var Nve=Object.defineProperty;var z$=e=>{throw TypeError(e)};var jve=(e,t,n)=>t in e?Nve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var dn=(e,t,n)=>jve(e,typeof t!="symbol"?t+"":t,n),$T=(e,t,n)=>t.has(e)||z$("Cannot "+n);var fe=(e,t,n)=>($T(e,t,"read from private field"),n?n.call(e):t.get(e)),Ot=(e,t,n)=>t.has(e)?z$("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),nt=(e,t,n,r)=>($T(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),on=(e,t,n)=>($T(e,t,"access private method"),n);var kC=(e,t,n,r)=>({set _(i){nt(e,t,i,n)},get _(){return fe(e,t,r)}});function Tve(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 Fh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function En(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cee={exports:{}},jN={},uee={exports:{}},An={};/**
 * @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 t2=Symbol.for("react.element"),Pve=Symbol.for("react.portal"),Ive=Symbol.for("react.fragment"),Ove=Symbol.for("react.strict_mode"),Fve=Symbol.for("react.profiler"),Mve=Symbol.for("react.provider"),Lve=Symbol.for("react.context"),Rve=Symbol.for("react.forward_ref"),Uve=Symbol.for("react.suspense"),Dve=Symbol.for("react.memo"),Qve=Symbol.for("react.lazy"),V$=Symbol.iterator;function Hve(e){return e===null||typeof e!="object"?null:(e=V$&&e[V$]||e["@@iterator"],typeof e=="function"?e:null)}var dee={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},hee=Object.assign,Aee={};function D0(e,t,n){this.props=e,this.context=t,this.refs=Aee,this.updater=n||dee}D0.prototype.isReactComponent={};D0.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")};D0.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function fee(){}fee.prototype=D0.prototype;function LR(e,t,n){this.props=e,this.context=t,this.refs=Aee,this.updater=n||dee}var RR=LR.prototype=new fee;RR.constructor=LR;hee(RR,D0.prototype);RR.isPureReactComponent=!0;var K$=Array.isArray,pee=Object.prototype.hasOwnProperty,UR={current:null},mee={key:!0,ref:!0,__self:!0,__source:!0};function gee(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)&&!mee.hasOwnProperty(r)&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var l=Array(o),u=0;u<o;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return{$$typeof:t2,type:e,key:s,ref:a,props:i,_owner:UR.current}}function $ve(e,t){return{$$typeof:t2,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function DR(e){return typeof e=="object"&&e!==null&&e.$$typeof===t2}function zve(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var q$=/\/+/g;function zT(e,t){return typeof e=="object"&&e!==null&&e.key!=null?zve(""+e.key):t.toString(36)}function bk(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 t2:case Pve:a=!0}}if(a)return a=e,i=i(a),e=r===""?"."+zT(a,0):r,K$(i)?(n="",e!=null&&(n=e.replace(q$,"$&/")+"/"),bk(i,t,n,"",function(u){return u})):i!=null&&(DR(i)&&(i=$ve(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(q$,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=r===""?".":r+":",K$(e))for(var o=0;o<e.length;o++){s=e[o];var l=r+zT(s,o);a+=bk(s,t,n,l,i)}else if(l=Hve(e),typeof l=="function")for(e=l.call(e),o=0;!(s=e.next()).done;)s=s.value,l=r+zT(s,o++),a+=bk(s,t,n,l,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 BC(e,t,n){if(e==null)return e;var r=[],i=0;return bk(e,r,"","",function(s){return t.call(n,s,i++)}),r}function Vve(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 xa={current:null},Ck={transition:null},Kve={ReactCurrentDispatcher:xa,ReactCurrentBatchConfig:Ck,ReactCurrentOwner:UR};function yee(){throw Error("act(...) is not supported in production builds of React.")}An.Children={map:BC,forEach:function(e,t,n){BC(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return BC(e,function(){t++}),t},toArray:function(e){return BC(e,function(t){return t})||[]},only:function(e){if(!DR(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};An.Component=D0;An.Fragment=Ive;An.Profiler=Fve;An.PureComponent=LR;An.StrictMode=Ove;An.Suspense=Uve;An.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Kve;An.act=yee;An.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=hee({},e.props),i=e.key,s=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,a=UR.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(l in t)pee.call(t,l)&&!mee.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&o!==void 0?o[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){o=Array(l);for(var u=0;u<l;u++)o[u]=arguments[u+2];r.children=o}return{$$typeof:t2,type:e.type,key:i,ref:s,props:r,_owner:a}};An.createContext=function(e){return e={$$typeof:Lve,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Mve,_context:e},e.Consumer=e};An.createElement=gee;An.createFactory=function(e){var t=gee.bind(null,e);return t.type=e,t};An.createRef=function(){return{current:null}};An.forwardRef=function(e){return{$$typeof:Rve,render:e}};An.isValidElement=DR;An.lazy=function(e){return{$$typeof:Qve,_payload:{_status:-1,_result:e},_init:Vve}};An.memo=function(e,t){return{$$typeof:Dve,type:e,compare:t===void 0?null:t}};An.startTransition=function(e){var t=Ck.transition;Ck.transition={};try{e()}finally{Ck.transition=t}};An.unstable_act=yee;An.useCallback=function(e,t){return xa.current.useCallback(e,t)};An.useContext=function(e){return xa.current.useContext(e)};An.useDebugValue=function(){};An.useDeferredValue=function(e){return xa.current.useDeferredValue(e)};An.useEffect=function(e,t){return xa.current.useEffect(e,t)};An.useId=function(){return xa.current.useId()};An.useImperativeHandle=function(e,t,n){return xa.current.useImperativeHandle(e,t,n)};An.useInsertionEffect=function(e,t){return xa.current.useInsertionEffect(e,t)};An.useLayoutEffect=function(e,t){return xa.current.useLayoutEffect(e,t)};An.useMemo=function(e,t){return xa.current.useMemo(e,t)};An.useReducer=function(e,t,n){return xa.current.useReducer(e,t,n)};An.useRef=function(e){return xa.current.useRef(e)};An.useState=function(e){return xa.current.useState(e)};An.useSyncExternalStore=function(e,t,n){return xa.current.useSyncExternalStore(e,t,n)};An.useTransition=function(){return xa.current.useTransition()};An.version="18.3.1";uee.exports=An;var k=uee.exports;const re=En(k),QR=Tve({__proto__:null,default:re},[k]);/**
 * @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 qve=k,Wve=Symbol.for("react.element"),Gve=Symbol.for("react.fragment"),Yve=Object.prototype.hasOwnProperty,Xve=qve.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Jve={key:!0,ref:!0,__self:!0,__source:!0};function vee(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)Yve.call(t,r)&&!Jve.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:Wve,type:e,key:s,ref:a,props:i,_owner:Xve.current}}jN.Fragment=Gve;jN.jsx=vee;jN.jsxs=vee;cee.exports=jN;var c=cee.exports,xee={exports:{}},Eo={},wee={exports:{}},bee={};/**
 * @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($,V){var Q=$.length;$.push(V);e:for(;0<Q;){var ce=Q-1>>>1,R=$[ce];if(0<i(R,V))$[ce]=V,$[Q]=R,Q=ce;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var V=$[0],Q=$.pop();if(Q!==V){$[0]=Q;e:for(var ce=0,R=$.length,M=R>>>1;ce<M;){var Y=2*(ce+1)-1,X=$[Y],K=Y+1,Z=$[K];if(0>i(X,Q))K<R&&0>i(Z,X)?($[ce]=Z,$[K]=Q,ce=K):($[ce]=X,$[Y]=Q,ce=Y);else if(K<R&&0>i(Z,Q))$[ce]=Z,$[K]=Q,ce=K;else break e}}return V}function i($,V){var Q=$.sortIndex-V.sortIndex;return Q!==0?Q:$.id-V.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 l=[],u=[],d=1,h=null,f=3,A=!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 V=n(u);V!==null;){if(V.callback===null)r(u);else if(V.startTime<=$)r(u),V.sortIndex=V.expirationTime,t(l,V);else break;V=n(u)}}function b($){if(m=!1,x($),!p)if(n(l)!==null)p=!0,H(w);else{var V=n(u);V!==null&&W(b,V.startTime-$)}}function w($,V){p=!1,m&&(m=!1,y(E),E=-1),A=!0;var Q=f;try{for(x(V),h=n(l);h!==null&&(!(h.expirationTime>V)||$&&!T());){var ce=h.callback;if(typeof ce=="function"){h.callback=null,f=h.priorityLevel;var R=ce(h.expirationTime<=V);V=e.unstable_now(),typeof R=="function"?h.callback=R:h===n(l)&&r(l),x(V)}else r(l);h=n(l)}if(h!==null)var M=!0;else{var Y=n(u);Y!==null&&W(b,Y.startTime-V),M=!1}return M}finally{h=null,f=Q,A=!1}}var S=!1,_=null,E=-1,j=5,I=-1;function T(){return!(e.unstable_now()-I<j)}function N(){if(_!==null){var $=e.unstable_now();I=$;var V=!0;try{V=_(!0,$)}finally{V?F():(S=!1,_=null)}}else S=!1}var F;if(typeof v=="function")F=function(){v(N)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,D=L.port2;L.port1.onmessage=N,F=function(){D.postMessage(null)}}else F=function(){g(N,0)};function H($){_=$,S||(S=!0,F())}function W($,V){E=g(function(){$(e.unstable_now())},V)}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||A||(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"):j=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function($){switch(f){case 1:case 2:case 3:var V=3;break;default:V=f}var Q=f;f=V;try{return $()}finally{f=Q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,V){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var Q=f;f=$;try{return V()}finally{f=Q}},e.unstable_scheduleCallback=function($,V,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:V,priorityLevel:$,startTime:Q,expirationTime:R,sortIndex:-1},Q>ce?($.sortIndex=Q,t(u,$),n(l)===null&&$===n(u)&&(m?(y(E),E=-1):m=!0,W(b,Q-ce))):($.sortIndex=R,t(l,$),p||A||(p=!0,H(w))),$},e.unstable_shouldYield=T,e.unstable_wrapCallback=function($){var V=f;return function(){var Q=f;f=V;try{return $.apply(this,arguments)}finally{f=Q}}}})(bee);wee.exports=bee;var Zve=wee.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 exe=k,ko=Zve;function Ke(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 Cee=new Set,nb={};function sm(e,t){zy(e,t),zy(e+"Capture",t)}function zy(e,t){for(nb[e]=t,e=0;e<t.length;e++)Cee.add(t[e])}var cd=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xO=Object.prototype.hasOwnProperty,txe=/^[: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]*$/,W$={},G$={};function nxe(e){return xO.call(G$,e)?!0:xO.call(W$,e)?!1:txe.test(e)?G$[e]=!0:(W$[e]=!0,!1)}function rxe(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 ixe(e,t,n,r){if(t===null||typeof t>"u"||rxe(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 wa(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 bs={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){bs[e]=new wa(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];bs[t]=new wa(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){bs[e]=new wa(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){bs[e]=new wa(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){bs[e]=new wa(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){bs[e]=new wa(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){bs[e]=new wa(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){bs[e]=new wa(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){bs[e]=new wa(e,5,!1,e.toLowerCase(),null,!1,!1)});var HR=/[\-:]([a-z])/g;function $R(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(HR,$R);bs[t]=new wa(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(HR,$R);bs[t]=new wa(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(HR,$R);bs[t]=new wa(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){bs[e]=new wa(e,1,!1,e.toLowerCase(),null,!1,!1)});bs.xlinkHref=new wa("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){bs[e]=new wa(e,1,!1,e.toLowerCase(),null,!0,!0)});function zR(e,t,n,r){var i=bs.hasOwnProperty(t)?bs[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(ixe(t,n,i,r)&&(n=null),r||i===null?nxe(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 bd=exe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,_C=Symbol.for("react.element"),Tg=Symbol.for("react.portal"),Pg=Symbol.for("react.fragment"),VR=Symbol.for("react.strict_mode"),wO=Symbol.for("react.profiler"),See=Symbol.for("react.provider"),kee=Symbol.for("react.context"),KR=Symbol.for("react.forward_ref"),bO=Symbol.for("react.suspense"),CO=Symbol.for("react.suspense_list"),qR=Symbol.for("react.memo"),uh=Symbol.for("react.lazy"),Bee=Symbol.for("react.offscreen"),Y$=Symbol.iterator;function Yv(e){return e===null||typeof e!="object"?null:(e=Y$&&e[Y$]||e["@@iterator"],typeof e=="function"?e:null)}var Rr=Object.assign,VT;function Lx(e){if(VT===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);VT=t&&t[1]||""}return`
`+VT+e}var KT=!1;function qT(e,t){if(!e||KT)return"";KT=!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 l=`
`+i[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=a&&0<=o);break}}}finally{KT=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Lx(e):""}function sxe(e){switch(e.tag){case 5:return Lx(e.type);case 16:return Lx("Lazy");case 13:return Lx("Suspense");case 19:return Lx("SuspenseList");case 0:case 2:case 15:return e=qT(e.type,!1),e;case 11:return e=qT(e.type.render,!1),e;case 1:return e=qT(e.type,!0),e;default:return""}}function SO(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 Pg:return"Fragment";case Tg:return"Portal";case wO:return"Profiler";case VR:return"StrictMode";case bO:return"Suspense";case CO:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case kee:return(e.displayName||"Context")+".Consumer";case See:return(e._context.displayName||"Context")+".Provider";case KR:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case qR:return t=e.displayName||null,t!==null?t:SO(e.type)||"Memo";case uh:t=e._payload,e=e._init;try{return SO(e(t))}catch{}}return null}function axe(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 SO(t);case 8:return t===VR?"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 vA(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _ee(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function oxe(e){var t=_ee(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 EC(e){e._valueTracker||(e._valueTracker=oxe(e))}function Eee(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=_ee(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function yB(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 kO(e,t){var n=t.checked;return Rr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function X$(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=vA(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 Nee(e,t){t=t.checked,t!=null&&zR(e,"checked",t,!1)}function BO(e,t){Nee(e,t);var n=vA(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")?_O(e,t.type,n):t.hasOwnProperty("defaultValue")&&_O(e,t.type,vA(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function J$(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 _O(e,t,n){(t!=="number"||yB(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Rx=Array.isArray;function ey(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=""+vA(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 EO(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Ke(91));return Rr({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Z$(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(Ke(92));if(Rx(n)){if(1<n.length)throw Error(Ke(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:vA(n)}}function jee(e,t){var n=vA(t.value),r=vA(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 e8(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Tee(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 NO(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Tee(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var NC,Pee=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(NC=NC||document.createElement("div"),NC.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=NC.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function rb(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var lw={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},lxe=["Webkit","ms","Moz","O"];Object.keys(lw).forEach(function(e){lxe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),lw[t]=lw[e]})});function Iee(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||lw.hasOwnProperty(e)&&lw[e]?(""+t).trim():t+"px"}function Oee(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Iee(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var cxe=Rr({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 jO(e,t){if(t){if(cxe[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Ke(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Ke(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Ke(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Ke(62))}}function TO(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 PO=null;function WR(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var IO=null,ty=null,ny=null;function t8(e){if(e=i2(e)){if(typeof IO!="function")throw Error(Ke(280));var t=e.stateNode;t&&(t=FN(t),IO(e.stateNode,e.type,t))}}function Fee(e){ty?ny?ny.push(e):ny=[e]:ty=e}function Mee(){if(ty){var e=ty,t=ny;if(ny=ty=null,t8(e),t)for(e=0;e<t.length;e++)t8(t[e])}}function Lee(e,t){return e(t)}function Ree(){}var WT=!1;function Uee(e,t,n){if(WT)return e(t,n);WT=!0;try{return Lee(e,t,n)}finally{WT=!1,(ty!==null||ny!==null)&&(Ree(),Mee())}}function ib(e,t){var n=e.stateNode;if(n===null)return null;var r=FN(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(Ke(231,t,typeof n));return n}var OO=!1;if(cd)try{var Xv={};Object.defineProperty(Xv,"passive",{get:function(){OO=!0}}),window.addEventListener("test",Xv,Xv),window.removeEventListener("test",Xv,Xv)}catch{OO=!1}function uxe(e,t,n,r,i,s,a,o,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var cw=!1,vB=null,xB=!1,FO=null,dxe={onError:function(e){cw=!0,vB=e}};function hxe(e,t,n,r,i,s,a,o,l){cw=!1,vB=null,uxe.apply(dxe,arguments)}function Axe(e,t,n,r,i,s,a,o,l){if(hxe.apply(this,arguments),cw){if(cw){var u=vB;cw=!1,vB=null}else throw Error(Ke(198));xB||(xB=!0,FO=u)}}function am(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 Dee(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 n8(e){if(am(e)!==e)throw Error(Ke(188))}function fxe(e){var t=e.alternate;if(!t){if(t=am(e),t===null)throw Error(Ke(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 n8(i),e;if(s===r)return n8(i),t;s=s.sibling}throw Error(Ke(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(Ke(189))}}if(n.alternate!==r)throw Error(Ke(190))}if(n.tag!==3)throw Error(Ke(188));return n.stateNode.current===n?e:t}function Qee(e){return e=fxe(e),e!==null?Hee(e):null}function Hee(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Hee(e);if(t!==null)return t;e=e.sibling}return null}var $ee=ko.unstable_scheduleCallback,r8=ko.unstable_cancelCallback,pxe=ko.unstable_shouldYield,mxe=ko.unstable_requestPaint,oi=ko.unstable_now,gxe=ko.unstable_getCurrentPriorityLevel,GR=ko.unstable_ImmediatePriority,zee=ko.unstable_UserBlockingPriority,wB=ko.unstable_NormalPriority,yxe=ko.unstable_LowPriority,Vee=ko.unstable_IdlePriority,TN=null,Yc=null;function vxe(e){if(Yc&&typeof Yc.onCommitFiberRoot=="function")try{Yc.onCommitFiberRoot(TN,e,void 0,(e.current.flags&128)===128)}catch{}}var ic=Math.clz32?Math.clz32:bxe,xxe=Math.log,wxe=Math.LN2;function bxe(e){return e>>>=0,e===0?32:31-(xxe(e)/wxe|0)|0}var jC=64,TC=4194304;function Ux(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 bB(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=Ux(o):(s&=a,s!==0&&(r=Ux(s)))}else a=n&~i,a!==0?r=Ux(a):s!==0&&(r=Ux(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-ic(t),i=1<<n,r|=e[n],t&=~i;return r}function Cxe(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 Sxe(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var a=31-ic(s),o=1<<a,l=i[a];l===-1?(!(o&n)||o&r)&&(i[a]=Cxe(o,t)):l<=t&&(e.expiredLanes|=o),s&=~o}}function MO(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Kee(){var e=jC;return jC<<=1,!(jC&4194240)&&(jC=64),e}function GT(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function n2(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ic(t),e[t]=n}function kxe(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-ic(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function YR(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ic(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Hn=0;function qee(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Wee,XR,Gee,Yee,Xee,LO=!1,PC=[],Gh=null,Yh=null,Xh=null,sb=new Map,ab=new Map,yh=[],Bxe="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 i8(e,t){switch(e){case"focusin":case"focusout":Gh=null;break;case"dragenter":case"dragleave":Yh=null;break;case"mouseover":case"mouseout":Xh=null;break;case"pointerover":case"pointerout":sb.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ab.delete(t.pointerId)}}function Jv(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=i2(t),t!==null&&XR(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function _xe(e,t,n,r,i){switch(t){case"focusin":return Gh=Jv(Gh,e,t,n,r,i),!0;case"dragenter":return Yh=Jv(Yh,e,t,n,r,i),!0;case"mouseover":return Xh=Jv(Xh,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return sb.set(s,Jv(sb.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,ab.set(s,Jv(ab.get(s)||null,e,t,n,r,i)),!0}return!1}function Jee(e){var t=Qf(e.target);if(t!==null){var n=am(t);if(n!==null){if(t=n.tag,t===13){if(t=Dee(n),t!==null){e.blockedOn=t,Xee(e.priority,function(){Gee(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 Sk(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=RO(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);PO=r,n.target.dispatchEvent(r),PO=null}else return t=i2(n),t!==null&&XR(t),e.blockedOn=n,!1;t.shift()}return!0}function s8(e,t,n){Sk(e)&&n.delete(t)}function Exe(){LO=!1,Gh!==null&&Sk(Gh)&&(Gh=null),Yh!==null&&Sk(Yh)&&(Yh=null),Xh!==null&&Sk(Xh)&&(Xh=null),sb.forEach(s8),ab.forEach(s8)}function Zv(e,t){e.blockedOn===t&&(e.blockedOn=null,LO||(LO=!0,ko.unstable_scheduleCallback(ko.unstable_NormalPriority,Exe)))}function ob(e){function t(i){return Zv(i,e)}if(0<PC.length){Zv(PC[0],e);for(var n=1;n<PC.length;n++){var r=PC[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Gh!==null&&Zv(Gh,e),Yh!==null&&Zv(Yh,e),Xh!==null&&Zv(Xh,e),sb.forEach(t),ab.forEach(t),n=0;n<yh.length;n++)r=yh[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<yh.length&&(n=yh[0],n.blockedOn===null);)Jee(n),n.blockedOn===null&&yh.shift()}var ry=bd.ReactCurrentBatchConfig,CB=!0;function Nxe(e,t,n,r){var i=Hn,s=ry.transition;ry.transition=null;try{Hn=1,JR(e,t,n,r)}finally{Hn=i,ry.transition=s}}function jxe(e,t,n,r){var i=Hn,s=ry.transition;ry.transition=null;try{Hn=4,JR(e,t,n,r)}finally{Hn=i,ry.transition=s}}function JR(e,t,n,r){if(CB){var i=RO(e,t,n,r);if(i===null)sP(e,t,r,SB,n),i8(e,r);else if(_xe(i,e,t,n,r))r.stopPropagation();else if(i8(e,r),t&4&&-1<Bxe.indexOf(e)){for(;i!==null;){var s=i2(i);if(s!==null&&Wee(s),s=RO(e,t,n,r),s===null&&sP(e,t,r,SB,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else sP(e,t,r,null,n)}}var SB=null;function RO(e,t,n,r){if(SB=null,e=WR(r),e=Qf(e),e!==null)if(t=am(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Dee(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 SB=e,null}function Zee(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(gxe()){case GR:return 1;case zee:return 4;case wB:case yxe:return 16;case Vee:return 536870912;default:return 16}default:return 16}}var Mh=null,ZR=null,kk=null;function ete(){if(kk)return kk;var e,t=ZR,n=t.length,r,i="value"in Mh?Mh.value:Mh.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 kk=i.slice(e,1<r?1-r:void 0)}function Bk(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 IC(){return!0}function a8(){return!1}function No(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)?IC:a8,this.isPropagationStopped=a8,this}return Rr(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=IC)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=IC)},persist:function(){},isPersistent:IC}),t}var Q0={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},eU=No(Q0),r2=Rr({},Q0,{view:0,detail:0}),Txe=No(r2),YT,XT,ex,PN=Rr({},r2,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tU,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!==ex&&(ex&&e.type==="mousemove"?(YT=e.screenX-ex.screenX,XT=e.screenY-ex.screenY):XT=YT=0,ex=e),YT)},movementY:function(e){return"movementY"in e?e.movementY:XT}}),o8=No(PN),Pxe=Rr({},PN,{dataTransfer:0}),Ixe=No(Pxe),Oxe=Rr({},r2,{relatedTarget:0}),JT=No(Oxe),Fxe=Rr({},Q0,{animationName:0,elapsedTime:0,pseudoElement:0}),Mxe=No(Fxe),Lxe=Rr({},Q0,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Rxe=No(Lxe),Uxe=Rr({},Q0,{data:0}),l8=No(Uxe),Dxe={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qxe={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"},Hxe={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $xe(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Hxe[e])?!!t[e]:!1}function tU(){return $xe}var zxe=Rr({},r2,{key:function(e){if(e.key){var t=Dxe[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Bk(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Qxe[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tU,charCode:function(e){return e.type==="keypress"?Bk(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Bk(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Vxe=No(zxe),Kxe=Rr({},PN,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),c8=No(Kxe),qxe=Rr({},r2,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tU}),Wxe=No(qxe),Gxe=Rr({},Q0,{propertyName:0,elapsedTime:0,pseudoElement:0}),Yxe=No(Gxe),Xxe=Rr({},PN,{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}),Jxe=No(Xxe),Zxe=[9,13,27,32],nU=cd&&"CompositionEvent"in window,uw=null;cd&&"documentMode"in document&&(uw=document.documentMode);var ewe=cd&&"TextEvent"in window&&!uw,tte=cd&&(!nU||uw&&8<uw&&11>=uw),u8=" ",d8=!1;function nte(e,t){switch(e){case"keyup":return Zxe.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rte(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ig=!1;function twe(e,t){switch(e){case"compositionend":return rte(t);case"keypress":return t.which!==32?null:(d8=!0,u8);case"textInput":return e=t.data,e===u8&&d8?null:e;default:return null}}function nwe(e,t){if(Ig)return e==="compositionend"||!nU&&nte(e,t)?(e=ete(),kk=ZR=Mh=null,Ig=!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 tte&&t.locale!=="ko"?null:t.data;default:return null}}var rwe={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 h8(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!rwe[e.type]:t==="textarea"}function ite(e,t,n,r){Fee(r),t=kB(t,"onChange"),0<t.length&&(n=new eU("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var dw=null,lb=null;function iwe(e){pte(e,0)}function IN(e){var t=Mg(e);if(Eee(t))return e}function swe(e,t){if(e==="change")return t}var ste=!1;if(cd){var ZT;if(cd){var eP="oninput"in document;if(!eP){var A8=document.createElement("div");A8.setAttribute("oninput","return;"),eP=typeof A8.oninput=="function"}ZT=eP}else ZT=!1;ste=ZT&&(!document.documentMode||9<document.documentMode)}function f8(){dw&&(dw.detachEvent("onpropertychange",ate),lb=dw=null)}function ate(e){if(e.propertyName==="value"&&IN(lb)){var t=[];ite(t,lb,e,WR(e)),Uee(iwe,t)}}function awe(e,t,n){e==="focusin"?(f8(),dw=t,lb=n,dw.attachEvent("onpropertychange",ate)):e==="focusout"&&f8()}function owe(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return IN(lb)}function lwe(e,t){if(e==="click")return IN(t)}function cwe(e,t){if(e==="input"||e==="change")return IN(t)}function uwe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var uc=typeof Object.is=="function"?Object.is:uwe;function cb(e,t){if(uc(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(!xO.call(t,i)||!uc(e[i],t[i]))return!1}return!0}function p8(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function m8(e,t){var n=p8(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=p8(n)}}function ote(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ote(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function lte(){for(var e=window,t=yB();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=yB(e.document)}return t}function rU(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 dwe(e){var t=lte(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ote(n.ownerDocument.documentElement,n)){if(r!==null&&rU(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=m8(n,s);var a=m8(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 hwe=cd&&"documentMode"in document&&11>=document.documentMode,Og=null,UO=null,hw=null,DO=!1;function g8(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;DO||Og==null||Og!==yB(r)||(r=Og,"selectionStart"in r&&rU(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}),hw&&cb(hw,r)||(hw=r,r=kB(UO,"onSelect"),0<r.length&&(t=new eU("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Og)))}function OC(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Fg={animationend:OC("Animation","AnimationEnd"),animationiteration:OC("Animation","AnimationIteration"),animationstart:OC("Animation","AnimationStart"),transitionend:OC("Transition","TransitionEnd")},tP={},cte={};cd&&(cte=document.createElement("div").style,"AnimationEvent"in window||(delete Fg.animationend.animation,delete Fg.animationiteration.animation,delete Fg.animationstart.animation),"TransitionEvent"in window||delete Fg.transitionend.transition);function ON(e){if(tP[e])return tP[e];if(!Fg[e])return e;var t=Fg[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in cte)return tP[e]=t[n];return e}var ute=ON("animationend"),dte=ON("animationiteration"),hte=ON("animationstart"),Ate=ON("transitionend"),fte=new Map,y8="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 OA(e,t){fte.set(e,t),sm(t,[e])}for(var nP=0;nP<y8.length;nP++){var rP=y8[nP],Awe=rP.toLowerCase(),fwe=rP[0].toUpperCase()+rP.slice(1);OA(Awe,"on"+fwe)}OA(ute,"onAnimationEnd");OA(dte,"onAnimationIteration");OA(hte,"onAnimationStart");OA("dblclick","onDoubleClick");OA("focusin","onFocus");OA("focusout","onBlur");OA(Ate,"onTransitionEnd");zy("onMouseEnter",["mouseout","mouseover"]);zy("onMouseLeave",["mouseout","mouseover"]);zy("onPointerEnter",["pointerout","pointerover"]);zy("onPointerLeave",["pointerout","pointerover"]);sm("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));sm("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));sm("onBeforeInput",["compositionend","keypress","textInput","paste"]);sm("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));sm("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));sm("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Dx="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(" "),pwe=new Set("cancel close invalid load scroll toggle".split(" ").concat(Dx));function v8(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Axe(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],l=o.instance,u=o.currentTarget;if(o=o.listener,l!==s&&i.isPropagationStopped())break e;v8(i,o,u),s=l}else for(a=0;a<r.length;a++){if(o=r[a],l=o.instance,u=o.currentTarget,o=o.listener,l!==s&&i.isPropagationStopped())break e;v8(i,o,u),s=l}}}if(xB)throw e=FO,xB=!1,FO=null,e}function pr(e,t){var n=t[VO];n===void 0&&(n=t[VO]=new Set);var r=e+"__bubble";n.has(r)||(mte(t,e,2,!1),n.add(r))}function iP(e,t,n){var r=0;t&&(r|=4),mte(n,e,r,t)}var FC="_reactListening"+Math.random().toString(36).slice(2);function ub(e){if(!e[FC]){e[FC]=!0,Cee.forEach(function(n){n!=="selectionchange"&&(pwe.has(n)||iP(n,!1,e),iP(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[FC]||(t[FC]=!0,iP("selectionchange",!1,t))}}function mte(e,t,n,r){switch(Zee(t)){case 1:var i=Nxe;break;case 4:i=jxe;break;default:i=JR}n=i.bind(null,t,n,e),i=void 0,!OO||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 sP(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 l=a.tag;if((l===3||l===4)&&(l=a.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;a=a.return}for(;o!==null;){if(a=Qf(o),a===null)return;if(l=a.tag,l===5||l===6){r=s=a;continue e}o=o.parentNode}}r=r.return}Uee(function(){var u=s,d=WR(n),h=[];e:{var f=fte.get(e);if(f!==void 0){var A=eU,p=e;switch(e){case"keypress":if(Bk(n)===0)break e;case"keydown":case"keyup":A=Vxe;break;case"focusin":p="focus",A=JT;break;case"focusout":p="blur",A=JT;break;case"beforeblur":case"afterblur":A=JT;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":A=o8;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":A=Ixe;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":A=Wxe;break;case ute:case dte:case hte:A=Mxe;break;case Ate:A=Yxe;break;case"scroll":A=Txe;break;case"wheel":A=Jxe;break;case"copy":case"cut":case"paste":A=Rxe;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":A=c8}var m=(t&4)!==0,g=!m&&e==="scroll",y=m?f!==null?f+"Capture":null:f;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=ib(v,y),b!=null&&m.push(db(v,b,x)))),g)break;v=v.return}0<m.length&&(f=new A(f,p,null,n,d),h.push({event:f,listeners:m}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",A=e==="mouseout"||e==="pointerout",f&&n!==PO&&(p=n.relatedTarget||n.fromElement)&&(Qf(p)||p[ud]))break e;if((A||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,A?(p=n.relatedTarget||n.toElement,A=u,p=p?Qf(p):null,p!==null&&(g=am(p),p!==g||p.tag!==5&&p.tag!==6)&&(p=null)):(A=null,p=u),A!==p)){if(m=o8,b="onMouseLeave",y="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(m=c8,b="onPointerLeave",y="onPointerEnter",v="pointer"),g=A==null?f:Mg(A),x=p==null?f:Mg(p),f=new m(b,v+"leave",A,n,d),f.target=g,f.relatedTarget=x,b=null,Qf(d)===u&&(m=new m(y,v+"enter",p,n,d),m.target=x,m.relatedTarget=g,b=m),g=b,A&&p)t:{for(m=A,y=p,v=0,x=m;x;x=Hm(x))v++;for(x=0,b=y;b;b=Hm(b))x++;for(;0<v-x;)m=Hm(m),v--;for(;0<x-v;)y=Hm(y),x--;for(;v--;){if(m===y||y!==null&&m===y.alternate)break t;m=Hm(m),y=Hm(y)}m=null}else m=null;A!==null&&x8(h,f,A,m,!1),p!==null&&g!==null&&x8(h,g,p,m,!0)}}e:{if(f=u?Mg(u):window,A=f.nodeName&&f.nodeName.toLowerCase(),A==="select"||A==="input"&&f.type==="file")var w=swe;else if(h8(f))if(ste)w=cwe;else{w=owe;var S=awe}else(A=f.nodeName)&&A.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(w=lwe);if(w&&(w=w(e,u))){ite(h,w,n,d);break e}S&&S(e,f,u),e==="focusout"&&(S=f._wrapperState)&&S.controlled&&f.type==="number"&&_O(f,"number",f.value)}switch(S=u?Mg(u):window,e){case"focusin":(h8(S)||S.contentEditable==="true")&&(Og=S,UO=u,hw=null);break;case"focusout":hw=UO=Og=null;break;case"mousedown":DO=!0;break;case"contextmenu":case"mouseup":case"dragend":DO=!1,g8(h,n,d);break;case"selectionchange":if(hwe)break;case"keydown":case"keyup":g8(h,n,d)}var _;if(nU)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Ig?nte(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(tte&&n.locale!=="ko"&&(Ig||E!=="onCompositionStart"?E==="onCompositionEnd"&&Ig&&(_=ete()):(Mh=d,ZR="value"in Mh?Mh.value:Mh.textContent,Ig=!0)),S=kB(u,E),0<S.length&&(E=new l8(E,e,null,n,d),h.push({event:E,listeners:S}),_?E.data=_:(_=rte(n),_!==null&&(E.data=_)))),(_=ewe?twe(e,n):nwe(e,n))&&(u=kB(u,"onBeforeInput"),0<u.length&&(d=new l8("onBeforeInput","beforeinput",null,n,d),h.push({event:d,listeners:u}),d.data=_))}pte(h,t)})}function db(e,t,n){return{instance:e,listener:t,currentTarget:n}}function kB(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=ib(e,n),s!=null&&r.unshift(db(e,s,i)),s=ib(e,t),s!=null&&r.push(db(e,s,i))),e=e.return}return r}function Hm(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function x8(e,t,n,r,i){for(var s=t._reactName,a=[];n!==null&&n!==r;){var o=n,l=o.alternate,u=o.stateNode;if(l!==null&&l===r)break;o.tag===5&&u!==null&&(o=u,i?(l=ib(n,s),l!=null&&a.unshift(db(n,l,o))):i||(l=ib(n,s),l!=null&&a.push(db(n,l,o)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var mwe=/\r\n?/g,gwe=/\u0000|\uFFFD/g;function w8(e){return(typeof e=="string"?e:""+e).replace(mwe,`
`).replace(gwe,"")}function MC(e,t,n){if(t=w8(t),w8(e)!==t&&n)throw Error(Ke(425))}function BB(){}var QO=null,HO=null;function $O(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 zO=typeof setTimeout=="function"?setTimeout:void 0,ywe=typeof clearTimeout=="function"?clearTimeout:void 0,b8=typeof Promise=="function"?Promise:void 0,vwe=typeof queueMicrotask=="function"?queueMicrotask:typeof b8<"u"?function(e){return b8.resolve(null).then(e).catch(xwe)}:zO;function xwe(e){setTimeout(function(){throw e})}function aP(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),ob(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);ob(t)}function Jh(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 C8(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 H0=Math.random().toString(36).slice(2),Hc="__reactFiber$"+H0,hb="__reactProps$"+H0,ud="__reactContainer$"+H0,VO="__reactEvents$"+H0,wwe="__reactListeners$"+H0,bwe="__reactHandles$"+H0;function Qf(e){var t=e[Hc];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ud]||n[Hc]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=C8(e);e!==null;){if(n=e[Hc])return n;e=C8(e)}return t}e=n,n=e.parentNode}return null}function i2(e){return e=e[Hc]||e[ud],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Mg(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Ke(33))}function FN(e){return e[hb]||null}var KO=[],Lg=-1;function FA(e){return{current:e}}function br(e){0>Lg||(e.current=KO[Lg],KO[Lg]=null,Lg--)}function lr(e,t){Lg++,KO[Lg]=e.current,e.current=t}var xA={},Vs=FA(xA),$a=FA(!1),jp=xA;function Vy(e,t){var n=e.type.contextTypes;if(!n)return xA;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 za(e){return e=e.childContextTypes,e!=null}function _B(){br($a),br(Vs)}function S8(e,t,n){if(Vs.current!==xA)throw Error(Ke(168));lr(Vs,t),lr($a,n)}function gte(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(Ke(108,axe(e)||"Unknown",i));return Rr({},n,r)}function EB(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||xA,jp=Vs.current,lr(Vs,e),lr($a,$a.current),!0}function k8(e,t,n){var r=e.stateNode;if(!r)throw Error(Ke(169));n?(e=gte(e,t,jp),r.__reactInternalMemoizedMergedChildContext=e,br($a),br(Vs),lr(Vs,e)):br($a),lr($a,n)}var zu=null,MN=!1,oP=!1;function yte(e){zu===null?zu=[e]:zu.push(e)}function Cwe(e){MN=!0,yte(e)}function MA(){if(!oP&&zu!==null){oP=!0;var e=0,t=Hn;try{var n=zu;for(Hn=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}zu=null,MN=!1}catch(i){throw zu!==null&&(zu=zu.slice(e+1)),$ee(GR,MA),i}finally{Hn=t,oP=!1}}return null}var Rg=[],Ug=0,NB=null,jB=0,Yo=[],Xo=0,Tp=null,Gu=1,Yu="";function Bf(e,t){Rg[Ug++]=jB,Rg[Ug++]=NB,NB=e,jB=t}function vte(e,t,n){Yo[Xo++]=Gu,Yo[Xo++]=Yu,Yo[Xo++]=Tp,Tp=e;var r=Gu;e=Yu;var i=32-ic(r)-1;r&=~(1<<i),n+=1;var s=32-ic(t)+i;if(30<s){var a=i-i%5;s=(r&(1<<a)-1).toString(32),r>>=a,i-=a,Gu=1<<32-ic(t)+i|n<<i|r,Yu=s+e}else Gu=1<<s|n<<i|r,Yu=e}function iU(e){e.return!==null&&(Bf(e,1),vte(e,1,0))}function sU(e){for(;e===NB;)NB=Rg[--Ug],Rg[Ug]=null,jB=Rg[--Ug],Rg[Ug]=null;for(;e===Tp;)Tp=Yo[--Xo],Yo[Xo]=null,Yu=Yo[--Xo],Yo[Xo]=null,Gu=Yo[--Xo],Yo[Xo]=null}var bo=null,vo=null,Er=!1,ql=null;function xte(e,t){var n=nl(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 B8(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,bo=e,vo=Jh(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,bo=e,vo=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Tp!==null?{id:Gu,overflow:Yu}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=nl(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,bo=e,vo=null,!0):!1;default:return!1}}function qO(e){return(e.mode&1)!==0&&(e.flags&128)===0}function WO(e){if(Er){var t=vo;if(t){var n=t;if(!B8(e,t)){if(qO(e))throw Error(Ke(418));t=Jh(n.nextSibling);var r=bo;t&&B8(e,t)?xte(r,n):(e.flags=e.flags&-4097|2,Er=!1,bo=e)}}else{if(qO(e))throw Error(Ke(418));e.flags=e.flags&-4097|2,Er=!1,bo=e}}}function _8(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;bo=e}function LC(e){if(e!==bo)return!1;if(!Er)return _8(e),Er=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!$O(e.type,e.memoizedProps)),t&&(t=vo)){if(qO(e))throw wte(),Error(Ke(418));for(;t;)xte(e,t),t=Jh(t.nextSibling)}if(_8(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Ke(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){vo=Jh(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}vo=null}}else vo=bo?Jh(e.stateNode.nextSibling):null;return!0}function wte(){for(var e=vo;e;)e=Jh(e.nextSibling)}function Ky(){vo=bo=null,Er=!1}function aU(e){ql===null?ql=[e]:ql.push(e)}var Swe=bd.ReactCurrentBatchConfig;function tx(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(Ke(309));var r=n.stateNode}if(!r)throw Error(Ke(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(Ke(284));if(!n._owner)throw Error(Ke(290,e))}return e}function RC(e,t){throw e=Object.prototype.toString.call(t),Error(Ke(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function E8(e){var t=e._init;return t(e._payload)}function bte(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=nA(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=fP(x,y.mode,b),v.return=y,v):(v=i(v,x),v.return=y,v)}function l(y,v,x,b){var w=x.type;return w===Pg?d(y,v,x.props.children,b,x.key):v!==null&&(v.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===uh&&E8(w)===v.type)?(b=i(v,x.props),b.ref=tx(y,v,x),b.return=y,b):(b=Ik(x.type,x.key,x.props,null,y.mode,b),b.ref=tx(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=pP(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=mp(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=fP(""+v,y.mode,x),v.return=y,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case _C:return x=Ik(v.type,v.key,v.props,null,y.mode,x),x.ref=tx(y,null,v),x.return=y,x;case Tg:return v=pP(v,y.mode,x),v.return=y,v;case uh:var b=v._init;return h(y,b(v._payload),x)}if(Rx(v)||Yv(v))return v=mp(v,y.mode,x,null),v.return=y,v;RC(y,v)}return null}function f(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 _C:return x.key===w?l(y,v,x,b):null;case Tg:return x.key===w?u(y,v,x,b):null;case uh:return w=x._init,f(y,v,w(x._payload),b)}if(Rx(x)||Yv(x))return w!==null?null:d(y,v,x,b,null);RC(y,x)}return null}function A(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 _C:return y=y.get(b.key===null?x:b.key)||null,l(v,y,b,w);case Tg:return y=y.get(b.key===null?x:b.key)||null,u(v,y,b,w);case uh:var S=b._init;return A(y,v,x,S(b._payload),w)}if(Rx(b)||Yv(b))return y=y.get(x)||null,d(v,y,b,w,null);RC(v,b)}return null}function p(y,v,x,b){for(var w=null,S=null,_=v,E=v=0,j=null;_!==null&&E<x.length;E++){_.index>E?(j=_,_=null):j=_.sibling;var I=f(y,_,x[E],b);if(I===null){_===null&&(_=j);break}e&&_&&I.alternate===null&&t(y,_),v=s(I,v,E),S===null?w=I:S.sibling=I,S=I,_=j}if(E===x.length)return n(y,_),Er&&Bf(y,E),w;if(_===null){for(;E<x.length;E++)_=h(y,x[E],b),_!==null&&(v=s(_,v,E),S===null?w=_:S.sibling=_,S=_);return Er&&Bf(y,E),w}for(_=r(y,_);E<x.length;E++)j=A(_,y,E,x[E],b),j!==null&&(e&&j.alternate!==null&&_.delete(j.key===null?E:j.key),v=s(j,v,E),S===null?w=j:S.sibling=j,S=j);return e&&_.forEach(function(T){return t(y,T)}),Er&&Bf(y,E),w}function m(y,v,x,b){var w=Yv(x);if(typeof w!="function")throw Error(Ke(150));if(x=w.call(x),x==null)throw Error(Ke(151));for(var S=w=null,_=v,E=v=0,j=null,I=x.next();_!==null&&!I.done;E++,I=x.next()){_.index>E?(j=_,_=null):j=_.sibling;var T=f(y,_,I.value,b);if(T===null){_===null&&(_=j);break}e&&_&&T.alternate===null&&t(y,_),v=s(T,v,E),S===null?w=T:S.sibling=T,S=T,_=j}if(I.done)return n(y,_),Er&&Bf(y,E),w;if(_===null){for(;!I.done;E++,I=x.next())I=h(y,I.value,b),I!==null&&(v=s(I,v,E),S===null?w=I:S.sibling=I,S=I);return Er&&Bf(y,E),w}for(_=r(y,_);!I.done;E++,I=x.next())I=A(_,y,E,I.value,b),I!==null&&(e&&I.alternate!==null&&_.delete(I.key===null?E:I.key),v=s(I,v,E),S===null?w=I:S.sibling=I,S=I);return e&&_.forEach(function(N){return t(y,N)}),Er&&Bf(y,E),w}function g(y,v,x,b){if(typeof x=="object"&&x!==null&&x.type===Pg&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case _C:e:{for(var w=x.key,S=v;S!==null;){if(S.key===w){if(w=x.type,w===Pg){if(S.tag===7){n(y,S.sibling),v=i(S,x.props.children),v.return=y,y=v;break e}}else if(S.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===uh&&E8(w)===S.type){n(y,S.sibling),v=i(S,x.props),v.ref=tx(y,S,x),v.return=y,y=v;break e}n(y,S);break}else t(y,S);S=S.sibling}x.type===Pg?(v=mp(x.props.children,y.mode,b,x.key),v.return=y,y=v):(b=Ik(x.type,x.key,x.props,null,y.mode,b),b.ref=tx(y,v,x),b.return=y,y=b)}return a(y);case Tg:e:{for(S=x.key;v!==null;){if(v.key===S)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=pP(x,y.mode,b),v.return=y,y=v}return a(y);case uh:return S=x._init,g(y,v,S(x._payload),b)}if(Rx(x))return p(y,v,x,b);if(Yv(x))return m(y,v,x,b);RC(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=fP(x,y.mode,b),v.return=y,y=v),a(y)):n(y,v)}return g}var qy=bte(!0),Cte=bte(!1),TB=FA(null),PB=null,Dg=null,oU=null;function lU(){oU=Dg=PB=null}function cU(e){var t=TB.current;br(TB),e._currentValue=t}function GO(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 iy(e,t){PB=e,oU=Dg=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Fa=!0),e.firstContext=null)}function ml(e){var t=e._currentValue;if(oU!==e)if(e={context:e,memoizedValue:t,next:null},Dg===null){if(PB===null)throw Error(Ke(308));Dg=e,PB.dependencies={lanes:0,firstContext:e}}else Dg=Dg.next=e;return t}var Hf=null;function uU(e){Hf===null?Hf=[e]:Hf.push(e)}function Ste(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,uU(t)):(n.next=i.next,i.next=n),t.interleaved=n,dd(e,r)}function dd(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 dh=!1;function dU(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function kte(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 td(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Zh(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,jn&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,dd(e,n)}return i=r.interleaved,i===null?(t.next=t,uU(r)):(t.next=i.next,i.next=t),r.interleaved=t,dd(e,n)}function _k(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,YR(e,n)}}function N8(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 IB(e,t,n,r){var i=e.updateQueue;dh=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,u=l.next;l.next=null,a===null?s=u:a.next=u,a=l;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=l))}if(s!==null){var h=i.baseState;a=0,d=u=l=null,o=s;do{var f=o.lane,A=o.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:A,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var p=e,m=o;switch(f=t,A=n,m.tag){case 1:if(p=m.payload,typeof p=="function"){h=p.call(A,h,f);break e}h=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=m.payload,f=typeof p=="function"?p.call(A,h,f):p,f==null)break e;h=Rr({},h,f);break e;case 2:dh=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[o]:f.push(o))}else A={eventTime:A,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=A,l=h):d=d.next=A,a|=f;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;f=o,o=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(d===null&&(l=h),i.baseState=l,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);Ip|=a,e.lanes=a,e.memoizedState=h}}function j8(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(Ke(191,i));i.call(r)}}}var s2={},Xc=FA(s2),Ab=FA(s2),fb=FA(s2);function $f(e){if(e===s2)throw Error(Ke(174));return e}function hU(e,t){switch(lr(fb,t),lr(Ab,e),lr(Xc,s2),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:NO(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=NO(t,e)}br(Xc),lr(Xc,t)}function Wy(){br(Xc),br(Ab),br(fb)}function Bte(e){$f(fb.current);var t=$f(Xc.current),n=NO(t,e.type);t!==n&&(lr(Ab,e),lr(Xc,n))}function AU(e){Ab.current===e&&(br(Xc),br(Ab))}var Or=FA(0);function OB(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 lP=[];function fU(){for(var e=0;e<lP.length;e++)lP[e]._workInProgressVersionPrimary=null;lP.length=0}var Ek=bd.ReactCurrentDispatcher,cP=bd.ReactCurrentBatchConfig,Pp=0,Lr=null,Ii=null,qi=null,FB=!1,Aw=!1,pb=0,kwe=0;function Es(){throw Error(Ke(321))}function pU(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!uc(e[n],t[n]))return!1;return!0}function mU(e,t,n,r,i,s){if(Pp=s,Lr=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ek.current=e===null||e.memoizedState===null?Nwe:jwe,e=n(r,i),Aw){s=0;do{if(Aw=!1,pb=0,25<=s)throw Error(Ke(301));s+=1,qi=Ii=null,t.updateQueue=null,Ek.current=Twe,e=n(r,i)}while(Aw)}if(Ek.current=MB,t=Ii!==null&&Ii.next!==null,Pp=0,qi=Ii=Lr=null,FB=!1,t)throw Error(Ke(300));return e}function gU(){var e=pb!==0;return pb=0,e}function Fc(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qi===null?Lr.memoizedState=qi=e:qi=qi.next=e,qi}function gl(){if(Ii===null){var e=Lr.alternate;e=e!==null?e.memoizedState:null}else e=Ii.next;var t=qi===null?Lr.memoizedState:qi.next;if(t!==null)qi=t,Ii=e;else{if(e===null)throw Error(Ke(310));Ii=e,e={memoizedState:Ii.memoizedState,baseState:Ii.baseState,baseQueue:Ii.baseQueue,queue:Ii.queue,next:null},qi===null?Lr.memoizedState=qi=e:qi=qi.next=e}return qi}function mb(e,t){return typeof t=="function"?t(e):t}function uP(e){var t=gl(),n=t.queue;if(n===null)throw Error(Ke(311));n.lastRenderedReducer=e;var r=Ii,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,l=null,u=s;do{var d=u.lane;if((Pp&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(o=l=h,a=r):l=l.next=h,Lr.lanes|=d,Ip|=d}u=u.next}while(u!==null&&u!==s);l===null?a=r:l.next=o,uc(r,t.memoizedState)||(Fa=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,Lr.lanes|=s,Ip|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function dP(e){var t=gl(),n=t.queue;if(n===null)throw Error(Ke(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);uc(s,t.memoizedState)||(Fa=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function _te(){}function Ete(e,t){var n=Lr,r=gl(),i=t(),s=!uc(r.memoizedState,i);if(s&&(r.memoizedState=i,Fa=!0),r=r.queue,yU(Tte.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||qi!==null&&qi.memoizedState.tag&1){if(n.flags|=2048,gb(9,jte.bind(null,n,r,i,t),void 0,null),Yi===null)throw Error(Ke(349));Pp&30||Nte(n,t,i)}return i}function Nte(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Lr.updateQueue,t===null?(t={lastEffect:null,stores:null},Lr.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function jte(e,t,n,r){t.value=n,t.getSnapshot=r,Pte(t)&&Ite(e)}function Tte(e,t,n){return n(function(){Pte(t)&&Ite(e)})}function Pte(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!uc(e,n)}catch{return!0}}function Ite(e){var t=dd(e,1);t!==null&&sc(t,e,1,-1)}function T8(e){var t=Fc();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:mb,lastRenderedState:e},t.queue=e,e=e.dispatch=Ewe.bind(null,Lr,e),[t.memoizedState,e]}function gb(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Lr.updateQueue,t===null?(t={lastEffect:null,stores:null},Lr.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 Ote(){return gl().memoizedState}function Nk(e,t,n,r){var i=Fc();Lr.flags|=e,i.memoizedState=gb(1|t,n,void 0,r===void 0?null:r)}function LN(e,t,n,r){var i=gl();r=r===void 0?null:r;var s=void 0;if(Ii!==null){var a=Ii.memoizedState;if(s=a.destroy,r!==null&&pU(r,a.deps)){i.memoizedState=gb(t,n,s,r);return}}Lr.flags|=e,i.memoizedState=gb(1|t,n,s,r)}function P8(e,t){return Nk(8390656,8,e,t)}function yU(e,t){return LN(2048,8,e,t)}function Fte(e,t){return LN(4,2,e,t)}function Mte(e,t){return LN(4,4,e,t)}function Lte(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 Rte(e,t,n){return n=n!=null?n.concat([e]):null,LN(4,4,Lte.bind(null,t,e),n)}function vU(){}function Ute(e,t){var n=gl();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&pU(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Dte(e,t){var n=gl();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&pU(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Qte(e,t,n){return Pp&21?(uc(n,t)||(n=Kee(),Lr.lanes|=n,Ip|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Fa=!0),e.memoizedState=n)}function Bwe(e,t){var n=Hn;Hn=n!==0&&4>n?n:4,e(!0);var r=cP.transition;cP.transition={};try{e(!1),t()}finally{Hn=n,cP.transition=r}}function Hte(){return gl().memoizedState}function _we(e,t,n){var r=tA(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},$te(e))zte(t,n);else if(n=Ste(e,t,n,r),n!==null){var i=ma();sc(n,e,r,i),Vte(n,t,r)}}function Ewe(e,t,n){var r=tA(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if($te(e))zte(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,uc(o,a)){var l=t.interleaved;l===null?(i.next=i,uU(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Ste(e,t,i,r),n!==null&&(i=ma(),sc(n,e,r,i),Vte(n,t,r))}}function $te(e){var t=e.alternate;return e===Lr||t!==null&&t===Lr}function zte(e,t){Aw=FB=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Vte(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,YR(e,n)}}var MB={readContext:ml,useCallback:Es,useContext:Es,useEffect:Es,useImperativeHandle:Es,useInsertionEffect:Es,useLayoutEffect:Es,useMemo:Es,useReducer:Es,useRef:Es,useState:Es,useDebugValue:Es,useDeferredValue:Es,useTransition:Es,useMutableSource:Es,useSyncExternalStore:Es,useId:Es,unstable_isNewReconciler:!1},Nwe={readContext:ml,useCallback:function(e,t){return Fc().memoizedState=[e,t===void 0?null:t],e},useContext:ml,useEffect:P8,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Nk(4194308,4,Lte.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Nk(4194308,4,e,t)},useInsertionEffect:function(e,t){return Nk(4,2,e,t)},useMemo:function(e,t){var n=Fc();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Fc();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=_we.bind(null,Lr,e),[r.memoizedState,e]},useRef:function(e){var t=Fc();return e={current:e},t.memoizedState=e},useState:T8,useDebugValue:vU,useDeferredValue:function(e){return Fc().memoizedState=e},useTransition:function(){var e=T8(!1),t=e[0];return e=Bwe.bind(null,e[1]),Fc().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Lr,i=Fc();if(Er){if(n===void 0)throw Error(Ke(407));n=n()}else{if(n=t(),Yi===null)throw Error(Ke(349));Pp&30||Nte(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,P8(Tte.bind(null,r,s,e),[e]),r.flags|=2048,gb(9,jte.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Fc(),t=Yi.identifierPrefix;if(Er){var n=Yu,r=Gu;n=(r&~(1<<32-ic(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=pb++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=kwe++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},jwe={readContext:ml,useCallback:Ute,useContext:ml,useEffect:yU,useImperativeHandle:Rte,useInsertionEffect:Fte,useLayoutEffect:Mte,useMemo:Dte,useReducer:uP,useRef:Ote,useState:function(){return uP(mb)},useDebugValue:vU,useDeferredValue:function(e){var t=gl();return Qte(t,Ii.memoizedState,e)},useTransition:function(){var e=uP(mb)[0],t=gl().memoizedState;return[e,t]},useMutableSource:_te,useSyncExternalStore:Ete,useId:Hte,unstable_isNewReconciler:!1},Twe={readContext:ml,useCallback:Ute,useContext:ml,useEffect:yU,useImperativeHandle:Rte,useInsertionEffect:Fte,useLayoutEffect:Mte,useMemo:Dte,useReducer:dP,useRef:Ote,useState:function(){return dP(mb)},useDebugValue:vU,useDeferredValue:function(e){var t=gl();return Ii===null?t.memoizedState=e:Qte(t,Ii.memoizedState,e)},useTransition:function(){var e=dP(mb)[0],t=gl().memoizedState;return[e,t]},useMutableSource:_te,useSyncExternalStore:Ete,useId:Hte,unstable_isNewReconciler:!1};function Dl(e,t){if(e&&e.defaultProps){t=Rr({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function YO(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Rr({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var RN={isMounted:function(e){return(e=e._reactInternals)?am(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ma(),i=tA(e),s=td(r,i);s.payload=t,n!=null&&(s.callback=n),t=Zh(e,s,i),t!==null&&(sc(t,e,i,r),_k(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ma(),i=tA(e),s=td(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Zh(e,s,i),t!==null&&(sc(t,e,i,r),_k(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ma(),r=tA(e),i=td(n,r);i.tag=2,t!=null&&(i.callback=t),t=Zh(e,i,r),t!==null&&(sc(t,e,r,n),_k(t,e,r))}};function I8(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?!cb(n,r)||!cb(i,s):!0}function Kte(e,t,n){var r=!1,i=xA,s=t.contextType;return typeof s=="object"&&s!==null?s=ml(s):(i=za(t)?jp:Vs.current,r=t.contextTypes,s=(r=r!=null)?Vy(e,i):xA),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=RN,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function O8(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&&RN.enqueueReplaceState(t,t.state,null)}function XO(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},dU(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=ml(s):(s=za(t)?jp:Vs.current,i.context=Vy(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(YO(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&&RN.enqueueReplaceState(i,i.state,null),IB(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Gy(e,t){try{var n="",r=t;do n+=sxe(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 hP(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function JO(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Pwe=typeof WeakMap=="function"?WeakMap:Map;function qte(e,t,n){n=td(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){RB||(RB=!0,l3=r),JO(e,t)},n}function Wte(e,t,n){n=td(-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(){JO(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){JO(e,t),typeof r!="function"&&(eA===null?eA=new Set([this]):eA.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function F8(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Pwe;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=Kwe.bind(null,e,t,n),t.then(e,e))}function M8(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 L8(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=td(-1,1),t.tag=2,Zh(n,t,1))),n.lanes|=1),e)}var Iwe=bd.ReactCurrentOwner,Fa=!1;function sa(e,t,n,r){t.child=e===null?Cte(t,null,n,r):qy(t,e.child,n,r)}function R8(e,t,n,r,i){n=n.render;var s=t.ref;return iy(t,i),r=mU(e,t,n,r,s,i),n=gU(),e!==null&&!Fa?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,hd(e,t,i)):(Er&&n&&iU(t),t.flags|=1,sa(e,t,r,i),t.child)}function U8(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!_U(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Gte(e,t,s,r,i)):(e=Ik(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:cb,n(a,r)&&e.ref===t.ref)return hd(e,t,i)}return t.flags|=1,e=nA(s,r),e.ref=t.ref,e.return=t,t.child=e}function Gte(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(cb(s,r)&&e.ref===t.ref)if(Fa=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(Fa=!0);else return t.lanes=e.lanes,hd(e,t,i)}return ZO(e,t,n,r,i)}function Yte(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},lr(Hg,fo),fo|=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,lr(Hg,fo),fo|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,lr(Hg,fo),fo|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,lr(Hg,fo),fo|=r;return sa(e,t,i,n),t.child}function Xte(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ZO(e,t,n,r,i){var s=za(n)?jp:Vs.current;return s=Vy(t,s),iy(t,i),n=mU(e,t,n,r,s,i),r=gU(),e!==null&&!Fa?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,hd(e,t,i)):(Er&&r&&iU(t),t.flags|=1,sa(e,t,n,i),t.child)}function D8(e,t,n,r,i){if(za(n)){var s=!0;EB(t)}else s=!1;if(iy(t,i),t.stateNode===null)jk(e,t),Kte(t,n,r),XO(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,o=t.memoizedProps;a.props=o;var l=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=ml(u):(u=za(n)?jp:Vs.current,u=Vy(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||l!==u)&&O8(t,a,r,u),dh=!1;var f=t.memoizedState;a.state=f,IB(t,r,a,i),l=t.memoizedState,o!==r||f!==l||$a.current||dh?(typeof d=="function"&&(YO(t,n,d,r),l=t.memoizedState),(o=dh||I8(t,n,o,r,f,l,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=l),a.props=r,a.state=l,a.context=u,r=o):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,kte(e,t),o=t.memoizedProps,u=t.type===t.elementType?o:Dl(t.type,o),a.props=u,h=t.pendingProps,f=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=ml(l):(l=za(n)?jp:Vs.current,l=Vy(t,l));var A=n.getDerivedStateFromProps;(d=typeof A=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==h||f!==l)&&O8(t,a,r,l),dh=!1,f=t.memoizedState,a.state=f,IB(t,r,a,i);var p=t.memoizedState;o!==h||f!==p||$a.current||dh?(typeof A=="function"&&(YO(t,n,A,r),p=t.memoizedState),(u=dh||I8(t,n,u,r,f,p,l)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,p,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,p,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=u):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return e3(e,t,n,r,s,i)}function e3(e,t,n,r,i,s){Xte(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&k8(t,n,!1),hd(e,t,s);r=t.stateNode,Iwe.current=t;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=qy(t,e.child,null,s),t.child=qy(t,null,o,s)):sa(e,t,o,s),t.memoizedState=r.state,i&&k8(t,n,!0),t.child}function Jte(e){var t=e.stateNode;t.pendingContext?S8(e,t.pendingContext,t.pendingContext!==t.context):t.context&&S8(e,t.context,!1),hU(e,t.containerInfo)}function Q8(e,t,n,r,i){return Ky(),aU(i),t.flags|=256,sa(e,t,n,r),t.child}var t3={dehydrated:null,treeContext:null,retryLane:0};function n3(e){return{baseLanes:e,cachePool:null,transitions:null}}function Zte(e,t,n){var r=t.pendingProps,i=Or.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),lr(Or,i&1),e===null)return WO(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=QN(a,r,0,null),e=mp(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=n3(n),t.memoizedState=t3,e):xU(t,a));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return Owe(e,t,a,r,o,i,n);if(s){s=r.fallback,a=t.mode,i=e.child,o=i.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=nA(i,l),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?s=nA(o,s):(s=mp(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?n3(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},s.memoizedState=a,s.childLanes=e.childLanes&~n,t.memoizedState=t3,r}return s=e.child,e=s.sibling,r=nA(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 xU(e,t){return t=QN({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function UC(e,t,n,r){return r!==null&&aU(r),qy(t,e.child,null,n),e=xU(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Owe(e,t,n,r,i,s,a){if(n)return t.flags&256?(t.flags&=-257,r=hP(Error(Ke(422))),UC(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=QN({mode:"visible",children:r.children},i,0,null),s=mp(s,i,a,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&qy(t,e.child,null,a),t.child.memoizedState=n3(a),t.memoizedState=t3,s);if(!(t.mode&1))return UC(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,s=Error(Ke(419)),r=hP(s,r,void 0),UC(e,t,a,r)}if(o=(a&e.childLanes)!==0,Fa||o){if(r=Yi,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,dd(e,i),sc(r,e,i,-1))}return BU(),r=hP(Error(Ke(421))),UC(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=qwe.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,vo=Jh(i.nextSibling),bo=t,Er=!0,ql=null,e!==null&&(Yo[Xo++]=Gu,Yo[Xo++]=Yu,Yo[Xo++]=Tp,Gu=e.id,Yu=e.overflow,Tp=t),t=xU(t,r.children),t.flags|=4096,t)}function H8(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),GO(e.return,t,n)}function AP(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 ene(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(sa(e,t,r.children,n),r=Or.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&&H8(e,n,t);else if(e.tag===19)H8(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(lr(Or,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&&OB(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),AP(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&&OB(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}AP(t,!0,n,null,s);break;case"together":AP(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function jk(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function hd(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ip|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Ke(153));if(t.child!==null){for(e=t.child,n=nA(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=nA(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Fwe(e,t,n){switch(t.tag){case 3:Jte(t),Ky();break;case 5:Bte(t);break;case 1:za(t.type)&&EB(t);break;case 4:hU(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;lr(TB,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(lr(Or,Or.current&1),t.flags|=128,null):n&t.child.childLanes?Zte(e,t,n):(lr(Or,Or.current&1),e=hd(e,t,n),e!==null?e.sibling:null);lr(Or,Or.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ene(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),lr(Or,Or.current),r)break;return null;case 22:case 23:return t.lanes=0,Yte(e,t,n)}return hd(e,t,n)}var tne,r3,nne,rne;tne=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}};r3=function(){};nne=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,$f(Xc.current);var s=null;switch(n){case"input":i=kO(e,i),r=kO(e,r),s=[];break;case"select":i=Rr({},i,{value:void 0}),r=Rr({},r,{value:void 0}),s=[];break;case"textarea":i=EO(e,i),r=EO(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=BB)}jO(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"&&(nb.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var l=r[u];if(o=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==o&&(l!=null||o!=null))if(u==="style")if(o){for(a in o)!o.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&o[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(s||(s=[]),s.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(nb.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&pr("scroll",e),s||o===l||(s=[])):(s=s||[]).push(u,l))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};rne=function(e,t,n,r){n!==r&&(t.flags|=4)};function nx(e,t){if(!Er)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 Ns(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 Mwe(e,t,n){var r=t.pendingProps;switch(sU(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ns(t),null;case 1:return za(t.type)&&_B(),Ns(t),null;case 3:return r=t.stateNode,Wy(),br($a),br(Vs),fU(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(LC(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ql!==null&&(d3(ql),ql=null))),r3(e,t),Ns(t),null;case 5:AU(t);var i=$f(fb.current);if(n=t.type,e!==null&&t.stateNode!=null)nne(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Ke(166));return Ns(t),null}if(e=$f(Xc.current),LC(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Hc]=t,r[hb]=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<Dx.length;i++)pr(Dx[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":X$(r,s),pr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},pr("invalid",r);break;case"textarea":Z$(r,s),pr("invalid",r)}jO(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&&MC(r.textContent,o,e),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(s.suppressHydrationWarning!==!0&&MC(r.textContent,o,e),i=["children",""+o]):nb.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&pr("scroll",r)}switch(n){case"input":EC(r),J$(r,s,!0);break;case"textarea":EC(r),e8(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=BB)}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=Tee(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[Hc]=t,e[hb]=r,tne(e,t,!1,!1),t.stateNode=e;e:{switch(a=TO(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<Dx.length;i++)pr(Dx[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":X$(e,r),i=kO(e,r),pr("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Rr({},r,{value:void 0}),pr("invalid",e);break;case"textarea":Z$(e,r),i=EO(e,r),pr("invalid",e);break;default:i=r}jO(n,i),o=i;for(s in o)if(o.hasOwnProperty(s)){var l=o[s];s==="style"?Oee(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Pee(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&rb(e,l):typeof l=="number"&&rb(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(nb.hasOwnProperty(s)?l!=null&&s==="onScroll"&&pr("scroll",e):l!=null&&zR(e,s,l,a))}switch(n){case"input":EC(e),J$(e,r,!1);break;case"textarea":EC(e),e8(e);break;case"option":r.value!=null&&e.setAttribute("value",""+vA(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?ey(e,!!r.multiple,s,!1):r.defaultValue!=null&&ey(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=BB)}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 Ns(t),null;case 6:if(e&&t.stateNode!=null)rne(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Ke(166));if(n=$f(fb.current),$f(Xc.current),LC(t)){if(r=t.stateNode,n=t.memoizedProps,r[Hc]=t,(s=r.nodeValue!==n)&&(e=bo,e!==null))switch(e.tag){case 3:MC(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&MC(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Hc]=t,t.stateNode=r}return Ns(t),null;case 13:if(br(Or),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Er&&vo!==null&&t.mode&1&&!(t.flags&128))wte(),Ky(),t.flags|=98560,s=!1;else if(s=LC(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(Ke(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(Ke(317));s[Hc]=t}else Ky(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ns(t),s=!1}else ql!==null&&(d3(ql),ql=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||Or.current&1?Li===0&&(Li=3):BU())),t.updateQueue!==null&&(t.flags|=4),Ns(t),null);case 4:return Wy(),r3(e,t),e===null&&ub(t.stateNode.containerInfo),Ns(t),null;case 10:return cU(t.type._context),Ns(t),null;case 17:return za(t.type)&&_B(),Ns(t),null;case 19:if(br(Or),s=t.memoizedState,s===null)return Ns(t),null;if(r=(t.flags&128)!==0,a=s.rendering,a===null)if(r)nx(s,!1);else{if(Li!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=OB(e),a!==null){for(t.flags|=128,nx(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 lr(Or,Or.current&1|2),t.child}e=e.sibling}s.tail!==null&&oi()>Yy&&(t.flags|=128,r=!0,nx(s,!1),t.lanes=4194304)}else{if(!r)if(e=OB(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),nx(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!Er)return Ns(t),null}else 2*oi()-s.renderingStartTime>Yy&&n!==1073741824&&(t.flags|=128,r=!0,nx(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=oi(),t.sibling=null,n=Or.current,lr(Or,r?n&1|2:n&1),t):(Ns(t),null);case 22:case 23:return kU(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?fo&1073741824&&(Ns(t),t.subtreeFlags&6&&(t.flags|=8192)):Ns(t),null;case 24:return null;case 25:return null}throw Error(Ke(156,t.tag))}function Lwe(e,t){switch(sU(t),t.tag){case 1:return za(t.type)&&_B(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wy(),br($a),br(Vs),fU(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return AU(t),null;case 13:if(br(Or),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ke(340));Ky()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return br(Or),null;case 4:return Wy(),null;case 10:return cU(t.type._context),null;case 22:case 23:return kU(),null;case 24:return null;default:return null}}var DC=!1,Us=!1,Rwe=typeof WeakSet=="function"?WeakSet:Set,ot=null;function Qg(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Wr(e,t,r)}else n.current=null}function i3(e,t,n){try{n()}catch(r){Wr(e,t,r)}}var $8=!1;function Uwe(e,t){if(QO=CB,e=lte(),rU(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,l=-1,u=0,d=0,h=e,f=null;t:for(;;){for(var A;h!==n||i!==0&&h.nodeType!==3||(o=a+i),h!==s||r!==0&&h.nodeType!==3||(l=a+r),h.nodeType===3&&(a+=h.nodeValue.length),(A=h.firstChild)!==null;)f=h,h=A;for(;;){if(h===e)break t;if(f===n&&++u===i&&(o=a),f===s&&++d===r&&(l=a),(A=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=A}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(HO={focusedElem:e,selectionRange:n},CB=!1,ot=t;ot!==null;)if(t=ot,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ot=e;else for(;ot!==null;){t=ot;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:Dl(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(Ke(163))}}catch(b){Wr(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,ot=e;break}ot=t.return}return p=$8,$8=!1,p}function fw(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&&i3(t,n,s)}i=i.next}while(i!==r)}}function UN(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 s3(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 ine(e){var t=e.alternate;t!==null&&(e.alternate=null,ine(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Hc],delete t[hb],delete t[VO],delete t[wwe],delete t[bwe])),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 sne(e){return e.tag===5||e.tag===3||e.tag===4}function z8(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||sne(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 a3(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=BB));else if(r!==4&&(e=e.child,e!==null))for(a3(e,t,n),e=e.sibling;e!==null;)a3(e,t,n),e=e.sibling}function o3(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(o3(e,t,n),e=e.sibling;e!==null;)o3(e,t,n),e=e.sibling}var ds=null,$l=!1;function qd(e,t,n){for(n=n.child;n!==null;)ane(e,t,n),n=n.sibling}function ane(e,t,n){if(Yc&&typeof Yc.onCommitFiberUnmount=="function")try{Yc.onCommitFiberUnmount(TN,n)}catch{}switch(n.tag){case 5:Us||Qg(n,t);case 6:var r=ds,i=$l;ds=null,qd(e,t,n),ds=r,$l=i,ds!==null&&($l?(e=ds,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ds.removeChild(n.stateNode));break;case 18:ds!==null&&($l?(e=ds,n=n.stateNode,e.nodeType===8?aP(e.parentNode,n):e.nodeType===1&&aP(e,n),ob(e)):aP(ds,n.stateNode));break;case 4:r=ds,i=$l,ds=n.stateNode.containerInfo,$l=!0,qd(e,t,n),ds=r,$l=i;break;case 0:case 11:case 14:case 15:if(!Us&&(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)&&i3(n,t,a),i=i.next}while(i!==r)}qd(e,t,n);break;case 1:if(!Us&&(Qg(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){Wr(n,t,o)}qd(e,t,n);break;case 21:qd(e,t,n);break;case 22:n.mode&1?(Us=(r=Us)||n.memoizedState!==null,qd(e,t,n),Us=r):qd(e,t,n);break;default:qd(e,t,n)}}function V8(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Rwe),t.forEach(function(r){var i=Wwe.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Tl(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:ds=o.stateNode,$l=!1;break e;case 3:ds=o.stateNode.containerInfo,$l=!0;break e;case 4:ds=o.stateNode.containerInfo,$l=!0;break e}o=o.return}if(ds===null)throw Error(Ke(160));ane(s,a,i),ds=null,$l=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){Wr(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)one(t,e),t=t.sibling}function one(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Tl(t,e),Tc(e),r&4){try{fw(3,e,e.return),UN(3,e)}catch(m){Wr(e,e.return,m)}try{fw(5,e,e.return)}catch(m){Wr(e,e.return,m)}}break;case 1:Tl(t,e),Tc(e),r&512&&n!==null&&Qg(n,n.return);break;case 5:if(Tl(t,e),Tc(e),r&512&&n!==null&&Qg(n,n.return),e.flags&32){var i=e.stateNode;try{rb(i,"")}catch(m){Wr(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,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{o==="input"&&s.type==="radio"&&s.name!=null&&Nee(i,s),TO(o,a);var u=TO(o,s);for(a=0;a<l.length;a+=2){var d=l[a],h=l[a+1];d==="style"?Oee(i,h):d==="dangerouslySetInnerHTML"?Pee(i,h):d==="children"?rb(i,h):zR(i,d,h,u)}switch(o){case"input":BO(i,s);break;case"textarea":jee(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var A=s.value;A!=null?ey(i,!!s.multiple,A,!1):f!==!!s.multiple&&(s.defaultValue!=null?ey(i,!!s.multiple,s.defaultValue,!0):ey(i,!!s.multiple,s.multiple?[]:"",!1))}i[hb]=s}catch(m){Wr(e,e.return,m)}}break;case 6:if(Tl(t,e),Tc(e),r&4){if(e.stateNode===null)throw Error(Ke(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(m){Wr(e,e.return,m)}}break;case 3:if(Tl(t,e),Tc(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ob(t.containerInfo)}catch(m){Wr(e,e.return,m)}break;case 4:Tl(t,e),Tc(e);break;case 13:Tl(t,e),Tc(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(CU=oi())),r&4&&V8(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Us=(u=Us)||d,Tl(t,e),Us=u):Tl(t,e),Tc(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ot=e,d=e.child;d!==null;){for(h=ot=d;ot!==null;){switch(f=ot,A=f.child,f.tag){case 0:case 11:case 14:case 15:fw(4,f,f.return);break;case 1:Qg(f,f.return);var p=f.stateNode;if(typeof p.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(m){Wr(r,n,m)}}break;case 5:Qg(f,f.return);break;case 22:if(f.memoizedState!==null){q8(h);continue}}A!==null?(A.return=f,ot=A):q8(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,l=h.memoizedProps.style,a=l!=null&&l.hasOwnProperty("display")?l.display:null,o.style.display=Iee("display",a))}catch(m){Wr(e,e.return,m)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(m){Wr(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:Tl(t,e),Tc(e),r&4&&V8(e);break;case 21:break;default:Tl(t,e),Tc(e)}}function Tc(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(sne(n)){var r=n;break e}n=n.return}throw Error(Ke(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(rb(i,""),r.flags&=-33);var s=z8(e);o3(e,s,i);break;case 3:case 4:var a=r.stateNode.containerInfo,o=z8(e);a3(e,o,a);break;default:throw Error(Ke(161))}}catch(l){Wr(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Dwe(e,t,n){ot=e,lne(e)}function lne(e,t,n){for(var r=(e.mode&1)!==0;ot!==null;){var i=ot,s=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||DC;if(!a){var o=i.alternate,l=o!==null&&o.memoizedState!==null||Us;o=DC;var u=Us;if(DC=a,(Us=l)&&!u)for(ot=i;ot!==null;)a=ot,l=a.child,a.tag===22&&a.memoizedState!==null?W8(i):l!==null?(l.return=a,ot=l):W8(i);for(;s!==null;)ot=s,lne(s),s=s.sibling;ot=i,DC=o,Us=u}K8(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,ot=s):K8(e)}}function K8(e){for(;ot!==null;){var t=ot;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Us||UN(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Us)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Dl(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&j8(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}j8(t,a,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&ob(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Ke(163))}Us||t.flags&512&&s3(t)}catch(f){Wr(t,t.return,f)}}if(t===e){ot=null;break}if(n=t.sibling,n!==null){n.return=t.return,ot=n;break}ot=t.return}}function q8(e){for(;ot!==null;){var t=ot;if(t===e){ot=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ot=n;break}ot=t.return}}function W8(e){for(;ot!==null;){var t=ot;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{UN(4,t)}catch(l){Wr(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){Wr(t,i,l)}}var s=t.return;try{s3(t)}catch(l){Wr(t,s,l)}break;case 5:var a=t.return;try{s3(t)}catch(l){Wr(t,a,l)}}}catch(l){Wr(t,t.return,l)}if(t===e){ot=null;break}var o=t.sibling;if(o!==null){o.return=t.return,ot=o;break}ot=t.return}}var Qwe=Math.ceil,LB=bd.ReactCurrentDispatcher,wU=bd.ReactCurrentOwner,ol=bd.ReactCurrentBatchConfig,jn=0,Yi=null,bi=null,ws=0,fo=0,Hg=FA(0),Li=0,yb=null,Ip=0,DN=0,bU=0,pw=null,Ia=null,CU=0,Yy=1/0,Qu=null,RB=!1,l3=null,eA=null,QC=!1,Lh=null,UB=0,mw=0,c3=null,Tk=-1,Pk=0;function ma(){return jn&6?oi():Tk!==-1?Tk:Tk=oi()}function tA(e){return e.mode&1?jn&2&&ws!==0?ws&-ws:Swe.transition!==null?(Pk===0&&(Pk=Kee()),Pk):(e=Hn,e!==0||(e=window.event,e=e===void 0?16:Zee(e.type)),e):1}function sc(e,t,n,r){if(50<mw)throw mw=0,c3=null,Error(Ke(185));n2(e,n,r),(!(jn&2)||e!==Yi)&&(e===Yi&&(!(jn&2)&&(DN|=n),Li===4&&vh(e,ws)),Va(e,r),n===1&&jn===0&&!(t.mode&1)&&(Yy=oi()+500,MN&&MA()))}function Va(e,t){var n=e.callbackNode;Sxe(e,t);var r=bB(e,e===Yi?ws:0);if(r===0)n!==null&&r8(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&r8(n),t===1)e.tag===0?Cwe(G8.bind(null,e)):yte(G8.bind(null,e)),vwe(function(){!(jn&6)&&MA()}),n=null;else{switch(qee(r)){case 1:n=GR;break;case 4:n=zee;break;case 16:n=wB;break;case 536870912:n=Vee;break;default:n=wB}n=mne(n,cne.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function cne(e,t){if(Tk=-1,Pk=0,jn&6)throw Error(Ke(327));var n=e.callbackNode;if(sy()&&e.callbackNode!==n)return null;var r=bB(e,e===Yi?ws:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=DB(e,r);else{t=r;var i=jn;jn|=2;var s=dne();(Yi!==e||ws!==t)&&(Qu=null,Yy=oi()+500,pp(e,t));do try{zwe();break}catch(o){une(e,o)}while(!0);lU(),LB.current=s,jn=i,bi!==null?t=0:(Yi=null,ws=0,t=Li)}if(t!==0){if(t===2&&(i=MO(e),i!==0&&(r=i,t=u3(e,i))),t===1)throw n=yb,pp(e,0),vh(e,r),Va(e,oi()),n;if(t===6)vh(e,r);else{if(i=e.current.alternate,!(r&30)&&!Hwe(i)&&(t=DB(e,r),t===2&&(s=MO(e),s!==0&&(r=s,t=u3(e,s))),t===1))throw n=yb,pp(e,0),vh(e,r),Va(e,oi()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(Ke(345));case 2:_f(e,Ia,Qu);break;case 3:if(vh(e,r),(r&130023424)===r&&(t=CU+500-oi(),10<t)){if(bB(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){ma(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=zO(_f.bind(null,e,Ia,Qu),t);break}_f(e,Ia,Qu);break;case 4:if(vh(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-ic(r);s=1<<a,a=t[a],a>i&&(i=a),r&=~s}if(r=i,r=oi()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Qwe(r/1960))-r,10<r){e.timeoutHandle=zO(_f.bind(null,e,Ia,Qu),r);break}_f(e,Ia,Qu);break;case 5:_f(e,Ia,Qu);break;default:throw Error(Ke(329))}}}return Va(e,oi()),e.callbackNode===n?cne.bind(null,e):null}function u3(e,t){var n=pw;return e.current.memoizedState.isDehydrated&&(pp(e,t).flags|=256),e=DB(e,t),e!==2&&(t=Ia,Ia=n,t!==null&&d3(t)),e}function d3(e){Ia===null?Ia=e:Ia.push.apply(Ia,e)}function Hwe(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(!uc(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 vh(e,t){for(t&=~bU,t&=~DN,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ic(t),r=1<<n;e[n]=-1,t&=~r}}function G8(e){if(jn&6)throw Error(Ke(327));sy();var t=bB(e,0);if(!(t&1))return Va(e,oi()),null;var n=DB(e,t);if(e.tag!==0&&n===2){var r=MO(e);r!==0&&(t=r,n=u3(e,r))}if(n===1)throw n=yb,pp(e,0),vh(e,t),Va(e,oi()),n;if(n===6)throw Error(Ke(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,_f(e,Ia,Qu),Va(e,oi()),null}function SU(e,t){var n=jn;jn|=1;try{return e(t)}finally{jn=n,jn===0&&(Yy=oi()+500,MN&&MA())}}function Op(e){Lh!==null&&Lh.tag===0&&!(jn&6)&&sy();var t=jn;jn|=1;var n=ol.transition,r=Hn;try{if(ol.transition=null,Hn=1,e)return e()}finally{Hn=r,ol.transition=n,jn=t,!(jn&6)&&MA()}}function kU(){fo=Hg.current,br(Hg)}function pp(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,ywe(n)),bi!==null)for(n=bi.return;n!==null;){var r=n;switch(sU(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&_B();break;case 3:Wy(),br($a),br(Vs),fU();break;case 5:AU(r);break;case 4:Wy();break;case 13:br(Or);break;case 19:br(Or);break;case 10:cU(r.type._context);break;case 22:case 23:kU()}n=n.return}if(Yi=e,bi=e=nA(e.current,null),ws=fo=t,Li=0,yb=null,bU=DN=Ip=0,Ia=pw=null,Hf!==null){for(t=0;t<Hf.length;t++)if(n=Hf[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}Hf=null}return e}function une(e,t){do{var n=bi;try{if(lU(),Ek.current=MB,FB){for(var r=Lr.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}FB=!1}if(Pp=0,qi=Ii=Lr=null,Aw=!1,pb=0,wU.current=null,n===null||n.return===null){Li=1,yb=t,bi=null;break}e:{var s=e,a=n.return,o=n,l=t;if(t=ws,o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=o,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var A=M8(a);if(A!==null){A.flags&=-257,L8(A,a,o,s,t),A.mode&1&&F8(s,u,t),t=A,l=u;var p=t.updateQueue;if(p===null){var m=new Set;m.add(l),t.updateQueue=m}else p.add(l);break e}else{if(!(t&1)){F8(s,u,t),BU();break e}l=Error(Ke(426))}}else if(Er&&o.mode&1){var g=M8(a);if(g!==null){!(g.flags&65536)&&(g.flags|=256),L8(g,a,o,s,t),aU(Gy(l,o));break e}}s=l=Gy(l,o),Li!==4&&(Li=2),pw===null?pw=[s]:pw.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var y=qte(s,l,t);N8(s,y);break e;case 1:o=l;var v=s.type,x=s.stateNode;if(!(s.flags&128)&&(typeof v.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(eA===null||!eA.has(x)))){s.flags|=65536,t&=-t,s.lanes|=t;var b=Wte(s,o,t);N8(s,b);break e}}s=s.return}while(s!==null)}Ane(n)}catch(w){t=w,bi===n&&n!==null&&(bi=n=n.return);continue}break}while(!0)}function dne(){var e=LB.current;return LB.current=MB,e===null?MB:e}function BU(){(Li===0||Li===3||Li===2)&&(Li=4),Yi===null||!(Ip&268435455)&&!(DN&268435455)||vh(Yi,ws)}function DB(e,t){var n=jn;jn|=2;var r=dne();(Yi!==e||ws!==t)&&(Qu=null,pp(e,t));do try{$we();break}catch(i){une(e,i)}while(!0);if(lU(),jn=n,LB.current=r,bi!==null)throw Error(Ke(261));return Yi=null,ws=0,Li}function $we(){for(;bi!==null;)hne(bi)}function zwe(){for(;bi!==null&&!pxe();)hne(bi)}function hne(e){var t=pne(e.alternate,e,fo);e.memoizedProps=e.pendingProps,t===null?Ane(e):bi=t,wU.current=null}function Ane(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Lwe(n,t),n!==null){n.flags&=32767,bi=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Li=6,bi=null;return}}else if(n=Mwe(n,t,fo),n!==null){bi=n;return}if(t=t.sibling,t!==null){bi=t;return}bi=t=e}while(t!==null);Li===0&&(Li=5)}function _f(e,t,n){var r=Hn,i=ol.transition;try{ol.transition=null,Hn=1,Vwe(e,t,n,r)}finally{ol.transition=i,Hn=r}return null}function Vwe(e,t,n,r){do sy();while(Lh!==null);if(jn&6)throw Error(Ke(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(Ke(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(kxe(e,s),e===Yi&&(bi=Yi=null,ws=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||QC||(QC=!0,mne(wB,function(){return sy(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=ol.transition,ol.transition=null;var a=Hn;Hn=1;var o=jn;jn|=4,wU.current=null,Uwe(e,n),one(n,e),dwe(HO),CB=!!QO,HO=QO=null,e.current=n,Dwe(n),mxe(),jn=o,Hn=a,ol.transition=s}else e.current=n;if(QC&&(QC=!1,Lh=e,UB=i),s=e.pendingLanes,s===0&&(eA=null),vxe(n.stateNode),Va(e,oi()),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(RB)throw RB=!1,e=l3,l3=null,e;return UB&1&&e.tag!==0&&sy(),s=e.pendingLanes,s&1?e===c3?mw++:(mw=0,c3=e):mw=0,MA(),null}function sy(){if(Lh!==null){var e=qee(UB),t=ol.transition,n=Hn;try{if(ol.transition=null,Hn=16>e?16:e,Lh===null)var r=!1;else{if(e=Lh,Lh=null,UB=0,jn&6)throw Error(Ke(331));var i=jn;for(jn|=4,ot=e.current;ot!==null;){var s=ot,a=s.child;if(ot.flags&16){var o=s.deletions;if(o!==null){for(var l=0;l<o.length;l++){var u=o[l];for(ot=u;ot!==null;){var d=ot;switch(d.tag){case 0:case 11:case 15:fw(8,d,s)}var h=d.child;if(h!==null)h.return=d,ot=h;else for(;ot!==null;){d=ot;var f=d.sibling,A=d.return;if(ine(d),d===u){ot=null;break}if(f!==null){f.return=A,ot=f;break}ot=A}}}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)}}ot=s}}if(s.subtreeFlags&2064&&a!==null)a.return=s,ot=a;else e:for(;ot!==null;){if(s=ot,s.flags&2048)switch(s.tag){case 0:case 11:case 15:fw(9,s,s.return)}var y=s.sibling;if(y!==null){y.return=s.return,ot=y;break e}ot=s.return}}var v=e.current;for(ot=v;ot!==null;){a=ot;var x=a.child;if(a.subtreeFlags&2064&&x!==null)x.return=a,ot=x;else e:for(a=v;ot!==null;){if(o=ot,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:UN(9,o)}}catch(w){Wr(o,o.return,w)}if(o===a){ot=null;break e}var b=o.sibling;if(b!==null){b.return=o.return,ot=b;break e}ot=o.return}}if(jn=i,MA(),Yc&&typeof Yc.onPostCommitFiberRoot=="function")try{Yc.onPostCommitFiberRoot(TN,e)}catch{}r=!0}return r}finally{Hn=n,ol.transition=t}}return!1}function Y8(e,t,n){t=Gy(n,t),t=qte(e,t,1),e=Zh(e,t,1),t=ma(),e!==null&&(n2(e,1,t),Va(e,t))}function Wr(e,t,n){if(e.tag===3)Y8(e,e,n);else for(;t!==null;){if(t.tag===3){Y8(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(eA===null||!eA.has(r))){e=Gy(n,e),e=Wte(t,e,1),t=Zh(t,e,1),e=ma(),t!==null&&(n2(t,1,e),Va(t,e));break}}t=t.return}}function Kwe(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=ma(),e.pingedLanes|=e.suspendedLanes&n,Yi===e&&(ws&n)===n&&(Li===4||Li===3&&(ws&130023424)===ws&&500>oi()-CU?pp(e,0):bU|=n),Va(e,t)}function fne(e,t){t===0&&(e.mode&1?(t=TC,TC<<=1,!(TC&130023424)&&(TC=4194304)):t=1);var n=ma();e=dd(e,t),e!==null&&(n2(e,t,n),Va(e,n))}function qwe(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),fne(e,n)}function Wwe(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(Ke(314))}r!==null&&r.delete(t),fne(e,n)}var pne;pne=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||$a.current)Fa=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Fa=!1,Fwe(e,t,n);Fa=!!(e.flags&131072)}else Fa=!1,Er&&t.flags&1048576&&vte(t,jB,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;jk(e,t),e=t.pendingProps;var i=Vy(t,Vs.current);iy(t,n),i=mU(null,t,r,e,i,n);var s=gU();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,za(r)?(s=!0,EB(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,dU(t),i.updater=RN,t.stateNode=i,i._reactInternals=t,XO(t,r,e,n),t=e3(null,t,r,!0,s,n)):(t.tag=0,Er&&s&&iU(t),sa(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(jk(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Ywe(r),e=Dl(r,e),i){case 0:t=ZO(null,t,r,e,n);break e;case 1:t=D8(null,t,r,e,n);break e;case 11:t=R8(null,t,r,e,n);break e;case 14:t=U8(null,t,r,Dl(r.type,e),n);break e}throw Error(Ke(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Dl(r,i),ZO(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Dl(r,i),D8(e,t,r,i,n);case 3:e:{if(Jte(t),e===null)throw Error(Ke(387));r=t.pendingProps,s=t.memoizedState,i=s.element,kte(e,t),IB(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=Gy(Error(Ke(423)),t),t=Q8(e,t,r,n,i);break e}else if(r!==i){i=Gy(Error(Ke(424)),t),t=Q8(e,t,r,n,i);break e}else for(vo=Jh(t.stateNode.containerInfo.firstChild),bo=t,Er=!0,ql=null,n=Cte(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ky(),r===i){t=hd(e,t,n);break e}sa(e,t,r,n)}t=t.child}return t;case 5:return Bte(t),e===null&&WO(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,a=i.children,$O(r,i)?a=null:s!==null&&$O(r,s)&&(t.flags|=32),Xte(e,t),sa(e,t,a,n),t.child;case 6:return e===null&&WO(t),null;case 13:return Zte(e,t,n);case 4:return hU(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=qy(t,null,r,n):sa(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Dl(r,i),R8(e,t,r,i,n);case 7:return sa(e,t,t.pendingProps,n),t.child;case 8:return sa(e,t,t.pendingProps.children,n),t.child;case 12:return sa(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,lr(TB,r._currentValue),r._currentValue=a,s!==null)if(uc(s.value,a)){if(s.children===i.children&&!$a.current){t=hd(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 l=o.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=td(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),GO(s.return,n,t),o.lanes|=n;break}l=l.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(Ke(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),GO(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}sa(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,iy(t,n),i=ml(i),r=r(i),t.flags|=1,sa(e,t,r,n),t.child;case 14:return r=t.type,i=Dl(r,t.pendingProps),i=Dl(r.type,i),U8(e,t,r,i,n);case 15:return Gte(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Dl(r,i),jk(e,t),t.tag=1,za(r)?(e=!0,EB(t)):e=!1,iy(t,n),Kte(t,r,i),XO(t,r,i,n),e3(null,t,r,!0,e,n);case 19:return ene(e,t,n);case 22:return Yte(e,t,n)}throw Error(Ke(156,t.tag))};function mne(e,t){return $ee(e,t)}function Gwe(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 nl(e,t,n,r){return new Gwe(e,t,n,r)}function _U(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ywe(e){if(typeof e=="function")return _U(e)?1:0;if(e!=null){if(e=e.$$typeof,e===KR)return 11;if(e===qR)return 14}return 2}function nA(e,t){var n=e.alternate;return n===null?(n=nl(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 Ik(e,t,n,r,i,s){var a=2;if(r=e,typeof e=="function")_U(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Pg:return mp(n.children,i,s,t);case VR:a=8,i|=8;break;case wO:return e=nl(12,n,t,i|2),e.elementType=wO,e.lanes=s,e;case bO:return e=nl(13,n,t,i),e.elementType=bO,e.lanes=s,e;case CO:return e=nl(19,n,t,i),e.elementType=CO,e.lanes=s,e;case Bee:return QN(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case See:a=10;break e;case kee:a=9;break e;case KR:a=11;break e;case qR:a=14;break e;case uh:a=16,r=null;break e}throw Error(Ke(130,e==null?e:typeof e,""))}return t=nl(a,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function mp(e,t,n,r){return e=nl(7,e,r,t),e.lanes=n,e}function QN(e,t,n,r){return e=nl(22,e,r,t),e.elementType=Bee,e.lanes=n,e.stateNode={isHidden:!1},e}function fP(e,t,n){return e=nl(6,e,null,t),e.lanes=n,e}function pP(e,t,n){return t=nl(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Xwe(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=GT(0),this.expirationTimes=GT(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=GT(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function EU(e,t,n,r,i,s,a,o,l){return e=new Xwe(e,t,n,o,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=nl(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},dU(s),e}function Jwe(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Tg,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function gne(e){if(!e)return xA;e=e._reactInternals;e:{if(am(e)!==e||e.tag!==1)throw Error(Ke(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(za(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Ke(171))}if(e.tag===1){var n=e.type;if(za(n))return gte(e,n,t)}return t}function yne(e,t,n,r,i,s,a,o,l){return e=EU(n,r,!0,e,i,s,a,o,l),e.context=gne(null),n=e.current,r=ma(),i=tA(n),s=td(r,i),s.callback=t??null,Zh(n,s,i),e.current.lanes=i,n2(e,i,r),Va(e,r),e}function HN(e,t,n,r){var i=t.current,s=ma(),a=tA(i);return n=gne(n),t.context===null?t.context=n:t.pendingContext=n,t=td(s,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Zh(i,t,a),e!==null&&(sc(e,i,a,s),_k(e,i,a)),a}function QB(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 X8(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function NU(e,t){X8(e,t),(e=e.alternate)&&X8(e,t)}function Zwe(){return null}var vne=typeof reportError=="function"?reportError:function(e){console.error(e)};function jU(e){this._internalRoot=e}$N.prototype.render=jU.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Ke(409));HN(e,t,null,null)};$N.prototype.unmount=jU.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Op(function(){HN(null,e,null,null)}),t[ud]=null}};function $N(e){this._internalRoot=e}$N.prototype.unstable_scheduleHydration=function(e){if(e){var t=Yee();e={blockedOn:null,target:e,priority:t};for(var n=0;n<yh.length&&t!==0&&t<yh[n].priority;n++);yh.splice(n,0,e),n===0&&Jee(e)}};function TU(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function zN(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function J8(){}function ebe(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=QB(a);s.call(u)}}var a=yne(t,r,e,0,null,!1,!1,"",J8);return e._reactRootContainer=a,e[ud]=a.current,ub(e.nodeType===8?e.parentNode:e),Op(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var u=QB(l);o.call(u)}}var l=EU(e,0,!1,null,null,!1,!1,"",J8);return e._reactRootContainer=l,e[ud]=l.current,ub(e.nodeType===8?e.parentNode:e),Op(function(){HN(t,l,n,r)}),l}function VN(e,t,n,r,i){var s=n._reactRootContainer;if(s){var a=s;if(typeof i=="function"){var o=i;i=function(){var l=QB(a);o.call(l)}}HN(t,a,e,i)}else a=ebe(n,t,e,i,r);return QB(a)}Wee=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ux(t.pendingLanes);n!==0&&(YR(t,n|1),Va(t,oi()),!(jn&6)&&(Yy=oi()+500,MA()))}break;case 13:Op(function(){var r=dd(e,1);if(r!==null){var i=ma();sc(r,e,1,i)}}),NU(e,1)}};XR=function(e){if(e.tag===13){var t=dd(e,134217728);if(t!==null){var n=ma();sc(t,e,134217728,n)}NU(e,134217728)}};Gee=function(e){if(e.tag===13){var t=tA(e),n=dd(e,t);if(n!==null){var r=ma();sc(n,e,t,r)}NU(e,t)}};Yee=function(){return Hn};Xee=function(e,t){var n=Hn;try{return Hn=e,t()}finally{Hn=n}};IO=function(e,t,n){switch(t){case"input":if(BO(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=FN(r);if(!i)throw Error(Ke(90));Eee(r),BO(r,i)}}}break;case"textarea":jee(e,n);break;case"select":t=n.value,t!=null&&ey(e,!!n.multiple,t,!1)}};Lee=SU;Ree=Op;var tbe={usingClientEntryPoint:!1,Events:[i2,Mg,FN,Fee,Mee,SU]},rx={findFiberByHostInstance:Qf,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},nbe={bundleType:rx.bundleType,version:rx.version,rendererPackageName:rx.rendererPackageName,rendererConfig:rx.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:bd.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Qee(e),e===null?null:e.stateNode},findFiberByHostInstance:rx.findFiberByHostInstance||Zwe,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 HC=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!HC.isDisabled&&HC.supportsFiber)try{TN=HC.inject(nbe),Yc=HC}catch{}}Eo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tbe;Eo.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!TU(t))throw Error(Ke(200));return Jwe(e,t,null,n)};Eo.createRoot=function(e,t){if(!TU(e))throw Error(Ke(299));var n=!1,r="",i=vne;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=EU(e,1,!1,null,null,n,!1,r,i),e[ud]=t.current,ub(e.nodeType===8?e.parentNode:e),new jU(t)};Eo.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(Ke(188)):(e=Object.keys(e).join(","),Error(Ke(268,e)));return e=Qee(t),e=e===null?null:e.stateNode,e};Eo.flushSync=function(e){return Op(e)};Eo.hydrate=function(e,t,n){if(!zN(t))throw Error(Ke(200));return VN(null,e,t,!0,n)};Eo.hydrateRoot=function(e,t,n){if(!TU(e))throw Error(Ke(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",a=vne;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=yne(t,null,e,1,n??null,i,!1,s,a),e[ud]=t.current,ub(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 $N(t)};Eo.render=function(e,t,n){if(!zN(t))throw Error(Ke(200));return VN(null,e,t,!1,n)};Eo.unmountComponentAtNode=function(e){if(!zN(e))throw Error(Ke(40));return e._reactRootContainer?(Op(function(){VN(null,null,e,!1,function(){e._reactRootContainer=null,e[ud]=null})}),!0):!1};Eo.unstable_batchedUpdates=SU;Eo.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!zN(n))throw Error(Ke(200));if(e==null||e._reactInternals===void 0)throw Error(Ke(38));return VN(e,t,n,!1,r)};Eo.version="18.3.1-next-f1338f8080-20240426";function xne(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(xne)}catch(e){console.error(e)}}xne(),xee.exports=Eo;var LA=xee.exports;const PU=En(LA);var wne,Z8=LA;wne=Z8.createRoot,Z8.hydrateRoot;const rbe=1,ibe=1e6;let mP=0;function sbe(){return mP=(mP+1)%Number.MAX_SAFE_INTEGER,mP.toString()}const gP=new Map,e7=e=>{if(gP.has(e))return;const t=setTimeout(()=>{gP.delete(e),gw({type:"REMOVE_TOAST",toastId:e})},ibe);gP.set(e,t)},abe=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,rbe)};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?e7(n):e.toasts.forEach(r=>{e7(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)}}},Ok=[];let Fk={toasts:[]};function gw(e){Fk=abe(Fk,e),Ok.forEach(t=>{t(Fk)})}function Xe({...e}){const t=sbe(),n=i=>gw({type:"UPDATE_TOAST",toast:{...i,id:t}}),r=()=>gw({type:"DISMISS_TOAST",toastId:t});return gw({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||r()}}}),{id:t,dismiss:r,update:n}}function RA(){const[e,t]=k.useState(Fk);return k.useEffect(()=>(Ok.push(t),()=>{const n=Ok.indexOf(t);n>-1&&Ok.splice(n,1)}),[e]),{...e,toast:Xe,dismiss:n=>gw({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 t7(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function bne(...e){return t=>{let n=!1;const r=e.map(i=>{const s=t7(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():t7(e[i],null)}}}}function tn(...e){return k.useCallback(bne(...e),e)}function obe(e,t){const n=k.createContext(t),r=s=>{const{children:a,...o}=s,l=k.useMemo(()=>o,Object.values(o));return c.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function i(s){const a=k.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 qs(e,t=[]){let n=[];function r(s,a){const o=k.createContext(a),l=n.length;n=[...n,a];const u=h=>{var y;const{scope:f,children:A,...p}=h,m=((y=f==null?void 0:f[e])==null?void 0:y[l])||o,g=k.useMemo(()=>p,Object.values(p));return c.jsx(m.Provider,{value:g,children:A})};u.displayName=s+"Provider";function d(h,f){var m;const A=((m=f==null?void 0:f[e])==null?void 0:m[l])||o,p=k.useContext(A);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=>k.createContext(a));return function(o){const l=(o==null?void 0:o[e])||s;return k.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])}};return i.scopeName=e,[r,lbe(i,...t)]}function lbe(...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:l,scopeName:u})=>{const h=l(s)[`__scope${u}`];return{...o,...h}},{});return k.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Fp(e){const t=ube(e),n=k.forwardRef((r,i)=>{const{children:s,...a}=r,o=k.Children.toArray(s),l=o.find(dbe);if(l){const u=l.props.children,d=o.map(h=>h===l?k.Children.count(u)>1?k.Children.only(null):k.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...a,ref:i,children:k.isValidElement(u)?k.cloneElement(u,void 0,d):null})}return c.jsx(t,{...a,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}var cbe=Fp("Slot");function ube(e){const t=k.forwardRef((n,r)=>{const{children:i,...s}=n;if(k.isValidElement(i)){const a=Abe(i),o=hbe(s,i.props);return i.type!==k.Fragment&&(o.ref=r?bne(r,a):a),k.cloneElement(i,o)}return k.Children.count(i)>1?k.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Cne=Symbol("radix.slottable");function Sne(e){const t=({children:n})=>c.jsx(c.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Cne,t}function dbe(e){return k.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Cne}function hbe(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 l=s(...o);return i(...o),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function Abe(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 KN(e){const t=e+"CollectionProvider",[n,r]=qs(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 c.jsx(i,{scope:g,itemMap:x,collectionRef:v,children:y})};a.displayName=t;const o=e+"CollectionSlot",l=Fp(o),u=re.forwardRef((m,g)=>{const{scope:y,children:v}=m,x=s(o,y),b=tn(g,x.collectionRef);return c.jsx(l,{ref:b,children:v})});u.displayName=o;const d=e+"CollectionItemSlot",h="data-radix-collection-item",f=Fp(d),A=re.forwardRef((m,g)=>{const{scope:y,children:v,...x}=m,b=re.useRef(null),w=tn(g,b),S=s(d,y);return re.useEffect(()=>(S.itemMap.set(b,{ref:b,...x}),()=>void S.itemMap.delete(b))),c.jsx(f,{[h]:"",ref:w,children:v})});A.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((S,_)=>x.indexOf(S.ref.current)-x.indexOf(_.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:u,ItemSlot:A},p,r]}var fbe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_t=fbe.reduce((e,t)=>{const n=Fp(`Primitive.${t}`),r=k.forwardRef((i,s)=>{const{asChild:a,...o}=i,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...o,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function kne(e,t){e&&LA.flushSync(()=>e.dispatchEvent(t))}function Mi(e){const t=k.useRef(e);return k.useEffect(()=>{t.current=e}),k.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function pbe(e,t=globalThis==null?void 0:globalThis.document){const n=Mi(e);k.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 mbe="DismissableLayer",h3="dismissableLayer.update",gbe="dismissableLayer.pointerDownOutside",ybe="dismissableLayer.focusOutside",n7,Bne=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$0=k.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:o,...l}=e,u=k.useContext(Bne),[d,h]=k.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,A]=k.useState({}),p=tn(t,_=>h(_)),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=xbe(_=>{const E=_.target,j=[...u.branches].some(I=>I.contains(E));!b||j||(i==null||i(_),a==null||a(_),_.defaultPrevented||o==null||o())},f),S=wbe(_=>{const E=_.target;[...u.branches].some(I=>I.contains(E))||(s==null||s(_),a==null||a(_),_.defaultPrevented||o==null||o())},f);return pbe(_=>{v===u.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&o&&(_.preventDefault(),o()))},f),k.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(n7=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),r7(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=n7)}},[d,f,n,u]),k.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),r7())},[d,u]),k.useEffect(()=>{const _=()=>A({});return document.addEventListener(h3,_),()=>document.removeEventListener(h3,_)},[]),c.jsx(_t.div,{...l,ref:p,style:{pointerEvents:x?b?"auto":"none":void 0,...e.style},onFocusCapture:at(e.onFocusCapture,S.onFocusCapture),onBlurCapture:at(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:at(e.onPointerDownCapture,w.onPointerDownCapture)})});$0.displayName=mbe;var vbe="DismissableLayerBranch",_ne=k.forwardRef((e,t)=>{const n=k.useContext(Bne),r=k.useRef(null),i=tn(t,r);return k.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),c.jsx(_t.div,{...e,ref:i})});_ne.displayName=vbe;function xbe(e,t=globalThis==null?void 0:globalThis.document){const n=Mi(e),r=k.useRef(!1),i=k.useRef(()=>{});return k.useEffect(()=>{const s=o=>{if(o.target&&!r.current){let l=function(){Ene(gbe,n,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}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 wbe(e,t=globalThis==null?void 0:globalThis.document){const n=Mi(e),r=k.useRef(!1);return k.useEffect(()=>{const i=s=>{s.target&&!r.current&&Ene(ybe,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 r7(){const e=new CustomEvent(h3);document.dispatchEvent(e)}function Ene(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?kne(i,s):i.dispatchEvent(s)}var bbe=$0,Cbe=_ne,Ui=globalThis!=null&&globalThis.document?k.useLayoutEffect:()=>{},Sbe="Portal",a2=k.forwardRef((e,t)=>{var o;const{container:n,...r}=e,[i,s]=k.useState(!1);Ui(()=>s(!0),[]);const a=n||i&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?PU.createPortal(c.jsx(_t.div,{...r,ref:t}),a):null});a2.displayName=Sbe;function kbe(e,t){return k.useReducer((n,r)=>t[n][r]??n,e)}var ba=e=>{const{present:t,children:n}=e,r=Bbe(t),i=typeof n=="function"?n({present:r.isPresent}):k.Children.only(n),s=tn(r.ref,_be(i));return typeof n=="function"||r.isPresent?k.cloneElement(i,{ref:s}):null};ba.displayName="Presence";function Bbe(e){const[t,n]=k.useState(),r=k.useRef(null),i=k.useRef(e),s=k.useRef("none"),a=e?"mounted":"unmounted",[o,l]=kbe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return k.useEffect(()=>{const u=$C(r.current);s.current=o==="mounted"?u:"none"},[o]),Ui(()=>{const u=r.current,d=i.current;if(d!==e){const f=s.current,A=$C(u);e?l("MOUNT"):A==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&f!==A?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Ui(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,h=A=>{const m=$C(r.current).includes(A.animationName);if(A.target===t&&m&&(l("ANIMATION_END"),!i.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},f=A=>{A.target===t&&(s.current=$C(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:k.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function $C(e){return(e==null?void 0:e.animationName)||"none"}function _be(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 Ebe=QR[" useInsertionEffect ".trim().toString()]||Ui;function Bo({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,s,a]=Nbe({defaultProp:t,onChange:n}),o=e!==void 0,l=o?e:i;{const d=k.useRef(e!==void 0);k.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=k.useCallback(d=>{var h;if(o){const f=jbe(d)?d(e):d;f!==e&&((h=a.current)==null||h.call(a,f))}else s(d)},[o,e,s,a]);return[l,u]}function Nbe({defaultProp:e,onChange:t}){const[n,r]=k.useState(e),i=k.useRef(n),s=k.useRef(t);return Ebe(()=>{s.current=t},[t]),k.useEffect(()=>{var a;i.current!==n&&((a=s.current)==null||a.call(s,n),i.current=n)},[n,i]),[n,r,s]}function jbe(e){return typeof e=="function"}var Nne=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"}),Tbe="VisuallyHidden",qN=k.forwardRef((e,t)=>c.jsx(_t.span,{...e,ref:t,style:{...Nne,...e.style}}));qN.displayName=Tbe;var Pbe=qN,IU="ToastProvider",[OU,Ibe,Obe]=KN("Toast"),[jne,Sjt]=qs("Toast",[Obe]),[Fbe,WN]=jne(IU),Tne=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:a}=e,[o,l]=k.useState(null),[u,d]=k.useState(0),h=k.useRef(!1),f=k.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${IU}\`. Expected non-empty \`string\`.`),c.jsx(OU.Provider,{scope:t,children:c.jsx(Fbe,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:s,toastCount:u,viewport:o,onViewportChange:l,onToastAdd:k.useCallback(()=>d(A=>A+1),[]),onToastRemove:k.useCallback(()=>d(A=>A-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:f,children:a})})};Tne.displayName=IU;var Pne="ToastViewport",Mbe=["F8"],A3="toast.viewportPause",f3="toast.viewportResume",Ine=k.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=Mbe,label:i="Notifications ({hotkey})",...s}=e,a=WN(Pne,n),o=Ibe(n),l=k.useRef(null),u=k.useRef(null),d=k.useRef(null),h=k.useRef(null),f=tn(t,h,a.onViewportChange),A=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),p=a.toastCount>0;k.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]),k.useEffect(()=>{const g=l.current,y=h.current;if(p&&g&&y){const v=()=>{if(!a.isClosePausedRef.current){const S=new CustomEvent(A3);y.dispatchEvent(S),a.isClosePausedRef.current=!0}},x=()=>{if(a.isClosePausedRef.current){const S=new CustomEvent(f3);y.dispatchEvent(S),a.isClosePausedRef.current=!1}},b=S=>{!g.contains(S.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=k.useCallback(({tabbingDirection:g})=>{const v=o().map(x=>{const b=x.ref.current,w=[b,...Gbe(b)];return g==="forwards"?w:w.reverse()});return(g==="forwards"?v.reverse():v).flat()},[o]);return k.useEffect(()=>{const g=h.current;if(g){const y=v=>{var w,S,_;const x=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!x){const E=document.activeElement,j=v.shiftKey;if(v.target===g&&j){(w=u.current)==null||w.focus();return}const N=m({tabbingDirection:j?"backwards":"forwards"}),F=N.findIndex(L=>L===E);yP(N.slice(F+1))?v.preventDefault():j?(S=u.current)==null||S.focus():(_=d.current)==null||_.focus()}};return g.addEventListener("keydown",y),()=>g.removeEventListener("keydown",y)}},[o,m]),c.jsxs(Cbe,{ref:l,role:"region","aria-label":i.replace("{hotkey}",A),tabIndex:-1,style:{pointerEvents:p?void 0:"none"},children:[p&&c.jsx(p3,{ref:u,onFocusFromOutsideViewport:()=>{const g=m({tabbingDirection:"forwards"});yP(g)}}),c.jsx(OU.Slot,{scope:n,children:c.jsx(_t.ol,{tabIndex:-1,...s,ref:f})}),p&&c.jsx(p3,{ref:d,onFocusFromOutsideViewport:()=>{const g=m({tabbingDirection:"backwards"});yP(g)}})]})});Ine.displayName=Pne;var One="ToastFocusProxy",p3=k.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,s=WN(One,n);return c.jsx(qN,{"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()}})});p3.displayName=One;var o2="Toast",Lbe="toast.swipeStart",Rbe="toast.swipeMove",Ube="toast.swipeCancel",Dbe="toast.swipeEnd",Fne=k.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:s,...a}=e,[o,l]=Bo({prop:r,defaultProp:i??!0,onChange:s,caller:o2});return c.jsx(ba,{present:n||o,children:c.jsx($be,{open:o,...a,ref:t,onClose:()=>l(!1),onPause:Mi(e.onPause),onResume:Mi(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`),l(!1)})})})});Fne.displayName=o2;var[Qbe,Hbe]=jne(o2,{onClose(){}}),$be=k.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:s,onClose:a,onEscapeKeyDown:o,onPause:l,onResume:u,onSwipeStart:d,onSwipeMove:h,onSwipeCancel:f,onSwipeEnd:A,...p}=e,m=WN(o2,n),[g,y]=k.useState(null),v=tn(t,L=>y(L)),x=k.useRef(null),b=k.useRef(null),w=i||m.duration,S=k.useRef(0),_=k.useRef(w),E=k.useRef(0),{onToastAdd:j,onToastRemove:I}=m,T=Mi(()=>{var D;(g==null?void 0:g.contains(document.activeElement))&&((D=m.viewport)==null||D.focus()),a()}),N=k.useCallback(L=>{!L||L===1/0||(window.clearTimeout(E.current),S.current=new Date().getTime(),E.current=window.setTimeout(T,L))},[T]);k.useEffect(()=>{const L=m.viewport;if(L){const D=()=>{N(_.current),u==null||u()},H=()=>{const W=new Date().getTime()-S.current;_.current=_.current-W,window.clearTimeout(E.current),l==null||l()};return L.addEventListener(A3,H),L.addEventListener(f3,D),()=>{L.removeEventListener(A3,H),L.removeEventListener(f3,D)}}},[m.viewport,w,l,u,N]),k.useEffect(()=>{s&&!m.isClosePausedRef.current&&N(w)},[s,w,m.isClosePausedRef,N]),k.useEffect(()=>(j(),()=>I()),[j,I]);const F=k.useMemo(()=>g?Hne(g):null,[g]);return m.viewport?c.jsxs(c.Fragment,{children:[F&&c.jsx(zbe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:F}),c.jsx(Qbe,{scope:n,onClose:T,children:LA.createPortal(c.jsx(OU.ItemSlot,{scope:n,children:c.jsx(bbe,{asChild:!0,onEscapeKeyDown:at(o,()=>{m.isFocusedToastEscapeKeyDownRef.current||T(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:c.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 D=L.clientX-x.current.x,H=L.clientY-x.current.y,W=!!b.current,$=["left","right"].includes(m.swipeDirection),V=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,Q=$?V(0,D):0,ce=$?0:V(0,H),R=L.pointerType==="touch"?10:2,M={x:Q,y:ce},Y={originalEvent:L,delta:M};W?(b.current=M,zC(Rbe,h,Y,{discrete:!1})):i7(M,m.swipeDirection,R)?(b.current=M,zC(Lbe,d,Y,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(D)>R||Math.abs(H)>R)&&(x.current=null)}),onPointerUp:at(e.onPointerUp,L=>{const D=b.current,H=L.target;if(H.hasPointerCapture(L.pointerId)&&H.releasePointerCapture(L.pointerId),b.current=null,x.current=null,D){const W=L.currentTarget,$={originalEvent:L,delta:D};i7(D,m.swipeDirection,m.swipeThreshold)?zC(Dbe,A,$,{discrete:!0}):zC(Ube,f,$,{discrete:!0}),W.addEventListener("click",V=>V.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),zbe=e=>{const{__scopeToast:t,children:n,...r}=e,i=WN(o2,t),[s,a]=k.useState(!1),[o,l]=k.useState(!1);return qbe(()=>a(!0)),k.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),o?null:c.jsx(a2,{asChild:!0,children:c.jsx(qN,{...r,children:s&&c.jsxs(c.Fragment,{children:[i.label," ",n]})})})},Vbe="ToastTitle",Mne=k.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return c.jsx(_t.div,{...r,ref:t})});Mne.displayName=Vbe;var Kbe="ToastDescription",Lne=k.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return c.jsx(_t.div,{...r,ref:t})});Lne.displayName=Kbe;var Rne="ToastAction",Une=k.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?c.jsx(Qne,{altText:n,asChild:!0,children:c.jsx(FU,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Rne}\`. Expected non-empty \`string\`.`),null)});Une.displayName=Rne;var Dne="ToastClose",FU=k.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,i=Hbe(Dne,n);return c.jsx(Qne,{asChild:!0,children:c.jsx(_t.button,{type:"button",...r,ref:t,onClick:at(e.onClick,i.onClose)})})});FU.displayName=Dne;var Qne=k.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...i}=e;return c.jsx(_t.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function Hne(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),Wbe(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(...Hne(r))}}),t}function zC(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?kne(i,s):i.dispatchEvent(s)}var i7=(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 qbe(e=()=>{}){const t=Mi(e);Ui(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function Wbe(e){return e.nodeType===e.ELEMENT_NODE}function Gbe(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 yP(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Ybe=Tne,$ne=Ine,zne=Fne,Vne=Mne,Kne=Lne,qne=Une,Wne=FU;function Gne(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=Gne(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function _n(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Gne(e))&&(r&&(r+=" "),r+=t);return r}const s7=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,a7=_n,GN=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return a7(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 f=s7(d)||s7(h);return i[u][f]}),o=n&&Object.entries(n).reduce((u,d)=>{let[h,f]=d;return f===void 0||(u[h]=f),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:h,className:f,...A}=d;return Object.entries(A).every(p=>{let[m,g]=p;return Array.isArray(g)?g.includes({...s,...o}[m]):{...s,...o}[m]===g})?[...u,h,f]:u},[]);return a7(e,a,l,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 Xbe=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Yne=(...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 Jbe={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 Zbe=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...o},l)=>k.createElement("svg",{ref:l,...Jbe,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Yne("lucide",i),...o},[...a.map(([u,d])=>k.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 $e=(e,t)=>{const n=k.forwardRef(({className:r,...i},s)=>k.createElement(Zbe,{ref:s,iconNode:t,className:Yne(`lucide-${Xbe(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 HB=$e("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 l2=$e("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 Ma=$e("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 Xne=$e("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 Jne=$e("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 e1e=$e("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 t1e=$e("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 Mk=$e("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 n1e=$e("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 Zne=$e("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 ll=$e("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 r1e=$e("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 ere=$e("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 tre=$e("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 Jc=$e("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 ac=$e("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 nre=$e("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 oc=$e("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 i1e=$e("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 s1e=$e("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 MU=$e("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 z0=$e("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 rre=$e("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 c2=$e("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 ire=$e("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 a1e=$e("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 o1e=$e("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 l1e=$e("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 c1e=$e("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 Ka=$e("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 o7=$e("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 vb=$e("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 u1e=$e("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 d1e=$e("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 sre=$e("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 Xy=$e("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 are=$e("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 u2=$e("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 h1e=$e("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 A1e=$e("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 f1e=$e("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 p1e=$e("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 ore=$e("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 m1e=$e("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 g1e=$e("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 LU=$e("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 m3=$e("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 y1e=$e("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 v1e=$e("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 l7=$e("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 lre=$e("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 x1e=$e("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 w1e=$e("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 b1e=$e("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 C1e=$e("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 ga=$e("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 S1e=$e("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 k1e=$e("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 Lk=$e("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 xb=$e("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=$e("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 $B=$e("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 rA=$e("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 cre=$e("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 B1e=$e("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 ure=$e("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 gp=$e("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 _1e=$e("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 g3=$e("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 Mp=$e("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 E1e=$e("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 N1e=$e("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 Vc=$e("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 wb=$e("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 YN=$e("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 dre=$e("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 RU=$e("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 j1e=$e("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 T1e=$e("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 zs=$e("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 hre=$e("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 y3=$e("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 XN=$e("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 yl=$e("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 P1e=$e("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 I1e=$e("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 Are=$e("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 Lp=$e("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 fre=$e("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 O1e=$e("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=$e("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 UU=$e("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 F1e=$e("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 M1e=$e("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 u7=$e("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 qa=$e("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 mre=$e("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"}]]),DU="-",L1e=e=>{const t=U1e(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const o=a.split(DU);return o[0]===""&&o.length!==1&&o.shift(),gre(o,t)||R1e(a)},getConflictingClassGroupIds:(a,o)=>{const l=n[a]||[];return o&&r[a]?[...l,...r[a]]:l}}},gre=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?gre(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(DU);return(a=t.validators.find(({validator:o})=>o(s)))==null?void 0:a.classGroupId},d7=/^\[(.+)\]$/,R1e=e=>{if(d7.test(e)){const t=d7.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},U1e=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Q1e(Object.entries(e.classGroups),n).forEach(([s,a])=>{v3(a,r,s,t)}),r},v3=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:h7(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(D1e(i)){v3(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,a])=>{v3(a,h7(t,s),n,r)})})},h7=(e,t)=>{let n=e;return t.split(DU).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},D1e=e=>e.isThemeGetter,Q1e=(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,H1e=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)}}},yre="!",$1e=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,a=o=>{const l=[];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)){l.push(o.slice(d,g)),d=g+s;continue}if(y==="/"){h=g;continue}}y==="["?u++:y==="]"&&u--}const f=l.length===0?o:o.substring(d),A=f.startsWith(yre),p=A?f.substring(1):f,m=h&&h>d?h-d:void 0;return{modifiers:l,hasImportantModifier:A,baseClassName:p,maybePostfixModifierPosition:m}};return n?o=>n({className:o,parseClassName:a}):a},z1e=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},V1e=e=>({cache:H1e(e.cacheSize),parseClassName:$1e(e),...L1e(e)}),K1e=/\s+/,q1e=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],a=e.trim().split(K1e);let o="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{modifiers:d,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:A}=n(u);let p=!!A,m=r(p?f.substring(0,A):f);if(!m){if(!p){o=u+(o.length>0?" "+o:o);continue}if(m=r(f),!m){o=u+(o.length>0?" "+o:o);continue}p=!1}const g=z1e(d).join(":"),y=h?g+yre: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 W1e(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=vre(t))&&(r&&(r+=" "),r+=n);return r}const vre=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=vre(e[r]))&&(n&&(n+=" "),n+=t);return n};function G1e(e,...t){let n,r,i,s=a;function a(l){const u=t.reduce((d,h)=>h(d),e());return n=V1e(u),r=n.cache.get,i=n.cache.set,s=o,o(l)}function o(l){const u=r(l);if(u)return u;const d=q1e(l,n);return i(l,d),d}return function(){return s(W1e.apply(null,arguments))}}const fr=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},xre=/^\[(?:([a-z-]+):)?(.+)\]$/i,Y1e=/^\d+\/\d+$/,X1e=new Set(["px","full","screen"]),J1e=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Z1e=/\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$/,e2e=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,t2e=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,n2e=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Nu=e=>ay(e)||X1e.has(e)||Y1e.test(e),Wd=e=>V0(e,"length",u2e),ay=e=>!!e&&!Number.isNaN(Number(e)),vP=e=>V0(e,"number",ay),ix=e=>!!e&&Number.isInteger(Number(e)),r2e=e=>e.endsWith("%")&&ay(e.slice(0,-1)),sn=e=>xre.test(e),Gd=e=>J1e.test(e),i2e=new Set(["length","size","percentage"]),s2e=e=>V0(e,i2e,wre),a2e=e=>V0(e,"position",wre),o2e=new Set(["image","url"]),l2e=e=>V0(e,o2e,h2e),c2e=e=>V0(e,"",d2e),sx=()=>!0,V0=(e,t,n)=>{const r=xre.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},u2e=e=>Z1e.test(e)&&!e2e.test(e),wre=()=>!1,d2e=e=>t2e.test(e),h2e=e=>n2e.test(e),A2e=()=>{const e=fr("colors"),t=fr("spacing"),n=fr("blur"),r=fr("brightness"),i=fr("borderColor"),s=fr("borderRadius"),a=fr("borderSpacing"),o=fr("borderWidth"),l=fr("contrast"),u=fr("grayscale"),d=fr("hueRotate"),h=fr("invert"),f=fr("gap"),A=fr("gradientColorStops"),p=fr("gradientColorStopPositions"),m=fr("inset"),g=fr("margin"),y=fr("opacity"),v=fr("padding"),x=fr("saturate"),b=fr("scale"),w=fr("sepia"),S=fr("skew"),_=fr("space"),E=fr("translate"),j=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto",sn,t],N=()=>[sn,t],F=()=>["",Nu,Wd],L=()=>["auto",ay,sn],D=()=>["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"],V=()=>["","0",sn],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ce=()=>[ay,sn];return{cacheSize:500,separator:":",theme:{colors:[sx],spacing:[Nu,Wd],blur:["none","",Gd,sn],brightness:ce(),borderColor:[e],borderRadius:["none","","full",Gd,sn],borderSpacing:N(),borderWidth:F(),contrast:ce(),grayscale:V(),hueRotate:ce(),invert:V(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[r2e,Wd],inset:T(),margin:T(),opacity:ce(),padding:N(),saturate:ce(),scale:ce(),sepia:V(),skew:ce(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",sn]}],container:["container"],columns:[{columns:[Gd]}],"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:[...D(),sn]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],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",ix,sn]}],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",sn]}],grow:[{grow:V()}],shrink:[{shrink:V()}],order:[{order:["first","last","none",ix,sn]}],"grid-cols":[{"grid-cols":[sx]}],"col-start-end":[{col:["auto",{span:["full",ix,sn]},sn]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[sx]}],"row-start-end":[{row:["auto",{span:[ix,sn]},sn]}],"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",sn]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",sn]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"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":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",sn,t]}],"min-w":[{"min-w":[sn,t,"min","max","fit"]}],"max-w":[{"max-w":[sn,t,"none","full","min","max","fit","prose",{screen:[Gd]},Gd]}],h:[{h:[sn,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[sn,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[sn,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[sn,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Gd,Wd]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",vP]}],"font-family":[{font:[sx]}],"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",sn]}],"line-clamp":[{"line-clamp":["none",ay,vP]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Nu,sn]}],"list-image":[{"list-image":["none",sn]}],"list-style-type":[{list:["none","disc","decimal",sn]}],"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",Nu,Wd]}],"underline-offset":[{"underline-offset":["auto",Nu,sn]}],"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",sn]}],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",sn]}],"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:[...D(),a2e]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",s2e]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},l2e]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[A]}],"gradient-via":[{via:[A]}],"gradient-to":[{to:[A]}],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":[Nu,sn]}],"outline-w":[{outline:[Nu,Wd]}],"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":[Nu,Wd]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Gd,c2e]}],"shadow-color":[{shadow:[sx]}],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:[l]}],"drop-shadow":[{"drop-shadow":["","none",Gd,sn]}],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":[l]}],"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",sn]}],duration:[{duration:ce()}],ease:[{ease:["linear","in","out","in-out",sn]}],delay:[{delay:ce()}],animate:[{animate:["none","spin","ping","pulse","bounce",sn]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[ix,sn]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",sn]}],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",sn]}],"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",sn]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Nu,Wd,vP]}],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"]}}},f2e=G1e(A2e);function pt(...e){return f2e(_n(e))}const p2e=Ybe,bre=k.forwardRef(({className:e,...t},n)=>c.jsx($ne,{ref:n,className:pt("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}));bre.displayName=$ne.displayName;const m2e=GN("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"}}),Cre=k.forwardRef(({className:e,variant:t,...n},r)=>c.jsx(zne,{ref:r,className:pt(m2e({variant:t}),e),...n}));Cre.displayName=zne.displayName;const g2e=k.forwardRef(({className:e,...t},n)=>c.jsx(qne,{ref:n,className:pt("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}));g2e.displayName=qne.displayName;const Sre=k.forwardRef(({className:e,...t},n)=>c.jsx(Wne,{ref:n,className:pt("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:c.jsx(qa,{className:"h-4 w-4"})}));Sre.displayName=Wne.displayName;const kre=k.forwardRef(({className:e,...t},n)=>c.jsx(Vne,{ref:n,className:pt("text-sm font-semibold",e),...t}));kre.displayName=Vne.displayName;const Bre=k.forwardRef(({className:e,...t},n)=>c.jsx(Kne,{ref:n,className:pt("text-sm opacity-90",e),...t}));Bre.displayName=Kne.displayName;function y2e(){const{toasts:e}=RA();return c.jsxs(p2e,{children:[e.map(function({id:t,title:n,description:r,action:i,...s}){return c.jsxs(Cre,{...s,children:[c.jsxs("div",{className:"grid gap-1",children:[n&&c.jsx(kre,{children:n}),r&&c.jsx(Bre,{children:r})]}),i,c.jsx(Sre,{})]},t)}),c.jsx(bre,{})]})}var A7=["light","dark"],v2e="(prefers-color-scheme: dark)",x2e=k.createContext(void 0),w2e={setTheme:e=>{},themes:[]},b2e=()=>{var e;return(e=k.useContext(x2e))!=null?e:w2e};k.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:s,value:a,attrs:o,nonce:l})=>{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?A7.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(p,m=!1,g=!0)=>{let y=a?a[p]:p,v=m?p+"|| ''":`'${y}'`,x="";return i&&g&&!m&&A7.includes(p)&&(x+=`d.style.colorScheme = '${p}';`),n==="class"?m||y?x+=`c.add(${v})`:x+="null":y&&(x+=`d[s](n,${v})`),x},A=e?`!function(){${d}${f(e)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${v2e}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${f(a?"x[e]":"e",!0)}}${u?"":"else{"+f(s,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${f(a?"x[e]":"e",!0)}}else{${f(s,!1,!1)};}${h}}catch(t){}}();`;return k.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:A}})});var C2e=e=>{switch(e){case"success":return B2e;case"info":return E2e;case"warning":return _2e;case"error":return N2e;default:return null}},S2e=Array(12).fill(0),k2e=({visible:e,className:t})=>re.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},re.createElement("div",{className:"sonner-spinner"},S2e.map((n,r)=>re.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),B2e=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"})),_2e=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"})),E2e=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"})),N2e=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"})),j2e=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"})),T2e=()=>{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},x3=1,P2e=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:x3++,a=this.toasts.find(l=>l.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(l=>l.id===s?(this.publish({...l,...t,id:s,title:r}),{...l,...t,id:s,dismissible:o,title:r}):l):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(O2e(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)}),l=()=>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:l}:Object.assign(r,{unwrap:l})},this.custom=(t,n)=>{let r=(n==null?void 0:n.id)||x3++;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}},ja=new P2e,I2e=(e,t)=>{let n=(t==null?void 0:t.id)||x3++;return ja.addToast({title:e,...t,id:n}),n},O2e=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",F2e=I2e,M2e=()=>ja.toasts,L2e=()=>ja.getActiveToasts(),yw=Object.assign(F2e,{success:ja.success,info:ja.info,warning:ja.warning,error:ja.error,custom:ja.custom,message:ja.message,promise:ja.promise,dismiss:ja.dismiss,loading:ja.loading},{getHistory:M2e,getToasts:L2e});function R2e(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))}R2e(`: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 VC(e){return e.label!==void 0}var U2e=3,D2e="32px",Q2e="16px",f7=4e3,H2e=356,$2e=14,z2e=20,V2e=200;function Pl(...e){return e.filter(Boolean).join(" ")}function K2e(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var q2e=e=>{var t,n,r,i,s,a,o,l,u,d,h;let{invert:f,toast:A,unstyled:p,interacting:m,setHeights:g,visibleToasts:y,heights:v,index:x,toasts:b,expanded:w,removeToast:S,defaultRichColors:_,closeButton:E,style:j,cancelButtonStyle:I,actionButtonStyle:T,className:N="",descriptionClassName:F="",duration:L,position:D,gap:H,loadingIcon:W,expandByDefault:$,classNames:V,icons:Q,closeButtonAriaLabel:ce="Close toast",pauseWhenPageIsHidden:R}=e,[M,Y]=re.useState(null),[X,K]=re.useState(null),[Z,de]=re.useState(!1),[se,ie]=re.useState(!1),[he,ue]=re.useState(!1),[Se,Fe]=re.useState(!1),[te,_e]=re.useState(!1),[Ze,et]=re.useState(0),[Te,st]=re.useState(0),xe=re.useRef(A.duration||L||f7),Qe=re.useRef(null),ze=re.useRef(null),Dt=x===0,dt=x+1<=y,ye=A.type,Ee=A.dismissible!==!1,We=A.className||"",Ue=A.descriptionClassName||"",Ge=re.useMemo(()=>v.findIndex(Ut=>Ut.toastId===A.id)||0,[v,A.id]),pe=re.useMemo(()=>{var Ut;return(Ut=A.closeButton)!=null?Ut:E},[A.closeButton,E]),mt=re.useMemo(()=>A.duration||L||f7,[A.duration,L]),ct=re.useRef(0),xt=re.useRef(0),Mt=re.useRef(0),zt=re.useRef(null),[ht,Lt]=D.split("-"),Pt=re.useMemo(()=>v.reduce((Ut,Wt,wn)=>wn>=Ge?Ut:Ut+Wt.height,0),[v,Ge]),qt=T2e(),er=A.invert||f,en=ye==="loading";xt.current=re.useMemo(()=>Ge*H+Pt,[Ge,Pt]),re.useEffect(()=>{xe.current=mt},[mt]),re.useEffect(()=>{de(!0)},[]),re.useEffect(()=>{let Ut=ze.current;if(Ut){let Wt=Ut.getBoundingClientRect().height;return st(Wt),g(wn=>[{toastId:A.id,height:Wt,position:A.position},...wn]),()=>g(wn=>wn.filter(Dr=>Dr.toastId!==A.id))}},[g,A.id]),re.useLayoutEffect(()=>{if(!Z)return;let Ut=ze.current,Wt=Ut.style.height;Ut.style.height="auto";let wn=Ut.getBoundingClientRect().height;Ut.style.height=Wt,st(wn),g(Dr=>Dr.find(yt=>yt.toastId===A.id)?Dr.map(yt=>yt.toastId===A.id?{...yt,height:wn}:yt):[{toastId:A.id,height:wn,position:A.position},...Dr])},[Z,A.title,A.description,g,A.id]);let kt=re.useCallback(()=>{ie(!0),et(xt.current),g(Ut=>Ut.filter(Wt=>Wt.toastId!==A.id)),setTimeout(()=>{S(A)},V2e)},[A,S,g,xt]);re.useEffect(()=>{if(A.promise&&ye==="loading"||A.duration===1/0||A.type==="loading")return;let Ut;return w||m||R&&qt?(()=>{if(Mt.current<ct.current){let Wt=new Date().getTime()-ct.current;xe.current=xe.current-Wt}Mt.current=new Date().getTime()})():xe.current!==1/0&&(ct.current=new Date().getTime(),Ut=setTimeout(()=>{var Wt;(Wt=A.onAutoClose)==null||Wt.call(A,A),kt()},xe.current)),()=>clearTimeout(Ut)},[w,m,A,ye,R,qt,kt]),re.useEffect(()=>{A.delete&&kt()},[kt,A.delete]);function Tn(){var Ut,Wt,wn;return Q!=null&&Q.loading?re.createElement("div",{className:Pl(V==null?void 0:V.loader,(Ut=A==null?void 0:A.classNames)==null?void 0:Ut.loader,"sonner-loader"),"data-visible":ye==="loading"},Q.loading):W?re.createElement("div",{className:Pl(V==null?void 0:V.loader,(Wt=A==null?void 0:A.classNames)==null?void 0:Wt.loader,"sonner-loader"),"data-visible":ye==="loading"},W):re.createElement(k2e,{className:Pl(V==null?void 0:V.loader,(wn=A==null?void 0:A.classNames)==null?void 0:wn.loader),visible:ye==="loading"})}return re.createElement("li",{tabIndex:0,ref:ze,className:Pl(N,We,V==null?void 0:V.toast,(t=A==null?void 0:A.classNames)==null?void 0:t.toast,V==null?void 0:V.default,V==null?void 0:V[ye],(n=A==null?void 0:A.classNames)==null?void 0:n[ye]),"data-sonner-toast":"","data-rich-colors":(r=A.richColors)!=null?r:_,"data-styled":!(A.jsx||A.unstyled||p),"data-mounted":Z,"data-promise":!!A.promise,"data-swiped":te,"data-removed":se,"data-visible":dt,"data-y-position":ht,"data-x-position":Lt,"data-index":x,"data-front":Dt,"data-swiping":he,"data-dismissible":Ee,"data-type":ye,"data-invert":er,"data-swipe-out":Se,"data-swipe-direction":X,"data-expanded":!!(w||$&&Z),style:{"--index":x,"--toasts-before":x,"--z-index":b.length-x,"--offset":`${se?Ze:xt.current}px`,"--initial-height":$?"auto":`${Te}px`,...j,...A.style},onDragEnd:()=>{ue(!1),Y(null),zt.current=null},onPointerDown:Ut=>{en||!Ee||(Qe.current=new Date,et(xt.current),Ut.target.setPointerCapture(Ut.pointerId),Ut.target.tagName!=="BUTTON"&&(ue(!0),zt.current={x:Ut.clientX,y:Ut.clientY}))},onPointerUp:()=>{var Ut,Wt,wn,Dr;if(Se||!Ee)return;zt.current=null;let yt=Number(((Ut=ze.current)==null?void 0:Ut.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Hi=Number(((Wt=ze.current)==null?void 0:Wt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ts=new Date().getTime()-((wn=Qe.current)==null?void 0:wn.getTime()),Sr=M==="x"?yt:Hi,Jr=Math.abs(Sr)/ts;if(Math.abs(Sr)>=z2e||Jr>.11){et(xt.current),(Dr=A.onDismiss)==null||Dr.call(A,A),K(M==="x"?yt>0?"right":"left":Hi>0?"down":"up"),kt(),Fe(!0),_e(!1);return}ue(!1),Y(null)},onPointerMove:Ut=>{var Wt,wn,Dr,yt;if(!zt.current||!Ee||((Wt=window.getSelection())==null?void 0:Wt.toString().length)>0)return;let Hi=Ut.clientY-zt.current.y,ts=Ut.clientX-zt.current.x,Sr=(wn=e.swipeDirections)!=null?wn:K2e(D);!M&&(Math.abs(ts)>1||Math.abs(Hi)>1)&&Y(Math.abs(ts)>Math.abs(Hi)?"x":"y");let Jr={x:0,y:0};M==="y"?(Sr.includes("top")||Sr.includes("bottom"))&&(Sr.includes("top")&&Hi<0||Sr.includes("bottom")&&Hi>0)&&(Jr.y=Hi):M==="x"&&(Sr.includes("left")||Sr.includes("right"))&&(Sr.includes("left")&&ts<0||Sr.includes("right")&&ts>0)&&(Jr.x=ts),(Math.abs(Jr.x)>0||Math.abs(Jr.y)>0)&&_e(!0),(Dr=ze.current)==null||Dr.style.setProperty("--swipe-amount-x",`${Jr.x}px`),(yt=ze.current)==null||yt.style.setProperty("--swipe-amount-y",`${Jr.y}px`)}},pe&&!A.jsx?re.createElement("button",{"aria-label":ce,"data-disabled":en,"data-close-button":!0,onClick:en||!Ee?()=>{}:()=>{var Ut;kt(),(Ut=A.onDismiss)==null||Ut.call(A,A)},className:Pl(V==null?void 0:V.closeButton,(i=A==null?void 0:A.classNames)==null?void 0:i.closeButton)},(s=Q==null?void 0:Q.close)!=null?s:j2e):null,A.jsx||k.isValidElement(A.title)?A.jsx?A.jsx:typeof A.title=="function"?A.title():A.title:re.createElement(re.Fragment,null,ye||A.icon||A.promise?re.createElement("div",{"data-icon":"",className:Pl(V==null?void 0:V.icon,(a=A==null?void 0:A.classNames)==null?void 0:a.icon)},A.promise||A.type==="loading"&&!A.icon?A.icon||Tn():null,A.type!=="loading"?A.icon||(Q==null?void 0:Q[ye])||C2e(ye):null):null,re.createElement("div",{"data-content":"",className:Pl(V==null?void 0:V.content,(o=A==null?void 0:A.classNames)==null?void 0:o.content)},re.createElement("div",{"data-title":"",className:Pl(V==null?void 0:V.title,(l=A==null?void 0:A.classNames)==null?void 0:l.title)},typeof A.title=="function"?A.title():A.title),A.description?re.createElement("div",{"data-description":"",className:Pl(F,Ue,V==null?void 0:V.description,(u=A==null?void 0:A.classNames)==null?void 0:u.description)},typeof A.description=="function"?A.description():A.description):null),k.isValidElement(A.cancel)?A.cancel:A.cancel&&VC(A.cancel)?re.createElement("button",{"data-button":!0,"data-cancel":!0,style:A.cancelButtonStyle||I,onClick:Ut=>{var Wt,wn;VC(A.cancel)&&Ee&&((wn=(Wt=A.cancel).onClick)==null||wn.call(Wt,Ut),kt())},className:Pl(V==null?void 0:V.cancelButton,(d=A==null?void 0:A.classNames)==null?void 0:d.cancelButton)},A.cancel.label):null,k.isValidElement(A.action)?A.action:A.action&&VC(A.action)?re.createElement("button",{"data-button":!0,"data-action":!0,style:A.actionButtonStyle||T,onClick:Ut=>{var Wt,wn;VC(A.action)&&((wn=(Wt=A.action).onClick)==null||wn.call(Wt,Ut),!Ut.defaultPrevented&&kt())},className:Pl(V==null?void 0:V.actionButton,(h=A==null?void 0:A.classNames)==null?void 0:h.actionButton)},A.action.label):null))};function p7(){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 W2e(e,t){let n={};return[e,t].forEach((r,i)=>{let s=i===1,a=s?"--mobile-offset":"--offset",o=s?Q2e:D2e;function l(u){["top","right","bottom","left"].forEach(d=>{n[`${a}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${a}-${u}`]=o:n[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(o)}),n}var G2e=k.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:s,closeButton:a,className:o,offset:l,mobileOffset:u,theme:d="light",richColors:h,duration:f,style:A,visibleToasts:p=U2e,toastOptions:m,dir:g=p7(),gap:y=$2e,loadingIcon:v,icons:x,containerAriaLabel:b="Notifications",pauseWhenPageIsHidden:w}=e,[S,_]=re.useState([]),E=re.useMemo(()=>Array.from(new Set([r].concat(S.filter(R=>R.position).map(R=>R.position)))),[S,r]),[j,I]=re.useState([]),[T,N]=re.useState(!1),[F,L]=re.useState(!1),[D,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,""),V=re.useRef(null),Q=re.useRef(!1),ce=re.useCallback(R=>{_(M=>{var Y;return(Y=M.find(X=>X.id===R.id))!=null&&Y.delete||ja.dismiss(R.id),M.filter(({id:X})=>X!==R.id)})},[]);return re.useEffect(()=>ja.subscribe(R=>{if(R.dismiss){_(M=>M.map(Y=>Y.id===R.id?{...Y,delete:!0}:Y));return}setTimeout(()=>{PU.flushSync(()=>{_(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(()=>{S.length<=1&&N(!1)},[S]),re.useEffect(()=>{let R=M=>{var Y,X;i.every(K=>M[K]||M.code===K)&&(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()=>{V.current&&(V.current.focus({preventScroll:!0}),V.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},E.map((R,M)=>{var Y;let[X,K]=R.split("-");return S.length?re.createElement("ol",{key:R,dir:g==="auto"?p7():g,tabIndex:-1,ref:W,className:o,"data-sonner-toaster":!0,"data-theme":D,"data-y-position":X,"data-lifted":T&&S.length>1&&!s,"data-x-position":K,style:{"--front-toast-height":`${((Y=j[0])==null?void 0:Y.height)||0}px`,"--width":`${H2e}px`,"--gap":`${y}px`,...A,...W2e(l,u)},onBlur:Z=>{Q.current&&!Z.currentTarget.contains(Z.relatedTarget)&&(Q.current=!1,V.current&&(V.current.focus({preventScroll:!0}),V.current=null))},onFocus:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||Q.current||(Q.current=!0,V.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)},S.filter(Z=>!Z.position&&M===0||Z.position===R).map((Z,de)=>{var se,ie;return re.createElement(q2e,{key:Z.id,icons:x,index:de,toast:Z,defaultRichColors:h,duration:(se=m==null?void 0:m.duration)!=null?se:f,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:n,visibleToasts:p,closeButton:(ie=m==null?void 0:m.closeButton)!=null?ie: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:S.filter(he=>he.position==Z.position),heights:j.filter(he=>he.position==Z.position),setHeights:I,expandByDefault:s,gap:y,loadingIcon:v,expanded:T,pauseWhenPageIsHidden:w,swipeDirections:e.swipeDirections})})):null}))});const Y2e=({...e})=>{const{theme:t="system"}=b2e();return c.jsx(G2e,{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 X2e=QR[" useId ".trim().toString()]||(()=>{}),J2e=0;function cl(e){const[t,n]=k.useState(X2e());return Ui(()=>{n(r=>r??String(J2e++))},[e]),t?`radix-${t}`:""}const Z2e=["top","right","bottom","left"],wA=Math.min,mo=Math.max,zB=Math.round,KC=Math.floor,Zc=e=>({x:e,y:e}),eCe={left:"right",right:"left",bottom:"top",top:"bottom"},tCe={start:"end",end:"start"};function w3(e,t,n){return mo(e,wA(t,n))}function Ad(e,t){return typeof e=="function"?e(t):e}function fd(e){return e.split("-")[0]}function K0(e){return e.split("-")[1]}function QU(e){return e==="x"?"y":"x"}function HU(e){return e==="y"?"height":"width"}const nCe=new Set(["top","bottom"]);function Kc(e){return nCe.has(fd(e))?"y":"x"}function $U(e){return QU(Kc(e))}function rCe(e,t,n){n===void 0&&(n=!1);const r=K0(e),i=$U(e),s=HU(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=VB(a)),[a,VB(a)]}function iCe(e){const t=VB(e);return[b3(e),t,b3(t)]}function b3(e){return e.replace(/start|end/g,t=>tCe[t])}const m7=["left","right"],g7=["right","left"],sCe=["top","bottom"],aCe=["bottom","top"];function oCe(e,t,n){switch(e){case"top":case"bottom":return n?t?g7:m7:t?m7:g7;case"left":case"right":return t?sCe:aCe;default:return[]}}function lCe(e,t,n,r){const i=K0(e);let s=oCe(fd(e),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),t&&(s=s.concat(s.map(b3)))),s}function VB(e){return e.replace(/left|right|bottom|top/g,t=>eCe[t])}function cCe(e){return{top:0,right:0,bottom:0,left:0,...e}}function _re(e){return typeof e!="number"?cCe(e):{top:e,right:e,bottom:e,left:e}}function KB(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 y7(e,t,n){let{reference:r,floating:i}=e;const s=Kc(t),a=$U(t),o=HU(a),l=fd(t),u=s==="y",d=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,f=r[o]/2-i[o]/2;let A;switch(l){case"top":A={x:d,y:r.y-i.height};break;case"bottom":A={x:d,y:r.y+r.height};break;case"right":A={x:r.x+r.width,y:h};break;case"left":A={x:r.x-i.width,y:h};break;default:A={x:r.x,y:r.y}}switch(K0(t)){case"start":A[a]-=f*(n&&u?-1:1);break;case"end":A[a]+=f*(n&&u?-1:1);break}return A}const uCe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,o=s.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:h}=y7(u,r,l),f=r,A={},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:f,strategy:i,middlewareData:A,rects:u,platform:a,elements:{reference:e,floating:t}});d=v??d,h=x??h,A={...A,[g]:{...A[g],...b}},w&&p<=50&&(p++,typeof w=="object"&&(w.placement&&(f=w.placement),w.rects&&(u=w.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):w.rects),{x:d,y:h}=y7(u,f,l)),m=-1)}return{x:d,y:h,placement:f,strategy:i,middlewareData:A}};async function bb(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:a,elements:o,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:f=!1,padding:A=0}=Ad(t,e),p=_re(A),g=o[f?h==="floating"?"reference":"floating":h],y=KB(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:l})),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=KB(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:v,offsetParent:x,strategy:l}):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 dCe=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:a,elements:o,middlewareData:l}=t,{element:u,padding:d=0}=Ad(e,t)||{};if(u==null)return{};const h=_re(d),f={x:n,y:r},A=$U(i),p=HU(A),m=await a.getDimensions(u),g=A==="y",y=g?"top":"left",v=g?"bottom":"right",x=g?"clientHeight":"clientWidth",b=s.reference[p]+s.reference[A]-f[A]-s.floating[p],w=f[A]-s.reference[A],S=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let _=S?S[x]:0;(!_||!await(a.isElement==null?void 0:a.isElement(S)))&&(_=o.floating[x]||s.floating[p]);const E=b/2-w/2,j=_/2-m[p]/2-1,I=wA(h[y],j),T=wA(h[v],j),N=I,F=_-m[p]-T,L=_/2-m[p]/2+E,D=w3(N,L,F),H=!l.arrow&&K0(i)!=null&&L!==D&&s.reference[p]/2-(L<N?I:T)-m[p]/2<0,W=H?L<N?L-N:L-F:0;return{[A]:f[A]+W,data:{[A]:D,centerOffset:L-D-W,...H&&{alignmentOffset:W}},reset:H}}}),hCe=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:l,elements:u}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:f,fallbackStrategy:A="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=Ad(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=fd(i),v=Kc(o),x=fd(o)===o,b=await(l.isRTL==null?void 0:l.isRTL(u.floating)),w=f||(x||!m?[VB(o)]:iCe(o)),S=p!=="none";!f&&S&&w.push(...lCe(o,m,p,b));const _=[o,...w],E=await bb(t,g),j=[];let I=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&j.push(E[y]),h){const L=rCe(i,a,b);j.push(E[L[0]],E[L[1]])}if(I=[...I,{placement:i,overflows:j}],!j.every(L=>L<=0)){var T,N;const L=(((T=s.flip)==null?void 0:T.index)||0)+1,D=_[L];if(D&&(!(h==="alignment"?v!==Kc(D):!1)||I.every($=>$.overflows[0]>0&&Kc($.placement)===v)))return{data:{index:L,overflows:I},reset:{placement:D}};let H=(N=I.filter(W=>W.overflows[0]<=0).sort((W,$)=>W.overflows[1]-$.overflows[1])[0])==null?void 0:N.placement;if(!H)switch(A){case"bestFit":{var F;const W=(F=I.filter($=>{if(S){const V=Kc($.placement);return V===v||V==="y"}return!0}).map($=>[$.placement,$.overflows.filter(V=>V>0).reduce((V,Q)=>V+Q,0)]).sort(($,V)=>$[1]-V[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 v7(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function x7(e){return Z2e.some(t=>e[t]>=0)}const ACe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Ad(e,t);switch(r){case"referenceHidden":{const s=await bb(t,{...i,elementContext:"reference"}),a=v7(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:x7(a)}}}case"escaped":{const s=await bb(t,{...i,altBoundary:!0}),a=v7(s,n.floating);return{data:{escapedOffsets:a,escaped:x7(a)}}}default:return{}}}}},Ere=new Set(["left","top"]);async function fCe(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=fd(n),o=K0(n),l=Kc(n)==="y",u=Ere.has(a)?-1:1,d=s&&l?-1:1,h=Ad(t,e);let{mainAxis:f,crossAxis:A,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"&&(A=o==="end"?p*-1:p),l?{x:A*d,y:f*u}:{x:f*u,y:A*d}}const pCe=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,l=await fCe(t,e);return a===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:a}}}}},mCe=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}}},...l}=Ad(e,t),u={x:n,y:r},d=await bb(t,l),h=Kc(fd(i)),f=QU(h);let A=u[f],p=u[h];if(s){const g=f==="y"?"top":"left",y=f==="y"?"bottom":"right",v=A+d[g],x=A-d[y];A=w3(v,A,x)}if(a){const g=h==="y"?"top":"left",y=h==="y"?"bottom":"right",v=p+d[g],x=p-d[y];p=w3(v,p,x)}const m=o.fn({...t,[f]:A,[h]:p});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[f]:s,[h]:a}}}}}},gCe=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:l=!0,crossAxis:u=!0}=Ad(e,t),d={x:n,y:r},h=Kc(i),f=QU(h);let A=d[f],p=d[h];const m=Ad(o,t),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const x=f==="y"?"height":"width",b=s.reference[f]-s.floating[x]+g.mainAxis,w=s.reference[f]+s.reference[x]-g.mainAxis;A<b?A=b:A>w&&(A=w)}if(u){var y,v;const x=f==="y"?"width":"height",b=Ere.has(fd(i)),w=s.reference[h]-s.floating[x]+(b&&((y=a.offset)==null?void 0:y[h])||0)+(b?0:g.crossAxis),S=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>S&&(p=S)}return{[f]:A,[h]:p}}}},yCe=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:l=()=>{},...u}=Ad(e,t),d=await bb(t,u),h=fd(i),f=K0(i),A=Kc(i)==="y",{width:p,height:m}=s.floating;let g,y;h==="top"||h==="bottom"?(g=h,y=f===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(y=h,g=f==="end"?"top":"bottom");const v=m-d.top-d.bottom,x=p-d.left-d.right,b=wA(m-d[g],v),w=wA(p-d[y],x),S=!t.middlewareData.shift;let _=b,E=w;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(_=v),S&&!f){const I=mo(d.left,0),T=mo(d.right,0),N=mo(d.top,0),F=mo(d.bottom,0);A?E=p-2*(I!==0||T!==0?I+T:mo(d.left,d.right)):_=m-2*(N!==0||F!==0?N+F:mo(d.top,d.bottom))}await l({...t,availableWidth:E,availableHeight:_});const j=await a.getDimensions(o.floating);return p!==j.width||m!==j.height?{reset:{rects:!0}}:{}}}};function JN(){return typeof window<"u"}function q0(e){return Nre(e)?(e.nodeName||"").toLowerCase():"#document"}function Co(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function du(e){var t;return(t=(Nre(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Nre(e){return JN()?e instanceof Node||e instanceof Co(e).Node:!1}function dc(e){return JN()?e instanceof Element||e instanceof Co(e).Element:!1}function au(e){return JN()?e instanceof HTMLElement||e instanceof Co(e).HTMLElement:!1}function w7(e){return!JN()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Co(e).ShadowRoot}const vCe=new Set(["inline","contents"]);function d2(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=hc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!vCe.has(i)}const xCe=new Set(["table","td","th"]);function wCe(e){return xCe.has(q0(e))}const bCe=[":popover-open",":modal"];function ZN(e){return bCe.some(t=>{try{return e.matches(t)}catch{return!1}})}const CCe=["transform","translate","scale","rotate","perspective"],SCe=["transform","translate","scale","rotate","perspective","filter"],kCe=["paint","layout","strict","content"];function zU(e){const t=VU(),n=dc(e)?hc(e):e;return CCe.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)||SCe.some(r=>(n.willChange||"").includes(r))||kCe.some(r=>(n.contain||"").includes(r))}function BCe(e){let t=bA(e);for(;au(t)&&!Jy(t);){if(zU(t))return t;if(ZN(t))return null;t=bA(t)}return null}function VU(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const _Ce=new Set(["html","body","#document"]);function Jy(e){return _Ce.has(q0(e))}function hc(e){return Co(e).getComputedStyle(e)}function ej(e){return dc(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bA(e){if(q0(e)==="html")return e;const t=e.assignedSlot||e.parentNode||w7(e)&&e.host||du(e);return w7(t)?t.host:t}function jre(e){const t=bA(e);return Jy(t)?e.ownerDocument?e.ownerDocument.body:e.body:au(t)&&d2(t)?t:jre(t)}function Cb(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=jre(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),a=Co(i);if(s){const o=C3(a);return t.concat(a,a.visualViewport||[],d2(i)?i:[],o&&n?Cb(o):[])}return t.concat(i,Cb(i,[],n))}function C3(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Tre(e){const t=hc(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=au(e),s=i?e.offsetWidth:n,a=i?e.offsetHeight:r,o=zB(n)!==s||zB(r)!==a;return o&&(n=s,r=a),{width:n,height:r,$:o}}function KU(e){return dc(e)?e:e.contextElement}function oy(e){const t=KU(e);if(!au(t))return Zc(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=Tre(t);let a=(s?zB(n.width):n.width)/r,o=(s?zB(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const ECe=Zc(0);function Pre(e){const t=Co(e);return!VU()||!t.visualViewport?ECe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function NCe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Co(e)?!1:t}function Rp(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=KU(e);let a=Zc(1);t&&(r?dc(r)&&(a=oy(r)):a=oy(e));const o=NCe(s,n,r)?Pre(s):Zc(0);let l=(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 f=Co(s),A=r&&dc(r)?Co(r):r;let p=f,m=C3(p);for(;m&&r&&A!==p;){const g=oy(m),y=m.getBoundingClientRect(),v=hc(m),x=y.left+(m.clientLeft+parseFloat(v.paddingLeft))*g.x,b=y.top+(m.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,u*=g.y,d*=g.x,h*=g.y,l+=x,u+=b,p=Co(m),m=C3(p)}}return KB({width:d,height:h,x:l,y:u})}function qU(e,t){const n=ej(e).scrollLeft;return t?t.left+n:Rp(du(e)).left+n}function Ire(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:qU(e,r)),s=r.top+t.scrollTop;return{x:i,y:s}}function jCe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",a=du(r),o=t?ZN(t.floating):!1;if(r===a||o&&s)return n;let l={scrollLeft:0,scrollTop:0},u=Zc(1);const d=Zc(0),h=au(r);if((h||!h&&!s)&&((q0(r)!=="body"||d2(a))&&(l=ej(r)),au(r))){const A=Rp(r);u=oy(r),d.x=A.x+r.clientLeft,d.y=A.y+r.clientTop}const f=a&&!h&&!s?Ire(a,l,!0):Zc(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+f.x,y:n.y*u.y-l.scrollTop*u.y+d.y+f.y}}function TCe(e){return Array.from(e.getClientRects())}function PCe(e){const t=du(e),n=ej(e),r=e.ownerDocument.body,i=mo(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=mo(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+qU(e);const o=-n.scrollTop;return hc(r).direction==="rtl"&&(a+=mo(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:a,y:o}}function ICe(e,t){const n=Co(e),r=du(e),i=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,o=0,l=0;if(i){s=i.width,a=i.height;const u=VU();(!u||u&&t==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:s,height:a,x:o,y:l}}const OCe=new Set(["absolute","fixed"]);function FCe(e,t){const n=Rp(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=au(e)?oy(e):Zc(1),a=e.clientWidth*s.x,o=e.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:a,height:o,x:l,y:u}}function b7(e,t,n){let r;if(t==="viewport")r=ICe(e,n);else if(t==="document")r=PCe(du(e));else if(dc(t))r=FCe(t,n);else{const i=Pre(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return KB(r)}function Ore(e,t){const n=bA(e);return n===t||!dc(n)||Jy(n)?!1:hc(n).position==="fixed"||Ore(n,t)}function MCe(e,t){const n=t.get(e);if(n)return n;let r=Cb(e,[],!1).filter(o=>dc(o)&&q0(o)!=="body"),i=null;const s=hc(e).position==="fixed";let a=s?bA(e):e;for(;dc(a)&&!Jy(a);){const o=hc(a),l=zU(a);!l&&o.position==="fixed"&&(i=null),(s?!l&&!i:!l&&o.position==="static"&&!!i&&OCe.has(i.position)||d2(a)&&!l&&Ore(e,a))?r=r.filter(d=>d!==a):i=o,a=bA(a)}return t.set(e,r),r}function LCe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?ZN(t)?[]:MCe(t,this._c):[].concat(n),r],o=a[0],l=a.reduce((u,d)=>{const h=b7(t,d,i);return u.top=mo(h.top,u.top),u.right=wA(h.right,u.right),u.bottom=wA(h.bottom,u.bottom),u.left=mo(h.left,u.left),u},b7(t,o,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function RCe(e){const{width:t,height:n}=Tre(e);return{width:t,height:n}}function UCe(e,t,n){const r=au(t),i=du(t),s=n==="fixed",a=Rp(e,!0,s,t);let o={scrollLeft:0,scrollTop:0};const l=Zc(0);function u(){l.x=qU(i)}if(r||!r&&!s)if((q0(t)!=="body"||d2(i))&&(o=ej(t)),r){const A=Rp(t,!0,s,t);l.x=A.x+t.clientLeft,l.y=A.y+t.clientTop}else i&&u();s&&!r&&i&&u();const d=i&&!r&&!s?Ire(i,o):Zc(0),h=a.left+o.scrollLeft-l.x-d.x,f=a.top+o.scrollTop-l.y-d.y;return{x:h,y:f,width:a.width,height:a.height}}function xP(e){return hc(e).position==="static"}function C7(e,t){if(!au(e)||hc(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return du(e)===n&&(n=n.ownerDocument.body),n}function Fre(e,t){const n=Co(e);if(ZN(e))return n;if(!au(e)){let i=bA(e);for(;i&&!Jy(i);){if(dc(i)&&!xP(i))return i;i=bA(i)}return n}let r=C7(e,t);for(;r&&wCe(r)&&xP(r);)r=C7(r,t);return r&&Jy(r)&&xP(r)&&!zU(r)?n:r||BCe(e)||n}const DCe=async function(e){const t=this.getOffsetParent||Fre,n=this.getDimensions,r=await n(e.floating);return{reference:UCe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function QCe(e){return hc(e).direction==="rtl"}const HCe={convertOffsetParentRelativeRectToViewportRelativeRect:jCe,getDocumentElement:du,getClippingRect:LCe,getOffsetParent:Fre,getElementRects:DCe,getClientRects:TCe,getDimensions:RCe,getScale:oy,isElement:dc,isRTL:QCe};function Mre(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $Ce(e,t){let n=null,r;const i=du(e);function s(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function a(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:d,top:h,width:f,height:A}=u;if(o||t(),!f||!A)return;const p=KC(h),m=KC(i.clientWidth-(d+f)),g=KC(i.clientHeight-(h+A)),y=KC(d),x={rootMargin:-p+"px "+-m+"px "+-g+"px "+-y+"px",threshold:mo(0,wA(1,l))||1};let b=!0;function w(S){const _=S[0].intersectionRatio;if(_!==l){if(!b)return a();_?a(!1,_):r=setTimeout(()=>{a(!1,1e-7)},1e3)}_===1&&!Mre(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 zCe(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:l=!1}=r,u=KU(e),d=i||s?[...u?Cb(u):[],...Cb(t)]:[];d.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const h=u&&o?$Ce(u,n):null;let f=-1,A=null;a&&(A=new ResizeObserver(y=>{let[v]=y;v&&v.target===u&&A&&(A.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=A)==null||x.observe(t)})),n()}),u&&!l&&A.observe(u),A.observe(t));let p,m=l?Rp(e):null;l&&g();function g(){const y=Rp(e);m&&!Mre(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=A)==null||y.disconnect(),A=null,l&&cancelAnimationFrame(p)}}const VCe=pCe,KCe=mCe,qCe=hCe,WCe=yCe,GCe=ACe,S7=dCe,YCe=gCe,XCe=(e,t,n)=>{const r=new Map,i={platform:HCe,...n},s={...i.platform,_c:r};return uCe(e,t,{...i,platform:s})};var JCe=typeof document<"u",ZCe=function(){},Rk=JCe?k.useLayoutEffect:ZCe;function qB(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(!qB(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)&&!qB(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Lre(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function k7(e,t){const n=Lre(e);return Math.round(t*n)/n}function wP(e){const t=k.useRef(e);return Rk(()=>{t.current=e}),t}function eSe(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:l,open:u}=e,[d,h]=k.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,A]=k.useState(r);qB(f,r)||A(r);const[p,m]=k.useState(null),[g,y]=k.useState(null),v=k.useCallback($=>{$!==S.current&&(S.current=$,m($))},[]),x=k.useCallback($=>{$!==_.current&&(_.current=$,y($))},[]),b=s||p,w=a||g,S=k.useRef(null),_=k.useRef(null),E=k.useRef(d),j=l!=null,I=wP(l),T=wP(i),N=wP(u),F=k.useCallback(()=>{if(!S.current||!_.current)return;const $={placement:t,strategy:n,middleware:f};T.current&&($.platform=T.current),XCe(S.current,_.current,$).then(V=>{const Q={...V,isPositioned:N.current!==!1};L.current&&!qB(E.current,Q)&&(E.current=Q,LA.flushSync(()=>{h(Q)}))})},[f,t,n,T,N]);Rk(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,h($=>({...$,isPositioned:!1})))},[u]);const L=k.useRef(!1);Rk(()=>(L.current=!0,()=>{L.current=!1}),[]),Rk(()=>{if(b&&(S.current=b),w&&(_.current=w),b&&w){if(I.current)return I.current(b,w,F);F()}},[b,w,F,I,j]);const D=k.useMemo(()=>({reference:S,floating:_,setReference:v,setFloating:x}),[v,x]),H=k.useMemo(()=>({reference:b,floating:w}),[b,w]),W=k.useMemo(()=>{const $={position:n,left:0,top:0};if(!H.floating)return $;const V=k7(H.floating,d.x),Q=k7(H.floating,d.y);return o?{...$,transform:"translate("+V+"px, "+Q+"px)",...Lre(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:Q}},[n,o,H.floating,d.x,d.y]);return k.useMemo(()=>({...d,update:F,refs:D,elements:H,floatingStyles:W}),[d,F,D,H,W])}const tSe=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?S7({element:r.current,padding:i}).fn(n):{}:r?S7({element:r,padding:i}).fn(n):{}}}},nSe=(e,t)=>({...VCe(e),options:[e,t]}),rSe=(e,t)=>({...KCe(e),options:[e,t]}),iSe=(e,t)=>({...YCe(e),options:[e,t]}),sSe=(e,t)=>({...qCe(e),options:[e,t]}),aSe=(e,t)=>({...WCe(e),options:[e,t]}),oSe=(e,t)=>({...GCe(e),options:[e,t]}),lSe=(e,t)=>({...tSe(e),options:[e,t]});var cSe="Arrow",Rre=k.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...s}=e;return c.jsx(_t.svg,{...s,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});Rre.displayName=cSe;var uSe=Rre;function WU(e){const[t,n]=k.useState(void 0);return Ui(()=>{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 l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;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 GU="Popper",[Ure,W0]=qs(GU),[dSe,Dre]=Ure(GU),Qre=e=>{const{__scopePopper:t,children:n}=e,[r,i]=k.useState(null);return c.jsx(dSe,{scope:t,anchor:r,onAnchorChange:i,children:n})};Qre.displayName=GU;var Hre="PopperAnchor",$re=k.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,s=Dre(Hre,n),a=k.useRef(null),o=tn(t,a);return k.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:c.jsx(_t.div,{...i,ref:o})});$re.displayName=Hre;var YU="PopperContent",[hSe,ASe]=Ure(YU),zre=k.forwardRef((e,t)=>{var Z,de,se,ie,he,ue;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:A="optimized",onPlaced:p,...m}=e,g=Dre(YU,n),[y,v]=k.useState(null),x=tn(t,Se=>v(Se)),[b,w]=k.useState(null),S=WU(b),_=(S==null?void 0:S.width)??0,E=(S==null?void 0:S.height)??0,j=r+(s!=="center"?"-"+s:""),I=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:I,boundary:T.filter(pSe),altBoundary:N},{refs:L,floatingStyles:D,placement:H,isPositioned:W,middlewareData:$}=eSe({strategy:"fixed",placement:j,whileElementsMounted:(...Se)=>zCe(...Se,{animationFrame:A==="always"}),elements:{reference:g.anchor},middleware:[nSe({mainAxis:i+E,alignmentAxis:a}),l&&rSe({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?iSe():void 0,...F}),l&&sSe({...F}),aSe({...F,apply:({elements:Se,rects:Fe,availableWidth:te,availableHeight:_e})=>{const{width:Ze,height:et}=Fe.reference,Te=Se.floating.style;Te.setProperty("--radix-popper-available-width",`${te}px`),Te.setProperty("--radix-popper-available-height",`${_e}px`),Te.setProperty("--radix-popper-anchor-width",`${Ze}px`),Te.setProperty("--radix-popper-anchor-height",`${et}px`)}}),b&&lSe({element:b,padding:o}),mSe({arrowWidth:_,arrowHeight:E}),f&&oSe({strategy:"referenceHidden",...F})]}),[V,Q]=qre(H),ce=Mi(p);Ui(()=>{W&&(ce==null||ce())},[W,ce]);const R=(Z=$.arrow)==null?void 0:Z.x,M=(de=$.arrow)==null?void 0:de.y,Y=((se=$.arrow)==null?void 0:se.centerOffset)!==0,[X,K]=k.useState();return Ui(()=>{y&&K(window.getComputedStyle(y).zIndex)},[y]),c.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:W?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(ie=$.transformOrigin)==null?void 0:ie.x,(he=$.transformOrigin)==null?void 0:he.y].join(" "),...((ue=$.hide)==null?void 0:ue.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(hSe,{scope:n,placedSide:V,onArrowChange:w,arrowX:R,arrowY:M,shouldHideArrow:Y,children:c.jsx(_t.div,{"data-side":V,"data-align":Q,...m,ref:x,style:{...m.style,animation:W?void 0:"none"}})})})});zre.displayName=YU;var Vre="PopperArrow",fSe={top:"bottom",right:"left",bottom:"top",left:"right"},Kre=k.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,s=ASe(Vre,r),a=fSe[s.placedSide];return c.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:c.jsx(uSe,{...i,ref:n,style:{...i.style,display:"block"}})})});Kre.displayName=Vre;function pSe(e){return e!==null}var mSe=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,l=a?0:e.arrowHeight,[u,d]=qre(n),h={start:"0%",center:"50%",end:"100%"}[d],f=(((y=i.arrow)==null?void 0:y.x)??0)+o/2,A=(((v=i.arrow)==null?void 0:v.y)??0)+l/2;let p="",m="";return u==="bottom"?(p=a?h:`${f}px`,m=`${-l}px`):u==="top"?(p=a?h:`${f}px`,m=`${r.floating.height+l}px`):u==="right"?(p=`${-l}px`,m=a?h:`${A}px`):u==="left"&&(p=`${r.floating.width+l}px`,m=a?h:`${A}px`),{data:{x:p,y:m}}}});function qre(e){const[t,n="center"]=e.split("-");return[t,n]}var XU=Qre,tj=$re,JU=zre,ZU=Kre,[nj,Bjt]=qs("Tooltip",[W0]),rj=W0(),Wre="TooltipProvider",gSe=700,S3="tooltip.open",[ySe,eD]=nj(Wre),Gre=e=>{const{__scopeTooltip:t,delayDuration:n=gSe,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=e,a=k.useRef(!0),o=k.useRef(!1),l=k.useRef(0);return k.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),c.jsx(ySe,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:k.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:k.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:o,onPointerInTransitChange:k.useCallback(u=>{o.current=u},[]),disableHoverableContent:i,children:s})};Gre.displayName=Wre;var Sb="Tooltip",[vSe,ij]=nj(Sb),Yre=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:s,disableHoverableContent:a,delayDuration:o}=e,l=eD(Sb,e.__scopeTooltip),u=rj(t),[d,h]=k.useState(null),f=cl(),A=k.useRef(0),p=a??l.disableHoverableContent,m=o??l.delayDuration,g=k.useRef(!1),[y,v]=Bo({prop:r,defaultProp:i??!1,onChange:_=>{_?(l.onOpen(),document.dispatchEvent(new CustomEvent(S3))):l.onClose(),s==null||s(_)},caller:Sb}),x=k.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),b=k.useCallback(()=>{window.clearTimeout(A.current),A.current=0,g.current=!1,v(!0)},[v]),w=k.useCallback(()=>{window.clearTimeout(A.current),A.current=0,v(!1)},[v]),S=k.useCallback(()=>{window.clearTimeout(A.current),A.current=window.setTimeout(()=>{g.current=!0,v(!0),A.current=0},m)},[m,v]);return k.useEffect(()=>()=>{A.current&&(window.clearTimeout(A.current),A.current=0)},[]),c.jsx(XU,{...u,children:c.jsx(vSe,{scope:t,contentId:f,open:y,stateAttribute:x,trigger:d,onTriggerChange:h,onTriggerEnter:k.useCallback(()=>{l.isOpenDelayedRef.current?S():b()},[l.isOpenDelayedRef,S,b]),onTriggerLeave:k.useCallback(()=>{p?w():(window.clearTimeout(A.current),A.current=0)},[w,p]),onOpen:b,onClose:w,disableHoverableContent:p,children:n})})};Yre.displayName=Sb;var k3="TooltipTrigger",Xre=k.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=ij(k3,n),s=eD(k3,n),a=rj(n),o=k.useRef(null),l=tn(t,o,i.onTriggerChange),u=k.useRef(!1),d=k.useRef(!1),h=k.useCallback(()=>u.current=!1,[]);return k.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),c.jsx(tj,{asChild:!0,...a,children:c.jsx(_t.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:at(e.onPointerMove,f=>{f.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)})})});Xre.displayName=k3;var xSe="TooltipPortal",[_jt,wSe]=nj(xSe,{forceMount:void 0}),Zy="TooltipContent",Jre=k.forwardRef((e,t)=>{const n=wSe(Zy,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=e,a=ij(Zy,e.__scopeTooltip);return c.jsx(ba,{present:r||a.open,children:a.disableHoverableContent?c.jsx(Zre,{side:i,...s,ref:t}):c.jsx(bSe,{side:i,...s,ref:t})})}),bSe=k.forwardRef((e,t)=>{const n=ij(Zy,e.__scopeTooltip),r=eD(Zy,e.__scopeTooltip),i=k.useRef(null),s=tn(t,i),[a,o]=k.useState(null),{trigger:l,onClose:u}=n,d=i.current,{onPointerInTransitChange:h}=r,f=k.useCallback(()=>{o(null),h(!1)},[h]),A=k.useCallback((p,m)=>{const g=p.currentTarget,y={x:p.clientX,y:p.clientY},v=_Se(y,g.getBoundingClientRect()),x=ESe(y,v),b=NSe(m.getBoundingClientRect()),w=TSe([...x,...b]);o(w),h(!0)},[h]);return k.useEffect(()=>()=>f(),[f]),k.useEffect(()=>{if(l&&d){const p=g=>A(g,d),m=g=>A(g,l);return l.addEventListener("pointerleave",p),d.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",p),d.removeEventListener("pointerleave",m)}}},[l,d,A,f]),k.useEffect(()=>{if(a){const p=m=>{const g=m.target,y={x:m.clientX,y:m.clientY},v=(l==null?void 0:l.contains(g))||(d==null?void 0:d.contains(g)),x=!jSe(y,a);v?f():x&&(f(),u())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[l,d,a,u,f]),c.jsx(Zre,{...e,ref:s})}),[CSe,SSe]=nj(Sb,{isInside:!1}),kSe=Sne("TooltipContent"),Zre=k.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:a,...o}=e,l=ij(Zy,n),u=rj(n),{onClose:d}=l;return k.useEffect(()=>(document.addEventListener(S3,d),()=>document.removeEventListener(S3,d)),[d]),k.useEffect(()=>{if(l.trigger){const h=f=>{const A=f.target;A!=null&&A.contains(l.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,d]),c.jsx($0,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:c.jsxs(JU,{"data-state":l.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:[c.jsx(kSe,{children:r}),c.jsx(CSe,{scope:n,isInside:!0,children:c.jsx(Pbe,{id:l.contentId,role:"tooltip",children:i||r})})]})})});Jre.displayName=Zy;var eie="TooltipArrow",BSe=k.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=rj(n);return SSe(eie,n).isInside?null:c.jsx(ZU,{...i,...r,ref:t})});BSe.displayName=eie;function _Se(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 ESe(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 NSe(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 jSe(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],l=t[a],u=o.x,d=o.y,h=l.x,f=l.y;d>r!=f>r&&n<(h-u)*(r-d)/(f-d)+u&&(i=!i)}return i}function TSe(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),PSe(t)}function PSe(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 ISe=Gre,OSe=Yre,FSe=Xre,tie=Jre;const tD=ISe,nD=OSe,rD=FSe,sj=k.forwardRef(({className:e,sideOffset:t=4,...n},r)=>c.jsx(tie,{ref:r,sideOffset:t,className:pt("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}));sj.displayName=tie.displayName;var G0=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(){}},Up=typeof window>"u"||"Deno"in globalThis;function aa(){}function MSe(e,t){return typeof e=="function"?e(t):e}function B3(e){return typeof e=="number"&&e>=0&&e!==1/0}function nie(e,t){return Math.max(e+(t||0)-Date.now(),0)}function iA(e,t){return typeof e=="function"?e(t):e}function qo(e,t){return typeof e=="function"?e(t):e}function B7(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:a,stale:o}=e;if(a){if(r){if(t.queryHash!==iD(a,t.options))return!1}else if(!kb(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||i&&i!==t.state.fetchStatus||s&&!s(t))}function _7(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Dp(t.options.mutationKey)!==Dp(s))return!1}else if(!kb(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function iD(e,t){return((t==null?void 0:t.queryKeyHashFn)||Dp)(e)}function Dp(e){return JSON.stringify(e,(t,n)=>_3(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function kb(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>kb(e[n],t[n])):!1}function rie(e,t){if(e===t)return e;const n=E7(e)&&E7(t);if(n||_3(e)&&_3(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),a=s.length,o=n?[]:{},l=new Set(r);let u=0;for(let d=0;d<a;d++){const h=n?d:s[d];(!n&&l.has(h)||n)&&e[h]===void 0&&t[h]===void 0?(o[h]=void 0,u++):(o[h]=rie(e[h],t[h]),o[h]===e[h]&&e[h]!==void 0&&u++)}return i===a&&u===i?e:o}return t}function WB(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 E7(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function _3(e){if(!N7(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!N7(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function N7(e){return Object.prototype.toString.call(e)==="[object Object]"}function LSe(e){return new Promise(t=>{setTimeout(t,e)})}function E3(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?rie(e,t):t}function RSe(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function USe(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var sD=Symbol();function iie(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===sD?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function sie(e,t){return typeof e=="function"?e(...t):!!e}var sp,kh,Py,ZZ,DSe=(ZZ=class extends G0{constructor(){super();Ot(this,sp);Ot(this,kh);Ot(this,Py);nt(this,Py,t=>{if(!Up&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){fe(this,kh)||this.setEventListener(fe(this,Py))}onUnsubscribe(){var t;this.hasListeners()||((t=fe(this,kh))==null||t.call(this),nt(this,kh,void 0))}setEventListener(t){var n;nt(this,Py,t),(n=fe(this,kh))==null||n.call(this),nt(this,kh,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){fe(this,sp)!==t&&(nt(this,sp,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof fe(this,sp)=="boolean"?fe(this,sp):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},sp=new WeakMap,kh=new WeakMap,Py=new WeakMap,ZZ),aD=new DSe,Iy,Bh,Oy,eee,QSe=(eee=class extends G0{constructor(){super();Ot(this,Iy,!0);Ot(this,Bh);Ot(this,Oy);nt(this,Oy,t=>{if(!Up&&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(){fe(this,Bh)||this.setEventListener(fe(this,Oy))}onUnsubscribe(){var t;this.hasListeners()||((t=fe(this,Bh))==null||t.call(this),nt(this,Bh,void 0))}setEventListener(t){var n;nt(this,Oy,t),(n=fe(this,Bh))==null||n.call(this),nt(this,Bh,t(this.setOnline.bind(this)))}setOnline(t){fe(this,Iy)!==t&&(nt(this,Iy,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return fe(this,Iy)}},Iy=new WeakMap,Bh=new WeakMap,Oy=new WeakMap,eee),GB=new QSe;function N3(){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 HSe(e){return Math.min(1e3*2**e,3e4)}function aie(e){return(e??"online")==="online"?GB.isOnline():!0}var oie=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function bP(e){return e instanceof oie}function lie(e){let t=!1,n=0,r=!1,i;const s=N3(),a=m=>{var g;r||(f(new oie(m)),(g=e.abort)==null||g.call(e))},o=()=>{t=!0},l=()=>{t=!1},u=()=>aD.isFocused()&&(e.networkMode==="always"||GB.isOnline())&&e.canRun(),d=()=>aie(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))},f=m=>{var g;r||(r=!0,(g=e.onError)==null||g.call(e,m),i==null||i(),s.reject(m))},A=()=>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 S;if(r)return;const v=e.retry??(Up?0:3),x=e.retryDelay??HSe,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){f(y);return}n++,(S=e.onFail)==null||S.call(e,n,y),LSe(b).then(()=>u()?void 0:A()).then(()=>{t?f(y):p()})})};return{promise:s,cancel:a,continue:()=>(i==null||i(),s),cancelRetry:o,continueRetry:l,canStart:d,start:()=>(d()?p():A().then(p),s)}}var $Se=e=>setTimeout(e,0);function zSe(){let e=[],t=0,n=o=>{o()},r=o=>{o()},i=$Se;const s=o=>{t?e.push(o):i(()=>{n(o)})},a=()=>{const o=e;e=[],o.length&&i(()=>{r(()=>{o.forEach(l=>{n(l)})})})};return{batch:o=>{let l;t++;try{l=o()}finally{t--,t||a()}return l},batchCalls:o=>(...l)=>{s(()=>{o(...l)})},schedule:s,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{i=o}}}var Oi=zSe(),ap,tee,cie=(tee=class{constructor(){Ot(this,ap)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),B3(this.gcTime)&&nt(this,ap,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Up?1/0:5*60*1e3))}clearGcTimeout(){fe(this,ap)&&(clearTimeout(fe(this,ap)),nt(this,ap,void 0))}},ap=new WeakMap,tee),Fy,op,Ko,lp,Os,X1,cp,Ql,Uu,nee,VSe=(nee=class extends cie{constructor(t){super();Ot(this,Ql);Ot(this,Fy);Ot(this,op);Ot(this,Ko);Ot(this,lp);Ot(this,Os);Ot(this,X1);Ot(this,cp);nt(this,cp,!1),nt(this,X1,t.defaultOptions),this.setOptions(t.options),this.observers=[],nt(this,lp,t.client),nt(this,Ko,fe(this,lp).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,nt(this,Fy,KSe(this.options)),this.state=t.state??fe(this,Fy),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=fe(this,Os))==null?void 0:t.promise}setOptions(t){this.options={...fe(this,X1),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&fe(this,Ko).remove(this)}setData(t,n){const r=E3(this.state.data,t,this.options);return on(this,Ql,Uu).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){on(this,Ql,Uu).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=fe(this,Os))==null?void 0:r.promise;return(i=fe(this,Os))==null||i.cancel(t),n?n.then(aa).catch(aa):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(fe(this,Fy))}isActive(){return this.observers.some(t=>qo(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===sD||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>iA(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:!nie(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=fe(this,Os))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=fe(this,Os))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),fe(this,Ko).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(fe(this,Os)&&(fe(this,cp)?fe(this,Os).cancel({revert:!0}):fe(this,Os).cancelRetry()),this.scheduleGc()),fe(this,Ko).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||on(this,Ql,Uu).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(fe(this,Os))return fe(this,Os).continueRetry(),fe(this,Os).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(A=>A.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(nt(this,cp,!0),r.signal)})},s=()=>{const f=iie(this.options,n),p=(()=>{const m={client:fe(this,lp),queryKey:this.queryKey,meta:this.meta};return i(m),m})();return nt(this,cp,!1),this.options.persister?this.options.persister(f,p,this):f(p)},o=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:fe(this,lp),state:this.state,fetchFn:s};return i(f),f})();(u=this.options.behavior)==null||u.onFetch(o,this),nt(this,op,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&on(this,Ql,Uu).call(this,{type:"fetch",meta:(h=o.fetchOptions)==null?void 0:h.meta});const l=f=>{var A,p,m,g;bP(f)&&f.silent||on(this,Ql,Uu).call(this,{type:"error",error:f}),bP(f)||((p=(A=fe(this,Ko).config).onError)==null||p.call(A,f,this),(g=(m=fe(this,Ko).config).onSettled)==null||g.call(m,this.state.data,f,this)),this.scheduleGc()};return nt(this,Os,lie({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var A,p,m,g;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(y){l(y);return}(p=(A=fe(this,Ko).config).onSuccess)==null||p.call(A,f,this),(g=(m=fe(this,Ko).config).onSettled)==null||g.call(m,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,A)=>{on(this,Ql,Uu).call(this,{type:"failed",failureCount:f,error:A})},onPause:()=>{on(this,Ql,Uu).call(this,{type:"pause"})},onContinue:()=>{on(this,Ql,Uu).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),fe(this,Os).start()}},Fy=new WeakMap,op=new WeakMap,Ko=new WeakMap,lp=new WeakMap,Os=new WeakMap,X1=new WeakMap,cp=new WeakMap,Ql=new WeakSet,Uu=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,...uie(r.data,this.options),fetchMeta:t.meta??null};case"success":return nt(this,op,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 bP(i)&&i.revert&&fe(this,op)?{...fe(this,op),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),Oi.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),fe(this,Ko).notify({query:this,type:"updated",action:t})})},nee);function uie(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:aie(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function KSe(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 Uc,ree,qSe=(ree=class extends G0{constructor(t={}){super();Ot(this,Uc);this.config=t,nt(this,Uc,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??iD(i,n);let a=this.get(s);return a||(a=new VSe({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){fe(this,Uc).has(t.queryHash)||(fe(this,Uc).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=fe(this,Uc).get(t.queryHash);n&&(t.destroy(),n===t&&fe(this,Uc).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Oi.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return fe(this,Uc).get(t)}getAll(){return[...fe(this,Uc).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>B7(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>B7(t,r)):n}notify(t){Oi.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Oi.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Oi.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Uc=new WeakMap,ree),Dc,na,up,Qc,ih,iee,WSe=(iee=class extends cie{constructor(t){super();Ot(this,Qc);Ot(this,Dc);Ot(this,na);Ot(this,up);this.mutationId=t.mutationId,nt(this,na,t.mutationCache),nt(this,Dc,[]),this.state=t.state||die(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){fe(this,Dc).includes(t)||(fe(this,Dc).push(t),this.clearGcTimeout(),fe(this,na).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){nt(this,Dc,fe(this,Dc).filter(n=>n!==t)),this.scheduleGc(),fe(this,na).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){fe(this,Dc).length||(this.state.status==="pending"?this.scheduleGc():fe(this,na).remove(this))}continue(){var t;return((t=fe(this,up))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,a,o,l,u,d,h,f,A,p,m,g,y,v,x,b,w,S,_,E;const n=()=>{on(this,Qc,ih).call(this,{type:"continue"})};nt(this,up,lie({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(j,I)=>{on(this,Qc,ih).call(this,{type:"failed",failureCount:j,error:I})},onPause:()=>{on(this,Qc,ih).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>fe(this,na).canRun(this)}));const r=this.state.status==="pending",i=!fe(this,up).canStart();try{if(r)n();else{on(this,Qc,ih).call(this,{type:"pending",variables:t,isPaused:i}),await((a=(s=fe(this,na).config).onMutate)==null?void 0:a.call(s,t,this));const I=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t));I!==this.state.context&&on(this,Qc,ih).call(this,{type:"pending",context:I,variables:t,isPaused:i})}const j=await fe(this,up).start();return await((d=(u=fe(this,na).config).onSuccess)==null?void 0:d.call(u,j,t,this.state.context,this)),await((f=(h=this.options).onSuccess)==null?void 0:f.call(h,j,t,this.state.context)),await((p=(A=fe(this,na).config).onSettled)==null?void 0:p.call(A,j,null,this.state.variables,this.state.context,this)),await((g=(m=this.options).onSettled)==null?void 0:g.call(m,j,null,t,this.state.context)),on(this,Qc,ih).call(this,{type:"success",data:j}),j}catch(j){try{throw await((v=(y=fe(this,na).config).onError)==null?void 0:v.call(y,j,t,this.state.context,this)),await((b=(x=this.options).onError)==null?void 0:b.call(x,j,t,this.state.context)),await((S=(w=fe(this,na).config).onSettled)==null?void 0:S.call(w,void 0,j,this.state.variables,this.state.context,this)),await((E=(_=this.options).onSettled)==null?void 0:E.call(_,void 0,j,t,this.state.context)),j}finally{on(this,Qc,ih).call(this,{type:"error",error:j})}}finally{fe(this,na).runNext(this)}}},Dc=new WeakMap,na=new WeakMap,up=new WeakMap,Qc=new WeakSet,ih=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),Oi.batch(()=>{fe(this,Dc).forEach(r=>{r.onMutationUpdate(t)}),fe(this,na).notify({mutation:this,type:"updated",action:t})})},iee);function die(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var qu,Hl,J1,see,GSe=(see=class extends G0{constructor(t={}){super();Ot(this,qu);Ot(this,Hl);Ot(this,J1);this.config=t,nt(this,qu,new Set),nt(this,Hl,new Map),nt(this,J1,0)}build(t,n,r){const i=new WSe({mutationCache:this,mutationId:++kC(this,J1)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){fe(this,qu).add(t);const n=qC(t);if(typeof n=="string"){const r=fe(this,Hl).get(n);r?r.push(t):fe(this,Hl).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(fe(this,qu).delete(t)){const n=qC(t);if(typeof n=="string"){const r=fe(this,Hl).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&fe(this,Hl).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=qC(t);if(typeof n=="string"){const r=fe(this,Hl).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=qC(t);if(typeof n=="string"){const i=(r=fe(this,Hl).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(){Oi.batch(()=>{fe(this,qu).forEach(t=>{this.notify({type:"removed",mutation:t})}),fe(this,qu).clear(),fe(this,Hl).clear()})}getAll(){return Array.from(fe(this,qu))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>_7(n,r))}findAll(t={}){return this.getAll().filter(n=>_7(t,n))}notify(t){Oi.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Oi.batch(()=>Promise.all(t.map(n=>n.continue().catch(aa))))}},qu=new WeakMap,Hl=new WeakMap,J1=new WeakMap,see);function qC(e){var t;return(t=e.options.scope)==null?void 0:t.id}function j7(e){return{onFetch:(t,n)=>{var d,h,f,A,p;const r=t.options,i=(f=(h=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:f.direction,s=((A=t.state.data)==null?void 0:A.pages)||[],a=((p=t.state.data)==null?void 0:p.pageParams)||[];let o={pages:[],pageParams:[]},l=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=iie(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 _=(()=>{const T={client:t.client,queryKey:t.queryKey,pageParam:b,direction:w?"backward":"forward",meta:t.options.meta};return g(T),T})(),E=await y(_),{maxPages:j}=t.options,I=w?USe:RSe;return{pages:I(x.pages,E,j),pageParams:I(x.pageParams,b,j)}};if(i&&s.length){const x=i==="backward",b=x?YSe:T7,w={pages:s,pageParams:a},S=b(r,w);o=await v(w,S,x)}else{const x=e??s.length;do{const b=l===0?a[0]??r.initialPageParam:T7(r,o);if(l>0&&b==null)break;o=await v(o,b),l++}while(l<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 T7(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 YSe(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 Vr,_h,Eh,My,Ly,Nh,Ry,Uy,aee,XSe=(aee=class{constructor(e={}){Ot(this,Vr);Ot(this,_h);Ot(this,Eh);Ot(this,My);Ot(this,Ly);Ot(this,Nh);Ot(this,Ry);Ot(this,Uy);nt(this,Vr,e.queryCache||new qSe),nt(this,_h,e.mutationCache||new GSe),nt(this,Eh,e.defaultOptions||{}),nt(this,My,new Map),nt(this,Ly,new Map),nt(this,Nh,0)}mount(){kC(this,Nh)._++,fe(this,Nh)===1&&(nt(this,Ry,aD.subscribe(async e=>{e&&(await this.resumePausedMutations(),fe(this,Vr).onFocus())})),nt(this,Uy,GB.subscribe(async e=>{e&&(await this.resumePausedMutations(),fe(this,Vr).onOnline())})))}unmount(){var e,t;kC(this,Nh)._--,fe(this,Nh)===0&&((e=fe(this,Ry))==null||e.call(this),nt(this,Ry,void 0),(t=fe(this,Uy))==null||t.call(this),nt(this,Uy,void 0))}isFetching(e){return fe(this,Vr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return fe(this,_h).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=fe(this,Vr).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=fe(this,Vr).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(iA(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return fe(this,Vr).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=fe(this,Vr).get(r.queryHash),s=i==null?void 0:i.state.data,a=MSe(t,s);if(a!==void 0)return fe(this,Vr).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Oi.batch(()=>fe(this,Vr).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=fe(this,Vr).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=fe(this,Vr);Oi.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=fe(this,Vr);return Oi.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Oi.batch(()=>fe(this,Vr).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(aa).catch(aa)}invalidateQueries(e,t={}){return Oi.batch(()=>(fe(this,Vr).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=Oi.batch(()=>fe(this,Vr).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(aa)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(aa)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=fe(this,Vr).build(this,t);return n.isStaleByTime(iA(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(aa).catch(aa)}fetchInfiniteQuery(e){return e.behavior=j7(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(aa).catch(aa)}ensureInfiniteQueryData(e){return e.behavior=j7(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return GB.isOnline()?fe(this,_h).resumePausedMutations():Promise.resolve()}getQueryCache(){return fe(this,Vr)}getMutationCache(){return fe(this,_h)}getDefaultOptions(){return fe(this,Eh)}setDefaultOptions(e){nt(this,Eh,e)}setQueryDefaults(e,t){fe(this,My).set(Dp(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...fe(this,My).values()],n={};return t.forEach(r=>{kb(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){fe(this,Ly).set(Dp(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...fe(this,Ly).values()],n={};return t.forEach(r=>{kb(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...fe(this,Eh).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=iD(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===sD&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...fe(this,Eh).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){fe(this,Vr).clear(),fe(this,_h).clear()}},Vr=new WeakMap,_h=new WeakMap,Eh=new WeakMap,My=new WeakMap,Ly=new WeakMap,Nh=new WeakMap,Ry=new WeakMap,Uy=new WeakMap,aee),Ea,gn,Z1,ra,dp,Dy,jh,Th,e2,Qy,Hy,hp,Ap,Ph,$y,Ln,Qx,j3,T3,P3,I3,O3,F3,M3,hie,oee,JSe=(oee=class extends G0{constructor(t,n){super();Ot(this,Ln);Ot(this,Ea);Ot(this,gn);Ot(this,Z1);Ot(this,ra);Ot(this,dp);Ot(this,Dy);Ot(this,jh);Ot(this,Th);Ot(this,e2);Ot(this,Qy);Ot(this,Hy);Ot(this,hp);Ot(this,Ap);Ot(this,Ph);Ot(this,$y,new Set);this.options=n,nt(this,Ea,t),nt(this,Th,null),nt(this,jh,N3()),this.options.experimental_prefetchInRender||fe(this,jh).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&&(fe(this,gn).addObserver(this),P7(fe(this,gn),this.options)?on(this,Ln,Qx).call(this):this.updateResult(),on(this,Ln,I3).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return L3(fe(this,gn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return L3(fe(this,gn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,on(this,Ln,O3).call(this),on(this,Ln,F3).call(this),fe(this,gn).removeObserver(this)}setOptions(t){const n=this.options,r=fe(this,gn);if(this.options=fe(this,Ea).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof qo(this.options.enabled,fe(this,gn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");on(this,Ln,M3).call(this),fe(this,gn).setOptions(this.options),n._defaulted&&!WB(this.options,n)&&fe(this,Ea).getQueryCache().notify({type:"observerOptionsUpdated",query:fe(this,gn),observer:this});const i=this.hasListeners();i&&I7(fe(this,gn),r,this.options,n)&&on(this,Ln,Qx).call(this),this.updateResult(),i&&(fe(this,gn)!==r||qo(this.options.enabled,fe(this,gn))!==qo(n.enabled,fe(this,gn))||iA(this.options.staleTime,fe(this,gn))!==iA(n.staleTime,fe(this,gn)))&&on(this,Ln,j3).call(this);const s=on(this,Ln,T3).call(this);i&&(fe(this,gn)!==r||qo(this.options.enabled,fe(this,gn))!==qo(n.enabled,fe(this,gn))||s!==fe(this,Ph))&&on(this,Ln,P3).call(this,s)}getOptimisticResult(t){const n=fe(this,Ea).getQueryCache().build(fe(this,Ea),t),r=this.createResult(n,t);return eke(this,r)&&(nt(this,ra,r),nt(this,Dy,this.options),nt(this,dp,fe(this,gn).state)),r}getCurrentResult(){return fe(this,ra)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),Reflect.get(r,i))})}trackProp(t){fe(this,$y).add(t)}getCurrentQuery(){return fe(this,gn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=fe(this,Ea).defaultQueryOptions(t),r=fe(this,Ea).getQueryCache().build(fe(this,Ea),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return on(this,Ln,Qx).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),fe(this,ra)))}createResult(t,n){var j;const r=fe(this,gn),i=this.options,s=fe(this,ra),a=fe(this,dp),o=fe(this,Dy),u=t!==r?t.state:fe(this,Z1),{state:d}=t;let h={...d},f=!1,A;if(n._optimisticResults){const I=this.hasListeners(),T=!I&&P7(t,n),N=I&&I7(t,r,n,i);(T||N)&&(h={...h,...uie(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:g}=h;A=h.data;let y=!1;if(n.placeholderData!==void 0&&A===void 0&&g==="pending"){let I;s!=null&&s.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData)?(I=s.data,y=!0):I=typeof n.placeholderData=="function"?n.placeholderData((j=fe(this,Hy))==null?void 0:j.state.data,fe(this,Hy)):n.placeholderData,I!==void 0&&(g="success",A=E3(s==null?void 0:s.data,I,n),f=!0)}if(n.select&&A!==void 0&&!y)if(s&&A===(a==null?void 0:a.data)&&n.select===fe(this,e2))A=fe(this,Qy);else try{nt(this,e2,n.select),A=n.select(A),A=E3(s==null?void 0:s.data,A,n),nt(this,Qy,A),nt(this,Th,null)}catch(I){nt(this,Th,I)}fe(this,Th)&&(p=fe(this,Th),A=fe(this,Qy),m=Date.now(),g="error");const v=h.fetchStatus==="fetching",x=g==="pending",b=g==="error",w=x&&v,S=A!==void 0,E={status:g,fetchStatus:h.fetchStatus,isPending:x,isSuccess:g==="success",isError:b,isInitialLoading:w,isLoading:w,data:A,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&&!S,isPaused:h.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:b&&S,isStale:oD(t,n),refetch:this.refetch,promise:fe(this,jh),isEnabled:qo(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const I=F=>{E.status==="error"?F.reject(E.error):E.data!==void 0&&F.resolve(E.data)},T=()=>{const F=nt(this,jh,E.promise=N3());I(F)},N=fe(this,jh);switch(N.status){case"pending":t.queryHash===r.queryHash&&I(N);break;case"fulfilled":(E.status==="error"||E.data!==N.value)&&T();break;case"rejected":(E.status!=="error"||E.error!==N.reason)&&T();break}}return E}updateResult(){const t=fe(this,ra),n=this.createResult(fe(this,gn),this.options);if(nt(this,dp,fe(this,gn).state),nt(this,Dy,this.options),fe(this,dp).data!==void 0&&nt(this,Hy,fe(this,gn)),WB(n,t))return;nt(this,ra,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!fe(this,$y).size)return!0;const a=new Set(s??fe(this,$y));return this.options.throwOnError&&a.add("error"),Object.keys(fe(this,ra)).some(o=>{const l=o;return fe(this,ra)[l]!==t[l]&&a.has(l)})};on(this,Ln,hie).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&on(this,Ln,I3).call(this)}},Ea=new WeakMap,gn=new WeakMap,Z1=new WeakMap,ra=new WeakMap,dp=new WeakMap,Dy=new WeakMap,jh=new WeakMap,Th=new WeakMap,e2=new WeakMap,Qy=new WeakMap,Hy=new WeakMap,hp=new WeakMap,Ap=new WeakMap,Ph=new WeakMap,$y=new WeakMap,Ln=new WeakSet,Qx=function(t){on(this,Ln,M3).call(this);let n=fe(this,gn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(aa)),n},j3=function(){on(this,Ln,O3).call(this);const t=iA(this.options.staleTime,fe(this,gn));if(Up||fe(this,ra).isStale||!B3(t))return;const r=nie(fe(this,ra).dataUpdatedAt,t)+1;nt(this,hp,setTimeout(()=>{fe(this,ra).isStale||this.updateResult()},r))},T3=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(fe(this,gn)):this.options.refetchInterval)??!1},P3=function(t){on(this,Ln,F3).call(this),nt(this,Ph,t),!(Up||qo(this.options.enabled,fe(this,gn))===!1||!B3(fe(this,Ph))||fe(this,Ph)===0)&&nt(this,Ap,setInterval(()=>{(this.options.refetchIntervalInBackground||aD.isFocused())&&on(this,Ln,Qx).call(this)},fe(this,Ph)))},I3=function(){on(this,Ln,j3).call(this),on(this,Ln,P3).call(this,on(this,Ln,T3).call(this))},O3=function(){fe(this,hp)&&(clearTimeout(fe(this,hp)),nt(this,hp,void 0))},F3=function(){fe(this,Ap)&&(clearInterval(fe(this,Ap)),nt(this,Ap,void 0))},M3=function(){const t=fe(this,Ea).getQueryCache().build(fe(this,Ea),this.options);if(t===fe(this,gn))return;const n=fe(this,gn);nt(this,gn,t),nt(this,Z1,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},hie=function(t){Oi.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(fe(this,ra))}),fe(this,Ea).getQueryCache().notify({query:fe(this,gn),type:"observerResultsUpdated"})})},oee);function ZSe(e,t){return qo(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function P7(e,t){return ZSe(e,t)||e.state.data!==void 0&&L3(e,t,t.refetchOnMount)}function L3(e,t,n){if(qo(t.enabled,e)!==!1&&iA(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&oD(e,t)}return!1}function I7(e,t,n,r){return(e!==t||qo(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&oD(e,n)}function oD(e,t){return qo(t.enabled,e)!==!1&&e.isStaleByTime(iA(t.staleTime,e))}function eke(e,t){return!WB(e.getCurrentResult(),t)}var Ih,Oh,Na,Wu,ld,Uk,R3,lee,tke=(lee=class extends G0{constructor(n,r){super();Ot(this,ld);Ot(this,Ih);Ot(this,Oh);Ot(this,Na);Ot(this,Wu);nt(this,Ih,n),this.setOptions(r),this.bindMethods(),on(this,ld,Uk).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=fe(this,Ih).defaultMutationOptions(n),WB(this.options,r)||fe(this,Ih).getMutationCache().notify({type:"observerOptionsUpdated",mutation:fe(this,Na),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Dp(r.mutationKey)!==Dp(this.options.mutationKey)?this.reset():((i=fe(this,Na))==null?void 0:i.state.status)==="pending"&&fe(this,Na).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=fe(this,Na))==null||n.removeObserver(this)}onMutationUpdate(n){on(this,ld,Uk).call(this),on(this,ld,R3).call(this,n)}getCurrentResult(){return fe(this,Oh)}reset(){var n;(n=fe(this,Na))==null||n.removeObserver(this),nt(this,Na,void 0),on(this,ld,Uk).call(this),on(this,ld,R3).call(this)}mutate(n,r){var i;return nt(this,Wu,r),(i=fe(this,Na))==null||i.removeObserver(this),nt(this,Na,fe(this,Ih).getMutationCache().build(fe(this,Ih),this.options)),fe(this,Na).addObserver(this),fe(this,Na).execute(n)}},Ih=new WeakMap,Oh=new WeakMap,Na=new WeakMap,Wu=new WeakMap,ld=new WeakSet,Uk=function(){var r;const n=((r=fe(this,Na))==null?void 0:r.state)??die();nt(this,Oh,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},R3=function(n){Oi.batch(()=>{var r,i,s,a,o,l,u,d;if(fe(this,Wu)&&this.hasListeners()){const h=fe(this,Oh).variables,f=fe(this,Oh).context;(n==null?void 0:n.type)==="success"?((i=(r=fe(this,Wu)).onSuccess)==null||i.call(r,n.data,h,f),(a=(s=fe(this,Wu)).onSettled)==null||a.call(s,n.data,null,h,f)):(n==null?void 0:n.type)==="error"&&((l=(o=fe(this,Wu)).onError)==null||l.call(o,n.error,h,f),(d=(u=fe(this,Wu)).onSettled)==null||d.call(u,void 0,n.error,h,f))}this.listeners.forEach(h=>{h(fe(this,Oh))})})},lee),Aie=k.createContext(void 0),Zi=e=>{const t=k.useContext(Aie);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},nke=({client:e,children:t})=>(k.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(Aie.Provider,{value:e,children:t})),fie=k.createContext(!1),rke=()=>k.useContext(fie);fie.Provider;function ike(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ske=k.createContext(ike()),ake=()=>k.useContext(ske),oke=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},lke=e=>{k.useEffect(()=>{e.clearReset()},[e])},cke=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||sie(n,[e.error,r])),uke=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))}},dke=(e,t)=>e.isLoading&&e.isFetching&&!t,hke=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,O7=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ake(e,t,n){var h,f,A,p,m;const r=rke(),i=ake(),s=Zi(),a=s.defaultQueryOptions(e);(f=(h=s.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||f.call(h,a),a._optimisticResults=r?"isRestoring":"optimistic",uke(a),oke(a,i),lke(i);const o=!s.getQueryCache().get(a.queryHash),[l]=k.useState(()=>new t(s,a)),u=l.getOptimisticResult(a),d=!r&&e.subscribed!==!1;if(k.useSyncExternalStore(k.useCallback(g=>{const y=d?l.subscribe(Oi.batchCalls(g)):aa;return l.updateResult(),y},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),k.useEffect(()=>{l.setOptions(a)},[a,l]),hke(a,u))throw O7(a,l,i);if(cke({result:u,errorResetBoundary:i,throwOnError:a.throwOnError,query:s.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw u.error;if((p=(A=s.getDefaultOptions().queries)==null?void 0:A._experimental_afterQuery)==null||p.call(A,a,u),a.experimental_prefetchInRender&&!Up&&dke(u,r)){const g=o?O7(a,l,i):(m=s.getQueryCache().get(a.queryHash))==null?void 0:m.promise;g==null||g.catch(aa).finally(()=>{l.updateResult()})}return a.notifyOnChangeProps?u:l.trackResult(u)}function dr(e,t){return Ake(e,JSe)}function Cs(e,t){const n=Zi(),[r]=k.useState(()=>new tke(n,e));k.useEffect(()=>{r.setOptions(e)},[r,e]);const i=k.useSyncExternalStore(k.useCallback(a=>r.subscribe(Oi.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=k.useCallback((a,o)=>{r.mutate(a,o).catch(aa)},[r]);if(i.error&&sie(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 Bb(){return Bb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bb.apply(this,arguments)}var Rh;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Rh||(Rh={}));const F7="popstate";function fke(e){e===void 0&&(e={});function t(r,i){let{pathname:s,search:a,hash:o}=r.location;return U3("",{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:YB(i)}return mke(t,n,null,e)}function hi(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 pke(){return Math.random().toString(36).substr(2,8)}function M7(e,t){return{usr:e.state,key:e.key,idx:t}}function U3(e,t,n,r){return n===void 0&&(n=null),Bb({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Y0(t):t,{state:n,key:t&&t.key||r||pke()})}function YB(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 Y0(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 mke(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,a=i.history,o=Rh.Pop,l=null,u=d();u==null&&(u=0,a.replaceState(Bb({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function h(){o=Rh.Pop;let g=d(),y=g==null?null:g-u;u=g,l&&l({action:o,location:m.location,delta:y})}function f(g,y){o=Rh.Push;let v=U3(m.location,g,y);u=d()+1;let x=M7(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&&l&&l({action:o,location:m.location,delta:1})}function A(g,y){o=Rh.Replace;let v=U3(m.location,g,y);u=d();let x=M7(v,u),b=m.createHref(v);a.replaceState(x,"",b),s&&l&&l({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:YB(g);return v=v.replace(/ $/,"%20"),hi(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(l)throw new Error("A history only accepts one active listener");return i.addEventListener(F7,h),l=g,()=>{i.removeEventListener(F7,h),l=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:f,replace:A,go(g){return a.go(g)}};return m}var L7;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(L7||(L7={}));function gke(e,t,n){return n===void 0&&(n="/"),yke(e,t,n,!1)}function yke(e,t,n,r){let i=typeof t=="string"?Y0(t):t,s=lD(i.pathname||"/",n);if(s==null)return null;let a=mie(e);vke(a);let o=null;for(let l=0;o==null&&l<a.length;++l){let u=jke(s);o=Eke(a[l],u,r)}return o}function mie(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,a,o)=>{let l={relativePath:o===void 0?s.path||"":o,caseSensitive:s.caseSensitive===!0,childrenIndex:a,route:s};l.relativePath.startsWith("/")&&(hi(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=sA([r,l.relativePath]),d=n.concat(l);s.children&&s.children.length>0&&(hi(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),mie(s.children,t,d,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:Bke(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 l of gie(s.path))i(s,a,l)}),t}function gie(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=gie(r.join("/")),o=[];return o.push(...a.map(l=>l===""?s:[s,l].join("/"))),i&&o.push(...a),o.map(l=>e.startsWith("/")&&l===""?"/":l)}function vke(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:_ke(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const xke=/^:[\w-]+$/,wke=3,bke=2,Cke=1,Ske=10,kke=-2,R7=e=>e==="*";function Bke(e,t){let n=e.split("/"),r=n.length;return n.some(R7)&&(r+=kke),t&&(r+=bke),n.filter(i=>!R7(i)).reduce((i,s)=>i+(xke.test(s)?wke:s===""?Cke:Ske),r)}function _ke(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 Eke(e,t,n){let{routesMeta:r}=e,i={},s="/",a=[];for(let o=0;o<r.length;++o){let l=r[o],u=o===r.length-1,d=s==="/"?t:t.slice(s.length)||"/",h=U7({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},d),f=l.route;if(!h&&u&&n&&!r[r.length-1].route.index&&(h=U7({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!h)return null;Object.assign(i,h.params),a.push({params:i,pathname:sA([s,h.pathname]),pathnameBase:Oke(sA([s,h.pathnameBase])),route:f}),h.pathnameBase!=="/"&&(s=sA([s,h.pathnameBase]))}return a}function U7(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Nke(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:f,isOptional:A}=d;if(f==="*"){let m=o[h]||"";a=s.slice(0,s.length-m.length).replace(/(.)\/+$/,"$1")}const p=o[h];return A&&!p?u[f]=void 0:u[f]=(p||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:a,pattern:e}}function Nke(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,l)=>(r.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function jke(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 lD(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 Tke(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Y0(e):e;return{pathname:n?n.startsWith("/")?n:Pke(n,t):t,search:Fke(r),hash:Mke(i)}}function Pke(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 CP(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 Ike(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function cD(e,t){let n=Ike(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function uD(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Y0(e):(i=Bb({},e),hi(!i.pathname||!i.pathname.includes("?"),CP("?","pathname","search",i)),hi(!i.pathname||!i.pathname.includes("#"),CP("#","pathname","hash",i)),hi(!i.search||!i.search.includes("#"),CP("#","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 f=a.split("/");for(;f[0]==="..";)f.shift(),h-=1;i.pathname=f.join("/")}o=h>=0?t[h]:"/"}let l=Tke(i,o),u=a&&a!=="/"&&a.endsWith("/"),d=(s||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const sA=e=>e.join("/").replace(/\/\/+/g,"/"),Oke=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Fke=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Mke=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Lke(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const yie=["post","put","patch","delete"];new Set(yie);const Rke=["get",...yie];new Set(Rke);/**
 * 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 _b(){return _b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_b.apply(this,arguments)}const dD=k.createContext(null),Uke=k.createContext(null),UA=k.createContext(null),aj=k.createContext(null),Cd=k.createContext({outlet:null,matches:[],isDataRoute:!1}),vie=k.createContext(null);function Dke(e,t){let{relative:n}=t===void 0?{}:t;X0()||hi(!1);let{basename:r,navigator:i}=k.useContext(UA),{hash:s,pathname:a,search:o}=wie(e,{relative:n}),l=a;return r!=="/"&&(l=a==="/"?r:sA([r,a])),i.createHref({pathname:l,search:o,hash:s})}function X0(){return k.useContext(aj)!=null}function jo(){return X0()||hi(!1),k.useContext(aj).location}function xie(e){k.useContext(UA).static||k.useLayoutEffect(e)}function Sd(){let{isDataRoute:e}=k.useContext(Cd);return e?Zke():Qke()}function Qke(){X0()||hi(!1);let e=k.useContext(dD),{basename:t,future:n,navigator:r}=k.useContext(UA),{matches:i}=k.useContext(Cd),{pathname:s}=jo(),a=JSON.stringify(cD(i,n.v7_relativeSplatPath)),o=k.useRef(!1);return xie(()=>{o.current=!0}),k.useCallback(function(u,d){if(d===void 0&&(d={}),!o.current)return;if(typeof u=="number"){r.go(u);return}let h=uD(u,JSON.parse(a),s,d.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:sA([t,h.pathname])),(d.replace?r.replace:r.push)(h,d.state,d)},[t,r,a,s,e])}function om(){let{matches:e}=k.useContext(Cd),t=e[e.length-1];return t?t.params:{}}function wie(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=k.useContext(UA),{matches:i}=k.useContext(Cd),{pathname:s}=jo(),a=JSON.stringify(cD(i,r.v7_relativeSplatPath));return k.useMemo(()=>uD(e,JSON.parse(a),s,n==="path"),[e,a,s,n])}function Hke(e,t){return $ke(e,t)}function $ke(e,t,n,r){X0()||hi(!1);let{navigator:i}=k.useContext(UA),{matches:s}=k.useContext(Cd),a=s[s.length-1],o=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let u=jo(),d;if(t){var h;let g=typeof t=="string"?Y0(t):t;l==="/"||(h=g.pathname)!=null&&h.startsWith(l)||hi(!1),d=g}else d=u;let f=d.pathname||"/",A=f;if(l!=="/"){let g=l.replace(/^\//,"").split("/");A="/"+f.replace(/^\//,"").split("/").slice(g.length).join("/")}let p=gke(e,{pathname:A}),m=Wke(p&&p.map(g=>Object.assign({},g,{params:Object.assign({},o,g.params),pathname:sA([l,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?l:sA([l,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),s,n,r);return t&&m?k.createElement(aj.Provider,{value:{location:_b({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Rh.Pop}},m):m}function zke(){let e=Jke(),t=Lke(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 k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},t),n?k.createElement("pre",{style:i},n):null,null)}const Vke=k.createElement(zke,null);class Kke extends k.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?k.createElement(Cd.Provider,{value:this.props.routeContext},k.createElement(vie.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function qke(e){let{routeContext:t,match:n,children:r}=e,i=k.useContext(dD);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),k.createElement(Cd.Provider,{value:t},r)}function Wke(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||hi(!1),a=a.slice(0,Math.min(a.length,d+1))}let l=!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:f,errors:A}=n,p=h.route.loader&&f[h.route.id]===void 0&&(!A||A[h.route.id]===void 0);if(h.route.lazy||p){l=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((d,h,f)=>{let A,p=!1,m=null,g=null;n&&(A=o&&h.route.id?o[h.route.id]:void 0,m=h.route.errorElement||Vke,l&&(u<0&&f===0?(p=!0,g=null):u===f&&(p=!0,g=h.route.hydrateFallbackElement||null)));let y=t.concat(a.slice(0,f+1)),v=()=>{let x;return A?x=m:p?x=g:h.route.Component?x=k.createElement(h.route.Component,null):h.route.element?x=h.route.element:x=d,k.createElement(qke,{match:h,routeContext:{outlet:d,matches:y,isDataRoute:n!=null},children:x})};return n&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?k.createElement(Kke,{location:n.location,revalidation:n.revalidation,component:m,error:A,children:v(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):v()},null)}var bie=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(bie||{}),XB=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}(XB||{});function Gke(e){let t=k.useContext(dD);return t||hi(!1),t}function Yke(e){let t=k.useContext(Uke);return t||hi(!1),t}function Xke(e){let t=k.useContext(Cd);return t||hi(!1),t}function Cie(e){let t=Xke(),n=t.matches[t.matches.length-1];return n.route.id||hi(!1),n.route.id}function Jke(){var e;let t=k.useContext(vie),n=Yke(XB.UseRouteError),r=Cie(XB.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Zke(){let{router:e}=Gke(bie.UseNavigateStable),t=Cie(XB.UseNavigateStable),n=k.useRef(!1);return xie(()=>{n.current=!0}),k.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,_b({fromRouteId:t},s)))},[e,t])}function eBe(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function oj(e){let{to:t,replace:n,state:r,relative:i}=e;X0()||hi(!1);let{future:s,static:a}=k.useContext(UA),{matches:o}=k.useContext(Cd),{pathname:l}=jo(),u=Sd(),d=uD(t,cD(o,s.v7_relativeSplatPath),l,i==="path"),h=JSON.stringify(d);return k.useEffect(()=>u(JSON.parse(h),{replace:n,state:r,relative:i}),[u,h,i,n,r]),null}function It(e){hi(!1)}function tBe(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Rh.Pop,navigator:s,static:a=!1,future:o}=e;X0()&&hi(!1);let l=t.replace(/^\/*/,"/"),u=k.useMemo(()=>({basename:l,navigator:s,static:a,future:_b({v7_relativeSplatPath:!1},o)}),[l,o,s,a]);typeof r=="string"&&(r=Y0(r));let{pathname:d="/",search:h="",hash:f="",state:A=null,key:p="default"}=r,m=k.useMemo(()=>{let g=lD(d,l);return g==null?null:{location:{pathname:g,search:h,hash:f,state:A,key:p},navigationType:i}},[l,d,h,f,A,p,i]);return m==null?null:k.createElement(UA.Provider,{value:u},k.createElement(aj.Provider,{children:n,value:m}))}function nBe(e){let{children:t,location:n}=e;return Hke(D3(t),n)}new Promise(()=>{});function D3(e,t){t===void 0&&(t=[]);let n=[];return k.Children.forEach(e,(r,i)=>{if(!k.isValidElement(r))return;let s=[...t,i];if(r.type===k.Fragment){n.push.apply(n,D3(r.props.children,s));return}r.type!==It&&hi(!1),!r.props.index||!r.props.children||hi(!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=D3(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 Q3(){return Q3=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},Q3.apply(this,arguments)}function rBe(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 iBe(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function sBe(e,t){return e.button===0&&(!t||t==="_self")&&!iBe(e)}function H3(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 aBe(e,t){let n=H3(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(s=>{n.append(i,s)})}),n}const oBe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],lBe="6";try{window.__reactRouterVersion=lBe}catch{}const cBe="startTransition",D7=QR[cBe];function uBe(e){let{basename:t,children:n,future:r,window:i}=e,s=k.useRef();s.current==null&&(s.current=fke({window:i,v5Compat:!0}));let a=s.current,[o,l]=k.useState({action:a.action,location:a.location}),{v7_startTransition:u}=r||{},d=k.useCallback(h=>{u&&D7?D7(()=>l(h)):l(h)},[l,u]);return k.useLayoutEffect(()=>a.listen(d),[a,d]),k.useEffect(()=>eBe(r),[r]),k.createElement(tBe,{basename:t,children:n,location:o.location,navigationType:o.action,navigator:a,future:r})}const dBe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",hBe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ct=k.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:s,replace:a,state:o,target:l,to:u,preventScrollReset:d,viewTransition:h}=t,f=rBe(t,oBe),{basename:A}=k.useContext(UA),p,m=!1;if(typeof u=="string"&&hBe.test(u)&&(p=u,dBe))try{let x=new URL(window.location.href),b=u.startsWith("//")?new URL(x.protocol+u):new URL(u),w=lD(b.pathname,A);b.origin===x.origin&&w!=null?u=w+b.search+b.hash:m=!0}catch{}let g=Dke(u,{relative:i}),y=ABe(u,{replace:a,state:o,target:l,preventScrollReset:d,relative:i,viewTransition:h});function v(x){r&&r(x),x.defaultPrevented||y(x)}return k.createElement("a",Q3({},f,{href:p||g,onClick:m||s?r:v,ref:n,target:l}))});var Q7;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Q7||(Q7={}));var H7;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(H7||(H7={}));function ABe(e,t){let{target:n,replace:r,state:i,preventScrollReset:s,relative:a,viewTransition:o}=t===void 0?{}:t,l=Sd(),u=jo(),d=wie(e,{relative:a});return k.useCallback(h=>{if(sBe(h,n)){h.preventDefault();let f=r!==void 0?r:YB(u)===YB(d);l(e,{replace:f,state:i,preventScrollReset:s,relative:a,viewTransition:o})}},[u,l,d,r,i,n,e,s,a,o])}function fBe(e){let t=k.useRef(H3(e)),n=k.useRef(!1),r=jo(),i=k.useMemo(()=>aBe(r.search,n.current?null:t.current),[r.search]),s=Sd(),a=k.useCallback((o,l)=>{const u=H3(typeof o=="function"?o(i):o);n.current=!0,s("?"+u,l)},[s,i]);return[i,a]}var pBe=typeof Element<"u",mBe=typeof Map=="function",gBe=typeof Set=="function",yBe=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Dk(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(!Dk(e[r],t[r]))return!1;return!0}var s;if(mBe&&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(!Dk(r.value[1],t.get(r.value[0])))return!1;return!0}if(gBe&&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(yBe&&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(pBe&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!Dk(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var vBe=function(t,n){try{return Dk(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 xBe=En(vBe);var wBe=function(e,t,n,r,i,s,a,o){if(!e){var l;if(t===void 0)l=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;l=new Error(t.replace(/%s/g,function(){return u[d++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},bBe=wBe;const $7=En(bBe);var CBe=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 l=Object.prototype.hasOwnProperty.bind(n),u=0;u<a.length;u++){var d=a[u];if(!l(d))return!1;var h=t[d],f=n[d];if(s=r?r.call(i,h,f,d):void 0,s===!1||s===void 0&&h!==f)return!1}return!0};const SBe=En(CBe);var Sie=(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))(Sie||{}),SP={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"]}},z7=Object.values(Sie),hD={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},kBe=Object.entries(hD).reduce((e,[t,n])=>(e[n]=t,e),{}),Xl="data-rh",ly={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},cy=(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},BBe=e=>{let t=cy(e,"title");const n=cy(e,ly.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,()=>t);const r=cy(e,ly.DEFAULT_TITLE);return t||r||void 0},_Be=e=>cy(e,ly.ON_CHANGE_CLIENT_STATE)||(()=>{}),kP=(e,t)=>t.filter(n=>typeof n[e]<"u").map(n=>n[e]).reduce((n,r)=>({...n,...r}),{}),EBe=(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},[]),NBe=e=>console&&typeof console.warn=="function"&&console.warn(e),ax=(e,t,n)=>{const r={};return n.filter(i=>Array.isArray(i[e])?!0:(typeof i[e]<"u"&&NBe(`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(l=>{let u;const d=Object.keys(l);for(let f=0;f<d.length;f+=1){const A=d[f],p=A.toLowerCase();t.indexOf(p)!==-1&&!(u==="rel"&&l[u].toLowerCase()==="canonical")&&!(p==="rel"&&l[p].toLowerCase()==="stylesheet")&&(u=p),t.indexOf(A)!==-1&&(A==="innerHTML"||A==="cssText"||A==="itemprop")&&(u=A)}if(!u||!l[u])return!1;const h=l[u].toLowerCase();return r[u]||(r[u]={}),a[u]||(a[u]={}),r[u][h]?!1:(a[u][h]=!0,!0)}).reverse().forEach(l=>i.push(l));const o=Object.keys(a);for(let l=0;l<o.length;l+=1){const u=o[l],d={...r[u],...a[u]};r[u]=d}return i},[]).reverse()},jBe=(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},TBe=e=>({baseTag:EBe(["href"],e),bodyAttributes:kP("bodyAttributes",e),defer:cy(e,ly.DEFER),encode:cy(e,ly.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:kP("htmlAttributes",e),linkTags:ax("link",["rel","href"],e),metaTags:ax("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:ax("noscript",["innerHTML"],e),onChangeClientState:_Be(e),scriptTags:ax("script",["src","innerHTML"],e),styleTags:ax("style",["cssText"],e),title:BBe(e),titleAttributes:kP("titleAttributes",e),prioritizeSeoTags:jBe(e,ly.PRIORITIZE_SEO_TAGS)}),kie=e=>Array.isArray(e)?e.join(""):e,PBe=(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},BP=(e,t)=>Array.isArray(e)?e.reduce((n,r)=>(PBe(r,t)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:e,priority:[]},V7=(e,t)=>({...e,[t]:void 0}),IBe=["noscript","script","style"],$3=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"),Bie=e=>Object.keys(e).reduce((t,n)=>{const r=typeof e[n]<"u"?`${n}="${e[n]}"`:`${n}`;return t?`${t} ${r}`:r},""),OBe=(e,t,n,r)=>{const i=Bie(n),s=kie(t);return i?`<${e} ${Xl}="true" ${i}>${$3(s,r)}</${e}>`:`<${e} ${Xl}="true">${$3(s,r)}</${e}>`},FBe=(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}="${$3(s[d],n)}"`;return u?`${u} ${h}`:h},""),o=s.innerHTML||s.cssText||"",l=IBe.indexOf(e)===-1;return`${r}<${e} ${Xl}="true" ${a}${l?"/>":`>${o}</${e}>`}`},""),_ie=(e,t={})=>Object.keys(e).reduce((n,r)=>{const i=hD[r];return n[i||r]=e[r],n},t),MBe=(e,t,n)=>{const r={key:t,[Xl]:!0},i=_ie(n,r);return[re.createElement("title",i,t)]},Qk=(e,t)=>t.map((n,r)=>{const i={key:r,[Xl]:!0};return Object.keys(n).forEach(s=>{const o=hD[s]||s;if(o==="innerHTML"||o==="cssText"){const l=n.innerHTML||n.cssText;i.dangerouslySetInnerHTML={__html:l}}else i[o]=n[s]}),re.createElement(e,i)}),zo=(e,t,n=!0)=>{switch(e){case"title":return{toComponent:()=>MBe(e,t.title,t.titleAttributes),toString:()=>OBe(e,t.title,t.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>_ie(t),toString:()=>Bie(t)};default:return{toComponent:()=>Qk(e,t),toString:()=>FBe(e,t,n)}}},LBe=({metaTags:e,linkTags:t,scriptTags:n,encode:r})=>{const i=BP(e,SP.meta),s=BP(t,SP.link),a=BP(n,SP.script);return{priorityMethods:{toComponent:()=>[...Qk("meta",i.priority),...Qk("link",s.priority),...Qk("script",a.priority)],toString:()=>`${zo("meta",i.priority,r)} ${zo("link",s.priority,r)} ${zo("script",a.priority,r)}`},metaTags:i.default,linkTags:s.default,scriptTags:a.default}},RBe=e=>{const{baseTag:t,bodyAttributes:n,encode:r=!0,htmlAttributes:i,noscriptTags:s,styleTags:a,title:o="",titleAttributes:l,prioritizeSeoTags:u}=e;let{linkTags:d,metaTags:h,scriptTags:f}=e,A={toComponent:()=>{},toString:()=>""};return u&&({priorityMethods:A,linkTags:d,metaTags:h,scriptTags:f}=LBe(e)),{priority:A,base:zo("base",t,r),bodyAttributes:zo("bodyAttributes",n,r),htmlAttributes:zo("htmlAttributes",i,r),link:zo("link",d,r),meta:zo("meta",h,r),noscript:zo("noscript",s,r),script:zo("script",f,r),style:zo("style",a,r),title:zo("title",{title:o,titleAttributes:l},r)}},z3=RBe,WC=[],Eie=!!(typeof window<"u"&&window.document&&window.document.createElement),V3=class{constructor(e,t){dn(this,"instances",[]);dn(this,"canUseDOM",Eie);dn(this,"context");dn(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?WC:this.instances,add:e=>{(this.canUseDOM?WC:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?WC:this.instances).indexOf(e);(this.canUseDOM?WC:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=z3({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},UBe={},Nie=re.createContext(UBe),fp,jie=(fp=class extends k.Component{constructor(n){super(n);dn(this,"helmetData");this.helmetData=new V3(this.props.context||{},fp.canUseDOM)}render(){return re.createElement(Nie.Provider,{value:this.helmetData.value},this.props.children)}},dn(fp,"canUseDOM",Eie),fp),$m=(e,t)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll(`${e}[${Xl}]`),i=[].slice.call(r),s=[];let a;return t&&t.length&&t.forEach(o=>{const l=document.createElement(e);for(const u in o)if(Object.prototype.hasOwnProperty.call(o,u))if(u==="innerHTML")l.innerHTML=o.innerHTML;else if(u==="cssText")l.styleSheet?l.styleSheet.cssText=o.cssText:l.appendChild(document.createTextNode(o.cssText));else{const d=u,h=typeof o[d]>"u"?"":o[d];l.setAttribute(u,h)}l.setAttribute(Xl,"true"),i.some((u,d)=>(a=d,l.isEqualNode(u)))?i.splice(a,1):s.push(l)}),i.forEach(o=>{var l;return(l=o.parentNode)==null?void 0:l.removeChild(o)}),s.forEach(o=>n.appendChild(o)),{oldTags:i,newTags:s}},K3=(e,t)=>{const n=document.getElementsByTagName(e)[0];if(!n)return;const r=n.getAttribute(Xl),i=r?r.split(","):[],s=[...i],a=Object.keys(t);for(const o of a){const l=t[o]||"";n.getAttribute(o)!==l&&n.setAttribute(o,l),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(Xl):n.getAttribute(Xl)!==a.join(",")&&n.setAttribute(Xl,a.join(","))},DBe=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=kie(e)),K3("title",t)},K7=(e,t)=>{const{baseTag:n,bodyAttributes:r,htmlAttributes:i,linkTags:s,metaTags:a,noscriptTags:o,onChangeClientState:l,scriptTags:u,styleTags:d,title:h,titleAttributes:f}=e;K3("body",r),K3("html",i),DBe(h,f);const A={baseTag:$m("base",n),linkTags:$m("link",s),metaTags:$m("meta",a),noscriptTags:$m("noscript",o),scriptTags:$m("script",u),styleTags:$m("style",d)},p={},m={};Object.keys(A).forEach(g=>{const{newTags:y,oldTags:v}=A[g];y.length&&(p[g]=y),v.length&&(m[g]=A[g].oldTags)}),t&&t(),l(e,p,m)},ox=null,QBe=e=>{ox&&cancelAnimationFrame(ox),e.defer?ox=requestAnimationFrame(()=>{K7(e,()=>{ox=null})}):(K7(e),ox=null)},HBe=QBe,q7=class extends k.Component{constructor(){super(...arguments);dn(this,"rendered",!1)}shouldComponentUpdate(t){return!SBe(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=TBe(t.get().map(s=>{const a={...s.props};return delete a.context,a}));jie.canUseDOM?HBe(i):z3&&(r=z3(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}},vO,ur=(vO=class extends k.Component{shouldComponentUpdate(e){return!xBe(V7(this.props,"helmetData"),V7(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 $7(z7.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 ${z7.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),$7(!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((l,u)=>(l[kBe[u]||u]=s[u],l),{});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 V3)){const i=r;r=new V3(i.context,!0),delete n.helmetData}return r?re.createElement(q7,{...n,context:r.value}):re.createElement(Nie.Consumer,null,i=>re.createElement(q7,{...n,context:i}))}},dn(vO,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),vO);const $Be=["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 zBe(){const e=navigator.userAgent;if(!$Be.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 VBe=()=>{const{pathname:e,hash:t}=jo();return k.useEffect(()=>{if(t){const n=document.querySelector(t);n&&n.scrollIntoView({behavior:"smooth"})}else window.scrollTo(0,0)},[e,t]),null},AD=k.createContext({});function fD(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const Tie=typeof window<"u",Pie=Tie?k.useLayoutEffect:k.useEffect,lj=k.createContext(null);function pD(e,t){e.indexOf(t)===-1&&e.push(t)}function mD(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const ou=(e,t,n)=>n>t?t:n<e?e:n;let cj=()=>{},e0=()=>{};const pd={},Iie=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Oie(e){return typeof e=="object"&&e!==null}const Fie=e=>/^0[^.\s]+$/u.test(e);function gD(e){let t;return()=>(t===void 0&&(t=e()),t)}const ul=e=>e,KBe=(e,t)=>n=>t(e(n)),h2=(...e)=>e.reduce(KBe),Eb=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class yD{constructor(){this.subscriptions=[]}add(t){return pD(this.subscriptions,t),()=>mD(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 eu=e=>e*1e3,rl=e=>e/1e3;function Mie(e,t){return t?e*(1e3/t):0}const Lie=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,qBe=1e-7,WBe=12;function GBe(e,t,n,r,i){let s,a,o=0;do a=t+(n-t)/2,s=Lie(a,r,i)-e,s>0?n=a:t=a;while(Math.abs(s)>qBe&&++o<WBe);return a}function A2(e,t,n,r){if(e===t&&n===r)return ul;const i=s=>GBe(s,0,1,e,n);return s=>s===0||s===1?s:Lie(i(s),t,r)}const Rie=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Uie=e=>t=>1-e(1-t),Die=A2(.33,1.53,.69,.99),vD=Uie(Die),Qie=Rie(vD),Hie=e=>(e*=2)<1?.5*vD(e):.5*(2-Math.pow(2,-10*(e-1))),xD=e=>1-Math.sin(Math.acos(e)),$ie=Uie(xD),zie=Rie(xD),YBe=A2(.42,0,1,1),XBe=A2(0,0,.58,1),Vie=A2(.42,0,.58,1),JBe=e=>Array.isArray(e)&&typeof e[0]!="number",Kie=e=>Array.isArray(e)&&typeof e[0]=="number",W7={linear:ul,easeIn:YBe,easeInOut:Vie,easeOut:XBe,circIn:xD,circInOut:zie,circOut:$ie,backIn:vD,backInOut:Qie,backOut:Die,anticipate:Hie},ZBe=e=>typeof e=="string",G7=e=>{if(Kie(e)){e0(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,i]=e;return A2(t,n,r,i)}else if(ZBe(e))return e0(W7[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),W7[e];return e},GC=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],Y7={value:null,addProjectionMetrics:null};function e_e(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},l=0;function u(h){a.has(h)&&(d.schedule(h),e()),l++,h(o)}const d={schedule:(h,f=!1,A=!1)=>{const m=A&&i?n:r;return f&&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&&Y7.value&&Y7.value.frameloop[t].push(l),l=0,n.clear(),i=!1,s&&(s=!1,d.process(h))}};return d}const t_e=40;function qie(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,a=GC.reduce((x,b)=>(x[b]=e_e(s,t?b:void 0),x),{}),{setup:o,read:l,resolveKeyframes:u,preUpdate:d,update:h,preRender:f,render:A,postRender:p}=a,m=()=>{const x=pd.useManualTiming?i.timestamp:performance.now();n=!1,pd.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(x-i.timestamp,t_e),1)),i.timestamp=x,i.isProcessing=!0,o.process(i),l.process(i),u.process(i),d.process(i),h.process(i),f.process(i),A.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:GC.reduce((x,b)=>{const w=a[b];return x[b]=(S,_=!1,E=!1)=>(n||g(),w.schedule(S,_,E)),x},{}),cancel:x=>{for(let b=0;b<GC.length;b++)a[GC[b]].cancel(x)},state:i,steps:a}}const{schedule:Cr,cancel:CA,state:fs,steps:_P}=qie(typeof requestAnimationFrame<"u"?requestAnimationFrame:ul,!0);let Hk;function n_e(){Hk=void 0}const ca={now:()=>(Hk===void 0&&ca.set(fs.isProcessing||pd.useManualTiming?fs.timestamp:performance.now()),Hk),set:e=>{Hk=e,queueMicrotask(n_e)}},Wie=e=>t=>typeof t=="string"&&t.startsWith(e),Gie=Wie("--"),r_e=Wie("var(--"),wD=e=>r_e(e)?i_e.test(e.split("/*")[0].trim()):!1,i_e=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function X7(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const J0={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Nb={...J0,transform:e=>ou(0,1,e)},YC={...J0,default:1},vw=e=>Math.round(e*1e5)/1e5,bD=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function s_e(e){return e==null}const a_e=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,CD=(e,t)=>n=>!!(typeof n=="string"&&a_e.test(n)&&n.startsWith(e)||t&&!s_e(n)&&Object.prototype.hasOwnProperty.call(n,t)),Yie=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,a,o]=r.match(bD);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},o_e=e=>ou(0,255,e),EP={...J0,transform:e=>Math.round(o_e(e))},zf={test:CD("rgb","red"),parse:Yie("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+EP.transform(e)+", "+EP.transform(t)+", "+EP.transform(n)+", "+vw(Nb.transform(r))+")"};function l_e(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 q3={test:CD("#"),parse:l_e,transform:zf.transform},f2=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),sh=f2("deg"),tu=f2("%"),At=f2("px"),c_e=f2("vh"),u_e=f2("vw"),J7={...tu,parse:e=>tu.parse(e)/100,transform:e=>tu.transform(e*100)},$g={test:CD("hsl","hue"),parse:Yie("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+tu.transform(vw(t))+", "+tu.transform(vw(n))+", "+vw(Nb.transform(r))+")"},xi={test:e=>zf.test(e)||q3.test(e)||$g.test(e),parse:e=>zf.test(e)?zf.parse(e):$g.test(e)?$g.parse(e):q3.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?zf.transform(e):$g.transform(e),getAnimatableNone:e=>{const t=xi.parse(e);return t.alpha=0,xi.transform(t)}},d_e=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function h_e(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(bD))==null?void 0:t.length)||0)+(((n=e.match(d_e))==null?void 0:n.length)||0)>0}const Xie="number",Jie="color",A_e="var",f_e="var(",Z7="${}",p_e=/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 jb(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const o=t.replace(p_e,l=>(xi.test(l)?(r.color.push(s),i.push(Jie),n.push(xi.parse(l))):l.startsWith(f_e)?(r.var.push(s),i.push(A_e),n.push(l)):(r.number.push(s),i.push(Xie),n.push(parseFloat(l))),++s,Z7)).split(Z7);return{values:n,split:o,indexes:r,types:i}}function Zie(e){return jb(e).values}function ese(e){const{split:t,types:n}=jb(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===Xie?s+=vw(i[a]):o===Jie?s+=xi.transform(i[a]):s+=i[a]}return s}}const m_e=e=>typeof e=="number"?0:xi.test(e)?xi.getAnimatableNone(e):e;function g_e(e){const t=Zie(e);return ese(e)(t.map(m_e))}const SA={test:h_e,parse:Zie,createTransformer:ese,getAnimatableNone:g_e};function NP(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 y_e({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,l=2*n-o;i=NP(l,o,e+1/3),s=NP(l,o,e),a=NP(l,o,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:r}}function JB(e,t){return n=>n>0?t:e}const Mr=(e,t,n)=>e+(t-e)*n,jP=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},v_e=[q3,zf,$g],x_e=e=>v_e.find(t=>t.test(e));function ez(e){const t=x_e(e);if(cj(!!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===$g&&(n=y_e(n)),n}const tz=(e,t)=>{const n=ez(e),r=ez(t);if(!n||!r)return JB(e,t);const i={...n};return s=>(i.red=jP(n.red,r.red,s),i.green=jP(n.green,r.green,s),i.blue=jP(n.blue,r.blue,s),i.alpha=Mr(n.alpha,r.alpha,s),zf.transform(i))},W3=new Set(["none","hidden"]);function w_e(e,t){return W3.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function b_e(e,t){return n=>Mr(e,t,n)}function SD(e){return typeof e=="number"?b_e:typeof e=="string"?wD(e)?JB:xi.test(e)?tz:k_e:Array.isArray(e)?tse:typeof e=="object"?xi.test(e)?tz:C_e:JB}function tse(e,t){const n=[...e],r=n.length,i=e.map((s,a)=>SD(s)(s,t[a]));return s=>{for(let a=0;a<r;a++)n[a]=i[a](s);return n}}function C_e(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=SD(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function S_e(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 k_e=(e,t)=>{const n=SA.createTransformer(t),r=jb(e),i=jb(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?W3.has(e)&&!i.values.length||W3.has(t)&&!r.values.length?w_e(e,t):h2(tse(S_e(r,i),i.values),n):(cj(!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"),JB(e,t))};function nse(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Mr(e,t,n):SD(e)(e,t)}const B_e=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Cr.update(t,n),stop:()=>CA(t),now:()=>fs.isProcessing?fs.timestamp:ca.now()}},rse=(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)})`},ZB=2e4;function kD(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<ZB;)t+=n,r=e.next(t);return t>=ZB?1/0:t}function __e(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(kD(r),ZB);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:rl(i)}}const E_e=5;function ise(e,t,n){const r=Math.max(t-E_e,0);return Mie(n-e(r),t-r)}const Ir={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},TP=.001;function N_e({duration:e=Ir.duration,bounce:t=Ir.bounce,velocity:n=Ir.velocity,mass:r=Ir.mass}){let i,s;cj(e<=eu(Ir.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-t;a=ou(Ir.minDamping,Ir.maxDamping,a),e=ou(Ir.minDuration,Ir.maxDuration,rl(e)),a<1?(i=u=>{const d=u*a,h=d*e,f=d-n,A=G3(u,a),p=Math.exp(-h);return TP-f/A*p},s=u=>{const h=u*a*e,f=h*n+n,A=Math.pow(a,2)*Math.pow(u,2)*e,p=Math.exp(-h),m=G3(Math.pow(u,2),a);return(-i(u)+TP>0?-1:1)*((f-A)*p)/m}):(i=u=>{const d=Math.exp(-u*e),h=(u-n)*e+1;return-TP+d*h},s=u=>{const d=Math.exp(-u*e),h=(n-u)*(e*e);return d*h});const o=5/e,l=T_e(i,s,o);if(e=eu(e),isNaN(l))return{stiffness:Ir.stiffness,damping:Ir.damping,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const j_e=12;function T_e(e,t,n){let r=n;for(let i=1;i<j_e;i++)r=r-e(r)/t(r);return r}function G3(e,t){return e*Math.sqrt(1-t*t)}const P_e=["duration","bounce"],I_e=["stiffness","damping","mass"];function nz(e,t){return t.some(n=>e[n]!==void 0)}function O_e(e){let t={velocity:Ir.velocity,stiffness:Ir.stiffness,damping:Ir.damping,mass:Ir.mass,isResolvedFromDuration:!1,...e};if(!nz(e,I_e)&&nz(e,P_e))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*ou(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Ir.mass,stiffness:i,damping:s}}else{const n=N_e(e);t={...t,...n,mass:Ir.mass},t.isResolvedFromDuration=!0}return t}function e_(e=Ir.visualDuration,t=Ir.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:l,damping:u,mass:d,duration:h,velocity:f,isResolvedFromDuration:A}=O_e({...n,velocity:-rl(n.velocity||0)}),p=f||0,m=u/(2*Math.sqrt(l*d)),g=a-s,y=rl(Math.sqrt(l/d)),v=Math.abs(g)<5;r||(r=v?Ir.restSpeed.granular:Ir.restSpeed.default),i||(i=v?Ir.restDelta.granular:Ir.restDelta.default);let x;if(m<1){const w=G3(y,m);x=S=>{const _=Math.exp(-m*y*S);return a-_*((p+m*y*g)/w*Math.sin(w*S)+g*Math.cos(w*S))}}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=S=>{const _=Math.exp(-m*y*S),E=Math.min(w*S,300);return a-_*((p+m*y*g)*Math.sinh(E)+w*g*Math.cosh(E))/w}}const b={calculatedDuration:A&&h||null,next:w=>{const S=x(w);if(A)o.done=w>=h;else{let _=w===0?p:0;m<1&&(_=w===0?eu(p):ise(x,w,S));const E=Math.abs(_)<=r,j=Math.abs(a-S)<=i;o.done=E&&j}return o.value=o.done?a:S,o},toString:()=>{const w=Math.min(kD(b),ZB),S=rse(_=>b.next(w*_).value,w,30);return w+"ms "+S},toTransition:()=>{}};return b}e_.applyToOptions=e=>{const t=__e(e,100,e_);return e.ease=t.ease,e.duration=eu(t.duration),e.type="keyframes",e};function Y3({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:a,min:o,max:l,restDelta:u=.5,restSpeed:d}){const h=e[0],f={done:!1,value:h},A=E=>o!==void 0&&E<o||l!==void 0&&E>l,p=E=>o===void 0?l:l===void 0||Math.abs(o-E)<Math.abs(l-E)?o:l;let m=n*t;const g=h+m,y=a===void 0?g:a(g);y!==g&&(m=y-h);const v=E=>-m*Math.exp(-E/r),x=E=>y+v(E),b=E=>{const j=v(E),I=x(E);f.done=Math.abs(j)<=u,f.value=f.done?y:I};let w,S;const _=E=>{A(f.value)&&(w=E,S=e_({keyframes:[f.value,p(f.value)],velocity:ise(x,E,f.value),damping:i,stiffness:s,restDelta:u,restSpeed:d}))};return _(0),{calculatedDuration:null,next:E=>{let j=!1;return!S&&w===void 0&&(j=!0,b(E),_(E)),w!==void 0&&E>=w?S.next(E-w):(!j&&b(E),f)}}}function F_e(e,t,n){const r=[],i=n||pd.mix||nse,s=e.length-1;for(let a=0;a<s;a++){let o=i(e[a],e[a+1]);if(t){const l=Array.isArray(t)?t[a]||ul:t;o=h2(l,o)}r.push(o)}return r}function M_e(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(e0(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=F_e(t,r,i),l=o.length,u=d=>{if(a&&d<e[0])return t[0];let h=0;if(l>1)for(;h<e.length-2&&!(d<e[h+1]);h++);const f=Eb(e[h],e[h+1],d);return o[h](f)};return n?d=>u(ou(e[0],e[s-1],d)):u}function L_e(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Eb(0,t,r);e.push(Mr(n,1,i))}}function R_e(e){const t=[0];return L_e(t,e.length-1),t}function U_e(e,t){return e.map(n=>n*t)}function D_e(e,t){return e.map(()=>t||Vie).splice(0,e.length-1)}function xw({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=JBe(r)?r.map(G7):G7(r),s={done:!1,value:t[0]},a=U_e(n&&n.length===t.length?n:R_e(t),e),o=M_e(a,t,{ease:Array.isArray(i)?i:D_e(t,i)});return{calculatedDuration:e,next:l=>(s.value=o(l),s.done=l>=e,s)}}const Q_e=e=>e!==null;function BD(e,{repeat:t,repeatType:n="loop"},r,i=1){const s=e.filter(Q_e),o=i<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!o||r===void 0?s[o]:r}const H_e={decay:Y3,inertia:Y3,tween:xw,keyframes:xw,spring:e_};function sse(e){typeof e.type=="string"&&(e.type=H_e[e.type])}class _D{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 $_e=e=>e/100;class ED extends _D{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!==ca.now()&&this.tick(ca.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=xw,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:a=0}=t;let{keyframes:o}=t;const l=n||xw;l!==xw&&typeof o[0]!="number"&&(this.mixKeyframes=h2($_e,nse(o[0],o[1])),o=[0,100]);const u=l({...t,keyframes:o});s==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...o].reverse(),velocity:-a})),u.calculatedDuration===null&&(u.calculatedDuration=kD(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:l}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:h,repeatType:f,repeatDelay:A,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 E=Math.min(this.currentTime,i)/o;let j=Math.floor(E),I=E%1;!I&&E>=1&&(I=1),I===1&&j--,j=Math.min(j,h+1),!!(j%2)&&(f==="reverse"?(I=1-I,A&&(I-=A/o)):f==="mirror"&&(b=a)),x=ou(0,1,I)*o}const w=v?{done:!1,value:d[0]}:b.next(x);s&&(w.value=s(w.value));let{done:S}=w;!v&&l!==null&&(S=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return _&&p!==Y3&&(w.value=BD(d,this.options,g,this.speed)),m&&m(w.value),_&&this.finish(),w}then(t,n){return this.finished.then(t,n)}get duration(){return rl(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+rl(t)}get time(){return rl(this.currentTime)}set time(t){var n;t=eu(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(ca.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=rl(this.currentTime))}play(){var i,s;if(this.isStopped)return;const{driver:t=B_e,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(ca.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 z_e(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Vf=e=>e*180/Math.PI,X3=e=>{const t=Vf(Math.atan2(e[1],e[0]));return J3(t)},V_e={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:X3,rotateZ:X3,skewX:e=>Vf(Math.atan(e[1])),skewY:e=>Vf(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},J3=e=>(e=e%360,e<0&&(e+=360),e),rz=X3,iz=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),sz=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),K_e={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:iz,scaleY:sz,scale:e=>(iz(e)+sz(e))/2,rotateX:e=>J3(Vf(Math.atan2(e[6],e[5]))),rotateY:e=>J3(Vf(Math.atan2(-e[2],e[0]))),rotateZ:rz,rotate:rz,skewX:e=>Vf(Math.atan(e[4])),skewY:e=>Vf(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Z3(e){return e.includes("scale")?1:0}function eF(e,t){if(!e||e==="none")return Z3(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=K_e,i=n;else{const o=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=V_e,i=o}if(!i)return Z3(t);const s=r[t],a=i[1].split(",").map(W_e);return typeof s=="function"?s(a):a[s]}const q_e=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return eF(n,t)};function W_e(e){return parseFloat(e.trim())}const Z0=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ev=new Set(Z0),az=e=>e===J0||e===At,G_e=new Set(["x","y","z"]),Y_e=Z0.filter(e=>!G_e.has(e));function X_e(e){const t=[];return Y_e.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Uh={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})=>eF(t,"x"),y:(e,{transform:t})=>eF(t,"y")};Uh.translateX=Uh.x;Uh.translateY=Uh.y;const yp=new Set;let tF=!1,nF=!1,rF=!1;function ase(){if(nF){const e=Array.from(yp).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=X_e(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)})}nF=!1,tF=!1,yp.forEach(e=>e.complete(rF)),yp.clear()}function ose(){yp.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(nF=!0)})}function J_e(){rF=!0,ose(),ase(),rF=!1}class ND{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?(yp.add(this),tF||(tF=!0,Cr.read(ose),Cr.resolveKeyframes(ase))):(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])}z_e(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),yp.delete(this)}cancel(){this.state==="scheduled"&&(yp.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Z_e=e=>e.startsWith("--");function eEe(e,t,n){Z_e(t)?e.style.setProperty(t,n):e.style[t]=n}const tEe=gD(()=>window.ScrollTimeline!==void 0),nEe={};function rEe(e,t){const n=gD(e);return()=>nEe[t]??n()}const lse=rEe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Hx=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,oz={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Hx([0,.65,.55,1]),circOut:Hx([.55,0,1,.45]),backIn:Hx([.31,.01,.66,-.59]),backOut:Hx([.33,1.53,.69,.99])};function cse(e,t){if(e)return typeof e=="function"?lse()?rse(e,t):"ease-out":Kie(e)?Hx(e):Array.isArray(e)?e.map(n=>cse(n,t)||oz.easeOut):oz[e]}function iEe(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:a="loop",ease:o="easeOut",times:l}={},u=void 0){const d={[t]:n};l&&(d.offset=l);const h=cse(o,i);Array.isArray(h)&&(d.easing=h);const f={delay:r,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),e.animate(d,f)}function use(e){return typeof e=="function"&&"applyToOptions"in e}function sEe({type:e,...t}){return use(e)&&lse()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class aEe extends _D{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:l}=t;this.isPseudoElement=!!s,this.allowFlatten=a,this.options=t,e0(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=sEe(t);this.animation=iEe(n,r,i,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=BD(i,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(d):eEe(n,r,d),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var 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 rl(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+rl(t)}get time(){return rl(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=eu(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&&tEe()?(this.animation.timeline=t,ul):n(this)}}const dse={anticipate:Hie,backInOut:Qie,circInOut:zie};function oEe(e){return e in dse}function lEe(e){typeof e.ease=="string"&&oEe(e.ease)&&(e.ease=dse[e.ease])}const PP=10;class cEe extends aEe{constructor(t){lEe(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 ED({...a,autoplay:!1}),l=Math.max(PP,ca.now()-this.startTime),u=ou(0,PP,l-PP);n.setWithVelocity(o.sample(Math.max(0,l-u)).value,o.sample(l).value,u),o.stop()}}const lz=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(SA.test(e)||e==="0")&&!e.startsWith("url("));function uEe(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 dEe(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=lz(i,t),o=lz(s,t);return cj(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:uEe(e)||(n==="spring"||use(n))&&r}function iF(e){e.duration=0,e.type="keyframes"}const hEe=new Set(["opacity","clipPath","filter","transform"]),AEe=gD(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function fEe(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:l,transformTemplate:u}=t.owner.getProps();return AEe()&&n&&hEe.has(n)&&(n!=="transform"||!u)&&!l&&!r&&i!=="mirror"&&s!==0&&a!=="inertia"}const pEe=40;class mEe extends _D{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:a="loop",keyframes:o,name:l,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=ca.now();const f={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:a,name:l,motionValue:u,element:d,...h},A=(d==null?void 0:d.KeyframeResolver)||ND;this.keyframeResolver=new A(o,(m,g,y)=>this.onKeyframesResolved(m,g,f,!y),l,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:l,isHandoff:u,onUpdate:d}=r;this.resolvedAt=ca.now(),dEe(t,s,a,o)||((pd.instantAnimations||!l)&&(d==null||d(BD(t,r,n))),t[0]=t[t.length-1],iF(r),r.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>pEe?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},A=!u&&fEe(f),p=(y=(g=f.motionValue)==null?void 0:g.owner)==null?void 0:y.current,m=A?new cEe({...f,element:p}):new ED(f);m.finished.then(()=>{this.notifyFinished()}).catch(ul),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(),J_e()),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 hse(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 gEe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function yEe(e){const t=gEe.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}const vEe=4;function Ase(e,t,n=1){e0(n<=vEe,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,i]=yEe(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const a=s.trim();return Iie(a)?parseFloat(a):a}return wD(i)?Ase(i,t,n+1):i}const xEe={type:"spring",stiffness:500,damping:25,restSpeed:10},wEe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),bEe={type:"keyframes",duration:.8},CEe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},SEe=(e,{keyframes:t})=>t.length>2?bEe:ev.has(e)?e.startsWith("scale")?wEe(t[1]):xEe:CEe,kEe=e=>e!==null;function BEe(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(kEe),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}function jD(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}function _Ee({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:a,repeatDelay:o,from:l,elapsed:u,...d}){return!!Object.keys(d).length}const TD=(e,t,n,r={},i,s)=>a=>{const o=jD(r,e)||{},l=o.delay||r.delay||0;let{elapsed:u=0}=r;u=u-eu(l);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-u,onUpdate:f=>{t.set(f),o.onUpdate&&o.onUpdate(f)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:s?void 0:i};_Ee(o)||Object.assign(d,SEe(e,d)),d.duration&&(d.duration=eu(d.duration)),d.repeatDelay&&(d.repeatDelay=eu(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let h=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(iF(d),d.delay===0&&(h=!0)),(pd.instantAnimations||pd.skipAnimations)&&(h=!0,iF(d),d.delay=0),d.allowFlatten=!o.type&&!o.ease,h&&!s&&t.get()!==void 0){const f=BEe(d.keyframes,o);if(f!==void 0){Cr.update(()=>{d.onUpdate(f),d.onComplete()});return}}return o.isSync?new ED(d):new mEe(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 PD(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 uy(e,t,n){const r=e.getProps();return PD(r,t,n!==void 0?n:r.custom,e)}const fse=new Set(["width","height","top","left","right","bottom",...Z0]),uz=30,EEe=e=>!isNaN(parseFloat(e));class NEe{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const i=ca.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=ca.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=EEe(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 yD);const r=this.events[t].add(n);return t==="change"?()=>{r(),Cr.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=ca.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>uz)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,uz);return Mie(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 t0(e,t){return new NEe(e,t)}const sF=e=>Array.isArray(e);function jEe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,t0(n))}function TEe(e){return sF(e)?e[e.length-1]||0:e}function PEe(e,t){const n=uy(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const a in s){const o=TEe(s[a]);jEe(e,a,o)}}const Hs=e=>!!(e&&e.getVelocity);function IEe(e){return!!(Hs(e)&&e.add)}function aF(e,t){const n=e.getValue("willChange");if(IEe(n))return n.add(t);if(!n&&pd.WillChange){const r=new pd.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function ID(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const OEe="framerAppearId",pse="data-"+ID(OEe);function mse(e){return e.props[pse]}function FEe({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function gse(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:a,...o}=t;r&&(s=r);const l=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const d in o){const h=e.getValue(d,e.latestValues[d]??null),f=o[d];if(f===void 0||u&&FEe(u,d))continue;const A={delay:n,...jD(s||{},d)},p=h.get();if(p!==void 0&&!h.isAnimating&&!Array.isArray(f)&&f===p&&!A.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const y=mse(e);if(y){const v=window.MotionHandoffAnimation(y,d,Cr);v!==null&&(A.startTime=v,m=!0)}}aF(e,d),h.start(TD(d,h,f,e.shouldReduceMotion&&fse.has(d)?{type:!1}:A,e,m));const g=h.animation;g&&l.push(g)}return a&&Promise.all(l).then(()=>{Cr.update(()=>{a&&PEe(e,a)})}),l}function oF(e,t,n={}){var l;const r=uy(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(gse(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:f}=i;return MEe(e,t,u,d,h,f,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 MEe(e,t,n=0,r=0,i=0,s=1,a){const o=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),o.push(oF(l,t,{...a,delay:n+(typeof r=="function"?0:r)+hse(e.variantChildren,l,r,i,s)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(o)}function LEe(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>oF(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=oF(e,t,n);else{const i=typeof t=="function"?uy(e,t,n.custom):t;r=Promise.all(gse(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const REe={test:e=>e==="auto",parse:e=>e},yse=e=>t=>t.test(e),vse=[J0,At,tu,sh,u_e,c_e,REe],dz=e=>vse.find(yse(e));function UEe(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Fie(e):!0}const DEe=new Set(["brightness","contrast","saturate","opacity"]);function QEe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(bD)||[];if(!r)return e;const i=n.replace(r,"");let s=DEe.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const HEe=/\b([a-z-]*)\(.*?\)/gu,lF={...SA,getAnimatableNone:e=>{const t=e.match(HEe);return t?t.map(QEe).join(" "):e}},hz={...J0,transform:Math.round},$Ee={rotate:sh,rotateX:sh,rotateY:sh,rotateZ:sh,scale:YC,scaleX:YC,scaleY:YC,scaleZ:YC,skew:sh,skewX:sh,skewY:sh,distance:At,translateX:At,translateY:At,translateZ:At,x:At,y:At,z:At,perspective:At,transformPerspective:At,opacity:Nb,originX:J7,originY:J7,originZ:At},OD={borderWidth:At,borderTopWidth:At,borderRightWidth:At,borderBottomWidth:At,borderLeftWidth:At,borderRadius:At,borderTopLeftRadius:At,borderTopRightRadius:At,borderBottomRightRadius:At,borderBottomLeftRadius:At,width:At,maxWidth:At,height:At,maxHeight:At,top:At,right:At,bottom:At,left:At,inset:At,insetBlock:At,insetBlockStart:At,insetBlockEnd:At,insetInline:At,insetInlineStart:At,insetInlineEnd:At,padding:At,paddingTop:At,paddingRight:At,paddingBottom:At,paddingLeft:At,paddingBlock:At,paddingBlockStart:At,paddingBlockEnd:At,paddingInline:At,paddingInlineStart:At,paddingInlineEnd:At,margin:At,marginTop:At,marginRight:At,marginBottom:At,marginLeft:At,marginBlock:At,marginBlockStart:At,marginBlockEnd:At,marginInline:At,marginInlineStart:At,marginInlineEnd:At,fontSize:At,backgroundPositionX:At,backgroundPositionY:At,...$Ee,zIndex:hz,fillOpacity:Nb,strokeOpacity:Nb,numOctaves:hz},zEe={...OD,color:xi,backgroundColor:xi,outlineColor:xi,fill:xi,stroke:xi,borderColor:xi,borderTopColor:xi,borderRightColor:xi,borderBottomColor:xi,borderLeftColor:xi,filter:lF,WebkitFilter:lF},xse=e=>zEe[e];function wse(e,t){let n=xse(e);return n!==lF&&(n=SA),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const VEe=new Set(["auto","none","0"]);function KEe(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!VEe.has(s)&&jb(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=wse(n,i)}class qEe extends ND{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(),wD(h))){const f=Ase(h,n.current);f!==void 0&&(t[d]=f),d===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!fse.has(r)||t.length!==2)return;const[i,s]=t,a=dz(i),o=dz(s),l=X7(i),u=X7(s);if(l!==u&&Uh[r]){this.needsMeasurement=!0;return}if(a!==o)if(az(a)&&az(o))for(let d=0;d<t.length;d++){const h=t[d];typeof h=="string"&&(t[d]=parseFloat(h))}else Uh[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)(t[i]===null||UEe(t[i]))&&r.push(i);r.length&&KEe(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=Uh[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]=Uh[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(([l,u])=>{t.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function bse(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 Cse=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function cF(e){return Oie(e)&&"offsetHeight"in e}const{schedule:FD,cancel:Njt}=qie(queueMicrotask,!1),Rl={x:!1,y:!1};function Sse(){return Rl.x||Rl.y}function WEe(e){return e==="x"||e==="y"?Rl[e]?null:(Rl[e]=!0,()=>{Rl[e]=!1}):Rl.x||Rl.y?null:(Rl.x=Rl.y=!0,()=>{Rl.x=Rl.y=!1})}function kse(e,t){const n=bse(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Az(e){return!(e.pointerType==="touch"||Sse())}function GEe(e,t,n={}){const[r,i,s]=kse(e,n),a=o=>{if(!Az(o))return;const{target:l}=o,u=t(l,o);if(typeof u!="function"||!l)return;const d=h=>{Az(h)&&(u(h),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,i)};return r.forEach(o=>{o.addEventListener("pointerenter",a,i)}),s}const Bse=(e,t)=>t?e===t?!0:Bse(e,t.parentElement):!1,MD=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,YEe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function _se(e){return YEe.has(e.tagName)||e.isContentEditable===!0}const $k=new WeakSet;function fz(e){return t=>{t.key==="Enter"&&e(t)}}function IP(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const XEe=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=fz(()=>{if($k.has(n))return;IP(n,"down");const i=fz(()=>{IP(n,"up")}),s=()=>IP(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 pz(e){return MD(e)&&!Sse()}function JEe(e,t,n={}){const[r,i,s]=kse(e,n),a=o=>{const l=o.currentTarget;if(!pz(o))return;$k.add(l);const u=t(l,o),d=(A,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),$k.has(l)&&$k.delete(l),pz(A)&&typeof u=="function"&&u(A,{success:p})},h=A=>{d(A,l===window||l===document||n.useGlobalTarget||Bse(l,A.target))},f=A=>{d(A,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return r.forEach(o=>{(n.useGlobalTarget?window:o).addEventListener("pointerdown",a,i),cF(o)&&(o.addEventListener("focus",u=>XEe(u,i)),!_se(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),s}function Ese(e){return Oie(e)&&"ownerSVGElement"in e}function ZEe(e){return Ese(e)&&e.tagName==="svg"}const eNe=[...vse,xi,SA],tNe=e=>eNe.find(yse(e)),mz=()=>({translate:0,scale:1,origin:0,originPoint:0}),zg=()=>({x:mz(),y:mz()}),gz=()=>({min:0,max:0}),Pi=()=>({x:gz(),y:gz()}),uF={current:null},Nse={current:!1},nNe=typeof window<"u";function rNe(){if(Nse.current=!0,!!nNe)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>uF.current=e.matches;e.addEventListener("change",t),t()}else uF.current=!1}const iNe=new WeakMap;function uj(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Tb(e){return typeof e=="string"||Array.isArray(e)}const LD=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],RD=["initial",...LD];function dj(e){return uj(e.animate)||RD.some(t=>Tb(e[t]))}function jse(e){return!!(dj(e)||e.variants)}function sNe(e,t,n){for(const r in t){const i=t[r],s=n[r];if(Hs(i))e.addValue(r,i);else if(Hs(s))e.addValue(r,t0(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,t0(a!==void 0?a:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const yz=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let t_={};function Tse(e){t_=e}function aNe(){return t_}class oNe{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=ND,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 f=ca.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,Cr.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=a;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},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=dj(n),this.isVariantNode=jse(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in h){const A=h[f];l[f]!==void 0&&Hs(A)&&A.set(l[f])}}mount(t){var n;this.current=t,iNe.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:(Nse.current||rNe(),this.shouldReduceMotion=uF.current),(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),CA(this.notifyUpdate),CA(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=ev.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Cr.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 t_){const n=t_[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):Pi()}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<yz.length;r++){const i=yz[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=sNe(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=t0(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"&&(Iie(r)||Fie(r))?r=parseFloat(r):!tNe(r)&&SA.test(n)&&(r=wse(t,n)),this.setBaseTarget(t,Hs(r)?r.get():r)),Hs(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=PD(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&&!Hs(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 yD),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){FD.render(this.render)}}class Pse extends oNe{constructor(){super(...arguments),this.KeyframeResolver=qEe}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;Hs(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class DA{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Ise({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function lNe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function cNe(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 OP(e){return e===void 0||e===1}function dF({scale:e,scaleX:t,scaleY:n}){return!OP(e)||!OP(t)||!OP(n)}function Ef(e){return dF(e)||Ose(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ose(e){return vz(e.x)||vz(e.y)}function vz(e){return e&&e!=="0%"}function n_(e,t,n){const r=e-n,i=t*r;return n+i}function xz(e,t,n,r,i){return i!==void 0&&(e=n_(e,i,r)),n_(e,n,r)+t}function hF(e,t=0,n=1,r,i){e.min=xz(e.min,t,n,r,i),e.max=xz(e.max,t,n,r,i)}function Fse(e,{x:t,y:n}){hF(e.x,t.translate,t.scale,t.originPoint),hF(e.y,n.translate,n.scale,n.originPoint)}const wz=.999999999999,bz=1.0000000000001;function uNe(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:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Kg(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),a&&(t.x*=a.x.scale,t.y*=a.y.scale,Fse(e,a)),r&&Ef(s.latestValues)&&Kg(e,s.latestValues))}t.x<bz&&t.x>wz&&(t.x=1),t.y<bz&&t.y>wz&&(t.y=1)}function Vg(e,t){e.min=e.min+t,e.max=e.max+t}function Cz(e,t,n,r,i=.5){const s=Mr(e.min,e.max,i);hF(e,t,n,s,r)}function Kg(e,t){Cz(e.x,t.x,t.scaleX,t.scale,t.originX),Cz(e.y,t.y,t.scaleY,t.scale,t.originY)}function Mse(e,t){return Ise(cNe(e.getBoundingClientRect(),t))}function dNe(e,t,n){const r=Mse(e,n),{scroll:i}=t;return i&&(Vg(r.x,i.offset.x),Vg(r.y,i.offset.y)),r}const hNe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ANe=Z0.length;function fNe(e,t,n){let r="",i=!0;for(let s=0;s<ANe;s++){const a=Z0[s],o=e[a];if(o===void 0)continue;let l=!0;if(typeof o=="number")l=o===(a.startsWith("scale")?1:0);else{const u=parseFloat(o);l=a.startsWith("scale")?u===1:u===0}if(!l||n){const u=Cse(o,OD[a]);if(!l){i=!1;const d=hNe[a]||a;r+=`${d}(${u}) `}n&&(t[a]=u)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function UD(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let a=!1,o=!1;for(const l in t){const u=t[l];if(ev.has(l)){a=!0;continue}else if(Gie(l)){i[l]=u;continue}else{const d=Cse(u,OD[l]);l.startsWith("origin")?(o=!0,s[l]=d):r[l]=d}}if(t.transform||(a||n?r.transform=fNe(t,e.transform,n):r.transform&&(r.transform="none")),o){const{originX:l="50%",originY:u="50%",originZ:d=0}=s;r.transformOrigin=`${l} ${u} ${d}`}}function Lse(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 Sz(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const lx={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(At.test(e))e=parseFloat(e);else return e;const n=Sz(e,t.target.x),r=Sz(e,t.target.y);return`${n}% ${r}%`}},pNe={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=SA.parse(e);if(i.length>5)return r;const s=SA.createTransformer(e),a=typeof i[0]!="number"?1:0,o=n.x.scale*t.x,l=n.y.scale*t.y;i[0+a]/=o,i[1+a]/=l;const u=Mr(o,l,.5);return typeof i[2+a]=="number"&&(i[2+a]/=u),typeof i[3+a]=="number"&&(i[3+a]/=u),s(i)}},AF={borderRadius:{...lx,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:lx,borderTopRightRadius:lx,borderBottomLeftRadius:lx,borderBottomRightRadius:lx,boxShadow:pNe};function Rse(e,{layout:t,layoutId:n}){return ev.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!AF[e]||e==="opacity")}function DD(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)(Hs(r[o])||i&&Hs(i[o])||Rse(o,e)||((a=n==null?void 0:n.getValue(o))==null?void 0:a.liveStyle)!==void 0)&&(s[o]=r[o]);return s}function mNe(e){return window.getComputedStyle(e)}class gNe extends Pse{constructor(){super(...arguments),this.type="html",this.renderInstance=Lse}readValueFromInstance(t,n){var r;if(ev.has(n))return(r=this.projection)!=null&&r.isProjecting?Z3(n):q_e(t,n);{const i=mNe(t),s=(Gie(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Mse(t,n)}build(t,n,r){UD(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return DD(t,n,r)}}const yNe={offset:"stroke-dashoffset",array:"stroke-dasharray"},vNe={offset:"strokeDashoffset",array:"strokeDasharray"};function xNe(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?yNe:vNe;e[s.offset]=`${-r}`,e[s.array]=`${t} ${n}`}const wNe=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Use(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:a=0,...o},l,u,d){if(UD(e,o,u),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:f}=e;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete h.transformBox);for(const A of wNe)h[A]!==void 0&&(f[A]=h[A],delete h[A]);t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),i!==void 0&&xNe(h,i,s,a,!1)}const Dse=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"]),Qse=e=>typeof e=="string"&&e.toLowerCase()==="svg";function bNe(e,t,n,r){Lse(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Dse.has(i)?i:ID(i),t.attrs[i])}function Hse(e,t,n){const r=DD(e,t,n);for(const i in e)if(Hs(e[i])||Hs(t[i])){const s=Z0.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}class CNe extends Pse{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Pi}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ev.has(n)){const r=xse(n);return r&&r.default||0}return n=Dse.has(n)?n:ID(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Hse(t,n,r)}build(t,n,r){Use(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){bNe(t,n,r,i)}mount(t){this.isSVGTag=Qse(t.tagName),super.mount(t)}}const SNe=RD.length;function $se(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?$se(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<SNe;n++){const r=RD[n],i=e.props[r];(Tb(i)||i===!1)&&(t[r]=i)}return t}function zse(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 kNe=[...LD].reverse(),BNe=LD.length;function _Ne(e){return t=>Promise.all(t.map(({animation:n,options:r})=>LEe(e,n,r)))}function ENe(e){let t=_Ne(e),n=kz(),r=!0;const i=l=>(u,d)=>{var f;const h=uy(e,d,l==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(h){const{transition:A,transitionEnd:p,...m}=h;u={...u,...m,...p}}return u};function s(l){t=l(e)}function a(l){const{props:u}=e,d=$se(e.parent)||{},h=[],f=new Set;let A={},p=1/0;for(let g=0;g<BNe;g++){const y=kNe[g],v=n[y],x=u[y]!==void 0?u[y]:d[y],b=Tb(x),w=y===l?v.isActive:null;w===!1&&(p=g);let S=x===d[y]&&x!==u[y]&&b;if(S&&r&&e.manuallyAnimateOnMount&&(S=!1),v.protectedKeys={...A},!v.isActive&&w===null||!x&&!v.prevProp||uj(x)||typeof x=="boolean")continue;const _=NNe(v.prevProp,x);let E=_||y===l&&v.isActive&&!S&&b||g>p&&b,j=!1;const I=Array.isArray(x)?x:[x];let T=I.reduce(i(y),{});w===!1&&(T={});const{prevResolvedValues:N={}}=v,F={...N,...T},L=W=>{E=!0,f.has(W)&&(j=!0,f.delete(W)),v.needsAnimating[W]=!0;const $=e.getValue(W);$&&($.liveStyle=!1)};for(const W in F){const $=T[W],V=N[W];if(A.hasOwnProperty(W))continue;let Q=!1;sF($)&&sF(V)?Q=!zse($,V):Q=$!==V,Q?$!=null?L(W):f.add(W):$!==void 0&&f.has(W)?L(W):v.protectedKeys[W]=!0}v.prevProp=x,v.prevResolvedValues=T,v.isActive&&(A={...A,...T}),r&&e.blockInitialAnimation&&(E=!1);const D=S&&_;E&&(!D||j)&&h.push(...I.map(W=>{const $={type:y};if(typeof W=="string"&&r&&!D&&e.manuallyAnimateOnMount&&e.parent){const{parent:V}=e,Q=uy(V,W);if(V.enteringChildren&&Q){const{delayChildren:ce}=Q.transition||{};$.delay=hse(V.enteringChildren,e,ce)}}return{animation:W,options:$}}))}if(f.size){const g={};if(typeof u.initial!="boolean"){const y=uy(e,Array.isArray(u.initial)?u.initial[0]:u.initial);y&&y.transition&&(g.transition=y.transition)}f.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(l,u){var h;if(n[l].isActive===u)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(f=>{var A;return(A=f.animationState)==null?void 0:A.setActive(l,u)}),n[l].isActive=u;const d=a(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:a,setActive:o,setAnimateFunction:s,getState:()=>n,reset:()=>{n=kz()}}}function NNe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!zse(t,e):!1}function yf(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function kz(){return{animate:yf(!0),whileInView:yf(),whileHover:yf(),whileTap:yf(),whileDrag:yf(),whileFocus:yf(),exit:yf()}}function Bz(e,t){e.min=t.min,e.max=t.max}function Il(e,t){Bz(e.x,t.x),Bz(e.y,t.y)}function _z(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Vse=1e-4,jNe=1-Vse,TNe=1+Vse,Kse=.01,PNe=0-Kse,INe=0+Kse;function ua(e){return e.max-e.min}function ONe(e,t,n){return Math.abs(e-t)<=n}function Ez(e,t,n,r=.5){e.origin=r,e.originPoint=Mr(t.min,t.max,e.origin),e.scale=ua(n)/ua(t),e.translate=Mr(n.min,n.max,e.origin)-e.originPoint,(e.scale>=jNe&&e.scale<=TNe||isNaN(e.scale))&&(e.scale=1),(e.translate>=PNe&&e.translate<=INe||isNaN(e.translate))&&(e.translate=0)}function ww(e,t,n,r){Ez(e.x,t.x,n.x,r?r.originX:void 0),Ez(e.y,t.y,n.y,r?r.originY:void 0)}function Nz(e,t,n){e.min=n.min+t.min,e.max=e.min+ua(t)}function FNe(e,t,n){Nz(e.x,t.x,n.x),Nz(e.y,t.y,n.y)}function jz(e,t,n){e.min=t.min-n.min,e.max=e.min+ua(t)}function r_(e,t,n){jz(e.x,t.x,n.x),jz(e.y,t.y,n.y)}function Tz(e,t,n,r,i){return e-=t,e=n_(e,1/n,r),i!==void 0&&(e=n_(e,1/i,r)),e}function MNe(e,t=0,n=1,r=.5,i,s=e,a=e){if(tu.test(t)&&(t=parseFloat(t),t=Mr(a.min,a.max,t/100)-a.min),typeof t!="number")return;let o=Mr(s.min,s.max,r);e===s&&(o-=t),e.min=Tz(e.min,t,n,o,i),e.max=Tz(e.max,t,n,o,i)}function Pz(e,t,[n,r,i],s,a){MNe(e,t[n],t[r],t[i],t.scale,s,a)}const LNe=["x","scaleX","originX"],RNe=["y","scaleY","originY"];function Iz(e,t,n,r){Pz(e.x,t,LNe,n?n.x:void 0,r?r.x:void 0),Pz(e.y,t,RNe,n?n.y:void 0,r?r.y:void 0)}function Oz(e){return e.translate===0&&e.scale===1}function qse(e){return Oz(e.x)&&Oz(e.y)}function Fz(e,t){return e.min===t.min&&e.max===t.max}function UNe(e,t){return Fz(e.x,t.x)&&Fz(e.y,t.y)}function Mz(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Wse(e,t){return Mz(e.x,t.x)&&Mz(e.y,t.y)}function Lz(e){return ua(e.x)/ua(e.y)}function Rz(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Ho(e){return[e("x"),e("y")]}function DNe(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:f,skewX:A,skewY:p}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),h&&(r+=`rotateX(${h}deg) `),f&&(r+=`rotateY(${f}deg) `),A&&(r+=`skewX(${A}deg) `),p&&(r+=`skewY(${p}deg) `)}const o=e.x.scale*t.x,l=e.y.scale*t.y;return(o!==1||l!==1)&&(r+=`scale(${o}, ${l})`),r||"none"}const Gse=["TopLeft","TopRight","BottomLeft","BottomRight"],QNe=Gse.length,Uz=e=>typeof e=="string"?parseFloat(e):e,Dz=e=>typeof e=="number"||At.test(e);function HNe(e,t,n,r,i,s){i?(e.opacity=Mr(0,n.opacity??1,$Ne(r)),e.opacityExit=Mr(t.opacity??1,0,zNe(r))):s&&(e.opacity=Mr(t.opacity??1,n.opacity??1,r));for(let a=0;a<QNe;a++){const o=`border${Gse[a]}Radius`;let l=Qz(t,o),u=Qz(n,o);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Dz(l)===Dz(u)?(e[o]=Math.max(Mr(Uz(l),Uz(u),r),0),(tu.test(u)||tu.test(l))&&(e[o]+="%")):e[o]=u}(t.rotate||n.rotate)&&(e.rotate=Mr(t.rotate||0,n.rotate||0,r))}function Qz(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const $Ne=Yse(0,.5,$ie),zNe=Yse(.5,.95,ul);function Yse(e,t,n){return r=>r<e?0:r>t?1:n(Eb(e,t,r))}function VNe(e,t,n){const r=Hs(e)?e:t0(e);return r.start(TD("",r,t,n)),r.animation}function Pb(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const KNe=(e,t)=>e.depth-t.depth;class qNe{constructor(){this.children=[],this.isDirty=!1}add(t){pD(this.children,t),this.isDirty=!0}remove(t){mD(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(KNe),this.isDirty=!1,this.children.forEach(t)}}function WNe(e,t){const n=ca.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(CA(r),e(s-t))};return Cr.setup(r,!0),()=>CA(r)}function zk(e){return Hs(e)?e.get():e}class GNe{constructor(){this.members=[]}add(t){pD(this.members,t),t.scheduleRender()}remove(t){if(mD(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 Vk={hasAnimatedSinceResize:!0,hasEverUpdated:!1},FP=["","X","Y","Z"],YNe=1e3;let XNe=0;function MP(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Xse(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=mse(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Cr,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Xse(r)}function Jse({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a={},o=t==null?void 0:t()){this.id=XNe++,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(eje),this.nodes.forEach(ije),this.nodes.forEach(sje),this.nodes.forEach(tje)},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 l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new qNe)}addEventListener(a,o){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new yD),this.eventHandlers.get(a).add(o)}notifyListeners(a,...o){const l=this.eventHandlers.get(a);l&&l.notify(...o)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=Ese(a)&&!ZEe(a),this.instance=a;const{layoutId:o,layout:l,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&&(l||o)&&(this.isLayoutDirty=!0),e){let d,h=0;const f=()=>this.root.updateBlockedByResize=!1;Cr.read(()=>{h=window.innerWidth}),e(a,()=>{const A=window.innerWidth;A!==h&&(h=A,this.root.updateBlockedByResize=!0,d&&d(),d=WNe(f,250),Vk.hasAnimatedSinceResize&&(Vk.hasAnimatedSinceResize=!1,this.nodes.forEach(zz)))})}o&&this.root.registerSharedNode(o,this),this.options.animate!==!1&&u&&(o||l)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:A})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||uje,{onLayoutAnimationStart:m,onLayoutAnimationComplete:g}=u.getProps(),y=!this.targetLayout||!Wse(this.targetLayout,A),v=!h&&f;if(this.options.layoutRoot||this.resumeFrom||v||h&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...jD(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||zz(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=A})}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(),CA(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(aje),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&&Xse(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:l}=this.options;if(o===void 0&&!l)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(Hz);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach($z);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(rje),this.nodes.forEach(JNe),this.nodes.forEach(ZNe)):this.nodes.forEach($z),this.clearAllSnapshots();const o=ca.now();fs.delta=ou(0,1e3/60,o-fs.timestamp),fs.timestamp=o,fs.isProcessing=!0,_P.update.process(fs),_P.preRender.process(fs),_P.render.process(fs),fs.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,FD.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(nje),this.sharedNodes.forEach(oje)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Cr.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Cr.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ua(this.snapshot.measuredBox.x)&&!ua(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Pi(),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 l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!qse(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;a&&this.instance&&(o||Ef(this.latestValues)||d)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const o=this.measurePageBox();let l=this.removeElementScroll(o);return a&&(l=this.removeTransform(l)),dje(l),{animationId:this.root.animationId,measuredBox:o,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:a}=this.options;if(!a)return Pi();const o=a.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(hje))){const{scroll:d}=this.root;d&&(Vg(o.x,d.offset.x),Vg(o.y,d.offset.y))}return o}removeElementScroll(a){var l;const o=Pi();if(Il(o,a),(l=this.scroll)!=null&&l.wasRoot)return o;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:h,options:f}=d;d!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&Il(o,a),Vg(o.x,h.offset.x),Vg(o.y,h.offset.y))}return o}applyTransform(a,o=!1){const l=Pi();Il(l,a);for(let u=0;u<this.path.length;u++){const d=this.path[u];!o&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Kg(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Ef(d.latestValues)&&Kg(l,d.latestValues)}return Ef(this.latestValues)&&Kg(l,this.latestValues),l}removeTransform(a){const o=Pi();Il(o,a);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Ef(u.latestValues))continue;dF(u.latestValues)&&u.updateSnapshot();const d=Pi(),h=u.measurePageBox();Il(d,h),Iz(o,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Ef(this.latestValues)&&Iz(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!==fs.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var A;const o=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=o.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=o.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=o.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==o;if(!(a||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(A=this.parent)!=null&&A.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:h}=this.options;if(!this.layout||!(d||h))return;this.resolvedRelativeTargetAt=fs.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Pi(),this.targetWithTransforms=Pi()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),FNe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Il(this.target,this.layout.layoutBox),Fse(this.target,this.targetDelta)):Il(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||dF(this.parent.latestValues)||Ose(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,l){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Pi(),this.relativeTargetOrigin=Pi(),r_(this.relativeTargetOrigin,o,l),Il(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var p;const a=this.getLead(),o=!!this.resumingFrom||this!==a;let l=!0;if((this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty)&&(l=!1),o&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===fs.timestamp&&(l=!1),l)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;Il(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;uNe(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=Pi());const{target:A}=a;if(!A){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(_z(this.prevProjectionDelta.x,this.projectionDelta.x),_z(this.prevProjectionDelta.y,this.projectionDelta.y)),ww(this.projectionDelta,this.layoutCorrected,A,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!Rz(this.projectionDelta.x,this.prevProjectionDelta.x)||!Rz(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",A))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var o;if((o=this.options.visualElement)==null||o.scheduleRender(),a){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=zg(),this.projectionDelta=zg(),this.projectionDeltaWithTransform=zg()}setAnimationOrigin(a,o=!1){const l=this.snapshot,u=l?l.latestValues:{},d={...this.latestValues},h=zg();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const f=Pi(),A=l?l.source:void 0,p=this.layout?this.layout.source:void 0,m=A!==p,g=this.getStack(),y=!g||g.members.length<=1,v=!!(m&&!y&&this.options.crossfade===!0&&!this.path.some(cje));this.animationProgress=0;let x;this.mixTargetDelta=b=>{const w=b/1e3;Vz(h.x,a.x,w),Vz(h.y,a.y,w),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(r_(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),lje(this.relativeTarget,this.relativeTargetOrigin,f,w),x&&UNe(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Pi()),Il(x,this.relativeTarget)),m&&(this.animationValues=d,HNe(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,l,u;this.notifyListeners("animationStart"),(o=this.currentAnimation)==null||o.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(CA(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Cr.update(()=>{Vk.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=t0(0)),this.currentAnimation=VNe(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(YNe),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:o,target:l,layout:u,latestValues:d}=a;if(!(!o||!l||!u)){if(this!==a&&this.layout&&u&&Zse(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Pi();const h=ua(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+h;const f=ua(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+f}Il(o,l),Kg(o,d),ww(this.projectionDeltaWithTransform,this.layoutCorrected,o,d)}}registerSharedNode(a,o){this.sharedNodes.has(a)||this.sharedNodes.set(a,new GNe),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:l}={}){const u=this.getStack();u&&u.promote(this,l),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:l}=a;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(o=!0),!o)return;const u={};l.z&&MP("z",a,u,this.animationValues);for(let d=0;d<FP.length;d++)MP(`rotate${FP[d]}`,a,u,this.animationValues),MP(`skew${FP[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 l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=zk(o==null?void 0:o.pointerEvents)||"",a.transform=l?l(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=zk(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Ef(this.latestValues)&&(a.transform=l?l({},""):"none",this.hasProjected=!1);return}a.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=DNe(this.projectionDeltaWithTransform,this.treeScale,d);l&&(h=l(d,h)),a.transform=h;const{x:f,y:A}=this.projectionDelta;a.transformOrigin=`${f.origin*100}% ${A.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 AF){if(d[p]===void 0)continue;const{correct:m,applyTo:g,isCSSVariable:y}=AF[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?zk(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(Hz),this.root.sharedNodes.clear()}}}function JNe(e){e.updateLayout()}function ZNe(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"?Ho(h=>{const f=a?t.measuredBox[h]:t.layoutBox[h],A=ua(f);f.min=r[h].min,f.max=f.min+A}):Zse(s,t.layoutBox,r)&&Ho(h=>{const f=a?t.measuredBox[h]:t.layoutBox[h],A=ua(r[h]);f.max=f.min+A,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+A)});const o=zg();ww(o,r,t.layoutBox);const l=zg();a?ww(l,e.applyTransform(i,!0),t.measuredBox):ww(l,r,t.layoutBox);const u=!qse(o);let d=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:A}=h;if(f&&A){const p=Pi();r_(p,t.layoutBox,f.layoutBox);const m=Pi();r_(m,r,A.layoutBox),Wse(p,m)||(d=!0),h.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=p,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:o,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function eje(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 tje(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function nje(e){e.clearSnapshot()}function Hz(e){e.clearMeasurements()}function $z(e){e.isLayoutDirty=!1}function rje(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function zz(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ije(e){e.resolveTargetDelta()}function sje(e){e.calcProjection()}function aje(e){e.resetSkewAndRotation()}function oje(e){e.removeLeadSnapshot()}function Vz(e,t,n){e.translate=Mr(t.translate,0,n),e.scale=Mr(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Kz(e,t,n,r){e.min=Mr(t.min,n.min,r),e.max=Mr(t.max,n.max,r)}function lje(e,t,n,r){Kz(e.x,t.x,n.x,r),Kz(e.y,t.y,n.y,r)}function cje(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const uje={duration:.45,ease:[.4,0,.1,1]},qz=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Wz=qz("applewebkit/")&&!qz("chrome/")?Math.round:ul;function Gz(e){e.min=Wz(e.min),e.max=Wz(e.max)}function dje(e){Gz(e.x),Gz(e.y)}function Zse(e,t,n){return e==="position"||e==="preserve-aspect"&&!ONe(Lz(t),Lz(n),.2)}function hje(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Aje=Jse({attachResizeListener:(e,t)=>Pb(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}),LP={current:void 0},eae=Jse({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!LP.current){const e=new Aje({});e.mount(window),e.setOptions({layoutScroll:!0}),LP.current=e}return LP.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),QD=k.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Yz(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fje(...e){return t=>{let n=!1;const r=e.map(i=>{const s=Yz(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():Yz(e[i],null)}}}}function pje(...e){return k.useCallback(fje(...e),e)}class mje extends k.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,i=cF(r)&&r.offsetWidth||0,s=cF(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 gje({children:e,isPresent:t,anchorX:n,anchorY:r,root:i}){var h;const s=k.useId(),a=k.useRef(null),o=k.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:l}=k.useContext(QD),u=((h=e.props)==null?void 0:h.ref)??(e==null?void 0:e.ref),d=pje(a,u);return k.useInsertionEffect(()=>{const{width:f,height:A,top:p,left:m,right:g,bottom:y}=o.current;if(t||!a.current||!f||!A)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");l&&(b.nonce=l);const w=i??document.head;return w.appendChild(b),b.sheet&&b.sheet.insertRule(`
          [data-motion-pop-id="${s}"] {
            position: absolute !important;
            width: ${f}px !important;
            height: ${A}px !important;
            ${v}px !important;
            ${x}px !important;
          }
        `),()=>{w.contains(b)&&w.removeChild(b)}},[t]),c.jsx(mje,{isPresent:t,childRef:a,sizeRef:o,children:k.cloneElement(e,{ref:d})})}const yje=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a,anchorX:o,anchorY:l,root:u})=>{const d=fD(vje),h=k.useId();let f=!0,A=k.useMemo(()=>(f=!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&&f&&(A={...A}),k.useMemo(()=>{d.forEach((p,m)=>d.set(m,!1))},[n]),k.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),a==="popLayout"&&(e=c.jsx(gje,{isPresent:n,anchorX:o,anchorY:l,root:u,children:e})),c.jsx(lj.Provider,{value:A,children:e})};function vje(){return new Map}function tae(e=!0){const t=k.useContext(lj);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=k.useId();k.useEffect(()=>{if(e)return i(s)},[e]);const a=k.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,a]:[!0]}const XC=e=>e.key||"";function Xz(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const dy=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:a=!1,anchorX:o="left",anchorY:l="top",root:u})=>{const[d,h]=tae(a),f=k.useMemo(()=>Xz(e),[e]),A=a&&!d?[]:f.map(XC),p=k.useRef(!0),m=k.useRef(f),g=fD(()=>new Map),y=k.useRef(new Set),[v,x]=k.useState(f),[b,w]=k.useState(f);Pie(()=>{p.current=!1,m.current=f;for(let E=0;E<b.length;E++){const j=XC(b[E]);A.includes(j)?(g.delete(j),y.current.delete(j)):g.get(j)!==!0&&g.set(j,!1)}},[b,A.length,A.join("-")]);const S=[];if(f!==v){let E=[...f];for(let j=0;j<b.length;j++){const I=b[j],T=XC(I);A.includes(T)||(E.splice(j,0,I),S.push(I))}return s==="wait"&&S.length&&(E=S),w(Xz(E)),x(f),null}const{forceRender:_}=k.useContext(AD);return c.jsx(c.Fragment,{children:b.map(E=>{const j=XC(E),I=a&&!d?!1:f===b||A.includes(j),T=()=>{if(y.current.has(j))return;if(y.current.add(j),g.has(j))g.set(j,!0);else return;let N=!0;g.forEach(F=>{F||(N=!1)}),N&&(_==null||_(),w(m.current),a&&(h==null||h()),r&&r())};return c.jsx(yje,{isPresent:I,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,root:u,onExitComplete:I?void 0:T,anchorX:o,anchorY:l,children:E},j)})})},nae=k.createContext({strict:!1}),Jz={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 Zz=!1;function xje(){if(Zz)return;const e={};for(const t in Jz)e[t]={isEnabled:n=>Jz[t].some(r=>!!n[r])};Tse(e),Zz=!0}function rae(){return xje(),aNe()}function wje(e){const t=rae();for(const n in e)t[n]={...t[n],...e[n]};Tse(t)}const bje=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 i_(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||bje.has(e)}let iae=e=>!i_(e);function Cje(e){typeof e=="function"&&(iae=t=>t.startsWith("on")?!i_(t):e(t))}try{Cje(require("@emotion/is-prop-valid").default)}catch{}function Sje(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(iae(i)||n===!0&&i_(i)||!t&&!i_(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const hj=k.createContext({});function kje(e,t){if(dj(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Tb(n)?n:void 0,animate:Tb(r)?r:void 0}}return e.inherit!==!1?t:{}}function Bje(e){const{initial:t,animate:n}=kje(e,k.useContext(hj));return k.useMemo(()=>({initial:t,animate:n}),[e9(t),e9(n)])}function e9(e){return Array.isArray(e)?e.join(" "):e}const HD=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function sae(e,t,n){for(const r in t)!Hs(t[r])&&!Rse(r,n)&&(e[r]=t[r])}function _je({transformTemplate:e},t){return k.useMemo(()=>{const n=HD();return UD(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Eje(e,t){const n=e.style||{},r={};return sae(r,n,e),Object.assign(r,_je(e,t)),r}function Nje(e,t){const n={},r=Eje(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 aae=()=>({...HD(),attrs:{}});function jje(e,t,n,r){const i=k.useMemo(()=>{const s=aae();return Use(s,t,Qse(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 Tje=["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 $D(e){return typeof e!="string"||e.includes("-")?!1:!!(Tje.indexOf(e)>-1||/[A-Z]/u.test(e))}function Pje(e,t,n,{latestValues:r},i,s=!1,a){const l=(a??$D(e)?jje:Nje)(t,r,i,e),u=Sje(t,typeof e=="string",s),d=e!==k.Fragment?{...u,...l,ref:n}:{},{children:h}=t,f=k.useMemo(()=>Hs(h)?h.get():h,[h]);return k.createElement(e,{...d,children:f})}function Ije({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Oje(n,r,i,e),renderState:t()}}function Oje(e,t,n,r){const i={},s=r(e,{});for(const f in s)i[f]=zk(s[f]);let{initial:a,animate:o}=e;const l=dj(e),u=jse(e);t&&u&&!l&&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"&&!uj(h)){const f=Array.isArray(h)?h:[h];for(let A=0;A<f.length;A++){const p=PD(e,f[A]);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 oae=e=>(t,n)=>{const r=k.useContext(hj),i=k.useContext(lj),s=()=>Ije(e,t,r,i);return n?s():fD(s)},Fje=oae({scrapeMotionValuesFromProps:DD,createRenderState:HD}),Mje=oae({scrapeMotionValuesFromProps:Hse,createRenderState:aae}),Lje=Symbol.for("motionComponentSymbol");function Rje(e,t,n){const r=k.useRef(n);k.useInsertionEffect(()=>{r.current=n});const i=k.useRef(null);return k.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 l=a(s);typeof l=="function"&&(i.current=l)}else i.current?(i.current(),i.current=null):a(s);else a&&(a.current=s)},[t])}const lae=k.createContext({});function $x(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Uje(e,t,n,r,i,s){var y,v;const{visualElement:a}=k.useContext(hj),o=k.useContext(nae),l=k.useContext(lj),u=k.useContext(QD).reducedMotion,d=k.useRef(null),h=k.useRef(!1);r=r||o.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:a,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,isSVG:s}),h.current&&d.current&&(d.current.manuallyAnimateOnMount=!0));const f=d.current,A=k.useContext(lae);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&Dje(d.current,n,i,A);const p=k.useRef(!1);k.useInsertionEffect(()=>{f&&p.current&&f.update(n,l)});const m=n[pse],g=k.useRef(!!m&&!((y=window.MotionHandoffIsComplete)!=null&&y.call(window,m))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,m)));return Pie(()=>{h.current=!0,f&&(p.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),g.current&&f.animationState&&f.animationState.animateChanges())}),k.useEffect(()=>{f&&(!g.current&&f.animationState&&f.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)==null||x.call(window,m)}),g.current=!1),f.enteringChildren=void 0)}),f}function Dje(e,t,n,r){const{layoutId:i,layout:s,drag:a,dragConstraints:o,layoutScroll:l,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:cae(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!a||o&&$x(o),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:u})}function cae(e){if(e)return e.options.allowProjection!==!1?e.projection:cae(e.parent)}function RP(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&wje(r);const s=n?n==="svg":$D(e),a=s?Mje:Fje;function o(u,d){let h;const f={...k.useContext(QD),...u,layoutId:Qje(u)},{isStatic:A}=f,p=Bje(u),m=a(u,A);if(!A&&Tie){Hje();const g=$je(f);h=g.MeasureLayout,p.visualElement=Uje(e,m,f,i,g.ProjectionNode,s)}return c.jsxs(hj.Provider,{value:p,children:[h&&p.visualElement?c.jsx(h,{visualElement:p.visualElement,...f}):null,Pje(e,u,Rje(m,p.visualElement,d),m,A,t,s)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=k.forwardRef(o);return l[Lje]=e,l}function Qje({layoutId:e}){const t=k.useContext(AD).id;return t&&e!==void 0?t+"-"+e:e}function Hje(e,t){k.useContext(nae).strict}function $je(e){const t=rae(),{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 zje(e,t){if(typeof Proxy>"u")return RP;const n=new Map,r=(s,a)=>RP(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,RP(a,void 0,e,t)),n.get(a))})}const Vje=(e,t)=>t.isSVG??$D(e)?new CNe(t):new gNe(t,{allowProjection:e!==k.Fragment});class Kje extends DA{constructor(t){super(t),t.animationState||(t.animationState=ENe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();uj(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 qje=0;class Wje extends DA{constructor(){super(...arguments),this.id=qje++}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 Gje={animation:{Feature:Kje},exit:{Feature:Wje}};function p2(e){return{point:{x:e.pageX,y:e.pageY}}}const Yje=e=>t=>MD(t)&&e(t,p2(t));function bw(e,t,n,r){return Pb(e,t,Yje(n),r)}const uae=({current:e})=>e?e.ownerDocument.defaultView:null,t9=(e,t)=>Math.abs(e-t);function Xje(e,t){const n=t9(e.x,t.x),r=t9(e.y,t.y);return Math.sqrt(n**2+r**2)}const n9=new Set(["auto","scroll"]);class dae{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=A=>{this.handleScroll(A.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const A=DP(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=Xje(A.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;const{point:g}=A,{timestamp:y}=fs;this.history.push({...g,timestamp:y});const{onStart:v,onMove:x}=this.handlers;p||(v&&v(this.lastMoveEvent,A),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,A)},this.handlePointerMove=(A,p)=>{this.lastMoveEvent=A,this.lastMoveEventInfo=UP(p,this.transformPagePoint),Cr.update(this.updatePoint,!0)},this.handlePointerUp=(A,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=DP(A.type==="pointercancel"?this.lastMoveEventInfo:UP(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(A,v),g&&g(A,v)},!MD(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=i||window;const l=p2(t),u=UP(l,this.transformPagePoint),{point:d}=u,{timestamp:h}=fs;this.history=[{...d,timestamp:h}];const{onSessionStart:f}=n;f&&f(t,DP(u,this.history)),this.removeListeners=h2(bw(this.contextWindow,"pointermove",this.handlePointerMove),bw(this.contextWindow,"pointerup",this.handlePointerUp),bw(this.contextWindow,"pointercancel",this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(n9.has(r.overflowX)||n9.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),Cr.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),CA(this.updatePoint)}}function UP(e,t){return t?{point:t(e.point)}:e}function r9(e,t){return{x:e.x-t.x,y:e.y-t.y}}function DP({point:e},t){return{point:e,delta:r9(e,hae(t)),offset:r9(e,Jje(t)),velocity:Zje(t,.1)}}function Jje(e){return e[0]}function hae(e){return e[e.length-1]}function Zje(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=hae(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>eu(t)));)n--;if(!r)return{x:0,y:0};const s=rl(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 e5e(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Mr(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Mr(n,e,r.max):Math.min(e,n)),e}function i9(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 t5e(e,{top:t,left:n,bottom:r,right:i}){return{x:i9(e.x,n,i),y:i9(e.y,t,r)}}function s9(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 n5e(e,t){return{x:s9(e.x,t.x),y:s9(e.y,t.y)}}function r5e(e,t){let n=.5;const r=ua(e),i=ua(t);return i>r?n=Eb(t.min,t.max-r,e.min):r>i&&(n=Eb(e.min,e.max-i,t.min)),ou(0,1,n)}function i5e(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 fF=.35;function s5e(e=fF){return e===!1?e=0:e===!0&&(e=fF),{x:a9(e,"left","right"),y:a9(e,"top","bottom")}}function a9(e,t,n){return{min:o9(e,t),max:o9(e,n)}}function o9(e,t){return typeof e=="number"?e:e[t]||0}const a5e=new WeakMap;class o5e{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=Pi(),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(p2(h).point)):this.pauseAnimation()},a=(h,f)=>{this.stopAnimation();const{drag:A,dragPropagation:p,onDragStart:m}=this.getProps();if(A&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=WEe(A),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ho(y=>{let v=this.getAxisMotionValue(y).get()||0;if(tu.test(v)){const{projection:x}=this.visualElement;if(x&&x.layout){const b=x.layout.layoutBox[y];b&&(v=ua(b)*(parseFloat(v)/100))}}this.originPoint[y]=v}),m&&Cr.postRender(()=>m(h,f)),aF(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},o=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:A,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!A&&!this.openDragLock)return;const{offset:y}=f;if(p&&this.currentDirection===null){this.currentDirection=l5e(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),g&&g(h,f)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>Ho(h=>{var f;return this.getAnimationState(h)==="paused"&&((f=this.getAxisMotionValue(h).animation)==null?void 0:f.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new dae(t,{onSessionStart:s,onStart:a,onMove:o,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:uae(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&&Cr.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||!JC(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=e5e(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&&$x(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=t5e(r.layoutBox,t):this.constraints=!1,this.elastic=s5e(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ho(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=i5e(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!$x(t))return!1;const r=t.current;e0(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=dNe(r,i.root,this.visualElement.getTransformPagePoint());let a=n5e(i.layout.layoutBox,s);if(n){const o=n(lNe(a));this.hasMutatedConstraints=!!o,o&&(a=Ise(o))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),l=this.constraints||{},u=Ho(d=>{if(!JC(d,n,this.currentDirection))return;let h=l&&l[d]||{};a&&(h={min:0,max:0});const f=i?200:1e6,A=i?40:1e7,p={type:"inertia",velocity:r?t[d]:0,bounceStiffness:f,bounceDamping:A,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 aF(this.visualElement,t),r.start(TD(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ho(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ho(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){Ho(n=>{const{drag:r}=this.getProps();if(!JC(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],l=s.get()||0;s.set(t[n]-Mr(a,o,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!$x(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ho(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const l=o.get();i[a]=r5e({min:l,max:l},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(),Ho(a=>{if(!JC(a,t,null))return;const o=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];o.set(Mr(l,u,i[a]))})}addListeners(){if(!this.visualElement.current)return;a5e.set(this.visualElement,this);const t=this.visualElement.current,n=bw(t,"pointerdown",l=>{const{drag:u,dragListener:d=!0}=this.getProps(),h=l.target,f=h!==t&&_se(h);u&&d&&!f&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();$x(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Cr.read(r);const a=Pb(window,"resize",()=>this.scalePositionWithinConstraints()),o=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ho(d=>{const h=this.getAxisMotionValue(d);h&&(this.originPoint[d]+=l[d].translate,h.set(h.get()+l[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=fF,dragMomentum:o=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:a,dragMomentum:o}}}function JC(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function l5e(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class c5e extends DA{constructor(t){super(t),this.removeGroupControls=ul,this.removeListeners=ul,this.controls=new o5e(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ul}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 l9=e=>(t,n)=>{e&&Cr.postRender(()=>e(t,n))};class u5e extends DA{constructor(){super(...arguments),this.removePointerDownListener=ul}onPointerDown(t){this.session=new dae(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:uae(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:l9(t),onStart:l9(n),onMove:r,onEnd:(s,a)=>{delete this.session,i&&Cr.postRender(()=>i(s,a))}}}mount(){this.removePointerDownListener=bw(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 QP=!1;class d5e extends k.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),QP&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Vk.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}),QP=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?a.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?a.promote():a.relegate()||Cr.postRender(()=>{const o=a.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),FD.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;QP=!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 Aae(e){const[t,n]=tae(),r=k.useContext(AD);return c.jsx(d5e,{...e,layoutGroup:r,switchLayoutGroup:k.useContext(lae),isPresent:t,safeToRemove:n})}const h5e={pan:{Feature:u5e},drag:{Feature:c5e,ProjectionNode:eae,MeasureLayout:Aae}};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&&Cr.postRender(()=>s(t,p2(t)))}class A5e extends DA{mount(){const{current:t}=this.node;t&&(this.unmount=GEe(t,(n,r)=>(c9(this.node,r,"Start"),i=>c9(this.node,i,"End"))))}unmount(){}}class f5e extends DA{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=h2(Pb(this.node.current,"focus",()=>this.onFocus()),Pb(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function u9(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&&Cr.postRender(()=>s(t,p2(t)))}class p5e extends DA{mount(){const{current:t}=this.node;t&&(this.unmount=JEe(t,(n,r)=>(u9(this.node,r,"Start"),(i,{success:s})=>u9(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const pF=new WeakMap,HP=new WeakMap,m5e=e=>{const t=pF.get(e.target);t&&t(e)},g5e=e=>{e.forEach(m5e)};function y5e({root:e,...t}){const n=e||document;HP.has(n)||HP.set(n,{});const r=HP.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(g5e,{root:e,...t})),r[i]}function v5e(e,t,n){const r=y5e(t);return pF.set(e,n),r.observe(e),()=>{pF.delete(e),r.unobserve(e)}}const x5e={some:0,all:1};class w5e extends DA{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:x5e[i]},o=l=>{const{isIntersecting:u}=l;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(),f=u?d:h;f&&f(l)};return v5e(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(b5e(t,n))&&this.startObserver()}unmount(){}}function b5e({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const C5e={inView:{Feature:w5e},tap:{Feature:p5e},focus:{Feature:f5e},hover:{Feature:A5e}},S5e={layout:{ProjectionNode:eae,MeasureLayout:Aae}},k5e={...Gje,...C5e,...h5e,...S5e},ii=zje(k5e,Vje),B5e={some:0,all:1};function _5e(e,t,{root:n,margin:r,amount:i="some"}={}){const s=bse(e),a=new WeakMap,o=u=>{u.forEach(d=>{const h=a.get(d.target);if(d.isIntersecting!==!!h)if(d.isIntersecting){const f=t(d.target,d);typeof f=="function"?a.set(d.target,f):l.unobserve(d.target)}else typeof h=="function"&&(h(d),a.delete(d.target))})},l=new IntersectionObserver(o,{root:n,rootMargin:r,threshold:typeof i=="number"?i:B5e[i]});return s.forEach(u=>l.observe(u)),()=>l.disconnect()}function E5e(e,{root:t,margin:n,amount:r,once:i=!1,initial:s=!1}={}){const[a,o]=k.useState(s);return k.useEffect(()=>{if(!e.current||i&&a)return;const l=()=>(o(!0),i?void 0:()=>o(!1)),u={root:t&&t.current||void 0,margin:n,amount:r};return _5e(e.current,l,u)},[t,e,n,i,r]),a}var $c=function(){return $c=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},$c.apply(this,arguments)};function tv(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 N5e(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 l(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?s(d.value):i(d.value).then(o,l)}u((r=r.apply(e,t||[])).next())})}function j5e(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 T5e=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class zD extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}}class P5e extends zD{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class d9 extends zD{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class h9 extends zD{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var mF;(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"})(mF||(mF={}));class I5e{constructor(t,{headers:n={},customFetch:r,region:i=mF.Any}={}){this.url=t,this.headers=n,this.region=i,this.fetch=T5e(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return N5e(this,arguments,void 0,function*(n,r={}){var i;let s,a;try{const{headers:o,method:l,body:u,signal:d,timeout:h}=r;let f={},{region:A}=r;A||(A=this.region);const p=new URL(`${this.url}/${n}`);A&&A!=="any"&&(f["x-region"]=A,p.searchParams.set("forceFunctionRegion",A));let m;u&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(f["Content-Type"]="application/octet-stream",m=u):typeof u=="string"?(f["Content-Type"]="text/plain",m=u):typeof FormData<"u"&&u instanceof FormData?m=u:(f["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:l||"POST",headers:Object.assign(Object.assign(Object.assign({},f),this.headers),o),body:m,signal:g}).catch(w=>{throw new P5e(w)}),v=y.headers.get("x-relay-error");if(v&&v==="true")throw new d9(y);if(!y.ok)throw new h9(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 h9||o instanceof d9?o.context:void 0}}finally{s&&clearTimeout(s)}})}}var O5e=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}},F5e=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,l=null,u=s.status,d=s.statusText;if(s.ok){var h,f;if(n.method!=="HEAD"){var A;const y=await s.text();y===""||(n.headers.get("Accept")==="text/csv"||n.headers.get("Accept")&&(!((A=n.headers.get("Accept"))===null||A===void 0)&&A.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=(f=s.headers.get("content-range"))===null||f===void 0?void 0:f.split("/");m&&g&&g.length>1&&(l=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,l=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 O5e(a)}return{error:a,data:o,count:l,status:u,statusText:d}});return this.shouldThrowOnError||(i=i.catch(s=>{var a;let o="";const l=s==null?void 0:s.cause;if(l){var u,d,h,f;const p=(u=l==null?void 0:l.message)!==null&&u!==void 0?u:"",m=(d=l==null?void 0:l.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: ${(f=l==null?void 0:l.name)!==null&&f!==void 0?f:"Error"}: ${p}`,m&&(o+=` (${m})`),l!=null&&l.stack&&(o+=`
${l.stack}`)}else{var A;o=(A=s==null?void 0:s.stack)!==null&&A!==void 0?A:""}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}},M5e=class extends F5e{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("|"),l=(a=this.headers.get("Accept"))!==null&&a!==void 0?a:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${s}; for="${l}"; 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 A9=new RegExp("[,()]");var xg=class extends M5e{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"&&A9.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"&&A9.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}},L5e=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:l}=this.cloneRequestState();return o.searchParams.set("select",a),r&&l.append("Prefer",`count=${r}`),new xg({method:i,url:o,headers:l,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((l,u)=>l.concat(Object.keys(u)),[]);if(o.length>0){const l=[...new Set(o)].map(u=>`"${u}"`);s.searchParams.set("columns",l.join(","))}}return new xg({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:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),t!==void 0&&o.searchParams.set("on_conflict",t),r&&l.append("Prefer",`count=${r}`),i||l.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 xg({method:a,url:o,headers:l,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 xg({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 xg({method:n,url:r,headers:i,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch})}},R5e=class fae{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 L5e(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new fae(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 l=new URL(`${this.url}/rpc/${t}`);let u;const d=A=>A!==null&&typeof A=="object"&&(!Array.isArray(A)||A.some(d)),h=r&&Object.values(n).some(d);h?(o="POST",u=n):r||i?(o=r?"HEAD":"GET",Object.entries(n).filter(([A,p])=>p!==void 0).map(([A,p])=>[A,Array.isArray(p)?`{${p.join(",")}}`:`${p}`]).forEach(([A,p])=>{l.searchParams.append(A,p)})):(o="POST",u=n);const f=new Headers(this.headers);return h?f.set("Prefer",s?`count=${s},return=minimal`:"return=minimal"):s&&f.set("Prefer",`count=${s}`),new xg({method:o,url:l,headers:f,schema:this.schemaName,body:u,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}};class U5e{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 D5e="2.93.2",Q5e=`realtime-js/${D5e}`,H5e="1.0.0",pae="2.0.0",f9=pae,gF=1e4,$5e=1e3,z5e=100;var hh;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(hh||(hh={}));var Ti;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(Ti||(Ti={}));var zl;(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"})(zl||(zl={}));var yF;(function(e){e.websocket="websocket"})(yF||(yF={}));var Ff;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(Ff||(Ff={}));class V5e{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:"",l=(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(l.length>255)throw new Error(`joinRef length ${l.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 f=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+o.length+a.length+u.length+h.length,A=new ArrayBuffer(this.HEADER_LENGTH+f);let p=new DataView(A),m=0;p.setUint8(m++,this.KINDS.userBroadcastPush),p.setUint8(m++,l.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(l,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(A.byteLength+r.byteLength);return g.set(new Uint8Array(A),0),g.set(new Uint8Array(r),A.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,l]=r;return n({join_ref:i,ref:s,topic:a,event:o,payload:l})}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 l=this.HEADER_LENGTH+4;const u=r.decode(t.slice(l,l+i));l=l+i;const d=r.decode(t.slice(l,l+s));l=l+s;const h=r.decode(t.slice(l,l+a));l=l+a;const f=t.slice(l,t.byteLength),A=o===this.JSON_ENCODING?JSON.parse(r.decode(f)):f,p={type:this.BROADCAST_EVENT,event:d,payload:A};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 mae{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 ir;(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"})(ir||(ir={}));const p9=(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]=K5e(a,e,t,i),s),{}):{}},K5e=(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)?gae(s,a):vF(a)},gae=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return Y5e(t,n)}switch(e){case ir.bool:return q5e(t);case ir.float4:case ir.float8:case ir.int2:case ir.int4:case ir.int8:case ir.numeric:case ir.oid:return W5e(t);case ir.json:case ir.jsonb:return G5e(t);case ir.timestamp:return X5e(t);case ir.abstime:case ir.date:case ir.daterange:case ir.int4range:case ir.int8range:case ir.money:case ir.reltime:case ir.text:case ir.time:case ir.timestamptz:case ir.timetz:case ir.tsrange:case ir.tstzrange:return vF(t);default:return vF(t)}},vF=e=>e,q5e=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},W5e=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},G5e=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},Y5e=(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=>gae(t,o))}return e},X5e=e=>typeof e=="string"?e.replace(" ","T"):e,yae=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 $P{constructor(t,n,r={},i=gF){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 m9;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(m9||(m9={}));class Cw{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=Cw.syncState(this.state,i,s,a),this.pendingDiffs.forEach(l=>{this.state=Cw.syncDiff(this.state,l,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=Cw.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={},l={};return this.map(s,(u,d)=>{a[u]||(l[u]=d)}),this.map(a,(u,d)=>{const h=s[u];if(h){const f=d.map(g=>g.presence_ref),A=h.map(g=>g.presence_ref),p=d.filter(g=>A.indexOf(g.presence_ref)<0),m=h.filter(g=>f.indexOf(g.presence_ref)<0);p.length>0&&(o[u]=p),m.length>0&&(l[u]=m)}else o[u]=d}),this.syncDiff(s,{joins:o,leaves:l},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,l)=>{var u;const d=(u=t[o])!==null&&u!==void 0?u:[];if(t[o]=this.cloneDeep(l),d.length>0){const h=t[o].map(A=>A.presence_ref),f=d.filter(A=>h.indexOf(A.presence_ref)<0);t[o].unshift(...f)}r(o,d,l)}),this.map(a,(o,l)=>{let u=t[o];if(!u)return;const d=l.map(h=>h.presence_ref);u=u.filter(h=>d.indexOf(h.presence_ref)<0),t[o]=u,i(o,u,l),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 g9;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(g9||(g9={}));var Sw;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Sw||(Sw={}));var Hu;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Hu||(Hu={}));class qg{constructor(t,n={config:{}},r){var i,s;if(this.topic=t,this.params=n,this.socket=r,this.bindings={},this.state=Ti.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 $P(this,zl.join,this.params,this.timeout),this.rejoinTimer=new mae(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Ti.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=Ti.closed,this.socket._remove(this)}),this._onError(a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=Ti.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Ti.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=Ti.errored,this.rejoinTimer.scheduleTimeout())}),this._on(zl.reply,{},(a,o)=>{this._trigger(this._replyEventName(o),a)}),this.presence=new Cw(this),this.broadcastEndpointURL=yae(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==Ti.closed){const{config:{broadcast:a,presence:o,private:l}}=this.params,u=(i=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(A=>A.filter))!==null&&i!==void 0?i:[],d=!!this.bindings[Sw.PRESENCE]&&this.bindings[Sw.PRESENCE].length>0||((s=this.params.config.presence)===null||s===void 0?void 0:s.enabled)===!0,h={},f={broadcast:a,presence:Object.assign(Object.assign({},o),{enabled:d}),postgres_changes:u,private:l};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(A=>t==null?void 0:t(Hu.CHANNEL_ERROR,A)),this._onClose(()=>t==null?void 0:t(Hu.CLOSED)),this.updateJoinPayload(Object.assign({config:f},h)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:A})=>{var p;if(this.socket._isManualToken()||this.socket.setAuth(),A===void 0){t==null||t(Hu.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:S,filter:_}}=x,E=A&&A[v];if(E&&E.event===b&&qg.isFilterValueEqual(E.schema,w)&&qg.isFilterValueEqual(E.table,S)&&qg.isFilterValueEqual(E.filter,_))y.push(Object.assign(Object.assign({},x),{id:E.id}));else{this.unsubscribe(),this.state=Ti.errored,t==null||t(Hu.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=y,t&&t(Hu.SUBSCRIBED);return}}).receive("error",A=>{this.state=Ti.errored,t==null||t(Hu.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(A).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(Hu.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===Ti.joined&&t===Sw.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 l=o.statusText;try{const u=await o.json();l=u.error||u.message||l}catch{}return Promise.reject(new Error(l))}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 l={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,l,(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,l;const u=this._push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((l=(o=(a=this.params)===null||a===void 0?void 0:a.config)===null||o===void 0?void 0:o.broadcast)===null||l===void 0)&&l.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=Ti.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(zl.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(i=>{r=new $P(this,zl.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=Ti.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 $P(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>z5e){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:l,leave:u,join:d}=zl;if(r&&[o,l,u,d].indexOf(a)>=0&&r!==this._joinRef())return;let f=this._onMessage(a,n,r);if(n&&!f)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(A=>{var p,m,g;return((p=A.filter)===null||p===void 0?void 0:p.event)==="*"||((g=(m=A.filter)===null||m===void 0?void 0:m.event)===null||g===void 0?void 0:g.toLocaleLowerCase())===a}).map(A=>A.callback(f,r)):(s=this.bindings[a])===null||s===void 0||s.filter(A=>{var p,m,g,y,v,x;if(["broadcast","presence","postgres_changes"].includes(a))if("id"in A){const b=A.id,w=(p=A.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=A==null?void 0:A.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 A.type.toLocaleLowerCase()===a}).map(A=>{if(typeof f=="object"&&"ids"in f){const p=f.data,{schema:m,table:g,commit_timestamp:y,type:v,errors:x}=p;f=Object.assign(Object.assign({},{schema:m,table:g,commit_timestamp:y,eventType:v,new:{},old:{},errors:x}),this._getPayloadRecords(p))}A.callback(f,r)})}_isClosed(){return this.state===Ti.closed}_isJoined(){return this.state===Ti.joined}_isJoining(){return this.state===Ti.joining}_isLeaving(){return this.state===Ti.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&&qg.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(zl.close,{},t)}_onError(t){this._on(zl.error,{},n=>t(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Ti.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=p9(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=p9(t.columns,t.old_record)),n}}const zP=()=>{},ZC={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},J5e=[1e3,2e3,5e3,1e4],Z5e=1e4,eTe=`
  addEventListener("message", (e) => {
    if (e.data.event === "start") {
      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
    }
  });`;class tTe{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=gF,this.transport=null,this.heartbeatIntervalMs=ZC.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=zP,this.ref=0,this.reconnectTimer=null,this.vsn=f9,this.logger=zP,this.conn=null,this.sendBuffer=[],this.serializer=new V5e,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}/${yF.websocket}`,this.httpEndpoint=yae(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=U5e.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 hh.connecting:return Ff.Connecting;case hh.open:return Ff.Open;case hh.closing:return Ff.Closing;default:return Ff.Closed}}isConnected(){return this.connectionState()===Ff.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 qg(`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 l;(l=this.conn)===null||l===void 0||l.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($5e,"heartbeat timeout"),setTimeout(()=>{var n;this.isConnected()||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout()},ZC.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})`:"",l=s.status||"";this.log("receive",`${l} ${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===hh.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===hh.open||this.conn.readyState===hh.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(zl.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([eTe],{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:Q5e};n&&i.updateJoinPayload(s),i.joinedOnce&&i._isJoined()&&i._push(zl.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 mae(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},ZC.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var n,r,i,s,a,o,l,u,d,h,f,A;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:gF,this.heartbeatIntervalMs=(i=t==null?void 0:t.heartbeatIntervalMs)!==null&&i!==void 0?i:ZC.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:zP,this.vsn=(l=t==null?void 0:t.vsn)!==null&&l!==void 0?l:f9,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=>J5e[p-1]||Z5e,this.vsn){case H5e: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 pae:this.encode=(f=t==null?void 0:t.encode)!==null&&f!==void 0?f:this.serializer.encode.bind(this.serializer),this.decode=(A=t==null?void 0:t.decode)!==null&&A!==void 0?A: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 Ib=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 nTe(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 rTe(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 iTe(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:i,body:s,headers:a}){const o=nTe(e.baseUrl,r,i),l=await rTe(e.auth),u=await t(o,{method:n,headers:{...s?{"Content-Type":"application/json"}:{},...l,...a},body:s?JSON.stringify(s):void 0}),d=await u.text(),h=(u.headers.get("content-type")||"").includes("application/json"),f=h&&d?JSON.parse(d):d;if(!u.ok){const A=h?f:void 0,p=A==null?void 0:A.error;throw new Ib((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:A})}return{status:u.status,headers:u.headers,data:f}}}}function eS(e){return e.join("")}var sTe=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:eS(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/${eS(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${eS(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${eS(e.namespace)}`}),!0}catch(t){if(t instanceof Ib&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(n){if(n instanceof Ib&&n.status===409)return;throw n}}};function zm(e){return e.join("")}var aTe=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/${zm(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/${zm(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/${zm(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/${zm(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/${zm(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/${zm(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(n){if(n instanceof Ib&&n.status===404)return!1;throw n}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof Ib&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},oTe=class{constructor(e){var r;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const n=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=iTe({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(r=e.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new sTe(this.client,t),this.tableOps=new aTe(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)}},Aj=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 fj(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var tS=class extends Aj{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}}},vae=class extends Aj{constructor(e,t,n="storage"){super(e,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};const lTe=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),cTe=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)},xF=e=>{if(Array.isArray(e))return e.map(n=>xF(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]=xF(r)}),t},uTe=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function Ob(e){"@babel/helpers - typeof";return Ob=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},Ob(e)}function dTe(e,t){if(Ob(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ob(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hTe(e){var t=dTe(e,"string");return Ob(t)=="symbol"?t:t+""}function ATe(e,t,n){return(t=hTe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y9(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 $t(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?y9(Object(n),!0).forEach(function(r){ATe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y9(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const v9=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)},fTe=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 tS(v9(a),s,o,r))}).catch(()=>{if(r==="vectors"){const a=s+"";t(new tS(i.statusText||`HTTP ${s} error`,s,a,r))}else{const a=s+"";t(new tS(i.statusText||`HTTP ${s} error`,s,a,r))}});else{const a=s+"";t(new tS(i.statusText||`HTTP ${s} error`,s,a,r))}}else t(new vae(v9(e),e,r))},pTe=(e,t,n,r)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||e==="HEAD"||!r?$t($t({},i),n):(cTe(r)?(i.headers=$t({"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),$t($t({},i),n))};async function cx(e,t,n,r,i,s,a){return new Promise((o,l)=>{e(n,pTe(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=>fTe(u,l,r,a))})}function mTe(e="storage"){return{get:async(t,n,r,i)=>cx(t,"GET",n,r,i,void 0,e),post:async(t,n,r,i,s)=>cx(t,"POST",n,i,s,r,e),put:async(t,n,r,i,s)=>cx(t,"PUT",n,i,s,r,e),head:async(t,n,r,i)=>cx(t,"HEAD",n,$t($t({},r),{},{noResolveJson:!0}),i,void 0,e),remove:async(t,n,r,i,s)=>cx(t,"DELETE",n,i,s,r,e)}}const gTe=mTe("storage"),{get:Fb,post:_r,put:wF,head:yTe,remove:VD}=gTe;var nv=class{constructor(e,t={},n,r="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.fetch=lTe(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(fj(n))return{data:null,error:n};throw n}}},vTe=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(fj(t))return{data:null,error:t};throw t}}};let xae;xae=Symbol.toStringTag;var xTe=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[xae]="BlobDownloadBuilder",this.promise=null}asStream(){return new vTe(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(fj(t))return{data:null,error:t};throw t}}};const wTe={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},x9={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var bTe=class extends nv{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=$t($t({},x9),r);let o=$t($t({},i.headers),e==="POST"&&{"x-upsert":String(a.upsert)});const l=a.metadata;typeof Blob<"u"&&n instanceof Blob?(s=new FormData,s.append("cacheControl",a.cacheControl),l&&s.append("metadata",i.encodeMetadata(l)),s.append("",n)):typeof FormData<"u"&&n instanceof FormData?(s=n,s.has("cacheControl")||s.append("cacheControl",a.cacheControl),l&&!s.has("metadata")&&s.append("metadata",i.encodeMetadata(l))):(s=n,o["cache-control"]=`max-age=${a.cacheControl}`,o["content-type"]=a.contentType,l&&(o["x-metadata"]=i.toBase64(i.encodeMetadata(l))),(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=$t($t({},o),r.headers));const u=i._removeEmptyFolders(t),d=i._getFinalPath(u),h=await(e=="PUT"?wF:_r)(i.fetch,`${i.url}/object/${d}`,s,$t({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 l;const u=$t({upsert:x9.upsert},r),d=$t($t({},i.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&n instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",n)):typeof FormData<"u"&&n instanceof FormData?(l=n,l.append("cacheControl",u.cacheControl)):(l=n,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType),{path:s,fullPath:(await wF(i.fetch,o.toString(),l,{headers:d})).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e);const i=$t({},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 Aj("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}`,$t({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=>$t($t({},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=()=>Fb(this.fetch,`${this.url}/${n}/${s}${i}`,{headers:this.headers,noResolveJson:!0});return new xTe(a,this.shouldThrowOnError)}async info(e){var t=this;const n=t._getFinalPath(e);return t.handleOperation(async()=>xF(await Fb(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;const n=t._getFinalPath(e);try{return await yTe(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(fj(r)&&r instanceof vae){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 VD(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=$t($t($t({},wTe),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=$t({},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 CTe="2.93.2",m2={"X-Client-Info":`storage-js/${CTe}`};var STe=class extends nv{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=$t($t({},m2),t);super(s,a,n,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=t.listBucketOptionsToQueryString(e);return await Fb(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Fb(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 wF(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 VD(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():""}},kTe=class extends nv{constructor(e,t={},n){const r=e.replace(/\/$/,""),i=$t($t({},m2),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 Fb(t.fetch,i,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await VD(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!uTe(e))throw new Aj("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 oTe({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(l){if(r)throw l;return{data:null,error:l}}}}})}},BTe=class extends nv{constructor(e,t={},n){const r=e.replace(/\/$/,""),i=$t($t({},m2),{},{"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})||{})}},_Te=class extends nv{constructor(e,t={},n){const r=e.replace(/\/$/,""),i=$t($t({},m2),{},{"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})||{})}},ETe=class extends nv{constructor(e,t={},n){const r=e.replace(/\/$/,""),i=$t($t({},m2),{},{"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})||{})}},NTe=class extends ETe{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new jTe(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)}},jTe=class extends BTe{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,$t($t({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,$t($t({},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 TTe(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},TTe=class extends _Te{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,$t($t({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,$t($t({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,$t($t({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,$t($t({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,$t($t({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},PTe=class extends STe{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new bTe(this.url,this.headers,e,this.fetch)}get vectors(){return new NTe(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new kTe(this.url+"/iceberg",this.headers,this.fetch)}};const wae="2.93.2",wg=30*1e3,bF=3,VP=bF*wg,ITe="http://localhost:9999",OTe="supabase.auth.token",FTe={"X-Client-Info":`gotrue-js/${wae}`},CF="X-Supabase-Api-Version",bae={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},MTe=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,LTe=10*60*1e3;class Mb extends Error{constructor(t,n,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function Bt(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class RTe extends Mb{constructor(t,n,r){super(t,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function UTe(e){return Bt(e)&&e.name==="AuthApiError"}class Mf extends Mb{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class kd extends Mb{constructor(t,n,r,i){super(t,r,i),this.name=n,this.status=r}}class oo extends kd{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function KP(e){return Bt(e)&&e.name==="AuthSessionMissingError"}class Vm extends kd{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class nS extends kd{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class rS extends kd{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 DTe(e){return Bt(e)&&e.name==="AuthImplicitGrantRedirectError"}class w9 extends kd{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 QTe extends kd{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 SF extends kd{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function qP(e){return Bt(e)&&e.name==="AuthRetryableFetchError"}class b9 extends kd{constructor(t,n,r){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class kF extends kd{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const s_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),C9=` 	
\r=`.split(""),HTe=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<C9.length;t+=1)e[C9[t].charCodeAt(0)]=-2;for(let t=0;t<s_.length;t+=1)e[s_[t].charCodeAt(0)]=t;return e})();function S9(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(s_[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(s_[r]),t.queuedBits-=6}}function Cae(e,t,n){const r=HTe[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 k9(e){const t=[],n=a=>{t.push(String.fromCodePoint(a))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},s=a=>{VTe(a,r,n)};for(let a=0;a<e.length;a+=1)Cae(e.charCodeAt(a),i,s);return t.join("")}function $Te(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 zTe(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}$Te(r,t)}}function VTe(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 hy(e){const t=[],n={queue:0,queuedBits:0},r=i=>{t.push(i)};for(let i=0;i<e.length;i+=1)Cae(e.charCodeAt(i),n,r);return new Uint8Array(t)}function KTe(e){const t=[];return zTe(e,n=>t.push(n)),new Uint8Array(t)}function Kf(e){const t=[],n={queue:0,queuedBits:0},r=i=>{t.push(i)};return e.forEach(i=>S9(i,n,r)),S9(null,n,r),t.join("")}function qTe(e){return Math.round(Date.now()/1e3)+e}function WTe(){return Symbol("auth-callback")}const cs=()=>typeof window<"u"&&typeof document<"u",vf={tested:!1,writable:!1},Sae=()=>{if(!cs())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(vf.tested)return vf.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),vf.tested=!0,vf.writable=!0}catch{vf.tested=!0,vf.writable=!1}return vf.writable};function GTe(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 kae=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),YTe=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",bg=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},xf=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},ls=async(e,t)=>{await e.removeItem(t)};class pj{constructor(){this.promise=new pj.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}pj.promiseConstructor=Promise;function iS(e){const t=e.split(".");if(t.length!==3)throw new kF("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!MTe.test(t[r]))throw new kF("JWT not in base64url format");return{header:JSON.parse(k9(t[0])),payload:JSON.parse(k9(t[1])),signature:hy(t[2]),raw:{header:t[0],payload:t[1]}}}async function XTe(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function JTe(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 ZTe(e){return("0"+e.toString(16)).substr(-2)}function ePe(){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,ZTe).join("")}async function tPe(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 nPe(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 tPe(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Km(e,t,n=!1){const r=ePe();let i=r;n&&(i+="/PASSWORD_RECOVERY"),await bg(e,`${t}-code-verifier`,i);const s=await nPe(r);return[s,r===s?"plain":"s256"]}const rPe=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function iPe(e){const t=e.headers.get(CF);if(!t||!t.match(rPe))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function sPe(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 aPe(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 oPe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function qm(e){if(!oPe.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function WP(){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 lPe(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 B9(e){return JSON.parse(JSON.stringify(e))}const Nf=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),cPe=[502,503,504];async function _9(e){var t;if(!YTe(e))throw new SF(Nf(e),0);if(cPe.includes(e.status))throw new SF(Nf(e),e.status);let n;try{n=await e.json()}catch(s){throw new Mf(Nf(s),s)}let r;const i=iPe(e);if(i&&i.getTime()>=bae["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 b9(Nf(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new oo}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 b9(Nf(n),e.status,n.weak_password.reasons);throw new RTe(Nf(n),e.status||500,r)}const uPe=(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 Ht(e,t,n,r){var i;const s=Object.assign({},r==null?void 0:r.headers);s[CF]||(s[CF]=bae["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():"",l=await dPe(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(l):{data:Object.assign({},l),error:null}}async function dPe(e,t,n,r,i,s){const a=uPe(t,r,i,s);let o;try{o=await e(n,Object.assign({},a))}catch(l){throw console.error(l),new SF(Nf(l),0)}if(o.ok||await _9(o),r!=null&&r.noResolveJson)return o;try{return await o.json()}catch(l){await _9(l)}}function Ml(e){var t;let n=null;fPe(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=qTe(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:r},error:null}}function E9(e){const t=Ml(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 xh(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function hPe(e){return{data:e,error:null}}function APe(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:s}=e,a=tv(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},l=Object.assign({},a);return{data:{properties:o,user:l},error:null}}function N9(e){return e}function fPe(e){return e.access_token&&e.refresh_token&&e.expires_in}const GP=["global","local","others"];class pPe{constructor({url:t="",headers:n={},fetch:r}){this.url=t,this.headers=n,this.fetch=kae(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=GP[0]){if(GP.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${GP.join(", ")}`);try{return await Ht(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Bt(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,n={}){try{return await Ht(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:xh})}catch(r){if(Bt(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{const{options:n}=t,r=tv(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 Ht(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:APe,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(Bt(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await Ht(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:xh})}catch(n){if(Bt(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,r,i,s,a,o,l;try{const u={nextPage:null,lastPage:0,total:0},d=await Ht(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:N9});if(d.error)throw d.error;const h=await d.json(),f=(a=d.headers.get("x-total-count"))!==null&&a!==void 0?a:0,A=(l=(o=d.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return A.length>0&&(A.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(f)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(Bt(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){qm(t);try{return await Ht(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:xh})}catch(n){if(Bt(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){qm(t);try{return await Ht(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:xh})}catch(r){if(Bt(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){qm(t);try{return await Ht(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:xh})}catch(r){if(Bt(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){qm(t.userId);try{const{data:n,error:r}=await Ht(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(Bt(n))return{data:null,error:n};throw n}}async _deleteFactor(t){qm(t.userId),qm(t.id);try{return{data:await Ht(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(Bt(n))return{data:null,error:n};throw n}}async _listOAuthClients(t){var n,r,i,s,a,o,l;try{const u={nextPage:null,lastPage:0,total:0},d=await Ht(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:N9});if(d.error)throw d.error;const h=await d.json(),f=(a=d.headers.get("x-total-count"))!==null&&a!==void 0?a:0,A=(l=(o=d.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return A.length>0&&(A.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(f)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(Bt(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await Ht(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Bt(n))return{data:null,error:n};throw n}}async _getOAuthClient(t){try{return await Ht(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Bt(n))return{data:null,error:n};throw n}}async _updateOAuthClient(t,n){try{return await Ht(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Bt(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(t){try{return await Ht(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Bt(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(t){try{return await Ht(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Bt(n))return{data:null,error:n};throw n}}}function j9(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}const Wm={debug:!!(globalThis&&Sae()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Bae extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class mPe extends Bae{}async function gPe(e,t,n){Wm.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;return t>0&&setTimeout(()=>{r.abort(),Wm.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){Wm.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,i.name);try{return await n()}finally{Wm.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,i.name)}}else{if(t===0)throw Wm.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new mPe(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(Wm.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 yPe(){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 _ae(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function vPe(e){return parseInt(e,16)}function xPe(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}function wPe(e){var t;const{chainId:n,domain:r,expirationTime:i,issuedAt:s=new Date,nonce:a,notBefore:o,requestId:l,resources:u,scheme:d,uri:h,version:f}=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(f!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${f}`);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 A=_ae(e.address),p=d?`${d}://${r}`:r,m=e.statement?`${e.statement}
`:"",g=`${p} wants you to sign in with your Ethereum account:
${A}

${m}`;let y=`URI: ${h}
Version: ${f}
Chain ID: ${n}${a?`
Nonce: ${a}`:""}
Issued At: ${s.toISOString()}`;if(i&&(y+=`
Expiration Time: ${i.toISOString()}`),o&&(y+=`
Not Before: ${o.toISOString()}`),l&&(y+=`
Request ID: ${l}`),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 vi 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 a_ extends vi{constructor(t,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:t}),this.name="WebAuthnUnknownError",this.originalError=n}}function bPe({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 vi({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 vi({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 vi({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 vi({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 vi({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new vi({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 vi({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new vi({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(Eae(a)){if(s.rp.id!==a)return new vi({message:`The RP ID "${s.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new vi({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 vi({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 vi({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 vi({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function CPe({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 vi({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new vi({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const r=window.location.hostname;if(Eae(r)){if(n.rpId!==r)return new vi({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new vi({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new vi({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 vi({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class SPe{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 kPe=new SPe;function BPe(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=tv(e,["challenge","user","excludeCredentials"]),s=hy(t).buffer,a=Object.assign(Object.assign({},n),{id:hy(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 l=0;l<r.length;l++){const u=r[l];o.excludeCredentials[l]=Object.assign(Object.assign({},u),{id:hy(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return o}function _Pe(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=tv(e,["challenge","allowCredentials"]),i=hy(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:hy(o.id).buffer,type:o.type||"public-key",transports:o.transports})}}return s}function EPe(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:Kf(new Uint8Array(e.response.attestationObject)),clientDataJSON:Kf(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function NPe(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:Kf(new Uint8Array(i.authenticatorData)),clientDataJSON:Kf(new Uint8Array(i.clientDataJSON)),signature:Kf(new Uint8Array(i.signature)),userHandle:i.userHandle?Kf(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function Eae(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function T9(){var e,t;return!!(cs()&&"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 jPe(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new a_("Browser returned unexpected credential type",t)}:{data:null,error:new a_("Empty credential response",t)}}catch(t){return{data:null,error:bPe({error:t,options:e})}}}async function TPe(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new a_("Browser returned unexpected credential type",t)}:{data:null,error:new a_("Empty credential response",t)}}catch(t){return{data:null,error:CPe({error:t,options:e})}}}const PPe={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},IPe={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function o_(...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]=o_(o,a):r[s]=o_(a)}else r[s]=a}return r}function OPe(e,t){return o_(PPe,e,t||{})}function FPe(e,t){return o_(IPe,e,t||{})}class MPe{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 l=i??kPe.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=OPe(a.webauthn.credential_options.publicKey,s==null?void 0:s.create),{data:d,error:h}=await jPe({publicKey:u,signal:l});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=FPe(a.webauthn.credential_options.publicKey,s==null?void 0:s.request),{data:d,error:h}=await TPe(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:u,signal:l}));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 Bt(a)?{data:null,error:a}:{data:null,error:new Mf("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 Mb("rpId is required for WebAuthn authentication")};try{if(!T9())return{data:null,error:new Mf("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:l}=a;return this._verify({factorId:t,challengeId:a.challengeId,webauthn:{type:l.type,rpId:n,rpOrigins:r,credential_response:l.credential_response}})}catch(a){return Bt(a)?{data:null,error:a}:{data:null,error:new Mf("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 Mb("rpId is required for WebAuthn registration")};try{if(!T9())return{data:null,error:new Mf("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(f=>f.factor_type==="webauthn"&&f.friendly_name===t&&f.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:o};const{data:l,error:u}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:i},{create:s});return l?this._verify({factorId:a.id,challengeId:l.challengeId,webauthn:{rpId:n,rpOrigins:r,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:u}}catch(a){return Bt(a)?{data:null,error:a}:{data:null,error:new Mf("Unexpected error in register",a)}}}}yPe();const LPe={url:ITe,storageKey:OTe,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:FTe,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:1e4};async function P9(e,t,n){return await n()}const Gm={};class Lb{get jwks(){var t,n;return(n=(t=Gm[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){Gm[this.storageKey]=Object.assign(Object.assign({},Gm[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=Gm[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Gm[this.storageKey]=Object.assign(Object.assign({},Gm[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({},LPe),t);if(this.storageKey=s.storageKey,this.instanceID=(n=Lb.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,Lb.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.instanceID>0&&cs()){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 pPe({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=kae(s.fetch),this.lock=s.lock||P9,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&&cs()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=gPe:this.lock=P9,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 MPe(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:Sae()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=j9(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=j9(this.memoryStorage)),cs()&&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} (${wae}) ${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(cs()&&(n=GTe(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),cs()&&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),DTe(s)){const l=(t=s.details)===null||t===void 0?void 0:t.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="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 Bt(n)?this._returnResult({error:n}):this._returnResult({error:new Mf("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,i;try{const s=await Ht(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:Ml}),{data:a,error:o}=s;if(o||!a)return this._returnResult({data:{user:null,session:null},error:o});const l=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(s){if(Bt(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:f}=t;let A=null,p=null;this.flowType==="pkce"&&([A,p]=await Km(this.storage,this.storageKey)),s=await Ht(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:d,password:h,data:(n=f==null?void 0:f.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:A,code_challenge_method:p},xform:Ml})}else if("phone"in t){const{phone:d,password:h,options:f}=t;s=await Ht(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:h,data:(r=f==null?void 0:f.data)!==null&&r!==void 0?r:{},channel:(i=f==null?void 0:f.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:Ml})}else throw new nS("You must provide either an email or phone number and a password");const{data:a,error:o}=s;if(o||!a)return await ls(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:o});const l=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(s){if(await ls(this.storage,`${this.storageKey}-code-verifier`),Bt(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 Ht(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:E9})}else if("phone"in t){const{phone:s,password:a,options:o}=t;n=await Ht(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:E9})}else throw new nS("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 Vm;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(Bt(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,l,u,d,h,f;let A,p;if("message"in t)A=t.message,p=t.signature;else{const{chain:m,wallet:g,statement:y,options:v}=t;let x;if(cs())if(typeof g=="object")x=g;else{const j=window;if("ethereum"in j&&typeof j.ethereum=="object"&&"request"in j.ethereum&&typeof j.ethereum.request=="function")x=j.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(j=>j).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 S=_ae(w[0]);let _=(r=v==null?void 0:v.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!_){const j=await x.request({method:"eth_chainId"});_=vPe(j)}const E={domain:b.host,address:S,statement:y,uri:b.href,version:"1",chainId:_,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:(l=v==null?void 0:v.signInWithEthereum)===null||l===void 0?void 0:l.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};A=wPe(E),p=await x.request({method:"personal_sign",params:[xPe(A),S]})}try{const{data:m,error:g}=await Ht(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:A,signature:p},!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:Ml});if(g)throw g;if(!m||!m.session||!m.user){const y=new Vm;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(Bt(m))return this._returnResult({data:{user:null,session:null},error:m});throw m}}async signInWithSolana(t){var n,r,i,s,a,o,l,u,d,h,f,A;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(cs())if(typeof y=="object")b=y;else{const S=window;if("solana"in S&&typeof S.solana=="object"&&("signIn"in S.solana&&typeof S.solana.signIn=="function"||"signMessage"in S.solana&&typeof S.solana.signMessage=="function"))b=S.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 S=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 _;if(Array.isArray(S)&&S[0]&&typeof S[0]=="object")_=S[0];else if(S&&typeof S=="object"&&"signedMessage"in S&&"signature"in S)_=S;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in _&&"signature"in _&&(typeof _.signedMessage=="string"||_.signedMessage instanceof Uint8Array)&&_.signature instanceof Uint8Array)p=typeof _.signedMessage=="string"?_.signedMessage:new TextDecoder().decode(_.signedMessage),m=_.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}`]:[],...!((l=x==null?void 0:x.signInWithSolana)===null||l===void 0)&&l.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(_=>`- ${_}`)]:[]].join(`
`);const S=await b.signMessage(new TextEncoder().encode(p),"utf8");if(!S||!(S instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");m=S}}try{const{data:g,error:y}=await Ht(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:p,signature:Kf(m)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(A=t.options)===null||A===void 0?void 0:A.captchaToken}}:null),xform:Ml});if(y)throw y;if(!g||!g.session||!g.user){const v=new Vm;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(Bt(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async _exchangeCodeForSession(t){const n=await xf(this.storage,`${this.storageKey}-code-verifier`),[r,i]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new QTe;const{data:s,error:a}=await Ht(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:Ml});if(await ls(this.storage,`${this.storageKey}-code-verifier`),a)throw a;if(!s||!s.session||!s.user){const o=new Vm;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 ls(this.storage,`${this.storageKey}-code-verifier`),Bt(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 Ht(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:Ml}),{data:l,error:u}=o;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!l||!l.session||!l.user){const d=new Vm;return this._returnResult({data:{user:null,session:null},error:d})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:u})}catch(n){if(Bt(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:l}=t;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await Km(this.storage,this.storageKey));const{error:h}=await Ht(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(n=l==null?void 0:l.data)!==null&&n!==void 0?n:{},create_user:(r=l==null?void 0:l.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in t){const{phone:o,options:l}=t,{data:u,error:d}=await Ht(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(i=l==null?void 0:l.data)!==null&&i!==void 0?i:{},create_user:(s=l==null?void 0:l.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(a=l==null?void 0:l.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 nS("You must provide either an email or phone number.")}catch(o){if(await ls(this.storage,`${this.storageKey}-code-verifier`),Bt(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 Ht(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:s}}),redirectTo:i,xform:Ml});if(o)throw o;if(!a)throw new Error("An error occurred on token verification.");const l=a.session,u=a.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(i){if(Bt(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,l=null;this.flowType==="pkce"&&([o,l]=await Km(this.storage,this.storageKey));const u=await Ht(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:l}),headers:this.headers,xform:hPe});return!((s=u.data)===null||s===void 0)&&s.url&&cs()&&!(!((a=t.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(o){if(await ls(this.storage,`${this.storageKey}-code-verifier`),Bt(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 oo;const{error:i}=await Ht(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(Bt(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 Ht(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 Ht(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 nS("You must provide either an email or phone number and a type")}catch(n){if(Bt(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 xf(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()<VP:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){const a=await xf(this.userStorage,this.storageKey+"-user");a!=null&&a.user?t.user=a.user:t.user=WP()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const a={value:this.suppressGetSessionWarning};t.user=lPe(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 Ht(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:xh}):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 oo}:await Ht(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:xh})})}catch(n){if(Bt(n))return KP(n)&&(await this._removeSession(),await ls(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 oo;const a=i.session;let o=null,l=null;this.flowType==="pkce"&&t.email!=null&&([o,l]=await Km(this.storage,this.storageKey));const{data:u,error:d}=await Ht(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:l}),jwt:a.access_token,xform:xh});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 ls(this.storage,`${this.storageKey}-code-verifier`),Bt(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 oo;const n=Date.now()/1e3;let r=n,i=!0,s=null;const{payload:a}=iS(t.access_token);if(a.exp&&(r=a.exp,i=r<=n),i){const{data:o,error:l}=await this._callRefreshToken(t.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!o)return{data:{user:null,session:null},error:null};s=o}else{const{data:o,error:l}=await this._getUser(t.access_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});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(Bt(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 oo;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(Bt(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(t,n){try{if(!cs())throw new rS("No browser detected.");if(t.error||t.error_description||t.error_code)throw new rS(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 w9("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new rS("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 w9("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:l,token_type:u}=t;if(!s||!o||!a||!u)throw new rS("No session defined in URL");const d=Math.round(Date.now()/1e3),h=parseInt(o);let f=d+h;l&&(f=parseInt(l));const A=f-d;A*1e3<=wg&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${A}s, should have been closer to ${h}s`);const p=f-h;d-p>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",p,f,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,f,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:f,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(Bt(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 xf(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&&!KP(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&&!(UTe(o)&&(o.status===404||o.status===401||o.status===403)||KP(o)))return this._returnResult({error:o})}return t!=="others"&&(await this._removeSession(),await ls(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const n=WTe(),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 Km(this.storage,this.storageKey,!0));try{return await Ht(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 ls(this.storage,`${this.storageKey}-code-verifier`),Bt(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(Bt(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,l,u,d;const{data:h,error:f}=s;if(f)throw f;const A=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:(l=t.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await Ht(this.fetch,"GET",A,{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 cs()&&!(!((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(Bt(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:l,access_token:u,nonce:d}=t,h=await Ht(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:l,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:Ml}),{data:f,error:A}=h;return A?this._returnResult({data:{user:null,session:null},error:A}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new Vm}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:A}))}catch(i){if(await ls(this.storage,`${this.storageKey}-code-verifier`),Bt(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 Ht(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(Bt(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 JTe(async i=>(i>0&&await XTe(200*Math.pow(2,i-1)),this._debug(n,"refreshing attempt",i),await Ht(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Ml})),(i,s)=>{const a=200*Math.pow(2,i);return s&&qP(s)&&Date.now()+a-r<wg})}catch(r){if(this._debug(n,"error",r),Bt(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),cs()&&!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 xf(this.storage,this.storageKey);if(i&&this.userStorage){let a=await xf(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!a&&(a={user:i.user},await bg(this.userStorage,this.storageKey+"-user",a)),i.user=(t=a==null?void 0:a.user)!==null&&t!==void 0?t:WP()}else if(i&&!i.user&&!i.user){const a=await xf(this.storage,this.storageKey+"-user");a&&(a!=null&&a.user)?(i.user=a.user,await ls(this.storage,this.storageKey+"-user"),await bg(this.storage,this.storageKey,i)):i.user=WP()}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()<VP;if(this._debug(r,`session has${s?"":" not"} expired with margin of ${VP}s`),s){if(this.autoRefreshToken&&i.refresh_token){const{error:a}=await this._callRefreshToken(i.refresh_token);a&&(console.error(a),qP(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 oo;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new pj;const{data:s,error:a}=await this._refreshAccessToken(t);if(a)throw a;if(!s.session)throw new oo;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),Bt(s)){const a={data:null,error:s};return qP(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(l){s.push(l)}});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 ls(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 bg(this.userStorage,this.storageKey+"-user",{user:n.user});const i=Object.assign({},n);delete i.user;const s=B9(i);await bg(this.storage,this.storageKey,s)}else{const i=B9(n);await bg(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await ls(this.storage,this.storageKey),await ls(this.storage,this.storageKey+"-code-verifier"),await ls(this.storage,this.storageKey+"-user"),this.userStorage&&await ls(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&cs()&&(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(),wg);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)/wg);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${wg}ms, refresh threshold is ${bF} ticks`),i<=bF&&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 Bae)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!cs()||!(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 Km(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 Ht(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(Bt(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:l,error:u}=await Ht(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"&&l.type==="totp"&&(!((i=l==null?void 0:l.totp)===null||i===void 0)&&i.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(n){if(Bt(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"?EPe(t.webauthn.credential_response):NPe(t.webauthn.credential_response)})}:{code:t.code}),{data:o,error:l}=await Ht(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 l?this._returnResult({data:null,error:l}):(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:l}))})}catch(n){if(Bt(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 Ht(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:BPe(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:_Pe(o.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(Bt(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:A}=iS(t);let p=null;A.aal&&(p=A.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=A.amr||[];return{data:{currentLevel:p,nextLevel:m,currentAuthenticationMethods:x},error:null}}catch(A){if(Bt(A))return this._returnResult({data:null,error:A});throw A}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:l}=iS(a.access_token);let u=null;l.aal&&(u=l.aal);let d=u;((s=(i=a.user.factors)===null||i===void 0?void 0:i.filter(A=>A.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(d="aal2");const f=l.amr||[];return{data:{currentLevel:u,nextLevel:d,currentAuthenticationMethods:f},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 Ht(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 oo})})}catch(n){if(Bt(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 oo});const a=await Ht(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&&cs()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(r){if(Bt(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 oo});const a=await Ht(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&&cs()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(r){if(Bt(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 Ht(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 oo})})}catch(t){if(Bt(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 Ht(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 oo})})}catch(n){if(Bt(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+LTe>i)return r;const{data:s,error:a}=await Ht(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:A,error:p}=await this.getSession();if(p||!A.session)return this._returnResult({data:null,error:p});r=A.session.access_token}const{header:i,payload:s,signature:a,raw:{header:o,payload:l}}=iS(r);n!=null&&n.allowExpired||sPe(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:A}=await this.getUser(r);if(A)throw A;return{data:{claims:s,header:i,signature:a},error:null}}const d=aPe(i.alg),h=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,h,a,KTe(`${o}.${l}`)))throw new kF("Invalid JWT signature");return{data:{claims:s,header:i,signature:a},error:null}}catch(r){if(Bt(r))return this._returnResult({data:null,error:r});throw r}}}Lb.nextInstanceID={};const RPe=Lb,UPe="2.93.2";let zx="";typeof Deno<"u"?zx="deno":typeof document<"u"?zx="web":typeof navigator<"u"&&navigator.product==="ReactNative"?zx="react-native":zx="node";const DPe={"X-Client-Info":`supabase-js-${zx}/${UPe}`},QPe={headers:DPe},HPe={schema:"public"},$Pe={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},zPe={};function Rb(e){"@babel/helpers - typeof";return Rb=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},Rb(e)}function VPe(e,t){if(Rb(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Rb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function KPe(e){var t=VPe(e,"string");return Rb(t)=="symbol"?t:t+""}function qPe(e,t,n){return(t=KPe(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 qr(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){qPe(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 WPe=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),GPe=()=>Headers,YPe=(e,t,n)=>{const r=WPe(n),i=GPe();return async(s,a)=>{var o;const l=(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 ${l}`),r(s,qr(qr({},a),{},{headers:u}))}};function XPe(e){return e.endsWith("/")?e:e+"/"}function JPe(e,t){var n,r;const{db:i,auth:s,realtime:a,global:o}=e,{db:l,auth:u,realtime:d,global:h}=t,f={db:qr(qr({},l),i),auth:qr(qr({},u),s),realtime:qr(qr({},d),a),storage:{},global:qr(qr(qr({},h),o),{},{headers:qr(qr({},(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?f.accessToken=e.accessToken:delete f.accessToken,f}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(XPe(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var eIe=class extends RPe{constructor(e){super(e)}},tIe=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:HPe,realtime:zPe,auth:qr(qr({},$Pe),{},{storageKey:a}),global:QPe},l=JPe(n??{},o);if(this.storageKey=(r=l.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(i=l.global.headers)!==null&&i!==void 0?i:{},l.accessToken)this.accessToken=l.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=l.auth)!==null&&u!==void 0?u:{},this.headers,l.global.fetch)}this.fetch=YPe(t,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(qr({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(d=>this.realtime.setAuth(d)).catch(d=>console.warn("Failed to set initial Realtime auth token:",d)),this.rest=new R5e(new URL("rest/v1",s).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),this.storage=new PTe(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new I5e(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:l,throwOnError:u},d,h){const f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new eIe({url:this.authUrl.href,headers:qr(qr({},f),d),storageKey:s,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,flowType:a,lock:o,debug:l,throwOnError:u,fetch:h,hasCustomAuthorizationHeader:Object.keys(this.headers).some(A=>A.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new tTe(this.realtimeUrl.href,qr(qr({},e),{},{params:qr(qr({},{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 nIe=(e,t,n)=>new tIe(e,t,n);function rIe(){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}rIe()&&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 iIe="https://khmmwvmdbhaplcfcndjx.supabase.co",sIe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",Me=nIe(iIe,sIe,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}});function Nae(){return dr({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 O9="/wordmark-compact-on-dark-transparent.svg",aIe=new Set(["buyers","sellers","about"]),sS=({label:e,items:t,align:n="center",widthClassName:r="min-w-[250px]",isActive:i,onNavigate:s})=>{const[a,o]=k.useState(!1),l=k.useRef(),u=k.useRef(null),d=n==="start"?"left-0":n==="end"?"right-0":"left-1/2 -translate-x-1/2",h=()=>{clearTimeout(l.current),o(!0)},f=()=>{l.current=setTimeout(()=>o(!1),150)};return c.jsxs("div",{ref:u,className:"relative",onMouseEnter:h,onMouseLeave:f,children:[c.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(A=>!A),children:[e,c.jsx(ac,{size:11,className:`text-primary-foreground/40 transition-transform duration-200 ${a?"rotate-180":""}`})]}),c.jsx(dy,{children:a&&c.jsxs(ii.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:[c.jsx("div",{className:"h-3"}),c.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:[c.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-gold/60 to-transparent"}),c.jsx("div",{className:"p-2",children:t.map(A=>c.jsx(Ct,{to:A.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(A.href)?"text-gold bg-primary-foreground/[0.04]":"text-primary-foreground/80 hover:bg-primary-foreground/[0.06] hover:text-primary-foreground"}`,children:A.name},A.href))})]})]})})]})},mj=()=>{const[e,t]=k.useState(!1),[n,r]=k.useState(null),[i,s]=k.useState(!1),a=k.useRef(null),o=jo(),{data:l}=Nae(),u=l==null?void 0:l.find(b=>b.slug.toLowerCase()==="neighborhoods"),{data:d}=dr({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=k.useMemo(()=>(l||[]).filter(b=>!aIe.has(b.slug.toLowerCase().trim())).filter(b=>b.slug.toLowerCase()!=="neighborhoods").map(b=>({name:b.name,href:`/${b.slug}`})),[l]),f=k.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]),A=k.useMemo(()=>[{name:"Buyers",href:"/buyers"},{name:"Sellers",href:"/sellers"},...h],[h]),p=k.useMemo(()=>[...f?[{name:"Neighborhoods",href:"/neighborhoods"}]:[],{name:"Search Homes",href:"/idx"},{name:"Market Pulse",href:"/market-pulse"}],[f]),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=k.useMemo(()=>[{label:"Home",items:[{name:"Home",href:"/"}]},{label:"Buying & Selling",items:[{name:"Buyers",href:"/buyers"},{name:"Sellers",href:"/sellers"},...h]},{label:"Explore",items:[...f?[f]:[],{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,f]);k.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),k.useEffect(()=>{const b=()=>s(window.scrollY>40);return window.addEventListener("scroll",b,{passive:!0}),()=>window.removeEventListener("scroll",b)},[]),k.useEffect(()=>{t(!1),r(null)},[o.pathname]);const v=b=>o.pathname===b,x=b=>{r(w=>w===b?null:b)};return c.jsxs(c.Fragment,{children:[c.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:[c.jsx("nav",{className:"w-full px-3 md:px-6",children:c.jsxs("div",{className:"flex items-center justify-between h-20",children:[c.jsx(Ct,{to:"/",className:"shrink-0 relative z-[60] group",children:c.jsx("img",{src:O9,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"})}),c.jsxs("div",{className:"hidden lg:flex items-center gap-6 xl:gap-8",children:[c.jsx(sS,{label:"Buying & Selling",items:A,align:"start",widthClassName:"w-[280px]",isActive:v,onNavigate:()=>{}}),c.jsx(sS,{label:"Explore",items:p,align:"center",widthClassName:"w-[230px]",isActive:v,onNavigate:()=>{}}),c.jsx(sS,{label:"Insights",items:g,align:"center",widthClassName:"w-[230px]",isActive:v,onNavigate:()=>{}}),c.jsx(sS,{label:"About",items:m,align:"end",widthClassName:"w-[240px]",isActive:v,onNavigate:()=>{}}),c.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:[c.jsx($B,{size:14,className:"group-hover:scale-110 transition-transform"}),c.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em] font-medium",children:"Text Holden"})]}),c.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?c.jsx(qa,{size:24}):c.jsx(c7,{size:24})})]}),c.jsxs("div",{className:"flex lg:hidden items-center gap-3",children:[c.jsxs("a",{href:"sms:6164036393",className:"flex items-center gap-1.5 px-3 py-1.5 border border-gold/60 text-gold",children:[c.jsx($B,{size:12}),c.jsx("span",{className:"text-[9px] uppercase tracking-[0.15em] font-medium",children:"Text Holden"})]}),c.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?c.jsx(qa,{size:24}):c.jsx(c7,{size:24})})]})]})}),c.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-gold/70 to-transparent"})]}),LA.createPortal(c.jsx(dy,{children:e&&c.jsxs(ii.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:[c.jsxs(ii.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:[c.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-white/[0.04] via-transparent to-black/25"}),c.jsx("div",{className:"absolute inset-[1px] border border-white/[0.06] pointer-events-none"}),c.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"})]}),c.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:c.jsx(qa,{size:22})}),c.jsx("div",{className:"relative w-full h-20 md:h-24 flex items-center px-6 md:px-12 shrink-0",children:c.jsx(Ct,{to:"/",onClick:()=>t(!1),className:"flex items-center",children:c.jsx("img",{src:O9,alt:"HoldenGR",className:"h-12 md:h-14 w-auto"})})}),c.jsx("div",{className:"relative px-6 md:px-12",children:c.jsx("div",{className:"h-px bg-gradient-to-r from-gold/40 via-gold/20 to-transparent"})}),c.jsx("div",{className:"relative flex-1 overflow-y-auto min-h-0",children:c.jsxs("div",{className:"max-w-7xl mx-auto w-full px-6 md:px-12 py-6 md:py-10",children:[c.jsxs("div",{className:"hidden lg:flex gap-16",children:[c.jsx("nav",{className:"flex-1 flex flex-col gap-8",children:y.map((b,w)=>c.jsxs("div",{children:[c.jsx(ii.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}),c.jsx("div",{className:"flex flex-col gap-0.5",children:b.items.map((S,_)=>c.jsx(ii.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.15+w*.06+_*.03,duration:.4,ease:[.22,1,.36,1]},children:S.children?c.jsxs("button",{onClick:()=>x(S.name),className:`group flex items-center gap-2 py-2.5 transition-colors duration-300 w-full text-left ${n===S.name?"text-gold":"text-white/70 hover:text-white"}`,children:[c.jsx("span",{className:"text-[13px] uppercase tracking-[0.25em] font-medium",children:S.name}),c.jsx(oc,{size:14,className:`transition-transform duration-300 text-gold/50 ${n===S.name?"rotate-90":""}`})]}):c.jsx(Ct,{to:S.href,onClick:()=>t(!1),className:`group flex items-center py-2.5 transition-colors duration-300 ${v(S.href)?"text-gold":"text-white/70 hover:text-white"}`,children:c.jsx("span",{className:"text-[13px] uppercase tracking-[0.25em] font-medium",children:S.name})})},S.name+S.href))}),w<y.length-1&&c.jsx("div",{className:"mt-5 h-px bg-gradient-to-r from-white/[0.06] via-white/[0.03] to-transparent"})]},b.label))}),c.jsx(dy,{mode:"wait",children:n&&c.jsxs(ii.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:[c.jsx("p",{className:"text-[9px] uppercase tracking-[0.35em] font-semibold text-gold/50 mb-4",children:n}),c.jsx("div",{className:"flex flex-col gap-0.5",children:y.flatMap(b=>b.items).filter(b=>b.name===n&&b.children).map(b=>c.jsxs("div",{children:[c.jsx(Ct,{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:c.jsxs("span",{className:"text-[11px] uppercase tracking-[0.2em] font-medium",children:["View All ",b.name]})}),c.jsx("div",{className:"h-px bg-white/[0.04] my-2"}),b.children.map((w,S)=>c.jsx(ii.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{delay:S*.03,duration:.3},children:c.jsx(Ct,{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:c.jsx("span",{className:"text-[12px] uppercase tracking-[0.15em] font-medium",children:w.name})})},w.href))]},b.href))})]},n)})]}),c.jsx("nav",{className:"lg:hidden flex flex-col gap-6",children:y.map((b,w)=>c.jsxs("div",{children:[c.jsx(ii.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}),c.jsx("div",{className:"flex flex-col",children:b.items.map((S,_)=>c.jsx(ii.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.12+w*.06+_*.03,duration:.4,ease:[.22,1,.36,1]},children:S.children?c.jsxs(c.Fragment,{children:[c.jsxs("button",{onClick:()=>x(S.name),className:`group flex items-center gap-2 py-2 transition-colors duration-300 w-full text-left ${n===S.name?"text-gold":"text-white/70 hover:text-white"}`,children:[c.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] font-medium",children:S.name}),c.jsx(oc,{size:13,className:`transition-transform duration-300 text-gold/50 ${n===S.name?"rotate-90":""}`})]}),c.jsx(dy,{children:n===S.name&&c.jsxs(ii.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:[c.jsx(Ct,{to:S.href,onClick:()=>t(!1),className:"flex items-center py-1.5 text-white/40 hover:text-white/70 transition-colors",children:c.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em] font-medium",children:"View All"})}),S.children.map(E=>c.jsx(Ct,{to:E.href,onClick:()=>t(!1),className:`flex items-center py-1.5 transition-colors duration-300 ${v(E.href)?"text-gold":"text-white/55 hover:text-white"}`,children:c.jsx("span",{className:"text-[10px] uppercase tracking-[0.15em] font-medium",children:E.name})},E.href))]})})]}):c.jsx(Ct,{to:S.href,onClick:()=>t(!1),className:`group flex items-center py-2 transition-colors duration-300 ${v(S.href)?"text-gold":"text-white/70 hover:text-white"}`,children:c.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] font-medium",children:S.name})})},S.name+S.href))}),w<y.length-1&&c.jsx("div",{className:"mt-4 h-px bg-gradient-to-r from-white/[0.06] via-white/[0.03] to-transparent"})]},b.label))})]})}),c.jsx(ii.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.6,duration:.5},className:"relative shrink-0 border-t border-white/[0.08]",children:c.jsx("div",{className:"max-w-7xl mx-auto w-full px-6 md:px-12 py-5",children:c.jsxs("div",{className:"flex flex-row items-center gap-8 md:gap-12",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-[9px] uppercase tracking-[0.3em] font-medium text-white/25 mb-1",children:"Phone"}),c.jsx("a",{href:"tel:6164036393",className:"text-white/50 hover:text-white text-sm font-light tracking-wide transition-colors",children:"(616) 403-6393"})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-[9px] uppercase tracking-[0.3em] font-medium text-white/25 mb-1",children:"Email"}),c.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)]})},jae="/assets/agent-portrait-DcetkHNl.jpg",oIe="/assets/eho-realtor-logo-NaFA1neB.jpg";function lIe(){return dr({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 To(){const e=lIe(),t=(e.data||[]).reduce((n,r)=>(n[r.key]=r.value||"",n),{});return{...e,configMap:t}}function Tae(){const e=Zi();return Cs({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 cIe=()=>c.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"w-[22px] h-[22px]",children:c.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"})}),uIe=()=>c.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"w-[22px] h-[22px]",children:c.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"})}),dIe=()=>c.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"w-[22px] h-[22px]",children:c.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"})}),hIe=()=>c.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"w-[22px] h-[22px]",children:c.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"})}),AIe=[{key:"about_website",label:"Website",icon:c.jsx(u2,{className:"w-[22px] h-[22px]"}),hoverColor:"#D4AF37"},{key:"about_google_business",label:"Google",icon:c.jsx(xb,{className:"w-[22px] h-[22px]"}),hoverColor:"#4285F4"},{key:"about_facebook",label:"Facebook",icon:c.jsx(u1e,{className:"w-[22px] h-[22px]"}),hoverColor:"#1877F2"},{key:"about_instagram",label:"Instagram",icon:c.jsx(m3,{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:c.jsx(x1e,{className:"w-[22px] h-[22px]"}),hoverColor:"#0A66C2"},{key:"about_youtube",label:"YouTube",icon:c.jsx(mre,{className:"w-[22px] h-[22px]"}),hoverColor:"#FF0000"},{key:"about_x",label:"X",icon:c.jsx(uIe,{}),hoverColor:"#FFFFFF"},{key:"about_tiktok",label:"TikTok",icon:c.jsx(cIe,{}),hoverColor:"#00F2EA"},{key:"about_zillow",label:"Zillow",icon:c.jsx(dIe,{}),hoverColor:"#006AFF"},{key:"about_realtor",label:"Realtor",icon:c.jsx(hIe,{}),hoverColor:"#D92228"}],fIe=()=>{const{configMap:e,isLoading:t}=To(),[n,r]=k.useState(null);if(t)return null;const i=AIe.filter(s=>e[s.key]);return i.length===0?null:c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-accent/50 to-transparent"}),c.jsx("div",{className:"py-8 md:py-10",children:c.jsxs("div",{className:"flex flex-col items-center gap-6",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("div",{className:"w-10 h-px bg-accent/30"}),c.jsx("span",{className:"text-[10px] tracking-[0.3em] uppercase text-primary-foreground/35 font-medium",children:"Find Me On"}),c.jsx("div",{className:"w-10 h-px bg-accent/30"})]}),c.jsx("div",{className:"flex items-center gap-3 md:gap-5 flex-wrap justify-center",children:i.map(s=>{const a=n===s.key;return c.jsxs("a",{href:e[s.key],target:"_blank",rel:"noopener noreferrer",className:"group flex flex-col items-center gap-2 transition-all duration-300","aria-label":s.label,onMouseEnter:()=>r(s.key),onMouseLeave:()=>r(null),children:[c.jsx("span",{className:"flex items-center justify-center w-12 h-12 rounded-full transition-all duration-300",style:{color:a?s.hoverColor:"hsl(var(--primary-foreground) / 0.45)",backgroundColor:a?`${s.hoverColor}15`:"transparent",transform:a?"translateY(-3px) scale(1.1)":"translateY(0) scale(1)",...a&&s.hoverStyle?s.hoverStyle:{}},children:s.icon}),c.jsx("span",{className:"text-[9px] tracking-[0.2em] uppercase font-medium transition-all duration-300",style:{color:a?s.hoverColor:"hsl(var(--primary-foreground) / 0.25)",opacity:a?1:.7},children:s.label})]},s.key)})})]})}),c.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-accent/50 to-transparent"})]})},pIe="/wordmark-on-dark-transparent.svg",mIe=[{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"}],gIe=new Set(["buyers","sellers","about"]),KD=()=>{const{data:e}=Nae(),t=(e||[]).filter(r=>!gIe.has(r.slug.toLowerCase().trim())).map(r=>({name:r.name,href:`/${r.slug}`})),n=[...mIe,...t];return c.jsxs("footer",{className:"bg-primary text-primary-foreground",children:[c.jsx(fIe,{}),c.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-accent/20 to-transparent"}),c.jsx("div",{className:"py-12 md:py-16",children:c.jsxs("div",{className:"container-page",children:[c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-8 md:gap-6",children:[c.jsxs("div",{className:"md:col-span-4",children:[c.jsxs("div",{className:"flex items-center gap-4 mb-5",children:[c.jsx("img",{src:jae,alt:"Holden Richardson",className:"w-14 h-14 rounded-full object-cover object-top border-2 border-accent/30 shrink-0"}),c.jsx("img",{src:pIe,alt:"@HoldenGR",className:"h-8 w-auto"})]}),c.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."})]}),c.jsxs("div",{className:"md:col-span-2",children:[c.jsx("h4",{className:"text-[10px] uppercase tracking-[0.25em] text-accent/50 mb-4 font-medium",children:"Quick Links"}),c.jsx("ul",{className:"space-y-2",children:n.map(r=>c.jsx("li",{children:c.jsx(Ct,{to:r.href,className:"text-[13px] text-primary-foreground/45 hover:text-accent transition-colors duration-300",children:r.name})},r.href))})]}),c.jsxs("div",{className:"md:col-span-3",children:[c.jsx("h4",{className:"text-[10px] uppercase tracking-[0.25em] text-accent/50 mb-4 font-medium",children:"Contact"}),c.jsxs("ul",{className:"space-y-1.5 text-[13px] text-primary-foreground/45",children:[c.jsx("li",{children:c.jsx("a",{href:"tel:+16164036393",className:"hover:text-accent transition-colors",children:"(616) 403-6393"})}),c.jsx("li",{children:c.jsx("a",{href:"mailto:holden@holdengr.com",className:"hover:text-accent transition-colors",children:"holden@holdengr.com"})}),c.jsx("li",{className:"text-primary-foreground/30 text-[11px] pt-1",children:"License #6501392389"})]}),c.jsx("h4",{className:"text-[10px] uppercase tracking-[0.25em] text-accent/50 mt-6 mb-3 font-medium",children:"Brokerage"}),c.jsxs("ul",{className:"space-y-1 text-[13px] text-primary-foreground/45",children:[c.jsx("li",{className:"font-medium text-primary-foreground/55",children:"616 Realty LLC"}),c.jsx("li",{children:"1171 Plainfield Ave NE"}),c.jsx("li",{children:"Grand Rapids, MI 49503"}),c.jsx("li",{children:"(616) 272-3707"})]})]}),c.jsxs("div",{className:"md:col-span-3",children:[c.jsx("div",{className:"bg-primary-foreground/10 rounded p-2 w-fit mb-4",children:c.jsx("img",{src:oIe,alt:"Equal Housing Opportunity & Realtor",className:"h-10 w-auto"})}),c.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."}),c.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."})]})]}),c.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:[c.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-2 md:gap-3",children:[c.jsxs("p",{className:"text-[11px] text-primary-foreground/25",children:["© ",new Date().getFullYear()," Holden Richardson | 616 Realty LLC. All rights reserved."]}),c.jsx("span",{className:"hidden md:inline text-primary-foreground/15",children:"•"}),c.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"})]}),c.jsxs("div",{className:"flex gap-5",children:[c.jsx(Ct,{to:"/privacy-policy",className:"text-[11px] text-primary-foreground/25 hover:text-accent transition-colors",children:"Privacy Policy"}),c.jsx(Ct,{to:"/terms-of-service",className:"text-[11px] text-primary-foreground/25 hover:text-accent transition-colors",children:"Terms of Service"}),c.jsx(Ct,{to:"/accessibility",className:"text-[11px] text-primary-foreground/25 hover:text-accent transition-colors",children:"Accessibility"})]})]})]})})]})},yIe=()=>{const{configMap:e}=To(),[t,n]=k.useState(!1),r=e.booking_url,i=e.agent_phone,s=i?`sms:${i.replace(/[^+\d]/g,"")}`:null;return!r&&!s?null:c.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&&c.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:[c.jsx("div",{className:"flex items-center justify-center w-12 h-12 shrink-0",children:c.jsx(ll,{className:"w-5 h-5"})}),c.jsx(dy,{children:t&&c.jsx(ii.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&&c.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:[c.jsx("div",{className:"flex items-center justify-center w-12 h-12 shrink-0",children:c.jsx(gp,{className:"w-5 h-5"})}),c.jsx(dy,{children:t&&c.jsx(ii.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"})})]})]})},xn=({children:e})=>c.jsxs("div",{className:"min-h-screen flex flex-col",children:[c.jsx(mj,{}),c.jsx("main",{className:"flex-1 pt-20",children:e}),c.jsx(KD,{}),c.jsx(yIe,{})]}),vIe={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 xIe(e){return vIe[e.trim()]??null}function Pae(e){return/^\d{5}$/.test(e.trim())}function qD({compact:e=!1}){const[t,n]=k.useState(""),[r,i]=k.useState("seller"),[s,a]=k.useState(""),o=Sd(),l=u=>{if(u.preventDefault(),!Pae(t)){a("Enter a valid 5-digit ZIP");return}a(""),o(`/market-pulse/${t}?lens=${r}&run=1&t=${Date.now()}`)};return c.jsxs("form",{onSubmit:l,className:`bg-background/95 backdrop-blur-xl border border-border ${e?"p-4":"p-5 md:p-6"} text-foreground shadow-2xl`,children:[c.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[c.jsx(HB,{size:14,className:"text-primary"}),c.jsx("span",{className:"text-[10px] uppercase tracking-[0.3em] font-semibold text-primary",children:"Market Pulse"})]}),c.jsx("div",{className:"text-sm text-foreground/80 mb-4",children:"Your ZIP. My take. Real numbers — instant."}),c.jsxs("div",{className:"flex border border-border mb-3",children:[c.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"}),c.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"})]}),c.jsxs("div",{className:"flex gap-2",children:[c.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"}),c.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 ",c.jsx(Ma,{size:14})]})]}),s&&c.jsx("p",{className:"text-[11px] text-destructive mt-2",children:s}),c.jsx("p",{className:"text-[10px] text-muted-foreground mt-3",children:"Free · No login · Instant report with calculator + AI chat"})]})}const wIe=()=>{const[e,t]=k.useState(!1);return c.jsxs("section",{className:"relative w-full overflow-hidden bg-secondary",children:[c.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-secondary via-background to-secondary"}),c.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_top_right,hsl(var(--gold)/0.08),transparent_60%)]"}),c.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_bottom_left,hsl(var(--foreground)/0.04),transparent_55%)]"}),c.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:c.jsxs("div",{className:"grid lg:grid-cols-12 gap-8 lg:gap-12 items-center",children:[c.jsxs("div",{className:"lg:col-span-7",children:[c.jsxs(ii.div,{initial:{opacity:0,y:24},animate:{opacity:1,y:0},transition:{duration:.7,ease:[.5,0,0,1]},children:[c.jsx("div",{className:"text-[10px] md:text-[11px] uppercase tracking-[0.35em] text-accent font-medium mb-5",children:"Grand Rapids Realtor®"}),c.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"}),c.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."})]}),c.jsx(ii.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:c.jsx(qD,{})}),c.jsxs(ii.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:[c.jsxs(Ct,{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:[c.jsx(YN,{size:14})," Search Homes"]}),c.jsxs(Ct,{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:[c.jsx(m1e,{size:14})," Home Valuation"]})]})]}),c.jsx("div",{className:"lg:col-span-5",children:c.jsxs(ii.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},transition:{duration:.9,ease:[.5,0,0,1]},className:"relative",children:[c.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"}),c.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"}),c.jsxs("div",{className:"relative aspect-[4/5] lg:aspect-[3/4] w-full overflow-hidden bg-primary border border-border shadow-2xl",children:[c.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:c.jsx("source",{src:"/videos/hero-video.mp4",type:"video/mp4"})}),c.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-primary/40 via-transparent to-transparent pointer-events-none"})]}),c.jsxs("div",{className:"mt-3 flex items-center justify-between text-[10px] uppercase tracking-[0.25em] text-muted-foreground",children:[c.jsx("span",{children:"Grand Rapids · Michigan"}),c.jsx("span",{className:"text-accent",children:"— On the ground"})]})]})})]})}),c.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-accent/50 to-transparent"})]})},bIe={up:{y:50,x:0},down:{y:-50,x:0},left:{x:60,y:0},right:{x:-60,y:0}},CIe=(e,t)=>{const n=bIe[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}}}},ke=({children:e,className:t="",delay:n=0,direction:r="up",variant:i="fade"})=>{const s=k.useRef(null),a=E5e(s,{once:!0,margin:"-80px"}),o=CIe(i,r);return c.jsx(ii.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})},Iae=[{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"}],Kk=3,aS=Math.ceil(Iae.length/Kk),SIe=()=>{const[e,t]=k.useState(0),n=Iae.slice(e*Kk,e*Kk+Kk);return c.jsx("section",{className:"section-padding bg-secondary",children:c.jsxs("div",{className:"container-page",children:[c.jsxs("div",{className:"flex flex-col md:flex-row md:items-end md:justify-between mb-12 md:mb-16",children:[c.jsxs("div",{children:[c.jsx(ke,{children:c.jsx("p",{className:"text-caption mb-4 text-xl font-semibold text-accent",children:"Client Stories"})}),c.jsx(ke,{delay:.1,children:c.jsx("h2",{className:"heading-section text-5xl",children:"What Clients Say"})})]}),aS>1&&c.jsxs("div",{className:"flex gap-2 mt-6 md:mt-0",children:[c.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:c.jsx(nre,{size:20})}),c.jsx("button",{onClick:()=>t(r=>r+1),disabled:e>=aS-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:c.jsx(oc,{size:20})})]})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:n.map((r,i)=>c.jsx(ke,{delay:i*.1,children:c.jsxs("div",{className:"bg-background p-8 md:p-10 h-full flex flex-col",children:[c.jsx("div",{className:"flex gap-1 mb-6",children:[...Array(5)].map((s,a)=>c.jsx(y3,{size:16,className:"fill-gold text-gold"},a))}),c.jsxs("blockquote",{className:"text-lg font-serif text-foreground mb-8 flex-1",children:['"',r.quote,'"']}),c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-foreground",children:r.author}),c.jsx("p",{className:"text-sm text-muted-foreground",children:r.role})]})]})},r.author))}),c.jsxs("div",{className:"flex flex-col items-center gap-6 mt-10",children:[aS>1&&c.jsx("div",{className:"flex justify-center gap-2",children:Array.from({length:aS}).map((r,i)=>c.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))}),c.jsx(ke,{delay:.3,children:c.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 ",c.jsx(Ka,{className:"w-4 h-4"})]})})]})]})})};function Tt({className:e,...t}){return c.jsx("div",{className:pt("animate-pulse rounded-md bg-muted",e),...t})}const kIe=async()=>{const{data:e,error:t}=await Me.functions.invoke("instagram-feed",{body:{limit:12}});if(t)throw t;return e.media||[]},BIe=()=>{const{data:e,isLoading:t,error:n}=dr({queryKey:["instagram-feed"],queryFn:kIe,staleTime:6e5,retry:0,enabled:!0});return n?(console.error("Instagram feed error:",n),null):c.jsx("section",{className:"section-padding bg-secondary",children:c.jsxs("div",{className:"container-page",children:[c.jsxs("div",{className:"flex flex-col md:flex-row md:items-end md:justify-between mb-12",children:[c.jsxs("div",{children:[c.jsx(ke,{children:c.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"Follow Along"})}),c.jsx(ke,{delay:.1,children:c.jsx("h2",{className:"heading-section",children:"On Instagram"})})]}),c.jsx(ke,{delay:.2,children:c.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:[c.jsx(m3,{size:18}),"@holdengr.re"]})})]}),c.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:t?Array.from({length:12}).map((r,i)=>c.jsx(Tt,{className:"aspect-square w-full"},i)):e==null?void 0:e.map((r,i)=>{var s;return c.jsx(ke,{delay:i*.05,children:c.jsxs("a",{href:r.permalink,target:"_blank",rel:"noopener noreferrer",className:"block aspect-square overflow-hidden group relative",children:[r.media_type==="VIDEO"&&c.jsx("div",{className:"absolute top-3 right-3 z-10 bg-background/80 backdrop-blur-sm rounded-full p-2",children:c.jsx(g3,{size:16,className:"text-foreground fill-foreground"})}),r.media_type==="VIDEO"?c.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}):c.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"}),c.jsx("div",{className:"absolute inset-0 bg-foreground/0 group-hover:bg-foreground/20 transition-colors duration-300 flex items-center justify-center",children:c.jsx(m3,{size:28,className:"text-background opacity-0 group-hover:opacity-100 transition-opacity duration-300"})})]})},r.id)})})]})})},_Ie="https://khmmwvmdbhaplcfcndjx.supabase.co",gj=`${_Ie}/functions/v1/blog-api`;async function yj(){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 Oae(e){return dr({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 EIe(e){return dr({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 NIe(){return dr({queryKey:["blog-posts","all"],queryFn:async()=>{const e=await yj(),t=await fetch(gj,{headers:e});if(!t.ok)throw new Error("Failed to fetch posts");return t.json()}})}function jIe(){const e=Zi();return Cs({mutationFn:async t=>{const n=await yj(),r=await fetch(gj,{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 TIe(){const e=Zi();return Cs({mutationFn:async({slug:t,data:n})=>{const r=await yj(),i=await fetch(`${gj}/${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 PIe(){const e=Zi();return Cs({mutationFn:async t=>{const n=await yj(),r=await fetch(`${gj}/${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 IIe=()=>{const{data:e,isLoading:t}=Oae(3);return t?c.jsx("section",{className:"section-padding bg-secondary",children:c.jsxs("div",{className:"container-page",children:[c.jsxs("div",{className:"text-center mb-12",children:[c.jsx(Tt,{className:"h-4 w-32 mx-auto mb-4"}),c.jsx(Tt,{className:"h-12 w-64 mx-auto"})]}),c.jsx("div",{className:"grid md:grid-cols-3 gap-8",children:[...Array(3)].map((n,r)=>c.jsxs("div",{className:"bg-card border border-border",children:[c.jsx(Tt,{className:"aspect-[16/10] w-full"}),c.jsxs("div",{className:"p-6 space-y-3",children:[c.jsx(Tt,{className:"h-4 w-24"}),c.jsx(Tt,{className:"h-6 w-3/4"}),c.jsx(Tt,{className:"h-16 w-full"})]})]},r))})]})}):!e||e.length===0?null:c.jsx("section",{className:"section-padding bg-secondary",children:c.jsxs("div",{className:"container-page",children:[c.jsx(ke,{children:c.jsxs("div",{className:"text-center mb-12 md:mb-16",children:[c.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"Latest Insights"}),c.jsx("h2",{className:"heading-section",children:"From the Blog"})]})}),c.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 c.jsx(ke,{delay:r*.1,children:c.jsx(Ct,{to:`/blog/${n.slug}`,className:"group block h-full",children:c.jsxs("article",{className:"bg-card border border-border h-full flex flex-col transition-all duration-500 hover:shadow-lg",children:[n.featured_image&&c.jsx("div",{className:"aspect-[16/10] overflow-hidden",children:c.jsx("img",{src:n.featured_image,alt:n.title,className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-105"})}),c.jsxs("div",{className:"p-6 flex flex-col flex-1",children:[i&&c.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground mb-3",children:[c.jsx(ll,{className:"w-3 h-3"}),i]}),c.jsx("h3",{className:"heading-card text-lg mb-3 group-hover:text-accent transition-colors line-clamp-2",children:n.title}),n.excerpt&&c.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3 flex-1",children:n.excerpt}),c.jsx("div",{className:"mt-4 pt-4 border-t border-border",children:c.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",c.jsx(Ma,{className:"w-3 h-3 transition-transform group-hover:translate-x-1"})]})})]})]})})},n.id)})}),c.jsx(ke,{children:c.jsx("div",{className:"text-center mt-12",children:c.jsx(Ct,{to:"/blog",className:"btn-outline-primary",children:"View All Posts"})})})]})})},OIe=["EfQb_jBmqmA","tiZKi3zaFLQ","HMci7juGyhQ"],FIe=()=>c.jsx("section",{className:"py-16 md:py-24 bg-secondary",children:c.jsxs("div",{className:"container-page",children:[c.jsx(ke,{variant:"blur",children:c.jsx("p",{className:"text-caption mb-4 text-center text-accent text-xl font-semibold",children:"Video"})}),c.jsx(ke,{delay:.1,children:c.jsx("h2",{className:"heading-section text-center mb-4 text-5xl",children:"Holden's Youtube Content"})}),c.jsx(ke,{delay:.15,children:c.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."})}),c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-6 max-w-5xl mx-auto",children:OIe.map((e,t)=>c.jsx(ke,{delay:.15+t*.1,variant:"scale",children:c.jsx("div",{className:"aspect-[9/16] w-full overflow-hidden rounded-md",children:c.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))}),c.jsx(ke,{delay:.5,children:c.jsx("div",{className:"text-center mt-10",children:c.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 ",c.jsx(Ka,{className:"w-4 h-4"})]})})})]})}),MIe="/assets/agent-portrait-DcetkHNl.jpg";var vj="Collapsible",[LIe,Fae]=qs(vj),[RIe,WD]=LIe(vj),Mae=k.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:s,onOpenChange:a,...o}=e,[l,u]=Bo({prop:r,defaultProp:i??!1,onChange:a,caller:vj});return c.jsx(RIe,{scope:n,disabled:s,contentId:cl(),open:l,onOpenToggle:k.useCallback(()=>u(d=>!d),[u]),children:c.jsx(_t.div,{"data-state":JD(l),"data-disabled":s?"":void 0,...o,ref:t})})});Mae.displayName=vj;var Lae="CollapsibleTrigger",GD=k.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=WD(Lae,n);return c.jsx(_t.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":JD(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:at(e.onClick,i.onOpenToggle)})});GD.displayName=Lae;var YD="CollapsibleContent",XD=k.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=WD(YD,e.__scopeCollapsible);return c.jsx(ba,{present:n||i.open,children:({present:s})=>c.jsx(UIe,{...r,ref:t,present:s})})});XD.displayName=YD;var UIe=k.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...s}=e,a=WD(YD,n),[o,l]=k.useState(r),u=k.useRef(null),d=tn(t,u),h=k.useRef(0),f=h.current,A=k.useRef(0),p=A.current,m=a.open||o,g=k.useRef(m),y=k.useRef(void 0);return k.useEffect(()=>{const v=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(v)},[]),Ui(()=>{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,A.current=x.width,g.current||(v.style.transitionDuration=y.current.transitionDuration,v.style.animationName=y.current.animationName),l(r)}},[a.open,r]),c.jsx(_t.div,{"data-state":JD(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!m,...s,ref:d,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...e.style},children:m&&i})});function JD(e){return e?"open":"closed"}var Rae=Mae,DIe=GD,QIe=XD,HIe=k.createContext(void 0);function g2(e){const t=k.useContext(HIe);return e||t||"ltr"}var pc="Accordion",$Ie=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[ZD,zIe,VIe]=KN(pc),[xj,Tjt]=qs(pc,[VIe,Fae]),e6=Fae(),Uae=re.forwardRef((e,t)=>{const{type:n,...r}=e,i=r,s=r;return c.jsx(ZD.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?c.jsx(GIe,{...s,ref:t}):c.jsx(WIe,{...i,ref:t})})});Uae.displayName=pc;var[Dae,KIe]=xj(pc),[Qae,qIe]=xj(pc,{collapsible:!1}),WIe=re.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:s=!1,...a}=e,[o,l]=Bo({prop:n,defaultProp:r??"",onChange:i,caller:pc});return c.jsx(Dae,{scope:e.__scopeAccordion,value:re.useMemo(()=>o?[o]:[],[o]),onItemOpen:l,onItemClose:re.useCallback(()=>s&&l(""),[s,l]),children:c.jsx(Qae,{scope:e.__scopeAccordion,collapsible:s,children:c.jsx(Hae,{...a,ref:t})})})}),GIe=re.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...s}=e,[a,o]=Bo({prop:n,defaultProp:r??[],onChange:i,caller:pc}),l=re.useCallback(d=>o((h=[])=>[...h,d]),[o]),u=re.useCallback(d=>o((h=[])=>h.filter(f=>f!==d)),[o]);return c.jsx(Dae,{scope:e.__scopeAccordion,value:a,onItemOpen:l,onItemClose:u,children:c.jsx(Qae,{scope:e.__scopeAccordion,collapsible:!0,children:c.jsx(Hae,{...s,ref:t})})})}),[YIe,wj]=xj(pc),Hae=re.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:s="vertical",...a}=e,o=re.useRef(null),l=tn(o,t),u=zIe(n),h=g2(i)==="ltr",f=at(e.onKeyDown,A=>{var E;if(!$Ie.includes(A.key))return;const p=A.target,m=u().filter(j=>{var I;return!((I=j.ref.current)!=null&&I.disabled)}),g=m.findIndex(j=>j.ref.current===p),y=m.length;if(g===-1)return;A.preventDefault();let v=g;const x=0,b=y-1,w=()=>{v=g+1,v>b&&(v=x)},S=()=>{v=g-1,v<x&&(v=b)};switch(A.key){case"Home":v=x;break;case"End":v=b;break;case"ArrowRight":s==="horizontal"&&(h?w():S());break;case"ArrowDown":s==="vertical"&&w();break;case"ArrowLeft":s==="horizontal"&&(h?S():w());break;case"ArrowUp":s==="vertical"&&S();break}const _=v%y;(E=m[_].ref.current)==null||E.focus()});return c.jsx(YIe,{scope:n,disabled:r,direction:i,orientation:s,children:c.jsx(ZD.Slot,{scope:n,children:c.jsx(_t.div,{...a,"data-orientation":s,ref:l,onKeyDown:r?void 0:f})})})}),l_="AccordionItem",[XIe,t6]=xj(l_),$ae=re.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...i}=e,s=wj(l_,n),a=KIe(l_,n),o=e6(n),l=cl(),u=r&&a.value.includes(r)||!1,d=s.disabled||e.disabled;return c.jsx(XIe,{scope:n,open:u,disabled:d,triggerId:l,children:c.jsx(Rae,{"data-orientation":s.orientation,"data-state":Gae(u),...o,...i,ref:t,disabled:d,open:u,onOpenChange:h=>{h?a.onItemOpen(r):a.onItemClose(r)}})})});$ae.displayName=l_;var zae="AccordionHeader",Vae=re.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=wj(pc,n),s=t6(zae,n);return c.jsx(_t.h3,{"data-orientation":i.orientation,"data-state":Gae(s.open),"data-disabled":s.disabled?"":void 0,...r,ref:t})});Vae.displayName=zae;var BF="AccordionTrigger",Kae=re.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=wj(pc,n),s=t6(BF,n),a=qIe(BF,n),o=e6(n);return c.jsx(ZD.ItemSlot,{scope:n,children:c.jsx(DIe,{"aria-disabled":s.open&&!a.collapsible||void 0,"data-orientation":i.orientation,id:s.triggerId,...o,...r,ref:t})})});Kae.displayName=BF;var qae="AccordionContent",Wae=re.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=wj(pc,n),s=t6(qae,n),a=e6(n);return c.jsx(QIe,{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}})});Wae.displayName=qae;function Gae(e){return e?"open":"closed"}var JIe=Uae,ZIe=$ae,e4e=Vae,Yae=Kae,Xae=Wae;const Qp=JIe,kA=k.forwardRef(({className:e,...t},n)=>c.jsx(ZIe,{ref:n,className:pt("border-b",e),...t}));kA.displayName="AccordionItem";const BA=k.forwardRef(({className:e,children:t,...n},r)=>c.jsx(e4e,{className:"flex",children:c.jsxs(Yae,{ref:r,className:pt("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,c.jsx(ac,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));BA.displayName=Yae.displayName;const _A=k.forwardRef(({className:e,children:t,...n},r)=>c.jsx(Xae,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:c.jsx("div",{className:pt("pb-4 pt-0",e),children:t})}));_A.displayName=Xae.displayName;const F9=[{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."}],t4e=()=>c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsx("title",{children:"Holden Richardson | Grand Rapids Real Estate Agent"}),c.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."}),c.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/"}),c.jsx("meta",{property:"og:title",content:"Holden Richardson | Grand Rapids Real Estate Agent"}),c.jsx("meta",{property:"og:description",content:"Grand Rapids area real estate — buy or sell homes with Holden Richardson."}),c.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/"}),c.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image.jpg"}),c.jsx("meta",{property:"og:type",content:"website"}),c.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),c.jsx("meta",{name:"twitter:title",content:"Holden Richardson | Grand Rapids Real Estate Agent"}),c.jsx("meta",{name:"twitter:description",content:"Grand Rapids area real estate — buy or sell homes with Holden Richardson."}),c.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image.jpg"}),c.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:F9.map(e=>({"@type":"Question",name:e.question,acceptedAnswer:{"@type":"Answer",text:e.answer}}))})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"-mt-20",children:c.jsx(wIe,{})}),c.jsx("section",{className:"section-padding bg-background",children:c.jsx("div",{className:"container-page",children:c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_auto] gap-8 lg:gap-12 items-center",children:[c.jsxs("div",{className:"text-left lg:max-w-xl",children:[c.jsx(ke,{variant:"blur",children:c.jsx("p",{className:"text-caption mb-6 text-xl text-accent text-left font-semibold",children:"GRAND RAPIDS AREA REAL ESTATE"})}),c.jsx(ke,{delay:.1,children:c.jsx("h2",{className:"heading-section mb-8 text-5xl",children:"Helping You Make Your Next Move in Grand Rapids"})}),c.jsx(ke,{delay:.2,children:c.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."})}),c.jsx(ke,{delay:.25,children:c.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."})}),c.jsx(ke,{delay:.3,children:c.jsx(Ct,{to:"/about",className:"btn-outline-primary",children:"Learn More About Holden"})})]}),c.jsx(ke,{delay:.2,variant:"blur",children:c.jsx("div",{className:"hidden lg:block",children:c.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"})})})]})})}),c.jsx(FIe,{}),c.jsxs("div",{className:"flex items-center justify-center py-2 bg-background",children:[c.jsx("div",{className:"h-px bg-border flex-1 max-w-16"}),c.jsx("div",{className:"w-2 h-2 rotate-45 border border-accent/50 mx-4"}),c.jsx("div",{className:"h-px bg-border flex-1 max-w-16"})]}),c.jsx("section",{className:"py-16 md:py-24 bg-background",children:c.jsxs("div",{className:"container-page max-w-4xl mx-auto",children:[c.jsx(ke,{children:c.jsxs("div",{className:"text-center mb-10",children:[c.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3 text-xl font-semibold",children:"Common Questions"}),c.jsx("h2",{className:"font-serif text-2xl text-foreground md:text-5xl font-semibold",children:"What You Need to Know"})]})}),c.jsx(ke,{delay:.1,children:c.jsx(Qp,{type:"single",collapsible:!0,className:"space-y-4 max-w-4xl mx-auto",children:F9.map((e,t)=>c.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:[c.jsx(BA,{className:"text-left text-sm md:text-base font-medium hover:no-underline py-4 text-foreground/85 hover:text-foreground",children:e.question}),c.jsx(_A,{className:"text-sm text-muted-foreground leading-relaxed pb-5 px-1",children:e.answer})]},t))})})]})}),c.jsx(SIe,{}),c.jsx("section",{className:"section-padding bg-background",children:c.jsx("div",{className:"container-page",children:c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 lg:gap-20 items-center",children:[c.jsx(ke,{direction:"left",variant:"slide",children:c.jsx("div",{className:"relative",children:c.jsx("img",{src:MIe,alt:"Holden Richardson",className:"w-full aspect-[3/4] object-cover",loading:"lazy"})})}),c.jsxs("div",{children:[c.jsx(ke,{children:c.jsx("p",{className:"text-caption mb-4 text-xl font-semibold text-accent",children:"Meet Holden Richardson"})}),c.jsx(ke,{delay:.1,children:c.jsx("h2",{className:"heading-section mb-6 text-5xl",children:"Local Roots. Personal Approach. Real Results."})}),c.jsx(ke,{delay:.2,children:c.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."})}),c.jsx(ke,{delay:.3,children:c.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."})}),c.jsx(ke,{delay:.4,children:c.jsx(Ct,{to:"/about",className:"btn-outline-primary",children:"Read Full Bio"})})]})]})})}),c.jsx(IIe,{}),c.jsx(BIe,{}),c.jsx("section",{className:"py-24 md:py-32 bg-foreground text-background",children:c.jsxs("div",{className:"container-page text-center",children:[c.jsx(ke,{variant:"lift",children:c.jsx("p",{className:"text-caption text-background/60 mb-4",children:"Ready to Find Your Dream Home?"})}),c.jsx(ke,{delay:.1,children:c.jsx("h2",{className:"heading-section text-background mb-8 text-5xl",children:"Let's Start the Conversation"})}),c.jsx(ke,{delay:.2,children:c.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."})}),c.jsx(ke,{delay:.3,children:c.jsx(Ct,{to:"/contact",className:"btn-outline-inverse",children:"Contact Holden"})})]})})]})]}),n4e=({image:e,title:t,location:n,price:r,status:i="For Sale",beds:s,baths:a,sqft:o,index:l=0,listingId:u,photos:d,description:h})=>{const f=u?`/properties/${u}`:"/properties",A={image:e,title:t,location:n,price:r,status:i,beds:s,baths:a,sqft:o,photos:d,description:h};return c.jsx(ii.div,{initial:{opacity:0,y:40},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-50px"},transition:{duration:.8,delay:l*.1,ease:[.5,0,0,1]},children:c.jsxs(Ct,{to:f,state:A,className:"property-card block",children:[c.jsxs("div",{className:"relative overflow-hidden aspect-[4/3]",children:[c.jsx(ii.img,{src:e,alt:t,className:"w-full h-full object-cover",whileHover:{scale:1.05},transition:{duration:.6,ease:[.5,0,0,1]}}),c.jsx("div",{className:"property-card-overlay"}),c.jsx("div",{className:"absolute top-4 left-4",children:c.jsx("span",{className:"text-caption px-3 py-1.5 bg-background/90 text-foreground text-xs",children:i})})]}),c.jsxs("div",{className:"pt-5",children:[c.jsx("p",{className:"text-gold text-lg md:text-xl font-serif mb-1",children:r}),c.jsx("h3",{className:"heading-card text-foreground mb-1",children:t}),c.jsx("p",{className:"text-muted-foreground text-sm",children:n}),(s>0||a>0||o)&&c.jsxs("div",{className:"flex gap-4 mt-3 text-sm text-muted-foreground",children:[s>0&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(Jne,{className:"w-4 h-4"}),s," Beds"]}),a>0&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(Xne,{className:"w-4 h-4"}),a," Baths"]}),o&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(hre,{className:"w-4 h-4"}),o," Sq Ft"]})]})]})]})})};var YP="rovingFocusGroup.onEntryFocus",r4e={bubbles:!1,cancelable:!0},y2="RovingFocusGroup",[_F,Jae,i4e]=KN(y2),[s4e,Zae]=qs(y2,[i4e]),[a4e,o4e]=s4e(y2),eoe=k.forwardRef((e,t)=>c.jsx(_F.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(_F.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(l4e,{...e,ref:t})})}));eoe.displayName=y2;var l4e=k.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=e,f=k.useRef(null),A=tn(t,f),p=g2(s),[m,g]=Bo({prop:a,defaultProp:o??null,onChange:l,caller:y2}),[y,v]=k.useState(!1),x=Mi(u),b=Jae(n),w=k.useRef(!1),[S,_]=k.useState(0);return k.useEffect(()=>{const E=f.current;if(E)return E.addEventListener(YP,x),()=>E.removeEventListener(YP,x)},[x]),c.jsx(a4e,{scope:n,orientation:r,dir:p,loop:i,currentTabStopId:m,onItemFocus:k.useCallback(E=>g(E),[g]),onItemShiftTab:k.useCallback(()=>v(!0),[]),onFocusableItemAdd:k.useCallback(()=>_(E=>E+1),[]),onFocusableItemRemove:k.useCallback(()=>_(E=>E-1),[]),children:c.jsx(_t.div,{tabIndex:y||S===0?-1:0,"data-orientation":r,...h,ref:A,style:{outline:"none",...e.style},onMouseDown:at(e.onMouseDown,()=>{w.current=!0}),onFocus:at(e.onFocus,E=>{const j=!w.current;if(E.target===E.currentTarget&&j&&!y){const I=new CustomEvent(YP,r4e);if(E.currentTarget.dispatchEvent(I),!I.defaultPrevented){const T=b().filter(H=>H.focusable),N=T.find(H=>H.active),F=T.find(H=>H.id===m),D=[N,F,...T].filter(Boolean).map(H=>H.ref.current);roe(D,d)}}w.current=!1}),onBlur:at(e.onBlur,()=>v(!1))})})}),toe="RovingFocusGroupItem",noe=k.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,children:a,...o}=e,l=cl(),u=s||l,d=o4e(toe,n),h=d.currentTabStopId===u,f=Jae(n),{onFocusableItemAdd:A,onFocusableItemRemove:p,currentTabStopId:m}=d;return k.useEffect(()=>{if(r)return A(),()=>p()},[r,A,p]),c.jsx(_F.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:c.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=d4e(g,d.orientation,d.dir);if(y!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let x=f().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?h4e(x,b+1):x.slice(b+1)}setTimeout(()=>roe(x))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:m!=null}):a})})});noe.displayName=toe;var c4e={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function u4e(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function d4e(e,t,n){const r=u4e(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return c4e[r]}function roe(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function h4e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var A4e=eoe,f4e=noe,bj="Tabs",[p4e,Pjt]=qs(bj,[Zae]),ioe=Zae(),[m4e,n6]=p4e(bj),soe=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:s,orientation:a="horizontal",dir:o,activationMode:l="automatic",...u}=e,d=g2(o),[h,f]=Bo({prop:r,onChange:i,defaultProp:s??"",caller:bj});return c.jsx(m4e,{scope:n,baseId:cl(),value:h,onValueChange:f,orientation:a,dir:d,activationMode:l,children:c.jsx(_t.div,{dir:d,"data-orientation":a,...u,ref:t})})});soe.displayName=bj;var aoe="TabsList",ooe=k.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,s=n6(aoe,n),a=ioe(n);return c.jsx(A4e,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:r,children:c.jsx(_t.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:t})})});ooe.displayName=aoe;var loe="TabsTrigger",coe=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...s}=e,a=n6(loe,n),o=ioe(n),l=hoe(a.baseId,r),u=Aoe(a.baseId,r),d=r===a.value;return c.jsx(f4e,{asChild:!0,...o,focusable:!i,active:d,children:c.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:l,...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)})})})});coe.displayName=loe;var uoe="TabsContent",doe=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:s,...a}=e,o=n6(uoe,n),l=hoe(o.baseId,r),u=Aoe(o.baseId,r),d=r===o.value,h=k.useRef(d);return k.useEffect(()=>{const f=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(f)},[]),c.jsx(ba,{present:i||d,children:({present:f})=>c.jsx(_t.div,{"data-state":d?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:u,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:f&&s})})});doe.displayName=uoe;function hoe(e,t){return`${e}-trigger-${t}`}function Aoe(e,t){return`${e}-content-${t}`}var g4e=soe,foe=ooe,poe=coe,moe=doe;const v2=g4e,rv=k.forwardRef(({className:e,...t},n)=>c.jsx(foe,{ref:n,className:pt("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));rv.displayName=foe.displayName;const si=k.forwardRef(({className:e,...t},n)=>c.jsx(poe,{ref:n,className:pt("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}));si.displayName=poe.displayName;const ai=k.forwardRef(({className:e,...t},n)=>c.jsx(moe,{ref:n,className:pt("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ai.displayName=moe.displayName;const y4e="https://api.realsavvy.com/api/v3/listings/search",v4e="https://api.realsavvy.com/api/v3/suggestions",r6="eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiIwMTdkZTg1ZTVkNmYyN2U1ZWVlNDQ0MTkyYmQ2OWFlOWE1YWQ1NmZkMzk5ZWViYjhmZTk5ZWQ5NzE1YmY0NzBiIiwiYXVkIjoiZ2lkOi8vcmVhbC1zYXZ2eS9TaXRlLzE3NjEiLCJzdWIiOiJnaWQ6Ly9yZWFsLXNhdnZ5L1NpdGUvMTc2MSIsInNjb3BlcyI6WyJhZG1pbiJdfQ.o3UL0ih_XwYtfFKjMO1rkNX84RcRVpL11s-WY6zlH0bZAfxgofDa933-GmRS0JezLJyGPrER9PYRmKtgukPl4VYEW0xDaDdVGmHtvavX2iNiAlXQscNMieJtvXT0TszFgDDqk0tsCsx0v9JIdUrBVyPYa6Zneu3rdg_Gvu4ocRy-UsXntMtW9WBs_CPZcKoSxMWOZZjxj1vGWB9VceRg62puKNN_EsxWK26JDBqwPqM8HMRac6yaECH9nvjtgmMasmybtXVeIDVbjuXx3fOfbeDFrCix1rbSGgs1H5-U8hN7AHvJijxqrHgNoofPPz5PSp2MsB-4fV7iuFE4dFZEbQ",x4e=async e=>{const t=await fetch(`${v4e}?ids[]=${e}`,{method:"GET",headers:{Authorization:`Bearer ${r6}`,"Content-Type":"application/json"}});return t.ok?t.json():(console.error(`Failed to fetch suggestion data: ${t.status}`),null)},w4e=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}}]},b4e=async e=>{const t=await fetch(y4e,{method:"POST",headers:{Authorization:`Bearer ${r6}`,"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(`API error: ${t.status}`);return t.json()},C4e=async(e,t)=>{if(t){const n=await x4e(t),r=w4e(n);r&&(e={...e,filter:{...e.filter,suggestion:{value:r}}})}return b4e(e)},S4e=(e,t=1,n=12,r)=>{const i={filter:e,market_id:null,page:{number:t,size:n},sort:"+price_in_dollars"};return dr({queryKey:["listings",JSON.stringify(e),t,n,r],queryFn:()=>C4e(i,r),staleTime:5*60*1e3})},k4e=async e=>{const t=await fetch(`https://api.realsavvy.com/api/v3/listings/${e}`,{method:"GET",headers:{Authorization:`Bearer ${r6}`,"Content-Type":"application/json"}});if(!t.ok)throw new Error(`API error: ${t.status}`);return t.json()},B4e=e=>dr({queryKey:["listing",e],queryFn:()=>k4e(e),enabled:!!e,staleTime:5*60*1e3}),goe=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e),c_=e=>new Intl.NumberFormat("en-US").format(e),M9=({filter:e,suggestionId:t})=>{var s;const{data:n,isLoading:r,error:i}=S4e(e,1,12,t);return r?c.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)=>c.jsxs("div",{className:"space-y-4",children:[c.jsx(Tt,{className:"aspect-[4/3] w-full"}),c.jsx(Tt,{className:"h-6 w-3/4"}),c.jsx(Tt,{className:"h-4 w-1/2"})]},o))}):i?c.jsx("div",{className:"text-center py-12",children:c.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?c.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 l=a.attributes,u=l.square_feet?c_(l.square_feet):l.lot_square_feet?c_(parseFloat(l.lot_square_feet)):void 0;return c.jsx(n4e,{listingId:a.id,image:l.photo_urls[0]||"/placeholder.svg",title:l.title,location:l.subtitle,price:goe(l.price_in_dollars),status:l.listing_status,beds:l.bedrooms,baths:l.bathrooms,sqft:u,index:o,photos:l.photo_urls,description:l.description||void 0},a.id)})}):c.jsx("div",{className:"text-center py-12",children:c.jsx("p",{className:"text-muted-foreground",children:"No properties found."})})},_4e=()=>c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsx("title",{children:"Properties | Grand Rapids Homes for Sale | Holden Richardson"}),c.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."}),c.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/properties"}),c.jsx("meta",{property:"og:title",content:"Properties | Grand Rapids Homes for Sale"}),c.jsx("meta",{property:"og:description",content:"Browse Grand Rapids area properties with Holden Richardson."}),c.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/properties"}),c.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image.jpg"}),c.jsx("meta",{property:"og:type",content:"website"}),c.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),c.jsx("meta",{name:"twitter:title",content:"Properties | Grand Rapids Homes for Sale"}),c.jsx("meta",{name:"twitter:description",content:"Browse Grand Rapids area properties with Holden Richardson."}),c.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image.jpg"})]}),c.jsx("section",{className:"-mt-20 pt-32 md:pt-40 pb-20 md:pb-28 bg-secondary",children:c.jsxs("div",{className:"container-page",children:[c.jsx(ke,{children:c.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"Exclusive Portfolio"})}),c.jsx(ke,{delay:.1,children:c.jsx("h1",{className:"heading-display max-w-4xl",children:"Properties"})}),c.jsx(ke,{delay:.2,children:c.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."})})]})}),c.jsx("section",{className:"section-padding bg-background",children:c.jsx("div",{className:"container-page",children:c.jsxs(v2,{defaultValue:"active",className:"w-full",children:[c.jsx(ke,{children:c.jsxs(rv,{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:[c.jsx(si,{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"}),c.jsx(si,{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"})]})}),c.jsx(ai,{value:"active",className:"mt-0",children:c.jsx(M9,{filter:{listing_status:{value:["Active"]},agent_profile:{"michigan-regional-information-center-llc":{key:["grich2990"],relationships:["listing"]}}}})}),c.jsx(ai,{value:"sold",className:"mt-0",children:c.jsx(M9,{filter:{listing_status:{value:["Sold"]},agent_profile:{"michigan-regional-information-center-llc":{key:["grich2990"],relationships:["listing"]}}}})})]})})}),c.jsx("section",{className:"py-20 md:py-28 bg-secondary",children:c.jsxs("div",{className:"container-page text-center",children:[c.jsx(ke,{children:c.jsx("h2",{className:"heading-section mb-6",children:"Looking for Something Specific?"})}),c.jsx(ke,{delay:.1,children:c.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."})}),c.jsx(ke,{delay:.2,children:c.jsx("a",{href:"/contact",className:"btn-outline-primary",children:"Contact Holden"})})]})})]}),i6=GN("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"}}),Be=k.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const a=r?cbe:"button";return c.jsx(a,{className:pt(i6({variant:t,size:n,className:e})),ref:s,...i})});Be.displayName="Button";const E4e=()=>{var d,h;const{id:e}=om(),n=jo().state,{data:r,isLoading:i,error:s}=B4e(e);if(i)return c.jsxs(xn,{children:[c.jsx("section",{className:"pt-8 pb-4 bg-background",children:c.jsx("div",{className:"container-page",children:c.jsx(Tt,{className:"h-6 w-32"})})}),c.jsx("section",{className:"pb-8 bg-background",children:c.jsx("div",{className:"container-page",children:c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsx(Tt,{className:"aspect-[4/3]"}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(Tt,{className:"aspect-[4/3]"}),c.jsx(Tt,{className:"aspect-[4/3]"}),c.jsx(Tt,{className:"aspect-[4/3]"}),c.jsx(Tt,{className:"aspect-[4/3]"})]})]})})}),c.jsx("section",{className:"py-12 bg-background",children:c.jsx("div",{className:"container-page",children:c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-12",children:[c.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[c.jsx(Tt,{className:"h-8 w-24"}),c.jsx(Tt,{className:"h-10 w-3/4"}),c.jsx(Tt,{className:"h-6 w-1/2"}),c.jsx(Tt,{className:"h-12 w-48"}),c.jsx(Tt,{className:"h-40 w-full"})]}),c.jsx("div",{children:c.jsx(Tt,{className:"h-64 w-full"})})]})})})]});const a=(d=r==null?void 0:r.data)==null?void 0:d.attributes,o=a?{id:r.data.id,title:a.title,subtitle:a.subtitle,price:goe(a.price_in_dollars),status:a.listing_status,bedrooms:a.bedrooms,bathrooms:a.bathrooms,squareFeet:a.square_feet?c_(a.square_feet):null,lotSize:a.lot_acre?`${a.lot_acre} acres`:a.lot_square_feet?`${c_(Number(a.lot_square_feet))} sq ft`:null,yearBuilt:a.year_built,propertyType:a.type?a.type.charAt(0).toUpperCase()+a.type.slice(1):"Residential",mlsNumber:a.mls_number,description:a.description,images:a.photo_urls||[],agent:{name:a.listing_agent||"Holden Richardson",phone:a.office_phone||"(616) 403-6393",broker:a.listing_broker||"616 Realty LLC"},realstaqSections:((h=a.realstaq_details)==null?void 0:h.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(!o)return c.jsx(xn,{children:c.jsx("section",{className:"py-20 bg-background",children:c.jsxs("div",{className:"container-page text-center",children:[c.jsx("h1",{className:"heading-section mb-4",children:"Listing Not Found"}),c.jsx("p",{className:"text-muted-foreground mb-8",children:"The property you're looking for could not be found."}),c.jsx(Ct,{to:"/properties",children:c.jsx(Be,{className:"btn-outline-primary",children:"Back to Properties"})})]})})});const l=`${o.title} | Holden Richardson — Grand Rapids Real Estate`,u=o.description?o.description.slice(0,160):`${o.title} — ${o.price}, ${o.bedrooms} bed, ${o.bathrooms} bath in Grand Rapids area.`;return c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsx("title",{children:l}),c.jsx("meta",{name:"description",content:u}),c.jsx("link",{rel:"canonical",href:`https://www.holdengr.com/properties/${e}`}),c.jsx("meta",{property:"og:title",content:l}),c.jsx("meta",{property:"og:description",content:u}),c.jsx("meta",{property:"og:url",content:`https://www.holdengr.com/properties/${e}`}),o.images[0]&&c.jsx("meta",{property:"og:image",content:o.images[0]}),c.jsx("meta",{property:"og:type",content:"website"}),c.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),c.jsx("meta",{name:"twitter:title",content:l}),c.jsx("meta",{name:"twitter:description",content:u}),o.images[0]&&c.jsx("meta",{name:"twitter:image",content:o.images[0]})]}),c.jsx("section",{className:"pt-8 pb-4 bg-background",children:c.jsx("div",{className:"container-page",children:c.jsxs(Ct,{to:"/properties",className:"inline-flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[c.jsx(l2,{className:"w-4 h-4"}),c.jsx("span",{className:"text-sm",children:"Back to Properties"})]})})}),c.jsx("section",{className:"pb-8 bg-background",children:c.jsx("div",{className:"container-page",children:c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsx("div",{className:"aspect-[4/3] overflow-hidden",children:o.images[0]&&c.jsx("img",{src:o.images[0],alt:o.title,className:"w-full h-full object-cover"})}),c.jsx("div",{className:"grid grid-cols-2 gap-4",children:o.images.slice(1,5).map((f,A)=>c.jsx("div",{className:"aspect-[4/3] overflow-hidden",children:c.jsx("img",{src:f,alt:`${o.title} - ${A+2}`,className:"w-full h-full object-cover"})},A))})]})})}),c.jsx("section",{className:"py-12 md:py-16 bg-background",children:c.jsx("div",{className:"container-page",children:c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-12",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx(ke,{children:c.jsxs("div",{className:"flex items-start justify-between mb-6",children:[c.jsxs("div",{children:[c.jsx("span",{className:"inline-block text-caption px-3 py-1.5 bg-secondary text-foreground text-xs mb-4",children:o.status}),c.jsx("h1",{className:"heading-section mb-2",children:o.title}),c.jsxs("p",{className:"text-muted-foreground flex items-center gap-2",children:[c.jsx(xb,{className:"w-4 h-4"}),o.subtitle]})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Be,{variant:"outline",size:"icon",children:c.jsx(j1e,{className:"w-4 h-4"})}),c.jsx(Be,{variant:"outline",size:"icon",children:c.jsx(ore,{className:"w-4 h-4"})})]})]})}),c.jsx(ke,{delay:.1,children:c.jsx("p",{className:"text-gold text-3xl md:text-4xl font-serif mb-8",children:o.price})}),c.jsx(ke,{delay:.2,children:c.jsxs("div",{className:"flex flex-wrap gap-6 py-6 border-y border-border mb-8",children:[o.bedrooms>0&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Jne,{className:"w-5 h-5 text-muted-foreground"}),c.jsx("span",{className:"text-foreground font-medium",children:o.bedrooms}),c.jsx("span",{className:"text-muted-foreground",children:"Beds"})]}),o.bathrooms>0&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Xne,{className:"w-5 h-5 text-muted-foreground"}),c.jsx("span",{className:"text-foreground font-medium",children:o.bathrooms}),c.jsx("span",{className:"text-muted-foreground",children:"Baths"})]}),o.squareFeet&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(hre,{className:"w-5 h-5 text-muted-foreground"}),c.jsx("span",{className:"text-foreground font-medium",children:o.squareFeet}),c.jsx("span",{className:"text-muted-foreground",children:"Sq Ft"})]})]})}),o.description&&c.jsx(ke,{delay:.3,children:c.jsxs("div",{className:"mb-10",children:[c.jsx("h2",{className:"heading-card mb-4",children:"Description"}),c.jsx("p",{className:"text-muted-foreground whitespace-pre-line leading-relaxed",children:o.description})]})}),o.fromState&&c.jsx(ke,{delay:.3,children:c.jsx("div",{className:"p-4 bg-secondary rounded-sm mb-10",children:c.jsx("p",{className:"text-muted-foreground text-sm",children:"This listing has been sold. Limited details are available from the original search results."})})}),o.realstaqSections.map((f,A)=>c.jsx(ke,{delay:.4+A*.1,children:c.jsxs("div",{className:"mb-10",children:[c.jsx("h2",{className:"heading-card mb-4",children:f.title}),c.jsx("div",{className:`grid gap-4 ${f.style==="third"?"grid-cols-2 md:grid-cols-3":"grid-cols-1 md:grid-cols-2"}`,children:f.fields.map((p,m)=>c.jsxs("div",{className:"p-4 bg-secondary rounded-sm",children:[c.jsx("p",{className:"text-caption text-muted-foreground mb-1",children:p.label}),c.jsx("p",{className:"text-foreground font-medium",children:p.value!==null&&p.value!==void 0?String(p.value):"N/A"})]},`${f.title}-${m}`))})]})},f.title))]}),c.jsx("div",{className:"lg:col-span-1",children:c.jsx(ke,{delay:.2,children:c.jsxs("div",{className:"sticky top-24 p-6 bg-secondary rounded-sm",children:[c.jsx("h3",{className:"heading-card mb-4",children:"Contact Agent"}),c.jsxs("div",{className:"mb-6",children:[c.jsx("p",{className:"text-foreground font-medium",children:o.agent.name}),c.jsx("p",{className:"text-muted-foreground text-sm",children:o.agent.broker}),c.jsx("p",{className:"text-muted-foreground text-sm",children:o.agent.phone})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsx(Be,{className:"w-full btn-outline-primary",children:"Schedule a Showing"}),c.jsx(Be,{variant:"outline",className:"w-full",children:"Request More Info"})]})]})})})]})})})]})},N4e="/assets/holden-about-BFemenAp.jpg",iv=e=>dr({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||[]}}),j4e=()=>{const e=Zi();return Cs({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:l}=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(l)throw l},onSuccess:()=>e.invalidateQueries({queryKey:["site-media"]})})},T4e=()=>{const e=Zi();return Cs({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"]})})},P4e=()=>{const e=Zi();return Cs({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"]})})},Ac=e=>{if(e.startsWith("http"))return e;const{data:t}=Me.storage.from("site-media").getPublicUrl(e);return t.publicUrl},I4e="https://res.cloudinary.com/dofjjlc6d/image/upload/v1769540628/user-uploads/2160/wrbvjojilgzlvn1u2hnw.jpg",O4e=[{value:"$50M+",label:"Real Estate Sold"},{value:"150+",label:"Homes Sold"},{value:"11+",label:"Years in the Business"}],F4e=()=>{const{data:e}=dr({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 c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsx("title",{children:"About Holden Richardson | Grand Rapids Realtor"}),c.jsx("meta",{name:"description",content:"Meet Holden Richardson — a dedicated Grand Rapids area real estate agent. Deep local expertise, client-first approach."}),c.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/about"}),c.jsx("meta",{property:"og:title",content:"About Holden Richardson | Grand Rapids Realtor"}),c.jsx("meta",{property:"og:description",content:"Meet Holden Richardson — a dedicated Grand Rapids area real estate agent."}),c.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/about"}),c.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image.jpg"}),c.jsx("meta",{property:"og:type",content:"profile"}),c.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),c.jsx("meta",{name:"twitter:title",content:"About Holden Richardson | Grand Rapids Realtor"}),c.jsx("meta",{name:"twitter:description",content:"Meet Holden Richardson — a dedicated Grand Rapids area real estate agent."}),c.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image.jpg"}),c.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"}})}),c.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"}]})})]}),c.jsxs("section",{className:"relative -mt-20 pt-32 md:pt-40 pb-20 md:pb-28 overflow-hidden",children:[c.jsxs("div",{className:"absolute inset-0",children:[c.jsx("img",{src:Ac("stock_photo/1772747249479-34tk12ax6yg.jpeg"),alt:"Grand Rapids area real estate",className:"w-full h-full object-cover"}),c.jsx("div",{className:"absolute inset-0 bg-black/40"})]}),c.jsxs("div",{className:"container-page relative z-10",children:[c.jsx(ke,{children:c.jsx("p",{className:"text-caption text-white/60 mb-4",children:"About"})}),c.jsxs(ke,{delay:.1,children:[c.jsx("h1",{className:"heading-display max-w-4xl text-white",children:"Holden Richardson"}),c.jsx("div",{className:"w-16 h-[2px] bg-accent mt-6 mb-6"})]}),c.jsx(ke,{delay:.2,children:c.jsx("p",{className:"text-body text-white/80 max-w-2xl",children:"Setting the standard for real estate in the Grand Rapids area."})})]})]}),c.jsx("section",{className:"section-padding bg-background",children:c.jsx("div",{className:"container-page",children:c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 lg:gap-20 items-start",children:[c.jsx(ke,{direction:"left",variant:"slide",children:c.jsx("div",{className:"relative sticky top-32",children:c.jsx("img",{src:N4e,alt:"Holden Richardson",className:"w-full aspect-[3/4] object-cover",loading:"lazy"})})}),c.jsxs("div",{children:[c.jsx(ke,{children:c.jsx("h2",{className:"heading-section mb-8",children:"A Reputation Built on Results"})}),c.jsxs("div",{className:"space-y-6 text-body text-muted-foreground",children:[c.jsx(ke,{delay:.1,children:c.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."})}),c.jsx(ke,{delay:.2,children:c.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."})}),c.jsx(ke,{delay:.3,children:c.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."})}),c.jsx(ke,{delay:.4,children:c.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."})})]}),c.jsx(ke,{delay:.5,children:c.jsx("div",{className:"mt-10",children:c.jsx(Ct,{to:"/contact",className:"btn-outline-primary",children:"Get in Touch"})})})]})]})})}),c.jsx("section",{className:"section-padding bg-secondary",children:c.jsxs("div",{className:"container-page",children:[c.jsx(ke,{children:c.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"Track Record"})}),c.jsx(ke,{delay:.1,children:c.jsx("h2",{className:"heading-section mb-12 md:mb-16",children:"By the Numbers"})}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 md:gap-12",children:O4e.map((t,n)=>c.jsx(ke,{delay:n*.1,children:c.jsxs("div",{className:"text-center md:text-left",children:[c.jsx("span",{className:"text-gold font-serif text-5xl md:text-6xl font-light",children:t.value}),c.jsx("p",{className:"text-muted-foreground mt-3 text-sm uppercase tracking-widest",children:t.label})]})},t.label))})]})}),e&&e.length>0&&c.jsx("section",{className:"section-padding bg-background",children:c.jsxs("div",{className:"container-page",children:[c.jsx(ke,{children:c.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"Learn More"})}),c.jsx(ke,{delay:.1,children:c.jsx("h2",{className:"heading-section mb-12 md:mb-16",children:"Common Questions"})}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:e.map((t,n)=>c.jsx(ke,{delay:n*.1,children:c.jsxs(Ct,{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:[c.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&&c.jsx("p",{className:"text-sm text-muted-foreground mb-4 line-clamp-2",children:t.subheadline}),t.intro_text&&c.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-4",children:t.intro_text}),c.jsxs("span",{className:"inline-flex items-center gap-1.5 text-caption text-foreground group-hover:text-accent transition-colors",children:["Read More ",c.jsx(Ma,{size:14})]})]})},t.id))})]})}),c.jsxs("section",{className:"relative",children:[c.jsxs("div",{className:"absolute inset-0",children:[c.jsx("img",{src:I4e,alt:"Grand Rapids area property",className:"w-full h-full object-cover"}),c.jsx("div",{className:"absolute inset-0 bg-black/70"})]}),c.jsx("div",{className:"relative section-padding",children:c.jsx("div",{className:"container-page",children:c.jsxs("div",{className:"max-w-3xl",children:[c.jsx(ke,{variant:"blur",children:c.jsx("p",{className:"text-caption text-gold mb-4",children:"Philosophy"})}),c.jsx(ke,{delay:.1,children:c.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."`})}),c.jsx(ke,{delay:.2,children:c.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."})})]})})})]})]})},M4e="/assets/testimonials-hero-D_OW3dCz.jpg",Cj=[{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"}],u_=Cj.length,L4e=Cj.reduce((e,t)=>e+t.rating,0)/u_,yoe=+L4e.toFixed(2),R4e={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 U4e(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=R4e[n[1].toLowerCase()];return r?`${n[2]}-${r}`:t}return t}const D4e={"@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:yoe,bestRating:5,worstRating:1,reviewCount:u_},review:Cj.map(e=>({"@type":"Review",itemReviewed:{"@id":"https://www.holdengr.com/#agent"},author:{"@type":"Person",name:e.author},datePublished:U4e(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"}}}))},Q4e=()=>c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsx("title",{children:"Client Testimonials | Holden Richardson | Grand Rapids Realtor"}),c.jsx("meta",{name:"description",content:`Read real reviews from Holden Richardson's clients across Google and Zillow. ${u_} reviews from buyers, sellers, and industry partners in the Grand Rapids area.`}),c.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/about/testimonials"}),c.jsx("meta",{property:"og:title",content:"Client Testimonials | Holden Richardson"}),c.jsx("meta",{property:"og:description",content:"Real reviews from real clients — see why Grand Rapids homeowners trust Holden Richardson."}),c.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/about/testimonials"}),c.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image.jpg"}),c.jsx("meta",{property:"og:type",content:"website"}),c.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),c.jsx("meta",{name:"twitter:title",content:"Client Testimonials | Holden Richardson"}),c.jsx("meta",{name:"twitter:description",content:"Real reviews from real clients — see why Grand Rapids homeowners trust Holden Richardson."}),c.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image.jpg"}),c.jsx("script",{type:"application/ld+json",children:JSON.stringify(D4e)})]}),c.jsxs("section",{className:"relative -mt-20 pt-32 md:pt-40 pb-20 md:pb-28 overflow-hidden",children:[c.jsxs("div",{className:"absolute inset-0",children:[c.jsx("img",{src:M4e,alt:"Elegant living space",className:"w-full h-full object-cover"}),c.jsx("div",{className:"absolute inset-0 bg-black/50"})]}),c.jsxs("div",{className:"container-page relative z-10",children:[c.jsx(ke,{children:c.jsx("p",{className:"text-caption text-white/60 mb-4",children:"About"})}),c.jsxs(ke,{delay:.1,children:[c.jsx("h1",{className:"heading-display max-w-4xl text-white",children:"Client Testimonials"}),c.jsx("div",{className:"w-16 h-[2px] bg-accent mt-6 mb-6"})]}),c.jsx(ke,{delay:.2,children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"flex gap-0.5",children:[...Array(5)].map((e,t)=>c.jsx(y3,{size:20,className:"fill-gold text-gold"},t))}),c.jsxs("span",{className:"text-white/80 text-lg font-light",children:[yoe," average · ",u_," reviews"]})]})})]})]}),c.jsx("section",{className:"section-padding bg-background",children:c.jsxs("div",{className:"container-page",children:[c.jsx(ke,{children:c.jsxs("div",{className:"flex flex-wrap gap-4 mb-12",children:[c.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 ",c.jsx(Ka,{className:"w-3.5 h-3.5"})]}),c.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 ",c.jsx(Ka,{className:"w-3.5 h-3.5"})]})]})}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:Cj.map((e,t)=>c.jsx(ke,{delay:t%3*.1,children:c.jsxs("div",{className:"bg-secondary p-8 h-full flex flex-col border border-border",children:[c.jsx("div",{className:"flex gap-0.5 mb-4",children:[...Array(5)].map((n,r)=>c.jsx(y3,{size:14,className:r<e.rating?"fill-gold text-gold":"text-border"},r))}),c.jsxs("blockquote",{className:"text-sm font-serif text-foreground mb-6 flex-1 leading-relaxed",children:['"',e.quote,'"']}),c.jsxs("div",{className:"border-t border-border pt-4 mt-auto",children:[c.jsx("p",{className:"font-medium text-foreground text-sm",children:e.author}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.role,e.location?` · ${e.location}`:""," · ",e.date]}),c.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))})]})}),c.jsx("section",{className:"section-padding bg-primary text-center",children:c.jsxs("div",{className:"container-page",children:[c.jsx(ke,{children:c.jsx("h2",{className:"heading-section text-white mb-6",children:"Ready to Write Your Own Story?"})}),c.jsx(ke,{delay:.1,children:c.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."})}),c.jsx(ke,{delay:.2,children:c.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"})})]})})]}),St=k.forwardRef(({className:e,type:t,...n},r)=>c.jsx("input",{type:t,className:pt("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}));St.displayName="Input";const Jl=k.forwardRef(({className:e,...t},n)=>c.jsx("textarea",{className:pt("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}));Jl.displayName="Textarea";const H4e="https://crm.realsavvy.com/api/form_submissions",$4e="eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiIwMTdkZTg1ZTVkNmYyN2U1ZWVlNDQ0MTkyYmQ2OWFlOWE1YWQ1NmZkMzk5ZWViYjhmZTk5ZWQ5NzE1YmY0NzBiIiwiYXVkIjoiZ2lkOi8vcmVhbC1zYXZ2eS9TaXRlLzE3NjEiLCJzdWIiOiJnaWQ6Ly9yZWFsLXNhdnZ5L1NpdGUvMTc2MSIsInNjb3BlcyI6WyJhZG1pbiJdfQ.o3UL0ih_XwYtfFKjMO1rkNX84RcRVpL11s-WY6zlH0bZAfxgofDa933-GmRS0JezLJyGPrER9PYRmKtgukPl4VYEW0xDaDdVGmHtvavX2iNiAlXQscNMieJtvXT0TszFgDDqk0tsCsx0v9JIdUrBVyPYa6Zneu3rdg_Gvu4ocRy-UsXntMtW9WBs_CPZcKoSxMWOZZjxj1vGWB9VceRg62puKNN_EsxWK26JDBqwPqM8HMRac6yaECH9nvjtgmMasmybtXVeIDVbjuXx3fOfbeDFrCix1rbSGgs1H5-U8hN7AHvJijxqrHgNoofPPz5PSp2MsB-4fV7iuFE4dFZEbQ",z4e="3qgHnU6N5RTJVQ";async function V4e(e){var s;const t=crypto.randomUUID(),n=new FormData;n.append("cyclum_vid",z4e),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(H4e,{method:"POST",headers:{Authorization:`Bearer ${$4e}`},body:n});if(!i.ok)throw new Error(`RealSavvy submission failed (${i.status})`)}const K4e="/assets/holden-brittany-BNfOpbGb.jpg",q4e=()=>{const{toast:e}=RA(),{configMap:t}=To(),[n,r]=k.useState(!1),[i,s]=k.useState({firstName:"",lastName:"",email:"",phone:"",message:"",interest:"buying"}),a=t.agent_phone,o=t.booking_url,l=async h=>{h.preventDefault(),r(!0);try{await V4e({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(f){console.error("Form submission error:",f),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 c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsx("title",{children:"Contact Holden Richardson | Grand Rapids Real Estate"}),c.jsx("meta",{name:"description",content:"Get in touch with Holden Richardson for buying, selling, or real estate consultation in the Grand Rapids area."}),c.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/contact"}),c.jsx("meta",{property:"og:title",content:"Contact Holden Richardson | Grand Rapids Real Estate"}),c.jsx("meta",{property:"og:description",content:"Get in touch with Holden Richardson for buying, selling, or real estate consultation in Grand Rapids."}),c.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/contact"}),c.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image.jpg"}),c.jsx("meta",{property:"og:type",content:"website"}),c.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),c.jsx("meta",{name:"twitter:title",content:"Contact Holden Richardson | Grand Rapids Real Estate"}),c.jsx("meta",{name:"twitter:description",content:"Get in touch with Holden Richardson for real estate in Grand Rapids."}),c.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image.jpg"}),c.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"]}]}})}),c.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"}]})})]}),c.jsx("section",{className:"bg-secondary pt-28 md:pt-32 pb-10 md:pb-14",children:c.jsxs("div",{className:"container-page",children:[c.jsx(ke,{children:c.jsxs("div",{className:"mb-8 md:mb-10",children:[c.jsx("p",{className:"text-caption text-muted-foreground mb-2",children:"Get in Touch"}),c.jsx("h1",{className:"font-serif text-2xl md:text-3xl font-light text-foreground",children:"Let's Start the Conversation"})]})}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-10 lg:gap-16 items-stretch",children:[c.jsx("div",{className:"flex items-center justify-center order-2 lg:order-1",children:c.jsx(ke,{variant:"scale",children:c.jsx("img",{src:K4e,alt:"Holden and Brittany Richardson",className:"w-full h-auto object-cover"})})}),c.jsx(ke,{delay:.1,className:"order-1 lg:order-2",children:c.jsxs("form",{onSubmit:l,className:"space-y-5 border border-border/60 p-6 md:p-8 bg-background shadow-sm",children:[c.jsx("h3",{className:"font-serif text-xl font-light mb-2",children:"Send a Message"}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx("label",{htmlFor:"firstName",className:"text-caption text-muted-foreground mb-1.5 block",children:"First Name *"}),c.jsx(St,{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"})]}),c.jsxs("div",{children:[c.jsx("label",{htmlFor:"lastName",className:"text-caption text-muted-foreground mb-1.5 block",children:"Last Name *"}),c.jsx(St,{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"})]})]}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx("label",{htmlFor:"email",className:"text-caption text-muted-foreground mb-1.5 block",children:"Email *"}),c.jsx(St,{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"})]}),c.jsxs("div",{children:[c.jsx("label",{htmlFor:"phone",className:"text-caption text-muted-foreground mb-1.5 block",children:"Phone"}),c.jsx(St,{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"})]})]}),c.jsxs("div",{children:[c.jsx("label",{htmlFor:"interest",className:"text-caption text-muted-foreground mb-1.5 block",children:"I'm Interested In"}),c.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:[c.jsx("option",{value:"buying",children:"Buying a Property"}),c.jsx("option",{value:"selling",children:"Selling a Property"}),c.jsx("option",{value:"both",children:"Both Buying and Selling"}),c.jsx("option",{value:"consultation",children:"General Consultation"})]})]}),c.jsxs("div",{children:[c.jsx("label",{htmlFor:"message",className:"text-caption text-muted-foreground mb-1.5 block",children:"Message"}),c.jsx(Jl,{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..."})]}),c.jsx("button",{type:"submit",className:"btn-outline-primary w-full disabled:opacity-50",disabled:n,children:n?"Sending...":"Send Message"})]})})]})]})}),c.jsx("section",{className:"py-10 md:py-14 bg-background",children:c.jsx("div",{className:"container-page",children:c.jsx(ke,{children:c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 max-w-3xl mx-auto",children:[a&&c.jsx("a",{href:`tel:${a}`,children:c.jsxs(Be,{size:"lg",className:"w-full bg-foreground text-background hover:bg-foreground/90 rounded-none font-semibold h-14 text-base",children:[c.jsx(gp,{className:"w-5 h-5 mr-2"}),"Call"]})}),d&&c.jsx("a",{href:d,children:c.jsxs(Be,{size:"lg",className:"w-full bg-foreground text-background hover:bg-foreground/90 rounded-none font-semibold h-14 text-base",children:[c.jsx(rA,{className:"w-5 h-5 mr-2"}),"Text"]})}),o&&c.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",children:c.jsxs(Be,{size:"lg",className:"w-full bg-foreground text-background hover:bg-foreground/90 rounded-none font-semibold h-14 text-base",children:[c.jsx(ll,{className:"w-5 h-5 mr-2"}),"Book Virtual Meeting"]})})]})})})})]})},W4e=[{icon:Are,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:e1e,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:_1e,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:ere,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."}],G4e=()=>(k.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)}},[]),c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsx("title",{children:"Home Valuation | What's Your Home Worth? | Holden Richardson"}),c.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."}),c.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/home-valuation"}),c.jsx("meta",{property:"og:title",content:"Home Valuation | What's Your Home Worth?"}),c.jsx("meta",{property:"og:description",content:"Get a free home valuation plus monthly market updates from Holden Richardson."}),c.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/home-valuation"}),c.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image.jpg"}),c.jsx("meta",{property:"og:type",content:"website"}),c.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),c.jsx("meta",{name:"twitter:title",content:"Home Valuation | What's Your Home Worth?"}),c.jsx("meta",{name:"twitter:description",content:"Get a free home valuation plus monthly market updates from Holden Richardson."}),c.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image.jpg"})]}),c.jsxs("section",{className:"relative -mt-20 pt-32 md:pt-40 pb-14 md:pb-20 bg-secondary overflow-hidden",children:[c.jsxs("div",{className:"absolute inset-0",children:[c.jsx("img",{src:Ac("stock_photo/1772747048679-xrqvfil905k.jpeg"),alt:"Grand Rapids home exterior",className:"w-full h-full object-cover"}),c.jsx("div",{className:"absolute inset-0 bg-black/40"})]}),c.jsxs("div",{className:"container-page text-center relative z-10",children:[c.jsx(ke,{children:c.jsx("p",{className:"text-caption text-white/70 mb-3",children:"Powered by Homebot"})}),c.jsx(ke,{delay:.1,children:c.jsx("h1",{className:"heading-section max-w-4xl mx-auto text-white",children:"What's Your Home Worth?"})}),c.jsx(ke,{delay:.2,children:c.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."})})]})]}),c.jsx("section",{className:"py-12 md:py-16 bg-background",children:c.jsx("div",{className:"container-page max-w-3xl",children:c.jsx("div",{id:"homebot_homeowner",className:"w-full min-h-[200px]"})})}),c.jsx("section",{className:"py-12 md:py-16 bg-secondary",children:c.jsxs("div",{className:"container-page",children:[c.jsx(ke,{children:c.jsxs("div",{className:"text-center mb-10",children:[c.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"Why Homebot?"}),c.jsx("h2",{className:"heading-section max-w-3xl mx-auto",children:"Your Home's Financial Dashboard — Free, Forever"}),c.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."})]})}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 md:gap-8",children:W4e.map((e,t)=>c.jsx(ke,{delay:t*.1,children:c.jsxs(ii.div,{className:"flex gap-5",whileHover:{x:4},transition:{duration:.3},children:[c.jsx("div",{className:"w-12 h-12 bg-accent/10 flex items-center justify-center shrink-0",children:c.jsx(e.icon,{size:22,className:"text-accent"})}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:e.title}),c.jsx("p",{className:"text-body text-muted-foreground text-sm leading-relaxed",children:e.description})]})]})},e.title))})]})})]}));var voe={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(f){var A=document.createEvent("Event");A.initEvent("pym:"+f,!0,!0),document.dispatchEvent(A)},i=function(f){var A=new RegExp("[\\?&]"+f.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]")+"=([^&#]*)"),p=A.exec(location.search);return p===null?"":decodeURIComponent(p[1].replace(/\+/g," "))},s=function(f,A){if(!(A.xdomain!=="*"&&!f.origin.match(new RegExp(A.xdomain+"$")))&&typeof f.data=="string")return!0},a=function(f){var A=/^(?:(?:https?|mailto|ftp):|[^&:/?#]*(?:[/?#]|$))/gi;if(f.match(A))return!0},o=function(f,A,p){var m=["pym",f,A,p];return m.join(t)},l=function(f){var A=["pym",f,"(\\S+)","(.*)"];return new RegExp("^"+A.join(t)+"$")},u=Date.now||function(){return new Date().getTime()},d=function(f,A,p){var m,g,y,v=null,x=0;p||(p={});var b=function(){x=p.leading===!1?0:u(),v=null,y=f.apply(m,g),v||(m=g=null)};return function(){var w=u();!x&&p.leading===!1&&(x=w);var S=A-(w-x);return m=this,g=arguments,S<=0||S>A?(v&&(clearTimeout(v),v=null),x=w,y=f.apply(m,g),v||(m=g=null)):!v&&p.trailing!==!1&&(v=setTimeout(b,S)),y}},h=function(){for(var f=n.autoInitInstances.length,A=f-1;A>=0;A--){var p=n.autoInitInstances[A];p.el.getElementsByTagName("iframe").length&&p.el.getElementsByTagName("iframe")[0].contentWindow||n.autoInitInstances.splice(A,1)}};return n.autoInitInstances=[],n.autoInit=function(f){var A=document.querySelectorAll("[data-pym-src]:not([data-pym-auto-initialized])"),p=A.length;h();for(var m=0;m<p;++m){var g=A[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 S=new n.Parent(g.id,y,x);n.autoInitInstances.push(S)}return f||r("pym-initialized"),n.autoInitInstances},n.Parent=function(f,A,p){this.id=f,this.url=A,this.el=document.getElementById(f),this.iframe=null,this.settings={xdomain:"*",optionalparams:!0,parenturlparam:"parentUrl",parenturlvalue:window.location.href,trackscroll:!1,scrollwait:100},this.messageRegex=l(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(f){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={},f=f||{},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 A=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 f)this.settings[p]=f[p];this.id=i("childId")||f.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)),A(f.onMarkedEmbeddedStatus),this},typeof document<"u"&&n.autoInit(!0),n})})(voe);var Y4e=voe.exports;const X4e=En(Y4e),Vx={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"}},L9={idxPath:"/",marketId:"2319",map:!0,query:{},suggestions:[],height:"100vh",idxRedirect:!0},xoe=(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"?xoe(s,i):`${encodeURIComponent(i)}=${encodeURIComponent(s)}`)}return n.join("&")},J4e=(e={})=>{const{path:t="/",marketId:n=L9.marketId,map:r=L9.map,query:i={},cycagt:s=null,vid:a=null,magicLink:o=null,magicAuth:l=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=Vx.clientId,h.font=Vx.style.mainFont,s&&(h._cycagt=s),a&&(h._vid=a),o&&(h.magic_link=o),l&&(h.magic_auth=l.replace(/ /g,"+")),typeof window<"u"&&window.matchMedia("(max-width: 768px)").matches&&(h.map=!1);let f=Vx.iframeDomain;/^https?:\/\//i.test(f)||(f=`https://${f}`),f=f.replace(/\/+$/,"");const A=xoe(h);return`${f}${Vx.idxPrefix}${t}${A?`?${A}`:""}`},Z4e=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 l=o.currentURL.split("?"),u=l[0],d=new URLSearchParams(l[1]||"");e&&d.set("_cycagt",e);const h=d.toString(),f=h===""?u:`${u}?${h}`;window.history.replaceState(o,document.title,`${Vx.idxRedirectPath}${f}`)}}}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)},eOe=(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},Pr=()=>{const e=k.useRef(null),t=jo();return k.useEffect(()=>{const n=new URLSearchParams(t.search),r=n.get("_cycagt"),i=n.get("_vid"),s=n.get("magic_link"),a=eOe(t.search,"magic_auth")??n.get("magic_auth");r&&localStorage.setItem("cycagt",r),i&&localStorage.setItem("_vid",i);const o=localStorage.getItem("cycagt"),l=localStorage.getItem("_vid"),u=Z4e(o),d=t.pathname.startsWith("/idx")?t.pathname.replace(/^\/idx/,"")||"/":t.pathname,h=J4e({path:d,cycagt:o,vid:l,magicLink:s,magicAuth:a});e.current=new X4e.Parent("idx-frame",h,{});const f=()=>{var g;const A=document.querySelector("header"),p=(A==null?void 0:A.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 f(),window.addEventListener("resize",f),()=>{u(),window.removeEventListener("resize",f)}},[t.pathname,t.search]),c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsxs(ur,{children:[c.jsx("title",{children:"Home Search | Grand Rapids Homes | Holden Richardson"}),c.jsx("meta",{name:"description",content:"Search homes for sale in Grand Rapids, East Grand Rapids, Ada, and West Michigan with Holden Richardson."}),c.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/idx"}),c.jsx("meta",{property:"og:title",content:"Home Search | Grand Rapids Homes for Sale"}),c.jsx("meta",{property:"og:description",content:"Search homes for sale in Grand Rapids and West Michigan with Holden Richardson."}),c.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/idx"}),c.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image.jpg"}),c.jsx("meta",{property:"og:type",content:"website"})]}),c.jsx(mj,{}),c.jsxs("main",{className:"flex-1 pt-[80px]",children:[c.jsx("div",{id:"idx-frame",className:"w-full [&>iframe]:w-full [&>iframe]:border-0"}),c.jsxs("div",{className:"text-center py-3 text-xs text-muted-foreground",children:["Powered by"," ",c.jsx("a",{href:"https://www.realsavvy.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"RealSavvy"})]})]})]})};var tOe="Label",woe=k.forwardRef((e,t)=>c.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())}}));woe.displayName=tOe;var boe=woe;const nOe=GN("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Sn=k.forwardRef(({className:e,...t},n)=>c.jsx(boe,{ref:n,className:pt(nOe(),e),...t}));Sn.displayName=boe.displayName;const vr=k.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:pt("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));vr.displayName="Card";const La=k.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:pt("flex flex-col space-y-1.5 p-6",e),...t}));La.displayName="CardHeader";const Ra=k.forwardRef(({className:e,...t},n)=>c.jsx("h3",{ref:n,className:pt("text-2xl font-semibold leading-none tracking-tight",e),...t}));Ra.displayName="CardTitle";const Ay=k.forwardRef(({className:e,...t},n)=>c.jsx("p",{ref:n,className:pt("text-sm text-muted-foreground",e),...t}));Ay.displayName="CardDescription";const xr=k.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:pt("p-6 pt-0",e),...t}));xr.displayName="CardContent";const rOe=k.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:pt("flex items-center p-6 pt-0",e),...t}));rOe.displayName="CardFooter";function Sj(){const[e,t]=k.useState(null),[n,r]=k.useState(null),[i,s]=k.useState(!0),[a,o]=k.useState(!1);return k.useEffect(()=>{const h=async A=>{const{data:p}=await Me.from("user_roles").select("role").eq("user_id",A).eq("role","admin").maybeSingle();o(!!p)},{data:{subscription:f}}=Me.auth.onAuthStateChange((A,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:A}})=>{r(A),t((A==null?void 0:A.user)??null),A!=null&&A.user?h(A.user.id).then(()=>s(!1)):s(!1)}),()=>f.unsubscribe()},[]),{user:e,session:n,isLoading:i,isAdmin:a,signIn:async(h,f)=>{const{error:A}=await Me.auth.signInWithPassword({email:h,password:f});return{error:A}},signUp:async(h,f)=>{const{error:A}=await Me.auth.signUp({email:h,password:f,options:{emailRedirectTo:window.location.origin}});return{error:A}},signOut:async()=>{await Me.auth.signOut(),t(null),r(null),o(!1)}}}const iOe=()=>{const e=Sd(),{toast:t}=RA(),{user:n,isLoading:r,isAdmin:i,signIn:s,signUp:a}=Sj(),[o,l]=k.useState("signin"),[u,d]=k.useState(""),[h,f]=k.useState(""),[A,p]=k.useState(""),[m,g]=k.useState(""),[y,v]=k.useState(""),[x,b]=k.useState(""),[w,S]=k.useState(!1),[_,E]=k.useState(!1);k.useEffect(()=>{!r&&n&&i&&e("/admin/blog")},[n,r,i,e]);const j=async N=>{N.preventDefault(),S(!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."}),S(!1)},I=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}S(!0);const{error:F}=await a(A,m);t(F?{variant:"destructive",title:"Registration failed",description:F.message}:{title:"Registration successful!",description:"Please check your email to verify your account."}),S(!1)},T=async N=>{N.preventDefault(),S(!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}):(E(!0),t({title:"Check your email",description:"A password reset link has been sent to your email."})),S(!1)};return r?c.jsx(xn,{children:c.jsx("div",{className:"min-h-[60vh] flex items-center justify-center",children:c.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading..."})})}):c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsx("title",{children:"Sign In | Holden Richardson | 616 Realty"}),c.jsx("meta",{name:"description",content:"Sign in to access your account."}),c.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),c.jsx("div",{className:"section-padding",children:c.jsx("div",{className:"container-page max-w-md",children:c.jsxs(vr,{className:"border-border",children:[c.jsxs(La,{className:"text-center",children:[c.jsx(Ra,{className:"heading-card",children:"Welcome"}),c.jsx(Ay,{children:o==="forgot"?"Reset your password":"Sign in to access the admin dashboard"})]}),c.jsx(xr,{children:o==="forgot"?c.jsx("div",{className:"space-y-4",children:_?c.jsxs("div",{className:"text-center space-y-4",children:[c.jsx("p",{className:"text-muted-foreground",children:"Check your email for a password reset link."}),c.jsx(Be,{variant:"outline",className:"w-full",onClick:()=>{l("signin"),E(!1)},children:"Back to Sign In"})]}):c.jsxs("form",{onSubmit:T,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{htmlFor:"forgot-email",children:"Email"}),c.jsx(St,{id:"forgot-email",type:"email",placeholder:"you@example.com",value:x,onChange:N=>b(N.target.value),required:!0})]}),c.jsx(Be,{type:"submit",className:"w-full",disabled:w,children:w?"Sending…":"Send Reset Link"}),c.jsx(Be,{type:"button",variant:"ghost",className:"w-full",onClick:()=>l("signin"),children:"Back to Sign In"})]})}):c.jsxs(v2,{value:o,onValueChange:N=>l(N),className:"w-full",children:[c.jsxs(rv,{className:"grid w-full grid-cols-2",children:[c.jsx(si,{value:"signin",children:"Sign In"}),c.jsx(si,{value:"signup",children:"Sign Up"})]}),c.jsx(ai,{value:"signin",className:"mt-6",children:c.jsxs("form",{onSubmit:j,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{htmlFor:"login-email",children:"Email"}),c.jsx(St,{id:"login-email",type:"email",placeholder:"you@example.com",value:u,onChange:N=>d(N.target.value),required:!0})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{htmlFor:"login-password",children:"Password"}),c.jsx(St,{id:"login-password",type:"password",placeholder:"••••••••",value:h,onChange:N=>f(N.target.value),required:!0})]}),c.jsx(Be,{type:"submit",className:"w-full",disabled:w,children:w?"Signing in…":"Sign In"}),c.jsx(Be,{type:"button",variant:"link",className:"w-full text-sm",onClick:()=>l("forgot"),children:"Forgot password?"})]})}),c.jsx(ai,{value:"signup",className:"mt-6",children:c.jsxs("form",{onSubmit:I,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{htmlFor:"register-email",children:"Email"}),c.jsx(St,{id:"register-email",type:"email",placeholder:"you@example.com",value:A,onChange:N=>p(N.target.value),required:!0})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{htmlFor:"register-password",children:"Password"}),c.jsx(St,{id:"register-password",type:"password",placeholder:"••••••••",value:m,onChange:N=>g(N.target.value),required:!0})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{htmlFor:"confirm-password",children:"Confirm Password"}),c.jsx(St,{id:"confirm-password",type:"password",placeholder:"••••••••",value:y,onChange:N=>v(N.target.value),required:!0})]}),c.jsx(Be,{type:"submit",className:"w-full",disabled:w,children:w?"Creating account…":"Create Account"})]})})]})})]})})})]})};function sOe(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 Coe(){return dr({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 Soe(e,t){if(!e||e.length===0)return null;const n=sOe(t)%e.length;return e[n]}const aOe=({post:e,fallbackPool:t})=>{const n=Soe(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 c.jsx(Ct,{to:`/blog/${e.slug}`,className:"group block mb-16",children:c.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&&c.jsx("div",{className:"aspect-[16/10] md:aspect-auto md:h-full overflow-hidden bg-secondary",children:c.jsx("img",{src:r,alt:i,className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-105",loading:"eager"})}),c.jsxs("div",{className:"p-6 md:p-10 flex flex-col justify-center",children:[c.jsx("p",{className:"text-[10px] uppercase tracking-[0.25em] text-gold mb-4 font-medium",children:"Featured"}),c.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs uppercase tracking-wider text-muted-foreground mb-4",children:[e.category&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(XN,{className:"w-3 h-3"}),e.category]}),s&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(ll,{className:"w-3 h-3"}),s]})]}),c.jsx("h2",{className:"heading-section mb-4 group-hover:text-accent transition-colors",children:e.title}),e.excerpt&&c.jsx("p",{className:"text-body text-muted-foreground line-clamp-3 mb-6",children:e.excerpt}),c.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",c.jsx(Ma,{size:14,className:"group-hover:translate-x-1 transition-transform"})]})]})]})})},oOe=({categories:e,active:t,onChange:n})=>{const r=k.useMemo(()=>[...e].sort((i,s)=>i.localeCompare(s)),[e]);return r.length===0?null:c.jsxs("div",{className:"flex flex-wrap gap-2 mb-10",children:[c.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=>c.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))]})},lOe=({post:e,fallbackPool:t})=>{const n=Soe(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 c.jsx(ke,{children:c.jsx(Ct,{to:`/blog/${e.slug}`,className:"group block h-full",children:c.jsxs("article",{className:"border border-border bg-card overflow-hidden transition-all duration-500 hover:shadow-lg h-full flex flex-col",children:[r&&c.jsx("div",{className:"aspect-[16/10] overflow-hidden bg-secondary",children:c.jsx("img",{src:r,alt:i,className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-105",loading:"lazy"})}),c.jsxs("div",{className:"p-6 md:p-7 flex-1 flex flex-col",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs uppercase tracking-wider text-muted-foreground mb-3",children:[e.category&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(XN,{className:"w-3 h-3"}),e.category]}),s&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(ll,{className:"w-3 h-3"}),s]}),e.author&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(UU,{className:"w-3 h-3"}),e.author]})]}),c.jsx("h2",{className:"heading-card mb-3 group-hover:text-accent transition-colors",children:e.title}),e.excerpt&&c.jsx("p",{className:"text-body text-muted-foreground line-clamp-3",children:e.excerpt}),c.jsx("div",{className:"mt-auto pt-5",children:c.jsx("span",{className:"text-caption text-foreground group-hover:text-accent transition-colors",children:"Read More →"})})]})]})})})},cOe=()=>c.jsxs("div",{className:"border border-border bg-card overflow-hidden",children:[c.jsx(Tt,{className:"aspect-[16/10] w-full"}),c.jsxs("div",{className:"p-6 md:p-7 space-y-4",children:[c.jsxs("div",{className:"flex gap-4",children:[c.jsx(Tt,{className:"h-4 w-20"}),c.jsx(Tt,{className:"h-4 w-24"})]}),c.jsx(Tt,{className:"h-8 w-3/4"}),c.jsx(Tt,{className:"h-16 w-full"}),c.jsx(Tt,{className:"h-4 w-24"})]})]}),uOe=()=>{const{data:e,isLoading:t,error:n}=Oae(),{data:r}=Coe(),[i,s]=k.useState(null),a=k.useMemo(()=>{if(!e)return[];const h=new Set;return e.forEach(f=>f.category&&h.add(f.category)),Array.from(h)},[e]),o=e==null?void 0:e[0],l=(e==null?void 0:e.slice(1))||[],u=i?l.filter(h=>h.category===i):l,d=i?(e==null?void 0:e.filter(h=>h.category===i))||[]:u;return c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsx("title",{children:"Blog | Grand Rapids Real Estate Insights | Holden Richardson"}),c.jsx("meta",{name:"description",content:"Real estate insights, market trends, and expert tips from Holden Richardson — Grand Rapids Realtor at 616 Realty LLC."}),c.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/blog"}),c.jsx("meta",{property:"og:title",content:"Blog | Grand Rapids Real Estate Insights"}),c.jsx("meta",{property:"og:description",content:"Real estate insights, market trends, and tips from Holden Richardson."}),c.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/blog"}),c.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image.jpg"}),c.jsx("meta",{property:"og:type",content:"website"}),c.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),c.jsx("meta",{name:"twitter:title",content:"Blog | Grand Rapids Real Estate Insights"}),c.jsx("meta",{name:"twitter:description",content:"Real estate insights, market trends, and tips from Holden Richardson."}),c.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image.jpg"}),c.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&&c.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,f)=>({"@type":"ListItem",position:f+1,url:`https://www.holdengr.com/blog/${h.slug}`,name:h.title}))}})})]}),c.jsx("section",{className:"bg-secondary -mt-20 pt-32 md:pt-40 pb-16 md:pb-20",children:c.jsx("div",{className:"container-page text-center max-w-3xl",children:c.jsxs(ke,{children:[c.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"Insights & Updates"}),c.jsx("h1",{className:"heading-display mb-6",children:"The Blog"}),c.jsx("p",{className:"text-body text-muted-foreground",children:"Stay informed with the latest real estate trends, market insights, and expert advice from Holden and the team."})]})})}),c.jsx("section",{className:"section-padding bg-background",children:c.jsxs("div",{className:"container-page",children:[n&&c.jsx("div",{className:"text-center py-12",children:c.jsx("p",{className:"text-destructive",children:"Failed to load posts. Please try again later."})}),t&&c.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:[...Array(6)].map((h,f)=>c.jsx(cOe,{},f))}),!t&&e&&e.length===0&&c.jsx("div",{className:"text-center py-12",children:c.jsx("p",{className:"text-muted-foreground",children:"No posts published yet. Check back soon!"})}),!t&&e&&e.length>0&&c.jsxs(c.Fragment,{children:[!i&&o&&c.jsx(aOe,{post:o,fallbackPool:r}),a.length>0&&c.jsx(oOe,{categories:a,active:i,onChange:s}),d.length===0&&c.jsx("p",{className:"text-center py-8 text-muted-foreground",children:"No posts in this category yet."}),c.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:d.map(h=>c.jsx(lOe,{post:h,fallbackPool:r},h.id))})]})]})})]})},dOe=()=>{const{slug:e}=om(),{data:t,isLoading:n,error:r}=EIe(e||"");if(Coe(),n)return c.jsx(xn,{children:c.jsx("div",{className:"section-padding",children:c.jsxs("div",{className:"container-page max-w-4xl",children:[c.jsx(Tt,{className:"h-8 w-32 mb-8"}),c.jsx(Tt,{className:"h-12 w-3/4 mb-4"}),c.jsxs("div",{className:"flex gap-4 mb-8",children:[c.jsx(Tt,{className:"h-4 w-24"}),c.jsx(Tt,{className:"h-4 w-24"})]}),c.jsx(Tt,{className:"aspect-[16/9] w-full mb-8"}),c.jsxs("div",{className:"space-y-4",children:[c.jsx(Tt,{className:"h-4 w-full"}),c.jsx(Tt,{className:"h-4 w-full"}),c.jsx(Tt,{className:"h-4 w-3/4"})]})]})})});if(r||!t)return c.jsxs(xn,{children:[c.jsx(ur,{children:c.jsx("title",{children:"Post Not Found | Holden Richardson"})}),c.jsx("div",{className:"section-padding",children:c.jsxs("div",{className:"container-page text-center",children:[c.jsx("h1",{className:"heading-section mb-4",children:"Post Not Found"}),c.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."}),c.jsx(Ct,{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 c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsxs("title",{children:[t.meta_title||t.title," | Holden Richardson"]}),c.jsx("meta",{name:"description",content:t.meta_description||t.excerpt||""}),c.jsx("link",{rel:"canonical",href:`https://www.holdengr.com/blog/${e}`}),c.jsx("meta",{property:"og:image",content:t.featured_image||"https://www.holdengr.com/og-image.jpg"}),c.jsx("meta",{property:"og:title",content:t.meta_title||t.title}),c.jsx("meta",{property:"og:description",content:t.meta_description||t.excerpt||""}),c.jsx("meta",{property:"og:url",content:`https://www.holdengr.com/blog/${e}`}),c.jsx("meta",{property:"og:type",content:"article"}),c.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),c.jsx("meta",{name:"twitter:title",content:t.meta_title||t.title}),c.jsx("meta",{name:"twitter:description",content:t.meta_description||t.excerpt||""}),c.jsx("meta",{name:"twitter:image",content:t.featured_image||"https://www.holdengr.com/og-image.jpg"}),c.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"})})]}),c.jsx("article",{className:"section-padding",children:c.jsxs("div",{className:"container-page max-w-4xl",children:[c.jsx(ke,{children:c.jsxs(Ct,{to:"/blog",className:"inline-flex items-center gap-2 text-caption text-muted-foreground hover:text-foreground transition-colors mb-8",children:[c.jsx(l2,{className:"w-4 h-4"}),"Back to Blog"]})}),c.jsx(ke,{children:c.jsxs("header",{className:"mb-8",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-xs uppercase tracking-wider text-muted-foreground mb-4",children:[t.category&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(XN,{className:"w-3 h-3"}),t.category]}),i&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(ll,{className:"w-3 h-3"}),i]}),t.author&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(UU,{className:"w-3 h-3"}),t.author]})]}),c.jsx("h1",{className:"heading-section",children:t.title})]})}),t.featured_image&&c.jsx(ke,{children:c.jsx("div",{className:"aspect-[16/9] overflow-hidden mb-8",children:c.jsx("img",{src:t.featured_image,alt:t.title,className:"w-full h-full object-cover",loading:"lazy"})})}),c.jsx(ke,{children:c.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&&c.jsx(ke,{children:c.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:c.jsx("div",{className:"flex flex-wrap gap-2",children:t.tags.map(s=>c.jsx("span",{className:"px-3 py-1 text-xs uppercase tracking-wider bg-secondary text-muted-foreground",children:s},s))})})})]})})]})};function hOe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const AOe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fOe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pOe={};function R9(e,t){return(pOe.jsx?fOe:AOe).test(e)}const mOe=/[ \t\n\f\r]/g;function gOe(e){return typeof e=="object"?e.type==="text"?U9(e.value):!1:U9(e)}function U9(e){return e.replace(mOe,"")===""}let x2=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};x2.prototype.normal={};x2.prototype.property={};x2.prototype.space=void 0;function koe(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new x2(n,r,t)}function EF(e){return e.toLowerCase()}class Ga{constructor(t,n){this.attribute=n,this.property=t}}Ga.prototype.attribute="";Ga.prototype.booleanish=!1;Ga.prototype.boolean=!1;Ga.prototype.commaOrSpaceSeparated=!1;Ga.prototype.commaSeparated=!1;Ga.prototype.defined=!1;Ga.prototype.mustUseProperty=!1;Ga.prototype.number=!1;Ga.prototype.overloadedBoolean=!1;Ga.prototype.property="";Ga.prototype.spaceSeparated=!1;Ga.prototype.space=void 0;let yOe=0;const an=lm(),gi=lm(),NF=lm(),qe=lm(),sr=lm(),fy=lm(),lo=lm();function lm(){return 2**++yOe}const jF=Object.freeze(Object.defineProperty({__proto__:null,boolean:an,booleanish:gi,commaOrSpaceSeparated:lo,commaSeparated:fy,number:qe,overloadedBoolean:NF,spaceSeparated:sr},Symbol.toStringTag,{value:"Module"})),XP=Object.keys(jF);class s6 extends Ga{constructor(t,n,r,i){let s=-1;if(super(t,n),D9(this,"space",i),typeof r=="number")for(;++s<XP.length;){const a=XP[s];D9(this,XP[s],(r&jF[a])===jF[a])}}}s6.prototype.defined=!0;function D9(e,t,n){n&&(e[t]=n)}function sv(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[EF(r)]=r,n[EF(s.attribute)]=r}return new x2(t,n,e.space)}const Boe=sv({properties:{ariaActiveDescendant:null,ariaAtomic:gi,ariaAutoComplete:null,ariaBusy:gi,ariaChecked:gi,ariaColCount:qe,ariaColIndex:qe,ariaColSpan:qe,ariaControls:sr,ariaCurrent:null,ariaDescribedBy:sr,ariaDetails:null,ariaDisabled:gi,ariaDropEffect:sr,ariaErrorMessage:null,ariaExpanded:gi,ariaFlowTo:sr,ariaGrabbed:gi,ariaHasPopup:null,ariaHidden:gi,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:sr,ariaLevel:qe,ariaLive:null,ariaModal:gi,ariaMultiLine:gi,ariaMultiSelectable:gi,ariaOrientation:null,ariaOwns:sr,ariaPlaceholder:null,ariaPosInSet:qe,ariaPressed:gi,ariaReadOnly:gi,ariaRelevant:null,ariaRequired:gi,ariaRoleDescription:sr,ariaRowCount:qe,ariaRowIndex:qe,ariaRowSpan:qe,ariaSelected:gi,ariaSetSize:qe,ariaSort:null,ariaValueMax:qe,ariaValueMin:qe,ariaValueNow:qe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function _oe(e,t){return t in e?e[t]:t}function Eoe(e,t){return _oe(e,t.toLowerCase())}const vOe=sv({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fy,acceptCharset:sr,accessKey:sr,action:null,allow:null,allowFullScreen:an,allowPaymentRequest:an,allowUserMedia:an,alt:null,as:null,async:an,autoCapitalize:null,autoComplete:sr,autoFocus:an,autoPlay:an,blocking:sr,capture:null,charSet:null,checked:an,cite:null,className:sr,cols:qe,colSpan:null,content:null,contentEditable:gi,controls:an,controlsList:sr,coords:qe|fy,crossOrigin:null,data:null,dateTime:null,decoding:null,default:an,defer:an,dir:null,dirName:null,disabled:an,download:NF,draggable:gi,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:an,formTarget:null,headers:sr,height:qe,hidden:NF,high:qe,href:null,hrefLang:null,htmlFor:sr,httpEquiv:sr,id:null,imageSizes:null,imageSrcSet:null,inert:an,inputMode:null,integrity:null,is:null,isMap:an,itemId:null,itemProp:sr,itemRef:sr,itemScope:an,itemType:sr,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:an,low:qe,manifest:null,max:null,maxLength:qe,media:null,method:null,min:null,minLength:qe,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:qe,pattern:null,ping:sr,placeholder:null,playsInline:an,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:an,referrerPolicy:null,rel:sr,required:an,reversed:an,rows:qe,rowSpan:qe,sandbox:sr,scope:null,scoped:an,seamless:an,selected:an,shadowRootClonable:an,shadowRootDelegatesFocus:an,shadowRootMode:null,shape:null,size:qe,sizes:null,slot:null,span:qe,spellCheck:gi,src:null,srcDoc:null,srcLang:null,srcSet:null,start:qe,step:null,style:null,tabIndex:qe,target:null,title:null,translate:null,type:null,typeMustMatch:an,useMap:null,value:gi,width:qe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:sr,axis:null,background:null,bgColor:null,border:qe,borderColor:null,bottomMargin:qe,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:qe,leftMargin:qe,link:null,longDesc:null,lowSrc:null,marginHeight:qe,marginWidth:qe,noResize:an,noHref:an,noShade:an,noWrap:an,object:null,profile:null,prompt:null,rev:null,rightMargin:qe,rules:null,scheme:null,scrolling:gi,standby:null,summary:null,text:null,topMargin:qe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:qe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:an,disableRemotePlayback:an,prefix:null,property:null,results:qe,security:null,unselectable:null},space:"html",transform:Eoe}),xOe=sv({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:lo,accentHeight:qe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:qe,amplitude:qe,arabicForm:null,ascent:qe,attributeName:null,attributeType:null,azimuth:qe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:qe,by:null,calcMode:null,capHeight:qe,className:sr,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:qe,diffuseConstant:qe,direction:null,display:null,dur:null,divisor:qe,dominantBaseline:null,download:an,dx:null,dy:null,edgeMode:null,editable:null,elevation:qe,enableBackground:null,end:null,event:null,exponent:qe,externalResourcesRequired:null,fill:null,fillOpacity:qe,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:fy,g2:fy,glyphName:fy,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:qe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:qe,horizOriginX:qe,horizOriginY:qe,id:null,ideographic:qe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:qe,k:qe,k1:qe,k2:qe,k3:qe,k4:qe,kernelMatrix:lo,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:qe,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:qe,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:qe,overlineThickness:qe,paintOrder:null,panose1:null,path:null,pathLength:qe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:sr,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:qe,pointsAtY:qe,pointsAtZ:qe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:lo,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:lo,rev:lo,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:lo,requiredFeatures:lo,requiredFonts:lo,requiredFormats:lo,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:qe,specularExponent:qe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:qe,strikethroughThickness:qe,string:null,stroke:null,strokeDashArray:lo,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:qe,strokeOpacity:qe,strokeWidth:null,style:null,surfaceScale:qe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:lo,tabIndex:qe,tableValues:null,target:null,targetX:qe,targetY:qe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:lo,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:qe,underlineThickness:qe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:qe,values:null,vAlphabetic:qe,vMathematical:qe,vectorEffect:null,vHanging:qe,vIdeographic:qe,version:null,vertAdvY:qe,vertOriginX:qe,vertOriginY:qe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:qe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:_oe}),Noe=sv({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()}}),joe=sv({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Eoe}),Toe=sv({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),wOe={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"},bOe=/[A-Z]/g,Q9=/-[a-z]/g,COe=/^data[-\w.:]+$/i;function SOe(e,t){const n=EF(t);let r=t,i=Ga;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&COe.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Q9,BOe);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Q9.test(s)){let a=s.replace(bOe,kOe);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=s6}return new i(r,t)}function kOe(e){return"-"+e.toLowerCase()}function BOe(e){return e.charAt(1).toUpperCase()}const _Oe=koe([Boe,vOe,Noe,joe,Toe],"html"),a6=koe([Boe,xOe,Noe,joe,Toe],"svg");function EOe(e){return e.join(" ").trim()}var o6={},H9=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,NOe=/\n/g,jOe=/^\s*/,TOe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,POe=/^:\s*/,IOe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,OOe=/^[;\s]*/,FOe=/^\s+|\s+$/g,MOe=`
`,$9="/",z9="*",Lf="",LOe="comment",ROe="declaration";function UOe(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(NOe);m&&(n+=m.length);var g=p.lastIndexOf(MOe);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 l(p){var m=p.exec(e);if(m){var g=m[0];return i(g),e=e.slice(g.length),m}}function u(){l(jOe)}function d(p){var m;for(p=p||[];m=h();)m!==!1&&p.push(m);return p}function h(){var p=s();if(!($9!=e.charAt(0)||z9!=e.charAt(1))){for(var m=2;Lf!=e.charAt(m)&&(z9!=e.charAt(m)||$9!=e.charAt(m+1));)++m;if(m+=2,Lf===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:LOe,comment:g})}}function f(){var p=s(),m=l(TOe);if(m){if(h(),!l(POe))return o("property missing ':'");var g=l(IOe),y=p({type:ROe,property:V9(m[0].replace(H9,Lf)),value:g?V9(g[0].replace(H9,Lf)):Lf});return l(OOe),y}}function A(){var p=[];d(p);for(var m;m=f();)m!==!1&&(p.push(m),d(p));return p}return u(),A()}function V9(e){return e?e.replace(FOe,Lf):Lf}var DOe=UOe,QOe=Fh&&Fh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o6,"__esModule",{value:!0});o6.default=$Oe;const HOe=QOe(DOe);function $Oe(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,HOe.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 kj={};Object.defineProperty(kj,"__esModule",{value:!0});kj.camelCase=void 0;var zOe=/^--[a-zA-Z0-9_-]+$/,VOe=/-([a-z])/g,KOe=/^[^-]+$/,qOe=/^-(webkit|moz|ms|o|khtml)-/,WOe=/^-(ms)-/,GOe=function(e){return!e||KOe.test(e)||zOe.test(e)},YOe=function(e,t){return t.toUpperCase()},K9=function(e,t){return"".concat(t,"-")},XOe=function(e,t){return t===void 0&&(t={}),GOe(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(WOe,K9):e=e.replace(qOe,K9),e.replace(VOe,YOe))};kj.camelCase=XOe;var JOe=Fh&&Fh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ZOe=JOe(o6),e3e=kj;function TF(e,t){var n={};return!e||typeof e!="string"||(0,ZOe.default)(e,function(r,i){r&&i&&(n[(0,e3e.camelCase)(r,t)]=i)}),n}TF.default=TF;var t3e=TF;const n3e=En(t3e),Poe=Ioe("end"),l6=Ioe("start");function Ioe(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 r3e(e){const t=l6(e),n=Poe(e);if(t&&n)return{start:t,end:n}}function kw(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?q9(e.position):"start"in e||"end"in e?q9(e):"line"in e||"column"in e?PF(e):""}function PF(e){return W9(e&&e.line)+":"+W9(e&&e.column)}function q9(e){return PF(e&&e.start)+"-"+PF(e&&e.end)}function W9(e){return e&&typeof e=="number"?e:1}class Ws 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 l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.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=kw(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}}Ws.prototype.file="";Ws.prototype.name="";Ws.prototype.reason="";Ws.prototype.message="";Ws.prototype.stack="";Ws.prototype.column=void 0;Ws.prototype.line=void 0;Ws.prototype.ancestors=void 0;Ws.prototype.cause=void 0;Ws.prototype.fatal=void 0;Ws.prototype.place=void 0;Ws.prototype.ruleId=void 0;Ws.prototype.source=void 0;const c6={}.hasOwnProperty,i3e=new Map,s3e=/[A-Z]/g,a3e=new Set(["table","tbody","thead","tfoot","tr"]),o3e=new Set(["td","th"]),Ooe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function l3e(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=m3e(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=p3e(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"?a6:_Oe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=Foe(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function Foe(e,t,n){if(t.type==="element")return c3e(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return u3e(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return h3e(e,t,n);if(t.type==="mdxjsEsm")return d3e(e,t);if(t.type==="root")return A3e(e,t,n);if(t.type==="text")return f3e(e,t)}function c3e(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=a6,e.schema=i),e.ancestors.push(t);const s=Loe(e,t.tagName,!1),a=g3e(e,t);let o=d6(e,t);return a3e.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!gOe(l):!0})),Moe(e,a,s,t),u6(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function u3e(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)}Ub(e,t.position)}function d3e(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ub(e,t.position)}function h3e(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=a6,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Loe(e,t.name,!0),a=y3e(e,t),o=d6(e,t);return Moe(e,a,s,t),u6(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function A3e(e,t,n){const r={};return u6(r,d6(e,t)),e.create(t,e.Fragment,r,n)}function f3e(e,t){return t.value}function Moe(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function u6(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function p3e(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 m3e(e,t){return n;function n(r,i,s,a){const o=Array.isArray(s.children),l=l6(r);return t(i,s,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function g3e(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&c6.call(t.properties,i)){const s=v3e(e,i,t.properties[i]);if(s){const[a,o]=s;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&o3e.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 y3e(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 Ub(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 Ub(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function d6(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:i3e;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const u=i.get(l)||0;a=l+"-"+u,i.set(l,u+1)}}const o=Foe(e,s,a);o!==void 0&&n.push(o)}return n}function v3e(e,t,n){const r=SOe(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?hOe(n):EOe(n)),r.property==="style"){let i=typeof n=="object"?n:x3e(e,String(n));return e.stylePropertyNameCase==="css"&&(i=w3e(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?wOe[r.property]||r.property:r.attribute,n]}}function x3e(e,t){try{return n3e(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Ws("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=Ooe+"#cannot-parse-style-attribute",i}}function Loe(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=R9(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=R9(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return c6.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ub(e)}function Ub(e,t){const n=new Ws("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=Ooe+"#cannot-handle-mdx-estrees-without-createevaluater",n}function w3e(e){const t={};let n;for(n in e)c6.call(e,n)&&(t[b3e(n)]=e[n]);return t}function b3e(e){let t=e.replace(s3e,C3e);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function C3e(e){return"-"+e.toLowerCase()}const JP={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"]},S3e={};function h6(e,t){const n=S3e,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Roe(e,r,i)}function Roe(e,t,n){if(k3e(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 G9(e.children,t,n)}return Array.isArray(e)?G9(e,t,n):""}function G9(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Roe(e[i],t,n);return r.join("")}function k3e(e){return!!(e&&typeof e=="object")}const Y9=document.createElement("i");function A6(e){const t="&"+e+";";Y9.innerHTML=t;const n=Y9.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function So(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 Jo(e,t){return e.length>0?(So(e,e.length,0,t),e):t}const X9={}.hasOwnProperty;function Uoe(e){const t={};let n=-1;for(;++n<e.length;)B3e(t,e[n]);return t}function B3e(e,t){let n;for(n in t){const i=(X9.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){X9.call(i,a)||(i[a]=[]);const o=s[a];_3e(i[a],Array.isArray(o)?o:o?[o]:[])}}}function _3e(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);So(e,0,0,r)}function Doe(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 lc(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const la=QA(/[A-Za-z]/),$s=QA(/[\dA-Za-z]/),E3e=QA(/[#-'*+\--9=?A-Z^-~]/);function d_(e){return e!==null&&(e<32||e===127)}const IF=QA(/\d/),N3e=QA(/[\dA-Fa-f]/),j3e=QA(/[!-/:-@[-`{-~]/);function Rt(e){return e!==null&&e<-2}function Zn(e){return e!==null&&(e<0||e===32)}function hn(e){return e===-2||e===-1||e===32}const Bj=QA(new RegExp("\\p{P}|\\p{S}","u")),Hp=QA(/\s/);function QA(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function av(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&$s(e.charCodeAt(n+1))&&$s(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 Bn(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(l){return hn(l)?(e.enter(n),o(l)):t(l)}function o(l){return hn(l)&&s++<i?(e.consume(l),o):(e.exit(n),t(l))}}const T3e={tokenize:P3e};function P3e(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"),Bn(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),s(o)}function s(o){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return Rt(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),a)}}const I3e={tokenize:O3e},J9={tokenize:F3e};function O3e(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,l,u)(x)}return u(x)}function l(x){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const b=t.events.length;let w=b,S;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){S=t.events[w][1].end;break}y(r);let _=b;for(;_<t.events.length;)t.events[_][1].end={...S},_++;return So(t.events,w+1,0,t.events.slice(b)),t.events.length=_,u(x)}return o(x)}function u(x){if(r===n.length){if(!i)return f(x);if(i.currentConstruct&&i.currentConstruct.concrete)return p(x);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(J9,d,h)(x)}function d(x){return i&&v(),y(r),f(x)}function h(x){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,p(x)}function f(x){return t.containerState={},e.attempt(J9,A,p)(x)}function A(x){return r++,n.push([t.currentConstruct,t.containerState]),f(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 Rt(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 S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<a&&(!i.events[S][1].end||i.events[S][1].end.offset>a))return;const _=t.events.length;let E=_,j,I;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){if(j){I=t.events[E][1].end;break}j=!0}for(y(r),S=_;S<t.events.length;)t.events[S][1].end={...I},S++;So(t.events,E+1,0,t.events.slice(_)),t.events.length=S}}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 F3e(e,t,n){return Bn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function n0(e){if(e===null||Zn(e)||Hp(e))return 1;if(Bj(e))return 2}function _j(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 OF={name:"attention",resolveAll:M3e,tokenize:L3e};function M3e(e,t){let n=-1,r,i,s,a,o,l,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;l=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},f={...e[n][1].start};Z9(h,-l),Z9(f,l),a={type:l>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>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=Jo(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Jo(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),u=Jo(u,_j(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Jo(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=Jo(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,So(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 L3e(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=n0(r);let s;return a;function a(l){return s=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===s)return e.consume(l),o;const u=e.exit("attentionSequence"),d=n0(l),h=!d||d===2&&i||n.includes(l),f=!i||i===2&&d||n.includes(r);return u._open=!!(s===42?h:h&&(i||!f)),u._close=!!(s===42?f:f&&(d||!h)),t(l)}}function Z9(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const R3e={name:"autolink",tokenize:U3e};function U3e(e,t,n){let r=0;return i;function i(A){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(A),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(A){return la(A)?(e.consume(A),a):A===64?n(A):u(A)}function a(A){return A===43||A===45||A===46||$s(A)?(r=1,o(A)):u(A)}function o(A){return A===58?(e.consume(A),r=0,l):(A===43||A===45||A===46||$s(A))&&r++<32?(e.consume(A),o):(r=0,u(A))}function l(A){return A===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(A),e.exit("autolinkMarker"),e.exit("autolink"),t):A===null||A===32||A===60||d_(A)?n(A):(e.consume(A),l)}function u(A){return A===64?(e.consume(A),d):E3e(A)?(e.consume(A),u):n(A)}function d(A){return $s(A)?h(A):n(A)}function h(A){return A===46?(e.consume(A),r=0,d):A===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(A),e.exit("autolinkMarker"),e.exit("autolink"),t):f(A)}function f(A){if((A===45||$s(A))&&r++<63){const p=A===45?f:h;return e.consume(A),p}return n(A)}}const w2={partial:!0,tokenize:D3e};function D3e(e,t,n){return r;function r(s){return hn(s)?Bn(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||Rt(s)?t(s):n(s)}}const Qoe={continuation:{tokenize:H3e},exit:$3e,name:"blockQuote",tokenize:Q3e};function Q3e(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 hn(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function H3e(e,t,n){const r=this;return i;function i(a){return hn(a)?Bn(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(Qoe,t,n)(a)}}function $3e(e){e.exit("blockQuote")}const Hoe={name:"characterEscape",tokenize:z3e};function z3e(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 j3e(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const $oe={name:"characterReference",tokenize:V3e};function V3e(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"),l}function l(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,a=$s,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=N3e,d):(e.enter("characterReferenceValue"),s=7,a=IF,d(h))}function d(h){if(h===59&&i){const f=e.exit("characterReferenceValue");return a===$s&&!A6(r.sliceSerialize(f))?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 eV={partial:!0,tokenize:q3e},tV={concrete:!0,name:"codeFenced",tokenize:K3e};function K3e(e,t,n){const r=this,i={partial:!0,tokenize:w};let s=0,a=0,o;return l;function l(S){return u(S)}function u(S){const _=r.events[r.events.length-1];return s=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,o=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(S)}function d(S){return S===o?(a++,e.consume(S),d):a<3?n(S):(e.exit("codeFencedFenceSequence"),hn(S)?Bn(e,h,"whitespace")(S):h(S))}function h(S){return S===null||Rt(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(eV,m,b)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(S))}function f(S){return S===null||Rt(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(S)):hn(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Bn(e,A,"whitespace")(S)):S===96&&S===o?n(S):(e.consume(S),f)}function A(S){return S===null||Rt(S)?h(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(S))}function p(S){return S===null||Rt(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(S)):S===96&&S===o?n(S):(e.consume(S),p)}function m(S){return e.attempt(i,b,g)(S)}function g(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),y}function y(S){return s>0&&hn(S)?Bn(e,v,"linePrefix",s+1)(S):v(S)}function v(S){return S===null||Rt(S)?e.check(eV,m,b)(S):(e.enter("codeFlowValue"),x(S))}function x(S){return S===null||Rt(S)?(e.exit("codeFlowValue"),v(S)):(e.consume(S),x)}function b(S){return e.exit("codeFenced"),t(S)}function w(S,_,E){let j=0;return I;function I(D){return S.enter("lineEnding"),S.consume(D),S.exit("lineEnding"),T}function T(D){return S.enter("codeFencedFence"),hn(D)?Bn(S,N,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):N(D)}function N(D){return D===o?(S.enter("codeFencedFenceSequence"),F(D)):E(D)}function F(D){return D===o?(j++,S.consume(D),F):j>=a?(S.exit("codeFencedFenceSequence"),hn(D)?Bn(S,L,"whitespace")(D):L(D)):E(D)}function L(D){return D===null||Rt(D)?(S.exit("codeFencedFence"),_(D)):E(D)}}}function q3e(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 ZP={name:"codeIndented",tokenize:G3e},W3e={partial:!0,tokenize:Y3e};function G3e(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Bn(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?l(u):Rt(u)?e.attempt(W3e,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||Rt(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),t(u)}}function Y3e(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):Rt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Bn(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):Rt(a)?i(a):n(a)}}const X3e={name:"codeText",previous:Z3e,resolve:J3e,tokenize:eFe};function J3e(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 Z3e(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function eFe(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"),l(h))}function l(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),l):h===96?(s=e.enter("codeTextSequence"),i=0,d(h)):Rt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(h))}function u(h){return h===null||h===32||h===96||Rt(h)?(e.exit("codeTextData"),l(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 tFe{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&&ux(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),ux(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ux(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);ux(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ux(this.left,n.reverse())}}}function ux(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 zoe(e){const t={};let n=-1,r,i,s,a,o,l,u;const d=new tFe(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"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,nFe(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 So(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function nFe(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,l=[],u={};let d,h,f=-1,A=n,p=0,m=0;const g=[m];for(;A;){for(;e.get(++i)[1]!==A;);s.push(i),A._tokenizer||(d=r.sliceStream(A),A.next||d.push(null),h&&a.defineSkip(A.start),A._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),A._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=A,A=A.next}for(A=n;++f<o.length;)o[f][0]==="exit"&&o[f-1][0]==="enter"&&o[f][1].type===o[f-1][1].type&&o[f][1].start.line!==o[f][1].end.line&&(m=f+1,g.push(m),A._tokenizer=void 0,A.previous=void 0,A=A.next);for(a.events=[],A?(A._tokenizer=void 0,A.previous=void 0):g.pop(),f=g.length;f--;){const y=o.slice(g[f],g[f+1]),v=s.pop();l.push([v,v+y.length-1]),e.splice(v,2,y)}for(l.reverse(),f=-1;++f<l.length;)u[p+l[f][0]]=p+l[f][1],p+=l[f][1]-l[f][0]-1;return u}const rFe={resolve:sFe,tokenize:aFe},iFe={partial:!0,tokenize:oFe};function sFe(e){return zoe(e),e}function aFe(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):Rt(o)?e.check(iFe,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 oFe(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Bn(e,s,"linePrefix")}function s(a){if(a===null||Rt(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 Voe(e,t,n,r,i,s,a,o,l){const u=l||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),f):y===null||y===32||y===41||d_(y)?n(y):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),m(y))}function f(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"}),A(y))}function A(y){return y===62?(e.exit("chunkString"),e.exit(o),f(y)):y===null||y===60||Rt(y)?n(y):(e.consume(y),y===92?p:A)}function p(y){return y===60||y===62||y===92?(e.consume(y),A):A(y)}function m(y){return!d&&(y===null||y===41||Zn(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||d_(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 Koe(e,t,n,r,i,s){const a=this;let o=0,l;return u;function u(A){return e.enter(r),e.enter(i),e.consume(A),e.exit(i),e.enter(s),d}function d(A){return o>999||A===null||A===91||A===93&&!l||A===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(A):A===93?(e.exit(s),e.enter(i),e.consume(A),e.exit(i),e.exit(r),t):Rt(A)?(e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(A))}function h(A){return A===null||A===91||A===93||Rt(A)||o++>999?(e.exit("chunkString"),d(A)):(e.consume(A),l||(l=!hn(A)),A===92?f:h)}function f(A){return A===91||A===92||A===93?(e.consume(A),o++,h):h(A)}}function qoe(e,t,n,r,i,s){let a;return o;function o(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),a=f===40?41:f,l):n(f)}function l(f){return f===a?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(s),u(f))}function u(f){return f===a?(e.exit(s),l(a)):f===null?n(f):Rt(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Bn(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===a||f===null||Rt(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?h:d)}function h(f){return f===a||f===92?(e.consume(f),d):d(f)}}function Bw(e,t){let n;return r;function r(i){return Rt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):hn(i)?Bn(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const lFe={name:"definition",tokenize:uFe},cFe={partial:!0,tokenize:dFe};function uFe(e,t,n){const r=this;let i;return s;function s(A){return e.enter("definition"),a(A)}function a(A){return Koe.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(A)}function o(A){return i=lc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),A===58?(e.enter("definitionMarker"),e.consume(A),e.exit("definitionMarker"),l):n(A)}function l(A){return Zn(A)?Bw(e,u)(A):u(A)}function u(A){return Voe(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(A)}function d(A){return e.attempt(cFe,h,h)(A)}function h(A){return hn(A)?Bn(e,f,"whitespace")(A):f(A)}function f(A){return A===null||Rt(A)?(e.exit("definition"),r.parser.defined.push(i),t(A)):n(A)}}function dFe(e,t,n){return r;function r(o){return Zn(o)?Bw(e,i)(o):n(o)}function i(o){return qoe(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return hn(o)?Bn(e,a,"whitespace")(o):a(o)}function a(o){return o===null||Rt(o)?t(o):n(o)}}const hFe={name:"hardBreakEscape",tokenize:AFe};function AFe(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return Rt(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const fFe={name:"headingAtx",resolve:pFe,tokenize:mFe};function pFe(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"},So(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function mFe(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||Zn(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||Rt(d)?(e.exit("atxHeading"),t(d)):hn(d)?Bn(e,o,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),o(d))}function u(d){return d===null||d===35||Zn(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),u)}}const gFe=["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"],nV=["pre","script","style","textarea"],yFe={concrete:!0,name:"htmlFlow",resolveTo:wFe,tokenize:bFe},vFe={partial:!0,tokenize:SFe},xFe={partial:!0,tokenize:CFe};function wFe(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 bFe(e,t,n){const r=this;let i,s,a,o,l;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),f):M===47?(e.consume(M),s=!0,m):M===63?(e.consume(M),i=3,r.interrupt?t:Q):la(M)?(e.consume(M),a=String.fromCharCode(M),g):n(M)}function f(M){return M===45?(e.consume(M),i=2,A):M===91?(e.consume(M),i=5,o=0,p):la(M)?(e.consume(M),i=4,r.interrupt?t:Q):n(M)}function A(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 la(M)?(e.consume(M),a=String.fromCharCode(M),g):n(M)}function g(M){if(M===null||M===47||M===62||Zn(M)){const Y=M===47,X=a.toLowerCase();return!Y&&!s&&nV.includes(X)?(i=1,r.interrupt?t(M):N(M)):gFe.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||$s(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 hn(M)?(e.consume(M),v):I(M)}function x(M){return M===47?(e.consume(M),I):M===58||M===95||la(M)?(e.consume(M),b):hn(M)?(e.consume(M),x):I(M)}function b(M){return M===45||M===46||M===58||M===95||$s(M)?(e.consume(M),b):w(M)}function w(M){return M===61?(e.consume(M),S):hn(M)?(e.consume(M),w):x(M)}function S(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),l=M,_):hn(M)?(e.consume(M),S):E(M)}function _(M){return M===l?(e.consume(M),l=null,j):M===null||Rt(M)?n(M):(e.consume(M),_)}function E(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||Zn(M)?w(M):(e.consume(M),E)}function j(M){return M===47||M===62||hn(M)?x(M):n(M)}function I(M){return M===62?(e.consume(M),T):n(M)}function T(M){return M===null||Rt(M)?N(M):hn(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),V):Rt(M)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(vFe,R,F)(M)):M===null||Rt(M)?(e.exit("htmlFlowData"),F(M)):(e.consume(M),N)}function F(M){return e.check(xFe,L,R)(M)}function L(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),D}function D(M){return M===null||Rt(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 nV.includes(Y)?(e.consume(M),ce):N(M)}return la(M)&&a.length<8?(e.consume(M),a+=String.fromCharCode(M),$):N(M)}function V(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||Rt(M)?(e.exit("htmlFlowData"),R(M)):(e.consume(M),ce)}function R(M){return e.exit("htmlFlow"),t(M)}}function CFe(e,t,n){const r=this;return i;function i(a){return Rt(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 SFe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(w2,t,n)}}const kFe={name:"htmlText",tokenize:BFe};function BFe(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),l}function l(Q){return Q===33?(e.consume(Q),u):Q===47?(e.consume(Q),w):Q===63?(e.consume(Q),x):la(Q)?(e.consume(Q),E):n(Q)}function u(Q){return Q===45?(e.consume(Q),d):Q===91?(e.consume(Q),s=0,p):la(Q)?(e.consume(Q),v):n(Q)}function d(Q){return Q===45?(e.consume(Q),A):n(Q)}function h(Q){return Q===null?n(Q):Q===45?(e.consume(Q),f):Rt(Q)?(a=h,W(Q)):(e.consume(Q),h)}function f(Q){return Q===45?(e.consume(Q),A):h(Q)}function A(Q){return Q===62?H(Q):Q===45?f(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):Rt(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):Rt(Q)?(a=v,W(Q)):(e.consume(Q),v)}function x(Q){return Q===null?n(Q):Q===63?(e.consume(Q),b):Rt(Q)?(a=x,W(Q)):(e.consume(Q),x)}function b(Q){return Q===62?H(Q):x(Q)}function w(Q){return la(Q)?(e.consume(Q),S):n(Q)}function S(Q){return Q===45||$s(Q)?(e.consume(Q),S):_(Q)}function _(Q){return Rt(Q)?(a=_,W(Q)):hn(Q)?(e.consume(Q),_):H(Q)}function E(Q){return Q===45||$s(Q)?(e.consume(Q),E):Q===47||Q===62||Zn(Q)?j(Q):n(Q)}function j(Q){return Q===47?(e.consume(Q),H):Q===58||Q===95||la(Q)?(e.consume(Q),I):Rt(Q)?(a=j,W(Q)):hn(Q)?(e.consume(Q),j):H(Q)}function I(Q){return Q===45||Q===46||Q===58||Q===95||$s(Q)?(e.consume(Q),I):T(Q)}function T(Q){return Q===61?(e.consume(Q),N):Rt(Q)?(a=T,W(Q)):hn(Q)?(e.consume(Q),T):j(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):Rt(Q)?(a=N,W(Q)):hn(Q)?(e.consume(Q),N):(e.consume(Q),L)}function F(Q){return Q===i?(e.consume(Q),i=void 0,D):Q===null?n(Q):Rt(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||Zn(Q)?j(Q):(e.consume(Q),L)}function D(Q){return Q===47||Q===62||Zn(Q)?j(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 hn(Q)?Bn(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):V(Q)}function V(Q){return e.enter("htmlTextData"),a(Q)}}const f6={name:"labelEnd",resolveAll:jFe,resolveTo:TFe,tokenize:PFe},_Fe={tokenize:IFe},EFe={tokenize:OFe},NFe={tokenize:FFe};function jFe(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&&So(e,0,e.length,n),e}function TFe(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 l={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",l,t],["enter",u,t]],o=Jo(o,e.slice(s+1,s+r+3)),o=Jo(o,[["enter",d,t]]),o=Jo(o,_j(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),o=Jo(o,[["exit",d,t],e[a-2],e[a-1],["exit",u,t]]),o=Jo(o,e.slice(a+1)),o=Jo(o,[["exit",l,t]]),So(e,s,e.length,o),e}function PFe(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(f){return s?s._inactive?h(f):(a=r.parser.defined.includes(lc(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):n(f)}function l(f){return f===40?e.attempt(_Fe,d,a?d:h)(f):f===91?e.attempt(EFe,d,a?u:h)(f):a?d(f):h(f)}function u(f){return e.attempt(NFe,d,h)(f)}function d(f){return t(f)}function h(f){return s._balanced=!0,n(f)}}function IFe(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 Zn(h)?Bw(e,s)(h):s(h)}function s(h){return h===41?d(h):Voe(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return Zn(h)?Bw(e,l)(h):d(h)}function o(h){return n(h)}function l(h){return h===34||h===39||h===40?qoe(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function u(h){return Zn(h)?Bw(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 OFe(e,t,n){const r=this;return i;function i(o){return Koe.call(r,e,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(lc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function FFe(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 MFe={name:"labelStartImage",resolveAll:f6.resolveAll,tokenize:LFe};function LFe(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 RFe={name:"labelStartLink",resolveAll:f6.resolveAll,tokenize:UFe};function UFe(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 eI={name:"lineEnding",tokenize:DFe};function DFe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Bn(e,t,"linePrefix")}}const qk={name:"thematicBreak",tokenize:QFe};function QFe(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"),l(u)):r>=3&&(u===null||Rt(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),hn(u)?Bn(e,o,"whitespace")(u):o(u))}}const _a={continuation:{tokenize:VFe},exit:qFe,name:"list",tokenize:zFe},HFe={partial:!0,tokenize:WFe},$Fe={partial:!0,tokenize:KFe};function zFe(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(A){const p=r.containerState.type||(A===42||A===43||A===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||A===r.containerState.marker:IF(A)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),A===42||A===45?e.check(qk,n,u)(A):u(A);if(!r.interrupt||A===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(A)}return n(A)}function l(A){return IF(A)&&++a<10?(e.consume(A),l):(!r.interrupt||a<2)&&(r.containerState.marker?A===r.containerState.marker:A===41||A===46)?(e.exit("listItemValue"),u(A)):n(A)}function u(A){return e.enter("listItemMarker"),e.consume(A),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||A,e.check(w2,r.interrupt?n:d,e.attempt(HFe,f,h))}function d(A){return r.containerState.initialBlankLine=!0,s++,f(A)}function h(A){return hn(A)?(e.enter("listItemPrefixWhitespace"),e.consume(A),e.exit("listItemPrefixWhitespace"),f):n(A)}function f(A){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(A)}}function VFe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(w2,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Bn(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!hn(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($Fe,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Bn(e,e.attempt(_a,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function KFe(e,t,n){const r=this;return Bn(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 qFe(e){e.exit(this.containerState.type)}function WFe(e,t,n){const r=this;return Bn(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!hn(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const rV={name:"setextUnderline",resolveTo:GFe,tokenize:YFe};function GFe(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 YFe(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"),hn(u)?Bn(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||Rt(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const XFe={tokenize:JFe};function JFe(e){const t=this,n=e.attempt(w2,r,e.attempt(this.parser.constructs.flowInitial,i,Bn(e,e.attempt(this.parser.constructs.flow,i,e.attempt(rFe,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 ZFe={resolveAll:Goe()},eMe=Woe("string"),tMe=Woe("text");function Woe(e){return{resolveAll:Goe(e==="text"?nMe: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),l}function l(d){return u(d)?(n.exit("data"),s(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;const h=i[d];let f=-1;if(h)for(;++f<h.length;){const A=h[f];if(!A.previous||A.previous.call(r,r.previous))return!0}return!1}}}function Goe(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 nMe(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,l;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)l=!0,o++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const u={type:n===e.length||l||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 rMe={42:_a,43:_a,45:_a,48:_a,49:_a,50:_a,51:_a,52:_a,53:_a,54:_a,55:_a,56:_a,57:_a,62:Qoe},iMe={91:lFe},sMe={[-2]:ZP,[-1]:ZP,32:ZP},aMe={35:fFe,42:qk,45:[rV,qk],60:yFe,61:rV,95:qk,96:tV,126:tV},oMe={38:$oe,92:Hoe},lMe={[-5]:eI,[-4]:eI,[-3]:eI,33:MFe,38:$oe,42:OF,60:[R3e,kFe],91:RFe,92:[hFe,Hoe],93:f6,95:OF,96:X3e},cMe={null:[OF,ZFe]},uMe={null:[42,95]},dMe={null:[]},hMe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:uMe,contentInitial:iMe,disable:dMe,document:rMe,flow:aMe,flowInitial:sMe,insideSpan:cMe,string:oMe,text:lMe},Symbol.toStringTag,{value:"Module"}));function AMe(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 l={attempt:_(w),check:_(S),consume:v,enter:x,exit:b,interrupt:_(S,{interrupt:!0})},u={code:null,containerState:{},defineSkip:m,events:[],now:p,parser:e,previous:null,sliceSerialize:f,sliceStream:A,write:h};let d=t.tokenize.call(u,l);return t.resolveAll&&s.push(t),u;function h(T){return a=Jo(a,T),g(),a[a.length-1]!==null?[]:(E(t,0),u.events=_j(s,u.events,u),u.events)}function f(T,N){return pMe(A(T),N)}function A(T){return fMe(a,T)}function p(){const{_bufferIndex:T,_index:N,line:F,column:L,offset:D}=r;return{_bufferIndex:T,_index:N,line:F,column:L,offset:D}}function m(T){i[T.line]=T.column,I()}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){Rt(T)?(r.line++,r.column=1,r.offset+=T===-3?2:1,I()):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){E(T,N.from)}function S(T,N){N.restore()}function _(T,N){return F;function F(L,D,H){let W,$,V,Q;return Array.isArray(L)?R(L):"tokenize"in L?R([L]):ce(L);function ce(K){return Z;function Z(de){const se=de!==null&&K[de],ie=de!==null&&K.null,he=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(ie)?ie:ie?[ie]:[]];return R(he)(de)}}function R(K){return W=K,$=0,K.length===0?H:M(K[$])}function M(K){return Z;function Z(de){return Q=j(),V=K,K.partial||(u.currentConstruct=K),K.name&&u.parser.constructs.disable.null.includes(K.name)?X():K.tokenize.call(N?Object.assign(Object.create(u),N):u,l,Y,X)(de)}}function Y(K){return T(V,Q),D}function X(K){return Q.restore(),++$<W.length?M(W[$]):H}}}function E(T,N){T.resolveAll&&!s.includes(T)&&s.push(T),T.resolve&&So(u.events,N,u.events.length-N,T.resolve(u.events.slice(N),u)),T.resolveTo&&(u.events=T.resolveTo(u.events,u))}function j(){const T=p(),N=u.previous,F=u.currentConstruct,L=u.events.length,D=Array.from(o);return{from:L,restore:H};function H(){r=T,u.previous=N,u.currentConstruct=F,u.events.length=L,o=D,I()}}function I(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function fMe(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 pMe(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 mMe(e){const r={constructs:Uoe([hMe,...(e||{}).extensions||[]]),content:i(T3e),defined:[],document:i(I3e),flow:i(XFe),lazy:{},string:i(eMe),text:i(tMe)};return r;function i(s){return a;function a(o){return AMe(r,s,o)}}}function gMe(e){for(;!zoe(e););return e}const iV=/[\0\t\n\r]/g;function yMe(){let e=1,t="",n=!0,r;return i;function i(s,a,o){const l=[];let u,d,h,f,A;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(iV.lastIndex=h,u=iV.exec(s),f=u&&u.index!==void 0?u.index:s.length,A=s.charCodeAt(f),!u){t=s.slice(h);break}if(A===10&&h===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),h<f&&(l.push(s.slice(h,f)),e+=f-h),A){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}h=f+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const vMe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function xMe(e){return e.replace(vMe,wMe)}function wMe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return Doe(n.slice(s?2:1),s?16:10)}return A6(n)||e}const Yoe={}.hasOwnProperty;function bMe(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),CMe(n)(gMe(mMe(n).document().write(yMe()(e,t,!0))))}function CMe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Te),autolinkProtocol:j,autolinkEmail:j,atxHeading:s(te),blockQuote:s(ie),characterEscape:j,characterReference:j,codeFenced:s(he),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(he,a),codeText:s(ue,a),codeTextData:j,data:j,codeFlowValue:j,definition:s(Se),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(Fe),hardBreakEscape:s(_e),hardBreakTrailing:s(_e),htmlFlow:s(Ze,a),htmlFlowData:j,htmlText:s(Ze,a),htmlTextData:j,image:s(et),label:a,link:s(Te),listItem:s(xe),listItemValue:f,listOrdered:s(st,h),listUnordered:s(st),paragraph:s(Qe),reference:M,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(te),strong:s(ze),thematicBreak:s(dt)},exit:{atxHeading:l(),atxHeadingSequence:w,autolink:l(),autolinkEmail:se,autolinkProtocol:de,blockQuote:l(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:X,characterReferenceMarkerNumeric:X,characterReferenceValue:K,characterReference:Z,codeFenced:l(g),codeFencedFence:m,codeFencedFenceInfo:A,codeFencedFenceMeta:p,codeFlowValue:I,codeIndented:l(y),codeText:l(D),codeTextData:I,data:I,definition:l(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:x,emphasis:l(),hardBreakEscape:l(N),hardBreakTrailing:l(N),htmlFlow:l(F),htmlFlowData:I,htmlText:l(L),htmlTextData:I,image:l(W),label:V,labelText:$,lineEnding:T,link:l(H),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Y,resourceDestinationString:Q,resourceTitleString:ce,resource:R,setextHeading:l(E),setextHeadingLineSequence:_,setextHeadingText:S,strong:l(),thematicBreak:l()}};Xoe(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ye){let Ee={type:"root",children:[]};const We={stack:[Ee],tokenStack:[],config:t,enter:o,exit:u,buffer:a,resume:d,data:n},Ue=[];let Ge=-1;for(;++Ge<ye.length;)if(ye[Ge][1].type==="listOrdered"||ye[Ge][1].type==="listUnordered")if(ye[Ge][0]==="enter")Ue.push(Ge);else{const pe=Ue.pop();Ge=i(ye,pe,Ge)}for(Ge=-1;++Ge<ye.length;){const pe=t[ye[Ge][0]];Yoe.call(pe,ye[Ge][1].type)&&pe[ye[Ge][1].type].call(Object.assign({sliceSerialize:ye[Ge][2].sliceSerialize},We),ye[Ge][1])}if(We.tokenStack.length>0){const pe=We.tokenStack[We.tokenStack.length-1];(pe[1]||sV).call(We,void 0,pe[0])}for(Ee.position={start:Yd(ye.length>0?ye[0][1].start:{line:1,column:1,offset:0}),end:Yd(ye.length>0?ye[ye.length-2][1].end:{line:1,column:1,offset:0})},Ge=-1;++Ge<t.transforms.length;)Ee=t.transforms[Ge](Ee)||Ee;return Ee}function i(ye,Ee,We){let Ue=Ee-1,Ge=-1,pe=!1,mt,ct,xt,Mt;for(;++Ue<=We;){const zt=ye[Ue];switch(zt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{zt[0]==="enter"?Ge++:Ge--,Mt=void 0;break}case"lineEndingBlank":{zt[0]==="enter"&&(mt&&!Mt&&!Ge&&!xt&&(xt=Ue),Mt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Mt=void 0}if(!Ge&&zt[0]==="enter"&&zt[1].type==="listItemPrefix"||Ge===-1&&zt[0]==="exit"&&(zt[1].type==="listUnordered"||zt[1].type==="listOrdered")){if(mt){let ht=Ue;for(ct=void 0;ht--;){const Lt=ye[ht];if(Lt[1].type==="lineEnding"||Lt[1].type==="lineEndingBlank"){if(Lt[0]==="exit")continue;ct&&(ye[ct][1].type="lineEndingBlank",pe=!0),Lt[1].type="lineEnding",ct=ht}else if(!(Lt[1].type==="linePrefix"||Lt[1].type==="blockQuotePrefix"||Lt[1].type==="blockQuotePrefixWhitespace"||Lt[1].type==="blockQuoteMarker"||Lt[1].type==="listItemIndent"))break}xt&&(!ct||xt<ct)&&(mt._spread=!0),mt.end=Object.assign({},ct?ye[ct][1].start:zt[1].end),ye.splice(ct||Ue,0,["exit",mt,zt[2]]),Ue++,We++}if(zt[1].type==="listItemPrefix"){const ht={type:"listItem",_spread:!1,start:Object.assign({},zt[1].start),end:void 0};mt=ht,ye.splice(Ue,0,["enter",ht,zt[2]]),Ue++,We++,xt=void 0,Mt=!0}}}return ye[Ee][1]._spread=pe,We}function s(ye,Ee){return We;function We(Ue){o.call(this,ye(Ue),Ue),Ee&&Ee.call(this,Ue)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(ye,Ee,We){this.stack[this.stack.length-1].children.push(ye),this.stack.push(ye),this.tokenStack.push([Ee,We||void 0]),ye.position={start:Yd(Ee.start),end:void 0}}function l(ye){return Ee;function Ee(We){ye&&ye.call(this,We),u.call(this,We)}}function u(ye,Ee){const We=this.stack.pop(),Ue=this.tokenStack.pop();if(Ue)Ue[0].type!==ye.type&&(Ee?Ee.call(this,ye,Ue[0]):(Ue[1]||sV).call(this,ye,Ue[0]));else throw new Error("Cannot close `"+ye.type+"` ("+kw({start:ye.start,end:ye.end})+"): it’s not open");We.position.end=Yd(ye.end)}function d(){return h6(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function f(ye){if(this.data.expectingFirstListItemValue){const Ee=this.stack[this.stack.length-2];Ee.start=Number.parseInt(this.sliceSerialize(ye),10),this.data.expectingFirstListItemValue=void 0}}function A(){const ye=this.resume(),Ee=this.stack[this.stack.length-1];Ee.lang=ye}function p(){const ye=this.resume(),Ee=this.stack[this.stack.length-1];Ee.meta=ye}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const ye=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=ye.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const ye=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=ye.replace(/(\r?\n|\r)$/g,"")}function v(ye){const Ee=this.resume(),We=this.stack[this.stack.length-1];We.label=Ee,We.identifier=lc(this.sliceSerialize(ye)).toLowerCase()}function x(){const ye=this.resume(),Ee=this.stack[this.stack.length-1];Ee.title=ye}function b(){const ye=this.resume(),Ee=this.stack[this.stack.length-1];Ee.url=ye}function w(ye){const Ee=this.stack[this.stack.length-1];if(!Ee.depth){const We=this.sliceSerialize(ye).length;Ee.depth=We}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function _(ye){const Ee=this.stack[this.stack.length-1];Ee.depth=this.sliceSerialize(ye).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function j(ye){const We=this.stack[this.stack.length-1].children;let Ue=We[We.length-1];(!Ue||Ue.type!=="text")&&(Ue=Dt(),Ue.position={start:Yd(ye.start),end:void 0},We.push(Ue)),this.stack.push(Ue)}function I(ye){const Ee=this.stack.pop();Ee.value+=this.sliceSerialize(ye),Ee.position.end=Yd(ye.end)}function T(ye){const Ee=this.stack[this.stack.length-1];if(this.data.atHardBreak){const We=Ee.children[Ee.children.length-1];We.position.end=Yd(ye.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ee.type)&&(j.call(this,ye),I.call(this,ye))}function N(){this.data.atHardBreak=!0}function F(){const ye=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=ye}function L(){const ye=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=ye}function D(){const ye=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=ye}function H(){const ye=this.stack[this.stack.length-1];if(this.data.inReference){const Ee=this.data.referenceType||"shortcut";ye.type+="Reference",ye.referenceType=Ee,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 Ee=this.data.referenceType||"shortcut";ye.type+="Reference",ye.referenceType=Ee,delete ye.url,delete ye.title}else delete ye.identifier,delete ye.label;this.data.referenceType=void 0}function $(ye){const Ee=this.sliceSerialize(ye),We=this.stack[this.stack.length-2];We.label=xMe(Ee),We.identifier=lc(Ee).toLowerCase()}function V(){const ye=this.stack[this.stack.length-1],Ee=this.resume(),We=this.stack[this.stack.length-1];if(this.data.inReference=!0,We.type==="link"){const Ue=ye.children;We.children=Ue}else We.alt=Ee}function Q(){const ye=this.resume(),Ee=this.stack[this.stack.length-1];Ee.url=ye}function ce(){const ye=this.resume(),Ee=this.stack[this.stack.length-1];Ee.title=ye}function R(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function Y(ye){const Ee=this.resume(),We=this.stack[this.stack.length-1];We.label=Ee,We.identifier=lc(this.sliceSerialize(ye)).toLowerCase(),this.data.referenceType="full"}function X(ye){this.data.characterReferenceType=ye.type}function K(ye){const Ee=this.sliceSerialize(ye),We=this.data.characterReferenceType;let Ue;We?(Ue=Doe(Ee,We==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ue=A6(Ee);const Ge=this.stack[this.stack.length-1];Ge.value+=Ue}function Z(ye){const Ee=this.stack.pop();Ee.position.end=Yd(ye.end)}function de(ye){I.call(this,ye);const Ee=this.stack[this.stack.length-1];Ee.url=this.sliceSerialize(ye)}function se(ye){I.call(this,ye);const Ee=this.stack[this.stack.length-1];Ee.url="mailto:"+this.sliceSerialize(ye)}function ie(){return{type:"blockquote",children:[]}}function he(){return{type:"code",lang:null,meta:null,value:""}}function ue(){return{type:"inlineCode",value:""}}function Se(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Fe(){return{type:"emphasis",children:[]}}function te(){return{type:"heading",depth:0,children:[]}}function _e(){return{type:"break"}}function Ze(){return{type:"html",value:""}}function et(){return{type:"image",title:null,url:"",alt:null}}function Te(){return{type:"link",title:null,url:"",children:[]}}function st(ye){return{type:"list",ordered:ye.type==="listOrdered",start:null,spread:ye._spread,children:[]}}function xe(ye){return{type:"listItem",spread:ye._spread,checked:null,children:[]}}function Qe(){return{type:"paragraph",children:[]}}function ze(){return{type:"strong",children:[]}}function Dt(){return{type:"text",value:""}}function dt(){return{type:"thematicBreak"}}}function Yd(e){return{line:e.line,column:e.column,offset:e.offset}}function Xoe(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Xoe(e,r):SMe(e,r)}}function SMe(e,t){let n;for(n in t)if(Yoe.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 sV(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+kw({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+kw({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+kw({start:t.start,end:t.end})+") is still open")}function kMe(e){const t=this;t.parser=n;function n(r){return bMe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function BMe(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 _Me(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function EMe(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 NMe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jMe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TMe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=av(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 l={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,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function PMe(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 IMe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Joe(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 OMe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Joe(e,t);const i={src:av(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 FMe(e,t){const n={src:av(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 MMe(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 LMe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Joe(e,t);const i={href:av(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 RMe(e,t){const n={href:av(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 UMe(e,t,n){const r=e.all(t),i=n?DMe(n):Zoe(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 l=r[r.length-1];l&&(i||l.type!=="element"||l.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 DMe(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=Zoe(n[r])}return t}function Zoe(e){const t=e.spread;return t??e.children.length>1}function QMe(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 HMe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $Me(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function zMe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function VMe(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=l6(t.children[1]),l=Poe(t.children[t.children.length-1]);o&&l&&(a.position={start:o,end:l}),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 KMe(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 l=-1;const u=[];for(;++l<o;){const h=t.children[l],f={},A=a?a[l]:void 0;A&&(f.align=A);let p={type:"element",tagName:s,properties:f,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 qMe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const aV=9,oV=32;function WMe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(lV(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(lV(t.slice(i),i>0,!1)),s.join("")}function lV(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===aV||s===oV;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===aV||s===oV;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function GMe(e,t){const n={type:"text",value:WMe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function YMe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const XMe={blockquote:BMe,break:_Me,code:EMe,delete:NMe,emphasis:jMe,footnoteReference:TMe,heading:PMe,html:IMe,imageReference:OMe,image:FMe,inlineCode:MMe,linkReference:LMe,link:RMe,listItem:UMe,list:QMe,paragraph:HMe,root:$Me,strong:zMe,table:VMe,tableCell:qMe,tableRow:KMe,text:GMe,thematicBreak:YMe,toml:oS,yaml:oS,definition:oS,footnoteDefinition:oS};function oS(){}const ele=-1,Ej=0,_w=1,h_=2,p6=3,m6=4,g6=5,y6=6,tle=7,nle=8,cV=typeof self=="object"?self:globalThis,JMe=(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 Ej:case ele:return n(a,i);case _w:{const o=n([],i);for(const l of a)o.push(r(l));return o}case h_:{const o=n({},i);for(const[l,u]of a)o[r(l)]=r(u);return o}case p6:return n(new Date(a),i);case m6:{const{source:o,flags:l}=a;return n(new RegExp(o,l),i)}case g6:{const o=n(new Map,i);for(const[l,u]of a)o.set(r(l),r(u));return o}case y6:{const o=n(new Set,i);for(const l of a)o.add(r(l));return o}case tle:{const{name:o,message:l}=a;return n(new cV[o](l),i)}case nle: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},uV=e=>JMe(new Map,e)(0),Ym="",{toString:ZMe}={},{keys:eLe}=Object,dx=e=>{const t=typeof e;if(t!=="object"||!e)return[Ej,t];const n=ZMe.call(e).slice(8,-1);switch(n){case"Array":return[_w,Ym];case"Object":return[h_,Ym];case"Date":return[p6,Ym];case"RegExp":return[m6,Ym];case"Map":return[g6,Ym];case"Set":return[y6,Ym];case"DataView":return[_w,n]}return n.includes("Array")?[_w,n]:n.includes("Error")?[tle,n]:[h_,n]},lS=([e,t])=>e===Ej&&(t==="function"||t==="symbol"),tLe=(e,t,n,r)=>{const i=(a,o)=>{const l=r.push(a)-1;return n.set(o,l),l},s=a=>{if(n.has(a))return n.get(a);let[o,l]=dx(a);switch(o){case Ej:{let d=a;switch(l){case"bigint":o=nle,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return i([ele],a)}return i([o,d],a)}case _w:{if(l){let f=a;return l==="DataView"?f=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(f=new Uint8Array(a)),i([l,[...f]],a)}const d=[],h=i([o,d],a);for(const f of a)d.push(s(f));return h}case h_:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const d=[],h=i([o,d],a);for(const f of eLe(a))(e||!lS(dx(a[f])))&&d.push([s(f),s(a[f])]);return h}case p6:return i([o,a.toISOString()],a);case m6:{const{source:d,flags:h}=a;return i([o,{source:d,flags:h}],a)}case g6:{const d=[],h=i([o,d],a);for(const[f,A]of a)(e||!(lS(dx(f))||lS(dx(A))))&&d.push([s(f),s(A)]);return h}case y6:{const d=[],h=i([o,d],a);for(const f of a)(e||!lS(dx(f)))&&d.push(s(f));return h}}const{message:u}=a;return i([o,{name:l,message:u}],a)};return s},dV=(e,{json:t,lossy:n}={})=>{const r=[];return tLe(!(t||n),!!t,new Map,r)(e),r},A_=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?uV(dV(e,t)):structuredClone(e):(e,t)=>uV(dV(e,t));function nLe(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 rLe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function iLe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||nLe,r=e.options.footnoteBackLabel||rLe,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const d=e.all(u),h=String(u.identifier).toUpperCase(),f=av(h.toLowerCase());let A=0;const p=[],m=e.footnoteCounts.get(h);for(;m!==void 0&&++A<=m;){p.length>0&&p.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,A);typeof v=="string"&&(v={type:"text",value:v}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(A>1?"-"+A:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,A),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-"+f},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:{...A_(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 Nj=function(e){if(e==null)return lLe;if(typeof e=="function")return jj(e);if(typeof e=="object")return Array.isArray(e)?sLe(e):aLe(e);if(typeof e=="string")return oLe(e);throw new Error("Expected function, string, or object as test")};function sLe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Nj(e[n]);return jj(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function aLe(e){const t=e;return jj(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function oLe(e){return jj(t);function t(n){return n&&n.type===e}}function jj(e){return t;function t(n,r,i){return!!(cLe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function lLe(){return!0}function cLe(e){return e!==null&&typeof e=="object"&&"type"in e}const rle=[],uLe=!0,FF=!1,dLe="skip";function ile(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=Nj(i),a=r?-1:1;o(e,void 0,[])();function o(l,u,d){const h=l&&typeof l=="object"?l:{};if(typeof h.type=="string"){const A=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(l.type+(A?"<"+A+">":""))+")"})}return f;function f(){let A=rle,p,m,g;if((!t||s(l,u,d[d.length-1]||void 0))&&(A=hLe(n(l,d)),A[0]===FF))return A;if("children"in l&&l.children){const y=l;if(y.children&&A[0]!==dLe)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]===FF)return p;m=typeof p[1]=="number"?p[1]:m+a}}return A}}}function hLe(e){return Array.isArray(e)?e:typeof e=="number"?[uLe,e]:e==null?rle:[e]}function v6(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),ile(e,s,o,i);function o(l,u){const d=u[u.length-1],h=d?d.children.indexOf(l):void 0;return a(l,h,d)}}const MF={}.hasOwnProperty,ALe={};function fLe(e,t){const n=t||ALe,r=new Map,i=new Map,s=new Map,a={...XMe,...n.handlers},o={all:u,applyData:mLe,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:l,options:n,patch:pLe,wrap:yLe};return v6(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const h=d.type==="definition"?r:i,f=String(d.identifier).toUpperCase();h.has(f)||h.set(f,d)}}),o;function l(d,h){const f=d.type,A=o.handlers[f];if(MF.call(o.handlers,f)&&A)return A(o,d,h);if(o.options.passThrough&&o.options.passThrough.includes(f)){if("children"in d){const{children:m,...g}=d,y=A_(g);return y.children=o.all(d),y}return A_(d)}return(o.options.unknownHandler||gLe)(o,d,h)}function u(d){const h=[];if("children"in d){const f=d.children;let A=-1;for(;++A<f.length;){const p=o.one(f[A],d);if(p){if(A&&f[A-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=hV(p.value)),!Array.isArray(p)&&p.type==="element")){const m=p.children[0];m&&m.type==="text"&&(m.value=hV(m.value))}Array.isArray(p)?h.push(...p):h.push(p)}}}return h}}function pLe(e,t){e.position&&(t.position=r3e(e))}function mLe(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,A_(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function gLe(e,t){const n=t.data||{},r="value"in t&&!(MF.call(n,"hProperties")||MF.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 yLe(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 hV(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function AV(e,t){const n=fLe(e,t),r=n.one(e,void 0),i=iLe(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
`},i),s}function vLe(e,t){return e&&"run"in e?async function(n,r){const i=AV(n,{file:r,...t});await e.run(i,r)}:function(n,r){return AV(n,{file:r,...e||t})}}function fV(e){if(e)throw e}var Wk=Object.prototype.hasOwnProperty,sle=Object.prototype.toString,pV=Object.defineProperty,mV=Object.getOwnPropertyDescriptor,gV=function(t){return typeof Array.isArray=="function"?Array.isArray(t):sle.call(t)==="[object Array]"},yV=function(t){if(!t||sle.call(t)!=="[object Object]")return!1;var n=Wk.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Wk.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Wk.call(t,i)},vV=function(t,n){pV&&n.name==="__proto__"?pV(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},xV=function(t,n){if(n==="__proto__")if(Wk.call(t,n)){if(mV)return mV(t,n).value}else return;return t[n]},xLe=function e(){var t,n,r,i,s,a,o=arguments[0],l=1,u=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=xV(o,n),i=xV(t,n),o!==i&&(d&&i&&(yV(i)||(s=gV(i)))?(s?(s=!1,a=r&&gV(r)?r:[]):a=r&&yV(r)?r:{},vV(o,{name:n,newValue:e(d,a,i)})):typeof i<"u"&&vV(o,{name:n,newValue:i}));return o};const tI=En(xLe);function LF(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 wLe(){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(l,...u){const d=e[++s];let h=-1;if(l){a(l);return}for(;++h<i.length;)(u[h]===null||u[h]===void 0)&&(u[h]=i[h]);i=u,d?bLe(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 bLe(e,t){let n;return r;function r(...a){const o=e.length>a.length;let l;o&&a.push(i);try{l=e.apply(this,a)}catch(u){const d=u;if(o&&n)throw d;return i(d)}o||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(a,...o){n||(n=!0,t(a,...o))}function s(a){i(null,a)}}const Mc={basename:CLe,dirname:SLe,extname:kLe,join:BLe,sep:"/"};function CLe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');b2(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 SLe(e){if(b2(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 kLe(e){b2(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 BLe(...e){let t=-1,n;for(;++t<e.length;)b2(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":_Le(n)}function _Le(e){b2(e);const t=e.codePointAt(0)===47;let n=ELe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function ELe(e,t){let n="",r=0,i=-1,s=0,a=-1,o,l;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(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),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 b2(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const NLe={cwd:jLe};function jLe(){return"/"}function RF(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function TLe(e){if(typeof e=="string")e=new URL(e);else if(!RF(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 PLe(e)}function PLe(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 nI=["history","path","basename","stem","extname","dirname"];class ale{constructor(t){let n;t?RF(t)?n={path:t}:typeof t=="string"||ILe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":NLe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<nI.length;){const s=nI[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)nI.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Mc.basename(this.path):void 0}set basename(t){iI(t,"basename"),rI(t,"basename"),this.path=Mc.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Mc.dirname(this.path):void 0}set dirname(t){wV(this.basename,"dirname"),this.path=Mc.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Mc.extname(this.path):void 0}set extname(t){if(rI(t,"extname"),wV(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=Mc.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){RF(t)&&(t=TLe(t)),iI(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Mc.basename(this.path,this.extname):void 0}set stem(t){iI(t,"stem"),rI(t,"stem"),this.path=Mc.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 Ws(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 rI(e,t){if(e&&e.includes(Mc.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Mc.sep+"`")}function iI(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function wV(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function ILe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const OLe=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},FLe={}.hasOwnProperty;class x6 extends OLe{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=wLe()}copy(){const t=new x6;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(tI(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(oI("data",this.frozen),this.namespace[t]=n,this):FLe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(oI("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=cS(t),r=this.parser||this.Parser;return sI("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),sI("process",this.parser||this.Parser),aI("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=cS(t),l=r.parse(o);r.run(l,o,function(d,h,f){if(d||!h||!f)return u(d);const A=h,p=r.stringify(A,f);RLe(p)?f.value=p:f.result=p,u(d,f)});function u(d,h){d||!h?a(d):s?s(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),sI("processSync",this.parser||this.Parser),aI("processSync",this.compiler||this.Compiler),this.process(t,i),CV("processSync","process",n),r;function i(s,a){n=!0,fV(s),r=a}}run(t,n,r){bV(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 l=cS(n);i.run(t,l,u);function u(d,h,f){const A=h||t;d?o(d):a?a(A):r(void 0,A,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),CV("runSync","run",r),i;function s(a,o){fV(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=cS(n),i=this.compiler||this.Compiler;return aI("stringify",i),bV(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(oI("use",this.frozen),t!=null)if(typeof t=="function")l(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")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...h]=u;l(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=tI(!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 l(u,d){let h=-1,f=-1;for(;++h<r.length;)if(r[h][0]===u){f=h;break}if(f===-1)r.push([u,...d]);else if(d.length>0){let[A,...p]=d;const m=r[f][1];LF(m)&&LF(A)&&(A=tI(!0,m,A)),r[f]=[u,A,...p]}}}}const MLe=new x6().freeze();function sI(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function aI(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function oI(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 bV(e){if(!LF(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function CV(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function cS(e){return LLe(e)?e:new ale(e)}function LLe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function RLe(e){return typeof e=="string"||ULe(e)}function ULe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const DLe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",SV=[],kV={allowDangerousHtml:!0},QLe=/^(https?|ircs?|mailto|xmpp)$/i,HLe=[{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 w6(e){const t=$Le(e),n=zLe(e);return VLe(t.runSync(t.parse(n),n),e)}function $Le(e){const t=e.rehypePlugins||SV,n=e.remarkPlugins||SV,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...kV}:kV;return MLe().use(kMe).use(n).use(vLe,r).use(t)}function zLe(e){const t=e.children||"",n=new ale;return typeof t=="string"&&(n.value=t),n}function VLe(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||KLe;for(const d of HLe)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+DLe+d.id,void 0);return v6(e,u),l3e(e,{Fragment:c.Fragment,components:i,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function u(d,h,f){if(d.type==="raw"&&f&&typeof h=="number")return a?f.children.splice(h,1):f.children[h]={type:"text",value:d.value},h;if(d.type==="element"){let A;for(A in JP)if(Object.hasOwn(JP,A)&&Object.hasOwn(d.properties,A)){const p=d.properties[A],m=JP[A];(m===null||m.includes(d.tagName))&&(d.properties[A]=l(String(p||""),A,d))}}if(d.type==="element"){let A=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!A&&r&&typeof h=="number"&&(A=!r(d,h,f)),A&&f&&typeof h=="number")return o&&d.children?f.children.splice(h,1,...d.children):f.children.splice(h,1),h}}}function KLe(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||QLe.test(e.slice(0,t))?e:""}function BV(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 qLe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function WLe(e,t,n){const i=Nj((n||{}).ignore||[]),s=GLe(t);let a=-1;for(;++a<s.length;)ile(e,"text",o);function o(u,d){let h=-1,f;for(;++h<d.length;){const A=d[h],p=f?f.children:void 0;if(i(A,p?p.indexOf(A):void 0,f))return;f=A}if(f)return l(u,d)}function l(u,d){const h=d[d.length-1],f=s[a][0],A=s[a][1];let p=0;const g=h.children.indexOf(u);let y=!1,v=[];f.lastIndex=0;let x=f.exec(u.value);for(;x;){const b=x.index,w={index:x.index,input:x.input,stack:[...d,u]};let S=A(...x,w);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?f.lastIndex=b+1:(p!==b&&v.push({type:"text",value:u.value.slice(p,b)}),Array.isArray(S)?v.push(...S):S&&v.push(S),p=b+x[0].length,y=!0),!f.global)break;x=f.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 GLe(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([YLe(i[0]),XLe(i[1])])}return t}function YLe(e){return typeof e=="string"?new RegExp(qLe(e),"g"):e}function XLe(e){return typeof e=="function"?e:function(){return e}}const lI="phrasing",cI=["autolink","link","image","label"];function JLe(){return{transforms:[sRe],enter:{literalAutolink:eRe,literalAutolinkEmail:uI,literalAutolinkHttp:uI,literalAutolinkWww:uI},exit:{literalAutolink:iRe,literalAutolinkEmail:rRe,literalAutolinkHttp:tRe,literalAutolinkWww:nRe}}}function ZLe(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:lI,notInConstruct:cI},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:lI,notInConstruct:cI},{character:":",before:"[ps]",after:"\\/",inConstruct:lI,notInConstruct:cI}]}}function eRe(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function uI(e){this.config.enter.autolinkProtocol.call(this,e)}function tRe(e){this.config.exit.autolinkProtocol.call(this,e)}function nRe(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 rRe(e){this.config.exit.autolinkEmail.call(this,e)}function iRe(e){this.exit(e)}function sRe(e){WLe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,aRe],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),oRe]],{ignore:["link","linkReference"]})}function aRe(e,t,n,r,i){let s="";if(!ole(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!lRe(n)))return!1;const a=cRe(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 oRe(e,t,n,r){return!ole(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function lRe(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 cRe(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=BV(e,"(");let s=BV(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 ole(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Hp(n)||Bj(n))&&(!t||n!==47)}lle.peek=yRe;function uRe(){this.buffer()}function dRe(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function hRe(){this.buffer()}function ARe(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function fRe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=lc(this.sliceSerialize(e)).toLowerCase(),n.label=t}function pRe(e){this.exit(e)}function mRe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=lc(this.sliceSerialize(e)).toLowerCase(),n.label=t}function gRe(e){this.exit(e)}function yRe(){return"["}function lle(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 vRe(){return{enter:{gfmFootnoteCallString:uRe,gfmFootnoteCall:dRe,gfmFootnoteDefinitionLabelString:hRe,gfmFootnoteDefinition:ARe},exit:{gfmFootnoteCallString:fRe,gfmFootnoteCall:pRe,gfmFootnoteDefinitionLabelString:mRe,gfmFootnoteDefinition:gRe}}}function xRe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:lle},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const o=s.createTracker(a);let l=o.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return l+=o.move(s.safe(s.associationId(r),{before:l,after:"]"})),d(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((t?`
`:" ")+s.indentLines(s.containerFlow(r,o.current()),t?cle:wRe))),u(),l}}function wRe(e,t,n){return t===0?e:cle(e,t,n)}function cle(e,t,n){return(n?"":"    ")+e}const bRe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ule.peek=_Re;function CRe(){return{canContainEols:["delete"],enter:{strikethrough:kRe},exit:{strikethrough:BRe}}}function SRe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:bRe}],handlers:{delete:ule}}}function kRe(e){this.enter({type:"delete",children:[]},e)}function BRe(e){this.exit(e)}function ule(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 _Re(){return"~"}function ERe(e){return e.length}function NRe(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||ERe,s=[],a=[],o=[],l=[];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=jRe(e[d][y]);if(n.alignDelimiters!==!1){const x=i(v);g[y]=x,(l[y]===void 0||x>l[y])&&(l[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]=_V(r[h]);else{const m=_V(r);for(;++h<u;)s[h]=m}h=-1;const f=[],A=[];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,l[h]-g.length-y.length);const x=g+"-".repeat(v)+y;n.alignDelimiters!==!1&&(v=g.length+v+y.length,v>l[h]&&(l[h]=v),A[h]=v),f[h]=x}a.splice(1,0,f),o.splice(1,0,A),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=l[h]-(g[h]||0),S=s[h];S===114?x=" ".repeat(w):S===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 jRe(e){return e==null?"":String(e)}function _V(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 TRe(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()),PRe);return i(),a}function PRe(e,t,n){return">"+(n?"":" ")+e}function IRe(e,t){return EV(e,t.inConstruct,!0)&&!EV(e,t.notInConstruct,!1)}function EV(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 NV(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
`&&IRe(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
`}function ORe(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 FRe(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 MRe(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 LRe(e,t,n,r){const i=MRe(n),s=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(FRe(e,n)){const h=n.enter("codeIndented"),f=n.indentLines(s,RRe);return h(),f}const o=n.createTracker(r),l=i.repeat(Math.max(ORe(s,i)+1,3)),u=n.enter("codeFenced");let d=o.move(l);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(l),u(),d}function RRe(e,t,n){return(n?"":"    ")+e}function b6(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 URe(e,t,n,r){const i=b6(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
`,...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),o()),a(),u}function DRe(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 Db(e){return"&#x"+e.toString(16).toUpperCase()+";"}function f_(e,t,n){const r=n0(e),i=n0(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}}dle.peek=QRe;function dle(e,t,n,r){const i=DRe(n),s=n.enter("emphasis"),a=n.createTracker(r),o=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=l.charCodeAt(0),d=f_(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(l=Db(u)+l.slice(1));const h=l.charCodeAt(l.length-1),f=f_(r.after.charCodeAt(0),h,i);f.inside&&(l=l.slice(0,-1)+Db(h));const A=a.move(i);return s(),n.attentionEncodeSurroundingInfo={after:f.outside,before:d.outside},o+l+A}function QRe(e,t,n){return n.options.emphasis||"*"}function HRe(e,t){let n=!1;return v6(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,FF}),!!((!e.depth||e.depth<3)&&h6(e)&&(t.options.setext||n))}function $Re(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(HRe(e,n)){const d=n.enter("headingSetext"),h=n.enter("phrasing"),f=n.containerPhrasing(e,{...s.current(),before:`
`,after:`
`});return h(),d(),f+`
`+(i===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
`))+1))}const a="#".repeat(i),o=n.enter("headingAtx"),l=n.enter("phrasing");s.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
`,...s.current()});return/^[\t ]/.test(u)&&(u=Db(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),l(),o(),u}hle.peek=zRe;function hle(e){return e.value||""}function zRe(){return"<"}Ale.peek=VRe;function Ale(e,t,n,r){const i=b6(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),o()),u+=l.move(")"),a(),u}function VRe(){return"!"}fle.peek=KRe;function fle(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const u=n.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=d,s(),i==="full"||!u||u!==h?l+=o.move(h+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function KRe(){return"!"}ple.peek=qRe;function ple(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 l;if(a.atBreak)for(;l=o.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return i+r+i}function qRe(){return"`"}function mle(e,t){const n=h6(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))}gle.peek=WRe;function gle(e,t,n,r){const i=b6(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,l;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"),l=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=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),l()),u+=a.move(")"),o(),u}function WRe(e,t,n){return mle(e,n)?"<":"["}yle.peek=GRe;function yle(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=d,s(),i==="full"||!u||u!==h?l+=o.move(h+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function GRe(){return"["}function C6(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 YRe(e){const t=C6(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 XRe(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 vle(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 JRe(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=e.ordered?XRe(n):C6(n);const o=e.ordered?a==="."?")":".":YRe(n);let l=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&&(l=!0),vle(n)===a&&d){let h=-1;for(;++h<e.children.length;){const f=e.children[h];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=o),n.bulletCurrent=a;const u=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),u}function ZRe(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 eUe(e,t,n,r){const i=ZRe(n);let s=n.bulletCurrent||C6(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 l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),d);return l(),u;function d(h,f,A){return f?(A?"":" ".repeat(a))+h:(A?s:s+" ".repeat(a-s.length))+h}}function tUe(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(e,r);return s(),i(),a}const nUe=Nj(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function rUe(e,t,n,r){return(e.children.some(function(a){return nUe(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function iUe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}xle.peek=sUe;function xle(e,t,n,r){const i=iUe(n),s=n.enter("strong"),a=n.createTracker(r),o=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=l.charCodeAt(0),d=f_(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(l=Db(u)+l.slice(1));const h=l.charCodeAt(l.length-1),f=f_(r.after.charCodeAt(0),h,i);f.inside&&(l=l.slice(0,-1)+Db(h));const A=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:f.outside,before:d.outside},o+l+A}function sUe(e,t,n){return n.options.strong||"*"}function aUe(e,t,n,r){return n.safe(e.value,r)}function oUe(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 lUe(e,t,n){const r=(vle(n)+(n.options.ruleSpaces?" ":"")).repeat(oUe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const wle={blockquote:TRe,break:NV,code:LRe,definition:URe,emphasis:dle,hardBreak:NV,heading:$Re,html:hle,image:Ale,imageReference:fle,inlineCode:ple,link:gle,linkReference:yle,list:JRe,listItem:eUe,paragraph:tUe,root:rUe,strong:xle,text:aUe,thematicBreak:lUe};function cUe(){return{enter:{table:uUe,tableData:jV,tableHeader:jV,tableRow:hUe},exit:{codeText:AUe,table:dUe,tableData:dI,tableHeader:dI,tableRow:dI}}}function uUe(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 dUe(e){this.exit(e),this.data.inTable=void 0}function hUe(e){this.enter({type:"tableRow",children:[]},e)}function dI(e){this.exit(e)}function jV(e){this.enter({type:"tableCell",children:[]},e)}function AUe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,fUe));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function fUe(e,t){return t==="|"?t:e}function pUe(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:f,table:a,tableCell:l,tableRow:o}};function a(A,p,m,g){return u(d(A,m,g),A.align)}function o(A,p,m,g){const y=h(A,m,g),v=u([y]);return v.slice(0,v.indexOf(`
`))}function l(A,p,m,g){const y=m.enter("tableCell"),v=m.enter("phrasing"),x=m.containerPhrasing(A,{...g,before:s,after:s});return v(),y(),x}function u(A,p){return NRe(A,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function d(A,p,m){const g=A.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(A,p,m){const g=A.children;let y=-1;const v=[],x=p.enter("tableRow");for(;++y<g.length;)v[y]=l(g[y],A,p,m);return x(),v}function f(A,p,m){let g=wle.inlineCode(A,p,m);return m.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function mUe(){return{exit:{taskListCheckValueChecked:TV,taskListCheckValueUnchecked:TV,paragraph:yUe}}}function gUe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:vUe}}}function TV(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function yUe(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 vUe(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 l=wle.listItem(e,t,n,{...r,...o.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(d){return d+a}}function xUe(){return[JLe(),vRe(),CRe(),cUe(),mUe()]}function wUe(e){return{extensions:[ZLe(),xRe(e),SRe(),pUe(e),gUe()]}}const bUe={tokenize:EUe,partial:!0},ble={tokenize:NUe,partial:!0},Cle={tokenize:jUe,partial:!0},Sle={tokenize:TUe,partial:!0},CUe={tokenize:PUe,partial:!0},kle={name:"wwwAutolink",tokenize:BUe,previous:_le},Ble={name:"protocolAutolink",tokenize:_Ue,previous:Ele},Bd={name:"emailAutolink",tokenize:kUe,previous:Nle},hu={};function SUe(){return{text:hu}}let wf=48;for(;wf<123;)hu[wf]=Bd,wf++,wf===58?wf=65:wf===91&&(wf=97);hu[43]=Bd;hu[45]=Bd;hu[46]=Bd;hu[95]=Bd;hu[72]=[Bd,Ble];hu[104]=[Bd,Ble];hu[87]=[Bd,kle];hu[119]=[Bd,kle];function kUe(e,t,n){const r=this;let i,s;return a;function a(h){return!UF(h)||!Nle.call(r,r.previous)||S6(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(h))}function o(h){return UF(h)?(e.consume(h),o):h===64?(e.consume(h),l):n(h)}function l(h){return h===46?e.check(CUe,d,u)(h):h===45||h===95||$s(h)?(s=!0,e.consume(h),l):d(h)}function u(h){return e.consume(h),i=!0,l}function d(h){return s&&i&&la(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function BUe(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!_le.call(r,r.previous)||S6(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(bUe,e.attempt(ble,e.attempt(Cle,s),n),n)(a))}function s(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function _Ue(e,t,n){const r=this;let i="",s=!1;return a;function a(h){return(h===72||h===104)&&Ele.call(r,r.previous)&&!S6(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),o):n(h)}function o(h){if(la(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),o;if(h===58){const f=i.toLowerCase();if(f==="http"||f==="https")return e.consume(h),l}return n(h)}function l(h){return h===47?(e.consume(h),s?u:(s=!0,l)):n(h)}function u(h){return h===null||d_(h)||Zn(h)||Hp(h)||Bj(h)?n(h):e.attempt(ble,e.attempt(Cle,d),n)(h)}function d(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function EUe(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 NUe(e,t,n){let r,i,s;return a;function a(u){return u===46||u===95?e.check(Sle,l,o)(u):u===null||Zn(u)||Hp(u)||u!==45&&Bj(u)?l(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 l(u){return i||r||!s?n(u):t(u)}}function jUe(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(Sle,t,s)(a):a===null||Zn(a)||Hp(a)?t(a):(e.consume(a),i)}function s(a){return a===41&&r++,e.consume(a),i}}function TUe(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||Zn(o)||Hp(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||Zn(o)||Hp(o)?t(o):r(o)}function s(o){return la(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):la(o)?(e.consume(o),a):n(o)}}function PUe(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return $s(s)?n(s):t(s)}}function _le(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Zn(e)}function Ele(e){return!la(e)}function Nle(e){return!(e===47||UF(e))}function UF(e){return e===43||e===45||e===46||e===95||$s(e)}function S6(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 IUe={tokenize:QUe,partial:!0};function OUe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:RUe,continuation:{tokenize:UUe},exit:DUe}},text:{91:{name:"gfmFootnoteCall",tokenize:LUe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:FUe,resolveTo:MUe}}}}function FUe(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return n(l);const u=lc(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function MUe(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 LUe(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"),l}function l(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||Zn(h))return n(h);if(h===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(lc(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return Zn(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 RUe(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,o;return l;function l(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||Zn(p))return n(p);if(p===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return s=lc(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return Zn(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 f(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(s)||i.push(s),Bn(e,A,"gfmFootnoteDefinitionWhitespace")):n(p)}function A(p){return t(p)}}function UUe(e,t,n){return e.check(w2,t,e.attempt(IUe,t,n))}function DUe(e){e.exit("gfmFootnoteDefinition")}function QUe(e,t,n){const r=this;return Bn(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 HUe(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 l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let u=l;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[l][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[l][1].end)},h={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[l][1].start)},f=[["enter",d,o],["enter",a[u][1],o],["exit",a[u][1],o],["enter",h,o]],A=o.parser.constructs.insideSpan.null;A&&So(f,f.length,0,_j(A,a.slice(u+1,l),o)),So(f,f.length,0,[["exit",h,o],["enter",a[l][1],o],["exit",a[l][1],o],["exit",d,o]]),So(a,u-1,l-u+3,f),l=u+f.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function s(a,o,l){const u=this.previous,d=this.events;let h=0;return f;function f(p){return u===126&&d[d.length-1][1].type!=="characterEscape"?l(p):(a.enter("strikethroughSequenceTemporary"),A(p))}function A(p){const m=n0(u);if(p===126)return h>1?l(p):(a.consume(p),h++,A);if(h<2&&!n)return l(p);const g=a.exit("strikethroughSequenceTemporary"),y=n0(p);return g._open=!y||y===2&&!!m,g._close=!m||m===2&&!!y,o(p)}}}class $Ue{constructor(){this.map=[]}add(t,n,r){zUe(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 zUe(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 VUe(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 KUe(){return{flow:{null:{name:"table",tokenize:qUe,resolveAll:WUe}}}}function qUe(e,t,n){const r=this;let i=0,s=0,a;return o;function o(I){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"?S:l;return F===S&&r.parser.lazy[r.now().line]?n(I):F(I)}function l(I){return e.enter("tableHead"),e.enter("tableRow"),u(I)}function u(I){return I===124||(a=!0,s+=1),d(I)}function d(I){return I===null?n(I):Rt(I)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),A):n(I):hn(I)?Bn(e,d,"whitespace")(I):(s+=1,a&&(a=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),h(I)))}function h(I){return I===null||I===124||Zn(I)?(e.exit("data"),d(I)):(e.consume(I),I===92?f:h)}function f(I){return I===92||I===124?(e.consume(I),h):h(I)}function A(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,hn(I)?Bn(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):p(I))}function p(I){return I===45||I===58?g(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),m):w(I)}function m(I){return hn(I)?Bn(e,g,"whitespace")(I):g(I)}function g(I){return I===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),y):I===45?(s+=1,y(I)):I===null||Rt(I)?b(I):w(I)}function y(I){return I===45?(e.enter("tableDelimiterFiller"),v(I)):w(I)}function v(I){return I===45?(e.consume(I),v):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(I))}function x(I){return hn(I)?Bn(e,b,"whitespace")(I):b(I)}function b(I){return I===124?p(I):I===null||Rt(I)?!a||i!==s?w(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):w(I)}function w(I){return n(I)}function S(I){return e.enter("tableRow"),_(I)}function _(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),_):I===null||Rt(I)?(e.exit("tableRow"),t(I)):hn(I)?Bn(e,_,"whitespace")(I):(e.enter("data"),E(I))}function E(I){return I===null||I===124||Zn(I)?(e.exit("data"),_(I)):(e.consume(I),I===92?j:E)}function j(I){return I===92||I===124?(e.consume(I),E):E(I)}}function WUe(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,d,h;const f=new $Ue;for(;++n<e.length;){const A=e[n],p=A[1];A[0]==="enter"?p.type==="tableHead"?(o=!1,l!==0&&(PV(f,t,l,u,d),d=void 0,l=0),u={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},f.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)},f.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=uS(f,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=uS(f,t,s,i,void 0,h)),s=a,a=[s[1],n,0,0])):p.type==="tableHead"?(o=!0,l=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(l=n,s[1]!==0?(a[0]=a[1],h=uS(f,t,s,i,n,h)):a[1]!==0&&(h=uS(f,t,a,i,n,h)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&PV(f,t,l,u,d),f.consume(t.events),n=-1;++n<t.events.length;){const A=t.events[n];A[0]==="enter"&&A[1].type==="table"&&(A[1]._align=VUe(t.events,n))}return e}function uS(e,t,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(s.end=Object.assign({},Cg(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=Cg(t.events,n[1]);if(s={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=Cg(t.events,n[2]),d=Cg(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 f=t.events[n[2]],A=t.events[n[3]];if(f[1].end=Object.assign({},A[1].end),f[1].type="chunkText",f[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({},Cg(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function PV(e,t,n,r,i){const s=[],a=Cg(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 Cg(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const GUe={name:"tasklistCheck",tokenize:XUe};function YUe(){return{text:{91:GUe}}}function XUe(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return Zn(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return Rt(l)?t(l):hn(l)?e.check({tokenize:JUe},t,n)(l):n(l)}}function JUe(e,t,n){return Bn(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function ZUe(e){return Uoe([SUe(),OUe(),HUe(e),KUe(),YUe()])}const eDe={};function tDe(e){const t=this,n=e||eDe,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(ZUe(n)),s.push(xUe()),a.push(wUe(n))}const IV="616-403-6393",nDe=["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?"],rDe=({onPick:e})=>c.jsxs("div",{className:"space-y-3",children:[c.jsxs("p",{className:"text-xs uppercase tracking-[0.2em] text-muted-foreground flex items-center gap-2",children:[c.jsx(zs,{size:12,className:"text-gold"}),"Try asking"]}),c.jsx("div",{className:"flex flex-wrap gap-2",children:nDe.map(t=>c.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))})]}),iDe=/^(https?:|mailto:|tel:|sms:|\/|#)/i,sDe=e=>iDe.test(e)?e:"",aDe=({href:e,children:t,...n})=>{const r=e&&/^https?:/i.test(e),i=e&&/^(sms:|tel:|mailto:)/i.test(e);return c.jsx("a",{href:e,...r?{target:"_blank",rel:"noopener noreferrer"}:{},...i?{rel:"noopener"}:{},...n,children:t})},oDe="https://khmmwvmdbhaplcfcndjx.supabase.co/functions/v1/faq-concierge",lDe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",cDe=()=>{const[e,t]=k.useState([]),[n,r]=k.useState(""),[i,s]=k.useState(!1),[a,o]=k.useState(null),l=k.useRef(null),u=k.useRef(null);k.useEffect(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[e,i]);const d=async A=>{const p=A.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(oDe,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${lDe}`},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 ${IV}.`),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 ${IV} and he'll get back to you fast.`)}finally{s(!1)}},h=A=>{A.preventDefault(),d(n)},f=A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),d(n))};return c.jsxs("div",{className:"border border-border bg-card flex flex-col",style:{minHeight:"min(70vh, 700px)"},children:[c.jsxs("div",{ref:l,className:"flex-1 overflow-y-auto p-4 md:p-6 space-y-6",style:{maxHeight:"60vh"},children:[e.length===0&&c.jsxs("div",{className:"space-y-6 py-4",children:[c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("div",{className:"w-9 h-9 rounded-full bg-primary text-primary-foreground flex items-center justify-center shrink-0",children:c.jsx(Mk,{size:18})}),c.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."})]}),c.jsx(rDe,{onPick:A=>d(A)})]}),e.map((A,p)=>c.jsxs("div",{className:`flex items-start gap-3 ${A.role==="user"?"flex-row-reverse":""}`,children:[c.jsx("div",{className:`w-9 h-9 rounded-full flex items-center justify-center shrink-0 ${A.role==="user"?"bg-gold/20 text-gold border border-gold/30":"bg-primary text-primary-foreground"}`,children:A.role==="user"?c.jsx($B,{size:16}):c.jsx(Mk,{size:18})}),c.jsx("div",{className:`px-4 py-3 text-sm max-w-[85%] ${A.role==="user"?"bg-primary text-primary-foreground":"bg-secondary text-foreground"}`,children:A.role==="assistant"?c.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:c.jsx(w6,{remarkPlugins:[tDe],urlTransform:sDe,components:{a:aDe},children:A.content})}):c.jsx("p",{className:"whitespace-pre-wrap",children:A.content})})]},p)),i&&c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("div",{className:"w-9 h-9 rounded-full bg-primary text-primary-foreground flex items-center justify-center shrink-0",children:c.jsx(Mk,{size:18})}),c.jsxs("div",{className:"bg-secondary px-4 py-3 text-sm text-muted-foreground flex items-center gap-2",children:[c.jsx(ga,{size:14,className:"animate-spin"}),"Searching the site…"]})]}),a&&c.jsx("div",{className:"bg-destructive/10 border border-destructive/30 px-4 py-3 text-sm text-destructive",children:a})]}),c.jsxs("form",{onSubmit:h,className:"border-t border-border p-3 md:p-4 flex gap-2 bg-background",children:[c.jsx("textarea",{ref:u,value:n,onChange:A=>r(A.target.value),onKeyDown:f,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"}}),c.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?c.jsx(ga,{size:16,className:"animate-spin"}):c.jsx(dre,{size:16}),c.jsx("span",{className:"hidden sm:inline text-xs uppercase tracking-wider font-medium",children:"Send"})]})]})]})};function uDe(){return dr({queryKey:["all-faqs-aggregated"],queryFn:async()=>{var u,d,h,f;const[e,t]=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")]),n=e.data||[],r=t.data||[],i={};n.forEach(A=>i[A.id]=A);const s=A=>{const p=i[A.category_id];if(!p)return"/blog";if(p.parent_id){const m=i[p.parent_id];return m?`/${m.slug}/${p.slug}/${A.slug}`:`/${p.slug}/${A.slug}`}return`/${p.slug}/${A.slug}`},a=A=>{if(A.parent_id){const p=i[A.parent_id];return p?`/${p.slug}/${A.slug}`:`/${A.slug}`}return`/${A.slug}`},o={},l=A=>{const p=A.parent_id&&i[A.parent_id]||A;return o[p.id]||(o[p.id]={categoryName:p.name,categorySlug:p.slug,faqs:[]}),o[p.id]};for(const A of n){const p=Array.isArray(A.faq_json)?A.faq_json:[],m=a(A),g=l(A);for(const y of p)!(y!=null&&y.question)||!(y!=null&&y.answer)||g.faqs.push({question:y.question,answer:y.answer,sourceUrl:m,sourceTitle:A.name,category:((u=i[A.parent_id])==null?void 0:u.name)||A.name,categorySlug:((d=i[A.parent_id])==null?void 0:d.slug)||A.slug})}for(const A of r){const p=i[A.category_id];if(!p)continue;const m=Array.isArray(A.faq_json)?A.faq_json:[],g=s(A),y=l(p);for(const v of m)!(v!=null&&v.question)||!(v!=null&&v.answer)||y.faqs.push({question:v.question,answer:v.answer,sourceUrl:g,sourceTitle:A.h1||A.title,category:((h=i[p.parent_id])==null?void 0:h.name)||p.name,categorySlug:((f=i[p.parent_id])==null?void 0:f.slug)||p.slug})}return Object.values(o).filter(A=>A.faqs.length>0).sort((A,p)=>A.categoryName.localeCompare(p.categoryName))},staleTime:1e3*60*10})}function dDe(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 l=0;for(const u of n)l+=(a.split(u).length-1)*3,l+=o.split(u).length-1;l>0&&r.push({...s,_score:l})}return r.sort((i,s)=>s._score-i._score),r.slice(0,30).map(({_score:i,...s})=>s)}const hDe=()=>{const{data:e,isLoading:t}=uDe(),[n,r]=k.useState(""),[i,s]=k.useState(null),[a,o]=k.useState(null),l=k.useMemo(()=>!e||!n.trim()?[]:dDe(e,n),[e,n]),u=(e||[]).reduce((d,h)=>d+h.faqs.length,0);return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"heading-section mb-2",children:"Browse all questions"}),c.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.`})]}),c.jsxs("div",{className:"relative",children:[c.jsx(YN,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-muted-foreground"}),c.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()&&c.jsxs("div",{className:"space-y-2",children:[c.jsxs("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:[l.length," match",l.length===1?"":"es"]}),l.length===0&&c.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."}),c.jsx("div",{className:"space-y-2",children:l.map((d,h)=>{const f=`search-${h}`,A=a===f;return c.jsxs("div",{className:"border border-border bg-card overflow-hidden",children:[c.jsxs("button",{onClick:()=>o(A?null:f),className:"w-full flex items-start gap-3 p-4 text-left hover:bg-secondary/50 transition-colors",children:[c.jsx(oc,{size:16,className:`mt-0.5 shrink-0 text-gold transition-transform ${A?"rotate-90":""}`}),c.jsxs("div",{className:"flex-1",children:[c.jsx("p",{className:"font-medium text-foreground text-sm",children:d.question}),c.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground mt-1",children:d.category})]})]}),A&&c.jsxs("div",{className:"px-4 pb-4 pl-11 space-y-3",children:[c.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap",children:d.answer}),c.jsxs(Ct,{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,c.jsx(Ka,{size:11})]})]})]},f)})})]}),!n.trim()&&c.jsx("div",{className:"space-y-3",children:(e||[]).map(d=>{const h=i===d.categorySlug;return c.jsxs("div",{className:"border border-border bg-card overflow-hidden",children:[c.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:[c.jsxs("div",{className:"text-left",children:[c.jsx("p",{className:"font-medium text-foreground",children:d.categoryName}),c.jsxs("p",{className:"text-xs uppercase tracking-wider text-muted-foreground mt-0.5",children:[d.faqs.length," question",d.faqs.length===1?"":"s"]})]}),c.jsx(ac,{size:16,className:`text-gold transition-transform ${h?"rotate-180":""}`})]}),h&&c.jsx("div",{className:"border-t border-border divide-y divide-border",children:d.faqs.map((f,A)=>{const p=`${d.categorySlug}-${A}`,m=a===p;return c.jsxs("div",{children:[c.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:[c.jsx(oc,{size:14,className:`mt-1 shrink-0 text-gold transition-transform ${m?"rotate-90":""}`}),c.jsx("p",{className:"flex-1 text-sm text-foreground",children:f.question})]}),m&&c.jsxs("div",{className:"px-4 pb-4 pl-11 space-y-3",children:[c.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap",children:f.answer}),c.jsxs(Ct,{to:f.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 ",f.sourceTitle,c.jsx(Ka,{size:11})]})]})]},p)})})]},d.categorySlug)})})]})},ADe=()=>c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsx("title",{children:"Ask Holden Anything | Grand Rapids Real Estate FAQ"}),c.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."}),c.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/faq"}),c.jsx("meta",{property:"og:title",content:"Ask Holden Anything | Grand Rapids Real Estate FAQ"}),c.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."}),c.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/faq"}),c.jsx("meta",{property:"og:type",content:"website"}),c.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image.jpg"}),c.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),c.jsx("meta",{name:"twitter:title",content:"Ask Holden Anything | Grand Rapids Real Estate FAQ"}),c.jsx("meta",{name:"twitter:description",content:"AI-powered answers to every Grand Rapids real estate question."}),c.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"}]})}),c.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"}})})]}),c.jsx("section",{className:"bg-secondary -mt-20 pt-32 md:pt-40 pb-12 md:pb-16",children:c.jsx("div",{className:"container-page text-center max-w-3xl",children:c.jsxs(ke,{children:[c.jsxs("p",{className:"text-caption text-muted-foreground mb-4 flex items-center justify-center gap-2",children:[c.jsx(zs,{size:12,className:"text-gold"}),"AI Concierge"]}),c.jsx("h1",{className:"heading-display mb-6",children:"Ask Holden Anything"}),c.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."})]})})}),c.jsx("section",{className:"section-padding bg-background",children:c.jsx("div",{className:"container-page max-w-4xl",children:c.jsx(ke,{children:c.jsx(cDe,{})})})}),c.jsx("section",{className:"section-padding bg-secondary/30",children:c.jsx("div",{className:"container-page max-w-4xl",children:c.jsx(ke,{children:c.jsx(hDe,{})})})})]}),fDe=GN("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 cr({className:e,variant:t,...n}){return c.jsx("div",{className:pt(fDe({variant:t}),e),...n})}const hI=10,jle=({categoryId:e,parentCategorySlug:t})=>{const[n,r]=k.useState(1),{data:i,isLoading:s}=dr({queryKey:["news-releases",e],queryFn:async()=>{const{data:h,error:f}=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(f)throw f;return h}}),a=i||[],o=Math.max(1,Math.ceil(a.length/hI)),l=a.slice((n-1)*hI,n*hI),u=h=>{const A=(h.intro_text||h.body_content||"").replace(/<[^>]*>/g,"").trim();return A.length<=200?A:A.slice(0,200).replace(/\s+\S*$/,"")+"…"},d=h=>h?new Date(h).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):"";return c.jsxs("div",{className:"bg-background",children:[c.jsx("section",{className:"py-16 md:py-20",children:c.jsx("div",{className:"container-page max-w-4xl mx-auto",children:c.jsxs(ke,{children:[c.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-4 font-semibold",children:"Press & Media"}),c.jsx("h2",{className:"font-serif text-3xl md:text-4xl font-light mb-4 text-foreground",children:"News & Press Releases"}),c.jsx("div",{className:"w-16 h-px bg-accent mb-6"}),c.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."})]})})}),c.jsx("div",{className:"container-page max-w-4xl mx-auto",children:c.jsx("div",{className:"h-px bg-gradient-to-r from-accent/40 via-border/60 to-transparent"})}),c.jsx("section",{className:"py-12 md:py-16",children:c.jsx("div",{className:"container-page max-w-4xl mx-auto",children:s?c.jsx("div",{className:"space-y-6",children:[1,2,3].map(h=>c.jsx("div",{className:"h-40 bg-secondary/30 animate-pulse rounded"},h))}):a.length===0?c.jsx("div",{className:"text-center py-16",children:c.jsx("p",{className:"text-muted-foreground text-lg",children:"No press releases published yet."})}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"space-y-6",children:l.map((h,f)=>{const A=h.press_links,p=[A==null?void 0:A.national,A==null?void 0:A.local,A==null?void 0:A.source].filter(Boolean).length;return c.jsx(ke,{delay:f*.05,children:c.jsx("article",{className:"group border border-border/50 hover:border-accent/30 transition-all duration-300 bg-background",children:c.jsxs("div",{className:"p-6 md:p-8",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-3",children:[c.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[c.jsx(ll,{className:"w-3.5 h-3.5"}),d(h.published_at||h.created_at)]}),p>0&&c.jsxs(cr,{variant:"secondary",className:"text-xs font-normal",children:["Featured in ",p," outlet",p>1?"s":""]})]}),c.jsx(Ct,{to:`/${t}/news/${h.slug}`,className:"block group-hover:text-accent transition-colors",children:c.jsx("h3",{className:"font-serif text-xl md:text-2xl font-medium leading-snug mb-3",children:h.h1||h.title})}),h.subheadline&&c.jsx("p",{className:"text-accent/80 text-sm font-medium mb-2",children:h.subheadline}),c.jsx("p",{className:"text-foreground/65 leading-relaxed mb-4 text-[0.95rem]",children:u(h)}),c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[A&&c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[c.jsx("span",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"As seen in:"}),A.national&&c.jsxs("a",{href:A.national,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-accent hover:underline",children:["National ",c.jsx(Ka,{className:"w-3 h-3"})]}),A.local&&c.jsxs("a",{href:A.local,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-accent hover:underline",children:["Local ",c.jsx(Ka,{className:"w-3 h-3"})]}),A.source&&c.jsxs("a",{href:A.source,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-accent hover:underline",children:["Source ",c.jsx(Ka,{className:"w-3 h-3"})]})]}),c.jsxs(Ct,{to:`/${t}/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 ",c.jsx(Ma,{className:"w-4 h-4"})]})]})]})})},h.id)})}),o>1&&c.jsxs("div",{className:"flex items-center justify-center gap-4 mt-12",children:[c.jsxs(Be,{variant:"outline",size:"sm",disabled:n===1,onClick:()=>r(h=>Math.max(1,h-1)),children:[c.jsx(nre,{className:"w-4 h-4 mr-1"})," Previous"]}),c.jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",n," of ",o]}),c.jsxs(Be,{variant:"outline",size:"sm",disabled:n===o,onClick:()=>r(h=>Math.min(o,h+1)),children:["Next ",c.jsx(oc,{className:"w-4 h-4 ml-1"})]})]})]})})})]})},pDe=()=>{const{data:e,isLoading:t}=dr({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 c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsx("title",{children:"News & Press | Holden Richardson | Grand Rapids Realtor"}),c.jsx("meta",{name:"description",content:"Latest press coverage, market news, and announcements from Holden Richardson — Grand Rapids Realtor at 616 Realty LLC."}),c.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/news"}),c.jsx("meta",{property:"og:title",content:"News & Press | Holden Richardson"}),c.jsx("meta",{property:"og:description",content:"Latest press coverage and announcements from Grand Rapids Realtor Holden Richardson."}),c.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/news"}),c.jsx("meta",{property:"og:type",content:"website"}),c.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"}]})})]}),c.jsx("section",{className:"bg-secondary -mt-20 pt-32 md:pt-40 pb-12 md:pb-16",children:c.jsx("div",{className:"container-page text-center max-w-3xl",children:c.jsxs(ke,{children:[c.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"News & Press"}),c.jsx("h1",{className:"heading-display mb-6",children:"In the News"}),c.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."})]})})}),c.jsx("section",{className:"section-padding bg-background",children:c.jsxs("div",{className:"container-page max-w-5xl",children:[t&&c.jsx("p",{className:"text-center text-muted-foreground",children:"Loading…"}),e&&c.jsx(jle,{categoryId:e.id,parentCategorySlug:""})]})})]})};var AI="focusScope.autoFocusOnMount",fI="focusScope.autoFocusOnUnmount",OV={bubbles:!1,cancelable:!0},mDe="FocusScope",Tj=k.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=e,[o,l]=k.useState(null),u=Mi(i),d=Mi(s),h=k.useRef(null),f=tn(t,m=>l(m)),A=k.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;k.useEffect(()=>{if(r){let m=function(x){if(A.paused||!o)return;const b=x.target;o.contains(b)?h.current=b:ah(h.current,{select:!0})},g=function(x){if(A.paused||!o)return;const b=x.relatedTarget;b!==null&&(o.contains(b)||ah(h.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const w of x)w.removedNodes.length>0&&ah(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,A.paused]),k.useEffect(()=>{if(o){MV.add(A);const m=document.activeElement;if(!o.contains(m)){const y=new CustomEvent(AI,OV);o.addEventListener(AI,u),o.dispatchEvent(y),y.defaultPrevented||(gDe(bDe(Tle(o)),{select:!0}),document.activeElement===m&&ah(o))}return()=>{o.removeEventListener(AI,u),setTimeout(()=>{const y=new CustomEvent(fI,OV);o.addEventListener(fI,d),o.dispatchEvent(y),y.defaultPrevented||ah(m??document.body,{select:!0}),o.removeEventListener(fI,d),MV.remove(A)},0)}}},[o,u,d,A]);const p=k.useCallback(m=>{if(!n&&!r||A.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]=yDe(v);x&&b?!m.shiftKey&&y===b?(m.preventDefault(),n&&ah(x,{select:!0})):m.shiftKey&&y===x&&(m.preventDefault(),n&&ah(b,{select:!0})):y===v&&m.preventDefault()}},[n,r,A.paused]);return c.jsx(_t.div,{tabIndex:-1,...a,ref:f,onKeyDown:p})});Tj.displayName=mDe;function gDe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ah(r,{select:t}),document.activeElement!==n)return}function yDe(e){const t=Tle(e),n=FV(t,e),r=FV(t.reverse(),e);return[n,r]}function Tle(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 FV(e,t){for(const n of e)if(!vDe(n,{upTo:t}))return n}function vDe(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 xDe(e){return e instanceof HTMLInputElement&&"select"in e}function ah(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&xDe(e)&&t&&e.select()}}var MV=wDe();function wDe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=LV(e,t),e.unshift(t)},remove(t){var n;e=LV(e,t),(n=e[0])==null||n.resume()}}}function LV(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function bDe(e){return e.filter(t=>t.tagName!=="A")}var pI=0;function k6(){k.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??RV()),document.body.insertAdjacentElement("beforeend",e[1]??RV()),pI++,()=>{pI===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),pI--}},[])}function RV(){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 Gk="right-scroll-bar-position",Yk="width-before-scroll-bar",CDe="with-scroll-bars-hidden",SDe="--removed-body-scroll-bar-size";function mI(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function kDe(e,t){var n=k.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 BDe=typeof window<"u"?k.useLayoutEffect:k.useEffect,UV=new WeakMap;function _De(e,t){var n=kDe(null,function(r){return e.forEach(function(i){return mI(i,r)})});return BDe(function(){var r=UV.get(n);if(r){var i=new Set(r),s=new Set(e),a=n.current;i.forEach(function(o){s.has(o)||mI(o,null)}),s.forEach(function(o){i.has(o)||mI(o,a)})}UV.set(n,e)},[e]),n}function EDe(e){return e}function NDe(e,t){t===void 0&&(t=EDe);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 l=function(){var d=a;a=[],d.forEach(s)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return i}function jDe(e){e===void 0&&(e={});var t=NDe(null);return t.options=$c({async:!0,ssr:!1},e),t}var Ple=function(e){var t=e.sideCar,n=tv(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 k.createElement(r,$c({},n))};Ple.isSideCarExport=!0;function TDe(e,t){return e.useMedium(t),Ple}var Ile=jDe(),gI=function(){},Pj=k.forwardRef(function(e,t){var n=k.useRef(null),r=k.useState({onScrollCapture:gI,onWheelCapture:gI,onTouchMoveCapture:gI}),i=r[0],s=r[1],a=e.forwardProps,o=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,f=e.sideCar,A=e.noRelative,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,x=e.gapMode,b=tv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=f,S=_De([n,t]),_=$c($c({},b),i);return k.createElement(k.Fragment,null,d&&k.createElement(w,{sideCar:Ile,removeScrollBar:u,shards:h,noRelative:A,noIsolation:p,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:x}),a?k.cloneElement(k.Children.only(o),$c($c({},_),{ref:S})):k.createElement(v,$c({},_,{className:l,ref:S}),o))});Pj.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Pj.classNames={fullWidth:Yk,zeroRight:Gk};var PDe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function IDe(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=PDe();return t&&e.setAttribute("nonce",t),e}function ODe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function FDe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var MDe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=IDe())&&(ODe(t,n),FDe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},LDe=function(){var e=MDe();return function(t,n){k.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ole=function(){var e=LDe(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},RDe={left:0,top:0,right:0,gap:0},yI=function(e){return parseInt(e||"",10)||0},UDe=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[yI(n),yI(r),yI(i)]},DDe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return RDe;var t=UDe(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])}},QDe=Ole(),py="data-scroll-locked",HDe=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(CDe,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(o,"px ").concat(r,`;
  }
  body[`).concat(py,`] {
    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(Gk,` {
    right: `).concat(o,"px ").concat(r,`;
  }
  
  .`).concat(Yk,` {
    margin-right: `).concat(o,"px ").concat(r,`;
  }
  
  .`).concat(Gk," .").concat(Gk,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(Yk," .").concat(Yk,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(py,`] {
    `).concat(SDe,": ").concat(o,`px;
  }
`)},DV=function(){var e=parseInt(document.body.getAttribute(py)||"0",10);return isFinite(e)?e:0},$De=function(){k.useEffect(function(){return document.body.setAttribute(py,(DV()+1).toString()),function(){var e=DV()-1;e<=0?document.body.removeAttribute(py):document.body.setAttribute(py,e.toString())}},[])},zDe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;$De();var s=k.useMemo(function(){return DDe(i)},[i]);return k.createElement(QDe,{styles:HDe(s,!t,i,n?"":"!important")})},DF=!1;if(typeof window<"u")try{var dS=Object.defineProperty({},"passive",{get:function(){return DF=!0,!0}});window.addEventListener("test",dS,dS),window.removeEventListener("test",dS,dS)}catch{DF=!1}var Xm=DF?{passive:!1}:!1,VDe=function(e){return e.tagName==="TEXTAREA"},Fle=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!VDe(e)&&n[t]==="visible")},KDe=function(e){return Fle(e,"overflowY")},qDe=function(e){return Fle(e,"overflowX")},QV=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Mle(e,r);if(i){var s=Lle(e,r),a=s[1],o=s[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},WDe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},GDe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Mle=function(e,t){return e==="v"?KDe(t):qDe(t)},Lle=function(e,t){return e==="v"?WDe(t):GDe(t)},YDe=function(e,t){return e==="h"&&t==="rtl"?-1:1},XDe=function(e,t,n,r,i){var s=YDe(e,window.getComputedStyle(t).direction),a=s*r,o=n.target,l=t.contains(o),u=!1,d=a>0,h=0,f=0;do{if(!o)break;var A=Lle(e,o),p=A[0],m=A[1],g=A[2],y=m-g-s*p;(p||y)&&Mle(e,o)&&(h+=y,f+=p);var v=o.parentNode;o=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&o!==document.body||l&&(t.contains(o)||t===o));return(d&&(Math.abs(h)<1||!i)||!d&&(Math.abs(f)<1||!i))&&(u=!0),u},hS=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},HV=function(e){return[e.deltaX,e.deltaY]},$V=function(e){return e&&"current"in e?e.current:e},JDe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ZDe=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},e6e=0,Jm=[];function t6e(e){var t=k.useRef([]),n=k.useRef([0,0]),r=k.useRef(),i=k.useState(e6e++)[0],s=k.useState(Ole)[0],a=k.useRef(e);k.useEffect(function(){a.current=e},[e]),k.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var m=j5e([e.lockRef.current],(e.shards||[]).map($V),!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=k.useCallback(function(m,g){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!a.current.allowPinchZoom;var y=hS(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,S=m.target,_=Math.abs(x)>Math.abs(b)?"h":"v";if("touches"in m&&_==="h"&&S.type==="range")return!1;var E=QV(_,S);if(!E)return!0;if(E?w=_:(w=_==="v"?"h":"v",E=QV(_,S)),!E)return!1;if(!r.current&&"changedTouches"in m&&(x||b)&&(r.current=w),!w)return!0;var j=r.current||w;return XDe(j,g,m,j==="h"?x:b,!0)},[]),l=k.useCallback(function(m){var g=m;if(!(!Jm.length||Jm[Jm.length-1]!==s)){var y="deltaY"in g?HV(g):hS(g),v=t.current.filter(function(w){return w.name===g.type&&(w.target===g.target||g.target===w.shadowParent)&&JDe(w.delta,y)})[0];if(v&&v.should){g.cancelable&&g.preventDefault();return}if(!v){var x=(a.current.shards||[]).map($V).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=k.useCallback(function(m,g,y,v){var x={name:m,delta:g,target:y,should:v,shadowParent:n6e(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(b){return b!==x})},1)},[]),d=k.useCallback(function(m){n.current=hS(m),r.current=void 0},[]),h=k.useCallback(function(m){u(m.type,HV(m),m.target,o(m,e.lockRef.current))},[]),f=k.useCallback(function(m){u(m.type,hS(m),m.target,o(m,e.lockRef.current))},[]);k.useEffect(function(){return Jm.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Xm),document.addEventListener("touchmove",l,Xm),document.addEventListener("touchstart",d,Xm),function(){Jm=Jm.filter(function(m){return m!==s}),document.removeEventListener("wheel",l,Xm),document.removeEventListener("touchmove",l,Xm),document.removeEventListener("touchstart",d,Xm)}},[]);var A=e.removeScrollBar,p=e.inert;return k.createElement(k.Fragment,null,p?k.createElement(s,{styles:ZDe(i)}):null,A?k.createElement(zDe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function n6e(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const r6e=TDe(Ile,t6e);var Ij=k.forwardRef(function(e,t){return k.createElement(Pj,$c({},e,{ref:t,sideCar:r6e}))});Ij.classNames=Pj.classNames;var i6e=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Zm=new WeakMap,AS=new WeakMap,fS={},vI=0,Rle=function(e){return e&&(e.host||Rle(e.parentNode))},s6e=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Rle(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})},a6e=function(e,t,n,r){var i=s6e(t,Array.isArray(e)?e:[e]);fS[n]||(fS[n]=new WeakMap);var s=fS[n],a=[],o=new Set,l=new Set(i),u=function(h){!h||o.has(h)||(o.add(h),u(h.parentNode))};i.forEach(u);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(f){if(o.has(f))d(f);else try{var A=f.getAttribute(r),p=A!==null&&A!=="false",m=(Zm.get(f)||0)+1,g=(s.get(f)||0)+1;Zm.set(f,m),s.set(f,g),a.push(f),m===1&&p&&AS.set(f,!0),g===1&&f.setAttribute(n,"true"),p||f.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",f,y)}})};return d(t),o.clear(),vI++,function(){a.forEach(function(h){var f=Zm.get(h)-1,A=s.get(h)-1;Zm.set(h,f),s.set(h,A),f||(AS.has(h)||h.removeAttribute(r),AS.delete(h)),A||h.removeAttribute(n)}),vI--,vI||(Zm=new WeakMap,Zm=new WeakMap,AS=new WeakMap,fS={})}},B6=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=i6e(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),a6e(r,i,n,"aria-hidden")):function(){return null}},Oj="Dialog",[Ule,Dle]=qs(Oj),[o6e,mc]=Ule(Oj),Qle=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,o=k.useRef(null),l=k.useRef(null),[u,d]=Bo({prop:r,defaultProp:i??!1,onChange:s,caller:Oj});return c.jsx(o6e,{scope:t,triggerRef:o,contentRef:l,contentId:cl(),titleId:cl(),descriptionId:cl(),open:u,onOpenChange:d,onOpenToggle:k.useCallback(()=>d(h=>!h),[d]),modal:a,children:n})};Qle.displayName=Oj;var Hle="DialogTrigger",$le=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=mc(Hle,n),s=tn(t,i.triggerRef);return c.jsx(_t.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":N6(i.open),...r,ref:s,onClick:at(e.onClick,i.onOpenToggle)})});$le.displayName=Hle;var _6="DialogPortal",[l6e,zle]=Ule(_6,{forceMount:void 0}),Vle=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,s=mc(_6,t);return c.jsx(l6e,{scope:t,forceMount:n,children:k.Children.map(r,a=>c.jsx(ba,{present:n||s.open,children:c.jsx(a2,{asChild:!0,container:i,children:a})}))})};Vle.displayName=_6;var p_="DialogOverlay",Kle=k.forwardRef((e,t)=>{const n=zle(p_,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=mc(p_,e.__scopeDialog);return s.modal?c.jsx(ba,{present:r||s.open,children:c.jsx(u6e,{...i,ref:t})}):null});Kle.displayName=p_;var c6e=Fp("DialogOverlay.RemoveScroll"),u6e=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=mc(p_,n);return c.jsx(Ij,{as:c6e,allowPinchZoom:!0,shards:[i.contentRef],children:c.jsx(_t.div,{"data-state":N6(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),$p="DialogContent",qle=k.forwardRef((e,t)=>{const n=zle($p,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=mc($p,e.__scopeDialog);return c.jsx(ba,{present:r||s.open,children:s.modal?c.jsx(d6e,{...i,ref:t}):c.jsx(h6e,{...i,ref:t})})});qle.displayName=$p;var d6e=k.forwardRef((e,t)=>{const n=mc($p,e.__scopeDialog),r=k.useRef(null),i=tn(t,n.contentRef,r);return k.useEffect(()=>{const s=r.current;if(s)return B6(s)},[]),c.jsx(Wle,{...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())})}),h6e=k.forwardRef((e,t)=>{const n=mc($p,e.__scopeDialog),r=k.useRef(!1),i=k.useRef(!1);return c.jsx(Wle,{...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 l,u;(l=e.onInteractOutside)==null||l.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()}})}),Wle=k.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=e,o=mc($p,n),l=k.useRef(null),u=tn(t,l);return k6(),c.jsxs(c.Fragment,{children:[c.jsx(Tj,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:c.jsx($0,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":N6(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(f6e,{titleId:o.titleId}),c.jsx(m6e,{contentRef:l,descriptionId:o.descriptionId})]})]})}),E6="DialogTitle",Gle=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=mc(E6,n);return c.jsx(_t.h2,{id:i.titleId,...r,ref:t})});Gle.displayName=E6;var Yle="DialogDescription",Xle=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=mc(Yle,n);return c.jsx(_t.p,{id:i.descriptionId,...r,ref:t})});Xle.displayName=Yle;var Jle="DialogClose",Zle=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=mc(Jle,n);return c.jsx(_t.button,{type:"button",...r,ref:t,onClick:at(e.onClick,()=>i.onOpenChange(!1))})});Zle.displayName=Jle;function N6(e){return e?"open":"closed"}var ece="DialogTitleWarning",[A6e,tce]=obe(ece,{contentName:$p,titleName:E6,docsSlug:"dialog"}),f6e=({titleId:e})=>{const t=tce(ece),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 k.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},p6e="DialogDescriptionWarning",m6e=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${tce(p6e).contentName}}.`;return k.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},nce=Qle,g6e=$le,rce=Vle,j6=Kle,T6=qle,P6=Gle,I6=Xle,O6=Zle;const qc=nce,y6e=rce,ice=k.forwardRef(({className:e,...t},n)=>c.jsx(j6,{ref:n,className:pt("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}));ice.displayName=j6.displayName;const Zl=k.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(y6e,{children:[c.jsx(ice,{}),c.jsxs(T6,{ref:r,className:pt("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,c.jsxs(O6,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[c.jsx(qa,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Zl.displayName=T6.displayName;const ec=({className:e,...t})=>c.jsx("div",{className:pt("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ec.displayName="DialogHeader";const tc=k.forwardRef(({className:e,...t},n)=>c.jsx(P6,{ref:n,className:pt("text-lg font-semibold leading-none tracking-tight",e),...t}));tc.displayName=P6.displayName;const v6e=k.forwardRef(({className:e,...t},n)=>c.jsx(I6,{ref:n,className:pt("text-sm text-muted-foreground",e),...t}));v6e.displayName=I6.displayName;const F6=k.forwardRef(({className:e,...t},n)=>c.jsx("div",{className:"relative w-full overflow-auto",children:c.jsx("table",{ref:n,className:pt("w-full caption-bottom text-sm",e),...t})}));F6.displayName="Table";const M6=k.forwardRef(({className:e,...t},n)=>c.jsx("thead",{ref:n,className:pt("[&_tr]:border-b",e),...t}));M6.displayName="TableHeader";const L6=k.forwardRef(({className:e,...t},n)=>c.jsx("tbody",{ref:n,className:pt("[&_tr:last-child]:border-0",e),...t}));L6.displayName="TableBody";const x6e=k.forwardRef(({className:e,...t},n)=>c.jsx("tfoot",{ref:n,className:pt("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));x6e.displayName="TableFooter";const my=k.forwardRef(({className:e,...t},n)=>c.jsx("tr",{ref:n,className:pt("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));my.displayName="TableRow";const Ta=k.forwardRef(({className:e,...t},n)=>c.jsx("th",{ref:n,className:pt("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));Ta.displayName="TableHead";const oa=k.forwardRef(({className:e,...t},n)=>c.jsx("td",{ref:n,className:pt("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));oa.displayName="TableCell";const w6e=k.forwardRef(({className:e,...t},n)=>c.jsx("caption",{ref:n,className:pt("mt-4 text-sm text-muted-foreground",e),...t}));w6e.displayName="TableCaption";function R6(e){const t=k.useRef({value:e,previous:e});return k.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Fj="Switch",[b6e,Ojt]=qs(Fj),[C6e,S6e]=b6e(Fj),sce=k.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:s,required:a,disabled:o,value:l="on",onCheckedChange:u,form:d,...h}=e,[f,A]=k.useState(null),p=tn(t,x=>A(x)),m=k.useRef(!1),g=f?d||!!f.closest("form"):!0,[y,v]=Bo({prop:i,defaultProp:s??!1,onChange:u,caller:Fj});return c.jsxs(C6e,{scope:n,checked:y,disabled:o,children:[c.jsx(_t.button,{type:"button",role:"switch","aria-checked":y,"aria-required":a,"data-state":cce(y),"data-disabled":o?"":void 0,disabled:o,value:l,...h,ref:p,onClick:at(e.onClick,x=>{v(b=>!b),g&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})}),g&&c.jsx(lce,{control:f,bubbles:!m.current,name:r,value:l,checked:y,required:a,disabled:o,form:d,style:{transform:"translateX(-100%)"}})]})});sce.displayName=Fj;var ace="SwitchThumb",oce=k.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=S6e(ace,n);return c.jsx(_t.span,{"data-state":cce(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});oce.displayName=ace;var k6e="SwitchBubbleInput",lce=k.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},s)=>{const a=k.useRef(null),o=tn(a,s),l=R6(n),u=WU(t);return k.useEffect(()=>{const d=a.current;if(!d)return;const h=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(h,"checked").set;if(l!==n&&A){const p=new Event("click",{bubbles:r});A.call(d,n),d.dispatchEvent(p)}},[l,n,r]),c.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}})});lce.displayName=k6e;function cce(e){return e?"checked":"unchecked"}var uce=sce,B6e=oce;const cc=k.forwardRef(({className:e,...t},n)=>c.jsx(uce,{className:pt("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:c.jsx(B6e,{className:pt("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")})}));cc.displayName=uce.displayName;var dce={exports:{}},hce={};/**
 * @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 r0=k;function _6e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var E6e=typeof Object.is=="function"?Object.is:_6e,N6e=r0.useState,j6e=r0.useEffect,T6e=r0.useLayoutEffect,P6e=r0.useDebugValue;function I6e(e,t){var n=t(),r=N6e({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return T6e(function(){i.value=n,i.getSnapshot=t,xI(i)&&s({inst:i})},[e,n,t]),j6e(function(){return xI(i)&&s({inst:i}),e(function(){xI(i)&&s({inst:i})})},[e]),P6e(n),n}function xI(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!E6e(e,n)}catch{return!0}}function O6e(e,t){return t()}var F6e=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?O6e:I6e;hce.useSyncExternalStore=r0.useSyncExternalStore!==void 0?r0.useSyncExternalStore:F6e;dce.exports=hce;var U6=dce.exports;function hs(e){this.content=e}hs.prototype={constructor:hs,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 hs(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 hs(n)},addToStart:function(e,t){return new hs([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new hs(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 hs(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=hs.from(e),e.size?new hs(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=hs.from(e),e.size?new hs(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=hs.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}};hs.from=function(e){if(e instanceof hs)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new hs(t)};function Ace(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=Ace(i.content,s.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function fce(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),l=a.nodeSize;if(a==o){n-=l,r-=l;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=fce(a.content,o.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class De{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 l=this.content[a],u=o+l.nodeSize;if(u>t&&r(l,i+o,s||null,a)!==!1&&l.content.size){let d=o+1;l.nodesBetween(Math.max(0,t-d),Math.min(l.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,l)=>{let u=o.isText?o.text.slice(Math.max(t,l)-l,n-l):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 De(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],l=a+o.nodeSize;l>t&&((a<t||l>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=l}return new De(r,i)}cutByIndex(t,n){return t==n?De.empty:t==0&&n==this.content.length?this:new De(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 De(i,s)}addToStart(t){return new De([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new De(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 Ace(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return fce(this,t,n,r)}findIndex(t){if(t==0)return pS(0,t);if(t==this.size)return pS(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?pS(n+1,s):pS(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 De.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new De(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return De.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 De(n||t,r)}static from(t){if(!t)return De.empty;if(t instanceof De)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new De([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}De.empty=new De([],0);const wI={index:0,offset:0};function pS(e,t){return wI.index=e,wI.offset=t,wI}function m_(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!m_(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!m_(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let Xn=class QF{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&&m_(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);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 QF.none;if(t instanceof QF)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};Xn.none=[];class g_ extends Error{}class rt{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=mce(this.content,t+this.openStart,n);return r&&new rt(r,this.openStart,this.openEnd)}removeBetween(t,n){return new rt(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 rt.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 rt(De.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 rt(t,r,i)}}rt.empty=new rt(De.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 mce(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=mce(a.content,t-s-1,n,a);return o&&e.replaceChild(i,a.copy(o))}function M6e(e,t,n){if(n.openStart>e.depth)throw new g_("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new g_("Inconsistent open depths");return gce(e,t,n,0)}function gce(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=gce(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 xp(a,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}else{let{start:a,end:o}=L6e(n,e);return xp(s,vce(e,a,o,t,r))}else return xp(s,y_(e,t,r))}function yce(e,t){if(!t.type.compatibleContent(e.type))throw new g_("Cannot join "+t.type.name+" onto "+e.type.name)}function HF(e,t,n){let r=e.node(n);return yce(r,t.node(n)),r}function vp(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 Ew(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&&(vp(e.nodeAfter,r),s++));for(let o=s;o<a;o++)vp(i.child(o),r);t&&t.depth==n&&t.textOffset&&vp(t.nodeBefore,r)}function xp(e,t){return e.type.checkContent(t),e.copy(t)}function vce(e,t,n,r,i){let s=e.depth>i&&HF(e,t,i+1),a=r.depth>i&&HF(n,r,i+1),o=[];return Ew(null,e,i,o),s&&a&&t.index(i)==n.index(i)?(yce(s,a),vp(xp(s,vce(e,t,n,r,i+1)),o)):(s&&vp(xp(s,y_(e,t,i+1)),o),Ew(t,n,i,o),a&&vp(xp(a,y_(n,r,i+1)),o)),Ew(r,null,i,o),new De(o)}function y_(e,t,n){let r=[];if(Ew(null,e,n,r),e.depth>n){let i=HF(e,t,n+1);vp(xp(i,y_(e,t,n+1)),r)}return Ew(t,null,n,r),new De(r)}function L6e(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(De.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class Qb{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 Xn.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 v_(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:l}=a.content.findIndex(s),u=s-l;if(r.push(a,o,i+l),!u||(a=a.child(o),a.isText))break;s=u-1,i+=l+1}return new Qb(n,r,s)}static resolveCached(t,n){let r=zV.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 zV.set(t,r=new R6e);let i=r.elts[r.i]=Qb.resolve(t,n);return r.i=(r.i+1)%U6e,i}}class R6e{constructor(){this.elts=[],this.i=0}}const U6e=12,zV=new WeakMap;class v_{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 D6e=Object.create(null);let aA=class $F{constructor(t,n,r,i=Xn.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||De.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&&m_(this.attrs,n||t.defaultAttrs||D6e)&&Xn.sameSet(this.marks,r||Xn.none)}copy(t=null){return t==this.content?this:new $F(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new $F(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 rt.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 rt(u,i.depth-a,s.depth-a)}replace(t,n,r){return M6e(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 Qb.resolveCached(this,t)}resolveNoCache(t){return Qb.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()+")"),xce(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=De.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 l=i;l<s;l++)if(!this.type.allowsMarks(r.child(l).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=Xn.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(!Xn.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=De.fromJSON(t,n.content),s=t.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};aA.prototype.text=void 0;class x_ extends aA{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):xce(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 x_(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new x_(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 xce(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 Q6e(t,n);if(r.next==null)return zp.empty;let i=wce(r);r.next&&r.err("Unexpected trailing text");let s=W6e(q6e(i));return G6e(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 l=a.matchFragment(t,r);if(l&&(!n||l.validEnd))return De.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 f=s(h,o.concat(d));if(f)return f}}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:l}=s.next[a];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in n)&&(!i.type||l.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 Q6e{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 wce(e){let t=[];do t.push(H6e(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function H6e(e){let t=[];do t.push($6e(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function $6e(e){let t=K6e(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=z6e(e,t);else break;return t}function VV(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function z6e(e,t){let n=VV(e),r=n;return e.eat(",")&&(e.next!="}"?r=VV(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function V6e(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 K6e(e){if(e.eat("(")){let t=wce(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=V6e(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 q6e(e){let t=[[]];return i(s(e,0),n()),t;function n(){return t.push([])-1}function r(a,o,l){let u={term:l,to:o};return t[a].push(u),u}function i(a,o){a.forEach(l=>l.to=o)}function s(a,o){if(a.type=="choice")return a.exprs.reduce((l,u)=>l.concat(s(u,o)),[]);if(a.type=="seq")for(let l=0;;l++){let u=s(a.exprs[l],o);if(l==a.exprs.length-1)return u;i(u,o=n())}else if(a.type=="star"){let l=n();return r(o,l),i(s(a.expr,l),l),[r(l)]}else if(a.type=="plus"){let l=n();return i(s(a.expr,o),l),i(s(a.expr,l),l),[r(l)]}else{if(a.type=="opt")return[r(o)].concat(s(a.expr,o));if(a.type=="range"){let l=o;for(let u=0;u<a.min;u++){let d=n();i(s(a.expr,l),d),l=d}if(a.max==-1)i(s(a.expr,l),l);else for(let u=a.min;u<a.max;u++){let d=n();r(l,d),i(s(a.expr,l),d),l=d}return[r(l)]}else{if(a.type=="name")return[r(o,void 0,a.value)];throw new Error("Unknown expr type")}}}}function bce(e,t){return t-e}function KV(e,t){let n=[];return r(t),n.sort(bce);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:l}=s[a];!o&&n.indexOf(l)==-1&&r(l)}}}function W6e(e){let t=Object.create(null);return n(KV(e,0));function n(r){let i=[];r.forEach(a=>{e[a].forEach(({term:o,to:l})=>{if(!o)return;let u;for(let d=0;d<i.length;d++)i[d][0]==o&&(u=i[d][1]);KV(e,l).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(bce);s.next.push({type:i[a][0],next:t[o.join(",")]||n(o)})}return s}}function G6e(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:l,next:u}=i.next[o];a.push(l.name),s&&!(l.isText||l.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 Cce(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 Sce(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 kce(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 Bce(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new X6e(e,r,t[r]);return n}let qV=class _ce{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=Bce(t,r.attrs),this.defaultAttrs=Cce(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:Sce(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new aA(this,this.computeAttrs(t),De.from(n),Xn.setFrom(r))}createChecked(t=null,n,r){return n=De.from(n),this.checkContent(n),new aA(this,this.computeAttrs(t),n,Xn.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=De.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(De.empty,!0);return s?new aA(this,t,n.append(s),Xn.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){kce(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:Xn.none:t}static compile(t,n){let r=Object.create(null);t.forEach((s,a)=>r[s]=new _ce(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 Y6e(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 X6e{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Y6e(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Mj{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=Bce(t,i.attrs),this.excluded=null;let s=Cce(this.attrs);this.instance=s?new Xn(this,s):null}create(t=null){return!t&&this.instance?this.instance:new Xn(this,Sce(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((s,a)=>r[s]=new Mj(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){kce(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class Ece{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=hs.from(t.nodes),n.marks=hs.from(t.marks||{}),this.nodes=qV.compile(this.spec.nodes,this),this.marks=Mj.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?WV(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==""?[]:WV(this,a.split(" "))}this.nodeFromJSON=i=>aA.fromJSON(this,i),this.markFromJSON=i=>Xn.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 qV){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 x_(r,r.defaultAttrs,t,Xn.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 WV(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 l=e.marks[o];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=l)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function J6e(e){return e.tag!=null}function Z6e(e){return e.style!=null}class oA{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(J6e(i))this.tags.push(i);else if(Z6e(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 YV(this,n,!1);return r.addAll(t,Xn.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new YV(this,n,!0);return r.addAll(t,Xn.none,n.from,n.to),rt.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(nQe(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 l=a.getAttrs(n);if(l===!1)continue;a.attrs=l||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=XV(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=XV(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new oA(t,oA.schemaRules(t)))}}const Nce={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},eQe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},jce={ol:!0,ul:!0},Hb=1,zF=2,Nw=4;function GV(e,t,n){return t!=null?(t?Hb:0)|(t==="full"?zF:0):e&&e.whitespace=="pre"?Hb|zF:n&~Nw}class mS{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=Xn.none,this.match=s||(a&Nw?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(De.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&Hb)){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=De.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(De.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&&!Nce.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class YV{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=GV(null,n.preserveWhitespace,0)|(r?Nw:0);i?s=new mS(i.type,i.attrs,Xn.none,!0,n.topMatch||i.type.contentMatch,a):r?s=new mS(null,null,Xn.none,!0,null,a):s=new mS(t.schema.topNodeType,null,Xn.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&zF?"full":this.localPreserveWS||(i.options&Hb)>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 l=0;l<o.length;l++)l&&this.insertNode(a.linebreakReplacement.create(),n,!0),o[l]&&this.insertNode(a.text(o[l]),n,!/\S/.test(o[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let o=i.content[i.content.length-1],l=t.previousSibling;(!o||l&&l.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;jce.hasOwnProperty(a)&&this.parser.normalizeLists&&tQe(t);let l=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(o=this.parser.matchTag(t,this,r));e:if(l?l.ignore:eQe.hasOwnProperty(a))this.findInside(t),this.ignoreFallback(t,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(t=l.skip);let u,d=this.needsBlock;if(Nce.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=l&&l.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,l,u,l.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 l=this.parser.matchStyle(s,a,this,o);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)o=l;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 l=this.enter(a,n.attrs||null,r,n.preserveWhitespace);l&&(s=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.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(l=>this.insertNode(l,r,!1));else{let l=t;typeof n.contentElement=="string"?l=t.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(t):n.contentElement&&(l=n.contentElement),this.findAround(t,l,!0),this.addAll(l,r),this.findAround(t,l,!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 l=this.nodes[a],u=l.findWrapping(t);if(u&&(!i||i.length>u.length+o)&&(i=u,s=l,!u.length))break;if(l.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=Xn.none;for(let o of i.concat(t.marks))(s.type?s.type.allowsMarkType(o.type):JV(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=GV(t,s,a.options);a.options&Nw&&a.content.length==0&&(o|=Nw);let l=Xn.none;return r=r.filter(u=>(a.type?a.type.allowsMarkType(u.type):JV(u.type,t))?(l=u.addToSet(l),!1):!0),this.nodes.push(new mS(t,n,l,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|=Hb)}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,l)=>{for(;o>=0;o--){let u=n[o];if(u==""){if(o==n.length-1||o==0)continue;for(;l>=s;l--)if(a(o-1,l))return!0;return!1}else{let d=l>0||l==0&&i?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!d||d.name!=u&&!d.isInGroup(u))return!1;l--}}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 tQe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&jce.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function nQe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function XV(e){let t={};for(let n in e)t[n]=e[n];return t}function JV(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 l=0;l<o.edgeCount;l++){let{type:u,next:d}=o.edge(l);if(u==t||s.indexOf(d)<0&&a(d))return!0}};if(a(i.contentMatch))return!0}}class cm{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=bI(n).createDocumentFragment());let i=r,s=[];return t.forEach(a=>{if(s.length||a.marks.length){let o=0,l=0;for(;o<s.length&&l<a.marks.length;){let u=a.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(s[o][0])||u.type.spec.spanning===!1)break;o++,l++}for(;o<s.length;)i=s.pop()[1];for(;l<a.marks.length;){let u=a.marks[l++],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}=Xk(bI(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&&Xk(bI(r),i(t,n),null,t.attrs)}static renderSpec(t,n,r=null,i){return Xk(t,n,r,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new cm(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=ZV(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return ZV(t.marks)}}function ZV(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function bI(e){return e.document||window.document}const eK=new WeakMap;function rQe(e){let t=eK.get(e);return t===void 0&&eK.set(e,t=iQe(e)),t}function iQe(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 Xk(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=rQe(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,l=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 f=h.indexOf(" ");f>0?l.setAttributeNS(h.slice(0,f),h.slice(f+1),u[h]):h=="style"&&l.style?l.style.cssText=u[h]:l.setAttribute(h,u[h])}}for(let h=d;h<t.length;h++){let f=t[h];if(f===0){if(h<t.length-1||h>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:A,contentDOM:p}=Xk(e,f,n,r);if(l.appendChild(A),p){if(o)throw new RangeError("Multiple content holes");o=p}}}return{dom:l,contentDOM:o}}const Tce=65535,Pce=Math.pow(2,16);function sQe(e,t){return e+t*Pce}function tK(e){return e&Tce}function aQe(e){return(e-(e&Tce))/Pce}const Ice=1,Oce=2,Jk=4,Fce=8;class VF{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Fce)>0}get deletedBefore(){return(this.delInfo&(Ice|Jk))>0}get deletedAfter(){return(this.delInfo&(Oce|Jk))>0}get deletedAcross(){return(this.delInfo&Jk)>0}}class go{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&go.empty)return go.empty}recover(t){let n=0,r=tK(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+aQe(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 l=this.ranges[o]-(this.inverted?i:0);if(l>t)break;let u=this.ranges[o+s],d=this.ranges[o+a],h=l+u;if(t<=h){let f=u?t==l?-1:t==h?1:n:n,A=l+i+(f<0?0:d);if(r)return A;let p=t==(n<0?l:h)?null:sQe(o/3,t-l),m=t==l?Oce:t==h?Ice:Jk;return(n<0?t!=l:t!=h)&&(m|=Fce),new VF(A,m,p)}i+=d-u}return r?t+i:new VF(t+i,0,null)}touches(t,n){let r=0,i=tK(n),s=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let l=this.ranges[o]-(this.inverted?r:0);if(l>t)break;let u=this.ranges[o+s],d=l+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),l=a+(this.inverted?0:s),u=this.ranges[i+n],d=this.ranges[i+r];t(o,o+u,l,l+d),s+=d-u}}invert(){return new go(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?go.empty:new go(t<0?[0,-t,0]:[0,0,t])}}go.empty=new go([]);class $b{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 $b(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 $b;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 l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,t=this._maps[l].recover(o.recover);continue}}i|=o.delInfo,t=o.pos}return r?t:new VF(t,i,null)}}const CI=Object.create(null);let Gs=class{getMap(){return go.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=CI[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 CI)throw new RangeError("Duplicate use of step JSON ID "+t);return CI[t]=n,n.prototype.jsonID=t,n}};class Ci{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Ci(t,null)}static fail(t){return new Ci(null,t)}static fromReplace(t,n,r,i){try{return Ci.ok(t.replace(n,r,i))}catch(s){if(s instanceof g_)return Ci.fail(s.message);throw s}}}function D6(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let s=e.child(i);s.content.size&&(s=s.copy(D6(s.content,t,s))),s.isInline&&(s=t(s,n,i)),r.push(s)}return De.fromArray(r)}class Dh extends Gs{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 rt(D6(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 Ci.fromReplace(t,this.from,this.to,s)}invert(){return new nc(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 Dh(n.pos,r.pos,this.mark)}merge(t){return t instanceof Dh&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Dh(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 Dh(n.from,n.to,t.markFromJSON(n.mark))}}Gs.jsonID("addMark",Dh);class nc extends Gs{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 rt(D6(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Ci.fromReplace(t,this.from,this.to,r)}invert(){return new Dh(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 nc(n.pos,r.pos,this.mark)}merge(t){return t instanceof nc&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new nc(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 nc(n.from,n.to,t.markFromJSON(n.mark))}}Gs.jsonID("removeMark",nc);class Qh extends Gs{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Ci.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ci.fromReplace(t,this.pos,this.pos+1,new rt(De.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 Qh(this.pos,n.marks[i]);return new Qh(this.pos,this.mark)}}return new Vp(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Qh(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 Qh(n.pos,t.markFromJSON(n.mark))}}Gs.jsonID("addNodeMark",Qh);class Vp extends Gs{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Ci.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Ci.fromReplace(t,this.pos,this.pos+1,new rt(De.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Qh(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Vp(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 Vp(n.pos,t.markFromJSON(n.mark))}}Gs.jsonID("removeNodeMark",Vp);class Gi extends Gs{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&KF(t,this.from,this.to)?Ci.fail("Structure replace would overwrite content"):Ci.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new go([this.from,this.to-this.from,this.slice.size])}invert(t){return new Gi(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 Gi(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(t){if(!(t instanceof Gi)||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?rt.empty:new rt(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Gi(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?rt.empty:new rt(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Gi(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 Gi(n.from,n.to,rt.fromJSON(t,n.slice),!!n.structure)}}Gs.jsonID("replace",Gi);class Xi extends Gs{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&&(KF(t,this.from,this.gapFrom)||KF(t,this.gapTo,this.to)))return Ci.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Ci.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Ci.fromReplace(t,this.from,this.to,r):Ci.fail("Content does not fit in gap")}getMap(){return new go([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 Xi(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 Xi(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 Xi(n.from,n.to,n.gapFrom,n.gapTo,rt.fromJSON(t,n.slice),n.insert,!!n.structure)}}Gs.jsonID("replaceAround",Xi);function KF(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 oQe(e,t,n,r){let i=[],s=[],a,o;e.doc.nodesBetween(t,n,(l,u,d)=>{if(!l.isInline)return;let h=l.marks;if(!r.isInSet(h)&&d.type.allowsMarkType(r.type)){let f=Math.max(u,t),A=Math.min(u+l.nodeSize,n),p=r.addToSet(h);for(let m=0;m<h.length;m++)h[m].isInSet(p)||(a&&a.to==f&&a.mark.eq(h[m])?a.to=A:i.push(a=new nc(f,A,h[m])));o&&o.to==f?o.to=A:s.push(o=new Dh(f,A,r))}}),i.forEach(l=>e.step(l)),s.forEach(l=>e.step(l))}function lQe(e,t,n,r){let i=[],s=0;e.doc.nodesBetween(t,n,(a,o)=>{if(!a.isInline)return;s++;let l=null;if(r instanceof Mj){let u=a.marks,d;for(;d=r.isInSet(u);)(l||(l=[])).push(d),u=d.removeFromSet(u)}else r?r.isInSet(a.marks)&&(l=[r]):l=a.marks;if(l&&l.length){let u=Math.min(o+a.nodeSize,n);for(let d=0;d<l.length;d++){let h=l[d],f;for(let A=0;A<i.length;A++){let p=i[A];p.step==s-1&&h.eq(i[A].style)&&(f=p)}f?(f.to=u,f.step=s):i.push({style:h,from:Math.max(o,t),to:u,step:s})}}}),i.forEach(a=>e.step(new nc(a.from,a.to,a.style)))}function Q6(e,t,n,r=n.contentMatch,i=!0){let s=e.doc.nodeAt(t),a=[],o=t+1;for(let l=0;l<s.childCount;l++){let u=s.child(l),d=o+u.nodeSize,h=r.matchType(u.type);if(!h)a.push(new Gi(o,d,rt.empty));else{r=h;for(let f=0;f<u.marks.length;f++)n.allowsMarkType(u.marks[f].type)||e.step(new nc(o,d,u.marks[f]));if(i&&u.isText&&n.whitespace!="pre"){let f,A=/\r?\n|\r/g,p;for(;f=A.exec(u.text);)p||(p=new rt(De.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),a.push(new Gi(o+f.index,o+f.index+f[0].length,p))}}o=d}if(!r.validEnd){let l=r.fillBefore(De.empty,!0);e.replace(o,o,new rt(l,0,0))}for(let l=a.length-1;l>=0;l--)e.step(a[l])}function cQe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function ov(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,l=e.$to.indexAfter(r)-s;if(r<e.depth&&a.canReplace(o,l,n))return r;if(r==0||a.type.spec.isolating||!cQe(a,o,l))break;o&&(i=1),l<a.childCount&&(s=1)}return null}function uQe(e,t,n){let{$from:r,$to:i,depth:s}=t,a=r.before(s+1),o=i.after(s+1),l=a,u=o,d=De.empty,h=0;for(let p=s,m=!1;p>n;p--)m||r.index(p)>0?(m=!0,d=De.from(r.node(p).copy(d)),h++):l--;let f=De.empty,A=0;for(let p=s,m=!1;p>n;p--)m||i.after(p+1)<i.end(p)?(m=!0,f=De.from(i.node(p).copy(f)),A++):u++;e.step(new Xi(l,u,a,o,new rt(d.append(f),h,A),d.size-h,!0))}function H6(e,t,n=null,r=e){let i=dQe(e,t),s=i&&hQe(r,t);return s?i.map(nK).concat({type:t,attrs:n}).concat(s.map(nK)):null}function nK(e){return{type:e,attrs:null}}function dQe(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 hQe(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 l=(a.length?a[a.length-1]:t).contentMatch;for(let u=r;l&&u<i;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:a}function AQe(e,t,n){let r=De.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=De.from(n[a].type.create(n[a].attrs,r))}let i=t.start,s=t.end;e.step(new Xi(i,s,i,s,new rt(r,0,0),n.length,!0))}function fQe(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 l=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(r,l)&&pQe(e.doc,e.mapping.slice(s).map(o),r)){let u=null;if(r.schema.linebreakReplacement){let A=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);A&&!p?u=!1:!A&&p&&(u=!0)}u===!1&&Lce(e,a,o,s),Q6(e,e.mapping.slice(s).map(o,1),r,void 0,u===null);let d=e.mapping.slice(s),h=d.map(o,1),f=d.map(o+a.nodeSize,1);return e.step(new Xi(h,f,h+1,f-1,new rt(De.from(r.create(l,null,a.marks)),0,0),1,!0)),u===!0&&Mce(e,a,o,s),!1}})}function Mce(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 l=e.mapping.slice(r).map(n+1+s+a.index);e.replaceWith(l,l+1,t.type.schema.linebreakReplacement.create())}}})}function Lce(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 pQe(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function mQe(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 Xi(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new rt(De.from(a),0,0),1,!0))}function gy(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),f=i.index(u);if(h.type.spec.isolating)return!1;let A=h.content.cutByIndex(f,h.childCount),p=r&&r[d+1];p&&(A=A.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[d]||h;if(!h.canReplace(f+1,h.childCount)||!m.type.validContent(A))return!1}let o=i.indexAfter(s),l=r&&r[0];return i.node(s).canReplaceWith(o,o,l?l.type:i.node(s+1).type)}function gQe(e,t,n=1,r){let i=e.doc.resolve(t),s=De.empty,a=De.empty;for(let o=i.depth,l=i.depth-n,u=n-1;o>l;o--,u--){s=De.from(i.node(o).copy(s));let d=r&&r[u];a=De.from(d?d.type.create(d.attrs,a):i.node(o).copy(a))}e.step(new Gi(t,t,new rt(s.append(a),n,n),!0))}function HA(e,t){let n=e.resolve(t),r=n.index();return Rce(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function yQe(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 Rce(e,t){return!!(e&&t&&!e.isLeaf&&yQe(e,t))}function Lj(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&&Rce(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 vQe(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);Lce(e,d.node(),d.before(),o)}a.inlineContent&&Q6(e,t+n-1,a,s.node().contentMatchAt(s.index()),r==null);let l=e.mapping.slice(o),u=l.map(t-n);if(e.step(new Gi(u,l.map(t+n,-1),rt.empty,!0)),r===!0){let d=e.doc.resolve(u);Mce(e,d.node(),d.before(),e.steps.length)}return e}function xQe(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 Uce(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,l=r.index(a)+(o>0?1:0),u=r.node(a),d=!1;if(s==1)d=u.canReplace(l,l,i);else{let h=u.contentMatchAt(l).findWrapping(i.firstChild.type);d=h&&u.canReplaceWith(l,l,h[0])}if(d)return o==0?r.pos:o<0?r.before(a+1):r.after(a+1)}return null}function Rj(e,t,n=t,r=rt.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),s=e.resolve(n);return Dce(i,s,r)?new Gi(t,n,r):new wQe(i,s,r).fit()}function Dce(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class wQe{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=De.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=De.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 l=new rt(s,a,o);return t>-1?new Xi(r.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Gi(r.pos,i.pos,l):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=SI(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:l,match:u}=this.frontier[o],d,h=null;if(n==1&&(a?u.matchType(a.type)||(h=u.fillBefore(De.from(a),!1)):s&&l.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=SI(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new rt(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=SI(t,n);if(i.childCount<=1&&n>0){let s=t.size-n<=n+i.size;this.unplaced=new rt(Kx(t,n-1,1),n-1,s?n-1:r)}else this.unplaced=new rt(Kx(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,l=a.openStart-t,u=0,d=[],{match:h,type:f}=this.frontier[n];if(i){for(let m=0;m<i.childCount;m++)d.push(i.child(m));h=h.matchFragment(i)}let A=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||l==0||m.content.size)&&(h=g,d.push(Qce(m.mark(f.allowedMarks(m.marks)),u==1?l:0,u==o.childCount?A:-1)))}let p=u==o.childCount;p||(A=-1),this.placed=qx(this.placed,n,De.from(d)),this.frontier[n].match=h,p&&A<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=o;m<A;m++){let y=g.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),g=y.content}this.unplaced=p?t==0?rt.empty:new rt(Kx(a.content,t-1,1),t-1,A<0?a.openEnd:t-1):new rt(Kx(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||!kI(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=kI(t,n,i,r,s);if(a){for(let o=n-1;o>=0;o--){let{match:l,type:u}=this.frontier[o],d=kI(t,o,u,l,!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=qx(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=qx(this.placed,this.depth,De.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(De.empty,!0);n.childCount&&(this.placed=qx(this.placed,this.frontier.length,n))}}function Kx(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Kx(e.firstChild.content,t-1,n)))}function qx(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(qx(e.lastChild.content,t-1,n)))}function SI(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Qce(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Qce(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(De.empty,!0)))),e.copy(r)}function kI(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&&!bQe(n,s.content,a)?o:null}function bQe(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function CQe(e){return e.spec.defining||e.spec.definingForContent}function SQe(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),s=e.doc.resolve(n);if(Dce(i,s,r))return e.step(new Gi(t,n,r));let a=$ce(i,s);a[a.length-1]==0&&a.pop();let o=-(i.depth+1);a.unshift(o);for(let f=i.depth,A=i.pos-1;f>0;f--,A--){let p=i.node(f).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;a.indexOf(f)>-1?o=f:i.before(f)==A&&a.splice(1,0,-f)}let l=a.indexOf(o),u=[],d=r.openStart;for(let f=r.content,A=0;;A++){let p=f.firstChild;if(u.push(p),A==r.openStart)break;f=p.content}for(let f=d-1;f>=0;f--){let A=u[f],p=CQe(A.type);if(p&&!A.sameMarkup(i.node(Math.abs(o)-1)))d=f;else if(p||!A.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let A=(f+d+1)%(r.openStart+1),p=u[A];if(p)for(let m=0;m<a.length;m++){let g=a[(m+l)%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 rt(Hce(r.content,0,r.openStart,A),A,r.openEnd))}}let h=e.steps.length;for(let f=a.length-1;f>=0&&(e.replace(t,n,r),!(e.steps.length>h));f--){let A=a[f];A<0||(t=i.before(A),n=s.after(A))}}function Hce(e,t,n,r,i){if(t<n){let s=e.firstChild;e=e.replaceChild(0,s.copy(Hce(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(De.empty,!0))}return e}function kQe(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=xQe(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new rt(De.from(r),0,0))}function BQe(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),s=$ce(r,i);for(let a=0;a<s.length;a++){let o=s[a],l=a==s.length-1;if(l&&o==0||r.node(o).type.contentMatch.validEnd)return e.delete(r.start(o),i.end(o));if(o>0&&(l||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 $ce(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 yy extends Gs{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 Ci.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 Ci.fromReplace(t,this.pos,this.pos+1,new rt(De.from(i),0,n.isLeaf?0:1))}getMap(){return go.empty}invert(t){return new yy(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 yy(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 yy(n.pos,n.attr,n.value)}}Gs.jsonID("attr",yy);class zb extends Gs{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 Ci.ok(r)}getMap(){return go.empty}invert(t){return new zb(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 zb(n.attr,n.value)}}Gs.jsonID("docAttr",zb);let i0=class extends Error{};i0=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};i0.prototype=Object.create(Error.prototype);i0.prototype.constructor=i0;i0.prototype.name="TransformError";class zce{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new $b}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new i0(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,l)=>{t=Math.min(t,o),n=Math.max(n,l)})}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=rt.empty){let i=Rj(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new rt(De.from(r),0,0))}delete(t,n){return this.replace(t,n,rt.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return SQe(this,t,n,r),this}replaceRangeWith(t,n,r){return kQe(this,t,n,r),this}deleteRange(t,n){return BQe(this,t,n),this}lift(t,n){return uQe(this,t,n),this}join(t,n=1){return vQe(this,t,n),this}wrap(t,n){return AQe(this,t,n),this}setBlockType(t,n=t,r,i=null){return fQe(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return mQe(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new yy(t,n,r)),this}setDocAttribute(t,n){return this.step(new zb(t,n)),this}addNodeMark(t,n){return this.step(new Qh(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 Xn)n.isInSet(r.marks)&&this.step(new Vp(t,n));else{let i=r.marks,s,a=[];for(;s=n.isInSet(i);)a.push(new Vp(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 gQe(this,t,n,r),this}addMark(t,n,r){return oQe(this,t,n,r),this}removeMark(t,n,r){return lQe(this,t,n,r),this}clearIncompatible(t,n,r){return Q6(this,t,n,r),this}}const BI=Object.create(null);class cn{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new _Qe(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=rt.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:l,$to:u}=a[o],d=t.mapping.slice(s);t.replaceRange(d.map(l.pos),d.map(u.pos),o?rt.empty:n),o==0&&sK(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],l=t.mapping.slice(r),u=l.map(a.pos),d=l.map(o.pos);s?t.deleteRange(u,d):(t.replaceRangeWith(u,d,n),sK(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new Yt(t):Sg(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?Sg(t.node(0),t.node(s),t.before(s+1),t.index(s),n,r):Sg(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 dl(t.node(0))}static atStart(t){return Sg(t,t,0,0,1)||new dl(t)}static atEnd(t){return Sg(t,t,t.content.size,t.childCount,-1)||new dl(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=BI[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 BI)throw new RangeError("Duplicate use of selection JSON ID "+t);return BI[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Yt.between(this.$anchor,this.$head).getBookmark()}}cn.prototype.visible=!0;class _Qe{constructor(t,n){this.$from=t,this.$to=n}}let rK=!1;function iK(e){!rK&&!e.parent.inlineContent&&(rK=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Yt extends cn{constructor(t,n=t){iK(t),iK(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 cn.near(r);let i=t.resolve(n.map(this.anchor));return new Yt(i.parent.inlineContent?i:r,r)}replace(t,n=rt.empty){if(super.replace(t,n),n==rt.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Yt&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Uj(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 Yt(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=cn.findFrom(n,r,!0)||cn.findFrom(n,-r,!0);if(s)n=s.$head;else return cn.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(cn.findFrom(t,-r,!0)||cn.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new Yt(t,n)}}cn.jsonID("text",Yt);class Uj{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Uj(t.map(this.anchor),t.map(this.head))}resolve(t){return Yt.between(t.resolve(this.anchor),t.resolve(this.head))}}class Ft extends cn{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?cn.near(s):new Ft(s)}content(){return new rt(De.from(this.node),0,0)}eq(t){return t instanceof Ft&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new $6(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Ft(t.resolve(n.anchor))}static create(t,n){return new Ft(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}Ft.prototype.visible=!1;cn.jsonID("node",Ft);class $6{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Uj(r,r):new $6(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&Ft.isSelectable(r)?new Ft(n):cn.near(n)}}class dl extends cn{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=rt.empty){if(n==rt.empty){t.delete(0,t.doc.content.size);let r=cn.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new dl(t)}map(t){return new dl(t)}eq(t){return t instanceof dl}getBookmark(){return EQe}}cn.jsonID("all",dl);const EQe={map(){return this},resolve(e){return new dl(e)}};function Sg(e,t,n,r,i,s=!1){if(t.inlineContent)return Yt.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&&Ft.isSelectable(o))return Ft.create(e,n-(i<0?o.nodeSize:0))}else{let l=Sg(e,o,n+i,i<0?o.childCount:0,i,s);if(l)return l}n+=o.nodeSize*i}return null}function sK(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Gi||i instanceof Xi))return;let s=e.mapping.maps[r],a;s.forEach((o,l,u,d)=>{a==null&&(a=d)}),e.setSelection(cn.near(e.doc.resolve(a),n))}const aK=1,gS=2,oK=4;class NQe extends zce{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|aK)&~gS,this.storedMarks=null,this}get selectionSet(){return(this.updated&aK)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=gS,this}ensureMarks(t){return Xn.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&gS)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~gS,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)||Xn.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(cn.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|=oK,this}get scrolledIntoView(){return(this.updated&oK)>0}}function lK(e,t){return!t||!e?e:e.bind(t)}class Wx{constructor(t,n,r){this.name=t,this.init=lK(n.init,r),this.apply=lK(n.apply,r)}}const jQe=[new Wx("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Wx("selection",{init(e,t){return e.selection||cn.atStart(t.doc)},apply(e){return e.selection}}),new Wx("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Wx("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class _I{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=jQe.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 Wx(r.key,r.spec.state,r))})}}class Wg{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 l=i?i[a].n:0,u=i?i[a].state:this,d=l<n.length&&o.spec.appendTransaction.call(o,l?n.slice(l):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 Wg(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 NQe(this)}static create(t){let n=new _I(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new Wg(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 _I(this.schema,t.plugins),r=n.fields,i=new Wg(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 _I(t.schema,t.plugins),s=new Wg(i);return i.fields.forEach(a=>{if(a.name=="doc")s.doc=aA.fromJSON(t.schema,n.doc);else if(a.name=="selection")s.selection=cn.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 l=r[o],u=l.spec.state;if(l.key==a.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,o)){s[a.name]=u.fromJSON.call(l,t,n[o],s);return}}s[a.name]=a.init(t,s)}}),s}}function Vce(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=Vce(i,t,{})),n[r]=i}return n}class Ur{constructor(t){this.spec=t,this.props={},t.props&&Vce(t.props,this,this.props),this.key=t.key?t.key.key:Kce("plugin")}getState(t){return t[this.key]}}const EI=Object.create(null);function Kce(e){return e in EI?e+"$"+ ++EI[e]:(EI[e]=0,e+"$")}class Di{constructor(t="key"){this.key=Kce(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const TQe=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function qce(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const PQe=(e,t,n)=>{let r=qce(e,n);if(!r)return!1;let i=z6(r);if(!i){let a=r.blockRange(),o=a&&ov(a);return o==null?!1:(t&&t(e.tr.lift(a,o).scrollIntoView()),!0)}let s=i.nodeBefore;if(Xce(e,i,t,-1))return!0;if(r.parent.content.size==0&&(s0(s,"end")||Ft.isSelectable(s)))for(let a=r.depth;;a--){let o=Rj(e.doc,r.before(a),r.after(a),rt.empty);if(o&&o.slice.size<o.to-o.from){if(t){let l=e.tr.step(o);l.setSelection(s0(s,"end")?cn.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):Ft.create(l.doc,i.pos-s.nodeSize)),t(l.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},IQe=(e,t,n)=>{let r=qce(e,n);if(!r)return!1;let i=z6(r);return i?Wce(e,i,t):!1},OQe=(e,t,n)=>{let r=Gce(e,n);if(!r)return!1;let i=V6(r);return i?Wce(e,i,t):!1};function Wce(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,l=t.pos+1;for(;!o.isTextblock;l++){if(o.type.spec.isolating)return!1;let d=o.firstChild;if(!d)return!1;o=d}let u=Rj(e.doc,s,l,rt.empty);if(!u||u.from!=s||u instanceof Gi&&u.slice.size>=l-s)return!1;if(n){let d=e.tr.step(u);d.setSelection(Yt.create(d.doc,s)),n(d.scrollIntoView())}return!0}function s0(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 FQe=(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=z6(r)}let a=s&&s.nodeBefore;return!a||!Ft.isSelectable(a)?!1:(t&&t(e.tr.setSelection(Ft.create(e.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)};function z6(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 Gce(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const MQe=(e,t,n)=>{let r=Gce(e,n);if(!r)return!1;let i=V6(r);if(!i)return!1;let s=i.nodeAfter;if(Xce(e,i,t,1))return!0;if(r.parent.content.size==0&&(s0(s,"start")||Ft.isSelectable(s))){let a=Rj(e.doc,r.before(),r.after(),rt.empty);if(a&&a.slice.size<a.to-a.from){if(t){let o=e.tr.step(a);o.setSelection(s0(s,"start")?cn.findFrom(o.doc.resolve(o.mapping.map(i.pos)),1):Ft.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},LQe=(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=V6(r)}let a=s&&s.nodeAfter;return!a||!Ft.isSelectable(a)?!1:(t&&t(e.tr.setSelection(Ft.create(e.doc,s.pos)).scrollIntoView()),!0)};function V6(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 RQe=(e,t)=>{let n=e.selection,r=n instanceof Ft,i;if(r){if(n.node.isTextblock||!HA(e.doc,n.from))return!1;i=n.from}else if(i=Lj(e.doc,n.from,-1),i==null)return!1;if(t){let s=e.tr.join(i);r&&s.setSelection(Ft.create(s.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(s.scrollIntoView())}return!0},UQe=(e,t)=>{let n=e.selection,r;if(n instanceof Ft){if(n.node.isTextblock||!HA(e.doc,n.to))return!1;r=n.to}else if(r=Lj(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},DQe=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),s=i&&ov(i);return s==null?!1:(t&&t(e.tr.lift(i,s).scrollIntoView()),!0)},QQe=(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 Yce(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 HQe=(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=Yce(i.contentMatchAt(s));if(!a||!i.canReplaceWith(s,s,a))return!1;if(t){let o=n.after(),l=e.tr.replaceWith(o,o,a.createAndFill());l.setSelection(cn.near(l.doc.resolve(o),1)),t(l.scrollIntoView())}return!0},$Qe=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof dl||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=Yce(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(Yt.create(o.doc,a+1)),t(o.scrollIntoView())}return!0},zQe=(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(gy(e.doc,s))return t&&t(e.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&ov(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},VQe=(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(Ft.create(e.doc,i))),!0)};function KQe(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||HA(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function Xce(e,t,n,r){let i=t.nodeBefore,s=t.nodeAfter,a,o,l=i.type.spec.isolating||s.type.spec.isolating;if(!l&&KQe(e,t,n))return!0;let u=!l&&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 A=t.pos+s.nodeSize,p=De.empty;for(let y=a.length-1;y>=0;y--)p=De.from(a[y].create(null,p));p=De.from(i.copy(p));let m=e.tr.step(new Xi(t.pos-1,A,t.pos,A,new rt(p,1,0),a.length,!0)),g=m.doc.resolve(A+2*a.length);g.nodeAfter&&g.nodeAfter.type==i.type&&HA(m.doc,g.pos)&&m.join(g.pos),n(m.scrollIntoView())}return!0}let d=s.type.spec.isolating||r>0&&l?null:cn.findFrom(t,1),h=d&&d.$from.blockRange(d.$to),f=h&&ov(h);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(h,f).scrollIntoView()),!0;if(u&&s0(s,"start",!0)&&s0(i,"end")){let A=i,p=[];for(;p.push(A),!A.isTextblock;)A=A.lastChild;let m=s,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(A.canReplace(A.childCount,A.childCount,m.content)){if(n){let y=De.empty;for(let x=p.length-1;x>=0;x--)y=De.from(p[x].copy(y));let v=e.tr.step(new Xi(t.pos-p.length,t.pos+s.nodeSize,t.pos+g,t.pos+s.nodeSize-g,new rt(y,p.length,0),0,!0));n(v.scrollIntoView())}return!0}}return!1}function Jce(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(Yt.create(t.doc,e<0?i.start(s):i.end(s)))),!0):!1}}const qQe=Jce(-1),WQe=Jce(1);function GQe(e,t=null){return function(n,r){let{$from:i,$to:s}=n.selection,a=i.blockRange(s),o=a&&H6(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,(l,u)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(e,t)))if(l.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:l}}=n.selection.ranges[a];s.setBlockType(o,l,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 YQe(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 XQe(o,a,e,t)?(r&&r(o.scrollIntoView()),!0):!1}}function XQe(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 l=a.resolve(t.start-2);s=new v_(l,l,t.depth),t.endIndex<t.parent.childCount&&(t=new v_(t.$from,a.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let o=H6(s,n,r,t);return o?(e&&JQe(e,t,o,i,n),!0):!1}function JQe(e,t,n,r,i){let s=De.empty;for(let d=n.length-1;d>=0;d--)s=De.from(n[d].type.create(n[d].attrs,s));e.step(new Xi(t.start-(r?2:0),t.end,t.start,t.end,new rt(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,l=t.start+n.length-(r?2:0),u=t.parent;for(let d=t.startIndex,h=t.endIndex,f=!0;d<h;d++,f=!1)!f&&gy(e.doc,l,o)&&(e.split(l,o),l+=2*o),l+=u.child(d).nodeSize;return e}function ZQe(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?eHe(t,n,e,s):tHe(t,n,s):!0:!1}}function eHe(e,t,n,r){let i=e.tr,s=r.end,a=r.$to.end(r.depth);s<a&&(i.step(new Xi(s-1,a,s,a,new rt(De.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new v_(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const o=ov(r);if(o==null)return!1;i.lift(r,o);let l=i.doc.resolve(i.mapping.map(s,-1)-1);return HA(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),t(i.scrollIntoView()),!0}function tHe(e,t,n){let r=e.tr,i=n.parent;for(let A=n.end,p=n.endIndex-1,m=n.startIndex;p>m;p--)A-=i.child(p).nodeSize,r.delete(A-1,A+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,l=n.endIndex==i.childCount,u=s.node(-1),d=s.index(-1);if(!u.canReplace(d+(o?0:1),d+1,a.content.append(l?De.empty:De.from(i))))return!1;let h=s.pos,f=h+a.nodeSize;return r.step(new Xi(h-(o?1:0),f+(l?1:0),h+1,f-1,new rt((o?De.empty:De.from(i.copy(De.empty))).append(l?De.empty:De.from(i.copy(De.empty))),o?0:1,l?0:1),o?0:1)),t(r.scrollIntoView()),!0}function nHe(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,l=o.child(a-1);if(l.type!=e)return!1;if(n){let u=l.lastChild&&l.lastChild.type==o.type,d=De.from(u?e.create():null),h=new rt(De.from(e.create(null,De.from(o.type.create(null,d)))),u?3:1,0),f=s.start,A=s.end;n(t.tr.step(new Xi(f-(u?3:1),A,f,A,h,1,!0)).scrollIntoView())}return!0}}const ms=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},a0=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let qF=null;const $u=function(e,t,n){let r=qF||(qF=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},rHe=function(){qF=null},Kp=function(e,t,n,r){return n&&(uK(e,t,n,r,-1)||uK(e,t,n,r,1))},iHe=/^(img|br|input|textarea|hr)$/i;function uK(e,t,n,r,i){for(var s;;){if(e==n&&t==r)return!0;if(t==(i<0?0:el(e))){let a=e.parentNode;if(!a||a.nodeType!=1||C2(e)||iHe.test(e.nodeName)||e.contentEditable=="false")return!1;t=ms(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?el(e):0}else return!1}}function el(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function sHe(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=el(e)}else if(e.parentNode&&!C2(e))t=ms(e),e=e.parentNode;else return null}}function aHe(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&&!C2(e))t=ms(e)+1,e=e.parentNode;else return null}}function oHe(e,t,n){for(let r=t==0,i=t==el(e);r||i;){if(e==n)return!0;let s=ms(e);if(e=e.parentNode,!e)return!1;r=r&&s==0,i=i&&s==el(e)}}function C2(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 Dj=function(e){return e.focusNode&&Kp(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Rf(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function lHe(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function cHe(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(el(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(el(r.startContainer),r.startOffset)}}}const lu=typeof navigator<"u"?navigator:null,dK=typeof document<"u"?document:null,$A=lu&&lu.userAgent||"",WF=/Edge\/(\d+)/.exec($A),Zce=/MSIE \d/.exec($A),GF=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec($A),Wa=!!(Zce||GF||WF),lA=Zce?document.documentMode:GF?+GF[1]:WF?+WF[1]:0,hl=!Wa&&/gecko\/(\d+)/i.test($A);hl&&+(/Firefox\/(\d+)/.exec($A)||[0,0])[1];const YF=!Wa&&/Chrome\/(\d+)/.exec($A),ys=!!YF,eue=YF?+YF[1]:0,Ks=!Wa&&!!lu&&/Apple Computer/.test(lu.vendor),o0=Ks&&(/Mobile\/\w+/.test($A)||!!lu&&lu.maxTouchPoints>2),Wo=o0||(lu?/Mac/.test(lu.platform):!1),tue=lu?/Win/.test(lu.platform):!1,Xu=/Android \d/.test($A),S2=!!dK&&"webkitFontSmoothing"in dK.documentElement.style,uHe=S2?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function dHe(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 ju(e,t){return typeof e=="number"?e:e[t]}function hHe(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 hK(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=a0(a);continue}let o=a,l=o==s.body,u=l?dHe(s):hHe(o),d=0,h=0;if(t.top<u.top+ju(r,"top")?h=-(u.top-t.top+ju(i,"top")):t.bottom>u.bottom-ju(r,"bottom")&&(h=t.bottom-t.top>u.bottom-u.top?t.top+ju(i,"top")-u.top:t.bottom-u.bottom+ju(i,"bottom")),t.left<u.left+ju(r,"left")?d=-(u.left-t.left+ju(i,"left")):t.right>u.right-ju(r,"right")&&(d=t.right-u.right+ju(i,"right")),d||h)if(l)s.defaultView.scrollBy(d,h);else{let A=o.scrollLeft,p=o.scrollTop;h&&(o.scrollTop+=h),d&&(o.scrollLeft+=d);let m=o.scrollLeft-A,g=o.scrollTop-p;t={left:t.left-m,top:t.top-g,right:t.right-m,bottom:t.bottom-g}}let f=l?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(f))break;a=f=="absolute"?a.offsetParent:a0(a)}}function AHe(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 l=o.getBoundingClientRect();if(l.top>=n-20){r=o,i=l.top;break}}return{refDOM:r,refTop:i,stack:nue(e.dom)}}function nue(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=a0(r));return t}function fHe({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;rue(n,r==0?0:r-t)}function rue(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 eg=null;function pHe(e){if(e.setActive)return e.setActive();if(eg)return e.focus(eg);let t=nue(e);e.focus(eg==null?{get preventScroll(){return eg={preventScroll:!0},!0}}:void 0),eg||(eg=!1,rue(t,0))}function iue(e,t){let n,r=2e8,i,s=0,a=t.top,o=t.top,l,u;for(let d=e.firstChild,h=0;d;d=d.nextSibling,h++){let f;if(d.nodeType==1)f=d.getClientRects();else if(d.nodeType==3)f=$u(d).getClientRects();else continue;for(let A=0;A<f.length;A++){let p=f[A];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&&!l&&p.left<=t.left&&p.right>=t.left&&(l=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&&l&&(n=l,i=u,r=0),n&&n.nodeType==3?mHe(n,i):!n||r&&n.nodeType==1?{node:e,offset:s}:iue(n,i)}function mHe(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=oh(r,1);if(a.top!=a.bottom&&K6(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 K6(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function gHe(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function yHe(e,t,n){let{node:r,offset:i}=iue(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 vHe(e,t,n,r){let i=-1;for(let s=t,a=!1;s!=e.dom;){let o=e.docView.nearestDesc(s,!0),l;if(!o)return null;if(o.dom.nodeType==1&&(o.node.isBlock&&o.parent||!o.contentDOM)&&((l=o.dom.getBoundingClientRect()).width||l.height)&&(o.node.isBlock&&o.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(o.dom.nodeName)&&(!a&&l.left>r.left||l.top>r.top?i=o.posBefore:(!a&&l.right<r.left||l.bottom<r.top)&&(i=o.posAfter),a=!0),!o.contentDOM&&i<0&&!o.node.isText))return(o.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?o.posBefore:o.posAfter;s=o.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function sue(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 l=0;l<o.length;l++){let u=o[l];if(K6(t,u))return sue(a,t,u)}}if((s=(s+1)%r)==i)break}return e}function xHe(e,t){let n=e.dom.ownerDocument,r,i=0,s=cHe(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(!K6(t,u)||(a=sue(e.dom,t,u),!a))return null}if(Ks)for(let u=a;r&&u;u=a0(u))u.draggable&&(r=void 0);if(a=gHe(a,t),r){if(hl&&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;S2&&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=vHe(e,r,i,t))}o==null&&(o=yHe(e,a,t));let l=e.docView.nearestDesc(a,!0);return{pos:o,inside:l?l.posAtStart-l.border:-1}}function AK(e){return e.top<e.bottom||e.left<e.right}function oh(e,t){let n=e.getClientRects();if(n.length){let r=n[t<0?0:n.length-1];if(AK(r))return r}return Array.prototype.find.call(n,AK)||e.getBoundingClientRect()}const wHe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function aue(e,t,n){let{node:r,offset:i,atom:s}=e.docView.domFromPos(t,n<0?-1:1),a=S2||hl;if(r.nodeType==3)if(a&&(wHe.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=oh($u(r,i,i),n);if(hl&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let u=oh($u(r,i-1,i-1),-1);if(u.top==l.top){let d=oh($u(r,i,i+1),-1);if(d.top!=l.top)return hx(d,d.left<u.left)}}return l}else{let l=i,u=i,d=n<0?1:-1;return n<0&&!i?(u++,d=-1):n>=0&&i==r.nodeValue.length?(l--,d=1):n<0?l--:u++,hx(oh($u(r,l,u),d),d<0)}if(!e.state.doc.resolve(t-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==el(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return NI(l.getBoundingClientRect(),!1)}if(s==null&&i<el(r)){let l=r.childNodes[i];if(l.nodeType==1)return NI(l.getBoundingClientRect(),!0)}return NI(r.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==el(r))){let l=r.childNodes[i-1],u=l.nodeType==3?$u(l,el(l)-(a?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return hx(oh(u,1),!1)}if(s==null&&i<el(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let u=l?l.nodeType==3?$u(l,0,a?0:1):l.nodeType==1?l:null:null;if(u)return hx(oh(u,-1),!0)}return hx(oh(r.nodeType==3?$u(r):r,-n),n>=0)}function hx(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 NI(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 oue(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 bHe(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return oue(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=aue(e,i.pos,1);for(let o=s.firstChild;o;o=o.nextSibling){let l;if(o.nodeType==1)l=o.getClientRects();else if(o.nodeType==3)l=$u(o,0,o.nodeValue.length).getClientRects();else continue;for(let u=0;u<l.length;u++){let d=l[u];if(d.bottom>d.top+1&&(n=="up"?a.top-d.top>(d.bottom-a.top)*2:d.bottom-a.bottom>(a.bottom-d.top)*2))return!1}}return!0})}const CHe=/[\u0590-\u08ac]/;function SHe(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?!CHe.test(r.parent.textContent)||!o.modify?n=="left"||n=="backward"?s:a:oue(e,t,()=>{let{focusNode:l,focusOffset:u,anchorNode:d,anchorOffset:h}=e.domSelectionRange(),f=o.caretBidiLevel;o.modify("move",n,"character");let A=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:p,focusOffset:m}=e.domSelectionRange(),g=p&&!A.contains(p.nodeType==1?p:p.parentNode)||l==p&&u==m;try{o.collapse(d,h),l&&(l!=d||u!=h)&&o.extend&&o.extend(l,u)}catch{}return f!=null&&(o.caretBidiLevel=f),g}):r.pos==r.start()||r.pos==r.end()}let fK=null,pK=null,mK=!1;function kHe(e,t,n){return fK==t&&pK==n?mK:(fK=t,pK=n,mK=n=="up"||n=="down"?bHe(e,t,n):SHe(e,t,n))}const Al=0,gK=1,qf=2,cu=3;class k2{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Al,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>ms(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 cue){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 lue&&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?ms(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?ms(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 l=this.children[o],u=a+l.size;if(i==-1&&t<=u){let d=a+l.border;if(t>=d&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,n,d);t=a;for(let h=o;h>0;h--){let f=this.children[h-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=ms(f.dom)+1;break}t-=f.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=ms(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 A=0,p=0;A<this.children.length;A++){let m=this.children[A],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),l=n==t?o:this.domFromPos(n,n?-1:1),u=r.root.getSelection(),d=r.domSelectionRange(),h=!1;if((hl||Ks)&&t==n){let{node:A,offset:p}=o;if(A.nodeType==3){if(h=!!(p&&A.nodeValue[p-1]==`
`),h&&p==A.nodeValue.length)for(let m=A,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(o=l={node:g.parentNode,offset:ms(g)+1});break}let y=m.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let m=A.childNodes[p-1];h=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(hl&&d.focusNode&&d.focusNode!=l.node&&d.focusNode.nodeType==1){let A=d.focusNode.childNodes[d.focusOffset];A&&A.contentEditable=="false"&&(i=!0)}if(!(i||h&&Ks)&&Kp(o.node,o.offset,d.anchorNode,d.anchorOffset)&&Kp(l.node,l.offset,d.focusNode,d.focusOffset))return;let f=!1;if((u.extend||t==n)&&!(h&&hl)){u.collapse(o.node,o.offset);try{t!=n&&u.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(t>n){let p=o;o=l,l=p}let A=document.createRange();A.setEnd(l.node,l.offset),A.setStart(o.node,o.offset),u.removeAllRanges(),u.addRange(A)}}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,l=a-s.border;if(t>=o&&n<=l){this.dirty=t==r||n==a?qf:gK,t==o&&n==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=cu:s.markDirty(t-o,n-o);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?qf:cu}r=a}this.dirty=qf}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?qf:gK;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class lue extends k2{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==Al&&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 BHe extends k2{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 qp extends k2{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=cm.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new qp(t,n,a.dom,a.contentDOM||a.dom,a)}parseRule(){return this.dirty&cu||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=cu&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Al){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Al}}slice(t,n,r){let i=qp.create(this.parent,this.mark,!0,r),s=this.children,a=this.size;n<a&&(s=JF(s,n,a,r)),t>0&&(s=JF(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 cA extends k2{constructor(t,n,r,i,s,a,o,l,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],l,u=o&&o(n,s,()=>{if(!l)return a;if(l.parent)return l.parent.posBeforeChild(l)},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}=cm.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 f=d;return d=hue(d,r,n),u?l=new _He(t,n,r,i,d,h||null,f,u,s,a+1):n.isText?new Qj(t,n,r,i,d,f,s):new cA(t,n,r,i,d,h||null,f,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=()=>De.empty)}return t}matchesNode(t,n,r){return this.dirty==Al&&t.eq(this.node)&&w_(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,l=new NHe(this,a&&a.node,t);PHe(this.node,this.innerDeco,(u,d,h)=>{u.spec.marks?l.syncToMarks(u.spec.marks,r,t,d):u.type.side>=0&&!h&&l.syncToMarks(d==this.node.childCount?Xn.none:this.node.child(d).marks,r,t,d),l.placeWidget(u,t,i)},(u,d,h,f)=>{l.syncToMarks(u.marks,r,t,f);let A;l.findNodeMatch(u,d,h,f)||o&&t.state.selection.from>i&&t.state.selection.to<i+u.nodeSize&&(A=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(u,d,h,A,t)||l.updateNextNode(u,d,h,t,f,i)||l.addNode(u,d,h,t,i),i+=u.nodeSize}),l.syncToMarks([],r,t,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==qf)&&(a&&this.protectLocalComposition(t,a),uue(this.contentDOM,this.children,t),o0&&IHe(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof Yt)||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=OHe(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 BHe(this,s,n,i);t.input.compositionNodes.push(a),this.children=JF(this.children,r,r+i.length,t,a)}update(t,n,r,i){return this.dirty==cu||!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=Al}updateOuterDeco(t){if(w_(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=due(this.dom,this.nodeDOM,XF(this.outerDeco,this.node,n),XF(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 yK(e,t,n,r,i){hue(r,t,e);let s=new cA(void 0,e,t,n,r,r,r,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class Qj extends cA{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==cu||this.dirty!=Al&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Al||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=Al,!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 Qj(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=cu)}get domAtom(){return!1}isText(t){return this.node.text==t}}class cue extends k2{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Al&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class _He extends cA{constructor(t,n,r,i,s,a,o,l,u,d){super(t,n,r,i,s,a,o,u,d),this.spec=l}update(t,n,r,i){if(this.dirty==cu)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 uue(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=vK(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(o,r);if(a instanceof qp){let l=r?r.previousSibling:e.lastChild;uue(a.contentDOM,a.children,n),r=l?l.nextSibling:e.firstChild}}for(;r;)r=vK(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const jw=function(e){e&&(this.nodeName=e)};jw.prototype=Object.create(null);const Wf=[new jw];function XF(e,t,n){if(e.length==0)return Wf;let r=n?Wf[0]:new jw,i=[r];for(let s=0;s<e.length;s++){let a=e[s].type.attrs;if(a){a.nodeName&&i.push(r=new jw(a.nodeName));for(let o in a){let l=a[o];l!=null&&(n&&i.length==1&&i.push(r=new jw(t.isInline?"span":"div")),o=="class"?r.class=(r.class?r.class+" ":"")+l:o=="style"?r.style=(r.style?r.style+";":"")+l:o!="nodeName"&&(r[o]=l))}}}return i}function due(e,t,n,r){if(n==Wf&&r==Wf)return t;let i=t;for(let s=0;s<r.length;s++){let a=r[s],o=n[s];if(s){let l;o&&o.nodeName==a.nodeName&&i!=e&&(l=i.parentNode)&&l.nodeName.toLowerCase()==a.nodeName||(l=document.createElement(a.nodeName),l.pmIsDeco=!0,l.appendChild(i),o=Wf[0]),i=l}EHe(i,o||Wf[0],a)}return i}function EHe(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 hue(e,t,n){return due(e,e,Wf,XF(t,n,e.nodeType!=1))}function w_(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 vK(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class NHe{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=jHe(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=Al,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<t.length;){this.stack.push(this.top,this.index+1);let l=-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)){l=d;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let d=qp.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,l=Math.min(this.top.children.length,o+5);o<l;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==cu&&a.dom==a.contentDOM&&(a.dirty=qf),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 l=this.top.children[o];if(l instanceof cA){let u=this.preMatch.matched.get(l);if(u!=null&&u!=s)return!1;let d=l.dom,h,f=this.isLocked(d)&&!(t.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==t.text&&l.dirty!=cu&&w_(n,l.outerDeco));if(!f&&l.update(t,n,r,i))return this.destroyBetween(this.index,o),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!f&&(h=this.recreateWrapper(l,t,n,r,i,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=qf,h.updateChildren(i,a+1),h.dirty=Al),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)||!w_(r,t.outerDeco)||!i.eq(t.innerDeco))return null;let o=cA.create(this.top,n,r,i,s,a);if(o.contentDOM){o.children=t.children,t.children=[];for(let l of o.children)l.parent=o}return t.destroy(),o}addNode(t,n,r,i,s){let a=cA.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 lue(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 qp;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof Qj)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((Ks||ys)&&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 cue(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 jHe(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 qp)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 l=o.node;if(l){if(l!=e.child(i-1))break;--i,s.set(o,i),a.push(o)}}return{index:i,matched:s,matches:a.reverse()}}function THe(e,t){return e.type.side-t.type.side}function PHe(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=[],l=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(THe);for(let g=0;g<h.length;g++)n(h[g],u,!!l)}else n(d,u,!!l);let f,A;if(l)A=-1,f=l,l=null;else if(u<e.childCount)A=u,f=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+f.nodeSize;if(f.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&&(l=f.cut(g-s),f=f.cut(0,g-s),p=g,A=-1)}else for(;a<i.length&&i[a].to<p;)a++;let m=f.isInline&&!f.isLeaf?o.filter(g=>!g.inline):o.slice();r(f,m,t.forChild(s,f),A),s=p}}function IHe(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 OHe(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 l=a.text;for(;i<e.childCount;){let u=e.child(i++);if(s+=u.nodeSize,!u.isText)break;l+=u.text}if(s>=n){if(s>=r&&l.slice(r-t.length-o,r-o)==t)return r-t.length;let u=o<r?l.lastIndexOf(t,r-o-1):-1;if(u>=0&&u+t.length+o>=n)return o+u;if(n==r&&l.length>=r+t.length-o&&l.slice(r-o,r-o+t.length)==t)return r}}return-1}function JF(e,t,n,r,i){let s=[];for(let a=0,o=0;a<e.length;a++){let l=e[a],u=o,d=o+=l.size;u>=n||d<=t?s.push(l):(u<t&&s.push(l.slice(0,t-u,r)),i&&(s.push(i),i=void 0),d>n&&s.push(l.slice(n-u,l.size,r)))}return s}function q6(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),l,u;if(Dj(n)){for(l=a;i&&!i.node;)i=i.parent;let h=i.node;if(i&&h.isAtom&&Ft.isSelectable(h)&&i.parent&&!(h.isInline&&oHe(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;u=new Ft(a==f?o:r.resolve(f))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=a,f=a;for(let A=0;A<n.rangeCount;A++){let p=n.getRangeAt(A);h=Math.min(h,e.docView.posFromDOM(p.startContainer,p.startOffset,1)),f=Math.max(f,e.docView.posFromDOM(p.endContainer,p.endOffset,-1))}if(h<0)return null;[l,a]=f==e.state.selection.anchor?[f,h]:[h,f],o=r.resolve(a)}else l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let d=r.resolve(l);if(!u){let h=t=="pointer"||e.state.selection.head<o.pos&&!s?1:-1;u=W6(e,d,o,h)}return u}function Aue(e){return e.editable?e.hasFocus():pue(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function nd(e,t=!1){let n=e.state.selection;if(fue(e,n),!!Aue(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&ys){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Kp(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)MHe(e);else{let{anchor:r,head:i}=n,s,a;xK&&!(n instanceof Yt)&&(n.$from.parent.inlineContent||(s=wK(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=wK(e,n.to))),e.docView.setSelection(r,i,e,t),xK&&(s&&bK(s),a&&bK(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&FHe(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const xK=Ks||ys&&eue<63;function wK(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(Ks&&i&&i.contentEditable=="false")return jI(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return jI(i);if(s)return jI(s)}}function jI(e){return e.contentEditable="true",Ks&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function bK(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function FHe(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(()=>{(!Aue(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function MHe(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName=="IMG";r?t.collapse(n.parentNode,ms(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&Wa&&lA<=11&&(n.disabled=!0,n.disabled=!1)}function fue(e,t){if(t instanceof Ft){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(CK(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else CK(e)}function CK(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function W6(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||Yt.between(t,n,r)}function SK(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 LHe(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Kp(t.node,t.offset,n.anchorNode,n.anchorOffset)}function ZF(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&&cn.findFrom(s,t)}function Ah(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function kK(e,t,n){let r=e.state.selection;if(r instanceof Yt)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 Ah(e,new Yt(r.$anchor,a))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=ZF(e.state,t);return i&&i instanceof Ft?Ah(e,i):!1}else if(!(Wo&&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?Ft.isSelectable(s)?Ah(e,new Ft(t<0?e.state.doc.resolve(i.pos-s.nodeSize):i)):S2?Ah(e,new Yt(e.state.doc.resolve(t<0?o:o+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Ft&&r.node.isInline)return Ah(e,new Yt(t>0?r.$to:r.$from));{let i=ZF(e.state,t);return i?Ah(e,i):!1}}}function b_(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Tw(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function tg(e,t){return t<0?RHe(e):UHe(e)}function RHe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,s,a=!1;for(hl&&n.nodeType==1&&r<b_(n)&&Tw(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let o=n.childNodes[r-1];if(Tw(o,-1))i=n,s=--r;else if(o.nodeType==3)n=o,r=n.nodeValue.length;else break}}else{if(mue(n))break;{let o=n.previousSibling;for(;o&&Tw(o,-1);)i=n.parentNode,s=ms(o),o=o.previousSibling;if(o)n=o,r=b_(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?eM(e,n,r):i&&eM(e,i,s)}function UHe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=b_(n),s,a;for(;;)if(r<i){if(n.nodeType!=1)break;let o=n.childNodes[r];if(Tw(o,1))s=n,a=++r;else break}else{if(mue(n))break;{let o=n.nextSibling;for(;o&&Tw(o,1);)s=o.parentNode,a=ms(o)+1,o=o.nextSibling;if(o)n=o,r=0,i=b_(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}s&&eM(e,s,a)}function mue(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function DHe(e,t){for(;e&&t==e.childNodes.length&&!C2(e);)t=ms(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 QHe(e,t){for(;e&&!t&&!C2(e);)t=ms(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 eM(e,t,n){if(t.nodeType!=3){let s,a;(a=DHe(t,n))?(t=a,n=0):(s=QHe(t,n))&&(t=s,n=s.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Dj(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&&nd(e)},50)}function BK(e,t){let n=e.state.doc.resolve(t);if(!(ys||tue)&&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 _K(e,t,n){let r=e.state.selection;if(r instanceof Yt&&!r.empty||n.indexOf("s")>-1||Wo&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let a=ZF(e.state,t);if(a&&a instanceof Ft)return Ah(e,a)}if(!i.parent.inlineContent){let a=t<0?i:s,o=r instanceof dl?cn.near(a,t):cn.findFrom(a,t);return o?Ah(e,o):!1}return!1}function EK(e,t){if(!(e.state.selection instanceof Yt))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 NK(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function HHe(e){if(!Ks||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;NK(e,r,"true"),setTimeout(()=>NK(e,r,"false"),20)}return!1}function $He(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function zHe(e,t){let n=t.keyCode,r=$He(t);if(n==8||Wo&&n==72&&r=="c")return EK(e,-1)||tg(e,-1);if(n==46&&!t.shiftKey||Wo&&n==68&&r=="c")return EK(e,1)||tg(e,1);if(n==13||n==27)return!0;if(n==37||Wo&&n==66&&r=="c"){let i=n==37?BK(e,e.state.selection.from)=="ltr"?-1:1:-1;return kK(e,i,r)||tg(e,i)}else if(n==39||Wo&&n==70&&r=="c"){let i=n==39?BK(e,e.state.selection.from)=="ltr"?1:-1:1;return kK(e,i,r)||tg(e,i)}else{if(n==38||Wo&&n==80&&r=="c")return _K(e,-1,r)||tg(e,-1);if(n==40||Wo&&n==78&&r=="c")return HHe(e)||_K(e,1,r)||tg(e,1);if(r==(Wo?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function G6(e,t){e.someProp("transformCopied",A=>{t=A(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 A=r.firstChild;n.push(A.type.name,A.attrs!=A.type.defaultAttrs?A.attrs:null),r=A.content}let a=e.someProp("clipboardSerializer")||cm.fromSchema(e.state.schema),o=bue(),l=o.createElement("div");l.appendChild(a.serializeFragment(r,{document:o}));let u=l.firstChild,d,h=0;for(;u&&u.nodeType==1&&(d=wue[u.nodeName.toLowerCase()]);){for(let A=d.length-1;A>=0;A--){let p=o.createElement(d[A]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),h++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${s}${h?` -${h}`:""} ${JSON.stringify(n)}`);let f=e.someProp("clipboardTextSerializer",A=>A(t,e))||t.content.textBetween(0,t.content.size,`

`);return{dom:l,text:f,slice:t}}function gue(e,t,n,r,i){let s=i.parent.type.spec.code,a,o;if(!n&&!t)return null;let l=!!t&&(r||s||!n);if(l){if(e.someProp("transformPastedText",f=>{t=f(t,s||r,e)}),s)return o=new rt(De.from(e.state.schema.text(t.replace(/\r\n?/g,`
`))),0,0),e.someProp("transformPasted",f=>{o=f(o,e,!0)}),o;let h=e.someProp("clipboardTextParser",f=>f(t,i,r,e));if(h)o=h;else{let f=i.marks(),{schema:A}=e.state,p=cm.fromSchema(A);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=a.appendChild(document.createElement("p"));m&&g.appendChild(p.serializeNode(A.text(m,f)))})}}else e.someProp("transformPastedHTML",h=>{n=h(n,e)}),a=WHe(n),S2&&GHe(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 f=a.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;a=f}if(o||(o=(e.someProp("clipboardParser")||e.someProp("domParser")||oA.fromSchema(e.state.schema)).parseSlice(a,{preserveWhitespace:!!(l||d),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!VHe.test(f.parentNode.nodeName)?{ignore:!0}:null}})),d)o=YHe(jK(o,+d[1],+d[2]),d[4]);else if(o=rt.maxOpen(KHe(o.content,i),!0),o.openStart||o.openEnd){let h=0,f=0;for(let A=o.content.firstChild;h<o.openStart&&!A.type.spec.isolating;h++,A=A.firstChild);for(let A=o.content.lastChild;f<o.openEnd&&!A.type.spec.isolating;f++,A=A.lastChild);o=jK(o,h,f)}return e.someProp("transformPasted",h=>{o=h(o,e,l)}),o}const VHe=/^(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 KHe(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 l=i.findWrapping(o.type),u;if(!l)return a=null;if(u=a.length&&s.length&&vue(l,s,o,a[a.length-1],0))a[a.length-1]=u;else{a.length&&(a[a.length-1]=xue(a[a.length-1],s.length));let d=yue(o,l);a.push(d),i=i.matchType(d.type),s=l}}),a)return De.from(a)}return e}function yue(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,De.from(e));return e}function vue(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let s=vue(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(De.from(yue(n,e,i+1))))}}function xue(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,xue(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(De.empty,!0);return e.copy(n.append(r))}function tM(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=tM(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(De.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(o))}function jK(e,t,n){return t<e.openStart&&(e=new rt(tM(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new rt(tM(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const wue={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 TK=null;function bue(){return TK||(TK=document.implementation.createHTMLDocument("title"))}let TI=null;function qHe(e){let t=window.trustedTypes;return t?(TI||(TI=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),TI.createHTML(e)):e}function WHe(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=bue().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&wue[r[1].toLowerCase()])&&(e=i.map(s=>"<"+s+">").join("")+e+i.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=qHe(e),i)for(let s=0;s<i.length;s++)n=n.querySelector(i[s])||n;return n}function GHe(e){let t=e.querySelectorAll(ys?"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 YHe(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 l=n.nodes[r[o]];if(!l||l.hasRequiredAttrs())break;i=De.from(l.create(r[o+1],i)),s++,a++}return new rt(i,s,a)}const ya={},va={},XHe={touchstart:!0,touchmove:!0};class JHe{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 ZHe(e){for(let t in ya){let n=ya[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{t$e(e,r)&&!Y6(e,r)&&(e.editable||!(r.type in va))&&n(e,r)},XHe[t]?{passive:!0}:void 0)}Ks&&e.dom.addEventListener("input",()=>null),nM(e)}function Hh(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function e$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 nM(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>Y6(e,r))})}function Y6(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function t$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 n$e(e,t){!Y6(e,t)&&ya[t.type]&&(e.editable||!(t.type in va))&&ya[t.type](e,t)}va.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!Sue(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Xu&&ys&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),o0&&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,Rf(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||zHe(e,n)?n.preventDefault():Hh(e,"key")};va.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};va.keypress=(e,t)=>{let n=t;if(Sue(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Wo&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Yt)||!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 Hj(e){return{left:e.clientX,top:e.clientY}}function r$e(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function X6(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 vy(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 i$e(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&Ft.isSelectable(r)?(vy(e,new Ft(n)),!0):!1}function s$e(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof Ft&&(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(Ft.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?(vy(e,Ft.create(e.state.doc,i)),!0):!1}function a$e(e,t,n,r,i){return X6(e,"handleClickOn",t,n,r)||e.someProp("handleClick",s=>s(e,t,r))||(i?s$e(e,n):i$e(e,n))}function o$e(e,t,n,r){return X6(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function l$e(e,t,n,r){return X6(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||c$e(e,n,r)}function c$e(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(vy(e,Yt.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)vy(e,Yt.create(r,o+1,o+1+a.content.size));else if(Ft.isSelectable(a))vy(e,Ft.create(r,o));else continue;return!0}}function J6(e){return C_(e)}const Cue=Wo?"metaKey":"ctrlKey";ya.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=J6(e),i=Date.now(),s="singleClick";i-e.input.lastClick.time<500&&r$e(n,e.input.lastClick)&&!n[Cue]&&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(Hj(n));a&&(s=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new u$e(e,a,n,!!r)):(s=="doubleClick"?o$e:l$e)(e,a.pos,a.inside,n)?n.preventDefault():Hh(e,"pointer"))};class u$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[Cue],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,l=o?t.docView.nearestDesc(o,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:u}=t.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||u instanceof Ft&&u.from<=a&&u.to>a)&&(this.mightDrag={node:s,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&hl&&!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)),Hh(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(()=>nd(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(Hj(t))),this.updateAllowDefault(t),this.allowDefault||!n?Hh(this.view,"pointer"):a$e(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Ks&&this.mightDrag&&!this.mightDrag.node.isAtom||ys&&!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)?(vy(this.view,cn.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):Hh(this.view,"pointer")}move(t){this.updateAllowDefault(t),Hh(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)}}ya.touchstart=e=>{e.input.lastTouch=Date.now(),J6(e),Hh(e,"pointer")};ya.touchmove=e=>{e.input.lastTouch=Date.now(),Hh(e,"pointer")};ya.contextmenu=e=>J6(e);function Sue(e,t){return e.composing?!0:Ks&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const d$e=Xu?5e3:-1;va.compositionstart=va.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Yt&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||ys&&tue&&h$e(e)))e.markCursor=e.state.storedMarks||n.marks(),C_(e,!0),e.markCursor=null;else if(C_(e,!t.selection.empty),hl&&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}kue(e,d$e)};function h$e(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"}va.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++,kue(e,20))};function kue(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>C_(e),t))}function Bue(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=f$e());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function A$e(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=sHe(t.focusNode,t.focusOffset),r=aHe(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 f$e(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function C_(e,t=!1){if(!(Xu&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Bue(e),t||e.docView&&e.docView.dirty){let n=q6(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 p$e(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 Vb=Wa&&lA<15||o0&&uHe<604;ya.copy=va.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let s=Vb?null:n.clipboardData,a=r.content(),{dom:o,text:l}=G6(e,a);s?(n.preventDefault(),s.clearData(),s.setData("text/html",o.innerHTML),s.setData("text/plain",l)):p$e(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function m$e(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function g$e(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?Kb(e,r.value,null,i,t):Kb(e,r.textContent,r.innerHTML,i,t)},50)}function Kb(e,t,n,r,i){let s=gue(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,i,s||rt.empty)))return!0;if(!s)return!1;let a=m$e(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 _ue(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," "):""}va.paste=(e,t)=>{let n=t;if(e.composing&&!Xu)return;let r=Vb?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Kb(e,_ue(r),r.getData("text/html"),i,n)?n.preventDefault():g$e(e,n)};class Eue{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const y$e=Wo?"altKey":"ctrlKey";function Nue(e,t){let n=e.someProp("dragCopies",r=>!r(t));return n??!t[y$e]}ya.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(Hj(n)),a;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof Ft?i.to-1:i.to))){if(r&&r.mightDrag)a=Ft.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=Ft.create(e.state.doc,h.posBefore))}}let o=(a||e.state.selection).content(),{dom:l,text:u,slice:d}=G6(e,o);(!n.dataTransfer.files.length||!ys||eue>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Vb?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Vb||n.dataTransfer.setData("text/plain",u),e.dragging=new Eue(d,Nue(e,n),a)};ya.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};va.dragover=va.dragenter=(e,t)=>t.preventDefault();va.drop=(e,t)=>{try{v$e(e,t,e.dragging)}finally{e.dragging=null}};function v$e(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Hj(t));if(!r)return;let i=e.state.doc.resolve(r.pos),s=n&&n.slice;s?e.someProp("transformPasted",A=>{s=A(s,e,!1)}):s=gue(e,_ue(t.dataTransfer),Vb?null:t.dataTransfer.getData("text/html"),!1,i);let a=!!(n&&Nue(e,t));if(e.someProp("handleDrop",A=>A(e,t,s||rt.empty,a))){t.preventDefault();return}if(!s)return;t.preventDefault();let o=s?Uce(e.state.doc,i.pos,s):i.pos;o==null&&(o=i.pos);let l=e.state.tr;if(a){let{node:A}=n;A?A.replace(l):l.deleteSelection()}let u=l.mapping.map(o),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=l.doc;if(d?l.replaceRangeWith(u,u,s.content.firstChild):l.replaceRange(u,u,s),l.doc.eq(h))return;let f=l.doc.resolve(u);if(d&&Ft.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new Ft(f));else{let A=l.mapping.map(o);l.mapping.maps[l.mapping.maps.length-1].forEach((p,m,g,y)=>A=y),l.setSelection(W6(e,f,l.doc.resolve(A)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}ya.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())&&nd(e)},20))};ya.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)};ya.beforeinput=(e,t)=>{if(ys&&Xu&&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,Rf(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 va)ya[e]=va[e];function qb(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 S_{constructor(t,n){this.toDOM=t,this.spec=n||wp,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 da(s-r,s-r,this)}valid(){return!0}eq(t){return this==t||t instanceof S_&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&qb(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class uA{constructor(t,n){this.attrs=t,this.spec=n||wp}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 da(s,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof uA&&qb(this.attrs,t.attrs)&&qb(this.spec,t.spec)}static is(t){return t.type instanceof uA}destroy(){}}class Z6{constructor(t,n){this.attrs=t,this.spec=n||wp}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 da(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 Z6&&qb(this.attrs,t.attrs)&&qb(this.spec,t.spec)}destroy(){}}class da{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new da(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 da(t,t,new S_(n,r))}static inline(t,n,r,i){return new da(t,n,new uA(r,i))}static node(t,n,r,i){return new da(t,n,new Z6(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof uA}get widget(){return this.type instanceof S_}}const kg=[],wp={};class Fr{constructor(t,n){this.local=t.length?t:kg,this.children=n.length?n:kg}static create(t,n){return n.length?k_(n,t,0,wp):Ms}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==Ms||t.maps.length==0?this:this.mapInner(t,n,0,0,r||wp)}mapInner(t,n,r,i,s){let a;for(let o=0;o<this.local.length;o++){let l=this.local[o].map(t,r,i);l&&l.type.valid(n,l)?(a||(a=[])).push(l):s.onRemove&&s.onRemove(this.local[o].spec)}return this.children.length?x$e(this.children,a||[],t,n,r,i,s):a?new Fr(a.sort(bp),kg):Ms}add(t,n){return n.length?this==Ms?Fr.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,s=0;t.forEach((o,l)=>{let u=l+r,d;if(d=Tue(n,o,u)){for(i||(i=this.children.slice());s<i.length&&i[s]<l;)s+=3;i[s]==l?i[s+2]=i[s+2].addInner(o,d,u+1):i.splice(s,0,l,l+o.nodeSize,k_(d,o,u+1,wp)),s+=3}});let a=jue(s?Pue(n):n,-r);for(let o=0;o<a.length;o++)a[o].type.valid(t,a[o])||a.splice(o--,1);return new Fr(a.length?this.local.concat(a).sort(bp):this.local,i||this.children)}remove(t){return t.length==0||this==Ms?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,l=r[s+1]+n;for(let d=0,h;d<t.length;d++)(h=t[d])&&h.from>o&&h.to<l&&(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!=Ms?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 Fr(i,r):Ms}forChild(t,n){if(this==Ms)return this;if(n.isLeaf)return Fr.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 l=this.local[o];if(l.from<a&&l.to>s&&l.type instanceof uA){let u=Math.max(s,l.from)-s,d=Math.min(a,l.to)-s;u<d&&(i||(i=[])).push(l.copy(u,d))}}if(i){let o=new Fr(i.sort(bp),kg);return r?new wh([o,r]):o}return r||Ms}eq(t){if(this==t)return!0;if(!(t instanceof Fr)||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 eQ(this.localsInner(t))}localsInner(t){if(this==Ms)return kg;if(t.inlineContent||!this.local.some(uA.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof uA||n.push(this.local[r]);return n}forEachSet(t){t(this)}}Fr.empty=new Fr([],[]);Fr.removeOverlap=eQ;const Ms=Fr.empty;class wh{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,wp));return wh.from(r)}forChild(t,n){if(n.isLeaf)return Fr.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(t,n);s!=Ms&&(s instanceof wh?r=r.concat(s.members):r.push(s))}return wh.from(r)}eq(t){if(!(t instanceof wh)||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?eQ(r?n:n.sort(bp)):kg}static from(t){switch(t.length){case 0:return Ms;case 1:return t[0];default:return new wh(t.every(n=>n instanceof Fr)?t:t.reduce((n,r)=>n.concat(r instanceof Fr?r:r.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function x$e(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((f,A,p,m)=>{let g=m-p-(A-f);for(let y=0;y<o.length;y+=3){let v=o[y+1];if(v<0||f>v+d-h)continue;let x=o[y]+d-h;A>=x?o[y+1]=f<=x?-2:-1:f>=d&&g&&(o[y]+=g,o[y+1]+=g)}h+=g}),d=n.maps[u].map(d,-1)}let l=!1;for(let u=0;u<o.length;u+=3)if(o[u+1]<0){if(o[u+1]==-2){l=!0,o[u+1]=-1;continue}let d=n.map(e[u]+s),h=d-i;if(h<0||h>=r.content.size){l=!0;continue}let f=n.map(e[u+1]+s,-1),A=f-i,{index:p,offset:m}=r.content.findIndex(h),g=r.maybeChild(p);if(g&&m==h&&m+g.nodeSize==A){let y=o[u+2].mapInner(n,g,d+1,e[u]+s+1,a);y!=Ms?(o[u]=h,o[u+1]=A,o[u+2]=y):(o[u+1]=-2,l=!0)}else l=!0}if(l){let u=w$e(o,e,t,n,i,s,a),d=k_(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,f=0;h<d.children.length;h+=3){let A=d.children[h];for(;f<o.length&&o[f]<A;)f+=3;o.splice(f,0,d.children[h],d.children[h+1],d.children[h+2])}}return new Fr(t.sort(bp),o)}function jue(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 da(i.from+t,i.to+t,i.type))}return n}function w$e(e,t,n,r,i,s,a){function o(l,u){for(let d=0;d<l.local.length;d++){let h=l.local[d].map(r,i,u);h?n.push(h):a.onRemove&&a.onRemove(l.local[d].spec)}for(let d=0;d<l.children.length;d+=3)o(l.children[d+2],l.children[d]+u+1)}for(let l=0;l<e.length;l+=3)e[l+1]==-1&&o(e[l+2],t[l]+s+1);return n}function Tue(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 Pue(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function k_(e,t,n,r){let i=[],s=!1;t.forEach((o,l)=>{let u=Tue(e,o,l+n);if(u){s=!0;let d=k_(u,o,n+l+1,r);d!=Ms&&i.push(l,l+o.nodeSize,d)}});let a=jue(s?Pue(e):e,-n).sort(bp);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 Fr(a,i):Ms}function bp(e,t){return e.from-t.from||e.to-t.to}function eQ(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),PK(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),PK(t,i,r.copy(s.from,r.to)));break}}}return t}function PK(e,t,n){for(;t<e.length&&bp(n,e[t])>0;)t++;e.splice(t,0,n)}function PI(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=Ms&&t.push(r)}),e.cursorWrapper&&t.push(Fr.create(e.state.doc,[e.cursorWrapper.deco])),wh.from(t)}const b$e={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},C$e=Wa&&lA<=11;class S$e{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 k$e{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new S$e,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]);Wa&&lA<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():Ks&&t.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),C$e&&(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,b$e)),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(SK(this.view)){if(this.suppressingSelectionUpdates)return nd(this.view);if(Wa&&lA<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Kp(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=a0(s))n.add(s);for(let s=t.anchorNode;s;s=a0(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)&&SK(t)&&!this.ignoreSelectionChange(r),s=-1,a=-1,o=!1,l=[];if(t.editable)for(let d=0;d<n.length;d++){let h=this.registerMutation(n[d],l);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(l.some(d=>d.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46)){for(let d of l)if(d.nodeName=="BR"&&d.parentNode){let h=d.nextSibling;h&&h.nodeType==1&&h.contentEditable=="false"&&d.parentNode.removeChild(d)}}else if(hl&&l.length){let d=l.filter(h=>h.nodeName=="BR");if(d.length==2){let[h,f]=d;h.parentNode&&h.parentNode.parentNode==f.parentNode?f.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let f of d){let A=f.parentNode;A&&A.nodeName=="LI"&&(!h||E$e(t,h)!=A)&&f.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&&Dj(r)&&(u=q6(t))&&u.eq(cn.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,nd(t),this.currentSelection.set(r),t.scrollToSelection()):(s>-1||i)&&(s>-1&&(t.docView.markDirty(s,a),B$e(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,N$e(t,l)),this.handleDOMChange(s,a,o,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||nd(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(Wa&&lA<=11&&t.addedNodes.length)for(let d=0;d<t.addedNodes.length;d++){let{previousSibling:h,nextSibling:f}=t.addedNodes[d];(!h||Array.prototype.indexOf.call(t.addedNodes,h)<0)&&(i=h),(!f||Array.prototype.indexOf.call(t.addedNodes,f)<0)&&(s=f)}let a=i&&i.parentNode==t.target?ms(i)+1:0,o=r.localPosFromDOM(t.target,a,-1),l=s&&s.parentNode==t.target?ms(s):t.target.childNodes.length,u=r.localPosFromDOM(t.target,l,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 IK=new WeakMap,OK=!1;function B$e(e){if(!IK.has(e)&&(IK.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=hl,OK)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."),OK=!0}}function FK(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,s=t.endOffset,a=e.domAtPos(e.state.selection.anchor);return Kp(a.node,a.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function _$e(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return FK(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?FK(e,n):null}function E$e(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 N$e(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 l=o.firstChild;if(!l||l.nodeType!=1||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;o=l}o.insertBefore(s,o.firstChild),r==s&&e.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}function j$e(e,t,n){let{node:r,fromOffset:i,toOffset:s,from:a,to:o}=e.docView.parseRange(t,n),l=e.domSelectionRange(),u,d=l.anchorNode;if(d&&e.dom.contains(d.nodeType==1?d:d.parentNode)&&(u=[{node:d,offset:l.anchorOffset}],Dj(l)||u.push({node:l.focusNode,offset:l.focusOffset})),ys&&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,f=e.someProp("domParser")||oA.fromSchema(e.state.schema),A=h.resolve(a),p=null,m=f.parse(r,{topNode:A.parent,topMatch:A.parent.contentMatchAt(A.index()),topOpen:!0,from:i,to:s,preserveWhitespace:A.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:T$e,context:A});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 T$e(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(Ks&&/^(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||Ks&&/^(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 P$e=/^(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 I$e(e,t,n,r,i){let s=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let _=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,E=q6(e,_);if(E&&!e.state.selection.eq(E)){if(ys&&Xu&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",I=>I(e,Rf(13,"Enter"))))return;let j=e.state.tr.setSelection(E);_=="pointer"?j.setMeta("pointer",!0):_=="key"&&j.scrollIntoView(),s&&j.setMeta("composition",s),e.dispatch(j)}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 l=e.state.selection,u=j$e(e,t,n),d=e.state.doc,h=d.slice(u.from,u.to),f,A;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,A="end"):(f=e.state.selection.from,A="start"),e.input.lastKeyCode=null;let p=M$e(h.content,u.doc.content,u.from,f,A);if(p&&e.input.domChangeCount++,(o0&&e.input.lastIOSEnter>Date.now()-225||Xu)&&i.some(_=>_.nodeType==1&&!P$e.test(_.nodeName))&&(!p||p.endA>=p.endB)&&e.someProp("handleKeyDown",_=>_(e,Rf(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!p)if(r&&l instanceof Yt&&!l.empty&&l.$head.sameParent(l.$anchor)&&!e.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let _=MK(e,e.state.doc,u.sel);if(_&&!_.eq(e.state.selection)){let E=e.state.tr.setSelection(_);s&&E.setMeta("composition",s),e.dispatch(E)}}return}e.state.selection.from<e.state.selection.to&&p.start==p.endB&&e.state.selection instanceof Yt&&(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)),Wa&&lA<=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((o0&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(_=>_.nodeName=="DIV"||_.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",_=>_(e,Rf(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>p.start&&F$e(d,p.start,p.endA,m,g)&&e.someProp("handleKeyDown",_=>_(e,Rf(8,"Backspace")))){Xu&&ys&&e.domObserver.suppressSelectionUpdates();return}ys&&p.endB==p.start&&(e.input.lastChromeDelete=Date.now()),Xu&&!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(_){return _(e,Rf(13,"Enter"))})},20));let x=p.start,b=p.endA,w=_=>{let E=_||e.state.tr.replace(x,b,u.doc.slice(p.start-u.from,p.endB-u.from));if(u.sel){let j=MK(e,E.doc,u.sel);j&&!(ys&&e.composing&&j.empty&&(p.start!=p.endB||e.input.lastChromeDelete<Date.now()-100)&&(j.head==x||j.head==E.mapping.map(b)-1)||Wa&&j.empty&&j.head==x)&&E.setSelection(j)}return s&&E.setMeta("composition",s),E.scrollIntoView()},S;if(v)if(m.pos==g.pos){Wa&&lA<=11&&m.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>nd(e),20));let _=w(e.state.tr.delete(x,b)),E=d.resolve(p.start).marksAcross(d.resolve(p.endA));E&&_.ensureMarks(E),e.dispatch(_)}else if(p.endA==p.endB&&(S=O$e(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start())))){let _=w(e.state.tr);S.type=="add"?_.addMark(x,b,S.mark):_.removeMark(x,b,S.mark),e.dispatch(_)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let _=m.parent.textBetween(m.parentOffset,g.parentOffset),E=()=>w(e.state.tr.insertText(_,x,b));e.someProp("handleTextInput",j=>j(e,x,b,_,E))||e.dispatch(E())}else e.dispatch(w());else e.dispatch(w())}function MK(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:W6(e,t.resolve(n.anchor),t.resolve(n.head))}function O$e(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,s=r,a,o,l;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",l=d=>d.mark(o.addToSet(d.marks));else if(i.length==0&&s.length==1)o=s[0],a="remove",l=d=>d.mark(o.removeFromSet(d.marks));else return null;let u=[];for(let d=0;d<t.childCount;d++)u.push(l(t.child(d)));if(De.from(u).eq(e))return{mark:o,type:a}}function F$e(e,t,n,r,i){if(n-t<=i.pos-r.pos||II(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(II(s,!0,!0));return!a.parent.isTextblock||a.pos>n||II(a,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function II(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 M$e(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 l=Math.max(0,s-Math.min(a,o));r-=a+l-s}if(a<s&&e.size<t.size){let l=r<=s&&r>=a?s-r:0;s-=l,s&&s<t.size&&LK(t.textBetween(s-1,s+1))&&(s+=l?1:-1),o=s+(o-a),a=s}else if(o<s){let l=r<=s&&r>=o?s-r:0;s-=l,s&&s<e.size&&LK(e.textBetween(s-1,s+1))&&(s+=l?1:-1),a=s+(a-o),o=s}return{start:s,endA:a,endB:o}}function LK(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 Iue{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 JHe,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(HK),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=DK(this),UK(this),this.nodeViews=QK(this),this.docView=yK(this.state.doc,RK(this),PI(this),this.dom,this),this.domObserver=new k$e(this,(r,i,s,a)=>I$e(this,r,i,s,a)),this.domObserver.start(),ZHe(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&&nM(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(HK),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&&(Bue(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 A=QK(this);R$e(A,this.nodeViews)&&(this.nodeViews=A,s=!0)}(o||n.handleDOMEvents!=this._props.handleDOMEvents)&&nM(this),this.editable=DK(this),UK(this);let l=PI(this),u=RK(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,l);(h||!t.selection.eq(i.selection))&&(a=!0);let f=d=="preserve"&&a&&this.dom.style.overflowAnchor==null&&AHe(this);if(a){this.domObserver.stop();let A=h&&(Wa||ys)&&!this.composing&&!i.selection.empty&&!t.selection.empty&&L$e(i.selection,t.selection);if(h){let p=ys?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=A$e(this)),(s||!this.docView.update(t.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=yK(t.doc,u,l,this.dom,this)),p&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(A=!0)}A||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&LHe(this))?nd(this,A):(fue(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():f&&fHe(f)}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 Ft){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&hK(this,n.getBoundingClientRect(),t)}else hK(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 Eue(t.slice,t.move,i<0?void 0:Ft.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(Wa){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&&pHe(this.dom),nd(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 xHe(this,t)}coordsAtPos(t,n=1){return aue(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 kHe(this,n||this.state,t)}pasteHTML(t,n){return Kb(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Kb(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return G6(this,t)}destroy(){this.docView&&(e$e(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],PI(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,rHe())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return n$e(this,t)}domSelectionRange(){let t=this.domSelection();return t?Ks&&this.root.nodeType===11&&lHe(this.dom.ownerDocument)==this.dom&&_$e(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}Iue.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function RK(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"),[da.node(0,e.state.doc.content.size,t)]}function UK(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:da.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function DK(e){return!e.someProp("editable",t=>t(e.state)===!1)}function L$e(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 QK(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 R$e(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 HK(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 EA={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:"'"},B_={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},U$e=typeof navigator<"u"&&/Mac/.test(navigator.platform),D$e=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var gs=0;gs<10;gs++)EA[48+gs]=EA[96+gs]=String(gs);for(var gs=1;gs<=24;gs++)EA[gs+111]="F"+gs;for(var gs=65;gs<=90;gs++)EA[gs]=String.fromCharCode(gs+32),B_[gs]=String.fromCharCode(gs);for(var OI in EA)B_.hasOwnProperty(OI)||(B_[OI]=EA[OI]);function Q$e(e){var t=U$e&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||D$e&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?B_:EA)[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 H$e=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),$$e=typeof navigator<"u"&&/Win/.test(navigator.platform);function z$e(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 l=t[o];if(/^(cmd|meta|m)$/i.test(l))a=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))H$e?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),a&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function V$e(e){let t=Object.create(null);for(let n in e)t[z$e(n)]=e[n];return t}function FI(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 K$e(e){return new Ur({props:{handleKeyDown:Oue(e)}})}function Oue(e){let t=V$e(e);return function(n,r){let i=Q$e(r),s,a=t[FI(i,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let o=t[FI(i,r,!1)];if(o&&o(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!($$e&&r.ctrlKey&&r.altKey)&&(s=EA[r.keyCode])&&s!=i){let o=t[FI(s,r)];if(o&&o(n.state,n.dispatch,n))return!0}}return!1}}var q$e=Object.defineProperty,tQ=(e,t)=>{for(var n in t)q$e(e,n,{get:t[n],enumerable:!0})};function $j(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 zj=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,l=e||i.tr,u=()=>(!o&&t&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(l),a.every(h=>h===!0)),d={...Object.fromEntries(Object.entries(n).map(([h,f])=>[h,(...p)=>{const m=this.buildProps(l,t),g=f(...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,l])=>[o,(...u)=>l(...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:$j({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,l])=>[o,(...u)=>l(...u)(a)]))}};return a}},Fue={};tQ(Fue,{blur:()=>W$e,clearContent:()=>G$e,clearNodes:()=>Y$e,command:()=>X$e,createParagraphNear:()=>J$e,cut:()=>Z$e,deleteCurrentNode:()=>e8e,deleteNode:()=>t8e,deleteRange:()=>n8e,deleteSelection:()=>r8e,enter:()=>i8e,exitCode:()=>s8e,extendMarkRange:()=>a8e,first:()=>o8e,focus:()=>c8e,forEach:()=>u8e,insertContent:()=>d8e,insertContentAt:()=>f8e,joinBackward:()=>g8e,joinDown:()=>m8e,joinForward:()=>y8e,joinItemBackward:()=>v8e,joinItemForward:()=>x8e,joinTextblockBackward:()=>w8e,joinTextblockForward:()=>b8e,joinUp:()=>p8e,keyboardShortcut:()=>S8e,lift:()=>k8e,liftEmptyBlock:()=>B8e,liftListItem:()=>_8e,newlineInCode:()=>E8e,resetAttributes:()=>N8e,scrollIntoView:()=>j8e,selectAll:()=>T8e,selectNodeBackward:()=>P8e,selectNodeForward:()=>I8e,selectParentNode:()=>O8e,selectTextblockEnd:()=>F8e,selectTextblockStart:()=>M8e,setContent:()=>L8e,setMark:()=>r7e,setMeta:()=>i7e,setNode:()=>s7e,setNodeSelection:()=>a7e,setTextDirection:()=>o7e,setTextSelection:()=>l7e,sinkListItem:()=>c7e,splitBlock:()=>u7e,splitListItem:()=>d7e,toggleList:()=>h7e,toggleMark:()=>A7e,toggleNode:()=>f7e,toggleWrap:()=>p7e,undoInputRule:()=>m7e,unsetAllMarks:()=>g7e,unsetMark:()=>y7e,unsetTextDirection:()=>v7e,updateAttributes:()=>x7e,wrapIn:()=>w7e,wrapInList:()=>b7e});var W$e=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),G$e=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),Y$e=()=>({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,l)=>{if(o.type.isText)return;const{doc:u,mapping:d}=t,h=u.resolve(d.map(l)),f=u.resolve(d.map(l+o.nodeSize)),A=h.blockRange(f);if(!A)return;const p=ov(A);if(o.type.isTextblock){const{defaultType:m}=h.parent.contentMatchAt(h.index());t.setNodeMarkup(A.start,m)}(p||p===0)&&t.lift(A,p)})}),!0},X$e=e=>t=>e(t),J$e=()=>({state:e,dispatch:t})=>$Qe(e,t),Z$e=(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 Yt(r.doc.resolve(Math.max(a-1,0)))),!0},e8e=()=>({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),l=i.after(s);e.delete(o,l).scrollIntoView()}return!0}return!1};function ki(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 t8e=e=>({tr:t,state:n,dispatch:r})=>{const i=ki(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 l=s.before(a),u=s.after(a);t.delete(l,u).scrollIntoView()}return!0}return!1},n8e=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},r8e=()=>({state:e,dispatch:t})=>TQe(e,t),i8e=()=>({commands:e})=>e.keyboardShortcut("Enter"),s8e=()=>({state:e,dispatch:t})=>HQe(e,t);function nQ(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function __(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:nQ(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function Mue(e,t,n={}){return e.find(r=>r.type===t&&__(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function $K(e,t,n={}){return!!Mue(e,t,n)}function rQ(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),!Mue([...i.node.marks],t,n)))return;let a=i.index,o=e.start()+i.offset,l=a+1,u=o+i.node.nodeSize;for(;a>0&&$K([...e.parent.child(a-1).marks],t,n);)a-=1,o-=e.parent.child(a).nodeSize;for(;l<e.parent.childCount&&$K([...e.parent.child(l).marks],t,n);)u+=e.parent.child(l).nodeSize,l+=1;return{from:o,to:u}}function _d(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 a8e=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const s=_d(e,r.schema),{doc:a,selection:o}=n,{$from:l,from:u,to:d}=o;if(i){const h=rQ(l,s,t);if(h&&h.from<=u&&h.to>=d){const f=Yt.create(a,h.from,h.to);n.setSelection(f)}}return!0},o8e=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 Lue(e){return e instanceof Yt}function Gf(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Rue(e,t=null){if(!t)return null;const n=cn.atStart(e),r=cn.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,s=r.to;return t==="all"?Yt.create(e,Gf(0,i,s),Gf(e.content.size,i,s)):Yt.create(e,Gf(t,i,s),Gf(t,i,s))}function zK(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function E_(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function l8e(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var c8e=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:s})=>{t={scrollIntoView:!0,...t};const a=()=>{(E_()||zK())&&r.dom.focus(),l8e()&&!E_()&&!zK()&&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&&!Lue(n.state.selection))return a(),!0;const o=Rue(i.doc,e)||n.state.selection,l=n.state.selection.eq(o);return s&&(l||i.setSelection(o),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},u8e=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),d8e=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Uue=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&&Uue(r)}return e};function yS(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 Uue(n)}function Wb(e,t,n){if(e instanceof aA||e instanceof De)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 De.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),Wb("",t,n)}if(i){if(n.errorOnInvalidContent){let a=!1,o="";const l=new Ece({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?oA.fromSchema(l).parseSlice(yS(e),n.parseOptions):oA.fromSchema(l).parse(yS(e),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${o}`)})}const s=oA.fromSchema(t);return n.slice?s.parseSlice(yS(e),n.parseOptions).content:s.parse(yS(e),n.parseOptions)}return Wb("",t,n)}function h8e(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof Gi||i instanceof Xi))return;const s=e.mapping.maps[r];let a=0;s.forEach((o,l,u,d)=>{a===0&&(a=d)}),e.setSelection(cn.near(e.doc.resolve(a),n))}var A8e=e=>!("type"in e),f8e=(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 l=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{Wb(t,s.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(g){l(g)}try{o=Wb(t,s.schema,{parseOptions:u,errorOnInvalidContent:(a=n.errorOnInvalidContent)!=null?a:s.options.enableContentCheck})}catch(g){return l(g),!1}let{from:d,to:h}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},f=!0,A=!0;if((A8e(o)?o:[o]).forEach(g=>{g.check(),f=f?g.isText&&g.marks.length===0:!1,A=A?g.isBlock:!1}),d===h&&A){const{parent:g}=r.doc.resolve(d);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(d-=1,h+=1)}let m;if(f){if(Array.isArray(t))m=t.map(g=>g.text||"").join("");else if(t instanceof De){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&&h8e(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},p8e=()=>({state:e,dispatch:t})=>RQe(e,t),m8e=()=>({state:e,dispatch:t})=>UQe(e,t),g8e=()=>({state:e,dispatch:t})=>PQe(e,t),y8e=()=>({state:e,dispatch:t})=>MQe(e,t),v8e=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Lj(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},x8e=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Lj(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},w8e=()=>({state:e,dispatch:t})=>IQe(e,t),b8e=()=>({state:e,dispatch:t})=>OQe(e,t);function Due(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function C8e(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 l=t[o];if(/^(cmd|meta|m)$/i.test(l))a=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))E_()||Due()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}var S8e=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const s=C8e(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}),l=t.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,o))});return l==null||l.steps.forEach(u=>{const d=u.map(r.mapping);d&&i&&r.maybeStep(d)}),!0};function NA(e,t,n={}){const{from:r,to:i,empty:s}=e.selection,a=t?ki(t,e.schema):null,o=[];e.doc.nodesBetween(r,i,(h,f)=>{if(h.isText)return;const A=Math.max(r,f),p=Math.min(i,f+h.nodeSize);o.push({node:h,from:A,to:p})});const l=i-r,u=o.filter(h=>a?a.name===h.node.type.name:!0).filter(h=>__(h.node.attrs,n,{strict:!1}));return s?!!u.length:u.reduce((h,f)=>h+f.to-f.from,0)>=l}var k8e=(e,t={})=>({state:n,dispatch:r})=>{const i=ki(e,n.schema);return NA(n,i,t)?DQe(n,r):!1},B8e=()=>({state:e,dispatch:t})=>zQe(e,t),_8e=e=>({state:t,dispatch:n})=>{const r=ki(e,t.schema);return ZQe(r)(t,n)},E8e=()=>({state:e,dispatch:t})=>QQe(e,t);function Vj(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function VK(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 N8e=(e,t)=>({tr:n,state:r,dispatch:i})=>{let s=null,a=null;const o=Vj(typeof e=="string"?e:e.name,r.schema);if(!o)return!1;o==="node"&&(s=ki(e,r.schema)),o==="mark"&&(a=_d(e,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(d,h)=>{s&&s===d.type&&(l=!0,i&&n.setNodeMarkup(h,void 0,VK(d.attrs,t))),a&&d.marks.length&&d.marks.forEach(f=>{a===f.type&&(l=!0,i&&n.addMark(h,h+d.nodeSize,a.create(VK(f.attrs,t))))})})}),l},j8e=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),T8e=()=>({tr:e,dispatch:t})=>{if(t){const n=new dl(e.doc);e.setSelection(n)}return!0},P8e=()=>({state:e,dispatch:t})=>FQe(e,t),I8e=()=>({state:e,dispatch:t})=>LQe(e,t),O8e=()=>({state:e,dispatch:t})=>VQe(e,t),F8e=()=>({state:e,dispatch:t})=>WQe(e,t),M8e=()=>({state:e,dispatch:t})=>qQe(e,t);function rM(e,t,n={},r={}){return Wb(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var L8e=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:a,commands:o})=>{const{doc:l}=s;if(r.preserveWhitespace!=="full"){const u=rM(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return a&&s.replaceWith(0,l.content.size,u).setMeta("preventUpdate",!n),!0}return a&&s.setMeta("preventUpdate",!n),o.insertContentAt({from:0,to:l.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function Que(e,t){const n=_d(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,l=>{a.push(...l.marks)});const o=a.find(l=>l.type.name===n.name);return o?{...o.attrs}:{}}function Hue(e,t){const n=new zce(e);return t.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function R8e(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 U8e(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,(i,s)=>{n(i)&&r.push({node:i,pos:s})}),r}function D8e(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 Kj(e){return t=>D8e(t.$from,e)}function jt(e,t,n){return e.config[t]===void 0&&e.parent?jt(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?jt(e.parent,t,n):null}):e.config[t]}function iQ(e){return e.map(t=>{const n={name:t.name,options:t.options,storage:t.storage},r=jt(t,"addExtensions",n);return r?[t,...iQ(r())]:t}).flat(10)}function sQ(e,t){const n=cm.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function $ue(e){return typeof e=="function"}function On(e,t=void 0,...n){return $ue(e)?t?e.bind(t)(...n):e(...n):e}function Q8e(e={}){return Object.keys(e).length===0&&e.constructor===Object}function l0(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 zue(e){const t=[],{nodeExtensions:n,markExtensions:r}=l0(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),l=[...a,...o];return e.forEach(u=>{const d={name:u.name,options:u.options,storage:u.storage,extensions:i},h=jt(u,"addGlobalAttributes",d);if(!h)return;h().forEach(A=>{let p;Array.isArray(A.types)?p=A.types:A.types==="*"?p=l:A.types==="nodes"?p=a:A.types==="marks"?p=o:p=[],p.forEach(m=>{Object.entries(A.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=jt(u,"addAttributes",d);if(!h)return;const f=h();Object.entries(f).forEach(([A,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:A,attribute:m})})}),t}function Xr(...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(" "):[],l=r[i]?r[i].split(" "):[],u=o.filter(d=>!l.includes(d));r[i]=[...l,...u].join(" ")}else if(i==="style"){const o=s?s.split(";").map(d=>d.trim()).filter(Boolean):[],l=r[i]?r[i].split(";").map(d=>d.trim()).filter(Boolean):[],u=new Map;l.forEach(d=>{const[h,f]=d.split(":").map(A=>A.trim());u.set(h,f)}),o.forEach(d=>{const[h,f]=d.split(":").map(A=>A.trim());u.set(h,f)}),r[i]=Array.from(u.entries()).map(([d,h])=>`${d}: ${h}`).join("; ")}else r[i]=s}),r},{})}function Gb(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)=>Xr(n,r),{})}function H8e(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function KK(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):H8e(n.getAttribute(a.name));return o==null?s:{...s,[a.name]:o}},{});return{...r,...i}}}}function qK(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&Q8e(n)?!1:n!=null))}function WK(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 $8e(e,t){var n;const r=zue(e),{nodeExtensions:i,markExtensions:s}=l0(e),a=(n=i.find(u=>jt(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},f=e.reduce((y,v)=>{const x=jt(v,"extendNodeSchema",h);return{...y,...x?x(u):{}}},{}),A=qK({...f,content:On(jt(u,"content",h)),marks:On(jt(u,"marks",h)),group:On(jt(u,"group",h)),inline:On(jt(u,"inline",h)),atom:On(jt(u,"atom",h)),selectable:On(jt(u,"selectable",h)),draggable:On(jt(u,"draggable",h)),code:On(jt(u,"code",h)),whitespace:On(jt(u,"whitespace",h)),linebreakReplacement:On(jt(u,"linebreakReplacement",h)),defining:On(jt(u,"defining",h)),isolating:On(jt(u,"isolating",h)),attrs:Object.fromEntries(d.map(WK))}),p=On(jt(u,"parseHTML",h));p&&(A.parseDOM=p.map(y=>KK(y,d)));const m=jt(u,"renderHTML",h);m&&(A.toDOM=y=>m({node:y,HTMLAttributes:Gb(y,d)}));const g=jt(u,"renderText",h);return g&&(A.toText=g),[u.name,A]})),l=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},f=e.reduce((g,y)=>{const v=jt(y,"extendMarkSchema",h);return{...g,...v?v(u):{}}},{}),A=qK({...f,inclusive:On(jt(u,"inclusive",h)),excludes:On(jt(u,"excludes",h)),group:On(jt(u,"group",h)),spanning:On(jt(u,"spanning",h)),code:On(jt(u,"code",h)),attrs:Object.fromEntries(d.map(WK))}),p=On(jt(u,"parseHTML",h));p&&(A.parseDOM=p.map(g=>KK(g,d)));const m=jt(u,"renderHTML",h);return m&&(A.toDOM=g=>m({mark:g,HTMLAttributes:Gb(g,d)})),[u.name,A]}));return new Ece({topNode:a,nodes:o,marks:l})}function z8e(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}function Pw(e){return e.sort((n,r)=>{const i=jt(n,"priority")||100,s=jt(r,"priority")||100;return i>s?-1:i<s?1:0})}function Vue(e){const t=Pw(iQ(e)),n=z8e(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 Kue(e,t,n){const{from:r,to:i}=t,{blockSeparator:s=`

`,textSerializers:a={}}=n||{};let o="";return e.nodesBetween(r,i,(l,u,d,h)=>{var f;l.isBlock&&u>r&&(o+=s);const A=a==null?void 0:a[l.type.name];if(A)return d&&(o+=A({node:l,pos:u,parent:d,index:h,range:t})),!1;l.isText&&(o+=(f=l==null?void 0:l.text)==null?void 0:f.slice(Math.max(r,u)-u,i-u))}),o}function V8e(e,t){const n={from:0,to:e.content.size};return Kue(e,n,t)}function que(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}function K8e(e,t){const n=ki(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 Wue(e,t){const n=Vj(typeof t=="string"?t:t.name,e.schema);return n==="node"?K8e(e,t):n==="mark"?Que(e,t):{}}function q8e(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 W8e(e){const t=q8e(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 Gue(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((i,s)=>{const a=[];if(i.ranges.length)i.forEach((o,l)=>{a.push({from:o,to:l})});else{const{from:o,to:l}=n[s];if(o===void 0||l===void 0)return;a.push({from:o,to:l})}a.forEach(({from:o,to:l})=>{const u=t.slice(s).map(o,-1),d=t.slice(s).map(l),h=t.invert().map(u,-1),f=t.invert().map(d);r.push({oldRange:{from:h,to:f},newRange:{from:u,to:d}})})}),W8e(r)}function aQ(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const s=n.resolve(e),a=rQ(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 G8e=(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 Ax(e,t){return t.nodes[e]||t.marks[e]||null}function Zk(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 Y8e=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,s,a,o)=>{var l,u;const d=((u=(l=i.type.spec).toText)==null?void 0:u.call(l,{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 iM(e,t,n={}){const{empty:r,ranges:i}=e.selection,s=t?_d(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(h=>s?s.name===h.type.name:!0).find(h=>__(h.attrs,n,{strict:!1}));let a=0;const o=[];if(i.forEach(({$from:h,$to:f})=>{const A=h.pos,p=f.pos;e.doc.nodesBetween(A,p,(m,g)=>{if(s&&m.inlineContent&&!m.type.allowsMarkType(s))return!1;if(!m.isText&&!m.marks.length)return;const y=Math.max(A,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 l=o.filter(h=>s?s.name===h.mark.type.name:!0).filter(h=>__(h.mark.attrs,n,{strict:!1})).reduce((h,f)=>h+f.to-f.from,0),u=o.filter(h=>s?h.mark.type!==s&&h.mark.type.excludes(s):!0).reduce((h,f)=>h+f.to-f.from,0);return(l>0?l+u:l)>=a}function X8e(e,t,n={}){if(!t)return NA(e,null,n)||iM(e,null,n);const r=Vj(t,e.schema);return r==="node"?NA(e,t,n):r==="mark"?iM(e,t,n):!1}var J8e=(e,t)=>{const{$from:n,$to:r,$anchor:i}=e.selection;if(t){const s=Kj(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)},Z8e=e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function GK(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function YK(e,t){const{nodeExtensions:n}=l0(t),r=n.find(a=>a.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=On(jt(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function qj(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&&(qj(s,{ignoreWhitespace:n,checkChildren:t})||(i=!1))}),i}return!1}function Yue(e){return e instanceof Ft}var Xue=class Jue{constructor(t){this.position=t}static fromJSON(t){return new Jue(t.position)}toJSON(){return{position:this.position}}};function e7e(e,t){const n=t.mapping.mapResult(e.position);return{position:new Xue(n.pos),mapResult:n}}function t7e(e){return new Xue(e)}function n7e(e,t,n){var r;const{selection:i}=t;let s=null;if(Lue(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:l})=>{let u=o.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(o.pos,l.pos,(d,h,f)=>{if(u)return!1;if(d.isInline){const A=!f||f.type.allowsMarkType(n),p=!!n.isInSet(d.marks)||!d.marks.some(m=>m.type.excludes(n));u=A&&p}return!u}),u})}var r7e=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:a,ranges:o}=s,l=_d(e,r.schema);if(i)if(a){const u=Que(r,l);n.addStoredMark(l.create({...u,...t}))}else o.forEach(u=>{const d=u.$from.pos,h=u.$to.pos;r.doc.nodesBetween(d,h,(f,A)=>{const p=Math.max(A,d),m=Math.min(A+f.nodeSize,h);f.marks.find(y=>y.type===l)?f.marks.forEach(y=>{l===y.type&&n.addMark(p,m,l.create({...y.attrs,...t}))}):n.addMark(p,m,l.create(t))})});return n7e(r,n,l)},i7e=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),s7e=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const s=ki(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)},a7e=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=Gf(e,0,r.content.size),s=Ft.create(r,i);t.setSelection(s)}return!0},o7e=(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,(l,u)=>{l.isText||n.setNodeMarkup(u,void 0,{...l.attrs,dir:e})}),!0},l7e=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:s}=typeof e=="number"?{from:e,to:e}:e,a=Yt.atStart(r).from,o=Yt.atEnd(r).to,l=Gf(i,a,o),u=Gf(s,a,o),d=Yt.create(r,l,u);t.setSelection(d)}return!0},c7e=e=>({state:t,dispatch:n})=>{const r=ki(e,t.schema);return nHe(r)(t,n)};function XK(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 u7e=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:a}=t,{$from:o,$to:l}=s,u=i.extensionManager.attributes,d=Zk(u,o.node().type.name,o.node().attrs);if(s instanceof Ft&&s.node.isBlock)return!o.parentOffset||!gy(a,o.pos)?!1:(r&&(e&&XK(n,i.extensionManager.splittableMarks),t.split(o.pos).scrollIntoView()),!0);if(!o.parent.isBlock)return!1;const h=l.parentOffset===l.parent.content.size,f=o.depth===0?void 0:R8e(o.node(-1).contentMatchAt(o.indexAfter(-1)));let A=h&&f?[{type:f,attrs:d}]:void 0,p=gy(t.doc,t.mapping.map(o.pos),1,A);if(!A&&!p&&gy(t.doc,t.mapping.map(o.pos),1,f?[{type:f}]:void 0)&&(p=!0,A=f?[{type:f,attrs:d}]:void 0),r){if(p&&(s instanceof Yt&&t.deleteSelection(),t.split(t.mapping.map(o.pos),1,A),f&&!h&&!o.parentOffset&&o.parent.type!==f)){const m=t.mapping.map(o.before()),g=t.doc.resolve(m);o.node(-1).canReplaceWith(g.index(),g.index()+1,f)&&t.setNodeMarkup(t.mapping.map(o.before()),f)}e&&XK(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return p},d7e=(e,t={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var a;const o=ki(e,r.schema),{$from:l,$to:u}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(u))return!1;const h=l.node(-1);if(h.type!==o)return!1;const f=s.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==o||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let y=De.empty;const v=l.index(-1)?1:l.index(-2)?2:3;for(let E=l.depth-v;E>=l.depth-3;E-=1)y=De.from(l.node(E).copy(y));const x=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,b={...Zk(f,l.node().type.name,l.node().attrs),...t},w=((a=o.contentMatch.defaultType)==null?void 0:a.createAndFill(b))||void 0;y=y.append(De.from(o.createAndFill(null,w)||void 0));const S=l.before(l.depth-(v-1));n.replace(S,l.after(-x),new rt(y,4-v,0));let _=-1;n.doc.nodesBetween(S,n.doc.content.size,(E,j)=>{if(_>-1)return!1;E.isTextblock&&E.content.size===0&&(_=j+1)}),_>-1&&n.setSelection(Yt.near(n.doc.resolve(_))),n.scrollIntoView()}return!0}const A=u.pos===l.end()?h.contentMatchAt(0).defaultType:null,p={...Zk(f,h.type.name,h.attrs),...t},m={...Zk(f,l.node().type.name,l.node().attrs),...t};n.delete(l.pos,u.pos);const g=A?[{type:o,attrs:p},{type:A,attrs:m}]:[{type:o,attrs:p}];if(!gy(n.doc,l.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(l.pos,2,g).scrollIntoView(),!b||!i)return!0;const w=b.filter(S=>x.includes(S.type.name));n.ensureMarks(w)}return!0},MI=(e,t)=>{const n=Kj(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)&&HA(e.doc,n.pos)&&e.join(n.pos),!0},LI=(e,t)=>{const n=Kj(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)&&HA(e.doc,r)&&e.join(r),!0},h7e=(e,t,n,r={})=>({editor:i,tr:s,state:a,dispatch:o,chain:l,commands:u,can:d})=>{const{extensions:h,splittableMarks:f}=i.extensionManager,A=ki(e,a.schema),p=ki(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=Kj(S=>YK(S.type.name,h))(m);if(x.depth>=1&&w&&x.depth-w.depth<=1){if(w.node.type===A)return u.liftListItem(p);if(YK(w.node.type.name,h)&&A.validContent(w.node.content)&&o)return l().command(()=>(s.setNodeMarkup(w.pos,A),!0)).command(()=>MI(s,A)).command(()=>LI(s,A)).run()}return!n||!b||!o?l().command(()=>d().wrapInList(A,r)?!0:u.clearNodes()).wrapInList(A,r).command(()=>MI(s,A)).command(()=>LI(s,A)).run():l().command(()=>{const S=d().wrapInList(A,r),_=b.filter(E=>f.includes(E.type.name));return s.ensureMarks(_),S?!0:u.clearNodes()}).wrapInList(A,r).command(()=>MI(s,A)).command(()=>LI(s,A)).run()},A7e=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,a=_d(e,r.schema);return iM(r,a,t)?i.unsetMark(a,{extendEmptyMarkRange:s}):i.setMark(a,t)},f7e=(e,t,n={})=>({state:r,commands:i})=>{const s=ki(e,r.schema),a=ki(t,r.schema),o=NA(r,s,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),o?i.setNode(a,l):i.setNode(s,{...l,...n})},p7e=(e,t={})=>({state:n,commands:r})=>{const i=ki(e,n.schema);return NA(n,i,t)?r.lift(i):r.wrapIn(i,t)},m7e=()=>({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 l=o.steps.length-1;l>=0;l-=1)a.step(o.steps[l].invert(o.docs[l]));if(s.text){const l=a.doc.resolve(s.from).marks();a.replaceWith(s.from,s.to,e.schema.text(s.text,l))}else a.delete(s.from,s.to)}return!0}}return!1},g7e=()=>({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},y7e=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,l=_d(e,r.schema),{$from:u,empty:d,ranges:h}=o;if(!i)return!0;if(d&&a){let{from:f,to:A}=o;const p=(s=u.marks().find(g=>g.type===l))==null?void 0:s.attrs,m=rQ(u,l,p);m&&(f=m.from,A=m.to),n.removeMark(f,A,l)}else h.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,l)});return n.removeStoredMark(l),!0},v7e=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,l)=>{if(o.isText)return;const u={...o.attrs};delete u.dir,t.setNodeMarkup(l,void 0,u)}),!0},x7e=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let s=null,a=null;const o=Vj(typeof e=="string"?e:e.name,r.schema);if(!o)return!1;o==="node"&&(s=ki(e,r.schema)),o==="mark"&&(a=_d(e,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{const d=u.$from.pos,h=u.$to.pos;let f,A,p,m;n.selection.empty?r.doc.nodesBetween(d,h,(g,y)=>{s&&s===g.type&&(l=!0,p=Math.max(y,d),m=Math.min(y+g.nodeSize,h),f=y,A=g)}):r.doc.nodesBetween(d,h,(g,y)=>{y<d&&s&&s===g.type&&(l=!0,p=Math.max(y,d),m=Math.min(y+g.nodeSize,h),f=y,A=g),y>=d&&y<=h&&(s&&s===g.type&&(l=!0,i&&n.setNodeMarkup(y,void 0,{...g.attrs,...t})),a&&g.marks.length&&g.marks.forEach(v=>{if(a===v.type&&(l=!0,i)){const x=Math.max(y,d),b=Math.min(y+g.nodeSize,h);n.addMark(x,b,a.create({...v.attrs,...t}))}}))}),A&&(f!==void 0&&i&&n.setNodeMarkup(f,void 0,{...A.attrs,...t}),a&&A.marks.length&&A.marks.forEach(g=>{a===g.type&&i&&n.addMark(p,m,a.create({...g.attrs,...t}))}))}),l},w7e=(e,t={})=>({state:n,dispatch:r})=>{const i=ki(e,n.schema);return GQe(i,t)(n,r)},b7e=(e,t={})=>({state:n,dispatch:r})=>{const i=ki(e,n.schema);return YQe(i,t)(n,r)},C7e=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={}}},Wj=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=(t=e.undoable)!=null?t:!0}},S7e=(e,t)=>{if(nQ(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 vS(e){var t;const{editor:n,from:r,to:i,text:s,rules:a,plugin:o}=e,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(r);if(u.parent.type.spec.code||(t=u.nodeBefore||u.nodeAfter)!=null&&t.marks.find(f=>f.type.spec.code))return!1;let d=!1;const h=Y8e(u)+s;return a.forEach(f=>{if(d)return;const A=S7e(h,f.find);if(!A)return;const p=l.state.tr,m=$j({state:l.state,transaction:p}),g={from:r-(A[0].length-s.length),to:i},{commands:y,chain:v,can:x}=new zj({editor:n,state:m});f.handler({state:m,range:g,match:A,commands:y,chain:v,can:x})===null||!p.steps.length||(f.undoable&&p.setMeta(o,{transform:p,from:r,to:i,text:s}),l.dispatch(p),d=!0)}),d}function k7e(e){const{editor:t,rules:n}=e,r=new Ur({state:{init(){return null},apply(i,s,a){const o=i.getMeta(r);if(o)return o;const l=i.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:d}=l;typeof d=="string"?d=d:d=sQ(De.from(d),a.schema);const{from:h}=l,f=h+d.length;vS({editor:t,from:h,to:f,text:d,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,a,o){return vS({editor:t,from:s,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&vS({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?vS({editor:t,from:a.pos,to:a.pos,text:`
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function B7e(e){return Object.prototype.toString.call(e).slice(8,-1)}function xS(e){return B7e(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Zue(e,t){const n={...e};return xS(e)&&xS(t)&&Object.keys(t).forEach(r=>{xS(t[r])&&xS(e[r])?n[r]=Zue(e[r],t[r]):n[r]=t[r]}),n}var oQ=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{...On(jt(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...On(jt(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Zue(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}},um=class ede extends oQ{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n=typeof t=="function"?t():t;return new ede(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 l=a.find(u=>(u==null?void 0:u.type.name)===n.name);return l&&r.removeStoredMark(l),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 _7e(e){return typeof e=="number"}var tde=class{constructor(e){this.find=e.find,this.handler=e.handler}},E7e=(e,t,n)=>{if(nQ(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 N7e(e){const{editor:t,state:n,from:r,to:i,rule:s,pasteEvent:a,dropEvent:o}=e,{commands:l,chain:u,can:d}=new zj({editor:t,state:n}),h=[];return n.doc.nodesBetween(r,i,(A,p)=>{var m,g,y,v,x;if((g=(m=A.type)==null?void 0:m.spec)!=null&&g.code||!(A.isText||A.isTextblock||A.isInline))return;const b=(x=(v=(y=A.content)==null?void 0:y.size)!=null?v:A.nodeSize)!=null?x:0,w=Math.max(r,p),S=Math.min(i,p+b);if(w>=S)return;const _=A.isText?A.text||"":A.textBetween(w-p,S-p,void 0,"");E7e(_,s.find,a).forEach(j=>{if(j.index===void 0)return;const I=w+j.index+1,T=I+j[0].length,N={from:n.tr.mapping.map(I),to:n.tr.mapping.map(T)},F=s.handler({state:n,range:N,match:j,commands:l,chain:u,can:d,pasteEvent:a,dropEvent:o});h.push(F)})}),h.every(A=>A!==null)}var wS=null,j7e=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData("text/html",e),n};function T7e(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 l=({state:d,from:h,to:f,rule:A,pasteEvt:p})=>{const m=d.tr,g=$j({state:d,transaction:m});if(!(!N7e({editor:t,state:g,from:Math.max(h-1,0),to:f.b-1,rule:A,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 Ur({view(h){const f=p=>{var m;r=(m=h.dom.parentElement)!=null&&m.contains(p.target)?h.dom.parentElement:null,r&&(wS=t)},A=()=>{wS&&(wS=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",A),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",A)}}},props:{handleDOMEvents:{drop:(h,f)=>{if(s=r===h.dom.parentElement,o=f,!s){const A=wS;A!=null&&A.isEditable&&setTimeout(()=>{const p=A.state.selection;p&&A.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(h,f)=>{var A;const p=(A=f.clipboardData)==null?void 0:A.getData("text/html");return a=f,i=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(h,f,A)=>{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=sQ(De.from(w),A.schema);const{from:S}=y,_=S+w.length,E=j7e(w);return l({rule:d,state:A,from:S,to:{b:_},pasteEvt:E})}const x=f.doc.content.findDiffStart(A.doc.content),b=f.doc.content.findDiffEnd(A.doc.content);if(!(!_7e(x)||!b||x===b.b))return l({rule:d,state:A,from:x,to:b,pasteEvt:a})}}))}var Gj=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=Vue(e),this.schema=$8e(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:Ax(t.name,this.schema)},r=jt(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){const{editor:e}=this;return Pw([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:Ax(r.name,this.schema)},s=[],a=jt(r,"addKeyboardShortcuts",i);let o={};if(r.type==="mark"&&jt(r,"exitable",i)&&(o.ArrowRight=()=>um.handleExit({editor:e,mark:r})),a){const f=Object.fromEntries(Object.entries(a()).map(([A,p])=>[A,()=>p({editor:e})]));o={...o,...f}}const l=K$e(o);s.push(l);const u=jt(r,"addInputRules",i);if(GK(r,e.options.enableInputRules)&&u){const f=u();if(f&&f.length){const A=k7e({editor:e,rules:f}),p=Array.isArray(A)?A:[A];s.push(...p)}}const d=jt(r,"addPasteRules",i);if(GK(r,e.options.enablePasteRules)&&d){const f=d();if(f&&f.length){const A=T7e({editor:e,rules:f});s.push(...A)}}const h=jt(r,"addProseMirrorPlugins",i);if(h){const f=h();s.push(...f)}return s})}get attributes(){return zue(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=l0(this.extensions);return Object.fromEntries(t.filter(n=>!!jt(n,"addNodeView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:ki(n.name,this.schema)},s=jt(n,"addNodeView",i);if(!s)return[];const a=s();if(!a)return[];const o=(l,u,d,h,f)=>{const A=Gb(l,r);return a({node:l,view:u,getPos:d,decorations:h,innerDecorations:f,editor:e,extension:n,HTMLAttributes:A})};return[n.name,o]}))}dispatchTransaction(e){const{editor:t}=this;return Pw([...this.extensions].reverse()).reduceRight((r,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:Ax(i.name,this.schema)},a=jt(i,"dispatchTransaction",s);return a?o=>{a.call(s,{transaction:o,next:r})}:r},e)}transformPastedHTML(e){const{editor:t}=this;return Pw([...this.extensions]).reduce((r,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:Ax(i.name,this.schema)},a=jt(i,"transformPastedHTML",s);return a?(o,l)=>{const u=r(o,l);return a.call(s,u)}:r},e||(r=>r))}get markViews(){const{editor:e}=this,{markExtensions:t}=l0(this.extensions);return Object.fromEntries(t.filter(n=>!!jt(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:_d(n.name,this.schema)},s=jt(n,"addMarkView",i);if(!s)return[];const a=(o,l,u)=>{const d=Gb(o,r);return s()({mark:o,view:l,inline:u,editor:e,extension:n,HTMLAttributes:d,updateAttributes:h=>{V7e(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:Ax(t.name,this.schema)};t.type==="mark"&&((n=On(jt(t,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(t.name);const i=jt(t,"onBeforeCreate",r),s=jt(t,"onCreate",r),a=jt(t,"onUpdate",r),o=jt(t,"onSelectionUpdate",r),l=jt(t,"onTransaction",r),u=jt(t,"onFocus",r),d=jt(t,"onBlur",r),h=jt(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),l&&this.editor.on("transaction",l),u&&this.editor.on("focus",u),d&&this.editor.on("blur",d),h&&this.editor.on("destroy",h)})}};Gj.resolve=Vue;Gj.sort=Pw;Gj.flatten=iQ;var P7e={};tQ(P7e,{ClipboardTextSerializer:()=>rde,Commands:()=>ide,Delete:()=>sde,Drop:()=>ade,Editable:()=>ode,FocusEvents:()=>cde,Keymap:()=>ude,Paste:()=>dde,Tabindex:()=>hde,TextDirection:()=>Ade,focusEventsPluginKey:()=>lde});var Ai=class nde extends oQ{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n=typeof t=="function"?t():t;return new nde(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}},rde=Ai.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ur({key:new Di("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)),l=que(n);return Kue(r,{from:a,to:o},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),ide=Ai.create({name:"commands",addCommands(){return{...Fue}}}),sde=Ai.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;const s=()=>{var a,o,l,u;if((u=(l=(o=(a=this.editor.options.coreExtensionOptions)==null?void 0:a.delete)==null?void 0:o.filterTransaction)==null?void 0:l.call(o,e))!=null?u:e.getMeta("y-sync$"))return;const d=Hue(e.before,[e,...t]);Gue(d).forEach(A=>{d.mapping.mapResult(A.oldRange.from).deletedAfter&&d.mapping.mapResult(A.oldRange.to).deletedBefore&&d.before.nodesBetween(A.oldRange.from,A.oldRange.to,(p,m)=>{const g=m+p.nodeSize-2,y=A.oldRange.from<=m&&g<=A.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:A.oldRange,newRange:A.newRange,partial:!y,editor:this.editor,transaction:e,combinedTransform:d})})});const f=d.mapping;d.steps.forEach((A,p)=>{var m,g;if(A instanceof nc){const y=f.slice(p).map(A.from,-1),v=f.slice(p).map(A.to),x=f.invert().map(y,-1),b=f.invert().map(v),w=(m=d.doc.nodeAt(y-1))==null?void 0:m.marks.some(_=>_.eq(A.mark)),S=(g=d.doc.nodeAt(v))==null?void 0:g.marks.some(_=>_.eq(A.mark));this.editor.emit("delete",{type:"mark",mark:A.mark,from:A.from,to:A.to,deletedRange:{from:x,to:b},newRange:{from:y,to:v},partial:!!(S||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()}}),ade=Ai.create({name:"drop",addProseMirrorPlugins(){return[new Ur({key:new Di("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),ode=Ai.create({name:"editable",addProseMirrorPlugins(){return[new Ur({key:new Di("editable"),props:{editable:()=>this.editor.options.editable}})]}}),lde=new Di("focusEvents"),cde=Ai.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Ur({key:lde,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}}}})]}}),ude=Ai.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:o})=>{const{selection:l,doc:u}=o,{empty:d,$anchor:h}=l,{pos:f,parent:A}=h,p=h.parent.isTextblock&&f>0?o.doc.resolve(f-1):h,m=p.parent.type.spec.isolating,g=h.pos-h.parentOffset,y=m&&p.parent.childCount===1?g===h.pos:cn.atStart(u).from===f;return!d||!A.type.isTextblock||A.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 E_()||Due()?s:i},addProseMirrorPlugins(){return[new Ur({key:new Di("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,l=cn.atStart(t.doc).from,u=cn.atEnd(t.doc).to;if(s||!(a===l&&o===u)||!qj(n.doc))return;const f=n.tr,A=$j({state:n,transaction:f}),{commands:p}=new zj({editor:this.editor,state:A});if(p.clearNodes(),!!f.steps.length)return f}})]}}),dde=Ai.create({name:"paste",addProseMirrorPlugins(){return[new Ur({key:new Di("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),hde=Ai.create({name:"tabindex",addProseMirrorPlugins(){return[new Ur({key:new Di("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Ade=Ai.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=l0(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 Ur({key:new Di("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}}),I7e=class Gx{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 Gx(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 Gx(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 Gx(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 l=this.resolvedPos.doc.resolve(o);if(!i&&!a&&l.depth<=this.depth)return;const u=new Gx(l,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 l=a[o];if(s[l]!==n[l])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(l=>n[l]===a.node.attrs[l])&&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)}},O7e=`.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 F7e(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 M7e=class extends C7e{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:e7e,createMappablePosition:t7e},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=Rue(t,this.options.autofocus);this.editorState=Wg.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=F7e(O7e,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=$ue(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?[ode,rde.configure({blockSeparator:(t=(e=this.options.coreExtensionOptions)==null?void 0:e.clipboardTextSerializer)==null?void 0:t.blockSeparator}),ide,cde,ude,hde,ade,dde,sde,Ade.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 Gj(r,this)}createCommandManager(){this.commandManager=new zj({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=rM(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=rM(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 Iue(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 l=this.view.dom;l.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(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"),l=a==null?void 0:a.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:a}),l&&this.emit("blur",{editor:this,event:l.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 Wue(this.state,e)}isActive(e,t){const n=typeof e=="string"?e:null,r=typeof e=="string"?t:e;return X8e(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return sQ(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`

`,textSerializers:n={}}=e||{};return V8e(this.state.doc,{blockSeparator:t,textSerializers:{...que(this.schema),...n}})}get isEmpty(){return qj(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 I7e(t,this)}get $doc(){return this.$pos(0)}};function c0(e){return new Wj({find:e.find,handler:({state:t,range:n,match:r})=>{const i=On(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 l=o.search(/\S/),u=n.from+o.indexOf(a),d=u+a.length;if(aQ(n.from,n.to,t.doc).filter(A=>A.mark.type.excluded.find(m=>m===e.type&&m!==A.mark.type)).filter(A=>A.to>u).length)return null;d<n.to&&s.delete(d,n.to),u>n.from&&s.delete(n.from+l,u);const f=n.from+l+a.length;s.addMark(n.from+l,f,e.type.create(i||{})),s.removeStoredMark(e.type)}},undoable:e.undoable})}function fde(e){return new Wj({find:e.find,handler:({state:t,range:n,match:r})=>{const i=On(e.getAttributes,void 0,r)||{},{tr:s}=t,a=n.from;let o=n.to;const l=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,l)}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 sM(e){return new Wj({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),s=On(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 u0(e){return new Wj({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const s=On(e.getAttributes,void 0,r)||{},a=t.tr.delete(n.from,n.to),l=a.doc.resolve(n.from).blockRange(),u=l&&H6(l,e.type,s);if(!u)return null;if(a.wrap(l,u),e.keepMarks&&e.editor){const{selection:h,storedMarks:f}=t,{splittableMarks:A}=e.editor.extensionManager,p=f||h.$to.parentOffset&&h.$from.marks();if(p){const m=p.filter(g=>A.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&&HA(a.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,d))&&a.join(n.from-1)},undoable:e.undoable})}var L7e=e=>"touches"in e,R7e=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 l=o.clientX-this.startX,u=o.clientY-this.startY;this.handleResize(l,u)},this.handleTouchMove=o=>{if(!this.isResizing||!this.activeHandle)return;const l=o.touches[0];if(!l)return;const u=l.clientX-this.startX,d=l.clientY-this.startY;this.handleResize(u,d)},this.handleMouseUp=()=>{if(!this.isResizing)return;const o=this.element.offsetWidth,l=this.element.offsetHeight;this.onCommit(o,l),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,L7e(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"),l=e.includes("top");return s?r=this.startWidth+t:a&&(r=this.startWidth-t),o?i=this.startHeight+n:l&&(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,l=t;return o<this.minSize.width&&(o=this.minSize.width,l=o/this.aspectRatio),l<this.minSize.height&&(l=this.minSize.height,o=l*this.aspectRatio),(s=this.maxSize)!=null&&s.width&&o>this.maxSize.width&&(o=this.maxSize.width,l=o/this.aspectRatio),(a=this.maxSize)!=null&&a.height&&l>this.maxSize.height&&(l=this.maxSize.height,o=l*this.aspectRatio),{width:o,height:l}}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 U7e(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof Ft){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 D7e={};tQ(D7e,{createAtomBlockMarkdownSpec:()=>pde,createBlockMarkdownSpec:()=>Q7e,createInlineMarkdownSpec:()=>z7e,parseAttributes:()=>lQ,parseIndentedBlocks:()=>aM,renderNestedMarkdownContent:()=>uQ,serializeAttributes:()=>cQ});function lQ(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 f=parseInt(((h=d.match(/__QUOTED_(\d+)__/))==null?void 0:h[1])||"0",10),A=n[f];A&&(t[u]=A.slice(1,-1))});const l=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return l&&l.split(/\s+/).filter(Boolean).forEach(d=>{d.match(/^[a-zA-Z][\w-]*$/)&&(t[d]=!0)}),t}function cQ(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=lQ,serializeAttributes:i=cQ,defaultAttributes:s={},requiredAttributes:a=[],allowedAttributes:o}=e,l=n||t,u=d=>{if(!o)return d;const h={};return o.forEach(f=>{f in d&&(h[f]=d[f])}),h};return{parseMarkdown:(d,h)=>{const f={...s,...d.attributes};return h.createNode(t,f,[])},markdownTokenizer:{name:t,level:"block",start(d){var h;const f=new RegExp(`^:::${l}(?:\\s|$)`,"m"),A=(h=d.match(f))==null?void 0:h.index;return A!==void 0?A:-1},tokenize(d,h,f){const A=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),p=d.match(A);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||{}),f=i(h),A=f?` {${f}}`:"";return`:::${l}${A} :::`}}}function Q7e(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=lQ,serializeAttributes:s=cQ,defaultAttributes:a={},content:o="block",allowedAttributes:l}=e,u=n||t,d=h=>{if(!l)return h;const f={};return l.forEach(A=>{A in h&&(f[A]=h[A])}),f};return{parseMarkdown:(h,f)=>{let A;if(r){const m=r(h);A=typeof m=="string"?[{type:"text",text:m}]:m}else o==="block"?A=f.parseChildren(h.tokens||[]):A=f.parseInline(h.tokens||[]);const p={...a,...h.attributes};return f.createNode(t,p,A)},markdownTokenizer:{name:t,level:"block",start(h){var f;const A=new RegExp(`^:::${u}`,"m"),p=(f=h.match(A))==null?void 0:f.index;return p!==void 0?p:-1},tokenize(h,f,A){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 S="";const _=/^:::([\w-]*)(\s.*)?/gm,E=h.slice(w);for(_.lastIndex=0;;){const j=_.exec(E);if(j===null)break;const I=j.index,T=j[1];if(!((p=j[2])!=null&&p.endsWith(":::"))){if(T)b+=1;else if(b-=1,b===0){const N=E.slice(0,I);S=N.trim();const F=h.slice(0,w+I+j[0].length);let L=[];if(S)if(o==="block")for(L=A.blockTokens(N),L.forEach(D=>{D.text&&(!D.tokens||D.tokens.length===0)&&(D.tokens=A.inlineTokens(D.text))});L.length>0;){const D=L[L.length-1];if(D.type==="paragraph"&&(!D.text||D.text.trim()===""))L.pop();else break}else L=A.inlineTokens(S);return{type:t,raw:F,attributes:x,content:S,tokens:L}}}}}},renderMarkdown:(h,f)=>{const A=d(h.attrs||{}),p=s(A),m=p?` {${p}}`:"",g=f.renderChildren(h.content||[],`

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

${g}

:::`}}}function H7e(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 $7e(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,n])=>`${t}="${n}"`).join(" ")}function z7e(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=H7e,serializeAttributes:s=$7e,defaultAttributes:a={},selfClosing:o=!1,allowedAttributes:l}=e,u=n||t,d=f=>{if(!l)return f;const A={};return l.forEach(p=>{const m=typeof p=="string"?p:p.name,g=typeof p=="string"?void 0:p.skipIfDefault;if(m in f){const y=f[m];if(g!==void 0&&y===g)return;A[m]=y}}),A},h=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(f,A)=>{const p={...a,...f.attributes};if(o)return A.createNode(t,p);const m=r?r(f):f.content||"";return m?A.createNode(t,p,[A.createTextNode(m)]):A.createNode(t,p,[])},markdownTokenizer:{name:t,level:"inline",start(f){const A=o?new RegExp(`\\[${h}\\s*[^\\]]*\\]`):new RegExp(`\\[${h}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${h}\\]`),p=f.match(A),m=p==null?void 0:p.index;return m!==void 0?m:-1},tokenize(f,A,p){const m=o?new RegExp(`^\\[${h}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${h}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${h}\\]`),g=f.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:f=>{let A="";r?A=r(f):f.content&&f.content.length>0&&(A=f.content.filter(y=>y.type==="text").map(y=>y.text).join(""));const p=d(f.attrs||{}),m=s(p),g=m?` ${m}`:"";return o?`[${u}${g}]`:`[${u}${g}]${A}[/${u}]`}}}function aM(e,t,n){var r,i,s,a;const o=e.split(`
`),l=[];let u="",d=0;const h=t.baseIndentSize||2;for(;d<o.length;){const f=o[d],A=f.match(t.itemPattern);if(!A){if(l.length>0)break;if(f.trim()===""){d+=1,u=`${u}${f}
`;continue}else return}const p=t.extractItemData(A),{indentLevel:m,mainContent:g}=p;u=`${u}${f}
`;const y=[g];for(d+=1;d<o.length;){const w=o[d];if(w.trim()===""){const _=o.slice(d+1).findIndex(I=>I.trim()!=="");if(_===-1)break;if((((i=(r=o[d+1+_].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(S=>S.slice(m+h)).join(`
`);w.trim()&&(t.customNestedParser?v=t.customNestedParser(w):v=n.blockTokens(w))}const b=t.createToken(p,v);l.push(b)}if(l.length!==0)return{items:l,raw:u}}function uQ(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]),l=[`${i}${o}`];return a&&a.length>0&&a.forEach(u=>{const d=t.renderChildren([u]);if(d){const h=d.split(`
`).map(f=>f?t.indent(f):"").join(`
`);l.push(h)}}),l.join(`
`)}function V7e(e,t,n={}){const{state:r}=t,{doc:i,tr:s}=r,a=e;i.descendants((o,l)=>{const u=s.mapping.map(l),d=s.mapping.map(l)+o.nodeSize;let h=null;if(o.marks.forEach(A=>{if(A!==a)return!1;h=A}),!h)return;let f=!1;if(Object.keys(n).forEach(A=>{n[A]!==h.attrs[A]&&(f=!0)}),f){const A=e.type.create({...e.attrs,...n});s.removeMark(u,d,e.type),s.addMark(u,d,A)}}),s.docChanged&&t.view.dispatch(s)}var Ca=class mde extends oQ{constructor(){super(...arguments),this.type="node"}static create(t={}){const n=typeof t=="function"?t():t;return new mde(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};function Wp(e){return new tde({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{const s=On(e.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:a}=t,o=r[r.length-1],l=r[0];let u=n.to;if(o){const d=l.search(/\S/),h=n.from+l.indexOf(o),f=h+o.length;if(aQ(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;f<n.to&&a.delete(f,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 K7e(e){return new tde({find:e.find,handler({match:t,chain:n,range:r,pasteEvent:i}){const s=On(e.getAttributes,void 0,t,i),a=On(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:q7e,getOwnPropertySymbols:W7e}=Object,{hasOwnProperty:G7e}=Object.prototype;function RI(e,t){return function(r,i,s){return e(r,i,s)&&t(r,i,s)}}function bS(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 l=e(n,r,i);return s.delete(n),s.delete(r),l}}function Y7e(e){return e!=null?e[Symbol.toStringTag]:void 0}function JK(e){return q7e(e).concat(W7e(e))}const X7e=Object.hasOwn||((e,t)=>G7e.call(e,t));function dm(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const J7e="__v",Z7e="__o",eze="_owner",{getOwnPropertyDescriptor:ZK,keys:eq}=Object;function tze(e,t){return e.byteLength===t.byteLength&&N_(new Uint8Array(e),new Uint8Array(t))}function nze(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 rze(e,t){return e.byteLength===t.byteLength&&N_(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function ize(e,t){return dm(e.getTime(),t.getTime())}function sze(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function aze(e,t){return e===t}function tq(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,l=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 f=a.value,A=o.value;if(n.equals(f[0],A[0],l,h,e,t,n)&&n.equals(f[1],A[1],f[0],A[0],e,t,n)){d=i[h]=!0;break}h++}if(!d)return!1;l++}return!0}const oze=dm;function lze(e,t,n){const r=eq(e);let i=r.length;if(eq(t).length!==i)return!1;for(;i-- >0;)if(!gde(e,t,n,r[i]))return!1;return!0}function fx(e,t,n){const r=JK(e);let i=r.length;if(JK(t).length!==i)return!1;let s,a,o;for(;i-- >0;)if(s=r[i],!gde(e,t,n,s)||(a=ZK(e,s),o=ZK(t,s),(a||o)&&(!a||!o||a.configurable!==o.configurable||a.enumerable!==o.enumerable||a.writable!==o.writable)))return!1;return!0}function cze(e,t){return dm(e.valueOf(),t.valueOf())}function uze(e,t){return e.source===t.source&&e.flags===t.flags}function nq(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 l=t.values();let u=!1,d=0;for(;(o=l.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 N_(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 dze(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 gde(e,t,n,r){return(r===eze||r===Z7e||r===J7e)&&(e.$$typeof||t.$$typeof)?!0:X7e(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const hze="[object ArrayBuffer]",Aze="[object Arguments]",fze="[object Boolean]",pze="[object DataView]",mze="[object Date]",gze="[object Error]",yze="[object Map]",vze="[object Number]",xze="[object Object]",wze="[object RegExp]",bze="[object Set]",Cze="[object String]",Sze={"[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},kze="[object URL]",Bze=Object.prototype.toString;function _ze({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:s,areMapsEqual:a,areNumbersEqual:o,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:d,areSetsEqual:h,areTypedArraysEqual:f,areUrlsEqual:A,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 l(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=Bze.call(g);if(w===mze)return r(g,y,v);if(w===wze)return d(g,y,v);if(w===yze)return a(g,y,v);if(w===bze)return h(g,y,v);if(w===xze)return typeof g.then!="function"&&typeof y.then!="function"&&l(g,y,v);if(w===kze)return A(g,y,v);if(w===gze)return i(g,y,v);if(w===Aze)return l(g,y,v);if(Sze[w])return f(g,y,v);if(w===hze)return e(g,y,v);if(w===pze)return n(g,y,v);if(w===fze||w===vze||w===Cze)return u(g,y,v);if(p){let S=p[w];if(!S){const _=Y7e(g);_&&(S=p[_])}if(S)return S(g,y,v)}return!1}}function Eze({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:tze,areArraysEqual:n?fx:nze,areDataViewsEqual:rze,areDatesEqual:ize,areErrorsEqual:sze,areFunctionsEqual:aze,areMapsEqual:n?RI(tq,fx):tq,areNumbersEqual:oze,areObjectsEqual:n?fx:lze,arePrimitiveWrappersEqual:cze,areRegExpsEqual:uze,areSetsEqual:n?RI(nq,fx):nq,areTypedArraysEqual:n?RI(N_,fx):N_,areUrlsEqual:dze,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=bS(r.areArraysEqual),s=bS(r.areMapsEqual),a=bS(r.areObjectsEqual),o=bS(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:s,areObjectsEqual:a,areSetsEqual:o})}return r}function Nze(e){return function(t,n,r,i,s,a,o){return e(t,n,o)}}function jze({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(o,l){const{cache:u=e?new WeakMap:void 0,meta:d}=n();return t(o,l,{cache:u,equals:r,meta:d,strict:i})};if(e)return function(o,l){return t(o,l,{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,l){return t(o,l,s)}}const yde=zA();zA({strict:!0});zA({circular:!0});zA({circular:!0,strict:!0});zA({createInternalComparator:()=>dm});zA({strict:!0,createInternalComparator:()=>dm});zA({circular:!0,createInternalComparator:()=>dm});zA({circular:!0,createInternalComparator:()=>dm,strict:!0});function zA(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,s=Eze(e),a=_ze(s),o=n?n(a):Nze(a);return jze({circular:t,comparator:a,createState:r,equals:o,strict:i})}var vde={exports:{}},xde={};/**
 * @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 Yj=k,Tze=U6;function Pze(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ize=typeof Object.is=="function"?Object.is:Pze,Oze=Tze.useSyncExternalStore,Fze=Yj.useRef,Mze=Yj.useEffect,Lze=Yj.useMemo,Rze=Yj.useDebugValue;xde.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=Fze(null);if(s.current===null){var a={hasValue:!1,value:null};s.current=a}else a=s.current;s=Lze(function(){function l(A){if(!u){if(u=!0,d=A,A=r(A),i!==void 0&&a.hasValue){var p=a.value;if(i(p,A))return h=p}return h=A}if(p=h,Ize(d,A))return p;var m=r(A);return i!==void 0&&i(p,m)?(d=A,p):(d=A,h=m)}var u=!1,d,h,f=n===void 0?null:n;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,n,r,i]);var o=Oze(e,s[0],s[1]);return Mze(function(){a.hasValue=!0,a.value=o},[o]),Rze(o),o};vde.exports=xde;var Uze=vde.exports,Dze=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},Qze=({contentComponent:e})=>{const t=U6.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return c.jsx(c.Fragment,{children:Object.values(t)})};function Hze(){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]:PU.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 $ze=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=Hze(),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 c.jsxs(c.Fragment,{children:[c.jsx("div",{ref:Dze(t,this.editorContentRef),...n}),(e==null?void 0:e.contentComponent)&&c.jsx(Qze,{contentComponent:e.contentComponent})]})}},zze=k.forwardRef((e,t)=>{const n=re.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return re.createElement($ze,{key:n,innerRef:t,...e})}),wde=re.memo(zze),Vze=typeof window<"u"?k.useLayoutEffect:k.useEffect,Kze=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 qze(e){var t;const[n]=k.useState(()=>new Kze(e.editor)),r=Uze.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!=null?t:yde);return Vze(()=>n.watch(e.editor),[e.editor,n]),k.useDebugValue(r),r}var Wze=!1,oM=typeof window>"u",Gze=oM||!!(typeof window<"u"&&window.next),Yze=class bde{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 oM||Gze?null:this.createEditor();if(this.options.current.immediatelyRender&&oM&&Wze)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 M7e(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?bde.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 Xze(e={},t=[]){const n=k.useRef(e);n.current=e;const[r]=k.useState(()=>new Yze(n)),i=U6.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return k.useDebugValue(i),k.useEffect(r.onRender(t)),qze({editor:i,selector:({transactionNumber:s})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&s===0?0:s+1}),i}var Cde=k.createContext({editor:null});Cde.Consumer;var Jze=k.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Zze=()=>k.useContext(Jze);re.forwardRef((e,t)=>{const{onDragStart:n}=Zze(),r=e.as||"div";return c.jsx(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});re.createContext({markViewContentRef:()=>{}});var dQ=k.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});dQ.displayName="TiptapContext";var e9e=()=>k.useContext(dQ);function Sde({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=k.useMemo(()=>({editor:r}),[r]),s=k.useMemo(()=>({editor:r}),[r]);return c.jsx(Cde.Provider,{value:s,children:c.jsx(dQ.Provider,{value:i,children:n})})}Sde.displayName="Tiptap";function kde({...e}){const{editor:t}=e9e();return c.jsx(wde,{editor:t,...e})}kde.displayName="Tiptap.Content";Object.assign(Sde,{Content:kde});var j_=(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]},t9e=/^\s*>\s$/,n9e=Ca.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return j_("blockquote",{...Xr(this.options.HTMLAttributes,e),children:j_("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(l=>l.trim()===""?n:`${n} ${l}`);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[u0({find:t9e,type:this.type})]}}),r9e=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,i9e=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,s9e=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,a9e=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,o9e=um.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 j_("strong",{...Xr(this.options.HTMLAttributes,e),children:j_("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[c0({find:r9e,type:this.type}),c0({find:s9e,type:this.type})]},addPasteRules(){return[Wp({find:i9e,type:this.type}),Wp({find:a9e,type:this.type})]}}),l9e=/(^|[^`])`([^`]+)`(?!`)$/,c9e=/(^|[^`])`([^`]+)`(?!`)/g,u9e=um.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",Xr(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[c0({find:l9e,type:this.type})]},addPasteRules(){return[Wp({find:c9e,type:this.type})]}}),UI=4,d9e=/^```([a-z]+)?[\s\n]$/,h9e=/^~~~([a-z]+)?[\s\n]$/,A9e=Ca.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:UI,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",Xr(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:UI,{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:l})=>{const{from:u,to:d}=i,A=r.doc.textBetween(u,d,`
`,`
`).split(`
`).map(p=>o+p).join(`
`);return l.replaceWith(u,d,r.schema.text(A)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!=null?t:UI,{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 l;const{pos:u}=s,d=s.start(),h=s.end(),A=r.doc.textBetween(d,h,`
`,`
`).split(`
`);let p=0,m=0;const g=u-d;for(let S=0;S<A.length;S+=1){if(m+A[S].length>=g){p=S;break}m+=A[S].length+1}const v=((l=A[p].match(/^ */))==null?void 0:l[0])||"",x=Math.min(v.length,n);if(x===0)return!0;let b=d;for(let S=0;S<p;S+=1)b+=A[S].length+1;return o.delete(b,b+x),u-b<=x&&o.setSelection(Yt.create(o.doc,b)),!0}):e.commands.command(({tr:o})=>{const{from:l,to:u}=i,f=r.doc.textBetween(l,u,`
`,`
`).split(`
`).map(A=>{var p;const m=((p=A.match(/^ */))==null?void 0:p[0])||"",g=Math.min(m.length,n);return A.slice(g)}).join(`
`);return o.replaceWith(l,u,r.schema.text(f)),!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(cn.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[sM({find:d9e,type:this.type,getAttributes:e=>({language:e[1]})}),sM({find:h9e,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Ur({key:new Di("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,l=o.text(n.replace(/\r\n?/g,`
`));return a.replaceSelectionWith(this.type.create({language:s},l)),a.selection.$from.parent.type!==this.type&&a.setSelection(Yt.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),e.dispatch(a),!0}}})]}}),f9e=Ca.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`

`):""}),p9e=Ca.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",Xr(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,l=s||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:u,dispatch:d})=>{if(d&&l&&a){const h=l.filter(f=>o.includes(f.type.name));u.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),m9e=Ca.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]}`,Xr(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=>sM({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),g9e=Ca.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",Xr(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!U7e(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$to:r}=n,i=e();return Yue(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:l}=a.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?a.setSelection(Yt.create(a.doc,l.pos+1)):l.nodeAfter.isBlock?a.setSelection(Ft.create(a.doc,l.pos)):a.setSelection(Yt.create(a.doc,l.pos));else{const d=s.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,h=d==null?void 0:d.create();h&&(a.insert(u,h),a.setSelection(Yt.create(a.doc,u+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[fde({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),y9e=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,v9e=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,x9e=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,w9e=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,b9e=um.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",Xr(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[c0({find:y9e,type:this.type}),c0({find:x9e,type:this.type})]},addPasteRules(){return[Wp({find:v9e,type:this.type}),Wp({find:w9e,type:this.type})]}});const C9e="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",S9e="ελ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",lM="numeric",cM="ascii",uM="alpha",Iw="asciinumeric",Yx="alphanumeric",dM="domain",Bde="emoji",k9e="scheme",B9e="slashscheme",DI="whitespace";function _9e(e,t){return e in t||(t[e]=[]),t[e]}function Yf(e,t,n){t[lM]&&(t[Iw]=!0,t[Yx]=!0),t[cM]&&(t[Iw]=!0,t[uM]=!0),t[Iw]&&(t[Yx]=!0),t[uM]&&(t[Yx]=!0),t[Yx]&&(t[dM]=!0),t[Bde]&&(t[dM]=!0);for(const r in t){const i=_9e(r,n);i.indexOf(e)<0&&i.push(e)}}function E9e(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function Oa(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Oa.groups={};Oa.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||Oa.groups;let i;return t&&t.j?i=t:(i=new Oa(t),n&&r&&Yf(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||Oa.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 Oa,Object.assign(a.j,o.j),a.jr.push.apply(a.jr,o.jr),a.jd=o.jd,a.t=o.t):a=new Oa,s){if(r)if(a.t&&typeof a.t=="string"){const l=Object.assign(E9e(a.t,r),n);Yf(s,l,r)}else n&&Yf(s,n,r);a.t=s}return i.j[e]=a,a}};const ln=(e,t,n,r,i)=>e.ta(t,n,r,i),zr=(e,t,n,r,i)=>e.tr(t,n,r,i),rq=(e,t,n,r,i)=>e.ts(t,n,r,i),Ve=(e,t,n,r,i)=>e.tt(t,n,r,i),Du="WORD",hM="UWORD",_de="ASCIINUMERICAL",Ede="ALPHANUMERICAL",Yb="LOCALHOST",AM="TLD",fM="UTLD",eB="SCHEME",Bg="SLASH_SCHEME",hQ="NUM",pM="WS",AQ="NL",Ow="OPENBRACE",Fw="CLOSEBRACE",T_="OPENBRACKET",P_="CLOSEBRACKET",I_="OPENPAREN",O_="CLOSEPAREN",F_="OPENANGLEBRACKET",M_="CLOSEANGLEBRACKET",L_="FULLWIDTHLEFTPAREN",R_="FULLWIDTHRIGHTPAREN",U_="LEFTCORNERBRACKET",D_="RIGHTCORNERBRACKET",Q_="LEFTWHITECORNERBRACKET",H_="RIGHTWHITECORNERBRACKET",$_="FULLWIDTHLESSTHAN",z_="FULLWIDTHGREATERTHAN",V_="AMPERSAND",K_="APOSTROPHE",q_="ASTERISK",fh="AT",W_="BACKSLASH",G_="BACKTICK",Y_="CARET",bh="COLON",fQ="COMMA",X_="DOLLAR",Lc="DOT",J_="EQUALS",pQ="EXCLAMATION",$o="HYPHEN",Mw="PERCENT",Z_="PIPE",eE="PLUS",tE="POUND",Lw="QUERY",mQ="QUOTE",Nde="FULLWIDTHMIDDLEDOT",gQ="SEMI",Rc="SLASH",Rw="TILDE",nE="UNDERSCORE",jde="EMOJI",rE="SYM";var Tde=Object.freeze({__proto__:null,ALPHANUMERICAL:Ede,AMPERSAND:V_,APOSTROPHE:K_,ASCIINUMERICAL:_de,ASTERISK:q_,AT:fh,BACKSLASH:W_,BACKTICK:G_,CARET:Y_,CLOSEANGLEBRACKET:M_,CLOSEBRACE:Fw,CLOSEBRACKET:P_,CLOSEPAREN:O_,COLON:bh,COMMA:fQ,DOLLAR:X_,DOT:Lc,EMOJI:jde,EQUALS:J_,EXCLAMATION:pQ,FULLWIDTHGREATERTHAN:z_,FULLWIDTHLEFTPAREN:L_,FULLWIDTHLESSTHAN:$_,FULLWIDTHMIDDLEDOT:Nde,FULLWIDTHRIGHTPAREN:R_,HYPHEN:$o,LEFTCORNERBRACKET:U_,LEFTWHITECORNERBRACKET:Q_,LOCALHOST:Yb,NL:AQ,NUM:hQ,OPENANGLEBRACKET:F_,OPENBRACE:Ow,OPENBRACKET:T_,OPENPAREN:I_,PERCENT:Mw,PIPE:Z_,PLUS:eE,POUND:tE,QUERY:Lw,QUOTE:mQ,RIGHTCORNERBRACKET:D_,RIGHTWHITECORNERBRACKET:H_,SCHEME:eB,SEMI:gQ,SLASH:Rc,SLASH_SCHEME:Bg,SYM:rE,TILDE:Rw,TLD:AM,UNDERSCORE:nE,UTLD:fM,UWORD:hM,WORD:Du,WS:pM});const Tu=/[a-z]/,px=new RegExp("\\p{L}","u"),QI=new RegExp("\\p{Emoji}","u"),Pu=/\d/,HI=/\s/,iq="\r",$I=`
`,N9e="️",j9e="‍",zI="";let CS=null,SS=null;function T9e(e=[]){const t={};Oa.groups=t;const n=new Oa;CS==null&&(CS=sq(C9e)),SS==null&&(SS=sq(S9e)),Ve(n,"'",K_),Ve(n,"{",Ow),Ve(n,"}",Fw),Ve(n,"[",T_),Ve(n,"]",P_),Ve(n,"(",I_),Ve(n,")",O_),Ve(n,"<",F_),Ve(n,">",M_),Ve(n,"(",L_),Ve(n,")",R_),Ve(n,"「",U_),Ve(n,"」",D_),Ve(n,"『",Q_),Ve(n,"』",H_),Ve(n,"<",$_),Ve(n,">",z_),Ve(n,"&",V_),Ve(n,"*",q_),Ve(n,"@",fh),Ve(n,"`",G_),Ve(n,"^",Y_),Ve(n,":",bh),Ve(n,",",fQ),Ve(n,"$",X_),Ve(n,".",Lc),Ve(n,"=",J_),Ve(n,"!",pQ),Ve(n,"-",$o),Ve(n,"%",Mw),Ve(n,"|",Z_),Ve(n,"+",eE),Ve(n,"#",tE),Ve(n,"?",Lw),Ve(n,'"',mQ),Ve(n,"/",Rc),Ve(n,";",gQ),Ve(n,"~",Rw),Ve(n,"_",nE),Ve(n,"\\",W_),Ve(n,"・",Nde);const r=zr(n,Pu,hQ,{[lM]:!0});zr(r,Pu,r);const i=zr(r,Tu,_de,{[Iw]:!0}),s=zr(r,px,Ede,{[Yx]:!0}),a=zr(n,Tu,Du,{[cM]:!0});zr(a,Pu,i),zr(a,Tu,a),zr(i,Pu,i),zr(i,Tu,i);const o=zr(n,px,hM,{[uM]:!0});zr(o,Tu),zr(o,Pu,s),zr(o,px,o),zr(s,Pu,s),zr(s,Tu),zr(s,px,s);const l=Ve(n,$I,AQ,{[DI]:!0}),u=Ve(n,iq,pM,{[DI]:!0}),d=zr(n,HI,pM,{[DI]:!0});Ve(n,zI,d),Ve(u,$I,l),Ve(u,zI,d),zr(u,HI,d),Ve(d,iq),Ve(d,$I),zr(d,HI,d),Ve(d,zI,d);const h=zr(n,QI,jde,{[Bde]:!0});Ve(h,"#"),zr(h,QI,h),Ve(h,N9e,h);const f=Ve(h,j9e);Ve(f,"#"),zr(f,QI,h);const A=[[Tu,a],[Pu,i]],p=[[Tu,null],[px,o],[Pu,s]];for(let m=0;m<CS.length;m++)Xd(n,CS[m],AM,Du,A);for(let m=0;m<SS.length;m++)Xd(n,SS[m],fM,hM,p);Yf(AM,{tld:!0,ascii:!0},t),Yf(fM,{utld:!0,alpha:!0},t),Xd(n,"file",eB,Du,A),Xd(n,"mailto",eB,Du,A),Xd(n,"http",Bg,Du,A),Xd(n,"https",Bg,Du,A),Xd(n,"ftp",Bg,Du,A),Xd(n,"ftps",Bg,Du,A),Yf(eB,{scheme:!0,ascii:!0},t),Yf(Bg,{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]?{[k9e]:!0}:{[B9e]:!0};g.indexOf("-")>=0?v[dM]=!0:Tu.test(g)?Pu.test(g)?v[Iw]=!0:v[cM]=!0:v[lM]=!0,rq(n,g,g,v)}return rq(n,"localhost",Yb,{ascii:!0}),n.jd=new Oa(rE),{start:n,tokens:Object.assign({groups:t},Tde)}}function Pde(e,t){const n=P9e(t.replace(/[A-Z]/g,o=>o.toLowerCase())),r=n.length,i=[];let s=0,a=0;for(;a<r;){let o=e,l=null,u=0,d=null,h=-1,f=-1;for(;a<r&&(l=o.go(n[a]));)o=l,o.accepts()?(h=0,f=0,d=o):h>=0&&(h+=n[a].length,f++),u+=n[a].length,s+=n[a].length,a++;s-=h,a-=f,u-=h,i.push({t:d.t,v:t.slice(s-u,s),s:s-u,e:s})}return i}function P9e(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 Xd(e,t,n,r,i){let s;const a=t.length;for(let o=0;o<a-1;o++){const l=t[o];e.j[l]?s=e.j[l]:(s=new Oa(r),s.jr=i.slice(),e.j[l]=s),e=s}return s=new Oa(n),s.jr=i.slice(),e.j[t[a-1]]=s,s}function sq(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 Xb={defaultProtocol:"http",events:null,format:aq,formatHref:aq,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function yQ(e,t=null){let n=Object.assign({},Xb);e&&(n=Object.assign(n,e instanceof yQ?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}yQ.prototype={o:Xb,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]:Xb[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 aq(e){return e}function Ide(e,t){this.t="token",this.v=e,this.tk=t}Ide.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=Xb.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),l=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),l&&(a.target=l),u&&(a.rel=u),d&&Object.assign(a,d),{tagName:i,attributes:a,content:s,eventListeners:h}}};function Xj(e,t){class n extends Ide{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 oq=Xj("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),lq=Xj("text"),I9e=Xj("nl"),kS=Xj("url",{isLink:!0,toHref(e=Xb.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==Yb&&e[1].t===bh}}),Lo=e=>new Oa(e);function O9e({groups:e}){const t=e.domain.concat([V_,q_,fh,W_,G_,Y_,X_,J_,$o,hQ,Mw,Z_,eE,tE,Rc,rE,Rw,nE]),n=[K_,bh,fQ,Lc,pQ,Mw,Lw,mQ,gQ,F_,M_,Ow,Fw,P_,T_,I_,O_,L_,R_,U_,D_,Q_,H_,$_,z_],r=[V_,K_,q_,W_,G_,Y_,X_,J_,$o,Ow,Fw,Mw,Z_,eE,tE,Lw,Rc,rE,Rw,nE],i=Lo(),s=Ve(i,Rw);ln(s,r,s),ln(s,e.domain,s);const a=Lo(),o=Lo(),l=Lo();ln(i,e.domain,a),ln(i,e.scheme,o),ln(i,e.slashscheme,l),ln(a,r,s),ln(a,e.domain,a);const u=Ve(a,fh);Ve(s,fh,u),Ve(o,fh,u),Ve(l,fh,u);const d=Ve(s,Lc);ln(d,r,s),ln(d,e.domain,s);const h=Lo();ln(u,e.domain,h),ln(h,e.domain,h);const f=Ve(h,Lc);ln(f,e.domain,h);const A=Lo(oq);ln(f,e.tld,A),ln(f,e.utld,A),Ve(u,Yb,A);const p=Ve(h,$o);Ve(p,$o,p),ln(p,e.domain,h),ln(A,e.domain,h),Ve(A,Lc,f),Ve(A,$o,p);const m=Ve(A,bh);ln(m,e.numeric,oq);const g=Ve(a,$o),y=Ve(a,Lc);Ve(g,$o,g),ln(g,e.domain,a),ln(y,r,s),ln(y,e.domain,a);const v=Lo(kS);ln(y,e.tld,v),ln(y,e.utld,v),ln(v,e.domain,a),ln(v,r,s),Ve(v,Lc,y),Ve(v,$o,g),Ve(v,fh,u);const x=Ve(v,bh),b=Lo(kS);ln(x,e.numeric,b);const w=Lo(kS),S=Lo();ln(w,t,w),ln(w,n,S),ln(S,t,w),ln(S,n,S),Ve(v,Rc,w),Ve(b,Rc,w);const _=Ve(o,bh),E=Ve(l,bh),j=Ve(E,Rc),I=Ve(j,Rc);ln(o,e.domain,a),Ve(o,Lc,y),Ve(o,$o,g),ln(l,e.domain,a),Ve(l,Lc,y),Ve(l,$o,g),ln(_,e.domain,w),Ve(_,Rc,w),Ve(_,Lw,w),ln(I,e.domain,w),ln(I,t,w),Ve(I,Rc,w);const T=[[Ow,Fw],[T_,P_],[I_,O_],[F_,M_],[L_,R_],[U_,D_],[Q_,H_],[$_,z_]];for(let N=0;N<T.length;N++){const[F,L]=T[N],D=Ve(w,F);Ve(S,F,D),Ve(D,L,w);const H=Lo(kS);ln(D,t,H);const W=Lo();ln(D,n),ln(H,t,H),ln(H,n,W),ln(W,t,H),ln(W,n,W),Ve(H,L,w),Ve(W,L,w)}return Ve(i,Yb,v),Ve(i,AQ,I9e),{start:i,tokens:Tde}}function F9e(e,t,n){let r=n.length,i=0,s=[],a=[];for(;i<r;){let o=e,l=null,u=null,d=0,h=null,f=-1;for(;i<r&&!(l=o.go(n[i].t));)a.push(n[i++]);for(;i<r&&(u=l||o.go(n[i].t));)l=null,o=u,o.accepts()?(f=0,h=o):f>=0&&f++,i++,d++;if(f<0)i-=d,i<r&&(a.push(n[i]),i++);else{a.length>0&&(s.push(VI(lq,t,a)),a=[]),i-=f,d-=f;const A=h.t,p=n.slice(i-d,i);s.push(VI(A,t,p))}}return a.length>0&&s.push(VI(lq,t,a)),s}function VI(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 M9e=typeof console<"u"&&console&&console.warn||(()=>{}),L9e="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",gr={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function R9e(){return Oa.groups={},gr.scanner=null,gr.parser=null,gr.tokenQueue=[],gr.pluginQueue=[],gr.customSchemes=[],gr.initialized=!1,gr}function cq(e,t=!1){if(gr.initialized&&M9e(`linkifyjs: already initialized - will not register custom scheme "${e}" ${L9e}`),!/^[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`);gr.customSchemes.push([e,t])}function U9e(){gr.scanner=T9e(gr.customSchemes);for(let e=0;e<gr.tokenQueue.length;e++)gr.tokenQueue[e][1]({scanner:gr.scanner});gr.parser=O9e(gr.scanner.tokens);for(let e=0;e<gr.pluginQueue.length;e++)gr.pluginQueue[e][1]({scanner:gr.scanner,parser:gr.parser});return gr.initialized=!0,gr}function vQ(e){return gr.initialized||U9e(),F9e(gr.parser.start,e,Pde(gr.scanner.start,e))}vQ.scan=Pde;function Ode(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 yQ(n),i=vQ(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 xQ="[\0-   ᠎ -\u2029  ]",D9e=new RegExp(xQ),Q9e=new RegExp(`${xQ}$`),H9e=new RegExp(xQ,"g");function $9e(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function z9e(e){return new Ur({key:new Di("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=Hue(n.doc,[...t]);if(Gue(o).forEach(({newRange:u})=>{const d=U8e(r.doc,u,A=>A.isTextblock);let h,f;if(d.length>1)h=d[0],f=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(d.length){const A=r.doc.textBetween(u.from,u.to," "," ");if(!Q9e.test(A))return;h=d[0],f=r.doc.textBetween(h.pos,u.to,void 0," ")}if(h&&f){const A=f.split(D9e).filter(Boolean);if(A.length<=0)return!1;const p=A[A.length-1],m=h.pos+f.lastIndexOf(p);if(!p)return!1;const g=vQ(p).map(y=>y.toObject(e.defaultProtocol));if(!$9e(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=>{aQ(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 V9e(e){return new Ur({key:new Di("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 l=r.target;if(!l)return!1;const u=e.editor.view.dom;a=l.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 l=Wue(t.state,e.type.name),u=(i=a.href)!=null?i:l.href,d=(s=a.target)!=null?s:l.target;u&&(window.open(u,d),o=!0)}return o}}})}function K9e(e){return new Ur({key:new Di("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:i}=e,{state:s}=t,{selection:a}=s,{empty:o}=a;if(o)return!1;let l="";r.content.forEach(d=>{l+=d.textContent});const u=Ode(l,{defaultProtocol:e.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!u||i!==void 0&&!i(u.value)?!1:e.editor.commands.setMark(e.type,{href:u.href})}}})}function bf(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(H9e,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var Fde=um.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(){R9e()},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)=>!!bf(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=>!!bf(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=>!!bf(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Xr(this.options.HTMLAttributes,e),0]:["a",Xr(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:"",l=t.renderChildren(e);return o?`[${l}](${a} "${o}")`:`[${l}](${a})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:r=>!!bf(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=>!!bf(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[Wp({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,i=Ode(e).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!bf(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(z9e({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!bf(i,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(V9e({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(K9e({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),q9e=Fde,W9e=Object.defineProperty,G9e=(e,t)=>{for(var n in t)W9e(e,n,{get:t[n],enumerable:!0})},Y9e="listItem",uq="textStyle",dq=/^\s*([-+*])\s$/,Mde=Ca.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",Xr(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(Y9e,this.editor.getAttributes(uq)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=u0({find:dq,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=u0({find:dq,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(uq),editor:this.editor})),[e]}}),Lde=Ca.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",Xr(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)=>uQ(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)}}}),X9e={};G9e(X9e,{findListItemPos:()=>B2,getNextListDepth:()=>wQ,handleBackspace:()=>mM,handleDelete:()=>gM,hasListBefore:()=>Rde,hasListItemAfter:()=>J9e,hasListItemBefore:()=>Ude,listItemHasSubList:()=>Dde,nextListIsDeeper:()=>Qde,nextListIsHigher:()=>Hde});var B2=(e,t)=>{const{$from:n}=t.selection,r=ki(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}},wQ=(e,t)=>{const n=B2(e,t);if(!n)return!1;const[,r]=G8e(t,e,n.$pos.pos+4);return r},Rde=(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))},Ude=(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)},Dde=(e,t,n)=>{if(!n)return!1;const r=ki(e,t.schema);let i=!1;return n.descendants(s=>{s.type===r&&(i=!0)}),i},mM=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!NA(e.state,t)&&Rde(e.state,t,n)){const{$anchor:o}=e.state.selection,l=e.state.doc.resolve(o.before()-1),u=[];l.node().descendants((f,A)=>{f.type.name===t&&u.push({node:f,pos:A})});const d=u.at(-1);if(!d)return!1;const h=e.state.doc.resolve(l.start()+d.pos+1);return e.chain().cut({from:o.start()-1,to:o.end()+1},h.end()).joinForward().run()}if(!NA(e.state,t)||!Z8e(e.state))return!1;const r=B2(t,e.state);if(!r)return!1;const s=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=Dde(t,e.state,s);return Ude(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},Qde=(e,t)=>{const n=wQ(e,t),r=B2(e,t);return!r||!n?!1:n>r.depth},Hde=(e,t)=>{const n=wQ(e,t),r=B2(e,t);return!r||!n?!1:n<r.depth},gM=(e,t)=>{if(!NA(e.state,t)||!J8e(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:Qde(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():Hde(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},J9e=(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)},$de=Ai.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&&gM(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&&gM(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&&mM(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&&mM(e,n,r)&&(t=!0)}),t}}}}),hq=/^(\s*)(\d+)\.\s+(.*)$/,Z9e=/^\s/;function eVe(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n],s=i.match(hq);if(!s)break;const[,a,o,l]=s,u=a.length;let d=l,h=n+1;const f=[i];for(;h<e.length;){const A=e[h];if(A.match(hq))break;if(A.trim()==="")f.push(A),d+=`
`,h+=1;else if(A.match(Z9e))f.push(A),d+=`
${A.slice(u+2)}`,h+=1;else break}t.push({indent:u,number:parseInt(o,10),content:d.trim(),raw:f.join(`
`)}),r=h,n=h}return[t,r]}function zde(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(`
`),l=((r=o[0])==null?void 0:r.trim())||"",u=[];l&&u.push({type:"paragraph",raw:l,tokens:n.inlineTokens(l)});const d=o.slice(1).join(`
`).trim();if(d){const A=n.blockTokens(d);u.push(...A)}let h=s+1;const f=[];for(;h<e.length&&e[h].indent>t;)f.push(e[h]),h+=1;if(f.length>0){const A=Math.min(...f.map(m=>m.indent)),p=zde(f,A,n);u.push({type:"list",ordered:!0,start:f[0].number,items:p,raw:f.map(m=>m.raw).join(`
`)})}i.push({type:"list_item",raw:a.raw,tokens:u}),s=h}else s+=1}return i}function tVe(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 nVe="listItem",Aq="textStyle",fq=/^(\d+)\.\s$/,Vde=Ca.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",Xr(this.options.HTMLAttributes,n),0]:["ol",Xr(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?tVe(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]=eVe(i);if(s.length===0)return;const o=zde(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(nVe,this.editor.getAttributes(Aq)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=u0({find:fq,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=u0({find:fq,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(Aq)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),rVe=/^\s*(\[([( |x])?\])\s$/,iVe=Ca.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",Xr(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 uQ(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"),l=document.createElement("div"),u=h=>{var f,A;o.ariaLabel=((A=(f=this.options.a11y)==null?void 0:f.checkboxLabel)==null?void 0:A.call(f,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:f}=h.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:A})=>{const p=n();if(typeof p!="number")return!1;const m=A.doc.nodeAt(p);return A.setNodeMarkup(p,void 0,{...m==null?void 0:m.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,f)||(o.checked=!o.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([h,f])=>{i.setAttribute(h,f)}),i.dataset.checked=e.attrs.checked,o.checked=e.attrs.checked,s.append(o,a),i.append(s,l),Object.entries(t).forEach(([h,f])=>{i.setAttribute(h,f)});let d=new Set(Object.keys(t));return{dom:i,contentDOM:l,update:h=>{if(h.type!==this.type)return!1;i.dataset.checked=h.attrs.checked,o.checked=h.attrs.checked,u(h);const f=r.extensionManager.attributes,A=Gb(h,f),p=new Set(Object.keys(A)),m=this.options.HTMLAttributes;return d.forEach(g=>{p.has(g)||(g in m?i.setAttribute(g,m[g]):i.removeAttribute(g))}),Object.entries(A).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[u0({find:rVe,type:this.type,getAttributes:e=>({checked:e[e.length-1]==="x"})})]}}),sVe=Ca.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",Xr(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=aM(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,l)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:n.inlineTokens(o.mainContent),nestedTokens:l}),customNestedParser:r},n);return a?[{type:"taskList",raw:a.raw,items:a.items}]:n.blockTokens(s)},i=aM(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()}}});Ai.create({name:"listKit",addExtensions(){const e=[];return this.options.bulletList!==!1&&e.push(Mde.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(Lde.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push($de.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(Vde.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(iVe.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(sVe.configure(this.options.taskList)),e}});var pq="&nbsp;",aVe=" ",oVe=Ca.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",Xr(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===pq||r[0].text===aVe)?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?pq:t.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),lVe=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,cVe=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,uVe=um.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",Xr(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[c0({find:lVe,type:this.type})]},addPasteRules(){return[Wp({find:cVe,type:this.type})]}}),dVe=Ca.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),hVe=um.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",Xr(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 AVe(e={}){return new Ur({view(t){return new fVe(t,e)}})}class fVe{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,f=t.nodeAfter;if(h||f){let A=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(A){let p=A.getBoundingClientRect(),m=h?p.bottom:p.top;h&&f&&(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),f=this.width/2*a;r={left:h.left-f,right:h.left+f,top:h.top,bottom:h.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let u,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")u=-pageXOffset,d=-pageYOffset;else{let h=l.getBoundingClientRect(),f=h.width/l.offsetWidth,A=h.height/l.offsetHeight;u=h.left-l.scrollLeft*f,d=h.top-l.scrollTop*A}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=Uce(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 Yr extends cn{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return Yr.valid(r)?new Yr(r):cn.near(r)}content(){return rt.empty}eq(t){return t instanceof Yr&&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 Yr(t.resolve(n.pos))}getBookmark(){return new bQ(this.anchor)}static valid(t){let n=t.parent;if(n.isTextblock||!pVe(t)||!mVe(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&&Yr.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 l=t.doc.resolve(i);if(Yr.valid(l))return l}for(;;){let a=n>0?s.firstChild:s.lastChild;if(!a){if(s.isAtom&&!s.isText&&!Ft.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(Yr.valid(o))return o}return null}}}Yr.prototype.visible=!1;Yr.findFrom=Yr.findGapCursorFrom;cn.jsonID("gapcursor",Yr);class bQ{constructor(t){this.pos=t}map(t){return new bQ(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return Yr.valid(n)?new Yr(n):cn.near(n)}}function Kde(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function pVe(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||Kde(i.type))return!0;if(i.inlineContent)return!1}}return!0}function mVe(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||Kde(i.type))return!0;if(i.inlineContent)return!1}}return!0}function gVe(){return new Ur({props:{decorations:wVe,createSelectionBetween(e,t,n){return t.pos==n.pos&&Yr.valid(n)?new Yr(n):null},handleClick:vVe,handleKeyDown:yVe,handleDOMEvents:{beforeinput:xVe}}})}const yVe=Oue({ArrowLeft:BS("horiz",-1),ArrowRight:BS("horiz",1),ArrowUp:BS("vert",-1),ArrowDown:BS("vert",1)});function BS(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,l=a.empty;if(a instanceof Yt){if(!s.endOfTextblock(n)||o.depth==0)return!1;l=!1,o=r.doc.resolve(t>0?o.after():o.before())}let u=Yr.findGapCursorFrom(o,t,l);return u?(i&&i(r.tr.setSelection(new Yr(u))),!0):!1}}function vVe(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Yr.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Ft.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Yr(r))),!0)}function xVe(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof Yr))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=De.empty;for(let a=r.length-1;a>=0;a--)i=De.from(r[a].createAndFill(null,i));let s=e.state.tr.replace(n.pos,n.pos,new rt(i,0,0));return s.setSelection(Yt.near(s.doc.resolve(n.pos+1))),e.dispatch(s),!1}function wVe(e){if(!(e.selection instanceof Yr))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Fr.create(e.doc,[da.widget(e.selection.head,t,{key:"gapcursor"})])}var iE=200,Ji=function(){};Ji.prototype.append=function(t){return t.length?(t=Ji.from(t),!this.length&&t||t.length<iE&&this.leafAppend(t)||this.length<iE&&t.leafPrepend(this)||this.appendInner(t)):this};Ji.prototype.prepend=function(t){return t.length?Ji.from(t).append(this):this};Ji.prototype.appendInner=function(t){return new bVe(this,t)};Ji.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?Ji.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Ji.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Ji.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)};Ji.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};Ji.from=function(t){return t instanceof Ji?t:t&&t.length?new qde(t):Ji.empty};var qde=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 l=s;l<a;l++)if(i(this.values[l],o+l)===!1)return!1},t.prototype.forEachInvertedInner=function(i,s,a,o){for(var l=s-1;l>=a;l--)if(i(this.values[l],o+l)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=iE)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=iE)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}(Ji);Ji.empty=new qde([]);var bVe=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}(Ji);const CVe=500;class Gl{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,l,u=[],d=[];return this.items.forEach((h,f)=>{if(!h.step){i||(i=this.remapping(r,f+1),s=i.maps.length),s--,d.push(h);return}if(i){d.push(new Jd(h.map));let A=h.step.map(i.slice(s)),p;A&&a.maybeStep(A).doc&&(p=a.mapping.maps[a.mapping.maps.length-1],u.push(new Jd(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,l=new Gl(this.items.slice(0,r).append(d.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:a,selection:o}}addTransform(t,n,r,i){let s=[],a=this.eventCount,o=this.items,l=!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]),f=new Jd(t.mapping.maps[d],h,n),A;(A=l&&l.merge(f))&&(f=A,d?s.pop():o=o.slice(0,o.length-1)),s.push(f),n&&(a++,n=void 0),i||(l=f)}let u=a-r.depth;return u>kVe&&(o=SVe(o,u),a-=u),new Gl(o.append(s),a)}remapping(t,n){let r=new $b;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 Gl(this.items.append(t.map(n=>new Jd(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(f=>{f.selection&&o--},i);let l=n;this.items.forEach(f=>{let A=s.getMirror(--l);if(A==null)return;a=Math.min(a,A);let p=s.maps[A];if(f.step){let m=t.steps[A].invert(t.docs[A]),g=f.selection&&f.selection.map(s.slice(l+1,A));g&&o++,r.push(new Jd(p,m,g))}else r.push(new Jd(p))},i);let u=[];for(let f=n;f<a;f++)u.push(new Jd(s.maps[f]));let d=this.items.slice(0,i).append(u).append(r),h=new Gl(d,o);return h.emptyItemCount()>CVe&&(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 l=a.step.map(n.slice(r)),u=l&&l.getMap();if(r--,u&&n.appendMap(u,r),l){let d=a.selection&&a.selection.map(n.slice(r));d&&s++;let h=new Jd(u.invert(),l,d),f,A=i.length-1;(f=i.length&&i[A].merge(h))?i[A]=f:i.push(h)}}else a.map&&r--},this.items.length,0),new Gl(Ji.from(i.reverse()),s)}}Gl.empty=new Gl(Ji.empty,0);function SVe(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}let Jd=class Wde{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 Wde(n.getMap().invert(),n,this.selection)}}};class ph{constructor(t,n,r,i,s){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const kVe=20;function BVe(e,t,n,r){let i=n.getMeta(Cp),s;if(i)return i.historyState;n.getMeta(NVe)&&(e=new ph(e.done,e.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(a&&a.getMeta(Cp))return a.getMeta(Cp).redo?new ph(e.done.addTransform(n,void 0,r,tB(t)),e.undone,mq(n.mapping.maps),e.prevTime,e.prevComposition):new ph(e.done,e.undone.addTransform(n,void 0,r,tB(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let o=n.getMeta("composition"),l=e.prevTime==0||!a&&e.prevComposition!=o&&(e.prevTime<(n.time||0)-r.newGroupDelay||!_Ve(n,e.prevRanges)),u=a?KI(e.prevRanges,n.mapping):mq(n.mapping.maps);return new ph(e.done.addTransform(n,l?t.selection.getBookmark():void 0,r,tB(t)),Gl.empty,u,n.time,o??e.prevComposition)}else return(s=n.getMeta("rebased"))?new ph(e.done.rebased(n,s),e.undone.rebased(n,s),KI(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new ph(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),KI(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function _Ve(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 mq(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 KI(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 EVe(e,t,n){let r=tB(t),i=Cp.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),l=new ph(n?o:s.remaining,n?s.remaining:o,null,0,-1);return s.transform.setSelection(a).setMeta(Cp,{redo:n,historyState:l})}let qI=!1,gq=null;function tB(e){let t=e.plugins;if(gq!=t){qI=!1,gq=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){qI=!0;break}}return qI}const Cp=new Di("history"),NVe=new Di("closeHistory");function jVe(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Ur({key:Cp,state:{init(){return new ph(Gl.empty,Gl.empty,null,0,-1)},apply(t,n,r){return BVe(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?Yde:r=="historyRedo"?Xde:null;return!i||!t.editable?!1:(n.preventDefault(),i(t.state,t.dispatch))}}}})}function Gde(e,t){return(n,r)=>{let i=Cp.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let s=EVe(i,n,e);s&&r(t?s.scrollIntoView():s)}return!0}}const Yde=Gde(!1,!0),Xde=Gde(!0,!0);Ai.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 Ur({key:new Di("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,l=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(o,l);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,l=s-r,u=o-l,d=o;return t.deleteRange(u,d),!(this.storage.characters({node:t.doc})>r)}})]}});var TVe=Ai.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[AVe(this.options)]}});Ai.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Ur({key:new Di("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,s=[];if(!n||!r)return Fr.create(e,[]);let a=0;this.options.mode==="deepest"&&e.descendants((l,u)=>{if(l.isText)return;if(!(i>=u&&i<=u+l.nodeSize-1))return!1;a+=1});let o=0;return e.descendants((l,u)=>{if(l.isText||!(i>=u&&i<=u+l.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(da.node(u,u+l.nodeSize,{class:this.options.className}))}),Fr.create(e,s)}}})]}});var PVe=Ai.create({name:"gapCursor",addProseMirrorPlugins(){return[gVe()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=On(jt(e,"allowGapCursor",n)))!=null?t:null}}}),yq="placeholder";function IVe(e){return e.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var OVe=Ai.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:yq,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const e=this.options.dataAttribute?`data-${IVe(this.options.dataAttribute)}`:`data-${yq}`;return[new Ur({key:new Di("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,l)=>{const u=i>=l&&i<=l+o.nodeSize,d=!o.isLeaf&&qj(o);if((u||!this.options.showOnlyCurrent)&&d){const h=[this.options.emptyNodeClass];a&&h.push(this.options.emptyEditorClass);const f=da.node(l,l+o.nodeSize,{class:h.join(" "),[e]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:l,hasAnchor:u}):this.options.placeholder});s.push(f)}return this.options.includeChildren}),Fr.create(t,s)}}})]}});Ai.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new Ur({key:new Di("selection"),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||Yue(n.selection)||e.view.dragging?null:Fr.create(n.doc,[da.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function vq({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(t==null?void 0:t.type)===e}var FVe=Ai.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var e;const t=new Di(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 Ur({key:t,appendTransaction:(i,s,a)=>{const{doc:o,tr:l,schema:u}=a,d=t.getState(a),h=o.content.size,f=u.nodes[n];if(d)return l.insert(h,f.create())},state:{init:(i,s)=>{const a=s.tr.doc.lastChild;return!vq({node:a,types:r})},apply:(i,s)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return s;const a=i.doc.lastChild;return!vq({node:a,types:r})}}})]}}),MVe=Ai.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>Yde(e,t),redo:()=>({state:e,dispatch:t})=>Xde(e,t)}},addProseMirrorPlugins(){return[jVe(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()}}}),LVe=Ai.create({name:"starterKit",addExtensions(){var e,t,n,r;const i=[];return this.options.bold!==!1&&i.push(o9e.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(n9e.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(Mde.configure(this.options.bulletList)),this.options.code!==!1&&i.push(u9e.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(A9e.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(f9e.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(TVe.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(PVe.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(p9e.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(m9e.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(MVe.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(g9e.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(b9e.configure(this.options.italic)),this.options.listItem!==!1&&i.push(Lde.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push($de.configure((e=this.options)==null?void 0:e.listKeymap)),this.options.link!==!1&&i.push(Fde.configure((t=this.options)==null?void 0:t.link)),this.options.orderedList!==!1&&i.push(Vde.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(oVe.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(uVe.configure(this.options.strike)),this.options.text!==!1&&i.push(dVe.configure(this.options.text)),this.options.underline!==!1&&i.push(hVe.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(FVe.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),RVe=LVe,UVe=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,DVe=Ca.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",Xr(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:"",l=(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?`![${l}](${o} "${u}")`:`![${l}](${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 l=document.createElement("img");Object.entries(a).forEach(([h,f])=>{if(f!=null)switch(h){case"width":case"height":break;default:l.setAttribute(h,f);break}}),l.src=a.src;const u=new R7e({element:l,editor:o,node:i,getPos:s,onResize:(h,f)=>{l.style.width=`${h}px`,l.style.height=`${f}px`},onCommit:(h,f)=>{const A=s();A!==void 0&&this.editor.chain().setNodeSelection(A).updateAttributes(this.name,{width:h,height:f}).run()},onUpdate:(h,f,A)=>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",l.onload=()=>{d.style.visibility="",d.style.pointerEvents=""},u}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[fde({find:UVe,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),QVe=DVe,HVe=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu\.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/,$Ve=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu\.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/g,Jde=e=>e.match(HVe),xq=(e,t)=>t?"https://www.youtube-nocookie.com/embed/videoseries?list=":e?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",zVe=e=>{const{url:t,allowFullscreen:n,autoplay:r,ccLanguage:i,ccLoadPolicy:s,controls:a,disableKBcontrols:o,enableIFrameApi:l,endTime:u,interfaceLanguage:d,ivLoadPolicy:h,loop:f,modestBranding:A,nocookie:p,origin:m,playlist:g,progressBarColor:y,startAt:v,rel:x}=e;if(!Jde(t))return null;if(t.includes("/embed/"))return t;if(t.includes("youtu.be")){const E=t.split("/").pop();return E?`${xq(p)}${E}`:null}const w=/(?:(v|list)=|shorts\/)([-\w]+)/gm.exec(t);if(!w||!w[2])return null;let S=`${xq(p,w[1]==="list")}${w[2]}`;const _=[];return n===!1&&_.push("fs=0"),r&&_.push("autoplay=1"),i&&_.push(`cc_lang_pref=${i}`),s&&_.push("cc_load_policy=1"),a||_.push("controls=0"),o&&_.push("disablekb=1"),l&&_.push("enablejsapi=1"),u&&_.push(`end=${u}`),d&&_.push(`hl=${d}`),h&&_.push(`iv_load_policy=${h}`),f&&_.push("loop=1"),A&&_.push("modestbranding=1"),m&&_.push(`origin=${m}`),g&&_.push(`playlist=${g}`),v&&_.push(`start=${v}`),y&&_.push(`color=${y}`),x!==void 0&&_.push(`rel=${x}`),_.length&&(S+=`${w[1]==="list"?"&":"?"}${_.join("&")}`),S},VVe=Ca.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})=>Jde(e.src)?t.insertContent({type:this.name,attrs:e}):!1}},addPasteRules(){return this.options.addPasteHandler?[K7e({find:$Ve,type:this.type,getAttributes:e=>({src:e.input})})]:[]},renderHTML({HTMLAttributes:e}){const t=zVe({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",Xr(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"]})}),KVe=VVe,qVe=OVe;async function Zde(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:l,height:u}=a;if(l>t||u>n){const f=Math.min(t/l,n/u);l=Math.round(l*f),u=Math.round(u*f)}const d=document.createElement("canvas");d.width=l,d.height=u;const h=d.getContext("2d");if(!h){s(new Error("Could not get canvas context"));return}h.drawImage(a,0,0,l,u),d.toBlob(f=>{if(!f){s(new Error("Could not compress image"));return}const A=new File([f],e.name.replace(/\.[^.]+$/,".webp"),{type:"image/webp"});i(A)},"image/webp",r)},a.onerror=()=>{URL.revokeObjectURL(o),s(new Error("Failed to load image"))},a.src=o})}async function WVe(e){const t=await Zde(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 GVe(e){const t=await Zde(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 Jj="Popover",[ehe,Ljt]=qs(Jj,[W0]),_2=W0(),[YVe,VA]=ehe(Jj),the=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:a=!1}=e,o=_2(t),l=k.useRef(null),[u,d]=k.useState(!1),[h,f]=Bo({prop:r,defaultProp:i??!1,onChange:s,caller:Jj});return c.jsx(XU,{...o,children:c.jsx(YVe,{scope:t,contentId:cl(),triggerRef:l,open:h,onOpenChange:f,onOpenToggle:k.useCallback(()=>f(A=>!A),[f]),hasCustomAnchor:u,onCustomAnchorAdd:k.useCallback(()=>d(!0),[]),onCustomAnchorRemove:k.useCallback(()=>d(!1),[]),modal:a,children:n})})};the.displayName=Jj;var nhe="PopoverAnchor",XVe=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=VA(nhe,n),s=_2(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:o}=i;return k.useEffect(()=>(a(),()=>o()),[a,o]),c.jsx(tj,{...s,...r,ref:t})});XVe.displayName=nhe;var rhe="PopoverTrigger",ihe=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=VA(rhe,n),s=_2(n),a=tn(t,i.triggerRef),o=c.jsx(_t.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":che(i.open),...r,ref:a,onClick:at(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?o:c.jsx(tj,{asChild:!0,...s,children:o})});ihe.displayName=rhe;var CQ="PopoverPortal",[JVe,ZVe]=ehe(CQ,{forceMount:void 0}),she=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,s=VA(CQ,t);return c.jsx(JVe,{scope:t,forceMount:n,children:c.jsx(ba,{present:n||s.open,children:c.jsx(a2,{asChild:!0,container:i,children:r})})})};she.displayName=CQ;var d0="PopoverContent",ahe=k.forwardRef((e,t)=>{const n=ZVe(d0,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,s=VA(d0,e.__scopePopover);return c.jsx(ba,{present:r||s.open,children:s.modal?c.jsx(tKe,{...i,ref:t}):c.jsx(nKe,{...i,ref:t})})});ahe.displayName=d0;var eKe=Fp("PopoverContent.RemoveScroll"),tKe=k.forwardRef((e,t)=>{const n=VA(d0,e.__scopePopover),r=k.useRef(null),i=tn(t,r),s=k.useRef(!1);return k.useEffect(()=>{const a=r.current;if(a)return B6(a)},[]),c.jsx(Ij,{as:eKe,allowPinchZoom:!0,children:c.jsx(ohe,{...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,l=o.button===0&&o.ctrlKey===!0,u=o.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:at(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),nKe=k.forwardRef((e,t)=>{const n=VA(d0,e.__scopePopover),r=k.useRef(!1),i=k.useRef(!1);return c.jsx(ohe,{...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 l,u;(l=e.onInteractOutside)==null||l.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()}})}),ohe=k.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...h}=e,f=VA(d0,n),A=_2(n);return k6(),c.jsx(Tj,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:c.jsx($0,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(JU,{"data-state":che(f.open),role:"dialog",id:f.contentId,...A,...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)"}})})})}),lhe="PopoverClose",rKe=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=VA(lhe,n);return c.jsx(_t.button,{type:"button",...r,ref:t,onClick:at(e.onClick,()=>i.onOpenChange(!1))})});rKe.displayName=lhe;var iKe="PopoverArrow",sKe=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=_2(n);return c.jsx(ZU,{...i,...r,ref:t})});sKe.displayName=iKe;function che(e){return e?"open":"closed"}var aKe=the,oKe=ihe,lKe=she,uhe=ahe;const yM=aKe,vM=oKe,sE=k.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>c.jsx(lKe,{children:c.jsx(uhe,{ref:i,align:t,sideOffset:n,className:pt("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})}));sE.displayName=uhe.displayName;const so=({onClick:e,isActive:t,children:n,title:r})=>c.jsx(Be,{type:"button",variant:t?"default":"ghost",size:"icon",className:"h-8 w-8",onClick:e,title:r,children:n}),cKe=({content:e,onChange:t})=>{const{toast:n}=RA(),r=k.useRef(null),[i,s]=k.useState(""),[a,o]=k.useState(""),l=Xze({extensions:[RVe,QVe.configure({inline:!1,allowBase64:!1}),KVe.configure({width:640,height:360}),q9e.configure({openOnClick:!1,autolink:!0}),qVe.configure({placeholder:"Start writing your post…"})],content:e,onUpdate:({editor:f})=>{t(f.getHTML())}}),u=k.useCallback(async f=>{var p;const A=(p=f.target.files)==null?void 0:p[0];if(!(!A||!l)){try{n({title:"Uploading image…"});const m=await WVe(A);l.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="")}},[l,n]),d=k.useCallback(()=>{!l||!i||(l.commands.setYoutubeVideo({src:i}),s(""))},[l,i]),h=k.useCallback(()=>{!l||!a||(l.chain().focus().setLink({href:a}).run(),o(""))},[l,a]);return l?c.jsxs("div",{className:"border border-input rounded-md overflow-hidden",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-0.5 p-2 border-b border-input bg-muted/50",children:[c.jsx(so,{onClick:()=>l.chain().focus().toggleBold().run(),isActive:l.isActive("bold"),title:"Bold",children:c.jsx(t1e,{className:"h-4 w-4"})}),c.jsx(so,{onClick:()=>l.chain().focus().toggleItalic().run(),isActive:l.isActive("italic"),title:"Italic",children:c.jsx(y1e,{className:"h-4 w-4"})}),c.jsx(so,{onClick:()=>l.chain().focus().toggleCode().run(),isActive:l.isActive("code"),title:"Code",children:c.jsx(a1e,{className:"h-4 w-4"})}),c.jsx("div",{className:"w-px h-6 bg-border mx-1"}),c.jsx(so,{onClick:()=>l.chain().focus().toggleHeading({level:1}).run(),isActive:l.isActive("heading",{level:1}),title:"Heading 1",children:c.jsx(A1e,{className:"h-4 w-4"})}),c.jsx(so,{onClick:()=>l.chain().focus().toggleHeading({level:2}).run(),isActive:l.isActive("heading",{level:2}),title:"Heading 2",children:c.jsx(f1e,{className:"h-4 w-4"})}),c.jsx(so,{onClick:()=>l.chain().focus().toggleHeading({level:3}).run(),isActive:l.isActive("heading",{level:3}),title:"Heading 3",children:c.jsx(p1e,{className:"h-4 w-4"})}),c.jsx("div",{className:"w-px h-6 bg-border mx-1"}),c.jsx(so,{onClick:()=>l.chain().focus().toggleBulletList().run(),isActive:l.isActive("bulletList"),title:"Bullet List",children:c.jsx(C1e,{className:"h-4 w-4"})}),c.jsx(so,{onClick:()=>l.chain().focus().toggleOrderedList().run(),isActive:l.isActive("orderedList"),title:"Ordered List",children:c.jsx(w1e,{className:"h-4 w-4"})}),c.jsx(so,{onClick:()=>l.chain().focus().toggleBlockquote().run(),isActive:l.isActive("blockquote"),title:"Blockquote",children:c.jsx(E1e,{className:"h-4 w-4"})}),c.jsx(so,{onClick:()=>l.chain().focus().setHorizontalRule().run(),title:"Horizontal Rule",children:c.jsx(cre,{className:"h-4 w-4"})}),c.jsx("div",{className:"w-px h-6 bg-border mx-1"}),c.jsx(so,{onClick:()=>{var f;return(f=r.current)==null?void 0:f.click()},title:"Insert Image",children:c.jsx(LU,{className:"h-4 w-4"})}),c.jsx("input",{ref:r,type:"file",accept:"image/*",className:"hidden",onChange:u}),c.jsxs(yM,{children:[c.jsx(vM,{asChild:!0,children:c.jsx(Be,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",title:"YouTube",children:c.jsx(mre,{className:"h-4 w-4"})})}),c.jsx(sE,{className:"w-80",children:c.jsxs("div",{className:"flex gap-2",children:[c.jsx(St,{placeholder:"YouTube URL",value:i,onChange:f=>s(f.target.value)}),c.jsx(Be,{type:"button",size:"sm",onClick:d,children:"Add"})]})})]}),c.jsxs(yM,{children:[c.jsx(vM,{asChild:!0,children:c.jsx(Be,{type:"button",variant:l.isActive("link")?"default":"ghost",size:"icon",className:"h-8 w-8",title:"Link",children:c.jsx(lre,{className:"h-4 w-4"})})}),c.jsx(sE,{className:"w-80",children:c.jsxs("div",{className:"flex gap-2",children:[c.jsx(St,{placeholder:"https://...",value:a,onChange:f=>o(f.target.value)}),c.jsx(Be,{type:"button",size:"sm",onClick:h,children:"Add"})]})})]}),c.jsx("div",{className:"w-px h-6 bg-border mx-1"}),c.jsx(so,{onClick:()=>l.chain().focus().undo().run(),title:"Undo",children:c.jsx(O1e,{className:"h-4 w-4"})}),c.jsx(so,{onClick:()=>l.chain().focus().redo().run(),title:"Redo",children:c.jsx(N1e,{className:"h-4 w-4"})})]}),c.jsx(wde,{editor:l,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},uKe=({value:e,onChange:t})=>{const{toast:n}=RA(),[r,i]=k.useState(!1),[s,a]=k.useState(!1),[o,l]=k.useState(""),[u,d]=k.useState(!1),h=k.useCallback(async p=>{if(!p.type.startsWith("image/")){n({variant:"destructive",title:"Please select an image file"});return}i(!0);try{const m=await GVe(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]),f=k.useCallback(p=>{p.preventDefault(),d(!1);const m=p.dataTransfer.files[0];m&&h(m)},[h]),A=()=>{o.trim()&&(t(o.trim()),l(""),a(!1))};return e?c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{children:"Featured Image"}),c.jsxs("div",{className:"relative group",children:[c.jsx("img",{src:e,alt:"Featured",className:"w-full aspect-[16/9] object-cover border border-input rounded-md"}),c.jsx(Be,{type:"button",variant:"destructive",size:"icon",className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>t(""),children:c.jsx(qa,{className:"h-4 w-4"})})]})]}):c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{children:"Featured Image"}),c.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:f,children:[c.jsx(LU,{className:"h-10 w-10 mx-auto mb-3 text-muted-foreground"}),c.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:r?"Uploading…":"Drag & drop an image or"}),c.jsxs("div",{className:"flex items-center justify-center gap-2",children:[c.jsxs(Be,{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:[c.jsx(pre,{className:"h-4 w-4 mr-1"}),"Upload"]}),c.jsxs(Be,{type:"button",variant:"outline",size:"sm",onClick:()=>a(!s),children:[c.jsx(lre,{className:"h-4 w-4 mr-1"}),"URL"]})]}),s&&c.jsxs("div",{className:"flex gap-2 mt-4 max-w-md mx-auto",children:[c.jsx(St,{placeholder:"https://...",value:o,onChange:p=>l(p.target.value)}),c.jsx(Be,{type:"button",size:"sm",onClick:A,children:"Set"})]})]})]})},dKe=[{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"}],hKe=["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"],wq={"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 jA(e){const t=[],n=e.toLowerCase();for(const{term:r,severity:i}of dKe){const s=n.indexOf(r);if(s!==-1){const a=Math.max(0,s-30),o=Math.min(e.length,s+r.length+30),l=wq[r];t.push({term:r,context:`...${e.slice(a,o)}...`,severity:i,suggestion:l?`Replace "${r}" with "${l}".`:`Remove or rephrase "${r}" — it may violate Fair Housing Act protections.`})}}for(const r of hKe){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=wq[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 dhe(e){return e.some(t=>t.severity==="critical")}const hhe=({violations:e})=>{if(e.length===0)return null;const t=e.filter(r=>r.severity==="critical"),n=e.filter(r=>r.severity==="warning");return c.jsxs("div",{className:"border border-destructive/40 bg-destructive/5 rounded p-4 space-y-3",children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-destructive",children:[c.jsx(Lp,{className:"w-4 h-4"}),"Fair Housing Compliance (",e.length," issue",e.length!==1?"s":"",")"]}),t.map((r,i)=>c.jsxs("div",{className:"flex items-start gap-2 text-sm border-l-2 border-destructive pl-3",children:[c.jsx(c2,{className:"w-3.5 h-3.5 mt-0.5 text-destructive shrink-0"}),c.jsxs("div",{children:[c.jsxs("span",{className:"font-medium",children:['"',r.term,'"']}),c.jsxs("span",{className:"text-muted-foreground ml-1",children:["— ",r.suggestion]})]})]},`c-${i}`)),n.map((r,i)=>c.jsxs("div",{className:"flex items-start gap-2 text-sm border-l-2 border-yellow-500 pl-3",children:[c.jsx(Lp,{className:"w-3.5 h-3.5 mt-0.5 text-yellow-600 shrink-0"}),c.jsxs("div",{children:[c.jsxs("span",{className:"font-medium",children:['"',r.term,'"']}),c.jsxs("span",{className:"text-muted-foreground ml-1",children:["— ",r.suggestion]})]})]},`w-${i}`))]})},AKe={title:"",slug:"",excerpt:"",content:"",featured_image:"",author:"Admin",category:"General",tags:"",published:!1,meta_title:"",meta_description:""};function fKe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const pKe=({initialData:e,onSubmit:t,onCancel:n,isSubmitting:r,isEditing:i})=>{const[s,a]=k.useState(e||AKe),[o,l]=k.useState(!i),[u,d]=k.useState([]);k.useEffect(()=>{e&&a(e)},[e]);const h=A=>{a(p=>({...p,title:A,slug:o?fKe(A):p.slug}))},f=A=>{A.preventDefault();const p=`${s.title} ${s.excerpt} ${s.content}`,m=jA(p);d(m),!(s.published&&dhe(m))&&t(s)};return c.jsxs("form",{onSubmit:f,className:"space-y-6",children:[c.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{htmlFor:"editor-title",children:"Title *"}),c.jsx(St,{id:"editor-title",value:s.title,onChange:A=>h(A.target.value),required:!0})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{htmlFor:"editor-slug",children:"Slug"}),c.jsx(St,{id:"editor-slug",value:s.slug,onChange:A=>{l(!1),a({...s,slug:A.target.value})},placeholder:"auto-generated-from-title"})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{htmlFor:"editor-excerpt",children:"Excerpt"}),c.jsx(Jl,{id:"editor-excerpt",value:s.excerpt,onChange:A=>a({...s,excerpt:A.target.value}),rows:2,placeholder:"A brief summary of the post…"})]}),c.jsx(uKe,{value:s.featured_image,onChange:A=>a({...s,featured_image:A})}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{children:"Content *"}),c.jsx(cKe,{content:s.content,onChange:A=>a({...s,content:A})})]}),c.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{htmlFor:"editor-author",children:"Author"}),c.jsx(St,{id:"editor-author",value:s.author,onChange:A=>a({...s,author:A.target.value})})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{htmlFor:"editor-category",children:"Category"}),c.jsx(St,{id:"editor-category",value:s.category,onChange:A=>a({...s,category:A.target.value})})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{htmlFor:"editor-tags",children:"Tags (comma-separated)"}),c.jsx(St,{id:"editor-tags",value:s.tags,onChange:A=>a({...s,tags:A.target.value}),placeholder:"real estate, market, tips"})]}),c.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{htmlFor:"editor-meta-title",children:"Meta Title"}),c.jsx(St,{id:"editor-meta-title",value:s.meta_title,onChange:A=>a({...s,meta_title:A.target.value}),placeholder:"SEO title (uses post title if empty)"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{htmlFor:"editor-meta-desc",children:"Meta Description"}),c.jsx(St,{id:"editor-meta-desc",value:s.meta_description,onChange:A=>a({...s,meta_description:A.target.value}),placeholder:"SEO description…"})]})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(cc,{id:"editor-published",checked:s.published,onCheckedChange:A=>a({...s,published:A})}),c.jsx(Sn,{htmlFor:"editor-published",children:"Publish immediately"})]}),c.jsx(hhe,{violations:u}),c.jsxs("div",{className:"flex justify-end gap-4",children:[c.jsx(Be,{type:"button",variant:"outline",onClick:n,children:"Cancel"}),c.jsx(Be,{type:"submit",disabled:r,children:r?"Saving…":i?"Update Post":"Create Post"})]})]})};var Ahe="AlertDialog",[mKe,Rjt]=qs(Ahe,[Dle]),Ed=Dle(),fhe=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ed(t);return c.jsx(nce,{...r,...n,modal:!0})};fhe.displayName=Ahe;var gKe="AlertDialogTrigger",yKe=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ed(n);return c.jsx(g6e,{...i,...r,ref:t})});yKe.displayName=gKe;var vKe="AlertDialogPortal",phe=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ed(t);return c.jsx(rce,{...r,...n})};phe.displayName=vKe;var xKe="AlertDialogOverlay",mhe=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ed(n);return c.jsx(j6,{...i,...r,ref:t})});mhe.displayName=xKe;var xy="AlertDialogContent",[wKe,bKe]=mKe(xy),CKe=Sne("AlertDialogContent"),ghe=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,s=Ed(n),a=k.useRef(null),o=tn(t,a),l=k.useRef(null);return c.jsx(A6e,{contentName:xy,titleName:yhe,docsSlug:"alert-dialog",children:c.jsx(wKe,{scope:n,cancelRef:l,children:c.jsxs(T6,{role:"alertdialog",...s,...i,ref:o,onOpenAutoFocus:at(i.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=l.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[c.jsx(CKe,{children:r}),c.jsx(kKe,{contentRef:a})]})})})});ghe.displayName=xy;var yhe="AlertDialogTitle",vhe=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ed(n);return c.jsx(P6,{...i,...r,ref:t})});vhe.displayName=yhe;var xhe="AlertDialogDescription",whe=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ed(n);return c.jsx(I6,{...i,...r,ref:t})});whe.displayName=xhe;var SKe="AlertDialogAction",bhe=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ed(n);return c.jsx(O6,{...i,...r,ref:t})});bhe.displayName=SKe;var Che="AlertDialogCancel",She=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=bKe(Che,n),s=Ed(n),a=tn(t,i);return c.jsx(O6,{...s,...r,ref:a})});She.displayName=Che;var kKe=({contentRef:e})=>{const t=`\`${xy}\` requires a description for the component to be accessible for screen reader users.

You can add a description to the \`${xy}\` by passing a \`${xhe}\` 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 \`${xy}\`. 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 k.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},BKe=fhe,_Ke=phe,khe=mhe,Bhe=ghe,_he=bhe,Ehe=She,Nhe=vhe,jhe=whe;const aE=BKe,EKe=_Ke,The=k.forwardRef(({className:e,...t},n)=>c.jsx(khe,{className:pt("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}));The.displayName=khe.displayName;const Jb=k.forwardRef(({className:e,...t},n)=>c.jsxs(EKe,{children:[c.jsx(The,{}),c.jsx(Bhe,{ref:n,className:pt("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})]}));Jb.displayName=Bhe.displayName;const Zb=({className:e,...t})=>c.jsx("div",{className:pt("flex flex-col space-y-2 text-center sm:text-left",e),...t});Zb.displayName="AlertDialogHeader";const e1=({className:e,...t})=>c.jsx("div",{className:pt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});e1.displayName="AlertDialogFooter";const t1=k.forwardRef(({className:e,...t},n)=>c.jsx(Nhe,{ref:n,className:pt("text-lg font-semibold",e),...t}));t1.displayName=Nhe.displayName;const n1=k.forwardRef(({className:e,...t},n)=>c.jsx(jhe,{ref:n,className:pt("text-sm text-muted-foreground",e),...t}));n1.displayName=jhe.displayName;const wy=k.forwardRef(({className:e,...t},n)=>c.jsx(_he,{ref:n,className:pt(i6(),e),...t}));wy.displayName=_he.displayName;const r1=k.forwardRef(({className:e,...t},n)=>c.jsx(Ehe,{ref:n,className:pt(i6({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));r1.displayName=Ehe.displayName;const NKe=()=>{const e=Sd(),{toast:t}=RA(),{user:n,isLoading:r,isAdmin:i,signOut:s}=Sj(),[a,o]=k.useState(""),[l,u]=k.useState(!1),[d,h]=k.useState(!1),[f,A]=k.useState(null),[p,m]=k.useState(null),{data:g,isLoading:y,error:v,refetch:x}=NIe(),b=jIe(),w=TIe(),S=PIe();k.useEffect(()=>{const D=localStorage.getItem("blog_api_key");D&&(o(D),u(!0))},[]),k.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 _=()=>{localStorage.setItem("blog_api_key",a),u(!0),x(),t({title:"API Key Saved",description:"Your API key has been saved locally."})},E=()=>{A(null),h(!0)},j=D=>{A(D),h(!0)},I=D=>{var H;return{title:D.title,slug:D.slug,excerpt:D.excerpt||"",content:D.content,featured_image:D.featured_image||"",author:D.author,category:D.category,tags:((H=D.tags)==null?void 0:H.join(", "))||"",published:D.published,meta_title:D.meta_title||"",meta_description:D.meta_description||""}},T=async D=>{const H={title:D.title,slug:D.slug||void 0,excerpt:D.excerpt||void 0,content:D.content,featured_image:D.featured_image||void 0,author:D.author||"Admin",category:D.category||"General",tags:D.tags?D.tags.split(",").map(W=>W.trim()):[],published:D.published,meta_title:D.meta_title||void 0,meta_description:D.meta_description||void 0};try{f?(await w.mutateAsync({slug:f.slug,data:H}),t({title:"Post updated successfully"})):(await b.mutateAsync(H),t({title:"Post created successfully"})),h(!1),A(null)}catch(W){t({variant:"destructive",title:"Error",description:W instanceof Error?W.message:"Something went wrong"})}},N=async()=>{if(p)try{await S.mutateAsync(p),t({title:"Post deleted successfully"}),m(null)}catch(D){t({variant:"destructive",title:"Error",description:D instanceof Error?D.message:"Failed to delete post"})}},F=async D=>{try{await w.mutateAsync({slug:D.slug,data:{published:!D.published}}),t({title:D.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?c.jsx(xn,{children:c.jsx("div",{className:"min-h-[60vh] flex items-center justify-center",children:c.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading..."})})}):!n||!i?null:c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsx("title",{children:"Blog Admin | Holden Richardson"}),c.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),c.jsx("div",{className:"section-padding",children:c.jsxs("div",{className:"container-page",children:[c.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4 mb-8",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"heading-section",children:"Blog Admin"}),c.jsx("p",{className:"text-muted-foreground mt-2",children:"Manage your blog posts"})]}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsxs(Be,{variant:"outline",size:"sm",onClick:()=>e("/admin/profile"),children:[c.jsx(UU,{className:"w-4 h-4 mr-2"}),"Profile"]}),c.jsxs(Be,{variant:"outline",size:"sm",onClick:L,children:[c.jsx(k1e,{className:"w-4 h-4 mr-2"}),"Sign Out"]})]})]}),!l&&c.jsxs(vr,{className:"mb-8",children:[c.jsx(La,{children:c.jsxs(Ra,{className:"flex items-center gap-2",children:[c.jsx(RU,{className:"w-5 h-5"}),"API Key Setup"]})}),c.jsxs(xr,{children:[c.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."}),c.jsxs("div",{className:"flex gap-4",children:[c.jsx(St,{type:"password",placeholder:"Enter your BLOG_API_KEY",value:a,onChange:D=>o(D.target.value),className:"max-w-md"}),c.jsx(Be,{onClick:_,children:"Save Key"})]})]})]}),l&&c.jsxs(vr,{children:[c.jsxs(La,{className:"flex flex-row items-center justify-between",children:[c.jsx(Ra,{children:"Posts"}),c.jsxs(Be,{onClick:E,children:[c.jsx(Mp,{className:"w-4 h-4 mr-2"}),"New Post"]})]}),c.jsxs(xr,{children:[y&&c.jsx("div",{className:"space-y-4",children:[...Array(5)].map((D,H)=>c.jsx(Tt,{className:"h-16 w-full"},H))}),v&&c.jsxs("div",{className:"text-center py-8",children:[c.jsx("p",{className:"text-destructive mb-4",children:"Failed to load posts. Check your API key."}),c.jsx(Be,{variant:"outline",onClick:()=>u(!1),children:"Update API Key"})]}),!y&&!v&&g&&c.jsxs(F6,{children:[c.jsx(M6,{children:c.jsxs(my,{children:[c.jsx(Ta,{children:"Title"}),c.jsx(Ta,{children:"Category"}),c.jsx(Ta,{children:"Status"}),c.jsx(Ta,{children:"Date"}),c.jsx(Ta,{className:"text-right",children:"Actions"})]})}),c.jsxs(L6,{children:[g.length===0&&c.jsx(my,{children:c.jsx(oa,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"No posts yet. Create your first post!"})}),g.map(D=>c.jsxs(my,{children:[c.jsx(oa,{className:"font-medium",children:D.title}),c.jsx(oa,{children:D.category}),c.jsx(oa,{children:c.jsx("span",{className:`inline-flex items-center gap-1 px-2 py-1 text-xs rounded ${D.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:D.published?c.jsxs(c.Fragment,{children:[c.jsx(vb,{className:"w-3 h-3"})," Published"]}):c.jsxs(c.Fragment,{children:[c.jsx(o7,{className:"w-3 h-3"})," Draft"]})})}),c.jsx(oa,{children:new Date(D.created_at).toLocaleDateString()}),c.jsx(oa,{className:"text-right",children:c.jsxs("div",{className:"flex items-center justify-end gap-2",children:[c.jsx(Be,{variant:"ghost",size:"icon",onClick:()=>F(D),title:D.published?"Unpublish":"Publish",children:D.published?c.jsx(o7,{className:"w-4 h-4"}):c.jsx(vb,{className:"w-4 h-4"})}),c.jsx(Be,{variant:"ghost",size:"icon",onClick:()=>j(D),children:c.jsx(ure,{className:"w-4 h-4"})}),c.jsx(Be,{variant:"ghost",size:"icon",onClick:()=>m(D.slug),children:c.jsx(yl,{className:"w-4 h-4 text-destructive"})})]})})]},D.id))]})]})]})]})]})}),c.jsx(qc,{open:d,onOpenChange:h,children:c.jsxs(Zl,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[c.jsx(ec,{children:c.jsx(tc,{children:f?"Edit Post":"Create New Post"})}),c.jsx(pKe,{initialData:f?I(f):void 0,onSubmit:T,onCancel:()=>h(!1),isSubmitting:b.isPending||w.isPending,isEditing:!!f})]})}),c.jsx(aE,{open:!!p,onOpenChange:()=>m(null),children:c.jsxs(Jb,{children:[c.jsxs(Zb,{children:[c.jsx(t1,{children:"Delete Post"}),c.jsx(n1,{children:"Are you sure you want to delete this post? This action cannot be undone."})]}),c.jsxs(e1,{children:[c.jsx(r1,{children:"Cancel"}),c.jsx(wy,{onClick:N,className:"bg-destructive text-destructive-foreground",children:"Delete"})]})]})})]})},jKe=()=>{const e=Sd(),{toast:t}=RA(),{user:n,isLoading:r,isAdmin:i}=Sj(),[s,a]=k.useState(""),[o,l]=k.useState(""),[u,d]=k.useState(""),[h,f]=k.useState(!1),[A,p]=k.useState(""),[m,g]=k.useState(!1);k.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]),k.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}f(!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(""),l(""),d("")),f(!1)},v=()=>{localStorage.setItem("blog_api_key",A),t({title:"API Key updated",description:"Your API key has been saved locally."})};return r?c.jsx(xn,{children:c.jsx("div",{className:"min-h-[60vh] flex items-center justify-center",children:c.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading..."})})}):!n||!i?null:c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsx("title",{children:"Profile Settings | Holden Richardson | 616 Realty"}),c.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),c.jsx("div",{className:"section-padding",children:c.jsxs("div",{className:"container-page max-w-2xl",children:[c.jsxs(Be,{variant:"ghost",onClick:()=>e("/admin/blog"),className:"mb-6",children:[c.jsx(l2,{className:"w-4 h-4 mr-2"}),"Back to Blog Admin"]}),c.jsx("h1",{className:"heading-section mb-8",children:"Profile Settings"}),c.jsxs(vr,{className:"mb-8",children:[c.jsxs(La,{children:[c.jsx(Ra,{children:"Account Information"}),c.jsx(Ay,{children:"Your account details"})]}),c.jsx(xr,{children:c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(Sn,{className:"text-muted-foreground",children:"Email"}),c.jsx("p",{className:"text-foreground",children:n.email})]}),c.jsxs("div",{children:[c.jsx(Sn,{className:"text-muted-foreground",children:"User ID"}),c.jsx("p",{className:"text-foreground font-mono text-sm",children:n.id})]}),c.jsxs("div",{children:[c.jsx(Sn,{className:"text-muted-foreground",children:"Role"}),c.jsx("p",{className:"text-foreground",children:"Administrator"})]})]})})]}),c.jsxs(vr,{className:"mb-8",children:[c.jsxs(La,{children:[c.jsx(Ra,{children:"Change Password"}),c.jsx(Ay,{children:"Update your password"})]}),c.jsx(xr,{children:c.jsxs("form",{onSubmit:y,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{htmlFor:"new-password",children:"New Password"}),c.jsx(St,{id:"new-password",type:"password",value:o,onChange:x=>l(x.target.value),placeholder:"••••••••",required:!0})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{htmlFor:"confirm-new-password",children:"Confirm New Password"}),c.jsx(St,{id:"confirm-new-password",type:"password",value:u,onChange:x=>d(x.target.value),placeholder:"••••••••",required:!0})]}),c.jsxs(Be,{type:"submit",disabled:h,children:[c.jsx(wb,{className:"w-4 h-4 mr-2"}),h?"Updating...":"Update Password"]})]})})]}),c.jsxs(vr,{children:[c.jsxs(La,{children:[c.jsxs(Ra,{className:"flex items-center gap-2",children:[c.jsx(v1e,{className:"w-5 h-5"}),"API Key"]}),c.jsx(Ay,{children:"Your Blog API key for managing posts. This is stored locally in your browser."})]}),c.jsx(xr,{children:c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{htmlFor:"api-key",children:"BLOG_API_KEY"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(St,{id:"api-key",type:m?"text":"password",value:A,onChange:x=>p(x.target.value),placeholder:"Enter your API key"}),c.jsx(Be,{type:"button",variant:"outline",onClick:()=>g(!m),children:m?"Hide":"Show"})]})]}),c.jsxs(Be,{onClick:v,children:[c.jsx(wb,{className:"w-4 h-4 mr-2"}),"Save API Key"]})]})})]})]})})]})};function Phe(){const{configMap:e,isLoading:t}=To(),n=Tae(),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 TKe=[{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"}],PKe=[{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"}],IKe=[{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"}],OKe=()=>{const{configMap:e,isLoading:t}=To(),n=Tae(),[r,i]=k.useState({}),s={...e,...r},a=()=>{const l=Object.entries(r).map(([u,d])=>({key:u,value:d}));if(l.length===0){Xe({title:"No changes to save"});return}n.mutate(l,{onSuccess:()=>{Xe({title:"Configuration saved!"}),i({})},onError:u=>Xe({title:"Error saving",description:u.message,variant:"destructive"})})};if(t)return c.jsx("div",{className:"space-y-4",children:Array.from({length:6}).map((l,u)=>c.jsx(Tt,{className:"h-10 w-full"},u))});const o=l=>c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:l.map(u=>c.jsxs("div",{className:"space-y-1.5",children:[c.jsx(Sn,{htmlFor:u.key,className:"text-xs uppercase tracking-wider",children:u.label}),c.jsx(St,{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 c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"font-serif text-xl mb-2",children:"Agent Identity"}),c.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(TKe)]}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-serif text-xl mb-2",children:"CTAs & Site Settings"}),c.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(PKe)]}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-serif text-xl mb-2",children:"About & Profile Links"}),c.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(IKe)]}),c.jsx("div",{className:"rounded-md border border-accent/30 bg-accent/5 p-4",children:c.jsxs("p",{className:"text-sm text-muted-foreground",children:[c.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."]})}),c.jsxs(Be,{onClick:a,disabled:n.isPending,className:"btn-gold border-0",children:[c.jsx(wb,{className:"w-4 h-4 mr-2"}),n.isPending?"Saving...":"Save Config"]})]})};function KA(e){return dr({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 FKe(e){return dr({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 gc(e){return dr({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 MKe(e,t,n){return dr({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:l,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 l?{...l,category:l.aeo_categories,faq_json:l.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 LKe(e){return dr({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 RKe=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 bq(e){return new Set((e||"").toLowerCase().replace(/[^a-z0-9\s]/g," ").split(/\s+/).filter(t=>t.length>3&&!RKe.has(t)))}function UKe(e,t,n,r=5){return dr({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=bq(n||""),l=a.map(d=>{const f=(Array.isArray(d.faq_json)?d.faq_json:[]).map(m=>`${(m==null?void 0:m.question)||""} ${(m==null?void 0:m.answer)||""}`).join(" "),A=bq(`${d.h1||""} ${d.title||""} ${d.intro_text||""} ${f}`);let p=0;if(o.size>0)for(const m of o)A.has(m)&&(p+=1);return{p:d,overlap:p}}),u=l.some(d=>d.overlap>0);return l.sort((d,h)=>u&&h.overlap!==d.overlap?h.overlap-d.overlap:(d.p.display_order??0)-(h.p.display_order??0)),l.slice(0,r).map(({p:d})=>({id:d.id,title:d.title,slug:d.slug,h1:d.h1,intro_text:d.intro_text}))}})}function Ihe(){const e=Zi();return Cs({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 Zj(){const e=Zi();return Cs({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 Ohe(){const e=Zi();return Cs({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 Fhe(){const e=Zi();return Cs({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 DKe(){const e=Zi();return Cs({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 QKe(){const e=Zi();return Cs({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 xM(e,[t,n]){return Math.min(n,Math.max(t,e))}var HKe=[" ","Enter","ArrowUp","ArrowDown"],$Ke=[" ","Enter"],Gp="Select",[e5,t5,zKe]=KN(Gp),[lv,Ujt]=qs(Gp,[zKe,W0]),n5=W0(),[VKe,qA]=lv(Gp),[KKe,qKe]=lv(Gp),Mhe=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:s,value:a,defaultValue:o,onValueChange:l,dir:u,name:d,autoComplete:h,disabled:f,required:A,form:p}=e,m=n5(t),[g,y]=k.useState(null),[v,x]=k.useState(null),[b,w]=k.useState(!1),S=g2(u),[_,E]=Bo({prop:r,defaultProp:i??!1,onChange:s,caller:Gp}),[j,I]=Bo({prop:a,defaultProp:o,onChange:l,caller:Gp}),T=k.useRef(null),N=g?p||!!g.closest("form"):!0,[F,L]=k.useState(new Set),D=Array.from(F).map(H=>H.props.value).join(";");return c.jsx(XU,{...m,children:c.jsxs(VKe,{required:A,scope:t,trigger:g,onTriggerChange:y,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:b,onValueNodeHasChildrenChange:w,contentId:cl(),value:j,onValueChange:I,open:_,onOpenChange:E,dir:S,triggerPointerDownPosRef:T,disabled:f,children:[c.jsx(e5.Provider,{scope:t,children:c.jsx(KKe,{scope:e.__scopeSelect,onNativeOptionAdd:k.useCallback(H=>{L(W=>new Set(W).add(H))},[]),onNativeOptionRemove:k.useCallback(H=>{L(W=>{const $=new Set(W);return $.delete(H),$})},[]),children:n})}),N?c.jsxs(aAe,{"aria-hidden":!0,required:A,tabIndex:-1,name:d,autoComplete:h,value:j,onChange:H=>I(H.target.value),disabled:f,form:p,children:[j===void 0?c.jsx("option",{value:""}):null,Array.from(F)]},D):null]})})};Mhe.displayName=Gp;var Lhe="SelectTrigger",Rhe=k.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,s=n5(n),a=qA(Lhe,n),o=a.disabled||r,l=tn(t,a.onTriggerChange),u=t5(n),d=k.useRef("touch"),[h,f,A]=lAe(m=>{const g=u().filter(x=>!x.disabled),y=g.find(x=>x.value===a.value),v=cAe(g,m,y);v!==void 0&&a.onValueChange(v.value)}),p=m=>{o||(a.onOpenChange(!0),A()),m&&(a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return c.jsx(tj,{asChild:!0,...s,children:c.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":oAe(a.value)?"":void 0,...i,ref:l,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&&f(m.key),!(g&&m.key===" ")&&HKe.includes(m.key)&&(p(),m.preventDefault())})})})});Rhe.displayName=Lhe;var Uhe="SelectValue",Dhe=k.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:s,placeholder:a="",...o}=e,l=qA(Uhe,n),{onValueNodeHasChildrenChange:u}=l,d=s!==void 0,h=tn(t,l.onValueNodeChange);return Ui(()=>{u(d)},[u,d]),c.jsx(_t.span,{...o,ref:h,style:{pointerEvents:"none"},children:oAe(l.value)?c.jsx(c.Fragment,{children:a}):s})});Dhe.displayName=Uhe;var WKe="SelectIcon",Qhe=k.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return c.jsx(_t.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});Qhe.displayName=WKe;var GKe="SelectPortal",Hhe=e=>c.jsx(a2,{asChild:!0,...e});Hhe.displayName=GKe;var Yp="SelectContent",$he=k.forwardRef((e,t)=>{const n=qA(Yp,e.__scopeSelect),[r,i]=k.useState();if(Ui(()=>{i(new DocumentFragment)},[]),!n.open){const s=r;return s?LA.createPortal(c.jsx(zhe,{scope:e.__scopeSelect,children:c.jsx(e5.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),s):null}return c.jsx(Vhe,{...e,ref:t})});$he.displayName=Yp;var Ul=10,[zhe,WA]=lv(Yp),YKe="SelectContentImpl",XKe=Fp("SelectContent.RemoveScroll"),Vhe=k.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:a,side:o,sideOffset:l,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:A,sticky:p,hideWhenDetached:m,avoidCollisions:g,...y}=e,v=qA(Yp,n),[x,b]=k.useState(null),[w,S]=k.useState(null),_=tn(t,Z=>b(Z)),[E,j]=k.useState(null),[I,T]=k.useState(null),N=t5(n),[F,L]=k.useState(!1),D=k.useRef(!1);k.useEffect(()=>{if(x)return B6(x)},[x]),k6();const H=k.useCallback(Z=>{const[de,...se]=N().map(ue=>ue.ref.current),[ie]=se.slice(-1),he=document.activeElement;for(const ue of Z)if(ue===he||(ue==null||ue.scrollIntoView({block:"nearest"}),ue===de&&w&&(w.scrollTop=0),ue===ie&&w&&(w.scrollTop=w.scrollHeight),ue==null||ue.focus(),document.activeElement!==he))return},[N,w]),W=k.useCallback(()=>H([E,x]),[H,E,x]);k.useEffect(()=>{F&&W()},[F,W]);const{onOpenChange:$,triggerPointerDownPosRef:V}=v;k.useEffect(()=>{if(x){let Z={x:0,y:0};const de=ie=>{var he,ue;Z={x:Math.abs(Math.round(ie.pageX)-(((he=V.current)==null?void 0:he.x)??0)),y:Math.abs(Math.round(ie.pageY)-(((ue=V.current)==null?void 0:ue.y)??0))}},se=ie=>{Z.x<=10&&Z.y<=10?ie.preventDefault():x.contains(ie.target)||$(!1),document.removeEventListener("pointermove",de),V.current=null};return V.current!==null&&(document.addEventListener("pointermove",de),document.addEventListener("pointerup",se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",de),document.removeEventListener("pointerup",se,{capture:!0})}}},[x,$,V]),k.useEffect(()=>{const Z=()=>$(!1);return window.addEventListener("blur",Z),window.addEventListener("resize",Z),()=>{window.removeEventListener("blur",Z),window.removeEventListener("resize",Z)}},[$]);const[Q,ce]=lAe(Z=>{const de=N().filter(he=>!he.disabled),se=de.find(he=>he.ref.current===document.activeElement),ie=cAe(de,Z,se);ie&&setTimeout(()=>ie.ref.current.focus())}),R=k.useCallback((Z,de,se)=>{const ie=!D.current&&!se;(v.value!==void 0&&v.value===de||ie)&&(j(Z),ie&&(D.current=!0))},[v.value]),M=k.useCallback(()=>x==null?void 0:x.focus(),[x]),Y=k.useCallback((Z,de,se)=>{const ie=!D.current&&!se;(v.value!==void 0&&v.value===de||ie)&&T(Z)},[v.value]),X=r==="popper"?wM:Khe,K=X===wM?{side:o,sideOffset:l,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:A,sticky:p,hideWhenDetached:m,avoidCollisions:g}:{};return c.jsx(zhe,{scope:n,content:x,viewport:w,onViewportChange:S,itemRefCallback:R,selectedItem:E,onItemLeave:M,itemTextRefCallback:Y,focusSelectedItem:W,selectedItemText:I,position:r,isPositioned:F,searchRef:Q,children:c.jsx(Ij,{as:XKe,allowPinchZoom:!0,children:c.jsx(Tj,{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:c.jsx($0,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:Z=>Z.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:c.jsx(X,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:Z=>Z.preventDefault(),...y,...K,onPlaced:()=>L(!0),ref:_,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 ie=N().filter(he=>!he.disabled).map(he=>he.ref.current);if(["ArrowUp","End"].includes(Z.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(Z.key)){const he=Z.target,ue=ie.indexOf(he);ie=ie.slice(ue+1)}setTimeout(()=>H(ie)),Z.preventDefault()}})})})})})})});Vhe.displayName=YKe;var JKe="SelectItemAlignedPosition",Khe=k.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,s=qA(Yp,n),a=WA(Yp,n),[o,l]=k.useState(null),[u,d]=k.useState(null),h=tn(t,_=>d(_)),f=t5(n),A=k.useRef(!1),p=k.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:y,focusSelectedItem:v}=a,x=k.useCallback(()=>{if(s.trigger&&s.valueNode&&o&&u&&m&&g&&y){const _=s.trigger.getBoundingClientRect(),E=u.getBoundingClientRect(),j=s.valueNode.getBoundingClientRect(),I=y.getBoundingClientRect();if(s.dir!=="rtl"){const he=I.left-E.left,ue=j.left-he,Se=_.left-ue,Fe=_.width+Se,te=Math.max(Fe,E.width),_e=window.innerWidth-Ul,Ze=xM(ue,[Ul,Math.max(Ul,_e-te)]);o.style.minWidth=Fe+"px",o.style.left=Ze+"px"}else{const he=E.right-I.right,ue=window.innerWidth-j.right-he,Se=window.innerWidth-_.right-ue,Fe=_.width+Se,te=Math.max(Fe,E.width),_e=window.innerWidth-Ul,Ze=xM(ue,[Ul,Math.max(Ul,_e-te)]);o.style.minWidth=Fe+"px",o.style.right=Ze+"px"}const T=f(),N=window.innerHeight-Ul*2,F=m.scrollHeight,L=window.getComputedStyle(u),D=parseInt(L.borderTopWidth,10),H=parseInt(L.paddingTop,10),W=parseInt(L.borderBottomWidth,10),$=parseInt(L.paddingBottom,10),V=D+H+F+$+W,Q=Math.min(g.offsetHeight*5,V),ce=window.getComputedStyle(m),R=parseInt(ce.paddingTop,10),M=parseInt(ce.paddingBottom,10),Y=_.top+_.height/2-Ul,X=N-Y,K=g.offsetHeight/2,Z=g.offsetTop+K,de=D+H+Z,se=V-de;if(de<=Y){const he=T.length>0&&g===T[T.length-1].ref.current;o.style.bottom="0px";const ue=u.clientHeight-m.offsetTop-m.offsetHeight,Se=Math.max(X,K+(he?M:0)+ue+W),Fe=de+Se;o.style.height=Fe+"px"}else{const he=T.length>0&&g===T[0].ref.current;o.style.top="0px";const Se=Math.max(Y,D+m.offsetTop+(he?R:0)+K)+se;o.style.height=Se+"px",m.scrollTop=de-Y+m.offsetTop}o.style.margin=`${Ul}px 0`,o.style.minHeight=Q+"px",o.style.maxHeight=N+"px",r==null||r(),requestAnimationFrame(()=>A.current=!0)}},[f,s.trigger,s.valueNode,o,u,m,g,y,s.dir,r]);Ui(()=>x(),[x]);const[b,w]=k.useState();Ui(()=>{u&&w(window.getComputedStyle(u).zIndex)},[u]);const S=k.useCallback(_=>{_&&p.current===!0&&(x(),v==null||v(),p.current=!1)},[x,v]);return c.jsx(eqe,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:A,onScrollButtonChange:S,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:c.jsx(_t.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Khe.displayName=JKe;var ZKe="SelectPopperPosition",wM=k.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ul,...s}=e,a=n5(n);return c.jsx(JU,{...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)"}})});wM.displayName=ZKe;var[eqe,SQ]=lv(Yp,{}),bM="SelectViewport",qhe=k.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,s=WA(bM,n),a=SQ(bM,n),o=tn(t,s.onViewportChange),l=k.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(e5.Slot,{scope:n,children:c.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:f}=a;if(f!=null&&f.current&&h){const A=Math.abs(l.current-d.scrollTop);if(A>0){const p=window.innerHeight-Ul*2,m=parseFloat(h.style.minHeight),g=parseFloat(h.style.height),y=Math.max(m,g);if(y<p){const v=y+A,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")}}}l.current=d.scrollTop})})})]})});qhe.displayName=bM;var Whe="SelectGroup",[tqe,nqe]=lv(Whe),rqe=k.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=cl();return c.jsx(tqe,{scope:n,id:i,children:c.jsx(_t.div,{role:"group","aria-labelledby":i,...r,ref:t})})});rqe.displayName=Whe;var Ghe="SelectLabel",Yhe=k.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=nqe(Ghe,n);return c.jsx(_t.div,{id:i.id,...r,ref:t})});Yhe.displayName=Ghe;var oE="SelectItem",[iqe,Xhe]=lv(oE),Jhe=k.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:s,...a}=e,o=qA(oE,n),l=WA(oE,n),u=o.value===r,[d,h]=k.useState(s??""),[f,A]=k.useState(!1),p=tn(t,v=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,v,r,i)}),m=cl(),g=k.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 c.jsx(iqe,{scope:n,value:r,disabled:i,textId:m,isSelected:u,onItemTextChange:k.useCallback(v=>{h(x=>x||((v==null?void 0:v.textContent)??"").trim())},[]),children:c.jsx(e5.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:c.jsx(_t.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"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,()=>A(!0)),onBlur:at(a.onBlur,()=>A(!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=l.onItemLeave)==null||x.call(l):g.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:at(a.onPointerLeave,v=>{var x;v.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:at(a.onKeyDown,v=>{var b;((b=l.searchRef)==null?void 0:b.current)!==""&&v.key===" "||($Ke.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})})})})});Jhe.displayName=oE;var Xx="SelectItemText",Zhe=k.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...s}=e,a=qA(Xx,n),o=WA(Xx,n),l=Xhe(Xx,n),u=qKe(Xx,n),[d,h]=k.useState(null),f=tn(t,y=>h(y),l.onItemTextChange,y=>{var v;return(v=o.itemTextRefCallback)==null?void 0:v.call(o,y,l.value,l.disabled)}),A=d==null?void 0:d.textContent,p=k.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:A},l.value),[l.disabled,l.value,A]),{onNativeOptionAdd:m,onNativeOptionRemove:g}=u;return Ui(()=>(m(p),()=>g(p)),[m,g,p]),c.jsxs(c.Fragment,{children:[c.jsx(_t.span,{id:l.textId,...s,ref:f}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?LA.createPortal(s.children,a.valueNode):null]})});Zhe.displayName=Xx;var eAe="SelectItemIndicator",tAe=k.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Xhe(eAe,n).isSelected?c.jsx(_t.span,{"aria-hidden":!0,...r,ref:t}):null});tAe.displayName=eAe;var CM="SelectScrollUpButton",nAe=k.forwardRef((e,t)=>{const n=WA(CM,e.__scopeSelect),r=SQ(CM,e.__scopeSelect),[i,s]=k.useState(!1),a=tn(t,r.onScrollButtonChange);return Ui(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),i?c.jsx(iAe,{...e,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop-l.offsetHeight)}}):null});nAe.displayName=CM;var SM="SelectScrollDownButton",rAe=k.forwardRef((e,t)=>{const n=WA(SM,e.__scopeSelect),r=SQ(SM,e.__scopeSelect),[i,s]=k.useState(!1),a=tn(t,r.onScrollButtonChange);return Ui(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<u;s(d)};const l=n.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),i?c.jsx(iAe,{...e,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop+l.offsetHeight)}}):null});rAe.displayName=SM;var iAe=k.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,s=WA("SelectScrollButton",n),a=k.useRef(null),o=t5(n),l=k.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return k.useEffect(()=>()=>l(),[l]),Ui(()=>{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]),c.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,()=>{l()})})}),sqe="SelectSeparator",sAe=k.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(_t.div,{"aria-hidden":!0,...r,ref:t})});sAe.displayName=sqe;var kM="SelectArrow",aqe=k.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=n5(n),s=qA(kM,n),a=WA(kM,n);return s.open&&a.position==="popper"?c.jsx(ZU,{...i,...r,ref:t}):null});aqe.displayName=kM;var oqe="SelectBubbleInput",aAe=k.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=k.useRef(null),s=tn(r,i),a=R6(t);return k.useEffect(()=>{const o=i.current;if(!o)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&d){const h=new Event("change",{bubbles:!0});d.call(o,t),o.dispatchEvent(h)}},[a,t]),c.jsx(_t.select,{...n,style:{...Nne,...n.style},ref:s,defaultValue:t})});aAe.displayName=oqe;function oAe(e){return e===""||e===void 0}function lAe(e){const t=Mi(e),n=k.useRef(""),r=k.useRef(0),i=k.useCallback(a=>{const o=n.current+a;t(o),function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(o)},[t]),s=k.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return k.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,s]}function cAe(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=lqe(e,Math.max(s,0));i.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function lqe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var cqe=Mhe,uAe=Rhe,uqe=Dhe,dqe=Qhe,hqe=Hhe,dAe=$he,Aqe=qhe,hAe=Yhe,AAe=Jhe,fqe=Zhe,pqe=tAe,fAe=nAe,pAe=rAe,mAe=sAe;const Ua=cqe,Da=uqe,ha=k.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(uAe,{ref:r,className:pt("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,c.jsx(dqe,{asChild:!0,children:c.jsx(ac,{className:"h-4 w-4 opacity-50"})})]}));ha.displayName=uAe.displayName;const gAe=k.forwardRef(({className:e,...t},n)=>c.jsx(fAe,{ref:n,className:pt("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(i1e,{className:"h-4 w-4"})}));gAe.displayName=fAe.displayName;const yAe=k.forwardRef(({className:e,...t},n)=>c.jsx(pAe,{ref:n,className:pt("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(ac,{className:"h-4 w-4"})}));yAe.displayName=pAe.displayName;const Aa=k.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>c.jsx(hqe,{children:c.jsxs(dAe,{ref:i,className:pt("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:[c.jsx(gAe,{}),c.jsx(Aqe,{className:pt("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(yAe,{})]})}));Aa.displayName=dAe.displayName;const mqe=k.forwardRef(({className:e,...t},n)=>c.jsx(hAe,{ref:n,className:pt("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));mqe.displayName=hAe.displayName;const kn=k.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(AAe,{ref:r,className:pt("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:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(pqe,{children:c.jsx(Jc,{className:"h-4 w-4"})})}),c.jsx(fqe,{children:t})]}));kn.displayName=AAe.displayName;const gqe=k.forwardRef(({className:e,...t},n)=>c.jsx(mAe,{ref:n,className:pt("-mx-1 my-1 h-px bg-muted",e),...t}));gqe.displayName=mAe.displayName;function yqe(e,t){return k.useReducer((n,r)=>t[n][r]??n,e)}var kQ="ScrollArea",[vAe,Djt]=qs(kQ),[vqe,wl]=vAe(kQ),xAe=k.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:s=600,...a}=e,[o,l]=k.useState(null),[u,d]=k.useState(null),[h,f]=k.useState(null),[A,p]=k.useState(null),[m,g]=k.useState(null),[y,v]=k.useState(0),[x,b]=k.useState(0),[w,S]=k.useState(!1),[_,E]=k.useState(!1),j=tn(t,T=>l(T)),I=g2(i);return c.jsx(vqe,{scope:n,type:r,dir:I,scrollHideDelay:s,scrollArea:o,viewport:u,onViewportChange:d,content:h,onContentChange:f,scrollbarX:A,onScrollbarXChange:p,scrollbarXEnabled:w,onScrollbarXEnabledChange:S,scrollbarY:m,onScrollbarYChange:g,scrollbarYEnabled:_,onScrollbarYEnabledChange:E,onCornerWidthChange:v,onCornerHeightChange:b,children:c.jsx(_t.div,{dir:I,...a,ref:j,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});xAe.displayName=kQ;var wAe="ScrollAreaViewport",bAe=k.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...s}=e,a=wl(wAe,n),o=k.useRef(null),l=tn(t,o,a.onViewportChange);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),c.jsx(_t.div,{"data-radix-scroll-area-viewport":"",...s,ref:l,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:c.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});bAe.displayName=wAe;var Au="ScrollAreaScrollbar",BQ=k.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=wl(Au,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:a}=i,o=e.orientation==="horizontal";return k.useEffect(()=>(o?s(!0):a(!0),()=>{o?s(!1):a(!1)}),[o,s,a]),i.type==="hover"?c.jsx(xqe,{...r,ref:t,forceMount:n}):i.type==="scroll"?c.jsx(wqe,{...r,ref:t,forceMount:n}):i.type==="auto"?c.jsx(CAe,{...r,ref:t,forceMount:n}):i.type==="always"?c.jsx(_Q,{...r,ref:t}):null});BQ.displayName=Au;var xqe=k.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=wl(Au,e.__scopeScrollArea),[s,a]=k.useState(!1);return k.useEffect(()=>{const o=i.scrollArea;let l=0;if(o){const u=()=>{window.clearTimeout(l),a(!0)},d=()=>{l=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return o.addEventListener("pointerenter",u),o.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),o.removeEventListener("pointerenter",u),o.removeEventListener("pointerleave",d)}}},[i.scrollArea,i.scrollHideDelay]),c.jsx(ba,{present:n||s,children:c.jsx(CAe,{"data-state":s?"visible":"hidden",...r,ref:t})})}),wqe=k.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=wl(Au,e.__scopeScrollArea),s=e.orientation==="horizontal",a=i5(()=>l("SCROLL_END"),100),[o,l]=yqe("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 k.useEffect(()=>{if(o==="idle"){const u=window.setTimeout(()=>l("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(u)}},[o,i.scrollHideDelay,l]),k.useEffect(()=>{const u=i.viewport,d=s?"scrollLeft":"scrollTop";if(u){let h=u[d];const f=()=>{const A=u[d];h!==A&&(l("SCROLL"),a()),h=A};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[i.viewport,s,l,a]),c.jsx(ba,{present:n||o!=="hidden",children:c.jsx(_Q,{"data-state":o==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:at(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:at(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),CAe=k.forwardRef((e,t)=>{const n=wl(Au,e.__scopeScrollArea),{forceMount:r,...i}=e,[s,a]=k.useState(!1),o=e.orientation==="horizontal",l=i5(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;a(o?u:d)}},10);return h0(n.viewport,l),h0(n.content,l),c.jsx(ba,{present:r||s,children:c.jsx(_Q,{"data-state":s?"visible":"hidden",...i,ref:t})})}),_Q=k.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=wl(Au,e.__scopeScrollArea),s=k.useRef(null),a=k.useRef(0),[o,l]=k.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=EAe(o.viewport,o.content),d={...r,sizes:o,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:f=>s.current=f,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:f=>a.current=f};function h(f,A){return _qe(f,a.current,o,A)}return n==="horizontal"?c.jsx(bqe,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const f=i.viewport.scrollLeft,A=Cq(f,o,i.dir);s.current.style.transform=`translate3d(${A}px, 0, 0)`}},onWheelScroll:f=>{i.viewport&&(i.viewport.scrollLeft=f)},onDragScroll:f=>{i.viewport&&(i.viewport.scrollLeft=h(f,i.dir))}}):n==="vertical"?c.jsx(Cqe,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const f=i.viewport.scrollTop,A=Cq(f,o);s.current.style.transform=`translate3d(0, ${A}px, 0)`}},onWheelScroll:f=>{i.viewport&&(i.viewport.scrollTop=f)},onDragScroll:f=>{i.viewport&&(i.viewport.scrollTop=h(f))}}):null}),bqe=k.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,s=wl(Au,e.__scopeScrollArea),[a,o]=k.useState(),l=k.useRef(null),u=tn(t,l,s.onScrollbarXChange);return k.useEffect(()=>{l.current&&o(getComputedStyle(l.current))},[l]),c.jsx(kAe,{"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":r5(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(s.viewport){const f=s.viewport.scrollLeft+d.deltaX;e.onWheelScroll(f),jAe(f,h)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&a&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:cE(a.paddingLeft),paddingEnd:cE(a.paddingRight)}})}})}),Cqe=k.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,s=wl(Au,e.__scopeScrollArea),[a,o]=k.useState(),l=k.useRef(null),u=tn(t,l,s.onScrollbarYChange);return k.useEffect(()=>{l.current&&o(getComputedStyle(l.current))},[l]),c.jsx(kAe,{"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":r5(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(s.viewport){const f=s.viewport.scrollTop+d.deltaY;e.onWheelScroll(f),jAe(f,h)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&a&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:cE(a.paddingTop),paddingEnd:cE(a.paddingBottom)}})}})}),[Sqe,SAe]=vAe(Au),kAe=k.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:s,onThumbPointerUp:a,onThumbPointerDown:o,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:h,...f}=e,A=wl(Au,n),[p,m]=k.useState(null),g=tn(t,j=>m(j)),y=k.useRef(null),v=k.useRef(""),x=A.viewport,b=r.content-r.viewport,w=Mi(d),S=Mi(l),_=i5(h,10);function E(j){if(y.current){const I=j.clientX-y.current.left,T=j.clientY-y.current.top;u({x:I,y:T})}}return k.useEffect(()=>{const j=I=>{const T=I.target;(p==null?void 0:p.contains(T))&&w(I,b)};return document.addEventListener("wheel",j,{passive:!1}),()=>document.removeEventListener("wheel",j,{passive:!1})},[x,p,b,w]),k.useEffect(S,[r,S]),h0(p,_),h0(A.content,_),c.jsx(Sqe,{scope:n,scrollbar:p,hasThumb:i,onThumbChange:Mi(s),onThumbPointerUp:Mi(a),onThumbPositionChange:S,onThumbPointerDown:Mi(o),children:c.jsx(_t.div,{...f,ref:g,style:{position:"absolute",...f.style},onPointerDown:at(e.onPointerDown,j=>{j.button===0&&(j.target.setPointerCapture(j.pointerId),y.current=p.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",A.viewport&&(A.viewport.style.scrollBehavior="auto"),E(j))}),onPointerMove:at(e.onPointerMove,E),onPointerUp:at(e.onPointerUp,j=>{const I=j.target;I.hasPointerCapture(j.pointerId)&&I.releasePointerCapture(j.pointerId),document.body.style.webkitUserSelect=v.current,A.viewport&&(A.viewport.style.scrollBehavior=""),y.current=null})})})}),lE="ScrollAreaThumb",BAe=k.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=SAe(lE,e.__scopeScrollArea);return c.jsx(ba,{present:n||i.hasThumb,children:c.jsx(kqe,{ref:t,...r})})}),kqe=k.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,s=wl(lE,n),a=SAe(lE,n),{onThumbPositionChange:o}=a,l=tn(t,h=>a.onThumbChange(h)),u=k.useRef(void 0),d=i5(()=>{u.current&&(u.current(),u.current=void 0)},100);return k.useEffect(()=>{const h=s.viewport;if(h){const f=()=>{if(d(),!u.current){const A=Eqe(h,o);u.current=A,o()}};return o(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[s.viewport,d,o]),c.jsx(_t.div,{"data-state":a.hasThumb?"visible":"hidden",...i,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:at(e.onPointerDownCapture,h=>{const A=h.target.getBoundingClientRect(),p=h.clientX-A.left,m=h.clientY-A.top;a.onThumbPointerDown({x:p,y:m})}),onPointerUp:at(e.onPointerUp,a.onThumbPointerUp)})});BAe.displayName=lE;var EQ="ScrollAreaCorner",_Ae=k.forwardRef((e,t)=>{const n=wl(EQ,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?c.jsx(Bqe,{...e,ref:t}):null});_Ae.displayName=EQ;var Bqe=k.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=wl(EQ,n),[s,a]=k.useState(0),[o,l]=k.useState(0),u=!!(s&&o);return h0(i.scrollbarX,()=>{var h;const d=((h=i.scrollbarX)==null?void 0:h.offsetHeight)||0;i.onCornerHeightChange(d),l(d)}),h0(i.scrollbarY,()=>{var h;const d=((h=i.scrollbarY)==null?void 0:h.offsetWidth)||0;i.onCornerWidthChange(d),a(d)}),u?c.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 cE(e){return e?parseInt(e,10):0}function EAe(e,t){const n=e/t;return isNaN(n)?0:n}function r5(e){const t=EAe(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function _qe(e,t,n,r="ltr"){const i=r5(n),s=i/2,a=t||s,o=i-a,l=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 NAe([l,u],h)(e)}function Cq(e,t,n="ltr"){const r=r5(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-i,a=t.content-t.viewport,o=s-r,l=n==="ltr"?[0,a]:[a*-1,0],u=xM(e,l);return NAe([0,a],[0,o])(u)}function NAe(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 jAe(e,t){return e>0&&e<t}var Eqe=(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 i5(e,t){const n=Mi(e),r=k.useRef(0);return k.useEffect(()=>()=>window.clearTimeout(r.current),[]),k.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function h0(e,t){const n=Mi(t);Ui(()=>{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 TAe=xAe,Nqe=bAe,jqe=_Ae;const PAe=k.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(TAe,{ref:r,className:pt("relative overflow-hidden",e),...n,children:[c.jsx(Nqe,{className:"h-full w-full rounded-[inherit]",children:t}),c.jsx(IAe,{}),c.jsx(jqe,{})]}));PAe.displayName=TAe.displayName;const IAe=k.forwardRef(({className:e,orientation:t="vertical",...n},r)=>c.jsx(BQ,{ref:r,orientation:t,className:pt("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:c.jsx(BAe,{className:"relative flex-1 rounded-full bg-border"})}));IAe.displayName=BQ.displayName;const uE=({selectedId:e,onSelect:t,label:n})=>{const[r,i]=k.useState(!1),{data:s}=iv(),a=(s||[]).filter(u=>u.media_type==="stock_photo"),o=a.find(u=>u.id===e),l=o?Ac(o.file_path):null;return c.jsxs("div",{className:"space-y-1.5",children:[n&&c.jsx("label",{className:"text-xs font-medium text-muted-foreground block",children:n}),c.jsxs(yM,{open:r,onOpenChange:i,children:[c.jsx(vM,{asChild:!0,children:c.jsx(Be,{variant:"outline",className:pt("relative h-auto min-h-[80px] w-full justify-start p-0 overflow-hidden",!l&&"border-dashed"),children:l?c.jsxs("div",{className:"relative w-full",children:[c.jsx("img",{src:l,alt:(o==null?void 0:o.alt_text)||"Selected",className:"w-full h-24 object-cover"}),c.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:c.jsx(qa,{className:"w-3 h-3"})})]}):c.jsxs("div",{className:"flex flex-col items-center justify-center w-full py-4 text-muted-foreground",children:[c.jsx(g1e,{className:"w-5 h-5 mb-1"}),c.jsx("span",{className:"text-xs",children:"Pick image"})]})})}),c.jsx(sE,{className:"w-80 p-2",align:"start",children:c.jsx(PAe,{className:"h-64",children:a.length===0?c.jsx("p",{className:"text-xs text-muted-foreground text-center py-8",children:"No stock photos uploaded yet."}):c.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:a.map(u=>{const d=Ac(u.file_path),h=u.id===e;return c.jsx("button",{type:"button",className:pt("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:c.jsx("img",{src:d,alt:u.alt_text||u.file_name,className:"w-full h-full object-cover",loading:"lazy"})},u.id)})})})})]})]})},OAe=({category:e})=>{const t=Fhe(),[n,r]=k.useState(e.context||""),[i,s]=k.useState(e.intro_text||""),[a,o]=k.useState(e.faq_json||[]),[l,u]=k.useState(e.faq_title||""),[d,h]=k.useState(e.video_url||""),[f,A]=k.useState(e.video_orientation||"horizontal"),[p,m]=k.useState(e.video_transcript||""),[g,y]=k.useState(e.video_headline||""),[v,x]=k.useState(e.cta_headline||""),[b,w]=k.useState(e.cover_image_id||null),[S,_]=k.useState(e.content_image_ids||[]),[E,j]=k.useState(e.stats_json||[]),[I,T]=k.useState(""),[N,F]=k.useState(!1),[L,D]=k.useState(!1),[H,W]=k.useState(!1),[$,V]=k.useState(null),[Q,ce]=k.useState([]);k.useEffect(()=>{r(e.context||""),s(e.intro_text||""),o(e.faq_json||[]),u(e.faq_title||""),h(e.video_url||""),A(e.video_orientation||"horizontal"),m(e.video_transcript||""),y(e.video_headline||""),x(e.cta_headline||""),w(e.cover_image_id||null),_(e.content_image_ids||[]),j(e.stats_json||[])},[e.id]);const R=i.split(`

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

`).filter(Boolean);let Fe=[];if(Se.length>0)try{const{data:_e,error:Ze}=await Me.functions.invoke("generate-aeo-content",{body:{mode:"generate-section-headings",paragraphs:Se,category_name:e.name,category_context:n||e.context||null}});!Ze&&(_e!=null&&_e.headings)&&(Fe=_e.headings)}catch{}const te=S.slice(0,Se.length).map(_e=>_e||null).filter(_e=>_e!==null);try{await t.mutateAsync({id:e.id,context:n||null,intro_text:i||null,faq_json:a.filter(_e=>_e.question.trim()&&_e.answer.trim()),faq_title:l||null,video_url:d||null,video_orientation:f,video_transcript:p||null,video_headline:g||null,cta_headline:v||null,section_headings:Fe,cover_image_id:b||null,content_image_ids:te,stats_json:E.filter(_e=>_e.label.trim()&&_e.value.trim())}),Xe({title:"Category content saved"})}catch(_e){Xe({title:"Error",description:_e.message,variant:"destructive"})}};return c.jsxs("div",{className:"space-y-6 pt-4 border-t border-border/50 mt-4",children:[c.jsx("div",{children:c.jsx(uE,{selectedId:b,onSelect:w,label:"Cover Image (hero banner)"})}),c.jsxs("div",{children:[c.jsxs("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:["Category Context ",c.jsx("span",{className:"text-muted-foreground/60",children:"(not visible on site — guides AI generation)"})]}),c.jsx(Jl,{value:n,onChange:ie=>r(ie.target.value),placeholder:"Describe what this category is about, who it's for, and what angle to take.",className:"min-h-[80px] text-sm"})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[c.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Category Intro (visible on landing page)"}),c.jsxs(Be,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:L,onClick:async()=>{D(!0);try{const{data:ie,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(ie!=null&&ie.error)throw new Error(ie.error);s(ie.intro_text),Xe({title:"Intro generated!",description:"Review and edit, then save."})}catch(ie){Xe({title:"Generation failed",description:ie.message,variant:"destructive"})}finally{D(!1)}},children:[c.jsx(zs,{className:"w-3 h-3 mr-1"}),L?"Generating...":"Generate with AI"]})]}),c.jsx(Jl,{value:i,onChange:ie=>s(ie.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&&c.jsxs("div",{children:[c.jsxs("label",{className:"text-xs font-medium text-muted-foreground mb-2 block",children:["Content Block Images (",R.length," paragraphs)"]}),c.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:R.map((ie,he)=>c.jsx(uE,{selectedId:S[he]||null,onSelect:ue=>{_(Se=>{const Fe=[...Se];return Fe[he]=ue,Fe})},label:`Block ${he+1}`},he))})]}),c.jsxs("div",{className:"border border-dashed border-border rounded p-4 space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(ere,{className:"w-4 h-4 text-muted-foreground"}),c.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Quick Stats ",c.jsx("span",{className:"text-muted-foreground/60",children:"(shown as stat pills on cards & stats band)"})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(Be,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:H,onClick:async()=>{W(!0);try{const ie=!e.parent_id,{data:he,error:ue}=await Me.functions.invoke("generate-aeo-content",{body:{mode:"generate-neighborhood-stats",community_name:e.name,is_metro:ie}});if(ue)throw ue;if(he!=null&&he.error)throw new Error(he.error);j(he.stats||[]),Xe({title:"Stats generated!",description:"Review and edit, then save."})}catch(ie){Xe({title:"Generation failed",description:ie.message,variant:"destructive"})}finally{W(!1)}},children:[c.jsx(zs,{className:"w-3 h-3 mr-1"}),H?"Looking up…":"Generate Stats"]}),c.jsxs(Be,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>j([...E,{label:"",value:"",icon:"pin"}]),children:[c.jsx(Mp,{className:"w-3 h-3 mr-1"})," Add Manual"]})]})]}),E.map((ie,he)=>c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(St,{value:ie.label,onChange:ue=>{const Se=[...E];Se[he]={...Se[he],label:ue.target.value},j(Se)},placeholder:"Label (e.g. Commute)",className:"text-sm flex-1"}),c.jsx(St,{value:ie.value,onChange:ue=>{const Se=[...E];Se[he]={...Se[he],value:ue.target.value},j(Se)},placeholder:"Value (e.g. 15 min)",className:"text-sm flex-1"}),c.jsxs(Ua,{value:ie.icon||"pin",onValueChange:ue=>{const Se=[...E];Se[he]={...Se[he],icon:ue},j(Se)},children:[c.jsx(ha,{className:"w-[100px] text-sm",children:c.jsx(Da,{})}),c.jsxs(Aa,{children:[c.jsx(kn,{value:"car",children:"🚗 Commute"}),c.jsx(kn,{value:"trees",children:"🌳 Setting"}),c.jsx(kn,{value:"building",children:"🏗️ Build"}),c.jsx(kn,{value:"heart",children:"❤️ Vibe"}),c.jsx(kn,{value:"users",children:"👥 Population"}),c.jsx(kn,{value:"school",children:"🎓 Schools"}),c.jsx(kn,{value:"pin",children:"📍 Location"})]})]}),c.jsx(Be,{variant:"ghost",size:"icon",className:"h-9 w-9 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>j(E.filter((ue,Se)=>Se!==he)),children:c.jsx(yl,{className:"w-3.5 h-3.5"})})]},he)),E.length===0&&c.jsx("p",{className:"text-xs text-muted-foreground",children:"No stats yet. Add stats like commute time, setting, vibe, etc."})]}),c.jsxs("div",{className:"border border-dashed border-border rounded p-4 space-y-3",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx(M1e,{className:"w-4 h-4 text-muted-foreground"}),c.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Category Video ",c.jsx("span",{className:"text-muted-foreground/60",children:"(optional YouTube embed)"})]})]}),c.jsx(St,{value:g,onChange:ie=>y(ie.target.value),placeholder:"Video headline, e.g. Watch: Your Guide to Downsizing in West Michigan",className:"text-sm"}),c.jsxs("div",{className:"flex gap-3",children:[c.jsx(St,{value:d,onChange:ie=>h(ie.target.value),placeholder:"YouTube URL, e.g. https://youtube.com/watch?v=...",className:"text-sm flex-1"}),c.jsxs(Ua,{value:f,onValueChange:A,children:[c.jsx(ha,{className:"w-[140px] text-sm",children:c.jsx(Da,{})}),c.jsxs(Aa,{children:[c.jsx(kn,{value:"horizontal",children:"Horizontal"}),c.jsx(kn,{value:"vertical",children:"Vertical"})]})]})]}),c.jsx(Jl,{value:p,onChange:ie=>m(ie.target.value),placeholder:"Paste the video transcript here (shown in an expandable accordion below the video)",className:"min-h-[80px] text-sm"})]}),c.jsxs("div",{children:[c.jsxs("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:["CTA Section Headline ",c.jsx("span",{className:"text-muted-foreground/60",children:"(bottom of category page)"})]}),c.jsx(St,{value:v,onChange:ie=>x(ie.target.value),placeholder:`e.g. Ready to Start Your ${e.name} Journey?`,className:"text-sm"})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Category FAQ (",a.length," items)"]}),c.jsxs(Be,{variant:"ghost",size:"sm",onClick:M,className:"h-7 text-xs",children:[c.jsx(Mp,{className:"w-3 h-3 mr-1"})," Add Manual"]})]}),c.jsxs("div",{className:"border border-dashed border-border rounded p-3 mb-4 space-y-2",children:[c.jsx("label",{className:"text-xs font-medium text-muted-foreground block",children:"Generate FAQ with AI"}),c.jsx(St,{value:I,onChange:ie=>T(ie.target.value),placeholder:"e.g. Common questions about downsizing in the Grand Rapids market",className:"text-sm",onKeyDown:ie=>ie.key==="Enter"&&!N&&K()}),c.jsxs(Be,{size:"sm",onClick:K,disabled:!I.trim()||N,className:"btn-gold border-0 text-xs",children:[c.jsx(zs,{className:"w-3 h-3 mr-1"}),N?"Generating...":"Generate FAQ"]})]}),$&&c.jsxs("div",{className:"border border-primary/30 bg-primary/5 rounded p-4 mb-4 space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("span",{className:"text-xs font-medium text-primary",children:["Generated ",$.length," FAQ items — review below"]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs(Be,{size:"sm",variant:"outline",onClick:de,className:"h-7 text-xs",children:[c.jsx(qa,{className:"w-3 h-3 mr-1"})," Discard"]}),c.jsxs(Be,{size:"sm",onClick:Z,className:"h-7 text-xs btn-gold border-0",children:[c.jsx(Jc,{className:"w-3 h-3 mr-1"})," Approve & Replace"]})]})]}),$.map((ie,he)=>c.jsxs("div",{className:"border border-border/50 rounded p-3 space-y-1 bg-background",children:[c.jsx("p",{className:"text-sm font-medium",children:ie.question}),c.jsx("p",{className:"text-sm text-muted-foreground",children:ie.answer})]},he))]}),c.jsx("div",{className:"space-y-3",children:a.map((ie,he)=>c.jsxs("div",{className:"border border-border/50 rounded p-3 space-y-2",children:[c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(St,{value:ie.question,onChange:ue=>Y(he,"question",ue.target.value),placeholder:"Question...",className:"text-sm"}),c.jsx(Be,{variant:"ghost",size:"icon",className:"h-9 w-9 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>X(he),children:c.jsx(yl,{className:"w-3.5 h-3.5"})})]}),c.jsx(Jl,{value:ie.answer,onChange:ue=>Y(he,"answer",ue.target.value),placeholder:"Answer...",className:"text-sm min-h-[60px]"})]},he))})]}),c.jsx(hhe,{violations:Q}),c.jsxs(Be,{onClick:se,disabled:t.isPending,size:"sm",children:[c.jsx(wb,{className:"w-3.5 h-3.5 mr-1.5"}),t.isPending?"Saving...":"Save Content"]})]})},Tqe=()=>{const{data:e}=KA(),{configMap:t}=To(),n=Ihe(),r=Zj(),[i,s]=k.useState(""),[a,o]=k.useState(""),[l,u]=k.useState(""),[d,h]=k.useState(""),[f,A]=k.useState(""),[p,m]=k.useState(""),[g,y]=k.useState(null),[v,x]=k.useState(!1),b=(e||[]).find(S=>S.slug==="news"&&S.parent_id!==null),w=async()=>{if(!i.trim()||!a.trim()){Xe({title:"Title and press release content are required",variant:"destructive"});return}if(!b){Xe({title:"News category not found",variant:"destructive"});return}x(!0);try{const S={national:d.trim()||null,local:f.trim()||null,source:p.trim()||null},{data:_,error:E}=await Me.functions.invoke("generate-aeo-content",{body:{mode:"create-press-release",title:i.trim(),press_content:a.trim(),press_links:S,date_published:l||new Date().toISOString().split("T")[0],agent_name:t.agent_name,agent_market:t.agent_market}});if(E)throw E;if(_!=null&&_.error)throw new Error(_.error);const j=_.slug||i.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),I=await n.mutateAsync({category_id:b.id,title:i.trim(),slug:j,h1:_.h1||i.trim(),is_parent:!1,status:"draft",cover_image_id:g});await r.mutateAsync({id:I.id,h1:_.h1,subheadline:_.subheadline,intro_text:_.intro_text,body_content:_.body_content,faq_json:_.faq_json,meta_title:_.meta_title,meta_description:_.meta_description,schema_markup:_.schema_markup,press_links:_.press_links}),Xe({title:"Press release created!",description:`Slug: /about/news/${j} — ready for review in Page Generator.`}),s(""),o(""),u(""),h(""),A(""),m(""),y(null)}catch(S){Xe({title:"Error",description:S.message,variant:"destructive"})}finally{x(!1)}};return c.jsxs("div",{className:"border border-border rounded p-6 space-y-6",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(B1e,{className:"w-5 h-5 text-accent"}),c.jsx("h3",{className:"font-serif text-xl",children:"New Press Release"})]}),c.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."}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-1.5",children:[c.jsx(Sn,{className:"text-xs uppercase tracking-wider",children:"Headline / Title"}),c.jsx(St,{value:i,onChange:S=>s(S.target.value),placeholder:"e.g., Holden Smith Named Top Agent in Grand Rapids for 2026"})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx(Sn,{className:"text-xs uppercase tracking-wider",children:"Date Published"}),c.jsx(St,{type:"date",value:l,onChange:S=>u(S.target.value)})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx(Sn,{className:"text-xs uppercase tracking-wider",children:"Press Release Content"}),c.jsx(Jl,{value:a,onChange:S=>o(S.target.value),placeholder:"Paste the full press release text here...",rows:12,className:"font-mono text-sm"})]}),c.jsxs("div",{className:"border border-border/50 rounded p-4 space-y-3 bg-muted/30",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx(Ka,{className:"w-4 h-4 text-muted-foreground"}),c.jsx("span",{className:"text-sm font-medium",children:"Pickup Links"})]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Where was this press release picked up? Add links to each version."}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx(Sn,{className:"text-xs uppercase tracking-wider",children:"National"}),c.jsx(St,{value:d,onChange:S=>h(S.target.value),placeholder:"https://prnewswire.com/..."})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsx(Sn,{className:"text-xs uppercase tracking-wider",children:"Local"}),c.jsx(St,{value:f,onChange:S=>A(S.target.value),placeholder:"https://localnews.com/..."})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsx(Sn,{className:"text-xs uppercase tracking-wider",children:"Source"}),c.jsx(St,{value:p,onChange:S=>m(S.target.value),placeholder:"https://yourbrokerage.com/..."})]})]})]}),c.jsxs("div",{className:"flex items-end gap-4",children:[c.jsx("div",{className:"w-40",children:c.jsx(uE,{selectedId:g,onSelect:y,label:"Cover Image"})}),c.jsxs(Be,{onClick:w,disabled:!i.trim()||!a.trim()||v,className:"btn-gold border-0",children:[c.jsx(zs,{className:"w-4 h-4 mr-2"}),v?"Processing...":"Create Press Release"]})]})]})]})},Pqe=({categoryId:e})=>{const{data:t}=gc(),n=Zj(),r=Ohe(),i=(t||[]).filter(o=>o.category_id===e).sort((o,l)=>new Date(l.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()}),Xe({title:"Published!",description:`"${o.title}" is now live.`})},a=async o=>{await r.mutateAsync(o),Xe({title:"Press release deleted"})};return c.jsxs("div",{className:"space-y-6 pt-4 border-t border-border/50 mt-4",children:[c.jsx(Tqe,{}),i.length>0&&c.jsxs("div",{className:"space-y-3",children:[c.jsxs("h4",{className:"font-serif text-lg",children:["Press Releases (",i.length,")"]}),c.jsx("div",{className:"space-y-2",children:i.map(o=>c.jsxs("div",{className:"flex items-center justify-between p-3 border border-border rounded",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[c.jsx(cr,{variant:o.status==="published"?"default":"secondary",className:"text-xs capitalize",children:o.status}),c.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(o.created_at).toLocaleDateString()})]}),c.jsx("p",{className:"font-serif text-sm truncate",children:o.title}),o.press_links&&c.jsxs("div",{className:"flex gap-3 mt-1",children:[o.press_links.national&&c.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&&c.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&&c.jsx("a",{href:o.press_links.source,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-accent hover:underline",children:"Source ↗"})]})]}),c.jsxs("div",{className:"flex items-center gap-2 ml-4",children:[o.status==="draft"&&c.jsxs(Be,{size:"sm",onClick:()=>s(o),className:"btn-gold border-0 text-xs",children:[c.jsx(u2,{className:"w-3 h-3 mr-1"})," Publish"]}),c.jsx(Be,{size:"sm",variant:"ghost",onClick:()=>a(o.id),children:c.jsx(yl,{className:"w-3 h-3"})})]})]},o.id))})]})]})},Uw=Rae,Dw=GD,Qw=XD;var s5="Checkbox",[Iqe,Qjt]=qs(s5),[Oqe,NQ]=Iqe(s5);function Fqe(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:s,form:a,name:o,onCheckedChange:l,required:u,value:d="on",internal_do_not_use_render:h}=e,[f,A]=Bo({prop:n,defaultProp:i??!1,onChange:l,caller:s5}),[p,m]=k.useState(null),[g,y]=k.useState(null),v=k.useRef(!1),x=p?!!a||!!p.closest("form"):!0,b={checked:f,disabled:s,setChecked:A,control:p,setControl:m,name:o,form:a,value:d,hasConsumerStoppedPropagationRef:v,required:u,defaultChecked:dA(i)?!1:i,isFormControl:x,bubbleInput:g,setBubbleInput:y};return c.jsx(Oqe,{scope:t,...b,children:Mqe(h)?h(b):r})}var FAe="CheckboxTrigger",MAe=k.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{const{control:s,value:a,disabled:o,checked:l,required:u,setControl:d,setChecked:h,hasConsumerStoppedPropagationRef:f,isFormControl:A,bubbleInput:p}=NQ(FAe,e),m=tn(i,d),g=k.useRef(l);return k.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]),c.jsx(_t.button,{type:"button",role:"checkbox","aria-checked":dA(l)?"mixed":l,"aria-required":u,"data-state":QAe(l),"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=>dA(v)?!0:!v),p&&A&&(f.current=y.isPropagationStopped(),f.current||y.stopPropagation())})})});MAe.displayName=FAe;var jQ=k.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:s,required:a,disabled:o,value:l,onCheckedChange:u,form:d,...h}=e;return c.jsx(Fqe,{__scopeCheckbox:n,checked:i,defaultChecked:s,disabled:o,required:a,onCheckedChange:u,name:r,form:d,value:l,internal_do_not_use_render:({isFormControl:f})=>c.jsxs(c.Fragment,{children:[c.jsx(MAe,{...h,ref:t,__scopeCheckbox:n}),f&&c.jsx(DAe,{__scopeCheckbox:n})]})})});jQ.displayName=s5;var LAe="CheckboxIndicator",RAe=k.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,s=NQ(LAe,n);return c.jsx(ba,{present:r||dA(s.checked)||s.checked===!0,children:c.jsx(_t.span,{"data-state":QAe(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});RAe.displayName=LAe;var UAe="CheckboxBubbleInput",DAe=k.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:s,defaultChecked:a,required:o,disabled:l,name:u,value:d,form:h,bubbleInput:f,setBubbleInput:A}=NQ(UAe,e),p=tn(n,A),m=R6(s),g=WU(r);k.useEffect(()=>{const v=f;if(!v)return;const x=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(x,"checked").set,S=!i.current;if(m!==s&&w){const _=new Event("click",{bubbles:S});v.indeterminate=dA(s),w.call(v,dA(s)?!1:s),v.dispatchEvent(_)}},[f,m,s,i]);const y=k.useRef(dA(s)?!1:s);return c.jsx(_t.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??y.current,required:o,disabled:l,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%)"}})});DAe.displayName=UAe;function Mqe(e){return typeof e=="function"}function dA(e){return e==="indeterminate"}function QAe(e){return dA(e)?"indeterminate":e?"checked":"unchecked"}const TA=k.forwardRef(({className:e,...t},n)=>c.jsx(jQ,{ref:n,className:pt("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:c.jsx(RAe,{className:pt("flex items-center justify-center text-current"),children:c.jsx(Jc,{className:"h-4 w-4"})})}));TA.displayName=jQ.displayName;var TQ="Progress",PQ=100,[Lqe,Hjt]=qs(TQ),[Rqe,Uqe]=Lqe(TQ),HAe=k.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:s=Dqe,...a}=e;(i||i===0)&&!Sq(i)&&console.error(Qqe(`${i}`,"Progress"));const o=Sq(i)?i:PQ;r!==null&&!kq(r,o)&&console.error(Hqe(`${r}`,"Progress"));const l=kq(r,o)?r:null,u=dE(l)?s(l,o):void 0;return c.jsx(Rqe,{scope:n,value:l,max:o,children:c.jsx(_t.div,{"aria-valuemax":o,"aria-valuemin":0,"aria-valuenow":dE(l)?l:void 0,"aria-valuetext":u,role:"progressbar","data-state":VAe(l,o),"data-value":l??void 0,"data-max":o,...a,ref:t})})});HAe.displayName=TQ;var $Ae="ProgressIndicator",zAe=k.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=Uqe($Ae,n);return c.jsx(_t.div,{"data-state":VAe(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});zAe.displayName=$Ae;function Dqe(e,t){return`${Math.round(e/t*100)}%`}function VAe(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function dE(e){return typeof e=="number"}function Sq(e){return dE(e)&&!isNaN(e)&&e>0}function kq(e,t){return dE(e)&&!isNaN(e)&&e<=t&&e>=0}function Qqe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${PQ}\`.`}function Hqe(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 ${PQ} if no \`max\` prop is set)
  - \`null\` or \`undefined\` if the progress is indeterminate.

Defaulting to \`null\`.`}var KAe=HAe,$qe=zAe;const A0=k.forwardRef(({className:e,value:t,...n},r)=>c.jsx(KAe,{ref:r,className:pt("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:c.jsx($qe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));A0.displayName=KAe.displayName;const qAe="aeo-blueprint-suggestions";function nB(){try{return JSON.parse(localStorage.getItem(qAe)||"[]")}catch{return[]}}function rB(e){localStorage.setItem(qAe,JSON.stringify(e)),window.dispatchEvent(new Event("blueprint-suggestions-updated"))}const Bq={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"},WAe=({open:e,onOpenChange:t,siteDomain:n,questions:r,metro:i,state:s,onImported:a})=>{const[o,l]=k.useState("generating"),[u,d]=k.useState(null),[h,f]=k.useState([]),[A,p]=k.useState(0),[m,g]=k.useState(0),[y,v]=k.useState(""),[x,b]=k.useState(new Set),[w,S]=k.useState({}),[_,E]=k.useState(!1),{data:j}=gc(),I="khmmwvmdbhaplcfcndjx",T="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",N=k.useMemo(()=>{const R=new Set;return(j||[]).forEach(M=>R.add(M.title.toLowerCase().trim())),R},[j]),F=R=>N.has(R.toLowerCase().trim());k.useEffect(()=>{e&&r.length>0&&(l("generating"),d(null),f([]),p(0),g(0),v(""),b(new Set),S({}),L())},[e]);const L=async()=>{try{const R=await fetch(`https://${I}.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="",K=null;for(;;){const{done:Z,value:de}=await M.read();if(Z)break;X+=Y.decode(de,{stream:!0});let se;for(;(se=X.indexOf(`

`))!==-1;){const ie=X.slice(0,se).trim();if(X=X.slice(se+2),!ie.startsWith("data: "))continue;const he=ie.slice(6).trim();if(he!=="[DONE]")try{const ue=JSON.parse(he);switch(ue.type){case"status":v(ue.message),ue.total&&g(ue.total);break;case"progress":v(ue.message),p(ue.completed),ue.total&&g(ue.total);break;case"title_complete":f(Se=>[...Se,{original_question:ue.original_question,page_title:ue.page_title,category:ue.category,citability_score:ue.citability_score}]),p(ue.index+1);break;case"filter_complete":v(ue.message);break;case"error":throw new Error(ue.message);case"result":K=ue;break}}catch(ue){if(ue.message&&!ue.message.includes("JSON"))throw ue}}}if(K){d(K);const Z=new Set;K.titles.forEach((de,se)=>{F(de.page_title)||Z.add(se)}),b(Z),l("review")}else throw new Error("No results received")}catch(R){Xe({title:"Blueprint generation failed",description:R.message,variant:"destructive"}),t(!1)}},D=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)||[],$=k.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]),V=()=>{if(!u||$===0)return;E(!0);const R=nB(),M=new Set(R.map(X=>X.page_title.toLowerCase().trim())),Y=[];W.forEach((X,K)=>{if(!x.has(K))return;const Z=w[K]??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})}),rB([...R,...Y]),Xe({title:"Suggestions saved!",description:`Added ${Y.length} title suggestions to the Blueprint tab.`}),E(!1),a(),t(!1)},Q=m>0?Math.round(A/m*100):0,ce=R=>R>=4?"bg-green-500":R>=3?"bg-yellow-500":"bg-orange-500";return c.jsx(qc,{open:e,onOpenChange:t,children:c.jsxs(Zl,{className:"max-w-4xl max-h-[90vh] flex flex-col p-0",children:[c.jsx(ec,{className:"px-6 pt-6 pb-4 border-b",children:c.jsxs(tc,{className:"flex items-center gap-2",children:[c.jsx(zs,{className:"w-5 h-5 text-primary"})," FAQ Page Title Generator"]})}),c.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:[o==="generating"&&c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex flex-col items-center justify-center py-8 space-y-4 max-w-lg mx-auto",children:[c.jsx(ga,{className:"w-10 h-10 animate-spin text-primary"}),c.jsxs("div",{className:"text-center space-y-2 w-full",children:[c.jsx("p",{className:"font-medium",children:"Generating FAQ page titles..."}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:["Analyzing ",r.length," questions one at a time"]}),m>0&&c.jsxs("div",{className:"space-y-1 pt-2",children:[c.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[c.jsxs("span",{children:[A,"/",m," titles"]}),c.jsxs("span",{children:[Q,"%"]})]}),c.jsx(A0,{value:Q,className:"h-3"})]}),y&&c.jsx("p",{className:"text-xs text-muted-foreground truncate pt-1",children:y})]})]}),h.length>0&&c.jsxs("div",{className:"border rounded-lg overflow-hidden",children:[c.jsxs("div",{className:"bg-muted/40 px-3 py-2 text-xs font-medium text-muted-foreground",children:["Titles generated so far (",h.length,")"]}),c.jsx("div",{className:"max-h-64 overflow-y-auto divide-y",children:h.map((R,M)=>c.jsxs("div",{className:"px-3 py-2 flex items-center gap-3 text-sm",children:[c.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${ce(R.citability_score)}`}),c.jsx("span",{className:"text-muted-foreground truncate flex-1",children:R.original_question}),c.jsx(Ma,{className:"w-3 h-3 text-muted-foreground shrink-0"}),c.jsx("span",{className:"font-medium truncate flex-1",children:R.page_title})]},M))})]})]}),o==="review"&&u&&c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"rounded-lg border bg-muted/30 p-4 space-y-1",children:[c.jsxs("p",{className:"font-medium",children:[u.total_titles," FAQ Page Titles Generated"]}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:[u.metro,", ",u.state]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Review and edit titles, then save them as suggestions in the Blueprint tab."})]}),c.jsxs("div",{className:"flex items-center gap-2 px-1",children:[c.jsx(TA,{checked:W.length>0&&W.every((R,M)=>x.has(M)),onCheckedChange:H}),c.jsxs("span",{className:"text-sm text-muted-foreground",children:["Select all (",W.length,")"]}),c.jsxs("span",{className:"text-xs text-muted-foreground ml-auto",children:[x.size," selected"]})]}),c.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),K=Bq[R.category]||Bq.general;return c.jsxs("div",{className:"px-3 py-2.5 flex items-start gap-2.5 hover:bg-muted/20",children:[c.jsx(TA,{checked:x.has(M),onCheckedChange:()=>D(M),className:"mt-1"}),c.jsx(Xy,{className:"w-3.5 h-3.5 text-muted-foreground mt-1.5 shrink-0"}),c.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.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=>S(de=>({...de,[M]:Z.target.value}))}),X&&c.jsx(cr,{variant:"outline",className:"text-[10px] shrink-0 border-amber-400 text-amber-600",children:"Already exists"})]}),c.jsxs("p",{className:"text-[11px] text-muted-foreground truncate",children:["Original: ",R.original_question]})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0 mt-1",children:[c.jsx("span",{className:`inline-block px-1.5 py-0.5 rounded text-[10px] ${K}`,children:R.category}),c.jsx("div",{className:`w-2 h-2 rounded-full ${ce(R.citability_score)}`}),c.jsx("span",{className:"text-xs text-muted-foreground w-6 text-right",children:R.citability_score.toFixed(1)})]})]},M)})})]})]}),o==="review"&&u&&c.jsxs("div",{className:"border-t bg-background px-6 py-4 flex items-center justify-between",children:[c.jsxs("p",{className:"text-sm text-muted-foreground",children:[$," title suggestions to save"]}),c.jsxs(Be,{onClick:V,disabled:$===0||_,children:[_?c.jsx(ga,{className:"w-4 h-4 mr-2 animate-spin"}):c.jsx(Jc,{className:"w-4 h-4 mr-2"}),"Save Suggestions"]})]})]})})},_q=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),zqe=(e,t,n)=>e<t?c.jsxs(cr,{variant:"outline",className:"text-xs border-yellow-500 text-yellow-600",children:["Low (",e,")"]}):e>n?c.jsxs(cr,{variant:"outline",className:"text-xs border-destructive text-destructive",children:["Over (",e,")"]}):c.jsxs(cr,{variant:"outline",className:"text-xs border-green-500 text-green-600",children:["Healthy (",e,")"]}),Vqe=({sub:e,pages:t,onUpdate:n,onDelete:r})=>{const i=t.filter(o=>o.category_id===e.id).length,[s,a]=k.useState(!1);return c.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:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-sm",children:e.icon||"📁"}),c.jsx("span",{className:"font-serif text-sm font-medium",children:e.name}),c.jsx(cr,{variant:"outline",className:"text-xs",children:"Sub"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("span",{className:"text-xs text-muted-foreground",children:[i," page(s)"]}),c.jsx(Be,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>r(e,i),children:c.jsx(yl,{className:"w-3 h-3"})}),c.jsx(cc,{checked:e.enabled,onCheckedChange:o=>n(e.id,{enabled:o})})]})]}),c.jsx(Be,{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"?c.jsx(Pqe,{categoryId:e.id}):c.jsx(OAe,{category:e}))]})},Kqe=({cat:e,allCategories:t,pages:n,onUpdate:r,onDelete:i,isAeo:s,onAddSubcategory:a})=>{const o=n.filter(A=>A.category_id===e.id).length,l=t.filter(A=>A.parent_id===e.id),[u,d]=k.useState(!1),[h,f]=k.useState(!1);return c.jsxs("div",{className:`border rounded p-4 space-y-3 transition-opacity ${e.enabled?"border-border":"border-border/50 opacity-60"}`,children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-lg",children:e.icon||"📄"}),c.jsx("span",{className:"font-serif font-medium",children:e.name})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Be,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:()=>i(e,o),children:c.jsx(yl,{className:"w-3.5 h-3.5"})}),c.jsx(cc,{checked:e.enabled,onCheckedChange:A=>r(e.id,{enabled:A})})]})]}),e.description&&c.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}),s&&c.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[c.jsxs("label",{className:"flex items-center gap-1",children:["Min",c.jsx(St,{type:"number",className:"w-16 h-7 text-xs",value:e.min_pages,onChange:A=>r(e.id,{min_pages:parseInt(A.target.value)||0})})]}),c.jsx("span",{className:"text-muted-foreground",children:"—"}),c.jsxs("label",{className:"flex items-center gap-1",children:["Max",c.jsx(St,{type:"number",className:"w-16 h-7 text-xs",value:e.max_pages,onChange:A=>r(e.id,{max_pages:parseInt(A.target.value)||0})})]}),c.jsx("div",{className:"ml-auto",children:zqe(o,e.min_pages,e.max_pages)})]}),(l.length>0||e.enabled)&&c.jsxs(Uw,{open:h,onOpenChange:f,children:[c.jsx(Dw,{asChild:!0,children:c.jsxs(Be,{variant:"ghost",size:"sm",className:"text-xs w-full justify-start text-muted-foreground hover:text-foreground gap-1",children:[c.jsx(ac,{className:`w-3 h-3 transition-transform ${h?"":"-rotate-90"}`}),"Sub-Categories (",l.length,")"]})}),c.jsxs(Qw,{className:"space-y-2 mt-2",children:[l.map(A=>c.jsx(Vqe,{sub:A,pages:n,onUpdate:r,onDelete:i},A.id)),c.jsxs(Be,{variant:"outline",size:"sm",className:"text-xs ml-4",onClick:()=>a(e.id),children:[c.jsx(Mp,{className:"w-3 h-3 mr-1"})," Add Sub-Category"]})]})]}),c.jsx(Be,{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&&c.jsx(OAe,{category:e})]})},qqe=()=>{var N;const{data:e,isLoading:t}=KA(),{data:n}=gc(),{isAeo:r}=Phe(),i=Fhe(),s=QKe(),a=DKe(),[o,l]=k.useState(""),[u,d]=k.useState(""),[h,f]=k.useState(null),[A,p]=k.useState(null),[m,g]=k.useState(nB);k.useEffect(()=>{const F="aeo-blueprint-suggestions-seeded";if(localStorage.getItem(F))return;if(nB().length>0){localStorage.setItem(F,"1");return}const D=[{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}];rB(D),g(D),localStorage.setItem(F,"1")},[]),k.useEffect(()=>{const F=()=>g(nB());return window.addEventListener("blueprint-suggestions-updated",F),()=>window.removeEventListener("blueprint-suggestions-updated",F)},[]);const y=k.useCallback(F=>{const L=m.filter((D,H)=>H!==F);rB(L),g(L)},[m]),v=k.useCallback(()=>{rB([]),g([])},[]),x=n||[],b=e||[],w=b.filter(F=>!F.parent_id),S=w.filter(F=>F.enabled),_=(F,L)=>{i.mutate({id:F,...L})},E=(F,L)=>{const H=b.filter(W=>W.parent_id===F.id).reduce((W,$)=>W+x.filter(V=>V.category_id===$.id).length,0);p({cat:F,pageCount:L+H})},j=async()=>{if(A){if(A.pageCount>0){Xe({title:"Cannot delete",description:"Please delete or reassign all pages in this category first.",variant:"destructive"}),p(null);return}try{await a.mutateAsync(A.cat.id),Xe({title:`"${A.cat.name}" deleted`})}catch(F){Xe({title:"Error",description:F.message,variant:"destructive"})}p(null)}},I=async()=>{if(o.trim())try{await s.mutateAsync({name:o.trim(),slug:_q(o),icon:"📄"}),Xe({title:"Category created!"}),l("")}catch(F){Xe({title:"Error",description:F.message,variant:"destructive"})}},T=async()=>{if(!(!u.trim()||!h))try{await s.mutateAsync({name:u.trim(),slug:_q(u),icon:"📁",parent_id:h}),Xe({title:"Sub-category created!"}),d(""),f(null)}catch(F){Xe({title:"Error",description:F.message,variant:"destructive"})}};return t?c.jsx("div",{className:"space-y-4",children:Array.from({length:4}).map((F,L)=>c.jsx(Tt,{className:"h-24 w-full"},L))}):c.jsxs("div",{className:"space-y-8",children:[c.jsx("div",{className:"flex items-center gap-6 text-sm",children:r?c.jsxs(c.Fragment,{children:[c.jsxs("span",{children:["Total Pages: ",c.jsx("strong",{children:x.length})," of ",w.reduce((F,L)=>F+L.min_pages,0),"–",w.reduce((F,L)=>F+L.max_pages,0)]}),c.jsxs("span",{children:["Categories Active: ",c.jsx("strong",{children:S.length})," of ",w.length]})]}):c.jsxs("span",{children:["Categories Active: ",c.jsx("strong",{children:S.length})," of ",w.length]})}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:w.map(F=>c.jsx(Kqe,{cat:F,allCategories:b,pages:x,onUpdate:_,onDelete:E,isAeo:r,onAddSubcategory:L=>f(L)},F.id))}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(St,{value:o,onChange:F=>l(F.target.value),placeholder:"New category name...",className:"max-w-xs",onKeyDown:F=>F.key==="Enter"&&I()}),c.jsxs(Be,{variant:"outline",onClick:I,disabled:!o.trim(),children:[c.jsx(Mp,{className:"w-4 h-4 mr-1"})," Add Niche"]})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-serif text-xl mb-4",children:"Page Hierarchy"}),c.jsx("div",{className:"space-y-3",children:w.map(F=>{const L=b.filter(V=>V.parent_id===F.id),D=x.filter(V=>V.category_id===F.id),H=D.filter(V=>V.is_parent),W=D.filter(V=>!V.is_parent&&!V.parent_id),$=D.length+L.reduce((V,Q)=>V+x.filter(ce=>ce.category_id===Q.id).length,0);return c.jsxs("div",{className:"border border-border rounded p-3",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[c.jsx("span",{children:F.icon||"📄"}),c.jsx(Ct,{to:`/${F.slug}`,className:"font-serif font-medium text-sm hover:text-accent transition-colors",children:F.name}),c.jsxs("span",{className:"text-xs text-muted-foreground ml-auto",children:[$," page(s)"]})]}),c.jsxs("div",{className:"ml-4 space-y-1",children:[L.map(V=>{const Q=x.filter(ce=>ce.category_id===V.id);return c.jsxs("div",{className:"mb-2",children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx(oc,{className:"w-3 h-3 text-accent"}),c.jsxs(Ct,{to:`/${F.slug}/${V.slug}`,className:"font-medium hover:text-accent transition-colors",children:[V.icon," ",V.name]}),c.jsx(cr,{variant:"outline",className:"text-xs",children:"Sub"}),c.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:Q.length})]}),Q.map(ce=>c.jsxs("div",{className:"flex items-center gap-2 text-sm ml-6 text-muted-foreground",children:[c.jsx("span",{className:"w-3 h-px bg-border"}),c.jsx(Ct,{to:`/${F.slug}/${V.slug}/${ce.slug}`,className:"hover:text-accent transition-colors",children:ce.title}),c.jsx(_S,{status:ce.status})]},ce.id))]},V.id)}),H.map(V=>{const Q=D.filter(ce=>ce.parent_id===V.id);return c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx(oc,{className:"w-3 h-3 text-muted-foreground"}),c.jsx(Ct,{to:`/${F.slug}/${V.slug}`,className:"font-medium hover:text-accent transition-colors",children:V.title}),c.jsx(_S,{status:V.status})]}),Q.map(ce=>c.jsxs("div",{className:"flex items-center gap-2 text-sm ml-6 text-muted-foreground",children:[c.jsx("span",{className:"w-3 h-px bg-border"}),c.jsx(Ct,{to:`/${F.slug}/${ce.slug}`,className:"hover:text-accent transition-colors",children:ce.title}),c.jsx(_S,{status:ce.status})]},ce.id))]},V.id)}),W.map(V=>c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx(oc,{className:"w-3 h-3 text-muted-foreground"}),c.jsx(Ct,{to:`/${F.slug}/${V.slug}`,className:"hover:text-accent transition-colors",children:V.title}),c.jsx(_S,{status:V.status})]},V.id)),D.length===0&&L.length===0&&c.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&&c.jsxs("div",{className:"border border-dashed border-accent rounded-lg p-4 space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(l7,{className:"w-4 h-4 text-accent"}),c.jsx("h3",{className:"font-serif text-lg font-medium",children:"Suggested Page Titles"}),c.jsx(cr,{variant:"outline",className:"text-xs",children:m.length})]}),c.jsx(Be,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:v,children:"Clear All"})]}),c.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."}),c.jsx("div",{className:"divide-y rounded border bg-background",children:m.map((F,L)=>{const D={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=D[F.category]||D.general;return c.jsxs("div",{className:"px-3 py-2 flex items-center gap-3 text-sm group",children:[c.jsx(l7,{className:"w-3 h-3 text-accent shrink-0"}),c.jsx("span",{className:"font-medium flex-1",children:F.page_title}),c.jsx("span",{className:`inline-block px-1.5 py-0.5 rounded text-[10px] shrink-0 ${H}`,children:F.category}),c.jsx(Be,{variant:"ghost",size:"icon",className:"h-5 w-5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",onClick:()=>y(L),children:c.jsx(qa,{className:"w-3 h-3"})})]},L)})})]}),c.jsx(aE,{open:!!h,onOpenChange:F=>!F&&f(null),children:c.jsxs(Jb,{children:[c.jsxs(Zb,{children:[c.jsx(t1,{children:"Add Sub-Category"}),c.jsxs(n1,{children:["Create a sub-category under ",c.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."]})]}),c.jsx(St,{value:u,onChange:F=>d(F.target.value),placeholder:"Sub-category name (e.g., Waterfront)",onKeyDown:F=>F.key==="Enter"&&T()}),c.jsxs(e1,{children:[c.jsx(r1,{onClick:()=>d(""),children:"Cancel"}),c.jsx(wy,{onClick:T,disabled:!u.trim(),children:"Create Sub-Category"})]})]})}),c.jsx(aE,{open:!!A,onOpenChange:F=>!F&&p(null),children:c.jsxs(Jb,{children:[c.jsxs(Zb,{children:[c.jsx(t1,{children:A!=null&&A.pageCount?"Category Has Pages":`Delete "${A==null?void 0:A.cat.name}"?`}),c.jsx(n1,{children:A!=null&&A.pageCount?c.jsxs(c.Fragment,{children:[c.jsx("strong",{children:A.cat.name})," has ",c.jsxs("strong",{children:[A.pageCount," page(s)"]})," attached. Deleting this category will undo all parent-to-children routing and cross-linking for those pages.",c.jsx("br",{}),c.jsx("br",{}),"You must ",c.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."})]}),c.jsxs(e1,{children:[c.jsx(r1,{children:"Cancel"}),A!=null&&A.pageCount?c.jsx(wy,{onClick:()=>p(null),children:"Understood"}):c.jsx(wy,{onClick:j,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Category"})]})]})})]})},_S=({status:e})=>c.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}),Wqe=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),Gqe=()=>{const{data:e,isLoading:t}=gc(),{data:n}=KA(),{configMap:r}=To(),i=Ihe(),s=Zj(),a=Ohe(),[o,l]=k.useState(null),[u,d]=k.useState(null),[h,f]=k.useState(""),[A,p]=k.useState(""),[m,g]=k.useState(null),[y,v]=k.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)),S=(e||[]).filter(N=>N.status==="published"),_=async()=>{if(!h.trim()||!A){Xe({title:"Enter a question and select a category",variant:"destructive"});return}v(!0);try{const N=(n||[]).find(W=>W.id===A),{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 D=F.slug||Wqe(h),H=await i.mutateAsync({category_id:A,title:h.trim(),slug:D,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}),Xe({title:"Page created & content generated!",description:`Slug: /${N==null?void 0:N.slug}/${D}`}),f(""),p(""),g(null)}catch(N){Xe({title:"Error",description:N.message,variant:"destructive"})}finally{v(!1)}},E=async N=>{var F;l(N.id);try{const{data:L,error:D}=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(D)throw D;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}),Xe({title:"Content generated!",description:`"${N.title}" is ready for review.`})}catch(L){Xe({title:"Generation failed",description:L.message,variant:"destructive"})}finally{l(null)}},j=async N=>{const F=`${N.h1} ${N.intro_text||""} ${N.body_content||""} ${(N.faq_json||[]).map(D=>D.question+" "+D.answer).join(" ")}`,L=jA(F);if(dhe(L)){Xe({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()}),Xe({title:"Published!",description:`"${N.title}" is now live.`})},I=async N=>{await a.mutateAsync(N),Xe({title:"Page deleted"})};if(t)return c.jsx("div",{className:"space-y-4",children:Array.from({length:4}).map((N,F)=>c.jsx(Tt,{className:"h-16 w-full"},F))});const T=({page:N,actions:F})=>{var H;const L=`${N.h1} ${N.intro_text||""} ${N.body_content||""}`,D=N.body_content?jA(L):[];return c.jsxs("div",{className:"flex items-center justify-between p-4 border border-border",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx("span",{className:"text-caption text-accent",children:(H=N.category)==null?void 0:H.name}),N.is_parent&&c.jsx(cr,{variant:"outline",className:"text-xs",children:"Parent"}),c.jsx(cr,{variant:N.status==="published"?"default":"secondary",className:"text-xs capitalize",children:N.status==="draft"&&x(N)?"Ready":N.status}),D.length>0&&c.jsxs("span",{className:"flex items-center gap-1 text-xs text-destructive",children:[c.jsx(Lp,{className:"w-3 h-3"}),D.length," issue(s)"]})]}),c.jsx("p",{className:"font-serif text-sm truncate",children:N.title})]}),c.jsx("div",{className:"flex items-center gap-2 ml-4",children:F})]})};return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{className:"border border-border rounded p-6 space-y-4",children:[c.jsx("h3",{className:"font-serif text-xl",children:"Create New Page"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter a question — it becomes the page title, H1, and drives the AI-generated content."}),c.jsx(St,{value:h,onChange:N=>f(N.target.value),placeholder:"Your Question (e.g., 'What are the best neighborhoods in Austin?')",className:"text-base"}),h&&c.jsx("p",{className:"text-xs text-muted-foreground",children:"The AI will generate an optimized short slug from your question."}),c.jsxs("div",{className:"flex items-start gap-4",children:[c.jsxs("div",{className:"flex-1 space-y-3",children:[c.jsx("div",{className:"flex items-center gap-3",children:c.jsxs(Ua,{value:A,onValueChange:N=>{p(N)},children:[c.jsx(ha,{className:"w-48",children:c.jsx(Da,{placeholder:"Category"})}),c.jsxs(Aa,{children:[(n||[]).filter(N=>!N.parent_id).map(N=>c.jsxs(kn,{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 c.jsxs(kn,{value:N.id,children:["  ↳ ",N.icon," ",N.name," ",F?`(${F.name})`:""]},N.id)})]})]})}),c.jsxs(Be,{onClick:_,disabled:!h.trim()||!A||y,className:"btn-gold border-0",children:[c.jsx(zs,{className:"w-4 h-4 mr-2"}),y?"Generating...":"Generate Unique FAQs"]})]}),c.jsx("div",{className:"w-40",children:c.jsx(uE,{selectedId:m,onSelect:g,label:"Cover Image"})})]})]}),b.length>0&&c.jsxs("div",{children:[c.jsxs("h3",{className:"font-serif text-xl mb-4",children:["Needs Content (",b.length,")"]}),c.jsx("div",{className:"space-y-2",children:b.map(N=>c.jsx(T,{page:N,actions:c.jsxs(c.Fragment,{children:[c.jsxs(Be,{size:"sm",onClick:()=>E(N),disabled:o===N.id,className:"btn-gold border-0 text-xs",children:[c.jsx(zs,{className:"w-3 h-3 mr-1"}),o===N.id?"Generating...":"Generate"]}),c.jsx(Be,{size:"sm",variant:"ghost",onClick:()=>I(N.id),children:c.jsx(yl,{className:"w-3 h-3"})})]})},N.id))})]}),w.length>0&&c.jsxs("div",{children:[c.jsxs("h3",{className:"font-serif text-xl mb-4",children:["Ready for Review (",w.length,")"]}),c.jsx("div",{className:"space-y-2",children:w.map(N=>c.jsx(T,{page:N,actions:c.jsxs(c.Fragment,{children:[c.jsxs(Be,{size:"sm",variant:"outline",onClick:()=>d(N),children:[c.jsx(vb,{className:"w-3 h-3 mr-1"})," Preview"]}),c.jsxs(Be,{size:"sm",onClick:()=>j(N),className:"btn-gold border-0 text-xs",children:[c.jsx(u2,{className:"w-3 h-3 mr-1"})," Publish"]}),c.jsxs(Be,{size:"sm",variant:"outline",onClick:()=>E(N),disabled:o===N.id,className:"text-xs",children:[c.jsx(zs,{className:"w-3 h-3 mr-1"}),o===N.id?"...":"Regenerate"]}),c.jsx(Be,{size:"sm",variant:"ghost",onClick:()=>I(N.id),children:c.jsx(yl,{className:"w-3 h-3"})})]})},N.id))})]}),S.length>0&&c.jsxs("div",{children:[c.jsxs("h3",{className:"font-serif text-xl mb-4",children:["Published (",S.length,")"]}),c.jsx("div",{className:"space-y-2",children:S.map(N=>c.jsx(T,{page:N,actions:c.jsxs(c.Fragment,{children:[c.jsx(MU,{className:"w-4 h-4 text-green-600"}),c.jsx(Be,{size:"sm",variant:"outline",onClick:()=>d(N),children:c.jsx(vb,{className:"w-3 h-3"})})]})},N.id))})]}),(e||[]).length===0&&!h&&c.jsx("p",{className:"text-muted-foreground text-center py-12",children:"No pages yet. Enter a question above to create your first AEO page."}),c.jsx(qc,{open:!!u,onOpenChange:()=>d(null),children:c.jsxs(Zl,{className:"max-w-3xl max-h-[80vh] overflow-y-auto",children:[c.jsx(ec,{children:c.jsx(tc,{className:"font-serif",children:u==null?void 0:u.h1})}),u&&c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"Meta Title:"})," ",u.meta_title]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Meta Desc:"})," ",u.meta_description]})]}),u.intro_text&&c.jsx("p",{className:"text-muted-foreground italic",children:u.intro_text}),u.body_content&&c.jsx("div",{className:"prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:u.body_content}}),u.faq_json&&u.faq_json.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"font-serif font-medium mb-2",children:"FAQ"}),u.faq_json.map((N,F)=>c.jsxs("div",{className:"mb-3",children:[c.jsx("p",{className:"font-medium text-sm",children:N.question}),c.jsx("p",{className:"text-sm text-muted-foreground",children:N.answer})]},F))]}),c.jsxs("div",{className:"border-t border-border pt-4 space-y-3",children:[c.jsx("h4",{className:"font-serif font-medium",children:"YouTube Video (optional)"}),c.jsxs("div",{className:"flex gap-3",children:[c.jsx(St,{value:u.video_url||"",onChange:N=>d({...u,video_url:N.target.value}),placeholder:"https://www.youtube.com/watch?v=...",className:"flex-1"}),c.jsxs(Ua,{value:u.video_orientation||"horizontal",onValueChange:N=>d({...u,video_orientation:N}),children:[c.jsx(ha,{className:"w-[140px] text-sm",children:c.jsx(Da,{})}),c.jsxs(Aa,{children:[c.jsx(kn,{value:"horizontal",children:"Horizontal"}),c.jsx(kn,{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?c.jsx("div",{className:`relative overflow-hidden rounded-lg mx-auto ${L?"max-w-sm aspect-[9/16]":"w-full aspect-video"}`,children:c.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})(),c.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"}),c.jsx(Be,{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"}),Xe({title:"Video fields saved!"})}catch(N){Xe({title:"Error saving",description:N.message,variant:"destructive"})}},children:"Save Video Fields"})]})]})]})})]})},Yqe=()=>{const[e,t]=k.useState([]),[n,r]=k.useState([]),[i,s]=k.useState(!1),[a,o]=k.useState(!1),[l,u]=k.useState(null),{data:d}=gc(),h=Zj(),f=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&&Xe({title:"No cannibalization issues found!"})}catch(g){Xe({title:"Scan failed",description:g.message,variant:"destructive"})}finally{s(!1)}},A=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}),Xe({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){Xe({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(E=>E.question),{data:w,error:S}=await Me.functions.invoke("generate-aeo-content",{body:{mode:"replace-faq",existing_questions:b,page_topic:x.title}});if(S)throw S;if(w!=null&&w.error)throw new Error(w.error);const _=[...x.faq_json];_[y]={question:w.question,answer:w.answer},await h.mutateAsync({id:g,faq_json:_}),Xe({title:"FAQ replaced with new unique question!"}),r(E=>E.filter((j,I)=>I!==v))}catch(b){Xe({title:"Replace failed",description:b.message,variant:"destructive"})}finally{u(null)}}},m=a&&!i&&e.length===0&&n.length===0;return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"font-serif text-xl mb-2",children:"Duplicate Question Scanner"}),c.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."}),c.jsxs(Be,{onClick:f,disabled:i,className:"btn-gold border-0",children:[c.jsx(YN,{className:"w-4 h-4 mr-2"}),i?"Scanning...":"Scan for Duplicates"]})]}),i&&c.jsx("div",{className:"space-y-3",children:Array.from({length:3}).map((g,y)=>c.jsx(Tt,{className:"h-16 w-full"},y))}),m&&c.jsxs("div",{className:"flex items-center gap-3 p-6 border border-green-200 bg-green-50",children:[c.jsx(MU,{className:"w-5 h-5 text-green-600"}),c.jsx("p",{className:"text-sm text-green-800",children:"No cannibalization issues detected. Your content is well-differentiated!"})]}),e.length>0&&c.jsxs("div",{className:"space-y-3",children:[c.jsx("h4",{className:"font-serif text-lg",children:"Page-Level Overlap"}),e.map((g,y)=>c.jsx("div",{className:"p-4 border border-border",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(Lp,{className:`w-4 h-4 mt-0.5 ${g.similarity>60?"text-destructive":"text-yellow-500"}`}),c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"flex items-center gap-2 mb-1",children:c.jsxs("span",{className:"font-medium text-sm",children:[g.similarity,"% overlap"]})}),c.jsxs("p",{className:"text-sm text-muted-foreground mb-1",children:[c.jsxs("strong",{children:['"',g.page_a.title,'"']})," vs ",c.jsxs("strong",{children:['"',g.page_b.title,'"']})]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:g.recommendation})]})]})},y))]}),n.length>0&&c.jsxs("div",{className:"space-y-3",children:[c.jsx("h4",{className:"font-serif text-lg",children:"FAQ-Level Duplicates"}),n.map((g,y)=>c.jsxs("div",{className:"p-4 border border-border space-y-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Lp,{className:"w-4 h-4 text-yellow-500"}),c.jsxs("span",{className:"font-medium text-sm",children:[g.similarity,"% similar"]})]}),c.jsxs("div",{className:"flex items-start justify-between gap-3 pl-4 border-l-2 border-border",children:[c.jsxs("div",{className:"flex-1",children:[c.jsxs("p",{className:"text-xs text-muted-foreground mb-1",children:["On: ",g.faq_a.page_title]}),c.jsxs("p",{className:"text-sm font-medium",children:['"',g.faq_a.question,'"']})]}),c.jsxs("div",{className:"flex gap-1 shrink-0",children:[c.jsx(Be,{variant:"ghost",size:"sm",onClick:()=>A(g.faq_a.page_id,g.faq_a.question_index),children:c.jsx(yl,{className:"w-3.5 h-3.5"})}),c.jsx(Be,{variant:"ghost",size:"sm",disabled:l===y,onClick:()=>p(g.faq_a.page_id,g.faq_a.question_index,y),children:c.jsx(Vc,{className:`w-3.5 h-3.5 ${l===y?"animate-spin":""}`})})]})]}),c.jsxs("div",{className:"flex items-start justify-between gap-3 pl-4 border-l-2 border-border",children:[c.jsxs("div",{className:"flex-1",children:[c.jsxs("p",{className:"text-xs text-muted-foreground mb-1",children:["On: ",g.faq_b.page_title]}),c.jsxs("p",{className:"text-sm font-medium",children:['"',g.faq_b.question,'"']})]}),c.jsxs("div",{className:"flex gap-1 shrink-0",children:[c.jsx(Be,{variant:"ghost",size:"sm",onClick:()=>A(g.faq_b.page_id,g.faq_b.question_index),children:c.jsx(yl,{className:"w-3.5 h-3.5"})}),c.jsx(Be,{variant:"ghost",size:"sm",disabled:l===y,onClick:()=>p(g.faq_b.page_id,g.faq_b.question_index,y),children:c.jsx(Vc,{className:`w-3.5 h-3.5 ${l===y?"animate-spin":""}`})})]})]})]},y))]})]})},Xqe=()=>c.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[c.jsx(l1e,{className:"w-12 h-12 text-muted-foreground/40 mb-4"}),c.jsx("h3",{className:"font-serif text-xl mb-2",children:"Backups Coming Soon"}),c.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."})]}),Eq=[{value:"all",label:"All"},{value:"logo",label:"Logos & Branding"},{value:"stock_photo",label:"Stock Photos"},{value:"headshot",label:"Agent Headshots"}],Jqe=[{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"}],Zqe=["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"],eWe=7,tWe=7,nWe=3,Nq=({selectedTags:e,onToggle:t,categorySlugs:n})=>{const[r,i]=k.useState("");return c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Usage"}),c.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:Jqe.map(s=>{const a=e.includes(s.value);return c.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&&c.jsx(Jc,{className:"w-2.5 h-2.5"}),s.label]},s.value)})})]}),n.length>0&&c.jsxs("div",{children:[c.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Category"}),c.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:n.map(s=>{const a=e.includes(s);return c.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&&c.jsx(Jc,{className:"w-2.5 h-2.5"}),s]},s)})})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Scene"}),c.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:Zqe.map(s=>{const a=e.includes(s);return c.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&&c.jsx(Jc,{className:"w-2.5 h-2.5"}),s]},s)})})]}),c.jsxs("div",{className:"flex gap-1",children:[c.jsx(St,{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(""))}}}),c.jsx(Be,{variant:"ghost",size:"sm",className:"h-7 px-2",disabled:!r.trim(),onClick:()=>{const s=r.trim().toLowerCase();s&&(t(s),i(""))},children:c.jsx(Mp,{className:"w-3 h-3"})})]})]})},rWe=({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 l=a>=o;return c.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 rounded border text-xs ${l?"border-green-500/30 bg-green-500/5 text-green-700":"border-amber-500/30 bg-amber-500/5 text-amber-700"}`,children:[l?c.jsx(z0,{className:"w-3.5 h-3.5"}):c.jsx(Lp,{className:"w-3.5 h-3.5"}),c.jsxs("span",{className:"font-medium",children:[s,":"]}),c.jsxs("span",{children:[a,"/",o]}),!l&&c.jsxs("span",{className:"text-[10px] opacity-70",children:["(",o-a," more needed)"]})]})};return c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(i,{label:"Cover images",count:t,min:eWe}),c.jsx(i,{label:"Content blocks",count:n,min:tWe}),c.jsx(i,{label:"Agent headshots",count:r,min:nWe})]})},iWe=()=>{const[e,t]=k.useState("all"),[n,r]=k.useState(""),{data:i,isLoading:s}=iv(e==="all"?void 0:e),{data:a}=KA(),o=(a||[]).filter(H=>H.slug!=="about").map(H=>H.slug),l=j4e(),u=P4e(),d=T4e(),h=k.useRef(null),[f,A]=k.useState("stock_photo"),[p,m]=k.useState([]),[g,y]=k.useState(!1),[v,x]=k.useState(null),[b,w]=k.useState([]),[S,_]=k.useState(""),[E,j]=k.useState(null),I=(i||[]).filter(H=>n?H.tags.some(W=>W.toLowerCase().includes(n.toLowerCase())):!0),T=(H,W)=>{W==="upload"?m($=>$.includes(H)?$.filter(V=>V!==H):[...$,H]):w($=>$.includes(H)?$.filter(V=>V!==H):[...$,H])},N=async H=>{const W=H.target.files;if(!W||W.length===0)return;y(!0);let $=0;for(const V of Array.from(W))try{await l.mutateAsync({file:V,tags:p,mediaType:f}),$++}catch(Q){Xe({title:`Failed to upload ${V.name}`,description:Q.message,variant:"destructive"})}$>0&&Xe({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:S}),Xe({title:"Updated"}),x(null)}catch(W){Xe({title:"Error",description:W.message,variant:"destructive"})}},L=async()=>{if(E){try{await u.mutateAsync({id:E.id,filePath:E.filePath}),Xe({title:`"${E.name}" deleted`})}catch(H){Xe({title:"Error",description:H.message,variant:"destructive"})}j(null)}},D=[...new Set((i||[]).flatMap(H=>H.tags))].sort();return c.jsxs("div",{className:"space-y-8",children:[(i||[]).length>0&&c.jsx(rWe,{media:i||[]}),c.jsxs("div",{className:"border border-dashed border-border rounded-lg p-6 space-y-4",children:[c.jsx("h3",{className:"font-serif text-xl",children:"Upload Media"}),c.jsx("div",{className:"flex flex-wrap items-center gap-3",children:c.jsx("div",{className:"flex gap-2",children:Eq.filter(H=>H.value!=="all").map(H=>c.jsx(Be,{variant:f===H.value?"default":"outline",size:"sm",onClick:()=>A(H.value),className:"text-xs",children:H.label},H.value))})}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Tags (applied to all uploads in this batch)"}),p.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:p.map(H=>c.jsxs(cr,{variant:"secondary",className:"text-xs gap-1",children:[H,c.jsx("button",{onClick:()=>T(H,"upload"),children:c.jsx(qa,{className:"w-2.5 h-2.5"})})]},H))}),c.jsx(Nq,{selectedTags:p,onToggle:H=>T(H,"upload"),categorySlugs:o})]}),c.jsx("input",{ref:h,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:N}),c.jsxs(Be,{onClick:()=>{var H;return(H=h.current)==null?void 0:H.click()},disabled:g,className:"btn-gold border-0",children:[c.jsx(pre,{className:"w-4 h-4 mr-2"}),g?"Uploading...":"Choose Files"]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[c.jsx("div",{className:"flex gap-1",children:Eq.map(H=>c.jsx(Be,{variant:e===H.value?"default":"ghost",size:"sm",onClick:()=>t(H.value),className:"text-xs",children:H.label},H.value))}),c.jsx(St,{value:n,onChange:H=>r(H.target.value),placeholder:"Filter by tag...",className:"max-w-[200px] h-8 text-xs"}),D.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1",children:D.slice(0,8).map(H=>c.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))}),c.jsxs("span",{className:"text-xs text-muted-foreground ml-auto",children:[I.length," item(s)"]})]}),s?c.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)=>c.jsx(Tt,{className:"aspect-square rounded"},W))}):I.length===0?c.jsxs("div",{className:"text-center py-16 text-muted-foreground",children:[c.jsx(LU,{className:"w-10 h-10 mx-auto mb-3 opacity-40"}),c.jsx("p",{className:"text-sm",children:"No media yet. Upload images above to build your library."})]}):c.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-3",children:I.map(H=>{const W=v===H.id;return c.jsxs("div",{className:"group relative border border-border rounded overflow-hidden bg-muted/30",children:[c.jsx("div",{className:"aspect-square",children:c.jsx("img",{src:Ac(H.file_path),alt:H.alt_text||H.file_name,className:"w-full h-full object-cover",loading:"lazy"})}),c.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/50 transition-colors flex items-end",children:c.jsx("div",{className:"w-full p-2 opacity-0 group-hover:opacity-100 transition-opacity",children:c.jsxs("div",{className:"flex gap-1",children:[c.jsxs(Be,{size:"sm",variant:"secondary",className:"h-6 text-[10px] flex-1",onClick:()=>{x(H.id),w([...H.tags]),_(H.alt_text||"")},children:[c.jsx(XN,{className:"w-2.5 h-2.5 mr-0.5"})," Edit"]}),c.jsx(Be,{size:"sm",variant:"destructive",className:"h-6 text-[10px] px-2",onClick:()=>j({id:H.id,filePath:H.file_path,name:H.file_name}),children:c.jsx(yl,{className:"w-2.5 h-2.5"})})]})})}),c.jsx("div",{className:"absolute top-1 left-1",children:c.jsx(cr,{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&&c.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($=>c.jsx(cr,{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&&c.jsxs(cr,{variant:"outline",className:"text-[8px] px-1 py-0 bg-background/80 backdrop-blur-sm",children:["+",H.tags.length-2]})]}),W&&c.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:[c.jsx(St,{value:S,onChange:$=>_($.target.value),placeholder:"Alt text...",className:"text-xs h-7"}),b.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1",children:b.map($=>c.jsxs(cr,{variant:"secondary",className:"text-[9px] gap-0.5",children:[$,c.jsx("button",{onClick:()=>T($,"edit"),children:c.jsx(qa,{className:"w-2 h-2"})})]},$))}),c.jsx(Nq,{selectedTags:b,onToggle:$=>T($,"edit"),categorySlugs:o}),c.jsxs("div",{className:"flex gap-1 mt-auto pt-2",children:[c.jsx(Be,{size:"sm",className:"h-6 text-[10px] flex-1",onClick:()=>F(H.id),children:"Save"}),c.jsx(Be,{size:"sm",variant:"ghost",className:"h-6 text-[10px]",onClick:()=>x(null),children:"Cancel"})]})]})]},H.id)})}),c.jsx(aE,{open:!!E,onOpenChange:H=>!H&&j(null),children:c.jsxs(Jb,{children:[c.jsxs(Zb,{children:[c.jsxs(t1,{children:['Delete "',E==null?void 0:E.name,'"?']}),c.jsx(n1,{children:"This will permanently remove the file from storage. This action cannot be undone."})]}),c.jsxs(e1,{children:[c.jsx(r1,{children:"Cancel"}),c.jsx(wy,{onClick:L,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})};function IQ(){return dr({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 sWe(){const e=Zi();return Cs({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 GAe(){const{data:e}=KA(),{data:t}=gc();To();const{data:n}=IQ();return k.useMemo(()=>{const r=e||[],i=t||[],s=i.filter(S=>S.status==="published"),a=n||[],o=r.reduce((S,_)=>S+(_.min_pages||0),0),l=o>0?Math.min(100,i.length/o*100):100,u=s.filter(S=>S.schema_markup),d=s.length>0?u.length/s.length*100:100;let h=0;for(const S of s){const _=[S.intro_text,S.body_content,...Array.isArray(S.faq_json)?S.faq_json.map(E=>`${E.question} ${E.answer}`):[]].filter(Boolean).join(" ");h+=jA(_).filter(E=>E.severity==="critical").length}const f=Math.max(0,100-h*10),A=100,p=r.filter(S=>S.cover_image_id&&(S.content_image_ids||[]).length>0),m=r.length>0?p.length/r.length*100:100,g=i.filter(S=>S.meta_title&&S.meta_description),y=i.length>0?g.length/i.length*100:100,v=a.filter(S=>S.google_indexed||S.bing_indexed),x=s.length>0?v.length/s.length*100:0,b=[{label:"Pages",weight:15,score:l},{label:"Schema",weight:25,score:d},{label:"Fair Housing",weight:15,score:f},{label:"Cannibalization",weight:10,score:A},{label:"Images",weight:10,score:m},{label:"Meta",weight:15,score:y},{label:"Indexing",weight:10,score:x}],w=b.reduce((S,_)=>S+_.score*_.weight/100,0);return{total:Math.round(w),factors:b}},[e,t,n])}const aWe=()=>{const{total:e,factors:t}=GAe(),n=e>=75?"text-green-600":e>=50?"text-yellow-600":"text-destructive";return c.jsx(tD,{children:c.jsxs("div",{className:"border rounded-lg p-6 space-y-4 bg-card",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-sm font-medium uppercase tracking-wider text-muted-foreground",children:"Site Readiness Score"}),c.jsxs("span",{className:`text-3xl font-bold ${n}`,children:[e,c.jsx("span",{className:"text-lg text-muted-foreground",children:"/100"})]})]}),c.jsx(A0,{value:e,className:"h-3"}),c.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 lg:grid-cols-7 gap-3",children:t.map(r=>c.jsxs(nD,{children:[c.jsx(rD,{asChild:!0,children:c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[c.jsx("span",{children:r.label}),c.jsxs("span",{children:[Math.round(r.score),"%"]})]}),c.jsx(A0,{value:r.score,className:"h-1.5"})]})}),c.jsx(sj,{children:c.jsxs("p",{children:[r.label,": ",Math.round(r.score),"% (weight ",r.weight,"%)"]})})]},r.label))})]})})};function oWe(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=jA(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 lWe(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=jA(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 cWe(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 WI=({type:e,category:t,page:n,pages:r,staticPageName:i,configMap:s})=>{let a=[];e==="category"&&t&&r?a=oWe(t,r):e==="subpage"&&n?a=lWe(n):e==="static"&&i&&s&&(a=cWe(i,s));const o=a.filter(d=>d.passed).length,l=a.length,u=l>0?Math.round(o/l*100):0;return c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[c.jsxs("span",{children:[o,"/",l," checks passed"]}),c.jsxs("span",{className:u===100?"text-green-600 font-medium":u>=60?"text-yellow-600":"text-destructive font-medium",children:[u,"%"]})]}),c.jsx("div",{className:"space-y-1",children:a.map((d,h)=>c.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[d.passed?c.jsx(z0,{className:"w-4 h-4 text-green-500 mt-0.5 shrink-0"}):c.jsx(c2,{className:"w-4 h-4 text-destructive mt-0.5 shrink-0"}),c.jsxs("div",{children:[c.jsx("span",{className:d.passed?"text-muted-foreground":"text-foreground",children:d.label}),!d.passed&&c.jsx("p",{className:"text-xs text-muted-foreground",children:d.fix})]})]},h))})]})};function uWe(){return dr({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 dWe(){const e=Zi();return Cs({mutationFn:async t=>{const{error:n}=await Me.from("site_wins").insert(t);if(n)throw n},onSuccess:()=>e.invalidateQueries({queryKey:["site-wins"]})})}const hWe=()=>{const{data:e}=gc(),{data:t}=IQ(),n=sWe(),r=dWe(),[i,s]=k.useState({}),a=e||[],o=(t||[]).reduce((A,p)=>(A[p.page_id]=p,A),{}),l=(A,p)=>{var m;return i[A]&&p in i[A]?i[A][p]:((m=o[A])==null?void 0:m[p])??(p==="notes"?"":!1)},u=(A,p,m)=>{s(g=>({...g,[A]:{...g[A],[p]:m}}))},d=async(A,p,m)=>{const g=o[A],y=i[A]||{};try{await n.mutateAsync({page_id:A,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[A],x}),yw.success("Saved")}catch{yw.error("Failed to save")}},f=[...[{id:"static-home",title:"Home",path:"/"},{id:"static-about",title:"About",path:"/about"},{id:"static-contact",title:"Contact",path:"/contact"}].map(A=>({id:A.id,title:A.title,path:A.path,status:"published"})),...a.map(A=>{var p;return{id:A.id,title:A.title,path:`/${((p=A.category)==null?void 0:p.slug)||"page"}/${A.slug}`,status:A.status}})];return c.jsxs("div",{className:"space-y-4",children:[c.jsx("h3",{className:"text-sm font-medium uppercase tracking-wider text-muted-foreground",children:"Indexing Tracker"}),c.jsx("div",{className:"border rounded-lg overflow-hidden",children:c.jsxs(F6,{children:[c.jsx(M6,{children:c.jsxs(my,{children:[c.jsx(Ta,{className:"w-[200px]",children:"Page"}),c.jsx(Ta,{className:"w-[80px]",children:"Status"}),c.jsx(Ta,{className:"w-[80px] text-center",children:"Google"}),c.jsx(Ta,{className:"w-[80px] text-center",children:"Bing"}),c.jsx(Ta,{className:"w-[80px] text-center",children:"Rich"}),c.jsx(Ta,{className:"w-[140px]",children:"First Indexed"}),c.jsx(Ta,{children:"Notes"}),c.jsx(Ta,{className:"w-[60px]"})]})}),c.jsx(L6,{children:f.map(A=>c.jsxs(my,{children:[c.jsx(oa,{children:c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-sm",children:A.title}),c.jsx("p",{className:"text-xs text-muted-foreground",children:A.path})]})}),c.jsx(oa,{children:c.jsx("span",{className:`text-xs uppercase tracking-wider ${A.status==="published"?"text-green-600":"text-muted-foreground"}`,children:A.status})}),c.jsx(oa,{className:"text-center",children:c.jsx(cc,{checked:!!l(A.id,"google_indexed"),onCheckedChange:p=>u(A.id,"google_indexed",p)})}),c.jsx(oa,{className:"text-center",children:c.jsx(cc,{checked:!!l(A.id,"bing_indexed"),onCheckedChange:p=>u(A.id,"bing_indexed",p)})}),c.jsx(oa,{className:"text-center",children:c.jsx(cc,{checked:!!l(A.id,"rich_results"),onCheckedChange:p=>u(A.id,"rich_results",p)})}),c.jsx(oa,{children:c.jsx(St,{type:"date",className:"h-8 text-xs",value:(l(A.id,"first_indexed_at")||"").slice(0,10),onChange:p=>u(A.id,"first_indexed_at",p.target.value?new Date(p.target.value).toISOString():null)})}),c.jsx(oa,{children:c.jsx(Jl,{className:"h-8 min-h-[2rem] text-xs resize-none",placeholder:"Notes...",value:l(A.id,"notes")||"",onChange:p=>u(A.id,"notes",p.target.value)})}),c.jsx(oa,{children:i[A.id]&&c.jsx(Be,{size:"icon",variant:"ghost",onClick:()=>d(A.id,A.path,A.title),children:c.jsx(wb,{className:"w-4 h-4"})})})]},A.id))})]})})]})};function qn(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 md(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function AWe(e,t){const n=qn(e);return isNaN(t)?md(e,NaN):(n.setDate(n.getDate()+t),n)}const YAe=6048e5,fWe=864e5,ES=43200,jq=1440;let pWe={};function E2(){return pWe}function i1(e,t){var o,l,u,d;const n=E2(),r=(t==null?void 0:t.weekStartsOn)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,i=qn(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 hE(e){return i1(e,{weekStartsOn:1})}function XAe(e){const t=qn(e),n=t.getFullYear(),r=md(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=hE(r),s=md(e,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const a=hE(s);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function Tq(e){const t=qn(e);return t.setHours(0,0,0,0),t}function AE(e){const t=qn(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 mWe(e,t){const n=Tq(e),r=Tq(t),i=+n-AE(n),s=+r-AE(r);return Math.round((i-s)/fWe)}function gWe(e){const t=XAe(e),n=md(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),hE(n)}function iB(e,t){const n=qn(e),r=qn(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function yWe(e){return md(e,Date.now())}function vWe(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function xWe(e){if(!vWe(e)&&typeof e!="number")return!1;const t=qn(e);return!isNaN(Number(t))}function wWe(e,t){const n=qn(e),r=qn(t),i=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return i*12+s}function bWe(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function CWe(e,t){return+qn(e)-+qn(t)}function SWe(e){const t=qn(e);return t.setHours(23,59,59,999),t}function kWe(e){const t=qn(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function BWe(e){const t=qn(e);return+SWe(t)==+kWe(t)}function _We(e,t){const n=qn(e),r=qn(t),i=iB(n,r),s=Math.abs(wWe(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=iB(n,r)===-i;BWe(qn(e))&&s===1&&iB(e,r)===1&&(o=!1),a=i*(s-Number(o))}return a===0?0:a}function EWe(e,t,n){const r=CWe(e,t)/1e3;return bWe(n==null?void 0:n.roundingMethod)(r)}function NWe(e){const t=qn(e),n=md(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const jWe={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"}},TWe=(e,t,n)=>{let r;const i=jWe[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 GI(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const PWe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},IWe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},OWe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},FWe={date:GI({formats:PWe,defaultWidth:"full"}),time:GI({formats:IWe,defaultWidth:"full"}),dateTime:GI({formats:OWe,defaultWidth:"full"})},MWe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},LWe=(e,t,n,r)=>MWe[e];function mx(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 RWe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},UWe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},DWe={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"]},QWe={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"]},HWe={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"}},$We={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"}},zWe=(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"},VWe={ordinalNumber:zWe,era:mx({values:RWe,defaultWidth:"wide"}),quarter:mx({values:UWe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:mx({values:DWe,defaultWidth:"wide"}),day:mx({values:QWe,defaultWidth:"wide"}),dayPeriod:mx({values:HWe,defaultWidth:"wide",formattingValues:$We,defaultFormattingWidth:"wide"})};function gx(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],l=Array.isArray(o)?qWe(o,h=>h.test(a)):KWe(o,h=>h.test(a));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const d=t.slice(a.length);return{value:u,rest:d}}}function KWe(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function qWe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function WWe(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 GWe=/^(\d+)(th|st|nd|rd)?/i,YWe=/\d+/i,XWe={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},JWe={any:[/^b/i,/^(a|c)/i]},ZWe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},eGe={any:[/1/i,/2/i,/3/i,/4/i]},tGe={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},nGe={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]},rGe={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},iGe={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]},sGe={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},aGe={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}},oGe={ordinalNumber:WWe({matchPattern:GWe,parsePattern:YWe,valueCallback:e=>parseInt(e,10)}),era:gx({matchPatterns:XWe,defaultMatchWidth:"wide",parsePatterns:JWe,defaultParseWidth:"any"}),quarter:gx({matchPatterns:ZWe,defaultMatchWidth:"wide",parsePatterns:eGe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:gx({matchPatterns:tGe,defaultMatchWidth:"wide",parsePatterns:nGe,defaultParseWidth:"any"}),day:gx({matchPatterns:rGe,defaultMatchWidth:"wide",parsePatterns:iGe,defaultParseWidth:"any"}),dayPeriod:gx({matchPatterns:sGe,defaultMatchWidth:"any",parsePatterns:aGe,defaultParseWidth:"any"})},JAe={code:"en-US",formatDistance:TWe,formatLong:FWe,formatRelative:LWe,localize:VWe,match:oGe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function lGe(e){const t=qn(e);return mWe(t,NWe(t))+1}function cGe(e){const t=qn(e),n=+hE(t)-+gWe(t);return Math.round(n/YAe)+1}function ZAe(e,t){var d,h,f,A;const n=qn(e),r=n.getFullYear(),i=E2(),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??((A=(f=i.locale)==null?void 0:f.options)==null?void 0:A.firstWeekContainsDate)??1,a=md(e,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const o=i1(a,t),l=md(e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=i1(l,t);return n.getTime()>=o.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function uGe(e,t){var o,l,u,d;const n=E2(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,i=ZAe(e,t),s=md(e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),i1(s,t)}function dGe(e,t){const n=qn(e),r=+i1(n,t)-+uGe(n,t);return Math.round(r/YAe)+1}function Dn(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Zd={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Dn(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Dn(n+1,2)},d(e,t){return Dn(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 Dn(e.getHours()%12||12,t.length)},H(e,t){return Dn(e.getHours(),t.length)},m(e,t){return Dn(e.getMinutes(),t.length)},s(e,t){return Dn(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Dn(i,t.length)}},ng={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Pq={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 Zd.y(e,t)},Y:function(e,t,n,r){const i=ZAe(e,r),s=i>0?i:1-i;if(t==="YY"){const a=s%100;return Dn(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Dn(s,t.length)},R:function(e,t){const n=XAe(e);return Dn(n,t.length)},u:function(e,t){const n=e.getFullYear();return Dn(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 Dn(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 Dn(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 Zd.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 Dn(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=dGe(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Dn(i,t.length)},I:function(e,t,n){const r=cGe(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Dn(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Zd.d(e,t)},D:function(e,t,n){const r=lGe(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Dn(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 Dn(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 Dn(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 Dn(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=ng.noon:r===0?i=ng.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=ng.evening:r>=12?i=ng.afternoon:r>=4?i=ng.morning:i=ng.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 Zd.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Zd.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Dn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Dn(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Zd.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Zd.s(e,t)},S:function(e,t){return Zd.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Oq(r);case"XXXX":case"XX":return jf(r);case"XXXXX":case"XXX":default:return jf(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Oq(r);case"xxxx":case"xx":return jf(r);case"xxxxx":case"xxx":default:return jf(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Iq(r,":");case"OOOO":default:return"GMT"+jf(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Iq(r,":");case"zzzz":default:return"GMT"+jf(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Dn(r,t.length)},T:function(e,t,n){const r=e.getTime();return Dn(r,t.length)}};function Iq(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+Dn(s,2)}function Oq(e,t){return e%60===0?(e>0?"-":"+")+Dn(Math.abs(e)/60,2):jf(e,t)}function jf(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Dn(Math.trunc(r/60),2),s=Dn(r%60,2);return n+i+t+s}const Fq=(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"})}},efe=(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"})}},hGe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Fq(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}}",Fq(r,t)).replace("{{time}}",efe(i,t))},AGe={p:efe,P:hGe},fGe=/^D+$/,pGe=/^Y+$/,mGe=["D","DD","YY","YYYY"];function gGe(e){return fGe.test(e)}function yGe(e){return pGe.test(e)}function vGe(e,t,n){const r=xGe(e,t,n);if(console.warn(r),mGe.includes(e))throw new RangeError(r)}function xGe(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 wGe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,bGe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,CGe=/^'([^]*?)'?$/,SGe=/''/g,kGe=/[a-zA-Z]/;function BGe(e,t,n){var d,h,f,A;const r=E2(),i=r.locale??JAe,s=r.firstWeekContainsDate??((h=(d=r.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,a=r.weekStartsOn??((A=(f=r.locale)==null?void 0:f.options)==null?void 0:A.weekStartsOn)??0,o=qn(e);if(!xWe(o))throw new RangeError("Invalid time value");let l=t.match(bGe).map(p=>{const m=p[0];if(m==="p"||m==="P"){const g=AGe[m];return g(p,i.formatLong)}return p}).join("").match(wGe).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const m=p[0];if(m==="'")return{isToken:!1,value:_Ge(p)};if(Pq[m])return{isToken:!0,value:p};if(m.match(kGe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:p}});i.localize.preprocessor&&(l=i.localize.preprocessor(o,l));const u={firstWeekContainsDate:s,weekStartsOn:a,locale:i};return l.map(p=>{if(!p.isToken)return p.value;const m=p.value;(yGe(m)||gGe(m))&&vGe(m,t,String(e));const g=Pq[m[0]];return g(o,m,i.localize,u)}).join("")}function _Ge(e){const t=e.match(CGe);return t?t[1].replace(SGe,"'"):e}function EGe(e,t,n){const r=E2(),i=(n==null?void 0:n.locale)??r.locale??JAe,s=2520,a=iB(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 l,u;a>0?(l=qn(t),u=qn(e)):(l=qn(e),u=qn(t));const d=EWe(u,l),h=(AE(u)-AE(l))/1e3,f=Math.round((d-h)/60);let A;if(f<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):f===0?i.formatDistance("lessThanXMinutes",1,o):i.formatDistance("xMinutes",f,o);if(f<45)return i.formatDistance("xMinutes",f,o);if(f<90)return i.formatDistance("aboutXHours",1,o);if(f<jq){const p=Math.round(f/60);return i.formatDistance("aboutXHours",p,o)}else{if(f<s)return i.formatDistance("xDays",1,o);if(f<ES){const p=Math.round(f/jq);return i.formatDistance("xDays",p,o)}else if(f<ES*2)return A=Math.round(f/ES),i.formatDistance("aboutXMonths",A,o)}if(A=_We(u,l),A<12){const p=Math.round(f/ES);return i.formatDistance("xMonths",p,o)}else{const p=A%12,m=Math.trunc(A/12);return p<3?i.formatDistance("aboutXYears",m,o):p<9?i.formatDistance("overXYears",m,o):i.formatDistance("almostXYears",m+1,o)}}function by(e,t){return EGe(e,yWe(e),t)}const NGe={indexed:c.jsx(u2,{className:"w-4 h-4 text-green-500"}),rich_results:c.jsx(zs,{className:"w-4 h-4 text-yellow-500"}),published:c.jsx(d1e,{className:"w-4 h-4 text-blue-500"}),schema:c.jsx(fre,{className:"w-4 h-4 text-purple-500"})},jGe=()=>{const{data:e}=uWe(),{data:t}=IQ(),{data:n}=gc(),{total:r}=GAe(),i=(n||[]).filter(l=>l.status==="published").length,s=(t||[]).filter(l=>l.google_indexed||l.bing_indexed).length,a=(t||[]).filter(l=>l.rich_results).length,o=r>=75?"text-green-600":r>=50?"text-yellow-600":"text-destructive";return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[c.jsx("div",{className:`text-6xl font-bold ${o}`,children:r}),c.jsx("p",{className:"text-sm text-muted-foreground uppercase tracking-wider",children:"Site Readiness Score"}),c.jsx(A0,{value:r,className:"h-3 w-64"})]}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsxs("div",{className:"border rounded-lg p-4 text-center bg-card",children:[c.jsx("p",{className:"text-2xl font-bold",children:i}),c.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Published"})]}),c.jsxs("div",{className:"border rounded-lg p-4 text-center bg-card",children:[c.jsx("p",{className:"text-2xl font-bold",children:s}),c.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Indexed"})]}),c.jsxs("div",{className:"border rounded-lg p-4 text-center bg-card",children:[c.jsx("p",{className:"text-2xl font-bold",children:a}),c.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Rich Results"})]})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsx("h3",{className:"text-sm font-medium uppercase tracking-wider text-muted-foreground",children:"Recent Wins"}),(!e||e.length===0)&&c.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."}),c.jsx("div",{className:"space-y-2",children:(e||[]).map(l=>c.jsxs("div",{className:"flex items-start gap-3 border rounded-lg p-3 bg-card",children:[c.jsx("div",{className:"mt-0.5",children:NGe[l.win_type]||c.jsx(fre,{className:"w-4 h-4 text-muted-foreground"})}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("p",{className:"text-sm font-medium",children:l.title}),l.description&&c.jsx("p",{className:"text-xs text-muted-foreground",children:l.description})]}),c.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:BGe(new Date(l.created_at),"MMM d")})]},l.id))})]})]})},TGe=()=>{const{data:e}=KA(),{data:t}=gc(),{configMap:n}=To(),[r,i]=k.useState("admin"),s=e||[],a=t||[];return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.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:[c.jsx(RU,{className:"w-3.5 h-3.5"}),"Admin"]}),c.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:[c.jsx(vb,{className:"w-3.5 h-3.5"}),"Client"]})]}),r==="client"?c.jsx(jGe,{}):c.jsxs("div",{className:"space-y-8",children:[c.jsx(aWe,{}),c.jsxs(v2,{defaultValue:"categories",className:"space-y-4",children:[c.jsxs(rv,{className:"bg-muted/50 p-1",children:[c.jsx(si,{value:"categories",className:"text-xs uppercase tracking-wider",children:"Categories"}),c.jsx(si,{value:"subpages",className:"text-xs uppercase tracking-wider",children:"Sub-Pages"}),c.jsx(si,{value:"static",className:"text-xs uppercase tracking-wider",children:"Static Pages"}),c.jsx(si,{value:"indexing",className:"text-xs uppercase tracking-wider",children:"Indexing"})]}),c.jsxs(ai,{value:"categories",className:"space-y-3",children:[s.map(o=>c.jsxs(Uw,{children:[c.jsxs(Dw,{className:"flex items-center justify-between w-full border rounded-lg p-3 bg-card hover:bg-muted/30 transition-colors",children:[c.jsx("span",{className:"text-sm font-medium",children:o.name}),c.jsx(ac,{className:"w-4 h-4 text-muted-foreground"})]}),c.jsx(Qw,{className:"border border-t-0 rounded-b-lg p-4 bg-card",children:c.jsx(WI,{type:"category",category:o,pages:a})})]},o.id)),s.length===0&&c.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No categories created yet."})]}),c.jsxs(ai,{value:"subpages",className:"space-y-3",children:[a.filter(o=>!o.is_parent).map(o=>c.jsxs(Uw,{children:[c.jsxs(Dw,{className:"flex items-center justify-between w-full border rounded-lg p-3 bg-card hover:bg-muted/30 transition-colors",children:[c.jsxs("div",{className:"text-left",children:[c.jsx("span",{className:"text-sm font-medium",children:o.title}),c.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["(",o.status,")"]})]}),c.jsx(ac,{className:"w-4 h-4 text-muted-foreground"})]}),c.jsx(Qw,{className:"border border-t-0 rounded-b-lg p-4 bg-card",children:c.jsx(WI,{type:"subpage",page:o})})]},o.id)),a.filter(o=>!o.is_parent).length===0&&c.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No sub-pages created yet."})]}),c.jsx(ai,{value:"static",className:"space-y-3",children:["Home","About","Contact"].map(o=>c.jsxs(Uw,{children:[c.jsxs(Dw,{className:"flex items-center justify-between w-full border rounded-lg p-3 bg-card hover:bg-muted/30 transition-colors",children:[c.jsx("span",{className:"text-sm font-medium",children:o}),c.jsx(ac,{className:"w-4 h-4 text-muted-foreground"})]}),c.jsx(Qw,{className:"border border-t-0 rounded-b-lg p-4 bg-card",children:c.jsx(WI,{type:"static",staticPageName:o,configMap:n})})]},o))}),c.jsx(ai,{value:"indexing",children:c.jsx(hWe,{})})]})]})]})};function rg({value:e,label:t}){return e===null?c.jsxs("span",{title:`${t}: N/A`,className:"inline-flex items-center gap-1",children:[c.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/60 uppercase",children:t}),c.jsx(rre,{size:14,className:"text-muted-foreground/40"})]}):c.jsxs("span",{title:`${t}: ${e?"Pass":"Fail"}`,className:"inline-flex items-center gap-1",children:[c.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/60 uppercase",children:t}),e?c.jsx(z0,{size:14,className:"text-emerald-500"}):c.jsx(c2,{size:14,className:"text-red-500"})]})}function Mq({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"?z0:t==="submitted"?ire:c2;return c.jsxs("button",{onClick:n,title:`${e}: ${i[t]} — Click to advance`,className:"inline-flex items-center gap-1 hover:opacity-80 transition-opacity",children:[c.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/60 uppercase",children:e}),c.jsx(s,{size:14,className:r[t],fill:t==="submitted"?"currentColor":"none"})]})}function Lq(e,t){return t?"indexed":e?"submitted":"none"}function Rq(e){return e==="none"?{submitted:!0,indexed:!1}:e==="submitted"?{submitted:!0,indexed:!0}:{submitted:!1,indexed:!1}}const fE=["/idx","/home-valuation"];function yx({entry:e,onToggleIndex:t}){const n=e.scan,r=["aeo","category","subcategory"].includes(e.page_type),i=fE.includes(e.page_path),s=fE.includes(e.page_path),a=Lq((n==null?void 0:n.google_submitted)??!1,(n==null?void 0:n.google_indexed)??!1),o=Lq((n==null?void 0:n.bing_submitted)??!1,(n==null?void 0:n.bing_indexed)??!1);return c.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:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-mono text-sm truncate",children:e.page_path}),c.jsx(cr,{variant:"outline",className:"text-[10px] uppercase tracking-wider shrink-0",children:e.page_type})]}),e.page_title&&c.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:e.page_title})]}),c.jsxs("div",{className:"flex items-center gap-2.5 shrink-0 flex-wrap justify-end",children:[c.jsx(Mq,{label:"G",state:a,onClick:()=>t(e.page_path,"google",Rq(a))}),c.jsx(Mq,{label:"B",state:o,onClick:()=>t(e.page_path,"bing",Rq(o))}),c.jsx(rg,{value:n?i?null:n.has_schema:null,label:"S"}),c.jsx(rg,{value:n&&r?n.faq_schema_matches:null,label:"F"}),c.jsx(rg,{value:n?n.has_meta_title&&n.has_meta_description:null,label:"M"}),c.jsx(rg,{value:(n==null?void 0:n.in_sitemap)??null,label:"SM"}),c.jsx(rg,{value:n?s?null:n.in_aeo_sitemap??!1:null,label:"AEO"}),c.jsx(rg,{value:(n==null?void 0:n.in_llms_txt)??null,label:"LLM"})]})]})}function NS({title:e,count:t}){return c.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 bg-muted/50 border-b border-border",children:[c.jsx("span",{className:"text-xs font-semibold uppercase tracking-widest text-muted-foreground",children:e}),c.jsx(cr,{variant:"secondary",className:"text-[10px]",children:t})]})}const Uq=[{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"}],tfe=[{path:"/blog",title:"Blog"},{path:"/properties",title:"Properties"}];tfe.map(e=>e.path);function PGe(){var x;const e=Zi(),{data:t,isLoading:n}=dr({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}=KA(),{data:s,isLoading:a}=gc(),o=n||i||a,l=k.useMemo(()=>{const b={};for(const w of t||[])b[w.page_path]=w;return b},[t]),u=k.useMemo(()=>{const b=[],w=new Set;for(const T of Uq)b.push({page_path:T.path,page_title:T.title,page_type:"static",scan:l[T.path]}),w.add(T.path);const S=new Set(Uq.map(T=>T.path)),_=(r||[]).filter(T=>T.enabled),E={};for(const T of _)E[T.id]=T;const j=_.filter(T=>!T.parent_id),I=_.filter(T=>T.parent_id);for(const T of j){const N=`/${T.slug}`;w.has(N)||S.has(N)||(b.push({page_path:N,page_title:T.name,page_type:"category",scan:l[N]}),w.add(N))}for(const T of I){const N=E[T.parent_id];if(!N)continue;const F=`/${N.slug}/${T.slug}`;w.has(F)||S.has(F)||(b.push({page_path:F,page_title:T.name,page_type:"subcategory",scan:l[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=E[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:l[F]}),w.add(F))}for(const T of tfe)w.has(T.path)||(b.push({page_path:T.path,page_title:T.title,page_type:"dormant",scan:l[T.path]}),w.add(T.path));return b},[t,r,s,l]),d=Cs({mutationFn:async({page_path:b,field:w,next:S})=>{const _={};_[`${w}_submitted`]=S.submitted,_[`${w}_indexed`]=S.indexed;const{data:E}=await Me.from("crawl_scan_results").select("id").eq("page_path",b).maybeSingle();if(E){const{error:j}=await Me.from("crawl_scan_results").update(_).eq("page_path",b);if(j)throw j}else{const j=u.find(T=>T.page_path===b),{error:I}=await Me.from("crawl_scan_results").insert({page_path:b,page_title:(j==null?void 0:j.page_title)||b,page_type:(j==null?void 0:j.page_type)==="dormant"?"static":(j==null?void 0:j.page_type)||"static",..._});if(I)throw I}},onSuccess:()=>e.invalidateQueries({queryKey:["crawl-scan-results"]}),onError:b=>yw.error(`Update failed: ${b.message}`)}),h=(b,w,S)=>{d.mutate({page_path:b,field:w,next:S})},f=Cs({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`:"";yw.success(`Scan complete: ${b.scanned} pages checked${w}`)},onError:b=>yw.error(`Scan failed: ${b.message}`)}),A=u.filter(b=>b.page_type!=="dormant"),p=u.filter(b=>b.page_type==="dormant"),m={static:A.filter(b=>b.page_type==="static"),category:A.filter(b=>b.page_type==="category"||b.page_type==="subcategory"),aeo:A.filter(b=>b.page_type==="aeo"),blog:A.filter(b=>b.page_type==="blog")},g=A.filter(b=>{if(!b.scan)return!1;const w=b.scan,_=!fE.includes(b.page_path)?w.has_schema:!0,E=w.has_meta_title&&w.has_meta_description,j=w.in_sitemap||w.in_aeo_sitemap,T=!fE.includes(b.page_path)&&b.page_path!=="/"?w.has_shadow_html:!0;return _&&E&&j&&T}).length,y=A.length,v=(x=t==null?void 0:t[0])==null?void 0:x.scan_timestamp;return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-semibold tracking-tight",children:"Crawlability Map"}),c.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"3-layer AEO visibility: Schema · Sitemaps · Shadow HTML · LLMs.txt"})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[v&&c.jsxs("span",{className:"text-xs text-muted-foreground",children:["Last scan: ",new Date(v).toLocaleString()]}),c.jsxs(Be,{onClick:()=>f.mutate(),disabled:f.isPending,className:"gap-2",children:[f.isPending?c.jsx(ga,{size:16,className:"animate-spin"}):c.jsx(Vc,{size:16}),"Run Full Scan"]})]})]}),y>0&&c.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-lg bg-muted/30 border",children:[c.jsxs("div",{className:"text-center",children:[c.jsxs("div",{className:"text-3xl font-bold",children:[g,"/",y]}),c.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Pages Healthy"})]}),c.jsx("div",{className:"flex-1 h-3 bg-muted rounded-full overflow-hidden",children:c.jsx("div",{className:"h-full bg-emerald-500 rounded-full transition-all",style:{width:`${y>0?g/y*100:0}%`}})}),c.jsxs("div",{className:"text-sm font-medium",children:[y>0?Math.round(g/y*100):0,"%"]})]}),c.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:[c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"font-mono font-bold",children:"G"})," Google"]}),c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"font-mono font-bold",children:"B"})," Bing"]}),c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"font-mono font-bold",children:"S"})," JSON-LD Schema"]}),c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"font-mono font-bold",children:"F"})," FAQ Schema"]}),c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"font-mono font-bold",children:"M"})," Meta Tags"]}),c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"font-mono font-bold",children:"SM"})," Sitemap"]}),c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"font-mono font-bold",children:"AEO"})," AEO Sitemap / Shadow HTML"]}),c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"font-mono font-bold",children:"LLM"})," In llms.txt"]}),c.jsxs("span",{className:"flex items-center gap-1.5 ml-2 border-l pl-3 border-border",children:[c.jsx(c2,{size:12,className:"text-red-500"})," Not Submitted",c.jsx(ire,{size:12,className:"text-yellow-500 fill-yellow-500"})," Submitted",c.jsx(z0,{size:12,className:"text-emerald-500"})," Indexed / Pass",c.jsx(rre,{size:12,className:"text-muted-foreground/40"})," N/A"]})]}),o?c.jsx("div",{className:"flex items-center justify-center py-16",children:c.jsx(ga,{className:"animate-spin text-muted-foreground",size:24})}):c.jsxs("div",{className:"border rounded-lg overflow-hidden",children:[m.static.length>0&&c.jsxs(c.Fragment,{children:[c.jsx(NS,{title:"Static Pages",count:m.static.length}),m.static.map(b=>c.jsx(yx,{entry:b,onToggleIndex:h},b.page_path))]}),m.category.length>0&&c.jsxs(c.Fragment,{children:[c.jsx(NS,{title:"Category Pages",count:m.category.length}),m.category.map(b=>c.jsx(yx,{entry:b,onToggleIndex:h},b.page_path))]}),m.aeo.length>0&&c.jsxs(c.Fragment,{children:[c.jsx(NS,{title:"AEO / FAQ Pages",count:m.aeo.length}),m.aeo.map(b=>c.jsx(yx,{entry:b,onToggleIndex:h},b.page_path))]}),m.blog.length>0&&c.jsxs(c.Fragment,{children:[c.jsx(NS,{title:"Blog Posts",count:m.blog.length}),m.blog.map(b=>c.jsx(yx,{entry:b,onToggleIndex:h},b.page_path))]}),p.length>0&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 bg-muted/30 border-b border-border",children:[c.jsx("span",{className:"text-xs font-semibold uppercase tracking-widest text-muted-foreground/60",children:"Dormant Pages"}),c.jsx(cr,{variant:"outline",className:"text-[10px] text-muted-foreground/60",children:p.length})]}),p.map(b=>c.jsx("div",{className:"opacity-50",children:c.jsx(yx,{entry:b,onToggleIndex:h})},b.page_path))]})]})]})}const IGe=()=>{const{configMap:e,isLoading:t}=To(),{data:n,isLoading:r}=gc(),i=(n||[]).filter(u=>u.status==="published"),s=i.filter(u=>u.schema_markup),a=k.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(f=>`${f.question} ${f.answer}`):[]].filter(Boolean).join(" ");u+=jA(h).filter(f=>f.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`}],l=o.every(u=>u.healthy);return c.jsx(tD,{children:c.jsxs("div",{className:`flex items-center gap-6 px-4 py-2.5 border rounded text-xs tracking-wider uppercase ${l?"border-border bg-muted/30":"border-destructive/30 bg-destructive/5"}`,children:[c.jsx("span",{className:"font-medium text-muted-foreground",children:"Site Health"}),o.map(u=>c.jsxs(nD,{children:[c.jsx(rD,{asChild:!0,children:c.jsxs("div",{className:"flex items-center gap-1.5 cursor-default",children:[c.jsx("span",{className:`w-2 h-2 rounded-full ${u.healthy?"bg-green-500":"bg-destructive"}`}),c.jsx("span",{className:"text-muted-foreground",children:u.label})]})}),c.jsx(sj,{children:c.jsx("p",{children:u.tooltip})})]},u.label))]})})},OGe=({open:e,onOpenChange:t,syncReport:n,setSyncReport:r,isSyncing:i})=>{const[s,a]=k.useState(!1),[o,l]=k.useState(!1),[u,d]=k.useState(!1),[h,f]=k.useState(null),A="khmmwvmdbhaplcfcndjx",p="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",m=async()=>{var w,S;a(!0);try{const _=(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"))}),E=(S=n==null?void 0:n.audit)==null?void 0:S.some(N=>{var F,L;return((F=N.contentSync)==null?void 0:F.includes("html"))||((L=N.contentSync)==null?void 0:L.includes("both"))}),I=await fetch(`https://${A}.supabase.co/functions/v1/sync-site-content?fix=${_&&E?"all":_?"llms":E?"html":"all"}`,{headers:{apikey:p}});if(!I.ok)throw new Error(await I.text());const T=await I.json();r(T),Xe({title:"Content mismatches fixed",description:`${T.summary.content_mismatches} remaining mismatches`})}catch(_){Xe({title:"Fix failed",description:_.message,variant:"destructive"})}finally{a(!1)}},g=async()=>{l(!0);try{const w=await fetch(`https://${A}.supabase.co/functions/v1/sync-site-content?fix=html`,{headers:{apikey:p}});if(!w.ok)throw new Error(await w.text());const S=await w.json();r(S),Xe({title:"HTML issues fixed",description:`${S.summary.html_issues||0} remaining issues`})}catch(w){Xe({title:"Fix failed",description:w.message,variant:"destructive"})}finally{l(!1)}},y=async()=>{d(!0);try{await fetch(`https://${A}.supabase.co/functions/v1/sitemap`,{headers:{apikey:p}});const w=await fetch(`https://${A}.supabase.co/functions/v1/sync-site-content?fix=all`,{headers:{apikey:p}});if(!w.ok)throw new Error(await w.text());const S=await w.json();r(S),Xe({title:"All issues fixed",description:"Sitemaps rebuilt, HTML & llms files regenerated."})}catch(w){Xe({title:"Fix All failed",description:w.message,variant:"destructive"})}finally{d(!1)}},v=async w=>{const S=w.path;f(S);try{const _=w.sourceId?`&id=${w.sourceId}`:"",E=w.type==="core"?"core":"aeo";await fetch(`https://${A}.supabase.co/functions/v1/generate-static-html?type=${E}${_}`,{headers:{apikey:p}}),await Promise.all([fetch(`https://${A}.supabase.co/functions/v1/generate-llms-txt?type=index&rebuild=true`,{headers:{apikey:p}}),fetch(`https://${A}.supabase.co/functions/v1/generate-llms-txt?type=full&rebuild=true`,{headers:{apikey:p}})]),Xe({title:`Regenerated assets for "${w.title}"`});const j=await fetch(`https://${A}.supabase.co/functions/v1/sync-site-content`,{headers:{apikey:p}});if(j.ok){const I=await j.json();r(I)}}catch(_){Xe({title:"Row fix failed",description:_.message,variant:"destructive"})}finally{f(null)}},x=w=>{var S,_;return w.llmsIndex==="❌"||w.llmsFull==="❌"||w.staticHtml==="❌"||w.redirect==="❌"||((S=w.contentSync)==null?void 0:S.includes("❌"))||((_=w.contentSync)==null?void 0:_.includes("⚠️"))},b=n?(n.summary.has_gaps||0)+(n.summary.html_issues||0)+(n.summary.content_mismatches||0):0;return c.jsx(qc,{open:e,onOpenChange:t,children:c.jsxs(Zl,{className:"max-w-4xl max-h-[85vh] overflow-y-auto",children:[c.jsx(ec,{children:c.jsx(tc,{children:"Site Sync & Coverage Audit"})}),i?c.jsxs("div",{className:"py-12 flex flex-col items-center justify-center text-muted-foreground gap-4",children:[c.jsx(Vc,{className:"w-8 h-8 animate-spin text-primary"}),c.jsx("p",{children:"Synchronizing sitemap, static HTML files, and AI models text..."})]}):n?c.jsxs("div",{className:"space-y-6 mt-4",children:[c.jsxs("div",{className:"grid grid-cols-3 md:grid-cols-6 gap-4",children:[c.jsxs("div",{className:"bg-muted p-4 rounded-lg text-center",children:[c.jsx("p",{className:"text-2xl font-bold",children:n.summary.total_pages}),c.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Total Pages"})]}),c.jsxs("div",{className:"bg-muted p-4 rounded-lg text-center",children:[c.jsx("p",{className:"text-2xl font-bold text-green-600",children:n.summary.fully_covered}),c.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Covered"})]}),c.jsxs("div",{className:"bg-muted p-4 rounded-lg text-center",children:[c.jsx("p",{className:`text-2xl font-bold ${n.summary.has_gaps>0?"text-destructive":"text-green-600"}`,children:n.summary.has_gaps}),c.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Missing Items"})]}),c.jsxs("div",{className:"bg-muted p-4 rounded-lg text-center",children:[c.jsx("p",{className:"text-2xl font-bold",children:n.summary.generated_html_files}),c.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"HTML Files"})]}),c.jsxs("div",{className:"bg-muted p-4 rounded-lg text-center",children:[c.jsx("p",{className:`text-2xl font-bold ${(n.summary.html_issues||0)>0?"text-destructive":"text-green-600"}`,children:n.summary.html_issues||0}),c.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"HTML Issues"})]}),c.jsxs("div",{className:"bg-muted p-4 rounded-lg text-center",children:[c.jsx("p",{className:`text-2xl font-bold ${n.summary.content_mismatches>0?"text-destructive":"text-green-600"}`,children:n.summary.content_mismatches}),c.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Content Mismatches"})]})]}),b>0&&c.jsxs("div",{className:"flex items-center gap-3 p-4 bg-primary/10 border border-primary/20 rounded-lg",children:[c.jsxs("div",{className:"flex-1",children:[c.jsxs("p",{className:"text-sm font-medium",children:[b," total issue",b!==1?"s":""," detected across all checks"]}),c.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."})]}),c.jsxs(Be,{size:"sm",onClick:y,disabled:u,children:[c.jsx(u7,{className:`w-3.5 h-3.5 mr-1.5 ${u?"animate-spin":""}`}),u?"Fixing Everything...":"Fix All Issues"]})]}),n.summary.content_mismatches>0&&c.jsxs("div",{className:"flex items-center gap-3 p-4 bg-destructive/10 border border-destructive/20 rounded-lg",children:[c.jsxs("div",{className:"flex-1",children:[c.jsxs("p",{className:"text-sm font-medium",children:[n.summary.content_mismatches," content mismatch",n.summary.content_mismatches!==1?"es":""," detected"]}),c.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."})]}),c.jsxs(Be,{size:"sm",variant:"destructive",onClick:m,disabled:s,children:[c.jsx(Vc,{className:`w-3.5 h-3.5 mr-1.5 ${s?"animate-spin":""}`}),s?"Fixing...":"Fix Mismatches"]})]}),(n.summary.html_issues||0)>0&&c.jsxs("div",{className:"flex items-center gap-3 p-4 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:[c.jsxs("div",{className:"flex-1",children:[c.jsxs("p",{className:"text-sm font-medium",children:[n.summary.html_issues," HTML issue",n.summary.html_issues!==1?"s":""," detected"]}),c.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."]})]}),c.jsxs(Be,{size:"sm",variant:"outline",className:"border-amber-500/30 hover:bg-amber-500/10",onClick:g,disabled:o,children:[c.jsx(Vc,{className:`w-3.5 h-3.5 mr-1.5 ${o?"animate-spin":""}`}),o?"Fixing...":"Fix All HTML Issues"]})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-medium mb-3",children:"Coverage Audit"}),c.jsx("div",{className:"border rounded-md overflow-x-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-muted",children:c.jsxs("tr",{children:[c.jsx("th",{className:"p-3 text-left font-medium",children:"Page Title"}),c.jsx("th",{className:"p-3 text-left font-medium",children:"Path"}),c.jsx("th",{className:"p-3 text-center font-medium",children:"Sitemap"}),c.jsx("th",{className:"p-3 text-center font-medium",children:"AEO Sitemap"}),c.jsx("th",{className:"p-3 text-center font-medium",children:"llms.txt"}),c.jsx("th",{className:"p-3 text-center font-medium",children:"llms-full"}),c.jsx("th",{className:"p-3 text-center font-medium",children:"HTML"}),c.jsx("th",{className:"p-3 text-center font-medium",children:"Redirect"}),c.jsx("th",{className:"p-3 text-center font-medium",children:"Content Sync"}),c.jsx("th",{className:"p-3 text-center font-medium",children:"Fix"})]})}),c.jsx("tbody",{className:"divide-y",children:n.audit.map((w,S)=>c.jsxs("tr",{className:"hover:bg-muted/50",children:[c.jsx("td",{className:"p-3 font-medium",children:w.title}),c.jsx("td",{className:"p-3 text-muted-foreground font-mono text-xs",children:w.path}),c.jsx("td",{className:"p-3 text-center",children:w.sitemap}),c.jsx("td",{className:"p-3 text-center",children:w.sitemapAeo||"—"}),c.jsx("td",{className:"p-3 text-center",title:w.llmsIndexDetail||"",children:w.llmsIndex}),c.jsx("td",{className:"p-3 text-center",title:w.llmsFullDetail||"",children:w.llmsFull}),c.jsx("td",{className:"p-3 text-center",children:w.staticHtml}),c.jsx("td",{className:"p-3 text-center",children:w.redirect}),c.jsx("td",{className:"p-3 text-center",title:w.contentDetail||"",children:w.contentSync}),c.jsx("td",{className:"p-3 text-center",children:x(w)?c.jsx(Be,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:()=>v(w),disabled:h===w.path,title:`Fix ${w.title}`,children:h===w.path?c.jsx(Vc,{className:"w-3.5 h-3.5 animate-spin"}):c.jsx(u7,{className:"w-3.5 h-3.5"})}):c.jsx("span",{className:"text-muted-foreground text-xs",children:"—"})})]},S))})]})})]})]}):null]})})};var FGe=Array.isArray,Ya=FGe,MGe=typeof Fh=="object"&&Fh&&Fh.Object===Object&&Fh,nfe=MGe,LGe=nfe,RGe=typeof self=="object"&&self&&self.Object===Object&&self,UGe=LGe||RGe||Function("return this")(),fu=UGe,DGe=fu,QGe=DGe.Symbol,N2=QGe,Dq=N2,rfe=Object.prototype,HGe=rfe.hasOwnProperty,$Ge=rfe.toString,vx=Dq?Dq.toStringTag:void 0;function zGe(e){var t=HGe.call(e,vx),n=e[vx];try{e[vx]=void 0;var r=!0}catch{}var i=$Ge.call(e);return r&&(t?e[vx]=n:delete e[vx]),i}var VGe=zGe,KGe=Object.prototype,qGe=KGe.toString;function WGe(e){return qGe.call(e)}var GGe=WGe,Qq=N2,YGe=VGe,XGe=GGe,JGe="[object Null]",ZGe="[object Undefined]",Hq=Qq?Qq.toStringTag:void 0;function eYe(e){return e==null?e===void 0?ZGe:JGe:Hq&&Hq in Object(e)?YGe(e):XGe(e)}var Nd=eYe;function tYe(e){return e!=null&&typeof e=="object"}var jd=tYe,nYe=Nd,rYe=jd,iYe="[object Symbol]";function sYe(e){return typeof e=="symbol"||rYe(e)&&nYe(e)==iYe}var cv=sYe,aYe=Ya,oYe=cv,lYe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cYe=/^\w*$/;function uYe(e,t){if(aYe(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||oYe(e)?!0:cYe.test(e)||!lYe.test(e)||t!=null&&e in Object(t)}var OQ=uYe;function dYe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var GA=dYe;const uv=En(GA);var hYe=Nd,AYe=GA,fYe="[object AsyncFunction]",pYe="[object Function]",mYe="[object GeneratorFunction]",gYe="[object Proxy]";function yYe(e){if(!AYe(e))return!1;var t=hYe(e);return t==pYe||t==mYe||t==fYe||t==gYe}var FQ=yYe;const un=En(FQ);var vYe=fu,xYe=vYe["__core-js_shared__"],wYe=xYe,YI=wYe,$q=function(){var e=/[^.]+$/.exec(YI&&YI.keys&&YI.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function bYe(e){return!!$q&&$q in e}var CYe=bYe,SYe=Function.prototype,kYe=SYe.toString;function BYe(e){if(e!=null){try{return kYe.call(e)}catch{}try{return e+""}catch{}}return""}var ife=BYe,_Ye=FQ,EYe=CYe,NYe=GA,jYe=ife,TYe=/[\\^$.*+?()[\]{}|]/g,PYe=/^\[object .+?Constructor\]$/,IYe=Function.prototype,OYe=Object.prototype,FYe=IYe.toString,MYe=OYe.hasOwnProperty,LYe=RegExp("^"+FYe.call(MYe).replace(TYe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function RYe(e){if(!NYe(e)||EYe(e))return!1;var t=_Ye(e)?LYe:PYe;return t.test(jYe(e))}var UYe=RYe;function DYe(e,t){return e==null?void 0:e[t]}var QYe=DYe,HYe=UYe,$Ye=QYe;function zYe(e,t){var n=$Ye(e,t);return HYe(n)?n:void 0}var hm=zYe,VYe=hm,KYe=VYe(Object,"create"),a5=KYe,zq=a5;function qYe(){this.__data__=zq?zq(null):{},this.size=0}var WYe=qYe;function GYe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var YYe=GYe,XYe=a5,JYe="__lodash_hash_undefined__",ZYe=Object.prototype,eXe=ZYe.hasOwnProperty;function tXe(e){var t=this.__data__;if(XYe){var n=t[e];return n===JYe?void 0:n}return eXe.call(t,e)?t[e]:void 0}var nXe=tXe,rXe=a5,iXe=Object.prototype,sXe=iXe.hasOwnProperty;function aXe(e){var t=this.__data__;return rXe?t[e]!==void 0:sXe.call(t,e)}var oXe=aXe,lXe=a5,cXe="__lodash_hash_undefined__";function uXe(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=lXe&&t===void 0?cXe:t,this}var dXe=uXe,hXe=WYe,AXe=YYe,fXe=nXe,pXe=oXe,mXe=dXe;function dv(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])}}dv.prototype.clear=hXe;dv.prototype.delete=AXe;dv.prototype.get=fXe;dv.prototype.has=pXe;dv.prototype.set=mXe;var gXe=dv;function yXe(){this.__data__=[],this.size=0}var vXe=yXe;function xXe(e,t){return e===t||e!==e&&t!==t}var MQ=xXe,wXe=MQ;function bXe(e,t){for(var n=e.length;n--;)if(wXe(e[n][0],t))return n;return-1}var o5=bXe,CXe=o5,SXe=Array.prototype,kXe=SXe.splice;function BXe(e){var t=this.__data__,n=CXe(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():kXe.call(t,n,1),--this.size,!0}var _Xe=BXe,EXe=o5;function NXe(e){var t=this.__data__,n=EXe(t,e);return n<0?void 0:t[n][1]}var jXe=NXe,TXe=o5;function PXe(e){return TXe(this.__data__,e)>-1}var IXe=PXe,OXe=o5;function FXe(e,t){var n=this.__data__,r=OXe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var MXe=FXe,LXe=vXe,RXe=_Xe,UXe=jXe,DXe=IXe,QXe=MXe;function hv(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])}}hv.prototype.clear=LXe;hv.prototype.delete=RXe;hv.prototype.get=UXe;hv.prototype.has=DXe;hv.prototype.set=QXe;var l5=hv,HXe=hm,$Xe=fu,zXe=HXe($Xe,"Map"),LQ=zXe,Vq=gXe,VXe=l5,KXe=LQ;function qXe(){this.size=0,this.__data__={hash:new Vq,map:new(KXe||VXe),string:new Vq}}var WXe=qXe;function GXe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var YXe=GXe,XXe=YXe;function JXe(e,t){var n=e.__data__;return XXe(t)?n[typeof t=="string"?"string":"hash"]:n.map}var c5=JXe,ZXe=c5;function eJe(e){var t=ZXe(this,e).delete(e);return this.size-=t?1:0,t}var tJe=eJe,nJe=c5;function rJe(e){return nJe(this,e).get(e)}var iJe=rJe,sJe=c5;function aJe(e){return sJe(this,e).has(e)}var oJe=aJe,lJe=c5;function cJe(e,t){var n=lJe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var uJe=cJe,dJe=WXe,hJe=tJe,AJe=iJe,fJe=oJe,pJe=uJe;function Av(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])}}Av.prototype.clear=dJe;Av.prototype.delete=hJe;Av.prototype.get=AJe;Av.prototype.has=fJe;Av.prototype.set=pJe;var RQ=Av,sfe=RQ,mJe="Expected a function";function UQ(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(mJe);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(UQ.Cache||sfe),n}UQ.Cache=sfe;var afe=UQ;const gJe=En(afe);var yJe=afe,vJe=500;function xJe(e){var t=yJe(e,function(r){return n.size===vJe&&n.clear(),r}),n=t.cache;return t}var wJe=xJe,bJe=wJe,CJe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,SJe=/\\(\\)?/g,kJe=bJe(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(CJe,function(n,r,i,s){t.push(i?s.replace(SJe,"$1"):r||n)}),t}),BJe=kJe;function _Je(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 DQ=_Je,Kq=N2,EJe=DQ,NJe=Ya,jJe=cv,TJe=1/0,qq=Kq?Kq.prototype:void 0,Wq=qq?qq.toString:void 0;function ofe(e){if(typeof e=="string")return e;if(NJe(e))return EJe(e,ofe)+"";if(jJe(e))return Wq?Wq.call(e):"";var t=e+"";return t=="0"&&1/e==-TJe?"-0":t}var PJe=ofe,IJe=PJe;function OJe(e){return e==null?"":IJe(e)}var lfe=OJe,FJe=Ya,MJe=OQ,LJe=BJe,RJe=lfe;function UJe(e,t){return FJe(e)?e:MJe(e,t)?[e]:LJe(RJe(e))}var cfe=UJe,DJe=cv,QJe=1/0;function HJe(e){if(typeof e=="string"||DJe(e))return e;var t=e+"";return t=="0"&&1/e==-QJe?"-0":t}var u5=HJe,$Je=cfe,zJe=u5;function VJe(e,t){t=$Je(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[zJe(t[n++])];return n&&n==r?e:void 0}var QQ=VJe,KJe=QQ;function qJe(e,t,n){var r=e==null?void 0:KJe(e,t);return r===void 0?n:r}var ufe=qJe;const fl=En(ufe);function WJe(e){return e==null}var GJe=WJe;const pn=En(GJe);var YJe=Nd,XJe=Ya,JJe=jd,ZJe="[object String]";function eZe(e){return typeof e=="string"||!XJe(e)&&JJe(e)&&YJe(e)==ZJe}var tZe=eZe;const j2=En(tZe);var dfe={exports:{}},$n={};/**
 * @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 HQ=Symbol.for("react.element"),$Q=Symbol.for("react.portal"),d5=Symbol.for("react.fragment"),h5=Symbol.for("react.strict_mode"),A5=Symbol.for("react.profiler"),f5=Symbol.for("react.provider"),p5=Symbol.for("react.context"),nZe=Symbol.for("react.server_context"),m5=Symbol.for("react.forward_ref"),g5=Symbol.for("react.suspense"),y5=Symbol.for("react.suspense_list"),v5=Symbol.for("react.memo"),x5=Symbol.for("react.lazy"),rZe=Symbol.for("react.offscreen"),hfe;hfe=Symbol.for("react.module.reference");function bl(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case HQ:switch(e=e.type,e){case d5:case A5:case h5:case g5:case y5:return e;default:switch(e=e&&e.$$typeof,e){case nZe:case p5:case m5:case x5:case v5:case f5:return e;default:return t}}case $Q:return t}}}$n.ContextConsumer=p5;$n.ContextProvider=f5;$n.Element=HQ;$n.ForwardRef=m5;$n.Fragment=d5;$n.Lazy=x5;$n.Memo=v5;$n.Portal=$Q;$n.Profiler=A5;$n.StrictMode=h5;$n.Suspense=g5;$n.SuspenseList=y5;$n.isAsyncMode=function(){return!1};$n.isConcurrentMode=function(){return!1};$n.isContextConsumer=function(e){return bl(e)===p5};$n.isContextProvider=function(e){return bl(e)===f5};$n.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===HQ};$n.isForwardRef=function(e){return bl(e)===m5};$n.isFragment=function(e){return bl(e)===d5};$n.isLazy=function(e){return bl(e)===x5};$n.isMemo=function(e){return bl(e)===v5};$n.isPortal=function(e){return bl(e)===$Q};$n.isProfiler=function(e){return bl(e)===A5};$n.isStrictMode=function(e){return bl(e)===h5};$n.isSuspense=function(e){return bl(e)===g5};$n.isSuspenseList=function(e){return bl(e)===y5};$n.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===d5||e===A5||e===h5||e===g5||e===y5||e===rZe||typeof e=="object"&&e!==null&&(e.$$typeof===x5||e.$$typeof===v5||e.$$typeof===f5||e.$$typeof===p5||e.$$typeof===m5||e.$$typeof===hfe||e.getModuleId!==void 0)};$n.typeOf=bl;dfe.exports=$n;var iZe=dfe.exports,sZe=Nd,aZe=jd,oZe="[object Number]";function lZe(e){return typeof e=="number"||aZe(e)&&sZe(e)==oZe}var Afe=lZe;const cZe=En(Afe);var uZe=Afe;function dZe(e){return uZe(e)&&e!=+e}var hZe=dZe;const T2=En(hZe);var rc=function(t){return t===0?0:t>0?1:-1},Xf=function(t){return j2(t)&&t.indexOf("%")===t.length-1},Je=function(t){return cZe(t)&&!T2(t)},Ri=function(t){return Je(t)||j2(t)},AZe=0,P2=function(t){var n=++AZe;return"".concat(t||"").concat(n)},Xp=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(!Je(t)&&!j2(t))return r;var s;if(Xf(t)){var a=t.indexOf("%");s=n*parseFloat(t.slice(0,a))/100}else s=+t;return T2(s)&&(s=r),i&&s>n&&(s=n),s},Ch=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},fZe=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},Wl=function(t,n){return Je(t)&&Je(n)?function(r){return t+r*(n-t)}:function(){return n}};function pE(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):fl(r,t))===n})}function Cy(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 BM(e){"@babel/helpers - typeof";return BM=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},BM(e)}var pZe=["viewBox","children"],mZe=["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"],Gq=["points","pathLength"],XI={svg:pZe,polygon:Gq,polyline:Gq},zQ=["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"],mE=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(k.isValidElement(t)&&(r=t.props),!uv(r))return null;var i={};return Object.keys(r).forEach(function(s){zQ.includes(s)&&(i[s]=n||function(a){return r[s](r,a)})}),i},gZe=function(t,n,r){return function(i){return t(n,r,i),null}},gE=function(t,n,r){if(!uv(t)||BM(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(s){var a=t[s];zQ.includes(s)&&typeof a=="function"&&(i||(i={}),i[s]=gZe(a,n,r))}),i},yZe=["children"],vZe=["children"];function Yq(e,t){if(e==null)return{};var n=xZe(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 xZe(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 _M(e){"@babel/helpers - typeof";return _M=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},_M(e)}var Xq={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"},rd=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},Jq=null,JI=null,VQ=function e(t){if(t===Jq&&Array.isArray(JI))return JI;var n=[];return k.Children.forEach(t,function(r){pn(r)||(iZe.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),JI=n,Jq=t,n};function pl(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return rd(i)}):r=[rd(t)],VQ(e).forEach(function(i){var s=fl(i,"type.displayName")||fl(i,"type.name");r.indexOf(s)!==-1&&n.push(i)}),n}function po(e,t){var n=pl(e,t);return n&&n[0]}var Zq=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!Je(r)||r<=0||!Je(i)||i<=0)},wZe=["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"],bZe=function(t){return t&&t.type&&j2(t.type)&&wZe.indexOf(t.type)>=0},CZe=function(t){return t&&_M(t)==="object"&&"clipDot"in t},SZe=function(t,n,r,i){var s,a=(s=XI==null?void 0:XI[i])!==null&&s!==void 0?s:[];return!un(t)&&(i&&a.includes(n)||mZe.includes(n))||r&&zQ.includes(n)},vn=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(k.isValidElement(t)&&(i=t.props),!uv(i))return null;var s={};return Object.keys(i).forEach(function(a){var o;SZe((o=i)===null||o===void 0?void 0:o[a],a,n,r)&&(s[a]=i[a])}),s},EM=function e(t,n){if(t===n)return!0;var r=k.Children.count(t);if(r!==k.Children.count(n))return!1;if(r===0)return!0;if(r===1)return eW(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(!eW(s,a))return!1}return!0},eW=function(t,n){if(pn(t)&&pn(n))return!0;if(!pn(t)&&!pn(n)){var r=t.props||{},i=r.children,s=Yq(r,yZe),a=n.props||{},o=a.children,l=Yq(a,vZe);return i&&o?Cy(s,l)&&EM(i,o):!i&&!o?Cy(s,l):!1}return!1},tW=function(t,n){var r=[],i={};return VQ(t).forEach(function(s,a){if(bZe(s))r.push(s);else if(s){var o=rd(s.type),l=n[o]||{},u=l.handler,d=l.once;if(u&&(!d||!i[o])){var h=u(s,o,a);r.push(h),i[o]=!0}}}),r},kZe=function(t){var n=t&&t.type;return n&&Xq[n]?Xq[n]:null},BZe=function(t,n){return VQ(n).indexOf(t)},_Ze=["children","width","height","viewBox","className","style","title","desc"];function NM(){return NM=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},NM.apply(this,arguments)}function EZe(e,t){if(e==null)return{};var n=NZe(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 NZe(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 jM(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,s=e.className,a=e.style,o=e.title,l=e.desc,u=EZe(e,_Ze),d=i||{width:n,height:r,x:0,y:0},h=_n("recharts-surface",s);return re.createElement("svg",NM({},vn(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,l),t)}var jZe=["children","className"];function TM(){return TM=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},TM.apply(this,arguments)}function TZe(e,t){if(e==null)return{};var n=PZe(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 PZe(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 di=re.forwardRef(function(e,t){var n=e.children,r=e.className,i=TZe(e,jZe),s=_n("recharts-layer",r);return re.createElement("g",TM({className:s},vn(i,!0),{ref:t}),n)}),id=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 IZe(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 OZe=IZe,FZe=OZe;function MZe(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:FZe(e,t,n)}var LZe=MZe,RZe="\\ud800-\\udfff",UZe="\\u0300-\\u036f",DZe="\\ufe20-\\ufe2f",QZe="\\u20d0-\\u20ff",HZe=UZe+DZe+QZe,$Ze="\\ufe0e\\ufe0f",zZe="\\u200d",VZe=RegExp("["+zZe+RZe+HZe+$Ze+"]");function KZe(e){return VZe.test(e)}var ffe=KZe;function qZe(e){return e.split("")}var WZe=qZe,pfe="\\ud800-\\udfff",GZe="\\u0300-\\u036f",YZe="\\ufe20-\\ufe2f",XZe="\\u20d0-\\u20ff",JZe=GZe+YZe+XZe,ZZe="\\ufe0e\\ufe0f",eet="["+pfe+"]",PM="["+JZe+"]",IM="\\ud83c[\\udffb-\\udfff]",tet="(?:"+PM+"|"+IM+")",mfe="[^"+pfe+"]",gfe="(?:\\ud83c[\\udde6-\\uddff]){2}",yfe="[\\ud800-\\udbff][\\udc00-\\udfff]",net="\\u200d",vfe=tet+"?",xfe="["+ZZe+"]?",ret="(?:"+net+"(?:"+[mfe,gfe,yfe].join("|")+")"+xfe+vfe+")*",iet=xfe+vfe+ret,set="(?:"+[mfe+PM+"?",PM,gfe,yfe,eet].join("|")+")",aet=RegExp(IM+"(?="+IM+")|"+set+iet,"g");function oet(e){return e.match(aet)||[]}var cet=oet,uet=WZe,det=ffe,het=cet;function Aet(e){return det(e)?het(e):uet(e)}var fet=Aet,pet=LZe,met=ffe,get=fet,yet=lfe;function vet(e){return function(t){t=yet(t);var n=met(t)?get(t):void 0,r=n?n[0]:t.charAt(0),i=n?pet(n,1).join(""):t.slice(1);return r[e]()+i}}var xet=vet,wet=xet,bet=wet("toUpperCase"),Cet=bet;const w5=En(Cet);function ar(e){return function(){return e}}const wfe=Math.cos,yE=Math.sin,yc=Math.sqrt,vE=Math.PI,b5=2*vE,OM=Math.PI,FM=2*OM,Tf=1e-6,ket=FM-Tf;function bfe(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Bet(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return bfe;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 _et{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?bfe:Bet(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,l=r-t,u=i-n,d=a-t,h=o-n,f=d*d+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(f>Tf)if(!(Math.abs(h*l-u*d)>Tf)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let A=r-a,p=i-o,m=l*l+u*u,g=A*A+p*p,y=Math.sqrt(m),v=Math.sqrt(f),x=s*Math.tan((OM-Math.acos((m+f-g)/(2*y*v)))/2),b=x/v,w=x/y;Math.abs(b-1)>Tf&&this._append`L${t+b*d},${n+b*h}`,this._append`A${s},${s},0,0,${+(h*A>d*p)},${this._x1=t+w*l},${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),l=r*Math.sin(i),u=t+o,d=n+l,h=1^a,f=a?i-s:s-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Tf||Math.abs(this._y1-d)>Tf)&&this._append`L${u},${d}`,r&&(f<0&&(f=f%FM+FM),f>ket?this._append`A${r},${r},0,1,${h},${t-o},${n-l}A${r},${r},0,1,${h},${this._x1=u},${this._y1=d}`:f>Tf&&this._append`A${r},${r},0,${+(f>=OM)},${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 KQ(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 _et(t)}function qQ(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Cfe(e){this._context=e}Cfe.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 C5(e){return new Cfe(e)}function Sfe(e){return e[0]}function kfe(e){return e[1]}function Bfe(e,t){var n=ar(!0),r=null,i=C5,s=null,a=KQ(o);e=typeof e=="function"?e:e===void 0?Sfe:ar(e),t=typeof t=="function"?t:t===void 0?kfe:ar(t);function o(l){var u,d=(l=qQ(l)).length,h,f=!1,A;for(r==null&&(s=i(A=a())),u=0;u<=d;++u)!(u<d&&n(h=l[u],u,l))===f&&((f=!f)?s.lineStart():s.lineEnd()),f&&s.point(+e(h,u,l),+t(h,u,l));if(A)return s=null,A+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:ar(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:ar(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:ar(!!l),o):n},o.curve=function(l){return arguments.length?(i=l,r!=null&&(s=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=s=null:s=i(r=l),o):r},o}function jS(e,t,n){var r=null,i=ar(!0),s=null,a=C5,o=null,l=KQ(u);e=typeof e=="function"?e:e===void 0?Sfe:ar(+e),t=typeof t=="function"?t:ar(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?kfe:ar(+n);function u(h){var f,A,p,m=(h=qQ(h)).length,g,y=!1,v,x=new Array(m),b=new Array(m);for(s==null&&(o=a(v=l())),f=0;f<=m;++f){if(!(f<m&&i(g=h[f],f,h))===y)if(y=!y)A=f,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),p=f-1;p>=A;--p)o.point(x[p],b[p]);o.lineEnd(),o.areaEnd()}y&&(x[f]=+e(g,f,h),b[f]=+t(g,f,h),o.point(r?+r(g,f,h):x[f],n?+n(g,f,h):b[f]))}if(v)return o=null,v+""||null}function d(){return Bfe().defined(i).curve(a).context(s)}return u.x=function(h){return arguments.length?(e=typeof h=="function"?h:ar(+h),r=null,u):e},u.x0=function(h){return arguments.length?(e=typeof h=="function"?h:ar(+h),u):e},u.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:ar(+h),u):r},u.y=function(h){return arguments.length?(t=typeof h=="function"?h:ar(+h),n=null,u):t},u.y0=function(h){return arguments.length?(t=typeof h=="function"?h:ar(+h),u):t},u.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:ar(+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:ar(!!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 _fe{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 Eet(e){return new _fe(e,!0)}function Net(e){return new _fe(e,!1)}const WQ={draw(e,t){const n=yc(t/vE);e.moveTo(n,0),e.arc(0,0,n,0,b5)}},jet={draw(e,t){const n=yc(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()}},Efe=yc(1/3),Tet=Efe*2,Pet={draw(e,t){const n=yc(t/Tet),r=n*Efe;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Iet={draw(e,t){const n=yc(t),r=-n/2;e.rect(r,r,n,n)}},Oet=.8908130915292852,Nfe=yE(vE/10)/yE(7*vE/10),Fet=yE(b5/10)*Nfe,Met=-wfe(b5/10)*Nfe,Let={draw(e,t){const n=yc(t*Oet),r=Fet*n,i=Met*n;e.moveTo(0,-n),e.lineTo(r,i);for(let s=1;s<5;++s){const a=b5*s/5,o=wfe(a),l=yE(a);e.lineTo(l*n,-o*n),e.lineTo(o*r-l*i,l*r+o*i)}e.closePath()}},ZI=yc(3),Ret={draw(e,t){const n=-yc(t/(ZI*3));e.moveTo(0,n*2),e.lineTo(-ZI*n,-n),e.lineTo(ZI*n,-n),e.closePath()}},Ro=-.5,Uo=yc(3)/2,MM=1/yc(12),Uet=(MM/2+1)*3,Det={draw(e,t){const n=yc(t/Uet),r=n/2,i=n*MM,s=r,a=n*MM+n,o=-s,l=a;e.moveTo(r,i),e.lineTo(s,a),e.lineTo(o,l),e.lineTo(Ro*r-Uo*i,Uo*r+Ro*i),e.lineTo(Ro*s-Uo*a,Uo*s+Ro*a),e.lineTo(Ro*o-Uo*l,Uo*o+Ro*l),e.lineTo(Ro*r+Uo*i,Ro*i-Uo*r),e.lineTo(Ro*s+Uo*a,Ro*a-Uo*s),e.lineTo(Ro*o+Uo*l,Ro*l-Uo*o),e.closePath()}};function Qet(e,t){let n=null,r=KQ(i);e=typeof e=="function"?e:ar(e||WQ),t=typeof t=="function"?t:ar(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:ar(s),i):e},i.size=function(s){return arguments.length?(t=typeof s=="function"?s:ar(+s),i):t},i.context=function(s){return arguments.length?(n=s??null,i):n},i}function xE(){}function wE(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 jfe(e){this._context=e}jfe.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:wE(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:wE(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Het(e){return new jfe(e)}function Tfe(e){this._context=e}Tfe.prototype={areaStart:xE,areaEnd:xE,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:wE(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $et(e){return new Tfe(e)}function Pfe(e){this._context=e}Pfe.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:wE(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function zet(e){return new Pfe(e)}function Ife(e){this._context=e}Ife.prototype={areaStart:xE,areaEnd:xE,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 Vet(e){return new Ife(e)}function nW(e){return e<0?-1:1}function rW(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(nW(s)+nW(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function iW(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function e4(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 bE(e){this._context=e}bE.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:e4(this,this._t0,iW(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,e4(this,iW(this,n=rW(this,e,t)),n);break;default:e4(this,this._t0,n=rW(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Ofe(e){this._context=new Ffe(e)}(Ofe.prototype=Object.create(bE.prototype)).point=function(e,t){bE.prototype.point.call(this,t,e)};function Ffe(e){this._context=e}Ffe.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 Ket(e){return new bE(e)}function qet(e){return new Ofe(e)}function Mfe(e){this._context=e}Mfe.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=sW(e),i=sW(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 sW(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 Wet(e){return new Mfe(e)}function S5(e,t){this._context=e,this._t=t}S5.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 Get(e){return new S5(e,.5)}function Yet(e){return new S5(e,0)}function Xet(e){return new S5(e,1)}function f0(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 LM(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Jet(e,t){return e[t]}function Zet(e){const t=[];return t.key=e,t}function ett(){var e=ar([]),t=LM,n=f0,r=Jet;function i(s){var a=Array.from(e.apply(this,arguments),Zet),o,l=a.length,u=-1,d;for(const h of s)for(o=0,++u;o<l;++o)(a[o][u]=[0,+r(h,a[o].key,u,s)]).data=h;for(o=0,d=qQ(t(a));o<l;++o)a[d[o]].index=o;return n(a,d),a}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:ar(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:ar(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?LM:typeof s=="function"?s:ar(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??f0,i):n},i}function ttt(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}f0(e,t)}}function ntt(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}f0(e,t)}}function rtt(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,l=0,u=0;o<a;++o){for(var d=e[t[o]],h=d[r][1]||0,f=d[r-1][1]||0,A=(h-f)/2,p=0;p<o;++p){var m=e[t[p]],g=m[r][1]||0,y=m[r-1][1]||0;A+=g-y}l+=h,u+=A*h}i[r-1][1]+=i[r-1][0]=n,l&&(n-=u/l)}i[r-1][1]+=i[r-1][0]=n,f0(e,t)}}function s1(e){"@babel/helpers - typeof";return s1=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},s1(e)}var itt=["type","size","sizeType"];function RM(){return RM=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},RM.apply(this,arguments)}function aW(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 oW(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aW(Object(n),!0).forEach(function(r){stt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aW(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function stt(e,t,n){return t=att(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function att(e){var t=ott(e,"string");return s1(t)=="symbol"?t:t+""}function ott(e,t){if(s1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(s1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ltt(e,t){if(e==null)return{};var n=ctt(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 ctt(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 Lfe={symbolCircle:WQ,symbolCross:jet,symbolDiamond:Pet,symbolSquare:Iet,symbolStar:Let,symbolTriangle:Ret,symbolWye:Det},utt=Math.PI/180,dtt=function(t){var n="symbol".concat(w5(t));return Lfe[n]||WQ},htt=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*utt;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}},Att=function(t,n){Lfe["symbol".concat(w5(t))]=n},GQ=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,l=ltt(t,itt),u=oW(oW({},l),{},{type:r,size:s,sizeType:o}),d=function(){var g=dtt(r),y=Qet().type(g).size(htt(s,o,r));return y()},h=u.className,f=u.cx,A=u.cy,p=vn(u,!0);return f===+f&&A===+A&&s===+s?re.createElement("path",RM({},p,{className:_n("recharts-symbols",h),transform:"translate(".concat(f,", ").concat(A,")"),d:d()})):null};GQ.registerSymbol=Att;function p0(e){"@babel/helpers - typeof";return p0=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},p0(e)}function UM(){return UM=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},UM.apply(this,arguments)}function lW(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 ftt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lW(Object(n),!0).forEach(function(r){a1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lW(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ptt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mtt(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,Ufe(r.key),r)}}function gtt(e,t,n){return t&&mtt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ytt(e,t,n){return t=CE(t),vtt(e,Rfe()?Reflect.construct(t,n||[],CE(e).constructor):t.apply(e,n))}function vtt(e,t){if(t&&(p0(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xtt(e)}function xtt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rfe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Rfe=function(){return!!e})()}function CE(e){return CE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},CE(e)}function wtt(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&&DM(e,t)}function DM(e,t){return DM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},DM(e,t)}function a1(e,t,n){return t=Ufe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ufe(e){var t=btt(e,"string");return p0(t)=="symbol"?t:t+""}function btt(e,t){if(p0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(p0(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Do=32,YQ=function(e){function t(){return ptt(this,t),ytt(this,t,arguments)}return wtt(t,e),gtt(t,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,s=Do/2,a=Do/6,o=Do/3,l=r.inactive?i:r.color;if(r.type==="plainline")return re.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:s,x2:Do,y2:s,className:"recharts-legend-icon"});if(r.type==="line")return re.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(s,"h").concat(o,`
            A`).concat(a,",").concat(a,",0,1,1,").concat(2*o,",").concat(s,`
            H`).concat(Do,"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:l,d:"M0,".concat(Do/8,"h").concat(Do,"v").concat(Do*3/4,"h").concat(-Do,"z"),className:"recharts-legend-icon"});if(re.isValidElement(r.legendIcon)){var u=ftt({},r);return delete u.legendIcon,re.cloneElement(r.legendIcon,u)}return re.createElement(GQ,{fill:l,cx:s,cy:s,size:Do,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,s=i.payload,a=i.iconSize,o=i.layout,l=i.formatter,u=i.inactiveColor,d={x:0,y:0,width:Do,height:Do},h={display:o==="horizontal"?"inline-block":"block",marginRight:10},f={display:"inline-block",verticalAlign:"middle",marginRight:4};return s.map(function(A,p){var m=A.formatter||l,g=_n(a1(a1({"recharts-legend-item":!0},"legend-item-".concat(p),!0),"inactive",A.inactive));if(A.type==="none")return null;var y=un(A.value)?null:A.value;id(!un(A.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=A.inactive?u:A.color;return re.createElement("li",UM({className:g,style:h,key:"legend-item-".concat(p)},gE(r.props,A,p)),re.createElement(jM,{width:a,height:a,viewBox:d,style:f},r.renderIcon(A)),re.createElement("span",{className:"recharts-legend-item-text",style:{color:v}},m?m(y,A,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())}}])}(k.PureComponent);a1(YQ,"displayName","Legend");a1(YQ,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Ctt=l5;function Stt(){this.__data__=new Ctt,this.size=0}var ktt=Stt;function Btt(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var _tt=Btt;function Ett(e){return this.__data__.get(e)}var Ntt=Ett;function jtt(e){return this.__data__.has(e)}var Ttt=jtt,Ptt=l5,Itt=LQ,Ott=RQ,Ftt=200;function Mtt(e,t){var n=this.__data__;if(n instanceof Ptt){var r=n.__data__;if(!Itt||r.length<Ftt-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ott(r)}return n.set(e,t),this.size=n.size,this}var Ltt=Mtt,Rtt=l5,Utt=ktt,Dtt=_tt,Qtt=Ntt,Htt=Ttt,$tt=Ltt;function fv(e){var t=this.__data__=new Rtt(e);this.size=t.size}fv.prototype.clear=Utt;fv.prototype.delete=Dtt;fv.prototype.get=Qtt;fv.prototype.has=Htt;fv.prototype.set=$tt;var Dfe=fv,ztt="__lodash_hash_undefined__";function Vtt(e){return this.__data__.set(e,ztt),this}var Ktt=Vtt;function qtt(e){return this.__data__.has(e)}var Wtt=qtt,Gtt=RQ,Ytt=Ktt,Xtt=Wtt;function SE(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Gtt;++t<n;)this.add(e[t])}SE.prototype.add=SE.prototype.push=Ytt;SE.prototype.has=Xtt;var Qfe=SE;function Jtt(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 Hfe=Jtt;function Ztt(e,t){return e.has(t)}var $fe=Ztt,ent=Qfe,tnt=Hfe,nnt=$fe,rnt=1,int=2;function snt(e,t,n,r,i,s){var a=n&rnt,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var u=s.get(e),d=s.get(t);if(u&&d)return u==t&&d==e;var h=-1,f=!0,A=n&int?new ent: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;f=!1;break}if(A){if(!tnt(t,function(y,v){if(!nnt(A,v)&&(p===y||i(p,y,n,r,s)))return A.push(v)})){f=!1;break}}else if(!(p===m||i(p,m,n,r,s))){f=!1;break}}return s.delete(e),s.delete(t),f}var zfe=snt,ant=fu,ont=ant.Uint8Array,lnt=ont;function cnt(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var unt=cnt;function dnt(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var XQ=dnt,cW=N2,uW=lnt,hnt=MQ,Ant=zfe,fnt=unt,pnt=XQ,mnt=1,gnt=2,ynt="[object Boolean]",vnt="[object Date]",xnt="[object Error]",wnt="[object Map]",bnt="[object Number]",Cnt="[object RegExp]",Snt="[object Set]",knt="[object String]",Bnt="[object Symbol]",_nt="[object ArrayBuffer]",Ent="[object DataView]",dW=cW?cW.prototype:void 0,t4=dW?dW.valueOf:void 0;function Nnt(e,t,n,r,i,s,a){switch(n){case Ent:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case _nt:return!(e.byteLength!=t.byteLength||!s(new uW(e),new uW(t)));case ynt:case vnt:case bnt:return hnt(+e,+t);case xnt:return e.name==t.name&&e.message==t.message;case Cnt:case knt:return e==t+"";case wnt:var o=fnt;case Snt:var l=r&mnt;if(o||(o=pnt),e.size!=t.size&&!l)return!1;var u=a.get(e);if(u)return u==t;r|=gnt,a.set(e,t);var d=Ant(o(e),o(t),r,i,s,a);return a.delete(e),d;case Bnt:if(t4)return t4.call(e)==t4.call(t)}return!1}var jnt=Nnt;function Tnt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Vfe=Tnt,Pnt=Vfe,Int=Ya;function Ont(e,t,n){var r=t(e);return Int(e)?r:Pnt(r,n(e))}var Fnt=Ont;function Mnt(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 Lnt=Mnt;function Rnt(){return[]}var Unt=Rnt,Dnt=Lnt,Qnt=Unt,Hnt=Object.prototype,$nt=Hnt.propertyIsEnumerable,hW=Object.getOwnPropertySymbols,znt=hW?function(e){return e==null?[]:(e=Object(e),Dnt(hW(e),function(t){return $nt.call(e,t)}))}:Qnt,Vnt=znt;function Knt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var qnt=Knt,Wnt=Nd,Gnt=jd,Ynt="[object Arguments]";function Xnt(e){return Gnt(e)&&Wnt(e)==Ynt}var Jnt=Xnt,AW=Jnt,Znt=jd,Kfe=Object.prototype,ert=Kfe.hasOwnProperty,trt=Kfe.propertyIsEnumerable,nrt=AW(function(){return arguments}())?AW:function(e){return Znt(e)&&ert.call(e,"callee")&&!trt.call(e,"callee")},JQ=nrt,kE={exports:{}};function rrt(){return!1}var irt=rrt;kE.exports;(function(e,t){var n=fu,r=irt,i=t&&!t.nodeType&&t,s=i&&!0&&e&&!e.nodeType&&e,a=s&&s.exports===i,o=a?n.Buffer:void 0,l=o?o.isBuffer:void 0,u=l||r;e.exports=u})(kE,kE.exports);var qfe=kE.exports,srt=9007199254740991,art=/^(?:0|[1-9]\d*)$/;function ort(e,t){var n=typeof e;return t=t??srt,!!t&&(n=="number"||n!="symbol"&&art.test(e))&&e>-1&&e%1==0&&e<t}var ZQ=ort,lrt=9007199254740991;function crt(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=lrt}var eH=crt,urt=Nd,drt=eH,hrt=jd,Art="[object Arguments]",frt="[object Array]",prt="[object Boolean]",mrt="[object Date]",grt="[object Error]",yrt="[object Function]",vrt="[object Map]",xrt="[object Number]",wrt="[object Object]",brt="[object RegExp]",Crt="[object Set]",Srt="[object String]",krt="[object WeakMap]",Brt="[object ArrayBuffer]",_rt="[object DataView]",Ert="[object Float32Array]",Nrt="[object Float64Array]",jrt="[object Int8Array]",Trt="[object Int16Array]",Prt="[object Int32Array]",Irt="[object Uint8Array]",Ort="[object Uint8ClampedArray]",Frt="[object Uint16Array]",Mrt="[object Uint32Array]",mr={};mr[Ert]=mr[Nrt]=mr[jrt]=mr[Trt]=mr[Prt]=mr[Irt]=mr[Ort]=mr[Frt]=mr[Mrt]=!0;mr[Art]=mr[frt]=mr[Brt]=mr[prt]=mr[_rt]=mr[mrt]=mr[grt]=mr[yrt]=mr[vrt]=mr[xrt]=mr[wrt]=mr[brt]=mr[Crt]=mr[Srt]=mr[krt]=!1;function Lrt(e){return hrt(e)&&drt(e.length)&&!!mr[urt(e)]}var Rrt=Lrt;function Urt(e){return function(t){return e(t)}}var Wfe=Urt,BE={exports:{}};BE.exports;(function(e,t){var n=nfe,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 l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();e.exports=o})(BE,BE.exports);var Drt=BE.exports,Qrt=Rrt,Hrt=Wfe,fW=Drt,pW=fW&&fW.isTypedArray,$rt=pW?Hrt(pW):Qrt,Gfe=$rt,zrt=qnt,Vrt=JQ,Krt=Ya,qrt=qfe,Wrt=ZQ,Grt=Gfe,Yrt=Object.prototype,Xrt=Yrt.hasOwnProperty;function Jrt(e,t){var n=Krt(e),r=!n&&Vrt(e),i=!n&&!r&&qrt(e),s=!n&&!r&&!i&&Grt(e),a=n||r||i||s,o=a?zrt(e.length,String):[],l=o.length;for(var u in e)(t||Xrt.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Wrt(u,l)))&&o.push(u);return o}var Zrt=Jrt,eit=Object.prototype;function tit(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||eit;return e===n}var nit=tit;function rit(e,t){return function(n){return e(t(n))}}var Yfe=rit,iit=Yfe,sit=iit(Object.keys,Object),ait=sit,oit=nit,lit=ait,cit=Object.prototype,uit=cit.hasOwnProperty;function dit(e){if(!oit(e))return lit(e);var t=[];for(var n in Object(e))uit.call(e,n)&&n!="constructor"&&t.push(n);return t}var hit=dit,Ait=FQ,fit=eH;function pit(e){return e!=null&&fit(e.length)&&!Ait(e)}var I2=pit,mit=Zrt,git=hit,yit=I2;function vit(e){return yit(e)?mit(e):git(e)}var k5=vit,xit=Fnt,wit=Vnt,bit=k5;function Cit(e){return xit(e,bit,wit)}var Sit=Cit,mW=Sit,kit=1,Bit=Object.prototype,_it=Bit.hasOwnProperty;function Eit(e,t,n,r,i,s){var a=n&kit,o=mW(e),l=o.length,u=mW(t),d=u.length;if(l!=d&&!a)return!1;for(var h=l;h--;){var f=o[h];if(!(a?f in t:_it.call(t,f)))return!1}var A=s.get(e),p=s.get(t);if(A&&p)return A==t&&p==e;var m=!0;s.set(e,t),s.set(t,e);for(var g=a;++h<l;){f=o[h];var y=e[f],v=t[f];if(r)var x=a?r(v,y,f,t,e,s):r(y,v,f,e,t,s);if(!(x===void 0?y===v||i(y,v,n,r,s):x)){m=!1;break}g||(g=f=="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 Nit=Eit,jit=hm,Tit=fu,Pit=jit(Tit,"DataView"),Iit=Pit,Oit=hm,Fit=fu,Mit=Oit(Fit,"Promise"),Lit=Mit,Rit=hm,Uit=fu,Dit=Rit(Uit,"Set"),Xfe=Dit,Qit=hm,Hit=fu,$it=Qit(Hit,"WeakMap"),zit=$it,QM=Iit,HM=LQ,$M=Lit,zM=Xfe,VM=zit,Jfe=Nd,pv=ife,gW="[object Map]",Vit="[object Object]",yW="[object Promise]",vW="[object Set]",xW="[object WeakMap]",wW="[object DataView]",Kit=pv(QM),qit=pv(HM),Wit=pv($M),Git=pv(zM),Yit=pv(VM),Pf=Jfe;(QM&&Pf(new QM(new ArrayBuffer(1)))!=wW||HM&&Pf(new HM)!=gW||$M&&Pf($M.resolve())!=yW||zM&&Pf(new zM)!=vW||VM&&Pf(new VM)!=xW)&&(Pf=function(e){var t=Jfe(e),n=t==Vit?e.constructor:void 0,r=n?pv(n):"";if(r)switch(r){case Kit:return wW;case qit:return gW;case Wit:return yW;case Git:return vW;case Yit:return xW}return t});var Xit=Pf,n4=Dfe,Jit=zfe,Zit=jnt,est=Nit,bW=Xit,CW=Ya,SW=qfe,tst=Gfe,nst=1,kW="[object Arguments]",BW="[object Array]",TS="[object Object]",rst=Object.prototype,_W=rst.hasOwnProperty;function ist(e,t,n,r,i,s){var a=CW(e),o=CW(t),l=a?BW:bW(e),u=o?BW:bW(t);l=l==kW?TS:l,u=u==kW?TS:u;var d=l==TS,h=u==TS,f=l==u;if(f&&SW(e)){if(!SW(t))return!1;a=!0,d=!1}if(f&&!d)return s||(s=new n4),a||tst(e)?Jit(e,t,n,r,i,s):Zit(e,t,l,n,r,i,s);if(!(n&nst)){var A=d&&_W.call(e,"__wrapped__"),p=h&&_W.call(t,"__wrapped__");if(A||p){var m=A?e.value():e,g=p?t.value():t;return s||(s=new n4),i(m,g,n,r,s)}}return f?(s||(s=new n4),est(e,t,n,r,i,s)):!1}var sst=ist,ast=sst,EW=jd;function Zfe(e,t,n,r,i){return e===t?!0:e==null||t==null||!EW(e)&&!EW(t)?e!==e&&t!==t:ast(e,t,n,r,Zfe,i)}var tH=Zfe,ost=Dfe,lst=tH,cst=1,ust=2;function dst(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 l=o[0],u=e[l],d=o[1];if(a&&o[2]){if(u===void 0&&!(l in e))return!1}else{var h=new ost;if(r)var f=r(u,d,l,e,t,h);if(!(f===void 0?lst(d,u,cst|ust,r,h):f))return!1}}return!0}var hst=dst,Ast=GA;function fst(e){return e===e&&!Ast(e)}var epe=fst,pst=epe,mst=k5;function gst(e){for(var t=mst(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,pst(i)]}return t}var yst=gst;function vst(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var tpe=vst,xst=hst,wst=yst,bst=tpe;function Cst(e){var t=wst(e);return t.length==1&&t[0][2]?bst(t[0][0],t[0][1]):function(n){return n===e||xst(n,e,t)}}var Sst=Cst;function kst(e,t){return e!=null&&t in Object(e)}var Bst=kst,_st=cfe,Est=JQ,Nst=Ya,jst=ZQ,Tst=eH,Pst=u5;function Ist(e,t,n){t=_st(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=Pst(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&&Tst(i)&&jst(a,i)&&(Nst(e)||Est(e)))}var Ost=Ist,Fst=Bst,Mst=Ost;function Lst(e,t){return e!=null&&Mst(e,t,Fst)}var Rst=Lst,Ust=tH,Dst=ufe,Qst=Rst,Hst=OQ,$st=epe,zst=tpe,Vst=u5,Kst=1,qst=2;function Wst(e,t){return Hst(e)&&$st(t)?zst(Vst(e),t):function(n){var r=Dst(n,e);return r===void 0&&r===t?Qst(n,e):Ust(t,r,Kst|qst)}}var Gst=Wst;function Yst(e){return e}var mv=Yst;function Xst(e){return function(t){return t==null?void 0:t[e]}}var Jst=Xst,Zst=QQ;function eat(e){return function(t){return Zst(t,e)}}var tat=eat,nat=Jst,rat=tat,iat=OQ,sat=u5;function aat(e){return iat(e)?nat(sat(e)):rat(e)}var oat=aat,lat=Sst,cat=Gst,uat=mv,dat=Ya,hat=oat;function Aat(e){return typeof e=="function"?e:e==null?uat:typeof e=="object"?dat(e)?cat(e[0],e[1]):lat(e):hat(e)}var YA=Aat;function fat(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 npe=fat;function pat(e){return e!==e}var mat=pat;function gat(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var yat=gat,vat=npe,xat=mat,wat=yat;function bat(e,t,n){return t===t?wat(e,t,n):vat(e,xat,n)}var Cat=bat,Sat=Cat;function kat(e,t){var n=e==null?0:e.length;return!!n&&Sat(e,t,0)>-1}var Bat=kat;function _at(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 Eat=_at;function Nat(){}var jat=Nat,r4=Xfe,Tat=jat,Pat=XQ,Iat=1/0,Oat=r4&&1/Pat(new r4([,-0]))[1]==Iat?function(e){return new r4(e)}:Tat,Fat=Oat,Mat=Qfe,Lat=Bat,Rat=Eat,Uat=$fe,Dat=Fat,Qat=XQ,Hat=200;function $at(e,t,n){var r=-1,i=Lat,s=e.length,a=!0,o=[],l=o;if(n)a=!1,i=Rat;else if(s>=Hat){var u=t?null:Dat(e);if(u)return Qat(u);a=!1,i=Uat,l=new Mat}else l=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 f=l.length;f--;)if(l[f]===h)continue e;t&&l.push(h),o.push(d)}else i(l,h,n)||(l!==o&&l.push(h),o.push(d))}return o}var zat=$at,Vat=YA,Kat=zat;function qat(e,t){return e&&e.length?Kat(e,Vat(t)):[]}var Wat=qat;const NW=En(Wat);function rpe(e,t,n){return t===!0?NW(e,n):un(t)?NW(e,t):e}function m0(e){"@babel/helpers - typeof";return m0=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},m0(e)}var Gat=["ref"];function jW(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 Iu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jW(Object(n),!0).forEach(function(r){B5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jW(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yat(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TW(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,spe(r.key),r)}}function Xat(e,t,n){return t&&TW(e.prototype,t),n&&TW(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jat(e,t,n){return t=_E(t),Zat(e,ipe()?Reflect.construct(t,n||[],_E(e).constructor):t.apply(e,n))}function Zat(e,t){if(t&&(m0(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return eot(e)}function eot(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ipe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ipe=function(){return!!e})()}function _E(e){return _E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_E(e)}function tot(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&&KM(e,t)}function KM(e,t){return KM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},KM(e,t)}function B5(e,t,n){return t=spe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function spe(e){var t=not(e,"string");return m0(t)=="symbol"?t:t+""}function not(e,t){if(m0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(m0(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rot(e,t){if(e==null)return{};var n=iot(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 iot(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 sot(e){return e.value}function aot(e,t){if(re.isValidElement(e))return re.cloneElement(e,t);if(typeof e=="function")return re.createElement(e,t);t.ref;var n=rot(t,Gat);return re.createElement(YQ,n)}var PW=1,Sp=function(e){function t(){var n;Yat(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=Jat(this,t,[].concat(i)),B5(n,"lastBoundingBox",{width:-1,height:-1}),n}return tot(t,e),Xat(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)>PW||Math.abs(i.height-this.lastBoundingBox.height)>PW)&&(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?Iu({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,s=i.layout,a=i.align,o=i.verticalAlign,l=i.margin,u=i.chartWidth,d=i.chartHeight,h,f;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(a==="center"&&s==="vertical"){var A=this.getBBoxSnapshot();h={left:((u||0)-A.width)/2}}else h=a==="right"?{right:l&&l.right||0}:{left:l&&l.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();f={top:((d||0)-p.height)/2}}else f=o==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return Iu(Iu({},h),f)}},{key:"render",value:function(){var r=this,i=this.props,s=i.content,a=i.width,o=i.height,l=i.wrapperStyle,u=i.payloadUniqBy,d=i.payload,h=Iu(Iu({position:"absolute",width:a||"auto",height:o||"auto"},this.getDefaultPosition(l)),l);return re.createElement("div",{className:"recharts-legend-wrapper",style:h,ref:function(A){r.wrapperNode=A}},aot(s,Iu(Iu({},this.props),{},{payload:rpe(d,u,sot)})))}}],[{key:"getWithHeight",value:function(r,i){var s=Iu(Iu({},this.defaultProps),r.props),a=s.layout;return a==="vertical"&&Je(r.props.height)?{height:r.props.height}:a==="horizontal"?{width:r.props.width||i}:null}}])}(k.PureComponent);B5(Sp,"displayName","Legend");B5(Sp,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var IW=N2,oot=JQ,lot=Ya,OW=IW?IW.isConcatSpreadable:void 0;function cot(e){return lot(e)||oot(e)||!!(OW&&e&&e[OW])}var uot=cot,dot=Vfe,hot=uot;function ape(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=hot),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?ape(o,t-1,n,r,i):dot(i,o):r||(i[i.length]=o)}return i}var ope=ape;function Aot(e){return function(t,n,r){for(var i=-1,s=Object(t),a=r(t),o=a.length;o--;){var l=a[e?o:++i];if(n(s[l],l,s)===!1)break}return t}}var fot=Aot,pot=fot,mot=pot(),got=mot,yot=got,vot=k5;function xot(e,t){return e&&yot(e,t,vot)}var lpe=xot,wot=I2;function bot(e,t){return function(n,r){if(n==null)return n;if(!wot(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 Cot=bot,Sot=lpe,kot=Cot,Bot=kot(Sot),nH=Bot,_ot=nH,Eot=I2;function Not(e,t){var n=-1,r=Eot(e)?Array(e.length):[];return _ot(e,function(i,s,a){r[++n]=t(i,s,a)}),r}var cpe=Not;function jot(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var Tot=jot,FW=cv;function Pot(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,s=FW(e),a=t!==void 0,o=t===null,l=t===t,u=FW(t);if(!o&&!u&&!s&&e>t||s&&a&&l&&!o&&!u||r&&a&&l||!n&&l||!i)return 1;if(!r&&!s&&!u&&e<t||u&&n&&i&&!r&&!s||o&&n&&i||!a&&i||!l)return-1}return 0}var Iot=Pot,Oot=Iot;function Fot(e,t,n){for(var r=-1,i=e.criteria,s=t.criteria,a=i.length,o=n.length;++r<a;){var l=Oot(i[r],s[r]);if(l){if(r>=o)return l;var u=n[r];return l*(u=="desc"?-1:1)}}return e.index-t.index}var Mot=Fot,i4=DQ,Lot=QQ,Rot=YA,Uot=cpe,Dot=Tot,Qot=Wfe,Hot=Mot,$ot=mv,zot=Ya;function Vot(e,t,n){t.length?t=i4(t,function(s){return zot(s)?function(a){return Lot(a,s.length===1?s[0]:s)}:s}):t=[$ot];var r=-1;t=i4(t,Qot(Rot));var i=Uot(e,function(s,a,o){var l=i4(t,function(u){return u(s)});return{criteria:l,index:++r,value:s}});return Dot(i,function(s,a){return Hot(s,a,n)})}var Kot=Vot;function qot(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 Wot=qot,Got=Wot,MW=Math.max;function Yot(e,t,n){return t=MW(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=MW(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),Got(e,this,o)}}var Xot=Yot;function Jot(e){return function(){return e}}var Zot=Jot,elt=hm,tlt=function(){try{var e=elt(Object,"defineProperty");return e({},"",{}),e}catch{}}(),upe=tlt,nlt=Zot,LW=upe,rlt=mv,ilt=LW?function(e,t){return LW(e,"toString",{configurable:!0,enumerable:!1,value:nlt(t),writable:!0})}:rlt,slt=ilt,alt=800,olt=16,llt=Date.now;function clt(e){var t=0,n=0;return function(){var r=llt(),i=olt-(r-n);if(n=r,i>0){if(++t>=alt)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var ult=clt,dlt=slt,hlt=ult,Alt=hlt(dlt),flt=Alt,plt=mv,mlt=Xot,glt=flt;function ylt(e,t){return glt(mlt(e,t,plt),e+"")}var vlt=ylt,xlt=MQ,wlt=I2,blt=ZQ,Clt=GA;function Slt(e,t,n){if(!Clt(n))return!1;var r=typeof t;return(r=="number"?wlt(n)&&blt(t,n.length):r=="string"&&t in n)?xlt(n[t],e):!1}var _5=Slt,klt=ope,Blt=Kot,_lt=vlt,RW=_5,Elt=_lt(function(e,t){if(e==null)return[];var n=t.length;return n>1&&RW(e,t[0],t[1])?t=[]:n>2&&RW(t[0],t[1],t[2])&&(t=[t[0]]),Blt(e,klt(t,1),[])}),Nlt=Elt;const rH=En(Nlt);function o1(e){"@babel/helpers - typeof";return o1=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},o1(e)}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 jlt(e,t){return Olt(e)||Ilt(e,t)||Plt(e,t)||Tlt()}function Tlt(){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 Plt(e,t){if(e){if(typeof e=="string")return UW(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 UW(e,t)}}function UW(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 Ilt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function Olt(e){if(Array.isArray(e))return e}function DW(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 s4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DW(Object(n),!0).forEach(function(r){Flt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DW(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Flt(e,t,n){return t=Mlt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mlt(e){var t=Llt(e,"string");return o1(t)=="symbol"?t:t+""}function Llt(e,t){if(o1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(o1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rlt(e){return Array.isArray(e)&&Ri(e[0])&&Ri(e[1])?e.join(" ~ "):e}var Ult=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,l=t.labelStyle,u=l===void 0?{}:l,d=t.payload,h=t.formatter,f=t.itemSorter,A=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=(f?rH(d,f):d).map(function(L,D){if(L.type==="none")return null;var H=s4({display:"block",paddingTop:4,paddingBottom:4,color:L.color||"#000"},o),W=L.formatter||h||Rlt,$=L.value,V=L.name,Q=$,ce=V;if(W&&Q!=null&&ce!=null){var R=W($,V,L,D,d);if(Array.isArray(R)){var M=jlt(R,2);Q=M[0],ce=M[1]}else Q=R}return re.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(D),style:H},Ri(ce)?re.createElement("span",{className:"recharts-tooltip-item-name"},ce):null,Ri(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=s4({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},s),w=s4({margin:0},u),S=!pn(m),_=S?m:"",E=_n("recharts-default-tooltip",A),j=_n("recharts-tooltip-label",p);S&&g&&d!==void 0&&d!==null&&(_=g(m,d));var I=v?{role:"status","aria-live":"assertive"}:{};return re.createElement("div",qM({className:E,style:b},I),re.createElement("p",{className:j,style:w},re.isValidElement(_)?_:"".concat(_)),x())};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 PS(e,t,n){return t=Dlt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dlt(e){var t=Qlt(e,"string");return l1(t)=="symbol"?t:t+""}function Qlt(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 xx="recharts-tooltip-wrapper",Hlt={visibility:"hidden"};function $lt(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return _n(xx,PS(PS(PS(PS({},"".concat(xx,"-right"),Je(n)&&t&&Je(t.x)&&n>=t.x),"".concat(xx,"-left"),Je(n)&&t&&Je(t.x)&&n<t.x),"".concat(xx,"-bottom"),Je(r)&&t&&Je(t.y)&&r>=t.y),"".concat(xx,"-top"),Je(r)&&t&&Je(t.y)&&r<t.y))}function QW(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offsetTopLeft,s=e.position,a=e.reverseDirection,o=e.tooltipDimension,l=e.viewBox,u=e.viewBoxDimension;if(s&&Je(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 f=d,A=l[r];return f<A?Math.max(h,l[r]):Math.max(d,l[r])}var p=h+o,m=l[r]+u;return p>m?Math.max(d,l[r]):Math.max(h,l[r])}function zlt(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 Vlt(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,s=e.reverseDirection,a=e.tooltipBox,o=e.useTranslate3d,l=e.viewBox,u,d,h;return a.height>0&&a.width>0&&n?(d=QW({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:s,tooltipDimension:a.width,viewBox:l,viewBoxDimension:l.width}),h=QW({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:s,tooltipDimension:a.height,viewBox:l,viewBoxDimension:l.height}),u=zlt({translateX:d,translateY:h,useTranslate3d:o})):u=Hlt,{cssProperties:u,cssClasses:$lt({translateX:d,translateY:h,coordinate:n})}}function g0(e){"@babel/helpers - typeof";return g0=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},g0(e)}function HW(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 $W(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HW(Object(n),!0).forEach(function(r){GM(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HW(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Klt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qlt(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,hpe(r.key),r)}}function Wlt(e,t,n){return t&&qlt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Glt(e,t,n){return t=EE(t),Ylt(e,dpe()?Reflect.construct(t,n||[],EE(e).constructor):t.apply(e,n))}function Ylt(e,t){if(t&&(g0(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xlt(e)}function Xlt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dpe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dpe=function(){return!!e})()}function EE(e){return EE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},EE(e)}function Jlt(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&&WM(e,t)}function WM(e,t){return WM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},WM(e,t)}function GM(e,t,n){return t=hpe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hpe(e){var t=Zlt(e,"string");return g0(t)=="symbol"?t:t+""}function Zlt(e,t){if(g0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(g0(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zW=1,ect=function(e){function t(){var n;Klt(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=Glt(this,t,[].concat(i)),GM(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),GM(n,"handleKeyDown",function(a){if(a.key==="Escape"){var o,l,u,d;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(o=(l=n.props.coordinate)===null||l===void 0?void 0:l.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 Jlt(t,e),Wlt(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>zW||Math.abs(r.height-this.state.lastBoundingBox.height)>zW)&&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,l=i.animationEasing,u=i.children,d=i.coordinate,h=i.hasPayload,f=i.isAnimationActive,A=i.offset,p=i.position,m=i.reverseDirection,g=i.useTranslate3d,y=i.viewBox,v=i.wrapperStyle,x=Vlt({allowEscapeViewBox:a,coordinate:d,offsetTopLeft:A,position:p,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:y}),b=x.cssClasses,w=x.cssProperties,S=$W($W({transition:f&&s?"transform ".concat(o,"ms ").concat(l):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:S,ref:function(E){r.wrapperNode=E}},u)}}])}(k.PureComponent),tct=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},sd={isSsr:tct(),get:function(t){return sd[t]},set:function(t,n){if(typeof t=="string")sd[t]=n;else{var r=Object.keys(t);r&&r.length&&r.forEach(function(i){sd[i]=t[i]})}}};function y0(e){"@babel/helpers - typeof";return y0=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},y0(e)}function VW(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 KW(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VW(Object(n),!0).forEach(function(r){iH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VW(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nct(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rct(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,fpe(r.key),r)}}function ict(e,t,n){return t&&rct(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function sct(e,t,n){return t=NE(t),act(e,Ape()?Reflect.construct(t,n||[],NE(e).constructor):t.apply(e,n))}function act(e,t){if(t&&(y0(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oct(e)}function oct(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ape(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ape=function(){return!!e})()}function NE(e){return NE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},NE(e)}function lct(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&&YM(e,t)}function YM(e,t){return YM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},YM(e,t)}function iH(e,t,n){return t=fpe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fpe(e){var t=cct(e,"string");return y0(t)=="symbol"?t:t+""}function cct(e,t){if(y0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(y0(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uct(e){return e.dataKey}function dct(e,t){return re.isValidElement(e)?re.cloneElement(e,t):typeof e=="function"?re.createElement(e,t):re.createElement(Ult,t)}var Go=function(e){function t(){return nct(this,t),sct(this,t,arguments)}return lct(t,e),ict(t,[{key:"render",value:function(){var r=this,i=this.props,s=i.active,a=i.allowEscapeViewBox,o=i.animationDuration,l=i.animationEasing,u=i.content,d=i.coordinate,h=i.filterNull,f=i.isAnimationActive,A=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=rpe(p.filter(function(_){return _.value!=null&&(_.hide!==!0||r.props.includeHidden)}),m,uct));var S=w.length>0;return re.createElement(ect,{allowEscapeViewBox:a,animationDuration:o,animationEasing:l,isAnimationActive:f,active:s,coordinate:d,hasPayload:S,offset:A,position:g,reverseDirection:y,useTranslate3d:v,viewBox:x,wrapperStyle:b},dct(u,KW(KW({},this.props),{},{payload:w})))}}])}(k.PureComponent);iH(Go,"displayName","Tooltip");iH(Go,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!sd.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 hct=fu,Act=function(){return hct.Date.now()},fct=Act,pct=/\s/;function mct(e){for(var t=e.length;t--&&pct.test(e.charAt(t)););return t}var gct=mct,yct=gct,vct=/^\s+/;function xct(e){return e&&e.slice(0,yct(e)+1).replace(vct,"")}var wct=xct,bct=wct,qW=GA,Cct=cv,WW=NaN,Sct=/^[-+]0x[0-9a-f]+$/i,kct=/^0b[01]+$/i,Bct=/^0o[0-7]+$/i,_ct=parseInt;function Ect(e){if(typeof e=="number")return e;if(Cct(e))return WW;if(qW(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=qW(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=bct(e);var n=kct.test(e);return n||Bct.test(e)?_ct(e.slice(2),n?2:8):Sct.test(e)?WW:+e}var ppe=Ect,Nct=GA,a4=fct,GW=ppe,jct="Expected a function",Tct=Math.max,Pct=Math.min;function Ict(e,t,n){var r,i,s,a,o,l,u=0,d=!1,h=!1,f=!0;if(typeof e!="function")throw new TypeError(jct);t=GW(t)||0,Nct(n)&&(d=!!n.leading,h="maxWait"in n,s=h?Tct(GW(n.maxWait)||0,t):s,f="trailing"in n?!!n.trailing:f);function A(S){var _=r,E=i;return r=i=void 0,u=S,a=e.apply(E,_),a}function p(S){return u=S,o=setTimeout(y,t),d?A(S):a}function m(S){var _=S-l,E=S-u,j=t-_;return h?Pct(j,s-E):j}function g(S){var _=S-l,E=S-u;return l===void 0||_>=t||_<0||h&&E>=s}function y(){var S=a4();if(g(S))return v(S);o=setTimeout(y,m(S))}function v(S){return o=void 0,f&&r?A(S):(r=i=void 0,a)}function x(){o!==void 0&&clearTimeout(o),u=0,r=l=i=o=void 0}function b(){return o===void 0?a:v(a4())}function w(){var S=a4(),_=g(S);if(r=arguments,i=this,l=S,_){if(o===void 0)return p(l);if(h)return clearTimeout(o),o=setTimeout(y,t),A(l)}return o===void 0&&(o=setTimeout(y,t)),a}return w.cancel=x,w.flush=b,w}var Oct=Ict,Fct=Oct,Mct=GA,Lct="Expected a function";function Rct(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(Lct);return Mct(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Fct(e,t,{leading:r,maxWait:t,trailing:i})}var Uct=Rct;const mpe=En(Uct);function c1(e){"@babel/helpers - typeof";return c1=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},c1(e)}function YW(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 IS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YW(Object(n),!0).forEach(function(r){Dct(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YW(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dct(e,t,n){return t=Qct(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qct(e){var t=Hct(e,"string");return c1(t)=="symbol"?t:t+""}function Hct(e,t){if(c1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(c1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $ct(e,t){return qct(e)||Kct(e,t)||Vct(e,t)||zct()}function zct(){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 Vct(e,t){if(e){if(typeof e=="string")return XW(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 XW(e,t)}}function XW(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 Kct(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function qct(e){if(Array.isArray(e))return e}var sH=k.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,l=o===void 0?"100%":o,u=e.minWidth,d=u===void 0?0:u,h=e.minHeight,f=e.maxHeight,A=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=k.useRef(null),S=k.useRef();S.current=v,k.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 _=k.useState({containerWidth:i.width,containerHeight:i.height}),E=$ct(_,2),j=E[0],I=E[1],T=k.useCallback(function(F,L){I(function(D){var H=Math.round(F),W=Math.round(L);return D.containerWidth===H&&D.containerHeight===W?D:{containerWidth:H,containerHeight:W}})},[]);k.useEffect(function(){var F=function(V){var Q,ce=V[0].contentRect,R=ce.width,M=ce.height;T(R,M),(Q=S.current)===null||Q===void 0||Q.call(S,R,M)};m>0&&(F=mpe(F,m,{trailing:!0,leading:!1}));var L=new ResizeObserver(F),D=w.current.getBoundingClientRect(),H=D.width,W=D.height;return T(H,W),L.observe(w.current),function(){L.disconnect()}},[T,m]);var N=k.useMemo(function(){var F=j.containerWidth,L=j.containerHeight;if(F<0||L<0)return null;id(Xf(a)||Xf(l),`The width(%s) and height(%s) are both fixed numbers,
       maybe you don't need to use a ResponsiveContainer.`,a,l),id(!n||n>0,"The aspect(%s) must be greater than zero.",n);var D=Xf(a)?F:a,H=Xf(l)?L:l;n&&n>0&&(D?H=D/n:H&&(D=H*n),f&&H>f&&(H=f)),id(D>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.`,D,H,a,l,d,h,n);var W=!Array.isArray(A)&&rd(A.type).endsWith("Chart");return re.Children.map(A,function($){return re.isValidElement($)?k.cloneElement($,IS({width:D,height:H},W?{style:IS({height:"100%",width:"100%",maxHeight:H,maxWidth:D},$.props.style)}:{})):$})},[n,A,l,f,h,d,j,a]);return re.createElement("div",{id:g?"".concat(g):void 0,className:_n("recharts-responsive-container",y),style:IS(IS({},b),{},{width:a,height:l,minWidth:d,minHeight:h,maxHeight:f}),ref:w},N)}),gpe=function(t){return null};gpe.displayName="Cell";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 JW(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 XM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JW(Object(n),!0).forEach(function(r){Wct(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JW(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wct(e,t,n){return t=Gct(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gct(e){var t=Yct(e,"string");return u1(t)=="symbol"?t:t+""}function Yct(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 ig={widthCache:{},cacheCount:0},Xct=2e3,Jct={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},ZW="recharts_measurement_span";function Zct(e){var t=XM({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var Hw=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||sd.isSsr)return{width:0,height:0};var r=Zct(n),i=JSON.stringify({text:t,copyStyle:r});if(ig.widthCache[i])return ig.widthCache[i];try{var s=document.getElementById(ZW);s||(s=document.createElement("span"),s.setAttribute("id",ZW),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var a=XM(XM({},Jct),r);Object.assign(s.style,a),s.textContent="".concat(t);var o=s.getBoundingClientRect(),l={width:o.width,height:o.height};return ig.widthCache[i]=l,++ig.cacheCount>Xct&&(ig.cacheCount=0,ig.widthCache={}),l}catch{return{width:0,height:0}}},eut=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};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 jE(e,t){return iut(e)||rut(e,t)||nut(e,t)||tut()}function tut(){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 nut(e,t){if(e){if(typeof e=="string")return eG(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 eG(e,t)}}function eG(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 rut(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function iut(e){if(Array.isArray(e))return e}function sut(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tG(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,out(r.key),r)}}function aut(e,t,n){return t&&tG(e.prototype,t),n&&tG(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function out(e){var t=lut(e,"string");return d1(t)=="symbol"?t:t+""}function lut(e,t){if(d1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(d1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var nG=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,rG=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,cut=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,uut=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,ype={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},dut=Object.keys(ype),Gg="NaN";function hut(e,t){return e*ype[t]}var OS=function(){function e(t,n){sut(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!cut.test(n)&&(this.num=NaN,this.unit=""),dut.includes(n)&&(this.num=hut(t,n),this.unit="px")}return aut(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=uut.exec(n))!==null&&r!==void 0?r:[],s=jE(i,3),a=s[1],o=s[2];return new e(parseFloat(a),o??"")}}])}();function vpe(e){if(e.includes(Gg))return Gg;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=nG.exec(t))!==null&&n!==void 0?n:[],i=jE(r,4),s=i[1],a=i[2],o=i[3],l=OS.parse(s??""),u=OS.parse(o??""),d=a==="*"?l.multiply(u):l.divide(u);if(d.isNaN())return Gg;t=t.replace(nG,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var h,f=(h=rG.exec(t))!==null&&h!==void 0?h:[],A=jE(f,4),p=A[1],m=A[2],g=A[3],y=OS.parse(p??""),v=OS.parse(g??""),x=m==="+"?y.add(v):y.subtract(v);if(x.isNaN())return Gg;t=t.replace(rG,x.toString())}return t}var iG=/\(([^()]*)\)/;function Aut(e){for(var t=e;t.includes("(");){var n=iG.exec(t),r=jE(n,2),i=r[1];t=t.replace(iG,vpe(i))}return t}function fut(e){var t=e.replace(/\s+/g,"");return t=Aut(t),t=vpe(t),t}function put(e){try{return fut(e)}catch{return Gg}}function o4(e){var t=put(e.slice(5,-1));return t===Gg?"":t}var mut=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],gut=["dx","dy","angle","className","breakAll"];function JM(){return JM=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},JM.apply(this,arguments)}function sG(e,t){if(e==null)return{};var n=yut(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 yut(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 aG(e,t){return but(e)||wut(e,t)||xut(e,t)||vut()}function vut(){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 xut(e,t){if(e){if(typeof e=="string")return oG(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 oG(e,t)}}function oG(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 wut(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function but(e){if(Array.isArray(e))return e}var xpe=/[ \f\n\r\t\v\u2028\u2029]+/,wpe=function(t){var n=t.children,r=t.breakAll,i=t.style;try{var s=[];pn(n)||(r?s=n.toString().split(""):s=n.toString().split(xpe));var a=s.map(function(l){return{word:l,width:Hw(l,i).width}}),o=r?0:Hw(" ",i).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}},Cut=function(t,n,r,i,s){var a=t.maxLines,o=t.children,l=t.style,u=t.breakAll,d=Je(a),h=o,f=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return D.reduce(function(H,W){var $=W.word,V=W.width,Q=H[H.length-1];if(Q&&(i==null||s||Q.width+V+r<Number(i)))Q.words.push($),Q.width+=V+r;else{var ce={words:[$],width:V};H.push(ce)}return H},[])},A=f(n),p=function(D){return D.reduce(function(H,W){return H.width>W.width?H:W})};if(!d)return A;for(var m="…",g=function(D){var H=h.slice(0,D),W=wpe({breakAll:u,style:l,children:H+m}).wordsWithComputedWidth,$=f(W),V=$.length>a||p($).width>Number(i);return[V,$]},y=0,v=h.length-1,x=0,b;y<=v&&x<=h.length-1;){var w=Math.floor((y+v)/2),S=w-1,_=g(S),E=aG(_,2),j=E[0],I=E[1],T=g(w),N=aG(T,1),F=N[0];if(!j&&!F&&(y=w+1),j&&F&&(v=w-1),!j&&F){b=I;break}x++}return b||A},lG=function(t){var n=pn(t)?[]:t.toString().split(xpe);return[{words:n}]},Sut=function(t){var n=t.width,r=t.scaleToFit,i=t.children,s=t.style,a=t.breakAll,o=t.maxLines;if((n||r)&&!sd.isSsr){var l,u,d=wpe({breakAll:a,children:i,style:s});if(d){var h=d.wordsWithComputedWidth,f=d.spaceWidth;l=h,u=f}else return lG(i);return Cut({breakAll:a,children:i,maxLines:o,style:s},l,u,n,r)}return lG(i)},cG="#808080",TE=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,l=t.capHeight,u=l===void 0?"0.71em":l,d=t.scaleToFit,h=d===void 0?!1:d,f=t.textAnchor,A=f===void 0?"start":f,p=t.verticalAnchor,m=p===void 0?"end":p,g=t.fill,y=g===void 0?cG:g,v=sG(t,mut),x=k.useMemo(function(){return Sut({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,S=v.angle,_=v.className,E=v.breakAll,j=sG(v,gut);if(!Ri(r)||!Ri(s))return null;var I=r+(Je(b)?b:0),T=s+(Je(w)?w:0),N;switch(m){case"start":N=o4("calc(".concat(u,")"));break;case"middle":N=o4("calc(".concat((x.length-1)/2," * -").concat(o," + (").concat(u," / 2))"));break;default:N=o4("calc(".concat(x.length-1," * -").concat(o,")"));break}var F=[];if(h){var L=x[0].width,D=v.width;F.push("scale(".concat((Je(D)?D/L:1)/L,")"))}return S&&F.push("rotate(".concat(S,", ").concat(I,", ").concat(T,")")),F.length&&(j.transform=F.join(" ")),re.createElement("text",JM({},vn(j,!0),{x:I,y:T,className:_n("recharts-text",_),textAnchor:A,fill:y.includes("url")?cG:y}),x.map(function(H,W){var $=H.words.join(E?"":" ");return re.createElement("tspan",{x:I,dy:W===0?N:o,key:"".concat($,"-").concat(W)},$)}))};function hA(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function kut(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function aH(e){let t,n,r;e.length!==2?(t=hA,n=(o,l)=>hA(e(o),l),r=(o,l)=>e(o)-l):(t=e===hA||e===kut?e:But,n=e,r=e);function i(o,l,u=0,d=o.length){if(u<d){if(t(l,l)!==0)return d;do{const h=u+d>>>1;n(o[h],l)<0?u=h+1:d=h}while(u<d)}return u}function s(o,l,u=0,d=o.length){if(u<d){if(t(l,l)!==0)return d;do{const h=u+d>>>1;n(o[h],l)<=0?u=h+1:d=h}while(u<d)}return u}function a(o,l,u=0,d=o.length){const h=i(o,l,u,d-1);return h>u&&r(o[h-1],l)>-r(o[h],l)?h-1:h}return{left:i,center:a,right:s}}function But(){return 0}function bpe(e){return e===null?NaN:+e}function*_ut(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Eut=aH(hA),O2=Eut.right;aH(bpe).center;class uG extends Map{constructor(t,n=Tut){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(dG(this,t))}has(t){return super.has(dG(this,t))}set(t,n){return super.set(Nut(this,t),n)}delete(t){return super.delete(jut(this,t))}}function dG({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Nut({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function jut({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Tut(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Put(e=hA){if(e===hA)return Cpe;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 Cpe(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Iut=Math.sqrt(50),Out=Math.sqrt(10),Fut=Math.sqrt(2);function PE(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>=Iut?10:s>=Out?5:s>=Fut?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/a,o=Math.round(e*u),l=Math.round(t*u),o/u<e&&++o,l/u>t&&--l,u=-u):(u=Math.pow(10,i)*a,o=Math.round(e/u),l=Math.round(t/u),o*u<e&&++o,l*u>t&&--l),l<o&&.5<=n&&n<2?PE(e,t,n*2):[o,l,u]}function ZM(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?PE(t,e,n):PE(e,t,n);if(!(s>=i))return[];const o=s-i+1,l=new Array(o);if(r)if(a<0)for(let u=0;u<o;++u)l[u]=(s-u)/-a;else for(let u=0;u<o;++u)l[u]=(s-u)*a;else if(a<0)for(let u=0;u<o;++u)l[u]=(i+u)/-a;else for(let u=0;u<o;++u)l[u]=(i+u)*a;return l}function eL(e,t,n){return t=+t,e=+e,n=+n,PE(e,t,n)[2]}function tL(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?eL(t,e,n):eL(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function hG(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function AG(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function Spe(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?Cpe:Put(i);r>n;){if(r-n>600){const l=r-n+1,u=t-n+1,d=Math.log(l),h=.5*Math.exp(2*d/3),f=.5*Math.sqrt(d*h*(l-h)/l)*(u-l/2<0?-1:1),A=Math.max(n,Math.floor(t-u*h/l+f)),p=Math.min(r,Math.floor(t+(l-u)*h/l+f));Spe(e,t,A,p,i)}const s=e[t];let a=n,o=r;for(wx(e,n,t),i(e[r],s)>0&&wx(e,n,r);a<o;){for(wx(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?wx(e,n,o):(++o,wx(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function wx(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Mut(e,t,n){if(e=Float64Array.from(_ut(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return AG(e);if(t>=1)return hG(e);var r,i=(r-1)*t,s=Math.floor(i),a=hG(Spe(e,s).subarray(0,s+1)),o=AG(e.subarray(s+1));return a+(o-a)*(i-s)}}function Lut(e,t,n=bpe){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 Rut(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 Cl(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Td(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 nL=Symbol("implicit");function oH(){var e=new uG,t=[],n=[],r=nL;function i(s){let a=e.get(s);if(a===void 0){if(r!==nL)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 uG;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 oH(t,n).unknown(r)},Cl.apply(i,arguments),i}function h1(){var e=oH().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,a,o=!1,l=0,u=0,d=.5;delete e.unknown;function h(){var f=t().length,A=i<r,p=A?i:r,m=A?r:i;s=(m-p)/Math.max(1,f-l+u*2),o&&(s=Math.floor(s)),p+=(m-p-s*(f-l))*d,a=s*(1-l),o&&(p=Math.round(p),a=Math.round(a));var g=Rut(f).map(function(y){return p+s*y});return n(A?g.reverse():g)}return e.domain=function(f){return arguments.length?(t(f),h()):t()},e.range=function(f){return arguments.length?([r,i]=f,r=+r,i=+i,h()):[r,i]},e.rangeRound=function(f){return[r,i]=f,r=+r,i=+i,o=!0,h()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(f){return arguments.length?(o=!!f,h()):o},e.padding=function(f){return arguments.length?(l=Math.min(1,u=+f),h()):l},e.paddingInner=function(f){return arguments.length?(l=Math.min(1,f),h()):l},e.paddingOuter=function(f){return arguments.length?(u=+f,h()):u},e.align=function(f){return arguments.length?(d=Math.max(0,Math.min(1,f)),h()):d},e.copy=function(){return h1(t(),[r,i]).round(o).paddingInner(l).paddingOuter(u).align(d)},Cl.apply(h(),arguments)}function kpe(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return kpe(t())},e}function $w(){return kpe(h1.apply(null,arguments).paddingInner(1))}function lH(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Bpe(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function F2(){}var A1=.7,IE=1/A1,Sy="\\s*([+-]?\\d+)\\s*",f1="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",nu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Uut=/^#([0-9a-f]{3,8})$/,Dut=new RegExp(`^rgb\\(${Sy},${Sy},${Sy}\\)$`),Qut=new RegExp(`^rgb\\(${nu},${nu},${nu}\\)$`),Hut=new RegExp(`^rgba\\(${Sy},${Sy},${Sy},${f1}\\)$`),$ut=new RegExp(`^rgba\\(${nu},${nu},${nu},${f1}\\)$`),zut=new RegExp(`^hsl\\(${f1},${nu},${nu}\\)$`),Vut=new RegExp(`^hsla\\(${f1},${nu},${nu},${f1}\\)$`),fG={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};lH(F2,p1,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:pG,formatHex:pG,formatHex8:Kut,formatHsl:qut,formatRgb:mG,toString:mG});function pG(){return this.rgb().formatHex()}function Kut(){return this.rgb().formatHex8()}function qut(){return _pe(this).formatHsl()}function mG(){return this.rgb().formatRgb()}function p1(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Uut.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?gG(t):n===3?new Qa(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?FS(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?FS(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=Dut.exec(e))?new Qa(t[1],t[2],t[3],1):(t=Qut.exec(e))?new Qa(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Hut.exec(e))?FS(t[1],t[2],t[3],t[4]):(t=$ut.exec(e))?FS(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=zut.exec(e))?xG(t[1],t[2]/100,t[3]/100,1):(t=Vut.exec(e))?xG(t[1],t[2]/100,t[3]/100,t[4]):fG.hasOwnProperty(e)?gG(fG[e]):e==="transparent"?new Qa(NaN,NaN,NaN,0):null}function gG(e){return new Qa(e>>16&255,e>>8&255,e&255,1)}function FS(e,t,n,r){return r<=0&&(e=t=n=NaN),new Qa(e,t,n,r)}function Wut(e){return e instanceof F2||(e=p1(e)),e?(e=e.rgb(),new Qa(e.r,e.g,e.b,e.opacity)):new Qa}function rL(e,t,n,r){return arguments.length===1?Wut(e):new Qa(e,t,n,r??1)}function Qa(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}lH(Qa,rL,Bpe(F2,{brighter(e){return e=e==null?IE:Math.pow(IE,e),new Qa(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?A1:Math.pow(A1,e),new Qa(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Qa(kp(this.r),kp(this.g),kp(this.b),OE(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:yG,formatHex:yG,formatHex8:Gut,formatRgb:vG,toString:vG}));function yG(){return`#${Jf(this.r)}${Jf(this.g)}${Jf(this.b)}`}function Gut(){return`#${Jf(this.r)}${Jf(this.g)}${Jf(this.b)}${Jf((isNaN(this.opacity)?1:this.opacity)*255)}`}function vG(){const e=OE(this.opacity);return`${e===1?"rgb(":"rgba("}${kp(this.r)}, ${kp(this.g)}, ${kp(this.b)}${e===1?")":`, ${e})`}`}function OE(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function kp(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Jf(e){return e=kp(e),(e<16?"0":"")+e.toString(16)}function xG(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Yl(e,t,n,r)}function _pe(e){if(e instanceof Yl)return new Yl(e.h,e.s,e.l,e.opacity);if(e instanceof F2||(e=p1(e)),!e)return new Yl;if(e instanceof Yl)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,l=(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/=l<.5?s+i:2-s-i,a*=60):o=l>0&&l<1?0:a,new Yl(a,o,l,e.opacity)}function Yut(e,t,n,r){return arguments.length===1?_pe(e):new Yl(e,t,n,r??1)}function Yl(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}lH(Yl,Yut,Bpe(F2,{brighter(e){return e=e==null?IE:Math.pow(IE,e),new Yl(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?A1:Math.pow(A1,e),new Yl(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 Qa(l4(e>=240?e-240:e+120,i,r),l4(e,i,r),l4(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Yl(wG(this.h),MS(this.s),MS(this.l),OE(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=OE(this.opacity);return`${e===1?"hsl(":"hsla("}${wG(this.h)}, ${MS(this.s)*100}%, ${MS(this.l)*100}%${e===1?")":`, ${e})`}`}}));function wG(e){return e=(e||0)%360,e<0?e+360:e}function MS(e){return Math.max(0,Math.min(1,e||0))}function l4(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 cH=e=>()=>e;function Xut(e,t){return function(n){return e+n*t}}function Jut(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 Zut(e){return(e=+e)==1?Epe:function(t,n){return n-t?Jut(t,n,e):cH(isNaN(t)?n:t)}}function Epe(e,t){var n=t-e;return n?Xut(e,n):cH(isNaN(e)?t:e)}const bG=function e(t){var n=Zut(t);function r(i,s){var a=n((i=rL(i)).r,(s=rL(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),u=Epe(i.opacity,s.opacity);return function(d){return i.r=a(d),i.g=o(d),i.b=l(d),i.opacity=u(d),i+""}}return r.gamma=e,r}(1);function edt(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 tdt(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ndt(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]=gv(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 rdt(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function FE(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function idt(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]=gv(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var iL=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,c4=new RegExp(iL.source,"g");function sdt(e){return function(){return e}}function adt(e){return function(t){return e(t)+""}}function odt(e,t){var n=iL.lastIndex=c4.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=iL.exec(e))&&(i=c4.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,l.push({i:a,x:FE(r,i)})),n=c4.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?adt(l[0].x):sdt(t):(t=l.length,function(u){for(var d=0,h;d<t;++d)o[(h=l[d]).i]=h.x(u);return o.join("")})}function gv(e,t){var n=typeof t,r;return t==null||n==="boolean"?cH(t):(n==="number"?FE:n==="string"?(r=p1(t))?(t=r,bG):odt:t instanceof p1?bG:t instanceof Date?rdt:tdt(t)?edt:Array.isArray(t)?ndt:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?idt:FE)(e,t)}function uH(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function ldt(e,t){t===void 0&&(t=e,e=gv);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 cdt(e){return function(){return e}}function ME(e){return+e}var CG=[0,1];function fa(e){return e}function sL(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:cdt(isNaN(t)?NaN:.5)}function udt(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function ddt(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=sL(i,r),s=n(a,s)):(r=sL(r,i),s=n(s,a)),function(o){return s(r(o))}}function hdt(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]=sL(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=O2(e,o,1,r)-1;return s[l](i[l](o))}}function M2(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function E5(){var e=CG,t=CG,n=gv,r,i,s,a=fa,o,l,u;function d(){var f=Math.min(e.length,t.length);return a!==fa&&(a=udt(e[0],e[f-1])),o=f>2?hdt:ddt,l=u=null,h}function h(f){return f==null||isNaN(f=+f)?s:(l||(l=o(e.map(r),t,n)))(r(a(f)))}return h.invert=function(f){return a(i((u||(u=o(t,e.map(r),FE)))(f)))},h.domain=function(f){return arguments.length?(e=Array.from(f,ME),d()):e.slice()},h.range=function(f){return arguments.length?(t=Array.from(f),d()):t.slice()},h.rangeRound=function(f){return t=Array.from(f),n=uH,d()},h.clamp=function(f){return arguments.length?(a=f?!0:fa,d()):a!==fa},h.interpolate=function(f){return arguments.length?(n=f,d()):n},h.unknown=function(f){return arguments.length?(s=f,h):s},function(f,A){return r=f,i=A,d()}}function dH(){return E5()(fa,fa)}function Adt(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function LE(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 v0(e){return e=LE(Math.abs(e)),e?e[1]:NaN}function fdt(e,t){return function(n,r){for(var i=n.length,s=[],a=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),s.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function pdt(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var mdt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function m1(e){if(!(t=mdt.exec(e)))throw new Error("invalid format: "+e);var t;return new hH({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]})}m1.prototype=hH.prototype;function hH(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+""}hH.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 gdt(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 Npe;function ydt(e,t){var n=LE(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(Npe=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")+LE(e,Math.max(0,t+s-1))[0]}function SG(e,t){var n=LE(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 kG={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Adt,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)=>SG(e*100,t),r:SG,s:ydt,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function BG(e){return e}var _G=Array.prototype.map,EG=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function vdt(e){var t=e.grouping===void 0||e.thousands===void 0?BG:fdt(_G.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?BG:pdt(_G.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(h){h=m1(h);var f=h.fill,A=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"):kG[w]||(x===void 0&&(x=12),b=!0,w="g"),(g||f==="0"&&A==="=")&&(g=!0,f="0",A="=");var S=m==="$"?n:m==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",_=m==="$"?r:/[%p]/.test(w)?a:"",E=kG[w],j=/[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 I(T){var N=S,F=_,L,D,H;if(w==="c")F=E(T)+F,T="";else{T=+T;var W=T<0||1/T<0;if(T=isNaN(T)?l:E(Math.abs(T),x),b&&(T=gdt(T)),W&&+T==0&&p!=="+"&&(W=!1),N=(W?p==="("?p:o:p==="-"||p==="("?"":p)+N,F=(w==="s"?EG[8+Npe/3]:"")+F+(W&&p==="("?")":""),j){for(L=-1,D=T.length;++L<D;)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,V=$<y?new Array(y-$+1).join(f):"";switch(v&&g&&(T=t(V+T,V.length?y-F.length:1/0),V=""),A){case"<":T=N+T+F+V;break;case"=":T=N+V+T+F;break;case"^":T=V.slice(0,$=V.length>>1)+N+T+F+V.slice($);break;default:T=V+N+T+F;break}return s(T)}return I.toString=function(){return h+""},I}function d(h,f){var A=u((h=m1(h),h.type="f",h)),p=Math.max(-8,Math.min(8,Math.floor(v0(f)/3)))*3,m=Math.pow(10,-p),g=EG[8+p/3];return function(y){return A(m*y)+g}}return{format:u,formatPrefix:d}}var LS,AH,jpe;xdt({thousands:",",grouping:[3],currency:["$",""]});function xdt(e){return LS=vdt(e),AH=LS.format,jpe=LS.formatPrefix,LS}function wdt(e){return Math.max(0,-v0(Math.abs(e)))}function bdt(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(v0(t)/3)))*3-v0(Math.abs(e)))}function Cdt(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,v0(t)-v0(e))+1}function Tpe(e,t,n,r){var i=tL(e,t,n),s;switch(r=m1(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=bdt(i,a))&&(r.precision=s),jpe(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=Cdt(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=wdt(i))&&(r.precision=s-(r.type==="%")*2);break}}return AH(r)}function XA(e){var t=e.domain;return e.ticks=function(n){var r=t();return ZM(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Tpe(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],l,u,d=10;for(o<a&&(u=a,a=o,o=u,u=i,i=s,s=u);d-- >0;){if(u=eL(a,o,n),u===l)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;l=u}return e},e}function RE(){var e=dH();return e.copy=function(){return M2(e,RE())},Cl.apply(e,arguments),XA(e)}function Ppe(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,ME),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return Ppe(e).unknown(t)},e=arguments.length?Array.from(e,ME):[0,1],XA(n)}function Ipe(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 NG(e){return Math.log(e)}function jG(e){return Math.exp(e)}function Sdt(e){return-Math.log(-e)}function kdt(e){return-Math.exp(-e)}function Bdt(e){return isFinite(e)?+("1e"+e):e<0?0:e}function _dt(e){return e===10?Bdt:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Edt(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 TG(e){return(t,n)=>-e(-t,n)}function fH(e){const t=e(NG,jG),n=t.domain;let r=10,i,s;function a(){return i=Edt(r),s=_dt(r),n()[0]<0?(i=TG(i),s=TG(s),e(Sdt,kdt)):e(NG,jG),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 l=n();let u=l[0],d=l[l.length-1];const h=d<u;h&&([u,d]=[d,u]);let f=i(u),A=i(d),p,m;const g=o==null?10:+o;let y=[];if(!(r%1)&&A-f<g){if(f=Math.floor(f),A=Math.ceil(A),u>0){for(;f<=A;++f)for(p=1;p<r;++p)if(m=f<0?p/s(-f):p*s(f),!(m<u)){if(m>d)break;y.push(m)}}else for(;f<=A;++f)for(p=r-1;p>=1;--p)if(m=f>0?p/s(-f):p*s(f),!(m<u)){if(m>d)break;y.push(m)}y.length*2<g&&(y=ZM(u,d,g))}else y=ZM(f,A,Math.min(A-f,g)).map(s);return h?y.reverse():y},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=m1(l)).precision==null&&(l.trim=!0),l=AH(l)),o===1/0)return l;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?l(d):""}},t.nice=()=>n(Ipe(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function Ope(){const e=fH(E5()).domain([1,10]);return e.copy=()=>M2(e,Ope()).base(e.base()),Cl.apply(e,arguments),e}function PG(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function IG(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function pH(e){var t=1,n=e(PG(t),IG(t));return n.constant=function(r){return arguments.length?e(PG(t=+r),IG(t)):t},XA(n)}function Fpe(){var e=pH(E5());return e.copy=function(){return M2(e,Fpe()).constant(e.constant())},Cl.apply(e,arguments)}function OG(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Ndt(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function jdt(e){return e<0?-e*e:e*e}function mH(e){var t=e(fa,fa),n=1;function r(){return n===1?e(fa,fa):n===.5?e(Ndt,jdt):e(OG(n),OG(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},XA(t)}function gH(){var e=mH(E5());return e.copy=function(){return M2(e,gH()).exponent(e.exponent())},Cl.apply(e,arguments),e}function Tdt(){return gH.apply(null,arguments).exponent(.5)}function FG(e){return Math.sign(e)*e*e}function Pdt(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Mpe(){var e=dH(),t=[0,1],n=!1,r;function i(s){var a=Pdt(e(s));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(s){return e.invert(FG(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,ME)).map(FG)),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 Mpe(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Cl.apply(i,arguments),XA(i)}function Lpe(){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]=Lut(e,a/o);return s}function s(a){return a==null||isNaN(a=+a)?r:t[O2(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(hA),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 Lpe().domain(e).range(t).unknown(r)},Cl.apply(s,arguments)}function Rpe(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[O2(r,l,0,n)]:s}function o(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,o()):[e,t]},a.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,o()):i.slice()},a.invertExtent=function(l){var u=i.indexOf(l);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},a.unknown=function(l){return arguments.length&&(s=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return Rpe().domain([e,t]).range(i).unknown(s)},Cl.apply(XA(a),arguments)}function Upe(){var e=[.5],t=[0,1],n,r=1;function i(s){return s!=null&&s<=s?t[O2(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 Upe().domain(e).range(t).unknown(n)},Cl.apply(i,arguments)}const u4=new Date,d4=new Date;function Qi(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 l=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;let u;do l.push(u=new Date(+s)),t(s,o),e(s);while(u<s&&s<a);return l},i.filter=s=>Qi(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)=>(u4.setTime(+s),d4.setTime(+a),e(u4),e(d4),Math.floor(n(u4,d4))),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 UE=Qi(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);UE.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Qi(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):UE);UE.range;const Ju=1e3,il=Ju*60,Zu=il*60,gd=Zu*24,yH=gd*7,MG=gd*30,h4=gd*365,Zf=Qi(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ju)},(e,t)=>(t-e)/Ju,e=>e.getUTCSeconds());Zf.range;const vH=Qi(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ju)},(e,t)=>{e.setTime(+e+t*il)},(e,t)=>(t-e)/il,e=>e.getMinutes());vH.range;const xH=Qi(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*il)},(e,t)=>(t-e)/il,e=>e.getUTCMinutes());xH.range;const wH=Qi(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ju-e.getMinutes()*il)},(e,t)=>{e.setTime(+e+t*Zu)},(e,t)=>(t-e)/Zu,e=>e.getHours());wH.range;const bH=Qi(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Zu)},(e,t)=>(t-e)/Zu,e=>e.getUTCHours());bH.range;const L2=Qi(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*il)/gd,e=>e.getDate()-1);L2.range;const N5=Qi(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/gd,e=>e.getUTCDate()-1);N5.range;const Dpe=Qi(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/gd,e=>Math.floor(e/gd));Dpe.range;function Am(e){return Qi(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())*il)/yH)}const j5=Am(0),DE=Am(1),Idt=Am(2),Odt=Am(3),x0=Am(4),Fdt=Am(5),Mdt=Am(6);j5.range;DE.range;Idt.range;Odt.range;x0.range;Fdt.range;Mdt.range;function fm(e){return Qi(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)/yH)}const T5=fm(0),QE=fm(1),Ldt=fm(2),Rdt=fm(3),w0=fm(4),Udt=fm(5),Ddt=fm(6);T5.range;QE.range;Ldt.range;Rdt.range;w0.range;Udt.range;Ddt.range;const CH=Qi(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());CH.range;const SH=Qi(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());SH.range;const yd=Qi(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());yd.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Qi(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)});yd.range;const vd=Qi(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());vd.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Qi(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)});vd.range;function Qpe(e,t,n,r,i,s){const a=[[Zf,1,Ju],[Zf,5,5*Ju],[Zf,15,15*Ju],[Zf,30,30*Ju],[s,1,il],[s,5,5*il],[s,15,15*il],[s,30,30*il],[i,1,Zu],[i,3,3*Zu],[i,6,6*Zu],[i,12,12*Zu],[r,1,gd],[r,2,2*gd],[n,1,yH],[t,1,MG],[t,3,3*MG],[e,1,h4]];function o(u,d,h){const f=d<u;f&&([u,d]=[d,u]);const A=h&&typeof h.range=="function"?h:l(u,d,h),p=A?A.range(u,+d+1):[];return f?p.reverse():p}function l(u,d,h){const f=Math.abs(d-u)/h,A=aH(([,,g])=>g).right(a,f);if(A===a.length)return e.every(tL(u/h4,d/h4,h));if(A===0)return UE.every(Math.max(tL(u,d,h),1));const[p,m]=a[f/a[A-1][2]<a[A][2]/f?A-1:A];return p.every(m)}return[o,l]}const[Qdt,Hdt]=Qpe(vd,SH,T5,Dpe,bH,xH),[$dt,zdt]=Qpe(yd,CH,j5,L2,wH,vH);function A4(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 f4(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 bx(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Vdt(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,a=e.shortDays,o=e.months,l=e.shortMonths,u=Cx(i),d=Sx(i),h=Cx(s),f=Sx(s),A=Cx(a),p=Sx(a),m=Cx(o),g=Sx(o),y=Cx(l),v=Sx(l),x={a:W,A:$,b:V,B:Q,c:null,d:HG,e:HG,f:fht,g:Sht,G:Bht,H:dht,I:hht,j:Aht,L:Hpe,m:pht,M:mht,p:ce,q:R,Q:VG,s:KG,S:ght,u:yht,U:vht,V:xht,w:wht,W:bht,x:null,X:null,y:Cht,Y:kht,Z:_ht,"%":zG},b={a:M,A:Y,b:X,B:K,c:null,d:$G,e:$G,f:Tht,g:Qht,G:$ht,H:Eht,I:Nht,j:jht,L:zpe,m:Pht,M:Iht,p:Z,q:de,Q:VG,s:KG,S:Oht,u:Fht,U:Mht,V:Lht,w:Rht,W:Uht,x:null,X:null,y:Dht,Y:Hht,Z:zht,"%":zG},w={a:I,A:T,b:N,B:F,c:L,d:DG,e:DG,f:oht,g:UG,G:RG,H:QG,I:QG,j:rht,L:aht,m:nht,M:iht,p:j,q:tht,Q:cht,s:uht,S:sht,u:Ydt,U:Xdt,V:Jdt,w:Gdt,W:Zdt,x:D,X:H,y:UG,Y:RG,Z:eht,"%":lht};x.x=S(n,x),x.X=S(r,x),x.c=S(t,x),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(se,ie){return function(he){var ue=[],Se=-1,Fe=0,te=se.length,_e,Ze,et;for(he instanceof Date||(he=new Date(+he));++Se<te;)se.charCodeAt(Se)===37&&(ue.push(se.slice(Fe,Se)),(Ze=LG[_e=se.charAt(++Se)])!=null?_e=se.charAt(++Se):Ze=_e==="e"?" ":"0",(et=ie[_e])&&(_e=et(he,Ze)),ue.push(_e),Fe=Se+1);return ue.push(se.slice(Fe,Se)),ue.join("")}}function _(se,ie){return function(he){var ue=bx(1900,void 0,1),Se=E(ue,se,he+="",0),Fe,te;if(Se!=he.length)return null;if("Q"in ue)return new Date(ue.Q);if("s"in ue)return new Date(ue.s*1e3+("L"in ue?ue.L:0));if(ie&&!("Z"in ue)&&(ue.Z=0),"p"in ue&&(ue.H=ue.H%12+ue.p*12),ue.m===void 0&&(ue.m="q"in ue?ue.q:0),"V"in ue){if(ue.V<1||ue.V>53)return null;"w"in ue||(ue.w=1),"Z"in ue?(Fe=f4(bx(ue.y,0,1)),te=Fe.getUTCDay(),Fe=te>4||te===0?QE.ceil(Fe):QE(Fe),Fe=N5.offset(Fe,(ue.V-1)*7),ue.y=Fe.getUTCFullYear(),ue.m=Fe.getUTCMonth(),ue.d=Fe.getUTCDate()+(ue.w+6)%7):(Fe=A4(bx(ue.y,0,1)),te=Fe.getDay(),Fe=te>4||te===0?DE.ceil(Fe):DE(Fe),Fe=L2.offset(Fe,(ue.V-1)*7),ue.y=Fe.getFullYear(),ue.m=Fe.getMonth(),ue.d=Fe.getDate()+(ue.w+6)%7)}else("W"in ue||"U"in ue)&&("w"in ue||(ue.w="u"in ue?ue.u%7:"W"in ue?1:0),te="Z"in ue?f4(bx(ue.y,0,1)).getUTCDay():A4(bx(ue.y,0,1)).getDay(),ue.m=0,ue.d="W"in ue?(ue.w+6)%7+ue.W*7-(te+5)%7:ue.w+ue.U*7-(te+6)%7);return"Z"in ue?(ue.H+=ue.Z/100|0,ue.M+=ue.Z%100,f4(ue)):A4(ue)}}function E(se,ie,he,ue){for(var Se=0,Fe=ie.length,te=he.length,_e,Ze;Se<Fe;){if(ue>=te)return-1;if(_e=ie.charCodeAt(Se++),_e===37){if(_e=ie.charAt(Se++),Ze=w[_e in LG?ie.charAt(Se++):_e],!Ze||(ue=Ze(se,he,ue))<0)return-1}else if(_e!=he.charCodeAt(ue++))return-1}return ue}function j(se,ie,he){var ue=u.exec(ie.slice(he));return ue?(se.p=d.get(ue[0].toLowerCase()),he+ue[0].length):-1}function I(se,ie,he){var ue=A.exec(ie.slice(he));return ue?(se.w=p.get(ue[0].toLowerCase()),he+ue[0].length):-1}function T(se,ie,he){var ue=h.exec(ie.slice(he));return ue?(se.w=f.get(ue[0].toLowerCase()),he+ue[0].length):-1}function N(se,ie,he){var ue=y.exec(ie.slice(he));return ue?(se.m=v.get(ue[0].toLowerCase()),he+ue[0].length):-1}function F(se,ie,he){var ue=m.exec(ie.slice(he));return ue?(se.m=g.get(ue[0].toLowerCase()),he+ue[0].length):-1}function L(se,ie,he){return E(se,t,ie,he)}function D(se,ie,he){return E(se,n,ie,he)}function H(se,ie,he){return E(se,r,ie,he)}function W(se){return a[se.getDay()]}function $(se){return s[se.getDay()]}function V(se){return l[se.getMonth()]}function Q(se){return o[se.getMonth()]}function ce(se){return i[+(se.getHours()>=12)]}function R(se){return 1+~~(se.getMonth()/3)}function M(se){return a[se.getUTCDay()]}function Y(se){return s[se.getUTCDay()]}function X(se){return l[se.getUTCMonth()]}function K(se){return o[se.getUTCMonth()]}function Z(se){return i[+(se.getUTCHours()>=12)]}function de(se){return 1+~~(se.getUTCMonth()/3)}return{format:function(se){var ie=S(se+="",x);return ie.toString=function(){return se},ie},parse:function(se){var ie=_(se+="",!1);return ie.toString=function(){return se},ie},utcFormat:function(se){var ie=S(se+="",b);return ie.toString=function(){return se},ie},utcParse:function(se){var ie=_(se+="",!0);return ie.toString=function(){return se},ie}}}var LG={"-":"",_:" ",0:"0"},es=/^\s*\d+/,Kdt=/^%/,qdt=/[\\^$*+?|[\]().{}]/g;function Pn(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 Wdt(e){return e.replace(qdt,"\\$&")}function Cx(e){return new RegExp("^(?:"+e.map(Wdt).join("|")+")","i")}function Sx(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Gdt(e,t,n){var r=es.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Ydt(e,t,n){var r=es.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Xdt(e,t,n){var r=es.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Jdt(e,t,n){var r=es.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Zdt(e,t,n){var r=es.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function RG(e,t,n){var r=es.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function UG(e,t,n){var r=es.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function eht(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 tht(e,t,n){var r=es.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function nht(e,t,n){var r=es.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function DG(e,t,n){var r=es.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function rht(e,t,n){var r=es.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function QG(e,t,n){var r=es.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function iht(e,t,n){var r=es.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function sht(e,t,n){var r=es.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function aht(e,t,n){var r=es.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function oht(e,t,n){var r=es.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function lht(e,t,n){var r=Kdt.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function cht(e,t,n){var r=es.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function uht(e,t,n){var r=es.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function HG(e,t){return Pn(e.getDate(),t,2)}function dht(e,t){return Pn(e.getHours(),t,2)}function hht(e,t){return Pn(e.getHours()%12||12,t,2)}function Aht(e,t){return Pn(1+L2.count(yd(e),e),t,3)}function Hpe(e,t){return Pn(e.getMilliseconds(),t,3)}function fht(e,t){return Hpe(e,t)+"000"}function pht(e,t){return Pn(e.getMonth()+1,t,2)}function mht(e,t){return Pn(e.getMinutes(),t,2)}function ght(e,t){return Pn(e.getSeconds(),t,2)}function yht(e){var t=e.getDay();return t===0?7:t}function vht(e,t){return Pn(j5.count(yd(e)-1,e),t,2)}function $pe(e){var t=e.getDay();return t>=4||t===0?x0(e):x0.ceil(e)}function xht(e,t){return e=$pe(e),Pn(x0.count(yd(e),e)+(yd(e).getDay()===4),t,2)}function wht(e){return e.getDay()}function bht(e,t){return Pn(DE.count(yd(e)-1,e),t,2)}function Cht(e,t){return Pn(e.getFullYear()%100,t,2)}function Sht(e,t){return e=$pe(e),Pn(e.getFullYear()%100,t,2)}function kht(e,t){return Pn(e.getFullYear()%1e4,t,4)}function Bht(e,t){var n=e.getDay();return e=n>=4||n===0?x0(e):x0.ceil(e),Pn(e.getFullYear()%1e4,t,4)}function _ht(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Pn(t/60|0,"0",2)+Pn(t%60,"0",2)}function $G(e,t){return Pn(e.getUTCDate(),t,2)}function Eht(e,t){return Pn(e.getUTCHours(),t,2)}function Nht(e,t){return Pn(e.getUTCHours()%12||12,t,2)}function jht(e,t){return Pn(1+N5.count(vd(e),e),t,3)}function zpe(e,t){return Pn(e.getUTCMilliseconds(),t,3)}function Tht(e,t){return zpe(e,t)+"000"}function Pht(e,t){return Pn(e.getUTCMonth()+1,t,2)}function Iht(e,t){return Pn(e.getUTCMinutes(),t,2)}function Oht(e,t){return Pn(e.getUTCSeconds(),t,2)}function Fht(e){var t=e.getUTCDay();return t===0?7:t}function Mht(e,t){return Pn(T5.count(vd(e)-1,e),t,2)}function Vpe(e){var t=e.getUTCDay();return t>=4||t===0?w0(e):w0.ceil(e)}function Lht(e,t){return e=Vpe(e),Pn(w0.count(vd(e),e)+(vd(e).getUTCDay()===4),t,2)}function Rht(e){return e.getUTCDay()}function Uht(e,t){return Pn(QE.count(vd(e)-1,e),t,2)}function Dht(e,t){return Pn(e.getUTCFullYear()%100,t,2)}function Qht(e,t){return e=Vpe(e),Pn(e.getUTCFullYear()%100,t,2)}function Hht(e,t){return Pn(e.getUTCFullYear()%1e4,t,4)}function $ht(e,t){var n=e.getUTCDay();return e=n>=4||n===0?w0(e):w0.ceil(e),Pn(e.getUTCFullYear()%1e4,t,4)}function zht(){return"+0000"}function zG(){return"%"}function VG(e){return+e}function KG(e){return Math.floor(+e/1e3)}var sg,Kpe,qpe;Vht({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 Vht(e){return sg=Vdt(e),Kpe=sg.format,sg.parse,qpe=sg.utcFormat,sg.utcParse,sg}function Kht(e){return new Date(e)}function qht(e){return e instanceof Date?+e:+new Date(+e)}function kH(e,t,n,r,i,s,a,o,l,u){var d=dH(),h=d.invert,f=d.domain,A=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(S){return(l(S)<S?A:o(S)<S?p:a(S)<S?m:s(S)<S?g:r(S)<S?i(S)<S?y:v:n(S)<S?x:b)(S)}return d.invert=function(S){return new Date(h(S))},d.domain=function(S){return arguments.length?f(Array.from(S,qht)):f().map(Kht)},d.ticks=function(S){var _=f();return e(_[0],_[_.length-1],S??10)},d.tickFormat=function(S,_){return _==null?w:u(_)},d.nice=function(S){var _=f();return(!S||typeof S.range!="function")&&(S=t(_[0],_[_.length-1],S??10)),S?f(Ipe(_,S)):d},d.copy=function(){return M2(d,kH(e,t,n,r,i,s,a,o,l,u))},d}function Wht(){return Cl.apply(kH($dt,zdt,yd,CH,j5,L2,wH,vH,Zf,Kpe).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Ght(){return Cl.apply(kH(Qdt,Hdt,vd,SH,T5,N5,bH,xH,Zf,qpe).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function P5(){var e=0,t=1,n,r,i,s,a=fa,o=!1,l;function u(h){return h==null||isNaN(h=+h)?l: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(f){var A,p;return arguments.length?([A,p]=f,a=h(A,p),u):[a(0),a(1)]}}return u.range=d(gv),u.rangeRound=d(uH),u.unknown=function(h){return arguments.length?(l=h,u):l},function(h){return s=h,n=h(e),r=h(t),i=n===r?0:1/(r-n),u}}function JA(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Wpe(){var e=XA(P5()(fa));return e.copy=function(){return JA(e,Wpe())},Td.apply(e,arguments)}function Gpe(){var e=fH(P5()).domain([1,10]);return e.copy=function(){return JA(e,Gpe()).base(e.base())},Td.apply(e,arguments)}function Ype(){var e=pH(P5());return e.copy=function(){return JA(e,Ype()).constant(e.constant())},Td.apply(e,arguments)}function BH(){var e=mH(P5());return e.copy=function(){return JA(e,BH()).exponent(e.exponent())},Td.apply(e,arguments)}function Yht(){return BH.apply(null,arguments).exponent(.5)}function Xpe(){var e=[],t=fa;function n(r){if(r!=null&&!isNaN(r=+r))return t((O2(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(hA),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)=>Mut(e,s/r))},n.copy=function(){return Xpe(t).domain(e)},Td.apply(n,arguments)}function I5(){var e=0,t=.5,n=1,r=1,i,s,a,o,l,u=fa,d,h=!1,f;function A(m){return isNaN(m=+m)?f:(m=.5+((m=+d(m))-s)*(r*m<r*s?o:l),u(h?Math.max(0,Math.min(1,m)):m))}A.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),l=s===a?0:.5/(a-s),r=s<i?-1:1,A):[e,t,n]},A.clamp=function(m){return arguments.length?(h=!!m,A):h},A.interpolator=function(m){return arguments.length?(u=m,A):u};function p(m){return function(g){var y,v,x;return arguments.length?([y,v,x]=g,u=ldt(m,[y,v,x]),A):[u(0),u(.5),u(1)]}}return A.range=p(gv),A.rangeRound=p(uH),A.unknown=function(m){return arguments.length?(f=m,A):f},function(m){return d=m,i=m(e),s=m(t),a=m(n),o=i===s?0:.5/(s-i),l=s===a?0:.5/(a-s),r=s<i?-1:1,A}}function Jpe(){var e=XA(I5()(fa));return e.copy=function(){return JA(e,Jpe())},Td.apply(e,arguments)}function Zpe(){var e=fH(I5()).domain([.1,1,10]);return e.copy=function(){return JA(e,Zpe()).base(e.base())},Td.apply(e,arguments)}function eme(){var e=pH(I5());return e.copy=function(){return JA(e,eme()).constant(e.constant())},Td.apply(e,arguments)}function _H(){var e=mH(I5());return e.copy=function(){return JA(e,_H()).exponent(e.exponent())},Td.apply(e,arguments)}function Xht(){return _H.apply(null,arguments).exponent(.5)}const qG=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:h1,scaleDiverging:Jpe,scaleDivergingLog:Zpe,scaleDivergingPow:_H,scaleDivergingSqrt:Xht,scaleDivergingSymlog:eme,scaleIdentity:Ppe,scaleImplicit:nL,scaleLinear:RE,scaleLog:Ope,scaleOrdinal:oH,scalePoint:$w,scalePow:gH,scaleQuantile:Lpe,scaleQuantize:Rpe,scaleRadial:Mpe,scaleSequential:Wpe,scaleSequentialLog:Gpe,scaleSequentialPow:BH,scaleSequentialQuantile:Xpe,scaleSequentialSqrt:Yht,scaleSequentialSymlog:Ype,scaleSqrt:Tdt,scaleSymlog:Fpe,scaleThreshold:Upe,scaleTime:Wht,scaleUtc:Ght,tickFormat:Tpe},Symbol.toStringTag,{value:"Module"}));var Jht=cv;function Zht(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&&!Jht(a):n(a,o)))var o=a,l=s}return l}var tme=Zht;function eAt(e,t){return e>t}var tAt=eAt,nAt=tme,rAt=tAt,iAt=mv;function sAt(e){return e&&e.length?nAt(e,iAt,rAt):void 0}var aAt=sAt;const O5=En(aAt);function oAt(e,t){return e<t}var lAt=oAt,cAt=tme,uAt=lAt,dAt=mv;function hAt(e){return e&&e.length?cAt(e,dAt,uAt):void 0}var AAt=hAt;const F5=En(AAt);var fAt=DQ,pAt=YA,mAt=cpe,gAt=Ya;function yAt(e,t){var n=gAt(e)?fAt:mAt;return n(e,pAt(t))}var vAt=yAt,xAt=ope,wAt=vAt;function bAt(e,t){return xAt(wAt(e,t),1)}var CAt=bAt;const SAt=En(CAt);var kAt=tH;function BAt(e,t){return kAt(e,t)}var _At=BAt;const M5=En(_At);var yv=1e9,EAt={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},NH,Nr=!0,vl="[DecimalError] ",Bp=vl+"Invalid argument: ",EH=vl+"Exponent out of range: ",vv=Math.floor,If=Math.pow,NAt=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,yo,Ki=1e7,yr=7,nme=9007199254740991,HE=vv(nme/yr),lt={};lt.absoluteValue=lt.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};lt.comparedTo=lt.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};lt.decimalPlaces=lt.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*yr;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};lt.dividedBy=lt.div=function(e){return ad(this,new this.constructor(e))};lt.dividedToIntegerBy=lt.idiv=function(e){var t=this,n=t.constructor;return Jn(ad(t,new n(e),0,1),n.precision)};lt.equals=lt.eq=function(e){return!this.cmp(e)};lt.exponent=function(){return Si(this)};lt.greaterThan=lt.gt=function(e){return this.cmp(e)>0};lt.greaterThanOrEqualTo=lt.gte=function(e){return this.cmp(e)>=0};lt.isInteger=lt.isint=function(){return this.e>this.d.length-2};lt.isNegative=lt.isneg=function(){return this.s<0};lt.isPositive=lt.ispos=function(){return this.s>0};lt.isZero=function(){return this.s===0};lt.lessThan=lt.lt=function(e){return this.cmp(e)<0};lt.lessThanOrEqualTo=lt.lte=function(e){return this.cmp(e)<1};lt.logarithm=lt.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(yo))throw Error(vl+"NaN");if(n.s<1)throw Error(vl+(n.s?"NaN":"-Infinity"));return n.eq(yo)?new r(0):(Nr=!1,t=ad(g1(n,s),g1(e,s),s),Nr=!0,Jn(t,i))};lt.minus=lt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?sme(t,e):rme(t,(e.s=-e.s,e))};lt.modulo=lt.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(vl+"NaN");return n.s?(Nr=!1,t=ad(n,e,0,1).times(e),Nr=!0,n.minus(t)):Jn(new r(n),i)};lt.naturalExponential=lt.exp=function(){return ime(this)};lt.naturalLogarithm=lt.ln=function(){return g1(this)};lt.negated=lt.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};lt.plus=lt.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?rme(t,e):sme(t,(e.s=-e.s,e))};lt.precision=lt.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Bp+e);if(t=Si(i)+1,r=i.d.length-1,n=r*yr+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};lt.squareRoot=lt.sqrt=function(){var e,t,n,r,i,s,a,o=this,l=o.constructor;if(o.s<1){if(!o.s)return new l(0);throw Error(vl+"NaN")}for(e=Si(o),Nr=!1,i=Math.sqrt(+o),i==0||i==1/0?(t=Wc(o.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=vv((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 l(t)):r=new l(i.toString()),n=l.precision,i=a=n+3;;)if(s=r,r=s.plus(ad(o,s,a+2)).times(.5),Wc(s.d).slice(0,a)===(t=Wc(r.d)).slice(0,a)){if(t=t.slice(a-3,a+1),i==a&&t=="4999"){if(Jn(s,n+1,0),s.times(s).eq(o)){r=s;break}}else if(t!="9999")break;a+=4}return Nr=!0,Jn(r,n)};lt.times=lt.mul=function(e){var t,n,r,i,s,a,o,l,u,d=this,h=d.constructor,f=d.d,A=(e=new h(e)).d;if(!d.s||!e.s)return new h(0);for(e.s*=d.s,n=d.e+e.e,l=f.length,u=A.length,l<u&&(s=f,f=A,A=s,a=l,l=u,u=a),s=[],a=l+u,r=a;r--;)s.push(0);for(r=u;--r>=0;){for(t=0,i=l+r;i>r;)o=s[i]+A[r]*f[i-r-1]+t,s[i--]=o%Ki|0,t=o/Ki|0;s[i]=(s[i]+t)%Ki|0}for(;!s[--a];)s.pop();return t?++n:s.shift(),e.d=s,e.e=n,Nr?Jn(e,h.precision):e};lt.toDecimalPlaces=lt.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(uu(e,0,yv),t===void 0?t=r.rounding:uu(t,0,8),Jn(n,e+Si(n)+1,t))};lt.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Jp(r,!0):(uu(e,0,yv),t===void 0?t=i.rounding:uu(t,0,8),r=Jn(new i(r),e+1,t),n=Jp(r,!0,e+1)),n};lt.toFixed=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?Jp(i):(uu(e,0,yv),t===void 0?t=s.rounding:uu(t,0,8),r=Jn(new s(i),e+Si(i)+1,t),n=Jp(r.abs(),!1,e+Si(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};lt.toInteger=lt.toint=function(){var e=this,t=e.constructor;return Jn(new t(e),Si(e)+1,t.rounding)};lt.toNumber=function(){return+this};lt.toPower=lt.pow=function(e){var t,n,r,i,s,a,o=this,l=o.constructor,u=12,d=+(e=new l(e));if(!e.s)return new l(yo);if(o=new l(o),!o.s){if(e.s<1)throw Error(vl+"Infinity");return o}if(o.eq(yo))return o;if(r=l.precision,e.eq(yo))return Jn(o,r);if(t=e.e,n=e.d.length-1,a=t>=n,s=o.s,a){if((n=d<0?-d:d)<=nme){for(i=new l(yo),t=Math.ceil(r/yr+4),Nr=!1;n%2&&(i=i.times(o),GG(i.d,t)),n=vv(n/2),n!==0;)o=o.times(o),GG(o.d,t);return Nr=!0,e.s<0?new l(yo).div(i):Jn(i,r)}}else if(s<0)throw Error(vl+"NaN");return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,o.s=1,Nr=!1,i=e.times(g1(o,r+u)),Nr=!0,i=ime(i),i.s=s,i};lt.toPrecision=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?(n=Si(i),r=Jp(i,n<=s.toExpNeg||n>=s.toExpPos)):(uu(e,1,yv),t===void 0?t=s.rounding:uu(t,0,8),i=Jn(new s(i),e,t),n=Si(i),r=Jp(i,e<=n||n<=s.toExpNeg,e)),r};lt.toSignificantDigits=lt.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(uu(e,1,yv),t===void 0?t=r.rounding:uu(t,0,8)),Jn(new r(n),e,t)};lt.toString=lt.valueOf=lt.val=lt.toJSON=lt[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Si(e),n=e.constructor;return Jp(e,t<=n.toExpNeg||t>=n.toExpPos)};function rme(e,t){var n,r,i,s,a,o,l,u,d=e.constructor,h=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),Nr?Jn(t,h):t;if(l=e.d,u=t.d,a=e.e,i=t.e,l=l.slice(),s=a-i,s){for(s<0?(r=l,s=-s,o=u.length):(r=u,i=a,o=l.length),a=Math.ceil(h/yr),o=a>o?a+1:o+1,s>o&&(s=o,r.length=1),r.reverse();s--;)r.push(0);r.reverse()}for(o=l.length,s=u.length,o-s<0&&(s=o,r=u,u=l,l=r),n=0;s;)n=(l[--s]=l[s]+u[s]+n)/Ki|0,l[s]%=Ki;for(n&&(l.unshift(n),++i),o=l.length;l[--o]==0;)l.pop();return t.d=l,t.e=i,Nr?Jn(t,h):t}function uu(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Bp+e)}function Wc(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=yr-r.length,n&&(s+=mh(n)),s+=r;a=e[t],r=a+"",n=yr-r.length,n&&(s+=mh(n))}else if(a===0)return"0";for(;a%10===0;)a/=10;return s+a}var ad=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%Ki|0,a=s/Ki|0;return a&&r.unshift(a),r}function t(r,i,s,a){var o,l;if(s!=a)l=s>a?1:-1;else for(o=l=0;o<s;o++)if(r[o]!=i[o]){l=r[o]>i[o]?1:-1;break}return l}function n(r,i,s){for(var a=0;s--;)r[s]-=a,a=r[s]<i[s]?1:0,r[s]=a*Ki+r[s]-i[s];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,s,a){var o,l,u,d,h,f,A,p,m,g,y,v,x,b,w,S,_,E,j=r.constructor,I=r.s==i.s?1:-1,T=r.d,N=i.d;if(!r.s)return new j(r);if(!i.s)throw Error(vl+"Division by zero");for(l=r.e-i.e,_=N.length,w=T.length,A=new j(I),p=A.d=[],u=0;N[u]==(T[u]||0);)++u;if(N[u]>(T[u]||0)&&--l,s==null?v=s=j.precision:a?v=s+(Si(r)-Si(i))+1:v=s,v<0)return new j(0);if(v=v/yr+2|0,u=0,_==1)for(d=0,N=N[0],v++;(u<w||d)&&v--;u++)x=d*Ki+(T[u]||0),p[u]=x/N|0,d=x%N|0;else{for(d=Ki/(N[0]+1)|0,d>1&&(N=e(N,d),T=e(T,d),_=N.length,w=T.length),b=_,m=T.slice(0,_),g=m.length;g<_;)m[g++]=0;E=N.slice(),E.unshift(0),S=N[0],N[1]>=Ki/2&&++S;do d=0,o=t(N,m,_,g),o<0?(y=m[0],_!=g&&(y=y*Ki+(m[1]||0)),d=y/S|0,d>1?(d>=Ki&&(d=Ki-1),h=e(N,d),f=h.length,g=m.length,o=t(h,m,f,g),o==1&&(d--,n(h,_<f?E:N,f))):(d==0&&(o=d=1),h=N.slice()),f=h.length,f<g&&h.unshift(0),n(m,h,g),o==-1&&(g=m.length,o=t(N,m,_,g),o<1&&(d++,n(m,_<g?E: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(),A.e=l,Jn(A,a?s+Si(A)+1:s)}}();function ime(e,t){var n,r,i,s,a,o,l=0,u=0,d=e.constructor,h=d.precision;if(Si(e)>16)throw Error(EH+Si(e));if(!e.s)return new d(yo);for(t==null?(Nr=!1,o=h):o=t,a=new d(.03125);e.abs().gte(.1);)e=e.times(a),u+=5;for(r=Math.log(If(2,u))/Math.LN10*2+5|0,o+=r,n=i=s=new d(yo),d.precision=o;;){if(i=Jn(i.times(e),o),n=n.times(++l),a=s.plus(ad(i,n,o)),Wc(a.d).slice(0,o)===Wc(s.d).slice(0,o)){for(;u--;)s=Jn(s.times(s),o);return d.precision=h,t==null?(Nr=!0,Jn(s,h)):s}s=a}}function Si(e){for(var t=e.e*yr,n=e.d[0];n>=10;n/=10)t++;return t}function p4(e,t,n){if(t>e.LN10.sd())throw Nr=!0,n&&(e.precision=n),Error(vl+"LN10 precision limit exceeded");return Jn(new e(e.LN10),t)}function mh(e){for(var t="";e--;)t+="0";return t}function g1(e,t){var n,r,i,s,a,o,l,u,d,h=1,f=10,A=e,p=A.d,m=A.constructor,g=m.precision;if(A.s<1)throw Error(vl+(A.s?"NaN":"-Infinity"));if(A.eq(yo))return new m(0);if(t==null?(Nr=!1,u=g):u=t,A.eq(10))return t==null&&(Nr=!0),p4(m,u);if(u+=f,m.precision=u,n=Wc(p),r=n.charAt(0),s=Si(A),Math.abs(s)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)A=A.times(e),n=Wc(A.d),r=n.charAt(0),h++;s=Si(A),r>1?(A=new m("0."+n),s++):A=new m(r+"."+n.slice(1))}else return l=p4(m,u+2,g).times(s+""),A=g1(new m(r+"."+n.slice(1)),u-f).plus(l),m.precision=g,t==null?(Nr=!0,Jn(A,g)):A;for(o=a=A=ad(A.minus(yo),A.plus(yo),u),d=Jn(A.times(A),u),i=3;;){if(a=Jn(a.times(d),u),l=o.plus(ad(a,new m(i),u)),Wc(l.d).slice(0,u)===Wc(o.d).slice(0,u))return o=o.times(2),s!==0&&(o=o.plus(p4(m,u+2,g).times(s+""))),o=ad(o,new m(h),u),m.precision=g,t==null?(Nr=!0,Jn(o,g)):o;o=l,i+=2}}function WG(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=vv(n/yr),e.d=[],r=(n+1)%yr,n<0&&(r+=yr),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=yr;r<i;)e.d.push(+t.slice(r,r+=yr));t=t.slice(r),r=yr-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),Nr&&(e.e>HE||e.e<-HE))throw Error(EH+n)}else e.s=0,e.e=0,e.d=[0];return e}function Jn(e,t,n){var r,i,s,a,o,l,u,d,h=e.d;for(a=1,s=h[0];s>=10;s/=10)a++;if(r=t-a,r<0)r+=yr,i=t,u=h[d=0];else{if(d=Math.ceil((r+1)/yr),s=h.length,d>=s)return e;for(u=s=h[d],a=1;s>=10;s/=10)a++;r%=yr,i=r-yr+a}if(n!==void 0&&(s=If(10,a-i-1),o=u/s%10|0,l=t<0||h[d+1]!==void 0||u%s,l=n<4?(o||l)&&(n==0||n==(e.s<0?3:2)):o>5||o==5&&(n==4||l||n==6&&(r>0?i>0?u/If(10,a-i):0:h[d-1])%10&1||n==(e.s<0?8:7))),t<1||!h[0])return l?(s=Si(e),h.length=1,t=t-s-1,h[0]=If(10,(yr-t%yr)%yr),e.e=vv(-t/yr)||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=If(10,yr-r),h[d]=i>0?(u/If(10,a-i)%If(10,i)|0)*s:0),l)for(;;)if(d==0){(h[0]+=s)==Ki&&(h[0]=1,++e.e);break}else{if(h[d]+=s,h[d]!=Ki)break;h[d--]=0,s=1}for(r=h.length;h[--r]===0;)h.pop();if(Nr&&(e.e>HE||e.e<-HE))throw Error(EH+Si(e));return e}function sme(e,t){var n,r,i,s,a,o,l,u,d,h,f=e.constructor,A=f.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new f(e),Nr?Jn(t,A):t;if(l=e.d,h=t.d,r=t.e,u=e.e,l=l.slice(),a=u-r,a){for(d=a<0,d?(n=l,a=-a,o=h.length):(n=h,r=u,o=l.length),i=Math.max(Math.ceil(A/yr),o)+2,a>i&&(a=i,n.length=1),n.reverse(),i=a;i--;)n.push(0);n.reverse()}else{for(i=l.length,o=h.length,d=i<o,d&&(o=i),i=0;i<o;i++)if(l[i]!=h[i]){d=l[i]<h[i];break}a=0}for(d&&(n=l,l=h,h=n,t.s=-t.s),o=l.length,i=h.length-o;i>0;--i)l[o++]=0;for(i=h.length;i>a;){if(l[--i]<h[i]){for(s=i;s&&l[--s]===0;)l[s]=Ki-1;--l[s],l[i]+=Ki}l[i]-=h[i]}for(;l[--o]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(t.d=l,t.e=r,Nr?Jn(t,A):t):new f(0)}function Jp(e,t,n){var r,i=Si(e),s=Wc(e.d),a=s.length;return t?(n&&(r=n-a)>0?s=s.charAt(0)+"."+s.slice(1)+mh(r):a>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+mh(-i-1)+s,n&&(r=n-a)>0&&(s+=mh(r))):i>=a?(s+=mh(i+1-a),n&&(r=n-i-1)>0&&(s=s+"."+mh(r))):((r=i+1)<a&&(s=s.slice(0,r)+"."+s.slice(r)),n&&(r=n-a)>0&&(i+1===a&&(s+="."),s+=mh(r))),e.s<0?"-"+s:s}function GG(e,t){if(e.length>t)return e.length=t,!0}function ame(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(Bp+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 WG(a,s.toString())}else if(typeof s!="string")throw Error(Bp+s);if(s.charCodeAt(0)===45?(s=s.slice(1),a.s=-1):a.s=1,NAt.test(s))WG(a,s);else throw Error(Bp+s)}if(i.prototype=lt,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=ame,i.config=i.set=jAt,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 jAt(e){if(!e||typeof e!="object")throw Error(vl+"Object expected");var t,n,r,i=["precision",1,yv,"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(vv(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Bp+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Bp+n+": "+r);return this}var NH=ame(EAt);yo=new NH(1);const Vn=NH;function TAt(e){return FAt(e)||OAt(e)||IAt(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 IAt(e,t){if(e){if(typeof e=="string")return aL(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 aL(e,t)}}function OAt(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function FAt(e){if(Array.isArray(e))return aL(e)}function aL(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 MAt=function(t){return t},ome={"@@functional/placeholder":!0},lme=function(t){return t===ome},YG=function(t){return function n(){return arguments.length===0||arguments.length===1&&lme(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},LAt=function e(t,n){return t===1?n:YG(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!==ome}).length;return a>=t?n.apply(void 0,i):e(t-a,YG(function(){for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];var d=i.map(function(h){return lme(h)?l.shift():h});return n.apply(void 0,TAt(d).concat(l))}))})},L5=function(t){return LAt(t.length,t)},oL=function(t,n){for(var r=[],i=t;i<n;++i)r[i-t]=i;return r},RAt=L5(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),UAt=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return MAt;var i=n.reverse(),s=i[0],a=i.slice(1);return function(){return a.reduce(function(o,l){return l(o)},s.apply(void 0,arguments))}},lL=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},cme=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,l){return o===n[l]})||(n=s,r=t.apply(void 0,s)),r}};function DAt(e){var t;return e===0?t=1:t=Math.floor(new Vn(e).abs().log(10).toNumber())+1,t}function QAt(e,t,n){for(var r=new Vn(e),i=0,s=[];r.lt(t)&&i<1e5;)s.push(r.toNumber()),r=r.add(n),i++;return s}var HAt=L5(function(e,t,n){var r=+e,i=+t;return r+n*(i-r)}),$At=L5(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),zAt=L5(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const R5={rangeStep:QAt,getDigitCount:DAt,interpolateNumber:HAt,uninterpolateNumber:$At,uninterpolateTruncation:zAt};function cL(e){return qAt(e)||KAt(e)||ume(e)||VAt()}function VAt(){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 KAt(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function qAt(e){if(Array.isArray(e))return uL(e)}function y1(e,t){return YAt(e)||GAt(e,t)||ume(e,t)||WAt()}function WAt(){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 ume(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 GAt(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(l){i=!0,s=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(i)throw s}}return n}}function YAt(e){if(Array.isArray(e))return e}function dme(e){var t=y1(e,2),n=t[0],r=t[1],i=n,s=r;return n>r&&(i=r,s=n),[i,s]}function hme(e,t,n){if(e.lte(0))return new Vn(0);var r=R5.getDigitCount(e.toNumber()),i=new Vn(10).pow(r),s=e.div(i),a=r!==1?.05:.1,o=new Vn(Math.ceil(s.div(a).toNumber())).add(n).mul(a),l=o.mul(i);return t?l:new Vn(Math.ceil(l))}function XAt(e,t,n){var r=1,i=new Vn(e);if(!i.isint()&&n){var s=Math.abs(e);s<1?(r=new Vn(10).pow(R5.getDigitCount(e)-1),i=new Vn(Math.floor(i.div(r).toNumber())).mul(r)):s>1&&(i=new Vn(Math.floor(e)))}else e===0?i=new Vn(Math.floor((t-1)/2)):n||(i=new Vn(Math.floor(e)));var a=Math.floor((t-1)/2),o=UAt(RAt(function(l){return i.add(new Vn(l-a).mul(r)).toNumber()}),oL);return o(0,t)}function Ame(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 Vn(0),tickMin:new Vn(0),tickMax:new Vn(0)};var s=hme(new Vn(t).sub(e).div(n-1),r,i),a;e<=0&&t>=0?a=new Vn(0):(a=new Vn(e).add(t).div(2),a=a.sub(new Vn(a).mod(s)));var o=Math.ceil(a.sub(e).div(s).toNumber()),l=Math.ceil(new Vn(t).sub(a).div(s).toNumber()),u=o+l+1;return u>n?Ame(e,t,n,r,i+1):(u<n&&(l=t>0?l+(n-u):l,o=t>0?o:o+(n-u)),{step:s,tickMin:a.sub(new Vn(o).mul(s)),tickMax:a.add(new Vn(l).mul(s))})}function JAt(e){var t=y1(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=dme([n,r]),l=y1(o,2),u=l[0],d=l[1];if(u===-1/0||d===1/0){var h=d===1/0?[u].concat(cL(oL(0,i-1).map(function(){return 1/0}))):[].concat(cL(oL(0,i-1).map(function(){return-1/0})),[d]);return n>r?lL(h):h}if(u===d)return XAt(u,i,s);var f=Ame(u,d,a,s),A=f.step,p=f.tickMin,m=f.tickMax,g=R5.rangeStep(p,m.add(new Vn(.1).mul(A)),A);return n>r?lL(g):g}function ZAt(e,t){var n=y1(e,2),r=n[0],i=n[1],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=dme([r,i]),o=y1(a,2),l=o[0],u=o[1];if(l===-1/0||u===1/0)return[r,i];if(l===u)return[l];var d=Math.max(t,2),h=hme(new Vn(u).sub(l).div(d-1),s,0),f=[].concat(cL(R5.rangeStep(new Vn(l),new Vn(u).sub(new Vn(.99).mul(h)),h)),[u]);return r>i?lL(f):f}var eft=cme(JAt),tft=cme(ZAt),nft="Invariant failed";function Zp(e,t){throw new Error(nft)}var rft=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function b0(e){"@babel/helpers - typeof";return b0=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},b0(e)}function $E(){return $E=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},$E.apply(this,arguments)}function ift(e,t){return lft(e)||oft(e,t)||aft(e,t)||sft()}function sft(){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 aft(e,t){if(e){if(typeof e=="string")return XG(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 XG(e,t)}}function XG(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 oft(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function lft(e){if(Array.isArray(e))return e}function cft(e,t){if(e==null)return{};var n=uft(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 uft(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 dft(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hft(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,mme(r.key),r)}}function Aft(e,t,n){return t&&hft(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function fft(e,t,n){return t=zE(t),pft(e,fme()?Reflect.construct(t,n||[],zE(e).constructor):t.apply(e,n))}function pft(e,t){if(t&&(b0(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mft(e)}function mft(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fme(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fme=function(){return!!e})()}function zE(e){return zE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},zE(e)}function gft(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&&dL(e,t)}function dL(e,t){return dL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},dL(e,t)}function pme(e,t,n){return t=mme(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mme(e){var t=yft(e,"string");return b0(t)=="symbol"?t:t+""}function yft(e,t){if(b0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(b0(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var R2=function(e){function t(){return dft(this,t),fft(this,t,arguments)}return gft(t,e),Aft(t,[{key:"render",value:function(){var r=this.props,i=r.offset,s=r.layout,a=r.width,o=r.dataKey,l=r.data,u=r.dataPointFormatter,d=r.xAxis,h=r.yAxis,f=cft(r,rft),A=vn(f,!1);this.props.direction==="x"&&d.type!=="number"&&Zp();var p=l.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=[],S,_;if(Array.isArray(b)){var E=ift(b,2);S=E[0],_=E[1]}else S=_=b;if(s==="vertical"){var j=d.scale,I=v+i,T=I+a,N=I-a,F=j(x-S),L=j(x+_);w.push({x1:L,y1:T,x2:L,y2:N}),w.push({x1:F,y1:I,x2:L,y2:I}),w.push({x1:F,y1:T,x2:F,y2:N})}else if(s==="horizontal"){var D=h.scale,H=y+i,W=H-a,$=H+a,V=D(x-S),Q=D(x+_);w.push({x1:W,y1:Q,x2:$,y2:Q}),w.push({x1:H,y1:V,x2:H,y2:Q}),w.push({x1:W,y1:V,x2:$,y2:V})}return re.createElement(di,$E({className:"recharts-errorBar",key:"bar-".concat(w.map(function(ce){return"".concat(ce.x1,"-").concat(ce.x2,"-").concat(ce.y1,"-").concat(ce.y2)}))},A),w.map(function(ce){return re.createElement("line",$E({},ce,{key:"line-".concat(ce.x1,"-").concat(ce.x2,"-").concat(ce.y1,"-").concat(ce.y2)}))}))});return re.createElement(di,{className:"recharts-errorBars"},p)}}])}(re.Component);pme(R2,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});pme(R2,"displayName","ErrorBar");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 JG(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 Cf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JG(Object(n),!0).forEach(function(r){vft(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JG(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vft(e,t,n){return t=xft(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xft(e){var t=wft(e,"string");return v1(t)=="symbol"?t:t+""}function wft(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 gme=function(t){var n=t.children,r=t.formattedGraphicalItems,i=t.legendWidth,s=t.legendContent,a=po(n,Sp);if(!a)return null;var o=Sp.defaultProps,l=o!==void 0?Cf(Cf({},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 f=h.item,A=h.props,p=A.sectors||A.data||[];return d.concat(p.map(function(m){return{type:a.props.iconType||f.props.legendType,value:m.name,color:m.fill,payload:m}}))},[]):u=(r||[]).map(function(d){var h=d.item,f=h.type.defaultProps,A=f!==void 0?Cf(Cf({},f),h.props):{},p=A.dataKey,m=A.name,g=A.legendType,y=A.hide;return{inactive:y,dataKey:p,type:l.iconType||g||"square",color:jH(h),value:m||p,payload:A}}),Cf(Cf(Cf({},l),Sp.getWithHeight(a,i)),{},{payload:u,item:a})};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 ZG(e){return kft(e)||Sft(e)||Cft(e)||bft()}function bft(){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 Cft(e,t){if(e){if(typeof e=="string")return hL(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 hL(e,t)}}function Sft(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kft(e){if(Array.isArray(e))return hL(e)}function hL(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 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 Gr(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){ky(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 ky(e,t,n){return t=Bft(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bft(e){var t=_ft(e,"string");return x1(t)=="symbol"?t:t+""}function _ft(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 _o(e,t,n){return pn(e)||pn(t)?n:Ri(t)?fl(e,t,n):un(t)?t(e):n}function zw(e,t,n,r){var i=SAt(e,function(o){return _o(o,t)});if(n==="number"){var s=i.filter(function(o){return Je(o)||parseFloat(o)});return s.length?[F5(s),O5(s)]:[1/0,-1/0]}var a=r?i.filter(function(o){return!pn(o)}):i;return a.map(function(o){return Ri(o)||o instanceof Date?o:""})}var Eft=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 l=s.range,u=0;u<o;u++){var d=u>0?i[u-1].coordinate:i[o-1].coordinate,h=i[u].coordinate,f=u>=o-1?i[0].coordinate:i[u+1].coordinate,A=void 0;if(rc(h-d)!==rc(f-h)){var p=[];if(rc(f-h)===rc(l[1]-l[0])){A=f;var m=h+l[1]-l[0];p[0]=Math.min(m,(m+d)/2),p[1]=Math.max(m,(m+d)/2)}else{A=d;var g=f+l[1]-l[0];p[0]=Math.min(h,(g+h)/2),p[1]=Math.max(h,(g+h)/2)}var y=[Math.min(h,(A+h)/2),Math.max(h,(A+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,f),x=Math.max(d,f);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},jH=function(t){var n,r=t,i=r.type.displayName,s=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Gr(Gr({},t.type.defaultProps),t.props):t.props,a=s.stroke,o=s.fill,l;switch(i){case"Line":l=a;break;case"Area":case"Radar":l=a&&a!=="none"?a:o;break;default:l=o;break}return l},Nft=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),l=0,u=o.length;l<u;l++)for(var d=s[o[l]].stackGroups,h=Object.keys(d),f=0,A=h.length;f<A;f++){var p=d[h[f]],m=p.items,g=p.cateAxisId,y=m.filter(function(_){return rd(_.type).indexOf("Bar")>=0});if(y&&y.length){var v=y[0].type.defaultProps,x=v!==void 0?Gr(Gr({},v),y[0].props):y[0].props,b=x.barSize,w=x[g];a[w]||(a[w]=[]);var S=pn(b)?n:b;a[w].push({item:y[0],stackList:y.slice(1),barSize:pn(S)?void 0:Xp(S,r,0)})}}return a},jft=function(t){var n=t.barGap,r=t.barCategoryGap,i=t.bandSize,s=t.sizeList,a=s===void 0?[]:s,o=t.maxBarSize,l=a.length;if(l<1)return null;var u=Xp(n,i,0,!0),d,h=[];if(a[0].barSize===+a[0].barSize){var f=!1,A=i/l,p=a.reduce(function(b,w){return b+w.barSize||0},0);p+=(l-1)*u,p>=i&&(p-=(l-1)*u,u=0),p>=i&&A>0&&(f=!0,A*=.9,p=l*A);var m=(i-p)/2>>0,g={offset:m-u,size:0};d=a.reduce(function(b,w){var S={item:w.item,position:{offset:g.offset+g.size+u,size:f?A:w.barSize}},_=[].concat(ZG(b),[S]);return g=_[_.length-1].position,w.stackList&&w.stackList.length&&w.stackList.forEach(function(E){_.push({item:E,position:g})}),_},h)}else{var y=Xp(r,i,0,!0);i-2*y-(l-1)*u<=0&&(u=0);var v=(i-2*y-(l-1)*u)/l;v>1&&(v>>=0);var x=o===+o?Math.min(v,o):v;d=a.reduce(function(b,w,S){var _=[].concat(ZG(b),[{item:w.item,position:{offset:y+(v+u)*S+(v-x)/2,size:x}}]);return w.stackList&&w.stackList.length&&w.stackList.forEach(function(E){_.push({item:E,position:_[_.length-1].position})}),_},h)}return d},Tft=function(t,n,r,i){var s=r.children,a=r.width,o=r.margin,l=a-(o.left||0)-(o.right||0),u=gme({children:s,legendWidth:l});if(u){var d=i||{},h=d.width,f=d.height,A=u.align,p=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&p==="middle")&&A!=="center"&&Je(t[A]))return Gr(Gr({},t),{},ky({},A,t[A]+(h||0)));if((m==="horizontal"||m==="vertical"&&A==="center")&&p!=="middle"&&Je(t[p]))return Gr(Gr({},t),{},ky({},p,t[p]+(f||0)))}return t},Pft=function(t,n,r){return pn(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},yme=function(t,n,r,i,s){var a=n.props.children,o=pl(a,R2).filter(function(u){return Pft(i,s,u.props.direction)});if(o&&o.length){var l=o.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var h=_o(d,r);if(pn(h))return u;var f=Array.isArray(h)?[F5(h),O5(h)]:[h,h],A=l.reduce(function(p,m){var g=_o(d,m,0),y=f[0]-Math.abs(Array.isArray(g)?g[0]:g),v=f[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(A[0],u[0]),Math.max(A[1],u[1])]},[1/0,-1/0])}return null},Ift=function(t,n,r,i,s){var a=n.map(function(o){return yme(t,o,r,s,i)}).filter(function(o){return!pn(o)});return a&&a.length?a.reduce(function(o,l){return[Math.min(o[0],l[0]),Math.max(o[1],l[1])]},[1/0,-1/0]):null},vme=function(t,n,r,i,s){var a=n.map(function(l){var u=l.props.dataKey;return r==="number"&&u&&yme(t,l,u,i)||zw(t,u,r,s)});if(r==="number")return a.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var o={};return a.reduce(function(l,u){for(var d=0,h=u.length;d<h;d++)o[u[d]]||(o[u[d]]=!0,l.push(u[d]));return l},[])},xme=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},wme=function(t,n,r,i){if(i)return t.map(function(l){return l.coordinate});var s,a,o=t.map(function(l){return l.coordinate===n&&(s=!0),l.coordinate===r&&(a=!0),l.coordinate});return s||o.push(n),a||o.push(r),o},ed=function(t,n,r){if(!t)return null;var i=t.scale,s=t.duplicateDomain,a=t.type,o=t.range,l=t.realScaleType==="scaleBand"?i.bandwidth()/2:2,u=(n||r)&&a==="category"&&i.bandwidth?i.bandwidth()/l:0;if(u=t.axisType==="angleAxis"&&(o==null?void 0:o.length)>=2?rc(o[0]-o[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(h){var f=s?s.indexOf(h):h;return{coordinate:i(f)+u,value:h,offset:u}});return d.filter(function(h){return!T2(h.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(h,f){return{coordinate:i(h)+u,value:h,index:f,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,f){return{coordinate:i(h)+u,value:s?s[h]:h,index:f,offset:u}})},m4=new WeakMap,RS=function(t,n){if(typeof n!="function")return t;m4.has(t)||m4.set(t,new WeakMap);var r=m4.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},Oft=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:h1(),realScaleType:"band"}:a==="radial"&&o==="angleAxis"?{scale:RE(),realScaleType:"linear"}:s==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:$w(),realScaleType:"point"}:s==="category"?{scale:h1(),realScaleType:"band"}:{scale:RE(),realScaleType:"linear"};if(j2(i)){var l="scale".concat(w5(i));return{scale:(qG[l]||$w)(),realScaleType:qG[l]?l:"point"}}return un(i)?{scale:i}:{scale:$w(),realScaleType:"point"}},tY=1e-4,Fft=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])-tY,a=Math.max(i[0],i[1])+tY,o=t(n[0]),l=t(n[r-1]);(o<s||o>a||l<s||l>a)&&t.domain([n[0],n[r-1]])}},Mft=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},Lft=function(t,n){if(!n||n.length!==2||!Je(n[0])||!Je(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(!Je(t[0])||t[0]<r)&&(s[0]=r),(!Je(t[1])||t[1]>i)&&(s[1]=i),s[0]>i&&(s[0]=i),s[1]<r&&(s[1]=r),s},Rft=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 l=T2(t[o][r][1])?t[o][r][0]:t[o][r][1];l>=0?(t[o][r][0]=s,t[o][r][1]=s+l,s=t[o][r][1]):(t[o][r][0]=a,t[o][r][1]=a+l,a=t[o][r][1])}},Uft=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=T2(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)}},Dft={sign:Rft,expand:ttt,none:f0,silhouette:ntt,wiggle:rtt,positive:Uft},Qft=function(t,n,r){var i=n.map(function(o){return o.props.dataKey}),s=Dft[r],a=ett().keys(i).value(function(o,l){return+_o(o,l,0)}).order(LM).offset(s);return a(t)},Hft=function(t,n,r,i,s,a){if(!t)return null;var o=a?n.reverse():n,l={},u=o.reduce(function(h,f){var A,p=(A=f.type)!==null&&A!==void 0&&A.defaultProps?Gr(Gr({},f.type.defaultProps),f.props):f.props,m=p.stackId,g=p.hide;if(g)return h;var y=p[r],v=h[y]||{hasStack:!1,stackGroups:{}};if(Ri(m)){var x=v.stackGroups[m]||{numericAxisId:r,cateAxisId:i,items:[]};x.items.push(f),v.hasStack=!0,v.stackGroups[m]=x}else v.stackGroups[P2("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[f]};return Gr(Gr({},h),{},ky({},y,v))},l),d={};return Object.keys(u).reduce(function(h,f){var A=u[f];if(A.hasStack){var p={};A.stackGroups=Object.keys(A.stackGroups).reduce(function(m,g){var y=A.stackGroups[g];return Gr(Gr({},m),{},ky({},g,{numericAxisId:r,cateAxisId:i,items:y.items,stackedData:Qft(t,y.items,s)}))},p)}return Gr(Gr({},h),{},ky({},f,A))},d)},$ft=function(t,n){var r=n.realScaleType,i=n.type,s=n.tickCount,a=n.originalDomain,o=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="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=eft(u,s,o);return t.domain([F5(d),O5(d)]),{niceTicks:d}}if(s&&i==="number"){var h=t.domain(),f=tft(h,s,o);return{niceTicks:f}}return null};function nY(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&&!pn(i[t.dataKey])){var o=pE(n,"value",i[t.dataKey]);if(o)return o.coordinate+r/2}return n[s]?n[s].coordinate+r/2:null}var l=_o(i,pn(a)?t.dataKey:a);return pn(l)?null:t.scale(l)}var rY=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 l=_o(a,n.dataKey,n.domain[o]);return pn(l)?null:n.scale(l)-s/2+i},zft=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]},Vft=function(t,n){var r,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Gr(Gr({},t.type.defaultProps),t.props):t.props,s=i.stackId;if(Ri(s)){var a=n[s];if(a){var o=a.items.indexOf(t);return o>=0?a.stackedData[o]:null}}return null},Kft=function(t){return t.reduce(function(n,r){return[F5(r.concat([n[0]]).filter(Je)),O5(r.concat([n[1]]).filter(Je))]},[1/0,-1/0])},bme=function(t,n,r){return Object.keys(t).reduce(function(i,s){var a=t[s],o=a.stackedData,l=o.reduce(function(u,d){var h=Kft(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(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},iY=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,sY=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,AL=function(t,n,r){if(un(t))return t(n,r);if(!Array.isArray(t))return n;var i=[];if(Je(t[0]))i[0]=r?t[0]:Math.min(t[0],n[0]);else if(iY.test(t[0])){var s=+iY.exec(t[0])[1];i[0]=n[0]-s}else un(t[0])?i[0]=t[0](n[0]):i[0]=n[0];if(Je(t[1]))i[1]=r?t[1]:Math.max(t[1],n[1]);else if(sY.test(t[1])){var a=+sY.exec(t[1])[1];i[1]=n[1]+a}else un(t[1])?i[1]=t[1](n[1]):i[1]=n[1];return i},VE=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=rH(n,function(h){return h.coordinate}),a=1/0,o=1,l=s.length;o<l;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},aY=function(t,n,r){return!t||!t.length||M5(t,fl(r,"type.defaultProps.domain"))?n:t},Cme=function(t,n){var r=t.type.defaultProps?Gr(Gr({},t.type.defaultProps),t.props):t.props,i=r.dataKey,s=r.name,a=r.unit,o=r.formatter,l=r.tooltipType,u=r.chartType,d=r.hide;return Gr(Gr({},vn(t,!1)),{},{dataKey:i,unit:a,formatter:o,name:s||i,color:jH(t),value:_o(n,i),type:l,payload:n,chartType:u,hide:d})};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 oY(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 lY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oY(Object(n),!0).forEach(function(r){qft(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qft(e,t,n){return t=Wft(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wft(e){var t=Gft(e,"string");return w1(t)=="symbol"?t:t+""}function Gft(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 KE=Math.PI/180,Yft=function(t){return t*180/Math.PI},vs=function(t,n,r,i){return{x:t+Math.cos(-KE*i)*r,y:n+Math.sin(-KE*i)*r}},Xft=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))},Jft=function(t,n){var r=t.x,i=t.y,s=n.cx,a=n.cy,o=Xft({x:r,y:i},{x:s,y:a});if(o<=0)return{radius:o};var l=(r-s)/o,u=Math.acos(l);return i>a&&(u=2*Math.PI-u),{radius:o,angle:Yft(u),angleInRadian:u}},Zft=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}},ept=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=Jft({x:r,y:i},n),a=s.radius,o=s.angle,l=n.innerRadius,u=n.outerRadius;if(a<l||a>u)return!1;if(a===0)return!0;var d=Zft(n),h=d.startAngle,f=d.endAngle,A=o,p;if(h<=f){for(;A>f;)A-=360;for(;A<h;)A+=360;p=A>=h&&A<=f}else{for(;A>h;)A-=360;for(;A<f;)A+=360;p=A>=f&&A<=h}return p?lY(lY({},n),{},{radius:a,angle:ept(A,n)}):null};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)}var tpt=["offset"];function npt(e){return apt(e)||spt(e)||ipt(e)||rpt()}function rpt(){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 ipt(e,t){if(e){if(typeof e=="string")return fL(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 fL(e,t)}}function spt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function apt(e){if(Array.isArray(e))return fL(e)}function fL(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 opt(e,t){if(e==null)return{};var n=lpt(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 lpt(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 uY(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 ji(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uY(Object(n),!0).forEach(function(r){cpt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cpt(e,t,n){return t=upt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function upt(e){var t=dpt(e,"string");return b1(t)=="symbol"?t:t+""}function dpt(e,t){if(b1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(b1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function C1(){return C1=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},C1.apply(this,arguments)}var hpt=function(t){var n=t.value,r=t.formatter,i=pn(t.children)?n:t.children;return un(r)?r(i):i},Apt=function(t,n){var r=rc(n-t),i=Math.min(Math.abs(n-t),360);return r*i},fpt=function(t,n,r){var i=t.position,s=t.viewBox,a=t.offset,o=t.className,l=s,u=l.cx,d=l.cy,h=l.innerRadius,f=l.outerRadius,A=l.startAngle,p=l.endAngle,m=l.clockWise,g=(h+f)/2,y=Apt(A,p),v=y>=0?1:-1,x,b;i==="insideStart"?(x=A+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=vs(u,d,g,x),S=vs(u,d,g,x+(b?1:-1)*359),_="M".concat(w.x,",").concat(w.y,`
    A`).concat(g,",").concat(g,",0,1,").concat(b?0:1,`,
    `).concat(S.x,",").concat(S.y),E=pn(t.id)?P2("recharts-radial-line-"):t.id;return re.createElement("text",C1({},r,{dominantBaseline:"central",className:_n("recharts-radial-bar-label",o)}),re.createElement("defs",null,re.createElement("path",{id:E,d:_})),re.createElement("textPath",{xlinkHref:"#".concat(E)},n))},ppt=function(t){var n=t.viewBox,r=t.offset,i=t.position,s=n,a=s.cx,o=s.cy,l=s.innerRadius,u=s.outerRadius,d=s.startAngle,h=s.endAngle,f=(d+h)/2;if(i==="outside"){var A=vs(a,o,u+r,f),p=A.x,m=A.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=(l+u)/2,y=vs(a,o,g,f),v=y.x,x=y.y;return{x:v,y:x,textAnchor:"middle",verticalAnchor:"middle"}},mpt=function(t){var n=t.viewBox,r=t.parentViewBox,i=t.offset,s=t.position,a=n,o=a.x,l=a.y,u=a.width,d=a.height,h=d>=0?1:-1,f=h*i,A=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:l-h*i,textAnchor:"middle",verticalAnchor:A};return ji(ji({},x),r?{height:Math.max(l-r.y,0),width:u}:{})}if(s==="bottom"){var b={x:o+u/2,y:l+d+f,textAnchor:"middle",verticalAnchor:p};return ji(ji({},b),r?{height:Math.max(r.y+r.height-(l+d),0),width:u}:{})}if(s==="left"){var w={x:o-g,y:l+d/2,textAnchor:y,verticalAnchor:"middle"};return ji(ji({},w),r?{width:Math.max(w.x-r.x,0),height:d}:{})}if(s==="right"){var S={x:o+u+g,y:l+d/2,textAnchor:v,verticalAnchor:"middle"};return ji(ji({},S),r?{width:Math.max(r.x+r.width-S.x,0),height:d}:{})}var _=r?{width:u,height:d}:{};return s==="insideLeft"?ji({x:o+g,y:l+d/2,textAnchor:v,verticalAnchor:"middle"},_):s==="insideRight"?ji({x:o+u-g,y:l+d/2,textAnchor:y,verticalAnchor:"middle"},_):s==="insideTop"?ji({x:o+u/2,y:l+f,textAnchor:"middle",verticalAnchor:p},_):s==="insideBottom"?ji({x:o+u/2,y:l+d-f,textAnchor:"middle",verticalAnchor:A},_):s==="insideTopLeft"?ji({x:o+g,y:l+f,textAnchor:v,verticalAnchor:p},_):s==="insideTopRight"?ji({x:o+u-g,y:l+f,textAnchor:y,verticalAnchor:p},_):s==="insideBottomLeft"?ji({x:o+g,y:l+d-f,textAnchor:v,verticalAnchor:A},_):s==="insideBottomRight"?ji({x:o+u-g,y:l+d-f,textAnchor:y,verticalAnchor:A},_):uv(s)&&(Je(s.x)||Xf(s.x))&&(Je(s.y)||Xf(s.y))?ji({x:o+Xp(s.x,u),y:l+Xp(s.y,d),textAnchor:"end",verticalAnchor:"end"},_):ji({x:o+u/2,y:l+d/2,textAnchor:"middle",verticalAnchor:"middle"},_)},gpt=function(t){return"cx"in t&&Je(t.cx)};function Ds(e){var t=e.offset,n=t===void 0?5:t,r=opt(e,tpt),i=ji({offset:n},r),s=i.viewBox,a=i.position,o=i.value,l=i.children,u=i.content,d=i.className,h=d===void 0?"":d,f=i.textBreakAll;if(!s||pn(o)&&pn(l)&&!k.isValidElement(u)&&!un(u))return null;if(k.isValidElement(u))return k.cloneElement(u,i);var A;if(un(u)){if(A=k.createElement(u,i),k.isValidElement(A))return A}else A=hpt(i);var p=gpt(s),m=vn(i,!0);if(p&&(a==="insideStart"||a==="insideEnd"||a==="end"))return fpt(i,A,m);var g=p?ppt(i):mpt(i);return re.createElement(TE,C1({className:_n("recharts-label",h)},m,g,{breakAll:f}),A)}Ds.displayName="Label";var Sme=function(t){var n=t.cx,r=t.cy,i=t.angle,s=t.startAngle,a=t.endAngle,o=t.r,l=t.radius,u=t.innerRadius,d=t.outerRadius,h=t.x,f=t.y,A=t.top,p=t.left,m=t.width,g=t.height,y=t.clockWise,v=t.labelViewBox;if(v)return v;if(Je(m)&&Je(g)){if(Je(h)&&Je(f))return{x:h,y:f,width:m,height:g};if(Je(A)&&Je(p))return{x:A,y:p,width:m,height:g}}return Je(h)&&Je(f)?{x:h,y:f,width:0,height:0}:Je(n)&&Je(r)?{cx:n,cy:r,startAngle:s||i||0,endAngle:a||i||0,innerRadius:u||0,outerRadius:d||l||o||0,clockWise:y}:t.viewBox?t.viewBox:{}},ypt=function(t,n){return t?t===!0?re.createElement(Ds,{key:"label-implicit",viewBox:n}):Ri(t)?re.createElement(Ds,{key:"label-implicit",viewBox:n,value:t}):k.isValidElement(t)?t.type===Ds?k.cloneElement(t,{key:"label-implicit",viewBox:n}):re.createElement(Ds,{key:"label-implicit",content:t,viewBox:n}):un(t)?re.createElement(Ds,{key:"label-implicit",content:t,viewBox:n}):uv(t)?re.createElement(Ds,C1({viewBox:n},t,{key:"label-implicit"})):null:null},vpt=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=Sme(t),a=pl(i,Ds).map(function(l,u){return k.cloneElement(l,{viewBox:n||s,key:"label-".concat(u)})});if(!r)return a;var o=ypt(t.label,n||s);return[o].concat(npt(a))};Ds.parseViewBox=Sme;Ds.renderCallByParent=vpt;function xpt(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var wpt=xpt;const bpt=En(wpt);function S1(e){"@babel/helpers - typeof";return S1=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},S1(e)}var Cpt=["valueAccessor"],Spt=["data","dataKey","clockWise","id","textBreakAll"];function kpt(e){return Npt(e)||Ept(e)||_pt(e)||Bpt()}function Bpt(){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 _pt(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 Ept(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Npt(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 qE(){return qE=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},qE.apply(this,arguments)}function dY(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 hY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dY(Object(n),!0).forEach(function(r){jpt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jpt(e,t,n){return t=Tpt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tpt(e){var t=Ppt(e,"string");return S1(t)=="symbol"?t:t+""}function Ppt(e,t){if(S1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(S1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function AY(e,t){if(e==null)return{};var n=Ipt(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 Ipt(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 Opt=function(t){return Array.isArray(t.value)?bpt(t.value):t.value};function AA(e){var t=e.valueAccessor,n=t===void 0?Opt:t,r=AY(e,Cpt),i=r.data,s=r.dataKey,a=r.clockWise,o=r.id,l=r.textBreakAll,u=AY(r,Spt);return!i||!i.length?null:re.createElement(di,{className:"recharts-label-list"},i.map(function(d,h){var f=pn(s)?n(d,h):_o(d&&d.payload,s),A=pn(o)?{}:{id:"".concat(o,"-").concat(h)};return re.createElement(Ds,qE({},vn(d,!0),u,A,{parentViewBox:d.parentViewBox,value:f,textBreakAll:l,viewBox:Ds.parseViewBox(pn(a)?d:hY(hY({},d),{},{clockWise:a})),key:"label-".concat(h),index:h}))}))}AA.displayName="LabelList";function Fpt(e,t){return e?e===!0?re.createElement(AA,{key:"labelList-implicit",data:t}):re.isValidElement(e)||un(e)?re.createElement(AA,{key:"labelList-implicit",data:t,content:e}):uv(e)?re.createElement(AA,qE({data:t},e,{key:"labelList-implicit"})):null:null}function Mpt(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=pl(r,AA).map(function(a,o){return k.cloneElement(a,{data:t,key:"labelList-".concat(o)})});if(!n)return i;var s=Fpt(e.label,t);return[s].concat(kpt(i))}AA.renderCallByParent=Mpt;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 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 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 pY(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){Lpt(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 Lpt(e,t,n){return t=Rpt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rpt(e){var t=Upt(e,"string");return k1(t)=="symbol"?t:t+""}function Upt(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)}var Dpt=function(t,n){var r=rc(n-t),i=Math.min(Math.abs(n-t),359.999);return r*i},US=function(t){var n=t.cx,r=t.cy,i=t.radius,s=t.angle,a=t.sign,o=t.isExternal,l=t.cornerRadius,u=t.cornerIsExternal,d=l*(o?1:-1)+i,h=Math.asin(l/d)/KE,f=u?s:s+a*h,A=vs(n,r,d,f),p=vs(n,r,i,f),m=u?s-a*h:s,g=vs(n,r,d*Math.cos(h*KE),m);return{center:A,circleTangency:p,lineTangency:g,theta:h}},kme=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,s=t.outerRadius,a=t.startAngle,o=t.endAngle,l=Dpt(a,o),u=a+l,d=vs(n,r,s,a),h=vs(n,r,s,u),f="M ".concat(d.x,",").concat(d.y,`
    A `).concat(s,",").concat(s,`,0,
    `).concat(+(Math.abs(l)>180),",").concat(+(a>u),`,
    `).concat(h.x,",").concat(h.y,`
  `);if(i>0){var A=vs(n,r,i,a),p=vs(n,r,i,u);f+="L ".concat(p.x,",").concat(p.y,`
            A `).concat(i,",").concat(i,`,0,
            `).concat(+(Math.abs(l)>180),",").concat(+(a<=u),`,
            `).concat(A.x,",").concat(A.y," Z")}else f+="L ".concat(n,",").concat(r," Z");return f},Qpt=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,s=t.outerRadius,a=t.cornerRadius,o=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,h=rc(d-u),f=US({cx:n,cy:r,radius:s,angle:u,sign:h,cornerRadius:a,cornerIsExternal:l}),A=f.circleTangency,p=f.lineTangency,m=f.theta,g=US({cx:n,cy:r,radius:s,angle:d,sign:-h,cornerRadius:a,cornerIsExternal:l}),y=g.circleTangency,v=g.lineTangency,x=g.theta,b=l?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
      `):kme({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(A.x,",").concat(A.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 S=US({cx:n,cy:r,radius:i,angle:u,sign:h,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),_=S.circleTangency,E=S.lineTangency,j=S.theta,I=US({cx:n,cy:r,radius:i,angle:d,sign:-h,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),T=I.circleTangency,N=I.lineTangency,F=I.theta,L=l?Math.abs(u-d):Math.abs(u-d)-j-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(_.x,",").concat(_.y,`
      A`).concat(a,",").concat(a,",0,0,").concat(+(h<0),",").concat(E.x,",").concat(E.y,"Z")}else w+="L".concat(n,",").concat(r,"Z");return w},Hpt={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Bme=function(t){var n=pY(pY({},Hpt),t),r=n.cx,i=n.cy,s=n.innerRadius,a=n.outerRadius,o=n.cornerRadius,l=n.forceCornerRadius,u=n.cornerIsExternal,d=n.startAngle,h=n.endAngle,f=n.className;if(a<s||d===h)return null;var A=_n("recharts-sector",f),p=a-s,m=Xp(o,p,0,!0),g;return m>0&&Math.abs(d-h)<360?g=Qpt({cx:r,cy:i,innerRadius:s,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:d,endAngle:h}):g=kme({cx:r,cy:i,innerRadius:s,outerRadius:a,startAngle:d,endAngle:h}),re.createElement("path",mL({},vn(n,!0),{className:A,d:g,role:"img"}))};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 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 mY(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 gY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mY(Object(n),!0).forEach(function(r){$pt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $pt(e,t,n){return t=zpt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zpt(e){var t=Vpt(e,"string");return B1(t)=="symbol"?t:t+""}function Vpt(e,t){if(B1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(B1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yY={curveBasisClosed:$et,curveBasisOpen:zet,curveBasis:Het,curveBumpX:Eet,curveBumpY:Net,curveLinearClosed:Vet,curveLinear:C5,curveMonotoneX:Ket,curveMonotoneY:qet,curveNatural:Wet,curveStep:Get,curveStepAfter:Xet,curveStepBefore:Yet},DS=function(t){return t.x===+t.x&&t.y===+t.y},kx=function(t){return t.x},Bx=function(t){return t.y},Kpt=function(t,n){if(un(t))return t;var r="curve".concat(w5(t));return(r==="curveMonotone"||r==="curveBump")&&n?yY["".concat(r).concat(n==="vertical"?"Y":"X")]:yY[r]||C5},qpt=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,l=t.connectNulls,u=l===void 0?!1:l,d=Kpt(r,o),h=u?s.filter(function(m){return DS(m)}):s,f;if(Array.isArray(a)){var A=u?a.filter(function(m){return DS(m)}):a,p=h.map(function(m,g){return gY(gY({},m),{},{base:A[g]})});return o==="vertical"?f=jS().y(Bx).x1(kx).x0(function(m){return m.base.x}):f=jS().x(kx).y1(Bx).y0(function(m){return m.base.y}),f.defined(DS).curve(d),f(p)}return o==="vertical"&&Je(a)?f=jS().y(Bx).x1(kx).x0(a):Je(a)?f=jS().x(kx).y1(Bx).y0(a):f=Bfe().x(kx).y(Bx),f.defined(DS).curve(d),f(h)},yL=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?qpt(t):i;return re.createElement("path",gL({},vn(t,!1),mE(t),{className:_n("recharts-curve",n),d:a,ref:s}))},_me={exports:{}},Wpt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Gpt=Wpt,Ypt=Gpt;function Eme(){}function Nme(){}Nme.resetWarningCache=Eme;var Xpt=function(){function e(r,i,s,a,o,l){if(l!==Ypt){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:Nme,resetWarningCache:Eme};return n.PropTypes=n,n};_me.exports=Xpt();var Jpt=_me.exports;const Fn=En(Jpt);function Zpt(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function vY(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):Zpt(i)};requestAnimationFrame(r)}function vL(e){"@babel/helpers - typeof";return vL=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},vL(e)}function emt(e){return imt(e)||rmt(e)||nmt(e)||tmt()}function tmt(){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 nmt(e,t){if(e){if(typeof e=="string")return xY(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 xY(e,t)}}function xY(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 rmt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function imt(e){if(Array.isArray(e))return e}function smt(){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=emt(a),l=o[0],u=o.slice(1);if(typeof l=="number"){vY(i.bind(null,u),l);return}i(l),vY(i.bind(null,u));return}vL(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 _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 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){jme(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 jme(e,t,n){return t=amt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function amt(e){var t=omt(e,"string");return _1(t)==="symbol"?t:String(t)}function omt(e,t){if(_1(e)!=="object"||e===null)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)}var lmt=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,i){return r.filter(function(s){return i.includes(s)})})},cmt=function(t){return t},umt=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},Vw=function(t,n){return Object.keys(n).reduce(function(r,i){return bY(bY({},r),{},jme({},i,t(i,n[i])))},{})},CY=function(t,n,r){return t.map(function(i){return"".concat(umt(i)," ").concat(n,"ms ").concat(r)}).join(",")};function dmt(e,t){return fmt(e)||Amt(e,t)||Tme(e,t)||hmt()}function hmt(){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 Amt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function fmt(e){if(Array.isArray(e))return e}function pmt(e){return ymt(e)||gmt(e)||Tme(e)||mmt()}function mmt(){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 Tme(e,t){if(e){if(typeof e=="string")return xL(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 xL(e,t)}}function gmt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ymt(e){if(Array.isArray(e))return xL(e)}function xL(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 WE=1e-4,Pme=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},Ime=function(t,n){return t.map(function(r,i){return r*Math.pow(n,i)}).reduce(function(r,i){return r+i})},SY=function(t,n){return function(r){var i=Pme(t,n);return Ime(i,r)}},vmt=function(t,n){return function(r){var i=Pme(t,n),s=[].concat(pmt(i.map(function(a,o){return a*o}).slice(1)),[0]);return Ime(s,r)}},kY=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 l=n[0].split("(");if(l[0]==="cubic-bezier"&&l[1].split(")")[0].split(",").length===4){var u=l[1].split(")")[0].split(",").map(function(g){return parseFloat(g)}),d=dmt(u,4);i=d[0],s=d[1],a=d[2],o=d[3]}}}var h=SY(i,a),f=SY(s,o),A=vmt(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,S=A(x);if(Math.abs(w-v)<WE||S<WE)return f(x);x=p(x-w/S)}return f(x)};return m.isStepper=!1,m},xmt=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,l=function(d,h,f){var A=-(d-h)*r,p=f*s,m=f+(A-p)*o/1e3,g=f*o/1e3+d;return Math.abs(g-h)<WE&&Math.abs(m)<WE?[h,0]:[g,m]};return l.isStepper=!0,l.dt=o,l},wmt=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 kY(i);case"spring":return xmt();default:if(i.split("(")[0]==="cubic-bezier")return kY(i)}return typeof i=="function"?i:null};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 BY(e){return Smt(e)||Cmt(e)||Ome(e)||bmt()}function bmt(){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 Cmt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Smt(e){if(Array.isArray(e))return bL(e)}function _Y(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 us(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_Y(Object(n),!0).forEach(function(r){wL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_Y(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wL(e,t,n){return t=kmt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kmt(e){var t=Bmt(e,"string");return E1(t)==="symbol"?t:String(t)}function Bmt(e,t){if(E1(e)!=="object"||e===null)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)}function _mt(e,t){return jmt(e)||Nmt(e,t)||Ome(e,t)||Emt()}function Emt(){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 Ome(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 Nmt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function jmt(e){if(Array.isArray(e))return e}var GE=function(t,n,r){return t+(n-t)*r},CL=function(t){var n=t.from,r=t.to;return n!==r},Tmt=function e(t,n,r){var i=Vw(function(s,a){if(CL(a)){var o=t(a.from,a.to,a.velocity),l=_mt(o,2),u=l[0],d=l[1];return us(us({},a),{},{from:u,velocity:d})}return a},n);return r<1?Vw(function(s,a){return CL(a)?us(us({},a),{},{velocity:GE(a.velocity,i[s].velocity,r),from:GE(a.from,i[s].from,r)}):a},n):e(t,i,r-1)};const Pmt=function(e,t,n,r,i){var s=lmt(e,t),a=s.reduce(function(g,y){return us(us({},g),{},wL({},y,[e[y],t[y]]))},{}),o=s.reduce(function(g,y){return us(us({},g),{},wL({},y,{from:e[y],velocity:0,to:t[y]}))},{}),l=-1,u,d,h=function(){return null},f=function(){return Vw(function(y,v){return v.from},o)},A=function(){return!Object.values(o).filter(CL).length},p=function(y){u||(u=y);var v=y-u,x=v/n.dt;o=Tmt(n,o,x),i(us(us(us({},e),t),f())),u=y,A()||(l=requestAnimationFrame(h))},m=function(y){d||(d=y);var v=(y-d)/r,x=Vw(function(w,S){return GE.apply(void 0,BY(S).concat([n(v)]))},a);if(i(us(us(us({},e),t),x)),v<1)l=requestAnimationFrame(h);else{var b=Vw(function(w,S){return GE.apply(void 0,BY(S).concat([n(1)]))},a);i(us(us(us({},e),t),b))}};return h=n.isStepper?p:m,function(){return requestAnimationFrame(h),function(){cancelAnimationFrame(l)}}};function C0(e){"@babel/helpers - typeof";return C0=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},C0(e)}var Imt=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function Omt(e,t){if(e==null)return{};var n=Fmt(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 Fmt(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 g4(e){return Umt(e)||Rmt(e)||Lmt(e)||Mmt()}function Mmt(){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 Lmt(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 Rmt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Umt(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}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 Ol(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){Jx(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 Jx(e,t,n){return t=Fme(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dmt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qmt(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,Fme(r.key),r)}}function Hmt(e,t,n){return t&&Qmt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fme(e){var t=$mt(e,"string");return C0(t)==="symbol"?t:String(t)}function $mt(e,t){if(C0(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(C0(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zmt(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&&kL(e,t)}function kL(e,t){return kL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},kL(e,t)}function Vmt(e){var t=Kmt();return function(){var r=YE(e),i;if(t){var s=YE(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return BL(this,i)}}function BL(e,t){if(t&&(C0(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _L(e)}function _L(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Kmt(){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 YE(e){return YE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},YE(e)}var xd=function(e){zmt(n,e);var t=Vmt(n);function n(r,i){var s;Dmt(this,n),s=t.call(this,r,i);var a=s.props,o=a.isActive,l=a.attributeName,u=a.from,d=a.to,h=a.steps,f=a.children,A=a.duration;if(s.handleStyleChange=s.handleStyleChange.bind(_L(s)),s.changeStyle=s.changeStyle.bind(_L(s)),!o||A<=0)return s.state={style:{}},typeof f=="function"&&(s.state={style:d}),BL(s);if(h&&h.length)s.state={style:h[0].style};else if(u){if(typeof f=="function")return s.state={style:u},BL(s);s.state={style:l?Jx({},l,u):u}}else s.state={style:{}};return s}return Hmt(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,l=s.attributeName,u=s.shouldReAnimate,d=s.to,h=s.from,f=this.state.style;if(o){if(!a){var A={style:l?Jx({},l,d):d};this.state&&f&&(l&&f[l]!==d||!l&&f!==d)&&this.setState(A);return}if(!(yde(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&&f){var g={style:l?Jx({},l,m):m};(l&&f[l]!==m||!l&&f!==m)&&this.setState(g)}this.runAnimation(Ol(Ol({},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,l=i.duration,u=i.easing,d=i.begin,h=i.onAnimationEnd,f=i.onAnimationStart,A=Pmt(a,o,wmt(u),l,this.changeStyle),p=function(){s.stopJSAnimation=A()};this.manager.start([f,d,p,l,h])}},{key:"runStepAnimation",value:function(i){var s=this,a=i.steps,o=i.begin,l=i.onAnimationStart,u=a[0],d=u.style,h=u.duration,f=h===void 0?0:h,A=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,S=g.properties,_=g.onAnimationEnd,E=y>0?a[y-1]:g,j=S||Object.keys(w);if(typeof b=="function"||b==="spring")return[].concat(g4(m),[s.runJSAnimation.bind(s,{from:E.style,to:w,duration:v,easing:b}),v]);var I=CY(j,v,b),T=Ol(Ol(Ol({},E.style),w),{},{transition:I});return[].concat(g4(m),[T,v,_]).filter(cmt)};return this.manager.start([l].concat(g4(a.reduce(A,[d,Math.max(f,o)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=smt());var s=i.begin,a=i.duration,o=i.attributeName,l=i.to,u=i.easing,d=i.onAnimationStart,h=i.onAnimationEnd,f=i.steps,A=i.children,p=this.manager;if(this.unSubscribe=p.subscribe(this.handleStyleChange),typeof u=="function"||typeof A=="function"||u==="spring"){this.runJSAnimation(i);return}if(f.length>1){this.runStepAnimation(i);return}var m=o?Jx({},o,l):l,g=CY(Object.keys(m),a,u);p.start([d,s,Ol(Ol({},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 l=Omt(i,Imt),u=k.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(A){var p=A.props,m=p.style,g=m===void 0?{}:m,y=p.className,v=k.cloneElement(A,Ol(Ol({},l),{},{style:Ol(Ol({},g),d),className:y}));return v};return u===1?h(k.Children.only(s)):re.createElement("div",null,k.Children.map(s,function(f){return h(f)}))}}]),n}(k.PureComponent);xd.displayName="Animate";xd.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};xd.propTypes={from:Fn.oneOfType([Fn.object,Fn.string]),to:Fn.oneOfType([Fn.object,Fn.string]),attributeName:Fn.string,duration:Fn.number,begin:Fn.number,easing:Fn.oneOfType([Fn.string,Fn.func]),steps:Fn.arrayOf(Fn.shape({duration:Fn.number.isRequired,style:Fn.object.isRequired,easing:Fn.oneOfType([Fn.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Fn.func]),properties:Fn.arrayOf("string"),onAnimationEnd:Fn.func})),children:Fn.oneOfType([Fn.node,Fn.func]),isActive:Fn.bool,canBegin:Fn.bool,onAnimationEnd:Fn.func,shouldReAnimate:Fn.bool,onAnimationStart:Fn.func,onAnimationReStart:Fn.func};function N1(e){"@babel/helpers - typeof";return N1=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},N1(e)}function XE(){return XE=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},XE.apply(this,arguments)}function qmt(e,t){return Xmt(e)||Ymt(e,t)||Gmt(e,t)||Wmt()}function Wmt(){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 Gmt(e,t){if(e){if(typeof e=="string")return NY(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 NY(e,t)}}function NY(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 Ymt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function Xmt(e){if(Array.isArray(e))return e}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 TY(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){Jmt(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 Jmt(e,t,n){return t=Zmt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zmt(e){var t=egt(e,"string");return N1(t)=="symbol"?t:t+""}function egt(e,t){if(N1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(N1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var PY=function(t,n,r,i,s){var a=Math.min(Math.abs(r)/2,Math.abs(i)/2),o=i>=0?1:-1,l=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],f=0,A=4;f<A;f++)h[f]=s[f]>a?a:s[f];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+l*h[0],",").concat(n)),d+="L ".concat(t+r-l*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-l*h[2],",").concat(n+i)),d+="L ".concat(t+l*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+l*p,",").concat(n,`
            L `).concat(t+r-l*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-l*p,",").concat(n+i,`
            L `).concat(t+l*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},tgt=function(t,n){if(!t||!n)return!1;var r=t.x,i=t.y,s=n.x,a=n.y,o=n.width,l=n.height;if(Math.abs(o)>0&&Math.abs(l)>0){var u=Math.min(s,s+o),d=Math.max(s,s+o),h=Math.min(a,a+l),f=Math.max(a,a+l);return r>=u&&r<=d&&i>=h&&i<=f}return!1},ngt={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},TH=function(t){var n=TY(TY({},ngt),t),r=k.useRef(),i=k.useState(-1),s=qmt(i,2),a=s[0],o=s[1];k.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var b=r.current.getTotalLength();b&&o(b)}catch{}},[]);var l=n.x,u=n.y,d=n.width,h=n.height,f=n.radius,A=n.className,p=n.animationEasing,m=n.animationDuration,g=n.animationBegin,y=n.isAnimationActive,v=n.isUpdateAnimationActive;if(l!==+l||u!==+u||d!==+d||h!==+h||d===0||h===0)return null;var x=_n("recharts-rectangle",A);return v?re.createElement(xd,{canBegin:a>0,from:{width:d,height:h,x:l,y:u},to:{width:d,height:h,x:l,y:u},duration:m,animationEasing:p,isActive:v},function(b){var w=b.width,S=b.height,_=b.x,E=b.y;return re.createElement(xd,{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",XE({},vn(n,!0),{className:x,d:PY(_,E,w,S,f),ref:r})))}):re.createElement("path",XE({},vn(n,!0),{className:x,d:PY(l,u,d,h,f)}))};function EL(){return EL=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},EL.apply(this,arguments)}var PH=function(t){var n=t.cx,r=t.cy,i=t.r,s=t.className,a=_n("recharts-dot",s);return n===+n&&r===+r&&i===+i?re.createElement("circle",EL({},vn(t,!1),mE(t),{className:a,cx:n,cy:r,r:i})):null};function j1(e){"@babel/helpers - typeof";return j1=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},j1(e)}var rgt=["x","y","top","left","width","height","className"];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 IY(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 igt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IY(Object(n),!0).forEach(function(r){sgt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sgt(e,t,n){return t=agt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function agt(e){var t=ogt(e,"string");return j1(t)=="symbol"?t:t+""}function ogt(e,t){if(j1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(j1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lgt(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={};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 ugt=function(t,n,r,i,s,a){return"M".concat(t,",").concat(s,"v").concat(i,"M").concat(a,",").concat(n,"h").concat(r)},dgt=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,l=t.left,u=l===void 0?0:l,d=t.width,h=d===void 0?0:d,f=t.height,A=f===void 0?0:f,p=t.className,m=lgt(t,rgt),g=igt({x:r,y:s,top:o,left:u,width:h,height:A},m);return!Je(r)||!Je(s)||!Je(h)||!Je(A)||!Je(o)||!Je(u)?null:re.createElement("path",NL({},vn(g,!0),{className:_n("recharts-cross",p),d:ugt(r,s,h,A,o,u)}))},hgt=Yfe,Agt=hgt(Object.getPrototypeOf,Object),fgt=Agt,pgt=Nd,mgt=fgt,ggt=jd,ygt="[object Object]",vgt=Function.prototype,xgt=Object.prototype,Mme=vgt.toString,wgt=xgt.hasOwnProperty,bgt=Mme.call(Object);function Cgt(e){if(!ggt(e)||pgt(e)!=ygt)return!1;var t=mgt(e);if(t===null)return!0;var n=wgt.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Mme.call(n)==bgt}var Sgt=Cgt;const kgt=En(Sgt);var Bgt=Nd,_gt=jd,Egt="[object Boolean]";function Ngt(e){return e===!0||e===!1||_gt(e)&&Bgt(e)==Egt}var jgt=Ngt;const Tgt=En(jgt);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 JE(){return JE=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},JE.apply(this,arguments)}function Pgt(e,t){return Mgt(e)||Fgt(e,t)||Ogt(e,t)||Igt()}function Igt(){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 Ogt(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 Fgt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function Mgt(e){if(Array.isArray(e))return 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){Lgt(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 Lgt(e,t,n){return t=Rgt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rgt(e){var t=Ugt(e,"string");return T1(t)=="symbol"?t:t+""}function Ugt(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)}var LY=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},Dgt={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Qgt=function(t){var n=MY(MY({},Dgt),t),r=k.useRef(),i=k.useState(-1),s=Pgt(i,2),a=s[0],o=s[1];k.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var x=r.current.getTotalLength();x&&o(x)}catch{}},[]);var l=n.x,u=n.y,d=n.upperWidth,h=n.lowerWidth,f=n.height,A=n.className,p=n.animationEasing,m=n.animationDuration,g=n.animationBegin,y=n.isUpdateAnimationActive;if(l!==+l||u!==+u||d!==+d||h!==+h||f!==+f||d===0&&h===0||f===0)return null;var v=_n("recharts-trapezoid",A);return y?re.createElement(xd,{canBegin:a>0,from:{upperWidth:0,lowerWidth:0,height:f,x:l,y:u},to:{upperWidth:d,lowerWidth:h,height:f,x:l,y:u},duration:m,animationEasing:p,isActive:y},function(x){var b=x.upperWidth,w=x.lowerWidth,S=x.height,_=x.x,E=x.y;return re.createElement(xd,{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",JE({},vn(n,!0),{className:v,d:LY(_,E,b,w,S),ref:r})))}):re.createElement("g",null,re.createElement("path",JE({},vn(n,!0),{className:v,d:LY(l,u,d,h,f)})))},Hgt=["option","shapeType","propTransformer","activeClassName","isActive"];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)}function $gt(e,t){if(e==null)return{};var n=zgt(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 zgt(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 RY(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 ZE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RY(Object(n),!0).forEach(function(r){Vgt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vgt(e,t,n){return t=Kgt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kgt(e){var t=qgt(e,"string");return P1(t)=="symbol"?t:t+""}function qgt(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 Wgt(e,t){return ZE(ZE({},t),e)}function Ggt(e,t){return e==="symbols"}function UY(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return re.createElement(TH,n);case"trapezoid":return re.createElement(Qgt,n);case"sector":return re.createElement(Bme,n);case"symbols":if(Ggt(t))return re.createElement(GQ,n);break;default:return null}}function Ygt(e){return k.isValidElement(e)?e.props:e}function Xgt(e){var t=e.option,n=e.shapeType,r=e.propTransformer,i=r===void 0?Wgt:r,s=e.activeClassName,a=s===void 0?"recharts-active-shape":s,o=e.isActive,l=$gt(e,Hgt),u;if(k.isValidElement(t))u=k.cloneElement(t,ZE(ZE({},l),Ygt(t)));else if(un(t))u=t(l);else if(kgt(t)&&!Tgt(t)){var d=i(t,l);u=re.createElement(UY,{shapeType:n,elementProps:d})}else{var h=l;u=re.createElement(UY,{shapeType:n,elementProps:h})}return o?re.createElement(di,{className:a},u):u}function U5(e,t){return t!=null&&"trapezoids"in e.props}function D5(e,t){return t!=null&&"sectors"in e.props}function I1(e,t){return t!=null&&"points"in e.props}function Jgt(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 Zgt(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function eyt(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}function tyt(e,t){var n;return U5(e,t)?n=Jgt:D5(e,t)?n=Zgt:I1(e,t)&&(n=eyt),n}function nyt(e,t){var n;return U5(e,t)?n="trapezoids":D5(e,t)?n="sectors":I1(e,t)&&(n="points"),n}function ryt(e,t){if(U5(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(D5(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 I1(e,t)?t.payload:{}}function iyt(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,i=nyt(n,t),s=ryt(n,t),a=r.filter(function(l,u){var d=M5(s,l),h=n.props[i].filter(function(p){var m=tyt(n,t);return m(p,t)}),f=n.props[i].indexOf(h[h.length-1]),A=u===f;return d&&A}),o=r.indexOf(a[a.length-1]);return o}var syt=Math.ceil,ayt=Math.max;function oyt(e,t,n,r){for(var i=-1,s=ayt(syt((t-e)/(n||1)),0),a=Array(s);s--;)a[r?s:++i]=e,e+=n;return a}var lyt=oyt,cyt=ppe,DY=1/0,uyt=17976931348623157e292;function dyt(e){if(!e)return e===0?e:0;if(e=cyt(e),e===DY||e===-DY){var t=e<0?-1:1;return t*uyt}return e===e?e:0}var Lme=dyt,hyt=lyt,Ayt=_5,y4=Lme;function fyt(e){return function(t,n,r){return r&&typeof r!="number"&&Ayt(t,n,r)&&(n=r=void 0),t=y4(t),n===void 0?(n=t,t=0):n=y4(n),r=r===void 0?t<n?1:-1:y4(r),hyt(t,n,r,e)}}var pyt=fyt,myt=pyt,gyt=myt(),yyt=gyt;const eN=En(yyt);function O1(e){"@babel/helpers - typeof";return O1=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},O1(e)}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 HY(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){Rme(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 Rme(e,t,n){return t=vyt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vyt(e){var t=xyt(e,"string");return O1(t)=="symbol"?t:t+""}function xyt(e,t){if(O1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(O1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wyt=["Webkit","Moz","O","ms"],byt=function(t,n){var r=t.replace(/(\w)/,function(s){return s.toUpperCase()}),i=wyt.reduce(function(s,a){return HY(HY({},s),{},Rme({},a+r,n))},{});return i[t]=n,i};function S0(e){"@babel/helpers - typeof";return S0=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},S0(e)}function tN(){return tN=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},tN.apply(this,arguments)}function $Y(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 v4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$Y(Object(n),!0).forEach(function(r){ho(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$Y(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cyt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zY(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,Dme(r.key),r)}}function Syt(e,t,n){return t&&zY(e.prototype,t),n&&zY(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function kyt(e,t,n){return t=nN(t),Byt(e,Ume()?Reflect.construct(t,n||[],nN(e).constructor):t.apply(e,n))}function Byt(e,t){if(t&&(S0(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _yt(e)}function _yt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ume(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ume=function(){return!!e})()}function nN(e){return nN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},nN(e)}function Eyt(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&&jL(e,t)}function jL(e,t){return jL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},jL(e,t)}function ho(e,t,n){return t=Dme(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dme(e){var t=Nyt(e,"string");return S0(t)=="symbol"?t:t+""}function Nyt(e,t){if(S0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(S0(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jyt=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 l=n.length,u=$w().domain(eN(0,l)).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}},VY=function(t){return t.changedTouches&&!!t.changedTouches.length},k0=function(e){function t(n){var r;return Cyt(this,t),r=kyt(this,t,[n]),ho(r,"handleDrag",function(i){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(i):r.state.isSlideMoving&&r.handleSlideDrag(i)}),ho(r,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&r.handleDrag(i.changedTouches[0])}),ho(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()}),ho(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),ho(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),ho(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),ho(r,"handleSlideDragStart",function(i){var s=VY(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 Eyt(t,e),Syt(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,l=o.gap,u=o.data,d=u.length-1,h=Math.min(i,s),f=Math.max(i,s),A=t.getIndexInRange(a,h),p=t.getIndexInRange(a,f);return{startIndex:A-A%l,endIndex:p===d?d:p-p%l}}},{key:"getTextOfTick",value:function(r){var i=this.props,s=i.data,a=i.tickFormatter,o=i.dataKey,l=_o(s[r],o,r);return un(a)?a(l,r):l}},{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,l=this.props,u=l.x,d=l.width,h=l.travellerWidth,f=l.startIndex,A=l.endIndex,p=l.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!==f||g.endIndex!==A)&&p&&p(g),this.setState({startX:a+m,endX:o+m,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var s=VY(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,l=i.startX,u=this.state[a],d=this.props,h=d.x,f=d.width,A=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+f-A-u):v<0&&(v=Math.max(v,h-u)),y[a]=u+v;var x=this.getIndex(y),b=x.startIndex,w=x.endIndex,S=function(){var E=g.length-1;return a==="startX"&&(o>l?b%m===0:w%m===0)||o<l&&w===E||a==="endX"&&(o>l?w%m===0:b%m===0)||o>l&&w===E};this.setState(ho(ho({},a,u+v),"brushMoveStartX",r.pageX),function(){p&&S()&&p(x)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var s=this,a=this.state,o=a.scaleValues,l=a.startX,u=a.endX,d=this.state[i],h=o.indexOf(d);if(h!==-1){var f=h+r;if(!(f===-1||f>=o.length)){var A=o[f];i==="startX"&&A>=u||i==="endX"&&A<=l||this.setState(ho({},i,A),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,l=r.fill,u=r.stroke;return re.createElement("rect",{stroke:u,fill:l,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,l=r.data,u=r.children,d=r.padding,h=k.Children.only(u);return h?re.cloneElement(h,{x:i,y:s,width:a,height:o,margin:d,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var s,a,o=this,l=this.props,u=l.y,d=l.travellerWidth,h=l.height,f=l.traveller,A=l.ariaLabel,p=l.data,m=l.startIndex,g=l.endIndex,y=Math.max(r,this.props.x),v=v4(v4({},vn(this.props,!1)),{},{x:y,y:u,width:d,height:h}),x=A||"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(di,{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(f,v))}},{key:"renderSlide",value:function(r,i){var s=this.props,a=s.y,o=s.height,l=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:l,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,l=r.travellerWidth,u=r.stroke,d=this.state,h=d.startX,f=d.endX,A=5,p={pointerEvents:"none",fill:u};return re.createElement(di,{className:"recharts-brush-texts"},re.createElement(TE,tN({textAnchor:"end",verticalAnchor:"middle",x:Math.min(h,f)-A,y:a+o/2},p),this.getTextOfTick(i)),re.createElement(TE,tN({textAnchor:"start",verticalAnchor:"middle",x:Math.max(h,f)+l+A,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,l=r.y,u=r.width,d=r.height,h=r.alwaysShowText,f=this.state,A=f.startX,p=f.endX,m=f.isTextActive,g=f.isSlideMoving,y=f.isTravellerMoving,v=f.isTravellerFocused;if(!i||!i.length||!Je(o)||!Je(l)||!Je(u)||!Je(d)||u<=0||d<=0)return null;var x=_n("recharts-brush",s),b=re.Children.count(a)===1,w=byt("userSelect","none");return re.createElement(di,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),b&&this.renderPanorama(),this.renderSlide(A,p),this.renderTravellerLayer(A,"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,l=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:l,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):un(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,l=r.travellerWidth,u=r.updateId,d=r.startIndex,h=r.endIndex;if(s!==i.prevData||u!==i.prevUpdateId)return v4({prevData:s,prevTravellerWidth:l,prevUpdateId:u,prevX:o,prevWidth:a},s&&s.length?jyt({data:s,width:a,x:o,travellerWidth:l,startIndex:d,endIndex:h}):{scale:null,scaleValues:null});if(i.scale&&(a!==i.prevWidth||o!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([o,o+a-l]);var f=i.scale.domain().map(function(A){return i.scale(A)});return{prevData:s,prevTravellerWidth:l,prevUpdateId:u,prevX:o,prevWidth:a,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:f}}return null}},{key:"getIndexInRange",value:function(r,i){for(var s=r.length,a=0,o=s-1;o-a>1;){var l=Math.floor((a+o)/2);r[l]>i?o=l:a=l}return i>=r[o]?o:a}}])}(k.PureComponent);ho(k0,"displayName","Brush");ho(k0,"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 Tyt=nH;function Pyt(e,t){var n;return Tyt(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}var Iyt=Pyt,Oyt=Hfe,Fyt=YA,Myt=Iyt,Lyt=Ya,Ryt=_5;function Uyt(e,t,n){var r=Lyt(e)?Oyt:Myt;return n&&Ryt(e,t,n)&&(t=void 0),r(e,Fyt(t))}var Dyt=Uyt;const Qyt=En(Dyt);var ru=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},KY=upe;function Hyt(e,t,n){t=="__proto__"&&KY?KY(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var $yt=Hyt,zyt=$yt,Vyt=lpe,Kyt=YA;function qyt(e,t){var n={};return t=Kyt(t),Vyt(e,function(r,i,s){zyt(n,i,t(r,i,s))}),n}var Wyt=qyt;const Gyt=En(Wyt);function Yyt(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 Xyt=Yyt,Jyt=nH;function Zyt(e,t){var n=!0;return Jyt(e,function(r,i,s){return n=!!t(r,i,s),n}),n}var e0t=Zyt,t0t=Xyt,n0t=e0t,r0t=YA,i0t=Ya,s0t=_5;function a0t(e,t,n){var r=i0t(e)?t0t:n0t;return n&&s0t(e,t,n)&&(t=void 0),r(e,r0t(t))}var o0t=a0t;const Qme=En(o0t);var l0t=["x","y"];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)}function TL(){return TL=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},TL.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 _x(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){c0t(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 c0t(e,t,n){return t=u0t(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u0t(e){var t=d0t(e,"string");return F1(t)=="symbol"?t:t+""}function d0t(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 h0t(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 f0t(e,t){var n=e.x,r=e.y,i=h0t(e,l0t),s="".concat(n),a=parseInt(s,10),o="".concat(r),l=parseInt(o,10),u="".concat(t.height||i.height),d=parseInt(u,10),h="".concat(t.width||i.width),f=parseInt(h,10);return _x(_x(_x(_x(_x({},t),i),a?{x:a}:{}),l?{y:l}:{}),{},{height:d,width:f,name:t.name,radius:t.radius})}function WY(e){return re.createElement(Xgt,TL({shapeType:"rectangle",propTransformer:f0t,activeClassName:"recharts-active-bar"},e))}var p0t=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||Zp(),n)}},m0t=["value","background"],Hme;function B0(e){"@babel/helpers - typeof";return B0=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},B0(e)}function g0t(e,t){if(e==null)return{};var n=y0t(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 y0t(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 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 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 yi(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){$h(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 v0t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YY(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 x0t(e,t,n){return t&&YY(e.prototype,t),n&&YY(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function w0t(e,t,n){return t=iN(t),b0t(e,$me()?Reflect.construct(t,n||[],iN(e).constructor):t.apply(e,n))}function b0t(e,t){if(t&&(B0(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return C0t(e)}function C0t(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $me(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($me=function(){return!!e})()}function iN(e){return iN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},iN(e)}function S0t(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&&PL(e,t)}function PL(e,t){return PL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},PL(e,t)}function $h(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 zme(e){var t=k0t(e,"string");return B0(t)=="symbol"?t:t+""}function k0t(e,t){if(B0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(B0(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pm=function(e){function t(){var n;v0t(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=w0t(this,t,[].concat(i)),$h(n,"state",{isAnimationFinished:!1}),$h(n,"id",P2("recharts-bar-")),$h(n,"handleAnimationEnd",function(){var a=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),a&&a()}),$h(n,"handleAnimationStart",function(){var a=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),a&&a()}),n}return S0t(t,e),x0t(t,[{key:"renderRectanglesStatically",value:function(r){var i=this,s=this.props,a=s.shape,o=s.dataKey,l=s.activeIndex,u=s.activeBar,d=vn(this.props,!1);return r&&r.map(function(h,f){var A=f===l,p=A?u:a,m=yi(yi(yi({},d),h),{},{isActive:A,option:p,index:f,dataKey:o,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return re.createElement(di,rN({className:"recharts-bar-rectangle"},gE(i.props,h,f),{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(WY,m))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,i=this.props,s=i.data,a=i.layout,o=i.isAnimationActive,l=i.animationBegin,u=i.animationDuration,d=i.animationEasing,h=i.animationId,f=this.state.prevData;return re.createElement(xd,{begin:l,duration:u,isActive:o,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(A){var p=A.t,m=s.map(function(g,y){var v=f&&f[y];if(v){var x=Wl(v.x,g.x),b=Wl(v.y,g.y),w=Wl(v.width,g.width),S=Wl(v.height,g.height);return yi(yi({},g),{},{x:x(p),y:b(p),width:w(p),height:S(p)})}if(a==="horizontal"){var _=Wl(0,g.height),E=_(p);return yi(yi({},g),{},{y:g.y+g.height-E,height:E})}var j=Wl(0,g.width),I=j(p);return yi(yi({},g),{},{width:I})});return re.createElement(di,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||!M5(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,l=vn(this.props.background,!1);return s.map(function(u,d){u.value;var h=u.background,f=g0t(u,m0t);if(!h)return null;var A=yi(yi(yi(yi(yi({},f),{},{fill:"#eee"},h),l),gE(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:a,index:d,className:"recharts-bar-background-rectangle"});return re.createElement(WY,rN({key:"background-bar-".concat(d),option:r.props.background,isActive:d===o},A))})}},{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,l=s.yAxis,u=s.layout,d=s.children,h=pl(d,R2);if(!h)return null;var f=u==="vertical"?a[0].height/2:a[0].width/2,A=function(g,y){var v=Array.isArray(g.value)?g.value[1]:g.value;return{x:g.x,y:g.y,value:v,errorVal:_o(g,y)}},p={clipPath:r?"url(#clipPath-".concat(i,")"):null};return re.createElement(di,p,h.map(function(m){return re.cloneElement(m,{key:"error-bar-".concat(i,"-").concat(m.props.dataKey),data:a,xAxis:o,yAxis:l,layout:u,offset:f,dataPointFormatter:A})}))}},{key:"render",value:function(){var r=this.props,i=r.hide,s=r.data,a=r.className,o=r.xAxis,l=r.yAxis,u=r.left,d=r.top,h=r.width,f=r.height,A=r.isAnimationActive,p=r.background,m=r.id;if(i||!s||!s.length)return null;var g=this.state.isAnimationFinished,y=_n("recharts-bar",a),v=o&&o.allowDataOverflow,x=l&&l.allowDataOverflow,b=v||x,w=pn(m)?this.id:m;return re.createElement(di,{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-f/2,width:v?h:h*2,height:x?f:f*2}))):null,re.createElement(di,{className:"recharts-bar-rectangles",clipPath:b?"url(#clipPath-".concat(w,")"):null},p?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(b,w),(!A||g)&&AA.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}}])}(k.PureComponent);Hme=pm;$h(pm,"displayName","Bar");$h(pm,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!sd.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});$h(pm,"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,l=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,h=e.displayedData,f=e.offset,A=Mft(r,n);if(!A)return null;var p=t.layout,m=n.type.defaultProps,g=m!==void 0?yi(yi({},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,S=zft({numericAxis:b}),_=pl(v,gpe),E=h.map(function(j,I){var T,N,F,L,D,H;u?T=Lft(u[d+I],w):(T=_o(j,y),Array.isArray(T)||(T=[S,T]));var W=p0t(x,Hme.defaultProps.minPointSize)(T[1],I);if(p==="horizontal"){var $,V=[a.scale(T[0]),a.scale(T[1])],Q=V[0],ce=V[1];N=rY({axis:s,ticks:o,bandSize:i,offset:A.offset,entry:j,index:I}),F=($=ce??Q)!==null&&$!==void 0?$:void 0,L=A.size;var R=Q-ce;if(D=Number.isNaN(R)?0:R,H={x:N,y:a.y,width:L,height:a.height},Math.abs(W)>0&&Math.abs(D)<Math.abs(W)){var M=rc(D||W)*(Math.abs(W)-Math.abs(D));F-=M,D+=M}}else{var Y=[s.scale(T[0]),s.scale(T[1])],X=Y[0],K=Y[1];if(N=X,F=rY({axis:a,ticks:l,bandSize:i,offset:A.offset,entry:j,index:I}),L=K-X,D=A.size,H={x:s.x,y:F,width:s.width,height:D},Math.abs(W)>0&&Math.abs(L)<Math.abs(W)){var Z=rc(L||W)*(Math.abs(W)-Math.abs(L));L+=Z}}return yi(yi(yi({},j),{},{x:N,y:F,width:L,height:D,value:u?T:T[1],payload:j,background:H},_&&_[I]&&_[I].props),{},{tooltipPayload:[Cme(n,j)],tooltipPosition:{x:N+L/2,y:F+D/2}})});return yi({data:E,layout:p},f)});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 B0t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XY(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,Vme(r.key),r)}}function _0t(e,t,n){return t&&XY(e.prototype,t),n&&XY(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}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 Vl(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){Q5(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 Q5(e,t,n){return t=Vme(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vme(e){var t=E0t(e,"string");return M1(t)=="symbol"?t:t+""}function E0t(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 Kme=function(t,n,r,i,s){var a=t.width,o=t.height,l=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},f=!!po(u,pm);return d.reduce(function(A,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,S="".concat(g).concat(b?"Mirror":""),_,E,j,I,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 D=F/N,H=m.layout==="vertical"?r.height:r.width;if(m.padding==="gap"&&(_=D*H/2),m.padding==="no-gap"){var W=Xp(t.barCategoryGap,D*H),$=D*H/2;_=$-W-($-W)/H*W}}}i==="xAxis"?E=[r.left+(x.left||0)+(_||0),r.left+r.width-(x.right||0)-(_||0)]:i==="yAxis"?E=l==="horizontal"?[r.top+r.height-(x.bottom||0),r.top+(x.top||0)]:[r.top+(x.top||0)+(_||0),r.top+r.height-(x.bottom||0)-(_||0)]:E=m.range,w&&(E=[E[1],E[0]]);var V=Oft(m,s,f),Q=V.scale,ce=V.realScaleType;Q.domain(y).range(E),Fft(Q);var R=$ft(Q,Vl(Vl({},m),{},{realScaleType:ce}));i==="xAxis"?(T=g==="top"&&!b||g==="bottom"&&b,j=r.left,I=h[S]-T*m.height):i==="yAxis"&&(T=g==="left"&&!b||g==="right"&&b,j=h[S]-T*m.width,I=r.top);var M=Vl(Vl(Vl({},m),R),{},{realScaleType:ce,x:j,y:I,scale:Q,width:i==="xAxis"?r.width:m.width,height:i==="yAxis"?r.height:m.height});return M.bandSize=VE(M,R),!m.hide&&i==="xAxis"?h[S]+=(T?-1:1)*M.height:m.hide||(h[S]+=(T?-1:1)*M.width),Vl(Vl({},A),{},Q5({},p,M))},{})},qme=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)}},N0t=function(t){var n=t.x1,r=t.y1,i=t.x2,s=t.y2;return qme({x:n,y:r},{x:i,y:s})},Wme=function(){function e(t){B0t(this,e),this.scale=t}return _0t(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 l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}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)}}])}();Q5(Wme,"EPS",1e-4);var IH=function(t){var n=Object.keys(t).reduce(function(r,i){return Vl(Vl({},r),{},Q5({},i,Wme.create(t[i])))},{});return Vl(Vl({},n),{},{apply:function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=s.bandAware,o=s.position;return Gyt(i,function(l,u){return n[u].apply(l,{bandAware:a,position:o})})},isInRange:function(i){return Qme(i,function(s,a){return n[a].isInRange(s)})}})};function j0t(e){return(e%180+180)%180}var T0t=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=j0t(i),a=s*Math.PI/180,o=Math.atan(r/n),l=a>o&&a<Math.PI-o?r/Math.sin(a):n/Math.cos(a);return Math.abs(l)},P0t=YA,I0t=I2,O0t=k5;function F0t(e){return function(t,n,r){var i=Object(t);if(!I0t(t)){var s=P0t(n);t=O0t(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 M0t=F0t,L0t=Lme;function R0t(e){var t=L0t(e),n=t%1;return t===t?n?t-n:t:0}var U0t=R0t,D0t=npe,Q0t=YA,H0t=U0t,$0t=Math.max;function z0t(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:H0t(n);return i<0&&(i=$0t(r+i,0)),D0t(e,Q0t(t),i)}var V0t=z0t,K0t=M0t,q0t=V0t,W0t=K0t(q0t),G0t=W0t;const Y0t=En(G0t);var X0t=gJe(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("")}),OH=k.createContext(void 0),FH=k.createContext(void 0),Gme=k.createContext(void 0),Yme=k.createContext({}),Xme=k.createContext(void 0),Jme=k.createContext(0),Zme=k.createContext(0),ZY=function(t){var n=t.state,r=n.xAxisMap,i=n.yAxisMap,s=n.offset,a=t.clipPathId,o=t.children,l=t.width,u=t.height,d=X0t(s);return re.createElement(OH.Provider,{value:r},re.createElement(FH.Provider,{value:i},re.createElement(Yme.Provider,{value:s},re.createElement(Gme.Provider,{value:d},re.createElement(Xme.Provider,{value:a},re.createElement(Jme.Provider,{value:u},re.createElement(Zme.Provider,{value:l},o)))))))},J0t=function(){return k.useContext(Xme)},ege=function(t){var n=k.useContext(OH);n==null&&Zp();var r=n[t];return r==null&&Zp(),r},Z0t=function(){var t=k.useContext(OH);return Ch(t)},evt=function(){var t=k.useContext(FH),n=Y0t(t,function(r){return Qme(r.domain,Number.isFinite)});return n||Ch(t)},tge=function(t){var n=k.useContext(FH);n==null&&Zp();var r=n[t];return r==null&&Zp(),r},tvt=function(){var t=k.useContext(Gme);return t},nvt=function(){return k.useContext(Yme)},MH=function(){return k.useContext(Zme)},LH=function(){return k.useContext(Jme)};function _0(e){"@babel/helpers - typeof";return _0=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},_0(e)}function rvt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ivt(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,rge(r.key),r)}}function svt(e,t,n){return t&&ivt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function avt(e,t,n){return t=sN(t),ovt(e,nge()?Reflect.construct(t,n||[],sN(e).constructor):t.apply(e,n))}function ovt(e,t){if(t&&(_0(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lvt(e)}function lvt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nge=function(){return!!e})()}function sN(e){return sN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},sN(e)}function cvt(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 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 tX(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){RH(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 RH(e,t,n){return t=rge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rge(e){var t=uvt(e,"string");return _0(t)=="symbol"?t:t+""}function uvt(e,t){if(_0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(_0(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dvt(e,t){return pvt(e)||fvt(e,t)||Avt(e,t)||hvt()}function hvt(){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 Avt(e,t){if(e){if(typeof e=="string")return nX(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 nX(e,t)}}function nX(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 fvt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function pvt(e){if(Array.isArray(e))return 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)}var mvt=function(t,n){var r;return re.isValidElement(t)?r=re.cloneElement(t,n):un(t)?r=t(n):r=re.createElement("line",OL({},n,{className:"recharts-reference-line-line"})),r},gvt=function(t,n,r,i,s,a,o,l,u){var d=s.x,h=s.y,f=s.width,A=s.height;if(r){var p=u.y,m=t.y.apply(p,{position:a});if(ru(u,"discard")&&!t.y.isInRange(m))return null;var g=[{x:d+f,y:m},{x:d,y:m}];return l==="left"?g.reverse():g}if(n){var y=u.x,v=t.x.apply(y,{position:a});if(ru(u,"discard")&&!t.x.isInRange(v))return null;var x=[{x:v,y:h+A},{x:v,y:h}];return o==="top"?x.reverse():x}if(i){var b=u.segment,w=b.map(function(S){return t.apply(S,{position:a})});return ru(u,"discard")&&Qyt(w,function(S){return!t.isInRange(S)})?null:w}return null};function yvt(e){var t=e.x,n=e.y,r=e.segment,i=e.xAxisId,s=e.yAxisId,a=e.shape,o=e.className,l=e.alwaysShow,u=J0t(),d=ege(i),h=tge(s),f=tvt();if(!u||!f)return null;id(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var A=IH({x:d.scale,y:h.scale}),p=Ri(t),m=Ri(n),g=r&&r.length===2,y=gvt(A,p,m,g,f,e.position,d.orientation,h.orientation,e);if(!y)return null;var v=dvt(y,2),x=v[0],b=x.x,w=x.y,S=v[1],_=S.x,E=S.y,j=ru(e,"hidden")?"url(#".concat(u,")"):void 0,I=tX(tX({clipPath:j},vn(e,!0)),{},{x1:b,y1:w,x2:_,y2:E});return re.createElement(di,{className:_n("recharts-reference-line",o)},mvt(a,I),Ds.renderCallByParent(e,N0t({x1:b,y1:w,x2:_,y2:E})))}var UH=function(e){function t(){return rvt(this,t),avt(this,t,arguments)}return cvt(t,e),svt(t,[{key:"render",value:function(){return re.createElement(yvt,this.props)}}])}(re.Component);RH(UH,"displayName","ReferenceLine");RH(UH,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});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 E0(e){"@babel/helpers - typeof";return E0=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},E0(e)}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 iX(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){H5(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 vvt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xvt(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,sge(r.key),r)}}function wvt(e,t,n){return t&&xvt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function bvt(e,t,n){return t=aN(t),Cvt(e,ige()?Reflect.construct(t,n||[],aN(e).constructor):t.apply(e,n))}function Cvt(e,t){if(t&&(E0(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Svt(e)}function Svt(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 aN(e){return aN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},aN(e)}function kvt(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&&ML(e,t)}function ML(e,t){return ML=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},ML(e,t)}function H5(e,t,n){return t=sge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sge(e){var t=Bvt(e,"string");return E0(t)=="symbol"?t:t+""}function Bvt(e,t){if(E0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(E0(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _vt=function(t){var n=t.x,r=t.y,i=t.xAxis,s=t.yAxis,a=IH({x:i.scale,y:s.scale}),o=a.apply({x:n,y:r},{bandAware:!0});return ru(t,"discard")&&!a.isInRange(o)?null:o},$5=function(e){function t(){return vvt(this,t),bvt(this,t,arguments)}return kvt(t,e),wvt(t,[{key:"render",value:function(){var r=this.props,i=r.x,s=r.y,a=r.r,o=r.alwaysShow,l=r.clipPathId,u=Ri(i),d=Ri(s);if(id(o===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var h=_vt(this.props);if(!h)return null;var f=h.x,A=h.y,p=this.props,m=p.shape,g=p.className,y=ru(this.props,"hidden")?"url(#".concat(l,")"):void 0,v=iX(iX({clipPath:y},vn(this.props,!0)),{},{cx:f,cy:A});return re.createElement(di,{className:_n("recharts-reference-dot",g)},t.renderDot(m,v),Ds.renderCallByParent(this.props,{x:f-a,y:A-a,width:2*a,height:2*a}))}}])}(re.Component);H5($5,"displayName","ReferenceDot");H5($5,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});H5($5,"renderDot",function(e,t){var n;return re.isValidElement(e)?n=re.cloneElement(e,t):un(e)?n=e(t):n=re.createElement(PH,FL({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function LL(){return LL=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},LL.apply(this,arguments)}function N0(e){"@babel/helpers - typeof";return N0=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},N0(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 aX(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){z5(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 Evt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nvt(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 jvt(e,t,n){return t&&Nvt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tvt(e,t,n){return t=oN(t),Pvt(e,age()?Reflect.construct(t,n||[],oN(e).constructor):t.apply(e,n))}function Pvt(e,t){if(t&&(N0(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ivt(e)}function Ivt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function age(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(age=function(){return!!e})()}function oN(e){return oN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},oN(e)}function Ovt(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&&RL(e,t)}function RL(e,t){return RL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},RL(e,t)}function z5(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=Fvt(e,"string");return N0(t)=="symbol"?t:t+""}function Fvt(e,t){if(N0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(N0(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Mvt=function(t,n,r,i,s){var a=s.x1,o=s.x2,l=s.y1,u=s.y2,d=s.xAxis,h=s.yAxis;if(!d||!h)return null;var f=IH({x:d.scale,y:h.scale}),A={x:t?f.x.apply(a,{position:"start"}):f.x.rangeMin,y:r?f.y.apply(l,{position:"start"}):f.y.rangeMin},p={x:n?f.x.apply(o,{position:"end"}):f.x.rangeMax,y:i?f.y.apply(u,{position:"end"}):f.y.rangeMax};return ru(s,"discard")&&(!f.isInRange(A)||!f.isInRange(p))?null:qme(A,p)},V5=function(e){function t(){return Evt(this,t),Tvt(this,t,arguments)}return Ovt(t,e),jvt(t,[{key:"render",value:function(){var r=this.props,i=r.x1,s=r.x2,a=r.y1,o=r.y2,l=r.className,u=r.alwaysShow,d=r.clipPathId;id(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var h=Ri(i),f=Ri(s),A=Ri(a),p=Ri(o),m=this.props.shape;if(!h&&!f&&!A&&!p&&!m)return null;var g=Mvt(h,f,A,p,this.props);if(!g&&!m)return null;var y=ru(this.props,"hidden")?"url(#".concat(d,")"):void 0;return re.createElement(di,{className:_n("recharts-reference-area",l)},t.renderRect(m,aX(aX({clipPath:y},vn(this.props,!0)),g)),Ds.renderCallByParent(this.props,g))}}])}(re.Component);z5(V5,"displayName","ReferenceArea");z5(V5,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});z5(V5,"renderRect",function(e,t){var n;return re.isValidElement(e)?n=re.cloneElement(e,t):un(e)?n=e(t):n=re.createElement(TH,LL({},t,{className:"recharts-reference-area-rect"})),n});function lge(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 Lvt(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return T0t(r,n)}function Rvt(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 lN(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 Uvt(e,t){return lge(e,t+1)}function Dvt(e,t,n,r,i){for(var s=(r||[]).slice(),a=t.start,o=t.end,l=0,u=1,d=a,h=function(){var p=r==null?void 0:r[l];if(p===void 0)return{v:lge(r,u)};var m=l,g,y=function(){return g===void 0&&(g=n(p,m)),g},v=p.coordinate,x=l===0||lN(e,v,y,d,o);x||(l=0,d=a,u+=1),x&&(d=v+e*(y()/2+i),l+=u)},f;u<=s.length;)if(f=h(),f)return f.v;return[]}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 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 Ls(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){Qvt(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 Qvt(e,t,n){return t=Hvt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hvt(e){var t=$vt(e,"string");return L1(t)=="symbol"?t:t+""}function $vt(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)}function zvt(e,t,n,r,i){for(var s=(r||[]).slice(),a=s.length,o=t.start,l=t.end,u=function(f){var A=s[f],p,m=function(){return p===void 0&&(p=n(A,f)),p};if(f===a-1){var g=e*(A.coordinate+e*m()/2-l);s[f]=A=Ls(Ls({},A),{},{tickCoord:g>0?A.coordinate-g*e:A.coordinate})}else s[f]=A=Ls(Ls({},A),{},{tickCoord:A.coordinate});var y=lN(e,A.tickCoord,m,o,l);y&&(l=A.tickCoord-e*(m()/2+i),s[f]=Ls(Ls({},A),{},{isShow:!0}))},d=a-1;d>=0;d--)u(d);return s}function Vvt(e,t,n,r,i,s){var a=(r||[]).slice(),o=a.length,l=t.start,u=t.end;if(s){var d=r[o-1],h=n(d,o-1),f=e*(d.coordinate+e*h/2-u);a[o-1]=d=Ls(Ls({},d),{},{tickCoord:f>0?d.coordinate-f*e:d.coordinate});var A=lN(e,d.tickCoord,function(){return h},l,u);A&&(u=d.tickCoord-e*(h/2+i),a[o-1]=Ls(Ls({},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 S=e*(x.coordinate-e*w()/2-l);a[v]=x=Ls(Ls({},x),{},{tickCoord:S<0?x.coordinate-S*e:x.coordinate})}else a[v]=x=Ls(Ls({},x),{},{tickCoord:x.coordinate});var _=lN(e,x.tickCoord,w,l,u);_&&(l=x.tickCoord+e*(w()/2+i),a[v]=Ls(Ls({},x),{},{isShow:!0}))},g=0;g<p;g++)m(g);return a}function DH(e,t,n){var r=e.tick,i=e.ticks,s=e.viewBox,a=e.minTickGap,o=e.orientation,l=e.interval,u=e.tickFormatter,d=e.unit,h=e.angle;if(!i||!i.length||!r)return[];if(Je(l)||sd.isSsr)return Uvt(i,typeof l=="number"&&Je(l)?l:0);var f=[],A=o==="top"||o==="bottom"?"width":"height",p=d&&A==="width"?Hw(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},m=function(x,b){var w=un(u)?u(x.value,b):x.value;return A==="width"?Lvt(Hw(w,{fontSize:t,letterSpacing:n}),p,h):Hw(w,{fontSize:t,letterSpacing:n})[A]},g=i.length>=2?rc(i[1].coordinate-i[0].coordinate):1,y=Rvt(s,g,A);return l==="equidistantPreserveStart"?Dvt(g,y,m,i,a):(l==="preserveStart"||l==="preserveStartEnd"?f=Vvt(g,y,m,i,a,l==="preserveStartEnd"):f=zvt(g,y,m,i,a),f.filter(function(v){return v.isShow}))}var Kvt=["viewBox"],qvt=["viewBox"],Wvt=["ticks"];function j0(e){"@babel/helpers - typeof";return j0=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},j0(e)}function Yg(){return Yg=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},Yg.apply(this,arguments)}function lX(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 ta(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lX(Object(n),!0).forEach(function(r){QH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function x4(e,t){if(e==null)return{};var n=Gvt(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 Gvt(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 Yvt(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,uge(r.key),r)}}function Xvt(e,t,n){return t&&cX(e.prototype,t),n&&cX(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jvt(e,t,n){return t=cN(t),Zvt(e,cge()?Reflect.construct(t,n||[],cN(e).constructor):t.apply(e,n))}function Zvt(e,t){if(t&&(j0(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ext(e)}function ext(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cge=function(){return!!e})()}function cN(e){return cN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},cN(e)}function txt(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 QH(e,t,n){return t=uge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uge(e){var t=nxt(e,"string");return j0(t)=="symbol"?t:t+""}function nxt(e,t){if(j0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(j0(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var xv=function(e){function t(n){var r;return Yvt(this,t),r=Jvt(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return txt(t,e),Xvt(t,[{key:"shouldComponentUpdate",value:function(r,i){var s=r.viewBox,a=x4(r,Kvt),o=this.props,l=o.viewBox,u=x4(o,qvt);return!Cy(s,l)||!Cy(a,u)||!Cy(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,l=i.height,u=i.orientation,d=i.tickSize,h=i.mirror,f=i.tickMargin,A,p,m,g,y,v,x=h?-1:1,b=r.tickSize||d,w=Je(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":A=p=r.coordinate,g=a+ +!h*l,m=g-x*b,v=m-x*f,y=w;break;case"left":m=g=r.coordinate,p=s+ +!h*o,A=p-x*b,y=A-x*f,v=w;break;case"right":m=g=r.coordinate,p=s+ +h*o,A=p+x*b,y=A+x*f,v=w;break;default:A=p=r.coordinate,g=a+ +h*l,m=g+x*b,v=m+x*f,y=w;break}return{line:{x1:A,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,l=r.orientation,u=r.mirror,d=r.axisLine,h=ta(ta(ta({},vn(this.props,!1)),vn(d,!1)),{},{fill:"none"});if(l==="top"||l==="bottom"){var f=+(l==="top"&&!u||l==="bottom"&&u);h=ta(ta({},h),{},{x1:i,y1:s+f*o,x2:i+a,y2:s+f*o})}else{var A=+(l==="left"&&!u||l==="right"&&u);h=ta(ta({},h),{},{x1:i+A*a,y1:s,x2:i+A*a,y2:s+o})}return re.createElement("line",Yg({},h,{className:_n("recharts-cartesian-axis-line",fl(d,"className"))}))}},{key:"renderTicks",value:function(r,i,s){var a=this,o=this.props,l=o.tickLine,u=o.stroke,d=o.tick,h=o.tickFormatter,f=o.unit,A=DH(ta(ta({},this.props),{},{ticks:r}),i,s),p=this.getTickTextAnchor(),m=this.getTickVerticalAnchor(),g=vn(this.props,!1),y=vn(d,!1),v=ta(ta({},g),{},{fill:"none"},vn(l,!1)),x=A.map(function(b,w){var S=a.getTickLineCoord(b),_=S.line,E=S.tick,j=ta(ta(ta(ta({textAnchor:p,verticalAnchor:m},g),{},{stroke:"none",fill:u},y),E),{},{index:w,payload:b,visibleTicksCount:A.length,tickFormatter:h});return re.createElement(di,Yg({className:"recharts-cartesian-axis-tick",key:"tick-".concat(b.value,"-").concat(b.coordinate,"-").concat(b.tickCoord)},gE(a.props,b,w)),l&&re.createElement("line",Yg({},v,_,{className:_n("recharts-cartesian-axis-tick-line",fl(l,"className"))})),d&&t.renderTickItem(d,j,"".concat(un(h)?h(b.value,w):b.value).concat(f||"")))});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,l=i.ticksGenerator,u=i.className,d=i.hide;if(d)return null;var h=this.props,f=h.ticks,A=x4(h,Wvt),p=f;return un(l)&&(p=f&&f.length>0?l(this.props):l(A)),a<=0||o<=0||!p||!p.length?null:re.createElement(di,{className:_n("recharts-cartesian-axis",u),ref:function(g){r.layerReference=g}},s&&this.renderAxisLine(),this.renderTicks(p,this.state.fontSize,this.state.letterSpacing),Ds.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,s){var a;return re.isValidElement(r)?a=re.cloneElement(r,i):un(r)?a=r(i):a=re.createElement(TE,Yg({},i,{className:"recharts-cartesian-axis-tick-value"}),s),a}}])}(k.Component);QH(xv,"displayName","CartesianAxis");QH(xv,"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 rxt=["x1","y1","x2","y2","key"],ixt=["offset"];function em(e){"@babel/helpers - typeof";return em=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},em(e)}function uX(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 Qs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uX(Object(n),!0).forEach(function(r){sxt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sxt(e,t,n){return t=axt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function axt(e){var t=oxt(e,"string");return em(t)=="symbol"?t:t+""}function oxt(e,t){if(em(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(em(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ep(){return ep=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},ep.apply(this,arguments)}function dX(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}var cxt=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,l=t.ry;return re.createElement("rect",{x:i,y:s,ry:l,width:a,height:o,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function dge(e,t){var n;if(re.isValidElement(e))n=re.cloneElement(e,t);else if(un(e))n=e(t);else{var r=t.x1,i=t.y1,s=t.x2,a=t.y2,o=t.key,l=dX(t,rxt),u=vn(l,!1);u.offset;var d=dX(u,ixt);n=re.createElement("line",ep({},d,{x1:r,y1:i,x2:s,y2:a,fill:"none",key:o}))}return n}function uxt(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,l){var u=Qs(Qs({},e),{},{x1:t,y1:o,x2:t+n,y2:o,key:"line-".concat(l),index:l});return dge(i,u)});return re.createElement("g",{className:"recharts-cartesian-grid-horizontal"},a)}function dxt(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,l){var u=Qs(Qs({},e),{},{x1:o,y1:t,x2:o,y2:t+n,key:"line-".concat(l),index:l});return dge(i,u)});return re.createElement("g",{className:"recharts-cartesian-grid-vertical"},a)}function hxt(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,s=e.width,a=e.height,o=e.horizontalPoints,l=e.horizontal,u=l===void 0?!0:l;if(!u||!t||!t.length)return null;var d=o.map(function(f){return Math.round(f+i-i)}).sort(function(f,A){return f-A});i!==d[0]&&d.unshift(0);var h=d.map(function(f,A){var p=!d[A+1],m=p?i+a-f:d[A+1]-f;if(m<=0)return null;var g=A%t.length;return re.createElement("rect",{key:"react-".concat(A),y:f,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 Axt(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,l=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var d=u.map(function(f){return Math.round(f+s-s)}).sort(function(f,A){return f-A});s!==d[0]&&d.unshift(0);var h=d.map(function(f,A){var p=!d[A+1],m=p?s+o-f:d[A+1]-f;if(m<=0)return null;var g=A%r.length;return re.createElement("rect",{key:"react-".concat(A),x:f,y:a,width:m,height:l,stroke:"none",fill:r[g],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return re.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},h)}var fxt=function(t,n){var r=t.xAxis,i=t.width,s=t.height,a=t.offset;return wme(DH(Qs(Qs(Qs({},xv.defaultProps),r),{},{ticks:ed(r,!0),viewBox:{x:0,y:0,width:i,height:s}})),a.left,a.left+a.width,n)},pxt=function(t,n){var r=t.yAxis,i=t.width,s=t.height,a=t.offset;return wme(DH(Qs(Qs(Qs({},xv.defaultProps),r),{},{ticks:ed(r,!0),viewBox:{x:0,y:0,width:i,height:s}})),a.top,a.top+a.height,n)},ag={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function K5(e){var t,n,r,i,s,a,o=MH(),l=LH(),u=nvt(),d=Qs(Qs({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:ag.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:ag.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:ag.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:ag.horizontalFill,vertical:(s=e.vertical)!==null&&s!==void 0?s:ag.vertical,verticalFill:(a=e.verticalFill)!==null&&a!==void 0?a:ag.verticalFill,x:Je(e.x)?e.x:u.left,y:Je(e.y)?e.y:u.top,width:Je(e.width)?e.width:u.width,height:Je(e.height)?e.height:u.height}),h=d.x,f=d.y,A=d.width,p=d.height,m=d.syncWithTicks,g=d.horizontalValues,y=d.verticalValues,v=Z0t(),x=evt();if(!Je(A)||A<=0||!Je(p)||p<=0||!Je(h)||h!==+h||!Je(f)||f!==+f)return null;var b=d.verticalCoordinatesGenerator||fxt,w=d.horizontalCoordinatesGenerator||pxt,S=d.horizontalPoints,_=d.verticalPoints;if((!S||!S.length)&&un(w)){var E=g&&g.length,j=w({yAxis:x?Qs(Qs({},x),{},{ticks:E?g:x.ticks}):void 0,width:o,height:l,offset:u},E?!0:m);id(Array.isArray(j),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(em(j),"]")),Array.isArray(j)&&(S=j)}if((!_||!_.length)&&un(b)){var I=y&&y.length,T=b({xAxis:v?Qs(Qs({},v),{},{ticks:I?y:v.ticks}):void 0,width:o,height:l,offset:u},I?!0:m);id(Array.isArray(T),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(em(T),"]")),Array.isArray(T)&&(_=T)}return re.createElement("g",{className:"recharts-cartesian-grid"},re.createElement(cxt,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),re.createElement(uxt,ep({},d,{offset:u,horizontalPoints:S,xAxis:v,yAxis:x})),re.createElement(dxt,ep({},d,{offset:u,verticalPoints:_,xAxis:v,yAxis:x})),re.createElement(hxt,ep({},d,{horizontalPoints:S})),re.createElement(Axt,ep({},d,{verticalPoints:_})))}K5.displayName="CartesianGrid";var mxt=["type","layout","connectNulls","ref"],gxt=["key"];function T0(e){"@babel/helpers - typeof";return T0=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},T0(e)}function hX(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}function Kw(){return Kw=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},Kw.apply(this,arguments)}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 co(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){Kl(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 og(e){return bxt(e)||wxt(e)||xxt(e)||vxt()}function vxt(){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 xxt(e,t){if(e){if(typeof e=="string")return DL(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 DL(e,t)}}function wxt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bxt(e){if(Array.isArray(e))return DL(e)}function DL(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 Cxt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fX(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,Age(r.key),r)}}function Sxt(e,t,n){return t&&fX(e.prototype,t),n&&fX(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function kxt(e,t,n){return t=uN(t),Bxt(e,hge()?Reflect.construct(t,n||[],uN(e).constructor):t.apply(e,n))}function Bxt(e,t){if(t&&(T0(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _xt(e)}function _xt(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 uN(e){return uN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},uN(e)}function Ext(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&&QL(e,t)}function QL(e,t){return QL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},QL(e,t)}function Kl(e,t,n){return t=Age(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Age(e){var t=Nxt(e,"string");return T0(t)=="symbol"?t:t+""}function Nxt(e,t){if(T0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(T0(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wv=function(e){function t(){var n;Cxt(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=kxt(this,t,[].concat(i)),Kl(n,"state",{isAnimationFinished:!0,totalLength:0}),Kl(n,"generateSimpleStrokeDasharray",function(a,o){return"".concat(o,"px ").concat(a-o,"px")}),Kl(n,"getStrokeDasharray",function(a,o,l){var u=l.reduce(function(y,v){return y+v});if(!u)return n.generateSimpleStrokeDasharray(o,a);for(var d=Math.floor(a/u),h=a%u,f=o-a,A=[],p=0,m=0;p<l.length;m+=l[p],++p)if(m+l[p]>h){A=[].concat(og(l.slice(0,p)),[h-m]);break}var g=A.length%2===0?[0,f]:[f];return[].concat(og(t.repeat(l,d)),og(A),g).map(function(y){return"".concat(y,"px")}).join(", ")}),Kl(n,"id",P2("recharts-line-")),Kl(n,"pathRef",function(a){n.mainCurve=a}),Kl(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Kl(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return Ext(t,e),Sxt(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,l=s.yAxis,u=s.layout,d=s.children,h=pl(d,R2);if(!h)return null;var f=function(m,g){return{x:m.x,y:m.y,value:m.value,errorVal:_o(m.payload,g)}},A={clipPath:r?"url(#clipPath-".concat(i,")"):null};return re.createElement(di,A,h.map(function(p){return re.cloneElement(p,{key:"bar-".concat(p.props.dataKey),data:a,xAxis:o,yAxis:l,layout:u,dataPointFormatter:f})}))}},{key:"renderDots",value:function(r,i,s){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var o=this.props,l=o.dot,u=o.points,d=o.dataKey,h=vn(this.props,!1),f=vn(l,!0),A=u.map(function(m,g){var y=co(co(co({key:"dot-".concat(g),r:3},h),f),{},{value:m.value,dataKey:d,cx:m.x,cy:m.y,index:g,payload:m.payload});return t.renderDotItem(l,y)}),p={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(s,")"):null};return re.createElement(di,Kw({className:"recharts-line-dots",key:"dots"},p),A)}},{key:"renderCurveStatically",value:function(r,i,s,a){var o=this.props,l=o.type,u=o.layout,d=o.connectNulls;o.ref;var h=hX(o,mxt),f=co(co(co({},vn(h,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(s,")"):null,points:r},a),{},{type:l,layout:u,connectNulls:d});return re.createElement(yL,Kw({},f,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var s=this,a=this.props,o=a.points,l=a.strokeDasharray,u=a.isAnimationActive,d=a.animationBegin,h=a.animationDuration,f=a.animationEasing,A=a.animationId,p=a.animateNewValues,m=a.width,g=a.height,y=this.state,v=y.prevPoints,x=y.totalLength;return re.createElement(xd,{begin:d,duration:h,isActive:u,easing:f,from:{t:0},to:{t:1},key:"line-".concat(A),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(b){var w=b.t;if(v){var S=v.length/o.length,_=o.map(function(N,F){var L=Math.floor(F*S);if(v[L]){var D=v[L],H=Wl(D.x,N.x),W=Wl(D.y,N.y);return co(co({},N),{},{x:H(w),y:W(w)})}if(p){var $=Wl(m*2,N.x),V=Wl(g/2,N.y);return co(co({},N),{},{x:$(w),y:V(w)})}return co(co({},N),{},{x:N.x,y:N.y})});return s.renderCurveStatically(_,r,i)}var E=Wl(0,x),j=E(w),I;if(l){var T="".concat(l).split(/[,\s]+/gim).map(function(N){return parseFloat(N)});I=s.getStrokeDasharray(j,x,T)}else I=s.generateSimpleStrokeDasharray(x,j);return s.renderCurveStatically(o,r,i,{strokeDasharray:I})})}},{key:"renderCurve",value:function(r,i){var s=this.props,a=s.points,o=s.isAnimationActive,l=this.state,u=l.prevPoints,d=l.totalLength;return o&&a&&a.length&&(!u&&d>0||!M5(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,l=i.className,u=i.xAxis,d=i.yAxis,h=i.top,f=i.left,A=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=_n("recharts-line",l),b=u&&u.allowDataOverflow,w=d&&d.allowDataOverflow,S=b||w,_=pn(g)?this.id:g,E=(r=vn(a,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},j=E.r,I=j===void 0?3:j,T=E.strokeWidth,N=T===void 0?2:T,F=CZe(a)?a:{},L=F.clipDot,D=L===void 0?!0:L,H=I*2+N;return re.createElement(di,{className:x},b||w?re.createElement("defs",null,re.createElement("clipPath",{id:"clipPath-".concat(_)},re.createElement("rect",{x:b?f:f-A/2,y:w?h:h-p/2,width:b?A:A*2,height:w?p:p*2})),!D&&re.createElement("clipPath",{id:"clipPath-dots-".concat(_)},re.createElement("rect",{x:f-H/2,y:h-H/2,width:A+H,height:p+H}))):null,!v&&this.renderCurve(S,_),this.renderErrorBar(S,_),(v||a)&&this.renderDots(S,D,_),(!m||y)&&AA.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(og(r),[0]):r,a=[],o=0;o<i;++o)a=[].concat(og(a),og(s));return a}},{key:"renderDotItem",value:function(r,i){var s;if(re.isValidElement(r))s=re.cloneElement(r,i);else if(un(r))s=r(i);else{var a=i.key,o=hX(i,gxt),l=_n("recharts-line-dot",typeof r!="boolean"?r.className:"");s=re.createElement(PH,Kw({key:a},o,{className:l}))}return s}}])}(k.PureComponent);Kl(wv,"displayName","Line");Kl(wv,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!sd.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Kl(wv,"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,l=e.displayedData,u=e.offset,d=t.layout,h=l.map(function(f,A){var p=_o(f,a);return d==="horizontal"?{x:nY({axis:n,ticks:i,bandSize:o,entry:f,index:A}),y:pn(p)?null:r.scale(p),value:p,payload:f}:{x:pn(p)?null:n.scale(p),y:nY({axis:r,ticks:s,bandSize:o,entry:f,index:A}),value:p,payload:f}});return co({points:h,layout:d},u)});function P0(e){"@babel/helpers - typeof";return P0=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},P0(e)}function jxt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Txt(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,mge(r.key),r)}}function Pxt(e,t,n){return t&&Txt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ixt(e,t,n){return t=dN(t),Oxt(e,fge()?Reflect.construct(t,n||[],dN(e).constructor):t.apply(e,n))}function Oxt(e,t){if(t&&(P0(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Fxt(e)}function Fxt(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 dN(e){return dN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},dN(e)}function Mxt(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 pge(e,t,n){return t=mge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mge(e){var t=Lxt(e,"string");return P0(t)=="symbol"?t:t+""}function Lxt(e,t){if(P0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(P0(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $L(){return $L=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},$L.apply(this,arguments)}function Rxt(e){var t=e.xAxisId,n=MH(),r=LH(),i=ege(t);return i==null?null:re.createElement(xv,$L({},i,{className:_n("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(a){return ed(a,!0)}}))}var mm=function(e){function t(){return jxt(this,t),Ixt(this,t,arguments)}return Mxt(t,e),Pxt(t,[{key:"render",value:function(){return re.createElement(Rxt,this.props)}}])}(re.Component);pge(mm,"displayName","XAxis");pge(mm,"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 I0(e){"@babel/helpers - typeof";return I0=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},I0(e)}function Uxt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dxt(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,vge(r.key),r)}}function Qxt(e,t,n){return t&&Dxt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hxt(e,t,n){return t=hN(t),$xt(e,gge()?Reflect.construct(t,n||[],hN(e).constructor):t.apply(e,n))}function $xt(e,t){if(t&&(I0(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zxt(e)}function zxt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gge=function(){return!!e})()}function hN(e){return hN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},hN(e)}function Vxt(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&&zL(e,t)}function zL(e,t){return zL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},zL(e,t)}function yge(e,t,n){return t=vge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vge(e){var t=Kxt(e,"string");return I0(t)=="symbol"?t:t+""}function Kxt(e,t){if(I0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(I0(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function VL(){return VL=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},VL.apply(this,arguments)}var qxt=function(t){var n=t.yAxisId,r=MH(),i=LH(),s=tge(n);return s==null?null:re.createElement(xv,VL({},s,{className:_n("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(o){return ed(o,!0)}}))},gm=function(e){function t(){return Uxt(this,t),Hxt(this,t,arguments)}return Vxt(t,e),Qxt(t,[{key:"render",value:function(){return re.createElement(qxt,this.props)}}])}(re.Component);yge(gm,"displayName","YAxis");yge(gm,"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 pX(e){return Xxt(e)||Yxt(e)||Gxt(e)||Wxt()}function Wxt(){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 Gxt(e,t){if(e){if(typeof e=="string")return KL(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 KL(e,t)}}function Yxt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Xxt(e){if(Array.isArray(e))return KL(e)}function KL(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 qL=function(t,n,r,i,s){var a=pl(t,UH),o=pl(t,$5),l=[].concat(pX(a),pX(o)),u=pl(t,V5),d="".concat(i,"Id"),h=i[0],f=n;if(l.length&&(f=l.reduce(function(m,g){if(g.props[d]===r&&ru(g.props,"extendDomain")&&Je(g.props[h])){var y=g.props[h];return[Math.min(m[0],y),Math.max(m[1],y)]}return m},f)),u.length){var A="".concat(h,"1"),p="".concat(h,"2");f=u.reduce(function(m,g){if(g.props[d]===r&&ru(g.props,"extendDomain")&&Je(g.props[A])&&Je(g.props[p])){var y=g.props[A],v=g.props[p];return[Math.min(m[0],y,v),Math.max(m[1],y,v)]}return m},f)}return s&&s.length&&(f=s.reduce(function(m,g){return Je(g)?[Math.min(m[0],g),Math.max(m[1],g)]:m},f)),f},xge={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(l,u,d){this.fn=l,this.context=u,this.once=d||!1}function s(l,u,d,h,f){if(typeof d!="function")throw new TypeError("The listener must be a function");var A=new i(d,h||l,f),p=n?n+u:u;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],A]:l._events[p].push(A):(l._events[p]=A,l._eventsCount++),l}function a(l,u){--l._eventsCount===0?l._events=new r:delete l._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 f=0,A=h.length,p=new Array(A);f<A;f++)p[f]=h[f].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,f,A,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,f),!0;case 5:return g.fn.call(g.context,d,h,f,A),!0;case 6:return g.fn.call(g.context,d,h,f,A,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,f);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,f){var A=n?n+u:u;if(!this._events[A])return this;if(!d)return a(this,A),this;var p=this._events[A];if(p.fn)p.fn===d&&(!f||p.once)&&(!h||p.context===h)&&a(this,A);else{for(var m=0,g=[],y=p.length;m<y;m++)(p[m].fn!==d||f&&!p[m].once||h&&p[m].context!==h)&&g.push(p[m]);g.length?this._events[A]=g.length===1?g[0]:g:a(this,A)}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})(xge);var Jxt=xge.exports;const Zxt=En(Jxt);var w4=new Zxt,b4="recharts.syncMouseEvents";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 ewt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function twt(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 nwt(e,t,n){return t&&twt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function C4(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=rwt(e,"string");return R1(t)=="symbol"?t:t+""}function rwt(e,t){if(R1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(R1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var iwt=function(){function e(){ewt(this,e),C4(this,"activeIndex",0),C4(this,"coordinateList",[]),C4(this,"layout","horizontal")}return nwt(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,l=n.layout,u=l===void 0?null:l,d=n.offset,h=d===void 0?null:d,f=n.mouseHandlerCallback,A=f===void 0?null:f;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=A??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,l=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+l+u,f=a+this.offset.top+o/2+d;this.mouseHandlerCallback({pageX:h,pageY:f})}}}])}();function swt(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&&Je(r)&&Je(i))return!0}return!1}function awt(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 bge(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,s=e.endAngle,a=vs(t,n,r,i),o=vs(t,n,r,s);return{points:[a,o],cx:t,cy:n,radius:r,startAngle:i,endAngle:s}}function owt(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,l=t.cy,u=t.innerRadius,d=t.outerRadius,h=t.angle,f=vs(o,l,u,h),A=vs(o,l,d,h);r=f.x,i=f.y,s=A.x,a=A.y}else return bge(t);return[{x:r,y:i},{x:s,y:a}]}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 mX(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 QS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mX(Object(n),!0).forEach(function(r){lwt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lwt(e,t,n){return t=cwt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cwt(e){var t=uwt(e,"string");return U1(t)=="symbol"?t:t+""}function uwt(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)}function dwt(e){var t,n,r=e.element,i=e.tooltipEventType,s=e.isActive,a=e.activeCoordinate,o=e.activePayload,l=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,h=e.layout,f=e.chartName,A=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!A||!s||!a||f!=="ScatterChart"&&i!=="axis")return null;var p,m=yL;if(f==="ScatterChart")p=a,m=dgt;else if(f==="BarChart")p=awt(h,a,l,d),m=TH;else if(h==="radial"){var g=bge(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=Bme}else p={points:owt(h,a,l)},m=yL;var S=QS(QS(QS(QS({stroke:"#ccc",pointerEvents:"none"},l),p),vn(A,!1)),{},{payload:o,payloadIndex:u,className:_n("recharts-tooltip-cursor",A.className)});return k.isValidElement(A)?k.cloneElement(A,S):k.createElement(m,S)}var hwt=["item"],Awt=["children","className","width","height","style","compact","title","desc"];function O0(e){"@babel/helpers - typeof";return O0=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},O0(e)}function Xg(){return Xg=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},Xg.apply(this,arguments)}function gX(e,t){return mwt(e)||pwt(e,t)||Sge(e,t)||fwt()}function fwt(){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 pwt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function mwt(e){if(Array.isArray(e))return e}function yX(e,t){if(e==null)return{};var n=gwt(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 gwt(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 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,kge(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=AN(t),bwt(e,Cge()?Reflect.construct(t,n||[],AN(e).constructor):t.apply(e,n))}function bwt(e,t){if(t&&(O0(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 Cge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Cge=function(){return!!e})()}function AN(e){return AN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},AN(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&&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 F0(e){return _wt(e)||Bwt(e)||Sge(e)||kwt()}function kwt(){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 Sge(e,t){if(e){if(typeof e=="string")return GL(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 GL(e,t)}}function Bwt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _wt(e){if(Array.isArray(e))return GL(e)}function GL(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 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 Pe(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){Qt(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 Qt(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=Ewt(e,"string");return O0(t)=="symbol"?t:t+""}function Ewt(e,t){if(O0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(O0(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Nwt={xAxis:["bottom","top"],yAxis:["left","right"]},jwt={width:"100%",height:"100%"},Bge={x:0,y:0};function HS(e){return e}var Twt=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Pwt=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),vs(i.cx,i.cy,o,a)),{},{angle:a,radius:o})}var l=s.coordinate,u=i.angle;return Pe(Pe(Pe({},i),vs(i.cx,i.cy,l,u)),{},{angle:u,radius:l})}return Bge},q5=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,s=n.dataEndIndex,a=(r??[]).reduce(function(o,l){var u=l.props.data;return u&&u.length?[].concat(F0(o),F0(u)):o},[]);return a.length>0?a:t&&t.length&&Je(i)&&Je(s)?t.slice(i,s+1):[]};function _ge(e){return e==="number"?[0,"auto"]:void 0}var YL=function(t,n,r,i){var s=t.graphicalItems,a=t.tooltipAxis,o=q5(n,t);return r<0||!s||!s.length||r>=o.length?null:s.reduce(function(l,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 f;if(a.dataKey&&!a.allowDuplicatedCategory){var A=h===void 0?o:h;f=pE(A,a.dataKey,i)}else f=h&&h[r]||o[r];return f?[].concat(F0(l),[Cme(u,f)]):l},[])},xX=function(t,n,r,i){var s=i||{x:t.chartX,y:t.chartY},a=Twt(s,r),o=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,d=Eft(a,o,u,l);if(d>=0&&u){var h=u[d]&&u[d].value,f=YL(t,n,d,h),A=Pwt(r,o,d,s);return{activeTooltipIndex:d,activeLabel:h,activePayload:f,activeCoordinate:A}}return null},Iwt=function(t,n){var r=n.axes,i=n.graphicalItems,s=n.axisType,a=n.axisIdKey,o=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,h=t.children,f=t.stackOffset,A=xme(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,S=y.scale,_=y.ticks,E=y.includeHidden,j=y[a];if(p[j])return p;var I=q5(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===j}),dataStartIndex:l,dataEndIndex:u}),T=I.length,N,F,L;swt(y.domain,b,v)&&(N=AL(y.domain,null,b),A&&(v==="number"||S!=="auto")&&(L=zw(I,x,"category")));var D=_ge(v);if(!N||N.length===0){var H,W=(H=y.domain)!==null&&H!==void 0?H:D;if(x){if(N=zw(I,x,v),v==="category"&&A){var $=fZe(N);w&&$?(F=N,N=eN(0,T)):w||(N=aY(W,N,m).reduce(function(R,M){return R.indexOf(M)>=0?R:[].concat(F0(R),[M])},[]))}else if(v==="category")w?N=N.filter(function(R){return R!==""&&!pn(R)}):N=aY(W,N,m).reduce(function(R,M){return R.indexOf(M)>=0||M===""||pn(M)?R:[].concat(F0(R),[M])},[]);else if(v==="number"){var V=Ift(I,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],K="hide"in R.props?R.props.hide:(Y=R.type.defaultProps)===null||Y===void 0?void 0:Y.hide;return X===j&&(E||!K)}),x,s,d);V&&(N=V)}A&&(v==="number"||S!=="auto")&&(L=zw(I,x,"category"))}else A?N=eN(0,T):o&&o[j]&&o[j].hasStack&&v==="number"?N=f==="expand"?[0,1]:bme(o[j].stackGroups,l,u):N=vme(I,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===j&&(E||!Y)}),v,d,!0);if(v==="number")N=qL(h,N,j,s,_),W&&(N=AL(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),{},Qt({},j,Pe(Pe({},y),{},{axisType:s,domain:N,categoricalDomain:L,duplicateDomain:F,originalDomain:(g=y.domain)!==null&&g!==void 0?g:D,isCategorical:A,layout:d})))},{})},Owt=function(t,n){var r=n.graphicalItems,i=n.Axis,s=n.axisType,a=n.axisIdKey,o=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,h=t.children,f=q5(t.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:u}),A=f.length,p=xme(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=_ge("number");if(!g[x]){m++;var w;return p?w=eN(0,A):o&&o[x]&&o[x].hasStack?(w=bme(o[x].stackGroups,l,u),w=qL(h,w,x,s)):(w=AL(b,vme(f,r.filter(function(S){var _,E,j=a in S.props?S.props[a]:(_=S.type.defaultProps)===null||_===void 0?void 0:_[a],I="hide"in S.props?S.props.hide:(E=S.type.defaultProps)===null||E===void 0?void 0:E.hide;return j===x&&!I}),"number",d),i.defaultProps.allowDataOverflow),w=qL(h,w,x,s)),Pe(Pe({},g),{},Qt({},x,Pe(Pe({axisType:s},i.defaultProps),{},{hide:!0,orientation:fl(Nwt,"".concat(s,".").concat(m%2),null),domain:w,originalDomain:b,isCategorical:p,layout:d})))}return g},{})},Fwt=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,s=n.AxisComp,a=n.graphicalItems,o=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,d=t.children,h="".concat(i,"Id"),f=pl(d,s),A={};return f&&f.length?A=Iwt(t,{axes:f,graphicalItems:a,axisType:i,axisIdKey:h,stackGroups:o,dataStartIndex:l,dataEndIndex:u}):a&&a.length&&(A=Owt(t,{Axis:s,graphicalItems:a,axisType:i,axisIdKey:h,stackGroups:o,dataStartIndex:l,dataEndIndex:u})),A},Mwt=function(t){var n=Ch(t),r=ed(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:rH(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:VE(n,r)}},wX=function(t){var n=t.children,r=t.defaultShowTooltip,i=po(n,k0),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}},Lwt=function(t){return!t||!t.length?!1:t.some(function(n){var r=rd(n&&n.type);return r&&r.indexOf("Bar")>=0})},bX=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"}},Rwt=function(t,n){var r=t.props,i=t.graphicalItems,s=t.xAxisMap,a=s===void 0?{}:s,o=t.yAxisMap,l=o===void 0?{}:o,u=r.width,d=r.height,h=r.children,f=r.margin||{},A=po(h,k0),p=po(h,Sp),m=Object.keys(l).reduce(function(w,S){var _=l[S],E=_.orientation;return!_.mirror&&!_.hide?Pe(Pe({},w),{},Qt({},E,w[E]+_.width)):w},{left:f.left||0,right:f.right||0}),g=Object.keys(a).reduce(function(w,S){var _=a[S],E=_.orientation;return!_.mirror&&!_.hide?Pe(Pe({},w),{},Qt({},E,fl(w,"".concat(E))+_.height)):w},{top:f.top||0,bottom:f.bottom||0}),y=Pe(Pe({},g),m),v=y.bottom;A&&(y.bottom+=A.props.height||k0.defaultProps.height),p&&n&&(y=Tft(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)})},Uwt=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},Ege=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,l=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,h=t.defaultProps,f=function(y,v){var x=v.graphicalItems,b=v.stackGroups,w=v.offset,S=v.updateId,_=v.dataStartIndex,E=v.dataEndIndex,j=y.barSize,I=y.layout,T=y.barGap,N=y.barCategoryGap,F=y.maxBarSize,L=bX(I),D=L.numericAxisName,H=L.cateAxisName,W=Lwt(x),$=[];return x.forEach(function(V,Q){var ce=q5(y.data,{graphicalItems:[V],dataStartIndex:_,dataEndIndex:E}),R=V.type.defaultProps!==void 0?Pe(Pe({},V.type.defaultProps),V.props):V.props,M=R.dataKey,Y=R.maxBarSize,X=R["".concat(D,"Id")],K=R["".concat(H,"Id")],Z={},de=l.reduce(function(xe,Qe){var ze=v["".concat(Qe.axisType,"Map")],Dt=R["".concat(Qe.axisType,"Id")];ze&&ze[Dt]||Qe.axisType==="zAxis"||Zp();var dt=ze[Dt];return Pe(Pe({},xe),{},Qt(Qt({},Qe.axisType,dt),"".concat(Qe.axisType,"Ticks"),ed(dt)))},Z),se=de[H],ie=de["".concat(H,"Ticks")],he=b&&b[X]&&b[X].hasStack&&Vft(V,b[X].stackGroups),ue=rd(V.type).indexOf("Bar")>=0,Se=VE(se,ie),Fe=[],te=W&&Nft({barSize:j,stackGroups:b,totalSize:Uwt(de,H)});if(ue){var _e,Ze,et=pn(Y)?F:Y,Te=(_e=(Ze=VE(se,ie,!0))!==null&&Ze!==void 0?Ze:et)!==null&&_e!==void 0?_e:0;Fe=jft({barGap:T,barCategoryGap:N,bandSize:Te!==Se?Te:Se,sizeList:te[K],maxBarSize:et}),Te!==Se&&(Fe=Fe.map(function(xe){return Pe(Pe({},xe),{},{position:Pe(Pe({},xe.position),{},{offset:xe.position.offset-Te/2})})}))}var st=V&&V.type&&V.type.getComposedData;st&&$.push({props:Pe(Pe({},st(Pe(Pe({},de),{},{displayedData:ce,props:y,dataKey:M,item:V,bandSize:Se,barPosition:Fe,offset:w,stackedData:he,layout:I,dataStartIndex:_,dataEndIndex:E}))),{},Qt(Qt(Qt({key:V.key||"item-".concat(Q)},D,de[D]),H,de[H]),"animationId",S)),childIndex:BZe(V,y.children),item:V})}),$},A=function(y,v){var x=y.props,b=y.dataStartIndex,w=y.dataEndIndex,S=y.updateId;if(!Zq({props:x}))return null;var _=x.children,E=x.layout,j=x.stackOffset,I=x.data,T=x.reverseStackOrder,N=bX(E),F=N.numericAxisName,L=N.cateAxisName,D=pl(_,r),H=Hft(I,D,"".concat(F,"Id"),"".concat(L,"Id"),j,T),W=l.reduce(function(R,M){var Y="".concat(M.axisType,"Map");return Pe(Pe({},R),{},Qt({},Y,Fwt(x,Pe(Pe({},M),{},{graphicalItems:D,stackGroups:M.axisType===F&&H,dataStartIndex:b,dataEndIndex:w}))))},{}),$=Rwt(Pe(Pe({},W),{},{props:x,graphicalItems:D}),v==null?void 0:v.legendBBox);Object.keys(W).forEach(function(R){W[R]=d(x,W[R],$,R.replace("Map",""),n)});var V=W["".concat(L,"Map")],Q=Mwt(V),ce=f(x,Pe(Pe({},W),{},{dataStartIndex:b,dataEndIndex:w,updateId:S,graphicalItems:D,stackGroups:H,offset:$}));return Pe(Pe({formattedGraphicalItems:ce,graphicalItems:D,offset:$,stackGroups:H},Q),W)},p=function(g){function y(v){var x,b,w;return ywt(this,y),w=wwt(this,y,[v]),Qt(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Qt(w,"accessibilityManager",new iwt),Qt(w,"handleLegendBBoxUpdate",function(S){if(S){var _=w.state,E=_.dataStartIndex,j=_.dataEndIndex,I=_.updateId;w.setState(Pe({legendBBox:S},A({props:w.props,dataStartIndex:E,dataEndIndex:j,updateId:I},Pe(Pe({},w.state),{},{legendBBox:S}))))}}),Qt(w,"handleReceiveSyncEvent",function(S,_,E){if(w.props.syncId===S){if(E===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(_)}}),Qt(w,"handleBrushChange",function(S){var _=S.startIndex,E=S.endIndex;if(_!==w.state.dataStartIndex||E!==w.state.dataEndIndex){var j=w.state.updateId;w.setState(function(){return Pe({dataStartIndex:_,dataEndIndex:E},A({props:w.props,dataStartIndex:_,dataEndIndex:E,updateId:j},w.state))}),w.triggerSyncEvent({dataStartIndex:_,dataEndIndex:E})}}),Qt(w,"handleMouseEnter",function(S){var _=w.getMouseInfo(S);if(_){var E=Pe(Pe({},_),{},{isTooltipActive:!0});w.setState(E),w.triggerSyncEvent(E);var j=w.props.onMouseEnter;un(j)&&j(E,S)}}),Qt(w,"triggeredAfterMouseMove",function(S){var _=w.getMouseInfo(S),E=_?Pe(Pe({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(E),w.triggerSyncEvent(E);var j=w.props.onMouseMove;un(j)&&j(E,S)}),Qt(w,"handleItemMouseEnter",function(S){w.setState(function(){return{isTooltipActive:!0,activeItem:S,activePayload:S.tooltipPayload,activeCoordinate:S.tooltipPosition||{x:S.cx,y:S.cy}}})}),Qt(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),Qt(w,"handleMouseMove",function(S){S.persist(),w.throttleTriggeredAfterMouseMove(S)}),Qt(w,"handleMouseLeave",function(S){w.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};w.setState(_),w.triggerSyncEvent(_);var E=w.props.onMouseLeave;un(E)&&E(_,S)}),Qt(w,"handleOuterEvent",function(S){var _=kZe(S),E=fl(w.props,"".concat(_));if(_&&un(E)){var j,I;/.*touch.*/i.test(_)?I=w.getMouseInfo(S.changedTouches[0]):I=w.getMouseInfo(S),E((j=I)!==null&&j!==void 0?j:{},S)}}),Qt(w,"handleClick",function(S){var _=w.getMouseInfo(S);if(_){var E=Pe(Pe({},_),{},{isTooltipActive:!0});w.setState(E),w.triggerSyncEvent(E);var j=w.props.onClick;un(j)&&j(E,S)}}),Qt(w,"handleMouseDown",function(S){var _=w.props.onMouseDown;if(un(_)){var E=w.getMouseInfo(S);_(E,S)}}),Qt(w,"handleMouseUp",function(S){var _=w.props.onMouseUp;if(un(_)){var E=w.getMouseInfo(S);_(E,S)}}),Qt(w,"handleTouchMove",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(S.changedTouches[0])}),Qt(w,"handleTouchStart",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&w.handleMouseDown(S.changedTouches[0])}),Qt(w,"handleTouchEnd",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&w.handleMouseUp(S.changedTouches[0])}),Qt(w,"handleDoubleClick",function(S){var _=w.props.onDoubleClick;if(un(_)){var E=w.getMouseInfo(S);_(E,S)}}),Qt(w,"handleContextMenu",function(S){var _=w.props.onContextMenu;if(un(_)){var E=w.getMouseInfo(S);_(E,S)}}),Qt(w,"triggerSyncEvent",function(S){w.props.syncId!==void 0&&w4.emit(b4,w.props.syncId,S,w.eventEmitterSymbol)}),Qt(w,"applySyncEvent",function(S){var _=w.props,E=_.layout,j=_.syncMethod,I=w.state.updateId,T=S.dataStartIndex,N=S.dataEndIndex;if(S.dataStartIndex!==void 0||S.dataEndIndex!==void 0)w.setState(Pe({dataStartIndex:T,dataEndIndex:N},A({props:w.props,dataStartIndex:T,dataEndIndex:N,updateId:I},w.state)));else if(S.activeTooltipIndex!==void 0){var F=S.chartX,L=S.chartY,D=S.activeTooltipIndex,H=w.state,W=H.offset,$=H.tooltipTicks;if(!W)return;if(typeof j=="function")D=j($,S);else if(j==="value"){D=-1;for(var V=0;V<$.length;V++)if($[V].value===S.activeLabel){D=V;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=$[D]&&$[D].value,Y=YL(w.state,w.props.data,D),X=$[D]?{x:E==="horizontal"?$[D].coordinate:ce,y:E==="horizontal"?R:$[D].coordinate}:Bge;w.setState(Pe(Pe({},S),{},{activeLabel:M,activeCoordinate:X,activePayload:Y,activeTooltipIndex:D}))}else w.setState(S)}),Qt(w,"renderCursor",function(S){var _,E=w.state,j=E.isTooltipActive,I=E.activeCoordinate,T=E.activePayload,N=E.offset,F=E.activeTooltipIndex,L=E.tooltipAxisBandSize,D=w.getTooltipEventType(),H=(_=S.props.active)!==null&&_!==void 0?_:j,W=w.props.layout,$=S.key||"_recharts-cursor";return re.createElement(dwt,{key:$,activeCoordinate:I,activePayload:T,activeTooltipIndex:F,chartName:n,element:S,isActive:H,layout:W,offset:N,tooltipAxisBandSize:L,tooltipEventType:D})}),Qt(w,"renderPolarAxis",function(S,_,E){var j=fl(S,"type.axisType"),I=fl(w.state,"".concat(j,"Map")),T=S.type.defaultProps,N=T!==void 0?Pe(Pe({},T),S.props):S.props,F=I&&I[N["".concat(j,"Id")]];return k.cloneElement(S,Pe(Pe({},F),{},{className:_n(j,F.className),key:S.key||"".concat(_,"-").concat(E),ticks:ed(F,!0)}))}),Qt(w,"renderPolarGrid",function(S){var _=S.props,E=_.radialLines,j=_.polarAngles,I=_.polarRadius,T=w.state,N=T.radiusAxisMap,F=T.angleAxisMap,L=Ch(N),D=Ch(F),H=D.cx,W=D.cy,$=D.innerRadius,V=D.outerRadius;return k.cloneElement(S,{polarAngles:Array.isArray(j)?j:ed(D,!0).map(function(Q){return Q.coordinate}),polarRadius:Array.isArray(I)?I:ed(L,!0).map(function(Q){return Q.coordinate}),cx:H,cy:W,innerRadius:$,outerRadius:V,key:S.key||"polar-grid",radialLines:E})}),Qt(w,"renderLegend",function(){var S=w.state.formattedGraphicalItems,_=w.props,E=_.children,j=_.width,I=_.height,T=w.props.margin||{},N=j-(T.left||0)-(T.right||0),F=gme({children:E,formattedGraphicalItems:S,legendWidth:N,legendContent:u});if(!F)return null;var L=F.item,D=yX(F,hwt);return k.cloneElement(L,Pe(Pe({},D),{},{chartWidth:j,chartHeight:I,margin:T,onBBoxUpdate:w.handleLegendBBoxUpdate}))}),Qt(w,"renderTooltip",function(){var S,_=w.props,E=_.children,j=_.accessibilityLayer,I=po(E,Go);if(!I)return null;var T=w.state,N=T.isTooltipActive,F=T.activeCoordinate,L=T.activePayload,D=T.activeLabel,H=T.offset,W=(S=I.props.active)!==null&&S!==void 0?S:N;return k.cloneElement(I,{viewBox:Pe(Pe({},H),{},{x:H.left,y:H.top}),active:W,label:D,payload:W?L:[],coordinate:F,accessibilityLayer:j})}),Qt(w,"renderBrush",function(S){var _=w.props,E=_.margin,j=_.data,I=w.state,T=I.offset,N=I.dataStartIndex,F=I.dataEndIndex,L=I.updateId;return k.cloneElement(S,{key:S.key||"_recharts-brush",onChange:RS(w.handleBrushChange,S.props.onChange),data:j,x:Je(S.props.x)?S.props.x:T.left,y:Je(S.props.y)?S.props.y:T.top+T.height+T.brushBottom-(E.bottom||0),width:Je(S.props.width)?S.props.width:T.width,startIndex:N,endIndex:F,updateId:"brush-".concat(L)})}),Qt(w,"renderReferenceElement",function(S,_,E){if(!S)return null;var j=w,I=j.clipPathId,T=w.state,N=T.xAxisMap,F=T.yAxisMap,L=T.offset,D=S.type.defaultProps||{},H=S.props,W=H.xAxisId,$=W===void 0?D.xAxisId:W,V=H.yAxisId,Q=V===void 0?D.yAxisId:V;return k.cloneElement(S,{key:S.key||"".concat(_,"-").concat(E),xAxis:N[$],yAxis:F[Q],viewBox:{x:L.left,y:L.top,width:L.width,height:L.height},clipPathId:I})}),Qt(w,"renderActivePoints",function(S){var _=S.item,E=S.activePoint,j=S.basePoint,I=S.childIndex,T=S.isRange,N=[],F=_.props.key,L=_.item.type.defaultProps!==void 0?Pe(Pe({},_.item.type.defaultProps),_.item.props):_.item.props,D=L.activeDot,H=L.dataKey,W=Pe(Pe({index:I,dataKey:H,cx:E.x,cy:E.y,r:4,fill:jH(_.item),strokeWidth:2,stroke:"#fff",payload:E.payload,value:E.value},vn(D,!1)),mE(D));return N.push(y.renderActiveDot(D,W,"".concat(F,"-activePoint-").concat(I))),j?N.push(y.renderActiveDot(D,Pe(Pe({},W),{},{cx:j.x,cy:j.y}),"".concat(F,"-basePoint-").concat(I))):T&&N.push(null),N}),Qt(w,"renderGraphicChild",function(S,_,E){var j=w.filterFormatItem(S,_,E);if(!j)return null;var I=w.getTooltipEventType(),T=w.state,N=T.isTooltipActive,F=T.tooltipAxis,L=T.activeTooltipIndex,D=T.activeLabel,H=w.props.children,W=po(H,Go),$=j.props,V=$.points,Q=$.isRange,ce=$.baseLine,R=j.item.type.defaultProps!==void 0?Pe(Pe({},j.item.type.defaultProps),j.item.props):j.item.props,M=R.activeDot,Y=R.hide,X=R.activeBar,K=R.activeShape,Z=!!(!Y&&N&&W&&(M||X||K)),de={};I!=="axis"&&W&&W.props.trigger==="click"?de={onClick:RS(w.handleItemMouseEnter,S.props.onClick)}:I!=="axis"&&(de={onMouseLeave:RS(w.handleItemMouseLeave,S.props.onMouseLeave),onMouseEnter:RS(w.handleItemMouseEnter,S.props.onMouseEnter)});var se=k.cloneElement(S,Pe(Pe({},j.props),de));function ie(Qe){return typeof F.dataKey=="function"?F.dataKey(Qe.payload):null}if(Z)if(L>=0){var he,ue;if(F.dataKey&&!F.allowDuplicatedCategory){var Se=typeof F.dataKey=="function"?ie:"payload.".concat(F.dataKey.toString());he=pE(V,Se,D),ue=Q&&ce&&pE(ce,Se,D)}else he=V==null?void 0:V[L],ue=Q&&ce&&ce[L];if(K||X){var Fe=S.props.activeIndex!==void 0?S.props.activeIndex:L;return[k.cloneElement(S,Pe(Pe(Pe({},j.props),de),{},{activeIndex:Fe})),null,null]}if(!pn(he))return[se].concat(F0(w.renderActivePoints({item:j,activePoint:he,basePoint:ue,childIndex:L,isRange:Q})))}else{var te,_e=(te=w.getItemByXY(w.state.activeCoordinate))!==null&&te!==void 0?te:{graphicalItem:se},Ze=_e.graphicalItem,et=Ze.item,Te=et===void 0?S:et,st=Ze.childIndex,xe=Pe(Pe(Pe({},j.props),de),{},{activeIndex:st});return[k.cloneElement(Te,xe),null,null]}return Q?[se,null,null]:[se,null]}),Qt(w,"renderCustomized",function(S,_,E){return k.cloneElement(S,Pe(Pe({key:"recharts-customized-".concat(E)},w.props),w.state))}),Qt(w,"renderMap",{CartesianGrid:{handler:HS,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:HS},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:HS},YAxis:{handler:HS},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:P2("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=mpe(w.triggeredAfterMouseMove,(b=v.throttleDelay)!==null&&b!==void 0?b:1e3/60),w.state={},w}return Swt(y,g),xwt(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,S=x.height,_=x.layout,E=po(b,Go);if(E){var j=E.props.defaultIndex;if(!(typeof j!="number"||j<0||j>this.state.tooltipTicks.length-1)){var I=this.state.tooltipTicks[j]&&this.state.tooltipTicks[j].value,T=YL(this.state,w,j,I),N=this.state.tooltipTicks[j].coordinate,F=(this.state.offset.top+S)/2,L=_==="horizontal",D=L?{x:N,y:F}:{y:N,x:F},H=this.state.formattedGraphicalItems.find(function($){var V=$.item;return V.type.name==="Scatter"});H&&(D=Pe(Pe({},D),H.props.points[j].tooltipPosition),T=H.props.points[j].tooltipPayload);var W={activeTooltipIndex:j,isTooltipActive:!0,activeLabel:I,activePayload:T,activeCoordinate:D};this.setState(W),this.renderCursor(E),this.accessibilityManager.setIndex(j)}}}},{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,S;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0}})}return null}},{key:"componentDidUpdate",value:function(x){EM([po(x.children,Go)],[po(this.props.children,Go)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=po(this.props.children,Go);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(),S=eut(w),_={chartX:Math.round(x.pageX-S.left),chartY:Math.round(x.pageY-S.top)},E=w.width/b.offsetWidth||1,j=this.inRange(_.chartX,_.chartY,E);if(!j)return null;var I=this.state,T=I.xAxisMap,N=I.yAxisMap,F=this.getTooltipEventType();if(F!=="axis"&&T&&N){var L=Ch(T).scale,D=Ch(N).scale,H=L&&L.invert?L.invert(_.chartX):null,W=D&&D.invert?D.invert(_.chartY):null;return Pe(Pe({},_),{},{xValue:H,yValue:W})}var $=xX(this.state,this.props.data,this.props.layout,j);return $?Pe(Pe({},_),$):null}},{key:"inRange",value:function(x,b){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,S=this.props.layout,_=x/w,E=b/w;if(S==="horizontal"||S==="vertical"){var j=this.state.offset,I=_>=j.left&&_<=j.left+j.width&&E>=j.top&&E<=j.top+j.height;return I?{x:_,y:E}:null}var T=this.state,N=T.angleAxisMap,F=T.radiusAxisMap;if(N&&F){var L=Ch(N);return cY({x:_,y:E},L)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,b=this.getTooltipEventType(),w=po(x,Go),S={};w&&b==="axis"&&(w.props.trigger==="click"?S={onClick:this.handleClick}:S={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 _=mE(this.props,this.handleOuterEvent);return Pe(Pe({},_),S)}},{key:"addListener",value:function(){w4.on(b4,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){w4.removeListener(b4,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,b,w){for(var S=this.state.formattedGraphicalItems,_=0,E=S.length;_<E;_++){var j=S[_];if(j.item===x||j.props.key===x.key||b===rd(j.item.type)&&w===j.childIndex)return j}return null}},{key:"renderClipPath",value:function(){var x=this.clipPathId,b=this.state.offset,w=b.left,S=b.top,_=b.height,E=b.width;return re.createElement("defs",null,re.createElement("clipPath",{id:x},re.createElement("rect",{x:w,y:S,height:_,width:E})))}},{key:"getXScales",value:function(){var x=this.state.xAxisMap;return x?Object.entries(x).reduce(function(b,w){var S=gX(w,2),_=S[0],E=S[1];return Pe(Pe({},b),{},Qt({},_,E.scale))},{}):null}},{key:"getYScales",value:function(){var x=this.state.yAxisMap;return x?Object.entries(x).reduce(function(b,w){var S=gX(w,2),_=S[0],E=S[1];return Pe(Pe({},b),{},Qt({},_,E.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,S=b.activeItem;if(w&&w.length)for(var _=0,E=w.length;_<E;_++){var j=w[_],I=j.props,T=j.item,N=T.type.defaultProps!==void 0?Pe(Pe({},T.type.defaultProps),T.props):T.props,F=rd(T.type);if(F==="Bar"){var L=(I.data||[]).find(function($){return tgt(x,$)});if(L)return{graphicalItem:j,payload:L}}else if(F==="RadialBar"){var D=(I.data||[]).find(function($){return cY(x,$)});if(D)return{graphicalItem:j,payload:D}}else if(U5(j,S)||D5(j,S)||I1(j,S)){var H=iyt({graphicalItem:j,activeTooltipItem:S,itemData:N.data}),W=N.activeIndex===void 0?H:N.activeIndex;return{graphicalItem:Pe(Pe({},j),{},{childIndex:W}),payload:I1(j,S)?N.data[H]:j.props.data[H]}}}return null}},{key:"render",value:function(){var x=this;if(!Zq(this))return null;var b=this.props,w=b.children,S=b.className,_=b.width,E=b.height,j=b.style,I=b.compact,T=b.title,N=b.desc,F=yX(b,Awt),L=vn(F,!1);if(I)return re.createElement(ZY,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},re.createElement(jM,Xg({},L,{width:_,height:E,title:T,desc:N}),this.renderClipPath(),tW(w,this.renderMap)));if(this.props.accessibilityLayer){var D,H;L.tabIndex=(D=this.props.tabIndex)!==null&&D!==void 0?D: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(ZY,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},re.createElement("div",Xg({className:_n("recharts-wrapper",S),style:Pe({position:"relative",cursor:"default",width:_,height:E},j)},W,{ref:function(V){x.container=V}}),re.createElement(jM,Xg({},L,{width:_,height:E,title:T,desc:N,style:jwt}),this.renderClipPath(),tW(w,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(k.Component);Qt(p,"displayName",n),Qt(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)),Qt(p,"getDerivedStateFromProps",function(g,y){var v=g.dataKey,x=g.data,b=g.children,w=g.width,S=g.height,_=g.layout,E=g.stackOffset,j=g.margin,I=y.dataStartIndex,T=y.dataEndIndex;if(y.updateId===void 0){var N=wX(g);return Pe(Pe(Pe({},N),{},{updateId:0},A(Pe(Pe({props:g},N),{},{updateId:0}),y)),{},{prevDataKey:v,prevData:x,prevWidth:w,prevHeight:S,prevLayout:_,prevStackOffset:E,prevMargin:j,prevChildren:b})}if(v!==y.prevDataKey||x!==y.prevData||w!==y.prevWidth||S!==y.prevHeight||_!==y.prevLayout||E!==y.prevStackOffset||!Cy(j,y.prevMargin)){var F=wX(g),L={chartX:y.chartX,chartY:y.chartY,isTooltipActive:y.isTooltipActive},D=Pe(Pe({},xX(y,x,_)),{},{updateId:y.updateId+1}),H=Pe(Pe(Pe({},F),L),D);return Pe(Pe(Pe({},H),A(Pe({props:g},H),y)),{},{prevDataKey:v,prevData:x,prevWidth:w,prevHeight:S,prevLayout:_,prevStackOffset:E,prevMargin:j,prevChildren:b})}if(!EM(b,y.prevChildren)){var W,$,V,Q,ce=po(b,k0),R=ce&&(W=($=ce.props)===null||$===void 0?void 0:$.startIndex)!==null&&W!==void 0?W:I,M=ce&&(V=(Q=ce.props)===null||Q===void 0?void 0:Q.endIndex)!==null&&V!==void 0?V:T,Y=R!==I||M!==T,X=!pn(x),K=X&&!Y?y.updateId:y.updateId+1;return Pe(Pe({updateId:K},A(Pe(Pe({props:g},y),{},{updateId:K,dataStartIndex:R,dataEndIndex:M}),y)),{},{prevChildren:b,dataStartIndex:R,dataEndIndex:M})}return null}),Qt(p,"renderActiveDot",function(g,y,v){var x;return k.isValidElement(g)?x=k.cloneElement(g,y):un(g)?x=g(y):x=re.createElement(PH,y),re.createElement(di,{className:"recharts-active-dot",key:v},x)});var m=k.forwardRef(function(y,v){return re.createElement(p,Xg({},y,{ref:v}))});return m.displayName=p.displayName,m},Nge=Ege({chartName:"LineChart",GraphicalChild:wv,axisComponents:[{axisType:"xAxis",AxisComp:mm},{axisType:"yAxis",AxisComp:gm}],formatAxisMap:Kme}),Dwt=Ege({chartName:"BarChart",GraphicalChild:pm,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:mm},{axisType:"yAxis",AxisComp:gm}],formatAxisMap:Kme});const CX={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"},Qwt=()=>{const[e,t]=k.useState([]),[n,r]=k.useState(!0),[i,s]=k.useState([]),[a,o]=k.useState(!0);k.useEffect(()=>{(async()=>{const S=new Date(Date.now()-2592e6).toISOString(),{data:_}=await Me.from("crawl_events").select("id, crawler_name, crawler_company, page_path, status_code, created_at").gte("created_at",S).order("created_at",{ascending:!1}).limit(1e3);t(_||[]),r(!1)})()},[]),k.useEffect(()=>{(async()=>{const[{data:S},{data:_}]=await Promise.all([Me.from("aeo_pages").select("slug").eq("status","published"),Me.from("crawl_events").select("page_path")]);if(S&&_){const E=new Set((_||[]).map(I=>I.page_path)),j=S.map(I=>`/${I.slug}`).filter(I=>!E.has(I));s(j)}o(!1)})()},[]);const l=Date.now(),u=l-7*864e5,d=l-14*864e5,h=k.useMemo(()=>e.filter(w=>new Date(w.created_at).getTime()>=u),[e,u]),f=k.useMemo(()=>e.filter(w=>{const S=new Date(w.created_at).getTime();return S>=d&&S<u}),[e,u,d]),A=k.useMemo(()=>new Set(h.map(w=>w.crawler_name)).size,[h]),p=k.useMemo(()=>{const w={};h.forEach(_=>{w[_.crawler_name]=(w[_.crawler_name]||0)+1});const S=Object.entries(w).sort((_,E)=>E[1]-_[1])[0];return S?{name:S[0],count:S[1]}:null},[h]),m=k.useMemo(()=>new Set(h.map(w=>w.page_path)).size,[h]),g=h.length>f.length?"up":h.length<f.length?"down":"flat",y=g==="up"?Are:g==="down"?I1e:cre,v=k.useMemo(()=>{const w={},S=new Set;return e.forEach(E=>{const j=E.created_at.substring(0,10);w[j]||(w[j]={}),w[j][E.crawler_name]=(w[j][E.crawler_name]||0)+1,S.add(E.crawler_name)}),{data:Object.entries(w).sort((E,j)=>E[0].localeCompare(j[0])).map(([E,j])=>({date:E.slice(5),...j})),crawlers:Array.from(S)}},[e]),x=k.useMemo(()=>{const w={};return h.forEach(S=>{w[S.crawler_name]||(w[S.crawler_name]={company:S.crawler_company,count:0,lastVisit:S.created_at,pageCounts:{}}),w[S.crawler_name].count++,w[S.crawler_name].pageCounts[S.page_path]=(w[S.crawler_name].pageCounts[S.page_path]||0)+1,S.created_at>w[S.crawler_name].lastVisit&&(w[S.crawler_name].lastVisit=S.created_at)}),Object.entries(w).map(([S,_])=>{var E;return{name:S,company:_.company,count:_.count,lastVisit:_.lastVisit,topPage:((E=Object.entries(_.pageCounts).sort((j,I)=>I[1]-j[1])[0])==null?void 0:E[0])||"-"}}).sort((S,_)=>_.count-S.count)},[h]),b=e.slice(0,50);return n?c.jsxs("div",{className:"space-y-4",children:[c.jsx(Tt,{className:"h-32 w-full"}),c.jsx(Tt,{className:"h-64 w-full"})]}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[c.jsx(vr,{children:c.jsx(xr,{className:"pt-6",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Visits (7d)"}),c.jsx("p",{className:"text-2xl font-bold",children:h.length})]}),c.jsx(y,{className:`w-5 h-5 ${g==="up"?"text-green-500":g==="down"?"text-red-500":"text-muted-foreground"}`})]})})}),c.jsx(vr,{children:c.jsxs(xr,{className:"pt-6",children:[c.jsx("div",{className:"flex items-center gap-2",children:c.jsx(Mk,{className:"w-5 h-5 text-muted-foreground"})}),c.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Unique Crawlers"}),c.jsx("p",{className:"text-2xl font-bold",children:A})]})}),c.jsx(vr,{children:c.jsxs(xr,{className:"pt-6",children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"Most Active Crawler"}),c.jsx("p",{className:"text-2xl font-bold",children:(p==null?void 0:p.name)||"—"}),p&&c.jsxs("p",{className:"text-xs text-muted-foreground",children:[p.count," visits"]})]})}),c.jsx(vr,{children:c.jsxs(xr,{className:"pt-6",children:[c.jsx("div",{className:"flex items-center gap-2",children:c.jsx(Xy,{className:"w-5 h-5 text-muted-foreground"})}),c.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Pages Crawled"}),c.jsx("p",{className:"text-2xl font-bold",children:m})]})})]}),c.jsxs(vr,{children:[c.jsx(La,{children:c.jsx(Ra,{className:"text-base",children:"Crawler Activity — Last 30 Days"})}),c.jsx(xr,{children:v.data.length===0?c.jsx("p",{className:"text-sm text-muted-foreground py-8 text-center",children:"No crawler activity recorded yet."}):c.jsx(sH,{width:"100%",height:300,children:c.jsxs(Nge,{data:v.data,children:[c.jsx(K5,{strokeDasharray:"3 3",className:"stroke-border"}),c.jsx(mm,{dataKey:"date",className:"text-xs"}),c.jsx(gm,{className:"text-xs"}),c.jsx(Go,{contentStyle:{backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",color:"hsl(var(--foreground))"}}),c.jsx(Sp,{}),v.crawlers.map(w=>c.jsx(wv,{type:"monotone",dataKey:w,stroke:CX[w]||"#888",strokeWidth:2,dot:!1},w))]})})})]}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[c.jsxs(vr,{children:[c.jsx(La,{children:c.jsx(Ra,{className:"text-base",children:"Crawler Breakdown (7d)"})}),c.jsx(xr,{children:x.length===0?c.jsx("p",{className:"text-sm text-muted-foreground",children:"No crawler visits in the last 7 days."}):c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-border text-muted-foreground",children:[c.jsx("th",{className:"text-left py-2 font-medium",children:"Crawler"}),c.jsx("th",{className:"text-left py-2 font-medium",children:"Company"}),c.jsx("th",{className:"text-right py-2 font-medium",children:"Visits"}),c.jsx("th",{className:"text-left py-2 font-medium",children:"Last Visit"}),c.jsx("th",{className:"text-left py-2 font-medium",children:"Top Page"})]})}),c.jsx("tbody",{children:x.map(w=>c.jsxs("tr",{className:"border-b border-border/50",children:[c.jsx("td",{className:"py-2 font-medium",children:w.name}),c.jsx("td",{className:"py-2 text-muted-foreground",children:w.company}),c.jsx("td",{className:"py-2 text-right",children:w.count}),c.jsx("td",{className:"py-2 text-muted-foreground",children:by(new Date(w.lastVisit),{addSuffix:!0})}),c.jsx("td",{className:"py-2 text-xs text-muted-foreground truncate max-w-[150px]",children:w.topPage})]},w.name))})]})})})]}),c.jsxs(vr,{children:[c.jsx(La,{children:c.jsx(Ra,{className:"text-base",children:"Pages Never Crawled"})}),c.jsx(xr,{children:a?c.jsx(Tt,{className:"h-20 w-full"}):i.length===0?c.jsxs("div",{className:"flex items-center gap-2 text-green-600",children:[c.jsx(MU,{className:"w-4 h-4"}),c.jsx("span",{className:"text-sm",children:"All AEO pages have been crawled by at least one AI bot."})]}):c.jsx("ul",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:i.map(w=>c.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[c.jsx(Lp,{className:"w-4 h-4 text-yellow-500 shrink-0"}),c.jsx("span",{className:"text-muted-foreground truncate",children:w})]},w))})})]})]}),c.jsxs(vr,{children:[c.jsx(La,{children:c.jsx(Ra,{className:"text-base",children:"Recent Activity"})}),c.jsx(xr,{children:b.length===0?c.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."}):c.jsx("div",{className:"max-h-[400px] overflow-y-auto space-y-2",children:b.map(w=>c.jsxs("div",{className:"flex items-center gap-3 text-sm py-1.5 border-b border-border/30 last:border-0",children:[c.jsx("span",{className:"text-xs text-muted-foreground w-24 shrink-0",children:by(new Date(w.created_at),{addSuffix:!0})}),c.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:CX[w.crawler_name]||"#888"}}),c.jsx("span",{className:"font-medium w-32 shrink-0",children:w.crawler_name}),c.jsx("span",{className:"text-muted-foreground truncate flex-1",children:w.page_path}),c.jsx(cr,{variant:w.status_code===200?"default":"destructive",className:"text-xs shrink-0",children:w.status_code||200})]},w.id))})})]})]})},Ex=["perplexity","openai","gemini"],$S={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"}},SX={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"},Hwt=["buying","selling","neighborhoods","market-insights","guides","luxury","general"],$wt=({siteDomain:e})=>{const[t,n]=k.useState([]),[r,i]=k.useState([]),[s,a]=k.useState(!0),[o,l]=k.useState(!1),[u,d]=k.useState({current:0,total:0}),[h,f]=k.useState(new Set),[A,p]=k.useState(new Set),[m,g]=k.useState("all"),[y,v]=k.useState("all"),[x,b]=k.useState("last-checked"),w="khmmwvmdbhaplcfcndjx",S="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",_=k.useCallback(async()=>{const K=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",K).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]);k.useEffect(()=>{_()},[_]);const E=t.length,j=t.filter(K=>K.was_cited).length,I=E>0?Math.round(j/E*100):0,T=k.useMemo(()=>{const K=new Set(t.filter(Z=>Z.was_cited).map(Z=>Z.ai_platform));return Ex.map(Z=>({platform:Z,citing:K.has(Z)}))},[t]),N=k.useMemo(()=>{const K=t.filter(Z=>{const de=Z.competitor_mentions;return Array.isArray(de)&&de.length>0}).length;return E>0?Math.round(K/E*100):0},[t,E]),F=k.useMemo(()=>Ex.map(K=>{var ue;const Z=t.filter(Se=>Se.ai_platform===K),de=Z.filter(Se=>Se.was_cited).length,se=Z.length>0?Math.round(de/Z.length*100):0,ie=Z[0],he=((ue=Z.find(Se=>Se.was_cited&&Se.citation_url))==null?void 0:ue.citation_url)||null;return{platform:K,total:Z.length,cited:de,rate:se,lastCheck:ie,lastCitedUrl:he,hasData:Z.length>0}}),[t]),L=k.useMemo(()=>r.map(K=>{const Z=t.filter(he=>he.prompt_text===K.prompt_text),de={};Ex.forEach(he=>{de[he]=Z.find(ue=>ue.ai_platform===he)||null});const se=Z.length>0?Z[0].checked_at:null,ie=Ex.filter(he=>{var ue;return(ue=de[he])==null?void 0:ue.was_cited}).length;return{...K,byPlatform:de,lastChecked:se,citedCount:ie}}),[r,t]),D=k.useMemo(()=>{let K=L;return m!=="all"&&(K=K.filter(Z=>Z.category===m)),y==="cited"&&(K=K.filter(Z=>Z.citedCount>0)),y==="not-cited"&&(K=K.filter(Z=>Z.citedCount===0)),x==="citation-rate"?K=[...K].sort((Z,de)=>de.citedCount-Z.citedCount):x==="category"?K=[...K].sort((Z,de)=>Z.category.localeCompare(de.category)):K=[...K].sort((Z,de)=>!Z.lastChecked&&!de.lastChecked?0:Z.lastChecked?de.lastChecked?new Date(de.lastChecked).getTime()-new Date(Z.lastChecked).getTime():-1:1),K},[L,m,y,x]),H=async K=>{l(!0),d({current:0,total:K.length});let Z=0;for(const se of K){d({current:Z+1,total:K.length});try{await fetch(`https://${w}.supabase.co/functions/v1/check-citations`,{method:"POST",headers:{"Content-Type":"application/json",apikey:S},body:JSON.stringify({prompt_text:se.prompt_text,site_domain:se.site_domain,prompt_category:se.category,prompt_id:se.id})})}catch(ie){console.error("Check failed for prompt:",se.prompt_text,ie)}Z++,Z<K.length&&await new Promise(ie=>setTimeout(ie,2e3))}l(!1),await _();const de=F.filter(se=>se.hasData||!0).length;Xe({title:`Checked ${Z} prompts across ${de} platforms`})},W=()=>H(r),$=()=>{const K=r.filter(Z=>h.has(Z.id));K.length>0&&H(K)},V=K=>{p(Z=>{const de=new Set(Z);return de.has(K)?de.delete(K):de.add(K),de})},Q=K=>{f(Z=>{const de=new Set(Z);return de.has(K)?de.delete(K):de.add(K),de})},ce=()=>{h.size===D.length?f(new Set):f(new Set(D.map(K=>K.id)))},R=t.length>0?t[0].checked_at:null,M=R?AWe(new Date(R),7):null,Y=I>30?"text-green-600":I>=10?"text-yellow-600":"text-red-500",X=K=>K?K.was_cited&&K.citation_position!=null?c.jsxs("span",{className:"text-green-600 font-medium text-xs",children:["✅ Cited (#",K.citation_position,")"]}):K.was_cited||K.brand_mentioned?c.jsx("span",{className:"text-green-500 text-xs",children:"✅ Mentioned"}):c.jsx("span",{className:"text-muted-foreground text-xs",children:"❌ Not found"}):c.jsx("span",{className:"text-muted-foreground",children:"—"});return s?c.jsxs("div",{className:"space-y-4",children:[c.jsx(Tt,{className:"h-32 w-full"}),c.jsx(Tt,{className:"h-64 w-full"})]}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[c.jsx(vr,{children:c.jsxs(xr,{className:"pt-6",children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"Citation Rate (30d)"}),c.jsxs("p",{className:`text-3xl font-bold ${Y}`,children:[I,"%"]}),c.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[j," of ",E," checks cited"]})]})}),c.jsx(vr,{children:c.jsxs(xr,{className:"pt-6",children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"Platforms Citing You"}),c.jsx("div",{className:"flex gap-2 mt-2",children:T.map(({platform:K,citing:Z})=>c.jsx("span",{className:`inline-flex px-2 py-1 rounded-full text-xs font-medium ${Z?$S[K].bgClass:"bg-muted text-muted-foreground"}`,children:$S[K].label},K))})]})}),c.jsx(vr,{children:c.jsxs(xr,{className:"pt-6",children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Checks Run"}),c.jsx("p",{className:"text-3xl font-bold",children:E})]})}),c.jsx(vr,{children:c.jsxs(xr,{className:"pt-6",children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"Competitors Cited Instead"}),c.jsxs("p",{className:`text-3xl font-bold ${N>20?"text-red-500":"text-muted-foreground"}`,children:[N,"%"]})]})})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:F.map(K=>{var Z;return c.jsxs(vr,{children:[c.jsx(La,{className:"pb-3",children:c.jsxs(Ra,{className:"text-sm flex items-center justify-between",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx("span",{className:`w-2 h-2 rounded-full ${K.hasData?"bg-green-500":"bg-muted-foreground"}`}),$S[K.platform].label]}),!K.hasData&&c.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"No data yet"})]})}),c.jsxs(xr,{className:"space-y-3",children:[c.jsx("p",{className:`text-2xl font-bold ${K.rate>30?"text-green-600":K.rate>=10?"text-yellow-600":"text-muted-foreground"}`,children:K.hasData?`${K.rate}%`:"—"}),K.hasData&&c.jsx("div",{className:"w-full bg-muted rounded-full h-2",children:c.jsx("div",{className:"bg-green-500 h-2 rounded-full transition-all",style:{width:`${K.rate}%`}})}),c.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[c.jsxs("p",{children:["Last checked: ",(Z=K.lastCheck)!=null&&Z.checked_at?by(new Date(K.lastCheck.checked_at),{addSuffix:!0}):"Never"]}),K.lastCitedUrl&&c.jsxs("p",{className:"truncate",children:["Last citation: ",c.jsx("a",{href:`https://${K.lastCitedUrl}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:K.lastCitedUrl})]})]})]})]},K.platform)})}),c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[c.jsxs(Ua,{value:m,onValueChange:g,children:[c.jsx(ha,{className:"w-[160px]",children:c.jsx(Da,{placeholder:"Category"})}),c.jsxs(Aa,{children:[c.jsx(kn,{value:"all",children:"All Categories"}),Hwt.map(K=>c.jsx(kn,{value:K,children:K},K))]})]}),c.jsxs(Ua,{value:y,onValueChange:v,children:[c.jsx(ha,{className:"w-[150px]",children:c.jsx(Da,{})}),c.jsxs(Aa,{children:[c.jsx(kn,{value:"all",children:"Show All"}),c.jsx(kn,{value:"cited",children:"Cited Only"}),c.jsx(kn,{value:"not-cited",children:"Not Cited Only"})]})]}),c.jsxs(Ua,{value:x,onValueChange:b,children:[c.jsx(ha,{className:"w-[150px]",children:c.jsx(Da,{})}),c.jsxs(Aa,{children:[c.jsx(kn,{value:"last-checked",children:"Last Checked"}),c.jsx(kn,{value:"citation-rate",children:"Citation Rate"}),c.jsx(kn,{value:"category",children:"Category"})]})]})]}),c.jsx(vr,{children:c.jsx(xr,{className:"pt-6",children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-border text-muted-foreground",children:[c.jsx("th",{className:"text-left py-2 w-8",children:c.jsx(TA,{checked:h.size===D.length&&D.length>0,onCheckedChange:ce})}),c.jsx("th",{className:"text-left py-2 w-6"}),c.jsx("th",{className:"text-left py-2 font-medium",children:"Prompt"}),c.jsx("th",{className:"text-left py-2 font-medium w-28",children:"Category"}),c.jsx("th",{className:"text-center py-2 font-medium w-28",children:"Perplexity"}),c.jsx("th",{className:"text-center py-2 font-medium w-28",children:"ChatGPT"}),c.jsx("th",{className:"text-center py-2 font-medium w-28",children:"Gemini"}),c.jsx("th",{className:"text-left py-2 font-medium w-28",children:"Last Checked"})]})}),c.jsxs("tbody",{children:[D.map(K=>c.jsxs(c.Fragment,{children:[c.jsxs("tr",{className:"border-b border-border/50 hover:bg-muted/30 cursor-pointer",onClick:()=>V(K.id),children:[c.jsx("td",{className:"py-2.5",onClick:Z=>Z.stopPropagation(),children:c.jsx(TA,{checked:h.has(K.id),onCheckedChange:()=>Q(K.id)})}),c.jsx("td",{className:"py-2.5",children:A.has(K.id)?c.jsx(ac,{className:"w-4 h-4 text-muted-foreground"}):c.jsx(oc,{className:"w-4 h-4 text-muted-foreground"})}),c.jsx("td",{className:"py-2.5",children:c.jsxs(nD,{children:[c.jsx(rD,{asChild:!0,children:c.jsx("span",{className:"block max-w-[300px] truncate",children:K.prompt_text})}),c.jsx(sj,{side:"top",className:"max-w-sm",children:c.jsx("p",{children:K.prompt_text})})]})}),c.jsx("td",{className:"py-2.5",children:c.jsx("span",{className:`inline-block px-2 py-0.5 rounded-full text-xs font-medium ${SX[K.category]||SX.general}`,children:K.category})}),c.jsx("td",{className:"py-2.5 text-center",children:X(K.byPlatform.perplexity)}),c.jsx("td",{className:"py-2.5 text-center",children:X(K.byPlatform.openai)}),c.jsx("td",{className:"py-2.5 text-center",children:X(K.byPlatform.gemini)}),c.jsx("td",{className:"py-2.5 text-xs text-muted-foreground",children:K.lastChecked?by(new Date(K.lastChecked),{addSuffix:!0}):"Never"})]},K.id),A.has(K.id)&&c.jsx("tr",{className:"bg-muted/20",children:c.jsx("td",{colSpan:8,className:"p-4",children:c.jsxs("div",{className:"space-y-3",children:[Ex.map(Z=>{const de=K.byPlatform[Z];return de?c.jsxs("div",{className:"text-xs space-y-1",children:[c.jsx("p",{className:"font-medium",children:$S[Z].label}),de.response_snippet&&c.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&&c.jsxs("p",{children:["Citation: ",c.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," ",c.jsx(Ka,{className:"w-3 h-3"})]})]}),Array.isArray(de.competitor_mentions)&&de.competitor_mentions.length>0&&c.jsxs("p",{className:"text-red-500",children:["Competitors mentioned: ",de.competitor_mentions.join(", ")]})]},Z):null}),c.jsxs(Be,{size:"sm",variant:"outline",disabled:o,onClick:Z=>{Z.stopPropagation(),H([K])},children:[c.jsx(g3,{className:"w-3 h-3 mr-1"})," Run This Prompt"]})]})})},`${K.id}-detail`)]})),D.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:8,className:"py-8 text-center text-muted-foreground",children:"No prompts match the current filters."})})]})]})})})}),c.jsx(vr,{children:c.jsxs(xr,{className:"pt-6 space-y-4",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[c.jsxs(Be,{onClick:W,disabled:o||r.length===0,children:[o?c.jsx(ga,{className:"w-4 h-4 mr-2 animate-spin"}):c.jsx(g3,{className:"w-4 h-4 mr-2"}),o?`Checking prompt ${u.current} of ${u.total}...`:"Run All Checks Now"]}),c.jsxs(Be,{variant:"outline",onClick:$,disabled:o||h.size===0,children:["Run Selected (",h.size,")"]})]}),o&&c.jsx(A0,{value:u.current/u.total*100,className:"h-2"}),c.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[c.jsxs("p",{children:["Last full run: ",R?by(new Date(R),{addSuffix:!0}):"Never"]}),M&&c.jsxs("p",{children:["Next suggested run: ",M.toLocaleDateString()]}),c.jsx("p",{className:"text-muted-foreground/60",children:"Estimated cost: ~$0.01–0.03 per prompt across all platforms"})]})]})})]})},zwt=[{id:"buying",label:"Buying"},{id:"selling",label:"Selling"},{id:"neighborhoods",label:"Neighborhoods & Area Guides"},{id:"market-insights",label:"Market Reports & Trends"}],Vwt=[{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"}]}],kX=3,Kwt=({selectedCategories:e,onCategoriesChange:t,onContinue:n})=>{const r=s=>{e.includes(s)?t(e.filter(a=>a!==s)):t([...e,s])},i=e.length>=kX;return c.jsxs("div",{className:"space-y-6 max-w-3xl mx-auto py-4",children:[c.jsxs("div",{className:"text-center space-y-2",children:[c.jsx("h2",{className:"text-lg font-semibold",children:"What do you specialize in?"}),c.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."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Always Included"}),c.jsx("div",{className:"grid grid-cols-2 gap-2",children:zwt.map(s=>c.jsxs("div",{className:"flex items-center gap-2.5 rounded-md border bg-muted/40 px-3 py-2.5 opacity-80",children:[c.jsx(TA,{checked:!0,disabled:!0,className:"opacity-60"}),c.jsx(S1e,{className:"w-3.5 h-3.5 text-muted-foreground"}),c.jsx("span",{className:"text-sm font-medium",children:s.label})]},s.id))})]}),Vwt.map(s=>c.jsxs("div",{className:"space-y-2",children:[c.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:s.name}),c.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 c.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:[c.jsx(TA,{checked:o,className:"mt-0.5 pointer-events-none"}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("span",{className:"text-sm font-medium block",children:a.label}),c.jsx("span",{className:"text-xs text-muted-foreground block",children:a.description})]})]},a.id)})})]},s.name)),c.jsxs("div",{className:"flex items-center justify-between pt-2 border-t",children:[c.jsxs("p",{className:"text-sm text-muted-foreground",children:[c.jsxs(cr,{variant:i?"default":"secondary",className:"mr-2",children:[e.length," of ",kX," minimum"]}),"selected"]}),c.jsxs(Be,{onClick:n,disabled:!i,children:["Continue ",c.jsx(oc,{className:"w-4 h-4 ml-1"})]})]})]})},BX={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"},qwt={perplexity:"bg-blue-500",openai:"bg-green-500",gemini:"bg-purple-500"},Wwt=({open:e,onOpenChange:t,siteDomain:n,onImported:r})=>{const[i,s]=k.useState("categories"),[a,o]=k.useState(""),[l,u]=k.useState(""),[d,h]=k.useState([]),[f,A]=k.useState(null),[p,m]=k.useState(new Set),[g,y]=k.useState({}),[v,x]=k.useState(!0),[b,w]=k.useState("all"),[S,_]=k.useState("score"),[E,j]=k.useState(!1),[I,T]=k.useState(!1),[N,F]=k.useState(1),[L,D]=k.useState(""),[H,W]=k.useState(0),[$,V]=k.useState(0),[Q,ce]=k.useState([]),[R,M]=k.useState(0),Y="khmmwvmdbhaplcfcndjx",X="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q";k.useEffect(()=>{!e||!n||(async()=>{const{data:xe}=await Me.from("monitored_sites").select("selected_categories").eq("domain",n).limit(1).single();xe!=null&&xe.selected_categories&&Array.isArray(xe.selected_categories)&&xe.selected_categories.length>0&&h(xe.selected_categories)})()},[e,n]);const K=async()=>{await Me.from("monitored_sites").update({selected_categories:d}).eq("domain",n),s("input")},Z=async()=>{if(!(!a.trim()||!l.trim())){s("loading"),F(1),D(`Starting discovery for ${a.trim()}, ${l.trim()}...`),W(0),V(0),ce([]),M(0);try{const xe=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:l.trim(),categories:d})});if(!xe.ok||!xe.body){const ye=await xe.text();throw new Error(ye||"Failed to start discovery")}const Qe=xe.body.getReader(),ze=new TextDecoder;let Dt="",dt=null;for(;;){const{done:ye,value:Ee}=await Qe.read();if(ye)break;Dt+=ze.decode(Ee,{stream:!0});let We;for(;(We=Dt.indexOf(`

`))!==-1;){const Ue=Dt.slice(0,We).trim();if(Dt=Dt.slice(We+2),!Ue.startsWith("data: "))continue;const Ge=Ue.slice(6).trim();if(Ge!=="[DONE]")try{const pe=JSON.parse(Ge);switch(pe.type){case"status":D(pe.message),pe.phase&&F(pe.phase),de(pe.message);break;case"progress":D(pe.message),W(pe.completed),V(pe.total),pe.phase&&F(pe.phase),de(pe.message);break;case"phase_complete":D(pe.message),pe.uniqueQuestions&&M(pe.uniqueQuestions),de(pe.message);break;case"error":throw new Error(pe.message);case"result":dt=pe;break}}catch(pe){if(pe.message&&!pe.message.includes("JSON"))throw pe}}}if(dt){A(dt);const ye=new Set;dt.questions.forEach(Ee=>{Ee.citability_score>=3&&ye.add(Ee.normalized)}),m(ye),s("results")}else throw new Error("No results received from discovery")}catch(xe){Xe({title:"Discovery failed",description:xe.message,variant:"destructive"}),s("input")}}},de=xe=>{ce(Qe=>[...Qe,`[${new Date().toLocaleTimeString()}] ${xe}`].slice(-30))},se=k.useMemo(()=>{if(!f)return[];let xe=[...f.questions];return v&&(xe=xe.filter(Qe=>Qe.citability_score>=4)),b!=="all"&&(xe=xe.filter(Qe=>Qe.category===b)),S==="score"?xe.sort((Qe,ze)=>ze.citability_score-Qe.citability_score):S==="category"?xe.sort((Qe,ze)=>Qe.category.localeCompare(ze.category)):S==="platforms"&&xe.sort((Qe,ze)=>ze.source_count-Qe.source_count),xe},[f,v,b,S]),ie=p.size,he=(f==null?void 0:f.questions.filter(xe=>p.has(xe.normalized)&&xe.citability_score>=4).length)||0,ue=(f==null?void 0:f.questions.filter(xe=>p.has(xe.normalized)&&xe.citability_score>=3&&xe.citability_score<4).length)||0,Se=xe=>{m(Qe=>{const ze=new Set(Qe);return ze.has(xe)?ze.delete(xe):ze.add(xe),ze})},Fe=()=>{const xe=new Set(p);se.forEach(Qe=>xe.add(Qe.normalized)),m(xe)},te=()=>m(new Set),_e=async()=>{if(!(!f||ie===0)){j(!0);try{const{data:xe}=await Me.from("monitor_prompts").select("prompt_text").eq("site_domain",n),Qe=new Set((xe||[]).map(dt=>dt.prompt_text.toLowerCase().replace(/[?!.,]+$/,"").trim())),ze=f.questions.filter(dt=>p.has(dt.normalized)).filter(dt=>!Qe.has(dt.normalized)).map(dt=>({site_domain:n,prompt_text:g[dt.normalized]||dt.question,category:dt.category,citability_score:dt.citability_score})),Dt=ie-ze.length;if(ze.length>0){const{error:dt}=await Me.from("monitor_prompts").insert(ze);if(dt)throw dt}Xe({title:`Added ${ze.length} new prompts to your prompt bank`,description:Dt>0?`${Dt} duplicates skipped`:void 0}),r(),t(!1),Ze()}catch(xe){Xe({title:"Import failed",description:xe.message,variant:"destructive"})}finally{j(!1)}}},Ze=()=>{s("categories"),A(null),m(new Set),y({}),ce([]),F(1),D(""),W(0),V(0),M(0)},et=xe=>{xe||Ze(),t(xe)},Te=xe=>{const Qe=xe/5*100,ze=xe>=4?"bg-green-500":xe>=3?"bg-yellow-500":xe>=2?"bg-orange-500":"bg-red-500",Dt=xe>=4?"High":xe>=3?"Medium":xe>=2?"Low":"Unlikely";return c.jsxs("div",{className:"flex items-center gap-2 min-w-[140px]",children:[c.jsx("div",{className:"flex-1 h-2 rounded-full bg-muted overflow-hidden",children:c.jsx("div",{className:`h-full rounded-full ${ze}`,style:{width:`${Qe}%`}})}),c.jsx("span",{className:"text-xs font-medium w-8 text-right",children:xe.toFixed(1)}),c.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${xe>=4?"bg-green-100 text-green-800":xe>=3?"bg-yellow-100 text-yellow-800":xe>=2?"bg-orange-100 text-orange-800":"bg-red-100 text-red-800"}`,children:Dt})]})},st=$>0?Math.round(H/$*100):0;return c.jsx(qc,{open:e,onOpenChange:et,children:c.jsxs(Zl,{className:"max-w-6xl max-h-[90vh] flex flex-col p-0",children:[c.jsx(ec,{className:"px-6 pt-6 pb-4 border-b",children:c.jsxs(tc,{className:"flex items-center gap-2",children:[c.jsx(zs,{className:"w-5 h-5 text-primary"})," Prompt Discovery Engine"]})}),c.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:[i==="categories"&&c.jsx(Kwt,{selectedCategories:d,onCategoriesChange:h,onContinue:K}),i==="input"&&c.jsxs("div",{className:"max-w-md mx-auto py-12 space-y-6",children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"text-sm font-medium",children:"Metro Area"}),c.jsx(St,{placeholder:"e.g., Grand Rapids, Phoenix, Dallas-Fort Worth",value:a,onChange:xe=>o(xe.target.value),className:"mt-1"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"text-sm font-medium",children:"State"}),c.jsx(St,{placeholder:"e.g., MI, AZ, TX",value:l,onChange:xe=>u(xe.target.value),className:"mt-1"})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Be,{variant:"outline",onClick:()=>s("categories"),children:"Back"}),c.jsxs(Be,{onClick:Z,disabled:!a.trim()||!l.trim(),className:"flex-1",children:[c.jsx(zs,{className:"w-4 h-4 mr-2"})," Discover Questions"]})]})]}),c.jsxs("div",{className:"text-center space-y-2",children:[c.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&&c.jsx("div",{className:"flex flex-wrap justify-center gap-1",children:d.map(xe=>c.jsx(cr,{variant:"secondary",className:"text-[10px]",children:xe},xe))})]})]}),i==="loading"&&c.jsxs("div",{className:"flex flex-col items-center justify-center py-10 space-y-6 max-w-2xl mx-auto",children:[c.jsx(ga,{className:"w-10 h-10 animate-spin text-primary"}),c.jsxs("div",{className:"text-center space-y-2 w-full",children:[c.jsx("p",{className:"font-medium",children:L}),c.jsx("div",{className:"flex items-center justify-center gap-2",children:["perplexity","openai","gemini"].map(xe=>c.jsx(cr,{variant:"secondary",className:"text-xs capitalize",children:xe==="openai"?"ChatGPT":xe.charAt(0).toUpperCase()+xe.slice(1)},xe))}),$>0&&c.jsxs("div",{className:"w-full space-y-1 pt-2",children:[c.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[c.jsxs("span",{children:["Phase ",N,": ",H,"/",$]}),c.jsxs("span",{children:[st,"%"]})]}),c.jsx("div",{className:"w-full h-3 rounded-full bg-muted overflow-hidden",children:c.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-500",style:{width:`${st}%`}})})]}),R>0&&c.jsxs("p",{className:"text-sm text-muted-foreground pt-1",children:["✅ ",R," unique questions discovered — now scoring citability..."]})]}),c.jsxs("div",{className:"w-full border rounded-lg bg-muted/30 p-3 max-h-48 overflow-y-auto",children:[c.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Live Activity Log"}),c.jsxs("div",{className:"space-y-0.5 font-mono text-[11px] text-muted-foreground",children:[Q.length===0&&c.jsx("p",{children:"Waiting for events..."}),Q.map((xe,Qe)=>c.jsx("p",{className:Qe===Q.length-1?"text-foreground font-medium":"",children:xe},Qe))]})]})]}),i==="results"&&f&&c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"rounded-lg border bg-muted/30 p-4 space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("p",{className:"font-medium",children:["Total questions found: ",f.total_questions]}),c.jsxs("p",{className:"text-sm font-medium text-green-700",children:[f.high_citability_count," questions scored 4+ (high citability) — these are your priority targets"]})]}),c.jsxs("div",{className:"flex h-3 rounded-full overflow-hidden bg-muted",children:[f.high_citability_count>0&&c.jsx("div",{className:"bg-green-500 transition-all",style:{width:`${f.high_citability_count/f.total_questions*100}%`}}),f.medium_citability_count>0&&c.jsx("div",{className:"bg-yellow-500 transition-all",style:{width:`${f.medium_citability_count/f.total_questions*100}%`}}),f.low_citability_count>0&&c.jsx("div",{className:"bg-red-500 transition-all",style:{width:`${f.low_citability_count/f.total_questions*100}%`}})]}),c.jsxs("div",{className:"flex gap-4 text-xs text-muted-foreground",children:[c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-green-500"})," High (",f.high_citability_count,")"]}),c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-yellow-500"})," Medium (",f.medium_citability_count,")"]}),c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-red-500"})," Low (",f.low_citability_count,")"]})]}),c.jsx("p",{className:"text-[10px] text-muted-foreground",children:f.accuracy_note})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(cc,{checked:v,onCheckedChange:x}),c.jsx("span",{className:"text-sm font-medium",children:"High Citability Only"})]}),c.jsxs(Ua,{value:b,onValueChange:w,children:[c.jsx(ha,{className:"w-[160px]",children:c.jsx(Da,{})}),c.jsxs(Aa,{children:[c.jsx(kn,{value:"all",children:"All Categories"}),["buying","selling","neighborhoods","market-insights","luxury","guides","general"].map(xe=>c.jsx(kn,{value:xe,children:xe},xe))]})]}),c.jsxs(Ua,{value:S,onValueChange:_,children:[c.jsx(ha,{className:"w-[160px]",children:c.jsx(Da,{})}),c.jsxs(Aa,{children:[c.jsx(kn,{value:"score",children:"Citability Score"}),c.jsx(kn,{value:"category",children:"Category"}),c.jsx(kn,{value:"platforms",children:"Number of Platforms"})]})]}),c.jsxs("div",{className:"flex gap-2 ml-auto",children:[c.jsx(Be,{size:"sm",variant:"outline",onClick:Fe,children:"Select All Visible"}),c.jsx(Be,{size:"sm",variant:"outline",onClick:te,children:"Deselect All"})]})]}),c.jsx("div",{className:"border rounded-lg overflow-hidden",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b bg-muted/50 text-muted-foreground",children:[c.jsx("th",{className:"w-10 p-2"}),c.jsx("th",{className:"text-left p-2 font-medium",children:"Question"}),c.jsx("th",{className:"text-left p-2 font-medium w-32",children:"Category"}),c.jsx("th",{className:"text-left p-2 font-medium w-44",children:"Citability"}),c.jsx("th",{className:"text-center p-2 font-medium w-24",children:"Platforms"})]})}),c.jsxs("tbody",{children:[se.map(xe=>c.jsxs("tr",{className:"border-b border-border/50 hover:bg-muted/30",children:[c.jsx("td",{className:"p-2 text-center",children:c.jsx(TA,{checked:p.has(xe.normalized),onCheckedChange:()=>Se(xe.normalized)})}),c.jsx("td",{className:"p-2",children:c.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[xe.normalized]??xe.question,onChange:Qe=>y(ze=>({...ze,[xe.normalized]:Qe.target.value}))})}),c.jsx("td",{className:"p-2",children:c.jsx("span",{className:`inline-block px-2 py-0.5 rounded-full text-xs font-medium ${BX[xe.category]||BX.general}`,children:xe.category})}),c.jsx("td",{className:"p-2",children:Te(xe.citability_score)}),c.jsx("td",{className:"p-2",children:c.jsx("div",{className:"flex items-center justify-center gap-1.5",children:xe.sources.map(Qe=>c.jsx("span",{className:`w-2.5 h-2.5 rounded-full ${qwt[Qe]||"bg-gray-400"}`,title:Qe},Qe))})})]},xe.normalized)),se.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:5,className:"py-8 text-center text-muted-foreground",children:"No questions match the current filters."})})]})]})})]})]}),i==="results"&&c.jsxs("div",{className:"border-t bg-background px-6 py-4 flex items-center justify-between",children:[c.jsxs("p",{className:"text-sm text-muted-foreground",children:[ie," questions selected (",he," high, ",ue," medium)"]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs(Be,{variant:"outline",onClick:()=>T(!0),disabled:ie===0||E,children:[c.jsx(Xy,{className:"w-4 h-4 mr-2"})," Generate Blueprint from Selected"]}),c.jsxs(Be,{onClick:_e,disabled:ie===0||E,children:[E?c.jsx(ga,{className:"w-4 h-4 mr-2 animate-spin"}):c.jsx(Jc,{className:"w-4 h-4 mr-2"}),"Add Selected to Prompt Bank"]})]})]}),f&&c.jsx(WAe,{open:I,onOpenChange:T,siteDomain:n,questions:f.questions.filter(xe=>p.has(xe.normalized)),metro:f.metro||a,state:f.state||l,onImported:r})]})})},S4=["buying","selling","neighborhoods","market-insights","guides","luxury","general"],_X={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"},Gwt=({score:e})=>{if(e==null)return c.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 c.jsxs("div",{className:"flex items-center gap-1.5 min-w-[110px]",children:[c.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-muted overflow-hidden",children:c.jsx("div",{className:`h-full rounded-full ${n}`,style:{width:`${t}%`}})}),c.jsx("span",{className:"text-[10px] font-medium w-6 text-right",children:e.toFixed(1)}),c.jsx("span",{className:`text-[9px] font-medium px-1 py-0.5 rounded ${i}`,children:r})]})},Ywt=()=>{const[e,t]=k.useState([]),[n,r]=k.useState(null),[i,s]=k.useState(!0),[a,o]=k.useState(""),[l,u]=k.useState("all"),[d,h]=k.useState(!1),[f,A]=k.useState(!1),[p,m]=k.useState(!1),[g,y]=k.useState(""),[v,x]=k.useState("general"),[b,w]=k.useState(""),[S,_]=k.useState("general"),[E,j]=k.useState(null),[I,T]=k.useState(""),[N,F]=k.useState(!1),[L,D]=k.useState(""),[H,W]=k.useState(""),[$,V]=k.useState(!1),[Q,ce]=k.useState(!1),[R,M]=k.useState(""),[Y,X]=k.useState(""),[K,Z]=k.useState("default"),[de,se]=k.useState(!1),[ie,he]=k.useState(!1),[ue,Se]=k.useState(!1),[Fe,te]=k.useState(""),[_e,Ze]=k.useState(""),et="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",Te=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)};k.useEffect(()=>{Te()},[]);const st=k.useMemo(()=>{let pe=e.filter(mt=>!(l!=="all"&&mt.category!==l||a&&!mt.prompt_text.toLowerCase().includes(a.toLowerCase())||de&&(mt.citability_score==null||mt.citability_score<4)));return K==="citability"&&(pe=[...pe].sort((mt,ct)=>(ct.citability_score??0)-(mt.citability_score??0))),pe},[e,l,a,K,de]),xe=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){Xe({title:"Failed to add prompt",variant:"destructive"});return}Xe({title:"Prompt added"}),y(""),h(!1),Te()},Qe=async()=>{if(!b.trim()||!n)return;const pe=b.split(`
`).map(xt=>xt.trim()).filter(Boolean);if(pe.length===0)return;const mt=pe.map(xt=>({site_domain:n.domain,prompt_text:xt,category:S})),{error:ct}=await Me.from("monitor_prompts").insert(mt);if(ct){Xe({title:"Bulk add failed",variant:"destructive"});return}Xe({title:`${pe.length} prompts added`}),w(""),A(!1),Te()},ze=async(pe,mt)=>{await Me.from("monitor_prompts").update({is_active:mt}).eq("id",pe),t(ct=>ct.map(xt=>xt.id===pe?{...xt,is_active:mt}:xt))},Dt=async pe=>{confirm("Delete this prompt?")&&(await Me.from("monitor_prompts").delete().eq("id",pe),t(mt=>mt.filter(ct=>ct.id!==pe)),Xe({title:"Prompt deleted"}))},dt=async pe=>{await Me.from("monitor_prompts").update({prompt_text:I}).eq("id",pe),t(mt=>mt.map(ct=>ct.id===pe?{...ct,prompt_text:I}:ct)),j(null),Xe({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}),D("")},Ee=async pe=>{if(!n)return;const mt=n.brand_keywords.filter(ct=>ct!==pe);await Me.from("monitored_sites").update({brand_keywords:mt}).eq("id",n.id),r({...n,brand_keywords:mt})},We=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(ct=>ct!==pe);await Me.from("monitored_sites").update({competitor_domains:mt}).eq("id",n.id),r({...n,competitor_domains:mt})},Ge=async()=>{if(!(!R.trim()||!Y.trim()||!n)){V(!0),ce(!1);try{const pe=e.filter(Lt=>Lt.is_active);if(pe.length===0){Xe({title:"No active prompts to score"}),V(!1);return}const mt=pe.map(Lt=>Lt.prompt_text),ct=Xwt(mt,R.trim(),Y.trim()),Mt=await Jwt(ct,mt.length,"https://khmmwvmdbhaplcfcndjx.supabase.co",et);for(let Lt=0;Lt<pe.length;Lt++){const Pt=Mt[Lt]??3;await Me.from("monitor_prompts").update({citability_score:Pt}).eq("id",pe[Lt].id)}const zt=Mt.filter(Lt=>Lt>=4).length,ht=Mt.filter(Lt=>Lt>=3&&Lt<4).length;Xe({title:`Scored ${pe.length} prompts`,description:`${zt} scored high, ${ht} scored medium.`}),Te()}catch(pe){Xe({title:"Scoring failed",description:pe.message,variant:"destructive"})}finally{V(!1)}}};return i?c.jsx(Tt,{className:"h-64 w-full"}):c.jsxs("div",{className:"space-y-6",children:[c.jsx(Uw,{open:N,onOpenChange:F,children:c.jsxs(vr,{children:[c.jsx(Dw,{className:"w-full",children:c.jsxs(La,{className:"flex flex-row items-center justify-between cursor-pointer",children:[c.jsxs(Ra,{className:"text-base flex items-center gap-2",children:[c.jsx(RU,{className:"w-4 h-4"})," Site Settings"]}),c.jsx(ac,{className:`w-4 h-4 transition-transform ${N?"rotate-180":""}`})]})}),c.jsx(Qw,{children:c.jsxs(xr,{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Site Domain"}),c.jsx("p",{className:"text-sm font-mono mt-1",children:n==null?void 0:n.domain})]}),c.jsxs("div",{children:[c.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Brand Keywords"}),c.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:n==null?void 0:n.brand_keywords.map(pe=>c.jsxs(cr,{variant:"secondary",className:"gap-1",children:[pe,c.jsx("button",{onClick:()=>Ee(pe),className:"ml-1 hover:text-destructive",children:c.jsx(qa,{className:"w-3 h-3"})})]},pe))}),c.jsxs("div",{className:"flex gap-2 mt-2",children:[c.jsx(St,{placeholder:"Add keyword...",value:L,onChange:pe=>D(pe.target.value),onKeyDown:pe=>pe.key==="Enter"&&ye(),className:"max-w-xs"}),c.jsx(Be,{size:"sm",variant:"outline",onClick:ye,children:"Add"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Competitor Domains"}),c.jsxs("div",{className:"flex flex-wrap gap-2 mt-2",children:[n==null?void 0:n.competitor_domains.map(pe=>c.jsxs(cr,{variant:"secondary",className:"gap-1",children:[pe,c.jsx("button",{onClick:()=>Ue(pe),className:"ml-1 hover:text-destructive",children:c.jsx(qa,{className:"w-3 h-3"})})]},pe)),(n==null?void 0:n.competitor_domains.length)===0&&c.jsx("span",{className:"text-sm text-muted-foreground",children:"None added yet"})]}),c.jsxs("div",{className:"flex gap-2 mt-2",children:[c.jsx(St,{placeholder:"Add competitor domain...",value:H,onChange:pe=>W(pe.target.value),onKeyDown:pe=>pe.key==="Enter"&&We(),className:"max-w-xs"}),c.jsx(Be,{size:"sm",variant:"outline",onClick:We,children:"Add"})]})]})]})})]})}),c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[c.jsxs("div",{className:"relative flex-1 min-w-[200px] max-w-sm",children:[c.jsx(YN,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),c.jsx(St,{placeholder:"Search prompts...",value:a,onChange:pe=>o(pe.target.value),className:"pl-9"})]}),c.jsxs(Ua,{value:l,onValueChange:u,children:[c.jsx(ha,{className:"w-[180px]",children:c.jsx(Da,{placeholder:"Category"})}),c.jsxs(Aa,{children:[c.jsx(kn,{value:"all",children:"All Categories"}),S4.map(pe=>c.jsx(kn,{value:pe,children:pe},pe))]})]}),c.jsxs(Ua,{value:K,onValueChange:Z,children:[c.jsx(ha,{className:"w-[160px]",children:c.jsx(Da,{})}),c.jsxs(Aa,{children:[c.jsx(kn,{value:"default",children:"Date Added"}),c.jsx(kn,{value:"citability",children:"Citability Score"})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(cc,{checked:de,onCheckedChange:se}),c.jsx("span",{className:"text-sm font-medium",children:"High Only"})]}),c.jsxs(Be,{size:"sm",onClick:()=>h(!0),children:[c.jsx(Mp,{className:"w-4 h-4 mr-1"})," Add Prompt"]}),c.jsxs(Be,{size:"sm",variant:"outline",onClick:()=>A(!0),children:[c.jsx(b1e,{className:"w-4 h-4 mr-1"})," Bulk Add"]}),c.jsxs(Be,{size:"sm",variant:"default",onClick:()=>m(!0),className:"bg-primary",children:[c.jsx(zs,{className:"w-4 h-4 mr-1"})," Discover Prompts"]}),c.jsxs(Be,{size:"sm",variant:"outline",onClick:()=>ce(!0),disabled:$,children:[$?c.jsx(ga,{className:"w-4 h-4 mr-1 animate-spin"}):c.jsx(Vc,{className:"w-4 h-4 mr-1"}),"Re-score Prompts"]}),c.jsxs(Be,{size:"sm",variant:"outline",onClick:()=>Se(!0),disabled:e.filter(pe=>pe.is_active).length===0,children:[c.jsx(Xy,{className:"w-4 h-4 mr-1"})," Generate Blueprint from Bank"]})]}),c.jsx(vr,{children:c.jsx(xr,{className:"pt-6",children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-border text-muted-foreground",children:[c.jsx("th",{className:"text-left py-2 font-medium",children:"Prompt Text"}),c.jsx("th",{className:"text-left py-2 font-medium w-32",children:"Category"}),c.jsx("th",{className:"text-left py-2 font-medium w-32",children:"Citability"}),c.jsx("th",{className:"text-center py-2 font-medium w-20",children:"Active"}),c.jsx("th",{className:"text-left py-2 font-medium w-28",children:"Last Checked"}),c.jsx("th",{className:"text-right py-2 font-medium w-24",children:"Actions"})]})}),c.jsxs("tbody",{children:[st.map(pe=>c.jsxs("tr",{className:"border-b border-border/50",children:[c.jsx("td",{className:"py-2.5",children:E===pe.id?c.jsxs("div",{className:"flex gap-2",children:[c.jsx(St,{value:I,onChange:mt=>T(mt.target.value),className:"text-sm"}),c.jsx(Be,{size:"sm",onClick:()=>dt(pe.id),children:"Save"}),c.jsx(Be,{size:"sm",variant:"ghost",onClick:()=>j(null),children:"Cancel"})]}):c.jsx("span",{children:pe.prompt_text})}),c.jsx("td",{className:"py-2.5",children:c.jsx("span",{className:`inline-block px-2 py-0.5 rounded-full text-xs font-medium ${_X[pe.category]||_X.general}`,children:pe.category})}),c.jsx("td",{className:"py-2.5",children:c.jsx(Gwt,{score:pe.citability_score})}),c.jsx("td",{className:"py-2.5 text-center",children:c.jsx(cc,{checked:pe.is_active??!0,onCheckedChange:mt=>ze(pe.id,mt)})}),c.jsx("td",{className:"py-2.5 text-muted-foreground text-xs",children:pe.last_checked_at?by(new Date(pe.last_checked_at),{addSuffix:!0}):"Never"}),c.jsx("td",{className:"py-2.5 text-right",children:c.jsxs("div",{className:"flex justify-end gap-1",children:[c.jsx(Be,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:()=>{j(pe.id),T(pe.prompt_text)},children:c.jsx(ure,{className:"w-3.5 h-3.5"})}),c.jsx(Be,{size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive",onClick:()=>Dt(pe.id),children:c.jsx(yl,{className:"w-3.5 h-3.5"})})]})})]},pe.id)),st.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:6,className:"py-8 text-center text-muted-foreground",children:"No prompts found."})})]})]})})})}),c.jsx(qc,{open:d,onOpenChange:h,children:c.jsxs(Zl,{children:[c.jsx(ec,{children:c.jsx(tc,{children:"Add Prompt"})}),c.jsxs("div",{className:"space-y-4",children:[c.jsx(Jl,{placeholder:"Enter your prompt question...",value:g,onChange:pe=>y(pe.target.value),rows:3}),c.jsxs(Ua,{value:v,onValueChange:x,children:[c.jsx(ha,{children:c.jsx(Da,{})}),c.jsx(Aa,{children:S4.map(pe=>c.jsx(kn,{value:pe,children:pe},pe))})]}),c.jsx(Be,{onClick:xe,disabled:!g.trim(),className:"w-full",children:"Save Prompt"})]})]})}),c.jsx(qc,{open:f,onOpenChange:A,children:c.jsxs(Zl,{children:[c.jsx(ec,{children:c.jsx(tc,{children:"Bulk Add Prompts"})}),c.jsxs("div",{className:"space-y-4",children:[c.jsx(Jl,{placeholder:"Paste one prompt per line...",value:b,onChange:pe=>w(pe.target.value),rows:8}),c.jsxs(Ua,{value:S,onValueChange:_,children:[c.jsx(ha,{children:c.jsx(Da,{})}),c.jsx(Aa,{children:S4.map(pe=>c.jsx(kn,{value:pe,children:pe},pe))})]}),c.jsxs(Be,{onClick:Qe,disabled:!b.trim(),className:"w-full",children:["Add ",b.split(`
`).filter(pe=>pe.trim()).length," Prompts"]})]})]})}),c.jsx(qc,{open:Q,onOpenChange:ce,children:c.jsxs(Zl,{children:[c.jsx(ec,{children:c.jsx(tc,{children:"Re-score Prompts for Citability"})}),c.jsxs("div",{className:"space-y-4",children:[c.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."]}),c.jsxs("div",{children:[c.jsx("label",{className:"text-sm font-medium",children:"Metro Area"}),c.jsx(St,{placeholder:"e.g., Grand Rapids",value:R,onChange:pe=>M(pe.target.value),className:"mt-1"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"text-sm font-medium",children:"State"}),c.jsx(St,{placeholder:"e.g., MI",value:Y,onChange:pe=>X(pe.target.value),className:"mt-1"})]}),c.jsxs(Be,{onClick:Ge,disabled:!R.trim()||!Y.trim(),className:"w-full",children:["Score ",e.filter(pe=>pe.is_active).length," Prompts"]})]})]})}),n&&c.jsx(Wwt,{open:p,onOpenChange:m,siteDomain:n.domain,onImported:Te}),c.jsx(qc,{open:ue,onOpenChange:Se,children:c.jsxs(Zl,{children:[c.jsx(ec,{children:c.jsx(tc,{children:"Generate Blueprint from Prompt Bank"})}),c.jsxs("div",{className:"space-y-4",children:[c.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."]}),c.jsxs("div",{children:[c.jsx("label",{className:"text-sm font-medium",children:"Metro Area"}),c.jsx(St,{placeholder:"e.g., Grand Rapids",value:Fe,onChange:pe=>te(pe.target.value),className:"mt-1"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"text-sm font-medium",children:"State"}),c.jsx(St,{placeholder:"e.g., MI",value:_e,onChange:pe=>Ze(pe.target.value),className:"mt-1"})]}),c.jsxs(Be,{onClick:()=>{Se(!1),he(!0)},disabled:!Fe.trim()||!_e.trim(),className:"w-full",children:[c.jsx(Xy,{className:"w-4 h-4 mr-2"})," Generate Blueprint"]})]})]})}),n&&c.jsx(WAe,{open:ie,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:Fe,state:_e,onImported:Te})]})};function Xwt(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 Jwt(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(),l=(a.content||a.text||"").trim().split(`
`).map(d=>d.trim()),u=[];for(const d of l){const h=d.match(/(\d)/);if(h){const f=parseInt(h[1]);f>=1&&f<=5&&u.push(f)}if(u.length>=t)break}for(;u.length<t;)u.push(3);return u}const Zwt=()=>{const[e,t]=k.useState([]),[n,r]=k.useState("");return k.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))})()},[]),c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-lg font-semibold",children:"AEO Monitor"}),c.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&&c.jsxs(Ua,{value:n,onValueChange:r,children:[c.jsx(ha,{className:"w-[220px]",children:c.jsx(Da,{placeholder:"Select site"})}),c.jsx(Aa,{children:e.map(i=>c.jsx(kn,{value:i.domain,children:i.display_name},i.domain))})]})]}),n&&c.jsxs(v2,{defaultValue:"crawler-activity",children:[c.jsxs(rv,{className:"bg-muted/50 p-1",children:[c.jsx(si,{value:"crawler-activity",className:"text-xs uppercase tracking-wider",children:"Crawler Activity"}),c.jsx(si,{value:"citation-tracker",className:"text-xs uppercase tracking-wider",children:"Citation Tracker"}),c.jsx(si,{value:"prompt-bank",className:"text-xs uppercase tracking-wider",children:"Prompt Bank"})]}),c.jsx(ai,{value:"crawler-activity",className:"mt-6",children:c.jsx(Qwt,{})}),c.jsx(ai,{value:"citation-tracker",className:"mt-6",children:c.jsx($wt,{siteDomain:n})}),c.jsx(ai,{value:"prompt-bank",className:"mt-6",children:c.jsx(Ywt,{})})]})]})},ebt=()=>{const{isAdmin:e,isLoading:t}=Sj(),{tier:n,isAeo:r,setTier:i,isLoading:s}=Phe(),{configMap:a}=To(),o=Sd(),[l,u]=k.useState(!1),[d,h]=k.useState("index"),[f,A]=k.useState(""),[p,m]=k.useState(!1),[g,y]=k.useState(!1),[v,x]=k.useState(!1),[b,w]=k.useState(null),[S,_]=k.useState(!1),[E,j]=k.useState(!1),I="khmmwvmdbhaplcfcndjx",T="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",N=async()=>{x(!0),_(!0),w(null);try{const[H,W]=await Promise.all([fetch(`https://${I}.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(),V=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>${V}/</loc>`)||W.includes(`<loc>${V}</loc>`):W.includes(`<loc>${V}/${Q.htmlFile}</loc>`);return{...Q,sitemapAeo:R?"✅":"❌"}})),w($),Xe({title:"Site content synchronized successfully"})}catch(H){Xe({title:"Sync failed",description:H.message,variant:"destructive"}),_(!1)}finally{x(!1)}},F=async()=>{j(!0);try{const H=await fetch(`https://${I}.supabase.co/functions/v1/sitemap`,{headers:{apikey:T}});if(!H.ok)throw new Error(await H.text());Xe({title:"Sitemaps regenerated",description:"sitemap.xml has been rebuilt from the database."})}catch(H){Xe({title:"Sitemap rebuild failed",description:H.message,variant:"destructive"})}finally{j(!1)}},L=async H=>{h(H),m(!0),u(!0),A("");try{const $=await(await fetch(`https://${I}.supabase.co/functions/v1/generate-llms-txt?type=${H}&rebuild=true`,{headers:{apikey:T}})).text();A($)}catch(W){Xe({title:"Rebuild failed",description:W.message,variant:"destructive"}),u(!1)}finally{m(!1)}},D=()=>{navigator.clipboard.writeText(f),y(!0),setTimeout(()=>y(!1),2e3)};return k.useEffect(()=>{!t&&!e&&o("/auth")},[e,t,o]),t||s?c.jsx(xn,{children:c.jsxs("div",{className:"container-page section-padding",children:[c.jsx(Tt,{className:"h-10 w-64 mb-8"}),c.jsx(Tt,{className:"h-64 w-full"})]})}):e?c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsx("title",{children:"Site Factory | Holden Richardson"}),c.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),c.jsxs("div",{className:"container-page py-12 md:py-20",children:[c.jsxs("div",{className:"flex items-center justify-between mb-6",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("h1",{className:"heading-section mb-0",children:"Site Factory"}),c.jsx(cr,{variant:r?"default":"outline",className:"text-xs uppercase tracking-wider",children:n==="aeo"?"AEO":"Core"})]}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx("span",{className:`font-medium ${r?"text-muted-foreground":"text-foreground"}`,children:"Core"}),c.jsx(cc,{checked:r,onCheckedChange:H=>i(H?"aeo":"core")}),c.jsx("span",{className:`font-medium ${r?"text-foreground":"text-muted-foreground"}`,children:"AEO"})]}),c.jsxs(Ct,{to:"/",className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[c.jsx(l2,{className:"w-4 h-4"}),"Back to Site"]})]})]}),c.jsxs("div",{className:"mb-8 flex flex-wrap items-center gap-3",children:[c.jsxs(Be,{size:"sm",variant:"default",onClick:N,disabled:v,children:[c.jsx(T1e,{className:"w-3.5 h-3.5 mr-1.5"})," Full Site Sync & Audit"]}),c.jsxs(Be,{size:"sm",variant:"outline",onClick:F,disabled:E,children:[c.jsx(u2,{className:`w-3.5 h-3.5 mr-1.5 ${E?"animate-spin":""}`}),E?"Rebuilding...":"Regenerate Sitemaps"]}),c.jsxs(Be,{size:"sm",variant:"outline",onClick:()=>L("index"),disabled:p,children:[c.jsx(Vc,{className:"w-3.5 h-3.5 mr-1.5"})," Rebuild llms.txt"]}),c.jsxs(Be,{size:"sm",variant:"outline",onClick:()=>L("full"),disabled:p,children:[c.jsx(Vc,{className:"w-3.5 h-3.5 mr-1.5"})," Rebuild llms-full.txt"]})]}),c.jsx("div",{className:"mb-8",children:c.jsx(IGe,{})}),c.jsxs(v2,{defaultValue:"agent-config",className:"space-y-8",children:[c.jsxs(rv,{className:"bg-muted/50 p-1",children:[c.jsx(si,{value:"agent-config",className:"text-xs uppercase tracking-wider",children:"Agent Config"}),c.jsx(si,{value:"blueprint",className:"text-xs uppercase tracking-wider",children:"Blueprint"}),c.jsx(si,{value:"media",className:"text-xs uppercase tracking-wider",children:"Media Library"}),r&&c.jsx(si,{value:"generator",className:"text-xs uppercase tracking-wider",children:"Page Generator"}),r&&c.jsx(si,{value:"cannibalization",className:"text-xs uppercase tracking-wider",children:"Cannibalization"}),c.jsx(si,{value:"monitor",className:"text-xs uppercase tracking-wider",children:"Monitor"}),c.jsx(si,{value:"backups",className:"text-xs uppercase tracking-wider",children:"Backups"}),c.jsx(si,{value:"crawlability",className:"text-xs uppercase tracking-wider",children:"Crawlability"}),c.jsx(si,{value:"readiness",className:"text-xs uppercase tracking-wider",children:"Readiness"})]}),c.jsx(ai,{value:"agent-config",children:c.jsx(OKe,{})}),c.jsx(ai,{value:"blueprint",children:c.jsx(qqe,{})}),c.jsx(ai,{value:"media",children:c.jsx(iWe,{})}),r&&c.jsx(ai,{value:"generator",children:c.jsx(Gqe,{})}),r&&c.jsx(ai,{value:"cannibalization",children:c.jsx(Yqe,{})}),c.jsx(ai,{value:"monitor",children:c.jsx(Zwt,{})}),c.jsx(ai,{value:"backups",children:c.jsx(Xqe,{})}),c.jsx(ai,{value:"crawlability",children:c.jsx(PGe,{})}),c.jsx(ai,{value:"readiness",children:c.jsx(TGe,{})})]}),c.jsx(qc,{open:l,onOpenChange:u,children:c.jsxs(Zl,{className:"max-w-3xl max-h-[80vh] overflow-y-auto",children:[c.jsx(ec,{children:c.jsxs(tc,{children:[d==="full"?"llms-full.txt":"llms.txt"," — Generated Content"]})}),p?c.jsx("div",{className:"py-12 text-center text-muted-foreground",children:"Generating..."}):c.jsxs(c.Fragment,{children:[c.jsxs(Be,{size:"sm",variant:"outline",onClick:D,className:"mb-2 w-fit",children:[g?c.jsx(Jc,{className:"w-3.5 h-3.5 mr-1.5"}):c.jsx(o1e,{className:"w-3.5 h-3.5 mr-1.5"}),g?"Copied!":"Copy to Clipboard"]}),c.jsx("pre",{className:"text-xs bg-muted p-4 rounded overflow-auto max-h-[50vh] whitespace-pre-wrap",children:f})]})]})}),c.jsx(OGe,{open:S,onOpenChange:_,syncReport:b,setSyncReport:w,isSyncing:v})]})]}):null},tbt=()=>{const e=Sd(),{toast:t}=RA(),[n,r]=k.useState(!1),[i,s]=k.useState(""),[a,o]=k.useState(""),[l,u]=k.useState(!1),[d,h]=k.useState(!1),[f,A]=k.useState(!0);k.useEffect(()=>{const{data:{subscription:m}}=Me.auth.onAuthStateChange(g=>{g==="PASSWORD_RECOVERY"&&(r(!0),A(!1))});return Me.auth.getSession().then(({data:{session:g}})=>{g&&r(!0),A(!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 f?c.jsx(xn,{children:c.jsx("div",{className:"min-h-[60vh] flex items-center justify-center",children:c.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Verifying reset link…"})})}):c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsx("title",{children:"Reset Password | Holden Richardson — Grand Rapids Real Estate"}),c.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),c.jsx("div",{className:"section-padding",children:c.jsx("div",{className:"container-page max-w-md",children:c.jsxs(vr,{className:"border-border",children:[c.jsxs(La,{className:"text-center",children:[c.jsx(Ra,{className:"heading-card",children:"Reset Password"}),c.jsx(Ay,{children:n?"Enter your new password below.":"This link is invalid or has expired."})]}),c.jsx(xr,{children:d?c.jsx("div",{className:"text-center space-y-4",children:c.jsx("p",{className:"text-muted-foreground",children:"Password updated successfully! Redirecting to sign in…"})}):n?c.jsxs("form",{onSubmit:p,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{htmlFor:"new-password",children:"New Password"}),c.jsx(St,{id:"new-password",type:"password",placeholder:"••••••••",value:i,onChange:m=>s(m.target.value),required:!0})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Sn,{htmlFor:"confirm-password",children:"Confirm Password"}),c.jsx(St,{id:"confirm-password",type:"password",placeholder:"••••••••",value:a,onChange:m=>o(m.target.value),required:!0})]}),c.jsx(Be,{type:"submit",className:"w-full",disabled:l,children:l?"Updating…":"Set New Password"})]}):c.jsxs("div",{className:"text-center space-y-4",children:[c.jsx("p",{className:"text-muted-foreground",children:"The password reset link is invalid or has expired. Please request a new one."}),c.jsx(Ct,{to:"/auth",children:c.jsx(Be,{variant:"outline",children:"Back to Sign In"})})]})})]})})})]})},nbt=()=>c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsx("title",{children:"Privacy Policy | Holden Richardson"}),c.jsx("meta",{name:"description",content:"Privacy policy for HoldenGR.com — how we collect, use, and protect your personal information."}),c.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/privacy-policy"}),c.jsx("meta",{property:"og:title",content:"Privacy Policy | Holden Richardson"}),c.jsx("meta",{property:"og:description",content:"Privacy policy for HoldenGR.com — how we collect, use, and protect your personal information."}),c.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/privacy-policy"}),c.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image.jpg"}),c.jsx("meta",{property:"og:type",content:"website"}),c.jsx("meta",{name:"twitter:card",content:"summary"}),c.jsx("meta",{name:"twitter:title",content:"Privacy Policy | Holden Richardson"}),c.jsx("meta",{name:"twitter:description",content:"Privacy policy for HoldenGR.com."}),c.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image.jpg"})]}),c.jsx("section",{className:"py-14 md:py-20 bg-secondary -mt-20 pt-32 md:pt-36",children:c.jsx("div",{className:"container-page",children:c.jsxs(ke,{variant:"blur",children:[c.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Legal"}),c.jsx("h1",{className:"font-serif text-3xl md:text-5xl font-light mb-3",children:"Privacy Policy"}),c.jsx("div",{className:"w-16 h-[2px] bg-accent mb-4"}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:["Last updated: ",new Date().toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})]})]})})}),c.jsx("section",{className:"py-14 md:py-20 bg-background",children:c.jsx("div",{className:"container-page max-w-3xl mx-auto prose prose-neutral prose-headings:font-serif prose-headings:font-light",children:c.jsxs(ke,{children:[c.jsx("h2",{children:"Information We Collect"}),c.jsx("p",{children:"When you use our website, we may collect the following personal information:"}),c.jsxs("ul",{children:[c.jsxs("li",{children:[c.jsx("strong",{children:"Contact Information:"})," Name, email address, phone number, and any message you provide through our contact form."]}),c.jsxs("li",{children:[c.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."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Cookies:"})," We use cookies and similar technologies to improve your experience and analyze site traffic."]})]}),c.jsx("h2",{children:"How We Use Your Information"}),c.jsx("p",{children:"We use the information we collect to:"}),c.jsxs("ul",{children:[c.jsx("li",{children:"Respond to your inquiries and provide real estate services"}),c.jsx("li",{children:"Send you relevant property information and market updates (only with your consent)"}),c.jsx("li",{children:"Improve our website and user experience"}),c.jsx("li",{children:"Comply with legal obligations"})]}),c.jsx("h2",{children:"Information Sharing"}),c.jsx("p",{children:"We do not sell, trade, or rent your personal information to third parties. We may share your information with:"}),c.jsxs("ul",{children:[c.jsxs("li",{children:[c.jsx("strong",{children:"616 Realty LLC:"})," Our brokerage, as necessary to facilitate real estate transactions"]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Service Providers:"})," Third-party services that help us operate our website and CRM systems"]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Legal Requirements:"})," When required by law or to protect our rights"]})]}),c.jsx("h2",{children:"Data Security"}),c.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."}),c.jsx("h2",{children:"Your Rights"}),c.jsx("p",{children:"You have the right to:"}),c.jsxs("ul",{children:[c.jsx("li",{children:"Request access to the personal information we hold about you"}),c.jsx("li",{children:"Request correction or deletion of your personal information"}),c.jsx("li",{children:"Opt out of marketing communications at any time"})]}),c.jsx("h2",{children:"Contact Us"}),c.jsx("p",{children:"If you have questions about this privacy policy, please contact us at:"}),c.jsxs("p",{children:["Holden Richardson — 616 Realty LLC",c.jsx("br",{}),"1171 Plainfield Ave NE, Grand Rapids, MI 49503",c.jsx("br",{}),c.jsx("a",{href:"mailto:holden@holdengr.com",children:"holden@holdengr.com"}),c.jsx("br",{}),"(616) 403-6393"]})]})})})]}),rbt=()=>c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsx("title",{children:"Terms of Service | Holden Richardson"}),c.jsx("meta",{name:"description",content:"Terms of service for HoldenGR.com — conditions governing the use of this website."}),c.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/terms-of-service"}),c.jsx("meta",{property:"og:title",content:"Terms of Service | Holden Richardson"}),c.jsx("meta",{property:"og:description",content:"Terms of service for HoldenGR.com — conditions governing the use of this website."}),c.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/terms-of-service"}),c.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image.jpg"}),c.jsx("meta",{property:"og:type",content:"website"}),c.jsx("meta",{name:"twitter:card",content:"summary"}),c.jsx("meta",{name:"twitter:title",content:"Terms of Service | Holden Richardson"}),c.jsx("meta",{name:"twitter:description",content:"Terms of service for HoldenGR.com."}),c.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image.jpg"})]}),c.jsx("section",{className:"py-14 md:py-20 bg-secondary -mt-20 pt-32 md:pt-36",children:c.jsx("div",{className:"container-page",children:c.jsxs(ke,{variant:"blur",children:[c.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Legal"}),c.jsx("h1",{className:"font-serif text-3xl md:text-5xl font-light mb-3",children:"Terms of Service"}),c.jsx("div",{className:"w-16 h-[2px] bg-accent mb-4"}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:["Last updated: ",new Date().toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})]})]})})}),c.jsx("section",{className:"py-14 md:py-20 bg-background",children:c.jsx("div",{className:"container-page max-w-3xl mx-auto prose prose-neutral prose-headings:font-serif prose-headings:font-light",children:c.jsxs(ke,{children:[c.jsx("h2",{children:"Agreement to Terms"}),c.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.'}),c.jsx("h2",{children:"Use of Website"}),c.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."}),c.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."}),c.jsx("h2",{children:"Property Listings & Information"}),c.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:"}),c.jsxs("ul",{children:[c.jsx("li",{children:"Listings may not reflect real-time availability, pricing, or property conditions"}),c.jsx("li",{children:"All information should be independently verified before making any decisions"}),c.jsx("li",{children:"Photos and descriptions may not represent current property conditions"}),c.jsx("li",{children:"We are not responsible for errors or omissions in listing data"})]}),c.jsx("h2",{children:"No Professional Advice"}),c.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."}),c.jsx("h2",{children:"Intellectual Property"}),c.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."}),c.jsx("h2",{children:"Limitation of Liability"}),c.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."}),c.jsx("h2",{children:"Governing Law"}),c.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."}),c.jsx("h2",{children:"Changes to Terms"}),c.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."}),c.jsx("h2",{children:"Contact"}),c.jsxs("p",{children:["Holden Richardson — 616 Realty LLC",c.jsx("br",{}),"1171 Plainfield Ave NE, Grand Rapids, MI 49503",c.jsx("br",{}),c.jsx("a",{href:"mailto:holden@holdengr.com",children:"holden@holdengr.com"}),c.jsx("br",{}),"(616) 403-6393"]})]})})})]}),ibt=()=>c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsx("title",{children:"Accessibility | Holden Richardson"}),c.jsx("meta",{name:"description",content:"Accessibility statement for HoldenGR.com — our commitment to digital accessibility."}),c.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/accessibility"}),c.jsx("meta",{property:"og:title",content:"Accessibility | Holden Richardson"}),c.jsx("meta",{property:"og:description",content:"Accessibility statement for HoldenGR.com — our commitment to digital accessibility."}),c.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/accessibility"}),c.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image.jpg"}),c.jsx("meta",{property:"og:type",content:"website"}),c.jsx("meta",{name:"twitter:card",content:"summary"}),c.jsx("meta",{name:"twitter:title",content:"Accessibility | Holden Richardson"}),c.jsx("meta",{name:"twitter:description",content:"Accessibility statement for HoldenGR.com."}),c.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image.jpg"})]}),c.jsx("section",{className:"py-14 md:py-20 bg-secondary -mt-20 pt-32 md:pt-36",children:c.jsx("div",{className:"container-page",children:c.jsxs(ke,{variant:"blur",children:[c.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Legal"}),c.jsx("h1",{className:"font-serif text-3xl md:text-5xl font-light mb-3",children:"Accessibility"}),c.jsx("div",{className:"w-16 h-[2px] bg-accent mb-4"})]})})}),c.jsx("section",{className:"py-14 md:py-20 bg-background",children:c.jsx("div",{className:"container-page max-w-3xl mx-auto prose prose-neutral prose-headings:font-serif prose-headings:font-light",children:c.jsxs(ke,{children:[c.jsx("h2",{children:"Our Commitment"}),c.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."}),c.jsx("h2",{children:"Standards"}),c.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:"}),c.jsxs("ul",{children:[c.jsx("li",{children:"Visual impairments (blindness, low vision, color blindness)"}),c.jsx("li",{children:"Hearing impairments"}),c.jsx("li",{children:"Motor impairments"}),c.jsx("li",{children:"Cognitive disabilities"})]}),c.jsx("h2",{children:"Measures Taken"}),c.jsx("p",{children:"We have taken the following measures to ensure accessibility:"}),c.jsxs("ul",{children:[c.jsx("li",{children:"Semantic HTML structure throughout the website"}),c.jsx("li",{children:"Descriptive alt text for all meaningful images"}),c.jsx("li",{children:"Sufficient color contrast ratios for text and interactive elements"}),c.jsx("li",{children:"Keyboard navigation support"}),c.jsx("li",{children:"Responsive design that works across devices and screen sizes"}),c.jsx("li",{children:"Clear and consistent navigation"}),c.jsx("li",{children:"Form labels and error messages for all input fields"})]}),c.jsx("h2",{children:"Known Limitations"}),c.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."}),c.jsx("h2",{children:"Feedback"}),c.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:"}),c.jsxs("p",{children:["Holden Richardson — 616 Realty LLC",c.jsx("br",{}),c.jsx("a",{href:"mailto:holden@holdengr.com",children:"holden@holdengr.com"}),c.jsx("br",{}),"(616) 403-6393"]}),c.jsx("p",{children:"We will make reasonable efforts to address any accessibility concerns and respond within 5 business days."}),c.jsx("h2",{children:"Fair Housing"}),c.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."})]})})})]}),sbt=()=>{const e=jo();return k.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsx("title",{children:"Page Not Found | Holden Richardson — Grand Rapids Real Estate"}),c.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),c.jsx("section",{className:"section-padding bg-background min-h-[60vh] flex items-center",children:c.jsxs("div",{className:"container-page text-center",children:[c.jsx("h1",{className:"text-8xl md:text-9xl font-serif text-gold mb-6",children:"404"}),c.jsx("h2",{className:"heading-section mb-4",children:"Page Not Found"}),c.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."}),c.jsx(Ct,{to:"/",className:"btn-outline-primary",children:"Return Home"})]})})]})},abt=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(`
`),sB=()=>{var X,K,Z,de;const{category:e,slug:t,subcategory:n}=om(),r=t||"",{data:i,isLoading:s}=MKe(e||"",r,n),{data:a}=LKe(i==null?void 0:i.id),o=k.useMemo(()=>{if(!i)return"";const ie=(Array.isArray(i.faq_json)?i.faq_json:[]).map(he=>`${(he==null?void 0:he.question)||""} ${(he==null?void 0:he.answer)||""}`).join(" ");return`${i.h1||""} ${i.title||""} ${i.intro_text||""} ${ie}`},[i]),{data:l}=UKe(i==null?void 0:i.category_id,i==null?void 0:i.id,o,5),{configMap:u}=To(),{data:d}=iv(),h=k.useMemo(()=>!d||!(i!=null&&i.cover_image_id)?null:d.find(se=>se.id===i.cover_image_id)||null,[d,i==null?void 0:i.cover_image_id]),f=u.agent_phone,A=u.agent_email,p=u.booking_url,m=u.agent_name,g=((X=u.site_base_url)==null?void 0:X.replace(/\/$/,""))||"",y=e==="about"?"About":e==null?void 0:e.replace(/-/g," "),v=`/${e}`,x=n?`/${e}/${n}`:null,b=n?`/${e}/${n}/${r}`:`/${e}/${r}`,w=g?`${g}${b}`:"",S=se=>g?`${g}${se}`:se;if(s)return c.jsx(xn,{children:c.jsxs("div",{className:"container-page section-padding",children:[c.jsx(Tt,{className:"h-12 w-3/4 mb-6"}),c.jsx(Tt,{className:"h-6 w-full mb-4"}),c.jsx(Tt,{className:"h-64 w-full"})]})});if(!i)return c.jsx(xn,{children:c.jsxs("div",{className:"container-page section-padding text-center",children:[c.jsx("h1",{className:"heading-section mb-4",children:"Page Not Found"}),c.jsx("p",{className:"text-body text-muted-foreground",children:"The page you're looking for doesn't exist."})]})});const _=((K=i.category)==null?void 0:K.slug)==="news",E=i.press_links,j=[u.about_website,u.about_google_business,u.about_facebook,u.about_instagram,u.about_linkedin,u.about_youtube,u.about_x,u.about_tiktok,u.about_zillow,u.about_realtor].filter(Boolean),I=(Z=i.faq_json)!=null&&Z.length?{"@context":"https://schema.org","@type":"FAQPage",...w&&{mainEntityOfPage:{"@type":"WebPage","@id":w}},about:{"@id":"https://www.holdengr.com/#agent"},mainEntity:i.faq_json.map(se=>({"@type":"Question",name:se.question,acceptedAnswer:{"@type":"Answer",text:se.answer}}))}:null,T=_?{"@context":"https://schema.org","@type":"NewsArticle",headline:i.h1,description:i.meta_description||i.intro_text||i.title,...w&&{mainEntityOfPage:{"@type":"WebPage","@id":w},url:w},...i.published_at&&{datePublished:i.published_at},...i.updated_at&&{dateModified:i.updated_at},author:{"@type":"Person",name:m||"Holden Richardson",url:"https://www.holdengr.com/about",...f&&{telephone:f},...A&&{email:A}},...h&&{image:[Ac(h.file_path)]},publisher:{"@id":"https://www.holdengr.com/#agent"},inLanguage:"en-US"}:null,N=!_&&m?{"@context":"https://schema.org","@type":"RealEstateAgent","@id":"https://www.holdengr.com/#agent",name:m,...u.agent_brokerage&&{worksFor:{"@type":"RealEstateOrganization",name:u.agent_brokerage}},...u.agent_market&&{areaServed:u.agent_market},...f&&{telephone:f},...A&&{email:A},...j.length>0&&{sameAs:j}}:null,F=[{"@type":"ListItem",position:1,name:"Home",item:g?`${g}/`:"https://www.holdengr.com/"},{"@type":"ListItem",position:2,name:y||"",item:S(v)}];n?(F.push({"@type":"ListItem",position:3,name:n.replace(/-/g," "),item:S(x)}),F.push({"@type":"ListItem",position:4,name:i.title,item:w||S(b)})):F.push({"@type":"ListItem",position:3,name:i.title,item:w||S(b)});const L={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:F},D=i.video_url,H=i.video_transcript,$=(i.video_orientation||"horizontal")==="vertical",V=D==null?void 0:D.match(/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|shorts\/|watch\?v=|watch\?.+&v=))([^&?\s]+)/),Q=V==null?void 0:V[1],ce=D&&Q?{"@context":"https://schema.org","@type":"VideoObject",name:i.h1,description:i.meta_description||i.subheadline||i.title,thumbnailUrl:`https://i.ytimg.com/vi/${Q}/hqdefault.jpg`,embedUrl:`https://www.youtube.com/embed/${Q}`,contentUrl:`https://www.youtube.com/watch?v=${Q}`,...i.published_at&&{uploadDate:i.published_at},publisher:{"@id":"https://www.holdengr.com/#agent"},inLanguage:"en-US",isAccessibleForFree:!0,...H&&{transcript:H}}:null,R=i.subheadline,M=h?Ac(h.file_path):null,Y=i.schema_markup&&typeof i.schema_markup=="object"?i.schema_markup:null;return c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsx("title",{children:i.meta_title||i.title}),i.meta_description&&c.jsx("meta",{name:"description",content:i.meta_description}),c.jsx("meta",{property:"og:title",content:i.meta_title||i.title}),i.meta_description&&c.jsx("meta",{property:"og:description",content:i.meta_description}),c.jsx("meta",{property:"og:type",content:"article"}),w&&c.jsx("meta",{property:"og:url",content:w}),w&&c.jsx("link",{rel:"canonical",href:w}),c.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),c.jsx("meta",{name:"twitter:title",content:i.meta_title||i.title}),i.meta_description&&c.jsx("meta",{name:"twitter:description",content:i.meta_description}),Y&&c.jsx("script",{type:"application/ld+json",children:JSON.stringify(Y)}),I&&c.jsx("script",{type:"application/ld+json",children:JSON.stringify(I)}),T&&c.jsx("script",{type:"application/ld+json",children:JSON.stringify(T)}),N&&c.jsx("script",{type:"application/ld+json",children:JSON.stringify(N)}),c.jsx("script",{type:"application/ld+json",children:JSON.stringify(L)}),ce&&c.jsx("script",{type:"application/ld+json",children:JSON.stringify(ce)})]}),c.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:[M?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:`url(${M})`}}),c.jsx("div",{className:"absolute inset-0 bg-black/40"})]}):c.jsx("div",{className:"absolute inset-0 bg-black"}),c.jsxs("div",{className:"container-page relative z-10 w-full",children:[c.jsx(ke,{variant:"blur",children:c.jsxs("nav",{className:"text-sm text-background/50 mb-6 uppercase tracking-wider",children:[c.jsx(Ct,{to:"/",className:"text-accent/70 hover:text-accent transition-colors",children:"Home"}),c.jsx("span",{className:"mx-2",children:"/"}),c.jsx(Ct,{to:v,className:"text-accent/70 hover:text-accent transition-colors capitalize",children:y}),n&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"mx-2",children:"/"}),c.jsx(Ct,{to:x,className:"text-accent/70 hover:text-accent transition-colors capitalize",children:n.replace(/-/g," ")})]}),c.jsx("span",{className:"mx-2",children:"/"}),c.jsx("span",{className:"text-background/80",children:i.title})]})}),c.jsxs(ke,{delay:.1,children:[c.jsx("h1",{className:"font-serif text-3xl md:text-5xl lg:text-6xl font-light leading-tight mb-4 max-w-4xl",children:i.h1}),c.jsx("div",{className:"w-16 h-[2px] bg-accent mt-4 mb-6"})]}),R&&c.jsx(ke,{delay:.2,children:c.jsx("p",{className:"text-lg md:text-xl text-background/65 max-w-3xl font-light",children:R})})]})]}),c.jsx("section",{className:"py-16 md:py-24 bg-background",children:c.jsxs("div",{className:"container-page max-w-4xl mx-auto",children:[i.intro_text&&c.jsx(ke,{children:c.jsx("p",{className:"text-body text-foreground/75 text-lg leading-relaxed max-w-3xl mx-auto text-left",children:i.intro_text})}),_&&i.body_content&&c.jsx(ke,{children:c.jsxs("div",{className:"mt-10 md:mt-14",children:[E&&(E.national||E.local||E.source)&&c.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-8 p-4 border border-border/50 rounded bg-muted/30",children:[c.jsx("span",{className:"text-xs uppercase tracking-wider text-muted-foreground font-medium",children:"As seen in:"}),E.national&&c.jsxs("a",{href:E.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:[c.jsx(Ka,{className:"w-3.5 h-3.5"})," National"]}),E.local&&c.jsxs("a",{href:E.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:[c.jsx(Ka,{className:"w-3.5 h-3.5"})," Local"]}),E.source&&c.jsxs("a",{href:E.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:[c.jsx(Ka,{className:"w-3.5 h-3.5"})," Source"]})]}),c.jsx("div",{className:"prose prose-sm md:prose-base max-w-none prose-headings:font-serif prose-a:text-accent",dangerouslySetInnerHTML:{__html:abt(i.body_content)}})]})}),i.intro_text&&i.faq_json&&i.faq_json.length>0&&c.jsxs("div",{className:"flex items-center justify-center my-10 md:my-14",children:[c.jsx("div",{className:"h-px bg-border flex-1 max-w-16"}),c.jsx("div",{className:"w-2 h-2 rotate-45 border border-accent/50 mx-4"}),c.jsx("div",{className:"h-px bg-border flex-1 max-w-16"})]}),i.faq_json&&i.faq_json.length>0&&c.jsxs(c.Fragment,{children:[c.jsx(ke,{children:c.jsxs("div",{className:"text-center mb-10",children:[c.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Common Questions"}),c.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-light text-foreground",children:"What You Need to Know"})]})}),c.jsx(ke,{delay:.1,children:c.jsx(Qp,{type:"single",collapsible:!0,className:"space-y-4",children:i.faq_json.map((se,ie)=>c.jsxs(kA,{value:`faq-${ie}`,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:[c.jsx(BA,{className:"text-left text-sm md:text-base font-medium hover:no-underline py-4 text-foreground/85 hover:text-foreground",children:se.question}),c.jsx(_A,{className:"text-sm text-muted-foreground leading-relaxed pb-5 px-1",children:se.answer})]},ie))})})]})]})}),i.faq_json&&i.faq_json.length>0&&D&&Q&&c.jsxs("div",{className:"flex items-center justify-center py-2 bg-background",children:[c.jsx("div",{className:"h-px bg-border flex-1 max-w-16"}),c.jsx("div",{className:"w-2 h-2 rotate-45 border border-accent/50 mx-4"}),c.jsx("div",{className:"h-px bg-border flex-1 max-w-16"})]}),D&&Q&&c.jsx("section",{className:"py-16 md:py-24 bg-secondary/15",children:c.jsxs("div",{className:"container-page max-w-4xl mx-auto",children:[c.jsxs(ke,{children:[c.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Watch"}),c.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-light mb-6",children:"Video Overview"})]}),c.jsx(ke,{delay:.1,children:c.jsx("div",{className:`relative overflow-hidden rounded-lg mx-auto ${$?"max-w-sm aspect-[9/16]":"w-full aspect-video"}`,children:c.jsx("iframe",{src:`https://www.youtube.com/embed/${Q}`,title:i.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"})})}),H&&c.jsx(Qp,{type:"single",collapsible:!0,className:"mt-6",children:c.jsxs(kA,{value:"transcript",className:"border border-border/60 px-6 md:px-8 transition-all duration-200 bg-background shadow-md shadow-foreground/[0.04] hover:shadow-lg",children:[c.jsx(BA,{className:"text-left text-sm font-medium hover:no-underline py-4 text-foreground/75 hover:text-foreground",children:"View Video Transcript"}),c.jsx(_A,{className:"text-sm text-muted-foreground leading-relaxed pb-5 px-1 whitespace-pre-line",children:H})]})})]})}),l&&l.length>0&&c.jsx("section",{className:"py-12 md:py-16 bg-background",children:c.jsxs("div",{className:"container-page",children:[c.jsxs(ke,{children:[c.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Related Topics"}),c.jsxs("h2",{className:"font-serif text-2xl md:text-3xl font-light mb-2",children:["Most Relevant ",y," Questions"]}),c.jsx("div",{className:"w-12 h-px bg-accent mb-8"})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:l.map((se,ie)=>c.jsx(ke,{delay:ie*.06,children:c.jsxs(Ct,{to:n?`/${e}/${n}/${se.slug}`:`/${e}/${se.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:[c.jsx("div",{className:"flex-1 min-w-0",children:c.jsx("h3",{className:"font-serif text-sm md:text-base group-hover:text-accent transition-colors leading-snug",children:se.h1||se.title})}),c.jsx(Ma,{size:16,className:"shrink-0 text-accent/60 group-hover:text-accent transition-all group-hover:translate-x-1"})]})},se.id))}),c.jsx(ke,{children:c.jsxs("div",{className:"mt-8 flex flex-wrap items-center gap-x-6 gap-y-3 text-sm",children:[c.jsxs(Ct,{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 ",c.jsx(Ma,{size:14})]}),c.jsxs(Ct,{to:v,className:"inline-flex items-center gap-2 text-foreground/60 hover:text-foreground transition-colors uppercase tracking-wider text-caption font-medium",children:["All ",y," topics ",c.jsx(Ma,{size:14})]})]})})]})}),a&&a.length>0&&c.jsx("section",{className:"py-16 md:py-24 bg-secondary/15",children:c.jsxs("div",{className:"container-page",children:[c.jsxs(ke,{children:[c.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Sub-Topics"}),c.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-light mb-2",children:"Explore More Topics"}),c.jsx("div",{className:"w-12 h-px bg-accent mb-12"})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:a.map((se,ie)=>c.jsx(ke,{delay:ie*.08,variant:"lift",children:c.jsxs(Ct,{to:`/${e}/${se.slug}`,className:"group block p-8 border border-border/60 hover:border-accent/50 bg-background hover:bg-secondary/20 transition-all duration-300",children:[c.jsx("h3",{className:"font-serif text-lg mb-2 group-hover:text-accent transition-colors",children:se.title}),se.intro_text&&c.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-4",children:se.intro_text}),c.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 ",c.jsx(Ma,{size:14,className:"transition-transform group-hover:translate-x-1"})]})]})},se.id))})]})}),c.jsx("section",{className:"py-20 md:py-28 bg-foreground text-background",children:c.jsx("div",{className:"container-page text-center",children:c.jsxs(ke,{children:[c.jsx("p",{className:"text-caption text-gold uppercase tracking-widest mb-3 font-semibold",children:"Let's Connect"}),c.jsx("h2",{className:"font-serif text-2xl md:text-4xl font-semibold mb-3",children:"Reach Out Your Way"}),c.jsx("p",{className:"text-background/80 max-w-lg mx-auto font-medium mb-10",children:m?`${m} is here to help — pick whichever works best for you.`:"We're here to help — pick whichever works best for you."}),c.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[p&&c.jsx("a",{href:p,target:"_blank",rel:"noopener noreferrer",children:c.jsxs(Be,{size:"lg",className:"bg-background text-foreground hover:bg-background/90 rounded-none transition-colors font-semibold",children:[c.jsx(ll,{className:"w-4 h-4 mr-2"}),"Book Virtual Meeting With Holden"]})}),A&&c.jsx("a",{href:`mailto:${A}`,children:c.jsxs(Be,{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:[c.jsx(Lk,{className:"w-4 h-4 mr-2"}),"Email"]})}),f&&c.jsx("a",{href:`tel:${f}`,children:c.jsxs(Be,{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:[c.jsx(gp,{className:"w-4 h-4 mr-2"}),"Call"]})}),c.jsx(Ct,{to:"/contact",children:c.jsxs(Be,{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:[c.jsx(rA,{className:"w-4 h-4 mr-2"}),"Send a Message"]})})]})]})})}),c.jsx("noscript",{children:c.jsxs("div",{style:{padding:"2rem"},children:[c.jsx("h1",{children:i.h1}),i.intro_text&&c.jsx("p",{children:i.intro_text}),(de=i.faq_json)==null?void 0:de.map((se,ie)=>c.jsxs("div",{children:[c.jsx("h3",{children:se.question}),c.jsx("p",{children:se.answer})]},ie))]})})]})},obt={car:r1e,trees:P1e,building:n1e,heart:ore,users:F1e,school:h1e,pin:xb},HH=({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-${k.useId().replace(/:/g,"")}`;return c.jsxs("section",{className:"relative py-10 md:py-14 overflow-hidden",children:[c.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-foreground via-foreground/95 to-foreground"}),c.jsx("div",{className:"absolute inset-0 backdrop-blur-sm"}),c.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-accent/30 to-transparent"}),c.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)); }
        }
      `}),c.jsx("div",{className:"relative container-page",children:c.jsx("div",{id:i,className:"grid gap-6 md:gap-8",children:e.map((s,a)=>{const o=s.icon&&obt[s.icon]||xb;return c.jsx(ke,{delay:a*.08,children:c.jsxs("div",{className:"text-center group",children:[c.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:c.jsx(o,{className:"w-5 h-5 text-accent"})}),c.jsx("p",{className:"text-lg md:text-xl font-semibold text-background",children:s.value}),c.jsx("p",{className:"text-xs text-background/50 uppercase tracking-widest mt-1",children:s.label})]})},a)})})}),c.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-background/10 to-transparent"})]})},lbt=({category:e,subcategories:t,faqs:n})=>{const{data:r}=iv(),i=(r||[]).filter(a=>a.media_type==="stock_photo"),s=e.stats_json||[];return c.jsxs(c.Fragment,{children:[e.intro_text&&c.jsx("section",{className:"py-16 md:py-20 bg-background",children:c.jsx("div",{className:"container-page max-w-4xl",children:c.jsx(ke,{children:c.jsx("p",{className:"text-body text-foreground/75 text-lg leading-relaxed text-left",children:e.intro_text.split(`

`)[0]})})})}),c.jsx(HH,{stats:s}),c.jsx("section",{className:"py-12 md:py-20 bg-secondary/20",children:c.jsxs("div",{className:"container-page",children:[c.jsx(ke,{children:c.jsxs("div",{className:"text-center mb-12",children:[c.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Explore Communities"}),c.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-light",children:"Grand Rapids Area Neighborhoods"}),c.jsx("div",{className:"w-12 h-px bg-accent mx-auto mt-4"})]})}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 lg:gap-8",children:t.map((a,o)=>{const l=a.cover_image_id?i.find(h=>h.id===a.cover_image_id):null,u=l?Ac(l.file_path):null,d=a.stats_json||[];return c.jsx(ke,{delay:o*.06,variant:"lift",children:c.jsxs(Ct,{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:[c.jsxs("div",{className:"relative aspect-[16/9] overflow-hidden",children:[u?c.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"}):c.jsx("div",{className:"w-full h-full bg-gradient-to-br from-secondary/60 to-secondary/30 flex items-center justify-center",children:c.jsx("span",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Add cover image"})}),c.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-5",children:c.jsxs("h3",{className:"font-serif text-xl md:text-2xl text-white font-light flex items-center gap-2",children:[a.icon&&c.jsx("span",{children:a.icon}),a.name]})})]}),c.jsxs("div",{className:"p-5 md:p-6",children:[a.description&&c.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed mb-4 line-clamp-3",children:a.description}),d.length>0&&c.jsx("div",{className:"flex flex-wrap gap-3 mb-4",children:d.slice(0,3).map((h,f)=>c.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:[c.jsx("span",{className:"font-medium",children:h.value}),c.jsx("span",{className:"text-muted-foreground",children:"·"}),c.jsx("span",{children:h.label})]},f))}),c.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,c.jsx(Ma,{size:14,className:"transition-transform group-hover:translate-x-1"})]})]})]})},a.id)})})]})}),n.length>0&&c.jsx("section",{className:"py-16 md:py-24 bg-background",children:c.jsxs("div",{className:"container-page max-w-4xl mx-auto",children:[c.jsx(ke,{children:c.jsx("div",{className:"text-center mb-12",children:c.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"})})}),c.jsx(ke,{delay:.1,children:c.jsx(Qp,{type:"single",collapsible:!0,className:"space-y-4",children:n.map((a,o)=>c.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:[c.jsx(BA,{className:"text-left text-sm md:text-base font-medium hover:no-underline py-4 text-foreground/85 hover:text-foreground",children:a.question}),c.jsx(_A,{className:"text-sm text-muted-foreground leading-relaxed pb-5 px-1",children:a.answer})]},o))})})]})})]})};function cbt(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 ubt=({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}=iv(),l=(o||[]).filter(f=>f.media_type==="stock_photo"),u=e.content_image_ids||[],d=l.filter(f=>{var A,p;return((A=f.tags)==null?void 0:A.includes(e.slug))||((p=f.tags)==null?void 0:p.includes("content"))});return c.jsxs(c.Fragment,{children:[c.jsx(HH,{stats:i}),s.length>0&&c.jsx("div",{className:"bg-background",children:s.map((f,A)=>{const p=A%2===1,m=u[A],y=(m?l.find(x=>x.id===m):null)||d[A],v=y?Ac(y.file_path):null;return c.jsx("section",{className:`py-16 md:py-24 ${A%2===0?"bg-background":"bg-secondary/20"}`,children:c.jsx("div",{className:"container-page",children:c.jsxs("div",{className:`grid grid-cols-1 lg:grid-cols-2 gap-10 lg:gap-16 items-center ${p?"lg:[direction:rtl]":""}`,children:[c.jsxs(ke,{className:p?"lg:[direction:ltr]":"",children:[c.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:e.name}),c.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-light mb-4 leading-snug",children:a[A]||cbt(f)}),c.jsx("div",{className:"w-10 h-px bg-accent mb-6"}),c.jsx("p",{className:"text-body text-foreground/75 leading-relaxed text-lg",children:f})]}),c.jsx(ke,{delay:.15,className:p?"lg:[direction:ltr]":"",children:v?c.jsx("div",{className:"aspect-[4/3] overflow-hidden",children:c.jsx("img",{src:v,alt:(y==null?void 0:y.alt_text)||`${e.name} — section ${A+1}`,className:"w-full h-full object-cover",loading:"lazy"})}):c.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:c.jsxs("div",{className:"text-center px-8",children:[c.jsx("div",{className:"w-12 h-12 mx-auto mb-3 border border-accent/30 flex items-center justify-center",children:c.jsx("span",{className:"text-accent text-lg font-serif",children:A+1})}),c.jsx("span",{className:"text-xs text-muted-foreground tracking-wider uppercase",children:"Upload image via Media Library"})]})})})]})})},A)})}),r.length>0&&c.jsx("section",{className:"py-16 md:py-24 bg-background",children:c.jsxs("div",{className:"container-page max-w-4xl mx-auto",children:[c.jsx(ke,{children:c.jsx("div",{className:"text-center mb-12",children:c.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}`})})}),c.jsx(ke,{delay:.1,children:c.jsx(Qp,{type:"single",collapsible:!0,className:"space-y-4",children:r.map((f,A)=>c.jsxs(kA,{value:`faq-${A}`,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:[c.jsx(BA,{className:"text-left text-sm md:text-base font-medium hover:no-underline py-4 text-foreground/85 hover:text-foreground",children:f.question}),c.jsx(_A,{className:"text-sm text-muted-foreground leading-relaxed pb-5 px-1",children:f.answer})]},A))})})]})}),n&&n.length>0&&c.jsx("section",{className:"py-12 md:py-16 bg-secondary/20",children:c.jsxs("div",{className:"container-page",children:[c.jsxs(ke,{children:[c.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Dive Deeper"}),c.jsxs("h2",{className:"font-serif text-2xl md:text-3xl font-light mb-2",children:["Explore ",e.name," Topics"]}),c.jsx("div",{className:"w-12 h-px bg-accent mb-8"})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:n.map((f,A)=>c.jsx(ke,{delay:A*.06,children:c.jsxs(Ct,{to:`/neighborhoods/${e.slug}/${f.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:[c.jsx("div",{className:"flex-1 min-w-0",children:c.jsx("h3",{className:"font-serif text-sm md:text-base group-hover:text-accent transition-colors leading-snug",children:f.h1||f.title})}),c.jsx(Ma,{size:16,className:"shrink-0 text-accent/60 group-hover:text-accent transition-all group-hover:translate-x-1"})]})},f.id))})]})})]})};function EX(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 dbt(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 hbt(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 jge=({subcategorySlug:e,categoryOverride:t}={})=>{var Y;const n=om(),r=t||n.category;if(r==="about"&&!e)return c.jsx(oj,{to:"/about",replace:!0});const{configMap:i}=To(),s=i.agent_name,a=i.agent_email,o=i.agent_phone,l=i.booking_url,{data:u,isLoading:d}=KA(),h=u==null?void 0:u.find(X=>X.slug===r&&!X.parent_id),f=e?u==null?void 0:u.find(X=>X.slug===e&&X.parent_id===(h==null?void 0:h.id)):h,{data:A}=FKe(e||f==null?void 0:f.id),{data:p,isLoading:m}=dr({queryKey:["category-parents",f==null?void 0:f.id],enabled:!!f,queryFn:async()=>{const{data:X,error:K}=await Me.from("aeo_pages").select("id, title, slug, h1, subheadline, intro_text, is_parent, display_order").eq("category_id",f.id).eq("status","published").order("display_order");if(K)throw K;return X}}),{data:g}=iv(),y=(g||[]).filter(X=>X.media_type==="stock_photo"),v=(f==null?void 0:f.cover_image_id)||null,x=(f==null?void 0:f.content_image_ids)||[],b=v?y.find(X=>X.id===v):null,w=y.filter(X=>{var K,Z;return((K=X.tags)==null?void 0:K.includes(r||""))||((Z=X.tags)==null?void 0:Z.includes("featured"))}),S=w.filter(X=>{var K;return(K=X.tags)==null?void 0:K.includes("cover")}),_=y.filter(X=>{var K;return(K=X.tags)==null?void 0:K.includes("cover")}),E=w.filter(X=>{var K;return(K=X.tags)==null?void 0:K.includes("content")}),j=y.filter(X=>{var K;return(K=X.tags)==null?void 0:K.includes("content")});if(!f&&!m&&!d)return c.jsx(xn,{children:c.jsxs("div",{className:"container-page section-padding text-center",children:[c.jsx("h1",{className:"heading-section mb-4",children:"Category Not Found"}),c.jsx("p",{className:"text-body text-muted-foreground",children:"This page doesn't exist yet."})]})});const I=(f==null?void 0:f.name)||(r==null?void 0:r.replace(/-/g," "))||"",T=(f==null?void 0:f.faq_json)||[],N=((Y=f==null?void 0:f.intro_text)==null?void 0:Y.split(`

`).filter(Boolean))||[],F=(f==null?void 0:f.section_headings)||[],L=f!=null&&f.video_url?dbt(f.video_url):null,D=f!=null&&f.video_url?hbt(f.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,$=f!=null&&f.video_url&&L?{"@context":"https://schema.org","@type":"VideoObject",name:f.video_headline||`${I} Video`,description:f.description||`Video about ${I} — Grand Rapids real estate.`,thumbnailUrl:D?`https://i.ytimg.com/vi/${D}/hqdefault.jpg`:"https://www.holdengr.com/og-image.jpg",embedUrl:L,...D&&{contentUrl:`https://www.youtube.com/watch?v=${D}`},uploadDate:f.created_at,publisher:{"@id":"https://www.holdengr.com/#agent"},inLanguage:"en-US",isAccessibleForFree:!0,...f.video_transcript?{transcript:f.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"]}}[r]:void 0,ce=!e&&Q&&F.length>0&&F.length===N.length?{"@context":"https://schema.org","@type":"HowTo",name:Q.name,description:(f==null?void 0:f.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,K)=>({"@type":"HowToStep",position:K+1,name:F[K]||EX(X),text:X,url:`${H}#step-${K+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)||I,item:`https://www.holdengr.com/${r}`}];e&&f&&R.push({"@type":"ListItem",position:3,name:f.name,item:H});const M={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:R};return c.jsxs(xn,{children:[c.jsxs(ur,{children:[c.jsxs("title",{children:[I," | Grand Rapids Area Real Estate"]}),c.jsx("meta",{name:"description",content:(f==null?void 0:f.description)||`${I} — Expert real estate guidance for the Grand Rapids area.`}),c.jsx("link",{rel:"canonical",href:H}),c.jsx("meta",{property:"og:title",content:`${I} | Grand Rapids Area Real Estate`}),c.jsx("meta",{property:"og:description",content:(f==null?void 0:f.description)||`${I} — Expert real estate guidance for the Grand Rapids area.`}),c.jsx("meta",{property:"og:url",content:H}),c.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image.jpg"}),c.jsx("meta",{property:"og:type",content:"website"}),c.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),c.jsx("meta",{name:"twitter:title",content:`${I} | Grand Rapids Area Real Estate`}),c.jsx("meta",{name:"twitter:description",content:(f==null?void 0:f.description)||`${I} — Expert real estate guidance.`}),c.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image.jpg"}),c.jsx("script",{type:"application/ld+json",children:JSON.stringify(M)}),W&&c.jsx("script",{type:"application/ld+json",children:JSON.stringify(W)}),$&&c.jsx("script",{type:"application/ld+json",children:JSON.stringify($)}),ce&&c.jsx("script",{type:"application/ld+json",children:JSON.stringify(ce)})]}),(()=>{const X=b||S[0]||_[0],K=X?Ac(X.file_path):null;return c.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:[K?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:`url(${K})`}}),c.jsx("div",{className:`absolute inset-0 ${r==="buyers"?"bg-black/55":"bg-black/40"}`})]}):c.jsx("div",{className:"absolute inset-0 bg-black"}),c.jsxs("div",{className:"container-page relative z-10 w-full",children:[c.jsx(ke,{children:c.jsx("p",{className:"text-caption text-background/50 mb-4 uppercase tracking-widest",children:"Grand Rapids Area Real Estate"})}),c.jsxs(ke,{delay:.1,children:[c.jsx("h1",{className:"font-sans text-4xl md:text-5xl lg:text-6xl font-semibold leading-tight mb-4 max-w-4xl capitalize",children:I}),c.jsx("div",{className:"w-16 h-[2px] bg-accent mt-4 mb-6"})]}),(f==null?void 0:f.description)&&c.jsx(ke,{delay:.2,children:c.jsx("p",{className:"text-lg md:text-xl text-background/65 max-w-3xl font-light",children:f.description})}),!K&&c.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:[c.jsx("span",{children:"📷"}),' Tag an image "hero" + "',r,'" in Media Library for cover photo']})]})]})})(),!(r==="neighborhoods"&&!e)&&c.jsx(HH,{stats:(f==null?void 0:f.stats_json)||[]}),r==="neighborhoods"&&!e&&f&&A&&A.length>0?c.jsxs(c.Fragment,{children:[c.jsx(lbt,{category:f,subcategories:A,faqs:T}),c.jsx("section",{className:"py-20 md:py-28 bg-foreground text-background",children:c.jsx("div",{className:"container-page text-center",children:c.jsxs(ke,{children:[c.jsx("p",{className:"text-caption text-gold uppercase tracking-widest mb-3 font-semibold",children:"Let's Connect"}),c.jsx("h2",{className:"font-serif text-2xl md:text-4xl font-semibold mb-3",children:"Reach Out Your Way"}),c.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."}),c.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[l&&c.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",children:c.jsxs(Be,{size:"lg",className:"bg-background text-foreground hover:bg-background/90 rounded-none transition-colors font-semibold",children:[c.jsx(ll,{className:"w-4 h-4 mr-2"}),"Book Virtual Meeting With Holden"]})}),a&&c.jsx("a",{href:`mailto:${a}`,children:c.jsxs(Be,{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:[c.jsx(Lk,{className:"w-4 h-4 mr-2"}),"Email"]})}),o&&c.jsx("a",{href:`tel:${o}`,children:c.jsxs(Be,{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:[c.jsx(gp,{className:"w-4 h-4 mr-2"}),"Call"]})}),c.jsx(Ct,{to:"/contact",children:c.jsxs(Be,{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:[c.jsx(rA,{className:"w-4 h-4 mr-2"}),"Send a Message"]})})]})]})})})]}):r==="neighborhoods"&&e&&f&&h?c.jsxs(c.Fragment,{children:[c.jsx(ubt,{category:f,parentCategory:h,pages:p||[],faqs:T}),c.jsx("section",{className:"py-20 md:py-28 bg-foreground text-background",children:c.jsx("div",{className:"container-page text-center",children:c.jsxs(ke,{children:[c.jsx("p",{className:"text-caption text-gold uppercase tracking-widest mb-3 font-semibold",children:"Let's Connect"}),c.jsx("h2",{className:"font-serif text-2xl md:text-4xl font-semibold mb-3",children:"Reach Out Your Way"}),c.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."}),c.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[l&&c.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",children:c.jsxs(Be,{size:"lg",className:"bg-background text-foreground hover:bg-background/90 rounded-none transition-colors font-semibold",children:[c.jsx(ll,{className:"w-4 h-4 mr-2"}),"Book Virtual Meeting With Holden"]})}),a&&c.jsx("a",{href:`mailto:${a}`,children:c.jsxs(Be,{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:[c.jsx(Lk,{className:"w-4 h-4 mr-2"}),"Email"]})}),o&&c.jsx("a",{href:`tel:${o}`,children:c.jsxs(Be,{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:[c.jsx(gp,{className:"w-4 h-4 mr-2"}),"Call"]})}),c.jsx(Ct,{to:"/contact",children:c.jsxs(Be,{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:[c.jsx(rA,{className:"w-4 h-4 mr-2"}),"Send a Message"]})})]})]})})})]}):e==="news"&&f?c.jsx(jle,{categoryId:f.id,parentCategorySlug:r||"about"}):c.jsxs(c.Fragment,{children:[N.length>0&&c.jsx("div",{className:N.length>0?"bg-background":"",children:N.map((X,K)=>{const Z=K%2===1,de=x[K],ie=(de?y.find(Se=>Se.id===de):null)||E[K]||j[K],he=ie?Ac(ie.file_path):null,ue=ce?`step-${K+1}`:void 0;return c.jsx("section",{id:ue,className:`py-16 md:py-24 ${K%2===0?"bg-background":"bg-secondary/20"} scroll-mt-24`,children:c.jsx("div",{className:"container-page",children:c.jsxs("div",{className:`grid grid-cols-1 lg:grid-cols-2 gap-10 lg:gap-16 items-center ${Z?"lg:[direction:rtl]":""}`,children:[c.jsxs(ke,{className:Z?"lg:[direction:ltr]":"",children:[c.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:ce?`Step ${K+1} of ${N.length}`:I}),c.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-light mb-4 leading-snug",children:F[K]||EX(X)}),c.jsx("div",{className:"w-10 h-px bg-accent mb-6"}),c.jsx("p",{className:"text-body text-foreground/75 leading-relaxed text-lg",children:X})]}),c.jsx(ke,{delay:.15,className:Z?"lg:[direction:ltr]":"",children:he?c.jsx("div",{className:"aspect-[4/3] overflow-hidden",children:c.jsx("img",{src:he,alt:(ie==null?void 0:ie.alt_text)||`${I} — section ${K+1}`,className:"w-full h-full object-cover",loading:"lazy"})}):c.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:c.jsxs("div",{className:"text-center px-8",children:[c.jsx("div",{className:"w-12 h-12 mx-auto mb-3 border border-accent/30 flex items-center justify-center",children:c.jsx("span",{className:"text-accent text-lg font-serif",children:K+1})}),c.jsx("span",{className:"text-xs text-muted-foreground tracking-wider uppercase",children:"Upload image via Media Library"})]})})})]})})},K)})}),T.length>0&&c.jsx("section",{className:"py-16 md:py-24 bg-background",children:c.jsxs("div",{className:"container-page max-w-4xl mx-auto",children:[c.jsx(ke,{children:c.jsxs("div",{className:"text-center mb-12",children:[c.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-light mb-3 text-foreground",children:(f==null?void 0:f.faq_title)||`Common Questions About ${I}`}),(f==null?void 0:f.description)&&c.jsx("p",{className:"text-sm text-muted-foreground max-w-2xl mx-auto",children:f.description})]})}),c.jsx(ke,{delay:.1,children:c.jsx(Qp,{type:"single",collapsible:!0,className:"space-y-4",children:T.map((X,K)=>c.jsxs(kA,{value:`faq-${K}`,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:[c.jsx(BA,{className:"text-left text-sm md:text-base font-medium hover:no-underline py-4 text-foreground/85 hover:text-foreground",children:X.question}),c.jsx(_A,{className:"text-sm text-muted-foreground leading-relaxed pb-5 px-1",children:X.answer})]},K))})})]})}),T.length>0&&L&&c.jsxs("div",{className:"flex items-center justify-center py-2 bg-background",children:[c.jsx("div",{className:"h-px bg-border flex-1 max-w-16"}),c.jsx("div",{className:"w-2 h-2 rotate-45 border border-accent/50 mx-4"}),c.jsx("div",{className:"h-px bg-border flex-1 max-w-16"})]}),L&&c.jsx("section",{className:"py-16 md:py-24 bg-secondary/20",children:c.jsxs("div",{className:"container-page max-w-4xl mx-auto",children:[c.jsxs(ke,{children:[(f==null?void 0:f.video_headline)&&c.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-light mb-8 text-center",children:f.video_headline}),c.jsx("div",{className:`mx-auto ${(f==null?void 0:f.video_orientation)==="vertical"?"max-w-sm":"max-w-4xl"}`,children:c.jsx("div",{className:`relative overflow-hidden rounded-lg shadow-lg ${(f==null?void 0:f.video_orientation)==="vertical"?"aspect-[9/16]":"aspect-video"}`,children:c.jsx("iframe",{src:L,title:(f==null?void 0:f.video_headline)||`${I} Video`,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"absolute inset-0 w-full h-full",loading:"lazy"})})})]}),(f==null?void 0:f.video_transcript)&&c.jsx(ke,{delay:.1,children:c.jsx("div",{className:"mt-8 max-w-3xl mx-auto",children:c.jsx(Qp,{type:"single",collapsible:!0,children:c.jsxs(kA,{value:"transcript",className:"border border-border/60 px-6 md:px-8 transition-all duration-200 bg-background shadow-md shadow-foreground/[0.04] hover:shadow-lg",children:[c.jsx(BA,{className:"text-left text-sm font-medium hover:no-underline py-4 text-foreground/75 hover:text-foreground",children:"View Video Transcript"}),c.jsx(_A,{className:"text-sm text-muted-foreground leading-relaxed pb-5 px-1 whitespace-pre-line",children:f.video_transcript})]})})})})]})}),c.jsx("section",{className:"py-12 md:py-16 bg-background",children:c.jsxs("div",{className:"container-page",children:[c.jsxs(ke,{children:[c.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Dive Deeper"}),c.jsxs("h2",{className:"font-serif text-2xl md:text-3xl font-light mb-2",children:["Explore ",I," Topics"]}),c.jsx("div",{className:"w-12 h-px bg-accent mb-8"})]}),m?c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[1,2,3].map(X=>c.jsx(Tt,{className:"h-24 w-full"},X))}):p&&p.length>0||A&&A.length>0?c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[!e&&(A==null?void 0:A.map((X,K)=>c.jsx(ke,{delay:K*.06,children:c.jsxs(Ct,{to:`/${r}/${X.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:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("h3",{className:"font-serif text-sm md:text-base group-hover:text-accent transition-colors leading-snug",children:[X.icon&&c.jsx("span",{className:"mr-1",children:X.icon}),X.name]}),X.description&&c.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1",children:X.description})]}),c.jsx(Ma,{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,K)=>{const Z=e?`/${r}/${e}`:`/${r}`;return c.jsx(ke,{delay:((A==null?void 0:A.length)||0+K)*.06,children:c.jsxs(Ct,{to:`${Z}/${X.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:[c.jsx("div",{className:"flex-1 min-w-0",children:c.jsx("h3",{className:"font-serif text-sm md:text-base group-hover:text-accent transition-colors leading-snug",children:X.h1||X.title})}),c.jsx(Ma,{size:16,className:"shrink-0 text-accent/60 group-hover:text-accent transition-all group-hover:translate-x-1"})]})},X.id)})]}):c.jsx("div",{className:"text-center py-12",children:c.jsx("p",{className:"text-muted-foreground",children:"Content for this category is coming soon."})})]})}),c.jsx("section",{className:"py-20 md:py-28 bg-foreground text-background",children:c.jsx("div",{className:"container-page text-center",children:c.jsxs(ke,{children:[c.jsx("p",{className:"text-caption text-gold uppercase tracking-widest mb-3 font-semibold",children:"Let's Connect"}),c.jsx("h2",{className:"font-serif text-2xl md:text-4xl font-semibold mb-3",children:"Reach Out Your Way"}),c.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."}),c.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[l&&c.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",children:c.jsxs(Be,{size:"lg",className:"bg-background text-foreground hover:bg-background/90 rounded-none transition-colors font-semibold",children:[c.jsx(ll,{className:"w-4 h-4 mr-2"}),"Book Virtual Meeting With Holden"]})}),a&&c.jsx("a",{href:`mailto:${a}`,children:c.jsxs(Be,{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:[c.jsx(Lk,{className:"w-4 h-4 mr-2"}),"Email"]})}),o&&c.jsx("a",{href:`tel:${o}`,children:c.jsxs(Be,{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:[c.jsx(gp,{className:"w-4 h-4 mr-2"}),"Call"]})}),c.jsx(Ct,{to:"/contact",children:c.jsxs(Be,{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:[c.jsx(rA,{className:"w-4 h-4 mr-2"}),"Send a Message"]})})]})]})})})]})]})},Abt=()=>{const{category:e,slug:t}=om(),{data:n,isLoading:r}=dr({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?c.jsx(xn,{children:c.jsxs("div",{className:"container-page section-padding",children:[c.jsx(Tt,{className:"h-12 w-3/4 mb-6"}),c.jsx(Tt,{className:"h-64 w-full"})]})}):(n==null?void 0:n.type)==="subcategory"?c.jsx(jge,{subcategorySlug:t}):c.jsx(sB,{})};function fbt({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 c.jsxs("div",{className:"bg-card border border-border p-6",children:[c.jsxs("div",{className:"flex items-baseline justify-between mb-4",children:[c.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium",children:n==="seller"?"Seller Market Heat":"Buyer Difficulty"}),c.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground/70",children:"0–100"})]}),c.jsxs("div",{className:"flex items-end gap-4",children:[c.jsx("div",{className:"text-5xl font-bold text-foreground tabular-nums",style:{color:i},children:r}),c.jsx("div",{className:"text-sm text-foreground/80 pb-2",children:t})]}),c.jsx("div",{className:"mt-4 h-2 bg-muted rounded-none overflow-hidden",children:c.jsx("div",{className:"h-full transition-all duration-700",style:{width:`${r}%`,background:i}})}),c.jsxs("div",{className:"flex justify-between text-[9px] uppercase tracking-[0.2em] text-muted-foreground/60 mt-2",children:[c.jsx("span",{children:"Cold"}),c.jsx("span",{children:"Balanced"}),c.jsx("span",{children:"Hot"})]})]})}function pbt(e){return e>=20?0:e>=15?.3:e>=10?.41:e>=5?.62:1}function mbt(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,l=pbt(e.downPaymentPct),u=n*(l/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:l}}const bv=e=>e.toLocaleString("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}),NX=e=>e.toLocaleString("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2}),eh=({label:e,value:t,sub:n})=>c.jsxs("div",{className:"bg-card border border-border p-5",children:[c.jsx("div",{className:"text-[9px] uppercase tracking-[0.25em] text-muted-foreground font-medium mb-2",children:e}),c.jsx("div",{className:"text-2xl font-bold text-foreground tabular-nums",children:t}),n&&c.jsx("div",{className:"text-[11px] text-muted-foreground mt-1",children:n})]});function gbt({snapshot:e,lens:t}){return e.yoy_pct>=0,c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium",children:"Market Snapshot"}),c.jsx("span",{className:"text-[9px] uppercase tracking-[0.2em] text-muted-foreground/60",children:"AI-researched · Not MLS-verified"})]}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:[c.jsx(eh,{label:"Median Sale Price",value:bv(e.median_sale_price),sub:`${e.yoy_pct>=0?"+":""}${e.yoy_pct.toFixed(1)}% YoY`}),c.jsx(eh,{label:"Homes Sold (30d)",value:String(e.homes_sold_30d)}),c.jsx(eh,{label:"Median Days on Market",value:`${e.median_dom}d`}),c.jsx(eh,{label:"List-to-Sale Ratio",value:`${e.list_to_sale_pct.toFixed(1)}%`}),c.jsx(eh,{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&&c.jsx(eh,{label:"Selling Above Ask",value:`${e.pct_above_ask.toFixed(0)}%`}),t==="buyer"&&e.new_listings_7d!==void 0&&c.jsx(eh,{label:"New Listings (7d)",value:String(e.new_listings_7d)}),t==="buyer"&&e.price_reduced_7d!==void 0&&c.jsx(eh,{label:"Price Reduced (7d)",value:String(e.price_reduced_7d)})]})]})}function ybt({data:e}){return c.jsxs("div",{className:"bg-card border border-border p-5",children:[c.jsx("div",{className:"flex items-center justify-between mb-4",children:c.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium",children:"Median Sale Price · 24-Month Trend"})}),c.jsx("div",{style:{width:"100%",height:260},children:c.jsx(sH,{children:c.jsxs(Nge,{data:e,margin:{top:10,right:12,left:12,bottom:0},children:[c.jsx(K5,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),c.jsx(mm,{dataKey:"month",tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"}}),c.jsx(gm,{tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"},tickFormatter:t=>`$${(t/1e3).toFixed(0)}k`,width:60}),c.jsx(Go,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))"},formatter:t=>bv(t)}),c.jsx(wv,{type:"monotone",dataKey:"value",stroke:"hsl(var(--primary))",strokeWidth:2,dot:{r:2}})]})})})]})}function vbt({data:e}){return c.jsxs("div",{className:"bg-card border border-border p-5",children:[c.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium mb-4",children:"Homes Sold per Month · 12-Month"}),c.jsx("div",{style:{width:"100%",height:220},children:c.jsx(sH,{children:c.jsxs(Dwt,{data:e,margin:{top:10,right:12,left:0,bottom:0},children:[c.jsx(K5,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),c.jsx(mm,{dataKey:"month",tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"}}),c.jsx(gm,{tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"},width:40}),c.jsx(Go,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))"}}),c.jsx(pm,{dataKey:"value",fill:"hsl(var(--primary))"})]})})})]})}function xbt({percentile:e,comps:t,zip:n}){return c.jsxs("div",{className:"bg-card border border-border p-5",children:[c.jsxs("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium mb-4",children:["Metro Score · How ",n," Ranks"]}),c.jsxs("div",{className:"mb-5",children:[c.jsxs("div",{className:"flex items-baseline gap-3 mb-2",children:[c.jsx("span",{className:"text-4xl font-bold tabular-nums",children:Math.round(e)}),c.jsx("span",{className:"text-sm text-muted-foreground",children:"percentile vs. GR metro"})]}),c.jsx("div",{className:"h-2 bg-muted",children:c.jsx("div",{className:"h-full bg-primary",style:{width:`${Math.max(2,Math.min(100,e))}%`}})})]}),t.length>0&&c.jsxs("div",{children:[c.jsx("div",{className:"text-[9px] uppercase tracking-[0.25em] text-muted-foreground/70 mb-2",children:"Nearby Comps"}),c.jsx("ul",{className:"space-y-1.5",children:t.map(r=>c.jsxs("li",{className:"flex items-center justify-between text-sm",children:[c.jsxs("span",{className:"text-foreground/80",children:[r.zip," · ",r.label]}),c.jsx("span",{className:"tabular-nums text-foreground",children:bv(r.median_price)})]},r.zip))})]})]})}function wbt(){const[e,t]=k.useState(null),[n,r]=k.useState(!0);return k.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}},[]),c.jsxs("div",{className:"bg-card border border-border p-5",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium",children:"Today's Mortgage Rates"}),e&&c.jsxs("span",{className:"text-[9px] uppercase tracking-[0.2em] text-muted-foreground/60",children:[e.source," · ",new Date(e.fetched_at).toLocaleDateString()]})]}),n||!e?c.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading rates…"}):c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[c.jsx(Nx,{label:"30-Yr Fixed",v:e.rates.thirty_year_fixed}),c.jsx(Nx,{label:"15-Yr Fixed",v:e.rates.fifteen_year_fixed}),e.rates.seven_one_arm!==void 0&&c.jsx(Nx,{label:"7/1 ARM",v:e.rates.seven_one_arm}),e.rates.fha_thirty!==void 0&&c.jsx(Nx,{label:"FHA 30",v:e.rates.fha_thirty}),e.rates.va_thirty!==void 0&&c.jsx(Nx,{label:"VA 30",v:e.rates.va_thirty})]}),c.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 Nx=({label:e,v:t})=>c.jsxs("div",{className:"border border-border p-3",children:[c.jsx("div",{className:"text-[9px] uppercase tracking-[0.2em] text-muted-foreground mb-1",children:e}),c.jsxs("div",{className:"text-xl font-bold tabular-nums",children:[t.toFixed(3),"%"]})]});function Tge(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 bbt(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??Tge(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 Ou=e=>e===""||e==="-"?0:Number(e)||0;function Cbt({defaultPrice:e}){const[t,n]=k.useState(String(e||35e4)),[r,i]=k.useState("180000"),[s,a]=k.useState("3"),[o,l]=k.useState("3"),[u,d]=k.useState("0"),[h,f]=k.useState("1500"),[A,p]=k.useState("400"),[m,g]=k.useState("75"),[y,v]=k.useState(""),x=k.useMemo(()=>bbt({salePrice:Ou(t),mortgagePayoff:Ou(r),listingCommissionPct:Ou(s),buyerAgentCommissionPct:Ou(o),sellerConcessions:Ou(u),proratedTax:Ou(h),settlementFee:Ou(A),recordingFee:Ou(m),titleInsuranceOverride:y?Number(y):void 0}),[t,r,s,o,u,h,A,m,y]);return c.jsxs("div",{className:"bg-card border border-border p-5",children:[c.jsxs("div",{className:"flex items-baseline justify-between mb-4",children:[c.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium",children:"Michigan Seller Net Sheet"}),c.jsx("span",{className:"text-[9px] uppercase tracking-[0.2em] text-muted-foreground/60",children:"Estimate"})]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[c.jsxs("div",{className:"space-y-3",children:[c.jsx(th,{label:"Sale Price",value:t,setValue:n,prefix:"$"}),c.jsx(th,{label:"Mortgage Payoff",value:r,setValue:i,prefix:"$"}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsx(th,{label:"Listing Comm. %",value:s,setValue:a,step:.25}),c.jsx(th,{label:"Buyer Agent %",value:o,setValue:l,step:.25})]}),c.jsx(th,{label:"Seller Concessions",value:u,setValue:d,prefix:"$"}),c.jsx(th,{label:"Prorated Property Tax",value:h,setValue:f,prefix:"$"}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsx(th,{label:"Settlement Fee",value:A,setValue:p,prefix:"$"}),c.jsx(th,{label:"Recording Fee",value:m,setValue:g,prefix:"$"})]}),c.jsxs("div",{children:[c.jsxs("label",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground block mb-1",children:["Title Insurance Override ",c.jsxs("span",{className:"text-muted-foreground/50",children:["(default ",bv(Tge(Ou(t))),")"]})]}),c.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"})]})]}),c.jsxs("div",{className:"bg-muted/40 border border-border p-4 space-y-2 text-sm",children:[c.jsx(Qo,{label:"Sale Price",v:x.salePrice,bold:!0}),c.jsx(jX,{}),c.jsx(Qo,{label:`Listing Commission (${s}%)`,v:-x.listingCommission}),c.jsx(Qo,{label:`Buyer Agent (${o}%)`,v:-x.buyerAgentCommission}),c.jsx(Qo,{label:"MI State Transfer Tax (0.75%)",v:-x.stateTransferTax}),c.jsx(Qo,{label:"Kent County Transfer Tax (0.11%)",v:-x.countyTransferTax}),c.jsx(Qo,{label:"Title Insurance (owner's)",v:-x.titleInsurance}),c.jsx(Qo,{label:"Settlement Fee",v:-x.settlementFee}),c.jsx(Qo,{label:"Recording / Deed Prep",v:-x.recordingFee}),c.jsx(Qo,{label:"Prorated Property Tax",v:-x.proratedTax}),x.sellerConcessions>0&&c.jsx(Qo,{label:"Seller Concessions",v:-x.sellerConcessions}),c.jsx(Qo,{label:"Mortgage Payoff",v:-x.mortgagePayoff}),c.jsx(jX,{}),c.jsx(Qo,{label:"Estimated Net Proceeds",v:x.estimatedNet,bold:!0,highlight:!0}),c.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 th=({label:e,value:t,setValue:n,prefix:r,step:i})=>c.jsxs("div",{children:[c.jsx("label",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground block mb-1",children:e}),c.jsxs("div",{className:"relative",children:[r&&c.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:r}),c.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"}`})]})]}),Qo=({label:e,v:t,bold:n,highlight:r})=>c.jsxs("div",{className:`flex items-center justify-between ${n?"font-bold":""} ${r?"text-lg pt-1":""}`,children:[c.jsx("span",{className:r?"text-foreground":"text-foreground/80",children:e}),c.jsx("span",{className:`tabular-nums ${t<0?"text-foreground/70":"text-foreground"}`,children:bv(t)})]}),jX=()=>c.jsx("div",{className:"h-px bg-border my-1"}),lg=e=>e===""||e==="-"||e==="."?0:Number(e)||0;function Sbt({defaultPrice:e}){const[t,n]=k.useState(String(e||325e3)),[r,i]=k.useState("10"),[s,a]=k.useState("6.875"),[o,l]=k.useState(30),[u,d]=k.useState("1.45"),[h,f]=k.useState("1400"),[A,p]=k.useState("0");k.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=k.useMemo(()=>mbt({homePrice:lg(t),downPaymentPct:lg(r),ratePct:lg(s),termYears:o,propertyTaxRatePct:lg(u),annualInsurance:lg(h),monthlyHoa:lg(A)}),[t,r,s,o,u,h,A]),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 c.jsxs("div",{className:"bg-card border border-border p-5",children:[c.jsxs("div",{className:"flex items-baseline justify-between mb-4",children:[c.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium",children:"PITI + PMI Mortgage Calculator"}),c.jsx("span",{className:"text-[9px] uppercase tracking-[0.2em] text-muted-foreground/60",children:"Estimate"})]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[c.jsxs("div",{className:"space-y-3",children:[c.jsx(cg,{label:"Home Price",v:t,set:n,prefix:"$"}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsx(cg,{label:"Down Payment %",v:r,set:i,step:.5}),c.jsx(cg,{label:"Rate %",v:s,set:a,step:.125})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground block mb-1",children:"Term"}),c.jsxs("select",{value:o,onChange:y=>l(Number(y.target.value)),className:"w-full bg-background border border-border px-3 py-2 text-sm",children:[c.jsx("option",{value:30,children:"30 years"}),c.jsx("option",{value:15,children:"15 years"})]})]}),c.jsx(cg,{label:"Property Tax %",v:u,set:d,step:.05})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsx(cg,{label:"Annual Insurance",v:h,set:f,prefix:"$"}),c.jsx(cg,{label:"Monthly HOA",v:A,set:p,prefix:"$"})]}),m.pmiRatePct>0&&c.jsxs("p",{className:"text-[11px] text-muted-foreground bg-muted/40 border border-border p-2",children:["Down payment under 20% — PMI applied at ",c.jsxs("strong",{children:[m.pmiRatePct.toFixed(2),"%/yr"]}),"."]})]}),c.jsxs("div",{className:"bg-muted/40 border border-border p-4",children:[c.jsx("div",{className:"text-[9px] uppercase tracking-[0.2em] text-muted-foreground mb-2",children:"Estimated Monthly Payment"}),c.jsx("div",{className:"text-4xl font-bold tabular-nums mb-4",children:NX(m.monthlyTotal)}),c.jsxs("div",{className:"space-y-1.5 text-sm mb-4",children:[c.jsx(Sf,{label:"Principal & Interest",v:m.monthlyPI}),c.jsx(Sf,{label:"Property Tax",v:m.monthlyTax}),c.jsx(Sf,{label:"Insurance",v:m.monthlyInsurance}),m.monthlyPmi>0&&c.jsx(Sf,{label:"PMI",v:m.monthlyPmi}),m.monthlyHoa>0&&c.jsx(Sf,{label:"HOA",v:m.monthlyHoa})]}),c.jsx("div",{className:"flex h-3 overflow-hidden border border-border",children:g.map(y=>c.jsx("div",{title:`${y.key}: ${NX(y.v)}`,style:{width:`${y.v/m.monthlyTotal*100}%`,background:y.color}},y.key))}),c.jsx("div",{className:"flex flex-wrap gap-x-3 gap-y-1 mt-2 text-[10px] uppercase tracking-[0.15em]",children:g.map(y=>c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"w-2 h-2",style:{background:y.color}}),c.jsx("span",{className:"text-muted-foreground",children:y.key})]},y.key))}),c.jsxs("div",{className:"mt-4 pt-3 border-t border-border text-sm space-y-1",children:[c.jsx(Sf,{label:"Down Payment",v:m.downPayment}),c.jsx(Sf,{label:"Loan Amount",v:m.loanAmount})]})]})]})]})}const cg=({label:e,v:t,set:n,prefix:r,step:i})=>c.jsxs("div",{children:[c.jsx("label",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground block mb-1",children:e}),c.jsxs("div",{className:"relative",children:[r&&c.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:r}),c.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"}`})]})]}),Sf=({label:e,v:t})=>c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-foreground/80",children:e}),c.jsx("span",{className:"tabular-nums",children:bv(t)})]});function kbt({md:e,area:t}){return c.jsxs("div",{className:"bg-card border border-border p-6",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[c.jsx("img",{src:jae,alt:"Holden Richardson",className:"w-12 h-12 rounded-full object-cover object-top border border-border"}),c.jsxs("div",{children:[c.jsx("div",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground",children:"Holden's Take"}),c.jsxs("div",{className:"text-sm font-medium",children:["On ",t]})]})]}),c.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:c.jsx(w6,{children:e})})]})}const Bbt=[{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."}],_bt=[{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 Ebt({lens:e}){const t=e==="seller"?Bbt:_bt;return c.jsxs("div",{className:"bg-card border border-border p-6",children:[c.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"]}),c.jsxs("p",{className:"text-sm text-foreground/80 mb-5",children:["Here's how I work with ",e==="seller"?"sellers":"buyers"," — start to close."]}),c.jsx("ol",{className:"space-y-4",children:t.map((n,r)=>c.jsxs("li",{className:"flex gap-3",children:[c.jsx("div",{className:"shrink-0 w-7 h-7 border border-border flex items-center justify-center text-xs font-bold text-foreground",children:r+1}),c.jsxs("div",{children:[c.jsxs("div",{className:"text-sm font-semibold flex items-center gap-2",children:[c.jsx(z0,{size:14,className:"text-foreground/70"})," ",n.t]}),c.jsx("p",{className:"text-sm text-foreground/75 mt-0.5",children:n.d})]})]},n.t))}),c.jsxs("div",{className:"mt-6 flex flex-wrap gap-3",children:[c.jsx(Ct,{to:"/contact",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"}),c.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 Nbt(){return c.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:c.jsxs("div",{className:"container-page py-3 flex items-center justify-between gap-3",children:[c.jsx("div",{className:"hidden md:block text-[11px] uppercase tracking-[0.2em] text-primary-foreground/80",children:"Questions about this report?"}),c.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[c.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:[c.jsx($B,{size:14})," Text"]}),c.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:[c.jsx(gp,{size:14})," Call"]}),c.jsxs(Ct,{to:"/contact",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:[c.jsx(ll,{size:14})," Book"]})]})]})})}const jbt="modulepreload",Tbt=function(e){return"/"+e},TX={},aB=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(l=>{if(l=Tbt(l),l in TX)return;TX[l]=!0;const u=l.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":jbt,u||(h.as="script"),h.crossOrigin="",h.href=l,o&&h.setAttribute("nonce",o),document.head.appendChild(h),u)return new Promise((f,A)=>{h.addEventListener("load",f),h.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${l}`)))})}))}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 Qn(e){"@babel/helpers - typeof";return Qn=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},Qn(e)}var fc=Uint8Array,xo=Uint16Array,$H=Int32Array,zH=new fc([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]),VH=new fc([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]),PX=new fc([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Pge=function(e,t){for(var n=new xo(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new $H(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}},Ige=Pge(zH,2),Pbt=Ige.b,XL=Ige.r;Pbt[28]=258,XL[258]=28;var Ibt=Pge(VH,0),IX=Ibt.r,JL=new xo(32768);for(var wr=0;wr<32768;++wr){var nh=(wr&43690)>>1|(wr&21845)<<1;nh=(nh&52428)>>2|(nh&13107)<<2,nh=(nh&61680)>>4|(nh&3855)<<4,JL[wr]=((nh&65280)>>8|(nh&255)<<8)>>1}var qw=function(e,t,n){for(var r=e.length,i=0,s=new xo(t);i<r;++i)e[i]&&++s[e[i]-1];var a=new xo(t);for(i=1;i<t;++i)a[i]=a[i-1]+s[i-1]<<1;var o;if(n){o=new xo(1<<t);var l=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,f=h|(1<<d)-1;h<=f;++h)o[JL[h]>>l]=u}else for(o=new xo(r),i=0;i<r;++i)e[i]&&(o[i]=JL[a[e[i]-1]++]>>15-e[i]);return o},tm=new fc(288);for(var wr=0;wr<144;++wr)tm[wr]=8;for(var wr=144;wr<256;++wr)tm[wr]=9;for(var wr=256;wr<280;++wr)tm[wr]=7;for(var wr=280;wr<288;++wr)tm[wr]=8;var fN=new fc(32);for(var wr=0;wr<32;++wr)fN[wr]=5;var Obt=qw(tm,9,0),Fbt=qw(fN,5,0),Oge=function(e){return(e+7)/8|0},Mbt=function(e,t,n){return(n==null||n>e.length)&&(n=e.length),new fc(e.subarray(t,n))},Fu=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},jx=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},k4=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:Mge,l:0};if(i==1){var a=new fc(n[0].s+1);return a[n[0].s]=1,{t:a,l:1}}n.sort(function(w,S){return w.f-S.f}),n.push({s:-1,f:25001});var o=n[0],l=n[1],u=0,d=1,h=2;for(n[0]={s:-1,f:o.f+l.f,l:o,r:l};d!=i-1;)o=n[n[u].f<n[h].f?u++:h++],l=n[u!=d&&n[u].f<n[h].f?u++:h++],n[d++]={s:-1,f:o.f+l.f,l:o,r:l};for(var f=s[0].s,r=1;r<i;++r)s[r].s>f&&(f=s[r].s);var A=new xo(f+1),p=ZL(n[d-1],A,0);if(p>t){var r=0,m=0,g=p-t,y=1<<g;for(s.sort(function(S,_){return A[_.s]-A[S.s]||S.f-_.f});r<i;++r){var v=s[r].s;if(A[v]>t)m+=y-(1<<p-A[v]),A[v]=t;else break}for(m>>=g;m>0;){var x=s[r].s;A[x]<t?m-=1<<t-A[x]++-1:++r}for(;r>=0&&m;--r){var b=s[r].s;A[b]==t&&(--A[b],++m)}p=t}return{t:new fc(A),l:p}},ZL=function(e,t,n){return e.s==-1?Math.max(ZL(e.l,t,n+1),ZL(e.r,t,n+1)):t[e.s]=n},OX=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new xo(++t),r=0,i=e[0],s=1,a=function(l){n[r++]=l},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}},Tx=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Fge=function(e,t,n){var r=n.length,i=Oge(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},FX=function(e,t,n,r,i,s,a,o,l,u,d){Fu(t,d++,n),++i[256];for(var h=k4(i,15),f=h.t,A=h.l,p=k4(s,15),m=p.t,g=p.l,y=OX(f),v=y.c,x=y.n,b=OX(m),w=b.c,S=b.n,_=new xo(19),E=0;E<v.length;++E)++_[v[E]&31];for(var E=0;E<w.length;++E)++_[w[E]&31];for(var j=k4(_,7),I=j.t,T=j.l,N=19;N>4&&!I[PX[N-1]];--N);var F=u+5<<3,L=Tx(i,tm)+Tx(s,fN)+a,D=Tx(i,f)+Tx(s,m)+a+14+3*N+Tx(_,I)+2*_[16]+3*_[17]+7*_[18];if(l>=0&&F<=L&&F<=D)return Fge(t,d,e.subarray(l,l+u));var H,W,$,V;if(Fu(t,d,1+(D<L)),d+=2,D<L){H=qw(f,A,0),W=f,$=qw(m,g,0),V=m;var Q=qw(I,T,0);Fu(t,d,x-257),Fu(t,d+5,S-1),Fu(t,d+10,N-4),d+=14;for(var E=0;E<N;++E)Fu(t,d+3*E,I[PX[E]]);d+=3*N;for(var ce=[v,w],R=0;R<2;++R)for(var M=ce[R],E=0;E<M.length;++E){var Y=M[E]&31;Fu(t,d,Q[Y]),d+=I[Y],Y>15&&(Fu(t,d,M[E]>>5&127),d+=M[E]>>12)}}else H=Obt,W=tm,$=Fbt,V=fN;for(var E=0;E<o;++E){var X=r[E];if(X>255){var Y=X>>18&31;jx(t,d,H[Y+257]),d+=W[Y+257],Y>7&&(Fu(t,d,X>>23&31),d+=zH[Y]);var K=X&31;jx(t,d,$[K]),d+=V[K],K>3&&(jx(t,d,X>>5&8191),d+=VH[K])}else jx(t,d,H[X]),d+=W[X]}return jx(t,d,H[256]),d+W[256]},Lbt=new $H([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Mge=new fc(0),Rbt=function(e,t,n,r,i,s){var a=s.z||e.length,o=new fc(r+a+5*(1+Math.ceil(a/7e3))+i),l=o.subarray(r,o.length-i),u=s.l,d=(s.r||0)&7;if(t){d&&(l[0]=s.r>>3);for(var h=Lbt[t-1],f=h>>13,A=h&8191,p=(1<<n)-1,m=s.p||new xo(32768),g=s.h||new xo(p+1),y=Math.ceil(n/3),v=2*y,x=function(Fe){return(e[Fe]^e[Fe+1]<<y^e[Fe+2]<<v)&p},b=new $H(25e3),w=new xo(288),S=new xo(32),_=0,E=0,j=s.i||0,I=0,T=s.w||0,N=0;j+2<a;++j){var F=x(j),L=j&32767,D=g[F];if(m[L]=D,g[F]=L,T<=j){var H=a-j;if((_>7e3||I>24576)&&(H>423||!u)){d=FX(e,l,0,b,w,S,E,I,N,j-N,d),I=_=E=0,N=j;for(var W=0;W<286;++W)w[W]=0;for(var W=0;W<30;++W)S[W]=0}var $=2,V=0,Q=A,ce=L-D&32767;if(H>2&&F==x(j-ce))for(var R=Math.min(f,H)-1,M=Math.min(32767,j),Y=Math.min(258,H);ce<=M&&--Q&&L!=D;){if(e[j+$]==e[j+$-ce]){for(var X=0;X<Y&&e[j+X]==e[j+X-ce];++X);if(X>$){if($=X,V=ce,X>R)break;for(var K=Math.min(ce,X-2),Z=0,W=0;W<K;++W){var de=j-ce+W&32767,se=m[de],ie=de-se&32767;ie>Z&&(Z=ie,D=de)}}}L=D,D=m[L],ce+=L-D&32767}if(V){b[I++]=268435456|XL[$]<<18|IX[V];var he=XL[$]&31,ue=IX[V]&31;E+=zH[he]+VH[ue],++w[257+he],++S[ue],T=j+$,++_}else b[I++]=e[j],++w[e[j]]}}for(j=Math.max(j,T);j<a;++j)b[I++]=e[j],++w[e[j]];d=FX(e,l,u,b,w,S,E,I,N,j-N,d),u||(s.r=d&7|l[d/8|0]<<3,d-=7,s.h=g,s.p=m,s.i=j,s.w=T)}else{for(var j=s.w||0;j<a+u;j+=65535){var Se=j+65535;Se>=a&&(l[d/8|0]=u,Se=a),d=Fge(l,d+1,e.subarray(j,Se))}s.i=a}return Mbt(o,0,r+Oge(d)+i)},Lge=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}}},Ubt=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),a=new fc(s.length+e.length);a.set(s),a.set(e,s.length),e=a,i.w=s.length}return Rbt(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)},Rge=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Dbt=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=Lge();i.p(t.dictionary),Rge(e,2,i.d())}};function eR(e,t){t||(t={});var n=Lge();n.p(e);var r=Ubt(e,t,t.dictionary?6:2,4);return Dbt(r,t),Rge(r,r.length-4,n.d()),r}var Qbt=typeof TextDecoder<"u"&&new TextDecoder,Hbt=0;try{Qbt.decode(Mge,{stream:!0}),Hbt=1}catch{}function $bt(e){if(Array.isArray(e))return e}function zbt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function MX(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 Vbt(e,t){if(e){if(typeof e=="string")return MX(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)?MX(e,t):void 0}}function Kbt(){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 LX(e,t){return $bt(e)||zbt(e,t)||Vbt(e,t)||Kbt()}function RX(e,t="utf8"){return new TextDecoder(t).decode(e)}const qbt=new TextEncoder;function Wbt(e){return qbt.encode(e)}const Gbt=1024*8,Ybt=(()=>{const e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),B4={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 KH{constructor(t=Gbt,n={}){dn(this,"buffer");dn(this,"byteLength");dn(this,"byteOffset");dn(this,"length");dn(this,"offset");dn(this,"lastWrittenByte");dn(this,"littleEndian");dn(this,"_data");dn(this,"_mark");dn(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 KH)&&(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=B4[n].BYTES_PER_ELEMENT*t,i=this.byteOffset+this.offset,s=this.buffer.slice(i,i+r);if(this.littleEndian===Ybt&&n!=="uint8"&&n!=="int8"){const o=new Uint8Array(this.buffer.slice(i,i+r));o.reverse();const l=new B4[n](o.buffer);return this.offset+=r,l.reverse(),l}const a=new B4[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 RX(this.readBytes(t))}decodeText(t=1,n="utf8"){return RX(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(Wbt(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 Xbt=4,UX=0,DX=1,Jbt=2;function Cv(e){let t=e.length;for(;--t>=0;)e[t]=0}const Zbt=0,Uge=1,e1t=2,t1t=3,n1t=258,qH=29,U2=256,D1=U2+1+qH,By=30,WH=19,Dge=2*D1+1,tp=15,_4=16,r1t=7,GH=256,Qge=16,Hge=17,$ge=18,tR=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]),oB=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]),i1t=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),zge=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s1t=512,Vu=new Array((D1+2)*2);Cv(Vu);const Ww=new Array(By*2);Cv(Ww);const Q1=new Array(s1t);Cv(Q1);const H1=new Array(n1t-t1t+1);Cv(H1);const YH=new Array(qH);Cv(YH);const pN=new Array(By);Cv(pN);function E4(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 Vge,Kge,qge;function N4(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const Wge=e=>e<256?Q1[e]:Q1[256+(e>>>7)],$1=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},Ha=(e,t,n)=>{e.bi_valid>_4-n?(e.bi_buf|=t<<e.bi_valid&65535,$1(e,e.bi_buf),e.bi_buf=t>>_4-e.bi_valid,e.bi_valid+=n-_4):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},zc=(e,t,n)=>{Ha(e,n[t*2],n[t*2+1])},Gge=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},a1t=e=>{e.bi_valid===16?($1(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)},o1t=(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,l=t.stat_desc.max_length;let u,d,h,f,A,p,m=0;for(f=0;f<=tp;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,u=e.heap_max+1;u<Dge;u++)d=e.heap[u],f=n[n[d*2+1]*2+1]+1,f>l&&(f=l,m++),n[d*2+1]=f,!(d>r)&&(e.bl_count[f]++,A=0,d>=o&&(A=a[d-o]),p=n[d*2],e.opt_len+=p*(f+A),s&&(e.static_len+=p*(i[d*2+1]+A)));if(m!==0){do{for(f=l-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[l]--,m-=2}while(m>0);for(f=l;f!==0;f--)for(d=e.bl_count[f];d!==0;)h=e.heap[--u],!(h>r)&&(n[h*2+1]!==f&&(e.opt_len+=(f-n[h*2+1])*n[h*2],n[h*2+1]=f),d--)}},Yge=(e,t,n)=>{const r=new Array(tp+1);let i=0,s,a;for(s=1;s<=tp;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]=Gge(r[o]++,o))}},l1t=()=>{let e,t,n,r,i;const s=new Array(tp+1);for(n=0,r=0;r<qH-1;r++)for(YH[r]=n,e=0;e<1<<tR[r];e++)H1[n++]=r;for(H1[n-1]=r,i=0,r=0;r<16;r++)for(pN[r]=i,e=0;e<1<<oB[r];e++)Q1[i++]=r;for(i>>=7;r<By;r++)for(pN[r]=i<<7,e=0;e<1<<oB[r]-7;e++)Q1[256+i++]=r;for(t=0;t<=tp;t++)s[t]=0;for(e=0;e<=143;)Vu[e*2+1]=8,e++,s[8]++;for(;e<=255;)Vu[e*2+1]=9,e++,s[9]++;for(;e<=279;)Vu[e*2+1]=7,e++,s[7]++;for(;e<=287;)Vu[e*2+1]=8,e++,s[8]++;for(Yge(Vu,D1+1,s),e=0;e<By;e++)Ww[e*2+1]=5,Ww[e*2]=Gge(e,5);Vge=new E4(Vu,tR,U2+1,D1,tp),Kge=new E4(Ww,oB,0,By,tp),qge=new E4(new Array(0),i1t,0,WH,r1t)},Xge=e=>{let t;for(t=0;t<D1;t++)e.dyn_ltree[t*2]=0;for(t=0;t<By;t++)e.dyn_dtree[t*2]=0;for(t=0;t<WH;t++)e.bl_tree[t*2]=0;e.dyn_ltree[GH*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Jge=e=>{e.bi_valid>8?$1(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},QX=(e,t,n,r)=>{const i=t*2,s=n*2;return e[i]<e[s]||e[i]===e[s]&&r[t]<=r[n]},j4=(e,t,n)=>{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&QX(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!QX(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},HX=(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?zc(e,i,t):(a=H1[i],zc(e,a+U2+1,t),o=tR[a],o!==0&&(i-=YH[a],Ha(e,i,o)),r--,a=Wge(r),zc(e,a,n),o=oB[a],o!==0&&(r-=pN[a],Ha(e,r,o)));while(s<e.sym_next);zc(e,GH,t)},nR=(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,l=-1,u;for(e.heap_len=0,e.heap_max=Dge,a=0;a<s;a++)n[a*2]!==0?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):n[a*2+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=l<2?++l:0,n[u*2]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=r[u*2+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)j4(e,n,a);u=s;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],j4(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++,j4(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],o1t(e,t),Yge(n,l,e.bl_count)},$X=(e,t,n)=>{let r,i=-1,s,a=t[0*2+1],o=0,l=7,u=4;for(a===0&&(l=138,u=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)s=a,a=t[(r+1)*2+1],!(++o<l&&s===a)&&(o<u?e.bl_tree[s*2]+=o:s!==0?(s!==i&&e.bl_tree[s*2]++,e.bl_tree[Qge*2]++):o<=10?e.bl_tree[Hge*2]++:e.bl_tree[$ge*2]++,o=0,i=s,a===0?(l=138,u=3):s===a?(l=6,u=3):(l=7,u=4))},zX=(e,t,n)=>{let r,i=-1,s,a=t[0*2+1],o=0,l=7,u=4;for(a===0&&(l=138,u=3),r=0;r<=n;r++)if(s=a,a=t[(r+1)*2+1],!(++o<l&&s===a)){if(o<u)do zc(e,s,e.bl_tree);while(--o!==0);else s!==0?(s!==i&&(zc(e,s,e.bl_tree),o--),zc(e,Qge,e.bl_tree),Ha(e,o-3,2)):o<=10?(zc(e,Hge,e.bl_tree),Ha(e,o-3,3)):(zc(e,$ge,e.bl_tree),Ha(e,o-11,7));o=0,i=s,a===0?(l=138,u=3):s===a?(l=6,u=3):(l=7,u=4)}},c1t=e=>{let t;for($X(e,e.dyn_ltree,e.l_desc.max_code),$X(e,e.dyn_dtree,e.d_desc.max_code),nR(e,e.bl_desc),t=WH-1;t>=3&&e.bl_tree[zge[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},u1t=(e,t,n,r)=>{let i;for(Ha(e,t-257,5),Ha(e,n-1,5),Ha(e,r-4,4),i=0;i<r;i++)Ha(e,e.bl_tree[zge[i]*2+1],3);zX(e,e.dyn_ltree,t-1),zX(e,e.dyn_dtree,n-1)},d1t=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return UX;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return DX;for(n=32;n<U2;n++)if(e.dyn_ltree[n*2]!==0)return DX;return UX};let VX=!1;const h1t=e=>{VX||(l1t(),VX=!0),e.l_desc=new N4(e.dyn_ltree,Vge),e.d_desc=new N4(e.dyn_dtree,Kge),e.bl_desc=new N4(e.bl_tree,qge),e.bi_buf=0,e.bi_valid=0,Xge(e)},Zge=(e,t,n,r)=>{Ha(e,(Zbt<<1)+(r?1:0),3),Jge(e),$1(e,n),$1(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},A1t=e=>{Ha(e,Uge<<1,3),zc(e,GH,Vu),a1t(e)},f1t=(e,t,n,r)=>{let i,s,a=0;e.level>0?(e.strm.data_type===Jbt&&(e.strm.data_type=d1t(e)),nR(e,e.l_desc),nR(e,e.d_desc),a=c1t(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?Zge(e,t,n,r):e.strategy===Xbt||s===i?(Ha(e,(Uge<<1)+(r?1:0),3),HX(e,Vu,Ww)):(Ha(e,(e1t<<1)+(r?1:0),3),u1t(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),HX(e,e.dyn_ltree,e.dyn_dtree)),Xge(e),r&&Jge(e)},p1t=(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[(H1[n]+U2+1)*2]++,e.dyn_dtree[Wge(t)*2]++),e.sym_next===e.sym_end);var m1t=h1t,g1t=Zge,y1t=f1t,v1t=p1t,x1t=A1t,w1t={_tr_init:m1t,_tr_stored_block:g1t,_tr_flush_block:y1t,_tr_tally:v1t,_tr_align:x1t};const b1t=(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 z1=b1t;const C1t=()=>{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},S1t=new Uint32Array(C1t()),k1t=(e,t,n,r)=>{const i=S1t,s=r+n;e^=-1;for(let a=r;a<s;a++)e=e>>>8^i[(e^t[a])&255];return e^-1};var Vi=k1t,M0={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"},D2={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:B1t,_tr_stored_block:rR,_tr_flush_block:_1t,_tr_tally:fA,_tr_align:E1t}=w1t,{Z_NO_FLUSH:pA,Z_PARTIAL_FLUSH:N1t,Z_FULL_FLUSH:j1t,Z_FINISH:tl,Z_BLOCK:KX,Z_OK:As,Z_STREAM_END:qX,Z_STREAM_ERROR:iu,Z_DATA_ERROR:T1t,Z_BUF_ERROR:T4,Z_DEFAULT_COMPRESSION:P1t,Z_FILTERED:I1t,Z_HUFFMAN_ONLY:zS,Z_RLE:O1t,Z_FIXED:F1t,Z_DEFAULT_STRATEGY:M1t,Z_UNKNOWN:L1t,Z_DEFLATED:W5}=D2,R1t=9,U1t=15,D1t=8,Q1t=29,H1t=256,iR=H1t+1+Q1t,$1t=30,z1t=19,V1t=2*iR+1,K1t=15,yn=3,zh=258,su=zh+yn+1,q1t=32,L0=42,XH=57,sR=69,aR=73,oR=91,lR=103,np=113,Zx=666,pa=1,Sv=2,nm=3,kv=4,W1t=3,rp=(e,t)=>(e.msg=M0[t],t),WX=e=>e*2-(e>4?9:0),Sh=e=>{let t=e.length;for(;--t>=0;)e[t]=0},G1t=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 Y1t=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,mA=Y1t;const Ao=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))},wo=(e,t)=>{_1t(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ao(e.strm)},In=(e,t)=>{e.pending_buf[e.pending++]=t},Px=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},cR=(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=z1(e.adler,t,i,n):e.state.wrap===2&&(e.adler=Vi(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},eye=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,s,a=e.prev_length,o=e.nice_match;const l=e.strstart>e.w_size-su?e.strstart-(e.w_size-su):0,u=e.window,d=e.w_mask,h=e.prev,f=e.strstart+zh;let A=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]!==A||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<f);if(s=zh-(f-r),r=f-zh,s>a){if(e.match_start=t,a=s,s>=o)break;A=u[r+a-1],p=u[r+a]}}while((t=h[t&d])>l&&--n!==0);return a<=e.lookahead?a:e.lookahead},R0=e=>{const t=e.w_size;let n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-su)&&(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),G1t(e),r+=t),e.strm.avail_in===0)break;if(n=cR(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=yn)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=mA(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=mA(e,e.ins_h,e.window[i+yn-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<yn)););}while(e.lookahead<su&&e.strm.avail_in!==0)},tye=(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!==tl||t===pA||r!==i+e.strm.avail_in)))break;a=t===tl&&r===i+e.strm.avail_in?1:0,rR(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,Ao(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&&(cR(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?kv:t!==pA&&t!==tl&&e.strm.avail_in===0&&e.strstart===e.block_start?Sv:(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&&(cR(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===tl)&&t!==pA&&e.strm.avail_in===0&&i<=s)&&(r=i>s?s:i,a=t===tl&&e.strm.avail_in===0&&r===i?1:0,rR(e,e.block_start,r,a),e.block_start+=r,Ao(e.strm)),a?nm:pa)},P4=(e,t)=>{let n,r;for(;;){if(e.lookahead<su){if(R0(e),e.lookahead<su&&t===pA)return pa;if(e.lookahead===0)break}if(n=0,e.lookahead>=yn&&(e.ins_h=mA(e,e.ins_h,e.window[e.strstart+yn-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-su&&(e.match_length=eye(e,n)),e.match_length>=yn)if(r=fA(e,e.strstart-e.match_start,e.match_length-yn),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=yn){e.match_length--;do e.strstart++,e.ins_h=mA(e,e.ins_h,e.window[e.strstart+yn-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=mA(e,e.ins_h,e.window[e.strstart+1]);else r=fA(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(wo(e,!1),e.strm.avail_out===0))return pa}return e.insert=e.strstart<yn-1?e.strstart:yn-1,t===tl?(wo(e,!0),e.strm.avail_out===0?nm:kv):e.sym_next&&(wo(e,!1),e.strm.avail_out===0)?pa:Sv},ug=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<su){if(R0(e),e.lookahead<su&&t===pA)return pa;if(e.lookahead===0)break}if(n=0,e.lookahead>=yn&&(e.ins_h=mA(e,e.ins_h,e.window[e.strstart+yn-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=yn-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-su&&(e.match_length=eye(e,n),e.match_length<=5&&(e.strategy===I1t||e.match_length===yn&&e.strstart-e.match_start>4096)&&(e.match_length=yn-1)),e.prev_length>=yn&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-yn,r=fA(e,e.strstart-1-e.prev_match,e.prev_length-yn),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=mA(e,e.ins_h,e.window[e.strstart+yn-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=yn-1,e.strstart++,r&&(wo(e,!1),e.strm.avail_out===0))return pa}else if(e.match_available){if(r=fA(e,0,e.window[e.strstart-1]),r&&wo(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return pa}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=fA(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<yn-1?e.strstart:yn-1,t===tl?(wo(e,!0),e.strm.avail_out===0?nm:kv):e.sym_next&&(wo(e,!1),e.strm.avail_out===0)?pa:Sv},X1t=(e,t)=>{let n,r,i,s;const a=e.window;for(;;){if(e.lookahead<=zh){if(R0(e),e.lookahead<=zh&&t===pA)return pa;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=yn&&e.strstart>0&&(i=e.strstart-1,r=a[i],r===a[++i]&&r===a[++i]&&r===a[++i])){s=e.strstart+zh;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=zh-(s-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=yn?(n=fA(e,1,e.match_length-yn),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=fA(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(wo(e,!1),e.strm.avail_out===0))return pa}return e.insert=0,t===tl?(wo(e,!0),e.strm.avail_out===0?nm:kv):e.sym_next&&(wo(e,!1),e.strm.avail_out===0)?pa:Sv},J1t=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(R0(e),e.lookahead===0)){if(t===pA)return pa;break}if(e.match_length=0,n=fA(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(wo(e,!1),e.strm.avail_out===0))return pa}return e.insert=0,t===tl?(wo(e,!0),e.strm.avail_out===0?nm:kv):e.sym_next&&(wo(e,!1),e.strm.avail_out===0)?pa:Sv};function Pc(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 ew=[new Pc(0,0,0,0,tye),new Pc(4,4,8,4,P4),new Pc(4,5,16,8,P4),new Pc(4,6,32,32,P4),new Pc(4,4,16,16,ug),new Pc(8,16,32,32,ug),new Pc(8,16,128,128,ug),new Pc(8,32,128,256,ug),new Pc(32,128,258,1024,ug),new Pc(32,258,258,4096,ug)],Z1t=e=>{e.window_size=2*e.w_size,Sh(e.head),e.max_lazy_match=ew[e.level].max_lazy,e.good_match=ew[e.level].good_length,e.nice_match=ew[e.level].nice_length,e.max_chain_length=ew[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=yn-1,e.match_available=0,e.ins_h=0};function e2t(){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=W5,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(V1t*2),this.dyn_dtree=new Uint16Array((2*$1t+1)*2),this.bl_tree=new Uint16Array((2*z1t+1)*2),Sh(this.dyn_ltree),Sh(this.dyn_dtree),Sh(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(K1t+1),this.heap=new Uint16Array(2*iR+1),Sh(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*iR+1),Sh(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 Q2=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==L0&&t.status!==XH&&t.status!==sR&&t.status!==aR&&t.status!==oR&&t.status!==lR&&t.status!==np&&t.status!==Zx?1:0},nye=e=>{if(Q2(e))return rp(e,iu);e.total_in=e.total_out=0,e.data_type=L1t;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?XH:t.wrap?L0:np,e.adler=t.wrap===2?0:1,t.last_flush=-2,B1t(t),As},rye=e=>{const t=nye(e);return t===As&&Z1t(e.state),t},t2t=(e,t)=>Q2(e)||e.state.wrap!==2?iu:(e.state.gzhead=t,As),iye=(e,t,n,r,i,s)=>{if(!e)return iu;let a=1;if(t===P1t&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>R1t||n!==W5||r<8||r>15||t<0||t>9||s<0||s>F1t||r===8&&a!==1)return rp(e,iu);r===8&&(r=9);const o=new e2t;return e.state=o,o.strm=e,o.status=L0,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+yn-1)/yn),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,rye(e)},n2t=(e,t)=>iye(e,t,W5,U1t,D1t,M1t),r2t=(e,t)=>{if(Q2(e)||t>KX||t<0)return e?rp(e,iu):iu;const n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===Zx&&t!==tl)return rp(e,e.avail_out===0?T4:iu);const r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(Ao(e),e.avail_out===0)return n.last_flush=-1,As}else if(e.avail_in===0&&WX(t)<=WX(r)&&t!==tl)return rp(e,T4);if(n.status===Zx&&e.avail_in!==0)return rp(e,T4);if(n.status===L0&&n.wrap===0&&(n.status=np),n.status===L0){let i=W5+(n.w_bits-8<<4)<<8,s=-1;if(n.strategy>=zS||n.level<2?s=0:n.level<6?s=1:n.level===6?s=2:s=3,i|=s<<6,n.strstart!==0&&(i|=q1t),i+=31-i%31,Px(n,i),n.strstart!==0&&(Px(n,e.adler>>>16),Px(n,e.adler&65535)),e.adler=1,n.status=np,Ao(e),n.pending!==0)return n.last_flush=-1,As}if(n.status===XH){if(e.adler=0,In(n,31),In(n,139),In(n,8),n.gzhead)In(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)),In(n,n.gzhead.time&255),In(n,n.gzhead.time>>8&255),In(n,n.gzhead.time>>16&255),In(n,n.gzhead.time>>24&255),In(n,n.level===9?2:n.strategy>=zS||n.level<2?4:0),In(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(In(n,n.gzhead.extra.length&255),In(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Vi(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=sR;else if(In(n,0),In(n,0),In(n,0),In(n,0),In(n,0),In(n,n.level===9?2:n.strategy>=zS||n.level<2?4:0),In(n,W1t),n.status=np,Ao(e),n.pending!==0)return n.last_flush=-1,As}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=Vi(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=o,Ao(e),n.pending!==0)return n.last_flush=-1,As;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=Vi(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=aR}if(n.status===aR){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=Vi(e.adler,n.pending_buf,n.pending-i,i)),Ao(e),n.pending!==0)return n.last_flush=-1,As;i=0}n.gzindex<n.gzhead.name.length?s=n.gzhead.name.charCodeAt(n.gzindex++)&255:s=0,In(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=Vi(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=oR}if(n.status===oR){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=Vi(e.adler,n.pending_buf,n.pending-i,i)),Ao(e),n.pending!==0)return n.last_flush=-1,As;i=0}n.gzindex<n.gzhead.comment.length?s=n.gzhead.comment.charCodeAt(n.gzindex++)&255:s=0,In(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=Vi(e.adler,n.pending_buf,n.pending-i,i))}n.status=lR}if(n.status===lR){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Ao(e),n.pending!==0))return n.last_flush=-1,As;In(n,e.adler&255),In(n,e.adler>>8&255),e.adler=0}if(n.status=np,Ao(e),n.pending!==0)return n.last_flush=-1,As}if(e.avail_in!==0||n.lookahead!==0||t!==pA&&n.status!==Zx){let i=n.level===0?tye(n,t):n.strategy===zS?J1t(n,t):n.strategy===O1t?X1t(n,t):ew[n.level].func(n,t);if((i===nm||i===kv)&&(n.status=Zx),i===pa||i===nm)return e.avail_out===0&&(n.last_flush=-1),As;if(i===Sv&&(t===N1t?E1t(n):t!==KX&&(rR(n,0,0,!1),t===j1t&&(Sh(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Ao(e),e.avail_out===0))return n.last_flush=-1,As}return t!==tl?As:n.wrap<=0?qX:(n.wrap===2?(In(n,e.adler&255),In(n,e.adler>>8&255),In(n,e.adler>>16&255),In(n,e.adler>>24&255),In(n,e.total_in&255),In(n,e.total_in>>8&255),In(n,e.total_in>>16&255),In(n,e.total_in>>24&255)):(Px(n,e.adler>>>16),Px(n,e.adler&65535)),Ao(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?As:qX)},i2t=e=>{if(Q2(e))return iu;const t=e.state.status;return e.state=null,t===np?rp(e,T1t):As},s2t=(e,t)=>{let n=t.length;if(Q2(e))return iu;const r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==L0||r.lookahead)return iu;if(i===1&&(e.adler=z1(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(Sh(r.head),r.strstart=0,r.block_start=0,r.insert=0);let l=new Uint8Array(r.w_size);l.set(t.subarray(n-r.w_size,n),0),t=l,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,R0(r);r.lookahead>=yn;){let l=r.strstart,u=r.lookahead-(yn-1);do r.ins_h=mA(r,r.ins_h,r.window[l+yn-1]),r.prev[l&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=l,l++;while(--u);r.strstart=l,r.lookahead=yn-1,R0(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=yn-1,r.match_available=0,e.next_in=a,e.input=o,e.avail_in=s,r.wrap=i,As};var a2t=n2t,o2t=iye,l2t=rye,c2t=nye,u2t=t2t,d2t=r2t,h2t=i2t,A2t=s2t,f2t="pako deflate (from Nodeca project)",Gw={deflateInit:a2t,deflateInit2:o2t,deflateReset:l2t,deflateResetKeep:c2t,deflateSetHeader:u2t,deflate:d2t,deflateEnd:h2t,deflateSetDictionary:A2t,deflateInfo:f2t};const p2t=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var m2t=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)p2t(n,r)&&(e[r]=n[r])}}return e},g2t=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},G5={assign:m2t,flattenChunks:g2t};let sye=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{sye=!1}const V1=new Uint8Array(256);for(let e=0;e<256;e++)V1[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;V1[254]=V1[254]=1;var y2t=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 v2t=(e,t)=>{if(t<65534&&e.subarray&&sye)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 x2t=(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=V1[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 v2t(s,i)},w2t=(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+V1[e[n]]>t?n:t},K1={string2buf:y2t,buf2string:x2t,utf8border:w2t};function b2t(){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 aye=b2t;const oye=Object.prototype.toString,{Z_NO_FLUSH:C2t,Z_SYNC_FLUSH:S2t,Z_FULL_FLUSH:k2t,Z_FINISH:B2t,Z_OK:mN,Z_STREAM_END:_2t,Z_DEFAULT_COMPRESSION:E2t,Z_DEFAULT_STRATEGY:N2t,Z_DEFLATED:j2t}=D2;function JH(e){this.options=G5.assign({level:E2t,method:j2t,chunkSize:16384,windowBits:15,memLevel:8,strategy:N2t},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 aye,this.strm.avail_out=0;let n=Gw.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==mN)throw new Error(M0[n]);if(t.header&&Gw.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=K1.string2buf(t.dictionary):oye.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=Gw.deflateSetDictionary(this.strm,r),n!==mN)throw new Error(M0[n]);this._dict_set=!0}}JH.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?B2t:C2t,typeof e=="string"?n.input=K1.string2buf(e):oye.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===S2t||s===k2t)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=Gw.deflate(n,s),i===_2t)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=Gw.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===mN;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};JH.prototype.onData=function(e){this.chunks.push(e)};JH.prototype.onEnd=function(e){e===mN&&(this.result=G5.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const VS=16209,T2t=16191;var P2t=function(t,n){let r,i,s,a,o,l,u,d,h,f,A,p,m,g,y,v,x,b,w,S,_,E,j,I;const T=t.state;r=t.next_in,j=t.input,i=r+(t.avail_in-5),s=t.next_out,I=t.output,a=s-(n-t.avail_out),o=s+(t.avail_out-257),l=T.dmax,u=T.wsize,d=T.whave,h=T.wnext,f=T.window,A=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&&(A+=j[r++]<<p,p+=8,A+=j[r++]<<p,p+=8),x=m[A&y];t:for(;;){if(b=x>>>24,A>>>=b,p-=b,b=x>>>16&255,b===0)I[s++]=x&65535;else if(b&16){w=x&65535,b&=15,b&&(p<b&&(A+=j[r++]<<p,p+=8),w+=A&(1<<b)-1,A>>>=b,p-=b),p<15&&(A+=j[r++]<<p,p+=8,A+=j[r++]<<p,p+=8),x=g[A&v];n:for(;;){if(b=x>>>24,A>>>=b,p-=b,b=x>>>16&255,b&16){if(S=x&65535,b&=15,p<b&&(A+=j[r++]<<p,p+=8,p<b&&(A+=j[r++]<<p,p+=8)),S+=A&(1<<b)-1,S>l){t.msg="invalid distance too far back",T.mode=VS;break e}if(A>>>=b,p-=b,b=s-a,S>b){if(b=S-b,b>d&&T.sane){t.msg="invalid distance too far back",T.mode=VS;break e}if(_=0,E=f,h===0){if(_+=u-b,b<w){w-=b;do I[s++]=f[_++];while(--b);_=s-S,E=I}}else if(h<b){if(_+=u+h-b,b-=h,b<w){w-=b;do I[s++]=f[_++];while(--b);if(_=0,h<w){b=h,w-=b;do I[s++]=f[_++];while(--b);_=s-S,E=I}}}else if(_+=h-b,b<w){w-=b;do I[s++]=f[_++];while(--b);_=s-S,E=I}for(;w>2;)I[s++]=E[_++],I[s++]=E[_++],I[s++]=E[_++],w-=3;w&&(I[s++]=E[_++],w>1&&(I[s++]=E[_++]))}else{_=s-S;do I[s++]=I[_++],I[s++]=I[_++],I[s++]=I[_++],w-=3;while(w>2);w&&(I[s++]=I[_++],w>1&&(I[s++]=I[_++]))}}else if(b&64){t.msg="invalid distance code",T.mode=VS;break e}else{x=g[(x&65535)+(A&(1<<b)-1)];continue n}break}}else if(b&64)if(b&32){T.mode=T2t;break e}else{t.msg="invalid literal/length code",T.mode=VS;break e}else{x=m[(x&65535)+(A&(1<<b)-1)];continue t}break}}while(r<i&&s<o);w=p>>3,r-=w,p-=w<<3,A&=(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=A,T.bits=p};const dg=15,GX=852,YX=592,XX=0,I4=1,JX=2,I2t=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]),O2t=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]),F2t=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]),M2t=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]),L2t=(e,t,n,r,i,s,a,o)=>{const l=o.bits;let u=0,d=0,h=0,f=0,A=0,p=0,m=0,g=0,y=0,v=0,x,b,w,S,_,E=null,j;const I=new Uint16Array(dg+1),T=new Uint16Array(dg+1);let N=null,F,L,D;for(u=0;u<=dg;u++)I[u]=0;for(d=0;d<r;d++)I[t[n+d]]++;for(A=l,f=dg;f>=1&&I[f]===0;f--);if(A>f&&(A=f),f===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,o.bits=1,0;for(h=1;h<f&&I[h]===0;h++);for(A<h&&(A=h),g=1,u=1;u<=dg;u++)if(g<<=1,g-=I[u],g<0)return-1;if(g>0&&(e===XX||f!==1))return-1;for(T[1]=0,u=1;u<dg;u++)T[u+1]=T[u]+I[u];for(d=0;d<r;d++)t[n+d]!==0&&(a[T[t[n+d]]++]=d);if(e===XX?(E=N=a,j=20):e===I4?(E=I2t,N=O2t,j=257):(E=F2t,N=M2t,j=0),v=0,d=0,u=h,_=s,p=A,m=0,w=-1,y=1<<A,S=y-1,e===I4&&y>GX||e===JX&&y>YX)return 1;for(;;){F=u-m,a[d]+1<j?(L=0,D=a[d]):a[d]>=j?(L=N[a[d]-j],D=E[a[d]-j]):(L=96,D=0),x=1<<u-m,b=1<<p,h=b;do b-=x,i[_+(v>>m)+b]=F<<24|L<<16|D|0;while(b!==0);for(x=1<<u-1;v&x;)x>>=1;if(x!==0?(v&=x-1,v+=x):v=0,d++,--I[u]===0){if(u===f)break;u=t[n+a[d]]}if(u>A&&(v&S)!==w){for(m===0&&(m=A),_+=h,p=u-m,g=1<<p;p+m<f&&(g-=I[p+m],!(g<=0));)p++,g<<=1;if(y+=1<<p,e===I4&&y>GX||e===JX&&y>YX)return 1;w=v&S,i[w]=A<<24|p<<16|_-s|0}}return v!==0&&(i[_+v]=u-m<<24|64<<16|0),o.bits=A,0};var Yw=L2t;const R2t=0,lye=1,cye=2,{Z_FINISH:ZX,Z_BLOCK:U2t,Z_TREES:KS,Z_OK:rm,Z_STREAM_END:D2t,Z_NEED_DICT:Q2t,Z_STREAM_ERROR:xl,Z_DATA_ERROR:uye,Z_MEM_ERROR:dye,Z_BUF_ERROR:H2t,Z_DEFLATED:eJ}=D2,Y5=16180,tJ=16181,nJ=16182,rJ=16183,iJ=16184,sJ=16185,aJ=16186,oJ=16187,lJ=16188,cJ=16189,gN=16190,Mu=16191,O4=16192,uJ=16193,F4=16194,dJ=16195,hJ=16196,AJ=16197,fJ=16198,qS=16199,WS=16200,pJ=16201,mJ=16202,gJ=16203,yJ=16204,vJ=16205,M4=16206,xJ=16207,wJ=16208,kr=16209,hye=16210,Aye=16211,$2t=852,z2t=592,V2t=15,K2t=V2t,bJ=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function q2t(){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 ym=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<Y5||t.mode>Aye?1:0},fye=e=>{if(ym(e))return xl;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=Y5,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($2t),t.distcode=t.distdyn=new Int32Array(z2t),t.sane=1,t.back=-1,rm},pye=e=>{if(ym(e))return xl;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,fye(e)},mye=(e,t)=>{let n;if(ym(e))return xl;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?xl:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,pye(e))},gye=(e,t)=>{if(!e)return xl;const n=new q2t;e.state=n,n.strm=e,n.window=null,n.mode=Y5;const r=mye(e,t);return r!==rm&&(e.state=null),r},W2t=e=>gye(e,K2t);let CJ=!0,L4,R4;const G2t=e=>{if(CJ){L4=new Int32Array(512),R4=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(Yw(lye,e.lens,0,288,L4,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Yw(cye,e.lens,0,32,R4,0,e.work,{bits:5}),CJ=!1}e.lencode=L4,e.lenbits=9,e.distcode=R4,e.distbits=5},yye=(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},Y2t=(e,t)=>{let n,r,i,s,a,o,l,u,d,h,f,A,p,m,g=0,y,v,x,b,w,S,_,E;const j=new Uint8Array(4);let I,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(ym(e)||!e.output||!e.input&&e.avail_in!==0)return xl;n=e.state,n.mode===Mu&&(n.mode=O4),a=e.next_out,i=e.output,l=e.avail_out,s=e.next_in,r=e.input,o=e.avail_in,u=n.hold,d=n.bits,h=o,f=l,E=rm;e:for(;;)switch(n.mode){case Y5:if(n.wrap===0){n.mode=O4;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,j[0]=u&255,j[1]=u>>>8&255,n.check=Vi(n.check,j,2,0),u=0,d=0,n.mode=tJ;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){e.msg="incorrect header check",n.mode=kr;break}if((u&15)!==eJ){e.msg="unknown compression method",n.mode=kr;break}if(u>>>=4,d-=4,_=(u&15)+8,n.wbits===0&&(n.wbits=_),_>15||_>n.wbits){e.msg="invalid window size",n.mode=kr;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=u&512?cJ:Mu,u=0,d=0;break;case tJ:for(;d<16;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(n.flags=u,(n.flags&255)!==eJ){e.msg="unknown compression method",n.mode=kr;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=kr;break}n.head&&(n.head.text=u>>8&1),n.flags&512&&n.wrap&4&&(j[0]=u&255,j[1]=u>>>8&255,n.check=Vi(n.check,j,2,0)),u=0,d=0,n.mode=nJ;case nJ: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&&(j[0]=u&255,j[1]=u>>>8&255,j[2]=u>>>16&255,j[3]=u>>>24&255,n.check=Vi(n.check,j,4,0)),u=0,d=0,n.mode=rJ;case rJ: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&&(j[0]=u&255,j[1]=u>>>8&255,n.check=Vi(n.check,j,2,0)),u=0,d=0,n.mode=iJ;case iJ: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&&(j[0]=u&255,j[1]=u>>>8&255,n.check=Vi(n.check,j,2,0)),u=0,d=0}else n.head&&(n.head.extra=null);n.mode=sJ;case sJ:if(n.flags&1024&&(A=n.length,A>o&&(A=o),A&&(n.head&&(_=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+A),_)),n.flags&512&&n.wrap&4&&(n.check=Vi(n.check,r,A,s)),o-=A,s+=A,n.length-=A),n.length))break e;n.length=0,n.mode=aJ;case aJ:if(n.flags&2048){if(o===0)break e;A=0;do _=r[s+A++],n.head&&_&&n.length<65536&&(n.head.name+=String.fromCharCode(_));while(_&&A<o);if(n.flags&512&&n.wrap&4&&(n.check=Vi(n.check,r,A,s)),o-=A,s+=A,_)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=oJ;case oJ:if(n.flags&4096){if(o===0)break e;A=0;do _=r[s+A++],n.head&&_&&n.length<65536&&(n.head.comment+=String.fromCharCode(_));while(_&&A<o);if(n.flags&512&&n.wrap&4&&(n.check=Vi(n.check,r,A,s)),o-=A,s+=A,_)break e}else n.head&&(n.head.comment=null);n.mode=lJ;case lJ: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=kr;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=Mu;break;case cJ:for(;d<32;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}e.adler=n.check=bJ(u),u=0,d=0,n.mode=gN;case gN:if(n.havedict===0)return e.next_out=a,e.avail_out=l,e.next_in=s,e.avail_in=o,n.hold=u,n.bits=d,Q2t;e.adler=n.check=1,n.mode=Mu;case Mu:if(t===U2t||t===KS)break e;case O4:if(n.last){u>>>=d&7,d-=d&7,n.mode=M4;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=uJ;break;case 1:if(G2t(n),n.mode=qS,t===KS){u>>>=2,d-=2;break e}break;case 2:n.mode=hJ;break;case 3:e.msg="invalid block type",n.mode=kr}u>>>=2,d-=2;break;case uJ: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=kr;break}if(n.length=u&65535,u=0,d=0,n.mode=F4,t===KS)break e;case F4:n.mode=dJ;case dJ:if(A=n.length,A){if(A>o&&(A=o),A>l&&(A=l),A===0)break e;i.set(r.subarray(s,s+A),a),o-=A,s+=A,l-=A,a+=A,n.length-=A;break}n.mode=Mu;break;case hJ: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=kr;break}n.have=0,n.mode=AJ;case AJ: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,I={bits:n.lenbits},E=Yw(R2t,n.lens,0,19,n.lencode,0,n.work,I),n.lenbits=I.bits,E){e.msg="invalid code lengths set",n.mode=kr;break}n.have=0,n.mode=fJ;case fJ: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=kr;break}_=n.lens[n.have-1],A=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,_=0,A=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,_=0,A=11+(u&127),u>>>=7,d-=7}if(n.have+A>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=kr;break}for(;A--;)n.lens[n.have++]=_}}if(n.mode===kr)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=kr;break}if(n.lenbits=9,I={bits:n.lenbits},E=Yw(lye,n.lens,0,n.nlen,n.lencode,0,n.work,I),n.lenbits=I.bits,E){e.msg="invalid literal/lengths set",n.mode=kr;break}if(n.distbits=6,n.distcode=n.distdyn,I={bits:n.distbits},E=Yw(cye,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,I),n.distbits=I.bits,E){e.msg="invalid distances set",n.mode=kr;break}if(n.mode=qS,t===KS)break e;case qS:n.mode=WS;case WS:if(o>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=s,e.avail_in=o,n.hold=u,n.bits=d,P2t(e,f),a=e.next_out,i=e.output,l=e.avail_out,s=e.next_in,r=e.input,o=e.avail_in,u=n.hold,d=n.bits,n.mode===Mu&&(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,S=x;g=n.lencode[S+((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=vJ;break}if(v&32){n.back=-1,n.mode=Mu;break}if(v&64){e.msg="invalid literal/length code",n.mode=kr;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=mJ;case mJ: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,S=x;g=n.distcode[S+((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=kr;break}n.offset=x,n.extra=v&15,n.mode=gJ;case gJ: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=kr;break}n.mode=yJ;case yJ:if(l===0)break e;if(A=f-l,n.offset>A){if(A=n.offset-A,A>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=kr;break}A>n.wnext?(A-=n.wnext,p=n.wsize-A):p=n.wnext-A,A>n.length&&(A=n.length),m=n.window}else m=i,p=a-n.offset,A=n.length;A>l&&(A=l),l-=A,n.length-=A;do i[a++]=m[p++];while(--A);n.length===0&&(n.mode=WS);break;case vJ:if(l===0)break e;i[a++]=n.length,l--,n.mode=WS;break;case M4:if(n.wrap){for(;d<32;){if(o===0)break e;o--,u|=r[s++]<<d,d+=8}if(f-=l,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?Vi(n.check,i,f,a-f):z1(n.check,i,f,a-f)),f=l,n.wrap&4&&(n.flags?u:bJ(u))!==n.check){e.msg="incorrect data check",n.mode=kr;break}u=0,d=0}n.mode=xJ;case xJ: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=kr;break}u=0,d=0}n.mode=wJ;case wJ:E=D2t;break e;case kr:E=uye;break e;case hye:return dye;case Aye:default:return xl}return e.next_out=a,e.avail_out=l,e.next_in=s,e.avail_in=o,n.hold=u,n.bits=d,(n.wsize||f!==e.avail_out&&n.mode<kr&&(n.mode<M4||t!==ZX))&&yye(e,e.output,e.next_out,f-e.avail_out),h-=e.avail_in,f-=e.avail_out,e.total_in+=h,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?Vi(n.check,i,f,e.next_out-f):z1(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Mu?128:0)+(n.mode===qS||n.mode===F4?256:0),(h===0&&f===0||t===ZX)&&E===rm&&(E=H2t),E},X2t=e=>{if(ym(e))return xl;let t=e.state;return t.window&&(t.window=null),e.state=null,rm},J2t=(e,t)=>{if(ym(e))return xl;const n=e.state;return n.wrap&2?(n.head=t,t.done=!1,rm):xl},Z2t=(e,t)=>{const n=t.length;let r,i,s;return ym(e)||(r=e.state,r.wrap!==0&&r.mode!==gN)?xl:r.mode===gN&&(i=1,i=z1(i,t,n,0),i!==r.check)?uye:(s=yye(e,t,n,n),s?(r.mode=hye,dye):(r.havedict=1,rm))};var eCt=pye,tCt=mye,nCt=fye,rCt=W2t,iCt=gye,sCt=Y2t,aCt=X2t,oCt=J2t,lCt=Z2t,cCt="pako inflate (from Nodeca project)",Ku={inflateReset:eCt,inflateReset2:tCt,inflateResetKeep:nCt,inflateInit:rCt,inflateInit2:iCt,inflate:sCt,inflateEnd:aCt,inflateGetHeader:oCt,inflateSetDictionary:lCt,inflateInfo:cCt};function uCt(){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 dCt=uCt;const vye=Object.prototype.toString,{Z_NO_FLUSH:hCt,Z_FINISH:ACt,Z_OK:q1,Z_STREAM_END:U4,Z_NEED_DICT:D4,Z_STREAM_ERROR:fCt,Z_DATA_ERROR:SJ,Z_MEM_ERROR:pCt}=D2;function H2(e){this.options=G5.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 aye,this.strm.avail_out=0;let n=Ku.inflateInit2(this.strm,t.windowBits);if(n!==q1)throw new Error(M0[n]);if(this.header=new dCt,Ku.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=K1.string2buf(t.dictionary):vye.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Ku.inflateSetDictionary(this.strm,t.dictionary),n!==q1)))throw new Error(M0[n])}H2.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?ACt:hCt,vye.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=Ku.inflate(n,a),s===D4&&i&&(s=Ku.inflateSetDictionary(n,i),s===q1?s=Ku.inflate(n,a):s===SJ&&(s=D4));n.avail_in>0&&s===U4&&n.state.wrap>0&&e[n.next_in]!==0;)Ku.inflateReset(n),s=Ku.inflate(n,a);switch(s){case fCt:case SJ:case D4:case pCt:return this.onEnd(s),this.ended=!0,!1}if(o=n.avail_out,n.next_out&&(n.avail_out===0||s===U4))if(this.options.to==="string"){let l=K1.utf8border(n.output,n.next_out),u=n.next_out-l,d=K1.buf2string(n.output,l);n.next_out=u,n.avail_out=r-u,u&&n.output.set(n.output.subarray(l,l+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===q1&&o===0)){if(s===U4)return s=Ku.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};H2.prototype.onData=function(e){this.chunks.push(e)};H2.prototype.onEnd=function(e){e===q1&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=G5.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function ZH(e,t){const n=new H2(t);if(n.push(e),n.err)throw n.msg||M0[n.err];return n.result}function mCt(e,t){return t=t||{},t.raw=!0,ZH(e,t)}var gCt=H2,yCt=ZH,vCt=mCt,xCt=ZH,wCt=D2,bCt={Inflate:gCt,inflate:yCt,inflateRaw:vCt,ungzip:xCt,constants:wCt};const{Inflate:CCt,inflate:SCt,inflateRaw:$jt,ungzip:zjt}=bCt;var kJ=CCt,kCt=SCt;const xye=[];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;xye[e]=t}const BJ=4294967295;function BCt(e,t,n){let r=e;for(let i=0;i<n;i++)r=xye[(r^t[i])&255]^r>>>8;return r}function _Ct(e,t){return(BCt(BJ,e,t)^BJ)>>>0}function _J(e,t,n){const r=e.readUint32(),i=_Ct(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 wye(e,t,n){for(let r=0;r<n;r++)t[r]=e[r]}function bye(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 Cye(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 Sye(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 kye(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]+ECt(t[s-i],n[s],n[s-i])&255}}function ECt(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 NCt(e,t,n,r,i,s){switch(e){case 0:wye(t,n,i);break;case 1:bye(t,n,i,s);break;case 2:Cye(t,n,r,i);break;case 3:Sye(t,n,r,i,s);break;case 4:kye(t,n,r,i,s);break;default:throw new Error(`Unsupported filter: ${e}`)}}const jCt=new Uint16Array([255]),TCt=new Uint8Array(jCt.buffer),PCt=TCt[0]===255;function ICt(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,l=new Uint8Array(r*n*o);let u=0;for(let d=0;d<7;d++){const h=a[d],f=Math.ceil((n-h.x)/h.xStep),A=Math.ceil((r-h.y)/h.yStep);if(f<=0||A<=0)continue;const p=f*o,m=new Uint8Array(p);for(let g=0;g<A;g++){const y=t[u++],v=t.subarray(u,u+p);u+=p;const x=new Uint8Array(p);NCt(y,v,x,m,p,o),m.set(x);for(let b=0;b<f;b++){const w=h.x+b*h.xStep,S=h.y+g*h.yStep;if(!(w>=n||S>=r))for(let _=0;_<o;_++)l[(S*n+w)*o+_]=x[b*o+_]}}}if(s===16){const d=new Uint16Array(l.buffer);if(PCt)for(let h=0;h<d.length;h++)d[h]=OCt(d[h]);return d}else return l}function OCt(e){return(e&255)<<8|e>>8&255}const FCt=new Uint16Array([255]),MCt=new Uint8Array(FCt.buffer),LCt=MCt[0]===255,RCt=new Uint8Array(0);function EJ(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),l=new Uint8Array(r*o);let u=RCt,d=0,h,f;for(let A=0;A<r;A++){switch(h=t.subarray(d+1,d+1+o),f=l.subarray(A*o,(A+1)*o),t[d]){case 0:wye(h,f,o);break;case 1:bye(h,f,o,a);break;case 2:Cye(h,f,u,o);break;case 3:Sye(h,f,u,o,a);break;case 4:kye(h,f,u,o,a);break;default:throw new Error(`Unsupported filter: ${t[d]}`)}u=f,d+=o+1}if(s===16){const A=new Uint16Array(l.buffer);if(LCt)for(let p=0;p<A.length;p++)A[p]=UCt(A[p]);return A}else return l}function UCt(e){return(e&255)<<8|e>>8&255}const lB=Uint8Array.of(137,80,78,71,13,10,26,10);function NJ(e){if(!DCt(e.readBytes(lB.length)))throw new Error("wrong PNG signature")}function DCt(e){if(e.length<lB.length)return!1;for(let t=0;t<lB.length;t++)if(e[t]!==lB[t])return!1;return!0}const QCt="tEXt",HCt=0,Bye=new TextDecoder("latin1");function $Ct(e){if(VCt(e),e.length===0||e.length>79)throw new Error("keyword length must be between 1 and 79")}const zCt=/^[\u0000-\u00FF]*$/;function VCt(e){if(!zCt.test(e))throw new Error("invalid latin1 text")}function KCt(e,t,n){const r=_ye(t);e[r]=qCt(t,n-r.length-1)}function _ye(e){for(e.mark();e.readByte()!==HCt;);const t=e.offset;e.reset();const n=Bye.decode(e.readBytes(t-e.offset-1));return e.skip(1),$Ct(n),n}function qCt(e,t){return Bye.decode(e.readBytes(t))}const ao={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},Q4={UNKNOWN:-1,DEFLATE:0},jJ={UNKNOWN:-1,ADAPTIVE:0},H4={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},GS={NONE:0,BACKGROUND:1,PREVIOUS:2},$4={SOURCE:0,OVER:1};class WCt extends KH{constructor(n,r={}){super(n);dn(this,"_checkCrc");dn(this,"_inflator");dn(this,"_png");dn(this,"_apng");dn(this,"_end");dn(this,"_hasPalette");dn(this,"_palette");dn(this,"_hasTransparency");dn(this,"_transparency");dn(this,"_compressionMethod");dn(this,"_filterMethod");dn(this,"_interlaceMethod");dn(this,"_colorType");dn(this,"_isAnimated");dn(this,"_numberOfFrames");dn(this,"_numberOfPlays");dn(this,"_frames");dn(this,"_writingDataChunks");const{checkCrc:i=!1}=r;this._checkCrc=i,this._inflator=new kJ,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=Q4.UNKNOWN,this._filterMethod=jJ.UNKNOWN,this._interlaceMethod=H4.UNKNOWN,this._colorType=ao.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(NJ(this);!this._end;){const n=this.readUint32(),r=this.readChars(4);this.decodeChunk(n,r)}return this.decodeImage(),this._png}decodeApng(){for(NJ(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 QCt:KCt(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?_J(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?_J(this,n+4,r):this.skip(4)}decodeIHDR(){const n=this._png;n.width=this.readUint32(),n.height=this.readUint32(),n.depth=GCt(this.readUint8());const r=this.readUint8();this._colorType=r;let i;switch(r){case ao.GREYSCALE:i=1;break;case ao.TRUECOLOUR:i=3;break;case ao.INDEXED_COLOUR:i=1;break;case ao.GREYSCALE_ALPHA:i=2;break;case ao.TRUECOLOUR_ALPHA:i=4;break;case ao.UNKNOWN:default:throw new Error(`Unknown color type: ${r}`)}if(this._png.channels=i,this._compressionMethod=this.readUint8(),this._compressionMethod!==Q4.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 ao.GREYSCALE:case ao.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 ao.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 ao.UNKNOWN:case ao.GREYSCALE_ALPHA:case ao.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(n){const r=_ye(this),i=this.readUint8();if(i!==Q4.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${i}`);const s=this.readBytes(n-r.length-2);this._png.iccEmbeddedProfile={name:r,profile:kCt(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=EJ({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 GS.NONE:break;case GS.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 l=0;l<this._png.channels;l++)i.data[o+l]=0}break;case GS.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 l=((a+r.yOffset)*this._png.width+r.xOffset+o)*this._png.channels,u=(a*r.width+o)*this._png.channels;return{index:l,frameIndex:u}};switch(r.blendOp){case $4.SOURCE:for(let a=0;a<r.height;a++)for(let o=0;o<r.width;o++){const{index:l,frameIndex:u}=s(a,o);for(let d=0;d<this._png.channels;d++)n.data[l+d]=r.data[u+d]}break;case $4.OVER:for(let a=0;a<r.height;a++)for(let o=0;o<r.width;o++){const{index:l,frameIndex:u}=s(a,o);for(let d=0;d<this._png.channels;d++){const h=r.data[u+this._png.channels-1]/i,f=d%(this._png.channels-1)===0?1:r.data[u+d],A=Math.floor(h*f+(1-h)*n.data[l+d]);n.data[l+d]+=A}}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!==jJ.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===H4.NO_INTERLACE)this._png.data=EJ({data:n,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===H4.ADAM7)this._png.data=ICt({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:GS.NONE,blendOp:$4.SOURCE,data:n}),this._inflator=new kJ,this._writingDataChunks=!1}}function GCt(e){if(e!==1&&e!==2&&e!==4&&e!==8&&e!==16)throw new Error(`invalid bit depth: ${e}`);return e}var TJ;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.METRE=1]="METRE"})(TJ||(TJ={}));function YCt(e,t){return new WCt(e,t).decode()}var Kt=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function z4(){Kt.console&&typeof Kt.console.log=="function"&&Kt.console.log.apply(Kt.console,arguments)}var Yn={log:z4,warn:function(e){Kt.console&&(typeof Kt.console.warn=="function"?Kt.console.warn.apply(Kt.console,arguments):z4.call(null,arguments))},error:function(e){Kt.console&&(typeof Kt.console.error=="function"?Kt.console.error.apply(Kt.console,arguments):z4(e))}};function V4(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){Of(r.response,t,n)},r.onerror=function(){Yn.error("could not download file")},r.send()}function PJ(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function YS(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 Of=Kt.saveAs||((typeof window>"u"?"undefined":Qn(window))!=="object"||window!==Kt?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(e,t,n){var r=Kt.URL||Kt.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?PJ(i.href)?V4(e,t,n):YS(i,i.target="_blank"):YS(i)):(i.href=r.createObjectURL(e),setTimeout(function(){r.revokeObjectURL(i.href)},4e4),setTimeout(function(){YS(i)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){if(t=t||e.name||"download",typeof e=="string")if(PJ(e))V4(e,t,n);else{var r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){YS(r)})}else navigator.msSaveOrOpenBlob(function(i,s){return s===void 0?s={autoBom:!1}:Qn(s)!=="object"&&(Yn.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 V4(e,t,n);var i=e.type==="application/octet-stream",s=/constructor/i.test(Kt.HTMLElement)||Kt.safari,a=/CriOS\/[\d]+/.test(navigator.userAgent);if((a||i&&s)&&(typeof FileReader>"u"?"undefined":Qn(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 l=Kt.URL||Kt.webkitURL,u=l.createObjectURL(e);r?r.location=u:location.href=u,r=null,setTimeout(function(){l.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 Eye(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),l=this.g.toString(16),u=this.b.toString(16);return o.length==1&&(o="0"+o),l.length==1&&(l="0"+l),u.length==1&&(u="0"+u),"#"+o+l+u}}var cB=Kt.atob.bind(Kt),IJ=Kt.btoa.bind(Kt);/**
 * @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 K4(e,t){var n=e[0],r=e[1],i=e[2],s=e[3];n=js(n,r,i,s,t[0],7,-680876936),s=js(s,n,r,i,t[1],12,-389564586),i=js(i,s,n,r,t[2],17,606105819),r=js(r,i,s,n,t[3],22,-1044525330),n=js(n,r,i,s,t[4],7,-176418897),s=js(s,n,r,i,t[5],12,1200080426),i=js(i,s,n,r,t[6],17,-1473231341),r=js(r,i,s,n,t[7],22,-45705983),n=js(n,r,i,s,t[8],7,1770035416),s=js(s,n,r,i,t[9],12,-1958414417),i=js(i,s,n,r,t[10],17,-42063),r=js(r,i,s,n,t[11],22,-1990404162),n=js(n,r,i,s,t[12],7,1804603682),s=js(s,n,r,i,t[13],12,-40341101),i=js(i,s,n,r,t[14],17,-1502002290),n=Ts(n,r=js(r,i,s,n,t[15],22,1236535329),i,s,t[1],5,-165796510),s=Ts(s,n,r,i,t[6],9,-1069501632),i=Ts(i,s,n,r,t[11],14,643717713),r=Ts(r,i,s,n,t[0],20,-373897302),n=Ts(n,r,i,s,t[5],5,-701558691),s=Ts(s,n,r,i,t[10],9,38016083),i=Ts(i,s,n,r,t[15],14,-660478335),r=Ts(r,i,s,n,t[4],20,-405537848),n=Ts(n,r,i,s,t[9],5,568446438),s=Ts(s,n,r,i,t[14],9,-1019803690),i=Ts(i,s,n,r,t[3],14,-187363961),r=Ts(r,i,s,n,t[8],20,1163531501),n=Ts(n,r,i,s,t[13],5,-1444681467),s=Ts(s,n,r,i,t[2],9,-51403784),i=Ts(i,s,n,r,t[7],14,1735328473),n=Ps(n,r=Ts(r,i,s,n,t[12],20,-1926607734),i,s,t[5],4,-378558),s=Ps(s,n,r,i,t[8],11,-2022574463),i=Ps(i,s,n,r,t[11],16,1839030562),r=Ps(r,i,s,n,t[14],23,-35309556),n=Ps(n,r,i,s,t[1],4,-1530992060),s=Ps(s,n,r,i,t[4],11,1272893353),i=Ps(i,s,n,r,t[7],16,-155497632),r=Ps(r,i,s,n,t[10],23,-1094730640),n=Ps(n,r,i,s,t[13],4,681279174),s=Ps(s,n,r,i,t[0],11,-358537222),i=Ps(i,s,n,r,t[3],16,-722521979),r=Ps(r,i,s,n,t[6],23,76029189),n=Ps(n,r,i,s,t[9],4,-640364487),s=Ps(s,n,r,i,t[12],11,-421815835),i=Ps(i,s,n,r,t[15],16,530742520),n=Is(n,r=Ps(r,i,s,n,t[2],23,-995338651),i,s,t[0],6,-198630844),s=Is(s,n,r,i,t[7],10,1126891415),i=Is(i,s,n,r,t[14],15,-1416354905),r=Is(r,i,s,n,t[5],21,-57434055),n=Is(n,r,i,s,t[12],6,1700485571),s=Is(s,n,r,i,t[3],10,-1894986606),i=Is(i,s,n,r,t[10],15,-1051523),r=Is(r,i,s,n,t[1],21,-2054922799),n=Is(n,r,i,s,t[8],6,1873313359),s=Is(s,n,r,i,t[15],10,-30611744),i=Is(i,s,n,r,t[6],15,-1560198380),r=Is(r,i,s,n,t[13],21,1309151649),n=Is(n,r,i,s,t[4],6,-145523070),s=Is(s,n,r,i,t[11],10,-1120210379),i=Is(i,s,n,r,t[2],15,718787259),r=Is(r,i,s,n,t[9],21,-343485551),e[0]=Vh(n,e[0]),e[1]=Vh(r,e[1]),e[2]=Vh(i,e[2]),e[3]=Vh(s,e[3])}function X5(e,t,n,r,i,s){return t=Vh(Vh(t,e),Vh(r,s)),Vh(t<<i|t>>>32-i,n)}function js(e,t,n,r,i,s,a){return X5(t&n|~t&r,e,t,i,s,a)}function Ts(e,t,n,r,i,s,a){return X5(t&r|n&~r,e,t,i,s,a)}function Ps(e,t,n,r,i,s,a){return X5(t^n^r,e,t,i,s,a)}function Is(e,t,n,r,i,s,a){return X5(n^(t|~r),e,t,i,s,a)}function Nye(e){var t,n=e.length,r=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)K4(r,XCt(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(K4(r,i),t=0;t<16;t++)i[t]=0;return i[14]=8*n,K4(r,i),r}function XCt(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 OJ="0123456789abcdef".split("");function JCt(e){for(var t="",n=0;n<4;n++)t+=OJ[e>>8*n+4&15]+OJ[e>>8*n&15];return t}function ZCt(e){return String.fromCharCode(255&e,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function uR(e){return Nye(e).map(ZCt).join("")}var eSt=function(e){for(var t=0;t<e.length;t++)e[t]=JCt(e[t]);return e.join("")}(Nye("hello"))!="5d41402abc4b2a76b9719d911017c592";function Vh(e,t){if(eSt){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 dR(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=[],l=0;l<256;l++)o[l]=l;var u=0;for(l=0;l<256;l++){var d=o[l];u=(u+d+a.charCodeAt(l))%256,o[l]=o[u],o[u]=d}n=e,r=o}else o=r;var h=t.length,f=0,A=0,p="";for(l=0;l<h;l++)A=(A+(d=o[f=(f+1)%256]))%256,o[f]=o[A],o[A]=d,a=o[(o[f]+o[A])%256],p+=String.fromCharCode(t.charCodeAt(l)^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 FJ={print:4,modify:8,copy:16,"annot-forms":32};function _g(e,t,n,r){this.v=1,this.r=2;var i=192;e.forEach(function(o){if(FJ.perm!==void 0)throw new Error("Invalid permission: "+o);i+=FJ[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=uR(s+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=dR(this.encryptionKey,this.padding)}function Eg(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 MJ(e){if(Qn(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){Kt.console&&Yn.error("jsPDF PubSub Error",o.message,o)}a[1]&&i.push(s)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function yN(e){if(!(this instanceof yN))return new yN(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 jye(e,t){this.gState=e,this.matrix=t,this.id="",this.objectNumber=-1}function Uf(e,t,n,r,i){if(!(this instanceof Uf))return new Uf(e,t,n,r,i);this.type=e==="axial"?2:3,this.coords=t,this.colors=n,jye.call(this,r,i)}function Jg(e,t,n,r,i){if(!(this instanceof Jg))return new Jg(e,t,n,r,i);this.boundingBox=e,this.xStep=t,this.yStep=n,this.stream="",this.cloneIndex=0,jye.call(this,r,i)}function Nt(e){var t,n=typeof arguments[0]=="string"?arguments[0]:"p",r=arguments[1],i=arguments[2],s=arguments[3],a=[],o=1,l=16,u="S",d=null;Qn(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&&(l=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,f={},A={internal:{},__private__:{}};A.__private__.PubSub=MJ;var p="1.3",m=A.__private__.getPdfVersion=function(){return p};A.__private__.setPdfVersion=function(P){p=P};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]};A.__private__.getPageFormats=function(){return g};var y=A.__private__.getPageFormat=function(P){return g[P]};i=i||"a4";var v="compat",x="advanced",b=v;function w(){this.saveGraphicsState(),te(new yt(Ge,0,0,-Ge,0,sf()*Ge).toString()+" cm"),this.setFontSize(this.getFontSize()/Ge),u="n",b=x}function S(){this.restoreGraphicsState(),u="S",b=v}var _=A.__private__.combineFontStyleAndFontWeight=function(P,z){if(P=="bold"&&z=="normal"||P=="bold"&&z==400||P=="normal"&&z=="italic"||P=="bold"&&z=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return z&&(P=z==400||z==="normal"?P==="italic"?"italic":"normal":z!=700&&z!=="bold"||P!=="normal"?(z==700?"bold":z)+""+P:"bold"),P};A.advancedAPI=function(P){var z=b===v;return z&&w.call(this),typeof P!="function"||(P(this),z&&S.call(this)),this},A.compatAPI=function(P){var z=b===x;return z&&S.call(this),typeof P!="function"||(P(this),z&&w.call(this)),this},A.isAdvancedAPI=function(){return b===x};var E,j=function(P){if(b!==x)throw new Error(P+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},I=A.roundToPrecision=A.__private__.roundToPrecision=function(P,z){var ae=t||z;if(isNaN(P)||isNaN(ae))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return P.toFixed(ae).replace(/0+$/,"")};E=A.hpf=A.__private__.hpf=typeof l=="number"?function(P){if(isNaN(P))throw new Error("Invalid argument passed to jsPDF.hpf");return I(P,l)}:l==="smart"?function(P){if(isNaN(P))throw new Error("Invalid argument passed to jsPDF.hpf");return I(P,P>-1&&P<1?16:5)}:function(P){if(isNaN(P))throw new Error("Invalid argument passed to jsPDF.hpf");return I(P,16)};var T=A.f2=A.__private__.f2=function(P){if(isNaN(P))throw new Error("Invalid argument passed to jsPDF.f2");return I(P,2)},N=A.__private__.f3=function(P){if(isNaN(P))throw new Error("Invalid argument passed to jsPDF.f3");return I(P,3)},F=A.scale=A.__private__.scale=function(P){if(isNaN(P))throw new Error("Invalid argument passed to jsPDF.scale");return b===v?P*Ge:b===x?P:void 0},L=function(P){return F(function(z){return b===v?sf()-z:b===x?z:void 0}(P))};A.__private__.setPrecision=A.setPrecision=function(P){typeof parseInt(P,10)=="number"&&(t=parseInt(P,10))};var D,H="00000000000000000000000000000000",W=A.__private__.getFileId=function(){return H},$=A.__private__.setFileId=function(P){return H=P!==void 0&&/^[a-fA-F0-9]{32}$/.test(P)?P.toUpperCase():H.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),d!==null&&(rs=new _g(d.userPermissions,d.userPassword,d.ownerPassword,H)),H};A.setFileId=function(P){return $(P),this},A.getFileId=function(){return W()};var V=A.__private__.convertDateToPDFDate=function(P){var z=P.getTimezoneOffset(),ae=z<0?"+":"-",Ae=Math.floor(Math.abs(z/60)),ve=Math.abs(z%60),Ne=[ae,Y(Ae),"'",Y(ve),"'"].join("");return["D:",P.getFullYear(),Y(P.getMonth()+1),Y(P.getDate()),Y(P.getHours()),Y(P.getMinutes()),Y(P.getSeconds()),Ne].join("")},Q=A.__private__.convertPDFDateToDate=function(P){var z=parseInt(P.substr(2,4),10),ae=parseInt(P.substr(6,2),10)-1,Ae=parseInt(P.substr(8,2),10),ve=parseInt(P.substr(10,2),10),Ne=parseInt(P.substr(12,2),10),Le=parseInt(P.substr(14,2),10);return new Date(z,ae,Ae,ve,Ne,Le,0)},ce=A.__private__.setCreationDate=function(P){var z;if(P===void 0&&(P=new Date),P instanceof Date)z=V(P);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(P))throw new Error("Invalid argument passed to jsPDF.setCreationDate");z=P}return D=z},R=A.__private__.getCreationDate=function(P){var z=D;return P==="jsDate"&&(z=Q(D)),z};A.setCreationDate=function(P){return ce(P),this},A.getCreationDate=function(P){return R(P)};var M,Y=A.__private__.padd2=function(P){return("0"+parseInt(P)).slice(-2)},X=A.__private__.padd2Hex=function(P){return("00"+(P=P.toString())).substr(P.length)},K=0,Z=[],de=[],se=0,ie=[],he=[],ue=!1,Se=de;A.__private__.setCustomOutputDestination=function(P){ue=!0,Se=P};var Fe=function(P){ue||(Se=P)};A.__private__.resetCustomOutputDestination=function(){ue=!1,Se=de};var te=A.__private__.out=function(P){return P=P.toString(),se+=P.length+1,Se.push(P),Se},_e=A.__private__.write=function(P){return te(arguments.length===1?P.toString():Array.prototype.join.call(arguments," "))},Ze=A.__private__.getArrayBuffer=function(P){for(var z=P.length,ae=new ArrayBuffer(z),Ae=new Uint8Array(ae);z--;)Ae[z]=P.charCodeAt(z);return ae},et=[["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]];A.__private__.getStandardFonts=function(){return et};var Te=e.fontSize||16;A.__private__.setFontSize=A.setFontSize=function(P){return Te=b===x?P/Ge:P,this};var st,xe=A.__private__.getFontSize=A.getFontSize=function(){return b===v?Te:Te*Ge},Qe=e.R2L||!1;A.__private__.setR2L=A.setR2L=function(P){return Qe=P,this},A.__private__.getR2L=A.getR2L=function(){return Qe};var ze,Dt=A.__private__.setZoomMode=function(P){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(P))st=P;else if(isNaN(P)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(P)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+P+'" is not recognized.');st=P}else st=parseInt(P,10)};A.__private__.getZoomMode=function(){return st};var dt,ye=A.__private__.setPageMode=function(P){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(P)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+P+'" is not recognized.');ze=P};A.__private__.getPageMode=function(){return ze};var Ee=A.__private__.setLayoutMode=function(P){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(P)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+P+'" is not recognized.');dt=P};A.__private__.getLayoutMode=function(){return dt},A.__private__.setDisplayMode=A.setDisplayMode=function(P,z,ae){return Dt(P),Ee(z),ye(ae),this};var We={title:"",subject:"",author:"",keywords:"",creator:""};A.__private__.getDocumentProperty=function(P){if(Object.keys(We).indexOf(P)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return We[P]},A.__private__.getDocumentProperties=function(){return We},A.__private__.setDocumentProperties=A.setProperties=A.setDocumentProperties=function(P){for(var z in We)We.hasOwnProperty(z)&&P[z]&&(We[z]=P[z]);return this},A.__private__.setDocumentProperty=function(P,z){if(Object.keys(We).indexOf(P)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return We[P]=z};var Ue,Ge,pe,mt,ct,xt={},Mt={},zt=[],ht={},Lt={},Pt={},qt={},er=null,en=0,kt=[],Tn=new MJ(A),Ut=e.hotfixes||[],Wt={},wn={},Dr=[],yt=function P(z,ae,Ae,ve,Ne,Le){if(!(this instanceof P))return new P(z,ae,Ae,ve,Ne,Le);isNaN(z)&&(z=1),isNaN(ae)&&(ae=0),isNaN(Ae)&&(Ae=0),isNaN(ve)&&(ve=1),isNaN(Ne)&&(Ne=0),isNaN(Le)&&(Le=0),this._matrix=[z,ae,Ae,ve,Ne,Le]};Object.defineProperty(yt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(P){this._matrix[0]=P}}),Object.defineProperty(yt.prototype,"shy",{get:function(){return this._matrix[1]},set:function(P){this._matrix[1]=P}}),Object.defineProperty(yt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(P){this._matrix[2]=P}}),Object.defineProperty(yt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(P){this._matrix[3]=P}}),Object.defineProperty(yt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(P){this._matrix[4]=P}}),Object.defineProperty(yt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(P){this._matrix[5]=P}}),Object.defineProperty(yt.prototype,"a",{get:function(){return this._matrix[0]},set:function(P){this._matrix[0]=P}}),Object.defineProperty(yt.prototype,"b",{get:function(){return this._matrix[1]},set:function(P){this._matrix[1]=P}}),Object.defineProperty(yt.prototype,"c",{get:function(){return this._matrix[2]},set:function(P){this._matrix[2]=P}}),Object.defineProperty(yt.prototype,"d",{get:function(){return this._matrix[3]},set:function(P){this._matrix[3]=P}}),Object.defineProperty(yt.prototype,"e",{get:function(){return this._matrix[4]},set:function(P){this._matrix[4]=P}}),Object.defineProperty(yt.prototype,"f",{get:function(){return this._matrix[5]},set:function(P){this._matrix[5]=P}}),Object.defineProperty(yt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(yt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(yt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(yt.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),yt.prototype.join=function(P){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(E).join(P)},yt.prototype.multiply=function(P){var z=P.sx*this.sx+P.shy*this.shx,ae=P.sx*this.shy+P.shy*this.sy,Ae=P.shx*this.sx+P.sy*this.shx,ve=P.shx*this.shy+P.sy*this.sy,Ne=P.tx*this.sx+P.ty*this.shx+this.tx,Le=P.tx*this.shy+P.ty*this.sy+this.ty;return new yt(z,ae,Ae,ve,Ne,Le)},yt.prototype.decompose=function(){var P=this.sx,z=this.shy,ae=this.shx,Ae=this.sy,ve=this.tx,Ne=this.ty,Le=Math.sqrt(P*P+z*z),vt=(P/=Le)*ae+(z/=Le)*Ae;ae-=P*vt,Ae-=z*vt;var gt=Math.sqrt(ae*ae+Ae*Ae);return vt/=gt,P*(Ae/=gt)<z*(ae/=gt)&&(P=-P,z=-z,vt=-vt,Le=-Le),{scale:new yt(Le,0,0,gt,0,0),translate:new yt(1,0,0,1,ve,Ne),rotate:new yt(P,z,-z,P,0,0),skew:new yt(1,0,vt,1,0,0)}},yt.prototype.toString=function(P){return this.join(" ")},yt.prototype.inversed=function(){var P=this.sx,z=this.shy,ae=this.shx,Ae=this.sy,ve=this.tx,Ne=this.ty,Le=1/(P*Ae-z*ae),vt=Ae*Le,gt=-z*Le,Gt=-ae*Le,Jt=P*Le;return new yt(vt,gt,Gt,Jt,-vt*ve-Gt*Ne,-gt*ve-Jt*Ne)},yt.prototype.applyToPoint=function(P){var z=P.x*this.sx+P.y*this.shx+this.tx,ae=P.x*this.shy+P.y*this.sy+this.ty;return new rf(z,ae)},yt.prototype.applyToRectangle=function(P){var z=this.applyToPoint(P),ae=this.applyToPoint(new rf(P.x+P.w,P.y+P.h));return new Fv(z.x,z.y,ae.x-z.x,ae.y-z.y)},yt.prototype.clone=function(){var P=this.sx,z=this.shy,ae=this.shx,Ae=this.sy,ve=this.tx,Ne=this.ty;return new yt(P,z,ae,Ae,ve,Ne)},A.Matrix=yt;var Hi=A.matrixMult=function(P,z){return z.multiply(P)},ts=new yt(1,0,0,1,0,0);A.unitMatrix=A.identityMatrix=ts;var Sr=function(P,z){if(!Lt[P]){var ae=(z instanceof Uf?"Sh":"P")+(Object.keys(ht).length+1).toString(10);z.id=ae,Lt[P]=ae,ht[ae]=z,Tn.publish("addPattern",z)}};A.ShadingPattern=Uf,A.TilingPattern=Jg,A.addShadingPattern=function(P,z){return j("addShadingPattern()"),Sr(P,z),this},A.beginTilingPattern=function(P){j("beginTilingPattern()"),Mv(P.boundingBox[0],P.boundingBox[1],P.boundingBox[2]-P.boundingBox[0],P.boundingBox[3]-P.boundingBox[1],P.matrix)},A.endTilingPattern=function(P,z){j("endTilingPattern()"),z.stream=he[M].join(`
`),Sr(P,z),Tn.publish("endTilingPattern",z),Dr.pop().restore()};var Jr,Qr=A.__private__.newObject=function(){var P=$i();return ns(P,!0),P},$i=A.__private__.newObjectDeferred=function(){return K++,Z[K]=function(){return se},K},ns=function(P,z){return z=typeof z=="boolean"&&z,Z[P]=se,z&&te(P+" 0 obj"),P},ZA=A.__private__.newAdditionalObject=function(){var P={objId:$i(),content:""};return ie.push(P),P},Pd=$i(),Sl=$i(),bc=A.__private__.decodeColorString=function(P){var z=P.split(" ");if(z.length!==2||z[1]!=="g"&&z[1]!=="G")z.length!==5||z[4]!=="k"&&z[4]!=="K"||(z=[(1-z[0])*(1-z[3]),(1-z[1])*(1-z[3]),(1-z[2])*(1-z[3]),"r"]);else{var ae=parseFloat(z[0]);z=[ae,ae,ae,"r"]}for(var Ae="#",ve=0;ve<3;ve++)Ae+=("0"+Math.floor(255*parseFloat(z[ve])).toString(16)).slice(-2);return Ae},kl=A.__private__.encodeColorString=function(P){var z;typeof P=="string"&&(P={ch1:P});var ae=P.ch1,Ae=P.ch2,ve=P.ch3,Ne=P.ch4,Le=P.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof ae=="string"&&ae.charAt(0)!=="#"){var vt=new Eye(ae);if(vt.ok)ae=vt.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 gt=parseInt(ae.substr(1),16);ae=gt>>16&255,Ae=gt>>8&255,ve=255&gt}if(Ae===void 0||Ne===void 0&&ae===Ae&&Ae===ve)z=typeof ae=="string"?ae+" "+Le[0]:P.precision===2?T(ae/255)+" "+Le[0]:N(ae/255)+" "+Le[0];else if(Ne===void 0||Qn(Ne)==="object"){if(Ne&&!isNaN(Ne.a)&&Ne.a===0)return["1.","1.","1.",Le[1]].join(" ");z=typeof ae=="string"?[ae,Ae,ve,Le[1]].join(" "):P.precision===2?[T(ae/255),T(Ae/255),T(ve/255),Le[1]].join(" "):[N(ae/255),N(Ae/255),N(ve/255),Le[1]].join(" ")}else z=typeof ae=="string"?[ae,Ae,ve,Ne,Le[2]].join(" "):P.precision===2?[T(ae),T(Ae),T(ve),T(Ne),Le[2]].join(" "):[N(ae),N(Ae),N(ve),N(Ne),Le[2]].join(" ");return z},Bl=A.__private__.getFilters=function(){return a},Po=A.__private__.putStream=function(P){var z=(P=P||{}).data||"",ae=P.filters||Bl(),Ae=P.alreadyAppliedFilters||[],ve=P.addLength1||!1,Ne=z.length,Le=P.objectId,vt=function(hr){return hr};if(d!==null&&Le===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");d!==null&&(vt=rs.encryptor(Le,0));var gt={};ae===!0&&(ae=["FlateEncode"]);var Gt=P.additionalKeyValues||[],Jt=(gt=Nt.API.processDataByFilters!==void 0?Nt.API.processDataByFilters(z,ae):{data:z,reverseChain:[]}).reverseChain+(Array.isArray(Ae)?Ae.join(" "):Ae.toString());if(gt.data.length!==0&&(Gt.push({key:"Length",value:gt.data.length}),ve===!0&&Gt.push({key:"Length1",value:Ne})),Jt.length!=0)if(Jt.split("/").length-1==1)Gt.push({key:"Filter",value:Jt});else{Gt.push({key:"Filter",value:"["+Jt+"]"});for(var bn=0;bn<Gt.length;bn+=1)if(Gt[bn].key==="DecodeParms"){for(var pi=[],Wn=0;Wn<gt.reverseChain.split("/").length-1;Wn+=1)pi.push("null");pi.push(Gt[bn].value),Gt[bn].value="["+pi.join(" ")+"]"}}te("<<");for(var zn=0;zn<Gt.length;zn++)te("/"+Gt[zn].key+" "+Gt[zn].value);te(">>"),gt.data.length!==0&&(te("stream"),te(vt(gt.data)),te("endstream"))},ef=A.__private__.putPage=function(P){var z=P.number,ae=P.data,Ae=P.objId,ve=P.contentsObjId;ns(Ae,!0),te("<</Type /Page"),te("/Parent "+P.rootDictionaryObjId+" 0 R"),te("/Resources "+P.resourceDictionaryObjId+" 0 R"),te("/MediaBox ["+parseFloat(E(P.mediaBox.bottomLeftX))+" "+parseFloat(E(P.mediaBox.bottomLeftY))+" "+E(P.mediaBox.topRightX)+" "+E(P.mediaBox.topRightY)+"]"),P.cropBox!==null&&te("/CropBox ["+E(P.cropBox.bottomLeftX)+" "+E(P.cropBox.bottomLeftY)+" "+E(P.cropBox.topRightX)+" "+E(P.cropBox.topRightY)+"]"),P.bleedBox!==null&&te("/BleedBox ["+E(P.bleedBox.bottomLeftX)+" "+E(P.bleedBox.bottomLeftY)+" "+E(P.bleedBox.topRightX)+" "+E(P.bleedBox.topRightY)+"]"),P.trimBox!==null&&te("/TrimBox ["+E(P.trimBox.bottomLeftX)+" "+E(P.trimBox.bottomLeftY)+" "+E(P.trimBox.topRightX)+" "+E(P.trimBox.topRightY)+"]"),P.artBox!==null&&te("/ArtBox ["+E(P.artBox.bottomLeftX)+" "+E(P.artBox.bottomLeftY)+" "+E(P.artBox.topRightX)+" "+E(P.artBox.topRightY)+"]"),typeof P.userUnit=="number"&&P.userUnit!==1&&te("/UserUnit "+P.userUnit),Tn.publish("putPage",{objId:Ae,pageContext:kt[z],pageNumber:z,page:ae}),te("/Contents "+ve+" 0 R"),te(">>"),te("endobj");var Ne=ae.join(`
`);return b===x&&(Ne+=`
Q`),ns(ve,!0),Po({data:Ne,filters:Bl(),objectId:ve}),te("endobj"),Ae},Cc=A.__private__.putPages=function(){var P,z,ae=[];for(P=1;P<=en;P++)kt[P].objId=$i(),kt[P].contentsObjId=$i();for(P=1;P<=en;P++)ae.push(ef({number:P,data:he[P],objId:kt[P].objId,contentsObjId:kt[P].contentsObjId,mediaBox:kt[P].mediaBox,cropBox:kt[P].cropBox,bleedBox:kt[P].bleedBox,trimBox:kt[P].trimBox,artBox:kt[P].artBox,userUnit:kt[P].userUnit,rootDictionaryObjId:Pd,resourceDictionaryObjId:Sl}));ns(Pd,!0),te("<</Type /Pages");var Ae="/Kids [";for(z=0;z<en;z++)Ae+=ae[z]+" 0 R ";te(Ae+"]"),te("/Count "+en),te(">>"),te("endobj"),Tn.publish("postPutPages")},tf=function(P){Tn.publish("putFont",{font:P,out:te,newObject:Qr,putStream:Po}),P.isAlreadyPutted!==!0&&(P.objectNumber=Qr(),te("<<"),te("/Type /Font"),te("/BaseFont /"+Eg(P.postScriptName)),te("/Subtype /Type1"),typeof P.encoding=="string"&&te("/Encoding /"+P.encoding),te("/FirstChar 32"),te("/LastChar 255"),te(">>"),te("endobj"))},xm=function(P){P.objectNumber=Qr();var z=[];z.push({key:"Type",value:"/XObject"}),z.push({key:"Subtype",value:"/Form"}),z.push({key:"BBox",value:"["+[E(P.x),E(P.y),E(P.x+P.width),E(P.y+P.height)].join(" ")+"]"}),z.push({key:"Matrix",value:"["+P.matrix.toString()+"]"});var ae=P.pages[1].join(`
`);Po({data:ae,additionalKeyValues:z,objectId:P.objectNumber}),te("endobj")},wm=function(P,z){z||(z=21);var ae=Qr(),Ae=function(Le,vt){var gt,Gt=[],Jt=1/(vt-1);for(gt=0;gt<1;gt+=Jt)Gt.push(gt);if(Gt.push(1),Le[0].offset!=0){var bn={offset:0,color:Le[0].color};Le.unshift(bn)}if(Le[Le.length-1].offset!=1){var pi={offset:1,color:Le[Le.length-1].color};Le.push(pi)}for(var Wn="",zn=0,hr=0;hr<Gt.length;hr++){for(gt=Gt[hr];gt>Le[zn+1].offset;)zn++;var jr=Le[zn].offset,Tr=(gt-jr)/(Le[zn+1].offset-jr),Ss=Le[zn].color,Cu=Le[zn+1].color;Wn+=X(Math.round((1-Tr)*Ss[0]+Tr*Cu[0]).toString(16))+X(Math.round((1-Tr)*Ss[1]+Tr*Cu[1]).toString(16))+X(Math.round((1-Tr)*Ss[2]+Tr*Cu[2]).toString(16))}return Wn.trim()}(P.colors,z),ve=[];ve.push({key:"FunctionType",value:"0"}),ve.push({key:"Domain",value:"[0.0 1.0]"}),ve.push({key:"Size",value:"["+z+"]"}),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]"}),Po({data:Ae,additionalKeyValues:ve,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:ae}),te("endobj"),P.objectNumber=Qr(),te("<< /ShadingType "+P.type),te("/ColorSpace /DeviceRGB");var Ne="/Coords ["+E(parseFloat(P.coords[0]))+" "+E(parseFloat(P.coords[1]))+" ";P.type===2?Ne+=E(parseFloat(P.coords[2]))+" "+E(parseFloat(P.coords[3])):Ne+=E(parseFloat(P.coords[2]))+" "+E(parseFloat(P.coords[3]))+" "+E(parseFloat(P.coords[4]))+" "+E(parseFloat(P.coords[5])),te(Ne+="]"),P.matrix&&te("/Matrix ["+P.matrix.toString()+"]"),te("/Function "+ae+" 0 R"),te("/Extend [true true]"),te(">>"),te("endobj")},bm=function(P,z){var ae=$i(),Ae=Qr();z.push({resourcesOid:ae,objectOid:Ae}),P.objectNumber=Ae;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:"["+P.boundingBox.map(E).join(" ")+"]"}),ve.push({key:"XStep",value:E(P.xStep)}),ve.push({key:"YStep",value:E(P.yStep)}),ve.push({key:"Resources",value:ae+" 0 R"}),P.matrix&&ve.push({key:"Matrix",value:"["+P.matrix.toString()+"]"}),Po({data:P.stream,additionalKeyValues:ve,objectId:P.objectNumber}),te("endobj")},lT=function(P){for(var z in P.objectNumber=Qr(),te("<<"),P)switch(z){case"opacity":te("/ca "+T(P[z]));break;case"stroke-opacity":te("/CA "+T(P[z]))}te(">>"),te("endobj")},_v=function(P){ns(P.resourcesOid,!0),te("<<"),te("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var z in te("/Font <<"),xt)xt.hasOwnProperty(z)&&(h===!1||h===!0&&f.hasOwnProperty(z))&&te("/"+z+" "+xt[z].objectNumber+" 0 R");te(">>")}(),function(){if(Object.keys(ht).length>0){for(var z in te("/Shading <<"),ht)ht.hasOwnProperty(z)&&ht[z]instanceof Uf&&ht[z].objectNumber>=0&&te("/"+z+" "+ht[z].objectNumber+" 0 R");Tn.publish("putShadingPatternDict"),te(">>")}}(),function(z){if(Object.keys(ht).length>0){for(var ae in te("/Pattern <<"),ht)ht.hasOwnProperty(ae)&&ht[ae]instanceof A.TilingPattern&&ht[ae].objectNumber>=0&&ht[ae].objectNumber<z&&te("/"+ae+" "+ht[ae].objectNumber+" 0 R");Tn.publish("putTilingPatternDict"),te(">>")}}(P.objectOid),function(){if(Object.keys(Pt).length>0){var z;for(z in te("/ExtGState <<"),Pt)Pt.hasOwnProperty(z)&&Pt[z].objectNumber>=0&&te("/"+z+" "+Pt[z].objectNumber+" 0 R");Tn.publish("putGStateDict"),te(">>")}}(),function(){for(var z in te("/XObject <<"),Wt)Wt.hasOwnProperty(z)&&Wt[z].objectNumber>=0&&te("/"+z+" "+Wt[z].objectNumber+" 0 R");Tn.publish("putXobjectDict"),te(">>")}(),te(">>"),te("endobj")},V2=function(P){Mt[P.fontName]=Mt[P.fontName]||{},Mt[P.fontName][P.fontStyle]=P.id},K2=function(P,z,ae,Ae,ve){var Ne={id:"F"+(Object.keys(xt).length+1).toString(10),postScriptName:P,fontName:z,fontStyle:ae,encoding:Ae,isStandardFont:ve||!1,metadata:{}};return Tn.publish("addFont",{font:Ne,instance:this}),xt[Ne.id]=Ne,V2(Ne),Ne.id},Io=A.__private__.pdfEscape=A.pdfEscape=function(P,z){return function(ae,Ae){var ve,Ne,Le,vt,gt,Gt,Jt,bn,pi;if(Le=(Ae=Ae||{}).sourceEncoding||"Unicode",gt=Ae.outputEncoding,(Ae.autoencode||gt)&&xt[Ue].metadata&&xt[Ue].metadata[Le]&&xt[Ue].metadata[Le].encoding&&(vt=xt[Ue].metadata[Le].encoding,!gt&&xt[Ue].encoding&&(gt=xt[Ue].encoding),!gt&&vt.codePages&&(gt=vt.codePages[0]),typeof gt=="string"&&(gt=vt[gt]),gt)){for(Jt=!1,Gt=[],ve=0,Ne=ae.length;ve<Ne;ve++)(bn=gt[ae.charCodeAt(ve)])?Gt.push(String.fromCharCode(bn)):Gt.push(ae[ve]),Gt[ve].charCodeAt(0)>>8&&(Jt=!0);ae=Gt.join("")}for(ve=ae.length;Jt===void 0&&ve!==0;)ae.charCodeAt(ve-1)>>8&&(Jt=!0),ve--;if(!Jt)return ae;for(Gt=Ae.noBOM?[]:[254,255],ve=0,Ne=ae.length;ve<Ne;ve++){if((pi=(bn=ae.charCodeAt(ve))>>8)>>8)throw new Error("Character at position "+ve+" of string '"+ae+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");Gt.push(pi),Gt.push(bn-(pi<<8))}return String.fromCharCode.apply(void 0,Gt)}(P,z).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Ev=A.__private__.beginPage=function(P){he[++en]=[],kt[en]={objId:0,contentsObjId:0,userUnit:Number(o),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(P[0]),topRightY:Number(P[1])}},W2(en),Fe(he[M])},q2=function(P,z){var ae,Ae,ve;switch(n=z||n,typeof P=="string"&&(ae=y(P.toLowerCase()),Array.isArray(ae)&&(Ae=ae[0],ve=ae[1])),Array.isArray(P)&&(Ae=P[0]*Ge,ve=P[1]*Ge),isNaN(Ae)&&(Ae=i[0],ve=i[1]),(Ae>14400||ve>14400)&&(Yn.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),Ae=Math.min(14400,Ae),ve=Math.min(14400,ve)),i=[Ae,ve],n.substr(0,1)){case"l":ve>Ae&&(i=[ve,Ae]);break;case"p":Ae>ve&&(i=[ve,Ae])}Ev(i),yT(Vt),te(Em),Iv!==0&&te(Iv+" J"),Fd!==0&&te(Fd+" j"),Tn.publish("addPage",{pageNumber:en})},Nv=function(P){P>0&&P<=en&&(he.splice(P,1),kt.splice(P,1),en--,M>en&&(M=en),this.setPage(M))},W2=function(P){P>0&&P<=en&&(M=P)},G2=A.__private__.getNumberOfPages=A.getNumberOfPages=function(){return he.length-1},Y2=function(P,z,ae){var Ae,ve=void 0;return ae=ae||{},P=P!==void 0?P:xt[Ue].fontName,z=z!==void 0?z:xt[Ue].fontStyle,Ae=P.toLowerCase(),Mt[Ae]!==void 0&&Mt[Ae][z]!==void 0?ve=Mt[Ae][z]:Mt[P]!==void 0&&Mt[P][z]!==void 0?ve=Mt[P][z]:ae.disableWarning===!1&&Yn.warn("Unable to look up font label for font '"+P+"', '"+z+"'. Refer to getFontList() for available fonts."),ve||ae.noFallback||(ve=Mt.times[z])==null&&(ve=Mt.times.normal),ve},Sc=A.__private__.putInfo=function(){var P=Qr(),z=function(Ae){return Ae};for(var ae in d!==null&&(z=rs.encryptor(P,0)),te("<<"),te("/Producer ("+Io(z("jsPDF "+Nt.version))+")"),We)We.hasOwnProperty(ae)&&We[ae]&&te("/"+ae.substr(0,1).toUpperCase()+ae.substr(1)+" ("+Io(z(We[ae]))+")");te("/CreationDate ("+Io(z(D))+")"),te(">>"),te("endobj")},Cm=A.__private__.putCatalog=function(P){var z=(P=P||{}).rootDictionaryObjId||Pd;switch(Qr(),te("<<"),te("/Type /Catalog"),te("/Pages "+z+" 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(dt||(dt="continuous"),dt){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")}ze&&te("/PageMode /"+ze),Tn.publish("putCatalog"),te(">>"),te("endobj")},cT=A.__private__.putTrailer=function(){te("trailer"),te("<<"),te("/Size "+(K+1)),te("/Root "+K+" 0 R"),te("/Info "+(K-1)+" 0 R"),d!==null&&te("/Encrypt "+rs.oid+" 0 R"),te("/ID [ <"+H+"> <"+H+"> ]"),te(">>")},fi=A.__private__.putHeader=function(){te("%PDF-"+p),te("%ºß¬à")},X2=A.__private__.putXRef=function(){var P="0000000000";te("xref"),te("0 "+(K+1)),te("0000000000 65535 f ");for(var z=1;z<=K;z++)typeof Z[z]=="function"?te((P+Z[z]()).slice(-10)+" 00000 n "):Z[z]!==void 0?te((P+Z[z]).slice(-10)+" 00000 n "):te("0000000000 00000 n ")},kc=A.__private__.buildDocument=function(){var P;K=0,se=0,de=[],Z=[],ie=[],Pd=$i(),Sl=$i(),Fe(de),Tn.publish("buildDocument"),fi(),Cc(),function(){Tn.publish("putAdditionalObjects");for(var ae=0;ae<ie.length;ae++){var Ae=ie[ae];ns(Ae.objId,!0),te(Ae.content),te("endobj")}Tn.publish("postPutAdditionalObjects")}(),P=[],function(){for(var ae in xt)xt.hasOwnProperty(ae)&&(h===!1||h===!0&&f.hasOwnProperty(ae))&&tf(xt[ae])}(),function(){var ae;for(ae in Pt)Pt.hasOwnProperty(ae)&&lT(Pt[ae])}(),function(){for(var ae in Wt)Wt.hasOwnProperty(ae)&&xm(Wt[ae])}(),function(ae){var Ae;for(Ae in ht)ht.hasOwnProperty(Ae)&&(ht[Ae]instanceof Uf?wm(ht[Ae]):ht[Ae]instanceof Jg&&bm(ht[Ae],ae))}(P),Tn.publish("putResources"),P.forEach(_v),_v({resourcesOid:Sl,objectOid:Number.MAX_SAFE_INTEGER}),Tn.publish("postPutResources"),d!==null&&(rs.oid=Qr(),te("<<"),te("/Filter /Standard"),te("/V "+rs.v),te("/R "+rs.r),te("/U <"+rs.toHexString(rs.U)+">"),te("/O <"+rs.toHexString(rs.O)+">"),te("/P "+rs.P),te(">>"),te("endobj")),Sc(),Cm();var z=se;return X2(),cT(),te("startxref"),te(""+z),te("%%EOF"),Fe(he[M]),de.join(`
`)},Sm=A.__private__.getBlob=function(P){return new Blob([Ze(P)],{type:"application/pdf"})},jv=function(P){for(;P.firstChild;)P.removeChild(P.firstChild)},Ja=function(P){var z,ae=P.document,Ae=ae.documentElement,ve=ae.head,Ne=ae.body;return ve||(ve=ae.createElement("head"),Ae.appendChild(ve)),Ne||(Ne=ae.createElement("body"),Ae.appendChild(Ne)),jv(ve),jv(Ne),(z=ae.createElement("style")).appendChild(ae.createTextNode("html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}")),ve.appendChild(z),{document:ae,body:Ne}},km=A.output=A.__private__.output=(Jr=function(P,z){switch(typeof(z=z||{})=="string"?z={filename:z}:z.filename=z.filename||"generated.pdf",P){case void 0:return kc();case"save":A.save(z.filename);break;case"arraybuffer":return Ze(kc());case"blob":return Sm(kc());case"bloburi":case"bloburl":if(Kt.URL!==void 0&&typeof Kt.URL.createObjectURL=="function")return Kt.URL&&Kt.URL.createObjectURL(Sm(kc()))||void 0;Yn.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var ae="",Ae=kc();try{ae=IJ(Ae)}catch{ae=IJ(unescape(encodeURIComponent(Ae)))}return"data:application/pdf;filename="+encodeURIComponent(z.filename)+";base64,"+ae;case"pdfobjectnewwindow":if(Object.prototype.toString.call(Kt)==="[object Window]"){var ve="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",Ne=!z.pdfObjectUrl;Ne||(ve=z.pdfObjectUrl);var Le=Kt.open();if(Le!==null){var vt=Ja(Le),gt=vt.document.createElement("script"),Gt=this;gt.src=ve,Ne&&(gt.integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==",gt.crossOrigin="anonymous"),gt.onload=function(){Le.PDFObject.embed(Gt.output("dataurlstring"),z)},vt.body.appendChild(gt)}return Le}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(Kt)==="[object Window]"){var Jt=z.pdfJsUrl||"examples/PDF.js/web/viewer.html",bn=Kt.open();if(bn!==null){var pi=Ja(bn),Wn=pi.document.createElement("iframe"),zn=Jt.indexOf("?")===-1?"?":"&";Gt=this,Wn.id="pdfViewer",Wn.width="500px",Wn.height="400px",Wn.src=Jt+zn+"file=&downloadName="+encodeURIComponent(z.filename),Wn.onload=function(){bn.document.title=z.filename,Wn.contentWindow.PDFViewerApplication.open(Gt.output("bloburl"))},pi.body.appendChild(Wn)}return bn}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(Kt)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var hr=Kt.open();if(hr!==null){var jr=Ja(hr),Tr=jr.document.createElement("iframe");Tr.src=this.output("datauristring",z),jr.body.appendChild(Tr),hr.document.title=z.filename}if(hr||typeof safari>"u")return hr;break;case"datauri":case"dataurl":return Kt.document.location.href=this.output("datauristring",z);default:return null}},Jr.foo=function(){try{return Jr.apply(this,arguments)}catch(ae){var P=ae.stack||"";~P.indexOf(" at ")&&(P=P.split(" at ")[1]);var z="Error in function "+P.split(`
`)[0].split("<")[0]+": "+ae.message;if(!Kt.console)throw new Error(z);Kt.console.error(z,ae),Kt.alert&&alert(z)}},Jr.foo.bar=Jr,Jr.foo),yu=function(P){return Array.isArray(Ut)===!0&&Ut.indexOf(P)>-1};switch(r){case"pt":Ge=1;break;case"mm":Ge=72/25.4;break;case"cm":Ge=72/2.54;break;case"in":Ge=72;break;case"px":Ge=yu("px_scaling")==1?.75:96/72;break;case"pc":case"em":Ge=12;break;case"ex":Ge=6;break;default:if(typeof r!="number")throw new Error("Invalid unit: "+r);Ge=r}var rs=null;ce(),$();var J2=A.__private__.getPageInfo=A.getPageInfo=function(P){if(isNaN(P)||P%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:kt[P].objId,pageNumber:P,pageContext:kt[P]}},uT=A.__private__.getPageInfoByObjId=function(P){if(isNaN(P)||P%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var z in kt)if(kt[z].objId===P)break;return J2(z)},dT=A.__private__.getCurrentPageInfo=A.getCurrentPageInfo=function(){return{objId:kt[M].objId,pageNumber:M,pageContext:kt[M]}};A.addPage=function(){return q2.apply(this,arguments),this},A.setPage=function(){return W2.apply(this,arguments),Fe.call(this,he[M]),this},A.insertPage=function(P){return this.addPage(),this.movePage(M,P),this},A.movePage=function(P,z){var ae,Ae;if(P>z){ae=he[P],Ae=kt[P];for(var ve=P;ve>z;ve--)he[ve]=he[ve-1],kt[ve]=kt[ve-1];he[z]=ae,kt[z]=Ae,this.setPage(z)}else if(P<z){ae=he[P],Ae=kt[P];for(var Ne=P;Ne<z;Ne++)he[Ne]=he[Ne+1],kt[Ne]=kt[Ne+1];he[z]=ae,kt[z]=Ae,this.setPage(z)}return this},A.deletePage=function(){return Nv.apply(this,arguments),this},A.__private__.text=A.text=function(P,z,ae,Ae,ve){var Ne,Le,vt,gt,Gt,Jt,bn,pi,Wn,zn=(Ae=Ae||{}).scope||this;if(typeof P=="number"&&typeof z=="number"&&(typeof ae=="string"||Array.isArray(ae))){var hr=ae;ae=z,z=P,P=hr}if(arguments[3]instanceof yt==0?(vt=arguments[4],gt=arguments[5],Qn(bn=arguments[3])==="object"&&bn!==null||(typeof vt=="string"&&(gt=vt,vt=null),typeof bn=="string"&&(gt=bn,bn=null),typeof bn=="number"&&(vt=bn,bn=null),Ae={flags:bn,angle:vt,align:gt})):(j("The transform parameter of text() with a Matrix value"),Wn=ve),isNaN(z)||isNaN(ae)||P==null)throw new Error("Invalid arguments passed to jsPDF.text");if(P.length===0)return zn;var jr,Tr="",Ss=typeof Ae.lineHeightFactor=="number"?Ae.lineHeightFactor:nf,Cu=zn.internal.scaleFactor;function Lv(tr){return tr=tr.split("	").join(Array(Ae.TabLen||9).join(" ")),Io(tr,bn)}function af(tr){for(var nr,Zr=tr.concat(),Bi=[],ku=Zr.length;ku--;)typeof(nr=Zr.shift())=="string"?Bi.push(nr):Array.isArray(tr)&&(nr.length===1||nr[1]===void 0&&nr[2]===void 0)?Bi.push(nr[0]):Bi.push([nr[0],nr[1],nr[2]]);return Bi}function of(tr,nr){var Zr;if(typeof tr=="string")Zr=nr(tr)[0];else if(Array.isArray(tr)){for(var Bi,ku,$v=tr.concat(),Dm=[],lC=$v.length;lC--;)typeof(Bi=$v.shift())=="string"?Dm.push(nr(Bi)[0]):Array.isArray(Bi)&&typeof Bi[0]=="string"&&(ku=nr(Bi[0],Bi[1],Bi[2]),Dm.push([ku[0],ku[1],ku[2]]));Zr=Dm}return Zr}var Md=!1,lf=!0;if(typeof P=="string")Md=!0;else if(Array.isArray(P)){var Pm=P.concat();Le=[];for(var Im,ks=Pm.length;ks--;)(typeof(Im=Pm.shift())!="string"||Array.isArray(Im)&&typeof Im[0]!="string")&&(lf=!1);Md=lf}if(Md===!1)throw new Error('Type of text must be string or Array. "'+P+'" is not recognized.');typeof P=="string"&&(P=P.match(/[\r?\n]/)?P.split(/\r\n|\r|\n/g):[P]);var cf=Te/zn.internal.scaleFactor,uf=cf*(Ss-1);switch(Ae.baseline){case"bottom":ae-=uf;break;case"top":ae+=cf-uf;break;case"hanging":ae+=cf-2*uf;break;case"middle":ae+=cf/2-uf}if((Jt=Ae.maxWidth||0)>0&&(typeof P=="string"?P=zn.splitTextToSize(P,Jt):Object.prototype.toString.call(P)==="[object Array]"&&(P=P.reduce(function(tr,nr){return tr.concat(zn.splitTextToSize(nr,Jt))},[]))),Ne={text:P,x:z,y:ae,options:Ae,mutex:{pdfEscape:Io,activeFontKey:Ue,fonts:xt,activeFontSize:Te}},Tn.publish("preProcessText",Ne),P=Ne.text,vt=(Ae=Ne.options).angle,Wn instanceof yt==0&&vt&&typeof vt=="number"){vt*=Math.PI/180,Ae.rotationDirection===0&&(vt=-vt),b===x&&(vt=-vt);var Rv=Math.cos(vt),Ec=Math.sin(vt);Wn=new yt(Rv,Ec,-Ec,Rv,0,0)}else vt&&vt instanceof yt&&(Wn=vt);b!==x||Wn||(Wn=ts),(Gt=Ae.charSpace||Nm)!==void 0&&(Tr+=E(F(Gt))+` Tc
`,this.setCharSpace(this.getCharSpace()||0)),(pi=Ae.horizontalScale)!==void 0&&(Tr+=E(100*pi)+` Tz
`),Ae.lang;var Ys=-1,aC=Ae.renderingMode!==void 0?Ae.renderingMode:Ae.stroke,Om=zn.internal.getCurrentPageInfo().pageContext;switch(aC){case 0:case!1:case"fill":Ys=0;break;case 1:case!0:case"stroke":Ys=1;break;case 2:case"fillThenStroke":Ys=2;break;case 3:case"invisible":Ys=3;break;case 4:case"fillAndAddForClipping":Ys=4;break;case 5:case"strokeAndAddPathForClipping":Ys=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":Ys=6;break;case 7:case"addToPathForClipping":Ys=7}var oC=Om.usedRenderingMode!==void 0?Om.usedRenderingMode:-1;Ys!==-1?Tr+=Ys+` Tr
`:oC!==-1&&(Tr+=`0 Tr
`),Ys!==-1&&(Om.usedRenderingMode=Ys),gt=Ae.align||"left";var Oo,df=Te*Ss,Uv=zn.internal.pageSize.getWidth(),Fm=xt[Ue];Gt=Ae.charSpace||Nm,Jt=Ae.maxWidth||0,bn=Object.assign({autoencode:!0,noBOM:!0},Ae.flags);var hf=[],Dv=function(tr){return zn.getStringUnitWidth(tr,{font:Fm,charSpace:Gt,fontSize:Te,doKerning:!1})*Te/Cu};if(Object.prototype.toString.call(P)==="[object Array]"){var Xs;Le=af(P),gt!=="left"&&(Oo=Le.map(Dv));var Sa,Mm=0;if(gt==="right"){z-=Oo[0],P=[],ks=Le.length;for(var Ld=0;Ld<ks;Ld++)Ld===0?(Sa=vu(z),Xs=xu(ae)):(Sa=F(Mm-Oo[Ld]),Xs=-df),P.push([Le[Ld],Sa,Xs]),Mm=Oo[Ld]}else if(gt==="center"){z-=Oo[0]/2,P=[],ks=Le.length;for(var Rd=0;Rd<ks;Rd++)Rd===0?(Sa=vu(z),Xs=xu(ae)):(Sa=F((Mm-Oo[Rd])/2),Xs=-df),P.push([Le[Rd],Sa,Xs]),Mm=Oo[Rd]}else if(gt==="left"){P=[],ks=Le.length;for(var Lm=0;Lm<ks;Lm++)P.push(Le[Lm])}else if(gt==="justify"&&Fm.encoding==="Identity-H"){P=[],ks=Le.length,Jt=Jt!==0?Jt:Uv;for(var Af=0,mi=0;mi<ks;mi++)if(Xs=mi===0?xu(ae):-df,Sa=mi===0?vu(z):Af,mi<ks-1){var BT=F((Jt-Oo[mi])/(Le[mi].split(" ").length-1)),Nc=Le[mi].split(" ");P.push([Nc[0]+" ",Sa,Xs]),Af=0;for(var _l=1;_l<Nc.length;_l++){var ff=(Dv(Nc[_l-1]+" "+Nc[_l])-Dv(Nc[_l]))*Cu+BT;_l==Nc.length-1?P.push([Nc[_l],ff,0]):P.push([Nc[_l]+" ",ff,0]),Af-=ff}}else P.push([Le[mi],Sa,Xs]);P.push(["",Af,0])}else{if(gt!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(P=[],ks=Le.length,Jt=Jt!==0?Jt:Uv,mi=0;mi<ks;mi++){Xs=mi===0?xu(ae):-df,Sa=mi===0?vu(z):0;var Qv=Le[mi].split(" ").length-1,Hv=Qv>0?(Jt-Oo[mi])/Qv:0;mi<ks-1?hf.push(E(F(Hv))):hf.push(0),P.push([Le[mi],Sa,Xs])}}}(typeof Ae.R2L=="boolean"?Ae.R2L:Qe)===!0&&(P=of(P,function(tr,nr,Zr){return[tr.split("").reverse().join(""),nr,Zr]})),Ne={text:P,x:z,y:ae,options:Ae,mutex:{pdfEscape:Io,activeFontKey:Ue,fonts:xt,activeFontSize:Te}},Tn.publish("postProcessText",Ne),P=Ne.text,jr=Ne.mutex.isHex||!1;var Rm=xt[Ue].encoding;Rm!=="WinAnsiEncoding"&&Rm!=="StandardEncoding"||(P=of(P,function(tr,nr,Zr){return[Lv(tr),nr,Zr]})),Le=af(P),P=[];for(var pf,mf,Ud,Su=Array.isArray(Le[0])?1:0,Dd="",Um=function(tr,nr,Zr){var Bi="";return Zr instanceof yt?(Zr=typeof Ae.angle=="number"?Hi(Zr,new yt(1,0,0,1,tr,nr)):Hi(new yt(1,0,0,1,tr,nr),Zr),b===x&&(Zr=Hi(new yt(1,0,0,-1,0,0),Zr)),Bi=Zr.join(" ")+` Tm
`):Bi=E(tr)+" "+E(nr)+` Td
`,Bi},Bs=0;Bs<Le.length;Bs++){switch(Dd="",Su){case 1:Ud=(jr?"<":"(")+Le[Bs][0]+(jr?">":")"),pf=parseFloat(Le[Bs][1]),mf=parseFloat(Le[Bs][2]);break;case 0:Ud=(jr?"<":"(")+Le[Bs]+(jr?">":")"),pf=vu(z),mf=xu(ae)}hf!==void 0&&hf[Bs]!==void 0&&(Dd=hf[Bs]+` Tw
`),Bs===0?P.push(Dd+Um(pf,mf,Wn)+Ud):Su===0?P.push(Dd+Ud):Su===1&&P.push(Dd+Um(pf,mf,Wn)+Ud)}P=Su===0?P.join(` Tj
T* `):P.join(` Tj
`),P+=` Tj
`;var jc=`BT
/`;return jc+=Ue+" "+Te+` Tf
`,jc+=E(Te*Ss)+` TL
`,jc+=_c+`
`,jc+=Tr,jc+=P,te(jc+="ET"),f[Ue]=!0,zn};var hT=A.__private__.clip=A.clip=function(P){return te(P==="evenodd"?"W*":"W"),this};A.clipEvenOdd=function(){return hT("evenodd")},A.__private__.discardPath=A.discardPath=function(){return te("n"),this};var Bc=A.__private__.isValidStyle=function(P){var z=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(P)!==-1&&(z=!0),z};A.__private__.setDefaultPathOperation=A.setDefaultPathOperation=function(P){return Bc(P)&&(u=P),this};var Z2=A.__private__.getStyle=A.getStyle=function(P){var z=u;switch(P){case"D":case"S":z="S";break;case"F":z="f";break;case"FD":case"DF":z="B";break;case"f":case"f*":case"B":case"B*":z=P}return z},Bm=A.close=function(){return te("h"),this};A.stroke=function(){return te("S"),this},A.fill=function(P){return _m("f",P),this},A.fillEvenOdd=function(P){return _m("f*",P),this},A.fillStroke=function(P){return _m("B",P),this},A.fillStrokeEvenOdd=function(P){return _m("B*",P),this};var _m=function(P,z){Qn(z)==="object"?fT(z,P):te(P)},Tv=function(P){P===null||b===x&&P===void 0||(P=Z2(P),te(P))};function AT(P,z,ae,Ae,ve){var Ne=new Jg(z||this.boundingBox,ae||this.xStep,Ae||this.yStep,this.gState,ve||this.matrix);Ne.stream=this.stream;var Le=P+"$$"+this.cloneIndex+++"$$";return Sr(Le,Ne),Ne}var fT=function(P,z){var ae=Lt[P.key],Ae=ht[ae];if(Ae instanceof Uf)te("q"),te(pT(z)),Ae.gState&&A.setGState(Ae.gState),te(P.matrix.toString()+" cm"),te("/"+ae+" sh"),te("Q");else if(Ae instanceof Jg){var ve=new yt(1,0,0,-1,0,sf());P.matrix&&(ve=ve.multiply(P.matrix||ts),ae=AT.call(Ae,P.key,P.boundingBox,P.xStep,P.yStep,ve).id),te("q"),te("/Pattern cs"),te("/"+ae+" scn"),Ae.gState&&A.setGState(Ae.gState),te(z),te("Q")}},pT=function(P){switch(P){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"}},Id=A.moveTo=function(P,z){return te(E(F(P))+" "+E(L(z))+" m"),this},eC=A.lineTo=function(P,z){return te(E(F(P))+" "+E(L(z))+" l"),this},Od=A.curveTo=function(P,z,ae,Ae,ve,Ne){return te([E(F(P)),E(L(z)),E(F(ae)),E(L(Ae)),E(F(ve)),E(L(Ne)),"c"].join(" ")),this};A.__private__.line=A.line=function(P,z,ae,Ae,ve){if(isNaN(P)||isNaN(z)||isNaN(ae)||isNaN(Ae)||!Bc(ve))throw new Error("Invalid arguments passed to jsPDF.line");return b===v?this.lines([[ae-P,Ae-z]],P,z,[1,1],ve||"S"):this.lines([[ae-P,Ae-z]],P,z,[1,1]).stroke()},A.__private__.lines=A.lines=function(P,z,ae,Ae,ve,Ne){var Le,vt,gt,Gt,Jt,bn,pi,Wn,zn,hr,jr,Tr;if(typeof P=="number"&&(Tr=ae,ae=z,z=P,P=Tr),Ae=Ae||[1,1],Ne=Ne||!1,isNaN(z)||isNaN(ae)||!Array.isArray(P)||!Array.isArray(Ae)||!Bc(ve)||typeof Ne!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(Id(z,ae),Le=Ae[0],vt=Ae[1],Gt=P.length,hr=z,jr=ae,gt=0;gt<Gt;gt++)(Jt=P[gt]).length===2?(hr=Jt[0]*Le+hr,jr=Jt[1]*vt+jr,eC(hr,jr)):(bn=Jt[0]*Le+hr,pi=Jt[1]*vt+jr,Wn=Jt[2]*Le+hr,zn=Jt[3]*vt+jr,hr=Jt[4]*Le+hr,jr=Jt[5]*vt+jr,Od(bn,pi,Wn,zn,hr,jr));return Ne&&Bm(),Tv(ve),this},A.path=function(P){for(var z=0;z<P.length;z++){var ae=P[z],Ae=ae.c;switch(ae.op){case"m":Id(Ae[0],Ae[1]);break;case"l":eC(Ae[0],Ae[1]);break;case"c":Od.apply(this,Ae);break;case"h":Bm()}}return this},A.__private__.rect=A.rect=function(P,z,ae,Ae,ve){if(isNaN(P)||isNaN(z)||isNaN(ae)||isNaN(Ae)||!Bc(ve))throw new Error("Invalid arguments passed to jsPDF.rect");return b===v&&(Ae=-Ae),te([E(F(P)),E(L(z)),E(F(ae)),E(F(Ae)),"re"].join(" ")),Tv(ve),this},A.__private__.triangle=A.triangle=function(P,z,ae,Ae,ve,Ne,Le){if(isNaN(P)||isNaN(z)||isNaN(ae)||isNaN(Ae)||isNaN(ve)||isNaN(Ne)||!Bc(Le))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[ae-P,Ae-z],[ve-ae,Ne-Ae],[P-ve,z-Ne]],P,z,[1,1],Le,!0),this},A.__private__.roundedRect=A.roundedRect=function(P,z,ae,Ae,ve,Ne,Le){if(isNaN(P)||isNaN(z)||isNaN(ae)||isNaN(Ae)||isNaN(ve)||isNaN(Ne)||!Bc(Le))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var vt=4/3*(Math.SQRT2-1);return ve=Math.min(ve,.5*ae),Ne=Math.min(Ne,.5*Ae),this.lines([[ae-2*ve,0],[ve*vt,0,ve,Ne-Ne*vt,ve,Ne],[0,Ae-2*Ne],[0,Ne*vt,-ve*vt,Ne,-ve,Ne],[2*ve-ae,0],[-ve*vt,0,-ve,-Ne*vt,-ve,-Ne],[0,2*Ne-Ae],[0,-Ne*vt,ve*vt,-Ne,ve,-Ne]],P+ve,z,[1,1],Le,!0),this},A.__private__.ellipse=A.ellipse=function(P,z,ae,Ae,ve){if(isNaN(P)||isNaN(z)||isNaN(ae)||isNaN(Ae)||!Bc(ve))throw new Error("Invalid arguments passed to jsPDF.ellipse");var Ne=4/3*(Math.SQRT2-1)*ae,Le=4/3*(Math.SQRT2-1)*Ae;return Id(P+ae,z),Od(P+ae,z-Le,P+Ne,z-Ae,P,z-Ae),Od(P-Ne,z-Ae,P-ae,z-Le,P-ae,z),Od(P-ae,z+Le,P-Ne,z+Ae,P,z+Ae),Od(P+Ne,z+Ae,P+ae,z+Le,P+ae,z),Tv(ve),this},A.__private__.circle=A.circle=function(P,z,ae,Ae){if(isNaN(P)||isNaN(z)||isNaN(ae)||!Bc(Ae))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(P,z,ae,ae,Ae)},A.setFont=function(P,z,ae){return ae&&(z=_(z,ae)),Ue=Y2(P,z,{disableWarning:!1}),this};var mT=A.__private__.getFont=A.getFont=function(){return xt[Y2.apply(A,arguments)]};A.__private__.getFontList=A.getFontList=function(){var P,z,ae={};for(P in Mt)if(Mt.hasOwnProperty(P))for(z in ae[P]=[],Mt[P])Mt[P].hasOwnProperty(z)&&ae[P].push(z);return ae},A.addFont=function(P,z,ae,Ae,ve){var Ne=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&Ne.indexOf(arguments[3])!==-1?ve=arguments[3]:arguments[3]&&Ne.indexOf(arguments[3])==-1&&(ae=_(ae,Ae)),K2.call(this,P,z,ae,ve=ve||"Identity-H")};var nf,Vt=e.lineWidth||.200025,gT=A.__private__.getLineWidth=A.getLineWidth=function(){return Vt},yT=A.__private__.setLineWidth=A.setLineWidth=function(P){return Vt=P,te(E(F(P))+" w"),this};A.__private__.setLineDash=Nt.API.setLineDash=Nt.API.setLineDashPattern=function(P,z){if(P=P||[],z=z||0,isNaN(z)||!Array.isArray(P))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return P=P.map(function(ae){return E(F(ae))}).join(" "),z=E(F(z)),te("["+P+"] "+z+" d"),this};var vT=A.__private__.getLineHeight=A.getLineHeight=function(){return Te*nf};A.__private__.getLineHeight=A.getLineHeight=function(){return Te*nf};var xT=A.__private__.setLineHeightFactor=A.setLineHeightFactor=function(P){return typeof(P=P||1.15)=="number"&&(nf=P),this},wT=A.__private__.getLineHeightFactor=A.getLineHeightFactor=function(){return nf};xT(e.lineHeight);var vu=A.__private__.getHorizontalCoordinate=function(P){return F(P)},xu=A.__private__.getVerticalCoordinate=function(P){return b===x?P:kt[M].mediaBox.topRightY-kt[M].mediaBox.bottomLeftY-F(P)},bT=A.__private__.getHorizontalCoordinateString=A.getHorizontalCoordinateString=function(P){return E(vu(P))},CT=A.__private__.getVerticalCoordinateString=A.getVerticalCoordinateString=function(P){return E(xu(P))},Em=e.strokeColor||"0 G";A.__private__.getStrokeColor=A.getDrawColor=function(){return bc(Em)},A.__private__.setStrokeColor=A.setDrawColor=function(P,z,ae,Ae){return Em=kl({ch1:P,ch2:z,ch3:ae,ch4:Ae,pdfColorType:"draw",precision:2}),te(Em),this};var Pv=e.fillColor||"0 g";A.__private__.getFillColor=A.getFillColor=function(){return bc(Pv)},A.__private__.setFillColor=A.setFillColor=function(P,z,ae,Ae){return Pv=kl({ch1:P,ch2:z,ch3:ae,ch4:Ae,pdfColorType:"fill",precision:2}),te(Pv),this};var _c=e.textColor||"0 g",ST=A.__private__.getTextColor=A.getTextColor=function(){return bc(_c)};A.__private__.setTextColor=A.setTextColor=function(P,z,ae,Ae){return _c=kl({ch1:P,ch2:z,ch3:ae,ch4:Ae,pdfColorType:"text",precision:3}),this};var Nm=e.charSpace,kT=A.__private__.getCharSpace=A.getCharSpace=function(){return parseFloat(Nm||0)};A.__private__.setCharSpace=A.setCharSpace=function(P){if(isNaN(P))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return Nm=P,this};var Iv=0;A.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},A.__private__.setLineCap=A.setLineCap=function(P){var z=A.CapJoinStyles[P];if(z===void 0)throw new Error("Line cap style of '"+P+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Iv=z,te(z+" J"),this};var Fd=0;A.__private__.setLineJoin=A.setLineJoin=function(P){var z=A.CapJoinStyles[P];if(z===void 0)throw new Error("Line join style of '"+P+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Fd=z,te(z+" j"),this},A.__private__.setLineMiterLimit=A.__private__.setMiterLimit=A.setLineMiterLimit=A.setMiterLimit=function(P){if(P=P||0,isNaN(P))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return te(E(F(P))+" M"),this},A.GState=yN,A.setGState=function(P){(P=typeof P=="string"?Pt[qt[P]]:Ov(null,P)).equals(er)||(te("/"+P.id+" gs"),er=P)};var Ov=function(P,z){if(!P||!qt[P]){var ae=!1;for(var Ae in Pt)if(Pt.hasOwnProperty(Ae)&&Pt[Ae].equals(z)){ae=!0;break}if(ae)z=Pt[Ae];else{var ve="GS"+(Object.keys(Pt).length+1).toString(10);Pt[ve]=z,z.id=ve}return P&&(qt[P]=z.id),Tn.publish("addGState",z),z}};A.addGState=function(P,z){return Ov(P,z),this},A.saveGraphicsState=function(){return te("q"),zt.push({key:Ue,size:Te,color:_c}),this},A.restoreGraphicsState=function(){te("Q");var P=zt.pop();return Ue=P.key,Te=P.size,_c=P.color,er=null,this},A.setCurrentTransformationMatrix=function(P){return te(P.toString()+" cm"),this},A.comment=function(P){return te("#"+P),this};var rf=function(P,z){var ae=P||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return ae},set:function(Ne){isNaN(Ne)||(ae=parseFloat(Ne))}});var Ae=z||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return Ae},set:function(Ne){isNaN(Ne)||(Ae=parseFloat(Ne))}});var ve="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return ve},set:function(Ne){ve=Ne.toString()}}),this},Fv=function(P,z,ae,Ae){rf.call(this,P,z),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 Ne=Ae||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return Ne},set:function(Le){isNaN(Le)||(Ne=parseFloat(Le))}}),this},jm=function(){this.page=en,this.currentPage=M,this.pages=he.slice(0),this.pagesContext=kt.slice(0),this.x=pe,this.y=mt,this.matrix=ct,this.width=tC(M),this.height=bu(M),this.outputDestination=Se,this.id="",this.objectNumber=-1};jm.prototype.restore=function(){en=this.page,M=this.currentPage,kt=this.pagesContext,he=this.pages,pe=this.x,mt=this.y,ct=this.matrix,wu(M,this.width),nC(M,this.height),Se=this.outputDestination};var Mv=function(P,z,ae,Ae,ve){Dr.push(new jm),en=M=0,he=[],pe=P,mt=z,ct=ve,Ev([ae,Ae])};for(var Tm in A.beginFormObject=function(P,z,ae,Ae,ve){return Mv(P,z,ae,Ae,ve),this},A.endFormObject=function(P){return function(z){if(wn[z])Dr.pop().restore();else{var ae=new jm,Ae="Xo"+(Object.keys(Wt).length+1).toString(10);ae.id=Ae,wn[z]=Ae,Wt[Ae]=ae,Tn.publish("addFormObject",ae),Dr.pop().restore()}}(P),this},A.doFormObject=function(P,z){var ae=Wt[wn[P]];return te("q"),te(z.toString()+" cm"),te("/"+ae.id+" Do"),te("Q"),this},A.getFormObject=function(P){var z=Wt[wn[P]];return{x:z.x,y:z.y,width:z.width,height:z.height,matrix:z.matrix}},A.save=function(P,z){return P=P||"generated.pdf",(z=z||{}).returnPromise=z.returnPromise||!1,z.returnPromise===!1?(Of(Sm(kc()),P),typeof Of.unload=="function"&&Kt.setTimeout&&setTimeout(Of.unload,911),this):new Promise(function(ae,Ae){try{var ve=Of(Sm(kc()),P);typeof Of.unload=="function"&&Kt.setTimeout&&setTimeout(Of.unload,911),ae(ve)}catch(Ne){Ae(Ne.message)}})},Nt.API)Nt.API.hasOwnProperty(Tm)&&(Tm==="events"&&Nt.API.events.length?function(P,z){var ae,Ae,ve;for(ve=z.length-1;ve!==-1;ve--)ae=z[ve][0],Ae=z[ve][1],P.subscribe.apply(P,[ae].concat(typeof Ae=="function"?[Ae]:Ae))}(Tn,Nt.API.events):A[Tm]=Nt.API[Tm]);function tC(P){return kt[P].mediaBox.topRightX-kt[P].mediaBox.bottomLeftX}function wu(P,z){kt[P].mediaBox.topRightX=z+kt[P].mediaBox.bottomLeftX}function bu(P){return kt[P].mediaBox.topRightY-kt[P].mediaBox.bottomLeftY}function nC(P,z){kt[P].mediaBox.topRightY=z+kt[P].mediaBox.bottomLeftY}var rC=A.getPageWidth=function(P){return tC(P=P||M)/Ge},iC=A.setPageWidth=function(P,z){wu(P,z*Ge)},sf=A.getPageHeight=function(P){return bu(P=P||M)/Ge},sC=A.setPageHeight=function(P,z){nC(P,z*Ge)};return A.internal={pdfEscape:Io,getStyle:Z2,getFont:mT,getFontSize:xe,getCharSpace:kT,getTextColor:ST,getLineHeight:vT,getLineHeightFactor:wT,getLineWidth:gT,write:_e,getHorizontalCoordinate:vu,getVerticalCoordinate:xu,getCoordinateString:bT,getVerticalCoordinateString:CT,collections:{},newObject:Qr,newAdditionalObject:ZA,newObjectDeferred:$i,newObjectDeferredBegin:ns,getFilters:Bl,putStream:Po,events:Tn,scaleFactor:Ge,pageSize:{getWidth:function(){return rC(M)},setWidth:function(P){iC(M,P)},getHeight:function(){return sf(M)},setHeight:function(P){sC(M,P)}},encryptionOptions:d,encryption:rs,getEncryptor:function(P){return d!==null?rs.encryptor(P,0):function(z){return z}},output:km,getNumberOfPages:G2,get pages(){return he},out:te,f2:T,f3:N,getPageInfo:J2,getPageInfoByObjId:uT,getCurrentPageInfo:dT,getPDFVersion:m,Point:rf,Rectangle:Fv,Matrix:yt,hasHotfix:yu},Object.defineProperty(A.internal.pageSize,"width",{get:function(){return rC(M)},set:function(P){iC(M,P)},enumerable:!0,configurable:!0}),Object.defineProperty(A.internal.pageSize,"height",{get:function(){return sf(M)},set:function(P){sC(M,P)},enumerable:!0,configurable:!0}),(function(P){for(var z=0,ae=et.length;z<ae;z++){var Ae=K2.call(this,P[z][0],P[z][1],P[z][2],et[z][3],!0);h===!1&&(f[Ae]=!0);var ve=P[z][0].split("-");V2({id:Ae,fontName:ve[0],fontStyle:ve[1]||""})}Tn.publish("addFonts",{fonts:xt,dictionary:Mt})}).call(A,et),Ue="F1",q2(i,n),Tn.publish("initialized"),A}_g.prototype.lsbFirstWord=function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)},_g.prototype.toHexString=function(e){return e.split("").map(function(t){return("0"+(255&t.charCodeAt(0)).toString(16)).slice(-2)}).join("")},_g.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("")},_g.prototype.processOwnerPassword=function(e,t){return dR(uR(t).substr(0,5),e)},_g.prototype.encryptor=function(e,t){var n=uR(this.encryptionKey+String.fromCharCode(255&e,e>>8&255,e>>16&255,255&t,t>>8&255)).substr(0,10);return function(r){return dR(n,r)}},yN.prototype.equals=function(e){var t,n="id,objectNumber,equals";if(!e||Qn(e)!==Qn(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},Nt.API={events:[]},Nt.version="4.2.1";var Kr=Nt.API,e$=1,vm=function(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},hg=function(e){return e.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},im=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)})},Xt=function(e){return e.toFixed(2)},rh=function(e){return e.toFixed(5)};Kr.__acroform__={};var Xa=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e},LJ=function(e){return e*e$},Oc=function(e){var t=new Pye,n=ft.internal.getHeight(e)||0,r=ft.internal.getWidth(e)||0;return t.BBox=[0,0,Number(Xt(r)),Number(Xt(n))],t},tSt=Kr.__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},nSt=Kr.__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)},rSt=Kr.__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},li=Kr.__acroform__.getBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return rSt(e,t-1)},ci=Kr.__acroform__.setBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return tSt(e,t-1)},ui=Kr.__acroform__.clearBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return nSt(e,t-1)},iSt=Kr.__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],l={};return l.lowerLeft_X=n(i)||0,l.lowerLeft_Y=r(s+o)||0,l.upperRight_X=n(i+a)||0,l.upperRight_Y=r(s)||0,[Number(Xt(l.lowerLeft_X)),Number(Xt(l.lowerLeft_Y)),Number(Xt(l.upperRight_X)),Number(Xt(l.upperRight_Y))]},sSt=function(e){if(e.appearanceStreamContent)return e.appearanceStreamContent;if(e.V||e.DV){var t=[],n=e._V||e.DV,r=hR(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+" "+Xt(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=Oc(e);return s.scope=e.scope,s.stream=t.join(`
`),s}},hR=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=ft.internal.getHeight(e)||0;a=a<0?-a:a;var o=ft.internal.getWidth(e)||0;o=o<0?-o:o;var l=function(T,N,F){if(T+1<i.length){var L=N+" "+i[T+1][0];return XS(L,e,F).width<=o-4}return!1};s++;e:for(;s>0;){t="",s--;var u,d,h=XS("3",e,s).height,f=e.multiline?a-s:(a-h)/2,A=f+=2,p=0,m=0,g=0;if(s<=0){t=`(...) Tj
`,t+="% Width of Text: "+XS(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),S=l(w,y,s),_=x>=i.length-1;if(S&&!_){y+=" ",g=0;continue}if(S||_){if(_)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 E="",j=p;j<=m;j++){var I=i[j];if(e.multiline){if(j===m){E+=I[g]+" ",g=(g+1)%I.length;continue}if(j===p){E+=I[I.length-1]+" ";continue}}E+=I[0]+" "}switch(E=E.substr(E.length-1)==" "?E.substr(0,E.length-1):E,d=XS(E,e,s).width,e.textAlign){case"right":u=o-d-2;break;case"center":u=(o-d)/2;break;default:u=2}t+=Xt(u)+" "+Xt(A)+` Td
`,t+="("+vm(E)+`) Tj
`,t+=-Xt(u)+` 0 Td
`,A=-(s+2),d=0,p=b?m:m+1,v++,y=""}break}return r.text=t,r.fontSize=s,r},XS=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}},aSt={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},oSt=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)},lSt=function(e,t){if(t.scope=e,e.internal!==void 0&&(e.internal.acroformPlugin===void 0||e.internal.acroformPlugin.isInitialized===!1)){if(vc.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(aSt)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");e$=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new Iye,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&&oSt(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],l=[],u=o.Rect;if(o.Rect&&(o.Rect=iSt(o.Rect,i)),i.internal.newObjectDeferredBegin(o.objId,!0),o.DA=ft.createDefaultAppearanceStream(o),Qn(o)==="object"&&typeof o.getKeyValueListForStream=="function"&&(l=o.getKeyValueListForStream()),o.Rect=u,o.hasAppearanceStream&&!o.appearanceStreamContent){var d=sSt(o);l.push({key:"AP",value:"<</N "+d+">>"}),i.internal.acroformPlugin.xForms.push(d)}if(o.appearanceStreamContent){var h="";for(var f in o.appearanceStreamContent)if(o.appearanceStreamContent.hasOwnProperty(f)){var A=o.appearanceStreamContent[f];if(h+="/"+f+" ",h+="<<",Object.keys(A).length>=1||Array.isArray(A)){for(var a in A)if(A.hasOwnProperty(a)){var p=A[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=A)=="function"&&(p=p.call(i,o)),h+="/"+a+" "+p,i.internal.acroformPlugin.xForms.indexOf(p)>=0||i.internal.acroformPlugin.xForms.push(p);h+=">>"}l.push({key:"AP",value:`<<
`+h+">>"})}i.internal.putStream({additionalKeyValues:l,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),Qn(x)==="object"&&typeof x.putStream=="function"&&x.putStream(),delete m[v]}}(i.internal.acroformPlugin.xForms,i)})(n,e)}),e.internal.acroformPlugin.isInitialized=!0}},Tye=Kr.__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+=" "),Qn(e[s])){case"boolean":case"number":case"object":i+=e[s].toString();break;case"string":e[s].substr(0,1)==="/"?i+="/"+im(e[s].substr(1)):(t!==void 0&&n&&(r=n.internal.getEncryptor(t)),i+="("+vm(r(e[s].toString()))+")")}return i+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},q4=function(e,t,n){var r=function(i){return i};return t!==void 0&&n&&(r=n.internal.getEncryptor(t)),(e=e||"").toString(),"("+vm(r(e))+")"},Gc=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})};Gc.prototype.toString=function(){return this.objId+" 0 R"},Gc.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out("endobj")},Gc.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:Tye(i,this.objId,this.scope)}):i instanceof Gc?(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 Pye=function(){Gc.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}})};Xa(Pye,Gc);var Iye=function(){Gc.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)),"("+vm(n(e))+")"}},set:function(n){e=n}})};Xa(Iye,Gc);var vc=function e(){Gc.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!!li(t,3)},set:function(y){y?this.F=ci(t,3):this.F=ui(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 vN)return;s="FieldObject"+e.FieldNum++}var y=function(v){return v};return this.scope&&(y=this.scope.internal.getEncryptor(this.objId)),"("+vm(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 l=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return l},set:function(y){l=y}});var u=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return u===void 0?50/e$: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 vN||this instanceof _p))return q4(h,this.objId,this.scope)},set:function(y){y=y.toString(),h=y}});var f=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(f)return this instanceof Wi==0?q4(f,this.objId,this.scope):f},set:function(y){y=y.toString(),f=this instanceof Wi==0?y.substr(0,1)==="("?hg(y.substr(1,y.length-2)):hg(y):y}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof Wi==1?hg(f.substr(1,f.length-1)):f},set:function(y){y=y.toString(),f=this instanceof Wi==1?"/"+im(y):y}});var A=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(A)return A},set:function(y){this.V=y}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(A)return this instanceof Wi==0?q4(A,this.objId,this.scope):A},set:function(y){y=y.toString(),A=this instanceof Wi==0?y.substr(0,1)==="("?hg(y.substr(1,y.length-2)):hg(y):y}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof Wi==1?hg(A.substr(1,A.length-1)):A},set:function(y){y=y.toString(),A=this instanceof Wi==1?"/"+im(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!!li(this.Ff,1)},set:function(y){y?this.Ff=ci(this.Ff,1):this.Ff=ui(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!li(this.Ff,2)},set:function(y){y?this.Ff=ci(this.Ff,2):this.Ff=ui(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!li(this.Ff,3)},set:function(y){y?this.Ff=ci(this.Ff,3):this.Ff=ui(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}}})};Xa(vc,Gc);var _y=function(){vc.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 Tye(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 l,u=[];l=a.exec(s);)u.push(l[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!!li(this.Ff,18)},set:function(n){n?this.Ff=ci(this.Ff,18):this.Ff=ui(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!li(this.Ff,19)},set:function(n){this.combo===!0&&(n?this.Ff=ci(this.Ff,19):this.Ff=ui(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!li(this.Ff,20)},set:function(n){n?(this.Ff=ci(this.Ff,20),t.sort()):this.Ff=ui(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!li(this.Ff,22)},set:function(n){n?this.Ff=ci(this.Ff,22):this.Ff=ui(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!li(this.Ff,23)},set:function(n){n?this.Ff=ci(this.Ff,23):this.Ff=ui(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!li(this.Ff,27)},set:function(n){n?this.Ff=ci(this.Ff,27):this.Ff=ui(this.Ff,27)}}),this.hasAppearanceStream=!1};Xa(_y,vc);var Ey=function(){_y.call(this),this.fontName="helvetica",this.combo=!1};Xa(Ey,_y);var Ny=function(){Ey.call(this),this.combo=!0};Xa(Ny,Ey);var uB=function(){Ny.call(this),this.edit=!0};Xa(uB,Ny);var Wi=function(){vc.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!li(this.Ff,15)},set:function(n){n?this.Ff=ci(this.Ff,15):this.Ff=ui(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!li(this.Ff,16)},set:function(n){n?this.Ff=ci(this.Ff,16):this.Ff=ui(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!li(this.Ff,17)},set:function(n){n?this.Ff=ci(this.Ff,17):this.Ff=ui(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!li(this.Ff,26)},set:function(n){n?this.Ff=ci(this.Ff,26):this.Ff=ui(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+" ("+vm(n(t[r]))+")");return i.push(">>"),i.join(`
`)}},set:function(n){Qn(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="/"+im(r)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(n){e="/"+im(n)}})};Xa(Wi,vc);var dB=function(){Wi.call(this),this.pushButton=!0};Xa(dB,Wi);var jy=function(){Wi.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:[]}})};Xa(jy,Wi);var vN=function(){var e,t;vc.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+" ("+vm(i(r[s]))+")");return a.push(">>"),a.join(`
`)},set:function(i){Qn(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="/"+im(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="/"+im(s)}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=ft.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};Xa(vN,vc),jy.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()}},jy.prototype.createOption=function(e){var t=new vN;return t.Parent=this,t.optionName=e,this.Kids.push(t),cSt.call(this.scope,t),t};var hB=function(){Wi.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=ft.CheckBox.createAppearanceStream()};Xa(hB,Wi);var _p=function(){vc.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!li(this.Ff,13)},set:function(t){t?this.Ff=ci(this.Ff,13):this.Ff=ui(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!li(this.Ff,21)},set:function(t){t?this.Ff=ci(this.Ff,21):this.Ff=ui(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!li(this.Ff,23)},set:function(t){t?this.Ff=ci(this.Ff,23):this.Ff=ui(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!li(this.Ff,24)},set:function(t){t?this.Ff=ci(this.Ff,24):this.Ff=ui(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!li(this.Ff,25)},set:function(t){t?this.Ff=ci(this.Ff,25):this.Ff=ui(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!li(this.Ff,26)},set:function(t){t?this.Ff=ci(this.Ff,26):this.Ff=ui(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}})};Xa(_p,vc);var AB=function(){_p.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!li(this.Ff,14)},set:function(e){e?this.Ff=ci(this.Ff,14):this.Ff=ui(this.Ff,14)}}),this.password=!0};Xa(AB,_p);var ft={CheckBox:{createAppearanceStream:function(){return{N:{On:ft.CheckBox.YesNormal},D:{On:ft.CheckBox.YesPushDown,Off:ft.CheckBox.OffPushDown}}},YesPushDown:function(e){var t=Oc(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=hR(e,e.caption);return n.push("0.749023 g"),n.push("0 0 "+Xt(ft.internal.getWidth(e))+" "+Xt(ft.internal.getHeight(e))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+Xt(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=Oc(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=ft.internal.getHeight(e),a=ft.internal.getWidth(e),o=hR(e,e.caption);return i.push("1 g"),i.push("0 0 "+Xt(a)+" "+Xt(s)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+Xt(a-1)+" "+Xt(s-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+n+" "+Xt(o.fontSize)+" Tf "+r),i.push(o.text),i.push("ET"),i.push("Q"),t.stream=i.join(`
`),t},OffPushDown:function(e){var t=Oc(e);t.scope=e.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+Xt(ft.internal.getWidth(e))+" "+Xt(ft.internal.getHeight(e))+" re"),n.push("f"),t.stream=n.join(`
`),t}},RadioButton:{Circle:{createAppearanceStream:function(e){var t={D:{Off:ft.RadioButton.Circle.OffPushDown},N:{}};return t.N[e]=ft.RadioButton.Circle.YesNormal,t.D[e]=ft.RadioButton.Circle.YesPushDown,t},getCA:function(){return"l"},YesNormal:function(e){var t=Oc(e);t.scope=e.scope;var n=[],r=ft.internal.getWidth(e)<=ft.internal.getHeight(e)?ft.internal.getWidth(e)/4:ft.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=ft.internal.Bezier_C,s=Number((r*i).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+rh(ft.internal.getWidth(e)/2)+" "+rh(ft.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=Oc(e);t.scope=e.scope;var n=[],r=ft.internal.getWidth(e)<=ft.internal.getHeight(e)?ft.internal.getWidth(e)/4:ft.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),s=Number((i*ft.internal.Bezier_C).toFixed(5)),a=Number((r*ft.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+rh(ft.internal.getWidth(e)/2)+" "+rh(ft.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 "+rh(ft.internal.getWidth(e)/2)+" "+rh(ft.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=Oc(e);t.scope=e.scope;var n=[],r=ft.internal.getWidth(e)<=ft.internal.getHeight(e)?ft.internal.getWidth(e)/4:ft.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),s=Number((i*ft.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+rh(ft.internal.getWidth(e)/2)+" "+rh(ft.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:ft.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=ft.RadioButton.Cross.YesNormal,t.D[e]=ft.RadioButton.Cross.YesPushDown,t},getCA:function(){return"8"},YesNormal:function(e){var t=Oc(e);t.scope=e.scope;var n=[],r=ft.internal.calculateCross(e);return n.push("q"),n.push("1 1 "+Xt(ft.internal.getWidth(e)-2)+" "+Xt(ft.internal.getHeight(e)-2)+" re"),n.push("W"),n.push("n"),n.push(Xt(r.x1.x)+" "+Xt(r.x1.y)+" m"),n.push(Xt(r.x2.x)+" "+Xt(r.x2.y)+" l"),n.push(Xt(r.x4.x)+" "+Xt(r.x4.y)+" m"),n.push(Xt(r.x3.x)+" "+Xt(r.x3.y)+" l"),n.push("s"),n.push("Q"),t.stream=n.join(`
`),t},YesPushDown:function(e){var t=Oc(e);t.scope=e.scope;var n=ft.internal.calculateCross(e),r=[];return r.push("0.749023 g"),r.push("0 0 "+Xt(ft.internal.getWidth(e))+" "+Xt(ft.internal.getHeight(e))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+Xt(ft.internal.getWidth(e)-2)+" "+Xt(ft.internal.getHeight(e)-2)+" re"),r.push("W"),r.push("n"),r.push(Xt(n.x1.x)+" "+Xt(n.x1.y)+" m"),r.push(Xt(n.x2.x)+" "+Xt(n.x2.y)+" l"),r.push(Xt(n.x4.x)+" "+Xt(n.x4.y)+" m"),r.push(Xt(n.x3.x)+" "+Xt(n.x3.y)+" l"),r.push("s"),r.push("Q"),t.stream=r.join(`
`),t},OffPushDown:function(e){var t=Oc(e);t.scope=e.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+Xt(ft.internal.getWidth(e))+" "+Xt(ft.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}};ft.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=ft.internal.getWidth(e),n=ft.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}}}},ft.internal.getWidth=function(e){var t=0;return Qn(e)==="object"&&(t=LJ(e.Rect[2])),t},ft.internal.getHeight=function(e){var t=0;return Qn(e)==="object"&&(t=LJ(e.Rect[3])),t};var cSt=Kr.addField=function(e){if(lSt(this,e),!(e instanceof vc))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};Kr.AcroFormChoiceField=_y,Kr.AcroFormListBox=Ey,Kr.AcroFormComboBox=Ny,Kr.AcroFormEditBox=uB,Kr.AcroFormButton=Wi,Kr.AcroFormPushButton=dB,Kr.AcroFormRadioButton=jy,Kr.AcroFormCheckBox=hB,Kr.AcroFormTextField=_p,Kr.AcroFormPasswordField=AB,Kr.AcroFormAppearance=ft,Kr.AcroForm={ChoiceField:_y,ListBox:Ey,ComboBox:Ny,EditBox:uB,Button:Wi,PushButton:dB,RadioButton:jy,CheckBox:hB,TextField:_p,PasswordField:AB,Appearance:ft},Nt.AcroForm={ChoiceField:_y,ListBox:Ey,ComboBox:Ny,EditBox:uB,Button:Wi,PushButton:dB,RadioButton:jy,CheckBox:hB,TextField:_p,PasswordField:AB,Appearance:ft};function Oye(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,D,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(S(T))for(W in r)for(D=r[W],F=0;F<D.length;F+=1){for(H=!0,L=0;L<D[F].length;L+=1)if(D[F][L]!==void 0&&D[F][L]!==T[L]){H=!1;break}if(H===!0){$=W;break}}else for(W in r)for(D=r[W],F=0;F<D.length;F+=1){for(H=!0,L=0;L<D[F].length;L+=1)if(D[F][L]!==void 0&&D[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,D=(0,this.internal.getFilters)();D.indexOf("FlateEncode")!==-1;)D.splice(D.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,V=N.transparency.length;$<V;$++)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:E(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")},l=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 l.call(this),T},d=function(){return Object.keys(this.internal.collections[t+"images"]).length},h=function(T){return typeof e["process"+T.toUpperCase()]=="function"},f=function(T){return Qn(T)==="object"&&T.nodeType===1},A=function(T,N){if(T.nodeName==="IMG"&&T.hasAttribute("src")){var F=""+T.getAttribute("src");if(F.indexOf("data:image/")===0)return cB(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 D;switch(N){case"PNG":D="image/png";break;case"WEBP":D="image/webp";break;default:D="image/jpeg"}return cB(T.toDataURL(D,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,D,H){var W=m.call(this,F,L,D),$=this.internal.getCoordinateString,V=this.internal.getVerticalCoordinateString,Q=u.call(this);if(F=W[0],L=W[1],Q[D.index]=D,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),V(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),V(N+L),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+D.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(S(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 S=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},_=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},E=e.__addimage__.arrayBufferToBinaryString=function(T){for(var N="",F=S(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,D,H,W,$,V;if(typeof arguments[1]=="number"?(N=n,F=arguments[1],L=arguments[2],D=arguments[3],H=arguments[4],W=arguments[5],$=arguments[6],V=arguments[7]):(N=arguments[1],F=arguments[2],L=arguments[3],D=arguments[4],H=arguments[5],W=arguments[6],$=arguments[7],V=arguments[8]),Qn(T=arguments[0])==="object"&&!f(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,D=Q.w||Q.width||D,H=Q.h||Q.height||H,W=Q.alias||W,$=Q.compression||$,V=Q.rotation||Q.angle||V}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");l.call(this);var R=j.call(this,T,N,W,$);return g.call(this,F,L,D,H,R,V),this};var j=function(T,N,F,L){var D,H,W;if(typeof T=="string"&&i(T)===n){T=unescape(T);var $=I(T,!1);($!==""||($=e.loadFile(T,!0))!==void 0)&&(T=$)}if(f(T)&&(T=A(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(V){return typeof V=="string"||S(V)?x(V):S(V.data)?x(V.data):null}(T)),(D=p.call(this,F))||(T instanceof Uint8Array||N==="RGBA"||(H=T,T=_(T)),D=this["process"+N.toUpperCase()](T,d.call(this),F,function(V){return V&&typeof V=="string"&&(V=V.toUpperCase()),V in e.image_compression?V:v.NONE}(L),H)),!D)throw new Error("An unknown error occurred whilst processing the image.");return D},I=e.__addimage__.convertBase64ToBinaryString=function(T,N){N=typeof N!="boolean"||N;var F,L="";if(typeof T=="string"){var D;F=(D=w(T))!==null&&D!==void 0?D:T;try{L=cB(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(f(T)&&(T=A(T)),typeof T=="string"&&i(T)===n&&((L=I(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=_(T)),!(N=this["process"+F.toUpperCase()](T)))throw new Error("An unknown error occurred whilst processing the image");return N.fileType=F,N}})(Nt.API),function(e){var t=function(n){if(n!==void 0&&n!="")return!0};Nt.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,l=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 f=0;f<u.length;f++){r=u[f];var A=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 ("+A(y(r.contents))+")",s+=" /Popup "+g.objId+" 0 R",s+=" /P "+l.objId+" 0 R",s+=" /T ("+A(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 ("+A(p(r.contents))+")",s+=" /DS("+A(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 ("+A(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 S=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+" "+S+" "+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(),l=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString;o.pageContext.annotations.push({finalBounds:{x:l(n),y:u(r),w:l(n+i),h:u(r+s)},options:a,type:"link"})},e.textWithLink=function(n,r,i,s){var a,o,l=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=l,a=u;return this.text(n,r,i,s),i+=.2*u,s.align==="center"&&(r-=l/2),s.align==="right"&&(r-=l),this.link(r,i-u,o,a,s),l},e.getTextWidth=function(n){var r=this.internal.getFontSize();return this.getStringUnitWidth(n)*r/this.internal.scaleFactor}}(Nt.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},l=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 f=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)&&l(g)||o(m)&&o(g)?0:d(m)&&a(g)&&!o(g)&&a(y)&&u(y)?3:o(m)||!a(y)?1:2:-1},A=function(m){var g=0,y=0,v=0,x="",b="",w="",S=(m=m||"").split("\\s+"),_=[];for(g=0;g<S.length;g+=1){for(_.push(""),y=0;y<S[g].length;y+=1)x=S[g][y],b=S[g][y-1],w=S[g][y+1],a(x)?(v=f(x,b,w),_[g]+=v!==-1?String.fromCharCode(t[x.charCodeAt(0)][v]):x):_[g]+=x;_[g]=h(_[g])}return _.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([A(g[v][0]),g[v][1],g[v][2]]):y.push([A(g[v])]);m=y}else m=A(g);return typeof arguments[0]=="string"?m:(arguments[0].text=m,arguments[0])};e.events.push(["preProcessText",p])}(Nt.API),Nt.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}])}(Nt.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 l=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return l},set:function(m){l=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 f=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return f},set:function(m){f=m}});var A=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return A},set:function(m){A=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(l){return r.call(this),this.internal.__cell__.headerFunction=typeof l=="function"?l:void 0,this},e.getTextDimensions=function(l,u){r.call(this);var d=(u=u||{}).fontSize||this.getFontSize(),h=u.font||this.getFont(),f=u.scaleFactor||this.internal.scaleFactor,A=0,p=0,m=0,g=this;if(!Array.isArray(l)&&typeof l!="string"){if(typeof l!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");l=String(l)}var y=u.maxWidth;y>0?typeof l=="string"?l=this.splitTextToSize(l,y):Object.prototype.toString.call(l)==="[object Array]"&&(l=l.reduce(function(x,b){return x.concat(g.splitTextToSize(b,y))},[])):l=Array.isArray(l)?l:[l];for(var v=0;v<l.length;v++)A<(m=this.getStringUnitWidth(l[v],{font:h})*d)&&(A=m);return A!==0&&(p=l.length),{w:A/=f,h:Math.max((p*d*this.getLineHeightFactor()-d*(this.getLineHeightFactor()-1))/f,0)}},e.cellAddPage=function(){r.call(this),this.addPage();var l=this.internal.__cell__.margins||t;return this.internal.__cell__.lastCell=new s(l.left,l.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var a=e.cell=function(){var l;l=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,f=this.internal.__cell__.tableHeaderRow,A=this.internal.__cell__.printHeaders;return u.lineNumber!==void 0&&(u.lineNumber===l.lineNumber?(l.x=(u.x||0)+(u.width||0),l.y=u.y||0):u.y+u.height+l.height+h.bottom>this.getPageHeight()?(this.cellAddPage(),l.y=h.top,A&&f&&(this.printHeaderRow(l.lineNumber,!0),l.y+=f[0].height)):l.y=u.y+u.height||l.y),l.text[0]!==void 0&&(this.rect(l.x,l.y,l.width,l.height,n===!0?"FD":void 0),l.align==="right"?this.text(l.text,l.x+l.width-d,l.y+d,{align:"right",baseline:"top"}):l.align==="center"?this.text(l.text,l.x+l.width/2,l.y+d,{align:"center",baseline:"top",maxWidth:l.width-d-d}):this.text(l.text,l.x+d,l.y+d,{align:"left",baseline:"top",maxWidth:l.width-d-d})),this.internal.__cell__.lastCell=l,this};e.table=function(l,u,d,h,f){if(r.call(this),!d)throw new Error("No data for PDF table.");var A,p,m,g,y=[],v=[],x=[],b={},w={},S=[],_=[],E=(f=f||{}).autoSize||!1,j=f.printHeaders!==!1,I=f.css&&f.css["font-size"]!==void 0?16*f.css["font-size"]:f.fontSize||12,T=f.margins||Object.assign({width:this.getPageWidth()},t),N=typeof f.padding=="number"?f.padding:3,F=f.headerBackgroundColor||"#c8c8c8",L=f.headerTextColor||"#000";if(i.call(this),this.internal.__cell__.printHeaders=j,this.internal.__cell__.margins=T,this.internal.__cell__.table_font_size=I,this.internal.__cell__.padding=N,this.internal.__cell__.headerBackgroundColor=F,this.internal.__cell__.headerTextColor=L,this.setFontSize(I),h==null)v=y=Object.keys(d[0]),x=y.map(function(){return"left"});else if(Array.isArray(h)&&Qn(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"}),A=0;A<h.length;A+=1)w[h[A].name]=.7499990551181103*h[A].width;else Array.isArray(h)&&typeof h[0]=="string"&&(v=y=h,x=y.map(function(){return"left"}));if(E||Array.isArray(h)&&typeof h[0]=="string")for(A=0;A<y.length;A+=1){for(b[g=y[A]]=d.map(function(Q){return Q[g]}),this.setFont(void 0,"bold"),S.push(this.getTextDimensions(v[A],{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)S.push(this.getTextDimensions(p[m],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);w[g]=Math.max.apply(null,S)+N+N,S=[]}if(j){var D={};for(A=0;A<y.length;A+=1)D[y[A]]={},D[y[A]].text=v[A],D[y[A]].align=x[A];var H=o.call(this,D,w);_=y.map(function(Q){return new s(l,u,w[Q],H,D[Q].text,void 0,D[Q].align)}),this.setTableHeaderRow(_),this.printHeaderRow(1,!1)}var W=h.reduce(function(Q,ce){return Q[ce.name]=ce.align,Q},{});for(A=0;A<d.length;A+=1){"rowStart"in f&&f.rowStart instanceof Function&&f.rowStart({row:A,data:d[A]},this);var $=o.call(this,d[A],w);for(m=0;m<y.length;m+=1){var V=d[A][y[m]];"cellStart"in f&&f.cellStart instanceof Function&&f.cellStart({row:A,col:m,data:V},this),a.call(this,new s(l,u,w[y[m]],$,V,A+2,W[y[m]]))}}return this.internal.__cell__.table_x=l,this.internal.__cell__.table_y=u,this};var o=function(l,u){var d=this.internal.__cell__.padding,h=this.internal.__cell__.table_font_size,f=this.internal.scaleFactor;return Object.keys(l).map(function(A){var p=l[A];return this.splitTextToSize(p.hasOwnProperty("text")?p.text:p,u[A]-d-d)},this).map(function(A){return this.getLineHeightFactor()*A.length*h/f+d+d},this).reduce(function(A,p){return Math.max(A,p)},0)};e.setTableHeaderRow=function(l){r.call(this),this.internal.__cell__.tableHeaderRow=l},e.printHeaderRow=function(l,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 f=[],A=0;A<this.internal.__cell__.tableHeaderRow.length;A+=1){d=this.internal.__cell__.tableHeaderRow[A].clone(),u&&(d.y=this.internal.__cell__.margins.top||0,f.push(d)),d.lineNumber=l;var p=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),a.call(this,d),this.setTextColor(p)}f.length>0&&this.setTableHeaderRow(f),this.setFont(void 0,"normal"),n=!1}}(Nt.API);var Fye={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},Mye=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],AR=Oye(Mye),Lye=[100,200,300,400,500,600,700,800,900],uSt=Oye(Lye);function W4(e){var t=e.family.replace(/"|'/g,"").toLowerCase(),n=function(s){return Fye[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 AR[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 RJ(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 dSt={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},UJ={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function DJ(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function QJ(e){return e.trimLeft()}function hSt(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 ASt(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 Ag,JS,HJ,$J,zJ,G4=["times"];function VJ(e,t,n,r,i){var s=4,a=qJ;switch(i){case Nt.API.image_compression.FAST:s=1,a=KJ;break;case Nt.API.image_compression.MEDIUM:s=6,a=WJ;break;case Nt.API.image_compression.SLOW:s=9,a=GJ}e=function(l,u,d,h){for(var f,A=l.length/u,p=new Uint8Array(l.length+A),m=[fSt,KJ,qJ,WJ,GJ],g=0;g<A;g+=1){var y=g*u,v=l.subarray(y,y+u);if(h)p.set(h(v,d,f),y+g);else{for(var x=m.length,b=[],w=0;w<x;w+=1)b[w]=m[w](v,d,f);var S=mSt(b.concat());p.set(b[S],y+g)}f=v}return p}(e,t,Math.ceil(n*r/8),a);var o=eR(e,{level:s});return Nt.API.__addimage__.arrayBufferToBinaryString(o)}function fSt(e){var t=Array.apply([],e);return t.unshift(0),t}function KJ(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 qJ(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 WJ(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 GJ(e,t,n){var r=e.length,i=[];i[0]=4;for(var s=0;s<r;s+=1){var a=pSt(e[s-t]||0,n&&n[s]||0,n&&n[s-t]||0);i[s+1]=e[s]-a+256&255}return i}function pSt(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 mSt(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 Y4(e,t,n){var r=t*n,i=Math.floor(r/8),s=16-(r-8*i+n),a=(1<<n)-1;return Rye(e,i)>>s&a}function YJ(e,t,n,r){var i=n*r,s=Math.floor(i/8),a=16-(i-8*s+r),o=(1<<r)-1,l=(t&o)<<a;(function(u,d,h){if(d+1<u.byteLength)u.setUint16(d,h,!1);else{var f=h>>8&255;u.setUint8(d,f)}})(e,s,Rye(e,s)&~(o<<a)&65535|l)}function Rye(e,t){return t+1<e.byteLength?e.getUint16(t,!1):e.getUint8(t)<<8}function gSt(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,l=null;s&&(o=t,l=a,t+=3*a);var u=!0,d=[],h=0,f=null,A=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,f=e[t++],1&m||(f=null),A=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,S=1<<1+(7&b),_=o,E=l,j=!1;b>>7&&(j=!0,_=t,E=S,t+=3*S);var I=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:j,palette_offset:_,palette_size:E,data_offset:I,data_length:t-I,transparent_index:f,interlaced:!!w,delay:h,disposal:A});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),D=L.width*L.height;if(D>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var H=new Uint8Array(D);XJ(e,L.data_offset,H,D);var W=L.palette_offset,$=L.transparent_index;$===null&&($=256);var V=L.width,Q=n-V,ce=V,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 K=8,Z=0,de=H.length;Z<de;++Z){var se=H[Z];if(ce===0&&(ce=V,(Y+=X)>=M&&(X=4*Q+4*n*(K-1),Y=R+(V+Q)*(K<<1),K>>=1)),se===$)Y+=4;else{var ie=e[W+3*se],he=e[W+3*se+1],ue=e[W+3*se+2];F[Y++]=ue,F[Y++]=he,F[Y++]=ie,F[Y++]=255}--ce}},this.decodeAndBlitFrameRGBA=function(N,F){var L=this.frameInfo(N),D=L.width*L.height;if(D>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var H=new Uint8Array(D);XJ(e,L.data_offset,H,D);var W=L.palette_offset,$=L.transparent_index;$===null&&($=256);var V=L.width,Q=n-V,ce=V,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 K=8,Z=0,de=H.length;Z<de;++Z){var se=H[Z];if(ce===0&&(ce=V,(Y+=X)>=M&&(X=4*Q+4*n*(K-1),Y=R+(V+Q)*(K<<1),K>>=1)),se===$)Y+=4;else{var ie=e[W+3*se],he=e[W+3*se+1],ue=e[W+3*se+2];F[Y++]=ie,F[Y++]=he,F[Y++]=ue,F[Y++]=255}--ce}}}function XJ(e,t,n,r){for(var i=e[t++],s=1<<i,a=s+1,o=a+1,l=i+1,u=(1<<l)-1,d=0,h=0,f=0,A=e[t++],p=new Int32Array(4096),m=null;;){for(;d<16&&A!==0;)h|=e[t++]<<d,d+=8,A===1?A=e[t++]:--A;if(d<l)break;var g=h&u;if(h>>=l,d-=l,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(f+v+(y!==g?1:0)>r)return void Yn.log("Warning, gif stream longer than expected.");n[f++]=b;var w=f+=v;for(y!==g&&(n[f++]=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&&l<12&&(++l,u=u<<1|1)),m=g}else o=a+1,u=(1<<(l=i+1))-1,m=null}return f!==r&&Yn.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 X4(e){var t,n,r,i,s,a=Math.floor,o=new Array(64),l=new Array(64),u=new Array(64),d=new Array(64),h=new Array(65535),f=new Array(65535),A=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),S=new Array(2048),_=[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],E=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],j=[0,1,2,3,4,5,6,7,8,9,10,11],I=[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],D=[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,K=new Array,Z=1;Z<=16;Z++){for(var de=1;de<=R[Z];de++)K[M[X]]=[],K[M[X]][0]=Y,K[M[X]][1]=Z,X++,Y++;Y*=2}return K}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 V(R){$(R>>8&255),$(255&R)}function Q(R,M,Y,X,K){for(var Z,de=K[0],se=K[240],ie=function(Te,st){var xe,Qe,ze,Dt,dt,ye,Ee,We,Ue,Ge,pe=0;for(Ue=0;Ue<8;++Ue){xe=Te[pe],Qe=Te[pe+1],ze=Te[pe+2],Dt=Te[pe+3],dt=Te[pe+4],ye=Te[pe+5],Ee=Te[pe+6];var mt=xe+(We=Te[pe+7]),ct=xe-We,xt=Qe+Ee,Mt=Qe-Ee,zt=ze+ye,ht=ze-ye,Lt=Dt+dt,Pt=Dt-dt,qt=mt+Lt,er=mt-Lt,en=xt+zt,kt=xt-zt;Te[pe]=qt+en,Te[pe+4]=qt-en;var Tn=.707106781*(kt+er);Te[pe+2]=er+Tn,Te[pe+6]=er-Tn;var Ut=.382683433*((qt=Pt+ht)-(kt=Mt+ct)),Wt=.5411961*qt+Ut,wn=1.306562965*kt+Ut,Dr=.707106781*(en=ht+Mt),yt=ct+Dr,Hi=ct-Dr;Te[pe+5]=Hi+Wt,Te[pe+3]=Hi-Wt,Te[pe+1]=yt+wn,Te[pe+7]=yt-wn,pe+=8}for(pe=0,Ue=0;Ue<8;++Ue){xe=Te[pe],Qe=Te[pe+8],ze=Te[pe+16],Dt=Te[pe+24],dt=Te[pe+32],ye=Te[pe+40],Ee=Te[pe+48];var ts=xe+(We=Te[pe+56]),Sr=xe-We,Jr=Qe+Ee,Qr=Qe-Ee,$i=ze+ye,ns=ze-ye,ZA=Dt+dt,Pd=Dt-dt,Sl=ts+ZA,bc=ts-ZA,kl=Jr+$i,Bl=Jr-$i;Te[pe]=Sl+kl,Te[pe+32]=Sl-kl;var Po=.707106781*(Bl+bc);Te[pe+16]=bc+Po,Te[pe+48]=bc-Po;var ef=.382683433*((Sl=Pd+ns)-(Bl=Qr+Sr)),Cc=.5411961*Sl+ef,tf=1.306562965*Bl+ef,xm=.707106781*(kl=ns+Qr),wm=Sr+xm,bm=Sr-xm;Te[pe+40]=bm+Cc,Te[pe+24]=bm-Cc,Te[pe+8]=wm+tf,Te[pe+56]=wm-tf,pe++}for(Ue=0;Ue<64;++Ue)Ge=Te[Ue]*st[Ue],A[Ue]=Ge>0?Ge+.5|0:Ge-.5|0;return A}(R,M),he=0;he<64;++he)p[_[he]]=ie[he];var ue=p[0]-Y;Y=p[0],ue==0?W(X[0]):(W(X[f[Z=32767+ue]]),W(h[Z]));for(var Se=63;Se>0&&p[Se]==0;)Se--;if(Se==0)return W(de),Y;for(var Fe,te=1;te<=Se;){for(var _e=te;p[te]==0&&te<=Se;)++te;var Ze=te-_e;if(Ze>=16){Fe=Ze>>4;for(var et=1;et<=Fe;++et)W(se);Ze&=15}Z=32767+p[te],W(K[(Ze<<4)+f[Z]]),W(h[Z]),te++}return Se!=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 K=a((Y[X]*M+50)/100);K=Math.min(Math.max(K,1),255),o[_[X]]=K}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 se=a((Z[de]*M+50)/100);se=Math.min(Math.max(se,1),255),l[_[de]]=se}for(var ie=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],he=0,ue=0;ue<8;ue++)for(var Se=0;Se<8;Se++)u[he]=1/(o[_[he]]*ie[ue]*ie[Se]*8),d[he]=1/(l[_[he]]*ie[ue]*ie[Se]*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,V(65496),V(65504),V(16),$(74),$(70),$(73),$(70),$(0),$(1),$(1),$(0),V(1),V(1),$(0),$(0),function(){V(65499),V(132),$(0);for(var Qe=0;Qe<64;Qe++)$(o[Qe]);$(1);for(var ze=0;ze<64;ze++)$(l[ze])}(),function(Qe,ze){V(65472),V(17),$(8),V(ze),V(Qe),$(3),$(1),$(17),$(0),$(2),$(17),$(1),$(3),$(17),$(1)}(R.width,R.height),function(){V(65476),V(418),$(0);for(var Qe=0;Qe<16;Qe++)$(E[Qe+1]);for(var ze=0;ze<=11;ze++)$(j[ze]);$(16);for(var Dt=0;Dt<16;Dt++)$(I[Dt+1]);for(var dt=0;dt<=161;dt++)$(T[dt]);$(1);for(var ye=0;ye<16;ye++)$(N[ye+1]);for(var Ee=0;Ee<=11;Ee++)$(F[Ee]);$(17);for(var We=0;We<16;We++)$(L[We+1]);for(var Ue=0;Ue<=161;Ue++)$(D[Ue])}(),V(65498),V(12),$(3),$(1),$(0),$(2),$(17),$(3),$(17),$(0),$(63),$(0);var Y=0,X=0,K=0;g=0,y=7,this.encode.displayName="_encode_";for(var Z,de,se,ie,he,ue,Se,Fe,te,_e=R.data,Ze=R.width,et=R.height,Te=4*Ze,st=0;st<et;){for(Z=0;Z<Te;){for(he=Te*st+Z,Se=-1,Fe=0,te=0;te<64;te++)ue=he+(Fe=te>>3)*Te+(Se=4*(7&te)),st+Fe>=et&&(ue-=Te*(st+1+Fe-et)),Z+Se>=Te&&(ue-=Z+Se-Te+4),de=_e[ue++],se=_e[ue++],ie=_e[ue++],v[te]=(S[de]+S[se+256|0]+S[ie+512|0]>>16)-128,x[te]=(S[de+768|0]+S[se+1024|0]+S[ie+1280|0]>>16)-128,b[te]=(S[de+1280|0]+S[se+1536|0]+S[ie+1792|0]>>16)-128;Y=Q(v,u,Y,t,r),X=Q(x,d,X,n,i),K=Q(b,d,K,n,i),Z+=32}st+=8}if(y>=0){var xe=[];xe[1]=y+1,xe[0]=(1<<y+1)-1,W(xe)}return V(65497),new Uint8Array(m)},e=e||50,function(){for(var R=String.fromCharCode,M=0;M<256;M++)w[M]=R(M)}(),t=H(E,j),n=H(N,F),r=H(I,T),i=H(L,D),function(){for(var R=1,M=2,Y=1;Y<=15;Y++){for(var X=R;X<M;X++)f[32767+X]=Y,h[32767+X]=[],h[32767+X][1]=Y,h[32767+X][0]=X;for(var K=-(M-1);K<=-R;K++)f[32767+K]=Y,h[32767+K]=[],h[32767+K][1]=Y,h[32767+K][0]=M-1+K;R<<=1,M<<=1}}(),function(){for(var R=0;R<256;R++)S[R]=19595*R,S[R+256|0]=38470*R,S[R+512|0]=7471*R+32768,S[R+768|0]=-11059*R,S[R+1024|0]=-21709*R,S[R+1280|0]=32768*R+8421375,S[R+1536|0]=-27439*R,S[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 Fl(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 JJ(e){function t(j){if(!j)throw Error("assert :P")}function n(j,I,T){for(var N=0;4>N;N++)if(j[I+N]!=T.charCodeAt(N))return!0;return!1}function r(j,I,T,N,F){for(var L=0;L<F;L++)j[I+L]=T[N+L]}function i(j,I,T,N){for(var F=0;F<N;F++)j[I+F]=T}function s(j){return new Int32Array(j)}function a(j,I){for(var T=[],N=0;N<j;N++)T.push(new I);return T}function o(j,I){var T=[];return function N(F,L,D){for(var H=D[L],W=0;W<H&&(F.push(D.length>L+1?[]:new I),!(D.length<L+1));W++)N(F[W],L+1,D)}(T,0,j),T}var l=function(){var j=this;function I(C,B){for(var O=1<<B-1>>>0;C&O;)O>>>=1;return O?(C&O-1)+O:C}function T(C,B,O,U,q){t(!(U%O));do C[B+(U-=O)]=q;while(0<U)}function N(C,B,O,U,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,Ce){var le,ge,we=ee,je=1<<ne,be=s(16),Ie=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;++be[oe[ge]]}if(be[0]==me)return 0;for(Ie[1]=0,le=1;15>le;++le){if(be[le]>1<<le)return 0;Ie[le+1]=Ie[le]+be[le]}for(ge=0;ge<me;++ge)le=oe[ge],0<oe[ge]&&(Ce[Ie[le]++]=ge);if(Ie[15]==1)return(oe=new F).g=0,oe.value=Ce[0],T(J,we,1,je,oe),je;var Oe,He=-1,Re=je-1,Et=0,ut=1,nn=1,wt=1<<ne;for(ge=0,le=1,me=2;le<=ne;++le,me<<=1){if(ut+=nn<<=1,0>(nn-=be[le]))return 0;for(;0<be[le];--be[le])(oe=new F).g=le,oe.value=Ce[ge++],T(J,we+Et,me,wt,oe),Et=I(Et,le)}for(le=ne+1,me=2;15>=le;++le,me<<=1){if(ut+=nn<<=1,0>(nn-=be[le]))return 0;for(;0<be[le];--be[le]){if(oe=new F,(Et&Re)!=He){for(we+=wt,Oe=1<<(He=le)-ne;15>He&&!(0>=(Oe-=be[He]));)++He,Oe<<=1;je+=wt=1<<(Oe=He-ne),J[ee+(He=Et&Re)].g=Oe+ne,J[ee+He].value=we-ee-He}oe.g=le-ne,oe.value=Ce[ge++],T(J,we+(Et>>ne),me,wt,oe),Et=I(Et,le)}}return ut!=2*Ie[15]-1?0:je}(C,B,O,U,q,G)}function F(){this.value=this.g=0}function L(){this.value=this.g=0}function D(){this.G=a(5,F),this.H=s(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=a(Fm,L)}function H(C,B,O,U){t(C!=null),t(B!=null),t(2147483648>U),C.Ca=254,C.I=0,C.b=-8,C.Ka=0,C.oa=B,C.pa=O,C.Jd=B,C.Yc=O+U,C.Zc=4<=U?O+U-4+1:O,de(C)}function W(C,B){for(var O=0;0<B--;)O|=ie(C,128)<<B;return O}function $(C,B){var O=W(C,B);return se(C)?-O:O}function V(C,B,O,U){var q,G=0;for(t(C!=null),t(B!=null),t(4294967288>U),C.Sb=U,C.Ra=0,C.u=0,C.h=0,4<U&&(U=4),q=0;q<U;++q)G+=B[O+q]<<8*q;C.Ra=G,C.bb=U,C.oa=B,C.pa=O}function Q(C){for(;8<=C.u&&C.bb<C.Sb;)C.Ra>>>=8,C.Ra+=C.oa[C.pa+C.bb]<<Xs-8>>>0,++C.bb,C.u-=8;X(C)&&(C.h=1,C.u=0)}function ce(C,B){if(t(0<=B),!C.h&&B<=Dv){var O=Y(C)&hf[B];return C.u+=B,Q(C),O}return C.h=1,C.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(C){return C.Ra>>>(C.u&Xs-1)>>>0}function X(C){return t(C.bb<=C.Sb),C.h||C.bb==C.Sb&&C.u>Xs}function K(C,B){C.u=B,C.h=X(C)}function Z(C){C.u>=Sa&&(t(C.u>=Sa),Q(C))}function de(C){t(C!=null&&C.oa!=null),C.pa<C.Zc?(C.I=(C.oa[C.pa++]|C.I<<8)>>>0,C.b+=8):(t(C!=null&&C.oa!=null),C.pa<C.Yc?(C.b+=8,C.I=C.oa[C.pa++]|C.I<<8):C.Ka?C.b=0:(C.I<<=8,C.b+=8,C.Ka=1))}function se(C){return W(C,1)}function ie(C,B){var O=C.Ca;0>C.b&&de(C);var U=C.b,q=O*B>>>8,G=(C.I>>>U>q)+0;for(G?(O-=q,C.I-=q+1<<U>>>0):O=q+1,U=O,q=0;256<=U;)q+=8,U>>=8;return U=7^q+Mm[U],C.b-=U,C.Ca=(O<<U)-1,G}function he(C,B,O){C[B+0]=O>>24&255,C[B+1]=O>>16&255,C[B+2]=O>>8&255,C[B+3]=255&O}function ue(C,B){return C[B+0]|C[B+1]<<8}function Se(C,B){return ue(C,B)|C[B+2]<<16}function Fe(C,B){return ue(C,B)|ue(C,B+2)<<16}function te(C,B){var O=1<<B;return t(C!=null),t(0<B),C.X=s(O),C.X==null?0:(C.Mb=32-B,C.Xa=B,1)}function _e(C,B){t(C!=null),t(B!=null),t(C.Xa==B.Xa),r(B.X,0,C.X,0,1<<B.Xa)}function Ze(){this.X=[],this.Xa=this.Mb=0}function et(C,B,O,U){t(O!=null),t(U!=null);var q=O[0],G=U[0];return q==0&&(q=(C*G+B/2)/B),G==0&&(G=(B*q+C/2)/C),0>=q||0>=G?0:(O[0]=q,U[0]=G,1)}function Te(C,B){return C+(1<<B)-1>>>B}function st(C,B){return((4278255360&C)+(4278255360&B)>>>0&4278255360)+((16711935&C)+(16711935&B)>>>0&16711935)>>>0}function xe(C,B){j[B]=function(O,U,q,G,J,ee,ne){var oe;for(oe=0;oe<J;++oe){var me=j[C](ee[ne+oe-1],q,G+oe);ee[ne+oe]=st(O[U+oe],me)}}}function Qe(){this.ud=this.hd=this.jd=0}function ze(C,B){return((4278124286&(C^B))>>>1)+(C&B)>>>0}function Dt(C){return 0<=C&&256>C?C:0>C?0:255<C?255:void 0}function dt(C,B){return Dt(C+(C-B+.5>>1))}function ye(C,B,O){return Math.abs(B-O)-Math.abs(C-O)}function Ee(C,B,O,U,q,G,J){for(U=G[J-1],O=0;O<q;++O)G[J+O]=U=st(C[B+O],U)}function We(C,B,O,U,q){var G;for(G=0;G<O;++G){var J=C[B+G],ee=J>>8&255,ne=16711935&(ne=(ne=16711935&J)+((ee<<16)+ee));U[q+G]=(4278255360&J)+ne>>>0}}function Ue(C,B){B.jd=255&C,B.hd=C>>8&255,B.ud=C>>16&255}function Ge(C,B,O,U,q,G){var J;for(J=0;J<U;++J){var ee=B[O+J],ne=ee>>>8,oe=ee,me=255&(me=(me=ee>>>16)+((C.jd<<24>>24)*(ne<<24>>24)>>>5));oe=255&(oe=(oe+=(C.hd<<24>>24)*(ne<<24>>24)>>>5)+((C.ud<<24>>24)*(me<<24>>24)>>>5)),q[G+J]=(4278255360&ee)+(me<<16)+oe}}function pe(C,B,O,U,q){j[B]=function(G,J,ee,ne,oe,me,Ce,le,ge){for(ne=Ce;ne<le;++ne)for(Ce=0;Ce<ge;++Ce)oe[me++]=q(ee[U(G[J++])])},j[C]=function(G,J,ee,ne,oe,me,Ce){var le=8>>G.b,ge=G.Ea,we=G.K[0],je=G.w;if(8>le)for(G=(1<<G.b)-1,je=(1<<le)-1;J<ee;++J){var be,Ie=0;for(be=0;be<ge;++be)be&G||(Ie=U(ne[oe++])),me[Ce++]=q(we[Ie&je]),Ie>>=le}else j["VP8LMapColor"+O](ne,oe,we,je,me,Ce,J,ee,ge)}}function mt(C,B,O,U,q){for(O=B+O;B<O;){var G=C[B++];U[q++]=G>>16&255,U[q++]=G>>8&255,U[q++]=255&G}}function ct(C,B,O,U,q){for(O=B+O;B<O;){var G=C[B++];U[q++]=G>>16&255,U[q++]=G>>8&255,U[q++]=255&G,U[q++]=G>>24&255}}function xt(C,B,O,U,q){for(O=B+O;B<O;){var G=(J=C[B++])>>16&240|J>>12&15,J=240&J|J>>28&15;U[q++]=G,U[q++]=J}}function Mt(C,B,O,U,q){for(O=B+O;B<O;){var G=(J=C[B++])>>16&248|J>>13&7,J=J>>5&224|J>>3&31;U[q++]=G,U[q++]=J}}function zt(C,B,O,U,q){for(O=B+O;B<O;){var G=C[B++];U[q++]=255&G,U[q++]=G>>8&255,U[q++]=G>>16&255}}function ht(C,B,O,U,q,G){if(G==0)for(O=B+O;B<O;)he(U,((G=C[B++])[0]>>24|G[1]>>8&65280|G[2]<<8&16711680|G[3]<<24)>>>0),q+=32;else r(U,q,C,B,O)}function Lt(C,B){j[B][0]=j[C+"0"],j[B][1]=j[C+"1"],j[B][2]=j[C+"2"],j[B][3]=j[C+"3"],j[B][4]=j[C+"4"],j[B][5]=j[C+"5"],j[B][6]=j[C+"6"],j[B][7]=j[C+"7"],j[B][8]=j[C+"8"],j[B][9]=j[C+"9"],j[B][10]=j[C+"10"],j[B][11]=j[C+"11"],j[B][12]=j[C+"12"],j[B][13]=j[C+"13"],j[B][14]=j[C+"0"],j[B][15]=j[C+"0"]}function Pt(C){return C==NT||C==jT||C==fC||C==TT}function qt(){this.eb=[],this.size=this.A=this.fb=0}function er(){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 en(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new qt,this.f.kb=new er,this.sd=null}function kt(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function Tn(){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(C){return alert("todo:WebPSamplerProcessPlane"),C.T}function Wt(C,B){var O=C.T,U=B.ba.f.RGBA,q=U.eb,G=U.fb+C.ka*U.A,J=Mo[B.ba.S],ee=C.y,ne=C.O,oe=C.f,me=C.N,Ce=C.ea,le=C.W,ge=B.cc,we=B.dc,je=B.Mc,be=B.Nc,Ie=C.ka,Oe=C.ka+C.T,He=C.U,Re=He+1>>1;for(Ie==0?J(ee,ne,null,null,oe,me,Ce,le,oe,me,Ce,le,q,G,null,null,He):(J(B.ec,B.fc,ee,ne,ge,we,je,be,oe,me,Ce,le,q,G-U.A,q,G,He),++O);Ie+2<Oe;Ie+=2)ge=oe,we=me,je=Ce,be=le,me+=C.Rc,le+=C.Rc,G+=2*U.A,J(ee,(ne+=2*C.fa)-C.fa,ee,ne,ge,we,je,be,oe,me,Ce,le,q,G-U.A,q,G,He);return ne+=C.fa,C.j+Oe<C.o?(r(B.ec,B.fc,ee,ne,He),r(B.cc,B.dc,oe,me,Re),r(B.Mc,B.Nc,Ce,le,Re),O--):1&Oe||J(ee,ne,null,null,oe,me,Ce,le,oe,me,Ce,le,q,G+U.A,null,null,He),O}function wn(C,B,O){var U=C.F,q=[C.J];if(U!=null){var G=C.U,J=B.ba.S,ee=J==AC||J==fC;B=B.ba.f.RGBA;var ne=[0],oe=C.ka;ne[0]=C.T,C.Kb&&(oe==0?--ne[0]:(--oe,q[0]-=C.width),C.j+C.ka+C.T==C.o&&(ne[0]=C.o-C.j-oe));var me=B.eb;oe=B.fb+oe*B.A,C=A$(U,q[0],C.width,G,ne,me,oe+(ee?0:3),B.A),t(O==ne),C&&Pt(J)&&zv(me,oe,ee,G,ne,B.A)}return 0}function Dr(C){var B=C.ma,O=B.ba.S,U=11>O,q=O==dC||O==hC||O==AC||O==ET||O==12||Pt(O);if(B.memory=null,B.Ib=null,B.Jb=null,B.Nd=null,!Oo(B.Oa,C,q?11:12))return 0;if(q&&Pt(O)&&Cu(),C.da)alert("todo:use_scaling");else{if(U){if(B.Ib=Ut,C.Kb){if(O=C.U+1>>1,B.memory=s(C.U+2*O),B.memory==null)return 0;B.ec=B.memory,B.fc=0,B.cc=B.ec,B.dc=B.fc+C.U,B.Mc=B.cc,B.Nc=B.dc+O,B.Ib=Wt,Cu()}}else alert("todo:EmitYUV");q&&(B.Jb=wn,U&&Tr())}if(U&&!j$){for(C=0;256>C;++C)uve[C]=89858*(C-128)+mC>>pC,Ave[C]=-22014*(C-128)+mC,hve[C]=-45773*(C-128),dve[C]=113618*(C-128)+mC>>pC;for(C=Kv;C<OT;++C)B=76283*(C-16)+mC>>pC,fve[C-Kv]=Sc(B,255),pve[C-Kv]=Sc(B+8>>4,15);j$=1}return 1}function yt(C){var B=C.ma,O=C.U,U=C.T;return t(!(1&C.ka)),0>=O||0>=U?0:(O=B.Ib(C,B),B.Jb!=null&&B.Jb(C,B,O),B.Dc+=O,1)}function Hi(C){C.ma.memory=null}function ts(C,B,O,U){return ce(C,8)!=47?0:(B[0]=ce(C,14)+1,O[0]=ce(C,14)+1,U[0]=ce(C,1),ce(C,3)!=0?0:!C.h)}function Sr(C,B){if(4>C)return C+1;var O=C-2>>1;return(2+(1&C)<<O)+ce(B,O)+1}function Jr(C,B){return 120<B?B-120:1<=(O=((O=Y0e[B-1])>>4)*C+(8-(15&O)))?O:1;var O}function Qr(C,B,O){var U=Y(O),q=C[B+=255&U].g-8;return 0<q&&(K(O,O.u+8),U=Y(O),B+=C[B].value,B+=U&(1<<q)-1),K(O,O.u+C[B].g),C[B].value}function $i(C,B,O){return O.g+=C.g,O.value+=C.value<<B>>>0,t(8>=O.g),C.g}function ns(C,B,O){var U=C.xc;return t((B=U==0?0:C.vc[C.md*(O>>U)+(B>>U)])<C.Wb),C.Ya[B]}function ZA(C,B,O,U){var q=C.ab,G=C.c*B,J=C.C;B=J+B;var ee=O,ne=U;for(U=C.Ta,O=C.Ua;0<q--;){var oe=C.gc[q],me=J,Ce=B,le=ee,ge=ne,we=(ne=U,ee=O,oe.Ea);switch(t(me<Ce),t(Ce<=oe.nc),oe.hc){case 2:Lm(le,ge,(Ce-me)*we,ne,ee);break;case 0:var je=me,be=Ce,Ie=ne,Oe=ee,He=(wt=oe).Ea;je==0&&(Ld(le,ge,null,null,1,Ie,Oe),Ee(le,ge+1,0,0,He-1,Ie,Oe+1),ge+=He,Oe+=He,++je);for(var Re=1<<wt.b,Et=Re-1,ut=Te(He,wt.b),nn=wt.K,wt=wt.w+(je>>wt.b)*ut;je<be;){var mn=nn,_i=wt,rn=1;for(Rd(le,ge,Ie,Oe-He,1,Ie,Oe);rn<He;){var bt=(rn&~Et)+Re;bt>He&&(bt=He),(0,_l[mn[_i++]>>8&15])(le,ge+ +rn,Ie,Oe+rn-He,bt-rn,Ie,Oe+rn),rn=bt}ge+=He,Oe+=He,++je&Et||(wt+=ut)}Ce!=oe.nc&&r(ne,ee-we,ne,ee+(Ce-me-1)*we,we);break;case 1:for(we=le,be=ge,He=(le=oe.Ea)-(Oe=le&~(Ie=(ge=1<<oe.b)-1)),je=Te(le,oe.b),Re=oe.K,oe=oe.w+(me>>oe.b)*je;me<Ce;){for(Et=Re,ut=oe,nn=new Qe,wt=be+Oe,mn=be+le;be<wt;)Ue(Et[ut++],nn),ff(nn,we,be,ge,ne,ee),be+=ge,ee+=ge;be<mn&&(Ue(Et[ut++],nn),ff(nn,we,be,He,ne,ee),be+=He,ee+=He),++me&Ie||(oe+=je)}break;case 3:if(le==ne&&ge==ee&&0<oe.b){for(be=ne,le=we=ee+(Ce-me)*we-(Oe=(Ce-me)*Te(oe.Ea,oe.b)),ge=ne,Ie=ee,je=[],Oe=(He=Oe)-1;0<=Oe;--Oe)je[Oe]=ge[Ie+Oe];for(Oe=He-1;0<=Oe;--Oe)be[le+Oe]=je[Oe];Af(oe,me,Ce,ne,we,ne,ee)}else Af(oe,me,Ce,le,ge,ne,ee)}ee=U,ne=O}ne!=O&&r(U,O,ee,ne,G)}function Pd(C,B){var O=C.V,U=C.Ba+C.c*C.C,q=B-C.C;if(t(B<=C.l.o),t(16>=q),0<q){var G=C.l,J=C.Ta,ee=C.Ua,ne=G.width;if(ZA(C,q,O,U),q=ee=[ee],t((O=C.C)<(U=B)),t(G.v<G.va),U>G.o&&(U=G.o),O<G.j){var oe=G.j-O;O=G.j,q[0]+=oe*ne}if(O>=U?O=0:(q[0]+=4*G.v,G.ka=O-G.j,G.U=G.va-G.v,G.T=U-O,O=1),O){if(ee=ee[0],11>(O=C.ca).S){var me=O.f.RGBA,Ce=(U=O.S,q=G.U,G=G.T,oe=me.eb,me.A),le=G;for(me=me.fb+C.Ma*me.A;0<le--;){var ge=J,we=ee,je=q,be=oe,Ie=me;switch(U){case uC:Qv(ge,we,je,be,Ie);break;case dC:Hv(ge,we,je,be,Ie);break;case NT:Hv(ge,we,je,be,Ie),zv(be,Ie,0,je,1,0);break;case x$:mf(ge,we,je,be,Ie);break;case hC:ht(ge,we,je,be,Ie,1);break;case jT:ht(ge,we,je,be,Ie,1),zv(be,Ie,0,je,1,0);break;case AC:ht(ge,we,je,be,Ie,0);break;case fC:ht(ge,we,je,be,Ie,0),zv(be,Ie,1,je,1,0);break;case ET:Rm(ge,we,je,be,Ie);break;case TT:Rm(ge,we,je,be,Ie),h$(be,Ie,je,1,0);break;case w$:pf(ge,we,je,be,Ie);break;default:t(0)}ee+=ne,me+=Ce}C.Ma+=G}else alert("todo:EmitRescaledRowsYUVA");t(C.Ma<=O.height)}}C.C=B,t(C.C<=C.i)}function Sl(C){var B;if(0<C.ua)return 0;for(B=0;B<C.Wb;++B){var O=C.Ya[B].G,U=C.Ya[B].H;if(0<O[1][U[1]+0].g||0<O[2][U[2]+0].g||0<O[3][U[3]+0].g)return 0}return 1}function bc(C,B,O,U,q,G){if(C.Z!=0){var J=C.qd,ee=C.rd;for(t(Hd[C.Z]!=null);B<O;++B)Hd[C.Z](J,ee,U,q,U,q,G),J=U,ee=q,q+=G;C.qd=J,C.rd=ee}}function kl(C,B){var O=C.l.ma,U=O.Z==0||O.Z==1?C.l.j:C.C;if(U=C.C<U?U:C.C,t(B<=C.l.o),B>U){var q=C.l.width,G=O.ca,J=O.tb+q*U,ee=C.V,ne=C.Ba+C.c*U,oe=C.gc;t(C.ab==1),t(oe[0].hc==3),BT(oe[0],U,B,ee,ne,G,J),bc(O,U,B,G,J,q)}C.C=C.Ma=B}function Bl(C,B,O,U,q,G,J){var ee=C.$/U,ne=C.$%U,oe=C.m,me=C.s,Ce=O+C.$,le=Ce;q=O+U*q;var ge=O+U*G,we=280+me.ua,je=C.Pb?ee:16777216,be=0<me.ua?me.Wa:null,Ie=me.wc,Oe=Ce<ge?ns(me,ne,ee):null;t(C.C<G),t(ge<=q);var He=!1;e:for(;;){for(;He||Ce<ge;){var Re=0;if(ee>=je){var Et=Ce-O;t((je=C).Pb),je.wd=je.m,je.xd=Et,0<je.s.ua&&_e(je.s.Wa,je.s.vb),je=ee+J0e}if(ne&Ie||(Oe=ns(me,ne,ee)),t(Oe!=null),Oe.Qb&&(B[Ce]=Oe.qb,He=!0),!He)if(Z(oe),Oe.jc){Re=oe,Et=B;var ut=Ce,nn=Oe.pd[Y(Re)&Fm-1];t(Oe.jc),256>nn.g?(K(Re,Re.u+nn.g),Et[ut]=nn.value,Re=0):(K(Re,Re.u+nn.g-256),t(256<=nn.value),Re=nn.value),Re==0&&(He=!0)}else Re=Qr(Oe.G[0],Oe.H[0],oe);if(oe.h)break;if(He||256>Re){if(!He)if(Oe.nd)B[Ce]=(Oe.qb|Re<<8)>>>0;else{if(Z(oe),He=Qr(Oe.G[1],Oe.H[1],oe),Z(oe),Et=Qr(Oe.G[2],Oe.H[2],oe),ut=Qr(Oe.G[3],Oe.H[3],oe),oe.h)break;B[Ce]=(ut<<24|He<<16|Re<<8|Et)>>>0}if(He=!1,++Ce,++ne>=U&&(ne=0,++ee,J!=null&&ee<=G&&!(ee%16)&&J(C,ee),be!=null))for(;le<Ce;)Re=B[le++],be.X[(506832829*Re&4294967295)>>>be.Mb]=Re}else if(280>Re){if(Re=Sr(Re-256,oe),Et=Qr(Oe.G[4],Oe.H[4],oe),Z(oe),Et=Jr(U,Et=Sr(Et,oe)),oe.h)break;if(Ce-O<Et||q-Ce<Re)break e;for(ut=0;ut<Re;++ut)B[Ce+ut]=B[Ce+ut-Et];for(Ce+=Re,ne+=Re;ne>=U;)ne-=U,++ee,J!=null&&ee<=G&&!(ee%16)&&J(C,ee);if(t(Ce<=q),ne&Ie&&(Oe=ns(me,ne,ee)),be!=null)for(;le<Ce;)Re=B[le++],be.X[(506832829*Re&4294967295)>>>be.Mb]=Re}else{if(!(Re<we))break e;for(He=Re-280,t(be!=null);le<Ce;)Re=B[le++],be.X[(506832829*Re&4294967295)>>>be.Mb]=Re;Re=Ce,t(!(He>>>(Et=be).Xa)),B[Re]=Et.X[He],He=!0}He||t(oe.h==X(oe))}if(C.Pb&&oe.h&&Ce<q)t(C.m.h),C.a=5,C.m=C.wd,C.$=C.xd,0<C.s.ua&&_e(C.s.vb,C.s.Wa);else{if(oe.h)break e;J!=null&&J(C,ee>G?G:ee),C.a=0,C.$=Ce-O}return 1}return C.a=3,0}function Po(C){t(C!=null),C.vc=null,C.yc=null,C.Ya=null;var B=C.Wa;B!=null&&(B.X=null),C.vb=null,t(C!=null)}function ef(){var C=new vt;return C==null?null:(C.a=0,C.xb=S$,Lt("Predictor","VP8LPredictors"),Lt("Predictor","VP8LPredictors_C"),Lt("PredictorAdd","VP8LPredictorsAdd"),Lt("PredictorAdd","VP8LPredictorsAdd_C"),Lm=We,ff=Ge,Qv=mt,Hv=ct,Rm=xt,pf=Mt,mf=zt,j.VP8LMapColor32b=mi,j.VP8LMapColor8b=Nc,C)}function Cc(C,B,O,U,q){var G=1,J=[C],ee=[B],ne=U.m,oe=U.s,me=null,Ce=0;e:for(;;){if(O)for(;G&&ce(ne,1);){var le=J,ge=ee,we=U,je=1,be=we.m,Ie=we.gc[we.ab],Oe=ce(be,2);if(we.Oc&1<<Oe)G=0;else{switch(we.Oc|=1<<Oe,Ie.hc=Oe,Ie.Ea=le[0],Ie.nc=ge[0],Ie.K=[null],++we.ab,t(4>=we.ab),Oe){case 0:case 1:Ie.b=ce(be,3)+2,je=Cc(Te(Ie.Ea,Ie.b),Te(Ie.nc,Ie.b),0,we,Ie.K),Ie.K=Ie.K[0];break;case 3:var He,Re=ce(be,8)+1,Et=16<Re?0:4<Re?1:2<Re?2:3;if(le[0]=Te(Ie.Ea,Et),Ie.b=Et,He=je=Cc(Re,1,0,we,Ie.K)){var ut,nn=Re,wt=Ie,mn=1<<(8>>wt.b),_i=s(mn);if(_i==null)He=0;else{var rn=wt.K[0],bt=wt.w;for(_i[0]=wt.K[0][0],ut=1;ut<1*nn;++ut)_i[ut]=st(rn[bt+ut],_i[ut-1]);for(;ut<4*mn;++ut)_i[ut]=0;wt.K[0]=null,wt.K[0]=_i,He=1}}je=He;break;case 2:break;default:t(0)}G=je}}if(J=J[0],ee=ee[0],G&&ce(ne,1)&&!(G=1<=(Ce=ce(ne,4))&&11>=Ce)){U.a=3;break e}var Ye;if(Ye=G)t:{var ei,Zt,Cn,Ar=U,is=J,Js=ee,Hr=Ce,_s=O,Zs=Ar.m,Ei=Ar.s,Nn=[null],Rn=1,$r=0,Un=X0e[Hr];n:for(;;){if(_s&&ce(Zs,1)){var ss=ce(Zs,3)+2,Nl=Te(is,ss),ti=Te(Js,ss),ka=Nl*ti;if(!Cc(Nl,ti,0,Ar,Nn))break n;for(Nn=Nn[0],Ei.xc=ss,ei=0;ei<ka;++ei){var Gn=Nn[ei]>>8&65535;Nn[ei]=Gn,Gn>=Rn&&(Rn=Gn+1)}}if(Zs.h)break n;for(Zt=0;5>Zt;++Zt){var Ni=b$[Zt];!Zt&&0<Hr&&(Ni+=1<<Hr),$r<Ni&&($r=Ni)}var eo=a(Rn*Un,F),ea=Rn,to=a(ea,D);if(to==null)var no=null;else t(65536>=ea),no=to;var Ba=s($r);if(no==null||Ba==null||eo==null){Ar.a=1;break n}var ro=eo;for(ei=Cn=0;ei<Rn;++ei){var rr=no[ei],io=rr.G,jl=rr.H,gf=0,_u=1,as=0;for(Zt=0;5>Zt;++Zt){Ni=b$[Zt],io[Zt]=ro,jl[Zt]=Cn,!Zt&&0<Hr&&(Ni+=1<<Hr);i:{var yC,FT=Ni,vC=Ar,qv=Ba,yve=ro,vve=Cn,MT=0,$d=vC.m,xve=ce($d,1);if(i(qv,0,0,FT),xve){var wve=ce($d,1)+1,bve=ce($d,1),I$=ce($d,bve==0?1:8);qv[I$]=1,wve==2&&(qv[I$=ce($d,8)]=1);var xC=1}else{var O$=s(19),F$=ce($d,4)+4;if(19<F$){vC.a=3;var wC=0;break i}for(yC=0;yC<F$;++yC)O$[G0e[yC]]=ce($d,3);var LT=void 0,Wv=void 0,M$=vC,Cve=O$,bC=FT,L$=qv,RT=0,zd=M$.m,R$=8,U$=a(128,F);r:for(;N(U$,0,7,Cve,19);){if(ce(zd,1)){var Sve=2+2*ce(zd,3);if((LT=2+ce(zd,Sve))>bC)break r}else LT=bC;for(Wv=0;Wv<bC&&LT--;){Z(zd);var D$=U$[0+(127&Y(zd))];K(zd,zd.u+D$.g);var Qm=D$.value;if(16>Qm)L$[Wv++]=Qm,Qm!=0&&(R$=Qm);else{var kve=Qm==16,Q$=Qm-16,Bve=q0e[Q$],H$=ce(zd,K0e[Q$])+Bve;if(Wv+H$>bC)break r;for(var _ve=kve?R$:0;0<H$--;)L$[Wv++]=_ve}}RT=1;break r}RT||(M$.a=3),xC=RT}(xC=xC&&!$d.h)&&(MT=N(yve,vve,8,qv,FT)),xC&&MT!=0?wC=MT:(vC.a=3,wC=0)}if(wC==0)break n;if(_u&&W0e[Zt]==1&&(_u=ro[Cn].g==0),gf+=ro[Cn].g,Cn+=wC,3>=Zt){var Gv,UT=Ba[0];for(Gv=1;Gv<Ni;++Gv)Ba[Gv]>UT&&(UT=Ba[Gv]);as+=UT}}if(rr.nd=_u,rr.Qb=0,_u&&(rr.qb=(io[3][jl[3]+0].value<<24|io[1][jl[1]+0].value<<16|io[2][jl[2]+0].value)>>>0,gf==0&&256>io[0][jl[0]+0].value&&(rr.Qb=1,rr.qb+=io[0][jl[0]+0].value<<8)),rr.jc=!rr.Qb&&6>as,rr.jc){var CC,Eu=rr;for(CC=0;CC<Fm;++CC){var Vd=CC,Kd=Eu.pd[Vd],SC=Eu.G[0][Eu.H[0]+Vd];256<=SC.value?(Kd.g=SC.g+256,Kd.value=SC.value):(Kd.g=0,Kd.value=0,Vd>>=$i(SC,8,Kd),Vd>>=$i(Eu.G[1][Eu.H[1]+Vd],16,Kd),Vd>>=$i(Eu.G[2][Eu.H[2]+Vd],0,Kd),$i(Eu.G[3][Eu.H[3]+Vd],24,Kd))}}}Ei.vc=Nn,Ei.Wb=Rn,Ei.Ya=no,Ei.yc=eo,Ye=1;break t}Ye=0}if(!(G=Ye)){U.a=3;break e}if(0<Ce){if(oe.ua=1<<Ce,!te(oe.Wa,Ce)){U.a=1,G=0;break e}}else oe.ua=0;var DT=U,$$=J,Eve=ee,QT=DT.s,HT=QT.xc;if(DT.c=$$,DT.i=Eve,QT.md=Te($$,HT),QT.wc=HT==0?-1:(1<<HT)-1,O){U.xb=sve;break e}if((me=s(J*ee))==null){U.a=1,G=0;break e}G=(G=Bl(U,me,0,J,ee,ee,null))&&!ne.h;break e}return G?(q!=null?q[0]=me:(t(me==null),t(O)),U.$=0,O||Po(oe)):Po(oe),G}function tf(C,B){var O=C.c*C.i,U=O+B+16*B;return t(C.c<=B),C.V=s(U),C.V==null?(C.Ta=null,C.Ua=0,C.a=1,0):(C.Ta=C.V,C.Ua=C.Ba+O+B,1)}function xm(C,B){var O=C.C,U=B-O,q=C.V,G=C.Ba+C.c*O;for(t(B<=C.l.o);0<U;){var J=16<U?16:U,ee=C.l.ma,ne=C.l.width,oe=ne*J,me=ee.ca,Ce=ee.tb+ne*O,le=C.Ta,ge=C.Ua;ZA(C,J,q,G),f$(le,ge,me,Ce,oe),bc(ee,O,O+J,me,Ce,ne),U-=J,q+=J*C.c,O+=J}t(O==B),C.C=C.Ma=B}function wm(){this.ub=this.yd=this.td=this.Rb=0}function bm(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function lT(){this.Fb=this.Bb=this.Cb=0,this.Zb=s(4),this.Lb=s(4)}function _v(){this.Yb=function(){var C=[];return function B(O,U,q){for(var G=q[U],J=0;J<G&&(O.push(q.length>U+1?[]:0),!(q.length<U+1));J++)B(O[J],U+1,q)}(C,0,[3,11]),C}()}function V2(){this.jb=s(3),this.Wc=o([4,8],_v),this.Xc=o([4,17],_v)}function K2(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new s(4),this.od=new s(4)}function Io(){this.ld=this.La=this.dd=this.tc=0}function Ev(){this.Na=this.la=0}function q2(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function Nv(){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 W2(){this.uc=this.M=this.Nb=0,this.wa=Array(new Io),this.Y=0,this.ya=Array(new Nv),this.aa=0,this.l=new Cm}function G2(){this.y=s(16),this.f=s(8),this.ea=s(8)}function Y2(){this.cb=this.a=0,this.sc="",this.m=new R,this.Od=new wm,this.Kc=new bm,this.ed=new K2,this.Qa=new lT,this.Ic=this.$c=this.Aa=0,this.D=new W2,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,q2),this.Pa=new V2,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new G2),this.Hd=0,this.rb=Array(new Ev),this.sb=0,this.wa=Array(new Io),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 Nv),this.L=this.aa=0,this.gd=o([4,2],Io),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 Sc(C,B){return 0>C?0:C>B?B:C}function Cm(){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 cT(){var C=new Y2;return C!=null&&(C.a=0,C.sc="OK",C.cb=0,C.Xb=0,Vv||(Vv=Sm)),C}function fi(C,B,O){return C.a==0&&(C.a=B,C.sc=O,C.cb=0),0}function X2(C,B,O){return 3<=O&&C[B+0]==157&&C[B+1]==1&&C[B+2]==42}function kc(C,B){if(C==null)return 0;if(C.a=0,C.sc="OK",B==null)return fi(C,2,"null VP8Io passed to VP8GetHeaders()");var O=B.data,U=B.w,q=B.ha;if(4>q)return fi(C,7,"Truncated header.");var G=O[U+0]|O[U+1]<<8|O[U+2]<<16,J=C.Od;if(J.Rb=!(1&G),J.td=G>>1&7,J.yd=G>>4&1,J.ub=G>>5,3<J.td)return fi(C,3,"Incorrect keyframe parameters.");if(!J.yd)return fi(C,4,"Frame not displayable.");U+=3,q-=3;var ee=C.Kc;if(J.Rb){if(7>q)return fi(C,7,"cannot parse picture header");if(!X2(O,U,q))return fi(C,3,"Bad code word");ee.c=16383&(O[U+4]<<8|O[U+3]),ee.Td=O[U+4]>>6,ee.i=16383&(O[U+6]<<8|O[U+5]),ee.Ud=O[U+6]>>6,U+=7,q-=7,C.za=ee.c+15>>4,C.Ub=ee.i+15>>4,B.width=ee.c,B.height=ee.i,B.Da=0,B.j=0,B.v=0,B.va=B.width,B.o=B.height,B.da=0,B.ib=B.width,B.hb=B.height,B.U=B.width,B.T=B.height,i((G=C.Pa).jb,0,255,G.jb.length),t((G=C.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 fi(C,7,"bad partition length");H(G=C.m,O,U,J.ub),U+=J.ub,q-=J.ub,J.Rb&&(ee.Ld=se(G),ee.Kd=se(G)),ee=C.Qa;var ne,oe=C.Pa;if(t(G!=null),t(ee!=null),ee.Cb=se(G),ee.Cb){if(ee.Bb=se(G),se(G)){for(ee.Fb=se(G),ne=0;4>ne;++ne)ee.Zb[ne]=se(G)?$(G,7):0;for(ne=0;4>ne;++ne)ee.Lb[ne]=se(G)?$(G,6):0}if(ee.Bb)for(ne=0;3>ne;++ne)oe.jb[ne]=se(G)?W(G,8):255}else ee.Bb=0;if(G.Ka)return fi(C,3,"cannot parse segment header");if((ee=C.ed).zd=se(G),ee.Tb=W(G,6),ee.wb=W(G,3),ee.Pc=se(G),ee.Pc&&se(G)){for(oe=0;4>oe;++oe)se(G)&&(ee.vd[oe]=$(G,6));for(oe=0;4>oe;++oe)se(G)&&(ee.od[oe]=$(G,6))}if(C.L=ee.Tb==0?0:ee.zd?1:2,G.Ka)return fi(C,3,"cannot parse filter header");var me=q;if(q=ne=U,U=ne+me,ee=me,C.Xb=(1<<W(C.m,2))-1,me<3*(oe=C.Xb))O=7;else{for(ne+=3*oe,ee-=3*oe,me=0;me<oe;++me){var Ce=O[q+0]|O[q+1]<<8|O[q+2]<<16;Ce>ee&&(Ce=ee),H(C.Jc[+me],O,ne,Ce),ne+=Ce,ee-=Ce,q+=3}H(C.Jc[+oe],O,ne,ee),O=ne<U?0:5}if(O!=0)return fi(C,O,"cannot parse partitions");for(O=W(ne=C.m,7),q=se(ne)?$(ne,4):0,U=se(ne)?$(ne,4):0,ee=se(ne)?$(ne,4):0,oe=se(ne)?$(ne,4):0,ne=se(ne)?$(ne,4):0,me=C.Qa,Ce=0;4>Ce;++Ce){if(me.Cb){var le=me.Zb[Ce];me.Fb||(le+=O)}else{if(0<Ce){C.pb[Ce]=C.pb[0];continue}le=O}var ge=C.pb[Ce];ge.Sc[0]=PT[Sc(le+q,127)],ge.Sc[1]=IT[Sc(le+0,127)],ge.Eb[0]=2*PT[Sc(le+U,127)],ge.Eb[1]=101581*IT[Sc(le+ee,127)]>>16,8>ge.Eb[1]&&(ge.Eb[1]=8),ge.Qc[0]=PT[Sc(le+oe,117)],ge.Qc[1]=IT[Sc(le+ne,127)],ge.lc=le+ne}if(!J.Rb)return fi(C,4,"Not a key frame.");for(se(G),J=C.Pa,O=0;4>O;++O){for(q=0;8>q;++q)for(U=0;3>U;++U)for(ee=0;11>ee;++ee)oe=ie(G,rve[O][q][U][ee])?W(G,8):tve[O][q][U][ee],J.Wc[O][q].Yb[U][ee]=oe;for(q=0;17>q;++q)J.Xc[O][q]=J.Wc[O][ive[q]]}return C.kc=se(G),C.kc&&(C.Bd=W(G,8)),C.cb=1}function Sm(C,B,O,U,q,G,J){var ee=B[q].Yb[O];for(O=0;16>q;++q){if(!ie(C,ee[O+0]))return q;for(;!ie(C,ee[O+1]);)if(ee=B[++q].Yb[0],O=0,q==16)return 16;var ne=B[q+1].Yb;if(ie(C,ee[O+2])){var oe=C,me=0;if(ie(oe,(le=ee)[(Ce=O)+3]))if(ie(oe,le[Ce+6])){for(ee=0,Ce=2*(me=ie(oe,le[Ce+8]))+(le=ie(oe,le[Ce+9+me])),me=0,le=Z0e[Ce];le[ee];++ee)me+=me+ie(oe,le[ee]);me+=3+(8<<Ce)}else ie(oe,le[Ce+7])?(me=7+2*ie(oe,165),me+=ie(oe,145)):me=5+ie(oe,159);else me=ie(oe,le[Ce+4])?3+ie(oe,le[Ce+5]):2;ee=ne[2]}else me=1,ee=ne[1];ne=J+eve[q],0>(oe=C).b&&de(oe);var Ce,le=oe.b,ge=(Ce=oe.Ca>>1)-(oe.I>>le)>>31;--oe.b,oe.Ca+=ge,oe.Ca|=1,oe.I-=(Ce+1&ge)<<le,G[ne]=((me^ge)-ge)*U[(0<q)+0]}return 16}function jv(C){var B=C.rb[C.sb-1];B.la=0,B.Na=0,i(C.zc,0,0,C.zc.length),C.ja=0}function Ja(C,B,O,U,q){q=C[B+O+32*U]+(q>>3),C[B+O+32*U]=-256&q?0>q?0:255:q}function km(C,B,O,U,q,G){Ja(C,B,0,O,U+q),Ja(C,B,1,O,U+G),Ja(C,B,2,O,U-G),Ja(C,B,3,O,U-q)}function yu(C){return(20091*C>>16)+C}function rs(C,B,O,U){var q,G=0,J=s(16);for(q=0;4>q;++q){var ee=C[B+0]+C[B+8],ne=C[B+0]-C[B+8],oe=(35468*C[B+4]>>16)-yu(C[B+12]),me=yu(C[B+4])+(35468*C[B+12]>>16);J[G+0]=ee+me,J[G+1]=ne+oe,J[G+2]=ne-oe,J[G+3]=ee-me,G+=4,B++}for(q=G=0;4>q;++q)ee=(C=J[G+0]+4)+J[G+8],ne=C-J[G+8],oe=(35468*J[G+4]>>16)-yu(J[G+12]),Ja(O,U,0,0,ee+(me=yu(J[G+4])+(35468*J[G+12]>>16))),Ja(O,U,1,0,ne+oe),Ja(O,U,2,0,ne-oe),Ja(O,U,3,0,ee-me),G++,U+=32}function J2(C,B,O,U){var q=C[B+0]+4,G=35468*C[B+4]>>16,J=yu(C[B+4]),ee=35468*C[B+1]>>16;km(O,U,0,q+J,C=yu(C[B+1]),ee),km(O,U,1,q+G,C,ee),km(O,U,2,q-G,C,ee),km(O,U,3,q-J,C,ee)}function uT(C,B,O,U,q){rs(C,B,O,U),q&&rs(C,B+16,O,U+4)}function dT(C,B,O,U){Su(C,B+0,O,U,1),Su(C,B+32,O,U+128,1)}function hT(C,B,O,U){var q;for(C=C[B+0]+4,q=0;4>q;++q)for(B=0;4>B;++B)Ja(O,U,B,q,C)}function Bc(C,B,O,U){C[B+0]&&Bs(C,B+0,O,U),C[B+16]&&Bs(C,B+16,O,U+4),C[B+32]&&Bs(C,B+32,O,U+128),C[B+48]&&Bs(C,B+48,O,U+128+4)}function Z2(C,B,O,U){var q,G=s(16);for(q=0;4>q;++q){var J=C[B+0+q]+C[B+12+q],ee=C[B+4+q]+C[B+8+q],ne=C[B+4+q]-C[B+8+q],oe=C[B+0+q]-C[B+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=(C=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=C-G[3+4*q],O[U+0]=J+ee>>3,O[U+16]=oe+ne>>3,O[U+32]=J-ee>>3,O[U+48]=oe-ne>>3,U+=64}function Bm(C,B,O){var U,q=B-32,G=Za,J=255-C[q-1];for(U=0;U<O;++U){var ee,ne=G,oe=J+C[B-1];for(ee=0;ee<O;++ee)C[B+ee]=ne[oe+C[q+ee]];B+=32}}function _m(C,B){Bm(C,B,4)}function Tv(C,B){Bm(C,B,8)}function AT(C,B){Bm(C,B,16)}function fT(C,B){var O;for(O=0;16>O;++O)r(C,B+32*O,C,B-32,16)}function pT(C,B){var O;for(O=16;0<O;--O)i(C,B,C[B-1],16),B+=32}function Id(C,B,O){var U;for(U=0;16>U;++U)i(B,O+32*U,C,16)}function eC(C,B){var O,U=16;for(O=0;16>O;++O)U+=C[B-1+32*O]+C[B+O-32];Id(U>>5,C,B)}function Od(C,B){var O,U=8;for(O=0;16>O;++O)U+=C[B-1+32*O];Id(U>>4,C,B)}function mT(C,B){var O,U=8;for(O=0;16>O;++O)U+=C[B+O-32];Id(U>>4,C,B)}function nf(C,B){Id(128,C,B)}function Vt(C,B,O){return C+2*B+O+2>>2}function gT(C,B){var O,U=B-32;for(U=new Uint8Array([Vt(C[U-1],C[U+0],C[U+1]),Vt(C[U+0],C[U+1],C[U+2]),Vt(C[U+1],C[U+2],C[U+3]),Vt(C[U+2],C[U+3],C[U+4])]),O=0;4>O;++O)r(C,B+32*O,U,0,U.length)}function yT(C,B){var O=C[B-1],U=C[B-1+32],q=C[B-1+64],G=C[B-1+96];he(C,B+0,16843009*Vt(C[B-1-32],O,U)),he(C,B+32,16843009*Vt(O,U,q)),he(C,B+64,16843009*Vt(U,q,G)),he(C,B+96,16843009*Vt(q,G,G))}function vT(C,B){var O,U=4;for(O=0;4>O;++O)U+=C[B+O-32]+C[B-1+32*O];for(U>>=3,O=0;4>O;++O)i(C,B+32*O,U,4)}function xT(C,B){var O=C[B-1+0],U=C[B-1+32],q=C[B-1+64],G=C[B-1-32],J=C[B+0-32],ee=C[B+1-32],ne=C[B+2-32],oe=C[B+3-32];C[B+0+96]=Vt(U,q,C[B-1+96]),C[B+1+96]=C[B+0+64]=Vt(O,U,q),C[B+2+96]=C[B+1+64]=C[B+0+32]=Vt(G,O,U),C[B+3+96]=C[B+2+64]=C[B+1+32]=C[B+0+0]=Vt(J,G,O),C[B+3+64]=C[B+2+32]=C[B+1+0]=Vt(ee,J,G),C[B+3+32]=C[B+2+0]=Vt(ne,ee,J),C[B+3+0]=Vt(oe,ne,ee)}function wT(C,B){var O=C[B+1-32],U=C[B+2-32],q=C[B+3-32],G=C[B+4-32],J=C[B+5-32],ee=C[B+6-32],ne=C[B+7-32];C[B+0+0]=Vt(C[B+0-32],O,U),C[B+1+0]=C[B+0+32]=Vt(O,U,q),C[B+2+0]=C[B+1+32]=C[B+0+64]=Vt(U,q,G),C[B+3+0]=C[B+2+32]=C[B+1+64]=C[B+0+96]=Vt(q,G,J),C[B+3+32]=C[B+2+64]=C[B+1+96]=Vt(G,J,ee),C[B+3+64]=C[B+2+96]=Vt(J,ee,ne),C[B+3+96]=Vt(ee,ne,ne)}function vu(C,B){var O=C[B-1+0],U=C[B-1+32],q=C[B-1+64],G=C[B-1-32],J=C[B+0-32],ee=C[B+1-32],ne=C[B+2-32],oe=C[B+3-32];C[B+0+0]=C[B+1+64]=G+J+1>>1,C[B+1+0]=C[B+2+64]=J+ee+1>>1,C[B+2+0]=C[B+3+64]=ee+ne+1>>1,C[B+3+0]=ne+oe+1>>1,C[B+0+96]=Vt(q,U,O),C[B+0+64]=Vt(U,O,G),C[B+0+32]=C[B+1+96]=Vt(O,G,J),C[B+1+32]=C[B+2+96]=Vt(G,J,ee),C[B+2+32]=C[B+3+96]=Vt(J,ee,ne),C[B+3+32]=Vt(ee,ne,oe)}function xu(C,B){var O=C[B+0-32],U=C[B+1-32],q=C[B+2-32],G=C[B+3-32],J=C[B+4-32],ee=C[B+5-32],ne=C[B+6-32],oe=C[B+7-32];C[B+0+0]=O+U+1>>1,C[B+1+0]=C[B+0+64]=U+q+1>>1,C[B+2+0]=C[B+1+64]=q+G+1>>1,C[B+3+0]=C[B+2+64]=G+J+1>>1,C[B+0+32]=Vt(O,U,q),C[B+1+32]=C[B+0+96]=Vt(U,q,G),C[B+2+32]=C[B+1+96]=Vt(q,G,J),C[B+3+32]=C[B+2+96]=Vt(G,J,ee),C[B+3+64]=Vt(J,ee,ne),C[B+3+96]=Vt(ee,ne,oe)}function bT(C,B){var O=C[B-1+0],U=C[B-1+32],q=C[B-1+64],G=C[B-1+96];C[B+0+0]=O+U+1>>1,C[B+2+0]=C[B+0+32]=U+q+1>>1,C[B+2+32]=C[B+0+64]=q+G+1>>1,C[B+1+0]=Vt(O,U,q),C[B+3+0]=C[B+1+32]=Vt(U,q,G),C[B+3+32]=C[B+1+64]=Vt(q,G,G),C[B+3+64]=C[B+2+64]=C[B+0+96]=C[B+1+96]=C[B+2+96]=C[B+3+96]=G}function CT(C,B){var O=C[B-1+0],U=C[B-1+32],q=C[B-1+64],G=C[B-1+96],J=C[B-1-32],ee=C[B+0-32],ne=C[B+1-32],oe=C[B+2-32];C[B+0+0]=C[B+2+32]=O+J+1>>1,C[B+0+32]=C[B+2+64]=U+O+1>>1,C[B+0+64]=C[B+2+96]=q+U+1>>1,C[B+0+96]=G+q+1>>1,C[B+3+0]=Vt(ee,ne,oe),C[B+2+0]=Vt(J,ee,ne),C[B+1+0]=C[B+3+32]=Vt(O,J,ee),C[B+1+32]=C[B+3+64]=Vt(U,O,J),C[B+1+64]=C[B+3+96]=Vt(q,U,O),C[B+1+96]=Vt(G,q,U)}function Em(C,B){var O;for(O=0;8>O;++O)r(C,B+32*O,C,B-32,8)}function Pv(C,B){var O;for(O=0;8>O;++O)i(C,B,C[B-1],8),B+=32}function _c(C,B,O){var U;for(U=0;8>U;++U)i(B,O+32*U,C,8)}function ST(C,B){var O,U=8;for(O=0;8>O;++O)U+=C[B+O-32]+C[B-1+32*O];_c(U>>4,C,B)}function Nm(C,B){var O,U=4;for(O=0;8>O;++O)U+=C[B+O-32];_c(U>>3,C,B)}function kT(C,B){var O,U=4;for(O=0;8>O;++O)U+=C[B-1+32*O];_c(U>>3,C,B)}function Iv(C,B){_c(128,C,B)}function Fd(C,B,O){var U=C[B-O],q=C[B+0],G=3*(q-U)+_T[1020+C[B-2*O]-C[B+O]],J=cC[112+(G+4>>3)];C[B-O]=Za[255+U+cC[112+(G+3>>3)]],C[B+0]=Za[255+q-J]}function Ov(C,B,O,U){var q=C[B+0],G=C[B+O];return Fo[255+C[B-2*O]-C[B-O]]>U||Fo[255+G-q]>U}function rf(C,B,O,U){return 4*Fo[255+C[B-O]-C[B+0]]+Fo[255+C[B-2*O]-C[B+O]]<=U}function Fv(C,B,O,U,q){var G=C[B-3*O],J=C[B-2*O],ee=C[B-O],ne=C[B+0],oe=C[B+O],me=C[B+2*O],Ce=C[B+3*O];return 4*Fo[255+ee-ne]+Fo[255+J-oe]>U?0:Fo[255+C[B-4*O]-G]<=q&&Fo[255+G-J]<=q&&Fo[255+J-ee]<=q&&Fo[255+Ce-me]<=q&&Fo[255+me-oe]<=q&&Fo[255+oe-ne]<=q}function jm(C,B,O,U){var q=2*U+1;for(U=0;16>U;++U)rf(C,B+U,O,q)&&Fd(C,B+U,O)}function Mv(C,B,O,U){var q=2*U+1;for(U=0;16>U;++U)rf(C,B+U*O,1,q)&&Fd(C,B+U*O,1)}function Tm(C,B,O,U){var q;for(q=3;0<q;--q)jm(C,B+=4*O,O,U)}function tC(C,B,O,U){var q;for(q=3;0<q;--q)Mv(C,B+=4,O,U)}function wu(C,B,O,U,q,G,J,ee){for(G=2*G+1;0<q--;){if(Fv(C,B,O,G,J))if(Ov(C,B,O,ee))Fd(C,B,O);else{var ne=C,oe=B,me=O,Ce=ne[oe-2*me],le=ne[oe-me],ge=ne[oe+0],we=ne[oe+me],je=ne[oe+2*me],be=27*(Oe=_T[1020+3*(ge-le)+_T[1020+Ce-we]])+63>>7,Ie=18*Oe+63>>7,Oe=9*Oe+63>>7;ne[oe-3*me]=Za[255+ne[oe-3*me]+Oe],ne[oe-2*me]=Za[255+Ce+Ie],ne[oe-me]=Za[255+le+be],ne[oe+0]=Za[255+ge-be],ne[oe+me]=Za[255+we-Ie],ne[oe+2*me]=Za[255+je-Oe]}B+=U}}function bu(C,B,O,U,q,G,J,ee){for(G=2*G+1;0<q--;){if(Fv(C,B,O,G,J))if(Ov(C,B,O,ee))Fd(C,B,O);else{var ne=C,oe=B,me=O,Ce=ne[oe-me],le=ne[oe+0],ge=ne[oe+me],we=cC[112+(4+(je=3*(le-Ce))>>3)],je=cC[112+(je+3>>3)],be=we+1>>1;ne[oe-2*me]=Za[255+ne[oe-2*me]+be],ne[oe-me]=Za[255+Ce+je],ne[oe+0]=Za[255+le-we],ne[oe+me]=Za[255+ge-be]}B+=U}}function nC(C,B,O,U,q,G){wu(C,B,O,1,16,U,q,G)}function rC(C,B,O,U,q,G){wu(C,B,1,O,16,U,q,G)}function iC(C,B,O,U,q,G){var J;for(J=3;0<J;--J)bu(C,B+=4*O,O,1,16,U,q,G)}function sf(C,B,O,U,q,G){var J;for(J=3;0<J;--J)bu(C,B+=4,1,O,16,U,q,G)}function sC(C,B,O,U,q,G,J,ee){wu(C,B,q,1,8,G,J,ee),wu(O,U,q,1,8,G,J,ee)}function P(C,B,O,U,q,G,J,ee){wu(C,B,1,q,8,G,J,ee),wu(O,U,1,q,8,G,J,ee)}function z(C,B,O,U,q,G,J,ee){bu(C,B+4*q,q,1,8,G,J,ee),bu(O,U+4*q,q,1,8,G,J,ee)}function ae(C,B,O,U,q,G,J,ee){bu(C,B+4,1,q,8,G,J,ee),bu(O,U+4,1,q,8,G,J,ee)}function Ae(){this.ba=new en,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new Tn,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 Ne(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function Le(){this.ua=0,this.Wa=new Ze,this.vb=new Ze,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new D,this.yc=new F}function vt(){this.xb=this.a=0,this.l=new Cm,this.ca=new en,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,Ne),this.Oc=0}function gt(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Cm,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function Gt(C,B,O,U,q,G,J){for(C=C==null?0:C[B+0],B=0;B<J;++B)q[G+B]=C+O[U+B]&255,C=q[G+B]}function Jt(C,B,O,U,q,G,J){var ee;if(C==null)Gt(null,null,O,U,q,G,J);else for(ee=0;ee<J;++ee)q[G+ee]=C[B+ee]+O[U+ee]&255}function bn(C,B,O,U,q,G,J){if(C==null)Gt(null,null,O,U,q,G,J);else{var ee,ne=C[B+0],oe=ne,me=ne;for(ee=0;ee<J;++ee)oe=me+(ne=C[B+ee])-oe,me=O[U+ee]+(-256&oe?0>oe?0:255:oe)&255,oe=ne,q[G+ee]=me}}function pi(C,B,O,U){var q=B.width,G=B.o;if(t(C!=null&&B!=null),0>O||0>=U||O+U>G)return null;if(!C.Cc){if(C.ga==null){var J;if(C.ga=new gt,(J=C.ga==null)||(J=B.width*B.o,t(C.Gb.length==0),C.Gb=s(J),C.Uc=0,C.Gb==null?J=0:(C.mb=C.Gb,C.nb=C.Uc,C.rc=null,J=1),J=!J),!J){J=C.ga;var ee=C.Fa,ne=C.P,oe=C.qc,me=C.mb,Ce=C.nb,le=ne+1,ge=oe-1,we=J.l;if(t(ee!=null&&me!=null&&B!=null),Hd[0]=null,Hd[1]=Gt,Hd[2]=Jt,Hd[3]=bn,J.ca=me,J.tb=Ce,J.c=B.width,J.i=B.height,t(0<J.c&&0<J.i),1>=oe)B=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)B=0;else if(we.put=yt,we.ac=Dr,we.bc=Hi,we.ma=J,we.width=B.width,we.height=B.height,we.Da=B.Da,we.v=B.v,we.va=B.va,we.j=B.j,we.o=B.o,J.$a)e:{t(J.$a==1),B=ef();t:for(;;){if(B==null){B=0;break e}if(t(J!=null),J.mc=B,B.c=J.c,B.i=J.i,B.l=J.l,B.l.ma=J,B.l.width=J.c,B.l.height=J.i,B.a=0,V(B.m,ee,le,ge),!Cc(J.c,J.i,1,B,null)||(B.ab==1&&B.gc[0].hc==3&&Sl(B.s)?(J.ic=1,ee=B.c*B.i,B.Ta=null,B.Ua=0,B.V=s(ee),B.Ba=0,B.V==null?(B.a=1,B=0):B=1):(J.ic=0,B=tf(B,J.c)),!B))break t;B=1;break e}J.mc=null,B=0}else B=ge>=J.c*J.i;J=!B}if(J)return null;C.ga.Lc!=1?C.Ga=0:U=G-O}t(C.ga!=null),t(O+U<=G);e:{if(B=(ee=C.ga).c,G=ee.l.o,ee.$a==0){if(le=C.rc,ge=C.Vc,we=C.Fa,ne=C.P+1+O*B,oe=C.mb,me=C.nb+O*B,t(ne<=C.P+C.qc),ee.Z!=0)for(t(Hd[ee.Z]!=null),J=0;J<U;++J)Hd[ee.Z](le,ge,we,ne,oe,me,B),le=oe,ge=me,me+=B,ne+=B;else for(J=0;J<U;++J)r(oe,me,we,ne,B),le=oe,ge=me,me+=B,ne+=B;C.rc=le,C.Vc=ge}else{if(t(ee.mc!=null),B=O+U,t((J=ee.mc)!=null),t(B<=J.i),J.C>=B)B=1;else if(ee.ic||Tr(),ee.ic){ee=J.V,le=J.Ba,ge=J.c;var je=J.i,be=(we=1,ne=J.$/ge,oe=J.$%ge,me=J.m,Ce=J.s,J.$),Ie=ge*je,Oe=ge*B,He=Ce.wc,Re=be<Oe?ns(Ce,oe,ne):null;t(be<=Ie),t(B<=je),t(Sl(Ce));t:for(;;){for(;!me.h&&be<Oe;){if(oe&He||(Re=ns(Ce,oe,ne)),t(Re!=null),Z(me),256>(je=Qr(Re.G[0],Re.H[0],me)))ee[le+be]=je,++be,++oe>=ge&&(oe=0,++ne<=B&&!(ne%16)&&kl(J,ne));else{if(!(280>je)){we=0;break t}je=Sr(je-256,me);var Et,ut=Qr(Re.G[4],Re.H[4],me);if(Z(me),!(be>=(ut=Jr(ge,ut=Sr(ut,me)))&&Ie-be>=je)){we=0;break t}for(Et=0;Et<je;++Et)ee[le+be+Et]=ee[le+be+Et-ut];for(be+=je,oe+=je;oe>=ge;)oe-=ge,++ne<=B&&!(ne%16)&&kl(J,ne);be<Oe&&oe&He&&(Re=ns(Ce,oe,ne))}t(me.h==X(me))}kl(J,ne>B?B:ne);break t}!we||me.h&&be<Ie?(we=0,J.a=me.h?5:3):J.$=be,B=we}else B=Bl(J,J.V,J.Ba,J.c,J.i,B,xm);if(!B){U=0;break e}}O+U>=G&&(C.Cc=1),U=1}if(!U)return null;if(C.Cc&&((U=C.ga)!=null&&(U.mc=null),C.ga=null,0<C.Ga))return alert("todo:WebPDequantizeLevels"),null}return C.nb+O*q}function Wn(C,B,O,U,q,G){for(;0<q--;){var J,ee=C,ne=B+(O?1:0),oe=C,me=B+(O?0:3);for(J=0;J<U;++J){var Ce=oe[me+4*J];Ce!=255&&(Ce*=32897,ee[ne+4*J+0]=ee[ne+4*J+0]*Ce>>23,ee[ne+4*J+1]=ee[ne+4*J+1]*Ce>>23,ee[ne+4*J+2]=ee[ne+4*J+2]*Ce>>23)}B+=G}}function zn(C,B,O,U,q){for(;0<U--;){var G;for(G=0;G<O;++G){var J=C[B+2*G+0],ee=15&(oe=C[B+2*G+1]),ne=4369*ee,oe=(240&oe|oe>>4)*ne>>16;C[B+2*G+0]=(240&J|J>>4)*ne>>16&240|(15&J|J<<4)*ne>>16>>4&15,C[B+2*G+1]=240&oe|ee}B+=q}}function hr(C,B,O,U,q,G,J,ee){var ne,oe,me=255;for(oe=0;oe<q;++oe){for(ne=0;ne<U;++ne){var Ce=C[B+ne];G[J+4*ne]=Ce,me&=Ce}B+=O,J+=ee}return me!=255}function jr(C,B,O,U,q){var G;for(G=0;G<q;++G)O[U+G]=C[B+G]>>8}function Tr(){zv=Wn,h$=zn,A$=hr,f$=jr}function Ss(C,B,O){j[C]=function(U,q,G,J,ee,ne,oe,me,Ce,le,ge,we,je,be,Ie,Oe,He){var Re,Et=He-1>>1,ut=ee[ne+0]|oe[me+0]<<16,nn=Ce[le+0]|ge[we+0]<<16;t(U!=null);var wt=3*ut+nn+131074>>2;for(B(U[q+0],255&wt,wt>>16,je,be),G!=null&&(wt=3*nn+ut+131074>>2,B(G[J+0],255&wt,wt>>16,Ie,Oe)),Re=1;Re<=Et;++Re){var mn=ee[ne+Re]|oe[me+Re]<<16,_i=Ce[le+Re]|ge[we+Re]<<16,rn=ut+mn+nn+_i+524296,bt=rn+2*(mn+nn)>>3;wt=bt+ut>>1,ut=(rn=rn+2*(ut+_i)>>3)+mn>>1,B(U[q+2*Re-1],255&wt,wt>>16,je,be+(2*Re-1)*O),B(U[q+2*Re-0],255&ut,ut>>16,je,be+(2*Re-0)*O),G!=null&&(wt=rn+nn>>1,ut=bt+_i>>1,B(G[J+2*Re-1],255&wt,wt>>16,Ie,Oe+(2*Re-1)*O),B(G[J+2*Re+0],255&ut,ut>>16,Ie,Oe+(2*Re+0)*O)),ut=mn,nn=_i}1&He||(wt=3*ut+nn+131074>>2,B(U[q+He-1],255&wt,wt>>16,je,be+(He-1)*O),G!=null&&(wt=3*nn+ut+131074>>2,B(G[J+He-1],255&wt,wt>>16,Ie,Oe+(He-1)*O)))}}function Cu(){Mo[uC]=ave,Mo[dC]=k$,Mo[x$]=ove,Mo[hC]=B$,Mo[AC]=_$,Mo[ET]=E$,Mo[w$]=lve,Mo[NT]=k$,Mo[jT]=B$,Mo[fC]=_$,Mo[TT]=E$}function Lv(C){return C&~cve?0>C?0:255:C>>N$}function af(C,B){return Lv((19077*C>>8)+(26149*B>>8)-14234)}function of(C,B,O){return Lv((19077*C>>8)-(6419*B>>8)-(13320*O>>8)+8708)}function Md(C,B){return Lv((19077*C>>8)+(33050*B>>8)-17685)}function lf(C,B,O,U,q){U[q+0]=af(C,O),U[q+1]=of(C,B,O),U[q+2]=Md(C,B)}function Pm(C,B,O,U,q){U[q+0]=Md(C,B),U[q+1]=of(C,B,O),U[q+2]=af(C,O)}function Im(C,B,O,U,q){var G=of(C,B,O);B=G<<3&224|Md(C,B)>>3,U[q+0]=248&af(C,O)|G>>5,U[q+1]=B}function ks(C,B,O,U,q){var G=240&Md(C,B)|15;U[q+0]=240&af(C,O)|of(C,B,O)>>4,U[q+1]=G}function cf(C,B,O,U,q){U[q+0]=255,lf(C,B,O,U,q+1)}function uf(C,B,O,U,q){Pm(C,B,O,U,q),U[q+3]=255}function Rv(C,B,O,U,q){lf(C,B,O,U,q),U[q+3]=255}function Ec(C,B,O){j[C]=function(U,q,G,J,ee,ne,oe,me,Ce){for(var le=me+(-2&Ce)*O;me!=le;)B(U[q+0],G[J+0],ee[ne+0],oe,me),B(U[q+1],G[J+0],ee[ne+0],oe,me+O),q+=2,++J,++ne,me+=2*O;1&Ce&&B(U[q+0],G[J+0],ee[ne+0],oe,me)}}function Ys(C,B,O){return O==0?C==0?B==0?6:5:B==0?4:0:O}function aC(C,B,O,U,q){switch(C>>>30){case 3:Su(B,O,U,q,0);break;case 2:Dd(B,O,U,q);break;case 1:Bs(B,O,U,q)}}function Om(C,B){var O,U,q=B.M,G=B.Nb,J=C.oc,ee=C.pc+40,ne=C.oc,oe=C.pc+584,me=C.oc,Ce=C.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[Ce+32*O-1]=129;for(0<q?J[ee-1-32]=ne[oe-1-32]=me[Ce-1-32]=129:(i(J,ee-32-1,127,21),i(ne,oe-32-1,127,9),i(me,Ce-32-1,127,9)),U=0;U<C.za;++U){var le=B.ya[B.aa+U];if(0<U){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,Ce+32*O-4,me,Ce+32*O+4,4)}var ge=C.Gd,we=C.Hd+U,je=le.ad,be=le.Hc;if(0<q&&(r(J,ee-32,ge[we].y,0,16),r(ne,oe-32,ge[we].f,0,8),r(me,Ce-32,ge[we].ea,0,8)),le.Za){var Ie=J,Oe=ee-32+16;for(0<q&&(U>=C.za-1?i(Ie,Oe,ge[we].y[15],4):r(Ie,Oe,ge[we+1].y,0,4)),O=0;4>O;O++)Ie[Oe+128+O]=Ie[Oe+256+O]=Ie[Oe+384+O]=Ie[Oe+0+O];for(O=0;16>O;++O,be<<=2)Ie=J,Oe=ee+T$[O],El[le.Ob[O]](Ie,Oe),aC(be,je,16*+O,Ie,Oe)}else if(Ie=Ys(U,q,le.Ob[0]),Qd[Ie](J,ee),be!=0)for(O=0;16>O;++O,be<<=2)aC(be,je,16*+O,J,ee+T$[O]);for(O=le.Gc,Ie=Ys(U,q,le.Dd),Bu[Ie](ne,oe),Bu[Ie](me,Ce),be=je,Ie=ne,Oe=oe,255&(le=0|O)&&(170&le?Um(be,256,Ie,Oe):jc(be,256,Ie,Oe)),le=me,be=Ce,255&(O>>=8)&&(170&O?Um(je,320,le,be):jc(je,320,le,be)),q<C.Ub-1&&(r(ge[we].y,0,J,ee+480,16),r(ge[we].f,0,ne,oe+224,8),r(ge[we].ea,0,me,Ce+224,8)),O=8*G*C.B,ge=C.sa,we=C.ta+16*U+16*G*C.R,je=C.qa,le=C.ra+8*U+O,be=C.Ha,Ie=C.Ia+8*U+O,O=0;16>O;++O)r(ge,we+O*C.R,J,ee+32*O,16);for(O=0;8>O;++O)r(je,le+O*C.B,ne,oe+32*O,8),r(be,Ie+O*C.B,me,Ce+32*O,8)}}function oC(C,B,O,U,q,G,J,ee,ne){var oe=[0],me=[0],Ce=0,le=ne!=null?ne.kd:0,ge=ne??new ve;if(C==null||12>O)return 7;ge.data=C,ge.w=B,ge.ha=O,B=[B],O=[O],ge.gb=[ge.gb];e:{var we=B,je=O,be=ge.gb;if(t(C!=null),t(je!=null),t(be!=null),be[0]=0,12<=je[0]&&!n(C,we[0],"RIFF")){if(n(C,we[0]+8,"WEBP")){be=3;break e}var Ie=Fe(C,we[0]+4);if(12>Ie||4294967286<Ie){be=3;break e}if(le&&Ie>je[0]-8){be=7;break e}be[0]=Ie,we[0]+=12,je[0]-=12}be=0}if(be!=0)return be;for(Ie=0<ge.gb[0],O=O[0];;){e:{var Oe=C;je=B,be=O;var He=oe,Re=me,Et=we=[0];if((wt=Ce=[Ce])[0]=0,8>be[0])be=7;else{if(!n(Oe,je[0],"VP8X")){if(Fe(Oe,je[0]+4)!=10){be=3;break e}if(18>be[0]){be=7;break e}var ut=Fe(Oe,je[0]+8),nn=1+Se(Oe,je[0]+12);if(2147483648<=nn*(Oe=1+Se(Oe,je[0]+15))){be=3;break e}Et!=null&&(Et[0]=ut),He!=null&&(He[0]=nn),Re!=null&&(Re[0]=Oe),je[0]+=18,be[0]-=18,wt[0]=1}be=0}}if(Ce=Ce[0],we=we[0],be!=0)return be;if(je=!!(2&we),!Ie&&Ce)return 3;if(G!=null&&(G[0]=!!(16&we)),J!=null&&(J[0]=je),ee!=null&&(ee[0]=0),J=oe[0],we=me[0],Ce&&je&&ne==null){be=0;break}if(4>O){be=7;break}if(Ie&&Ce||!Ie&&!Ce&&!n(C,B[0],"ALPH")){O=[O],ge.na=[ge.na],ge.P=[ge.P],ge.Sa=[ge.Sa];e:{ut=C,be=B,Ie=O;var wt=ge.gb;He=ge.na,Re=ge.P,Et=ge.Sa,nn=22,t(ut!=null),t(Ie!=null),Oe=be[0];var mn=Ie[0];for(t(He!=null),t(Et!=null),He[0]=null,Re[0]=null,Et[0]=0;;){if(be[0]=Oe,Ie[0]=mn,8>mn){be=7;break e}var _i=Fe(ut,Oe+4);if(4294967286<_i){be=3;break e}var rn=8+_i+1&-2;if(nn+=rn,0<wt&&nn>wt){be=3;break e}if(!n(ut,Oe,"VP8 ")||!n(ut,Oe,"VP8L")){be=0;break e}if(mn[0]<rn){be=7;break e}n(ut,Oe,"ALPH")||(He[0]=ut,Re[0]=Oe+8,Et[0]=_i),Oe+=rn,mn-=rn}}if(O=O[0],ge.na=ge.na[0],ge.P=ge.P[0],ge.Sa=ge.Sa[0],be!=0)break}O=[O],ge.Ja=[ge.Ja],ge.xa=[ge.xa];e:if(wt=C,be=B,Ie=O,He=ge.gb[0],Re=ge.Ja,Et=ge.xa,ut=be[0],Oe=!n(wt,ut,"VP8 "),nn=!n(wt,ut,"VP8L"),t(wt!=null),t(Ie!=null),t(Re!=null),t(Et!=null),8>Ie[0])be=7;else{if(Oe||nn){if(wt=Fe(wt,ut+4),12<=He&&wt>He-12){be=3;break e}if(le&&wt>Ie[0]-8){be=7;break e}Re[0]=wt,be[0]+=8,Ie[0]-=8,Et[0]=nn}else Et[0]=5<=Ie[0]&&wt[ut+0]==47&&!(wt[ut+4]>>5),Re[0]=Ie[0];be=0}if(O=O[0],ge.Ja=ge.Ja[0],ge.xa=ge.xa[0],B=B[0],be!=0)break;if(4294967286<ge.Ja)return 3;if(ee==null||je||(ee[0]=ge.xa?2:1),J=[J],we=[we],ge.xa){if(5>O){be=7;break}ee=J,le=we,je=G,C==null||5>O?C=0:5<=O&&C[B+0]==47&&!(C[B+4]>>5)?(Ie=[0],wt=[0],He=[0],V(Re=new M,C,B,O),ts(Re,Ie,wt,He)?(ee!=null&&(ee[0]=Ie[0]),le!=null&&(le[0]=wt[0]),je!=null&&(je[0]=He[0]),C=1):C=0):C=0}else{if(10>O){be=7;break}ee=we,C==null||10>O||!X2(C,B+3,O-3)?C=0:(le=C[B+0]|C[B+1]<<8|C[B+2]<<16,je=16383&(C[B+7]<<8|C[B+6]),C=16383&(C[B+9]<<8|C[B+8]),1&le||3<(le>>1&7)||!(le>>4&1)||le>>5>=ge.Ja||!je||!C?C=0:(J&&(J[0]=je),ee&&(ee[0]=C),C=1))}if(!C||(J=J[0],we=we[0],Ce&&(oe[0]!=J||me[0]!=we)))return 3;ne!=null&&(ne[0]=ge,ne.offset=B-ne.w,t(4294967286>B-ne.w),t(ne.offset==ne.ha-O));break}return be==0||be==7&&Ce&&ne==null?(G!=null&&(G[0]|=ge.na!=null&&0<ge.na.length),U!=null&&(U[0]=J),q!=null&&(q[0]=we),0):be}function Oo(C,B,O){var U=B.width,q=B.height,G=0,J=0,ee=U,ne=q;if(B.Da=C!=null&&0<C.Da,B.Da&&(ee=C.cd,ne=C.bd,G=C.v,J=C.j,11>O||(G&=-2,J&=-2),0>G||0>J||0>=ee||0>=ne||G+ee>U||J+ne>q))return 0;if(B.v=G,B.j=J,B.va=G+ee,B.o=J+ne,B.U=ee,B.T=ne,B.da=C!=null&&0<C.da,B.da){if(!et(ee,ne,O=[C.ib],G=[C.hb]))return 0;B.ib=O[0],B.hb=G[0]}return B.ob=C!=null&&C.ob,B.Kb=C==null||!C.Sd,B.da&&(B.ob=B.ib<3*U/4&&B.hb<3*q/4,B.Kb=0),1}function df(C){if(C==null)return 2;if(11>C.S){var B=C.f.RGBA;B.fb+=(C.height-1)*B.A,B.A=-B.A}else B=C.f.kb,C=C.height,B.O+=(C-1)*B.fa,B.fa=-B.fa,B.N+=(C-1>>1)*B.Ab,B.Ab=-B.Ab,B.W+=(C-1>>1)*B.Db,B.Db=-B.Db,B.F!=null&&(B.J+=(C-1)*B.lb,B.lb=-B.lb);return 0}function Uv(C,B,O,U){if(U==null||0>=C||0>=B)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>C||ee+G>B)return 2;C=q,B=G}if(O.da){if(!et(C,B,q=[O.ib],G=[O.hb]))return 2;C=q[0],B=G[0]}}U.width=C,U.height=B;e:{var ne=U.width,oe=U.height;if(C=U.S,0>=ne||0>=oe||!(C>=uC&&13>C))C=2;else{if(0>=U.Rd&&U.sd==null){J=G=q=B=0;var me=(ee=ne*P$[C])*oe;if(11>C||(G=(oe+1)/2*(B=(ne+1)/2),C==12&&(J=(q=ne)*oe)),(oe=s(me+2*G+J))==null){C=1;break e}U.sd=oe,11>C?((ne=U.f.RGBA).eb=oe,ne.fb=0,ne.A=ee,ne.size=me):((ne=U.f.kb).y=oe,ne.O=0,ne.fa=ee,ne.Fd=me,ne.f=oe,ne.N=0+me,ne.Ab=B,ne.Cd=G,ne.ea=oe,ne.W=0+me+G,ne.Db=B,ne.Ed=G,C==12&&(ne.F=oe,ne.J=0+me+2*G),ne.Tc=J,ne.lb=q)}if(B=1,q=U.S,G=U.width,J=U.height,q>=uC&&13>q)if(11>q)C=U.f.RGBA,B&=(ee=Math.abs(C.A))*(J-1)+G<=C.size,B&=ee>=G*P$[q],B&=C.eb!=null;else{C=U.f.kb,ee=(G+1)/2,me=(J+1)/2,ne=Math.abs(C.fa),oe=Math.abs(C.Ab);var Ce=Math.abs(C.Db),le=Math.abs(C.lb),ge=le*(J-1)+G;B&=ne*(J-1)+G<=C.Fd,B&=oe*(me-1)+ee<=C.Cd,B=(B&=Ce*(me-1)+ee<=C.Ed)&ne>=G&oe>=ee&Ce>=ee,B&=C.y!=null,B&=C.f!=null,B&=C.ea!=null,q==12&&(B&=le>=G,B&=ge<=C.Tc,B&=C.F!=null)}else B=0;C=B?0:2}}return C!=0||O!=null&&O.fd&&(C=df(U)),C}var Fm=64,hf=[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],Dv=24,Xs=32,Sa=8,Mm=[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];xe("Predictor0","PredictorAdd0"),j.Predictor0=function(){return 4278190080},j.Predictor1=function(C){return C},j.Predictor2=function(C,B,O){return B[O+0]},j.Predictor3=function(C,B,O){return B[O+1]},j.Predictor4=function(C,B,O){return B[O-1]},j.Predictor5=function(C,B,O){return ze(ze(C,B[O+1]),B[O+0])},j.Predictor6=function(C,B,O){return ze(C,B[O-1])},j.Predictor7=function(C,B,O){return ze(C,B[O+0])},j.Predictor8=function(C,B,O){return ze(B[O-1],B[O+0])},j.Predictor9=function(C,B,O){return ze(B[O+0],B[O+1])},j.Predictor10=function(C,B,O){return ze(ze(C,B[O-1]),ze(B[O+0],B[O+1]))},j.Predictor11=function(C,B,O){var U=B[O+0];return 0>=ye(U>>24&255,C>>24&255,(B=B[O-1])>>24&255)+ye(U>>16&255,C>>16&255,B>>16&255)+ye(U>>8&255,C>>8&255,B>>8&255)+ye(255&U,255&C,255&B)?U:C},j.Predictor12=function(C,B,O){var U=B[O+0];return(Dt((C>>24&255)+(U>>24&255)-((B=B[O-1])>>24&255))<<24|Dt((C>>16&255)+(U>>16&255)-(B>>16&255))<<16|Dt((C>>8&255)+(U>>8&255)-(B>>8&255))<<8|Dt((255&C)+(255&U)-(255&B)))>>>0},j.Predictor13=function(C,B,O){var U=B[O-1];return(dt((C=ze(C,B[O+0]))>>24&255,U>>24&255)<<24|dt(C>>16&255,U>>16&255)<<16|dt(C>>8&255,U>>8&255)<<8|dt(255&C,255&U))>>>0};var Ld=j.PredictorAdd0;j.PredictorAdd1=Ee,xe("Predictor2","PredictorAdd2"),xe("Predictor3","PredictorAdd3"),xe("Predictor4","PredictorAdd4"),xe("Predictor5","PredictorAdd5"),xe("Predictor6","PredictorAdd6"),xe("Predictor7","PredictorAdd7"),xe("Predictor8","PredictorAdd8"),xe("Predictor9","PredictorAdd9"),xe("Predictor10","PredictorAdd10"),xe("Predictor11","PredictorAdd11"),xe("Predictor12","PredictorAdd12"),xe("Predictor13","PredictorAdd13");var Rd=j.PredictorAdd2;pe("ColorIndexInverseTransform","MapARGB","32b",function(C){return C>>8&255},function(C){return C}),pe("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(C){return C},function(C){return C>>8&255});var Lm,Af=j.ColorIndexInverseTransform,mi=j.MapARGB,BT=j.VP8LColorIndexInverseTransformAlpha,Nc=j.MapAlpha,_l=j.VP8LPredictorsAdd=[];_l.length=16,(j.VP8LPredictors=[]).length=16,(j.VP8LPredictorsAdd_C=[]).length=16,(j.VP8LPredictors_C=[]).length=16;var ff,Qv,Hv,Rm,pf,mf,Ud,Su,Dd,Um,Bs,jc,tr,nr,Zr,Bi,ku,$v,Dm,lC,l$,c$,u$,d$,zv,h$,A$,f$,p$=s(511),m$=s(2041),g$=s(225),y$=s(767),v$=0,_T=m$,cC=g$,Za=y$,Fo=p$,uC=0,dC=1,x$=2,hC=3,AC=4,ET=5,w$=6,NT=7,jT=8,fC=9,TT=10,K0e=[2,3,7],q0e=[3,3,11],b$=[280,256,256,256,40],W0e=[0,1,1,1,0],G0e=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Y0e=[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],X0e=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],J0e=8,PT=[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],IT=[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],Vv=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]],eve=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],C$=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],tve=[[[[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]]]],nve=[[[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]]],rve=[[[[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]]]],ive=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Qd=[],El=[],Bu=[],sve=1,S$=2,Hd=[],Mo=[];Ss("UpsampleRgbLinePair",lf,3),Ss("UpsampleBgrLinePair",Pm,3),Ss("UpsampleRgbaLinePair",Rv,4),Ss("UpsampleBgraLinePair",uf,4),Ss("UpsampleArgbLinePair",cf,4),Ss("UpsampleRgba4444LinePair",ks,2),Ss("UpsampleRgb565LinePair",Im,2);var ave=j.UpsampleRgbLinePair,ove=j.UpsampleBgrLinePair,k$=j.UpsampleRgbaLinePair,B$=j.UpsampleBgraLinePair,_$=j.UpsampleArgbLinePair,E$=j.UpsampleRgba4444LinePair,lve=j.UpsampleRgb565LinePair,pC=16,mC=1<<pC-1,Kv=-227,OT=482,N$=6,cve=(256<<N$)-1,j$=0,uve=s(256),dve=s(256),hve=s(256),Ave=s(256),fve=s(OT-Kv),pve=s(OT-Kv);Ec("YuvToRgbRow",lf,3),Ec("YuvToBgrRow",Pm,3),Ec("YuvToRgbaRow",Rv,4),Ec("YuvToBgraRow",uf,4),Ec("YuvToArgbRow",cf,4),Ec("YuvToRgba4444Row",ks,2),Ec("YuvToRgb565Row",Im,2);var T$=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],gC=[0,2,8],mve=[8,7,6,4,4,2,2,2,1,1,1,1],gve=1;this.WebPDecodeRGBA=function(C,B,O,U,q){var G=dC,J=new Ae,ee=new en;J.ba=ee,ee.S=G,ee.width=[ee.width],ee.height=[ee.height];var ne=ee.width,oe=ee.height,me=new kt;if(me==null||C==null)var Ce=2;else t(me!=null),Ce=oC(C,B,O,me.width,me.height,me.Pd,me.Qd,me.format,null);if(Ce!=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],U!=null&&(U[0]=ee.width),q!=null&&(q[0]=ee.height);e:{if(U=new Cm,(q=new ve).data=C,q.w=B,q.ha=O,q.kd=1,B=[0],t(q!=null),((C=oC(q.data,q.w,q.ha,null,null,null,B,null,q))==0||C==7)&&B[0]&&(C=4),(B=C)==0){if(t(J!=null),U.data=q.data,U.w=q.w+q.offset,U.ha=q.ha-q.offset,U.put=yt,U.ac=Dr,U.bc=Hi,U.ma=J,q.xa){if((C=ef())==null){J=1;break e}if(function(le,ge){var we=[0],je=[0],be=[0];t:for(;;){if(le==null)return 0;if(ge==null)return le.a=2,0;if(le.l=ge,le.a=0,V(le.m,ge.data,ge.w,ge.ha),!ts(le.m,we,je,be)){le.a=3;break t}if(le.xb=S$,ge.width=we[0],ge.height=je[0],!Cc(we[0],je[0],1,le,null))break t;return 1}return t(le.a!=0),0}(C,U)){if(U=(B=Uv(U.width,U.height,J.Oa,J.ba))==0){t:{U=C;n:for(;;){if(U==null){U=0;break t}if(t(U.s.yc!=null),t(U.s.Ya!=null),t(0<U.s.Wb),t((O=U.l)!=null),t((q=O.ma)!=null),U.xb!=0){if(U.ca=q.ba,U.tb=q.tb,t(U.ca!=null),!Oo(q.Oa,O,hC)){U.a=2;break n}if(!tf(U,O.width)||O.da)break n;if((O.da||Pt(U.ca.S))&&Tr(),11>U.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),U.ca.f.kb.F!=null&&Tr()),U.Pb&&0<U.s.ua&&U.s.vb.X==null&&!te(U.s.vb,U.s.Wa.Xa)){U.a=1;break n}U.xb=0}if(!Bl(U,U.V,U.Ba,U.c,U.i,O.o,Pd))break n;q.Dc=U.Ma,U=1;break t}t(U.a!=0),U=0}U=!U}U&&(B=C.a)}else B=C.a}else{if((C=new cT)==null){J=1;break e}if(C.Fa=q.na,C.P=q.P,C.qc=q.Sa,kc(C,U)){if((B=Uv(U.width,U.height,J.Oa,J.ba))==0){if(C.Aa=0,O=J.Oa,t((q=C)!=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>(Ce=q.pb[oe]).lc&&(Ce.ia=ne*mve[0>Ce.lc?0:Ce.lc]>>3),me|=Ce.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 fi(le,2,"NULL VP8Io parameter in VP8Decode().");if(!le.cb&&!kc(le,ge))return 0;if(t(le.cb),ge.ac==null||ge.ac(ge)){ge.ob&&(le.L=0);var we=gC[le.L];if(le.L==2?(le.yb=0,le.zb=0):(le.yb=ge.v-we>>4,le.zb=ge.j-we>>4,0>le.yb&&(le.yb=0),0>le.zb&&(le.zb=0)),le.Va=ge.o+15+we>>4,le.Hb=ge.va+15+we>>4,le.Hb>le.za&&(le.Hb=le.za),le.Va>le.Ub&&(le.Va=le.Ub),0<le.L){var je=le.ed;for(we=0;4>we;++we){var be;if(le.Qa.Cb){var Ie=le.Qa.Lb[we];le.Qa.Fb||(Ie+=je.Tb)}else Ie=je.Tb;for(be=0;1>=be;++be){var Oe=le.gd[we][be],He=Ie;if(je.Pc&&(He+=je.vd[0],be&&(He+=je.od[0])),0<(He=0>He?0:63<He?63:He)){var Re=He;0<je.wb&&(Re=4<je.wb?Re>>2:Re>>1)>9-je.wb&&(Re=9-je.wb),1>Re&&(Re=1),Oe.dd=Re,Oe.tc=2*He+Re,Oe.ld=40<=He?2:15<=He?1:0}else Oe.tc=0;Oe.La=be}}}we=0}else fi(le,6,"Frame setup failed"),we=le.a;if(we=we==0){if(we){le.$c=0,0<le.Aa||(le.Ic=gve);t:{we=le.Ic,je=4*(Re=le.za);var Et=32*Re,ut=Re+1,nn=0<le.L?Re*(0<le.Aa?2:1):0,wt=(le.Aa==2?2:1)*Re;if((Oe=je+832+(be=3*(16*we+gC[le.L])/2*Et)+(Ie=le.Fa!=null&&0<le.Fa.length?le.Kc.c*le.Kc.i:0))!=Oe)we=0;else{if(Oe>le.Vb){if(le.Vb=0,le.Ec=s(Oe),le.Fc=0,le.Ec==null){we=fi(le,1,"no memory during frame initialization.");break t}le.Vb=Oe}Oe=le.Ec,He=le.Fc,le.Ac=Oe,le.Bc=He,He+=je,le.Gd=a(Et,G2),le.Hd=0,le.rb=a(ut+1,Ev),le.sb=1,le.wa=nn?a(nn,Io):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=Oe,le.pc=He,He+=832,le.ya=a(wt,Nv),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=(Et=gC[le.L])*le.R,Et=Et/2*le.B,le.sa=Oe,le.ta=He+Re,le.qa=le.sa,le.ra=le.ta+16*we*le.R+Et,le.Ha=le.qa,le.Ia=le.ra+8*we*le.B+Et,le.$c=0,He+=be,le.mb=Ie?Oe:null,le.nb=Ie?He:null,t(He+Ie<=le.Fc+le.Vb),jv(le),i(le.Ac,le.Bc,0,je),we=1}}if(we){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,!v$){for(we=-255;255>=we;++we)p$[255+we]=0>we?-we:we;for(we=-1020;1020>=we;++we)m$[1020+we]=-128>we?-128:127<we?127:we;for(we=-112;112>=we;++we)g$[112+we]=-16>we?-16:15<we?15:we;for(we=-255;510>=we;++we)y$[255+we]=0>we?0:255<we?255:we;v$=1}Ud=Z2,Su=uT,Um=dT,Bs=hT,jc=Bc,Dd=J2,tr=nC,nr=rC,Zr=sC,Bi=P,ku=iC,$v=sf,Dm=z,lC=ae,l$=jm,c$=Mv,u$=Tm,d$=tC,El[0]=vT,El[1]=_m,El[2]=gT,El[3]=yT,El[4]=xT,El[5]=vu,El[6]=wT,El[7]=xu,El[8]=CT,El[9]=bT,Qd[0]=eC,Qd[1]=AT,Qd[2]=fT,Qd[3]=pT,Qd[4]=Od,Qd[5]=mT,Qd[6]=nf,Bu[0]=ST,Bu[1]=Tv,Bu[2]=Em,Bu[3]=Pv,Bu[4]=kT,Bu[5]=Nm,Bu[6]=Iv,we=1}else we=0}we&&(we=function(mn,_i){for(mn.M=0;mn.M<mn.Va;++mn.M){var rn,bt=mn.Jc[mn.M&mn.Xb],Ye=mn.m,ei=mn;for(rn=0;rn<ei.za;++rn){var Zt=Ye,Cn=ei,Ar=Cn.Ac,is=Cn.Bc+4*rn,Js=Cn.zc,Hr=Cn.ya[Cn.aa+rn];if(Cn.Qa.Bb?Hr.$b=ie(Zt,Cn.Pa.jb[0])?2+ie(Zt,Cn.Pa.jb[2]):ie(Zt,Cn.Pa.jb[1]):Hr.$b=0,Cn.kc&&(Hr.Ad=ie(Zt,Cn.Bd)),Hr.Za=!ie(Zt,145)+0,Hr.Za){var _s=Hr.Ob,Zs=0;for(Cn=0;4>Cn;++Cn){var Ei,Nn=Js[0+Cn];for(Ei=0;4>Ei;++Ei){Nn=nve[Ar[is+Ei]][Nn];for(var Rn=C$[ie(Zt,Nn[0])];0<Rn;)Rn=C$[2*Rn+ie(Zt,Nn[Rn])];Nn=-Rn,Ar[is+Ei]=Nn}r(_s,Zs,Ar,is,4),Zs+=4,Js[0+Cn]=Nn}}else Nn=ie(Zt,156)?ie(Zt,128)?1:3:ie(Zt,163)?2:0,Hr.Ob[0]=Nn,i(Ar,is,Nn,4),i(Js,0,Nn,4);Hr.Dd=ie(Zt,142)?ie(Zt,114)?ie(Zt,183)?1:3:2:0}if(ei.m.Ka)return fi(mn,7,"Premature end-of-partition0 encountered.");for(;mn.ja<mn.za;++mn.ja){if(ei=bt,Zt=(Ye=mn).rb[Ye.sb-1],Ar=Ye.rb[Ye.sb+Ye.ja],rn=Ye.ya[Ye.aa+Ye.ja],is=Ye.kc?rn.Ad:0)Zt.la=Ar.la=0,rn.Za||(Zt.Na=Ar.Na=0),rn.Hc=0,rn.Gc=0,rn.ia=0;else{var $r,Un;if(Zt=Ar,Ar=ei,is=Ye.Pa.Xc,Js=Ye.ya[Ye.aa+Ye.ja],Hr=Ye.pb[Js.$b],Cn=Js.ad,_s=0,Zs=Ye.rb[Ye.sb-1],Nn=Ei=0,i(Cn,_s,0,384),Js.Za)var ss=0,Nl=is[3];else{Rn=s(16);var ti=Zt.Na+Zs.Na;if(ti=Vv(Ar,is[1],ti,Hr.Eb,0,Rn,0),Zt.Na=Zs.Na=(0<ti)+0,1<ti)Ud(Rn,0,Cn,_s);else{var ka=Rn[0]+3>>3;for(Rn=0;256>Rn;Rn+=16)Cn[_s+Rn]=ka}ss=1,Nl=is[0]}var Gn=15&Zt.la,Ni=15&Zs.la;for(Rn=0;4>Rn;++Rn){var eo=1&Ni;for(ka=Un=0;4>ka;++ka)Gn=Gn>>1|(eo=(ti=Vv(Ar,Nl,ti=eo+(1&Gn),Hr.Sc,ss,Cn,_s))>ss)<<7,Un=Un<<2|(3<ti?3:1<ti?2:Cn[_s+0]!=0),_s+=16;Gn>>=4,Ni=Ni>>1|eo<<7,Ei=(Ei<<8|Un)>>>0}for(Nl=Gn,ss=Ni>>4,$r=0;4>$r;$r+=2){for(Un=0,Gn=Zt.la>>4+$r,Ni=Zs.la>>4+$r,Rn=0;2>Rn;++Rn){for(eo=1&Ni,ka=0;2>ka;++ka)ti=eo+(1&Gn),Gn=Gn>>1|(eo=0<(ti=Vv(Ar,is[2],ti,Hr.Qc,0,Cn,_s)))<<3,Un=Un<<2|(3<ti?3:1<ti?2:Cn[_s+0]!=0),_s+=16;Gn>>=2,Ni=Ni>>1|eo<<5}Nn|=Un<<4*$r,Nl|=Gn<<4<<$r,ss|=(240&Ni)<<$r}Zt.la=Nl,Zs.la=ss,Js.Hc=Ei,Js.Gc=Nn,Js.ia=43690&Nn?0:Hr.ia,is=!(Ei|Nn)}if(0<Ye.L&&(Ye.wa[Ye.Y+Ye.ja]=Ye.gd[rn.$b][rn.Za],Ye.wa[Ye.Y+Ye.ja].La|=!is),ei.Ka)return fi(mn,7,"Premature end-of-file encountered.")}if(jv(mn),Ye=_i,ei=1,rn=(bt=mn).D,Zt=0<bt.L&&bt.M>=bt.zb&&bt.M<=bt.Va,bt.Aa==0)t:{if(rn.M=bt.M,rn.uc=Zt,Om(bt,rn),ei=1,rn=(Un=bt.D).Nb,Zt=(Nn=gC[bt.L])*bt.R,Ar=Nn/2*bt.B,Rn=16*rn*bt.R,ka=8*rn*bt.B,is=bt.sa,Js=bt.ta-Zt+Rn,Hr=bt.qa,Cn=bt.ra-Ar+ka,_s=bt.Ha,Zs=bt.Ia-Ar+ka,Ni=(Gn=Un.M)==0,Ei=Gn>=bt.Va-1,bt.Aa==2&&Om(bt,Un),Un.uc)for(eo=(ti=bt).D.M,t(ti.D.uc),Un=ti.yb;Un<ti.Hb;++Un){ss=Un,Nl=eo;var ea=(to=(as=ti).D).Nb;$r=as.R;var to=to.wa[to.Y+ss],no=as.sa,Ba=as.ta+16*ea*$r+16*ss,ro=to.dd,rr=to.tc;if(rr!=0)if(t(3<=rr),as.L==1)0<ss&&c$(no,Ba,$r,rr+4),to.La&&d$(no,Ba,$r,rr),0<Nl&&l$(no,Ba,$r,rr+4),to.La&&u$(no,Ba,$r,rr);else{var io=as.B,jl=as.qa,gf=as.ra+8*ea*io+8*ss,_u=as.Ha,as=as.Ia+8*ea*io+8*ss;ea=to.ld,0<ss&&(nr(no,Ba,$r,rr+4,ro,ea),Bi(jl,gf,_u,as,io,rr+4,ro,ea)),to.La&&($v(no,Ba,$r,rr,ro,ea),lC(jl,gf,_u,as,io,rr,ro,ea)),0<Nl&&(tr(no,Ba,$r,rr+4,ro,ea),Zr(jl,gf,_u,as,io,rr+4,ro,ea)),to.La&&(ku(no,Ba,$r,rr,ro,ea),Dm(jl,gf,_u,as,io,rr,ro,ea))}}if(bt.ia&&alert("todo:DitherRow"),Ye.put!=null){if(Un=16*Gn,Gn=16*(Gn+1),Ni?(Ye.y=bt.sa,Ye.O=bt.ta+Rn,Ye.f=bt.qa,Ye.N=bt.ra+ka,Ye.ea=bt.Ha,Ye.W=bt.Ia+ka):(Un-=Nn,Ye.y=is,Ye.O=Js,Ye.f=Hr,Ye.N=Cn,Ye.ea=_s,Ye.W=Zs),Ei||(Gn-=Nn),Gn>Ye.o&&(Gn=Ye.o),Ye.F=null,Ye.J=null,bt.Fa!=null&&0<bt.Fa.length&&Un<Gn&&(Ye.J=pi(bt,Ye,Un,Gn-Un),Ye.F=bt.mb,Ye.F==null&&Ye.F.length==0)){ei=fi(bt,3,"Could not decode alpha data.");break t}Un<Ye.j&&(Nn=Ye.j-Un,Un=Ye.j,t(!(1&Nn)),Ye.O+=bt.R*Nn,Ye.N+=bt.B*(Nn>>1),Ye.W+=bt.B*(Nn>>1),Ye.F!=null&&(Ye.J+=Ye.width*Nn)),Un<Gn&&(Ye.O+=Ye.v,Ye.N+=Ye.v>>1,Ye.W+=Ye.v>>1,Ye.F!=null&&(Ye.J+=Ye.v),Ye.ka=Un-Ye.j,Ye.U=Ye.va-Ye.v,Ye.T=Gn-Un,ei=Ye.put(Ye))}rn+1!=bt.Ic||Ei||(r(bt.sa,bt.ta-Zt,is,Js+16*bt.R,Zt),r(bt.qa,bt.ra-Ar,Hr,Cn+8*bt.B,Ar),r(bt.Ha,bt.Ia-Ar,_s,Zs+8*bt.B,Ar))}if(!ei)return fi(mn,6,"Output aborted.")}return 1}(le,ge)),ge.bc!=null&&ge.bc(ge),we&=1}return we?(le.cb=0,we):0})(C,U)||(B=C.a)}}else B=C.a}B==0&&J.Oa!=null&&J.Oa.fd&&(B=df(J.ba))}J=B}G=J!=0?null:11>G?ee.f.RGBA.eb:ee.f.kb.y}else G=null;return G};var P$=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function u(j,I){for(var T="",N=0;N<4;N++)T+=String.fromCharCode(j[I++]);return T}function d(j,I){return j[I+0]|j[I+1]<<8}function h(j,I){return(j[I+0]|j[I+1]<<8|j[I+2]<<16)>>>0}function f(j,I){return(j[I+0]|j[I+1]<<8|j[I+2]<<16|j[I+3]<<24)>>>0}new l;var A=[0],p=[0],m=[],g=new l,y=e,v=function(j,I){var T={},N=0,F=!1,L=0,D=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}(j,I)){for(f(j,I+=4),I+=8;I<j.length;){var H=u(j,I),W=f(j,I+=4);I+=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?D:I-8,ce.src_size=L+W+8,N++,F&&(F=!1,L=0,D=0);break;case"VP8X":(ce=T.header={}).feature_flags=j[I];var V=I+4;ce.canvas_width=1+h(j,V),V+=3,ce.canvas_height=1+h(j,V),V+=3;break;case"ALPH":F=!0,L=$+8,D=I-8;break;case"ANIM":(ce=T.header).bgcolor=f(j,I),V=I+4,ce.loop_count=d(j,V),V+=2;break;case"ANMF":var Q,ce;(ce=T.frames[N]={}).offset_x=2*h(j,I),I+=3,ce.offset_y=2*h(j,I),I+=3,ce.width=1+h(j,I),I+=3,ce.height=1+h(j,I),I+=3,ce.duration=h(j,I),I+=3,Q=j[I++],ce.dispose=1&Q,ce.blend=Q>>1&1}H!="ANMF"&&(I+=$)}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,A=[x.canvas_height],p=[x.canvas_width];for(var w=0;w<b.length&&b[w].blend!=0;w++);}var S=b[0],_=g.WebPDecodeRGBA(y,S.src_off,S.src_size,p,A);S.rgba=_,S.imgwidth=p[0],S.imgheight=A[0];for(var E=0;E<p[0]*A[0]*4;E++)m[E]=_[E];return this.width=p,this.height=A,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 ySt(){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 vSt(){this.internal.__metadata__.metadataObjectNumber&&this.internal.write("/Metadata "+this.internal.__metadata__.metadataObjectNumber+" 0 R")}(function(e){var t,n,r,i,s,a,o,l,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 l,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,l=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 K=0;Object.defineProperty(this,"posX",{get:function(){return K},set:function(te){isNaN(te)||(K=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 _e;typeof te=="number"?_e=[te,te,te,te]:((_e=new Array(4))[0]=te[0],_e[1]=te.length>=2?te[1]:_e[0],_e[2]=te.length>=3?te[2]:_e[0],_e[3]=te.length>=4?te[3]:_e[1]),u.margin=_e}});var de=!1;Object.defineProperty(this,"autoPaging",{get:function(){return de},set:function(te){de=te}});var se=0;Object.defineProperty(this,"lastBreak",{get:function(){return se},set:function(te){se=te}});var ie=[];Object.defineProperty(this,"pageBreaks",{get:function(){return ie},set:function(te){ie=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 _e;_e=f(te),this.ctx.fillStyle=_e.style,this.ctx.isFillTransparent=_e.a===0,this.ctx.fillOpacity=_e.a,this.pdf.setFillColor(_e.r,_e.g,_e.b,{a:_e.a}),this.pdf.setTextColor(_e.r,_e.g,_e.b,{a:_e.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(te){var _e=f(te);this.ctx.strokeStyle=_e.style,this.ctx.isStrokeTransparent=_e.a===0,this.ctx.strokeOpacity=_e.a,_e.a===0?this.pdf.setDrawColor(255,255,255):(_e.a,this.pdf.setDrawColor(_e.r,_e.g,_e.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 ue=null,Se=null,Fe=null;Object.defineProperty(this,"fontFaces",{get:function(){return Fe},set:function(te){ue=null,Se=null,Fe=te}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(te){var _e;if(this.ctx.font=te,(_e=/^\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 Ze=_e[1];_e[2];var et=_e[3],Te=_e[4];_e[5];var st=_e[6],xe=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Te)[2];Te=Math.floor(xe==="px"?parseFloat(Te)*this.pdf.internal.scaleFactor:xe==="em"?parseFloat(Te)*this.pdf.getFontSize():parseFloat(Te)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Te);var Qe=function(pe){var mt,ct,xt=[],Mt=pe.trim();if(Mt==="")return G4;if(Mt in UJ)return[UJ[Mt]];for(;Mt!=="";){switch(ct=null,mt=(Mt=QJ(Mt)).charAt(0)){case'"':case"'":ct=hSt(Mt.substring(1),mt);break;default:ct=ASt(Mt)}if(ct===null||(xt.push(ct[0]),(Mt=QJ(ct[1]))!==""&&Mt.charAt(0)!==","))return G4;Mt=Mt.replace(/^,/,"")}return xt}(st);if(this.fontFaces){var ze=function(pe,mt){var ct=pe.getFontList(),xt=JSON.stringify(ct);if(ue===null||Se!==xt){var Mt=function(zt){var ht=[];return Object.keys(zt).forEach(function(Lt){zt[Lt].forEach(function(Pt){var qt=null;switch(Pt){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:Pt},ht.push(qt))})}),ht}(ct);ue=function(zt){for(var ht={},Lt=0;Lt<zt.length;++Lt){var Pt=W4(zt[Lt]),qt=Pt.family,er=Pt.stretch,en=Pt.style,kt=Pt.weight;ht[qt]=ht[qt]||{},ht[qt][er]=ht[qt][er]||{},ht[qt][er][en]=ht[qt][er][en]||{},ht[qt][er][en][kt]=Pt}return ht}(Mt.concat(mt)),Se=xt}return ue}(this.pdf,this.fontFaces),Dt=Qe.map(function(pe){return{family:pe,stretch:"normal",weight:et,style:Ze}}),dt=function(pe,mt,ct){for(var xt=(ct=ct||{}).defaultFontFamily||"times",Mt=Object.assign({},dSt,ct.genericFontFamilies||{}),zt=null,ht=null,Lt=0;Lt<mt.length;++Lt)if(Mt[(zt=W4(mt[Lt])).family]&&(zt.family=Mt[zt.family]),pe.hasOwnProperty(zt.family)){ht=pe[zt.family];break}if(!(ht=ht||pe[xt]))throw new Error("Could not find a font-family for the rule '"+DJ(zt)+"' and default family '"+xt+"'.");if(ht=function(Pt,qt){if(qt[Pt])return qt[Pt];var er=AR[Pt],en=er<=AR.normal?-1:1,kt=RJ(qt,Mye,er,en);if(!kt)throw new Error("Could not find a matching font-stretch value for "+Pt);return kt}(zt.stretch,ht),ht=function(Pt,qt){if(qt[Pt])return qt[Pt];for(var er=Fye[Pt],en=0;en<er.length;++en)if(qt[er[en]])return qt[er[en]];throw new Error("Could not find a matching font-style for "+Pt)}(zt.style,ht),!(ht=function(Pt,qt){if(qt[Pt])return qt[Pt];if(Pt===400&&qt[500])return qt[500];if(Pt===500&&qt[400])return qt[400];var er=uSt[Pt],en=RJ(qt,Lye,er,Pt<400?-1:1);if(!en)throw new Error("Could not find a matching font-weight for value "+Pt);return en}(zt.weight,ht)))throw new Error("Failed to resolve a font for the rule '"+DJ(zt)+"'.");return ht}(ze,Dt);this.pdf.setFont(dt.ref.name,dt.ref.style)}else{var ye="";(et==="bold"||parseInt(et,10)>=700||Ze==="bold")&&(ye="bold"),Ze==="italic"&&(ye+="italic"),ye.length===0&&(ye="normal");for(var Ee="",We={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<Qe.length;Ue++){if(this.pdf.internal.getFont(Qe[Ue],ye,{noFallback:!0,disableWarning:!0})!==void 0){Ee=Qe[Ue];break}if(ye==="bolditalic"&&this.pdf.internal.getFont(Qe[Ue],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Ee=Qe[Ue],ye="bold";else if(this.pdf.internal.getFont(Qe[Ue],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Ee=Qe[Ue],ye="normal";break}}if(Ee===""){for(var Ge=0;Ge<Qe.length;Ge++)if(We[Qe[Ge]]){Ee=We[Qe[Ge]];break}}Ee=Ee===""?"Times":Ee,this.pdf.setFont(Ee,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 Yn.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"&&Qn(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 Yn.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 Yn.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var K=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:K.x,y:K.y}),this.ctx.lastPoint=new a(K.x,K.y)},h.prototype.bezierCurveTo=function(R,M,Y,X,K,Z){if(isNaN(K)||isNaN(Z)||isNaN(R)||isNaN(M)||isNaN(Y)||isNaN(X))throw Yn.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var de=this.ctx.transform.applyToPoint(new a(K,Z)),se=this.ctx.transform.applyToPoint(new a(R,M)),ie=this.ctx.transform.applyToPoint(new a(Y,X));this.path.push({type:"bct",x1:se.x,y1:se.y,x2:ie.x,y2:ie.y,x:de.x,y:de.y}),this.ctx.lastPoint=new a(de.x,de.y)},h.prototype.arc=function(R,M,Y,X,K,Z){if(isNaN(R)||isNaN(M)||isNaN(Y)||isNaN(X)||isNaN(K))throw Yn.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 se=this.ctx.transform.applyToPoint(new a(0,Y)),ie=this.ctx.transform.applyToPoint(new a(0,0));Y=Math.sqrt(Math.pow(se.x-ie.x,2)+Math.pow(se.y-ie.y,2))}Math.abs(K-X)>=2*Math.PI&&(X=0,K=2*Math.PI),this.path.push({type:"arc",x:R,y:M,radius:Y,startAngle:X,endAngle:K,counterclockwise:Z})},h.prototype.arcTo=function(R,M,Y,X,K){throw new Error("arcTo not implemented.")},h.prototype.rect=function(R,M,Y,X){if(isNaN(R)||isNaN(M)||isNaN(Y)||isNaN(X))throw Yn.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 Yn.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!A.call(this)){var K={};this.lineCap!=="butt"&&(K.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(K.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(R,M,Y,X),this.fill(),K.hasOwnProperty("lineCap")&&(this.lineCap=K.lineCap),K.hasOwnProperty("lineJoin")&&(this.lineJoin=K.lineJoin)}},h.prototype.strokeRect=function(R,M,Y,X){if(isNaN(R)||isNaN(M)||isNaN(Y)||isNaN(X))throw Yn.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 Yn.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 f=function(R){var M,Y,X,K;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,K=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]),K=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]),K=parseFloat(Z[4]);else{if(K=1,typeof R=="string"&&R.charAt(0)!=="#"){var de=new Eye(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:K,style:R}},A=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 Yn.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(X=isNaN(X)?void 0:X,!A.call(this)){var K=$(this.ctx.transform.rotation),Z=this.ctx.transform.scaleX;N.call(this,{text:R,x:M,y:Y,scale:Z,angle:K,align:this.textAlign,maxWidth:X})}},h.prototype.strokeText=function(R,M,Y,X){if(isNaN(M)||isNaN(Y)||typeof R!="string")throw Yn.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 K=$(this.ctx.transform.rotation),Z=this.ctx.transform.scaleX;N.call(this,{text:R,x:M,y:Y,scale:Z,renderingMode:"stroke",angle:K,align:this.textAlign,maxWidth:X})}},h.prototype.measureText=function(R){if(typeof R!="string")throw Yn.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(),K=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:K*=Math.round(96*Y/72*1e4)/1e4})},h.prototype.scale=function(R,M){if(isNaN(R)||isNaN(M))throw Yn.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var Y=new l(R,0,0,M,0,0);this.ctx.transform=this.ctx.transform.multiply(Y)},h.prototype.rotate=function(R){if(isNaN(R))throw Yn.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var M=new l(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 Yn.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var Y=new l(1,0,0,1,R,M);this.ctx.transform=this.ctx.transform.multiply(Y)},h.prototype.transform=function(R,M,Y,X,K,Z){if(isNaN(R)||isNaN(M)||isNaN(Y)||isNaN(X)||isNaN(K)||isNaN(Z))throw Yn.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var de=new l(R,M,Y,X,K,Z);this.ctx.transform=this.ctx.transform.multiply(de)},h.prototype.setTransform=function(R,M,Y,X,K,Z){R=isNaN(R)?1:R,M=isNaN(M)?0:M,Y=isNaN(Y)?0:Y,X=isNaN(X)?1:X,K=isNaN(K)?0:K,Z=isNaN(Z)?0:Z,this.ctx.transform=new l(R,M,Y,X,K,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,K,Z,de,se,ie){var he=this.pdf.getImageProperties(R),ue=1,Se=1,Fe=1,te=1;X!==void 0&&se!==void 0&&(Fe=se/X,te=ie/K,ue=he.width/X*se/X,Se=he.height/K*ie/K),Z===void 0&&(Z=M,de=Y,M=0,Y=0),X!==void 0&&se===void 0&&(se=X,ie=K),X===void 0&&se===void 0&&(se=he.width,ie=he.height);var _e=this.ctx.transform.decompose(),Ze=$(_e.rotate.shx),et=new l,Te=(et=(et=(et=et.multiply(_e.translate)).multiply(_e.skew)).multiply(_e.scale)).applyToRectangle(new o(Z-M*Fe,de-Y*te,X*ue,K*Se));if(this.autoPaging){for(var st,xe=g.call(this,Te),Qe=[],ze=0;ze<xe.length;ze+=1)Qe.indexOf(xe[ze])===-1&&Qe.push(xe[ze]);x(Qe);for(var Dt=Qe[0],dt=Qe[Qe.length-1],ye=Dt;ye<dt+1;ye++){this.pdf.setPage(ye);var Ee=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],We=ye===1?this.posY+this.margin[0]:this.margin[0],Ue=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ge=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],pe=ye===1?0:Ue+(ye-2)*Ge;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+We+this.ctx.prevPageLastElemOffset),w.call(this,"fill",!0),this.path=mt}var ct=JSON.parse(JSON.stringify(Te));ct=v([ct],this.posX+this.margin[3],-pe+We+this.ctx.prevPageLastElemOffset)[0];var xt=(ye>Dt||ye<dt)&&m.call(this);xt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Ee,Ge,null).clip().discardPath()),this.pdf.addImage(R,"JPEG",ct.x,ct.y,ct.w,ct.h,null,null,Ze),xt&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(R,"JPEG",Te.x,Te.y,Te.w,Te.h,null,null,Ze)};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 K=this.posY+this.ctx.prevPageLastElemOffset;switch(R.type){default:case"mt":case"lt":X.push(Math.floor((R.y+K)/Y)+1);break;case"arc":X.push(Math.floor((R.y+K-R.radius)/Y)+1),X.push(Math.floor((R.y+K+R.radius)/Y)+1);break;case"qct":var Z=V(this.ctx.lastPoint.x,this.ctx.lastPoint.y,R.x1,R.y1,R.x,R.y);X.push(Math.floor((Z.y+K)/Y)+1),X.push(Math.floor((Z.y+Z.h+K)/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+K)/Y)+1),X.push(Math.floor((de.y+de.h+K)/Y)+1);break;case"rect":X.push(Math.floor((R.y+K)/Y)+1),X.push(Math.floor((R.y+R.h+K)/Y)+1)}for(var se=0;se<X.length;se+=1)for(;this.pdf.internal.getNumberOfPages()<X[se];)y.call(this);return X},y=function(){var R=this.fillStyle,M=this.strokeStyle,Y=this.font,X=this.lineCap,K=this.lineWidth,Z=this.lineJoin;this.pdf.addPage(),this.fillStyle=R,this.strokeStyle=M,this.font=Y,this.lineCap=X,this.lineWidth=K,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,K=this.lineCap,Z=this.lineWidth,de=Math.abs(Z*this.ctx.transform.scaleX),se=this.lineJoin;if(this.autoPaging){for(var ie,he,ue=JSON.parse(JSON.stringify(this.path)),Se=JSON.parse(JSON.stringify(this.path)),Fe=[],te=0;te<Se.length;te++)if(Se[te].x!==void 0)for(var _e=g.call(this,Se[te]),Ze=0;Ze<_e.length;Ze+=1)Fe.indexOf(_e[Ze])===-1&&Fe.push(_e[Ze]);for(var et=0;et<Fe.length;et++)for(;this.pdf.internal.getNumberOfPages()<Fe[et];)y.call(this);x(Fe);for(var Te=Fe[0],st=Fe[Fe.length-1],xe=Te;xe<st+1;xe++){this.pdf.setPage(xe),this.fillStyle=Y,this.strokeStyle=X,this.lineCap=K,this.lineWidth=de,this.lineJoin=se;var Qe=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],ze=xe===1?this.posY+this.margin[0]:this.margin[0],Dt=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],dt=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],ye=xe===1?0:Dt+(xe-2)*dt;if(this.ctx.clip_path.length!==0){var Ee=this.path;ie=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(ie,this.posX+this.margin[3],-ye+ze+this.ctx.prevPageLastElemOffset),w.call(this,R,!0),this.path=Ee}if(he=JSON.parse(JSON.stringify(ue)),this.path=v(he,this.posX+this.margin[3],-ye+ze+this.ctx.prevPageLastElemOffset),M===!1||xe===0){var We=(xe>Te||xe<st)&&m.call(this);We&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Qe,dt,null).clip().discardPath()),w.call(this,R,M),We&&this.pdf.restoreGraphicsState()}this.lineWidth=Z}this.path=ue}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||!A.call(this))){for(var Y,X,K=[],Z=this.path,de=0;de<Z.length;de++){var se=Z[de];switch(se.type){case"begin":K.push({begin:!0});break;case"close":K.push({close:!0});break;case"mt":K.push({start:se,deltas:[],abs:[]});break;case"lt":var ie=K.length;if(Z[de-1]&&!isNaN(Z[de-1].x)&&(Y=[se.x-Z[de-1].x,se.y-Z[de-1].y],ie>0)){for(;ie>=0;ie--)if(K[ie-1].close!==!0&&K[ie-1].begin!==!0){K[ie-1].deltas.push(Y),K[ie-1].abs.push(se);break}}break;case"bct":Y=[se.x1-Z[de-1].x,se.y1-Z[de-1].y,se.x2-Z[de-1].x,se.y2-Z[de-1].y,se.x-Z[de-1].x,se.y-Z[de-1].y],K[K.length-1].deltas.push(Y);break;case"qct":var he=Z[de-1].x+2/3*(se.x1-Z[de-1].x),ue=Z[de-1].y+2/3*(se.y1-Z[de-1].y),Se=se.x+2/3*(se.x1-se.x),Fe=se.y+2/3*(se.y1-se.y),te=se.x,_e=se.y;Y=[he-Z[de-1].x,ue-Z[de-1].y,Se-Z[de-1].x,Fe-Z[de-1].y,te-Z[de-1].x,_e-Z[de-1].y],K[K.length-1].deltas.push(Y);break;case"arc":K.push({deltas:[],abs:[],arc:!0}),Array.isArray(K[K.length-1].abs)&&K[K.length-1].abs.push(se)}}X=M?null:R==="stroke"?"stroke":"fill";for(var Ze=!1,et=0;et<K.length;et++)if(K[et].arc)for(var Te=K[et].abs,st=0;st<Te.length;st++){var xe=Te[st];xe.type==="arc"?E.call(this,xe.x,xe.y,xe.radius,xe.startAngle,xe.endAngle,xe.counterclockwise,void 0,M,!Ze):F.call(this,xe.x,xe.y),Ze=!0}else if(K[et].close===!0)this.pdf.internal.out("h"),Ze=!1;else if(K[et].begin!==!0){var Qe=K[et].start.x,ze=K[et].start.y;L.call(this,K[et].deltas,Qe,ze),Ze=!0}X&&j.call(this,X),M&&I.call(this)}},S=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}},_=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 E=function(R,M,Y,X,K,Z,de,se,ie){for(var he=H.call(this,Y,X,K,Z),ue=0;ue<he.length;ue++){var Se=he[ue];ue===0&&(ie?T.call(this,Se.x1+R,Se.y1+M):F.call(this,Se.x1+R,Se.y1+M)),D.call(this,R,M,Se.x2,Se.y2,Se.x3,Se.y3,Se.x4,Se.y4)}se?I.call(this):j.call(this,de)},j=function(R){switch(R){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},I=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,K,Z=this.pdf.getTextDimensions(R.text),de=S.call(this,R.y),se=_.call(this,de)-Z.h,ie=this.ctx.transform.applyToPoint(new a(R.x,de));if(this.autoPaging){var he=this.ctx.transform.decompose(),ue=new l;ue=(ue=(ue=ue.multiply(he.translate)).multiply(he.skew)).multiply(he.scale);for(var Se=this.ctx.transform.applyToRectangle(new o(R.x,de,Z.w,Z.h)),Fe=ue.applyToRectangle(new o(R.x,se,Z.w,Z.h)),te=g.call(this,Fe),_e=[],Ze=0;Ze<te.length;Ze+=1)_e.indexOf(te[Ze])===-1&&_e.push(te[Ze]);x(_e);for(var et=_e[0],Te=_e[_e.length-1],st=et;st<Te+1;st++){this.pdf.setPage(st);var xe=st===1?this.posY+this.margin[0]:this.margin[0],Qe=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],ze=this.pdf.internal.pageSize.height-this.margin[2],Dt=ze-this.margin[0],dt=this.pdf.internal.pageSize.width-this.margin[1],ye=dt-this.margin[3],Ee=st===1?0:Qe+(st-2)*Dt;if(this.ctx.clip_path.length!==0){var We=this.path;Y=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(Y,this.posX+this.margin[3],-1*Ee+xe),w.call(this,"fill",!0),this.path=We}var Ue=v([JSON.parse(JSON.stringify(Fe))],this.posX+this.margin[3],-Ee+xe+this.ctx.prevPageLastElemOffset)[0];R.scale>=.01&&(X=this.pdf.internal.getFontSize(),this.pdf.setFontSize(X*R.scale),K=this.lineWidth,this.lineWidth=K*R.scale);var Ge=this.autoPaging!=="text";if(Ge||Ue.y+Ue.h<=ze){if(Ge||Ue.y>=xe&&Ue.x<=dt){var pe=Ge?R.text:this.pdf.splitTextToSize(R.text,R.maxWidth||dt-Ue.x)[0],mt=v([JSON.parse(JSON.stringify(Se))],this.posX+this.margin[3],-Ee+xe+this.ctx.prevPageLastElemOffset)[0],ct=Ge&&(st>et||st<Te)&&m.call(this);ct&&(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}),ct&&this.pdf.restoreGraphicsState()}}else Ue.y<ze&&(this.ctx.prevPageLastElemOffset+=ze-Ue.y);R.scale>=.01&&(this.pdf.setFontSize(X),this.lineWidth=K)}}else R.scale>=.01&&(X=this.pdf.internal.getFontSize(),this.pdf.setFontSize(X*R.scale),K=this.lineWidth,this.lineWidth=K*R.scale),this.pdf.text(R.text,ie.x+this.posX,ie.y+this.posY,{angle:R.angle,align:M,renderingMode:R.renderingMode,maxWidth:R.maxWidth}),R.scale>=.01&&(this.pdf.setFontSize(X),this.lineWidth=K)},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)},D=function(R,M,Y,X,K,Z,de,se){this.pdf.internal.out([t(i(Y+R)),t(s(X+M)),t(i(K+R)),t(s(Z+M)),t(i(de+R)),t(s(se+M)),"c"].join(" "))},H=function(R,M,Y,X){for(var K=2*Math.PI,Z=Math.PI/2;M>Y;)M-=K;var de=Math.abs(Y-M);de<K&&X&&(de=K-de);for(var se=[],ie=X?-1:1,he=M;de>1e-5;){var ue=he+ie*Math.min(de,Z);se.push(W.call(this,R,he,ue)),de-=Math.abs(ue-he),he=ue}return se},W=function(R,M,Y){var X=(Y-M)/2,K=R*Math.cos(X),Z=R*Math.sin(X),de=K,se=-Z,ie=de*de+se*se,he=ie+de*K+se*Z,ue=4/3*(Math.sqrt(2*ie*he)-he)/(de*Z-se*K),Se=de-ue*se,Fe=se+ue*de,te=Se,_e=-Fe,Ze=X+M,et=Math.cos(Ze),Te=Math.sin(Ze);return{x1:R*Math.cos(M),y1:R*Math.sin(M),x2:Se*et-Fe*Te,y2:Se*Te+Fe*et,x3:te*et-_e*Te,y3:te*Te+_e*et,x4:R*Math.cos(Y),y4:R*Math.sin(Y)}},$=function(R){return 180*R/Math.PI},V=function(R,M,Y,X,K,Z){var de=R+.5*(Y-R),se=M+.5*(X-M),ie=K+.5*(Y-K),he=Z+.5*(X-Z),ue=Math.min(R,K,de,ie),Se=Math.max(R,K,de,ie),Fe=Math.min(M,Z,se,he),te=Math.max(M,Z,se,he);return new o(ue,Fe,Se-ue,te-Fe)},Q=function(R,M,Y,X,K,Z,de,se){var ie,he,ue,Se,Fe,te,_e,Ze,et,Te,st,xe,Qe,ze,Dt=Y-R,dt=X-M,ye=K-Y,Ee=Z-X,We=de-K,Ue=se-Z;for(he=0;he<41;he++)et=(_e=(ue=R+(ie=he/40)*Dt)+ie*((Fe=Y+ie*ye)-ue))+ie*(Fe+ie*(K+ie*We-Fe)-_e),Te=(Ze=(Se=M+ie*dt)+ie*((te=X+ie*Ee)-Se))+ie*(te+ie*(Z+ie*Ue-te)-Ze),he==0?(st=et,xe=Te,Qe=et,ze=Te):(st=Math.min(st,et),xe=Math.min(xe,Te),Qe=Math.max(Qe,et),ze=Math.max(ze,Te));return new o(Math.round(st),Math.round(xe),Math.round(Qe-st),Math.round(ze-xe))},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)}}})(Nt.API),function(e){var t=function(a){var o,l,u,d,h,f,A,p,m,g;for(l=[],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?(f=(h=((h=((h=((h=(h-(g=h%85))/85)-(m=h%85))/85)-(p=h%85))/85)-(A=h%85))/85)%85,l.push(f+33,A+33,p+33,m+33,g+33)):l.push(122);return function(y,v){for(var x=v;x>0;x--)y.pop()}(l,o.length),String.fromCharCode.apply(String,l)+"~>"},n=function(a){var o,l,u,d,h,f=String,A="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[A]%5||5))[A];h>d;d+=5)l=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&l>>24,p&l>>16,p&l>>8,p&l);return function(v,x){for(var b=x;b>0;b--)v.pop()}(u,o[A]),f.fromCharCode.apply(f,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 l="",u=0;u<a.length;u+=2)l+=String.fromCharCode("0x"+(a[u]+a[u+1]));return l},s=function(a){for(var o=new Uint8Array(a.length),l=a.length;l--;)o[l]=a.charCodeAt(l);return(o=eR(o)).reduce(function(u,d){return u+String.fromCharCode(d)},"")};e.processDataByFilters=function(a,o){var l=0,u=a||"",d=[];for(typeof(o=o||[])=="string"&&(o=[o]),l=0;l<o.length;l+=1)switch(o[l]){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[l]+'" is not implemented')}return{data:u,reverseChain:d.reverse().join(" ")}}}(Nt.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(l,u,d){var h=new XMLHttpRequest,f=0,A=function(p){var m=p.length,g=[],y=String.fromCharCode;for(f=0;f<m;f+=1)g.push(y(255&p.charCodeAt(f)));return g.join("")};if(h.open("GET",l,!u),h.overrideMimeType("text/plain; charset=x-user-defined"),u===!1&&(h.onload=function(){h.status===200?d(A(this.responseText)):d(void 0)}),h.send(null),u&&h.status===200)return A(h.responseText)}(i,s,a)}catch{}return o}(t,n,r)},e.allowFsRead=void 0,e.loadImageFile=e.loadFile}(Nt.API),function(e){function t(){return(Kt.html2canvas?Promise.resolve(Kt.html2canvas):aB(()=>Promise.resolve().then(()=>sjt),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(Kt.DOMPurify?Promise.resolve(Kt.DOMPurify):aB(()=>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 l=Qn(o);return l==="undefined"?"undefined":l==="string"||o instanceof String?"string":l==="number"||o instanceof Number?"number":l==="function"||o instanceof Function?"function":o&&o.constructor===Array?"array":o&&o.nodeType===1?"element":l==="object"?"object":"unknown"},i=function(o,l){var u=document.createElement(o);for(var d in l.className&&(u.className=l.className),l.innerHTML&&l.dompurify&&(u.innerHTML=l.dompurify.sanitize(l.innerHTML)),l.style)u.style[d]=l.style[d];return u},s=function o(l,u){for(var d=l.nodeType===3?document.createTextNode(l.nodeValue):l.cloneNode(!1),h=l.firstChild;h;h=h.nextSibling)u!==!0&&h.nodeType===1&&h.nodeName==="SCRIPT"||d.appendChild(o(h,u));return l.nodeType===1&&(l.nodeName==="CANVAS"?(d.width=l.width,d.height=l.height,d.getContext("2d").drawImage(l,0,0)):l.nodeName!=="TEXTAREA"&&l.nodeName!=="SELECT"||(d.value=l.value),d.addEventListener("load",function(){d.scrollTop=l.scrollTop,d.scrollLeft=l.scrollLeft},!0)),d},a=function o(l){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(l)};(a.prototype=Object.create(Promise.prototype)).constructor=a,a.convert=function(o,l){return o.__proto__=l||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,l){return this.then(function(){switch(l=l||function(u){switch(r(u)){case"string":return"string";case"element":return u.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(o),l){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},l=s(this.prop.src,this.opt.html2canvas.javascriptEnabled);l.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(l),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(l){var u=Object.assign({},this.opt.html2canvas);return delete u.onrendered,l(this.prop.container,u)}).then(function(l){(this.opt.html2canvas.onrendered||function(){})(l),this.prop.canvas=l,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(l){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,f=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 f.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 A=0;A<d.length;++A){var p=d[A],m=p.src.find(function(g){return g.format==="truetype"});m&&u.addFont(m.url,p.ref.name,p.ref.style)}return f.windowHeight=f.windowHeight||0,f.windowHeight=f.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):f.windowHeight,u.context2d.save(!0),l(this.prop.container,f)}).then(function(l){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(l),this.prop.canvas=l,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,l,u){return(u=u||"pdf").toLowerCase()==="img"||u.toLowerCase()==="image"?this.outputImg(o,l):this.outputPdf(o,l)},a.prototype.outputPdf=function(o,l){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(o,l)})},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 l=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(l)})},a.prototype.get=function(o,l){return this.then(function(){var u=o in a.template.prop?this.prop[o]:this.opt[o];return l?l(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 l(u,d){return Math.floor(u*d/72*96)}return this.then(function(){(o=o||Nt.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:l(o.inner.width,o.k),height:l(o.inner.height,o.k)},o.inner.ratio=o.inner.height/o.inner.width),this.prop.pageSize=o})},a.prototype.setProgress=function(o,l,u,d){return o!=null&&(this.progress.val=o),l!=null&&(this.progress.state=l),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,l,u,d){return this.setProgress(o?this.progress.val+o:null,l||null,u?this.progress.n+u:null,d?this.progress.stack.concat(d):null)},a.prototype.then=function(o,l){var u=this;return this.thenCore(o,l,function(d,h){return u.updateProgress(null,null,1,[d]),Promise.prototype.then.call(this,function(f){return u.updateProgress(null,d),f}).then(d,h).then(function(f){return u.updateProgress(1),f})})},a.prototype.thenCore=function(o,l,u){u=u||Promise.prototype.then;var d=this;o&&(o=o.bind(d)),l&&(l=l.bind(d));var h=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?d:a.convert(Object.assign({},d),Promise.prototype),f=u.call(h,o,l);return a.convert(f,d.__proto__)},a.prototype.thenExternal=function(o,l){return Promise.prototype.then.call(this,o,l)},a.prototype.thenList=function(o){var l=this;return o.forEach(function(u){l=l.thenCore(u)}),l},a.prototype.catch=function(o){o&&(o=o.bind(this));var l=Promise.prototype.catch.call(this,o);return a.convert(l,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,Nt.getPageSize=function(o,l,u){if(Qn(o)==="object"){var d=o;o=d.orientation,l=d.unit||l,u=d.format||u}l=l||"mm",u=u||"a4",o=(""+(o||"P")).toLowerCase();var h,f=(""+u).toLowerCase(),A={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(l){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: "+l}var p,m=0,g=0;if(A.hasOwnProperty(f))m=A[f][1]/h,g=A[f][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:l,k:h,orientation:o}},e.html=function(o,l){(l=l||{}).callback=l.callback||function(){},l.html2canvas=l.html2canvas||{},l.html2canvas.canvas=l.html2canvas.canvas||this.canvas,l.jsPDF=l.jsPDF||this,l.fontFaces=l.fontFaces?l.fontFaces.map(W4):null;var u=new a(l);return l.worker?u:u.from(o).doCallback()}}(Nt.API),Nt.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 l=0,u=a-1;u>=0&&i[u]==="\\";u--)l++;s+=l%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 l=o[1];n.internal.newObjectDeferredBegin(l,!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 f=n.internal.getPageInfo(s+1);n.internal.write("<< /D["+f.objId+" 0 R /XYZ null null null]>> endobj")}var A=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 "+A+" 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 l=n.internal.getPageInfo(a.options.pageNumber);this.line("/Dest ["+l.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}}])}(Nt.API),function(e){var t=[192,193,194,195,196,197,198,199];e.processJPEG=function(n,r,i,s,a,o){var l,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,l=function(h){for(var f,A=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+=A,t.indexOf(h.charCodeAt(g+1))!==-1){f=256*h.charCodeAt(g+5)+h.charCodeAt(g+6),m={width:256*h.charCodeAt(g+7)+h.charCodeAt(g+8),height:f,numcomponents:h.charCodeAt(g+9)};break}A=256*h.charCodeAt(g+2)+h.charCodeAt(g+3)}return m}(n=this.__addimage__.isArrayBufferView(n)?this.__addimage__.arrayBufferToBinaryString(n):n),l.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:l.width,height:l.height,colorSpace:o,bitsPerComponent:8,filter:u,index:r,alias:i}}return d}}(Nt.API),Nt.API.processPNG=function(e,t,n,r){if(this.__addimage__.isArrayBuffer(e)&&(e=new Uint8Array(e)),this.__addimage__.isArrayBufferView(e)){var i,s=YCt(e,{checkCrc:!0}),a=s.width,o=s.height,l=s.channels,u=s.palette,d=s.depth;i=u&&l===1?function(E){for(var j=E.width,I=E.height,T=E.data,N=E.palette,F=E.depth,L=!1,D=[],H=[],W=void 0,$=!1,V=0,Q=0;Q<N.length;Q++){var ce=LX(N[Q],4),R=ce[0],M=ce[1],Y=ce[2],X=ce[3];D.push(R,M,Y),X!=null&&(X===0?(V++,H.length<1&&H.push(Q)):X<255&&($=!0))}if($||V>1){L=!0,H=void 0;var K=j*I;W=new Uint8Array(K);for(var Z=new DataView(T.buffer),de=0;de<K;de++){var se=Y4(Z,de,F),ie=LX(N[se],4)[3];W[de]=ie}}else V===0&&(H=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:L?8:void 0,colorBytes:T,alphaBytes:W,needSMask:L,palette:D,mask:H}}(s):l===2||l===4?function(E){for(var j=E.data,I=E.width,T=E.height,N=E.channels,F=E.depth,L=N===2?"DeviceGray":"DeviceRGB",D=N-1,H=I*T,W=D,$=H*W,V=1*H,Q=Math.ceil($*F/8),ce=Math.ceil(V*F/8),R=new Uint8Array(Q),M=new Uint8Array(ce),Y=new DataView(j.buffer),X=new DataView(R.buffer),K=new DataView(M.buffer),Z=!1,de=0;de<H;de++){for(var se=de*N,ie=0;ie<W;ie++)YJ(X,Y4(Y,se+ie,F),de*W+ie,F);var he=Y4(Y,se+W,F);he<(1<<F)-1&&(Z=!0),YJ(K,he,1*de,F)}return{colorSpace:L,colorsPerPixel:D,sMaskBitsPerComponent:Z?F:void 0,colorBytes:R,alphaBytes:M,needSMask:Z}}(s):function(E){var j=E.data,I=E.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:I,colorsPerPixel:I==="DeviceGray"?1:3,colorBytes:j instanceof Uint16Array?function(T){for(var N=T.length,F=new Uint8Array(2*N),L=new DataView(F.buffer,F.byteOffset,F.byteLength),D=0;D<N;D++)L.setUint16(2*D,T[D],!1);return F}(j):j,needSMask:!1}}(s);var h,f,A,p=i,m=p.colorSpace,g=p.colorsPerPixel,y=p.sMaskBitsPerComponent,v=p.colorBytes,x=p.alphaBytes,b=p.needSMask,w=p.palette,S=p.mask,_=null;return r!==Nt.API.image_compression.NONE&&typeof eR=="function"?(_=function(E){var j;switch(E){case Nt.API.image_compression.FAST:j=11;break;case Nt.API.image_compression.MEDIUM:j=13;break;case Nt.API.image_compression.SLOW:j=14;break;default:j=12}return j}(r),h=this.decode.FLATE_DECODE,f="/Predictor ".concat(_," /Colors ").concat(g," /BitsPerComponent ").concat(d," /Columns ").concat(a),e=VJ(v,Math.ceil(a*g*d/8),g,d,r),b&&(A=VJ(x,Math.ceil(a*y/8),1,y,r))):(h=void 0,f=void 0,e=v,b&&(A=x)),(this.__addimage__.isArrayBuffer(e)||this.__addimage__.isArrayBufferView(e))&&(e=this.__addimage__.arrayBufferToBinaryString(e)),(A&&this.__addimage__.isArrayBuffer(A)||this.__addimage__.isArrayBufferView(A))&&(A=this.__addimage__.arrayBufferToBinaryString(A)),{alias:n,data:e,index:t,filter:h,decodeParameters:f,transparency:S,palette:w,sMask:A,predictor:_,width:a,height:o,bitsPerComponent:d,sMaskBitsPerComponent:y,colorSpace:m}}},function(e){e.processGIF89A=function(t,n,r,i){var s=new gSt(t),a=s.width,o=s.height,l=[];s.decodeAndBlitFrameRGBA(0,l);var u={data:l,width:a,height:o},d=new X4(100).encode(u,100);return e.processJPEG.call(this,d,n,r,i)},e.processGIF87A=e.processGIF89A}(Nt.API),Fl.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)},Fl.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){Yn.log("bit decode error:"+n)}},Fl.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 l=this.palette[s>>7-o&1];this.data[a+4*o]=l.blue,this.data[a+4*o+1]=l.green,this.data[a+4*o+2]=l.red,this.data[a+4*o+3]=255}n!==0&&(this.pos+=4-n)}},Fl.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,l=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[l],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)}},Fl.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)}},Fl.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,l=(s>>10&t)/t*255|0,u=s>>15?255:0,d=r*this.width*4+4*i;this.data[d]=l,this.data[d+1]=o,this.data[d+2]=a,this.data[d+3]=u}this.pos+=e}},Fl.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,l=(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]=l,this.data[d+2]=o,this.data[d+3]=255}this.pos+=e}},Fl.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}},Fl.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}},Fl.prototype.getData=function(){return this.data},function(e){e.processBMP=function(t,n,r,i){var s=new Fl(t,!1),a=s.width,o=s.height,l={data:s.getData(),width:a,height:o},u=new X4(100).encode(l,100);return e.processJPEG.call(this,u,n,r,i)}}(Nt.API),JJ.prototype.getData=function(){return this.data},function(e){e.processWEBP=function(t,n,r,i){var s=new JJ(t),a=s.width,o=s.height,l={data:s.getData(),width:a,height:o},u=new X4(100).encode(l,100);return e.processJPEG.call(this,u,n,r,i)}}(Nt.API),Nt.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,l=0,u=0;u<i;u+=4){var d=r[u],h=r[u+1],f=r[u+2],A=r[u+3];s[o++]=d,s[o++]=h,s[o++]=f,a[l++]=A}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}},Nt.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},Ag=Nt.API,JS=Ag.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,l=o.fof?o.fof:1,u=t.kerning?t.kerning:i.metadata.Unicode.kerning,d=u.fof?u.fof:1,h=t.doKerning!==!1,f=0,A=e.length,p=0,m=o[0]||l,g=[];for(n=0;n<A;n++)r=e.charCodeAt(n),typeof i.metadata.widthOfString=="function"?g.push((i.metadata.widthOfGlyph(i.metadata.characterToGlyph(r))+a*(1e3/s)||0)/1e3):(f=h&&Qn(u[r])==="object"&&!isNaN(parseInt(u[r][p],10))?u[r][p]/d:0,g.push((o[r]||m)/l+f)),p=r;return g},HJ=Ag.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 Ag.processArabic&&(e=Ag.processArabic(e)),typeof r.metadata.widthOfString=="function"?r.metadata.widthOfString(e,n,i)/n:JS.apply(this,arguments).reduce(function(s,a){return s+a},0)},$J=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 l=s;for(o=0;s!==a;)o+t[s]>r&&(i.push(e.slice(l,s)),o=0,l=s),o+=t[s],s++;return l!==s&&i.push(e.slice(l,s)),i},zJ=function(e,t,n){n||(n={});var r,i,s,a,o,l,u,d=[],h=[d],f=n.textIndent||0,A=0,p=0,m=e.split(" "),g=JS.apply(this,[" ",n])[0];if(l=n.lineIndent===-1?m[0].length+2:n.lineIndent||0){var y=Array(l).join(" "),v=[];m.map(function(b){(b=b.split(/\s*\n/)).length>1?v=v.concat(b.map(function(w,S){return(S&&w.length?`
`:"")+w})):v.push(b[0])}),m=v,l=HJ.apply(this,[y,n])}for(s=0,a=m.length;s<a;s++){var x=0;if(r=m[s],l&&r[0]==`
`&&(r=r.substr(1),x=1),f+A+(p=(i=JS.apply(this,[r,n])).reduce(function(b,w){return b+w},0))>t||x){if(p>t){for(o=$J.apply(this,[r,i,t-(f+A),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),f=p+l,A=g}else d.push(r),f+=A+p,A=g}return u=l?function(b,w){return(w?y:"")+b.join(" ")}:function(b){return b.join(" ")},h.map(u)},Ag.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),f="Unicode";return h.metadata[f]?{widths:h.metadata[f].widths||{0:1},kerning:h.metadata[f].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,l,u=[];for(o=0,l=r.length;o<l;o++)u=u.concat(zJ.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(f){return"0x"+parseInt(f,10).toString(16)},o=e.__fontmetrics__.compress=function(f){var A,p,m,g,y=["{"];for(var v in f){if(A=f[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 A=="number")A<0?(m=a(A).slice(3),g="-"):(m=a(A).slice(2),g=""),m=g+m.slice(0,-1)+i[m.slice(-1)];else{if(Qn(A)!=="object")throw new Error("Don't know what to do with value type "+Qn(A)+".");m=o(A)}y.push(p+m)}return y.push("}"),y.join("")},l=e.__fontmetrics__.uncompress=function(f){if(typeof f!="string")throw new Error("Invalid argument passed to uncompress.");for(var A,p,m,g,y={},v=1,x=y,b=[],w="",S="",_=f.length-1,E=1;E<_;E+=1)(g=f[E])=="'"?A?(m=A.join(""),A=void 0):A=[]:A?A.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)?(S+=r[g],x[m]=parseInt(S,16)*v,v=1,m=void 0,S=""):S+=g;return y},u={codePages:["WinAnsiEncoding"],WinAnsiEncoding:l("{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":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":l("{'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":l("{'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:l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":l("{'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:l("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:l("{'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":l("{'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:l("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":l("{'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":l("{'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":l("{'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(f){var A=f.font,p=h.Unicode[A.postScriptName];p&&(A.metadata.Unicode={},A.metadata.Unicode.widths=p.widths,A.metadata.Unicode.kerning=p.kerning);var m=d.Unicode[A.postScriptName];m&&(A.metadata.Unicode.encoding=m,A.encoding=m.codePages[0])}])}(Nt.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(cB(o)),a.metadata=e.API.TTFFont.open(o),a.metadata.Unicode=a.metadata.Unicode||{encoding:{},kerning:{},widths:[]},a.metadata.glyIdsUsed=[0]})(i,r)}}])}(Nt),Nt.API.addSvgAsImage=function(e,t,n,r,i,s,a,o){if(isNaN(t)||isNaN(n))throw Yn.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(i))throw Yn.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var l=document.createElement("canvas");l.width=r,l.height=i;var u=l.getContext("2d");u.fillStyle="#fff",u.fillRect(0,0,l.width,l.height);var d={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},h=this;return(Kt.canvg?Promise.resolve(Kt.canvg):aB(()=>import("./index.es-t9dy4vce.js"),[])).catch(function(f){return Promise.reject(new Error("Could not load canvg: "+f))}).then(function(f){return f.default?f.default:f}).then(function(f){return f.fromString(u,e,d)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(f){return f.render(d)}).then(function(){h.addImage(l.toDataURL("image/jpeg",1),t,n,r,i,a,o)})},Nt.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},Nt.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),l=[],u=0,d=0,h=0;function f(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 A=o.length;for(h=0;h<A;h+=1)n[o[h]].value=n[o[h]].defaultValue,n[o[h]].explicitSet=!1}if(Qn(e)==="object"){for(i in e)if(s=e[i],f(o,i)&&s!==void 0){if(n[i].type==="boolean"&&typeof s=="boolean")n[i].value=s;else if(n[i].type==="name"&&f(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")l.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&&l.push([s[u][0]-1,s[u][1]-1].join(" "))}n[i].value="["+l.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},Nt.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",vSt),this.internal.events.subscribe("postPutResources",ySt)),this},function(e){var t=e.API,n=t.pdfEscape16=function(s,a){for(var o,l=a.metadata.Unicode.widths,u=["","0","00","000","0000"],d=[""],h=0,f=s.length;h<f;++h){if(o=a.metadata.characterToGlyph(s.charCodeAt(h)),a.metadata.glyIdsUsed.push(o),a.metadata.toUnicode[o]=s.charCodeAt(h),l.indexOf(o)==-1&&(l.push(o),l.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,l,u,d,h,f;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`,l=[],h=0,f=(o=Object.keys(s).sort(function(A,p){return A-p})).length;h<f;h++)a=o[h],l.length>=100&&(d+=`
`+l.length+` beginbfchar
`+l.join(`
`)+`
endbfchar`,l=[]),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),l.push("<"+a+"><"+u+">"));return l.length&&(d+=`
`+l.length+` beginbfchar
`+l.join(`
`)+`
endbfchar
`),d+`endcmap
CMapName currentdict /CMap defineresource pop
end
end`};t.events.push(["putFont",function(s){(function(a){var o=a.font,l=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,f=o.metadata.subset.encode(o.metadata.glyIdsUsed,1),A="",p=0;p<f.length;p++)A+=String.fromCharCode(f[p]);var m=u();d({data:A,addLength1:!0,objectId:m}),l("endobj");var g=u();d({data:r(o.metadata.toUnicode),addLength1:!0,objectId:g}),l("endobj");var y=u();l("<<"),l("/Type /FontDescriptor"),l("/FontName /"+Eg(o.fontName)),l("/FontFile2 "+m+" 0 R"),l("/FontBBox "+e.API.PDFObject.convert(o.metadata.bbox)),l("/Flags "+o.metadata.flags),l("/StemV "+o.metadata.stemV),l("/ItalicAngle "+o.metadata.italicAngle),l("/Ascent "+o.metadata.ascender),l("/Descent "+o.metadata.decender),l("/CapHeight "+o.metadata.capHeight),l(">>"),l("endobj");var v=u();l("<<"),l("/Type /Font"),l("/BaseFont /"+Eg(o.fontName)),l("/FontDescriptor "+y+" 0 R"),l("/W "+e.API.PDFObject.convert(h)),l("/CIDToGIDMap /Identity"),l("/DW 1000"),l("/Subtype /CIDFontType2"),l("/CIDSystemInfo"),l("<<"),l("/Supplement 0"),l("/Registry (Adobe)"),l("/Ordering ("+o.encoding+")"),l(">>"),l(">>"),l("endobj"),o.objectNumber=u(),l("<<"),l("/Type /Font"),l("/Subtype /Type0"),l("/ToUnicode "+g+" 0 R"),l("/BaseFont /"+Eg(o.fontName)),l("/Encoding /"+o.encoding),l("/DescendantFonts ["+v+" 0 R]"),l(">>"),l("endobj"),o.isAlreadyPutted=!0}})(s)}]),t.events.push(["putFont",function(s){(function(a){var o=a.font,l=a.out,u=a.newObject,d=a.putStream;if(o.metadata instanceof e.API.TTFFont&&o.encoding==="WinAnsiEncoding"){for(var h=o.metadata.rawData,f="",A=0;A<h.length;A++)f+=String.fromCharCode(h[A]);var p=u();d({data:f,addLength1:!0,objectId:p}),l("endobj");var m=u();d({data:r(o.metadata.toUnicode),addLength1:!0,objectId:m}),l("endobj");var g=u();l("<<"),l("/Descent "+o.metadata.decender),l("/CapHeight "+o.metadata.capHeight),l("/StemV "+o.metadata.stemV),l("/Type /FontDescriptor"),l("/FontFile2 "+p+" 0 R"),l("/Flags 96"),l("/FontBBox "+e.API.PDFObject.convert(o.metadata.bbox)),l("/FontName /"+Eg(o.fontName)),l("/ItalicAngle "+o.metadata.italicAngle),l("/Ascent "+o.metadata.ascender),l(">>"),l("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));l("<</Subtype/TrueType/Type/Font/ToUnicode "+m+" 0 R/BaseFont/"+Eg(o.fontName)+"/FontDescriptor "+g+" 0 R/Encoding/"+o.encoding+" /FirstChar 29 /LastChar 255 /Widths "+e.API.PDFObject.convert(o.metadata.hmtx.widths)+">>"),l("endobj"),o.isAlreadyPutted=!0}})(s)}]);var i=function(s){var a,o=s.text||"",l=s.x,u=s.y,d=s.options||{},h=s.mutex||{},f=h.pdfEscape,A=h.activeFontKey,p=h.fonts,m=A,g="",y=0,v="",x=p[m].encoding;if(p[m].encoding!=="Identity-H")return{text:o,x:l,y:u,options:d,mutex:h};for(v=o,m=A,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=f(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:l,y:u,options:d,mutex:h}};t.events.push(["postProcessText",function(s){var a=s.text||"",o=[],l={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({},l,{text:a[u][0]})).text,a[u][1],a[u][2]]):o.push(i(Object.assign({},l,{text:a[u]})).text);s.text=o}else s.text=i(Object.assign({},l,{text:a})).text}])}(Nt),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}}(Nt.API),function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(r){var i,s,a,o,l,u,d,h=t,f=[[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]],A=[[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},S=function(T,N,F,L){var D,H,W,$,V=N[L];switch(V){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&&(V="AN");break;case"AL":v=!0,V="R";break;case"WS":case"BN":V="N";break;case"CS":L<1||L+1>=N.length||(D=F[L-1])!=="EN"&&D!=="AN"||(H=N[L+1])!=="EN"&&H!=="AN"?V="N":v&&(H="AN"),V=H===D?H:"N";break;case"ES":V=(D=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"){V="EN";break}if(v){V="N";break}for(W=L+1,$=N.length;W<$&&N[W]==="ET";)W++;V=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(D=N[W],ce&&(D==="R"||D==="AL")){V="R";break}}}V=L<1||(D=N[L-1])==="B"?"N":F[L-1];break;case"B":v=!1,i=!0,V=x;break;case"S":s=!0,V="N"}return V},_=function(T,N,F){var L=T.split("");return F&&E(L,F,{hiLevel:x}),L.reverse(),N&&N.reverse(),L.join("")},E=function(T,N,F){var L,D,H,W,$,V=-1,Q=T.length,ce=0,R=[],M=x?A:f,Y=[];for(v=!1,i=!1,s=!1,D=0;D<Q;D++)Y[D]=b(T[D]);for(H=0;H<Q;H++){if($=ce,R[H]=S(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(D=V;D<H;D++)N[D]=1;V=-1}else V=-1;if(M[ce][6])V===-1&&(V=H);else if(V>-1){for(D=V;D<H;D++)N[D]=W;V=-1}Y[H]==="B"&&(N[H]=0),F.hiLevel|=W}s&&function(X,K,Z){for(var de=0;de<Z;de++)if(X[de]==="S"){K[de]=x;for(var se=de-1;se>=0&&X[se]==="WS";se--)K[se]=x}}(Y,N,Q)},j=function(T,N,F,L,D){if(!(D.hiLevel<T)){if(T===1&&x===1&&!i)return N.reverse(),void(F&&F.reverse());for(var H,W,$,V,Q=N.length,ce=0;ce<Q;){if(L[ce]>=T){for($=ce+1;$<Q&&L[$]>=T;)$++;for(V=ce,W=$-1;V<W;V++,W--)H=N[V],N[V]=N[W],N[W]=H,F&&(H=F[V],F[V]=F[W],F[W]=H);ce=$}ce++}}},I=function(T,N,F){var L=T.split(""),D={hiLevel:x};return F||(F=[]),E(L,F,D),function(H,W,$){if($.hiLevel!==0&&d)for(var V,Q=0;Q<H.length;Q++)W[Q]===1&&(V=g.indexOf(H[Q]))>=0&&(H[Q]=g[V+1])}(L,F,D),j(2,L,N,F,D),j(1,L,N,F,D),L.join("")};return this.__bidiEngine__.doBidiReorder=function(T,N,F){if(function(D,H){if(H)for(var W=0;W<D.length;W++)H[W]=W;o===void 0&&(o=w(D)),u===void 0&&(u=w(D))}(T,N),a||!l||u)if(a&&l&&o^u)x=o?1:0,T=_(T,N,F);else if(!a&&l&&u)x=o?1:0,T=I(T,N,F),T=_(T,N);else if(!a||o||l||u){if(a&&!l&&o^u)T=_(T,N),o?(x=0,T=I(T,N,F)):(x=1,T=I(T,N,F),T=_(T,N));else if(a&&o&&!l&&u)x=1,T=I(T,N,F),T=_(T,N);else if(!a&&!l&&o^u){var L=d;o?(x=1,T=I(T,N,F),x=0,d=!1,T=I(T,N,F),d=L):(x=0,T=I(T,N,F),T=_(T,N),x=1,d=!1,T=I(T,N,F),d=L,T=_(T,N))}}else x=0,T=I(T,N,F);else x=o?1:0,T=I(T,N,F);return T},this.__bidiEngine__.setOptions=function(T){T&&(a=T.isInputVisual,l=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})}])}(Nt),Nt.API.TTFFont=function(){function e(t){var n;if(this.rawData=t,n=this.contents=new PA(t),this.contents.pos=4,n.readString(4)==="ttcf")throw new Error("TTCF not supported.");n.pos=0,this.parse(),this.subset=new OSt(this),this.registerTTF()}return e.open=function(t){return new e(t)},e.prototype.parse=function(){return this.directory=new xSt(this.contents),this.head=new bSt(this),this.name=new _St(this),this.cmap=new Uye(this),this.toUnicode={},this.hhea=new CSt(this),this.maxp=new ESt(this),this.hmtx=new NSt(this),this.post=new kSt(this),this.os2=new SSt(this),this.loca=new ISt(this),this.glyf=new jSt(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,l,u;for(u=[],a=0,o=(l=this.bbox).length;a<o;a++)t=l[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 xc,PA=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,l;return t=this.readByte(),n=this.readByte(),r=this.readByte(),i=this.readByte(),s=this.readByte(),a=this.readByte(),o=this.readByte(),l=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^l)+1):72057594037927940*t+281474976710656*n+1099511627776*r+4294967296*i+16777216*s+65536*a+256*o+l},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}(),xSt=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,l,u,d,h,f,A,p,m;for(m in A=Object.keys(n).length,l=Math.log(2),h=16*Math.floor(Math.log(A)/l),a=Math.floor(h/l),d=16*A-h,(i=new PA).writeInt(this.scalarType),i.writeShort(A),i.writeShort(h),i.writeShort(a),i.writeShort(d),s=16*A,u=i.pos+s,o=null,p=[],n)for(f=n[m],i.writeString(m),i.writeInt(e(f)),i.writeInt(u),i.writeInt(f.length),p=p.concat(f),m==="head"&&(o=u),u+=f.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=Dye.call(n);n.length%4;)n.push(0);for(s=new PA(n),i=0,r=0,a=n.length;r<a;r=r+=4)i+=s.readUInt32();return 4294967295&i},t}(),wSt={}.hasOwnProperty,pu=function(e,t){for(var n in t)wSt.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};xc=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 bSt=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return pu(e,xc),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 PA).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}(),ZJ=function(){function e(t,n){var r,i,s,a,o,l,u,d,h,f,A,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(l=0;l<256;++l)this.codeMap[l]=t.readByte();break;case 4:for(A=t.readUInt16(),f=A/2,t.pos+=6,s=function(){var b,w;for(w=[],l=b=0;0<=f?b<f:b>f;l=0<=f?++b:--b)w.push(t.readUInt16());return w}(),t.pos+=2,m=function(){var b,w;for(w=[],l=b=0;0<=f?b<f:b>f;l=0<=f?++b:--b)w.push(t.readUInt16());return w}(),u=function(){var b,w;for(w=[],l=b=0;0<=f?b<f:b>f;l=0<=f?++b:--b)w.push(t.readUInt16());return w}(),d=function(){var b,w;for(w=[],l=b=0;0<=f?b<f:b>f;l=0<=f?++b:--b)w.push(t.readUInt16());return w}(),i=(this.length-t.pos+this.offset)/2,o=function(){var b,w;for(w=[],l=b=0;0<=i?b<i:b>i;l=0<=i?++b:--b)w.push(t.readUInt16());return w}(),l=y=0,x=s.length;y<x;l=++y)for(g=s[l],r=v=p=m[l];p<=g?v<=g:v>=g;r=p<=g?++v:--v)d[l]===0?a=r+u[l]:(a=o[d[l]/2+(r-p)-(f-l)]||0)!==0&&(a+=u[l]),this.codeMap[r]=65535&a}t.pos=h}return e.encode=function(t,n){var r,i,s,a,o,l,u,d,h,f,A,p,m,g,y,v,x,b,w,S,_,E,j,I,T,N,F,L,D,H,W,$,V,Q,ce,R,M,Y,X,K,Z,de,se,ie,he,ue;switch(L=new PA,a=Object.keys(t).sort(function(Se,Fe){return Se-Fe}),n){case"macroman":for(m=0,g=function(){var Se=[];for(p=0;p<256;++p)Se.push(0);return Se}(),v={0:0},s={},D=0,V=a.length;D<V;D++)v[se=t[i=a[D]]]==null&&(v[se]=++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),I=2*(j=N.length),E=2*Math.pow(Math.log(j)/Math.LN2,2),f=Math.log(E/2)/Math.LN2,_=2*j-E,l=[],S=[],A=[],p=W=0,ce=N.length;W<ce;p=++W){if(T=N[p],d=h[p],T===65535){l.push(0),S.push(0);break}if(T-(F=r[T].new)>=32768)for(l.push(0),S.push(2*(A.length+j-p)),i=$=T;T<=d?$<=d:$>=d;i=T<=d?++$:--$)A.push(r[i].new);else l.push(F-T),S.push(0)}for(L.writeUInt16(3),L.writeUInt16(1),L.writeUInt32(12),L.writeUInt16(4),L.writeUInt16(16+8*j+2*A.length),L.writeUInt16(0),L.writeUInt16(I),L.writeUInt16(E),L.writeUInt16(f),L.writeUInt16(_),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(ie=0,Y=l.length;ie<Y;ie++)o=l[ie],L.writeUInt16(o);for(he=0,X=S.length;he<X;he++)b=S[he],L.writeUInt16(b);for(ue=0,K=A.length;ue<K;ue++)m=A[ue],L.writeUInt16(m);return{charMap:r,subtable:L.data,maxGlyphID:x+1}}},e}(),Uye=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return pu(e,xc),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 ZJ(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=ZJ.encode(t,n),(i=new PA).writeUInt16(0),i.writeUInt16(1),r.table=i.data.concat(r.subtable),r},e}(),CSt=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return pu(e,xc),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}(),SSt=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return pu(e,xc),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}(),kSt=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return pu(e,xc),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,l;for(l=[],s=a=0,o=this.file.maxp.numGlyphs;0<=o?a<o:a>o;s=0<=o?++a:--a)l.push(t.readUInt32());return l}).call(this)}},e}(),BSt=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},_St=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return pu(e,xc),e.prototype.tag="name",e.prototype.parse=function(t){var n,r,i,s,a,o,l,u,d,h,f;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(l={},s=d=0,h=r.length;d<h;s=++d)i=r[s],t.pos=i.offset,u=t.readString(i.length),a=new BSt(u,i),l[f=i.nameID]==null&&(l[f]=[]),l[i.nameID].push(a);this.strings=l,this.copyright=l[0],this.fontFamily=l[1],this.fontSubfamily=l[2],this.uniqueSubfamily=l[3],this.fontName=l[4],this.version=l[5];try{this.postscriptName=l[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=l[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=l[7],this.manufacturer=l[8],this.designer=l[9],this.description=l[10],this.vendorUrl=l[11],this.designerUrl=l[12],this.license=l[13],this.licenseUrl=l[14],this.preferredFamily=l[15],this.preferredSubfamily=l[17],this.compatibleFull=l[18],this.sampleText=l[19]},e}(),ESt=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return pu(e,xc),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}(),NSt=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return pu(e,xc),e.prototype.tag="hmtx",e.prototype.parse=function(t){var n,r,i,s,a,o,l;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,f;for(f=[],u=0,d=(h=this.metrics).length;u<d;u++)s=h[u],f.push(s.advance);return f}).call(this),r=this.widths[this.widths.length-1],l=[],n=a=0;0<=i?a<i:a>i;n=0<=i?++a:--a)l.push(this.widths.push(r));return l},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}(),Dye=[].slice,jSt=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return pu(e,xc),e.prototype.tag="glyf",e.prototype.parse=function(){return this.cache={}},e.prototype.glyphFor=function(t){var n,r,i,s,a,o,l,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 PA(n.read(i))).readShort(),u=o.readShort(),h=o.readShort(),l=o.readShort(),d=o.readShort(),this.cache[t]=a===-1?new PSt(o,u,h,l,d):new TSt(o,a,u,h,l,d),this.cache[t]))},e.prototype.encode=function(t,n,r){var i,s,a,o,l;for(a=[],s=[],o=0,l=n.length;o<l;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}(),TSt=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}(),PSt=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 PA(Dye.call(this.raw.data)),t=0,r=this.glyphIDs.length;t<r;++t)n.pos=this.glyphOffsets[t];return n.data},e}(),ISt=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return pu(e,xc),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],l=this.offsets[a+1]-o;l>0&&(i+=l)}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}(),OSt=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,l;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 l=this.glyphsFor(n))r=l[s],i[s]=r;return i},e.prototype.encode=function(t,n){var r,i,s,a,o,l,u,d,h,f,A,p,m,g,y;for(i in r=Uye.encode(this.generateCmap(),"unicode"),a=this.glyphsFor(t),A={0:0},y=r.charMap)A[(l=y[i]).old]=l.new;for(p in f=r.maxGlyphID,a)p in A||(A[p]=f++);return d=function(v){var x,b;for(x in b={},v)b[v[x]]=x;return b}(A),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,A),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}();Nt.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,l,u;for(u=[],o=0,l=n.length;o<l;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 fR=function(e,t){return fR=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])},fR(e,t)};function wc(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");fR(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var pR=function(){return pR=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},pR.apply(this,arguments)};function ia(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 l(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?s(d.value):i(d.value).then(o,l)}u((r=r.apply(e,[])).next())})}function Fs(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 l([u,d])}}function l(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 ZS(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 wd=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}(),J5=function(e,t){return wd.fromClientRect(e,t.getBoundingClientRect())},FSt=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 wd(0,0,r,i)},Z5=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},ri=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},eZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",MSt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var ek=0;ek<eZ.length;ek++)MSt[eZ.charCodeAt(ek)]=ek;var tZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tw=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var tk=0;tk<tZ.length;tk++)tw[tZ.charCodeAt(tk)]=tk;var LSt=function(e){var t=e.length*.75,n=e.length,r,i=0,s,a,o,l;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=tw[e.charCodeAt(r)],a=tw[e.charCodeAt(r+1)],o=tw[e.charCodeAt(r+2)],l=tw[e.charCodeAt(r+3)],d[i++]=s<<2|a>>4,d[i++]=(a&15)<<4|o>>2,d[i++]=(o&3)<<6|l&63;return u},RSt=function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n.push(e[r+1]<<8|e[r]);return n},USt=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},Ep=5,t$=11,J4=2,DSt=t$-Ep,Qye=65536>>Ep,QSt=1<<Ep,Z4=QSt-1,HSt=1024>>Ep,$St=Qye+HSt,zSt=$St,VSt=32,KSt=zSt+VSt,qSt=65536>>t$,WSt=1<<DSt,GSt=WSt-1,nZ=function(e,t,n){return e.slice?e.slice(t,n):new Uint16Array(Array.prototype.slice.call(e,t,n))},YSt=function(e,t,n){return e.slice?e.slice(t,n):new Uint32Array(Array.prototype.slice.call(e,t,n))},XSt=function(e,t){var n=LSt(e),r=Array.isArray(n)?USt(n):new Uint32Array(n),i=Array.isArray(n)?RSt(n):new Uint16Array(n),s=24,a=nZ(i,s/2,r[4]/2),o=r[5]===2?nZ(i,(s+r[4])/2):YSt(r,Math.ceil((s+r[4])/4));return new JSt(r[0],r[1],r[2],r[3],a,o)},JSt=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>>Ep],n=(n<<J4)+(t&Z4),this.data[n];if(t<=65535)return n=this.index[Qye+(t-55296>>Ep)],n=(n<<J4)+(t&Z4),this.data[n];if(t<this.highStart)return n=KSt-qSt+(t>>t$),n=this.index[n],n+=t>>Ep&GSt,n=this.index[n],n=(n<<J4)+(t&Z4),this.data[n];if(t<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),rZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ZSt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var nk=0;nk<rZ.length;nk++)ZSt[rZ.charCodeAt(nk)]=nk;var ekt="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==",iZ=50,tkt=1,Hye=2,$ye=3,nkt=4,rkt=5,sZ=7,zye=8,aZ=9,Kh=10,mR=11,oZ=12,gR=13,ikt=14,nw=15,yR=16,rk=17,Ix=18,skt=19,lZ=20,vR=21,Ox=22,eO=23,fg=24,uo=25,rw=26,iw=27,pg=28,akt=29,Df=30,okt=31,ik=32,sk=33,xR=34,wR=35,bR=36,W1=37,CR=38,fB=39,pB=40,tO=41,Vye=42,lkt=43,ckt=[9001,65288],Kye="!",fn="×",ak="÷",SR=XSt(ekt),Lu=[Df,bR],kR=[tkt,Hye,$ye,rkt],qye=[Kh,zye],cZ=[iw,rw],ukt=kR.concat(qye),uZ=[CR,fB,pB,xR,wR],dkt=[nw,gR],hkt=function(e,t){t===void 0&&(t="strict");var n=[],r=[],i=[];return e.forEach(function(s,a){var o=SR.get(s);if(o>iZ?(i.push(!0),o-=iZ):i.push(!1),["normal","auto","loose"].indexOf(t)!==-1&&[8208,8211,12316,12448].indexOf(s)!==-1)return r.push(a),n.push(yR);if(o===nkt||o===mR){if(a===0)return r.push(a),n.push(Df);var l=n[a-1];return ukt.indexOf(l)===-1?(r.push(r[a-1]),n.push(l)):(r.push(a),n.push(Df))}if(r.push(a),o===okt)return n.push(t==="strict"?vR:W1);if(o===Vye||o===akt)return n.push(Df);if(o===lkt)return s>=131072&&s<=196605||s>=196608&&s<=262141?n.push(W1):n.push(Df);n.push(o)}),[r,n,i]},nO=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!==Kh)break}if(i===Kh)for(var s=n;s>0;){s--;var o=r[s];if(Array.isArray(e)?e.indexOf(o)!==-1:e===o)for(var l=n;l<=r.length;){l++;var a=r[l];if(a===t)return!0;if(a!==Kh)break}if(o!==Kh)break}return!1},dZ=function(e,t){for(var n=e;n>=0;){var r=t[n];if(r===Kh)n--;else return r}return 0},Akt=function(e,t,n,r,i){if(n[r]===0)return fn;var s=r-1;if(Array.isArray(i)&&i[s]===!0)return fn;var a=s-1,o=s+1,l=t[s],u=a>=0?t[a]:0,d=t[o];if(l===Hye&&d===$ye)return fn;if(kR.indexOf(l)!==-1)return Kye;if(kR.indexOf(d)!==-1||qye.indexOf(d)!==-1)return fn;if(dZ(s,t)===zye)return ak;if(SR.get(e[s])===mR||(l===ik||l===sk)&&SR.get(e[o])===mR||l===sZ||d===sZ||l===aZ||[Kh,gR,nw].indexOf(l)===-1&&d===aZ||[rk,Ix,skt,fg,pg].indexOf(d)!==-1||dZ(s,t)===Ox||nO(eO,Ox,s,t)||nO([rk,Ix],vR,s,t)||nO(oZ,oZ,s,t))return fn;if(l===Kh)return ak;if(l===eO||d===eO)return fn;if(d===yR||l===yR)return ak;if([gR,nw,vR].indexOf(d)!==-1||l===ikt||u===bR&&dkt.indexOf(l)!==-1||l===pg&&d===bR||d===lZ||Lu.indexOf(d)!==-1&&l===uo||Lu.indexOf(l)!==-1&&d===uo||l===iw&&[W1,ik,sk].indexOf(d)!==-1||[W1,ik,sk].indexOf(l)!==-1&&d===rw||Lu.indexOf(l)!==-1&&cZ.indexOf(d)!==-1||cZ.indexOf(l)!==-1&&Lu.indexOf(d)!==-1||[iw,rw].indexOf(l)!==-1&&(d===uo||[Ox,nw].indexOf(d)!==-1&&t[o+1]===uo)||[Ox,nw].indexOf(l)!==-1&&d===uo||l===uo&&[uo,pg,fg].indexOf(d)!==-1)return fn;if([uo,pg,fg,rk,Ix].indexOf(d)!==-1)for(var h=s;h>=0;){var f=t[h];if(f===uo)return fn;if([pg,fg].indexOf(f)!==-1)h--;else break}if([iw,rw].indexOf(d)!==-1)for(var h=[rk,Ix].indexOf(l)!==-1?a:s;h>=0;){var f=t[h];if(f===uo)return fn;if([pg,fg].indexOf(f)!==-1)h--;else break}if(CR===l&&[CR,fB,xR,wR].indexOf(d)!==-1||[fB,xR].indexOf(l)!==-1&&[fB,pB].indexOf(d)!==-1||[pB,wR].indexOf(l)!==-1&&d===pB||uZ.indexOf(l)!==-1&&[lZ,rw].indexOf(d)!==-1||uZ.indexOf(d)!==-1&&l===iw||Lu.indexOf(l)!==-1&&Lu.indexOf(d)!==-1||l===fg&&Lu.indexOf(d)!==-1||Lu.concat(uo).indexOf(l)!==-1&&d===Ox&&ckt.indexOf(e[o])===-1||Lu.concat(uo).indexOf(d)!==-1&&l===Ix)return fn;if(l===tO&&d===tO){for(var A=n[s],p=1;A>0&&(A--,t[A]===tO);)p++;if(p%2!==0)return fn}return l===ik&&d===sk?fn:ak},fkt=function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var n=hkt(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[uo,Df,Vye].indexOf(o)!==-1?W1:o}));var a=t.wordBreak==="keep-all"?s.map(function(o,l){return o&&e[l]>=19968&&e[l]<=40959}):void 0;return[r,i,a]},pkt=function(){function e(t,n,r,i){this.codePoints=t,this.required=n===Kye,this.start=r,this.end=i}return e.prototype.slice=function(){return ri.apply(void 0,this.codePoints.slice(this.start,this.end))},e}(),mkt=function(e,t){var n=Z5(e),r=fkt(n,t),i=r[0],s=r[1],a=r[2],o=n.length,l=0,u=0;return{next:function(){if(u>=o)return{done:!0,value:null};for(var d=fn;u<o&&(d=Akt(n,s,i,++u,a))===fn;);if(d!==fn||u===o){var h=new pkt(n,d,l,u);return l=u,{value:h,done:!1}}return{done:!0,value:null}}}},gkt=1,ykt=2,$2=4,hZ=8,xN=10,AZ=47,Xw=92,vkt=9,xkt=32,ok=34,Fx=61,wkt=35,bkt=36,Ckt=37,lk=39,ck=40,Mx=41,Skt=95,Pa=45,kkt=33,Bkt=60,_kt=62,Ekt=64,Nkt=91,jkt=93,Tkt=61,Pkt=123,uk=63,Ikt=125,fZ=124,Okt=126,Fkt=128,pZ=65533,rO=42,ip=43,Mkt=44,Lkt=58,Rkt=59,G1=46,Ukt=0,Dkt=8,Qkt=11,Hkt=14,$kt=31,zkt=127,Ic=-1,Wye=48,Gye=97,Yye=101,Vkt=102,Kkt=117,qkt=122,Xye=65,Jye=69,Zye=70,Wkt=85,Gkt=90,Rs=function(e){return e>=Wye&&e<=57},Ykt=function(e){return e>=55296&&e<=57343},mg=function(e){return Rs(e)||e>=Xye&&e<=Zye||e>=Gye&&e<=Vkt},Xkt=function(e){return e>=Gye&&e<=qkt},Jkt=function(e){return e>=Xye&&e<=Gkt},Zkt=function(e){return Xkt(e)||Jkt(e)},eBt=function(e){return e>=Fkt},dk=function(e){return e===xN||e===vkt||e===xkt},wN=function(e){return Zkt(e)||eBt(e)||e===Skt},mZ=function(e){return wN(e)||Rs(e)||e===Pa},tBt=function(e){return e>=Ukt&&e<=Dkt||e===Qkt||e>=Hkt&&e<=$kt||e===zkt},gh=function(e,t){return e!==Xw?!1:t!==xN},hk=function(e,t,n){return e===Pa?wN(t)||gh(t,n):wN(e)?!0:!!(e===Xw&&gh(e,t))},iO=function(e,t,n){return e===ip||e===Pa?Rs(t)?!0:t===G1&&Rs(n):Rs(e===G1?t:e)},nBt=function(e){var t=0,n=1;(e[t]===ip||e[t]===Pa)&&(e[t]===Pa&&(n=-1),t++);for(var r=[];Rs(e[t]);)r.push(e[t++]);var i=r.length?parseInt(ri.apply(void 0,r),10):0;e[t]===G1&&t++;for(var s=[];Rs(e[t]);)s.push(e[t++]);var a=s.length,o=a?parseInt(ri.apply(void 0,s),10):0;(e[t]===Jye||e[t]===Yye)&&t++;var l=1;(e[t]===ip||e[t]===Pa)&&(e[t]===Pa&&(l=-1),t++);for(var u=[];Rs(e[t]);)u.push(e[t++]);var d=u.length?parseInt(ri.apply(void 0,u),10):0;return n*(i+o*Math.pow(10,-a))*Math.pow(10,l*d)},rBt={type:2},iBt={type:3},sBt={type:4},aBt={type:13},oBt={type:8},lBt={type:21},cBt={type:9},uBt={type:10},dBt={type:11},hBt={type:12},ABt={type:14},Ak={type:23},fBt={type:1},pBt={type:25},mBt={type:24},gBt={type:26},yBt={type:27},vBt={type:28},xBt={type:29},wBt={type:31},BR={type:32},e0e=function(){function e(){this._value=[]}return e.prototype.write=function(t){this._value=this._value.concat(Z5(t))},e.prototype.read=function(){for(var t=[],n=this.consumeToken();n!==BR;)t.push(n),n=this.consumeToken();return t},e.prototype.consumeToken=function(){var t=this.consumeCodePoint();switch(t){case ok:return this.consumeStringToken(ok);case wkt:var n=this.peekCodePoint(0),r=this.peekCodePoint(1),i=this.peekCodePoint(2);if(mZ(n)||gh(r,i)){var s=hk(n,r,i)?ykt:gkt,a=this.consumeName();return{type:5,value:a,flags:s}}break;case bkt:if(this.peekCodePoint(0)===Fx)return this.consumeCodePoint(),aBt;break;case lk:return this.consumeStringToken(lk);case ck:return rBt;case Mx:return iBt;case rO:if(this.peekCodePoint(0)===Fx)return this.consumeCodePoint(),ABt;break;case ip:if(iO(t,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(t),this.consumeNumericToken();break;case Mkt:return sBt;case Pa:var o=t,l=this.peekCodePoint(0),u=this.peekCodePoint(1);if(iO(o,l,u))return this.reconsumeCodePoint(t),this.consumeNumericToken();if(hk(o,l,u))return this.reconsumeCodePoint(t),this.consumeIdentLikeToken();if(l===Pa&&u===_kt)return this.consumeCodePoint(),this.consumeCodePoint(),mBt;break;case G1:if(iO(t,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(t),this.consumeNumericToken();break;case AZ:if(this.peekCodePoint(0)===rO)for(this.consumeCodePoint();;){var d=this.consumeCodePoint();if(d===rO&&(d=this.consumeCodePoint(),d===AZ))return this.consumeToken();if(d===Ic)return this.consumeToken()}break;case Lkt:return gBt;case Rkt:return yBt;case Bkt:if(this.peekCodePoint(0)===kkt&&this.peekCodePoint(1)===Pa&&this.peekCodePoint(2)===Pa)return this.consumeCodePoint(),this.consumeCodePoint(),pBt;break;case Ekt:var h=this.peekCodePoint(0),f=this.peekCodePoint(1),A=this.peekCodePoint(2);if(hk(h,f,A)){var a=this.consumeName();return{type:7,value:a}}break;case Nkt:return vBt;case Xw:if(gh(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),this.consumeIdentLikeToken();break;case jkt:return xBt;case Tkt:if(this.peekCodePoint(0)===Fx)return this.consumeCodePoint(),oBt;break;case Pkt:return dBt;case Ikt:return hBt;case Kkt:case Wkt:var p=this.peekCodePoint(0),m=this.peekCodePoint(1);return p===ip&&(mg(m)||m===uk)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(t),this.consumeIdentLikeToken();case fZ:if(this.peekCodePoint(0)===Fx)return this.consumeCodePoint(),cBt;if(this.peekCodePoint(0)===fZ)return this.consumeCodePoint(),lBt;break;case Okt:if(this.peekCodePoint(0)===Fx)return this.consumeCodePoint(),uBt;break;case Ic:return BR}return dk(t)?(this.consumeWhiteSpace(),wBt):Rs(t)?(this.reconsumeCodePoint(t),this.consumeNumericToken()):wN(t)?(this.reconsumeCodePoint(t),this.consumeIdentLikeToken()):{type:6,value:ri(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();mg(n)&&t.length<6;)t.push(n),n=this.consumeCodePoint();for(var r=!1;n===uk&&t.length<6;)t.push(n),n=this.consumeCodePoint(),r=!0;if(r){var i=parseInt(ri.apply(void 0,t.map(function(l){return l===uk?Wye:l})),16),s=parseInt(ri.apply(void 0,t.map(function(l){return l===uk?Zye:l})),16);return{type:30,start:i,end:s}}var a=parseInt(ri.apply(void 0,t),16);if(this.peekCodePoint(0)===Pa&&mg(this.peekCodePoint(1))){this.consumeCodePoint(),n=this.consumeCodePoint();for(var o=[];mg(n)&&o.length<6;)o.push(n),n=this.consumeCodePoint();var s=parseInt(ri.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)===ck?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===ck?(this.consumeCodePoint(),{type:19,value:t}):{type:20,value:t}},e.prototype.consumeUrlToken=function(){var t=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===Ic)return{type:22,value:""};var n=this.peekCodePoint(0);if(n===lk||n===ok){var r=this.consumeStringToken(this.consumeCodePoint());return r.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===Ic||this.peekCodePoint(0)===Mx)?(this.consumeCodePoint(),{type:22,value:r.value}):(this.consumeBadUrlRemnants(),Ak)}for(;;){var i=this.consumeCodePoint();if(i===Ic||i===Mx)return{type:22,value:ri.apply(void 0,t)};if(dk(i))return this.consumeWhiteSpace(),this.peekCodePoint(0)===Ic||this.peekCodePoint(0)===Mx?(this.consumeCodePoint(),{type:22,value:ri.apply(void 0,t)}):(this.consumeBadUrlRemnants(),Ak);if(i===ok||i===lk||i===ck||tBt(i))return this.consumeBadUrlRemnants(),Ak;if(i===Xw)if(gh(i,this.peekCodePoint(0)))t.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),Ak;else t.push(i)}},e.prototype.consumeWhiteSpace=function(){for(;dk(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var t=this.consumeCodePoint();if(t===Mx||t===Ic)return;gh(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+=ri.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===Ic||i===void 0||i===t)return n+=this.consumeStringSlice(r),{type:0,value:n};if(i===xN)return this._value.splice(0,r),fBt;if(i===Xw){var s=this._value[r+1];s!==Ic&&s!==void 0&&(s===xN?(n+=this.consumeStringSlice(r),r=-1,this._value.shift()):gh(i,s)&&(n+=this.consumeStringSlice(r),n+=ri(this.consumeEscapedCodePoint()),r=-1))}r++}while(!0)},e.prototype.consumeNumber=function(){var t=[],n=$2,r=this.peekCodePoint(0);for((r===ip||r===Pa)&&t.push(this.consumeCodePoint());Rs(this.peekCodePoint(0));)t.push(this.consumeCodePoint());r=this.peekCodePoint(0);var i=this.peekCodePoint(1);if(r===G1&&Rs(i))for(t.push(this.consumeCodePoint(),this.consumeCodePoint()),n=hZ;Rs(this.peekCodePoint(0));)t.push(this.consumeCodePoint());r=this.peekCodePoint(0),i=this.peekCodePoint(1);var s=this.peekCodePoint(2);if((r===Jye||r===Yye)&&((i===ip||i===Pa)&&Rs(s)||Rs(i)))for(t.push(this.consumeCodePoint(),this.consumeCodePoint()),n=hZ;Rs(this.peekCodePoint(0));)t.push(this.consumeCodePoint());return[nBt(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(hk(i,s,a)){var o=this.consumeName();return{type:15,number:n,flags:r,unit:o}}return i===Ckt?(this.consumeCodePoint(),{type:16,number:n,flags:r}):{type:17,number:n,flags:r}},e.prototype.consumeEscapedCodePoint=function(){var t=this.consumeCodePoint();if(mg(t)){for(var n=ri(t);mg(this.peekCodePoint(0))&&n.length<6;)n+=ri(this.consumeCodePoint());dk(this.peekCodePoint(0))&&this.consumeCodePoint();var r=parseInt(n,16);return r===0||Ykt(r)||r>1114111?pZ:r}return t===Ic?pZ:t},e.prototype.consumeName=function(){for(var t="";;){var n=this.consumeCodePoint();if(mZ(n))t+=ri(n);else if(gh(n,this.peekCodePoint(0)))t+=ri(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(n),t}},e}(),t0e=function(){function e(t){this._tokens=t}return e.create=function(t){var n=new e0e;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||CBt(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"?BR:t},e.prototype.reconsumeToken=function(t){this._tokens.unshift(t)},e}(),z2=function(e){return e.type===15},Bv=function(e){return e.type===17},Kn=function(e){return e.type===20},bBt=function(e){return e.type===0},_R=function(e,t){return Kn(e)&&e.value===t},n0e=function(e){return e.type!==31},U0=function(e){return e.type!==31&&e.type!==4},mu=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},CBt=function(e,t){return t===11&&e.type===12||t===28&&e.type===29?!0:t===2&&e.type===3},IA=function(e){return e.type===17||e.type===15},wi=function(e){return e.type===16||IA(e)},r0e=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},xs={type:17,number:0,flags:$2},n$={type:16,number:50,flags:$2},qh={type:16,number:100,flags:$2},sw=function(e,t,n){var r=e[0],i=e[1];return[or(r,t),or(typeof i<"u"?i:r,n)]},or=function(e,t){if(e.type===16)return e.number/100*t;if(z2(e))switch(e.unit){case"rem":case"em":return 16*e.number;case"px":default:return e.number}return e.number},i0e="deg",s0e="grad",a0e="rad",o0e="turn",eT={name:"angle",parse:function(e,t){if(t.type===15)switch(t.unit){case i0e:return Math.PI*t.number/180;case s0e:return Math.PI/200*t.number;case a0e:return t.number;case o0e:return Math.PI*2*t.number}throw new Error("Unsupported angle type")}},l0e=function(e){return e.type===15&&(e.unit===i0e||e.unit===s0e||e.unit===a0e||e.unit===o0e)},c0e=function(e){var t=e.filter(Kn).map(function(n){return n.value}).join(" ");switch(t){case"to bottom right":case"to right bottom":case"left top":case"top left":return[xs,xs];case"to top":case"bottom":return sl(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[xs,qh];case"to right":case"left":return sl(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[qh,qh];case"to bottom":case"top":return sl(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[qh,xs];case"to left":case"right":return sl(270)}return 0},sl=function(e){return Math.PI*e/180},gA={name:"color",parse:function(e,t){if(t.type===18){var n=SBt[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 Wh(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 Wh(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 Wh(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 Wh(parseInt(r,16),parseInt(i,16),parseInt(s,16),parseInt(a,16)/255)}}if(t.type===20){var o=od[t.value.toUpperCase()];if(typeof o<"u")return o}return od.TRANSPARENT}},yA=function(e){return(255&e)===0},zi=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+")"},Wh=function(e,t,n,r){return(e<<24|t<<16|n<<8|Math.round(r*255)<<0)>>>0},gZ=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},yZ=function(e,t){var n=t.filter(U0);if(n.length===3){var r=n.map(gZ),i=r[0],s=r[1],a=r[2];return Wh(i,s,a,1)}if(n.length===4){var o=n.map(gZ),i=o[0],s=o[1],a=o[2],l=o[3];return Wh(i,s,a,l)}return 0};function sO(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 vZ=function(e,t){var n=t.filter(U0),r=n[0],i=n[1],s=n[2],a=n[3],o=(r.type===17?sl(r.number):eT.parse(e,r))/(Math.PI*2),l=wi(i)?i.number/100:0,u=wi(s)?s.number/100:0,d=typeof a<"u"&&wi(a)?or(a,1):1;if(l===0)return Wh(u*255,u*255,u*255,1);var h=u<=.5?u*(l+1):u+l-u*l,f=u*2-h,A=sO(f,h,o+1/3),p=sO(f,h,o),m=sO(f,h,o-1/3);return Wh(A*255,p*255,m*255,d)},SBt={hsl:vZ,hsla:vZ,rgb:yZ,rgba:yZ},Jw=function(e,t){return gA.parse(e,t0e.create(t).parseComponentValue())},od={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},kBt={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(n){if(Kn(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"},tT=function(e,t){var n=gA.parse(e,t[0]),r=t[1];return r&&wi(r)?{color:n,stop:r}:{color:n,stop:null}},xZ=function(e,t){var n=e[0],r=e[e.length-1];n.stop===null&&(n.stop=xs),r.stop===null&&(r.stop=qh);for(var i=[],s=0,a=0;a<e.length;a++){var o=e[a].stop;if(o!==null){var l=or(o,t);l>s?i.push(l):i.push(s),s=l}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,f=i[u-1],A=(d-f)/(h+1),p=1;p<=h;p++)i[u+p-1]=A*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)}})},_Bt=function(e,t,n){var r=t/2,i=n/2,s=or(e[0],t)-r,a=i-or(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:_Bt(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,l=Math.sin(r-Math.PI/2)*o,u=Math.cos(r-Math.PI/2)*o;return[i,s-u,s+u,a-l,a+l]},Ll=function(e,t){return Math.sqrt(e*e+t*t)},wZ=function(e,t,n,r,i){var s=[[0,0],[0,t],[e,0],[e,t]];return s.reduce(function(a,o){var l=o[0],u=o[1],d=Ll(n-l,r-u);return(i?d<a.optimumDistance:d>a.optimumDistance)?{optimumCorner:o,optimumDistance:d}:a},{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},NBt=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(Ll(t,n),Ll(t,n-i),Ll(t-r,n),Ll(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)),l=wZ(r,i,t,n,!0),u=l[0],d=l[1];s=Ll(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(Ll(t,n),Ll(t,n-i),Ll(t-r,n),Ll(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=wZ(r,i,t,n,!1),u=h[0],d=h[1];s=Ll(u-t,(d-n)/o),a=o*s}break}return Array.isArray(e.size)&&(s=or(e.size[0],r),a=e.size.length===2?or(e.size[1],i):s),[s,a]},jBt=function(e,t){var n=sl(180),r=[];return mu(t).forEach(function(i,s){if(s===0){var a=i[0];if(a.type===20&&a.value==="to"){n=c0e(i);return}else if(l0e(a)){n=eT.parse(e,a);return}}var o=tT(e,i);r.push(o)}),{angle:n,stops:r,type:1}},fk=function(e,t){var n=sl(180),r=[];return mu(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=c0e(i);return}else if(l0e(a)){n=(eT.parse(e,a)+sl(270))%sl(360);return}}var o=tT(e,i);r.push(o)}),{angle:n,stops:r,type:1}},TBt=function(e,t){var n=sl(180),r=[],i=1,s=0,a=3,o=[];return mu(t).forEach(function(l,u){var d=l[0];if(u===0){if(Kn(d)&&d.value==="linear"){i=1;return}else if(Kn(d)&&d.value==="radial"){i=2;return}}if(d.type===18){if(d.name==="from"){var h=gA.parse(e,d.values[0]);r.push({stop:xs,color:h})}else if(d.name==="to"){var h=gA.parse(e,d.values[0]);r.push({stop:qh,color:h})}else if(d.name==="color-stop"){var f=d.values.filter(U0);if(f.length===2){var h=gA.parse(e,f[1]),A=f[0];Bv(A)&&r.push({stop:{type:16,number:A.number*100,flags:A.flags},color:h})}}}}),i===1?{angle:(n+sl(180))%sl(360),stops:r,type:i}:{size:a,shape:s,stops:r,position:o,type:i}},u0e="closest-side",d0e="farthest-side",h0e="closest-corner",A0e="farthest-corner",f0e="circle",p0e="ellipse",m0e="cover",g0e="contain",PBt=function(e,t){var n=0,r=3,i=[],s=[];return mu(t).forEach(function(a,o){var l=!0;if(o===0){var u=!1;l=a.reduce(function(h,f){if(u)if(Kn(f))switch(f.value){case"center":return s.push(n$),h;case"top":case"left":return s.push(xs),h;case"right":case"bottom":return s.push(qh),h}else(wi(f)||IA(f))&&s.push(f);else if(Kn(f))switch(f.value){case f0e:return n=0,!1;case p0e:return n=1,!1;case"at":return u=!0,!1;case u0e:return r=0,!1;case m0e:case d0e:return r=1,!1;case g0e:case h0e:return r=2,!1;case A0e:return r=3,!1}else if(IA(f)||wi(f))return Array.isArray(r)||(r=[]),r.push(f),!1;return h},l)}if(l){var d=tT(e,a);i.push(d)}}),{size:r,shape:n,stops:i,position:s,type:2}},pk=function(e,t){var n=0,r=3,i=[],s=[];return mu(t).forEach(function(a,o){var l=!0;if(o===0?l=a.reduce(function(d,h){if(Kn(h))switch(h.value){case"center":return s.push(n$),!1;case"top":case"left":return s.push(xs),!1;case"right":case"bottom":return s.push(qh),!1}else if(wi(h)||IA(h))return s.push(h),!1;return d},l):o===1&&(l=a.reduce(function(d,h){if(Kn(h))switch(h.value){case f0e:return n=0,!1;case p0e:return n=1,!1;case g0e:case u0e:return r=0,!1;case d0e:return r=1,!1;case h0e:return r=2,!1;case m0e:case A0e:return r=3,!1}else if(IA(h)||wi(h))return Array.isArray(r)||(r=[]),r.push(h),!1;return d},l)),l){var u=tT(e,a);i.push(u)}}),{size:r,shape:n,stops:i,position:s,type:2}},IBt=function(e){return e.type===1},OBt=function(e){return e.type===2},r$={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=y0e[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 FBt(e){return!(e.type===20&&e.value==="none")&&(e.type!==18||!!y0e[e.name])}var y0e={"linear-gradient":jBt,"-moz-linear-gradient":fk,"-ms-linear-gradient":fk,"-o-linear-gradient":fk,"-webkit-linear-gradient":fk,"radial-gradient":PBt,"-moz-radial-gradient":pk,"-ms-radial-gradient":pk,"-o-radial-gradient":pk,"-webkit-radial-gradient":pk,"-webkit-gradient":TBt},MBt={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 U0(r)&&FBt(r)}).map(function(r){return r$.parse(e,r)})}},LBt={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(n){if(Kn(n))switch(n.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},RBt={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,t){return mu(t).map(function(n){return n.filter(wi)}).map(r0e)}},UBt={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,t){return mu(t).map(function(n){return n.filter(Kn).map(function(r){return r.value}).join(" ")}).map(DBt)}},DBt=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}},Ty;(function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"})(Ty||(Ty={}));var QBt={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,t){return mu(t).map(function(n){return n.filter(HBt)})}},HBt=function(e){return Kn(e)||wi(e)},nT=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},$Bt=nT("top"),zBt=nT("right"),VBt=nT("bottom"),KBt=nT("left"),rT=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(t,n){return r0e(n.filter(wi))}}},qBt=rT("top-left"),WBt=rT("top-right"),GBt=rT("bottom-right"),YBt=rT("bottom-left"),iT=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}}},XBt=iT("top"),JBt=iT("right"),ZBt=iT("bottom"),e_t=iT("left"),sT=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(t,n){return z2(n)?n.number:0}}},t_t=sT("top"),n_t=sT("right"),r_t=sT("bottom"),i_t=sT("left"),s_t={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},a_t={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,t){switch(t){case"rtl":return 1;case"ltr":default:return 0}}},o_t={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,t){return t.filter(Kn).reduce(function(n,r){return n|l_t(r.value)},0)}},l_t=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},c_t={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}},u_t={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}},bN;(function(e){e.NORMAL="normal",e.STRICT="strict"})(bN||(bN={}));var d_t={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"strict":return bN.STRICT;case"normal":default:return bN.NORMAL}}},h_t={name:"line-height",initialValue:"normal",prefix:!1,type:4},bZ=function(e,t){return Kn(e)&&e.value==="normal"?1.2*t:e.type===17?t*e.number:wi(e)?or(e,t):t},A_t={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,t){return t.type===20&&t.value==="none"?null:r$.parse(e,t)}},f_t={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}}},ER={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}}},aT=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},p_t=aT("top"),m_t=aT("right"),g_t=aT("bottom"),y_t=aT("left"),v_t={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,t){return t.filter(Kn).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}})}},x_t={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"}}},oT=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},w_t=oT("top"),b_t=oT("right"),C_t=oT("bottom"),S_t=oT("left"),k_t={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}}},B_t={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}},__t={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.length===1&&_R(t[0],"none")?[]:mu(t).map(function(n){for(var r={color:od.TRANSPARENT,offsetX:xs,offsetY:xs,blur:xs},i=0,s=0;s<n.length;s++){var a=n[s];IA(a)?(i===0?r.offsetX=a:i===1?r.offsetY=a:r.blur=a,i++):r.color=gA.parse(e,a)}return r})}},E_t={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}},N_t={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=P_t[t.name];if(typeof n>"u")throw new Error('Attempting to parse an unsupported transform function "'+t.name+'"');return n(t.values)}return null}},j_t=function(e){var t=e.filter(function(n){return n.type===17}).map(function(n){return n.number});return t.length===6?t:null},T_t=function(e){var t=e.filter(function(l){return l.type===17}).map(function(l){return l.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},P_t={matrix:j_t,matrix3d:T_t},CZ={type:16,number:50,flags:$2},I_t=[CZ,CZ],O_t={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(e,t){var n=t.filter(wi);return n.length!==2?I_t:[n[0],n[1]]}},F_t={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}}},Zw;(function(e){e.NORMAL="normal",e.BREAK_ALL="break-all",e.KEEP_ALL="keep-all"})(Zw||(Zw={}));var M_t={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-all":return Zw.BREAK_ALL;case"keep-all":return Zw.KEEP_ALL;case"normal":default:return Zw.NORMAL}}},L_t={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(e,t){if(t.type===20)return{auto:!0,order:0};if(Bv(t))return{auto:!1,order:t.number};throw new Error("Invalid z-index number parsed")}},v0e={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")}},R_t={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(e,t){return Bv(t)?t.number:1}},U_t={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},D_t={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(e,t){return t.filter(Kn).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})}},Q_t={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+"'"})}},H_t={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},$_t={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(e,t){if(Bv(t))return t.number;if(Kn(t))switch(t.value){case"bold":return 700;case"normal":default:return 400}return 400}},z_t={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.filter(Kn).map(function(n){return n.value})}},V_t={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"}}},Fi=function(e,t){return(e&t)!==0},K_t={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}},q_t={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(n0e),s=0;s<i.length;s++){var a=i[s],o=i[s+1];if(a.type===20){var l=o&&Bv(o)?o.number:1;r.push({counter:a.value,increment:l})}}return r}},W_t={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(t.length===0)return[];for(var n=[],r=t.filter(n0e),i=0;i<r.length;i++){var s=r[i],a=r[i+1];if(Kn(s)&&s.value!=="none"){var o=a&&Bv(a)?a.number:0;n.push({counter:s.value,reset:o})}}return n}},G_t={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(e,t){return t.filter(z2).map(function(n){return v0e.parse(e,n)})}},Y_t={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(bBt);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}},SZ=function(e,t,n){if(!e)return"";var r=e[Math.min(t,e.length-1)];return r?n?r.open:r.close:""},X_t={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.length===1&&_R(t[0],"none")?[]:mu(t).map(function(n){for(var r={color:255,offsetX:xs,offsetY:xs,blur:xs,spread:xs,inset:!1},i=0,s=0;s<n.length;s++){var a=n[s];_R(a,"inset")?r.inset=!0:IA(a)?(i===0?r.offsetX=a:i===1?r.offsetY=a:i===2?r.blur=a:r.spread=a,i++):r.color=gA.parse(e,a)}return r})}},J_t={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(e,t){var n=[0,1,2],r=[];return t.filter(Kn).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}},Z_t={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},eEt={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return z2(t)?t.number:0}},tEt=function(){function e(t,n){var r,i;this.animationDuration=it(t,G_t,n.animationDuration),this.backgroundClip=it(t,kBt,n.backgroundClip),this.backgroundColor=it(t,BBt,n.backgroundColor),this.backgroundImage=it(t,MBt,n.backgroundImage),this.backgroundOrigin=it(t,LBt,n.backgroundOrigin),this.backgroundPosition=it(t,RBt,n.backgroundPosition),this.backgroundRepeat=it(t,UBt,n.backgroundRepeat),this.backgroundSize=it(t,QBt,n.backgroundSize),this.borderTopColor=it(t,$Bt,n.borderTopColor),this.borderRightColor=it(t,zBt,n.borderRightColor),this.borderBottomColor=it(t,VBt,n.borderBottomColor),this.borderLeftColor=it(t,KBt,n.borderLeftColor),this.borderTopLeftRadius=it(t,qBt,n.borderTopLeftRadius),this.borderTopRightRadius=it(t,WBt,n.borderTopRightRadius),this.borderBottomRightRadius=it(t,GBt,n.borderBottomRightRadius),this.borderBottomLeftRadius=it(t,YBt,n.borderBottomLeftRadius),this.borderTopStyle=it(t,XBt,n.borderTopStyle),this.borderRightStyle=it(t,JBt,n.borderRightStyle),this.borderBottomStyle=it(t,ZBt,n.borderBottomStyle),this.borderLeftStyle=it(t,e_t,n.borderLeftStyle),this.borderTopWidth=it(t,t_t,n.borderTopWidth),this.borderRightWidth=it(t,n_t,n.borderRightWidth),this.borderBottomWidth=it(t,r_t,n.borderBottomWidth),this.borderLeftWidth=it(t,i_t,n.borderLeftWidth),this.boxShadow=it(t,X_t,n.boxShadow),this.color=it(t,s_t,n.color),this.direction=it(t,a_t,n.direction),this.display=it(t,o_t,n.display),this.float=it(t,c_t,n.cssFloat),this.fontFamily=it(t,Q_t,n.fontFamily),this.fontSize=it(t,H_t,n.fontSize),this.fontStyle=it(t,V_t,n.fontStyle),this.fontVariant=it(t,z_t,n.fontVariant),this.fontWeight=it(t,$_t,n.fontWeight),this.letterSpacing=it(t,u_t,n.letterSpacing),this.lineBreak=it(t,d_t,n.lineBreak),this.lineHeight=it(t,h_t,n.lineHeight),this.listStyleImage=it(t,A_t,n.listStyleImage),this.listStylePosition=it(t,f_t,n.listStylePosition),this.listStyleType=it(t,ER,n.listStyleType),this.marginTop=it(t,p_t,n.marginTop),this.marginRight=it(t,m_t,n.marginRight),this.marginBottom=it(t,g_t,n.marginBottom),this.marginLeft=it(t,y_t,n.marginLeft),this.opacity=it(t,R_t,n.opacity);var s=it(t,v_t,n.overflow);this.overflowX=s[0],this.overflowY=s[s.length>1?1:0],this.overflowWrap=it(t,x_t,n.overflowWrap),this.paddingTop=it(t,w_t,n.paddingTop),this.paddingRight=it(t,b_t,n.paddingRight),this.paddingBottom=it(t,C_t,n.paddingBottom),this.paddingLeft=it(t,S_t,n.paddingLeft),this.paintOrder=it(t,J_t,n.paintOrder),this.position=it(t,B_t,n.position),this.textAlign=it(t,k_t,n.textAlign),this.textDecorationColor=it(t,U_t,(r=n.textDecorationColor)!==null&&r!==void 0?r:n.color),this.textDecorationLine=it(t,D_t,(i=n.textDecorationLine)!==null&&i!==void 0?i:n.textDecoration),this.textShadow=it(t,__t,n.textShadow),this.textTransform=it(t,E_t,n.textTransform),this.transform=it(t,N_t,n.transform),this.transformOrigin=it(t,O_t,n.transformOrigin),this.visibility=it(t,F_t,n.visibility),this.webkitTextStrokeColor=it(t,Z_t,n.webkitTextStrokeColor),this.webkitTextStrokeWidth=it(t,eEt,n.webkitTextStrokeWidth),this.wordBreak=it(t,M_t,n.wordBreak),this.zIndex=it(t,L_t,n.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},e.prototype.isTransparent=function(){return yA(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 Fi(this.display,4)||Fi(this.display,33554432)||Fi(this.display,268435456)||Fi(this.display,536870912)||Fi(this.display,67108864)||Fi(this.display,134217728)},e}(),nEt=function(){function e(t,n){this.content=it(t,K_t,n.content),this.quotes=it(t,Y_t,n.quotes)}return e}(),kZ=function(){function e(t,n){this.counterIncrement=it(t,q_t,n.counterIncrement),this.counterReset=it(t,W_t,n.counterReset)}return e}(),it=function(e,t,n){var r=new e0e,i=n!==null&&typeof n<"u"?n.toString():t.initialValue;r.write(i);var s=new t0e(r.read());switch(t.type){case 2:var a=s.parseComponentValue();return t.parse(e,Kn(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 eT.parse(e,s.parseComponentValue());case"color":return gA.parse(e,s.parseComponentValue());case"image":return r$.parse(e,s.parseComponentValue());case"length":var o=s.parseComponentValue();return IA(o)?o:xs;case"length-percentage":var l=s.parseComponentValue();return wi(l)?l:xs;case"time":return v0e.parse(e,s.parseComponentValue())}break}},rEt="data-html2canvas-debug",iEt=function(e){var t=e.getAttribute(rEt);switch(t){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},NR=function(e,t){var n=iEt(e);return n===1||t===n},gu=function(){function e(t,n){if(this.context=t,this.textNodes=[],this.elements=[],this.flags=0,NR(n,3))debugger;this.styles=new tEt(t,window.getComputedStyle(n,null)),PR(n)&&(this.styles.animationDuration.some(function(r){return r>0})&&(n.style.animationDuration="0s"),this.styles.transform!==null&&(n.style.transform="none")),this.bounds=J5(this.context,n),NR(n,4)&&(this.flags|=16)}return e}(),sEt="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",BZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",aw=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var mk=0;mk<BZ.length;mk++)aw[BZ.charCodeAt(mk)]=mk;var aEt=function(e){var t=e.length*.75,n=e.length,r,i=0,s,a,o,l;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=aw[e.charCodeAt(r)],a=aw[e.charCodeAt(r+1)],o=aw[e.charCodeAt(r+2)],l=aw[e.charCodeAt(r+3)],d[i++]=s<<2|a>>4,d[i++]=(a&15)<<4|o>>2,d[i++]=(o&3)<<6|l&63;return u},oEt=function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n.push(e[r+1]<<8|e[r]);return n},lEt=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},Np=5,i$=11,aO=2,cEt=i$-Np,x0e=65536>>Np,uEt=1<<Np,oO=uEt-1,dEt=1024>>Np,hEt=x0e+dEt,AEt=hEt,fEt=32,pEt=AEt+fEt,mEt=65536>>i$,gEt=1<<cEt,yEt=gEt-1,_Z=function(e,t,n){return e.slice?e.slice(t,n):new Uint16Array(Array.prototype.slice.call(e,t,n))},vEt=function(e,t,n){return e.slice?e.slice(t,n):new Uint32Array(Array.prototype.slice.call(e,t,n))},xEt=function(e,t){var n=aEt(e),r=Array.isArray(n)?lEt(n):new Uint32Array(n),i=Array.isArray(n)?oEt(n):new Uint16Array(n),s=24,a=_Z(i,s/2,r[4]/2),o=r[5]===2?_Z(i,(s+r[4])/2):vEt(r,Math.ceil((s+r[4])/4));return new wEt(r[0],r[1],r[2],r[3],a,o)},wEt=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>>Np],n=(n<<aO)+(t&oO),this.data[n];if(t<=65535)return n=this.index[x0e+(t-55296>>Np)],n=(n<<aO)+(t&oO),this.data[n];if(t<this.highStart)return n=pEt-mEt+(t>>i$),n=this.index[n],n+=t>>Np&yEt,n=this.index[n],n=(n<<aO)+(t&oO),this.data[n];if(t<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),EZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bEt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var gk=0;gk<EZ.length;gk++)bEt[EZ.charCodeAt(gk)]=gk;var CEt=1,lO=2,cO=3,NZ=4,jZ=5,SEt=7,TZ=8,uO=9,dO=10,PZ=11,IZ=12,OZ=13,FZ=14,hO=15,kEt=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},_Et=xEt(sEt),Vo="×",AO="÷",EEt=function(e){return _Et.get(e)},NEt=function(e,t,n){var r=n-2,i=t[r],s=t[n-1],a=t[n];if(s===lO&&a===cO)return Vo;if(s===lO||s===cO||s===NZ||a===lO||a===cO||a===NZ)return AO;if(s===TZ&&[TZ,uO,PZ,IZ].indexOf(a)!==-1||(s===PZ||s===uO)&&(a===uO||a===dO)||(s===IZ||s===dO)&&a===dO||a===OZ||a===jZ||a===SEt||s===CEt)return Vo;if(s===OZ&&a===FZ){for(;i===jZ;)i=t[--r];if(i===FZ)return Vo}if(s===hO&&a===hO){for(var o=0;i===hO;)o++,i=t[--r];if(o%2===0)return Vo}return AO},jEt=function(e){var t=kEt(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=Vo;r<n&&(a=NEt(t,s,++r))===Vo;);if(a!==Vo||r===n){var o=BEt.apply(null,t.slice(i,r));return i=r,{value:o,done:!1}}return{done:!0,value:null}}}},TEt=function(e){for(var t=jEt(e),n=[],r;!(r=t.next()).done;)r.value&&n.push(r.value.slice());return n},PEt=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},IEt=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=Z5(r.data).map(function(l){return ri(l)}),s=0,a={},o=i.every(function(l,u){n.setStart(r,s),n.setEnd(r,s+l.length);var d=n.getBoundingClientRect();s+=l.length;var h=d.x>a.x||d.y>a.y;return a=d,u===0?!0:h});return e.body.removeChild(t),o},OEt=function(){return typeof new Image().crossOrigin<"u"},FEt=function(){return typeof new XMLHttpRequest().responseType=="string"},MEt=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},MZ=function(e){return e[0]===0&&e[1]===255&&e[2]===0&&e[3]===255},LEt=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=jR(n,n,0,0,i);return r.fillStyle="red",r.fillRect(0,0,n,n),LZ(a).then(function(o){r.drawImage(o,0,0);var l=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",MZ(l)?LZ(jR(n,n,0,0,u)):Promise.reject(!1)}).then(function(o){return r.drawImage(o,0,0),MZ(r.getImageData(0,0,n,n).data)}).catch(function(){return!1})},jR=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},LZ=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))})},ps={get SUPPORT_RANGE_BOUNDS(){var e=PEt(document);return Object.defineProperty(ps,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=ps.SUPPORT_RANGE_BOUNDS&&IEt(document);return Object.defineProperty(ps,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=MEt(document);return Object.defineProperty(ps,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e=typeof Array.from=="function"&&typeof window.fetch=="function"?LEt(document):Promise.resolve(!1);return Object.defineProperty(ps,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=OEt();return Object.defineProperty(ps,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e=FEt();return Object.defineProperty(ps,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(ps,"SUPPORT_CORS_XHR",{value:e}),e},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var e=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(ps,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:e}),e}},eb=function(){function e(t,n){this.text=t,this.bounds=n}return e}(),REt=function(e,t,n,r){var i=QEt(t,n),s=[],a=0;return i.forEach(function(o){if(n.textDecorationLine.length||o.trim().length>0)if(ps.SUPPORT_RANGE_BOUNDS){var l=RZ(r,a,o.length).getClientRects();if(l.length>1){var u=s$(o),d=0;u.forEach(function(f){s.push(new eb(f,wd.fromDOMRectList(e,RZ(r,d+a,f.length).getClientRects()))),d+=f.length})}else s.push(new eb(o,wd.fromDOMRectList(e,l)))}else{var h=r.splitText(o.length);s.push(new eb(o,UEt(e,r))),r=h}else ps.SUPPORT_RANGE_BOUNDS||(r=r.splitText(o.length));a+=o.length}),s},UEt=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=J5(e,r);return r.firstChild&&i.replaceChild(r.firstChild,r),s}}return wd.EMPTY},RZ=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},s$=function(e){if(ps.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 TEt(e)},DEt=function(e,t){if(ps.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 $Et(e,t)},QEt=function(e,t){return t.letterSpacing!==0?s$(e):DEt(e,t)},HEt=[32,160,4961,65792,65793,4153,4241],$Et=function(e,t){for(var n=mkt(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=Z5(a),l="";o.forEach(function(u){HEt.indexOf(u)===-1?l+=ri(u):(l.length&&r.push(l),r.push(ri(u)),l="")}),l.length&&r.push(l)}};!(i=n.next()).done;)s();return r},zEt=function(){function e(t,n,r){this.text=VEt(n.data,r.textTransform),this.textBounds=REt(t,this.text,r,n)}return e}(),VEt=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(KEt,qEt);case 2:return e.toUpperCase();default:return e}},KEt=/(^|\s|:|-|\(|\))([a-z])/g,qEt=function(e,t,n){return e.length>0?t+n.toUpperCase():e},w0e=function(e){wc(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}(gu),b0e=function(e){wc(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}(gu),C0e=function(e){wc(t,e);function t(n,r){var i=e.call(this,n,r)||this,s=new XMLSerializer,a=J5(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}(gu),S0e=function(e){wc(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.value=r.value,i}return t}(gu),TR=function(e){wc(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}(gu),WEt=[{type:15,flags:0,unit:"px",number:3}],GEt=[{type:16,flags:0,number:50}],YEt=function(e){return e.width>e.height?new wd(e.left+(e.width-e.height)/2,e.top,e.height,e.height):e.width<e.height?new wd(e.left,e.top+(e.height-e.width)/2,e.width,e.width):e},XEt=function(e){var t=e.type===JEt?new Array(e.value.length+1).join("•"):e.value;return t.length===0?e.placeholder||"":t},CN="checkbox",SN="radio",JEt="password",UZ=707406591,a$=function(e){wc(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=XEt(r),(i.type===CN||i.type===SN)&&(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=YEt(i.bounds)),i.type){case CN:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=WEt;break;case SN:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=GEt;break}return i}return t}(gu),k0e=function(e){wc(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}(gu),B0e=function(e){wc(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.value=r.value,i}return t}(gu),_0e=function(e){wc(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=N0e(n,r.contentWindow.document.documentElement);var s=r.contentWindow.document.documentElement?Jw(n,getComputedStyle(r.contentWindow.document.documentElement).backgroundColor):od.TRANSPARENT,a=r.contentWindow.document.body?Jw(n,getComputedStyle(r.contentWindow.document.body).backgroundColor):od.TRANSPARENT;i.backgroundColor=yA(s)?yA(a)?i.styles.backgroundColor:a:s}}catch{}return i}return t}(gu),ZEt=["OL","UL","MENU"],mB=function(e,t,n,r){for(var i=t.firstChild,s=void 0;i;i=s)if(s=i.nextSibling,j0e(i)&&i.data.trim().length>0)n.textNodes.push(new zEt(e,i,n.styles));else if(Zg(i))if(O0e(i)&&i.assignedNodes)i.assignedNodes().forEach(function(o){return mB(e,o,n,r)});else{var a=E0e(e,i);a.styles.isVisible()&&(eNt(i,a,r)?a.flags|=4:tNt(a.styles)&&(a.flags|=2),ZEt.indexOf(i.tagName)!==-1&&(a.flags|=8),n.elements.push(a),i.slot,i.shadowRoot?mB(e,i.shadowRoot,a,r):!kN(i)&&!T0e(i)&&!BN(i)&&mB(e,i,a,r))}},E0e=function(e,t){return IR(t)?new w0e(e,t):P0e(t)?new b0e(e,t):T0e(t)?new C0e(e,t):nNt(t)?new S0e(e,t):rNt(t)?new TR(e,t):iNt(t)?new a$(e,t):BN(t)?new k0e(e,t):kN(t)?new B0e(e,t):I0e(t)?new _0e(e,t):new gu(e,t)},N0e=function(e,t){var n=E0e(e,t);return n.flags|=4,mB(e,t,n,n),n},eNt=function(e,t,n){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||o$(e)&&n.styles.isTransparent()},tNt=function(e){return e.isPositioned()||e.isFloating()},j0e=function(e){return e.nodeType===Node.TEXT_NODE},Zg=function(e){return e.nodeType===Node.ELEMENT_NODE},PR=function(e){return Zg(e)&&typeof e.style<"u"&&!gB(e)},gB=function(e){return typeof e.className=="object"},nNt=function(e){return e.tagName==="LI"},rNt=function(e){return e.tagName==="OL"},iNt=function(e){return e.tagName==="INPUT"},sNt=function(e){return e.tagName==="HTML"},T0e=function(e){return e.tagName==="svg"},o$=function(e){return e.tagName==="BODY"},P0e=function(e){return e.tagName==="CANVAS"},DZ=function(e){return e.tagName==="VIDEO"},IR=function(e){return e.tagName==="IMG"},I0e=function(e){return e.tagName==="IFRAME"},QZ=function(e){return e.tagName==="STYLE"},aNt=function(e){return e.tagName==="SCRIPT"},kN=function(e){return e.tagName==="TEXTAREA"},BN=function(e){return e.tagName==="SELECT"},O0e=function(e){return e.tagName==="SLOT"},HZ=function(e){return e.tagName.indexOf("-")>0},oNt=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 l=n.counters[o.counter];l&&o.increment!==0&&(s=!1,l.length||l.push(1),l[Math.max(0,l.length-1)]+=o.increment)});var a=[];return s&&i.forEach(function(o){var l=n.counters[o.counter];a.push(o.counter),l||(l=n.counters[o.counter]=[]),l.push(o.reset)}),a},e}(),$Z={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"]},zZ={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:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},lNt={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:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},cNt={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:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},gg=function(e,t,n,r,i,s){return e<t||e>n?Y1(e,i,s.length>0):r.integers.reduce(function(a,o,l){for(;e>=o;)e-=o,a+=r.values[l];return a},"")+s},F0e=function(e,t,n,r){var i="";do n||e--,i=r(e)+i,e/=t;while(e*t>=t);return i},ni=function(e,t,n,r,i){var s=n-t+1;return(e<0?"-":"")+(F0e(Math.abs(e),s,r,function(a){return ri(Math.floor(a%s)+t)})+i)},kf=function(e,t,n){n===void 0&&(n=". ");var r=t.length;return F0e(Math.abs(e),r,!1,function(i){return t[Math.floor(i%r)]})+n},Ng=1,lh=2,ch=4,ow=8,Ru=function(e,t,n,r,i,s){if(e<-9999||e>9999)return Y1(e,4,i.length>0);var a=Math.abs(e),o=i;if(a===0)return t[0]+o;for(var l=0;a>0&&l<=4;l++){var u=a%10;u===0&&Fi(s,Ng)&&o!==""?o=t[u]+o:u>1||u===1&&l===0||u===1&&l===1&&Fi(s,lh)||u===1&&l===1&&Fi(s,ch)&&e>100||u===1&&l>1&&Fi(s,ow)?o=t[u]+(l>0?n[l-1]:"")+o:u===1&&l>0&&(o=n[l-1]+o),a=Math.floor(a/10)}return(e<0?r:"")+o},VZ="十百千萬",KZ="拾佰仟萬",qZ="マイナス",fO="마이너스",Y1=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=ni(e,48,57,!0,r);return o.length<4?"0"+o:o;case 4:return kf(e,"〇一二三四五六七八九",i);case 6:return gg(e,1,3999,$Z,3,r).toLowerCase();case 7:return gg(e,1,3999,$Z,3,r);case 8:return ni(e,945,969,!1,r);case 9:return ni(e,97,122,!1,r);case 10:return ni(e,65,90,!1,r);case 11:return ni(e,1632,1641,!0,r);case 12:case 49:return gg(e,1,9999,zZ,3,r);case 35:return gg(e,1,9999,zZ,3,r).toLowerCase();case 13:return ni(e,2534,2543,!0,r);case 14:case 30:return ni(e,6112,6121,!0,r);case 15:return kf(e,"子丑寅卯辰巳午未申酉戌亥",i);case 16:return kf(e,"甲乙丙丁戊己庚辛壬癸",i);case 17:case 48:return Ru(e,"零一二三四五六七八九",VZ,"負",i,lh|ch|ow);case 47:return Ru(e,"零壹貳參肆伍陸柒捌玖",KZ,"負",i,Ng|lh|ch|ow);case 42:return Ru(e,"零一二三四五六七八九",VZ,"负",i,lh|ch|ow);case 41:return Ru(e,"零壹贰叁肆伍陆柒捌玖",KZ,"负",i,Ng|lh|ch|ow);case 26:return Ru(e,"〇一二三四五六七八九","十百千万",qZ,i,0);case 25:return Ru(e,"零壱弐参四伍六七八九","拾百千万",qZ,i,Ng|lh|ch);case 31:return Ru(e,"영일이삼사오육칠팔구","십백천만",fO,s,Ng|lh|ch);case 33:return Ru(e,"零一二三四五六七八九","十百千萬",fO,s,0);case 32:return Ru(e,"零壹貳參四五六七八九","拾百千",fO,s,Ng|lh|ch);case 18:return ni(e,2406,2415,!0,r);case 20:return gg(e,1,19999,cNt,3,r);case 21:return ni(e,2790,2799,!0,r);case 22:return ni(e,2662,2671,!0,r);case 22:return gg(e,1,10999,lNt,3,r);case 23:return kf(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return kf(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return ni(e,3302,3311,!0,r);case 28:return kf(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",i);case 29:return kf(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",i);case 34:return ni(e,3792,3801,!0,r);case 37:return ni(e,6160,6169,!0,r);case 38:return ni(e,4160,4169,!0,r);case 39:return ni(e,2918,2927,!0,r);case 40:return ni(e,1776,1785,!0,r);case 43:return ni(e,3046,3055,!0,r);case 44:return ni(e,3174,3183,!0,r);case 45:return ni(e,3664,3673,!0,r);case 46:return ni(e,3872,3881,!0,r);case 3:default:return ni(e,48,57,!0,r)}},M0e="data-html2canvas-ignore",WZ=function(){function e(t,n,r){if(this.context=t,this.options=r,this.scrolledElements=[],this.referenceElement=n,this.counters=new oNt,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=uNt(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,l=o.document,u=ANt(i).then(function(){return ia(r,void 0,void 0,function(){var d,h;return Fs(this,function(f){switch(f.label){case 0:return this.scrolledElements.forEach(gNt),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")]:l.fonts&&l.fonts.ready?[4,l.fonts.ready]:[3,2];case 1:f.sent(),f.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,hNt(l)]:[3,4];case 3:f.sent(),f.label=4;case 4:return typeof d=="function"?[2,Promise.resolve().then(function(){return d(l,h)}).then(function(){return i})]:[2,i]}})})});return l.open(),l.write(pNt(document.doctype)+"<html></html>"),mNt(this.referenceElement.ownerDocument,s,a),l.replaceChild(l.adoptNode(this.documentElement),l.documentElement),l.close(),u},e.prototype.createElementClone=function(t){if(NR(t,2))debugger;if(P0e(t))return this.createCanvasClone(t);if(DZ(t))return this.createVideoClone(t);if(QZ(t))return this.createStyleClone(t);var n=t.cloneNode(!1);return IR(n)&&(IR(t)&&t.currentSrc&&t.currentSrc!==t.src&&(n.src=t.currentSrc,n.srcset=""),n.loading==="lazy"&&(n.loading="eager")),HZ(n)?this.createCustomElementClone(n):n},e.prototype.createCustomElementClone=function(t){var n=document.createElement("html2canvascustomelement");return pO(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 l=o.getContextAttributes();(l==null?void 0:l.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){(!Zg(n)||!aNt(n)&&!n.hasAttribute(M0e)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(n)))&&(!this.options.copyStyles||!Zg(n)||!QZ(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(Zg(s)&&O0e(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(j0e(t))return document.createTextNode(t.data);if(!t.ownerDocument)return t.cloneNode(!1);var r=t.ownerDocument.defaultView;if(r&&Zg(t)&&(PR(t)||gB(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&&PR(i)&&(this.clonedReferenceElement=i),o$(i)&&xNt(i);var l=this.counters.parse(new kZ(this.context,s)),u=this.resolvePseudoContent(t,i,a,tb.BEFORE);HZ(t)&&(n=!0),DZ(t)||this.cloneChildNodes(t,i,n),u&&i.insertBefore(u,i.firstChild);var d=this.resolvePseudoContent(t,i,o,tb.AFTER);return d&&i.appendChild(d),this.counters.pop(l),(s&&(this.options.copyStyles||gB(t))&&!I0e(t)||n)&&pO(s,i),(t.scrollTop!==0||t.scrollLeft!==0)&&this.scrolledElements.push([i,t.scrollLeft,t.scrollTop]),(kN(t)||BN(t))&&(kN(i)||BN(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 kZ(this.context,r));var l=new nEt(this.context,r),u=o.createElement("html2canvaspseudoelement");pO(r,u),l.content.forEach(function(h){if(h.type===0)u.appendChild(o.createTextNode(h.value));else if(h.type===22){var f=o.createElement("img");f.src=h.value,f.style.opacity="1",u.appendChild(f)}else if(h.type===18){if(h.name==="attr"){var A=h.values.filter(Kn);A.length&&u.appendChild(o.createTextNode(t.getAttribute(A[0].value)||""))}else if(h.name==="counter"){var p=h.values.filter(U0),m=p[0],g=p[1];if(m&&Kn(m)){var y=s.counters.getCounterValue(m.value),v=g&&Kn(g)?ER.parse(s.context,g.value):3;u.appendChild(o.createTextNode(Y1(y,v,!1)))}}else if(h.name==="counters"){var x=h.values.filter(U0),m=x[0],b=x[1],g=x[2];if(m&&Kn(m)){var w=s.counters.getCounterValues(m.value),S=g&&Kn(g)?ER.parse(s.context,g.value):3,_=b&&b.type===0?b.value:"",E=w.map(function(T){return Y1(T,S,!1)}).join(_);u.appendChild(o.createTextNode(E))}}}else if(h.type===20)switch(h.value){case"open-quote":u.appendChild(o.createTextNode(SZ(l.quotes,s.quoteDepth++,!0)));break;case"close-quote":u.appendChild(o.createTextNode(SZ(l.quotes,--s.quoteDepth,!1)));break;default:u.appendChild(o.createTextNode(h.value))}}),u.className=OR+" "+FR;var d=i===tb.BEFORE?" "+OR:" "+FR;return gB(n)?n.className.baseValue+=d:n.className+=d,u}}},e.destroy=function(t){return t.parentNode?(t.parentNode.removeChild(t),!0):!1},e}(),tb;(function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"})(tb||(tb={}));var uNt=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(M0e,"true"),e.body.appendChild(n),n},dNt=function(e){return new Promise(function(t){if(e.complete){t();return}if(!e.src){t();return}e.onload=t,e.onerror=t})},hNt=function(e){return Promise.all([].slice.call(e.images,0).map(dNt))},ANt=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)}})},fNt=["all","d","content"],pO=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e.item(n);fNt.indexOf(r)===-1&&t.style.setProperty(r,e.getPropertyValue(r))}return t},pNt=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},mNt=function(e,t,n){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||n!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,n)},gNt=function(e){var t=e[0],n=e[1],r=e[2];t.scrollLeft=n,t.scrollTop=r},yNt=":before",vNt=":after",OR="___html2canvas___pseudoelement_before",FR="___html2canvas___pseudoelement_after",GZ=`{
    content: "" !important;
    display: none !important;
}`,xNt=function(e){wNt(e,"."+OR+yNt+GZ+`
         .`+FR+vNt+GZ)},wNt=function(e,t){var n=e.ownerDocument;if(n){var r=n.createElement("style");r.textContent=t,e.appendChild(r)}},L0e=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}(),bNt=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)||(gO(t)||BNt(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 ia(this,void 0,void 0,function(){var n,r,i,s,a=this;return Fs(this,function(o){switch(o.label){case 0:return n=L0e.isSameOrigin(t),r=!mO(t)&&this._options.useCORS===!0&&ps.SUPPORT_CORS_IMAGES&&!n,i=!mO(t)&&!n&&!gO(t)&&typeof this._options.proxy=="string"&&ps.SUPPORT_CORS_XHR&&!r,!n&&this._options.allowTaint===!1&&!mO(t)&&!gO(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(l,u){var d=new Image;d.onload=function(){return l(d)},d.onerror=u,(_Nt(s)||r)&&(d.crossOrigin="anonymous"),d.src=s,d.complete===!0&&setTimeout(function(){return l(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=ps.SUPPORT_RESPONSE_TYPE?"blob":"text",l=new XMLHttpRequest;l.onload=function(){if(l.status===200)if(o==="text")s(l.response);else{var h=new FileReader;h.addEventListener("load",function(){return s(h.result)},!1),h.addEventListener("error",function(f){return a(f)},!1),h.readAsDataURL(l.response)}else a("Failed to proxy resource "+i+" with status code "+l.status)},l.onerror=a;var u=r.indexOf("?")>-1?"&":"?";if(l.open("GET",""+r+u+"url="+encodeURIComponent(t)+"&responseType="+o),o!=="text"&&l instanceof XMLHttpRequest&&(l.responseType=o),n._options.imageTimeout){var d=n._options.imageTimeout;l.timeout=d,l.ontimeout=function(){return a("Timed out ("+d+"ms) proxying "+i)}}l.send()})},e}(),CNt=/^data:image\/svg\+xml/i,SNt=/^data:image\/.*;base64,/i,kNt=/^data:image\/.*/i,BNt=function(e){return ps.SUPPORT_SVG_DRAWING||!ENt(e)},mO=function(e){return kNt.test(e)},_Nt=function(e){return SNt.test(e)},gO=function(e){return e.substr(0,4)==="blob"},ENt=function(e){return e.substr(-3).toLowerCase()==="svg"||CNt.test(e)},tt=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}(),yg=function(e,t,n){return new tt(e.x+(t.x-e.x)*n,e.y+(t.y-e.y)*n)},yk=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=yg(this.start,this.startControl,t),i=yg(this.startControl,this.endControl,t),s=yg(this.endControl,this.end,t),a=yg(r,i,t),o=yg(i,s,t),l=yg(a,o,t);return n?new e(this.start,r,a,l):new e(l,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}(),Zo=function(e){return e.type===1},NNt=function(){function e(t){var n=t.styles,r=t.bounds,i=sw(n.borderTopLeftRadius,r.width,r.height),s=i[0],a=i[1],o=sw(n.borderTopRightRadius,r.width,r.height),l=o[0],u=o[1],d=sw(n.borderBottomRightRadius,r.width,r.height),h=d[0],f=d[1],A=sw(n.borderBottomLeftRadius,r.width,r.height),p=A[0],m=A[1],g=[];g.push((s+l)/r.width),g.push((p+h)/r.width),g.push((a+m)/r.height),g.push((u+f)/r.height);var y=Math.max.apply(Math,g);y>1&&(s/=y,a/=y,l/=y,u/=y,h/=y,f/=y,p/=y,m/=y);var v=r.width-l,x=r.height-f,b=r.width-h,w=r.height-m,S=n.borderTopWidth,_=n.borderRightWidth,E=n.borderBottomWidth,j=n.borderLeftWidth,I=or(n.paddingTop,t.bounds.width),T=or(n.paddingRight,t.bounds.width),N=or(n.paddingBottom,t.bounds.width),F=or(n.paddingLeft,t.bounds.width);this.topLeftBorderDoubleOuterBox=s>0||a>0?Br(r.left+j/3,r.top+S/3,s-j/3,a-S/3,Mn.TOP_LEFT):new tt(r.left+j/3,r.top+S/3),this.topRightBorderDoubleOuterBox=s>0||a>0?Br(r.left+v,r.top+S/3,l-_/3,u-S/3,Mn.TOP_RIGHT):new tt(r.left+r.width-_/3,r.top+S/3),this.bottomRightBorderDoubleOuterBox=h>0||f>0?Br(r.left+b,r.top+x,h-_/3,f-E/3,Mn.BOTTOM_RIGHT):new tt(r.left+r.width-_/3,r.top+r.height-E/3),this.bottomLeftBorderDoubleOuterBox=p>0||m>0?Br(r.left+j/3,r.top+w,p-j/3,m-E/3,Mn.BOTTOM_LEFT):new tt(r.left+j/3,r.top+r.height-E/3),this.topLeftBorderDoubleInnerBox=s>0||a>0?Br(r.left+j*2/3,r.top+S*2/3,s-j*2/3,a-S*2/3,Mn.TOP_LEFT):new tt(r.left+j*2/3,r.top+S*2/3),this.topRightBorderDoubleInnerBox=s>0||a>0?Br(r.left+v,r.top+S*2/3,l-_*2/3,u-S*2/3,Mn.TOP_RIGHT):new tt(r.left+r.width-_*2/3,r.top+S*2/3),this.bottomRightBorderDoubleInnerBox=h>0||f>0?Br(r.left+b,r.top+x,h-_*2/3,f-E*2/3,Mn.BOTTOM_RIGHT):new tt(r.left+r.width-_*2/3,r.top+r.height-E*2/3),this.bottomLeftBorderDoubleInnerBox=p>0||m>0?Br(r.left+j*2/3,r.top+w,p-j*2/3,m-E*2/3,Mn.BOTTOM_LEFT):new tt(r.left+j*2/3,r.top+r.height-E*2/3),this.topLeftBorderStroke=s>0||a>0?Br(r.left+j/2,r.top+S/2,s-j/2,a-S/2,Mn.TOP_LEFT):new tt(r.left+j/2,r.top+S/2),this.topRightBorderStroke=s>0||a>0?Br(r.left+v,r.top+S/2,l-_/2,u-S/2,Mn.TOP_RIGHT):new tt(r.left+r.width-_/2,r.top+S/2),this.bottomRightBorderStroke=h>0||f>0?Br(r.left+b,r.top+x,h-_/2,f-E/2,Mn.BOTTOM_RIGHT):new tt(r.left+r.width-_/2,r.top+r.height-E/2),this.bottomLeftBorderStroke=p>0||m>0?Br(r.left+j/2,r.top+w,p-j/2,m-E/2,Mn.BOTTOM_LEFT):new tt(r.left+j/2,r.top+r.height-E/2),this.topLeftBorderBox=s>0||a>0?Br(r.left,r.top,s,a,Mn.TOP_LEFT):new tt(r.left,r.top),this.topRightBorderBox=l>0||u>0?Br(r.left+v,r.top,l,u,Mn.TOP_RIGHT):new tt(r.left+r.width,r.top),this.bottomRightBorderBox=h>0||f>0?Br(r.left+b,r.top+x,h,f,Mn.BOTTOM_RIGHT):new tt(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=p>0||m>0?Br(r.left,r.top+w,p,m,Mn.BOTTOM_LEFT):new tt(r.left,r.top+r.height),this.topLeftPaddingBox=s>0||a>0?Br(r.left+j,r.top+S,Math.max(0,s-j),Math.max(0,a-S),Mn.TOP_LEFT):new tt(r.left+j,r.top+S),this.topRightPaddingBox=l>0||u>0?Br(r.left+Math.min(v,r.width-_),r.top+S,v>r.width+_?0:Math.max(0,l-_),Math.max(0,u-S),Mn.TOP_RIGHT):new tt(r.left+r.width-_,r.top+S),this.bottomRightPaddingBox=h>0||f>0?Br(r.left+Math.min(b,r.width-j),r.top+Math.min(x,r.height-E),Math.max(0,h-_),Math.max(0,f-E),Mn.BOTTOM_RIGHT):new tt(r.left+r.width-_,r.top+r.height-E),this.bottomLeftPaddingBox=p>0||m>0?Br(r.left+j,r.top+Math.min(w,r.height-E),Math.max(0,p-j),Math.max(0,m-E),Mn.BOTTOM_LEFT):new tt(r.left+j,r.top+r.height-E),this.topLeftContentBox=s>0||a>0?Br(r.left+j+F,r.top+S+I,Math.max(0,s-(j+F)),Math.max(0,a-(S+I)),Mn.TOP_LEFT):new tt(r.left+j+F,r.top+S+I),this.topRightContentBox=l>0||u>0?Br(r.left+Math.min(v,r.width+j+F),r.top+S+I,v>r.width+j+F?0:l-j+F,u-(S+I),Mn.TOP_RIGHT):new tt(r.left+r.width-(_+T),r.top+S+I),this.bottomRightContentBox=h>0||f>0?Br(r.left+Math.min(b,r.width-(j+F)),r.top+Math.min(x,r.height+S+I),Math.max(0,h-(_+T)),f-(E+N),Mn.BOTTOM_RIGHT):new tt(r.left+r.width-(_+T),r.top+r.height-(E+N)),this.bottomLeftContentBox=p>0||m>0?Br(r.left+j+F,r.top+w,Math.max(0,p-(j+F)),m-(E+N),Mn.BOTTOM_LEFT):new tt(r.left+j+F,r.top+r.height-(E+N))}return e}(),Mn;(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"})(Mn||(Mn={}));var Br=function(e,t,n,r,i){var s=4*((Math.sqrt(2)-1)/3),a=n*s,o=r*s,l=e+n,u=t+r;switch(i){case Mn.TOP_LEFT:return new yk(new tt(e,u),new tt(e,u-o),new tt(l-a,t),new tt(l,t));case Mn.TOP_RIGHT:return new yk(new tt(e,t),new tt(e+a,t),new tt(l,u-o),new tt(l,u));case Mn.BOTTOM_RIGHT:return new yk(new tt(l,t),new tt(l,t+o),new tt(e+a,u),new tt(e,u));case Mn.BOTTOM_LEFT:default:return new yk(new tt(l,u),new tt(l-a,u),new tt(e,t+o),new tt(e,t))}},_N=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},jNt=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},EN=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},TNt=function(){function e(t,n,r){this.offsetX=t,this.offsetY=n,this.matrix=r,this.type=0,this.target=6}return e}(),vk=function(){function e(t,n){this.path=t,this.target=n,this.type=1}return e}(),PNt=function(){function e(t){this.opacity=t,this.type=2,this.target=6}return e}(),INt=function(e){return e.type===0},R0e=function(e){return e.type===1},ONt=function(e){return e.type===2},YZ=function(e,t){return e.length===t.length?e.some(function(n,r){return n===t[r]}):!1},FNt=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})},U0e=function(){function e(t){this.element=t,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e}(),D0e=function(){function e(t,n){if(this.container=t,this.parent=n,this.effects=[],this.curves=new NNt(this.container),this.container.styles.opacity<1&&this.effects.push(new PNt(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 TNt(r,i,s))}if(this.container.styles.overflowX!==0){var a=_N(this.curves),o=EN(this.curves);YZ(a,o)?this.effects.push(new vk(a,6)):(this.effects.push(new vk(a,2)),this.effects.push(new vk(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(l){return!R0e(l)});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=_N(r.curves),o=EN(r.curves);YZ(a,o)||i.unshift(new vk(o,6))}}else i.unshift.apply(i,s);r=r.parent}return i.filter(function(l){return Fi(l.target,t)})},e}(),MR=function(e,t,n,r){e.container.elements.forEach(function(i){var s=Fi(i.flags,4),a=Fi(i.flags,2),o=new D0e(i,e);Fi(i.styles.display,2048)&&r.push(o);var l=Fi(i.flags,8)?[]:r;if(s||a){var u=s||i.styles.isPositioned()?n:t,d=new U0e(o);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var h=i.styles.zIndex.order;if(h<0){var f=0;u.negativeZIndex.some(function(p,m){return h>p.element.container.styles.zIndex.order?(f=m,!1):f>0}),u.negativeZIndex.splice(f,0,d)}else if(h>0){var A=0;u.positiveZIndex.some(function(p,m){return h>=p.element.container.styles.zIndex.order?(A=m+1,!1):A>0}),u.positiveZIndex.splice(A,0,d)}else u.zeroOrAutoZIndexOrTransformedOrOpacity.push(d)}else i.styles.isFloating()?u.nonPositionedFloats.push(d):u.nonPositionedInlineLevel.push(d);MR(o,d,s?d:n,l)}else i.styles.isInlineLevel()?t.inlineLevel.push(o):t.nonInlineLevel.push(o),MR(o,t,n,l);Fi(i.flags,8)&&Q0e(i,l)})},Q0e=function(e,t){for(var n=e instanceof TR?e.start:1,r=e instanceof TR?e.reversed:!1,i=0;i<t.length;i++){var s=t[i];s.container instanceof S0e&&typeof s.container.value=="number"&&s.container.value!==0&&(n=s.container.value),s.listValue=Y1(n,s.container.styles.listStyleType,!0),n+=r?-1:1}},MNt=function(e){var t=new D0e(e,null),n=new U0e(t),r=[];return MR(t,n,n,r),Q0e(t.container,r),n},XZ=function(e,t){switch(t){case 0:return al(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return al(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return al(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);case 3:default:return al(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},LNt=function(e,t){switch(t){case 0:return al(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return al(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return al(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);case 3:default:return al(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}},RNt=function(e,t){switch(t){case 0:return al(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return al(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return al(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);case 3:default:return al(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}},UNt=function(e,t){switch(t){case 0:return xk(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return xk(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return xk(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);case 3:default:return xk(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}},xk=function(e,t){var n=[];return Zo(e)?n.push(e.subdivide(.5,!1)):n.push(e),Zo(t)?n.push(t.subdivide(.5,!0)):n.push(t),n},al=function(e,t,n,r){var i=[];return Zo(e)?i.push(e.subdivide(.5,!1)):i.push(e),Zo(n)?i.push(n.subdivide(.5,!0)):i.push(n),Zo(r)?i.push(r.subdivide(.5,!0).reverse()):i.push(r),Zo(t)?i.push(t.subdivide(.5,!1).reverse()):i.push(t),i},H0e=function(e){var t=e.bounds,n=e.styles;return t.add(n.borderLeftWidth,n.borderTopWidth,-(n.borderRightWidth+n.borderLeftWidth),-(n.borderTopWidth+n.borderBottomWidth))},NN=function(e){var t=e.styles,n=e.bounds,r=or(t.paddingLeft,n.width),i=or(t.paddingRight,n.width),s=or(t.paddingTop,n.width),a=or(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))},DNt=function(e,t){return e===0?t.bounds:e===2?NN(t):H0e(t)},QNt=function(e,t){return e===0?t.bounds:e===2?NN(t):H0e(t)},yO=function(e,t,n){var r=DNt(jg(e.styles.backgroundOrigin,t),e),i=QNt(jg(e.styles.backgroundClip,t),e),s=HNt(jg(e.styles.backgroundSize,t),n,r),a=s[0],o=s[1],l=sw(jg(e.styles.backgroundPosition,t),r.width-a,r.height-o),u=$Nt(jg(e.styles.backgroundRepeat,t),l,s,r,i),d=Math.round(r.left+l[0]),h=Math.round(r.top+l[1]);return[u,d,h,a,o]},vg=function(e){return Kn(e)&&e.value===Ty.AUTO},wk=function(e){return typeof e=="number"},HNt=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(wi(a)&&o&&wi(o))return[or(a,n.width),or(o,n.height)];var l=wk(s);if(Kn(a)&&(a.value===Ty.CONTAIN||a.value===Ty.COVER)){if(wk(s)){var u=n.width/n.height;return u<s!=(a.value===Ty.COVER)?[n.width,n.width/s]:[n.height*s,n.height]}return[n.width,n.height]}var d=wk(r),h=wk(i),f=d||h;if(vg(a)&&(!o||vg(o))){if(d&&h)return[r,i];if(!l&&!f)return[n.width,n.height];if(f&&l){var A=d?r:i*s,p=h?i:r/s;return[A,p]}var m=d?r:n.width,g=h?i:n.height;return[m,g]}if(l){var y=0,v=0;return wi(a)?y=or(a,n.width):wi(o)&&(v=or(o,n.height)),vg(a)?y=v*s:(!o||vg(o))&&(v=y/s),[y,v]}var x=null,b=null;if(wi(a)?x=or(a,n.width):o&&wi(o)&&(b=or(o,n.height)),x!==null&&(!o||vg(o))&&(b=d&&h?x/r*i:n.height),b!==null&&vg(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")},jg=function(e,t){var n=e[t];return typeof n>"u"?e[0]:n},$Nt=function(e,t,n,r,i){var s=t[0],a=t[1],o=n[0],l=n[1];switch(e){case 2:return[new tt(Math.round(r.left),Math.round(r.top+a)),new tt(Math.round(r.left+r.width),Math.round(r.top+a)),new tt(Math.round(r.left+r.width),Math.round(l+r.top+a)),new tt(Math.round(r.left),Math.round(l+r.top+a))];case 3:return[new tt(Math.round(r.left+s),Math.round(r.top)),new tt(Math.round(r.left+s+o),Math.round(r.top)),new tt(Math.round(r.left+s+o),Math.round(r.height+r.top)),new tt(Math.round(r.left+s),Math.round(r.height+r.top))];case 1:return[new tt(Math.round(r.left+s),Math.round(r.top+a)),new tt(Math.round(r.left+s+o),Math.round(r.top+a)),new tt(Math.round(r.left+s+o),Math.round(r.top+a+l)),new tt(Math.round(r.left+s),Math.round(r.top+a+l))];default:return[new tt(Math.round(i.left),Math.round(i.top)),new tt(Math.round(i.left+i.width),Math.round(i.top)),new tt(Math.round(i.left+i.width),Math.round(i.height+i.top)),new tt(Math.round(i.left),Math.round(i.height+i.top))]}},zNt="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",JZ="Hidden Text",VNt=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=zNt,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(JZ)),r.appendChild(s),r.appendChild(i);var o=i.offsetTop-s.offsetTop+2;r.removeChild(s),r.appendChild(this._document.createTextNode(JZ)),r.style.lineHeight="normal",i.style.verticalAlign="super";var l=i.offsetTop-r.offsetTop+2;return a.removeChild(r),{baseline:o,middle:l}},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}(),$0e=function(){function e(t,n){this.context=t,this.options=n}return e}(),KNt=1e4,qNt=function(e){wc(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 VNt(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(),ONt(n)&&(this.ctx.globalAlpha=n.opacity),INt(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)),R0e(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 ia(this,void 0,void 0,function(){var r;return Fs(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 ia(this,void 0,void 0,function(){return Fs(this,function(r){switch(r.label){case 0:if(Fi(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=s$(n.text);a.reduce(function(o,l){return s.ctx.fillText(l,o,n.bounds.top+i),o+s.ctx.measureText(l).width},n.bounds.left)}},t.prototype.createFontStyle=function(n){var r=n.fontVariant.filter(function(a){return a==="normal"||a==="small-caps"}).join(""),i=JNt(n.fontFamily).join(", "),s=z2(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 ia(this,void 0,void 0,function(){var i,s,a,o,l,u,d,h,f=this;return Fs(this,function(A){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",l=this.fontMetrics.getMetrics(a,o),u=l.baseline,d=l.middle,h=r.paintOrder,n.textBounds.forEach(function(p){h.forEach(function(m){switch(m){case 0:f.ctx.fillStyle=zi(r.color),f.renderTextWithLetterSpacing(p,r.letterSpacing,u);var g=r.textShadow;g.length&&p.text.trim().length&&(g.slice(0).reverse().forEach(function(y){f.ctx.shadowColor=zi(y.color),f.ctx.shadowOffsetX=y.offsetX.number*f.options.scale,f.ctx.shadowOffsetY=y.offsetY.number*f.options.scale,f.ctx.shadowBlur=y.blur.number,f.renderTextWithLetterSpacing(p,r.letterSpacing,u)}),f.ctx.shadowColor="",f.ctx.shadowOffsetX=0,f.ctx.shadowOffsetY=0,f.ctx.shadowBlur=0),r.textDecorationLine.length&&(f.ctx.fillStyle=zi(r.textDecorationColor||r.color),r.textDecorationLine.forEach(function(y){switch(y){case 1:f.ctx.fillRect(p.bounds.left,Math.round(p.bounds.top+u),p.bounds.width,1);break;case 2:f.ctx.fillRect(p.bounds.left,Math.round(p.bounds.top),p.bounds.width,1);break;case 3:f.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&&(f.ctx.strokeStyle=zi(r.webkitTextStrokeColor),f.ctx.lineWidth=r.webkitTextStrokeWidth,f.ctx.lineJoin=window.chrome?"miter":"round",f.ctx.strokeText(p.text,p.bounds.left,p.bounds.top+u)),f.ctx.strokeStyle="",f.ctx.lineWidth=0,f.ctx.lineJoin="miter";break}})}),[2]})})},t.prototype.renderReplacedElement=function(n,r,i){if(i&&n.intrinsicWidth>0&&n.intrinsicHeight>0){var s=NN(n),a=EN(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 ia(this,void 0,void 0,function(){var r,i,s,a,o,l,v,v,u,d,h,f,b,A,p,w,m,g,y,v,x,b,w;return Fs(this,function(S){switch(S.label){case 0:this.applyEffects(n.getEffects(4)),r=n.container,i=n.curves,s=r.styles,a=0,o=r.textNodes,S.label=1;case 1:return a<o.length?(l=o[a],[4,this.renderTextNode(l,s)]):[3,4];case 2:S.sent(),S.label=3;case 3:return a++,[3,1];case 4:if(!(r instanceof w0e))return[3,8];S.label=5;case 5:return S.trys.push([5,7,,8]),[4,this.context.cache.match(r.src)];case 6:return v=S.sent(),this.renderReplacedElement(r,i,v),[3,8];case 7:return S.sent(),this.context.logger.error("Error loading image "+r.src),[3,8];case 8:if(r instanceof b0e&&this.renderReplacedElement(r,i,r.canvas),!(r instanceof C0e))return[3,12];S.label=9;case 9:return S.trys.push([9,11,,12]),[4,this.context.cache.match(r.svg)];case 10:return v=S.sent(),this.renderReplacedElement(r,i,v),[3,12];case 11:return S.sent(),this.context.logger.error("Error loading svg "+r.svg.substring(0,255)),[3,12];case 12:return r instanceof _0e&&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=S.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),S.label=14;case 14:if(r instanceof a$&&(h=Math.min(r.bounds.width,r.bounds.height),r.type===CN?r.checked&&(this.ctx.save(),this.path([new tt(r.bounds.left+h*.39363,r.bounds.top+h*.79),new tt(r.bounds.left+h*.16,r.bounds.top+h*.5549),new tt(r.bounds.left+h*.27347,r.bounds.top+h*.44071),new tt(r.bounds.left+h*.39694,r.bounds.top+h*.5649),new tt(r.bounds.left+h*.72983,r.bounds.top+h*.23),new tt(r.bounds.left+h*.84,r.bounds.top+h*.34085),new tt(r.bounds.left+h*.39363,r.bounds.top+h*.79)]),this.ctx.fillStyle=zi(UZ),this.ctx.fill(),this.ctx.restore()):r.type===SN&&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=zi(UZ),this.ctx.fill(),this.ctx.restore())),WNt(r)&&r.value.length){switch(f=this.createFontStyle(s),b=f[0],A=f[1],p=this.fontMetrics.getMetrics(b,A).baseline,this.ctx.font=b,this.ctx.fillStyle=zi(s.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=YNt(r.styles.textAlign),w=NN(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 tt(w.left,w.top),new tt(w.left+w.width,w.top),new tt(w.left+w.width,w.top+w.height),new tt(w.left,w.top+w.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new eb(r.value,g),s.letterSpacing,p),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!Fi(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,S.label=15;case 15:return S.trys.push([15,17,,18]),[4,this.context.cache.match(x)];case 16:return v=S.sent(),this.ctx.drawImage(v,r.bounds.left-(v.width+10),r.bounds.top),[3,18];case 17:return S.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=zi(s.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",w=new wd(r.bounds.left,r.bounds.top+or(r.styles.paddingTop,r.bounds.width),r.bounds.width,bZ(s.lineHeight,s.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new eb(n.listValue,w),s.letterSpacing,bZ(s.lineHeight,s.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),S.label=20;case 20:return[2]}})})},t.prototype.renderStackContent=function(n){return ia(this,void 0,void 0,function(){var r,i,y,s,a,y,o,l,y,u,d,y,h,f,y,A,p,y,m,g,y;return Fs(this,function(v){switch(v.label){case 0:if(Fi(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,l=n.nonPositionedFloats,v.label=11;case 11:return o<l.length?(y=l[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,f=n.inlineLevel,v.label=19;case 19:return h<f.length?(y=f[h],[4,this.renderNode(y)]):[3,22];case 20:v.sent(),v.label=21;case 21:return h++,[3,19];case 22:A=0,p=n.zeroOrAutoZIndexOrTransformedOrOpacity,v.label=23;case 23:return A<p.length?(y=p[A],[4,this.renderStack(y)]):[3,26];case 24:v.sent(),v.label=25;case 25:return A++,[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=Zo(i)?i.start:i;s===0?r.ctx.moveTo(a.x,a.y):r.ctx.lineTo(a.x,a.y),Zo(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 l=o.getContext("2d");return l.drawImage(n,0,0,n.width,n.height,0,0,r,i),o},t.prototype.renderBackgroundImage=function(n){return ia(this,void 0,void 0,function(){var r,i,s,a,o,l;return Fs(this,function(u){switch(u.label){case 0:r=n.styles.backgroundImage.length-1,i=function(d){var h,f,A,I,H,W,F,L,E,p,I,H,W,F,L,m,g,y,v,x,b,w,S,_,E,j,I,T,N,F,L,D,H,W,$,V,Q,ce,R,M,Y,X;return Fs(this,function(K){switch(K.label){case 0:if(d.type!==0)return[3,5];h=void 0,f=d.url,K.label=1;case 1:return K.trys.push([1,3,,4]),[4,s.context.cache.match(f)];case 2:return h=K.sent(),[3,4];case 3:return K.sent(),s.context.logger.error("Error loading background-image "+f),[3,4];case 4:return h&&(A=yO(n,r,[h.width,h.height,h.width/h.height]),I=A[0],H=A[1],W=A[2],F=A[3],L=A[4],E=s.ctx.createPattern(s.resizeImage(h,F,L),"repeat"),s.renderRepeat(I,E,H,W)),[3,6];case 5:IBt(d)?(p=yO(n,r,[null,null,null]),I=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,S=w.getContext("2d"),_=S.createLinearGradient(y,x,v,b),xZ(d.stops,g).forEach(function(Z){return _.addColorStop(Z.stop,zi(Z.color))}),S.fillStyle=_,S.fillRect(0,0,F,L),F>0&&L>0&&(E=s.ctx.createPattern(w,"repeat"),s.renderRepeat(I,E,H,W))):OBt(d)&&(j=yO(n,r,[null,null,null]),I=j[0],T=j[1],N=j[2],F=j[3],L=j[4],D=d.position.length===0?[n$]:d.position,H=or(D[0],F),W=or(D[D.length-1],L),$=NBt(d,H,W,F,L),V=$[0],Q=$[1],V>0&&Q>0&&(ce=s.ctx.createRadialGradient(T+H,N+W,0,T+H,N+W,V),xZ(d.stops,V*2).forEach(function(Z){return ce.addColorStop(Z.stop,zi(Z.color))}),s.path(I),s.ctx.fillStyle=ce,V!==Q?(R=n.bounds.left+.5*n.bounds.width,M=n.bounds.top+.5*n.bounds.height,Y=Q/V,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())),K.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?(l=o[a],[5,i(l)]):[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 ia(this,void 0,void 0,function(){return Fs(this,function(s){return this.path(XZ(i,r)),this.ctx.fillStyle=zi(n),this.ctx.fill(),[2]})})},t.prototype.renderDoubleBorder=function(n,r,i,s){return ia(this,void 0,void 0,function(){var a,o;return Fs(this,function(l){switch(l.label){case 0:return r<3?[4,this.renderSolidBorder(n,i,s)]:[3,2];case 1:return l.sent(),[2];case 2:return a=LNt(s,i),this.path(a),this.ctx.fillStyle=zi(n),this.ctx.fill(),o=RNt(s,i),this.path(o),this.ctx.fill(),[2]}})})},t.prototype.renderNodeBackgroundAndBorders=function(n){return ia(this,void 0,void 0,function(){var r,i,s,a,o,l,u,d,h=this;return Fs(this,function(f){switch(f.label){case 0:return this.applyEffects(n.getEffects(2)),r=n.container.styles,i=!yA(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=GNt(jg(r.backgroundClip,0),n.curves),i||r.boxShadow.length?(this.ctx.save(),this.path(a),this.ctx.clip(),yA(r.backgroundColor)||(this.ctx.fillStyle=zi(r.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(n.container)]):[3,2];case 1:f.sent(),this.ctx.restore(),r.boxShadow.slice(0).reverse().forEach(function(A){h.ctx.save();var p=_N(n.curves),m=A.inset?0:KNt,g=FNt(p,-m+(A.inset?1:-1)*A.spread.number,(A.inset?1:-1)*A.spread.number,A.spread.number*(A.inset?-2:2),A.spread.number*(A.inset?-2:2));A.inset?(h.path(p),h.ctx.clip(),h.mask(g)):(h.mask(p),h.ctx.clip(),h.path(g)),h.ctx.shadowOffsetX=A.offsetX.number+m,h.ctx.shadowOffsetY=A.offsetY.number,h.ctx.shadowColor=zi(A.color),h.ctx.shadowBlur=A.blur.number,h.ctx.fillStyle=A.inset?zi(A.color):"rgba(0,0,0,1)",h.ctx.fill(),h.ctx.restore()}),f.label=2;case 2:o=0,l=0,u=s,f.label=3;case 3:return l<u.length?(d=u[l],d.style!==0&&!yA(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 f.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 f.sent(),[3,11];case 7:return d.style!==4?[3,9]:[4,this.renderDoubleBorder(d.color,d.width,o,n.curves)];case 8:return f.sent(),[3,11];case 9:return[4,this.renderSolidBorder(d.color,o,n.curves)];case 10:f.sent(),f.label=11;case 11:o++,f.label=12;case 12:return l++,[3,3];case 13:return[2]}})})},t.prototype.renderDashedDottedBorder=function(n,r,i,s,a){return ia(this,void 0,void 0,function(){var o,l,u,d,h,f,A,p,m,g,y,v,x,b,w,S,w,S;return Fs(this,function(_){return this.ctx.save(),o=UNt(s,i),l=XZ(s,i),a===2&&(this.path(l),this.ctx.clip()),Zo(l[0])?(u=l[0].start.x,d=l[0].start.y):(u=l[0].x,d=l[0].y),Zo(l[1])?(h=l[1].end.x,f=l[1].end.y):(h=l[1].x,f=l[1].y),i===0||i===2?A=Math.abs(u-h):A=Math.abs(d-f),this.ctx.beginPath(),a===3?this.formatPath(o):this.formatPath(l.slice(0,2)),p=r<3?r*3:r*2,m=r<3?r*2:r,a===3&&(p=r,m=r),g=!0,A<=p*2?g=!1:A<=p*2+m?(y=A/(2*p+m),p*=y,m*=y):(v=Math.floor((A+m)/(p+m)),x=(A-v*p)/(v-1),b=(A-(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=zi(n),this.ctx.stroke(),this.ctx.setLineDash([]),a===2&&(Zo(l[0])&&(w=l[3],S=l[0],this.ctx.beginPath(),this.formatPath([new tt(w.end.x,w.end.y),new tt(S.start.x,S.start.y)]),this.ctx.stroke()),Zo(l[1])&&(w=l[1],S=l[2],this.ctx.beginPath(),this.formatPath([new tt(w.end.x,w.end.y),new tt(S.start.x,S.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},t.prototype.render=function(n){return ia(this,void 0,void 0,function(){var r;return Fs(this,function(i){switch(i.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=zi(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),r=MNt(n),[4,this.renderStack(r)];case 1:return i.sent(),this.applyEffects([]),[2,this.canvas]}})})},t}($0e),WNt=function(e){return e instanceof B0e||e instanceof k0e?!0:e instanceof a$&&e.type!==SN&&e.type!==CN},GNt=function(e,t){switch(e){case 0:return _N(t);case 2:return jNt(t);case 1:default:return EN(t)}},YNt=function(e){switch(e){case 1:return"center";case 2:return"right";case 0:default:return"left"}},XNt=["-apple-system","system-ui"],JNt=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter(function(t){return XNt.indexOf(t)===-1}):e},ZNt=function(e){wc(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 ia(this,void 0,void 0,function(){var r,i;return Fs(this,function(s){switch(s.label){case 0:return r=jR(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,n),[4,ejt(r)];case 1:return i=s.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=zi(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}($0e),ejt=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))})},tjt=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,ZS([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,ZS([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,ZS([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,ZS([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},e.instances={},e}(),njt=function(){function e(t,n){var r;this.windowBounds=n,this.instanceName="#"+e.instanceCount++,this.logger=new tjt({id:this.instanceName,enabled:t.logging}),this.cache=(r=t.cache)!==null&&r!==void 0?r:new bNt(this,t)}return e.instanceCount=1,e}(),z0e=function(e,t){return t===void 0&&(t={}),rjt(e,t)};typeof window<"u"&&L0e.setContext(window);var rjt=function(e,t){return ia(void 0,void 0,void 0,function(){var n,r,i,s,a,o,l,u,d,h,f,A,p,m,g,y,v,x,b,w,_,S,_,E,j,I,T,N,F,L,D,H,W,$,V,Q,ce,R,M,Y;return Fs(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:(E=t.allowTaint)!==null&&E!==void 0?E:!1,imageTimeout:(j=t.imageTimeout)!==null&&j!==void 0?j:15e3,proxy:t.proxy,useCORS:(I=t.useCORS)!==null&&I!==void 0?I:!1},s=pR({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:(D=t.scrollY)!==null&&D!==void 0?D:r.pageYOffset},o=new wd(a.scrollX,a.scrollY,a.windowWidth,a.windowHeight),l=new njt(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},l.logger.debug("Starting document clone with size "+o.width+"x"+o.height+" scrolled to "+-o.left+","+-o.top),h=new WZ(l,e,d),f=h.clonedReferenceElement,f?[4,h.toIFrame(n,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return A=X.sent(),p=o$(f)||sNt(f)?FSt(f.ownerDocument):J5(l,f),m=p.width,g=p.height,y=p.left,v=p.top,x=ijt(l,f,t.backgroundColor),b={canvas:t.canvas,backgroundColor:x,scale:(V=($=t.scale)!==null&&$!==void 0?$:r.devicePixelRatio)!==null&&V!==void 0?V: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?(l.logger.debug("Document cloned, using foreign object rendering"),_=new ZNt(l,b),[4,_.render(f)]):[3,3];case 2:return w=X.sent(),[3,5];case 3:return l.logger.debug("Document cloned, element located at "+y+","+v+" with size "+m+"x"+g+" using computed rendering"),l.logger.debug("Starting DOM parsing"),S=N0e(l,f),x===S.styles.backgroundColor&&(S.styles.backgroundColor=od.TRANSPARENT),l.logger.debug("Starting renderer for element at "+b.x+","+b.y+" with size "+b.width+"x"+b.height),_=new qNt(l,b),[4,_.render(S)];case 4:w=X.sent(),X.label=5;case 5:return(!((Y=t.removeContainer)!==null&&Y!==void 0)||Y)&&(WZ.destroy(A)||l.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),l.logger.debug("Finished rendering"),[2,w]}})})},ijt=function(e,t,n){var r=t.ownerDocument,i=r.documentElement?Jw(e,getComputedStyle(r.documentElement).backgroundColor):od.TRANSPARENT,s=r.body?Jw(e,getComputedStyle(r.body).backgroundColor):od.TRANSPARENT,a=typeof n=="string"?Jw(e,n):n===null?od.TRANSPARENT:4294967295;return t===r.documentElement?yA(i)?yA(s)?a:s:i:a};const sjt=Object.freeze(Object.defineProperty({__proto__:null,default:z0e},Symbol.toStringTag,{value:"Module"}));function ajt({payload:e,targetId:t}){const[n,r]=k.useState(!1),[i,s]=k.useState(!1),a=async()=>{r(!0);try{const l=document.getElementById(t);if(!l)throw new Error("Report container not found");const u=await z0e(l,{scale:2,useCORS:!0,backgroundColor:"#ffffff",windowWidth:l.scrollWidth}),d=u.toDataURL("image/png"),h=new Nt({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(l){console.error(l),alert("Could not generate PDF. Try the HTML download instead.")}finally{r(!1)}},o=async()=>{s(!0);try{const{data:l,error:u}=await Me.functions.invoke("generate-market-pulse-html",{body:{payload:e}});if(u)throw u;const d=l==null?void 0:l.html;if(!d)throw new Error("No HTML returned");const h=new Blob([d],{type:"text/html"}),f=URL.createObjectURL(h),A=document.createElement("a");A.href=f,A.download=`Holden_MarketPulse_${e.zip}_${new Date().toISOString().slice(0,10)}.html`,A.click(),URL.revokeObjectURL(f)}catch(l){console.error(l),alert("Could not generate HTML. Please try again.")}finally{s(!1)}};return c.jsxs("div",{className:"flex flex-wrap gap-3",children:[c.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?c.jsx(ga,{size:14,className:"animate-spin"}):c.jsx(c1e,{size:14})," Download PDF"]}),c.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?c.jsx(ga,{size:14,className:"animate-spin"}):c.jsx(Xy,{size:14})," Download HTML"]})]})}function ojt({role:e,content:t}){const n=e==="user";return c.jsx("div",{className:`flex ${n?"justify-end":"justify-start"}`,children:c.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?c.jsx("p",{className:"whitespace-pre-wrap",children:t}):c.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:c.jsx(w6,{children:t||"…"})})})})}function ljt({chips:e,onPick:t}){return c.jsx("div",{className:"flex flex-wrap gap-2",children:e.map(n=>c.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 cjt({zip:e,lens:t,onDismiss:n}){const[r,i]=k.useState(""),[s,a]=k.useState(""),[o,l]=k.useState(""),[u,d]=k.useState(!1),[h,f]=k.useState(!1),A=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}`}}),f(!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?c.jsx("div",{className:"bg-muted border border-border p-4 my-2",children:c.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[c.jsx(Jc,{size:16})," Thanks — Holden will reach out shortly."]})}):c.jsxs("div",{className:"bg-muted border border-border p-4 my-2 space-y-2",children:[c.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground",children:"Want Holden to follow up personally?"}),c.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[c.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"}),c.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"})]}),c.jsx("input",{value:o,onChange:p=>l(p.target.value),placeholder:"Email",type:"email",className:"w-full bg-background border border-border px-2.5 py-1.5 text-sm"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs("button",{onClick:A,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?c.jsx(ga,{size:14,className:"animate-spin"}):null," Send"]}),c.jsx("button",{onClick:n,className:"px-3 py-2 text-[11px] uppercase tracking-[0.2em] text-muted-foreground hover:text-foreground",children:"Dismiss"})]})]})}const ujt=/\b(tour|visit|see it|list|sell my|pre.?approval|preapproval|ready to buy|let.?s do|set up|book|schedule)\b/i;function djt(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 hjt({payload:e,rates:t}){const[n,r]=k.useState(!1),[i,s]=k.useState([]),[a,o]=k.useState(""),[l,u]=k.useState(!1),[d,h]=k.useState(!1),[f,A]=k.useState(!1),p=k.useRef(null),m=djt(e.zip,e.lens);k.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]),k.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 E,j,I;const x=v.trim();if(!x||l)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 S=w.filter(T=>T.role==="user").length;!f&&(ujt.test(x)||S>0&&S%4===0)&&h(!0);let _="";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 D="",H=!1;for(;!H;){const{done:W,value:$}=await F.read();if(W)break;D+=L.decode($,{stream:!0});let V;for(;(V=D.indexOf(`
`))!==-1;){let Q=D.slice(0,V);if(D=D.slice(V+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=(I=(j=(E=JSON.parse(ce).choices)==null?void 0:E[0])==null?void 0:j.delta)==null?void 0:I.content;M&&(_+=M,s(Y=>{const X=[...Y];return X[X.length-1]={role:"assistant",content:_},X}))}catch{D=Q+`
`+D;break}}}}catch(T){_=`_${T.message||"Sorry — something went wrong. Please try again."}_`,s(N=>{const F=[...N];return F[F.length-1]={role:"assistant",content:_},F})}finally{u(!1),_&&Me.from("market_pulse_chats").insert({session_id:m,zip:e.zip,lens:e.lens,role:"assistant",content:_}).then(()=>{})}}return c.jsxs(c.Fragment,{children:[!n&&c.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:[c.jsx(rA,{size:16}),c.jsxs("span",{className:"text-[11px] uppercase tracking-[0.2em] font-medium",children:["Ask About ",e.zip]})]}),n&&c.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:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-primary text-primary-foreground",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-[10px] uppercase tracking-[0.25em] opacity-80",children:"Ask Holden's AI"}),c.jsxs("div",{className:"text-sm font-semibold",children:["About ",e.zip," · ",e.area]})]}),c.jsx("button",{onClick:()=>r(!1),className:"p-1 hover:opacity-80","aria-label":"Close chat",children:c.jsx(qa,{size:18})})]}),c.jsxs("div",{ref:p,className:"flex-1 overflow-y-auto p-4 space-y-3",children:[i.length===0&&c.jsxs(c.Fragment,{children:[c.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,"."]}),c.jsx(ljt,{chips:g,onPick:y})]}),i.map((v,x)=>c.jsx(ojt,{role:v.role,content:v.content},x)),d&&!f&&c.jsx(cjt,{zip:e.zip,lens:e.lens,onDismiss:()=>{h(!1),A(!0)}})]}),c.jsxs("form",{onSubmit:v=>{v.preventDefault(),y(a)},className:"border-t border-border p-3 flex items-center gap-2",children:[c.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:l}),c.jsx("button",{type:"submit",disabled:l||!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:l?c.jsx(ga,{size:14,className:"animate-spin"}):c.jsx(dre,{size:14})})]}),c.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 Ajt(){var v,x;const{zip:e=""}=om(),[t]=fBe(),n=t.get("lens")==="buyer"?"buyer":"seller",r=t.get("run")==="1",i=t.get("t")||"",[s,a]=k.useState(null),[o,l]=k.useState(null),[u,d]=k.useState(!1),[h,f]=k.useState(null),[A,p]=k.useState(!1),m=Pae(e),g=m?((v=xIe(e))==null?void 0:v.city)||"Grand Rapids area":"",y=async()=>{if(!m){f("Invalid ZIP code");return}p(!0),d(!0),f(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 S=b==null?void 0:b.payload;if(!S)throw new Error("No report returned");a(S);const{data:_}=await Me.from("market_pulse_rates").select("rates, source, fetched_at").order("fetched_at",{ascending:!1}).limit(1).maybeSingle();_&&l({rates:_.rates,source:_.source,fetched_at:_.fetched_at})}catch(b){f(b.message||"Failed to generate report")}finally{d(!1)}};return k.useEffect(()=>{r&&m&&y()},[e,n,i,r]),c.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[c.jsxs(ur,{children:[c.jsx("title",{children:`Market Pulse · ZIP ${e} · ${n==="seller"?"Seller":"Buyer"} Report · HoldenGR`}),c.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.`})]}),c.jsx(mj,{}),c.jsx("main",{className:"flex-1 pt-20 pb-24",children:c.jsxs("div",{className:"container-page",children:[c.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4 py-6 border-b border-border",children:[c.jsxs("div",{children:[c.jsxs(Ct,{to:"/",className:"inline-flex items-center gap-1 text-[10px] uppercase tracking-[0.25em] text-muted-foreground hover:text-foreground",children:[c.jsx(l2,{size:12})," Home"]}),c.jsxs("h1",{className:"text-3xl md:text-4xl font-bold mt-2",children:["Market Pulse · ZIP ",e]}),c.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[n==="seller"?"Seller report":"Buyer report"," · ",s?`${s.city} — ${s.area}`:g]})]}),c.jsx("div",{className:"w-full md:w-auto md:max-w-sm",children:c.jsx(qD,{compact:!0})})]}),!A&&!u&&!s&&!h&&c.jsxs("div",{className:"py-10 md:py-14 space-y-12",children:[c.jsxs("div",{className:"bg-card border border-border p-6 md:p-10 text-center max-w-3xl mx-auto",children:[c.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:[c.jsx(HB,{size:12})," Live Report Ready"]}),c.jsxs("h2",{className:"text-2xl md:text-3xl font-bold mb-3",children:["Generate your ",n==="seller"?"seller":"buyer"," report for ZIP ",e]}),c.jsxs("p",{className:"text-sm md:text-base text-foreground/75 max-w-xl mx-auto mb-6 leading-relaxed",children:["I'll research ",c.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."]}),c.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:[c.jsx(zs,{size:14})," Run Report"]}),c.jsx("p",{className:"text-[10px] text-muted-foreground mt-4",children:"Free · No login · You can switch ZIP or buyer/seller anytime"})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"text-center mb-6",children:[c.jsx("div",{className:"text-[10px] uppercase tracking-[0.3em] text-primary font-semibold mb-2",children:"What's Inside"}),c.jsx("h3",{className:"text-xl md:text-2xl font-bold",children:"A snapshot of what you'll get"})]}),c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:[{icon:are,title:"Heat Index",body:"0–100 score telling you if this ZIP is a seller's, balanced, or buyer's market right now."},{icon:tre,title:"Price & Velocity Trends",body:"24 months of median price + 12 months of days-on-market and list-to-sale ratio."},{icon:HB,title:"Today's Mortgage Rates",body:"Live 30-yr, 15-yr, FHA, VA, and 7/1 ARM rates from FRED + Mortgage News Daily."},{icon:Zne,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:rA,title:"Chat With The Report",body:"Ask follow-up questions like 'what about ZIP 49503?' or 'should I list in March?' — context stays."},{icon:sre,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:S})=>c.jsxs("div",{className:"bg-card border border-border p-5",children:[c.jsx(b,{size:18,className:"text-primary mb-3"}),c.jsx("div",{className:"text-sm font-semibold mb-1.5",children:w}),c.jsx("div",{className:"text-xs text-foreground/70 leading-relaxed",children:S})]},w))})]}),c.jsxs("div",{className:"bg-muted/30 border border-border p-6 md:p-8",children:[c.jsx("div",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground mb-3",children:"Sample · Holden's Take"}),c.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."`}),c.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:S})=>c.jsxs("div",{className:"bg-background border border-border p-3",children:[c.jsx("div",{className:"text-[9px] uppercase tracking-[0.2em] text-muted-foreground mb-1",children:b}),c.jsx("div",{className:"text-lg font-bold tabular-nums",children:w}),c.jsx("div",{className:"text-[10px] text-foreground/60",children:S})]},b))}),c.jsxs("p",{className:"text-[10px] text-muted-foreground/70 mt-4",children:["Sample only · Your report uses live data for ZIP ",e]})]})]}),u&&c.jsxs("div",{className:"py-24 flex flex-col items-center text-center",children:[c.jsx(ga,{size:32,className:"animate-spin text-primary mb-4"}),c.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&&c.jsxs("div",{className:"py-16 max-w-md mx-auto text-center",children:[c.jsx(s1e,{size:32,className:"text-destructive mx-auto mb-3"}),c.jsx("p",{className:"text-sm text-foreground/80 mb-4",children:h}),c.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&&c.jsxs("div",{id:"market-pulse-report",className:"py-8 space-y-8",children:[c.jsxs("div",{className:"bg-primary text-primary-foreground p-5 md:p-6",children:[c.jsx("div",{className:"text-[10px] uppercase tracking-[0.25em] opacity-70 mb-1",children:"Holden's Take"}),c.jsx("p",{className:"text-lg md:text-xl leading-snug",children:s.holdens_take})]}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[c.jsx("div",{className:"lg:col-span-1",children:c.jsx(fbt,{value:s.heat_index,label:s.heat_label,lens:n})}),c.jsx("div",{className:"lg:col-span-2",children:c.jsx(gbt,{snapshot:s.snapshot,lens:n})})]}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[c.jsx(ybt,{data:s.price_trend_24mo}),c.jsx(vbt,{data:s.velocity_trend_12mo})]}),c.jsx(xbt,{percentile:s.metro_score_percentile,comps:s.metro_comps,zip:s.zip}),c.jsxs("div",{className:"bg-card border border-border p-6",children:[c.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?"}),c.jsx("p",{className:"text-lg font-semibold mb-2",children:s.now_or_wait.verdict}),c.jsx("p",{className:"text-sm text-foreground/80 leading-relaxed",children:s.now_or_wait.reasoning})]}),c.jsx(kbt,{md:s.writeup_md,area:s.area}),c.jsx(wbt,{}),n==="seller"?c.jsx(Cbt,{defaultPrice:s.snapshot.median_sale_price}):c.jsx(Sbt,{defaultPrice:s.snapshot.median_sale_price}),c.jsx(Ebt,{lens:n}),((x=s.sources)==null?void 0:x.length)>0&&c.jsxs("div",{className:"bg-card border border-border p-5",children:[c.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium mb-3",children:"Sources"}),c.jsx("ul",{className:"space-y-1.5 text-sm",children:s.sources.map((b,w)=>c.jsx("li",{children:c.jsx("a",{href:b.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:b.title})},w))}),c.jsx("p",{className:"text-[10px] text-muted-foreground/70 mt-3",children:"AI-researched · Not MLS-verified · Confirm with your agent before decisions."})]}),c.jsxs("div",{className:"bg-muted/30 border border-border p-5",children:[c.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium mb-3",children:"Take This Report With You"}),c.jsx(ajt,{payload:s,targetId:"market-pulse-report"})]})]})]})}),s&&c.jsx(Nbt,{}),s&&c.jsx(hjt,{payload:s,rates:o}),c.jsx(KD,{})]})}const fjt=[{icon:are,title:"Heat Index",desc:"Instant read on whether your ZIP is a buyer's, seller's, or balanced market."},{icon:tre,title:"Price & Velocity Trends",desc:"12-month median price and days-on-market charts pulled live."},{icon:HB,title:"Live Mortgage Rates",desc:"Today's 30-yr, 15-yr, and FHA rates refreshed daily."},{icon:Zne,title:"Net Sheet & PITI Calculators",desc:"Michigan-accurate seller proceeds and buyer payment math."},{icon:rA,title:"AI Chat with Holden's Take",desc:"Ask questions about your ZIP and get answers grounded in the report."},{icon:sre,title:"Downloadable Report",desc:"Save or share a clean PDF of your full market snapshot."}];function pjt(){return c.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[c.jsxs(ur,{children:[c.jsx("title",{children:"Market Pulse · Live Grand Rapids ZIP Reports · HoldenGR"}),c.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."}),c.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/market-pulse"})]}),c.jsx(mj,{}),c.jsxs("main",{className:"flex-1 pt-20",children:[c.jsx("section",{className:"border-b border-border bg-muted/30",children:c.jsx("div",{className:"container-page py-16 md:py-24",children:c.jsxs("div",{className:"grid md:grid-cols-2 gap-12 items-center",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[c.jsx(zs,{size:14,className:"text-primary"}),c.jsx("span",{className:"text-[10px] uppercase tracking-[0.3em] font-semibold text-primary",children:"Market Pulse"})]}),c.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-semibold tracking-tight mb-6",children:"Your ZIP. My take. Real numbers."}),c.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."}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Free · No login · Built and personally tuned by Holden Richardson, REALTOR®"})]}),c.jsx("div",{children:c.jsx(qD,{})})]})})}),c.jsxs("section",{className:"container-page py-16 md:py-24",children:[c.jsxs("div",{className:"max-w-2xl mb-12",children:[c.jsx("h2",{className:"text-2xl md:text-3xl font-semibold tracking-tight mb-3",children:"What you get"}),c.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."})]}),c.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-6",children:fjt.map(({icon:e,title:t,desc:n})=>c.jsxs("div",{className:"border border-border p-6 bg-background hover:border-primary/40 transition-colors",children:[c.jsx(e,{size:20,className:"text-primary mb-4"}),c.jsx("h3",{className:"font-semibold mb-2",children:t}),c.jsx("p",{className:"text-sm text-foreground/70",children:n})]},t))})]}),c.jsx("section",{className:"border-t border-border bg-muted/30",children:c.jsx("div",{className:"container-page py-16 md:pt-20 md:pb-28",children:c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[c.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=>c.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:[c.jsx("span",{className:"tabular-nums font-semibold",children:e.zip}),c.jsxs("span",{className:"text-foreground/60",children:["· ",e.label]})]},e.zip))]})})})]}),c.jsx(KD,{})]})}const V0e=Object.assign({"../pages/groovy.html":()=>aB(()=>import("./groovy-C3QU58Km.js"),[]).then(e=>e.default)});function mjt(e){const t=`../pages/${e}.html`;return Object.prototype.hasOwnProperty.call(V0e,t)?t:null}function gjt({slug:e}={}){const{slug:t}=om(),n=e??t??null,[r,i]=k.useState(null),[s,a]=k.useState(!1);if(k.useEffect(()=>{if(!n){a(!0);return}const u=mjt(n);if(!u){a(!0);return}const d=V0e[u];d().then(i).catch(()=>a(!0))},[n]),s||!n)return c.jsx(oj,{to:"/",replace:!0});if(r===null)return c.jsx("div",{className:"p-8 text-center",children:"Loading…"});const o=r.match(/<body[^>]*>([\s\S]*)<\/body>/i),l=o?o[1].trim():r;return c.jsx("div",{className:"migration-page-contents",dangerouslySetInnerHTML:{__html:l}})}const yjt=c.jsx(c.Fragment,{children:c.jsx(It,{path:"groovy",element:c.jsx(gjt,{slug:"groovy"})})}),vjt=new XSe,xjt=()=>{const e=jo();return k.useEffect(()=>{zBe()},[e.pathname]),null},wjt=()=>{const t=jo().pathname.replace(/^\/about\/news\//,"");return c.jsx(oj,{to:`/news/${t}`,replace:!0})},bjt=()=>c.jsx(jie,{children:c.jsx(nke,{client:vjt,children:c.jsxs(tD,{children:[c.jsx(y2e,{}),c.jsx(Y2e,{}),c.jsxs(uBe,{children:[c.jsx(VBe,{}),c.jsx(xjt,{}),c.jsxs(nBe,{children:[c.jsx(It,{path:"/",element:c.jsx(t4e,{})}),c.jsx(It,{path:"/properties",element:c.jsx(_4e,{})}),c.jsx(It,{path:"/properties/:id",element:c.jsx(E4e,{})}),c.jsx(It,{path:"/about",element:c.jsx(F4e,{})}),c.jsx(It,{path:"/about/testimonials",element:c.jsx(Q4e,{})}),c.jsx(It,{path:"/about/news",element:c.jsx(oj,{to:"/news",replace:!0})}),c.jsx(It,{path:"/about/news/:slug",element:c.jsx(wjt,{})}),c.jsx(It,{path:"/about/:slug",element:c.jsx(sB,{})}),c.jsx(It,{path:"/contact",element:c.jsx(q4e,{})}),c.jsx(It,{path:"/home-valuation",element:c.jsx(G4e,{})}),c.jsx(It,{path:"/idx",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/idx/:a",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/idx/:a/:b",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/idx/:a/:b/:c",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/idx/:a/:b/:c/:d",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/idx/*",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/client",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/client/:a",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/client/:a/:b",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/client/:a/:b/:c",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/client/:a/:b/:c/:d",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/r",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/r/:a",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/r/:a/:b",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/r/:a/:b/:c",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/search",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/search/:a",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/search/:a/:b",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/search/:a/:b/:c",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/preview-property",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/preview-property/:a",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/preview-property/:a/:b",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/magic-redirect",element:c.jsx(Pr,{})}),c.jsx(It,{path:"/auth",element:c.jsx(iOe,{})}),c.jsx(It,{path:"/blog",element:c.jsx(uOe,{})}),c.jsx(It,{path:"/blog/:slug",element:c.jsx(dOe,{})}),c.jsx(It,{path:"/faq",element:c.jsx(ADe,{})}),c.jsx(It,{path:"/news",element:c.jsx(pDe,{})}),c.jsx(It,{path:"/news/:slug",element:c.jsx(sB,{})}),c.jsx(It,{path:"/admin/blog",element:c.jsx(NKe,{})}),c.jsx(It,{path:"/admin/profile",element:c.jsx(jKe,{})}),c.jsx(It,{path:"/admin/aeo",element:c.jsx(ebt,{})}),c.jsx(It,{path:"/reset-password",element:c.jsx(tbt,{})}),c.jsx(It,{path:"/privacy-policy",element:c.jsx(nbt,{})}),c.jsx(It,{path:"/terms-of-service",element:c.jsx(rbt,{})}),c.jsx(It,{path:"/accessibility",element:c.jsx(ibt,{})}),c.jsx(It,{path:"/market-pulse",element:c.jsx(pjt,{})}),c.jsx(It,{path:"/market-pulse/:zip",element:c.jsx(Ajt,{})}),yjt,c.jsx(It,{path:"/:category",element:c.jsx(jge,{})}),c.jsx(It,{path:"/:category/:slug",element:c.jsx(Abt,{})}),c.jsx(It,{path:"/:category/:subcategory/:slug",element:c.jsx(sB,{})}),c.jsx(It,{path:"*",element:c.jsx(sbt,{})})]})]})]})})});wne(document.getElementById("root")).render(c.jsx(bjt,{}));export{Fh as c,En as g};