PageSourceSearch

https://stockholm-home-match.lovable.app/assets/index-B0-YMiCO.js

js stockholm-home-match.lovable.app collected 2026-10-03 03:37:34 UTC 2,116,485 bytes, 994 lines download raw bytes

vendor: 5,999 bytes, lines 1-9
1var Ree=Object.defineProperty;var TI=t=>{throw TypeError(t)};var Iee=(t,e,r)=>e in t?Ree(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var ao=(t,e,r)=>Iee(t,typeof e!="symbol"?e+"":e,r),GS=(t,e,r)=>e.has(t)||TI("Cannot "+r);var de=(t,e,r)=>(GS(t,e,"read from private field"),r?r.call(t):e.get(t)),Tt=(t,e,r)=>e.has(t)?TI("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),tt=(t,e,r,n)=>(GS(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),Mn=(t,e,r)=>(GS(t,e,"access private method"),r);var fx=(t,e,r,n)=>({set _(i){tt(t,e,i,r)},get _(){return de(t,e,n)}});function Lee(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(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"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(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 n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var Am=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function St(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var t8={exports:{}},G1={},r8={exports:{}},xt={};/**
2 * @license React
3 * react.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var dy=Symbol.for("react.element"),$ee=Symbol.for("react.portal"),Dee=Symbol.for("react.fragment"),Bee=Symbol.for("react.strict_mode"),Fee=Symbol.for("react.profiler"),zee=Symbol.for("react.provider"),Uee=Symbol.for("react.context"),Hee=Symbol.for("react.forward_ref"),Vee=Symbol.for("react.suspense"),Wee=Symbol.for("react.memo"),qee=Symbol.for("react.lazy"),AI=Symbol.iterator;function Kee(t){return t===null||typeof t!="object"?null:(t=AI&&t[AI]||t["@@iterator"],typeof t=="function"?t:null)}var n8={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},i8=Object.assign,s8={};function up(t,e,r){this.props=t,this.context=e,this.refs=s8,this.updater=r||n8}up.prototype.isReactComponent={};up.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};up.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function a8(){}a8.prototype=up.prototype;function NA(t,e,r){this.props=t,this.context=e,this.refs=s8,this.updater=r||n8}var CA=NA.prototype=new a8;CA.constructor=NA;i8(CA,up.prototype);CA.isPureReactComponent=!0;var PI=Array.isArray,o8=Object.prototype.hasOwnProperty,EA={current:null},l8={key:!0,ref:!0,__self:!0,__source:!0};function c8(t,e,r){var n,i={},s=null,a=null;if(e!=null)for(n in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(s=""+e.key),e)o8.call(e,n)&&!l8.hasOwnProperty(n)&&(i[n]=e[n]);var o=arguments.length-2;if(o===1)i.children=r;else if(1<o){for(var c=Array(o),u=0;u<o;u++)c[u]=arguments[u+2];i.children=c}if(t&&t.defaultProps)for(n in o=t.defaultProps,o)i[n]===void 0&&(i[n]=o[n]);return{$$typeof:dy,type:t,key:s,ref:a,props:i,_owner:EA.current}}function Gee(t,e){return{$$typeof:dy,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function OA(t){return typeof t=="object"&&t!==null&&t.$$typeof===dy}function Zee(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var MI=/\/+/g;function ZS(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Zee(""+t.key):e.toString(36)}function kb(t,e,r,n,i){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var a=!1;if(t===null)a=!0;else switch(s){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case dy:case $ee:a=!0}}if(a)return a=t,i=i(a),t=n===""?"."+ZS(a,0):n,PI(i)?(r="",t!=null&&(r=t.replace(MI,"$&/")+"/"),kb(i,e,r,"",function(u){return u})):i!=null&&(OA(i)&&(i=Gee(i,r+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(MI,"$&/")+"/")+t)),e.push(i)),1;if(a=0,n=n===""?".":n+":",PI(t))for(var o=0;o<t.length;o++){s=t[o];var c=n+ZS(s,o);a+=kb(s,e,r,c,i)}else if(c=Kee(t),typeof c=="function")for(t=c.call(t),o=0;!(s=t.next()).done;)s=s.value,c=n+ZS(s,o++),a+=kb(s,e,r,c,i);else if(s==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return a}function hx(t,e,r){if(t==null)return t;var n=[],i=0;return kb(t,n,"","",function(s){return e.call(r,s,i++)}),n}function Jee(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var ci={current:null},Sb={transition:null},Yee={ReactCurrentDispatcher:ci,ReactCurrentBatchConfig:Sb,ReactCurrentOwner:EA};function u8(){throw Error("act(...) is not supported in production builds of React.")}
vendor: 4,508 bytes, lines 9-25
9xt.Children={map:hx,forEach:function(t,e,r){hx(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return hx(t,function(){e++}),e},toArray:function(t){return hx(t,function(e){return e})||[]},only:function(t){if(!OA(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};xt.Component=up;xt.Fragment=Dee;xt.Profiler=Fee;xt.PureComponent=NA;xt.StrictMode=Bee;xt.Suspense=Vee;xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yee;xt.act=u8;xt.cloneElement=function(t,e,r){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=i8({},t.props),i=t.key,s=t.ref,a=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,a=EA.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var o=t.type.defaultProps;for(c in e)o8.call(e,c)&&!l8.hasOwnProperty(c)&&(n[c]=e[c]===void 0&&o!==void 0?o[c]:e[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){o=Array(c);for(var u=0;u<c;u++)o[u]=arguments[u+2];n.children=o}return{$$typeof:dy,type:t.type,key:i,ref:s,props:n,_owner:a}};xt.createContext=function(t){return t={$$typeof:Uee,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:zee,_context:t},t.Consumer=t};xt.createElement=c8;xt.createFactory=function(t){var e=c8.bind(null,t);return e.type=t,e};xt.createRef=function(){return{current:null}};xt.forwardRef=function(t){return{$$typeof:Hee,render:t}};xt.isValidElement=OA;xt.lazy=function(t){return{$$typeof:qee,_payload:{_status:-1,_result:t},_init:Jee}};xt.memo=function(t,e){return{$$typeof:Wee,type:t,compare:e===void 0?null:e}};xt.startTransition=function(t){var e=Sb.transition;Sb.transition={};try{t()}finally{Sb.transition=e}};xt.unstable_act=u8;xt.useCallback=function(t,e){return ci.current.useCallback(t,e)};xt.useContext=function(t){return ci.current.useContext(t)};xt.useDebugValue=function(){};xt.useDeferredValue=function(t){return ci.current.useDeferredValue(t)};xt.useEffect=function(t,e){return ci.current.useEffect(t,e)};xt.useId=function(){return ci.current.useId()};xt.useImperativeHandle=function(t,e,r){return ci.current.useImperativeHandle(t,e,r)};xt.useInsertionEffect=function(t,e){return ci.current.useInsertionEffect(t,e)};xt.useLayoutEffect=function(t,e){return ci.current.useLayoutEffect(t,e)};xt.useMemo=function(t,e){return ci.current.useMemo(t,e)};xt.useReducer=function(t,e,r){return ci.current.useReducer(t,e,r)};xt.useRef=function(t){return ci.current.useRef(t)};xt.useState=function(t){return ci.current.useState(t)};xt.useSyncExternalStore=function(t,e,r){return ci.current.useSyncExternalStore(t,e,r)};xt.useTransition=function(){return ci.current.useTransition()};xt.version="18.3.1";r8.exports=xt;var x=r8.exports;const D=St(x),TA=Lee({__proto__:null,default:D},[x]);/**
10 * @license React
11 * react-jsx-runtime.production.min.js
12 *
13 * Copyright (c) Facebook, Inc. and its affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var Xee=x,Qee=Symbol.for("react.element"),ete=Symbol.for("react.fragment"),tte=Object.prototype.hasOwnProperty,rte=Xee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,nte={key:!0,ref:!0,__self:!0,__source:!0};function d8(t,e,r){var n,i={},s=null,a=null;r!==void 0&&(s=""+r),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(a=e.ref);for(n in e)tte.call(e,n)&&!nte.hasOwnProperty(n)&&(i[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:Qee,type:t,key:s,ref:a,props:i,_owner:rte.current}}G1.Fragment=ete;G1.jsx=d8;G1.jsxs=d8;t8.exports=G1;var l=t8.exports,f8={exports:{}},es={},h8={exports:{}},p8={};/**
18 * @license React
19 * scheduler.production.min.js
20 *
21 * Copyright (c) Facebook, Inc. and its affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */(function(t){function e(z,H){var G=z.length;z.push(H);e:for(;0<G;){var Y=G-1>>>1,U=z[Y];if(0<i(U,H))z[Y]=H,z[G]=U,G=Y;else break e}}function r(z){return z.length===0?null:z[0]}function n(z){if(z.length===0)return null;var H=z[0],G=z.pop();if(G!==H){z[0]=G;e:for(var Y=0,U=z.length,J=U>>>1;Y<J;){var te=2*(Y+1)-1,re=z[te],ae=te+1,oe=z[ae];if(0>i(re,G))ae<U&&0>i(oe,re)?(z[Y]=oe,z[ae]=G,Y=ae):(z[Y]=re,z[te]=G,Y=te);else if(ae<U&&0>i(oe,G))z[Y]=oe,z[ae]=G,Y=ae;else break e}}return H}
vendor: 8,972 bytes, lines 25-33
25function i(z,H){var G=z.sortIndex-H.sortIndex;return G!==0?G:z.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var c=[],u=[],d=1,f=null,p=3,m=!1,y=!1,v=!1,w=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(z){for(var H=r(u);H!==null;){if(H.callback===null)n(u);else if(H.startTime<=z)n(u),H.sortIndex=H.expirationTime,e(c,H);else break;H=r(u)}}function N(z){if(v=!1,S(z),!y)if(r(c)!==null)y=!0,V(j);else{var H=r(u);H!==null&&W(N,H.startTime-z)}}function j(z,H){y=!1,v&&(v=!1,b(P),P=-1),m=!0;var G=p;try{for(S(H),f=r(c);f!==null&&(!(f.expirationTime>H)||z&&!B());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,p=f.priorityLevel;var U=Y(f.expirationTime<=H);H=t.unstable_now(),typeof U=="function"?f.callback=U:f===r(c)&&n(c),S(H)}else n(c);f=r(c)}if(f!==null)var J=!0;else{var te=r(u);te!==null&&W(N,te.startTime-H),J=!1}return J}finally{f=null,p=G,m=!1}}var C=!1,O=null,P=-1,T=5,$=-1;function B(){return!(t.unstable_now()-$<T)}function R(){if(O!==null){var z=t.unstable_now();$=z;var H=!0;try{H=O(!0,z)}finally{H?M():(C=!1,O=null)}}else C=!1}var M;if(typeof _=="function")M=function(){_(R)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,q=F.port2;F.port1.onmessage=R,M=function(){q.postMessage(null)}}else M=function(){w(R,0)};function V(z){O=z,C||(C=!0,M())}function W(z,H){P=w(function(){z(t.unstable_now())},H)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(z){z.callback=null},t.unstable_continueExecution=function(){y||m||(y=!0,V(j))},t.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<z?Math.floor(1e3/z):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(c)},t.unstable_next=function(z){switch(p){case 1:case 2:case 3:var H=3;break;default:H=p}var G=p;p=H;try{return z()}finally{p=G}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(z,H){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var G=p;p=z;try{return H()}finally{p=G}},t.unstable_scheduleCallback=function(z,H,G){var Y=t.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?Y+G:Y):G=Y,z){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=G+U,z={id:d++,callback:H,priorityLevel:z,startTime:G,expirationTime:U,sortIndex:-1},G>Y?(z.sortIndex=G,e(u,z),r(c)===null&&z===r(u)&&(v?(b(P),P=-1):v=!0,W(N,G-Y))):(z.sortIndex=U,e(c,z),y||m||(y=!0,V(j))),z},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(z){var H=p;return function(){var G=p;p=H;try{return z.apply(this,arguments)}finally{p=G}}}})(p8);h8.exports=p8;var ite=h8.exports;/**
26 * @license React
27 * react-dom.production.min.js
28 *
29 * Copyright (c) Facebook, Inc. and its affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var ste=x,Ji=ite;function ye(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var m8=new Set,Eg={};function pd(t,e){ph(t,e),ph(t+"Capture",e)}function ph(t,e){for(Eg[t]=e,t=0;t<e.length;t++)m8.add(e[t])}var Lo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gC=Object.prototype.hasOwnProperty,ate=/^[: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]*$/,RI={},II={};function ote(t){return gC.call(II,t)?!0:gC.call(RI,t)?!1:ate.test(t)?II[t]=!0:(RI[t]=!0,!1)}function lte(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function cte(t,e,r,n){if(e===null||typeof e>"u"||lte(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function ui(t,e,r,n,i,s,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=a}var An={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){An[t]=new ui(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];An[e]=new ui(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){An[t]=new ui(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){An[t]=new ui(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){An[t]=new ui(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){An[t]=new ui(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){An[t]=new ui(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){An[t]=new ui(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){An[t]=new ui(t,5,!1,t.toLowerCase(),null,!1,!1)});var AA=/[\-:]([a-z])/g;function PA(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(AA,PA);An[e]=new ui(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(AA,PA);An[e]=new ui(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(AA,PA);An[e]=new ui(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){An[t]=new ui(t,1,!1,t.toLowerCase(),null,!1,!1)});An.xlinkHref=new ui("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){An[t]=new ui(t,1,!1,t.toLowerCase(),null,!0,!0)});function MA(t,e,r,n){var i=An.hasOwnProperty(e)?An[e]:null;(i!==null?i.type!==0:n||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(cte(e,r,i,n)&&(r=null),n||i===null?ote(e)&&(r===null?t.removeAttribute(e):t.setAttribute(e,""+r)):i.mustUseProperty?t[i.propertyName]=r===null?i.type===3?!1:"":r:(e=i.attributeName,n=i.attributeNamespace,r===null?t.removeAttribute(e):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,n?t.setAttributeNS(n,e,r):t.setAttribute(e,r))))}
vendor: 9,694 bytes, lines 33-37
33var Yo=ste.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,px=Symbol.for("react.element"),vf=Symbol.for("react.portal"),yf=Symbol.for("react.fragment"),RA=Symbol.for("react.strict_mode"),vC=Symbol.for("react.profiler"),g8=Symbol.for("react.provider"),v8=Symbol.for("react.context"),IA=Symbol.for("react.forward_ref"),yC=Symbol.for("react.suspense"),xC=Symbol.for("react.suspense_list"),LA=Symbol.for("react.memo"),bl=Symbol.for("react.lazy"),y8=Symbol.for("react.offscreen"),LI=Symbol.iterator;function nm(t){return t===null||typeof t!="object"?null:(t=LI&&t[LI]||t["@@iterator"],typeof t=="function"?t:null)}var yr=Object.assign,JS;function Pm(t){if(JS===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);JS=e&&e[1]||""}return`
34`+JS+t}var YS=!1;function XS(t,e){if(!t||YS)return"";YS=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var n=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){n=u}t.call(e.prototype)}else{try{throw Error()}catch(u){n=u}t()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var i=u.stack.split(`
35`),s=n.stack.split(`
36`),a=i.length-1,o=s.length-1;1<=a&&0<=o&&i[a]!==s[o];)o--;for(;1<=a&&0<=o;a--,o--)if(i[a]!==s[o]){if(a!==1||o!==1)do if(a--,o--,0>o||i[a]!==s[o]){var c=`
37`+i[a].replace(" at new "," at ");return t.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",t.displayName)),c}while(1<=a&&0<=o);break}}}finally{YS=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Pm(t):""}function ute(t){switch(t.tag){case 5:return Pm(t.type);case 16:return Pm("Lazy");case 13:return Pm("Suspense");case 19:return Pm("SuspenseList");case 0:case 2:case 15:return t=XS(t.type,!1),t;case 11:return t=XS(t.type.render,!1),t;case 1:return t=XS(t.type,!0),t;default:return""}}function bC(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case yf:return"Fragment";case vf:return"Portal";case vC:return"Profiler";case RA:return"StrictMode";case yC:return"Suspense";case xC:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case v8:return(t.displayName||"Context")+".Consumer";case g8:return(t._context.displayName||"Context")+".Provider";case IA:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case LA:return e=t.displayName||null,e!==null?e:bC(t.type)||"Memo";case bl:e=t._payload,t=t._init;try{return bC(t(e))}catch{}}return null}function dte(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return bC(e);case 8:return e===RA?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function pc(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function x8(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function fte(t){var e=x8(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(a){n=""+a,s.call(this,a)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function mx(t){t._valueTracker||(t._valueTracker=fte(t))}function b8(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=x8(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function Qb(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function wC(t,e){var r=e.checked;return yr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function $I(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=pc(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function w8(t,e){e=e.checked,e!=null&&MA(t,"checked",e,!1)}function _C(t,e){w8(t,e);var r=pc(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?kC(t,e.type,r):e.hasOwnProperty("defaultValue")&&kC(t,e.type,pc(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function DI(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function kC(t,e,r){(e!=="number"||Qb(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var Mm=Array.isArray;function $f(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i<r.length;i++)e["$"+r[i]]=!0;for(r=0;r<t.length;r++)i=e.hasOwnProperty("$"+t[r].value),t[r].selected!==i&&(t[r].selected=i),i&&n&&(t[r].defaultSelected=!0)}else{for(r=""+pc(r),e=null,i=0;i<t.length;i++){if(t[i].value===r){t[i].selected=!0,n&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function SC(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(ye(91));return yr({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function BI(t,e){var r=e.value;if(r==null){if(r=e.children,e=e.defaultValue,r!=null){if(e!=null)throw Error(ye(92));if(Mm(r)){if(1<r.length)throw Error(ye(93));r=r[0]}e=r}e==null&&(e=""),r=e}t._wrapperState={initialValue:pc(r)}}function _8(t,e){var r=pc(e.value),n=pc(e.defaultValue);r!=null&&(r=""+r,r!==t.value&&(t.value=r),e.defaultValue==null&&t.defaultValue!==r&&(t.defaultValue=r)),n!=null&&(t.defaultValue=""+n)}function FI(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function k8(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function jC(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?k8(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var gx,S8=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,r,n,i){MSApp.execUnsafeLocalFunction(function(){return t(e,r,n,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(gx=gx||document.createElement("div"),gx.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=gx.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Og(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Km={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},hte=["Webkit","ms","Moz","O"];Object.keys(Km).forEach(function(t){hte.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Km[e]=Km[t]})});function j8(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Km.hasOwnProperty(t)&&Km[t]?(""+e).trim():e+"px"}function N8(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=j8(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var pte=yr({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 NC(t,e){if(e){if(pte[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(ye(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(ye(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(ye(61))}if(e.style!=null&&typeof e.style!="object")throw Error(ye(62))}}function CC(t,e){if(t.indexOf("-")===-1)return typeof e.is=="str
37ing";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var EC=null;function $A(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var OC=null,Df=null,Bf=null;function zI(t){if(t=py(t)){if(typeof OC!="function")throw Error(ye(280));var e=t.stateNode;e&&(e=Q1(e),OC(t.stateNode,t.type,e))}}function C8(t){Df?Bf?Bf.push(t):Bf=[t]:Df=t}function E8(){if(Df){var t=Df,e=Bf;if(Bf=Df=null,zI(t),e)for(t=0;t<e.length;t++)zI(e[t])}}function O8(t,e){return t(e)}function T8(){}var QS=!1;function A8(t,e,r){if(QS)return t(e,r);QS=!0;try{return O8(t,e,r)}finally{QS=!1,(Df!==null||Bf!==null)&&(T8(),E8())}}function Tg(t,e){var r=t.stateNode;if(r===null)return null;var n=Q1(r);if(n===null)return null;r=n[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(t=t.type,n=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!n;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(ye(231,e,typeof r));return r}var TC=!1;if(Lo)try{var im={};Object.defineProperty(im,"passive",{get:function(){TC=!0}}),window.addEventListener("test",im,im),window.removeEventListener("test",im,im)}catch{TC=!1}function mte(t,e,r,n,i,s,a,o,c){var u=Array.prototype.slice.call(arguments,3);try{e.apply(r,u)}catch(d){this.onError(d)}}var Gm=!1,e0=null,t0=!1,AC=null,gte={onError:function(t){Gm=!0,e0=t}};function vte(t,e,r,n,i,s,a,o,c){Gm=!1,e0=null,mte.apply(gte,arguments)}function yte(t,e,r,n,i,s,a,o,c){if(vte.apply(this,arguments),Gm){if(Gm){var u=e0;Gm=!1,e0=null}else throw Error(ye(198));t0||(t0=!0,AC=u)}}function md(t){var e=t,r=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(r=e.return),t=e.return;while(t)}return e.tag===3?r:null}function P8(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function UI(t){if(md(t)!==t)throw Error(ye(188))}function xte(t){var e=t.alternate;if(!e){if(e=md(t),e===null)throw Error(ye(188));return e!==t?null:t}for(var r=t,n=e;;){var i=r.return;if(i===null)break;var s=i.alternate;if(s===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===r)return UI(i),t;if(s===n)return UI(i),e;s=s.sibling}throw Error(ye(188))}if(r.return!==n.return)r=i,n=s;else{for(var a=!1,o=i.child;o;){if(o===r){a=!0,r=i,n=s;break}if(o===n){a=!0,n=i,r=s;break}o=o.sibling}if(!a){for(o=s.child;o;){if(o===r){a=!0,r=s,n=i;break}if(o===n){a=!0,n=s,r=i;break}o=o.sibling}if(!a)throw Error(ye(189))}}if(r.alternate!==n)throw Error(ye(190))}if(r.tag!==3)throw Error(ye(188));return r.stateNode.current===r?t:e}function M8(t){return t=xte(t),t!==null?R8(t):null}function R8(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=R8(t);if(e!==null)return e;t=t.sibling}return null}var I8=Ji.unstable_scheduleCallback,HI=Ji.unstable_cancelCallback,bte=Ji.unstable_shouldYield,wte=Ji.unstable_requestPaint,Ar=Ji.unstable_now,_te=Ji.unstable_getCurrentPriorityLevel,DA=Ji.unstable_ImmediatePriority,L8=Ji.unstable_UserBlockingPriority,r0=Ji.unstable_NormalPriority,kte=Ji.unstable_LowPriority,$8=Ji.unstable_IdlePriority,Z1=null,Fa=null;function Ste(t){if(Fa&&typeof Fa.onCommitFiberRoot=="function")try{Fa.onCommitFiberRoot(Z1,t,void 0,(t.current.flags&128)===128)}catch{}}var la=Math.clz32?Math.clz32:Cte,jte=Math.log,Nte=Math.LN2;function Cte(t){return t>>>=0,t===0?32:31-(jte(t)/Nte|0)|0}var vx=64,yx=4194304;function Rm(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function n0(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,s=t.pingedLanes,a=r&268435455;if(a!==0){var o=a&~i;o!==0?n=Rm(o):(s&=a,s!==0&&(n=Rm(s)))}else a=r&~i,a!==0?n=Rm(a):s!==0&&(n=Rm(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0<e;)r=31-la(e),i=1<<r,n|=t[r],e&=~i;return n}function Ete(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ote(t,e){for(var r=t.suspendedLanes,n=t.pingedLanes,i=t.expirationTimes,s=t.pendingLanes;0<s;){var a=31-la(s),o=1<<a,c=i[a];c===-1?(!(o&r)||o&n)&&(i[a]=Ete(o,e)):c<=e&&(t.expiredLanes|=o),s&=~o}}function PC(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function D8(){var t=vx;return vx<<=1,!(vx&4194240)&&(vx=64),t}function ej(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function fy(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-la(e),t[e]=r}function Tte(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0<r;){var i=31-la(r),s=1<<i;e[i]=0,n[i]=-1,t[i]=-1,r&=~s}}function BA(t,e){var r=t.entangledLanes|=e;for(t=t.entanglements;r;){var n=31-la(r),i=1<<n;i&e|t[n]&e&&(t[n]|=e),r&=~i}}var It=0;function B8(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var F8,FA,z8,U8,H8,MC=!1,xx=[],Jl=null,Yl=null,Xl=null,Ag=new Map,Pg=new Map,Ol=[],Ate="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 VI(t,e){switch(t){case"focusin":case"focusout":Jl=null;break;case"dragenter":case"dragleave":Yl=null;break;case"mouseover":case"mouseout":Xl=null;break;case"pointerover":case"pointerout":Ag.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pg.delete(e.pointerId)}}function sm(t,e,r,n,i,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:r,eventSystemFlags:n,nativeEvent:s,targetContainers:[i]},e!==null&&(e=py(e),e!==null&&FA(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function Pte(t,e,r,n,i){switch(e){case"focusin":return Jl=sm(Jl,t,e,r,n,i),!0;case"dragenter":return Yl=sm(Yl,t,e,r,n,i),!0;case"mouseover":return Xl=sm(Xl,t,e,r,n,i),!0;case"pointerover":var s=i.pointerId;return Ag.set(s,sm(Ag.get(s)||null,t,e,r,n,i)),!0;case"gotpointercapture":return s=i.pointerId,Pg.set(s,sm(Pg.get(s)||null,t,e,r,n,i)),!0}return!1}function V8(t){var e=vu(t.target);if(e!==null){var r=md(e);if(r!==null){if(e=r.tag,e===13){if(e=P8(r),e!==null){t.blockedOn=e,H8(t.priority,function(){z8(r)});return}}else if(e===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function jb(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var r=RC(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(r===null){r=t.nativeEvent;var n=new r.constructor(r.type,r);EC=n,r.target.dispatchEvent(n),EC=null}else return e=py(r),e!==null&&FA(e),t.blockedOn=r,!1;e.shift()}return!0}function WI(t,e,r){jb(t)&&r.delete(e)}function Mte(){MC=!1,Jl!==null&&jb(Jl)&&(Jl=null),Yl!==null&&jb(Yl)&&(Yl=null),Xl!==null&&jb(Xl)&&(Xl=null),Ag.forEach(WI),Pg.forEach(WI)}function am(t,e){t.blockedOn===e&&(t.blockedOn=null,MC||(MC=!0,Ji.unstable_scheduleCallback(Ji.unstable_NormalPriority,Mte)))}function Mg(t){function e(i){return am(i,t)}if(0<xx.length){am(xx[0],t);for(var r=1;r<xx.length;r++){var n=xx[r];n.blockedOn===t&&(n.blockedOn=null)}}for(Jl!==null&&am(Jl,t),Yl!==null&&am(Yl,t),Xl!==null&&am(Xl,t),Ag.forEach(e),Pg.forEach(e),r=0;r<Ol.length;r++)n=Ol[r],n.blockedOn===t&&(n.blockedOn=null);for(;0<Ol.length&&(r=Ol[0],r.blockedOn===null);)V8(r),r.blockedOn===null&&Ol.shift()}var Ff=Yo.ReactCurrentBatchConfig,i0=!0;function Rte(t,e,r,n){var i=It,s=Ff.transition;Ff.transition=null;try{It=1,zA(t,e,r,n)}finally{It=i,Ff.transition=s}}function Ite(t,e,r,n){var i=It,s=Ff.transition;Ff.transition=null;try{It=4,zA(t,e,r,n)}finally{It=i,Ff.transition=s}}function zA(t,e,r,n){if(i0){var i=RC(t,e,r,n);if(i===null)uj(t,e,n,s0,r),VI(t,n);else if(Pte(i,t,e,r,n))n.stopPropagation();else if(VI(t,n),e&4&&-1<Ate.indexOf(t)){for(;i!==null;){var s=py(i);if(s!==null&&F8(s),s=RC(t,e,r,n),s===null&&uj(t,e,n,s0,r),s===i)break;i=s}i!==null&&n.stopPropagation()}else uj(t,e,n,null,r)}}var s0=null;function RC(t,e,r,n){if(s0=null,t=$A(n),t=vu(t),t!==null)if(e=md(t),e===null)t=null;else if(r=e.tag,r===13){if(t=P8(e),t!==null)return t;t=null}else if(r===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return s0=t,null}
vendor: 10,457 bytes, line 37
37function W8(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(_te()){case DA:return 1;case L8:return 4;case r0:case kte:return 16;case $8:return 536870912;default:return 16}default:return 16}}var Ul=null,UA=null,Nb=null;function q8(){if(Nb)return Nb;var t,e=UA,r=e.length,n,i="value"in Ul?Ul.value:Ul.textContent,s=i.length;for(t=0;t<r&&e[t]===i[t];t++);var a=r-t;for(n=1;n<=a&&e[r-n]===i[s-n];n++);return Nb=i.slice(t,1<n?1-n:void 0)}function Cb(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function bx(){return!0}function qI(){return!1}function ts(t){function e(r,n,i,s,a){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=s,this.target=a,this.currentTarget=null;for(var o in t)t.hasOwnProperty(o)&&(r=t[o],this[o]=r?r(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?bx:qI,this.isPropagationStopped=qI,this}return yr(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=bx)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=bx)},persist:function(){},isPersistent:bx}),e}var dp={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},HA=ts(dp),hy=yr({},dp,{view:0,detail:0}),Lte=ts(hy),tj,rj,om,J1=yr({},hy,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:VA,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==om&&(om&&t.type==="mousemove"?(tj=t.screenX-om.screenX,rj=t.screenY-om.screenY):rj=tj=0,om=t),tj)},movementY:function(t){return"movementY"in t?t.movementY:rj}}),KI=ts(J1),$te=yr({},J1,{dataTransfer:0}),Dte=ts($te),Bte=yr({},hy,{relatedTarget:0}),nj=ts(Bte),Fte=yr({},dp,{animationName:0,elapsedTime:0,pseudoElement:0}),zte=ts(Fte),Ute=yr({},dp,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Hte=ts(Ute),Vte=yr({},dp,{data:0}),GI=ts(Vte),Wte={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qte={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"},Kte={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Gte(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=Kte[t])?!!e[t]:!1}function VA(){return Gte}var Zte=yr({},hy,{key:function(t){if(t.key){var e=Wte[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Cb(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?qte[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:VA,charCode:function(t){return t.type==="keypress"?Cb(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Cb(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Jte=ts(Zte),Yte=yr({},J1,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ZI=ts(Yte),Xte=yr({},hy,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:VA}),Qte=ts(Xte),ere=yr({},dp,{propertyName:0,elapsedTime:0,pseudoElement:0}),tre=ts(ere),rre=yr({},J1,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),nre=ts(rre),ire=[9,13,27,32],WA=Lo&&"CompositionEvent"in window,Zm=null;Lo&&"documentMode"in document&&(Zm=document.documentMode);var sre=Lo&&"TextEvent"in window&&!Zm,K8=Lo&&(!WA||Zm&&8<Zm&&11>=Zm),JI=" ",YI=!1;function G8(t,e){switch(t){case"keyup":return ire.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Z8(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var xf=!1;function are(t,e){switch(t){case"compositionend":return Z8(e);case"keypress":return e.which!==32?null:(YI=!0,JI);case"textInput":return t=e.data,t===JI&&YI?null:t;default:return null}}function ore(t,e){if(xf)return t==="compositionend"||!WA&&G8(t,e)?(t=q8(),Nb=UA=Ul=null,xf=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return K8&&e.locale!=="ko"?null:e.data;default:return null}}var lre={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 XI(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!lre[t.type]:e==="textarea"}function J8(t,e,r,n){C8(n),e=a0(e,"onChange"),0<e.length&&(r=new HA("onChange","change",null,r,n),t.push({event:r,listeners:e}))}var Jm=null,Rg=null;function cre(t){o6(t,0)}function Y1(t){var e=_f(t);if(b8(e))return t}function ure(t,e){if(t==="change")return e}var Y8=!1;if(Lo){var ij;if(Lo){var sj="oninput"in document;if(!sj){var QI=document.createElement("div");QI.setAttribute("oninput","return;"),sj=typeof QI.oninput=="function"}ij=sj}else ij=!1;Y8=ij&&(!document.documentMode||9<document.documentMode)}function eL(){Jm&&(Jm.detachEvent("onpropertychange",X8),Rg=Jm=null)}function X8(t){if(t.propertyName==="value"&&Y1(Rg)){var e=[];J8(e,Rg,t,$A(t)),A8(cre,e)}}function dre(t,e,r){t==="focusin"?(eL(),Jm=e,Rg=r,Jm.attachEvent("onpropertychange",X8)):t==="focusout"&&eL()}function fre(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Y1(Rg)}function hre(t,e){if(t==="click")return Y1(e)}function pre(t,e){if(t==="input"||t==="change")return Y1(e)}function mre(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var da=typeof Object.is=="function"?Object.is:mre;function Ig(t,e){if(da(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!gC.call(e,i)||!da(t[i],e[i]))return!1}return!0}function tL(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function rL(t,e){var r=tL(t);t=0;for(var n;r;){if(r.nodeType===3){if(n=t+r.textContent.length,t<=e&&n>=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=tL(r)}}function Q8(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Q8(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function e6(){for(var t=window,e=Qb();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=Qb(t.document)}return e}function qA(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function gre(t){var e=e6(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&Q8(r.ownerDocument.documentElement,r)){if(n!==null&&qA(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!t.extend&&s>n&&(i=n,n=s,s=i),i=rL(r,s);var a=rL(r,n);i&&a&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>n?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<e.length;r++)t=e[r],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var vre=Lo&&"documentMode"in document&&11>=document.documentMode,bf=null,IC=null,Ym=null,LC=!1;function nL(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;LC||bf==null||bf!==Qb(n)||(n=bf,"selectionStart"in n&&qA(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focu
vendor: 4,392 bytes, line 37
37sNode:n.focusNode,focusOffset:n.focusOffset}),Ym&&Ig(Ym,n)||(Ym=n,n=a0(IC,"onSelect"),0<n.length&&(e=new HA("onSelect","select",null,e,r),t.push({event:e,listeners:n}),e.target=bf)))}function wx(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var wf={animationend:wx("Animation","AnimationEnd"),animationiteration:wx("Animation","AnimationIteration"),animationstart:wx("Animation","AnimationStart"),transitionend:wx("Transition","TransitionEnd")},aj={},t6={};Lo&&(t6=document.createElement("div").style,"AnimationEvent"in window||(delete wf.animationend.animation,delete wf.animationiteration.animation,delete wf.animationstart.animation),"TransitionEvent"in window||delete wf.transitionend.transition);function X1(t){if(aj[t])return aj[t];if(!wf[t])return t;var e=wf[t],r;for(r in e)if(e.hasOwnProperty(r)&&r in t6)return aj[t]=e[r];return t}var r6=X1("animationend"),n6=X1("animationiteration"),i6=X1("animationstart"),s6=X1("transitionend"),a6=new Map,iL="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 Sc(t,e){a6.set(t,e),pd(e,[t])}for(var oj=0;oj<iL.length;oj++){var lj=iL[oj],yre=lj.toLowerCase(),xre=lj[0].toUpperCase()+lj.slice(1);Sc(yre,"on"+xre)}Sc(r6,"onAnimationEnd");Sc(n6,"onAnimationIteration");Sc(i6,"onAnimationStart");Sc("dblclick","onDoubleClick");Sc("focusin","onFocus");Sc("focusout","onBlur");Sc(s6,"onTransitionEnd");ph("onMouseEnter",["mouseout","mouseover"]);ph("onMouseLeave",["mouseout","mouseover"]);ph("onPointerEnter",["pointerout","pointerover"]);ph("onPointerLeave",["pointerout","pointerover"]);pd("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));pd("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));pd("onBeforeInput",["compositionend","keypress","textInput","paste"]);pd("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));pd("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));pd("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Im="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(" "),bre=new Set("cancel close invalid load scroll toggle".split(" ").concat(Im));function sL(t,e,r){var n=t.type||"unknown-event";t.currentTarget=r,yte(n,e,void 0,t),t.currentTarget=null}function o6(t,e){e=(e&4)!==0;for(var r=0;r<t.length;r++){var n=t[r],i=n.event;n=n.listeners;e:{var s=void 0;if(e)for(var a=n.length-1;0<=a;a--){var o=n[a],c=o.instance,u=o.currentTarget;if(o=o.listener,c!==s&&i.isPropagationStopped())break e;sL(i,o,u),s=c}else for(a=0;a<n.length;a++){if(o=n[a],c=o.instance,u=o.currentTarget,o=o.listener,c!==s&&i.isPropagationStopped())break e;sL(i,o,u),s=c}}}if(t0)throw t=AC,t0=!1,AC=null,t}function tr(t,e){var r=e[zC];r===void 0&&(r=e[zC]=new Set);var n=t+"__bubble";r.has(n)||(l6(e,t,2,!1),r.add(n))}function cj(t,e,r){var n=0;e&&(n|=4),l6(r,t,n,e)}var _x="_reactListening"+Math.random().toString(36).slice(2);function Lg(t){if(!t[_x]){t[_x]=!0,m8.forEach(function(r){r!=="selectionchange"&&(bre.has(r)||cj(r,!1,t),cj(r,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[_x]||(e[_x]=!0,cj("selectionchange",!1,e))}}function l6(t,e,r,n){switch(W8(e)){case 1:var i=Rte;break;case 4:i=Ite;break;default:i=zA}r=i.bind(null,e,r,t),i=void 0,!TC||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),n?i!==void 0?t.addEventListener(e,r,{capture:!0,passive:i}):t.addEventListener(e,r,!0):i!==void 0?t.addEventListener(e,r,{passive:i}):t.addEventListener(e,r,!1)}function uj(t,e,r,n,i){var s=n;
vendor: 5,458 bytes, lines 37-38
37if(!(e&1)&&!(e&2)&&n!==null)e:for(;;){if(n===null)return;var a=n.tag;if(a===3||a===4){var o=n.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.parentNode===i)break;if(a===4)for(a=n.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;a=a.return}for(;o!==null;){if(a=vu(o),a===null)return;if(c=a.tag,c===5||c===6){n=s=a;continue e}o=o.parentNode}}n=n.return}A8(function(){var u=s,d=$A(r),f=[];e:{var p=a6.get(t);if(p!==void 0){var m=HA,y=t;switch(t){case"keypress":if(Cb(r)===0)break e;case"keydown":case"keyup":m=Jte;break;case"focusin":y="focus",m=nj;break;case"focusout":y="blur",m=nj;break;case"beforeblur":case"afterblur":m=nj;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=KI;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=Dte;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=Qte;break;case r6:case n6:case i6:m=zte;break;case s6:m=tre;break;case"scroll":m=Lte;break;case"wheel":m=nre;break;case"copy":case"cut":case"paste":m=Hte;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=ZI}var v=(e&4)!==0,w=!v&&t==="scroll",b=v?p!==null?p+"Capture":null:p;v=[];for(var _=u,S;_!==null;){S=_;var N=S.stateNode;if(S.tag===5&&N!==null&&(S=N,b!==null&&(N=Tg(_,b),N!=null&&v.push($g(_,N,S)))),w)break;_=_.return}0<v.length&&(p=new m(p,y,null,r,d),f.push({event:p,listeners:v}))}}if(!(e&7)){e:{if(p=t==="mouseover"||t==="pointerover",m=t==="mouseout"||t==="pointerout",p&&r!==EC&&(y=r.relatedTarget||r.fromElement)&&(vu(y)||y[$o]))break e;if((m||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,m?(y=r.relatedTarget||r.toElement,m=u,y=y?vu(y):null,y!==null&&(w=md(y),y!==w||y.tag!==5&&y.tag!==6)&&(y=null)):(m=null,y=u),m!==y)){if(v=KI,N="onMouseLeave",b="onMouseEnter",_="mouse",(t==="pointerout"||t==="pointerover")&&(v=ZI,N="onPointerLeave",b="onPointerEnter",_="pointer"),w=m==null?p:_f(m),S=y==null?p:_f(y),p=new v(N,_+"leave",m,r,d),p.target=w,p.relatedTarget=S,N=null,vu(d)===u&&(v=new v(b,_+"enter",y,r,d),v.target=S,v.relatedTarget=w,N=v),w=N,m&&y)t:{for(v=m,b=y,_=0,S=v;S;S=Ud(S))_++;for(S=0,N=b;N;N=Ud(N))S++;for(;0<_-S;)v=Ud(v),_--;for(;0<S-_;)b=Ud(b),S--;for(;_--;){if(v===b||b!==null&&v===b.alternate)break t;v=Ud(v),b=Ud(b)}v=null}else v=null;m!==null&&aL(f,p,m,v,!1),y!==null&&w!==null&&aL(f,w,y,v,!0)}}e:{if(p=u?_f(u):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var j=ure;else if(XI(p))if(Y8)j=pre;else{j=fre;var C=dre}else(m=p.nodeName)&&m.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(j=hre);if(j&&(j=j(t,u))){J8(f,j,r,d);break e}C&&C(t,p,u),t==="focusout"&&(C=p._wrapperState)&&C.controlled&&p.type==="number"&&kC(p,"number",p.value)}switch(C=u?_f(u):window,t){case"focusin":(XI(C)||C.contentEditable==="true")&&(bf=C,IC=u,Ym=null);break;case"focusout":Ym=IC=bf=null;break;case"mousedown":LC=!0;break;case"contextmenu":case"mouseup":case"dragend":LC=!1,nL(f,r,d);break;case"selectionchange":if(vre)break;case"keydown":case"keyup":nL(f,r,d)}var O;if(WA)e:{switch(t){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else xf?G8(t,r)&&(P="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(P="onCompositionStart");P&&(K8&&r.locale!=="ko"&&(xf||P!=="onCompositionStart"?P==="onCompositionEnd"&&xf&&(O=q8()):(Ul=d,UA="value"in Ul?Ul.value:Ul.textContent,xf=!0)),C=a0(u,P),0<C.length&&(P=new GI(P,t,null,r,d),f.push({event:P,listeners:C}),O?P.data=O:(O=Z8(r),O!==null&&(P.data=O)))),(O=sre?are(t,r):ore(t,r))&&(u=a0(u,"onBeforeInput"),0<u.length&&(d=new GI("onBeforeInput","beforeinput",null,r,d),f.push({event:d,listeners:u}),d.data=O))}o6(f,e)})}function $g(t,e,r){return{instance:t,listener:e,currentTarget:r}}function a0(t,e){for(var r=e+"Capture",n=[];t!==null;){var i=t,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Tg(t,r),s!=null&&n.unshift($g(t,s,i)),s=Tg(t,e),s!=null&&n.push($g(t,s,i))),t=t.return}return n}function Ud(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function aL(t,e,r,n,i){for(var s=e._reactName,a=[];r!==null&&r!==n;){var o=r,c=o.alternate,u=o.stateNode;if(c!==null&&c===n)break;o.tag===5&&u!==null&&(o=u,i?(c=Tg(r,s),c!=null&&a.unshift($g(r,c,o))):i||(c=Tg(r,s),c!=null&&a.push($g(r,c,o)))),r=r.return}a.length!==0&&t.push({event:e,listeners:a})}var wre=/\r\n?/g,_re=/\u0000|\uFFFD/g;function oL(t){return(typeof t=="string"?t:""+t).replace(wre,`
38`).replace(_re,"")}function kx(t,e,r){if(e=oL(e),oL(t)!==e&&r)throw Error(ye(425))}function o0(){}var $C=null,DC=null;function BC(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var FC=typeof setTimeout=="function"?setTimeout:void 0,kre=typeof clearTimeout=="function"?clearTimeout:void 0,lL=typeof Promise=="function"?Promise:void 0,Sre=typeof queueMicrotask=="function"?queueMicrotask:typeof lL<"u"?function(t){return lL.resolve(null).then(t).cat
vendor: 4,838 bytes, line 38
38ch(jre)}:FC;function jre(t){setTimeout(function(){throw t})}function dj(t,e){var r=e,n=0;do{var i=r.nextSibling;if(t.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){t.removeChild(i),Mg(e);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);Mg(e)}function Ql(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function cL(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"){if(e===0)return t;e--}else r==="/$"&&e++}t=t.previousSibling}return null}var fp=Math.random().toString(36).slice(2),Ia="__reactFiber$"+fp,Dg="__reactProps$"+fp,$o="__reactContainer$"+fp,zC="__reactEvents$"+fp,Nre="__reactListeners$"+fp,Cre="__reactHandles$"+fp;function vu(t){var e=t[Ia];if(e)return e;for(var r=t.parentNode;r;){if(e=r[$o]||r[Ia]){if(r=e.alternate,e.child!==null||r!==null&&r.child!==null)for(t=cL(t);t!==null;){if(r=t[Ia])return r;t=cL(t)}return e}t=r,r=t.parentNode}return null}function py(t){return t=t[Ia]||t[$o],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function _f(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(ye(33))}function Q1(t){return t[Dg]||null}var UC=[],kf=-1;function jc(t){return{current:t}}function sr(t){0>kf||(t.current=UC[kf],UC[kf]=null,kf--)}function Yt(t,e){kf++,UC[kf]=t.current,t.current=e}var mc={},Hn=jc(mc),ki=jc(!1),Wu=mc;function mh(t,e){var r=t.type.contextTypes;if(!r)return mc;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Si(t){return t=t.childContextTypes,t!=null}function l0(){sr(ki),sr(Hn)}function uL(t,e,r){if(Hn.current!==mc)throw Error(ye(168));Yt(Hn,e),Yt(ki,r)}function c6(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(ye(108,dte(t)||"Unknown",i));return yr({},r,n)}function c0(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||mc,Wu=Hn.current,Yt(Hn,t),Yt(ki,ki.current),!0}function dL(t,e,r){var n=t.stateNode;if(!n)throw Error(ye(169));r?(t=c6(t,e,Wu),n.__reactInternalMemoizedMergedChildContext=t,sr(ki),sr(Hn),Yt(Hn,t)):sr(ki),Yt(ki,r)}var _o=null,e_=!1,fj=!1;function u6(t){_o===null?_o=[t]:_o.push(t)}function Ere(t){e_=!0,u6(t)}function Nc(){if(!fj&&_o!==null){fj=!0;var t=0,e=It;try{var r=_o;for(It=1;t<r.length;t++){var n=r[t];do n=n(!0);while(n!==null)}_o=null,e_=!1}catch(i){throw _o!==null&&(_o=_o.slice(t+1)),I8(DA,Nc),i}finally{It=e,fj=!1}}return null}var Sf=[],jf=0,u0=null,d0=0,vs=[],ys=0,qu=null,So=1,jo="";function ou(t,e){Sf[jf++]=d0,Sf[jf++]=u0,u0=t,d0=e}function d6(t,e,r){vs[ys++]=So,vs[ys++]=jo,vs[ys++]=qu,qu=t;var n=So;t=jo;var i=32-la(n)-1;n&=~(1<<i),r+=1;var s=32-la(e)+i;if(30<s){var a=i-i%5;s=(n&(1<<a)-1).toString(32),n>>=a,i-=a,So=1<<32-la(e)+i|r<<i|n,jo=s+t}else So=1<<s|r<<i|n,jo=t}function KA(t){t.return!==null&&(ou(t,1),d6(t,1,0))}function GA(t){for(;t===u0;)u0=Sf[--jf],Sf[jf]=null,d0=Sf[--jf],Sf[jf]=null;for(;t===qu;)qu=vs[--ys],vs[ys]=null,jo=vs[--ys],vs[ys]=null,So=vs[--ys],vs[ys]=null}var Ki=null,Hi=null,ur=!1,ia=null;function f6(t,e){var r=ws(5,null,null,0);r.elementType="DELETED",r.stateNode=e,r.return=t,e=t.deletions,e===null?(t.deletions=[r],t.flags|=16):e.push(r)}function fL(t,e){switch(t.tag){case 5:var r=t.type;return e=e.nodeType!==1||r.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Ki=t,Hi=Ql(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Ki=t,Hi=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(r=qu!==null?{id:So,overflow:jo}:null,t.memoizedState={dehydrated:e,treeContext:r,retryLane:1073741824},r=ws(18,null,null,0),r.stateNode=e,r.return=t,t.child=r,Ki=t,Hi=null,!0):!1;default:return!1}}function HC(t){return(t.mode&1)!==0&&(t.flags&128)===0}function VC(t){if(ur){var e=Hi;if(e){var r=e;if(!fL(t,e)){if(HC(t))throw Error(ye(418));e=Ql(r.nextSibling);var n=Ki;e&&fL(t,e)?f6(n,r):(t.flags=t.flags&-4097|2,ur=!1,Ki=t)}}else{if(HC(t))throw Error(ye(418));t.flags=t.flags&-4097|2,ur=!1,Ki=t}}}function hL(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Ki=t}function Sx(t){if(t!==Ki)return!1;if(!ur)return hL(t),ur=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!BC(t.type,t.memoizedProps)),e&&(e=Hi)){if(HC(t))throw h6(),Error(ye(418));for(;e;)f6(t,e),e=Ql(e.nextSibling)}if(hL(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(ye(317));e:{for(t=t.nextSibling,e=0;t;
vendor: 10,290 bytes, line 38
38){if(t.nodeType===8){var r=t.data;if(r==="/$"){if(e===0){Hi=Ql(t.nextSibling);break e}e--}else r!=="$"&&r!=="$!"&&r!=="$?"||e++}t=t.nextSibling}Hi=null}}else Hi=Ki?Ql(t.stateNode.nextSibling):null;return!0}function h6(){for(var t=Hi;t;)t=Ql(t.nextSibling)}function gh(){Hi=Ki=null,ur=!1}function ZA(t){ia===null?ia=[t]:ia.push(t)}var Ore=Yo.ReactCurrentBatchConfig;function lm(t,e,r){if(t=r.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(ye(309));var n=r.stateNode}if(!n)throw Error(ye(147,t));var i=n,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(a){var o=i.refs;a===null?delete o[s]:o[s]=a},e._stringRef=s,e)}if(typeof t!="string")throw Error(ye(284));if(!r._owner)throw Error(ye(290,t))}return t}function jx(t,e){throw t=Object.prototype.toString.call(e),Error(ye(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function pL(t){var e=t._init;return e(t._payload)}function p6(t){function e(b,_){if(t){var S=b.deletions;S===null?(b.deletions=[_],b.flags|=16):S.push(_)}}function r(b,_){if(!t)return null;for(;_!==null;)e(b,_),_=_.sibling;return null}function n(b,_){for(b=new Map;_!==null;)_.key!==null?b.set(_.key,_):b.set(_.index,_),_=_.sibling;return b}function i(b,_){return b=nc(b,_),b.index=0,b.sibling=null,b}function s(b,_,S){return b.index=S,t?(S=b.alternate,S!==null?(S=S.index,S<_?(b.flags|=2,_):S):(b.flags|=2,_)):(b.flags|=1048576,_)}function a(b){return t&&b.alternate===null&&(b.flags|=2),b}function o(b,_,S,N){return _===null||_.tag!==6?(_=xj(S,b.mode,N),_.return=b,_):(_=i(_,S),_.return=b,_)}function c(b,_,S,N){var j=S.type;return j===yf?d(b,_,S.props.children,N,S.key):_!==null&&(_.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===bl&&pL(j)===_.type)?(N=i(_,S.props),N.ref=lm(b,_,S),N.return=b,N):(N=Rb(S.type,S.key,S.props,null,b.mode,N),N.ref=lm(b,_,S),N.return=b,N)}function u(b,_,S,N){return _===null||_.tag!==4||_.stateNode.containerInfo!==S.containerInfo||_.stateNode.implementation!==S.implementation?(_=bj(S,b.mode,N),_.return=b,_):(_=i(_,S.children||[]),_.return=b,_)}function d(b,_,S,N,j){return _===null||_.tag!==7?(_=$u(S,b.mode,N,j),_.return=b,_):(_=i(_,S),_.return=b,_)}function f(b,_,S){if(typeof _=="string"&&_!==""||typeof _=="number")return _=xj(""+_,b.mode,S),_.return=b,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case px:return S=Rb(_.type,_.key,_.props,null,b.mode,S),S.ref=lm(b,null,_),S.return=b,S;case vf:return _=bj(_,b.mode,S),_.return=b,_;case bl:var N=_._init;return f(b,N(_._payload),S)}if(Mm(_)||nm(_))return _=$u(_,b.mode,S,null),_.return=b,_;jx(b,_)}return null}function p(b,_,S,N){var j=_!==null?_.key:null;if(typeof S=="string"&&S!==""||typeof S=="number")return j!==null?null:o(b,_,""+S,N);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case px:return S.key===j?c(b,_,S,N):null;case vf:return S.key===j?u(b,_,S,N):null;case bl:return j=S._init,p(b,_,j(S._payload),N)}if(Mm(S)||nm(S))return j!==null?null:d(b,_,S,N,null);jx(b,S)}return null}function m(b,_,S,N,j){if(typeof N=="string"&&N!==""||typeof N=="number")return b=b.get(S)||null,o(_,b,""+N,j);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case px:return b=b.get(N.key===null?S:N.key)||null,c(_,b,N,j);case vf:return b=b.get(N.key===null?S:N.key)||null,u(_,b,N,j);case bl:var C=N._init;return m(b,_,S,C(N._payload),j)}if(Mm(N)||nm(N))return b=b.get(S)||null,d(_,b,N,j,null);jx(_,N)}return null}function y(b,_,S,N){for(var j=null,C=null,O=_,P=_=0,T=null;O!==null&&P<S.length;P++){O.index>P?(T=O,O=null):T=O.sibling;var $=p(b,O,S[P],N);if($===null){O===null&&(O=T);break}t&&O&&$.alternate===null&&e(b,O),_=s($,_,P),C===null?j=$:C.sibling=$,C=$,O=T}if(P===S.length)return r(b,O),ur&&ou(b,P),j;if(O===null){for(;P<S.length;P++)O=f(b,S[P],N),O!==null&&(_=s(O,_,P),C===null?j=O:C.sibling=O,C=O);return ur&&ou(b,P),j}for(O=n(b,O);P<S.length;P++)T=m(O,b,P,S[P],N),T!==null&&(t&&T.alternate!==null&&O.delete(T.key===null?P:T.key),_=s(T,_,P),C===null?j=T:C.sibling=T,C=T);return t&&O.forEach(function(B){return e(b,B)}),ur&&ou(b,P),j}function v(b,_,S,N){var j=nm(S);if(typeof j!="function")throw Error(ye(150));if(S=j.call(S),S==null)throw Error(ye(151));for(var C=j=null,O=_,P=_=0,T=null,$=S.next();O!==null&&!$.done;P++,$=S.next()){O.index>P?(T=O,O=null):T=O.sibling;var B=p(b,O,$.value,N);if(B===null){O===null&&(O=T);break}t&&O&&B.alternate===null&&e(b,O),_=s(B,_,P),C===null?j=B:C.sibling=B,C=B,O=T}if($.done)return r(b,O),ur&&ou(b,P),j;if(O===null){for(;!$.done;P++,$=S.next())$=f(b,$.value,N),$!==null&&(_=s($,_,P),C===null?j=$:C.sibling=$,C=$);return ur&&ou(b,P),j}for(O=n(b,O);!$.done;P++,$=S.next())$=m(O,b,P,$.value,N),$!==null&&(t&&$.alternate!==null&&O.delete($.key===null?P:$.key),_=s($,_,P),C===null?j=$:C.sibling=$,C=$);return t&&O.forEach(function(R){return e(b,R)}),ur&&ou(b,P),j}function w(b,_,S,N){if(typeof S=="object"&&S!==null&&S.type===yf&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case px:e:{for(var j=S.key,C=_;C!==null;){if(C.key===j){if(j=S.type,j===yf){if(C.tag===7){r(b,C.sibling),_=i(C,S.props.children),_.return=b,b=_;break e}}else if(C.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===bl&&pL(j)===C.type){r(b,C.sibling),_=i(C,S.props),_.ref=lm(b,C,S),_.return=b,b=_;break e}r(b,C);break}else e(b,C);C=C.sibling}S.type===yf?(_=$u(S.props.children,b.mode,N,S.key),_.return=b,b=_):(N=Rb(S.type,S.key,S.props,null,b.mode,N),N.ref=lm(b,_,S),N.return=b,b=N)}return a(b);case vf:e:{for(C=S.key;_!==null;){if(_.key===C)if(_.tag===4&&_.stateNode.containerInfo===S.containerInfo&&_.stateNode.implementation===S.implementation){r(b,_.sibling),_=i(_,S.children||[]),_.return=b,b=_;break e}else{r(b,_);break}else e(b,_);_=_.sibling}_=bj(S,b.mode,N),_.return=b,b=_}return a(b);case bl:return C=S._init,w(b,_,C(S._payload),N)}if(Mm(S))return y(b,_,S,N);if(nm(S))return v(b,_,S,N);jx(b,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,_!==null&&_.tag===6?(r(b,_.sibling),_=i(_,S),_.return=b,b=_):(r(b,_),_=xj(S,b.mode,N),_.return=b,b=_),a(b)):r(b,_)}return w}var vh=p6(!0),m6=p6(!1),f0=jc(null),h0=null,Nf=null,JA=null;function YA(){JA=Nf=h0=null}function XA(t){var e=f0.current;sr(f0),t._currentValue=e}function WC(t,e,r){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function zf(t,e){h0=t,JA=Nf=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(wi=!0),t.firstContext=null)}function As(t){var e=t._currentValue;if(JA!==t)if(t={context:t,memoizedValue:e,next:null},Nf===null){if(h0===null)throw Error(ye(308));Nf=t,h0.dependencies={lanes:0,firstContext:t}}else Nf=Nf.next=t;return e}var yu=null;function QA(t){yu===null?yu=[t]:yu.push(t)}function g6(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,QA(e)):(r.next=i.next,i.next=r),e.interleaved=r,Do(t,n)}function Do(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var wl=!1;function eP(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function v6(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Ao(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function ec(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,jt&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,Do(t,r)}return i=n.interleaved,i===null?(e.next=e,QA(n)):(e.next=i.next,i.next=e),n.interleaved=e,Do(t,r)}function Eb(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,BA(t,r)}}function mL(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var a={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=a:s=s.next=a,r=r.next}while(r!==null);s===null?i=s=e:s=s.next=e}else i=s=e;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function p0(t,e,r,n){var i=t.updateQueue;wl=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var c=o,u=c.next;c.next=null,a===null?s=u:a.next=u,a=c;var d=t.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=c))}if(s!==null){var f=i.baseState;a=0,d=u=c=null,o=s;do{var p=o.lane,m=o.eventTime;if((n&p)===p){d!==null&&(d=d.next={eventTime:m,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var y=t,v=o;switch(p=e,m=r,v.tag){case 1:if(y=v.payload,typeof y=="function"){f=y.call(m,f,p);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,p=typeof y=="function"?y.call(m,f,p):y,p==null)break e;f=yr({},f,p);break e;case 2:wl=!0}}o.callback!==null&&o.lane!==0&&(t.flags|=64,p=i.effects,p===null?i.effects=[o]:p.push(o))}else m={eventTime:m,lane:p,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,a|=p;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;p=o,o=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(d===null&&(c=f),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,e=i.shared.interleaved,e!==null){i=e;do a|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);Gu|=a,t.lanes=a,t.memoizedState=f}}function gL(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var n=t[e],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(ye(191,i));i.call(n)}}}var my={},za=jc(my),Bg=jc(my),Fg=jc(my);function xu(t){if(t===my)throw Error(ye(174));return t}function tP(t,e){switch(Yt(Fg,e),Yt(Bg,t),Yt(za,my),t=e.nodeType,t){case 9:case 11:e=(e
vendor: 6,862 bytes, line 38
38=e.documentElement)?e.namespaceURI:jC(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=jC(e,t)}sr(za),Yt(za,e)}function yh(){sr(za),sr(Bg),sr(Fg)}function y6(t){xu(Fg.current);var e=xu(za.current),r=jC(e,t.type);e!==r&&(Yt(Bg,t),Yt(za,r))}function rP(t){Bg.current===t&&(sr(za),sr(Bg))}var mr=jc(0);function m0(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var hj=[];function nP(){for(var t=0;t<hj.length;t++)hj[t]._workInProgressVersionPrimary=null;hj.length=0}var Ob=Yo.ReactCurrentDispatcher,pj=Yo.ReactCurrentBatchConfig,Ku=0,gr=null,Yr=null,on=null,g0=!1,Xm=!1,zg=0,Tre=0;function Rn(){throw Error(ye(321))}function iP(t,e){if(e===null)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(!da(t[r],e[r]))return!1;return!0}function sP(t,e,r,n,i,s){if(Ku=s,gr=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Ob.current=t===null||t.memoizedState===null?Rre:Ire,t=r(n,i),Xm){s=0;do{if(Xm=!1,zg=0,25<=s)throw Error(ye(301));s+=1,on=Yr=null,e.updateQueue=null,Ob.current=Lre,t=r(n,i)}while(Xm)}if(Ob.current=v0,e=Yr!==null&&Yr.next!==null,Ku=0,on=Yr=gr=null,g0=!1,e)throw Error(ye(300));return t}function aP(){var t=zg!==0;return zg=0,t}function ja(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?gr.memoizedState=on=t:on=on.next=t,on}function Ps(){if(Yr===null){var t=gr.alternate;t=t!==null?t.memoizedState:null}else t=Yr.next;var e=on===null?gr.memoizedState:on.next;if(e!==null)on=e,Yr=t;else{if(t===null)throw Error(ye(310));Yr=t,t={memoizedState:Yr.memoizedState,baseState:Yr.baseState,baseQueue:Yr.baseQueue,queue:Yr.queue,next:null},on===null?gr.memoizedState=on=t:on=on.next=t}return on}function Ug(t,e){return typeof e=="function"?e(t):e}function mj(t){var e=Ps(),r=e.queue;if(r===null)throw Error(ye(311));r.lastRenderedReducer=t;var n=Yr,i=n.baseQueue,s=r.pending;if(s!==null){if(i!==null){var a=i.next;i.next=s.next,s.next=a}n.baseQueue=i=s,r.pending=null}if(i!==null){s=i.next,n=n.baseState;var o=a=null,c=null,u=s;do{var d=u.lane;if((Ku&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:t(n,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(o=c=f,a=n):c=c.next=f,gr.lanes|=d,Gu|=d}u=u.next}while(u!==null&&u!==s);c===null?a=n:c.next=o,da(n,e.memoizedState)||(wi=!0),e.memoizedState=n,e.baseState=a,e.baseQueue=c,r.lastRenderedState=n}if(t=r.interleaved,t!==null){i=t;do s=i.lane,gr.lanes|=s,Gu|=s,i=i.next;while(i!==t)}else i===null&&(r.lanes=0);return[e.memoizedState,r.dispatch]}function gj(t){var e=Ps(),r=e.queue;if(r===null)throw Error(ye(311));r.lastRenderedReducer=t;var n=r.dispatch,i=r.pending,s=e.memoizedState;if(i!==null){r.pending=null;var a=i=i.next;do s=t(s,a.action),a=a.next;while(a!==i);da(s,e.memoizedState)||(wi=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),r.lastRenderedState=s}return[s,n]}function x6(){}function b6(t,e){var r=gr,n=Ps(),i=e(),s=!da(n.memoizedState,i);if(s&&(n.memoizedState=i,wi=!0),n=n.queue,oP(k6.bind(null,r,n,t),[t]),n.getSnapshot!==e||s||on!==null&&on.memoizedState.tag&1){if(r.flags|=2048,Hg(9,_6.bind(null,r,n,i,e),void 0,null),un===null)throw Error(ye(349));Ku&30||w6(r,e,i)}return i}function w6(t,e,r){t.flags|=16384,t={getSnapshot:e,value:r},e=gr.updateQueue,e===null?(e={lastEffect:null,stores:null},gr.updateQueue=e,e.stores=[t]):(r=e.stores,r===null?e.stores=[t]:r.push(t))}function _6(t,e,r,n){e.value=r,e.getSnapshot=n,S6(e)&&j6(t)}function k6(t,e,r){return r(function(){S6(e)&&j6(t)})}function S6(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!da(t,r)}catch{return!0}}function j6(t){var e=Do(t,1);e!==null&&ca(e,t,1,-1)}function vL(t){var e=ja();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ug,lastRenderedState:t},e.queue=t,t=t.dispatch=Mre.bind(null,gr,t),[e.memoizedState,t]}function Hg(t,e,r,n){return t={tag:t,create:e,destroy:r,deps:n,next:null},e=gr.updateQueue,e===null?(e={lastEffect:null,stores:null},gr.updateQueue=e,e.lastEffect=t.next=t):(r=e.lastEffect,r===null?e.lastEffect=t.next=t:(n=r.next,r.next=t,t.next=n,e.lastEffect=t)),t}function N6(){return Ps().memoizedState}function Tb(t,e,r,n){var i=ja();gr.flags|=t,i.memoizedState=Hg(1|e,r,void 0,n===void 0?null:n)}function t_(t,e,r,n){var i=Ps();n=n===void 0?null:n;var s=void 0;if(Yr!==null){var a=Yr.memoizedState;if(s=a.destroy,n!==null&&iP(n,a.deps)){i.memoizedState=Hg(e,r,s,n);return}}gr.flags|=t,i.memoizedState=Hg(1|e,r,s,n)}function yL(t,e){return Tb(8390656,8,t,e)}function oP(t,e){return t_(2048,8,t,e)}function C6(t,e){return t_(4,2,t,e)}function E6(t,e){return t_(4,4,t,e)}function O6(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function T6(t,e,r){return r=r!=null?r.concat([t]):null,t_(4,4,O6.bind(null,e,t),r)}function lP(){}function A6(t,e){var r=Ps();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&iP(e,n[1])?n[0]:(r.memoizedState=[t,e],t)}function P6(t,e){var r=Ps();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&iP(e,n[1])?n[0]:(t=t(),r.memoizedState=[t,e],t)}function M6(t,e,r){return Ku&21?(da(r,e)||(r=D8(),gr.lanes|=r,Gu|=r,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,wi=!0),t.memoizedState=r)}function Are(t,e){var r=It;It=r!==0&&4>r?r:4,t(!0);var n=pj.transition;pj.transition={};try{t(!1),e()}finally{It=r,pj.transition=n}}function R6(){return Ps().memoizedState}function Pre(t,e,r){var n=rc(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},I6(t))L6(e,r);else if(r=g6(t,e,r,n),r!==null){var i=si();ca(r,t,n,i),$6(r,e,n)}}function Mre(t,e,r){var n=rc(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(I6(t))L6(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var a=e.lastRenderedState,o=s(a,r);if(i.hasEagerState=!0,i.eagerState=o,da(o,a)){var c=e.interleaved;c===null?(i.next=i,QA(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}r=g6(t,e,i,n),r!==null&&(i=si(),ca(r,t,n,i),$6(r,e,n))}}function I6(t){var e=t.alternate;return t===gr||e!==null&&e===gr}function L6(t,e){Xm=g0=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function $6(t,e,r){if(r&4194240){var n=e.lanes;
vendor: 8,483 bytes, lines 38-40
38n&=t.pendingLanes,r|=n,e.lanes=r,BA(t,r)}}var v0={readContext:As,useCallback:Rn,useContext:Rn,useEffect:Rn,useImperativeHandle:Rn,useInsertionEffect:Rn,useLayoutEffect:Rn,useMemo:Rn,useReducer:Rn,useRef:Rn,useState:Rn,useDebugValue:Rn,useDeferredValue:Rn,useTransition:Rn,useMutableSource:Rn,useSyncExternalStore:Rn,useId:Rn,unstable_isNewReconciler:!1},Rre={readContext:As,useCallback:function(t,e){return ja().memoizedState=[t,e===void 0?null:e],t},useContext:As,useEffect:yL,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,Tb(4194308,4,O6.bind(null,e,t),r)},useLayoutEffect:function(t,e){return Tb(4194308,4,t,e)},useInsertionEffect:function(t,e){return Tb(4,2,t,e)},useMemo:function(t,e){var r=ja();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=ja();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=Pre.bind(null,gr,t),[n.memoizedState,t]},useRef:function(t){var e=ja();return t={current:t},e.memoizedState=t},useState:vL,useDebugValue:lP,useDeferredValue:function(t){return ja().memoizedState=t},useTransition:function(){var t=vL(!1),e=t[0];return t=Are.bind(null,t[1]),ja().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=gr,i=ja();if(ur){if(r===void 0)throw Error(ye(407));r=r()}else{if(r=e(),un===null)throw Error(ye(349));Ku&30||w6(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,yL(k6.bind(null,n,s,t),[t]),n.flags|=2048,Hg(9,_6.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=ja(),e=un.identifierPrefix;if(ur){var r=jo,n=So;r=(n&~(1<<32-la(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=zg++,0<r&&(e+="H"+r.toString(32)),e+=":"}else r=Tre++,e=":"+e+"r"+r.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},Ire={readContext:As,useCallback:A6,useContext:As,useEffect:oP,useImperativeHandle:T6,useInsertionEffect:C6,useLayoutEffect:E6,useMemo:P6,useReducer:mj,useRef:N6,useState:function(){return mj(Ug)},useDebugValue:lP,useDeferredValue:function(t){var e=Ps();return M6(e,Yr.memoizedState,t)},useTransition:function(){var t=mj(Ug)[0],e=Ps().memoizedState;return[t,e]},useMutableSource:x6,useSyncExternalStore:b6,useId:R6,unstable_isNewReconciler:!1},Lre={readContext:As,useCallback:A6,useContext:As,useEffect:oP,useImperativeHandle:T6,useInsertionEffect:C6,useLayoutEffect:E6,useMemo:P6,useReducer:gj,useRef:N6,useState:function(){return gj(Ug)},useDebugValue:lP,useDeferredValue:function(t){var e=Ps();return Yr===null?e.memoizedState=t:M6(e,Yr.memoizedState,t)},useTransition:function(){var t=gj(Ug)[0],e=Ps().memoizedState;return[t,e]},useMutableSource:x6,useSyncExternalStore:b6,useId:R6,unstable_isNewReconciler:!1};function Ys(t,e){if(t&&t.defaultProps){e=yr({},e),t=t.defaultProps;for(var r in t)e[r]===void 0&&(e[r]=t[r]);return e}return e}function qC(t,e,r,n){e=t.memoizedState,r=r(n,e),r=r==null?e:yr({},e,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var r_={isMounted:function(t){return(t=t._reactInternals)?md(t)===t:!1},enqueueSetState:function(t,e,r){t=t._reactInternals;var n=si(),i=rc(t),s=Ao(n,i);s.payload=e,r!=null&&(s.callback=r),e=ec(t,s,i),e!==null&&(ca(e,t,i,n),Eb(e,t,i))},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var n=si(),i=rc(t),s=Ao(n,i);s.tag=1,s.payload=e,r!=null&&(s.callback=r),e=ec(t,s,i),e!==null&&(ca(e,t,i,n),Eb(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=si(),n=rc(t),i=Ao(r,n);i.tag=2,e!=null&&(i.callback=e),e=ec(t,i,n),e!==null&&(ca(e,t,n,r),Eb(e,t,n))}};function xL(t,e,r,n,i,s,a){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(n,s,a):e.prototype&&e.prototype.isPureReactComponent?!Ig(r,n)||!Ig(i,s):!0}function D6(t,e,r){var n=!1,i=mc,s=e.contextType;return typeof s=="object"&&s!==null?s=As(s):(i=Si(e)?Wu:Hn.current,n=e.contextTypes,s=(n=n!=null)?mh(t,i):mc),e=new e(r,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=r_,t.stateNode=e,e._reactInternals=t,n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=s),e}function bL(t,e,r,n){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(r,n),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(r,n),e.state!==t&&r_.enqueueReplaceState(e,e.state,null)}function KC(t,e,r,n){var i=t.stateNode;i.props=r,i.state=t.memoizedState,i.refs={},eP(t);var s=e.contextType;typeof s=="object"&&s!==null?i.context=As(s):(s=Si(e)?Wu:Hn.current,i.context=mh(t,s)),i.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(qC(t,e,s,r),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&r_.enqueueReplaceState(i,i.state,null),p0(t,r,i,n),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function xh(t,e){try{var r="",n=e;do r+=ute(n),n=n.return;while(n);var i=r}catch(s){i=`
39Error generating stack: `+s.message+`
40`+s.stack}return{value:t,source:e,stack:i,digest:null}}function vj(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function GC(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var $re=typeof WeakMap=="function"?WeakMap:Map;function B6(t,e,r){r=Ao(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){x0||(x0=!0,iE=n),GC(t,e)},r}function F6(t,e,r){r=Ao(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var i=e.value;r.payload=function(){return n(i)},r.callback=function(){GC(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){GC(t,e),typeof n!="function"&&(tc===null?tc=new Set([this]):tc.add(this));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),r}function wL(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new $re;var i=new Set;n.set(e,i)}else i=n.get(e),i===void 0&&(i=new Set,n.set(e,i));i.has(r)||(i.add(r),t=Yre.bind(null,t,e,r),e.then(t,t))}function _L(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function kL(t,e,r,n,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=Ao(-1,1),e.tag=2,ec(r,e,1))),r.lanes|=1),t)}var Dre=Yo.ReactCurrentOwner,wi=!1;function Qn(t,e,r,n){e.child=t===null?m6(e,null,r,n):vh(e,t.child,r,n)}function SL(t,e,r,n,i){r=r.render;var s=e.ref;return zf(e,i),n=sP(t,e,r,n,s,i),r=aP(),t!==null&&!wi?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Bo(t,e,i)):(ur&&r&&KA(e),e.flags|=1,Qn(t,e,n,i),e.child)}function jL(t,e,r,n,i){if(t===null){var s=r.type;return typeof s=="function"&&!gP(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=s,z6(t,e,s,n,i)):(t=Rb(r.type,null,n,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var a=s.memoizedProps;if(r=r.compare,r=r!==null?r:Ig,r(a,n)&&t.ref===e.ref)return Bo(t,e,i)}return e.flags|=1,t=nc(s,n),t.ref=e.ref,t.return=e,e.child=t}function z6(t,e,r,n,i){if(t!==null){var s=t.memoizedProps;if(Ig(s,n)&&t.ref===e.ref)if(wi=!1,e.pendingProps=n=s,(t.lanes&i)!==0)t.flags&131072&&(wi=!0);else return e.lanes=t.lanes,Bo(t,e,i)}return ZC(t,e,r,n,i)}function U6(t,e,r){var n=e.pendingProps,i=n.children,s=t!==null?t.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Yt(Ef,$i),$i|=r;else{if(!(r&1073741824))return t=s!==null?s.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Yt(Ef,$i),$i|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=s!==null?s.baseLanes:r,Yt(Ef,$i),$i|=n}else s!==null?(n=s.baseLanes|r,e.memoizedState=null):n=r,Yt(Ef,$i),$i|=n;return Qn(t,e,i,r),e.child}function H6(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}
vendor: 4,713 bytes, line 40
40function ZC(t,e,r,n,i){var s=Si(r)?Wu:Hn.current;return s=mh(e,s),zf(e,i),r=sP(t,e,r,n,s,i),n=aP(),t!==null&&!wi?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Bo(t,e,i)):(ur&&n&&KA(e),e.flags|=1,Qn(t,e,r,i),e.child)}function NL(t,e,r,n,i){if(Si(r)){var s=!0;c0(e)}else s=!1;if(zf(e,i),e.stateNode===null)Ab(t,e),D6(e,r,n),KC(e,r,n,i),n=!0;else if(t===null){var a=e.stateNode,o=e.memoizedProps;a.props=o;var c=a.context,u=r.contextType;typeof u=="object"&&u!==null?u=As(u):(u=Si(r)?Wu:Hn.current,u=mh(e,u));var d=r.getDerivedStateFromProps,f=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==n||c!==u)&&bL(e,a,n,u),wl=!1;var p=e.memoizedState;a.state=p,p0(e,n,a,i),c=e.memoizedState,o!==n||p!==c||ki.current||wl?(typeof d=="function"&&(qC(e,r,d,n),c=e.memoizedState),(o=wl||xL(e,r,o,n,p,c,u))?(f||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"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=c),a.props=n,a.state=c,a.context=u,n=o):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{a=e.stateNode,v6(t,e),o=e.memoizedProps,u=e.type===e.elementType?o:Ys(e.type,o),a.props=u,f=e.pendingProps,p=a.context,c=r.contextType,typeof c=="object"&&c!==null?c=As(c):(c=Si(r)?Wu:Hn.current,c=mh(e,c));var m=r.getDerivedStateFromProps;(d=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==f||p!==c)&&bL(e,a,n,c),wl=!1,p=e.memoizedState,a.state=p,p0(e,n,a,i);var y=e.memoizedState;o!==f||p!==y||ki.current||wl?(typeof m=="function"&&(qC(e,r,m,n),y=e.memoizedState),(u=wl||xL(e,r,u,n,p,y,c)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(n,y,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(n,y,c)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=y),a.props=n,a.state=y,a.context=c,n=u):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),n=!1)}return JC(t,e,r,n,s,i)}function JC(t,e,r,n,i,s){H6(t,e);var a=(e.flags&128)!==0;if(!n&&!a)return i&&dL(e,r,!1),Bo(t,e,s);n=e.stateNode,Dre.current=e;var o=a&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&a?(e.child=vh(e,t.child,null,s),e.child=vh(e,null,o,s)):Qn(t,e,o,s),e.memoizedState=n.state,i&&dL(e,r,!0),e.child}function V6(t){var e=t.stateNode;e.pendingContext?uL(t,e.pendingContext,e.pendingContext!==e.context):e.context&&uL(t,e.context,!1),tP(t,e.containerInfo)}function CL(t,e,r,n,i){return gh(),ZA(i),e.flags|=256,Qn(t,e,r,n),e.child}var YC={dehydrated:null,treeContext:null,retryLane:0};function XC(t){return{baseLanes:t,cachePool:null,transitions:null}}function W6(t,e,r){var n=e.pendingProps,i=mr.current,s=!1,a=(e.flags&128)!==0,o;if((o=a)||(o=t!==null&&t.memoizedState===null?!1:(i&2)!==0),o?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),Yt(mr,i&1),t===null)return VC(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(a=n.children,t=n.fallback,s?(n=e.mode,s=e.child,a={mode:"hidden",children:a},!(n&1)&&s!==null?(s.childLanes=0,s.pendingProps=a):s=s_(a,n,0,null),t=$u(t,n,r,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=XC(r),e.memoizedState=YC,t):cP(e,a));if(i=t.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return Bre(t,e,a,n,o,i,r);if(s){s=n.fallback,a=e.mode,i=t.child,o=i.sibling;var c={mode:"hidden",children:n.children};return!(a&1)&&e.child!==i?(n=e.child,n.childLanes=0,n.pendingProps=c,e.deletions=null):(n=nc(i,c),n.subtreeFlags=i.subtreeFlags&14680064),o!==null?s=nc(o,s):(s=$u(s,a,r,null),s.flags|=2),s.return=e,n.return=e,n.sibling=s,e.child=n,n=s,s=e.child,a=t.child.memoizedState,a=a===null?XC(r):{base
vendor: 7,083 bytes, line 40
40Lanes:a.baseLanes|r,cachePool:null,transitions:a.transitions},s.memoizedState=a,s.childLanes=t.childLanes&~r,e.memoizedState=YC,n}return s=t.child,t=s.sibling,n=nc(s,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=n,e.memoizedState=null,n}function cP(t,e){return e=s_({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Nx(t,e,r,n){return n!==null&&ZA(n),vh(e,t.child,null,r),t=cP(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Bre(t,e,r,n,i,s,a){if(r)return e.flags&256?(e.flags&=-257,n=vj(Error(ye(422))),Nx(t,e,a,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=n.fallback,i=e.mode,n=s_({mode:"visible",children:n.children},i,0,null),s=$u(s,i,a,null),s.flags|=2,n.return=e,s.return=e,n.sibling=s,e.child=n,e.mode&1&&vh(e,t.child,null,a),e.child.memoizedState=XC(a),e.memoizedState=YC,s);if(!(e.mode&1))return Nx(t,e,a,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var o=n.dgst;return n=o,s=Error(ye(419)),n=vj(s,n,void 0),Nx(t,e,a,n)}if(o=(a&t.childLanes)!==0,wi||o){if(n=un,n!==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&(n.suspendedLanes|a)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Do(t,i),ca(n,t,i,-1))}return mP(),n=vj(Error(ye(421))),Nx(t,e,a,n)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=Xre.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,Hi=Ql(i.nextSibling),Ki=e,ur=!0,ia=null,t!==null&&(vs[ys++]=So,vs[ys++]=jo,vs[ys++]=qu,So=t.id,jo=t.overflow,qu=e),e=cP(e,n.children),e.flags|=4096,e)}function EL(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),WC(t.return,e,r)}function yj(t,e,r,n,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i)}function q6(t,e,r){var n=e.pendingProps,i=n.revealOrder,s=n.tail;if(Qn(t,e,n.children,r),n=mr.current,n&2)n=n&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&EL(t,r,e);else if(t.tag===19)EL(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if(Yt(mr,n),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(r=e.child,i=null;r!==null;)t=r.alternate,t!==null&&m0(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),yj(e,!1,i,r,s);break;case"backwards":for(r=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&m0(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}yj(e,!0,r,null,s);break;case"together":yj(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Ab(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Bo(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Gu|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(ye(153));if(e.child!==null){for(t=e.child,r=nc(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=nc(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function Fre(t,e,r){switch(e.tag){case 3:V6(e),gh();break;case 5:y6(e);break;case 1:Si(e.type)&&c0(e);break;case 4:tP(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,i=e.memoizedProps.value;Yt(f0,n._currentValue),n._currentValue=i;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(Yt(mr,mr.current&1),e.flags|=128,null):r&e.child.childLanes?W6(t,e,r):(Yt(mr,mr.current&1),t=Bo(t,e,r),t!==null?t.sibling:null);Yt(mr,mr.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return q6(t,e,r);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Yt(mr,mr.current),n)break;return null;case 22:case 23:return e.lanes=0,U6(t,e,r)}return Bo(t,e,r)}var K6,QC,G6,Z6;K6=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};QC=function(){};G6=function(t,e,r,n){var i=t.memoizedProps;if(i!==n){t=e.stateNode,xu(za.current);var s=null;switch(r){case"input":i=wC(t,i),n=wC(t,n),s=[];break;case"select":i=yr({},i,{value:void 0}),n=yr({},n,{value:void 0}),s=[];break;case"textarea":i=SC(t,i),n=SC(t,n),s=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=o0)}NC(r,n);var a;r=null;for(u in i)if(!n.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var o=i[u];for(a in o)o.hasOwnProperty(a)&&(r||(r={}),r[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Eg.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in n){var c=n[u];if(o=i!=null?i[u]:void 0,n.hasOwnProperty(u)&&c!==o&&(c!=null||o!=null))if(u==="style")if(o){for(a in o)!o.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(r||(r={}),r[a]="");for(a in c)c.hasOwnProperty(a)&&o[a]!==c[a]&&(r||(r={}),r[a]=c[a])}else r||(s||(s=[]),s.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,o=o?o.__html:void 0,c!=null&&o!==c&&(s=s||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Eg.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&tr("scroll",t),s||o===c||(s=[])):(s=s||[]).push(u,c))}r&&(s=s||[]).push("style",r);var u=s;(e.updateQueue=u)&&(e.flags|=4)}};Z6=function(t,e,r,n){r!==n&&(e.flags|=4)};function cm(t,e){if(!ur)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function In(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,n=0;if(e)for(var i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function zre(t,e,r){var n=e.pendingProps;switch(GA(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return In(e),null;case 1:return Si(e.type)&&l0(),In(e),null;
vendor: 31,391 bytes, line 40
40case 3:return n=e.stateNode,yh(),sr(ki),sr(Hn),nP(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(Sx(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,ia!==null&&(oE(ia),ia=null))),QC(t,e),In(e),null;case 5:rP(e);var i=xu(Fg.current);if(r=e.type,t!==null&&e.stateNode!=null)G6(t,e,r,n,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(ye(166));return In(e),null}if(t=xu(za.current),Sx(e)){n=e.stateNode,r=e.type;var s=e.memoizedProps;switch(n[Ia]=e,n[Dg]=s,t=(e.mode&1)!==0,r){case"dialog":tr("cancel",n),tr("close",n);break;case"iframe":case"object":case"embed":tr("load",n);break;case"video":case"audio":for(i=0;i<Im.length;i++)tr(Im[i],n);break;case"source":tr("error",n);break;case"img":case"image":case"link":tr("error",n),tr("load",n);break;case"details":tr("toggle",n);break;case"input":$I(n,s),tr("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!s.multiple},tr("invalid",n);break;case"textarea":BI(n,s),tr("invalid",n)}NC(r,s),i=null;for(var a in s)if(s.hasOwnProperty(a)){var o=s[a];a==="children"?typeof o=="string"?n.textContent!==o&&(s.suppressHydrationWarning!==!0&&kx(n.textContent,o,t),i=["children",o]):typeof o=="number"&&n.textContent!==""+o&&(s.suppressHydrationWarning!==!0&&kx(n.textContent,o,t),i=["children",""+o]):Eg.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&tr("scroll",n)}switch(r){case"input":mx(n),DI(n,s,!0);break;case"textarea":mx(n),FI(n);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(n.onclick=o0)}n=i,e.updateQueue=n,n!==null&&(e.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=k8(r)),t==="http://www.w3.org/1999/xhtml"?r==="script"?(t=a.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=a.createElement(r,{is:n.is}):(t=a.createElement(r),r==="select"&&(a=t,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):t=a.createElementNS(t,r),t[Ia]=e,t[Dg]=n,K6(t,e,!1,!1),e.stateNode=t;e:{switch(a=CC(r,n),r){case"dialog":tr("cancel",t),tr("close",t),i=n;break;case"iframe":case"object":case"embed":tr("load",t),i=n;break;case"video":case"audio":for(i=0;i<Im.length;i++)tr(Im[i],t);i=n;break;case"source":tr("error",t),i=n;break;case"img":case"image":case"link":tr("error",t),tr("load",t),i=n;break;case"details":tr("toggle",t),i=n;break;case"input":$I(t,n),i=wC(t,n),tr("invalid",t);break;case"option":i=n;break;case"select":t._wrapperState={wasMultiple:!!n.multiple},i=yr({},n,{value:void 0}),tr("invalid",t);break;case"textarea":BI(t,n),i=SC(t,n),tr("invalid",t);break;default:i=n}NC(r,i),o=i;for(s in o)if(o.hasOwnProperty(s)){var c=o[s];s==="style"?N8(t,c):s==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&S8(t,c)):s==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&Og(t,c):typeof c=="number"&&Og(t,""+c):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Eg.hasOwnProperty(s)?c!=null&&s==="onScroll"&&tr("scroll",t):c!=null&&MA(t,s,c,a))}switch(r){case"input":mx(t),DI(t,n,!1);break;case"textarea":mx(t),FI(t);break;case"option":n.value!=null&&t.setAttribute("value",""+pc(n.value));break;case"select":t.multiple=!!n.multiple,s=n.value,s!=null?$f(t,!!n.multiple,s,!1):n.defaultValue!=null&&$f(t,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=o0)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return In(e),null;case 6:if(t&&e.stateNode!=null)Z6(t,e,t.memoizedProps,n);else{if(typeof n!="string"&&e.stateNode===null)throw Error(ye(166));if(r=xu(Fg.current),xu(za.current),Sx(e)){if(n=e.stateNode,r=e.memoizedProps,n[Ia]=e,(s=n.nodeValue!==r)&&(t=Ki,t!==null))switch(t.tag){case 3:kx(n.nodeValue,r,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&kx(n.nodeValue,r,(t.mode&1)!==0)}s&&(e.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Ia]=e,e.stateNode=n}return In(e),null;case 13:if(sr(mr),n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(ur&&Hi!==null&&e.mode&1&&!(e.flags&128))h6(),gh(),e.flags|=98560,s=!1;else if(s=Sx(e),n!==null&&n.dehydrated!==null){if(t===null){if(!s)throw Error(ye(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(ye(317));s[Ia]=e}else gh(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;In(e),s=!1}else ia!==null&&(oE(ia),ia=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=r,e):(n=n!==null,n!==(t!==null&&t.memoizedState!==null)&&n&&(e.child.flags|=8192,e.mode&1&&(t===null||mr.current&1?Qr===0&&(Qr=3):mP())),e.updateQueue!==null&&(e.flags|=4),In(e),null);case 4:return yh(),QC(t,e),t===null&&Lg(e.stateNode.containerInfo),In(e),null;case 10:return XA(e.type._context),In(e),null;case 17:return Si(e.type)&&l0(),In(e),null;case 19:if(sr(mr),s=e.memoizedState,s===null)return In(e),null;if(n=(e.flags&128)!==0,a=s.rendering,a===null)if(n)cm(s,!1);else{if(Qr!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(a=m0(t),a!==null){for(e.flags|=128,cm(s,!1),n=a.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),e.subtreeFlags=0,n=r,r=e.child;r!==null;)s=r,t=n,s.flags&=14680066,a=s.alternate,a===null?(s.childLanes=0,s.lanes=t,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,t=a.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),r=r.sibling;return Yt(mr,mr.current&1|2),e.child}t=t.sibling}s.tail!==null&&Ar()>bh&&(e.flags|=128,n=!0,cm(s,!1),e.lanes=4194304)}else{if(!n)if(t=m0(a),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),cm(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!ur)return In(e),null}else 2*Ar()-s.renderingStartTime>bh&&r!==1073741824&&(e.flags|=128,n=!0,cm(s,!1),e.lanes=4194304);s.isBackwards?(a.sibling=e.child,e.child=a):(r=s.last,r!==null?r.sibling=a:e.child=a,s.last=a)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Ar(),e.sibling=null,r=mr.current,Yt(mr,n?r&1|2:r&1),e):(In(e),null);case 22:case 23:return pP(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?$i&1073741824&&(In(e),e.subtreeFlags&6&&(e.flags|=8192)):In(e),null;case 24:return null;case 25:return null}throw Error(ye(156,e.tag))}function Ure(t,e){switch(GA(e),e.tag){case 1:return Si(e.type)&&l0(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return yh(),sr(ki),sr(Hn),nP(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return rP(e),null;case 13:if(sr(mr),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(ye(340));gh()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return sr(mr),null;case 4:return yh(),null;case 10:return XA(e.type._context),null;case 22:case 23:return pP(),null;case 24:return null;default:return null}}var Cx=!1,Fn=!1,Hre=typeof WeakSet=="function"?WeakSet:Set,Ce=null;function Cf(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Nr(t,e,n)}else r.current=null}function eE(t,e,r){try{r()}catch(n){Nr(t,e,n)}}var OL=!1;function Vre(t,e){if($C=i0,t=e6(),qA(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var a=0,o=-1,c=-1,u=0,d=0,f=t,p=null;t:for(;;){for(var m;f!==r||i!==0&&f.nodeType!==3||(o=a+i),f!==s||n!==0&&f.nodeType!==3||(c=a+n),f.nodeType===3&&(a+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===t)break t;if(p===r&&++u===i&&(o=a),p===s&&++d===n&&(c=a),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=o===-1||c===-1?null:{start:o,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(DC={focusedElem:t,selectionRange:r},i0=!1,Ce=e;Ce!==null;)if(e=Ce,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ce=t;else for(;Ce!==null;){e=Ce;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,w=y.memoizedState,b=e.stateNode,_=b.getSnapshotBeforeUpdate(e.elementType===e.type?v:Ys(e.type,v),w);b.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var S=e.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ye(163))}}catch(N){Nr(e,e.return,N)}if(t=e.sibling,t!==null){t.return=e.return,Ce=t;break}Ce=e.return}return y=OL,OL=!1,y}function Qm(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&eE(e,r,s)}i=i.next}while(i!==n)}}function n_(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function tE(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function J6(t){var e=t.alternate;e!==null&&(t.alternate=null,J6(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Ia],delete e[Dg],delete e[zC],delete e[Nre],delete e[Cre])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Y6(t){return t.tag===5||t.tag===3||t.tag===4}function TL(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Y6(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function rE(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=o0));else if(n!==4&&(t=t.child,t!==null))for(rE(t,e,r),t=t.sibling;t!==null;)rE(t,e,r),t=t.sibling}function nE(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(nE(t,e,r),t=t.sibling;t!==null;)nE(t,e,r),t=t.sibling}var Sn=null,ra=!1;function cl(t,e,r){for(r=r.child;r!==null;)X6(t,e,r),r=r.sibling}function X6(t,e,r){if(Fa&&typeof Fa.onCommitFiberUnmount=="function")try{Fa.onCommitFiberUnmount(Z1,r)}catch{}switch(r.tag){case 5:Fn||Cf(r,e);case 6:var n=Sn,i=ra;Sn=null,cl(t,e,r),Sn=n,ra=i,Sn!==null&&(ra?(t=Sn,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Sn.removeChild(r.stateNode));break;case 18:Sn!==null&&(ra?(t=Sn,r=r.stateNode,t.nodeType===8?dj(t.parentNode,r):t.nodeType===1&&dj(t,r),Mg(t)):dj(Sn,r.stateNode));break;case 4:n=Sn,i=ra,Sn=r.stateNode.containerInfo,ra=!0,cl(t,e,r),Sn=n,ra=i;break;case 0:case 11:case 14:case 15:if(!Fn&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&eE(r,e,a),i=i.next}while(i!==n)}cl(t,e,r);break;case 1:if(!Fn&&(Cf(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(o){Nr(r,e,o)}cl(t,e,r);break;case 21:cl(t,e,r);break;case 22:r.mode&1?(Fn=(n=Fn)||r.memoizedState!==null,cl(t,e,r),Fn=n):cl(t,e,r);break;default:cl(t,e,r)}}function AL(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new Hre),e.forEach(function(n){var i=Qre.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function qs(t,e){var r=e.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var s=t,a=e,o=a;e:for(;o!==null;){switch(o.tag){case 5:Sn=o.stateNode,ra=!1;break e;case 3:Sn=o.stateNode.containerInfo,ra=!0;break e;case 4:Sn=o.stateNode.containerInfo,ra=!0;break e}o=o.return}if(Sn===null)throw Error(ye(160));X6(s,a,i),Sn=null,ra=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){Nr(i,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)Q6(e,t),e=e.sibling}function Q6(t,e){var r=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(qs(e,t),ka(t),n&4){try{Qm(3,t,t.return),n_(3,t)}catch(v){Nr(t,t.return,v)}try{Qm(5,t,t.return)}catch(v){Nr(t,t.return,v)}}break;case 1:qs(e,t),ka(t),n&512&&r!==null&&Cf(r,r.return);break;case 5:if(qs(e,t),ka(t),n&512&&r!==null&&Cf(r,r.return),t.flags&32){var i=t.stateNode;try{Og(i,"")}catch(v){Nr(t,t.return,v)}}if(n&4&&(i=t.stateNode,i!=null)){var s=t.memoizedProps,a=r!==null?r.memoizedProps:s,o=t.type,c=t.updateQueue;if(t.updateQueue=null,c!==null)try{o==="input"&&s.type==="radio"&&s.name!=null&&w8(i,s),CC(o,a);var u=CC(o,s);for(a=0;a<c.length;a+=2){var d=c[a],f=c[a+1];d==="style"?N8(i,f):d==="dangerouslySetInnerHTML"?S8(i,f):d==="children"?Og(i,f):MA(i,d,f,u)}switch(o){case"input":_C(i,s);break;case"textarea":_8(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var m=s.value;m!=null?$f(i,!!s.multiple,m,!1):p!==!!s.multiple&&(s.defaultValue!=null?$f(i,!!s.multiple,s.defaultValue,!0):$f(i,!!s.multiple,s.multiple?[]:"",!1))}i[Dg]=s}catch(v){Nr(t,t.return,v)}}break;case 6:if(qs(e,t),ka(t),n&4){if(t.stateNode===null)throw Error(ye(162));i=t.stateNode,s=t.memoizedProps;try{i.nodeValue=s}catch(v){Nr(t,t.return,v)}}break;case 3:if(qs(e,t),ka(t),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Mg(e.containerInfo)}catch(v){Nr(t,t.return,v)}break;case 4:qs(e,t),ka(t);break;case 13:qs(e,t),ka(t),i=t.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(fP=Ar())),n&4&&AL(t);break;case 22:if(d=r!==null&&r.memoizedState!==null,t.mode&1?(Fn=(u=Fn)||d,qs(e,t),Fn=u):qs(e,t),ka(t),n&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!d&&t.mode&1)for(Ce=t,d=t.child;d!==null;){for(f=Ce=d;Ce!==null;){switch(p=Ce,m=p.child,p.tag){case 0:case 11:case 14:case 15:Qm(4,p,p.return);break;case 1:Cf(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){n=p,r=p.return;try{e=n,y.props=e.memoizedProps,y.state=e.memoizedState,y.componentWillUnmount()}catch(v){Nr(n,r,v)}}break;case 5:Cf(p,p.return);break;case 22:if(p.memoizedState!==null){ML(f);continue}}m!==null?(m.return=p,Ce=m):ML(f)}d=d.sibling}e:for(d=null,f=t;;){if(f.tag===5){if(d===null){d=f;try{i=f.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(o=f.stateNode,c=f.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,o.style.display=j8("display",a))}catch(v){Nr(t,t.return,v)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(v){Nr(t,t.return,v)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===t)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:qs(e,t),ka(t),n&4&&AL(t);break;case 21:break;default:qs(e,t),ka(t)}}function ka(t){var e=t.flags;if(e&2){try{e:{for(var r=t.return;r!==null;){if(Y6(r)){var n=r;break e}r=r.return}throw Error(ye(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(Og(i,""),n.flags&=-33);var s=TL(t);nE(t,s,i);break;case 3:case 4:var a=n.stateNode.containerInfo,o=TL(t);rE(t,o,a);break;default:throw Error(ye(161))}}catch(c){Nr(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function Wre(t,e,r){Ce=t,eU(t)}function eU(t,e,r){for(var n=(t.mode&1)!==0;Ce!==null;){var i=Ce,s=i.child;if(i.tag===22&&n){var a=i.memoizedState!==null||Cx;if(!a){var o=i.alternate,c=o!==null&&o.memoizedState!==null||Fn;o=Cx;var u=Fn;if(Cx=a,(Fn=c)&&!u)for(Ce=i;Ce!==null;)a=Ce,c=a.child,a.tag===22&&a.memoizedState!==null?RL(i):c!==null?(c.return=a,Ce=c):RL(i);for(;s!==null;)Ce=s,eU(s),s=s.sibling;Ce=i,Cx=o,Fn=u}PL(t)}else i.subtreeFlags&8772&&s!==null?(s.return=i,Ce=s):PL(t)}}function PL(t){for(;Ce!==null;){var e=Ce;if(e.flags&8772){var r=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Fn||n_(5,e);break;case 1:var n=e.stateNode;if(e.flags&4&&!Fn)if(r===null)n.componentDidMount();else{var i=e.elementType===e.type?r.memoizedProps:Ys(e.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&gL(e,s,n);break;case 3:var a=e.updateQueue;if(a!==null){if(r=null,e.child!==null)switch(e.child.tag){case 5:r=e.child.stateNode;break;case 1:r=e.child.stateNode}gL(e,a,r)}break;case 5:var o=e.stateNode;if(r===null&&e.flags&4){r=o;var c=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&Mg(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ye(163))}Fn||e.flags&512&&tE(e)}catch(p){Nr(e,e.return,p)}}if(e===t){Ce=null;break}if(r=e.sibling,r!==null){r.return=e.return,Ce=r;break}Ce=e.return}}function ML(t){for(;Ce!==null;){var e=Ce;if(e===t){Ce=null;break}var r=e.sibling;if(r!==null){r.return=e.return,Ce=r;break}Ce=e.return}}function RL(t){for(;Ce!==null;){var e=Ce;try{switch(e.tag){case 0:case 11:case 15:var r=e.return;try{n_(4,e)}catch(c){Nr(e,r,c)}break;case 1:var n=e.stateNode;if(typeof n.componentDidMount=="function"){var i=e.return;try{n.componentDidMount()}catch(c){Nr(e,i,c)}}var s=e.return;try{tE(e)}catch(c){Nr(e,s,c)}break;case 5:var a=e.return;try{tE(e)}catch(c){Nr(e,a,c)}}}catch(c){Nr(e,e.return,c)}if(e===t){Ce=null;break}var o=e.sibling;if(o!==null){o.return=e.return,Ce=o;break}Ce=e.return}}var qre=Math.ceil,y0=Yo.ReactCurrentDispatcher,uP=Yo.ReactCurrentOwner,ks=Yo.ReactCurrentBatchConfig,jt=0,un=null,Ur=null,Tn=0,$i=0,Ef=jc(0),Qr=0,Vg=null,Gu=0,i_=0,dP=0,eg=null,xi=null,fP=0,bh=1/0,vo=null,x0=!1,iE=null,tc=null,Ex=!1,Hl=null,b0=0,tg=0,sE=null,Pb=-1,Mb=0;function si(){return jt&6?Ar():Pb!==-1?Pb:Pb=Ar()}function rc(t){return t.mode&1?jt&2&&Tn!==0?Tn&-Tn:Ore.transition!==null?(Mb===0&&(Mb=D8()),Mb):(t=It,t!==0||(t=window.event,t=t===void 0?16:W8(t.type)),t):1}function ca(t,e,r,n){if(50<tg)throw tg=0,sE=null,Error(ye(185));fy(t,r,n),(!(jt&2)||t!==un)&&(t===un&&(!(jt&2)&&(i_|=r),Qr===4&&Tl(t,Tn)),ji(t,n),r===1&&jt===0&&!(e.mode&1)&&(bh=Ar()+500,e_&&Nc()))}function ji(t,e){var r=t.callbackNode;Ote(t,e);var n=n0(t,t===un?Tn:0);if(n===0)r!==null&&HI(r),t.callbackNode=null,t.callbackPriority=0;else if(e=n&-n,t.callbackPriority!==e){if(r!=null&&HI(r),e===1)t.tag===0?Ere(IL.bind(null,t)):u6(IL.bind(null,t)),Sre(function(){!(jt&6)&&Nc()}),r=null;else{switch(B8(n)){case 1:r=DA;break;case 4:r=L8;break;case 16:r=r0;break;case 536870912:r=$8;break;default:r=r0}r=lU(r,tU.bind(null,t))}t.callbackPriority=e,t.callbackNode=r}}function tU(t,e){if(Pb=-1,Mb=0,jt&6)throw Error(ye(327));var r=t.callbackNode;if(Uf()&&t.callbackNode!==r)return null;var n=n0(t,t===un?Tn:0);if(n===0)return null;if(n&30||n&t.expiredLanes||e)e=w0(t,n);else{e=n;var i=jt;jt|=2;var s=nU();(un!==t||Tn!==e)&&(vo=null,bh=Ar()+500,Lu(t,e));do try{Zre();break}catch(o){rU(t,o)}while(!0);YA(),y0.current=s,jt=i,Ur!==null?e=0:(un=null,Tn=0,e=Qr)}if(e!==0){if(e===2&&(i=PC(t),i!==0&&(n=i,e=aE(t,i))),e===1)throw r=Vg,Lu(t,0),Tl(t,n),ji(t,Ar()),r;if(e===6)Tl(t,n);else{if(i=t.current.alternate,!(n&30)&&!Kre(i)&&(e=w0(t,n),e===2&&(s=PC(t),s!==0&&(n=s,e=aE(t,s))),e===1))throw r=Vg,Lu(t,0),Tl(t,n),ji(t,Ar()),r;switch(t.finishedWork=i,t.finishedLanes=n,e){case 0:case 1:throw Error(ye(345));case 2:lu(t,xi,vo);break;case 3:if(Tl(t,n),(n&130023424)===n&&(e=fP+500-Ar(),10<e)){if(n0(t,0)!==0)break;if(i=t.suspendedLanes,(i&n)!==n){si(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=FC(lu.bind(null,t,xi,vo),e);break}lu(t,xi,vo);break;case 4:if(Tl(t,n),(n&4194240)===n)break;for(e=t.eventTimes,i=-1;0<n;){var a=31-la(n);s=1<<a,a=e[a],a>i&&(i=a),n&=~s}if(n=i,n=Ar()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*qre(n/1960))-n,10<n){t.timeoutHandle=FC(lu.bind(null,t,xi,vo),n);break}lu(t,xi,vo);break;case 5:lu(t,xi,vo);break;default:throw Error(ye(329))}}}return ji(t,Ar()),t.callbackNode===r?tU.bind(null,t):null}function aE(t,e){var r=eg;return t.current.memoizedState.isDehydrated&&(Lu(t,e).flags|=256),t=w0(t,e),t!==2&&(e=xi,xi=r,e!==null&&oE(e)),t}function oE(t){xi===null?xi=t:xi.push.apply(xi,t)}function Kre(t){for(var e=t;;){if(e.flags&16384){var r=e.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var i=r[n],s=i.getSnapshot;i=i.value;try{if(!da(s(),i))return!1}catch{return!1}}}if(r=e.child,e.subtreeFlags&16384&&r!==null)r.return=e,e=r;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Tl(t,e){for(e&=~dP,e&=~i_,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var r=31-la(e),n=1<<r;t[r]=-1,e&=~n}}function IL(t){if(jt&6)throw Error(ye(327));Uf();var e=n0(t,0);if(!(e&1))return ji(t,Ar()),null;var r=w0(t,e);if(t.tag!==0&&r===2){var n=PC(t);n!==0&&(e=n,r=aE(t,n))}if(r===1)throw r=Vg,Lu(t,0),Tl(t,e),ji(t,Ar()),r;if(r===6)throw Error(ye(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,lu(t,xi,vo),ji(t,Ar()),null}function hP(t,e){var r=jt;jt|=1;try{return t(e)}finally{jt=r,jt===0&&(bh=Ar()+500,e_&&Nc())}}function Zu(t){Hl!==null&&Hl.tag===0&&!(jt&6)&&Uf();var e=jt;jt|=1;var r=ks.transition,n=It;try{if(ks.transition=null,It=1,t)return t()}finally{It=n,ks.transition=r,jt=e,!(jt&6)&&Nc()}}function pP(){$i=Ef.current,sr(Ef)}function Lu(t,e){t.finishedWork=null,t.finishedLanes=0;var r=t.timeoutHandle;if(r!==-1&&(t.timeoutHandle=-1,kre(r)),Ur!==null)for(r=Ur.return;r!==null;){var n=r;switch(GA(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&l0();break;case 3:yh(),sr(ki),sr(Hn),nP();break;case 5:rP(n);break;case 4:yh();break;case 13:sr(mr);break;case 19:sr(mr);break;case 10:XA(n.type._context);break;case 22:case 23:pP()}r=r.return}if(un=t,Ur=t=nc(t.current,null),Tn=$i=e,Qr=0,Vg=null,dP=i_=Gu=0,xi=eg=null,yu!==null){for(e=0;e<yu.length;e++)if(r=yu[e],n=r.interleaved,n!==null){r.interleaved=null;var i=n.next,s=r.pending;if(s!==null){var a=s.next;s.next=i,n.next=a}r.pending=n}yu=null}return t}function rU(t,e){do{var r=Ur;try{if(YA(),Ob.current=v0,g0){for(var n=gr.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}g0=!1}if(Ku=0,on=Yr=gr=null,Xm=!1,zg=0,uP.current=null,r===null||r.return===null){Qr=1,Vg=e,Ur=null;break}e:{var s=t,a=r.return,o=r,c=e;if(e=Tn,o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=o,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=_L(a);if(m!==null){m.flags&=-257,kL(m,a,o,s,e),m.mode&1&&wL(s,u,e),e=m,c=u;var y=e.updateQueue;if(y===null){var v=new Set;v.add(c),e.updateQueue=v}else y.add(c);break e}else{if(!(e&1)){wL(s,u,e),mP();break e}c=Error(ye(426))}}else if(ur&&o.mode&1){var w=_L(a);if(w!==null){!(w.flags&65536)&&(w.flags|=256),kL(w,a,o,s,e),ZA(xh(c,o));break e}}s=c=xh(c,o),Qr!==4&&(Qr=2),eg===null?eg=[s]:eg.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var b=B6(s,c,e);mL(s,b);break e;case 1:o=c;var _=s.type,S=s.stateNode;if(!(s.flags&128)&&(typeof _.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(tc===null||!tc.has(S)))){s.flags|=65536,e&=-e,s.lanes|=e;var N=F6(s,o,e);mL(s,N);break e}}s=s.return}while(s!==null)}sU(r)}catch(j){e=j,Ur===r&&r!==null&&(Ur=r=r.return);continue}break}while(!0)}function nU(){var t=y0.current;return y0.current=v0,t===null?v0:t}function mP(){(Qr===0||Qr===3||Qr===2)&&(Qr=4),un===null||!(Gu&268435455)&&!(i_&268435455)||Tl(un,Tn)}function w0(t,e){var r=jt;jt|=2;var n=nU();(un!==t||Tn!==e)&&(vo=null,Lu(t,e));do try{Gre();break}catch(i){rU(t,i)}while(!0);if(YA(),jt=r,y0.current=n,Ur!==null)throw Error(ye(261));return un=null,Tn=0,Qr}function Gre(){for(;Ur!==null;)iU(Ur)}function Zre(){for(;Ur!==null&&!bte();)iU(Ur)}function iU(t){var e=oU(t.alternate,t,$i);t.memoizedProps=t.pendingProps,e===null?sU(t):Ur=e,uP.current=null}function sU(t){var e=t;do{var r=e.alternate;if(t=e.return,e.flags&32768){if(r=Ure(r,e),r!==null){r.flags&=32767,Ur=r;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Qr=6,Ur=null;return}}else if(r=zre(r,e,$i),r!==null){Ur=r;return}if(e=e.sibling,e!==null){Ur=e;return}Ur=e=t}while(e!==null);Qr===0&&(Qr=5)}function lu(t,e,r){var n=It,i=ks.transition;try{ks.transition=null,It=1,Jre(t,e,r,n)}finally{ks.transition=i,It=n}return null}function Jre(t,e,r,n){do Uf();while(Hl!==null);if(jt&6)throw Error(ye(327));r=t.finishedWork;var i=t.finishedLanes;if(r===null)return null;if(t.finishedWork=null,t.finishedLanes=0,r===t.current)throw Error(ye(177));t.callbackNode=null,t.callbackPriority=0;var s=r.lanes|r.childLanes;if(Tte(t,s),t===un&&(Ur=un=null,Tn=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Ex||(Ex=!0,lU(r0,function(){return Uf(),null})),s=(r.flags&15990)!==0,r.subtreeFlags&15990||s){s=ks.transition,ks.transition=null;var a=It;It=1;var o=jt;jt|=4,uP.current=null,Vre(t,r),Q6(r,t),gre(DC),i0=!!$C,DC=$C=null,t.current=r,Wre(r),wte(),jt=o,It=a,ks.transition=s}else t.current=r;if(Ex&&(Ex=!1,Hl=t,b0=i),s=t.pendingLanes,s===0&&(tc=null),Ste(r.stateNode),ji(t,Ar()),e!==null)for(n=t.onRecoverableError,r=0;r<e.length;r++)i=e[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(x0)throw x0=!1,t=iE,iE=null,t;return b0&1&&t.tag!==0&&Uf(),s=t.pendingLanes,s&1?t===sE?tg++:(tg=0,sE=t):tg=0,Nc(),null}function Uf(){if(Hl!==null){var t=B8(b0),e=ks.transition,r=It;try{if(ks.transition=null,It=16>t?16:t,Hl===null)var n=!1;else{if(t=Hl,Hl=null,b0=0,jt&6)throw Error(ye(331));var i=jt;for(jt|=4,Ce=t.current;Ce!==null;){var s=Ce,a=s.child;if(Ce.flags&16){var o=s.deletions;if(o!==null){for(var c=0;c<o.length;c++){var u=o[c];for(Ce=u;Ce!==null;){var d=Ce;switch(d.tag){case 0:case 11:case 15:Qm(8,d,s)}var f=d.child;if(f!==null)f.return=d,Ce=f;else for(;Ce!==null;){d=Ce;var p=d.sibling,m=d.return;if(J6(d),d===u){Ce=null;break}if(p!==null){p.return=m,Ce=p;break}Ce=m}}}var y=s.alternate;if(y!==null){var v=y.child;if(v!==null){y.child=null;do{var w=v.sibling;v.sibling=null,v=w}while(v!==null)}}Ce=s}}if(s.subtreeFlags&2064&&a!==null)a.return=s,Ce=a;else e:for(;Ce!==null;){if(s=Ce,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Qm(9,s,s.return)}var b=s.sibling;if(b!==null){b.return=s.return,Ce=b;break e}Ce=s.return}}var _=t.current;for(Ce=_;Ce!==null;){a=Ce;var S=a.child;if(a.subtreeFlags&2064&&S!==null)S.return=a,Ce=S;else e:for(a=_;Ce!==null;){if(o=Ce,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:n_(9,o)}}catch(j){Nr(o,o.return,j)}if(o===a){Ce=null;break e}var N=o.sibling;if(N!==null){N.return=o.return,Ce=N;break e}Ce=o.return}}if(jt=i,Nc(),Fa&&typeof Fa.onPostCommitFiberRoot=="function")try{Fa.onPostCommitFiberRoot(Z1,t)}catch{}n=!0}return n}finally{It=r,ks.transition=e}}return!1}function LL(t,e,r){e=xh(r,e),e=B6(t,e,1),t=ec(t,e,1),e=si(),t!==null&&(fy(t,1,e),ji(t,e))}function Nr(t,e,r){if(t.tag===3)LL(t,t,r);else for(;e!==null;){if(e.tag===3){LL(e,t,r);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(tc===null||!tc.has(n))){t=xh(r,t),t=F6(e,t,1),e=ec(e,t,1),t=si(),e!==null&&(fy(e,1,t),ji(e,t));break}}e=e.return}}function Yre(t,e,r){var n=t.pingCache;n!==null&&n.delete(e),e=si(),t.pingedLanes|=t.suspendedLanes&r,un===t&&(Tn&r)===r&&(Qr===4||Qr===3&&(Tn&130023424)===Tn&&500>Ar()-fP?Lu(t,0):dP|=r),ji(t,e)}function aU(t,e){e===0&&(t.mode&1?(e=yx,yx<<=1,!(yx&130023424)&&(yx=4194304)):e=1);var r=si();t=Do(t,e),t!==null&&(fy(t,e,r),ji(t,r))}function Xre(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),aU(t,r)}function Qre(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(ye(314))}n!==null&&n.delete(e),aU(t,r)}var oU;oU=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||ki.current)wi=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return wi=!1,Fre(t,e,r);wi=!!(t.flags&131072)}else wi=!1,ur&&e.flags&1048576&&d6(e,d0,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;Ab(t,e),t=e.pendingProps;var i=mh(e,Hn.current);zf(e,r),i=sP(null,e,n,t,i,r);var s=aP();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Si(n)?(s=!0,c0(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,eP(e),i.updater=r_,e.stateNode=i,i._reactInternals=e,KC(e,n,t,r),e=JC(null,e,n,!0,s,r)):(e.tag=0,ur&&s&&KA(e),Qn(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(Ab(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=tne(n),t=Ys(n,t),i){case 0:e=ZC(null,e,n,t,r);break e;case 1:e=NL(null,e,n,t,r);break e;case 11:e=SL(null,e,n,t,r);break e;case 14:e=jL(null,e,n,Ys(n.type,t),r);break e}throw Error(ye(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ys(n,i),ZC(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ys(n,i),NL(t,e,n,i,r);case 3:e:{if(V6(e),t===null)throw Error(ye(387));n=e.pendingProps,s=e.memoizedState,i=s.element,v6(t,e),p0(e,n,null,r);var a=e.memoizedState;if(n=a.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=xh(Error(ye(423)),e),e=CL(t,e,n,r,i);break e}else if(n!==i){i=xh(Error(ye(424)),e),e=CL(t,e,n,r,i);break e}else for(Hi=Ql(e.stateNode.containerInfo.firstChild),Ki=e,ur=!0,ia=null,r=m6(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(gh(),n===i){e=Bo(t,e,r);break e}Qn(t,e,n,r)}e=e.child}return e;case 5:return y6(e),t===null&&VC(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,a=i.children,BC(n,i)?a=null:s!==null&&BC(n,s)&&(e.flags|=32),H6(t,e),Qn(t,e,a,r),e.child;case 6:return t===null&&VC(e),null;case 13:return W6(t,e,r);case 4:return tP(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=vh(e,null,n,r):Qn(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ys(n,i),SL(t,e,n,i,r);case 7:return Qn(t,e,e.pendingProps,r),e.child;case 8:return Qn(t,e,e.pendingProps.children,r),e.child;case 12:return Qn(t,e,e.pendingProps.children,r),e.child;
vendor: 4,558 bytes, line 40
40case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,a=i.value,Yt(f0,n._currentValue),n._currentValue=a,s!==null)if(da(s.value,a)){if(s.children===i.children&&!ki.current){e=Bo(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var o=s.dependencies;if(o!==null){a=s.child;for(var c=o.firstContext;c!==null;){if(c.context===n){if(s.tag===1){c=Ao(-1,r&-r),c.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}s.lanes|=r,c=s.alternate,c!==null&&(c.lanes|=r),WC(s.return,r,e),o.lanes|=r;break}c=c.next}}else if(s.tag===10)a=s.type===e.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(ye(341));a.lanes|=r,o=a.alternate,o!==null&&(o.lanes|=r),WC(a,r,e),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===e){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}Qn(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,zf(e,r),i=As(i),n=n(i),e.flags|=1,Qn(t,e,n,r),e.child;case 14:return n=e.type,i=Ys(n,e.pendingProps),i=Ys(n.type,i),jL(t,e,n,i,r);case 15:return z6(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ys(n,i),Ab(t,e),e.tag=1,Si(n)?(t=!0,c0(e)):t=!1,zf(e,r),D6(e,n,i),KC(e,n,i,r),JC(null,e,n,!0,t,r);case 19:return q6(t,e,r);case 22:return U6(t,e,r)}throw Error(ye(156,e.tag))};function lU(t,e){return I8(t,e)}function ene(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ws(t,e,r,n){return new ene(t,e,r,n)}function gP(t){return t=t.prototype,!(!t||!t.isReactComponent)}function tne(t){if(typeof t=="function")return gP(t)?1:0;if(t!=null){if(t=t.$$typeof,t===IA)return 11;if(t===LA)return 14}return 2}function nc(t,e){var r=t.alternate;return r===null?(r=ws(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function Rb(t,e,r,n,i,s){var a=2;if(n=t,typeof t=="function")gP(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case yf:return $u(r.children,i,s,e);case RA:a=8,i|=8;break;case vC:return t=ws(12,r,e,i|2),t.elementType=vC,t.lanes=s,t;case yC:return t=ws(13,r,e,i),t.elementType=yC,t.lanes=s,t;case xC:return t=ws(19,r,e,i),t.elementType=xC,t.lanes=s,t;case y8:return s_(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case g8:a=10;break e;case v8:a=9;break e;case IA:a=11;break e;case LA:a=14;break e;case bl:a=16,n=null;break e}throw Error(ye(130,t==null?t:typeof t,""))}return e=ws(a,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function $u(t,e,r,n){return t=ws(7,t,n,e),t.lanes=r,t}function s_(t,e,r,n){return t=ws(22,t,n,e),t.elementType=y8,t.lanes=r,t.stateNode={isHidden:!1},t}function xj(t,e,r){return t=ws(6,t,null,e),t.lanes=r,t}function bj(t,e,r){return e=ws(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function rne(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ej(0),this.expirationTimes=ej(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ej(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function vP(t,e,r,n,i,s,a,o,c){return t=new rne(t,e,r,o,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=ws(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},eP(s),t}function nne(t,e,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;
vendor: 4,601 bytes, line 40
40return{$$typeof:vf,key:n==null?null:""+n,children:t,containerInfo:e,implementation:r}}function cU(t){if(!t)return mc;t=t._reactInternals;e:{if(md(t)!==t||t.tag!==1)throw Error(ye(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Si(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(ye(171))}if(t.tag===1){var r=t.type;if(Si(r))return c6(t,r,e)}return e}function uU(t,e,r,n,i,s,a,o,c){return t=vP(r,n,!0,t,i,s,a,o,c),t.context=cU(null),r=t.current,n=si(),i=rc(r),s=Ao(n,i),s.callback=e??null,ec(r,s,i),t.current.lanes=i,fy(t,i,n),ji(t,n),t}function a_(t,e,r,n){var i=e.current,s=si(),a=rc(i);return r=cU(r),e.context===null?e.context=r:e.pendingContext=r,e=Ao(s,a),e.payload={element:t},n=n===void 0?null:n,n!==null&&(e.callback=n),t=ec(i,e,a),t!==null&&(ca(t,i,a,s),Eb(t,i,a)),a}function _0(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function $L(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<e?r:e}}function yP(t,e){$L(t,e),(t=t.alternate)&&$L(t,e)}function ine(){return null}var dU=typeof reportError=="function"?reportError:function(t){console.error(t)};function xP(t){this._internalRoot=t}o_.prototype.render=xP.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(ye(409));a_(t,e,null,null)};o_.prototype.unmount=xP.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Zu(function(){a_(null,t,null,null)}),e[$o]=null}};function o_(t){this._internalRoot=t}o_.prototype.unstable_scheduleHydration=function(t){if(t){var e=U8();t={blockedOn:null,target:t,priority:e};for(var r=0;r<Ol.length&&e!==0&&e<Ol[r].priority;r++);Ol.splice(r,0,t),r===0&&V8(t)}};function bP(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function l_(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function DL(){}function sne(t,e,r,n,i){if(i){if(typeof n=="function"){var s=n;n=function(){var u=_0(a);s.call(u)}}var a=uU(e,n,t,0,null,!1,!1,"",DL);return t._reactRootContainer=a,t[$o]=a.current,Lg(t.nodeType===8?t.parentNode:t),Zu(),a}for(;i=t.lastChild;)t.removeChild(i);if(typeof n=="function"){var o=n;n=function(){var u=_0(c);o.call(u)}}var c=vP(t,0,!1,null,null,!1,!1,"",DL);return t._reactRootContainer=c,t[$o]=c.current,Lg(t.nodeType===8?t.parentNode:t),Zu(function(){a_(e,c,r,n)}),c}function c_(t,e,r,n,i){var s=r._reactRootContainer;if(s){var a=s;if(typeof i=="function"){var o=i;i=function(){var c=_0(a);o.call(c)}}a_(e,a,t,i)}else a=sne(r,e,t,i,n);return _0(a)}F8=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var r=Rm(e.pendingLanes);r!==0&&(BA(e,r|1),ji(e,Ar()),!(jt&6)&&(bh=Ar()+500,Nc()))}break;case 13:Zu(function(){var n=Do(t,1);if(n!==null){var i=si();ca(n,t,1,i)}}),yP(t,1)}};FA=function(t){if(t.tag===13){var e=Do(t,134217728);if(e!==null){var r=si();ca(e,t,134217728,r)}yP(t,134217728)}};z8=function(t){if(t.tag===13){var e=rc(t),r=Do(t,e);if(r!==null){var n=si();ca(r,t,e,n)}yP(t,e)}};U8=function(){return It};H8=function(t,e){var r=It;try{return It=t,e()}finally{It=r}};OC=function(t,e,r){switch(e){case"input":if(_C(t,r),e=r.name,r.type==="radio"&&e!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<r.length;e++){var n=r[e];if(n!==t&&n.form===t.form){var i=Q1(n);if(!i)throw Error(ye(90));b8(n),_C(n,i)}}}break;case"textarea":_8(t,r);break;case"select":e=r.value,e!=null&&$f(t,!!r.multiple,e,!1)}};O8=hP;T8=Zu;var ane={usingClientEntryPoint:!1,Events:[py,_f,Q1,C8,E8,hP]},um={findFiberByHostInstance:vu,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},one={bundleType:um.bundleType,version:um.version,rendererPackageName:um.rendererPackageName,rendererConfig:um.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Yo.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=M8(t),t===null?null:t.stateNode},findFiberByHostInstance:um.findFiberByHostInstance||ine,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
40if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ox=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ox.isDisabled&&Ox.supportsFiber)try{Z1=Ox.inject(one),Fa=Ox}catch{}}es.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ane;es.createPortal=function(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!bP(e))throw Error(ye(200));return nne(t,e,null,r)};es.createRoot=function(t,e){if(!bP(t))throw Error(ye(299));var r=!1,n="",i=dU;return e!=null&&(e.unstable_strictMode===!0&&(r=!0),e.identifierPrefix!==void 0&&(n=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=vP(t,1,!1,null,null,r,!1,n,i),t[$o]=e.current,Lg(t.nodeType===8?t.parentNode:t),new xP(e)};es.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(ye(188)):(t=Object.keys(t).join(","),Error(ye(268,t)));return t=M8(e),t=t===null?null:t.stateNode,t};es.flushSync=function(t){return Zu(t)};es.hydrate=function(t,e,r){if(!l_(e))throw Error(ye(200));return c_(null,t,e,!0,r)};es.hydrateRoot=function(t,e,r){if(!bP(t))throw Error(ye(405));var n=r!=null&&r.hydratedSources||null,i=!1,s="",a=dU;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(s=r.identifierPrefix),r.onRecoverableError!==void 0&&(a=r.onRecoverableError)),e=uU(e,null,t,1,r??null,i,!1,s,a),t[$o]=e.current,Lg(t),n)for(t=0;t<n.length;t++)r=n[t],i=r._getVersion,i=i(r._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[r,i]:e.mutableSourceEagerHydrationData.push(r,i);return new o_(e)};es.render=function(t,e,r){if(!l_(e))throw Error(ye(200));return c_(null,t,e,!1,r)};es.unmountComponentAtNode=function(t){if(!l_(t))throw Error(ye(40));return t._reactRootContainer?(Zu(function(){c_(null,null,t,!1,function(){t._reactRootContainer=null,t[$o]=null})}),!0):!1};es.unstable_batchedUpdates=hP;es.unstable_renderSubtreeIntoContainer=function(t,e,r,n){if(!l_(r))throw Error(ye(200));if(t==null||t._reactInternals===void 0)throw Error(ye(38));return c_(t,e,r,!1,n)};es.version="18.3.1-next-f1338f8080-20240426";function fU(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(fU)}catch(t){console.error(t)}}fU(),f8.exports=es;var Vi=f8.exports;const wP=St(Vi);var hU,BL=Vi;hU=BL.createRoot,BL.hydrateRoot;var lne=typeof Element<"u",cne=typeof Map=="function",une=typeof Set=="function",dne=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Ib(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var r,n,i;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!Ib(t[n],e[n]))return!1;return!0}var s;if(cne&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(s=t.entries();!(n=s.next()).done;)if(!e.has(n.value[0]))return!1;for(s=t.entries();!(n=s.next()).done;)if(!Ib(n.value[1],e.get(n.value[0])))return!1;return!0}if(une&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(s=t.entries();!(n=s.next()).done;)if(!e.has(n.value[0]))return!1;return!0}if(dne&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(t[n]!==e[n])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof e.valueOf=="function")return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof e.toString=="function")return t.toString()===e.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;if(lne&&t instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&t.$$typeof)&&!Ib(t[i[n]],e[i[n]]))return!1;return!0}return t!==t&&e!==e}var fne=function(e,r){try{return Ib(e,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const hne=St(fne);var pne=function(t,e,r,n,i,s,a,o){if(!t){var c;if(e===void 0)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,i,s,a,o],d=0;c=new Error(e.replace(/%s/g,function(){return u[d++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}},mne=pne;const FL=St(mne);var gne=function(e,r,n,i){var s=n?n.call(i,e,r):void 0;if(s!==void 0)return!!s;
40if(e===r)return!0;if(typeof e!="object"||!e||typeof r!="object"||!r)return!1;var a=Object.keys(e),o=Object.keys(r);if(a.length!==o.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(r),u=0;u<a.length;u++){var d=a[u];if(!c(d))return!1;var f=e[d],p=r[d];if(s=n?n.call(i,f,p,d):void 0,s===!1||s===void 0&&f!==p)return!1}return!0};const vne=St(gne);var pU=(t=>(t.BASE="base",t.BODY="body",t.HEAD="head",t.HTML="html",t.LINK="link",t.META="meta",t.NOSCRIPT="noscript",t.SCRIPT="script",t.STYLE="style",t.TITLE="title",t.FRAGMENT="Symbol(react.fragment)",t))(pU||{}),wj={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"]}},zL=Object.values(pU),u_={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},mU=Object.entries(u_).reduce((t,[e,r])=>(t[r]=e,t),{}),oa="data-rh",Hf={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},Vf=(t,e)=>{for(let r=t.length-1;r>=0;r-=1){const n=t[r];if(Object.prototype.hasOwnProperty.call(n,e))return n[e]}return null},yne=t=>{let e=Vf(t,"title");const r=Vf(t,Hf.TITLE_TEMPLATE);if(Array.isArray(e)&&(e=e.join("")),r&&e)return r.replace(/%s/g,()=>e);const n=Vf(t,Hf.DEFAULT_TITLE);return e||n||void 0},xne=t=>Vf(t,Hf.ON_CHANGE_CLIENT_STATE)||(()=>{}),_j=(t,e)=>e.filter(r=>typeof r[t]<"u").map(r=>r[t]).reduce((r,n)=>({...r,...n}),{}),bne=(t,e)=>e.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const i=Object.keys(n);for(let s=0;s<i.length;s+=1){const o=i[s].toLowerCase();if(t.indexOf(o)!==-1&&n[o])return r.concat(n)}}return r},[]),wne=t=>console&&typeof console.warn=="function"&&console.warn(t),dm=(t,e,r)=>{const n={};return r.filter(i=>Array.isArray(i[t])?!0:(typeof i[t]<"u"&&wne(`Helmet: ${t} should be of type "Array". Instead found type "${typeof i[t]}"`),!1)).map(i=>i[t]).reverse().reduce((i,s)=>{const a={};s.filter(c=>{let u;const d=Object.keys(c);for(let p=0;p<d.length;p+=1){const m=d[p],y=m.toLowerCase();e.indexOf(y)!==-1&&!(u==="rel"&&c[u].toLowerCase()==="canonical")&&!(y==="rel"&&c[y].toLowerCase()==="stylesheet")&&(u=y),e.indexOf(m)!==-1&&(m==="innerHTML"||m==="cssText"||m==="itemprop")&&(u=m)}if(!u||!c[u])return!1;const f=c[u].toLowerCase();return n[u]||(n[u]={}),a[u]||(a[u]={}),n[u][f]?!1:(a[u][f]=!0,!0)}).reverse().forEach(c=>i.push(c));const o=Object.keys(a);for(let c=0;c<o.length;c+=1){const u=o[c],d={...n[u],...a[u]};n[u]=d}return i},[]).reverse()},_ne=(t,e)=>{if(Array.isArray(t)&&t.length){for(let r=0;r<t.length;r+=1)if(t[r][e])return!0}return!1},kne=t=>({baseTag:bne(["href"],t),bodyAttributes:_j("bodyAttributes",t),defer:Vf(t,Hf.DEFER),encode:Vf(t,Hf.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:_j("htmlAttributes",t),linkTags:dm("link",["rel","href"],t),metaTags:dm("meta",["name","charset","http-equiv","property","itemprop"],t),noscriptTags:dm("noscript",["innerHTML"],t),onChangeClientState:xne(t),scriptTags:dm("script",["src","innerHTML"],t),styleTags:dm("style",["cssText"],t),title:yne(t),titleAttributes:_j("titleAttributes",t),prioritizeSeoTags:_ne(t,Hf.PRIORITIZE_SEO_TAGS)}),gU=t=>Array.isArray(t)?t.join(""):t,Sne=(t,e)=>{const r=Object.keys(t);for(let n=0;n<r.length;n+=1)if(e[r[n]]&&e[r[n]].includes(t[r[n]]))return!0;return!1},kj=(t,e)=>Array.isArray(t)?t.reduce((r,n)=>(Sne(n,e)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:t,priority:[]},UL=(t,e)=>({...t,[e]:void 0}),jne=["noscript","script","style"],lE=(t,e=!0)=>e===!1?String(t):String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"),vU=t=>Object.keys(t).reduce((e,r)=>{const n=typeof t[r]<"u"?`${r}="${t[r]}"`:`${r}`;return e?`${e} ${n}`:n},""),Nne=(t,e,r,n)=>{const i=vU(r),s=gU(e);return i?`<${t} ${oa}="true" ${i}>${lE(s,n)}</${t}>`:`<${t} ${oa}="true">${lE(s,n)}</${t}>`},Cne=(t,e,r=!0)=>e.reduce((n,i)=>{const s=i,a=Object.keys(s).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,d)=>{const f=typeof s[d]>"u"?d:`${d}="${lE(s[d],r)}"`;return u?`${u} ${f}`:f},""),o=s.innerHTML||s.cssText||"",c=jne.indexOf(t)===-1;return`${n}<${t} ${oa}="true" ${a}${c?"/>":`>${o}</${t}>`}`},""),yU=(t,e={})=>Object.keys(t).reduce((r,n)=>{const i=u_[n];return r[i||n]=t[n],r},e),Ene=(t,e,r)=>{const n={key:e,[oa]:!0},i=yU(r,n);return[D.createElement("title",i,e)]},Lb=(t,e)=>e.map((r,n)=>{const i={key:n,[oa]:!0};return Object.keys(r).forEach(s=>{const o=u_[s]||s;if(o==="innerHTML"||o==="cssText"){const c=r.innerHTML||r.cssText;i.dangerouslySetInnerHTML={__html:c}}else i[o]=r[s]}),D.createElement(t,i)}),hs=(t,e,r=!0)=>{switch(t){case"title":return{toComponent:()=>Ene(t,e.title,e.titleAttributes),toString:()=>Nne(t,e.title,e.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>yU(e),toString:()=>vU(e)};default:return{toComponent:()=>Lb(t,e),toString:()=>Cne(t,e,r)}}},One=({metaTags:t,linkTags:e,scriptTags:r,encode:n})=>{const i=kj(t,wj.meta),s=kj(e,wj.link),a=kj(r,wj.script);return{priorityMethods:{toComponent:()=>[...Lb("meta",i.priority),...Lb("link",s.priority),...Lb("script",a.priority)],toString:()=>`${hs("meta",i.priority,n)} ${hs("link",s.priority,n)} ${hs("script",a.priority,n)}`},metaTags:i.default,linkTags:s.default,scriptTags:a.default}},Tne=t=>{const{baseTag:e,bodyAttributes:r,encode:n=!0,htmlAttributes:i,noscriptTags:s,styleTags:a,title:o="",titleAttributes:c,prioritizeSeoTags:u}=t;let{linkTags:d,metaTags:f,scriptTags:p}=t,m={toComponent:()=>[],toString:()=>""};return u&&({priorityMethods:m,linkTags:d,metaTags:f,scriptTags:p}=One(t)),{priority:m,base:hs("base",e,n),bodyAttributes:hs("bodyAttributes",r,n),htmlAttributes:hs("htmlAttributes",i,n),link:hs("link",d,n),meta:hs("meta",f,n),noscript:hs("noscript",s,n),script:hs("script",p,n),style:hs("style",a,n),title:hs("title",{title:o,titleAttributes:c},n)}},cE=Tne,Tx=[],_P=!!(typeof window<"u"&&window.document&&window.document.createElement),uE=class{constructor(t,e){ao(this,"instances",[]);ao(this,"canUseDOM",_P);ao(this,"context");ao(this,"value",{setHelmet:t=>{this.context.helmet=t},helmetInstances:{get:()=>this.canUseDOM?Tx:this.instances,add:t=>{(this.canUseDOM?Tx:this.instances).push(t)},remove:t=>{const e=(this.canUseDOM?Tx:this.instances).indexOf(t);(this.canUseDOM?Tx:this.instances).splice(e,1)}}});this.context=t,this.canUseDOM=e||!1,e||(t.helmet=cE({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Ane=parseInt(D.version.split(".")[0],10),dE=Ane>=19,Pne={},xU=D.createContext(Pne),Ou,bU=(Ou=class extends x.Component{constructor(r){super(r);ao(this,"helmetData");dE?this.helmetData=null:this.helmetData=new uE(this.props.context||{},Ou.canUseDOM)}render(){return dE?D.createElement(D.Fragment,null,this.props.children):D.createElement(xU.Provider,{value:this.helmetData.value},this.props.children)}},ao(Ou,"canUseDOM",_P),Ou),Hd=(t,e)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${t}[${oa}]`),i=[].slice.call(n),s=[];let a;return e&&e.length&&e.forEach(o=>{const c=document.createElement(t);for(const u in o)if(Object.prototype.hasOwnProperty.call(o,u))if(u==="innerHTML")c.innerHTML=o.innerHTML;else if(u==="cssText"){const d=o.cssText;
40c.appendChild(document.createTextNode(d))}else{const d=u,f=typeof o[d]>"u"?"":o[d];c.setAttribute(u,f)}c.setAttribute(oa,"true"),i.some((u,d)=>(a=d,c.isEqualNode(u)))?i.splice(a,1):s.push(c)}),i.forEach(o=>{var c;return(c=o.parentNode)==null?void 0:c.removeChild(o)}),s.forEach(o=>r.appendChild(o)),{oldTags:i,newTags:s}},fE=(t,e)=>{const r=document.getElementsByTagName(t)[0];if(!r)return;const n=r.getAttribute(oa),i=n?n.split(","):[],s=[...i],a=Object.keys(e);for(const o of a){const c=e[o]||"";r.getAttribute(o)!==c&&r.setAttribute(o,c),i.indexOf(o)===-1&&i.push(o);const u=s.indexOf(o);u!==-1&&s.splice(u,1)}for(let o=s.length-1;o>=0;o-=1)r.removeAttribute(s[o]);i.length===s.length?r.removeAttribute(oa):r.getAttribute(oa)!==a.join(",")&&r.setAttribute(oa,a.join(","))},Mne=(t,e)=>{typeof t<"u"&&document.title!==t&&(document.title=gU(t)),fE("title",e)},HL=(t,e)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:i,linkTags:s,metaTags:a,noscriptTags:o,onChangeClientState:c,scriptTags:u,styleTags:d,title:f,titleAttributes:p}=t;fE("body",n),fE("html",i),Mne(f,p);const m={baseTag:Hd("base",r),linkTags:Hd("link",s),metaTags:Hd("meta",a),noscriptTags:Hd("noscript",o),scriptTags:Hd("script",u),styleTags:Hd("style",d)},y={},v={};Object.keys(m).forEach(w=>{const{newTags:b,oldTags:_}=m[w];b.length&&(y[w]=b),_.length&&(v[w]=m[w].oldTags)}),e&&e(),c(t,y,v)},fm=null,Rne=t=>{fm&&cancelAnimationFrame(fm),t.defer?fm=requestAnimationFrame(()=>{HL(t,()=>{fm=null})}):(HL(t),fm=null)},Ine=Rne,VL=class extends x.Component{constructor(){super(...arguments);ao(this,"rendered",!1)}shouldComponentUpdate(e){return!vne(e,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:e}=this.props.context;e.remove(this),this.emitChange()}emitChange(){const{helmetInstances:e,setHelmet:r}=this.props.context;let n=null;const i=kne(e.get().map(s=>{const{context:a,...o}=s.props;return o}));bU.canUseDOM?Ine(i):cE&&(n=cE(i)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:e}=this.props.context;e.add(this),this.emitChange()}render(){return this.init(),null}},$b=[],WL=t=>{const e={};for(const r of Object.keys(t))e[mU[r]||r]=t[r];return e},Xc=t=>{const e={};for(const r of Object.keys(t)){const n=u_[r];e[n||r]=t[r]}return e},qL=(t,e)=>{if(!_P)return;const r=document.getElementsByTagName(t)[0];if(!r)return;const n="data-rh-managed",i=r.getAttribute(n),s=i?i.split(","):[],a=Object.keys(e);for(const o of s)a.includes(o)||r.removeAttribute(o);for(const o of a){const c=e[o];c==null||c===!1?r.removeAttribute(o):c===!0?r.setAttribute(o,""):r.setAttribute(o,String(c))}a.length>0?r.setAttribute(n,a.join(",")):r.removeAttribute(n)},Sj=()=>{const t={},e={};for(const r of $b){const{htmlAttributes:n,bodyAttributes:i}=r.props;n&&Object.assign(t,WL(n)),i&&Object.assign(e,WL(i))}qL("html",t),qL("body",e)},Lne=class extends x.Component{componentDidMount(){$b.push(this),Sj()}componentDidUpdate(){Sj()}componentWillUnmount(){const t=$b.indexOf(this);t!==-1&&$b.splice(t,1),Sj()}resolveTitle(){const{title:t,titleTemplate:e,defaultTitle:r}=this.props;return t&&e?e.replace(/%s/g,()=>Array.isArray(t)?t.join(""):t):t||r||void 0}renderTitle(){const t=this.resolveTitle();if(t===void 0)return null;const e=this.props.titleAttributes||{};return D.createElement("title",Xc(e),t)}renderBase(){const{base:t}=this.props;return t?D.createElement("base",Xc(t)):null}renderMeta(){const{meta:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,r)=>D.createElement("meta",{key:r,...Xc(e)}))}renderLink(){const{link:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,r)=>D.createElement("link",{key:r,...Xc(e)}))}renderScript(){const{script:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,r)=>{const{innerHTML:n,...i}=e,s=Xc(i);return n&&(s.dangerouslySetInnerHTML={__html:n}),D.createElement("script",{key:r,...s})})}renderStyle(){const{style:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,r)=>{const{cssText:n,...i}=e,s=Xc(i);return n&&(s.dangerouslySetInnerHTML={__html:n}),D.createElement("style",{key:r,...s})})}renderNoscript(){const{noscript:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,r)=>{const{innerHTML:n,...i}=e,s=Xc(i);return n&&(s.dangerouslySetInnerHTML={__html:n}),D.createElement("noscript",{key:r,...s})})}render(){return D.createElement(D.Fragment,null,this.renderTitle(),this.renderBase(),this.renderMeta(),this.renderLink(),this.renderScript(),this.renderStyle(),this.renderNoscript())}},mC,kP=(mC=class extends x.Component{shouldComponentUpdate(t){return!hne(UL(this.props,"helmetData"),UL(t,"helmetData"))}mapNestedChildrenToProps(t,e){if(!e)return null;switch(t.type){case"script":case"noscript":return{innerHTML:e};case"style":return{cssText:e};default:throw new Error(`<${t.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(t,e,r,n){return{...e,[t.type]:[...e[t.type]||[],{...r,...this.mapNestedChildrenToProps(t,n)}]}}mapObjectTypeChildren(t,e,r,n){switch(t.type){case"title":return{...e,[t.type]:n,titleAttributes:{...r}};case"body":return{...e,bodyAttributes:{...r}};case"html":return{...e,htmlAttributes:{...r}};default:return{...e,[t.type]:{...r}}}}mapArrayTypeChildrenToProps(t,e){let r={...e};return Object.keys(t).forEach(n=>{r={...r,[n]:t[n]}}),r}
40warnOnInvalidChildren(t,e){return FL(zL.some(r=>t.type===r),typeof t.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 ${zL.join(", ")} are allowed. Helmet does not support rendering <${t.type}> elements. Refer to our API for more information.`),FL(!e||typeof e=="string"||Array.isArray(e)&&!e.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${t.type}>. Did you forget to wrap your children in braces? ( <${t.type}>{\`\`}</${t.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(t,e){let r={};return D.Children.forEach(t,n=>{if(!n||!n.props)return;const{children:i,...s}=n.props,a=Object.keys(s).reduce((c,u)=>(c[mU[u]||u]=s[u],c),{});let{type:o}=n;switch(typeof o=="symbol"?o=o.toString():this.warnOnInvalidChildren(n,i),o){case"Symbol(react.fragment)":e=this.mapChildrenToProps(i,e);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,a,i);break;default:e=this.mapObjectTypeChildren(n,e,a,i);break}}),this.mapArrayTypeChildrenToProps(r,e)}render(){const{children:t,...e}=this.props;let r={...e},{helmetData:n}=e;if(t&&(r=this.mapChildrenToProps(t,r)),n&&!(n instanceof uE)){const i=n;n=new uE(i.context,!0),delete r.helmetData}return dE?D.createElement(Lne,{...r}):n?D.createElement(VL,{...r,context:n.value}):D.createElement(xU.Consumer,null,i=>D.createElement(VL,{...r,context:i}))}},ao(mC,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),mC),d_=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},f_=typeof window>"u"||"Deno"in globalThis;function Xs(){}function $ne(t,e){return typeof t=="function"?t(e):t}function Dne(t){return typeof t=="number"&&t>=0&&t!==1/0}function Bne(t,e){return Math.max(t+(e||0)-Date.now(),0)}function hE(t,e){return typeof t=="function"?t(e):t}function Fne(t,e){return typeof t=="function"?t(e):t}function KL(t,e){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:a,stale:o}=t;if(a){if(n){if(e.queryHash!==SP(a,e.options))return!1}else if(!qg(e.queryKey,a))return!1}if(r!=="all"){const c=e.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||i&&i!==e.state.fetchStatus||s&&!s(e))}function GL(t,e){const{exact:r,status:n,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(r){if(Wg(e.options.mutationKey)!==Wg(s))return!1}else if(!qg(e.options.mutationKey,s))return!1}return!(n&&e.state.status!==n||i&&!i(e))}function SP(t,e){return((e==null?void 0:e.queryKeyHashFn)||Wg)(t)}function Wg(t){return JSON.stringify(t,(e,r)=>pE(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function qg(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(r=>qg(t[r],e[r])):!1}function wU(t,e){if(t===e)return t;const r=ZL(t)&&ZL(e);if(r||pE(t)&&pE(e)){const n=r?t:Object.keys(t),i=n.length,s=r?e:Object.keys(e),a=s.length,o=r?[]:{},c=new Set(n);let u=0;for(let d=0;d<a;d++){const f=r?d:s[d];(!r&&c.has(f)||r)&&t[f]===void 0&&e[f]===void 0?(o[f]=void 0,u++):(o[f]=wU(t[f],e[f]),o[f]===t[f]&&t[f]!==void 0&&u++)}return i===a&&u===i?t:o}return e}function ZL(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function pE(t){if(!JL(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!JL(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function JL(t){return Object.prototype.toString.call(t)==="[object Object]"}function zne(t){return new Promise(e=>{setTimeout(e,t)})}function Une(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?wU(t,e):e}function Hne(t,e,r=0){const n=[...t,e];return r&&n.length>r?n.slice(1):n}function Vne(t,e,r=0){const n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var jP=Symbol();function _U(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===jP?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Tu,$l,ah,Kz,Wne=(Kz=class extends d_{constructor(){super();Tt(this,Tu);Tt(this,$l);Tt(this,ah);tt(this,ah,e=>{if(!f_&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){de(this,$l)||this.setEventListener(de(this,ah))}onUnsubscribe(){var e;this.hasListeners()||((e=de(this,$l))==null||e.call(this),tt(this,$l,void 0))}setEventListener(e){var r;tt(this,ah,e),(r=de(this,$l))==null||r.call(this),tt(this,$l,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){de(this,Tu)!==e&&(tt(this,Tu,e),this.onFocus())}onFocus(){const e=this.isFocused();
vendor: 4,959 bytes, line 40
40this.listeners.forEach(r=>{r(e)})}isFocused(){var e;return typeof de(this,Tu)=="boolean"?de(this,Tu):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Tu=new WeakMap,$l=new WeakMap,ah=new WeakMap,Kz),kU=new Wne,oh,Dl,lh,Gz,qne=(Gz=class extends d_{constructor(){super();Tt(this,oh,!0);Tt(this,Dl);Tt(this,lh);tt(this,lh,e=>{if(!f_&&window.addEventListener){const r=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){de(this,Dl)||this.setEventListener(de(this,lh))}onUnsubscribe(){var e;this.hasListeners()||((e=de(this,Dl))==null||e.call(this),tt(this,Dl,void 0))}setEventListener(e){var r;tt(this,lh,e),(r=de(this,Dl))==null||r.call(this),tt(this,Dl,e(this.setOnline.bind(this)))}setOnline(e){de(this,oh)!==e&&(tt(this,oh,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return de(this,oh)}},oh=new WeakMap,Dl=new WeakMap,lh=new WeakMap,Gz),k0=new qne;function Kne(){let t,e;const r=new Promise((i,s)=>{t=i,e=s});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),t(i)},r.reject=i=>{n({status:"rejected",reason:i}),e(i)},r}function Gne(t){return Math.min(1e3*2**t,3e4)}function SU(t){return(t??"online")==="online"?k0.isOnline():!0}var jU=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function jj(t){return t instanceof jU}function NU(t){let e=!1,r=0,n=!1,i;const s=Kne(),a=v=>{var w;n||(p(new jU(v)),(w=t.abort)==null||w.call(t))},o=()=>{e=!0},c=()=>{e=!1},u=()=>kU.isFocused()&&(t.networkMode==="always"||k0.isOnline())&&t.canRun(),d=()=>SU(t.networkMode)&&t.canRun(),f=v=>{var w;n||(n=!0,(w=t.onSuccess)==null||w.call(t,v),i==null||i(),s.resolve(v))},p=v=>{var w;n||(n=!0,(w=t.onError)==null||w.call(t,v),i==null||i(),s.reject(v))},m=()=>new Promise(v=>{var w;i=b=>{(n||u())&&v(b)},(w=t.onPause)==null||w.call(t)}).then(()=>{var v;i=void 0,n||(v=t.onContinue)==null||v.call(t)}),y=()=>{if(n)return;let v;const w=r===0?t.initialPromise:void 0;try{v=w??t.fn()}catch(b){v=Promise.reject(b)}Promise.resolve(v).then(f).catch(b=>{var C;if(n)return;const _=t.retry??(f_?0:3),S=t.retryDelay??Gne,N=typeof S=="function"?S(r,b):S,j=_===!0||typeof _=="number"&&r<_||typeof _=="function"&&_(r,b);if(e||!j){p(b);return}r++,(C=t.onFail)==null||C.call(t,r,b),zne(N).then(()=>u()?void 0:m()).then(()=>{e?p(b):y()})})};return{promise:s,cancel:a,continue:()=>(i==null||i(),s),cancelRetry:o,continueRetry:c,canStart:d,start:()=>(d()?y():m().then(y),s)}}var Zne=t=>setTimeout(t,0);function Jne(){let t=[],e=0,r=o=>{o()},n=o=>{o()},i=Zne;const s=o=>{e?t.push(o):i(()=>{r(o)})},a=()=>{const o=t;t=[],o.length&&i(()=>{n(()=>{o.forEach(c=>{r(c)})})})};return{batch:o=>{let c;e++;try{c=o()}finally{e--,e||a()}return c},batchCalls:o=>(...c)=>{s(()=>{o(...c)})},schedule:s,setNotifyFunction:o=>{r=o},setBatchNotifyFunction:o=>{n=o},setScheduler:o=>{i=o}}}var ti=Jne(),Au,Zz,CU=(Zz=class{constructor(){Tt(this,Au)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Dne(this.gcTime)&&tt(this,Au,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(f_?1/0:5*60*1e3))}clearGcTimeout(){de(this,Au)&&(clearTimeout(de(this,Au)),tt(this,Au,void 0))}},Au=new WeakMap,Zz),ch,Pu,ps,Mu,$n,cy,Ru,ea,mo,Jz,Yne=(Jz=class extends CU{constructor(e){super();Tt(this,ea);Tt(this,ch);Tt(this,Pu);Tt(this,ps);Tt(this,Mu);Tt(this,$n);Tt(this,cy);Tt(this,Ru);tt(this,Ru,!1),tt(this,cy,e.defaultOptions),this.setOptions(e.options),this.observers=[],tt(this,Mu,e.client),tt(this,ps,de(this,Mu).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,tt(this,ch,Qne(this.options)),this.state=e.state??de(this,ch),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=de(this,$n))==null?void 0:e.promise}setOptions(e){this.options={...de(this,cy),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&de(this,ps).remove(this)}setData(e,r){const n=Une(this.state.data,e,this.options);return Mn(this,ea,mo).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e,r){Mn(this,ea,mo).call(this,{type:"setState",state:e,setStateOptions:r})}cancel(e){var n,i;const r=(n=de(this,$n))==null?void 0:n.promise;return(i=de(this,$n))==null||i.cancel(e),r?r.then(Xs).catch(Xs):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(de(this,ch))}isActive(){return this.observers.some(e=>Fne(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jP||this.state.dataUpdateCount+this.state.errorUpdate
40Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>hE(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Bne(this.state.dataUpdatedAt,e)}onFocus(){var r;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(r=de(this,$n))==null||r.continue()}onOnline(){var r;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(r=de(this,$n))==null||r.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),de(this,ps).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(de(this,$n)&&(de(this,Ru)?de(this,$n).cancel({revert:!0}):de(this,$n).cancelRetry()),this.scheduleGc()),de(this,ps).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Mn(this,ea,mo).call(this,{type:"invalidate"})}fetch(e,r){var u,d,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(de(this,$n))return de(this,$n).continueRetry(),de(this,$n).promise}if(e&&this.setOptions(e),!this.options.queryFn){const p=this.observers.find(m=>m.options.queryFn);p&&this.setOptions(p.options)}const n=new AbortController,i=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(tt(this,Ru,!0),n.signal)})},s=()=>{const p=_U(this.options,r),y=(()=>{const v={client:de(this,Mu),queryKey:this.queryKey,meta:this.meta};return i(v),v})();return tt(this,Ru,!1),this.options.persister?this.options.persister(p,y,this):p(y)},o=(()=>{const p={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:de(this,Mu),state:this.state,fetchFn:s};return i(p),p})();(u=this.options.behavior)==null||u.onFetch(o,this),tt(this,Pu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&Mn(this,ea,mo).call(this,{type:"fetch",meta:(f=o.fetchOptions)==null?void 0:f.meta});const c=p=>{var m,y,v,w;jj(p)&&p.silent||Mn(this,ea,mo).call(this,{type:"error",error:p}),jj(p)||((y=(m=de(this,ps).config).onError)==null||y.call(m,p,this),(w=(v=de(this,ps).config).onSettled)==null||w.call(v,this.state.data,p,this)),this.scheduleGc()};return tt(this,$n,NU({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:p=>{var m,y,v,w;if(p===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(b){c(b);return}(y=(m=de(this,ps).config).onSuccess)==null||y.call(m,p,this),(w=(v=de(this,ps).config).onSettled)==null||w.call(v,p,this.state.error,this),this.scheduleGc()},onError:c,onFail:(p,m)=>{Mn(this,ea,mo).call(this,{type:"failed",failureCount:p,error:m})},onPause:()=>{Mn(this,ea,mo).call(this,{type:"pause"})},onContinue:()=>{Mn(this,ea,mo).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),de(this,$n).start()}},ch=new WeakMap,Pu=new WeakMap,ps=new WeakMap,Mu=new WeakMap,$n=new WeakMap,cy=new WeakMap,Ru=new WeakMap,ea=new WeakSet,mo=function(e){const r=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Xne(n.data,this.options),fetchMeta:e.meta??null};case"success":return tt(this,Pu,void 0),{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return jj(i)&&i.revert&&de(this,Pu)?{...de(this,Pu),fetchStatus:"idle"}
vendor: 5,135 bytes, line 40
40:{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),ti.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),de(this,ps).notify({query:this,type:"updated",action:e})})},Jz);function Xne(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:SU(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Qne(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Aa,Yz,eie=(Yz=class extends d_{constructor(e={}){super();Tt(this,Aa);this.config=e,tt(this,Aa,new Map)}build(e,r,n){const i=r.queryKey,s=r.queryHash??SP(i,r);let a=this.get(s);return a||(a=new Yne({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(i)}),this.add(a)),a}add(e){de(this,Aa).has(e.queryHash)||(de(this,Aa).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=de(this,Aa).get(e.queryHash);r&&(e.destroy(),r===e&&de(this,Aa).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ti.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return de(this,Aa).get(e)}getAll(){return[...de(this,Aa).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(n=>KL(r,n))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(n=>KL(e,n)):r}notify(e){ti.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){ti.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ti.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Aa=new WeakMap,Yz),Pa,Xn,Iu,Ma,vl,Xz,tie=(Xz=class extends CU{constructor(e){super();Tt(this,Ma);Tt(this,Pa);Tt(this,Xn);Tt(this,Iu);this.mutationId=e.mutationId,tt(this,Xn,e.mutationCache),tt(this,Pa,[]),this.state=e.state||rie(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){de(this,Pa).includes(e)||(de(this,Pa).push(e),this.clearGcTimeout(),de(this,Xn).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){tt(this,Pa,de(this,Pa).filter(r=>r!==e)),this.scheduleGc(),de(this,Xn).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){de(this,Pa).length||(this.state.status==="pending"?this.scheduleGc():de(this,Xn).remove(this))}continue(){var e;return((e=de(this,Iu))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var s,a,o,c,u,d,f,p,m,y,v,w,b,_,S,N,j,C,O,P;const r=()=>{Mn(this,Ma,vl).call(this,{type:"continue"})};tt(this,Iu,NU({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(T,$)=>{Mn(this,Ma,vl).call(this,{type:"failed",failureCount:T,error:$})},onPause:()=>{Mn(this,Ma,vl).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>de(this,Xn).canRun(this)}));const n=this.state.status==="pending",i=!de(this,Iu).canStart();try{if(n)r();else{Mn(this,Ma,vl).call(this,{type:"pending",variables:e,isPaused:i}),await((a=(s=de(this,Xn).config).onMutate)==null?void 0:a.call(s,e,this));const $=await((c=(o=this.options).onMutate)==null?void 0:c.call(o,e));$!==this.state.context&&Mn(this,Ma,vl).call(this,{type:"pending",context:$,variables:e,isPaused:i})}const T=await de(this,Iu).start();return await((d=(u=de(this,Xn).config).onSuccess)==null?void 0:d.call(u,T,e,this.state.context,this)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,T,e,this.state.context)),await((y=(m=de(this,Xn).config).onSettled)==null?void 0:y.call(m,T,null,this.state.variables,this.state.context,this)),await((w=(v=this.options).onSettled)==null?void 0:w.call(v,T,null,e,this.state.context)),Mn(this,Ma,vl).call(this,{type:"success",data:T}),T}catch(T){try{throw await((_=(b=de(this,Xn).config).onError)==null?void 0:_.call(b,T,e,this.state.context,this)),await((N=(S=this.options).onError)==null?void 0:N.call(S,T,e,this.state.context)),await((C=(j=de(this,Xn).config).onSettled)==null?void 0:C.call(j,void 0,T,this.state.variables,this.state.context,this)),await((P=(O=this.options).onSettled)==null?void 0:P.call(O,void 0,T,e,this.state.context)),T}finally{Mn(this,Ma,vl).call(this,{type:"error",error:T})}}finally{de(this,Xn).runNext(this)}}},Pa=new WeakMap,Xn=new WeakMap,Iu=new WeakMap,Ma=new WeakSet,vl=function(e){const r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};
40case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),ti.batch(()=>{de(this,Pa).forEach(n=>{n.onMutationUpdate(e)}),de(this,Xn).notify({mutation:this,type:"updated",action:e})})},Xz);function rie(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ko,ta,uy,Qz,nie=(Qz=class extends d_{constructor(e={}){super();Tt(this,ko);Tt(this,ta);Tt(this,uy);this.config=e,tt(this,ko,new Set),tt(this,ta,new Map),tt(this,uy,0)}build(e,r,n){const i=new tie({mutationCache:this,mutationId:++fx(this,uy)._,options:e.defaultMutationOptions(r),state:n});return this.add(i),i}add(e){de(this,ko).add(e);const r=Ax(e);if(typeof r=="string"){const n=de(this,ta).get(r);n?n.push(e):de(this,ta).set(r,[e])}this.notify({type:"added",mutation:e})}remove(e){if(de(this,ko).delete(e)){const r=Ax(e);if(typeof r=="string"){const n=de(this,ta).get(r);if(n)if(n.length>1){const i=n.indexOf(e);i!==-1&&n.splice(i,1)}else n[0]===e&&de(this,ta).delete(r)}}this.notify({type:"removed",mutation:e})}canRun(e){const r=Ax(e);if(typeof r=="string"){const n=de(this,ta).get(r),i=n==null?void 0:n.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var n;const r=Ax(e);if(typeof r=="string"){const i=(n=de(this,ta).get(r))==null?void 0:n.find(s=>s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ti.batch(()=>{de(this,ko).forEach(e=>{this.notify({type:"removed",mutation:e})}),de(this,ko).clear(),de(this,ta).clear()})}getAll(){return Array.from(de(this,ko))}find(e){const r={exact:!0,...e};return this.getAll().find(n=>GL(r,n))}findAll(e={}){return this.getAll().filter(r=>GL(e,r))}notify(e){ti.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>
vendor: 6,941 bytes, lines 40-49
40r.state.isPaused);return ti.batch(()=>Promise.all(e.map(r=>r.continue().catch(Xs))))}},ko=new WeakMap,ta=new WeakMap,uy=new WeakMap,Qz);function Ax(t){var e;return(e=t.options.scope)==null?void 0:e.id}function YL(t){return{onFetch:(e,r)=>{var d,f,p,m,y;const n=e.options,i=(p=(f=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:p.direction,s=((m=e.state.data)==null?void 0:m.pages)||[],a=((y=e.state.data)==null?void 0:y.pageParams)||[];let o={pages:[],pageParams:[]},c=0;const u=async()=>{let v=!1;const w=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(e.signal.aborted?v=!0:e.signal.addEventListener("abort",()=>{v=!0}),e.signal)})},b=_U(e.options,e.fetchOptions),_=async(S,N,j)=>{if(v)return Promise.reject();if(N==null&&S.pages.length)return Promise.resolve(S);const O=(()=>{const B={client:e.client,queryKey:e.queryKey,pageParam:N,direction:j?"backward":"forward",meta:e.options.meta};return w(B),B})(),P=await b(O),{maxPages:T}=e.options,$=j?Vne:Hne;return{pages:$(S.pages,P,T),pageParams:$(S.pageParams,N,T)}};if(i&&s.length){const S=i==="backward",N=S?iie:XL,j={pages:s,pageParams:a},C=N(n,j);o=await _(j,C,S)}else{const S=t??s.length;do{const N=c===0?a[0]??n.initialPageParam:XL(n,o);if(c>0&&N==null)break;o=await _(o,N),c++}while(c<S)}return o};e.options.persister?e.fetchFn=()=>{var v,w;return(w=(v=e.options).persister)==null?void 0:w.call(v,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=u}}}function XL(t,{pages:e,pageParams:r}){const n=e.length-1;return e.length>0?t.getNextPageParam(e[n],e,r[n],r):void 0}function iie(t,{pages:e,pageParams:r}){var n;return e.length>0?(n=t.getPreviousPageParam)==null?void 0:n.call(t,e[0],e,r[0],r):void 0}var kr,Bl,Fl,uh,dh,zl,fh,hh,e8,sie=(e8=class{constructor(t={}){Tt(this,kr);Tt(this,Bl);Tt(this,Fl);Tt(this,uh);Tt(this,dh);Tt(this,zl);Tt(this,fh);Tt(this,hh);tt(this,kr,t.queryCache||new eie),tt(this,Bl,t.mutationCache||new nie),tt(this,Fl,t.defaultOptions||{}),tt(this,uh,new Map),tt(this,dh,new Map),tt(this,zl,0)}mount(){fx(this,zl)._++,de(this,zl)===1&&(tt(this,fh,kU.subscribe(async t=>{t&&(await this.resumePausedMutations(),de(this,kr).onFocus())})),tt(this,hh,k0.subscribe(async t=>{t&&(await this.resumePausedMutations(),de(this,kr).onOnline())})))}unmount(){var t,e;fx(this,zl)._--,de(this,zl)===0&&((t=de(this,fh))==null||t.call(this),tt(this,fh,void 0),(e=de(this,hh))==null||e.call(this),tt(this,hh,void 0))}isFetching(t){return de(this,kr).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return de(this,Bl).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=de(this,kr).get(e.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),r=de(this,kr).build(this,e),n=r.state.data;return n===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(hE(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(t){return de(this,kr).findAll(t).map(({queryKey:e,state:r})=>{const n=r.data;return[e,n]})}setQueryData(t,e,r){const n=this.defaultQueryOptions({queryKey:t}),i=de(this,kr).get(n.queryHash),s=i==null?void 0:i.state.data,a=$ne(e,s);if(a!==void 0)return de(this,kr).build(this,n).setData(a,{...r,manual:!0})}setQueriesData(t,e,r){return ti.batch(()=>de(this,kr).findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,r)]))}getQueryState(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=de(this,kr).get(e.queryHash))==null?void 0:r.state}removeQueries(t){const e=de(this,kr);ti.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=de(this,kr);return ti.batch(()=>(r.findAll(t).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const r={revert:!0,...e},n=ti.batch(()=>de(this,kr).findAll(t).map(i=>i.cancel(r)));return Promise.all(n).then(Xs).catch(Xs)}invalidateQueries(t,e={}){return ti.batch(()=>(de(this,kr).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const r={...e,cancelRefetch:e.cancelRefetch??!0},n=ti.batch(()=>de(this,kr).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(Xs)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(Xs)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=de(this,kr).build(this,e);return r.isStaleByTime(hE(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Xs).catch(Xs)}fetchInfiniteQuery(t){return t.behavior=YL(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Xs).catch(Xs)}ensureInfiniteQueryData(t){return t.behavior=YL(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return k0.isOnline()?de(this,Bl).resumePausedMutations():Promise.resolve()}getQueryCache(){return de(this,kr)}getMutationCache(){return de(this,Bl)}getDefaultOptions(){return de(this,Fl)}setDefaultOptions(t){tt(this,Fl,t)}setQueryDefaults(t,e){de(this,uh).set(Wg(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...de(this,uh).values()],r={};return e.forEach(n=>{qg(t,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(t,e){de(this,dh).set(Wg(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...de(this,dh).values()],r={};return e.forEach(n=>{qg(t,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...de(this,Fl).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=SP(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===jP&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...de(this,Fl).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){de(this,kr).clear(),de(this,Bl).clear()}},kr=new WeakMap,Bl=new WeakMap,Fl=new WeakMap,uh=new WeakMap,dh=new WeakMap,zl=new WeakMap,fh=new WeakMap,hh=new WeakMap,e8),aie=x.createContext(void 0),oie=({client:t,children:e})=>(x.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),l.jsx(aie.Provider,{value:t,children:e}));/**
41 * @remix-run/router v1.23.0
42 *
43 * Copyright (c) Remix Software Inc.
44 *
45 * This source code is licensed under the MIT license found in the
46 * LICENSE.md file in the root directory of this source tree.
47 *
48 * @license MIT
49 */function Kg(){return Kg=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];
vendor: 4,857 bytes, line 49
49for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Kg.apply(this,arguments)}var Vl;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(Vl||(Vl={}));const QL="popstate";function lie(t){t===void 0&&(t={});function e(n,i){let{pathname:s,search:a,hash:o}=n.location;return mE("",{pathname:s,search:a,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(n,i){return typeof i=="string"?i:S0(i)}return uie(e,r,null,t)}function vr(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function EU(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function cie(){return Math.random().toString(36).substr(2,8)}function e$(t,e){return{usr:t.state,key:t.key,idx:e}}function mE(t,e,r,n){return r===void 0&&(r=null),Kg({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?hp(e):e,{state:r,key:e&&e.key||n||cie()})}function S0(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function hp(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function uie(t,e,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:s=!1}=n,a=i.history,o=Vl.Pop,c=null,u=d();u==null&&(u=0,a.replaceState(Kg({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function f(){o=Vl.Pop;let w=d(),b=w==null?null:w-u;u=w,c&&c({action:o,location:v.location,delta:b})}function p(w,b){o=Vl.Push;let _=mE(v.location,w,b);u=d()+1;let S=e$(_,u),N=v.createHref(_);try{a.pushState(S,"",N)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;i.location.assign(N)}s&&c&&c({action:o,location:v.location,delta:1})}function m(w,b){o=Vl.Replace;let _=mE(v.location,w,b);u=d();let S=e$(_,u),N=v.createHref(_);a.replaceState(S,"",N),s&&c&&c({action:o,location:v.location,delta:0})}function y(w){let b=i.location.origin!=="null"?i.location.origin:i.location.href,_=typeof w=="string"?w:S0(w);return _=_.replace(/ $/,"%20"),vr(b,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,b)}let v={get action(){return o},get location(){return t(i,a)},listen(w){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(QL,f),c=w,()=>{i.removeEventListener(QL,f),c=null}},createHref(w){return e(i,w)},createURL:y,encodeLocation(w){let b=y(w);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:p,replace:m,go(w){return a.go(w)}};return v}var t$;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(t$||(t$={}));function die(t,e,r){return r===void 0&&(r="/"),fie(t,e,r,!1)}function fie(t,e,r,n){let i=typeof e=="string"?hp(e):e,s=wh(i.pathname||"/",r);if(s==null)return null;let a=OU(t);hie(a);let o=null;for(let c=0;o==null&&c<a.length;++c){let u=Sie(s);o=_ie(a[c],u,n)}return o}function OU(t,e,r,n){e===void 0&&(e=[]),r===void 0&&(r=[]),n===void 0&&(n="");let i=(s,a,o)=>{let c={relativePath:o===void 0?s.path||"":o,caseSensitive:s.caseSensitive===!0,childrenIndex:a,route:s};c.relativePath.startsWith("/")&&(vr(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=ic([n,c.relativePath]),d=r.concat(c);s.children&&s.children.length>0&&(vr(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),OU(s.children,e,d,u)),!(s.path==null&&!s.index)&&e.push({path:u,score:bie(u,s.index),routesMeta:d})};return t.forEach((s,a)=>{var o;if(s.path===""||!((o=s.path)!=null&&o.includes("?")))i(s,a);else for(let c of TU(s.path))i(s,a,c)}),e}function TU(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,i=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return i?[s,""]:[s];let a=TU(n.join("/")),o=[];return o.push(...a.map(c=>c===""?s:[s,c].join("/"))),i&&o.push(...a),o.map(c=>t.startsWith("/")&&c===""?"/":c)}function hie(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:wie(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const pie=/^:[\w-]+$/,mie=3,gie=2,vie=1,yie=10,xie=-2,r$=t=>t==="*";function bie(t,e){let r=t.split("/"),n=r.length;return r.some(r$)&&(n+=xie),e&&(n+=gie),r.filter(i=>!r$(i)).reduce((i,s)=>i+(pie.test(s)?mie:s===""?vie:yie),n)}function wie(t,e){return t.length===e.length&&t.slice(0,-1).every((n,i)=>n===e[i])?t[t.length-1]-e[e.length-1]:0}function _ie(t,e,r){let{routesMeta:n}=t,i={},s="/",a=[];for(let o=0;o<n.length;++o){let c=n[o],u=o===n.length-1,d=s==="/"?e:e.slice(s.length)||"/",f
vendor: 9,863 bytes, lines 49-58
49=j0({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),p=c.route;if(!f&&u&&r&&!n[n.length-1].route.index&&(f=j0({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!f)return null;Object.assign(i,f.params),a.push({params:i,pathname:ic([s,f.pathname]),pathnameBase:Eie(ic([s,f.pathnameBase])),route:p}),f.pathnameBase!=="/"&&(s=ic([s,f.pathnameBase]))}return a}function j0(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=kie(t.path,t.caseSensitive,t.end),i=e.match(r);if(!i)return null;let s=i[0],a=s.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:n.reduce((u,d,f)=>{let{paramName:p,isOptional:m}=d;if(p==="*"){let v=o[f]||"";a=s.slice(0,s.length-v.length).replace(/(.)\/+$/,"$1")}const y=o[f];return m&&!y?u[p]=void 0:u[p]=(y||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:a,pattern:t}}function kie(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),EU(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,c)=>(n.push({paramName:o,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function Sie(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return EU(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function wh(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function jie(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?hp(t):t;return{pathname:r?r.startsWith("/")?r:Nie(r,e):e,search:Oie(n),hash:Tie(i)}}function Nie(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function Nj(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Cie(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function NP(t,e){let r=Cie(t);return e?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function CP(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=hp(t):(i=Kg({},t),vr(!i.pathname||!i.pathname.includes("?"),Nj("?","pathname","search",i)),vr(!i.pathname||!i.pathname.includes("#"),Nj("#","pathname","hash",i)),vr(!i.search||!i.search.includes("#"),Nj("#","search","hash",i)));let s=t===""||i.pathname==="",a=s?"/":i.pathname,o;if(a==null)o=r;else{let f=e.length-1;if(!n&&a.startsWith("..")){let p=a.split("/");for(;p[0]==="..";)p.shift(),f-=1;i.pathname=p.join("/")}o=f>=0?e[f]:"/"}let c=jie(i,o),u=a&&a!=="/"&&a.endsWith("/"),d=(s||a===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const ic=t=>t.join("/").replace(/\/\/+/g,"/"),Eie=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),Oie=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Tie=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function Aie(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const AU=["post","put","patch","delete"];new Set(AU);const Pie=["get",...AU];new Set(Pie);/**
50 * React Router v6.30.1
51 *
52 * Copyright (c) Remix Software Inc.
53 *
54 * This source code is licensed under the MIT license found in the
55 * LICENSE.md file in the root directory of this source tree.
56 *
57 * @license MIT
58 */function Gg(){return Gg=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Gg.apply(this,arguments)}const h_=x.createContext(null),PU=x.createContext(null),Xo=x.createContext(null),p_=x.createContext(null),Xa=x.createContext({outlet:null,matches:[],isDataRoute:!1}),MU=x.createContext(null);function Mie(t,e){let{relative:r}=e===void 0?{}:e;pp()||vr(!1);let{basename:n,navigator:i}=x.useContext(Xo),{hash:s,pathname:a,search:o}=m_(t,{relative:r}),c=a;return n!=="/"&&(c=a==="/"?n:ic([n,a])),i.createHref({pathname:c,search:o,hash:s})}function pp(){return x.useContext(p_)!=null}function Oi(){return pp()||vr(!1),x.useContext(p_).location}function RU(t){x.useContext(Xo).static||x.useLayoutEffect(t)}function Ti(){let{isDataRoute:t}=x.useContext(Xa);return t?Gie():Rie()}function Rie(){pp()||vr(!1);let t=x.useContext(h_),{basename:e,future:r,navigator:n}=x.useContext(Xo),{matches:i}=x.useContext(Xa),{pathname:s}=Oi(),a=JSON.stringify(NP(i,r.v7_relativeSplatPath)),o=x.useRef(!1);return RU(()=>{o.current=!0}),x.useCallback(function(u,d){if(d===void 0&&(d={}),!o.current)return;if(typeof u=="number"){n.go(u);return}let f=CP(u,JSON.parse(a),s,d.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:ic([e,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[e,n,a,s,t])}const Iie=x.createContext(null);function Lie(t){let e=x.useContext(Xa).outlet;return e&&x.createElement(Iie.Provider,{value:t},e)}function gy(){let{matches:t}=x.useContext(Xa),e=t[t.length-1];return e?e.params:{}}function m_(t,e){let{relative:r}=e===void 0?{}:e,{future:n}=x.useContext(Xo),{matches:i}=x.useContext(Xa),{pathname:s}=Oi(),a=JSON.stringify(NP(i,n.v7_relativeSplatPath));return x.useMemo(()=>CP(t,JSON.parse(a),s,r==="path"),[t,a,s,r])}function $ie(t,e){return Die(t,e)}function Die(t,e,r,n){pp()||vr(!1);let{navigator:i}=x.useContext(Xo),{matches:s}=x.useContext(Xa),a=s[s.length-1],o=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let u=Oi(),d;if(e){var f;let w=typeof e=="string"?hp(e):e;c==="/"||(f=w.pathname)!=null&&f.startsWith(c)||vr(!1),d=w}else d=u;let p=d.pathname||"/",m=p;if(c!=="/"){let w=c.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(w.length).join("/")}let y=die(t,{pathname:m}),v=Hie(y&&y.map(w=>Object.assign({},w,{params:Object.assign({},o,w.params),pathname:ic([c,i.encodeLocation?i.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?c:ic([c,i.encodeLocation?i.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),s,r,n);return e&&v?x.createElement(p_.Provider,{value:{location:Gg({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Vl.Pop}},v):v}function Bie(){let t=Kie(),e=Aie(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},e),r?x.createElement("pre",{style:i},r):null,null)}const Fie=x.createElement(Bie,null);class zie extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?x.createElement(Xa.Provider,{value:this.props.routeContext},x.createElement(MU.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Uie(t){let{routeContext:e,match:r,children:n}=t,i=x.useContext(h_);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),x.createElement(Xa.Provider,{value:e},n)}function Hie(t,e,r,n){var i;if(e===void 0&&(e=[]),r===void 0&&(r=null),n===void 0&&(n=null),t==null){var s;if(!r)return null;if(r.errors)t=r.matches;else if((s=n)!=null&&s.v7_partialHydration&&e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let a=t,o=(i=r)==null?void 0:i.errors;if(o!=null){let d=a.findIndex(f=>f.route.id&&(o==null?void 0:o[f.route.id])!==void 0);d>=0||vr(!1),a=a.slice(0,Math.min(a.length,d+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d<a.length;d++){let f=a[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:p,errors:m}=r,y=f.route.loader&&p[f.route.id]===void 0&&(!m||m[f.route.id]===void 0);if(f.route.lazy||y){c=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((d,f,p)=>{let m,y=!1,v=null,w=null;r&&(m=o&&f.route.id?o[f.route.id]:void 0,v=f.route.errorElement||Fie,c&&(u<0&&p===0?(y=!0,w=null):u===p&&(y=!0,w=f.route.hydrateFallbackElement||null)));let b=e.concat(a.slice(0,p+1)),_=()=>{let S;return m?S=v:y?S=w:f.route.Component?S=x.createElement(f.route.Component,null):f.route.element?S=f.route.element:S=d,x.createElement(Uie,{match:f,routeContext:{outlet:d,matches:b,isDataRoute:r!=null},children:S})};return r&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?x.createElement(zie,{location:r.location,revalidation:r.revalidation,component:v,error:m,children:_(),routeC
58ontext:{outlet:null,matches:b,isDataRoute:!0}}):_()},null)}var IU=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(IU||{}),N0=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(N0||{});function Vie(t){let e=x.useContext(h_);return e||vr(!1),e}function Wie(t){let e=x.useContext(PU);return e||vr(!1),e}function qie(t){let e=x.useContext(Xa);return e||vr(!1),e}function LU(t){let e=qie(),r=e.matches[e.matches.length-1];return r.route.id||vr(!1),r.route.id}function Kie(){var t;let e=x.useContext(MU),r=Wie(N0.UseRouteError),n=LU(N0.UseRouteError);return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}function Gie(){let{router:t}=Vie(IU.UseNavigateStable),e=LU(N0.UseNavigateStable),r=x.useRef(!1);return RU(()=>{r.current=!0}),x.useCallback(function(i,s){s===void 0&&(s={}),r.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,Gg({fromRouteId:e},s)))},[t,e])}function Zie(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function Jie(t){let{to:e,replace:r,state:n,relative:i}=t;pp()||vr(!1);let{future:s,static:a}=x.useContext(Xo),{matches:o}=x.useContext(Xa),{pathname:c}=Oi(),u=Ti(),d=CP(e,NP(o,s.v7_relativeSplatPath),c,i==="path"),f=JSON.stringify(d);return x.useEffect(()=>u(JSON.parse(f),{replace:r,state:n,relative:i}),[u,f,i,r,n]),null}function $U(t){return Lie(t.context)}function Ke(t){vr(!1)}function Yie(t){let{basename:e="/",children:r=null,location:n,navigationType:i=Vl.Pop,navigator:s,static:a=!1,future:o}=t;pp()&&vr(!1);let c=e.replace(/^\/*/,"/"),u=x.useMemo(()=>({basename:c,navigator:s,static:a,future:Gg({v7_relativeSplatPath:!1},o)}),[c,o,s,a]);typeof n=="string"&&(n=hp(n));let{pathname:d="/",search:f="",hash:p="",state:m=null,key:y="default"}=n,v=x.useMemo(()=>{let w=wh(d,c);return w==null?null:{location:{pathname:w,search:f,hash:p,state:m,key:y},navigationType:i}},[c,d,f,p,m,y,i]);return v==null?null:x.createElement(Xo.Provider,{value:u},x.createElement(p_.Provider,{children:r,value:v}))}function Xie(t){let{children:e,location:r}=t;return $ie(gE(e),r)}new Promise(()=>{});function gE(t,e){e===void 0&&(e=[]);let r=[];return x.Children.forEach(t,(n,i)=>{if(!x.isValidElement(n))return;let s=[...e,i];if(n.type===x.Fragment){r.push.apply(r,gE(n.props.children,s));return}n.type!==Ke&&vr(!1),!n.props.index||!n.props.children||vr(!1);let a={id:n.props.id||s.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(a.children=gE(n.props.children,s)),r.push(a)}),r}/**
59 * React Router DOM v6.30.1
60 *
61 * Copyright (c) Remix Software Inc.
62 *
63 * This source code is licensed under the MIT license found in the
64 * LICENSE.md file in the root directory of this source tree.
65 *
66 * @license MIT
67 */function C0(){return C0=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},C0.apply(this,arguments)}function DU(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s<n.length;s++)i=n[s],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function Qie(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function ese(t,e){return t.button===0&&(!e||e==="_self")&&!Qie(t)}function vE(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,r)=>{let n=t[r];return e.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function tse(t,e){let r=vE(t);return e&&e.forEach((n,i)=>
67{r.has(i)||e.getAll(i).forEach(s=>{r.append(i,s)})}),r}const rse=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],nse=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],ise="6";try{window.__reactRouterVersion=ise}catch{}const sse=x.createContext({isTransitioning:!1}),ase="startTransition",n$=TA[ase];function ose(t){let{basename:e,children:r,future:n,window:i}=t,s=x.useRef();s.current==null&&(s.current=lie({window:i,v5Compat:!0}));let a=s.current,[o,c]=x.useState({action:a.action,location:a.location}),{v7_startTransition:u}=n||{},d=x.useCallback(f=>{u&&n$?n$(()=>c(f)):c(f)},[c,u]);return x.useLayoutEffect(()=>a.listen(d),[a,d]),x.useEffect(()=>Zie(n),[n]),x.createElement(Yie,{basename:e,children:r,location:o.location,navigationType:o.action,navigator:a,future:n})}const lse=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",cse=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Re=x.forwardRef(function(e,r){let{onClick:n,relative:i,reloadDocument:s,replace:a,state:o,target:c,to:u,preventScrollReset:d,viewTransition:f}=e,p=DU(e,rse),{basename:m}=x.useContext(Xo),y,v=!1;if(typeof u=="string"&&cse.test(u)&&(y=u,lse))try{let S=new URL(window.location.href),N=u.startsWith("//")?new URL(S.protocol+u):new URL(u),j=wh(N.pathname,m);N.origin===S.origin&&j!=null?u=j+N.search+N.hash:v=!0}catch{}let w=Mie(u,{relative:i}),b=fse(u,{replace:a,state:o,target:c,preventScrollReset:d,relative:i,viewTransition:f});function _(S){n&&n(S),S.defaultPrevented||b(S)}return x.createElement("a",C0({},p,{href:y||w,onClick:v||s?n:_,ref:r,target:c}))}),use=x.forwardRef(function(e,r){let{"aria-current":n="page",caseSensitive:i=!1,className:s="",end:a=!1,style:o,to:c,viewTransition:u,children:d}=e,f=DU(e,nse),p=m_(c,{relative:f.relative}),m=Oi(),y=x.useContext(PU),{navigator:v,basename:w}=x.useContext(Xo),b=y!=null&&pse(p)&&u===!0,_=v.encodeLocation?v.encodeLocation(p).pathname:p.pathname,S=m.pathname,N=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;i||(S=S.toLowerCase(),N=N?N.toLowerCase():null,_=_.toLowerCase()),N&&w&&(N=wh(N,w)||N);const j=_!=="/"&&_.endsWith("/")?_.length-1:_.length;let C=S===_||!a&&S.startsWith(_)&&S.charAt(j)==="/",O=N!=null&&(N===_||!a&&N.startsWith(_)&&N.charAt(_.length)==="/"),P={isActive:C,isPending:O,isTransitioning:b},T=C?n:void 0,$;typeof s=="function"?$=s(P):$=[s,C?"active":null,O?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let B=typeof o=="function"?o(P):o;return x.createElement(Re,C0({},f,{"aria-current":T,className:$,ref:r,style:B,to:c,viewTransition:u}),typeof d=="function"?d(P):d)});var yE;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(yE||(yE={}));var i$;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(i$||(i$={}));function dse(t){let e=x.useContext(h_);return e||vr(!1),e}function fse(t,e){let{target:r,replace:n,state:i,preventScrollReset:s,relative:a,viewTransition:o}=e===void 0?{}:e,c=Ti(),u=Oi(),d=m_(t,{relative:a});return x.useCallback(f=>{if(ese(f,r)){f.preventDefault();let p=n!==void 0?n:S0(u)===S0(d);c(t,{replace:p,state:i,preventScrollReset:s,relative:a,viewTransition:o})}},[u,c,d,n,i,r,t,s,a,o])}function hse(t){let e=x.useRef(vE(t)),r=x.useRef(!1),n=Oi(),i=x.useMemo(()=>tse(n.search,r.current?null:e.current),[n.search]),s=Ti(),a=x.useCallback((o,c)=>{const u=vE(typeof o=="function"?o(i):o);r.current=!0,s("?"+u,c)},[s,i]);return[i,a]}function pse(t,e){e===void 0&&(e={});let r=x.useContext(sse);r==null&&vr(!1);let{basename:n}=dse(yE.useViewTransitionState),i=m_(t,{relative:e.relative});if(!r.isTransitioning)return!1;let s=wh(r.currentLocation.pathname,n)||r.currentLocation.pathname,a=wh(r.nextLocation.pathname,n)||r.nextLocation.pathname;return j0(i.pathname,a)!=null||j0(i.pathname,s)!=null}var s$=["light","dark"],mse="(prefers-color-scheme: dark)",gse=x.createContext(void 0),vse={setTheme:t=>{},themes:[]},yse=()=>{var t;return(t=x.useContext(gse))!=null?t:vse};x.memo(({forcedTheme:t,storageKey:e,attribute:r,enableSystem:n,enableColorScheme:i,defaultTheme:s,value:a,attrs:o,nonce:c})=>{let u=s==="system",d=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${o.map(y=>`'${y}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,f=i?s$.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",p=(y,v=!1,w=!0)=>{let b=a?a[y]:y,_=v?y+"|| ''":`'${b}'`,S="";return i&&w&&!v&&s$.includes(y)&&(S+=`d.style.colorScheme = '${y}';`),r==="class"?v||b?S+=`c.add(${_})`:S+="null":b&&(S+=`d[s](n,${_})`),S},m=t?`!function(){${d}${p(t)}}()`:n?`!function(){try{${d}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${u})){var t='${mse}',m=window.matchMedia(t);if(m.media!==t||m.matches){${p("dark")}}else{${p("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${p(a?"x[e]":"e",!0)}}${u?"":"else{"+p(s,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${e}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${p(a?"x[e]":"e",!0)}}else{${p(s,!1,!1)};}${f}}catch(t){}}();`;return x.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:m}})});var xse=t=>{switch(t){case"success":return _se;case"info":return Sse;case"warning":return kse;case"error":return jse;default:return null}},bse=Array(12).fill(0),wse=({visible:t,className:e})=>D.createElement("div",{className:["sonner-loading-wrapper",e].filter(
67Boolean).join(" "),"data-visible":t},D.createElement("div",{className:"sonner-spinner"},bse.map((r,n)=>D.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),_se=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},D.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"})),kse=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},D.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"})),Sse=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},D.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"})),jse=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},D.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"})),Nse=D.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"},D.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),D.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Cse=()=>{let[t,e]=D.useState(document.hidden);return D.useEffect(()=>{let r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t},xE=1,Ese=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:r,...n}=t,i=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:xE++,s=this.toasts.find(o=>o.id===i),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),s?this.toasts=this.toasts.map(o=>o.id===i?(this.publish({...o,...t,id:i,title:r}),{...o,...t,id:i,dismissible:a,title:r}):o):this.addToast({title:r,...n,dismissible:a,id:i}),i},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(r=>r({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let r;e.loading!==void 0&&(r=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let n=t instanceof Promise?t:t(),i=r!==void 0,s,a=n.then(async c=>{if(s=["resolve",c],D.isValidElement(c))i=!1,this.create({id:r,type:"default",message:c});else if(Tse(c)&&!c.ok){i=!1;let u=typeof e.error=="function"?await e.error(`HTTP error! status: ${c.status}`):e.error,d=typeof e.description=="function"?await e.description(`HTTP error! status: ${c.status}`):e.description;this.create({id:r,type:"error",message:u,description:d})}else if(e.success!==void 0){i=!1;let u=typeof e.success=="function"?await e.success(c):e.success,d=typeof e.description=="function"?await e.description(c):e.description;this.create({id:r,type:"success",message:u,description:d})}}).catch(async c=>{if(s=["reject",c],e.error!==void 0){i=!1;let u=typeof e.error=="function"?await e.error(c):e.error,d=typeof e.description=="function"?await e.description(c):e.description;this.create({id:r,type:"error",message:u,description:d})}}).finally(()=>{var c;i&&(this.dismiss(r),r=void 0),(c=e.finally)==null||c.call(e)}),o=()=>new Promise((c,u)=>a.then(()=>s[0]==="reject"?u(s[1]):c(s[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:o}:Object.assign(r,{unwrap:o})},this.custom=(t,e)=>{let r=(e==null?void 0:e.id)||xE++;return this.create({jsx:t(r),id:r,...e}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},yi=new Ese,Ose=(t,e)=>{let r=(e==null?void 0:e.id)||xE++;return yi.addToast({title:t,...e,id:r}),r},Tse=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",Ase=Ose,Pse=()=>yi.toasts,Mse=()=>yi.getActiveToasts(),ke=Object.assign(Ase,{success:yi.success,info:yi.info,warning:yi.warning,error:yi.error,custom:yi.custom,message:yi.message,promise:yi.promise,dismiss:yi.dismiss,loading:yi.loading},{getHistory:Pse,getToasts:Mse});function Rse(t,{insertAt:e}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}Rse(`: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;
67left: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}
67: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%);
67--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%)}
68`);function Px(t){return t.label!==void 0}var Ise=3,Lse="32px",$se="16px",a$=4e3,Dse=356,Bse=14,Fse=20,zse=200;function Ks(...t){return t.filter(Boolean).join(" ")}function Use(t){let[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}var Hse=t=>{var e,r,n,i,s,a,o,c,u,d,f;let{invert:p,toast:m,unstyled:y,interacting:v,setHeights:w,visibleToasts:b,heights:_,index:S,toasts:N,expanded:j,removeToast:C,defaultRichColors:O,closeButton:P,style:T,cancelButtonStyle:$,actionButtonStyle:B,className:R="",descriptionClassName:M="",duration:F,position:q,gap:V,loadingIcon:W,expandByDefault:z,classNames:H,icons:G,closeButtonAriaLabel:Y="Close toast",pauseWhenPageIsHidden:U}
vendor: 4,506 bytes, line 68
68=t,[J,te]=D.useState(null),[re,ae]=D.useState(null),[oe,_e]=D.useState(!1),[ne,ue]=D.useState(!1),[be,Q]=D.useState(!1),[He,Ie]=D.useState(!1),[ft,ot]=D.useState(!1),[yt,Bt]=D.useState(0),[Or,xr]=D.useState(0),ar=D.useRef(m.duration||F||a$),fr=D.useRef(null),qr=D.useRef(null),Us=S===0,Z=S+1<=b,Le=m.type,ht=m.dismissible!==!1,Qt=m.className||"",Ft=m.descriptionClassName||"",Kr=D.useMemo(()=>_.findIndex(Fe=>Fe.toastId===m.id)||0,[_,m.id]),pi=D.useMemo(()=>{var Fe;return(Fe=m.closeButton)!=null?Fe:P},[m.closeButton,P]),xa=D.useMemo(()=>m.duration||F||a$,[m.duration,F]),zt=D.useRef(0),Zn=D.useRef(0),rs=D.useRef(0),mi=D.useRef(null),[ns,Od]=q.split("-"),Td=D.useMemo(()=>_.reduce((Fe,et,lt)=>lt>=Kr?Fe:Fe+et.height,0),[_,Kr]),qc=Cse(),Ad=m.invert||p,hr=Le==="loading";Zn.current=D.useMemo(()=>Kr*V+Td,[Kr,Td]),D.useEffect(()=>{ar.current=xa},[xa]),D.useEffect(()=>{_e(!0)},[]),D.useEffect(()=>{let Fe=qr.current;if(Fe){let et=Fe.getBoundingClientRect().height;return xr(et),w(lt=>[{toastId:m.id,height:et,position:m.position},...lt]),()=>w(lt=>lt.filter(lr=>lr.toastId!==m.id))}},[w,m.id]),D.useLayoutEffect(()=>{if(!oe)return;let Fe=qr.current,et=Fe.style.height;Fe.style.height="auto";let lt=Fe.getBoundingClientRect().height;Fe.style.height=et,xr(lt),w(lr=>lr.find(br=>br.toastId===m.id)?lr.map(br=>br.toastId===m.id?{...br,height:lt}:br):[{toastId:m.id,height:lt,position:m.position},...lr])},[oe,m.title,m.description,w,m.id]);let or=D.useCallback(()=>{ue(!0),Bt(Zn.current),w(Fe=>Fe.filter(et=>et.toastId!==m.id)),setTimeout(()=>{C(m)},zse)},[m,C,w,Zn]);D.useEffect(()=>{if(m.promise&&Le==="loading"||m.duration===1/0||m.type==="loading")return;let Fe;return j||v||U&&qc?(()=>{if(rs.current<zt.current){let et=new Date().getTime()-zt.current;ar.current=ar.current-et}rs.current=new Date().getTime()})():ar.current!==1/0&&(zt.current=new Date().getTime(),Fe=setTimeout(()=>{var et;(et=m.onAutoClose)==null||et.call(m,m),or()},ar.current)),()=>clearTimeout(Fe)},[j,v,m,Le,U,qc,or]),D.useEffect(()=>{m.delete&&or()},[or,m.delete]);function yn(){var Fe,et,lt;return G!=null&&G.loading?D.createElement("div",{className:Ks(H==null?void 0:H.loader,(Fe=m==null?void 0:m.classNames)==null?void 0:Fe.loader,"sonner-loader"),"data-visible":Le==="loading"},G.loading):W?D.createElement("div",{className:Ks(H==null?void 0:H.loader,(et=m==null?void 0:m.classNames)==null?void 0:et.loader,"sonner-loader"),"data-visible":Le==="loading"},W):D.createElement(wse,{className:Ks(H==null?void 0:H.loader,(lt=m==null?void 0:m.classNames)==null?void 0:lt.loader),visible:Le==="loading"})}return D.createElement("li",{tabIndex:0,ref:qr,className:Ks(R,Qt,H==null?void 0:H.toast,(e=m==null?void 0:m.classNames)==null?void 0:e.toast,H==null?void 0:H.default,H==null?void 0:H[Le],(r=m==null?void 0:m.classNames)==null?void 0:r[Le]),"data-sonner-toast":"","data-rich-colors":(n=m.richColors)!=null?n:O,"data-styled":!(m.jsx||m.unstyled||y),"data-mounted":oe,"data-promise":!!m.promise,"data-swiped":ft,"data-removed":ne,"data-visible":Z,"data-y-position":ns,"data-x-position":Od,"data-index":S,"data-front":Us,"data-swiping":be,"data-dismissible":ht,"data-type":Le,"data-invert":Ad,"data-swipe-out":He,"data-swipe-direction":re,"data-expanded":!!(j||z&&oe),style:{"--index":S,"--toasts-before":S,"--z-index":N.length-S,"--offset":`${ne?yt:Zn.current}px`,"--initial-height":z?"auto":`${Or}px`,...T,...m.style},onDragEnd:()=>{Q(!1),te(null),mi.current=null},onPointerDown:Fe=>{hr||!ht||(fr.current=new Date,Bt(Zn.current),Fe.target.setPointerCapture(Fe.pointerId),Fe.target.tagName!=="BUTTON"&&(Q(!0),mi.current={x:Fe.clientX,y:Fe.clientY}))},onPointerUp:()=>{var Fe,et,lt,lr;if(He||!ht)return;mi.current=null;let br=Number(((Fe=qr.current)==null?void 0:Fe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),$t=Number(((et=qr.current)==null?void 0:et.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),nn=new Date().getTime()-((lt=fr.current)==null?void 0:lt.getTime()),cr=J==="x"?br:$t,Rr=Math.abs(cr)/nn;if(Math.abs(cr)>=Fse||Rr>.11){Bt(Zn.current),(lr=m.onDismiss)==null||lr.call(m,m),ae(J==="x"?br>0?"right":"left":$t>0?"down":"up"),or(),Ie(!0),ot(!1);return}Q(!1),te(null)},onPointerMove:Fe=>{var et,lt,lr,br;if(!mi.current||!ht||((et=window.getSelection())==null?void 0:et.toString().length)>0)return;let $t=Fe.clientY-mi.current.y,nn=Fe.clientX-mi.current.x,cr=(lt=t.swipeDirections)!=null?lt:Use(q);!J&&(Math.abs(nn)>1||Math.abs($t)>1)&&te(Math.abs(nn)>Math.abs($t)?"x":"y");let Rr={x:0,y:0};
68J==="y"?(cr.includes("top")||cr.includes("bottom"))&&(cr.includes("top")&&$t<0||cr.includes("bottom")&&$t>0)&&(Rr.y=$t):J==="x"&&(cr.includes("left")||cr.includes("right"))&&(cr.includes("left")&&nn<0||cr.includes("right")&&nn>0)&&(Rr.x=nn),(Math.abs(Rr.x)>0||Math.abs(Rr.y)>0)&&ot(!0),(lr=qr.current)==null||lr.style.setProperty("--swipe-amount-x",`${Rr.x}px`),(br=qr.current)==null||br.style.setProperty("--swipe-amount-y",`${Rr.y}px`)}},pi&&!m.jsx?D.createElement("button",{"aria-label":Y,"data-disabled":hr,"data-close-button":!0,onClick:hr||!ht?()=>{}:()=>{var Fe;or(),(Fe=m.onDismiss)==null||Fe.call(m,m)},className:Ks(H==null?void 0:H.closeButton,(i=m==null?void 0:m.classNames)==null?void 0:i.closeButton)},(s=G==null?void 0:G.close)!=null?s:Nse):null,m.jsx||x.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:D.createElement(D.Fragment,null,Le||m.icon||m.promise?D.createElement("div",{"data-icon":"",className:Ks(H==null?void 0:H.icon,(a=m==null?void 0:m.classNames)==null?void 0:a.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||yn():null,m.type!=="loading"?m.
vendor: 4,752 bytes, line 68
68icon||(G==null?void 0:G[Le])||xse(Le):null):null,D.createElement("div",{"data-content":"",className:Ks(H==null?void 0:H.content,(o=m==null?void 0:m.classNames)==null?void 0:o.content)},D.createElement("div",{"data-title":"",className:Ks(H==null?void 0:H.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?D.createElement("div",{"data-description":"",className:Ks(M,Ft,H==null?void 0:H.description,(u=m==null?void 0:m.classNames)==null?void 0:u.description)},typeof m.description=="function"?m.description():m.description):null),x.isValidElement(m.cancel)?m.cancel:m.cancel&&Px(m.cancel)?D.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||$,onClick:Fe=>{var et,lt;Px(m.cancel)&&ht&&((lt=(et=m.cancel).onClick)==null||lt.call(et,Fe),or())},className:Ks(H==null?void 0:H.cancelButton,(d=m==null?void 0:m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,x.isValidElement(m.action)?m.action:m.action&&Px(m.action)?D.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||B,onClick:Fe=>{var et,lt;Px(m.action)&&((lt=(et=m.action).onClick)==null||lt.call(et,Fe),!Fe.defaultPrevented&&or())},className:Ks(H==null?void 0:H.actionButton,(f=m==null?void 0:m.classNames)==null?void 0:f.actionButton)},m.action.label):null))};function o$(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function Vse(t,e){let r={};return[t,e].forEach((n,i)=>{let s=i===1,a=s?"--mobile-offset":"--offset",o=s?$se:Lse;function c(u){["top","right","bottom","left"].forEach(d=>{r[`${a}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${a}-${u}`]=o:r[`${a}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(o)}),r}var Wse=x.forwardRef(function(t,e){let{invert:r,position:n="bottom-right",hotkey:i=["altKey","KeyT"],expand:s,closeButton:a,className:o,offset:c,mobileOffset:u,theme:d="light",richColors:f,duration:p,style:m,visibleToasts:y=Ise,toastOptions:v,dir:w=o$(),gap:b=Bse,loadingIcon:_,icons:S,containerAriaLabel:N="Notifications",pauseWhenPageIsHidden:j}=t,[C,O]=D.useState([]),P=D.useMemo(()=>Array.from(new Set([n].concat(C.filter(U=>U.position).map(U=>U.position)))),[C,n]),[T,$]=D.useState([]),[B,R]=D.useState(!1),[M,F]=D.useState(!1),[q,V]=D.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=D.useRef(null),z=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),H=D.useRef(null),G=D.useRef(!1),Y=D.useCallback(U=>{O(J=>{var te;return(te=J.find(re=>re.id===U.id))!=null&&te.delete||yi.dismiss(U.id),J.filter(({id:re})=>re!==U.id)})},[]);return D.useEffect(()=>yi.subscribe(U=>{if(U.dismiss){O(J=>J.map(te=>te.id===U.id?{...te,delete:!0}:te));return}setTimeout(()=>{wP.flushSync(()=>{O(J=>{let te=J.findIndex(re=>re.id===U.id);return te!==-1?[...J.slice(0,te),{...J[te],...U},...J.slice(te+1)]:[U,...J]})})})}),[]),D.useEffect(()=>{if(d!=="system"){V(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?V("dark"):V("light")),typeof window>"u")return;let U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:J})=>{V(J?"dark":"light")})}catch{U.addListener(({matches:te})=>{try{V(te?"dark":"light")}catch(re){console.error(re)}})}},[d]),D.useEffect(()=>{C.length<=1&&R(!1)},[C]),D.useEffect(()=>{let U=J=>{var te,re;i.every(ae=>J[ae]||J.code===ae)&&(R(!0),(te=W.current)==null||te.focus()),J.code==="Escape"&&(document.activeElement===W.current||(re=W.current)!=null&&re.contains(document.activeElement))&&R(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[i]),D.useEffect(()=>{if(W.current)return()=>{H.current&&(H.current.focus({preventScroll:!0}),H.current=null,G.current=!1)}},[W.current]),D.createElement("section",{ref:e,"aria-label":`${N} ${z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((U,J)=>{var te;let[re,ae]=U.split("-");return C.length?D.createElement("ol",{key:U,dir:w==="auto"?o$():w,tabIndex:-1,ref:W,className:o,"data-sonner-toaster":!0,"data-theme":q,"data-y-position":re,"data-lifted":B&&C.length>1&&!s,"data-x-position":ae,style:{"--front-toast-height":`${((te=T[0])==null?void 0:te.height)||0}px`,"--width":`${Dse}px`,"--gap":`${b}px`,...m,...Vse(c,u)},onBlur:oe=>{G.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(G.current=!1,H.
68current&&(H.current.focus({preventScroll:!0}),H.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||G.current||(G.current=!0,H.current=oe.relatedTarget)},onMouseEnter:()=>R(!0),onMouseMove:()=>R(!0),onMouseLeave:()=>{M||R(!1)},onDragEnd:()=>R(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||F(!0)},onPointerUp:()=>F(!1)},C.filter(oe=>!oe.position&&J===0||oe.position===U).map((oe,_e)=>{var ne,ue;return D.createElement(Hse,{key:oe.id,icons:S,index:_e,toast:oe,defaultRichColors:f,duration:(ne=v==null?void 0:v.duration)!=null?ne:p,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:r,visibleToasts:y,closeButton:(ue=v==null?void 0:v.closeButton)!=null?ue:a,interacting:M,position:U,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:Y,toasts:C.filter(be=>be.position==oe.position),heights:T.filter(be=>be.position==oe.position),setHeights:$,expandByDefault:s,gap:b,loadingIcon:_,expanded:B,pauseWhenPageIsHidden:j,swipeDirections:t.swipeDirections})})):null}))});const qse=({...t})=>{const{theme:e="system"}=yse();return l.jsx(Wse,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})},Kse=1,Gse=1e6;let Cj=0;function Zse(){return Cj=(Cj+1)%Number.MAX_SAFE_INTEGER,Cj.toString()}const Ej=new Map,l$=t=>{if(Ej.has(t))return;const e=setTimeout(()=>{Ej.delete(t),rg({type:"REMOVE_TOAST",toastId:t})},Gse);Ej.set(t,e)},Jse=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,Kse)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(r=>r.id===e.toast.id?{...r,...e.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=e;return r?l$(r):t.toasts.forEach(n=>{l$(n.id)}),{...t,toasts:t.toasts.map(n=>
vendor: 10,116 bytes, line 68
68n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(r=>r.id!==e.toastId)}}},Db=[];let Bb={toasts:[]};function rg(t){Bb=Jse(Bb,t),Db.forEach(e=>{e(Bb)})}function nt({...t}){const e=Zse(),r=i=>rg({type:"UPDATE_TOAST",toast:{...i,id:e}}),n=()=>rg({type:"DISMISS_TOAST",toastId:e});return rg({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:i=>{i||n()}}}),{id:e,dismiss:n,update:r}}function Qo(){const[t,e]=x.useState(Bb);return x.useEffect(()=>(Db.push(e),()=>{const r=Db.indexOf(e);r>-1&&Db.splice(r,1)}),[t]),{...t,toast:nt,dismiss:r=>rg({type:"DISMISS_TOAST",toastId:r})}}function we(t,e,{checkForDefaultPrevented:r=!0}={}){return function(i){if(t==null||t(i),r===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function c$(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Fo(...t){return e=>{let r=!1;const n=t.map(i=>{const s=c$(i,e);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let i=0;i<n.length;i++){const s=n[i];typeof s=="function"?s():c$(t[i],null)}}}}function it(...t){return x.useCallback(Fo(...t),t)}function Yse(t,e){const r=x.createContext(e),n=s=>{const{children:a,...o}=s,c=x.useMemo(()=>o,Object.values(o));return l.jsx(r.Provider,{value:c,children:a})};n.displayName=t+"Provider";function i(s){const a=x.useContext(r);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[n,i]}function Kn(t,e=[]){let r=[];function n(s,a){const o=x.createContext(a),c=r.length;r=[...r,a];const u=f=>{var b;const{scope:p,children:m,...y}=f,v=((b=p==null?void 0:p[t])==null?void 0:b[c])||o,w=x.useMemo(()=>y,Object.values(y));return l.jsx(v.Provider,{value:w,children:m})};u.displayName=s+"Provider";function d(f,p){var v;const m=((v=p==null?void 0:p[t])==null?void 0:v[c])||o,y=x.useContext(m);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const i=()=>{const s=r.map(a=>x.createContext(a));return function(o){const c=(o==null?void 0:o[t])||s;return x.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return i.scopeName=t,[n,Xse(i,...e)]}function Xse(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const a=n.reduce((o,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...o,...f}},{});return x.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return r.scopeName=e.scopeName,r}function gc(t){const e=Qse(t),r=x.forwardRef((n,i)=>{const{children:s,...a}=n,o=x.Children.toArray(s),c=o.find(eae);if(c){const u=c.props.children,d=o.map(f=>f===c?x.Children.count(u)>1?x.Children.only(null):x.isValidElement(u)?u.props.children:null:f);return l.jsx(e,{...a,ref:i,children:x.isValidElement(u)?x.cloneElement(u,void 0,d):null})}return l.jsx(e,{...a,ref:i,children:s})});return r.displayName=`${t}.Slot`,r}var gd=gc("Slot");function Qse(t){const e=x.forwardRef((r,n)=>{const{children:i,...s}=r;if(x.isValidElement(i)){const a=rae(i),o=tae(s,i.props);return i.type!==x.Fragment&&(o.ref=n?Fo(n,a):a),x.cloneElement(i,o)}return x.Children.count(i)>1?x.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var BU=Symbol("radix.slottable");function FU(t){const e=({children:r})=>l.jsx(l.Fragment,{children:r});return e.displayName=`${t}.Slottable`,e.__radixId=BU,e}function eae(t){return x.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===BU}function tae(t,e){const r={...e};for(const n in e){const i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...o)=>{const c=s(...o);return i(...o),c}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}function rae(t){var n,i;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}function vy(t){const e=t+"CollectionProvider",[r,n]=Kn(e),[i,s]=r(e,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:w,children:b}=v,_=D.useRef(null),S=D.useRef(new Map).current;return l.jsx(i,{scope:w,itemMap:S,collectionRef:_,children:b})};a.displayName=e;const o=t+"CollectionSlot",c=gc(o),u=D.forwardRef((v,w)=>{const{scope:b,children:_}=v,S=s(o,b),N=it(w,S.collectionRef);return l.jsx(c,{ref:N,children:_})});u.displayName=o;const d=t+"CollectionItemSlot",f="data-radix-collection-item",p=gc(d),m=D.forwardRef((v,w)=>{const{scope:b,children:_,...S}=v,N=D.useRef(null),j=it(w,N),C=s(d,b);return D.useEffect(()=>(C.itemMap.set(N,{ref:N,...S}),()=>void C.itemMap.delete(N))),l.jsx(p,{[f]:"",ref:j,children:_})});m.displayName=d;function y(v){const w=s(t+"CollectionConsumer",v);return D.useCallback(()=>{const _=w.collectionRef.current;if(!_)return[];const S=Array.from(_.querySelectorAll(`[${f}]`));return Array.from(w.itemMap.values()).sort((C,O)=>S.indexOf(C.ref.current)-S.indexOf(O.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:a,Slot:u,ItemSlot:m},y,n]}var nae=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Oe=nae.reduce((t,e)=>{const r=gc(`Primitive.${e}`),n=x.forwardRef((i,s)=>{const{asChild:a,...o}=i,c=a?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...o,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function EP(t,e){t&&Vi.flushSync(()=>t.dispatchEvent(e))}function Ci(t){const e=x.useRef(t);return x.useEffect(()=>{e.current=t}),x.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}function iae(t,e=globalThis==null?void 0:globalThis.document){const r=Ci(t);x.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var sae="DismissableLayer",bE="dismissableLayer.update",aae="dismissableLayer.pointerDownOutside",oae="dismissableLayer.focusOutside",u$,zU=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vd=x.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:o,...c}=t,u=x.useContext(zU),[d,f]=x.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=x.useState({}),y=it(e,O=>f(O)),v=Array.from(u.layers),[w]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(w),_=d?v.indexOf(d):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,N=_>=b,j=cae(O=>{const P=O.target,T=[...u.branches].some($=>$.contains(P));!N||T||(i==null||i(O),a==null||a(O),O.defaultPrevented||o==null||o())},p),C=uae(O=>{const P=O.target;[...u.branches].some($=>$.contains(P))||(s==null||s(O),a==null||a(O),O.defaultPrevented||o==null||o())},p);return iae(O=>{_===u.layers.size-1&&(n==null||n(O),!O.defaultPrevented&&o&&(O.preventDefault(),o()))},p),x.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(u$=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),d$(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=u$)}},[d,p,r,u]),x.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),d$())},[d,u]),x.useEffect(()=>{const O=()=>m({});return document.addEventListener(bE,O),()=>document.removeEventListener(bE,O)},[]),l.jsx(Oe.div,{...c,ref:y,style:{pointerEvents:S?N?"auto":"none":void 0,...t.style},onFocusCapture:we(t.onFocusCapture,C.onFocusCapture),onBlurCapture:we(t.onBlurCapture,C.onBlurCapture),onPointerDownCapture:we(t.onPointerDownCapture,j.onPointerDownCapture)})});vd.displayName=sae;var lae="DismissableLayerBranch",UU=x.forwardRef((t,e)=>{const r=x.useContext(zU),n=x.useRef(null),i=it(e,n);return x.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),l.jsx(Oe.div,{...t,ref:i})});UU.displayName=lae;function cae(t,e=globalThis==null?void 0:globalThis.document){const r=Ci(t),n=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const s=o=>{if(o.target&&!n.current){let c=function(){HU(aae,r,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);n.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function uae(t,e=globalThis==null?void 0:globalThis.document){const r=Ci(t),n=x.useRef(!1);return x.useEffect(()=>{const i=s=>{s.target&&!n.current&&HU(oae,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function d$(){const t=new CustomEvent(bE);document.dispatchEvent(t)}function HU(t,e,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?EP(i,s):i.dispatchEvent(s)}var dae=vd,fae=UU,hn=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},hae="Portal",mp=x.forwardRef((t,e)=>{var o;const{container:r,...n}=t,[i,s]=x.useState(!1);hn(()=>s(!0),[]);const a=r||i&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?wP.createPortal(l.jsx(Oe.div,{...n,ref:e}),a):null});mp.displayName=hae;function pae(t,e){return x.useReducer((r,n)=>e[r][n]??r,t)}var di=t=>{const{present:e,children:r}=t,n=mae(e),i=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),s=it(n.ref,gae(i));return typeof r=="function"||n.isPresent?x.cloneElement(i,{ref:s}):null};di.displayName="Presence";
68function mae(t){const[e,r]=x.useState(),n=x.useRef(null),i=x.useRef(t),s=x.useRef("none"),a=t?"mounted":"unmounted",[o,c]=pae(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const u=Mx(n.current);s.current=o==="mounted"?u:"none"},[o]),hn(()=>{const u=n.current,d=i.current;if(d!==t){const p=s.current,m=Mx(u);t?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),hn(()=>{if(e){let u;const d=e.ownerDocument.defaultView??window,f=m=>{const v=Mx(n.current).includes(m.animationName);if(m.target===e&&v&&(c("ANIMATION_END"),!i.current)){const w=e.style.animationFillMode;e.style.animationFillMode="forwards",u=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=w)})}},p=m=>{m.target===e&&(s.current=Mx(n.current))};return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",f),e.addEventListener("animationend",f),()=>{d.clearTimeout(u),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",f),e.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:x.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function Mx(t){return(t==null?void 0:t.animationName)||"none"}function gae(t){var n,i;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var vae=TA[" useInsertionEffect ".trim().toString()]||hn;function Yi({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[i,s,a]=yae({defaultProp:e,onChange:r}),o=t!==void 0,c=o?t:i;{const d=x.useRef(t!==void 0);x.useEffect(()=>{const f=d.current;f!==o&&console.warn(`${n} is changing from ${f?"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,n])}const u=x.useCallback(d=>{var f;if(o){const p=xae(d)?d(t):d;p!==t&&((f=a.current)==null||f.call(a,p))}else s(d)},[o,t,s,a]);return[c,u]}function yae({defaultProp:t,onChange:e}){const[r,n]=x.useState(t),i=x.useRef(r),s=x.useRef(e);return vae(()=>{s.current=e},[e]),x.useEffect(()=>{var a;i.current!==r&&((a=s.current)==null||a.call(s,r),i.current=r)},[r,i]),[r,n,s]}function xae(t){return typeof t=="function"}var VU=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"}),bae="VisuallyHidden",g_=x.forwardRef((t,e)=>l.jsx(Oe.span,{...t,ref:e,style:{...VU,...t.style}}));g_.displayName=bae;var wae=g_,OP="ToastProvider",[TP,_ae,kae]=vy("Toast"),[WU,IZe]=Kn("Toast",[kae]),[Sae,v_]=WU(OP),qU=t=>{const{__scopeToast:e,label:r="Notification",duration:n=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:a}=t,[o,c]=x.useState(null),[u,d]=x.useState(0),f=x.useRef(!1),p=x.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${OP}\`. Expected non-empty \`string\`.`),l.jsx(TP.Provider,{scope:e,children:l.jsx(Sae,{scope:e,label:r,duration:n,swipeDirection:i,swipeThreshold:s,toastCount:u,viewport:o,onViewportChange:c,onToastAdd:x.useCallback(()=>d(m=>m+1),[]),onToastRemove:x.useCallback(()=>d(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,children:a})})};qU.displayName=OP;var KU="ToastViewport",jae=["F8"],wE="toast.viewportPause",_E="toast.viewportResume",GU=x.forwardRef((t,e)=>{const{__scopeToast:r,hotkey:n=jae,label:i="Notifications ({hotkey})",...s}=t,a=v_(KU,r),o=_ae(r),c=x.useRef(null),u=x.useRef(null),d=x.useRef(null),f=x.useRef(null),p=it(e,f,a.onViewportChange),m=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=a.toastCount>0;x.useEffect(()=>{const w=b=>{var S;n.length!==0&&n.every(N=>b[N]||b.code===N)&&((S=f.current)==null||S.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[n]),x.useEffect(()=>{const w=c.current,b=f.current;if(y&&w&&b){const _=()=>{if(!a.isClosePausedRef.current){const C=new CustomEvent(wE);b.dispatchEvent(C),a.isClosePausedRef.current=!0}},S=()=>
68{if(a.isClosePausedRef.current){const C=new CustomEvent(_E);b.dispatchEvent(C),a.isClosePausedRef.current=!1}},N=C=>{!w.contains(C.relatedTarget)&&S()},j=()=>{w.contains(document.activeElement)||S()};return w.addEventListener("focusin",_),w.addEventListener("focusout",N),w.addEventListener("pointermove",_),w.addEventListener("pointerleave",j),window.addEventListener("blur",_),window.addEventListener("focus",S),()=>{w.removeEventListener("focusin",_),w.removeEventListener("focusout",N),w.removeEventListener("pointermove",_),w.removeEventListener("pointerleave",j),window.removeEventListener("blur",_),window.removeEventListener("focus",S)}}},[y,a.isClosePausedRef]);const v=x.useCallback(({tabbingDirection:w})=>{const _=o().map(S=>{const N=S.ref.current,j=[N,...Dae(N)];return w==="forwards"?j:j.reverse()});return(w==="forwards"?_.reverse():_).flat()},[o]);return x.useEffect(()=>{const w=f.current;if(w){const b=_=>{var j,C,O;const S=_.altKey||_.ctrlKey||_.metaKey;if(_.key==="Tab"&&!S){const P=document.activeElement,T=_.shiftKey;if(_.target===w&&T){(j=u.current)==null||j.focus();return}const R=v({tabbingDirection:T?"backwards":"forwards"}),M=R.findIndex(F=>F===P);Oj(R.slice(M+1))?_.preventDefault():T?(C=u.current)==null||C.focus():(O=d.current)==null||O.focus()}};return w.addEventListener("keydown",b),()=>w.removeEventListener("keydown",b)}},[o,v]),l.jsxs(fae,{ref:c,role:"region","aria-label":i.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&l.jsx(kE,{ref:u,onFocusFromOutsideViewport:()=>{const w=v({tabbingDirection:"forwards"});Oj(w)}}),l.jsx(TP.Slot,{scope:r,children:l.jsx(Oe.ol,{tabIndex:-1,...s,ref:p})}),y&&l.jsx(kE,{ref:d,onFocusFromOutsideViewport:()=>{const w=v({tabbingDirection:"backwards"});Oj(w)}})]})});GU.displayName=KU;var ZU="ToastFocusProxy",kE=x.forwardRef((t,e)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=t,s=v_(ZU,r);return l.jsx(g_,{"aria-hidden":!0,tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:a=>{var u;const o=a.relatedTarget;!((u=s.viewport)!=null&&u.contains(o))&&n()}})});kE.displayName=ZU;var yy="Toast",Nae="toast.swipeStart",Cae="toast.swipeMove",Eae="toast.swipeCancel",Oae="toast.swipeEnd",JU=x.forwardRef((t,e)=>{const{forceMount:r,open:n,defaultOpen:i,onOpenChange:s,...a}=t,[o,c]=Yi({prop:n,defaultProp:i??!0,onChange:s,caller:yy});return l.jsx(di,{present:r||o,children:l.jsx(Pae,{open:o,...a,ref:e,onClose:()=>c(!1),onPause:Ci(t.onPause),onResume:Ci(t.onResume),onSwipeStart:we(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:we(t.onSwipeMove,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:we(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:we(t.onSwipeEnd,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),c(!1)})})})});JU.displayName=yy;var[Tae,Aae]=WU(yy,{onClose(){}}),Pae=x.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:s,onClose:a,onEscapeKeyDown:o,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:m,...y}=t,v=v_(yy,r),[w,b]=x.useState(null),_=it(e,F=>b(F)),S=x.useRef(null),N=x.useRef(null),j=i||v.duration,C=x.useRef(0),O=x.useRef(j),P=x.useRef(0),{onToastAdd:T,onToastRemove:$}=v,B=Ci(()=>{var q;(w==null?void 0:w.contains(document.activeElement))&&((q=v.viewport)==null||q.focus()),a()}),R=x.useCallback(F=>
68{!F||F===1/0||(window.clearTimeout(P.current),C.current=new Date().getTime(),P.current=window.setTimeout(B,F))},[B]);x.useEffect(()=>{const F=v.viewport;if(F){const q=()=>{R(O.current),u==null||u()},V=()=>{const W=new Date().getTime()-C.current;O.current=O.current-W,window.clearTimeout(P.current),c==null||c()};return F.addEventListener(wE,V),F.addEventListener(_E,q),()=>{F.removeEventListener(wE,V),F.removeEventListener(_E,q)}}},[v.viewport,j,c,u,R]),x.useEffect(()=>{s&&!v.isClosePausedRef.current&&R(j)},[s,j,v.isClosePausedRef,R]),x.useEffect(()=>(T(),()=>$()),[T,$]);const M=x.useMemo(()=>w?nH(w):null,[w]);return v.viewport?l.jsxs(l.Fragment,{children:[M&&l.jsx(Mae,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:M}),l.jsx(Tae,{scope:r,onClose:B,children:Vi.createPortal(l.jsx(TP.ItemSlot,{scope:r,children:l.jsx(dae,{asChild:!0,onEscapeKeyDown:we(o,()=>{v.isFocusedToastEscapeKeyDownRef.current||B(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(Oe.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":v.swipeDirection,...y,ref:_,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:we(t.onKeyDown,F=>{F.key==="Escape"&&(o==null||o(F.nativeEvent),F.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,B()))}),onPointerDown:we(t.onPointerDown,F=>{F.button===0&&(S.current={x:F.clientX,y:F.clientY})}),onPointerMove:we(t.onPointerMove,F=>{if(!S.current)return;const q=F.clientX-S.current.x,V=F.clientY-S.current.y,W=!!N.current,z=["left","right"].includes(v.swipeDirection),H=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,G=z?H(0,q):0,Y=z?0:H(0,V),U=F.pointerType==="touch"?10:2,J={x:G,y:Y},te={originalEvent:F,delta:J};W?(N.current=J,Rx(Cae,f,te,{discrete:!1})):f$(J,v.swipeDirection,U)?(N.current=J,Rx(Nae,d,te,{discrete:!1}),F.target.setPointerCapture(F.pointerId)):(Math.abs(q)>U||Math.abs(V)>U)&&(S.current=null)}),onPointerUp:we(t.onPointerUp,F=>{const q=N.current,V=F.target;if(V.hasPointerCapture(F.pointerId)&&V.releasePointerCapture(F.pointerId),N.current=null,S.current=null,q){const W=F.currentTarget,z={originalEvent:F,delta:q};f$(q,v.swipeDirection,v.swipeThreshold)?Rx(Oae,m,z,{discrete:!0}):Rx(Eae,p,z,{discrete:!0}),W.addEventListener("click",H=>H.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),Mae=t=>{const{__scopeToast:e,children:r,...n}=t,i=v_(yy,e),[s,a]=x.useState(!1),[o,c]=x.useState(!1);return Lae(()=>a(!0)),x.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),o?null:l.jsx(mp,{asChild:!0,children:l.jsx(g_,{...n,children:s&&l.jsxs(l.Fragment,{children:[i.label," ",r]})})})},Rae="ToastTitle",YU=x.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return l.jsx(Oe.div,{...n,ref:e})});YU.displayName=Rae;var Iae="ToastDescription",XU=x.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return l.jsx(Oe.div,{...n,ref:e})});XU.displayName=Iae;var QU="ToastAction",eH=x.forwardRef((t,e)=>{const{altText:r,...n}=t;return r.trim()?l.jsx(rH,{altText:r,asChild:!0,children:l.jsx(AP,{...n,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${QU}\`. Expected non-empty \`string\`.`),null)});eH.displayName=QU;var tH="ToastClose",AP=x.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,i=Aae(tH,r);return l.jsx(rH,{asChild:!0,children:l.jsx(Oe.button,{type:"button",...n,ref:e,onClick:we(t.onClick,i.onClose)})})});AP.displayName=tH;var rH=x.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...i}=t;return l.jsx(Oe.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...i,ref:e})});function nH(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),$ae(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const a=n.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...nH(n))}}),e}function Rx(t,e,r,{discrete:n}){const i=r.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?EP(i,s):i.dispatchEvent(s)}var f$=(t,e,r=0)=>{const n=Math.abs(t.x),i=Math.abs(t.y),s=n>i;return e==="left"||e==="right"?s&&n>r:!s&&i>r};function Lae(t=()=>{}){const e=Ci(t);hn(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function $ae(t){return t.nodeType===t.ELEMENT_NODE}function Dae(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function Oj(t){const e=document.activeElement;return t.some(r=>r===e?!0:(r.focus(),document.activeElement!==e))}var Bae=qU,iH=GU,sH=JU,aH=YU,oH=XU,lH=eH,cH=AP;function uH(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(r=uH(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function at(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=uH(t))&&(n&&(n+=" "),n+=e);return n}const h$=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,p$=at,gp=(t,e)=>r=>{var n;if((e==null?void 0:e.variants)==null)return p$(t,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:s}=e,a=Object.keys(i).map(u=>{const d=r==null?void 0:r[u],f=s==null?void 0:s[u];if(d===null)return null;const p=h$(d)||h$(f);return i[u][p]}),o=r&&Object.entries(r).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),c=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:f,className:p,...m}=d;return Object.entries(m).every(y=>{let[v,w]=y;return Array.isArray(w)?w.includes({...s,...o}[v]):{...s,...o}[v]===w})?[...u,f,p]:u},[]);return p$(t,a,c,r==null?void 0:r.class,r==null?void 0:r.className)};/**
69 * @license lucide-react v0.462.0 - ISC
70 *
71 * This source code is licensed under the ISC license.
72 * See the LICENSE file in the root directory of this source tree.
73 */const Fae=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),dH=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim();/**
74 * @license lucide-react v0.462.0 - ISC
75 *
76 * This source code is licensed under the ISC license.
77 * See the LICENSE file in the root directory of this source tree.
78 */var zae={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"};/**
79 * @license lucide-react v0.462.0 - ISC
80 *
81 * This source code is licensed under the ISC license.
82 * See the LICENSE file in the root directory of this source tree.
83 */const Uae=x.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:s,iconNode:a,...o},c)=>x.createElement("svg",{ref:c,...zae,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:dH("lucide",i),...o},[...a.map(([u,d])=>x.createElement(u,d)),...Array.isArray(s)?s:[s]]));/**
84 * @license lucide-react v0.462.0 - ISC
85 *
86 * This source code is licensed under the ISC license.
87 * See the LICENSE file in the root directory of this source tree.
88 */const pe=(t,e)=>{const r=x.forwardRef(({className:n,...i},s)=>x.createElement(Uae,{ref:s,iconNode:e,className:dH(`lucide-${Fae(t)}`,n),...i}));return r.displayName=`${t}`,r};/**
89 * @license lucide-react v0.462.0 - ISC
90 *
91 * This source code is licensed under the ISC license.
92 * See the LICENSE file in the root directory of this source tree.
93 */const fH=pe("ArchiveRestore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);/**
94 * @license lucide-react v0.462.0 - ISC
95 *
96 * This source code is licensed under the ISC license.
97 * See the LICENSE file in the root directory of this source tree.
98 */const hH=pe("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
99 * @license lucide-react v0.462.0 - ISC
100 *
101 * This source code is licensed under the ISC license.
102 * See the LICENSE file in the root directory of this source tree.
103 */const pH=pe("Armchair",[["path",{d:"M19 9V6a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v3",key:"irtipd"}],["path",{d:"M3 16a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-5a2 2 0 0 0-4 0v1.5a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5V11a2 2 0 0 0-4 0z",key:"1qyhux"}],["path",{d:"M5 18v2",key:"ppbyun"}],["path",{d:"M19 18v2",key:"gy7782"}]]);/**
104 * @license lucide-react v0.462.0 - ISC
105 *
106 * This source code is licensed under the ISC license.
107 * See the LICENSE file in the root directory of this source tree.
108 */const mH=pe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
109 * @license lucide-react v0.462.0 - ISC
110 *
111 * This source code is licensed under the ISC license.
112 * See the LICENSE file in the root directory of this source tree.
113 */const Hae=pe("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/**
114 * @license lucide-react v0.462.0 - ISC
115 *
116 * This source code is licensed under the ISC license.
117 * See the LICENSE file in the root directory of this source tree.
118 */const _h=pe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
119 * @license lucide-react v0.462.0 - ISC
120 *
121 * This source code is licensed under the ISC license.
122 * See the LICENSE file in the root directory of this source tree.
123 */const Vae=pe("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
124 * @license lucide-react v0.462.0 - ISC
125 *
126 * This source code is licensed under the ISC license.
127 * See the LICENSE file in the root directory of this source tree.
128 */const Wae=pe("ArrowUpFromLine",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/**
129 * @license lucide-react v0.462.0 - ISC
130 *
131 * This source code is licensed under the ISC license.
132 * See the LICENSE file in the root directory of this source tree.
133 */const gH=pe("ArrowUpToLine",[["path",{d:"M5 3h14",key:"7usisc"}],["path",{d:"m18 13-6-6-6 6",key:"1kf1n9"}],["path",{d:"M12 7v14",key:"1akyts"}]]);/**
134 * @license lucide-react v0.462.0 - ISC
135 *
136 * This source code is licensed under the ISC license.
137 * See the LICENSE file in the root directory of this source tree.
138 */const qae=pe("Banknote",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M6 12h.01M18 12h.01",key:"113zkx"}]]);/**
139 * @license lucide-react v0.462.0 - ISC
140 *
141 * This source code is licensed under the ISC license.
142 * See the LICENSE file in the root directory of this source tree.
143 */const E0=pe("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"}]]);/**
144 * @license lucide-react v0.462.0 - ISC
145 *
146 * This source code is licensed under the ISC license.
147 * See the LICENSE file in the root directory of this source tree.
148 */const vp=pe("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"}]]);/**
149 * @license lucide-react v0.462.0 - ISC
150 *
151 * This source code is licensed under the ISC license.
152 * See the LICENSE file in the root directory of this source tree.
153 */const vH=pe("Bed",[["path",{d:"M2 4v16",key:"vw9hq8"}],["path",{d:"M2 8h18a2 2 0 0 1 2 2v10",key:"1dgv2r"}],["path",{d:"M2 17h20",key:"18nfp3"}],["path",{d:"M6 8v9",key:"1yriud"}]]);/**
154 * @license lucide-react v0.462.0 - ISC
155 *
156 * This source code is licensed under the ISC license.
157 * See the LICENSE file in the root directory of this source tree.
158 */const Kae=pe("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"}]]);/**
159 * @license lucide-react v0.462.0 - ISC
160 *
161 * This source code is licensed under the ISC license.
162 * See the LICENSE file in the root directory of this source tree.
163 */const Gae=pe("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"}]]);/**
164 * @license lucide-react v0.462.0 - ISC
165 *
166 * This source code is licensed under the ISC license.
167 * See the LICENSE file in the root directory of this source tree.
168 */const yH=pe("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
169 * @license lucide-react v0.462.0 - ISC
170 *
171 * This source code is licensed under the ISC license.
172 * See the LICENSE file in the root directory of this source tree.
173 */const xH=pe("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/**
174 * @license lucide-react v0.462.0 - ISC
175 *
176 * This source code is licensed under the ISC license.
177 * See the LICENSE file in the root directory of this source tree.
178 */const vc=pe("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"}
178],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
179 * @license lucide-react v0.462.0 - ISC
180 *
181 * This source code is licensed under the ISC license.
182 * See the LICENSE file in the root directory of this source tree.
183 */const m$=pe("CalendarCheck",[["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"}],["path",{d:"m9 16 2 2 4-4",key:"19s6y9"}]]);/**
184 * @license lucide-react v0.462.0 - ISC
185 *
186 * This source code is licensed under the ISC license.
187 * See the LICENSE file in the root directory of this source tree.
188 */const SE=pe("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"}]]);/**
189 * @license lucide-react v0.462.0 - ISC
190 *
191 * This source code is licensed under the ISC license.
192 * See the LICENSE file in the root directory of this source tree.
193 */const yp=pe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
194 * @license lucide-react v0.462.0 - ISC
195 *
196 * This source code is licensed under the ISC license.
197 * See the LICENSE file in the root directory of this source tree.
198 */const xp=pe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
199 * @license lucide-react v0.462.0 - ISC
200 *
201 * This source code is licensed under the ISC license.
202 * See the LICENSE file in the root directory of this source tree.
203 */const O0=pe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
204 * @license lucide-react v0.462.0 - ISC
205 *
206 * This source code is licensed under the ISC license.
207 * See the LICENSE file in the root directory of this source tree.
208 */const kh=pe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
209 * @license lucide-react v0.462.0 - ISC
210 *
211 * This source code is licensed under the ISC license.
212 * See the LICENSE file in the root directory of this source tree.
213 */const Zae=pe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
214 * @license lucide-react v0.462.0 - ISC
215 *
216 * This source code is licensed under the ISC license.
217 * See the LICENSE file in the root directory of this source tree.
218 */const bH=pe("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
219 * @license lucide-react v0.462.0 - ISC
220 *
221 * This source code is licensed under the ISC license.
222 * See the LICENSE file in the root directory of this source tree.
223 */const Jae=pe("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"}]]);/**
224 * @license lucide-react v0.462.0 - ISC
225 *
226 * This source code is licensed under the ISC license.
227 * See the LICENSE file in the root directory of this source tree.
228 */const wH=pe("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
229 * @license lucide-react v0.462.0 - ISC
230 *
231 * This source code is licensed under the ISC license.
232 * See the LICENSE file in the root directory of this source tree.
233 */const Sh=pe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
234 * @license lucide-react v0.462.0 - ISC
235 *
236 * This source code is licensed under the ISC license.
237 * See the LICENSE file in the root directory of this source tree.
238 */const Yae=pe("CircleUserRound",[["path",{d:"M18 20a6 6 0 0 0-12 0",key:"1qehca"}],["circle",{cx:"12",cy:"10",r:"4",key:"1h16sb"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
239 * @license lucide-react v0.462.0 - ISC
240 *
241 * This source code is licensed under the ISC license.
242 * See the LICENSE file in the root directory of this source tree.
243 */const Xae=pe("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"}]]);/**
244 * @license lucide-react v0.462.0 - ISC
245 *
246 * This source code is licensed under the ISC license.
247 * See the LICENSE file in the root directory of this source tree.
248 */const _H=pe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
249 * @license lucide-react v0.462.0 - ISC
250 *
251 * This source code is licensed under the ISC license.
252 * See the LICENSE file in the root directory of this source tree.
253 */const Qae=pe("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
254 * @license lucide-react v0.462.0 - ISC
255 *
256 * This source code is licensed under the ISC license.
257 * See the LICENSE file in the root directory of this source tree.
258 */const kH=pe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
259 * @license lucide-react v0.462.0 - ISC
260 *
261 * This source code is licensed under the ISC license.
262 * See the LICENSE file in the root directory of this source tree.
263 */const PP=pe("DoorOpen",[["path",{d:"M13 4h3a2 2 0 0 1 2 2v14",key:"hrm0s9"}],["path",{d:"M2 20h3",key:"1gaodv"}],["path",{d:"M13 20h9",key:"s90cdi"}],["path",{d:"M10 12v.01",key:"vx6srw"}],["path",{d:"M13 4.562v16.157a1 1 0 0 1-1.242.97L5 20V5.562a2 2 0 0 1 1.515-1.94l4-1A2 2 0 0 1 13 4.561Z",key:"199qr4"}]]);/**
264 * @license lucide-react v0.462.0 - ISC
265 *
266 * This source code is licensed under the ISC license.
267 * See the LICENSE file in the root directory of this source tree.
268 */const SH=pe("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"}]]);/**
269 * @license lucide-react v0.462.0 - ISC
270 *
271 * This source code is licensed under the ISC license.
272 * See the LICENSE file in the root directory of this source tree.
273 */const T0=pe("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"}]]);/**
274 * @license lucide-react v0.462.0 - ISC
275 *
276 * This source code is licensed under the ISC license.
277 * See the LICENSE file in the root directory of this source tree.
278 */const y_=pe("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"}]]);/**
279 * @license lucide-react v0.462.0 - ISC
280 *
281 * This source code is licensed under the ISC license.
282 * See the LICENSE file in the root directory of this source tree.
283 */const Cc=pe("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"}]]);/**
284 * @license lucide-react v0.462.0 - ISC
285 *
286 * This source code is licensed under the ISC license.
287 * See the LICENSE file in the root directory of this source tree.
288 */const eoe=pe("Fence",[["path",{d:"M4 3 2 5v15c0 .6.4 1 1 1h2c.6 0 1-.4 1-1V5Z",key:"1n2rgs"}],["path",{d:"M6 8h4",key:"utf9t1"}],["path",{d:"M6 18h4",key:"12yh4b"}],["path",{d:"m12 3-2 2v15c0 .6.4 1 1 1h2c.6 0 1-.4 1-1V5Z",key:"3ha7mj"}],["path",{d:"M14 8h4",key:"1r8wg2"}],["path",{d:"M14 18h4",key:"1t3kbu"}],["path",{d:"m20 3-2 2v15c0 .6.4 1 1 1h2c.6 0 1-.4 1-1V5Z",key:"dfd4e2"}]]);/**
289 * @license lucide-react v0.462.0 - ISC
290 *
291 * This source code is licensed under the ISC license.
292 * See the LICENSE file in the root directory of this source tree.
293 */const toe=pe("FileJson",[["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 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);/**
294 * @license lucide-react v0.462.0 - ISC
295 *
296 * This source code is licensed under the ISC license.
297 * See the LICENSE file in the root directory of this source tree.
298 */const roe=pe("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"}]]);/**
299 * @license lucide-react v0.462.0 - ISC
300 *
301 * This source code is licensed under the ISC license.
302 * See the LICENSE file in the root directory of this source tree.
303 */const noe=pe("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);/**
304 * @license lucide-react v0.462.0 - ISC
305 *
306 * This source code is licensed under the ISC license.
307 * See the LICENSE file in the root directory of this source tree.
308 */const jH=pe("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
309 * @license lucide-react v0.462.0 - ISC
310 *
311 * This source code is licensed under the ISC license.
312 * See the LICENSE file in the root directory of this source tree.
313 */const ioe=pe("Handshake",[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]]);/**
314 * @license lucide-react v0.462.0 - ISC
315 *
316 * This source code is licensed under the ISC license.
317 * See the LICENSE file in the root directory of this source tree.
318 */const soe=pe("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"}
318]]);/**
319 * @license lucide-react v0.462.0 - ISC
320 *
321 * This source code is licensed under the ISC license.
322 * See the LICENSE file in the root directory of this source tree.
323 */const aoe=pe("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"}]]);/**
324 * @license lucide-react v0.462.0 - ISC
325 *
326 * This source code is licensed under the ISC license.
327 * See the LICENSE file in the root directory of this source tree.
328 */const ooe=pe("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"}]]);/**
329 * @license lucide-react v0.462.0 - ISC
330 *
331 * This source code is licensed under the ISC license.
332 * See the LICENSE file in the root directory of this source tree.
333 */const Ss=pe("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"}]]);/**
334 * @license lucide-react v0.462.0 - ISC
335 *
336 * This source code is licensed under the ISC license.
337 * See the LICENSE file in the root directory of this source tree.
338 */const loe=pe("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"}]]);/**
339 * @license lucide-react v0.462.0 - ISC
340 *
341 * This source code is licensed under the ISC license.
342 * See the LICENSE file in the root directory of this source tree.
343 */const coe=pe("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]]);/**
344 * @license lucide-react v0.462.0 - ISC
345 *
346 * This source code is licensed under the ISC license.
347 * See the LICENSE file in the root directory of this source tree.
348 */const g$=pe("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
349 * @license lucide-react v0.462.0 - ISC
350 *
351 * This source code is licensed under the ISC license.
352 * See the LICENSE file in the root directory of this source tree.
353 */const NH=pe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
354 * @license lucide-react v0.462.0 - ISC
355 *
356 * This source code is licensed under the ISC license.
357 * See the LICENSE file in the root directory of this source tree.
358 */const uoe=pe("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"}]]);/**
359 * @license lucide-react v0.462.0 - ISC
360 *
361 * This source code is licensed under the ISC license.
362 * See the LICENSE file in the root directory of this source tree.
363 */const MP=pe("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
364 * @license lucide-react v0.462.0 - ISC
365 *
366 * This source code is licensed under the ISC license.
367 * See the LICENSE file in the root directory of this source tree.
368 */const doe=pe("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
369 * @license lucide-react v0.462.0 - ISC
370 *
371 * This source code is licensed under the ISC license.
372 * See the LICENSE file in the root directory of this source tree.
373 */const foe=pe("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"}]]);/**
374 * @license lucide-react v0.462.0 - ISC
375 *
376 * This source code is licensed under the ISC license.
377 * See the LICENSE file in the root directory of this source tree.
378 */const hoe=pe("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"}]]);/**
379 * @license lucide-react v0.462.0 - ISC
380 *
381 * This source code is licensed under the ISC license.
382 * See the LICENSE file in the root directory of this source tree.
383 */const poe=pe("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"}]]);/**
384 * @license lucide-react v0.462.0 - ISC
385 *
386 * This source code is licensed under the ISC license.
387 * See the LICENSE file in the root directory of this source tree.
388 */const moe=pe("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"}]]);/**
389 * @license lucide-react v0.462.0 - ISC
390 *
391 * This source code is licensed under the ISC license.
392 * See the LICENSE file in the root directory of this source tree.
393 */const js=pe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
394 * @license lucide-react v0.462.0 - ISC
395 *
396 * This source code is licensed under the ISC license.
397 * See the LICENSE file in the root directory of this source tree.
398 */const CH=pe("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"}]]);/**
399 * @license lucide-react v0.462.0 - ISC
400 *
401 * This source code is licensed under the ISC license.
402 * See the LICENSE file in the root directory of this source tree.
403 */const En=pe("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"}]]);/**
404 * @license lucide-react v0.462.0 - ISC
405 *
406 * This source code is licensed under the ISC license.
407 * See the LICENSE file in the root directory of this source tree.
408 */const Vn=pe("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"}]]);/**
409 * @license lucide-react v0.462.0 - ISC
410 *
411 * This source code is licensed under the ISC license.
412 * See the LICENSE file in the root directory of this source tree.
413 */const goe=pe("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
414 * @license lucide-react v0.462.0 - ISC
415 *
416 * This source code is licensed under the ISC license.
417 * See the LICENSE file in the root directory of this source tree.
418 */const A0=pe("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);/**
419 * @license lucide-react v0.462.0 - ISC
420 *
421 * This source code is licensed under the ISC license.
422 * See the LICENSE file in the root directory of this source tree.
423 */const voe=pe("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"}]]);/**
424 * @license lucide-react v0.462.0 - ISC
425 *
426 * This source code is licensed under the ISC license.
427 * See the LICENSE file in the root directory of this source tree.
428 */const yoe=pe("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"}]]);/**
429 * @license lucide-react v0.462.0 - ISC
430 *
431 * This source code is licensed under the ISC license.
432 * See the LICENSE file in the root directory of this source tree.
433 */const xoe=pe("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
434 * @license lucide-react v0.462.0 - ISC
435 *
436 * This source code is licensed under the ISC license.
437 * See the LICENSE file in the root directory of this source tree.
438 */const boe=pe("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
439 * @license lucide-react v0.462.0 - ISC
440 *
441 * This source code is licensed under the ISC license.
442 * See the LICENSE file in the root directory of this source tree.
443 */const zo=pe("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"}]]);/**
444 * @license lucide-react v0.462.0 - ISC
445 *
446 * This source code is licensed under the ISC license.
447 * See the LICENSE file in the root directory of this source tree.
448 */const ai=pe("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"}]]);/**
449 * @license lucide-react v0.462.0 - ISC
450 *
451 * This source code is licensed under the ISC license.
452 * See the LICENSE file in the root directory of this source tree.
453 */const qa=pe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
454 * @license lucide-react v0.462.0 - ISC
455 *
456 * This source code is licensed under the ISC license.
457 * See the LICENSE file in the root directory of this source tree.
458 */const RP=pe("Printer",[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]);/**
459 * @license lucide-react v0.462.0 - ISC
460 *
461 * This source code is licensed under the ISC license.
462 * See the LICENSE file in the root directory of this source tree.
463 */const woe=pe("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"}]]);/**
464 * @license lucide-react v0.462.0 - ISC
465 *
466 * This source code is licensed under the ISC license.
467 * See the LICENSE file in the root directory of this source tree.
468 */const EH=pe("Radius",[["path",{d:"M20.34 17.52a10 10 0 1 0-2.82 2.82",key:"fydyku"}],["circle",{cx:"19",cy:"19",r:"2",key:"17f5cg"}],["path",{d:"m13.41 13.41 4.18 4.18",key:"1gqbwc"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
469 * @license lucide-react v0.462.0 - ISC
470 *
471 * This source code is licensed under the ISC license.
472 * See the LICENSE file in the root directory of this source tree.
473 */const _oe=pe("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"}]]);/**
474 * @license lucide-react v0.462.0 - ISC
475 *
476 * This source code is licensed under the ISC license.
477 * See the LICENSE file in the root directory of this source tree.
478 */const koe=pe("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"}]]);/**
479 * @license lucide-react v0.462.0 - ISC
480 *
481 * This source code is licensed under the ISC license.
482 * See the LICENSE file in the root directory of this source tree.
483 */const OH=pe("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
484 * @license lucide-react v0.462.0 - ISC
485 *
486 * This source code is licensed under the ISC license.
487 * See the LICENSE file in the root directory of this source tree.
488 */const IP=pe("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"}]]);/**
489 * @license lucide-react v0.462.0 - ISC
490 *
491 * This source code is licensed under the ISC license.
492 * See the LICENSE file in the root directory of this source tree.
493 */const ma=pe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
494 * @license lucide-react v0.462.0 - ISC
495 *
496 * This source code is licensed under the ISC license.
497 * See the LICENSE file in the root directory of this source tree.
498 */const TH=pe("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"}]]);/**
499 * @license lucide-react v0.462.0 - ISC
500 *
501 * This source code is licensed under the ISC license.
502 * See the LICENSE file in the root directory of this source tree.
503 */const x_=pe("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",ke
503y:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
504 * @license lucide-react v0.462.0 - ISC
505 *
506 * This source code is licensed under the ISC license.
507 * See the LICENSE file in the root directory of this source tree.
508 */const Soe=pe("ShieldOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]);/**
509 * @license lucide-react v0.462.0 - ISC
510 *
511 * This source code is licensed under the ISC license.
512 * See the LICENSE file in the root directory of this source tree.
513 */const P0=pe("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
514 * @license lucide-react v0.462.0 - ISC
515 *
516 * This source code is licensed under the ISC license.
517 * See the LICENSE file in the root directory of this source tree.
518 */const joe=pe("ShowerHead",[["path",{d:"m4 4 2.5 2.5",key:"uv2vmf"}],["path",{d:"M13.5 6.5a4.95 4.95 0 0 0-7 7",key:"frdkwv"}],["path",{d:"M15 5 5 15",key:"1ag8rq"}],["path",{d:"M14 17v.01",key:"eokfpp"}],["path",{d:"M10 16v.01",key:"14uyyl"}],["path",{d:"M13 13v.01",key:"1v1k97"}],["path",{d:"M16 10v.01",key:"5169yg"}],["path",{d:"M11 20v.01",key:"cj92p8"}],["path",{d:"M17 14v.01",key:"11cswd"}],["path",{d:"M20 11v.01",key:"19e0od"}]]);/**
519 * @license lucide-react v0.462.0 - ISC
520 *
521 * This source code is licensed under the ISC license.
522 * See the LICENSE file in the root directory of this source tree.
523 */const LP=pe("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
524 * @license lucide-react v0.462.0 - ISC
525 *
526 * This source code is licensed under the ISC license.
527 * See the LICENSE file in the root directory of this source tree.
528 */const Noe=pe("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"}]]);/**
529 * @license lucide-react v0.462.0 - ISC
530 *
531 * This source code is licensed under the ISC license.
532 * See the LICENSE file in the root directory of this source tree.
533 */const M0=pe("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
534 * @license lucide-react v0.462.0 - ISC
535 *
536 * This source code is licensed under the ISC license.
537 * See the LICENSE file in the root directory of this source tree.
538 */const Coe=pe("Toilet",[["path",{d:"M7 12h13a1 1 0 0 1 1 1 5 5 0 0 1-5 5h-.598a.5.5 0 0 0-.424.765l1.544 2.47a.5.5 0 0 1-.424.765H5.402a.5.5 0 0 1-.424-.765L7 18",key:"kc4kqr"}],["path",{d:"M8 18a5 5 0 0 1-5-5V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8",key:"1tqs57"}]]);/**
539 * @license lucide-react v0.462.0 - ISC
540 *
541 * This source code is licensed under the ISC license.
542 * See the LICENSE file in the root directory of this source tree.
543 */const yd=pe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}
vendor: 9,166 bytes, lines 543-593
543],["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"}]]);/**
544 * @license lucide-react v0.462.0 - ISC
545 *
546 * This source code is licensed under the ISC license.
547 * See the LICENSE file in the root directory of this source tree.
548 */const Eoe=pe("TreePine",[["path",{d:"m17 14 3 3.3a1 1 0 0 1-.7 1.7H4.7a1 1 0 0 1-.7-1.7L7 14h-.3a1 1 0 0 1-.7-1.7L9 9h-.2A1 1 0 0 1 8 7.3L12 3l4 4.3a1 1 0 0 1-.8 1.7H15l3 3.3a1 1 0 0 1-.7 1.7H17Z",key:"cpyugq"}],["path",{d:"M12 22v-3",key:"kmzjlo"}]]);/**
549 * @license lucide-react v0.462.0 - ISC
550 *
551 * This source code is licensed under the ISC license.
552 * See the LICENSE file in the root directory of this source tree.
553 */const AH=pe("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"}]]);/**
554 * @license lucide-react v0.462.0 - ISC
555 *
556 * This source code is licensed under the ISC license.
557 * See the LICENSE file in the root directory of this source tree.
558 */const Ooe=pe("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"}]]);/**
559 * @license lucide-react v0.462.0 - ISC
560 *
561 * This source code is licensed under the ISC license.
562 * See the LICENSE file in the root directory of this source tree.
563 */const $P=pe("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"}]]);/**
564 * @license lucide-react v0.462.0 - ISC
565 *
566 * This source code is licensed under the ISC license.
567 * See the LICENSE file in the root directory of this source tree.
568 */const PH=pe("UserCheck",[["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"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/**
569 * @license lucide-react v0.462.0 - ISC
570 *
571 * This source code is licensed under the ISC license.
572 * See the LICENSE file in the root directory of this source tree.
573 */const MH=pe("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
574 * @license lucide-react v0.462.0 - ISC
575 *
576 * This source code is licensed under the ISC license.
577 * See the LICENSE file in the root directory of this source tree.
578 */const Toe=pe("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"}]]);/**
579 * @license lucide-react v0.462.0 - ISC
580 *
581 * This source code is licensed under the ISC license.
582 * See the LICENSE file in the root directory of this source tree.
583 */const jE=pe("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"}]]);/**
584 * @license lucide-react v0.462.0 - ISC
585 *
586 * This source code is licensed under the ISC license.
587 * See the LICENSE file in the root directory of this source tree.
588 */const Aoe=pe("Wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);/**
589 * @license lucide-react v0.462.0 - ISC
590 *
591 * This source code is licensed under the ISC license.
592 * See the LICENSE file in the root directory of this source tree.
593 */const Wi=pe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),DP="-",Poe=t=>{const e=Roe(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:a=>{const o=a.split(DP);return o[0]===""&&o.length!==1&&o.shift(),RH(o,e)||Moe(a)},getConflictingClassGroupIds:(a,o)=>{const c=r[a]||[];return o&&n[a]?[...c,...n[a]]:c}}},RH=(t,e)=>{var a;if(t.length===0)return e.classGroupId;const r=t[0],n=e.nextPart.get(r),i=n?RH(t.slice(1),n):void 0;if(i)return i;if(e.validators.length===0)return;const s=t.join(DP);return(a=e.validators.find(({validator:o})=>o(s)))==null?void 0:a.classGroupId},v$=/^\[(.+)\]$/,Moe=t=>{if(v$.test(t)){const e=v$.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},Roe=t=>{const{theme:e,prefix:r}=t,n={nextPart:new Map,validators:[]};return Loe(Object.entries(t.classGroups),r).forEach(([s,a])=>{NE(a,n,s,e)}),n},NE=(t,e,r,n)=>{t.forEach(i=>{if(typeof i=="string"){const s=i===""?e:y$(e,i);s.classGroupId=r;return}if(typeof i=="function"){if(Ioe(i)){NE(i(n),e,r,n);return}e.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([s,a])=>{NE(a,y$(e,s),r,n)})})},y$=(t,e)=>{let r=t;return e.split(DP).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Ioe=t=>t.isThemeGetter,Loe=(t,e)=>e?t.map(([r,n])=>{const i=n.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([a,o])=>[e+a,o])):s);return[r,i]}):t,$oe=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,n=new Map;const i=(s,a)=>{r.set(s,a),e++,e>t&&(e=0,n=r,r=new Map)};return{get(s){let a=r.get(s);if(a!==void 0)return a;if((a=n.get(s))!==void 0)return i(s,a),a},set(s,a){r.has(s)?r.set(s,a):i(s,a)}}},IH="!",Doe=t=>{const{separator:e,experimentalParseClassName:r}=t,n=e.length===1,i=e[0],s=e.length,a=o=>{const c=[];let u=0,d=0,f;for(let w=0;w<o.length;w++){let b=o[w];if(u===0){if(b===i&&(n||o.slice(w,w+s)===e)){c.push(o.slice(d,w)),d=w+s;continue}if(b==="/"){f=w;continue}}b==="["?u++:b==="]"&&u--}const p=c.length===0?o:o.substring(d),m=p.startsWith(IH),y=m?p.substring(1):p,v=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:y,maybePostfixModifierPosition:v}};return r?o=>r({className:o,parseClassName:a}):a},Boe=t=>{if(t.length<=1)return t;const e=[];let r=[];return t.forEach(n=>{n[0]==="["?(e.push(...r.sort(),n),r=[]):r.push(n)}),e.push(...r.sort()),e},Foe=t=>({cache:$oe(t.cacheSize),parseClassName:Doe(t),...Poe(t)}),zoe=/\s+/,Uoe=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=e,s=[],a=t.trim().split(zoe);let o="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=r(u);let y=!!m,v=n(y?p.substring(0,m):p);if(!v){if(!y){o=u+(o.length>0?" "+o:o);continue}if(v=n(p),!v){o=u+(o.length>0?" "+o:o);continue}y=!1}const w=Boe(d).join(":"),b=f?w+IH:w,_=b+v;if(s.includes(_))continue;s.push(_);const S=i(v,y);for(let N=0;N<S.length;++N){const j=S[N];s.push(b+j)}o=u+(o.length>0?" "+o:o)}return o};function Hoe(){let t=0,e,r,n="";for(;t<arguments.length;)(e=arguments[t++])&&(r=LH(e))&&(n&&(n+=" "),n+=r);return n}const LH=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=LH(t[n]))&&(r&&(r+=" "),r+=e);return r};function Voe(t,...e){let r,n,i,s=a;function a(c){const u=e.reduce((d,f)=>f(d),t());return r=Foe(u),n=r.cache.get,i=r.cache.set,s=o,o(c)}function o(c){const u=n(c);if(u)return u;const d=Uoe(c,r);return i(c,d),d}return function(){return s(Hoe.apply(null,arguments))}}const er=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},$H=/^\[(?:([a-z-]+):)?(.+)\]$/i,Woe=/^\d+\/\d+$/,qoe=new Set(["px","full","screen"]),Koe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Goe=/\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$/,Zoe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Joe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Yoe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oo=t=>Wf(t)||qoe.has(t)||Woe.test(t),ul=t=>bp(t,"length",sle),Wf=t=>!!t&&!Number.isNaN(Number(t)),Tj=t=>bp(t,"number",Wf),hm=t=>!!t&&Number.isInteger(Number(t)),Xoe=t=>t.endsWith("%")&&Wf(t.slice(0,-1)),st=t=>$H.test(t),dl=t=>Koe.test(t),Qoe=new Set(["length","size","percentage"]),ele=t=>bp(t,Qoe,DH),tle=t=>bp(t,"position",DH),rle=new Set(["image","url"]),nle=t=>bp(t,rle,ole),ile=t=>bp(t,"",ale),pm=()=>!0,bp=(t,e,r)=>{const n=$H.exec(t);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):r(n[2]):!1},sle=t=>Goe.test(t)&&!Zoe.test(t),DH=()=>!1,ale=t=>Joe.test(t),ole=t=>Yoe.test(t),lle=()=>{const t=er("colors"),e=er("spacing"),r=er("blur"),n=er("brightness"),i=er("borderColor"),s=er("borderRadius"),a=er("borderSpacing"),o=er("borderWidth"),c=er("contrast"),u=er("grayscale"),d=er("hueRotate"),f=er("invert"),p=er("gap"),m=er("gradientColorStops"),y=er("gradientColorStopPositions"),v=er("inset"),w=er("margin"),b=er("opacity"),_=er("padding"),S=er("saturate"),N=er("scale"),j=er("sepia"),C=er("skew"),O=er("space"),P=er("translate"),T=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",st,e],R=()=>[st,e],M=()=>["",oo,ul],F=()=>["auto",Wf,st],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],
vendor: 12,076 bytes, line 593
593V=()=>["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"],z=()=>["start","end","center","between","around","evenly","stretch"],H=()=>["","0",st],G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[Wf,st];return{cacheSize:500,separator:":",theme:{colors:[pm],spacing:[oo,ul],blur:["none","",dl,st],brightness:Y(),borderColor:[t],borderRadius:["none","","full",dl,st],borderSpacing:R(),borderWidth:M(),contrast:Y(),grayscale:H(),hueRotate:Y(),invert:H(),gap:R(),gradientColorStops:[t],gradientColorStopPositions:[Xoe,ul],inset:B(),margin:B(),opacity:Y(),padding:R(),saturate:Y(),scale:Y(),sepia:H(),skew:Y(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",st]}],container:["container"],columns:[{columns:[dl]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"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:[...q(),st]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",hm,st]}],basis:[{basis:B()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",st]}],grow:[{grow:H()}],shrink:[{shrink:H()}],order:[{order:["first","last","none",hm,st]}],"grid-cols":[{"grid-cols":[pm]}],"col-start-end":[{col:["auto",{span:["full",hm,st]},st]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[pm]}],"row-start-end":[{row:["auto",{span:[hm,st]},st]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",st]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",st]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",st,e]}],"min-w":[{"min-w":[st,e,"min","max","fit"]}],"max-w":[{"max-w":[st,e,"none","full","min","max","fit","prose",{screen:[dl]},dl]}],h:[{h:[st,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[st,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[st,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[st,e,"auto","min","max","fit"]}],"font-size":[{text:["base",dl,ul]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Tj]}],"font-family":[{font:[pm]}],"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",st]}],"line-clamp":[{"line-clamp":["none",Wf,Tj]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",oo,st]}],"list-image":[{"list-image":["none",st]}],"list-style-type":[{list:["none","disc","decimal",st]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",oo,ul]}],"underline-offset":[{"underline-offset":["auto",oo,st]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",st]}],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",st]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),tle]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ele]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},nle]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],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":[b]}],"border-style":[{border:[...V(),"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":[b]}],"divide-style":[{divide:V()}],"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:["",...V()]}],"outline-offset":[{"outline-offset":[oo,st]}],"outline-w":[{outline:[oo,ul]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[oo,ul]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",dl,ile]}],"shadow-color":[{shadow:[pm]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",dl,st]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[S]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"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",st]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",st]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",st]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[hm,st]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",st]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",st]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
vendor: 4,657 bytes, line 593
593],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",st]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[oo,ul,Tj]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},cle=Voe(lle);function fe(...t){return cle(at(t))}const ule=Bae,BH=x.forwardRef(({className:t,...e},r)=>l.jsx(iH,{ref:r,className:fe("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));BH.displayName=iH.displayName;const dle=gp("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"}}),FH=x.forwardRef(({className:t,variant:e,...r},n)=>l.jsx(sH,{ref:n,className:fe(dle({variant:e}),t),...r}));FH.displayName=sH.displayName;const fle=x.forwardRef(({className:t,...e},r)=>l.jsx(lH,{ref:r,className:fe("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",t),...e}));fle.displayName=lH.displayName;const zH=x.forwardRef(({className:t,...e},r)=>l.jsx(cH,{ref:r,className:fe("absolute right-2 top-2 rounded-md p-1 text-foreground
vendor: 26,445 bytes, line 593
593/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:l.jsx(Wi,{className:"h-4 w-4"})}));zH.displayName=cH.displayName;const UH=x.forwardRef(({className:t,...e},r)=>l.jsx(aH,{ref:r,className:fe("text-sm font-semibold",t),...e}));UH.displayName=aH.displayName;const HH=x.forwardRef(({className:t,...e},r)=>l.jsx(oH,{ref:r,className:fe("text-sm opacity-90",t),...e}));HH.displayName=oH.displayName;function hle(){const{toasts:t}=Qo();return l.jsxs(ule,{children:[t.map(function({id:e,title:r,description:n,action:i,...s}){return l.jsxs(FH,{...s,children:[l.jsxs("div",{className:"grid gap-1",children:[r&&l.jsx(UH,{children:r}),n&&l.jsx(HH,{children:n})]}),i,l.jsx(zH,{})]},e)}),l.jsx(BH,{})]})}var ple=TA[" useId ".trim().toString()]||(()=>{}),mle=0;function tn(t){const[e,r]=x.useState(ple());return hn(()=>{r(n=>n??String(mle++))},[t]),e?`radix-${e}`:""}const gle=["top","right","bottom","left"],yc=Math.min,Bi=Math.max,R0=Math.round,Ix=Math.floor,Ua=t=>({x:t,y:t}),vle={left:"right",right:"left",bottom:"top",top:"bottom"},yle={start:"end",end:"start"};function CE(t,e,r){return Bi(t,yc(e,r))}function Uo(t,e){return typeof t=="function"?t(e):t}function Ho(t){return t.split("-")[0]}function wp(t){return t.split("-")[1]}function BP(t){return t==="x"?"y":"x"}function FP(t){return t==="y"?"height":"width"}const xle=new Set(["top","bottom"]);function La(t){return xle.has(Ho(t))?"y":"x"}function zP(t){return BP(La(t))}function ble(t,e,r){r===void 0&&(r=!1);const n=wp(t),i=zP(t),s=FP(i);let a=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=I0(a)),[a,I0(a)]}function wle(t){const e=I0(t);return[EE(t),e,EE(e)]}function EE(t){return t.replace(/start|end/g,e=>yle[e])}const x$=["left","right"],b$=["right","left"],_le=["top","bottom"],kle=["bottom","top"];function Sle(t,e,r){switch(t){case"top":case"bottom":return r?e?b$:x$:e?x$:b$;case"left":case"right":return e?_le:kle;default:return[]}}function jle(t,e,r,n){const i=wp(t);let s=Sle(Ho(t),r==="start",n);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(EE)))),s}function I0(t){return t.replace(/left|right|bottom|top/g,e=>vle[e])}function Nle(t){return{top:0,right:0,bottom:0,left:0,...t}}function VH(t){return typeof t!="number"?Nle(t):{top:t,right:t,bottom:t,left:t}}function L0(t){const{x:e,y:r,width:n,height:i}=t;return{width:n,height:i,top:r,left:e,right:e+n,bottom:r+i,x:e,y:r}}function w$(t,e,r){let{reference:n,floating:i}=t;const s=La(e),a=zP(e),o=FP(a),c=Ho(e),u=s==="y",d=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,p=n[o]/2-i[o]/2;let m;switch(c){case"top":m={x:d,y:n.y-i.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:f};break;case"left":m={x:n.x-i.width,y:f};break;default:m={x:n.x,y:n.y}}switch(wp(e)){case"start":m[a]-=p*(r&&u?-1:1);break;case"end":m[a]+=p*(r&&u?-1:1);break}return m}const Cle=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:a}=r,o=s.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(e));let u=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:f}=w$(u,n,c),p=n,m={},y=0;for(let v=0;v<o.length;v++){const{name:w,fn:b}=o[v],{x:_,y:S,data:N,reset:j}=await b({x:d,y:f,initialPlacement:n,placement:p,strategy:i,middlewareData:m,rects:u,platform:a,elements:{reference:t,floating:e}});d=_??d,f=S??f,m={...m,[w]:{...m[w],...N}},j&&y<=50&&(y++,typeof j=="object"&&(j.placement&&(p=j.placement),j.rects&&(u=j.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:i}):j.rects),{x:d,y:f}=w$(u,p,c)),v=-1)}return{x:d,y:f,placement:p,strategy:i,middlewareData:m}};async function Zg(t,e){var r;e===void 0&&(e={});const{x:n,y:i,platform:s,rects:a,elements:o,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:m=0}=Uo(e,t),y=VH(m),w=o[p?f==="floating"?"reference":"floating":f],b=L0(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(w)))==null||r?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:u,rootBoundary:d,strategy:c})),_=f==="floating"?{x:n,y:i,width:a.floating.width,height:a.floating.height}:a.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating)),N=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},j=L0(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:_,offsetParent:S,strategy:c}):_);return{top:(b.top-j.top+y.top)/N.y,bottom:(j.bottom-b.bottom+y.bottom)/N.y,left:(b.left-j.left+y.left)/N.x,right:(j.right-b.right+y.right)/N.x}}const Ele=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:s,platform:a,elements:o,middlewareData:c}=e,{element:u,padding:d=0}=Uo(t,e)||{};if(u==null)return{};const f=VH(d),p={x:r,y:n},m=zP(i),y=FP(m),v=await a.getDimensions(u),w=m==="y",b=w?"top":"left",_=w?"bottom":"right",S=w?"clientHeight":"clientWidth",N=s.reference[y]+s.reference[m]-p[m]-s.floating[y],j=p[m]-s.reference[m],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let O=C?C[S]:0;(!O||!await(a.isElement==null?void 0:a.isElement(C)))&&(O=o.floating[S]||s.floating[y]);const P=N/2-j/2,T=O/2-v[y]/2-1,$=yc(f[b],T),B=yc(f[_],T),R=$,M=O-v[y]-B,F=O/2-v[y]/2+P,q=CE(R,F,M),V=!c.arrow&&wp(i)!=null&&F!==q&&s.reference[y]/2-(F<R?$:B)-v[y]/2<0,W=V?F<R?F-R:F-M:0;return{[m]:p[m]+W,data:{[m]:q,centerOffset:F-q-W,...V&&{alignmentOffset:W}},reset:V}}}),Ole=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:i,middlewareData:s,rects:a,initialPlacement:o,platform:c,elements:u}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...w}=Uo(t,e);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const b=Ho(i),_=La(o),S=Ho(o)===o,N=await(c.isRTL==null?void 0:c.isRTL(u.floating)),j=p||(S||!v?[I0(o)]:wle(o)),C=y!=="none";!p&&C&&j.push(...jle(o,v,y,N));const O=[o,...j],P=await Zg(e,w),T=[];let $=((n=s.flip)==null?void 0:n.overflows)||[];if(d&&T.push(P[b]),f){const F=ble(i,a,N);T.push(P[F[0]],P[F[1]])}if($=[...$,{placement:i,overflows:T}],!T.every(F=>F<=0)){var B,R;const F=(((B=s.flip)==null?void 0:B.index)||0)+1,q=O[F];if(q&&(!(f==="alignment"?_!==La(q):!1)||$.every(z=>z.overflows[0]>0&&La(z.placement)===_)))return{data:{index:F,overflows:$},reset:{placement:q}};let V=(R=$.filter(W=>W.overflows[0]<=0).sort((W,z)=>W.overflows[1]-z.overflows[1])[0])==null?void 0:R.placement;if(!V)switch(m){case"bestFit":{var M;const W=(M=$.filter(z=>{if(C){const H=La(z.placement);return H===_||H==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(H=>H>0).reduce((H,G)=>H+G,0)]).sort((z,H)=>z[1]-H[1])[0])==null?void 0:M[0];W&&(V=W);break}case"initialPlacement":V=o;break}if(i!==V)return{reset:{placement:V}}}return{}}}};function _$(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function k$(t){return gle.some(e=>t[e]>=0)}const Tle=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=Uo(t,e);switch(n){case"referenceHidden":{const s=await Zg(e,{...i,elementContext:"reference"}),a=_$(s,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:k$(a)}}}case"escaped":{const s=await Zg(e,{...i,altBoundary:!0}),a=_$(s,r.floating);return{data:{escapedOffsets:a,escaped:k$(a)}}}default:return{}}}}},WH=new Set(["left","top"]);async function Ale(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),a=Ho(r),o=wp(r),c=La(r)==="y",u=WH.has(a)?-1:1,d=s&&c?-1:1,f=Uo(e,t);let{mainAxis:p,crossAxis:m,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return o&&typeof y=="number"&&(m=o==="end"?y*-1:y),c?{x:m*d,y:p*u}:{x:p*u,y:m*d}}const Ple=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:i,y:s,placement:a,middlewareData:o}=e,c=await Ale(e,t);return a===((r=o.offset)==null?void 0:r.placement)&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:a}}}}},Mle=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:o={fn:w=>{let{x:b,y:_}=w;return{x:b,y:_}}},...c}=Uo(t,e),u={x:r,y:n},d=await Zg(e,c),f=La(Ho(i)),p=BP(f);let m=u[p],y=u[f];if(s){const w=p==="y"?"top":"left",b=p==="y"?"bottom":"right",_=m+d[w],S=m-d[b];m=CE(_,m,S)}if(a){const w=f==="y"?"top":"left",b=f==="y"?"bottom":"right",_=y+d[w],S=y-d[b];y=CE(_,y,S)}const v=o.fn({...e,[p]:m,[f]:y});return{...v,data:{x:v.x-r,y:v.y-n,enabled:{[p]:s,[f]:a}}}}}},Rle=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:s,middlewareData:a}=e,{offset:o=0,mainAxis:c=!0,crossAxis:u=!0}=Uo(t,e),d={x:r,y:n},f=La(i),p=BP(f);let m=d[p],y=d[f];const v=Uo(o,e),w=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const S=p==="y"?"height":"width",N=s.reference[p]-s.floating[S]+w.mainAxis,j=s.reference[p]+s.reference[S]-w.mainAxis;m<N?m=N:m>j&&(m=j)}if(u){var b,_;const S=p==="y"?"width":"height",N=WH.has(Ho(i)),j=s.reference[f]-s.floating[S]+(N&&((b=a.offset)==null?void 0:b[f])||0)+(N?0:w.crossAxis),C=s.reference[f]+s.reference[S]+(N?0:((_=a.offset)==null?void 0:_[f])||0)-(N?w.crossAxis:0);y<j?y=j:y>C&&(y=C)}return{[p]:m,[f]:y}}}},Ile=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:i,rects:s,platform:a,elements:o}=e,{apply:c=()=>{},...u}=Uo(t,e),d=await Zg(e,u),f=Ho(i),p=wp(i),m=La(i)==="y",{width:y,height:v}=s.floating;let w,b;f==="top"||f==="bottom"?(w=f,b=p===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(b=f,w=p==="end"?"top":"bottom");const _=v-d.top-d.bottom,S=y-d.left-d.right,N=yc(v-d[w],_),j=yc(y-d[b],S),C=!e.middlewareData.shift;let O=N,P=j;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(P=S),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(O=_),C&&!p){const $=Bi(d.left,0),B=Bi(d.right,0),R=Bi(d.top,0),M=Bi(d.bottom,0);m?P=y-2*($!==0||B!==0?$+B:Bi(d.left,d.right)):O=v-2*(R!==0||M!==0?R+M:Bi(d.top,d.bottom))}await c({...e,availableWidth:P,availableHeight:O});const T=await a.getDimensions(o.floating);return y!==T.width||v!==T.height?{reset:{rects:!0}}:{}}}};function b_(){return typeof window<"u"}function _p(t){return qH(t)?(t.nodeName||"").toLowerCase():"#document"}function Gi(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Qa(t){var e;return(e=(qH(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function qH(t){return b_()?t instanceof Node||t instanceof Gi(t).Node:!1}function fa(t){return b_()?t instanceof Element||t instanceof Gi(t).Element:!1}function Ka(t){return b_()?t instanceof HTMLElement||t instanceof Gi(t).HTMLElement:!1}function S$(t){return!b_()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Gi(t).ShadowRoot}const Lle=new Set(["inline","contents"]);function xy(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=ha(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!Lle.has(i)}const $le=new Set(["table","td","th"]);function Dle(t){return $le.has(_p(t))}const Ble=[":popover-open",":modal"];function w_(t){return Ble.some(e=>{try{return t.matches(e)}catch{return!1}})}const Fle=["transform","translate","scale","rotate","perspective"],zle=["transform","translate","scale","rotate","perspective","filter"],Ule=["paint","layout","strict","content"];function UP(t){const e=HP(),r=fa(t)?ha(t):t;return Fle.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||zle.some(n=>(r.willChange||"").includes(n))||Ule.some(n=>(r.contain||"").includes(n))}function Hle(t){let e=xc(t);for(;Ka(e)&&!jh(e);){if(UP(e))return e;if(w_(e))return null;e=xc(e)}return null}function HP(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Vle=new Set(["html","body","#document"]);function jh(t){return Vle.has(_p(t))}function ha(t){return Gi(t).getComputedStyle(t)}function __(t){return fa(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function xc(t){if(_p(t)==="html")return t;const e=t.assignedSlot||t.parentNode||S$(t)&&t.host||Qa(t);return S$(e)?e.host:e}function KH(t){const e=xc(t);return jh(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ka(e)&&xy(e)?e:KH(e)}function Jg(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=KH(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),a=Gi(i);if(s){const o=OE(a);return e.concat(a,a.visualViewport||[],xy(i)?i:[],o&&r?Jg(o):[])}return e.concat(i,Jg(i,[],r))}function OE(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function GH(t){const e=ha(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=Ka(t),s=i?t.offsetWidth:r,a=i?t.offsetHeight:n,o=R0(r)!==s||R0(n)!==a;return o&&(r=s,n=a),{width:r,height:n,$:o}}function VP(t){return fa(t)?t:t.contextElement}function qf(t){const e=VP(t);if(!Ka(e))return Ua(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=GH(e);let a=(s?R0(r.width):r.width)/n,o=(s?R0(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const Wle=Ua(0);function ZH(t){const e=Gi(t);return!HP()||!e.visualViewport?Wle:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function qle(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Gi(t)?!1:e}function Ju(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=VP(t);let a=Ua(1);e&&(n?fa(n)&&(a=qf(n)):a=qf(t));const o=qle(s,r,n)?ZH(s):Ua(0);let c=(i.left+o.x)/a.x,u=(i.top+o.y)/a.y,d=i.width/a.x,f=i.height/a.y;if(s){const p=Gi(s),m=n&&fa(n)?Gi(n):n;let y=p,v=OE(y);for(;v&&n&&m!==y;){const w=qf(v),b=v.getBoundingClientRect(),_=ha(v),S=b.left+(v.clientLeft+parseFloat(_.paddingLeft))*w.x,N=b.top+(v.clientTop+parseFloat(_.paddingTop))*w.y;c*=w.x,u*=w.y,d*=w.x,f*=w.y,c+=S,u+=N,y=Gi(v),v=OE(y)}}return L0({width:d,height:f,x:c,y:u})}function WP(t,e){const r=__(t).scrollLeft;return e?e.left+r:Ju(Qa(t)).left+r}function JH(t,e,r){r===void 0&&(r=!1);const n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-(r?0:WP(t,n)),s=n.top+e.scrollTop;return{x:i,y:s}}function Kle(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t;const s=i==="fixed",a=Qa(n),o=e?w_(e.floating):!1;if(n===a||o&&s)return r;let c={scrollLeft:0,scrollTop:0},u=Ua(1);const d=Ua(0),f=Ka(n);if((f||!f&&!s)&&((_p(n)!=="body"||xy(a))&&(c=__(n)),Ka(n))){const m=Ju(n);u=qf(n),d.x=m.x+n.clientLeft,d.y=m.y+n.clientTop}const p=a&&!f&&!s?JH(a,c,!0):Ua(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+d.x+p.x,y:r.y*u.y-c.scrollTop*u.y+d.y+p.y}}function Gle(t){return Array.from(t.getClientRects())}function Zle(t){const e=Qa(t),r=__(t),n=t.ownerDocument.body,i=Bi(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=Bi(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+WP(t);const o=-r.scrollTop;return ha(n).direction==="rtl"&&(a+=Bi(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:a,y:o}}function Jle(t,e){const r=Gi(t),n=Qa(t),i=r.visualViewport;let s=n.clientWidth,a=n.clientHeight,o=0,c=0;if(i){s=i.width,a=i.height;const u=HP();(!u||u&&e==="fixed")&&(o=i.offsetLeft,c=i.offsetTop)}return{width:s,height:a,x:o,y:c}}const Yle=new Set(["absolute","fixed"]);function Xle(t,e){const r=Ju(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=Ka(t)?qf(t):Ua(1),a=t.clientWidth*s.x,o=t.clientHeight*s.y,c=i*s.x,u=n*s.y;return{width:a,height:o,x:c,y:u}}function j$(t,e,r){let n;if(e==="viewport")n=Jle(t,r);else if(e==="document")n=Zle(Qa(t));else if(fa(e))n=Xle(e,r);else{const i=ZH(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return L0(n)}function YH(t,e){const r=xc(t);return r===e||!fa(r)||jh(r)?!1:ha(r).position==="fixed"||YH(r,e)}function Qle(t,e){const r=e.get(t);if(r)return r;let n=Jg(t,[],!1).filter(o=>fa(o)&&_p(o)!=="body"),i=null;const s=ha(t).position==="fixed";let a=s?xc(t):t;for(;fa(a)&&!jh(a);){const o=ha(a),c=UP(a);!c&&o.position==="fixed"&&(i=null),(s?!c&&!i:!c&&o.position==="static"&&!!i&&Yle.has(i.position)||xy(a)&&!c&&YH(t,a))?n=n.filter(d=>d!==a):i=o,a=xc(a)}return e.set(t,n),n}function ece(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const a=[...r==="clippingAncestors"?w_(e)?[]:Qle(e,this._c):[].concat(r),n],o=a[0],c=a.reduce((u,d)=>{const f=j$(e,d,i);return u.top=Bi(f.top,u.top),u.right=yc(f.right,u.right),u.bottom=yc(f.bottom,u.bottom),u.left=Bi(f.left,u.left),u},j$(e,o,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function tce(t){const{width:e,height:r}=GH(t);return{width:e,height:r}}function rce(t,e,r){const n=Ka(e),i=Qa(e),s=r==="fixed",a=Ju(t,!0,s,e);let o={scrollLeft:0,scrollTop:0};const c=Ua(0);function u(){c.x=WP(i)}if(n||!n&&!s)if((_p(e)!=="body"||xy(i))&&(o=__(e)),n){const m=Ju(e,!0,s,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}else i&&u();s&&!n&&i&&u();const d=i&&!n&&!s?JH(i,o):Ua(0),f=a.left+o.scrollLeft-c.x-d.x,p=a.top+o.scrollTop-c.y-d.y;return{x:f,y:p,width:a.width,height:a.height}}function Aj(t){return ha(t).position==="static"}function N$(t,e){if(!Ka(t)||ha(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return Qa(t)===r&&(r=r.ownerDocument.body),r}function XH(t,e){const r=Gi(t);if(w_(t))return r;if(!Ka(t)){let i=xc(t);for(;i&&!jh(i);){if(fa(i)&&!Aj(i))return i;i=xc(i)}return r}let n=N$(t,e);for(;n&&Dle(n)&&Aj(n);)n=N$(n,e);return n&&jh(n)&&Aj(n)&&!UP(n)?r:n||Hle(t)||r}const nce=async function(t){const e=this.getOffsetParent||XH,r=this.getDimensions,n=await r(t.floating);return{reference:rce(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function ice(t){return ha(t).direction==="rtl"}const sce={convertOffsetParentRelativeRectToViewportRelativeRect:Kle,getDocumentElement:Qa,getClippingRect:ece,getOffsetParent:XH,getElementRects:nce,getClientRects:Gle,getDimensions:tce,getScale:qf,isElement:fa,isRTL:ice};function QH(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ace(t,e){let r=null,n;const i=Qa(t);function s(){var o;clearTimeout(n),(o=r)==null||o.disconnect(),r=null}function a(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),s();const u=t.getBoundingClientRect(),{left:d,top:f,width:p,height:m}=u;if(o||e(),!p||!m)return;const y=Ix(f),v=Ix(i.clientWidth-(d+p)),w=Ix(i.clientHeight-(f+m)),b=Ix(d),S={rootMargin:-y+"px "+-v+"px "+-w+"px "+-b+"px",threshold:Bi(0,yc(1,c))||1};let N=!0;function j(C){const O=C[0].intersectionRatio;if(O!==c){if(!N)return a();O?a(!1,O):n=setTimeout(()=>{a(!1,1e-7)},1e3)}O===1&&!QH(u,t.getBoundingClientRect())&&a(),N=!1}try{r=new IntersectionObserver(j,{...S,root:i.ownerDocument})}catch{r=new IntersectionObserver(j,S)}r.observe(t)}return a(!0),s}function oce(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=VP(t),d=i||s?[...u?Jg(u):[],...Jg(e)]:[];d.forEach(b=>{i&&b.addEventListener("scroll",r,{passive:!0}),s&&b.addEventListener("resize",r)});const f=u&&o?ace(u,r):null;let p=-1,m=null;a&&(m=new ResizeObserver(b=>{let[_]=b;_&&_.target===u&&m&&(m.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=m)==null||S.observe(e)})),r()}),u&&!c&&m.observe(u),m.observe(e));let y,v=c?Ju(t):null;c&&w();function w(){const b=Ju(t);v&&!QH(v,b)&&r(),v=b,y=requestAnimationFrame(w)}return r(),()=>{var b;d.forEach(_=>{i&&_.removeEventListener("scroll",r),s&&_.removeEventListener("resize",r)}),f==null||f(),(b=m)==null||b.disconnect(),m=null,c&&cancelAnimationFrame(y)}}const lce=Ple,cce=Mle,uce=Ole,dce=Ile,fce=Tle,C$=Ele,hce=Rle,pce=(t,e,r)=>{const n=new Map,i={platform:sce,...r},s={...i.platform,_c:n};return Cle(t,e,{...i,platform:s})};var mce=typeof document<"u",gce=function(){},Fb=mce?x.useLayoutEffect:gce;function $0(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!$0(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&t.$$typeof)&&!$0(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function eV(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function E$(t,e){const r=eV(t);return Math.round(e*r)/r}function Pj(t){const e=x.useRef(t);return Fb(()=>{e.current=t}),e}function vce(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:a}={},transform:o=!0,whileElementsMounted:c,open:u}=t,[d,f]=x.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[p,m]=x.useState(n);$0(p,n)||m(n);const[y,v]=x.useState(null),[w,b]=x.useState(null),_=x.useCallback(z=>{z!==C.current&&(C.current=z,v(z))},[]),S=x.useCallback(z=>{z!==O.current&&(O.current=z,b(z))},[]),N=s||y,j=a||w,C=x.useRef(null),O=x.useRef(null),P=x.useRef(d),T=c!=null,$=Pj(c),B=Pj(i),R=Pj(u),M=x.useCallback(()=>{if(!C.current||!O.current)return;const z={placement:e,strategy:r,middleware:p};B.current&&(z.platform=B.current),pce(C.current,O.current,z).then(H=>{const G={...H,isPositioned:R.current!==!1};F.current&&!$0(P.current,G)&&(P.current=G,Vi.flushSync(()=>{f(G)}))})},[p,e,r,B,R]);Fb(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(z=>({...z,isPositioned:!1})))},[u]);const F=x.useRef(!1);Fb(()=>(F.current=!0,()=>{F.current=!1}),[]),Fb(()=>{if(N&&(C.current=N),j&&(O.current=j),N&&j){if($.current)return $.current(N,j,M);M()}},[N,j,M,$,T]);const q=x.useMemo(()=>({reference:C,floating:O,setReference:_,setFloating:S}),[_,S]),V=x.useMemo(()=>({reference:N,floating:j}),[N,j]),W=x.useMemo(()=>{const z={position:r,left:0,top:0};if(!V.floating)return z;const H=E$(V.floating,d.x),G=E$(V.floating,d.y);return o?{...z,transform:"translate("+H+"px, "+G+"px)",...eV(V.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:H,top:G}},[r,o,V.floating,d.x,d.y]);return x.useMemo(()=>({...d,update:M,refs:q,elements:V,floatingStyles:W}),[d,M,q,V,W])}const yce=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?C$({element:n.current,padding:i}).fn(r):{}:n?C$({element:n,padding:i}).fn(r):{}}}},xce=(t,e)=>({...lce(t),options:[t,e]}),bce=(t,e)=>({...cce(t),options:[t,e]}),wce=(t,e)=>({...hce(t),options:[t,e]}),_ce=(t,e)=>({...uce(t),options:[t,e]}),kce=(t,e)=>({...dce(t),options:[t,e]}),Sce=(t,e)=>({...fce(t),options:[t,e]}),jce=(t,e)=>({...yce(t),options:[t,e]});var Nce="Arrow",tV=x.forwardRef((t,e)=>{const{children:r,width:n=10,height:i=5,...s}=t;return l.jsx(Oe.svg,{...s,ref:e,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});tV.displayName=Nce;var Cce=tV;function qP(t){const[e,r]=x.useState(void 0);return hn(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let a,o;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,o=u.blockSize}else a=t.offsetWidth,o=t.offsetHeight;r({width:a,height:o})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}var KP="Popper",[rV,Ec]=Kn(KP),[Ece,nV]=rV(KP),iV=t=>{const{__scopePopper:e,children:r}=t,[n,i]=x.useState(null);return l.jsx(Ece,{scope:e,anchor:n,onAnchorChange:i,children:r})};iV.displayName=KP;var sV="PopperAnchor",aV=x.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=nV(sV,r),a=x.useRef(null),o=it(e,a);return x.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||a.current)}),n?null:l.jsx(Oe.div,{...i,ref:o})});aV.displayName=sV;var GP="PopperContent",[Oce,Tce]=rV(GP),oV=x.forwardRef((t,e)=>{var oe,_e,ne,ue,be,Q;const{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:y,...v}=t,w=nV(GP,r),[b,_]=x.useState(null),S=it(e,He=>_(He)),[N,j]=x.useState(null),C=qP(N),O=(C==null?void 0:C.width)??0,P=(C==null?void 0:C.height)??0,T=n+(s!=="center"?"-"+s:""),$=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},B=Array.isArray(u)?u:[u],R=B.length>0,M={padding:$,boundary:B.filter(Pce),altBoundary:R},{refs:F,floatingStyles:q,placement:V,isPositioned:W,middlewareData:z}=vce({strategy:"fixed",placement:T,whileElementsMounted:(...He)=>oce(...He,{animationFrame:m==="always"}),elements:{reference:w.anchor},middleware:[xce({mainAxis:i+P,alignmentAxis:a}),c&&bce({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?wce():void 0,...M}),c&&_ce({...M}),kce({...M,apply:({elements:He,rects:Ie,availableWidth:ft,availableHeight:ot})=>{const{width:yt,height:Bt}=Ie.reference,Or=He.floating.style;Or.setProperty("--radix-popper-available-width",`${ft}px`),Or.setProperty("--radix-popper-available-height",`${ot}px`),Or.setProperty("--radix-popper-anchor-width",`${yt}px`),Or.setProperty("--radix-popper-anchor-height",`${Bt}px`)}}),N&&jce({element:N,padding:o}),Mce({arrowWidth:O,arrowHeight:P}),p&&Sce({strategy:"referenceHidden",...M})]}),[H,G]=uV(V),Y=Ci(y);hn(()=>{W&&(Y==null||Y())},[W,Y]);const U=(oe=z.arrow)==null?void 0:oe.x,J=(_e=z.arrow)==null?void 0:_e.y,te=((ne=z.arrow)==null?void 0:ne.centerOffset)!==0,[re,ae]=x.use
vendor: 4,206 bytes, line 593
593State();return hn(()=>{b&&ae(window.getComputedStyle(b).zIndex)},[b]),l.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:W?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(ue=z.transformOrigin)==null?void 0:ue.x,(be=z.transformOrigin)==null?void 0:be.y].join(" "),...((Q=z.hide)==null?void 0:Q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:l.jsx(Oce,{scope:r,placedSide:H,onArrowChange:j,arrowX:U,arrowY:J,shouldHideArrow:te,children:l.jsx(Oe.div,{"data-side":H,"data-align":G,...v,ref:S,style:{...v.style,animation:W?void 0:"none"}})})})});oV.displayName=GP;var lV="PopperArrow",Ace={top:"bottom",right:"left",bottom:"top",left:"right"},cV=x.forwardRef(function(e,r){const{__scopePopper:n,...i}=e,s=Tce(lV,n),a=Ace[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(Cce,{...i,ref:r,style:{...i.style,display:"block"}})})});cV.displayName=lV;function Pce(t){return t!==null}var Mce=t=>({name:"transformOrigin",options:t,fn(e){var w,b,_;const{placement:r,rects:n,middlewareData:i}=e,a=((w=i.arrow)==null?void 0:w.centerOffset)!==0,o=a?0:t.arrowWidth,c=a?0:t.arrowHeight,[u,d]=uV(r),f={start:"0%",center:"50%",end:"100%"}[d],p=(((b=i.arrow)==null?void 0:b.x)??0)+o/2,m=(((_=i.arrow)==null?void 0:_.y)??0)+c/2;let y="",v="";return u==="bottom"?(y=a?f:`${p}px`,v=`${-c}px`):u==="top"?(y=a?f:`${p}px`,v=`${n.floating.height+c}px`):u==="right"?(y=`${-c}px`,v=a?f:`${m}px`):u==="left"&&(y=`${n.floating.width+c}px`,v=a?f:`${m}px`),{data:{x:y,y:v}}}});function uV(t){const[e,r="center"]=t.split("-");return[e,r]}var k_=iV,by=aV,S_=oV,j_=cV,[N_,LZe]=Kn("Tooltip",[Ec]),C_=Ec(),dV="TooltipProvider",Rce=700,TE="tooltip.open",[Ice,ZP]=N_(dV),fV=t=>{const{__scopeTooltip:e,delayDuration:r=Rce,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:s}=t,a=x.useRef(!0),o=x.useRef(!1),c=x.useRef(0);return x.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(Ice,{scope:e,isOpenDelayedRef:a,delayDuration:r,onOpen:x.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,n)},[n]),isPointerInTransitRef:o,onPointerInTransitChange:x.useCallback(u=>{o.current=u},[]),disableHoverableContent:i,children:s})};fV.displayName=dV;var Yg="Tooltip",[Lce,E_]=N_(Yg),hV=t=>{const{__scopeTooltip:e,children:r,open:n,defaultOpen:i,onOpenChange:s,disableHoverableContent:a,delayDuration:o}=t,c=ZP(Yg,t.__scopeTooltip),u=C_(e),[d,f]=x.useState(null),p=tn(),m=x.useRef(0),y=a??c.disableHoverableContent,v=o??c.delayDuration,w=x.useRef(!1),[b,_]=Yi({prop:n,defaultProp:i??!1,onChange:O=>{O?(c.onOpen(),document.dispatchEvent(new CustomEvent(TE))):c.onClose(),s==null||s(O)},caller:Yg}),S=x.useMemo(()=>b?w.current?"delayed-open":"instant-open":"closed",[b]),N=x.useCallback(()=>{window.clearTimeout(m.current),m.current=0,w.current=!1,_(!0)},[_]),j=x.useCallback(()=>{window.clearTimeout(m.current),m.current=0,_(!1)},[_]),C=x.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{w.current=!0,_(!0),m.current=0},v)},[v,_]);return x.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),l.jsx(k_,{...u,children:l.jsx(Lce,{scope:e,contentId:p,open:b,stateAttribute:S,trigger:d,onTriggerChange:f,onTriggerEnter:x.useCallback(()=>{c.isOpenDelayedRef.current?C():N()},[c.isOpenDelayedRef,C,N]),onTriggerLeave:x.useCallback(()=>{y?j():(window.clearTimeout(m.current),m.current=0)},[j,y]),onOpen:N,onClose:j,disableHoverableContent:y,children:r})})};hV.displayName=Yg;var AE="TooltipTrigger",pV=x.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,i=E_(AE,r),s=ZP(AE,r),a=C_(r),o=x.useRef(null),c=it(e,o,i.onTriggerChange),u=
vendor: 5,550 bytes, line 593
593x.useRef(!1),d=x.useRef(!1),f=x.useCallback(()=>u.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),l.jsx(by,{asChild:!0,...a,children:l.jsx(Oe.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...n,ref:c,onPointerMove:we(t.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:we(t.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:we(t.onPointerDown,()=>{i.open&&i.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:we(t.onFocus,()=>{u.current||i.onOpen()}),onBlur:we(t.onBlur,i.onClose),onClick:we(t.onClick,i.onClose)})})});pV.displayName=AE;var $ce="TooltipPortal",[$Ze,Dce]=N_($ce,{forceMount:void 0}),Nh="TooltipContent",mV=x.forwardRef((t,e)=>{const r=Dce(Nh,t.__scopeTooltip),{forceMount:n=r.forceMount,side:i="top",...s}=t,a=E_(Nh,t.__scopeTooltip);return l.jsx(di,{present:n||a.open,children:a.disableHoverableContent?l.jsx(gV,{side:i,...s,ref:e}):l.jsx(Bce,{side:i,...s,ref:e})})}),Bce=x.forwardRef((t,e)=>{const r=E_(Nh,t.__scopeTooltip),n=ZP(Nh,t.__scopeTooltip),i=x.useRef(null),s=it(e,i),[a,o]=x.useState(null),{trigger:c,onClose:u}=r,d=i.current,{onPointerInTransitChange:f}=n,p=x.useCallback(()=>{o(null),f(!1)},[f]),m=x.useCallback((y,v)=>{const w=y.currentTarget,b={x:y.clientX,y:y.clientY},_=Vce(b,w.getBoundingClientRect()),S=Wce(b,_),N=qce(v.getBoundingClientRect()),j=Gce([...S,...N]);o(j),f(!0)},[f]);return x.useEffect(()=>()=>p(),[p]),x.useEffect(()=>{if(c&&d){const y=w=>m(w,d),v=w=>m(w,c);return c.addEventListener("pointerleave",y),d.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",y),d.removeEventListener("pointerleave",v)}}},[c,d,m,p]),x.useEffect(()=>{if(a){const y=v=>{const w=v.target,b={x:v.clientX,y:v.clientY},_=(c==null?void 0:c.contains(w))||(d==null?void 0:d.contains(w)),S=!Kce(b,a);_?p():S&&(p(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,d,a,u,p]),l.jsx(gV,{...t,ref:s})}),[Fce,zce]=N_(Yg,{isInside:!1}),Uce=FU("TooltipContent"),gV=x.forwardRef((t,e)=>{const{__scopeTooltip:r,children:n,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:a,...o}=t,c=E_(Nh,r),u=C_(r),{onClose:d}=c;return x.useEffect(()=>(document.addEventListener(TE,d),()=>document.removeEventListener(TE,d)),[d]),x.useEffect(()=>{if(c.trigger){const f=p=>{const m=p.target;m!=null&&m.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),l.jsx(vd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:l.jsxs(S_,{"data-state":c.stateAttribute,...u,...o,ref:e,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(Uce,{children:n}),l.jsx(Fce,{scope:r,isInside:!0,children:l.jsx(wae,{id:c.contentId,role:"tooltip",children:i||n})})]})})});mV.displayName=Nh;var vV="TooltipArrow",Hce=x.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,i=C_(r);return zce(vV,r).isInside?null:l.jsx(j_,{...i,...n,ref:e})});Hce.displayName=vV;function Vce(t,e){const r=Math.abs(e.top-t.y),n=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(r,n,i,s)){case s:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Wce(t,e,r=5){const n=[];switch(e){case"top":n.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":n.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":n.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":n.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return n}function qce(t){const{top:e,right:r,bottom:n,left:i}=t;return[{x:i,y:e},{x:r,y:e},{x:r,y:n},{x:i,y:n}]}function Kce(t,e){const{x:r,y:n}=t;let i=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const o=e[s],c=e[a],u=o.x,d=o.y,f=c.x,p=c.y;d>n!=p>n&&r<(f-u)*(n-d)/(p-d)+u&&(i=!i)}return i}function Gce(t){const e=t.slice();return e.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),Zce(e)}function Zce(t){if(t.length<=1)return t.slice();const e=[];for(let n=0;n<t.length;n++){const i=t[n];for(;e.length>=2;){const s=e[e.length-1],a=e[e.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))e.pop();else break}e.push(i)}e.pop();const r=[];for(let n=t.length-1;n>=0;n--){const i=t[n];for(;r.length>=2;){const s=r[r.length-1],a=r[r.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))r.pop();else break}r.push(i)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}var Jce=fV,Yce=hV,Xce=pV,yV=mV;const xV=Jce,Qce=Yce,eue=Xce,bV=x.forwardRef(({className:t,sideOffset:e=4,...r},n)=>l.jsx(yV,{ref:n,sideOffset:e,className:fe("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]:sli
593de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r}));bV.displayName=yV.displayName;const Ze=t=>typeof t=="string",mm=()=>{let t,e;const r=new Promise((n,i)=>{t=n,e=i});return r.resolve=t,r.reject=e,r},O$=t=>t==null?"":String(t),tue=(t,e,r)=>{t.forEach(n=>{e[n]&&(r[n]=e[n])})},rue=/###/g,T$=t=>t&&t.includes("###")?t.replace(rue,"."):t,A$=t=>!t||Ze(t),ng=(t,e,r)=>{const n=Ze(e)?e.split("."):e;let i=0;for(;i<n.length-1;){if(A$(t))return{};const s=T$(n[i]);!t[s]&&r&&(t[s]=new r),Object.prototype.hasOwnProperty.call(t,s)?t=t[s]:t={},++i}return A$(t)?{}:{obj:t,k:T$(n[i])}},P$=(t,e,r)=>{const{obj:n,k:i}=ng(t,e,Object);if(n!==void 0||e.length===1){n[i]=r;return}let s=e[e.length-1],a=e.slice(0,e.length-1),o=ng(t,a,Object);for(;o.obj===void 0&&a.length;)s=`${a[a.length-1]}.${s}`,a=a.slice(0,a.length-1),o=ng(t,a,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${s}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${s}`]=r},nue=(t,e,r,n)=>{const{obj:i,k:s}=ng(t,e,Object);i[s]=i[s]||[],i[s].push(r)},D0=(t,e)=>{const{obj:r,k:n}=ng(t,e);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},iue=(t,e,r)=>{const n=D0(t,r);return n!==void 0?n:D0(e,r)},wV=(t,e,r)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in t?Ze(t[n])||t[n]instanceof String||Ze(e[n])||e[n]instanceof String?r&&(t[n]=e[n]):wV(t[n],e[n],r):t[n]=e[n]);return t},Qc=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),sue={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},aue=t=>Ze(t)?t.replace(/[&<>"'\/]/g,e=>sue[e]):t;class oue{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const r=this.regExpMap.get(e);if(r!==void 0)return r;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const lue=[" ",",","?","!",";"],cue=new oue(20),uue=(t,e,r)=>{e=e||"",r=r||"";const n=lue.filter(a=>!e.includes(a)&&!r.includes(a));if(n.length===0)return!0;const i=cue.getRegExp(`(${n.map(a=>a==="?"?"\\?":a).join("|")})`);let s=!i.test(t);if(!s){const a=t.indexOf(r);a>0&&!i.test(t.substring(0,a))&&(s=!0)}return s},PE=(t,e,r=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const n=e.split(r);let i=t;for(let s=0;s<n.length;){if(!i||typeof i!="object")return;let a,o="";for(let c=s;c<n.length;++c)if(c!==s&&(o+=r),o+=n[c],a=i[o],a!==void 0){if(["string","number","boolean"].includes(typeof a)&&c<n.length-1)continue;s+=c-s+1;break}i=a}return i},Xg=t=>t==null?void 0:t.replace(/_/g,"-"),due={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var r,n;(n=(r=console==null?void 0:console[t])==null?void 0:r.apply)==null||n.call(r,console,e)}};class B0{constructor(e,r={}){this.init(e,r)}init(e,r={}){this.prefix=r.prefix||"i18next:",this.logger=e||due,this.options=r,this.debug=r.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,r,n,i){return i&&!this.debug?null:(Ze(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[r](e))}create(e){return new B0(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new B0(this.logger,e)}}var $a=new B0;let O_=class{constructor(){this.observers={}}on(e,r){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const i=this.observers[n].get(r)||0;this.observers[n].set(r,i+1)}),this}off(e,r){if(this.observers[e]){if(!r){delete this.observers[e];return}this.observers[e].delete(r)}}once(e,r){const n=(...i)=>{r(...i),this.off(e,n)};return this.on(e,n),this}emit(e,...r){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([i,s])=>{for(let a=0;a<s;a++)i(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,s])=>{for(let a=0;a<s;a++)i(e,...r)})}};class M$ extends O_{constructor(e,r={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){const r=this.options.ns.indexOf(e);r>-1&&this.options.ns.splice(r,1)}getResource(e,r,n,i={}){var u,d;const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.includes(".")?o=e.split("."):(o=[e,r],n&&(Array.isArray(n)?o.push(...n):Ze(n)&&s?o.push(...n.split(s)):o.push(n)));const c=D0(this.data,o);return!c&&!r&&!n&&e.includes(".")&&(e=o[0],r=o[1],n=o.slice(2).join(".")),c||!a||!Ze(n)?c:PE((d=(u=this.data)==null?void 0:u[e])==null?void 0:d[r],n,s)}addResource(e,r,n,i,s={silent:!1}){const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let o=[e,r];
vendor: 2,017 bytes, line 593
593n&&(o=o.concat(a?n.split(a):n)),e.includes(".")&&(o=e.split("."),i=r,r=o[1]),this.addNamespaces(r),P$(this.data,o,i),s.silent||this.emit("added",e,r,n,i)}addResources(e,r,n,i={silent:!1}){for(const s in n)(Ze(n[s])||Array.isArray(n[s]))&&this.addResource(e,r,s,n[s],{silent:!0});i.silent||this.emit("added",e,r,n)}addResourceBundle(e,r,n,i,s,a={silent:!1,skipCopy:!1}){let o=[e,r];e.includes(".")&&(o=e.split("."),i=n,n=r,r=o[1]),this.addNamespaces(r);let c=D0(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?wV(c,n,s):c={...c,...n},P$(this.data,o,c),a.silent||this.emit("added",e,r,n)}removeResourceBundle(e,r){this.hasResourceBundle(e,r)&&delete this.data[e][r],this.removeNamespaces(r),this.emit("removed",e,r)}hasResourceBundle(e,r){return this.getResource(e,r)!==void 0}getResourceBundle(e,r){return r||(r=this.options.defaultNS),this.getResource(e,r)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const r=this.getDataByLanguage(e);return!!(r&&Object.keys(r)||[]).find(i=>r[i]&&Object.keys(r[i]).length>0)}toJSON(){return this.data}}var _V={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,r,n,i){return t.forEach(s=>{var a;e=((a=this.processors[s])==null?void 0:a.process(e,r,n,i))??e}),e}};const kV=Symbol("i18next/PATH_KEY");function fue(){const t=[],e=Object.create(null);let r;return e.get=(n,i)=>{var s;return(s=r==null?void 0:r.revoke)==null||s.call(r),i===kV?t:(t.push(i),r=Proxy.revocable(n,e),r.proxy)},Proxy.revocable(Object.create(null),e).proxy}function Kf(t,e){const{[kV]:r}=t(fue()),n=(e==null?void 0:e.keySeparator)??".",i=(e==null?void 0:e.nsSeparator)??":";if(r.length>1&&i){const s=e==null?void 0:e.ns,a=Array.isArray(s)?s:null;if(a&&a.length>1&&a.slice(1).includes(r[0]))return`${r[0]}${i}${r.slice(1).join(n)}`}return r.join(n)}const Mj=t=>!Ze(t)&&typeof t!="boolean"&&typeof t!="number";class F0 extends O_{constructor(e,r={}){super(),tue(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
593i18nFormat","utils"],e,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=$a.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,r={interpolation:{}}){const n={...r};if(e==null)return!1;const i=this.resolve(e,n);if((i==null?void 0:i.res)===void 0)return!1;const s=Mj(i.res);return!(n.returnObjects===!1&&s)}extractFromKey(e,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let s=r.ns||this.options.defaultNS||[];const a=n&&e.includes(n),o=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!uue(e,n,i);if(a&&!o){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:Ze(s)?[s]:s};const u=e.split(n);(n!==i||n===i&&this.options.ns.includes(u[0]))&&(s=u.shift()),e=u.join(i)}return{key:e,namespaces:Ze(s)?[s]:s}}translate(e,r,n){let i=typeof r=="object"?{...r}:r;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),e==null)return"";typeof e=="function"&&(e=Kf(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map(M=>typeof M=="function"?Kf(M,{...this.options,...i}):String(M));const s=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:o,namespaces:c}=this.extractFromKey(e[e.length-1],i),u=c[c.length-1];let d=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const f=i.lng||this.language,p=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return p?s?{res:`${u}${d}${o}`,usedKey:o,exactUsedKey:o,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:`${u}${d}${o}`:s?{res:o,usedKey:o,exactUsedKey:o,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:o;const m=this.resolve(e,i);let y=m==null?void 0:m.res;const v=(m==null?void 0:m.usedKey)||o,w=(m==null?void 0:m.exactUsedKey)||o,b=["[object Number]","[object Function]","[object RegExp]"],_=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,S=!this.i18nFormat||this.i18nFormat.handleAsObject,N=i.count!==void 0&&!Ze(i.count),j=F0.hasDefaultValue(i),C=N?this.pluralResolver.getSuffix(f,i.count,i):"",O=i.ordinal&&N?this.pluralResolver.getSuffix(f,i.count,{ordinal:!1}):"",P=N&&!i.ordinal&&i.count===0,T=P&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${C}`]||i[`defaultValue${O}`]||i.defaultValue;let $=y;S&&!y&&j&&($=T);const B=Mj($),R=Object.prototype.toString.apply($);if(S&&$&&B&&!b.includes(R)&&!(Ze(_)&&Array.isArray($))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const M=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,$,{...i,ns:c}):`key '${o} (${this.language})' returned an object instead of string.`;return s?(m.res=M,m.usedParams=this.getUsedParamsDetails(i),m):M}if(a){const M=Array.isArray($),F=M?[]:{},q=M?w:v;for(const V in $)if(Object.prototype.hasOwnProperty.call($,V)){const W=`${q}${a}${V}`;j&&!y?F[V]=this.translate(W,{...i,defaultValue:Mj(T)?T[V]:void 0,joinArrays:!1,ns:c}):F[V]=this.translate(W,{...i,joinArrays:!1,ns:c}),F[V]===W&&(F[V]=$[V])}y=F}}else if(S&&Ze(_)&&Array.isArray(y))y=y.join(_),y&&(y=this.extendTranslation(y,e,i,n));else{let M=!1,F=!1;!this.isValidLookup(y)&&j&&(M=!0,y=T),this.isValidLookup(y)||(F=!0,y=o);const V=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&F?void 0:y,W=j&&T!==y&&this.options.updateMissing;if(F||M||W){if(this.logger.log(W?"updateKey":"missingKey",f,u,o,W?T:y),a){const Y=this.resolve(o,{...i,keySeparator:!1});Y&&Y.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let z=[];const H=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&H&&H[0])for(let Y=0;Y<H.length;Y++)z.push(H[Y]);else this.options.saveMissingTo==="all"?z=this.languageUtils.toResolveHierarchy(i.lng||this.language):z.push(i.lng||this.language);const G=(Y,U,J)=>{var re;const te=j&&J!==y?J:V;this.options.missingKeyHandler?this.options.missingKeyHandler(Y,u,U,te,W,i):(re=this.backendConnector)!=null&&re.saveMissing&&this.backendConnector.saveMissing(Y,u,U,te,W,i),this.emit
vendor: 28,574 bytes, line 593
593("missingKey",Y,u,U,y)};this.options.saveMissing&&(this.options.saveMissingPlurals&&N?z.forEach(Y=>{const U=this.pluralResolver.getSuffixes(Y,i);P&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!U.includes(`${this.options.pluralSeparator}zero`)&&U.push(`${this.options.pluralSeparator}zero`),U.forEach(J=>{G([Y],o+J,i[`defaultValue${J}`]||T)})}):G(z,o,T))}y=this.extendTranslation(y,e,i,m,n),F&&y===o&&this.options.appendNamespaceToMissingKey&&(y=`${u}${d}${o}`),(F||M)&&this.options.parseMissingKeyHandler&&(y=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${o}`:o,M?y:void 0,i))}return s?(m.res=y,m.usedParams=this.getUsedParamsDetails(i),m):y}extendTranslation(e,r,n,i,s){var c,u;if((c=this.i18nFormat)!=null&&c.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const d=Ze(e)&&(((u=n==null?void 0:n.interpolation)==null?void 0:u.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const m=e.match(this.interpolator.nestingRegexp);f=m&&m.length}let p=n.replace&&!Ze(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),e=this.interpolator.interpolate(e,p,n.lng||this.language||i.usedLng,n),d){const m=e.match(this.interpolator.nestingRegexp),y=m&&m.length;f<y&&(n.nest=!1)}!n.lng&&i&&i.res&&(n.lng=this.language||i.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...m)=>(s==null?void 0:s[0])===m[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${r[0]}`),null):this.translate(...m,r),n)),n.interpolation&&this.interpolator.reset()}const a=n.postProcess||this.options.postProcess,o=Ze(a)?[a]:a;return e!=null&&(o!=null&&o.length)&&n.applyPostProcessor!==!1&&(e=_V.handle(o,e,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,r={}){let n,i,s,a,o;return Ze(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(c=>typeof c=="function"?Kf(c,{...this.options,...r}):c)),e.forEach(c=>{if(this.isValidLookup(n))return;const u=this.extractFromKey(c,r),d=u.key;i=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const p=r.count!==void 0&&!Ze(r.count),m=p&&!r.ordinal&&r.count===0,y=r.context!==void 0&&(Ze(r.context)||typeof r.context=="number")&&r.context!=="",v=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);f.forEach(w=>{var b,_;this.isValidLookup(n)||(o=w,!this.checkedLoadedFor[`${v[0]}-${w}`]&&((b=this.utils)!=null&&b.hasLoadedNamespace)&&!((_=this.utils)!=null&&_.hasLoadedNamespace(o))&&(this.checkedLoadedFor[`${v[0]}-${w}`]=!0,this.logger.warn(`key "${i}" for languages "${v.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),v.forEach(S=>{var C;if(this.isValidLookup(n))return;a=S;const N=[d];if((C=this.i18nFormat)!=null&&C.addLookupKeys)this.i18nFormat.addLookupKeys(N,d,S,w,r);else{let O;p&&(O=this.pluralResolver.getSuffix(S,r.count,r));const P=`${this.options.pluralSeparator}zero`,T=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(r.ordinal&&O.startsWith(T)&&N.push(d+O.replace(T,this.options.pluralSeparator)),N.push(d+O),m&&N.push(d+P)),y){const $=`${d}${this.options.contextSeparator||"_"}${r.context}`;N.push($),p&&(r.ordinal&&O.startsWith(T)&&N.push($+O.replace(T,this.options.pluralSeparator)),N.push($+O),m&&N.push($+P))}}let j;for(;j=N.pop();)this.isValidLookup(n)||(s=j,n=this.getResource(S,w,j,r))}))})}),{res:n,usedKey:i,exactUsedKey:s,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,r,n,i={}){var s;return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(e,r,n,i):this.resourceStore.getResource(e,r,n,i)}getUsedParamsDetails(e={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!Ze(e.replace);let i=n?e.replace:e;if(n&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const s of r)delete i[s]}return i}static hasDefaultValue(e){const r="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&n.startsWith(r)&&e[n]!==void 0)return!0;return!1}}class R${constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=$a.create("languageUtils")}getScriptPartFromCode(e){if(e=Xg(e),!e||!e.includes("-"))return null;const r=e.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(e){if(e=Xg(e),!e||!e.includes("-"))return e;const r=e.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(e){if(Ze(e)&&e.includes("-")){let r;try{r=Intl.getCanonicalLocales(e)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let r;return e.forEach(n=>{if(r)return;const i=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(i))&&(r=i)}),!r&&this.options.supportedLngs&&e.forEach(n=>{if(r)return;const i=this.getScriptPartFromCode(n);if(this.isSupportedCode(i))return r=i;const s=this.getLanguagePartFromCode(n);if(this.isSupportedCode(s))return r=s;r=this.options.supportedLngs.find(a=>a===s?!0:!a.includes("-")&&!s.includes("-")?!1:!!(a.includes("-")&&!s.includes("-")&&a.slice(0,a.indexOf("-"))===s||a.startsWith(s)&&s.length>1))}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(e,r){if(!e)return[];if(typeof e=="function"&&(e=e(r)),Ze(e)&&(e=[e]),Array.isArray(e))return e;if(!r)return e.default||[];let n=e[r];return n||(n=e[this.getScriptPartFromCode(r)]),n||(n=e[this.formatLanguageCode(r)]),n||(n=e[this.getLanguagePartFromCode(r)]),n||(n=e.default),n||[]}toResolveHierarchy(e,r){const n=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],e),i=[],s=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return Ze(e)&&(e.includes("-")||e.includes("_"))?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(e))):Ze(e)&&s(this.formatLanguageCode(e)),n.forEach(a=>{i.includes(a)||s(this.formatLanguageCode(a))}),i}}const I$={zero:0,one:1,two:2,few:3,many:4,other:5},L$={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class hue{constructor(e,r={}){this.languageUtils=e,this.options=r,this.logger=$a.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,r={}){const n=Xg(e==="dev"?"en":e),i=r.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:n,type:i});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let a;try{a=new Intl.PluralRules(n,{type:i})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),L$;if(!e.match(/-|_/))return L$;const c=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(c,r)}return this.pluralRulesCache[s]=a,a}needsPlural(e,r={}){let n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,r,n={}){return this.getSuffixes(e,n).map(i=>`${r}${i}`)}getSuffixes(e,r={}){let n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),n?n.resolvedOptions().pluralCategories.sort((i,s)=>I$[i]-I$[s]).map(i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,r,n={}){const i=this.getRule(e,n);return i?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(r)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",r,n))}}const $$=(t,e,r,n=".",i=!0)=>{let s=iue(t,e,r);return!s&&i&&Ze(r)&&(s=PE(t,r,n),s===void 0&&(s=PE(e,r,n))),s},Rj=t=>t.replace(/\$/g,"$$$$");class D${constructor(e={}){var r;this.logger=$a.create("interpolator"),this.options=e,this.format=((r=e==null?void 0:e.interpolation)==null?void 0:r.format)||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:r,escapeValue:n,useRawValueToEscape:i,prefix:s,prefixEscaped:a,suffix:o,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:p,nestingPrefixEscaped:m,nestingSuffix:y,nestingSuffixEscaped:v,nestingOptionsSeparator:w,maxReplaces:b,alwaysFormat:_}=e.interpolation;this.escape=r!==void 0?r:aue,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=s?Qc(s):a||"{{",this.suffix=o?Qc(o):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=p?Qc(p):m||Qc("$t("),this.nestingSuffix=y?Qc(y):v||Qc(")"),this.nestingOptionsSeparator=w||",",this.maxReplaces=b||1e3,this.alwaysFormat=_!==void 0?_:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(r,n)=>(r==null?void 0:r.source)===n?(r.lastIndex=0,r):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,r,n,i){var m;let s,a,o;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=y=>{if(!y.includes(this.formatSeparator)){const _=$$(r,c,y,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(_,void 0,n,{...i,...r,interpolationkey:y}):_}const v=y.split(this.formatSeparator),w=v.shift().trim(),b=v.join(this.formatSeparator).trim();return this.format($$(r,c,w,this.options.keySeparator,this.options.ignoreJSONStructure),b,n,{...i,...r,interpolationkey:w})};this.resetRegExp();const d=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((m=i==null?void 0:i.interpolation)==null?void 0:m.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:y=>Rj(y)},{regex:this.regexp,safeValue:y=>this.escapeValue?Rj(this.escape(y)):Rj(y)}].forEach(y=>{for(o=0;s=y.regex.exec(e);){const v=s[1].trim();if(a=u(v),a===void 0)if(typeof d=="function"){const b=d(e,s,i);a=Ze(b)?b:""}else if(i&&Object.prototype.hasOwnProperty.call(i,v))a="";else if(f){a=s[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${e}`),a="";else!Ze(a)&&!this.useRawValueToEscape&&(a=O$(a));const w=y.safeValue(a);if(e=e.replace(s[0],w),f?(y.regex.lastIndex+=a.length,y.regex.lastIndex-=s[0].length):y.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,r,n={}){let i,s,a;const o=(c,u)=>{const d=this.nestingOptionsSeparator;if(!c.includes(d))return c;const f=c.split(new RegExp(`${Qc(d)}[ ]*{`));let p=`{${f[1]}`;c=f[0],p=this.interpolate(p,a);const m=p.match(/'/g),y=p.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!y||((y==null?void 0:y.length)??0)%2!==0)&&(p=p.replace(/'/g,'"'));try{a=JSON.parse(p),u&&(a={...u,...a})}catch(v){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,v),`${c}${d}${p}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,c};for(;i=this.nestingRegexp.exec(e);){let c=[];a={...n},a=a.replace&&!Ze(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const u=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(u!==-1&&(c=i[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),i[1]=i[1].slice(0,u)),s=r(o.call(this,i[1].trim(),a),a),s&&i[0]===e&&!Ze(s))return s;Ze(s)||(s=O$(s)),s||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),s=""),c.length&&(s=c.reduce((d,f)=>this.format(d,f,n.lng,{...n,interpolationkey:i[1].trim()}),s.trim())),e=e.replace(i[0],s),this.regexp.lastIndex=0}return e}}const pue=t=>{let e=t.toLowerCase().trim();const r={};if(t.includes("(")){const n=t.split("(");e=n[0].toLowerCase().trim();const i=n[1].slice(0,-1);e==="currency"&&!i.includes(":")?r.currency||(r.currency=i.trim()):e==="relativetime"&&!i.includes(":")?r.range||(r.range=i.trim()):i.split(";").forEach(a=>{if(a){const[o,...c]=a.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=o.trim();r[d]||(r[d]=u),u==="false"&&(r[d]=!1),u==="true"&&(r[d]=!0),isNaN(u)||(r[d]=parseInt(u,10))}})}return{formatName:e,formatOptions:r}},B$=t=>{const e={};return(r,n,i)=>{let s=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(s={...s,[i.interpolationkey]:void 0});const a=n+JSON.stringify(s);let o=e[a];return o||(o=t(Xg(n),i),e[a]=o),o(r)}},mue=t=>(e,r,n)=>t(Xg(r),n)(e);class gue{constructor(e={}){this.logger=$a.create("formatter"),this.options=e,this.init(e)}init(e,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const n=r.cacheInBuiltFormats?B$:mue;this.formats={number:n((i,s)=>{const a=new Intl.NumberFormat(i,{...s});return o=>a.format(o)}),currency:n((i,s)=>{const a=new Intl.NumberFormat(i,{...s,style:"currency"});return o=>a.format(o)}),datetime:n((i,s)=>{const a=new Intl.DateTimeFormat(i,{...s});return o=>a.format(o)}),relativetime:n((i,s)=>{const a=new Intl.RelativeTimeFormat(i,{...s});return o=>a.format(o,s.range||"day")}),list:n((i,s)=>{const a=new Intl.ListFormat(i,{...s});return o=>a.format(o)})}}add(e,r){this.formats[e.toLowerCase().trim()]=r}addCached(e,r){this.formats[e.toLowerCase().trim()]=B$(r)}format(e,r,n,i={}){if(!r||e==null)return e;const s=r.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&!s[0].includes(")")&&s.find(o=>o.includes(")"))){const o=s.findIndex(c=>c.includes(")"));s[0]=[s[0],...s.splice(1,o)].join(this.formatSeparator)}return s.reduce((o,c)=>{var f;const{formatName:u,formatOptions:d}=pue(c);if(this.formats[u]){let p=o;try{const m=((f=i==null?void 0:i.formatParams)==null?void 0:f[i.interpolationkey])||{},y=m.locale||m.lng||i.locale||i.lng||n;p=this.formats[u](o,y,{...d,...i,...m})}catch(m){this.logger.warn(m)}return p}else this.logger.warn(`there was no format function for ${u}`);return o},e)}}const vue=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class yue extends O_{constructor(e,r,n,i={}){var s,a;super(),this.backend=e,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=$a.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(a=(s=this.backend)==null?void 0:s.init)==null||a.call(s,n,i.backend,i)}queueLoad(e,r,n,i){const s={},a={},o={},c={};return e.forEach(u=>{let d=!0;r.forEach(f=>{const p=`${u}|${f}`;!n.reload&&this.store.hasResourceBundle(u,f)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?a[p]===void 0&&(a[p]=!0):(this.state[p]=1,d=!1,a[p]===void 0&&(a[p]=!0),s[p]===void 0&&(s[p]=!0),c[f]===void 0&&(c[f]=!0)))}),d||(o[u]=!0)}),(Object.keys(s).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(s),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(c)}}loaded(e,r,n){const i=e.split("|"),s=i[0],a=i[1];r&&this.emit("failedLoading",s,a,r),!r&&n&&this.store.addResourceBundle(s,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=r?-1:2,r&&n&&(this.state[e]=0);const o={};this.queue.forEach(c=>{nue(c.loaded,[s],a),vue(c,e),r&&c.errors.push(r),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{o[u]||(o[u]={});const d=c.loaded[u];d.length&&d.forEach(f=>{o[u][f]===void 0&&(o[u][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(c=>!c.done)}read(e,r,n,i=0,s=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:r,fcName:n,tried:i,wait:s,callback:a});return}this.readingCalls++;const o=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&i<this.maxRetries){setTimeout(()=>{this.read(e,r,n,i+1,s*2,a)},s);return}a(u,d)},c=this.backend[n].bind(this.backend);if(c.length===2){try{const u=c(e,r);u&&typeof u.then=="function"?u.then(d=>o(null,d)).catch(o):o(null,u)}catch(u){o(u)}return}return c(e,r,o)}prepareLoading(e,r,n={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();Ze(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Ze(r)&&(r=[r]);const s=this.queueLoad(e,r,n,i);if(!s.toLoad.length)return s.pending.length||i(),null;s.toLoad.forEach(a=>{this.loadOne(a)})}load(e,r,n){this.prepareLoading(e,r,{},n)}reload(e,r,n){this.prepareLoading(e,r,{reload:!0},n)}loadOne(e,r=""){const n=e.split("|"),i=n[0],s=n[1];this.read(i,s,"read",void 0,void 0,(a,o)=>{a&&this.logger.warn(`${r}loading namespace ${s} for language ${i} failed`,a),!a&&o&&this.logger.log(`${r}loaded namespace ${s} for language ${i}`,o),this.loaded(e,a,o)})}saveMissing(e,r,n,i,s,a={},o=()=>{}){var c,u,d,f,p;if((u=(c=this.services)==null?void 0:c.utils)!=null&&u.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(r))){this.logger.warn(`did not save key "${n}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((p=this.backend)!=null&&p.create){const m={...a,isUpdate:s},y=this.backend.create.bind(this.backend);if(y.length<6)try{let v;y.length===5?v=y(e,r,n,i,m):v=y(e,r,n,i),v&&typeof v.then=="function"?v.then(w=>o(null,w)).catch(o):o(null,v)}catch(v){o(v)}else y(e,r,n,i,o,m)}!e||!e[0]||this.store.addResource(e[0],r,n,i)}}}const Ij=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),Ze(t[1])&&(e.defaultValue=t[1]),Ze(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(n=>{e[n]=r[n]})}return e},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),F$=t=>(Ze(t.ns)&&(t.ns=[t.ns]),Ze(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),Ze(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&!t.supportedLngs.includes("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),Lx=()=>{},xue=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(r=>{typeof t[r]=="function"&&(t[r]=t[r].bind(t))})};class ig extends O_{constructor(e={},r){if(super(),this.options=F$(e),this.services={},this.logger=$a,this.modules={external:[]},xue(this),r&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,r),this;setTimeout(()=>{this.init(e,r)},0)}}init(e={},r){this.isInitializing=!0,typeof e=="function"&&(r=e,e={}),e.defaultNS==null&&e.ns&&(Ze(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const n=Ij();this.options={...n,...this.options,...F$(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);const i=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?$a.init(i(this.modules.logger),this.options):$a.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=gue;const d=new R$(this.options);this.store=new M$(this.options.resources,this.options);const f=this.services;f.logger=$a,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new hue(d,{prepend:this.options.pluralSeparator}),u&&(f.formatter=i(u),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new D$(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new yue(i(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(p,...m)=>{this.emit(p,...m)}),this.modules.languageDetector&&(f.languageDetector=i(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=i(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new F0(this.services,this.options),this.translator.on("*",(p,...m)=>{this.emit(p,...m)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Lx),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const o=mm(),c=()=>{const u=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(f),r(d,f)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),o}loadResources(e,r=Lx){var s,a;let n=r;const i=Ze(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const o=[],c=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&(o.includes(f)||o.push(f))})};i?c(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(a=(s=this.options.preload)==null?void 0:s.forEach)==null||a.call(s,u=>c(u)),this.services.backendConnector.load(o,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(u)})}else n(null)}reloadResources(e,r,n){const i=mm();return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=void 0),e||(e=this.languages),r||(r=this.options.ns),n||(n=Lx),this.services.backendConnector.reload(e,r,s=>{i.resolve(),n(s)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&_V.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!["cimode","dev"].includes(e)){for(let r=0;r<this.languages.length;r++){const n=this.languages[r];if(!["cimode","dev"].includes(n)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,r){this.isLanguageChangingTo=e;const n=mm();this.emit("languageChanging",e);const i=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},s=(o,c)=>{c?this.isLanguageChangingTo===e&&(i(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,n.resolve((...u)=>this.t(...u)),r&&r(o,(...u)=>this.t(...u))},a=o=>{var d,f;!e&&!o&&this.services.languageDetector&&(o=[]);const c=Ze(o)?o:o&&o[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(Ze(o)?[o]:o);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),(f=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||f.call(d,u)),this.loadResources(u,p=>{s(p,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,r,n){const i=(s,a,...o)=>{let c;typeof a!="object"?c=this.options.overloadTranslationOptionHandler([s,a].concat(o)):c={...a},c.lng=c.lng||i.lng,c.lngs=c.lngs||i.lngs,c.ns=c.ns||i.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||n||i.keyPrefix);const u={...this.options,...c};typeof c.keyPrefix=="function"&&(c.keyPrefix=Kf(c.keyPrefix,u));const d=this.options.keySeparator||".";let f;return c.keyPrefix&&Array.isArray(s)?f=s.map(p=>(typeof p=="function"&&(p=Kf(p,u)),`${c.keyPrefix}${d}${p}`)):(typeof s=="function"&&(s=Kf(s,u)),f=c.keyPrefix?`${c.keyPrefix}${d}${s}`:s),this.t(f,c)};return Ze(e)?i.lng=e:i.lngs=e,i.ns=r,i.keyPrefix=n,i}t(...e){var r;return(r=this.translator)==null?void 0:r.translate(...e)}exists(...e){var r;return(r=this.translator)==null?void 0:r.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,r={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;
593if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=r.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const a=(o,c)=>{const u=this.services.backendConnector.state[`${o}|${c}`];return u===-1||u===0||u===2};if(r.precheck){const o=r.precheck(this,a);if(o!==void 0)return o}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!i||a(s,e)))}loadNamespaces(e,r){const n=mm();return this.options.ns?(Ze(e)&&(e=[e]),e.forEach(i=>{this.options.ns.includes(i)||this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}loadLanguages(e,r){const n=mm();Ze(e)&&(e=[e]);const i=this.options.preload||[],s=e.filter(a=>!i.includes(a)&&this.services.languageUtils.isSupportedCode(a));return s.length?(this.options.preload=i.concat(s),this.loadResources(a=>{n.resolve(),r&&r(a)}),n):(r&&r(),Promise.resolve())}dir(e){var i,s;if(e||(e=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!e)return"rtl";try{const a=new Intl.Locale(e);if(a&&a.getTextInfo){const o=a.getTextInfo();if(o&&o.direction)return o.direction}}catch{}const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((s=this.services)==null?void 0:s.languageUtils)||new R$(Ij());return e.toLowerCase().indexOf("-latn")>1?"ltr":r.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},r){const n=new ig(e,r);return n.createInstance=ig.createInstance,n}cloneInstance(e={},r=Lx){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},s=new ig(i);if((e.debug!==void 0||e.prefix!==void 0)&&(s.logger=s.logger.clone(e)),["store","services","language"].forEach(o=>{s[o]=this[o]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},n){const o=Object.keys(this.store.data).reduce((c,u)=>(c[u]={...this.store.data[u]},c[u]=Object.keys(c[u]).reduce((d,f)=>(d[f]={...c[u][f]},d),c[u]),c),{});s.store=new M$(o,i),s.services.resourceStore=s.store}if(e.interpolation){const c={...Ij().interpolation,...this.options.interpolation,...e.interpolation},u={...i,interpolation:c};s.services.interpolator=new D$(u)}return s.translator=new F0(s.services,i),s.translator.on("*",(o,...c)=>{s.emit(o,...c)}),s.init(i,r),s.translator.options=i,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const fi=ig.createInstance();fi.createInstance;fi.dir;fi.init;fi.loadResources;fi.reloadResources;fi.use;fi.changeLanguage;fi.getFixedT;fi.t;fi.exists;fi.setDefaultNamespace;fi.hasLoadedNamespace;fi.loadNamespaces;fi.loadLanguages;const bue=(t,e,r,n)=>{var s,a,o,c;const i=[r,{code:e,...n||{}}];if((a=(s=t==null?void 0:t.services)==null?void 0:s.logger)!=null&&a.forward)return t.services.logger.forward(i,"warn","react-i18next::",!0);Yu(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),(c=(o=t==null?void 0:t.services)==null?void 0:o.logger)!=null&&c.warn?t.services.logger.warn(...i):console!=null&&console.warn&&console.warn(...i)},z$={},ME=(t,e,r,n)=>{Yu(r)&&z$[r]||(Yu(r)&&(z$[r]=new Date),bue(t,e,r,n))},SV=(t,e)=>()=>{if(t.isInitialized)e();else{const r=()=>{setTimeout(()=>{t.off("initialized",r)},0),e()};t.on("initialized",r)}},RE=(t,e,r)=>{t.loadNamespaces(e,SV(t,r))},U$=(t,e,r,n)=>{if(Yu(r)&&(r=[r]),t.options.preload&&t.options.preload.indexOf(e)>-1)return RE(t,r,n);r.forEach(i=>
593{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,SV(t,n))},wue=(t,e,r={})=>!e.languages||!e.languages.length?(ME(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:r.lng,precheck:(n,i)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!i(n.isLanguageChangingTo,t))return!1}}),Yu=t=>typeof t=="string",_ue=t=>typeof t=="object"&&t!==null,kue=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Sue={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},jue=t=>Sue[t],Nue=t=>t.replace(kue,jue);let IE={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Nue,transDefaultProps:void 0};const Cue=(t={})=>{IE={...IE,...t}},Eue=()=>IE;let jV;const Oue=t=>{jV=t},Tue=()=>jV,Aue={type:"3rdParty",init(t){Cue(t.options.react),Oue(t)}},Pue=x.createContext();class Mue{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var NV={exports:{}},CV={};/**
594 * @license React
595 * use-sync-external-store-shim.production.js
596 *
597 * Copyright (c) Meta Platforms, Inc. and affiliates.
598 *
599 * This source code is licensed under the MIT license found in the
600 * LICENSE file in the root directory of this source tree.
601 */var Ch=x;function Rue(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Iue=typeof Object.is=="function"?Object.is:Rue,Lue=Ch.useState,$ue=Ch.useEffect,Due=Ch.useLayoutEffect,Bue=Ch.useDebugValue;function Fue(t,e){var r=e(),n=Lue({inst:{value:r,getSnapshot:e}}),i=n[0].inst,s=n[1];return Due(function(){i.value=r,i.getSnapshot=e,Lj(i)&&s({inst:i})},[t,r,e]),$ue(function(){return Lj(i)&&s({inst:i}),t(function(){Lj(i)&&s({inst:i})})},[t]),Bue(r),r}function Lj(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!Iue(t,r)}catch{return!0}}function zue(t,e){return e()}var Uue=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?zue:Fue;CV.useSyncExternalStore=Ch.useSyncExternalStore!==void 0?Ch.useSyncExternalStore:Uue;NV.exports=CV;var Hue=NV.exports;const Vue=(t,e)=>{if(Yu(e))return e;if(_ue(e)&&Yu(e.defaultValue))return e.defaultValue;if(typeof t=="function")return"";if(Array.isArray(t)){const r=t[t.length-1];return typeof r=="function"?"":r}return t},Wue={t:Vue,ready:!1},que=()=>()=>{},JP=(t,e={})=>{var T,$,B;const{i18n:r}=e,{i18n:n,defaultNS:i}=x.useContext(Pue)||{},s=r||n||Tue();s&&!s.reportNamespaces&&(s.reportNamespaces=new Mue),s||ME(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const a=x.useMemo(()=>{var R;return{...Eue(),...(R=s==null?void 0:s.options)==null?void 0:R.react,...e}},[s,e]),{useSuspense:o,keyPrefix:c}=a,u=i||((T=s==null?void 0:s.options)==null?void 0:T.defaultNS),d=Yu(u)?[u]:u||["translation"],f=x.useMemo(()=>d,d);(B=($=s==null?void 0:s.reportNamespaces)==null?void 0:$.addUsedNamespaces)==null||B.call($,f);const p=x.useRef(0),m=x.useCallback(R=>{if(!s)return que;const{bindI18n:M,bindI18nStore:F}=a,q=()=>{p.current+=1,R()};return M&&s.on(M,q),F&&s.store.on(F,q),()=>{M&&M.split(" ").forEach(V=>s.off(V,q)),F&&F.split(" ").forEach(V=>s.store.off(V,q))}},[s,a]),y=x.useRef(),v=x.useCallback(()=>{if(!s)return Wue;const R=!!(s.isInitialized||s.initializedStoreOnce)&&f.every(z=>wue(z,s,a)),M=e.lng||s.language,F=p.current,q=y.current;if(q&&q.ready===R&&q.lng===M&&q.keyPrefix===c&&q.revision===F)return q;const W={t:s.getFixedT(M,a.nsMode==="fallback"?f:f[0],c),ready:R,lng:M,keyPrefix:c,revision:F};return y.current=W,W},[s,f,c,a,e.lng]),[w,b]=x.useState(0),{t:_,ready:S}=Hue.useSyncExternalStore(m,v,v);x.useEffect(()=>{if(s&&!S&&!o){const R=()=>b(M=>M+1);e.lng?U$(s,e.lng,f,R):RE(s,f,R)}},[s,e.lng,f,S,o,w]);const N=s||{},j=x.useRef(null),C=x.useRef(),O=R=>{const M=Object.getOwnPropertyDescriptors(R);M.__original&&delete M.__original;const F=Object.create(Object.getPrototypeOf(R),M);if(!Object.prototype.hasOwnProperty.call(F,"__original"))try{Object.defineProperty(F,"__original",{value:R,writable:!1,enumerable:!1,
601configurable:!1})}catch{}return F},P=x.useMemo(()=>{const R=N,M=R==null?void 0:R.language;let F=R;R&&(j.current&&j.current.__original===R?C.current!==M?(F=O(R),j.current=F,C.current=M):F=j.current:(F=O(R),j.current=F,C.current=M));const q=!S&&!o?(...W)=>(ME(s,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),_(...W)):_,V=[q,F,S];return V.t=q,V.i18n=F,V.ready=S,V},[_,N,S,N.resolvedLanguage,N.language,N.languages]);if(s&&o&&!S)throw new Promise(R=>{const M=()=>R();e.lng?U$(s,e.lng,f,M):RE(s,f,M)});return P},YP=gp("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-semibold ring-offset-background transition-all duration-200 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 shadow-sm hover:shadow-md",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",hero:"bg-primary text-primary-foreground hover:bg-primary/90 shadow-md hover:shadow-lg hover:-translate-y-0.5 transition-all duration-200","hero-outline":"border-2 border-primary text-primary bg-background hover:bg-accent transition-all duration-200"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-12 rounded-lg px-8 text-base",xl:"h-14 roun
601ded-xl px-10 text-lg",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),se=x.forwardRef(({className:t,variant:e,size:r,asChild:n=!1,...i},s)=>{const a=n?gd:"button";return l.jsx(a,{className:fe(YP({variant:e,size:r,className:t})),ref:s,...i})});se.displayName="Button";const XP="/assets/foretagslogi-logo-TPuODQPg.png",Pr=()=>{const{t}=JP(),[e,r]=x.useState(!1),[n,i]=x.useState(!1);x.useEffect(()=>{const a=()=>i(window.scrollY>20);return window.addEventListener("scroll",a,{passive:!0}),()=>window.removeEventListener("scroll",a)},[]),x.useEffect(()=>(document.body.style.overflow=e?"hidden":"",()=>{document.body.style.overflow=""}),[e]);const s=[{href:"/bostader",label:t("nav.bostader"),isRoute:!0},{href:"/foretagsservice",label:t("nav.foretagsservice"),isRoute:!0},{href:"/om-oss",label:t("nav.omOss"),isRoute:!0},{href:"/hyra-ut",label:t("nav.hyraUt"),isRoute:!0},{href:"/kontakt",label:t("nav.kontakt"),isRoute:!0}];return l.jsxs("header",{className:`fixed top-0 left-0 right-0 z-50 transition-all duration-300 bg-header text-header-foreground ${n?"shadow-sm border-b border-header-border/40":""}`,children:[l.jsxs("div",{className:"container mx-auto flex items-center justify-between h-16 md:h-18 px-3 md:px-6",children:[l.jsx(Re,{to:"/",className:"flex items-center py-1",children:l.jsx("img",{src:XP,alt:"företagslogi-logga",className:"h-36 md:h-44 w-auto max-w-[220px] md:max-w-[280px] object-contain"})}),l.jsxs("nav",{className:"hidden md:flex items-center gap-7 ml-auto mr-6",children:[l.jsx(Re,{to:"/bostader",className:"text-sm font-medium text-foreground hover:text-primary transition-colors",children:t("nav.bostader")}),l.jsx(Re,{to:"/foretagsservice",className:"text-sm font-medium text-foreground hover:text-primary transition-colors",children:t("nav.foretagsservice")}),l.jsx(Re,{to:"/hyra-ut",className:"text-sm font-medium text-foreground hover:text-primary transition-colors",children:t("nav.hyraUt")})]}),l.jsxs("div",{className:"flex items-center gap-1 md:gap-3",children:[l.jsx(se,{variant:"ghost",size:"sm",className:"hidden sm:inline-flex gap-2 font-semibold",asChild:!0,children:l.jsxs(Re,{to:"/logga-in",children:[l.jsx(Yae,{className:"!h-5 !w-5",strokeWidth:1.75}),t("nav.loggaIn")]})}),l.jsx(se,{variant:"hero",size:"default",className:"hidden sm:inline-flex",asChild:!0,children:l.jsx(Re,{to:"/kontakt",children:t("nav.skickaForfragan")})}),l.jsx("button",{className:"relative z-[60] w-10 h-10 flex items-center justify-center rounded-lg active:bg-muted transition-colors",onClick:()=>r(!e),"aria-label":t(e?"nav.stangMeny":"nav.oppnaMeny"),children:e?l.jsx(Wi,{className:"h-5 w-5"}):l.jsx(voe,{className:"h-5 w-5"})})]})]}),e&&l.jsx("div",{className:"fixed inset-0 z-40 animate-fade-in",style:{backgroundColor:"rgba(0,0,0,0.5)"},onClick:()=>r(!1)}),l.jsxs("div",{className:`fixed top-0 right-0 z-50 flex h-screen w-[80%] max-w-sm flex-col overflow-hidden shadow-2xl transition-transform duration-300 ease-in-out ${e?"translate-x-0":"translate-x-full"}`,style:{backgroundColor:"hsl(var(--background))"},children:[l.jsx("div",{className:"flex h-16 items-center justify-end border-b border-border px-4 md:h-18",style:{backgroundColor:"hsl(var(--background))"},children:l.jsx("button",{className:"w-10 h-10 flex items-center justify-center rounded-lg active:bg-muted transition-colors",onClick:()=>r(!1),"aria-label":t("nav.stangMeny"),children:l.jsx(Wi,{className:"h-5 w-5"})})}),l.jsxs("nav",{className:"flex flex-1 flex-col overflow-y-auto px-6 pb-8 pt-6",style:{backgroundColor:"hsl(var(--background))"},children:[l.jsx("div",{className:"space-y-1",children:s.map((a,o)=>{const c=`block text-lg font-medium py-3 px-2 text-foreground border-b border-border/30 transition-all duration-200 ${e?"opacity-100 translate-x-0":"opacity-0 translate-x-4"}`;return a.isRoute?l.jsx(Re,{to:a.href,className:c,style:{transitionDelay:e?`${100+o*50}ms`:"0ms"},onClick:()=>r(!1),children:a.label},a.href):l.jsx("a",{href:a.href,className:c,style:{transitionDelay:e?`${100+o*50}ms`:"0ms"},onClick:()=>r(!1),...a.isExternal?{target:"_blank",rel:"noopener noreferrer"}:{},children:a.label},a.href)})}),l.jsxs("div",{className:"mt-auto pt-6 space-y-3",children:[l.jsx(se,{variant:"hero-outline",className:"w-full h-12 text-base rounded-full",asChild:!0,children:l.jsx(Re,{to:"/kontakt",onClick:()=>r(!1),children:t("nav.skickaEnForfragan")})}),l.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"[email protected] · 08 – 644 58 20"})]})]})]})]})},Kue="/assets/hero-apartment-BBHgu1cm.jpg";function H$(t,[e,r]){return Math.min(r,Math.max(e,t))}var Gue=x.createContext(void 0);function wy(t){const e=x.useContext(Gue);return t||e||"ltr"}var $j=0;
vendor: 5,577 bytes, line 601
601function T_(){x.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??V$()),document.body.insertAdjacentElement("beforeend",t[1]??V$()),$j++,()=>{$j===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),$j--}},[])}function V$(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Dj="focusScope.autoFocusOnMount",Bj="focusScope.autoFocusOnUnmount",W$={bubbles:!1,cancelable:!0},Zue="FocusScope",_y=x.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=t,[o,c]=x.useState(null),u=Ci(i),d=Ci(s),f=x.useRef(null),p=it(e,v=>c(v)),m=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let v=function(S){if(m.paused||!o)return;const N=S.target;o.contains(N)?f.current=N:yl(f.current,{select:!0})},w=function(S){if(m.paused||!o)return;const N=S.relatedTarget;N!==null&&(o.contains(N)||yl(f.current,{select:!0}))},b=function(S){if(document.activeElement===document.body)for(const j of S)j.removedNodes.length>0&&yl(o)};document.addEventListener("focusin",v),document.addEventListener("focusout",w);const _=new MutationObserver(b);return o&&_.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",w),_.disconnect()}}},[n,o,m.paused]),x.useEffect(()=>{if(o){K$.add(m);const v=document.activeElement;if(!o.contains(v)){const b=new CustomEvent(Dj,W$);o.addEventListener(Dj,u),o.dispatchEvent(b),b.defaultPrevented||(Jue(tde(EV(o)),{select:!0}),document.activeElement===v&&yl(o))}return()=>{o.removeEventListener(Dj,u),setTimeout(()=>{const b=new CustomEvent(Bj,W$);o.addEventListener(Bj,d),o.dispatchEvent(b),b.defaultPrevented||yl(v??document.body,{select:!0}),o.removeEventListener(Bj,d),K$.remove(m)},0)}}},[o,u,d,m]);const y=x.useCallback(v=>{if(!r&&!n||m.paused)return;const w=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,b=document.activeElement;if(w&&b){const _=v.currentTarget,[S,N]=Yue(_);S&&N?!v.shiftKey&&b===N?(v.preventDefault(),r&&yl(S,{select:!0})):v.shiftKey&&b===S&&(v.preventDefault(),r&&yl(N,{select:!0})):b===_&&v.preventDefault()}},[r,n,m.paused]);return l.jsx(Oe.div,{tabIndex:-1,...a,ref:p,onKeyDown:y})});_y.displayName=Zue;function Jue(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(yl(n,{select:e}),document.activeElement!==r)return}function Yue(t){const e=EV(t),r=q$(e,t),n=q$(e.reverse(),t);return[r,n]}function EV(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function q$(t,e){for(const r of t)if(!Xue(r,{upTo:e}))return r}function Xue(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Que(t){return t instanceof HTMLInputElement&&"select"in t}function yl(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&Que(t)&&e&&t.select()}}var K$=ede();function ede(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=G$(t,e),t.unshift(e)},remove(e){var r;t=G$(t,e),(r=t[0])==null||r.resume()}}}function G$(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function tde(t){return t.filter(e=>e.tagName!=="A")}function QP(t){const e=x.useRef({value:t,previous:t});return x.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var rde=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Vd=new WeakMap,$x=new WeakMap,Dx={},Fj=0,OV=function(t){return t&&(t.host||OV(t.parentNode))},nde=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=OV(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},ide=function(t,e,r,n){var i=nde(e,Array.isArray(t)?t:[t]);Dx[r]||(Dx[r]=new WeakMap);var s=Dx[r],a=[],o=new Set,c=new Set(i),u=function(f){!f||o.has(f)||(o.add(f),u(f.parentNode))};i.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(p){if(o.has(p))d(p);else try{var m=p.getAttribute(n),y=m!==null&&m!=="false",v=(Vd.get(p)||0)+1,w=(s.get(p)||0)+1;Vd.set(p,v),s.set(p,w),a.push(p),v===1&&y&&$x.set(p,!0),w===1&&p.setAttribute(r,"true"),y||p.setAttribute(n,"true")}catch(b){console.error("aria-hidden: cannot operate on ",p,b)}})};return d(e),o.clear(),Fj++,function(){a.forEach(function(f){var p=Vd.get(f)-1,m=s.get(f)-1;Vd.set(f,p),s.set(f,m),p||($x.has(f)||f.removeAttribute(n),$x.delete(f)),m||f.removeAttribute(r)}),Fj--,Fj||(Vd=new WeakMap,Vd=new WeakMap,$x=new WeakMap,Dx={})}},A_=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=rde(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),ide(n,i,r,"aria-hidden")):function(){return null}},Al=function(){return Al=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&
vendor: 6,016 bytes, lines 601-616
601(e[s]=r[s])}return e},Al.apply(this,arguments)};function sde(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function ade(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))}var zb="right-scroll-bar-position",Ub="width-before-scroll-bar",ode="with-scroll-bars-hidden",lde="--removed-body-scroll-bar-size";function zj(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function cde(t,e){var r=x.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(n){var i=r.value;i!==n&&(r.value=n,r.callback(n,i))}}}})[0];return r.callback=e,r.facade}var ude=typeof window<"u"?x.useLayoutEffect:x.useEffect,Z$=new WeakMap;function dde(t,e){var r=cde(null,function(n){return t.forEach(function(i){return zj(i,n)})});return ude(function(){var n=Z$.get(r);if(n){var i=new Set(n),s=new Set(t),a=r.current;i.forEach(function(o){s.has(o)||zj(o,null)}),s.forEach(function(o){i.has(o)||zj(o,a)})}Z$.set(r,t)},[t]),r}var z0=function(){return z0=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},z0.apply(this,arguments)};function fde(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function hde(t){return t}function pde(t,e){e===void 0&&(e=hde);var r=[],n=!1,i={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(s){var a=e(s,n);return r.push(a),function(){r=r.filter(function(o){return o!==a})}},assignSyncMedium:function(s){for(n=!0;r.length;){var a=r;r=[],a.forEach(s)}r={push:function(o){return s(o)},filter:function(){return r}}},assignMedium:function(s){n=!0;var a=[];if(r.length){var o=r;r=[],o.forEach(s),a=r}var c=function(){var d=a;a=[],d.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),r}}}};return i}function mde(t){t===void 0&&(t={});var e=pde(null);return e.options=z0({async:!0,ssr:!1},t),e}var TV=function(t){var e=t.sideCar,r=fde(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return x.createElement(n,z0({},r))};TV.isSideCarExport=!0;function gde(t,e){return t.useMedium(e),TV}var AV=mde(),Uj=function(){},P_=x.forwardRef(function(t,e){var r=x.useRef(null),n=x.useState({onScrollCapture:Uj,onWheelCapture:Uj,onTouchMoveCapture:Uj}),i=n[0],s=n[1],a=t.forwardProps,o=t.children,c=t.className,u=t.removeScrollBar,d=t.enabled,f=t.shards,p=t.sideCar,m=t.noRelative,y=t.noIsolation,v=t.inert,w=t.allowPinchZoom,b=t.as,_=b===void 0?"div":b,S=t.gapMode,N=sde(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=p,C=dde([r,e]),O=Al(Al({},N),i);return x.createElement(x.Fragment,null,d&&x.createElement(j,{sideCar:AV,removeScrollBar:u,shards:f,noRelative:m,noIsolation:y,inert:v,setCallbacks:s,allowPinchZoom:!!w,lockRef:r,gapMode:S}),a?x.cloneElement(x.Children.only(o),Al(Al({},O),{ref:C})):x.createElement(_,Al({},O,{className:c,ref:C}),o))});P_.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};P_.classNames={fullWidth:Ub,zeroRight:zb};var vde=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function yde(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=vde();return e&&t.setAttribute("nonce",e),t}function xde(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function bde(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var wde=function(){var t=0,e=null;return{add:function(r){t==0&&(e=yde())&&(xde(e,r),bde(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},_de=function(){var t=wde();return function(e,r){x.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},PV=function(){var t=_de(),e=function(r){var n=r.styles,i=r.dynamic;return t(n,i),null};return e},kde={left:0,top:0,right:0,gap:0},Hj=function(t){return parseInt(t||"",10)||0},Sde=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[Hj(r),Hj(n),Hj(i)]},jde=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return kde;var e=Sde(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},Nde=PV(),Gf="data-scroll-locked",Cde=function(t,e,r,n){var i=t.left,s=t.top,a=t.right,o=t.gap;return r===void 0&&(r="margin"),`
602  .`.concat(ode,` {
603   overflow: hidden `).concat(n,`;
604   padding-right: `).concat(o,"px ").concat(n,`;
605  }
606  body[`).concat(Gf,`] {
607    overflow: hidden `).concat(n,`;
608    overscroll-behavior: contain;
609    `).concat([e&&"position: relative ".concat(n,";"),r==="margin"&&`
610    padding-left: `.concat(i,`px;
611    padding-top: `).concat(s,`px;
612    padding-right: `).concat(a,`px;
613    margin-left:0;
614    margin-top:0;
615    margin-right: `).concat(o,"px ").concat(n,`;
616    `),r==="padding"&&"padding-right: ".concat(o,"px ").concat(n,";
616")].filter(Boolean).join(""),`
617  }
618  
619  .`).concat(zb,` {
620    right: `).concat(o,"px ").concat(n,`;
621  }
622  
623  .`).concat(Ub,` {
624    margin-right: `).concat(o,"px ").concat(n,`;
625  }
626  
627  .`).concat(zb," .").concat(zb,` {
628    right: 0 `).concat(n,`;
629  }
630  
631  .`).concat(Ub," .").concat(Ub,` {
632    margin-right: 0 `).concat(n,`;
633  }
634  
635  body[`).concat(Gf,`] {
636    `).concat(lde,": ").concat(o,`px;
637  }
638`)},J$=function(){var t=parseInt(document.body.getAttribute(Gf)||"0",10);return isFinite(t)?t:0},Ede=function(){x.useEffect(function(){return document.body.setAttribute(Gf,(J$()+1).toString()),function(){var t=J$()-1;t<=0?document.body.removeAttribute(Gf):document.body.setAttribute(Gf,t.toString())}},[])},Ode=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n;Ede();var s=x.useMemo(function(){return jde(i)},[i]);return x.createElement(Nde,{styles:Cde(s,!e,i,r?"":"!important")})},LE=!1;if(typeof window<"u")try{var Bx=Object.defineProperty({},"passive",{get:function(){return LE=!0,!0}});window.addEventListener("test",Bx,Bx),window.removeEventListener("test",Bx,Bx)}catch{LE=!1}var Wd=LE?{passive:!1}:!1,Tde=function(t){return t.tagName==="TEXTAREA"},MV=function(t,e){if(!(t instanceof Element))return!1;var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!Tde(t)&&r[e]==="visible")},Ade=function(t){return MV(t,"overflowY")},Pde=function(t){return MV(t,"overflowX")},Y$=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=RV(t,n);if(i){var s=IV(t,n),a=s[1],o=s[2];if(a>o)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Mde=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},Rde=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},RV=function(t,e){return t==="v"?Ade(e):Pde(e)},IV=function(t,e){return t==="v"?Mde(e):Rde(e)},Ide=function(t,e){return t==="h"&&e==="rtl"?-1:1},Lde=function(t,e,r,n,i){var s=Ide(t,window.getComputedStyle(e).direction),a=s*n,o=r.target,c=e.contains(o),u=!1,d=a>0,f=0,p=0;do{if(!o)break;var m=IV(t,o),y=m[0],v=m[1],w=m[2],b=v-w-s*y;(y||b)&&RV(t,o)&&(f+=b,p+=y);var _=o.parentNode;o=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!c&&o!==document.body||c&&(e.contains(o)||e===o));return(d&&(Math.abs(f)<1||!i)||!d&&(Math.abs(p)<1||!i))&&(u=!0),u},Fx=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},X$=function(t){return[t.deltaX,t.deltaY]},Q$=function(t){return t&&"current"in t?t.current:t},$de=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Dde=function(t){return`
639  .block-interactivity-`.concat(t,` {pointer-events: none;}
640  .allow-interactivity-`).concat(t,` {pointer-events: all;}
641`)},Bde=0,qd=[];function Fde(t){var e=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),i=x.useState(Bde++)[0],s=x.useState(PV)[0],a=x.useRef(t);x.useEffect(function(){a.current=t},[t]),x.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var v=ade([t.lockRef.current],(t.shards||[]).map(Q$),!0).filter(Boolean);return v.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var o=x.useCallback(function(v,w){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!a.current.allowPinchZoom;var b=Fx(v),_=r.current,S="deltaX"in v?v.deltaX:_[0]-b[0],N="deltaY"in v?v.deltaY:_[1]-b[1],j,C=v.target,O=Math.abs(S)>Math.abs(N)?"h":"v";if("touches"in v&&O==="h"&&C.type==="range")return!1;var P=Y$(O,C);if(!P)return!0;if(P?j=O:(j=O==="v"?"h":"v",P=Y$(O,C)),!P)return!1;if(!n.current&&"changedTouches"in v&&(S||N)&&(n.current=j),!j)return!0;var T=n.current||j;return Lde(T,w,v,T==="h"?S:N,!0)},[]),c=x.useCallback(function(v){var w=v;if(!(!qd.length||qd[qd.length-1]!==s)){var b="deltaY"in w?X$(w):Fx(w),_=e.current.filter(function(j){return j.name===w.t
vendor: 4,275 bytes, line 641
641ype&&(j.target===w.target||w.target===j.shadowParent)&&$de(j.delta,b)})[0];if(_&&_.should){w.cancelable&&w.preventDefault();return}if(!_){var S=(a.current.shards||[]).map(Q$).filter(Boolean).filter(function(j){return j.contains(w.target)}),N=S.length>0?o(w,S[0]):!a.current.noIsolation;N&&w.cancelable&&w.preventDefault()}}},[]),u=x.useCallback(function(v,w,b,_){var S={name:v,delta:w,target:b,should:_,shadowParent:zde(b)};e.current.push(S),setTimeout(function(){e.current=e.current.filter(function(N){return N!==S})},1)},[]),d=x.useCallback(function(v){r.current=Fx(v),n.current=void 0},[]),f=x.useCallback(function(v){u(v.type,X$(v),v.target,o(v,t.lockRef.current))},[]),p=x.useCallback(function(v){u(v.type,Fx(v),v.target,o(v,t.lockRef.current))},[]);x.useEffect(function(){return qd.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,Wd),document.addEventListener("touchmove",c,Wd),document.addEventListener("touchstart",d,Wd),function(){qd=qd.filter(function(v){return v!==s}),document.removeEventListener("wheel",c,Wd),document.removeEventListener("touchmove",c,Wd),document.removeEventListener("touchstart",d,Wd)}},[]);var m=t.removeScrollBar,y=t.inert;return x.createElement(x.Fragment,null,y?x.createElement(s,{styles:Dde(i)}):null,m?x.createElement(Ode,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function zde(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Ude=gde(AV,Fde);var ky=x.forwardRef(function(t,e){return x.createElement(P_,Al({},t,{ref:e,sideCar:Ude}))});ky.classNames=P_.classNames;var Hde=[" ","Enter","ArrowUp","ArrowDown"],Vde=[" ","Enter"],Xu="Select",[M_,R_,Wde]=vy(Xu),[kp,BZe]=Kn(Xu,[Wde,Ec]),I_=Ec(),[qde,Oc]=kp(Xu),[Kde,Gde]=kp(Xu),LV=t=>{const{__scopeSelect:e,children:r,open:n,defaultOpen:i,onOpenChange:s,value:a,defaultValue:o,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:p,required:m,form:y}=t,v=I_(e),[w,b]=x.useState(null),[_,S]=x.useState(null),[N,j]=x.useState(!1),C=wy(u),[O,P]=Yi({prop:n,defaultProp:i??!1,onChange:s,caller:Xu}),[T,$]=Yi({prop:a,defaultProp:o,onChange:c,caller:Xu}),B=x.useRef(null),R=w?y||!!w.closest("form"):!0,[M,F]=x.useState(new Set),q=Array.from(M).map(V=>V.props.value).join(";");return l.jsx(k_,{...v,children:l.jsxs(qde,{required:m,scope:e,trigger:w,onTriggerChange:b,valueNode:_,onValueNodeChange:S,valueNodeHasChildren:N,onValueNodeHasChildrenChange:j,contentId:tn(),value:T,onValueChange:$,open:O,onOpenChange:P,dir:C,triggerPointerDownPosRef:B,disabled:p,children:[l.jsx(M_.Provider,{scope:e,children:l.jsx(Kde,{scope:t.__scopeSelect,onNativeOptionAdd:x.useCallback(V=>{F(W=>new Set(W).add(V))},[]),onNativeOptionRemove:x.useCallback(V=>{F(W=>{const z=new Set(W);return z.delete(V),z})},[]),children:r})}),R?l.jsxs(a9,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:T,onChange:V=>$(V.target.value),disabled:p,form:y,children:[T===void 0?l.jsx("option",{value:""}):null,Array.from(M)]},q):null]})})};LV.displayName=Xu;var $V="SelectTrigger",DV=x.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:n=!1,...i}=t,s=I_(r),a=Oc($V,r),o=a.disabled||n,c=it(e,a.onTriggerChange),u=R_(r),d=x.useRef("touch"),[f,p,m]=l9(v=>{const w=u().filter(S=>!S.disabled),b=w.find(S=>S.value===a.value),_=c9(w,v,b);_!==void 0&&a.onValueChange(_.value)}),y=v=>{o||(a.onOpenChange(!0),m()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return l.jsx(by,{asChild:!0,...s,children:l.jsx(Oe.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":o9(a.value)?"":void 0,...i,ref:c,onClick:we(i.onClick,v=>{v.currentTarget.focus(),d.current!=="mouse"&&y(v)}),onPointerDown:we(i.onPointerDown,v=>{d.current=v.pointerType;const w=v.target;w.hasPointerCapture(v.pointerId)&&w.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(y(v),v.preventDefault())}),onKeyDown:we(i.onKeyDown,v=>{const w=f.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&p(v.key),!(w&&v.key===" ")&&Hde.includes(v.key)&&
vendor: 15,699 bytes, line 641
641(y(),v.preventDefault())})})})});DV.displayName=$V;var BV="SelectValue",FV=x.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,children:s,placeholder:a="",...o}=t,c=Oc(BV,r),{onValueNodeHasChildrenChange:u}=c,d=s!==void 0,f=it(e,c.onValueNodeChange);return hn(()=>{u(d)},[u,d]),l.jsx(Oe.span,{...o,ref:f,style:{pointerEvents:"none"},children:o9(c.value)?l.jsx(l.Fragment,{children:a}):s})});FV.displayName=BV;var Zde="SelectIcon",zV=x.forwardRef((t,e)=>{const{__scopeSelect:r,children:n,...i}=t;return l.jsx(Oe.span,{"aria-hidden":!0,...i,ref:e,children:n||"▼"})});zV.displayName=Zde;var Jde="SelectPortal",UV=t=>l.jsx(mp,{asChild:!0,...t});UV.displayName=Jde;var Qu="SelectContent",HV=x.forwardRef((t,e)=>{const r=Oc(Qu,t.__scopeSelect),[n,i]=x.useState();if(hn(()=>{i(new DocumentFragment)},[]),!r.open){const s=n;return s?Vi.createPortal(l.jsx(VV,{scope:t.__scopeSelect,children:l.jsx(M_.Slot,{scope:t.__scopeSelect,children:l.jsx("div",{children:t.children})})}),s):null}return l.jsx(WV,{...t,ref:e})});HV.displayName=Qu;var Js=10,[VV,Tc]=kp(Qu),Yde="SelectContentImpl",Xde=gc("SelectContent.RemoveScroll"),WV=x.forwardRef((t,e)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:a,side:o,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:y,hideWhenDetached:v,avoidCollisions:w,...b}=t,_=Oc(Qu,r),[S,N]=x.useState(null),[j,C]=x.useState(null),O=it(e,oe=>N(oe)),[P,T]=x.useState(null),[$,B]=x.useState(null),R=R_(r),[M,F]=x.useState(!1),q=x.useRef(!1);x.useEffect(()=>{if(S)return A_(S)},[S]),T_();const V=x.useCallback(oe=>{const[_e,...ne]=R().map(Q=>Q.ref.current),[ue]=ne.slice(-1),be=document.activeElement;for(const Q of oe)if(Q===be||(Q==null||Q.scrollIntoView({block:"nearest"}),Q===_e&&j&&(j.scrollTop=0),Q===ue&&j&&(j.scrollTop=j.scrollHeight),Q==null||Q.focus(),document.activeElement!==be))return},[R,j]),W=x.useCallback(()=>V([P,S]),[V,P,S]);x.useEffect(()=>{M&&W()},[M,W]);const{onOpenChange:z,triggerPointerDownPosRef:H}=_;x.useEffect(()=>{if(S){let oe={x:0,y:0};const _e=ue=>{var be,Q;oe={x:Math.abs(Math.round(ue.pageX)-(((be=H.current)==null?void 0:be.x)??0)),y:Math.abs(Math.round(ue.pageY)-(((Q=H.current)==null?void 0:Q.y)??0))}},ne=ue=>{oe.x<=10&&oe.y<=10?ue.preventDefault():S.contains(ue.target)||z(!1),document.removeEventListener("pointermove",_e),H.current=null};return H.current!==null&&(document.addEventListener("pointermove",_e),document.addEventListener("pointerup",ne,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",_e),document.removeEventListener("pointerup",ne,{capture:!0})}}},[S,z,H]),x.useEffect(()=>{const oe=()=>z(!1);return window.addEventListener("blur",oe),window.addEventListener("resize",oe),()=>{window.removeEventListener("blur",oe),window.removeEventListener("resize",oe)}},[z]);const[G,Y]=l9(oe=>{const _e=R().filter(be=>!be.disabled),ne=_e.find(be=>be.ref.current===document.activeElement),ue=c9(_e,oe,ne);ue&&setTimeout(()=>ue.ref.current.focus())}),U=x.useCallback((oe,_e,ne)=>{const ue=!q.current&&!ne;(_.value!==void 0&&_.value===_e||ue)&&(T(oe),ue&&(q.current=!0))},[_.value]),J=x.useCallback(()=>S==null?void 0:S.focus(),[S]),te=x.useCallback((oe,_e,ne)=>{const ue=!q.current&&!ne;(_.value!==void 0&&_.value===_e||ue)&&B(oe)},[_.value]),re=n==="popper"?$E:qV,ae=re===$E?{side:o,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:y,hideWhenDetached:v,avoidCollisions:w}:{};return l.jsx(VV,{scope:r,content:S,viewport:j,onViewportChange:C,itemRefCallback:U,selectedItem:P,onItemLeave:J,itemTextRefCallback:te,focusSelectedItem:W,selectedItemText:$,position:n,isPositioned:M,searchRef:G,children:l.jsx(ky,{as:Xde,allowPinchZoom:!0,children:l.jsx(_y,{asChild:!0,trapped:_.open,onMountAutoFocus:oe=>{oe.preventDefault()},onUnmountAutoFocus:we(i,oe=>{var _e;(_e=_.trigger)==null||_e.focus({preventScroll:!0}),oe.preventDefault()}),children:l.jsx(vd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:oe=>oe.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:l.jsx(re,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:oe=>oe.preventDefault(),...b,...ae,onPlaced:()=>F(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:we(b.onKeyDown,oe=>{const _e=oe.ctrlKey||oe.altKey||oe.metaKey;if(oe.key==="Tab"&&oe.preventDefault(),!_e&&oe.key.length===1&&Y(oe.key),["ArrowUp","ArrowDown","Home","End"].includes(oe.key)){let ue=R().filter(be=>!be.disabled).map(be=>be.ref.current);if(["ArrowUp","End"].includes(oe.key)&&(ue=ue.slice().reverse()),["ArrowUp","ArrowDown"].includes(oe.key)){const be=oe.target,Q=ue.indexOf(be);ue=ue.slice(Q+1)}setTimeout(()=>V(ue)),oe.preventDefault()}})})})})})})});WV.displayName=Yde;var Qde="SelectItemAlignedPosition",qV=x.forwardRef((t,e)=>{const{__scopeSelect:r,onPlaced:n,...i}=t,s=Oc(Qu,r),a=Tc(Qu,r),[o,c]=x.useState(null),[u,d]=x.useState(null),f=it(e,O=>d(O)),p=R_(r),m=x.useRef(!1),y=x.useRef(!0),{viewport:v,selectedItem:w,selectedItemText:b,focusSelectedItem:_}=a,S=x.useCallback(()=>{if(s.trigger&&s.valueNode&&o&&u&&v&&w&&b){const O=s.trigger.getBoundingClientRect(),P=u.getBoundingClientRect(),T=s.valueNode.getBoundingClientRect(),$=b.getBoundingClientRect();if(s.dir!=="rtl"){const be=$.left-P.left,Q=T.left-be,He=O.left-Q,Ie=O.width+He,ft=Math.max(Ie,P.width),ot=window.innerWidth-Js,yt=H$(Q,[Js,Math.max(Js,ot-ft)]);o.style.minWidth=Ie+"px",o.style.left=yt+"px"}else{const be=P.right-$.right,Q=window.innerWidth-T.right-be,He=window.innerWidth-O.right-Q,Ie=O.width+He,ft=Math.max(Ie,P.width),ot=window.innerWidth-Js,yt=H$(Q,[Js,Math.max(Js,ot-ft)]);o.style.minWidth=Ie+"px",o.style.right=yt+"px"}const B=p(),R=window.innerHeight-Js*2,M=v.scrollHeight,F=window.getComputedStyle(u),q=parseInt(F.borderTopWidth,10),V=parseInt(F.paddingTop,10),W=parseInt(F.borderBottomWidth,10),z=parseInt(F.paddingBottom,10),H=q+V+M+z+W,G=Math.min(w.offsetHeight*5,H),Y=window.getComputedStyle(v),U=parseInt(Y.paddingTop,10),J=parseInt(Y.paddingBottom,10),te=O.top+O.height/2-Js,re=R-te,ae=w.offsetHeight/2,oe=w.offsetTop+ae,_e=q+V+oe,ne=H-_e;if(_e<=te){const be=B.length>0&&w===B[B.length-1].ref.current;o.style.bottom="0px";const Q=u.clientHeight-v.offsetTop-v.offsetHeight,He=Math.max(re,ae+(be?J:0)+Q+W),Ie=_e+He;o.style.height=Ie+"px"}else{const be=B.length>0&&w===B[0].ref.current;o.style.top="0px";const He=Math.max(te,q+v.offsetTop+(be?U:0)+ae)+ne;o.style.height=He+"px",v.scrollTop=_e-te+v.offsetTop}o.style.margin=`${Js}px 0`,o.style.minHeight=G+"px",o.style.maxHeight=R+"px",n==null||n(),requestAnimationFrame(()=>m.current=!0)}},[p,s.trigger,s.valueNode,o,u,v,w,b,s.dir,n]);hn(()=>S(),[S]);const[N,j]=x.useState();hn(()=>{u&&j(window.getComputedStyle(u).zIndex)},[u]);const C=x.useCallback(O=>{O&&y.current===!0&&(S(),_==null||_(),y.current=!1)},[S,_]);return l.jsx(tfe,{scope:r,contentWrapper:o,shouldExpandOnScrollRef:m,onScrollButtonChange:C,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:l.jsx(Oe.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});qV.displayName=Qde;var efe="SelectPopperPosition",$E=x.forwardRef((t,e)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=Js,...s}=t,a=I_(r);return l.jsx(S_,{...a,...s,ref:e,align:n,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)"}})});$E.displayName=efe;var[tfe,e2]=kp(Qu,{}),DE="SelectViewport",KV=x.forwardRef((t,e)=>{const{__scopeSelect:r,nonce:n,...i}=t,s=Tc(DE,r),a=e2(DE,r),o=it(e,s.onViewportChange),c=x.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),l.jsx(M_.Slot,{scope:r,children:l.jsx(Oe.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:we(i.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=a;if(p!=null&&p.current&&f){const m=Math.abs(c.current-d.scrollTop);if(m>0){const y=window.innerHeight-Js*2,v=parseFloat(f.style.minHeight),w=parseFloat(f.style.height),b=Math.max(v,w);if(b<y){const _=b+m,S=Math.min(y,_),N=_-S;f.style.height=S+"px",f.style.bottom==="0px"&&(d.scrollTop=N>0?N:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});KV.displayName=DE;var GV="SelectGroup",[rfe,nfe]=kp(GV),ife=x.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=tn();return l.jsx(rfe,{scope:r,id:i,children:l.jsx(Oe.div,{role:"group","aria-labelledby":i,...n,ref:e})})});ife.displayName=GV;var ZV="SelectLabel",JV=x.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=nfe(ZV,r);return l.jsx(Oe.div,{id:i.id,...n,ref:e})});JV.displayName=ZV;var U0="SelectItem",[sfe,YV]=kp(U0),XV=x.forwardRef((t,e)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:s,...a}=t,o=Oc(U0,r),c=Tc(U0,r),u=o.value===n,[d,f]=x.useState(s??""),[p,m]=x.useState(!1),y=it(e,_=>{var S;return(S=c.itemRefCallback)==null?void 0:S.call(c,_,n,i)}),v=tn(),w=x.useRef("touch"),b=()=>{i||(o.onValueChange(n),o.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(sfe,{scope:r,value:n,disabled:i,textId:v,isSelected:u,onItemTextChange:x.useCallback(_=>{f(S=>S||((_==null?void 0:_.textContent)??"").trim())},[]),children:l.jsx(M_.ItemSlot,{scope:r,value:n,disabled:i,textValue:d,children:l.jsx(Oe.div,{role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:y,onFocus:we(a.onFocus,()=>m(!0)),onBlur:we(a.onBlur,()=>m(!1)),onClick:we(a.onClick,()=>{w.current!=="mouse"&&b()}),onPointerUp:we(a.onPointerUp,()=>{w.current==="mouse"&&b()}),onPointerDown:we(a.onPointerDown,_=>{w.current=_.pointerType}),onPointerMove:we(a.onPointerMove,_=>{var S;w.current=_.pointerType,i?(S=c.onItemLeave)==null||S.call(c):w.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:we(a.onPointerLeave,_=>{var S;_.currentTarget===document.activeElement&&((S=c.onItemLeave)==null||S.call(c))}),onKeyDown:we(a.onKeyDown,_=>{var N;((N=c.searchRef)==null?void 0:N.current)!==""&&_.key===" "||(Vde.includes(_.key)&&b(),_.key===" "&&_.preventDefault())})})})})});XV.displayName=U0;var Lm="SelectItemText",QV=x.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,...s}=t,a=Oc(Lm,r),o=Tc(Lm,r),c=YV(Lm,r),u=Gde(Lm,r),[d,f]=x.useState(null),p=it(e,b=>f(b),c.onItemTextChange,b=>{var _;return(_=o.itemTextRefCallback)==null?void 0:_.call(o,b,c.value,c.disabled)}),m=d==null?void 0:d.textContent,y=x.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:v,onNativeOptionRemove:w}=u;return hn(()=>(v(y),()=>w(y)),[v,w,y]),l.jsxs(l.Fragment,{children:[l.jsx(Oe.span,{id:c.textId,...s,ref:p}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Vi.createPortal(s.children,a.valueNode):null]})});QV.displayName=Lm;var e9="SelectItemIndicator",t9=x.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t;return YV(e9,r).isSelected?l.jsx(Oe.span,{"aria-hidden":!0,...n,ref:e}):null});t9.displayName=e9;var BE="SelectScrollUpButton",r9=x.forwardRef((t,e)=>{const r=Tc(BE,t.__scopeSelect),n=e2(BE,t.__scopeSelect),[i,s]=x.useState(!1),a=it(e,n.onScrollButtonChange);return hn(()=>{if(r.viewport&&r.isPositioned){let o=function(){const u=c.scrollTop>0;s(u)};const c=r.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[r.viewport,r.isPositioned]),i?l.jsx(i9,{...t,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=r;o&&c&&(o.scrollTop=o.scrollTop-c.offsetHeight)}}):null});r9.displayName=BE;var FE="SelectScrollDownButton",n9=x.forwardRef((t,e)=>{const r=Tc(FE,t.__scopeSelect),n=e2(FE,t.__scopeSelect),[i,s]=x.useState(!1),a=it(e,n.onScrollButtonChange);return hn(()=>{if(r.viewport&&r.isPositioned){let o=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;s(d)};const c=r.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[r.viewport,r.isPositioned]),i?l.jsx(i9,{...t,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=r;o&&c&&(o.scrollTop=o.scrollTop+c.offsetHeight)}}):null});n9.displayName=FE;var i9=x.forwardRef((t,e)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=t,s=Tc("SelectScrollButton",r),a=x.useRef(null),o=R_(r),c=x.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return x.useEffect(()=>()=>c(),[c]),hn(()=>{var d;const u=o().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[o]),l.jsx(Oe.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:we(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:we(i.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:we(i.onPointerLeave,()=>{c()})})}),afe="SelectSeparator",s9=x.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t;return l.jsx(Oe.div,{"aria-hidden":!0,...n,ref:e})});s9.displayName=afe;var zE="SelectArrow",ofe=x.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=I_(r),s=Oc(zE,r),a=Tc(zE,r);return s.open&&a.position==="popper"?l.jsx(j_,{...i,...n,ref:e}):null});ofe.displayName=zE;var lfe="SelectBubbleInput",a9=x.forwardRef(({__scopeSelect:t,value:e,...r},n)=>{const i=x.useRef(null),s=it(n,i),a=QP(e);return x.useEffect(()=>{const o=i.current;if(!o)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==e&&d){const f=new Event("change",{bubbles:!0});d.call(o,e),o.dispatchEvent(f)}},[a,e]),l.jsx(Oe.select,{...r,style:{...VU,...r.style},ref:s,defaultValue:e})});a9.displayName=lfe;function o9(t){return t===""||t===void 0}function l9(t){const e=Ci(t),r=x.useRef(""),n=x.useRef(0),i=x.useCallback(a=>{const o=r.current+a;e(o),function c(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(o)},[e]),s=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,s]}function c9(t,e,r){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let a=cfe(t,Math.max(s,0));i.length===1&&(a=a.filter(u=>u!==r));const c=a.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function cfe(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var ufe=LV,u9=DV,dfe=FV,ffe=zV,hfe=UV,d9=HV,pfe=KV,f9=JV,h9=XV,mfe=QV,gfe=t9,p9=r9,m9=n9,g9=s9;const Nt=ufe,Ct=dfe,_t=x.forwardRef(({className:t,children:e,...r},n)=>l.jsxs(u9,{ref:n,className:fe("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
641ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...r,children:[e,l.jsx(ffe,{asChild:!0,children:l.jsx(xp,{className:"h-4 w-4 opacity-50"})})]}));_t.displayName=u9.displayName;const v9=x.forwardRef(({className:t,...e},r)=>l.jsx(p9,{ref:r,className:fe("flex cursor-default items-center justify-center py-1",t),...e,children:l.jsx(Zae,{className:"h-4 w-4"})}));v9.displayName=p9.displayName;const y9=x.forwardRef(({className:t,...e},r)=>l.jsx(m9,{ref:r,className:fe("flex cursor-default items-center justify-center py-1",t),...e,children:l.jsx(xp,{className:"h-4 w-4"})}));y9.displayName=m9.displayName;const kt=x.forwardRef(({className:t,children:e,position:r="popper",...n},i)=>l.jsx(hfe,{children:l.jsxs(d9,{ref:i,className:fe("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",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,...n,children:[l.jsx(v9,{}),l.jsx(pfe,{className:fe("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),l.jsx(y9,{})]})}));kt.displayName=d9.displayName;const vfe=x.forwardRef(({className:t,...e},r)=>l.jsx(f9,{ref:r,className:fe("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));vfe.displayName=f9.displayName;const De=x.forwardRef(({className:t,children:e,...r},n)=>l.jsxs(h9,{ref:n,className:fe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),...r,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(gfe,{children:l.jsx(yp,{className:"h-4 w-4"})})}),l.jsx(mfe,{children:e})]}));De.displayName=h9.displayName;const yfe=x.forwardRef(({className:t,...e},r)=>l.jsx(g9,{ref:r,className:fe("-mx-1 my-1 h-px bg-muted",t),...e}));yfe.displayName=g9.displayName;var eD=1,xfe=.9,bfe=.8,wfe=.17,Vj=.1,Wj=.999,_fe=.9999,kfe=.99,Sfe=/[\\\/_+.#"@\[\(\{&]/,jfe=/[\\\/_+.#"@\[\(\{&]/g,Nfe=/[\s-]/,x9=/[\s-]/g;function UE(t,e,r,n,i,s,a){if(s===e.length)return i===t.length?eD:kfe;var o=`${i},${s}`;if(a[o]!==void 0)return a[o];for(var c=n.charAt(s),u=r.indexOf(c,i),d=0,f,p,m,y;u>=0;)f=UE(t,e,r,n,u+1,s+1,a),f>d&&(u===i?f*=eD:Sfe.test(t.charAt(u-1))?(f*=bfe,m=t.slice(i,u-1).match(jfe),m&&i>0&&(f*=Math.pow(Wj,m.length))):Nfe.test(t.charAt(u-1))?(f*=xfe,y=t.slice(i,u-1).match(x9),y&&i>0&&(f*=Math.pow(Wj,y.length))):(f*=wfe,i>0&&(f*=Math.pow(Wj,u-i))),t.charAt(u)!==e.charAt(s)&&(f*=_fe)),(f<Vj&&r.charAt(u-1)===n.charAt(s+1)||n.charAt(s+1)===n.charAt(s)&&r.charAt(u-1)!==n.charAt(s))&&(p=UE(t,e,r,n,u+1,s+2,a),p*Vj>f&&(f=p*Vj)),f>d&&(d=f),u=r.indexOf(c,u+1);return a[o]=d,d}function tD(t){return t.toLowerCase().replace(x9," ")}function Cfe(t,e,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,UE(t,e,tD(t),tD(e),0,0,{})}var L_="Dialog",[b9,w9]=Kn(L_),[Efe,ga]=b9(L_),_9=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:a=!0}=t,o=x.useRef(null),c=x.useRef(null),[u,d]=Yi({prop:n,defaultProp:i??!1,onChange:s,caller:L_});return l.jsx(Efe,{scope:e,triggerRef:o,contentRef:c,contentId:tn(),titleId:tn(),descriptionId:tn(),open:u,onOpenChange:d,onOpenToggle:x.useCallback(()=>d(f=>!f),[d]),modal:a,children:r})};_9.displayName=L_;var k9="DialogTrigger",S9=x.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=ga(k9,r),s=it(e,i.triggerRef);return l.jsx(Oe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":n2(i.open),...n,ref:s,onClick:we(t.onClick,i.onOpenToggle)})});S9.displayName=k9;var t2="DialogPortal",[Ofe,j9]=b9(t2,{forceMount:void 0}),N9=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:i}=t,s=ga(t2,e);return l.jsx(Ofe,{scope:e,forceMount:r,children:x.Children.map(n,a=>l.jsx(di,{present:r||s.open,children:l.jsx(mp,{asChild:!0,container:i,children:a})}))})};N9.displayName=t2;var H0="DialogOverlay",C9=x.forwardRef((t,e)=>{const r=j9(H0,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=ga(H0,t.__scopeDialog);return s.modal?l.jsx(di,{present:n||s.open,children:l.jsx(Afe,{...i,ref:e})}):null});C9.displayName=H0;var Tfe=gc("DialogOverlay.RemoveScroll"),Afe=x.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=ga(H0,r);return l.jsx(ky,{as:Tfe,allowPinchZoom:!0,shards:[i.contentRef],children:l.jsx(Oe.div,{"data-state":n2(i.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),ed="DialogContent",E9=x.forwardRef((t,e)=>{const r=j9(ed,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=ga(ed,t.__scopeDialog);return l.jsx(di,{present:n||s.open,children:s.modal?l.jsx(Pfe,{...i,ref:e}):l.jsx(Mfe,{...i,ref:e})})});E9.displayName=ed;var Pfe=x.forwardRef((t,e)=>{const r=ga(ed,t.__scopeDialog),n=x.useRef(null),i=it(e,r.contentRef,n);return x.useEffect(()=>{const s=n.current;if(s)return A_(s)},[]),l.jsx(O9,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(t.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:we(t.onPointerDownOutside,s=>{const a=s.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&s.preventDefault()}),onFocusOutside:we(t.onFocusOutside,s=>s.preventDefault())})}),Mfe=x.forwardRef((t,e)=>{const r=ga(ed,t.__scopeDialog),n=x.useRef(!1),i=x.useRef(!1);return l.jsx(O9,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,o;(a=t.onCloseAutoFocus)==null||a.call(t,s),s.defaultPrevented||(n.current||(o=r.triggerRef.current)==null||o.focus(),s.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:s=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((u=r.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),O9=x.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=t,o=ga(ed,r),c=x.useRef(null),u=it(e,c);return T_(),l.jsxs(l.Fragment,{children:[l.jsx(_y,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s,children:l.jsx(vd,{role:"dialog",id:o.c
vendor: 13,670 bytes, lines 641-645
641ontentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":n2(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(Ife,{titleId:o.titleId}),l.jsx($fe,{contentRef:c,descriptionId:o.descriptionId})]})]})}),r2="DialogTitle",T9=x.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=ga(r2,r);return l.jsx(Oe.h2,{id:i.titleId,...n,ref:e})});T9.displayName=r2;var A9="DialogDescription",P9=x.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=ga(A9,r);return l.jsx(Oe.p,{id:i.descriptionId,...n,ref:e})});P9.displayName=A9;var M9="DialogClose",R9=x.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=ga(M9,r);return l.jsx(Oe.button,{type:"button",...n,ref:e,onClick:we(t.onClick,()=>i.onOpenChange(!1))})});R9.displayName=M9;function n2(t){return t?"open":"closed"}var I9="DialogTitleWarning",[Rfe,L9]=Yse(I9,{contentName:ed,titleName:r2,docsSlug:"dialog"}),Ife=({titleId:t})=>{const e=L9(I9),r=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
642
643If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
644
645For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return x.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},Lfe="DialogDescriptionWarning",$fe=({contentRef:t,descriptionId:e})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${L9(Lfe).contentName}}.`;return x.useEffect(()=>{var s;const i=(s=t.current)==null?void 0:s.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(n))},[n,t,e]),null},$_=_9,i2=S9,D_=N9,Sp=C9,jp=E9,Sy=T9,jy=P9,B_=R9,gm='[cmdk-group=""]',qj='[cmdk-group-items=""]',Dfe='[cmdk-group-heading=""]',$9='[cmdk-item=""]',rD=`${$9}:not([aria-disabled="true"])`,HE="cmdk-item-select",sf="data-value",Bfe=(t,e,r)=>Cfe(t,e,r),D9=x.createContext(void 0),Ny=()=>x.useContext(D9),B9=x.createContext(void 0),s2=()=>x.useContext(B9),F9=x.createContext(void 0),z9=x.forwardRef((t,e)=>{let r=af(()=>{var U,J;return{search:"",value:(J=(U=t.value)!=null?U:t.defaultValue)!=null?J:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=af(()=>new Set),i=af(()=>new Map),s=af(()=>new Map),a=af(()=>new Set),o=U9(t),{label:c,children:u,value:d,onValueChange:f,filter:p,shouldFilter:m,loop:y,disablePointerSelection:v=!1,vimBindings:w=!0,...b}=t,_=tn(),S=tn(),N=tn(),j=x.useRef(null),C=Jfe();td(()=>{if(d!==void 0){let U=d.trim();r.current.value=U,O.emit()}},[d]),td(()=>{C(6,M)},[]);let O=x.useMemo(()=>({subscribe:U=>(a.current.add(U),()=>a.current.delete(U)),snapshot:()=>r.current,setState:(U,J,te)=>{var re,ae,oe,_e;if(!Object.is(r.current[U],J)){if(r.current[U]=J,U==="search")R(),$(),C(1,B);else if(U==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ne=document.getElementById(N);ne?ne.focus():(re=document.getElementById(_))==null||re.focus()}if(C(7,()=>{var ne;r.current.selectedItemId=(ne=F())==null?void 0:ne.id,O.emit()}),te||C(5,M),((ae=o.current)==null?void 0:ae.value)!==void 0){let ne=J??"";(_e=(oe=o.current).onValueChange)==null||_e.call(oe,ne);return}}O.emit()}},emit:()=>{a.current.forEach(U=>U())}}),[]),P=x.useMemo(()=>({value:(U,J,te)=>{var re;J!==((re=s.current.get(U))==null?void 0:re.value)&&(s.current.set(U,{value:J,keywords:te}),r.current.filtered.items.set(U,T(J,te)),C(2,()=>{$(),O.emit()}))},item:(U,J)=>(n.current.add(U),J&&(i.current.has(J)?i.current.get(J).add(U):i.current.set(J,new Set([U]))),C(3,()=>{R(),$(),r.current.value||B(),O.emit()}),()=>{s.current.delete(U),n.current.delete(U),r.current.filtered.items.delete(U);let te=F();C(4,()=>{R(),(te==null?void 0:te.getAttribute("id"))===U&&B(),O.emit()})}),group:U=>(i.current.has(U)||i.current.set(U,new Set),()=>{s.current.delete(U),i.current.delete(U)}),filter:()=>o.current.shouldFilter,label:c||t["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:_,inputId:N,labelId:S,listInnerRef:j}),[]);function T(U,J){var te,re;let ae=(re=(te=o.current)==null?void 0:te.filter)!=null?re:Bfe;return U?ae(U,r.current.search,J):0}function $(){if(!r.current.search||o.current.shouldFilter===!1)return;let U=r.current.filtered.items,J=[];r.current.filtered.groups.forEach(re=>{let ae=i.current.get(re),oe=0;ae.forEach(_e=>{let ne=U.get(_e);oe=Math.max(ne,oe)}),J.push([re,oe])});let te=j.current;q().sort((re,ae)=>{var oe,_e;let ne=re.getAttribute("id"),ue=ae.getAttribute("id");return((oe=U.get(ue))!=null?oe:0)-((_e=U.get(ne))!=null?_e:0)}).forEach(re=>{let ae=re.closest(qj);ae?ae.appendChild(re.parentElement===ae?re:re.closest(`${qj} > *`)):te.appendChild(re.parentElement===te?re:re.closest(`${qj} > *`))}),J.sort((re,ae)=>ae[1]-re[1]).forEach(re=>{var ae;let oe=(ae=j.current)==null?void 0:ae.querySelector(`${gm}[${sf}="${encodeURIComponent(re[0])}"]`);oe==null||oe.parentElement.appendChild(oe)})}function B(){let U=q().find(te=>te.getAttribute("aria-disabled")!=="true"),J=U==null?void 0:U.getAttribute(sf);O.setState("value",J||void 0)}function R(){var U,J,te,re;if(!r.current.search||o.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let ae=0;for(let oe of n.current){let _e=(J=(U=s.current.get(oe))==null?void 0:U.value)!=null?J:"",ne=(re=(te=s.current.get(oe))==null?void 0:te.keywords)!=null?re:[],ue=T(_e,ne);r.current.filtered.items.set(oe,ue),ue>0&&ae++}for(let[oe,_e]of i.current)for(let ne of _e)if(r.current.filtered.items.get(ne)>0){r.current.filtered.groups.add(oe);break}r.current.filtered.count=ae}function M(){var U,J,te;let re=F();re&&(((U=re.parentElement)==null?void 0:U.firstChild)===re&&((te=(J=re.closest(gm))==null?void 0:J.querySelector(Dfe))==null||te.scrollIntoView({block:"nearest"})),re.scrollIntoView({block:"nearest"}))}function F(){var U;return(U=j.current)==null?void 0:U.querySelector(`${$9}[aria-selected="true"]`)}function q(){var U;return Array.from(((U=j.current)==null?void 0:U.querySelectorAll(rD))||[])}function V(U){let J=q()[U];J&&O.setState("value",J.getAttribute(sf))}function W(U){var J;let te=F(),re=q(),ae=re.findIndex(_e=>_e===te),oe=re[ae+U];(J=o.current)!=null&&J.loop&&(oe=ae+U<0?re[re.length-1]:ae+U===re.length?re[0]:re[ae+U]),oe&&O.setState("value",oe.getAttribute(sf))}function z(U){let J=F(),te=J==null?void 0:J.closest(gm),re;for(;te&&!re;)te=U>0?Gfe(te,gm):Zfe(te,gm),re=te==null?void 0:te.querySelector(rD);re?O.setState("value",re.getAttribute(sf)):W(U)}let H=()=>V(q().length-1),G=U=>{U.preventDefault(),U.metaKey?H():U.altKey?z(1):W(1)},Y=U=>{U.preventDefault(),U.metaKey?V(0):U.altKey?z(-1):W(-1)};return x.createElement(Oe.div,{ref:e,tabIndex:-1,...b,"cmdk-root":"",onKeyDown:U=>{var J;(J=b.onKeyDown)==null||J.call(b,U);let te=U.nativeEvent.isComposing||U.keyCode===229;if(!(U.defaultPrevented||te))switch(U.key){case"n":case"j":{w&&U.ctrlKey&&G(U);break}case"ArrowDown":{G(U);break}case"p":case"k":{w&&U.ctrlKey&&Y(U);break}case"ArrowUp":{Y(U);break}case"Home":{U.preventDefault(),V(0);break}case"End":{U.preventDefault(),H();break}case"Enter":{U.preventDefault();let re=F();if(re){let ae=new Event(HE);re.dispatchEvent(ae)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:Xfe},c),F_(t,U=>x.createElement(B9.Provider,{value:O},x.createElement(D9.Provider,{value:P},U))))}),Ffe=x.forwardRef((t,e)=>{var r,n;let i=tn(),s=x.useRef(null),a=x.useContext(F9),o=Ny(),c=U9(t),u=(n=(r=c.current)==null?void 0:r.forceMount)!=null?n:a==null?void 0:a.forceMount;td(()=>{if(!u)return o.item(i,a==null?void 0:a.id)},[u]);let d=H9(i,s,[t.value,t.children,s],t.keywords),f=s2(),p=bc(C=>C.value&&C.value===d.current),m=bc(C=>u||o.filter()===!1?!0:C.search?C.filtered.items.get(i)>0:!0);x.useEffect(()=>{let C=s.current;if(!(!C||t.disabled))return C.addEventListener(HE,y),()=>C.removeEventListener(HE,y)},[m,t.onSelect,t.disabled]);function y(){var C,O;v(),(O=(C=c.current).onSelect)==null||O.call(C,d.current)}function v(){f.setState("value",d.current,!0)}if(!m)return null;let{disabled:w,value:b,onSelect:_,forceMount:S,keywords:N,...j}=t;return x.createElement(Oe.div,{ref:Fo(s,e),...j,id:i,"cmdk-item":"",role:"option","aria-disabled":!!w,"aria-selected":!!p,"data-disabled":!!w,"data-selected":!!p,onPointerMove:w||o.getDisablePointerSelection()?void 0:v,onClick:w?void 0:y},t.children)}),zfe=x.forwardRef((t,e)=>{let{heading:r,children:n,forceMount:i,...s}=t,a=tn(),o=x.useRef(null),c=x.useRef(null),u=tn(),d=Ny(),f=bc(m=>i||d.filter()===!1?!0:m.search?m.filtered.groups.has(a):!0);td(()=>d.group(a),[]),H9(a,o,[t.value,t.heading,c]);let p=x.useMemo(()=>({id:a,forceMount:i}),[i]);return x.createElement(Oe.div,{ref:Fo(o,e),...s,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},r&&x.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),F_(t,m=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},x.createElement(F9.Provider,{value:p},m))))}),Ufe=x.forwardRef((t,e)=>{let{alwaysRender:r,...n}=t,i=x.useRef(null),s=bc(a=>!a.search);return!r&&!s?null:x.createElement(Oe.div,{ref:Fo(i,e),...n,"cmdk-separator":"",role:"separator"})}),Hfe=x.forwardRef((t,e)=>{let{onValueChange:r,...n}=t,i=t.value!=null,s=s2(),a=bc(u=>u.search),o=bc(u=>u.selectedItemId),c=Ny();return x.useEffect(()=>{t.value!=null&&s.setState("search",t.value)},[t.value]),x.createElement(Oe.input,{ref:e,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":o,id:c.inputId,type:"text",value:i?t.value:a,onChange:u=>{i||s.setState("search",u.target.value),r==null||r(u.target.value)}})}),Vfe=x.forwardRef((t,e)=>{let{children:r,label:n="Suggestions",...i}=t,s=x.useRef(null),a=x.useRef(null),o=bc(u=>u.selectedItemId),c=Ny();return x.useEffect(()=>{if(a.current&&s.current){let u=a.current,d=s.current,f,p=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let m=u.offsetHeight;d.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return p.observe(u),()=>{cancelAnimationFrame(f),p.unobserve(u)}}},[]),x.createElement(Oe.div,{ref:Fo(s,e),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":n,id:c.listId},F_(t,u=>x.createElement("div",{ref:Fo(a,c.listInnerRef),"cmdk-list-sizer":""},u)))}),Wfe=x.forwardRef((t,e)=>{let{open:r,onOpenChange:n,overlayClassName:i,contentClassName:s,container:a,...o}=t;return x.createElement($_,{open:r,onOpenChange:n},x.createElement(D_,{container:a},x.createElement(Sp,{"cmdk-overlay":"",className:i}),x.createElement(jp,{"aria-label":t.label,"cmdk-dialog":"",className:s},x.createElement(z9,{ref:e,...o}))))}),qfe=x.forwardRef((t,e)=>bc(r=>r.filtered.count===0)?x.createElement(Oe.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),Kfe=x.forwardRef((t,e)=>{let{progress:r,children:n,label:i="Loading...",...s}=t;return x.createElement(Oe.div,{ref:e,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},F_(t,a=>x.createElement("div",{"aria-hidden":!0},a)))}),Ai=Object.assign(z9,{List:Vfe,Item:Ffe,Input:Hfe,Group:zfe,Separator:Ufe,Dialog:Wfe,Empty:qfe,Loading:Kfe});function Gfe(t,e){let r=t.nextElementSibling;for(;r;){if(r.matches(e))return r;r=r.nextElementSibling}}function Zfe(t,e){let r=t.previousElementSibling;for(;r;){if(r.matches(e))return r;r=r.previousElementSibling}}function U9(t){let e=x.useRef(t);return td(()=>{e.current=t}),e}var td=typeof window>"u"?x.useEffect:x.useLayoutEffect;function af(t){let e=x.useRef();return e.current===void 0&&(e.current=t()),e}function bc(t){let e=s2(),r=()=>t(e.snapshot());return x.useSyncExternalStore(e.subscribe,r,r)}function H9(t,e,r,n=[]){let i=x.useRef(),s=Ny();return td(()=>{var a;let o=(()=>{var u;for(let d of r){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():i.current}})(),c=n.map(u=>u.trim());s.value(t,o,c),(a=e.current)==null||a.setAttribute(sf,o),i.current=o}),i}var Jfe=()=>{let[t,e]=x.useState(),r=af(()=>new Map);return td(()=>{r.current.forEach(n=>n()),r.current=new Map},[t]),(n,i)=>{r.current.set(n,i),e({})}};function Yfe(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function F_({asChild:t,children:e},r){return t&&x.isValidElement(e)?x.cloneElement(Yfe(e),{ref:e.ref},r(e.props.children)):r(e)}var Xfe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Xi=$_,Qfe=i2,ehe=D_,V9=x.forwardRef(({className:t,...e},r)=>l.jsx(Sp,{ref:r,className:fe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));V9.displayName=Sp.displayName;const Ei=x.forwardRef(({className:t,children:e,...r},n)=>l.jsxs(ehe,{children:[l.jsx(V9,{}),l.jsxs(jp,{ref:n,className:fe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
645nded-lg",t),...r,children:[e,l.jsxs(B_,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[l.jsx(Wi,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ei.displayName=jp.displayName;const Ms=({className:t,...e})=>l.jsx("div",{className:fe("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});Ms.displayName="DialogHeader";const Vo=({className:t,...e})=>l.jsx("div",{className:fe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Vo.displayName="DialogFooter";const Rs=x.forwardRef(({className:t,...e},r)=>l.jsx(Sy,{ref:r,className:fe("text-lg font-semibold leading-none tracking-tight",t),...e}));Rs.displayName=Sy.displayName;const xd=x.forwardRef(({className:t,...e},r)=>l.jsx(jy,{ref:r,className:fe("text-sm text-muted-foreground",t),...e}));xd.displayName=jy.displayName;const a2=x.forwardRef(({className:t,...e},r)=>l.jsx(Ai,{ref:r,className:fe("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));a2.displayName=Ai.displayName;const o2=x.forwardRef(({className:t,...e},r)=>l.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[l.jsx(ma,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),l.jsx(Ai.Input,{ref:r,className:fe("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...e})]}));o2.displayName=Ai.Input.displayName;const l2=x.forwardRef(({className:t,...e},r)=>l.jsx(Ai.List,{ref:r,className:fe("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));l2.displayName=Ai.List.displayName;const c2=x.forwardRef((t,e)=>l.jsx(Ai.Empty,{ref:e,className:"py-6 text-center text-sm",...t}));c2.displayName=Ai.Empty.displayName;const u2=x.forwardRef(({className:t,...e},r)=>l.jsx(Ai.Group,{ref:r,className:fe("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...e}));u2.displayName=Ai.Group.displayName;const the=x.forwardRef(({className:t,...e},r)=>l.jsx(Ai.Separator,{ref:r,className:fe("-mx-1 h-px bg-border",t),...e}));the.displayName=Ai.Separator.displayName;const d2=x.forwardRef(({className:t,...e},r)=>l.jsx(Ai.Item,{ref:r,className:fe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",t),...e}));d2.displayName=Ai.Item.displayName;var z_="Popover",[W9,FZe]=Kn(z_,[Ec]),Cy=Ec(),[rhe,Ac]=W9(z_),q9=t=>{const{__scopePopover:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:a=!1}=t,o=Cy(e),c=x.useRef(null),[u,d]=x.useState(!1),[f,p]=Yi({prop:n,defaultProp:i??!1,onChange:s,caller:z_});return l.jsx(k_,{...o,children:l.jsx(rhe,{scope:e,contentId:tn(),triggerRef:c,open:f,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(m=>!m),[p]),hasCustomAnchor:u,onCustomAnchorAdd:x.useCallback(()=>d(!0),[]),onCustomAnchorRemove:x.useCallback(()=>d(!1),[]),modal:a,children:r})})};q9.displayName=z_;var K9="PopoverAnchor",nhe=x.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=Ac(K9,r),s=Cy(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:o}=i;return x.useEffect(()=>(a(),()=>o()),[a,o]),l.jsx(by,{...s,...n,ref:e})});nhe.displayName=K9;var G9="PopoverTrigger",Z9=x.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=Ac(G9,r),s=Cy(r),a=it(e,i.triggerRef),o=l.jsx(Oe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":eW(i.open),...n,ref:a,onClick:we(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?o:l.jsx(by,{asChild:!0,...s,children:o})});Z9.displayName=G9;var f2="PopoverPortal",[ihe,she]=W9(f2,{forceMount:void 0}),J9=t=>{const{__scopePopover:e,forceMount:r,children:n,container:i}=t,s=Ac(f2,e);return l.jsx(ihe,{scope:e,forceMount:r,children:l.jsx(di,{present:r||s.open,children:l.jsx(mp,{asChild:!0,container:i,children:n})})})};J9.displayName=f2;var Eh="PopoverContent",Y9=x.forwardRef((t,e)=>{const r=she(Eh,t.__scopePopover),{forceMount:n=r.forceMount,...i}=t,s=Ac(Eh,t.__scopePopover);return l.jsx(di,{present:n||s.open,children:s.modal?l.jsx(ohe,{...i,ref:e}):l.jsx(lhe,{...i,ref:e})})});Y9.displayName=Eh;var ahe=gc("PopoverContent.RemoveScroll"),ohe=x.forwardRef((t,e)=>{const r=Ac(Eh,t.__scopePopover),n=x.useRef(null),i=it(e,n),s=x.useRef(!1);return x.useEffect(()=>{const a=n.current;if(a)return A_(a)},[]),l.jsx(ky,{as:ahe,allowPinchZoom:!0,children:l.jsx(X9,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(t.onCloseAutoFocus,a=>{var o;a.preventDefault(),s.current||(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:we(t.onPointerDownOutside,a=>{const o=a.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0,u=o.button===2||c;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:we(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),lhe=x.forwardRef((t,e)=>{const r=Ac(Eh,t.__scopePopover),n=x.useRef(!1),i=x.useRef(!1);return l.jsx(X9,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,o;(a=t.onCloseAutoFocus)==null||a.call(t,s),s.defaultPrevented||(n.current||(o=r.triggerRef.current)==null||o.focus(),s.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:s=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((u=r.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),X9=x.forwardRef((t,e)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=t,p=Ac(Eh,r),m=Cy(r);return T_(),l.jsx(_y,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s,children:l.jsx(vd,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),children:l.jsx(S_,{"data-state":eW(p.open),role:"dialog",id:p.contentId,...m,...f,ref:e,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Q9="PopoverClose",che=x.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=Ac(Q9,r);return l.jsx(Oe.button,{type:"button",...n,ref:e,onClick:we(t.onClick,()=>i.onOpenChange(!1))})});che.displayName=Q9;var uhe="PopoverArrow",dhe=x.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=Cy(r);return l.jsx(j_,{...i,...n,ref:e})});dhe.displayName=uhe;function eW(t){return t?"open":"closed"}var fhe=q9,hhe=Z9,phe=J9,tW=Y9;const h2=fhe,p2=hhe,U_=x.forwardRef(({className:t,align:e="center",sideOffset:r=4,...n},i)=>l.jsx(phe,{children:l.jsx(tW,{ref:i,align:e,sideOffset:r,className:fe("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
645de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));U_.displayName=tW.displayName;function H_({value:t,onChange:e,options:r,placeholder:n="Välj stad",className:i}){const[s,a]=x.useState(!1);return l.jsxs(h2,{open:s,onOpenChange:a,children:[l.jsx(p2,{asChild:!0,children:l.jsxs(se,{variant:"outline",role:"combobox","aria-expanded":s,className:fe("w-full justify-between font-normal",!t&&"text-muted-foreground",i),children:[l.jsxs("span",{className:"flex items-center gap-2 truncate",children:[l.jsx(Vn,{className:"h-4 w-4 shrink-0 opacity-60"}),t||n]}),l.jsx(bH,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),l.jsx(U_,{className:"w-[--radix-popover-trigger-width] p-0 bg-popover",align:"start",children:l.jsxs(a2,{children:[l.jsx(o2,{placeholder:"Sök stad…"}),l.jsxs(l2,{children:[l.jsx(c2,{children:"Ingen stad hittades."}),l.jsx(u2,{children:r.map(o=>l.jsxs(d2,{value:o,onSelect:()=>{e(o),a(!1)},children:[l.jsx(yp,{className:fe("mr-2 h-4 w-4",t===o?"opacity-100":"opacity-0")}),o]},o))})]})]})})]})}const mhe=["Alla områden","Abrahamsberg","Alvik","Aspudden","Axelsberg","Bagarmossen","Bandhagen","Barkarby","Bergshamra","Birkastan","Bjorkhagen","Blackeberg","Blåsut","Brandbergen","Bredang","Bro","Bromma","Brommaplan","Bromsten","Dalaro","Danderyd","Danviksklippan","Djurgarden","Djursholm","Drottningholm","Edsviken","Ekerö","Ekolsund","Enköping","Enskede","Enskededalen","Farsta","Farsta Strand","Fisksätra","Fittja","Flemingsberg","Fredhäll","Fridhemsplan","Fruängen","G:a Bagarmossen","G:a Enskede","G:a Rogsved","G:a Råsunda","Gamla Spånga","Gamla Stan","Globen","Gröndal","Gubbängen","Gullmarsplan","Gustavberg","Gärdet","Göteborg","Gotland","GÄVLE","Hagsätra","Hallonbergen","Hallunda","Hammarby","Hammarbyhöjden","Hammarbysjöstad","Handen","Haninge","Hjorthagen","Hjulsta","Hornstull","Huddinge","Husby","Hägersten","Hägerstensåsen","Hässelby","Hässelby Gård","Hässelby Strand","Hässelby Villastad","Högdalen","Johanneshov","Jordbro","Järfälla","Järfälla/Viksjö","Kallhäll","Karlaplan","Kista","Kristineberg","Kungsholmen","Kungsholmsklippan","Kungsängen","Kärrtorp","Lappkärr
645sberget","Lidingö","Liljeholmen","Lilla Essingen","Mariatorget","Mariefred","Midsommarkransen","Mora","Mälarhöjden","Märsta","Mörby","Nacka","Norra Brunn","Norra Djurgårdsstaden","Norrmalm","Norsborg","Nynäshamn","Odenplan","Orminge","Rinkeby","Rissne","Ropsten","Roslagstull","Rotebro","Rågsved","Rönninge","S:t Eriksplan","Salem","Saltsjö-Boo","Saltsjöbaden","Sandviken","Segeltorp","Sigtuna","Skanstull","Skarpnäck","Skogås","Skärholmen","Skärmarbrink","Sköndal","Slagsta","Slussen","Sollentuna","Solna","Solna/Järvastaden","Solna/Råsunda","Spånga","Spånga/Vinsta","Stockholm City","Stocksund","Stora Essingen","Storholmen","Strängnäs","Stureby","Stureplan","Stuvsta","Sundbyberg","Sundbyberg/Hallonbergen","Sundbyberg/Rissne","Sätra","Södermalm","Södertälje","Södra Vallentuna","Tallkrogen","Telefonplan","Tensta","Thorildsplan","Traneberg","Trångsund","Tullinge","Tumba","Tyresö","Täby","Ulvsunda","Universitetet","Upplands-Väsby","Uppsala","Vallentuna","Vasastan","Vasastan/Birkastan","Vasastan/Norrmalm","Vaxholm","Vendelsö","Viksjö","Vårberg","Vårby","Vårby Gård","Vällingby","Värmdö","Västertorp","Västrahaninge","Västerås","Zinkensdamm","Åkersberga","Årsta","Älvsjö","Örby","Ösmo","Östberga","Östermalm","Österskär"],ghe=[0,15e3,2e4,25e3,3e4,4e4,5e4,75e3,1e5,15e4,2e5,3e5,4e5,5e5],nD=[1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6],vhe=["Alla","Lägenhet","Villa","Radhus","Rum"],yhe=["Alla","Möblerat","Omöblerat","Delvis möblerat"],V0={"Stockholm City":[59.3293,18.0686],"Gamla Stan":[59.3257,18.0712],Norrmalm:[59.3345,18.0633],Östermalm:[59.337,18.083],Södermalm:[59.3155,18.072],Kungsholmen:[59.3308,18.0388],Vasastan:[59.3439,18.0489],"Vasastan/Birkastan":[59.3415,18.0395],"Vasastan/Norrmalm":[59.341,18.053],Birkastan:[59.3415,18.0395],Gärdet:[59.3445,18.101],Hjorthagen:[59.353,18.105],"Norra Djurgårdsstaden":[59.347,18.103],Djurgarden:[59.3258,18.115],Fridhemsplan:[59.333,18.036],Kristineberg:[59.334,18.014],Stadshagen:[59.336,18.024],"Lilla Essingen":[59.324,18.003],"Stora Essingen":[59.317,17.992],Karlaplan:[59.338,18.093],Stureplan:[59.336,18.075],Mariatorget:[59.3175,18.0625],Hornstull:[59.3145,18.037],Zinkensdamm:[59.317,18.05],Slussen:[59.32,18.072],Skanstull:[59.306,18.078],"S:t Eriksplan":[59.343,18.0395],Odenplan:[59.343,18.05],Roslagstull:[59.347,18.061],Thorildsplan:[59.332,18.022],Fredhäll:[59.329,18.015],Kungsholmsklippan:[59.327,18.026],Ropsten:[59.3585,18.101],Universitetet:[59.365,18.057],Lappkärrsberget:[59.368,18.066],Liljeholmen:[59.3105,18.024],Gröndal:[59.311,17.997],Aspudden:[59.305,18.005],Midsommarkransen:[59.301,18.015],Telefonplan:[59.2985,18.014],Hägersten:[59.298,17.998],Hägerstensåsen:[59.292,18.004],Mälarhöjden:[59.286,17.987],Västertorp:[59.292,17.997],Fruängen:[59.286,17.965],Älvsjö:[59.279,18.008],Örby:[59.272,18.068],Bandhagen:[59.271,18.079],Högdalen:[59.267,18.09],Rågsved:[59.258,18.089],Hagsätra:[59.258,18.064],Bredang:[59.292,17.929],Sätra:[59.282,17.93],Skärholmen:[59.277,17.908],Vårberg:[59.273,17.891],Vårby:[59.263,17.877],"Vårby Gård":[59.262,17.878],Segeltorp:[59.287,17.946],Stuvsta:[59.251,17.977],Huddinge:[59.237,17.982],Flemingsberg:[59.223,17.942],Tullinge:[59.197,17.9],Tumba:[59.2,17.835],Salem:[59.201,17.772],Rönninge:[59.199,17.744],Norsborg:[59.244,17.812],Hallunda:[59.248,17.824],Slagsta:[59.248,17.842],Fittja:[59.25,17.86],Alby:[59.244,17.858],Sundbyberg:[59.3613,17.971],"Sundbyberg/Hallonbergen":[59.37,17.965],"Sundbyberg/Rissne":[59.376,17.956],Hallonbergen:[59.37,17.965],Rissne:[59.376,17.956],Solna:[59.36,18],"Solna/Järvastaden":[59.385,17.987],"Solna/Råsunda":[59.364,17.993],"G:a Råsunda":[59.364,17.993],Bergshamra:[59.387,18.044],Stocksund:[59.395,18.042],Danderyd:[59.406,18.033],Mörby:[59.403,18.041],Djursholm:[59.398,18.082],Lidingö:[59.364,18.138],Storholmen:[59.376,18.149],Bromma:[59.345,17.947],Brommaplan:[59.34,17.939],Alvik:[59.334,17.981],Traneberg:[59.338,17.974],Abrahamsberg:[59.343,17.946],Ulvsunda:[59.349,17.958],Blackeberg:[59.354,17.895],Vällingby:[59.364,17.873],Hässelby:[59.368,17.835],"Hässelby Gård":[59.365,17.835],"Hässelby Strand":[59.362,17.824],"Hässelby Villastad":[59.369,17.826],Spånga:[59.383,17.899],"Gamla Spånga":[59.383,17.899],"Spånga/Vinsta":[59.37,17.858],Bromsten:[59.385,17.907],Rinkeby:[59.388,17.927],Tensta:[59.395,17.902],Hjulsta:[59.397,17.887],Husby:[59.409,17.922],Kista:[59.403,17.944],Akalla:[59.414,17.913],Barkarby:[59.416,17.873],Järfälla:[59.422,17.84],"Järfälla/Viksjö":[59.418,17.821],Viksjö:[59.418,17.821],Jakobsberg:[59.424,17.835],Kallhäll:[59.448,17.812],Bro:[59.513,17.636],Kungsängen:[59.479,17.744],"Upplands-Väsby":[59.518,17.908],Sollentuna:[59.428,17.951],Rotebro:[59.479,17.917],Hammarby:[59.305,18.107],Hammarbyhöjden:[59.296,18.106],Hammarbysjöstad:[59.305,18.101],Johanneshov:[59.3,18.09],Globen:[59.294,18.081],Gullmarsplan:[59.298,18.081],Skärmarbrink:[59.289,18.093],Blåsut:[59.287,18.105],Enskede:[59.281,18.081],"G
645:a Enskede":[59.282,18.078],Enskededalen:[59.275,18.09],Stureby:[59.271,18.07],Östberga:[59.275,18.056],Årsta:[59.298,18.05],Tallkrogen:[59.273,18.089],Gubbängen:[59.268,18.095],Farsta:[59.244,18.093],"Farsta Strand":[59.236,18.095],Sköndal:[59.254,18.114],Skarpnäck:[59.268,18.128],Bagarmossen:[59.278,18.13],"G:a Bagarmossen":[59.278,18.13],Kärrtorp:[59.287,18.123],Bjorkhagen:[59.286,18.121],Trångsund:[59.224,18.148],Skogås:[59.22,18.152],Handen:[59.169,18.139],Haninge:[59.169,18.139],Jordbro:[59.148,18.118],Brandbergen:[59.16,18.153],Västrahaninge:[59.118,18.096],Nynäshamn:[58.902,17.947],Ösmo:[58.976,17.899],Dalaro:[59.133,18.402],Tyresö:[59.244,18.23],Vendelsö:[59.211,18.209],Nacka:[59.31,18.164],"Saltsjö-Boo":[59.321,18.258],Saltsjöbaden:[59.282,18.305],Fisksätra:[59.292,18.262],Orminge:[59.326,18.23],Gustavberg:[59.326,18.385],Värmdö:[59.322,18.471],Vaxholm:[59.402,18.349],Åkersberga:[59.479,18.296],Österskär:[59.481,18.329],Österåker:[59.479,18.296],Vallentuna:[59.534,18.078],"Södra Vallentuna":[59.506,18.053],Täby:[59.444,18.068],Edsviken:[59.404,17.989],Märsta:[59.624,17.854],Sigtuna:[59.617,17.724],Drottningholm:[59.322,17.886],Ekerö:[59.29,17.812],Ekolsund:[59.605,17.466],Göteborg:[57.7089,11.9746],Uppsala:[59.8586,17.6389],Västerås:[59.6099,16.5448],Södertälje:[59.1955,17.6253],Strängnäs:[59.3777,17.0297],Mariefred:[59.258,17.228],Enköping:[59.636,17.078],Sandviken:[60.6157,16.7762],GÄVLE:[60.6749,17.1413],Mora:[61,14.5333],Gotland:[57.4684,18.4867],"Norra Brunn":[59.342,18.059],Danviksklippan:[59.312,18.101],Malmö:[55.605,13.0038],Gävle:[60.6749,17.1413]};function xhe(t,e){const r=u=>u*Math.PI/180,i=r(e[0]-t[0]),s=r(e[1]-t[1]),a=r(t[0]),o=r(e[0]),c=Math.sin(i/2)**2+Math.sin(s/2)**2*Math.cos(a)*Math.cos(o);return 2*6371*Math.asin(Math.sqrt(c))}function m2(t,e,r){if(r<=0)return t===e;const n=V0[t],i=V0[e];return!n||!i?t===e:xhe(n,i)<=r}const g2=[0,5,10,25,50],bhe=[1e4,15e3,2e4,25e3,3e4,4e4,5e4,75e3,1e5,15e4,2e5,3e5,4e5,5e5],iD=[1,2,3,4,5,6],whe=()=>{const{t}=JP(),e=[{value:"Lägenhet",label:t("search.apartment"),icon:vc},{value:"Villa",label:t("search.villa"),icon:Ss},{value:"Radhus",label:t("search.townhouse"),icon:Ss},{value:"Rum",label:t("search.room"),icon:PP}],r=Ti(),[n,i]=x.useState("Alla"),[s,a]=x.useState("Alla områden"),[o,c]=x.useState("0"),[u,d]=x.useState(""),[f,p]=x.useState(""),[m,y]=x.useState(""),[v,w]=x.useState(!1),b=()=>{const _=new URLSearchParams;n!=="Alla"&&_.set("type",n),s!=="Alla områden"&&_.set("area",s),o&&o!=="0"&&_.set("radiusKm",o),u&&_.set("maxRent",u),f&&_.set("roomsMin",f),m&&_.set("roomsMax",m),r(`/bostader${_.toString()?`?${_}`:""}`)};return l.jsxs("div",{className:"w-full max-w-md bg-background rounded-2xl shadow-2xl p-4 sm:p-5 space-y-3.5 border border-border/50",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-bold text-foreground",children:t("search.title")}),l.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:t("search.subtitle")})]}),l.jsxs("div",{children:[l.jsxs("label",{className:"flex items-center gap-2 text-xs font-semibold text-foreground mb-1.5",children:[l.jsx(Ss,{className:"h-3.5 w-3.5 text-muted-foreground"})," ",t("search.propertyType")]}),l.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[l.jsx("button",{type:"button",onClick:()=>i("Alla"),className:`px-3 py-1 rounded-full text-xs font-medium border transition-colors ${n==="Alla"?"bg-primary text-primary-foreground border-primary":"bg-background text-foreground border-border hover:border-primary/50"}`,children:t("search.all")}),e.map(_=>l.jsx("button",{type:"button",onClick:()=>i(_.value),className:`px-3 py-1 rounded-full text-xs font-medium border transition-colors ${n===_.value?"bg-primary text-primary-foreground border-primary":"bg-background text-foreground border-border hover:border-primary/50"}`,children:_.label},_.value))]})]}),l.jsxs("div",{children:[l.jsxs("label",{className:"flex items-center gap-2 text-xs font-semibold text-foreground mb-1.5",children:[l.jsx(Vn,{className:"h-3.5 w-3.5 text-muted-foreground"})," ",t("search.city")]}),l.jsx(H_,{value:s==="Alla områden"?"":s,onChange:_=>a(_||"Alla områden"),options:mhe.filter(_=>_!=="Alla områden"),placeholder:t("search.cityPlaceholder")})]}),l.jsxs("div",{children:[l.jsxs("label",{className:"flex items-center gap-2 text-xs font-semibold text-foreground mb-1.5",children:[l.jsx(vp,{className:"h-3.5 w-3.5 text-muted-foreground"})," ",t("search.rooms")]}),l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsxs(Nt,{value:f,onValueChange:p,children:[l.jsx(_t,{className:"bg-background h-9",children:l.jsx(Ct,{placeholder:t("search.min")})}),l.jsx(kt,{children:iD.map(_=>l.jsx(De,{value:String(_),children:_},_))})]}),l.jsxs(Nt,{value:m,onValueChange:y,children:[l.jsx(_t,{className:"bg-background h-9",children:l.jsx(Ct,{placeholder:t("search.max")})}),l.jsx(kt,{children:iD.map(_=>l.jsx(De,{value:String(_),children:_},_))})]})]})]}),v&&l.jsxs("div",{className:"space-y-3.5 pt-1 animate-fade-in",children:[l.jsxs("div",{children:[l.jsxs("label",{className:"flex items-center gap-2 text-xs font-semibold text-foreground mb-1.5",children:[l.jsx(EH,{className:"h-3.5 w-3.5 text-muted-foreground"})," Utöka område med"]}),l.jsxs(Nt,{value:o,onValueChange:c,disabled:s==="Alla områden",children:[l.jsx(_t,{className:"w-full bg-background h-9",children:l.jsx(Ct,{placeholder:"+ 0 km"})}),l.jsx(kt,{children:g2.map(_=>l.jsx(De,{value:String(_),children:_===0?"Endast vald stad":`+ ${_} km`},_))})]}),s==="Alla områden"&&l.jsx("p",{className:"text-[11px] text-muted-foreground mt-1",children:"Välj en stad först"})]}),l.jsxs("div",{children:[l.jsxs("label",{className:"flex items-center gap-2 text-xs font-semibold text-foreground mb-1.5",children:[l.jsx(Aoe,{className:"h-3.5 w-3.5 text-muted-foreground"})," ",t("search.maxRent")]}),l.jsxs(Nt,{value:u,onValueChange:_=>d(_==="0"?"":_),children:[l.jsx(_t,{className:"w-full bg-background h-9",children:l.jsx(Ct,{placeholder:t("search.maxRent")}
645)}),l.jsxs(kt,{children:[l.jsx(De,{value:"0",children:"Ingen gräns"}),bhe.map(_=>l.jsxs(De,{value:String(_),children:[_.toLocaleString("sv-SE")," kr"]},_))]})]})]})]}),l.jsxs("button",{type:"button",onClick:()=>w(_=>!_),className:"flex items-center gap-1 text-xs font-semibold text-foreground hover:text-primary transition-colors",children:["Fler sökfilter",l.jsx(xp,{className:`h-3.5 w-3.5 transition-transform ${v?"rotate-180":""}`})]}),l.jsx(se,{onClick:b,variant:"hero",size:"lg",className:"w-full h-11 text-base",children:t("search.submit")})]})},_he=()=>{const{t}=JP();return l.jsxs("section",{className:"relative pt-14 md:pt-16 overflow-hidden",children:[l.jsxs("div",{className:"absolute inset-0 z-0",children:[l.jsx("img",{src:Kue,alt:"Företagsbostad i Stockholm",className:"w-full h-full object-cover"}),l.jsx("div",{className:"absolute inset-0 bg-foreground/65"})]}),l.jsx("div",{className:"relative z-10 container mx-auto px-10 md:px-14 py-8 sm:py-10 md:py-10 lg:py-12",children:l.jsxs("div",{className:"grid lg:grid-cols-2 gap-5 lg:gap-8 items-center",children:[l.jsxs("div",{className:"space-y-3 md:space-y-4 animate-fade-up text-center lg:text-left",children:[l.jsxs("div",{className:"inline-flex items-center gap-2 text-primary-foreground/80 text-xs sm:text-sm font-medium uppercase tracking-[0.2em] justify-center lg:justify-start",children:[l.jsx("span",{className:"h-px w-8 bg-primary"}),l.jsx("span",{children:t("hero.sedan")})]}),l.jsxs("h1",{className:"text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-extrabold leading-[1.15] text-primary-foreground",children:[t("hero.titlePart1")," ",l.jsx("span",{className:"text-primary",children:t("hero.titlePart2")})]}),l.jsx("p",{className:"hidden sm:block text-base sm:text-lg md:text-xl text-primary-foreground/80 max-w-xl mx-auto lg:mx-0 leading-relaxed",children:t("hero.subtitle")}),l.jsxs("div",{className:"hidden sm:flex flex-col sm:flex-row gap-3 sm:gap-4 pt-1 justify-center lg:justify-start",children:[l.jsx(se,{variant:"hero",size:"xl",className:"w-full sm:w-auto h-13 sm:h-auto text-base",asChild:!0,children:l.jsx("a",{href:"#kontakt",children:t("hero.ctaPrimary")})}),l.jsx(se,{variant:"hero-outline",size:"xl",className:"w-full sm:w-auto h-13 sm:h-auto text-base bg-primary-foreground/10 backdrop-blur-sm border-primary-foreground/30 text-primary-foreground hover:bg-primary-foreground/20",asChild:!0,children:l.jsx("a",{href:"#bostader",children:t("hero.ctaSecondary")})})]})]}),l.jsx("div",{className:"flex justify-center lg:justify-end animate-fade-up",children:l.jsx(whe,{})})]})})]})},khe="/assets/spotify-VgpLkaUN.png",She="/assets/hm-B3ByGEXH.png",jhe="/assets/klarna-ByJpjKKz.png",Nhe="/assets/skanska-CKGvAeWo.png",Che="/assets/ericsson-B5Qm6hWi.png",Ehe="/assets/sveaskog-DfnET31X.png",Ohe="/assets/tele2-DeUpqmZG.png",The="/assets/huawei-Bcoajk_Y.png",Ahe="/assets/tietoenator-CPTzqK9w.png",sD=[{src:khe,alt:"Spotify"},{src:She,alt:"H&M"},{src:jhe,alt:"Klarna"},{src:Nhe,alt:"Skanska"},{src:Che,alt:"Ericsson"},{src:Ehe,alt:"Sveaskog"},{src:Ohe,alt:"Tele2"},{src:The,alt:"Huawei"},{src:Ahe,alt:"TietoEnator"}],rW=({compact:t=!1})=>{const e=[...sD,...sD];return l.jsxs("section",{className:`${t?"py-6 sm:py-8":"py-10 sm:py-14"} bg-accent/50 border-y border-border/40 overflow-hidden`,children:[l.jsx("div",{className:"container mx-auto px-10 md:px-14",children:l.jsx("p",{className:`text-center text-xs font-semibold text-muted-foreground uppercase tracking-wider ${t?"mb-4 sm:mb-5":"sm:text-sm mb-6 sm:mb-8"}`,children:"Företag som anlitat oss"})}),l.jsx("div",{className:"group relative w-full overflow-hidden",style:{maskImage:"linear-gradient(to right, transparent, black 8%, black 92%, transparent)",WebkitMaskImage:"linear-gradient(to right, transparent, black 8%, black 92%, transparent)"},children:l.jsx("div",{className:`flex w-max animate-marquee group-hover:[animation-play-state:paused] ${t?"gap-8 sm:gap-12 md:gap-14":"gap-12 sm:gap-16 md:gap-20"}`,children:e.map((r,n)=>{const i=t?r.alt==="Huawei"?"h-8 sm:h-10 md:h-12":"h-6 sm:h-7 md:h-8":r.alt==="Huawei"?"h-12 sm:h-16 md:h-20":"h-8 sm:h-10 md:h-12";return l.jsx("img",{src:r.src,alt:r.alt,className:`${i} w-auto object-contain grayscale opacity-60 hover:grayscale-0 hover:opacity-100 transition-all duration-300 shrink-0`},`${r.alt}-${n}`)})})})]})};function V_(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Phe(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(d){try{u(n.next(d))}catch(f){a(f)}}function c(d){try{u(n.throw(d))}catch(f){a(f)}}function u(d){d.done?s(d.value):i(d.value).then(o,c)}u((n=n.apply(t,e||[])).next())})}const Mhe=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);
645class v2 extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class Rhe extends v2{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class aD extends v2{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class oD extends v2{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var VE;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(VE||(VE={}));class Ihe{constructor(e,{headers:r={},customFetch:n,region:i=VE.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=Mhe(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return Phe(this,arguments,void 0,function*(r,n={}){var i;let s,a;try{const{headers:o,method:c,body:u,signal:d,timeout:f}=n;let p={},{region:m}=n;m||(m=this.region);const y=new URL(`${this.url}/${r}`);m&&m!=="any"&&(p["x-region"]=m,y.searchParams.set("forceFunctionRegion",m));let v;u&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(p["Content-Type"]="application/octet-stream",v=u):typeof u=="string"?(p["Content-Type"]="text/plain",v=u):typeof FormData<"u"&&u instanceof FormData?v=u:(p["Content-Type"]="application/json",v=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?v=JSON.stringify(u):v=u;let w=d;f&&(a=new AbortController,s=setTimeout(()=>a.abort(),f),d?(w=a.signal,d.addEventListener("abort",()=>a.abort())):w=a.signal);const b=yield this.fetch(y.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},p),this.headers),o),body:v,signal:w}).catch(j=>{throw new Rhe(j)}),_=b.headers.get("x-relay-error");if(_&&_==="true")throw new aD(b);if(!b.ok)throw new oD(b);let S=((i=b.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),N;return S==="application/json"?N=yield b.json():S==="application/octet-stream"||S==="application/pdf"?N=yield b.blob():S==="text/event-stream"?N=b:S==="multipart/form-data"?N=yield b.formData():N=yield b.text(),{data:N,error:null,response:b}}catch(o){return{data:null,error:o,response:o instanceof oD||o instanceof aD?o.context:void 0}}finally{s&&clearTimeout(s)}})}}const nW=3,lD=t=>Math.min(1e3*2**t,3e4),Lhe=[520,503],iW=["GET","HEAD","OPTIONS"];var $he=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.co
645de=t.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function cD(t,e){return new Promise(r=>{if(e!=null&&e.aborted){r();return}const n=setTimeout(()=>{e==null||e.removeEventListener("abort",i),r()},t);function i(){clearTimeout(n),r()}e==null||e.addEventListener("abort",i)})}function Dhe(t,e,r,n){return!(!n||r>=nW||!iW.includes(t)||!Lhe.includes(e))}var Bhe=class{constructor(t){var e,r,n,i,s;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(r=t.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(n=t.shouldStripNulls)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(i=t.urlLengthLimit)!==null&&i!==void 0?i:8e3,this.retryEnabled=(s=t.retry)!==null&&s!==void 0?s:!0,t.fetch?this.fetch=t.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}retry(t){return this.retryEnabled=t,this}then(t,e){var r=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const a=this.headers.get("Accept");a==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!a||a==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const n=this.fetch;let s=(async()=>{let a=0;for(;;){const u=new Headers(r.headers);a>0&&u.set("X-Retry-Count",String(a));let d;try{d=await n(r.url.toString(),{method:r.method,headers:u,body:JSON.stringify(r.body,(f,p)=>typeof p=="bigint"?p.toString():p),signal:r.signal})}catch(f){if((f==null?void 0:f.name)==="AbortError"||(f==null?void 0:f.code)==="ABORT_ERR"||!iW.includes(r.method))throw f;if(r.retryEnabled&&a<nW){const p=lD(a);a++,await cD(p,r.signal);continue}throw f}if(Dhe(r.method,d.status,a,r.retryEnabled)){var o,c;const f=(o=(c=d.headers)===null||c===void 0?void 0:c.get("Retry-After"))!==null&&o!==void 0?o:null,p=f!==null?Math.max(0,parseInt(f,10)||0)*1e3:lD(a);await d.text(),a++,await cD(p,r.signal);continue}return await r.processResponse(d)}})();return this.shouldThrowOnError||(s=s.catch(a=>{var o;let c="",u="",d="";const f=a==null?void 0:a.cause;if(f){var p,m,y,v;const _=(p=f==null?void 0:f.message)!==null&&p!==void 0?p:"",S=(m=f==null?void 0:f.code)!==null&&m!==void 0?m:"";c=`${(y=a==null?void 0:a.name)!==null&&y!==void 0?y:"FetchError"}: ${a==null?void 0:a.message}`,c+=`
646
647Caused by: ${(v=f==null?void 0:f.name)!==null&&v!==void 0?v:"Error"}: ${_}`,S&&(c+=` (${S})`),f!=null&&f.stack&&(c+=`
648${f.stack}`)}else{var w;c=(w=a==null?void 0:a.stack)!==null&&w!==void 0?w:""}const b=this.url.toString().length;return(a==null?void 0:a.name)==="AbortError"||(a==null?void 0:a.code)==="ABORT_ERR"?(d="",u="Request was aborted (timeout or manual cancellation)",b>this.urlLengthLimit&&(u+=`. Note: Your request URL is ${b} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((f==null?void 0:f.name)==="HeadersOverflowError"||(f==null?void 0:f.code)==="UND_ERR_HEADERS_OVERFLOW")&&(d="",u="HTTP headers exceeded server limits (typically 16KB)",b>this.urlLengthLimit&&(u+=`. Your request URL is ${b} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(o=a==null?void 0:a.name)!==null&&o!==void 0?o:"FetchError"}: ${a==null?void 0:a.message}`,details:c,hint:u,code:d},data:null,count:null,status:0,statusText:""}}
648)),s.then(t,e)}async processResponse(t){var e=this;let r=null,n=null,i=null,s=t.status,a=t.statusText;if(t.ok){var o,c;if(e.method!=="HEAD"){var u;const p=await t.text();p===""||(e.headers.get("Accept")==="text/csv"||e.headers.get("Accept")&&(!((u=e.headers.get("Accept"))===null||u===void 0)&&u.includes("application/vnd.pgrst.plan+text"))?n=p:n=JSON.parse(p))}const d=(o=e.headers.get("Prefer"))===null||o===void 0?void 0:o.match(/count=(exact|planned|estimated)/),f=(c=t.headers.get("content-range"))===null||c===void 0?void 0:c.split("/");d&&f&&f.length>1&&(i=parseInt(f[1])),e.isMaybeSingle&&Array.isArray(n)&&(n.length>1?(r={code:"PGRST116",details:`Results contain ${n.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},n=null,i=null,s=406,a="Not Acceptable"):n.length===1?n=n[0]:n=null)}else{const d=await t.text();try{r=JSON.parse(d),Array.isArray(r)&&t.status===404&&(n=[],r=null,s=200,a="OK")}catch{t.status===404&&d===""?(s=204,a="No Content"):r={message:d}}if(r&&e.shouldThrowOnError)throw new $he(r)}return{success:r===null,error:r,data:n,count:i,status:s,statusText:a}}returns(){return this}overrideTypes(){return this}},Fhe=class extends Bhe{select(t){let e=!1;const r=(t??"*").split("").map(n=>/\s/.test(n)&&!e?"":(n==='"'&&(e=!e),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:r,foreignTable:n,referencedTable:i=n}={}){const s=i?`${i}.order`:"order",a=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${a?`${a},`:""}${t}.${e?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:r=e}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${t}`),this}range(t,e,{foreignTable:r,referencedTable:n=r}={}){const i=typeof n>"u"?"offset":`${n}.offset`,s=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${t}`),this.url.searchParams.set(s,`${e-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:t=!1,verbose:e=!1,settings:r=!1,buffers:n=!1,wal:i=!1,format:s="text"}={}){var a;const o=[t?"analyze":null,e?"verbose":null,r?"settings":null,n?"buffers":null,i?"wal":null].filter(Boolean).join("|"),c=(a=this.headers.get("Accept"))!==null&&a!==void 0?a:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${s}; for="${c}"; options=${o};`),s==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};const uD=new RegExp("[,()]");var of=class extends Fhe{eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(",")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(",")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(",")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&uD.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}notIn(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&uD.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`not.in.(${r})`),this}contains(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e=="string"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(",")}}`),this}textSearch(t,e,{config:r,type:n}={}){let i="";n==="plain"?i="pl":n==="phrase"?i="ph":n==="websearch"&&(i="w");const s=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${i}fts${s}.${e}`),this}match(t){return Object.entries(t).filter(([e,r])=>
648r!==void 0).forEach(([e,r])=>{this.url.searchParams.append(e,`eq.${r}`)}),this}not(t,e,r){return this.url.searchParams.append(t,`not.${e}.${r}`),this}or(t,{foreignTable:e,referencedTable:r=e}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${t})`),this}filter(t,e,r){return this.url.searchParams.append(t,`${e}.${r}`),this}},zhe=class{constructor(t,{headers:e={},schema:r,fetch:n,urlLengthLimit:i=8e3,retry:s}){this.url=t,this.headers=new Headers(e),this.schema=r,this.fetch=n,this.urlLengthLimit=i,this.retry=s}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){const{head:r=!1,count:n}=e??{},i=r?"HEAD":"GET";let s=!1;const a=(t??"*").split("").map(u=>/\s/.test(u)&&!s?"":(u==='"'&&(s=!s),u)).join(""),{url:o,headers:c}=this.cloneRequestState();return o.searchParams.set("select",a),n&&c.append("Prefer",`count=${n}`),new of({method:i,url:o,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(t,{count:e,defaultToNull:r=!0}={}){var n;const i="POST",{url:s,headers:a}=this.cloneRequestState();if(e&&a.append("Prefer",`count=${e}`),r||a.append("Prefer","missing=default"),Array.isArray(t)){const o=t.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(o.length>0){const c=[...new Set(o)].map(u=>`"${u}"`);s.searchParams.set("columns",c.join(","))}}return new of({method:i,url:s,headers:a,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(t,{onConflict:e,ignoreDuplicates:r=!1,count:n,defaultToNull:i=!0}={}){var s;const a="POST",{url:o,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),e!==void 0&&o.searchParams.set("on_conflict",e),n&&c.append("Prefer",`count=${n}`),i||c.append("Prefer","missing=default"),Array.isArray(t)){const u=t.reduce((d,f)=>d.concat(Object.keys(f)),[]);if(u.length>0){const d=[...new Set(u)].map(f=>`"${f}"`);o.searchParams.set("columns",d.join(","))}}return new of({method:a,url:o,headers:c,schema:this.schema,body:t,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(t,{count:e}={}){var r;const n="PATCH",{url:i,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new of({method:n,url:i,headers:s,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:t}={}){var e;const r="DELETE",{url:n,headers:i}=this.cloneRequestState();return t&&i.append("Prefer",`count=${t}`),new of({method:r,url:n,headers:i,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function Qg(t){"@babel/helpers - typeof";return Qg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qg(t)}function Uhe(t,e){if(Qg(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Qg(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Hhe(t){var e=Uhe(t,"string");return Qg(e)=="symbol"?e:e+""}function Vhe(t,e,r){return(e=Hhe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dD(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function zx(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?dD(Object(r),!0).forEach(function(n){Vhe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dD(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var Whe=class sW{constructor(e,{headers:r={},schema:n,fetch:i,timeout:s,urlLengthLimit:a=8e3,retry:o}={}){this.url=e,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=a;const c=i??globalThis.fetch;s!==void 0&&s>0?this.fetch=(u,d)=>{const f=new AbortController,p=setTimeout(()=>f.abort(),s),m=d==null?void 0:d.signal;if(m){if(m.aborted)return clearTimeout(p),c(u,d);const y=()=>{clearTimeout(p),f.abort()};return m.addEventListener("abort",y,{once:!0}),c(u,zx(zx({},d),{}
648,{signal:f.signal})).finally(()=>{clearTimeout(p),m.removeEventListener("abort",y)})}return c(u,zx(zx({},d),{},{signal:f.signal})).finally(()=>clearTimeout(p))}:this.fetch=c,this.retry=o}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new zhe(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(e){return new sW(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,r={},{head:n=!1,get:i=!1,count:s}={}){var a;let o;const c=new URL(`${this.url}/rpc/${e}`);let u;const d=m=>m!==null&&typeof m=="object"&&(!Array.isArray(m)||m.some(d)),f=n&&Object.values(r).some(d);f?(o="POST",u=r):n||i?(o=n?"HEAD":"GET",Object.entries(r).filter(([m,y])=>y!==void 0).map(([m,y])=>[m,Array.isArray(y)?`{${y.join(",")}}`:`${y}`]).forEach(([m,y])=>{c.searchParams.append(m,y)})):(o="POST",u=r);const p=new Headers(this.headers);return f?p.set("Prefer",s?`count=${s},return=minimal`:"return=minimal"):s&&p.set("Prefer",`count=${s}`),new of({method:o,url:c,headers:p,schema:this.schemaName,body:u,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class qhe{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const r=globalThis.process;if(r){const n=r.versions;if(n&&n.node){const i=n.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:
649import ws from "ws"
650new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.constructor)return e.constructor;let r=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(r+=`
651
652Suggested solution: ${e.workaround}`),new Error(r)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const Khe="2.103.3",Ghe=`realtime-js/${Khe}`,Zhe="1.0.0",aW="2.0.0",Jhe=aW,Yhe=1e4,Xhe=100,Pl={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},oW={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},WE={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class Qhe{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,r){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){var r;return this._isArrayBuffer((r=e.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var r,n;const i=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,i)}_encodeJsonUserBroadcastPush(e){var r,n;const i=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},a=new TextEncoder().encode(JSON.stringify(i)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,a)}_encodeUserBroadcastPush(e,r,n){var i,s;const a=e.topic,o=(i=e.ref)!==null&&i!==void 0?i:"",c=(s=e.join_ref)!==null&&s!==void 0?s:"",u=e.payload.event,d=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},f=Object.keys(d).length===0?"":JSON.stringify(d);if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`ref length ${o.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`topic length ${a.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`metadata length ${f.length} exceeds maximum of 255`);const p=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+o.length+a.length+u.length+f.length,m=new ArrayBuffer(this.HEADER_LENGTH+p);let y=new DataView(m),v=0;y.setUint8(v++,this.KINDS.userBroadcastPush),y.setUint8(v++,c.length),y.setUint8(v++,o.length),y.setUint8(v++,a.length),y.setUint8(v++,u.length),y.setUint8(v++,f.length),y.setUint8(v++,r),Array.from(c,b=>y.setUint8(v++,b.charCodeAt(0))),Array.from(o,b=>y.setUint8(v++,b.charCodeAt(0))),Array.from(a,b=>y.setUint8(v++,b.charCodeAt(0))),Array.from(u,b=>y.setUint8(v++,b.charCodeAt(0))),Array.from(f,b=>y.setUint8(v++,b.charCodeAt(0)));var w=new Uint8Array(m.byteLength+n.byteLength);return w.set(new Uint8Array(m),0),w.set(new Uint8Array(n),m.byteLength),w.buffer}decode(e,r){if(this._isArrayBuffer(e)){let n=this._binaryDecode(e);return r(n)}if(typeof e=="string"){const n=JSON.parse(e),[i,s,a,o,c]=n;return r({join_ref:i,ref:s,topic:a,event:o,payload:c})}return r({})}_binaryDecode(e){const r=new DataView(e),n=r.getUint8(0),i=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,r,i)}}_decodeUserBroadcast(e,r,n){const i=r.getUint8(1),s=r.getUint8(2),a=r.getUint8(3),o=r.getUint8(4);let c=this.HEADER_LENGTH+4;const u=n.decode(e.slice(c,c+i));c=c+i;const d=n.decode(e.slice(c,c+s));c=c+s;const f=n.decode(e.slice(c,c+a));c=c+a;const p=e.slice(c,e.byteLength),m=o===this.JSON_ENCODING?JSON.parse(n.decode(p)):p,y={type:this.BROADCAST_EVENT,event:d,payload:m};return a>0&&(y.meta=JSON.parse(f)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:y}}_isArrayBuffer(e){var r;return e instanceof ArrayBuffer||((r=e==null?void 0:e.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(e,r){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([n])=>r.includes(n)))}}var Gt;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.t
vendor: 6,748 bytes, line 652
652srange="tsrange",t.tstzrange="tstzrange"})(Gt||(Gt={}));const fD=(t,e,r={})=>{var n;const i=(n=r.skipTypes)!==null&&n!==void 0?n:[];return e?Object.keys(e).reduce((s,a)=>(s[a]=epe(a,t,e,i),s),{}):{}},epe=(t,e,r,n)=>{const i=e.find(o=>o.name===t),s=i==null?void 0:i.type,a=r[t];return s&&!n.includes(s)?lW(s,a):qE(a)},lW=(t,e)=>{if(t.charAt(0)==="_"){const r=t.slice(1,t.length);return ipe(e,r)}switch(t){case Gt.bool:return tpe(e);case Gt.float4:case Gt.float8:case Gt.int2:case Gt.int4:case Gt.int8:case Gt.numeric:case Gt.oid:return rpe(e);case Gt.json:case Gt.jsonb:return npe(e);case Gt.timestamp:return spe(e);case Gt.abstime:case Gt.date:case Gt.daterange:case Gt.int4range:case Gt.int8range:case Gt.money:case Gt.reltime:case Gt.text:case Gt.time:case Gt.timestamptz:case Gt.timetz:case Gt.tsrange:case Gt.tstzrange:return qE(e);default:return qE(e)}},qE=t=>t,tpe=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},rpe=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},npe=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},ipe=(t,e)=>{if(typeof t!="string")return t;const r=t.length-1,n=t[r];if(t[0]==="{"&&n==="}"){let s;const a=t.slice(1,r);try{s=JSON.parse("["+a+"]")}catch{s=a?a.split(","):[]}return s.map(o=>lW(e,o))}return t},spe=t=>typeof t=="string"?t.replace(" ","T"):t,cW=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};var sg=t=>typeof t=="function"?t:function(){return t},ape=typeof self<"u"?self:null,lf=typeof window<"u"?window:null,Oa=ape||lf||globalThis,ope="2.0.0",lpe=1e4,cpe=1e3,Ra={connecting:0,open:1,closing:2,closed:3},vi={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},yo={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},KE={longpoll:"longpoll",websocket:"websocket"},upe={complete:4},GE="base64url.bearer.phx.",Ux=class{constructor(t,e,r,n){this.channel=t,this.event=e,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(t){this.timeout=t,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:t,response:e,_ref:r}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},uW=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},dpe=class{constructor(t,e,r){this.state=vi.closed,this.topic=t,this.params=sg(e||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Ux(this,yo.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new uW(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=vi.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",n=>{this.state=vi.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=vi.closed,this.socket.remove(this)}),this.onError(n=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.isJoining()&&this.joinPush.reset(),this.state=vi.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new Ux(this,yo.leave,sg({}),this.timeout).send(),this.state=vi.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(yo.reply,(n,i)=>{this.trigger(this.replyEventName(i),n)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=vi.closed,this.bindings=[]}onClose(t){this.on(yo.close,t)}onError(t){return this.on(yo.error,e=>t(e))}on(t,e){let r=this.bindingRef++;return this.bindings.push({event:t,ref:r,callback:e}),r}off(t,e){this.bindings=this.bindings.filter(r=>!(r.event===t&&(typeof e>"u"||e===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,r=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new Ux(this,t,function(){return e},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=vi.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(yo.close,"leave")}
vendor: 4,101 bytes, line 652
652,r=new Ux(this,yo.leave,sg({}),t);return r.receive("ok",()=>e()).receive("timeout",()=>e()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(t,e,r){return e}filterBindings(t,e,r){return!0}isMember(t,e,r,n){return this.topic!==t?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:r,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=vi.joining,this.joinPush.resend(t))}trigger(t,e,r,n){let i=this.onMessage(t,e,r,n);if(e&&!i)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let s=this.bindings.filter(a=>a.event===t&&this.filterBindings(a,e,r));for(let a=0;a<s.length;a++)s[a].callback(i,r,n||this.joinRef())}replyEventName(t){return`chan_reply_${t}`}isClosed(){return this.state===vi.closed}isErrored(){return this.state===vi.errored}isJoined(){return this.state===vi.joined}isJoining(){return this.state===vi.joining}isLeaving(){return this.state===vi.leaving}},W0=class{static request(t,e,r,n,i,s,a){if(Oa.XDomainRequest){let o=new Oa.XDomainRequest;return this.xdomainRequest(o,t,e,n,i,s,a)}else if(Oa.XMLHttpRequest){let o=new Oa.XMLHttpRequest;return this.xhrRequest(o,t,e,r,n,i,s,a)}else{if(Oa.fetch&&Oa.AbortController)return this.fetchRequest(t,e,r,n,i,s,a);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(t,e,r,n,i,s,a){let o={method:t,headers:r,body:n},c=null;return i&&(c=new AbortController,setTimeout(()=>c.abort(),i),o.signal=c.signal),Oa.fetch(e,o).then(u=>u.text()).then(u=>this.parseJSON(u)).then(u=>a&&a(u)).catch(u=>{u.name==="AbortError"&&s?s():a&&a(null)}),c}static xdomainRequest(t,e,r,n,i,s,a){return t.timeout=i,t.open(e,r),t.onload=()=>{let o=this.parseJSON(t.responseText);a&&a(o)},s&&(t.ontimeout=s),t.onprogress=()=>{},t.send(n),t}static xhrRequest(t,e,r,n,i,s,a,o){t.open(e,r,!0),t.timeout=s;for(let[c,u]of Object.entries(n))t.setRequestHeader(c,u);return t.onerror=()=>o&&o(null),t.onreadystatechange=()=>{if(t.readyState===upe.complete&&o){let c=this.parseJSON(t.responseText);o(c)}},a&&(t.ontimeout=a),t.send(i),t}static parseJSON(t){if(!t||t==="")return null;try{return JSON.parse(t)}catch{return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let r=[];for(var n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let i=e?`${e}[${n}]`:n,s=t[n];typeof s=="object"?r.push(this.serialize(s,i)):r.push(encodeURIComponent(i)+"="+encodeURIComponent(s))}return r.join("&")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let r=t.match(/\?/)?"&":"?";return`${t}${r}${this.serialize(e)}`}},fpe=t=>{let e="",r=new Uint8Array(t),n=r.byteLength;for(let i=0;i<n;i++)e+=String.fromCharCode(r[i]);return btoa(e)},Kd=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(GE)&&(this.authToken=atob(e[1].slice(GE.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=Ra.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+KE.websocket),"$1/"+KE.longpoll)}endpointURL(){return W0.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,r){this.close(t,e,r),this.readyState=Ra.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Ra.open||this.readyState===Ra.connecting}poll(){const t={Accept:"application/json"};this.authToken&&(t["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",t,null,()=>this.ontimeout(),e=>{if(e){var{status:r,token:n,messages:i}=e;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=n}else r=0;
vendor: 1,501 bytes, lines 652-653
652switch(r){case 200:i.forEach(s=>{setTimeout(()=>this.onmessage({data:s}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Ra.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${r}`)}})}send(t){typeof t!="string"&&(t=fpe(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},t.join(`
653`),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(t,e,r){for(let i of this.reqs)i.abort();this.readyState=Ra.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(t,e,r,n,i){let s,a=()=>{this.reqs.delete(s),n()};s=W0.request(t,this.endpointURL(),e,r,this.timeout,a,o=>{this.reqs.delete(s),this.isActive()&&i(o)}),this.reqs.add(s)}}
vendor: 10,890 bytes, line 653
653,hpe=class $m{constructor(e,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=e,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,i=>{let{onJoin:s,onLeave:a,onSync:o}=this.caller;this.joinRef=this.channel.joinRef(),this.state=$m.syncState(this.state,i,s,a),this.pendingDiffs.forEach(c=>{this.state=$m.syncDiff(this.state,c,s,a)}),this.pendingDiffs=[],o()}),this.channel.on(n.diff,i=>{let{onJoin:s,onLeave:a,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=$m.syncDiff(this.state,i,s,a),o())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return $m.list(this.state,e)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,r,n,i){let s=this.clone(e),a={},o={};return this.map(s,(c,u)=>{r[c]||(o[c]=u)}),this.map(r,(c,u)=>{let d=s[c];if(d){let f=u.metas.map(v=>v.phx_ref),p=d.metas.map(v=>v.phx_ref),m=u.metas.filter(v=>p.indexOf(v.phx_ref)<0),y=d.metas.filter(v=>f.indexOf(v.phx_ref)<0);m.length>0&&(a[c]=u,a[c].metas=m),y.length>0&&(o[c]=this.clone(d),o[c].metas=y)}else a[c]=u}),this.syncDiff(s,{joins:a,leaves:o},n,i)}static syncDiff(e,r,n,i){let{joins:s,leaves:a}=this.clone(r);return n||(n=function(){}),i||(i=function(){}),this.map(s,(o,c)=>{let u=e[o];if(e[o]=this.clone(c),u){let d=e[o].metas.map(p=>p.phx_ref),f=u.metas.filter(p=>d.indexOf(p.phx_ref)<0);e[o].metas.unshift(...f)}n(o,u,c)}),this.map(a,(o,c)=>{let u=e[o];if(!u)return;let d=c.metas.map(f=>f.phx_ref);u.metas=u.metas.filter(f=>d.indexOf(f.phx_ref)<0),i(o,u,c),u.metas.length===0&&delete e[o]}),e}static list(e,r){return r||(r=function(n,i){return i}),this.map(e,(n,i)=>r(n,i))}static map(e,r){return Object.getOwnPropertyNames(e).map(n=>r(n,e[n]))}static clone(e){return JSON.parse(JSON.stringify(e))}},Hx={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(r))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[r,n,i,s,a]=JSON.parse(t);return e({join_ref:r,ref:n,topic:i,event:s,payload:a})}},binaryEncode(t){let{join_ref:e,ref:r,event:n,topic:i,payload:s}=t,a=this.META_LENGTH+e.length+r.length+i.length+n.length,o=new ArrayBuffer(this.HEADER_LENGTH+a),c=new DataView(o),u=0;c.setUint8(u++,this.KINDS.push),c.setUint8(u++,e.length),c.setUint8(u++,r.length),c.setUint8(u++,i.length),c.setUint8(u++,n.length),Array.from(e,f=>c.setUint8(u++,f.charCodeAt(0))),Array.from(r,f=>c.setUint8(u++,f.charCodeAt(0))),Array.from(i,f=>c.setUint8(u++,f.charCodeAt(0))),Array.from(n,f=>c.setUint8(u++,f.charCodeAt(0)));var d=new Uint8Array(o.byteLength+s.byteLength);return d.set(new Uint8Array(o),0),d.set(new Uint8Array(s),o.byteLength),d.buffer},binaryDecode(t){let e=new DataView(t),r=e.getUint8(0),n=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(t,e,n);case this.KINDS.reply:return this.decodeReply(t,e,n);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,n)}},decodePush(t,e,r){let n=e.getUint8(1),i=e.getUint8(2),s=e.getUint8(3),a=this.HEADER_LENGTH+this.META_LENGTH-1,o=r.decode(t.slice(a,a+n));a=a+n;let c=r.decode(t.slice(a,a+i));a=a+i;let u=r.decode(t.slice(a,a+s));a=a+s;let d=t.slice(a,t.byteLength);return{join_ref:o,ref:null,topic:c,event:u,payload:d}},decodeReply(t,e,r){let n=e.getUint8(1),i=e.getUint8(2),s=e.getUint8(3),a=e.getUint8(4),o=this.HEADER_LENGTH+this.META_LENGTH,c=r.decode(t.slice(o,o+n));o=o+n;let u=r.decode(t.slice(o,o+i));o=o+i;let d=r.decode(t.slice(o,o+s));o=o+s;let f=r.decode(t.slice(o,o+a));o=o+a;let p=t.slice(o,t.byteLength),m={status:f,response:p};return{join_ref:c,ref:u,topic:d,event:yo.reply,payload:m}},decodeBroadcast(t,e,r){let n=e.getUint8(1),i=e.getUint8(2),s=this.HEADER_LENGTH+2,a=r.decode(t.slice(s,s+n));s=s+n;let o=r.decode(t.slice(s,s+i));s=s+i;let c=t.slice(s,t.byteLength);return{join_ref:null,ref:null,topic:a,event:o,payload:c}}},ppe=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||lpe,this.transport=e.transport||Oa.WebSocket||Kd,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=e.sessionStorage||Oa&&Oa.sessionStorage,this.establishedConnections=0,this.defaultEncoder=Hx.encode.bind(Hx),this.defaultDecoder=Hx.decode.bind(Hx),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Kd?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let r=null;lf&&lf.addEventListener&&(lf.addEventListener("pagehide",n=>{this.conn&&(this.disconnect(),r=this.connectClock)}),lf.addEventListener("pageshow",n=>{r===this.connectClock&&(r=null,this.connect())}),lf.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=e.autoSendHeartbeat??!0,this.heartbeatCallback=e.heartbeatCallback??(()=>{}),this.rejoinAfterMs=n=>e.rejoinAfterMs?e.rejoinAfterMs(n):[1e3,2e3,5e3][n-1]||1e4,this.reconnectAfterMs=n=>e.reconnectAfterMs?e.reconnectAfterMs(n):[10,50,100,150,200,250,500,1e3,2e3][n-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(n,i,s)=>{console.log(`${n}: ${i}`,s)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=sg(e.params||{}),this.endPoint=`${t}/${KE.websocket}`,this.vsn=e.vsn||ope,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new uW(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{e.beforeReconnect&&await e.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=e.authToken}getLongPollTransport(){return Kd}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=W0.appendParams(W0.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!=="/"?t:t.charAt(1)==="/"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},e,r)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=sg(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Kd?this.connectWithFallback(Kd,this.longPollFallbackMs):this.transportConnect())}log(t,e,r){this.logger&&this.logger(t,e,r)}hasLogger(){return this.logger!==null}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}onHeartbeat(t){this.heartbeatCallback=t}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let n=this.onMessage(i=>{i.ref===e&&(this.off([n]),t(Date.now()-r))});return!0}transportName(t){switch(t){case Kd:return"LongPoll";default:return t.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${GE}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),t),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,e){this.sessionStore&&this.sessionStore.setItem(t,e)}connectWithFallback(t,e=2500){clearTimeout(this.fallbackTimer);let r=!1,n=!0,i,s,a=this.transportName(t),o=c=>{this.log("transport",`falling back to ${a}...`,c),this.off([i,s]),n=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${a}`))return o("memorized");this.fallbackTimer=setTimeout(o,e),s=this.onError(c=>{this.log("transport","error",c),n&&!r&&(clearTimeout(this.fallbackTimer),o(c))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!n){let c=this.transportName(t);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${c}`,"true"),this.log("transport",`established ${c} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,e),this.ping(c=>{this.log("transport","connected to primary after",c),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(t){this.log("error","error in heartbeat callback",t)}this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),cpe,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,r){if(!this.conn)return t&&t();const n=this.conn;this.waitForBufferDone(n,()=>{e?n.close(e,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){}
653,this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e,r=1){if(r===5||!t.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(t,e,r+1)},150*r)}waitForSocketClosed(t,e,r=1){if(r===5||t.readyState===Ra.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(t,e,r+1)},150*r)}onConnClose(t){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",t)}onConnError(t){this.hasLogger()&&this.log("transport",t);let e=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",t,e,r),(e===this.transport||r>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(yo.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case Ra.connecting:return"connecting";case Ra.open:return"open";case Ra.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e!==t)}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([r])=>t.indexOf(r)===-1)}channel(t,e={}){let r=new dpe(t,e,this);return this.channels.push(r),r}push(t){if(this.hasLogger()){let{topic:e,event:r,payload:n,ref:i,join_ref:s}=t;this.log("push",`${e} ${r} (${s}, ${i})`,n)}this.isConnected()?this.encode(t,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(t,e=>this.conn.send(e)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(t){this.log("error","error in heartbeat callback",t)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(t){this.log("error","error in heartbeat callback",t)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,e=>{let{topic:r,event:n,payload:i,ref:s,join_ref:a}=e;if(s&&s===this.pendingHeartbeatRef){const o=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(i.status==="ok"?"ok":"error",o)}catch(c){this.log("error","error in heartbeat callback",c)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${i.status||""} ${r} ${n} ${s&&"("+s+")"||""}`.trim(),i);for(let o=0;o<this.channels.length;o++){const c=this.channels[o];c.isMember(r,n,i,a)&&c.trigger(n,i,s,a)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(t,...e){try{this.stateChangeCallbacks[t].forEach(([r,n])=>{try{n(...e)}catch(i){this.log("error",`error in ${t} callback`,i)}})}catch(r){this.log("error",`error triggering ${t} callbacks`,r)}}leaveOpenTopic(t){let e=this.channels.find(r=>r.topic===t&&(r.isJoined()||r.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}};class ag{constructor(e,r){const n=gpe(r);this.presence=new hpe(e.getChannel(),n),this.presence.onJoin((i,s,a)=>{const o=ag.onJoinPayload(i,s,a);e.getChannel().trigger("presence",o)}),this.presence.onLeave((i,s,a)=>{const o=ag.onLeavePayload(i,s,a);e.getChannel().trigger("presence",o)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return ag.transformState(this.presence.state)}static transformState(e){return e=mpe(e),Object.getOwnPropertyNames(e).reduce((r,n)=>{const i=e[n];return r[n]=Hb(i),r},{})}static onJoinPayload(e,r,n){const i=hD(r),s=Hb(n);return{event:"join",key:e,currentPresences:i,newPresences:s}}static onLeavePayload(e,r,n){const i=hD(r),s=Hb(n);return{event:"leave",key:e,currentPresences:i,leftPresences:s}}}function Hb(t){return t.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function mpe(t){return JSON.parse(JSON.stringify(t))}function gpe(t){return(t==null?void 0:t.events)&&{events:t.events}}function hD(t){return t!=null&&t.metas?Hb(t):[]}var pD;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(pD||(pD={}));class vpe{get state(){return this.presenceAdapter.state}constructor(e,r){this.channel=e,this.presenceAdapter=new ag(this.channel.channelAdapter,r)}}class ype{constructor(e,r,n){const i=xpe(n);this.channel=e.getSocket().channel(r,i),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,r){return this.channel.on(e,r)}off(e,r){this.channel.off(e,r)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,r,n){let i;try{i=this.channel.push(e,r,n)}catch{throw new Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>Xhe){const s=this.channel.pushBuffer.shift();s.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${s.event}`,s.payload())}return i}updateJoinPayload(e){const r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),e)}canPush(){return this.socket.isConnected()&&this.state===Pl.joined}isJoined(){return this.state===Pl.joined}isJoining(){return this.state===Pl.joining}isClosed(){return this.state===Pl.closed}isLeaving(){return this.state===Pl.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}function xpe(t){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config)}}var mD;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELET
653E="DELETE"})(mD||(mD={}));var Of;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Of||(Of={}));var xo;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(xo||(xo={}));class og{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,r={config:{}},n){var i,s;if(this.topic=e,this.params=r,this.socket=n,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.channelAdapter=new ype(this.socket.socketAdapter,e,this.params),this.presence=new vpe(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=cW(this.socket.socketAdapter.endPointURL()),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 new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,r=this.timeout){var n,i,s;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:a,presence:o,private:c}}=this.params,u=(i=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(m=>m.filter))!==null&&i!==void 0?i:[],d=!!this.bindings[Of.PRESENCE]&&this.bindings[Of.PRESENCE].length>0||((s=this.params.config.presence)===null||s===void 0?void 0:s.enabled)===!0,f={},p={broadcast:a,presence:Object.assign(Object.assign({},o),{enabled:d}),postgres_changes:u,private:c};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(m=>{e==null||e(xo.CHANNEL_ERROR,m)}),this._onClose(()=>e==null?void 0:e(xo.CLOSED)),this.updateJoinPayload(Object.assign({config:p},f)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:m})=>{if(this.socket._isManualToken()||this.socket.setAuth(),m===void 0){e==null||e(xo.SUBSCRIBED);return}this._updatePostgresBindings(m,e)}).receive("error",m=>{this.state=Pl.errored,e==null||e(xo.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(m).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(xo.TIMED_OUT)})}return this}_updatePostgresBindings(e,r){var n;const i=this.bindings.postgres_changes,s=(n=i==null?void 0:i.length)!==null&&n!==void 0?n:0,a=[];for(let o=0;o<s;o++){const c=i[o],{filter:{event:u,schema:d,table:f,filter:p}}=c,m=e&&e[o];if(m&&m.event===u&&og.isFilterValueEqual(m.schema,d)&&og.isFilterValueEqual(m.table,f)&&og.isFilterValueEqual(m.filter,p))a.push(Object.assign(Object.assign({},c),{id:m.id}));else{this.unsubscribe(),this.state=Pl.errored,r==null||r(xo.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=a,this.state!=Pl.errored&&r&&r(xo.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,r={}){return await this.send({type:"presence",event:"track",payload:e},r.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,r,n){const i=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),s=e===Of.PRESENCE||e===Of.POSTGRES_CHANGES;if(i&&s)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,r,n)}async httpSend(e,r,n={}){var i;if(r==null)return Promise.reject(new Error("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:e,payload:r,private:this.private}]})},o=await this._fetchWithTimeout(this.broadcastEndpointURL,a,(i=n.timeout)!==null&&i!==void 0?i:this.timeout);if(o.status===202)return{success:!0};let c=o.statusText;
653try{const u=await o.json();c=u.error||u.message||c}catch{}return Promise.reject(new Error(c))}async send(e,r={}){var n,i;if(!this.channelAdapter.canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:s,payload:a}=e,o={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:o,body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:a,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((i=u.body)===null||i===void 0?void 0:i.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(s=>{var a,o,c;const u=this.channelAdapter.push(e.type,e,r.timeout||this.timeout);e.type==="broadcast"&&!(!((c=(o=(a=this.params)===null||a===void 0?void 0:a.config)===null||o===void 0?void 0:o.broadcast)===null||c===void 0)&&c.ack)&&s("ok"),u.receive("ok",()=>s("ok")),u.receive("error",()=>s("error")),u.receive("timeout",()=>s("timed out"))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,r,n){const i=new AbortController,s=setTimeout(()=>i.abort(),n),a=await this.socket.fetch(e,Object.assign(Object.assign({},r),{signal:i.signal}));return clearTimeout(s),a}_on(e,r,n){const i=e.toLocaleLowerCase(),s=this.channelAdapter.on(e,n),a={type:i,filter:r,callback:n,ref:s};return this.bindings[i]?this.bindings[i].push(a):this.bindings[i]=[a],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,r,n)=>{var i,s,a,o,c,u,d;const f=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(f,n))return!1;const p=(i=this.bindings[f])===null||i===void 0?void 0:i.find(m=>m.ref===e.ref);if(!p)return!0;if(["broadcast","presence","postgres_changes"].includes(f))if("id"in p){const m=p.id,y=(s=p.filter)===null||s===void 0?void 0:s.event;return m&&((a=r.ids)===null||a===void 0?void 0:a.includes(m))&&(y==="*"||(y==null?void 0:y.toLocaleLowerCase())===((o=r.data)===null||o===void 0?void 0:o.type.toLocaleLowerCase()))}else{const m=(u=(c=p==null?void 0:p.filter)===null||c===void 0?void 0:c.event)===null||u===void 0?void 0:u.toLocaleLowerCase();return m==="*"||m===((d=r==null?void 0:r.event)===null||d===void 0?void 0:d.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===f})}_notThisChannelEvent(e,r){const{close:n,error:i,leave:s,join:a}=oW;return r&&[n,i,s,a].includes(e)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,r,n)=>{if(typeof r=="object"&&"ids"in r){const i=r.data,{schema:s,table:a,commit_timestamp:o,type:c,errors:u}=i;return Object.assign(Object.assign({},{schema:s,table:a,commit_timestamp:o,eventType:c,new:{},old:{},errors:u}),this._getPayloadRecords(i))}return r})}copyBindings(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const r in e.bindings)for(const n of e.bindings[r])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(e,r){return(e??void 0)===(r??void 0)}_getPayloadRecords(e){const r={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(r.new=fD(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=fD(e.columns,e.old_record)),r}}class bpe{constructor(e,r){this.socket=new ppe(e,r)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,r,n,i=1e4){return new Promise(s=>{setTimeout(()=>s("timeout"),i),this.socket.disconnect(()=>{e(),s("ok")},r,n)})}push(e){this.socket.push(e)}log(e,r,n){this.socket.log(e,r,n)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==WE.connecting}isDisconnecting(){return this.socket.connectionState()==WE.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const wpe={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},_pe=[1e3,2e3,5e3,1e4],kpe=1e4,Spe=`
654  addEventListener("message", (e) => {
655    if (e.data.event === "start") {
656      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
657    }
658  });`;class jpe{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,r){var n;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={}
658,this.ref=0,this.serializer=new Qhe,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._resolveFetch=s=>s?(...a)=>s(...a):(...a)=>fetch(...a),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey;const i=this._initializeOptions(r);this.socketAdapter=new bpe(e,i),this.httpEndpoint=cW(e),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){const r=e.message;throw r.includes("Node.js")?new Error(`${r}
659
660To use Realtime in Node.js, you need to provide a WebSocket implementation:
661
662Option 1: Use Node.js 22+ which has native WebSocket support
663Option 2: Install and provide the "ws" package:
664
665  npm install ws
666
667  import ws from "ws"
668  const client = new RealtimeClient(url, {
669    ...options,
670    transport: ws
671  })`):new Error(`WebSocket not available: ${r}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,r){return this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,r)}getChannels(){return this.channels}async removeChannel(e){const r=await e.unsubscribe();return r==="ok"&&e.teardown(),this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const e=this.channels.map(async n=>{const i=await n.unsubscribe();return n.teardown(),i}),r=await Promise.all(e);return this.disconnect(),r}log(e,r,n){this.socketAdapter.log(e,r,n)}connectionState(){return this.socketAdapter.connectionState()||WE.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,r={config:{}}){const n=`realtime:${e}`,i=this.getChannels().find(s=>s.topic===n);if(i)return i;{const s=new og(`realtime:${e}`,r,this);return this.channels.push(s),s}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(r=>r.topic!==e.topic)}async _performAuth(e=null){let r,n=!1;if(e)r=e,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(i){this.log("error","Error fetching access token from callback",i),r=this.accessTokenValue}else r=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(i=>{const s={access_token:r,version:Ghe};r&&i.updateJoinPayload(s),i.joinedOnce&&i.channelAdapter.isJoined()&&i.channelAdapter.push(oW.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${e}`,r)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(r,n)=>{r=="sent"&&this._setAuthSafely(),e&&e(r,n)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let r;if(e)r=e;else{const n=new Blob([Spe],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_initializeOptions(e){var r,n,i,s,a,o,c,u,d;this.worker=(r=e==null?void 0:e.worker)!==null&&r!==void 0?r:!1,this.accessToken=(n=e==null?void 0:e.accessToken)!==null&&n!==void 0?n:null;const f={};f.timeout=(i=e==null?void 0:e.timeout)!==null&&i!==void 0?i:Yhe,f.heartbeatIntervalMs=(s=e==null?void 0:e.heartbeatIntervalMs)!==null&&s!==void 0?s:wpe.HEARTBEAT_INTERVAL,f.transport=(a=e==null?void 0:e.transport)!==null&&a!==void 0?a:qhe.getWebSocketConstructor(),f.params=e==null?void 0:e.params,f.logger=e==null?void 0:e.logger,f.heartbeatCallback=this._wrapHeartbeatCallback(e==null?void 0:e.heartbeatCallback),f.reconnectAfterMs=(o=e==null?void 0:e.reconnectAfterMs)!==null&&o!==void 0?o:v=>_pe[v-1]||kpe;let p,m;const y=(c=e==null?void 0:e.vsn)!==null&&c!==void 0?c:Jhe;switch(y){case Zhe:p=(v,w)=>w(JSON.stringify(v)),m=(v,w)=>w(JSON.parse(v));break;case aW:p=this.serializer.encode.bind(this.serializer),m=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${f.vsn}`)}if(f.vsn=y,f.encode=(u=e==null?void 0:e.encode)!==null&&u!==void 0?u:p,f.decode=(d=e==null?void 0:e.decode)!==null&&d!==void 0?d:m,f.beforeReconnect=this._reconnectAuth.bind(this),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,f.params=Object.assign(Object.assign({},f.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl,f.autoSendHeartbeat=!this.worker}return f}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
671var ev=class extends Error{constructor(t,e){var r;super(t),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&((r=e.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function Npe(t,e,r){const n=new URL(e,t);if(r)for(const[i,s]of Object.entries(r))s!==void 0&&n.searchParams.set(i,s);return n.toString()}async function Cpe(t){return!t||t.type==="none"?{}:t.type==="bearer"?{Authorization:`Bearer ${t.token}`}:t.type==="header"?{[t.name]:t.value}:t.type==="custom"?await t.getHeaders():{}}function Epe(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:i,body:s,headers:a}){const o=Npe(t.baseUrl,n,i),c=await Cpe(t.auth),u=await e(o,{method:r,headers:{...s?{"Content-Type":"application/json"}:{},...c,...a},body:s?JSON.stringify(s):void 0}),d=await u.text(),f=(u.headers.get("content-type")||"").includes("application/json"),p=f&&d?JSON.parse(d):d;if(!u.ok){const m=f?p:void 0,y=m==null?void 0:m.error;throw new ev((y==null?void 0:y.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:y==null?void 0:y.type,icebergCode:y==null?void 0:y.code,details:m})}return{status:u.status,headers:u.headers,data:p}}}}function Vx(t){return t.join("�")}var Ope=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:Vx(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(t,e){const r={namespace:t.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Vx(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Vx(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Vx(t.namespace)}`}),!0}catch(e){if(e instanceof ev&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(r){if(r instanceof ev&&r.status===409)return;throw r}}};function Gd(t){return t.join("�")}var Tpe=class{constructor(t,e="",r){this.client=t,this.prefix=e,this.accessDelegation=r}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Gd(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Gd(t.namespace)}/tables`,body:e,headers:r})).data.metadata}async updateTable(t,e){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Gd(t.namespace)}/tables/${t.name}`,body:e});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Gd(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(t){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Gd(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Gd(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(r){if(r instanceof ev&&r.status===404)return!1;throw r}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(r){if(r instanceof ev&&r.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw r}}},Ape=class{constructor(t){var n;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const r=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=Epe({baseUrl:r,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(n=t.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new Ope(this.client,e),this.tableOps=new Tpe(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}
671async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}};function tv(t){"@babel/helpers - typeof";return tv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tv(t)}function Ppe(t,e){if(tv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(tv(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Mpe(t){var e=Ppe(t,"string");return tv(e)=="symbol"?e:e+""}function Rpe(t,e,r){return(e=Mpe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gD(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ze(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?gD(Object(r),!0).forEach(function(n){Rpe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gD(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var W_=class extends Error{constructor(t,e="storage",r,n){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function q_(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var ZE=class extends W_{constructor(t,e,r,n="storage"){super(t,n,e,r),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=r}toJSON(){return ze({},super.toJSON())}},dW=class extends W_{constructor(t,e,r="storage"){super(t,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};const Ipe=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),Lpe=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},JE=t=>{if(Array.isArray(t))return t.map(r=>JE(r));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([r,n])=>{const i=r.replace(/([-_][a-z])/gi,s=>s.toUpperCase().replace(/[-_]/g,""));e[i]=JE(n)}),e},$pe=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t),vD=t=>{var e;return t.msg||t.message||t.error_description||(typeof t.error=="string"?t.error:(e=t.error)===null||e===void 0?void 0:e.message)||JSON.stringify(t)},Dpe=async(t,e,r,n)=>{if(t!==null&&typeof t=="object"&&typeof t.json=="function"){const i=t;let s=parseInt(i.status,10);Number.isFinite(s)||(s=500),i.json().then(a=>{const o=(a==null?void 0:a.statusCode)||(a==null?void 0:a.code)||s+"";e(new ZE(vD(a),s,o,n))}).catch(()=>{const a=s+"";e(new ZE(i.statusText||`HTTP ${s} error`,s,a,n))})}else e(new dW(vD(t),t,n))},Bpe=(t,e,r,n)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};if(t==="GET"||t==="HEAD"||!n)return ze(ze({},i),r);if(Lpe(n)){var s;const a=(e==null?void 0:e.headers)||{};let o;for(const[c,u]of Object.entries(a))c.toLowerCase()==="content-type"&&(o=u);i.headers=Fpe(a,"Content-Type",(s=o)!==null&&s!==void 0?s:"application/json"),i.body=JSON.stringify(n)}else i.body=n;return e!=null&&e.duplex&&(i.duplex=e.duplex),ze(ze({},i),r)};function Fpe(t,e,r){const n=ze({},t);for(const i of Object.keys(n))i.toLowerCase()===e.toLowerCase()&&delete n[i];return n[e]=r,n}async function vm(t,e,r,n,i,s,a){return new Promise((o,c)=>{t(r,Bpe(e,n,i,s)).then(u=>{if(!u.ok)throw u;if(n!=null&&n.noResolveJson)return u;if(a==="vectors"){const d=u.headers.get("content-type");if(u.headers.get("content-length")==="0"||u.status===204)return{};if(!d||!d.includes("application/json"))return{}}return u.json()}).then(u=>o(u)).catch(u=>Dpe(u,c,n,a))})}function fW(t="storage"){return{get:async(e,r,n,i)=>vm(e,"GET",r,n,i,void 0,t),post:async(e,r,n,i,s)=>vm(e,"POST",r,i,s,n,t),put:async(e,r,n,i,s)=>vm(e,"PUT",r,i,s,n,t),head:async(e,r,n,i)=>vm(e,"HEAD",r,ze(ze({},n),{},{noResolveJson:!0}),i,void 0,t),remove:async(e,r,n,i,s)=>vm(e,"DELETE",r,i,s,n,t)}}const zpe=fW("storage"),{get:rv,post:Qs,put:YE,head:Upe,remove:y2}=zpe,Fi=fW("vectors");var Np=class{constructor(t,e={},r,n="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=Object.fromEntries(Object.entries(e).map(([i,s])=>[i.toLowerCase(),s])),this.fetch=Ipe(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=ze(ze({},this.headers),{},{[t.toLowerCase()]:e}),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(q_(r))return{data:null,error:r};throw r}}},Hpe=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e}then(t,e){return this.execute().then(t,e)}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(q_(e))return{data:null,error:e};throw e}}};let hW;hW=Symbol.toStringTag;var Vpe=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[hW]="BlobDownloadBuilder",this.promise=null}asStream(){return new Hpe(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(q_(e))return{data:null,error:e};throw e}}};const Wpe={limit:100,offset:0,sortBy:{column:"name",order:"asc"}}
671,yD={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var qpe=class extends Np{constructor(t,e={},r,n){super(t,e,n,"storage"),this.bucketId=r}async uploadOrUpdate(t,e,r,n){var i=this;return i.handleOperation(async()=>{let s;const a=ze(ze({},yD),n);let o=ze(ze({},i.headers),t==="POST"&&{"x-upsert":String(a.upsert)});const c=a.metadata;typeof Blob<"u"&&r instanceof Blob?(s=new FormData,s.append("cacheControl",a.cacheControl),c&&s.append("metadata",i.encodeMetadata(c)),s.append("",r)):typeof FormData<"u"&&r instanceof FormData?(s=r,s.has("cacheControl")||s.append("cacheControl",a.cacheControl),c&&!s.has("metadata")&&s.append("metadata",i.encodeMetadata(c))):(s=r,o["cache-control"]=`max-age=${a.cacheControl}`,o["content-type"]=a.contentType,c&&(o["x-metadata"]=i.toBase64(i.encodeMetadata(c))),(typeof ReadableStream<"u"&&s instanceof ReadableStream||s&&typeof s=="object"&&"pipe"in s&&typeof s.pipe=="function")&&!a.duplex&&(a.duplex="half")),n!=null&&n.headers&&(o=ze(ze({},o),n.headers));const u=i._removeEmptyFolders(e),d=i._getFinalPath(u),f=await(t=="PUT"?YE:Qs)(i.fetch,`${i.url}/object/${d}`,s,ze({headers:o},a!=null&&a.duplex?{duplex:a.duplex}:{}));return{path:u,id:f.Id,fullPath:f.Key}})}async upload(t,e,r){return this.uploadOrUpdate("POST",t,e,r)}async uploadToSignedUrl(t,e,r,n){var i=this;const s=i._removeEmptyFolders(t),a=i._getFinalPath(s),o=new URL(i.url+`/object/upload/sign/${a}`);return o.searchParams.set("token",e),i.handleOperation(async()=>{let c;const u=ze(ze({},yD),n),d=ze(ze({},i.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&r instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),c.append("",r)):typeof FormData<"u"&&r instanceof FormData?(c=r,c.append("cacheControl",u.cacheControl)):(c=r,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType),{path:s,fullPath:(await YE(i.fetch,o.toString(),c,{headers:d})).Key}})}async createSignedUploadUrl(t,e){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(t);const i=ze({},r.headers);e!=null&&e.upsert&&(i["x-upsert"]="true");const s=await Qs(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:i}),a=new URL(r.url+s.url),o=a.searchParams.get("token");if(!o)throw new W_("No token returned by API");return{signedUrl:a.toString(),path:t,token:o}})}async update(t,e,r){return this.uploadOrUpdate("PUT",t,e,r)}async move(t,e,r){var n=this;return n.handleOperation(async()=>await Qs(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}))}async copy(t,e,r){var n=this;return n.handleOperation(async()=>({path:(await Qs(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(t,e,r){var n=this;return n.handleOperation(async()=>{let i=n._getFinalPath(t);const s=typeof(r==null?void 0:r.transform)=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let a=await Qs(n.fetch,`${n.url}/object/sign/${i}`,ze({expiresIn:e},s?{transform:r.transform}:{}),{headers:n.headers});const o=new URLSearchParams;r!=null&&r.download&&o.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&o.set("cacheNonce",String(r.cacheNonce));const c=o.toString();return{signedUrl:encodeURI(`${n.url}${a.signedURL}${c?`&${c}`:""}`)}})}async createSignedUrls(t,e,r){var n=this;return n.handleOperation(async()=>{const i=await Qs(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:e,paths:t},{headers:n.headers}),s=new URLSearchParams;r!=null&&r.download&&s.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&s.set("cacheNonce",String(r.cacheNonce));const a=s.toString();return i.map(o=>ze(ze({},o),{},{signedUrl:o.signedURL?encodeURI(`${n.url}${o.signedURL}${a?`&${a}`:""}`):null}))})}download(t,e,r){const n=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image/authenticated":"object",i=new URLSearchParams;e!=null&&e.transform&&this.applyTransformOptsToQuery(i,e.transform),(e==null?void 0:e.cacheNonce)!=null&&i.set("cacheNonce",String(e.cacheNonce));const s=i.toString(),a=this._getFinalPath(t),o=()=>rv(this.fetch,`${this.url}/${n}/${a}${s?`?${s}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new Vpe(o,this.shouldThrowOnError)}async info(t){var e=this;const r=e._getFinalPath(t);return e.handleOperation(async()=>JE(await rv(e.fetch,`${e.url}/object/info/${r}`,{headers:e.headers})))}async exists(t){var e=this;const r=e._getFinalPath(t);try{return await Upe(e.fetch,`${e.url}/object/${r}`,{headers:e.headers}),{data:!0,error:null}}catch(i){if(e.shouldThrowOnError)throw i;
671if(q_(i)){var n;const s=i instanceof ZE?i.status:i instanceof dW?(n=i.originalError)===null||n===void 0?void 0:n.status:void 0;if(s!==void 0&&[400,404].includes(s))return{data:!1,error:i}}throw i}}getPublicUrl(t,e){const r=this._getFinalPath(t),n=new URLSearchParams;e!=null&&e.download&&n.set("download",e.download===!0?"":e.download),e!=null&&e.transform&&this.applyTransformOptsToQuery(n,e.transform),(e==null?void 0:e.cacheNonce)!=null&&n.set("cacheNonce",String(e.cacheNonce));const i=n.toString(),s=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${s}/public/${r}`)+(i?`?${i}`:"")}}}async remove(t){var e=this;return e.handleOperation(async()=>await y2(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async list(t,e,r){var n=this;return n.handleOperation(async()=>{const i=ze(ze(ze({},Wpe),e),{},{prefix:t||""});return await Qs(n.fetch,`${n.url}/object/list/${n.bucketId}`,i,{headers:n.headers},r)})}async listV2(t,e){var r=this;return r.handleOperation(async()=>{const n=ze({},t);return await Qs(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},e)})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(t,e){return e.width&&t.set("width",e.width.toString()),e.height&&t.set("height",e.height.toString()),e.resize&&t.set("resize",e.resize),e.format&&t.set("format",e.format),e.quality&&t.set("quality",e.quality.toString()),t}};const Kpe="2.103.3",Ey={"X-Client-Info":`storage-js/${Kpe}`};var Gpe=class extends Np{constructor(t,e={},r,n){const i=new URL(t);n!=null&&n.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=ze(ze({},Ey),e);super(s,a,r,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=e.listBucketOptionsToQueryString(t);return await rv(e.fetch,`${e.url}/bucket${r}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await rv(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var r=this;return r.handleOperation(async()=>await Qs(r.fetch,`${r.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async updateBucket(t,e){var r=this;return r.handleOperation(async()=>await YE(r.fetch,`${r.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await Qs(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await y2(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}listBucketOptionsToQueryString(t){const e={};return t&&("limit"in t&&(e.limit=String(t.limit)),"offset"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},Zpe=class extends Np{constructor(t,e={},r){const n=t.replace(/\/$/,""),i=ze(ze({},Ey),e);super(n,i,r,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Qs(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&r.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&r.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&r.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&r.set("sortOrder",t.sortOrder),t!=null&&t.search&&r.set("search",t.search);const n=r.toString(),i=n?`${e.url}/bucket?${n}`:`${e.url}/bucket`;return await rv(e.fetch,i,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await y2(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!$pe(t))throw new W_("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 r=new Ape({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(i,s){const a=i[s];return typeof a!="function"?a:async(...o)=>{try{return{data:await a.apply(i,o),error:null}}catch(c){if(n)throw c;return{data:null,error:c}}}}})}},Jpe=class extends Np{constructor(t,e={},r){const n=t.replace(/\/$/,""),i=ze(ze({},Ey),{},{"Content-Type":"application/json"},e);super(n,i,r,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await Fi.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var r=this;return r.handleOperation(async()=>await Fi.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await Fi.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var r=this;return r.handleOperation(async()=>await Fi.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers})||{})}},Ype=class extends Np{constructor(t,e={},r){const n=t.replace(/\/$/,""),i=ze(ze({},Ey),{},{"Content-Type":"application/json"},e);super(n,i,r,"vectors")}async putVectors(t){var e=this;if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await Fi.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await Fi.post(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}))}async listVectors(t){var e=this;if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");
671if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return e.handleOperation(async()=>await Fi.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await Fi.post(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}))}async deleteVectors(t){var e=this;if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await Fi.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},Xpe=class extends Np{constructor(t,e={},r){const n=t.replace(/\/$/,""),i=ze(ze({},Ey),{},{"Content-Type":"application/json"},e);super(n,i,r,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Fi.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await Fi.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await Fi.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Fi.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},Qpe=class extends Xpe{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new eme(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,r=this;return e().call(r,t)}async getBucket(t){var e=()=>super.getBucket,r=this;return e().call(r,t)}async listBuckets(t={}){var e=()=>super.listBuckets,r=this;return e().call(r,t)}async deleteBucket(t){var e=()=>super.deleteBucket,r=this;return e().call(r,t)}},eme=class extends Jpe{constructor(t,e,r,n){super(t,e,n),this.vectorBucketName=r}async createIndex(t){var e=()=>super.createIndex,r=this;return e().call(r,ze(ze({},t),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,r=this;return e().call(r,ze(ze({},t),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,r=this;return e().call(r,r.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,r=this;return e().call(r,r.vectorBucketName,t)}index(t){return new tme(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},tme=class extends Ype{constructor(t,e,r,n,i){super(t,e,i),this.vectorBucketName=r,this.indexName=n}async putVectors(t){var e=()=>super.putVectors,r=this;return e().call(r,ze(ze({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(t){var e=()=>super.getVectors,r=this;return e().call(r,ze(ze({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,r=this;return e().call(r,ze(ze({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,r=this;return e().call(r,ze(ze({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,r=this;return e().call(r,ze(ze({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},rme=class extends Gpe{constructor(t,e={},r,n){super(t,e,r,n)}from(t){return new qpe(this.url,this.headers,t,this.fetch)}get vectors(){return new Qpe(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new Zpe(this.url+"/iceberg",this.headers,this.fetch)}};const pW="2.103.3",cf=30*1e3,XE=3,Kj=XE*cf,nme="http://localhost:9999",ime="supabase.auth.token",sme={"X-Client-Info":`gotrue-js/${pW}`},QE="X-Supabase-Api-Version",mW={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},ame=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,ome=10*60*1e3;class nv extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function Te(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class lme extends nv{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.co
671de=n}}function cme(t){return Te(t)&&t.name==="AuthApiError"}class hu extends nv{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}}class el extends nv{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}}class Ii extends el{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Wx(t){return Te(t)&&t.name==="AuthSessionMissingError"}class Zd extends el{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class qx extends el{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class Kx extends el{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function ume(t){return Te(t)&&t.name==="AuthImplicitGrantRedirectError"}class xD extends el{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class dme extends el{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 eO extends el{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}}function Gj(t){return Te(t)&&t.name==="AuthRetryableFetchError"}class bD extends el{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class tO extends el{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const q0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),wD=` 	
672\r=`.split(""),fme=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<wD.length;e+=1)t[wD[e].charCodeAt(0)]=-2;for(let e=0;e<q0.length;e+=1)t[q0[e].charCodeAt(0)]=e;return t})();function _D(t,e,r){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(q0[n]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(q0[n]),e.queuedBits-=6}}function gW(t,e,r){const n=fme[t];if(n>-1)for(e.queue=e.queue<<6|n,e.queuedBits+=6;e.queuedBits>=8;)r(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function kD(t){const e=[],r=a=>{e.push(String.fromCodePoint(a))},n={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},s=a=>{mme(a,n,r)};for(let a=0;a<t.length;a+=1)gW(t.charCodeAt(a),i,s);return e.join("")}function hme(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function pme(t,e){for(let r=0;r<t.length;r+=1){let n=t.charCodeAt(r);if(n>55295&&n<=56319){const i=(n-55296)*1024&65535;n=(t.charCodeAt(r+1)-56320&65535|i)+65536,r+=1}hme(n,e)}}function mme(t,e,r){if(e.utf8seq===0){if(t<=127){r(t);return}for(let n=1;n<6;n+=1)if(!(t>>7-n&1)){e.utf8seq=n;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&r(e.codepoint)}}function Zf(t){const e=[],r={queue:0,queuedBits:0},n=i=>{e.push(i)};for(let i=0;i<t.length;i+=1)gW(t.charCodeAt(i),r,n);return new Uint8Array(e)}function gme(t){const e=[];return pme(t,r=>e.push(r)),new Uint8Array(e)}function bu(t){const e=[],r={queue:0,queuedBits:0},n=i=>{e.push(i)};return t.forEach(i=>
672_D(i,r,n)),_D(null,r,n),e.join("")}function vme(t){return Math.round(Date.now()/1e3)+t}function yme(){return Symbol("auth-callback")}const _n=()=>typeof window<"u"&&typeof document<"u",eu={tested:!1,writable:!1},vW=()=>{if(!_n())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(eu.tested)return eu.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),eu.tested=!0,eu.writable=!0}catch{eu.tested=!0,eu.writable=!1}return eu.writable};function xme(t){const e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((i,s)=>{e[s]=i})}catch{}return r.searchParams.forEach((n,i)=>{e[i]=n}),e}const yW=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),bme=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",uf=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))},tu=async(t,e)=>{const r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}},bn=async(t,e)=>{await t.removeItem(e)};class K_{constructor(){this.promise=new K_.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}}K_.promiseConstructor=Promise;function Gx(t){const e=t.split(".");if(e.length!==3)throw new tO("Invalid JWT structure");for(let n=0;n<e.length;n++)if(!ame.test(e[n]))throw new tO("JWT not in base64url format");return{header:JSON.parse(kD(e[0])),payload:JSON.parse(kD(e[1])),signature:Zf(e[2]),raw:{header:e[0],payload:e[1]}}}async function wme(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function _me(t,e){return new Promise((n,i)=>{(async()=>{for(let s=0;s<1/0;s++)try{const a=await t(s);if(!e(s,null,a)){n(a);return}}catch(a){if(!e(s,a)){i(a);return}}})()})}function kme(t){return("0"+t.toString(16)).substr(-2)}function Sme(){const e=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let i="";for(let s=0;s<56;s++)i+=r.charAt(Math.floor(Math.random()*n));return i}return crypto.getRandomValues(e),Array.from(e,kme).join("")}async function jme(t){const r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r),i=new Uint8Array(n);return Array.from(i).map(s=>String.fromCharCode(s)).join("")}async function Nme(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;const r=await jme(t);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Jd(t,e,r=!1){const n=Sme();let i=n;r&&(i+="/PASSWORD_RECOVERY"),await uf(t,`${e}-code-verifier`,i);const s=await Nme(n);return[s,n===s?"plain":"s256"]}const Cme=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Eme(t){const e=t.headers.get(QE);if(!e||!e.match(Cme))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function Ome(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function Tme(t){switch(t){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const Ame=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Yd(t){if(!Ame.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Zj(){const t={};return new Proxy(t,{get:(e,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="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 "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function Pme(t,e){return new Proxy(t,{get:(r,n,i)=>{if(n==="__isInsecureUserWarningProxy")return!0;
672if(typeof n=="symbol"){const s=n.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="Symbol(util.inspect.custom)"||s==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,i)}return!e.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(r,n,i)}})}function SD(t){return JSON.parse(JSON.stringify(t))}const cu=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),Mme=[502,503,504,520,521,522,523,524,530];async function jD(t){var e;if(!bme(t))throw new eO(cu(t),0);if(Mme.includes(t.status))throw new eO(cu(t),t.status);let r;try{r=await t.json()}catch(s){throw new hu(cu(s),s)}let n;const i=Eme(t);if(i&&i.getTime()>=mW["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new bD(cu(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new Ii}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((s,a)=>s&&typeof a=="string",!0))throw new bD(cu(r),t.status,r.weak_password.reasons);throw new lme(cu(r),t.status||500,n)}const Rme=(t,e,r,n)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),i.body=JSON.stringify(n),Object.assign(Object.assign({},i),r))};async function Be(t,e,r,n){var i;const s=Object.assign({},n==null?void 0:n.headers);s[QE]||(s[QE]=mW["2024-01-01"].name),n!=null&&n.jwt&&(s.Authorization=`Bearer ${n.jwt}`);const a=(i=n==null?void 0:n.query)!==null&&i!==void 0?i:{};n!=null&&n.redirectTo&&(a.redirect_to=n.redirectTo);const o=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",c=await Ime(t,e,r+o,{headers:s,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(c):{data:Object.assign({},c),error:null}}async function Ime(t,e,r,n,i,s){const a=Rme(e,n,i,s);let o;try{o=await t(r,Object.assign({},a))}catch(c){throw console.error(c),new eO(cu(c),0)}if(o.ok||await jD(o),n!=null&&n.noResolveJson)return o;try{return await o.json()}catch(c){await jD(c)}}function Zs(t){var e;let r=null;Dme(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=vme(t.expires_in)));const n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}function ND(t){const e=Zs(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(e.data.weak_password=t.weak_password),e}function Ml(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function Lme(t){return{data:t,error:null}}function $me(t){const{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:s}=t,a=V_(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:s},c=Object.assign({},a);return{data:{properties:o,user:c},error:null}}function CD(t){return t}function Dme(t){return t.access_token&&t.refresh_token&&t.expires_in}const Jj=["global","local","others"];class Bme{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=yW(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)}}
vendor: 4,781 bytes, line 672
672async signOut(e,r=Jj[0]){if(Jj.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Jj.join(", ")}`);try{return await Be(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Te(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await Be(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Ml})}catch(n){if(Te(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{const{options:r}=e,n=V_(e,["options"]),i=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(i.new_email=n==null?void 0:n.newEmail,delete i.newEmail),await Be(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:$me,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(Te(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await Be(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Ml})}catch(r){if(Te(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,i,s,a,o,c;try{const u={nextPage:null,lastPage:0,total:0},d=await Be(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(s=(i=e==null?void 0:e.perPage)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""},xform:CD});if(d.error)throw d.error;const f=await d.json(),p=(a=d.headers.get("x-total-count"))!==null&&a!==void 0?a:0,m=(c=(o=d.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&c!==void 0?c:[];return m.length>0&&(m.forEach(y=>{const v=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),w=JSON.parse(y.split(";")[1].split("=")[1]);u[`${w}Page`]=v}),u.total=parseInt(p)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(Te(u))return{data:{users:[]},error:u};throw u}}async getUserById(e){Yd(e);try{return await Be(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Ml})}catch(r){if(Te(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){Yd(e);try{return await Be(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:Ml})}catch(n){if(Te(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){Yd(e);try{return await Be(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:Ml})}catch(n){if(Te(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){Yd(e.userId);try{const{data:r,error:n}=await Be(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:r,error:n}}catch(r){if(Te(r))return{data:null,error:r};throw r}}async _deleteFactor(e){Yd(e.userId),Yd(e.id);try{return{data:await Be(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if(Te(r))return{data:null,error:r};throw r}}async _listOAuthClients(e){var r,n,i,s,a,o,c;try{const u={nextPage:null,lastPage:0,total:0},d=await Be(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(s=(i=e==null?void 0:e.perPage)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""},xform:CD});if(d.error)throw d.error;const f=await d.json(),p=(a=d.headers.get("x-total-count"))!==null&&a!==void 0?a:0,m=(c=(o=d.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&c!==void 0?c:[];return m.length>0&&(m.forEach(y=>{const v=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),w=JSON.parse(y.split(";")[1].split("=")[1]);u[`${w}Page`]=v}),u.total=parseInt(p)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(Te(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(e){try{return await Be(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Te(r))return{data:null,error:r};throw r}}async _getOAuthClient(e){try{return await Be(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Te(r))return{data:null,error:r};throw r}}async _updateOAuthClient(e,r){try{return await Be(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Te(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(e){try{return await Be(this.fetch,"DELET
672E",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Te(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(e){try{return await Be(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Te(r))return{data:null,error:r};throw r}}async _listCustomProviders(e){try{const r={};return e!=null&&e.type&&(r.type=e.type),await Be(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:n=>{var i;return{data:{providers:(i=n==null?void 0:n.providers)!==null&&i!==void 0?i:[]},error:null}}})}catch(r){if(Te(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(e){try{return await Be(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Te(r))return{data:null,error:r};throw r}}async _getCustomProvider(e){try{return await Be(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Te(r))return{data:null,error:r};throw r}}async _updateCustomProvider(e,r){try{return await Be(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Te(n))return{data:null,error:n};throw n}}async _deleteCustomProvider(e){try{return await Be(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Te(r))return{data:null,error:r};throw r}}}function ED(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}const Sa={debug:!!(globalThis&&vW()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class xW extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class OD extends xW{}async function Fme(t,e,r){Sa.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const n=new globalThis.AbortController;let i;e>0&&(i=setTimeout(()=>{n.abort(),Sa.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e)),await Promise.resolve();try{return await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async s=>{if(s){clearTimeout(i),Sa.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,s.name);try{return await r()}finally{Sa.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,s.name)}}else{if(e===0)throw Sa.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new OD(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Sa.debug)try{const a=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(a,null,"  "))}catch(a){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",a)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(i),await r()}})}catch(s){if(e>0&&clearTimeout(i),(s==null?void 0:s.name)==="AbortError"&&e>0){if(n.signal.aborted)return Sa.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",t),console.warn(`@supabase/gotrue-js: Lock "${t}" was not released within ${e}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,{mode:"exclusive",steal:!0},async a=>{if(a){Sa.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",t,a.name);try{return await r()}finally{Sa.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",t,a.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await r()}));throw Sa.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",t),new OD(`Lock "${t}" was released because another request stole it`)}throw s}}function zme(){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 bW(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}
672" is invalid.`);return t.toLowerCase()}function Ume(t){return parseInt(t,16)}function Hme(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")}function Vme(t){var e;const{chainId:r,domain:n,expirationTime:i,issuedAt:s=new Date,nonce:a,notBefore:o,requestId:c,resources:u,scheme:d,uri:f,version:p}=t;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)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(!f)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(p!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${p}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(`
673`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const m=bW(t.address),y=d?`${d}://${n}`:n,v=t.statement?`${t.statement}
674`:"",w=`${y} wants you to sign in with your Ethereum account:
675${m}
676
677${v}`;let b=`URI: ${f}
678Version: ${p}
679Chain ID: ${r}${a?`
680Nonce: ${a}`:""}
681Issued At: ${s.toISOString()}`;if(i&&(b+=`
682Expiration Time: ${i.toISOString()}`),o&&(b+=`
683Not Before: ${o.toISOString()}`),c&&(b+=`
684Request ID: ${c}`),u){let _=`
685Resources:`;for(const S of u){if(!S||typeof S!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${S}`);_+=`
686- ${S}`}b+=_}return`${w}
687${b}`}class Br extends Error{constructor({message:e,code:r,cause:n,name:i}){var s;super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=(s=i??(n instanceof Error?n.name:void 0))!==null&&s!==void 0?s:"Unknown Error",this.code=r}}class K0 extends Br{constructor(e,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:e}),this.name="WebAuthnUnknownError",this.originalError=r}}function Wme({error:t,options:e}){var r,n,i;const{publicKey:s}=e;if(!s)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Br({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((r=s.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new Br({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((n=s.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new Br({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((i=s.authenticatorSelection)===null||i===void 0?void 0:i.userVerification)==="required")return new Br({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new Br({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new Br({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return s.pubKeyCredParams.filter(o=>o.type==="public-key").length===0?new Br({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new Br({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const a=window.location.hostname;if(wW(a)){if(s.rp.id!==a)return new Br({message:`The RP ID "${s.rp.id}
687" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Br({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(s.user.id.byteLength<1||s.user.id.byteLength>64)return new Br({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new Br({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new Br({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function qme({error:t,options:e}){const{publicKey:r}=e;if(!r)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Br({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new Br({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const n=window.location.hostname;if(wW(n)){if(r.rpId!==n)return new Br({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Br({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new Br({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new Br({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class Kme{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const Gme=new Kme;function Zme(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:r,excludeCredentials:n}=t,i=V_(t,["challenge","user","excludeCredentials"]),s=Zf(e).buffer,a=Object.assign(Object.assign({},r),{id:Zf(r.id).buffer}),o=Object.assign(Object.assign({},i),{challenge:s,user:a});if(n&&n.length>0){o.excludeCredentials=new Array(n.length);for(let c=0;c<n.length;c++){const u=n[c];o.excludeCredentials[c]=Object.assign(Object.assign({},u),{id:Zf(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return o}function Jme(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);const{challenge:e,allowCredentials:r}=t,n=V_(t,["challenge","allowCredentials"]),i=Zf(e).buffer,s=Object.assign(Object.assign({},n),{challenge:i});if(r&&r.length>0){s.allowCredentials=new Array(r.length);for(let a=0;a<r.length;a++){const o=r[a];s.allowCredentials[a]=Object.assign(Object.assign({},o),{id:Zf(o.id).buffer,type:o.type||"public-key",transports:o.transports})}}return s}function Yme(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t;return{id:t.id,rawId:t.id,response:{attestationObject:bu(new Uint8Array(t.response.attestationObject)),clientDataJSON:bu(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function Xme(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t,n=t.getClientExtensionResults(),i=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:bu(new Uint8Array(i.authenticatorData)),clientDataJSON:bu(new Uint8Array(i.clientDataJSON)),signature:bu(new Uint8Array(i.signature)),userHandle:i.userHandle?bu(new 
687Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function wW(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function TD(){var t,e;return!!(_n()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function Qme(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new K0("Browser returned unexpected credential type",e)}:{data:null,error:new K0("Empty credential response",e)}}catch(e){return{data:null,error:Wme({error:e,options:t})}}}async function ege(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new K0("Browser returned unexpected credential type",e)}:{data:null,error:new K0("Empty credential response",e)}}catch(e){return{data:null,error:qme({error:e,options:t})}}}const tge={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},rge={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function G0(...t){const e=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),r=i=>i instanceof ArrayBuffer||ArrayBuffer.isView(i),n={};for(const i of t)if(i)for(const s in i){const a=i[s];if(a!==void 0)if(Array.isArray(a))n[s]=a;else if(r(a))n[s]=a;else if(e(a)){const o=n[s];e(o)?n[s]=G0(o,a):n[s]=G0(a)}else n[s]=a}return n}function nge(t,e){return G0(tge,t,e||{})}function ige(t,e){return G0(rge,t,e||{})}class sge{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:r,friendlyName:n,signal:i},s){var a;try{const{data:o,error:c}=await this.client.mfa.challenge({factorId:e,webauthn:r});if(!o)return{data:null,error:c};const u=i??Gme.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:d}=o.webauthn.credential_options.publicKey;if(!d.name){const f=n;if(f)d.name=`${d.id}:${f}`;else{const m=(await this.client.getUser()).data.user,y=((a=m==null?void 0:m.user_metadata)===null||a===void 0?void 0:a.name)||(m==null?void 0:m.email)||(m==null?void 0:m.id)||"User";d.name=`${d.id}:${y}`}}d.displayName||(d.displayName=d.name)}switch(o.webauthn.type){case"create":{const d=nge(o.webauthn.credential_options.publicKey,s==null?void 0:s.create),{data:f,error:p}=await Qme({publicKey:d,signal:u});return f?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:f}},error:null}:{data:null,error:p}}case"request":{const d=ige(o.webauthn.credential_options.publicKey,s==null?void 0:s.request),{data:f,error:p}=await ege(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:d,signal:u}));return f?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:f}},error:null}:{data:null,error:p}}}}catch(o){return Te(o)?{data:null,error:o}:{data:null,error:new hu("Unexpected error in challenge",o)}}}async _verify({challengeId:e,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},s){if(!r)return{data:null,error:new nv("rpId is required for WebAuthn authentication")};try{if(!TD())return{data:null,error:new hu("Browser does not support WebAuthn",null)};const{data:a,error:o}=await this.challenge({factorId:e,webauthn:{rpId:r,rpOrigins:n},signal:i},{request:s});if(!a)return{data:null,error:o};const{webauthn:c}=a;return this._verify({factorId:e,challengeId:a.challengeId,webauthn:{type:c.type,rpId:r,rpOrigins:n,credential_response:c.credential_response}})}catch(a){return Te(a)?{data:null,error:a}:{data:null,error:new hu("Unexpected error in authenticate",a)}}}async _register({friendlyName:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},s){if(!r)return{data:null,error:new nv("rpId is required for WebAuthn registration")};try{if(!TD())return{data:null,error:new hu("Browser does not support WebAuthn",null)};const{data:a,error:o}=await this._enroll({friendlyName:e});if(!a)return await this.client.mfa.listFactors().then(d=>{var f;return(f=d.data)===null||f===void 0?void 0:f.all.find(p=>p.factor_type==="webauthn"&&p.friendly_name===e&&p.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:o};const{data:c,error:u}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:i},{create:s});return c?this._verify({factorId:a.id,challengeId:c.challengeId,webauthn:{rpId:r,rpOrigins:n,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:u}}catch(a){return Te(a)?{data:null,error:a}:{data:null,error:new hu("Unexpected error in register",a)}}}}zme();const age={url:nme,storageKey:ime,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:sme,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function AD(t,e,r){return await r()}const Xd={};class iv{get jwks(){var e,r;return(r=(e=Xd[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){Xd[this.storageKey]=Object.assign(Object.assign({}
687,Xd[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=Xd[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Xd[this.storageKey]=Object.assign(Object.assign({},Xd[this.storageKey]),{cachedAt:e})}constructor(e){var r,n,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({},age),e);if(this.storageKey=s.storageKey,this.instanceID=(r=iv.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,iv.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.instanceID>0&&_n()){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 Bme({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=yW(s.fetch),this.lock=s.lock||AD,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&&_n()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=Fme:this.lock=AD,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 sge(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:vW()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=ED(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=ED(this.memoryStorage)),_n()&&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)}})}s.skipAutoInitialize||this.initialize().catch(a=>{this._debug("#initialize()","error",a)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${pW}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let r={},n="none";if(_n()&&(r=xme(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),_n()&&this.detectSessionInUrl&&n!=="none"){const{data:i,error:s}=await this._getSessionFromURL(r,n);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),ume(s)){const c=(e=s.details)===null||e===void 0?void 0:e.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:s}}return{error:s}}const{session:a,redirectType:o}=i;return this._debug("#_initialize()","detected session in URL",a,"redirect type",o),await this._saveSession(a),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",a):await this._notifyAllSubscribers("SIGNED_IN",a)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return Te(r)?this._returnResult({error:r}):this._returnResult({error:new hu("Unexpected error during initialization",r)}
687)}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,i;try{const s=await Be(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(i=e==null?void 0:e.options)===null||i===void 0?void 0:i.captchaToken}},xform:Zs}),{data:a,error:o}=s;if(o||!a)return this._returnResult({data:{user:null,session:null},error:o});const c=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(s){if(Te(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signUp(e){var r,n,i;try{let s;if("email"in e){const{email:d,password:f,options:p}=e;let m=null,y=null;this.flowType==="pkce"&&([m,y]=await Jd(this.storage,this.storageKey)),s=await Be(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:p==null?void 0:p.emailRedirectTo,body:{email:d,password:f,data:(r=p==null?void 0:p.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken},code_challenge:m,code_challenge_method:y},xform:Zs})}else if("phone"in e){const{phone:d,password:f,options:p}=e;s=await Be(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:f,data:(n=p==null?void 0:p.data)!==null&&n!==void 0?n:{},channel:(i=p==null?void 0:p.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken}},xform:Zs})}else throw new qx("You must provide either an email or phone number and a password");const{data:a,error:o}=s;if(o||!a)return await bn(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:o});const c=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(s){if(await bn(this.storage,`${this.storageKey}-code-verifier`),Te(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithPassword(e){try{let r;if("email"in e){const{email:s,password:a,options:o}=e;r=await Be(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:ND})}else if("phone"in e){const{phone:s,password:a,options:o}=e;r=await Be(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:ND})}else throw new qx("You must provide either an email or phone number and a password");const{data:n,error:i}=r;if(i)return this._returnResult({data:{user:null,session:null},error:i});if(!n||!n.session||!n.user){const s=new Zd;return this._returnResult({data:{user:null,session:null},error:s})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if(Te(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(e){var r,n,i,s;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(s=e.options)===null||s===void 0?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:r}=e;switch(r){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(e){var r,n,i,s,a,o,c,u,d,f,p;let m,y;if("message"in e)m=e.message,y=e.signature;else{const{chain:v,wallet:w,statement:b,options:_}=e;let S;if(_n())if(typeof w=="object")S=w;else{const T=window;if("ethereum"in T&&typeof T.ethereum=="object"&&"request"in T.ethereum&&typeof T.ethereum.request=="function")S=T.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 w!="object"||!(_!=null&&_.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");S=w}const N=new URL((r=_==null?void 0:_.url)!==null&&r!==void 0?r:window.location.href),j=await S.request({method:"eth_requestAccounts"}).then(T=>T).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!j||j.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const C=bW(j[0]);let O=(n=_==null?void 0:_.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!O){const T=await S.request({method:"eth_chainId"});O=Ume(T)}const P={domain:N.host,address:C,statement:b,uri:N.href,version:"1",chainId:O,nonce:(i=_==null?void 0:_.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(a=(s=_==null?void 0:_.signInWithEthereum)===null||s===void 0?void 0:s.issuedAt)!==null&&a!==void 0?a:new Date,expirationTime:(o=_==null?void 0:_.signInWithEthereum)===null||o===void 0?void 0:o.expirationTime,notBefore:(c=_==null?void 0:_.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(u=_==null?void 0:_.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=_==null?void 0:_.signInWithEthereum)===null||d===void 0?void 0:d.resources};m=Vme(P),y=await S.request({method:"personal_sign",params:[Hme(m),C]})}try{const{data:v,error:w}=await Be(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:m,signature:y},!((f=e.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(p=e.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:Zs});if(w)throw w;if(!v||!v.session||!v.user){const b=new Zd;return this._returnResult({data:{user:null,session:null},error:b})}return v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers("SIGNED_IN",v.session)),this._returnResult({data:Object.assign({},v),error:w})}catch(v){if(Te(v))return this._returnResult({data:{user:null,session:null},error:v});throw v}}async signInWithSolana(e){var r,n,i,s,a,o,c,u,d,f,p,m;let y,v;if("message"in e)y=e.message,v=e.signature;else{const{chain:w,wallet:b,statement:_,options:S}=e;let N;if(_n())if(typeof b=="object")N=b;else{const C=window;if("solana"in C&&typeof C.solana=="object"&&("signIn"in C.solana&&typeof C.solana.signIn=="function"||"signMessage"in C.solana&&typeof C.solana.signMessage=="function"))N=C.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof b!="object"||!(S!=null&&S.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");N=b}const j=new URL((r=S==null?void 0:S.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in N&&N.signIn){const C=await N.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},S==null?void 0:S.signInWithSolana),{version:"1",domain:j.host,uri:j.href}),_?{statement:_}:null));let O;if(Array.isArray(C)&&C[0]&&typeof C[0]=="object")O=C[0];else if(C&&typeof C=="object"&&"signedMessage"in C&&"signature"in C)O=C;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in O&&"signature"in O&&(typeof O.signedMessage=="string"||O.signedMessage instanceof Uint8Array)&&O.signature instanceof Uint8Array)y=typeof O.signedMessage=="string"?O.signedMessage:new TextDecoder().decode(O.signedMessage),v=O.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in N)||typeof N.signMessage!="function"||!("publicKey"in N)||typeof N!="object"||!N.publicKey||!("toBase58"in N.publicKey)||typeof N.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");y=[`${j.host} wants you to sign in with your Solana account:`,N.publicKey.toBase58(),..._?["",_,""]:[""],"Version: 1",`URI: ${j.href}`,`Issued At: ${(i=(n=S==null?void 0:S.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((s=S==null?void 0:S.signInWithSolana)===null||s===void 0)&&s.notBefore?[`Not Before: ${S.signInWithSolana.notBefore}`]:[],...!((a=S==null?void 0:S.signInWithSolana)===null||a===void 0)&&a.expirationTime?[`Expiration Time: ${S.signInWithSolana.expirationTime}`]:[],...!((o=S==null?void 0:S.signInWithSolana)===null||o===void 0)&&o.chainId?[`Chain ID: ${S.signInWithSolana.chainId}`]:[],...!((c=S==null?void 0:S.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${S.signInWithSolana.nonce}`]:[],...!((u=S==null?void 0:S.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${S.signInWithSolana.requestId}`]:[],...!((f=(d=S==null?void 0:S.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||f===void 0)&&f.length?["Resources",...S.signInWithSolana.resources.map(O=>`- ${O}`)]:[]].join(`
688`);const C=await N.signMessage(new TextEncoder().encode(y),"utf8");if(!C||!(C instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");v=C}}try{const{data:w,error:b}=await Be(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:y,signature:bu(v)},!((p=e.options)===null||p===void 0)&&p.captchaToken?{gotrue_meta_security:{captcha_token:(m=e.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:Zs});if(b)throw b;if(!w||!w.session||!w.user){const _=new Zd;return this._returnResult({data:{user:null,session:null},error:_})}return w.session&&(await this._saveSession(w.session),await this._notifyAllSubscribers("SIGNED_IN",w.session)),this._returnResult({data:Object.assign({},w),error:b})}catch(w){if(Te(w))return this._returnResult({data:{user:null,session:null},error:w});throw w}}async _exchangeCodeForSession(e){const r=await tu(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new dme;const{data:s,error:a}=await Be(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:Zs});if(await bn(this.storage,`${this.storageKey}-code-verifier`),a)throw a;if(!s||!s.session||!s.user){const o=new Zd;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 bn(this.storage,`${this.storageKey}-code-verifier`),Te(s))return this._returnResult({data:{user:null,session:null,redirectType:null},error:s});throw s}}async signInWithIdToken(e){try{const{options:r,provider:n,token:i,access_token:s,nonce:a}=e,o=await Be(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:s,nonce:a,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:Zs}),{data:c,error:u}=o;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!c||!c.session||!c.user){const d=new Zd;return this._returnResult({data:{user:null,session:null},error:d})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:u})}catch(r){if(Te(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(e){var r,n,i,s,a;try{if("email"in e){const{email:o,options:c}=e;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await Jd(this.storage,this.storageKey));const{error:f}=await Be(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(r=c==null?void 0:c.data)!==null&&r!==void 0?r:{},create_user:(n=c==null?void 0:c.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:f})}if("phone"in e){const{phone:o,options:c}=e,{data:u,error:d}=await Be(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(i=c==null?void 0:c.data)!==null&&i!==void 0?i:{},create_user:(s=c==null?void 0:c.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(a=c==null?void 0:c.channel)!==null&&a!==void 0?a:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new qx("You must provide either an email or phone number.")}catch(o){if(await bn(this.storage,`${this.storageKey}-code-verifier`),Te(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async verifyOtp(e){var r,n;try{let i,s;"options"in e&&(i=(r=e.options)===null||r===void 0?void 0:r.redirectTo,s=(n=e.options)===null||n===void 0?void 0:n.captchaToken);const{data:a,error:o}=await Be(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:s}}),redirectTo:i,xform:Zs});if(o)throw o;if(!a)throw new Error("An error occurred on token verification.");const c=a.session,u=a.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(i){if(Te(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithSSO(e){var r,n,i,s,a;try{let o=null,c=null;this.flowType==="pkce"&&([o,c]=await Jd(this.storage,this.storageKey));const u=await Be(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=e==null?void 0:e.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}
688:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:c}),headers:this.headers,xform:Lme});return!((s=u.data)===null||s===void 0)&&s.url&&_n()&&!(!((a=e.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(o){if(await bn(this.storage,`${this.storageKey}-code-verifier`),Te(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 e=>{const{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new Ii;const{error:i}=await Be(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:i})})}catch(e){if(Te(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const r=`${this.url}/resend`;if("email"in e){const{email:n,type:i,options:s}=e,{error:a}=await Be(this.fetch,"POST",r,{headers:this.headers,body:{email:n,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 e){const{phone:n,type:i,options:s}=e,{data:a,error:o}=await Be(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,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 qx("You must provide either an email or phone number and a type")}catch(r){if(Te(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const r=await tu(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const n=e.expires_at?e.expires_at*1e3-Date.now()<Kj:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.userStorage){const a=await tu(this.userStorage,this.storageKey+"-user");a!=null&&a.user?e.user=a.user:e.user=Zj()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const a={value:this.suppressGetSessionWarning};e.user=Pme(e.user,a),a.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:i,error:s}=await this._callRefreshToken(e.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(e){if(e)return await this._getUser(e);await this.initializePromise;const r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(e){try{return e?await Be(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Ml}):await this._useSession(async r=>{var n,i,s;const{data:a,error:o}=r;if(o)throw o;return!(!((n=a.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Ii}:await Be(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:Ml})})}catch(r){if(Te(r))return Wx(r)&&(await this._removeSession(),await bn(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{const{data:i,error:s}=n;if(s)throw s;if(!i.session)throw new Ii;const a=i.session;let o=null,c=null;this.flowType==="pkce"&&e.email!=null&&([o,c]=await Jd(this.storage,this.storageKey));const{data:u,error:d}=await Be(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({}
vendor: 4,857 bytes, line 688
688,e),{code_challenge:o,code_challenge_method:c}),jwt:a.access_token,xform:Ml});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(n){if(await bn(this.storage,`${this.storageKey}-code-verifier`),Te(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Ii;const r=Date.now()/1e3;let n=r,i=!0,s=null;const{payload:a}=Gx(e.access_token);if(a.exp&&(n=a.exp,i=n<=r),i){const{data:o,error:c}=await this._callRefreshToken(e.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!o)return{data:{user:null,session:null},error:null};s=o}else{const{data:o,error:c}=await this._getUser(e.access_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});s={access_token:e.access_token,refresh_token:e.refresh_token,user:o.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(r){if(Te(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){const{data:a,error:o}=r;if(o)throw o;e=(n=a.session)!==null&&n!==void 0?n:void 0}if(!(e!=null&&e.refresh_token))throw new Ii;const{data:i,error:s}=await this._callRefreshToken(e.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(r){if(Te(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(e,r){try{if(!_n())throw new Kx("No browser detected.");if(e.error||e.error_description||e.error_code)throw new Kx(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new xD("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Kx("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new xD("No code detected.");const{data:_,error:S}=await this._exchangeCodeForSession(e.code);if(S)throw S;const N=new URL(window.location.href);return N.searchParams.delete("code"),window.history.replaceState(window.history.state,"",N.toString()),{data:{session:_.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:i,access_token:s,refresh_token:a,expires_in:o,expires_at:c,token_type:u}=e;if(!s||!o||!a||!u)throw new Kx("No session defined in URL");const d=Math.round(Date.now()/1e3),f=parseInt(o);let p=d+f;c&&(p=parseInt(c));const m=p-d;m*1e3<=cf&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${m}s, should have been closer to ${f}s`);const y=p-f;d-y>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",y,p,d):d-y<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",y,p,d);const{data:v,error:w}=await this._getUser(s);if(w)throw w;const b={provider_token:n,provider_refresh_token:i,access_token:s,expires_in:f,expires_at:p,refresh_token:a,token_type:u,user:v.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:b,redirectType:e.type},error:null})}catch(n){if(Te(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){const r=await tu(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:i,error:s}=r;if(s&&!Wx(s))return this._returnResult({error:s});const a=(n=i.session)===null||n===void 0?void 0:n.access_token;if(a){const{error:o}=await this.admin.signOut(a,e);
688if(o&&!(cme(o)&&(o.status===404||o.status===401||o.status===403)||Wx(o)))return this._returnResult({error:o})}return e!=="others"&&(await this._removeSession(),await bn(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const r=yme(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,i;try{const{data:{session:s},error:a}=r;if(a)throw a;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",e,"session",s)}catch(s){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",s),Wx(s)?console.warn(s):console.error(s)}})}async resetPasswordForEmail(e,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await Jd(this.storage,this.storageKey,!0));try{return await Be(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(s){if(await bn(this.storage,`${this.storageKey}-code-verifier`),Te(s))return this._returnResult({data:null,error:s});throw s}}async getUserIdentities(){var e;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(r){if(Te(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var r;try{const{data:n,error:i}=await this._useSession(async s=>{var a,o,c,u,d;const{data:f,error:p}=s;if(p)throw p;const m=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(a=e.options)===null||a===void 0?void 0:a.redirectTo,scopes:(o=e.options)===null||o===void 0?void 0:o.scopes,queryParams:(c=e.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await Be(this.fetch,"GET",m,{headers:this.headers,jwt:(d=(u=f.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(i)throw i;return _n()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:e.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(Te(n))return this._returnResult({data:{provider:e.provider,url:null},error:n});throw n}}async linkIdentityIdToken(e){return await this._useSession(async r=>{var n;try{const{error:i,data:{session:s}}=r;if(i)throw i;const{options:a,provider:o,token:c,access_token:u,nonce:d}=e,f=await Be(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=s==null?void 0:s.access_token)!==null&&n!==void 0?n:void 0,body:{provider:o,id_token:c,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:Zs}),{data:p,error:m}=f;return m?this._returnResult({data:{user:null,session:null},error:m}):!p||!p.session||!p.user?this._returnResult({data:{user:null,session:null},error:new Zd}):(p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("USER_UPDATED",p.session)),this._returnResult({data:p,error:m}))}catch(i){if(await bn(this.storage,`${this.storageKey}-code-verifier`),Te(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}})}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,i;const{data:s,error:a}=r;if(a)throw a;return await Be(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(n=s.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(r){if(Te(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(e){const r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await _me(async i=>(i>0&&await wme(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await Be(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Zs})),(i,s)=>{const a=200*Math.pow(2,i);return s&&Gj(s)&&Date.now()+a-n<cf})}catch(n){if(this._debug(r,"error",n),Te(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),_n()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const i=await tu(this.storage,this.storageKey);if(i&&this.userStorage){let a=await tu(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!a&&(a={user:i.user},await uf(this.userStorage,this.storageKey+"-user",a)),i.user=(e=a==null?void 0:a.user)!==null&&e!==void 0?e:Zj()}else if(i&&!i.user&&!i.user){const a=await tu(this.storage,this.storageKey+"-user");a&&(a!=null&&a.user)?(i.user=a.user,await bn(this.storage,this.storageKey+"-user"),await uf(this.storage,this.storageKey,i)):i.user=Zj()}
688if(this._debug(n,"session from storage",i),!this._isValidSession(i)){this._debug(n,"session is not valid"),i!==null&&await this._removeSession();return}const s=((r=i.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<Kj;if(this._debug(n,`session has${s?"":" not"} expired with margin of ${Kj}s`),s){if(this.autoRefreshToken&&i.refresh_token){const{error:a}=await this._callRefreshToken(i.refresh_token);a&&(console.error(a),Gj(a)||(this._debug(n,"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(n,"could not get user data, skipping SIGNED_IN notification")}catch(a){console.error("Error getting user data:",a),this._debug(n,"error getting user data, skipping SIGNED_IN notification",a)}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){this._debug(n,"error",i),console.error(i);return}finally{this._debug(n,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new Ii;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new K_;const{data:s,error:a}=await this._refreshAccessToken(e);if(a)throw a;if(!s.session)throw new Ii;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),Te(s)){const a={data:null,error:s};return Gj(s)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(a),a}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(s),s}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,r,n=!0){const i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});const s=[],a=Array.from(this.stateChangeEmitters.values()).map(async o=>{try{await o.callback(e,r)}catch(c){s.push(c)}});if(await Promise.all(a),s.length>0){for(let o=0;o<s.length;o+=1)console.error(s[o]);throw s[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await bn(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},e),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await uf(this.userStorage,this.storageKey+"-user",{user:r.user});const i=Object.assign({},r);delete i.user;const s=SD(i);await uf(this.storage,this.storageKey,s)}else{const i=SD(r);await uf(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await bn(this.storage,this.storageKey),await bn(this.storage,this.storageKey+"-code-verifier"),await bn(this.storage,this.storageKey+"-user"),this.userStorage&&await bn(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&_n()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),cf);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const i=Math.floor((n.expires_at*1e3-e)/cf);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${cf}ms, refresh threshold is ${XE} ticks`),i<=XE&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof xW)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!_n()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(
688await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){const i=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[s,a]=await Jd(this.storage,this.storageKey),o=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(a)}`});i.push(o.toString())}if(n!=null&&n.queryParams){const s=new URLSearchParams(n.queryParams);i.push(s.toString())}return n!=null&&n.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;const{data:i,error:s}=r;return s?this._returnResult({data:null,error:s}):await Be(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(Te(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,i;const{data:s,error:a}=r;if(a)return this._returnResult({data:null,error:a});const o=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:c,error:u}=await Be(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(e.factorType==="totp"&&c.type==="totp"&&(!((i=c==null?void 0:c.totp)===null||i===void 0)&&i.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(r){if(Te(r))return this._returnResult({data:null,error:r});throw r}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:i,error:s}=r;if(s)return this._returnResult({data:null,error:s});const a=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?Yme(e.webauthn.credential_response):Xme(e.webauthn.credential_response)})}:{code:e.code}),{data:o,error:c}=await Be(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:a,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),this._returnResult({data:o,error:c}))})}catch(r){if(Te(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:i,error:s}=r;if(s)return this._returnResult({data:null,error:s});const a=await Be(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.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:Zme(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:Jme(o.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(Te(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(e){const{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){var e;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const i={all:[],phone:[],totp:[],webauthn:[]};for(const s of(e=r==null?void 0:r.factors)!==null&&e!==void 0?e:[])i.all.push(s),s.status==="verified"&&i[s.factor_type].push(s);return{data:i,error:null}}async _getAuthenticatorAssuranceLevel(e){var r,n,i,s;if(e)try{const{payload:m}=Gx(e);let y=null;m.aal&&(y=m.aal);let v=y;const{data:{user:w},error:b}=await this.getUser(e);if(b)return this._returnResult({data:null,error:b});((n=(r=w==null?void 0:w.factors)===null||r===void 0?void 0:r.filter(N=>N.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(v="aal2");const S=m.amr||[];return{data:{currentLevel:y,nextLevel:v,currentAuthenticationMethods:S},error:null}}catch(m){if(Te(m))return this._returnResult({data:null,error:m});throw m}const{data:{session:a},error:o}
688=await this.getSession();if(o)return this._returnResult({data:null,error:o});if(!a)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:c}=Gx(a.access_token);let u=null;c.aal&&(u=c.aal);let d=u;((s=(i=a.user.factors)===null||i===void 0?void 0:i.filter(m=>m.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(d="aal2");const p=c.amr||[];return{data:{currentLevel:u,nextLevel:d,currentAuthenticationMethods:p},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;return i?this._returnResult({data:null,error:i}):n?await Be(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new Ii})})}catch(r){if(Te(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:i},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!i)return this._returnResult({data:null,error:new Ii});const a=await Be(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:o=>({data:o,error:null})});return a.data&&a.data.redirect_url&&_n()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(n){if(Te(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:i},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!i)return this._returnResult({data:null,error:new Ii});const a=await Be(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:o=>({data:o,error:null})});return a.data&&a.data.redirect_url&&_n()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(n){if(Te(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;return n?this._returnResult({data:null,error:n}):r?await Be(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new Ii})})}catch(e){if(Te(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;return i?this._returnResult({data:null,error:i}):n?(await Be(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Ii})})}catch(r){if(Te(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(e,r={keys:[]}){let n=r.keys.find(o=>o.kid===e);if(n)return n;const i=Date.now();if(n=this.jwks.keys.find(o=>o.kid===e),n&&this.jwks_cached_at+ome>i)return n;const{data:s,error:a}=await Be(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,n=s.keys.find(o=>o.kid===e),!n)?null:n}async getClaims(e,r={}){try{let n=e;if(!n){const{data:m,error:y}
688=await this.getSession();if(y||!m.session)return this._returnResult({data:null,error:y});n=m.session.access_token}const{header:i,payload:s,signature:a,raw:{header:o,payload:c}}=Gx(n);r!=null&&r.allowExpired||Ome(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,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!u){const{error:m}=await this.getUser(n);if(m)throw m;return{data:{claims:s,header:i,signature:a},error:null}}const d=Tme(i.alg),f=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,f,a,gme(`${o}.${c}`)))throw new tO("Invalid JWT signature");return{data:{claims:s,header:i,signature:a},error:null}}catch(n){if(Te(n))return this._returnResult({data:null,error:n});throw n}}}iv.nextInstanceID={};const oge=iv,lge="2.103.3";let Dm="";typeof Deno<"u"?Dm="deno":typeof document<"u"?Dm="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Dm="react-native":Dm="node";const cge={"X-Client-Info":`supabase-js-${Dm}/${lge}`},uge={headers:cge},dge={schema:"public"},fge={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},hge={};function sv(t){"@babel/helpers - typeof";return sv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sv(t)}function pge(t,e){if(sv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(sv(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function mge(t){var e=pge(t,"string");return sv(e)=="symbol"?e:e+""}function gge(t,e,r){return(e=mge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function PD(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Sr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?PD(Object(r),!0).forEach(function(n){gge(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):PD(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}const vge=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),yge=()=>Headers,xge=(t,e,r)=>{const n=vge(r),i=yge();return async(s,a)=>{var o;const c=(o=await e())!==null&&o!==void 0?o:t;let u=new i(a==null?void 0:a.headers);return u.has("apikey")||u.set("apikey",t),u.has("Authorization")||u.set("Authorization",`Bearer ${c}`),n(s,Sr(Sr({},a),{},{headers:u}))}};function bge(t){return t.endsWith("/")?t:t+"/"}function wge(t,e){var r,n;const{db:i,auth:s,realtime:a,global:o}=t,{db:c,auth:u,realtime:d,global:f}=e,p={db:Sr(Sr({},c),i),auth:Sr(Sr({},u),s),realtime:Sr(Sr({},d),a),storage:{},global:Sr(Sr(Sr({},f),o),{},{headers:Sr(Sr({},(r=f==null?void 0:f.headers)!==null&&r!==void 0?r:{}),(n=o==null?void 0:o.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return t.accessToken?p.accessToken=t.accessToken:delete p.accessToken,p}function _ge(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(bge(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var kge=class extends oge{constructor(t){super(t)}},Sge=class{constructor(t,e,r){var n,i;this.supabaseUrl=t,this.supabaseKey=e;const s=_ge(t);if(!e)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:dge,realtime:hge,auth:Sr(Sr({},fge),{},{storageKey:a}),global:uge},c=wge(r??{},o);if(this.storageKey=(n=c.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(i=c.global.headers)!==null&&i!==void 0?i:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(d,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=c.auth)!==null&&u!==void 0?u:{},this.headers,c.global.fetch)}this.fetch=xge(e,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Sr({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(d=>this.realtime.setAuth(d)).catch(d=>console.warn("Failed to set initial Realtime auth token:",d)),this.rest=new Whe(new URL("rest/v1",s).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch,timeout:c.db.timeout,urlLengthLimit:c.db.urlLengthLimit}),this.storage=new rme(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new Ihe(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,e={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,r)}channel(t,e={config:{}}){return this.realtime.channel(t,e)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t=this,e,r;if(t.accessToken)return await t.accessToken();const{data:n}=await t.auth.getSession();return(e=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:i,storageKey:s,flowType:a,lock:o,debug:c,throwOnError:u},d,f){const p={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new kge({url:this.authUrl.href,headers:Sr(Sr({},p),d),storageKey:s,autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:i,flowType:a,lock:o,debug:c,throwOnError:u,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(m=>m.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new jpe(this.realtimeUrl.href,Sr(Sr({},t),{},{params:Sr(Sr({},{apikey:this.supabaseKey}),t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,e)=>{this._handleTokenChanged(t,"CLIENT",e==null?void 0:e.access_token)})}_handleTokenChanged(t,e,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const jge=(t,e,r)=>new Sge(t,e,r);function Nge(){if(typeof window<"u")return!1;const t=globalThis.process;if(!t)return!1;const e=t.version;if(e==null)return!1;const r=e.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}Nge()&&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 N
688ode.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");function Cge(){var w,b;if(typeof window>"u")return;const t=location.hostname,r=["lovableproject.com","lovableproject-dev.com","lovable.app","gpt-eng.com","gptengineer.run"].some(_=>t===_||t.endsWith("."+_)),n="[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",i=r?((w=t.match(new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+n+")(?:-dev)?(?=\\.|$)","i")))==null?void 0:w[1])??((b=t.match(new RegExp("^("+n+")(?=[.-])","i")))==null?void 0:b[1]):void 0,s=window.parent&&window.parent!==window;if(!i||!s)return localStorage;const a=t.endsWith(".lovableproject-dev.com")||t.endsWith(".gpt-eng.com"),o=a?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,c=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:""),u=c&&o.test(c)?[c]:a?["https://lovable.dev","http://localhost:3000"]:["https://lovable.dev"],d="lovable-preview-auth:result",f=2e3,p=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),m=(_,S,N)=>new Promise(j=>{const C=p();let O=!1,P;const T=R=>{O||(O=!0,clearTimeout(P),window.removeEventListener("message",$),j(R))},$=R=>{if(u.indexOf(R.origin)<0)return;const M=R.data;M&&M.type===d&&M.requestId===C&&T(M)};window.addEventListener("message",$);const B={type:_,requestId:C,projectId:i,key:S};N!==void 0&&(B.value=N);for(const R of u)window.parent.postMessage(B,R);P=setTimeout(()=>T(null),f)});let y=!0;const v=250;return{getItem:async _=>{let S=await m("lovable-preview-auth:get",_);return!S&&y&&(await new Promise(N=>setTimeout(N,v)),S=await m("lovable-preview-auth:get",_)),y=!1,S&&S.ok&&typeof S.value=="string"?S.value===""?(localStorage.removeItem(_),null):S.value:localStorage.getItem(_)},setItem:(_,S)=>(localStorage.setItem(_,S),m("lovable-preview-auth:set",_,S).then(N=>{N&&N.ok&&typeof N.value=="string"&&localStorage.getItem(_)===S&&(N.value===""?localStorage.removeItem(_):localStorage.setItem(_,N.value))})),removeItem:_=>(localStorage.removeItem(_),m("lovable-preview-auth:remove",_).then(()=>{}))}}const Ege="https://wykzqbbuyabvltminuvj.supabase.co",Oge="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Ind5a3pxYmJ1eWFidmx0bWludXZqIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzYwOTM4NzQsImV4cCI6MjA5MTY2OTg3NH0.zGoPN0q9zXf2degJhCILkJ3CcP9Fx5YRN3A_LZzgWFI",ie=jge(Ege,Oge,{auth:{storage:Cge(),persistSession:!0,autoRefreshToken:!0}}),_W=({images:t,alt:e})=>{const[r,n]=x.useState(0),i=t.length>1,s=c=>{c.preventDefault(),c.stopPropagation()},a=c=>{s(c),n(u=>u===0?t.length-1:u-1)},o=c=>{s(c),n(u=>u===t.length-1?0:u+1)};return t.length===0?l.jsx("div",{className:"w-full h-full bg-muted flex items-center justify-center text-muted-foreground text-sm",children:"Ingen bild"}):l.jsxs(l.Fragment,{children:[l.jsx("img",{src:t[r],alt:e,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"}),i&&l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:a,"aria-label":"Föregående bild",className:"absolute left-2 top-1/2 -translate-y-1/2 w-8 h-8 rounded-full bg-background/80 backdrop-blur-sm flex items-center justify-center shadow-sm opacity-0 group-hover:opacity-100 hover:bg-background transition-opacity z-10",children:l.jsx(O0,{className:"h-4 w-4 text-foreground"})}),l.jsx("button",{onClick:o,"aria-label":"Nästa bild",className:"absolute right-2 top-1/2 -translate-y-1/2 w-8 h-8 rounded-full bg-background/80 backdrop-blur-sm flex items-center justify-center shadow-sm opacity-0 group-hover:opacity-100 hover:bg-background transition-opacity z-10",children:l.jsx(kh,{className:"h-4 w-4 text-foreground"})}),l.jsx("div",{className:"absolute bottom-2 left-1/2 -translate-x-1/2 flex gap-1 z-10",children:t.map((c,u)=>l.jsx("span",{className:fe("h-1.5 rounded-full transition-all",u===r?"w-4 bg-background":"w-1.5 bg-background/60")},u))})]})]})},G_=["id","status","property_type","rooms","bedrooms","bathrooms","area_sqm","secondary_area_sqm","city","street_address","postal_code","floor","furnished","furnished_rent","unfurnished","unfurnished_rent","partially_furnished","partially_furnished_rent","move_in_date","move_out_date","immediate","possibly_longer","indefinite","included_in_rent","built_year","renovated_year","amenities","garden_sqm","description","images","created_at","updated_at","rented_until","assigned_agent","legacy_id","legacy_city_id"].join(","),Tge=()=>{const[t,e]=x.useState([]),[r,n]=x.useState(!0);return x.useEffect(()=>{(async()=>{const s=new Date().toISOString().split("T")[0];await ie.from("properties").update({status:"approved",rented_until:null}).eq("status","rented").not("rented_until","is",null).lte("rented_until",s);const{data:a}=await ie.from("properties").select(G_).eq("status","approved").order("display_order",{ascending:!0,nullsFirst:!1}).order("created_at",{ascending:!1}).limit(3);e(a||[]),n(!1)})()},[]),r?l.jsx("section",{id:"bostader",className:"py-14 sm:py-20 md:py-28",children:l.jsx("div",{className:"container mx-auto px-10 md:px-14 text-center",children:l.jsx("div",{className:"w-6 h-6 border-2 border-primary border-t-transparent roun
688ded-full animate-spin mx-auto"})})}):t.length===0?null:l.jsx("section",{id:"bostader",className:"py-14 sm:py-20 md:py-28",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14",children:[l.jsxs("div",{className:"text-center max-w-2xl mx-auto mb-10 sm:mb-16",children:[l.jsx("p",{className:"text-xs sm:text-sm font-semibold text-primary uppercase tracking-wider mb-2 sm:mb-3",children:"Utvalda bostäder"}),l.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold mb-3 sm:mb-4",children:"Lediga företagsbostäder"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-lg",children:"Ett urval av våra tillgängliga bostäder i Stockholm."})]}),l.jsx("div",{className:"flex gap-4 overflow-x-auto snap-x snap-mandatory pb-4 -mx-5 px-5 sm:mx-0 sm:px-0 sm:overflow-visible sm:grid sm:grid-cols-2 lg:grid-cols-3 sm:gap-8 sm:pb-0 scrollbar-hide",children:t.map(i=>{const s=i.street_address||`${i.property_type} · ${i.rooms} rum`,a=i.city||"Stockholm",o=i.images||[],c=i.furnished_rent||i.unfurnished_rent||i.partially_furnished_rent||0;return l.jsxs(Re,{to:`/bostad/${i.id}`,className:"bg-card rounded-xl overflow-hidden shadow-card hover:shadow-elevated transition-all duration-300 group min-w-[85vw] sm:min-w-0 snap-center block",children:[l.jsxs("div",{className:"relative overflow-hidden aspect-[4/3]",children:[l.jsx(_W,{images:o,alt:s}),l.jsx("div",{className:"absolute top-3 left-3 bg-primary text-primary-foreground text-xs font-semibold px-3 py-1 rounded-full z-10",children:a})]}),l.jsxs("div",{className:"p-4 sm:p-5 space-y-2.5 sm:space-y-3",children:[l.jsx("h3",{className:"font-semibold text-base sm:text-lg",children:s}),l.jsxs("div",{className:"flex flex-wrap items-center gap-3 sm:gap-4 text-xs sm:text-sm text-muted-foreground",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(Vn,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5 shrink-0"}),a]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(vp,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5 shrink-0"}),i.rooms," rum"]}),i.bedrooms!==null&&i.bedrooms!==void 0&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(vH,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5 shrink-0"}),i.bedrooms," sovrum"]}),i.area_sqm&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(A0,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5 shrink-0"}),i.area_sqm," m²"]})]}),c>0&&l.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border",children:[l.jsxs("span",{className:"text-lg sm:text-xl font-bold text-primary",children:[c.toLocaleString("sv-SE")," kr/mån"]}),l.jsx("span",{className:"text-primary text-sm font-medium",children:"Visa mer →"})]})]})]},i.id)})}),l.jsx("div",{className:"text-center mt-8 sm:mt-12",children:l.jsx(se,{variant:"hero-outline",size:"lg",className:"w-full sm:w-auto",asChild:!0,children:l.jsx(Re,{to:"/bostader",children:"Se alla bostäder"})})})]})})},Age=1,Pge="c2da6913-e175-473f-b5e9-41396038a5a2",Mge="1c3f83e6-5979-4b24-8cc5-71a1e8a1c97a",Rge="/__l5e/assets-v1/c2da6913-e175-473f-b5e9-41396038a5a2/fmi-logo.png",Ige="a/v1/1c3f83e6-5979-4b24-8cc5-71a1e8a1c97a/c2da6913-e175-473f-b5e9-41396038a5a2/fmi-logo.png",Lge="fmi-logo.png",$ge=717497,Dge="image/png",Bge="2026-07-17T11:54:02Z",Fge={version:Age,asset_id:Pge,project_id:Mge,url:Rge,r2_key:Ige,original_filename:Lge,size:$ge,content_type:Dge,created_at:Bge},x2=({className:t,text:e=`Våra mäklare är registrerade
689hyresförmedlare hos FMI`})=>{const r=e.split(`
690`);return l.jsxs("a",{href:"https://fmi.se/",target:"_blank",rel:"noopener noreferrer",className:`inline-flex items-center gap-3 px-4 py-3 rounded-xl bg-background border border-border shadow-sm hover:shadow-md hover:border-primary/30 transition-all ${t}`,children:[l.jsx("img",{src:Fge.url,alt:"Fastighetsmäklarinspektionen",className:"h-10 w-auto object-contain"}),l.jsx("p",{className:"text-sm text-muted-foreground leading-tight",children:r.map((n,i)=>l.jsxs("span",{children:[n,i<r.length-1&&l.jsx("br",{})]},i))})]})},zge=[{title:"Tjänster",links:[{label:"Bostadssök",to:"/bostader"},{label:"Hyra ut bostad",to:"/hyra-ut"},{label:"Företagsservice",to:"/foretagsservice"},{label:"Logga in",to:"/logga-in"},{label:"Registrera konto",to:"/registrera"}]},{title:"Mina sidor",links:[{label:"Mina objekt",to:"/mina-sidor"},{label:"Lägg in nytt objekt",to:"/mina-sidor/nytt-objekt"},{label:"Min profil",to:"/mina-sidor/profil"},{label:"Glömt lösenord",to:"/glomt-losenord"}]},{title:"Om oss",links:[{label:"Om Företagslogi",to:"/om-oss"},{label:"Kontakt",to:"/kontakt"},{label:"Bostäder i Stockholm",to:"/bostader"}]},{title:"Integritet",links:[{label:"Användarvillkor",to:"/anvandarvillkor"},{label:"Integritetspolicy",to:"/integritetspolicy"},{label:"Om GDPR",to:"/om-gdpr"},{label:"Cookies",to:"/cookies"}]}],Mr=()=>l.jsx("footer",{className:"bg-foreground text-primary-foreground
690/70 pt-12 pb-8",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14",children:[l.jsxs("div",{className:"flex flex-col md:flex-row md:items-end md:justify-between gap-6 pb-10 border-b border-primary-foreground/10",children:[l.jsxs("div",{children:[l.jsx("img",{src:XP,alt:"Företagslogi",className:"h-32 sm:h-40 w-auto -ml-4 -mb-2 brightness-0 invert"}),l.jsx("p",{className:"text-sm leading-relaxed max-w-md",children:"Företagsbostäder i Stockholm – snabbt, enkelt och tryggt."})]}),l.jsxs("div",{className:"flex flex-col items-start md:items-end gap-4",children:[l.jsxs("div",{className:"text-sm space-y-1 md:text-right",children:[l.jsx("a",{href:"mailto:[email protected]",className:"block hover:text-primary-foreground transition-colors",children:"[email protected]"}),l.jsx("a",{href:"tel:+4686445820",className:"block hover:text-primary-foreground transition-colors",children:"08 – 644 58 20"}),l.jsx("p",{children:"Stockholm, Sverige"})]}),l.jsx(x2,{})]})]}),l.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-8 py-10",children:zge.map(t=>l.jsxs("div",{children:[l.jsx("h4",{className:"font-semibold text-primary-foreground mb-4 text-base",children:t.title}),l.jsx("ul",{className:"space-y-3 text-sm",children:t.links.map(e=>l.jsx("li",{children:l.jsx(Re,{to:e.to,className:"hover:text-primary-foreground transition-colors",children:e.label})},e.to+e.label))})]},t.title))}),l.jsxs("div",{className:"border-t border-primary-foreground/10 pt-6 text-center text-xs space-y-1",children:[l.jsx("p",{children:"Bostad för dig i Stockholm AB · Sveavägen 61, 113 59 Stockholm · Org-nummer: 556555-8078"}),l.jsxs("p",{children:["© ",new Date().getFullYear()," Företagslogi. Alla rättigheter förbehÃ¥llna."]})]})]})}),kW=({property:t})=>{const e=`${t.property_type} · ${t.rooms} rum`,r=t.city||"OmrÃ¥de saknas",n=t.images||[],i=t.furnished_rent||t.unfurnished_rent||t.partially_furnished_rent||0;return l.jsxs(Re,{to:`/bostad/${t.id}`,className:"bg-card rounded-xl overflow-hidden shadow-card hover:shadow-elevated transition-all duration-300 group block",children:[l.jsxs("div",{className:"relative overflow-hidden aspect-[4/3]",children:[l.jsx(_W,{images:n,alt:e}),l.jsx("div",{className:"absolute top-3 left-3 bg-primary text-primary-foreground text-xs font-semibold px-3 py-1 rounded-full z-10",children:r})]}),l.jsxs("div",{className:"p-4 sm:p-5 space-y-2.5",children:[l.jsx("h3",{className:"font-semibold text-base sm:text-lg",children:t.street_address||e}),l.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 sm:gap-x-4 text-xs sm:text-sm text-muted-foreground",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(Vn,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5 shrink-0"}),r]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(vp,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5 shrink-0"}),t.rooms," rum"]}),t.bedrooms!==null&&t.bedrooms!==void 0&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(vH,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5 shrink-0"}),t.bedrooms," sovrum"]}),t.area_sqm&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(A0,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5 shrink-0"}),t.area_sqm," m²"]})]}),i>0&&l.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border",children:[l.jsxs("span",{className:"text-lg sm:text-xl font-bold text-primary",children:[i.toLocaleString("sv-SE")," kr/mÃ¥n"]}),l.jsx("span",{className:"text-primary text-sm font-medium",children:"Visa mer →"})]})]})]})},SW=x.forwardRef(({...t},e)=>l.jsx("nav",{ref:e,"aria-label":"breadcrumb",...t}));SW.displayName="Breadcrumb";const jW=x.forwardRef(({className:t,...e},r)=>l.jsx("ol",{ref:r,className:fe("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",t),...e}));jW.displayName="BreadcrumbList";const rO=x.forwardRef(({className:t,...e},r)=>l.jsx("li",{ref:r,className:fe("inline-flex items-center gap-1.5",t),...e}));rO.displayName="BreadcrumbItem";const nO=x.forwardRef(({asChild:t,className:e,...r},n)=>{const i=t?gd:"a";return l.jsx(i,{ref:n,className:fe("transition-colors hover:text-foreground",e),...r})});nO.displayName="BreadcrumbLink";const NW=x.forwardRef(({className:t,...e},r)=>l.jsx("span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:fe("font-normal text-foreground",t),...e}));NW.displayName="BreadcrumbPage";const CW=({children:t,className:e,...r})=>l.jsx("li",{role:"presentation","aria-hidden":"true",className:fe("[&>svg]:size-3.5",e),...r,children:t??l.jsx(kh,{})});CW.displayName="BreadcrumbSeparator";const Uge={bostader:"Företagslägenheter",bostad:"Företagslägenheter","om-oss":"Om oss",kontakt:"Kontakt",foretagsservice:"Företagsservice","hyra-ut":"Hyra ut",guider:"Guider",medarbetare:"Medarbetare","annelie-permerin":"Annelie Permerin","ulrika-nystrom":"Ulrika Nyström",registrera:"Registrera","logga-in":"Logga in","glomt-losenord":"Glömt lösenord","aterstall-losenord":"Återställ lösenord",anvandarvillkor:"Användarvillkor",integritetspolicy:"Integritetspolicy","om-gdpr":"Om GDPR",cookies:"Cookies","mina-sidor":"Mina sidor","nytt-objekt":"Nytt objekt",profil:"Profil"},Hge=t=>decodeURIComponent(t).replace(/-/g," ").replace(/^\w/,e=>e.toUpperCase()),Vr=({currentLabel:t,className:e})=>{const{pathname:r}
690=Oi(),n=r.split("/").filter(Boolean);if(n.length===0)return null;const i=n.map((o,c)=>{const u="/"+n.slice(0,c+1).join("/"),d=c===n.length-1;return{label:d&&t?t:Uge[o]??Hge(o),to:o==="bostad"&&!d?"/bostader":u,isLast:d}}),s=typeof window<"u"?window.location.origin:"https://foretagslogi.se",a={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Hem",item:s+"/"},...i.map((o,c)=>({"@type":"ListItem",position:c+2,name:o.label,item:s+o.to}))]};return l.jsxs("nav",{className:e??"bg-header text-header-foreground pt-20 md:pt-24 pb-4 md:pb-5",children:[l.jsx(kP,{children:l.jsx("script",{type:"application/ld+json",children:JSON.stringify(a)})}),l.jsx("div",{className:"container mx-auto px-4 md:px-6",children:l.jsx(SW,{children:l.jsxs(jW,{className:"text-header-foreground/80",children:[l.jsx(rO,{children:l.jsx(nO,{asChild:!0,className:"text-header-foreground/80 hover:text-header-foreground",children:l.jsx(Re,{to:"/",children:"Hem"})})}),i.map(o=>l.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2.5",children:[l.jsx(CW,{className:"text-header-foreground
690/50"}),l.jsx(rO,{children:o.isLast?l.jsx(NW,{className:"line-clamp-1 text-header-foreground",children:o.label}):l.jsx(nO,{asChild:!0,className:"text-header-foreground/80 hover:text-header-foreground",children:l.jsx(Re,{to:o.to,children:o.label})})})]},o.to))]})})})]})},Vb={stockholm:{slug:"stockholm",name:"Stockholm",radiusKm:40,h1:"Företagslägenheter i Stockholm",title:"Företagslägenheter i Stockholm | Företagslogi",metaDescription:"Lediga företagslägenheter i Stockholm för uthyrning till företag. Möblerat eller omöblerat, från 1 månad och uppåt. B2B-avtal och faktura.",intro:"Stockholm är Sveriges största bostadsmarknad och vår hemmaplan sedan 1999. Här förmedlar vi företagslägenheter i innerstaden, kranskommunerna och närförorterna – från kompakta ettor för konsulter till familjevänliga villor för längre uppdrag.",longIntro:"Efterfrågan på företagsbostäder i Stockholm är hög året runt, och vi har ett brett nätverk av privata uthyrare, bostadsrättsföreningar och fastighetsägare i hela regionen. Populära områden bland våra företagskunder är Östermalm, Vasastan, Södermalm, Kungsholmen, Bromma, Solna, Sundbyberg, Danderyd och Nacka. Alla objekt förmedlas via B2B-avtal med organisationsnummer och faktura till företag."},goteborg:{slug:"goteborg",name:"Göteborg",radiusKm:30,h1:"Företagslägenheter i Göteborg",title:"Företagslägenheter i Göteborg | Företagslogi",metaDescription:"Lediga företagslägenheter i Göteborg för företag, konsulter och projektpersonal. Möblerat eller omöblerat, kort eller lång tid. B2B-avtal.",intro:"Göteborg är en av Sveriges mest expansiva regioner med stor efterfrågan på tillfälligt boende för konsulter, projektpersonal och nyanställda. Vi förmedlar företagslägenheter både centralt och i kranskommunerna Mölndal, Partille och Kungsbacka.",longIntro:"Fordonsindustrin, hamnen och tech-sektorn drar hela tiden nya medarbetare till Göteborg – ofta för uppdrag på 3–24 månader. Våra företagslägenheter fungerar som ett flexibelt och betydligt mer prisvärt alternativ till hotell och serviced apartments. Populära områden är Vasastan, Linnéstaden, Majorna, Örgryte, Johanneberg och Hisingen."},malmo:{slug:"malmo",name:"Malmö",radiusKm:25,h1:"Företagslägenheter i Malmö",title:"Företagslägenheter i Malmö | Företagslogi",metaDescription:"Företagslägenheter i Malmö och Öresundsregionen för uthyrning till företag. Möblerade bostäder i centrum, Västra Hamnen och Lund – från 1 månad.",intro:"Malmö och Öresundsregionen är en attraktiv marknad för företag med verksamhet i södra Sverige och Danmark. Vi förmedlar företagslägenheter i Malmö centrum, Västra Hamnen och angränsande orter som Lund och Lomma.",longIntro:"Många av våra kunder i Malmö är life science-företag, konsultbolag och byggföretag som behöver boende för medarbetare på pendlingsavstånd till Köpenhamn. Vi hjälper er hitta rätt bostad oavsett om det gäller en enskild konsult eller ett helt projektteam."},uppsala:{slug:"uppsala",name:"Uppsala",radiusKm:20,h1:"Företagslägenheter i Uppsala",title:"Företagslägenheter i Uppsala | Företagslogi",metaDescription:"Lediga företagslägenheter i Uppsala för företag, forskare och konsulter. Möblerade bostäder centralt och nära universitetet. B2B-avtal.",intro:"Uppsala är hem åt Sveriges största universitet och en växande life science-sektor. Vi förmedlar företagslägenheter för gästforskare, konsulter och personal – både centralt och nära Uppsala Science Park.",longIntro:"Efterfrågan på tillfälligt boende i Uppsala är hög under hela läsåret, särskilt i områden som Kungsängen, Luthagen, Fålhagen och Sunnersta. Med pendeltåg 35 minuter från Stockholm är Uppsala också ett populärt alternativ för Stockholmsbaserade företag som behöver extra kapacitet."},gavle:{slug:"gavle",name:"Gävle",radiusKm:20,h1:"Företagslägenheter i Gävle",title:"Företagslägenheter i Gävle | Företagslogi",metaDescription:"Företagslägenheter i Gävle för uthyrning till företag. Möblerade och omöblerade bostäder centralt och i närområdet. B2B-avtal och faktura.",intro:"Gävle är ett viktigt logistik- och industrinav i Gästrikland med god pendlingsförbindelse till Stockholm och Uppsala. Vi förmedlar företagslägenheter till företag med uppdrag i regionen – från kortare projekt till fleråriga stationeringar.",longIntro:"Många av våra företagskunder i Gävle är verksamma inom bygg, tillverkning, energi och logistik. Vi har objekt både i Gävle centrum, Brynäs, Sätra och kringliggande orter, och kan hjälpa er hitta rätt även om behovet dyker upp med kort varsel."}},Vge=()=>{const{citySlug:t}=gy(),e=t?Vb[t.toLowerCase()]:void 0,[r,n]=x.useState([]),[i,s]=x.useState(!0),a=e?`https://foretagslogi.se/bostader/${e.slug}`:void 0;x.useEffect(()=>{if(!e)return;(async()=>{s(!0);const u=new Date().toISOString().split("T")[0];await ie.from("properties").update({status:"approved",rented_until:null}).eq("status","rented").not("rented_until","is",null).lte("rented_until",u);const{data:d}=await ie.from("properties").select(G_).eq("status","approved").order("display_order",{ascending:!0,nullsFirst:!1}).order("created_at",{ascending:!1});n(d||[]),s(!1)})()},[e]);const o=x.useMemo(()=>e?r.filter(c=>c.city?c.city.toLowerCase()===e.name.toLowerCase()?!0:m2(e.name,c.city,e.radiusKm):!1):[],[r,e]);return e?l.jsxs("div",{className:"min-h-screen bg-background",children:[l.jsxs(kP,{children:[l.jsx("title",{children:e.title}),l.jsx("meta",{name:"description",content:e.metaDescription}),l.jsx("link",{rel:"canonical",href:a}),l.jsx("meta",{property:"og:title",content:e.title}),l.jsx("meta",{property:"og:description",content:e.metaDescription}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{property:"og:url",content:a}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:e.title}),l.jsx("meta",{name:"twitter:description",content:e.metaDescription})]}),l.jsx(Pr,{}),l.jsx(Vr,{currentLabel:e.name}),l.jsxs("main",{className:"pb-12",children:[l.jsx("section",{className:"bg-header text-header-foreground pt-4 md:pt-6 border-b border-header-border",children:l.jsxs("div",{className:"container mx-auto px-4 md:px-6 pb-8 sm:pb-12",children:[l.jsx("h1",{className:"text-2xl sm:text-3xl md:text-4xl font-bold text-foreground mb-4",children:e.h1}),l.jsx("p",{className:"text-sm sm:text-base text-muted-foreground max-w-3xl mb-4 leading-relaxed",children:e.intro}),l.jsx("p",{className:"text-sm sm:text-base text-muted-foreground max-w-3xl mb-5 leading-relaxed",children:e.longIntro}),l.jsxs("div",{className:"flex flex-wrap gap-x-5 gap-y-2 text-xs sm:text-sm text-muted-foreground",children:[l.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[l.jsx(x_,{className:"h-4 w-4 text-primary"})," B2B-avtal med organisationsnummer"]}),l.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[l.jsx(vc,{className:"h-4 w-4 text-primary"})," Faktura till företag"]}),l.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[l.jsx(xH,{className:"h-4 w-4 text-primary"})," Personal, konsulter & projekt"]})]})]})}),l.jsxs("div",{className:"container mx-auto px-4 md:px-6 pt-8",children:[l.jsxs("div",{className:"mb-6 flex flex-wrap items-end justify-between gap-3",children:[l.jsxs("div",{children:[l.jsxs("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-1",children:["Lediga företagslägenheter i ",e.name]}),l.jsxs("p",{className:"text-muted-foreground text-sm",children:[o.length," objekt tillgängliga för företagsuthyrning"]})]}),l.jsx(se,{variant:"outline",size:"sm",asChild:!0,children:l.jsx(Re,{to:"/bostader",children:"Se alla städer"})})]}),l.jsxs("div",{className:"flex gap-8",children:[l.jsx("aside",{className:"hidden lg:block w-72 shrink-0",children:l.jsxs("div",{className:"sticky top-24 space-y-6",children:[l.jsxs("div",{className:"rounded-xl border border-border bg-surface p-5",children:[l.jsx("h3",{className:"text-sm font-semibold text-foreground mb-3.5",children:"Företagslägenheter i Sverige"}),l.jsx("ul",{className:"space-y-1.5",children:Object.values(Vb).map(c=>l.jsx("li",{children:l.jsxs(Re,{to:`/bostader/${c.slug}`,className:`flex items-center justify-between rounded-lg px-3 py-2 text-sm transition-colors ${c.slug===e.slug?"bg-primary/10 text-primary font-medium":"text-foreground hover:bg-primary/5 hover:text-primary"}`,"aria-current":c.slug===e.slug?"page":void 0,children:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx(Vn,{className:"h-3.5 w-3.5"}),c.name]}),c.slug===e.slug&&l.jsx("span",{className:"text-xs",children:"du är här"})]})},c.slug))})]}),l.jsxs("div",{className:"rounded-xl border border-border bg-surface p-5",children:[l.jsx("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Hittar ni inte rätt bostad?"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Vi matchar era behov mot hela vårt nätverk – även objekt som inte publicerats än."}),l.jsx(se,{variant:"hero",size:"sm",className:"w-full",asChild:!0,children:l.jsx(Re,{to:"/foretagsservice#forfragan",children:"Få förslag"})})]})]})}),l.jsx("div",{className:"flex-1 min-w-0",children:i?l.jsx("div",{className:"flex justify-center py-16",children:l.jsx(js,{className:"h-6 w-6 animate-spin text-primary"})}):o.length>0?l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-5",children:o.map(c=>l.jsx(kW,{property:c},c.id))}):l.jsxs("div",{className:"text-center py-16 border border-dashed border-border rounded-xl",children:[l.jsxs("p",{className:"text-lg font-medium text-foreground mb-2",children:["Inga lediga företagslägenheter i ",e.name," just nu"]}
690),l.jsx("p",{className:"text-muted-foreground mb-4 max-w-md mx-auto",children:"Vi har ofta bostäder som ännu inte publicerats. Skicka en förfrågan så hör vi av oss med matchande objekt."}),l.jsx(se,{variant:"hero",asChild:!0,children:l.jsx(Re,{to:"/foretagsservice#forfragan",children:"Skicka förfrågan"})})]})})]}),l.jsxs("div",{className:"mt-14 border-t border-border pt-8",children:[l.jsx("h3",{className:"text-lg font-semibold text-foreground mb-4",children:"Företagslägenheter i andra städer"}),l.jsx("div",{className:"flex flex-wrap gap-2",children:Object.values(Vb).filter(c=>c.slug!==e.slug).map(c=>l.jsxs(Re,{to:`/bostader/${c.slug}`,className:"inline-flex items-center gap-1.5 rounded-full border border-border bg-surface px-3.5 py-1.5 text-sm text-foreground hover:border-primary hover:text-primary transition-colors",children:[l.jsx(Vn,{className:"h-3.5 w-3.5"}),c.name]},c.slug))})]})]})]}),l.jsx(Mr,{})]}):l.jsx(Jie,{to:"/bostader",replace:!0})},Wge=()=>{const t=Object.values(Vb);return l.jsx("section",{className:"py-14 sm:py-20 md:py-28 bg-surface",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14",children:[l.jsxs("div",{className:"max-w-2xl mb-10 sm:mb-14",children:[l.jsx("p",{className:"text-xs sm:text-sm font-semibold text-primary uppercase tracking-wider mb-2 sm:mb-3",children:"Populära städer"}),l.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold mb-3 sm:mb-4",children:"Företagslägenheter i Sverige"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base",children:"Se lediga företagsbostäder i de städer där vi är mest aktiva."})]}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 gap-4 sm:gap-5",children:t.map(e=>l.jsxs(Re,{to:`/bostader/${e.slug}`,className:"group flex items-center justify-between rounded-xl bg-card border border-border p-5 shadow-card hover:shadow-elevated hover:border-primary/40 transition-all duration-300",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"w-10 h-10 rounded-lg bg-accent flex items-center justify-center shrink-0",children:l.jsx(Vn,{className:"h-5 w-5 text-accent-foreground"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-semibold text-foreground",children:e.name}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Företagslägenheter"})]})]}),l.jsx(_h,{className:"h-4 w-4 text-muted-foreground group-hover:text-primary transition-colors"})]},e.slug))})]})})},MD=[{icon:TH,num:"01",title:"Skicka er förfrågan",desc:"Berätta om era behov – antal bostäder, period, område och budget."},{icon:ma,num:"02",title:"Vi matchar er med rätt bostäder",desc:"Vårt team presenterar handplockade alternativ som passar era krav."},{icon:Ss,num:"03",title:"Inflytt utan krångel",desc:"Vi sköter allt praktiskt så ni kan flytta in snabbt och smidigt."}],qge=()=>l.jsx("section",{id:"hur-det-fungerar",className:"py-14 sm:py-20 md:py-28 bg-surface",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14",children:[l.jsxs("div",{className:"text-center max-w-2xl mx-auto mb-10 sm:mb-16",children:[l.jsx("p",{className:"text-xs sm:text-sm font-semibold text-primary uppercase tracking-wider mb-2 sm:mb-3",children:"Så fungerar det"}),l.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold mb-3 sm:mb-4",children:"Tre enkla steg till er företagsbostad"})]}),l.jsx("div",{className:"flex flex-col sm:grid sm:grid-cols-3 gap-6 sm:gap-8 max-w-4xl mx-auto",children:MD.map(({icon:t,num:e,title:r,desc:n},i)=>l.jsxs("div",{className:"flex sm:flex-col items-start sm:items-center sm:text-center gap-4 sm:gap-0 relative",children:[i<MD.length-1&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"sm:hidden absolute left-[28px] top-[60px] w-0.5 h-[calc(100%+8px)] bg-primary/20"}),l.jsx("div",{className:"hidden sm:block absolute top-12 left-[60%] w-[80%] border-t-2 border-dashed border-primary/20"})]}),l.jsxs("div",{className:"w-14 h-14 sm:w-24 sm:h-24 rounded-xl sm:rounded-2xl bg-accent flex items-center justify-center shrink-0 sm:mx-auto sm:mb-6 relative",children:[l.jsx(t,{className:"h-6 w-6 sm:h-10 sm:w-10 text-accent-foreground"}),l.jsx("span",{className:"absolute -top-1.5 -right-1.5 sm:-top-2 sm:-right-2 w-6 h-6 sm:w-8 sm:h-8 rounded-full bg-primary text-primary-foreground text-xs sm:text-sm font-bold flex items-center justify-center",children:e})]}),l.jsxs("div",{className:"pt-1 sm:pt-0",children:[l.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-1 sm:mb-2",children:r}),l.jsx("p",{className:"text-muted-foreground text-sm max-w-xs",children:n})]})]},e))})]})}),Kge=()=>l.jsx("section",{className:"py-14 sm:py-20 md:py-28 bg-surface",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14",children:[l.jsxs("div",{className:"text-center max-w-2xl mx-auto mb-10 sm:mb-14",children:[l.jsx("p",{className:"text-xs sm:text-sm font-semibold text-primary uppercase tracking-wider mb-2 sm:mb-3",children:"Vilken väg passar er?"}),l.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold mb-3 sm:mb-4",children:"Hyra eller hyra ut? Vi hjälper er"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base",children:"Oavsett om ni söker bostad till era anställda eller har en bostad att hyra ut till företag – vi guidar er hela vägen."})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-5 sm:gap-6",children:[l.jsxs("div",{className:"bg-card rounded-2xl p-6 sm:p-8 md:p-10 shadow-card border border-border flex flex-col",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[l.jsx("div",{className:"w-11 h-11 rounded-xl bg-accent flex items-center justify-center",children:l.jsx(MP,{className:"h-5 w-5 text-accent-foreground"})}),l.jsx("p",{className:"text-xs sm:text-sm font-semibold text-primary uppercase tracking-wider",children:"För uthyrare"})]}),l.jsx("h3",{className:"text-xl sm:text-2xl font-bold mb-3",children:"Har du en bostad att hyra ut?"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base mb-6 leading-relaxed",children:"Registrera dig kostnadsfritt och nå hundratals företagskunder. Vi sköter matchning, visning och kontrakt."}),l.jsx("ul",{className:"space-y-2.5 mb-7 sm:mb-8",children:["Trygga företagsavtal","98% uthyrningsgrad","Ingen kostnad förrän vi förmedlat"].map(t=>l.jsxs("li",{className:"flex items-start gap-2.5",children:[l.jsx(Sh,{className:"h-4 w-4 text-primary mt-0.5 shrink-0"}),l.jsx("span",{className:"text-sm text-foreground",children:t})]},t))}),l.jsxs("div",{className:"mt-auto flex flex-col sm:flex-row gap-3",children:[l.jsx(se,{variant:"hero",size:"lg",className:"w-full sm:w-auto",asChild:!0,children:l.jsxs(Re,{to:"/registrera",children:["Registrera dig",l.jsx(_h,{className:"h-4 w-4 ml-1"})]})}),l.jsx(se,{variant:"hero-outline",size:"lg",className:"w-full sm:w-auto",asChild:!0,children:l.jsx(Re,{to:"/hyra-ut",children:"Läs mer om uthyrning"})})]})]}),l.jsxs("div",{className:"bg-card rounded-2xl p-6 sm:p-8 md:p-10 shadow-card border border-border flex flex-col",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[l.jsx("div",{className:"w-11 h-11 rounded-xl bg-accent flex items-center justify-center",children:l.jsx(vc,{className:"h-5 w-5 text-accent-foreground"})}),l.jsx("p",{className:"text-xs sm:text-sm font-semibold text-primary uppercase tracking-wider",children:"Företagsservice"})]}),l.jsx("h3",{className:"text-xl sm:text-2xl font-bold mb-3",children:"Söker ert företag boende?"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base mb-6 leading-relaxed",children:"Vi hittar rätt bostäder till era anställda – möblerat eller omöblerat, kort eller lång period, i hela Stockholm."}),l.jsx("ul",{className:"space-y-2.5 mb-7 sm:mb-8",children:["Handplockade objekt utifrån era behov","Hjälp med kontrakt och inflytt","Svar inom 24 timmar"].map(t=>l.jsxs("li",{className:"flex items-start gap-2.5",children:[l.jsx(Sh,{className:"h-4 w-4 text-primary mt-0.5 shrink-0"}),l.jsx("span",{className:"text-sm text-foreground",children:t})]},t))}),l.jsxs("div",{className:"mt-auto flex flex-col sm:flex-row gap-3",children:[l.jsx(se,{variant:"hero",size:"lg",className:"w-full sm:w-auto",asChild:!0,children:l.jsxs(Re,{to:"/foretagsservice#forfragan",children:["Skicka förfrågan",l.jsx(_h,{className:"h-4 w-4 ml-1"})]})}),l.jsx(se,{variant:"hero-outline",size:"lg",className:"w-full sm:w-auto",asChild:!0,children:l.jsx(Re,{to:"/foretagsservice",children:"Läs mer om företagsservice"})})]})]})]})]})}),Gge=()=>l.jsx("section",{className:"py-14 sm:py-20 md:py-28 bg-background",children:l.jsx("div",{className:"container mx-auto px-10 md:px-14",children:l.jsxs("div",{className:"max-w-3xl mx-auto lg:mx-0 space-y-5",children:[l.jsx("p",{className:"text-xs sm:text-sm font-semibold text-primary uppercase tracking-wider",children:"Möt oss"}),l.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold leading-tight",children:"Riktiga människor bakom varje uthyrning"}),l.jsxs("div",{className:"space-y-4 text-muted-foreground text-sm sm:text-base leading-relaxed",children:[l.jsxs("p",{children:["Företagslogi är ett personligt bolag med nära kundkontakt – vi tror på riktiga relationer, inte automatiserade svar. Med över ",l.jsx("strong",{className:"text-foreground",children:"5 000 förmedlingar"})," bakom oss har vi hjälpt företag och uthyrare med företagslägenheter i Stockholm och resten av Sverige sedan 1999."]}),l.jsx("p",{children:"Vårt team skräddarsyr lösningar för både företag som söker boende åt sina medarbetare och privatpersoner som vill hyra ut sin lägenhet tryggt. Vi finns med hela vägen – från första kontakt till inflytt."})]}),l.jsx("div",{className:"flex flex-wrap gap-3 pt-2",children:l.jsx(se,{variant:"hero",asChild:!0,children:l.jsxs(Re,{to:"/om-oss",children:["Mer om oss ",l.jsx(_h,{className:"ml-1 h-4 w-4"})]})})})]})})}),Zge=()=>l.jsxs("div",{className:"min-h-screen",children:[l.jsx(Pr,{}),l.jsx(_he,{}),l.jsx(rW,{}),l.jsx(Tge,{}),l.jsx(Wge,{}),l.jsx(qge,{}),l.jsx(Kge,{}),l.jsx(Gge,{}),l.jsx(Mr,{})]}),Jge=({images:t})=>
690{const[e,r]=x.useState(0),n=()=>r(s=>s===0?t.length-1:s-1),i=()=>r(s=>s===t.length-1?0:s+1);return l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"relative aspect-[4/3] rounded-xl overflow-hidden bg-muted",children:[l.jsx("img",{src:t[e],alt:`Bild ${e+1}`,className:"w-full h-full object-cover"}),l.jsx("button",{onClick:n,className:"absolute left-2 top-1/2 -translate-y-1/2 w-9 h-9 rounded-full bg-background/80 backdrop-blur-sm flex items-center justify-center shadow-sm hover:bg-background transition-colors","aria-label":"Föregående bild",children:l.jsx(O0,{className:"h-4 w-4 text-foreground"})}),l.jsx("button",{onClick:i,className:"absolute right-2 top-1/2 -translate-y-1/2 w-9 h-9 rounded-full bg-background/80 backdrop-blur-sm flex items-center justify-center shadow-sm hover:bg-background transition-colors","aria-label":"Nästa bild",children:l.jsx(kh,{className:"h-4 w-4 text-foreground"})}),l.jsxs("div",{className:"absolute bottom-2 right-2 bg-foreground/70 text-primary-foreground text-xs font-medium px-2.5 py-1 rounded-full backdrop-blur-sm flex items-center gap-1.5",children:[l.jsx(coe,{className:"h-3 w-3"}),e+1," / ",t.length]})]}),l.jsx("div",{className:"flex gap-1.5 overflow-x-auto scrollbar-hide",children:t.map((s,a)=>l.jsx("button",{onClick:()=>r(a),className:fe("shrink-0 w-16 h-12 rounded-lg overflow-hidden border-2 transition-all",a===e?"border-primary ring-1 ring-primary/30":"border-transparent opacity-50 hover:opacity-100"),children:l.jsx("img",{src:s,alt:`Miniatyr ${a+1}`,className:"w-full h-full object-cover"})},a))})]})},Yge=gp("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 Vt({className:t,variant:e,...r}){return l.jsx("div",{className:fe(Yge({variant:e}),t),...r})}var Yj="rovingFocusGroup.onEntryFocus",Xge={bubbles:!1,cancelable:!0},Oy="RovingFocusGroup",[iO,EW,Qge]=vy(Oy),[eve,Z_]=Kn(Oy,[Qge]),[tve,rve]=eve(Oy),OW=x.forwardRef((t,e)=>l.jsx(iO.Provider,{scope:t.__scopeRovingFocusGroup,children:l.jsx(iO.Slot,{scope:t.__scopeRovingFocusGroup,children:l.jsx(nve,{...t,ref:e})})}));OW.displayName=Oy;var nve=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=t,p=x.useRef(null),m=it(e,p),y=wy(s),[v,w]=Yi({prop:a,defaultProp:o??null,onChange:c,caller:Oy}),[b,_]=x.useState(!1),S=Ci(u),N=EW(r),j=x.useRef(!1),[C,O]=x.useState(0);return x.useEffect(()=>{const P=p.current;if(P)return P.addEventListener(Yj,S),()=>P.removeEventListener(Yj,S)},[S]),l.jsx(tve,{scope:r,orientation:n,dir:y,loop:i,currentTabStopId:v,onItemFocus:x.useCallback(P=>w(P),[w]),onItemShiftTab:x.useCallback(()=>_(!0),[]),onFocusableItemAdd:x.useCallback(()=>O(P=>P+1),[]),onFocusableItemRemove:x.useCallback(()=>O(P=>P-1),[]),children:l.jsx(Oe.div,{tabIndex:b||C===0?-1:0,"data-orientation":n,...f,ref:m,style:{outline:"none",...t.style},onMouseDown:we(t.onMouseDown,()=>{j.current=!0}),onFocus:we(t.onFocus,P=>{const T=!j.current;if(P.target===P.currentTarget&&T&&!b){const $=new CustomEvent(Yj,Xge);if(P.currentTarget.dispatchEvent($),!$.defaultPrevented){const B=N().filter(V=>V.focusable),R=B.find(V=>V.active),M=B.find(V=>V.id===v),q=[R,M,...B].filter(Boolean).map(V=>V.ref.current);PW(q,d)}}j.current=!1}),onBlur:we(t.onBlur,()=>_(!1))})})}),TW="RovingFocusGroupItem",AW=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,children:a,...o}=t,c=tn(),u=s||c,d=rve(TW,r),f=d.currentTabStopId===u,p=EW(r),{onFocusableItemAdd:m,onFocusableItemRemove:y,currentTabStopId:v}=d;return x.useEffect(()=>{if(n)return m(),()=>y()}
vendor: 16,622 bytes, line 690
690,[n,m,y]),l.jsx(iO.ItemSlot,{scope:r,id:u,focusable:n,active:i,children:l.jsx(Oe.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...o,ref:e,onMouseDown:we(t.onMouseDown,w=>{n?d.onItemFocus(u):w.preventDefault()}),onFocus:we(t.onFocus,()=>d.onItemFocus(u)),onKeyDown:we(t.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){d.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const b=ave(w,d.orientation,d.dir);if(b!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let S=p().filter(N=>N.focusable).map(N=>N.ref.current);if(b==="last")S.reverse();else if(b==="prev"||b==="next"){b==="prev"&&S.reverse();const N=S.indexOf(w.currentTarget);S=d.loop?ove(S,N+1):S.slice(N+1)}setTimeout(()=>PW(S))}}),children:typeof a=="function"?a({isCurrentTabStop:f,hasTabStop:v!=null}):a})})});AW.displayName=TW;var ive={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function sve(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function ave(t,e,r){const n=sve(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return ive[n]}function PW(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}function ove(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var MW=OW,RW=AW,sO=["Enter"," "],lve=["ArrowDown","PageUp","Home"],IW=["ArrowUp","PageDown","End"],cve=[...lve,...IW],uve={ltr:[...sO,"ArrowRight"],rtl:[...sO,"ArrowLeft"]},dve={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ty="Menu",[av,fve,hve]=vy(Ty),[bd,LW]=Kn(Ty,[hve,Ec,Z_]),J_=Ec(),$W=Z_(),[pve,wd]=bd(Ty),[mve,Ay]=bd(Ty),DW=t=>{const{__scopeMenu:e,open:r=!1,children:n,dir:i,onOpenChange:s,modal:a=!0}=t,o=J_(e),[c,u]=x.useState(null),d=x.useRef(!1),f=Ci(s),p=wy(i);return x.useEffect(()=>{const m=()=>{d.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),l.jsx(k_,{...o,children:l.jsx(pve,{scope:e,open:r,onOpenChange:f,content:c,onContentChange:u,children:l.jsx(mve,{scope:e,onClose:x.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:a,children:n})})})};DW.displayName=Ty;var gve="MenuAnchor",b2=x.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,i=J_(r);return l.jsx(by,{...i,...n,ref:e})});b2.displayName=gve;var w2="MenuPortal",[vve,BW]=bd(w2,{forceMount:void 0}),FW=t=>{const{__scopeMenu:e,forceMount:r,children:n,container:i}=t,s=wd(w2,e);return l.jsx(vve,{scope:e,forceMount:r,children:l.jsx(di,{present:r||s.open,children:l.jsx(mp,{asChild:!0,container:i,children:n})})})};FW.displayName=w2;var Ns="MenuContent",[yve,_2]=bd(Ns),zW=x.forwardRef((t,e)=>{const r=BW(Ns,t.__scopeMenu),{forceMount:n=r.forceMount,...i}=t,s=wd(Ns,t.__scopeMenu),a=Ay(Ns,t.__scopeMenu);return l.jsx(av.Provider,{scope:t.__scopeMenu,children:l.jsx(di,{present:n||s.open,children:l.jsx(av.Slot,{scope:t.__scopeMenu,children:a.modal?l.jsx(xve,{...i,ref:e}):l.jsx(bve,{...i,ref:e})})})})}),xve=x.forwardRef((t,e)=>{const r=wd(Ns,t.__scopeMenu),n=x.useRef(null),i=it(e,n);return x.useEffect(()=>{const s=n.current;if(s)return A_(s)},[]),l.jsx(k2,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:we(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),bve=x.forwardRef((t,e)=>{const r=wd(Ns,t.__scopeMenu);return l.jsx(k2,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),wve=gc("MenuContent.ScrollLock"),k2=x.forwardRef((t,e)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:y,...v}=t,w=wd(Ns,r),b=Ay(Ns,r),_=J_(r),S=$W(r),N=fve(r),[j,C]=x.useState(null),O=x.useRef(null),P=it(e,O,w.onContentChange),T=x.useRef(0),$=x.useRef(""),B=x.useRef(0),R=x.useRef(null),M=x.useRef("right"),F=x.useRef(0),q=y?ky:x.Fragment,V=y?{as:wve,allowPinchZoom:!0}:void 0,W=H=>{var oe,_e;const G=$.current+H,Y=N().filter(ne=>!ne.disabled),U=document.activeElement,J=(oe=Y.find(ne=>ne.ref.current===U))==null?void 0:oe.textValue,te=Y.map(ne=>ne.textValue),re=Mve(te,G,J),ae=(_e=Y.find(ne=>ne.textValue===re))==null?void 0:_e.ref.current;(function ne(ue){$.current=ue,window.clearTimeout(T.current),ue!==""&&(T.current=window.setTimeout(()=>ne(""),1e3))})(G),ae&&setTimeout(()=>ae.focus())};x.useEffect(()=>()=>window.clearTimeout(T.current),[]),T_();const z=x.useCallback(H=>{var Y,U;return M.current===((Y=R.current)==null?void 0:Y.side)&&Ive(H,(U=R.current)==null?void 0:U.area)},[]);return l.jsx(yve,{scope:r,searchRef:$,onItemEnter:x.useCallback(H=>{z(H)&&H.preventDefault()},[z]),onItemLeave:x.useCallback(H=>{var G;z(H)||((G=O.current)==null||G.focus(),C(null))},[z]),onTriggerLeave:x.useCallback(H=>{z(H)&&H.preventDefault()},[z]),pointerGraceTimerRef:B,onPointerGraceIntentChange:x.useCallback(H=>{R.current=H},[]),children:l.jsx(q,{...V,children:l.jsx(_y,{asChild:!0,trapped:i,onMountAutoFocus:we(s,H=>{var G;H.preventDefault(),(G=O.current)==null||G.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:l.jsx(vd,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:m,children:l.jsx(MW,{asChild:!0,...S,dir:b.dir,orientation:"vertical",loop:n,currentTabStopId:j,onCurrentTabStopIdChange:C,onEntryFocus:we(c,H=>{b.isUsingKeyboardRef.current||H.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(S_,{role:"menu","aria-orientation":"vertical","data-state":nq(w.open),"data-radix-menu-content":"",dir:b.dir,..._,...v,ref:P,style:{outline:"none",...v.style},onKeyDown:we(v.onKeyDown,H=>{const Y=H.target.closest("[data-radix-menu-content]")===H.currentTarget,U=H.ctrlKey||H.altKey||H.metaKey,J=H.key.length===1;Y&&(H.key==="Tab"&&H.preventDefault(),!U&&J&&W(H.key));const te=O.current;if(H.target!==te||!cve.includes(H.key))return;H.preventDefault();const ae=N().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);IW.includes(H.key)&&ae.reverse(),Ave(ae)}),onBlur:we(t.onBlur,H=>{H.currentTarget.contains(H.target)||(window.clearTimeout(T.current),$.current="")}),onPointerMove:we(t.onPointerMove,ov(H=>{const G=H.target,Y=F.current!==H.clientX;if(H.currentTarget.contains(G)&&Y){const U=H.clientX>F.current?"right":"left";M.current=U,F.current=H.clientX}}))})})})})})})});zW.displayName=Ns;var _ve="MenuGroup",S2=x.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return l.jsx(Oe.div,{role:"group",...n,ref:e})});S2.displayName=_ve;var kve="MenuLabel",UW=x.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return l.jsx(Oe.div,{...n,ref:e})});UW.displayName=kve;var Z0="MenuItem",RD="menu.itemSelect",Y_=x.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...i}=t,s=x.useRef(null),a=Ay(Z0,t.__scopeMenu),o=_2(Z0,t.__scopeMenu),c=it(e,s),u=x.useRef(!1),d=()=>{const f=s.current;if(!r&&f){const p=new CustomEvent(RD,{bubbles:!0,cancelable:!0});f.addEventListener(RD,m=>n==null?void 0:n(m),{once:!0}),EP(f,p),p.defaultPrevented?u.current=!1:a.onClose()}};return l.jsx(HW,{...i,ref:c,disabled:r,onClick:we(t.onClick,d),onPointerDown:f=>{var p;(p=t.onPointerDown)==null||p.call(t,f),u.current=!0},onPointerUp:we(t.onPointerUp,f=>{var p;u.current||(p=f.currentTarget)==null||p.click()}),onKeyDown:we(t.onKeyDown,f=>{const p=o.searchRef.current!=="";r||p&&f.key===" "||sO.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Y_.displayName=Z0;var HW=x.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...s}=t,a=_2(Z0,r),o=$W(r),c=x.useRef(null),u=it(e,c),[d,f]=x.useState(!1),[p,m]=x.useState("");return x.useEffect(()=>{const y=c.current;y&&m((y.textContent??"").trim())},[s.children]),l.jsx(av.ItemSlot,{scope:r,disabled:n,textValue:i??p,children:l.jsx(RW,{asChild:!0,...o,focusable:!n,children:l.jsx(Oe.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:u,onPointerMove:we(t.onPointerMove,ov(y=>{n?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:we(t.onPointerLeave,ov(y=>a.onItemLeave(y))),onFocus:we(t.onFocus,()=>f(!0)),onBlur:we(t.onBlur,()=>f(!1))})})})}),Sve="MenuCheckboxItem",VW=x.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...i}=t;return l.jsx(ZW,{scope:t.__scopeMenu,checked:r,children:l.jsx(Y_,{role:"menuitemcheckbox","aria-checked":J0(r)?"mixed":r,...i,ref:e,"data-state":N2(r),onSelect:we(i.onSelect,()=>n==null?void 0:n(J0(r)?!0:!r),{checkForDefaultPrevented:!1})})})});VW.displayName=Sve;var WW="MenuRadioGroup",[jve,Nve]=bd(WW,{value:void 0,onValueChange:()=>{}}),qW=x.forwardRef((t,e)=>{const{value:r,onValueChange:n,...i}=t,s=Ci(n);return l.jsx(jve,{scope:t.__scopeMenu,value:r,onValueChange:s,children:l.jsx(S2,{...i,ref:e})})});qW.displayName=WW;var KW="MenuRadioItem",GW=x.forwardRef((t,e)=>{const{value:r,...n}=t,i=Nve(KW,t.__scopeMenu),s=r===i.value;return l.jsx(ZW,{scope:t.__scopeMenu,checked:s,children:l.jsx(Y_,{role:"menuitemradio","aria-checked":s,...n,ref:e,"data-state":N2(s),onSelect:we(n.onSelect,()=>{var a;return(a=i.onValueChange)==null?void 0:a.call(i,r)},{checkForDefaultPrevented:!1})})})});GW.displayName=KW;var j2="MenuItemIndicator",[ZW,Cve]=bd(j2,{checked:!1}),JW=x.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...i}=t,s=Cve(j2,r);return l.jsx(di,{present:n||J0(s.checked)||s.checked===!0,children:l.jsx(Oe.span,{...i,ref:e,"data-state":N2(s.checked)})})});JW.displayName=j2;var Eve="MenuSeparator",YW=x.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return l.jsx(Oe.div,{role:"separator","aria-orientation":"horizontal",...n,ref:e})});YW.displayName=Eve;var Ove="MenuArrow",XW=x.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,i=J_(r);return l.jsx(j_,{...i,...n,ref:e})});XW.displayName=Ove;var Tve="MenuSub",[zZe,QW]=bd(Tve),Bm="MenuSubTrigger",eq=x.forwardRef((t,e)=>{const r=wd(Bm,t.__scopeMenu),n=Ay(Bm,t.__scopeMenu),i=QW(Bm,t.__scopeMenu),s=_2(Bm,t.__scopeMenu),a=x.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:c}=s,u={__scopeMenu:t.__scopeMenu},d=x.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return x.useEffect(()=>d,[d]),x.useEffect(()=>{const f=o.current;return()=>{window.clearTimeout(f),c(null)}},[o,c]),l.jsx(b2,{asChild:!0,...u,children:l.jsx(HW,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":nq(r.open),...t,ref:Fo(e,i.onTriggerChange),onClick:f=>{var p;(p=t.onClick)==null||p.call(t,f),!(t.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:we(t.onPointerMove,ov(f=>{s.onItemEnter(f),!f.defaultPrevented&&!t.disabled&&!r.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),d()},100))})),onPointerLeave:we(t.onPointerLeave,ov(f=>{var m,y;d();const p=(m=r.content)==null?void 0:m.getBoundingClientRect();if(p){const v=(y=r.content)==null?void 0:y.dataset.side,w=v==="right",b=w?-5:5,_=p[w?"left":"right"],S=p[w?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+b,y:f.clientY},{x:_,y:p.top},{x:S,y:p.top},{x:S,y:p.bottom},{x:_,y:p.bottom}],side:v}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:we(t.onKeyDown,f=>{var m;const p=s.searchRef.current!=="";t.disabled||p&&f.key===" "||uve[n.dir].includes(f.key)&&(r.onOpenChange(!0),(m=r.content)==null||m.focus(),f.preventDefault())})})})});eq.displayName=Bm;var tq="MenuSubContent",rq=x.forwardRef((t,e)=>{const r=BW(Ns,t.__scopeMenu),{forceMount:n=r.forceMount,...i}=t,s=wd(Ns,t.__scopeMenu),a=Ay(Ns,t.__scopeMenu),o=QW(tq,t.__scopeMenu),c=x.useRef(null),u=it(e,c);return l.jsx(av.Provider,{scope:t.__scopeMenu,children:l.jsx(di,{present:n||s.open,children:l.jsx(av.Slot,{scope:t.__scopeMenu,children:l.jsx(k2,{id:o.contentId,"aria-labelledby":o.triggerId,...i,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;a.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:we(t.onFocusOutside,d=>{d.target!==o.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:we(t.onEscapeKeyDown,d=>{a.onClose(),d.preventDefault()}),onKeyDown:we(t.onKeyDown,d=>{var m;const f=d.currentTarget.contains(d.target),p=dve[a.dir].includes(d.key);f&&p&&(s.onOpenChange(!1),(m=o.trigger)==null||m.focus(),d.preventDefault())})})})})})});rq.displayName=tq;function nq(t){return t?"open":"closed"}function J0(t){return t==="indeterminate"}function N2(t){return J0(t)?"indeterminate":t?"checked":"unchecked"}function Ave(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function Pve(t,e){return t.map((r,n)=>t[(e+n)%t.length])}function Mve(t,e,r){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let a=Pve(t,Math.max(s,0));i.length===1&&(a=a.filter(u=>u!==r));const c=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function Rve(t,e){const{x:r,y:n}=t;let i=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const o=e[s],c=e[a],u=o.x,d=o.y,f=c.x,p=c.y;d>n!=p>n&&r<(f-u)*(n-d)/(p-d)+u&&(i=!i)}return i}function Ive(t,e){if(!e)return!1;const r={x:t.clientX,y:t.clientY};return Rve(r,e)}function ov(t){return e=>e.pointerType==="mouse"?t(e):void 0}var Lve=DW,$ve=b2,Dve=FW,Bve=zW,Fve=S2,zve=UW,Uve=Y_,Hve=VW,Vve=qW,Wve=GW,qve=JW,Kve=YW,Gve=XW,Zve=eq,Jve=rq,X_="DropdownMenu",[Yve,UZe]=Kn(X_,[LW]),hi=LW(),[Xve,iq]=Yve(X_),sq=t=>{const{__scopeDropdownMenu:e,children:r,dir:n,open:i,defaultOpen:s,onOpenChange:a,modal:o=!0}=t,c=hi(e),u=x.useRef(null),[d,f]=Yi({prop:i,defaultProp:s??!1,onChange:a,caller:X_});return l.jsx(Xve,{scope:e,triggerId:tn(),triggerRef:u,contentId:tn(),open:d,onOpenChange:f,onOpenToggle:x.useCallback(()=>f(p=>!p),[f]),modal:o,children:l.jsx(Lve,{...c,open:d,onOpenChange:f,dir:n,modal:o,children:r})})};sq.displayName=X_;var aq="DropdownMenuTrigger",oq=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=t,s=iq(aq,r),a=hi(r);return l.jsx($ve,{asChild:!0,...a,children:l.jsx(Oe.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...i,ref:Fo(e,s.triggerRef),onPointerDown:we(t.onPointerDown,o=>{!n&&o.button===0&&o.ctrlKey===!1&&(s.onOpenToggle(),s.open||o.preventDefault())}),onKeyDown:we(t.onKeyDown,o=>{n||(["Enter"," "].includes(o.key)&&s.onOpenToggle(),o.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});oq.displayName=aq;var Qve="DropdownMenuPortal",lq=t=>{const{__scopeDropdownMenu:e,...r}=t,n=hi(e);return l.jsx(Dve,{...n,...r})};lq.displayName=Qve;var cq="DropdownMenuContent",uq=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=iq(cq,r),s=hi(r),a=x.useRef(!1);return l.jsx(Bve,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...n,ref:e,onCloseAutoFocus:we(t.onCloseAutoFocus,o=>{var c;a.current||(c=i.triggerRef.current)==null||c.focus(),a.current=!1,o.preventDefault()}),onInteractOutside:we(t.onInteractOutside,o=>{const c=o.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!i.modal||d)&&(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});uq.displayName=cq;var eye="DropdownMenuGroup",tye=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=hi(r);return l.jsx(Fve,{...i,...n,ref:e})});
690tye.displayName=eye;var rye="DropdownMenuLabel",dq=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=hi(r);return l.jsx(zve,{...i,...n,ref:e})});dq.displayName=rye;var nye="DropdownMenuItem",fq=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=hi(r);return l.jsx(Uve,{...i,...n,ref:e})});fq.displayName=nye;var iye="DropdownMenuCheckboxItem",hq=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=hi(r);return l.jsx(Hve,{...i,...n,ref:e})});hq.displayName=iye;var sye="DropdownMenuRadioGroup",aye=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=hi(r);return l.jsx(Vve,{...i,...n,ref:e})});aye.displayName=sye;var oye="DropdownMenuRadioItem",pq=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=hi(r);return l.jsx(Wve,{...i,...n,ref:e})});pq.displayName=oye;var lye="DropdownMenuItemIndicator",mq=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=hi(r);return l.jsx(qve,{...i,...n,ref:e})});mq.displayName=lye;var cye="DropdownMenuSeparator",gq=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=hi(r);return l.jsx(Kve,{...i,...n,ref:e})});gq.displayName=cye;var uye="DropdownMenuArrow",dye=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=hi(r);return l.jsx(Gve,{...i,...n,ref:e})});dye.displayName=uye;var fye="DropdownMenuSubTrigger",vq=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=hi(r);return l.jsx(Zve,{...i,...n,ref:e})});vq.displayName=fye;var hye="DropdownMenuSubContent",yq=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=hi(r);return l.jsx(Jve,{...i,...n,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});yq.displayName=hye;var pye=sq,mye=oq,gye=lq,xq=uq,bq=dq,wq=fq,_q=hq,kq=pq,Sq=mq,jq=gq,Nq=vq,Cq=yq;const vye=pye,yye=mye,xye=x.forwardRef(({className:t,inset:e,children:r,...n},i)=>l.jsxs(Nq,{ref:i,className:fe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",e&&"pl-8",t),...n,children:[r,l.jsx(kh,{className:"ml-auto h-4 w-4"})]}));xye.displayName=Nq.displayName;const bye=x.forwardRef(({className:t,...e},r)=>l.jsx(Cq,{ref:r,className:fe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",t),...e}));bye.displayName=Cq.displayName;const Eq=x.forwardRef(({className:t,sideOffset:e=4,...r},n)=>l.jsx(gye,{children:l.jsx(xq,{ref:n,sideOffset:e,className:fe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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",t),...r})}));Eq.displayName=xq.displayName;const Wb=x.forwardRef(({className:t,inset:e,...r},n)=>l.jsx(wq,{ref:n,className:fe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e&&"pl-8",t),...r}));Wb.displayName=wq.displayName;const wye=x.forwardRef(({className:t,children:e,checked:r,...n},i)=>l.jsxs(_q,{ref:i,className:fe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),checked:r,...n,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(Sq,{children:l.jsx(yp,{className:"h-4 w-4"})})}),e]}));wye.displayName=_q.displayName;const _ye=x.forwardRef(({className:t,children:e,...r},n)=>l.jsxs(kq,{ref:n,className:fe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),...r,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(Sq,{children:l.jsx(_H,{className:"h-2 w-2 fill-current"})})}),e]}));_ye.displayName=kq.displayName;
690const kye=x.forwardRef(({className:t,inset:e,...r},n)=>l.jsx(bq,{ref:n,className:fe("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...r}));kye.displayName=bq.displayName;const Sye=x.forwardRef(({className:t,...e},r)=>l.jsx(jq,{ref:r,className:fe("-mx-1 my-1 h-px bg-muted",t),...e}));Sye.displayName=jq.displayName;const Cp="/assets/annelie-permerin-CXd2fO-Z.jpg",Oh={annelie:{key:"annelie",name:"Annelie Permerin",role:"reg. Hyresförmedlare",image:Cp,initials:"AP",profileUrl:"/medarbetare/annelie-permerin",phone:"+4686445820",email:"[email protected]"},ulrika:{key:"ulrika",name:"Ulrika Nyström",role:"reg. Hyresförmedlare",initials:"UN",profileUrl:"/medarbetare/ulrika-nystrom",phone:"+4686445820",email:"[email protected]"}},Oq=Object.values(Oh),jye=t=>t&&Oh[t]||Oh.annelie,Nye=Oh.annelie,Cye=({title:t,address:e,area:r,priceFurnished:n,priceUnfurnished:i,furnishing:s,moveIn:a,moveOut:o,agent:c=Nye})=>{const u=c.key==="ulrika"?Oh.annelie:Oh.ulrika,d=[c,u];return l.jsxs("div",{className:"bg-card rounded-xl border border-border/60 shadow-card p-5 space-y-5",children:[l.jsxs("div",{children:[l.jsx(Vt,{variant:"secondary",className:"bg-accent text-accent-foreground font-medium text-xs mb-2",children:s==="Möblerad"?"Möblerad":s==="Omöblerad"?"Omöblerad":"Möblerad / Omöblerad"}),l.jsx("h1",{className:"text-xl font-bold text-foreground leading-tight mb-1.5",children:t}),l.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[l.jsx(Vn,{className:"h-3.5 w-3.5 text-primary shrink-0"}),l.jsxs("span",{className:"text-sm",children:[e," · ",r]})]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("p",{className:"text-2xl font-bold text-primary",children:[(n??i??0).toLocaleString("sv-SE")," kr",l.jsx("span",{className:"text-sm font-normal text-muted-foreground",children:"/mÃ¥n"}),n&&i&&l.jsx("span",{className:"text-xs font-normal text-muted-foreground ml-1.5",children:"möblerad"})]}),n&&i&&l.jsxs("p",{className:"text-lg font-semibold text-foreground",children:[i.toLocaleString("sv-SE")," kr",l.jsx("span",{className:"text-sm font-normal text-muted-foreground",children:"/mÃ¥n omöblerad"})]})]}),l.jsxs("div",{className:"space-y-3 text-sm",children:[l.jsx(Xj,{icon:l.jsx(Hae,{className:"h-4 w-4 text-primary"}),label:"Möblering",value:s}),l.jsx(Xj,{icon:l.jsx(m$,{className:"h-4 w-4 text-primary"}),label:"Inflyttning",value:a}),l.jsx(Xj,{icon:l.jsx(m$,{className:"h-4 w-4 text-primary"}),label:"Utflyttning",value:o})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"reg. Hyresförmedlare"}),l.jsx("div",{className:"space-y-2",children:d.map(f=>l.jsxs(Re,{to:f.profileUrl,className:"flex items-center gap-3 p-3 -mx-1 rounded-lg border border-border/60 hover:bg-accent/40 transition-colors group",children:[f.image?l.jsx("img",{src:f.image,alt:f.name,className:"w-11 h-11 rounded-full object-cover shrink-0"}):l.jsx("div",{className:"w-11 h-11 rounded-full bg-accent text-primary font-bold flex items-center justify-center shrink-0 text-sm",children:f.initials}),l.jsx("div",{className:"min-w-0",children:l.jsx("p",{className:"text-sm font-semibold text-foreground group-hover:text-primary transition-colors truncate",children:f.name})})]},f.key))})]}),l.jsxs(vye,{children:[l.jsx(yye,{asChild:!0,children:l.jsxs(se,{variant:"hero",size:"lg",className:"w-full h-12 text-base",children:["Kontakta uthyrare",l.jsx(xp,{className:"h-4 w-4 ml-1"})]})}),l.jsxs(Eq,{align:"end",className:"w-[var(--radix-dropdown-menu-trigger-width)] bg-popover",children:[l.jsx(Wb,{asChild:!0,children:l.jsxs("a",{href:"#kontakta-uthyrare",className:"cursor-pointer",children:[l.jsx(yoe,{className:"h-4 w-4 mr-2"}),"Skicka meddelande"]})}),d.map(f=>l.jsxs("div",{children:[f.email&&l.jsx(Wb,{asChild:!0,children:l.jsxs("a",{href:`mailto:${f.email}`,className:"cursor-pointer",children:[l.jsx(En,{className:"h-4 w-4 mr-2"}),"Mejla ",f.name.split(" ")[0]]})}),f.phone&&l.jsx(Wb,{asChild:!0,children:l.jsxs("a",{href:`tel:${f.phone}`,className:"cursor-pointer",children:[l.jsx(ai,{className:"h-4 w-4 mr-2"}),"Ring ",f.name.split(" ")[0]]})})]},f.key))]})]})]})},Xj=({icon:t,label:e,value:r})=>l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t,l.jsx("span",{children:e})]}),l.jsx("span",{className:"font-medium text-foreground",children:r})]}),Eye=({sqm:t,rooms:e,bedrooms:r,bathrooms:n,furnishing:i})=>{const s=[{icon:l.jsx(goe,{className:"h-4 w-4 text-primary"}),text:`${t} m²`},{icon:l.jsx(PP,{className:"h-4 w-4 text-primary"}),text:`${e} rum`},...r?[{icon:l.jsx(vp,{className:"h-4 w-4 text-primary"}),text:`${r} sovrum`}]:[],{icon:l.jsx(E0,{className:"h-4 w-4 text-primary"}),text:`${n} badrum`},{icon:l.jsx(pH,{className:"h-4 w-4 text-primary"}),text:i}];return l.jsx("div",{className:"flex flex-wrap gap-x-6 gap-y-2 py-5 my-6 border-y border-border/60",children:s.map((a,o)=>l.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground font-medium",children:[a.icon,l.jsx("span",{children:a.text})]},o))})},Oye=({text:t})=>l.jsxs("div",{children:[l.jsx("h2",{className:"text-base font-semibold text-foreground mb-2",children:"Om bostaden"}),l.jsx("p",{className:"text-muted-foreground leading-relaxed text-sm",children:t})]}),Tye=({included:t})=>l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg md:text-xl font-semibold text-foreground mb-4",children:"IngÃ¥r i hyran"}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:t.map(e=>l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx("div",{className:"w-6 h-6 rounded-full bg-primary/10 flex items-center justify-center shrink-0",children:l.jsx(yp,{className:"h-3.5 w-3.5 text-primary"})}),l.jsx("span",{className:"text-sm text-foreground",children:e})]},e))})]}),Aye={Balkong:M0,"Fransk balkong":M0,Uteplats:eoe,TrädgÃ¥rd:Eoe,Hiss:Wae,Badkar:E0,Dusch:joe,"Extra badrum":E0,"Egen ingÃ¥ng":PP,"Gäst-WC":Coe},Pye=({extras:t,buildYear:e,renovatedYear:r,gardenSqm:n})=>l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg md:text-xl font-semibold text-foreground mb-4",children:"Extrafunktioner"}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3 mb-5",children:t.map(i=>{const s=Aye[i]||M0;return l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx(s,{className:"h-4 w-4 text-primary shrink-0"}),l.jsx("span",{className:"text-sm text-foreground",children:i})]},i)})}),(e||r||n)&&l.jsxs("div",{className:"flex flex-wrap gap-4 text-sm text-muted-foreground",children:[e&&l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(SE,{className:"h-4 w-4 text-primary"}),l.jsxs("span",{children:["ByggÃ¥r: ",e]})]}),r&&l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(SE,{className:"h-4 w-4 text-primary"}),l.jsxs("span",{children:["Renoverad: ",r]})]}),n&&l.jsxs("span",{children:["TrädgÃ¥rd: ",n," m²"]})]})]}),ce=x.forwardRef(({className:t,type:e,...r},n)=>l.jsx("input",{type:e,className:fe("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",t),ref:n,...r}));ce.displayName="Input";const Is=x.forwardRef(({className:t,...e},r)=>l.jsx("textarea",{className:fe("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
690ing-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",t),ref:r,...e}));Is.displayName="Textarea";const Mye=()=>{const{id:t}=gy(),[e,r]=x.useState(!1),[n,i]=x.useState(!1),[s,a]=x.useState(""),[o,c]=x.useState(""),[u,d]=x.useState(""),[f,p]=x.useState(""),[m,y]=x.useState(""),v=async w=>{w.preventDefault(),i(!0);try{const b=typeof window<"u"?window.location.href:"",{error:_}=await ie.from("property_inquiries").insert({property_id:t??null,property_url:b,first_name:s,last_name:o,email:u,phone:f||null,move_in:null,move_out:null,message:m||null,calculated_total:null,calculated_months:null,status:"new"});if(_)throw _;const{error:S}=await ie.functions.invoke("send-inquiry-email",{body:{type:"BostadsförfrÃ¥gan",subject:`Ny bostadsförfrÃ¥gan frÃ¥n ${s} ${o}`.trim(),replyTo:u||void 0,confirmTo:u||void 0,confirmName:`${s} ${o}`.trim()||void 0,fields:{Förnamn:s,Efternamn:o,"E-post":u,Telefon:f,Meddelande:m,"Objekt-ID":t,Länk:b}}});S&&console.error("Email notify failed:",S),r(!0)}catch(b){console.error(b),nt({title:"NÃ¥got gick fel",description:"Försök igen om en stund.",variant:"destructive"})}finally{i(!1)}};return l.jsxs("div",{className:"bg-card rounded-xl border border-border/60 shadow-card p-5 md:p-6",children:[l.jsx("h3",{className:"text-lg font-semibold text-foreground mb-1",children:"Skicka förfrÃ¥gan"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-5",children:"Fyll i formuläret sÃ¥ hör vi av oss."}),e?l.jsxs("div",{className:"text-center py-6 space-y-2",children:[l.jsx(wH,{className:"h-10 w-10 text-primary mx-auto"}),l.jsx("h4",{className:"text-base font-semibold",children:"Tack för din förfrÃ¥gan!"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Vi Ã¥terkommer inom kort."})]}):l.jsxs("form",{onSubmit:v,className:"space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-xs font-medium mb-1 block text-muted-foreground",children:"Förnamn"}),l.jsx(ce,{placeholder:"Anna",required:!0,className:"h-9",value:s,onChange:w=>a(w.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs font-medium mb-1 block text-muted-foreground",children:"Efternamn"}),l.jsx(ce,{placeholder:"Svensson",required:!0,className:"h-9",value:o,onChange:w=>c(w.target.value)})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs font-medium mb-1 block text-muted-foreground",children:"E-post"}),l.jsx(ce,{type:"email",placeholder:"[email protected]",required:!0,className:"h-9",value:u,onChange:w=>d(w.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs font-medium mb-1 block text-muted-foreground",children:"Telefon"}),l.jsx(ce,{type:"tel",placeholder:"070-123 45 67",className:"h-9",value:f,onChange:w=>p(w.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs font-medium mb-1 block text-muted-foreground",children:"Meddelande"}),l.jsx(Is,{placeholder:"Berätta om era behov…",rows:3,required:!0,value:m,onChange:w=>y(w.target.value)})]}),l.jsxs(se,{variant:"hero",size:"lg",type:"submit",className:"w-full h-11 text-base",disabled:n,children:[l.jsx(TH,{className:"h-4 w-4 mr-2"}),n?"Skickar...":"Skicka förfrÃ¥gan"]}),l.jsx("p",{className:"text-[11px] text-muted-foreground text-center",children:"Vi behandlar era uppgifter enligt GDPR."})]})]})};function Tq(t,e){const r=x.useRef(e);x.useEffect(function(){e!==r.current&&t.attributionControl!=null&&(r.current!=null&&t.attributionControl.removeAttribution(r.current),e!=null&&t.attributionControl.addAttribution(e)),r.current=e},[t,e])}const Rye=1;function Iye(t){return Object.freeze({__version:Rye,map:t})}function Lye(t,e){return Object.freeze({...t,...e})}const Aq=x.createContext(null),Pq=Aq.Provider;function Mq(){const t=x.useContext(Aq);if(t==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return t}function $ye(t){function e(r,n){const{instance:i,context:s}=t(r).current;return x.useImperativeHandle(n,()=>i),r.children==null?null:D.createElement(Pq,{value:s},r.children)}return x.forwardRef(e)}function Dye(t){function e(r,n){const[i,s]=x.useState(!1),{instance:a}=t(r,s).current;x.useImperativeHandle(n,()=>a),x.useEffect(function(){i&&a.update()},[a,i,r.children]);const o=a._contentNode;return o?Vi.createPortal(r.children,o):null}return x.forwardRef(e)}function Bye(t){function e(r,n){const{instance:i}=t(r).current;return x.useImperativeHandle(n,()=>i),null}return x.forwardRef(e)}function Rq(t,e){const r=x.useRef();x.useEffect(function(){return e!=null&&t.instance.on(e),r.current=e,function(){r.current!=null&&t.instance.off(r.current),r.current=null}},[t,e])}function C2(t,e){const r=t.pane??e.pane;return r?{...t,pane:r}:t}function Fye(t,e){return function(n,i){const s=Mq(),a=t(C2(n,s),s);return Tq(s.map,n.attribution),Rq(a.current,n.eventHandlers),e(a.current,s,n,i),a}}var aO={exports:{}};/* @preserve
691 * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
692 * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
693 */(function(t,e){(function(r,n){n(e)})(Am,function(r){var n="1.9.4";function i(h){var g,k,E,A;for(k=1,E=arguments.length;k<E;k++){A=arguments[k];for(g in A)h[g]=A[g]}return h}var s=Object.create||function(){function h(){}return function(g){return h.prototype=g,new h}}();function a(h,g){var k=Array.prototype.slice;
693if(h.bind)return h.bind.apply(h,k.call(arguments,1));var E=k.call(arguments,2);return function(){return h.apply(g,E.length?E.concat(k.call(arguments)):arguments)}}var o=0;function c(h){return"_leaflet_id"in h||(h._leaflet_id=++o),h._leaflet_id}function u(h,g,k){var E,A,I,K;return K=function(){E=!1,A&&(I.apply(k,A),A=!1)},I=function(){E?A=arguments:(h.apply(k,arguments),setTimeout(K,g),E=!0)},I}function d(h,g,k){var E=g[1],A=g[0],I=E-A;return h===E&&k?h:((h-A)%I+I)%I+A}function f(){return!1}function p(h,g){if(g===!1)return h;var k=Math.pow(10,g===void 0?6:g);return Math.round(h*k)/k}function m(h){return h.trim?h.trim():h.replace(/^\s+|\s+$/g,"")}function y(h){return m(h).split(/\s+/)}function v(h,g){Object.prototype.hasOwnProperty.call(h,"options")||(h.options=h.options?s(h.options):{});for(var k in g)h.options[k]=g[k];return h.options}function w(h,g,k){var E=[];for(var A in h)E.push(encodeURIComponent(k?A.toUpperCase():A)+"="+encodeURIComponent(h[A]));return(!g||g.indexOf("?")===-1?"?":"&")+E.join("&")}var b=/\{ *([\w_ -]+) *\}/g;function _(h,g){return h.replace(b,function(k,E){var A=g[E];if(A===void 0)throw new Error("No value provided for variable "+k);return typeof A=="function"&&(A=A(g)),A})}var S=Array.isArray||function(h){return Object.prototype.toString.call(h)==="[object Array]"};function N(h,g){for(var k=0;k<h.length;k++)if(h[k]===g)return k;return-1}var j="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function C(h){return window["webkit"+h]||window["moz"+h]||window["ms"+h]}var O=0;function P(h){var g=+new Date,k=Math.max(0,16-(g-O));return O=g+k,window.setTimeout(h,k)}var T=window.requestAnimationFrame||C("RequestAnimationFrame")||P,$=window.cancelAnimationFrame||C("CancelAnimationFrame")||C("CancelRequestAnimationFrame")||function(h){window.clearTimeout(h)};function B(h,g,k){if(k&&T===P)h.call(g);else return T.call(window,a(h,g))}function R(h){h&&$.call(window,h)}var M={__proto__:null,extend:i,create:s,bind:a,get lastId(){return o},stamp:c,throttle:u,wrapNum:d,falseFn:f,formatNum:p,trim:m,splitWords:y,setOptions:v,getParamString:w,template:_,isArray:S,indexOf:N,emptyImageUrl:j,requestFn:T,cancelFn:$,requestAnimFrame:B,cancelAnimFrame:R};function F(){}F.extend=function(h){var g=function(){v(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},k=g.__super__=this.prototype,E=s(k);E.constructor=g,g.prototype=E;for(var A in this)Object.prototype.hasOwnProperty.call(this,A)&&A!=="prototype"&&A!=="__super__"&&(g[A]=this[A]);return h.statics&&i(g,h.statics),h.includes&&(q(h.includes),i.apply(null,[E].concat(h.includes))),i(E,h),delete E.statics,delete E.includes,E.options&&(E.options=k.options?s(k.options):{},i(E.options,h.options)),E._initHooks=[],E.callInitHooks=function(){if(!this._initHooksCalled){k.callInitHooks&&k.callInitHooks.call(this),this._initHooksCalled=!0;for(var I=0,K=E._initHooks.length;I<K;I++)E._initHooks[I].call(this)}},g},F.include=function(h){var g=this.prototype.options;return i(this.prototype,h),h.options&&(this.prototype.options=g,this.mergeOptions(h.options)),this},F.mergeOptions=function(h){return i(this.prototype.options,h),this},F.addInitHook=function(h){var g=Array.prototype.slice.call(arguments,1),k=typeof h=="function"?h:function(){this[h].apply(this,g)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(k),this};function q(h){if(!(typeof L>"u"||!L||!L.Mixin)){h=S(h)?h:[h];for(var g=0;g<h.length;
693g++)h[g]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var V={on:function(h,g,k){if(typeof h=="object")for(var E in h)this._on(E,h[E],g);else{h=y(h);for(var A=0,I=h.length;A<I;A++)this._on(h[A],g,k)}return this},off:function(h,g,k){if(!arguments.length)delete this._events;else if(typeof h=="object")for(var E in h)this._off(E,h[E],g);else{h=y(h);for(var A=arguments.length===1,I=0,K=h.length;I<K;I++)A?this._off(h[I]):this._off(h[I],g,k)}return this},_on:function(h,g,k,E){if(typeof g!="function"){console.warn("wrong listener type: "+typeof g);return}if(this._listens(h,g,k)===!1){k===this&&(k=void 0);var A={fn:g,ctx:k};E&&(A.once=!0),this._events=this._events||{},this._events[h]=this._events[h]||[],this._events[h].push(A)}},_off:function(h,g,k){var E,A,I;if(this._events&&(E=this._events[h],!!E)){if(arguments.length===1){if(this._firingCount)for(A=0,I=E.length;A<I;A++)E[A].fn=f;delete this._events[h];return}if(typeof g!="function"){console.warn("wrong listener type: "+typeof g);return}var K=this._listens(h,g,k);if(K!==!1){var X=E[K];this._firingCount&&(X.fn=f,this._events[h]=E=E.slice()),E.splice(K,1)}}},fire:function(h,g,k){if(!this.listens(h,k))return this;var E=i({},g,{type:h,target:this,sourceTarget:g&&g.sourceTarget||this});if(this._events){var A=this._events[h];if(A){this._firingCount=this._firingCount+1||1;for(var I=0,K=A.length;I<K;I++){var X=A[I],ee=X.fn;X.once&&this.off(h,ee,X.ctx),ee.call(X.ctx||this,E)}this._firingCount--}}return k&&this._propagateEvent(E),this},listens:function(h,g,k,E){typeof h!="string"&&console.warn('"string" type argument expected');var A=g;typeof g!="function"&&(E=!!g,A=void 0,k=void 0);var I=this._events&&this._events[h];if(I&&I.length&&this._listens(h,A,k)!==!1)return!0;if(E){for(var K in this._eventParents)if(this._eventParents[K].listens(h,g,k,E))return!0}return!1},_listens:function(h,g,k){if(!this._events)return!1;var E=this._events[h]||[];if(!g)return!!E.length;k===this&&(k=void 0);for(var A=0,I=E.length;A<I;A++)if(E[A].fn===g&&E[A].ctx===k)return A;return!1},once:function(h,g,k){if(typeof h=="object")for(var E in h)this._on(E,h[E],g,!0);else{h=y(h);for(var A=0,I=h.length;A<I;A++)this._on(h[A],g,k,!0)}return this},addEventParent:function(h){return this._eventParents=this._eventParents||{},this._eventParents[c(h)]=h,this},removeEventParent:function(h){return this._eventParents&&delete this._eventParents[c(h)],this},_propagateEvent:function(h){for(var g in this._eventParents)this._eventParents[g].fire(h.type,i({layer:h.target,propagatedFrom:h.target},h),!0)}};V.addEventListener=V.on,V.removeEventListener=V.clearAllEventListeners=V.off,V.addOneTimeEventListener=V.once,V.fireEvent=V.fire,V.hasEventListeners=V.listens;var W=F.extend(V);function z(h,g,k){this.x=k?Math.round(h):h,this.y=k?Math.round(g):g}var H=Math.trunc||function(h){return h>0?Math.floor(h):Math.ceil(h)};z.prototype={clone:function(){return new z(this.x,this.y)},add:function(h){return this.clone()._add(G(h))},_add:function(h){return this.x+=h.x,this.y+=h.y,this},subtract:function(h){return this.clone()._subtract(G(h))},_subtract:function(h){return this.x-=h.x,this.y-=h.y,this},divideBy:function(h){return this.clone()._divideBy(h)},_divideBy:function(h){return this.x/=h,this.y/=h,this},multiplyBy:function(h){return this.clone()._multiplyBy(h)},_multiplyBy:function(h){return this.x*=h,this.y*=h,this},scaleBy:function(h){return new z(this.x*h.x,this.y*h.y)},unscaleBy:function(h){return new z(this.x/h.x,this.y/h.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=H(this.x),this.y=H(this.y),this},distanceTo:function(h){h=G(h);var g=h.x-this.x,k=h.y-this.y;return Math.sqrt(g*g+k*k)},equals:function(h){return h=G(h),h.x===this.x&&h.y===this.y},contains:function(h){return h=G(h),Math.abs(h.x)<=Math.abs(this.x)&&Math.abs(h.y)<=Math.abs(this.y)},toString:function(){return"Point("+p(this.x)+", "+p(this.y)+")"}};function G(h,g,k){return h instanceof z?h:S(h)?new z(h[0],h[1]):h==null?h:typeof h=="object"&&"x"in h&&"y"in h?new z(h.x,h.y):new z(h,g,k)}function Y(h,g){if(h)for(var k=g?[h,g]:h,E=0,A=k.length;E<A;E++)this.extend(k[E])}Y.prototype={extend:function(h){var g,k;if(!h)return this;if(h instanceof z||typeof h[0]=="number"||"x"in h)g=k=G(h);else if(h=U(h),g=h.min,k=h.max,!g||!k)return this;return!this.min&&!this.max?(this.min=g.clone(),this.max=k.clone()):(this.min.x=Math.min(g.x,this.min.x),this.max.x=Math.max(k.x,this.max.x),this.min.y=Math.min(g.y,this.min.y),this.max.y=Math.max(k.y,this.max.y)),this},getCenter:function(h){return G((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,h)},getBottomLeft:function(){return G(this.min.x,this.max.y)},getTopRight:function(){return G(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(h){var g,k;return typeof h[0]=="number"||h instanceof z?h=G(h):h=U(h),h instanceof Y?(g=h.min,k=h.max):g=k=h,g.x>=this.min.x&&k.x<=this.max.x&&g.y>=this.min.y&&k.y<=this.max.y},intersects:function(h){h=U(h);var g=this.min,k=this.max,E=h.min,A=h.max,I=A.x>
693=g.x&&E.x<=k.x,K=A.y>=g.y&&E.y<=k.y;return I&&K},overlaps:function(h){h=U(h);var g=this.min,k=this.max,E=h.min,A=h.max,I=A.x>g.x&&E.x<k.x,K=A.y>g.y&&E.y<k.y;return I&&K},isValid:function(){return!!(this.min&&this.max)},pad:function(h){var g=this.min,k=this.max,E=Math.abs(g.x-k.x)*h,A=Math.abs(g.y-k.y)*h;return U(G(g.x-E,g.y-A),G(k.x+E,k.y+A))},equals:function(h){return h?(h=U(h),this.min.equals(h.getTopLeft())&&this.max.equals(h.getBottomRight())):!1}};function U(h,g){return!h||h instanceof Y?h:new Y(h,g)}function J(h,g){if(h)for(var k=g?[h,g]:h,E=0,A=k.length;E<A;E++)this.extend(k[E])}J.prototype={extend:function(h){var g=this._southWest,k=this._northEast,E,A;if(h instanceof re)E=h,A=h;else if(h instanceof J){if(E=h._southWest,A=h._northEast,!E||!A)return this}else return h?this.extend(ae(h)||te(h)):this;return!g&&!k?(this._southWest=new re(E.lat,E.lng),this._northEast=new re(A.lat,A.lng)):(g.lat=Math.min(E.lat,g.lat),g.lng=Math.min(E.lng,g.lng),k.lat=Math.max(A.lat,k.lat),k.lng=Math.max(A.lng,k.lng)),this},pad:function(h){var g=this._southWest,k=this._northEast,E=Math.abs(g.lat-k.lat)*h,A=Math.abs(g.lng-k.lng)*h;return new J(new re(g.lat-E,g.lng-A),new re(k.lat+E,k.lng+A))},getCenter:function(){return new re((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new re(this.getNorth(),this.getWest())},getSouthEast:function(){return new re(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(h){typeof h[0]=="number"||h instanceof re||"lat"in h?h=ae(h):h=te(h);var g=this._southWest,k=this._northEast,E,A;
693return h instanceof J?(E=h.getSouthWest(),A=h.getNorthEast()):E=A=h,E.lat>=g.lat&&A.lat<=k.lat&&E.lng>=g.lng&&A.lng<=k.lng},intersects:function(h){h=te(h);var g=this._southWest,k=this._northEast,E=h.getSouthWest(),A=h.getNorthEast(),I=A.lat>=g.lat&&E.lat<=k.lat,K=A.lng>=g.lng&&E.lng<=k.lng;return I&&K},overlaps:function(h){h=te(h);var g=this._southWest,k=this._northEast,E=h.getSouthWest(),A=h.getNorthEast(),I=A.lat>g.lat&&E.lat<k.lat,K=A.lng>g.lng&&E.lng<k.lng;return I&&K},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(h,g){return h?(h=te(h),this._southWest.equals(h.getSouthWest(),g)&&this._northEast.equals(h.getNorthEast(),g)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function te(h,g){return h instanceof J?h:new J(h,g)}function re(h,g,k){if(isNaN(h)||isNaN(g))throw new Error("Invalid LatLng object: ("+h+", "+g+")");this.lat=+h,this.lng=+g,k!==void 0&&(this.alt=+k)}re.prototype={equals:function(h,g){if(!h)return!1;h=ae(h);var k=Math.max(Math.abs(this.lat-h.lat),Math.abs(this.lng-h.lng));return k<=(g===void 0?1e-9:g)},toString:function(h){return"LatLng("+p(this.lat,h)+", "+p(this.lng,h)+")"},distanceTo:function(h){return _e.distance(this,ae(h))},wrap:function(){return _e.wrapLatLng(this)},toBounds:function(h){var g=180*h/40075017,k=g/Math.cos(Math.PI/180*this.lat);return te([this.lat-g,this.lng-k],[this.lat+g,this.lng+k])},clone:function(){return new re(this.lat,this.lng,this.alt)}};function ae(h,g,k){return h instanceof re?h:S(h)&&typeof h[0]!="object"?h.length===3?new re(h[0],h[1],h[2]):h.length===2?new re(h[0],h[1]):null:h==null?h:typeof h=="object"&&"lat"in h?new re(h.lat,"lng"in h?h.lng:h.lon,h.alt):g===void 0?null:new re(h,g,k)}var oe={latLngToPoint:function(h,g){var k=this.projection.project(h),E=this.scale(g);return this.transformation._transform(k,E)},pointToLatLng:function(h,g){var k=this.scale(g),E=this.transformation.untransform(h,k);return this.projection.unproject(E)},project:function(h){return this.projection.project(h)},unproject:function(h){return this.projection.unproject(h)},scale:function(h){return 256*Math.pow(2,h)},zoom:function(h){return Math.log(h/256)/Math.LN2},getProjectedBounds:function(h){if(this.infinite)return null;var g=this.projection.bounds,k=this.scale(h),E=this.transformation.transform(g.min,k),A=this.transformation.transform(g.max,k);return new Y(E,A)},infinite:!1,wrapLatLng:function(h){var g=this.wrapLng?d(h.lng,this.wrapLng,!0):h.lng,k=this.wrapLat?d(h.lat,this.wrapLat,!0):h.lat,E=h.alt;return new re(k,g,E)},wrapLatLngBounds:function(h){var g=h.getCenter(),k=this.wrapLatLng(g),E=g.lat-k.lat,A=g.lng-k.lng;if(E===0&&A===0)return h;
693var I=h.getSouthWest(),K=h.getNorthEast(),X=new re(I.lat-E,I.lng-A),ee=new re(K.lat-E,K.lng-A);return new J(X,ee)}},_e=i({},oe,{wrapLng:[-180,180],R:6371e3,distance:function(h,g){var k=Math.PI/180,E=h.lat*k,A=g.lat*k,I=Math.sin((g.lat-h.lat)*k/2),K=Math.sin((g.lng-h.lng)*k/2),X=I*I+Math.cos(E)*Math.cos(A)*K*K,ee=2*Math.atan2(Math.sqrt(X),Math.sqrt(1-X));return this.R*ee}}),ne=6378137,ue={R:ne,MAX_LATITUDE:85.0511287798,project:function(h){var g=Math.PI/180,k=this.MAX_LATITUDE,E=Math.max(Math.min(k,h.lat),-k),A=Math.sin(E*g);return new z(this.R*h.lng*g,this.R*Math.log((1+A)/(1-A))/2)},unproject:function(h){var g=180/Math.PI;return new re((2*Math.atan(Math.exp(h.y/this.R))-Math.PI/2)*g,h.x*g/this.R)},bounds:function(){var h=ne*Math.PI;return new Y([-h,-h],[h,h])}()};function be(h,g,k,E){if(S(h)){this._a=h[0],this._b=h[1],this._c=h[2],this._d=h[3];return}this._a=h,this._b=g,this._c=k,this._d=E}be.prototype={transform:function(h,g){return this._transform(h.clone(),g)},_transform:function(h,g){return g=g||1,h.x=g*(this._a*h.x+this._b),h.y=g*(this._c*h.y+this._d),h},untransform:function(h,g){return g=g||1,new z((h.x/g-this._b)/this._a,(h.y/g-this._d)/this._c)}};function Q(h,g,k,E){return new be(h,g,k,E)}var He=i({},_e,{code:"EPSG:3857",projection:ue,transformation:function(){var h=.5/(Math.PI*ue.R);return Q(h,.5,-h,.5)}()}),Ie=i({},He,{code:"EPSG:900913"});function ft(h){return document.createElementNS("http://www.w3.org/2000/svg",h)}function ot(h,g){var k="",E,A,I,K,X,ee;for(E=0,I=h.length;E<I;E++){for(X=h[E],A=0,K=X.length;A<K;A++)ee=X[A],k+=(A?"L":"M")+ee.x+" "+ee.y;k+=g?Pe.svg?"z":"x":""}return k||"M0 0"}var yt=document.documentElement.style,Bt="ActiveXObject"in window,Or=Bt&&!document.addEventListener,xr="msLaunchUri"in navigator&&!("documentMode"in document),ar=Pn("webkit"),fr=Pn("android"),qr=Pn("android 2")||Pn("android 3"),Us=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),Z=fr&&Pn("Google")&&Us<537&&!("AudioNode"in window),Le=!!window.opera,ht=!xr&&Pn("chrome"),Qt=Pn("gecko")&&!ar&&!Le&&!Bt,Ft=!ht&&Pn("safari"),Kr=Pn("phantom"),pi="OTransition"in yt,xa=navigator.platform.indexOf("Win")===0,zt=Bt&&"transition"in yt,Zn="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!qr,rs="MozPerspective"in yt,mi=!window.L_DISABLE_3D&&(zt||Zn||rs)&&!pi&&!Kr,ns=typeof orientation<"u"||Pn("mobile"),Od=ns&&ar,Td=ns&&Zn,qc=!window.PointerEvent&&window.MSPointerEvent,Ad=!!(window.PointerEvent||qc),hr="ontouchstart"in window||!!window.TouchEvent,or=!window.L_NO_TOUCH&&(hr||Ad),yn=ns&&Le,Fe=ns&&Qt,et=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,lt=function(){var h=!1;try{var g=Object.defineProperty({},"passive",{get:function(){h=!0}});window.addEventListener("testPassiveEventSupport",f,g),window.removeEventListener("testPassiveEventSupport",f,g)}catch{}return h}(),lr=function(){return!!document.createElement("canvas").getContext}(),br=!!(document.createElementNS&&ft("svg").createSVGRect),$t=!!br&&function(){var h=document.createElement("div");return h.innerHTML="<svg/>",(h.firstChild&&h.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),nn=!br&&function(){try{var h=document.createElement("div");h.innerHTML='<v:shape adj="1"/>';var g=h.firstChild;return g.style.behavior="url(#default#VML)",g&&typeof g.adj=="object"}catch{return!1}}(),cr=navigator.platform.indexOf("Mac")===0,Rr=navigator.platform.indexOf("Linux")===0;function Pn(h){return navigator.userAgent.toLowerCase().indexOf(h)>=0}var Pe={ie:Bt,ielt9:Or,edge:xr,webkit:ar,android:fr,android23:qr,androidStock:Z,opera:Le,chrome:ht,gecko:Qt,safari:Ft,phantom:Kr,opera12:pi,win:xa,ie3d:zt,webkit3d:Zn,gecko3d:rs,any3d:mi,mobile:ns,mobileWebkit:Od,mobileWebkit3d:Td,msPointer:qc,pointer:Ad,touch:or,touchNative:hr,mobileOpera:yn,mobileGecko:Fe,retina:et,passiveEvents:lt,canvas:lr,svg:br,vml:nn,inlineSvg:$t,mac:cr,linux:Rr},Hs=Pe.msPointer?"MSPointerDown":"pointerdown",al=Pe.msPointer?"MSPointerMove":"pointermove",Pd=Pe.msPointer?"MSPointerUp":"pointerup",DR=Pe.msPointer?"MSPointerCancel":"pointercancel",_S={touchstart:Hs,touchmove:al,touchend:Pd,touchcancel:DR},BR={touchstart:RQ,touchmove:Gy,touchend:Gy,touchcancel:Gy},Md={},FR=!1;function OQ(h,g,k){return g==="touchstart"&&MQ(),BR[g]?(k=BR[g].bind(this,k),h.addEventListener(_S[g],k,!1),
693k):(console.warn("wrong event specified:",g),f)}function TQ(h,g,k){if(!_S[g]){console.warn("wrong event specified:",g);return}h.removeEventListener(_S[g],k,!1)}function AQ(h){Md[h.pointerId]=h}function PQ(h){Md[h.pointerId]&&(Md[h.pointerId]=h)}function zR(h){delete Md[h.pointerId]}function MQ(){FR||(document.addEventListener(Hs,AQ,!0),document.addEventListener(al,PQ,!0),document.addEventListener(Pd,zR,!0),document.addEventListener(DR,zR,!0),FR=!0)}function Gy(h,g){if(g.pointerType!==(g.MSPOINTER_TYPE_MOUSE||"mouse")){g.touches=[];for(var k in Md)g.touches.push(Md[k]);g.changedTouches=[g],h(g)}}function RQ(h,g){g.MSPOINTER_TYPE_TOUCH&&g.pointerType===g.MSPOINTER_TYPE_TOUCH&&xn(g),Gy(h,g)}function IQ(h){var g={},k,E;for(E in h)k=h[E],g[E]=k&&k.bind?k.bind(h):k;return h=g,g.type="dblclick",g.detail=2,g.isTrusted=!1,g._simulated=!0,g}var LQ=200;function $Q(h,g){h.addEventListener("dblclick",g);var k=0,E;function A(I){if(I.detail!==1){E=I.detail;return}if(!(I.pointerType==="mouse"||I.sourceCapabilities&&!I.sourceCapabilities.firesTouchEvents)){var K=qR(I);if(!(K.some(function(ee){return ee instanceof HTMLLabelElement&&ee.attributes.for})&&!K.some(function(ee){return ee instanceof HTMLInputElement||ee instanceof HTMLSelectElement}))){var X=Date.now();X-k<=LQ?(E++,E===2&&g(IQ(I))):E=1,k=X}}}return h.addEventListener("click",A),{dblclick:g,simDblclick:A}}function DQ(h,g){h.removeEventListener("dblclick",g.dblclick),h.removeEventListener("click",g.simDblclick)}var kS=Yy(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Wp=Yy(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),UR=Wp==="webkitTransition"||Wp==="OTransition"?Wp+"End":"transitionend";function HR(h){return typeof h=="string"?document.getElementById(h):h}function qp(h,g){var k=h.style[g]||h.currentStyle&&h.currentStyle[g];if((!k||k==="auto")&&document.defaultView){var E=document.defaultView.getComputedStyle(h,null);k=E?E[g]:null}return k==="auto"?null:k}function Ot(h,g,k){var E=document.createElement(h);return E.className=g||"",k&&k.appendChild(E),E}function pr(h){var g=h.parentNode;g&&g.removeChild(h)}function Zy(h){for(;h.firstChild;)h.removeChild(h.firstChild)}function Rd(h){var g=h.parentNode;g&&g.lastChild!==h&&g.appendChild(h)}function Id(h){var g=h.parentNode;g&&g.firstChild!==h&&g.insertBefore(h,g.firstChild)}function SS(h,g){if(h.classList!==void 0)return h.classList.contains(g);var k=Jy(h);return k.length>0&&new RegExp("(^|\\s)"+g+"(\\s|$)").test(k)}function ct(h,g){if(h.classList!==void 0)for(var k=y(g),E=0,A=k.length;E<A;E++)h.classList.add(k[E]);else if(!SS(h,g)){var I=Jy(h);jS(h,(I?I+" ":"")+g)}}function Tr(h,g){h.classList!==void 0?h.classList.remove(g):jS(h,m((" "+Jy(h)+" ").replace(" "+g+" "," ")))}function jS(h,g){h.className.baseVal===void 0?h.className=g:h.className.baseVal=g}function Jy(h){return h.correspondingElement&&(h=h.correspondingElement),h.className.baseVal===void 0?h.className:h.className.baseVal}function is(h,g){"opacity"in h.style?h.style.opacity=g:"filter"in h.style&&BQ(h,g)}function BQ(h,g){var k=!1,E="DXImageTransform.Microsoft.Alpha";try{k=h.filters.item(E)}catch{if(g===1)return}g=Math.round(g*100),k?(k.Enabled=g!==100,k.Opacity=g):h.style.filter+=" progid:"+E+"(opacity="+g+")"}function Yy(h){for(var g=document.documentElement.style,k=0;k<h.length;k++)if(h[k]in g)return h[k];return!1}function Kc(h,g,k){var E=g||new z(0,0);h.style[kS]=(Pe.ie3d?"translate("+E.x+"px,"+E.y+"px)":"translate3d("+E.x+"px,"+E.y+"px,0)")+(k?" scale("+k+")":"")}function Ir(h,g){h._leaflet_pos=g,Pe.any3d?Kc(h,g):(h.style.left=g.x+"px",h.style.top=g.y+"px")}function Gc(h){return h._leaflet_pos||new z(0,0)}var Kp,Gp,NS;if("onselectstart"in document)Kp=function(){rt(window,"selectstart",xn)},Gp=function(){Kt(window,"selectstart",xn)};else{var Zp=Yy(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Kp=function(){if(Zp){var h=document.documentElement.style;NS=h[Zp],h[Zp]="none"}},Gp=function(){Zp&&(document.documentElement.style[Zp]=NS,NS=void 0)}}function CS(){rt(window,"dragstart",xn)}function ES(){Kt(window,"dragstart",xn)}var Xy,OS;function TS(h){for(;h.tabIndex===-1;)h=h.parentNode;h.style&&(Qy(),Xy=h,OS=h.style.outlineStyle,h.style.outlineStyle="none",rt(window,"keydown",Qy))}function Qy(){Xy&&(Xy.style.outlineStyle=OS,Xy=void 0,OS=void 0,Kt(window,"keydown",Qy))}function VR(h){do h=h.parentNode;while((!h.offsetWidth||!h.offsetHeight)&&h!==document.body);return h}function AS(h){var g=h.getBoundingClientRect();return{x:g.width/h.offsetWidth||1,y:g.height/h.offsetHeight||1,boundingClientRect:g}}var FQ={__proto__:null,TRANSFORM:kS,TRANSITION:Wp,TRANSITION_END:UR,get:HR,getStyle:qp,create:Ot,remove:pr,empty:Zy,toFront:Rd,toBack:Id,hasClass:SS,addClass:ct,removeClass:Tr,setClass:jS,getClass:Jy,setOpacity:is,testProp:Yy,setTransform:Kc,setPosition:Ir,getPosition:Gc,get disableTextSelection(){return Kp},get enableTextSelection(){return Gp},disableImageDrag:CS,enableImageDrag:ES,preventOutline:TS,restoreOutline:Qy,get
693SizedParentNode:VR,getScale:AS};function rt(h,g,k,E){if(g&&typeof g=="object")for(var A in g)MS(h,A,g[A],k);else{g=y(g);for(var I=0,K=g.length;I<K;I++)MS(h,g[I],k,E)}return this}var ba="_leaflet_events";function Kt(h,g,k,E){if(arguments.length===1)WR(h),delete h[ba];else if(g&&typeof g=="object")for(var A in g)RS(h,A,g[A],k);else if(g=y(g),arguments.length===2)WR(h,function(X){return N(g,X)!==-1});else for(var I=0,K=g.length;I<K;I++)RS(h,g[I],k,E);return this}function WR(h,g){for(var k in h[ba]){var E=k.split(/\d/)[0];(!g||g(E))&&RS(h,E,null,null,k)}}var PS={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function MS(h,g,k,E){var A=g+c(k)+(E?"_"+c(E):"");if(h[ba]&&h[ba][A])return this;var I=function(X){return k.call(E||h,X||window.event)},K=I;!Pe.touchNative&&Pe.pointer&&g.indexOf("touch")===0?I=OQ(h,g,I):Pe.touch&&g==="dblclick"?I=$Q(h,I):"addEventListener"in h?g==="touchstart"||g==="touchmove"||g==="wheel"||g==="mousewheel"?h.addEventListener(PS[g]||g,I,Pe.passiveEvents?{passive:!1}:!1):g==="mouseenter"||g==="mouseleave"?(I=function(X){X=X||window.event,LS(h,X)&&K(X)},h.addEventListener(PS[g],I,!1)):h.addEventListener(g,K,!1):h.attachEvent("on"+g,I),h[ba]=h[ba]||{},h[ba][A]=I}function RS(h,g,k,E,A){A=A||g+c(k)+(E?"_"+c(E):"");var I=h[ba]&&h[ba][A];if(!I)return this;!Pe.touchNative&&Pe.pointer&&g.indexOf("touch")===0?TQ(h,g,I):Pe.touch&&g==="dblclick"?DQ(h,I):"removeEventListener"in h?h.removeEventListener(PS[g]||g,I,!1):h.detachEvent("on"+g,I),h[ba][A]=null}function Zc(h){return h.stopPropagation?h.stopPropagation():h.originalEvent?h.originalEvent._stopped=!0:h.cancelBubble=!0,this}function IS(h){return MS(h,"wheel",Zc),this}function Jp(h){return rt(h,"mousedown touchstart dblclick contextmenu",Zc),h._leaflet_disable_click=!0,this}function xn(h){return h.preventDefault?h.preventDefault():h.returnValue=!1,this}function Jc(h){return xn(h),Zc(h),this}function qR(h){if(h.composedPath)return h.composedPath();for(var g=[],k=h.target;k;)g.push(k),k=k.parentNode;return g}function KR(h,g){if(!g)return new z(h.clientX,h.clientY);var k=AS(g),E=k.boundingClientRect;return new z((h.clientX-E.left)/k.x-g.clientLeft,(h.clientY-E.top)/k.y-g.clientTop)}var zQ=Pe.linux&&Pe.chrome?window.devicePixelRatio:Pe.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function GR(h){return Pe.edge?h.wheelDeltaY/2:h.deltaY&&h.deltaMode===0?-h.deltaY/zQ:h.deltaY&&h.deltaMode===1?-h.deltaY*20:h.deltaY&&h.deltaMode===2?-h.deltaY*60:h.deltaX||h.deltaZ?0:h.wheelDelta?(h.wheelDeltaY||h.wheelDelta)/2:h.detail&&Math.abs(h.detail)<32765?-h.detail*20:h.detail?h.detail/-32765*60:0}function LS(h,g){var k=g.relatedTarget;if(!k)return!0;try{for(;k&&k!==h;)k=k.parentNode}catch{return!1}return k!==h}var UQ={__proto__:null,on:rt,off:Kt,stopPropagation:Zc,disableScrollPropagation:IS,disableClickPropagation:Jp,preventDefault:xn,stop:Jc,getPropagationPath:qR,getMousePosition:KR,getWheelDelta:GR,isExternalTarget:LS,addListener:rt,removeListener:Kt},ZR=W.extend({run:function(h,g,k,E){this.stop(),this._el=h,this._inProgress=!0,this._duration=k||.25,this._easeOutPower=1/Math.max(E||.5,.2),this._startPos=Gc(h),this._offset=g.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=B(this._animate,this),this._step()},_step:function(h){var g=+new Date-this._startTime,k=this._duration*1e3;g<k?this._runFrame(this._easeOut(g/k),h):(this._runFrame(1),this._complete())},_runFrame:function(h,g){var k=this._startPos.add(this._offset.multiplyBy(h));g&&k._round(),Ir(this._el,k),this.fire("step")},_complete:function(){R(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(h){return 1-Math.pow(1-h,this._easeOutPower)}}),wt=W.extend({options:{crs:He,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(h,g){g=v(this,g),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(h),this._initLayout(),this._onResize=a(this._onResize,this),this._initEvents(),g.maxBounds&&this.setMaxBounds(g.maxBounds),g.zoom!==void 0&&(this._zoom=this._limitZoom(g.zoom)),g.center&&g.zoom!==void 0&&this.setView(ae(g.center),g.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Wp&&Pe.any3d&&!Pe.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),rt(this._proxy,UR,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)}
vendor: 6,788 bytes, line 693
693,setView:function(h,g,k){if(g=g===void 0?this._zoom:this._limitZoom(g),h=this._limitCenter(ae(h),g,this.options.maxBounds),k=k||{},this._stop(),this._loaded&&!k.reset&&k!==!0){k.animate!==void 0&&(k.zoom=i({animate:k.animate},k.zoom),k.pan=i({animate:k.animate,duration:k.duration},k.pan));var E=this._zoom!==g?this._tryAnimatedZoom&&this._tryAnimatedZoom(h,g,k.zoom):this._tryAnimatedPan(h,k.pan);if(E)return clearTimeout(this._sizeTimer),this}return this._resetView(h,g,k.pan&&k.pan.noMoveStart),this},setZoom:function(h,g){return this._loaded?this.setView(this.getCenter(),h,{zoom:g}):(this._zoom=h,this)},zoomIn:function(h,g){return h=h||(Pe.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+h,g)},zoomOut:function(h,g){return h=h||(Pe.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-h,g)},setZoomAround:function(h,g,k){var E=this.getZoomScale(g),A=this.getSize().divideBy(2),I=h instanceof z?h:this.latLngToContainerPoint(h),K=I.subtract(A).multiplyBy(1-1/E),X=this.containerPointToLatLng(A.add(K));return this.setView(X,g,{zoom:k})},_getBoundsCenterZoom:function(h,g){g=g||{},h=h.getBounds?h.getBounds():te(h);var k=G(g.paddingTopLeft||g.padding||[0,0]),E=G(g.paddingBottomRight||g.padding||[0,0]),A=this.getBoundsZoom(h,!1,k.add(E));if(A=typeof g.maxZoom=="number"?Math.min(g.maxZoom,A):A,A===1/0)return{center:h.getCenter(),zoom:A};var I=E.subtract(k).divideBy(2),K=this.project(h.getSouthWest(),A),X=this.project(h.getNorthEast(),A),ee=this.unproject(K.add(X).divideBy(2).add(I),A);return{center:ee,zoom:A}},fitBounds:function(h,g){if(h=te(h),!h.isValid())throw new Error("Bounds are not valid.");var k=this._getBoundsCenterZoom(h,g);return this.setView(k.center,k.zoom,g)},fitWorld:function(h){return this.fitBounds([[-90,-180],[90,180]],h)},panTo:function(h,g){return this.setView(h,this._zoom,{pan:g})},panBy:function(h,g){if(h=G(h).round(),g=g||{},!h.x&&!h.y)return this.fire("moveend");if(g.animate!==!0&&!this.getSize().contains(h))return this._resetView(this.unproject(this.project(this.getCenter()).add(h)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ZR,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),g.noMoveStart||this.fire("movestart"),g.animate!==!1){ct(this._mapPane,"leaflet-pan-anim");var k=this._getMapPanePos().subtract(h).round();this._panAnim.run(this._mapPane,k,g.duration||.25,g.easeLinearity)}else this._rawPanBy(h),this.fire("move").fire("moveend");return this},flyTo:function(h,g,k){if(k=k||{},k.animate===!1||!Pe.any3d)return this.setView(h,g,k);this._stop();var E=this.project(this.getCenter()),A=this.project(h),I=this.getSize(),K=this._zoom;h=ae(h),g=g===void 0?K:g;var X=Math.max(I.x,I.y),ee=X*this.getZoomScale(K,g),he=A.distanceTo(E)||1,Se=1.42,qe=Se*Se;function mt(Lr){var dx=Lr?-1:1,Tee=Lr?ee:X,Aee=ee*ee-X*X+dx*qe*qe*he*he,Pee=2*Tee*qe*he,KS=Aee/Pee,OI=Math.sqrt(KS*KS+1)-KS,Mee=OI<1e-9?-18:Math.log(OI);return Mee}function Jn(Lr){return(Math.exp(Lr)-Math.exp(-Lr))/2}function sn(Lr){return(Math.exp(Lr)+Math.exp(-Lr))/2}function as(Lr){return Jn(Lr)/sn(Lr)}var gi=mt(0);function zd(Lr){return X*(sn(gi)/sn(gi+Se*Lr))}function Nee(Lr){return X*(sn(gi)*as(gi+Se*Lr)-Jn(gi))/qe}function Cee(Lr){return 1-Math.pow(1-Lr,1.5)}var Eee=Date.now(),CI=(mt(1)-gi)/Se,Oee=k.duration?1e3*k.duration:1e3*CI*.8;function EI(){var Lr=(Date.now()-Eee)/Oee,dx=Cee(Lr)*CI;Lr<=1?(this._flyToFrame=B(EI,this),this._move(this.unproject(E.add(A.subtract(E).multiplyBy(Nee(dx)/he)),K),this.getScaleZoom(X/zd(dx),K),{flyTo:!0})):this._move(h,g)._moveEnd(!0)}return this._moveStart(!0,k.noMoveStart),EI.call(this),this},flyToBounds:function(h,g){var k=this._getBoundsCenterZoom(h,g);return this.flyTo(k.center,k.zoom,g)},setMaxBounds:function(h){return h=te(h),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),h.isValid()?(this.options.maxBounds=h,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(h){var g=this.options.minZoom;return this.options.minZoom=h,this._loaded&&g!==h&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(h):this},setMaxZoom:function(h){var g=this.options.maxZoom;return this.options.maxZoom=h,this._loaded&&g!==h&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(h):this},panInsideBounds:function(h,g){this._enforcingBounds=!0;var k=this.getCenter(),E=this._limitCenter(k,this._zoom,te(h));return k.equals(E)||this.panTo(E,g),this._enforcingBounds=!1,this},panInside:function(h,g){g=g||{};var k=G(g.paddingTopLeft||g.padding||[0,0]),E=G(g.paddingBottomRight||g.padding||[0,0]),A=this.project(this.getCenter()),I=this.project(h),K=this.getPixelBounds(),X=U([K.min.add(k),K.max.subtract(E)]),ee=X.getSize();if(!X.contains(I)){this._enforcingBounds=!0;var he=I.subtract(X.getCenter()),Se=X.extend(I).getSize().subtract(ee);A.x+=he.x<0?-Se.x:Se.x,A.y+=he.y<0?-Se.y:Se.y,this.panTo(this.unproject(A),g),this._enforcingBounds=!1}return this},invalidateSize:function(h){if(!this._loaded)return this;h=i({animate:!1,pan:!0},h===!0?{animate:!0}:h);var g=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var k=this.getSize(),E=g.divideBy(2).round(),A=k.divideBy(2).round(),I=E.subtract(A);return!I.x&&!I.y?this:(h.animate&&h.pan?this.panBy(I):(h.pan&&this._rawPanBy(I),this.fire("move"),h.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:g,newSize:k}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(h){if(h=this._locateOptions=i({timeout:1e4,watch:!1},h),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var g=a(this._handleGeolocationResponse,this),k=a(this._handleGeolocationError,this);return h.watch?this._locationWatchId=navigator.geolocation.watchPosition(g,k,h):navigator.geolocation.getCurrentPosition(g,k,h),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(h){if(this._container._leaflet_id){var g=h.code,k=h.message||(g===1?"permission denied":g===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:g,message:"Geolocation error: "+k+"."})}},_handleGeolocationResponse:function(h){if(this._container._leaflet_id){var g=h.coords.latitude,k=h.coords.longitude,E=new re(g,k),A=E.toBounds(h.coords.accuracy*2),I=this._locateOptions;
693if(I.setView){var K=this.getBoundsZoom(A);this.setView(E,I.maxZoom?Math.min(K,I.maxZoom):K)}var X={latlng:E,bounds:A,timestamp:h.timestamp};for(var ee in h.coords)typeof h.coords[ee]=="number"&&(X[ee]=h.coords[ee]);this.fire("locationfound",X)}},addHandler:function(h,g){if(!g)return this;var k=this[h]=new g(this);return this._handlers.push(k),this.options[h]&&k.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),pr(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(R(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var h;for(h in this._layers)this._layers[h].remove();for(h in this._panes)pr(this._panes[h]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(h,g){var k="leaflet-pane"+(h?" leaflet-"+h.replace("Pane","")+"-pane":""),E=Ot("div",k,g||this._mapPane);return h&&(this._panes[h]=E),E},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var h=this.getPixelBounds(),g=this.unproject(h.getBottomLeft()),k=this.unproject(h.getTopRight());return new J(g,k)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(h,g,k){h=te(h),k=G(k||[0,0]);var E=this.getZoom()||0,A=this.getMinZoom(),I=this.getMaxZoom(),K=h.getNorthWest(),X=h.getSouthEast(),ee=this.getSize().subtract(k),he=U(this.project(X,E),this.project(K,E)).getSize(),Se=Pe.any3d?this.options.zoomSnap:1,qe=ee.x/he.x,mt=ee.y/he.y,Jn=g?Math.max(qe,mt):Math.min(qe,mt);return E=this.getScaleZoom(Jn,E),Se&&(E=Math.round(E/(Se/100))*(Se/100),E=g?Math.ceil(E/Se)*Se:Math.floor(E/Se)*Se),Math.max(A,Math.min(I,E))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new z(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(h,g){var k=this._getTopLeftPoint(h,g);return new Y(k,k.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(h){return this.options.crs.getProjectedBounds(h===void 0?this.getZoom():h)},getPane:function(h){return typeof h=="string"?this._panes[h]:h},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(h,g){var k=this.options.crs;return g=g===void 0?this._zoom:g,k.scale(h)/k.scale(g)},getScaleZoom:function(h,g){var k=this.options.crs;g=g===void 0?this._zoom:g;var E=k.zoom(h*k.scale(g));return isNaN(E)?1/0:E},project:function(h,g){return g=g===void 0?this._zoom:g,this.options.crs.latLngToPoint(ae(h),g)},unproject:function(h,g){return g=g===void 0?this._zoom:g,this.options.crs.pointToLatLng(G(h),g)},layerPointToLatLng:function(h){var g=G(h).add(this.getPixelOrigin());return this.unproject(g)},latLngToLayerPoint:function(h){var g=this.project(ae(h))._round();return g._subtract(this.getPixelOrigin())},wrapLatLng:function(h){return this.options.crs.wrapLatLng(ae(h))},wrapLatLngBounds:function(h){return this.options.crs.wrapLatLngBounds(te(h))},distance:function(h,g){return this.options.crs.distance(ae(h),ae(g))},containerPointToLayerPoint:function(h){return G(h).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(h){return G(h).add(this._getMapPanePos())},containerPointToLatLng:function(h){var g=this.containerPointToLayerPoint(G(h));return this.layerPointToLatLng(g)},latLngToContainerPoint:function(h){return this.layerPointToContainerPoint(this.latLngToLayerPoint(ae(h)))},mouseEventToContainerPoint:function(h){return KR(h,this._container)},mouseEventToLayerPoint:function(h){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(h))},mouseEventToLatLng:function(h){return this.layerPointToLatLng(this.mouseEventToLayerPoint(h))},_initContainer:function(h){var g=this._container=HR(h);if(g){if(g._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");rt(g,"scroll",this._onScroll,this),this._containerId=c(g)},_initLayout:function(){var h=this._container;this._fadeAnimated=this.options.fadeAnimation&&Pe.any3d,ct(h,"leaflet-container"+(Pe.touch?" leaflet-touch":"")+(Pe.retina?" leaflet-retina":"")+(Pe.ielt9?" leaflet-oldie":"")+(Pe.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var g=qp(h,"position");g!=="absolute"&&g!=="relative"&&g!=="fixed"&&g!=="sticky"&&(h.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var h=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Ir(this._mapPane,new z(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ct(h.markerPane,"leaflet-zoom-hide"),ct(h.shadowPane,"leaflet-zoom-hide"))},_resetView:function(h,g,k){Ir(this._mapPane,new z(0,0));var E=!this._loaded;this._loaded=!0,g=this._limitZoom(g),this.fire("viewprereset");var A=this._zoom!==g;this._moveStart(A,k)._move(h,g)._moveEnd(A),this.fire("viewreset"),E&&this.fire("load")},_moveStart:function(h,g){return h&&this.fire("zoomstart"),g||this.fire("movestart"),this},_move:function(h,g,k,E){g===void 0&&(g=this._zoom);var A=this._zoom!==g;return this._zoom=g,this._lastCenter=h,this._pixelOrigin=this._getNewPixelOrigin(h
693),E?k&&k.pinch&&this.fire("zoom",k):((A||k&&k.pinch)&&this.fire("zoom",k),this.fire("move",k)),this},_moveEnd:function(h){return h&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return R(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(h){Ir(this._mapPane,this._getMapPanePos().subtract(h))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(h){this._targets={},this._targets[c(this._container)]=this;var g=h?Kt:rt;g(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&g(window,"resize",this._onResize,this),Pe.any3d&&this.options.transform3DLimit&&(h?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){R(this._resizeRequest),this._resizeRequest=B(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var h=this._getMapPanePos();Math.max(Math.abs(h.x),Math.abs(h.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(h,g){for(var k=[],E,A=g==="mouseout"||g==="mouseover",I=h.target||h.srcElement,K=!1;I;){if(E=this._targets[c(I)],E&&(g==="click"||g==="preclick")&&this._draggableMoved(E)){K=!0;break}if(E&&E.listens(g,!0)&&(A&&!LS(I,h)||(k.push(E),A))||I===this._container)break;I=I.parentNode}return!k.length&&!K&&!A&&this.listens(g,!0)&&(k=[this]),k},_isClickDisabled:function(h){for(;h&&h!==this._container;){if(h._leaflet_disable_click)return!0;h=h.parentNode}},_handleDOMEvent:function(h){var g=h.target||h.srcElement;if(!(!this._loaded||g._leaflet_disable_events||h.type==="click"&&this._isClickDisabled(g))){var k=h.type;k==="mousedown"&&TS(g),this._fireDOMEvent(h,k)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(h,g,k){if(h.type==="click"){var E=i({},h);E.type="preclick",this._fireDOMEvent(E,E.type,k)}var A=this._findEventTargets(h,g);if(k){for(var I=[],K=0;K<k.length;K++)k[K].listens(g,!0)&&I.push(k[K]);A=I.concat(A)}if(A.length){g==="contextmenu"&&xn(h);var X=A[0],ee={originalEvent:h};if(h.type!=="keypress"&&h.type!=="keydown"&&h.type!=="keyup"){var he=X.getLatLng&&(!X._radius||X._radius<=10);ee.containerPoint=he?this.latLngToContainerPoint(X.getLatLng()):this.mouseEventToContainerPoint(h),ee.layerPoint=this.containerPointToLayerPoint(ee.containerPoint),ee.latlng=he?X.getLatLng():this.layerPointToLatLng(ee.layerPoint)}for(K=0;K<A.length;K++)if(A[K].fire(g,ee,!0),ee.originalEvent._stopped||A[K].options.bubblingMouseEvents===!1&&N(this._mouseEvents,g)!==-1)return}},_draggableMoved:function(h){return h=h.dragging&&h.dragging.enabled()?h:this,h.dragging&&h.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var h=0,g=this._handlers.length;h<g;h++)this._handlers[h].disable()},whenReady:function(h,g){return this._loaded?h.call(g||this,{target:this}):this.on("load",h,g),this},_getMapPanePos:function(){return Gc(this._mapPane)||new z(0,0)},_moved:function(){var h=this._getMapPanePos();return h&&!h.equals([0,0])},_getTopLeftPoint:function(h,g){var k=h&&g!==void 0?this._getNewPixelOrigin(h,g):this.getPixelOrigin();return k.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(h,g){var k=this.getSize()._divideBy(2);return this.project(h,g)._subtract(k)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(h,g,k){var E=this._getNewPixelOrigin(k,g);return this.project(h,g)._subtract(E)},_latLngBoundsToNewLayerBounds:function(h,g,k){var E=this._getNewPixelOrigin(k,g);
vendor: 18,714 bytes, line 693
693return U([this.project(h.getSouthWest(),g)._subtract(E),this.project(h.getNorthWest(),g)._subtract(E),this.project(h.getSouthEast(),g)._subtract(E),this.project(h.getNorthEast(),g)._subtract(E)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(h){return this.latLngToLayerPoint(h).subtract(this._getCenterLayerPoint())},_limitCenter:function(h,g,k){if(!k)return h;var E=this.project(h,g),A=this.getSize().divideBy(2),I=new Y(E.subtract(A),E.add(A)),K=this._getBoundsOffset(I,k,g);return Math.abs(K.x)<=1&&Math.abs(K.y)<=1?h:this.unproject(E.add(K),g)},_limitOffset:function(h,g){if(!g)return h;var k=this.getPixelBounds(),E=new Y(k.min.add(h),k.max.add(h));return h.add(this._getBoundsOffset(E,g))},_getBoundsOffset:function(h,g,k){var E=U(this.project(g.getNorthEast(),k),this.project(g.getSouthWest(),k)),A=E.min.subtract(h.min),I=E.max.subtract(h.max),K=this._rebound(A.x,-I.x),X=this._rebound(A.y,-I.y);return new z(K,X)},_rebound:function(h,g){return h+g>0?Math.round(h-g)/2:Math.max(0,Math.ceil(h))-Math.max(0,Math.floor(g))},_limitZoom:function(h){var g=this.getMinZoom(),k=this.getMaxZoom(),E=Pe.any3d?this.options.zoomSnap:1;return E&&(h=Math.round(h/E)*E),Math.max(g,Math.min(k,h))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Tr(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(h,g){var k=this._getCenterOffset(h)._trunc();return(g&&g.animate)!==!0&&!this.getSize().contains(k)?!1:(this.panBy(k,g),!0)},_createAnimProxy:function(){var h=this._proxy=Ot("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(h),this.on("zoomanim",function(g){var k=kS,E=this._proxy.style[k];Kc(this._proxy,this.project(g.center,g.zoom),this.getZoomScale(g.zoom,1)),E===this._proxy.style[k]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){pr(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var h=this.getCenter(),g=this.getZoom();Kc(this._proxy,this.project(h,g),this.getZoomScale(g,1))},_catchTransitionEnd:function(h){this._animatingZoom&&h.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(h,g,k){if(this._animatingZoom)return!0;if(k=k||{},!this._zoomAnimated||k.animate===!1||this._nothingToAnimate()||Math.abs(g-this._zoom)>this.options.zoomAnimationThreshold)return!1;var E=this.getZoomScale(g),A=this._getCenterOffset(h)._divideBy(1-1/E);return k.animate!==!0&&!this.getSize().contains(A)?!1:(B(function(){this._moveStart(!0,k.noMoveStart||!1)._animateZoom(h,g,!0)},this),!0)},_animateZoom:function(h,g,k,E){this._mapPane&&(k&&(this._animatingZoom=!0,this._animateToCenter=h,this._animateToZoom=g,ct(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:h,zoom:g,noUpdate:E}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Tr(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function HQ(h,g){return new wt(h,g)}var Vs=F.extend({options:{position:"topright"},initialize:function(h){v(this,h)},getPosition:function(){return this.options.position},setPosition:function(h){var g=this._map;return g&&g.removeControl(this),this.options.position=h,g&&g.addControl(this),this},getContainer:function(){return this._container},addTo:function(h){this.remove(),this._map=h;var g=this._container=this.onAdd(h),k=this.getPosition(),E=h._controlCorners[k];return ct(g,"leaflet-control"),k.indexOf("bottom")!==-1?E.insertBefore(g,E.firstChild):E.appendChild(g),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(pr(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(h){this._map&&h&&h.screenX>0&&h.screenY>0&&this._map.getContainer().focus()}}),Yp=function(h){return new Vs(h)};wt.include({addControl:function(h){return h.addTo(this),this},removeControl:function(h){return h.remove(),this},_initControlPos:function(){var h=this._controlCorners={},g="leaflet-",k=this._controlContainer=Ot("div",g+"control-container",this._container);function E(A,I){var K=g+A+" "+g+I;h[A+I]=Ot("div",K,k)}E("top","left"),E("top","right"),E("bottom","left"),E("bottom","right")},_clearControlPos:function(){for(var h in this._controlCorners)pr(this._controlCorners[h]);pr(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var JR=Vs.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(h,g,k,E){return k<E?-1:E<k?1:0}},initialize:function(h,g,k){v(this,k),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var E in h)this._addLayer(h[E],E);for(E in g)this._addLayer(g[E],E,!0)},onAdd:function(h){this._initLayout(),this._update(),this._map=h,h.on("zoomend",this._checkDisabledLayers,this);for(var g=0;g<this._layers.length;g++)this._layers[g].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(h){return Vs.prototype.addTo.call(this,h),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var h=0;h<this._layers.length;h++)this._layers[h].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(h,g){return this._addLayer(h,g),this._map?this._update():this},addOverlay:function(h,g){return this._addLayer(h,g,!0),this._map?this._update():this},removeLayer:function(h){h.off("add remove",this._onLayerChange,this);var g=this._getLayer(c(h));return g&&this._layers.splice(this._layers.indexOf(g),1),this._map?this._update():this},expand:function(){ct(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var h=this._map.getSize().y-(this._container.offsetTop+50);return h<this._section.clientHeight?(ct(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=h+"px"):Tr(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return Tr(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var h="leaflet-control-layers",g=this._container=Ot("div",h),k=this.options.collapsed;g.setAttribute("aria-haspopup",!0),Jp(g),IS(g);var E=this._section=Ot("section",h+"-list");k&&(this._map.on("click",this.collapse,this),rt(g,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var A=this._layersLink=Ot("a",h+"-toggle",g);A.href="#",A.title="Layers",A.setAttribute("role","button"),rt(A,{keydown:function(I){I.keyCode===13&&this._expandSafely()},click:function(I){xn(I),this._expandSafely()}},this),k||this.expand(),this._baseLayersList=Ot("div",h+"-base",E),this._separator=Ot("div",h+"-separator",E),this._overlaysList=Ot("div",h+"-overlays",E),g.appendChild(E)},_getLayer:function(h){for(var g=0;g<this._layers.length;g++)if(this._layers[g]&&c(this._layers[g].layer)===h)return this._layers[g]},_addLayer:function(h,g,k){this._map&&h.on("add remove",this._onLayerChange,this),this._layers.push({layer:h,name:g,overlay:k}),this.options.sortLayers&&this._layers.sort(a(function(E,A){return this.options.sortFunction(E.layer,A.layer,E.name,A.name)},this)),this.options.autoZIndex&&h.setZIndex&&(this._lastZIndex++,h.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Zy(this._baseLayersList),Zy(this._overlaysList),this._layerControlInputs=[];var h,g,k,E,A=0;for(k=0;k<this._layers.length;k++)E=this._layers[k],this._addItem(E),g=g||E.overlay,h=h||!E.overlay,A+=E.overlay?0:1;return this.options.hideSingleBase&&(h=h&&A>1,this._baseLayersList.style.display=h?"":"none"),this._separator.style.display=g&&h?"":"none",this},_onLayerChange:function(h){this._handlingClick||this._update();var g=this._getLayer(c(h.target)),k=g.overlay?h.type==="add"?"overlayadd":"overlayremove":h.type==="add"?"baselayerchange":null;k&&this._map.fire(k,g)},_createRadioElement:function(h,g){var k='<input type="radio" class="leaflet-control-layers-selector" name="'+h+'"'+(g?' checked="checked"':"")+"/>",E=document.createElement("div");return E.innerHTML=k,E.firstChild},_addItem:function(h){var g=document.createElement("label"),k=this._map.hasLayer(h.layer),E;h.overlay?(E=document.createElement("input"),E.type="checkbox",E.className="leaflet-control-layers-selector",E.defaultChecked=k):E=this._createRadioElement("leaflet-base-layers_"+c(this),k),this._layerControlInputs.push(E),E.layerId=c(h.layer),rt(E,"click",this._onInputClick,this);var A=document.createElement("span");A.innerHTML=" "+h.name;var I=document.createElement("span");g.appendChild(I),I.appendChild(E),I.appendChild(A);var K=h.overlay?this._overlaysList:this._baseLayersList;return K.appendChild(g),this._checkDisabledLayers(),g},_onInputClick:function(){if(!this._preventClick){var h=this._layerControlInputs,g,k,E=[],A=[];this._handlingClick=!0;for(var I=h.length-1;I>=0;I--)g=h[I],k=this._getLayer(g.layerId).layer,g.checked?E.push(k):g.checked||A.push(k);for(I=0;I<A.length;I++)this._map.hasLayer(A[I])&&this._map.removeLayer(A[I]);for(I=0;I<E.length;I++)this._map.hasLayer(E[I])||this._map.addLayer(E[I]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var h=this._layerControlInputs,g,k,E=this._map.getZoom(),A=h.length-1;A>=0;A--)g=h[A],k=this._getLayer(g.layerId).layer,g.disabled=k.options.minZoom!==void 0&&E<k.options.minZoom||k.options.maxZoom!==void 0&&E>k.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var h=this._section;this._preventClick=!0,rt(h,"click",xn),this.expand();var g=this;setTimeout(function(){Kt(h,"click",xn),g._preventClick=!1})}}),VQ=function(h,g,k){return new JR(h,g,k)},$S=Vs.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(h){var g="leaflet-control-zoom",k=Ot("div",g+" leaflet-bar"),E=this.options;return this._zoomInButton=this._createButton(E.zoomInText,E.zoomInTitle,g+"-in",k,this._zoomIn),this._zoomOutButton=this._createButton(E.zoomOutText,E.zoomOutTitle,g+"-out",k,this._zoomOut),this._updateDisabled(),h.on("zoomend zoomlevelschange",this._updateDisabled,this),k},onRemove:function(h){h.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(h){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(h.shiftKey?3:1))},_zoomOut:function(h){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(h.shiftKey?3:1))},_createButton:function(h,g,k,E,A){var I=Ot("a",k,E);return I.innerHTML=h,I.href="#",I.title=g,I.setAttribute("role","button"),I.setAttribute("aria-label",g),Jp(I),rt(I,"click",Jc),rt(I,"click",A,this),rt(I,"click",this._refocusOnMap,this),I},_updateDisabled:function(){var h=this._map,g="leaflet-disabled";Tr(this._zoomInButton,g),Tr(this._zoomOutButton,g),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||h._zoom===h.getMinZoom())&&(ct(this._zoomOutButton,g),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||h._zoom===h.getMaxZoom())&&(ct(this._zoomInButton,g),this._zoomInButton.setAttribute("aria-disabled","true"))}});wt.mergeOptions({zoomControl:!0}),wt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new $S,this.addControl(this.zoomControl))});var WQ=function(h){return new $S(h)},YR=Vs.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(h){var g="leaflet-control-scale",k=Ot("div",g),E=this.options;return this._addScales(E,g+"-line",k),h.on(E.updateWhenIdle?"moveend":"move",this._update,this),h.whenReady(this._update,this),k},onRemove:function(h){h.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(h,g,k){h.metric&&(this._mScale=Ot("div",g,k)),h.imperial&&(this._iScale=Ot("div",g,k))},_update:function(){var h=this._map,g=h.getSize().y/2,k=h.distance(h.containerPointToLatLng([0,g]),h.containerPointToLatLng([this.options.maxWidth,g]));this._updateScales(k)},_updateScales:function(h){this.options.metric&&h&&this._updateMetric(h),this.options.imperial&&h&&this._updateImperial(h)},_updateMetric:function(h){var g=this._getRoundNum(h),k=g<1e3?g+" m":g/1e3+" km";this._updateScale(this._mScale,k,g/h)},_updateImperial:function(h){var g=h*3.2808399,k,E,A;g>5280?(k=g/5280,E=this._getRoundNum(k),this._updateScale(this._iScale,E+" mi",E/k)):(A=this._getRoundNum(g),this._updateScale(this._iScale,A+" ft",A/g))},_updateScale:function(h,g,k){h.style.width=Math.round(this.options.maxWidth*k)+"px",h.innerHTML=g},_getRoundNum:function(h){var g=Math.pow(10,(Math.floor(h)+"").length-1),k=h/g;return k=k>=10?10:k>=5?5:k>=3?3:k>=2?2:1,g*k}}),qQ=function(h){return new YR(h)},KQ='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',DS=Vs.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Pe.inlineSvg?KQ+" ":"")+"Leaflet</a>"},initialize:function(h){v(this,h),this._attributions={}},onAdd:function(h){h.attributionControl=this,this._container=Ot("div","leaflet-control-attribution"),Jp(this._container);for(var g in h._layers)h._layers[g].getAttribution&&this.addAttribution(h._layers[g].getAttribution());return this._update(),h.on("layeradd",this._addAttribution,this),this._container},onRemove:function(h){h.off("layeradd",this._addAttribution,this)},_addAttribution:function(h){h.layer.getAttribution&&(this.addAttribution(h.layer.getAttribution()),h.layer.once("remove",function(){this.removeAttribution(h.layer.getAttribution())},this))},setPrefix:function(h){return this.options.prefix=h,this._update(),this},addAttribution:function(h){return h?(this._attributions[h]||(this._attributions[h]=0),this._attributions[h]++,this._update(),this):this},removeAttribution:function(h){return h?(this._attributions[h]&&(this._attributions[h]--,this._update()),this):this},_update:function(){if(this._map){var h=[];for(var g in this._attributions)this._attributions[g]&&h.push(g);var k=[];this.options.prefix&&k.push(this.options.prefix),h.length&&k.push(h.join(", ")),this._container.innerHTML=k.join(' <span aria-hidden="true">|</span> ')}}});wt.mergeOptions({attributionControl:!0}),wt.addInitHook(function(){this.options.attributionControl&&new DS().addTo(this)});var GQ=function(h){return new DS(h)};Vs.Layers=JR,Vs.Zoom=$S,Vs.Scale=YR,Vs.Attribution=DS,Yp.layers=VQ,Yp.zoom=WQ,Yp.scale=qQ,Yp.attribution=GQ;var wa=F.extend({initialize:function(h){this._map=h},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});wa.addTo=function(h,g){return h.addHandler(g,this),this};var ZQ={Events:V},XR=Pe.touch?"touchstart mousedown":"mousedown",ol=W.extend({options:{clickTolerance:3},initialize:function(h,g,k,E){v(this,E),this._element=h,this._dragStartTarget=g||h,this._preventOutline=k},enable:function(){this._enabled||(rt(this._dragStartTarget,XR,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ol._dragging===this&&this.finishDrag(!0),Kt(this._dragStartTarget,XR,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(h){if(this._enabled&&(this._moved=!1,!SS(this._element,"leaflet-zoom-anim"))){if(h.touches&&h.touches.length!==1){ol._dragging===this&&this.finishDrag();return}if(!(ol._dragging||h.shiftKey||h.which!==1&&h.button!==1&&!h.touches)&&(ol._dragging=this,this._preventOutline&&TS(this._element),CS(),Kp(),!this._moving)){this.fire("down");var g=h.touches?h.touches[0]:h,k=VR(this._element);this._startPoint=new z(g.clientX,g.clientY),this._startPos=Gc(this._element),this._parentScale=AS(k);var E=h.type==="mousedown";rt(document,E?"mousemove":"touchmove",this._onMove,this),rt(document,E?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(h){if(this._enabled){if(h.touches&&h.touches.length>1){this._moved=!0;return}var g=h.touches&&h.touches.length===1?h.touches[0]:h,k=new z(g.clientX,g.clientY)._subtract(this._startPoint);!k.x&&!k.y||Math.abs(k.x)+Math.abs(k.y)<this.options.clickTolerance||(k.x/=this._parentScale.x,k.y/=this._parentScale.y,xn(h),this._moved||(this.fire("dragstart"),this._moved=!0,ct(document.body,"leaflet-dragging"),this._lastTarget=h.target||h.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),ct(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(k),this._moving=!0,this._lastEvent=h,this._updatePosition())}},_updatePosition:function(){var h={originalEvent:this._lastEvent};this.fire("predrag",h),Ir(this._element,this._newPos),this.fire("drag",h)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(h){Tr(document.body,"leaflet-dragging"),this._lastTarget&&(Tr(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Kt(document,"mousemove touchmove",this._onMove,this),Kt(document,"mouseup touchend touchcancel",this._onUp,this),ES(),Gp();var g=this._moved&&this._moving;this._moving=!1,ol._dragging=!1,g&&this.fire("dragend",{noInertia:h,distance:this._newPos.distanceTo(this._startPos)})}});function QR(h,g,k){var E,A=[1,4,2,8],I,K,X,ee,he,Se,qe,mt;for(I=0,Se=h.length;I<Se;I++)h[I]._code=Yc(h[I],g);for(X=0;X<4;X++){for(qe=A[X],E=[],I=0,Se=h.length,K=Se-1;I<Se;
693K=I++)ee=h[I],he=h[K],ee._code&qe?he._code&qe||(mt=ex(he,ee,qe,g,k),mt._code=Yc(mt,g),E.push(mt)):(he._code&qe&&(mt=ex(he,ee,qe,g,k),mt._code=Yc(mt,g),E.push(mt)),E.push(ee));h=E}return h}function eI(h,g){var k,E,A,I,K,X,ee,he,Se;if(!h||h.length===0)throw new Error("latlngs not passed");ss(h)||(console.warn("latlngs are not flat! Only the first ring will be used"),h=h[0]);var qe=ae([0,0]),mt=te(h),Jn=mt.getNorthWest().distanceTo(mt.getSouthWest())*mt.getNorthEast().distanceTo(mt.getNorthWest());Jn<1700&&(qe=BS(h));var sn=h.length,as=[];for(k=0;k<sn;k++){var gi=ae(h[k]);as.push(g.project(ae([gi.lat-qe.lat,gi.lng-qe.lng])))}for(X=ee=he=0,k=0,E=sn-1;k<sn;E=k++)A=as[k],I=as[E],K=A.y*I.x-I.y*A.x,ee+=(A.x+I.x)*K,he+=(A.y+I.y)*K,X+=K*3;X===0?Se=as[0]:Se=[ee/X,he/X];var zd=g.unproject(G(Se));return ae([zd.lat+qe.lat,zd.lng+qe.lng])}function BS(h){for(var g=0,k=0,E=0,A=0;A<h.length;A++){var I=ae(h[A]);g+=I.lat,k+=I.lng,E++}return ae([g/E,k/E])}var JQ={__proto__:null,clipPolygon:QR,polygonCenter:eI,centroid:BS};function tI(h,g){if(!g||!h.length)return h.slice();var k=g*g;return h=QQ(h,k),h=XQ(h,k),h}function rI(h,g,k){return Math.sqrt(Xp(h,g,k,!0))}function YQ(h,g,k){return Xp(h,g,k)}function XQ(h,g){var k=h.length,E=typeof Uint8Array<"u"?Uint8Array:Array,A=new E(k);A[0]=A[k-1]=1,FS(h,A,g,0,k-1);var I,K=[];for(I=0;I<k;I++)A[I]&&K.push(h[I]);return K}function FS(h,g,k,E,A){var I=0,K,X,ee;for(X=E+1;X<=A-1;X++)ee=Xp(h[X],h[E],h[A],!0),ee>I&&(K=X,I=ee);I>k&&(g[K]=1,FS(h,g,k,E,K),FS(h,g,k,K,A))}function QQ(h,g){for(var k=[h[0]],E=1,A=0,I=h.length;E<I;E++)eee(h[E],h[A])>g&&(k.push(h[E]),A=E);return A<I-1&&k.push(h[I-1]),k}var nI;function iI(h,g,k,E,A){var I=E?nI:Yc(h,k),K=Yc(g,k),X,ee,he;for(nI=K;;){if(!(I|K))return[h,g];if(I&K)return!1;X=I||K,ee=ex(h,g,X,k,A),he=Yc(ee,k),X===I?(h=ee,I=he):(g=ee,K=he)}}function ex(h,g,k,E,A){var I=g.x-h.x,K=g.y-h.y,X=E.min,ee=E.max,he,Se;return k&8?(he=h.x+I*(ee.y-h.y)/K,Se=ee.y):k&4?(he=h.x+I*(X.y-h.y)/K,Se=X.y):k&2?(he=ee.x,Se=h.y+K*(ee.x-h.x)/I):k&1&&(he=X.x,Se=h.y+K*(X.x-h.x)/I),new z(he,Se,A)}function Yc(h,g){var k=0;return h.x<g.min.x?k|=1:h.x>g.max.x&&(k|=2),h.y<g.min.y?k|=4:h.y>g.max.y&&(k|=8),k}function eee(h,g){var k=g.x-h.x,E=g.y-h.y;return k*k+E*E}function Xp(h,g,k,E){var A=g.x,I=g.y,K=k.x-A,X=k.y-I,ee=K*K+X*X,he;return ee>0&&(he=((h.x-A)*K+(h.y-I)*X)/ee,he>1?(A=k.x,I=k.y):he>0&&(A+=K*he,I+=X*he)),K=h.x-A,X=h.y-I,E?K*K+X*X:new z(A,I)}function ss(h){return!S(h[0])||typeof h[0][0]!="object"&&typeof h[0][0]<"u"}function sI(h){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),ss(h)}function aI(h,g){var k,E,A,I,K,X,ee,he;if(!h||h.length===0)throw new Error("latlngs not passed");ss(h)||(console.warn("latlngs are not flat! Only the first ring will be used"),h=h[0]);var Se=ae([0,0]),qe=te(h),mt=qe.getNorthWest().distanceTo(qe.getSouthWest
vendor: 4,240 bytes, line 693
693())*qe.getNorthEast().distanceTo(qe.getNorthWest());mt<1700&&(Se=BS(h));var Jn=h.length,sn=[];for(k=0;k<Jn;k++){var as=ae(h[k]);sn.push(g.project(ae([as.lat-Se.lat,as.lng-Se.lng])))}for(k=0,E=0;k<Jn-1;k++)E+=sn[k].distanceTo(sn[k+1])/2;if(E===0)he=sn[0];else for(k=0,I=0;k<Jn-1;k++)if(K=sn[k],X=sn[k+1],A=K.distanceTo(X),I+=A,I>E){ee=(I-E)/A,he=[X.x-ee*(X.x-K.x),X.y-ee*(X.y-K.y)];break}var gi=g.unproject(G(he));return ae([gi.lat+Se.lat,gi.lng+Se.lng])}var tee={__proto__:null,simplify:tI,pointToSegmentDistance:rI,closestPointOnSegment:YQ,clipSegment:iI,_getEdgeIntersection:ex,_getBitCode:Yc,_sqClosestPointOnSegment:Xp,isFlat:ss,_flat:sI,polylineCenter:aI},zS={project:function(h){return new z(h.lng,h.lat)},unproject:function(h){return new re(h.y,h.x)},bounds:new Y([-180,-90],[180,90])},US={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Y([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(h){var g=Math.PI/180,k=this.R,E=h.lat*g,A=this.R_MINOR/k,I=Math.sqrt(1-A*A),K=I*Math.sin(E),X=Math.tan(Math.PI/4-E/2)/Math.pow((1-K)/(1+K),I/2);return E=-k*Math.log(Math.max(X,1e-10)),new z(h.lng*g*k,E)},unproject:function(h){for(var g=180/Math.PI,k=this.R,E=this.R_MINOR/k,A=Math.sqrt(1-E*E),I=Math.exp(-h.y/k),K=Math.PI/2-2*Math.atan(I),X=0,ee=.1,he;X<15&&Math.abs(ee)>1e-7;X++)he=A*Math.sin(K),he=Math.pow((1-he)/(1+he),A/2),ee=Math.PI/2-2*Math.atan(I*he)-K,K+=ee;return new re(K*g,h.x*g/k)}},ree={__proto__:null,LonLat:zS,Mercator:US,SphericalMercator:ue},nee=i({},_e,{code:"EPSG:3395",projection:US,transformation:function(){var h=.5/(Math.PI*US.R);return Q(h,.5,-h,.5)}()}),oI=i({},_e,{code:"EPSG:4326",projection:zS,transformation:Q(1/180,1,-1/180,.5)}),iee=i({},oe,{projection:zS,transformation:Q(1,0,-1,0),scale:function(h){return Math.pow(2,h)},zoom:function(h){return Math.log(h)/Math.LN2},distance:function(h,g){var k=g.lng-h.lng,E=g.lat-h.lat;return Math.sqrt(k*k+E*E)},infinite:!0});oe.Earth=_e,oe.EPSG3395=nee,oe.EPSG3857=He,oe.EPSG900913=Ie,oe.EPSG4326=oI,oe.Simple=iee;var Ws=W.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(h){return h.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(h){return h&&h.removeLayer(this),this},getPane:function(h){return this._map.getPane(h?this.options[h]||h:this.options.pane)},addInteractiveTarget:function(h){return this._map._targets[c(h)]=this,this},removeInteractiveTarget:function(h){return delete this._map._targets[c(h)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(h){var g=h.target;if(g.hasLayer(this)){if(this._map=g,this._zoomAnimated=g._zoomAnimated,this.getEvents){var k=this.getEvents();g.on(k,this),this.once("remove",function(){g.off(k,this)},this)}this.onAdd(g),this.fire("add"),g.fire("layeradd",{layer:this})}}});wt.include({addLayer:function(h){if(!h._layerAdd)throw new Error("The provided object is not a Layer.");var g=c(h);return this._layers[g]?this:(this._layers[g]=h,h._mapToAdd=this,h.beforeAdd&&h.beforeAdd(this),this.whenReady(h._layerAdd,h),this)},removeLayer:function(h){var g=c(h);return this._layers[g]?(this._loaded&&h.onRemove(this),delete this._layers[g],this._loaded&&(this.fire("layerremove",{layer:h}),h.fire("remove")),h._map=h._mapToAdd=null,this):this},hasLayer:function(h){return c(h)in this._layers},eachLayer:function(h,g){for(var k in this._layers)h.call(g,this._layers[k]);return this},_addLayers:function(h){h=h?S(h)?h:[h]:[];for(var g=0,k=h.length;g<k;g++)this.addLayer(h[g])},_addZoomLimit:function(h){(!isNaN(h.options.maxZoom)||!isNaN(h.options.minZoom))&&(this._zoomBoundLayers[c(h)]=h,this._updateZoomLevels())},_removeZoomLimit:function(h){var g=c(h);this._zoomBoundLayers[g]&&(delete this._zoomBoundLayers[g],this._updateZoomLevels())},_updateZoomLevels:function(){var h=1/0,g=-1/0,k=this._getZoomSpan();for(var E in this._zoomBoundLayers){var A=this._zoomBoundLayers[E].options;h=A.minZoom===void 0?h:Math.min(h,A.minZoom),g=A.maxZoom===void 0?g:Math.max(g,A.maxZoom)}this._layersMaxZoom=g===-1/0?void 0:g,this._layersMinZoom=h===1/0?void 0:h,k!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZo
vendor: 12,544 bytes, line 693
693om&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Ld=Ws.extend({initialize:function(h,g){v(this,g),this._layers={};var k,E;if(h)for(k=0,E=h.length;k<E;k++)this.addLayer(h[k])},addLayer:function(h){var g=this.getLayerId(h);return this._layers[g]=h,this._map&&this._map.addLayer(h),this},removeLayer:function(h){var g=h in this._layers?h:this.getLayerId(h);return this._map&&this._layers[g]&&this._map.removeLayer(this._layers[g]),delete this._layers[g],this},hasLayer:function(h){var g=typeof h=="number"?h:this.getLayerId(h);return g in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(h){var g=Array.prototype.slice.call(arguments,1),k,E;for(k in this._layers)E=this._layers[k],E[h]&&E[h].apply(E,g);return this},onAdd:function(h){this.eachLayer(h.addLayer,h)},onRemove:function(h){this.eachLayer(h.removeLayer,h)},eachLayer:function(h,g){for(var k in this._layers)h.call(g,this._layers[k]);return this},getLayer:function(h){return this._layers[h]},getLayers:function(){var h=[];return this.eachLayer(h.push,h),h},setZIndex:function(h){return this.invoke("setZIndex",h)},getLayerId:function(h){return c(h)}}),see=function(h,g){return new Ld(h,g)},ro=Ld.extend({addLayer:function(h){return this.hasLayer(h)?this:(h.addEventParent(this),Ld.prototype.addLayer.call(this,h),this.fire("layeradd",{layer:h}))},removeLayer:function(h){return this.hasLayer(h)?(h in this._layers&&(h=this._layers[h]),h.removeEventParent(this),Ld.prototype.removeLayer.call(this,h),this.fire("layerremove",{layer:h})):this},setStyle:function(h){return this.invoke("setStyle",h)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var h=new J;for(var g in this._layers){var k=this._layers[g];h.extend(k.getBounds?k.getBounds():k.getLatLng())}return h}}),aee=function(h,g){return new ro(h,g)},$d=F.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(h){v(this,h)},createIcon:function(h){return this._createIcon("icon",h)},createShadow:function(h){return this._createIcon("shadow",h)},_createIcon:function(h,g){var k=this._getIconUrl(h);if(!k){if(h==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var E=this._createImg(k,g&&g.tagName==="IMG"?g:null);return this._setIconStyles(E,h),(this.options.crossOrigin||this.options.crossOrigin==="")&&(E.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),E},_setIconStyles:function(h,g){var k=this.options,E=k[g+"Size"];typeof E=="number"&&(E=[E,E]);var A=G(E),I=G(g==="shadow"&&k.shadowAnchor||k.iconAnchor||A&&A.divideBy(2,!0));h.className="leaflet-marker-"+g+" "+(k.className||""),I&&(h.style.marginLeft=-I.x+"px",h.style.marginTop=-I.y+"px"),A&&(h.style.width=A.x+"px",h.style.height=A.y+"px")},_createImg:function(h,g){return g=g||document.createElement("img"),g.src=h,g},_getIconUrl:function(h){return Pe.retina&&this.options[h+"RetinaUrl"]||this.options[h+"Url"]}});function oee(h){return new $d(h)}var Qp=$d.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(h){return typeof Qp.imagePath!="string"&&(Qp.imagePath=this._detectIconPath()),(this.options.imagePath||Qp.imagePath)+$d.prototype._getIconUrl.call(this,h)},_stripUrl:function(h){var g=function(k,E,A){var I=E.exec(k);return I&&I[A]};return h=g(h,/^url\((['"])?(.+)\1\)$/,2),h&&g(h,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var h=Ot("div","leaflet-default-icon-path",document.body),g=qp(h,"background-image")||qp(h,"backgroundImage");if(document.body.removeChild(h),g=this._stripUrl(g),g)return g;var k=document.querySelector('link[href$="leaflet.css"]');return k?k.href.substring(0,k.href.length-11-1):""}}),lI=wa.extend({initialize:function(h){this._marker=h},addHooks:function(){var h=this._marker._icon;this._draggable||(this._draggable=new ol(h,h,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),ct(h,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&Tr(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(h){var g=this._marker,k=g._map,E=this._marker.options.autoPanSpeed,A=this._marker.options.autoPanPadding,I=Gc(g._icon),K=k.getPixelBounds(),X=k.getPixelOrigin(),ee=U(K.min._subtract(X).add(A),K.max._subtract(X).subtract(A));if(!ee.contains(I)){var he=G((Math.max(ee.max.x,I.x)-ee.max.x)/(K.max.x-ee.max.x)-(Math.min(ee.min.x,I.x)-ee.min.x)/(K.min.x-ee.min.x),(Math.max(ee.max.y,I.y)-ee.max.y)/(K.max.y-ee.max.y)-(Math.min(ee.min.y,I.y)-ee.min.y)/(K.min.y-ee.min.y)).multiplyBy(E);k.panBy(he,{animate:!1}),this._draggable._newPos._add(he),this._draggable._startPos._add(he),Ir(g._icon,this._draggable._newPos),this._onDrag(h),this._panRequest=B(this._adjustPan.bind(this,h))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(h){this._marker.options.autoPan&&(R(this._panRequest),this._panRequest=B(this._adjustPan.bind(this,h)))},_onDrag:function(h){var g=this._marker,k=g._shadow,E=Gc(g._icon),A=g._map.layerPointToLatLng(E);k&&Ir(k,E),g._latlng=A,h.latlng=A,h.oldLatLng=this._oldLatLng,g.fire("move",h).fire("drag",h)},_onDragEnd:function(h){R(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",h)}}),tx=Ws.extend({options:{icon:new Qp,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(h,g){v(this,g),this._latlng=ae(h)},onAdd:function(h){this._zoomAnimated=this._zoomAnimated&&h.options.markerZoomAnimation,this._zoomAnimated&&h.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(h){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&h.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(h){var g=this._latlng;return this._latlng=ae(h),this.update(),this.fire("move",{oldLatLng:g,latlng:this._latlng})},setZIndexOffset:function(h){return this.options.zIndexOffset=h,this.update()},getIcon:function(){return this.options.icon},setIcon:function(h){return this.options.icon=h,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var h=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(h)}return this},_initIcon:function(){var h=this.options,g="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),k=h.icon.createIcon(this._icon),E=!1;k!==this._icon&&(this._icon&&this._removeIcon(),E=!0,h.title&&(k.title=h.title),k.tagName==="IMG"&&(k.alt=h.alt||"")),ct(k,g),h.keyboard&&(k.tabIndex="0",k.setAttribute("role","button")),this._icon=k,h.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&rt(k,"focus",this._panOnFocus,this);var A=h.icon.createShadow(this._shadow),I=!1;A!==this._shadow&&(this._removeShadow(),I=!0),A&&(ct(A,g),A.alt=""),this._shadow=A,h.opacity<1&&this._updateOpacity(),E&&this.getPane().appendChild(this._icon),this._initInteraction(),A&&I&&this.getPane(h.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Kt(this._icon,"focus",this._panOnFocus,this),pr(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&pr(this._shadow),this._shadow=null},_setPos:function(h){this._icon&&Ir(this._icon,h),this._shadow&&Ir(this._shadow,h),this._zIndex=h.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(h){this._icon&&(this._icon.style.zIndex=this._zIndex+h)},_animateZoom:function(h){var g=this._map._latLngToNewLayerPoint(this._latlng,h.zoom,h.center).round();this._setPos(g)},_initInteraction:function(){if(this.options.interactive&&(ct(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),lI)){var h=this.options.draggable;this.dragging&&(h=this.dragging.enabled(),this.dragging.disable()),this.dragging=new lI(this),h&&this.dragging.enable()}},setOpacity:function(h){return this.options.opacity=h,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var h=this.options.opacity;this._icon&&is(this._icon,h),this._shadow&&is(this._shadow,h)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var h=this._map;if(h){var g=this.options.icon.options,k=g.iconSize?G(g.iconSize):G(0,0),E=g.iconAnchor?G(g.iconAnchor):G(0,0);h.panInside(this._latlng,{paddingTopLeft:E,paddingBottomRight:k.subtract(E)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function lee(h,g){return new tx(h,g)}var ll=Ws.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(h){this._renderer=h.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(h){return v(this,h),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&h&&Object.prototype.hasOwnProperty.call(h,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),rx=ll.extend({options:{fill:!0,radius:10},initialize:function(h,g){v(this,g),this._latlng=ae(h),this._radius=this.options.radius},setLatLng:function(h){var g=this._latlng;return this._latlng=ae(h),this.redraw(),this.fire("move",{oldLatLng:g,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(h){return this.options.radius=this._radius=h,this.redraw()},getRadius:function(){return this._radius},setStyle:function(h){var g=h&&h.radius||this._radius;return ll.prototype.setStyle.call(this,h),this.setRadius(g),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var h=this._radius,g=this._radiusY||h,k=this._clickTolerance(),E=[h+k,g+k];this._pxBounds=new Y(this._point.subtract(E),this._point.add(E))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(h){return h.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function cee(h,g){return new rx(h,g)}var HS=rx.extend({initialize:function(h,g,k){if(typeof g=="number"&&(g=i({},k,{radius:g})),v(this,g),this._latlng=ae(h),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(h){return this._mRadius=h,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var h=[this._radius,this._radiusY||this._radius];
693return new J(this._map.layerPointToLatLng(this._point.subtract(h)),this._map.layerPointToLatLng(this._point.add(h)))},setStyle:ll.prototype.setStyle,_project:function(){var h=this._latlng.lng,g=this._latlng.lat,k=this._map,E=k.options.crs;if(E.distance===_e.distance){var A=Math.PI/180,I=this._mRadius/_e.R/A,K=k.project([g+I,h]),X=k.project([g-I,h]),ee=K.add(X).divideBy(2),he=k.unproject(ee).lat,Se=Math.acos((Math.cos(I*A)-Math.sin(g*A)*Math.sin(he*A))/(Math.cos(g*A)*Math.cos(he*A)))/A;(isNaN(Se)||Se===0)&&(Se=I/Math.cos(Math.PI/180*g)),this._point=ee.subtract(k.getPixelOrigin()),this._radius=isNaN(Se)?0:ee.x-k.project([he,h-Se]).x,this._radiusY=ee.y-K.y}else{var qe=E.unproject(E.project(this._latlng).subtract([this._mRadius,0]));this._point=k.latLngToLayerPoint(this._latlng),this._radius=this._point.x-k.latLngToLayerPoint(qe).x}this._updateBounds()}});function uee(h,g,k){return new HS(h,g,k)}var no=ll.extend({options:{smoothFactor:1,noClip:!1},initialize:function(h,g){v(this,g),this._setLatLngs(h)},getLatLngs:function(){return this._latlngs},setLatLngs:function(h){return this._setLatLngs(h),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(h){for(var g=1/0,k=null,E=Xp,A,I,K=0,X=this._parts.length;K<X;K++)for(var ee=this._parts[K],he=1,Se=ee.length;he<Se;he++){A=ee[he-1],I=ee[he];var qe=E(h,A,I,!0);qe<g&&(g=qe,k=E(h,A,I))}return k&&(k.distance=Math.sqrt(g)),k}
693,getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return aI(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(h,g){return g=g||this._defaultShape(),h=ae(h),g.push(h),this._bounds.extend(h),this.redraw()},_setLatLngs:function(h){this._bounds=new J,this._latlngs=this._convertLatLngs(h)},_defaultShape:function(){return ss(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(h){for(var g=[],k=ss(h),E=0,A=h.length;E<A;E++)k?(g[E]=ae(h[E]),this._bounds.extend(g[E])):g[E]=this._convertLatLngs(h[E]);return g},_project:function(){var h=new Y;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,h),this._bounds.isValid()&&h.isValid()&&(this._rawPxBounds=h,this._updateBounds())},_updateBounds:function(){var h=this._clickTolerance(),g=new z(h,h);this._rawPxBounds&&(this._pxBounds=new Y([this._rawPxBounds.min.subtract(g),this._rawPxBounds.max.add(g)]))},_projectLatlngs:function(h,g,k){var E=h[0]instanceof re,A=h.length,I,K;if(E){for(K=[],I=0;I<A;I++)K[I]=this._map.latLngToLayerPoint(h[I]),k.extend(K[I]);g.push(K)}else for(I=0;I<A;I++)this._projectLatlngs(h[I],g,k)},_clipPoints:function(){var h=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(h))){if(this.options.noClip){this._parts=this._rings;return}var g=this._parts,k,E,A,I,K,X,ee;for(k=0,A=0,I=this._rings.length;k<I;k++)for(ee=this._rings[k],E=0,K=ee.length;E<K-1;E++)X=iI(ee[E],ee[E+1],h,E,!0),X&&(g[A]=g[A]||[],g[A].push(X[0]),(X[1]!==ee[E+1]||E===K-2)&&(g[A].push(X[1]),A++))}},_simplifyPoints:function(){for(var h=this._parts,g=this.options.smoothFactor,k=0,E=h.length;k<E;k++)h[k]=tI(h[k],g)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(h,g){var k,E,A,I,K,X,ee=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(h))return!1;for(k=0,I=this._parts.length;k<I;k++)for(X=this._parts[k],E=0,K=X.length,A=K-1;E<K;A=E++)if(!(!g&&E===0)&&rI(h,X[A],X[E])<=ee)return!0;return!1}});function dee(h,g){return new no(h,g)}no._flat=sI;var Dd=no.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length}
693,getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return eI(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(h){var g=no.prototype._convertLatLngs.call(this,h),k=g.length;return k>=2&&g[0]instanceof re&&g[0].equals(g[k-1])&&g.pop(),g},_setLatLngs:function(h){no.prototype._setLatLngs.call(this,h),ss(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return ss(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var h=this._renderer._bounds,g=this.options.weight,k=new z(g,g);if(h=new Y(h.min.subtract(k),h.max.add(k)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(h))){if(this.options.noClip){this._parts=this._rings;return}for(var E=0,A=this._rings.length,I;E<A;E++)I=QR(this._rings[E],h,!0),I.length&&this._parts.push(I)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(h){var g=!1,k,E,A,I,K,X,ee,he;if(!this._pxBounds||!this._pxBounds.contains(h))return!1;for(I=0,ee=this._parts.length;I<ee;I++)for(k=this._parts[I],K=0,he=k.length,X=he-1;K<he;X=K++)E=k[K],A=k[X],E.y>h.y!=A.y>h.y&&h.x<(A.x-E.x)*(h.y-E.y)/(A.y-E.y)+E.x&&(g=!g);return g||no.prototype._containsPoint.call(this,h,!0)}});function fee(h,g){return new Dd(h,g)}var io=ro.extend({initialize:function(h,g){v(this,g),this._layers={},h&&this.addData(h)},addData:function(h){var g=S(h)?h:h.features,k,E,A;if(g){for(k=0,E=g.length;k<E;k++)A=g[k],(A.geometries||A.geometry||A.features||A.coordinates)&&this.addData(A);return this}var I=this.options;if(I.filter&&!I.filter(h))return this;var K=nx(h,I);return K?(K.feature=ax(h),K.defaultOptions=K.options,this.resetStyle(K),I.onEachFeature&&I.onEachFeature(h,K),this.addLayer(K)):this},resetStyle:function(h){return h===void 0?this.eachLayer(this.resetStyle,this):(h.options=i({},h.defaultOptions),this._setLayerStyle(h,this.options.style),this)},setStyle:function(h){return this.eachLayer(function(g){this._setLayerStyle(g,h)},this)},_setLayerStyle:function(h,g){h.setStyle&&(typeof g=="function"&&(g=g(h.feature)),h.setStyle(g))}});function nx(h,g){var k=h.type==="Feature"?h.geometry:h,E=k?k.coordinates:null,A=[],I=g&&g.pointToLayer,K=g&&g.coordsToLatLng||VS,X,ee,he,Se;if(!E&&!k)return null;switch(k.type){case"Point":return X=K(E),cI(I,h,X,g);case"MultiPoint":for(he=0,Se=E.length;he<Se;he++)X=K(E[he]),A.push(cI(I,h,X,g));return new ro(A);case"LineString":case"MultiLineString":return ee=ix(E,k.type==="LineString"?0:1,K),new no(ee,g);case"Polygon":case"MultiPolygon":return ee=ix(E,k.type==="Polygon"?1:2,K),new Dd(ee,g);case"GeometryCollection":for(he=0,Se=k.geometries.length;he<Se;he++){var qe=nx({geometry:k.geometries[he],type:"Feature",properties:h.properties},g);qe&&A.push(qe)}return new ro(A);case"FeatureCollection":for(he=0,Se=k.features.length;he<Se;he++){var mt=nx(k.features[he],g);mt&&A.push(mt)}return new ro(A);default:throw new Error("Invalid GeoJSON object.")}}function cI(h,g,k,E){return h?h(g,k):new tx(k,E&&E.markersInheritOptions&&E)}function VS(h){return new re(h[1],h[0],h[2])}function ix(h,g,k){for(var E=[],A=0,I=h.length,K;A<I;A++)K=g?ix(h[A],g-1,k):(k||VS)(h[A]),E.push(K);return E}function WS(h,g){return h=ae(h),h.alt!==void 0?[p(h.lng,g),p(h.lat,g),p(h.alt,g)]:[p(h.lng,g),p(h.lat,g)]}function sx(h,g,k,E){for(var A=[],I=0,K=h.length;I<K;I++)A.push(g?sx(h[I],ss(h[I])?0:g-1,k,E):WS(h[I],E));return!g&&k&&A.length>0&&A.push(A[0].slice()),A}function Bd(h,g){return h.feature?i({},h.feature,{geometry:g}):ax(g)}function ax(h){return h.type==="Feature"||h.type==="FeatureCollection"?h:{type:"Feature",properties:{},geometry:h}}var qS={toGeoJSON:function(h){return Bd(this,{type:"Point",coordinates:WS(this.getLatLng(),h)})}};tx.include(qS),HS.include(qS),rx.include(qS),no.include({toGeoJSON:function(h){var g=!ss(this._latlngs),k=sx(this._latlngs,g?1:0,!1,h);return Bd(this,{type:(g?"Multi":"")+"LineString",coordinates:k})}}),Dd.include({toGeoJSON:function(h){var g=!ss(this._latlngs),k=g&&!ss(this._latlngs[0]),E=sx(this._latlngs,k?2:g?1:0,!0,h);return g||(E=[E]),Bd(this,{type:(k?"Multi":"")+"Polygon",coordinates:E})}}),Ld.include({toMultiPoint:function(h){var g=[];return this.eachLayer(function(k){g.push(k.toGeoJSON(h).geometry.coordinates)}),Bd(this,{type:"MultiPoint",coordinates:g})},toGeoJSON:function(h){var g=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(g==="MultiPoint")return this.toMultiPoint(h);var k=g==="GeometryCollection",E=[];return this.eachLayer(function(A){if(A.toGeoJSON){var I=A.toGeoJSON(h);if(k)E.push(I.geometry);else{var K=ax(I);K.type==="FeatureCollection"?E.push.apply(E,K.features):E.push(K)}}}),k?Bd(this,{geometries:E,type:"GeometryCollection"}):{type:"FeatureCollection",features:E}}});function uI(h,g){return new io(h,g)}var hee=uI,ox=Ws.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(h,g,k){this._url=h,this._bounds=te(g),v(this,k)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ct(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){pr(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(h){return this.options.opacity=h,this._image&&this._updateOpacity(),this},setStyle:function(h){return h.opacity&&this.setOpacity(h.opacity),this},bringToFront:function(){return this._map&&Rd(this._image),this},bringToBack:function(){return this._map&&Id(this._image),this},setUrl:function(h){return this._url=h,this._image&&(this._image.src=h),this},setBounds:function(h){return this._bounds=te(h),this._map&&this._reset(),this},getEvents:function(){var h={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(h.zoomanim=this._animateZoom),h},setZIndex:function(h){return this.options.zIndex=h,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var h=this._url.tagName==="IMG",g=this._image=h?this._url:Ot("img");if(ct(g,"leaflet-image-layer"),this._zoomAnimated&&ct(g,"leaflet-zoom-animated"),this.options.className&&ct(g,this.options.className),g.onselectstart=f,g.onmousemove=f,g.onload=a(this.fire,this,"load"),g.onerror=a(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(g.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),h){this._url=g.src;return}g.src=this._url,g.alt=this.options.alt},_animateZoom:function(h){var g=this._map.getZoomScale(h.zoom),k=this._map._latLngBoundsToNewLayerBounds(this._bounds,h.zoom,h.center).min;Kc(this._image,k,g)},_reset:function(){var h=this._image,g=new Y(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),k=g.getSize();Ir(h,g.min),h.style.width=k.x+"px",h.style.height=k.y+"px"},_updateOpacity:function(){is(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var h=this.options.errorOverlayUrl;h&&this._url!==h&&(this._url=h,this._image.src=h)},getCenter:function(){return this._bounds.getCenter()}}),pee=function(h,g,k){return new ox(h,g,k)},dI=ox.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInl
vendor: 5,698 bytes, line 693
693ine:!0},_initImage:function(){var h=this._url.tagName==="VIDEO",g=this._image=h?this._url:Ot("video");if(ct(g,"leaflet-image-layer"),this._zoomAnimated&&ct(g,"leaflet-zoom-animated"),this.options.className&&ct(g,this.options.className),g.onselectstart=f,g.onmousemove=f,g.onloadeddata=a(this.fire,this,"load"),h){for(var k=g.getElementsByTagName("source"),E=[],A=0;A<k.length;A++)E.push(k[A].src);this._url=k.length>0?E:[g.src];return}S(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(g.style,"objectFit")&&(g.style.objectFit="fill"),g.autoplay=!!this.options.autoplay,g.loop=!!this.options.loop,g.muted=!!this.options.muted,g.playsInline=!!this.options.playsInline;for(var I=0;I<this._url.length;I++){var K=Ot("source");K.src=this._url[I],g.appendChild(K)}}});function mee(h,g,k){return new dI(h,g,k)}var fI=ox.extend({_initImage:function(){var h=this._image=this._url;ct(h,"leaflet-image-layer"),this._zoomAnimated&&ct(h,"leaflet-zoom-animated"),this.options.className&&ct(h,this.options.className),h.onselectstart=f,h.onmousemove=f}});function gee(h,g,k){return new fI(h,g,k)}var _a=Ws.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(h,g){h&&(h instanceof re||S(h))?(this._latlng=ae(h),v(this,g)):(v(this,h),this._source=g),this.options.content&&(this._content=this.options.content)},openOn:function(h){return h=arguments.length?h:this._source._map,h.hasLayer(this)||h.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(h){return this._map?this.close():(arguments.length?this._source=h:h=this._source,this._prepareOpen(),this.openOn(h._map)),this},onAdd:function(h){this._zoomAnimated=h._zoomAnimated,this._container||this._initLayout(),h._fadeAnimated&&is(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),h._fadeAnimated&&is(this._container,1),this.bringToFront(),this.options.interactive&&(ct(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(h){h._fadeAnimated?(is(this._container,0),this._removeTimeout=setTimeout(a(pr,void 0,this._container),200)):pr(this._container),this.options.interactive&&(Tr(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(h){return this._latlng=ae(h),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(h){return this._content=h,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var h={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(h.zoomanim=this._animateZoom),h},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&Rd(this._container),this},bringToBack:function(){return this._map&&Id(this._container),this},_prepareOpen:function(h){var g=this._source;if(!g._map)return!1;if(g instanceof ro){g=null;var k=this._source._layers;for(var E in k)if(k[E]._map){g=k[E];break}if(!g)return!1;this._source=g}if(!h)if(g.getCenter)h=g.getCenter();else if(g.getLatLng)h=g.getLatLng();else if(g.getBounds)h=g.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(h),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var h=this._contentNode,g=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof g=="string")h.innerHTML=g;else{for(;h.hasChildNodes();)h.removeChild(h.firstChild);h.appendChild(g)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var h=this._map.latLngToLayerPoint(this._latlng),g=G(this.options.offset),k=this._getAnchor();this._zoomAnimated?Ir(this._container,h.add(k)):g=g.add(h).add(k);var E=this._containerBottom=-g.y,A=this._containerLeft=-Math.round(this._containerWidth/2)+g.x;this._container.style.bottom=E+"px",this._container.style.left=A+"px"}},_getAnchor:function(){return[0,0]}});wt.include({_initOverlay:function(h,g,k,E){var A=g;return A instanceof h||(A=new h(E).setContent(g)),k&&A.setLatLng(k),A}}),Ws.include({_initOverlay:function(h,g,k,E){var A=k;return A instanceof h?(v(A,E),A._source=this):(A=g&&!E?g:new h(E,this),A.setContent(k)),A}});var lx=_a.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(h){return h=arguments.length?h:this._source._map,!h.hasLayer(this)&&h._popup&&h._popup.options.autoClose&&h.removeLayer(h._popup),h._popup=this,_a.prototype.openOn.call(this,h)},onAdd:function(h){_a.prototype.onAdd.call(this,h),h.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof ll||this._source.on("preclick",Zc))},onRemove:function(h){_a.prototype.onRemove.call(this,h),h.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof ll||this._source.off("preclick",Zc))},getEvents:function(){var h=_a.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(h.preclick=this.close),this.options.keepInView&&
693(h.moveend=this._adjustPan),h},_initLayout:function(){var h="leaflet-popup",g=this._container=Ot("div",h+" "+(this.options.className||"")+" leaflet-zoom-animated"),k=this._wrapper=Ot("div",h+"-content-wrapper",g);if(this._contentNode=Ot("div",h+"-content",k),Jp(g),IS(this._contentNode),rt(g,"contextmenu",Zc),this._tipContainer=Ot("div",h+"-tip-container",g),this._tip=Ot("div",h+"-tip",this._tipContainer),this.options.closeButton){var E=this._closeButton=Ot("a",h+"-close-button",g);E.setAttribute("role","button"),E.setAttribute("aria-label","Close popup"),E.href="#close",E.innerHTML='<span aria-hidden="true">&#215;</span>',rt(E,"click",function(A){xn(A),this.close()},this)}},_updateLayout:function(){var h=this._contentNode,g=h.style;g.width="",g.whiteSpace="nowrap";var k=h.offsetWidth;k=Math.min(k,this.options.maxWidth),k=Math.max(k,this.options.minWidth),g.width=k+1+"px",g.whiteSpace="",g.height="";var E=h.offsetHeight,A=this.options.maxHeight,I="leaflet-popup-scrolled";A&&E>A?(g.height=A+"px",ct(h,I)):Tr(h,I),this._containerWidth=this._container.offsetWidth},_animateZoom:function(h){var g=this._map._latLngToNewLayerPoint(this._latlng,h.zoom,h.center),k=this._getAnchor();Ir(this._container,g.add(k))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var h=this._map,g=parseInt(qp(this._container,"marginBottom"),10)||0,k=this._container.offsetHeight+g,E=this._containerWidth,A=new z(this._containerLeft,-k-this._containerBottom);A._add(Gc(this._container));var I=h.layerPointToContainerPoint(A),K=G(this.options.autoPanPadding),X=G(this.options.autoPanPaddingTopLeft||K),ee=G(this.options.autoPanPaddingBottomRight||K),he=h.getSize(),Se=0,qe=0;I.x+E+ee.x>he.x&&(Se=I.x+E-he.x+ee.x),I.x-Se-X.x<0&&(Se=I.x-X.x),I.y+k+ee.y>he.y&&(qe=I.y+k-he.y+ee.y),I.y-qe-X.y<0&&(qe=I.y-X.y),(Se||qe)&&(this.options.keepInView&&(this._autopanning=!0),h.fire("autopanstart").panBy([Se,qe]))}},_getAnchor:function(){return G(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),vee=function(h,g){return new lx(h,g)};wt.mergeOptions({closePopupOnClick:!0}),wt.include({openPopup:function(h,g,k){return this._initOverlay(lx,h,g,k).openOn(this),this},closePopup:function(h){return h=arguments.length?h:this._popup,h&&h.close(),this}}),Ws.include({bindPopup:function(h,g){return this._popup=this._initOverlay(lx,this._popup,h,g),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(h){return this._popup&&(this instanceof ro||(this._popup._source=this),this._popup._prepareOpen(h||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(h){return this._popup&&this._popup.setContent(h),this},getPopup:function(){return this._popup},_openPopup:function(h){if(!(!this._popup||!this._map)){Jc(h);var g=h.layer||h.target;if(this._popup._source===g&&!(g instanceof ll)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(h.latlng);return}this._popup._source=g,this.openPopup(h.latlng)}},_movePopup:function(h){this._popup.setLatLng(h.latlng)},_onKeyPress:function(h){h.originalEvent.keyCode===13&&this._openPopup(h)}});var cx=_a.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(h){_a.prototype.onAdd.call(this,h),this.setOpacity(this.options.opacity),h.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(h){_a.prototype.onRemove.call(this,h),h.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var h=_a.prototype.getEvents.call(this);return this.options.permanent||(h.preclick=this.close),h},_initLayout:function(){var h="leaflet-tooltip",g=h+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Ot("div",g),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+c(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(h){var g,k,E=this._map,A=this._container,I=E.latLngToContainerPoint(E.getCenter()),K=E.layerPointToContainerPoint(h),X=this.options.direction,ee=A.offsetWidth,he=A.offsetHeight,Se=G(this.options.offset),qe=this._getAnchor();X==="top"?(g=ee/2,k=he):X==="bottom"?(g=ee/2,k=0):X==="center"?(g=ee/2,k=he/2):X==="right"?(g=0,k=he/2):X==="left"?
vendor: 5,890 bytes, line 693
693(g=ee,k=he/2):K.x<I.x?(X="right",g=0,k=he/2):(X="left",g=ee+(Se.x+qe.x)*2,k=he/2),h=h.subtract(G(g,k,!0)).add(Se).add(qe),Tr(A,"leaflet-tooltip-right"),Tr(A,"leaflet-tooltip-left"),Tr(A,"leaflet-tooltip-top"),Tr(A,"leaflet-tooltip-bottom"),ct(A,"leaflet-tooltip-"+X),Ir(A,h)},_updatePosition:function(){var h=this._map.latLngToLayerPoint(this._latlng);this._setPosition(h)},setOpacity:function(h){this.options.opacity=h,this._container&&is(this._container,h)},_animateZoom:function(h){var g=this._map._latLngToNewLayerPoint(this._latlng,h.zoom,h.center);this._setPosition(g)},_getAnchor:function(){return G(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),yee=function(h,g){return new cx(h,g)};wt.include({openTooltip:function(h,g,k){return this._initOverlay(cx,h,g,k).openOn(this),this},closeTooltip:function(h){return h.close(),this}}),Ws.include({bindTooltip:function(h,g){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(cx,this._tooltip,h,g),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(h){if(!(!h&&this._tooltipHandlersAdded)){var g=h?"off":"on",k={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?k.add=this._openTooltip:(k.mouseover=this._openTooltip,k.mouseout=this.closeTooltip,k.click=this._openTooltip,this._map?this._addFocusListeners():k.add=this._addFocusListeners),this._tooltip.options.sticky&&(k.mousemove=this._moveTooltip),this[g](k),this._tooltipHandlersAdded=!h}},openTooltip:function(h){return this._tooltip&&(this instanceof ro||(this._tooltip._source=this),this._tooltip._prepareOpen(h)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(h){return this._tooltip&&this._tooltip.setContent(h),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(h){var g=typeof h.getElement=="function"&&h.getElement();g&&(rt(g,"focus",function(){this._tooltip._source=h,this.openTooltip()},this),rt(g,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(h){var g=typeof h.getElement=="function"&&h.getElement();g&&g.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(h){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var g=this;this._map.once("moveend",function(){g._openOnceFlag=!1,g._openTooltip(h)});return}this._tooltip._source=h.layer||h.target,this.openTooltip(this._tooltip.options.sticky?h.latlng:void 0)}},_moveTooltip:function(h){var g=h.latlng,k,E;this._tooltip.options.sticky&&h.originalEvent&&(k=this._map.mouseEventToContainerPoint(h.originalEvent),E=this._map.containerPointToLayerPoint(k),g=this._map.layerPointToLatLng(E)),this._tooltip.setLatLng(g)}});var hI=$d.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(h){var g=h&&h.tagName==="DIV"?h:document.createElement("div"),k=this.options;if(k.html instanceof Element?(Zy(g),g.appendChild(k.html)):g.innerHTML=k.html!==!1?k.html:"",k.bgPos){var E=G(k.bgPos);g.style.backgroundPosition=-E.x+"px "+-E.y+"px"}return this._setIconStyles(g,"icon"),g},createShadow:function(){return null}});function xee(h){return new hI(h)}$d.Default=Qp;var em=Ws.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Pe.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(h){v(this,h)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(h){h._addZoomLimit(this)},onRemove:function(h){this._removeAllTiles(),pr(this._container),h._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Rd(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Id(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(h){return this.options.opacity=h,this._updateOpacity(),this},setZIndex:function(h){return this.options.zIndex=h,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var h=this._clampZoom(this._map.getZoom());h!==this._tileZoom&&(this._tileZoom=h,this._updateLevels()),this._update()}return this},getEvents:function(){var h={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=u(this._onMoveEnd,this.options.updateInterval,this)),h.move=this._onMove),this._zoomAnimated&&(h.zoomanim=this._animateZoom),h},createTile:function(){return document.createElement("div")},getTileSize:function(){var h=this.options.tileSize;return h instanceof z?h:new z(h,h)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(h){for(var g=this.getPane().children,k=-
vendor: 4,186 bytes, line 693
693h(-1/0,1/0),E=0,A=g.length,I;E<A;E++)I=g[E].style.zIndex,g[E]!==this._container&&I&&(k=h(k,+I));isFinite(k)&&(this.options.zIndex=k+h(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Pe.ielt9){is(this._container,this.options.opacity);var h=+new Date,g=!1,k=!1;for(var E in this._tiles){var A=this._tiles[E];if(!(!A.current||!A.loaded)){var I=Math.min(1,(h-A.loaded)/200);is(A.el,I),I<1?g=!0:(A.active?k=!0:this._onOpaqueTile(A),A.active=!0)}}k&&!this._noPrune&&this._pruneTiles(),g&&(R(this._fadeFrame),this._fadeFrame=B(this._updateOpacity,this))}},_onOpaqueTile:f,_initContainer:function(){this._container||(this._container=Ot("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var h=this._tileZoom,g=this.options.maxZoom;if(h!==void 0){for(var k in this._levels)k=Number(k),this._levels[k].el.children.length||k===h?(this._levels[k].el.style.zIndex=g-Math.abs(h-k),this._onUpdateLevel(k)):(pr(this._levels[k].el),this._removeTilesAtZoom(k),this._onRemoveLevel(k),delete this._levels[k]);var E=this._levels[h],A=this._map;return E||(E=this._levels[h]={},E.el=Ot("div","leaflet-tile-container leaflet-zoom-animated",this._container),E.el.style.zIndex=g,E.origin=A.project(A.unproject(A.getPixelOrigin()),h).round(),E.zoom=h,this._setZoomTransform(E,A.getCenter(),A.getZoom()),f(E.el.offsetWidth),this._onCreateLevel(E)),this._level=E,E}},_onUpdateLevel:f,_onRemoveLevel:f,_onCreateLevel:f,_pruneTiles:function(){if(this._map){var h,g,k=this._map.getZoom();if(k>this.options.maxZoom||k<this.options.minZoom){this._removeAllTiles();return}for(h in this._tiles)g=this._tiles[h],g.retain=g.current;for(h in this._tiles)if(g=this._tiles[h],g.current&&!g.active){var E=g.coords;this._retainParent(E.x,E.y,E.z,E.z-5)||this._retainChildren(E.x,E.y,E.z,E.z+2)}for(h in this._tiles)this._tiles[h].retain||this._removeTile(h)}},_removeTilesAtZoom:function(h){for(var g in this._tiles)this._tiles[g].coords.z===h&&this._removeTile(g)},_removeAllTiles:function(){for(var h in this._tiles)this._removeTile(h)},_invalidateAll:function(){for(var h in this._levels)pr(this._levels[h].el),this._onRemoveLevel(Number(h)),delete this._levels[h];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(h,g,k,E){var A=Math.floor(h/2),I=Math.floor(g/2),K=k-1,X=new z(+A,+I);X.z=+K;var ee=this._tileCoordsToKey(X),he=this._tiles[ee];return he&&he.active?(he.retain=!0,!0):(he&&he.loaded&&(he.retain=!0),K>E?this._retainParent(A,I,K,E):!1)},_retainChildren:function(h,g,k,E){for(var A=2*h;A<2*h+2;A++)for(var I=2*g;I<2*g+2;I++){var K=new z(A,I);K.z=k+1;var X=this._tileCoordsToKey(K),ee=this._tiles[X];if(ee&&ee.active){ee.retain=!0;continue}else ee&&ee.loaded&&(ee.retain=!0);k+1<E&&this._retainChildren(A,I,k+1,E)}},_resetView:function(h){var g=h&&(h.pinch||h.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),g,g)},_animateZoom:function(h){this._setView(h.center,h.zoom,!0,h.noUpdate)},_clampZoom:function(h){var g=this.options;return g.minNativeZoom!==void 0&&h<g.minNativeZoom?g.minNativeZoom:g.maxNativeZoom!==void 0&&g.maxNativeZoom<h?g.maxNativeZoom:h},_setView:function(h,g,k,E){var A=Math.round(g);this.options.maxZoom!==void 0&&A>this.options.maxZoom||this.options.minZoom!==void 0&&A<this.options.minZoom?A=void 0:A=this._clampZoom(A);var I=this.options.updateWhenZooming&&A!==this._tileZoom;(!E||I)&&(this._tileZoom=A,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),A!==void 0&&this._update(h),k||this._pruneTiles(),this._noPrune=!!k),this._setZoomTransforms(h,g)},_setZoomTransforms:function(h,g){for(var k in this._levels)this._setZoomTransform(this._levels[k],h,g)},_setZoomTransform:function(h,g,k){var E=this._map.getZoomScale(k,h.zoom),A=h.origin.multiplyBy(E).subtract(this._map._getNewPixelOrigin(g,k)).round();Pe.any3d?Kc(h.el,A,E):Ir(h.el,A)},_resetGrid:function(){var h=this._map,g=h.options.crs,k=this._tileSize=this.getTileSize(),E=this._tileZoom,A=this._map.getPixelWorldBounds(this._tileZoom);A&&(this._globalTileRange=this._pxBoundsToTileRange(A)),this._wrapX=g.
vendor: 9,315 bytes, line 693
693wrapLng&&!this.options.noWrap&&[Math.floor(h.project([0,g.wrapLng[0]],E).x/k.x),Math.ceil(h.project([0,g.wrapLng[1]],E).x/k.y)],this._wrapY=g.wrapLat&&!this.options.noWrap&&[Math.floor(h.project([g.wrapLat[0],0],E).y/k.x),Math.ceil(h.project([g.wrapLat[1],0],E).y/k.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(h){var g=this._map,k=g._animatingZoom?Math.max(g._animateToZoom,g.getZoom()):g.getZoom(),E=g.getZoomScale(k,this._tileZoom),A=g.project(h,this._tileZoom).floor(),I=g.getSize().divideBy(E*2);return new Y(A.subtract(I),A.add(I))},_update:function(h){var g=this._map;if(g){var k=this._clampZoom(g.getZoom());if(h===void 0&&(h=g.getCenter()),this._tileZoom!==void 0){var E=this._getTiledPixelBounds(h),A=this._pxBoundsToTileRange(E),I=A.getCenter(),K=[],X=this.options.keepBuffer,ee=new Y(A.getBottomLeft().subtract([X,-X]),A.getTopRight().add([X,-X]));if(!(isFinite(A.min.x)&&isFinite(A.min.y)&&isFinite(A.max.x)&&isFinite(A.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var he in this._tiles){var Se=this._tiles[he].coords;(Se.z!==this._tileZoom||!ee.contains(new z(Se.x,Se.y)))&&(this._tiles[he].current=!1)}if(Math.abs(k-this._tileZoom)>1){this._setView(h,k);return}for(var qe=A.min.y;qe<=A.max.y;qe++)for(var mt=A.min.x;mt<=A.max.x;mt++){var Jn=new z(mt,qe);if(Jn.z=this._tileZoom,!!this._isValidTile(Jn)){var sn=this._tiles[this._tileCoordsToKey(Jn)];sn?sn.current=!0:K.push(Jn)}}if(K.sort(function(gi,zd){return gi.distanceTo(I)-zd.distanceTo(I)}),K.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var as=document.createDocumentFragment();for(mt=0;mt<K.length;mt++)this._addTile(K[mt],as);this._level.el.appendChild(as)}}}},_isValidTile:function(h){var g=this._map.options.crs;if(!g.infinite){var k=this._globalTileRange;if(!g.wrapLng&&(h.x<k.min.x||h.x>k.max.x)||!g.wrapLat&&(h.y<k.min.y||h.y>k.max.y))return!1}if(!this.options.bounds)return!0;var E=this._tileCoordsToBounds(h);return te(this.options.bounds).overlaps(E)},_keyToBounds:function(h){return this._tileCoordsToBounds(this._keyToTileCoords(h))},_tileCoordsToNwSe:function(h){var g=this._map,k=this.getTileSize(),E=h.scaleBy(k),A=E.add(k),I=g.unproject(E,h.z),K=g.unproject(A,h.z);return[I,K]},_tileCoordsToBounds:function(h){var g=this._tileCoordsToNwSe(h),k=new J(g[0],g[1]);return this.options.noWrap||(k=this._map.wrapLatLngBounds(k)),k},_tileCoordsToKey:function(h){return h.x+":"+h.y+":"+h.z},_keyToTileCoords:function(h){var g=h.split(":"),k=new z(+g[0],+g[1]);return k.z=+g[2],k},_removeTile:function(h){var g=this._tiles[h];g&&(pr(g.el),delete this._tiles[h],this.fire("tileunload",{tile:g.el,coords:this._keyToTileCoords(h)}))},_initTile:function(h){ct(h,"leaflet-tile");var g=this.getTileSize();h.style.width=g.x+"px",h.style.height=g.y+"px",h.onselectstart=f,h.onmousemove=f,Pe.ielt9&&this.options.opacity<1&&is(h,this.options.opacity)},_addTile:function(h,g){var k=this._getTilePos(h),E=this._tileCoordsToKey(h),A=this.createTile(this._wrapCoords(h),a(this._tileReady,this,h));this._initTile(A),this.createTile.length<2&&B(a(this._tileReady,this,h,null,A)),Ir(A,k),this._tiles[E]={el:A,coords:h,current:!0},g.appendChild(A),this.fire("tileloadstart",{tile:A,coords:h})},_tileReady:function(h,g,k){g&&this.fire("tileerror",{error:g,tile:k,coords:h});var E=this._tileCoordsToKey(h);k=this._tiles[E],k&&(k.loaded=+new Date,this._map._fadeAnimated?(is(k.el,0),R(this._fadeFrame),this._fadeFrame=B(this._updateOpacity,this)):(k.active=!0,this._pruneTiles()),g||(ct(k.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:k.el,coords:h})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Pe.ielt9||!this._map._fadeAnimated?B(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(h){return h.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(h){var g=new z(this._wrapX?d(h.x,this._wrapX):h.x,this._wrapY?d(h.y,this._wrapY):h.y);return g.z=h.z,g},_pxBoundsToTileRange:function(h){var g=this.getTileSize();return new Y(h.min.unscaleBy(g).floor(),h.max.unscaleBy(g).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var h in this._tiles)if(!this._tiles[h].loaded)return!1;return!0}});function bee(h){return new em(h)}var Fd=em.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(h,g){this._url=h,g=v(this,g),g.detectRetina&&Pe.retina&&g.maxZoom>0?(g.tileSize=Math.floor(g.tileSize/2),g.zoomReverse?(g.zoomOffset--,g.minZoom=Math.min(g.maxZoom,g.minZoom+1)):(g.zoomOffset++,g.maxZoom=Math.max(g.minZoom,g.maxZoom-1)),g.minZoom=Math.max(0,g.minZoom)):g.zoomReverse?g.minZoom=Math.min(g.maxZoom,g.minZoom):g.maxZoom=Math.max(g.minZoom,g.maxZoom),typeof g.subdomains=="string"&&(g.subdomains=g.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(h,g){return this._url===h&&g===void 0&&(g=!0),this._url=h,g||this.redraw(),this},createTile:function(h,g){var k=document.createElement("img");return rt(k,"load",a(this._tileOnLoad,this,g,k)),rt(k,"error",a(this._tileOnError,this,g,k)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(k.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(k.referrerPolicy=this.options.referrerPolicy),k.alt="",k.src=this.getTileUrl(h),k},getTileUrl:function(h){var g={r:Pe.retina?"@2x":"",s:this._getSubdomain(h),x:h.x,y:h.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var k=this._globalTileRange.max.y-h.y;this.options.tms&&(g.y=k),g["-y"]=k}return _(this._url,i(g,this.options))},_tileOnLoad:function(h,g){Pe.ielt9?setTimeout(a(h,this,null,g),0):h(null,g)},_tileOnError:function(h,g,k){var E=this.options.errorTileUrl;E&&g.getAttribute("src")!==E&&(g.src=E),h(k,g)},_onTileRemove:function(h){h.tile.onload=null},_getZoomForUrl:function(){var h=this._tileZoom,g=this.options.maxZoom,k=this.options.zoomReverse,E=this.options.zoomOffset;return k&&(h=g-h),h+E},_getSubdomain:function(h){var g=Math.abs(h.x+h.y)%this.options.subdomains.length;return this.options.subdomains[g]},_abortLoading:function(){var h,g;for(h in this._tiles)if(this._tiles[h].coords.z!==this._tileZoom&&(g=this._tiles[h].el,g.onload=f,g.onerror=f,!g.complete)){g.src=j;var k=this._tiles[h].coords;pr(g),delete this._tiles[h],this.fire("tileabort",{tile:g,coords:k})}},_removeTile:function(h){var g=this._tiles[h];if(g)return g.el.setAttribute("src",j),em.prototype._removeTile.call(this,h)},_tileReady:function(h,g,k){if(!(!this._map||k&&k.getAttribute("src")===j))return em.prototype._tileReady.call(this,h,g,k)}});function pI(h,g){return new Fd(h,g)}var mI=Fd.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(h,g){this._url=h;var k=i({},this.defaultWmsParams);for(var E in g)E in this.options||(k[E]=g[E]);g=v(this,g);var A=g.detectRetina&&Pe.retina?2:1,I=this.getTileSize();k.width=I.x*A,k.height=I.y*A,this.wmsParams=k},onAdd:function(h){this._crs=this.options.crs||h.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var g=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[g]=this._crs.code,Fd.prototype.onAdd.call(this,h)},getTileUrl:function(h){var g=this._tileCoordsToNwSe(h),k=this._crs,E=U(k.project(g[0]),k.project(g[1])),A=E.min,I=E.max,K=(this._wmsVersion>=1.3&&this._crs===oI?[A.y,A.x,I.y,I.x]:[A.x,A.y,I.x,I.y]).join(","),X=Fd.prototype.getTileUrl.call(this,h);return X+w(this.wmsParams,X,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+K},setParams:function(h,g){return i(this.wmsParams,h),g||this.redraw(),this}});function wee(h,g){return new mI(h,g)}Fd.WMS=mI,pI.wms=wee;var so=Ws.extend({options:{padding:.1},initialize:function(h){v(this,h),c(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),ct(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var h={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(h.zoomanim=this._onAnimZoom),h},_onAnimZoom:function(h){this._updateTransform(h.center,h.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(h,g){var k=this._map.getZoomScale(g,this._zoom),E=this._map.getSize().multiplyBy(.5+this.options.padding),A=this._map.project(this._center,g),I=E.multiplyBy(-k).add(A).subtract(this._map._getNewPixelOrigin(h,g));Pe.any3d?Kc(this._container,I,k):Ir(this._container,I)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var h in this._layers)this._layers[h]._reset()},_onZoomEnd:function(){for(var h in this._layers)this._layers[h]._project()},_updatePaths:function(){for(var h in this._layers)this._layers[h]._update()},_update:function(){var h=this.options.padding,g=this._map.getSize(),k=this._map.containerPointToLayerPoint(g.multiplyBy(-h)).round();
693this._bounds=new Y(k,k.add(g.multiplyBy(1+h*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),gI=so.extend({options:{tolerance:0},getEvents:function(){var h=so.prototype.getEvents.call(this);return h.viewprereset=this._onViewPreReset,h},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){so.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var h=this._container=document.createElement("canvas");rt(h,"mousemove",this._onMouseMove,this),rt(h,"click dblclick mousedown mouseup contextmenu",this._onClick,this),rt(h,"mouseout",this._handleMouseOut,this),h._leaflet_disable_events=!0,this._ctx=h.getContext("2d")},_destroyContainer:function(){R(this._redrawRequest),delete this._ctx,pr(this._container),Kt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var h;this._redrawBounds=null;for(var g in this._layers)h=this._layers[g],h._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){so.prototype._update.call(this);var h=this._bounds,g=this._container,k=h.getSize(),E=Pe.retina?2:1;Ir(g,h.min),g.width=E*k.x,g.height=E*k.y,g.style.width=k.x+"px",g.style.height=k.y+"px",Pe.retina&&this._ctx.scale(2,2),this._ctx.translate(-h.min.x,-h.min.y),this.fire("update")}},_reset:function(){so.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(h){this._updateDashArray(h),this._layers[c(h)]=h;var g=h._order={layer:h,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=g),this._drawLast=g,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(h){this._requestRedraw(h)},_removePath:function(h){var g=h._order,k=g.next,E=g.prev;k?k.prev=E:this._drawLast=E,E?E.next=k:this._drawFirst=k,delete h._order,delete this._layers[c(h)],this._requestRedraw(h)},_updatePath:function(h){this._extendRedrawBounds(h),h._project(),h._update(),this._requestRedraw(h)},_updateStyle:function(h){this._updateDashArray(h),this._requestRedraw(h)},_updateDashArray:function(h){if(typeof h.options.dashArray=="string"){var g=h.options.dashArray.split(/[, ]+/),k=[],E,A;for(A=0;A<g.length;A++){if(E=Number(g[A]),isNaN(E))return;k.push(E)}h.options._dashArray=k}else h.options._dashArray=h.options.dashArray},_requestRedraw:function(h){this._map&&(this._extendRedrawBounds(h),this._redrawRequest=this._redrawRequest||B(this._redraw,this))},_extendRedrawBounds:function(h){if(h._pxBounds){var g=(h.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Y,this._redrawBounds.extend(h._pxBounds.min.subtract([g,g])),this._redrawBounds.extend(h._pxBounds.max.add([g,g]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var h=this._redrawBounds;if(h){var g=h.getSize();this._ctx.clearRect(h.min.x,h.min.y,g.x,g.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var h,g=this._redrawBounds;if(this._ctx.save(),g){var k=g.getSize();this._ctx.beginPath(),this._ctx.rect(g.min.x,g.min.y,k.x,k.y),this._ctx.clip()}this._drawing=!0;for(var E=this._drawFirst;E;E=E.next)h=E.layer,(!g||h._pxBounds&&h._pxBounds.intersects(g))&&h._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(h,g){if(this._drawing){var k,E,A,I,K=h._parts,X=K.length,ee=this._ctx;if(X){for(ee.beginPath(),k=0;k<X;k++){for(E=0,A=K[k].length;E<A;E++)I=K[k][E],ee[E?"lineTo":"moveTo"](I.x,I.y);g&&ee.closePath()}this._fillStroke(ee,h)}}},_updateCircle:function(h){if(!(!this._drawing||h._empty())){var g=h._point,k=this._ctx,E=Math.max(Math.round(h._radius),1),A=(Math.max(Math.round(h._radiusY),1)||E)/E;A!==1&&(k.save(),k.scale(1,A)),k.beginPath(),k.arc(g.x,g.y/A,E,0,Math.PI*2,!1),A!==1&&k.restore(),this._fillStroke(k,h)}},_fillStroke:function(h,g){var k=g.options;k.fill&&(h.globalAlpha=k.fillOpacity,h.fillStyle=k.fillColor||k.color,h.fill(k.fillRule||"evenodd")),k.stroke&&k.weight!==0&&(h.setLineDash&&h.setLineDash(g.options&&g.options._dashArray||[]),h.globalAlpha=k.opacity,h.lineWidth=k.weight,h.strokeStyle=k.color,h.lineCap=k.lineCap,h.lineJoin=k.lineJoin,h.stroke())},_onClick:function(h){for(var g=this._map.mouseEventToLayerPoint(h),k,E,A=this._drawFirst;A;A=A.next)k=A.layer,k.options.interactive&&k._containsPoint(g)&&(!(h.type==="click"||h.type==="preclick")||!this._map._draggableMoved(k))&&(E=k);this._fireEvent(E?[E]:!1,h)},_onMouseMove:function(h){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var g=this._map.mouseEventToLayerPoint(h);this._handleMouseHover(h,g)}},_handleMouseOut:function(h){var g=this._hoveredLayer;g&&(Tr(this._container,"leaflet-interactive"),this._fireEvent([g],h,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(h,g){if(!this._mouseHoverThrottled){for(var k,E,A=this._drawFirst;A;A=A.next)k=A.layer,k.options.interactive&&k._containsPoint(g)&&(E=k);E!==this._hoveredLayer&&(this._handleMouseOut(h),E&&(ct(this._container,"leaflet-interactive"),this._fireEvent([E],h,"mouseover"),this._hoveredLayer=E)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,h),this._mouseHoverThrottled=!0,setTimeout(a(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(h,g,k){this._map._fireDOMEvent(g,k||g.type,h)},_bringToFront:function(h){var g=h._order;if(g){var k=g.next,E=g.prev;if(k)k.prev=E;else return;E?E.next=k:k&&(this._drawFirst=k),g.prev=this._drawLast,this._drawLast.next=g,g.next=null,this._drawLast=g,this._requestRedraw(h)}},_bringToBack:function(h){var g=h._order;if(g){var k=g.next,E=g.prev;if(E)E.next=k;else return;k?k.prev=E:E&&(this._drawLast=E),g.prev=null,g.next=this._drawFirst,this._drawFirst.prev=g,this._drawFirst=g,this._requestRedraw(h)}}});function vI(h){return Pe.canvas?new gI(h):null}var tm=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(h){return document.createElement("<lvml:"+h+' class="lvml">')}}catch{}return function(h){return document.createElement("<"+h+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),_ee={_initContainer:function(){this._container=Ot("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(so.prototype._update.call(this),this.fire("update"))},_initPath:function(h){var g=h._container=tm("shape");ct(g,"leaflet-vml-shape "+(this.options.className||"")),g.coordsize="1 1",h._path=tm("path"),g.appendChild(h._path),this._updateStyle(h),this._layers[c(h)]=h},_addPath:function(h){var g=h._container;this._container.appendChild(g),h.options.interactive&&h.addInteractiveTarget(g)},_removePath:function(h){var g=h._container;pr(g),h.removeInteractiveTarget(g),delete this._layers[c(h)]},_updateStyle:function(h){var g=h._stroke,k=h._fill,E=h.options,A=h._container;
vendor: 3,828 bytes, line 693
693A.stroked=!!E.stroke,A.filled=!!E.fill,E.stroke?(g||(g=h._stroke=tm("stroke")),A.appendChild(g),g.weight=E.weight+"px",g.color=E.color,g.opacity=E.opacity,E.dashArray?g.dashStyle=S(E.dashArray)?E.dashArray.join(" "):E.dashArray.replace(/( *, *)/g," "):g.dashStyle="",g.endcap=E.lineCap.replace("butt","flat"),g.joinstyle=E.lineJoin):g&&(A.removeChild(g),h._stroke=null),E.fill?(k||(k=h._fill=tm("fill")),A.appendChild(k),k.color=E.fillColor||E.color,k.opacity=E.fillOpacity):k&&(A.removeChild(k),h._fill=null)},_updateCircle:function(h){var g=h._point.round(),k=Math.round(h._radius),E=Math.round(h._radiusY||k);this._setPath(h,h._empty()?"M0 0":"AL "+g.x+","+g.y+" "+k+","+E+" 0,"+65535*360)},_setPath:function(h,g){h._path.v=g},_bringToFront:function(h){Rd(h._container)},_bringToBack:function(h){Id(h._container)}},ux=Pe.vml?tm:ft,rm=so.extend({_initContainer:function(){this._container=ux("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=ux("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){pr(this._container),Kt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){so.prototype._update.call(this);var h=this._bounds,g=h.getSize(),k=this._container;(!this._svgSize||!this._svgSize.equals(g))&&(this._svgSize=g,k.setAttribute("width",g.x),k.setAttribute("height",g.y)),Ir(k,h.min),k.setAttribute("viewBox",[h.min.x,h.min.y,g.x,g.y].join(" ")),this.fire("update")}},_initPath:function(h){var g=h._path=ux("path");h.options.className&&ct(g,h.options.className),h.options.interactive&&ct(g,"leaflet-interactive"),this._updateStyle(h),this._layers[c(h)]=h},_addPath:function(h){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(h._path),h.addInteractiveTarget(h._path)},_removePath:function(h){pr(h._path),h.removeInteractiveTarget(h._path),delete this._layers[c(h)]},_updatePath:function(h){h._project(),h._update()},_updateStyle:function(h){var g=h._path,k=h.options;g&&(k.stroke?(g.setAttribute("stroke",k.color),g.setAttribute("stroke-opacity",k.opacity),g.setAttribute("stroke-width",k.weight),g.setAttribute("stroke-linecap",k.lineCap),g.setAttribute("stroke-linejoin",k.lineJoin),k.dashArray?g.setAttribute("stroke-dasharray",k.dashArray):g.removeAttribute("stroke-dasharray"),k.dashOffset?g.setAttribute("stroke-dashoffset",k.dashOffset):g.removeAttribute("stroke-dashoffset")):g.setAttribute("stroke","none"),k.fill?(g.setAttribute("fill",k.fillColor||k.color),g.setAttribute("fill-opacity",k.fillOpacity),g.setAttribute("fill-rule",k.fillRule||"evenodd")):g.setAttribute("fill","none"))},_updatePoly:function(h,g){this._setPath(h,ot(h._parts,g))},_updateCircle:function(h){var g=h._point,k=Math.max(Math.round(h._radius),1),E=Math.max(Math.round(h._radiusY),1)||k,A="a"+k+","+E+" 0 1,0 ",I=h._empty()?"M0 0":"M"+(g.x-k)+","+g.y+A+k*2+",0 "+A+-k*2+",0 ";this._setPath(h,I)},_setPath:function(h,g){h._path.setAttribute("d",g)},_bringToFront:function(h){Rd(h._path)},_bringToBack:function(h){Id(h._path)}});Pe.vml&&rm.include(_ee);function yI(h){return Pe.svg||Pe.vml?new rm(h):null}wt.include({getRenderer:function(h){var g=h.options.renderer||this._getPaneRenderer(h.options.pane)||this.options.renderer||this._renderer;return g||(g=this._renderer=this._createRenderer()),this.hasLayer(g)||this.addLayer(g),g},_getPaneRenderer:function(h){if(h==="overlayPane"||h===void 0)return!1;var g=this._paneRenderers[h];return g===void 0&&(g=this._createRenderer({pane:h}),this._paneRenderers[h]=g),g},_createRenderer:function(h){return this.options.preferCanvas&&vI(h)||yI(h)}});var xI=Dd.extend({initialize:function(h,g){Dd.prototype.initialize.call(this,this._boundsToLatLngs(h),g)},setBounds:function(h){return this.setLatLngs(this._boundsToLatLngs(h))}
vendor: 10,461 bytes, line 693
693,_boundsToLatLngs:function(h){return h=te(h),[h.getSouthWest(),h.getNorthWest(),h.getNorthEast(),h.getSouthEast()]}});function kee(h,g){return new xI(h,g)}rm.create=ux,rm.pointsToPath=ot,io.geometryToLayer=nx,io.coordsToLatLng=VS,io.coordsToLatLngs=ix,io.latLngToCoords=WS,io.latLngsToCoords=sx,io.getFeature=Bd,io.asFeature=ax,wt.mergeOptions({boxZoom:!0});var bI=wa.extend({initialize:function(h){this._map=h,this._container=h._container,this._pane=h._panes.overlayPane,this._resetStateTimeout=0,h.on("unload",this._destroy,this)},addHooks:function(){rt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Kt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){pr(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(h){if(!h.shiftKey||h.which!==1&&h.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Kp(),CS(),this._startPoint=this._map.mouseEventToContainerPoint(h),rt(document,{contextmenu:Jc,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(h){this._moved||(this._moved=!0,this._box=Ot("div","leaflet-zoom-box",this._container),ct(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(h);var g=new Y(this._point,this._startPoint),k=g.getSize();Ir(this._box,g.min),this._box.style.width=k.x+"px",this._box.style.height=k.y+"px"},_finish:function(){this._moved&&(pr(this._box),Tr(this._container,"leaflet-crosshair")),Gp(),ES(),Kt(document,{contextmenu:Jc,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(h){if(!(h.which!==1&&h.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0);var g=new J(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(g).fire("boxzoomend",{boxZoomBounds:g})}},_onKeyDown:function(h){h.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});wt.addInitHook("addHandler","boxZoom",bI),wt.mergeOptions({doubleClickZoom:!0});var wI=wa.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(h){var g=this._map,k=g.getZoom(),E=g.options.zoomDelta,A=h.originalEvent.shiftKey?k-E:k+E;g.options.doubleClickZoom==="center"?g.setZoom(A):g.setZoomAround(h.containerPoint,A)}});wt.addInitHook("addHandler","doubleClickZoom",wI),wt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var _I=wa.extend({addHooks:function(){if(!this._draggable){var h=this._map;this._draggable=new ol(h._mapPane,h._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),h.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),h.on("zoomend",this._onZoomEnd,this),h.whenReady(this._onZoomEnd,this))}ct(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Tr(this._map._container,"leaflet-grab"),Tr(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var h=this._map;if(h._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var g=te(this._map.options.maxBounds);this._offsetLimit=U(this._map.latLngToContainerPoint(g.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(g.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;h.fire("movestart").fire("dragstart"),h.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(h){if(this._map.options.inertia){var g=this._lastTime=+new Date,k=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(k),this._times.push(g),this._prunePositions(g)}this._map.fire("move",h).fire("drag",h)},_prunePositions:function(h){for(;this._positions.length>1&&h-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var h=this._map.getSize().divideBy(2),g=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=g.subtract(h).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(h,g){return h-(h-g)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var h=this._draggable._newPos.subtract(this._draggable._startPos),g=this._offsetLimit;h.x<g.min.x&&(h.x=this._viscousLimit(h.x,g.min.x)),h.y<g.min.y&&(h.y=this._viscousLimit(h.y,g.min.y)),h.x>g.max.x&&(h.x=this._viscousLimit(h.x,g.max.x)),h.y>g.max.y&&(h.y=this._viscousLimit(h.y,g.max.y)),this._draggable._newPos=this._draggable._startPos.add(h)}},_onPreDragWrap:function(){var h=this._worldWidth,g=Math.round(h/2),k=this._initialWorldOffset,E=this._draggable._newPos.x,A=(E-g+k)%h+g-k,I=(E+g+k)%h-g-k,K=Math.abs(A+k)<Math.abs(I+k)?A:I;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=K},_onDragEnd:function(h){var g=this._map,k=g.options,E=!k.inertia||h.noInertia||this._times.length<2;if(g.fire("dragend",h),E)g.fire("moveend");else{this._prunePositions(+new Date);var A=this._lastPos.subtract(this._positions[0]),I=(this._lastTime-this._times[0])/1e3,K=k.easeLinearity,X=A.multiplyBy(K/I),ee=X.distanceTo([0,0]),he=Math.min(k.inertiaMaxSpeed,ee),Se=X.multiplyBy(he/ee),qe=he/(k.inertiaDeceleration*K),mt=Se.multiplyBy(-qe/2).round();!mt.x&&!mt.y?g.fire("moveend"):(mt=g._limitOffset(mt,g.options.maxBounds),B(function(){g.panBy(mt,{duration:qe,easeLinearity:K,noMoveStart:!0,animate:!0})}))}}});wt.addInitHook("addHandler","dragging",_I),wt.mergeOptions({keyboard:!0,keyboardPanDelta:80});var kI=wa.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(h){this._map=h,this._setPanDelta(h.options.keyboardPanDelta),this._setZoomDelta(h.options.zoomDelta)},addHooks:function(){var h=this._map._container;h.tabIndex<=0&&(h.tabIndex="0"),rt(h,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Kt(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var h=document.body,g=document.documentElement,k=h.scrollTop||g.scrollTop,E=h.scrollLeft||g.scrollLeft;this._map._container.focus(),window.scrollTo(E,k)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(h){var g=this._panKeys={},k=this.keyCodes,E,A;for(E=0,A=k.left.length;E<A;E++)g[k.left[E]]=[-1*h,0];for(E=0,A=k.right.length;E<A;E++)g[k.right[E]]=[h,0];for(E=0,A=k.down.length;E<A;E++)g[k.down[E]]=[0,h];for(E=0,A=k.up.length;E<A;E++)g[k.up[E]]=[0,-1*h]},_setZoomDelta:function(h){var g=this._zoomKeys={},k=this.keyCodes,E,A;for(E=0,A=k.zoomIn.length;E<A;E++)g[k.zoomIn[E]]=h;for(E=0,A=k.zoomOut.length;E<A;E++)g[k.zoomOut[E]]=-h},_addHooks:function(){rt(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Kt(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(h){if(!(h.altKey||h.ctrlKey||h.metaKey)){var g=h.keyCode,k=this._map,E;if(g in this._panKeys){if(!k._panAnim||!k._panAnim._inProgress)if(E=this._panKeys[g],h.shiftKey&&(E=G(E).multiplyBy(3)),k.options.maxBounds&&(E=k._limitOffset(G(E),k.options.maxBounds)),k.options.worldCopyJump){var A=k.wrapLatLng(k.unproject(k.project(k.getCenter()).add(E)));k.panTo(A)}else k.panBy(E)}else if(g in this._zoomKeys)k.setZoom(k.getZoom()+(h.shiftKey?3:1)*this._zoomKeys[g]);else if(g===27&&k._popup&&k._popup.options.closeOnEscapeKey)k.closePopup();else return;Jc(h)}}});wt.addInitHook("addHandler","keyboard",kI),wt.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var SI=wa.extend({addHooks:function(){rt(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Kt(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(h){var g=GR(h),k=this._map.options.wheelDebounceTime;this._delta+=g,this._lastMousePos=this._map.mouseEventToContainerPoint(h),this._startTime||(this._startTime=+new Date);var E=Math.max(k-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(a(this._performZoom,this),E),Jc(h)},_performZoom:function(){var h=this._map,g=h.getZoom(),k=this._map.options.zoomSnap||0;h._stop();var E=this._delta/(this._map.options.wheelPxPerZoomLevel*4),A=4*Math.log(2/(1+Math.exp(-Math.abs(E))))/Math.LN2,I=k?Math.ceil(A/k)*k:A,K=h._limitZoom(g+(this._delta>0?I:-I))-g;this._delta=0,this._startTime=null,K&&(h.options.scrollWheelZoom==="center"?h.setZoom(g+K):h.setZoomAround(this._lastMousePos,g+K))}});wt.addInitHook("addHandler","scrollWheelZoom",SI);var See=600;wt.mergeOptions({tapHold:Pe.touchNative&&Pe.safari&&Pe.mobile,tapTolerance:15});var jI=wa.extend({addHooks:function(){rt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Kt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(h){if(clearTimeout(this._holdTimeout),h.touches.length===1){var g=h.touches[0];this._startPos=this._newPos=new z(g.clientX,g.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(rt(document,"touchend",xn),rt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",g))},this),See),rt(document,"touchend touchcancel contextmenu",this._cancel,this),rt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function h(){Kt(document,"touchend",xn),Kt(document,"touchend touchcancel",h)}
693,_cancel:function(){clearTimeout(this._holdTimeout),Kt(document,"touchend touchcancel contextmenu",this._cancel,this),Kt(document,"touchmove",this._onMove,this)},_onMove:function(h){var g=h.touches[0];this._newPos=new z(g.clientX,g.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(h,g){var k=new MouseEvent(h,{bubbles:!0,cancelable:!0,view:window,screenX:g.screenX,screenY:g.screenY,clientX:g.clientX,clientY:g.clientY});k._simulated=!0,g.target.dispatchEvent(k)}});wt.addInitHook("addHandler","tapHold",jI),wt.mergeOptions({touchZoom:Pe.touch,bounceAtZoomLimits:!0});var NI=wa.extend({addHooks:function(){ct(this._map._container,"leaflet-touch-zoom"),rt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Tr(this._map._container,"leaflet-touch-zoom"),Kt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(h){var g=this._map;if(!(!h.touches||h.touches.length!==2||g._animatingZoom||this._zooming)){var k=g.mouseEventToContainerPoint(h.touches[0]),E=g.mouseEventToContainerPoint(h.touches[1]);this._centerPoint=g.getSize()._divideBy(2),this._startLatLng=g.containerPointToLatLng(this._centerPoint),g.options.touchZoom!=="center"&&(this._pinchStartLatLng=g.containerPointToLatLng(k.add(E)._divideBy(2))),this._startDist=k.distanceTo(E),this._startZoom=g.getZoom(),this._moved=!1,this._zooming=!0,g._stop(),rt(document,"touchmove",this._onTouchMove,this),rt(document,"touchend touchcancel",this._onTouchEnd,this),xn(h)}},_onTouchMove:function(h){if(!(!h.touches||h.touches.length!==2||!this._zooming)){var g=this._map,k=g.mouseEventToContainerPoint(h.touches[0]),E=g.mouseEventToContainerPoint(h.touches[1]),A=k.distanceTo(E)/this._startDist;if(this._zoom=g.getScaleZoom(A,this._startZoom),!g.options.bounceAtZoomLimits&&(this._zoom<g.getMinZoom()&&A<1||this._zoom>g.getMaxZoom()&&A>1)&&(this._zoom=g._limitZoom(this._zoom)),g.options.touchZoom==="center"){if(this._center=this._startLatLng,A===1)return}else{var I=k._add(E)._divideBy(2)._subtract(this._centerPoint);if(A===1&&I.x===0&&I.y===0)return;this._center=g.unproject(g.project(this._pinchStartLatLng,this._zoom).subtract(I),this._zoom)}this._moved||(g._moveStart(!0,!1),this._moved=!0),R(this._animRequest);var K=a(g._move,g,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=B(K,this,!0),xn(h)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,R(this._animRequest),Kt(document,"touchmove",this._onTouchMove,this),Kt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});wt.addInitHook("addHandler","touchZoom",NI),wt.BoxZoom=bI,wt.DoubleClickZoom=wI,wt.Drag=_I,wt.Keyboard=kI,wt.ScrollWheelZoom=SI,wt.TapHold=jI,wt.TouchZoom=NI,r.Bounds=Y,r.Browser=Pe,r.CRS=oe,r.Canvas=gI,r.Circle=HS,r.CircleMarker=rx,r.Class=F,r.Control=Vs,r.DivIcon=hI,r.DivOverlay=_a,r.DomEvent=UQ,r.DomUtil=FQ,r.Draggable=ol,r.Evented=W,r.FeatureGroup=ro,r.GeoJSON=io,r.GridLayer=em,r.Handler=wa,r.Icon=$d,r.ImageOverlay=ox,r.LatLng=re,r.LatLngBounds=J,r.Layer=Ws,r.LayerGroup=Ld,r.LineUtil=tee,r.Map=wt,r.Marker=tx,r.Mixin=ZQ,r.Path=ll,r.Point=z,r.PolyUtil=JQ,r.Polygon=Dd,r.Polyline=no,r.Popup=lx,r.PosAnimation=ZR,r.Projection=ree,r.Rectangle=xI,r.Renderer=so,r.SVG=rm,r.SVGOverlay=fI,r.TileLayer=Fd,r.Tooltip=cx,r.Transformation=be,r.Util=M,r.VideoOverlay=dI,r.bind=a,r.bounds=U,r.canvas=vI,r.circle=uee,r.circleMarker=cee,r.control=Yp,r.divIcon=xee,r.extend=i,r.featureGroup=aee,r.geoJSON=uI,r.geoJson=hee,r.gridLayer=bee,r.icon=oee,r.imageOverlay=pee,r.latLng=ae,r.latLngBounds=te,r.layerGroup=see,r.map=HQ,r.marker=lee,r.point=G,r.polygon=fee,r.polyline=dee,r.popup=vee,r.rectangle=kee,r.setOptions=v,r.stamp=c,r.svg=yI,r.svgOverlay=gee,r.tileLayer=pI,r.tooltip=yee,r.transformation=Q,r.version=n,r.videoOverlay=mee;var jee=window.L;r.noConflict=function(){return window.L=jee,this},window.L=r})})(aO,aO.exports);var Py=aO.exports;const Iq=St(Py);function E2(t,e,r){return Object.freeze({instance:t,context:e,container:r})}function O2(t,e){return e==null?function(n,i){const s=x.useRef();return s.current||(s.current=t(n,i)),s}:function(n,i){const s=x.useRef();s.current||(s.current=t(n,i));const a=x.useRef(n),{instance:o}=s.current;return x.useEffect(function(){a.current!==n&&(e(o,n,a.current),a.current=n)},[o,n,i]),s}}function zye(t,e){x.useEffect(function(){return(e.layerContainer??e.map).addLayer(t.instance),function(){var s;(s=e.layerContainer)==null||s.removeLayer(t.instance),e.map.removeLayer(t.instance)}},[e,t])}function Lq(t){return function(r){const n=Mq(),i=t(C2(r,n),n);return Tq(n.map,r.attribution),Rq(i.current,r.eventHandlers),zye(i.current,n),i}}function Uye(t,e){const r=O2(t,e),n=Lq(r);return $ye(n)}function Hye(t,e){const r=O2(t),n=Fye(r,e);return Dye(n)}function Vye(t,e){const r=O2(t,e),n=Lq(r);return Bye(n)}function Wye(t,e,r){const{opacity:n,zIndex:i}=e;n!=null&&n!==r.opacity&&t.setOpacity(n),i!=null&&i!==r.zIndex&&t.setZIndex(i)}function oO(){return oO=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];
693for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},oO.apply(this,arguments)}function qye({bounds:t,boundsOptions:e,center:r,children:n,className:i,id:s,placeholder:a,style:o,whenReady:c,zoom:u,...d},f){const[p]=x.useState({className:i,id:s,style:o}),[m,y]=x.useState(null);x.useImperativeHandle(f,()=>(m==null?void 0:m.map)??null,[m]);const v=x.useCallback(b=>{if(b!==null&&m===null){const _=new Py.Map(b,d);r!=null&&u!=null?_.setView(r,u):t!=null&&_.fitBounds(t,e),c!=null&&_.whenReady(c),y(Iye(_))}},[]);x.useEffect(()=>()=>{m==null||m.map.remove()},[m]);const w=m?D.createElement(Pq,{value:m},n):a??null;return D.createElement("div",oO({},p,{ref:v}),w)}const Kye=x.forwardRef(qye),Gye=Uye(function({position:e,...r},n){const i=new Py.Marker(e,r);return E2(i,Lye(n,{overlayContainer:i}))},function(e,r,n){r.position!==n.position&&e.setLatLng(r.position),r.icon!=null&&r.icon!==n.icon&&e.setIcon(r.icon),r.zIndexOffset!=null&&r.zIndexOffset!==n.zIndexOffset&&e.setZIndexOffset(r.zIndexOffset),r.opacity!=null&&r.opacity!==n.opacity&&e.setOpacity(r.opacity),e.dragging!=null&&r.draggable!==n.draggable&&(r.draggable===!0?e.dragging.enable():e.dragging.disable())}),Zye=Hye(function(e,r){const n=new Py.Popup(e,r.overlayContainer);return E2(n,r)},function(e,r,{position:n},i){x.useEffect(function(){const{instance:a}=e;function o(u){u.popup===a&&(a.update(),i(!0))}function c(u){u.popup===a&&i(!1)}return r.map.on({popupopen:o,popupclose:c}),r.overlayContainer==null?(n!=null&&a.setLatLng(n),a.openOn(r.map)):r.overlayContainer.bindPopup(a),function(){var d;r.map.off({popupopen:o,popupclose:c}),(d=r.overlayContainer)==null||d.unbindPopup(),r.map.removeLayer(a)}},[e,r,i,n])}),Jye=Vye(function({url:e,...r},n){const i=new Py.TileLayer(e,C2(r,n));return E2(i,n)},function(e,r,n){Wye(e,r,n);const{url:i}=r;i!=null&&i!==n.url&&e.setUrl(i)});delete Iq.Icon.Default.prototype._getIconUrl;Iq.Icon.Default.mergeOptions({iconRetinaUrl:"https://unpkg.com/[email protected]/dist/images/marker-icon-2x.png",iconUrl:"https://unpkg.com/[email protected]/dist/images/marker-icon.png",shadowUrl:"https://unpkg.com/[email protected]/dist/images/marker-shadow.png"});const Yye=({address:t,city:e})=>{const[r,n]=x.useState(null),[i,s]=x.useState(!1),[a,o]=x.useState(!0),[c,u]=x.useState(!1),d=x.useRef(!1);return x.useEffect(()=>{d.current=!1,o(!0),u(!1),n(null),s(!1);const f=t==null?void 0:t.replace(/\s*\d+.*$/,"").trim(),p=[];if(t&&p.push({q:[t,e,"Sverige"].filter(Boolean).join(", "),exact:!0}),f&&f!==t&&p.push({q:[f,e,"Sverige"].filter(Boolean).join(", "),exact:!0}),e&&p.push({q:`${e}, Sverige`,exact:!1}),p.length===0){o(!1),u(!0);return}return(async()=>{for(const m of p)try{const v=await(await fetch(`https://nominatim.openstreetmap.org/search?format=json&limit=1&q=${encodeURIComponent(m.q)}`,{headers:{Accept:"application/json"}})).json();if(d.current)return;if(v&&v.length>0){n([parseFloat(v[0].lat),parseFloat(v[0].lon)]),s(!m.exact),o(!1);return}}catch{}d.current||(u(!0),o(!1))})(),()=>{d.current=!0}},[t,e]),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("h3",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[l.jsx(Vn,{className:"h-5 w-5 text-primary"}),"Plats"]}),l.jsxs("div",{className:"rounded-xl overflow-hidden border border-border/60 shadow-card bg-muted h-[320px] md:h-[380px] relative",children:[a&&l.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:l.jsx(js,{className:"h-5 w-5 animate-spin text-primary"})}),!a&&c&&l.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-sm text-muted-foreground",children:"Kunde inte ladda kartan för denna adress."}),!a&&r&&l.jsxs(Kye,{center:r,zoom:i?12:15,scrollWheelZoom:!1,style:{height:"100%",width:"100%"},children:[l.jsx(Jye,{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),l.jsx(Gye,{position:r,children:l.jsxs(Zye,{children:[t,e?`, ${e}`:""]})})]},`${r[0]},${r[1]}`)]}),!a&&r&&i&&l.jsx("p",{className:"text-xs text-muted-foreground",children:"Exakt adress saknas i kartdatan – kartan visar ungefärligt omrÃ¥de."})]})},Xye=()=>new Date().toISOString().split("T")[0],Y0=t=>!!t&&t<Xye(),$q=(t,e,r="—")=>e?"OmgÃ¥ende":t?Y0(t)?"OmgÃ¥ende":t:r,Dq=(t,e,r="—")=>e?"Tillsvidare":t?Y0(t)?"Tillsvidare":t:r,Qye=()=>{var m;const{id:t}
693=gy(),[e,r]=x.useState(null),[n,i]=x.useState(!0);if(x.useEffect(()=>{(async()=>{if(!t)return;const{data:v}=await ie.from("properties").select(G_).eq("id",t).maybeSingle();r(v??null),i(!1)})()},[t]),n)return l.jsxs("div",{className:"min-h-screen bg-background",children:[l.jsx(Pr,{}),l.jsx(Vr,{}),l.jsx("div",{className:"flex justify-center items-center py-32",children:l.jsx(js,{className:"h-6 w-6 animate-spin text-primary"})}),l.jsx(Mr,{})]});if(!e)return l.jsxs("div",{className:"min-h-screen bg-background",children:[l.jsx(Pr,{}),l.jsx(Vr,{}),l.jsxs("div",{className:"container mx-auto px-4 py-32 text-center",children:[l.jsx("h1",{className:"text-2xl font-bold text-foreground mb-2",children:"Objektet hittades inte"}),l.jsx("p",{className:"text-muted-foreground",children:"Det kan ha tagits bort eller är inte längre tillgängligt."})]}),l.jsx(Mr,{})]});const s=e.street_address?`${e.street_address}${e.city?`, ${e.city}`:""}`:`${e.property_type} · ${e.rooms} rum`,a=e.city||"Stockholm",o=(m=e.images)!=null&&m.length?e.images:[],c=e.furnished&&e.unfurnished?"Valbart":e.furnished?"Möblerad":"Omöblerad",u=$q(e.move_in_date,e.immediate),d=Dq(e.move_out_date,e.indefinite),f=`${s} | Företagslogi`,p=[`Företagslägenhet på ${s}`,`${e.rooms} rum`,e.area_sqm?`${e.area_sqm} m²`:null,c.toLowerCase(),`inflytt ${u.toLowerCase()}`].filter(Boolean).join(", ")+". Hyr via Företagslogi.";return l.jsxs("div",{className:"min-h-screen bg-background",children:[l.jsxs(kP,{children:[l.jsx("title",{children:f.slice(0,60)}),l.jsx("meta",{name:"description",content:p.slice(0,158)}),l.jsx("meta",{property:"og:title",content:f}),l.jsx("meta",{property:"og:description",content:p.slice(0,158)})]}),l.jsx(Pr,{}),l.jsx(Vr,{currentLabel:s}),l.jsx("main",{className:"pt-4 md:pt-6",children:l.jsxs("div",{className:"container mx-auto px-4 md:px-6",children:[l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-5 gap-6 lg:gap-8",children:[l.jsx("div",{className:"lg:col-span-3",children:l.jsx(Jge,{images:o})}),l.jsx("div",{className:"lg:col-span-2",children:l.jsx("div",{className:"lg:sticky lg:top-24",children:l.jsx(Cye,{title:s,address:e.street_address||"",area:a,priceFurnished:e.furnished_rent?Number(e.furnished_rent):void 0,priceUnfurnished:e.unfurnished_rent?Number(e.unfurnished_rent):void 0,furnishing:c,moveIn:u,moveOut:d,agent:jye(e.assigned_agent)})})})]}),l.jsx(Eye,{sqm:e.area_sqm?Number(e.area_sqm):0,rooms:e.rooms,bedrooms:e.bedrooms,bathrooms:e.bathrooms||0,furnishing:c}),l.jsxs("div",{className:"max-w-3xl space-y-8 py-8",children:[e.description&&l.jsx(Oye,{text:e.description}),e.included_in_rent&&e.included_in_rent.length>0&&l.jsx(Tye,{included:e.included_in_rent}),l.jsx(Pye,{extras:e.amenities||[],buildYear:e.built_year||void 0,renovatedYear:e.renovated_year||void 0}),(e.street_address||e.city)&&l.jsx(Yye,{address:e.street_address||"",city:e.city||void 0})]}),l.jsx("div",{className:"max-w-3xl pb-12",id:"kontakta-uthyrare",children:l.jsx(Mye,{})})]})}),l.jsx(Mr,{}),l.jsx("div",{className:"fixed bottom-0 left-0 right-0 p-3 bg-background/95 backdrop-blur-lg border-t border-border/50 lg:hidden z-40",children:l.jsx(se,{variant:"hero",size:"lg",className:"w-full h-12 text-base",asChild:!0,children:l.jsxs("a",{href:"#kontakta-uthyrare",children:[l.jsx(ai,{className:"h-4 w-4 mr-2"}),"Kontakta uthyrare"]})})})]})};function T2({values:t,onChange:e,options:r,placeholder:n="Välj städer / områden",className:i}){const[s,a]=x.useState(!1),o=u=>{t.includes(u)?e(t.filter(d=>d!==u)):e([...t,u])},c=u=>e(t.filter(d=>d!==u));return l.jsxs("div",{className:fe("space-y-2",i),children:[l.jsxs(h2,{open:s,onOpenChange:a,children:[l.jsx(p2,{asChild:!0,children:l.jsxs(se,{variant:"outline",role:"combobox","aria-expanded":s,className:"w-full justify-between font-normal",children:[l.jsxs("span",{className:"flex items-center gap-2 truncate text-muted-foreground",children:[l.jsx(Vn,{className:"h-4 w-4 shrink-0 opacity-60"}),t.length===0?n:`${t.length} ${t.length===1?"område valt":"områden valda"}`]}),l.jsx(bH,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),l.jsx(U_,{className:"w-[--radix-popover-trigger-width] p-0 bg-popover",align:"start",children:l.jsxs(a2,{children:[l.jsx(o2,{placeholder:"Sök stad eller område…"}),l.jsxs(l2,{className:"max-h-72",children:[l.jsx(c2,{children:"Ingen stad hittades."}),l.jsx(u2,{children:r.map(u=>{const d=t.includes(u);return l.jsxs(d2,{value:u,onSelect:()=>o(u),children:[l.jsx(yp,{className:fe("mr-2 h-4 w-4",d?"opacity-100 text-primary":"opacity-0")}),u]},u)})})]})]})})]}),t.length>0&&l.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(u=>l.jsxs(Vt,{variant:"secondary",className:"pl-2.5 pr-1 py-1 gap-1",children:[u,l.
693jsx("button",{type:"button",onClick:()=>c(u),className:"ml-0.5 rounded-full hover:bg-background/50 p-0.5","aria-label":`Ta bort ${u}`,children:l.jsx(Wi,{className:"h-3 w-3"})})]},u))})]})}const ID=Object.entries(V0).map(([t,[e,r]])=>({name:t,latitude:e,longitude:r}));function Ep(){const[t,e]=x.useState([]),[r,n]=x.useState(!0);x.useEffect(()=>{let c=!0;return(async()=>{const{data:u}=await ie.from("cities").select("name, latitude, longitude");c&&(e((u||[]).map(d=>({name:d.name,latitude:d.latitude!==null?Number(d.latitude):null,longitude:d.longitude!==null?Number(d.longitude):null}))),n(!1))})(),()=>{c=!1}},[]);const i=new Set(ID.map(c=>c.name.toLowerCase())),s=[...ID,...t.filter(c=>!i.has(c.name.toLowerCase()))],a=s.map(c=>c.name).sort((c,u)=>c.localeCompare(u,"sv")),o={};return s.forEach(c=>{c.latitude!==null&&c.longitude!==null&&(o[c.name]=[c.latitude,c.longitude])}),{cities:a,coords:o,loading:r}}const LD=({filters:t,onChange:e})=>{const{cities:r}=Ep(),[n,i]=x.useState([]);x.useEffect(()=>{let o=!0;return(async()=>{const{data:c}=await ie.from("properties").select("city").eq("status","approved").not("city","is",null);if(!o)return;const u=new Set;(c??[]).forEach(d=>d.city&&u.add(d.city)),i(Array.from(u))})(),()=>{o=!1}},[]);const s=Array.from(new Set([...r,...n])).sort((o,c)=>o.localeCompare(c,"sv")),a=(o,c)=>e({...t,[o]:c});return l.jsxs("div",{className:"bg-card rounded-xl border border-border/60 shadow-card p-5 space-y-6",children:[l.jsxs("div",{className:"flex items-center gap-2 pb-4 border-b border-border/60",children:[l.jsx(LP,{className:"h-4 w-4 text-foreground"}),l.jsx("span",{className:"font-semibold text-foreground",children:"Filter"})]}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[l.jsx(Ss,{className:"h-4 w-4 text-muted-foreground"}),"Bostadstyp"]}),l.jsx("div",{className:"flex flex-wrap gap-2",children:vhe.map(o=>l.jsx("button",{onClick:()=>a("type",o),className:fe("px-3.5 py-1.5 rounded-full text-sm font-medium border transition-colors",t.type===o?"bg-primary text-primary-foreground border-primary":"bg-background text-foreground border-border hover:border-primary/40"),children:o},o))})]}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[l.jsx(Vn,{className:"h-4 w-4 text-muted-foreground"}),"Välj stad/städer"]}),l.jsx(T2,{values:t.areas,onChange:o=>a("areas",o),options:s,placeholder:"Alla områden"})]}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[l.jsx(EH,{className:"h-4 w-4 text-muted-foreground"}),"Utöka område med"]}),l.jsxs(Nt,{value:String(t.radiusKm),onValueChange:o=>a("radiusKm",Number(o)),disabled:t.areas.length===0,children:[l.jsx(_t,{className:"w-full",children:l.jsx(Ct,{placeholder:"+ 0 km"})}),l.jsx(kt,{children:g2.map(o=>l.jsx(De,{value:String(o),children:o===0?"Endast valda städer":`+ ${o} km`},o))})]}),t.areas.length===0&&l.jsx("p",{className:"text-xs text-muted-foreground",children:"Välj en eller flera städer"})]}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[l.jsx(qae,{className:"h-4 w-4 text-muted-foreground"}),"Max hyra"]}),l.jsxs(Nt,{value:String(t.maxRent),onValueChange:o=>a("maxRent",Number(o)),children:[l.jsx(_t,{className:"w-full",children:l.jsx(Ct,{placeholder:"Max hyra"})}),l.jsxs(kt,{children:[l.jsx(De,{value:"0",children:"Ingen gräns"}),ghe.filter(o=>o>0).map(o=>l.jsxs(De,{value:String(o),children:[o.toLocaleString("sv-SE")," kr/mån"]},o))]})]})]}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[l.jsx(vp,{className:"h-4 w-4 text-muted-foreground"}),"Antal rum"]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wide mb-1",children:"Min"}),l.jsxs(Nt,{value:String(t.roomsMin),onValueChange:o=>a("roomsMin",Number(o)),children:[l.jsx(_t,{className:"w-full",children:l.jsx(Ct,{placeholder:"Min"})}),l.jsxs(kt,{children:[l.jsx(De,{value:"0",children:"Min"}),nD.map(o=>l.jsx(De,{value:String(o),children:o},o))]})]})]}),l.jsx("span",{className:"text-muted-foreground mt-5",children:"—"}),l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wide mb-1",children:"Max"}),l.jsxs(Nt,{value:String(t.roomsMax),onValueChange:o=>a("roomsMax",Number(o)),children:[l.jsx(_t,{className:"w-full",children:l.jsx(Ct,{placeholder:"Max"})}),l.jsxs(kt,{children:[l.jsx(De,{value:"0",children:"Max"}),nD.map(o=>l.jsx(De,{value:String(o),children:o},o))]})]})]})]})]}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[l.jsx(pH,{className:"h-4 w-4 text-muted-foreground"}),"Möblering"]}),l.jsx("div",{className:"flex flex-wrap gap-2",children:yhe.map(o=>l.jsx("button",{onClick:()=>a("furnishing",o),className:fe("px-3.5 py-1.5 rounded-full text-sm font-medium border transition-colors",t.furnishing===o?"bg-primary text-primary-foreground border-primary":"bg-background text-foreground border-border hover:border-primary/40"),children:o},o))})]})]})},Bq=$_,exe=i2,txe=D_,Fq=x.forwardRef(({className:t,...e},r)=>l.jsx(Sp,{className:fe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:r}));Fq.displayName=Sp.displayName;const rxe=gp("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),A2=x.forwardRef(({side:t="right",className:e,children:r,...n},i)=>l.jsxs(txe,{children:[l.jsx(Fq,{}),l.jsxs(jp,{ref:i,className:fe(rxe({side:t}),e),...n,children:[r,l.jsxs(B_,{className:"absolute right-4 top-4 roun
693ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[l.jsx(Wi,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));A2.displayName=jp.displayName;const nxe=x.forwardRef(({className:t,...e},r)=>l.jsx(Sy,{ref:r,className:fe("text-lg font-semibold text-foreground",t),...e}));nxe.displayName=Sy.displayName;const ixe=x.forwardRef(({className:t,...e},r)=>l.jsx(jy,{ref:r,className:fe("text-sm text-muted-foreground",t),...e}));ixe.displayName=jy.displayName;var Q_="Collapsible",[sxe,zq]=Kn(Q_),[axe,P2]=sxe(Q_),Uq=x.forwardRef((t,e)=>{const{__scopeCollapsible:r,open:n,defaultOpen:i,disabled:s,onOpenChange:a,...o}=t,[c,u]=Yi({prop:n,defaultProp:i??!1,onChange:a,caller:Q_});return l.jsx(axe,{scope:r,disabled:s,contentId:tn(),open:c,onOpenToggle:x.useCallback(()=>u(d=>!d),[u]),children:l.jsx(Oe.div,{"data-state":R2(c),"data-disabled":s?"":void 0,...o,ref:e})})});Uq.displayName=Q_;var Hq="CollapsibleTrigger",Vq=x.forwardRef((t,e)=>{const{__scopeCollapsible:r,...n}=t,i=P2(Hq,r);return l.jsx(Oe.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":R2(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...n,ref:e,onClick:we(t.onClick,i.onOpenToggle)})});Vq.displayName=Hq;var M2="CollapsibleContent",Wq=x.forwardRef((t,e)=>{const{forceMount:r,...n}=t,i=P2(M2,t.__scopeCollapsible);return l.jsx(di,{present:r||i.open,children:({present:s})=>l.jsx(oxe,{...n,ref:e,present:s})})});Wq.displayName=M2;var oxe=x.forwardRef((t,e)=>{const{__scopeCollapsible:r,present:n,children:i,...s}=t,a=P2(M2,r),[o,c]=x.useState(n),u=x.useRef(null),d=it(e,u),f=x.useRef(0),p=f.current,m=x.useRef(0),y=m.current,v=a.open||o,w=x.useRef(v),b=x.useRef(void 0);return x.useEffect(()=>{const _=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(_)},[]),hn(()=>{const _=u.current;if(_){b.current=b.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const S=_.getBoundingClientRect();f.current=S.height,m.current=S.width,w.current||(_.style.transitionDuration=b.current.transitionDuration,_.style.animationName=b.current.animationName),c(n)}},[a.open,n]),l.jsx(Oe.div,{"data-state":R2(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!v,...s,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...t.style},children:v&&i})});function R2(t){return t?"open":"closed"}var lxe=Uq,cxe=Vq,uxe=Wq,va="Accordion",dxe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[I2,fxe,hxe]=vy(va),[ek,HZe]=Kn(va,[hxe,zq]),L2=zq(),qq=D.forwardRef((t,e)=>{const{type:r,...n}=t,i=n,s=n;return l.jsx(I2.Provider,{scope:t.__scopeAccordion,children:r==="multiple"?l.jsx(vxe,{...s,ref:e}):l.jsx(gxe,{...i,ref:e})})});qq.displayName=va;var[Kq,pxe]=ek(va),[Gq,mxe]=ek(va,{collapsible:!1}),gxe=D.forwardRef((t,e)=>{const{value:r,defaultValue:n,onValueChange:i=()=>{},collapsible:s=!1,...a}=t,[o,c]=Yi({prop:r,defaultProp:n??"",onChange:i,caller:va});return l.jsx(Kq,{scope:t.__scopeAccordion,value:D.useMemo(()=>o?[o]:[],[o]),onItemOpen:c,onItemClose:D.useCallback(()=>s&&c(""),[s,c]),children:l.jsx(Gq,{scope:t.__scopeAccordion,collapsible:s,children:l.jsx(Zq,{...a,ref:e})})})}),vxe=D.forwardRef((t,e)=>{const{value:r,defaultValue:n,onValueChange:i=()=>{},...s}=t,[a,o]=Yi({prop:r,defaultProp:n??[],onChange:i,caller:va}),c=D.useCallback(d=>o((f=[])=>[...f,d]),[o]),u=D.useCallback(d=>o((f=[])=>f.filter(p=>p!==d)),[o]);return l.jsx(Kq,{scope:t.__scopeAccordion,value:a,onItemOpen:c,onItemClose:u,children:l.jsx(Gq,{scope:t.__scopeAccordion,collapsible:!0,children:l.jsx(Zq,{...s,ref:e})})})}),[yxe,tk]=ek(va),Zq=D.forwardRef((t,e)=>{const{__scopeAccordion:r,disabled:n,dir:i,orientation:s="vertical",...a}=t,o=D.useRef(null),c=it(o,e),u=fxe(r),f=wy(i)==="ltr",p=we(t.onKeyDown,m=>{var P;if(!dxe.includes(m.key))return;const y=m.target,v=u().filter(T=>{var $;return!(($=T.ref.current)!=null&&$.disabled)}),w=v.findIndex(T=>T.ref.current===y),b=v.length;if(w===-1)return;m.preventDefault();let _=w;const S=0,N=b-1,j=()=>{_=w+1,_>N&&(_=S)},C=()=>{_=w-1,_<S&&(_=N)};switch(m.key){case"Home":_=S;break;case"End":_=N;break;case"ArrowRight":s==="horizontal"&&(f?j():C());break;case"ArrowDown":s==="vertical"&&j();break;case"ArrowLeft":s==="horizontal"&&(f?C():j());break;case"ArrowUp":s==="vertical"&&C();break}const O=_%b;(P=v[O].ref.current)==null||P.focus()});return l.jsx(yxe,{scope:r,disabled:n,direction:i,orientation:s,children:l.jsx(I2.Slot,{scope:r,children:l.jsx(Oe.div,{...a,"data-orientation":s,ref:c,onKeyDown:n?void 0:p})})})}),X0="AccordionItem",[xxe,$2]=ek(X0),Jq=D.forwardRef((t,e)=>{const{__scopeAccordion:r,value:n,...i}=t,s=tk(X0,r),a=pxe(X0,r),o=L2(r),c=tn(),u=n&&a.value.includes(n)||!1,d=s.disabled||t.disabled;return l.jsx(xxe,{scope:r,open:u,disabled:d,triggerId:c,children:l.jsx(lxe,{"data-orientation":s.orientation,"data-state":r7(u),...o,...i,ref:e,disabled:d,open:u,onOpenChange:f=>{f?a.onItemOpen(n):a.onItemClose(n)}})})});Jq.displayName=X0;var Yq="AccordionHeader",Xq=D.forwardRef((t,e)=>{const{__scopeAccordion:r,...n}=t,i=tk(va,r),s=$2(Yq,r);return l.jsx(Oe.h3,{"data-orientation":i.orientation,"data-state":r7(s.open),"data-disabled":s.disabled?"":void 0,...n,ref:e})});Xq.displayName=Yq;var lO="AccordionTrigger",Qq=D.forwardRef((t,e)=>{const{__scopeAccordion:r,...n}=t,i=tk(va,r),s=$2(lO,r),a=mxe(lO,r),o=L2(r);return l.jsx(I2.ItemSlot,{scope:r,children:l.jsx(cxe,{"aria-disabled":s.open&&!a.collapsible||void 0,"data-orientation":i.orientation,id:s.triggerId,...o,...n,ref:e})})});Qq.displayName=lO;var e7="AccordionContent",t7=D.forwardRef((t,e)=>{const{__scopeAccordion:r,...n}=t,i=tk(va,r),s=$2(e7,r),a=L2(r);return l.jsx(uxe,{role:"region","aria-labelledby":s.triggerId,"data-orientation":i.orientation,...a,...n,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});t7.displayName=e7;function r7(t){return t?"open":"closed"}var bxe=qq,wxe=Jq,_xe=Xq,n7=Qq,i7=t7;const kxe=bxe,s7=x.forwardRef(({className:t,...e},r)=>l.jsx(wxe,{ref:r,className:fe("border-b",t),...e}));s7.displayName="AccordionItem";const a7=x.forwardRef(({className:t,children:e,...r},n)=>l.jsx(_xe,{className:"flex",children:l.jsxs(n7,{ref:n,className:fe("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...r,children:[e,l.jsx(xp,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));a7.displayName=n7.displayName;const o7=x.forwardRef(({className:t,children:e,...r},n)=>l.jsx(i7,{ref:n,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:l.jsx("div",{className:fe("pb-4 pt-0",t),children:e})}));o7.displayName=i7.displayName;const Sxe="Lediga företagslägenheter | Företagslogi",ru={type:"Alla",areas:[],radiusKm:0,maxRent:0,roomsMin:0,roomsMax:0,furnishing:"Alla"},jxe=()=>
693{const[t]=hse(),[e,r]=x.useState([]),[n,i]=x.useState(!0),[s,a]=x.useState(()=>({...ru,type:t.get("type")||ru.type,areas:t.get("area")?[t.get("area")]:ru.areas,radiusKm:Number(t.get("radiusKm"))||0,maxRent:Number(t.get("maxRent"))||0,roomsMin:Number(t.get("roomsMin"))||0,roomsMax:Number(t.get("roomsMax"))||0})),[o,c]=x.useState(!1);x.useEffect(()=>{document.title=Sxe},[]),x.useEffect(()=>{(async()=>{const p=new Date().toISOString().split("T")[0];await ie.from("properties").update({status:"approved",rented_until:null}).eq("status","rented").not("rented_until","is",null).lte("rented_until",p);const{data:m}=await ie.from("properties").select(G_).eq("status","approved").order("display_order",{ascending:!0,nullsFirst:!1}).order("created_at",{ascending:!1});r(m||[]),i(!1)})()},[]);const u=x.useMemo(()=>e.filter(f=>{if(s.type!=="Alla"&&f.property_type!==s.type||s.areas.length>0&&(!f.city||!s.areas.some(p=>m2(p,f.city,s.radiusKm)))||s.furnishing!=="Alla"&&(s.furnishing==="Möblerat"&&!f.furnished||s.furnishing==="Omöblerat"&&!f.unfurnished||s.furnishing==="Delvis möblerat"&&!f.partially_furnished))return!1;if(s.maxRent>0){const m=(s.furnishing==="Möblerat"?[f.furnished_rent]:s.furnishing==="Omöblerat"?[f.unfurnished_rent]:s.furnishing==="Delvis möblerat"?[f.partially_furnished_rent]:[f.furnished_rent,f.unfurnished_rent,f.partially_furnished_rent]).map(Number).filter(y=>y>0);if(m.length===0||Math.min(...m)>s.maxRent)return!1}return!(s.roomsMin>0&&f.rooms<s.roomsMin||s.roomsMax>0&&f.rooms>s.roomsMax)}),[s,e]),d=Object.entries(s).filter(([f,p])=>f==="areas"?p.length>0:p!==ru[f]).length;return l.jsxs("div",{className:"min-h-screen bg-background",children:[l.jsx(Pr,{}),l.jsx(Vr,{}),l.jsxs("main",{className:"pb-12",children:[l.jsx("section",{className:"bg-header text-header-foreground pt-4 md:pt-6 border-b border-header-border",children:l.jsxs("div",{className:"container mx-auto px-4 md:px-6 pb-8 sm:pb-12",children:[l.jsx("h1",{className:"text-2xl sm:text-3xl md:text-4xl font-bold text-foreground mb-4",children:"Lediga företagslägenheter för uthyrning till företag"}),l.jsxs("p",{className:"text-sm sm:text-base text-muted-foreground max-w-3xl mb-5 leading-relaxed",children:["Företagslogi förmedlar bostäder uteslutande till ",l.jsx("strong",{className:"text-foreground",children:"företag, organisationer och myndigheter"})," som behöver tillfälligt boende för personal, konsulter eller projektmedarbetare. Privatpersoner kan tyvärr inte hyra via oss."]}),l.jsxs("div",{className:"flex flex-wrap gap-x-5 gap-y-2 text-xs sm:text-sm text-muted-foreground",children:[l.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[l.jsx(x_,{className:"h-4 w-4 text-primary"})," B2B-avtal med organisationsnummer"]}),l.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[l.jsx(vc,{className:"h-4 w-4 text-primary"})," Faktura till företag"]}),l.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[l.jsx(xH,{className:"h-4 w-4 text-primary"})," Personal, konsulter & projekt"]})]}),l.jsxs("details",{className:"group max-w-3xl mt-5",children:[l.jsxs("summary",{className:"cursor-pointer list-none inline-flex items-center gap-1.5 text-sm font-medium text-primary hover:underline",children:[l.jsx("span",{className:"group-open:hidden",children:"Läs mer om våra företagsbostäder"}),l.jsx("span",{className:"hidden group-open:inline",children:"Visa mindre"}),l.jsx("svg",{className:"h-4 w-4 transition-transform group-open:rotate-180",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),l.jsxs("div",{className:"mt-4 space-y-3 text-sm sm:text-base text-muted-foreground leading-relaxed",children:[l.jsxs("p",{children:["Vi förmedlar kvalitetssäkrade ",l.jsx("strong",{className:"text-foreground",children:"företagslägenheter"}),", villor och radhus till företag som behöver tillfälligt boende för personal, konsulter eller projektmedarbetare – från någon vecka upp till flera år. Alla avtal tecknas mellan uthyrare och hyrande företag, med organisationsnummer och fakturer
693ing."]}),l.jsx("p",{children:"Till skillnad från hotell och korttidsboende jobbar vi med riktiga bostäder från privata uthyrare och fastighetsägare. Det ger lägre kostnad per natt, mer yta, eget kök och en hemkänsla som passar långa vistelser – samtidigt som ni får ett tryggt B2B-avtal och en kontaktperson genom hela hyresperioden."})]})]})]})}),l.jsx(rW,{compact:!0}),l.jsx("section",{className:"border-b border-border bg-background",children:l.jsxs("div",{className:"container mx-auto px-4 md:px-6 py-6 sm:py-8",children:[l.jsx("h2",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wider mb-3",children:"Företagslägenheter per stad"}),l.jsx("div",{className:"flex flex-wrap gap-2",children:[{slug:"stockholm",name:"Stockholm"},{slug:"goteborg",name:"Göteborg"},{slug:"malmo",name:"Malmö"},{slug:"uppsala",name:"Uppsala"},{slug:"gavle",name:"Gävle"}].map(f=>l.jsx(Re,{to:`/bostader/${f.slug}`,className:"inline-flex items-center gap-1.5 rounded-full border border-border bg-surface px-3.5 py-1.5 text-sm text-foreground hover:border-primary hover:text-primary transition-colors",children:f.name},f.slug))})]})}),l.jsxs("div",{className:"container mx-auto px-4 md:px-6 pt-8",children:[l.jsxs("div",{className:"mb-6 flex flex-wrap items-end justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-1",children:"Aktuella företagslägenheter"}),l.jsxs("p",{className:"text-muted-foreground text-sm",children:[u.length," objekt tillgängliga för företagsuthyrning"]})]}),l.jsxs("span",{className:"hidden sm:inline-flex items-center gap-1.5 rounded-md border border-border bg-surface px-2.5 py-1 text-xs font-medium text-muted-foreground",children:[l.jsx(NH,{className:"h-3.5 w-3.5 text-primary"}),"Dessa lägenheter hyrs endast ut till företag"]})]}),n?l.jsx("div",{className:"flex justify-center py-16",children:l.jsx(js,{className:"h-6 w-6 animate-spin text-primary"})}):l.jsxs("div",{className:"flex gap-8",children:[l.jsx("aside",{className:"hidden lg:block w-72 shrink-0",children:l.jsxs("div",{className:"sticky top-24",children:[l.jsx(LD,{filters:s,onChange:a}),d>0&&l.jsxs("button",{onClick:()=>a(ru),className:"mt-3 text-sm text-primary hover:underline flex items-center gap-1",children:[l.jsx(Wi,{className:"h-3.5 w-3.5"}),"Rensa filter"]})]})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"lg:hidden mb-4",children:l.jsxs(Bq,{open:o,onOpenChange:c,children:[l.jsx(exe,{asChild:!0,children:l.jsxs(se,{variant:"outline",className:"w-full justify-center gap-2",children:[l.jsx(LP,{className:"h-4 w-4"}),"Filter",d>0&&l.jsx("span",{className:"bg-primary text-primary-foreground text-xs rounded-full w-5 h-5 flex items-center justify-center",children:d})]})}),l.jsx(A2,{side:"left",className:"w-80 p-0 overflow-y-auto",children:l.jsxs("div",{className:"p-5",children:[l.jsx(LD,{filters:s,onChange:a}),l.jsxs("div",{className:"mt-4 space-y-2",children:[l.jsxs(se,{variant:"hero",className:"w-full",onClick:()=>c(!1),children:["Visa ",u.length," bostäder"]}),d>0&&l.jsx("button",{onClick:()=>a(ru),className:"w-full text-sm text-primary hover:underline",children:"Rensa filter"})]})]})})]})}),u.length>0?l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-5",children:u.map(f=>l.jsx(kW,{property:f},f.id))}):l.jsxs("div",{className:"text-center py-16",children:[l.jsx("p",{className:"text-lg font-medium text-foreground mb-2",children:"Inga bostäder matchar dina filter"}),l.jsx("p",{className:"text-muted-foreground mb-4",children:"Prova att ändra dina filterval"}),l.jsx(se,{variant:"outline",onClick:()=>a(ru),children:"Rensa filter"})]})]})]})]})]}),l.jsx("section",{className:"bg-surface border-t border-border",children:l.jsxs("div",{className:"container mx-auto px-4 md:px-6 py-14 sm:py-20 max-w-3xl",children:[l.jsxs("div",{className:"text-center mb-8 sm:mb-10",children:[l.jsx("p",{className:"text-xs sm:text-sm font-semibold text-primary uppercase tracking-wider mb-2",children:"Vanliga frågor"}),l.jsx("h2",{className:"text-2xl sm:text-3xl font-bold text-foreground",children:"Frågor & svar om företagslägenheter"})]}),l.jsx(kxe,{type:"single",collapsible:!0,className:"w-full",children:$D.map((f,p)=>l.jsxs(s7,{value:`item-${p}`,children:[l.jsx(a7,{className:"text-left text-base font-semibold",children:f.q}),l.jsx(o7,{className:"text-sm sm:text-base text-muted-foreground leading-relaxed",children:f.a})]},p))}),l.jsxs("div",{className:"mt-10 text-center",children:[l.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Hittar du inte svaret du söker?"}),l.jsx(se,{variant:"hero",asChild:!0,children:l.jsx(Re,{to:"/foretagsservice#forfragan",children:"Kontakta oss"})})]})]})}),l.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntity:$D.map(f=>
693({"@type":"Question",name:f.q,acceptedAnswer:{"@type":"Answer",text:f.a}}))})}}),l.jsx(Mr,{})]})},$D=[{q:"Vad är en företagslägenhet?",a:"En företagslägenhet är en lägenhet, villa eller radhus som hyrs ut till ett företag istället för en privatperson. Företaget står som hyresgäst och låter sin personal, konsulter eller besökare bo i bostaden under hyresperioden. Det är ett tryggt och flexibelt alternativ till hotell eller serviced apartments när någon behöver bo längre än ett par veckor."},{q:"Hur länge kan vi hyra en företagslägenhet?",a:"Vi förmedlar både kortare uthyrningar från ungefär en månad och längre kontrakt på 6–24 månader eller tillsvidare. Varje objekt visar tydligt när bostaden är tillgänglig och hur länge den kan hyras. Behöver ni något mer flexibelt hjälper vi gärna till att förhandla med uthyraren."},{q:"Vad ingår i hyran?",a:"Detta varierar mellan objekt, men i de flesta möblerade bostäder ingår möbler, vitvaror, porslin, sängkläder, wifi och el. Hos enskilda objekt finns även städning som tillval. På objektsidan ser ni exakt vad som ingår, samt eventuella tillval och avgifter."},{q:"Vad kostar det att använda Företagslogi som företag?",a:"Det kostar inget att söka bland våra bostäder, skicka förfrågan eller få förslag matchade till era behov. Vid förmedlat avtal tas en förmedlingsavgift motsvarande en månadshyra (exkl. moms) ut, med en minimiavgift på 7 900 kr. Inga dolda avgifter, ingen löpande abonnemangskostnad."},{q:"Kan vi hyra omöblerat?",a:"Ja. Vi har både möblerade, delvis möblerade och helt omöblerade bostäder. Filtrera enkelt på möblering i listan ovan, eller berätta i förfrågan vilket alternativ ni föredrar så matchar vi mot rätt objekt."},{q:"Hur snabbt kan vi flytta in?",a:"Många bostäder är tillgängliga med kort varsel – ibland inom någon vecka. Andra har specifika tillträdesdatum som anges på objektsidan. Om ni har en deadline – berätta det i förfrågan så prioriterar vi objekt som matchar er tidsplan."},{q:"Vilka städer arbetar ni i?",a:"Tyngdpunkten ligger i Stockholm med kranskommuner, men vi förmedlar företagslägenheter i över 150 städer i Sverige – inklusive Göteborg, Malmö, Uppsala, Linköping, Västerås och fler. Saknas er ort i listan – hör av er, vi har ofta större nätverk än vad som syns publikt."},{q:"Hur skiljer ni er från hotell och korttidsboende?",a:"Vi förmedlar riktiga bostäder, inte hotellrum eller koncept-lägenheter. Det betyder större ytor, fullt utrustat kök, hemkänsla och en betydligt lägre kostnad per dygn vid längre vistelser. Ni får dessutom en personlig kontakt genom hela processen istället för en receptionist."}];var Nxe="Label",l7=x.forwardRef((t,e)=>l.jsx(Oe.label,{...t,ref:e,onMouseDown:r=>{var i;r.target.closest("button, input, select, textarea")||((i=t.onMouseDown)==null||i.call(t,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));l7.displayName=Nxe;var c7=l7;const Cxe=gp("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ve=x.forwardRef(({className:t,...e},r)=>l.jsx(c7,{ref:r,className:fe(Cxe(),t),...e}));Ve.displayName=c7.displayName;const Exe=()=>{const[t,e]=x.useState({firstName:"",lastName:"",email:"",password:"",confirmPassword:"",phone:""}),[r,n]=x.useState(!1),[i,s]=x.useState(!1),{toast:a}=Qo(),o=Ti(),c=(d,f)=>e(p=>({...p,[d]:f})),u=async d=>{if(d.preventDefault(),t.password!==t.confirmPassword){a({title:"Lösenorden matchar inte",variant:"destructive"});return}if(t.password.length<6){a({title:"Lösenordet måste vara minst 6 tecken",variant:"destructive"});return}s(!0);const{error:f}=await ie.auth.signUp({email:t.email,password:t.password,options:{emailRedirectTo:window.location.origin,data:{first_name:t.firstName,last_name:t.lastName,phone:t.phone}}});s(!1),f?a({title:"Registrering misslyckades",description:f.message,variant:"destructive"}):(a({title:"Konto skapat!",description:"Kontrollera din e-post för att verifiera kontot. Logga in för att lägga in ditt första objekt."}),o("/logga-in"))};return l.jsxs("div",{className:"min-h-screen bg-background",children:[l.jsx(Pr,{}),l.jsx(Vr,{}),l.jsx("main",{className:"pt-4 pb-16",children:l.jsx("div",{className:"container mx-auto px-4 max-w-md",children:l.jsxs("div",{className:"bg-card rounded-xl border border-border/60 shadow-card p-6 sm:p-8",children:[l.jsx("h1",{className:"text-2xl font-bold text-foreground mb-1",children:"Registrera"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Skapa ett konto för att hyra ut din bostad"}),l.jsxs("form",{onSubmit:u,className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs(Ve,{htmlFor:"firstName",children:["Förnamn ",l.jsx("span",{className:"text-destructive",children:"*"})]}),l.jsx(ce,{id:"firstName",required:!0,value:t.firstName,onChange:d=>c("firstName",d.target.value),placeholder:"Förnamn"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs(Ve,{htmlFor:"lastName",children:["Efternamn ",l.jsx("span",{className:"text-destructive",children:"*"})]}),l.jsx(ce,{id:"lastName",required:!0,value:t.lastName,onChange:d=>c("lastName",d.target.value),placeholder:"Efternamn"})]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs(Ve,{htmlFor:"email",children:["E-post ",l.jsx("span",{className:"text-destructive",children:"*"})]}),l.jsx(ce,{id:"email",type:"email",required:!0,value:t.email,onChange:d=>c("email",d.target.value),placeholder:"E-post"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs(Ve,{htmlFor:"password",children:["Lösenord ",l.jsx("span",{className:"text-destructive",children:"*"})]}),l.jsxs("div",{className:"relative",children:[l.jsx(ce,{id:"password",type:r?"text":"password",required:!0,value:t.password,onChange:d=>c("password",d.target.value),placeholder:"Lösenord"}),l.jsx("button",{type:"button",onClick:()=>n(!r),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:r?l.jsx(y_,{className:"h-4 w-4"}):l.jsx(Cc,{className:"h-4 w-4"})})]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs(Ve,{htmlFor:"confirmPassword",children:["Skriv igen ",l.jsx("span",{className:"text-destructive",children:"*"})]}),l.jsx(ce,{id:"confirmPassword",type:"password",required:!0,value:t.confirmPassword,onChange:d=>c("confirmPassword",d.target.value),placeholder:"Bekräfta lösenord"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs(Ve,{htmlFor:"phone",children:["Telefon ",l.jsx("span",{className:"text-destructive",children:"*"})]}),l.jsx(ce,{id:"phone",type:"tel",required:!0,value:t.phone,onChange:d=>c("phone",d.target.value),placeholder:"07X-XXX XX XX"})]}),l.jsx(se,{variant:"hero",size:"lg",className:"w-full",type:"submit",disabled:i,children:i?"Skapar konto...":"Registrera"})]}),l.jsxs("p",{className:"text-sm text-muted-foreground text-center mt-6",children:["Har du redan ett konto?"," ",l.jsx(Re,{to:"/logga-in",className:"text-primary hover:underline font-medium",children:"Logga in"})]})]})})}),l.jsx(Mr,{})]})},Oxe=()=>{const[t,e]=x.useState(""),[r,n]=x.useState(""),[i,s]=x.useState(!1),[a,o]=x.useState(!1),{toast:c}=Qo(),u=Ti(),d=async f=>{f.preventDefault(),o(!0);const{data:p,error:m}=await ie.auth.signInWithPassword({email:t,password:r});if(o(!1),m)c({title:"Inloggning misslyckades",description:m.message,variant:"destructive"});else{const{data:y}=await ie.from("user_roles").select("role").eq("user_id",p.user.id).eq("role","admin").maybeSingle();if(y){await ie.auth.signOut(),c({title:"Fel inloggning",description:"Detta är en admin-konto. Använd admin-inloggningen på /admin/logga-in.",variant:"destructive"});return}c({title:"Inloggad!"}),u("/mina-sidor/nytt-objekt")}};return l.jsxs("div",{className:"min-h-screen bg-background",children:[l.jsx(Pr,{}),l.jsx(Vr,{}),l.jsx("main",{className:"pt-4 pb-16",children:l.jsx("div",{className:"container mx-auto px-4 max-w-md",children:l.jsxs("div",{className:"bg-card rounded-xl border border-border/60 shadow-card p-6 sm:p-8",children:[l.jsx("h1",{className:"text-2xl font-bold text-foreground mb-1",children:"Logga in"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Logga in på ditt konto"}),l.jsxs("form",{onSubmit:d,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{htmlFor:"email",children:"E-post"}),l.jsx(ce,{id:"email",type:"email",required:!0,value:t,onChange:f=>e(f.target.value),placeholder:"E-post"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{htmlFor:"password",children:"Lösenord"}),l.jsxs("div",{className:"relative",children:[l.jsx(ce,{id:"password",type:i?"text":"password",required:!0,value:r,onChange:f=>n(f.target.value),placeholder:"Lösenord"}),l.jsx("button",{type:"button",onClick:()=>s(!i),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:i?l.jsx(y_,{className:"h-4 w-4"}):l.jsx(Cc,{className:"h-4 w-4"})})]})]}),l.jsxs("div",{className:"flex items-center justify-between text-sm",children:[l.jsxs("label",{className:"flex items-center gap-2 text-muted-foreground",children:[l.jsx("input",{type:"checkbox",className:"rounded border-border"}),"Kom ihåg mig"]}),l.jsx(Re,{to:"/glomt-losenord",className:"text-primary hover:underline",children:"Glömt lösenord"})]}),l.jsx(se,{variant:"hero",size:"lg",className:"w-full",type:"submit",disabled:a,children:a?"Loggar in...":"Logga in"})]}),l.jsxs("p",{className:"text-sm text-muted-foreground text-center mt-6",children:["Har du inget k
693onto?"," ",l.jsx(Re,{to:"/registrera",className:"text-primary hover:underline font-medium",children:"Registrera"})]})]})})}),l.jsx(Mr,{})]})},Txe=()=>{const[t,e]=x.useState(""),[r,n]=x.useState(!1),[i,s]=x.useState(!1),{toast:a}=Qo(),o=async c=>{c.preventDefault(),n(!0);const u=window.location.hostname.includes("lovable.app")||window.location.hostname.includes("lovableproject.com")||window.location.hostname==="localhost"?"https://foretagslogi.se":window.location.origin,{error:d}=await ie.auth.resetPasswordForEmail(t,{redirectTo:`${u}/aterstall-losenord`});n(!1),d?a({title:"Något gick fel",description:d.message,variant:"destructive"}):(s(!0),a({title:"E-post skickad",description:"Kolla din inkorg för återställningslänken."}))};return l.jsxs("div",{className:"min-h-screen bg-background",children:[l.jsx(Pr,{}),l.jsx(Vr,{}),l.jsx("main",{className:"pt-4 pb-16",children:l.jsx("div",{className:"container mx-auto px-4 max-w-md",children:l.jsxs("div",{className:"bg-card rounded-xl border border-border/60 shadow-card p-6 sm:p-8",children:[l.jsx("h1",{className:"text-2xl font-bold text-foreground mb-1",children:"Glömt lösenord"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Ange din e-postadress så skickar vi en länk för att återställa lösenordet."}),i?l.jsxs("div",{className:"space-y-4",children:[l.jsxs("p",{className:"text-sm text-foreground",children:["Vi har skickat ett mejl till ",l.jsx("strong",{children:t}),". Följ länken i mejlet för att välja ett nytt lösenord."]}),l.jsx(Re,{to:"/logga-in",className:"text-primary hover:underline text-sm",children:"Tillbaka till inloggning"})]}):l.jsxs("form",{onSubmit:o,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{htmlFor:"email",children:"E-post"}),l.jsx(ce,{id:"email",type:"email",required:!0,value:t,onChange:c=>e(c.target.value),placeholder:"E-post"})]}),l.jsx(se,{variant:"hero",size:"lg",className:"w-full",type:"submit",disabled:r,children:r?"Skickar...":"Skicka återställningslänk"}),l.jsx("p",{className:"text-sm text-muted-foreground text-center",children:l.jsx(Re,{to:"/logga-in",className:"text-primary hover:underline",children:"Tillbaka till inloggning"})})]})]})})}),l.jsx(Mr,{})]})},Axe=()=>{const[t,e]=x.useState(""),[r,n]=x.useState(""),[i,s]=x.useState(!1),[a,o]=x.useState(!1),[c,u]=x.useState(!1),{toast:d}=Qo(),f=Ti();x.useEffect(()=>{const{data:m}=ie.auth.onAuthStateChange(y=>{(y==="PASSWORD_RECOVERY"||y==="SIGNED_IN")&&u(!0)});return ie.auth.getSession().then(({data:y})=>{y.session&&u(!0)}),()=>m.subscription.unsubscribe()},[]);const p=async m=>{if(m.preventDefault(),t!==r){d({title:"Lösenorden matchar inte",variant:"destructive"});return}if(t.length<6){d({title:"Lösenordet måste vara minst 6 tecken",variant:"destructive"});return}o(!0);const{error:y}=await ie.auth.updateUser({password:t});o(!1),y?d({title:"Kunde inte uppdatera lösenord",description:y.message,variant:"destructive"}):(d({title:"Lösenord uppdaterat!",description:"Du kan nu logga in med ditt nya lösenord."}),f("/logga-in"))};return l.jsxs("div",{className:"min-h-screen bg-background",children:[l.jsx(Pr,{}),l.jsx(Vr,{}),l.jsx("main",{className:"pt-4 pb-16",children:l.jsx("div",{className:"container mx-auto px-4 max-w-md",children:l.jsxs("div",{className:"bg-card rounded-xl border border-border/60 shadow-card p-6 sm:p-8",children:[l.jsx("h1",{className:"text-2xl font-bold text-foreground mb-1",children:"Välj nytt lösenord"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Ange ditt nya lösenord nedan."}),l.jsxs("form",{onSubmit:p,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{htmlFor:"password",children:"Nytt lösenord"}),l.jsxs("div",{className:"relative",children:[l.jsx(ce,{id:"password",type:i?"text":"password",required:!0,value:t,onChange:m=>e(m.target.value),placeholder:"Minst 6 tecken"}),l.jsx("button",{type:"button",onClick:()=>s(!i),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:i?l.jsx(y_,{className:"h-4 w-4"}):l.jsx(Cc,{className:"h-4 w-4"})})]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{htmlFor:"confirm",children:"Bekräfta lösenord"}),l.jsx(ce,{id:"confirm",type:i?"text":"password",required:!0,value:r,onChange:m=>n(m.target.value),placeholder:"Upprepa lösenord"})]}),l.jsx(se,{variant:"hero",size:"lg",className:"w-full",type:"submit",disabled:a||!c,children:a?"Uppdaterar...":c?"Uppdatera lösenord":"Verifierar länk..."})]})]})})}),l.jsx(Mr,{})]})},Pxe=()=>{const t=Oi();return x.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),l.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),l.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},Mxe=()=>{const{hash:t}=Oi();return x.useEffect(()=>{if(t){const e=document.getElementById(t.slice(1));e&&setTimeout(()=>e.scrollIntoView({behavior:"smooth",block:"start"}),50)}},[t]),l.jsxs("div",{className:"min-h-screen",children:[l.jsx(Pr,{}),l.jsx(Vr,{}),l.jsx("section",{className:"pt-4 sm:pt-6 pb-12 sm:pb-16 bg-accent",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14 max-w-3xl text-center",children:[l.jsx("p",{className:"text-xs sm:text-sm font-semibold text-primary uppercase tracking-wider mb-3",children:"Om oss"}),l.jsx("h1",{className:"text-3xl sm:text-4xl md:text-5xl font-extrabold mb-4 sm:mb-6",children:"Företagslogi"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-lg leading-relaxed max-w-2xl mx-auto",children:"Din partner för företagsbostäder i Stockholm och över hela Sverige. Företagslogi hjälper företag och institutioner att hitta logi i Stockholm och resten av Sverige till sina anställda. Oavsett om det gäller korttids- eller långtidsboende har vi ett stort urval av lägenheter att välja på."})]})}),l.jsx("section",{className:"py-14 sm:py-20",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14 max-w-3xl space-y-14 sm:sp
693ace-y-20",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold mb-3",children:"Korttidsboende för företag i Stockholm"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base leading-relaxed",children:"Letar du efter ett korttidsboende för ditt företags räkning? Då har du hittat rätt. Vi erbjuder bra korttidsboende till dina anställda och du har ett stort antal objekt att välja på hos oss. Våra boenden finns i och utanför tullområdena vilket gör att du kan välja boende utifrån det område som passar dig bäst."})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold mb-3",children:"Långtidsboende för företag i Stockholm"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base leading-relaxed",children:"Vi förmedlar även företagslogi i form av långtidsboende för medarbetare som ska vistas en längre tid i Stockholm. Vi utför alltid en selektiv sökning för er räkning enligt behov och önskemål. Fyll i behovsanalysen på hemsidan redan idag så kontaktar vi er med ett förslag på avtal."})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold mb-3",children:"Med kunden i fokus"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base leading-relaxed",children:"Vår företagsservice är utformad för att ditt bostadssökande ska gå så smidigt som möjligt. Vi är med dig i hela processen från visning och sökning av bra företagslogi till själva kontraktet. Det är kostnadsfritt att söka bostad hos oss och betalning sker först vid förmedling av bostaden."}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base leading-relaxed mt-3",children:"Fråga oss om utbudet för långtids- eller korttidsboende – vi hjälper dig att matcha dina önskemål med bästa tänkbara objekt."})]}),l.jsxs("figure",{id:"annelie",className:"border-l-4 border-primary pl-6 sm:pl-8 py-2 scroll-mt-24",children:[l.jsx("blockquote",{className:"text-lg sm:text-xl md:text-2xl font-medium leading-relaxed text-foreground italic",children:"”Vi tar hand om all organisation och administration. Dessutom är det mycket tryggare än att annonsera på egen hand eftersom vi kontrollerar våra företag och sköter kontakten med dem om något skulle hända som behöver ersättas.”"}),l.jsxs("figcaption",{className:"mt-5 flex items-center gap-3 text-sm text-muted-foreground",children:[l.jsx(Re,{to:"/medarbetare/annelie-permerin",className:"shrink-0",children:l.jsx("img",{src:Cp,alt:"Annelie Permerin",className:"w-11 h-11 rounded-full object-cover hover:opacity-90 transition-opacity"})}),l.jsxs("div",{children:[l.jsx(Re,{to:"/medarbetare/annelie-permerin",className:"font-semibold text-foreground not-italic hover:text-primary transition-colors",children:"Annelie Permerin"}),l.jsx("span",{children:" · VD, Företagslogi"}),l.jsxs("span",{className:"block mt-0.5 text-xs",children:["Källa:"," ",l.jsx("a",{href:"https://www.enterprisemagazine.se/nyheter/artikel/snabb-och-trygg-formedling-av-tillfalliga-boenden",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-primary transition-colors",children:"Enterprise Magazine"})]})]})]})]})]})}),l.jsx("section",{className:"py-14 sm:py-20 bg-accent/40",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14 max-w-5xl",children:[l.jsxs("div",{className:"text-center max-w-2xl mx-auto mb-10 sm:mb-14",children:[l.jsx("p",{className:"text-xs sm:text-sm font-semibold text-primary uppercase tracking-wider mb-3",children:"Möt teamet"}),l.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold mb-4",children:"Säg hej till oss"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base leading-relaxed",children:"Vi är ett litet team som brinner för det vi gör. Hör av dig när du vill – vi finns här och hjälper gärna till, oavsett om det gäller en stor förfrågan eller bara en fråga."})]}),l.jsx("div",{className:"grid sm:grid-cols-2 gap-6 max-w-3xl mx-auto",children:Oq.map(e=>l.jsxs(Re,{to:e.profileUrl,className:"group flex gap-4 p-5 rounded-2xl bg-background border border-border hover:shadow-card transition-all",children:[l.jsx("div",{className:"w-20 h-20 sm:w-24 sm:h-24 rounded-xl overflow-hidden bg-accent flex items-center justify-center shrink-0",children:e.image?l.jsx("img",{src:e.image,alt:e.name,className:"w-full h-full object-cover group-hover:scale-[1.03] transition-transform duration-500"}):l.jsx("span",{className:"text-2xl font-bold text-primary",children:e.initials})}),l.jsxs("div",{className:"min-w-0 flex flex-col justify-center",children:[l.jsx("p",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:e.name}),l.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:e.role}),e.phone&&l.jsxs("a",{href:`tel:${e.phone}`,onClick:r=>r.stopPropagation(),className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-primary transition-colors",children:[l.jsx(ai,{className:"h-3 w-3"})," ",e.phone.replace("+46","0")]})]})]},e.key))})]})}),l.jsx("section",{className:"py-14 sm:py-20",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14 max-w-5xl",children:[l.jsxs("div",{className:"text-center max-w-2xl mx-auto mb-10 sm:mb-14",children:[l.jsx("p",{className:"text-xs sm:text-sm font-semibold text-primary uppercase tracking-wider mb-3",children:"Så jobbar vi"}),l.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold",children:"Personligt, tryggt och nära"})]}),l.jsx("div",{className:"grid sm:grid-cols-3 gap-6 sm:gap-8",children:[{Icon:ooe,title:"Personlig kontakt",text:"Du får en egen kontaktperson som följer dig hela vägen – inga ärendenummer eller bottar."},{Icon:ioe,title:"Nära relationer",text:"Vi har jobbat med många av våra företagskunder och uthyrare i över 20 år. Förtroende byggs över tid."},{Icon:x_,title:"Trygghet i varje steg",text:"Vi kontrollerar företagen, hanterar avtalen och finns där om något oväntat händer under hyrestiden."}].map(({Icon:e,title:r,text:n})=>l.jsxs("div",{className:"text-center sm:text-left",children:[l.jsx("div",{className:"w-12 h-12 rounded-xl bg-accent flex items-center justify-center mb-4 mx-auto 
693sm:mx-0",children:l.jsx(e,{className:"h-6 w-6 text-primary"})}),l.jsx("h3",{className:"text-lg font-bold mb-2",children:r}),l.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:n})]},r))})]})}),l.jsx("section",{className:"py-12 sm:py-16 bg-surface",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14 max-w-3xl text-center space-y-5",children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold",children:"Kontakta vÃ¥r bostadsförmedling"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base leading-relaxed max-w-2xl mx-auto",children:"Företagslogi är en registrerad bifirma till Bostad för dig i Stockholm AB (org-nummer: 556555-8078), Sveavägen 61, 113 59 Stockholm, som har över tjugo Ã¥rs erfarenhet av förmedling av företagslogi. Vi har kunskapen och erfarenheten du behöver för att känna dig trygg när du hyr en företagslägenhet i Stockholm eller nÃ¥gon annanstans i Sverige."}),l.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4 sm:gap-6 pt-2",children:[l.jsxs("a",{href:"tel:+4686445820",className:"flex items-center gap-2 text-foreground hover:text-primary transition-colors font-medium text-sm sm:text-base",children:[l.jsx(ai,{className:"h-5 w-5 text-primary"}),"08 – 644 58 20"]}),l.jsxs("a",{href:"mailto:[email protected]",className:"flex items-center gap-2 text-foreground hover:text-primary transition-colors font-medium text-sm sm:text-base",children:[l.jsx(En,{className:"h-5 w-5 text-primary"}),"[email protected]"]})]}),l.jsx(se,{variant:"hero",size:"lg",className:"mt-4",asChild:!0,children:l.jsx("a",{href:"/#kontakt",children:"Skicka förfrÃ¥gan"})})]})}),l.jsx(Mr,{})]})},Rxe=()=>{const[t,e]=x.useState(!1),[r,n]=x.useState(!1),[i,s]=x.useState(""),[a,o]=x.useState(""),[c,u]=x.useState(""),[d,f]=x.useState(""),[p,m]=x.useState(""),y=async v=>{v.preventDefault(),n(!0);try{const{error:w}=await ie.functions.invoke("send-inquiry-email",{body:{type:"KontaktförfrÃ¥gan",subject:`Ny kontaktförfrÃ¥gan frÃ¥n ${i}`,replyTo:c||void 0,fields:{Företagsnamn:i,Kontaktperson:a,"E-post":c,Telefon:d,Meddelande:p}}});if(w)throw w;e(!0)}catch(w){console.error(w),nt({title:"NÃ¥got gick fel",description:"Försök igen om en stund.",variant:"destructive"})}finally{n(!1)}};return l.jsxs("div",{className:"min-h-screen",children:[l.jsx(Pr,{}),l.jsx(Vr,{}),l.jsx("section",{className:"pt-4 sm:pt-6 pb-12 sm:pb-16 bg-accent",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14 max-w-3xl text-center",children:[l.jsx("p",{className:"text-xs sm:text-sm font-semibold text-primary uppercase tracking-wider mb-3",children:"Kontakt"}),l.jsx("h1",{className:"text-3xl sm:text-4xl md:text-5xl font-extrabold mb-4 sm:mb-6",children:"Kontakta oss"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-lg leading-relaxed max-w-2xl mx-auto",children:"Har du frÃ¥gor om företagsbostäder i Stockholm? Hör av dig till oss sÃ¥ hjälper vi dig att hitta rätt boende."})]})}),l.jsx("section",{className:"py-14 sm:py-20",children:l.jsx("div",{className:"container mx-auto px-10 md:px-14 max-w-5xl",children:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-10 lg:gap-16",children:[l.jsxs("div",{className:"space-y-10",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold mb-6",children:"Hitta oss"}),l.jsxs("div",{className:"space-y-5",children:[l.jsxs("a",{href:"tel:+4686445820",className:"flex items-center gap-4 group",children:[l.jsx("div",{className:"w-11 h-11 rounded-xl bg-accent flex items-center justify-center shrink-0",children:l.jsx(ai,{className:"h-5 w-5 text-accent-foreground"})}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Telefon"}),l.jsx("p",{className:"font-medium text-foreground group-hover:text-primary transition-colors",children:"08 – 644 58 20"})]})]}),l.jsxs("a",{href:"mailto:[email protected]",className:"flex items-center gap-4 group",children:[l.jsx("div",{className:"w-11 h-11 rounded-xl bg-accent flex items-center justify-center shrink-0",children:l.jsx(En,{className:"h-5 w-5 text-accent-foreground"})}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"E-post"}),l.jsx("p",{className:"font-medium text-foreground group-hover:text-primary transition-colors",children:"[email protected]"})]})]})]})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold mb-6",children:"Vi som arbetar med Företagslogi"}),l.jsxs("div",{className:"space-y-5",children:[l.jsxs("div",{className:"bg-card rounded-2xl p-5 sm:p-6 shadow-card",children:[l.jsxs(Re,{to:"/medarbetare/annelie-permerin",className:"flex items-center gap-4 mb-5 group",children:[l.jsx("img",{src:Cp,alt:"Annelie Permerin, VD Företagslogi",className:"w-14 h-14 roun
693ded-full object-cover shrink-0"}),l.jsxs("div",{children:[l.jsx("p",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:"Annelie Permerin"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"VD, Företagslogi"})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("a",{href:"tel:+4686445820",className:"flex items-center gap-3 group",children:[l.jsx(ai,{className:"h-4 w-4 text-primary shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-foreground group-hover:text-primary transition-colors",children:"08 – 644 58 20"})]}),l.jsxs("a",{href:"mailto:[email protected]",className:"flex items-center gap-3 group",children:[l.jsx(En,{className:"h-4 w-4 text-primary shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-foreground group-hover:text-primary transition-colors",children:"[email protected]"})]})]})]}),l.jsxs("div",{className:"bg-card rounded-2xl p-5 sm:p-6 shadow-card",children:[l.jsxs(Re,{to:"/medarbetare/ulrika-nystrom",className:"flex items-center gap-4 mb-5 group",children:[l.jsx("div",{className:"w-14 h-14 rounded-full bg-accent flex items-center justify-center shrink-0",children:l.jsx("span",{className:"text-base font-semibold text-primary",children:"UN"})}),l.jsxs("div",{children:[l.jsx("p",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:"Ulrika Nyström"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Företagslogi"})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("a",{href:"tel:+4686445820",className:"flex items-center gap-3 group",children:[l.jsx(ai,{className:"h-4 w-4 text-primary shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-foreground group-hover:text-primary transition-colors",children:"08 – 644 58 20"})]}),l.jsxs("a",{href:"mailto:[email protected]",className:"flex items-center gap-3 group",children:[l.jsx(En,{className:"h-4 w-4 text-primary shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-foreground group-hover:text-primary transition-colors",children:"[email protected]"})]})]})]})]})]})]}),l.jsx("div",{children:l.jsxs("div",{className:"bg-card rounded-2xl p-5 sm:p-6 md:p-8 shadow-card",children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold mb-2",children:"Skicka förfrÃ¥gan"}),l.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"Fyll i formuläret sÃ¥ Ã¥terkommer vi inom 24 timmar med skräddarsydda förslag."}),t?l.jsxs("div",{className:"text-center py-10 sm:py-12 space-y-4",children:[l.jsx("div",{className:"w-14 h-14 sm:w-16 sm:h-16 rounded-full bg-accent flex items-center justify-center mx-auto",children:l.jsx(En,{className:"h-7 w-7 sm:h-8 sm:w-8 text-accent-foreground"})}),l.jsx("h3",{className:"text-lg sm:text-xl font-semibold",children:"Tack för din förfrÃ¥gan!"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base",children:"Vi Ã¥terkommer inom 24 timmar."})]}):l.jsxs("form",{onSubmit:y,className:"space-y-4 sm:space-y-5",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium mb-1.5 block",children:"Företagsnamn"}),l.jsx(ce,{placeholder:"Ert företag AB",required:!0,className:"h-11 sm:h-10",value:i,onChange:v=>s(v.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium mb-1.5 block",children:"Kontaktperson"}),l.jsx(ce,{placeholder:"Förnamn Efternamn",required:!0,className:"h-11 sm:h-10",value:a,onChange:v=>o(v.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium mb-1.5 block",children:"E-post"}),l.jsx(ce,{type:"email",placeholder:"[email protected]",required:!0,className:"h-11 sm:h-10",value:c,onChange:v=>u(v.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium mb-1.5 block",children:"Telefon"}),l.jsx(ce,{type:"tel",placeholder:"07X-XXX XX XX",className:"h-11 sm:h-10",value:d,onChange:v=>f(v.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium mb-1.5 block",children:"Meddelande"}),l.jsx(Is,{placeholder:"Berätta om era behov – antal bostäder, period, omrÃ¥de...",rows:4,required:!0,value:p,onChange:v=>m(v.target.value)})]}),l.jsx(se,{variant:"hero",size:"lg",type:"submit",className:"w-full h-12 text-base",disabled:r,children:r?"Skickar...":"Skicka förfrÃ¥gan"}),l.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Vi behandlar era uppgifter enligt GDPR."})]})]})})]})})}),l.jsx(Mr,{})]})};var At;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{const s={};for(const a of i)s[a]=a;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),a={};for(const o of s)a[o]=i[o];return t.objectValues(a)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&s.push(a);return s},t.find=(i,s)=>{for(const a of i)if(s(a))return a},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(a=>
vendor: 1,174 bytes, line 693
693typeof a=="string"?`'${a}'`:a).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(At||(At={}));var DD;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(DD||(DD={}));const Me=At.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_l=t=>{switch(typeof t){case"undefined":return Me.undefined;case"string":return Me.string;case"number":return Number.isNaN(t)?Me.nan:Me.number;case"boolean":return Me.boolean;case"function":return Me.function;case"bigint":return Me.bigint;case"symbol":return Me.symbol;case"object":return Array.isArray(t)?Me.array:t===null?Me.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Me.promise:typeof Map<"u"&&t instanceof Map?Me.map:typeof Set<"u"&&t instanceof Set?Me.set:typeof Date<"u"&&t instanceof Date?Me.date:Me.object;default:return Me.unknown}},ve=At.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invali
693d_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Wo extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(s){return s.message},n={_errors:[]},i=s=>{for(const a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let o=n,c=0;for(;c<a.path.length;){const u=a.path[c];c===a.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(r(a))):o[u]=o[u]||{_errors:[]},o=o[u],c++}}};return i(this),n}static assert(e){if(!(e instanceof Wo))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,At.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const i of this.issues)if(i.path.length>0){const s=i.path[0];r[s]=r[s]||[],r[s].push(e(i))}else n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Wo.create=t=>new Wo(t);const cO=(t,e)=>{let r;switch(t.code){case ve.invalid_type:t.received===Me.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case ve.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,At.jsonStringifyReplacer)}`;break;case ve.unrecognized_keys:r=`Unrecognized key(s) in object: ${At.joinValues(t.keys,", ")}`;break;case ve.invalid_union:r="Invalid input";break;case ve.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${At.joinValues(t.options)}`;break;case ve.invalid_enum_value:r=`Invalid enum value. Expected ${At.joinValues(t.options)}, received '${t.received}'`;break;case ve.invalid_arguments:r="Invalid function arguments";break;case ve.invalid_return_type:r="Invalid function return type";break;case ve.invalid_date:r="Invalid date";break;case ve.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:At.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case ve.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case ve.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case ve.custom:r="Invalid input";break;
vendor: 5,147 bytes, line 693
693case ve.invalid_intersection_types:r="Intersection results could not be merged";break;case ve.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case ve.not_finite:r="Number must be finite";break;default:r=e.defaultError,At.assertNever(t)}return{message:r}};let Ixe=cO;function Lxe(){return Ixe}const $xe=t=>{const{data:e,path:r,errorMaps:n,issueData:i}=t,s=[...r,...i.path||[]],a={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let o="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)o=u(a,{data:e,defaultError:o}).message;return{...i,path:s,message:o}};function je(t,e){const r=Lxe(),n=$xe({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===cO?void 0:cO].filter(i=>!!i)});t.common.issues.push(n)}class Qi{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const i of r){if(i.status==="aborted")return Ye;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const i of r){const s=await i.key,a=await i.value;n.push({key:s,value:a})}return Qi.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const i of r){const{key:s,value:a}=i;if(s.status==="aborted"||a.status==="aborted")return Ye;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(n[s.value]=a.value)}return{status:e.value,value:n}}}const Ye=Object.freeze({status:"aborted"}),Fm=t=>({status:"dirty",value:t}),Ds=t=>({status:"valid",value:t}),BD=t=>t.status==="aborted",FD=t=>t.status==="dirty",Th=t=>t.status==="valid",Q0=t=>typeof Promise<"u"&&t instanceof Promise;var $e;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})($e||($e={}));class wc{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const zD=(t,e)=>{if(Th(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Wo(t.common.issues);return this._error=r,this._error}}};function gt(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(a,o)=>{const{message:c}=t;return a.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??n??o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:c??r??o.defaultError}},description:i}}class Et{get description(){return this._def.description}_getType(e){return _l(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:_l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Qi,ctx:{common:e.parent.common,data:e.data,parsedType:_l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(Q0(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_l(e)},i=this._parseSync({data:e,path:n.path,parent:n});return zD(n,i)}"~validate"(e){var n,i;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_l(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:r});return Th(s)?{value:s.value}:{issues:r.common.issues}}catch(s){(i=(n=s==null?void 0:s.message)==null?void 0:n.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(s=>Th(s)?{value:s.value}:{issues:r.common.issues})}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_l(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(Q0(i)?i:Promise.resolve(i));return zD(n,s)}refine(e,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{const a=e(i),o=()=>s.addIssue({code:ve.custom,...n(i)});
vendor: 5,977 bytes, line 693
693return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new Ph({schema:this,typeName:Xe.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return sc.create(this,this._def)}nullable(){return Mh.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ha.create(this)}promise(){return nw.create(this,this._def)}or(e){return tw.create([this,e],this._def)}and(e){return rw.create(this,e,this._def)}transform(e){return new Ph({...gt(this._def),schema:this,typeName:Xe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new fO({...gt(this._def),innerType:this,defaultValue:r,typeName:Xe.ZodDefault})}brand(){return new abe({typeName:Xe.ZodBranded,type:this,...gt(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new hO({...gt(this._def),innerType:this,catchValue:r,typeName:Xe.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return D2.create(this,e)}readonly(){return pO.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Dxe=/^c[^\s-]{8,}$/i,Bxe=/^[0-9a-z]+$/,Fxe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,zxe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Uxe=/^[a-z0-9_-]{21}$/i,Hxe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Vxe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Wxe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,qxe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Qj;const Kxe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Gxe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Zxe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Jxe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Yxe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Xxe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,u7="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Qxe=new RegExp(`^${u7}$`);function d7(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function ebe(t){return new RegExp(`^${d7(t)}$`)}function tbe(t){let e=`${u7}T${d7(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function rbe(t,e){return!!((e==="v4"||!e)&&Kxe.test(t)||(e==="v6"||!e)&&Zxe.test(t))}function nbe(t,e){if(!Hxe.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function ibe(t,e){return!!((e==="v4"||!e)&&Gxe.test(t)||(e==="v6"||!e)&&Jxe.test(t))}
vendor: 16,673 bytes, line 693
693class Wl extends Et{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Me.string){const s=this._getOrReturnCtx(e);return je(s,{code:ve.invalid_type,expected:Me.string,received:s.parsedType}),Ye}const n=new Qi;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),je(i,{code:ve.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),je(i,{code:ve.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const a=e.data.length>s.value,o=e.data.length<s.value;(a||o)&&(i=this._getOrReturnCtx(e,i),a?je(i,{code:ve.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&je(i,{code:ve.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Wxe.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"email",code:ve.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Qj||(Qj=new RegExp(qxe,"u")),Qj.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"emoji",code:ve.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")zxe.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"uuid",code:ve.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")Uxe.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"nanoid",code:ve.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Dxe.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"cuid",code:ve.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Bxe.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"cuid2",code:ve.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Fxe.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"ulid",code:ve.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),je(i,{validation:"url",code:ve.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"regex",code:ve.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),je(i,{code:ve.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),je(i,{code:ve.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),je(i,{code:ve.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?tbe(s).test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{code:ve.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?Qxe.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{code:ve.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?ebe(s).test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{code:ve.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Vxe.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"duration",code:ve.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?rbe(e.data,s.version)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"ip",code:ve.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?nbe(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"jwt",code:ve.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?ibe(e.data,s.version)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"cidr",code:ve.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Yxe.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"base64",code:ve.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?Xxe.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"base64url",code:ve.invalid_string,message:s.message}),n.dirty()):At.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:ve.invalid_string,...$e.errToObj(n)})}_addCheck(e){return new Wl({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...$e.errToObj(e)})}url(e){return this._addCheck({kind:"url",...$e.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...$e.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...$e.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...$e.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...$e.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...$e.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...$e.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...$e.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...$e.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...$e.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...$e.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...$e.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...$e.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...$e.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...$e.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...$e.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...$e.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...$e.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...$e.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...$e.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...$e.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...$e.errToObj(r)})}nonempty(e){return this.min(1,$e.errToObj(e))}trim(){return new Wl({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Wl({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Wl({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Wl.create=t=>new Wl({checks:[],typeName:Xe.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...gt(t)});function sbe(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,s=Number.parseInt(t.toFixed(i).replace(".","")),a=Number.parseInt(e.toFixed(i).replace(".",""));return s%a/10**i}class lv extends Et{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Me.number){const s=this._getOrReturnCtx(e);return je(s,{code:ve.invalid_type,expected:Me.number,received:s.parsedType}),Ye}let n;const i=new Qi;for(const s of this._def.checks)s.kind==="int"?At.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),je(n,{code:ve.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),je(n,{code:ve.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),je(n,{code:ve.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?sbe(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),je(n,{code:ve.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),je(n,{code:ve.not_finite,message:s.message}),i.dirty()):At.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,$e.toString(r))}gt(e,r){return this.setLimit("min",e,!1,$e.toString(r))}lte(e,r){return this.setLimit("max",e,!0,$e.toString(r))}lt(e,r){return this.setLimit("max",e,!1,$e.toString(r))}setLimit(e,r,n,i){return new lv({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:$e.toString(i)}]})}_addCheck(e){return new lv({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:$e.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:$e.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:$e.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:$e.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:$e.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:$e.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:$e.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:$e.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:$e.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&At.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}lv.create=t=>new lv({checks:[],typeName:Xe.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...gt(t)});class cv extends Et{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Me.bigint)return this._getInvalidInput(e);let n;const i=new Qi;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),je(n,{code:ve.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),je(n,{code:ve.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),je(n,{code:ve.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):At.assertNever(s);return{status:i.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return je(r,{code:ve.invalid_type,expected:Me.bigint,received:r.parsedType}),Ye}gte(e,r){return this.setLimit("min",e,!0,$e.toString(r))}gt(e,r){return this.setLimit("min",e,!1,$e.toString(r))}lte(e,r){return this.setLimit("max",e,!0,$e.toString(r))}lt(e,r){return this.setLimit("max",e,!1,$e.toString(r))}setLimit(e,r,n,i){return new cv({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:$e.toString(i)}]})}_addCheck(e){return new cv({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:$e.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:$e.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:$e.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:$e.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:$e.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}cv.create=t=>new cv({checks:[],typeName:Xe.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...gt(t)});class UD extends Et{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Me.boolean){const n=this._getOrReturnCtx(e);return je(n,{code:ve.invalid_type,expected:Me.boolean,received:n.parsedType}),Ye}return Ds(e.data)}}UD.create=t=>new UD({typeName:Xe.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...gt(t)});class ew extends Et{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Me.date){const s=this._getOrReturnCtx(e);return je(s,{code:ve.invalid_type,expected:Me.date,received:s.parsedType}),Ye}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return je(s,{code:ve.invalid_date}),Ye}const n=new Qi;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),je(i,{code:ve.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),je(i,{code:ve.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):At.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ew({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:$e.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:$e.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}ew.create=t=>new ew({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Xe.ZodDate,...gt(t)});class HD extends Et{_parse(e){if(this._getType(e)!==Me.symbol){const n=this._getOrReturnCtx(e);return je(n,{code:ve.invalid_type,expected:Me.symbol,received:n.parsedType}),Ye}return Ds(e.data)}}HD.create=t=>new HD({typeName:Xe.ZodSymbol,...gt(t)});class VD extends Et{_parse(e){if(this._getType(e)!==Me.undefined){const n=this._getOrReturnCtx(e);return je(n,{code:ve.invalid_type,expected:Me.undefined,received:n.parsedType}),Ye}return Ds(e.data)}}VD.create=t=>new VD({typeName:Xe.ZodUndefined,...gt(t)});class WD extends Et{_parse(e){if(this._getType(e)!==Me.null){const n=this._getOrReturnCtx(e);return je(n,{code:ve.invalid_type,expected:Me.null,received:n.parsedType}),Ye}return Ds(e.data)}}WD.create=t=>new WD({typeName:Xe.ZodNull,...gt(t)});
vendor: 6,010 bytes, line 693
693class qD extends Et{constructor(){super(...arguments),this._any=!0}_parse(e){return Ds(e.data)}}qD.create=t=>new qD({typeName:Xe.ZodAny,...gt(t)});class KD extends Et{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ds(e.data)}}KD.create=t=>new KD({typeName:Xe.ZodUnknown,...gt(t)});class _c extends Et{_parse(e){const r=this._getOrReturnCtx(e);return je(r,{code:ve.invalid_type,expected:Me.never,received:r.parsedType}),Ye}}_c.create=t=>new _c({typeName:Xe.ZodNever,...gt(t)});class GD extends Et{_parse(e){if(this._getType(e)!==Me.undefined){const n=this._getOrReturnCtx(e);return je(n,{code:ve.invalid_type,expected:Me.void,received:n.parsedType}),Ye}return Ds(e.data)}}GD.create=t=>new GD({typeName:Xe.ZodVoid,...gt(t)});class Ha extends Et{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==Me.array)return je(r,{code:ve.invalid_type,expected:Me.array,received:r.parsedType}),Ye;if(i.exactLength!==null){const a=r.data.length>i.exactLength.value,o=r.data.length<i.exactLength.value;(a||o)&&(je(r,{code:a?ve.too_big:ve.too_small,minimum:o?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(je(r,{code:ve.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(je(r,{code:ve.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,o)=>i.type._parseAsync(new wc(r,a,r.path,o)))).then(a=>Qi.mergeArray(n,a));const s=[...r.data].map((a,o)=>i.type._parseSync(new wc(r,a,r.path,o)));return Qi.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new Ha({...this._def,minLength:{value:e,message:$e.toString(r)}})}max(e,r){return new Ha({...this._def,maxLength:{value:e,message:$e.toString(r)}})}length(e,r){return new Ha({...this._def,exactLength:{value:e,message:$e.toString(r)}})}nonempty(e){return this.min(1,e)}}Ha.create=(t,e)=>new Ha({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Xe.ZodArray,...gt(e)});function df(t){if(t instanceof jr){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=sc.create(df(n))}return new jr({...t._def,shape:()=>e})}else return t instanceof Ha?new Ha({...t._def,type:df(t.element)}):t instanceof sc?sc.create(df(t.unwrap())):t instanceof Mh?Mh.create(df(t.unwrap())):t instanceof rd?rd.create(t.items.map(e=>df(e))):t}class jr extends Et{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=At.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==Me.object){const u=this._getOrReturnCtx(e);return je(u,{code:ve.invalid_type,expected:Me.object,received:u.parsedType}),Ye}const{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof _c&&this._def.unknownKeys==="strip"))for(const u in i.data)a.includes(u)||o.push(u);const c=[];for(const u of a){const d=s[u],f=i.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new wc(i,f,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof _c){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of o)c.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(u==="strict")o.length>0&&(je(i,{code:ve.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of o){const f=i.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new wc(i,f,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const f=await d.key,p=await d.value;u.push({key:f,value:p,alwaysSet:d.alwaysSet})}return u}).then(u=>Qi.mergeObjectSync(n,u)):Qi.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return $e.errToObj,new jr({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var s,a;const i=((a=(s=this._def).errorMap)==null?void 0:a.call(s,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:$e.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new jr({...this._def,unknownKeys:"strip"})}passthrough(){return new jr({...this._def,unknownKeys:"passthrough"})}extend(e){return new jr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new jr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Xe.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new jr({...this._def,catchall:e})}pick(e){const r={};for(const n of At.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new jr({...this._def,shape:()=>r})}omit(e){const r={};for(const n of At.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new jr({...this._def,shape:()=>r})}deepPartial(){return df(this)}partial(e){const r={};for(const n of At.objectKeys(this.shape)){const i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}return new jr({...this._def,shape:()=>r})}required(e){const r={};for(const n of At.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof sc;)s=s._def.innerType;r[n]=s}return new jr({...this._def,shape:()=>r})}keyof(){return f7(At.objectKeys(this.shape))}}jr.create=(t,e)=>new jr({shape:()=>t,unknownKeys:"strip",catchall:_c.create(),typeName:Xe.ZodObject,...gt(e)});jr.strictCreate=(t,e)=>new jr({shape:()=>t,unknownKeys:"strict",catchall:_c.create(),typeName:Xe.ZodObject,...gt(e)});jr.lazycreate=(t,e)=>new jr({shape:t,unknownKeys:"strip",catchall:_c.create(),typeName:Xe.ZodObject,...gt(e)});
vendor: 5,533 bytes, line 693
693class tw extends Et{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function i(s){for(const o of s)if(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(o=>new Wo(o.ctx.common.issues));return je(r,{code:ve.invalid_union,unionErrors:a}),Ye}if(r.common.async)return Promise.all(n.map(async s=>{const a={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(i);{let s;const a=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;const o=a.map(c=>new Wo(c));return je(r,{code:ve.invalid_union,unionErrors:o}),Ye}}get options(){return this._def.options}}tw.create=(t,e)=>new tw({options:t,typeName:Xe.ZodUnion,...gt(e)});function uO(t,e){const r=_l(t),n=_l(e);if(t===e)return{valid:!0,data:t};if(r===Me.object&&n===Me.object){const i=At.objectKeys(e),s=At.objectKeys(t).filter(o=>i.indexOf(o)!==-1),a={...t,...e};for(const o of s){const c=uO(t[o],e[o]);if(!c.valid)return{valid:!1};a[o]=c.data}return{valid:!0,data:a}}else if(r===Me.array&&n===Me.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const a=t[s],o=e[s],c=uO(a,o);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===Me.date&&n===Me.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class rw extends Et{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),i=(s,a)=>{if(BD(s)||BD(a))return Ye;const o=uO(s.value,a.value);return o.valid?((FD(s)||FD(a))&&r.dirty(),{status:r.value,value:o.data}):(je(n,{code:ve.invalid_intersection_types}),Ye)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,a])=>i(s,a)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}rw.create=(t,e,r)=>new rw({left:t,right:e,typeName:Xe.ZodIntersection,...gt(r)});class rd extends Et{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.array)return je(n,{code:ve.invalid_type,expected:Me.array,received:n.parsedType}),Ye;if(n.data.length<this._def.items.length)return je(n,{code:ve.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ye;!this._def.rest&&n.data.length>this._def.items.length&&(je(n,{code:ve.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const s=[...n.data].map((a,o)=>{const c=this._def.items[o]||this._def.rest;return c?c._parse(new wc(n,a,n.path,o)):null}).filter(a=>!!a);return n.common.async?Promise.all(s).then(a=>Qi.mergeArray(r,a)):Qi.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new rd({...this._def,rest:e})}}rd.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new rd({items:t,typeName:Xe.ZodTuple,rest:null,...gt(e)})};class ZD extends Et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.map)return je(n,{code:ve.invalid_type,expected:Me.map,received:n.parsedType}),Ye;const i=this._def.keyType,s=this._def.valueType,a=[...n.data.entries()].map(([o,c],u)=>({key:i._parse(new wc(n,o,n.path,[u,"key"])),value:s._parse(new wc(n,c,n.path,[u,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const c of a){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return Ye;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),o.set(u.value,d.value)}return{status:r.value,value:o}})}else{const o=new Map;for(const c of a){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return Ye;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),o.set(u.value,d.value)}return{status:r.value,value:o}}}}ZD.create=(t,e,r)=>new ZD({valueType:e,keyType:t,typeName:Xe.ZodMap,...gt(r)});class uv extends Et{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.set)return je(n,{code:ve.invalid_type,expected:Me.set,received:n.parsedType}),Ye;const i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(je(n,{code:ve.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(je(n,{code:ve.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const s=this._def.valueType;function a(c){const u=new Set;for(const d of c){if(d.status==="aborted")return Ye;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}const o=[...n.data.values()].map((c,u)=>s._parse(new wc(n,c,n.path,u)));return n.common.async?Promise.all(o).then(c=>a(c)):a(o)}min(e,r){return new uv({...this._def,minSize:{value:e,message:$e.toString(r)}})}max(e,r){return new uv({...this._def,maxSize:{value:e,message:$e.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}uv.create=(t,e)=>new uv({valueType:t,minSize:null,maxSize:null,typeName:Xe.ZodSet,...gt(e)});
vendor: 2,543 bytes, line 693
693class JD extends Et{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}JD.create=(t,e)=>new JD({getter:t,typeName:Xe.ZodLazy,...gt(e)});class dO extends Et{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return je(r,{received:r.data,code:ve.invalid_literal,expected:this._def.value}),Ye}return{status:"valid",value:e.data}}get value(){return this._def.value}}dO.create=(t,e)=>new dO({value:t,typeName:Xe.ZodLiteral,...gt(e)});function f7(t,e){return new Ah({values:t,typeName:Xe.ZodEnum,...gt(e)})}class Ah extends Et{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return je(r,{expected:At.joinValues(n),received:r.parsedType,code:ve.invalid_type}),Ye}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return je(r,{received:r.data,code:ve.invalid_enum_value,options:n}),Ye}return Ds(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Ah.create(e,{...this._def,...r})}exclude(e,r=this._def){return Ah.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}Ah.create=f7;class YD extends Et{_parse(e){const r=At.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Me.string&&n.parsedType!==Me.number){const i=At.objectValues(r);return je(n,{expected:At.joinValues(i),received:n.parsedType,code:ve.invalid_type}),Ye}if(this._cache||(this._cache=new Set(At.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=At.objectValues(r);return je(n,{received:n.data,code:ve.invalid_enum_value,options:i}),Ye}return Ds(e.data)}get enum(){return this._def.values}}YD.create=(t,e)=>new YD({values:t,typeName:Xe.ZodNativeEnum,...gt(e)});class nw extends Et{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==Me.promise&&r.common.async===!1)return je(r,{code:ve.invalid_type,expected:Me.promise,received:r.parsedType}),Ye;const n=r.parsedType===Me.promise?r.data:Promise.resolve(r.data);return Ds(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}nw.create=(t,e)=>new nw({type:t,typeName:Xe.ZodPromise,...gt(e)});
vendor: 4,125 bytes, line 693
693class Ph extends Et{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Xe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:a=>{je(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const a=i.transform(n.data,s);if(n.common.async)return Promise.resolve(a).then(async o=>{if(r.value==="aborted")return Ye;const c=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return c.status==="aborted"?Ye:c.status==="dirty"||r.value==="dirty"?Fm(c.value):c});{if(r.value==="aborted")return Ye;const o=this._def.schema._parseSync({data:a,path:n.path,parent:n});return o.status==="aborted"?Ye:o.status==="dirty"||r.value==="dirty"?Fm(o.value):o}}if(i.type==="refinement"){const a=o=>{const c=i.refinement(o,s);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Ye:(o.status==="dirty"&&r.dirty(),a(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?Ye:(o.status==="dirty"&&r.dirty(),a(o.value).then(()=>({status:r.value,value:o.value}))))}if(i.type==="transform")if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Th(a))return Ye;const o=i.transform(a.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>Th(a)?Promise.resolve(i.transform(a.value,s)).then(o=>({status:r.value,value:o})):Ye);At.assertNever(i)}}Ph.create=(t,e,r)=>new Ph({schema:t,typeName:Xe.ZodEffects,effect:e,...gt(r)});Ph.createWithPreprocess=(t,e,r)=>new Ph({schema:e,effect:{type:"preprocess",transform:t},typeName:Xe.ZodEffects,...gt(r)});class sc extends Et{_parse(e){return this._getType(e)===Me.undefined?Ds(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}sc.create=(t,e)=>new sc({innerType:t,typeName:Xe.ZodOptional,...gt(e)});class Mh extends Et{_parse(e){return this._getType(e)===Me.null?Ds(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Mh.create=(t,e)=>new Mh({innerType:t,typeName:Xe.ZodNullable,...gt(e)});class fO extends Et{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===Me.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}fO.create=(t,e)=>new fO({innerType:t,typeName:Xe.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...gt(e)});class hO extends Et{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Q0(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Wo(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Wo(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}hO.create=(t,e)=>new hO({innerType:t,typeName:Xe.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...gt(e)});class XD extends Et{_parse(e){if(this._getType(e)!==Me.nan){const n=this._getOrReturnCtx(e);return je(n,{code:ve.invalid_type,expected:Me.nan,received:n.parsedType}),Ye}return{status:"valid",value:e.data}}}XD.create=t=>new XD({typeName:Xe.ZodNaN,...gt(t)});class abe extends Et{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}
vendor: 8,297 bytes, line 693
693class D2 extends Et{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Ye:s.status==="dirty"?(r.dirty(),Fm(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Ye:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new D2({in:e,out:r,typeName:Xe.ZodPipeline})}}class pO extends Et{_parse(e){const r=this._def.innerType._parse(e),n=i=>(Th(i)&&(i.value=Object.freeze(i.value)),i);return Q0(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}}pO.create=(t,e)=>new pO({innerType:t,typeName:Xe.ZodReadonly,...gt(e)});jr.lazycreate;var Xe;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Xe||(Xe={}));const Yn=Wl.create;_c.create;Ha.create;const obe=jr.create;jr.strictCreate;tw.create;rw.create;rd.create;const lbe=dO.create,cbe=Ah.create;nw.create;sc.create;Mh.create;var rk="Checkbox",[ube,VZe]=Kn(rk),[dbe,B2]=ube(rk);function fbe(t){const{__scopeCheckbox:e,checked:r,children:n,defaultChecked:i,disabled:s,form:a,name:o,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=t,[p,m]=Yi({prop:r,defaultProp:i??!1,onChange:c,caller:rk}),[y,v]=x.useState(null),[w,b]=x.useState(null),_=x.useRef(!1),S=y?!!a||!!y.closest("form"):!0,N={checked:p,disabled:s,setChecked:m,control:y,setControl:v,name:o,form:a,value:d,hasConsumerStoppedPropagationRef:_,required:u,defaultChecked:ac(i)?!1:i,isFormControl:S,bubbleInput:w,setBubbleInput:b};return l.jsx(dbe,{scope:e,...N,children:hbe(f)?f(N):n})}var h7="CheckboxTrigger",p7=x.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:r,...n},i)=>{const{control:s,value:a,disabled:o,checked:c,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:p,isFormControl:m,bubbleInput:y}=B2(h7,t),v=it(i,d),w=x.useRef(c);return x.useEffect(()=>{const b=s==null?void 0:s.form;if(b){const _=()=>f(w.current);return b.addEventListener("reset",_),()=>b.removeEventListener("reset",_)}},[s,f]),l.jsx(Oe.button,{type:"button",role:"checkbox","aria-checked":ac(c)?"mixed":c,"aria-required":u,"data-state":x7(c),"data-disabled":o?"":void 0,disabled:o,value:a,...n,ref:v,onKeyDown:we(e,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:we(r,b=>{f(_=>ac(_)?!0:!_),y&&m&&(p.current=b.isPropagationStopped(),p.current||b.stopPropagation())})})});p7.displayName=h7;var F2=x.forwardRef((t,e)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:s,required:a,disabled:o,value:c,onCheckedChange:u,form:d,...f}=t;return l.jsx(fbe,{__scopeCheckbox:r,checked:i,defaultChecked:s,disabled:o,required:a,onCheckedChange:u,name:n,form:d,value:c,internal_do_not_use_render:({isFormControl:p})=>l.jsxs(l.Fragment,{children:[l.jsx(p7,{...f,ref:e,__scopeCheckbox:r}),p&&l.jsx(y7,{__scopeCheckbox:r})]})})});F2.displayName=rk;var m7="CheckboxIndicator",g7=x.forwardRef((t,e)=>{const{__scopeCheckbox:r,forceMount:n,...i}=t,s=B2(m7,r);return l.jsx(di,{present:n||ac(s.checked)||s.checked===!0,children:l.jsx(Oe.span,{"data-state":x7(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...t.style}})})});g7.displayName=m7;var v7="CheckboxBubbleInput",y7=x.forwardRef(({__scopeCheckbox:t,...e},r)=>{const{control:n,hasConsumerStoppedPropagationRef:i,checked:s,defaultChecked:a,required:o,disabled:c,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:m}=B2(v7,t),y=it(r,m),v=QP(s),w=qP(n);x.useEffect(()=>{const _=p;if(!_)return;const S=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(S,"checked").set,C=!i.current;if(v!==s&&j){const O=new Event("click",{bubbles:C});_.indeterminate=ac(s),j.call(_,ac(s)?!1:s),_.dispatchEvent(O)}},[p,v,s,i]);const b=x.useRef(ac(s)?!1:s);return l.jsx(Oe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??b.current,required:o,disabled:c,name:u,value:d,form:f,...e,tabIndex:-1,ref:y,style:{...e.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});y7.displayName=v7;function hbe(t){return typeof t=="function"}function ac(t){return t==="indeterminate"}function x7(t){return ac(t)?"indeterminate":t?"checked":"unchecked"}const Ls=x.forwardRef(({className:t,...e},r)=>l.jsx(F2,{ref:r,className:fe("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:l.jsx(g7,{className:fe("flex items-center justify-center text-current"),children:l.jsx(yp,{className:"h-4 w-4"})})}));Ls.displayName=F2.displayName;var z2="Radio",[pbe,b7]=Kn(z2),[mbe,gbe]=pbe(z2),w7=x.forwardRef((t,e)=>{const{__scopeRadio:r,name:n,checked:i=!1,required:s,disabled:a,value:o="on",onCheck:c,form:u,...d}=t,[f,p]=x.useState(null),m=it(e,w=>p(w)),y=x.useRef(!1),v=f?u||!!f.closest("form"):!0;return l.jsxs(mbe,{scope:r,checked:i,disabled:a,children:[l.jsx(Oe.button,{type:"button",role:"radio","aria-checked":i,"data-state":j7(i),"data-disabled":a?"":void 0,disabled:a,value:o,...d,ref:m,onClick:we(t.onClick,w=>{i||c==null||c(),v&&(y.current=w.isPropagationStopped(),y.current||w.stopPropagation())})}),v&&l.jsx(S7,{control:f,bubbles:!y.current,name:n,value:o,checked:i,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});w7.displayName=z2;var _7="RadioIndicator",k7=x.forwardRef((t,e)=>{const{__scopeRadio:r,forceMount:n,...i}=t,s=gbe(_7,r);return l.jsx(di,{present:n||s.checked,children:l.jsx(Oe.span,{"data-state":j7(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:e})})});k7.displayName=_7;var vbe="RadioBubbleInput",S7=x.forwardRef(({__scopeRadio:t,control:e,checked:r,bubbles:n=!0,...i},s)=>{const a=x.useRef(null),o=it(a,s),c=QP(r),u=qP(e);return x.useEffect(()=>{const d=a.current;if(!d)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==r&&m){const y=new Event("click",{bubbles:n});m.call(d,r),d.dispatchEvent(y)}},[c,r,n]),l.jsx(Oe.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:o,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});S7.displayName=vbe;function j7(t){return t?"checked":"unchecked"}var ybe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],nk="RadioGroup",[xbe,WZe]=Kn(nk,[Z_,b7]),N7=Z_(),C7=b7(),[bbe,wbe]=xbe(nk),E7=x.forwardRef((t,e)=>{const{__scopeRadioGroup:r,name:n,defaultValue:i,value:s,required:a=!1,disabled:o=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...p}=t,m=N7(r),y=wy(u),[v,w]=Yi({prop:s,defaultProp:i??null,onChange:f,caller:nk});return l.jsx(bbe,{scope:r,name:n,required:a,disabled:o,value:v,onValueChange:w,children:l.jsx(MW,{asChild:!0,...m,orientation:c,dir:y,loop:d,children:l.jsx(Oe.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":o?"":void 0,dir:y,...p,ref:e})})})});E7.displayName=nk;var O7="RadioGroupItem",T7=x.forwardRef((t,e)=>{const{__scopeRadioGroup:r,disabled:n,...i}=t,s=wbe(O7,r),a=s.disabled||n,o=N7(r),c=C7(r),u=x.useRef(null),d=it(e,u),f=s.value===i.value,p=x.useRef(!1);return x.useEffect(()=>{const m=v=>
693{ybe.includes(v.key)&&(p.current=!0)},y=()=>p.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",y),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",y)}},[]),l.jsx(RW,{asChild:!0,...o,focusable:!a,active:f,children:l.jsx(w7,{disabled:a,required:s.required,checked:f,...c,...i,name:s.name,ref:d,onCheck:()=>s.onValueChange(i.value),onKeyDown:we(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:we(i.onFocus,()=>{var m;p.current&&((m=u.current)==null||m.click())})})})});T7.displayName=O7;var _be="RadioGroupIndicator",A7=x.forwardRef((t,e)=>{const{__scopeRadioGroup:r,...n}=t,i=C7(r);return l.jsx(k7,{...i,...n,ref:e})});A7.displayName=_be;var P7=E7,M7=T7,kbe=A7;const mO=x.forwardRef(({className:t,...e},r)=>l.jsx(P7,{className:fe("grid gap-2",t),...e,ref:r}));mO.displayName=P7.displayName;const zm=x.forwardRef(({className:t,...e},r)=>l.jsx(M7,{ref:r,className:fe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:l.jsx(kbe,{className:"flex items-center justify-center",children:l.jsx(_H,{className:"h-2.5 w-2.5 fill-current text-current"})})}));zm.displayName=M7.displayName;const QD=t=>Array.from({length:t},(e,r)=>r+1),Sbe=[30,60,90,120,150,180],jbe=["Lägenhet","Villa","Radhus","Kedjehus","Parhus","Rum","Fritidshus"],Nbe=["Möblerad","Omöblerad","Delvis möblerad","Valfri möblering"],R7=(t,e)=>{switch(t.code){case ve.invalid_type:return{message:"Obligatoriskt"};case ve.invalid_enum_value:return{message:"Välj alternativ"};case ve.invalid_string:return{message:t.validation==="email"?"Ogiltig e-post":"Ogiltigt värde"};case ve.too_small:return{message:"Obligatoriskt"};case ve.too_big:return{message:`Max ${t.maximum} tecken`};default:return{message:e.defaultError==="Required"?"Obligatoriskt":e.defaultError}}},e4=t=>cbe(t,{errorMap:R7}),Cbe=obe({companyName:Yn().trim().min(1,"Obligatoriskt").max(150),streetAddress:Yn().trim().min(1,"Obligatoriskt").max(200),email:Yn().trim().email("Ogiltig e-post").max(255).optional().or(lbe("")),postalCode:Yn().trim().max(20).optional(),invoiceAddress:Yn().trim().max(300).optional(),orgNr:Yn().trim().min(1,"Obligatoriskt").max(20),phone:Yn().trim().min(1,"Obligatoriskt").max(30),contactPerson:Yn().trim().max(100).optional(),pets:e4(["JA","NEJ"]),smoker:e4(["JA","NEJ"]),rooms:Yn().min(1,"Obligatoriskt"),bedrooms:Yn().min(1,"Obligatoriskt"),minSqm:Yn().min(1,"Obligatoriskt"),housingType:Yn().min(1,"Obligatoriskt"),furnishing:Yn().min(1,"Obligatoriskt"),rentFrom:Yn().min(1,"Obligatoriskt"),maxRent:Yn().trim().min(1,"Obligatoriskt").max(20)}),Ut=({label:t,required:e,children:r,error:n})=>l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs(Ve,{className:"text-sm font-medium",children:[t," ",e&&l.jsx("span",{className:"text-primary",children:"*"})]}),r,n&&l.jsx("p",{className:"text-xs text-destructive",children:n})]}),Ebe=()=>{const{cities:t}=Ep(),[e,r]=x.useState([]),[n,i]=x.useState(!1),[s,a]=x.useState({companyName:"",streetAddress:"",email:"",postalCode:"",invoiceAddress:"",orgNr:"",phone:"",contactPerson:"",tenantName:"",tenantPhone:"",tenantMobile:"",tenantEmail:"",nationality:"",position:"",age:"",children:"",pets:"",smoker:"",rooms:"",bedrooms:"",minSqm:"",housingType:"",furnishing:"",rentFrom:"",rentTo:"",maxRent:"",notes:""}),[o,c]=x.useState({}),[u,d]=x.useState(!1),[f,p]=x.useState(!1),[m,y]=x.useState(!1),v=(b,_)=>a(S=>({...S,[b]:_})),w=async b=>{b.preventDefault();const _=Cbe.safeParse(s,{errorMap:R7});if(!_.success){const C={};_.error.errors.forEach(O=>{O.path[0]&&(C[O.path[0]]=O.message)}),c(C),nt({title:"Kontrollera formuläret",description:"Vissa fält saknas eller är ogiltiga.",variant:"destructive"});return}c({}),d(!0);const S=e.filter(Boolean),N=C=>C.trim()===""?null:parseInt(C,10),{error:j}=await ie.from("company_inquiries").insert({company_name:s.companyName,street_address:s.streetAddress,postal_code:s.postalCode||null,invoice_address:s.invoiceAddress||null,email:s.email||null,org_nr:s.orgNr,phone:s.phone,contact_person:s.contactPerson||null,tenant_name:s.tenantName||null,tenant_phone:s.tenantPhone||null,tenant_mobile:s.tenantMobile||null,tenant_email:s.tenantEmail||null,nationality:s.nationality||null,position:s.position||null,age:N(s.age),children:N(s.children),pets:s.pets==="JA",smoker:s.smoker==="JA",rooms:p
693arseInt(s.rooms,10),bedrooms:parseInt(s.bedrooms,10),min_sqm:parseInt(s.minSqm,10),housing_type:s.housingType,furnishing:s.furnishing,areas:S,rent_from:s.rentFrom||null,rent_to:n?null:s.rentTo||null,indefinite:n,max_rent:s.maxRent,notes:s.notes||null});if(j){console.error("Inquiry submit error",j),d(!1),nt({title:"Något gick fel",description:"Försök igen om en stund.",variant:"destructive"});return}try{const{error:C}=await ie.functions.invoke("send-inquiry-email",{body:{type:"Företagsförfrågan",subject:`Ny företagsförfrågan från ${s.companyName}`,replyTo:s.email||void 0,confirmTo:s.email||s.tenantEmail||void 0,confirmName:s.contactPerson||s.companyName||void 0,fields:{Företag:s.companyName,"Org nr":s.orgNr,Gatuadress:s.streetAddress,Postnummer:s.postalCode,Fakturaadress:s.invoiceAddress,"E-post":s.email,Telefon:s.phone,Kontaktperson:s.contactPerson,"Hyressökandes namn":s.tenantName,Befattning:s.position,"Telefon (sökande)":s.tenantPhone,"Mobil (sökande)":s.tenantMobile,"E-post (sökande)":s.tenantEmail,Nationalitet:s.nationality,Ålder:s.age,"Antal barn":s.children,Husdjur:s.pets,Rökare:s.smoker,"Antal rum":s.rooms,"Antal sovrum":s.bedrooms,"Minst kvm":s.minSqm,Typ:s.housingType,Möblemang:s.furnishing,Områden:S.join(", "),"Hyrestid från":s.rentFrom,"Hyrestid till":n?"Tillsvidare":s.rentTo,Maxhyra:s.maxRent,Övrigt:s.notes}}});C&&console.error("Email notify failed",C)}catch(C){console.error("Email notify failed",C)}d(!1),p(!0),nt({title:"Tack!",description:"Din förfrågan har skickats. Vi återkommer inom kort."})};return f?l.jsxs("div",{className:"py-12 text-center",children:[l.jsx("div",{className:"w-14 h-14 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-4",children:l.jsx("svg",{className:"w-7 h-7 text-primary",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),l.jsx("h3",{className:"text-xl sm:text-2xl font-bold mb-2",children:"Tack för din förfrågan!"}),l.jsx("p",{className:"text-muted-foreground",children:"Vi återkommer till dig snarast under kontorstid."})]}):l.jsxs("form",{onSubmit:w,className:"space-y-12",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-base sm:text-lg font-bold uppercase tracking-wide text-foreground mb-5 border-b border-border pb-3",children:"Företagsuppgifter"}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-4",children:[l.jsx(Ut,{label:"Företagsnamn",required:!0,error:o.companyName,children:l.jsx(ce,{value:s.companyName,onChange:b=>v("companyName",b.target.value),maxLength:150})}),l.jsx(Ut,{label:"Org nr",required:!0,error:o.orgNr,children:l.jsx(ce,{value:s.orgNr,onChange:b=>v("orgNr",b.target.value),maxLength:20})}),l.jsx(Ut,{label:"Gatuadress",required:!0,error:o.streetAddress,children:l.jsx(ce,{value:s.streetAddress,onChange:b=>v("streetAddress",b.target.value),maxLength:200})}),l.jsx(Ut,{label:"Postnummer",children:l.jsx(ce,{value:s.postalCode,onChange:b=>v("postalCode",b.target.value),maxLength:20})}),l.jsx("div",{className:"sm:col-span-2",children:l.jsx(Ut,{label:"Fakturaadress",children:l.jsx(ce,{value:s.invoiceAddress,onChange:b=>v("invoiceAddress",b.target.value),maxLength:300,placeholder:"Om annan än ovan, t.ex. Box 123, 111 22 Stockholm"})})}),l.jsx(Ut,{label:"E-post",error:o.email,children:l.jsx(ce,{type:"email",value:s.email,onChange:b=>v("email",b.target.value),maxLength:255})}),l.jsx(Ut,{label:"Telefon",required:!0,error:o.phone,children:l.jsx(ce,{value:s.phone,onChange:b=>v("phone",b.target.value),maxLength:30})}),l.jsx(Ut,{label:"Kontaktperson",children:l.jsx(ce,{value:s.contactPerson,onChange:b=>v("contactPerson",b.target.value),maxLength:100})})]})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-base sm:text-lg font-bold uppercase tracking-wide text-foreground mb-5 border-b border-border pb-3",children:"Hyressökande"}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-4",children:[l.jsx(Ut,{label:"Hyressökandes namn",children:l.jsx(ce,{value:s.tenantName,onChange:b=>v("tenantName",b.target.value),maxLength:150})}),l.jsx(Ut,{label:"Befattning",children:l.jsx(ce,{value:s.position,onChange:b=>v("position",b.target.value),maxLength:100})}),l.jsx(Ut,{label:"Telefon",children:l.jsx(ce,{value:s.tenantPhone,onChange:b=>v("tenantPhone",b.target.value),maxLength:30})}),l.jsx(Ut,{label:"Mobil",children:l.jsx(ce,{value:s.tenantMobile,onChange:b=>v("tenantMobile",b.target.value),maxLength:30})}),l.jsx(Ut,{label:"E-post",children:l.jsx(ce,{type:"email",value:s.tenantEmail,onChange:b=>v("tenantEmail",b.target.value),maxLength:255})}),l.jsx(Ut,{label:"Nationalitet",children:l.jsx(ce,{value:s.nationality,onChange:b=>v("nationality",b.target.value),maxLength:100})}),l.jsx(Ut,{label:"Ålder",children:l.jsx(ce,{type:"number",min:0,max:120,value:s.age,onChange:b=>v("age",b.target.value)})}),l.jsx(Ut,{label:"Antal barn",children:l.jsx(ce,{type:"number",min:0,max:20,value:s.children,onChange:b=>v("children",b.target.value)})}),l.jsx(Ut,{label:"Husdjur",required:!0,error:o.pets,children:l.jsxs(mO,{value:s.pets,onValueChange:b=>v("pets",b),className:"flex gap-6 pt-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(zm,{value:"JA",id:"pets-ja"}),l.jsx(Ve,{htmlFor:"pets-ja",className:"font-normal cursor-pointer",children:"Ja"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(zm,{value:"NEJ",id:"pets-nej"}),l.jsx(Ve,{htmlFor:"pets-nej",className:"font-normal cursor-pointer",children:"Nej"})]})]})}),l.jsx(Ut,{label:"Rökare",required:!0,error:o.smoker,children:l.jsxs(mO,{value:s.smoker,onValueChange:b=>v("smoker",b),className:"flex gap-6 pt-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(zm,{value:"JA",id:"smoker-ja"}),l.jsx(Ve,{htmlFor:"smoker-ja",className:"font-normal cursor-pointer",children:"Ja"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(zm,{value:"NEJ",id:"smoker-nej"}),l.jsx(Ve,{htmlFor:"smoker-nej",className:"font-normal cursor-pointer",children:"Nej"})]})]})})]})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-base sm:text-lg font-bold uppercase tracking-wide text-foreground mb-5 border-b border-border pb-3",children:"Önskemål om bostad"}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-4",children:[l.jsx(Ut,{label:"Önskar antal rum",required:!0,error:o.rooms,children:l.jsxs(Nt,{value:s.rooms,onValueChange:b=>v("rooms",b),children:[l.jsx(_t,{children:l.jsx(Ct,{placeholder:"Välj"})}),l.jsx(kt,{children:QD(15).map(b=>l.jsx(De,{value:String(b),children:b},b))})]})}),l.jsx(Ut,{label:"Antal sovrum",required:!0,error:o.bedrooms,children:l.jsxs(Nt,{value:s.bedrooms,onValueChange:b=>v("bedrooms",b),children:[l.jsx(_t,{children:l.jsx(Ct,{placeholder:"Välj"})}),l.jsx(kt,{children:QD(15).map(b=>l.jsx(De,{value:String(b),children:b},b))})]})}),l.jsx(Ut,{label:"Minst antal kvm",required:!0,error:o.minSqm,children:l.jsxs(Nt,{value:s.minSqm,onValueChange:b=>v("minSqm",b),children:[l.jsx(_t,{children:l.jsx(Ct,{placeholder:"Välj"})}),l.jsx(kt,{children:Sbe.map(b=>l.jsxs(De,{value:String(b),children:[b," kvm"]},b))})]})}),l.jsx(Ut,{label:"Maxhyra per månad",required:!0,error:o.maxRent,children:l.jsx(ce,{value:s.maxRent,onChange:b=>v("maxRent",b.target.value),placeholder:"t.ex. 25 000 kr",maxLength:20})}),l.jsx(Ut,{label:"Typ",required:!0,error:o.housingType,children:l.jsxs(Nt,{value:s.housingType,onValueChange:b=>v("housingType",b),children:[l.jsx(_t,{children:l.jsx(Ct,{placeholder:"Välj"})}),l.jsx(kt,{children:jbe.map(b=>l.jsx(De,{value:b,children:b},b))})]})}),l.jsx(Ut,{label:"Möblemang",required:!0,error:o.furnishing,children:l.jsxs(Nt,{value:s.furnishing,onValueChange:b=>v("furnishing",b),children:[l.jsx(_t,{children:l.jsx(Ct,{placeholder:"Välj"})}),l.jsx(kt,{children:Nbe.map(b=>l.jsx(De,{value:b,children:b},b))})]})})]}),l.jsxs("div",{className:"mt-5 space-y-1.5",children:[l.jsx(Ve,{className:"text-sm font-medium",children:"Önskade områden / städer"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Välj en eller flera städer från vår lista. Vi söker bostäder i dessa områden."}),l.jsx(T2,{values:e,onChange:r,options:t})]}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-4 mt-5",children:[l.jsx(Ut,{label:"Hyrestid från",required:!0,error:o.rentFrom,children:l.jsx(ce,{type:"date",value:s.rentFrom,onChange:b=>v("rentFrom",b.target.value)})}),l.jsx(Ut,{label:"Hyrestid till",children:l.jsx(ce,{type:"date",value:s.rentTo,onChange:b=>v("rentTo",b.target.value),disabled:n})})]}),l.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[l.jsx(Ls,{id:"indefinite",checked:n,onCheckedChange:b=>i(!!b)}
693),l.jsx(Ve,{htmlFor:"indefinite",className:"font-normal cursor-pointer",children:"Tillsvidare"})]}),l.jsx("div",{className:"mt-5",children:l.jsx(Ut,{label:"Övrig information",children:l.jsx(Is,{value:s.notes,onChange:b=>v("notes",b.target.value),placeholder:"Skriv in text och siffror...",rows:4,maxLength:2e3})})})]}),l.jsxs("div",{className:"rounded-lg border border-primary/20 bg-primary/5 p-4 text-sm text-foreground leading-relaxed",children:[l.jsx("p",{children:l.jsx("strong",{children:"Förmedlingspris inkl. hyresgaranti"})}),l.jsx("p",{className:"mt-2",children:"Vid förmedling utgår en provision om 1 (en) månadshyra av objektet. Mervärdeskatt tillkommer."}),l.jsx("p",{className:"mt-1",children:"Minsta debitering är dock sjutusen niohundra (7.900) kronor, exklusive mervärdesskatt."}),l.jsx("p",{className:"mt-1",children:"Provisionen förfaller till omgående betalning i samband med att hyressökanden, eller någon annan som anvisats av beställaren, och hyresvärden undertecknat hyresavtalet."}),l.jsx("p",{className:"mt-1",children:"Företagslogi äger rätt till provision endast för de fall att uppdraget leder till att hyresavtal träffas mellan hyressökanden, eller någon annan som anvisats av beställaren, och hyresvärden."}),l.jsx("p",{className:"mt-1",children:"Beställaren äger ej rätt att ingå hyresavtal avseende objekt som uppdragstagaren vidarebefordrat till beställaren."}),l.jsx("p",{className:"mt-1",children:"I priset ingår en förmedlingsavgift på 3.000 kronor."})]}),l.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border/60 bg-muted/40 p-4",children:[l.jsx(Ls,{id:"company-accept-terms",checked:m,onCheckedChange:b=>y(b===!0),className:"mt-0.5"}),l.jsxs("label",{htmlFor:"company-accept-terms",className:"text-sm text-foreground cursor-pointer leading-relaxed",children:["Jag har läst och accepterar ovanstående förmedlingsvillkor samt Företagslogis"," ",l.jsx("a",{href:"/anvandarvillkor",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2",children:"användarvillkor"}),". ",l.jsx("span",{className:"text-destructive",children:"*"})]})]}),l.jsx("div",{className:"flex justify-end pt-4 border-t border-border",children:l.jsx(se,{type:"submit",variant:"hero",size:"lg",disabled:u||!m,children:u?"Skickar...":"Skicka förfrågan"})})]})},Obe=()=>(x.useEffect(()=>{document.title="Bostadsförmedling för företag - Företagslogi";const t=document.querySelector('meta[name="description"]'),e=t instanceof HTMLMetaElement?t:document.createElement("meta");e.name="description",e.content="Bostadsförmedling för företag i Stockholm och Sverige. Företagslogi hjälper er hitta rätt företagslägenhet snabbt, säkert och med personlig service.",t||document.head.appendChild(e)},[]),l.jsxs("div",{className:"min-h-screen",children:[l.jsx(Pr,{}),l.jsx(Vr,{}),l.jsx("section",{className:"bg-header text-header-foreground pt-4 md:pt-6 border-b border-header-border",children:l.jsxs("div",{className:"container mx-auto px-4 md:px-6 pb-8 sm:pb-12",children:[l.jsx("p",{className:"text-xs sm:text-sm font-semibold text-primary uppercase tracking-wider mb-2",children:"Företagsservice"}),l.jsx("h1",{className:"text-2xl sm:text-3xl md:text-4xl font-bold text-foreground mb-4",children:"Bostadsförmedling för företag"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base leading-relaxed max-w-3xl",children:"Vi erbjuder ett stort urval av företagslägenheter för både korta och långa hyresperioder. Oavsett om du söker ett hus eller en mindre lägenhet centralt i Stockholm, hjälper vi dig att snabbt hitta den bostad du behöver."})]})}),l.jsx("section",{className:"py-14 sm:py-20",children:l.jsxs("div",{className:"container mx-auto px-4 md:px-6",children:[l.jsxs("div",{className:"space-y-4 mb-14 sm:mb-20 max-w-3xl",children:[l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base leading-relaxed",children:"Med vår långa erfarenhet av bostadsförmedling i Stockholm kan vi erbjuda hjälp genom hela processen kring ditt bostadssökande. Med företagsservice i toppklass och din trygghet i fokus, ser vi till att du hittar rätt bostad."}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base leading-relaxed",children:"Hos oss finns ett brett utbud av företagslägenheter att välja bland. Du får snabb tillgång till ett stort urval av objekt, vilket gör processen enkel och effektiv."})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-10 sm:gap-14 mb-14 sm:mb-20",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg sm:text-xl font-bold mb-4 border-b border-border pb-3",children:"Våra tjänster"}),l.jsxs("ul",{className:"space-y-2.5 text-sm sm:text-base text-muted-foreground",children:[l.jsx("li",{children:"» Selektiv sökning baserat på era önskemål."}),l.jsx("li",{children:"» Boka visningstid när det passar er."}),l.jsx("li",{children:"» Snabb tillgång till verifierade objekt."}),l.jsx("li",{children:"» Hjälp med kontraktsskrivning."})]})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg sm:text-xl font-bold mb-4 border-b border-border pb-3",children:"Kostnad och villkor"}),l.jsxs("ul",{className:"space-y-2.5 text-sm sm:text-base text-muted-foreground",children:[l.jsxs("li",{children:["» ",l.jsx("strong",{className:"text-foreground",children:"Kostnadsfri registrering"})," — Det är gratis att registrera sig hos oss."]}),l.jsxs("li",{children:["» ",l.jsx("strong",{className:"text-foreground",children:"Betal
693ning vid förmedling"})," — En avgift om en mÃ¥nadshyra (exkl. moms). Minsta avgift 7 900 SEK exkl. moms."]}),l.jsxs("li",{children:["» ",l.jsx("strong",{className:"text-foreground",children:"Hyresgaranti"})," — Provisionen förfaller till omedelbar betalning när hyresavtalet undertecknas."]})]})]})]}),l.jsxs("div",{className:"mb-14 sm:mb-20 bg-accent rounded-2xl p-6 sm:p-8 text-center",children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold mb-2",children:"Behöver ni en bostad redan nu?"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base mb-5 max-w-xl mx-auto",children:"Bläddra bland vÃ¥ra aktuella objekt – möblerade och omöblerade lägenheter, villor och radhus i hela StockholmsomrÃ¥det."}),l.jsx(se,{variant:"hero",size:"lg",asChild:!0,children:l.jsxs(Re,{to:"/bostader",children:["Se tillgängliga lägenheter för företag i Stockholm",l.jsx(_h,{className:"h-4 w-4 ml-1"})]})})]}),l.jsx("div",{className:"border-t border-border mb-14 sm:mb-20"}),l.jsxs("div",{id:"forfragan",className:"scroll-mt-20 mb-14 sm:mb-20",children:[l.jsxs("div",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl sm:text-3xl font-bold mb-2",children:"Skicka en förfrÃ¥gan"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base",children:"Fyll i formuläret nedan sÃ¥ kontaktar vi er snarast under kontorstid med ett komplett uppdragsavtal."})]}),l.jsx(Ebe,{})]}),l.jsxs("div",{className:"max-w-3xl",children:[l.jsx("h2",{className:"text-lg sm:text-xl font-bold mb-4 border-b border-border pb-3",children:"Om oss"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base leading-relaxed mb-8",children:"Företagslogi är en bifirma till Bostad För Dig AB, som har över 20 Ã¥rs erfarenhet av bostadsförmedling. Vi erbjuder support och information för bÃ¥de uthyrare och hyresgäster, bÃ¥de före och under kontraktstiden. Vi hjälper exempelvis med frÃ¥gor om bredband, el, städning och mycket mer."}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-5",children:[l.jsxs("div",{className:"bg-card rounded-2xl p-5 sm:p-6 shadow-card",children:[l.jsxs(Re,{to:"/medarbetare/annelie-permerin",className:"flex items-center gap-4 mb-5 group",children:[l.jsx("img",{src:Cp,alt:"Annelie Permerin, VD Företagslogi",className:"w-14 h-14 rounded-full object-cover shrink-0"}),l.jsxs("div",{children:[l.jsx("p",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:"Annelie Permerin"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"VD, Företagslogi"})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("a",{href:"tel:+4686445820",className:"flex items-center gap-3 group",children:[l.jsx(ai,{className:"h-4 w-4 text-primary shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-foreground group-hover:text-primary transition-colors",children:"08 – 644 58 20"})]}),l.jsxs("a",{href:"mailto:[email protected]",className:"flex items-center gap-3 group",children:[l.jsx(En,{className:"h-4 w-4 text-primary shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-foreground group-hover:text-primary transition-colors",children:"[email protected]"})]})]})]}),l.jsxs("div",{className:"bg-card rounded-2xl p-5 sm:p-6 shadow-card",children:[l.jsxs(Re,{to:"/medarbetare/ulrika-nystrom",className:"flex items-center gap-4 mb-5 group",children:[l.jsx("div",{className:"w-14 h-14 rounded-full bg-accent flex items-center justify-center shrink-0",children:l.jsx("span",{className:"text-base font-semibold text-primary",children:"UN"})}),l.jsxs("div",{children:[l.jsx("p",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:"Ulrika Nyström"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Företagslogi"})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("a",{href:"tel:+4686445820",className:"flex items-center gap-3 group",children:[l.jsx(ai,{className:"h-4 w-4 text-primary shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-foreground group-hover:text-primary transition-colors",children:"08 – 644 58 20"})]}),l.jsxs("a",{href:"mailto:[email protected]",className:"flex items-center gap-3 group",children:[l.jsx(En,{className:"h-4 w-4 text-primary shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-foreground group-hover:text-primary transition-colors",children:"[email protected]"})]})]})]})]})]})]})}),l.jsx(Mr,{})]})),Tbe=1,Abe="928e3a8b-001a-4220-ae7a-ebf59201f49e",Pbe="1c3f83e6-5979-4b24-8cc5-71a1e8a1c97a",Mbe="/__l5e/assets-v1/928e3a8b-001a-4220-ae7a-ebf59201f49e/terrace-stockholm.png",Rbe="a/v1/1c3f83e6-5979-4b24-8cc5-71a1e8a1c97a/928e3a8b-001a-4220-ae7a-ebf59201f49e/terrace-stockholm.png",Ibe="terrace-stockholm.png",Lbe=2557005,$be="image/png",Dbe="2026-07-16T15:28:18Z",Bbe={ver
693sion:Tbe,asset_id:Abe,project_id:Pbe,url:Mbe,r2_key:Rbe,original_filename:Ibe,size:Lbe,content_type:$be,created_at:Dbe},t4=[{q:"Vad kostar det att hyra ut?",a:"Kostnaden är 15 % av första månadshyran för lägenheter. För villor och radhus är kostnaden 50 % av första månadshyran. Det tillkommer inga andra avgifter."},{q:"Binder jag mig till några kostnader när jag anmäler min bostad?",a:"Nej, kostnad utgår endast när ett objekt är förmedlat och kontraktet är påskrivet."},{q:"Utgår någon avgift om lägenheten/villan/radhuset inte hyrs ut?",a:"Nej. Du betalar ingenting om vi inte lyckas förmedla din bostad."},{q:"Kan man välja om företaget eller den anställde ska stå på kontraktet?",a:"Ja. Kontraktet kan skrivas antingen med företaget eller den anställde som hyresgäst – det väljer ni själva."},{q:"När får man hyra ut sin lägenhet?",a:"Vid studier eller arbete på annan ort, i Sverige eller utomlands. Vid militärtjänstgöring. Vid längre sjukhusvistelse eller annan rehabilitering, då man ej kan nyttja bostaden. Vid provsammanboende."},{q:"Vilken hyra kan jag begära om jag hyr ut min hyreslägenhet?",a:"Den hyra som är tillåten enligt bruksvärdesprincipen. Den innebär att man vid uthyrning av en hyresrätt har rätt att begära en andrahandshyra som är på samma belopp som grundhyran. Om bostaden är möblerad godkänner hyresnämnden ett tillägg på hyran på 10–15 procent för möblerna."},{q:"Kan jag bli återbetalningsskyldig om jag tar ut för hög hyra?",a:"Ja. Överhyror kan anmälas till hyresnämnden för prövning. Nämnden avgör sedan vilken hyra som är skälig i varje enskilt fall. Vid fällning blir hyresvärden återbetalningsskyldig för överskjutande hyra samt ränta på beloppet. Anmälan till hyresnämnden måste ske senast tre månader efter hyreskontraktets upphörande och beloppet kan vara retroaktivt för maximalt 24 månadshyror."},{q:"Ska jag deklarera och skatta för hyresinkomsten?",a:"Ja. Om bostaden man hyrt ut är en privatbostad deklarerar man hyresinkomsten på blankett K3. Om hyresgästen betalar för el, telefon eller andra omkostnader direkt till hyresvärden, räknas även detta som en hyresinkomst och är skattepliktig."},{q:"Hur ofta uppdateras registret med nya bostäder?",a:"Minst en gång om dagen. Vi kontrollerar veckovis att samtliga objekt fortfarande är lediga."}],ym=({label:t,title:e,desc:r,centered:n=!1})=>l.jsxs("div",{className:`max-w-2xl mb-8 sm:mb-12 ${n?"mx-auto text-center":""}`,children:[l.jsx("p",{className:"text-xs sm:text-sm font-semibold text-primary uppercase tracking-wider mb-2",children:t}),l.jsx("h2",{className:"text-2xl sm:text-3xl font-bold mb-3",children:e}),r&&l.jsx("div",{className:"text-muted-foreground text-sm sm:text-base mt-3",children:r})]}),Fbe=()=>(x.useEffect(()=>{var i;document.title="Hyra ut lägenhet i Stockholm – Trygga företagshyresgäster | Företagslogi",((s,a)=>{let o=document.querySelector(`meta[name="${s}"]`);o||(o=document.createElement("meta"),o.name=s,document.head.appendChild(o)),o.content=a})("description","Hyra ut lägenhet i Stockholm? Vi matchar din bostad med trygga företagshyresgäster. 98 % uthyrningsgrad, kostnadsfri registrering, betala först vid lyckad förmedling.");let e=document.querySelector('link[rel="canonical"]');e||(e=document.createElement("link"),e.rel="canonical",document.head.appendChild(e)),e.href=`${window.location.origin}/hyra-ut`;const r="ld-hyra-ut-faq";(i=document.getElementById(r))==null||i.remove();const n=document.createElement("script");return n.type="application/ld+json",n.id=r,n.text=JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntity:t4.map(s=>
693({"@type":"Question",name:s.q,acceptedAnswer:{"@type":"Answer",text:s.a}}))}),document.head.appendChild(n),()=>{var s;(s=document.getElementById(r))==null||s.remove()}},[]),l.jsxs("div",{className:"min-h-screen",children:[l.jsx(Pr,{}),l.jsx(Vr,{}),l.jsx("section",{className:"bg-header text-header-foreground pt-4 md:pt-6 border-b border-header-border",children:l.jsx("div",{className:"container mx-auto px-3 md:px-6 pb-8 sm:pb-12 text-left",children:l.jsxs("div",{children:[l.jsx("p",{className:"text-xs sm:text-sm font-semibold text-primary uppercase tracking-wider mb-2",children:"För fastighetsägare"}),l.jsx("h1",{className:"text-2xl sm:text-3xl md:text-4xl font-bold text-foreground mb-4",children:"Hyra ut lägenhet i Stockholm"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base leading-relaxed max-w-3xl",children:"Företagslogi matchar din lägenhet med stabila företagshyresgäster. Kostnadsfri registrering, 98 % uthyrningsgrad och du betalar först när vi hittat rätt hyresgäst."})]})})}),l.jsx("section",{id:"sa-fungerar-det",className:"scroll-mt-24 py-14 sm:py-20",children:l.jsx("div",{className:"container mx-auto px-4 md:px-6",children:l.jsxs("div",{className:"grid lg:grid-cols-2 gap-8 lg:gap-14 items-center",children:[l.jsx("div",{className:"order-2 lg:order-1",children:l.jsx("div",{className:"relative overflow-hidden rounded-3xl shadow-elevated",children:l.jsx("img",{src:Bbe.url,alt:"Takterrass med utemöbler i Stockholm",className:"w-full h-auto object-cover aspect-[4/3]"})})}),l.jsxs("div",{className:"order-1 lg:order-2",children:[l.jsx("p",{className:"text-xs sm:text-sm font-semibold text-primary uppercase tracking-wider mb-3",children:"Så här fungerar det"}),l.jsx("h2",{className:"text-3xl sm:text-4xl lg:text-5xl font-bold text-foreground mb-5 leading-tight",children:"Så funkar det"}),l.jsx("p",{className:"text-muted-foreground text-base sm:text-lg leading-relaxed mb-6",children:"Att hyra ut lägenhet i Stockholm till företag är enkelt med Företagslogi. Vi matchar din bostad med trygga företagshyresgäster och sköter allt från marknadsföring till kontrakt."}),l.jsx("p",{className:"text-foreground font-semibold text-base sm:text-lg mb-4",children:"Så här kommer du igång:"}),l.jsx("ul",{className:"space-y-3 mb-8",children:["Registrera bostaden med bilder och beskrivning","Vi kvalificerar och matchar med etablerade företag","Du betalar först vid lyckad förmedling"].map(t=>l.jsxs("li",{className:"flex items-start gap-3 text-sm sm:text-base text-muted-foreground",children:[l.jsx(Sh,{className:"h-5 w-5 text-primary shrink-0 mt-0.5"}),l.jsx("span",{children:t})]},t))}),l.jsx(se,{variant:"hero",size:"lg",asChild:!0,children:l.jsx(Re,{to:"/registrera",children:"Registrera din bostad kostnadsfritt"})})]})]})})}),l.jsx("section",{id:"fordelar-villkor",className:"scroll-mt-24 py-14 sm:py-20 bg-surface",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14",children:[l.jsx(ym,{label:"Fördelar & villkor",title:"Varför hyra ut med Företagslogi?"}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsxs("div",{className:"bg-card border border-border rounded-2xl p-5 sm:p-6 shadow-card",children:[l.jsx("h3",{className:"text-lg font-bold text-foreground mb-4",children:"Därför Företagslogi"}),l.jsxs("ul",{className:"space-y-2.5 text-sm sm:text-base text-muted-foreground",children:[l.jsx("li",{children:"» Trygga företagshyresgäster med stabil betalning."}),l.jsx("li",{children:"» 98 % uthyrningsgrad – minimal vakans."}),l.jsx("li",{children:"» Genomsnittlig matchningstid på 24 timmar."}),l.jsx("li",{children:"» Vi sköter marknadsföring, visning och kontrakt."}),l.jsx("li",{children:"» Korta och långa avtal, möblerat eller omöblerat."})]})]}),l.jsxs("div",{className:"bg-card border border-border rounded-2xl p-5 sm:p-6 shadow-card",children:[l.jsx("h3",{className:"text-lg font-bold text-foreground mb-4",children:"Kostnad och villkor"}),l.jsxs("ul",{className:"space-y-2.5 text-sm sm:text-base text-muted-foreground",children:[l.jsxs("li",{children:["» ",l.jsx("strong",{className:"text-foreground",children:"Kostnadsfri registrering"})," — Det är gratis att registrera och lägga upp din bostad."]}),l.jsxs("li",{children:["» ",l.jsx("strong",{className:"text-foreground",children:"Betal
693ning vid förmedling"})," — Du betalar först när vi hittat rätt hyresgäst."]}),l.jsxs("li",{children:["» ",l.jsx("strong",{className:"text-foreground",children:"Förmedlingsavgift"})," — 15 % av första månadshyran för lägenheter. För villor och radhus är avgiften 50 % av första månadshyran."]}),l.jsxs("li",{children:["» ",l.jsx("strong",{className:"text-foreground",children:"Inga bindningstider"})," — Inga uppstartsavgifter eller dolda kostnader."]})]})]})]})]})}),l.jsx("section",{id:"kom-igang",className:"scroll-mt-24 py-14 sm:py-20",children:l.jsx("div",{className:"container mx-auto px-10 md:px-14",children:l.jsx("div",{className:"bg-card border border-primary/20 rounded-2xl p-6 sm:p-8 shadow-card",children:l.jsxs("div",{className:"flex flex-col md:flex-row gap-6 md:items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-2xl sm:text-3xl font-bold mb-2",children:"Kom igång"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base max-w-xl",children:"Skapa ett kostnadsfritt konto och lägg upp din lägenhet idag, eller logga in om du redan är registrerad."}),l.jsx("p",{className:"text-xs text-muted-foreground mt-4",children:"Inga bindningstider · Inga uppstartsavgifter · Betala först vid lyckad förmedling"})]}),l.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 shrink-0",children:[l.jsx(se,{variant:"hero",size:"lg",asChild:!0,children:l.jsx(Re,{to:"/registrera",children:"Registrera dig kostnadsfritt"})}),l.jsx(se,{variant:"hero-outline",size:"lg",asChild:!0,children:l.jsx(Re,{to:"/logga-in",children:"Logga in"})})]})]})})})}),l.jsx("section",{id:"for-och-nackdelar",className:"scroll-mt-24 py-14 sm:py-20 bg-surface",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14",children:[l.jsx(ym,{label:"Att tänka på",title:"För- och nackdelar att hyra ut till företag",desc:"Att hyra ut till företag är ett av de tryggaste sätten att hyra ut sin bostad. Här är vad du bör veta innan du bestämmer dig."}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsxs("div",{className:"bg-card border border-primary/20 rounded-2xl p-5 sm:p-6 shadow-card",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[l.jsx("div",{className:"w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center shrink-0",children:l.jsx(qa,{className:"h-5 w-5 text-primary",strokeWidth:3})}),l.jsx("h3",{className:"text-lg font-bold text-foreground",children:"Fördelar"})]}),l.jsxs("ul",{className:"space-y-3 text-sm sm:text-base text-muted-foreground",children:[l.jsxs("li",{children:[l.jsx("strong",{className:"text-foreground",children:"Tryggare hyresgäst"})," — Företaget står på kontraktet och ansvarar för hyran, även om medarbetaren byts ut."]}),l.jsxs("li",{children:[l.jsx("strong",{className:"text-foreground",children:"Stabil och säker betalning"})," — Etablerade företag betalar i tid, varje månad."]}),l.jsxs("li",{children:[l.jsx("strong",{className:"text-foreground",children:"Lägre risk för vakans"})," — Längre kontrakt och hög efterfrågan ger jämn uthyrning."]}),l.jsxs("li",{children:[l.jsx("strong",{className:"text-foreground",children:"Mindre administration"})," — Vi sköter marknadsföring, visning, kvalificering och kontrakt."]}),l.jsxs("li",{children:[l.jsx("strong",{className:"text-foreground",children:"Möjlighet till högre hyra"})," — Möblerad uthyrning ger 10–15 % påslag enligt bruksvärdesprincipen."]}),l.jsxs("li",{children:[l.jsx("strong",{className:"text-foreground",children:"Skötsamma hyresgäster"}
vendor: 4,726 bytes, line 693
693)," — Konsulter och medarbetare på uppdrag är ofta hemma sällan och slits lite på bostaden."]})]})]}),l.jsxs("div",{className:"bg-card border border-border rounded-2xl p-5 sm:p-6 shadow-card",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[l.jsx("div",{className:"w-10 h-10 rounded-full bg-accent flex items-center justify-center shrink-0",children:l.jsx(NH,{className:"h-5 w-5 text-primary"})}),l.jsx("h3",{className:"text-lg font-bold text-foreground",children:"Att tänka på"})]}),l.jsxs("ul",{className:"space-y-3 text-sm sm:text-base text-muted-foreground",children:[l.jsxs("li",{children:[l.jsx("strong",{className:"text-foreground",children:"Möblerat och inflyttningsklart"})," — De flesta företag efterfrågar fullt möblerade bostäder med basutrustning."]}),l.jsxs("li",{children:[l.jsx("strong",{className:"text-foreground",children:"Hyresgästen kan bytas ut"})," — Företaget står på avtalet, men personen som bor kan variera under kontraktstiden."]}),l.jsxs("li",{children:[l.jsx("strong",{className:"text-foreground",children:"Kort framförhållning ibland"})," — Vid relocations behövs ofta snabb inflytt — men det innebär också snabbare matchning för dig."]}),l.jsxs("li",{children:[l.jsx("strong",{className:"text-foreground",children:"Krav på god standard"})," — Företagshyresgäster förväntar sig välunderhållna bostäder."]})]}),l.jsxs("p",{className:"mt-5 pt-5 border-t border-border text-sm text-foreground",children:[l.jsx(x_,{className:"inline h-4 w-4 text-primary mr-1.5 -mt-0.5"}),l.jsx("strong",{children:"Vår garanti:"})," Vi kvalificerar varje företag noga och hjälper dig genom hela processen — så att uthyrningen alltid känns trygg."]})]})]})]})}),l.jsx("section",{id:"fornya-annonsen",className:"scroll-mt-24 py-14 sm:py-20",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14",children:[l.jsx(ym,{label:"Hantera dina annonser",title:"Förnya annonsen när bostaden blir ledig"}),l.jsx("div",{className:"bg-card border border-border rounded-2xl p-5 sm:p-6 shadow-card",children:l.jsxs("div",{className:"flex flex-col sm:flex-row gap-5 items-start",children:[l.jsx("div",{className:"w-14 h-14 rounded-full bg-primary/10 flex items-center justify-center shrink-0",children:l.jsx(koe,{className:"h-7 w-7 text-primary"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg sm:text-xl font-bold text-foreground mb-2",children:"Blir din lägenhet uthyrd? Spara annonsen för nästa gång"}),l.jsx("p",{className:"text-sm sm:text-base text-muted-foreground leading-relaxed",children:"Lägg till datumet när den befintliga hyresgästen flyttar ut, så kan du enkelt aktivera annonsen igen när bostaden blir ledig. Alla dina annonser sparas i vårt system, och du bestämmer själv hur de ser ut med bilder och beskrivning."})]})]})})]})}),l.jsx("section",{id:"faq",className:"scroll-mt-24 py-14 sm:py-20 bg-surface",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14",children:[l.jsx(ym,{label:"Vanliga frågor",title:"Det här undrar många över"}),l.jsx("div",{className:"bg-card border border-border rounded-2xl p-5 sm:p-6 shadow-card",children:l.jsx("div",{className:"space-y-3",children:t4.map(t=>l.jsxs("details",{className:"group py-3 border-b border-border/60 last:border-b-0",children:[l.jsxs("summary",{className:"cursor-pointer font-semibold text-foreground list-none flex items-start justify-between gap-4",children:[l.jsx("span",{className:"text-sm sm:text-base",children:t.q}),l.jsx("span",{className:"text-primary text-xl leading-none transition-transform group-open:rotate-45 shrink-0",children:"+"})]}),l.jsx("p",{className:"mt-3 text-sm sm:text-base text-muted-foreground leading-relaxed",children:t.a})]},t.q))})})]})}),l.jsx("section",{id:"kontakt",className:"scroll-mt-24 py-14 sm:py-20",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14",children:[l.jsx(ym,{label:"Om oss",title:"Kontakta Företagslogi"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base leading-relaxed mb-8 max-w-3xl",children:"Företagslogi är en bifirma till Bostad För Dig AB, som har över 20 års erfarenhet av bostadsförmedling. Vi erbjuder support och information för både uthyrare och hyresgäster, både före och under kontraktstiden. Vi hjälper exempelvis med frågor om bredband, el, städning och mycket mer."}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-5",children:[l.jsxs("div",{className:"bg-card rounded-2xl p-5 sm:p-6 shadow-card",children:[l.jsxs(Re,{to:"/medarbetare/annelie-permerin",className:"flex items-center gap-4 mb-5 group",children:[l.jsx("img",{src:Cp,alt:"Annelie Permerin, VD Företagslogi",className:"w-14 h-14 roun
693ded-full object-cover shrink-0"}),l.jsxs("div",{children:[l.jsx("p",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:"Annelie Permerin"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"VD, Företagslogi"})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("a",{href:"tel:+4686445820",className:"flex items-center gap-3 group",children:[l.jsx(ai,{className:"h-4 w-4 text-primary shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-foreground group-hover:text-primary transition-colors",children:"08 – 644 58 20"})]}),l.jsxs("a",{href:"mailto:[email protected]",className:"flex items-center gap-3 group",children:[l.jsx(En,{className:"h-4 w-4 text-primary shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-foreground group-hover:text-primary transition-colors",children:"[email protected]"})]})]})]}),l.jsxs("div",{className:"bg-card rounded-2xl p-5 sm:p-6 shadow-card",children:[l.jsxs(Re,{to:"/medarbetare/ulrika-nystrom",className:"flex items-center gap-4 mb-5 group",children:[l.jsx("div",{className:"w-14 h-14 rounded-full bg-accent flex items-center justify-center shrink-0",children:l.jsx("span",{className:"text-base font-semibold text-primary",children:"UN"})}),l.jsxs("div",{children:[l.jsx("p",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:"Ulrika Nyström"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Företagslogi"})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("a",{href:"tel:+4686445820",className:"flex items-center gap-3 group",children:[l.jsx(ai,{className:"h-4 w-4 text-primary shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-foreground group-hover:text-primary transition-colors",children:"08 – 644 58 20"})]}),l.jsxs("a",{href:"mailto:[email protected]",className:"flex items-center gap-3 group",children:[l.jsx(En,{className:"h-4 w-4 text-primary shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-foreground group-hover:text-primary transition-colors",children:"[email protected]"})]})]})]})]})]})}),l.jsx(Mr,{})]}));var I7="AlertDialog",[zbe,qZe]=Kn(I7,[w9]),tl=w9(),L7=t=>{const{__scopeAlertDialog:e,...r}=t,n=tl(e);return l.jsx($_,{...n,...r,modal:!0})};L7.displayName=I7;var Ube="AlertDialogTrigger",$7=x.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,i=tl(r);return l.jsx(i2,{...i,...n,ref:e})});$7.displayName=Ube;var Hbe="AlertDialogPortal",D7=t=>{const{__scopeAlertDialog:e,...r}=t,n=tl(e);return l.jsx(D_,{...n,...r})};D7.displayName=Hbe;var Vbe="AlertDialogOverlay",B7=x.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,i=tl(r);return l.jsx(Sp,{...i,...n,ref:e})});B7.displayName=Vbe;var Jf="AlertDialogContent",[Wbe,qbe]=zbe(Jf),Kbe=FU("AlertDialogContent"),F7=x.forwardRef((t,e)=>{const{__scopeAlertDialog:r,children:n,...i}=t,s=tl(r),a=x.useRef(null),o=it(e,a),c=x.useRef(null);return l.jsx(Rfe,{contentName:Jf,titleName:z7,docsSlug:"alert-dialog",children:l.jsx(Wbe,{scope:r,cancelRef:c,children:l.jsxs(jp,{role:"alertdialog",...s,...i,ref:o,onOpenAutoFocus:we(i.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[l.jsx(Kbe,{children:n}),l.jsx(Zbe,{contentRef:a})]})})})});F7.displayName=Jf;var z7="AlertDialogTitle",U7=x.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,i=tl(r);return l.jsx(Sy,{...i,...n,ref:e})});U7.displayName=z7;var H7="AlertDialogDescription",V7=x.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,i=tl(r);return l.jsx(jy,{...i,...n,ref:e})});V7.displayName=H7;var Gbe="AlertDialogAction",W7=x.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,i=tl(r);return l.jsx(B_,{...i,...n,ref:e})});W7.displayName=Gbe;var q7="AlertDialogCancel",K7=x.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,{cancelRef:i}=qbe(q7,r),s=tl(r),a=it(e,i);return l.jsx(B_,{...s,...n,ref:a})});K7.displayName=q7;var Zbe=({contentRef:t})=>{const e=`\`${Jf}\` requires a description for the component to be accessible for screen reader users.
694
695You can add a description to the \`${Jf}\` by passing a \`${H7}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
696
697Alternatively, 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 \`${Jf}\`. 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.
698
699For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return x.useEffect(()=>{var n;document.getElementById((n=t.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},Jbe=L7,Ybe=$7,Xbe=D7,G7=B7,Z7=F7,J7=W7,Y7=K7,X7=U7,Q7=V7;const _d=Jbe,eK=Ybe,Qbe=Xbe,tK=x.forwardRef(({className:t,...e},r)=>l.jsx(G7,{className:fe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:r}));tK.displayName=G7.displayName;const Pc=x.forwardRef(({className:t,...e},r)=>l.jsxs(Qbe,{children:[l.jsx(tK,{}),l.jsx(Z7,{ref:r,className:fe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));Pc.displayName=Z7.displayName;const Mc=({className:t,...e})=>l.jsx("div",{className:fe("flex flex-col space-y-2 text-center sm:text-left",t),...e});Mc.displayName="AlertDialogHeader";const Rc=({className:t,...e})=>l.jsx("div",{className:fe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Rc.displayName="AlertDialogFooter";const Ic=x.forwardRef(({className:t,...e},r)=>l.jsx(X7,{ref:r,className:fe("text-lg font-semibold",t),...e}));Ic.displayName=X7.displayName;const Lc=x.forwardRef(({className:t,...e},r)=>l.jsx(Q7,{ref:r,className:fe("text-sm text-muted-foreground",t),...e}));Lc.displayName=Q7.displayName;const $c=x.forwardRef(({className:t,...e},r)=>l.jsx(J7,{ref:r,className:fe(YP(),t),...e}));$c.displayName=J7.displayName;const Dc=x.forwardRef(({className:t,...e},r)=>l.jsx(Y7,{ref:r,className:fe(YP({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));Dc.displayName=Y7.displayName;function e0e(){const[t,e]=x.useState([]),[r,n]=x.useState(!0),[i,s]=x.useState(""),[a,o]=x.useState(null),c=async()=>{n(!0);const{data:f,error:p}=await ie.from("guides").select("id, slug, title, category, status, published_at, updated_at, author:authors(name)").order("updated_at",{ascending:!1});p&&ke.error(p.message),e(f||[]),n(!1)};x.useEffect(()=>{c()},[]);const u=async()=>{if(!a)return;const{error:f}=await ie.from("guides").delete().eq("id",a.id);if(f){ke.error("Kunde inte ta bort");return}ke.success("Guiden togs bort"),o(null),c()},d=t.filter(f=>f.title.toLowerCase().includes(i.trim().toLowerCase()));return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between gap-3 mb-6",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/15 flex items-center justify-center",children:l.jsx(yH,{className:"h-5 w-5 text-primary"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Guider & artiklar"}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.length," totalt"]})]})]}),l.jsx(se,{asChild:!0,className:"gap-2",children:l.jsxs(Re,{to:"/admin/guider/ny",children:[l.jsx(qa,{className:"h-4 w-4"})," Ny guide"]})})]}),l.jsxs("div",{className:"relative mb-4 max-w-md",children:[l.jsx(ma,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),l.jsx(ce,{placeholder:"Sök titel…",value:i,onChange:f=>s(f.target.value),className:"pl-9"})]}),l.jsx("div",{className:"bg-card border border-border rounded-xl overflow-hidden",children:r?l.jsx("div",{className:"p-6 text-center text-muted-foreground text-sm",children:"Laddar…"}):d.length===0?l.jsx("div",{className:"p-10 text-center text-muted-foreground text-sm",children:t.length===0?"Inga guider än. Skapa din första!":"Inga matchande guider."}):l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border text-muted-foreground text-xs",children:[l.jsx("th",{className:"text-left py-2.5 px-4 font-medium",children:"Titel"}),l.jsx("th",{className:"text-left py-2.5 px-4 font-medium",children:"Kategori"}),l.jsx("th",{className:"text-left py-2.5 px-4 font-medium",children:"Författare"}),l.jsx("th",{className:"text-left py-2.5 px-4 font-medium",children:"Status"}),l.jsx("th",{className:"text-left py-2.5 px-4 font-medium",children:"Uppdaterad"}),l.jsx("th",{className:"text-right py-2.5 px-4 font-medium",children:"Åtgärd"})]})}),l.jsx("tbody",{children:d.map(f=>{var p;return l.jsxs("tr",{className:"border-b border-border/50 last:border-0 hover:bg-secondary/30",children:[l.jsx("td",{className:"py-3 px-4 font-medium text-foreground max-w-md truncate",children:f.title}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground",children:f.category}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground",children:((p=f.author)==null?void 0:p.name)||"–"}),l.jsx("td",{className:"py-3 px-4",children:l.jsx(Vt,{variant:f.status==="published"?"default":"secondary",className:"text-xs",children:f.status==="published"?"Publicerad":"Utkast"})}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground text-xs",children:new Date(f.updated_at).toLocaleDateString("sv-SE")}),l.jsx("td",{className:"py-3 px-4 text-right",children:l.jsxs("div",{className:"flex items-center justify-end gap-1",children:[f.status==="published"&&l.jsx(se,{asChild:!0,variant:"ghost",size:"icon",className:"h-8 w-8",children:l.jsx("a",{href:`/guide/${f.slug}`,target:"_blank",rel:"noopener noreferrer",title:"Visa på sajten",children:l.jsx(T0,{className:"h-4 w-4"})})}),l.jsx(se,{asChild:!0,variant:"ghost",size:"icon",className:"h-8 w-8",children:l.jsx(Re,{to:`/admin/guider/${f.id}`,title:"Redigera",children:l.jsx(zo,{className:"h-4 w-4"})})}),l.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",onClick:()=>o(f),title:"Ta bort",children:l.jsx(yd,{className:"h-4 w-4"})})]})})]},f.id)})})]})}),l.jsx(_d,{open:!!a,onOpenChange:f=>!f&&o(null),children:l.jsxs(Pc,{children:[l.jsxs(Mc,{children:[l.jsx(Ic,{children:"Ta bort guide?"}),l.jsxs(Lc,{children:['"',a==null?void 0:a.title,'" tas bort permanent. Detta kan inte ångras.']})]}),l.jsxs(Rc,{children:[l.jsx(Dc,{children:"Avbryt"}),l.jsx($c,{onClick:u,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Ta bort"})]})]})})]})}function jn(t){this.content=t}jn.prototype={constructor:jn,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,r){var n=r&&r!=t?this.remove(r):this,i=n.find(t),s=n.content.slice();return i==-1?s.push(r||t,e):(s[i+1]=e,r&&(s[i]=r)),new jn(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var r=this.content.slice();return r.splice(e,2),new jn(r)},addToStart:function(t,e){return new jn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var r=this.remove(t).content.slice();return r.push(t,e),new jn(r)},addBefore:function(t,e,r){var n=this.remove(e),i=n.content.slice(),s=n.find(t);return i.splice(s==-1?i.length:s,0,e,r),new jn(i)}
vendor: 13,155 bytes, line 699
699,forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=jn.from(t),t.size?new jn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=jn.from(t),t.size?new jn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=jn.from(t);for(var r=0;r<t.content.length;r+=2)e=e.remove(t.content[r]);return e},toObject:function(){var t={};return this.forEach(function(e,r){t[e]=r}),t},get size(){return this.content.length>>1}};jn.from=function(t){if(t instanceof jn)return t;var e=[];if(t)for(var r in t)e.push(r,t[r]);return new jn(e)};function rK(t,e,r){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:r;let i=t.child(n),s=e.child(n);if(i==s){r+=i.nodeSize;continue}if(!i.sameMarkup(s))return r;if(i.isText&&i.text!=s.text){for(let a=0;i.text[a]==s.text[a];a++)r++;return r}if(i.content.size||s.content.size){let a=rK(i.content,s.content,r+1);if(a!=null)return a}r+=i.nodeSize}}function nK(t,e,r,n){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:r,b:n};let a=t.child(--i),o=e.child(--s),c=a.nodeSize;if(a==o){r-=c,n-=c;continue}if(!a.sameMarkup(o))return{a:r,b:n};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++,r--,n--;return{a:r,b:n}}if(a.content.size||o.content.size){let u=nK(a.content,o.content,r-1,n-1);if(u)return u}r-=c,n-=c}}class me{constructor(e,r){if(this.content=e,this.size=r||0,r==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,r,n,i=0,s){for(let a=0,o=0;o<r;a++){let c=this.content[a],u=o+c.nodeSize;if(u>e&&n(c,i+o,s||null,a)!==!1&&c.content.size){let d=o+1;c.nodesBetween(Math.max(0,e-d),Math.min(c.content.size,r-d),n,i+d)}o=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,r,n,i){let s="",a=!0;return this.nodesBetween(e,r,(o,c)=>{let u=o.isText?o.text.slice(Math.max(e,c)-c,r-c):o.isLeaf?i?typeof i=="function"?i(o):i:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&u||o.isTextblock)&&n&&(a?a=!1:s+=n),s+=u},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let r=this.lastChild,n=e.firstChild,i=this.content.slice(),s=0;for(r.isText&&r.sameMarkup(n)&&(i[i.length-1]=r.withText(r.text+n.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new me(i,this.size+e.size)}cut(e,r=this.size){if(e==0&&r==this.size)return this;let n=[],i=0;if(r>e)for(let s=0,a=0;a<r;s++){let o=this.content[s],c=a+o.nodeSize;c>e&&((a<e||c>r)&&(o.isText?o=o.cut(Math.max(0,e-a),Math.min(o.text.length,r-a)):o=o.cut(Math.max(0,e-a-1),Math.min(o.content.size,r-a-1))),n.push(o),i+=o.nodeSize),a=c}return new me(n,i)}cutByIndex(e,r){return e==r?me.empty:e==0&&r==this.content.length?this:new me(this.content.slice(e,r))}replaceChild(e,r){let n=this.content[e];if(n==r)return this;let i=this.content.slice(),s=this.size+r.nodeSize-n.nodeSize;return i[e]=r,new me(i,s)}addToStart(e){return new me([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new me(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let r=0;r<this.content.length;r++)if(!this.content[r].eq(e.content[r]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let r=this.content[e];if(!r)throw new RangeError("Index "+e+" out of range for "+this);return r}maybeChild(e){return this.content[e]||null}forEach(e){for(let r=0,n=0;r<this.content.length;r++){let i=this.content[r];e(i,n,r),n+=i.nodeSize}}findDiffStart(e,r=0){return rK(this,e,r)}findDiffEnd(e,r=this.size,n=e.size){return nK(this,e,r,n)}findIndex(e){if(e==0)return Zx(0,e);if(e==this.size)return Zx(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,n=0;;r++){let i=this.child(r),s=n+i.nodeSize;if(s>=e)return s==e?Zx(r+1,s):Zx(r,n);n=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,r){if(!r)return me.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new me(r.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return me.empty;let r,n=0;for(let i=0;i<e.length;i++){let s=e[i];n+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(r||(r=e.slice(0,i)),r[r.length-1]=s.withText(r[r.length-1].text+s.text)):r&&r.push(s)}return new me(r||e,n)}static from(e){if(!e)return me.empty;if(e instanceof me)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new me([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}me.empty=new me([],0);const eN={index:0,offset:0};function Zx(t,e){return eN.index=t,eN.offset=e,eN}function iw(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let r=Array.isArray(t);if(Array.isArray(e)!=r)return!1;if(r){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!iw(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!iw(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let Wt=class gO{constructor(e,r){this.type=e,this.attrs=r}addToSet(e){let r,n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))r||(r=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!n&&s.type.rank>this.type.rank&&(r||(r=e.slice(0,i)),r.push(this),n=!0),r&&r.push(s)}}return r||(r=e.slice()),n||r.push(this),r}removeFromSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return e.slice(0,r).concat(e.slice(r+1));return e}isInSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return!0;return!1}eq(e){return this==e||this.type==e.type&&iw(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[r.type];if(!n)throw new RangeError(`There is no mark type ${r.type} in this schema`);let i=n.create(r.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,r){if(e==r)return!0;if(e.length!=r.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(r[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return gO.none;if(e instanceof gO)return[e];let r=e.slice();return r.sort((n,i)=>n.type.rank-i.type.rank),r}};Wt.none=[];class sw extends Error{}class Ne{constructor(e,r,n){this.content=e,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,r){let n=sK(this.content,e+this.openStart,r);return n&&new Ne(n,this.openStart,this.openEnd)}removeBetween(e,r){return new Ne(iK(this.content,e+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,r){if(!r)return Ne.empty;let n=r.openStart||0,i=r.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Ne(me.fromJSON(e,r.content),n,i)}static maxOpen(e,r=!0){let n=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(r||!s.type.spec.isolating);s=s.firstChild)n++;for(let s=e.lastChild;s&&!s.isLeaf&&(r||!s.type.spec.isolating);s=s.lastChild)i++;return new Ne(e,n,i)}}Ne.empty=new Ne(me.empty,0,0);function iK(t,e,r){let{index:n,offset:i}=t.findIndex(e),s=t.maybeChild(n),{index:a,offset:o}=t.findIndex(r);if(i==e||s.isText){if(o!=r&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(r))}if(n!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(n,s.copy(iK(s.content,e-i-1,r-i-1)))}function sK(t,e,r,n){let{index:i,offset:s}=t.findIndex(e),a=t.maybeChild(i);if(s==e||a.isText)return n&&!n.canReplace(i,i,r)?null:t.cut(0,e).append(r).append(t.cut(e));let o=sK(a.content,e-s-1,r,a);return o&&t.replaceChild(i,a.copy(o))}function t0e(t,e,r){if(r.openStart>t.depth)throw new sw("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new sw("Inconsistent open depths");return aK(t,e,r,0)}function aK(t,e,r,n){let i=t.index(n),s=t.node(n);if(i==e.index(n)&&n<t.depth-r.openStart){let a=aK(t,e,r,n+1);return s.copy(s.content.replaceChild(i,a))}else if(r.content.size)if(!r.openStart&&!r.openEnd&&t.depth==n&&e.depth==n){let a=t.parent,o=a.content;return Bu(a,o.cut(0,t.parentOffset).append(r.content).append(o.cut(e.parentOffset)))}else{let{start:a,end:o}=r0e(r,t);return Bu(s,lK(t,a,o,e,n))}else return Bu(s,aw(t,e,n))}function oK(t,e){if(!e.type.compatibleContent(t.type))throw new sw("Cannot join "+e.type.name+" onto "+t.type.name)}function vO(t,e,r){let n=t.node(r);return oK(n,e.node(r)),n}function Du(t,e){let r=e.length-1;r>=0&&t.isText&&t.sameMarkup(e[r])?e[r]=t.withText(e[r].text+t.text):e.push(t)}function lg(t,e,r,n){let i=(e||t).node(r),s=0,a=e?e.index(r):i.childCount;t&&(s=t.index(r),t.depth>r?s++:t.textOffset&&(Du(t.nodeAfter,n),s++));for(let o=s;o<a;o++)Du(i.child(o),n);e&&e.depth==r&&e.textOffset&&Du(e.nodeBefore,n)}function Bu(t,e){return t.type.checkContent(e),t.copy(e)}function lK(t,e,r,n,i){let s=t.depth>i&&vO(t,e,i+1),a=n.depth>i&&vO(r,n,i+1),o=[];return lg(null,t,i,o),s&&a&&e.index(i)==r.index(i)?(oK(s,a),Du(Bu(s,lK(t,e,r,n,i+1)),o)):(s&&Du(Bu(s,aw(t,e,i+1)),o),lg(e,r,i,o),a&&Du(Bu(a,aw(r,n,i+1)),o)),lg(n,null,i,o),new me(o)}function aw(t,e,r){let n=[];if(lg(null,t,r,n),t.depth>r){let i=vO(t,e,r+1);Du(Bu(i,aw(t,e,r+1)),n)}return lg(e,null,r,n),new me(n)}function r0e(t,e){let r=e.depth-t.openStart,i=e.node(r).copy(t.content);for(let s=r-1;s>=0;s--)i=e.node(s).copy(me.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}class dv{constructor(e,r,n){this.pos=e,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,r=this.index(this.depth);if(r==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(r);return n?e.child(r).cut(n):i}get nodeBefore(){let e=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(e).cut(0,r):e==0?null:this.parent.child(e-1)}posAtIndex(e,r){r=this.resolveDepth(r);let n=this.path[r*3],i=r==0?0:this.path[r*3-1]+1;for(let s=0;s<e;s++)i+=n.child(s).nodeSize;return i}marks(){let e=this.parent,r=this.index();if(e.content.size==0)return Wt.none;if(this.textOffset)return e.child(r).marks;let n=e.maybeChild(r-1),i=e.maybeChild(r);if(!n){let o=n;n=i,i=o}let s=n.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(e){let r=this.parent.maybeChild(this.index());if(!r||!r.isInline)return null;let n=r.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<n.length;s++)n[s].type.spec.inclusive===!1&&(!i||!n[s].isInSet(i.marks))&&(n=n[s--].removeFromSet(n));return n}sharedDepth(e){for(let r=this.depth;r>0;r--)if(this.start(r)<=e&&this.end(r)>=e)return r;return 0}blockRange(e=this,r){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!r||r(this.node(n))))return new ow(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let r=1;r<=this.depth;r++)e+=(e?"/":"")+this.node(r).type.name+"_"+this.index(r-1);return e+":"+this.parentOffset}static resolve(e,r){if(!(r>=0&&r<=e.content.size))throw new RangeError("Position "+r+" out of range");let n=[],i=0,s=r;for(let a=e;;){let{index:o,offset:c}=a.content.findIndex(s),u=s-c;
vendor: 4,479 bytes, line 699
699if(n.push(a,o,i+c),!u||(a=a.child(o),a.isText))break;s=u-1,i+=c+1}return new dv(r,n,s)}static resolveCached(e,r){let n=r4.get(e);if(n)for(let s=0;s<n.elts.length;s++){let a=n.elts[s];if(a.pos==r)return a}else r4.set(e,n=new n0e);let i=n.elts[n.i]=dv.resolve(e,r);return n.i=(n.i+1)%i0e,i}}class n0e{constructor(){this.elts=[],this.i=0}}const i0e=12,r4=new WeakMap;class ow{constructor(e,r,n){this.$from=e,this.$to=r,this.depth=n}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 s0e=Object.create(null);let oc=class yO{constructor(e,r,n,i=Wt.none){this.type=e,this.attrs=r,this.marks=i,this.content=n||me.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,r,n,i=0){this.content.nodesBetween(e,r,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,r,n,i){return this.content.textBetween(e,r,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,r,n){return this.type==e&&iw(this.attrs,r||e.defaultAttrs||s0e)&&Wt.sameSet(this.marks,n||Wt.none)}copy(e=null){return e==this.content?this:new yO(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new yO(this.type,this.attrs,this.content,e)}cut(e,r=this.content.size){return e==0&&r==this.content.size?this:this.copy(this.content.cut(e,r))}slice(e,r=this.content.size,n=!1){if(e==r)return Ne.empty;let i=this.resolve(e),s=this.resolve(r),a=n?0:i.sharedDepth(r),o=i.start(a),u=i.node(a).content.cut(i.pos-o,s.pos-o);return new Ne(u,i.depth-a,s.depth-a)}replace(e,r,n){return t0e(this.resolve(e),this.resolve(r),n)}nodeAt(e){for(let r=this;;){let{index:n,offset:i}=r.content.findIndex(e);if(r=r.maybeChild(n),!r)return null;if(i==e||r.isText)return r;e-=i+1}}childAfter(e){let{index:r,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(r),index:r,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:r,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(r),index:r,offset:n};let i=this.content.child(r-1);return{node:i,index:r-1,offset:n-i.nodeSize}}resolve(e){return dv.resolveCached(this,e)}resolveNoCache(e){return dv.resolve(this,e)}rangeHasMark(e,r,n){let i=!1;return r>e&&this.nodesBetween(e,r,s=>(n.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 e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),cK(this.marks,e)}contentMatchAt(e){let r=this.type.contentMatch.matchFragment(this.content,0,e);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(e,r,n=me.empty,i=0,s=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,i,s),o=a&&a.matchFragment(this.content,r);if(!o||!o.validEnd)return!1;for(let c=i;c<s;c++)if(!this.type.allowsMarks(n.child(c).marks))return!1;return!0}canReplaceWith(e,r,n,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(n),a=s&&s.matchFragment(this.content,r);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Wt.none;for(let r=0;r<this.marks.length;r++){let n=this.marks[r];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Wt.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(r=>r.type.name)}
699`);this.content.forEach(r=>r.check())}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(r=>r.toJSON())),e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(e.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(r.text,n)}let i=me.fromJSON(e,r.content),s=e.nodeType(r.type).create(r.attrs,i,n);return s.type.checkAttrs(s.attrs),s}};oc.prototype.text=void 0;class lw extends oc{constructor(e,r,n,i){if(super(e,r,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):cK(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,r){return this.text.slice(e,r)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new lw(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new lw(this.type,this.attrs,e,this.marks)}cut(e=0,r=this.text.length){return e==0&&r==this.text.length?this:this.withText(this.text.slice(e,r))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function cK(t,e){for(let r=t.length-1;r>=0;r--)e=t[r].type.name+"("+e+")";return e}class nd{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,r){let n=new a0e(e,r);if(n.next==null)return nd.empty;let i=uK(n);n.next&&n.err("Unexpected trailing text");let s=h0e(f0e(i));return p0e(s,n),s}matchType(e){for(let r=0;r<this.next.length;r++)if(this.next[r].type==e)return this.next[r].next;return null}matchFragment(e,r=0,n=e.childCount){let i=this;for(let s=r;i&&s<n;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:r}=this.next[e];if(!(r.isText||r.hasRequiredAttrs()))return r}return null}compatible(e){for(let r=0;r<this.next.length;r++)for(let n=0;n<e.next.length;n++)if(this.next[r].type==e.next[n].type)return!0;return!1}fillBefore(e,r=!1,n=0){let i=[this];function s(a,o){let c=a.matchFragment(e,n);if(c&&(!r||c.validEnd))return me.from(o.map(u=>u.createAndFill()));for(let u=0;u<a.next.length;u++){let{type:d,next:f}=a.next[u];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let p=s(f,o.concat(d));if(p)return p}}return null}return s(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let r=this.computeWrapping(e);return this.wrapCache.push(e,r),r}computeWrapping(e){let r=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),s=i.match;if(s.matchType(e)){let a=[];for(let o=i;o.type;o=o.via)a.push(o.type);return a.reverse()}for(let a=0;a<s.next.length;a++){let{type:o,next:c}=s.next[a];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in r)&&(!i.type||c.validEnd)&&(n.push({match:o.contentMatch,type:o,via:i}),r[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function r(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&r(n.next[i].next)}return r(this),e.map((n,i)=>{let s=i+(n.validEnd?"*":" ")+" ";for(let a=0;a<n.next.length;a++)s+=(a?", ":"")+n.next[a].type.name+"->"+e.indexOf(n.next[a].next);return s}).join(`
700`)}}nd.empty=new nd(!0);class a0e{constructor(e,r){this.string=e,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function uK(t){let e=[];do e.push(o0e(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function o0e(t){let e=[];do e.push(l0e(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function l0e(t){let e=d0e(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=c0e(t,e);else break;return e}function n4(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");
vendor: 4,733 bytes, line 700
700let e=Number(t.next);return t.pos++,e}function c0e(t,e){let r=n4(t),n=r;return t.eat(",")&&(t.next!="}"?n=n4(t):n=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:e}}function u0e(t,e){let r=t.nodeTypes,n=r[e];if(n)return[n];let i=[];for(let s in r){let a=r[s];a.isInGroup(e)&&i.push(a)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function d0e(t){if(t.eat("(")){let e=uK(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=u0e(t,t.next).map(r=>(t.inline==null?t.inline=r.isInline:t.inline!=r.isInline&&t.err("Mixing inline and block content"),{type:"name",value:r}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function f0e(t){let e=[[]];return i(s(t,0),r()),e;function r(){return e.push([])-1}function n(a,o,c){let u={term:c,to:o};return e[a].push(u),u}function i(a,o){a.forEach(c=>c.to=o)}function s(a,o){if(a.type=="choice")return a.exprs.reduce((c,u)=>c.concat(s(u,o)),[]);if(a.type=="seq")for(let c=0;;c++){let u=s(a.exprs[c],o);if(c==a.exprs.length-1)return u;i(u,o=r())}else if(a.type=="star"){let c=r();return n(o,c),i(s(a.expr,c),c),[n(c)]}else if(a.type=="plus"){let c=r();return i(s(a.expr,o),c),i(s(a.expr,c),c),[n(c)]}else{if(a.type=="opt")return[n(o)].concat(s(a.expr,o));if(a.type=="range"){let c=o;for(let u=0;u<a.min;u++){let d=r();i(s(a.expr,c),d),c=d}if(a.max==-1)i(s(a.expr,c),c);else for(let u=a.min;u<a.max;u++){let d=r();n(c,d),i(s(a.expr,c),d),c=d}return[n(c)]}else{if(a.type=="name")return[n(o,void 0,a.value)];throw new Error("Unknown expr type")}}}}function dK(t,e){return e-t}function i4(t,e){let r=[];return n(e),r.sort(dK);function n(i){let s=t[i];if(s.length==1&&!s[0].term)return n(s[0].to);r.push(i);for(let a=0;a<s.length;a++){let{term:o,to:c}=s[a];!o&&r.indexOf(c)==-1&&n(c)}}}function h0e(t){let e=Object.create(null);return r(i4(t,0));function r(n){let i=[];n.forEach(a=>{t[a].forEach(({term:o,to:c})=>{if(!o)return;let u;for(let d=0;d<i.length;d++)i[d][0]==o&&(u=i[d][1]);i4(t,c).forEach(d=>{u||i.push([o,u=[]]),u.indexOf(d)==-1&&u.push(d)})})});let s=e[n.join(",")]=new nd(n.indexOf(t.length-1)>-1);for(let a=0;a<i.length;a++){let o=i[a][1].sort(dK);s.next.push({type:i[a][0],next:e[o.join(",")]||r(o)})}return s}}function p0e(t,e){for(let r=0,n=[t];r<n.length;r++){let i=n[r],s=!i.validEnd,a=[];for(let o=0;o<i.next.length;o++){let{type:c,next:u}=i.next[o];a.push(c.name),s&&!(c.isText||c.hasRequiredAttrs())&&(s=!1),n.indexOf(u)==-1&&n.push(u)}s&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function fK(t){let e=Object.create(null);for(let r in t){let n=t[r];if(!n.hasDefault)return null;e[r]=n.default}return e}function hK(t,e){let r=Object.create(null);for(let n in t){let i=e&&e[n];if(i===void 0){let s=t[n];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+n)}r[n]=i}return r}function pK(t,e,r,n){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${r} of type ${i}`);for(let i in t){let s=t[i];s.validate&&s.validate(e[i])}}function mK(t,e){let r=Object.create(null);if(e)for(let n in e)r[n]=new g0e(t,n,e[n]);return r}let s4=class gK{constructor(e,r,n){this.name=e,this.schema=r,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=mK(e,n.attrs),this.defaultAttrs=fK(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==nd.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:hK(this.attrs,e)}create(e=null,r,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new oc(this,this.computeAttrs(e),me.from(r),Wt.setFrom(n))}createChecked(e=null,r,n){return r=me.from(r),this.checkContent(r),new oc(this,this.computeAttrs(e),r,Wt.setFrom(n))}createAndFill(e=null,r,n){if(e=this.computeAttrs(e),r=me.from(r),r.size){let a=this.contentMatch.fillBefore(r);if(!a)return null;r=a.append(r)}let i=this.contentMatch.matchFragment(r),s=i&&i.fillBefore(me.empty,!0);return s?new oc(this,e,r.append(s),Wt.setFrom(n)):null}validContent(e){let r=this.contentMatch.matchFragment(e);
vendor: 9,390 bytes, lines 700-701
700if(!r||!r.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){pK(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let r=0;r<e.length;r++)if(!this.allowsMarkType(e[r].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let r;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?r&&r.push(e[n]):r||(r=e.slice(0,n));return r?r.length?r:Wt.none:e}static compile(e,r){let n=Object.create(null);e.forEach((s,a)=>n[s]=new gK(s,r,a));let i=r.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let s in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function m0e(t,e,r){let n=r.split("|");return i=>{let s=i===null?"null":typeof i;if(n.indexOf(s)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${t}, got ${s}`)}}class g0e{constructor(e,r,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?m0e(e,r,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class ik{constructor(e,r,n,i){this.name=e,this.rank=r,this.schema=n,this.spec=i,this.attrs=mK(e,i.attrs),this.excluded=null;let s=fK(this.attrs);this.instance=s?new Wt(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Wt(this,hK(this.attrs,e))}static compile(e,r){let n=Object.create(null),i=0;return e.forEach((s,a)=>n[s]=new ik(s,i++,r,a)),n}removeFromSet(e){for(var r=0;r<e.length;r++)e[r].type==this&&(e=e.slice(0,r).concat(e.slice(r+1)),r--);return e}isInSet(e){for(let r=0;r<e.length;r++)if(e[r].type==this)return e[r]}checkAttrs(e){pK(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class vK{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let r=this.spec={};for(let i in e)r[i]=e[i];r.nodes=jn.from(e.nodes),r.marks=jn.from(e.marks||{}),this.nodes=s4.compile(this.spec.nodes,this),this.marks=ik.compile(this.spec.marks,this);let n=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=n[a]||(n[a]=nd.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?a4(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==""?[]:a4(this,a.split(" "))}this.nodeFromJSON=i=>oc.fromJSON(this,i),this.markFromJSON=i=>Wt.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,r=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof s4){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(r,n,i)}text(e,r){let n=this.nodes.text;return new lw(n,n.defaultAttrs,e,Wt.setFrom(r))}mark(e,r){return typeof e=="string"&&(e=this.marks[e]),e.create(r)}nodeType(e){let r=this.nodes[e];if(!r)throw new RangeError("Unknown node type: "+e);return r}}function a4(t,e){let r=[];for(let n=0;n<e.length;n++){let i=e[n],s=t.marks[i],a=s;if(s)r.push(s);else for(let o in t.marks){let c=t.marks[o];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&r.push(a=c)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return r}function v0e(t){return t.tag!=null}function y0e(t){return t.style!=null}class lc{constructor(e,r){this.schema=e,this.rules=r,this.tags=[],this.styles=[];let n=this.matchedStyles=[];r.forEach(i=>{if(v0e(i))this.tags.push(i);else if(y0e(i)){let s=/[^=]*/.exec(i.style)[0];n.indexOf(s)<0&&n.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=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,r={}){let n=new l4(this,r,!1);return n.addAll(e,Wt.none,r.from,r.to),n.finish()}parseSlice(e,r={}){let n=new l4(this,r,!0);return n.addAll(e,Wt.none,r.from,r.to),Ne.maxOpen(n.finish())}matchTag(e,r,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(w0e(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||r.matchesContext(s.context))){if(s.getAttrs){let a=s.getAttrs(e);if(a===!1)continue;s.attrs=a||void 0}return s}}}matchStyle(e,r,n,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(e)!=0||a.context&&!n.matchesContext(a.context)||o.length>e.length&&(o.charCodeAt(e.length)!=61||o.slice(e.length+1)!=r))){if(a.getAttrs){let c=a.getAttrs(r);if(c===!1)continue;a.attrs=c||void 0}return a}}}static schemaRules(e){let r=[];function n(i){let s=i.priority==null?50:i.priority,a=0;for(;a<r.length;a++){let o=r[a];if((o.priority==null?50:o.priority)<s)break}r.splice(a,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(a=>{n(a=c4(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(a=>{n(a=c4(a)),a.node||a.ignore||a.mark||(a.node=i)})}return r}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new lc(e,lc.schemaRules(e)))}}const yK={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},x0e={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},xK={ol:!0,ul:!0},fv=1,xO=2,cg=4;function o4(t,e,r){return e!=null?(e?fv:0)|(e==="full"?xO:0):t&&t.whitespace=="pre"?fv|xO:r&~cg}class Jx{constructor(e,r,n,i,s,a){this.type=e,this.attrs=r,this.marks=n,this.solid=i,this.options=a,this.content=[],this.activeMarks=Wt.none,this.match=s||(a&cg?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(me.from(e));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&fv)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let s=n;n.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 r=me.from(this.content);return!e&&this.match&&(r=r.append(this.match.fillBefore(me.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!yK.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class l4{constructor(e,r,n){this.parser=e,this.options=r,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=r.topNode,s,a=o4(null,r.preserveWhitespace,0)|(n?cg:0);i?s=new Jx(i.type,i.attrs,Wt.none,!0,r.topMatch||i.type.contentMatch,a):n?s=new Jx(null,null,Wt.none,!0,null,a):s=new Jx(e.schema.topNodeType,null,Wt.none,!0,null,a),this.nodes=[s],this.find=r.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,r){e.nodeType==3?this.addTextNode(e,r):e.nodeType==1&&this.addElement(e,r)}addTextNode(e,r){let n=e.nodeValue,i=this.top,s=i.options&xO?"full":this.localPreserveWS||(i.options&fv)>0,{schema:a}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(s)if(s==="full")n=n.replace(/\r\n?/g,`
701`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let o=n.split(/\r?\n|\r/);for(let c=0;c<o.length;c++)c&&this.insertNode(a.linebreakReplacement.create(),r,!0),o[c]&&this.insertNode(a.text(o[c]),r,!/\S/.test(o[c]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let o=i.content[i.content.length-1],c=e.previousSibling;(!o||c&&c.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(n=n.slice(1))}n&&this.insertNode(a.text(n),r,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,r,n){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;xK.hasOwnProperty(a)&&this.parser.normalizeLists&&b0e(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));e:if(c?c.ignore:x0e.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,r);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(e=c.skip);let u,d=this.needsBlock;
vendor: 4,702 bytes, lines 701-702
701if(yK.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(!e.firstChild){this.leafFallback(e,r);break e}let f=c&&c.skip?r:this.readStyles(e,r);f&&this.addAll(e,f),u&&this.sync(s),this.needsBlock=d}else{let u=this.readStyles(e,r);u&&this.addElementByRule(e,c,u,c.consuming===!1?o:void 0)}this.localPreserveWS=i}leafFallback(e,r){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
702`),r)}ignoreFallback(e,r){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),r,!0)}readStyles(e,r){let n=e.style;if(n&&n.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],a=n.getPropertyValue(s);if(a)for(let o=void 0;;){let c=this.parser.matchStyle(s,a,this,o);if(!c)break;if(c.ignore)return null;if(c.clearMark?r=r.filter(u=>!c.clearMark(u)):r=r.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)o=c;else break}}return r}addElementByRule(e,r,n,i){let s,a;if(r.node)if(a=this.parser.schema.nodes[r.node],a.isLeaf)this.insertNode(a.create(r.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let c=this.enter(a,r.attrs||null,n,r.preserveWhitespace);c&&(s=!0,n=c)}else{let c=this.parser.schema.marks[r.mark];n=n.concat(c.create(r.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(r.getContent)this.findInside(e),r.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,n,!1));else{let c=e;typeof r.contentElement=="string"?c=e.querySelector(r.contentElement):typeof r.contentElement=="function"?c=r.contentElement(e):r.contentElement&&(c=r.contentElement),this.findAround(e,c,!0),this.addAll(c,n),this.findAround(e,c,!1)}s&&this.sync(o)&&this.open--}addAll(e,r,n,i){let s=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=i==null?null:e.childNodes[i];a!=o;a=a.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(a,r);this.findAtPoint(e,s)}findPlace(e,r,n){let i,s;for(let a=this.open,o=0;a>=0;a--){let c=this.nodes[a],u=c.findWrapping(e);if(u&&(!i||i.length>u.length+o)&&(i=u,s=c,!u.length))break;if(c.solid){if(n)break;o+=2}}if(!i)return null;this.sync(s);for(let a=0;a<i.length;a++)r=this.enterInner(i[a],null,r,!1);return r}insertNode(e,r,n){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(r=this.enterInner(s,null,r))}let i=this.findPlace(e,r,n);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let a=Wt.none;for(let o of i.concat(e.marks))(s.type?s.type.allowsMarkType(o.type):u4(o.type,e.type))&&(a=o.addToSet(a));return s.content.push(e.mark(a)),!0}return!1}enter(e,r,n,i){let s=this.findPlace(e.create(r),n,!1);return s&&(s=this.enterInner(e,r,n,!0,i)),s}enterInner(e,r,n,i=!1,s){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=o4(e,s,a.options);a.options&cg&&a.content.length==0&&(o|=cg);let c=Wt.none;return n=n.filter(u=>(a.type?a.type.allowsMarkType(u.type):u4(u.type,e))?(c=u.addToSet(c),!1):!0),this.nodes.push(new Jx(e,r,c,i,null,o)),this.open++,n}closeExtra(e=!1){let r=this.nodes.length-1;if(r>this.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let r=this.open;r>=0;r--){if(this.nodes[r]==e)return this.open=r,!0;this.localPreserveWS&&(this.nodes[r].options|=fv)}return!1}get currentPos(){this.closeExtra();let e=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;r&&e++}return e}findAtPoint(e,r){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==r&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&(this.find[r].pos=this.currentPos)}findAround(e,r,n){if(e!=r&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&r.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&(this.find[r].pos=this.currentPos-(e.nodeValue.length-this.find[r].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let r=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),s=-(n?n.depth+1:0)+(i?0:1),a=(o,c)=>{for(;o>=0;
vendor: 4,694 bytes, line 702
702o--){let u=r[o];if(u==""){if(o==r.length-1||o==0)continue;for(;c>=s;c--)if(a(o-1,c))return!0;return!1}else{let d=c>0||c==0&&i?this.nodes[c].type:n&&c>=s?n.node(c-s).type:null;if(!d||d.name!=u&&!d.isInGroup(u))return!1;c--}}return!0};return a(r.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let r=e.depth;r>=0;r--){let n=e.node(r).contentMatchAt(e.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}}function b0e(t){for(let e=t.firstChild,r=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&xK.hasOwnProperty(n)&&r?(r.appendChild(e),e=r):n=="li"?r=e:n&&(r=null)}}function w0e(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function c4(t){let e={};for(let r in t)e[r]=t[r];return e}function u4(t,e){let r=e.schema.nodes;for(let n in r){let i=r[n];if(!i.allowsMarkType(t))continue;let s=[],a=o=>{s.push(o);for(let c=0;c<o.edgeCount;c++){let{type:u,next:d}=o.edge(c);if(u==e||s.indexOf(d)<0&&a(d))return!0}};if(a(i.contentMatch))return!0}}class kd{constructor(e,r){this.nodes=e,this.marks=r}serializeFragment(e,r={},n){n||(n=tN(r).createDocumentFragment());let i=n,s=[];return e.forEach(a=>{if(s.length||a.marks.length){let o=0,c=0;for(;o<s.length&&c<a.marks.length;){let u=a.marks[c];if(!this.marks[u.type.name]){c++;continue}if(!u.eq(s[o][0])||u.type.spec.spanning===!1)break;o++,c++}for(;o<s.length;)i=s.pop()[1];for(;c<a.marks.length;){let u=a.marks[c++],d=this.serializeMark(u,a.isInline,r);d&&(s.push([u,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(a,r))}),n}serializeNodeInner(e,r){let{dom:n,contentDOM:i}=qb(tN(r),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,r,i)}return n}serializeNode(e,r={}){let n=this.serializeNodeInner(e,r);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,r);s&&((s.contentDOM||s.dom).appendChild(n),n=s.dom)}return n}serializeMark(e,r,n={}){let i=this.marks[e.type.name];return i&&qb(tN(n),i(e,r),null,e.attrs)}static renderSpec(e,r,n=null,i){return qb(e,r,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new kd(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let r=d4(e.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(e){return d4(e.marks)}}function d4(t){let e={};for(let r in t){let n=t[r].spec.toDOM;n&&(e[r]=n)}return e}function tN(t){return t.document||window.document}const f4=new WeakMap;function _0e(t){let e=f4.get(t);return e===void 0&&f4.set(t,e=k0e(t)),e}function k0e(t){let e=null;function r(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)r(n[i]);else for(let i in n)r(n[i])}return r(t),e}function qb(t,e,r,n){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(s=_0e(n))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=i.indexOf(" ");a>0&&(r=i.slice(0,a),i=i.slice(a+1));let o,c=r?t.createElementNS(r,i):t.createElement(i),u=e[1],d=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){d=2;for(let f in u)if(u[f]!=null){let p=f.indexOf(" ");p>0?c.setAttributeNS(f.slice(0,p),f.slice(p+1),u[f]):f=="style"&&c.style?c.style.cssText=u[f]:c.setAttribute(f,u[f])}}for(let f=d;f<e.length;f++){let p=e[f];if(p===0){if(f<e.length-1||f>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:m,contentDOM:y}=qb(t,p,r,n);if(c.appendChild(m),y){if(o)throw new RangeError("Multiple content holes");o=y}}}return{dom:c,contentDOM:o}}const bK=65535,wK=Math.pow(2,16);function S0e(t,e){return t+e*wK}function h4(t){return t&bK}function j0e(t){return(t-(t&bK))/wK}const _K=1,kK=2,Kb=4,SK=8;class bO{constructor(e,r,n){this.pos=e,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&SK)>0}get deletedBefore(){return(this.delInfo&(_K|Kb))>0}get deletedAfter(){return(this.delInfo&(kK|Kb))>0}get deletedAcross(){return(this.delInfo&Kb)>0}}class zi{constructor(e,r=!1){if(this.ranges=e,this.inverted=r,!e.length&&zi.empty)return zi.empty}recover(e){let r=0,n=h4(e);if(!this.inverted)for(let i=0;i<n;
vendor: 4,610 bytes, line 702
702i++)r+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+r+j0e(e)}mapResult(e,r=1){return this._map(e,r,!1)}map(e,r=1){return this._map(e,r,!0)}_map(e,r,n){let i=0,s=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let c=this.ranges[o]-(this.inverted?i:0);if(c>e)break;let u=this.ranges[o+s],d=this.ranges[o+a],f=c+u;if(e<=f){let p=u?e==c?-1:e==f?1:r:r,m=c+i+(p<0?0:d);if(n)return m;let y=e==(r<0?c:f)?null:S0e(o/3,e-c),v=e==c?kK:e==f?_K:Kb;return(r<0?e!=c:e!=f)&&(v|=SK),new bO(m,v,y)}i+=d-u}return n?e+i:new bO(e+i,0,null)}touches(e,r){let n=0,i=h4(r),s=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let c=this.ranges[o]-(this.inverted?n:0);if(c>e)break;let u=this.ranges[o+s],d=c+u;if(e<=d&&o==i*3)return!0;n+=this.ranges[o+a]-u}return!1}forEach(e){let r=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let a=this.ranges[i],o=a-(this.inverted?s:0),c=a+(this.inverted?0:s),u=this.ranges[i+r],d=this.ranges[i+n];e(o,o+u,c,c+d),s+=d-u}}invert(){return new zi(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?zi.empty:new zi(e<0?[0,-e,0]:[0,0,e])}}zi.empty=new zi([]);class hv{constructor(e,r,n=0,i=e?e.length:0){this.mirror=r,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||r)}get maps(){return this._maps}slice(e=0,r=this.maps.length){return new hv(this._maps,this.mirror,e,r)}appendMap(e,r){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),r!=null&&this.setMirror(this._maps.length-1,r)}appendMapping(e){for(let r=0,n=this._maps.length;r<e._maps.length;r++){let i=e.getMirror(r);this.appendMap(e._maps[r],i!=null&&i<r?n+i:void 0)}}getMirror(e){if(this.mirror){for(let r=0;r<this.mirror.length;r++)if(this.mirror[r]==e)return this.mirror[r+(r%2?-1:1)]}}setMirror(e,r){this.mirror||(this.mirror=[]),this.mirror.push(e,r)}appendMappingInverted(e){for(let r=e.maps.length-1,n=this._maps.length+e._maps.length;r>=0;r--){let i=e.getMirror(r);this.appendMap(e._maps[r].invert(),i!=null&&i>r?n-i-1:void 0)}}invert(){let e=new hv;return e.appendMappingInverted(this),e}map(e,r=1){if(this.mirror)return this._map(e,r,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,r);return e}mapResult(e,r=1){return this._map(e,r,!1)}_map(e,r,n){let i=0;for(let s=this.from;s<this.to;s++){let a=this._maps[s],o=a.mapResult(e,r);if(o.recover!=null){let c=this.getMirror(s);if(c!=null&&c>s&&c<this.to){s=c,e=this._maps[c].recover(o.recover);continue}}i|=o.delInfo,e=o.pos}return n?e:new bO(e,i,null)}}const rN=Object.create(null);let Gn=class{getMap(){return zi.empty}merge(e){return null}static fromJSON(e,r){if(!r||!r.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=rN[r.stepType];if(!n)throw new RangeError(`No step type ${r.stepType} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in rN)throw new RangeError("Duplicate use of step JSON ID "+e);return rN[e]=r,r.prototype.jsonID=e,r}};class Hr{constructor(e,r){this.doc=e,this.failed=r}static ok(e){return new Hr(e,null)}static fail(e){return new Hr(null,e)}static fromReplace(e,r,n,i){try{return Hr.ok(e.replace(r,n,i))}catch(s){if(s instanceof sw)return Hr.fail(s.message);throw s}}}function U2(t,e,r){let n=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(U2(s.content,e,s))),s.isInline&&(s=e(s,r,i)),n.push(s)}return me.fromArray(n)}class ql extends Gn{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),s=new Ne(U2(r.content,(a,o)=>!a.isAtom||!o.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),r.openStart,r.openEnd);return Hr.fromReplace(e,this.from,this.to,s)}invert(){return new Da(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new ql(r.pos,n.pos,this.mark)}merge(e){return e instanceof ql&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ql(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ql(r.from,r.to,e.markFromJSON(r.mark))}}Gn.jsonID("addMark",ql);class Da extends Gn{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}
vendor: 11,431 bytes, lines 702-703
702apply(e){let r=e.slice(this.from,this.to),n=new Ne(U2(r.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),r.openStart,r.openEnd);return Hr.fromReplace(e,this.from,this.to,n)}invert(){return new ql(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new Da(r.pos,n.pos,this.mark)}merge(e){return e instanceof Da&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Da(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Da(r.from,r.to,e.markFromJSON(r.mark))}}Gn.jsonID("removeMark",Da);class Kl extends Gn{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return Hr.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return Hr.fromReplace(e,this.pos,this.pos+1,new Ne(me.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let i=0;i<r.marks.length;i++)if(!r.marks[i].isInSet(n))return new Kl(this.pos,r.marks[i]);return new Kl(this.pos,this.mark)}}return new id(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new Kl(r.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Kl(r.pos,e.markFromJSON(r.mark))}}Gn.jsonID("addNodeMark",Kl);class id extends Gn{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return Hr.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.removeFromSet(r.marks));return Hr.fromReplace(e,this.pos,this.pos+1,new Ne(me.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);return!r||!this.mark.isInSet(r.marks)?this:new Kl(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new id(r.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new id(r.pos,e.markFromJSON(r.mark))}}Gn.jsonID("removeNodeMark",id);class Fr extends Gn{constructor(e,r,n,i=!1){super(),this.from=e,this.to=r,this.slice=n,this.structure=i}apply(e){return this.structure&&wO(e,this.from,this.to)?Hr.fail("Structure replace would overwrite content"):Hr.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new zi([this.from,this.to-this.from,this.slice.size])}invert(e){return new Fr(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let r=e.mapResult(this.to,-1),n=this.from==this.to&&Fr.MAP_BIAS<0?r:e.mapResult(this.from,1);return n.deletedAcross&&r.deletedAcross?null:new Fr(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Fr)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let r=this.slice.size+e.slice.size==0?Ne.empty:new Ne(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Fr(this.from,this.to+(e.to-e.from),r,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let r=this.slice.size+e.slice.size==0?Ne.empty:new Ne(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Fr(e.from,this.to,r,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Fr(r.from,r.to,Ne.fromJSON(e,r.slice),!!r.structure)}}Fr.MAP_BIAS=1;Gn.jsonID("replace",Fr);class dn extends Gn{constructor(e,r,n,i,s,a,o=!1){super(),this.from=e,this.to=r,this.gapFrom=n,this.gapTo=i,this.slice=s,this.insert=a,this.structure=o}apply(e){if(this.structure&&(wO(e,this.from,this.gapFrom)||wO(e,this.gapTo,this.to)))return Hr.fail("Structure gap-replace would overwrite content");let r=e.slice(this.gapFrom,this.gapTo);if(r.openStart||r.openEnd)return Hr.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,r.content);return n?Hr.fromReplace(e,this.from,this.to,n):Hr.fail("Content does not fit in gap")}getMap(){return new zi([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let r=this.gapTo-this.gapFrom;return new dn(this.from,this.from+this.slice.size+r,this.from+this.insert,this.from+this.insert+r,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?r.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return r.deletedAcross&&n.deletedAcross||i<r.pos||s>n.pos?null:new dn(r.pos,n.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new dn(r.from,r.to,r.gapFrom,r.gapTo,Ne.fromJSON(e,r.slice),r.insert,!!r.structure)}}Gn.jsonID("replaceAround",dn);function wO(t,e,r){let n=t.resolve(e),i=r-e,s=n.depth;for(;i>0&&s>0&&n.indexAfter(s)==n.node(s).childCount;)s--,i--;if(i>0){let a=n.node(s).maybeChild(n.indexAfter(s));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function N0e(t,e,r,n){let i=[],s=[],a,o;t.doc.nodesBetween(e,r,(c,u,d)=>{if(!c.isInline)return;let f=c.marks;if(!n.isInSet(f)&&d.type.allowsMarkType(n.type)){let p=Math.max(u,e),m=Math.min(u+c.nodeSize,r),y=n.addToSet(f);for(let v=0;v<f.length;v++)f[v].isInSet(y)||(a&&a.to==p&&a.mark.eq(f[v])?a.to=m:i.push(a=new Da(p,m,f[v])));o&&o.to==p?o.to=m:s.push(o=new ql(p,m,n))}}),i.forEach(c=>t.step(c)),s.forEach(c=>t.step(c))}function C0e(t,e,r,n){let i=[],s=0;t.doc.nodesBetween(e,r,(a,o)=>{if(!a.isInline)return;s++;let c=null;if(n instanceof ik){let u=a.marks,d;for(;d=n.isInSet(u);)(c||(c=[])).push(d),u=d.removeFromSet(u)}else n?n.isInSet(a.marks)&&(c=[n]):c=a.marks;if(c&&c.length){let u=Math.min(o+a.nodeSize,r);for(let d=0;d<c.length;d++){let f=c[d],p;for(let m=0;m<i.length;m++){let y=i[m];y.step==s-1&&f.eq(i[m].style)&&(p=y)}p?(p.to=u,p.step=s):i.push({style:f,from:Math.max(o,e),to:u,step:s})}}}),i.forEach(a=>t.step(new Da(a.from,a.to,a.style)))}function H2(t,e,r,n=r.contentMatch,i=!0){let s=t.doc.nodeAt(e),a=[],o=e+1;for(let c=0;c<s.childCount;c++){let u=s.child(c),d=o+u.nodeSize,f=n.matchType(u.type);if(!f)a.push(new Fr(o,d,Ne.empty));else{n=f;for(let p=0;p<u.marks.length;p++)r.allowsMarkType(u.marks[p].type)||t.step(new Da(o,d,u.marks[p]));if(i&&u.isText&&r.whitespace!="pre"){let p,m=/\r?\n|\r/g,y;for(;p=m.exec(u.text);)y||(y=new Ne(me.from(r.schema.text(" ",r.allowedMarks(u.marks))),0,0)),a.push(new Fr(o+p.index,o+p.index+p[0].length,y))}}o=d}if(!n.validEnd){let c=n.fillBefore(me.empty,!0);t.replace(o,o,new Ne(c,0,0))}for(let c=a.length-1;c>=0;c--)t.step(a[c])}function E0e(t,e,r){return(e==0||t.canReplace(e,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function Op(t){let r=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth,i=0,s=0;;--n){let a=t.$from.node(n),o=t.$from.index(n)+i,c=t.$to.indexAfter(n)-s;if(n<t.depth&&a.canReplace(o,c,r))return n;if(n==0||a.type.spec.isolating||!E0e(a,o,c))break;o&&(i=1),c<a.childCount&&(s=1)}return null}function O0e(t,e,r){let{$from:n,$to:i,depth:s}=e,a=n.before(s+1),o=i.after(s+1),c=a,u=o,d=me.empty,f=0;for(let y=s,v=!1;y>r;y--)v||n.index(y)>0?(v=!0,d=me.from(n.node(y).copy(d)),f++):c--;let p=me.empty,m=0;for(let y=s,v=!1;y>r;y--)v||i.after(y+1)<i.end(y)?(v=!0,p=me.from(i.node(y).copy(p)),m++):u++;t.step(new dn(c,u,a,o,new Ne(d.append(p),f,m),d.size-f,!0))}function V2(t,e,r=null,n=t){let i=T0e(t,e),s=i&&A0e(n,e);return s?i.map(p4).concat({type:e,attrs:r}).concat(s.map(p4)):null}function p4(t){return{type:t,attrs:null}}function T0e(t,e){let{parent:r,startIndex:n,endIndex:i}=t,s=r.contentMatchAt(n).findWrapping(e);if(!s)return null;let a=s.length?s[0]:e;return r.canReplaceWith(n,i,a)?s:null}function A0e(t,e){let{parent:r,startIndex:n,endIndex:i}=t,s=r.child(n),a=e.contentMatch.findWrapping(s.type);if(!a)return null;let c=(a.length?a[a.length-1]:e).contentMatch;for(let u=n;c&&u<i;u++)c=c.matchType(r.child(u).type);return!c||!c.validEnd?null:a}function P0e(t,e,r){let n=me.empty;for(let a=r.length-1;a>=0;a--){if(n.size){let o=r[a].type.contentMatch.matchFragment(n);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=me.from(r[a].type.create(r[a].attrs,n))}let i=e.start,s=e.end;t.step(new dn(i,s,i,s,new Ne(n,0,0),r.length,!0))}function M0e(t,e,r,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,r,(a,o)=>{let c=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(n,c)&&R0e(t.doc,t.mapping.slice(s).map(o),n)){let u=null;if(n.schema.linebreakReplacement){let m=n.whitespace=="pre",y=!!n.contentMatch.matchType(n.schema.linebreakReplacement);m&&!y?u=!1:!m&&y&&(u=!0)}u===!1&&NK(t,a,o,s),H2(t,t.mapping.slice(s).map(o,1),n,void 0,u===null);let d=t.mapping.slice(s),f=d.map(o,1),p=d.map(o+a.nodeSize,1);return t.step(new dn(f,p,f+1,p-1,new Ne(me.from(n.create(c,null,a.marks)),0,0),1,!0)),u===!0&&jK(t,a,o,s),!1}})}function jK(t,e,r,n){e.forEach((i,s)=>{if(i.isText){let a,o=/\r?\n|\r/g;for(;a=o.exec(i.text);){let c=t.mapping.slice(n).map(r+1+s+a.index);t.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function NK(t,e,r,n){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let a=t.mapping.slice(n).map(r+1+s);t.replaceWith(a,a+1,e.type.schema.text(`
703`))}})}function R0e(t,e,r){let n=t.resolve(e),i=n.index();return n.parent.canReplaceWith(i,i+1,r)}function I0e(t,e,r,n,i){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");r||(r=s.type);let a=r.create(n,null,i||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,a);if(!r.validContent(s.content))throw new RangeError("Invalid content for node type "+r.name);t.step(new dn(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new Ne(me.from(a),0,0),1,!0))}function Yf(t,e,r=1,n){let i=t.resolve(e),s=i.depth-r,a=n&&n[n.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=r-2;u>s;u--,d--){let f=i.node(u),p=i.index(u);if(f.type.spec.isolating)return!1;let m=f.content.cutByIndex(p,f.childCount),y=n&&n[d+1];
vendor: 4,522 bytes, line 703
703y&&(m=m.replaceChild(0,y.type.create(y.attrs)));let v=n&&n[d]||f;if(!f.canReplace(p+1,f.childCount)||!v.type.validContent(m))return!1}let o=i.indexAfter(s),c=n&&n[0];return i.node(s).canReplaceWith(o,o,c?c.type:i.node(s+1).type)}function L0e(t,e,r=1,n){let i=t.doc.resolve(e),s=me.empty,a=me.empty;for(let o=i.depth,c=i.depth-r,u=r-1;o>c;o--,u--){s=me.from(i.node(o).copy(s));let d=n&&n[u];a=me.from(d?d.type.create(d.attrs,a):i.node(o).copy(a))}t.step(new Fr(e,e,new Ne(s.append(a),r,r),!0))}function Bc(t,e){let r=t.resolve(e),n=r.index();return CK(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function $0e(t,e){e.content.size||t.type.compatibleContent(e.type);let r=t.contentMatchAt(t.childCount),{linebreakReplacement:n}=t.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),a=s.type==n?t.type.schema.nodes.text:s.type;if(r=r.matchType(a),!r||!t.type.allowsMarks(s.marks))return!1}return r.validEnd}function CK(t,e){return!!(t&&e&&!t.isLeaf&&$0e(t,e))}function sk(t,e,r=-1){let n=t.resolve(e);for(let i=n.depth;;i--){let s,a,o=n.index(i);if(i==n.depth?(s=n.nodeBefore,a=n.nodeAfter):r>0?(s=n.node(i+1),o++,a=n.node(i).maybeChild(o)):(s=n.node(i).maybeChild(o-1),a=n.node(i+1)),s&&!s.isTextblock&&CK(s,a)&&n.node(i).canReplace(o,o+1))return e;if(i==0)break;e=r<0?n.before(i):n.after(i)}}function D0e(t,e,r){let n=null,{linebreakReplacement:i}=t.doc.type.schema,s=t.doc.resolve(e-r),a=s.node().type;if(i&&a.inlineContent){let d=a.whitespace=="pre",f=!!a.contentMatch.matchType(i);d&&!f?n=!1:!d&&f&&(n=!0)}let o=t.steps.length;if(n===!1){let d=t.doc.resolve(e+r);NK(t,d.node(),d.before(),o)}a.inlineContent&&H2(t,e+r-1,a,s.node().contentMatchAt(s.index()),n==null);let c=t.mapping.slice(o),u=c.map(e-r);if(t.step(new Fr(u,c.map(e+r,-1),Ne.empty,!0)),n===!0){let d=t.doc.resolve(u);jK(t,d.node(),d.before(),t.steps.length)}return t}function B0e(t,e,r){let n=t.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),r))return e;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let s=n.index(i);if(n.node(i).canReplaceWith(s,s,r))return n.before(i+1);if(s>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let s=n.indexAfter(i);if(n.node(i).canReplaceWith(s,s,r))return n.after(i+1);if(s<n.node(i).childCount)return null}return null}function EK(t,e,r){let n=t.resolve(e);if(!r.content.size)return e;let i=r.content;for(let s=0;s<r.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(r.openStart==0&&r.size?2:1);s++)for(let a=n.depth;a>=0;a--){let o=a==n.depth?0:n.pos<=(n.start(a+1)+n.end(a+1))/2?-1:1,c=n.index(a)+(o>0?1:0),u=n.node(a),d=!1;if(s==1)d=u.canReplace(c,c,i);else{let f=u.contentMatchAt(c).findWrapping(i.firstChild.type);d=f&&u.canReplaceWith(c,c,f[0])}if(d)return o==0?n.pos:o<0?n.before(a+1):n.after(a+1)}return null}function ak(t,e,r=e,n=Ne.empty){if(e==r&&!n.size)return null;let i=t.resolve(e),s=t.resolve(r);return OK(i,s,n)?new Fr(e,r,n):new F0e(i,s,n).fit()}function OK(t,e,r){return!r.openStart&&!r.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),r.content)}class F0e{constructor(e,r,n){this.$from=e,this.$to=r,this.unplaced=n,this.frontier=[],this.placed=me.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=me.from(e.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 e=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let s=this.placed,a=n.depth,o=i.depth;for(;a&&o&&s.childCount==1;)s=s.firstChild.content,a--,o--;let c=new Ne(s,a,o);return e>-1?new dn(n.pos,e,this.$to.pos,this.$to.end(),c,r):c.size||n.pos!=this.$to.pos?new Fr(n.pos,i.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let r=this.unplaced.content,n=0,i=this.unplaced.openEnd;n<e;n++){let s=r.firstChild;if(r.childCount>1&&(i=0),s.type.spec.isolating&&i<=n){e=n;break}r=s.content}for(let r=1;r<=2;r++)for(let n=r==1?e:this.unplaced.openStart;n>=0;n--){let i,s=null;n?(s=nN(this.unplaced.content,n-1).firstChild,i=s.content):i=this.unplaced.content;let a=i.firstChild;for(let o=this.depth;o>=0;o--){let{type:c,match:u}=this.frontier[o],d,f=null;if(r==1&&(a?u.matchType(a.type)||(f=u.fillBefore(me.from(a),!1)):s&&c.compatibleContent(s.type)))return{sliceDepth:n,frontierDepth:o,parent:s,inject:f};
vendor: 8,113 bytes, line 703
703if(r==2&&a&&(d=u.findWrapping(a.type)))return{sliceDepth:n,frontierDepth:o,parent:s,wrap:d};if(s&&u.matchType(s.type))break}}}openMore(){let{content:e,openStart:r,openEnd:n}=this.unplaced,i=nN(e,r);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Ne(e,r+1,Math.max(n,i.size+r>=e.size-n?r+1:0)),!0)}dropNode(){let{content:e,openStart:r,openEnd:n}=this.unplaced,i=nN(e,r);if(i.childCount<=1&&r>0){let s=e.size-r<=r+i.size;this.unplaced=new Ne(Um(e,r-1,1),r-1,s?r-1:n)}else this.unplaced=new Ne(Um(e,r,1),r,n)}placeNodes({sliceDepth:e,frontierDepth:r,parent:n,inject:i,wrap:s}){for(;this.depth>r;)this.closeFrontierNode();if(s)for(let v=0;v<s.length;v++)this.openFrontierNode(s[v]);let a=this.unplaced,o=n?n.content:a.content,c=a.openStart-e,u=0,d=[],{match:f,type:p}=this.frontier[r];if(i){for(let v=0;v<i.childCount;v++)d.push(i.child(v));f=f.matchFragment(i)}let m=o.size+e-(a.content.size-a.openEnd);for(;u<o.childCount;){let v=o.child(u),w=f.matchType(v.type);if(!w)break;u++,(u>1||c==0||v.content.size)&&(f=w,d.push(TK(v.mark(p.allowedMarks(v.marks)),u==1?c:0,u==o.childCount?m:-1)))}let y=u==o.childCount;y||(m=-1),this.placed=Hm(this.placed,r,me.from(d)),this.frontier[r].match=f,y&&m<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,w=o;v<m;v++){let b=w.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),w=b.content}this.unplaced=y?e==0?Ne.empty:new Ne(Um(a.content,e-1,1),e-1,m<0?a.openEnd:e-1):new Ne(Um(a.content,e,u),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],r;if(!e.type.isTextblock||!iN(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(r=this.findCloseLevel(this.$to))&&r.depth==this.depth)return-1;let{depth:n}=this.$to,i=this.$to.after(n);for(;n>1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let r=Math.min(this.depth,e.depth);r>=0;r--){let{match:n,type:i}=this.frontier[r],s=r<e.depth&&e.end(r+1)==e.pos+(e.depth-(r+1)),a=iN(e,r,i,n,s);if(a){for(let o=r-1;o>=0;o--){let{match:c,type:u}=this.frontier[o],d=iN(e,o,u,c,!0);if(!d||d.childCount)continue e}return{depth:r,fit:a,move:s?e.doc.resolve(e.after(r+1)):e}}}}close(e){let r=this.findCloseLevel(e);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=Hm(this.placed,r.depth,r.fit)),e=r.move;for(let n=r.depth+1;n<=e.depth;n++){let i=e.node(n),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,r=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Hm(this.placed,this.depth,me.from(e.create(r,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let r=this.frontier.pop().match.fillBefore(me.empty,!0);r.childCount&&(this.placed=Hm(this.placed,this.frontier.length,r))}}function Um(t,e,r){return e==0?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(Um(t.firstChild.content,e-1,r)))}function Hm(t,e,r){return e==0?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(Hm(t.lastChild.content,e-1,r)))}function nN(t,e){for(let r=0;r<e;r++)t=t.firstChild.content;return t}function TK(t,e,r){if(e<=0)return t;let n=t.content;return e>1&&(n=n.replaceChild(0,TK(n.firstChild,e-1,n.childCount==1?r-1:0))),e>0&&(n=t.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(t.type.contentMatch.matchFragment(n).fillBefore(me.empty,!0)))),t.copy(n)}function iN(t,e,r,n,i){let s=t.node(e),a=i?t.indexAfter(e):t.index(e);if(a==s.childCount&&!r.compatibleContent(s.type))return null;let o=n.fillBefore(s.content,!0,a);return o&&!z0e(r,s.content,a)?o:null}function z0e(t,e,r){for(let n=r;n<e.childCount;n++)if(!t.allowsMarks(e.child(n).marks))return!0;return!1}function U0e(t){return t.spec.defining||t.spec.definingForContent}function H0e(t,e,r,n){if(!n.size)return t.deleteRange(e,r);let i=t.doc.resolve(e),s=t.doc.resolve(r);if(OK(i,s,n))return t.step(new Fr(e,r,n));let a=PK(i,s);a[a.length-1]==0&&a.pop();let o=-(i.depth+1);a.unshift(o);for(let p=i.depth,m=i.pos-1;p>0;p--,m--){let y=i.node(p).type.spec;if(y.defining||y.definingAsContext||y.isolating)break;a.indexOf(p)>-1?o=p:i.before(p)==m&&a.splice(1,0,-p)}let c=a.indexOf(o),u=[],d=n.openStart;for(let p=n.content,m=0;;m++){let y=p.firstChild;if(u.push(y),m==n.openStart)break;p=y.content}for(let p=d-1;p>=0;p--){let m=u[p],y=U0e(m.type);if(y&&!m.sameMarkup(i.node(Math.abs(o)-1)))d=p;else if(y||!m.type.isTextblock)break}for(let p=n.openStart;p>=0;p--){let m=(p+d+1)%(n.openStart+1),y=u[m];if(y)for(let v=0;v<a.length;v++){let w=a[(v+c)%a.length],b=!0;w<0&&(b=!1,w=-w);let _=i.node(w-1),S=i.index(w-1);if(_.canReplaceWith(S,S,y.type,y.marks))return t.replace(i.before(w),b?s.after(w):r,new Ne(AK(n.content,0,n.openStart,m),m,n.openEnd))}}let f=t.steps.length;for(let p=a.length-1;p>=0&&(t.replace(e,r,n),!(t.steps.length>f));p--){let m=a[p];m<0||(e=i.before(m),r=s.after(m))}}function AK(t,e,r,n,i){if(e<r){let s=t.firstChild;t=t.replaceChild(0,s.copy(AK(s.content,e+1,r,n,s)))}if(e>n){let s=i.contentMatchAt(0),a=s.fillBefore(t).append(t);t=a.append(s.matchFragment(a).fillBefore(me.empty,!0))}return t}function V0e(t,e,r,n){if(!n.isInline&&e==r&&t.doc.resolve(e).parent.content.size){let i=B0e(t.doc,e,n.type);i!=null&&(e=r=i)}t.replaceRange(e,r,new Ne(me.from(n),0,0))}function W0e(t,e,r){let n=t.doc.resolve(e),i=t.doc.resolve(r);if(n.parent.isTextblock&&i.parent.isTextblock&&n.start()!=i.start()&&n.parentOffset==0&&i.parentOffset==0){let a=n.sharedDepth(r),o=!1;for(let c=n.depth;c>a;c--)n.node(c).type.spec.isolating&&(o=!0);for(let c=i.depth;c>a;c--)i.node(c).type.spec.isolating&&(o=!0);if(!o){for(let c=n.depth;c>0&&e==n.start(c);c--)e=n.before(c);for(let c=i.depth;c>0&&r==i.start(c);c--)r=i.before(c);n=t.doc.resolve(e),i=t.doc.resolve(r)}}let s=PK(n,i);for(let a=0;a<s.length;a++){let o=s[a],c=a==s.length-1;if(c&&o==0||n.node(o).type.contentMatch.validEnd)return t.delete(n.start(o),i.end(o));if(o>0&&(c||n.node(o-1).canReplace(n.index(o-1),i.indexAfter(o-1))))return t.delete(n.before(o),i.after(o))}for(let a=1;a<=n.depth&&a<=i.depth;a++)if(e-n.start(a)==n.depth-a&&r>n.end(a)&&i.end(a)-r!=i.depth-a&&n.start(a-1)==i.start(a-1)&&n.node(a-1).canReplace(n.index(a-1),i.index(a-1)))return t.delete(n.before(a),r);t.delete(e,r)}function PK(t,e){let r=[],n=Math.min(t.depth,e.depth);for(let i=n;i>=0;i--){let s=t.start(i);if(s<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&r.push(i)}return r}class Xf extends Gn{constructor(e,r,n){super(),this.pos=e,this.attr=r,this.value=n}apply(e){let r=e.nodeAt(this.pos);if(!r)return Hr.fail("No node at attribute step's position");let n=Object.create(null);for(let s in r.attrs)n[s]=r.attrs[s];n[this.attr]=this.value;let i=r.type.create(n,null,r.marks);return Hr.fromReplace(e,this.pos,this.pos+1,new Ne(me.from(i),0,r.isLeaf?0:1))}getMap(){return zi.empty}invert(e){return new Xf(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new Xf(r.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.pos!="number"||typeof r.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Xf(r.pos,r.attr,r.value)}}Gn.jsonID("attr",Xf);class pv extends Gn{constructor(e,r){super(),this.attr=e,this.value=r}apply(e){let r=Object.create(null);for(let i in e.attrs)r[i]=e.attrs[i];r[this.attr]=this.value;let n=e.type.create(r,e.content,e.marks);return Hr.ok(n)}getMap(){return zi.empty}invert(e){return new pv(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new pv(r.attr,r.value)}}Gn.jsonID("docAttr",pv);
vendor: 4,298 bytes, line 703
703let Rh=class extends Error{};Rh=function t(e){let r=Error.call(this,e);return r.__proto__=t.prototype,r};Rh.prototype=Object.create(Error.prototype);Rh.prototype.constructor=Rh;Rh.prototype.name="TransformError";class MK{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new hv}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let r=this.maybeStep(e);if(r.failed)throw new Rh(r.failed);return this}maybeStep(e){let r=e.apply(this.doc);return r.failed||this.addStep(e,r.doc),r}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,r=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let i=this.mapping.maps[n];n&&(e=i.map(e,1),r=i.map(r,-1)),i.forEach((s,a,o,c)=>{e=Math.min(e,o),r=Math.max(r,c)})}return e==1e9?null:{from:e,to:r}}addStep(e,r){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=r}replace(e,r=e,n=Ne.empty){let i=ak(this.doc,e,r,n);return i&&this.step(i),this}replaceWith(e,r,n){return this.replace(e,r,new Ne(me.from(n),0,0))}delete(e,r){return this.replace(e,r,Ne.empty)}insert(e,r){return this.replaceWith(e,e,r)}replaceRange(e,r,n){return H0e(this,e,r,n),this}replaceRangeWith(e,r,n){return V0e(this,e,r,n),this}deleteRange(e,r){return W0e(this,e,r),this}lift(e,r){return O0e(this,e,r),this}join(e,r=1){return D0e(this,e,r),this}wrap(e,r){return P0e(this,e,r),this}setBlockType(e,r=e,n,i=null){return M0e(this,e,r,n,i),this}setNodeMarkup(e,r,n=null,i){return I0e(this,e,r,n,i),this}setNodeAttribute(e,r,n){return this.step(new Xf(e,r,n)),this}setDocAttribute(e,r){return this.step(new pv(e,r)),this}addNodeMark(e,r){return this.step(new Kl(e,r)),this}removeNodeMark(e,r){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(r instanceof Wt)r.isInSet(n.marks)&&this.step(new id(e,r));else{let i=n.marks,s,a=[];for(;s=r.isInSet(i);)a.push(new id(e,s)),i=s.removeFromSet(i);for(let o=a.length-1;o>=0;o--)this.step(a[o])}return this}split(e,r=1,n){return L0e(this,e,r,n),this}addMark(e,r,n){return N0e(this,e,r,n),this}removeMark(e,r,n){return C0e(this,e,r,n),this}clearIncompatible(e,r,n){return H2(this,e,r,n),this}}const sN=Object.create(null);class dt{constructor(e,r,n){this.$anchor=e,this.$head=r,this.ranges=n||[new q0e(e.min(r),e.max(r))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let r=0;r<e.length;r++)if(e[r].$from.pos!=e[r].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,r=Ne.empty){let n=r.content.lastChild,i=null;for(let o=0;o<r.openEnd;o++)i=n,n=n.lastChild;let s=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:c,$to:u}=a[o],d=e.mapping.slice(s);e.replaceRange(d.map(c.pos),d.map(u.pos),o?Ne.empty:r),o==0&&v4(e,s,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,r){let n=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:o}=i[s],c=e.mapping.slice(n),u=c.map(a.pos),d=c.map(o.pos);s?e.deleteRange(u,d):(e.replaceRangeWith(u,d,r),v4(e,n,r.isInline?-1:1))}}static findFrom(e,r,n=!1){let i=e.parent.inlineContent?new Qe(e):ff(e.node(0),e.parent,e.pos,e.index(),r,n);if(i)return i;for(let s=e.depth-1;s>=0;s--){let a=r<0?ff(e.node(0),e.node(s),e.before(s+1),e.index(s),r,n):ff(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,r,n);if(a)return a}return null}static near(e,r=1){return this.findFrom(e,r)||this.findFrom(e,-r)||new Cs(e.node(0))}static atStart(e){return ff(e,e,0,0,1)||new Cs(e)}static atEnd(e){return ff(e,e,e.content.size,e.childCount,-1)||new Cs(e)}static fromJSON(e,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=sN[r.type];if(!n)throw new RangeError(`No selection type ${r.type} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in sN)throw new RangeError("Duplicate use of selection JSON ID "+e);return sN[e]=r,r.prototype.jsonID=e,r}getBookmark(){return Qe.between(this.$anchor,this.$head).getBookmark()}}dt.prototype.visible=!0;class q0e{constructor(e,r){this.$from=e,this.$to=r}}let m4=!1;function g4(t){!m4&&!t.parent.inlineContent&&(m4=!0,console.warn("TextSelection endpoint not pointing into a 
703node with inline content ("+t.parent.type.name+")"))}class Qe extends dt{constructor(e,r=e){g4(e),g4(r),super(e,r)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,r){let n=e.resolve(r.map(this.head));if(!n.parent.inlineContent)return dt.near(n);let i=e.resolve(r.map(this.anchor));return new Qe(i.parent.inlineContent?i:n,n)}replace(e,r=Ne.empty){if(super.replace(e,r),r==Ne.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof Qe&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ok(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,r){if(typeof r.anchor!="number"||typeof r.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Qe(e.resolve(r.anchor),e.resolve(r.head))}static create(e,r,n=r){let i=e.resolve(r);return new this(i,n==r?i:e.resolve(n))}static between(e,r,n){let i=e.pos-r.pos;if((!n||i)&&(n=i>=0?1:-1),!r.parent.inlineContent){let s=dt.findFrom(r,n,!0)||dt.findFrom(r,-n,!0);if(s)r=s.$head;else return dt.near(r,n)}return e.parent.inlineContent||(i==0?e=r:(e=(dt.findFrom(e,-n,!0)||dt.findFrom(e,n,!0)).$anchor,e.pos<r.pos!=i<0&&(e=r))),new Qe(e,r)}}dt.jsonID("text",Qe);class ok{constructor(e,r){this.anchor=e,this.head=r}map(e){return new ok(e.map(this.anchor),e.map(this.head))}resolve(e){return Qe.between(e.resolve(this.anchor),e.resolve(this.head))}}class Ue extends dt{constructor(e){let r=e.nodeAfter,n=e.node(0).resolve(e.pos+r.nodeSize);super(e,n),this.node=r}map(e,r){let{deleted:n,pos:i}=r.mapResult(this.anchor),s=e.resolve(i);return n?dt.near(s):new Ue(s)}content(){return new Ne(me.from(this.node),0,0)}eq(e){return e instanceof Ue&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new W2(this.anchor)}static fromJSON(e,r){if(typeof r.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Ue(e.resolve(r.anchor))}static create(e,r){return new Ue(e.resolve(r))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Ue.prototype.visible=!1;dt.jsonID("node",Ue);class W2{constructor(e){this.anchor=e}map(e){let{deleted:r,pos:n}=e.mapResult(this.anchor);return r?new ok(n,n):new W2(n)}resolve(e){let r=e.resolve(this.anchor),n=r.nodeAfter;return n&&Ue.isSelectable(n)?new Ue(r):dt.near(r)}}class Cs extends dt{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,r=Ne.empty){if(r==Ne.empty){e.delete(0,e.doc.content.size);let n=dt.atStart(e.doc);n.eq(e.selection)||e.setSelection(n)}else super.replace(e,r)}toJSON(){return{type:"all"}}static fromJSON(e){return new Cs(e)}map(e){return new Cs(e)}eq(e){return e instanceof Cs}getBookmark(){return K0e}}dt.jsonID("all",Cs);const K0e={map(){return this},resolve(t){return new Cs(t)}};function ff(t,e,r,n,i,s=!1){if(e.inlineContent)return Qe.create(t,r);for(let a=n-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let o=e.child(a);if(o.isAtom){if(!s&&Ue.isSelectable(o))return Ue.create(t,r-(i<0?o.nodeSize:0))}else{let c=ff(t,o,r+i,i<0?o.childCount:0,i,s);if(c)return c}r+=o.nodeSize*i}return null}function v4(t,e,r){let n=t.steps.length-1;if(n<e)return;let i=t.steps[n];if(!(i instanceof Fr||i instanceof dn))return;let s=t.mapping.maps[n],a;s.forEach((o,c,u,d)=>{a==null&&(a=d)}),t.setSelection(dt.near(t.doc.resolve(a),r))}const y4=1,Yx=2,x4=4;class G0e extends MK{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|y4)&~Yx,this.storedMarks=null,this}get selectionSet(){return(this.updated&y4)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Yx,this}ensureMarks(e){return Wt.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Yx)>0}addStep(e,r){super.addStep(e,r),this.updated=this.updated&~Yx,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,r=!0){let n=this.selection;return r&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Wt.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,r,n){let i=this.doc.type.schema;if(r==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(n==null&&(n=r),!e)return this.deleteRange(r,n);let s=this.storedMarks;if(!s){let a=this.doc.resolve(r);s=n==r?a.marks():a.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(r,n,i.text(e,s)),!this.selection.empty&&this.selection.to==r+e.length&&this.setSelection(dt.near(this.selection.$to)),this}}setMeta(e,r){return this.meta[typeof e=="string"?e:e.key]=r,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=x4,this}get scrolledIntoView(){return(this.updated&x4)>0}}function b4(t,e){return!e||!t?t:t.bind(e)}class Vm{constructor(e,r,n){this.name=e,this.init=b4(r.init,n),this.apply=b4(r.apply,n)}}const Z0e=[new Vm("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Vm("selection",{init(t,e){return t.selection||dt.atStart(e.doc)},apply(t){return t.selection}}),new Vm("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,r,n){return n.selection.$cursor?t.storedMarks:null}}),new Vm("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class aN{constructor(e,r){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Z0e.slice(),r&&r.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new Vm(n.key,n.spec.state,n))})}}class Tf{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}
vendor: 4,191 bytes, line 703
703apply(e){return this.applyTransaction(e).state}filterTransaction(e,r=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=r){let i=this.config.plugins[n];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let r=[e],n=this.applyInner(e),i=null;for(;;){let s=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let c=i?i[a].n:0,u=i?i[a].state:this,d=c<r.length&&o.spec.appendTransaction.call(o,c?r.slice(c):r,u,n);if(d&&n.filterTransaction(d,a)){if(d.setMeta("appendedTransaction",e),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<a?{state:n,n:r.length}:{state:this,n:0})}r.push(d),n=n.applyInner(d),s=!0}i&&(i[a]={state:n,n:r.length})}}if(!s)return{state:n,transactions:r}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let r=new Tf(this.config),n=this.config.fields;for(let i=0;i<n.length;i++){let s=n[i];r[s.name]=s.apply(e,this[s.name],this,r)}return r}get tr(){return new G0e(this)}static create(e){let r=new aN(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Tf(r);for(let i=0;i<r.fields.length;i++)n[r.fields[i].name]=r.fields[i].init(e,n);return n}reconfigure(e){let r=new aN(this.schema,e.plugins),n=r.fields,i=new Tf(r);for(let s=0;s<n.length;s++){let a=n[s].name;i[a]=this.hasOwnProperty(a)?this[a]:n[s].init(e,i)}return i}toJSON(e){let r={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(r.storedMarks=this.storedMarks.map(n=>n.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[n],s=i.spec.state;s&&s.toJSON&&(r[n]=s.toJSON.call(i,this[i.key]))}return r}static fromJSON(e,r,n){if(!r)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new aN(e.schema,e.plugins),s=new Tf(i);return i.fields.forEach(a=>{if(a.name=="doc")s.doc=oc.fromJSON(e.schema,r.doc);else if(a.name=="selection")s.selection=dt.fromJSON(s.doc,r.selection);else if(a.name=="storedMarks")r.storedMarks&&(s.storedMarks=r.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let c=n[o],u=c.spec.state;if(c.key==a.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(r,o)){s[a.name]=u.fromJSON.call(c,e,r[o],s);return}}s[a.name]=a.init(e,s)}}),s}}function RK(t,e,r){for(let n in t){let i=t[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=RK(i,e,{})),r[n]=i}return r}class gn{constructor(e){this.spec=e,this.props={},e.props&&RK(e.props,this,this.props),this.key=e.key?e.key.key:IK("plugin")}getState(e){return e[this.key]}}const oN=Object.create(null);function IK(t){return t in oN?t+"$"+ ++oN[t]:(oN[t]=0,t+"$")}class Pi{constructor(e="key"){this.key=IK(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Nn=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Ih=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let _O=null;const bo=function(t,e,r){let n=_O||(_O=document.createRange());return n.setEnd(t,r??t.nodeValue.length),n.setStart(t,e||0),n},J0e=function(){_O=null},sd=function(t,e,r,n){return r&&(w4(t,e,r,n,-1)||w4(t,e,r,n,1))},Y0e=/^(img|br|input|textarea|hr)$/i;function w4(t,e,r,n,i){for(var s;;){if(t==r&&e==n)return!0;if(e==(i<0?0:xs(t))){let a=t.parentNode;if(!a||a.nodeType!=1||My(t)||Y0e.test(t.nodeName)||t.contentEditable=="false")return!1;e=Nn(t)+(i<0?0:1),t=a}else if(t.nodeType==1){let a=t.childNodes[e+(i<0?-1:0)];if(a.nodeType==1&&a.contentEditable=="false")if(!((s=a.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else t=a,e=i<0?xs(t):0}else return!1}}function xs(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function X0e(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=xs(t)}else if(t.parentNode&&!My(t))e=Nn(t),t=t.parentNode;else return null}}function Q0e(t,e){for(;;
vendor: 4,482 bytes, line 703
703){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!My(t))e=Nn(t)+1,t=t.parentNode;else return null}}function ewe(t,e,r){for(let n=e==0,i=e==xs(t);n||i;){if(t==r)return!0;let s=Nn(t);if(t=t.parentNode,!t)return!1;n=n&&s==0,i=i&&s==xs(t)}}function My(t){let e;for(let r=t;r&&!(e=r.pmViewDesc);r=r.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const lk=function(t){return t.focusNode&&sd(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function pu(t,e){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=e,r}function twe(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function rwe(t,e,r){if(t.caretPositionFromPoint)try{let n=t.caretPositionFromPoint(e,r);if(n)return{node:n.offsetNode,offset:Math.min(xs(n.offsetNode),n.offset)}}catch{}if(t.caretRangeFromPoint){let n=t.caretRangeFromPoint(e,r);if(n)return{node:n.startContainer,offset:Math.min(xs(n.startContainer),n.startOffset)}}}const Ga=typeof navigator<"u"?navigator:null,_4=typeof document<"u"?document:null,Fc=Ga&&Ga.userAgent||"",kO=/Edge\/(\d+)/.exec(Fc),LK=/MSIE \d/.exec(Fc),SO=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Fc),Ni=!!(LK||SO||kO),cc=LK?document.documentMode:SO?+SO[1]:kO?+kO[1]:0,Es=!Ni&&/gecko\/(\d+)/i.test(Fc);Es&&+(/Firefox\/(\d+)/.exec(Fc)||[0,0])[1];const jO=!Ni&&/Chrome\/(\d+)/.exec(Fc),On=!!jO,$K=jO?+jO[1]:0,Wn=!Ni&&!!Ga&&/Apple Computer/.test(Ga.vendor),Lh=Wn&&(/Mobile\/\w+/.test(Fc)||!!Ga&&Ga.maxTouchPoints>2),ms=Lh||(Ga?/Mac/.test(Ga.platform):!1),DK=Ga?/Win/.test(Ga.platform):!1,No=/Android \d/.test(Fc),Ry=!!_4&&"webkitFontSmoothing"in _4.documentElement.style,nwe=Ry?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function iwe(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function lo(t,e){return typeof t=="number"?t:t[e]}function swe(t){let e=t.getBoundingClientRect(),r=e.width/t.offsetWidth||1,n=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*r,top:e.top,bottom:e.top+t.clientHeight*n}}function k4(t,e,r){let n=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let a=r||t.dom;a;){if(a.nodeType!=1){a=Ih(a);continue}let o=a,c=o==s.body,u=c?iwe(s):swe(o),d=0,f=0;if(e.top<u.top+lo(n,"top")?f=-(u.top-e.top+lo(i,"top")):e.bottom>u.bottom-lo(n,"bottom")&&(f=e.bottom-e.top>u.bottom-u.top?e.top+lo(i,"top")-u.top:e.bottom-u.bottom+lo(i,"bottom")),e.left<u.left+lo(n,"left")?d=-(u.left-e.left+lo(i,"left")):e.right>u.right-lo(n,"right")&&(d=e.right-u.right+lo(i,"right")),d||f)if(c)s.defaultView.scrollBy(d,f);else{let m=o.scrollLeft,y=o.scrollTop;f&&(o.scrollTop+=f),d&&(o.scrollLeft+=d);let v=o.scrollLeft-m,w=o.scrollTop-y;e={left:e.left-v,top:e.top-w,right:e.right-v,bottom:e.bottom-w}}let p=c?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(p))break;a=p=="absolute"?a.offsetParent:Ih(a)}}function awe(t){let e=t.dom.getBoundingClientRect(),r=Math.max(0,e.top),n,i;for(let s=(e.left+e.right)/2,a=r+1;a<Math.min(innerHeight,e.bottom);a+=5){let o=t.root.elementFromPoint(s,a);if(!o||o==t.dom||!t.dom.contains(o))continue;let c=o.getBoundingClientRect();if(c.top>=r-20){n=o,i=c.top;break}}return{refDOM:n,refTop:i,stack:BK(t.dom)}}function BK(t){let e=[],r=t.ownerDocument;for(let n=t;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),t!=r);n=Ih(n));return e}function owe({refDOM:t,refTop:e,stack:r}){let n=t?t.getBoundingClientRect().top:0;FK(r,n==0?0:n-e)}function FK(t,e){for(let r=0;r<t.length;r++){let{dom:n,top:i,left:s}=t[r];n.scrollTop!=i+e&&(n.scrollTop=i+e),n.scrollLeft!=s&&(n.scrollLeft=s)}}let Qd=null;function lwe(t){if(t.setActive)return t.setActive();if(Qd)return t.focus(Qd);let e=BK(t);t.focus(Qd==null?{get preventScroll(){return Qd={preventScroll:!0},!0}}:void 0),Qd||(Qd=!1,FK(e,0))}function zK(t,e){let r,n=2e8,i,s=0,a=e.top,o=e.top,c,u;for(let d=t.firstChild,f=0;d;d=d.nextSibling,f++){let p;if(d.nodeType==1)p=d.getClientRects();else if(d.nodeType==3)p=bo(d).getClientRects();else continue;for(let m=0;m<p.length;m++){let y=p[m];if(y.top<=a&&y.bottom>=o){a=Math.max(y.bottom,a),o=Math.min(y.top,o);let v=y.left>e.left?y.left-e.left:y.right<e.left?e.left-y.right:0;
vendor: 14,290 bytes, lines 703-704
703if(v<n){r=d,n=v,i=v&&r.nodeType==3?{left:y.right<e.left?y.right:y.left,top:e.top}:e,d.nodeType==1&&v&&(s=f+(e.left>=(y.left+y.right)/2?1:0));continue}}else y.top>e.top&&!c&&y.left<=e.left&&y.right>=e.left&&(c=d,u={left:Math.max(y.left,Math.min(y.right,e.left)),top:y.top});!r&&(e.left>=y.right&&e.top>=y.top||e.left>=y.left&&e.top>=y.bottom)&&(s=f+1)}}return!r&&c&&(r=c,i=u,n=0),r&&r.nodeType==3?cwe(r,i):!r||n&&r.nodeType==1?{node:t,offset:s}:zK(r,i)}function cwe(t,e){let r=t.nodeValue.length,n=document.createRange(),i;for(let s=0;s<r;s++){n.setEnd(t,s+1),n.setStart(t,s);let a=xl(n,1);if(a.top!=a.bottom&&q2(e,a)){i={node:t,offset:s+(e.left>=(a.left+a.right)/2?1:0)};break}}return n.detach(),i||{node:t,offset:0}}function q2(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function uwe(t,e){let r=t.parentNode;return r&&/^li$/i.test(r.nodeName)&&e.left<t.getBoundingClientRect().left?r:t}function dwe(t,e,r){let{node:n,offset:i}=zK(e,r),s=-1;if(n.nodeType==1&&!n.firstChild){let a=n.getBoundingClientRect();s=a.left!=a.right&&r.left>(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(n,i,s)}function fwe(t,e,r,n){let i=-1;for(let s=e,a=!1;s!=t.dom;){let o=t.docView.nearestDesc(s,!0),c;if(!o)return null;if(o.dom.nodeType==1&&(o.node.isBlock&&o.parent||!o.contentDOM)&&((c=o.dom.getBoundingClientRect()).width||c.height)&&(o.node.isBlock&&o.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(o.dom.nodeName)&&(!a&&c.left>n.left||c.top>n.top?i=o.posBefore:(!a&&c.right<n.left||c.bottom<n.top)&&(i=o.posAfter),a=!0),!o.contentDOM&&i<0&&!o.node.isText))return(o.node.isBlock?n.top<(c.top+c.bottom)/2:n.left<(c.left+c.right)/2)?o.posBefore:o.posAfter;s=o.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,r,-1)}function UK(t,e,r){let n=t.childNodes.length;if(n&&r.top<r.bottom)for(let i=Math.max(0,Math.min(n-1,Math.floor(n*(e.top-r.top)/(r.bottom-r.top))-2)),s=i;;){let a=t.childNodes[s];if(a.nodeType==1){let o=a.getClientRects();for(let c=0;c<o.length;c++){let u=o[c];if(q2(e,u))return UK(a,e,u)}}if((s=(s+1)%n)==i)break}return t}function hwe(t,e){let r=t.dom.ownerDocument,n,i=0,s=rwe(r,e.left,e.top);s&&({node:n,offset:i}=s);let a=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top),o;if(!a||!t.dom.contains(a.nodeType!=1?a.parentNode:a)){let u=t.dom.getBoundingClientRect();if(!q2(e,u)||(a=UK(t.dom,e,u),!a))return null}if(Wn)for(let u=a;n&&u;u=Ih(u))u.draggable&&(n=void 0);if(a=uwe(a,e),n){if(Es&&n.nodeType==1&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let d=n.childNodes[i],f;d.nodeName=="IMG"&&(f=d.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let u;Ry&&i&&n.nodeType==1&&(u=n.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,n==t.dom&&i==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?o=t.state.doc.content.size:(i==0||n.nodeType!=1||n.childNodes[i-1].nodeName!="BR")&&(o=fwe(t,n,i,e))}o==null&&(o=dwe(t,a,e));let c=t.docView.nearestDesc(a,!0);return{pos:o,inside:c?c.posAtStart-c.border:-1}}function S4(t){return t.top<t.bottom||t.left<t.right}function xl(t,e){let r=t.getClientRects();if(r.length){let n=r[e<0?0:r.length-1];if(S4(n))return n}return Array.prototype.find.call(r,S4)||t.getBoundingClientRect()}const pwe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function HK(t,e,r){let{node:n,offset:i,atom:s}=t.docView.domFromPos(e,r<0?-1:1),a=Ry||Es;if(n.nodeType==3)if(a&&(pwe.test(n.nodeValue)||(r<0?!i:i==n.nodeValue.length))){let c=xl(bo(n,i,i),r);if(Es&&i&&/\s/.test(n.nodeValue[i-1])&&i<n.nodeValue.length){let u=xl(bo(n,i-1,i-1),-1);if(u.top==c.top){let d=xl(bo(n,i,i+1),-1);if(d.top!=c.top)return xm(d,d.left<u.left)}}return c}else{let c=i,u=i,d=r<0?1:-1;return r<0&&!i?(u++,d=-1):r>=0&&i==n.nodeValue.length?(c--,d=1):r<0?c--:u++,xm(xl(bo(n,c,u),d),d<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(r<0||i==xs(n))){let c=n.childNodes[i-1];if(c.nodeType==1)return lN(c.getBoundingClientRect(),!1)}if(s==null&&i<xs(n)){let c=n.childNodes[i];if(c.nodeType==1)return lN(c.getBoundingClientRect(),!0)}return lN(n.getBoundingClientRect(),r>=0)}if(s==null&&i&&(r<0||i==xs(n))){let c=n.childNodes[i-1],u=c.nodeType==3?bo(c,xs(c)-(a?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(u)return xm(xl(u,1),!1)}if(s==null&&i<xs(n)){let c=n.childNodes[i];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let u=c?c.nodeType==3?bo(c,0,a?0:1):c.nodeType==1?c:null:null;if(u)return xm(xl(u,-1),!0)}return xm(xl(n.nodeType==3?bo(n):n,-r),r>=0)}function xm(t,e){if(t.width==0)return t;let r=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:r,right:r}}function lN(t,e){if(t.height==0)return t;let r=e?t.top:t.bottom;return{top:r,bottom:r,left:t.left,right:t.right}}function VK(t,e,r){let n=t.state,i=t.root.activeElement;n!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return r()}finally{n!=e&&t.updateState(n),i!=t.dom&&i&&i.focus()}}function mwe(t,e,r){let n=e.selection,i=r=="up"?n.$from:n.$to;return VK(t,e,()=>{let{node:s}=t.docView.domFromPos(i.pos,r=="up"?-1:1);for(;;){let o=t.docView.nearestDesc(s,!0);if(!o)break;if(o.node.isBlock){s=o.contentDOM||o.dom;break}s=o.dom.parentNode}let a=HK(t,i.pos,1);for(let o=s.firstChild;o;o=o.nextSibling){let c;if(o.nodeType==1)c=o.getClientRects();else if(o.nodeType==3)c=bo(o,0,o.nodeValue.length).getClientRects();else continue;for(let u=0;u<c.length;u++){let d=c[u];if(d.bottom>d.top+1&&(r=="up"?a.top-d.top>(d.bottom-a.top)*2:d.bottom-a.bottom>(a.bottom-d.top)*2))return!1}}return!0})}const gwe=/[\u0590-\u08ac]/;function vwe(t,e,r){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let i=n.parentOffset,s=!i,a=i==n.parent.content.size,o=t.domSelection();return o?!gwe.test(n.parent.textContent)||!o.modify?r=="left"||r=="backward"?s:a:VK(t,e,()=>{let{focusNode:c,focusOffset:u,anchorNode:d,anchorOffset:f}=t.domSelectionRange(),p=o.caretBidiLevel;o.modify("move",r,"character");let m=n.depth?t.docView.domAfterPos(n.before()):t.dom,{focusNode:y,focusOffset:v}=t.domSelectionRange(),w=y&&!m.contains(y.nodeType==1?y:y.parentNode)||c==y&&u==v;try{o.collapse(d,f),c&&(c!=d||u!=f)&&o.extend&&o.extend(c,u)}catch{}return p!=null&&(o.caretBidiLevel=p),w}):n.pos==n.start()||n.pos==n.end()}let j4=null,N4=null,C4=!1;function ywe(t,e,r){return j4==e&&N4==r?C4:(j4=e,N4=r,C4=r=="up"||r=="down"?mwe(t,e,r):vwe(t,e,r))}const Os=0,E4=1,wu=2,Za=3;class Iy{constructor(e,r,n,i){this.parent=e,this.children=r,this.dom=n,this.contentDOM=i,this.dirty=Os,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,r,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let r=0;r<this.children.length;r++)e+=this.children[r].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let r=0,n=this.posAtStart;;r++){let i=this.children[r];if(i==e)return n;n+=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(e,r,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let s,a;if(e==this.contentDOM)s=e.childNodes[r-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.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(e==this.contentDOM)s=e.childNodes[r];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((a=s.pmViewDesc)&&a.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(a):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=r>Nn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(r==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&r==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,r=!1){for(let n=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),a;if(s&&(!r||s.node))if(n&&(a=s.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return s}}getDesc(e){let r=e.pmViewDesc;for(let n=r;n;n=n.parent)if(n==this)return r}posFromDOM(e,r,n){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,r,n)}return-1}descAt(e){for(let r=0,n=0;r<this.children.length;r++){let i=this.children[r],s=n+i.size;if(n==e&&s!=n){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(e<s)return i.descAt(e-n-i.border);n=s}}domFromPos(e,r){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,i=0;for(let s=0;n<this.children.length;n++){let a=this.children[n],o=s+a.size;if(o>e||a instanceof qK){i=e-s;break}s=o}if(i)return this.children[n].domFromPos(i-this.children[n].border,r);for(let s;n&&!(s=this.children[n-1]).size&&s instanceof WK&&s.side>=0;n--);if(r<=0){let s,a=!0;for(;s=n?this.children[n-1]:null,!(!s||s.dom.parentNode==this.contentDOM);n--,a=!1);return s&&r&&a&&!s.border&&!s.domAtom?s.domFromPos(s.size,r):{node:this.contentDOM,offset:s?Nn(s.dom)+1:0}}else{let s,a=!0;for(;s=n<this.children.length?this.children[n]:null,!(!s||s.dom.parentNode==this.contentDOM);n++,a=!1);return s&&a&&!s.border&&!s.domAtom?s.domFromPos(0,r):{node:this.contentDOM,offset:s?Nn(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,r,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:r,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let a=n,o=0;;o++){let c=this.children[o],u=a+c.size;if(i==-1&&e<=u){let d=a+c.border;if(e>=d&&r<=u-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,r,d);e=a;for(let f=o;f>0;f--){let p=this.children[f-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){i=Nn(p.dom)+1;break}e-=p.size}i==-1&&(i=0)}if(i>-1&&(u>r||o==this.children.length-1)){r=u;for(let d=o+1;d<this.children.length;d++){let f=this.children[d];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){s=Nn(f.dom);break}r+=f.size}s==-1&&(s=this.contentDOM.childNodes.length);break}a=u}return{node:this.contentDOM,from:e,to:r,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let r=this.children[e<0?0:this.children.length-1];return r.size==0||r.emptyChildAt(e)}domAfterPos(e){let{node:r,offset:n}=this.domFromPos(e,0);if(r.nodeType!=1||n==r.childNodes.length)throw new RangeError("No node after pos "+e);return r.childNodes[n]}setSelection(e,r,n,i=!1){let s=Math.min(e,r),a=Math.max(e,r);for(let m=0,y=0;m<this.children.length;m++){let v=this.children[m],w=y+v.size;if(s>y&&a<w)return v.setSelection(e-y-v.border,r-y-v.border,n,i);y=w}let o=this.domFromPos(e,e?-1:1),c=r==e?o:this.domFromPos(r,r?-1:1),u=n.root.getSelection(),d=n.domSelectionRange(),f=!1;if((Es||Wn)&&e==r){let{node:m,offset:y}=o;if(m.nodeType==3){if(f=!!(y&&m.nodeValue[y-1]==`
704`),f&&y==m.nodeValue.length)for(let v=m,w;v;v=v.parentNode){if(w=v.nextSibling){w.nodeName=="BR"&&(o=c={node:w.parentNode,offset:Nn(w)+1});break}let b=v.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let v=m.childNodes[y-1];f=v&&(v.nodeName=="BR"||v.contentEditable=="false")}}if(Es&&d.focusNode&&d.focusNode!=c.node&&d.focusNode.nodeType==1){let m=d.focusNode.childNodes[d.focusOffset];m&&m.contentEditable=="false"&&(i=!0)}if(!(i||f&&Wn)&&sd(o.node,o.offset,d.anchorNode,d.anchorOffset)&&sd(c.node,c.offset,d.focusNode,d.focusOffset))return;let p=!1;if((u.extend||e==r)&&!(f&&Es)){u.collapse(o.node,o.offset);try{e!=r&&u.extend(c.node,c.offset),p=!0}catch{}}if(!p){if(e>r){let y=o;o=c,c=y}let m=document.createRange();m.setEnd(c.node,c.offset),m.setStart(o.node,o.offset),u.removeAllRanges(),u.addRange(m)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,r){for(let n=0,i=0;i<this.children.length;i++){let s=this.children[i],a=n+s.size;if(n==a?e<=a&&r>=n:e<a&&r>n){let o=n+s.border,c=a-s.border;if(e>=o&&r<=c){this.dirty=e==n||r==a?wu:E4,e==o&&r==c&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Za:s.markDirty(e-o,r-o);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?wu:Za}n=a}this.dirty=wu}markParentsDirty(){let e=1;for(let r=this.parent;r;r=r.parent,e++){let n=e==1?wu:E4;r.dirty<n&&(r.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class WK extends Iy{constructor(e,r,n,i){let s,a=r.type.toDOM;if(typeof a=="function"&&(a=a(n,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!r.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(e,[],a,null),this.widget=r,this.widget=r,s=this}matchesWidget(e){return this.dirty==Os&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let r=this.widget.spec.stopEvent;return r?r(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class xwe extends Iy{constructor(e,r,n,i){super(e,[],r,null),this.textDOM=n,this.text=i}get size(){return this.text.length}localPosFromDOM(e,r){return e!=this.textDOM?this.posAtStart+(r?this.size:0):this.posAtStart+r}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class ad extends Iy{constructor(e,r,n,i,s){super(e,[],n,i),this.mark=r,this.spec=s}
vendor: 7,466 bytes, line 704
704static create(e,r,n,i){let s=i.nodeViews[r.type.name],a=s&&s(r,i,n);return(!a||!a.dom)&&(a=kd.renderSpec(document,r.type.spec.toDOM(r,n),null,r.attrs)),new ad(e,r,a.dom,a.contentDOM||a.dom,a)}parseRule(){return this.dirty&Za||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Za&&this.mark.eq(e)}markDirty(e,r){if(super.markDirty(e,r),this.dirty!=Os){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty<this.dirty&&(n.dirty=this.dirty),this.dirty=Os}}slice(e,r,n){let i=ad.create(this.parent,this.mark,!0,n),s=this.children,a=this.size;r<a&&(s=CO(s,r,a,n)),e>0&&(s=CO(s,0,e,n));for(let o=0;o<s.length;o++)s[o].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class uc extends Iy{constructor(e,r,n,i,s,a,o,c,u){super(e,[],s,a),this.node=r,this.outerDeco=n,this.innerDeco=i,this.nodeDOM=o}static create(e,r,n,i,s,a){let o=s.nodeViews[r.type.name],c,u=o&&o(r,s,()=>{if(!c)return a;if(c.parent)return c.parent.posBeforeChild(c)},n,i),d=u&&u.dom,f=u&&u.contentDOM;if(r.isText){if(!d)d=document.createTextNode(r.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:f}=kd.renderSpec(document,r.type.spec.toDOM(r),null,r.attrs));!f&&!r.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),r.type.spec.draggable&&(d.draggable=!0));let p=d;return d=ZK(d,n,r),u?c=new bwe(e,r,n,i,d,f||null,p,u,s,a+1):r.isText?new ck(e,r,n,i,d,p,s):new uc(e,r,n,i,d,f||null,p,s,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let n=this.children[r];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>me.empty)}return e}matchesNode(e,r,n){return this.dirty==Os&&e.eq(this.node)&&cw(r,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,r){let n=this.node.inlineContent,i=r,s=e.composing?this.localCompositionInfo(e,r):null,a=s&&s.pos>-1?s:null,o=s&&s.pos<0,c=new _we(this,a&&a.node,e);jwe(this.node,this.innerDeco,(u,d,f)=>{u.spec.marks?c.syncToMarks(u.spec.marks,n,e,d):u.type.side>=0&&!f&&c.syncToMarks(d==this.node.childCount?Wt.none:this.node.child(d).marks,n,e,d),c.placeWidget(u,e,i)},(u,d,f,p)=>{c.syncToMarks(u.marks,n,e,p);let m;c.findNodeMatch(u,d,f,p)||o&&e.state.selection.from>i&&e.state.selection.to<i+u.nodeSize&&(m=c.findIndexWithChild(s.node))>-1&&c.updateNodeAt(u,d,f,m,e)||c.updateNextNode(u,d,f,e,p,i)||c.addNode(u,d,f,e,i),i+=u.nodeSize}),c.syncToMarks([],n,e,0),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==wu)&&(a&&this.protectLocalComposition(e,a),KK(this.contentDOM,this.children,e),Lh&&Nwe(this.dom))}localCompositionInfo(e,r){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof Qe)||n<r||i>r+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,o=Cwe(this.node.content,a,n-r,i-r);return o<0?null:{node:s,pos:o,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:r,pos:n,text:i}){if(this.getDesc(r))return;let s=r;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 xwe(this,s,r,i);e.input.compositionNodes.push(a),this.children=CO(this.children,n,n+i.length,e,a)}update(e,r,n,i){return this.dirty==Za||!e.sameMarkup(this.node)?!1:(this.updateInner(e,r,n,i),!0)}updateInner(e,r,n,i){this.updateOuterDeco(r),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Os}updateOuterDeco(e){if(cw(e,this.outerDeco))return;let r=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=GK(this.dom,this.nodeDOM,NO(this.outerDeco,this.node,r),NO(e,this.node,r)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function O4(t,e,r,n,i){ZK(n,e,t);let s=new uc(void 0,t,e,r,n,n,n,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class ck extends uc{constructor(e,r,n,i,s,a,o){super(e,r,n,i,s,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,r,n,i){return this.dirty==Za||this.dirty!=Os&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(r),(this.dirty!=Os||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Os,!0)}inParent(){let e=this.parent.contentDOM;for(let r=this.nodeDOM;r;r=r.parentNode)if(r==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,r,n){return e==this.nodeDOM?this.posAtStart+Math.min(r,this.node.text.length):super.localPosFromDOM(e,r,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,r,n){let i=this.node.cut(e,r),s=document.createTextNode(i.text);return new ck(this.parent,i,this.outerDeco,this.innerDeco,s,s,n)}markDirty(e,r){super.markDirty(e,r),this.dom!=this.nodeDOM&&(e==0||r==this.nodeDOM.nodeValue.length)&&(this.dirty=Za)}get domAtom(){return!1}isText(e){return this.node.text==e}}class qK extends Iy{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Os&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class bwe extends uc{constructor(e,r,n,i,s,a,o,c,u,d){super(e,r,n,i,s,a,o,u,d),this.spec=c}update(e,r,n,i){if(this.dirty==Za)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,r,n);return s&&this.updateInner(e,r,n,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,r,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,r,n,i){this.spec.setSelection?this.spec.setSelection(e,r,n.root):super.setSelection(e,r,n,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function KK(t,e,r){let n=t.firstChild,i=!1;for(let s=0;s<e.length;s++){let a=e[s],o=a.dom;if(o.parentNode==t){for(;o!=n;)n=T4(n),i=!0;n=n.nextSibling}else i=!0,t.insertBefore(o,n);if(a instanceof ad){let c=n?n.previousSibling:t.lastChild;
vendor: 4,156 bytes, line 704
704KK(a.contentDOM,a.children,r),n=c?c.nextSibling:t.firstChild}}for(;n;)n=T4(n),i=!0;i&&r.trackWrites==t&&(r.trackWrites=null)}const ug=function(t){t&&(this.nodeName=t)};ug.prototype=Object.create(null);const _u=[new ug];function NO(t,e,r){if(t.length==0)return _u;let n=r?_u[0]:new ug,i=[n];for(let s=0;s<t.length;s++){let a=t[s].type.attrs;if(a){a.nodeName&&i.push(n=new ug(a.nodeName));for(let o in a){let c=a[o];c!=null&&(r&&i.length==1&&i.push(n=new ug(e.isInline?"span":"div")),o=="class"?n.class=(n.class?n.class+" ":"")+c:o=="style"?n.style=(n.style?n.style+";":"")+c:o!="nodeName"&&(n[o]=c))}}}return i}function GK(t,e,r,n){if(r==_u&&n==_u)return e;let i=e;for(let s=0;s<n.length;s++){let a=n[s],o=r[s];if(s){let c;o&&o.nodeName==a.nodeName&&i!=t&&(c=i.parentNode)&&c.nodeName.toLowerCase()==a.nodeName||(c=document.createElement(a.nodeName),c.pmIsDeco=!0,c.appendChild(i),o=_u[0]),i=c}wwe(i,o||_u[0],a)}return i}function wwe(t,e,r){for(let n in e)n!="class"&&n!="style"&&n!="nodeName"&&!(n in r)&&t.removeAttribute(n);for(let n in r)n!="class"&&n!="style"&&n!="nodeName"&&r[n]!=e[n]&&t.setAttribute(n,r[n]);if(e.class!=r.class){let n=e.class?e.class.split(" ").filter(Boolean):[],i=r.class?r.class.split(" ").filter(Boolean):[];for(let s=0;s<n.length;s++)i.indexOf(n[s])==-1&&t.classList.remove(n[s]);for(let s=0;s<i.length;s++)n.indexOf(i[s])==-1&&t.classList.add(i[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=r.style){if(e.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=n.exec(e.style);)t.style.removeProperty(i[1])}r.style&&(t.style.cssText+=r.style)}}function ZK(t,e,r){return GK(t,t,_u,NO(e,r,t.nodeType!=1))}function cw(t,e){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].type.eq(e[r].type))return!1;return!0}function T4(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class _we{constructor(e,r,n){this.lock=r,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=kwe(e.node.content,e)}destroyBetween(e,r){if(e!=r){for(let n=e;n<r;n++)this.top.children[n].destroy();this.top.children.splice(e,r-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,r,n,i){let s=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;s<o&&(s==a-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<a;)this.destroyRest(),this.top.dirty=Os,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let c=-1,u=this.top.children.length;i<this.preMatch.index&&(u=Math.min(this.index+3,u));for(let d=this.index;d<u;d++){let f=this.top.children[d];if(f.matchesMark(e[a])&&!this.isLocked(f.dom)){c=d;break}}if(c>-1)c>this.index&&(this.changed=!0,this.destroyBetween(this.index,c)),this.top=this.top.children[this.index];else{let d=ad.create(this.top,e[a],r,n);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,a++}}findNodeMatch(e,r,n,i){let s=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(e,r,n))s=this.top.children.indexOf(a,this.index);else for(let o=this.index,c=Math.min(this.top.children.length,o+5);o<c;o++){let u=this.top.children[o];if(u.matchesNode(e,r,n)&&!this.preMatch.matched.has(u)){s=o;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,r,n,i,s){let a=this.top.children[i];return a.dirty==Za&&a.dom==a.contentDOM&&(a.dirty=wu),a.update(e,r,n,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let r=e.parentNode;if(!r)return-1;if(r==this.top.contentDOM){let n=e.pmViewDesc;if(n){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==n)return i}return-1}e=r}}updateNextNode(e,r,n,i,s,a){for(let o=this.index;o<this.top.children.length;o++){let c=this.top.children[o];if(c instanceof uc){let u=this.preMatch.matched.get(c);if(u!=null&&u!=s)return!1;let d=c.dom,f,p=this.isLocked(d)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=Za&&cw(r,c.outerDeco));
vendor: 12,723 bytes, line 704
704if(!p&&c.update(e,r,n,i))return this.destroyBetween(this.index,o),c.dom!=d&&(this.changed=!0),this.index++,!0;if(!p&&(f=this.recreateWrapper(c,e,r,n,i,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=wu,f.updateChildren(i,a+1),f.dirty=Os),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,r,n,i,s,a){if(e.dirty||r.isAtom||!e.children.length||!e.node.content.eq(r.content)||!cw(n,e.outerDeco)||!i.eq(e.innerDeco))return null;let o=uc.create(this.top,r,n,i,s,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let c of o.children)c.parent=o}return e.destroy(),o}addNode(e,r,n,i,s){let a=uc.create(this.top,e,r,n,i,s);a.contentDOM&&a.updateChildren(i,s+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,r,n){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new WK(this.top,e,r,n);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],r=this.top;for(;e instanceof ad;)r=e,e=r.children[r.children.length-1];(!e||!(e instanceof ck)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Wn||On)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",r),this.addHackNode("BR",this.top))}addHackNode(e,r){if(r==this.top&&this.index<r.children.length&&r.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e=="IMG"&&(n.className="ProseMirror-separator",n.alt=""),e=="BR"&&(n.className="ProseMirror-trailingBreak");let i=new qK(this.top,[],n,null);r!=this.top?r.children.push(i):r.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function kwe(t,e){let r=e,n=r.children.length,i=t.childCount,s=new Map,a=[];e:for(;i>0;){let o;for(;;)if(n){let u=r.children[n-1];if(u instanceof ad)r=u,n=u.children.length;else{o=u,n--;break}}else{if(r==e)break e;n=r.parent.children.indexOf(r),r=r.parent}let c=o.node;if(c){if(c!=t.child(i-1))break;--i,s.set(o,i),a.push(o)}}return{index:i,matched:s,matches:a.reverse()}}function Swe(t,e){return t.type.side-e.type.side}function jwe(t,e,r,n){let i=e.locals(t),s=0;if(i.length==0){for(let u=0;u<t.childCount;u++){let d=t.child(u);n(d,i,e.forChild(s,d),u),s+=d.nodeSize}return}let a=0,o=[],c=null;for(let u=0;;){let d,f;for(;a<i.length&&i[a].to==s;){let w=i[a++];w.widget&&(d?(f||(f=[d])).push(w):d=w)}if(d)if(f){f.sort(Swe);for(let w=0;w<f.length;w++)r(f[w],u,!!c)}else r(d,u,!!c);let p,m;if(c)m=-1,p=c,c=null;else if(u<t.childCount)m=u,p=t.child(u++);else break;for(let w=0;w<o.length;w++)o[w].to<=s&&o.splice(w--,1);for(;a<i.length&&i[a].from<=s&&i[a].to>s;)o.push(i[a++]);let y=s+p.nodeSize;if(p.isText){let w=y;a<i.length&&i[a].from<w&&(w=i[a].from);for(let b=0;b<o.length;b++)o[b].to<w&&(w=o[b].to);w<y&&(c=p.cut(w-s),p=p.cut(0,w-s),y=w,m=-1)}else for(;a<i.length&&i[a].to<y;)a++;let v=p.isInline&&!p.isLeaf?o.filter(w=>!w.inline):o.slice();n(p,v,e.forChild(s,p),m),s=y}}function Nwe(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function Cwe(t,e,r,n){for(let i=0,s=0;i<t.childCount&&s<=n;){let a=t.child(i++),o=s;if(s+=a.nodeSize,!a.isText)continue;let c=a.text;for(;i<t.childCount;){let u=t.child(i++);if(s+=u.nodeSize,!u.isText)break;c+=u.text}if(s>=r){if(s>=n&&c.slice(n-e.length-o,n-o)==e)return n-e.length;let u=o<n?c.lastIndexOf(e,n-o-1):-1;if(u>=0&&u+e.length+o>=r)return o+u;if(r==n&&c.length>=n+e.length-o&&c.slice(n-o,n-o+e.length)==e)return n}}return-1}function CO(t,e,r,n,i){let s=[];for(let a=0,o=0;a<t.length;a++){let c=t[a],u=o,d=o+=c.size;u>=r||d<=e?s.push(c):(u<e&&s.push(c.slice(0,e-u,n)),i&&(s.push(i),i=void 0),d>r&&s.push(c.slice(r-u,c.size,n)))}return s}function K2(t,e=null){let r=t.domSelectionRange(),n=t.state.doc;if(!r.focusNode)return null;let i=t.docView.nearestDesc(r.focusNode),s=i&&i.size==0,a=t.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(a<0)return null;let o=n.resolve(a),c,u;if(lk(r)){for(c=a;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&Ue.isSelectable(f)&&i.parent&&!(f.isInline&&ewe(r.focusNode,r.focusOffset,i.dom))){let p=i.posBefore;u=new Ue(a==p?o:n.resolve(p))}}else{if(r instanceof t.dom.ownerDocument.defaultView.Selection&&r.rangeCount>1){let f=a,p=a;for(let m=0;m<r.rangeCount;m++){let y=r.getRangeAt(m);f=Math.min(f,t.docView.posFromDOM(y.startContainer,y.startOffset,1)),p=Math.max(p,t.docView.posFromDOM(y.endContainer,y.endOffset,-1))}if(f<0)return null;[c,a]=p==t.state.selection.anchor?[p,f]:[f,p],o=n.resolve(a)}else c=t.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(c<0)return null}let d=n.resolve(c);if(!u){let f=e=="pointer"||t.state.selection.head<o.pos&&!s?1:-1;u=G2(t,d,o,f)}return u}function JK(t){return t.editable?t.hasFocus():XK(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Po(t,e=!1){let r=t.state.selection;if(YK(t,r),!!JK(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&On){let n=t.domSelectionRange(),i=t.domObserver.currentSelection;if(n.anchorNode&&i.anchorNode&&sd(n.anchorNode,n.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)Owe(t);else{let{anchor:n,head:i}=r,s,a;A4&&!(r instanceof Qe)&&(r.$from.parent.inlineContent||(s=P4(t,r.from)),!r.empty&&!r.$from.parent.inlineContent&&(a=P4(t,r.to))),t.docView.setSelection(n,i,t,e),A4&&(s&&M4(s),a&&M4(a)),r.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Ewe(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const A4=Wn||On&&$K<63;function P4(t,e){let{node:r,offset:n}=t.docView.domFromPos(e,0),i=n<r.childNodes.length?r.childNodes[n]:null,s=n?r.childNodes[n-1]:null;if(Wn&&i&&i.contentEditable=="false")return cN(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return cN(i);if(s)return cN(s)}}function cN(t){return t.contentEditable="true",Wn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function M4(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Ewe(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let r=t.domSelectionRange(),n=r.anchorNode,i=r.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(r.anchorNode!=n||r.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!JK(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function Owe(t){let e=t.domSelection();if(!e)return;let r=t.cursorWrapper.dom,n=r.nodeName=="IMG";n?e.collapse(r.parentNode,Nn(r)+1):e.collapse(r,0),!n&&!t.state.selection.visible&&Ni&&cc<=11&&(r.disabled=!0,r.disabled=!1)}function YK(t,e){if(e instanceof Ue){let r=t.docView.descAt(e.from);r!=t.lastSelectedViewDesc&&(R4(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else R4(t)}function R4(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function G2(t,e,r,n){return t.someProp("createSelectionBetween",i=>i(t,e,r))||Qe.between(e,r,n)}function I4(t){return t.editable&&!t.hasFocus()?!1:XK(t)}function XK(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Twe(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),r=t.domSelectionRange();return sd(e.node,e.offset,r.anchorNode,r.anchorOffset)}function EO(t,e){let{$anchor:r,$head:n}=t.selection,i=e>0?r.max(n):r.min(n),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&dt.findFrom(s,e)}function kl(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function L4(t,e,r){let n=t.state.selection;if(n instanceof Qe)if(r.indexOf("s")>-1){let{$head:i}=n,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let a=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return kl(t,new Qe(n.$anchor,a))}else if(n.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=EO(t.state,e);return i&&i instanceof Ue?kl(t,i):!1}else if(!(ms&&r.indexOf("m")>-1)){let i=n.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,a;if(!s||s.isText)return!1;let o=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(a=t.docView.descAt(o))&&!a.contentDOM?Ue.isSelectable(s)?kl(t,new Ue(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):Ry?kl(t,new Qe(t.state.doc.resolve(e<0?o:o+s.nodeSize))):!1:!1}}else return!1;else{if(n instanceof Ue&&n.node.isInline)return kl(t,new Qe(e>0?n.$to:n.$from));{let i=EO(t.state,e);return i?kl(t,i):!1}}}function uw(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function dg(t,e){let r=t.pmViewDesc;return r&&r.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function ef(t,e){return e<0?Awe(t):Pwe(t)}function Awe(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let i,s,a=!1;for(Es&&r.nodeType==1&&n<uw(r)&&dg(r.childNodes[n],-1)&&(a=!0);;)if(n>0){if(r.nodeType!=1)break;{let o=r.childNodes[n-1];if(dg(o,-1))i=r,s=--n;else if(o.nodeType==3)r=o,n=r.nodeValue.length;else break}}else{if(QK(r))break;{let o=r.previousSibling;for(;o&&dg(o,-1);)i=r.parentNode,s=Nn(o),o=o.previousSibling;if(o)r=o,n=uw(r);else{if(r=r.parentNode,r==t.dom)break;n=0}}}a?OO(t,r,n):i&&OO(t,i,s)}function Pwe(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let i=uw(r),s,a;for(;;)if(n<i){if(r.nodeType!=1)break;let o=r.childNodes[n];if(dg(o,1))s=r,a=++n;else break}else{if(QK(r))break;{let o=r.nextSibling;for(;o&&dg(o,1);)s=o.parentNode,a=Nn(o)+1,o=o.nextSibling;if(o)r=o,n=0,i=uw(r);else{if(r=r.parentNode,r==t.dom)break;n=i=0}}}s&&OO(t,s,a)}function QK(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Mwe(t,e){for(;t&&e==t.childNodes.length&&!My(t);)e=Nn(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let r=t.childNodes[e];if(r.nodeType==3)return r;if(r.nodeType==1&&r.contentEditable=="false")break;t=r,e=0}}function Rwe(t,e){for(;t&&!e&&!My(t);)e=Nn(t),t=t.parentNode;for(;t&&e;){let r=t.childNodes[e-1];if(r.nodeType==3)return r;if(r.nodeType==1&&r.contentEditable=="false")break;t=r,e=t.childNodes.length}}function OO(t,e,r){if(e.nodeType!=3){let s,a;(a=Mwe(e,r))?(e=a,r=0):(s=Rwe(e,r))&&(e=s,r=s.nodeValue.length)}let n=t.domSelection();if(!n)return;if(lk(n)){let s=document.createRange();s.setEnd(e,r),s.setStart(e,r),n.removeAllRanges(),n.addRange(s)}else n.extend&&n.extend(e,r);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&Po(t)},50)}function $4(t,e){let r=t.state.doc.resolve(e);if(!(On||DK)&&r.parent.inlineContent){let i=t.coordsAtPos(e);if(e>r.start()){let s=t.coordsAtPos(e-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(e<r.end()){let s=t.coordsAtPos(e+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(t.dom).direction=="rtl"?"rtl":"ltr"}function D4(t,e,r){let n=t.state.selection;if(n instanceof Qe&&!n.empty||r.indexOf("s")>-1||ms&&r.indexOf("m")>-1)return!1;let{$from:i,$to:s}=n;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let a=EO(t.state,e);if(a&&a instanceof Ue)return kl(t,a)}if(!i.parent.inlineContent){let a=e<0?i:s,o=n instanceof Cs?dt.near(a,e):dt.findFrom(a,e);return o?kl(t,o):!1}return!1}function B4(t,e){if(!(t.state.selection instanceof Qe))return!0;let{$head:r,$anchor:n,empty:i}=t.state.selection;if(!r.sameParent(n))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(s&&!s.isText){let a=t.state.tr;return e<0?a.delete(r.pos-s.nodeSize,r.pos):a.delete(r.pos,r.pos+s.nodeSize),t.dispatch(a),!0}return!1}function F4(t,e,r){t.domObserver.stop(),e.contentEditable=r,t.domObserver.start()}function Iwe(t){if(!Wn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:r}=t.domSelectionRange();if(e&&e.nodeType==1&&r==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;F4(t,n,"true"),setTimeout(()=>F4(t,n,"false"),20)}return!1}function Lwe(t){let e="";
vendor: 4,166 bytes, lines 704-707
704return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function $we(t,e){let r=e.keyCode,n=Lwe(e);if(r==8||ms&&r==72&&n=="c")return B4(t,-1)||ef(t,-1);if(r==46&&!e.shiftKey||ms&&r==68&&n=="c")return B4(t,1)||ef(t,1);if(r==13||r==27)return!0;if(r==37||ms&&r==66&&n=="c"){let i=r==37?$4(t,t.state.selection.from)=="ltr"?-1:1:-1;return L4(t,i,n)||ef(t,i)}else if(r==39||ms&&r==70&&n=="c"){let i=r==39?$4(t,t.state.selection.from)=="ltr"?1:-1:1;return L4(t,i,n)||ef(t,i)}else{if(r==38||ms&&r==80&&n=="c")return D4(t,-1,n)||ef(t,-1);if(r==40||ms&&r==78&&n=="c")return Iwe(t)||D4(t,1,n)||ef(t,1);if(n==(ms?"m":"c")&&(r==66||r==73||r==89||r==90))return!0}return!1}function Z2(t,e){t.someProp("transformCopied",m=>{e=m(e,t)});let r=[],{content:n,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&n.childCount==1&&n.firstChild.childCount==1;){i--,s--;let m=n.firstChild;r.push(m.type.name,m.attrs!=m.type.defaultAttrs?m.attrs:null),n=m.content}let a=t.someProp("clipboardSerializer")||kd.fromSchema(t.state.schema),o=sG(),c=o.createElement("div");c.appendChild(a.serializeFragment(n,{document:o}));let u=c.firstChild,d,f=0;for(;u&&u.nodeType==1&&(d=iG[u.nodeName.toLowerCase()]);){for(let m=d.length-1;m>=0;m--){let y=o.createElement(d[m]);for(;c.firstChild;)y.appendChild(c.firstChild);c.appendChild(y),f++}u=c.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${s}${f?` -${f}`:""} ${JSON.stringify(r)}`);let p=t.someProp("clipboardTextSerializer",m=>m(e,t))||e.content.textBetween(0,e.content.size,`
705
706`);return{dom:c,text:p,slice:e}}function eG(t,e,r,n,i){let s=i.parent.type.spec.code,a,o;if(!r&&!e)return null;let c=!!e&&(n||s||!r);if(c){if(t.someProp("transformPastedText",p=>{e=p(e,s||n,t)}),s)return o=new Ne(me.from(t.state.schema.text(e.replace(/\r\n?/g,`
707`))),0,0),t.someProp("transformPasted",p=>{o=p(o,t,!0)}),o;let f=t.someProp("clipboardTextParser",p=>p(e,i,n,t));if(f)o=f;else{let p=i.marks(),{schema:m}=t.state,y=kd.fromSchema(m);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(v=>{let w=a.appendChild(document.createElement("p"));v&&w.appendChild(y.serializeNode(m.text(v,p)))})}}else t.someProp("transformPastedHTML",f=>{r=f(r,t)}),a=zwe(r),Ry&&Uwe(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 f=+d[3];f>0;f--){let p=a.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;a=p}if(o||(o=(t.someProp("clipboardParser")||t.someProp("domParser")||lc.fromSchema(t.state.schema)).parseSlice(a,{preserveWhitespace:!!(c||d),context:i,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!Dwe.test(p.parentNode.nodeName)?{ignore:!0}:null}})),d)o=Hwe(z4(o,+d[1],+d[2]),d[4]);else if(o=Ne.maxOpen(Bwe(o.content,i),!0),o.openStart||o.openEnd){let f=0,p=0;for(let m=o.content.firstChild;f<o.openStart&&!m.type.spec.isolating;f++,m=m.firstChild);for(let m=o.content.lastChild;p<o.openEnd&&!m.type.spec.isolating;p++,m=m.lastChild);o=z4(o,f,p)}return t.someProp("transformPasted",f=>{o=f(o,t,c)}),o}const Dwe=/^(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 Bwe(t,e){if(t.childCount<2)return t;for(let r=e.depth;r>=0;r--){let i=e.node(r).contentMatchAt(e.index(r)),s,a=[];if(t.forEach(o=>{if(!a)return;let c=i.findWrapping(o.type),u;if(!c)return a=null;if(u=a.length&&s.length&&rG(c,s,o,a[a.length-1],0))a[a.length-1]=u;else{a.length&&(a[a.length-1]=nG(a[a.length-1],s.length));let d=tG(o,c);a.push(d),i=i.matchType(d.type),s=c}}),a)return me.from(a)}return t}function tG(t,e,r=0){for(let n=e.length-1;n>=r;n--)t=e[n].create(null,me.from(t));return t}function rG(t,e,r,n,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=rG(t,e,r,n.lastChild,i+1);if(s)return n.copy(n.content.replaceChild(n.childCount-1,s));if(n.contentMatchAt(n.childCount).matchType(i==t.length-1?r.type:t[i+1]))return n.copy(n.content.append(me.from(tG(r,t,i+1))))}}function nG(t,e){if(e==0)return t;let r=t.content.replaceChild(t.childCount-1,nG(t.lastChild,e-1)),n=t.contentMatchAt(t.childCount).fillBefore(me.empty,!0);return t.copy(r.append(n))}
vendor: 6,561 bytes, line 707
707function TO(t,e,r,n,i,s){let a=e<0?t.firstChild:t.lastChild,o=a.content;return t.childCount>1&&(s=0),i<n-1&&(o=TO(o,e,r,n,i+1,s)),i>=r&&(o=e<0?a.contentMatchAt(0).fillBefore(o,s<=i).append(o):o.append(a.contentMatchAt(a.childCount).fillBefore(me.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(o))}function z4(t,e,r){return e<t.openStart&&(t=new Ne(TO(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),r<t.openEnd&&(t=new Ne(TO(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}const iG={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 U4=null;function sG(){return U4||(U4=document.implementation.createHTMLDocument("title"))}let uN=null;function Fwe(t){let e=window.trustedTypes;return e?(uN||(uN=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:r=>r})),uN.createHTML(t)):t}function zwe(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let r=sG().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(t),i;if((i=n&&iG[n[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"</"+s+">").reverse().join("")),r.innerHTML=Fwe(t),i)for(let s=0;s<i.length;s++)r=r.querySelector(i[s])||r;return r}function Uwe(t){let e=t.querySelectorAll(On?"span:not([class]):not([style])":"span.Apple-converted-space");for(let r=0;r<e.length;r++){let n=e[r];n.childNodes.length==1&&n.textContent==" "&&n.parentNode&&n.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),n)}}function Hwe(t,e){if(!t.size)return t;let r=t.content.firstChild.type.schema,n;try{n=JSON.parse(e)}catch{return t}let{content:i,openStart:s,openEnd:a}=t;for(let o=n.length-2;o>=0;o-=2){let c=r.nodes[n[o]];if(!c||c.hasRequiredAttrs())break;i=me.from(c.create(n[o+1],i)),s++,a++}return new Ne(i,s,a)}const oi={},li={},Vwe={touchstart:!0,touchmove:!0};class Wwe{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 qwe(t){for(let e in oi){let r=oi[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=n=>{Gwe(t,n)&&!J2(t,n)&&(t.editable||!(n.type in li))&&r(t,n)},Vwe[e]?{passive:!0}:void 0)}Wn&&t.dom.addEventListener("input",()=>null),AO(t)}function Gl(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function Kwe(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function AO(t){t.someProp("handleDOMEvents",e=>{for(let r in e)t.input.eventHandlers[r]||t.dom.addEventListener(r,t.input.eventHandlers[r]=n=>J2(t,n))})}function J2(t,e){return t.someProp("handleDOMEvents",r=>{let n=r[e.type];return n?n(t,e)||e.defaultPrevented:!1})}function Gwe(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let r=e.target;r!=t.dom;r=r.parentNode)if(!r||r.nodeType==11||r.pmViewDesc&&r.pmViewDesc.stopEvent(e))return!1;return!0}function Zwe(t,e){!J2(t,e)&&oi[e.type]&&(t.editable||!(e.type in li))&&oi[e.type](t,e)}li.keydown=(t,e)=>{let r=e;if(t.input.shiftKey=r.keyCode==16||r.shiftKey,!oG(t,r)&&(t.input.lastKeyCode=r.keyCode,t.input.lastKeyCodeTime=Date.now(),!(No&&On&&r.keyCode==13)))if(r.keyCode!=229&&t.domObserver.forceFlush(),Lh&&r.keyCode==13&&!r.ctrlKey&&!r.altKey&&!r.metaKey){let n=Date.now();t.input.lastIOSEnter=n,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==n&&(t.someProp("handleKeyDown",i=>i(t,pu(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",n=>n(t,r))||$we(t,r)?r.preventDefault():Gl(t,"key")};li.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};li.keypress=(t,e)=>{let r=e;if(oG(t,r)||!r.charCode||r.ctrlKey&&!r.altKey||ms&&r.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,r))){r.preventDefault();return}let n=t.state.selection;if(!(n instanceof Qe)||!n.$from.sameParent(n.$to)){let i=String.fromCharCode(r.charCode),s=()=>t.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",a=>a(t,n.$from.pos,n.$to.pos,i,s))&&t.dispatch(s()),r.preventDefault()}};function uk(t){return{left:t.clientX,top:t.clientY}}function Jwe(t,e){let r=e.x-t.clientX,n=e.y-t.clientY;return r*r+n*n<100}function Y2(t,e,r,n,i){if(n==-1)return!1;let s=t.state.doc.resolve(n);for(let a=s.depth+1;a>0;a--)if(t.someProp(e,o=>a>s.depth?o(t,r,s.nodeAfter,s.before(a),i,!0):o(t,r,s.node(a),s.before(a),i,!1)))return!0;return!1}function Qf(t,e,r){if(t.focused||t.focus(),t.state.selection.eq(e))return;let n=t.state.tr.setSelection(e);n.setMeta("pointer",!0),t.dispatch(n)}function Ywe(t,e){if(e==-1)return!1;let r=t.state.doc.resolve(e),n=r.nodeAfter;return n&&n.isAtom&&Ue.isSelectable(n)?(Qf(t,new Ue(r)),!0):!1}function Xwe(t,e){if(e==-1)return!1;let r=t.state.selection,n,i;r instanceof Ue&&(n=r.node);let s=t.state.doc.resolve(e);for(let a=s.depth+1;a>0;a--){let o=a>s.depth?s.nodeAfter:s.node(a);if(Ue.isSelectable(o)){n&&r.$from.depth>0&&a>=r.$from.depth&&s.before(r.$from.depth+1)==r.$from.pos?i=s.before(r.$from.depth):i=s.before(a);break}}return i!=null?(Qf(t,Ue.create(t.state.doc,i)),!0):!1}function Qwe(t,e,r,n,i){return Y2(t,"handleClickOn",e,r,n)||t.someProp("handleClick",s=>s(t,e,n))||(i?Xwe(t,r):Ywe(t,r))}function e1e(t,e,r,n){return Y2(t,"handleDoubleClickOn",e,r,n)||t.someProp("handleDoubleClick",i=>i(t,e,n))}function t1e(t,e,r,n){return Y2(t,"handleTripleClickOn",e,r,n)||t.someProp("handleTripleClick",i=>i(t,e,n))||r1e(t,r,n)}function r1e(t,e,r){if(r.button!=0)return!1;let n=t.state.doc;if(e==-1)return n.inlineContent?(Qf(t,Qe.create(n,0,n.content.size)),!0):!1;let i=n.resolve(e);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)Qf(t,Qe.create(n,o+1,o+1+a.content.size));else if(Ue.isSelectable(a))Qf(t,Ue.create(n,o));else continue;return!0}}function X2(t){return dw(t)}const aG=ms?"metaKey":"ctrlKey";oi.mousedown=(t,e)=>{let r=e;t.input.shiftKey=r.shiftKey;let n=X2(t),i=Date.now(),s="singleClick";
vendor: 4,187 bytes, line 707
707i-t.input.lastClick.time<500&&Jwe(r,t.input.lastClick)&&!r[aG]&&t.input.lastClick.button==r.button&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:i,x:r.clientX,y:r.clientY,type:s,button:r.button};let a=t.posAtCoords(uk(r));a&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new n1e(t,a,r,!!n)):(s=="doubleClick"?e1e:t1e)(t,a.pos,a.inside,r)?r.preventDefault():Gl(t,"pointer"))};class n1e{constructor(e,r,n,i){this.view=e,this.pos=r,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[aG],this.allowDefault=n.shiftKey;let s,a;if(r.inside>-1)s=e.state.doc.nodeAt(r.inside),a=r.inside;else{let d=e.state.doc.resolve(r.pos);s=d.parent,a=d.depth?d.before():0}const o=i?null:n.target,c=o?e.docView.nearestDesc(o,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:u}=e.state;n.button==0&&(s.type.spec.draggable&&s.type.spec.selectable!==!1||u instanceof Ue&&u.from<=a&&u.to>a)&&(this.mightDrag={node:s,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Es&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Gl(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Po(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(uk(e))),this.updateAllowDefault(e),this.allowDefault||!r?Gl(this.view,"pointer"):Qwe(this.view,r.pos,r.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Wn&&this.mightDrag&&!this.mightDrag.node.isAtom||On&&!this.view.state.selection.visible&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(Qf(this.view,dt.near(this.view.state.doc.resolve(r.pos))),e.preventDefault()):Gl(this.view,"pointer")}move(e){this.updateAllowDefault(e),Gl(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}oi.touchstart=t=>{t.input.lastTouch=Date.now(),X2(t),Gl(t,"pointer")};oi.touchmove=t=>{t.input.lastTouch=Date.now(),Gl(t,"pointer")};oi.contextmenu=t=>X2(t);function oG(t,e){return t.composing?!0:Wn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const i1e=No?5e3:-1;li.compositionstart=li.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,r=e.selection.$to;if(e.selection instanceof Qe&&(e.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)||On&&DK&&s1e(t)))t.markCursor=t.state.storedMarks||r.marks(),dw(t,!0),t.markCursor=null;else if(dw(t,!e.selection.empty),Es&&e.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let n=t.domSelectionRange();for(let i=n.focusNode,s=n.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=t.domSelection();o&&o.collapse(a,a.nodeValue.length);break}else i=a,s=-1}}t.input.composing=!0}lG(t,i1e)};function s1e(t){let{focusNode:e,focusOffset:r}=t.domSelectionRange();if(!e||e.nodeType!=1||r>=e.childNodes.length)return!1;let n=e.childNodes[r];
vendor: 4,196 bytes, line 707
707return n.nodeType==1&&n.contentEditable=="false"}li.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,lG(t,20))};function lG(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>dw(t),e))}function cG(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=o1e());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function a1e(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let r=X0e(e.focusNode,e.focusOffset),n=Q0e(e.focusNode,e.focusOffset);if(r&&n&&r!=n){let i=n.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(r==s||n==s)return s;if(!i||!i.isText(n.nodeValue))return n;if(t.input.compositionNode==n){let a=r.pmViewDesc;if(!(!a||!a.isText(r.nodeValue)))return n}}return r||n}function o1e(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function dw(t,e=!1){if(!(No&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),cG(t),e||t.docView&&t.docView.dirty){let r=K2(t),n=t.state.selection;return r&&!r.eq(n)?t.dispatch(t.state.tr.setSelection(r)):(t.markCursor||e)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function l1e(t,e){if(!t.dom.parentNode)return;let r=t.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(e),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),n.removeAllRanges(),n.addRange(i),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),t.focus()},50)}const mv=Ni&&cc<15||Lh&&nwe<604;oi.copy=li.cut=(t,e)=>{let r=e,n=t.state.selection,i=r.type=="cut";if(n.empty)return;let s=mv?null:r.clipboardData,a=n.content(),{dom:o,text:c}=Z2(t,a);s?(r.preventDefault(),s.clearData(),s.setData("text/html",o.innerHTML),s.setData("text/plain",c)):l1e(t,o),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function c1e(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function u1e(t,e){if(!t.dom.parentNode)return;let r=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,n=t.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),n.parentNode&&n.parentNode.removeChild(n),r?gv(t,n.value,null,i,e):gv(t,n.textContent,n.innerHTML,i,e)},50)}function gv(t,e,r,n,i){let s=eG(t,e,r,n,t.state.selection.$from);if(t.someProp("handlePaste",c=>c(t,i,s||Ne.empty)))return!0;if(!s)return!1;let a=c1e(s),o=a?t.state.tr.replaceSelectionWith(a,n):t.state.tr.replaceSelection(s);return t.dispatch(o.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function uG(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let r=t.getData("text/uri-list");return r?r.replace(/\r?\n/g," "):""}li.paste=(t,e)=>{let r=e;if(t.composing&&!No)return;let n=mv?null:r.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;n&&gv(t,uG(n),n.getData("text/html"),i,r)?r.preventDefault():u1e(t,r)};class dG{constructor(e,r,n){this.slice=e,this.move=r,this.node=n}}const d1e=ms?"altKey":"ctrlKey";function fG(t,e){let r;return t.someProp("dragCopies",n=>{r=r||n(e)}),r!=null?!r:!e[d1e]}oi.dragstart=(t,e)=>{let r=e,n=t.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;let i=t.state.selection,s=i.empty?null:t.posAtCoords(uk(r)),a;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof Ue?i.to-1:i.to))){if(n&&n.mightDrag)a=Ue.create(t.state.doc,n.mightDrag.pos);else if(r.target&&r.target.nodeType==1){let f=t.docView.nearestDesc(r.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(a=Ue.create(t.state.doc,f.posBefore))}}
vendor: 8,691 bytes, line 707
707let o=(a||t.state.selection).content(),{dom:c,text:u,slice:d}=Z2(t,o);(!r.dataTransfer.files.length||!On||$K>120)&&r.dataTransfer.clearData(),r.dataTransfer.setData(mv?"Text":"text/html",c.innerHTML),r.dataTransfer.effectAllowed="copyMove",mv||r.dataTransfer.setData("text/plain",u),t.dragging=new dG(d,fG(t,r),a)};oi.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};li.dragover=li.dragenter=(t,e)=>e.preventDefault();li.drop=(t,e)=>{try{f1e(t,e,t.dragging)}finally{t.dragging=null}};function f1e(t,e,r){if(!e.dataTransfer)return;let n=t.posAtCoords(uk(e));if(!n)return;let i=t.state.doc.resolve(n.pos),s=r&&r.slice;s?t.someProp("transformPasted",m=>{s=m(s,t,!1)}):s=eG(t,uG(e.dataTransfer),mv?null:e.dataTransfer.getData("text/html"),!1,i);let a=!!(r&&fG(t,e));if(t.someProp("handleDrop",m=>m(t,e,s||Ne.empty,a))){e.preventDefault();return}if(!s)return;e.preventDefault();let o=s?EK(t.state.doc,i.pos,s):i.pos;o==null&&(o=i.pos);let c=t.state.tr;if(a){let{node:m}=r;m?m.replace(c):c.deleteSelection()}let u=c.mapping.map(o),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&Ue.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Ue(p));else{let m=c.mapping.map(o);c.mapping.maps[c.mapping.maps.length-1].forEach((y,v,w,b)=>m=b),c.setSelection(G2(t,p,c.doc.resolve(m)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))}oi.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Po(t)},20))};oi.blur=(t,e)=>{let r=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),r.relatedTarget&&t.dom.contains(r.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};oi.beforeinput=(t,e)=>{if(On&&No&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",s=>s(t,pu(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in li)oi[t]=li[t];function vv(t,e){if(t==e)return!0;for(let r in t)if(t[r]!==e[r])return!1;for(let r in e)if(!(r in t))return!1;return!0}class fw{constructor(e,r){this.toDOM=e,this.spec=r||Fu,this.side=this.spec.side||0}map(e,r,n,i){let{pos:s,deleted:a}=e.mapResult(r.from+i,this.side<0?-1:1);return a?null:new qi(s-n,s-n,this)}valid(){return!0}eq(e){return this==e||e instanceof fw&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&vv(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class dc{constructor(e,r){this.attrs=e,this.spec=r||Fu}map(e,r,n,i){let s=e.map(r.from+i,this.spec.inclusiveStart?-1:1)-n,a=e.map(r.to+i,this.spec.inclusiveEnd?1:-1)-n;return s>=a?null:new qi(s,a,this)}valid(e,r){return r.from<r.to}eq(e){return this==e||e instanceof dc&&vv(this.attrs,e.attrs)&&vv(this.spec,e.spec)}static is(e){return e.type instanceof dc}destroy(){}}class Q2{constructor(e,r){this.attrs=e,this.spec=r||Fu}map(e,r,n,i){let s=e.mapResult(r.from+i,1);if(s.deleted)return null;let a=e.mapResult(r.to+i,-1);return a.deleted||a.pos<=s.pos?null:new qi(s.pos-n,a.pos-n,this)}valid(e,r){let{index:n,offset:i}=e.content.findIndex(r.from),s;return i==r.from&&!(s=e.child(n)).isText&&i+s.nodeSize==r.to}eq(e){return this==e||e instanceof Q2&&vv(this.attrs,e.attrs)&&vv(this.spec,e.spec)}destroy(){}}class qi{constructor(e,r,n){this.from=e,this.to=r,this.type=n}copy(e,r){return new qi(e,r,this.type)}eq(e,r=0){return this.type.eq(e.type)&&this.from+r==e.from&&this.to+r==e.to}map(e,r,n){return this.type.map(e,this,r,n)}static widget(e,r,n){return new qi(e,e,new fw(r,n))}static inline(e,r,n,i){return new qi(e,r,new dc(n,i))}static node(e,r,n,i){return new qi(e,r,new Q2(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof dc}get widget(){return this.type instanceof fw}}const hf=[],Fu={};class zr{constructor(e,r){this.local=e.length?e:hf,this.children=r.length?r:hf}static create(e,r){return r.length?hw(r,e,0,Fu):Dn}find(e,r,n){let i=[];return this.findInner(e??0,r??1e9,i,0,n),i}findInner(e,r,n,i,s){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=r&&o.to>=e&&(!s||s(o.spec))&&n.push(o.copy(o.from+i,o.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<r&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,r-o,n,i+o,s)}}map(e,r,n){return this==Dn||e.maps.length==0?this:this.mapInner(e,r,0,0,n||Fu)}mapInner(e,r,n,i,s){let a;for(let o=0;o<this.local.length;o++){let c=this.local[o].map(e,n,i);c&&c.type.valid(r,c)?(a||(a=[])).push(c):s.onRemove&&s.onRemove(this.local[o].spec)}return this.children.length?h1e(this.children,a||[],e,r,n,i,s):a?new zr(a.sort(zu),hf):Dn}add(e,r){return r.length?this==Dn?zr.create(e,r):this.addInner(e,r,0):this}addInner(e,r,n){let i,s=0;e.forEach((o,c)=>{let u=c+n,d;if(d=pG(r,o,u)){for(i||(i=this.children.slice());s<i.length&&i[s]<c;)s+=3;i[s]==c?i[s+2]=i[s+2].addInner(o,d,u+1):i.splice(s,0,c,c+o.nodeSize,hw(d,o,u+1,Fu)),s+=3}});let a=hG(s?mG(r):r,-n);for(let o=0;o<a.length;o++)a[o].type.valid(e,a[o])||a.splice(o--,1);return new zr(a.length?this.local.concat(a).sort(zu):this.local,i||this.children)}remove(e){return e.length==0||this==Dn?this:this.removeInner(e,0)}removeInner(e,r){let n=this.children,i=this.local;for(let s=0;s<n.length;s+=3){let a,o=n[s]+r,c=n[s+1]+r;for(let d=0,f;d<e.length;d++)(f=e[d])&&f.from>o&&f.to<c&&(e[d]=null,(a||(a=[])).push(f));if(!a)continue;n==this.children&&(n=this.children.slice());let u=n[s+2].removeInner(a,o+1);u!=Dn?n[s+2]=u:(n.splice(s,3),s-=3)}if(i.length){for(let s=0,a;s<e.length;s++)if(a=e[s])for(let o=0;o<i.length;o++)i[o].eq(a,r)&&(i==this.local&&(i=this.local.slice()),i.splice(o--,1))}return n==this.children&&i==this.local?this:i.length||n.length?new zr(i,n):Dn}forChild(e,r){if(this==Dn)return this;if(r.isLeaf)return zr.empty;let n,i;for(let o=0;o<this.children.length;o+=3)if(this.children[o]>=e){this.children[o]==e&&(n=this.children[o+2]);break}let s=e+1,a=s+r.content.size;for(let o=0;o<this.local.length;o++){let c=this.local[o];if(c.from<a&&c.to>s&&c.type instanceof dc){let u=Math.max(s,c.from)-s,d=Math.min(a,c.to)-s;u<d&&(i||(i=[])).push(c.copy(u,d))}}if(i){let o=new zr(i.sort(zu),hf);return n?new Rl([o,n]):o}return n||Dn}eq(e){if(this==e)return!0;if(!(e instanceof zr)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let r=0;r<this.local.length;r++)if(!this.local[r].eq(e.local[r]))return!1;for(let r=0;r<this.children.length;r+=3)if(this.children[r]!=e.children[r]||this.children[r+1]!=e.children[r+1]||!this.children[r+2].eq(e.children[r+2]))return!1;return!0}locals(e){return eM(this.localsInner(e))}localsInner(e){if(this==Dn)return hf;if(e.inlineContent||!this.local.some(dc.is))return this.local;let r=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof dc||r.push(this.local[n]);return r}forEachSet(e){e(this)}}zr.empty=new zr([],[]);zr.removeOverlap=eM;const Dn=zr.empty;class Rl{constructor(e){this.members=e}map(e,r){const n=this.members.map(i=>i.map(e,r,Fu));return Rl.from(n)}forChild(e,r){if(r.isLeaf)return zr.empty;let n=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,r);s!=Dn&&(s instanceof Rl?n=n.concat(s.members):n.push(s))}return Rl.from(n)}eq(e){if(!(e instanceof Rl)||e.members.length!=this.members.length)return!1;for(let r=0;r<this.members.length;r++)if(!this.members[r].eq(e.members[r]))return!1;return!0}locals(e){let r,n=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!r)r=s;else{n&&(r=r.slice(),n=!1);for(let a=0;a<s.length;a++)r.push(s[a])}}return r?eM(n?r:r.sort(zu)):hf}static from(e){switch(e.length){case 0:return Dn;case 1:return e[0];default:return new Rl(e.every(r=>r instanceof zr)?e:e.reduce((r,n)=>r.concat(n instanceof zr?n:n.members),[]))}}forEachSet(e){for(let r=0;r<this.members.length;r++)this.members[r].forEachSet(e)}}function h1e(t,e,r,n,i,s,a){let o=t.slice();for(let u=0,d=s;u<r.maps.length;u++){let f=0;r.maps[u].forEach((p,m,y,v)=>{let w=v-y-(m-p);for(let b=0;b<o.length;b+=3){let _=o[b+1];if(_<0||p>_+d-f)continue;let S=o[b]+d-f;m>=S?o[b+1]=p<=S?-2:-1:p>=d&&w&&(o[b]+=w,o[b+1]+=w)}f+=w}),d=r.maps[u].map(d,-1)}let c=!1;for(let u=0;u<o.length;
vendor: 9,916 bytes, line 707
707u+=3)if(o[u+1]<0){if(o[u+1]==-2){c=!0,o[u+1]=-1;continue}let d=r.map(t[u]+s),f=d-i;if(f<0||f>=n.content.size){c=!0;continue}let p=r.map(t[u+1]+s,-1),m=p-i,{index:y,offset:v}=n.content.findIndex(f),w=n.maybeChild(y);if(w&&v==f&&v+w.nodeSize==m){let b=o[u+2].mapInner(r,w,d+1,t[u]+s+1,a);b!=Dn?(o[u]=f,o[u+1]=m,o[u+2]=b):(o[u+1]=-2,c=!0)}else c=!0}if(c){let u=p1e(o,t,e,r,i,s,a),d=hw(u,n,0,a);e=d.local;for(let f=0;f<o.length;f+=3)o[f+1]<0&&(o.splice(f,3),f-=3);for(let f=0,p=0;f<d.children.length;f+=3){let m=d.children[f];for(;p<o.length&&o[p]<m;)p+=3;o.splice(p,0,d.children[f],d.children[f+1],d.children[f+2])}}return new zr(e.sort(zu),o)}function hG(t,e){if(!e||!t.length)return t;let r=[];for(let n=0;n<t.length;n++){let i=t[n];r.push(new qi(i.from+e,i.to+e,i.type))}return r}function p1e(t,e,r,n,i,s,a){function o(c,u){for(let d=0;d<c.local.length;d++){let f=c.local[d].map(n,i,u);f?r.push(f):a.onRemove&&a.onRemove(c.local[d].spec)}for(let d=0;d<c.children.length;d+=3)o(c.children[d+2],c.children[d]+u+1)}for(let c=0;c<t.length;c+=3)t[c+1]==-1&&o(t[c+2],e[c]+s+1);return r}function pG(t,e,r){if(e.isLeaf)return null;let n=r+e.nodeSize,i=null;for(let s=0,a;s<t.length;s++)(a=t[s])&&a.from>r&&a.to<n&&((i||(i=[])).push(a),t[s]=null);return i}function mG(t){let e=[];for(let r=0;r<t.length;r++)t[r]!=null&&e.push(t[r]);return e}function hw(t,e,r,n){let i=[],s=!1;e.forEach((o,c)=>{let u=pG(t,o,c+r);if(u){s=!0;let d=hw(u,o,r+c+1,n);d!=Dn&&i.push(c,c+o.nodeSize,d)}});let a=hG(s?mG(t):t,-r).sort(zu);for(let o=0;o<a.length;o++)a[o].type.valid(e,a[o])||(n.onRemove&&n.onRemove(a[o].spec),a.splice(o--,1));return a.length||i.length?new zr(a,i):Dn}function zu(t,e){return t.from-e.from||t.to-e.to}function eM(t){let e=t;for(let r=0;r<e.length-1;r++){let n=e[r];if(n.from!=n.to)for(let i=r+1;i<e.length;i++){let s=e[i];if(s.from==n.from){s.to!=n.to&&(e==t&&(e=t.slice()),e[i]=s.copy(s.from,n.to),H4(e,i+1,s.copy(n.to,s.to)));continue}else{s.from<n.to&&(e==t&&(e=t.slice()),e[r]=n.copy(n.from,s.from),H4(e,i,n.copy(s.from,n.to)));break}}}return e}function H4(t,e,r){for(;e<t.length&&zu(r,t[e])>0;)e++;t.splice(e,0,r)}function dN(t){let e=[];return t.someProp("decorations",r=>{let n=r(t.state);n&&n!=Dn&&e.push(n)}),t.cursorWrapper&&e.push(zr.create(t.state.doc,[t.cursorWrapper.deco])),Rl.from(e)}const m1e={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},g1e=Ni&&cc<=11;class v1e{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class y1e{constructor(e,r){this.view=e,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new v1e,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let i=0;i<n.length;i++)this.queue.push(n[i]);Ni&&cc<=11&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():Wn&&e.composing&&n.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),g1e&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.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,m1e)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let r=0;r<e.length;r++)this.queue.push(e[r]);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(I4(this.view)){if(this.suppressingSelectionUpdates)return Po(this.view);if(Ni&&cc<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&sd(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let r=new Set,n;for(let s=e.focusNode;s;s=Ih(s))r.add(s);for(let s=e.anchorNode;s;s=Ih(s))if(r.has(s)){n=s;break}let i=n&&this.view.docView.nearestDesc(n);if(i&&i.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]);let n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&I4(e)&&!this.ignoreSelectionChange(n),s=-1,a=-1,o=!1,c=[];if(e.editable)for(let d=0;d<r.length;d++){let f=this.registerMutation(r[d],c);f&&(s=s<0?f.from:Math.min(f.from,s),a=a<0?f.to:Math.max(f.to,a),f.typeOver&&(o=!0))}if(c.some(d=>d.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let d of c)if(d.nodeName=="BR"&&d.parentNode){let f=d.nextSibling;for(;f&&f.nodeType==1;){if(f.contentEditable=="false"){d.parentNode.removeChild(d);break}f=f.firstChild}}}else if(Es&&c.length){let d=c.filter(f=>f.nodeName=="BR");if(d.length==2){let[f,p]=d;f.parentNode&&f.parentNode.parentNode==p.parentNode?p.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let p of d){let m=p.parentNode;m&&m.nodeName=="LI"&&(!f||w1e(e,f)!=m)&&p.remove()}}}let u=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&lk(n)&&(u=K2(e))&&u.eq(dt.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Po(e),this.currentSelection.set(n),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,a),x1e(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,_1e(e,c)),this.handleDOMChange(s,a,o,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Po(e),this.currentSelection.set(n))}registerMutation(e,r){if(r.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let f=e.addedNodes[d];r.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let i=e.previousSibling,s=e.nextSibling;if(Ni&&cc<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:f,nextSibling:p}=e.addedNodes[d];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(s=p)}let a=i&&i.parentNode==e.target?Nn(i)+1:0,o=n.localPosFromDOM(e.target,a,-1),c=s&&s.parentNode==e.target?Nn(s):e.target.childNodes.length,u=n.localPosFromDOM(e.target,c,1);return{from:o,to:u}}else return e.type=="attributes"?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let V4=new WeakMap,W4=!1;function x1e(t){if(!V4.has(t)&&(V4.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Es,W4)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."),W4=!0}}function q4(t,e){let r=e.startContainer,n=e.startOffset,i=e.endContainer,s=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return sd(a.node,a.offset,i,s)&&([r,n,i,s]=[i,s,r,n]),{anchorNode:r,anchorOffset:n,focusNode:i,focusOffset:s}}function b1e(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return q4(t,i)}let r;function n(i){i.preventDefault(),i.stopImmediatePropagation(),r=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0),r?q4(t,r):null}function w1e(t,e){for(let r=e.parentNode;r&&r!=t.dom;r=r.parentNode){let n=t.docView.nearestDesc(r,!0);if(n&&n.node.isBlock)return r}return null}function _1e(t,e){var r;let{focusNode:n,focusOffset:i}=t.domSelectionRange();for(let s of e)if(((r=s.parentNode)===null||r===void 0?void 0:r.nodeName)=="TR"){let a=s.nextSibling;for(;a&&a.nodeName!="TD"&&a.nodeName!="TH";)a=a.nextSibling;if(a){let o=a;for(;;){let c=o.firstChild;if(!c||c.nodeType!=1||c.contentEditable=="false"||/^(BR|IMG)$/.test(c.nodeName))break;o=c}o.insertBefore(s,o.firstChild),n==s&&t.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}function k1e(t,e,r){let{node:n,fromOffset:i,toOffset:s,from:a,to:o}
vendor: 1,934 bytes, line 707
707=t.docView.parseRange(e,r),c=t.domSelectionRange(),u,d=c.anchorNode;if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(u=[{node:d,offset:c.anchorOffset}],lk(c)||u.push({node:c.focusNode,offset:c.focusOffset})),On&&t.input.lastKeyCode===8)for(let w=s;w>i;w--){let b=n.childNodes[w-1],_=b.pmViewDesc;if(b.nodeName=="BR"&&!_){s=w;break}if(!_||_.size)break}let f=t.state.doc,p=t.someProp("domParser")||lc.fromSchema(t.state.schema),m=f.resolve(a),y=null,v=p.parse(n,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:i,to:s,preserveWhitespace:m.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:S1e,context:m});if(u&&u[0].pos!=null){let w=u[0].pos,b=u[1]&&u[1].pos;b==null&&(b=w),y={anchor:w+a,head:b+a}}return{doc:v,sel:y,from:a,to:o}}function S1e(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Wn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(t.parentNode.lastChild==t||Wn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const j1e=/^(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 N1e(t,e,r,n,i){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let O=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,P=K2(t,O);if(P&&!t.state.selection.eq(P)){if(On&&No&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",$=>$(t,pu(13,"Enter"))))return;let T=t.state.tr.setSelection(P);O=="pointer"?T.setMeta("pointer",!0):O=="key"&&T.scrollIntoView(),s&&T.setMeta("composition",s),t.dis
vendor: 4,885 bytes, line 707
707patch(T)}return}let a=t.state.doc.resolve(e),o=a.sharedDepth(r);e=a.before(o+1),r=t.state.doc.resolve(r).after(o+1);let c=t.state.selection,u=k1e(t,e,r),d=t.state.doc,f=d.slice(u.from,u.to),p,m;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(p=t.state.selection.to,m="end"):(p=t.state.selection.from,m="start"),t.input.lastKeyCode=null;let y=O1e(f.content,u.doc.content,u.from,p,m);if(y&&t.input.domChangeCount++,(Lh&&t.input.lastIOSEnter>Date.now()-225||No)&&i.some(O=>O.nodeType==1&&!j1e.test(O.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",O=>O(t,pu(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y)if(n&&c instanceof Qe&&!c.empty&&c.$head.sameParent(c.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))y={start:c.from,endA:c.to,endB:c.to};else{if(u.sel){let O=K4(t,t.state.doc,u.sel);if(O&&!O.eq(t.state.selection)){let P=t.state.tr.setSelection(O);s&&P.setMeta("composition",s),t.dispatch(P)}}return}t.state.selection.from<t.state.selection.to&&y.start==y.endB&&t.state.selection instanceof Qe&&(y.start>t.state.selection.from&&y.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?y.start=t.state.selection.from:y.endA<t.state.selection.to&&y.endA>=t.state.selection.to-2&&t.state.selection.to<=u.to&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),Ni&&cc<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>u.from&&u.doc.textBetween(y.start-u.from-1,y.start-u.from+1)=="  "&&(y.start--,y.endA--,y.endB--);let v=u.doc.resolveNoCache(y.start-u.from),w=u.doc.resolveNoCache(y.endB-u.from),b=d.resolve(y.start),_=v.sameParent(w)&&v.parent.inlineContent&&b.end()>=y.endA;if((Lh&&t.input.lastIOSEnter>Date.now()-225&&(!_||i.some(O=>O.nodeName=="DIV"||O.nodeName=="P"))||!_&&v.pos<u.doc.content.size&&(!v.sameParent(w)||!v.parent.inlineContent)&&v.pos<w.pos&&!/\S/.test(u.doc.textBetween(v.pos,w.pos,"","")))&&t.someProp("handleKeyDown",O=>O(t,pu(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>y.start&&E1e(d,y.start,y.endA,v,w)&&t.someProp("handleKeyDown",O=>O(t,pu(8,"Backspace")))){No&&On&&t.domObserver.suppressSelectionUpdates();return}On&&y.endB==y.start&&(t.input.lastChromeDelete=Date.now()),No&&!_&&v.start()!=w.start()&&w.parentOffset==0&&v.depth==w.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==y.endA&&(y.endB-=2,w=u.doc.resolveNoCache(y.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(O){return O(t,pu(13,"Enter"))})},20));let S=y.start,N=y.endA,j=O=>{let P=O||t.state.tr.replace(S,N,u.doc.slice(y.start-u.from,y.endB-u.from));if(u.sel){let T=K4(t,P.doc,u.sel);T&&!(On&&t.composing&&T.empty&&(y.start!=y.endB||t.input.lastChromeDelete<Date.now()-100)&&(T.head==S||T.head==P.mapping.map(N)-1)||Ni&&T.empty&&T.head==S)&&P.setSelection(T)}return s&&P.setMeta("composition",s),P.scrollIntoView()},C;if(_)if(v.pos==w.pos){Ni&&cc<=11&&v.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Po(t),20));let O=j(t.state.tr.delete(S,N)),P=d.resolve(y.start).marksAcross(d.resolve(y.endA));P&&O.ensureMarks(P),t.dispatch(O)}else if(y.endA==y.endB&&(C=C1e(v.parent.content.cut(v.parentOffset,w.parentOffset),b.parent.content.cut(b.parentOffset,y.endA-b.start())))){let O=j(t.state.tr);C.type=="add"?O.addMark(S,N,C.mark):O.removeMark(S,N,C.mark),t.dispatch(O)}else if(v.parent.child(v.index()).isText&&v.index()==w.index()-(w.textOffset?0:1)){let O=v.parent.textBetween(v.parentOffset,w.parentOffset),P=()=>j(t.state.tr.insertText(O,S,N));t.someProp("handleTextInput",T=>T(t,S,N,O,P))||t.dispatch(P())}else t.dispatch(j());else t.dispatch(j())}function K4(t,e,r){return Math.max(r.anchor,r.head)>e.content.size?null:G2(t,e.resolve(r.anchor),e.resolve(r.head))}function C1e(t,e){let r=t.firstChild.marks,n=e.firstChild.marks,i=r,s=n,a,o,c;for(let d=0;d<n.length;d++)i=n[d].removeFromSet(i);for(let d=0;d<r.length;d++)s=r[d].removeFromSet(s);if(i.length==1&&s.length==0)o=i[0],a="add",c=d=>d.mark(o.addToSet(d.marks));else if(i.length==0&&s.length==1)o=s[0],a="remove",c=d=>d.mark(o.removeFromSet(d.marks));else return null;let u=[];for(let d=0;d<e.childCount;d++)u.push(c(e.child(d)));if(me.from(u).eq(t))return{mark:o,type:a}}function E1e(t,e,r,n,i){if(r-e<=i.pos-n.pos||fN(n,!0,!1)<i.pos)return!1;let s=t.resolve(e);if(!n.parent.isTextblock){let o=s.nodeAfter;return o!=null&&r==e+o.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let a=t.resolve(fN(s,!0,!0));return!a.parent.isTextblock||a.pos>r||fN(a,!0,!1)<r?!1:n.parent.content.cut(n.parentOffset).eq(a.parent.content)}function fN(t,e,r){let n=t.depth,i=e?t.end():t.pos;for(;n>0&&(e||t.indexAfter(n)==t.node(n).childCount);)n--,i++,e=!1;if(r){let s=t.node(n).maybeChild(t.indexAfter(n));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function O1e(t,e,r,n,i){let s=t.findDiffStart(e,r);if(s==null)return null;let{a,b:o}=t.findDiffEnd(e,r+t.size,r+e.size);
vendor: 4,459 bytes, line 707
707if(i=="end"){let c=Math.max(0,s-Math.min(a,o));n-=a+c-s}if(a<s&&t.size<e.size){let c=n<=s&&n>=a?s-n:0;s-=c,s&&s<e.size&&G4(e.textBetween(s-1,s+1))&&(s+=c?1:-1),o=s+(o-a),a=s}else if(o<s){let c=n<=s&&n>=o?s-n:0;s-=c,s&&s<t.size&&G4(t.textBetween(s-1,s+1))&&(s+=c?1:-1),a=s+(a-o),o=s}return{start:s,endA:a,endB:o}}function G4(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),r=t.charCodeAt(1);return e>=56320&&e<=57343&&r>=55296&&r<=56319}class gG{constructor(e,r){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 Wwe,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=r,this.state=r.state,this.directPlugins=r.plugins||[],this.directPlugins.forEach(Q4),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Y4(this),J4(this),this.nodeViews=X4(this),this.docView=O4(this.state.doc,Z4(this),dN(this),this.dom,this),this.domObserver=new y1e(this,(n,i,s,a)=>N1e(this,n,i,s,a)),this.domObserver.start(),qwe(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let r in e)this._props[r]=e[r];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&AO(this);let r=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Q4),this.directPlugins=e.plugins),this.updateStateInner(e.state,r)}setProps(e){let r={};for(let n in this._props)r[n]=this._props[n];r.state=this.state;for(let n in e)r[n]=e[n];this.update(r)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,r){var n;let i=this.state,s=!1,a=!1;e.storedMarks&&this.composing&&(cG(this),a=!0),this.state=e;let o=i.plugins!=e.plugins||this._props.plugins!=r.plugins;if(o||this._props.plugins!=r.plugins||this._props.nodeViews!=r.nodeViews){let m=X4(this);A1e(m,this.nodeViews)&&(this.nodeViews=m,s=!0)}(o||r.handleDOMEvents!=this._props.handleDOMEvents)&&AO(this),this.editable=Y4(this),J4(this);let c=dN(this),u=Z4(this),d=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=s||!this.docView.matchesNode(e.doc,u,c);(f||!e.selection.eq(i.selection))&&(a=!0);let p=d=="preserve"&&a&&this.dom.style.overflowAnchor==null&&awe(this);if(a){this.domObserver.stop();let m=f&&(Ni||On)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&T1e(i.selection,e.selection);if(f){let y=On?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=a1e(this)),(s||!this.docView.update(e.doc,u,c,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=O4(e.doc,u,c,this.dom,this)),y&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(m=!0)}m||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Twe(this))?Po(this,m):(YK(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((n=this.dragging)===null||n===void 0)&&n.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():p&&owe(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",r=>r(this)))if(this.state.selection instanceof Ue){let r=this.docView.domAfterPos(this.state.selection.from);r.nodeType==1&&k4(this,r.getBoundingClientRect(),e)}else k4(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let r=0;r<this.directPlugins.length;r++){let n=this.directPlugins[r];n.spec.view&&this.pluginViews.push(n.spec.view(this))}for(let r=0;r<this.state.plugins.length;r++){let n=this.state.plugins[r];n.spec.view&&this.pluginViews.push(n.spec.view(this))}}else for(let r=0;r<this.pluginViews.length;r++){let n=this.pluginViews[r];n.update&&n.update(this,e)}}updateDraggedNode(e,r){let n=e.node,i=-1;
vendor: 6,082 bytes, line 707
707if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)i=n.from;else{let s=n.from+(this.state.doc.content.size-r.doc.content.size);(s>0&&s<this.state.doc.content.size&&this.state.doc.nodeAt(s))==n.node&&(i=s)}this.dragging=new dG(e.slice,e.move,i<0?void 0:Ue.create(this.state.doc,i))}someProp(e,r){let n=this._props&&this._props[e],i;if(n!=null&&(i=r?r(n):n))return i;for(let a=0;a<this.directPlugins.length;a++){let o=this.directPlugins[a].props[e];if(o!=null&&(i=r?r(o):o))return i}let s=this.state.plugins;if(s)for(let a=0;a<s.length;a++){let o=s[a].props[e];if(o!=null&&(i=r?r(o):o))return i}}hasFocus(){if(Ni){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&lwe(this.dom),Po(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let r=this.dom.parentNode;r;r=r.parentNode)if(r.nodeType==9||r.nodeType==11&&r.host)return r.getSelection||(Object.getPrototypeOf(r).getSelection=()=>r.ownerDocument.getSelection()),this._root=r}return e||document}updateRoot(){this._root=null}posAtCoords(e){return hwe(this,e)}coordsAtPos(e,r=1){return HK(this,e,r)}domAtPos(e,r=0){return this.docView.domFromPos(e,r)}nodeDOM(e){let r=this.docView.descAt(e);return r?r.nodeDOM:null}posAtDOM(e,r,n=-1){let i=this.docView.posFromDOM(e,r,n);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,r){return ywe(this,r||this.state,e)}pasteHTML(e,r){return gv(this,"",e,!1,r||new ClipboardEvent("paste"))}pasteText(e,r){return gv(this,e,null,!0,r||new ClipboardEvent("paste"))}serializeForClipboard(e){return Z2(this,e)}destroy(){this.docView&&(Kwe(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],dN(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,J0e())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Zwe(this,e)}domSelectionRange(){let e=this.domSelection();return e?Wn&&this.root.nodeType===11&&twe(this.dom.ownerDocument)==this.dom&&b1e(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}gG.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function Z4(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",r=>{if(typeof r=="function"&&(r=r(t.state)),r)for(let n in r)n=="class"?e.class+=" "+r[n]:n=="style"?e.style=(e.style?e.style+";":"")+r[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(r[n]))}),e.translate||(e.translate="no"),[qi.node(0,t.state.doc.content.size,e)]}function J4(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:qi.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Y4(t){return!t.someProp("editable",e=>e(t.state)===!1)}function T1e(t,e){let r=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(r)!=e.$anchor.start(r)}function X4(t){let e=Object.create(null);function r(n){for(let i in n)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=n[i])}return t.someProp("nodeViews",r),t.someProp("markViews",r),e}function A1e(t,e){let r=0,n=0;for(let i in t){if(t[i]!=e[i])return!0;r++}for(let i in e)n++;return r!=n}function Q4(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var kc={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:"'"},pw={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},P1e=typeof navigator<"u"&&/Mac/.test(navigator.platform),M1e=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Cn=0;Cn<10;Cn++)kc[48+Cn]=kc[96+Cn]=String(Cn);for(var Cn=1;Cn<=24;Cn++)kc[Cn+111]="F"+Cn;for(var Cn=65;Cn<=90;Cn++)kc[Cn]=String.fromCharCode(Cn+32),pw[Cn]=String.fromCharCode(Cn);for(var hN in kc)pw.hasOwnProperty(hN)||(pw[hN]=kc[hN]);function R1e(t){var e=P1e&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||M1e&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",r=!e&&t.key||(t.shiftKey?pw:kc)[t.keyCode]||t.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}const I1e=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),L1e=typeof navigator<"u"&&/Win/.test(navigator.platform);function $1e(t){let e=t.split(/-(?!$)/),r=e[e.length-1];r=="Space"&&(r=" ");let n,i,s,a;for(let o=0;o<e.length-1;o++){let c=e[o];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))n=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))I1e?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return n&&(r="Alt-"+r),i&&(r="Ctrl-"+r),a&&(r="Meta-"+r),s&&(r="Shift-"+r),r}function D1e(t){let e=Object.create(null);for(let r in t)e[$1e(r)]=t[r];return e}
vendor: 4,901 bytes, lines 707-708
707function pN(t,e,r=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),r&&e.shiftKey&&(t="Shift-"+t),t}function B1e(t){return new gn({props:{handleKeyDown:vG(t)}})}function vG(t){let e=D1e(t);return function(r,n){let i=R1e(n),s,a=e[pN(i,n)];if(a&&a(r.state,r.dispatch,r))return!0;if(i.length==1&&i!=" "){if(n.shiftKey){let o=e[pN(i,n,!1)];if(o&&o(r.state,r.dispatch,r))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(L1e&&n.ctrlKey&&n.altKey)&&(s=kc[n.keyCode])&&s!=i){let o=e[pN(s,n)];if(o&&o(r.state,r.dispatch,r))return!0}}return!1}}const F1e=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function yG(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("backward",t):r.parentOffset>0)?null:r}const z1e=(t,e,r)=>{let n=yG(t,r);if(!n)return!1;let i=tM(n);if(!i){let a=n.blockRange(),o=a&&Op(a);return o==null?!1:(e&&e(t.tr.lift(a,o).scrollIntoView()),!0)}let s=i.nodeBefore;if(_G(t,i,e,-1))return!0;if(n.parent.content.size==0&&($h(s,"end")||Ue.isSelectable(s)))for(let a=n.depth;;a--){let o=ak(t.doc,n.before(a),n.after(a),Ne.empty);if(o&&o.slice.size<o.to-o.from){if(e){let c=t.tr.step(o);c.setSelection($h(s,"end")?dt.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):Ue.create(c.doc,i.pos-s.nodeSize)),e(c.scrollIntoView())}return!0}if(a==1||n.node(a-1).childCount>1)break}return s.isAtom&&i.depth==n.depth-1?(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},U1e=(t,e,r)=>{let n=yG(t,r);if(!n)return!1;let i=tM(n);return i?xG(t,i,e):!1},H1e=(t,e,r)=>{let n=bG(t,r);if(!n)return!1;let i=rM(n);return i?xG(t,i,e):!1};function xG(t,e,r){let n=e.nodeBefore,i=n,s=e.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=e.nodeAfter,o=a,c=e.pos+1;for(;!o.isTextblock;c++){if(o.type.spec.isolating)return!1;let d=o.firstChild;if(!d)return!1;o=d}let u=ak(t.doc,s,c,Ne.empty);if(!u||u.from!=s||u instanceof Fr&&u.slice.size>=c-s)return!1;if(r){let d=t.tr.step(u);d.setSelection(Qe.create(d.doc,s)),r(d.scrollIntoView())}return!0}function $h(t,e,r=!1){for(let n=t;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(r&&n.childCount!=1)return!1}return!1}const V1e=(t,e,r)=>{let{$head:n,empty:i}=t.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",t):n.parentOffset>0)return!1;s=tM(n)}let a=s&&s.nodeBefore;return!a||!Ue.isSelectable(a)?!1:(e&&e(t.tr.setSelection(Ue.create(t.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)};function tM(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function bG(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)?null:r}const W1e=(t,e,r)=>{let n=bG(t,r);if(!n)return!1;let i=rM(n);if(!i)return!1;let s=i.nodeAfter;if(_G(t,i,e,1))return!0;if(n.parent.content.size==0&&($h(s,"start")||Ue.isSelectable(s))){let a=ak(t.doc,n.before(),n.after(),Ne.empty);if(a&&a.slice.size<a.to-a.from){if(e){let o=t.tr.step(a);o.setSelection($h(s,"start")?dt.findFrom(o.doc.resolve(o.mapping.map(i.pos)),1):Ue.create(o.doc,o.mapping.map(i.pos))),e(o.scrollIntoView())}return!0}}return s.isAtom&&i.depth==n.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},q1e=(t,e,r)=>{let{$head:n,empty:i}=t.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)return!1;s=rM(n)}let a=s&&s.nodeAfter;return!a||!Ue.isSelectable(a)?!1:(e&&e(t.tr.setSelection(Ue.create(t.doc,s.pos)).scrollIntoView()),!0)};function rM(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let r=t.node(e);if(t.index(e)+1<r.childCount)return t.doc.resolve(t.after(e+1));if(r.type.spec.isolating)break}return null}const K1e=(t,e)=>{let r=t.selection,n=r instanceof Ue,i;if(n){if(r.node.isTextblock||!Bc(t.doc,r.from))return!1;i=r.from}else if(i=sk(t.doc,r.from,-1),i==null)return!1;if(e){let s=t.tr.join(i);n&&s.setSelection(Ue.create(s.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},G1e=(t,e)=>{let r=t.selection,n;if(r instanceof Ue){if(r.node.isTextblock||!Bc(t.doc,r.to))return!1;n=r.to}else if(n=sk(t.doc,r.to,1),n==null)return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0},Z1e=(t,e)=>{let{$from:r,$to:n}=t.selection,i=r.blockRange(n),s=i&&Op(i);return s==null?!1:(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)},J1e=(t,e)=>{let{$head:r,$anchor:n}=t.selection;return!r.parent.type.spec.code||!r.sameParent(n)?!1:(e&&e(t.tr.insertText(`
708`).scrollIntoView()),!0)};function wG(t){for(let e=0;e<t.edgeCount;e++){let{type:r}=t.edge(e);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}const Y1e=(t,e)=>{let{$head:r,$anchor:n}=t.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;
vendor: 5,846 bytes, line 708
708let i=r.node(-1),s=r.indexAfter(-1),a=wG(i.contentMatchAt(s));if(!a||!i.canReplaceWith(s,s,a))return!1;if(e){let o=r.after(),c=t.tr.replaceWith(o,o,a.createAndFill());c.setSelection(dt.near(c.doc.resolve(o),1)),e(c.scrollIntoView())}return!0},X1e=(t,e)=>{let r=t.selection,{$from:n,$to:i}=r;if(r instanceof Cs||n.parent.inlineContent||i.parent.inlineContent)return!1;let s=wG(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let a=(!n.parentOffset&&i.index()<i.parent.childCount?n:i).pos,o=t.tr.insert(a,s.createAndFill());o.setSelection(Qe.create(o.doc,a+1)),e(o.scrollIntoView())}return!0},Q1e=(t,e)=>{let{$cursor:r}=t.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let s=r.before();if(Yf(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let n=r.blockRange(),i=n&&Op(n);return i==null?!1:(e&&e(t.tr.lift(n,i).scrollIntoView()),!0)},e_e=(t,e)=>{let{$from:r,to:n}=t.selection,i,s=r.sharedDepth(n);return s==0?!1:(i=r.before(s),e&&e(t.tr.setSelection(Ue.create(t.doc,i))),!0)};function t_e(t,e,r){let n=e.nodeBefore,i=e.nodeAfter,s=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(s-1,s)?(r&&r(t.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||Bc(t.doc,e.pos))?!1:(r&&r(t.tr.join(e.pos).scrollIntoView()),!0)}function _G(t,e,r,n){let i=e.nodeBefore,s=e.nodeAfter,a,o,c=i.type.spec.isolating||s.type.spec.isolating;if(!c&&t_e(t,e,r))return!0;let u=!c&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(a=(o=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&o.matchType(a[0]||s.type).validEnd){if(r){let m=e.pos+s.nodeSize,y=me.empty;for(let b=a.length-1;b>=0;b--)y=me.from(a[b].create(null,y));y=me.from(i.copy(y));let v=t.tr.step(new dn(e.pos-1,m,e.pos,m,new Ne(y,1,0),a.length,!0)),w=v.doc.resolve(m+2*a.length);w.nodeAfter&&w.nodeAfter.type==i.type&&Bc(v.doc,w.pos)&&v.join(w.pos),r(v.scrollIntoView())}return!0}let d=s.type.spec.isolating||n>0&&c?null:dt.findFrom(e,1),f=d&&d.$from.blockRange(d.$to),p=f&&Op(f);if(p!=null&&p>=e.depth)return r&&r(t.tr.lift(f,p).scrollIntoView()),!0;if(u&&$h(s,"start",!0)&&$h(i,"end")){let m=i,y=[];for(;y.push(m),!m.isTextblock;)m=m.lastChild;let v=s,w=1;for(;!v.isTextblock;v=v.firstChild)w++;if(m.canReplace(m.childCount,m.childCount,v.content)){if(r){let b=me.empty;for(let S=y.length-1;S>=0;S--)b=me.from(y[S].copy(b));let _=t.tr.step(new dn(e.pos-y.length,e.pos+s.nodeSize,e.pos+w,e.pos+s.nodeSize-w,new Ne(b,y.length,0),0,!0));r(_.scrollIntoView())}return!0}}return!1}function kG(t){return function(e,r){let n=e.selection,i=t<0?n.$from:n.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(r&&r(e.tr.setSelection(Qe.create(e.doc,t<0?i.start(s):i.end(s)))),!0):!1}}const r_e=kG(-1),n_e=kG(1);function i_e(t,e=null){return function(r,n){let{$from:i,$to:s}=r.selection,a=i.blockRange(s),o=a&&V2(a,t,e);return o?(n&&n(r.tr.wrap(a,o).scrollIntoView()),!0):!1}}function e3(t,e=null){return function(r,n){let i=!1;for(let s=0;s<r.selection.ranges.length&&!i;s++){let{$from:{pos:a},$to:{pos:o}}=r.selection.ranges[s];r.doc.nodesBetween(a,o,(c,u)=>{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(t,e)))if(c.type==t)i=!0;else{let d=r.doc.resolve(u),f=d.index();i=d.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(n){let s=r.tr;for(let a=0;a<r.selection.ranges.length;a++){let{$from:{pos:o},$to:{pos:c}}=r.selection.ranges[a];s.setBlockType(o,c,t,e)}n(s.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function s_e(t,e=null){return function(r,n){let{$from:i,$to:s}=r.selection,a=i.blockRange(s);if(!a)return!1;let o=n?r.tr:null;return a_e(o,a,t,e)?(n&&n(o.scrollIntoView()),!0):!1}}function a_e(t,e,r,n=null){let i=!1,s=e,a=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(r)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=a.resolve(e.start-2);s=new ow(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new ow(e.$from,a.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let o=V2(s,r,n,e);return o?(t&&o_e(t,e,o,i,r),!0):!1}function o_e(t,e,r,n,i){let s=me.empty;for(let d=r.length-1;d>=0;d--)s=me.from(r[d].type.create(r[d].attrs,s));t.step(new dn(e.start-(n?2:0),e.end,e.start,e.end,new Ne(s,0,0),r.length,!0));let a=0;for(let d=0;d<r.length;d++)r[d].type==i&&(a=d+1);let o=r.length-a,c=e.start+r.length-(n?2:0),u=e.parent;for(let d=e.startIndex,f=e.endIndex,p=!0;d<f;d++,p=!1)!p&&Yf(t.doc,c,o)&&(t.split(c,o),c+=2*o),c+=u.child(d).nodeSize;return t}function l_e(t){return function(e,r){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,a=>a.childCount>0&&a.firstChild.type==t);return s?r?n.node(s.depth-1).type==t?c_e(e,r,t,s):u_e(e,r,s):!0:!1}}function c_e(t,e,r,n){let i=t.tr,s=n.end,a=n.$to.end(n.depth);s<a&&(i.step(new dn(s-1,a,s,a,new Ne(me.from(r.create(null,n.parent.copy())),1,0),1,!0)),n=new ow(i.doc.resolve(n.$from.pos),i.doc.resolve(a),n.depth));const o=Op(n);if(o==null)return!1;i.lift(n,o);let c=i.doc.resolve(i.mapping.map(s,-1)-1);return Bc(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),e(i.scrollIntoView()),!0}function u_e(t,e,r){let n=t.tr,i=r.parent;for(let m=r.end,y=r.endIndex-1,v=r.startIndex;y>v;y--)m-=i.child(y).nodeSize,n.delete(m-1,m+1);let s=n.doc.resolve(r.start),a=s.nodeAfter;if(n.mapping.map(r.end)!=r.start+s.nodeAfter.nodeSize)return!1;let o=r.startIndex==0,c=r.endIndex==i.childCount,u=s.node(-1),d=s.index(-1);if(!u.canReplace(d+(o?0:1),d+1,a.content.append(c?me.empty:me.from(i))))return!1;let f=s.pos,p=f+a.nodeSize;return n.step(new dn(f-(o?1:0),p+(c?1:0),f+1,p-1,new Ne((o?me.empty:me.from(i.copy(me.empty))).append(c?me.empty:me.from(i.copy(me.empty))),o?0:1,c?0:1),o?0:1)),e(n.scrollIntoView()),!0}
vendor: 19,183 bytes, lines 708-710
708function d_e(t){return function(e,r){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,u=>u.childCount>0&&u.firstChild.type==t);if(!s)return!1;let a=s.startIndex;if(a==0)return!1;let o=s.parent,c=o.child(a-1);if(c.type!=t)return!1;if(r){let u=c.lastChild&&c.lastChild.type==o.type,d=me.from(u?t.create():null),f=new Ne(me.from(t.create(null,me.from(o.type.create(null,d)))),u?3:1,0),p=s.start,m=s.end;r(e.tr.step(new dn(p-(u?3:1),m,p,m,f,1,!0)).scrollIntoView())}return!0}}function dk(t){const{state:e,transaction:r}=t;let{selection:n}=r,{doc:i}=r,{storedMarks:s}=r;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return n},get doc(){return i},get tr(){return n=r.selection,i=r.doc,s=r.storedMarks,r}}}class fk{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:r,state:n}=this,{view:i}=r,{tr:s}=n,a=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([o,c])=>[o,(...d)=>{const f=c(...d)(a);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,r=!0){const{rawCommands:n,editor:i,state:s}=this,{view:a}=i,o=[],c=!!e,u=e||s.tr,d=()=>(!c&&r&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(u),o.every(p=>p===!0)),f={...Object.fromEntries(Object.entries(n).map(([p,m])=>[p,(...v)=>{const w=this.buildProps(u,r),b=m(...v)(w);return o.push(b),f}])),run:d};return f}createCan(e){const{rawCommands:r,state:n}=this,i=!1,s=e||n.tr,a=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(r).map(([c,u])=>[c,(...d)=>u(...d)({...a,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,r=!0){const{rawCommands:n,editor:i,state:s}=this,{view:a}=i,o={tr:e,editor:i,view:a,state:dk({state:s,transaction:e}),dispatch:r?()=>{}:void 0,chain:()=>this.createChain(e,r),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([c,u])=>[c,(...d)=>u(...d)(o)]))}};return o}}let f_e=class{constructor(){this.callbacks={}}on(e,r){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(r),this}emit(e,...r){const n=this.callbacks[e];return n&&n.forEach(i=>i.apply(this,r)),this}off(e,r){const n=this.callbacks[e];return n&&(r?this.callbacks[e]=n.filter(i=>i!==r):delete this.callbacks[e]),this}once(e,r){const n=(...i)=>{this.off(e,n),r.apply(this,i)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}};function Ae(t,e,r){return t.config[e]===void 0&&t.parent?Ae(t.parent,e,r):typeof t.config[e]=="function"?t.config[e].bind({...r,parent:t.parent?Ae(t.parent,e,r):null}):t.config[e]}function hk(t){const e=t.filter(i=>i.type==="extension"),r=t.filter(i=>i.type==="node"),n=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:r,markExtensions:n}}function SG(t){const e=[],{nodeExtensions:r,markExtensions:n}=hk(t),i=[...r,...n],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(a=>{const o={name:a.name,options:a.options,storage:a.storage,extensions:i},c=Ae(a,"addGlobalAttributes",o);if(!c)return;c().forEach(d=>{d.types.forEach(f=>{Object.entries(d.attributes).forEach(([p,m])=>{e.push({type:f,name:p,attribute:{...s,...m}})})})})}),i.forEach(a=>{const o={name:a.name,options:a.options,storage:a.storage},c=Ae(a,"addAttributes",o);if(!c)return;const u=c();Object.entries(u).forEach(([d,f])=>{const p={...s,...f};typeof(p==null?void 0:p.default)=="function"&&(p.default=p.default()),p!=null&&p.isRequired&&(p==null?void 0:p.default)===void 0&&delete p.default,e.push({type:a.name,name:d,attribute:p})})}),e}function pn(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function mn(...t){return t.filter(e=>!!e).reduce((e,r)=>{const n={...e};return Object.entries(r).forEach(([i,s])=>{if(!n[i]){n[i]=s;return}if(i==="class"){const o=s?String(s).split(" "):[],c=n[i]?n[i].split(" "):[],u=o.filter(d=>!c.includes(d));n[i]=[...c,...u].join(" ")}else if(i==="style"){const o=s?s.split(";").map(d=>d.trim()).filter(Boolean):[],c=n[i]?n[i].split(";").map(d=>d.trim()).filter(Boolean):[],u=new Map;c.forEach(d=>{const[f,p]=d.split(":").map(m=>m.trim());u.set(f,p)}),o.forEach(d=>{const[f,p]=d.split(":").map(m=>m.trim());u.set(f,p)}),n[i]=Array.from(u.entries()).map(([d,f])=>`${d}: ${f}`).join("; ")}else n[i]=s}),n},{})}function PO(t,e){return e.filter(r=>r.type===t.type.name).filter(r=>r.attribute.rendered).map(r=>r.attribute.renderHTML?r.attribute.renderHTML(t.attrs)||{}:{[r.name]:t.attrs[r.name]}).reduce((r,n)=>mn(r,n),{})}function jG(t){return typeof t=="function"}function pt(t,e=void 0,...r){return jG(t)?e?t.bind(e)(...r):t(...r):t}function h_e(t={}){return Object.keys(t).length===0&&t.constructor===Object}function p_e(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function t3(t,e){return"style"in t?t:{...t,getAttrs:r=>{const n=t.getAttrs?t.getAttrs(r):t.attrs;if(n===!1)return!1;const i=e.reduce((s,a)=>{const o=a.attribute.parseHTML?a.attribute.parseHTML(r):p_e(r.getAttribute(a.name));return o==null?s:{...s,[a.name]:o}},{});return{...n,...i}}}}function r3(t){return Object.fromEntries(Object.entries(t).filter(([e,r])=>e==="attrs"&&h_e(r)?!1:r!=null))}function m_e(t,e){var r;const n=SG(t),{nodeExtensions:i,markExtensions:s}=hk(t),a=(r=i.find(u=>Ae(u,"topNode")))===null||r===void 0?void 0:r.name,o=Object.fromEntries(i.map(u=>{const d=n.filter(b=>b.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:e},p=t.reduce((b,_)=>{const S=Ae(_,"extendNodeSchema",f);return{...b,...S?S(u):{}}},{}),m=r3({...p,content:pt(Ae(u,"content",f)),marks:pt(Ae(u,"marks",f)),group:pt(Ae(u,"group",f)),inline:pt(Ae(u,"inline",f)),atom:pt(Ae(u,"atom",f)),selectable:pt(Ae(u,"selectable",f)),draggable:pt(Ae(u,"draggable",f)),code:pt(Ae(u,"code",f)),whitespace:pt(Ae(u,"whitespace",f)),linebreakReplacement:pt(Ae(u,"linebreakReplacement",f)),defining:pt(Ae(u,"defining",f)),isolating:pt(Ae(u,"isolating",f)),attrs:Object.fromEntries(d.map(b=>{var _;return[b.name,{default:(_=b==null?void 0:b.attribute)===null||_===void 0?void 0:_.default}]}))}),y=pt(Ae(u,"parseHTML",f));y&&(m.parseDOM=y.map(b=>t3(b,d)));const v=Ae(u,"renderHTML",f);v&&(m.toDOM=b=>v({node:b,HTMLAttributes:PO(b,d)}));const w=Ae(u,"renderText",f);return w&&(m.toText=w),[u.name,m]})),c=Object.fromEntries(s.map(u=>{const d=n.filter(w=>w.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:e},p=t.reduce((w,b)=>{const _=Ae(b,"extendMarkSchema",f);return{...w,..._?_(u):{}}},{}),m=r3({...p,inclusive:pt(Ae(u,"inclusive",f)),excludes:pt(Ae(u,"excludes",f)),group:pt(Ae(u,"group",f)),spanning:pt(Ae(u,"spanning",f)),code:pt(Ae(u,"code",f)),attrs:Object.fromEntries(d.map(w=>{var b;return[w.name,{default:(b=w==null?void 0:w.attribute)===null||b===void 0?void 0:b.default}]}))}),y=pt(Ae(u,"parseHTML",f));y&&(m.parseDOM=y.map(w=>t3(w,d)));const v=Ae(u,"renderHTML",f);return v&&(m.toDOM=w=>v({mark:w,HTMLAttributes:PO(w,d)})),[u.name,m]}));return new vK({topNode:a,nodes:o,marks:c})}function mN(t,e){return e.nodes[t]||e.marks[t]||null}function n3(t,e){return Array.isArray(e)?e.some(r=>(typeof r=="string"?r:r.name)===t.name):e}function nM(t,e){const r=kd.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(r),i.innerHTML}const g_e=(t,e=500)=>{let r="";const n=t.parentOffset;return t.parent.nodesBetween(Math.max(0,n-e),n,(i,s,a,o)=>{var c,u;const d=((u=(c=i.type.spec).toText)===null||u===void 0?void 0:u.call(c,{node:i,pos:s,parent:a,index:o}))||i.textContent||"%leaf%";r+=i.isAtom&&!i.isText?d:d.slice(0,Math.max(0,n-s))}),r};function iM(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class pk{constructor(e){this.find=e.find,this.handler=e.handler}}const v_e=(t,e)=>{if(iM(e))return e.exec(t);const r=e(t);if(!r)return null;const n=[r.text];return n.index=r.index,n.input=t,n.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),n.push(r.replaceWith)),n};function Xx(t){var e;const{editor:r,from:n,to:i,text:s,rules:a,plugin:o}=t,{view:c}=r;if(c.composing)return!1;const u=c.state.doc.resolve(n);if(u.parent.type.spec.code||!((e=u.nodeBefore||u.nodeAfter)===null||e===void 0)&&e.marks.find(p=>p.type.spec.code))return!1;let d=!1;const f=g_e(u)+s;return a.forEach(p=>{if(d)return;const m=v_e(f,p.find);if(!m)return;const y=c.state.tr,v=dk({state:c.state,transaction:y}),w={from:n-(m[0].length-s.length),to:i},{commands:b,chain:_,can:S}=new fk({editor:r,state:v});p.handler({state:v,range:w,match:m,commands:b,chain:_,can:S})===null||!y.steps.length||(y.setMeta(o,{transform:y,from:n,to:i,text:s}),c.dispatch(y),d=!0)}),d}function y_e(t){const{editor:e,rules:r}=t,n=new gn({state:{init(){return null},apply(i,s,a){const o=i.getMeta(n);if(o)return o;const c=i.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:d}=c;typeof d=="string"?d=d:d=nM(me.from(d),a.schema);const{from:f}=c,p=f+d.length;Xx({editor:e,from:f,to:p,text:d,rules:r,plugin:n})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,a,o){return Xx({editor:e,from:s,to:a,text:o,rules:r,plugin:n})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&Xx({editor:e,from:s.pos,to:s.pos,text:"",rules:r,plugin:n})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?Xx({editor:e,from:a.pos,to:a.pos,text:`
709`,rules:r,plugin:n}):!1}},isInputRules:!0});return n}function x_e(t){return Object.prototype.toString.call(t).slice(8,-1)}function Qx(t){return x_e(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function mk(t,e){const r={...t};return Qx(t)&&Qx(e)&&Object.keys(e).forEach(n=>{Qx(e[n])&&Qx(t[n])?r[n]=mk(t[n],e[n]):r[n]=e[n]}),r}class qo{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=pt(Ae(this,"addOptions",{name:this.name}))),this.storage=pt(Ae(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new qo(e)}configure(e={}){const r=this.extend({...this.config,addOptions:()=>mk(this.options,e)});return r.name=this.name,r.parent=this.parent,r}extend(e={}){const r=new qo(e);return r.parent=this,this.child=r,r.name=e.name?e.name:r.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${r.name}".`),r.options=pt(Ae(r,"addOptions",{name:r.name})),r.storage=pt(Ae(r,"addStorage",{name:r.name,options:r.options})),r}static handleExit({editor:e,mark:r}){const{tr:n}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(u=>(u==null?void 0:u.type.name)===r.name))return!1;const c=a.find(u=>(u==null?void 0:u.type.name)===r.name);return c&&n.removeStoredMark(c),n.insertText(" ",i.pos),e.view.dispatch(n),!0}return!1}}function b_e(t){return typeof t=="number"}class w_e{constructor(e){this.find=e.find,this.handler=e.handler}}const __e=(t,e,r)=>{if(iM(e))return[...t.matchAll(e)];const n=e(t,r);return n?n.map(i=>{const s=[i.text];return s.index=i.index,s.input=t,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 k_e(t){const{editor:e,state:r,from:n,to:i,rule:s,pasteEvent:a,dropEvent:o}=t,{commands:c,chain:u,can:d}=new fk({editor:e,state:r}),f=[];return r.doc.nodesBetween(n,i,(m,y)=>{if(!m.isTextblock||m.type.spec.code)return;const v=Math.max(n,y),w=Math.min(i,y+m.content.size),b=m.textBetween(v-y,w-y,void 0,"");__e(b,s.find,a).forEach(S=>{if(S.index===void 0)return;const N=v+S.index+1,j=N+S[0].length,C={from:r.tr.mapping.map(N),to:r.tr.mapping.map(j)},O=s.handler({state:r,range:C,match:S,commands:c,chain:u,can:d,pasteEvent:a,dropEvent:o});f.push(O)})}),f.every(m=>m!==null)}let eb=null;const S_e=t=>{var e;const r=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=r.clipboardData)===null||e===void 0||e.setData("text/html",t),r};function j_e(t){const{editor:e,rules:r}=t;let n=null,i=!1,s=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,o;try{o=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{o=null}const c=({state:d,from:f,to:p,rule:m,pasteEvt:y})=>{const v=d.tr,w=dk({state:d,transaction:v});if(!(!k_e({editor:e,state:w,from:Math.max(f-1,0),to:p.b-1,rule:m,pasteEvent:y,dropEvent:o})||!v.steps.length)){try{o=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{o=null}return a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,v}};return r.map(d=>new gn({view(f){const p=y=>{var v;n=!((v=f.dom.parentElement)===null||v===void 0)&&v.contains(y.target)?f.dom.parentElement:null,n&&(eb=e)},m=()=>{eb&&(eb=null)};return window.addEventListener("dragstart",p),window.addEventListener("dragend",m),{destroy(){window.removeEventListener("dragstart",p),window.removeEventListener("dragend",m)}}},props:{handleDOMEvents:{drop:(f,p)=>{if(s=n===f.dom.parentElement,o=p,!s){const m=eb;m!=null&&m.isEditable&&setTimeout(()=>{const y=m.state.selection;y&&m.commands.deleteRange({from:y.from,to:y.to})},10)}return!1},paste:(f,p)=>{var m;const y=(m=p.clipboardData)===null||m===void 0?void 0:m.getData("text/html");return a=p,i=!!(y!=null&&y.includes("data-pm-slice")),!1}}},appendTransaction:(f,p,m)=>{const y=f[0],v=y.getMeta("uiEvent")==="paste"&&!i,w=y.getMeta("uiEvent")==="drop"&&!s,b=y.getMeta("applyPasteRules"),_=!!b;if(!v&&!w&&!_)return;if(_){let{text:j}=b;typeof j=="string"?j=j:j=nM(me.from(j),m.schema);const{from:C}=b,O=C+j.length,P=S_e(j);return c({rule:d,state:m,from:C,to:{b:O},pasteEvt:P})}const S=p.doc.content.findDiffStart(m.doc.content),N=p.doc.content.findDiffEnd(m.doc.content);if(!(!b_e(S)||!N||S===N.b))return c({rule:d,state:m,from:S,to:N,pasteEvt:a})}}))}function N_e(t){const e=t.filter((r,n)=>t.indexOf(r)!==n);return Array.from(new Set(e))}class Af{constructor(e,r){this.splittableMarks=[],this.editor=r,this.extensions=Af.resolve(e),this.schema=m_e(this.extensions,r),this.setupExtensions()}static resolve(e){const r=Af.sort(Af.flatten(e)),n=N_e(r.map(i=>i.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),r}static flatten(e){return e.map(r=>{const n={name:r.name,options:r.options,storage:r.storage},i=Ae(r,"addExtensions",n);return i?[r,...this.flatten(i())]:r}).flat(10)}static sort(e){return e.sort((n,i)=>{const s=Ae(n,"priority")||100,a=Ae(i,"priority")||100;return s>a?-1:s<a?1:0})}get commands(){return this.extensions.reduce((e,r)=>{const n={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:mN(r.name,this.schema)},i=Ae(r,"addCommands",n);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,r=Af.sort([...this.extensions].reverse()),n=[],i=[],s=r.map(a=>{const o={name:a.name,options:a.options,storage:a.storage,editor:e,type:mN(a.name,this.schema)},c=[],u=Ae(a,"addKeyboardShortcuts",o);let d={};if(a.type==="mark"&&Ae(a,"exitable",o)&&(d.ArrowRight=()=>qo.handleExit({editor:e,mark:a})),u){const v=Object.fromEntries(Object.entries(u()).map(([w,b])=>[w,()=>b({editor:e})]));d={...d,...v}}const f=B1e(d);c.push(f);const p=Ae(a,"addInputRules",o);n3(a,e.options.enableInputRules)&&p&&n.push(...p());const m=Ae(a,"addPasteRules",o);n3(a,e.options.enablePasteRules)&&m&&i.push(...m());const y=Ae(a,"addProseMirrorPlugins",o);if(y){const v=y();c.push(...v)}return c}).flat();return[y_e({editor:e,rules:n}),...j_e({editor:e,rules:i}),...s]}get attributes(){return SG(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:r}=hk(this.extensions);return Object.fromEntries(r.filter(n=>!!Ae(n,"addNodeView")).map(n=>{const i=this.attributes.filter(c=>c.type===n.name),s={name:n.name,options:n.options,storage:n.storage,editor:e,type:pn(n.name,this.schema)},a=Ae(n,"addNodeView",s);if(!a)return[];const o=(c,u,d,f,p)=>{const m=PO(c,i);return a()({node:c,view:u,getPos:d,decorations:f,innerDecorations:p,editor:e,extension:n,HTMLAttributes:m})};return[n.name,o]}))}setupExtensions(){this.extensions.forEach(e=>{var r;this.editor.extensionStorage[e.name]=e.storage;const n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:mN(e.name,this.schema)};e.type==="mark"&&(!((r=pt(Ae(e,"keepOnSplit",n)))!==null&&r!==void 0)||r)&&this.splittableMarks.push(e.name);const i=Ae(e,"onBeforeCreate",n),s=Ae(e,"onCreate",n),a=Ae(e,"onUpdate",n),o=Ae(e,"onSelectionUpdate",n),c=Ae(e,"onTransaction",n),u=Ae(e,"onFocus",n),d=Ae(e,"onBlur",n),f=Ae(e,"onDestroy",n);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),a&&this.editor.on("update",a),o&&this.editor.on("selectionUpdate",o),c&&this.editor.on("transaction",c),u&&this.editor.on("focus",u),d&&this.editor.on("blur",d),f&&this.editor.on("destroy",f)})}}class qn{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=pt(Ae(this,"addOptions",{name:this.name}))),this.storage=pt(Ae(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new qn(e)}configure(e={}){const r=this.extend({...this.config,addOptions:()=>mk(this.options,e)});return r.name=this.name,r.parent=this.parent,r}extend(e={}){const r=new qn({...this.config,...e});return r.parent=this,this.child=r,r.name=e.name?e.name:r.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${r.name}".`),r.options=pt(Ae(r,"addOptions",{name:r.name})),r.storage=pt(Ae(r,"addStorage",{name:r.name,options:r.options})),r}}function NG(t,e,r){const{from:n,to:i}=e,{blockSeparator:s=`
710
711`,textSerializers:a={}}=r||{};let o="";return t.nodesBetween(n,i,(c,u,d,f)=>{var p;c.isBlock&&u>n&&(o+=s);const m=a==null?void 0:a[c.type.name];if(m)return d&&(o+=m({node:c,pos:u,parent:d,index:f,range:e})),!1;c.isText&&(o+=(p=c==null?void 0:c.text)===null||p===void 0?void 0:p.slice(Math.max(n,u)-u,i-u))}),o}function CG(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,r])=>[e,r.spec.toText]))}const C_e=qn.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new gn({key:new Pi("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:r}=t,{doc:n,selection:i}=e,{ranges:s}=i,a=Math.min(...s.map(d=>d.$from.pos)),o=Math.max(...s.map(d=>d.$to.pos)),c=CG(r);return NG(n,{from:a,to:o},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),E_e=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var r;t.isDestroyed||(e.dom.blur(),(r=window==null?void 0:window.getSelection())===null||r===void 0||r.removeAllRanges())}),!0),O_e=(t=!1)=>({commands:e})=>e.setContent("",t),T_e=()=>({state:t,tr:e,dispatch:r})=>{const{selection:n}=e,{ranges:i}=n;return r&&i.forEach(({$from:s,$to:a})=>{t.doc.nodesBetween(s.pos,a.pos,(o,c)=>{if(o.type.isText)return;const{doc:u,mapping:d}=e,f=u.resolve(d.map(c)),p=u.resolve(d.map(c+o.nodeSize)),m=f.blockRange(p);if(!m)return;const y=Op(m);if(o.type.isTextblock){const{defaultType:v}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(m.start,v)}(y||y===0)&&e.lift(m,y)})}),!0},A_e=t=>e=>t(e),P_e=()=>({state:t,dispatch:e})=>X1e(t,e),M_e=(t,e)=>({editor:r,tr:n})=>{const{state:i}=r,s=i.doc.slice(t.from,t.to);n.deleteRange(t.from,t.to);const a=n.mapping.map(e);return n.insert(a,s.content),n.setSelection(new Qe(n.doc.resolve(Math.max(a-1,0)))),!0},R_e=()=>({tr:t,dispatch:e})=>{const{selection:r}=t,n=r.$anchor.node();if(n.content.size>0)return!1;const i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===n.type){if(e){const o=i.before(s),c=i.after(s);t.delete(o,c).scrollIntoView()}return!0}return!1},I_e=t=>({tr:e,state:r,dispatch:n})=>{const i=pn(t,r.schema),s=e.selection.$anchor;for(let a=s.depth;a>0;a-=1)if(s.node(a).type===i){if(n){const c=s.before(a),u=s.after(a);e.delete(c,u).scrollIntoView()}return!0}return!1},L_e=t=>({tr:e,dispatch:r})=>{const{from:n,to:i}=t;return r&&e.delete(n,i),!0},$_e=()=>({state:t,dispatch:e})=>F1e(t,e),D_e=()=>({commands:t})=>t.keyboardShortcut("Enter"),B_e=()=>({state:t,dispatch:e})=>Y1e(t,e);function mw(t,e,r={strict:!0}){const n=Object.keys(e);return n.length?n.every(i=>r.strict?e[i]===t[i]:iM(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function EG(t,e,r={}){return t.find(n=>n.type===e&&mw(Object.fromEntries(Object.keys(r).map(i=>[i,n.attrs[i]])),r))}function i3(t,e,r={}){return!!EG(t,e,r)}function sM(t,e,r){var n;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(d=>d.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(d=>d.type===e)||(r=r||((n=i.node.marks[0])===null||n===void 0?void 0:n.attrs),!EG([...i.node.marks],e,r)))return;let a=i.index,o=t.start()+i.offset,c=a+1,u=o+i.node.nodeSize;for(;a>0&&i3([...t.parent.child(a-1).marks],e,r);)a-=1,o-=t.parent.child(a).nodeSize;for(;c<t.parent.childCount&&i3([...t.parent.child(c).marks],e,r);)u+=t.parent.child(c).nodeSize,c+=1;return{from:o,to:u}}function zc(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const F_e=(t,e={})=>({tr:r,state:n,dispatch:i})=>{const s=zc(t,n.schema),{doc:a,selection:o}=r,{$from:c,from:u,to:d}=o;if(i){const f=sM(c,s,e);if(f&&f.from<=u&&f.to>=d){const p=Qe.create(a,f.from,f.to);r.setSelection(p)}}return!0},z_e=t=>e=>{const r=typeof t=="function"?t(e):t;for(let n=0;n<r.length;n+=1)if(r[n](e))return!0;return!1};function OG(t){return t instanceof Qe}function ku(t=0,e=0,r=0){return Math.min(Math.max(t,e),r)}function TG(t,e=null){if(!e)return null;const r=dt.atStart(t),n=dt.atEnd(t);if(e==="start"||e===!0)return r;if(e==="end")return n;const i=r.from,s=n.to;return e==="all"?Qe.create(t,ku(0,i,s),ku(t.content.size,i,s)):Qe.create(t,ku(e,i,s),ku(e,i,s))}function s3(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function gw(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function U_e(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const H_e=(t=null,e={})=>({editor:r,view:n,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const a=()=>{(gw()||s3())&&n.dom.focus(),requestAnimationFrame(()=>{r.isDestroyed||(n.focus(),U_e()&&!gw()&&!s3()&&n.dom.focus({preventScroll:!0}))})};if(n.hasFocus()&&t===null||t===!1)return!0;
vendor: 14,339 bytes, line 711
711if(s&&t===null&&!OG(r.state.selection))return a(),!0;const o=TG(i.doc,t)||r.state.selection,c=r.state.selection.eq(o);return s&&(c||i.setSelection(o),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},V_e=(t,e)=>r=>t.every((n,i)=>e(n,{...r,index:i})),W_e=(t,e)=>({tr:r,commands:n})=>n.insertContentAt({from:r.selection.from,to:r.selection.to},t,e),AG=t=>{const e=t.childNodes;for(let r=e.length-1;r>=0;r-=1){const n=e[r];n.nodeType===3&&n.nodeValue&&/^(\n\s\s|\n)$/.test(n.nodeValue)?t.removeChild(n):n.nodeType===1&&AG(n)}return t};function tb(t){const e=`<body>${t}</body>`,r=new window.DOMParser().parseFromString(e,"text/html").body;return AG(r)}function yv(t,e,r){if(t instanceof oc||t instanceof me)return t;r={slice:!0,parseOptions:{},...r};const n=typeof t=="object"&&t!==null,i=typeof t=="string";if(n)try{if(Array.isArray(t)&&t.length>0)return me.fromArray(t.map(o=>e.nodeFromJSON(o)));const a=e.nodeFromJSON(t);return r.errorOnInvalidContent&&a.check(),a}catch(s){if(r.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),yv("",e,r)}if(i){if(r.errorOnInvalidContent){let a=!1,o="";const c=new vK({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(a=!0,o=typeof u=="string"?u:u.outerHTML,null)}]}})});if(r.slice?lc.fromSchema(c).parseSlice(tb(t),r.parseOptions):lc.fromSchema(c).parse(tb(t),r.parseOptions),r.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${o}`)})}const s=lc.fromSchema(e);return r.slice?s.parseSlice(tb(t),r.parseOptions).content:s.parse(tb(t),r.parseOptions)}return yv("",e,r)}function q_e(t,e,r){const n=t.steps.length-1;if(n<e)return;const i=t.steps[n];if(!(i instanceof Fr||i instanceof dn))return;const s=t.mapping.maps[n];let a=0;s.forEach((o,c,u,d)=>{a===0&&(a=d)}),t.setSelection(dt.near(t.doc.resolve(a),r))}const K_e=t=>!("type"in t),G_e=(t,e,r)=>({tr:n,dispatch:i,editor:s})=>{var a;if(i){r={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...r};let o;const c=w=>{s.emit("contentError",{editor:s,error:w,disableCollaboration:()=>{s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...r.parseOptions};if(!r.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{yv(e,s.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(w){c(w)}try{o=yv(e,s.schema,{parseOptions:u,errorOnInvalidContent:(a=r.errorOnInvalidContent)!==null&&a!==void 0?a:s.options.enableContentCheck})}catch(w){return c(w),!1}let{from:d,to:f}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},p=!0,m=!0;if((K_e(o)?o:[o]).forEach(w=>{w.check(),p=p?w.isText&&w.marks.length===0:!1,m=m?w.isBlock:!1}),d===f&&m){const{parent:w}=n.doc.resolve(d);w.isTextblock&&!w.type.spec.code&&!w.childCount&&(d-=1,f+=1)}let v;if(p){if(Array.isArray(e))v=e.map(w=>w.text||"").join("");else if(e instanceof me){let w="";e.forEach(b=>{b.text&&(w+=b.text)}),v=w}else typeof e=="object"&&e&&e.text?v=e.text:v=e;n.insertText(v,d,f)}else v=o,n.replaceWith(d,f,v);r.updateSelection&&q_e(n,n.steps.length-1,-1),r.applyInputRules&&n.setMeta("applyInputRules",{from:d,text:v}),r.applyPasteRules&&n.setMeta("applyPasteRules",{from:d,text:v})}return!0},Z_e=()=>({state:t,dispatch:e})=>K1e(t,e),J_e=()=>({state:t,dispatch:e})=>G1e(t,e),Y_e=()=>({state:t,dispatch:e})=>z1e(t,e),X_e=()=>({state:t,dispatch:e})=>W1e(t,e),Q_e=()=>({state:t,dispatch:e,tr:r})=>{try{const n=sk(t.doc,t.selection.$from.pos,-1);return n==null?!1:(r.join(n,2),e&&e(r),!0)}catch{return!1}},eke=()=>({state:t,dispatch:e,tr:r})=>{try{const n=sk(t.doc,t.selection.$from.pos,1);return n==null?!1:(r.join(n,2),e&&e(r),!0)}catch{return!1}},tke=()=>({state:t,dispatch:e})=>U1e(t,e),rke=()=>({state:t,dispatch:e})=>H1e(t,e);function PG(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function nke(t){const e=t.split(/-(?!$)/);let r=e[e.length-1];r==="Space"&&(r=" ");let n,i,s,a;for(let o=0;o<e.length-1;o+=1){const c=e[o];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))n=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))gw()||PG()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return n&&(r=`Alt-${r}`),i&&(r=`Ctrl-${r}`),a&&(r=`Meta-${r}`),s&&(r=`Shift-${r}`),r}const ike=t=>({editor:e,view:r,tr:n,dispatch:i})=>{const s=nke(t).split(/-(?!$)/),a=s.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),o=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{r.someProp("handleKeyDown",u=>u(r,o))});return c==null||c.steps.forEach(u=>{const d=u.map(n.mapping);d&&i&&n.maybeStep(d)}),!0};function xv(t,e,r={}){const{from:n,to:i,empty:s}=t.selection,a=e?pn(e,t.schema):null,o=[];t.doc.nodesBetween(n,i,(f,p)=>{if(f.isText)return;const m=Math.max(n,p),y=Math.min(i,p+f.nodeSize);o.push({node:f,from:m,to:y})});const c=i-n,u=o.filter(f=>a?a.name===f.node.type.name:!0).filter(f=>mw(f.node.attrs,r,{strict:!1}));return s?!!u.length:u.reduce((f,p)=>f+p.to-p.from,0)>=c}const ske=(t,e={})=>({state:r,dispatch:n})=>{const i=pn(t,r.schema);return xv(r,i,e)?Z1e(r,n):!1},ake=()=>({state:t,dispatch:e})=>Q1e(t,e),oke=t=>({state:e,dispatch:r})=>{const n=pn(t,e.schema);return l_e(n)(e,r)},lke=()=>({state:t,dispatch:e})=>J1e(t,e);function gk(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function a3(t,e){const r=typeof e=="string"?[e]:e;return Object.keys(t).reduce((n,i)=>(r.includes(i)||(n[i]=t[i]),n),{})}const cke=(t,e)=>({tr:r,state:n,dispatch:i})=>{let s=null,a=null;const o=gk(typeof t=="string"?t:t.name,n.schema);return o?(o==="node"&&(s=pn(t,n.schema)),o==="mark"&&(a=zc(t,n.schema)),i&&r.selection.ranges.forEach(c=>{n.doc.nodesBetween(c.$from.pos,c.$to.pos,(u,d)=>{s&&s===u.type&&r.setNodeMarkup(d,void 0,a3(u.attrs,e)),a&&u.marks.length&&u.marks.forEach(f=>{a===f.type&&r.addMark(d,d+u.nodeSize,a.create(a3(f.attrs,e)))})})}),!0):!1},uke=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),dke=()=>({tr:t,dispatch:e})=>{if(e){const r=new Cs(t.doc);t.setSelection(r)}return!0},fke=()=>({state:t,dispatch:e})=>V1e(t,e),hke=()=>({state:t,dispatch:e})=>q1e(t,e),pke=()=>({state:t,dispatch:e})=>e_e(t,e),mke=()=>({state:t,dispatch:e})=>n_e(t,e),gke=()=>({state:t,dispatch:e})=>r_e(t,e);function MO(t,e,r={},n={}){return yv(t,e,{slice:!1,parseOptions:r,errorOnInvalidContent:n.errorOnInvalidContent})}const vke=(t,e=!1,r={},n={})=>({editor:i,tr:s,dispatch:a,commands:o})=>{var c,u;const{doc:d}=s;if(r.preserveWhitespace!=="full"){const f=MO(t,i.schema,r,{errorOnInvalidContent:(c=n.errorOnInvalidContent)!==null&&c!==void 0?c:i.options.enableContentCheck});return a&&s.replaceWith(0,d.content.size,f).setMeta("preventUpdate",!e),!0}return a&&s.setMeta("preventUpdate",!e),o.insertContentAt({from:0,to:d.content.size},t,{parseOptions:r,errorOnInvalidContent:(u=n.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck})};function MG(t,e){const r=zc(e,t.schema),{from:n,to:i,empty:s}=t.selection,a=[];s?(t.storedMarks&&a.push(...t.storedMarks),a.push(...t.selection.$head.marks())):t.doc.nodesBetween(n,i,c=>{a.push(...c.marks)});const o=a.find(c=>c.type.name===r.name);return o?{...o.attrs}:{}}function yke(t,e){const r=new MK(t);return e.forEach(n=>{n.steps.forEach(i=>{r.step(i)})}),r}function xke(t){for(let e=0;e<t.edgeCount;e+=1){const{type:r}=t.edge(e);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}function bke(t,e,r){const n=[];return t.nodesBetween(e.from,e.to,(i,s)=>{r(i)&&n.push({node:i,pos:s})}),n}function wke(t,e){for(let r=t.depth;r>0;r-=1){const n=t.node(r);if(e(n))return{pos:r>0?t.before(r):0,start:t.start(r),depth:r,node:n}}}function aM(t){return e=>wke(e.$from,t)}function _ke(t,e){const r={from:0,to:t.content.size};return NG(t,r,e)}function kke(t,e){const r=pn(e,t.schema),{from:n,to:i}=t.selection,s=[];t.doc.nodesBetween(n,i,o=>{s.push(o)});const a=s.reverse().find(o=>o.type.name===r.name);return a?{...a.attrs}:{}}function RG(t,e){const r=gk(typeof e=="string"?e:e.name,t.schema);return r==="node"?kke(t,e):r==="mark"?MG(t,e):{}}function Ske(t,e=JSON.stringify){const r={};return t.filter(n=>{const i=e(n);return Object.prototype.hasOwnProperty.call(r,i)?!1:r[i]=!0})}function jke(t){const e=Ske(t);return e.length===1?e:e.filter((r,n)=>!e.filter((s,a)=>a!==n).some(s=>r.oldRange.from>=s.oldRange.from&&r.oldRange.to<=s.oldRange.to&&r.newRange.from>=s.newRange.from&&r.newRange.to<=s.newRange.to))}function Nke(t){const{mapping:e,steps:r}=t,n=[];return e.maps.forEach((i,s)=>{const a=[];if(i.ranges.length)i.forEach((o,c)=>{a.push({from:o,to:c})});else{const{from:o,to:c}=r[s];if(o===void 0||c===void 0)return;a.push({from:o,to:c})}a.forEach(({from:o,to:c})=>{const u=e.slice(s).map(o,-1),d=e.slice(s).map(c),f=e.invert().map(u,-1),p=e.invert().map(d);n.push({oldRange:{from:f,to:p},newRange:{from:u,to:d}})})}),jke(n)}function oM(t,e,r){const n=[];return t===e?r.resolve(t).marks().forEach(i=>{const s=r.resolve(t),a=sM(s,i.type);a&&n.push({mark:i,...a})}):r.nodesBetween(t,e,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||n.push(...i.marks.map(a=>({from:s,to:s+i.nodeSize,mark:a})))}),n}function Gb(t,e,r){return Object.fromEntries(Object.entries(r).filter(([n])=>{const i=t.find(s=>s.type===e&&s.name===n);return i?i.attribute.keepOnSplit:!1}))}function RO(t,e,r={}){const{empty:n,ranges:i}=t.selection,s=e?zc(e,t.schema):null;if(n)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>s?s.name===f.type.name:!0).find(f=>mw(f.attrs,r,{strict:!1}));let a=0;const o=[];if(i.forEach(({$from:f,$to:p})=>{const m=f.pos,y=p.pos;t.doc.nodesBetween(m,y,(v,w)=>{if(!v.isText&&!v.marks.length)return;const b=Math.max(m,w),_=Math.min(y,w+v.nodeSize),S=_-b;a+=S,o.push(...v.marks.map(N=>({mark:N,from:b,to:_})))})}),a===0)return!1;const c=o.filter(f=>s?s.name===f.mark.type.name:!0).filter(f=>mw(f.mark.attrs,r,{strict:!1})).reduce((f,p)=>f+p.to-p.from,0),u=o.filter(f=>s?f.mark.type!==s&&f.mark.type.excludes(s):!0).reduce((f,p)=>f+p.to-p.from,0);return(c>0?c+u:c)>=a}function Cke(t,e,r={}){if(!e)return xv(t,null,r)||RO(t,null,r);const n=gk(e,t.schema);return n==="node"?xv(t,e,r):n==="mark"?RO(t,e,r):!1}function o3(t,e){const{nodeExtensions:r}=hk(e),n=r.find(a=>a.name===t);if(!n)return!1;const i={name:n.name,options:n.options,storage:n.storage},s=pt(Ae(n,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function vk(t,{checkChildren:e=!0,ignoreWhitespace:r=!1}={}){var n;if(r){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((n=t.text)!==null&&n!==void 0?n:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(s=>{i!==!1&&(vk(s,{ignoreWhitespace:r,checkChildren:e})||(i=!1))}),i}return!1}function Eke(t){return t instanceof Ue}function Oke(t,e,r){var n;const{selection:i}=e;let s=null;if(OG(i)&&(s=i.$cursor),s){const o=(n=t.storedMarks)!==null&&n!==void 0?n:s.marks();return!!r.isInSet(o)||!o.some(c=>c.type.excludes(r))}const{ranges:a}=i;return a.some(({$from:o,$to:c})=>{let u=o.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(r):!1;return t.doc.nodesBetween(o.pos,c.pos,(d,f,p)=>{if(u)return!1;if(d.isInline){const m=!p||p.type.allowsMarkType(r),y=!!r.isInSet(d.marks)||!d.marks.some(v=>v.type.excludes(r));u=m&&y}return!u}),u})}const Tke=(t,e={})=>({tr:r,state:n,dispatch:i})=>{const{selection:s}=r,{empty:a,ranges:o}=s,c=zc(t,n.schema);if(i)if(a){const u=MG(n,c);r.addStoredMark(c.create({...u,...e}))}else o.forEach(u=>{const d=u.$from.pos,f=u.$to.pos;n.doc.nodesBetween(d,f,(p,m)=>{const y=Math.max(m,d),v=Math.min(m+p.nodeSize,f);p.marks.find(b=>b.type===c)?p.marks.forEach(b=>{c===b.type&&r.addMark(y,v,c.create({...b.attrs,...e}))}):r.addMark(y,v,c.create(e))})});return Oke(n,r,c)},Ake=(t,e)=>({tr:r})=>(r.setMeta(t,e),!0),Pke=(t,e={})=>({state:r,dispatch:n,chain:i})=>{const s=pn(t,r.schema);let a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:o})=>e3(s,{...a,...e})(r)?!0:o.clearNodes()).command(({state:o})=>e3(s,{...a,...e})(o,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Mke=t=>({tr:e,dispatch:r})=>{if(r){const{doc:n}=e,i=ku(t,0,n.content.size),s=Ue.create(n,i);e.setSelection(s)}return!0},Rke=t=>({tr:e,dispatch:r})=>{if(r){const{doc:n}=e,{from:i,to:s}=typeof t=="number"?{from:t,to:t}:t,a=Qe.atStart(n).from,o=Qe.atEnd(n).to,c=ku(i,a,o),u=ku(s,a,o),d=Qe.create(n,c,u);e.setSelection(d)}return!0},Ike=t=>({state:e,dispatch:r})=>{const n=pn(t,e.schema);return d_e(n)(e,r)};function l3(t,e){const r=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(r){const n=r.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(n)}}const Lke=({keepMarks:t=!0}={})=>({tr:e,state:r,dispatch:n,editor:i})=>{const{selection:s,doc:a}=e,{$from:o,$to:c}=s,u=i.extensionManager.attributes,d=Gb(u,o.node().type.name,o.node().attrs);if(s instanceof Ue&&s.node.isBlock)return!o.parentOffset||!Yf(a,o.pos)?!1:(n&&(t&&l3(r,i.extensionManager.splittableMarks),e.split(o.pos).scrollIntoView()),!0);if(!o.parent.isBlock)return!1;const f=c.parentOffset===c.parent.content.size,p=o.depth===0?void 0:xke(o.node(-1).contentMatchAt(o.indexAfter(-1)));let m=f&&p?[{type:p,attrs:d}]:void 0,y=Yf(e.doc,e.mapping.map(o.pos),1,m);if(!m&&!y&&Yf(e.doc,e.mapping.map(o.pos),1,p?[{type:p}]:void 0)&&(y=!0,m=p?[{type:p,attrs:d}]:void 0),n){if(y&&(s instanceof Qe&&e.deleteSelection(),e.split(e.mapping.map(o.pos),1,m),p&&!f&&!o.parentOffset&&o.parent.type!==p)){const v=e.mapping.map(o.before()),w=e.doc.resolve(v);o.node(-1).canReplaceWith(w.index(),w.index()+1,p)&&e.setNodeMarkup(e.mapping.map(o.before()),p)}t&&l3(r,i.extensionManager.splittableMarks),e.scrollIntoView()}return y},$ke=(t,e={})=>({tr:r,state:n,dispatch:i,editor:s})=>{var a;const o=pn(t,n.schema),{$from:c,$to:u}=n.selection,d=n.selection.node;
vendor: 4,545 bytes, line 711
711if(d&&d.isBlock||c.depth<2||!c.sameParent(u))return!1;const f=c.node(-1);if(f.type!==o)return!1;const p=s.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==o||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let b=me.empty;const _=c.index(-1)?1:c.index(-2)?2:3;for(let P=c.depth-_;P>=c.depth-3;P-=1)b=me.from(c.node(P).copy(b));const S=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,N={...Gb(p,c.node().type.name,c.node().attrs),...e},j=((a=o.contentMatch.defaultType)===null||a===void 0?void 0:a.createAndFill(N))||void 0;b=b.append(me.from(o.createAndFill(null,j)||void 0));const C=c.before(c.depth-(_-1));r.replace(C,c.after(-S),new Ne(b,4-_,0));let O=-1;r.doc.nodesBetween(C,r.doc.content.size,(P,T)=>{if(O>-1)return!1;P.isTextblock&&P.content.size===0&&(O=T+1)}),O>-1&&r.setSelection(Qe.near(r.doc.resolve(O))),r.scrollIntoView()}return!0}const m=u.pos===c.end()?f.contentMatchAt(0).defaultType:null,y={...Gb(p,f.type.name,f.attrs),...e},v={...Gb(p,c.node().type.name,c.node().attrs),...e};r.delete(c.pos,u.pos);const w=m?[{type:o,attrs:y},{type:m,attrs:v}]:[{type:o,attrs:y}];if(!Yf(r.doc,c.pos,2))return!1;if(i){const{selection:b,storedMarks:_}=n,{splittableMarks:S}=s.extensionManager,N=_||b.$to.parentOffset&&b.$from.marks();if(r.split(c.pos,2,w).scrollIntoView(),!N||!i)return!0;const j=N.filter(C=>S.includes(C.type.name));r.ensureMarks(j)}return!0},gN=(t,e)=>{const r=aM(a=>a.type===e)(t.selection);if(!r)return!0;const n=t.doc.resolve(Math.max(0,r.pos-1)).before(r.depth);if(n===void 0)return!0;const i=t.doc.nodeAt(n);return r.node.type===(i==null?void 0:i.type)&&Bc(t.doc,r.pos)&&t.join(r.pos),!0},vN=(t,e)=>{const r=aM(a=>a.type===e)(t.selection);if(!r)return!0;const n=t.doc.resolve(r.start).after(r.depth);if(n===void 0)return!0;const i=t.doc.nodeAt(n);return r.node.type===(i==null?void 0:i.type)&&Bc(t.doc,n)&&t.join(n),!0},Dke=(t,e,r,n={})=>({editor:i,tr:s,state:a,dispatch:o,chain:c,commands:u,can:d})=>{const{extensions:f,splittableMarks:p}=i.extensionManager,m=pn(t,a.schema),y=pn(e,a.schema),{selection:v,storedMarks:w}=a,{$from:b,$to:_}=v,S=b.blockRange(_),N=w||v.$to.parentOffset&&v.$from.marks();if(!S)return!1;const j=aM(C=>o3(C.type.name,f))(v);if(S.depth>=1&&j&&S.depth-j.depth<=1){if(j.node.type===m)return u.liftListItem(y);if(o3(j.node.type.name,f)&&m.validContent(j.node.content)&&o)return c().command(()=>(s.setNodeMarkup(j.pos,m),!0)).command(()=>gN(s,m)).command(()=>vN(s,m)).run()}return!r||!N||!o?c().command(()=>d().wrapInList(m,n)?!0:u.clearNodes()).wrapInList(m,n).command(()=>gN(s,m)).command(()=>vN(s,m)).run():c().command(()=>{const C=d().wrapInList(m,n),O=N.filter(P=>p.includes(P.type.name));return s.ensureMarks(O),C?!0:u.clearNodes()}).wrapInList(m,n).command(()=>gN(s,m)).command(()=>vN(s,m)).run()},Bke=(t,e={},r={})=>({state:n,commands:i})=>{const{extendEmptyMarkRange:s=!1}=r,a=zc(t,n.schema);return RO(n,a,e)?i.unsetMark(a,{extendEmptyMarkRange:s}):i.setMark(a,e)},Fke=(t,e,r={})=>({state:n,commands:i})=>{const s=pn(t,n.schema),a=pn(e,n.schema),o=xv(n,s,r);let c;return n.selection.$anchor.sameParent(n.selection.$head)&&(c=n.selection.$anchor.parent.attrs),o?i.setNode(a,c):i.setNode(s,{...c,...r})},zke=(t,e={})=>({state:r,commands:n})=>{const i=pn(t,r.schema);return xv(r,i,e)?n.lift(i):n.wrapIn(i,e)},Uke=()=>({state:t,dispatch:e})=>{const r=t.plugins;for(let n=0;n<r.length;n+=1){const i=r[n];let s;if(i.spec.isInputRules&&(s=i.getState(t))){if(e){const a=t.tr,o=s.transform;for(let c=o.steps.length-1;c>=0;c-=1)a.step(o.steps[c].invert(o.docs[c]));if(s.text){const c=a.doc.resolve(s.from).marks();a.replaceWith(s.from,s.to,t.schema.text(s.text,c))}else a.delete(s.from,s.to)}return!0}}return!1},Hke=()=>({tr:t,dispatch:e})=>{const{selection:r}=t,{empty:n,ranges:i}=r;return n||e&&i.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},Vke=(t,e={})=>({tr:r,state:n,dispatch:i})=>{var s;const{extendEmptyMarkRange:a=!1}=e,{selection:o}=r,c=zc(t,n.schema),{$from:u,empty:d,ranges:f}=o;if(!i)return!0;if(d&&a){let{from:p,to:m}=o;const y=(s=u.marks().find(w=>w.type===c))===null||s===void 0?void 0:s.attrs,v=sM(u,c,y);v&&(p=v.from,m=v.to),r.removeMark(p,m,c)}else f.forEach(p=>{r.removeMark(p.$from.pos,p.$to.pos,c)});return r.removeStoredMark(c),!0},Wke=(t,e={})=>({tr:r,state:n,dispatch:i})=>{let s=null,a=null;const o=gk(typeof t=="string"?t:t.name,n.schema);return o?(o==="node"&&(s=pn(t,n.schema)),o==="mark"&&(a=zc(t,n.schema)),i&&r.selection.ranges.forEac
vendor: 8,507 bytes, lines 711-751
711h(c=>{const u=c.$from.pos,d=c.$to.pos;let f,p,m,y;r.selection.empty?n.doc.nodesBetween(u,d,(v,w)=>{s&&s===v.type&&(m=Math.max(w,u),y=Math.min(w+v.nodeSize,d),f=w,p=v)}):n.doc.nodesBetween(u,d,(v,w)=>{w<u&&s&&s===v.type&&(m=Math.max(w,u),y=Math.min(w+v.nodeSize,d),f=w,p=v),w>=u&&w<=d&&(s&&s===v.type&&r.setNodeMarkup(w,void 0,{...v.attrs,...e}),a&&v.marks.length&&v.marks.forEach(b=>{if(a===b.type){const _=Math.max(w,u),S=Math.min(w+v.nodeSize,d);r.addMark(_,S,a.create({...b.attrs,...e}))}}))}),p&&(f!==void 0&&r.setNodeMarkup(f,void 0,{...p.attrs,...e}),a&&p.marks.length&&p.marks.forEach(v=>{a===v.type&&r.addMark(m,y,a.create({...v.attrs,...e}))}))}),!0):!1},qke=(t,e={})=>({state:r,dispatch:n})=>{const i=pn(t,r.schema);return i_e(i,e)(r,n)},Kke=(t,e={})=>({state:r,dispatch:n})=>{const i=pn(t,r.schema);return s_e(i,e)(r,n)};var Gke=Object.freeze({__proto__:null,blur:E_e,clearContent:O_e,clearNodes:T_e,command:A_e,createParagraphNear:P_e,cut:M_e,deleteCurrentNode:R_e,deleteNode:I_e,deleteRange:L_e,deleteSelection:$_e,enter:D_e,exitCode:B_e,extendMarkRange:F_e,first:z_e,focus:H_e,forEach:V_e,insertContent:W_e,insertContentAt:G_e,joinBackward:Y_e,joinDown:J_e,joinForward:X_e,joinItemBackward:Q_e,joinItemForward:eke,joinTextblockBackward:tke,joinTextblockForward:rke,joinUp:Z_e,keyboardShortcut:ike,lift:ske,liftEmptyBlock:ake,liftListItem:oke,newlineInCode:lke,resetAttributes:cke,scrollIntoView:uke,selectAll:dke,selectNodeBackward:fke,selectNodeForward:hke,selectParentNode:pke,selectTextblockEnd:mke,selectTextblockStart:gke,setContent:vke,setMark:Tke,setMeta:Ake,setNode:Pke,setNodeSelection:Mke,setTextSelection:Rke,sinkListItem:Ike,splitBlock:Lke,splitListItem:$ke,toggleList:Dke,toggleMark:Bke,toggleNode:Fke,toggleWrap:zke,undoInputRule:Uke,unsetAllMarks:Hke,unsetMark:Vke,updateAttributes:Wke,wrapIn:qke,wrapInList:Kke});const Zke=qn.create({name:"commands",addCommands(){return{...Gke}}}),Jke=qn.create({name:"drop",addProseMirrorPlugins(){return[new gn({key:new Pi("tiptapDrop"),props:{handleDrop:(t,e,r,n)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:r,moved:n})}}})]}}),Yke=qn.create({name:"editable",addProseMirrorPlugins(){return[new gn({key:new Pi("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Xke=new Pi("focusEvents"),Qke=qn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new gn({key:Xke,props:{handleDOMEvents:{focus:(e,r)=>{t.isFocused=!0;const n=t.state.tr.setMeta("focus",{event:r}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,r)=>{t.isFocused=!1;const n=t.state.tr.setMeta("blur",{event:r}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}}),eSe=qn.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:o})=>{const{selection:c,doc:u}=o,{empty:d,$anchor:f}=c,{pos:p,parent:m}=f,y=f.parent.isTextblock&&p>0?o.doc.resolve(p-1):f,v=y.parent.type.spec.isolating,w=f.pos-f.parentOffset,b=v&&y.parent.childCount===1?w===f.pos:dt.atStart(u).from===p;return!d||!m.type.isTextblock||m.textContent.length||!b||b&&f.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},s={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return gw()||PG()?s:i},addProseMirrorPlugins(){return[new gn({key:new Pi("clearDocument"),appendTransaction:(t,e,r)=>{if(t.some(v=>v.getMeta("composition")))return;const n=t.some(v=>v.docChanged)&&!e.doc.eq(r.doc),i=t.some(v=>v.getMeta("preventClearDocument"));if(!n||i)return;const{empty:s,from:a,to:o}=e.selection,c=dt.atStart(e.doc).from,u=dt.atEnd(e.doc).to;if(s||!(a===c&&o===u)||!vk(r.doc))return;const p=r.tr,m=dk({state:r,transaction:p}),{commands:y}=new fk({editor:this.editor,state:m});if(y.clearNodes(),!!p.steps.length)return p}})]}}),tSe=qn.create({name:"paste",addProseMirrorPlugins(){return[new gn({key:new Pi("tiptapPaste"),props:{handlePaste:(t,e,r)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:r})}}})]}}),rSe=qn.create({name:"tabindex",addProseMirrorPlugins(){return[new gn({key:new Pi("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class mu{get name(){return this.node.type.name}constructor(e,r,n=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=r,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let r=this.from,n=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}r=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:r,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),r=this.resolvedPos.doc.resolve(e);return new mu(r,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new mu(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new mu(e,this.editor)}get children(){const e=[];return this.node.content.forEach((r,n)=>{const i=r.isBlock&&!r.isTextblock,s=r.isAtom&&!r.isText,a=this.pos+n+(s?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const o=this.resolvedPos.doc.resolve(a);if(!i&&o.depth<=this.depth)return;const c=new mu(o,this.editor,i,i?r:null);i&&(c.actualDepth=this.depth+1),e.push(new mu(o,this.editor,i,i?r:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,r={}){let n=null,i=this.parent;for(;i&&!n;){if(i.node.type.name===e)if(Object.keys(r).length>0){const s=i.node.attrs,a=Object.keys(r);for(let o=0;o<a.length;o+=1){const c=a[o];if(s[c]!==r[c])break}}else n=i;i=i.parent}return n}querySelector(e,r={}){return this.querySelectorAll(e,r,!0)[0]||null}querySelectorAll(e,r={},n=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(r);return this.children.forEach(a=>{n&&i.length>0||(a.node.type.name===e&&s.every(c=>r[c]===a.node.attrs[c])&&i.push(a),!(n&&i.length>0)&&(i=i.concat(a.querySelectorAll(e,r,n))))}),i}setAttribute(e){const{tr:r}=this.editor.state;r.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(r)}}const nSe=`.ProseMirror {
712  position: relative;
713}
714
715.ProseMirror {
716  word-wrap: break-word;
717  white-space: pre-wrap;
718  white-space: break-spaces;
719  -webkit-font-variant-ligatures: none;
720  font-variant-ligatures: none;
721  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
722}
723
724.ProseMirror [contenteditable="false"] {
725  white-space: normal;
726}
727
728.ProseMirror [contenteditable="false"] [contenteditable="true"] {
729  white-space: pre-wrap;
730}
731
732.ProseMirror pre {
733  white-space: pre-wrap;
734}
735
736img.ProseMirror-separator {
737  display: inline !important;
738  border: none !important;
739  margin: 0 !important;
740  width: 0 !important;
741  height: 0 !important;
742}
743
744.ProseMirror-gapcursor {
745  display: none;
746  pointer-events: none;
747  position: absolute;
748  margin: 0;
749}
750
751.ProseMirror-gapcursor:after {
752  content: "";
753  display: block;
754  position: absolute;
755  top: -2px;
756  width: 20px;
757  border-top: 1px solid black;
758  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
759}
760
761@keyframes ProseMirror-cursor-blink {
762  to {
763    visibility: hidden;
764  }
765}
766
767.ProseMirror-hideselection *::selection {
768  background: transparent;
769}
770
771.ProseMirror-hideselection *::-moz-selection {
772  background: transparent;
773}
774
775.ProseMirror-hideselection * {
776  caret-color: transparent;
777}
778
779.ProseMirror-focused .ProseMirror-gapcursor {
780  display: block;
781}
782
783.tippy-box[data-animation=fade][data-state=hidden] {
784  opacity: 0
785}`;function iSe(t,e,r){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}class sSe extends f_e{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:n,moved:i})=>this.options.onDrop(r,n,i)),this.on("paste",({event:r,slice:n})=>this.options.onPaste(r,n)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=iSe(nSe,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,r=!0){this.setOptions({editable:e}),r&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,r){const n=jG(r)?r(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:n});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;const r=this.state.plugins;let n=r;if([].concat(e).forEach(s=>{const a=typeof s=="string"?`${s}$`:s.key;n=n.filter(o=>!o.key.startsWith(a))}),r.length===n.length)return;const i=this.state.reconfigure({plugins:n});return this.view.updateState(i),i}createExtensionManager(){var e,r;const i=[...this.options.enableCoreExtensions?[Yke,C_e.configure({blockSeparator:(r=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||r===void 0?void 0:r.blockSeparator}),Zke,Qke,eSe,rSe,Jke,tSe].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s==null?void 0:s.type));this.extensionManager=new Af(i,this)}createCommandManager(){this.commandManager=new fk({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let r;try{r=MO(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(a){if(!(a instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(a.message))throw a;
vendor: 4,192 bytes, lines 785-787
785this.emit("contentError",{editor:this,error:a,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(o=>o.name!=="collaboration"),this.createExtensionManager()}}),r=MO(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=TG(r,this.options.autofocus);this.view=new gG(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:Tf.create({doc:r,selection:n||void 0})});const i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.createNodeViews(),this.prependClass();const s=this.view.dom;s.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const r=this.capturedTransaction;return this.capturedTransaction=null,r}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(a=>{var o;return(o=this.capturedTransaction)===null||o===void 0?void 0:o.step(a)});return}const r=this.state.apply(e),n=!this.state.selection.eq(r.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:r}),this.view.updateState(r),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),s=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),s&&this.emit("blur",{editor:this,event:s.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return RG(this.state,e)}isActive(e,r){const n=typeof e=="string"?e:null,i=typeof e=="string"?r:e;return Cke(this.state,n,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return nM(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:r=`
786
787`,textSerializers:n={}}=e||{};return _ke(this.state.doc,{blockSeparator:r,textSerializers:{...CG(this.schema),...n}})}get isEmpty(){return vk(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,r){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelector(e,r))||null}$nodes(e,r){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelectorAll(e,r))||null}$pos(e){const r=this.state.doc.resolve(e);return new mu(r,this)}get $doc(){return this.$pos(0)}}function Dh(t){return new pk({find:t.find,handler:({state:e,range:r,match:n})=>{const i=pt(t.getAttributes,void 0,n);if(i===!1||i===null)return null;const{tr:s}=e,a=n[n.length-1],o=n[0];if(a){const c=o.search(/\S/),u=r.from+o.indexOf(a),d=u+a.length;if(oM(r.from,r.to,e.doc).filter(m=>m.mark.type.excluded.find(v=>v===t.type&&v!==m.mark.type)).filter(m=>m.to>u).length)return null;d<r.to&&s.delete(d,r.to),u>r.from&&s.delete(r.from+c,u);const p=r.from+c+a.length;s.addMark(r.from+c,p,t.type.create(i||{})),s.removeStoredMark(t.type)}}})}function IG(t){return new pk({find:t.find,handler:({state:e,range:r,match:n})=>{const i=pt(t.getAttributes,void 0,n)||{},{tr:s}=e,a=r.from;let o=r.to;const c=t.type.create(i);if(n[1]){const u=n[0].lastIndexOf(n[1]);let d=a+u;d>o?d=o:o=d+n[1].length;const f=n[0][n[0].length-1];s.insertText(f,a+n[0].length-1),s.replaceWith(d,o,c)}else if(n[0]){const u=t.type.isInline?a:a-1;s.insert(u,t.type.create(i)).delete(s.mapping.map(a),s.mapping.map(o))}s.scrollIntoView()}})}function IO(t){return new pk({find:t.find,handler:({state:e,range:r,match:n}
787)=>{const i=e.doc.resolve(r.from),s=pt(t.getAttributes,void 0,n)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(r.from,r.to).setBlockType(r.from,r.from,t.type,s)}})}function bv(t){return new pk({find:t.find,handler:({state:e,range:r,match:n,chain:i})=>{const s=pt(t.getAttributes,void 0,n)||{},a=e.tr.delete(r.from,r.to),c=a.doc.resolve(r.from).blockRange(),u=c&&V2(c,t.type,s);if(!u)return null;if(a.wrap(c,u),t.keepMarks&&t.editor){const{selection:f,storedMarks:p}=e,{splittableMarks:m}=t.editor.extensionManager,y=p||f.$to.parentOffset&&f.$from.marks();if(y){const v=y.filter(w=>m.includes(w.type.name));a.ensureMarks(v)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,s).run()}const d=a.doc.resolve(r.from-1).nodeBefore;d&&d.type===t.type&&Bc(a.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(n,d))&&a.join(r.from-1)}})}let Bs=class LO{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=pt(Ae(this,"addOptions",{name:this.name}))),this.storage=pt(Ae(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new LO(e)}configure(e={}){const r=this.extend({...this.config,addOptions:()=>mk(this.options,e)});return r.name=this.name,r.parent=this.parent,r}extend(e={}){const r=new LO(e);return r.parent=this,this.child=r,r.name=e.name?e.name:r.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${r.name}".`),r.options=pt(Ae(r,"addOptions",{name:r.name})),r.storage=pt(Ae(r,"addStorage",{name:r.name,options:r.options})),r}};function od(t){return new w_e({find:t.find,handler:({state:e,range:r,match:n,pasteEvent:i})=>{const s=pt(t.getAttributes,void 0,n,i);if(s===!1||s===null)return null;const{tr:a}=e,o=n[n.length-1],c=n[0];let u=r.to;if(o){const d=c.search(/\S/),f=r.from+c.indexOf(o),p=f+o.length;if(oM(r.from,r.to,e.doc).filter(y=>y.mark.type.excluded.find(w=>w===t.type&&w!==y.mark.type)).filter(y=>y.to>f).length)return null;p<r.to&&a.delete(p,r.to),f>r.from&&a.delete(r.from+d,f),u=r.from+d+o.length,a.addMark(r.from+d,u,t.type.create(s||{})),a.removeStoredMark(t.type)}}})}function aSe(t,e){const{selection:r}=t,{$from:n}=r;if(r instanceof Ue){const s=n.index();return n.parent.canReplaceWith(s,s+1,e)}let i=n.depth;for(;i>=0;){const s=n.index(i);if(n.node(i).contentMatchAt(s).matchType(e))return!0;i-=1}return!1}function oSe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var LG={exports:{}},yN={};/**
788 * @license React
789 * use-sync-external-store-shim.production.min.js
790 *
791 * Copyright (c) Facebook, Inc. and its affiliates.
792 *
793 * This source code is licensed under the MIT license found in the
794 * LICENSE file in the root directory of this source tree.
795 */var c3;function lSe(){if(c3)return yN;c3=1;var t=D;function e(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:e,n=t.useState,i=t.useEffect,s=t.useLayoutEffect,a=t.useDebugValue;function o(f,p){var m=p(),y=n({inst:{value:m,getSnapshot:p}}),v=y[0].inst,w=y[1];return s(function(){v.value=m,v.getSnapshot=p,c(v)&&w({inst:v})},[f,m,p]),i(function(){return c(v)&&w({inst:v}),f(function(){c(v)&&w({inst:v})})},[f]),a(m),m}function c(f){var p=f.getSnapshot;f=f.value;try{var m=p();return!r(f,m)}catch{return!0}}function u(f,p){return p()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return yN.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:d,yN}LG.exports=lSe();var lM=LG.exports;const cSe=(...t)=>e=>{t.forEach(r=>{typeof r=="function"?r(e):r&&(r.current=e)})},uSe=({contentComponent:t})=>{const e=lM.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return D.createElement(D.Fragment,null,Object.values(e))};function dSe(){const t=new Set;let e={};return{subscribe(r){return t.add(r),()=>{t.delete(r)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(r,n){e={...e,[r]:wP.createPortal(n.reactElement,n.element,r)},t.forEach(i=>
795i())},removeRenderer(r){const n={...e};delete n[r],e=n,t.forEach(i=>i())}}}class fSe extends D.Component{constructor(e){var r;super(e),this.editorContentRef=D.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((r=e.editor)===null||r===void 0)&&r.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const r=this.editorContentRef.current;r.append(...e.options.element.childNodes),e.setOptions({element:r}),e.contentComponent=dSe(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(n=>n.hasContentComponentInitialized?n:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;const r=document.createElement("div");r.append(...e.options.element.childNodes),e.setOptions({element:r})}render(){const{editor:e,innerRef:r,...n}=this.props;return D.createElement(D.Fragment,null,D.createElement("div",{ref:cSe(r,this.editorContentRef),...n}),(e==null?void 0:e.contentComponent)&&D.createElement(uSe,{contentComponent:e.contentComponent}))}}const hSe=x.forwardRef((t,e)=>{const r=D.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return D.createElement(fSe,{key:r,innerRef:e,...t})}),pSe=D.memo(hSe);var mSe=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;for(i of e.entries())if(!r.has(i[0]))return!1;for(i of e.entries())if(!t(i[1],r.get(i[0])))return!1;return!0}if(e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;for(i of e.entries())if(!r.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(r)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(e[i]!==r[i])return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!(a==="_owner"&&e.$$typeof)&&!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r},gSe=oSe(mSe),$G={exports:{}},xN={};/**
796 * @license React
797 * use-sync-external-store-shim/with-selector.production.min.js
798 *
799 * Copyright (c) Facebook, Inc. and its affiliates.
800 *
801 * This source code is licensed under the MIT license found in the
802 * LICENSE file in the root directory of this source tree.
803 */var u3;function vSe(){if(u3)return xN;u3=1;var t=D,e=lM;function r(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var n=typeof Object.is=="function"?Object.is:r,i=e.useSyncExternalStore,s=t.useRef,a=t.useEffect,o=t.useMemo,c=t.useDebugValue;return xN.useSyncExternalStoreWithSelector=function(u,d,f,p,m){var y=s(null);if(y.current===null){var v={hasValue:!1,value:null};y.current=v}else v=y.current;y=o(function(){function b(C){if(!_){if(_=!0,S=C,C=p(C),m!==void 0&&v.hasValue){var O=v.value;if(m(O,C))return N=O}return N=C}if(O=N,n(S,C))return O;var P=p(C);return m!==void 0&&m(O,P)?O:(S=C,N=P)}var _=!1,S,N,j=f===void 0?null:f;return[function(){return b(d())},j===null?void 0:function(){return b(j())}]},[d,f,p,m]);var w=i(u,y[0],y[1]);return a(function(){v.hasValue=!0,v.value=w},[w]),c(w),w},xN}$G.exports=vSe();var ySe=$G.exports;const xSe=typeof window<"u"?x.useLayoutEffect:x.useEffect;class bSe{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0}
803,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 r=()=>{this.transactionNumber+=1,this.subscribers.forEach(i=>i())},n=this.editor;return n.on("transaction",r),()=>{n.off("transaction",r)}}}}function wSe(t){var e;const[r]=x.useState(()=>new bSe(t.editor)),n=ySe.useSyncExternalStoreWithSelector(r.subscribe,r.getSnapshot,r.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:gSe);return xSe(()=>r.watch(t.editor),[t.editor,r]),x.useDebugValue(n),n}const _Se=!1,$O=typeof window>"u",kSe=$O||!!(typeof window<"u"&&window.next);class cM{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(r=>r())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return $O||kSe?null:this.createEditor();if(this.options.current.immediatelyRender&&$O&&_Se)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...n)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)===null||s===void 0?void 0:s.call(i,...n)},onBlur:(...n)=>{var i,s;return(s=(i=this.options.current).onBlur)===null||s===void 0?void 0:s.call(i,...n)},onCreate:(...n)=>{var i,s;return(s=(i=this.options.current).onCreate)===null||s===void 0?void 0:s.call(i,...n)},onDestroy:(...n)=>{var i,s;return(s=(i=this.options.current).onDestroy)===null||s===void 0?void 0:s.call(i,...n)},onFocus:(...n)=>{var i,s;return(s=(i=this.options.current).onFocus)===null||s===void 0?void 0:s.call(i,...n)},onSelectionUpdate:(...n)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)===null||s===void 0?void 0:s.call(i,...n)},onTransaction:(...n)=>{var i,s;return(s=(i=this.options.current).onTransaction)===null||s===void 0?void 0:s.call(i,...n)},onUpdate:(...n)=>{var i,s;return(s=(i=this.options.current).onUpdate)===null||s===void 0?void 0:s.call(i,...n)},onContentError:(...n)=>{var i,s;return(s=(i=this.options.current).onContentError)===null||s===void 0?void 0:s.call(i,...n)},onDrop:(...n)=>{var i,s;return(s=(i=this.options.current).onDrop)===null||s===void 0?void 0:s.call(i,...n)},onPaste:(...n)=>{var i,s;return(s=(i=this.options.current).onPaste)===null||s===void 0?void 0:s.call(i,...n)}};return new sSe(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,r){return Object.keys(e).every(n=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)?!0:n==="extensions"&&e.extensions&&r.extensions?e.extensions.length!==r.extensions.length?!1:e.extensions.every((i,s)=>{var a;return i===((a=r.extensions)===null||a===void 0?void 0:a[s])}):e[n]===r[n])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?cM.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}
803):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((n,i)=>n===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,r=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){r&&r.setOptions(this.options.current);return}r&&!r.isDestroyed&&(r.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}function SSe(t={},e=[]){const r=x.useRef(t);r.current=t;const[n]=x.useState(()=>new cM(r)),i=lM.useSyncExternalStore(n.subscribe,n.getEditor,n.getServerSnapshot);return x.useDebugValue(i),x.useEffect(n.onRender(e)),wSe({editor:i,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&s===0?0:s+1}),i}const jSe=x.createContext({editor:null});jSe.Consumer;const NSe=x.createContext({onDragStart:void 0}),CSe=()=>x.useContext(NSe);D.forwardRef((t,e)=>{const{onDragStart:r}=CSe(),n=t.as||"div";return D.createElement(n,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})});const ESe=/^\s*>\s$/,OSe=Bs.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",mn(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[bv({find:ESe,type:this.type})]}}),TSe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,ASe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,PSe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,MSe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,RSe=qo.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",mn(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Dh({find:TSe,type:this.type}),Dh({find:PSe,type:this.type})]},addPasteRules(){return[od({find:ASe,type:this.type}),od({find:MSe,type:this.type})]}}),ISe="listItem",d3="textStyle",f3=/^\s*([-+*])\s$/,LSe=Bs.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",mn(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ISe,this.editor.getAttributes(d3)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=bv({find:f3,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=bv({find:f3,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(d3),editor:this.editor})),[t]}}
vendor: 12,263 bytes, lines 803-807
803),$Se=/(^|[^`])`([^`]+)`(?!`)/,DSe=/(^|[^`])`([^`]+)`(?!`)/g,BSe=qo.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",mn(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Dh({find:$Se,type:this.type})]},addPasteRules(){return[od({find:DSe,type:this.type})]}}),FSe=/^```([a-z]+)?[\s\n]$/,zSe=/^~~~([a-z]+)?[\s\n]$/,USe=Bs.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:r}=this.options,s=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(a=>a.startsWith(r)).map(a=>a.replace(r,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",mn(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,r=e.pos===1;return!t||e.parent.type.name!==this.name?!1:r||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:r}=e,{$from:n,empty:i}=r;if(!i||n.parent.type!==this.type)return!1;const s=n.parentOffset===n.parent.nodeSize-2,a=n.parent.textContent.endsWith(`
804
805`);return!s||!a?!1:t.chain().command(({tr:o})=>(o.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:r,doc:n}=e,{$from:i,empty:s}=r;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const o=i.after();return o===void 0?!1:n.nodeAt(o)?t.commands.command(({tr:u})=>(u.setSelection(dt.near(n.resolve(o))),!0)):t.commands.exitCode()}}},addInputRules(){return[IO({find:FSe,type:this.type,getAttributes:t=>({language:t[1]})}),IO({find:zSe,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new gn({key:new Pi("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const r=e.clipboardData.getData("text/plain"),n=e.clipboardData.getData("vscode-editor-data"),i=n?JSON.parse(n):void 0,s=i==null?void 0:i.mode;if(!r||!s)return!1;const{tr:a,schema:o}=t.state,c=o.text(r.replace(/\r\n?/g,`
806`));return a.replaceSelectionWith(this.type.create({language:s},c)),a.selection.$from.parent.type!==this.type&&a.setSelection(Qe.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),t.dispatch(a),!0}}})]}}),HSe=Bs.create({name:"doc",topNode:!0,content:"block+"});function VSe(t={}){return new gn({view(e){return new WSe(e,t)}})}class WSe{constructor(e,r){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=r.width)!==null&&n!==void 0?n:1,this.color=r.color===!1?void 0:r.color||"black",this.class=r.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=a=>{this[i](a)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:r})=>this.editorView.dom.removeEventListener(e,r))}update(e,r){this.cursorPos!=null&&r.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),r=!e.parent.inlineContent,n,i=this.editorView.dom,s=i.getBoundingClientRect(),a=s.width/i.offsetWidth,o=s.height/i.offsetHeight;if(r){let f=e.nodeBefore,p=e.nodeAfter;if(f||p){let m=this.editorView.nodeDOM(this.cursorPos-(f?f.nodeSize:0));if(m){let y=m.getBoundingClientRect(),v=f?y.bottom:y.top;f&&p&&(v=(v+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let w=this.width/2*o;n={left:y.left,right:y.right,top:v-w,bottom:v+w}}}}if(!n){let f=this.editorView.coordsAtPos(this.cursorPos),p=this.width/2*a;n={left:f.left-p,right:f.left+p,top:f.top,bottom:f.bottom}}let c=this.editorView.dom.offsetParent;this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r);let u,d;if(!c||c==document.body&&getComputedStyle(c).position=="static")u=-pageXOffset,d=-pageYOffset;else{let f=c.getBoundingClientRect(),p=f.width/c.offsetWidth,m=f.height/c.offsetHeight;u=f.left-c.scrollLeft*p,d=f.top-c.scrollTop*m}this.element.style.left=(n.left-u)/a+"px",this.element.style.top=(n.top-d)/o+"px",this.element.style.width=(n.right-n.left)/a+"px",this.element.style.height=(n.bottom-n.top)/o+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let r=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=r&&r.inside>=0&&this.editorView.state.doc.nodeAt(r.inside),i=n&&n.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,r,e):i;if(r&&!s){let a=r.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let o=EK(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(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const qSe=qn.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[VSe(this.options)]}});class Er extends dt{constructor(e){super(e,e)}map(e,r){let n=e.resolve(r.map(this.head));return Er.valid(n)?new Er(n):dt.near(n)}content(){return Ne.empty}eq(e){return e instanceof Er&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Er(e.resolve(r.pos))}getBookmark(){return new uM(this.anchor)}static valid(e){let r=e.parent;if(r.inlineContent||!KSe(e)||!GSe(e))return!1;let n=r.type.spec.allowGapCursor;if(n!=null)return n;let i=r.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,r,n=!1){e:for(;;){if(!n&&Er.valid(e))return e;let i=e.pos,s=null;for(let a=e.depth;;a--){let o=e.node(a);if(r>0?e.indexAfter(a)<o.childCount:e.index(a)>0){s=o.child(r>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;i+=r;let c=e.doc.resolve(i);if(Er.valid(c))return c}for(;;){let a=r>0?s.firstChild:s.lastChild;if(!a){if(s.isAtom&&!s.isText&&!Ue.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*r),n=!1;continue e}break}s=a,i+=r;let o=e.doc.resolve(i);if(Er.valid(o))return o}return null}}}Er.prototype.visible=!1;Er.findFrom=Er.findGapCursorFrom;dt.jsonID("gapcursor",Er);class uM{constructor(e){this.pos=e}map(e){return new uM(e.map(this.pos))}resolve(e){let r=e.resolve(this.pos);return Er.valid(r)?new Er(r):dt.near(r)}}function DG(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function KSe(t){for(let e=t.depth;e>=0;e--){let r=t.index(e),n=t.node(e);if(r==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(r-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||DG(i.type))return!0;if(i.inlineContent)return!1}}return!0}function GSe(t){for(let e=t.depth;e>=0;e--){let r=t.indexAfter(e),n=t.node(e);if(r==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(r);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||DG(i.type))return!0;if(i.inlineContent)return!1}}return!0}function ZSe(){return new gn({props:{decorations:QSe,createSelectionBetween(t,e,r){return e.pos==r.pos&&Er.valid(r)?new Er(r):null},handleClick:YSe,handleKeyDown:JSe,handleDOMEvents:{beforeinput:XSe}}})}const JSe=vG({ArrowLeft:rb("horiz",-1),ArrowRight:rb("horiz",1),ArrowUp:rb("vert",-1),ArrowDown:rb("vert",1)});function rb(t,e){const r=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,s){let a=n.selection,o=e>0?a.$to:a.$from,c=a.empty;if(a instanceof Qe){if(!s.endOfTextblock(r)||o.depth==0)return!1;c=!1,o=n.doc.resolve(e>0?o.after():o.before())}let u=Er.findGapCursorFrom(o,e,c);return u?(i&&i(n.tr.setSelection(new Er(u))),!0):!1}}function YSe(t,e,r){if(!t||!t.editable)return!1;let n=t.state.doc.resolve(e);if(!Er.valid(n))return!1;let i=t.posAtCoords({left:r.clientX,top:r.clientY});return i&&i.inside>-1&&Ue.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Er(n))),!0)}function XSe(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Er))return!1;let{$from:r}=t.state.selection,n=r.parent.contentMatchAt(r.index()).findWrapping(t.state.schema.nodes.text);if(!n)return!1;let i=me.empty;for(let a=n.length-1;a>=0;a--)i=me.from(n[a].createAndFill(null,i));let s=t.state.tr.replace(r.pos,r.pos,new Ne(i,0,0));return s.setSelection(Qe.near(s.doc.resolve(r.pos+1))),t.dispatch(s),!1}function QSe(t){if(!(t.selection instanceof Er))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",zr.create(t.doc,[qi.widget(t.selection.head,e,{key:"gapcursor"})])}const eje=qn.create({name:"gapCursor",addProseMirrorPlugins(){return[ZSe()]},extendNodeSchema(t){var e;const r={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=pt(Ae(t,"allowGapCursor",r)))!==null&&e!==void 0?e:null}}}),tje=Bs.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",mn(this.options.HTMLAttributes,t)]},renderText(){return`
807`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:r,editor:n})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=r;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:o}=n.extensionManager,c=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:d})=>{if(d&&c&&a){const f=c.filter(p=>o.includes(p.type.name));u.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),rje=Bs.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,mn(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>IO({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}}
807)\\s$`),type:this.type,getAttributes:{level:t}}))}});var vw=200,fn=function(){};fn.prototype.append=function(e){return e.length?(e=fn.from(e),!this.length&&e||e.length<vw&&this.leafAppend(e)||this.length<vw&&e.leafPrepend(this)||this.appendInner(e)):this};fn.prototype.prepend=function(e){return e.length?fn.from(e).append(this):this};fn.prototype.appendInner=function(e){return new nje(this,e)};fn.prototype.slice=function(e,r){return e===void 0&&(e=0),r===void 0&&(r=this.length),e>=r?fn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,r))};fn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};fn.prototype.forEach=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(e,r,n,0):this.forEachInvertedInner(e,r,n,0)};fn.prototype.map=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(s,a){return i.push(e(s,a))},r,n),i};fn.from=function(e){return e instanceof fn?e:e&&e.length?new BG(e):fn.empty};var BG=function(t){function e(n){t.call(this),this.values=n}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,a,o){for(var c=s;c<a;c++)if(i(this.values[c],o+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,a,o){for(var c=s-1;c>=a;c--)if(i(this.values[c],o+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=vw)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=vw)return new e(i.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(e.prototype,r),e}(fn);fn.empty=new BG([]);var nje=function(t){function e(r,n){t.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,i,s,a){var o=this.left.length;if(i<o&&this.left.forEachInner(n,i,Math.min(s,o),a)===!1||s>o&&this.right.forEachInner(n,Math.max(i-o,0),Math.min(this.length,s)-o,a+o)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,s,a){var o=this.left.length;if(i>o&&this.right.forEachInvertedInner(n,i-o,Math.max(s,o)-o,a+o)===!1||s<o&&this.left.forEachInvertedInner(n,Math.min(i,o),s,a)===!1)return!1},e.prototype.sliceInner=function(n,i){if(n==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(n,i):n>=s?this.right.slice(n-s,i-s):this.left.slice(n,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(fn);const ije=500;class sa{constructor(e,r){this.items=e,this.eventCount=r}popEvent(e,r){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,s;r&&(i=this.remapping(n,this.items.length),s=i.maps.length);let a=e.tr,o,c,u=[],d=[];return this.items.forEach((f,p)=>{if(!f.step){i||(i=this.remapping(n,p+1),s=i.maps.length),s--,d.push(f);return}if(i){d.push(new Na(f.map));let m=f.step.map(i.slice(s)),y;m&&a.maybeStep(m).doc&&(y=a.mapping.maps[a.mapping.maps.length-1],u.push(new Na(y,void 0,void 0,u.length+d.length))),s--,y&&i.appendMap(y,s)}else a.maybeStep(f.step);if(f.selection)return o=i?f.selection.map(i.slice(s)):f.selection,c=new sa(this.items.slice(0,n).append(d.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:a,selection:o}}addTransform(e,r,n,i){let s=[],a=this.eventCount,o=this.items,c=!i&&o.length?o.get(o.length-1):null;for(let d=0;d<e.steps.length;d++){let f=e.steps[d].invert(e.docs[d]),p=new Na(e.mapping.maps[d],f,r),m;(m=c&&c.merge(p))&&(p=m,d?s.pop():o=o.slice(0,o.length-1)),s.push(p),r&&(a++,r=void 0),i||(c=p)}let u=a-n.depth;return u>aje&&(o=sje(o,u),a-=u),new sa(o.append(s),a)}remapping(e,r){let n=new hv;
vendor: 14,934 bytes, line 807
807return this.items.forEach((i,s)=>{let a=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,a)},e,r),n}addMaps(e){return this.eventCount==0?this:new sa(this.items.append(e.map(r=>new Na(r))),this.eventCount)}rebased(e,r){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-r),s=e.mapping,a=e.steps.length,o=this.eventCount;this.items.forEach(p=>{p.selection&&o--},i);let c=r;this.items.forEach(p=>{let m=s.getMirror(--c);if(m==null)return;a=Math.min(a,m);let y=s.maps[m];if(p.step){let v=e.steps[m].invert(e.docs[m]),w=p.selection&&p.selection.map(s.slice(c+1,m));w&&o++,n.push(new Na(y,v,w))}else n.push(new Na(y))},i);let u=[];for(let p=r;p<a;p++)u.push(new Na(s.maps[p]));let d=this.items.slice(0,i).append(u).append(n),f=new sa(d,o);return f.emptyItemCount()>ije&&(f=f.compress(this.items.length-n.length)),f}emptyItemCount(){let e=0;return this.items.forEach(r=>{r.step||e++}),e}compress(e=this.items.length){let r=this.remapping(0,e),n=r.maps.length,i=[],s=0;return this.items.forEach((a,o)=>{if(o>=e)i.push(a),a.selection&&s++;else if(a.step){let c=a.step.map(r.slice(n)),u=c&&c.getMap();if(n--,u&&r.appendMap(u,n),c){let d=a.selection&&a.selection.map(r.slice(n));d&&s++;let f=new Na(u.invert(),c,d),p,m=i.length-1;(p=i.length&&i[m].merge(f))?i[m]=p:i.push(f)}}else a.map&&n--},this.items.length,0),new sa(fn.from(i.reverse()),s)}}sa.empty=new sa(fn.empty,0);function sje(t,e){let r;return t.forEach((n,i)=>{if(n.selection&&e--==0)return r=i,!1}),t.slice(r)}class Na{constructor(e,r,n,i){this.map=e,this.step=r,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let r=e.step.merge(this.step);if(r)return new Na(r.getMap().invert(),r,this.selection)}}}class Sl{constructor(e,r,n,i,s){this.done=e,this.undone=r,this.prevRanges=n,this.prevTime=i,this.prevComposition=s}}const aje=20;function oje(t,e,r,n){let i=r.getMeta(Uu),s;if(i)return i.historyState;r.getMeta(uje)&&(t=new Sl(t.done,t.undone,null,0,-1));let a=r.getMeta("appendedTransaction");if(r.steps.length==0)return t;if(a&&a.getMeta(Uu))return a.getMeta(Uu).redo?new Sl(t.done.addTransform(r,void 0,n,Zb(e)),t.undone,h3(r.mapping.maps),t.prevTime,t.prevComposition):new Sl(t.done,t.undone.addTransform(r,void 0,n,Zb(e)),null,t.prevTime,t.prevComposition);if(r.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let o=r.getMeta("composition"),c=t.prevTime==0||!a&&t.prevComposition!=o&&(t.prevTime<(r.time||0)-n.newGroupDelay||!lje(r,t.prevRanges)),u=a?bN(t.prevRanges,r.mapping):h3(r.mapping.maps);return new Sl(t.done.addTransform(r,c?e.selection.getBookmark():void 0,n,Zb(e)),sa.empty,u,r.time,o??t.prevComposition)}else return(s=r.getMeta("rebased"))?new Sl(t.done.rebased(r,s),t.undone.rebased(r,s),bN(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new Sl(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),bN(t.prevRanges,r.mapping),t.prevTime,t.prevComposition)}function lje(t,e){if(!e)return!1;if(!t.docChanged)return!0;let r=!1;return t.mapping.maps[0].forEach((n,i)=>{for(let s=0;s<e.length;s+=2)n<=e[s+1]&&i>=e[s]&&(r=!0)}),r}function h3(t){let e=[];for(let r=t.length-1;r>=0&&e.length==0;r--)t[r].forEach((n,i,s,a)=>e.push(s,a));return e}function bN(t,e){if(!t)return null;let r=[];for(let n=0;n<t.length;n+=2){let i=e.map(t[n],1),s=e.map(t[n+1],-1);i<=s&&r.push(i,s)}return r}function cje(t,e,r){let n=Zb(e),i=Uu.get(e).spec.config,s=(r?t.undone:t.done).popEvent(e,n);if(!s)return null;let a=s.selection.resolve(s.transform.doc),o=(r?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,n),c=new Sl(r?o:s.remaining,r?s.remaining:o,null,0,-1);return s.transform.setSelection(a).setMeta(Uu,{redo:r,historyState:c})}let wN=!1,p3=null;function Zb(t){let e=t.plugins;if(p3!=e){wN=!1,p3=e;for(let r=0;r<e.length;r++)if(e[r].spec.historyPreserveItems){wN=!0;break}}return wN}const Uu=new Pi("history"),uje=new Pi("closeHistory");function dje(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new gn({key:Uu,state:{init(){return new Sl(sa.empty,sa.empty,null,0,-1)},apply(e,r,n){return oje(r,n,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,r){let n=r.inputType,i=n=="historyUndo"?zG:n=="historyRedo"?UG:null;return!i||!e.editable?!1:(r.preventDefault(),i(e.state,e.dispatch))}}}})}function FG(t,e){return(r,n)=>{let i=Uu.getState(r);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(n){let s=cje(i,r,t);s&&n(e?s.scrollIntoView():s)}return!0}}const zG=FG(!1,!0),UG=FG(!0,!0),fje=qn.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>zG(t,e),redo:()=>({state:t,dispatch:e})=>UG(t,e)}},addProseMirrorPlugins(){return[dje(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()}}}),hje=Bs.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",mn(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!aSe(e,e.schema.nodes[this.name]))return!1;const{selection:r}=e,{$from:n,$to:i}=r,s=t();return n.parentOffset===0?s.insertContentAt({from:Math.max(n.pos-1,0),to:i.pos},{type:this.name}):Eke(r)?s.insertContentAt(i.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({tr:a,dispatch:o})=>{var c;if(o){const{$to:u}=a.selection,d=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?a.setSelection(Qe.create(a.doc,u.pos+1)):u.nodeAfter.isBlock?a.setSelection(Ue.create(a.doc,u.pos)):a.setSelection(Qe.create(a.doc,u.pos));else{const f=(c=u.parent.type.contentMatch.defaultType)===null||c===void 0?void 0:c.create();f&&(a.insert(d,f),a.setSelection(Qe.create(a.doc,d+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[IG({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),pje=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,mje=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,gje=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,vje=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,yje=qo.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",mn(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Dh({find:pje,type:this.type}),Dh({find:gje,type:this.type})]},addPasteRules(){return[od({find:mje,type:this.type}),od({find:vje,type:this.type})]}}),xje=Bs.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",mn(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),bje="listItem",m3="textStyle",g3=/^(\d+)\.\s$/,wje=Bs.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...r}=t;return e===1?["ol",mn(this.options.HTMLAttributes,r),0]:["ol",mn(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(bje,this.editor.getAttributes(m3)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=bv({find:g3,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,r)=>r.childCount+r.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=bv({find:g3,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(m3)}),joinPredicate:(e,r)=>r.childCount+r.attrs.start===+e[1],editor:this.editor})),[t]}}),_je=Bs.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",mn(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),kje=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Sje=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,jje=qo.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",mn(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Dh({find:kje,type:this.type})]},addPasteRules(){return[od({find:Sje,type:this.type})]}}),Nje=Bs.create({name:"text",group:"inline"}),Cje=qn.create({name:"starterKit",addExtensions(){const t=[];return this.options.bold!==!1&&t.push(RSe.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(OSe.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(LSe.configure(this.options.bulletList)),this.options.code!==!1&&t.push(BSe.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(USe.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(HSe.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(qSe.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(eje.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(tje.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(rje.configure(this.options.heading)),this.options.history!==!1&&t.push(fje.configure(this.options.history)),this.options.horizontalRule!==!1&&t.push(hje.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(yje.configure(this.options.italic)),this.options.listItem!==!1&&t.push(xje.configure(this.options.listItem)),this.options.orderedList!==!1&&t.push(wje.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(_je.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(jje.configure(this.options.strike)),this.options.text!==!1&&t.push(Nje.configure(this.options.text)),t}}),Eje="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
807ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Oje="ελ1υ2бг1ел3дети4ею2католик6ом3мÐ
807ºÐ´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",DO="numeric",BO="ascii",FO="alpha",fg="asciinumeric",Wm="alphanumeric",zO="domain",HG="emoji",Tje="scheme",Aje="slashscheme",_N="whitespace";function Pje(t,e){return t in e||(e[t]=[]),e[t]}function Su(t,e,r){e[DO]&&(e[fg]=!0,e[Wm]=!0),e[BO]&&(e[fg]=!0,e[FO]=!0),e[fg]&&(e[Wm]=!0),e[FO]&&(e[Wm]=!0),e[Wm]&&(e[zO]=!0),e[HG]&&(e[zO]=!0);for(const n in e){const i=Pje(n,r);i.indexOf(t)<0&&i.push(t)}}function Mje(t,e){const r={};for(const n in e)e[n].indexOf(t)>=0&&(r[n]=!0);return r}function bi(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}bi.groups={};bi.prototype={accepts(){return!!this.t},go(t){const e=this,r=e.j[t];if(r)return r;for(let n=0;n<e.jr.length;n++){const i=e.jr[n][0],s=e.jr[n][1];if(s&&i.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,r,n){for(let i=0;i<t.length;i++)this.tt(t[i],e,r,n)},tr(t,e,r,n){n=n||bi.groups;let i;return e&&e.j?i=e:(i=new bi(e),r&&n&&Su(e,r,n)),this.jr.push([t,i]),i},ts(t,e,r,n){let i=this;const s=t.length;if(!s)return i;for(let a=0;a<s-1;a++)i=i.tt(t[a]);return i.tt(t[s-1],e,r,n)},tt(t,e,r,n){n=n||bi.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const s=e;let a,o=i.go(t);if(o?(a=new bi,Object.assign(a.j,o.j),a.jr.push.apply(a.jr,o.jr),a.jd=o.jd,a.t=o.t):a=new bi,s){if(n)if(a.t&&typeof a.t=="string"){const c=Object.assign(Mje(a.t,n),r);Su(s,c,n)}else r&&Su(s,r,n);a.t=s}return i.j[t]=a,a}};const ut=(t,e,r,n,i)=>t.ta(e,r,n,i),wr=(t,e,r,n,i)=>t.tr(e,r,n,i),v3=(t,e,r,n,i)=>t.ts(e,r,n,i),ge=(t,e,r,n,i)=>t.tt(e,r,n,i),go="WORD",UO="UWORD",VG="ASCIINUMERICAL",WG="ALPHANUMERICAL",wv="LOCALHOST",HO="TLD",VO="UTLD",Jb="SCHEME",pf="SLASH_SCHEME",dM="NUM",WO="WS",fM="NL",hg="OPENBRACE",pg="CLOSEBRACE",yw="OPENBRACKET",xw="CLOSEBRACKET",bw="OPENPAREN",ww="CLOSEPAREN",_w="OPENANGLEBRACKET",kw="CLOSEANGLEBRACKET",Sw="FULLWIDTHLEFTPAREN",jw="FULLWIDTHRIGHTPAREN",Nw="LEFTCORNERBRACKET",Cw="RIGHTCORNERBRACKET",Ew="LEFTWHITECORNERBRACKET",Ow="RIGHTWHITECORNERBRACKET",Tw="FULLWIDTHLESSTHAN",Aw="FULLWIDTHGREATERTHAN",Pw="AMPERSAND",Mw="APOSTROPHE",Rw="ASTERISK",jl="AT",Iw="BACKSLASH",Lw="BACKTICK",$w="CARET",Il="COLON",hM="COMMA",Dw="DOLLAR",Ca="DOT",Bw="EQUALS",pM="EXCLAMATION",fs="HYPHEN",mg="PERCENT",Fw="PIPE",zw="PLUS",Uw="POUND",gg="QUERY",mM="QUOTE",qG="FULLWIDTHMIDDLEDOT",gM="SEMI",Ea="SLASH",vg="TILDE",Hw="UNDERSCORE",KG="EMOJI",Vw="SYM";var GG=Object.freeze({__proto__:null,ALPHANUMERICAL:WG,AMPERSAND:Pw,APOSTROPHE:Mw,ASCIINUMERICAL:VG,ASTERISK:Rw,AT:jl,BACKSLASH:Iw,BACKTICK:Lw,CARET:$w,CLOSEANGLEBRACKET:kw,CLOSEBRACE:pg,CLOSEBRACKET:xw,CLOSEPAREN:ww,COLON:Il,COMMA:hM,DOLLAR:Dw,DOT:Ca,EMOJI:KG,EQUALS:Bw,EXCLAMATION:pM,FULLWIDTHGREATERTHAN:Aw,FULLWIDTHLEFTPAREN:Sw,FULLWIDTHLESSTHAN:Tw,FULLWIDTHMIDDLEDOT:qG,FULLWIDTHRIGHTPAREN:jw,HYPHEN:fs,LEFTCORNERBRACKET:Nw,LEFTWHITECORNERBRACKET:Ew,LOCALHOST:wv,NL:fM,NUM:dM,OPENANGLEBRACKET:_w,OPENBRACE:hg,OPENBRACKET:yw,OPENPAREN:bw,PERCENT:mg,PIPE:Fw,PLUS:zw,POUND:Uw,QUERY:gg,QUOTE:mM,RIGHTCORNERBRACKET:Cw,RIGHTWHITECORNERBRACKET:Ow,SCHEME:Jb,SEMI:gM,SLASH:Ea,SLASH_SCHEME:pf,SYM:Vw,TILDE:vg,TLD:HO,UNDERSCORE:Hw,UTLD:VO,UWORD:UO,WORD:go,WS:WO});const co=/[a-z]/,bm=new RegExp("\\p{L}","u"),kN=new RegExp("\\p{Emoji}","u"),uo=/\d/,SN=/\s/,y3="\r",jN=`
808`,Rje="️",Ije="‍",NN="";let nb=null,ib=null;function Lje(t=[]){const e={};bi.groups=e;const r=new bi;nb==null&&(nb=x3(Eje)),ib==null&&(ib=x3(Oje)),ge(r,"'",Mw),ge(r,"{",hg),ge(r,"}",pg),ge(r,"[",yw),ge(r,"]",xw),ge(r,"(",bw),ge(r,")",ww),ge(r,"<",_w),ge(r,">",kw),ge(r,"(",Sw),ge(r,")",jw),ge(r,"「",Nw),ge(r,"」",Cw),ge(r,"『",Ew),ge(r,"』",Ow),ge(r,"<",Tw),ge(r,">",Aw),ge(r,"&",Pw),ge(r,"*",Rw),ge(r,"@",jl),ge(r,"`",Lw),ge(r,"^",$w),ge(r,":",Il),ge(r,",",hM),ge(r,"$",Dw),ge(r,".",Ca),ge(r,"=",Bw),ge(r,"!",pM),ge(r,"-",fs),ge(r,"%",mg),ge(r,"|",Fw),ge(r,"+",zw),ge(r,"#",Uw),ge(r,"?",gg),ge(r,'"',mM),ge(r,"/",Ea),ge(r,";",gM),ge(r,"~",vg),ge(r,"_",Hw),ge(r,"\\",Iw),ge(r,"・",qG);
vendor: 9,412 bytes, lines 808-811
808const n=wr(r,uo,dM,{[DO]:!0});wr(n,uo,n);const i=wr(n,co,VG,{[fg]:!0}),s=wr(n,bm,WG,{[Wm]:!0}),a=wr(r,co,go,{[BO]:!0});wr(a,uo,i),wr(a,co,a),wr(i,uo,i),wr(i,co,i);const o=wr(r,bm,UO,{[FO]:!0});wr(o,co),wr(o,uo,s),wr(o,bm,o),wr(s,uo,s),wr(s,co),wr(s,bm,s);const c=ge(r,jN,fM,{[_N]:!0}),u=ge(r,y3,WO,{[_N]:!0}),d=wr(r,SN,WO,{[_N]:!0});ge(r,NN,d),ge(u,jN,c),ge(u,NN,d),wr(u,SN,d),ge(d,y3),ge(d,jN),wr(d,SN,d),ge(d,NN,d);const f=wr(r,kN,KG,{[HG]:!0});ge(f,"#"),wr(f,kN,f),ge(f,Rje,f);const p=ge(f,Ije);ge(p,"#"),wr(p,kN,f);const m=[[co,a],[uo,i]],y=[[co,null],[bm,o],[uo,s]];for(let v=0;v<nb.length;v++)fl(r,nb[v],HO,go,m);for(let v=0;v<ib.length;v++)fl(r,ib[v],VO,UO,y);Su(HO,{tld:!0,ascii:!0},e),Su(VO,{utld:!0,alpha:!0},e),fl(r,"file",Jb,go,m),fl(r,"mailto",Jb,go,m),fl(r,"http",pf,go,m),fl(r,"https",pf,go,m),fl(r,"ftp",pf,go,m),fl(r,"ftps",pf,go,m),Su(Jb,{scheme:!0,ascii:!0},e),Su(pf,{slashscheme:!0,ascii:!0},e),t=t.sort((v,w)=>v[0]>w[0]?1:-1);for(let v=0;v<t.length;v++){const w=t[v][0],_=t[v][1]?{[Tje]:!0}:{[Aje]:!0};w.indexOf("-")>=0?_[zO]=!0:co.test(w)?uo.test(w)?_[fg]=!0:_[BO]=!0:_[DO]=!0,v3(r,w,w,_)}return v3(r,"localhost",wv,{ascii:!0}),r.jd=new bi(Vw),{start:r,tokens:Object.assign({groups:e},GG)}}function ZG(t,e){const r=$je(e.replace(/[A-Z]/g,o=>o.toLowerCase())),n=r.length,i=[];let s=0,a=0;for(;a<n;){let o=t,c=null,u=0,d=null,f=-1,p=-1;for(;a<n&&(c=o.go(r[a]));)o=c,o.accepts()?(f=0,p=0,d=o):f>=0&&(f+=r[a].length,p++),u+=r[a].length,s+=r[a].length,a++;s-=f,a-=p,u-=f,i.push({t:d.t,v:e.slice(s-u,s),s:s-u,e:s})}return i}function $je(t){const e=[],r=t.length;let n=0;for(;n<r;){let i=t.charCodeAt(n),s,a=i<55296||i>56319||n+1===r||(s=t.charCodeAt(n+1))<56320||s>57343?t[n]:t.slice(n,n+2);e.push(a),n+=a.length}return e}function fl(t,e,r,n,i){let s;const a=e.length;for(let o=0;o<a-1;o++){const c=e[o];t.j[c]?s=t.j[c]:(s=new bi(n),s.jr=i.slice(),t.j[c]=s),t=s}return s=new bi(r),s.jr=i.slice(),t.j[e[a-1]]=s,s}function x3(t){const e=[],r=[];let n=0,i="0123456789";for(;n<t.length;){let s=0;for(;i.indexOf(t[n+s])>=0;)s++;if(s>0){e.push(r.join(""));for(let a=parseInt(t.substring(n,n+s),10);a>0;a--)r.pop();n+=s}else r.push(t[n]),n++}return e}const _v={defaultProtocol:"http",events:null,format:b3,formatHref:b3,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function vM(t,e=null){let r=Object.assign({},_v);t&&(r=Object.assign(r,t instanceof vM?t.o:t));const n=r.ignoreTags,i=[];for(let s=0;s<n.length;s++)i.push(n[s].toUpperCase());this.o=r,e&&(this.defaultRender=e),this.ignoreTags=i}vM.prototype={o:_v,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,r){const n=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=r.t in i?i[r.t]:_v[t],typeof i=="function"&&n&&(i=i(e,r))):typeof i=="function"&&n&&(i=i(e,r.t,r)),i)},getObj(t,e,r){let n=this.o[t];return typeof n=="function"&&e!=null&&(n=n(e,r.t,r)),n},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function b3(t){return t}function JG(t,e){this.t="token",this.v=t,this.tk=e}JG.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),r=t.get("truncate",e,this),n=t.get("format",e,this);return r&&n.length>r?n.substring(0,r)+"…":n},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=_v.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,r=this.toHref(t.get("defaultProtocol")),n=t.get("formatHref",r,this),i=t.get("tagName",r,e),s=this.toFormattedString(t),a={},o=t.get("className",r,e),c=t.get("target",r,e),u=t.get("rel",r,e),d=t.getObj("attributes",r,e),f=t.getObj("events",r,e);return a.href=n,o&&(a.class=o),c&&(a.target=c),u&&(a.rel=u),d&&Object.assign(a,d),{tagName:i,attributes:a,content:s,eventListeners:f}}};function yk(t,e){class r extends JG{constructor(i,s){super(i,s),this.t=t}}for(const n in e)r.prototype[n]=e[n];return r.t=t,r}const w3=yk("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),_3=yk("text"),Dje=yk("nl"),sb=yk("url",{isLink:!0,toHref(t=_v.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==wv&&t[1].t===Il}}),ls=t=>new bi(t);function Bje({groups:t}){const e=t.domain.concat([Pw,Rw,jl,Iw,Lw,$w,Dw,Bw,fs,dM,mg,Fw,zw,Uw,Ea,Vw,vg,Hw]),r=[Mw,Il,hM,Ca,pM,mg,gg,mM,gM,_w,kw,hg,pg,xw,yw,bw,ww,Sw,jw,Nw,Cw,Ew,Ow,Tw,Aw],n=[Pw,Mw,Rw,Iw,Lw,$w,Dw,Bw,fs,hg,pg,mg,Fw,zw,Uw,gg,Ea,Vw,vg,Hw],i=ls(),s=ge(i,vg);ut(s,n,s),ut(s,t.domain,s);const a=ls(),o=ls(),c=ls();ut(i,t.domain,a),ut(i,t.scheme,o),ut(i,t.slashscheme,c),ut(a,n,s),ut(a,t.domain,a);const u=ge(a,jl);ge(s,jl,u),ge(o,jl,u),ge(c,jl,u);const d=ge(s,Ca);ut(d,n,s),ut(d,t.domain,s);const f=ls();ut(u,t.domain,f),ut(f,t.domain,f);const p=ge(f,Ca);ut(p,t.domain,f);const m=ls(w3);ut(p,t.tld,m),ut(p,t.utld,m),ge(u,wv,m);const y=ge(f,fs);ge(y,fs,y),ut(y,t.domain,f),ut(m,t.domain,f),ge(m,Ca,p),ge(m,fs,y);const v=ge(m,Il);ut(v,t.numeric,w3);const w=ge(a,fs),b=ge(a,Ca);ge(w,fs,w),ut(w,t.domain,a),ut(b,n,s),ut(b,t.domain,a);const _=ls(sb);ut(b,t.tld,_),ut(b,t.utld,_),ut(_,t.domain,a),ut(_,n,s),ge(_,Ca,b),ge(_,fs,w),ge(_,jl,u);const S=ge(_,Il),N=ls(sb);ut(S,t.numeric,N);const j=ls(sb),C=ls();ut(j,e,j),ut(j,r,C),ut(C,e,j),ut(C,r,C),ge(_,Ea,j),ge(N,Ea,j);const O=ge(o,Il),P=ge(c,Il),T=ge(P,Ea),$=ge(T,Ea);ut(o,t.domain,a),ge(o,Ca,b),ge(o,fs,w),ut(c,t.domain,a),ge(c,Ca,b),ge(c,fs,w),ut(O,t.domain,j),ge(O,Ea,j),ge(O,gg,j),ut($,t.domain,j),ut($,e,j),ge($,Ea,j);const B=[[hg,pg],[yw,xw],[bw,ww],[_w,kw],[Sw,jw],[Nw,Cw],[Ew,Ow],[Tw,Aw]];for(let R=0;R<B.length;R++){const[M,F]=B[R],q=ge(j,M);ge(C,M,q),ge(q,F,j);const V=ls(sb);ut(q,e,V);const W=ls();ut(q,r),ut(V,e,V),ut(V,r,W),ut(W,e,V),ut(W,r,W),ge(V,F,j),ge(W,F,j)}return ge(i,wv,_),ge(i,fM,Dje),{start:i,tokens:GG}}function Fje(t,e,r){let n=r.length,i=0,s=[],a=[];for(;i<n;){let o=t,c=null,u=null,d=0,f=null,p=-1;for(;i<n&&!(c=o.go(r[i].t));)a.push(r[i++]);for(;i<n&&(u=c||o.go(r[i].t));)c=null,o=u,o.accepts()?(p=0,f=o):p>=0&&p++,i++,d++;if(p<0)i-=d,i<n&&(a.push(r[i]),i++);else{a.length>0&&(s.push(CN(_3,e,a)),a=[]),i-=p,d-=p;const m=f.t,y=r.slice(i-d,i);s.push(CN(m,e,y))}}return a.length>0&&s.push(CN(_3,e,a)),s}function CN(t,e,r){const n=r[0].s,i=r[r.length-1].e,s=e.slice(n,i);return new t(s,r)}const zje=typeof console<"u"&&console&&console.warn||(()=>{}),Uje="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",nr={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Hje(){return bi.groups={},nr.scanner=null,nr.parser=null,nr.tokenQueue=[],nr.pluginQueue=[],nr.customSchemes=[],nr.initialized=!1,nr}function k3(t,e=!1){if(nr.initialized&&zje(`linkifyjs: already initialized - will not register custom scheme "${t}" ${Uje}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
8091. Must only contain digits, lowercase ASCII letters or "-"
8102. Cannot start or end with "-"
8113. "-" cannot repeat`);nr.customSchemes.push([t,e])}function Vje(){nr.scanner=Lje(nr.customSchemes);for(let t=0;t<nr.tokenQueue.length;t++)nr.tokenQueue[t][1]({scanner:nr.scanner});nr.parser=Bje(nr.scanner.tokens);for(let t=0;t<nr.pluginQueue.length;t++)nr.pluginQueue[t][1]({scanner:nr.scanner,parser:nr.parser});return nr.initialized=!0,nr}function yM(t){return nr.initialized||Vje(),Fje(nr.parser.start,t,ZG(nr.scanner.start,t))}yM.scan=ZG;function YG(t,e=null,r=null){if(e&&typeof e=="object"){if(r)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);r=e,e=null}const n=new vM(r),i=yM(t),s=[];for(let a=0;a<i.length;a++){const o=i[a];o.isLink&&(!e||o.t===e)&&n.check(o)&&s.push(o.toFormattedObject(n))}return s}const xM="[\0-   ᠎ -\u2029  ]",Wje=new RegExp(xM),qje=new RegExp(`${xM}$`),Kje=new RegExp(xM,"g");function Gje(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function Zje(t){return new gn({key:new Pi("autolink"),appendTransaction:(e,r,n)=>{const i=e.some(u=>u.docChanged)&&!r.doc.eq(n.doc),s=e.some(u=>u.getMeta("preventAutolink"));if(!i||s)return;const{tr:a}=n,o=yke(r.doc,[...e]);if(Nke(o).forEach(({newRange:u})=>{const d=bke(n.doc,u,m=>m.isTextblock);let f,p;if(d.length>1)f=d[0],p=n.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ");else if(d.length){const m=n.doc.textBetween(u.from,u.to," "," ");if(!qje.test(m))return;f=d[0],p=n.doc.textBetween(f.pos,u.to,void 0," ")}if(f&&p){const m=p.split(Wje).filter(Boolean);if(m.length<=0)return!1;const y=m[m.length-1],v=f.pos+p.lastIndexOf(y);if(!y)return!1;const w=yM(y).map(b=>b.toObject(t.defaultProtocol));if(!Gje(w))return!1;w.filter(b=>b.isLink).map(b=>({...b,from:v+b.start+1,to:v+b.end+1})).filter(b=>n.schema.marks.code?!n.doc.rangeHasMark(b.from,b.to,n.schema.marks.code):!0).filter(b=>t.validate(b.value)).filter(b=>
vendor: 3,801 bytes, line 811
811t.shouldAutoLink(b.value)).forEach(b=>{oM(b.from,b.to,n.doc).some(_=>_.mark.type===t.type)||a.addMark(b.from,b.to,t.type.create({href:b.href}))})}}),!!a.steps.length)return a}})}function Jje(t){return new gn({key:new Pi("handleClickLink"),props:{handleClick:(e,r,n)=>{var i,s;if(n.button!==0||!e.editable)return!1;let a=n.target;const o=[];for(;a.nodeName!=="DIV";)o.push(a),a=a.parentNode;if(!o.find(p=>p.nodeName==="A"))return!1;const c=RG(e.state,t.type.name),u=n.target,d=(i=u==null?void 0:u.href)!==null&&i!==void 0?i:c.href,f=(s=u==null?void 0:u.target)!==null&&s!==void 0?s:c.target;return u&&d?(window.open(d,f),!0):!1}}})}function Yje(t){return new gn({key:new Pi("handlePasteLink"),props:{handlePaste:(e,r,n)=>{const{state:i}=e,{selection:s}=i,{empty:a}=s;if(a)return!1;let o="";n.content.forEach(u=>{o+=u.textContent});const c=YG(o,{defaultProtocol:t.defaultProtocol}).find(u=>u.isLink&&u.value===o);return!o||!c?!1:t.editor.commands.setMark(t.type,{href:c.href})}}})}function nu(t,e){const r=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(n=>{const i=typeof n=="string"?n:n.scheme;i&&r.push(i)}),!t||t.replace(Kje,"").match(new RegExp(`^(?:(?:${r.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Xje=qo.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){k3(t);return}k3(t.scheme,t.optionalSlashes)})},onDestroy(){Hje()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!nu(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:r=>!!nu(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!nu(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",mn(this.options.HTMLAttributes,t),0]:["a",mn(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:r}=t;return this.options.isAllowedUri(r,{defaultValidate:n=>!!nu(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:r}=t;return this.options.isAllowedUri(r,{defaultValidate:n=>!!nu(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[od({find:t=>{const e=[];if(t){const{protocols:r,defaultProtocol:n}=this.options,i=YG(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!nu(a,r),protocols:r,defaultProtocol:n}));i.length&&i.forEach(s=>e.push({text:s.value,data:{href:s.href},index:s.start}))}return e}
811,type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:r}=this.options;return this.options.autolink&&t.push(Zje({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:i=>!!nu(i,e),protocols:e,defaultProtocol:r}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(Jje({type:this.type})),this.options.linkOnPaste&&t.push(Yje({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),Qje=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,eNe=Bs.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},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}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",mn(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[IG({find:Qje,type:this.type,getAttributes:t=>{const[,,e,r,n]=t;return{src:r,alt:e,title:n}}})]}}),tNe=qn.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new gn({key:new Pi("placeholder"),props:{decorations:({doc:t,selection:e})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=e,i=[];if(!r)return null;const s=this.editor.isEmpty;return t.descendants((a,o)=>{const c=n>=o&&n<=o+a.nodeSize,u=!a.isLeaf&&vk(a);if((c||!this.options.showOnlyCurrent)&&u){const d=[this.options.emptyNodeClass];s&&d.push(this.options.emptyEditorClass);const f=qi.node(o,o+a.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:o,hasAnchor:c}):this.options.placeholder});i.push(f)}return this.options.includeChildren}),zr.create(t,i)}}})]}});function rNe({value:t,onChange:e,placeholder:r}){const n=x.useRef(null),i=SSe({extensions:[Cje,Xje.configure({openOnClick:!1,HTMLAttributes:{class:"text-primary underline"}}),eNe.configure({HTMLAttributes:{class:"rounded-lg my-4 max-w-full h-auto"}}),tNe.configure({placeholder:r||"Skriv guiden här..."})],content:t,onUpdate:({editor:c})=>e(c.getHTML()),editorProps:{attributes:{class:"prose prose-sm sm:prose-base max-w-none focus:outline-none min-h-[400px] px-4 py-3"}}});if(!i)return null;const s=()=>{const c=window.prompt("URL:");c&&i.chain().focus().extendMarkRange("link").setLink({href:c}).run()},a=async c=>{const u=c.name.split(".").pop(),d=`content/${Date.now()}-${Math.random().toString(36).slice(2)}.${u}`,{error:f}=await ie.storage.from("guide-images").upload(d,c);if(f){ke.error("Kunde inte ladda upp bild: "+f.message);return}const{data:p}=ie.storage.from("guide-images").getPublicUrl(d);i.chain().focus().setImage({src:p.publicUrl}).run()},o=({onClick:c,active:u,children:d,title:f})=>l.jsx(se,{type:"button",variant:"ghost",size:"icon",title:f,className:`h-8 w-8 ${u?"bg-secondary text-foreground":""}`,onClick:c,children:d});return l.jsxs("div",{className:"border border-border rounded-lg bg-card",children:[l.jsxs("div",{className:"flex flex-wrap gap-0.5 p-2 border-b border-border",children:[l.jsx(o,{onClick:()=>i.chain().focus().toggleHeading({level:2}).run(),active:i.isActive("heading",{level:2}),title:"Rubrik 2",children:l.jsx(soe,{className:"h-4 w-4"})}),l.jsx(o,{onClick:()=>i.chain().focus().toggleHeading({level:3}).run(),active:i.isActive("heading",{level:3}),title:"Rubrik 3",children:l.jsx(aoe,{className:"h-4 w-4"})}),l.jsx("div",{className:"w-px bg-border mx-1"}),l.jsx(o,{onClick:()=>i.chain().focus().toggleBold().run(),active:i.isActive("bold"),title:"Fet",children:l.jsx(Gae,{className:"h-4 w-4"})}),l.jsx(o,{onClick:()=>i.chain().focus().toggleItalic().run(),active:i.isActive("italic"),title:"Kursiv",children:l.jsx(uoe,{className:"h-4 w-4"})}),l.jsx("div",{className:"w-px bg-border mx-1"}),l.jsx(o,{onClick:()=>i.chain().focus().toggleBulletList().run(),active:i.isActive("bulletList"),title:"Punktlista",children:l.jsx(moe,{className:"h-4 w-4"})}),l.jsx(o,{onClick:()=>i.chain().focus().toggleOrderedList().run(),active:i.isActive("orderedList"),title:"Numrerad lista",children:l.jsx(poe,{className:"h-4 w-4"})}),l.jsx(o,{onClick:()=>i.chain().focus().toggleBlockquote().run(),active:i.isActive("blockquote"),title:"Citat",children:l.jsx(woe,{className:"h-4 w-4"})}),l.jsx(o,{onClick:()=>i.chain().focus().setHorizontalRule().run(),title:"Avdelare",children:l.jsx(xoe,{className:"h-4 w-4"})}),l.jsx("div",{className:"w-px bg-border mx-1"}),l.jsx(o,{onClick:s,active:i.isActive("link"),title:"Länk",children:l.jsx(foe,{className:"h-4 w-4"})}),l.jsx(o,{onClick:()=>{var c;return(c=n.current)==null?void 0:c.click()},title:"Bild",children:l.jsx(loe,{className:"h-4 w-4"})}),l.jsx("input",{ref:n,type:"file",accept:"image/*",className:"hidden",onChange:c=>{var d;const u=(d=c.target.files)==null?void 0:d[0];u&&a(u),c.target.value=""}}),l.jsx("div",{className:"flex-1"}),l.jsx(o,{onClick:()=>
811i.chain().focus().undo().run(),title:"Ångra",children:l.jsx(Ooe,{className:"h-4 w-4"})}),l.jsx(o,{onClick:()=>i.chain().focus().redo().run(),title:"Gör om",children:l.jsx(_oe,{className:"h-4 w-4"})})]}),l.jsx(pSe,{editor:i})]})}const S3=t=>t.toLowerCase().replace(/å|ä/g,"a").replace(/ö/g,"o").replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"");function j3(){const{id:t}=gy(),e=!t||t==="ny",r=Ti(),[n,i]=x.useState(!e),[s,a]=x.useState(!1),[o,c]=x.useState([]),[u,d]=x.useState(!1),[f,p]=x.useState(""),[m,y]=x.useState(""),[v,w]=x.useState(!1),[b,_]=x.useState(""),[S,N]=x.useState("Guide"),[j,C]=x.useState(""),[O,P]=x.useState(null),[T,$]=x.useState(""),[B,R]=x.useState(""),[M,F]=x.useState("draft");x.useEffect(()=>{ie.from("authors").select("id, name").order("sort_order").then(({data:W})=>{c(W||[])})},[]),x.useEffect(()=>{e||ie.from("guides").select("*").eq("id",t).maybeSingle().then(({data:W,error:z})=>{if(z||!W){ke.error("Kunde inte ladda guide"),r("/admin/guider");return}p(W.title),y(W.slug),w(!0),_(W.excerpt||""),N(W.category||"Guide"),C(W.read_time||""),P(W.cover_image_url),$(W.author_id||""),R(W.content||""),F(W.status||"draft"),i(!1)})},[t,e,r]),x.useEffect(()=>{!v&&e&&y(S3(f))},[f,v,e]);const q=async W=>{d(!0);const z=W.name.split(".").pop(),H=`covers/${Date.now()}-${Math.random().toString(36).slice(2)}.${z}`,{error:G}=await ie.storage.from("guide-images").upload(H,W);if(G){ke.error("Uppladdning misslyckades: "+G.message),d(!1);return}const{data:Y}=ie.storage.from("guide-images").getPublicUrl(H);P(Y.publicUrl),d(!1)},V=async W=>{if(!f.trim()){ke.error("Ange en titel");return}if(!m.trim()){ke.error("Slug saknas");return}if(!T){ke.error("Välj författare");return}a(!0);const z=W===void 0?M:W?"published":"draft",H={title:f.trim(),slug:m.trim(),excerpt:b.trim(),category:S.trim(),read_time:j.trim()||null,cover_image_url:O,author_id:T,content:B,status:z,published_at:z==="published"?M==="published"?void 0:new Date().toISOString():null};if(e){const{data:{user:G}}=await ie.auth.getUser(),{data:Y,error:U}=await ie.from("guides").insert({...H,created_by:G==null?void 0:G.id,published_at:z==="published"?new Date().toISOString():null}).select("id").single();if(U){ke.error(U.message),a(!1);return}ke.success("Guide skapad"),r(`/admin/guider/${Y.id}`)}else{const G={...H};H.published_at===void 0&&delete G.published_at;const{error:Y}=await ie.from("guides").update(G).eq("id",t);if(Y){ke.error(Y.message),a(!1);return}F(z),ke.success(z==="published"?"Guide publicerad":"Sparad")}a(!1)};return n?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(js,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):l.jsxs("div",{className:"max-w-5xl mx-auto",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3 mb-6",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(se,{asChild:!0,variant:"ghost",size:"icon",children:l.jsx(Re,{to:"/admin/guider",children:l.jsx(mH,{className:"h-4 w-4"})})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-foreground",children:e?"Ny guide":"Redigera guide"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:M==="published"?"Publicerad":"Utkast"})]})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(se,{variant:"outline",onClick:()=>V(!1),disabled:s,children:[l.jsx(IP,{className:"h-4 w-4"})," Spara utkast"]}),l.jsxs(se,{onClick:()=>V(!0),disabled:s,children:[s?l.jsx(js,{className:"h-4 w-4 animate-spin"}):null,M==="published"?"Uppdatera":"Publicera"]})]})]}),l.jsxs("div",{className:"grid lg:grid-cols-3 gap-6",children:[l.jsxs("div",{className:"lg:col-span-2 space-y-5",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{children:"Titel"}),l.jsx(ce,{value:f,onChange:W=>p(W.target.value),placeholder:"Guidens titel",maxLength:200})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{children:"Sammanfattning"}),l.jsx(Is,{value:b,onChange:W=>_(W.target.value),placeholder:"Kort beskrivning som visas i listan…",rows:3,maxLength:500})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{children:"Innehåll"}),l.jsx(rNe,{value:B,onChange:R}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Klicka på bildikonen för att ladda upp bilder direkt i texten."})]})]}),l.jsxs("div",{className:"space-y-5",children:[l.jsxs("div",{className:"bg-card border border-border rounded-xl p-4 space-y-4",children:[l.jsx("h3",{className:"text-sm font-semibold",children:"Inställningar"}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{children:"Slug (URL)"}),l.jsx(ce,{value:m,onChange:W=>{y(S3(W.target.value)),w(!0)},placeholder:"hyra-foretagsbostad"}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["/guide/",m||"..."]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{children:"Författare"}),l.jsxs(Nt,{value:T,onValueChange:$,children:[l.jsx(_t,{children:l.jsx(Ct,{placeholder:"Välj författare"})}),l.jsx(kt,{children:o.map(W=>l.jsx(De,{value:W.id,children:W.name},W.id))})]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{children:"Kategori"}),l.jsx(ce,{value:S,onChange:W=>N(W.target.value),placeholder:"t.ex. Företagsbostad"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{children:"Lästid"}),l.jsx(ce,{value:j,onChange:W=>C(W.target.value),placeholder:"t.ex. 5 min läsning"})]})]}),l.jsxs("div",{className:"bg-card border border-border rounded-xl p-4 space-y-3",children:[l.jsx("h3",{className:"text-sm font-semibold",children:"Omslagsbild"}),O?l.jsxs("div",{className:"relative",children:[l.jsx("img",{src:O,alt:"Omslag",className:"w-full aspect-[16/10] object-cover rounded-lg"}),l.jsx(se,{variant:"destructive",size:"icon",className:"absolute top-2 right-2 h-7 w-7",onClick:()=>P(null),children:l.jsx(Wi,{className:"h-3.5 w-3.5"})})]}):l.jsxs("label",{className:"flex flex-col items-center justify-center aspect-[16/10] border-2 border-dashed border-border rounded-lg cursor-pointer hover:bg-secondary/30 transition-colors",children:[u?l.jsx(js,{className:"h-6 w-6 text-muted-foreground animate-spin"}):l.jsxs(l.Fragment,{children:[l.jsx($P,{className:"h-6 w-6 text-muted-foreground mb-2"}),l.jsx("span",{className:"text-xs text-muted-foreground",children:"Ladda upp bild"})]}),l.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:W=>{var H;const z=(H=W.target.files)==null?void 0:H[0];z&&q(z)}})]})]})]})]})]})}const nNe=()=>l.jsxs("div",{className:"min-h-screen bg-background",children:[l.jsx(Pr,{}),l.jsx(Vr,{}),l.jsx("section",{className:"pt-4 sm:pt-6 pb-12 sm:pb-16",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14 max-w-5xl",children:[l.jsxs("nav",{className:"text-sm text-muted-foreground mb-8",children:[l.jsx(Re,{to:"/",className:"hover:text-foreground",children:"Hem"}),l.jsx("span",{className:"mx-2",children:"→"}),l.jsx(Re,{to:"/om-oss",className:"hover:text-foreground",children:"Om oss"}),l.jsx("span",{className:"mx-2",children:"→"}),l.jsx("span",{className:"text-foreground",children:"Annelie Permerin"})]}),l.jsxs("div",{className:"grid md:grid-cols-[280px_1fr] gap-8 md:gap-12 items-start",children:[l.jsx("div",{className:"aspect-[4/5] rounded-2xl overflow-hidden bg-accent",children:l.jsx("img",{src:Cp,alt:"Annelie Permerin",className:"w-full h-full object-cover"})}),l.jsxs("div",{children:[l.jsx("p",{className:"text-xs font-semibold text-primary uppercase tracking-[0.2em] mb-3",children:"Medarbetare"}),l.jsx("h1",{className:"text-3xl sm:text-4xl md:text-5xl font-extrabold leading-tight mb-2 font-serif",children:"Annelie Permerin"}),l.jsx("p",{className:"text-lg text-muted-foreground mb-6",children:"VD & grundare, Företagslogi"}
811),l.jsxs("div",{className:"space-y-4 text-foreground/90 leading-relaxed",children:[l.jsx("p",{children:"Annelie Permerin är grundare av Företagslogi och Bostad För Dig AB. I över 25 år har hon hjälpt företag och uthyrare att förmedla företagslägenheter."}),l.jsx("p",{children:"Med ett gediget kontaktnät har Företagslogi blivit ett av Sveriges största bolag för förmedling av bostäder till företag och en respekterad partner till flera av de allra största svenska företagen som letar efter bostäder till personal."})]}),l.jsx("div",{className:"mt-6",children:l.jsx(x2,{text:`Registrerad hyresförmedlare
812hos FMI`})}),l.jsxs("div",{className:"flex flex-wrap gap-3 mt-8",children:[l.jsx(se,{variant:"hero",asChild:!0,children:l.jsxs("a",{href:"mailto:[email protected]",children:[l.jsx(En,{className:"h-4 w-4"}),"Kontakta Annelie"]})}),l.jsx(se,{variant:"hero-outline",asChild:!0,children:l.jsxs("a",{href:"tel:+4686445820",children:[l.jsx(ai,{className:"h-4 w-4"}),"08 – 644 58 20"]})}),l.jsx(se,{variant:"hero-outline",asChild:!0,children:l.jsxs("a",{href:"https://www.linkedin.com/in/annelie-permerin-b4062043",target:"_blank",rel:"noopener noreferrer",children:[l.jsx(hoe,{className:"h-4 w-4"}),"LinkedIn"]})})]})]})]})]})}),l.jsx(Mr,{})]}),iNe=()=>l.jsxs("div",{className:"min-h-screen bg-background",children:[l.jsx(Pr,{}),l.jsx(Vr,{}),l.jsx("section",{className:"pt-4 sm:pt-6 pb-12 sm:pb-16",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14 max-w-5xl",children:[l.jsxs("nav",{className:"text-sm text-muted-foreground mb-8",children:[l.jsx(Re,{to:"/",className:"hover:text-foreground",children:"Hem"}),l.jsx("span",{className:"mx-2",children:"→"}),l.jsx(Re,{to:"/om-oss",className:"hover:text-foreground",children:"Om oss"}),l.jsx("span",{className:"mx-2",children:"→"}),l.jsx("span",{className:"text-foreground",children:"Ulrika Nyström"})]}),l.jsxs("div",{className:"grid md:grid-cols-[280px_1fr] gap-8 md:gap-12 items-start",children:[l.jsx("div",{className:"aspect-[4/5] rounded-2xl overflow-hidden bg-accent flex items-center justify-center",children:l.jsx("span",{className:"text-6xl font-bold text-primary",children:"UN"})}),l.jsxs("div",{children:[l.jsx("p",{className:"text-xs font-semibold text-primary uppercase tracking-[0.2em] mb-3",children:"Medarbetare"}),l.jsx("h1",{className:"text-3xl sm:text-4xl md:text-5xl font-extrabold leading-tight mb-2 font-serif",children:"Ulrika Nyström"}),l.jsx("p",{className:"text-lg text-muted-foreground mb-6",children:"reg. Hyresförmedlare, Företagslogi"}),l.jsxs("div",{className:"space-y-4 text-foreground/90 leading-relaxed",children:[l.jsx("p",{children:"Ulrika arbetar med förmedling av företagsbostäder pÃ¥ Företagslogi och hjälper bÃ¥de uthyrare och företag att hitta rätt matchning – frÃ¥n första kontakt till pÃ¥skrivet kontrakt."}),l.jsx("p",{children:"Med stor erfarenhet av Stockholms bostadsmarknad är Ulrika en trygg kontaktperson för dig som vill hyra ut din bostad eller söka boende för era anställda."})]}),l.jsx("div",{className:"mt-6",children:l.jsx(x2,{text:`Registrerad hyresförmedlare
813hos FMI`})}),l.jsxs("div",{className:"flex flex-wrap gap-3 mt-8",children:[l.jsx(se,{variant:"hero",asChild:!0,children:l.jsxs("a",{href:"mailto:[email protected]",children:[l.jsx(En,{className:"h-4 w-4"}),"Kontakta Ulrika"]})}),l.jsx(se,{variant:"hero-outline",asChild:!0,children:l.jsxs("a",{href:"tel:+4686445820",children:[l.jsx(ai,{className:"h-4 w-4"}),"08 – 644 58 20"]})})]})]})]})]})}),l.jsx(Mr,{})]}),EN=768;function sNe(){const[t,e]=x.useState(void 0);return x.useEffect(()=>{const r=window.matchMedia(`(max-width: ${EN-1}px)`),n=()=>{e(window.innerWidth<EN)};return r.addEventListener("change",n),e(window.innerWidth<EN),()=>r.removeEventListener("change",n)},[]),!!t}var aNe="Separator",N3="horizontal",oNe=["horizontal","vertical"],XG=x.forwardRef((t,e)=>{const{decorative:r,orientation:n=N3,...i}=t,s=lNe(n)?n:N3,o=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return l.jsx(Oe.div,{"data-orientation":s,...o,...i,ref:e})});XG.displayName=aNe;function lNe(t){return oNe.includes(t)}var QG=XG;const eZ=x.forwardRef(({className:t,orientation:e="horizontal",decorative:r=!0,...n},i)=>l.jsx(QG,{ref:i,decorative:r,orientation:e,className:fe("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...n}));eZ.displayName=QG.displayName;function C3({className:t,...e}){return l.jsx("div",{className:fe("animate-pulse rounded-md bg-muted",t),...e})}const cNe="sidebar:state",uNe=60*60*24*7,dNe="16rem",fNe="18rem",hNe="3rem",pNe="b",tZ=x.createContext(null);function Ly(){const t=x.useContext(tZ);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}const rZ=x.forwardRef(({defaultOpen:t=!0,open:e,onOpenChange:r,className:n,style:i,children:s,...a},o)=>{const c=sNe(),[u,d]=x.useState(!1),[f,p]=x.useState(t),m=e??f,y=x.useCallback(_=>{const S=typeof _=="function"?_(m):_;r?r(S):p(S),document.cookie=`${cNe}=${S}; path=/; max-age=${uNe}`},[r,m]),v=x.useCallback(()=>c?d(_=>!_):y(_=>!_),[c,y,d]);x.useEffect(()=>{const _=S=>
813{S.key===pNe&&(S.metaKey||S.ctrlKey)&&(S.preventDefault(),v())};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[v]);const w=m?"expanded":"collapsed",b=x.useMemo(()=>({state:w,open:m,setOpen:y,isMobile:c,openMobile:u,setOpenMobile:d,toggleSidebar:v}),[w,m,y,c,u,d,v]);return l.jsx(tZ.Provider,{value:b,children:l.jsx(xV,{delayDuration:0,children:l.jsx("div",{style:{"--sidebar-width":dNe,"--sidebar-width-icon":hNe,...i},className:fe("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",n),ref:o,...a,children:s})})})});rZ.displayName="SidebarProvider";const nZ=x.forwardRef(({side:t="left",variant:e="sidebar",collapsible:r="offcanvas",className:n,children:i,...s},a)=>{const{isMobile:o,state:c,openMobile:u,setOpenMobile:d}=Ly();return r==="none"?l.jsx("div",{className:fe("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",n),ref:a,...s,children:i}):o?l.jsx(Bq,{open:u,onOpenChange:d,...s,children:l.jsx(A2,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":fNe},side:t,children:l.jsx("div",{className:"flex h-full w-full flex-col",children:i})})}):l.jsxs("div",{ref:a,className:"group peer hidden text-sidebar-foreground md:block","data-state":c,"data-collapsible":c==="collapsed"?r:"","data-variant":e,"data-side":t,children:[l.jsx("div",{className:fe("relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),l.jsx("div",{className:fe("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...s,children:l.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:i})})]})});nZ.displayName="Sidebar";const iZ=x.forwardRef(({className:t,onClick:e,...r},n)=>{const{toggleSidebar:i}=Ly();return l.jsxs(se,{ref:n,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:fe("h-7 w-7",t),onClick:s=>{e==null||e(s),i()},...r,children:[l.jsx(boe,{}),l.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});iZ.displayName="SidebarTrigger";const mNe=x.forwardRef(({className:t,...e},r)=>{const{toggleSidebar:n}=Ly();return l.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:fe("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 hover:after:bg-sidebar-border sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...e})});mNe.displayName="SidebarRail";const gNe=x.forwardRef(({className:t,...e},r)=>l.jsx("main",{ref:r,className:fe("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-
813h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",t),...e}));gNe.displayName="SidebarInset";const vNe=x.forwardRef(({className:t,...e},r)=>l.jsx(ce,{ref:r,"data-sidebar":"input",className:fe("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",t),...e}));vNe.displayName="SidebarInput";const yNe=x.forwardRef(({className:t,...e},r)=>l.jsx("div",{ref:r,"data-sidebar":"header",className:fe("flex flex-col gap-2 p-2",t),...e}));yNe.displayName="SidebarHeader";const sZ=x.forwardRef(({className:t,...e},r)=>l.jsx("div",{ref:r,"data-sidebar":"footer",className:fe("flex flex-col gap-2 p-2",t),...e}));sZ.displayName="SidebarFooter";const xNe=x.forwardRef(({className:t,...e},r)=>l.jsx(eZ,{ref:r,"data-sidebar":"separator",className:fe("mx-2 w-auto bg-sidebar-border",t),...e}));xNe.displayName="SidebarSeparator";const aZ=x.forwardRef(({className:t,...e},r)=>l.jsx("div",{ref:r,"data-sidebar":"content",className:fe("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...e}));aZ.displayName="SidebarContent";const oZ=x.forwardRef(({className:t,...e},r)=>l.jsx("div",{ref:r,"data-sidebar":"group",className:fe("relative flex w-full min-w-0 flex-col p-2",t),...e}));oZ.displayName="SidebarGroup";const lZ=x.forwardRef(({className:t,asChild:e=!1,...r},n)=>{const i=e?gd:"div";return l.jsx(i,{ref:n,"data-sidebar":"group-label",className:fe("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...r})});lZ.displayName="SidebarGroupLabel";const bNe=x.forwardRef(({className:t,asChild:e=!1,...r},n)=>{const i=e?gd:"button";return l.jsx(i,{ref:n,"data-sidebar":"group-action",className:fe("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",t),...r})});bNe.displayName="SidebarGroupAction";const cZ=x.forwardRef(({className:t,...e},r)=>l.jsx("div",{ref:r,"data-sidebar":"group-content",className:fe("w-full text-sm",t),...e}));cZ.displayName="SidebarGroupContent";const uZ=x.forwardRef(({className:t,...e},r)=>l.jsx("ul",{ref:r,"data-sidebar":"menu",className:fe("flex w-full min-w-0 flex-col gap-1",t),...e}));uZ.displayName="SidebarMenu";const dZ=x.forwardRef(({className:t,...e},r)=>l.jsx("li",{ref:r,"data-sidebar":"menu-item",className:fe("group/menu-item relative",t),...e}));dZ.displayName="SidebarMenuItem";const wNe=gp("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),fZ=x.forwardRef(({asChild:t=!1,isActive:e=!1,variant:r="default",size:n="default",tooltip:i,className:s,...a},o)=>{const c=t?gd:"button",{isMobile:u,state:d}=Ly(),f=l.jsx(c,{ref:o,"data-sidebar":"menu-button","data-size":n,"data-active":e,className:fe(wNe({variant:r,size:n}),s),...a}
813);return i?(typeof i=="string"&&(i={children:i}),l.jsxs(Qce,{children:[l.jsx(eue,{asChild:!0,children:f}),l.jsx(bV,{side:"right",align:"center",hidden:d!=="collapsed"||u,...i})]})):f});fZ.displayName="SidebarMenuButton";const _Ne=x.forwardRef(({className:t,asChild:e=!1,showOnHover:r=!1,...n},i)=>{const s=e?gd:"button";return l.jsx(s,{ref:i,"data-sidebar":"menu-action",className:fe("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",t),...n})});_Ne.displayName="SidebarMenuAction";const kNe=x.forwardRef(({className:t,...e},r)=>l.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:fe("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...e}));kNe.displayName="SidebarMenuBadge";const SNe=x.forwardRef(({className:t,showIcon:e=!1,...r},n)=>{const i=x.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return l.jsxs("div",{ref:n,"data-sidebar":"menu-skeleton",className:fe("flex h-8 items-center gap-2 rounded-md px-2",t),...r,children:[e&&l.jsx(C3,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),l.jsx(C3,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":i}})]})});SNe.displayName="SidebarMenuSkeleton";const jNe=x.forwardRef(({className:t,...e},r)=>l.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:fe("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...e}));jNe.displayName="SidebarMenuSub";const NNe=x.forwardRef(({...t},e)=>l.jsx("li",{ref:e,...t}));NNe.displayName="SidebarMenuSubItem";const CNe=x.forwardRef(({asChild:t=!1,size:e="md",isActive:r,className:n,...i},s)=>{const a=t?gd:"a";return l.jsx(a,{ref:s,"data-sidebar":"menu-sub-button","data-size":e,"data-active":r,className:fe("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",e==="sm"&&"text-xs",e==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...i})});CNe.displayName="SidebarMenuSubButton";const hZ=x.forwardRef(({className:t,activeClassName:e,pendingClassName:r,to:n,...i},s)=>l.jsx(use,{ref:s,to:n,className:({isActive:a,isPending:o})=>fe(t,a&&e,o&&r),...i}));hZ.displayName="NavLink";const ENe=(t,e,r)=>[{label:"ANVÄNDARE",items:[{title:"Alla användare",url:"/admin/anvandare",icon:jE},{title:"Företag",url:"/admin/foretag",icon:vc},{title:"Uthyrare",url:"/admin/uthyrare",icon:PH},{title:"Hyresgäster",url:"/admin/hyresgaster",icon:jE}]},{label:"OBJEKT",items:[{title:"Alla objekt",url:"/admin/objekt",icon:Ss},{title:"Väntar på godkännande",url:"/admin/godkannande",icon:kH,badge:t},{title:"Flaggade",url:"/admin/flaggade",icon:noe}]},{label:"FÖRMEDLING",items:[{title:"Intresseanmälningar bostäder",url:"/admin/bostadsforfragningar",icon:g$,dot:e},{title:"Förfrågningar företag",url:"/admin/forfragningar",icon:g$,dot:r}]},{label:"INNEHÅLL",items:[{title:"Guider & artiklar",url:"/admin/guider",icon:yH}]},{label:"INSTÄLLNINGAR",items:[{title:"Städer & områden",url:"/admin/stader",icon:Vn},{title:"Legacy-områden",url:"/admin/legacy-omraden",icon:Vn}]}];function ONe(){const{state:t}=Ly(),e=t==="collapsed",r=Ti(),[n,i]=x.useState(0),[s,a]=x.useState(0),[o,c]=x.useState(0);x.useEffect(()=>{const f=async()=>{const{count:m}=await ie.from("properties").select("*",{count:"exact",head:!0}
813).eq("status","pending");i(m||0)};f();const p=ie.channel("admin-pending-properties").on("postgres_changes",{event:"*",schema:"public",table:"properties"},f).subscribe();return()=>{ie.removeChannel(p)}},[]),x.useEffect(()=>{const f=async()=>{const[{count:m},{count:y}]=await Promise.all([ie.from("property_inquiries").select("*",{count:"exact",head:!0}).eq("status","new"),ie.from("company_inquiries").select("*",{count:"exact",head:!0}).eq("status","new")]);a(m||0),c(y||0)};f();const p=ie.channel("admin-new-inquiries").on("postgres_changes",{event:"*",schema:"public",table:"property_inquiries"},f).on("postgres_changes",{event:"*",schema:"public",table:"company_inquiries"},f).subscribe();return()=>{ie.removeChannel(p)}},[]);const u=ENe(n,s,o),d=async()=>{await ie.auth.signOut(),r("/logga-in")};return l.jsxs(nZ,{collapsible:"icon",className:"border-r border-sidebar-border bg-sidebar",children:[l.jsxs(aZ,{className:"pt-4",children:[!e&&l.jsx("div",{className:"px-2 pb-4 mb-2",children:l.jsx("img",{src:XP,alt:"Företagslogi",className:"h-40 w-auto object-contain"})}),u.map(f=>l.jsxs(oZ,{children:[l.jsxs(lZ,{className:"text-[11px] font-semibold text-muted-foreground tracking-wider flex items-center justify-between",children:[f.label,l.jsx(xp,{className:"h-3 w-3 text-muted-foreground/50"})]}),l.jsx(cZ,{children:l.jsx(uZ,{children:f.items.map(p=>l.jsx(dZ,{children:l.jsx(fZ,{asChild:!0,children:l.jsxs(hZ,{to:p.url,end:p.url==="/admin",className:"flex items-center gap-3 px-3 py-2 rounded-lg text-sm text-muted-foreground hover:text-foreground hover:bg-secondary transition-colors",activeClassName:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground font-medium",children:[l.jsx(p.icon,{className:"h-4 w-4 shrink-0"}),!e&&l.jsx("span",{className:"flex-1",children:p.title}),"dot"in p&&p.dot>0&&l.jsxs("span",{className:"relative ml-auto flex h-2.5 w-2.5 shrink-0",children:[l.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-destructive opacity-60"}),l.jsx("span",{className:"relative inline-flex h-2.5 w-2.5 rounded-full bg-destructive"})]}),!e&&"badge"in p&&p.badge&&l.jsx("span",{className:"ml-auto bg-destructive text-destructive-foreground text-[10px] font-bold rounded-full w-5 h-5 flex items-center justify-center",children:p.badge})]})})},p.url))})})]},f.label))]}),l.jsxs(sZ,{className:"p-3 border-t border-sidebar-border",children:[!e&&l.jsx("p",{className:"text-[10px] text-muted-foreground/50 px-3 mb-2",children:"Företagslogi Admin v1.0"}),l.jsxs(se,{variant:"ghost",size:"sm",className:"w-full justify-start text-muted-foreground hover:text-foreground",onClick:d,children:[l.jsx(CH,{className:"mr-2 h-4 w-4"}),!e&&"Logga ut"]})]})]})}function TNe(){const[t,e]=x.useState(!0),[r,n]=x.useState(!1),[i,s]=x.useState(null),a=Ti();return x.useEffect(()=>{(async()=>{var p;const{data:{session:u}}=await ie.auth.getSession();if(console.log("[AdminAuth] session:",((p=u==null?void 0:u.user)==null?void 0:p.email)??"none"),!u){a("/admin/logga-in");return}s(u.user.id);const{data:d,error:f}=await ie.from("user_roles").select("role").eq("user_id",u.user.id).eq("role","admin").maybeSingle();if(console.log("[AdminAuth] role query:",{data:d,error:f}),!d){a("/");return}n(!0),e(!1)})();const{data:{subscription:c}}=ie.auth.onAuthStateChange((u,d)=>{d||a("/admin/logga-in")});return()=>c.unsubscribe()},[a]),{loading:t,isAdmin:r,userId:i}}const ANe={"/admin":"Ekonomi","/admin/anvandare":"Användare","/admin/foretag":"Företag","/admin/uthyrare":"Uthyrare","/admin/hyresgaster":"Hyresgäster","/admin/objekt":"Objekt","/admin/objekt/nytt":"Nytt objekt","/admin/godkannande":"Godkännande","/admin/flaggade":"Flaggade","/admin/bokningar":"Bokningar","/admin/visningar":"Visningar","/admin/sokprofiler":"Sökprofiler","/admin/forfragningar":"Förfrågningar bostadsförmedling","/admin/bostadsforfragningar":"Intresseanmälningar bostäder","/admin/stader":"Städer & områden","/admin/guider":"Guider & artiklar","/admin/fakturor":"Fakturor","/admin/rapporter":"Rapporter"};function PNe(){const{loading:t,isAdmin:e}=TNe(),{pathname:r}=Oi(),n=ANe[r]||"Dashboard";return t||!e?l.jsx("div",{className:"admin-dark min-h-screen flex items-center justify-center bg-background",children:l.jsxs("div",{className:"flex flex-col items-center gap-3",children:[l.jsx("div",{className:"w-8 h-8 border-2 border-primary border-t-transparent roun
813ded-full animate-spin"}),l.jsx("p",{className:"text-muted-foreground text-sm",children:"Laddar..."})]})}):l.jsx("div",{children:l.jsx(rZ,{children:l.jsxs("div",{className:"min-h-screen flex w-full bg-background",children:[l.jsx(ONe,{}),l.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[l.jsxs("header",{className:"h-14 flex items-center border-b border-border px-4 bg-card/50 backdrop-blur-sm gap-4",children:[l.jsx(iZ,{className:"text-muted-foreground hover:text-foreground"}),l.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[l.jsx(Ss,{className:"h-4 w-4"}),l.jsx("span",{className:"text-muted-foreground/50",children:"›"}),l.jsx("span",{className:"text-foreground font-medium",children:n})]}),l.jsx("div",{className:"flex-1"}),l.jsx(se,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-foreground h-9 w-9",children:l.jsx(M0,{className:"h-4 w-4"})}),l.jsxs(se,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-foreground h-9 w-9 relative",children:[l.jsx(Kae,{className:"h-4 w-4"}),l.jsx("span",{className:"absolute top-1.5 right-1.5 w-2 h-2 bg-destructive rounded-full"})]}),l.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/20 flex items-center justify-center",children:l.jsx("span",{className:"text-primary text-xs font-bold",children:"A"})})]}),l.jsx("main",{className:"flex-1 p-6 overflow-auto",children:l.jsx($U,{})})]})]})})})}var MNe=Array.isArray,Mi=MNe,RNe=typeof Am=="object"&&Am&&Am.Object===Object&&Am,pZ=RNe,INe=pZ,LNe=typeof self=="object"&&self&&self.Object===Object&&self,$Ne=INe||LNe||Function("return this")(),eo=$Ne,DNe=eo,BNe=DNe.Symbol,$y=BNe,E3=$y,mZ=Object.prototype,FNe=mZ.hasOwnProperty,zNe=mZ.toString,wm=E3?E3.toStringTag:void 0;function UNe(t){var e=FNe.call(t,wm),r=t[wm];try{t[wm]=void 0;var n=!0}catch{}var i=zNe.call(t);return n&&(e?t[wm]=r:delete t[wm]),i}var HNe=UNe,VNe=Object.prototype,WNe=VNe.toString;function qNe(t){return WNe.call(t)}var KNe=qNe,O3=$y,GNe=HNe,ZNe=KNe,JNe="[object Null]",YNe="[object Undefined]",T3=O3?O3.toStringTag:void 0;function XNe(t){return t==null?t===void 0?YNe:JNe:T3&&T3 in Object(t)?GNe(t):ZNe(t)}var rl=XNe;function QNe(t){return t!=null&&typeof t=="object"}var nl=QNe,eCe=rl,tCe=nl,rCe="[object Symbol]";function nCe(t){return typeof t=="symbol"||tCe(t)&&eCe(t)==rCe}var Tp=nCe,iCe=Mi,sCe=Tp,aCe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,oCe=/^\w*$/;function lCe(t,e){if(iCe(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||sCe(t)?!0:oCe.test(t)||!aCe.test(t)||e!=null&&t in Object(e)}var bM=lCe;function cCe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Uc=cCe;const Ap=St(Uc);var uCe=rl,dCe=Uc,fCe="[object AsyncFunction]",hCe="[object Function]",pCe="[object GeneratorFunction]",mCe="[object Proxy]";function gCe(t){if(!dCe(t))return!1;var e=uCe(t);return e==hCe||e==pCe||e==fCe||e==mCe}var wM=gCe;const Je=St(wM);var vCe=eo,yCe=vCe["__core-js_shared__"],xCe=yCe,ON=xCe,A3=function(){var t=/[^.]+$/.exec(ON&&ON.keys&&ON.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function bCe(t){return!!A3&&A3 in t}var wCe=bCe,_Ce=Function.prototype,kCe=_Ce.toString;function SCe(t){if(t!=null){try{return kCe.call(t)}catch{}try{return t+""}catch{}}return""}var gZ=SCe,jCe=wM,NCe=wCe,CCe=Uc,ECe=gZ,OCe=/[\\^$.*+?()[\]{}|]/g,TCe=/^\[object .+?Constructor\]$/,ACe=Function.prototype,PCe=Object.prototype,MCe=ACe.toString,RCe=PCe.hasOwnProperty,ICe=RegExp("^"+MCe.call(RCe).replace(OCe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function LCe(t){if(!CCe(t)||NCe(t))return!1;var e=jCe(t)?ICe:TCe;return e.test(ECe(t))}var $Ce=LCe;function DCe(t,e){return t==null?void 0:t[e]}var BCe=DCe,FCe=$Ce,zCe=BCe;function UCe(t,e){var r=zCe(t,e);return FCe(r)?r:void 0}var Sd=UCe,HCe=Sd,VCe=HCe(Object,"create"),xk=VCe,P3=xk;function WCe(){this.__data__=P3?P3(null):{},this.size=0}var qCe=WCe;function KCe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var GCe=KCe,ZCe=xk,JCe="__lodash_hash_undefined__",YCe=Object.prototype,XCe=YCe.hasOwnProperty;function QCe(t){var e=this.__data__;if(ZCe){var r=e[t];return r===JCe?void 0:r}return XCe.call(e,t)?e[t]:void 0}var eEe=QCe,tEe=xk,rEe=Object.prototype,nEe=rEe.hasOwnProperty;function iEe(t){var e=this.__data__;return tEe?e[t]!==void 0:nEe.call(e,t)}var sEe=iEe,aEe=xk,oEe="__lodash_hash_undefined__";function lEe(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=aEe&&e===void 0?oEe:e,this}var cEe=lEe,uEe=qCe,dEe=GCe,fEe=eEe,hEe=sEe,pEe=cEe;function Pp(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Pp.prototype.clear=uEe;Pp.prototype.delete=dEe;Pp.prototype.get=fEe;Pp.prototype.has=hEe;Pp.prototype.set=pEe;var mEe=Pp;function gEe(){this.__data__=[],this.size=0}var vEe=gEe;function yEe(t,e){return t===e||t!==t&&e!==e}var _M=yEe,xEe=_M;function bEe(t,e){for(var r=t.length;r--;)if(xEe(t[r][0],e))return r;return-1}var bk=bEe,wEe=bk,_Ee=Array.prototype,kEe=_Ee.splice;function SEe(t){var e=this.__data__,r=wEe(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():kEe.call(e,r,1),--this.size,!0}var jEe=SEe,NEe=bk;function CEe(t){var e=this.__data__,r=NEe(e,t);return r<0?void 0:e[r][1]}var EEe=CEe,OEe=bk;function TEe(t){return OEe(this.__data__,t)>-1}
vendor: 1,825 bytes, line 813
813var AEe=TEe,PEe=bk;function MEe(t,e){var r=this.__data__,n=PEe(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var REe=MEe,IEe=vEe,LEe=jEe,$Ee=EEe,DEe=AEe,BEe=REe;function Mp(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Mp.prototype.clear=IEe;Mp.prototype.delete=LEe;Mp.prototype.get=$Ee;Mp.prototype.has=DEe;Mp.prototype.set=BEe;var wk=Mp,FEe=Sd,zEe=eo,UEe=FEe(zEe,"Map"),kM=UEe,M3=mEe,HEe=wk,VEe=kM;function WEe(){this.size=0,this.__data__={hash:new M3,map:new(VEe||HEe),string:new M3}}var qEe=WEe;function KEe(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var GEe=KEe,ZEe=GEe;function JEe(t,e){var r=t.__data__;return ZEe(e)?r[typeof e=="string"?"string":"hash"]:r.map}var _k=JEe,YEe=_k;function XEe(t){var e=YEe(this,t).delete(t);return this.size-=e?1:0,e}var QEe=XEe,eOe=_k;function tOe(t){return eOe(this,t).get(t)}var rOe=tOe,nOe=_k;function iOe(t){return nOe(this,t).has(t)}var sOe=iOe,aOe=_k;function oOe(t,e){var r=aOe(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var lOe=oOe,cOe=qEe,uOe=QEe,dOe=rOe,fOe=sOe,hOe=lOe;function Rp(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Rp.prototype.clear=cOe;Rp.prototype.delete=uOe;Rp.prototype.get=dOe;Rp.prototype.has=fOe;Rp.prototype.set=hOe;var SM=Rp,vZ=SM,pOe="Expected a function";function jM(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(pOe);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var a=t.apply(this,n);return r.cache=s.set(i,a)||s,a};return r.cache=new(jM.Cache||vZ),r}jM.Cache=vZ;var yZ=jM;const mOe=St(yZ);var gOe=yZ,vOe=500;function yOe(t){var e=gOe(t,function(n){return r.size===vOe&&r.clear(),n}
vendor: 6,750 bytes, lines 813-821
813),r=e.cache;return e}var xOe=yOe,bOe=xOe,wOe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_Oe=/\\(\\)?/g,kOe=bOe(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(wOe,function(r,n,i,s){e.push(i?s.replace(_Oe,"$1"):n||r)}),e}),SOe=kOe;function jOe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var NM=jOe,R3=$y,NOe=NM,COe=Mi,EOe=Tp,OOe=1/0,I3=R3?R3.prototype:void 0,L3=I3?I3.toString:void 0;function xZ(t){if(typeof t=="string")return t;if(COe(t))return NOe(t,xZ)+"";if(EOe(t))return L3?L3.call(t):"";var e=t+"";return e=="0"&&1/t==-OOe?"-0":e}var TOe=xZ,AOe=TOe;function POe(t){return t==null?"":AOe(t)}var bZ=POe,MOe=Mi,ROe=bM,IOe=SOe,LOe=bZ;function $Oe(t,e){return MOe(t)?t:ROe(t,e)?[t]:IOe(LOe(t))}var wZ=$Oe,DOe=Tp,BOe=1/0;function FOe(t){if(typeof t=="string"||DOe(t))return t;var e=t+"";return e=="0"&&1/t==-BOe?"-0":e}var kk=FOe,zOe=wZ,UOe=kk;function HOe(t,e){e=zOe(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[UOe(e[r++])];return r&&r==n?t:void 0}var CM=HOe,VOe=CM;function WOe(t,e,r){var n=t==null?void 0:VOe(t,e);return n===void 0?r:n}var _Z=WOe;const Zi=St(_Z);function qOe(t){return t==null}var KOe=qOe;const vt=St(KOe);var GOe=rl,ZOe=Mi,JOe=nl,YOe="[object String]";function XOe(t){return typeof t=="string"||!ZOe(t)&&JOe(t)&&GOe(t)==YOe}var QOe=XOe;const ld=St(QOe);var kZ={exports:{}},Lt={};/**
814 * @license React
815 * react-is.production.min.js
816 *
817 * Copyright (c) Facebook, Inc. and its affiliates.
818 *
819 * This source code is licensed under the MIT license found in the
820 * LICENSE file in the root directory of this source tree.
821 */var EM=Symbol.for("react.element"),OM=Symbol.for("react.portal"),Sk=Symbol.for("react.fragment"),jk=Symbol.for("react.strict_mode"),Nk=Symbol.for("react.profiler"),Ck=Symbol.for("react.provider"),Ek=Symbol.for("react.context"),eTe=Symbol.for("react.server_context"),Ok=Symbol.for("react.forward_ref"),Tk=Symbol.for("react.suspense"),Ak=Symbol.for("react.suspense_list"),Pk=Symbol.for("react.memo"),Mk=Symbol.for("react.lazy"),tTe=Symbol.for("react.offscreen"),SZ;SZ=Symbol.for("react.module.reference");function Fs(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case EM:switch(t=t.type,t){case Sk:case Nk:case jk:case Tk:case Ak:return t;default:switch(t=t&&t.$$typeof,t){case eTe:case Ek:case Ok:case Mk:case Pk:case Ck:return t;default:return e}}case OM:return e}}}Lt.ContextConsumer=Ek;Lt.ContextProvider=Ck;Lt.Element=EM;Lt.ForwardRef=Ok;Lt.Fragment=Sk;Lt.Lazy=Mk;Lt.Memo=Pk;Lt.Portal=OM;Lt.Profiler=Nk;Lt.StrictMode=jk;Lt.Suspense=Tk;Lt.SuspenseList=Ak;Lt.isAsyncMode=function(){return!1};Lt.isConcurrentMode=function(){return!1};Lt.isContextConsumer=function(t){return Fs(t)===Ek};Lt.isContextProvider=function(t){return Fs(t)===Ck};Lt.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===EM};Lt.isForwardRef=function(t){return Fs(t)===Ok};Lt.isFragment=function(t){return Fs(t)===Sk};Lt.isLazy=function(t){return Fs(t)===Mk};Lt.isMemo=function(t){return Fs(t)===Pk};Lt.isPortal=function(t){return Fs(t)===OM};Lt.isProfiler=function(t){return Fs(t)===Nk};Lt.isStrictMode=function(t){return Fs(t)===jk};Lt.isSuspense=function(t){return Fs(t)===Tk};Lt.isSuspenseList=function(t){return Fs(t)===Ak};Lt.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===Sk||t===Nk||t===jk||t===Tk||t===Ak||t===tTe||typeof t=="object"&&t!==null&&(t.$$typeof===Mk||t.$$typeof===Pk||t.$$typeof===Ck||t.$$typeof===Ek||t.$$typeof===Ok||t.$$typeof===SZ||t.getModuleId!==void 0)};Lt.typeOf=Fs;kZ.exports=Lt;var rTe=kZ.exports,nTe=rl,iTe=nl,sTe="[object Number]";function aTe(t){return typeof t=="number"||iTe(t)&&nTe(t)==sTe}var jZ=aTe;const oTe=St(jZ);var lTe=jZ;function cTe(t){return lTe(t)&&t!=+t}var uTe=cTe;const Dy=St(uTe);var ri=function(e){return e===0?0:e>0?1:-1},ju=function(e){return ld(e)&&e.indexOf("%")===e.length-1},xe=function(e){return oTe(e)&&!Dy(e)},dTe=function(e){return vt(e)},en=function(e){return xe(e)||ld(e)},fTe=0,By=function(e){var r=++fTe;return"".concat(e||"").concat(r)},ni=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!xe(e)&&!ld(e))return n;var s;if(ju(e)){var a=e.indexOf("%");s=r*parseFloat(e.slice(0,a))/100}else s=+e;return Dy(s)&&(s=n),i&&s>r&&(s=r),s},Ll=function(e){if(!e)return null;var r=Object.keys(e);return r&&r.length?e[r[0]]:null},hTe=function(e){if(!Array.isArray(e))return!1;for(var r=e.length,n={},i=0;i<r;i++)if(!n[e[i]])n[e[i]]=!0;else return!0;return!1},Nl=function(e,r){return xe(e)&&xe(r)?function(n){return e+n*(r-e)}:function(){return r}};function qO(t,e,r){return!t||!t.length?null:t.find(function(n){return n&&(typeof e=="function"?e(n):Zi(n,e))===r})}var pTe=function(e,r){return xe(e)&&xe(r)?e-r:ld(e)&&ld(r)?e.localeCompare(r):e instanceof Date&&r instanceof Date?e.getTime()-r.getTime():String(e).localeCompare(String(r))};function eh(t,e){for(var r in t)if({}.hasOwnProperty.call(t,r)&&(!{}.hasOwnProperty.call(e,r)||t[r]!==e[r]))return!1;for(var n in e)if({}.hasOwnProperty.call(e,n)&&!{}.hasOwnProperty.call(t,n))return!1;return!0}function KO(t){"@babel/helpers - typeof";return KO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},KO(t)}var mTe=["viewBox","children"],gTe=["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","colorRen
821dering","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"],$3=["points","pathLength"],TN={svg:mTe,polygon:$3,polyline:$3},TM=["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","onDrag
821Capture","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"],Ww=function(e,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(x.isValidElement(e)&&(n=e.props),!Ap(n))return null;var i={};return Object.keys(n).forEach(function(s){TM.includes(s)&&(i[s]=r||function(a){return n[s](n,a)})}),i},vTe=function(e,r,n){return function(i){return e(r,n,i),null}},cd=function(e,r,n){if(!Ap(e)||KO(e)!=="object")return null;var i=null;return Object.keys(e).forEach(function(s){var a=e[s];TM.includes(s)&&typeof a=="function"&&(i||(i={}),i[s]=vTe(a,r,n))}),i},yTe=["children"],xTe=["children"];function D3(t,e){if(t==null)return{};var r=bTe(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function bTe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var B3={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"},Mo=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},F3=null,AN=null,AM=function t(e){if(e===F3&&Array.isArray(AN))return AN;var r=[];return x.Children.forEach(e,function(n){vt(n)||(rTe.isFragment(n)?r=r.concat(t(n.props.children)):r.push(n))}),AN=r,F3=e,r};function Ts(t,e){var r=[],n=[];return Array.isArray(e)?n=e.map(function(i){return Mo(i)}):n=[Mo(e)],AM(t).forEach(function(i){var s=Zi(i,"type.displayName")||Zi(i,"type.name");n.indexOf(s)!==-1&&r.push(i)}),r}function Di(t,e){var r=Ts(t,e);return r&&r[0]}var z3=function(e){if(!e||!e.props)return!1;var r=e.props,n=r.width,i=r.height;return!(!xe(n)||n<=0||!xe(i)||i<=0)},wTe=["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"],_Te=function(e){return e&&e.type&&ld(e.type)&&wTe.indexOf(e.type)>=0},kTe=function(e,r,n,i){var s,a=(s=TN==null?void 0:TN[i])!==null&&s!==void 0?s:[];return r.startsWith("data-")||!Je(e)&&(i&&a.includes(r)||gTe.includes(r))||n&&TM.includes(r)},Ge=function(e,r,n){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(x.isValidElement(e)&&(i=e.props),!Ap(i))return null;var s={};
821return Object.keys(i).forEach(function(a){var o;kTe((o=i)===null||o===void 0?void 0:o[a],a,r,n)&&(s[a]=i[a])}),s},GO=function t(e,r){if(e===r)return!0;var n=x.Children.count(e);if(n!==x.Children.count(r))return!1;if(n===0)return!0;if(n===1)return U3(Array.isArray(e)?e[0]:e,Array.isArray(r)?r[0]:r);for(var i=0;i<n;i++){var s=e[i],a=r[i];if(Array.isArray(s)||Array.isArray(a)){if(!t(s,a))return!1}else if(!U3(s,a))return!1}return!0},U3=function(e,r){if(vt(e)&&vt(r))return!0;if(!vt(e)&&!vt(r)){var n=e.props||{},i=n.children,s=D3(n,yTe),a=r.props||{},o=a.children,c=D3(a,xTe);return i&&o?eh(s,c)&&GO(i,o):!i&&!o?eh(s,c):!1}return!1},H3=function(e,r){var n=[],i={};return AM(e).forEach(function(s,a){if(_Te(s))n.push(s);else if(s){var o=Mo(s.type),c=r[o]||{},u=c.handler,d=c.once;if(u&&(!d||!i[o])){var f=u(s,o,a);n.push(f),i[o]=!0}}}),n},STe=function(e){var r=e&&e.type;return r&&B3[r]?B3[r]:null},jTe=function(e,r){return AM(r).indexOf(e)},NTe=["children","width","height","viewBox","className","style","title","desc"];function ZO(){return ZO=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ZO.apply(this,arguments)}function CTe(t,e){if(t==null)return{};var r=ETe(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function ETe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function JO(t){var e=t.children,r=t.width,n=t.height,i=t.viewBox,s=t.className,a=t.style,o=t.title,c=t.desc,u=CTe(t,NTe),d=i||{width:r,height:n,x:0,y:0},f=at("recharts-surface",s);return D.createElement("svg",ZO({},Ge(u,!0,"svg"),{className:f,width:r,height:n,style:a,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),D.createElement("title",null,o),D.createElement("desc",null,c),e)}var OTe=["children","className"];function YO(){return YO=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},YO.apply(this,arguments)}function TTe(t,e){if(t==null)return{};var r=ATe(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function ATe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var Rt=D.forwardRef(function(t,e){var r=t.children,n=t.className,i=TTe(t,OTe),s=at("recharts-layer",n);return D.createElement("g",YO({className:s},Ge(i,!0),{ref:e}),r)}),ua=function(e,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s]};function PTe(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var s=Array(i);++n<i;)s[n]=t[n+e];return s}var MTe=PTe,RTe=MTe;function ITe(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:RTe(t,e,r)}var LTe=ITe,$Te="\\ud800-\\udfff",DTe="\\u0300-\\u036f",BTe="\\ufe20-\\ufe2f",FTe="\\u20d0-\\u20ff",zTe=DTe+BTe+FTe,UTe="\\ufe0e\\ufe0f",HTe="\\u200d",VTe=RegExp("["+HTe+$Te+zTe+UTe+"]");function WTe(t){return VTe.test(t)}var NZ=WTe;function qTe(t){return t.split("")}var KTe=qTe,CZ="\\ud800-\\udfff",GTe="\\u0300-\\u036f",ZTe="\\ufe20-\\ufe2f",JTe="\\u20d0-\\u20ff",YTe=GTe+ZTe+JTe,XTe="\\ufe0e\\ufe0f",QTe="["+CZ+"]",XO="["+YTe+"]",QO="\\ud83c[\\udffb-\\udfff]",eAe="(?:"+XO+"|"+QO+")",EZ="[^"+CZ+"]",OZ="(?:\\ud83c[\\udde6-\\uddff]){2}",TZ="[\\ud800-\\udbff][\\udc00-\\udfff]",tAe="\\u200d",AZ=eAe+"?",PZ="["+XTe+"]?",rAe="(?:"+tAe+"(?:"+[EZ,OZ,TZ].join("|")+")"+PZ+AZ+")*",nAe=PZ+AZ+rAe,iAe="(?:"+[EZ+XO+"?",XO,OZ,TZ,QTe].join("|")+")",sAe=RegExp(QO+"(?="+QO+")|"+iAe+nAe,"g");function aAe(t){return t.match(sAe)||[]}var oAe=aAe,lAe=KTe,cAe=NZ,uAe=oAe;function dAe(t){return cAe(t)?uAe(t):lAe(t)}var fAe=dAe,hAe=LTe,pAe=NZ,mAe=fAe,gAe=bZ;function vAe(t){return function(e){e=gAe(e);var r=pAe(e)?mAe(e):void 0,n=r?r[0]:e.charAt(0),i=r?hAe(r,1).join(""):e.slice(1);return n[t]()+i}}var yAe=vAe,xAe=yAe,bAe=xAe("toUpperCase"),wAe=bAe;const Rk=St(wAe);function Jt(t){return function(){return t}}const MZ=Math.cos,qw=Math.sin,ya=Math.sqrt,Kw=Math.PI,Ik=2*Kw,eT=Math.PI,tT=2*eT,uu=1e-6,_Ae=tT-uu;function RZ(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}function kAe(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return RZ;const r=10**e;return function(n){this._+=n[0];for(let i=1,s=n.length;i<s;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}class SAe{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?RZ:kAe(e)}moveTo(e,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,r){this._append`L${this._x1=+e},${this._y1=+r}`}quadraticCurveTo(e,r,n,i){this._append`Q${+e},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(e,r,n,i,s,a){this._append`C${+e},${+r},${+n}
821,${+i},${this._x1=+s},${this._y1=+a}`}arcTo(e,r,n,i,s){if(e=+e,r=+r,n=+n,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,c=n-e,u=i-r,d=a-e,f=o-r,p=d*d+f*f;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(p>uu)if(!(Math.abs(f*c-u*d)>uu)||!s)this._append`L${this._x1=e},${this._y1=r}`;else{let m=n-a,y=i-o,v=c*c+u*u,w=m*m+y*y,b=Math.sqrt(v),_=Math.sqrt(p),S=s*Math.tan((eT-Math.acos((v+p-w)/(2*b*_)))/2),N=S/_,j=S/b;Math.abs(N-1)>uu&&this._append`L${e+N*d},${r+N*f}`,this._append`A${s},${s},0,0,${+(f*m>d*y)},${this._x1=e+j*c},${this._y1=r+j*u}`}}arc(e,r,n,i,s,a){if(e=+e,r=+r,n=+n,a=!!a,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),c=n*Math.sin(i),u=e+o,d=r+c,f=1^a,p=a?i-s:s-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>uu||Math.abs(this._y1-d)>uu)&&this._append`L${u},${d}`,n&&(p<0&&(p=p%tT+tT),p>_Ae?this._append`A${n},${n},0,1,${f},${e-o},${r-c}A${n},${n},0,1,${f},${this._x1=u},${this._y1=d}`:p>uu&&this._append`A${n},${n},0,${+(p>=eT)},${f},${this._x1=e+n*Math.cos(s)},${this._y1=r+n*Math.sin(s)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function PM(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new SAe(e)}function MM(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function IZ(t){this._context=t}IZ.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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function Lk(t){return new IZ(t)}function LZ(t){return t[0]}function $Z(t){return t[1]}function DZ(t,e){var r=Jt(!0),n=null,i=Lk,s=null,a=PM(o);t=typeof t=="function"?t:t===void 0?LZ:Jt(t),e=typeof e=="function"?e:e===void 0?$Z:Jt(e);function o(c){var u,d=(c=MM(c)).length,f,p=!1,m;
vendor: 10,797 bytes, line 821
821for(n==null&&(s=i(m=a())),u=0;u<=d;++u)!(u<d&&r(f=c[u],u,c))===p&&((p=!p)?s.lineStart():s.lineEnd()),p&&s.point(+t(f,u,c),+e(f,u,c));if(m)return s=null,m+""||null}return o.x=function(c){return arguments.length?(t=typeof c=="function"?c:Jt(+c),o):t},o.y=function(c){return arguments.length?(e=typeof c=="function"?c:Jt(+c),o):e},o.defined=function(c){return arguments.length?(r=typeof c=="function"?c:Jt(!!c),o):r},o.curve=function(c){return arguments.length?(i=c,n!=null&&(s=i(n)),o):i},o.context=function(c){return arguments.length?(c==null?n=s=null:s=i(n=c),o):n},o}function ab(t,e,r){var n=null,i=Jt(!0),s=null,a=Lk,o=null,c=PM(u);t=typeof t=="function"?t:t===void 0?LZ:Jt(+t),e=typeof e=="function"?e:Jt(e===void 0?0:+e),r=typeof r=="function"?r:r===void 0?$Z:Jt(+r);function u(f){var p,m,y,v=(f=MM(f)).length,w,b=!1,_,S=new Array(v),N=new Array(v);for(s==null&&(o=a(_=c())),p=0;p<=v;++p){if(!(p<v&&i(w=f[p],p,f))===b)if(b=!b)m=p,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),y=p-1;y>=m;--y)o.point(S[y],N[y]);o.lineEnd(),o.areaEnd()}b&&(S[p]=+t(w,p,f),N[p]=+e(w,p,f),o.point(n?+n(w,p,f):S[p],r?+r(w,p,f):N[p]))}if(_)return o=null,_+""||null}function d(){return DZ().defined(i).curve(a).context(s)}return u.x=function(f){return arguments.length?(t=typeof f=="function"?f:Jt(+f),n=null,u):t},u.x0=function(f){return arguments.length?(t=typeof f=="function"?f:Jt(+f),u):t},u.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Jt(+f),u):n},u.y=function(f){return arguments.length?(e=typeof f=="function"?f:Jt(+f),r=null,u):e},u.y0=function(f){return arguments.length?(e=typeof f=="function"?f:Jt(+f),u):e},u.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Jt(+f),u):r},u.lineX0=u.lineY0=function(){return d().x(t).y(e)},u.lineY1=function(){return d().x(t).y(r)},u.lineX1=function(){return d().x(n).y(e)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Jt(!!f),u):i},u.curve=function(f){return arguments.length?(a=f,s!=null&&(o=a(s)),u):a},u.context=function(f){return arguments.length?(f==null?s=o=null:o=a(s=f),u):s},u}class BZ{constructor(e,r){this._context=e,this._x=r}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(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function jAe(t){return new BZ(t,!0)}function NAe(t){return new BZ(t,!1)}const RM={draw(t,e){const r=ya(e/Kw);t.moveTo(r,0),t.arc(0,0,r,0,Ik)}},CAe={draw(t,e){const r=ya(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},FZ=ya(1/3),EAe=FZ*2,OAe={draw(t,e){const r=ya(e/EAe),n=r*FZ;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},TAe={draw(t,e){const r=ya(e),n=-r/2;t.rect(n,n,r,r)}},AAe=.8908130915292852,zZ=qw(Kw/10)/qw(7*Kw/10),PAe=qw(Ik/10)*zZ,MAe=-MZ(Ik/10)*zZ,RAe={draw(t,e){const r=ya(e*AAe),n=PAe*r,i=MAe*r;t.moveTo(0,-r),t.lineTo(n,i);for(let s=1;s<5;++s){const a=Ik*s/5,o=MZ(a),c=qw(a);t.lineTo(c*r,-o*r),t.lineTo(o*n-c*i,c*n+o*i)}t.closePath()}},PN=ya(3),IAe={draw(t,e){const r=-ya(e/(PN*3));t.moveTo(0,r*2),t.lineTo(-PN*r,-r),t.lineTo(PN*r,-r),t.closePath()}},cs=-.5,us=ya(3)/2,rT=1/ya(12),LAe=(rT/2+1)*3,$Ae={draw(t,e){const r=ya(e/LAe),n=r/2,i=r*rT,s=n,a=r*rT+r,o=-s,c=a;t.moveTo(n,i),t.lineTo(s,a),t.lineTo(o,c),t.lineTo(cs*n-us*i,us*n+cs*i),t.lineTo(cs*s-us*a,us*s+cs*a),t.lineTo(cs*o-us*c,us*o+cs*c),t.lineTo(cs*n+us*i,cs*i-us*n),t.lineTo(cs*s+us*a,cs*a-us*s),t.lineTo(cs*o+us*c,cs*c-us*o),t.closePath()}};function DAe(t,e){let r=null,n=PM(i);t=typeof t=="function"?t:Jt(t||RM),e=typeof e=="function"?e:Jt(e===void 0?64:+e);function i(){let s;if(r||(r=s=n()),t.apply(this,arguments).draw(r,+e.apply(this,arguments)),s)return r=null,s+""||null}return i.type=function(s){return arguments.length?(t=typeof s=="function"?s:Jt(s),i):t},i.size=function(s){return arguments.length?(e=typeof s=="function"?s:Jt(+s),i):e},i.context=function(s){return arguments.length?(r=s??null,i):r},i}function Gw(){}function Zw(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function UZ(t){this._context=t}UZ.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:Zw(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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);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:Zw(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function BAe(t){return new UZ(t)}function HZ(t){this._context=t}HZ.prototype={areaStart:Gw,areaEnd:Gw,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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Zw(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function FAe(t){return new HZ(t)}function VZ(t){this._context=t}VZ.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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Zw(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function zAe(t){return new VZ(t)}function WZ(t){this._context=t}WZ.prototype={areaStart:Gw,areaEnd:Gw,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function UAe(t){return new WZ(t)}function V3(t){return t<0?-1:1}function W3(t,e,r){var n=t._x1-t._x0,i=e-t._x1,s=(t._y1-t._y0)/(n||i<0&&-0),a=(r-t._y1)/(i||n<0&&-0),o=(s*i+a*n)/(n+i);return(V3(s)+V3(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function q3(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function MN(t,e,r){var n=t._x0,i=t._y0,s=t._x1,a=t._y1,o=(s-n)/3;t._context.bezierCurveTo(n+o,i+o*e,s-o,a-o*r,s,a)}function Jw(t){this._context=t}Jw.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:MN(this,this._t0,q3(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,MN(this,q3(this,r=W3(this,t,e)),r);break;default:MN(this,this._t0,r=W3(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function qZ(t){this._context=new KZ(t)}(qZ.prototype=Object.create(Jw.prototype)).point=function(t,e){Jw.prototype.point.call(this,e,t)};function KZ(t){this._context=t}KZ.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,s){this._context.bezierCurveTo(e,t,n,r,s,i)}};function HAe(t){return new Jw(t)}function VAe(t){return new qZ(t)}function GZ(t){this._context=t}GZ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=K3(t),i=K3(e),s=0,a=1;a<r;++s,++a)this._context.bezierCurveTo(n[0][s],i[0][s],n[1][s],i[1][s],t[a],e[a]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function K3(t){var e,r=t.length-1,n,i=new Array(r),s=new Array(r),a=new Array(r);for(i[0]=0,s[0]=2,a[0]=t[0]+2*t[1],e=1;e<r-1;++e)i[e]=1,s[e]=4,a[e]=4*t[e]+2*t[e+1];for(i[r-1]=2,s[r-1]=7,a[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=i[e]/s[e-1],s[e]-=n,a[e]-=n*a[e-1];for(i[r-1]=a[r-1]/s[r-1],e=r-2;e>=0;--e)i[e]=(a[e]-i[e+1])/s[e];for(s[r-1]=(t[r]+i[r-1])/2,e=0;e<r-1;++e)s[e]=2*t[e+1]-i[e+1];return[i,s]}function WAe(t){return new GZ(t)}function $k(t,e){this._context=t,this._t=e}$k.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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;
vendor: 9,521 bytes, lines 821-824
821default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function qAe(t){return new $k(t,.5)}function KAe(t){return new $k(t,0)}function GAe(t){return new $k(t,1)}function Bh(t,e){if((a=t.length)>1)for(var r=1,n,i,s=t[e[0]],a,o=s.length;r<a;++r)for(i=s,s=t[e[r]],n=0;n<o;++n)s[n][1]+=s[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function nT(t){for(var e=t.length,r=new Array(e);--e>=0;)r[e]=e;return r}function ZAe(t,e){return t[e]}function JAe(t){const e=[];return e.key=t,e}function YAe(){var t=Jt([]),e=nT,r=Bh,n=ZAe;function i(s){var a=Array.from(t.apply(this,arguments),JAe),o,c=a.length,u=-1,d;for(const f of s)for(o=0,++u;o<c;++o)(a[o][u]=[0,+n(f,a[o].key,u,s)]).data=f;for(o=0,d=MM(e(a));o<c;++o)a[d[o]].index=o;return r(a,d),a}return i.keys=function(s){return arguments.length?(t=typeof s=="function"?s:Jt(Array.from(s)),i):t},i.value=function(s){return arguments.length?(n=typeof s=="function"?s:Jt(+s),i):n},i.order=function(s){return arguments.length?(e=s==null?nT:typeof s=="function"?s:Jt(Array.from(s)),i):e},i.offset=function(s){return arguments.length?(r=s??Bh,i):r},i}function XAe(t,e){if((n=t.length)>0){for(var r,n,i=0,s=t[0].length,a;i<s;++i){for(a=r=0;r<n;++r)a+=t[r][i][1]||0;if(a)for(r=0;r<n;++r)t[r][i][1]/=a}Bh(t,e)}}function QAe(t,e){if((i=t.length)>0){for(var r=0,n=t[e[0]],i,s=n.length;r<s;++r){for(var a=0,o=0;a<i;++a)o+=t[a][r][1]||0;n[r][1]+=n[r][0]=-o/2}Bh(t,e)}}function ePe(t,e){if(!(!((a=t.length)>0)||!((s=(i=t[e[0]]).length)>0))){for(var r=0,n=1,i,s,a;n<s;++n){for(var o=0,c=0,u=0;o<a;++o){for(var d=t[e[o]],f=d[n][1]||0,p=d[n-1][1]||0,m=(f-p)/2,y=0;y<o;++y){var v=t[e[y]],w=v[n][1]||0,b=v[n-1][1]||0;m+=w-b}c+=f,u+=m*f}i[n-1][1]+=i[n-1][0]=r,c&&(r-=u/c)}i[n-1][1]+=i[n-1][0]=r,Bh(t,e)}}function kv(t){"@babel/helpers - typeof";return kv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kv(t)}var tPe=["type","size","sizeType"];function iT(){return iT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},iT.apply(this,arguments)}function G3(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Z3(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?G3(Object(r),!0).forEach(function(n){rPe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):G3(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function rPe(t,e,r){return e=nPe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function nPe(t){var e=iPe(t,"string");return kv(e)=="symbol"?e:e+""}function iPe(t,e){if(kv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(kv(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function sPe(t,e){if(t==null)return{};var r=aPe(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function aPe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var ZZ={symbolCircle:RM,symbolCross:CAe,symbolDiamond:OAe,symbolSquare:TAe,symbolStar:RAe,symbolTriangle:IAe,symbolWye:$Ae},oPe=Math.PI/180,lPe=function(e){var r="symbol".concat(Rk(e));return ZZ[r]||RM},cPe=function(e,r,n){if(r==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var i=18*oPe;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},uPe=function(e,r){ZZ["symbol".concat(Rk(e))]=r},IM=function(e){var r=e.type,n=r===void 0?"circle":r,i=e.size,s=i===void 0?64:i,a=e.sizeType,o=a===void 0?"area":a,c=sPe(e,tPe),u=Z3(Z3({},c),{},{type:n,size:s,sizeType:o}),d=function(){var w=lPe(n),b=DAe().type(w).size(cPe(s,o,n));return b()},f=u.className,p=u.cx,m=u.cy,y=Ge(u,!0);return p===+p&&m===+m&&s===+s?D.createElement("path",iT({},y,{className:at("recharts-symbols",f),transform:"translate(".concat(p,", ").concat(m,")"),d:d()})):null};IM.registerSymbol=uPe;function Fh(t){"@babel/helpers - typeof";return Fh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fh(t)}function sT(){return sT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},sT.apply(this,arguments)}function J3(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function dPe(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?J3(Object(r),!0).forEach(function(n){Sv(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):J3(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function fPe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hPe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,YZ(n.key),n)}}function pPe(t,e,r){return e&&hPe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function mPe(t,e,r){return e=Yw(e),gPe(t,JZ()?Reflect.construct(e,r||[],Yw(t).constructor):e.apply(t,r))}function gPe(t,e){if(e&&(Fh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vPe(t)}function vPe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function JZ(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(JZ=function(){return!!t})()}function Yw(t){return Yw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Yw(t)}function yPe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&aT(t,e)}function aT(t,e){return aT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},aT(t,e)}function Sv(t,e,r){return e=YZ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function YZ(t){var e=xPe(t,"string");return Fh(e)=="symbol"?e:e+""}function xPe(t,e){if(Fh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Fh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ds=32,LM=function(t){function e(){return fPe(this,e),mPe(this,e,arguments)}return yPe(e,t),pPe(e,[{key:"renderIcon",value:function(n){var i=this.props.inactiveColor,s=ds/2,a=ds/6,o=ds/3,c=n.inactive?i:n.color;if(n.type==="plainline")return D.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:s,x2:ds,y2:s,className:"recharts-legend-icon"});if(n.type==="line")return D.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(s,"h").concat(o,`
822            A`).concat(a,",").concat(a,",0,1,1,").concat(2*o,",").concat(s,`
823            H`).concat(ds,"M").concat(2*o,",").concat(s,`
824            A`).concat(a,",").concat(a,",0,1,1,").concat(o,",").concat(s),className:"recharts-legend-icon"});if(n.type==="rect")return D.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(ds/8,"h").concat(ds,"v").concat(ds*3/4,"h").concat(-ds,"z"),className:"recharts-legend-icon"});if(D.isValidElement(n.legendIcon)){var u=dPe({},n);return delete u.legendIcon,D.cloneElement(n.legendIcon,u)}return D.createElement(IM,{fill:c,cx:s,cy:s,size:ds,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,i=this.props,s=i.payload,a=i.iconSize,o=i.layout,c=i.formatter,u=i.inactiveColor,d={x:0,y:0,width:ds,height:ds},f={display:o==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return s.map(function(m,y){var v=m.formatter||c,w=at(Sv(Sv({"recharts-legend-item":!0},"legend-item-".concat(y),!0),"inactive",m.inactive));if(m.type==="none")return null;var b=Je(m.value)?null:m.value;
vendor: 9,541 bytes, line 824
824ua(!Je(m.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 _=m.inactive?u:m.color;return D.createElement("li",sT({className:w,style:f,key:"legend-item-".concat(y)},cd(n.props,m,y)),D.createElement(JO,{width:a,height:a,viewBox:d,style:p},n.renderIcon(m)),D.createElement("span",{className:"recharts-legend-item-text",style:{color:_}},v?v(b,m,y):b))})}},{key:"render",value:function(){var n=this.props,i=n.payload,s=n.layout,a=n.align;if(!i||!i.length)return null;var o={padding:0,margin:0,textAlign:s==="horizontal"?a:"left"};return D.createElement("ul",{className:"recharts-default-legend",style:o},this.renderItems())}}])}(x.PureComponent);Sv(LM,"displayName","Legend");Sv(LM,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var bPe=wk;function wPe(){this.__data__=new bPe,this.size=0}var _Pe=wPe;function kPe(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var SPe=kPe;function jPe(t){return this.__data__.get(t)}var NPe=jPe;function CPe(t){return this.__data__.has(t)}var EPe=CPe,OPe=wk,TPe=kM,APe=SM,PPe=200;function MPe(t,e){var r=this.__data__;if(r instanceof OPe){var n=r.__data__;if(!TPe||n.length<PPe-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new APe(n)}return r.set(t,e),this.size=r.size,this}var RPe=MPe,IPe=wk,LPe=_Pe,$Pe=SPe,DPe=NPe,BPe=EPe,FPe=RPe;function Ip(t){var e=this.__data__=new IPe(t);this.size=e.size}Ip.prototype.clear=LPe;Ip.prototype.delete=$Pe;Ip.prototype.get=DPe;Ip.prototype.has=BPe;Ip.prototype.set=FPe;var XZ=Ip,zPe="__lodash_hash_undefined__";function UPe(t){return this.__data__.set(t,zPe),this}var HPe=UPe;function VPe(t){return this.__data__.has(t)}var WPe=VPe,qPe=SM,KPe=HPe,GPe=WPe;function Xw(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new qPe;++e<r;)this.add(t[e])}Xw.prototype.add=Xw.prototype.push=KPe;Xw.prototype.has=GPe;var QZ=Xw;function ZPe(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var eJ=ZPe;function JPe(t,e){return t.has(e)}var tJ=JPe,YPe=QZ,XPe=eJ,QPe=tJ,e2e=1,t2e=2;function r2e(t,e,r,n,i,s){var a=r&e2e,o=t.length,c=e.length;if(o!=c&&!(a&&c>o))return!1;var u=s.get(t),d=s.get(e);if(u&&d)return u==e&&d==t;var f=-1,p=!0,m=r&t2e?new YPe:void 0;for(s.set(t,e),s.set(e,t);++f<o;){var y=t[f],v=e[f];if(n)var w=a?n(v,y,f,e,t,s):n(y,v,f,t,e,s);if(w!==void 0){if(w)continue;p=!1;break}if(m){if(!XPe(e,function(b,_){if(!QPe(m,_)&&(y===b||i(y,b,r,n,s)))return m.push(_)})){p=!1;break}}else if(!(y===v||i(y,v,r,n,s))){p=!1;break}}return s.delete(t),s.delete(e),p}var rJ=r2e,n2e=eo,i2e=n2e.Uint8Array,s2e=i2e;function a2e(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}var o2e=a2e;function l2e(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var $M=l2e,Y3=$y,X3=s2e,c2e=_M,u2e=rJ,d2e=o2e,f2e=$M,h2e=1,p2e=2,m2e="[object Boolean]",g2e="[object Date]",v2e="[object Error]",y2e="[object Map]",x2e="[object Number]",b2e="[object RegExp]",w2e="[object Set]",_2e="[object String]",k2e="[object Symbol]",S2e="[object ArrayBuffer]",j2e="[object DataView]",Q3=Y3?Y3.prototype:void 0,RN=Q3?Q3.valueOf:void 0;function N2e(t,e,r,n,i,s,a){switch(r){case j2e:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case S2e:return!(t.byteLength!=e.byteLength||!s(new X3(t),new X3(e)));case m2e:case g2e:case x2e:return c2e(+t,+e);case v2e:return t.name==e.name&&t.message==e.message;case b2e:case _2e:return t==e+"";case y2e:var o=d2e;case w2e:var c=n&h2e;if(o||(o=f2e),t.size!=e.size&&!c)return!1;var u=a.get(t);if(u)return u==e;n|=p2e,a.set(t,e);var d=u2e(o(t),o(e),n,i,s,a);return a.delete(t),d;case k2e:if(RN)return RN.call(t)==RN.call(e)}return!1}var C2e=N2e;function E2e(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var nJ=E2e,O2e=nJ,T2e=Mi;function A2e(t,e,r){var n=e(t);return T2e(t)?n:O2e(n,r(t))}var P2e=A2e;function M2e(t,e){for(var r=-1,n=t==null?0:t.length,i=0,s=[];++r<n;){var a=t[r];e(a,r,t)&&(s[i++]=a)}return s}var R2e=M2e;function I2e(){return[]}var L2e=I2e,$2e=R2e,D2e=L2e,B2e=Object.prototype,F2e=B2e.propertyIsEnumerable,e5=Object.getOwnPropertySymbols,z2e=e5?function(t){return t==null?[]:(t=Object(t),$2e(e5(t),function(e){return F2e.call(t,e)}))}:D2e,U2e=z2e;function H2e(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var V2e=H2e,W2e=rl,q2e=nl,K2e="[object Arguments]";function G2e(t){return q2e(t)&&W2e(t)==K2e}var Z2e=G2e,t5=Z2e,J2e=nl,iJ=Object.prototype,Y2e=iJ.hasOwnProperty,X2e=iJ.propertyIsEnumerable,Q2e=t5(function(){return arguments}())?t5:function(t){return J2e(t)&&Y2e.call(t,"callee")&&!X2e.call(t,"callee")},DM=Q2e,Qw={exports:{}};function eMe(){return!1}var tMe=eMe;Qw.exports;(function(t,e){var r=eo,n=tMe,i=e&&!e.nodeType&&e,s=i&&!0&&t&&!t.nodeType&&t,a=s&&s.exports===i,o=a?r.Buffer:void 0,c=o?o.isBuffer:void 0,u=c||n;t.exports=u})(Qw,Qw.exports);var sJ=Qw.exports,rMe=9007199254740991,nMe=/^(?:0|[1-9]\d*)$/;function iMe(t,e){var r=typeof t;return e=e??rMe,!!e&&(r=="number"||r!="symbol"&&nMe.test(t))&&t>-1&&t%1==0&&t<e}var BM=iMe,sMe=9007199254740991;function aMe(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=sMe}var FM=aMe,oMe=rl,lMe=FM,cMe=nl,uMe="[object Arguments]",dMe="[object Array]",fMe="[object Boolean]",hMe="[object Date]",pMe="[object Error]",mMe="[object Function]",gMe="[object Map]",vMe="[object Number]",yMe="[object Object]",xMe="[object RegExp]",bMe="[object Set]",wMe="[object String]",_Me="[object WeakMap]",kMe="[object ArrayBuffer]",SMe="[object DataView]",jMe="[object Float32Array]",NMe="[object Float64Array]",CMe="[object Int8Array]",EMe="[object Int16Array]",OMe="[object Int32Array]",TMe="[object Uint8Array]",AMe="[object Uint8ClampedArray]",PMe="[object Uint16Array]",MMe="[object Uint32Array]",rr={};rr[jMe]=rr[NMe]=rr[CMe]=rr[EMe]=rr[OMe]=rr[TMe]=rr[AMe]=rr[PMe]=rr[MMe]=!0;rr[uMe]=rr[dMe]=rr[kMe]=rr[fMe]=rr[SMe]=rr[hMe]=rr[pMe]=rr[mMe]=rr[gMe]=rr[vMe]=rr[yMe]=rr[xMe]=rr[bMe]=rr[wMe]=rr[_Me]=!1;function RMe(t){return cMe(t)&&lMe(t.length)&&!!rr[oMe(t)]}var IMe=RMe;function LMe(t){return function(e){return t(e)}}var aJ=LMe,e1={exports:{}};e1.exports;(function(t,e){var r=pZ,n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,s=i&&i.exports===n,a=s&&r.process,o=function(){try{var c=i&&i.require&&i.require("util").types;return c||a&&a.binding&&a.binding("util")}catch{}}();t.exports=o})(e1,e1.exports);var $Me=e1.exports,DMe=IMe,BMe=aJ,r5=$Me,n5=r5&&r5.isTypedArray,FMe=n5?BMe(n5):DMe,oJ=FMe,zMe=V2e,UMe=DM,HMe=Mi,VMe=sJ,WMe=BM,qMe=oJ,KMe=Object.prototype,GMe=KMe.hasOwnProperty;function ZMe(t,e){var r=HMe(t),n=!r&&UMe(t),i=!r&&!n&&VMe(t),s=!r&&!n&&!i&&qMe(t),a=r||n||i||s,o=a?zMe(t.length,String):[],c=o.length;for(var u in t)(e||GMe.call(t,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||WMe(u,c)))&&o.push(u);return o}var JMe=ZMe,YMe=Object.prototype;function XMe(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||YMe;return t===r}var QMe=XMe;function eRe(t,e){return function(r){return t(e(r))}}var lJ=eRe,tRe=lJ,rRe=tRe(Object.keys,Object),nRe=rRe,iRe=QMe,sRe=nRe,aRe=Object.prototype,oRe=aRe.hasOwnProperty;function lRe(t){if(!iRe(t))return sRe(t);var e=[];for(var r in Object(t))oRe.call(t,r)&&r!="constructor"&&e.push(r);return e}var cRe=lRe,uRe=wM,dRe=FM;function fRe(t){return t!=null&&dRe(t.length)&&!uRe(t)}var Fy=fRe,hRe=JMe,pRe=cRe,mRe=Fy;function gRe(t){return mRe(t)?hRe(t):pRe(t)}var Dk=gRe,vRe=P2e,yRe=U2e,xRe=Dk;function bRe(t){return vRe(t,xRe,yRe)}var wRe=bRe,i5=wRe,_Re=1,kRe=Object.prototype,SRe=kRe.hasOwnProperty;function jRe(t,e,r,n,i,s){var a=r&_Re,o=i5(t),c=o.length,u=i5(e),d=u.length;if(c!=d&&!a)return!1;for(var f=c;f--;){var p=o[f];if(!(a?p in e:SRe.call(e,p)))return!1}var m=s.get(t),y=s.get(e);if(m&&y)return m==e&&y==t;var v=!0;s.set(t,e),s.set(e,t);for(var w=a;++f<c;){p=o[f];var b=t[p],_=e[p];if(n)var S=a?n(_,b,p,e,t,s):n(b,_,p,t,e,s);if(!(S===void 0?b===_||i(b,_,r,n,s):S)){v=!1;break}w||(w=p=="constructor")}if(v&&!w){var N=t.constructor,j=e.constructor;N!=j&&"constructor"in t&&"constructor"in e&&!(typeof N=="function"&&N instanceof N&&typeof j=="function"&&j instanceof j)&&(v=!1)}return s.delete(t),s.delete(e),v}var NRe=jRe,CRe=Sd,ERe=eo,ORe=CRe(ERe,"DataView"),TRe=ORe,ARe=Sd,PRe=eo,MRe=ARe(PRe,"Promise"),RRe=MRe,IRe=Sd,LRe=eo,$Re=IRe(LRe,"Set"),cJ=$Re,DRe=Sd,BRe=eo,FRe=DRe(BRe,"WeakMap"),zRe=FRe,oT=TRe,lT=kM,cT=RRe,uT=cJ,dT=zRe,uJ=rl,Lp=gZ,s5="[object Map]",URe="[object Object]",a5="[object Promise]",o5="[object Set]",l5="[object WeakMap]",c5="[object DataView]",HRe=Lp(oT),VRe=Lp(lT),WRe=Lp(cT),qRe=Lp(uT),KRe=Lp(dT),du=uJ;(oT&&du(new oT(new ArrayBuffer(1)))!=c5||lT&&du(new lT)!=s5||cT&&du(cT.resolve())!=a5||uT&&du(new uT)!=o5||dT&&du(new dT)!=l5)&&(du=function(t){var e=uJ(t),r=e==URe?t.constructor:void 0,n=r?Lp(r):"";if(n)switch(n){case HRe:return c5;case VRe:return s5;case WRe:return a5;case qRe:return o5;case KRe:return l5}return e});var GRe=du,IN=XZ,ZRe=rJ,JRe=C2e,YRe=NRe,u5=GRe,d5=Mi,f5=sJ,XRe=oJ,QRe=1,h5="[object Arguments]",p5="[object Array]",ob="[object Object]",eIe=Object.prototype,m5=eIe.hasOwnProperty;function tIe(t,e,r,n,i,s){var a=d5(t),o=d5(e),c=a?p5:u5(t),u=o?p5:u5(e);c=c==h5?ob:c,u=u==h5?ob:u;var d=c==ob,f=u==ob,p=c==u;if(p&&f5(t)){if(!f5(e))return!1;a=!0,d=!1}if(p&&!d)return s||(s=new IN),a||XRe(t)?ZRe(t,e,r,n,i,s):JRe(t,e,c,r,n,i,s);if(!(r&QRe)){var m=d&&m5.call(t,"__wrapped__"),y=f&&m5.call(e,"__wrapped__");
vendor: 4,112 bytes, line 824
824if(m||y){var v=m?t.value():t,w=y?e.value():e;return s||(s=new IN),i(v,w,r,n,s)}}return p?(s||(s=new IN),YRe(t,e,r,n,i,s)):!1}var rIe=tIe,nIe=rIe,g5=nl;function dJ(t,e,r,n,i){return t===e?!0:t==null||e==null||!g5(t)&&!g5(e)?t!==t&&e!==e:nIe(t,e,r,n,dJ,i)}var zM=dJ,iIe=XZ,sIe=zM,aIe=1,oIe=2;function lIe(t,e,r,n){var i=r.length,s=i,a=!n;if(t==null)return!s;for(t=Object(t);i--;){var o=r[i];if(a&&o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++i<s;){o=r[i];var c=o[0],u=t[c],d=o[1];if(a&&o[2]){if(u===void 0&&!(c in t))return!1}else{var f=new iIe;if(n)var p=n(u,d,c,t,e,f);if(!(p===void 0?sIe(d,u,aIe|oIe,n,f):p))return!1}}return!0}var cIe=lIe,uIe=Uc;function dIe(t){return t===t&&!uIe(t)}var fJ=dIe,fIe=fJ,hIe=Dk;function pIe(t){for(var e=hIe(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,fIe(i)]}return e}var mIe=pIe;function gIe(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var hJ=gIe,vIe=cIe,yIe=mIe,xIe=hJ;function bIe(t){var e=yIe(t);return e.length==1&&e[0][2]?xIe(e[0][0],e[0][1]):function(r){return r===t||vIe(r,t,e)}}var wIe=bIe;function _Ie(t,e){return t!=null&&e in Object(t)}var kIe=_Ie,SIe=wZ,jIe=DM,NIe=Mi,CIe=BM,EIe=FM,OIe=kk;function TIe(t,e,r){e=SIe(e,t);for(var n=-1,i=e.length,s=!1;++n<i;){var a=OIe(e[n]);if(!(s=t!=null&&r(t,a)))break;t=t[a]}return s||++n!=i?s:(i=t==null?0:t.length,!!i&&EIe(i)&&CIe(a,i)&&(NIe(t)||jIe(t)))}var AIe=TIe,PIe=kIe,MIe=AIe;function RIe(t,e){return t!=null&&MIe(t,e,PIe)}var IIe=RIe,LIe=zM,$Ie=_Z,DIe=IIe,BIe=bM,FIe=fJ,zIe=hJ,UIe=kk,HIe=1,VIe=2;function WIe(t,e){return BIe(t)&&FIe(e)?zIe(UIe(t),e):function(r){var n=$Ie(r,t);return n===void 0&&n===e?DIe(r,t):LIe(e,n,HIe|VIe)}}var qIe=WIe;function KIe(t){return t}var $p=KIe;function GIe(t){return function(e){return e==null?void 0:e[t]}}var ZIe=GIe,JIe=CM;function YIe(t){return function(e){return JIe(e,t)}}var XIe=YIe,QIe=ZIe,eLe=XIe,tLe=bM,rLe=kk;function nLe(t){return tLe(t)?QIe(rLe(t)):eLe(t)}var iLe=nLe,sLe=wIe,aLe=qIe,oLe=$p,lLe=Mi,cLe=iLe;function uLe(t){return typeof t=="function"?t:t==null?oLe:typeof t=="object"?lLe(t)?aLe(t[0],t[1]):sLe(t):cLe(t)}var to=uLe;function dLe(t,e,r,n){for(var i=t.length,s=r+(n?1:-1);n?s--:++s<i;)if(e(t[s],s,t))return s;return-1}var pJ=dLe;function fLe(t){return t!==t}var hLe=fLe;function pLe(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}var mLe=pLe,gLe=pJ,vLe=hLe,yLe=mLe;function xLe(t,e,r){return e===e?yLe(t,e,r):gLe(t,vLe,r)}var bLe=xLe,wLe=bLe;function _Le(t,e){var r=t==null?0:t.length;return!!r&&wLe(t,e,0)>-1}var kLe=_Le;function SLe(t,e,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}var jLe=SLe;function NLe(){}var CLe=NLe,LN=cJ,ELe=CLe,OLe=$M,TLe=1/0,ALe=LN&&1/OLe(new LN([,-0]))[1]==TLe?function(t){return new LN(t)}:ELe,PLe=ALe,MLe=QZ,RLe=kLe,ILe=jLe,LLe=tJ,$Le=PLe,DLe=$M,BLe=200;function FLe(t,e,r){var n=-1,i=RLe,s=t.length,a=!0,o=[],c=o;if(r)a=!1,i=ILe;else if(s>=BLe){var u=e?null:$Le(t);if(u)return DLe(u);a=!1,i=LLe,c=new MLe}else c=e?[]:o;e:for(;++n<s;){var d=t[n],f=e?e(d):d;if(d=r||d!==0?d:0,a&&f===f){for(var p=c.length;p--;)if(c[p]===f)continue e;e&&c.push(f),o.push(d)}else i(c,f,r)||(c!==o&&c.push(f),o.push(d))}return o}var zLe=FLe,ULe=to,HLe=zLe;function VLe(t,e){return t&&t.length?HLe(t,ULe(e)):[]}var WLe=VLe;const v5=St(WLe);function mJ(t,e,r){return e===!0?v5(t,r):Je(e)?v5(t,e):t}function zh(t){"@babel/helpers - typeof";return zh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zh(t)}var qLe=["ref"];function y5(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function fo(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?y5(Object(r),!0).forEach(function(n){Bk(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):y5(Object(r)).forEac
vendor: 4,282 bytes, line 824
824h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function KLe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function x5(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,vJ(n.key),n)}}function GLe(t,e,r){return e&&x5(t.prototype,e),r&&x5(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function ZLe(t,e,r){return e=t1(e),JLe(t,gJ()?Reflect.construct(e,r||[],t1(t).constructor):e.apply(t,r))}function JLe(t,e){if(e&&(zh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return YLe(t)}function YLe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function gJ(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gJ=function(){return!!t})()}function t1(t){return t1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},t1(t)}function XLe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fT(t,e)}function fT(t,e){return fT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},fT(t,e)}function Bk(t,e,r){return e=vJ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vJ(t){var e=QLe(t,"string");return zh(e)=="symbol"?e:e+""}function QLe(t,e){if(zh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(zh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function e$e(t,e){if(t==null)return{};var r=t$e(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function t$e(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function r$e(t){return t.value}function n$e(t,e){if(D.isValidElement(t))return D.cloneElement(t,e);if(typeof t=="function")return D.createElement(t,e);e.ref;var r=e$e(e,qLe);return D.createElement(LM,r)}var b5=1,th=function(t){function e(){var r;KLe(this,e);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=ZLe(this,e,[].concat(i)),Bk(r,"lastBoundingBox",{width:-1,height:-1}),r}return XLe(e,t),GLe(e,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>b5||Math.abs(i.height-this.lastBoundingBox.height)>b5)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?fo({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,s=i.layout,a=i.align,o=i.verticalAlign,c=i.margin,u=i.chartWidth,d=i.chartHeight,f,p;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(a==="center"&&s==="vertical"){var m=this.getBBoxSnapshot();f={left:((u||0)-m.width)/2}}else f=a==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(o==="middle"){var y=this.getBBoxSnapsh
824ot();p={top:((d||0)-y.height)/2}}else p=o==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return fo(fo({},f),p)}},{key:"render",value:function(){var n=this,i=this.props,s=i.content,a=i.width,o=i.height,c=i.wrapperStyle,u=i.payloadUniqBy,d=i.payload,f=fo(fo({position:"absolute",width:a||"auto",height:o||"auto"},this.getDefaultPosition(c)),c);return D.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(m){n.wrapperNode=m}},n$e(s,fo(fo({},this.props),{},{payload:mJ(d,u,r$e)})))}}],[{key:"getWithHeight",value:function(n,i){var s=fo(fo({},this.defaultProps),n.props),a=s.layout;return a==="vertical"&&xe(n.props.height)?{height:n.props.height}:a==="horizontal"?{width:n.props.width||i}:null}}])}(x.PureComponent);Bk(th,"displayName","Legend");Bk(th,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var w5=$y,i$e=DM,s$e=Mi,_5=w5?w5.isConcatSpreadable:void 0;function a$e(t){return s$e(t)||i$e(t)||!!(_5&&t&&t[_5])}var o$e=a$e,l$e=nJ,c$e=o$e;function yJ(t,e,r,n,i){var s=-1,a=t.length;for(r||(r=c$e),i||(i=[]);++s<a;){var o=t[s];e>0&&r(o)?e>1?yJ(o,e-1,r,n,i):l$e(i,o):n||(i[i.length]=o)}return i}var xJ=yJ;function u$e(t){return function(e,r,n){for(var i=-1,s=Object(e),a=n(e),o=a.length;o--;){var c=a[t?o:++i];if(r(s[c],c,s)===!1)break}return e}}var d$e=u$e,f$e=d$e,h$e=f$e(),p$e=h$e,m$e=p$e,g$e=Dk;function v$e(t,e){return t&&m$e(t,e,g$e)}var bJ=v$e,y$e=Fy;function x$e(t,e){return function(r,n){if(r==null)return r;if(!y$e(r))return t(r,n);for(var i=r.length,s=e?i:-1,a=Object(r);(e?s--:++s<i)&&n(a[s],s,a)!==!1;);return r}}var b$e=x$e,w$e=bJ,_$e=b$e,k$e=_$e(w$e),UM=k$e,S$e=UM,j$e=Fy;function N$e(t,e){var r=-1,n=j$e(t)?Array(t.length):[];return S$e(t,function(i,s,a){n[++r]=e(i,s,a)}),n}var wJ=N$e;function C$e(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}var E$e=C$e,k5=Tp;function O$e(t,e){if(t!==e){var r=t!==void 0,n=t===null,i=t===t,s=k5(t),a=e!==void 0,o=e===null,c=e===e,u=k5(e);if(!o&&!u&&!s&&t>e||s&&a&&c&&!o&&!u||n&&a&&c||!r&&c||!i)return 1;if(!n&&!s&&!u&&t<e||u&&r&&i&&!n&&!s||o&&r&&i||!a&&i||!c)return-1}return 0}var T$e=O$e,A$e=T$e;function P$e(t,e,r){for(var n=-1,i=t.criteria,s=e.criteria,a=i.length,o=r.length;++n<a;){var c=A$e(i[n],s[n]);if(c){if(n>=o)return c;var u=r[n];return c*(u=="desc"?-1:1)}}return t.index-e.index}var M$e=P$e,$N=NM,R$e=CM,I$e=to,L$e=wJ,$$e=E$e,D$e=aJ,B$e=M$e,F$e=$p,z$e=Mi;function U$e(t,e,r){e.length?e=$N(e,function(s){return z$e(s)?function(a){return R$e(a,s.length===1?s[0]:s)}:s}):e=[F$e];var n=-1;e=$N(e,D$e(I$e));var i=L$e(t,function(s,a,o){var c=$N(e,function(u){return u(s)});return{criteria:c,index:++n,value:s}});return $$e(i,function(s,a){return B$e(s,a,r)})}var H$e=U$e;function V$e(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var W$e=V$e,q$e=W$e,S5=Math.max;function K$e(t,e,r){return e=S5(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,s=S5(n.length-e,0),a=Array(s);++i<s;)a[i]=n[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=n[i];return o[e]=r(a),q$e(t,this,o)}}var G$e=K$e;function Z$e(t){return function(){return t}}var J$e=Z$e,Y$e=Sd,X$e=function(){try{var t=Y$e(Object,"defineProperty");return t({},"",{}),t}catch{}}(),_J=X$e,Q$e=J$e,j5=_J,eDe=$p,tDe=j5?function(t,e){return j5(t,"toString",{configurable:!0,enumerable:!1,value:Q$e(e),writable:!0})}:eDe,rDe=tDe,nDe=800,iDe=16,sDe=Date.now;function aDe(t){var e=0,r=0;return function(){var n=sDe(),i=iDe-(n-r);if(r=n,i>0){if(++e>=nDe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var oDe=aDe,lDe=rDe,cDe=oDe,uDe=cDe(lDe),dDe=uDe,fDe=$p,hDe=G$e,pDe=dDe;function mDe(t,e){return pDe(hDe(t,e,fDe),t+"")}var gDe=mDe,vDe=_M,yDe=Fy,xDe=BM,bDe=Uc;function wDe(t,e,r){if(!bDe(r))return!1;var n=typeof e;return(n=="number"?yDe(r)&&xDe(e,r.length):n=="string"&&e in r)?vDe(r[e],t):!1}var Fk=wDe,_De=xJ,kDe=H$e,SDe=gDe,N5=Fk,jDe=SDe(function(t,e){if(t==null)return[];var r=e.length;return r>1&&N5(t,e[0],e[1])?e=[]:r>2&&N5(e[0],e[1],e[2])&&(e=[e[0]]),kDe(t,_De(e,1),[])}),NDe=jDe;const HM=St(NDe);function jv(t){"@babel/helpers - typeof";return jv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jv(t)}function hT(){return hT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];
vendor: 29,151 bytes, lines 824-831
824for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},hT.apply(this,arguments)}function CDe(t,e){return ADe(t)||TDe(t,e)||ODe(t,e)||EDe()}function EDe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
825In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ODe(t,e){if(t){if(typeof t=="string")return C5(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return C5(t,e)}}function C5(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function TDe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function ADe(t){if(Array.isArray(t))return t}function E5(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function DN(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?E5(Object(r),!0).forEach(function(n){PDe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E5(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function PDe(t,e,r){return e=MDe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function MDe(t){var e=RDe(t,"string");return jv(e)=="symbol"?e:e+""}function RDe(t,e){if(jv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(jv(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function IDe(t){return Array.isArray(t)&&en(t[0])&&en(t[1])?t.join(" ~ "):t}var LDe=function(e){var r=e.separator,n=r===void 0?" : ":r,i=e.contentStyle,s=i===void 0?{}:i,a=e.itemStyle,o=a===void 0?{}:a,c=e.labelStyle,u=c===void 0?{}:c,d=e.payload,f=e.formatter,p=e.itemSorter,m=e.wrapperClassName,y=e.labelClassName,v=e.label,w=e.labelFormatter,b=e.accessibilityLayer,_=b===void 0?!1:b,S=function(){if(d&&d.length){var R={padding:0,margin:0},M=(p?HM(d,p):d).map(function(F,q){if(F.type==="none")return null;var V=DN({display:"block",paddingTop:4,paddingBottom:4,color:F.color||"#000"},o),W=F.formatter||f||IDe,z=F.value,H=F.name,G=z,Y=H;if(W&&G!=null&&Y!=null){var U=W(z,H,F,q,d);if(Array.isArray(U)){var J=CDe(U,2);G=J[0],Y=J[1]}else G=U}return D.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(q),style:V},en(Y)?D.createElement("span",{className:"recharts-tooltip-item-name"},Y):null,en(Y)?D.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,D.createElement("span",{className:"recharts-tooltip-item-value"},G),D.createElement("span",{className:"recharts-tooltip-item-unit"},F.unit||""))});return D.createElement("ul",{className:"recharts-tooltip-item-list",style:R},M)}return null},N=DN({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},s),j=DN({margin:0},u),C=!vt(v),O=C?v:"",P=at("recharts-default-tooltip",m),T=at("recharts-tooltip-label",y);C&&w&&d!==void 0&&d!==null&&(O=w(v,d));var $=_?{role:"status","aria-live":"assertive"}:{};return D.createElement("div",hT({className:P,style:N},$),D.createElement("p",{className:T,style:j},D.isValidElement(O)?O:"".concat(O)),S())};function Nv(t){"@babel/helpers - typeof";return Nv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nv(t)}function lb(t,e,r){return e=$De(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $De(t){var e=DDe(t,"string");return Nv(e)=="symbol"?e:e+""}function DDe(t,e){if(Nv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Nv(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var _m="recharts-tooltip-wrapper",BDe={visibility:"hidden"};function FDe(t){var e=t.coordinate,r=t.translateX,n=t.translateY;return at(_m,lb(lb(lb(lb({},"".concat(_m,"-right"),xe(r)&&e&&xe(e.x)&&r>=e.x),"".concat(_m,"-left"),xe(r)&&e&&xe(e.x)&&r<e.x),"".concat(_m,"-bottom"),xe(n)&&e&&xe(e.y)&&n>=e.y),"".concat(_m,"-top"),xe(n)&&e&&xe(e.y)&&n<e.y))}function O5(t){var e=t.allowEscapeViewBox,r=t.coordinate,n=t.key,i=t.offsetTopLeft,s=t.position,a=t.reverseDirection,o=t.tooltipDimension,c=t.viewBox,u=t.viewBoxDimension;if(s&&xe(s[n]))return s[n];var d=r[n]-o-i,f=r[n]+i;if(e[n])return a[n]?d:f;if(a[n]){var p=d,m=c[n];return p<m?Math.max(f,c[n]):Math.max(d,c[n])}var y=f+o,v=c[n]+u;return y>v?Math.max(d,c[n]):Math.max(f,c[n])}function zDe(t){var e=t.translateX,r=t.translateY,n=t.useTranslate3d;return{transform:n?"translate3d(".concat(e,"px, ").concat(r,"px, 0)"):"translate(".concat(e,"px, ").concat(r,"px)")}}function UDe(t){var e=t.allowEscapeViewBox,r=t.coordinate,n=t.offsetTopLeft,i=t.position,s=t.reverseDirection,a=t.tooltipBox,o=t.useTranslate3d,c=t.viewBox,u,d,f;return a.height>0&&a.width>0&&r?(d=O5({allowEscapeViewBox:e,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:s,tooltipDimension:a.width,viewBox:c,viewBoxDimension:c.width}),f=O5({allowEscapeViewBox:e,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:s,tooltipDimension:a.height,viewBox:c,viewBoxDimension:c.height}),u=zDe({translateX:d,translateY:f,useTranslate3d:o})):u=BDe,{cssProperties:u,cssClasses:FDe({translateX:d,translateY:f,coordinate:r})}}function Uh(t){"@babel/helpers - typeof";return Uh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Uh(t)}function T5(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function A5(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?T5(Object(r),!0).forEach(function(n){mT(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):T5(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function HDe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function VDe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,SJ(n.key),n)}}function WDe(t,e,r){return e&&VDe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function qDe(t,e,r){return e=r1(e),KDe(t,kJ()?Reflect.construct(e,r||[],r1(t).constructor):e.apply(t,r))}function KDe(t,e){if(e&&(Uh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return GDe(t)}function GDe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function kJ(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kJ=function(){return!!t})()}function r1(t){return r1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},r1(t)}function ZDe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pT(t,e)}function pT(t,e){return pT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},pT(t,e)}function mT(t,e,r){return e=SJ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function SJ(t){var e=JDe(t,"string");return Uh(e)=="symbol"?e:e+""}function JDe(t,e){if(Uh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Uh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var P5=1,YDe=function(t){function e(){var r;HDe(this,e);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=qDe(this,e,[].concat(i)),mT(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),mT(r,"handleKeyDown",function(a){if(a.key==="Escape"){var o,c,u,d;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(o=(c=r.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&o!==void 0?o:0,y:(u=(d=r.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),r}return ZDe(e,t),WDe(e,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>P5||Math.abs(n.height-this.state.lastBoundingBox.height)>P5)&&this.setState({lastBoundingBox:{width:n.width,height:n.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 n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.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 n=this,i=this.props,s=i.active,a=i.allowEscapeViewBox,o=i.animationDuration,c=i.animationEasing,u=i.children,d=i.coordinate,f=i.hasPayload,p=i.isAnimationActive,m=i.offset,y=i.position,v=i.reverseDirection,w=i.useTranslate3d,b=i.viewBox,_=i.wrapperStyle,S=UDe({allowEscapeViewBox:a,coordinate:d,offsetTopLeft:m,position:y,reverseDirection:v,tooltipBox:this.state.lastBoundingBox,useTranslate3d:w,viewBox:b}),N=S.cssClasses,j=S.cssProperties,C=A5(A5({transition:p&&s?"transform ".concat(o,"ms ").concat(c):void 0},j),{},{pointerEvents:"none",visibility:!this.state.dismissed&&s&&f?"visible":"hidden",position:"absolute",top:0,left:0},_);return D.createElement("div",{tabIndex:-1,className:N,style:C,ref:function(P){n.wrapperNode=P}},u)}}])}(x.PureComponent),XDe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Ro={isSsr:XDe(),get:function(e){return Ro[e]},set:function(e,r){if(typeof e=="string")Ro[e]=r;else{var n=Object.keys(e);n&&n.length&&n.forEach(function(i){Ro[i]=e[i]})}}};function Hh(t){"@babel/helpers - typeof";return Hh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hh(t)}function M5(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function R5(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?M5(Object(r),!0).forEach(function(n){VM(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):M5(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function QDe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e4e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,NJ(n.key),n)}}function t4e(t,e,r){return e&&e4e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function r4e(t,e,r){return e=n1(e),n4e(t,jJ()?Reflect.construct(e,r||[],n1(t).constructor):e.apply(t,r))}function n4e(t,e){if(e&&(Hh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return i4e(t)}function i4e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function jJ(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jJ=function(){return!!t})()}function n1(t){return n1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},n1(t)}function s4e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&gT(t,e)}function gT(t,e){return gT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},gT(t,e)}function VM(t,e,r){return e=NJ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function NJ(t){var e=a4e(t,"string");return Hh(e)=="symbol"?e:e+""}function a4e(t,e){if(Hh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Hh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function o4e(t){return t.dataKey}function l4e(t,e){return D.isValidElement(t)?D.cloneElement(t,e):typeof t=="function"?D.createElement(t,e):D.createElement(LDe,e)}var Ta=function(t){function e(){return QDe(this,e),r4e(this,e,arguments)}return s4e(e,t),t4e(e,[{key:"render",value:function(){var n=this,i=this.props,s=i.active,a=i.allowEscapeViewBox,o=i.animationDuration,c=i.animationEasing,u=i.content,d=i.coordinate,f=i.filterNull,p=i.isAnimationActive,m=i.offset,y=i.payload,v=i.payloadUniqBy,w=i.position,b=i.reverseDirection,_=i.useTranslate3d,S=i.viewBox,N=i.wrapperStyle,j=y??[];f&&j.length&&(j=mJ(y.filter(function(O){return O.value!=null&&(O.hide!==!0||n.props.includeHidden)}),v,o4e));var C=j.length>0;return D.createElement(YDe,{allowEscapeViewBox:a,animationDuration:o,animationEasing:c,isAnimationActive:p,active:s,coordinate:d,hasPayload:C,offset:m,position:w,reverseDirection:b,useTranslate3d:_,viewBox:S,wrapperStyle:N},l4e(u,R5(R5({},this.props),{},{payload:j})))}}])}(x.PureComponent);VM(Ta,"displayName","Tooltip");VM(Ta,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Ro.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 c4e=eo,u4e=function(){return c4e.Date.now()},d4e=u4e,f4e=/\s/;function h4e(t){for(var e=t.length;e--&&f4e.test(t.charAt(e)););return e}var p4e=h4e,m4e=p4e,g4e=/^\s+/;function v4e(t){return t&&t.slice(0,m4e(t)+1).replace(g4e,"")}var y4e=v4e,x4e=y4e,I5=Uc,b4e=Tp,L5=NaN,w4e=/^[-+]0x[0-9a-f]+$/i,_4e=/^0b[01]+$/i,k4e=/^0o[0-7]+$/i,S4e=parseInt;function j4e(t){if(typeof t=="number")return t;if(b4e(t))return L5;if(I5(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=I5(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=x4e(t);var r=_4e.test(t);return r||k4e.test(t)?S4e(t.slice(2),r?2:8):w4e.test(t)?L5:+t}var CJ=j4e,N4e=Uc,BN=d4e,$5=CJ,C4e="Expected a function",E4e=Math.max,O4e=Math.min;function T4e(t,e,r){var n,i,s,a,o,c,u=0,d=!1,f=!1,p=!0;if(typeof t!="function")throw new TypeError(C4e);e=$5(e)||0,N4e(r)&&(d=!!r.leading,f="maxWait"in r,s=f?E4e($5(r.maxWait)||0,e):s,p="trailing"in r?!!r.trailing:p);function m(C){var O=n,P=i;return n=i=void 0,u=C,a=t.apply(P,O),a}function y(C){return u=C,o=setTimeout(b,e),d?m(C):a}function v(C){var O=C-c,P=C-u,T=e-O;return f?O4e(T,s-P):T}function w(C){var O=C-c,P=C-u;return c===void 0||O>=e||O<0||f&&P>=s}function b(){var C=BN();if(w(C))return _(C);o=setTimeout(b,v(C))}function _(C){return o=void 0,p&&n?m(C):(n=i=void 0,a)}function S(){o!==void 0&&clearTimeout(o),u=0,n=c=i=o=void 0}function N(){return o===void 0?a:_(BN())}function j(){var C=BN(),O=w(C);if(n=arguments,i=this,c=C,O){if(o===void 0)return y(c);if(f)return clearTimeout(o),o=setTimeout(b,e),m(c)}return o===void 0&&(o=setTimeout(b,e)),a}return j.cancel=S,j.flush=N,j}var A4e=T4e,P4e=A4e,M4e=Uc,R4e="Expected a function";function I4e(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(R4e);return M4e(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),P4e(t,e,{leading:n,maxWait:e,trailing:i})}var L4e=I4e;const EJ=St(L4e);function Cv(t){"@babel/helpers - typeof";return Cv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cv(t)}function D5(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function cb(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?D5(Object(r),!0).forEach(function(n){$4e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):D5(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function $4e(t,e,r){return e=D4e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function D4e(t){var e=B4e(t,"string");return Cv(e)=="symbol"?e:e+""}function B4e(t,e){if(Cv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Cv(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function F4e(t,e){return V4e(t)||H4e(t,e)||U4e(t,e)||z4e()}function z4e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
826In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function U4e(t,e){if(t){if(typeof t=="string")return B5(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return B5(t,e)}}function B5(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function H4e(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function V4e(t){if(Array.isArray(t))return t}var F5=x.forwardRef(function(t,e){var r=t.aspect,n=t.initialDimension,i=n===void 0?{width:-1,height:-1}:n,s=t.width,a=s===void 0?"100%":s,o=t.height,c=o===void 0?"100%":o,u=t.minWidth,d=u===void 0?0:u,f=t.minHeight,p=t.maxHeight,m=t.children,y=t.debounce,v=y===void 0?0:y,w=t.id,b=t.className,_=t.onResize,S=t.style,N=S===void 0?{}:S,j=x.useRef(null),C=x.useRef();C.current=_,x.useImperativeHandle(e,function(){return Object.defineProperty(j.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),j.current},configurable:!0})});var O=x.useState({containerWidth:i.width,containerHeight:i.height}),P=F4e(O,2),T=P[0],$=P[1],B=x.useCallback(function(M,F){$(function(q){var V=Math.round(M),W=Math.round(F);return q.containerWidth===V&&q.containerHeight===W?q:{containerWidth:V,containerHeight:W}})},[]);x.useEffect(function(){var M=function(H){var G,Y=H[0].contentRect,U=Y.width,J=Y.height;B(U,J),(G=C.current)===null||G===void 0||G.call(C,U,J)};v>0&&(M=EJ(M,v,{trailing:!0,leading:!1}));var F=new ResizeObserver(M),q=j.current.getBoundingClientRect(),V=q.width,W=q.height;return B(V,W),F.observe(j.current),function(){F.disconnect()}},[B,v]);var R=x.useMemo(function(){var M=T.containerWidth,F=T.containerHeight;if(M<0||F<0)return null;ua(ju(a)||ju(c),`The width(%s) and height(%s) are both fixed numbers,
827       maybe you don't need to use a ResponsiveContainer.`,a,c),ua(!r||r>0,"The aspect(%s) must be greater than zero.",r);var q=ju(a)?M:a,V=ju(c)?F:c;r&&r>0&&(q?V=q/r:V&&(q=V*r),p&&V>p&&(V=p)),ua(q>0||V>0,`The width(%s) and height(%s) of chart should be greater than 0,
828       please check the style of container, or the props width(%s) and height(%s),
829       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
830       height and width.`,q,V,a,c,d,f,r);var W=!Array.isArray(m)&&Mo(m.type).endsWith("Chart");return D.Children.map(m,function(z){return D.isValidElement(z)?x.cloneElement(z,cb({width:q,height:V},W?{style:cb({height:"100%",width:"100%",maxHeight:V,maxWidth:q},z.props.style)}:{})):z})},[r,m,c,p,f,d,T,a]);return D.createElement("div",{id:w?"".concat(w):void 0,className:at("recharts-responsive-container",b),style:cb(cb({},N),{},{width:a,height:c,minWidth:d,minHeight:f,maxHeight:p}),ref:j},R)}),Ev=function(e){return null};Ev.displayName="Cell";function Ov(t){"@babel/helpers - typeof";return Ov=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ov(t)}function z5(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function vT(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?z5(Object(r),!0).forEach(function(n){W4e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):z5(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function W4e(t,e,r){return e=q4e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function q4e(t){var e=K4e(t,"string");return Ov(e)=="symbol"?e:e+""}function K4e(t,e){if(Ov(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ov(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var tf={widthCache:{},cacheCount:0},G4e=2e3,Z4e={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},U5="recharts_measurement_span";function J4e(t){var e=vT({},t);return Object.keys(e).forEach(function(r){e[r]||delete e[r]}),e}var yg=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||Ro.isSsr)return{width:0,height:0};var n=J4e(r),i=JSON.stringify({text:e,copyStyle:n});if(tf.widthCache[i])return tf.widthCache[i];try{var s=document.getElementById(U5);s||(s=document.createElement("span"),s.setAttribute("id",U5),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var a=vT(vT({},Z4e),n);Object.assign(s.style,a),s.textContent="".concat(e);var o=s.getBoundingClientRect(),c={width:o.width,height:o.height};return tf.widthCache[i]=c,++tf.cacheCount>G4e&&(tf.cacheCount=0,tf.widthCache={}),c}catch{return{width:0,height:0}}},Y4e=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function Tv(t){"@babel/helpers - typeof";return Tv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tv(t)}function i1(t,e){return t3e(t)||e3e(t,e)||Q4e(t,e)||X4e()}function X4e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
831In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Q4e(t,e){if(t){if(typeof t=="string")return H5(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return H5(t,e)}}function H5(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function e3e(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function t3e(t){if(Array.isArray(t))return t}function r3e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function V5(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i3e(n.key),n)}}function n3e(t,e,r){return e&&V5(t.prototype,e),r&&V5(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function i3e(t){var e=s3e(t,"string");return Tv(e)=="symbol"?e:e+""}function s3e(t,e){if(Tv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Tv(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var W5=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,q5=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,a3e=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,o3e=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,OJ={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},l3e=Object.keys(OJ),Pf="NaN";function c3e(t,e){return t*OJ[e]}var ub=function(){function t(e,r){r3e(this,t),this.num=e,this.unit=r,this.num=e,this.unit=r,Number.isNaN(e)&&(this.unit=""),r!==""&&!a3e.test(r)&&(this.num=NaN,this.unit=""),l3e.includes(r)&&(this.num=c3e(e,r),this.unit="px")}return n3e(t,[{key:"add",value:function(r){return this.unit!==r.unit?new t(NaN,""):new t(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new t(NaN,""):new t(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new t(NaN,""):new t(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new t(NaN,""):new t(this.num/r.num,this.unit||r.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(r){var n,i=(n=o3e.exec(r))!==null&&n!==void 0?n:[],s=i1(i,3),a=s[1],o=s[2];return new t(parseFloat(a),o??"")}}])}();function TJ(t){if(t.includes(Pf))return Pf;for(var e=t;e.includes("*")||e.includes("/");){var r,n=(r=W5.exec(e))!==null&&r!==void 0?r:[],i=i1(n,4),s=i[1],a=i[2],o=i[3],c=ub.parse(s??""),u=ub.parse(o??""),d=a==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return Pf;e=e.replace(W5,d.toString())}for(;e.includes("+")||/.-\d+(?:\.\d+)?/.test(e);){var f,p=(f=q5.exec(e))!==null&&f!==void 0?f:[],m=i1(p,4),y=m[1],v=m[2],w=m[3],b=ub.parse(y??""),_=ub.parse(w??""),S=v==="+"?b.add(_):b.subtract(_);if(S.isNaN())return Pf;e=e.replace(q5,S.toString())}return e}var K5=/\(([^()]*)\)/;function u3e(t){for(var e=t;e.includes("(");){var r=K5.exec(e),n=i1(r,2),i=n[1];e=e.replace(K5,TJ(i))}return e}function d3e(t){var e=t.replace(/\s+/g,"");return e=u3e(e),e=TJ(e),e}function f3e(t){try{return d3e(t)}catch{return Pf}}function FN(t){var e=f3e(t.slice(5,-1));return e===Pf?"":e}var h3e=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],p3e=["dx","dy","angle","className","breakAll"];function yT(){return yT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];
831for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},yT.apply(this,arguments)}function G5(t,e){if(t==null)return{};var r=m3e(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function m3e(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Z5(t,e){return x3e(t)||y3e(t,e)||v3e(t,e)||g3e()}function g3e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
832In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v3e(t,e){if(t){if(typeof t=="string")return J5(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return J5(t,e)}}function J5(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function y3e(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function x3e(t){if(Array.isArray(t))return t}var AJ=/[ \f\n\r\t\v\u2028\u2029]+/,PJ=function(e){var r=e.children,n=e.breakAll,i=e.style;try{var s=[];vt(r)||(n?s=r.toString().split(""):s=r.toString().split(AJ));var a=s.map(function(c){return{word:c,width:yg(c,i).width}}),o=n?0:yg(" ",i).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}},b3e=function(e,r,n,i,s){var a=e.maxLines,o=e.children,c=e.style,u=e.breakAll,d=xe(a),f=o,p=function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return q.reduce(function(V,W){var z=W.word,H=W.width,G=V[V.length-1];if(G&&(i==null||s||G.width+H+n<Number(i)))G.words.push(z),G.width+=H+n;else{var Y={words:[z],width:H};V.push(Y)}return V},[])},m=p(r),y=function(q){return q.reduce(function(V,W){return V.width>W.width?V:W})};if(!d)return m;for(var v="…",w=function(q){var V=f.slice(0,q),W=PJ({breakAll:u,style:c,children:V+v}).wordsWithComputedWidth,z=p(W),H=z.length>a||y(z).width>Number(i);return[H,z]},b=0,_=f.length-1,S=0,N;b<=_&&S<=f.length-1;){var j=Math.floor((b+_)/2),C=j-1,O=w(C),P=Z5(O,2),T=P[0],$=P[1],B=w(j),R=Z5(B,1),M=R[0];if(!T&&!M&&(b=j+1),T&&M&&(_=j-1),!T&&M){N=$;break}S++}return N||m},Y5=function(e){var r=vt(e)?[]:e.toString().split(AJ);return[{words:r}]},w3e=function(e){var r=e.width,n=e.scaleToFit,i=e.children,s=e.style,a=e.breakAll,o=e.maxLines;if((r||n)&&!Ro.isSsr){var c,u,d=PJ({breakAll:a,children:i,style:s});if(d){var f=d.wordsWithComputedWidth,p=d.spaceWidth;c=f,u=p}else return Y5(i);return b3e({breakAll:a,children:i,maxLines:o,style:s},c,u,r,n)}return Y5(i)},X5="#808080",ud=function(e){var r=e.x,n=r===void 0?0:r,i=e.y,s=i===void 0?0:i,a=e.lineHeight,o=a===void 0?"1em":a,c=e.capHeight,u=c===void 0?"0.71em":c,d=e.scaleToFit,f=d===void 0?!1:d,p=e.textAnchor,m=p===void 0?"start":p,y=e.verticalAnchor,v=y===void 0?"end":y,w=e.fill,b=w===void 0?X5:w,_=G5(e,h3e),S=x.useMemo(function(){return w3e({breakAll:_.breakAll,children:_.children,maxLines:_.maxLines,scaleToFit:f,style:_.style,width:_.width})},[_.breakAll,_.children,_.maxLines,f,_.style,_.width]),N=_.dx,j=_.dy,C=_.angle,O=_.className,P=_.breakAll,T=G5(_,p3e);if(!en(n)||!en(s))return null;var $=n+(xe(N)?N:0),B=s+(xe(j)?j:0),R;switch(v){case"start":R=FN("calc(".concat(u,")"));break;case"middle":R=FN("calc(".concat((S.length-1)/2," * -").concat(o," + (").concat(u," / 2))"));break;default:R=FN("calc(".concat(S.length-1," * -").concat(o,")"));break}var M=[];if(f){var F=S[0].width,q=_.width;M.push("scale(".concat((xe(q)?q/F:1)/F,")"))}return C&&M.push("rotate(".concat(C,", ").concat($,", ").concat(B,")")),M.length&&(T.transform=M.join(" ")),D.createElement("text",yT({},Ge(T,!0),{x:$,y:B,className:at("recharts-text",O),textAnchor:m,fill:b.includes("url")?X5:b}),S.map(function(V,W){var z=V.words.join(P?"":" ");return D.createElement("tspan",{x:$,dy:W===0?R:o,key:"".concat(z,"-").concat(W)},z)}))};function fc(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function _3e(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function WM(t){let e,r,n;t.length!==2?(e=fc,r=(o,c)=>fc(t(o),c),n=(o,c)=>t(o)-c):(e=t===fc||t===_3e?t:k3e,r=t,n=t);function i(o,c,u=0,d=o.length){if(u<d){if(e(c,c)!==0)return d;do{const f=u+d>>>1;r(o[f],c)<0?u=f+1:d=f}while(u<d)}return u}function s(o,c,u=0,d=o.length){if(u<d){if(e(c,c)!==0)return d;do{const f=u+d>>>1;r(o[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function a(o,c,u=0,d=o.length){const f=i(o,c,u,d-1);return f>u&&n(o[f-1],c)>-n(o[f],c)?f-1:f}return{left:i,center:a,right:s}}function k3e(){return 0}function MJ(t){return t===null?NaN:+t}function*S3e(t,e){for(let r of t)r!=null&&(r=+r)>=r&&(yield r)}const j3e=WM(fc),zy=j3e.right;WM(MJ).center;class Q5 extends Map{constructor(e,r=E3e){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,i]of e)this.set(n,i)}get(e){return super.get(eB(this,e))}has(e){return super.has(eB(this,e))}set(e,r){return super.set(N3e(this,e),r)}delete(e){return super.delete(C3e(this,e))}}function eB({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function N3e({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function C3e({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function E3e(t){return t!==null&&typeof t=="object"?t.valueOf():t}function O3e(t=fc){if(t===fc)return RJ;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,r)=>{const n=t(e,r);return n||n===0?n:(t(r,r)===0)-(t(e,e)===0)}}function RJ(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}const T3e=Math.sqrt(50),A3e=Math.sqrt(10),P3e=Math.sqrt(2);function s1(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),s=n/Math.pow(10,i),a=s>=T3e?10:s>=A3e?5:s>=P3e?2:1;let o,c,u;return i<0?(u=Math.pow(10,-i)/a,o=Math.round(t*u),c=Math.round(e*u),o/u<t&&++o,c/u>e&&--c,u=-u):(u=Math.pow(10,i)*a,o=Math.round(t/u),c=Math.round(e/u),o*u<t&&++o,c*u>e&&--c),c<o&&.5<=r&&r<2?s1(t,e,r*2):[o,c,u]}function xT(t,e,r){if(e=+e,t=+t,r=+r,!(r>0))return[];if(t===e)return[t];const n=e<t,[i,s,a]=n?s1(e,t,r):s1(t,e,r);
832if(!(s>=i))return[];const o=s-i+1,c=new Array(o);if(n)if(a<0)for(let u=0;u<o;++u)c[u]=(s-u)/-a;else for(let u=0;u<o;++u)c[u]=(s-u)*a;else if(a<0)for(let u=0;u<o;++u)c[u]=(i+u)/-a;else for(let u=0;u<o;++u)c[u]=(i+u)*a;return c}function bT(t,e,r){return e=+e,t=+t,r=+r,s1(t,e,r)[2]}function wT(t,e,r){e=+e,t=+t,r=+r;const n=e<t,i=n?bT(e,t,r):bT(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}function tB(t,e){let r;for(const n of t)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function rB(t,e){let r;for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function IJ(t,e,r=0,n=1/0,i){if(e=Math.floor(e),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(t.length-1,n)),!(r<=e&&e<=n))return t;for(i=i===void 0?RJ:O3e(i);n>r;){if(n-r>600){const c=n-r+1,u=e-r+1,d=Math.log(c),f=.5*Math.exp(2*d/3),p=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),m=Math.max(r,Math.floor(e-u*f/c+p)),y=Math.min(n,Math.floor(e+(c-u)*f/c+p));IJ(t,e,m,y,i)}const s=t[e];let a=r,o=n;for(km(t,r,e),i(t[n],s)>0&&km(t,r,n);a<o;){for(km(t,a,o),++a,--o;i(t[a],s)<0;)++a;for(;i(t[o],s)>0;)--o}i(t[r],s)===0?km(t,r,o):(++o,km(t,o,n)),o<=e&&(r=o+1),e<=o&&(n=o-1)}return t}function km(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function M3e(t,e,r){if(t=Float64Array.from(S3e(t)),!(!(n=t.length)||isNaN(e=+e))){if(e<=0||n<2)return rB(t);if(e>=1)return tB(t);var n,i=(n-1)*e,s=Math.floor(i),a=tB(IJ(t,s).subarray(0,s+1)),o=rB(t.subarray(s+1));return a+(o-a)*(i-s)}}function R3e(t,e,r=MJ){if(!(!(n=t.length)||isNaN(e=+e))){if(e<=0||n<2)return+r(t[0],0,t);if(e>=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,s=Math.floor(i),a=+r(t[s],s,t),o=+r(t[s+1],s+1,t);return a+(o-a)*(i-s)}}function I3e(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,s=new Array(i);++n<i;)s[n]=t+n*r;return s}function zs(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function il(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const _T=Symbol("implicit");function qM(){var t=new Q5,e=[],r=[],n=_T;function i(s){let a=t.get(s);if(a===void 0){if(n!==_T)return n;t.set(s,a=e.push(s)-1)}return r[a%r.length]}return i.domain=function(s){if(!arguments.length)return e.slice();e=[],t=new Q5;for(const a of s)t.has(a)||t.set(a,e.push(a)-1);return i},i.range=function(s){return arguments.length?(r=Array.from(s),i):r.slice()},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return qM(e,r).unknown(n)},zs.apply(i,arguments),i}function Av(){var t=qM().unknown(void 0),e=t.domain,r=t.range,n=0,i=1,s,a,o=!1,c=0,u=0,d=.5;delete t.unknown;function f(){var p=e().length,m=i<n,y=m?i:n,v=m?n:i;s=(v-y)/Math.max(1,p-c+u*2),o&&(s=Math.floor(s)),y+=(v-y-s*(p-c))*d,a=s*(1-c),o&&(y=Math.round(y),a=Math.round(a));var w=I3e(p).map(function(b){return y+s*b});return r(m?w.reverse():w)}return t.domain=function(p){return arguments.length?(e(p),f()):e()},t.range=function(p){return arguments.length?([n,i]=p,n=+n,i=+i,f()):[n,i]},t.rangeRound=function(p){return[n,i]=p,n=+n,i=+i,o=!0,f()},t.bandwidth=function(){return a},t.step=function(){return s},t.round=function(p){return arguments.length?(o=!!p,f()):o},t.padding=function(p){return arguments.length?(c=Math.min(1,u=+p),f()):c},t.paddingInner=function(p){return arguments.length?(c=Math.min(1,p),f()):c},t.paddingOuter=function(p){return arguments.length?(u=+p,f()):u},t.align=function(p){return arguments.length?(d=Math.max(0,Math.min(1,p)),f()):d},t.copy=function(){return Av(e(),[n,i]).round(o).paddingInner(c).paddingOuter(u).align(d)},zs.apply(f(),arguments)}function LJ(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return LJ(e())},t}function xg(){return LJ(Av.apply(null,arguments).paddingInner(1))}function KM(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function $J(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Uy(){}var Pv=.7,a1=1/Pv,rh="\\s*([+-]?\\d+)\\s*",Mv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Va="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",L3e=/^#([0-9a-f]{3,8})$/,$3e=new RegExp(`^rgb\\(${rh},${rh},${rh}
832\\)$`),D3e=new RegExp(`^rgb\\(${Va},${Va},${Va}\\)$`),B3e=new RegExp(`^rgba\\(${rh},${rh},${rh},${Mv}\\)$`),F3e=new RegExp(`^rgba\\(${Va},${Va},${Va},${Mv}\\)$`),z3e=new RegExp(`^hsl\\(${Mv},${Va},${Va}\\)$`),U3e=new RegExp(`^hsla\\(${Mv},${Va},${Va},${Mv}\\)$`),nB={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};KM(Uy,Rv,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:iB,formatHex:iB,formatHex8:H3e,formatHsl:V3e,formatRgb:sB,toString:sB});function iB(){return this.rgb().formatHex()}function H3e(){return this.rgb().formatHex8()}function V3e(){return DJ(this).formatHsl()}function sB(){return this.rgb().formatRgb()}function Rv(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=L3e.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?aB(e):r===3?new _i(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?db(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?db(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=$3e.exec(t))?new _i(e[1],e[2],e[3],1):(e=D3e.exec(t))?new _i(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=B3e.exec(t))?db(e[1],e[2],e[3],e[4]):(e=F3e.exec(t))?db(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=z3e.exec(t))?cB(e[1],e[2]/100,e[3]/100,1):(e=U3e.exec(t))?cB(e[1],e[2]/100,e[3]/100,e[4]):nB.hasOwnProperty(t)?aB(nB[t]):t==="transparent"?new _i(NaN,NaN,NaN,0):null}function aB(t){return new _i(t>>16&255,t>>8&255,t&255,1)}function db(t,e,r,n){return n<=0&&(t=e=r=NaN),new _i(t,e,r,n)}function W3e(t){return t instanceof Uy||(t=Rv(t)),t?(t=t.rgb(),new _i(t.r,t.g,t.b,t.opacity)):new _i}function kT(t,e,r,n){return arguments.length===1?W3e(t):new _i(t,e,r,n??1)}function _i(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}KM(_i,kT,$J(Uy,{brighter(t){return t=t==null?a1:Math.pow(a1,t),new _i(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Pv:Math.pow(Pv,t),new _i(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new _i(Hu(this.r),Hu(this.g),Hu(this.b),o1(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:oB,formatHex:oB,formatHex8:q3e,formatRgb:lB,toString:lB}));function oB(){return`#${Nu(this.r)}${Nu(this.g)}${Nu(this.b)}`}function q3e(){return`#${Nu(this.r)}${Nu(this.g)}${Nu(this.b)}${Nu((isNaN(this.opacity)?1:this.opacity)*255)}`}function lB(){const t=o1(this.opacity);return`${t===1?"rgb(":"rgba("}${Hu(this.r)}, ${Hu(this.g)}, ${Hu(this.b)}${t===1?")":`, ${t})`}`}function o1(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Hu(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Nu(t){return t=Hu(t),(t<16?"0":"")+t.toString(16)}function cB(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new aa(t,e,r,n)}function DJ(t){if(t instanceof aa)return new aa(t.h,t.s,t.l,t.opacity);if(t instanceof Uy||(t=Rv(t)),!t)return new aa;if(t instanceof aa)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),s=Math.max(e,r,n),a=NaN,o=s-i,c=(s+i)/2;return o?(e===s?a=(r-n)/o+(r<n)*6:r===s?a=(n-e)/o+2:a=(e-r)/o+4,o/=c<.5?s+i:2-s-i,a*=60):o=c>0&&c<1?0:a,new aa(a,o,c,t.opacity)}function K3e(t,e,r,n){return arguments.length===1?DJ(t):new aa(t,e,r,n??1)}function aa(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}KM(aa,K3e,$J(Uy,{brighter(t){return t=t==null?a1:Math.pow(a1,t),new aa(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Pv:Math.pow(Pv,t),new aa(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new _i(zN(t>=240?t-240:t+120,i,n),zN(t,i,n),zN(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new aa(uB(this.h),fb(this.s),fb(this.l),o1(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 t=o1(this.opacity);return`${t===1?"hsl(":"hsla("}${uB(this.h)}, ${fb(this.s)*100}%, ${fb(this.l)*100}%${t===1?")":`, ${t})`}`}}));function uB(t){return t=(t||0)%360,t<0?t+360:t}
vendor: 4,318 bytes, line 832
832function fb(t){return Math.max(0,Math.min(1,t||0))}function zN(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const GM=t=>()=>t;function G3e(t,e){return function(r){return t+r*e}}function Z3e(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function J3e(t){return(t=+t)==1?BJ:function(e,r){return r-e?Z3e(e,r,t):GM(isNaN(e)?r:e)}}function BJ(t,e){var r=e-t;return r?G3e(t,r):GM(isNaN(t)?e:t)}const dB=function t(e){var r=J3e(e);function n(i,s){var a=r((i=kT(i)).r,(s=kT(s)).r),o=r(i.g,s.g),c=r(i.b,s.b),u=BJ(i.opacity,s.opacity);return function(d){return i.r=a(d),i.g=o(d),i.b=c(d),i.opacity=u(d),i+""}}return n.gamma=t,n}(1);function Y3e(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(s){for(i=0;i<r;++i)n[i]=t[i]*(1-s)+e[i]*s;return n}}function X3e(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Q3e(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,i=new Array(n),s=new Array(r),a;for(a=0;a<n;++a)i[a]=Dp(t[a],e[a]);for(;a<r;++a)s[a]=e[a];return function(o){for(a=0;a<n;++a)s[a]=i[a](o);return s}}function e5e(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function l1(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function t5e(t,e){var r={},n={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?r[i]=Dp(t[i],e[i]):n[i]=e[i];return function(s){for(i in r)n[i]=r[i](s);return n}}var ST=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,UN=new RegExp(ST.source,"g");function r5e(t){return function(){return t}}function n5e(t){return function(e){return t(e)+""}}function i5e(t,e){var r=ST.lastIndex=UN.lastIndex=0,n,i,s,a=-1,o=[],c=[];for(t=t+"",e=e+"";(n=ST.exec(t))&&(i=UN.exec(e));)(s=i.index)>r&&(s=e.slice(r,s),o[a]?o[a]+=s:o[++a]=s),(n=n[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,c.push({i:a,x:l1(n,i)})),r=UN.lastIndex;return r<e.length&&(s=e.slice(r),o[a]?o[a]+=s:o[++a]=s),o.length<2?c[0]?n5e(c[0].x):r5e(e):(e=c.length,function(u){for(var d=0,f;d<e;++d)o[(f=c[d]).i]=f.x(u);return o.join("")})}function Dp(t,e){var r=typeof e,n;return e==null||r==="boolean"?GM(e):(r==="number"?l1:r==="string"?(n=Rv(e))?(e=n,dB):i5e:e instanceof Rv?dB:e instanceof Date?e5e:X3e(e)?Y3e:Array.isArray(e)?Q3e:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?t5e:l1)(t,e)}function ZM(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function s5e(t,e){e===void 0&&(e=t,t=Dp);for(var r=0,n=e.length-1,i=e[0],s=new Array(n<0?0:n);r<n;)s[r]=t(i,i=e[++r]);return function(a){var o=Math.max(0,Math.min(n-1,Math.floor(a*=n)));return s[o](a-o)}}function a5e(t){return function(){return t}}function c1(t){return+t}var fB=[0,1];function ii(t){return t}function jT(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:a5e(isNaN(e)?NaN:.5)}function o5e(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function l5e(t,e,r){var n=t[0],i=t[1],s=e[0],a=e[1];return i<n?(n=jT(i,n),s=r(a,s)):(n=jT(n,i),s=r(s,a)),function(o){return s(n(o))}}function c5e(t,e,r){var n=Math.min(t.length,e.length)-1,i=new Array(n),s=new Array(n),a=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<n;)i[a]=jT(t[a],t[a+1]),s[a]=r(e[a],e[a+1]);return function(o){var c=zy(t,o,1,n)-1;return s[c](i[c](o))}}function Hy(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function zk(){var t=fB,e=fB,r=Dp,n,i,s,a=ii,o,c,u;function d(){var p=Math.min(t.length,e.length);return a!==ii&&(a=o5e(t[0],t[p-1])),o=p>2?c5e:l5e,c=u=null,f}function f(p){return p==null||isNaN(p=+p)?s:(c||(c=o(t.map(n),e,r)))(n(a(p)))}return f.invert=function(p){return a(i((u||(u=o(e,t.map(n),l1)))(p)))},f.domain=function(p){return arguments.length?(t=Array.from(p,c1),d()):t.slice()},f.range=function(p){return arguments.length?(e=Array.from(p),d()):e.slice()},f.rangeRound=function(p){return e=Array.from(p),r=ZM,d()},f.clamp=function(p){return arguments.length?(a=p?!0:ii,d()):a!==ii},f.interpolate=function(p){return arguments.length?(r=p,d()):r},f.unknown=function(p){return arguments.length?(s=p,f):s},function(p,m){return n=p,i=m,d()}}function JM(){return zk()(ii,ii)}function u5e(t){return Math.abs(t=Math.round(t))>
vendor: 4,286 bytes, line 832
832=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function u1(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function Vh(t){return t=u1(Math.abs(t)),t?t[1]:NaN}function d5e(t,e){return function(r,n){for(var i=r.length,s=[],a=0,o=t[0],c=0;i>0&&o>0&&(c+o+1>n&&(o=Math.max(1,n-c)),s.push(r.substring(i-=o,i+o)),!((c+=o+1)>n));)o=t[a=(a+1)%t.length];return s.reverse().join(e)}}function f5e(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var h5e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Iv(t){if(!(e=h5e.exec(t)))throw new Error("invalid format: "+t);var e;return new YM({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Iv.prototype=YM.prototype;function YM(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}YM.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 p5e(t){e:for(var e=t.length,r=1,n=-1,i;r<e;++r)switch(t[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+t[r])break e;n>0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var FJ;function m5e(t,e){var r=u1(t,e);if(!r)return t+"";var n=r[0],i=r[1],s=i-(FJ=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=n.length;return s===a?n:s>a?n+new Array(s-a+1).join("0"):s>0?n.slice(0,s)+"."+n.slice(s):"0."+new Array(1-s).join("0")+u1(t,Math.max(0,e+s-1))[0]}function hB(t,e){var r=u1(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const pB={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:u5e,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>hB(t*100,e),r:hB,s:m5e,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function mB(t){return t}var gB=Array.prototype.map,vB=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function g5e(t){var e=t.grouping===void 0||t.thousands===void 0?mB:d5e(gB.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",s=t.numerals===void 0?mB:f5e(gB.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function u(f){f=Iv(f);var p=f.fill,m=f.align,y=f.sign,v=f.symbol,w=f.zero,b=f.width,_=f.comma,S=f.precision,N=f.trim,j=f.type;j==="n"?(_=!0,j="g"):pB[j]||(S===void 0&&(S=12),N=!0,j="g"),(w||p==="0"&&m==="=")&&(w=!0,p="0",m="=");var C=v==="$"?r:v==="#"&&/[boxX]/.test(j)?"0"+j.toLowerCase():"",O=v==="$"?n:/[%p]/.test(j)?a:"",P=pB[j],T=/[defgprs%]/.test(j);S=S===void 0?6:/[gprs]/.test(j)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function $(B){var R=C,M=O,F,q,V;if(j==="c")M=P(B)+M,B="";else{B=+B;var W=B<0||1/B<0;if(B=isNaN(B)?c:P(Math.abs(B),S),N&&(B=p5e(B)),W&&+B==0&&y!=="+"&&(W=!1),R=(W?y==="("?y:o:y==="-"||y==="("?"":y)+R,M=(j==="s"?vB[8+FJ/3]:"")+M+(W&&y==="("?")":""),T){for(F=-1,q=B.length;++F<q;)if(V=B.charCodeAt(F),48>V||V>57){M=(V===46?i+B.slice(F+1):B.slice(F))+M,B=B.slice(0,F);break}}}_&&!w&&(B=e(B,1/0));var z=R.length+B.length+M.length,H=z<b?new Array(b-z+1).join(p):"";switch(_&&w&&(B=e(H+B,H.length?b-M.length:1/0),H=""),m){case"<":B=R+B+M+H;break;case"=":B=R+H+B+M;break;case"^":B=H.slice(0,z=H.length>>1)+R+B+M+H.slice(z);break;default:B=H+R+B+M;break}return s(B)}return $.toString=function(){return f+""},$}function d(f,p){var m=u((f=Iv(f),f.type="f",f)),y=Math.max(-8,Math.min(8,Math.floor(Vh(
vendor: 4,536 bytes, line 832
832p)/3)))*3,v=Math.pow(10,-y),w=vB[8+y/3];return function(b){return m(v*b)+w}}return{format:u,formatPrefix:d}}var hb,XM,zJ;v5e({thousands:",",grouping:[3],currency:["$",""]});function v5e(t){return hb=g5e(t),XM=hb.format,zJ=hb.formatPrefix,hb}function y5e(t){return Math.max(0,-Vh(Math.abs(t)))}function x5e(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Vh(e)/3)))*3-Vh(Math.abs(t)))}function b5e(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Vh(e)-Vh(t))+1}function UJ(t,e,r,n){var i=wT(t,e,r),s;switch(n=Iv(n??",f"),n.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(s=x5e(i,a))&&(n.precision=s),zJ(n,a)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(s=b5e(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=s-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(s=y5e(i))&&(n.precision=s-(n.type==="%")*2);break}}return XM(n)}function Hc(t){var e=t.domain;return t.ticks=function(r){var n=e();return xT(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return UJ(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,s=n.length-1,a=n[i],o=n[s],c,u,d=10;for(o<a&&(u=a,a=o,o=u,u=i,i=s,s=u);d-- >0;){if(u=bT(a,o,r),u===c)return n[i]=a,n[s]=o,e(n);if(u>0)a=Math.floor(a/u)*u,o=Math.ceil(o/u)*u;else if(u<0)a=Math.ceil(a*u)/u,o=Math.floor(o*u)/u;else break;c=u}return t},t}function d1(){var t=JM();return t.copy=function(){return Hy(t,d1())},zs.apply(t,arguments),Hc(t)}function HJ(t){var e;function r(n){return n==null||isNaN(n=+n)?e:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(t=Array.from(n,c1),r):t.slice()},r.unknown=function(n){return arguments.length?(e=n,r):e},r.copy=function(){return HJ(t).unknown(e)},t=arguments.length?Array.from(t,c1):[0,1],Hc(r)}function VJ(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],s=t[n],a;return s<i&&(a=r,r=n,n=a,a=i,i=s,s=a),t[r]=e.floor(i),t[n]=e.ceil(s),t}function yB(t){return Math.log(t)}function xB(t){return Math.exp(t)}function w5e(t){return-Math.log(-t)}function _5e(t){return-Math.exp(-t)}function k5e(t){return isFinite(t)?+("1e"+t):t<0?0:t}function S5e(t){return t===10?k5e:t===Math.E?Math.exp:e=>Math.pow(t,e)}function j5e(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function bB(t){return(e,r)=>-t(-e,r)}function QM(t){const e=t(yB,xB),r=e.domain;let n=10,i,s;function a(){return i=j5e(n),s=S5e(n),r()[0]<0?(i=bB(i),s=bB(s),t(w5e,_5e)):t(yB,xB),e}return e.base=function(o){return arguments.length?(n=+o,a()):n},e.domain=function(o){return arguments.length?(r(o),a()):r()},e.ticks=o=>{const c=r();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let p=i(u),m=i(d),y,v;const w=o==null?10:+o;let b=[];if(!(n%1)&&m-p<w){if(p=Math.floor(p),m=Math.ceil(m),u>0){for(;p<=m;++p)for(y=1;y<n;++y)if(v=p<0?y/s(-p):y*s(p),!(v<u)){if(v>d)break;b.push(v)}}else for(;p<=m;++p)for(y=n-1;y>=1;--y)if(v=p>0?y/s(-p):y*s(p),!(v<u)){if(v>d)break;b.push(v)}b.length*2<w&&(b=xT(u,d,w))}else b=xT(p,m,Math.min(m-p,w)).map(s);return f?b.reverse():b},e.tickFormat=(o,c)=>{if(o==null&&(o=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=Iv(c)).precision==null&&(c.trim=!0),c=XM(c)),o===1/0)return c;const u=Math.max(1,n*o/e.ticks().length);return d=>{let f=d/s(Math.round(i(d)));return f*n<n-.5&&(f*=n),f<=u?c(d):""}},e.nice=()=>r(VJ(r(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),e}function WJ(){const t=QM(zk()).domain([1,10]);return t.copy=()=>Hy(t,WJ()).base(t.base()),zs.apply(t,arguments),t}function wB(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function _B(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function eR(t){var e=1,r=t(wB(e),_B(e));return r.constant=function(n){return arguments.length?t(wB(e=+n),_B(e)):e},Hc(r)}function qJ(){var t=eR(zk());return t.copy=function(){return Hy(t,qJ()).constant(t.constant())},zs.apply(t,arguments)}function kB(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function N5e(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function C5e(t){return t<0?-t*t:t*t}function tR(t){var e=t(ii,ii),r=1;function n(){return r===1?t(ii,ii):r===.5?t(N5e,C5e):t(kB(r),kB(1/r))}return e.exponent=function(i){return arguments.length?(r=+i,n()):r},Hc(e)}function rR(){var t=tR(zk());return t.copy=function(){return Hy(t,rR()).exponent(t.exponent())},zs.apply(t,arguments),t}function E5e(){return rR.apply(null,arguments).exponent(.5)}function SB(t){return Math.sign(t)*t*t}
832function O5e(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function KJ(){var t=JM(),e=[0,1],r=!1,n;function i(s){var a=O5e(t(s));return isNaN(a)?n:r?Math.round(a):a}return i.invert=function(s){return t.invert(SB(s))},i.domain=function(s){return arguments.length?(t.domain(s),i):t.domain()},i.range=function(s){return arguments.length?(t.range((e=Array.from(s,c1)).map(SB)),i):e.slice()},i.rangeRound=function(s){return i.range(s).round(!0)},i.round=function(s){return arguments.length?(r=!!s,i):r},i.clamp=function(s){return arguments.length?(t.clamp(s),i):t.clamp()},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return KJ(t.domain(),e).round(r).clamp(t.clamp()).unknown(n)},zs.apply(i,arguments),Hc(i)}function GJ(){var t=[],e=[],r=[],n;function i(){var a=0,o=Math.max(1,e.length);for(r=new Array(o-1);++a<o;)r[a-1]=R3e(t,a/o);return s}function s(a){return a==null||isNaN(a=+a)?n:e[zy(r,a)]}return s.invertExtent=function(a){var o=e.indexOf(a);return o<0?[NaN,NaN]:[o>0?r[o-1]:t[0],o<r.length?r[o]:t[t.length-1]]},s.domain=function(a){if(!arguments.length)return t.slice();t=[];for(let o of a)o!=null&&!isNaN(o=+o)&&t.push(o);return t.sort(fc),i()},s.range=function(a){return arguments.length?(e=Array.from(a),i()):e.slice()},s.unknown=function(a){return arguments.length?(n=a,s):n},s.quantiles=function(){return r.slice()},s.copy=function(){return GJ().domain(t).range(e).unknown(n)},zs.apply(s,arguments)}function ZJ(){var t=0,e=1,r=1,n=[.5],i=[0,1],s;function a(c){return c!=null&&c<=c?i[zy(n,c,0,r)]:s}function o(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*e-(c-r)*t)/(r+1);return a}return a.domain=function(c){return arguments.length?([t,e]=c,t=+t,e=+e,o()):[t,e]},a.range=function(c){return arguments.length?(r=(i=Array.from(c)).length-1,o()):i.slice()},a.invertExtent=function(c){var u=i.indexOf(c);return u<0?[NaN,NaN]:u<1?[t,n[0]]:u>=r?[n[r-1],e]:[n[u-1],n[u]]},a.unknown=function(c){return arguments.length&&(s=c),a},a.thresholds=function(){return n.slice()},a.copy=function(){return ZJ().domain([t,e]).range(i).unknown(s)},zs.apply(Hc(a),arguments)}function JJ(){var t=[.5],e=[0,1],r,n=1;function i(s){return s!=null&&s<=s?e[zy(t,s,0,n)]:r}return i.domain=function(s){return arguments.length?(t=Array.from(s),n=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(s){return arguments.length?(e=Array.from(s),n=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(s){var a=e.indexOf(s);return[t[a-1],t[a]]},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return JJ().domain(t).range(e).unknown(r)},zs.apply(i,arguments)}const HN=new Date,VN=new Date;function rn(t,e,r,n){function i(s){return t(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),o=i.ceil(s);return s-a<o-s?a:o},i.offset=(s,a)=>(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,o)=>{const c=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return c;let u;do c.push(u=new Date(+s)),e(s,o),t(s);while(u<s&&s<a);return c},i.filter=s=>rn(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;e(a,-1),!s(a););else for(;--o>=0;)for(;e(a,1),!s(a););}),r&&(i.count=(s,a)=>(HN.setTime(+s),VN.setTime(+a),t(HN),t(VN),Math.floor(r(HN,VN))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(n?a=>n(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const f1=rn(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);f1.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?rn(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):f1);f1.range;const Co=1e3,_s=Co*60,Eo=_s*60,Ko=Eo*24,nR=Ko*7,jB=Ko*30,WN=Ko*365,Cu=rn(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Co)},(t,e)=>(e-t)/Co,t=>t.getUTCSeconds());Cu.range;const iR=rn(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Co)},(t,e)=>{t.setTime(+t+e*_s)},(t,e)=>(e-t)/_s,t=>t.getMinutes());iR.range;const sR=rn(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*_s)},(t,e)=>(e-t)/_s,t=>t.getUTCMinutes());sR.range;const aR=rn(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Co-t.getMinutes()*_s)},(t,e)=>{t.setTime(+t+e*Eo)},(t,e)=>(e-t)/Eo,t=>t.getHours());aR.range;const oR=rn(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Eo)},(t,e)=>(e-t)/Eo,t=>t.getUTCHours());oR.range;const Vy=rn(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>
vendor: 5,201 bytes, line 832
832(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*_s)/Ko,t=>t.getDate()-1);Vy.range;const Uk=rn(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Ko,t=>t.getUTCDate()-1);Uk.range;const YJ=rn(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Ko,t=>Math.floor(t/Ko));YJ.range;function jd(t){return rn(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*_s)/nR)}const Hk=jd(0),h1=jd(1),T5e=jd(2),A5e=jd(3),Wh=jd(4),P5e=jd(5),M5e=jd(6);Hk.range;h1.range;T5e.range;A5e.range;Wh.range;P5e.range;M5e.range;function Nd(t){return rn(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/nR)}const Vk=Nd(0),p1=Nd(1),R5e=Nd(2),I5e=Nd(3),qh=Nd(4),L5e=Nd(5),$5e=Nd(6);Vk.range;p1.range;R5e.range;I5e.range;qh.range;L5e.range;$5e.range;const lR=rn(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());lR.range;const cR=rn(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());cR.range;const Go=rn(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Go.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:rn(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});Go.range;const Zo=rn(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Zo.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:rn(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});Zo.range;function XJ(t,e,r,n,i,s){const a=[[Cu,1,Co],[Cu,5,5*Co],[Cu,15,15*Co],[Cu,30,30*Co],[s,1,_s],[s,5,5*_s],[s,15,15*_s],[s,30,30*_s],[i,1,Eo],[i,3,3*Eo],[i,6,6*Eo],[i,12,12*Eo],[n,1,Ko],[n,2,2*Ko],[r,1,nR],[e,1,jB],[e,3,3*jB],[t,1,WN]];function o(u,d,f){const p=d<u;p&&([u,d]=[d,u]);const m=f&&typeof f.range=="function"?f:c(u,d,f),y=m?m.range(u,+d+1):[];return p?y.reverse():y}function c(u,d,f){const p=Math.abs(d-u)/f,m=WM(([,,w])=>w).right(a,p);if(m===a.length)return t.every(wT(u/WN,d/WN,f));if(m===0)return f1.every(Math.max(wT(u,d,f),1));const[y,v]=a[p/a[m-1][2]<a[m][2]/p?m-1:m];return y.every(v)}return[o,c]}const[D5e,B5e]=XJ(Zo,cR,Vk,YJ,oR,sR),[F5e,z5e]=XJ(Go,lR,Hk,Vy,aR,iR);function qN(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function KN(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Sm(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function U5e(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,s=t.days,a=t.shortDays,o=t.months,c=t.shortMonths,u=jm(i),d=Nm(i),f=jm(s),p=Nm(s),m=jm(a),y=Nm(a),v=jm(o),w=Nm(o),b=jm(c),_=Nm(c),S={a:W,A:z,b:H,B:G,c:null,d:AB,e:AB,f:dBe,g:wBe,G:kBe,H:lBe,I:cBe,j:uBe,L:QJ,m:fBe,M:hBe,p:Y,q:U,Q:RB,s:IB,S:pBe,u:mBe,U:gBe,V:vBe,w:yBe,W:xBe,x:null,X:null,y:bBe,Y:_Be,Z:SBe,"%":MB},N={a:J,A:te,b:re,B:ae,c:null,d:PB,e:PB,f:EBe,g:DBe,G:FBe,H:jBe,I:NBe,j:CBe,L:tY,m:OBe,M:TBe,p:oe,q:_e,Q:RB,s:IB,S:ABe,u:PBe,U:MBe,V:RBe,w:IBe,W:LBe,x:null,X:null,y:$Be,Y:BBe,Z:zBe,"%":MB},j={a:$,A:B,b:R,B:M,c:F,d:OB,e:OB,f:iBe,g:EB,G:CB,H:TB,I:TB,j:eBe,L:nBe,m:Q5e,M:tBe,p:T,q:X5e,Q:aBe,s:oBe,S:rBe,u:K5e,U:G5e,V:Z5e,w:q5e,W:J5e,x:q,X:V,y:EB,Y:CB,Z:Y5e,"%":sBe};S.x=C(r,S),S.X=C(n,S),S.c=C(e,S),N.x=C(r,N),N.X=C(n,N),N.c=C(e,N);function C(ne,ue){return function(be){var Q=[],He=-1,Ie=0,ft=ne.length,ot,yt,Bt;for(be instanceof Date||(be=new Date(+be));++He<ft;)ne.charCodeAt(He)===37&&(Q.push(ne.slice(Ie,He)),(yt=NB[ot=ne.charAt(++He)])!=null?ot=ne.charAt(++He):yt=ot==="e"?" ":"0",(Bt=ue[ot])&&(ot=Bt(be,yt)),Q.push(ot),Ie=He+1);return Q.push(ne.slice(Ie,He)),Q.join("")}}function O(ne,ue){return function(be){var Q=Sm(1900,void 0,1),He=P(Q,ne,be+="",0),Ie,ft;if(He!=be.length)return null;if("Q"in Q)return new Date(Q.Q);if("s"in Q)return new Date(Q.s*1e3+("L"in Q?Q.L:0));if(ue&&!("Z"in Q)&&(Q.Z=0),"p"in Q&&(Q.H=Q.H%12+Q.p*12),Q.m===void 0&&(Q.m="q"in Q?Q.q:0),"V"in Q){if(Q.V<1||Q.V>53)return null;"w"in Q||(Q.w=1),"Z"in Q?(Ie=KN(Sm(Q.y,0,1)),ft=Ie.getUTCDay(),Ie=ft>4||ft===0?p1.ceil(Ie):p1(Ie),Ie=Uk.offset(Ie,(Q.V-1)*7),Q.y=Ie.getUTCFullYear(),Q.m=Ie.getUTCMonth(),Q.d=Ie.getUTCDate()+(Q.w+6)%7):(Ie=qN(Sm(Q.y,0,1)),ft=Ie.getDay(),Ie=ft>4||ft===0?h1.ceil(Ie):h1(Ie),Ie=Vy.offset(Ie,(Q.V-1)*7),Q.y=Ie.getFullYear(),Q.m=Ie.getMonth(),Q.d=Ie.getDate()+(Q.w+6)%7)}else("W"in Q||"U"in Q)&&("w"in Q||(Q.w="u"in Q?Q.u%7:"W"in Q?1:0),ft="Z"in Q?KN(Sm(Q.y,0,1)).getUTCDay():qN(Sm(Q.y,0,1)).getDay(),Q.m=0,Q.d="W"in Q?(Q.w+6)%7+Q.W*7-(ft+5)%7:Q.w+Q.U*7-(ft+6)%
vendor: 6,542 bytes, line 832
8327);return"Z"in Q?(Q.H+=Q.Z/100|0,Q.M+=Q.Z%100,KN(Q)):qN(Q)}}function P(ne,ue,be,Q){for(var He=0,Ie=ue.length,ft=be.length,ot,yt;He<Ie;){if(Q>=ft)return-1;if(ot=ue.charCodeAt(He++),ot===37){if(ot=ue.charAt(He++),yt=j[ot in NB?ue.charAt(He++):ot],!yt||(Q=yt(ne,be,Q))<0)return-1}else if(ot!=be.charCodeAt(Q++))return-1}return Q}function T(ne,ue,be){var Q=u.exec(ue.slice(be));return Q?(ne.p=d.get(Q[0].toLowerCase()),be+Q[0].length):-1}function $(ne,ue,be){var Q=m.exec(ue.slice(be));return Q?(ne.w=y.get(Q[0].toLowerCase()),be+Q[0].length):-1}function B(ne,ue,be){var Q=f.exec(ue.slice(be));return Q?(ne.w=p.get(Q[0].toLowerCase()),be+Q[0].length):-1}function R(ne,ue,be){var Q=b.exec(ue.slice(be));return Q?(ne.m=_.get(Q[0].toLowerCase()),be+Q[0].length):-1}function M(ne,ue,be){var Q=v.exec(ue.slice(be));return Q?(ne.m=w.get(Q[0].toLowerCase()),be+Q[0].length):-1}function F(ne,ue,be){return P(ne,e,ue,be)}function q(ne,ue,be){return P(ne,r,ue,be)}function V(ne,ue,be){return P(ne,n,ue,be)}function W(ne){return a[ne.getDay()]}function z(ne){return s[ne.getDay()]}function H(ne){return c[ne.getMonth()]}function G(ne){return o[ne.getMonth()]}function Y(ne){return i[+(ne.getHours()>=12)]}function U(ne){return 1+~~(ne.getMonth()/3)}function J(ne){return a[ne.getUTCDay()]}function te(ne){return s[ne.getUTCDay()]}function re(ne){return c[ne.getUTCMonth()]}function ae(ne){return o[ne.getUTCMonth()]}function oe(ne){return i[+(ne.getUTCHours()>=12)]}function _e(ne){return 1+~~(ne.getUTCMonth()/3)}return{format:function(ne){var ue=C(ne+="",S);return ue.toString=function(){return ne},ue},parse:function(ne){var ue=O(ne+="",!1);return ue.toString=function(){return ne},ue},utcFormat:function(ne){var ue=C(ne+="",N);return ue.toString=function(){return ne},ue},utcParse:function(ne){var ue=O(ne+="",!0);return ue.toString=function(){return ne},ue}}}var NB={"-":"",_:" ",0:"0"},vn=/^\s*\d+/,H5e=/^%/,V5e=/[\\^$*+?|[\]().{}]/g;function Pt(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",s=i.length;return n+(s<r?new Array(r-s+1).join(e)+i:i)}function W5e(t){return t.replace(V5e,"\\$&")}function jm(t){return new RegExp("^(?:"+t.map(W5e).join("|")+")","i")}function Nm(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function q5e(t,e,r){var n=vn.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function K5e(t,e,r){var n=vn.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function G5e(t,e,r){var n=vn.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function Z5e(t,e,r){var n=vn.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function J5e(t,e,r){var n=vn.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function CB(t,e,r){var n=vn.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function EB(t,e,r){var n=vn.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Y5e(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function X5e(t,e,r){var n=vn.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function Q5e(t,e,r){var n=vn.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function OB(t,e,r){var n=vn.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function eBe(t,e,r){var n=vn.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function TB(t,e,r){var n=vn.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function tBe(t,e,r){var n=vn.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function rBe(t,e,r){var n=vn.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function nBe(t,e,r){var n=vn.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function iBe(t,e,r){var n=vn.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function sBe(t,e,r){var n=H5e.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function aBe(t,e,r){var n=vn.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function oBe(t,e,r){var n=vn.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function AB(t,e){return Pt(t.getDate(),e,2)}function lBe(t,e){return Pt(t.getHours(),e,2)}function cBe(t,e){return Pt(t.getHours()%12||12,e,2)}function uBe(t,e){return Pt(1+Vy.count(Go(t),t),e,3)}function QJ(t,e){return Pt(t.getMilliseconds(),e,3)}function dBe(t,e){return QJ(t,e)+"000"}function fBe(t,e){return Pt(t.getMonth()+1,e,2)}function hBe(t,e){return Pt(t.getMinutes(),e,2)}function pBe(t,e){return Pt(t.getSeconds(),e,2)}function mBe(t){var e=t.getDay();return e===0?7:e}function gBe(t,e){return Pt(Hk.count(Go(t)-1,t),e,2)}function eY(t){var e=t.getDay();return e>=4||e===0?Wh(t):Wh.ceil(t)}function vBe(t,e){return t=eY(t),Pt(Wh.count(Go(t),t)+(Go(t).getDay()===4),e,2)}function yBe(t){return t.getDay()}function xBe(t,e){return Pt(h1.count(Go(t)-1,t),e,2)}function bBe(t,e){return Pt(t.getFullYear()%100,e,2)}function wBe(t,e){return t=eY(t),Pt(t.getFullYear()%100,e,2)}function _Be(t,e){return Pt(t.getFullYear()%1e4,e,4)}function kBe(t,e){var r=t.getDay();return t=r>=4||r===0?Wh(t):Wh.ceil(t),Pt(t.getFullYear()%1e4,e,4)}function SBe(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Pt(e/60|0,"0",2)+Pt(e%60,"0",2)}function PB(t,e){return Pt(t.getUTCDate(),e,2)}function jBe(t,e){return Pt(t.getUTCHours(),e,2)}function NBe(t,e){return Pt(t.getUTCHours()%12||12,e,2)}function CBe(t,e){return Pt(1+Uk.count(Zo(t),t),e,3)}function tY(t,e){return Pt(t.getUTCMilliseconds(),e,3)}function EBe(t,e){return tY(t,e)+"000"}function OBe(t,e){return Pt(t.getUTCMonth()+1,e,2)}function TBe(t,e){return Pt(t.getUTCMinutes(),e,2)}function ABe(t,e){return Pt(t.getUTCSeconds(),e,2)}function PBe(t){var e=t.getUTCDay();return e===0?7:e}function MBe(t,e){return Pt(Vk.count(Zo(t)-1,t),e,2)}function rY(t){var e=t.getUTCDay();return e>=4||e===0?qh(t):qh.ceil(t)}function RBe(t,e){return t=rY(t),Pt(qh.count(Zo(t),t)+(Zo(t).getUTCDay()===4),e,2)}function IBe(t){return t.getUTCDay()}function LBe(t,e){return Pt(p1.count(Zo(t)-1,t),e,2)}function $Be(t,e){return Pt(t.getUTCFullYear()%100,e,2)}function DBe(t,e){return t=rY(t),Pt(t.getUTCFullYear()%100,e,2)}function BBe(t,e){return Pt(t.getUTCFullYear()%1e4,e,4)}function FBe(t,e){var r=t.getUTCDay();return t=r>=4||r===0?qh(t):qh.ceil(t),Pt(t.getUTCFullYear()%1e4,e,4)}function zBe(){return"+0000"}function MB(){return"%"}function RB(t){return+t}function IB(t){return Math.floor(+t/1e3)}var rf,nY,iY;UBe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
832ay","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 UBe(t){return rf=U5e(t),nY=rf.format,rf.parse,iY=rf.utcFormat,rf.utcParse,rf}function HBe(t){return new Date(t)}function VBe(t){return t instanceof Date?+t:+new Date(+t)}function uR(t,e,r,n,i,s,a,o,c,u){var d=JM(),f=d.invert,p=d.domain,m=u(".%L"),y=u(":%S"),v=u("%I:%M"),w=u("%I %p"),b=u("%a %d"),_=u("%b %d"),S=u("%B"),N=u("%Y");function j(C){return(c(C)<C?m:o(C)<C?y:a(C)<C?v:s(C)<C?w:n(C)<C?i(C)<C?b:_:r(C)<C?S:N)(C)}return d.invert=function(C){return new Date(f(C))},d.domain=function(C){return arguments.length?p(Array.from(C,VBe)):p().map(HBe)},d.ticks=function(C){var O=p();return t(O[0],O[O.length-1],C??10)},d.tickFormat=function(C,O){return O==null?j:u(O)},d.nice=function(C){var O=p();return(!C||typeof C.range!="function")&&(C=e(O[0],O[O.length-1],C??10)),C?p(VJ(O,C)):d},d.copy=function(){return Hy(d,uR(t,e,r,n,i,s,a,o,c,u))},d}function WBe(){return zs.apply(uR(F5e,z5e,Go,lR,Hk,Vy,aR,iR,Cu,nY).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function qBe(){return zs.apply(uR(D5e,B5e,Zo,cR,Vk,Uk,oR,sR,Cu,iY).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Wk(){var t=0,e=1,r,n,i,s,a=ii,o=!1,c;function u(f){return f==null||isNaN(f=+f)?c:a(i===0?.5:(f=(s(f)-r)*i,o?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([t,e]=f,r=s(t=+t),n=s(e=+e),i=r===n?0:1/(n-r),u):[t,e]},u.clamp=function(f){return arguments.length?(o=!!f,u):o},u.interpolator=function(f){return arguments.length?(a=f,u):a};function d(f){return function(p){var m,y;return arguments.length?([m,y]=p,a=f(m,y),u):[a(0),a(1)]}}return u.range=d(Dp),u.rangeRound=d(ZM),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return s=f,r=f(t),n=f(e),i=r===n?0:1/(n-r),u}}function Vc(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function sY(){var t=Hc(Wk()(ii));return t.copy=function(){return Vc(t,sY())},il.apply(t,arguments)}function aY(){var t=QM(Wk()).domain([1,10]);return t.copy=function(){return Vc(t,aY()).base(t.base())},il.apply(t,arguments)}function oY(){var t=eR(Wk());return t.copy=function(){return Vc(t,oY()).constant(t.constant())},il.apply(t,arguments)}function dR(){var t=tR(Wk());return t.copy=function(){return Vc(t,dR()).exponent(t.exponent())},il.apply(t,arguments)}function KBe(){return dR.apply(null,arguments).exponent(.5)}function lY(){var t=[],e=ii;function r(n){if(n!=null&&!isNaN(n=+n))return e((zy(t,n,1)-1)/(t.length-1))}return r.domain=function(n){if(!arguments.length)return t.slice();t=[];for(let i of n)i!=null&&!isNaN(i=+i)&&t.push(i);return t.sort(fc),r},r.interpolator=function(n){return arguments.length?(e=n,r):e},r.range=function(){return t.map((n,i)=>e(i/(t.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,s)=>M3e(t,s/n))},r.copy=function(){return lY(e).domain(t)},il.apply(r,arguments)}function qk(){var t=0,e=.5,r=1,n=1,i,s,a,o,c,u=ii,d,f=!1,p;function m(v){return isNaN(v=+v)?p:(v=.5+((v=+d(v))-s)*(n*v<n*s?o:c),u(f?Math.max(0,Math.min(1,v)):v))}m.domain=function(v){return arguments.length?([t,e,r]=v,i=d(t=+t),s=d(e=+e),a=d(r=+r),o=i===s?0:.5/(s-i),c=s===a?0:.5/(a-s),n=s<i?-1:1,m):[t,e,r]},m.clamp=function(v){return arguments.length?(f=!!v,m):f},m.interpolator=function(v){return arguments.length?(u=v,m):u};function y(v){return function(w){var b,_,S;return arguments.length?([b,_,S]=w,u=s5e(v,[b,_,S]),m):[u(0),u(.5),u(1)]}}return m.range=y(Dp),m.rangeRound=y(ZM),m.unknown=function(v){return arguments.length?(p=v,m):p},function(v){return d=v,i=v(t),s=v(e),a=v(r),o=i===s?0:.5/(s-i),c=s===a?0:.5/(a-s),n=s<i?-1:1,m}}function cY(){var t=Hc(qk()(ii));return t.copy=function(){return Vc(t,cY())},il.apply(t,arguments)}function uY(){var t=QM(qk()).domain([.1,1,10]);return t.copy=function(){return Vc(t,uY()).base(t.base())},il.apply(t,arguments)}function dY(){var t=eR(qk());return t.copy=function(){return Vc(t,dY()).constant(t.constant())},il.apply(t,arguments)}function fR(){var t=tR(qk());return t.copy=function(){return Vc(t,fR()).exponent(t.exponent())},il.apply(t,arguments)}function GBe(){return fR.apply(null,arguments).exponent(.5)}const LB=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Av,scaleDiverging:cY,scaleDivergingLog:uY,scaleDivergingPow:fR,scaleDivergingSqrt:GBe,scaleDivergingSymlog:dY,scaleIdentity:HJ,scaleImplicit:_T,scaleLinear:d1,scaleLog:WJ,scaleOrdinal:qM,scalePoint:xg,scalePow:rR,scaleQuantile:GJ,scaleQuantize:ZJ,scaleRadial:KJ,scaleSequential:sY,scaleSequentialLog:aY,scaleSequentialPow:dR,scaleSequentialQuantile:lY,scaleSequentialSqrt:KBe,scaleSequentialSymlog:oY,scaleSqrt:E5e,scaleSymlog:qJ,scaleThreshold:JJ,scaleTime:WBe,scaleUtc:qBe,tickFormat:UJ},Symbol.toStringTag,{value:"Module"}));var ZBe=Tp;function JBe(t,e,r){for(var n=-1,i=t.length;++n<i;){var s=t[n],a=e(s);if(a!=null&&(o===void 0?a===a&&!ZBe(a):r(a,o)))var o=a,c=s}return c}var Kk=JBe;function YBe(t,e){return t>e}var fY=YBe,XBe=Kk,QBe=fY,eFe=$p;function tFe(t){return t&&t.length?XBe(t,eFe,QBe):void 0}var rFe=tFe;const Gk=St(rFe);function nFe(t,e){return t<e}var hY=nFe,iFe=Kk,sFe=hY,aFe=$p;
vendor: 62,327 bytes, lines 832-859
832function oFe(t){return t&&t.length?iFe(t,aFe,sFe):void 0}var lFe=oFe;const Zk=St(lFe);var cFe=NM,uFe=to,dFe=wJ,fFe=Mi;function hFe(t,e){var r=fFe(t)?cFe:dFe;return r(t,uFe(e))}var pFe=hFe,mFe=xJ,gFe=pFe;function vFe(t,e){return mFe(gFe(t,e),1)}var yFe=vFe;const xFe=St(yFe);var bFe=zM;function wFe(t,e){return bFe(t,e)}var _Fe=wFe;const Jk=St(_Fe);var Bp=1e9,kFe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},pR,dr=!0,$s="[DecimalError] ",Vu=$s+"Invalid argument: ",hR=$s+"Exponent out of range: ",Fp=Math.floor,fu=Math.pow,SFe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ui,an=1e7,ir=7,pY=9007199254740991,m1=Fp(pY/ir),Ee={};Ee.absoluteValue=Ee.abs=function(){var t=new this.constructor(this);return t.s&&(t.s=1),t};Ee.comparedTo=Ee.cmp=function(t){var e,r,n,i,s=this;if(t=new s.constructor(t),s.s!==t.s)return s.s||-t.s;if(s.e!==t.e)return s.e>t.e^s.s<0?1:-1;for(n=s.d.length,i=t.d.length,e=0,r=n<i?n:i;e<r;++e)if(s.d[e]!==t.d[e])return s.d[e]>t.d[e]^s.s<0?1:-1;return n===i?0:n>i^s.s<0?1:-1};Ee.decimalPlaces=Ee.dp=function(){var t=this,e=t.d.length-1,r=(e-t.e)*ir;if(e=t.d[e],e)for(;e%10==0;e/=10)r--;return r<0?0:r};Ee.dividedBy=Ee.div=function(t){return Io(this,new this.constructor(t))};Ee.dividedToIntegerBy=Ee.idiv=function(t){var e=this,r=e.constructor;return qt(Io(e,new r(t),0,1),r.precision)};Ee.equals=Ee.eq=function(t){return!this.cmp(t)};Ee.exponent=function(){return Wr(this)};Ee.greaterThan=Ee.gt=function(t){return this.cmp(t)>0};Ee.greaterThanOrEqualTo=Ee.gte=function(t){return this.cmp(t)>=0};Ee.isInteger=Ee.isint=function(){return this.e>this.d.length-2};Ee.isNegative=Ee.isneg=function(){return this.s<0};Ee.isPositive=Ee.ispos=function(){return this.s>0};Ee.isZero=function(){return this.s===0};Ee.lessThan=Ee.lt=function(t){return this.cmp(t)<0};Ee.lessThanOrEqualTo=Ee.lte=function(t){return this.cmp(t)<1};Ee.logarithm=Ee.log=function(t){var e,r=this,n=r.constructor,i=n.precision,s=i+5;if(t===void 0)t=new n(10);else if(t=new n(t),t.s<1||t.eq(Ui))throw Error($s+"NaN");if(r.s<1)throw Error($s+(r.s?"NaN":"-Infinity"));return r.eq(Ui)?new n(0):(dr=!1,e=Io(Lv(r,s),Lv(t,s),s),dr=!0,qt(e,i))};Ee.minus=Ee.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?vY(e,t):mY(e,(t.s=-t.s,t))};Ee.modulo=Ee.mod=function(t){var e,r=this,n=r.constructor,i=n.precision;if(t=new n(t),!t.s)throw Error($s+"NaN");return r.s?(dr=!1,e=Io(r,t,0,1).times(t),dr=!0,r.minus(e)):qt(new n(r),i)};Ee.naturalExponential=Ee.exp=function(){return gY(this)};Ee.naturalLogarithm=Ee.ln=function(){return Lv(this)};Ee.negated=Ee.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};Ee.plus=Ee.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?mY(e,t):vY(e,(t.s=-t.s,t))};Ee.precision=Ee.sd=function(t){var e,r,n,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Vu+t);if(e=Wr(i)+1,n=i.d.length-1,r=n*ir+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return t&&e>r?e:r};Ee.squareRoot=Ee.sqrt=function(){var t,e,r,n,i,s,a,o=this,c=o.constructor;if(o.s<1){if(!o.s)return new c(0);throw Error($s+"NaN")}for(t=Wr(o),dr=!1,i=Math.sqrt(+o),i==0||i==1/0?(e=Ba(o.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=Fp((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),n=new c(e)):n=new c(i.toString()),r=c.precision,i=a=r+3;;)if(s=n,n=s.plus(Io(o,s,a+2)).times(.5),Ba(s.d).slice(0,a)===(e=Ba(n.d)).slice(0,a)){if(e=e.slice(a-3,a+1),i==a&&e=="4999"){if(qt(s,r+1,0),s.times(s).eq(o)){n=s;break}}else if(e!="9999")break;a+=4}return dr=!0,qt(n,r)};Ee.times=Ee.mul=function(t){var e,r,n,i,s,a,o,c,u,d=this,f=d.constructor,p=d.d,m=(t=new f(t)).d;if(!d.s||!t.s)return new f(0);for(t.s*=d.s,r=d.e+t.e,c=p.length,u=m.length,c<u&&(s=p,p=m,m=s,a=c,c=u,u=a),s=[],a=c+u,n=a;n--;)s.push(0);for(n=u;--n>=0;){for(e=0,i=c+n;i>n;)o=s[i]+m[n]*p[i-n-1]+e,s[i--]=o%an|0,e=o/an|0;s[i]=(s[i]+e)%an|0}for(;!s[--a];)s.pop();return e?++r:s.shift(),t.d=s,t.e=r,dr?qt(t,f.precision):t};Ee.toDecimalPlaces=Ee.todp=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(Ja(t,0,Bp),e===void 0?e=n.rounding:Ja(e,0,8),qt(r,t+Wr(r)+1,e))};Ee.toExponential=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=dd(n,!0):(Ja(t,0,Bp),e===void 0?e=i.rounding:Ja(e,0,8),n=qt(new i(n),t+1,e),r=dd(n,!0,t+1)),r};Ee.toFixed=function(t,e){var r,n,i=this,s=i.constructor;return t===void 0?dd(i):(Ja(t,0,Bp),e===void 0?e=s.rounding:Ja(e,0,8),n=qt(new s(i),t+Wr(i)+1,e),r=dd(n.abs(),!1,t+Wr(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};Ee.toInteger=Ee.toint=function(){var t=this,e=t.constructor;return qt(new e(t),Wr(t)+1,e.rounding)};Ee.toNumber=function(){return+this};Ee.toPower=Ee.pow=function(t){var e,r,n,i,s,a,o=this,c=o.constructor,u=12,d=+(t=new c(t));if(!t.s)return new c(Ui);if(o=new c(o),!o.s){if(t.s<1)throw Error($s+"Infinity");return o}if(o.eq(Ui))return o;if(n=c.precision,t.eq(Ui))return qt(o,n);if(e=t.e,r=t.d.length-1,a=e>=r,s=o.s,a){if((r=d<0?-d:d)<=pY){for(i=new c(Ui),e=Math.ceil(n/ir+4),dr=!1;r%2&&(i=i.times(o),DB(i.d,e)),r=Fp(r/2),r!==0;)o=o.times(o),DB(o.d,e);return dr=!0,t.s<0?new c(Ui).div(i):qt(i,n)}}else if(s<0)throw Error($s+"NaN");return s=s<0&&t.d[Math.max(e,r)]&1?-1:1,o.s=1,dr=!1,i=t.times(Lv(o,n+u)),dr=!0,i=gY(i),i.s=s,i};Ee.toPrecision=function(t,e){var r,n,i=this,s=i.constructor;return t===void 0?(r=Wr(i),n=dd(i,r<=s.toExpNeg||r>=s.toExpPos)):(Ja(t,1,Bp),e===void 0?e=s.rounding:Ja(e,0,8),i=qt(new s(i),t,e),r=Wr(i),n=dd(i,t<=r||r<=s.toExpNeg,t)),n};Ee.toSignificantDigits=Ee.tosd=function(t,e){var r=this,n=r.constructor;return t===void 0?(t=n.precision,e=n.rounding):(Ja(t,1,Bp),e===void 0?e=n.rounding:Ja(e,0,8)),qt(new n(r),t,e)};Ee.toString=Ee.valueOf=Ee.val=Ee.toJSON=Ee[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=Wr(t),r=t.constructor;return dd(t,e<=r.toExpNeg||e>=r.toExpPos)};function mY(t,e){var r,n,i,s,a,o,c,u,d=t.constructor,f=d.precision;if(!t.s||!e.s)return e.s||(e=new d(t)),dr?qt(e,f):e;if(c=t.d,u=e.d,a=t.e,i=e.e,c=c.slice(),s=a-i,s){for(s<0?(n=c,s=-s,o=u.length):(n=u,i=a,o=c.length),a=Math.ceil(f/ir),o=a>o?a+1:o+1,s>o&&(s=o,n.length=1),n.reverse();s--;)n.push(0);n.reverse()}for(o=c.length,s=u.length,o-s<0&&(s=o,n=u,u=c,c=n),r=0;s;)r=(c[--s]=c[s]+u[s]+r)/an|0,c[s]%=an;for(r&&(c.unshift(r),++i),o=c.length;c[--o]==0;)c.pop();return e.d=c,e.e=i,dr?qt(e,f):e}function Ja(t,e,r){if(t!==~~t||t<e||t>r)throw Error(Vu+t)}function Ba(t){var e,r,n,i=t.length-1,s="",a=t[0];if(i>0){for(s+=a,e=1;e<i;e++)n=t[e]+"",r=ir-n.length,r&&(s+=Cl(r)),s+=n;a=t[e],n=a+"",r=ir-n.length,r&&(s+=Cl(r))}else if(a===0)return"0";for(;a%10===0;)a/=10;return s+a}var Io=function(){function t(n,i){var s,a=0,o=n.length;for(n=n.slice();o--;)s=n[o]*i+a,n[o]=s%an|0,a=s/an|0;return a&&n.unshift(a),n}function e(n,i,s,a){var o,c;if(s!=a)c=s>a?1:-1;else for(o=c=0;o<s;o++)if(n[o]!=i[o]){c=n[o]>i[o]?1:-1;break}return c}function r(n,i,s){for(var a=0;s--;)n[s]-=a,a=n[s]<i[s]?1:0,n[s]=a*an+n[s]-i[s];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,s,a){var o,c,u,d,f,p,m,y,v,w,b,_,S,N,j,C,O,P,T=n.constructor,$=n.s==i.s?1:-1,B=n.d,R=i.d;if(!n.s)return new T(n);if(!i.s)throw Error($s+"Division by zero");for(c=n.e-i.e,O=R.length,j=B.length,m=new T($),y=m.d=[],u=0;R[u]==(B[u]||0);)++u;if(R[u]>(B[u]||0)&&--c,s==null?_=s=T.precision:a?_=s+(Wr(n)-Wr(i))+1:_=s,_<0)return new T(0);if(_=_/ir+2|0,u=0,O==1)for(d=0,R=R[0],_++;(u<j||d)&&_--;u++)S=d*an+(B[u]||0),y[u]=S/R|0,d=S%R|0;else{for(d=an/(R[0]+1)|0,d>1&&(R=t(R,d),B=t(B,d),O=R.length,j=B.length),N=O,v=B.slice(0,O),w=v.length;w<O;)v[w++]=0;P=R.slice(),P.unshift(0),C=R[0],R[1]>=an/2&&++C;do d=0,o=e(R,v,O,w),o<0?(b=v[0],O!=w&&(b=b*an+(v[1]||0)),d=b/C|0,d>1?(d>=an&&(d=an-1),f=t(R,d),p=f.length,w=v.length,o=e(f,v,p,w),o==1&&(d--,r(f,O<p?P:R,p))):(d==0&&(o=d=1),f=R.slice()),p=f.length,p<w&&f.unshift(0),r(v,f,w),o==-1&&(w=v.length,o=e(R,v,O,w),o<1&&(d++,r(v,O<w?P:R,w))),w=v.length):o===0&&(d++,v=[0]),y[u++]=d,o&&v[0]?v[w++]=B[N]||0:(v=[B[N]],w=1);while((N++<j||v[0]!==void 0)&&_--)}return y[0]||y.shift(),m.e=c,qt(m,a?s+Wr(m)+1:s)}}();function gY(t,e){var r,n,i,s,a,o,c=0,u=0,d=t.constructor,f=d.precision;if(Wr(t)>16)throw Error(hR+Wr(t));if(!t.s)return new d(Ui);for(e==null?(dr=!1,o=f):o=e,a=new d(.03125);t.abs().gte(.1);)t=t.times(a),u+=5;for(n=Math.log(fu(2,u))/Math.LN10*2+5|0,o+=n,r=i=s=new d(Ui),d.precision=o;;){if(i=qt(i.times(t),o),r=r.times(++c),a=s.plus(Io(i,r,o)),Ba(a.d).slice(0,o)===Ba(s.d).slice(0,o)){for(;u--;)s=qt(s.times(s),o);return d.precision=f,e==null?(dr=!0,qt(s,f)):s}s=a}}function Wr(t){for(var e=t.e*ir,r=t.d[0];r>=10;r/=10)e++;return e}function GN(t,e,r){if(e>t.LN10.sd())throw dr=!0,r&&(t.precision=r),Error($s+"LN10 precision limit exceeded");return qt(new t(t.LN10),e)}function Cl(t){for(var e="";t--;)e+="0";return e}function Lv(t,e){var r,n,i,s,a,o,c,u,d,f=1,p=10,m=t,y=m.d,v=m.constructor,w=v.precision;if(m.s<1)throw Error($s+(m.s?"NaN":"-Infinity"));if(m.eq(Ui))return new v(0);if(e==null?(dr=!1,u=w):u=e,m.eq(10))return e==null&&(dr=!0),GN(v,u);if(u+=p,v.precision=u,r=Ba(y),n=r.charAt(0),s=Wr(m),Math.abs(s)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)m=m.times(t),r=Ba(m.d),n=r.charAt(0),f++;s=Wr(m),n>1?(m=new v("0."+r),s++):m=new v(n+"."+r.slice(1))}else return c=GN(v,u+2,w).times(s+""),m=Lv(new v(n+"."+r.slice(1)),u-p).plus(c),v.precision=w,e==null?(dr=!0,qt(m,w)):m;for(o=a=m=Io(m.minus(Ui),m.plus(Ui),u),d=qt(m.times(m),u),i=3;;){if(a=qt(a.times(d),u),c=o.plus(Io(a,new v(i),u)),Ba(c.d).slice(0,u)===Ba(o.d).slice(0,u))return o=o.times(2),s!==0&&(o=o.plus(GN(v,u+2,w).times(s+""))),o=Io(o,new v(f),u),v.precision=w,e==null?(dr=!0,qt(o,w)):o;o=c,i+=2}}function $B(t,e){var r,n,i;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;e.charCodeAt(n)===48;)++n;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(n,i),e){if(i-=n,r=r-n-1,t.e=Fp(r/ir),t.d=[],n=(r+1)%ir,r<0&&(n+=ir),n<i){for(n&&t.d.push(+e.slice(0,n)),i-=ir;n<i;)t.d.push(+e.slice(n,n+=ir));e=e.slice(n),n=ir-e.length}else n-=i;for(;n--;)e+="0";if(t.d.push(+e),dr&&(t.e>m1||t.e<-m1))throw Error(hR+r)}else t.s=0,t.e=0,t.d=[0];return t}function qt(t,e,r){var n,i,s,a,o,c,u,d,f=t.d;for(a=1,s=f[0];s>=10;s/=10)a++;if(n=e-a,n<0)n+=ir,i=e,u=f[d=0];else{if(d=Math.ceil((n+1)/ir),s=f.length,d>=s)return t;for(u=s=f[d],a=1;s>=10;s/=10)a++;n%=ir,i=n-ir+a}if(r!==void 0&&(s=fu(10,a-i-1),o=u/s%10|0,c=e<0||f[d+1]!==void 0||u%s,c=r<4?(o||c)&&(r==0||r==(t.s<0?3:2)):o>5||o==5&&(r==4||c||r==6&&(n>0?i>0?u/fu(10,a-i):0:f[d-1])%10&1||r==(t.s<0?8:7))),e<1||!f[0])return c?(s=Wr(t),f.length=1,e=e-s-1,f[0]=fu(10,(ir-e%ir)%ir),t.e=Fp(-e/ir)||0):(f.length=1,f[0]=t.e=t.s=0),t;if(n==0?(f.length=d,s=1,d--):(f.length=d+1,s=fu(10,ir-n),f[d]=i>0?(u/fu(10,a-i)%fu(10,i)|0)*s:0),c)for(;;)if(d==0){(f[0]+=s)==an&&(f[0]=1,++t.e);break}else{if(f[d]+=s,f[d]!=an)break;f[d--]=0,s=1}for(n=f.length;f[--n]===0;)f.pop();if(dr&&(t.e>m1||t.e<-m1))throw Error(hR+Wr(t));return t}function vY(t,e){var r,n,i,s,a,o,c,u,d,f,p=t.constructor,m=p.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new p(t),dr?qt(e,m):e;if(c=t.d,f=e.d,n=e.e,u=t.e,c=c.slice(),a=u-n,a){for(d=a<0,d?(r=c,a=-a,o=f.length):(r=f,n=u,o=c.length),i=Math.max(Math.ceil(m/ir),o)+2,a>i&&(a=i,r.length=1),r.reverse(),i=a;i--;)r.push(0);r.reverse()}else{for(i=c.length,o=f.length,d=i<o,d&&(o=i),i=0;i<o;i++)if(c[i]!=f[i]){d=c[i]<f[i];break}a=0}for(d&&(r=c,c=f,f=r,e.s=-e.s),o=c.length,i=f.length-o;i>0;--i)c[o++]=0;for(i=f.length;i>a;){if(c[--i]<f[i]){for(s=i;s&&c[--s]===0;)c[s]=an-1;--c[s],c[i]+=an}c[i]-=f[i]}for(;c[--o]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(e.d=c,e.e=n,dr?qt(e,m):e):new p(0)}function dd(t,e,r){var n,i=Wr(t),s=Ba(t.d),a=s.length;return e?(r&&(n=r-a)>0?s=s.charAt(0)+"."+s.slice(1)+Cl(n):a>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+Cl(-i-1)+s,r&&(n=r-a)>0&&(s+=Cl(n))):i>=a?(s+=Cl(i+1-a),r&&(n=r-i-1)>0&&(s=s+"."+Cl(n))):((n=i+1)<a&&(s=s.slice(0,n)+"."+s.slice(n)),r&&(n=r-a)>0&&(i+1===a&&(s+="."),s+=Cl(n))),t.s<0?"-"+s:s}function DB(t,e){if(t.length>e)return t.length=e,!0}function yY(t){var e,r,n;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(Vu+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 $B(a,s.toString())}else if(typeof s!="string")throw Error(Vu+s);if(s.charCodeAt(0)===45?(s=s.slice(1),a.s=-1):a.s=1,SFe.test(s))$B(a,s);else throw Error(Vu+s)}if(i.prototype=Ee,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=yY,i.config=i.set=jFe,t===void 0&&(t={}),t)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e<n.length;)t.hasOwnProperty(r=n[e++])||(t[r]=this[r]);return i.config(t),i}function jFe(t){if(!t||typeof t!="object")throw Error($s+"Object expected");var e,r,n,i=["precision",1,Bp,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(e=0;e<i.length;e+=3)if((n=t[r=i[e]])!==void 0)if(Fp(n)===n&&n>=i[e+1]&&n<=i[e+2])this[r]=n;else throw Error(Vu+r+": "+n);if((n=t[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Vu+r+": "+n);return this}var pR=yY(kFe);Ui=new pR(1);const Dt=pR;function NFe(t){return TFe(t)||OFe(t)||EFe(t)||CFe()}function CFe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
833In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function EFe(t,e){if(t){if(typeof t=="string")return NT(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return NT(t,e)}}function OFe(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function TFe(t){if(Array.isArray(t))return NT(t)}function NT(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var AFe=function(e){return e},xY={"@@functional/placeholder":!0},bY=function(e){return e===xY},BB=function(e){return function r(){return arguments.length===0||arguments.length===1&&bY(arguments.length<=0?void 0:arguments[0])?r:e.apply(void 0,arguments)}},PFe=function t(e,r){return e===1?r:BB(function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];var a=i.filter(function(o){return o!==xY}).length;return a>=e?r.apply(void 0,i):t(e-a,BB(function(){for(var o=arguments.length,c=new Array(o),u=0;u<o;u++)c[u]=arguments[u];var d=i.map(function(f){return bY(f)?c.shift():f});return r.apply(void 0,NFe(d).concat(c))}))})},Yk=function(e){return PFe(e.length,e)},CT=function(e,r){for(var n=[],i=e;i<r;++i)n[i-e]=i;return n},MFe=Yk(function(t,e){return Array.isArray(e)?e.map(t):Object.keys(e).map(function(r){return e[r]}).map(t)}),RFe=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(!r.length)return AFe;var i=r.reverse(),s=i[0],a=i.slice(1);return function(){return a.reduce(function(o,c){return c(o)},s.apply(void 0,arguments))}},ET=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},wY=function(e){var r=null,n=null;return function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return r&&s.every(function(o,c){return o===r[c]})||(r=s,n=e.apply(void 0,s)),n}};function IFe(t){var e;return t===0?e=1:e=Math.floor(new Dt(t).abs().log(10).toNumber())+1,e}function LFe(t,e,r){for(var n=new Dt(t),i=0,s=[];n.lt(e)&&i<1e5;)s.push(n.toNumber()),n=n.add(r),i++;return s}var $Fe=Yk(function(t,e,r){var n=+t,i=+e;return n+r*(i-n)}),DFe=Yk(function(t,e,r){var n=e-+t;return n=n||1/0,(r-t)/n}),BFe=Yk(function(t,e,r){var n=e-+t;return n=n||1/0,Math.max(0,Math.min(1,(r-t)/n))});const Xk={rangeStep:LFe,getDigitCount:IFe,interpolateNumber:$Fe,uninterpolateNumber:DFe,uninterpolateTruncation:BFe};function OT(t){return UFe(t)||zFe(t)||_Y(t)||FFe()}function FFe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
834In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zFe(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function UFe(t){if(Array.isArray(t))return TT(t)}function $v(t,e){return WFe(t)||VFe(t,e)||_Y(t,e)||HFe()}function HFe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
835In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _Y(t,e){if(t){if(typeof t=="string")return TT(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return TT(t,e)}}function TT(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function VFe(t,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(t)))){var r=[],n=!0,i=!1,s=void 0;try{for(var a=t[Symbol.iterator](),o;!(n=(o=a.next()).done)&&(r.push(o.value),!(e&&r.length===e));n=!0);}catch(c){i=!0,s=c}finally{try{!n&&a.return!=null&&a.return()}finally{if(i)throw s}}return r}}function WFe(t){if(Array.isArray(t))return t}function kY(t){var e=$v(t,2),r=e[0],n=e[1],i=r,s=n;return r>n&&(i=n,s=r),[i,s]}function SY(t,e,r){if(t.lte(0))return new Dt(0);var n=Xk.getDigitCount(t.toNumber()),i=new Dt(10).pow(n),s=t.div(i),a=n!==1?.05:.1,o=new Dt(Math.ceil(s.div(a).toNumber())).add(r).mul(a),c=o.mul(i);return e?c:new Dt(Math.ceil(c))}function qFe(t,e,r){var n=1,i=new Dt(t);if(!i.isint()&&r){var s=Math.abs(t);s<1?(n=new Dt(10).pow(Xk.getDigitCount(t)-1),i=new Dt(Math.floor(i.div(n).toNumber())).mul(n)):s>1&&(i=new Dt(Math.floor(t)))}else t===0?i=new Dt(Math.floor((e-1)/2)):r||(i=new Dt(Math.floor(t)));var a=Math.floor((e-1)/2),o=RFe(MFe(function(c){return i.add(new Dt(c-a).mul(n)).toNumber()}),CT);return o(0,e)}function jY(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(r-1)))return{step:new Dt(0),tickMin:new Dt(0),tickMax:new Dt(0)};var s=SY(new Dt(e).sub(t).div(r-1),n,i),a;t<=0&&e>=0?a=new Dt(0):(a=new Dt(t).add(e).div(2),a=a.sub(new Dt(a).mod(s)));var o=Math.ceil(a.sub(t).div(s).toNumber()),c=Math.ceil(new Dt(e).sub(a).div(s).toNumber()),u=o+c+1;return u>r?jY(t,e,r,n,i+1):(u<r&&(c=e>0?c+(r-u):c,o=e>0?o:o+(r-u)),{step:s,tickMin:a.sub(new Dt(o).mul(s)),tickMax:a.add(new Dt(c).mul(s))})}function KFe(t){var e=$v(t,2),r=e[0],n=e[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=kY([r,n]),c=$v(o,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(OT(CT(0,i-1).map(function(){return 1/0}))):[].concat(OT(CT(0,i-1).map(function(){return-1/0})),[d]);return r>n?ET(f):f}if(u===d)return qFe(u,i,s);var p=jY(u,d,a,s),m=p.step,y=p.tickMin,v=p.tickMax,w=Xk.rangeStep(y,v.add(new Dt(.1).mul(m)),m);return r>n?ET(w):w}function GFe(t,e){var r=$v(t,2),n=r[0],i=r[1],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=kY([n,i]),o=$v(a,2),c=o[0],u=o[1];if(c===-1/0||u===1/0)return[n,i];if(c===u)return[c];var d=Math.max(e,2),f=SY(new Dt(u).sub(c).div(d-1),s,0),p=[].concat(OT(Xk.rangeStep(new Dt(c),new Dt(u).sub(new Dt(.99).mul(f)),f)),[u]);return n>i?ET(p):p}var ZFe=wY(KFe),JFe=wY(GFe),YFe="Invariant failed";function fd(t,e){throw new Error(YFe)}var XFe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Kh(t){"@babel/helpers - typeof";return Kh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kh(t)}function g1(){return g1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},g1.apply(this,arguments)}function QFe(t,e){return nze(t)||rze(t,e)||tze(t,e)||eze()}function eze(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
836In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tze(t,e){if(t){if(typeof t=="string")return FB(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return FB(t,e)}}function FB(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function rze(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function nze(t){if(Array.isArray(t))return t}function ize(t,e){if(t==null)return{};var r=sze(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function sze(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function aze(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function oze(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,EY(n.key),n)}}function lze(t,e,r){return e&&oze(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function cze(t,e,r){return e=v1(e),uze(t,NY()?Reflect.construct(e,r||[],v1(t).constructor):e.apply(t,r))}function uze(t,e){if(e&&(Kh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dze(t)}function dze(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function NY(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(NY=function(){return!!t})()}function v1(t){return v1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},v1(t)}function fze(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&AT(t,e)}function AT(t,e){return AT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},AT(t,e)}function CY(t,e,r){return e=EY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function EY(t){var e=hze(t,"string");return Kh(e)=="symbol"?e:e+""}function hze(t,e){if(Kh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Kh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Qk=function(t){function e(){return aze(this,e),cze(this,e,arguments)}return fze(e,t),lze(e,[{key:"render",value:function(){var n=this.props,i=n.offset,s=n.layout,a=n.width,o=n.dataKey,c=n.data,u=n.dataPointFormatter,d=n.xAxis,f=n.yAxis,p=ize(n,XFe),m=Ge(p,!1);this.props.direction==="x"&&d.type!=="number"&&fd();var y=c.map(function(v){var w=u(v,o),b=w.x,_=w.y,S=w.value,N=w.errorVal;if(!N)return null;var j=[],C,O;if(Array.isArray(N)){var P=QFe(N,2);C=P[0],O=P[1]}else C=O=N;if(s==="vertical"){var T=d.scale,$=_+i,B=$+a,R=$-a,M=T(S-C),F=T(S+O);j.push({x1:F,y1:B,x2:F,y2:R}),j.push({x1:M,y1:$,x2:F,y2:$}),j.push({x1:M,y1:B,x2:M,y2:R})}else if(s==="horizontal"){var q=f.scale,V=b+i,W=V-a,z=V+a,H=q(S-C),G=q(S+O);j.push({x1:W,y1:G,x2:z,y2:G}),j.push({x1:V,y1:H,x2:V,y2:G}),j.push({x1:W,y1:H,x2:z,y2:H})}return D.createElement(Rt,g1({className:"recharts-errorBar",key:"bar-".concat(j.map(function(Y){return"".concat(Y.x1,"-").concat(Y.x2,"-").concat(Y.y1,"-").concat(Y.y2)}))},m),j.map(function(Y){return D.createElement("line",g1({},Y,{key:"line-".concat(Y.x1,"-").concat(Y.x2,"-").concat(Y.y1,"-").concat(Y.y2)}))}))});return D.createElement(Rt,{className:"recharts-errorBars"},y)}}])}(D.Component);CY(Qk,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});CY(Qk,"displayName","ErrorBar");function Dv(t){"@babel/helpers - typeof";return Dv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dv(t)}function zB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function iu(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?zB(Object(r),!0).forEach(function(n){pze(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zB(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function pze(t,e,r){return e=mze(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mze(t){var e=gze(t,"string");return Dv(e)=="symbol"?e:e+""}function gze(t,e){if(Dv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Dv(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var OY=function(e){var r=e.children,n=e.formattedGraphicalItems,i=e.legendWidth,s=e.legendContent,a=Di(r,th);if(!a)return null;var o=th.defaultProps,c=o!==void 0?iu(iu({},o),a.props):{},u;return a.props&&a.props.payload?u=a.props&&a.props.payload:s==="children"?u=(n||[]).reduce(function(d,f){var p=f.item,m=f.props,y=m.sectors||m.data||[];return d.concat(y.map(function(v){return{type:a.props.iconType||p.props.legendType,value:v.name,color:v.fill,payload:v}}))},[]):u=(n||[]).map(function(d){var f=d.item,p=f.type.defaultProps,m=p!==void 0?iu(iu({},p),f.props):{},y=m.dataKey,v=m.name,w=m.legendType,b=m.hide;return{inactive:b,dataKey:y,type:c.iconType||w||"square",color:mR(f),value:v||y,payload:m}}),iu(iu(iu({},c),th.getWithHeight(a,i)),{},{payload:u,item:a})};function Bv(t){"@babel/helpers - typeof";return Bv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bv(t)}function UB(t){return bze(t)||xze(t)||yze(t)||vze()}function vze(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
837In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yze(t,e){if(t){if(typeof t=="string")return PT(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return PT(t,e)}}function xze(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function bze(t){if(Array.isArray(t))return PT(t)}function PT(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function HB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Cr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?HB(Object(r),!0).forEach(function(n){nh(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):HB(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function nh(t,e,r){return e=wze(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wze(t){var e=_ze(t,"string");return Bv(e)=="symbol"?e:e+""}function _ze(t,e){if(Bv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Bv(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Un(t,e,r){return vt(t)||vt(e)?r:en(e)?Zi(t,e,r):Je(e)?e(t):r}function bg(t,e,r,n){var i=xFe(t,function(o){return Un(o,e)});if(r==="number"){var s=i.filter(function(o){return xe(o)||parseFloat(o)});return s.length?[Zk(s),Gk(s)]:[1/0,-1/0]}var a=n?i.filter(function(o){return!vt(o)}):i;return a.map(function(o){return en(o)||o instanceof Date?o:""})}var kze=function(e){var r,n=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=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(o<=1)return 0;if(s&&s.axisType==="angleAxis"&&Math.abs(Math.abs(s.range[1]-s.range[0])-360)<=1e-6)for(var c=s.range,u=0;u<o;u++){var d=u>0?i[u-1].coordinate:i[o-1].coordinate,f=i[u].coordinate,p=u>=o-1?i[0].coordinate:i[u+1].coordinate,m=void 0;if(ri(f-d)!==ri(p-f)){var y=[];if(ri(p-f)===ri(c[1]-c[0])){m=p;var v=f+c[1]-c[0];y[0]=Math.min(v,(v+d)/2),y[1]=Math.max(v,(v+d)/2)}else{m=d;var w=p+c[1]-c[0];y[0]=Math.min(f,(w+f)/2),y[1]=Math.max(f,(w+f)/2)}var b=[Math.min(f,(m+f)/2),Math.max(f,(m+f)/2)];if(e>b[0]&&e<=b[1]||e>=y[0]&&e<=y[1]){a=i[u].index;break}}else{var _=Math.min(d,p),S=Math.max(d,p);if(e>(_+f)/2&&e<=(S+f)/2){a=i[u].index;break}}}else for(var N=0;N<o;N++)if(N===0&&e<=(n[N].coordinate+n[N+1].coordinate)/2||N>0&&N<o-1&&e>(n[N].coordinate+n[N-1].coordinate)/2&&e<=(n[N].coordinate+n[N+1].coordinate)/2||N===o-1&&e>(n[N].coordinate+n[N-1].coordinate)/2){a=n[N].index;break}return a},mR=function(e){var r,n=e,i=n.type.displayName,s=(r=e.type)!==null&&r!==void 0&&r.defaultProps?Cr(Cr({},e.type.defaultProps),e.props):e.props,a=s.stroke,o=s.fill,c;switch(i){case"Line":c=a;break;case"Area":case"Radar":c=a&&a!=="none"?a:o;break;default:c=o;break}return c},Sze=function(e){var r=e.barSize,n=e.totalSize,i=e.stackGroups,s=i===void 0?{}:i;if(!s)return{};for(var a={},o=Object.keys(s),c=0,u=o.length;c<u;c++)for(var d=s[o[c]].stackGroups,f=Object.keys(d),p=0,m=f.length;p<m;p++){var y=d[f[p]],v=y.items,w=y.cateAxisId,b=v.filter(function(O){return Mo(O.type).indexOf("Bar")>=0});if(b&&b.length){var _=b[0].type.defaultProps,S=_!==void 0?Cr(Cr({},_),b[0].props):b[0].props,N=S.barSize,j=S[w];a[j]||(a[j]=[]);var C=vt(N)?r:N;a[j].push({item:b[0],stackList:b.slice(1),barSize:vt(C)?void 0:ni(C,n,0)})}}return a},jze=function(e){var r=e.barGap,n=e.barCategoryGap,i=e.bandSize,s=e.sizeList,a=s===void 0?[]:s,o=e.maxBarSize,c=a.length;if(c<1)return null;var u=ni(r,i,0,!0),d,f=[];if(a[0].barSize===+a[0].barSize){var p=!1,m=i/c,y=a.reduce(function(N,j){return N+j.barSize||0},0);y+=(c-1)*u,y>=i&&(y-=(c-1)*u,u=0),y>=i&&m>0&&(p=!0,m*=.9,y=c*m);var v=(i-y)/2>>0,w={offset:v-u,size:0};d=a.reduce(function(N,j){var C={item:j.item,position:{offset:w.offset+w.size+u,size:p?m:j.barSize}},O=[].concat(UB(N),[C]);return w=O[O.length-1].position,j.stackList&&j.stackList.length&&j.stackList.forEach(function(P){O.push({item:P,position:w})}),O},f)}else{var b=ni(n,i,0,!0);i-2*b-(c-1)*u<=0&&(u=0);var _=(i-2*b-(c-1)*u)/c;_>1&&(_>>=0);var S=o===+o?Math.min(_,o):_;d=a.reduce(function(N,j,C){var O=[].concat(UB(N),[{item:j.item,position:{offset:b+(_+u)*C+(_-S)/2,size:S}}]);return j.stackList&&j.stackList.length&&j.stackList.forEach(function(P){O.push({item:P,position:O[O.length-1].position})}),O},f)}return d},Nze=function(e,r,n,i){var s=n.children,a=n.width,o=n.margin,c=a-(o.left||0)-(o.right||0),u=OY({children:s,legendWidth:c});if(u){var d=i||{},f=d.width,p=d.height,m=u.align,y=u.verticalAlign,v=u.layout;if((v==="vertical"||v==="horizontal"&&y==="middle")&&m!=="center"&&xe(e[m]))return Cr(Cr({},e),{},nh({},m,e[m]+(f||0)));if((v==="horizontal"||v==="vertical"&&m==="center")&&y!=="middle"&&xe(e[y]))return Cr(Cr({},e),{},nh({},y,e[y]+(p||0)))}return e},Cze=function(e,r,n){return vt(r)?!0:e==="horizontal"?r==="yAxis":e==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},TY=function(e,r,n,i,s){var a=r.props.children,o=Ts(a,Qk).filter(function(u){return Cze(i,s,u.props.direction)});if(o&&o.length){var c=o.map(function(u){return u.props.dataKey});return e.reduce(function(u,d){var f=Un(d,n);if(vt(f))return u;var p=Array.isArray(f)?[Zk(f),Gk(f)]:[f,f],m=c.reduce(function(y,v){var w=Un(d,v,0),b=p[0]-Math.abs(Array.isArray(w)?w[0]:w),_=p[1]+Math.abs(Array.isArray(w)?w[1]:w);return[Math.min(b,y[0]),Math.max(_,y[1])]},[1/0,-1/0]);return[Math.min(m[0],u[0]),Math.max(m[1],u[1])]},[1/0,-1/0])}return null},Eze=function(e,r,n,i,s){var a=r.map(function(o){return TY(e,o,n,s,i)}).filter(function(o){return!vt(o)});return a&&a.length?a.reduce(function(o,c){return[Math.min(o[0],c[0]),Math.max(o[1],c[1])]},[1/0,-1/0]):null},AY=function(e,r,n,i,s){var a=r.map(function(c){var u=c.props.dataKey;return n==="number"&&u&&TY(e,c,u,i)||bg(e,u,n,s)});if(n==="number")return a.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var o={};return a.reduce(function(c,u){for(var d=0,f=u.length;d<f;d++)o[u[d]]||(o[u[d]]=!0,c.push(u[d]));return c},[])},PY=function(e,r){return e==="horizontal"&&r==="xAxis"||e==="vertical"&&r==="yAxis"||e==="centric"&&r==="angleAxis"||e==="radial"&&r==="radiusAxis"},MY=function(e,r,n,i){if(i)return e.map(function(c){return c.coordinate});var s,a,o=e.map(function(c){return c.coordinate===r&&(s=!0),c.coordinate===n&&(a=!0),c.coordinate});return s||o.push(r),a||o.push(n),o},Oo=function(e,r,n){if(!e)return null;var i=e.scale,s=e.duplicateDomain,a=e.type,o=e.range,c=e.realScaleType==="scaleBand"?i.bandwidth()/2:2,u=(r||n)&&a==="category"&&i.bandwidth?i.bandwidth()/c:0;if(u=e.axisType==="angleAxis"&&(o==null?void 0:o.length)>=2?ri(o[0]-o[1])*2*u:u,r&&(e.ticks||e.niceTicks)){var d=(e.ticks||e.niceTicks).map(function(f){var p=s?s.indexOf(f):f;return{coordinate:i(p)+u,value:f,offset:u}});return d.filter(function(f){return!Dy(f.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(f,p){return{coordinate:i(f)+u,value:f,index:p,offset:u}}):i.ticks&&!n?i.ticks(e.tickCount).map(function(f){return{coordinate:i(f)+u,value:f,offset:u}}):i.domain().map(function(f,p){return{coordinate:i(f)+u,value:s?s[f]:f,index:p,offset:u}})},ZN=new WeakMap,pb=function(e,r){if(typeof r!="function")return e;ZN.has(e)||ZN.set(e,new WeakMap);var n=ZN.get(e);if(n.has(r))return n.get(r);var i=function(){e.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},RY=function(e,r,n){var i=e.scale,s=e.type,a=e.layout,o=e.axisType;if(i==="auto")return a==="radial"&&o==="radiusAxis"?{scale:Av(),realScaleType:"band"}:a==="radial"&&o==="angleAxis"?{scale:d1(),realScaleType:"linear"}:s==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:xg(),realScaleType:"point"}:s==="category"?{scale:Av(),realScaleType:"band"}:{scale:d1(),realScaleType:"linear"};if(ld(i)){var c="scale".concat(Rk(i));return{scale:(LB[c]||xg)(),realScaleType:LB[c]?c:"point"}}return Je(i)?{scale:i}:{scale:xg(),realScaleType:"point"}},VB=1e-4,IY=function(e){var r=e.domain();if(!(!r||r.length<=2)){var n=r.length,i=e.range(),s=Math.min(i[0],i[1])-VB,a=Math.max(i[0],i[1])+VB,o=e(r[0]),c=e(r[n-1]);(o<s||o>a||c<s||c>a)&&e.domain([r[0],r[n-1]])}},Oze=function(e,r){if(!e)return null;for(var n=0,i=e.length;n<i;n++)if(e[n].item===r)return e[n].position;return null},Tze=function(e,r){if(!r||r.length!==2||!xe(r[0])||!xe(r[1]))return e;var n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]),s=[e[0],e[1]];return(!xe(e[0])||e[0]<n)&&(s[0]=n),(!xe(e[1])||e[1]>i)&&(s[1]=i),s[0]>i&&(s[0]=i),s[1]<n&&(s[1]=n),s},Aze=function(e){var r=e.length;if(!(r<=0))for(var n=0,i=e[0].length;n<i;++n)for(var s=0,a=0,o=0;o<r;++o){var c=Dy(e[o][n][1])?e[o][n][0]:e[o][n][1];c>=0?(e[o][n][0]=s,e[o][n][1]=s+c,s=e[o][n][1]):(e[o][n][0]=a,e[o][n][1]=a+c,a=e[o][n][1])}},Pze=function(e){var r=e.length;if(!(r<=0))for(var n=0,i=e[0].length;n<i;++n)for(var s=0,a=0;a<r;++a){var o=Dy(e[a][n][1])?e[a][n][0]:e[a][n][1];o>=0?(e[a][n][0]=s,e[a][n][1]=s+o,s=e[a][n][1]):(e[a][n][0]=0,e[a][n][1]=0)}},Mze={sign:Aze,expand:XAe,none:Bh,silhouette:QAe,wiggle:ePe,positive:Pze},Rze=function(e,r,n){var i=r.map(function(o){return o.props.dataKey}),s=Mze[n],a=YAe().keys(i).value(function(o,c){return+Un(o,c,0)}).order(nT).offset(s);return a(e)},Ize=function(e,r,n,i,s,a){if(!e)return null;var o=a?r.reverse():r,c={},u=o.reduce(function(f,p){var m,y=(m=p.type)!==null&&m!==void 0&&m.defaultProps?Cr(Cr({},p.type.defaultProps),p.props):p.props,v=y.stackId,w=y.hide;if(w)return f;var b=y[n],_=f[b]||{hasStack:!1,stackGroups:{}};if(en(v)){var S=_.stackGroups[v]||{numericAxisId:n,cateAxisId:i,items:[]};S.items.push(p),_.hasStack=!0,_.stackGroups[v]=S}else _.stackGroups[By("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[p]};return Cr(Cr({},f),{},nh({},b,_))},c),d={};return Object.keys(u).reduce(function(f,p){var m=u[p];if(m.hasStack){var y={};m.stackGroups=Object.keys(m.stackGroups).reduce(function(v,w){var b=m.stackGroups[w];return Cr(Cr({},v),{},nh({},w,{numericAxisId:n,cateAxisId:i,items:b.items,stackedData:Rze(e,b.items,s)}))},y)}return Cr(Cr({},f),{},nh({},p,m))},d)},LY=function(e,r){var n=r.realScaleType,i=r.type,s=r.tickCount,a=r.originalDomain,o=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(s&&i==="number"&&a&&(a[0]==="auto"||a[1]==="auto")){var u=e.domain();if(!u.length)return null;var d=ZFe(u,s,o);return e.domain([Zk(d),Gk(d)]),{niceTicks:d}}if(s&&i==="number"){var f=e.domain(),p=JFe(f,s,o);return{niceTicks:p}}return null},WB=function(e){var r=e.axis,n=e.ticks,i=e.offset,s=e.bandSize,a=e.entry,o=e.index;if(r.type==="category")return n[o]?n[o].coordinate+i:null;var c=Un(a,r.dataKey,r.domain[o]);return vt(c)?null:r.scale(c)-s/2+i},Lze=function(e){var r=e.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),s=Math.max(n[0],n[1]);return i<=0&&s>=0?0:s<0?s:i}return n[0]},$ze=function(e,r){var n,i=(n=e.type)!==null&&n!==void 0&&n.defaultProps?Cr(Cr({},e.type.defaultProps),e.props):e.props,s=i.stackId;if(en(s)){var a=r[s];if(a){var o=a.items.indexOf(e);return o>=0?a.stackedData[o]:null}}return null},Dze=function(e){return e.reduce(function(r,n){return[Zk(n.concat([r[0]]).filter(xe)),Gk(n.concat([r[1]]).filter(xe))]},[1/0,-1/0])},$Y=function(e,r,n){return Object.keys(e).reduce(function(i,s){var a=e[s],o=a.stackedData,c=o.reduce(function(u,d){var f=Dze(d.slice(r,n+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},qB=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,KB=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,MT=function(e,r,n){if(Je(e))return e(r,n);if(!Array.isArray(e))return r;var i=[];if(xe(e[0]))i[0]=n?e[0]:Math.min(e[0],r[0]);else if(qB.test(e[0])){var s=+qB.exec(e[0])[1];i[0]=r[0]-s}else Je(e[0])?i[0]=e[0](r[0]):i[0]=r[0];if(xe(e[1]))i[1]=n?e[1]:Math.max(e[1],r[1]);else if(KB.test(e[1])){var a=+KB.exec(e[1])[1];i[1]=r[1]+a}else Je(e[1])?i[1]=e[1](r[1]):i[1]=r[1];return i},y1=function(e,r,n){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!n||i>0)return i}if(e&&r&&r.length>=2){for(var s=HM(r,function(f){return f.coordinate}),a=1/0,o=1,c=s.length;o<c;o++){var u=s[o],d=s[o-1];a=Math.min((u.coordinate||0)-(d.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0},GB=function(e,r,n){return!e||!e.length||Jk(e,Zi(n,"type.defaultProps.domain"))?r:e},DY=function(e,r){var n=e.type.defaultProps?Cr(Cr({},e.type.defaultProps),e.props):e.props,i=n.dataKey,s=n.name,a=n.unit,o=n.formatter,c=n.tooltipType,u=n.chartType,d=n.hide;return Cr(Cr({},Ge(e,!1)),{},{dataKey:i,unit:a,formatter:o,name:s||i,color:mR(e),value:Un(r,i),type:c,payload:r,chartType:u,hide:d})};function Fv(t){"@babel/helpers - typeof";return Fv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fv(t)}function ZB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function wo(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ZB(Object(r),!0).forEach(function(n){BY(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ZB(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function BY(t,e,r){return e=Bze(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Bze(t){var e=Fze(t,"string");return Fv(e)=="symbol"?e:e+""}function Fze(t,e){if(Fv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Fv(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function zze(t,e){return Wze(t)||Vze(t,e)||Hze(t,e)||Uze()}function Uze(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
838In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hze(t,e){if(t){if(typeof t=="string")return JB(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return JB(t,e)}}function JB(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Vze(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function Wze(t){if(Array.isArray(t))return t}var x1=Math.PI/180,qze=function(e){return e*180/Math.PI},Xt=function(e,r,n,i){return{x:e+Math.cos(-x1*i)*n,y:r+Math.sin(-x1*i)*n}},FY=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},Kze=function(e,r,n,i,s){var a=e.width,o=e.height,c=e.startAngle,u=e.endAngle,d=ni(e.cx,a,a/2),f=ni(e.cy,o,o/2),p=FY(a,o,n),m=ni(e.innerRadius,p,0),y=ni(e.outerRadius,p,p*.8),v=Object.keys(r);return v.reduce(function(w,b){var _=r[b],S=_.domain,N=_.reversed,j;if(vt(_.range))i==="angleAxis"?j=[c,u]:i==="radiusAxis"&&(j=[m,y]),N&&(j=[j[1],j[0]]);else{j=_.range;var C=j,O=zze(C,2);c=O[0],u=O[1]}var P=RY(_,s),T=P.realScaleType,$=P.scale;$.domain(S).range(j),IY($);var B=LY($,wo(wo({},_),{},{realScaleType:T})),R=wo(wo(wo({},_),B),{},{range:j,radius:y,realScaleType:T,scale:$,cx:d,cy:f,innerRadius:m,outerRadius:y,startAngle:c,endAngle:u});return wo(wo({},w),{},BY({},b,R))},{})},Gze=function(e,r){var n=e.x,i=e.y,s=r.x,a=r.y;return Math.sqrt(Math.pow(n-s,2)+Math.pow(i-a,2))},Zze=function(e,r){var n=e.x,i=e.y,s=r.cx,a=r.cy,o=Gze({x:n,y:i},{x:s,y:a});if(o<=0)return{radius:o};var c=(n-s)/o,u=Math.acos(c);return i>a&&(u=2*Math.PI-u),{radius:o,angle:qze(u),angleInRadian:u}},Jze=function(e){var r=e.startAngle,n=e.endAngle,i=Math.floor(r/360),s=Math.floor(n/360),a=Math.min(i,s);return{startAngle:r-a*360,endAngle:n-a*360}},Yze=function(e,r){var n=r.startAngle,i=r.endAngle,s=Math.floor(n/360),a=Math.floor(i/360),o=Math.min(s,a);return e+o*360},YB=function(e,r){var n=e.x,i=e.y,s=Zze({x:n,y:i},r),a=s.radius,o=s.angle,c=r.innerRadius,u=r.outerRadius;if(a<c||a>u)return!1;if(a===0)return!0;var d=Jze(r),f=d.startAngle,p=d.endAngle,m=o,y;if(f<=p){for(;m>p;)m-=360;for(;m<f;)m+=360;y=m>=f&&m<=p}else{for(;m>f;)m-=360;for(;m<p;)m+=360;y=m>=p&&m<=f}return y?wo(wo({},r),{},{radius:a,angle:Yze(m,r)}):null},zY=function(e){return!x.isValidElement(e)&&!Je(e)&&typeof e!="boolean"?e.className:""};function zv(t){"@babel/helpers - typeof";return zv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zv(t)}var Xze=["offset"];function Qze(t){return n8e(t)||r8e(t)||t8e(t)||e8e()}function e8e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
839In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function t8e(t,e){if(t){if(typeof t=="string")return RT(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return RT(t,e)}}function r8e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function n8e(t){if(Array.isArray(t))return RT(t)}function RT(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function i8e(t,e){if(t==null)return{};var r=s8e(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function s8e(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function XB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Zr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?XB(Object(r),!0).forEach(function(n){a8e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):XB(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function a8e(t,e,r){return e=o8e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o8e(t){var e=l8e(t,"string");return zv(e)=="symbol"?e:e+""}function l8e(t,e){if(zv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(zv(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Uv(){return Uv=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Uv.apply(this,arguments)}var c8e=function(e){var r=e.value,n=e.formatter,i=vt(e.children)?r:e.children;return Je(n)?n(i):i},u8e=function(e,r){var n=ri(r-e),i=Math.min(Math.abs(r-e),360);return n*i},d8e=function(e,r,n){var i=e.position,s=e.viewBox,a=e.offset,o=e.className,c=s,u=c.cx,d=c.cy,f=c.innerRadius,p=c.outerRadius,m=c.startAngle,y=c.endAngle,v=c.clockWise,w=(f+p)/2,b=u8e(m,y),_=b>=0?1:-1,S,N;i==="insideStart"?(S=m+_*a,N=v):i==="insideEnd"?(S=y-_*a,N=!v):i==="end"&&(S=y+_*a,N=v),N=b<=0?N:!N;var j=Xt(u,d,w,S),C=Xt(u,d,w,S+(N?1:-1)*359),O="M".concat(j.x,",").concat(j.y,`
840    A`).concat(w,",").concat(w,",0,1,").concat(N?0:1,`,
841    `).concat(C.x,",").concat(C.y),P=vt(e.id)?By("recharts-radial-line-"):e.id;return D.createElement("text",Uv({},n,{dominantBaseline:"central",className:at("recharts-radial-bar-label",o)}),D.createElement("defs",null,D.createElement("path",{id:P,d:O})),D.createElement("textPath",{xlinkHref:"#".concat(P)},r))},f8e=function(e){var r=e.viewBox,n=e.offset,i=e.position,s=r,a=s.cx,o=s.cy,c=s.innerRadius,u=s.outerRadius,d=s.startAngle,f=s.endAngle,p=(d+f)/2;if(i==="outside"){var m=Xt(a,o,u+n,p),y=m.x,v=m.y;return{x:y,y:v,textAnchor:y>=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 w=(c+u)/2,b=Xt(a,o,w,p),_=b.x,S=b.y;return{x:_,y:S,textAnchor:"middle",verticalAnchor:"middle"}},h8e=function(e){var r=e.viewBox,n=e.parentViewBox,i=e.offset,s=e.position,a=r,o=a.x,c=a.y,u=a.width,d=a.height,f=d>=0?1:-1,p=f*i,m=f>0?"end":"start",y=f>0?"start":"end",v=u>=0?1:-1,w=v*i,b=v>0?"end":"start",_=v>0?"start":"end";if(s==="top"){var S={x:o+u/2,y:c-f*i,textAnchor:"middle",verticalAnchor:m};return Zr(Zr({},S),n?{height:Math.max(c-n.y,0),width:u}:{})}if(s==="bottom"){var N={x:o+u/2,y:c+d+p,textAnchor:"middle",verticalAnchor:y};return Zr(Zr({},N),n?{height:Math.max(n.y+n.height-(c+d),0),width:u}:{})}if(s==="left"){var j={x:o-w,y:c+d/2,textAnchor:b,verticalAnchor:"middle"};return Zr(Zr({},j),n?{width:Math.max(j.x-n.x,0),height:d}:{})}if(s==="right"){var C={x:o+u+w,y:c+d/2,textAnchor:_,verticalAnchor:"middle"};return Zr(Zr({},C),n?{width:Math.max(n.x+n.width-C.x,0),height:d}:{})}var O=n?{width:u,height:d}:{};return s==="insideLeft"?Zr({x:o+w,y:c+d/2,textAnchor:_,verticalAnchor:"middle"},O):s==="insideRight"?Zr({x:o+u-w,y:c+d/2,textAnchor:b,verticalAnchor:"middle"},O):s==="insideTop"?Zr({x:o+u/2,y:c+p,textAnchor:"middle",verticalAnchor:y},O):s==="insideBottom"?Zr({x:o+u/2,y:c+d-p,textAnchor:"middle",verticalAnchor:m},O):s==="insideTopLeft"?Zr({x:o+w,y:c+p,textAnchor:_,verticalAnchor:y},O):s==="insideTopRight"?Zr({x:o+u-w,y:c+p,textAnchor:b,verticalAnchor:y},O):s==="insideBottomLeft"?Zr({x:o+w,y:c+d-p,textAnchor:_,verticalAnchor:m},O):s==="insideBottomRight"?Zr({x:o+u-w,y:c+d-p,textAnchor:b,verticalAnchor:m},O):Ap(s)&&(xe(s.x)||ju(s.x))&&(xe(s.y)||ju(s.y))?Zr({x:o+ni(s.x,u),y:c+ni(s.y,d),textAnchor:"end",verticalAnchor:"end"},O):Zr({x:o+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},O)},p8e=function(e){return"cx"in e&&xe(e.cx)};function cn(t){var e=t.offset,r=e===void 0?5:e,n=i8e(t,Xze),i=Zr({offset:r},n),s=i.viewBox,a=i.position,o=i.value,c=i.children,u=i.content,d=i.className,f=d===void 0?"":d,p=i.textBreakAll;if(!s||vt(o)&&vt(c)&&!x.isValidElement(u)&&!Je(u))return null;if(x.isValidElement(u))return x.cloneElement(u,i);var m;if(Je(u)){if(m=x.createElement(u,i),x.isValidElement(m))return m}else m=c8e(i);var y=p8e(s),v=Ge(i,!0);if(y&&(a==="insideStart"||a==="insideEnd"||a==="end"))return d8e(i,m,v);var w=y?f8e(i):h8e(i);return D.createElement(ud,Uv({className:at("recharts-label",f)},v,w,{breakAll:p}),m)}cn.displayName="Label";var UY=function(e){var r=e.cx,n=e.cy,i=e.angle,s=e.startAngle,a=e.endAngle,o=e.r,c=e.radius,u=e.innerRadius,d=e.outerRadius,f=e.x,p=e.y,m=e.top,y=e.left,v=e.width,w=e.height,b=e.clockWise,_=e.labelViewBox;if(_)return _;if(xe(v)&&xe(w)){if(xe(f)&&xe(p))return{x:f,y:p,width:v,height:w};if(xe(m)&&xe(y))return{x:m,y,width:v,height:w}}return xe(f)&&xe(p)?{x:f,y:p,width:0,height:0}:xe(r)&&xe(n)?{cx:r,cy:n,startAngle:s||i||0,endAngle:a||i||0,innerRadius:u||0,outerRadius:d||c||o||0,clockWise:b}:e.viewBox?e.viewBox:{}},m8e=function(e,r){return e?e===!0?D.createElement(cn,{key:"label-implicit",viewBox:r}):en(e)?D.createElement(cn,{key:"label-implicit",viewBox:r,value:e}):x.isValidElement(e)?e.type===cn?x.cloneElement(e,{key:"label-implicit",viewBox:r}):D.createElement(cn,{key:"label-implicit",content:e,viewBox:r}):Je(e)?D.createElement(cn,{key:"label-implicit",content:e,viewBox:r}):Ap(e)?D.createElement(cn,Uv({viewBox:r},e,{key:"label-implicit"})):null:null},g8e=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var i=e.children,s=UY(e),a=Ts(i,cn).map(function(c,u){return x.cloneElement(c,{viewBox:r||s,key:"label-".concat(u)})});if(!n)return a;var o=m8e(e.label,r||s);return[o].concat(Qze(a))};cn.parseViewBox=UY;cn.renderCallByParent=g8e;function v8e(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var y8e=v8e;const x8e=St(y8e);function Hv(t){"@babel/helpers - typeof";return Hv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hv(t)}var b8e=["valueAccessor"],w8e=["data","dataKey","clockWise","id","textBreakAll"];function _8e(t){return N8e(t)||j8e(t)||S8e(t)||k8e()}function k8e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
842In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S8e(t,e){if(t){if(typeof t=="string")return IT(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return IT(t,e)}}function j8e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function N8e(t){if(Array.isArray(t))return IT(t)}function IT(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function b1(){return b1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},b1.apply(this,arguments)}function QB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function eF(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?QB(Object(r),!0).forEach(function(n){C8e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):QB(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function C8e(t,e,r){return e=E8e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function E8e(t){var e=O8e(t,"string");return Hv(e)=="symbol"?e:e+""}function O8e(t,e){if(Hv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Hv(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tF(t,e){if(t==null)return{};var r=T8e(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function T8e(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var A8e=function(e){return Array.isArray(e.value)?x8e(e.value):e.value};function hc(t){var e=t.valueAccessor,r=e===void 0?A8e:e,n=tF(t,b8e),i=n.data,s=n.dataKey,a=n.clockWise,o=n.id,c=n.textBreakAll,u=tF(n,w8e);return!i||!i.length?null:D.createElement(Rt,{className:"recharts-label-list"},i.map(function(d,f){var p=vt(s)?r(d,f):Un(d&&d.payload,s),m=vt(o)?{}:{id:"".concat(o,"-").concat(f)};return D.createElement(cn,b1({},Ge(d,!0),u,m,{parentViewBox:d.parentViewBox,value:p,textBreakAll:c,viewBox:cn.parseViewBox(vt(a)?d:eF(eF({},d),{},{clockWise:a})),key:"label-".concat(f),index:f}))}))}hc.displayName="LabelList";function P8e(t,e){return t?t===!0?D.createElement(hc,{key:"labelList-implicit",data:e}):D.isValidElement(t)||Je(t)?D.createElement(hc,{key:"labelList-implicit",data:e,content:t}):Ap(t)?D.createElement(hc,b1({data:e},t,{key:"labelList-implicit"})):null:null}function M8e(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var n=t.children,i=Ts(n,hc).map(function(a,o){return x.cloneElement(a,{data:e,key:"labelList-".concat(o)})});if(!r)return i;var s=P8e(t.label,e);return[s].concat(_8e(i))}hc.renderCallByParent=M8e;function Vv(t){"@babel/helpers - typeof";return Vv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vv(t)}function LT(){return LT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},LT.apply(this,arguments)}function rF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function nF(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?rF(Object(r),!0).forEach(function(n){R8e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function R8e(t,e,r){return e=I8e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function I8e(t){var e=L8e(t,"string");return Vv(e)=="symbol"?e:e+""}function L8e(t,e){if(Vv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Vv(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var $8e=function(e,r){var n=ri(r-e),i=Math.min(Math.abs(r-e),359.999);return n*i},mb=function(e){var r=e.cx,n=e.cy,i=e.radius,s=e.angle,a=e.sign,o=e.isExternal,c=e.cornerRadius,u=e.cornerIsExternal,d=c*(o?1:-1)+i,f=Math.asin(c/d)/x1,p=u?s:s+a*f,m=Xt(r,n,d,p),y=Xt(r,n,i,p),v=u?s-a*f:s,w=Xt(r,n,d*Math.cos(f*x1),v);return{center:m,circleTangency:y,lineTangency:w,theta:f}},HY=function(e){var r=e.cx,n=e.cy,i=e.innerRadius,s=e.outerRadius,a=e.startAngle,o=e.endAngle,c=$8e(a,o),u=a+c,d=Xt(r,n,s,a),f=Xt(r,n,s,u),p="M ".concat(d.x,",").concat(d.y,`
843    A `).concat(s,",").concat(s,`,0,
844    `).concat(+(Math.abs(c)>180),",").concat(+(a>u),`,
845    `).concat(f.x,",").concat(f.y,`
846  `);if(i>0){var m=Xt(r,n,i,a),y=Xt(r,n,i,u);p+="L ".concat(y.x,",").concat(y.y,`
847            A `).concat(i,",").concat(i,`,0,
848            `).concat(+(Math.abs(c)>180),",").concat(+(a<=u),`,
849            `).concat(m.x,",").concat(m.y," Z")}else p+="L ".concat(r,",").concat(n," Z");return p},D8e=function(e){var r=e.cx,n=e.cy,i=e.innerRadius,s=e.outerRadius,a=e.cornerRadius,o=e.forceCornerRadius,c=e.cornerIsExternal,u=e.startAngle,d=e.endAngle,f=ri(d-u),p=mb({cx:r,cy:n,radius:s,angle:u,sign:f,cornerRadius:a,cornerIsExternal:c}),m=p.circleTangency,y=p.lineTangency,v=p.theta,w=mb({cx:r,cy:n,radius:s,angle:d,sign:-f,cornerRadius:a,cornerIsExternal:c}),b=w.circleTangency,_=w.lineTangency,S=w.theta,N=c?Math.abs(u-d):Math.abs(u-d)-v-S;if(N<0)return o?"M ".concat(y.x,",").concat(y.y,`
850        a`).concat(a,",").concat(a,",0,0,1,").concat(a*2,`,0
851        a`).concat(a,",").concat(a,",0,0,1,").concat(-a*2,`,0
852      `):HY({cx:r,cy:n,innerRadius:i,outerRadius:s,startAngle:u,endAngle:d});var j="M ".concat(y.x,",").concat(y.y,`
853    A`).concat(a,",").concat(a,",0,0,").concat(+(f<0),",").concat(m.x,",").concat(m.y,`
854    A`).concat(s,",").concat(s,",0,").concat(+(N>180),",").concat(+(f<0),",").concat(b.x,",").concat(b.y,`
855    A`).concat(a,",").concat(a,",0,0,").concat(+(f<0),",").concat(_.x,",").concat(_.y,`
856  `);if(i>0){var C=mb({cx:r,cy:n,radius:i,angle:u,sign:f,isExternal:!0,cornerRadius:a,cornerIsExternal:c}),O=C.circleTangency,P=C.lineTangency,T=C.theta,$=mb({cx:r,cy:n,radius:i,angle:d,sign:-f,isExternal:!0,cornerRadius:a,cornerIsExternal:c}),B=$.circleTangency,R=$.lineTangency,M=$.theta,F=c?Math.abs(u-d):Math.abs(u-d)-T-M;if(F<0&&a===0)return"".concat(j,"L").concat(r,",").concat(n,"Z");j+="L".concat(R.x,",").concat(R.y,`
857      A`).concat(a,",").concat(a,",0,0,").concat(+(f<0),",").concat(B.x,",").concat(B.y,`
858      A`).concat(i,",").concat(i,",0,").concat(+(F>180),",").concat(+(f>0),",").concat(O.x,",").concat(O.y,`
859      A`).concat(a,",").concat(a,",0,0,").concat(+(f<0),",").concat(P.x,",").concat(P.y,"Z")}else j+="L".concat(r,",").concat(n,"Z");return j},B8e={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},VY=function(e){var r=nF(nF({},B8e),e),n=r.cx,i=r.cy,s=r.innerRadius,a=r.outerRadius,o=r.cornerRadius,c=r.forceCornerRadius,u=r.cornerIsExternal,d=r.startAngle,f=r.endAngle,p=r.className;if(a<s||d===f)return null;var m=at("recharts-sector",p),y=a-s,v=ni(o,y,0,!0),w;return v>0&&Math.abs(d-f)<360?w=D8e({cx:n,cy:i,innerRadius:s,outerRadius:a,cornerRadius:Math.min(v,y/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):w=HY({cx:n,cy:i,innerRadius:s,outerRadius:a,startAngle:d,endAngle:f}),D.createElement("path",LT({},Ge(r,!0),{className:m,d:w,role:"img"}))};function Wv(t){"@babel/helpers - typeof";return Wv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wv(t)}function $T(){return $T=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];
859for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},$T.apply(this,arguments)}function iF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function sF(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?iF(Object(r),!0).forEach(function(n){F8e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):iF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function F8e(t,e,r){return e=z8e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function z8e(t){var e=U8e(t,"string");return Wv(e)=="symbol"?e:e+""}function U8e(t,e){if(Wv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Wv(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var aF={curveBasisClosed:FAe,curveBasisOpen:zAe,curveBasis:BAe,curveBumpX:jAe,curveBumpY:NAe,curveLinearClosed:UAe,curveLinear:Lk,curveMonotoneX:HAe,curveMonotoneY:VAe,curveNatural:WAe,curveStep:qAe,curveStepAfter:GAe,curveStepBefore:KAe},gb=function(e){return e.x===+e.x&&e.y===+e.y},Cm=function(e){return e.x},Em=function(e){return e.y},H8e=function(e,r){if(Je(e))return e;var n="curve".concat(Rk(e));return(n==="curveMonotone"||n==="curveBump")&&r?aF["".concat(n).concat(r==="vertical"?"Y":"X")]:aF[n]||Lk},V8e=function(e){var r=e.type,n=r===void 0?"linear":r,i=e.points,s=i===void 0?[]:i,a=e.baseLine,o=e.layout,c=e.connectNulls,u=c===void 0?!1:c,d=H8e(n,o),f=u?s.filter(function(v){return gb(v)}):s,p;if(Array.isArray(a)){var m=u?a.filter(function(v){return gb(v)}):a,y=f.map(function(v,w){return sF(sF({},v),{},{base:m[w]})});return o==="vertical"?p=ab().y(Em).x1(Cm).x0(function(v){return v.base.x}):p=ab().x(Cm).y1(Em).y0(function(v){return v.base.y}),p.defined(gb).curve(d),p(y)}return o==="vertical"&&xe(a)?p=ab().y(Em).x1(Cm).x0(a):xe(a)?p=ab().x(Cm).y1(Em).y0(a):p=DZ().x(Cm).y(Em),p.defined(gb).curve(d),p(f)},DT=function(e){var r=e.className,n=e.points,i=e.path,s=e.pathRef;if((!n||!n.length)&&!i)return null;var a=n&&n.length?V8e(e):i;return x.createElement("path",$T({},Ge(e,!1),Ww(e),{className:at("recharts-curve",r),d:a,ref:s}))},WY={exports:{}},W8e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",q8e=W8e,K8e=q8e;function qY(){}function KY(){}KY.resetWarningCache=qY;var G8e=function(){function t(n,i,s,a,o,c){if(c!==K8e){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}}t.isRequired=t;function e(){return t}var r={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:KY,resetWarningCache:qY};return r.PropTypes=r,r};WY.exports=G8e();var Z8e=WY.exports;const Mt=St(Z8e);var J8e=Object.getOwnPropertyNames,Y8e=Object.getOwnPropertySymbols,X8e=Object.prototype.hasOwnProperty;function oF(t,e){return function(n,i,s){return t(n,i,s)&&e(n,i,s)}}function vb(t){return function(r,n,i){if(!r||!n||typeof r!="object"||typeof n!="object")return t(r,n,i);var s=i.cache,a=s.get(r),o=s.get(n);if(a&&o)return a===n&&o===r;s.set(r,n),s.set(n,r);var c=t(r,n,i);return s.delete(r),s.delete(n),c}}function lF(t){return J8e(t).concat(Y8e(t))}var Q8e=Object.hasOwn||function(t,e){return X8e.call(t,e)};function Cd(t,e){return t===e||!t&&!e&&t!==t&&e!==e}var e6e="__v",t6e="__o",r6e="_owner",cF=Object.getOwnPropertyDescriptor,uF=Object.keys;function n6e(t,e,r){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(!r.equals(t[n],e[n],n,n,t,e,r))return!1;return!0}function i6e(t,e){return Cd(t.getTime(),e.getTime())}function s6e(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function a6e(t,e){return t===e}function dF(t,e,r){var n=t.size;if(n!==e.size)return!1;if(!n)return!0;for(var i=new Array(n),s=t.entries(),a,o,c=0;(a=s.next())&&!a.done;){for(var u=e.entries(),d=!1,f=0;(o=u.next())&&!o.done;){if(i[f]){f++;continue}var p=a.value,m=o.value;if(r.equals(p[0],m[0],c,f,t,e,r)&&r.equals(p[1],m[1],p[0],m[0],t,e,r)){d=i[f]=!0;break}f++}if(!d)return!1;c++}return!0}var o6e=Cd;function l6e(t,e,r){var n=uF(t),i=n.length;if(uF(e).length!==i)return!1;for(;i-- >0;)if(!GY(t,e,r,n[i]))return!1;return!0}
859function Om(t,e,r){var n=lF(t),i=n.length;if(lF(e).length!==i)return!1;for(var s,a,o;i-- >0;)if(s=n[i],!GY(t,e,r,s)||(a=cF(t,s),o=cF(e,s),(a||o)&&(!a||!o||a.configurable!==o.configurable||a.enumerable!==o.enumerable||a.writable!==o.writable)))return!1;return!0}function c6e(t,e){return Cd(t.valueOf(),e.valueOf())}function u6e(t,e){return t.source===e.source&&t.flags===e.flags}function fF(t,e,r){var n=t.size;if(n!==e.size)return!1;if(!n)return!0;for(var i=new Array(n),s=t.values(),a,o;(a=s.next())&&!a.done;){for(var c=e.values(),u=!1,d=0;(o=c.next())&&!o.done;){if(!i[d]&&r.equals(a.value,o.value,a.value,o.value,t,e,r)){u=i[d]=!0;break}d++}if(!u)return!1}return!0}function d6e(t,e){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(t[r]!==e[r])return!1;return!0}function f6e(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function GY(t,e,r,n){return(n===r6e||n===t6e||n===e6e)&&(t.$$typeof||e.$$typeof)?!0:Q8e(e,n)&&r.equals(t[n],e[n],n,n,t,e,r)}var h6e="[object Arguments]",p6e="[object Boolean]",m6e="[object Date]",g6e="[object Error]",v6e="[object Map]",y6e="[object Number]",x6e="[object Object]",b6e="[object RegExp]",w6e="[object Set]",_6e="[object String]",k6e="[object URL]",S6e=Array.isArray,hF=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,pF=Object.assign,j6e=Object.prototype.toString.call.bind(Object.prototype.toString);function N6e(t){var e=t.areArraysEqual,r=t.areDatesEqual,n=t.areErrorsEqual,i=t.areFunctionsEqual,s=t.areMapsEqual,a=t.areNumbersEqual,o=t.areObjectsEqual,c=t.arePrimitiveWrappersEqual,u=t.areRegExpsEqual,d=t.areSetsEqual,f=t.areTypedArraysEqual,p=t.areUrlsEqual;return function(y,v,w){if(y===v)return!0;if(y==null||v==null)return!1;var b=typeof y;if(b!==typeof v)return!1;if(b!=="object")return b==="number"?a(y,v,w):b==="function"?i(y,v,w):!1;var _=y.constructor;if(_!==v.constructor)return!1;if(_===Object)return o(y,v,w);if(S6e(y))return e(y,v,w);if(hF!=null&&hF(y))return f(y,v,w);if(_===Date)return r(y,v,w);if(_===RegExp)return u(y,v,w);if(_===Map)return s(y,v,w);if(_===Set)return d(y,v,w);var S=j6e(y);return S===m6e?r(y,v,w):S===b6e?u(y,v,w):S===v6e?s(y,v,w):S===w6e?d(y,v,w):S===x6e?typeof y.then!="function"&&typeof v.then!="function"&&o(y,v,w):S===k6e?p(y,v,w):S===g6e?n(y,v,w):S===h6e?o(y,v,w):S===p6e||S===y6e||S===_6e?c(y,v,w):!1}}function C6e(t){var e=t.circular,r=t.createCustomConfig,n=t.strict,i={areArraysEqual:n?Om:n6e,areDatesEqual:i6e,areErrorsEqual:s6e,areFunctionsEqual:a6e,areMapsEqual:n?oF(dF,Om):dF,areNumbersEqual:o6e,areObjectsEqual:n?Om:l6e,arePrimitiveWrappersEqual:c6e,areRegExpsEqual:u6e,areSetsEqual:n?oF(fF,Om):fF,areTypedArraysEqual:n?Om:d6e,areUrlsEqual:f6e};if(r&&(i=pF({},i,r(i))),e){var s=vb(i.areArraysEqual),a=vb(i.areMapsEqual),o=vb(i.areObjectsEqual),c=vb(i.areSetsEqual);i=pF({},i,{areArraysEqual:s,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:c})}return i}function E6e(t){return function(e,r,n,i,s,a,o){return t(e,r,o)}}function O6e(t){var e=t.circular,r=t.comparator,n=t.createState,i=t.equals,s=t.strict;if(n)return function(c,u){var d=n(),f=d.cache,p=f===void 0?e?new WeakMap:void 0:f,m=d.meta;return r(c,u,{cache:p,equals:i,meta:m,strict:s})};if(e)return function(c,u){return r(c,u,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};var a={cache:void 0,equals:i,meta:void 0,strict:s};return function(c,u){return r(c,u,a)}}var T6e=Wc();Wc({strict:!0});Wc({circular:!0});Wc({circular:!0,strict:!0});Wc({createInternalComparator:function(){return Cd}});Wc({strict:!0,createInternalComparator:function(){return Cd}});Wc({circular:!0,createInternalComparator:function(){return Cd}});Wc({circular:!0,createInternalComparator:function(){return Cd},strict:!0});function Wc(t){t===void 0&&(t={});var e=t.circular,r=e===void 0?!1:e,n=t.createInternalComparator,i=t.createState,s=t.strict,a=s===void 0?!1:s,o=C6e(t),c=N6e(o),u=n?n(c):E6e(c);return O6e({circular:r,comparator:c,createState:i,equals:u,strict:a})}function A6e(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function mF(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(s){r<0&&(r=s),s-r>e?(t(s),r=-1):A6e(i)};requestAnimationFrame(n)}function BT(t){"@babel/helpers - typeof";return BT=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},BT(t)}function P6e(t){return L6e(t)||I6e(t)||R6e(t)||M6e()}
vendor: 75,073 bytes, lines 859-880
859function M6e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
860In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R6e(t,e){if(t){if(typeof t=="string")return gF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gF(t,e)}}function gF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function I6e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function L6e(t){if(Array.isArray(t))return t}function $6e(){var t={},e=function(){return null},r=!1,n=function i(s){if(!r){if(Array.isArray(s)){if(!s.length)return;var a=s,o=P6e(a),c=o[0],u=o.slice(1);if(typeof c=="number"){mF(i.bind(null,u),c);return}i(c),mF(i.bind(null,u));return}BT(s)==="object"&&(t=s,e(t)),typeof s=="function"&&s()}};return{stop:function(){r=!0},start:function(s){r=!1,n(s)},subscribe:function(s){return e=s,function(){e=function(){return null}}}}}function qv(t){"@babel/helpers - typeof";return qv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qv(t)}function vF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function yF(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?vF(Object(r),!0).forEach(function(n){ZY(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ZY(t,e,r){return e=D6e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function D6e(t){var e=B6e(t,"string");return qv(e)==="symbol"?e:String(e)}function B6e(t,e){if(qv(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(qv(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var F6e=function(e,r){return[Object.keys(e),Object.keys(r)].reduce(function(n,i){return n.filter(function(s){return i.includes(s)})})},z6e=function(e){return e},U6e=function(e){return e.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},wg=function(e,r){return Object.keys(r).reduce(function(n,i){return yF(yF({},n),{},ZY({},i,e(i,r[i])))},{})},xF=function(e,r,n){return e.map(function(i){return"".concat(U6e(i)," ").concat(r,"ms ").concat(n)}).join(",")};function H6e(t,e){return q6e(t)||W6e(t,e)||JY(t,e)||V6e()}function V6e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
861In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W6e(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function q6e(t){if(Array.isArray(t))return t}function K6e(t){return J6e(t)||Z6e(t)||JY(t)||G6e()}function G6e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
862In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JY(t,e){if(t){if(typeof t=="string")return FT(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return FT(t,e)}}function Z6e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function J6e(t){if(Array.isArray(t))return FT(t)}function FT(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var w1=1e-4,YY=function(e,r){return[0,3*e,3*r-6*e,3*e-3*r+1]},XY=function(e,r){return e.map(function(n,i){return n*Math.pow(r,i)}).reduce(function(n,i){return n+i})},bF=function(e,r){return function(n){var i=YY(e,r);return XY(i,n)}},Y6e=function(e,r){return function(n){var i=YY(e,r),s=[].concat(K6e(i.map(function(a,o){return a*o}).slice(1)),[0]);return XY(s,n)}},wF=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=r[0],s=r[1],a=r[2],o=r[3];if(r.length===1)switch(r[0]){case"linear":i=0,s=0,a=1,o=1;break;case"ease":i=.25,s=.1,a=.25,o=1;break;case"ease-in":i=.42,s=0,a=1,o=1;break;case"ease-out":i=.42,s=0,a=.58,o=1;break;case"ease-in-out":i=0,s=0,a=.58,o=1;break;default:{var c=r[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(w){return parseFloat(w)}),d=H6e(u,4);i=d[0],s=d[1],a=d[2],o=d[3]}}}var f=bF(i,a),p=bF(s,o),m=Y6e(i,a),y=function(b){return b>1?1:b<0?0:b},v=function(b){for(var _=b>1?1:b,S=_,N=0;N<8;++N){var j=f(S)-_,C=m(S);if(Math.abs(j-_)<w1||C<w1)return p(S);S=y(S-j/C)}return p(S)};return v.isStepper=!1,v},X6e=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.stiff,n=r===void 0?100:r,i=e.damping,s=i===void 0?8:i,a=e.dt,o=a===void 0?17:a,c=function(d,f,p){var m=-(d-f)*n,y=p*s,v=p+(m-y)*o/1e3,w=p*o/1e3+d;return Math.abs(w-f)<w1&&Math.abs(v)<w1?[f,0]:[w,v]};return c.isStepper=!0,c.dt=o,c},Q6e=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=r[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return wF(i);case"spring":return X6e();default:if(i.split("(")[0]==="cubic-bezier")return wF(i)}return typeof i=="function"?i:null};function Kv(t){"@babel/helpers - typeof";return Kv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kv(t)}function _F(t){return rUe(t)||tUe(t)||QY(t)||eUe()}function eUe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
863In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tUe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function rUe(t){if(Array.isArray(t))return UT(t)}function kF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function kn(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?kF(Object(r),!0).forEach(function(n){zT(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function zT(t,e,r){return e=nUe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function nUe(t){var e=iUe(t,"string");return Kv(e)==="symbol"?e:String(e)}function iUe(t,e){if(Kv(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Kv(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function sUe(t,e){return lUe(t)||oUe(t,e)||QY(t,e)||aUe()}function aUe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
864In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QY(t,e){if(t){if(typeof t=="string")return UT(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return UT(t,e)}}function UT(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function oUe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function lUe(t){if(Array.isArray(t))return t}var _1=function(e,r,n){return e+(r-e)*n},HT=function(e){var r=e.from,n=e.to;return r!==n},cUe=function t(e,r,n){var i=wg(function(s,a){if(HT(a)){var o=e(a.from,a.to,a.velocity),c=sUe(o,2),u=c[0],d=c[1];return kn(kn({},a),{},{from:u,velocity:d})}return a},r);return n<1?wg(function(s,a){return HT(a)?kn(kn({},a),{},{velocity:_1(a.velocity,i[s].velocity,n),from:_1(a.from,i[s].from,n)}):a},r):t(e,i,n-1)};const uUe=function(t,e,r,n,i){var s=F6e(t,e),a=s.reduce(function(w,b){return kn(kn({},w),{},zT({},b,[t[b],e[b]]))},{}),o=s.reduce(function(w,b){return kn(kn({},w),{},zT({},b,{from:t[b],velocity:0,to:e[b]}))},{}),c=-1,u,d,f=function(){return null},p=function(){return wg(function(b,_){return _.from},o)},m=function(){return!Object.values(o).filter(HT).length},y=function(b){u||(u=b);var _=b-u,S=_/r.dt;o=cUe(r,o,S),i(kn(kn(kn({},t),e),p())),u=b,m()||(c=requestAnimationFrame(f))},v=function(b){d||(d=b);var _=(b-d)/n,S=wg(function(j,C){return _1.apply(void 0,_F(C).concat([r(_)]))},a);if(i(kn(kn(kn({},t),e),S)),_<1)c=requestAnimationFrame(f);else{var N=wg(function(j,C){return _1.apply(void 0,_F(C).concat([r(1)]))},a);i(kn(kn(kn({},t),e),N))}};return f=r.isStepper?y:v,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};function Gh(t){"@babel/helpers - typeof";return Gh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gh(t)}var dUe=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function fUe(t,e){if(t==null)return{};var r=hUe(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function hUe(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s<n.length;s++)i=n[s],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function JN(t){return vUe(t)||gUe(t)||mUe(t)||pUe()}function pUe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
865In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mUe(t,e){if(t){if(typeof t=="string")return VT(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return VT(t,e)}}function gUe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function vUe(t){if(Array.isArray(t))return VT(t)}function VT(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function SF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Gs(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?SF(Object(r),!0).forEach(function(n){qm(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):SF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function qm(t,e,r){return e=eX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yUe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xUe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,eX(n.key),n)}}function bUe(t,e,r){return e&&xUe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function eX(t){var e=wUe(t,"string");return Gh(e)==="symbol"?e:String(e)}function wUe(t,e){if(Gh(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Gh(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function _Ue(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&WT(t,e)}function WT(t,e){return WT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},WT(t,e)}function kUe(t){var e=SUe();return function(){var n=k1(t),i;if(e){var s=k1(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return qT(this,i)}}function qT(t,e){if(e&&(Gh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return KT(t)}function KT(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function SUe(){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 k1(t){return k1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},k1(t)}var Jo=function(t){_Ue(r,t);var e=kUe(r);function r(n,i){var s;yUe(this,r),s=e.call(this,n,i);var a=s.props,o=a.isActive,c=a.attributeName,u=a.from,d=a.to,f=a.steps,p=a.children,m=a.duration;if(s.handleStyleChange=s.handleStyleChange.bind(KT(s)),s.changeStyle=s.changeStyle.bind(KT(s)),!o||m<=0)return s.state={style:{}},typeof p=="function"&&(s.state={style:d}),qT(s);if(f&&f.length)s.state={style:f[0].style};else if(u){if(typeof p=="function")return s.state={style:u},qT(s);s.state={style:c?qm({},c,u):u}}else s.state={style:{}};return s}return bUe(r,[{key:"componentDidMount",value:function(){var i=this.props,s=i.isActive,a=i.canBegin;this.mounted=!0,!(!s||!a)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var s=this.props,a=s.isActive,o=s.canBegin,c=s.attributeName,u=s.shouldReAnimate,d=s.to,f=s.from,p=this.state.style;if(o){if(!a){var m={style:c?qm({},c,d):d};this.state&&p&&(c&&p[c]!==d||!c&&p!==d)&&this.setState(m);return}if(!(T6e(i.to,d)&&i.canBegin&&i.isActive)){var y=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var v=y||u?f:i.to;if(this.state&&p){var w={style:c?qm({},c,v):v};(c&&p[c]!==v||!c&&p!==v)&&this.setState(w)}this.runAnimation(Gs(Gs({},this.props),{},{from:v,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var s=this,a=i.from,o=i.to,c=i.duration,u=i.easing,d=i.begin,f=i.onAnimationEnd,p=i.onAnimationStart,m=uUe(a,o,Q6e(u),c,this.changeStyle),y=function(){s.stopJSAnimation=m()};this.manager.start([p,d,y,c,f])}},{key:"runStepAnimation",value:function(i){var s=this,a=i.steps,o=i.begin,c=i.onAnimationStart,u=a[0],d=u.style,f=u.duration,p=f===void 0?0:f,m=function(v,w,b){if(b===0)return v;var _=w.duration,S=w.easing,N=S===void 0?"ease":S,j=w.style,C=w.properties,O=w.onAnimationEnd,P=b>0?a[b-1]:w,T=C||Object.keys(j);if(typeof N=="function"||N==="spring")return[].concat(JN(v),[s.runJSAnimation.bind(s,{from:P.style,to:j,duration:_,easing:N}),_]);var $=xF(T,_,N),B=Gs(Gs(Gs({},P.style),j),{},{transition:$});return[].concat(JN(v),[B,_,O]).filter(z6e)};return this.manager.start([c].concat(JN(a.reduce(m,[d,Math.max(p,o)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=$6e());var s=i.begin,a=i.duration,o=i.attributeName,c=i.to,u=i.easing,d=i.onAnimationStart,f=i.onAnimationEnd,p=i.steps,m=i.children,y=this.manager;if(this.unSubscribe=y.subscribe(this.handleStyleChange),typeof u=="function"||typeof m=="function"||u==="spring"){this.runJSAnimation(i);return}if(p.length>1){this.runStepAnimation(i);return}var v=o?qm({},o,c):c,w=xF(Object.keys(v),a,u);y.start([d,s,Gs(Gs({},v),{},{transition:w}),a,f])}},{key:"render",value:function(){var i=this.props,s=i.children;i.begin;var a=i.duration;i.attributeName,i.easing;var o=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=fUe(i,dUe),u=x.Children.count(s),d=this.state.style;if(typeof s=="function")return s(d);if(!o||u===0||a<=0)return s;var f=function(m){var y=m.props,v=y.style,w=v===void 0?{}:v,b=y.className,_=x.cloneElement(m,Gs(Gs({},c),{},{style:Gs(Gs({},w),d),className:b}));return _};return u===1?f(x.Children.only(s)):D.createElement("div",null,x.Children.map(s,function(p){return f(p)}))}}]),r}(x.PureComponent);Jo.displayName="Animate";Jo.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Jo.propTypes={from:Mt.oneOfType([Mt.object,Mt.string]),to:Mt.oneOfType([Mt.object,Mt.string]),attributeName:Mt.string,duration:Mt.number,begin:Mt.number,easing:Mt.oneOfType([Mt.string,Mt.func]),steps:Mt.arrayOf(Mt.shape({duration:Mt.number.isRequired,style:Mt.object.isRequired,easing:Mt.oneOfType([Mt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Mt.func]),properties:Mt.arrayOf("string"),onAnimationEnd:Mt.func})),children:Mt.oneOfType([Mt.node,Mt.func]),isActive:Mt.bool,canBegin:Mt.bool,onAnimationEnd:Mt.func,shouldReAnimate:Mt.bool,onAnimationStart:Mt.func,onAnimationReStart:Mt.func};function Gv(t){"@babel/helpers - typeof";return Gv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gv(t)}function S1(){return S1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},S1.apply(this,arguments)}function jUe(t,e){return OUe(t)||EUe(t,e)||CUe(t,e)||NUe()}function NUe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
866In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CUe(t,e){if(t){if(typeof t=="string")return jF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jF(t,e)}}function jF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function EUe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function OUe(t){if(Array.isArray(t))return t}function NF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function CF(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?NF(Object(r),!0).forEach(function(n){TUe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):NF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function TUe(t,e,r){return e=AUe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function AUe(t){var e=PUe(t,"string");return Gv(e)=="symbol"?e:e+""}function PUe(t,e){if(Gv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Gv(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var EF=function(e,r,n,i,s){var a=Math.min(Math.abs(n)/2,Math.abs(i)/2),o=i>=0?1:-1,c=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,d;if(a>0&&s instanceof Array){for(var f=[0,0,0,0],p=0,m=4;p<m;p++)f[p]=s[p]>a?a:s[p];d="M".concat(e,",").concat(r+o*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(e+c*f[0],",").concat(r)),d+="L ".concat(e+n-c*f[1],",").concat(r),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
867        `).concat(e+n,",").concat(r+o*f[1])),d+="L ".concat(e+n,",").concat(r+i-o*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
868        `).concat(e+n-c*f[2],",").concat(r+i)),d+="L ".concat(e+c*f[3],",").concat(r+i),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
869        `).concat(e,",").concat(r+i-o*f[3])),d+="Z"}else if(a>0&&s===+s&&s>0){var y=Math.min(a,s);d="M ".concat(e,",").concat(r+o*y,`
870            A `).concat(y,",").concat(y,",0,0,").concat(u,",").concat(e+c*y,",").concat(r,`
871            L `).concat(e+n-c*y,",").concat(r,`
872            A `).concat(y,",").concat(y,",0,0,").concat(u,",").concat(e+n,",").concat(r+o*y,`
873            L `).concat(e+n,",").concat(r+i-o*y,`
874            A `).concat(y,",").concat(y,",0,0,").concat(u,",").concat(e+n-c*y,",").concat(r+i,`
875            L `).concat(e+c*y,",").concat(r+i,`
876            A `).concat(y,",").concat(y,",0,0,").concat(u,",").concat(e,",").concat(r+i-o*y," Z")}else d="M ".concat(e,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return d},MUe=function(e,r){if(!e||!r)return!1;var n=e.x,i=e.y,s=r.x,a=r.y,o=r.width,c=r.height;if(Math.abs(o)>0&&Math.abs(c)>0){var u=Math.min(s,s+o),d=Math.max(s,s+o),f=Math.min(a,a+c),p=Math.max(a,a+c);return n>=u&&n<=d&&i>=f&&i<=p}return!1},RUe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},gR=function(e){var r=CF(CF({},RUe),e),n=x.useRef(),i=x.useState(-1),s=jUe(i,2),a=s[0],o=s[1];x.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var N=n.current.getTotalLength();N&&o(N)}catch{}},[]);var c=r.x,u=r.y,d=r.width,f=r.height,p=r.radius,m=r.className,y=r.animationEasing,v=r.animationDuration,w=r.animationBegin,b=r.isAnimationActive,_=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var S=at("recharts-rectangle",m);return _?D.createElement(Jo,{canBegin:a>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:v,animationEasing:y,isActive:_},function(N){var j=N.width,C=N.height,O=N.x,P=N.y;return D.createElement(Jo,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:v,isActive:b,easing:y},D.createElement("path",S1({},Ge(r,!0),{className:S,d:EF(O,P,j,C,p),ref:n})))}):D.createElement("path",S1({},Ge(r,!0),{className:S,d:EF(c,u,d,f,p)}))},IUe=["points","className","baseLinePoints","connectNulls"];function Mf(){return Mf=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Mf.apply(this,arguments)}function LUe(t,e){if(t==null)return{};var r=$Ue(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function $Ue(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function OF(t){return zUe(t)||FUe(t)||BUe(t)||DUe()}function DUe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
877In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BUe(t,e){if(t){if(typeof t=="string")return GT(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return GT(t,e)}}function FUe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function zUe(t){if(Array.isArray(t))return GT(t)}function GT(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var TF=function(e){return e&&e.x===+e.x&&e.y===+e.y},UUe=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return e.forEach(function(n){TF(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),TF(e[0])&&r[r.length-1].push(e[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},_g=function(e,r){var n=UUe(e);r&&(n=[n.reduce(function(s,a){return[].concat(OF(s),OF(a))},[])]);var i=n.map(function(s){return s.reduce(function(a,o,c){return"".concat(a).concat(c===0?"M":"L").concat(o.x,",").concat(o.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},HUe=function(e,r,n){var i=_g(e,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(_g(r.reverse(),n).slice(1))},VUe=function(e){var r=e.points,n=e.className,i=e.baseLinePoints,s=e.connectNulls,a=LUe(e,IUe);if(!r||!r.length)return null;var o=at("recharts-polygon",n);if(i&&i.length){var c=a.stroke&&a.stroke!=="none",u=HUe(r,i,s);return D.createElement("g",{className:o},D.createElement("path",Mf({},Ge(a,!0),{fill:u.slice(-1)==="Z"?a.fill:"none",stroke:"none",d:u})),c?D.createElement("path",Mf({},Ge(a,!0),{fill:"none",d:_g(r,s)})):null,c?D.createElement("path",Mf({},Ge(a,!0),{fill:"none",d:_g(i,s)})):null)}var d=_g(r,s);return D.createElement("path",Mf({},Ge(a,!0),{fill:d.slice(-1)==="Z"?a.fill:"none",className:o,d}))};function ZT(){return ZT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ZT.apply(this,arguments)}var vR=function(e){var r=e.cx,n=e.cy,i=e.r,s=e.className,a=at("recharts-dot",s);return r===+r&&n===+n&&i===+i?x.createElement("circle",ZT({},Ge(e,!1),Ww(e),{className:a,cx:r,cy:n,r:i})):null};function Zv(t){"@babel/helpers - typeof";return Zv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zv(t)}var WUe=["x","y","top","left","width","height","className"];function JT(){return JT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},JT.apply(this,arguments)}function AF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function qUe(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?AF(Object(r),!0).forEach(function(n){KUe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):AF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function KUe(t,e,r){return e=GUe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function GUe(t){var e=ZUe(t,"string");return Zv(e)=="symbol"?e:e+""}function ZUe(t,e){if(Zv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Zv(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function JUe(t,e){if(t==null)return{};var r=YUe(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function YUe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var XUe=function(e,r,n,i,s,a){return"M".concat(e,",").concat(s,"v").concat(i,"M").concat(a,",").concat(r,"h").concat(n)},QUe=function(e){var r=e.x,n=r===void 0?0:r,i=e.y,s=i===void 0?0:i,a=e.top,o=a===void 0?0:a,c=e.left,u=c===void 0?0:c,d=e.width,f=d===void 0?0:d,p=e.height,m=p===void 0?0:p,y=e.className,v=JUe(e,WUe),w=qUe({x:n,y:s,top:o,left:u,width:f,height:m},v);return!xe(n)||!xe(s)||!xe(f)||!xe(m)||!xe(o)||!xe(u)?null:D.createElement("path",JT({},Ge(w,!0),{className:at("recharts-cross",y),d:XUe(n,s,f,m,o,u)}))},eHe=Kk,tHe=fY,rHe=to;function nHe(t,e){return t&&t.length?eHe(t,rHe(e),tHe):void 0}var iHe=nHe;const sHe=St(iHe);var aHe=Kk,oHe=to,lHe=hY;function cHe(t,e){return t&&t.length?aHe(t,oHe(e),lHe):void 0}var uHe=cHe;const dHe=St(uHe);var fHe=["cx","cy","angle","ticks","axisLine"],hHe=["ticks","tick","angle","tickFormatter","stroke"];function Zh(t){"@babel/helpers - typeof";return Zh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zh(t)}function kg(){return kg=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},kg.apply(this,arguments)}function PF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function su(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?PF(Object(r),!0).forEach(function(n){eS(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):PF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function MF(t,e){if(t==null)return{};var r=pHe(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function pHe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function mHe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function RF(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,rX(n.key),n)}}function gHe(t,e,r){return e&&RF(t.prototype,e),r&&RF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function vHe(t,e,r){return e=j1(e),yHe(t,tX()?Reflect.construct(e,r||[],j1(t).constructor):e.apply(t,r))}function yHe(t,e){if(e&&(Zh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xHe(t)}function xHe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function tX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tX=function(){return!!t})()}function j1(t){return j1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},j1(t)}function bHe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&YT(t,e)}function YT(t,e){return YT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},YT(t,e)}function eS(t,e,r){return e=rX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rX(t){var e=wHe(t,"string");return Zh(e)=="symbol"?e:e+""}function wHe(t,e){if(Zh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Zh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var tS=function(t){function e(){return mHe(this,e),vHe(this,e,arguments)}return bHe(e,t),gHe(e,[{key:"getTickValueCoord",value:function(n){var i=n.coordinate,s=this.props,a=s.angle,o=s.cx,c=s.cy;return Xt(o,c,i,a)}},{key:"getTickTextAnchor",value:function(){var n=this.props.orientation,i;switch(n){case"left":i="end";break;case"right":i="start";break;default:i="middle";break}return i}},{key:"getViewBox",value:function(){var n=this.props,i=n.cx,s=n.cy,a=n.angle,o=n.ticks,c=sHe(o,function(d){return d.coordinate||0}),u=dHe(o,function(d){return d.coordinate||0});return{cx:i,cy:s,startAngle:a,endAngle:a,innerRadius:u.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,s=n.cy,a=n.angle,o=n.ticks,c=n.axisLine,u=MF(n,fHe),d=o.reduce(function(y,v){return[Math.min(y[0],v.coordinate),Math.max(y[1],v.coordinate)]},[1/0,-1/0]),f=Xt(i,s,d[0],a),p=Xt(i,s,d[1],a),m=su(su(su({},Ge(u,!1)),{},{fill:"none"},Ge(c,!1)),{},{x1:f.x,y1:f.y,x2:p.x,y2:p.y});return D.createElement("line",kg({className:"recharts-polar-radius-axis-line"},m))}},{key:"renderTicks",value:function(){var n=this,i=this.props,s=i.ticks,a=i.tick,o=i.angle,c=i.tickFormatter,u=i.stroke,d=MF(i,hHe),f=this.getTickTextAnchor(),p=Ge(d,!1),m=Ge(a,!1),y=s.map(function(v,w){var b=n.getTickValueCoord(v),_=su(su(su(su({textAnchor:f,transform:"rotate(".concat(90-o,", ").concat(b.x,", ").concat(b.y,")")},p),{},{stroke:"none",fill:u},m),{},{index:w},b),{},{payload:v});return D.createElement(Rt,kg({className:at("recharts-polar-radius-axis-tick",zY(a)),key:"tick-".concat(v.coordinate)},cd(n.props,v,w)),e.renderTickItem(a,_,c?c(v.value,w):v.value))});return D.createElement(Rt,{className:"recharts-polar-radius-axis-ticks"},y)}},{key:"render",value:function(){var n=this.props,i=n.ticks,s=n.axisLine,a=n.tick;return!i||!i.length?null:D.createElement(Rt,{className:at("recharts-polar-radius-axis",this.props.className)},s&&this.renderAxisLine(),a&&this.renderTicks(),cn.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(n,i,s){var a;return D.isValidElement(n)?a=D.cloneElement(n,i):Je(n)?a=n(i):a=D.createElement(ud,kg({},i,{className:"recharts-polar-radius-axis-tick-value"}),s),a}}])}(x.PureComponent);eS(tS,"displayName","PolarRadiusAxis");eS(tS,"axisType","radiusAxis");eS(tS,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function Jh(t){"@babel/helpers - typeof";return Jh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jh(t)}function gu(){return gu=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},gu.apply(this,arguments)}function IF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function au(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?IF(Object(r),!0).forEach(function(n){rS(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):IF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function _He(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function LF(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,iX(n.key),n)}}function kHe(t,e,r){return e&&LF(t.prototype,e),r&&LF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function SHe(t,e,r){return e=N1(e),jHe(t,nX()?Reflect.construct(e,r||[],N1(t).constructor):e.apply(t,r))}function jHe(t,e){if(e&&(Jh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return NHe(t)}function NHe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nX=function(){return!!t})()}function N1(t){return N1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},N1(t)}function CHe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&XT(t,e)}function XT(t,e){return XT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},XT(t,e)}function rS(t,e,r){return e=iX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function iX(t){var e=EHe(t,"string");return Jh(e)=="symbol"?e:e+""}function EHe(t,e){if(Jh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Jh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var OHe=Math.PI/180,$F=1e-5,nS=function(t){function e(){return _He(this,e),SHe(this,e,arguments)}return CHe(e,t),kHe(e,[{key:"getTickLineCoord",value:function(n){var i=this.props,s=i.cx,a=i.cy,o=i.radius,c=i.orientation,u=i.tickSize,d=u||8,f=Xt(s,a,o,n.coordinate),p=Xt(s,a,o+(c==="inner"?-1:1)*d,n.coordinate);return{x1:f.x,y1:f.y,x2:p.x,y2:p.y}}},{key:"getTickTextAnchor",value:function(n){var i=this.props.orientation,s=Math.cos(-n.coordinate*OHe),a;return s>$F?a=i==="outer"?"start":"end":s<-$F?a=i==="outer"?"end":"start":a="middle",a}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,s=n.cy,a=n.radius,o=n.axisLine,c=n.axisLineType,u=au(au({},Ge(this.props,!1)),{},{fill:"none"},Ge(o,!1));if(c==="circle")return D.createElement(vR,gu({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:s,r:a}));var d=this.props.ticks,f=d.map(function(p){return Xt(i,s,a,p.coordinate)});return D.createElement(VUe,gu({className:"recharts-polar-angle-axis-line"},u,{points:f}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,s=i.ticks,a=i.tick,o=i.tickLine,c=i.tickFormatter,u=i.stroke,d=Ge(this.props,!1),f=Ge(a,!1),p=au(au({},d),{},{fill:"none"},Ge(o,!1)),m=s.map(function(y,v){var w=n.getTickLineCoord(y),b=n.getTickTextAnchor(y),_=au(au(au({textAnchor:b},d),{},{stroke:"none",fill:u},f),{},{index:v,payload:y,x:w.x2,y:w.y2});return D.createElement(Rt,gu({className:at("recharts-polar-angle-axis-tick",zY(a)),key:"tick-".concat(y.coordinate)},cd(n.props,y,v)),o&&D.createElement("line",gu({className:"recharts-polar-angle-axis-tick-line"},p,w)),a&&e.renderTickItem(a,_,c?c(y.value,v):y.value))});return D.createElement(Rt,{className:"recharts-polar-angle-axis-ticks"},m)}},{key:"render",value:function(){var n=this.props,i=n.ticks,s=n.radius,a=n.axisLine;return s<=0||!i||!i.length?null:D.createElement(Rt,{className:at("recharts-polar-angle-axis",this.props.className)},a&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,s){var a;return D.isValidElement(n)?a=D.cloneElement(n,i):Je(n)?a=n(i):a=D.createElement(ud,gu({},i,{className:"recharts-polar-angle-axis-tick-value"}),s),a}}])}(x.PureComponent);rS(nS,"displayName","PolarAngleAxis");rS(nS,"axisType","angleAxis");rS(nS,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var THe=lJ,AHe=THe(Object.getPrototypeOf,Object),PHe=AHe,MHe=rl,RHe=PHe,IHe=nl,LHe="[object Object]",$He=Function.prototype,DHe=Object.prototype,sX=$He.toString,BHe=DHe.hasOwnProperty,FHe=sX.call(Object);function zHe(t){if(!IHe(t)||MHe(t)!=LHe)return!1;var e=RHe(t);if(e===null)return!0;var r=BHe.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&sX.call(r)==FHe}var UHe=zHe;const HHe=St(UHe);var VHe=rl,WHe=nl,qHe="[object Boolean]";function KHe(t){return t===!0||t===!1||WHe(t)&&VHe(t)==qHe}var GHe=KHe;const ZHe=St(GHe);function Jv(t){"@babel/helpers - typeof";return Jv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jv(t)}function C1(){return C1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},C1.apply(this,arguments)}function JHe(t,e){return eVe(t)||QHe(t,e)||XHe(t,e)||YHe()}function YHe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
878In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XHe(t,e){if(t){if(typeof t=="string")return DF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return DF(t,e)}}function DF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function QHe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function eVe(t){if(Array.isArray(t))return t}function BF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function FF(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?BF(Object(r),!0).forEach(function(n){tVe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):BF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function tVe(t,e,r){return e=rVe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rVe(t){var e=nVe(t,"string");return Jv(e)=="symbol"?e:e+""}function nVe(t,e){if(Jv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Jv(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var zF=function(e,r,n,i,s){var a=n-i,o;return o="M ".concat(e,",").concat(r),o+="L ".concat(e+n,",").concat(r),o+="L ".concat(e+n-a/2,",").concat(r+s),o+="L ".concat(e+n-a/2-i,",").concat(r+s),o+="L ".concat(e,",").concat(r," Z"),o},iVe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},sVe=function(e){var r=FF(FF({},iVe),e),n=x.useRef(),i=x.useState(-1),s=JHe(i,2),a=s[0],o=s[1];x.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&o(S)}catch{}},[]);var c=r.x,u=r.y,d=r.upperWidth,f=r.lowerWidth,p=r.height,m=r.className,y=r.animationEasing,v=r.animationDuration,w=r.animationBegin,b=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||p!==+p||d===0&&f===0||p===0)return null;var _=at("recharts-trapezoid",m);return b?D.createElement(Jo,{canBegin:a>0,from:{upperWidth:0,lowerWidth:0,height:p,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:p,x:c,y:u},duration:v,animationEasing:y,isActive:b},function(S){var N=S.upperWidth,j=S.lowerWidth,C=S.height,O=S.x,P=S.y;return D.createElement(Jo,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:v,easing:y},D.createElement("path",C1({},Ge(r,!0),{className:_,d:zF(O,P,N,j,C),ref:n})))}):D.createElement("g",null,D.createElement("path",C1({},Ge(r,!0),{className:_,d:zF(c,u,d,f,p)})))},aVe=["option","shapeType","propTransformer","activeClassName","isActive"];function Yv(t){"@babel/helpers - typeof";return Yv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yv(t)}function oVe(t,e){if(t==null)return{};var r=lVe(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function lVe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function UF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function E1(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?UF(Object(r),!0).forEach(function(n){cVe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):UF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function cVe(t,e,r){return e=uVe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uVe(t){var e=dVe(t,"string");return Yv(e)=="symbol"?e:e+""}function dVe(t,e){if(Yv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Yv(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fVe(t,e){return E1(E1({},e),t)}function hVe(t,e){return t==="symbols"}function HF(t){var e=t.shapeType,r=t.elementProps;switch(e){case"rectangle":return D.createElement(gR,r);case"trapezoid":return D.createElement(sVe,r);case"sector":return D.createElement(VY,r);case"symbols":if(hVe(e))return D.createElement(IM,r);break;default:return null}}function pVe(t){return x.isValidElement(t)?t.props:t}function aX(t){var e=t.option,r=t.shapeType,n=t.propTransformer,i=n===void 0?fVe:n,s=t.activeClassName,a=s===void 0?"recharts-active-shape":s,o=t.isActive,c=oVe(t,aVe),u;if(x.isValidElement(e))u=x.cloneElement(e,E1(E1({},c),pVe(e)));else if(Je(e))u=e(c);else if(HHe(e)&&!ZHe(e)){var d=i(e,c);u=D.createElement(HF,{shapeType:r,elementProps:d})}else{var f=c;u=D.createElement(HF,{shapeType:r,elementProps:f})}return o?D.createElement(Rt,{className:a},u):u}function iS(t,e){return e!=null&&"trapezoids"in t.props}function sS(t,e){return e!=null&&"sectors"in t.props}function Xv(t,e){return e!=null&&"points"in t.props}function mVe(t,e){var r,n,i=t.x===(e==null||(r=e.labelViewBox)===null||r===void 0?void 0:r.x)||t.x===e.x,s=t.y===(e==null||(n=e.labelViewBox)===null||n===void 0?void 0:n.y)||t.y===e.y;return i&&s}function gVe(t,e){var r=t.endAngle===e.endAngle,n=t.startAngle===e.startAngle;return r&&n}function vVe(t,e){var r=t.x===e.x,n=t.y===e.y,i=t.z===e.z;return r&&n&&i}function yVe(t,e){var r;return iS(t,e)?r=mVe:sS(t,e)?r=gVe:Xv(t,e)&&(r=vVe),r}function xVe(t,e){var r;return iS(t,e)?r="trapezoids":sS(t,e)?r="sectors":Xv(t,e)&&(r="points"),r}function bVe(t,e){if(iS(t,e)){var r;return(r=e.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(sS(t,e)){var n;return(n=e.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return Xv(t,e)?e.payload:{}}function wVe(t){var e=t.activeTooltipItem,r=t.graphicalItem,n=t.itemData,i=xVe(r,e),s=bVe(r,e),a=n.filter(function(c,u){var d=Jk(s,c),f=r.props[i].filter(function(y){var v=yVe(r,e);return v(y,e)}),p=r.props[i].indexOf(f[f.length-1]),m=u===p;return d&&m}),o=n.indexOf(a[a.length-1]);return o}var Yb;function Yh(t){"@babel/helpers - typeof";return Yh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yh(t)}function Rf(){return Rf=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Rf.apply(this,arguments)}function VF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Zt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?VF(Object(r),!0).forEach(function(n){bs(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):VF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function _Ve(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function WF(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,lX(n.key),n)}}function kVe(t,e,r){return e&&WF(t.prototype,e),r&&WF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function SVe(t,e,r){return e=O1(e),jVe(t,oX()?Reflect.construct(e,r||[],O1(t).constructor):e.apply(t,r))}function jVe(t,e){if(e&&(Yh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return NVe(t)}function NVe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function oX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oX=function(){return!!t})()}function O1(t){return O1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},O1(t)}function CVe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&QT(t,e)}function QT(t,e){return QT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},QT(t,e)}function bs(t,e,r){return e=lX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lX(t){var e=EVe(t,"string");return Yh(e)=="symbol"?e:e+""}function EVe(t,e){if(Yh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Yh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var sl=function(t){function e(r){var n;return _Ve(this,e),n=SVe(this,e,[r]),bs(n,"pieRef",null),bs(n,"sectorRefs",[]),bs(n,"id",By("recharts-pie-")),bs(n,"handleAnimationEnd",function(){var i=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),Je(i)&&i()}),bs(n,"handleAnimationStart",function(){var i=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),Je(i)&&i()}),n.state={isAnimationFinished:!r.isAnimationActive,prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,sectorToFocus:0},n}return CVe(e,t),kVe(e,[{key:"isActiveIndex",value:function(n){var i=this.props.activeIndex;return Array.isArray(i)?i.indexOf(n)!==-1:n===i}},{key:"hasActiveIndex",value:function(){var n=this.props.activeIndex;return Array.isArray(n)?n.length!==0:n||n===0}},{key:"renderLabels",value:function(n){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var s=this.props,a=s.label,o=s.labelLine,c=s.dataKey,u=s.valueKey,d=Ge(this.props,!1),f=Ge(a,!1),p=Ge(o,!1),m=a&&a.offsetRadius||20,y=n.map(function(v,w){var b=(v.startAngle+v.endAngle)/2,_=Xt(v.cx,v.cy,v.outerRadius+m,b),S=Zt(Zt(Zt(Zt({},d),v),{},{stroke:"none"},f),{},{index:w,textAnchor:e.getTextAnchor(_.x,v.cx)},_),N=Zt(Zt(Zt(Zt({},d),v),{},{fill:"none",stroke:v.fill},p),{},{index:w,points:[Xt(v.cx,v.cy,v.outerRadius,b),_]}),j=c;return vt(c)&&vt(u)?j="value":vt(c)&&(j=u),D.createElement(Rt,{key:"label-".concat(v.startAngle,"-").concat(v.endAngle,"-").concat(v.midAngle,"-").concat(w)},o&&e.renderLabelLineItem(o,N,"line"),e.renderLabelItem(a,S,Un(v,j)))});return D.createElement(Rt,{className:"recharts-pie-labels"},y)}},{key:"renderSectorsStatically",value:function(n){var i=this,s=this.props,a=s.activeShape,o=s.blendStroke,c=s.inactiveShape;return n.map(function(u,d){if((u==null?void 0:u.startAngle)===0&&(u==null?void 0:u.endAngle)===0&&n.length!==1)return null;var f=i.isActiveIndex(d),p=c&&i.hasActiveIndex()?c:null,m=f?a:p,y=Zt(Zt({},u),{},{stroke:o?u.fill:u.stroke,tabIndex:-1});return D.createElement(Rt,Rf({ref:function(w){w&&!i.sectorRefs.includes(w)&&i.sectorRefs.push(w)},tabIndex:-1,className:"recharts-pie-sector"},cd(i.props,u,d),{key:"sector-".concat(u==null?void 0:u.startAngle,"-").concat(u==null?void 0:u.endAngle,"-").concat(u.midAngle,"-").concat(d)}),D.createElement(aX,Rf({option:m,isActive:f,shapeType:"sector"},y)))})}},{key:"renderSectorsWithAnimation",value:function(){var n=this,i=this.props,s=i.sectors,a=i.isAnimationActive,o=i.animationBegin,c=i.animationDuration,u=i.animationEasing,d=i.animationId,f=this.state,p=f.prevSectors,m=f.prevIsAnimationActive;return D.createElement(Jo,{begin:o,duration:c,isActive:a,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(d,"-").concat(m),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(y){var v=y.t,w=[],b=s&&s[0],_=b.startAngle;return s.forEach(function(S,N){var j=p&&p[N],C=N>0?Zi(S,"paddingAngle",0):0;if(j){var O=Nl(j.endAngle-j.startAngle,S.endAngle-S.startAngle),P=Zt(Zt({},S),{},{startAngle:_+C,endAngle:_+O(v)+C});w.push(P),_=P.endAngle}else{var T=S.endAngle,$=S.startAngle,B=Nl(0,T-$),R=B(v),M=Zt(Zt({},S),{},{startAngle:_+C,endAngle:_+R+C});w.push(M),_=M.endAngle}}),D.createElement(Rt,null,n.renderSectorsStatically(w))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(s){if(!s.altKey)switch(s.key){case"ArrowLeft":{var a=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[a].focus(),i.setState({sectorToFocus:a});break}case"ArrowRight":{var o=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,s=n.isAnimationActive,a=this.state.prevSectors;return s&&i&&i.length&&(!a||!Jk(a,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,s=i.hide,a=i.sectors,o=i.className,c=i.label,u=i.cx,d=i.cy,f=i.innerRadius,p=i.outerRadius,m=i.isAnimationActive,y=this.state.isAnimationFinished;if(s||!a||!a.length||!xe(u)||!xe(d)||!xe(f)||!xe(p))return null;var v=at("recharts-pie",o);return D.createElement(Rt,{tabIndex:this.props.rootTabIndex,className:v,ref:function(b){n.pieRef=b}},this.renderSectors(),c&&this.renderLabels(a),cn.renderCallByParent(this.props,null,!1),(!m||y)&&hc.renderCallByParent(this.props,a,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n<i?"end":"middle"}},{key:"renderLabelLineItem",value:function(n,i,s){if(D.isValidElement(n))return D.cloneElement(n,i);if(Je(n))return n(i);var a=at("recharts-pie-label-line",typeof n!="boolean"?n.className:"");return D.createElement(DT,Rf({},i,{key:s,type:"linear",className:a}))}},{key:"renderLabelItem",value:function(n,i,s){if(D.isValidElement(n))return D.cloneElement(n,i);var a=s;if(Je(n)&&(a=n(i),D.isValidElement(a)))return a;var o=at("recharts-pie-label-text",typeof n!="boolean"&&!Je(n)?n.className:"");return D.createElement(ud,Rf({},i,{alignmentBaseline:"middle",className:o}),a)}}])}(x.PureComponent);Yb=sl;bs(sl,"displayName","Pie");bs(sl,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!Ro.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});bs(sl,"parseDeltaAngle",function(t,e){var r=ri(e-t),n=Math.min(Math.abs(e-t),360);return r*n});bs(sl,"getRealPieData",function(t){var e=t.data,r=t.children,n=Ge(t,!1),i=Ts(r,Ev);return e&&e.length?e.map(function(s,a){return Zt(Zt(Zt({payload:s},n),s),i&&i[a]&&i[a].props)}):i&&i.length?i.map(function(s){return Zt(Zt({},n),s.props)}):[]});bs(sl,"parseCoordinateOfPie",function(t,e){var r=e.top,n=e.left,i=e.width,s=e.height,a=FY(i,s),o=n+ni(t.cx,i,i/2),c=r+ni(t.cy,s,s/2),u=ni(t.innerRadius,a,0),d=ni(t.outerRadius,a,a*.8),f=t.maxRadius||Math.sqrt(i*i+s*s)/2;return{cx:o,cy:c,innerRadius:u,outerRadius:d,maxRadius:f}});bs(sl,"getComposedData",function(t){var e=t.item,r=t.offset,n=e.type.defaultProps!==void 0?Zt(Zt({},e.type.defaultProps),e.props):e.props,i=Yb.getRealPieData(n);if(!i||!i.length)return null;var s=n.cornerRadius,a=n.startAngle,o=n.endAngle,c=n.paddingAngle,u=n.dataKey,d=n.nameKey,f=n.valueKey,p=n.tooltipType,m=Math.abs(n.minAngle),y=Yb.parseCoordinateOfPie(n,r),v=Yb.parseDeltaAngle(a,o),w=Math.abs(v),b=u;vt(u)&&vt(f)?(ua(!1,`Use "dataKey" to specify the value of pie,
879      the props "valueKey" will be deprecated in 1.1.0`),b="value"):vt(u)&&(ua(!1,`Use "dataKey" to specify the value of pie,
880      the props "valueKey" will be deprecated in 1.1.0`),b=f);var _=i.filter(function(P){return Un(P,b,0)!==0}).length,S=(w>=360?_:_-1)*c,N=w-_*m-S,j=i.reduce(function(P,T){var $=Un(T,b,0);return P+(xe($)?$:0)},0),C;if(j>0){var O;C=i.map(function(P,T){var $=Un(P,b,0),B=Un(P,d,T),R=(xe($)?$:0)/j,M;T?M=O.endAngle+ri(v)*c*($!==0?1:0):M=a;var F=M+ri(v)*(($!==0?m:0)+R*N),q=(M+F)/2,V=(y.innerRadius+y.outerRadius)/2,W=[{name:B,value:$,payload:P,dataKey:b,type:p}],z=Xt(y.cx,y.cy,V,q);return O=Zt(Zt(Zt({percent:R,cornerRadius:s,name:B,tooltipPayload:W,midAngle:q,middleRadius:V,tooltipPosition:z},P),y),{},{value:Un(P,b),startAngle:M,endAngle:F,payload:P,paddingAngle:ri(v)*c}),O})}return Zt(Zt({},y),{},{sectors:C,data:i})});var OVe=Math.ceil,TVe=Math.max;function AVe(t,e,r,n){for(var i=-1,s=TVe(OVe((e-t)/(r||1)),0),a=Array(s);s--;)a[n?s:++i]=t,t+=r;return a}var PVe=AVe,MVe=CJ,qF=1/0,RVe=17976931348623157e292;function IVe(t){if(!t)return t===0?t:0;if(t=MVe(t),t===qF||t===-qF){var e=t<0?-1:1;return e*RVe}return t===t?t:0}var cX=IVe,LVe=PVe,$Ve=Fk,YN=cX;function DVe(t){return function(e,r,n){return n&&typeof n!="number"&&$Ve(e,r,n)&&(r=n=void 0),e=YN(e),r===void 0?(r=e,e=0):r=YN(r),n=n===void 0?e<r?1:-1:YN(n),LVe(e,r,n,t)}}var BVe=DVe,FVe=BVe,zVe=FVe(),UVe=zVe;const T1=St(UVe);function Qv(t){"@babel/helpers - typeof";return Qv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qv(t)}function KF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function GF(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?KF(Object(r),!0).forEach(function(n){uX(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):KF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function uX(t,e,r){return e=HVe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function HVe(t){var e=VVe(t,"string");return Qv(e)=="symbol"?e:e+""}function VVe(t,e){if(Qv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Qv(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var WVe=["Webkit","Moz","O","ms"],qVe=function(e,r){var n=e.replace(/(\w)/,function(s){return s.toUpperCase()}),i=WVe.reduce(function(s,a){return GF(GF({},s),{},uX({},a+n,r))},{});return i[e]=r,i};function Xh(t){"@babel/helpers - typeof";return Xh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xh(t)}function A1(){return A1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},A1.apply(this,arguments)}function ZF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function XN(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ZF(Object(r),!0).forEach(function(n){Li(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ZF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function KVe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function JF(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,fX(n.key),n)}}function GVe(t,e,r){return e&&JF(t.prototype,e),r&&JF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function ZVe(t,e,r){return e=P1(e),JVe(t,dX()?Reflect.construct(e,r||[],P1(t).constructor):e.apply(t,r))}function JVe(t,e){if(e&&(Xh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return YVe(t)}function YVe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function dX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dX=function(){return!!t})()}function P1(t){return P1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},P1(t)}function XVe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&eA(t,e)}function eA(t,e){return eA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},eA(t,e)}function Li(t,e,r){return e=fX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fX(t){var e=QVe(t,"string");return Xh(e)=="symbol"?e:e+""}function QVe(t,e){if(Xh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Xh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var e9e=function(e){var r=e.data,n=e.startIndex,i=e.endIndex,s=e.x,a=e.width,o=e.travellerWidth;if(!r||!r.length)return{};var c=r.length,u=xg().domain(T1(0,c)).range([s,s+a-o]),d=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(n),endX:u(i),scale:u,scaleValues:d}},YF=function(e){return e.changedTouches&&!!e.changedTouches.length},Qh=function(t){function e(r){var n;return KVe(this,e),n=ZVe(this,e,[r]),Li(n,"handleDrag",function(i){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(i):n.state.isSlideMoving&&n.handleSlideDrag(i)}),Li(n,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&n.handleDrag(i.changedTouches[0])}),Li(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,s=i.endIndex,a=i.onDragEnd,o=i.startIndex;a==null||a({endIndex:s,startIndex:o})}),n.detachDragEndListener()}),Li(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Li(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Li(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Li(n,"handleSlideDragStart",function(i){var s=YF(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:s.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return XVe(e,t),GVe(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,s=n.endX,a=this.state.scaleValues,o=this.props,c=o.gap,u=o.data,d=u.length-1,f=Math.min(i,s),p=Math.max(i,s),m=e.getIndexInRange(a,f),y=e.getIndexInRange(a,p);return{startIndex:m-m%c,endIndex:y===d?d:y-y%c}}},{key:"getTextOfTick",value:function(n){var i=this.props,s=i.data,a=i.tickFormatter,o=i.dataKey,c=Un(s[n],o,n);return Je(a)?a(c,n):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,s=i.slideMoveStartX,a=i.startX,o=i.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,p=c.startIndex,m=c.endIndex,y=c.onChange,v=n.pageX-s;v>0?v=Math.min(v,u+d-f-o,u+d-f-a):v<0&&(v=Math.max(v,u-a,u-o));var w=this.getIndex({startX:a+v,endX:o+v});(w.startIndex!==p||w.endIndex!==m)&&y&&y(w),this.setState({startX:a+v,endX:o+v,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var s=YF(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:s.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,s=i.brushMoveStartX,a=i.movingTravellerId,o=i.endX,c=i.startX,u=this.state[a],d=this.props,f=d.x,p=d.width,m=d.travellerWidth,y=d.onChange,v=d.gap,w=d.data,b={startX:this.state.startX,endX:this.state.endX},_=n.pageX-s;_>0?_=Math.min(_,f+p-m-u):_<0&&(_=Math.max(_,f-u)),b[a]=u+_;var S=this.getIndex(b),N=S.startIndex,j=S.endIndex,C=function(){var P=w.length-1;return a==="startX"&&(o>c?N%v===0:j%v===0)||o<c&&j===P||a==="endX"&&(o>c?j%v===0:N%v===0)||o>c&&j===P};this.setState(Li(Li({},a,u+_),"brushMoveStartX",n.pageX),function(){y&&C()&&y(S)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var s=this,a=this.state,o=a.scaleValues,c=a.startX,u=a.endX,d=this.state[i],f=o.indexOf(d);if(f!==-1){var p=f+n;if(!(p===-1||p>=o.length)){var m=o[p];i==="startX"&&m>=u||i==="endX"&&m<=c||this.setState(Li({},i,m),function(){s.props.onChange(s.getIndex({startX:s.state.startX,endX:s.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,s=n.y,a=n.width,o=n.height,c=n.fill,u=n.stroke;return D.createElement("rect",{stroke:u,fill:c,x:i,y:s,width:a,height:o})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,s=n.y,a=n.width,o=n.height,c=n.data,u=n.children,d=n.padding,f=x.Children.only(u);return f?D.cloneElement(f,{x:i,y:s,width:a,height:o,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,i){var s,a,o=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,p=c.traveller,m=c.ariaLabel,y=c.data,v=c.startIndex,w=c.endIndex,b=Math.max(n,this.props.x),_=XN(XN({},Ge(this.props,!1)),{},{x:b,y:u,width:d,height:f}),S=m||"Min value: ".concat((s=y[v])===null||s===void 0?void 0:s.name,", Max value: ").concat((a=y[w])===null||a===void 0?void 0:a.name);return D.createElement(Rt,{tabIndex:0,role:"slider","aria-label":S,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(j){["ArrowLeft","ArrowRight"].includes(j.key)&&(j.preventDefault(),j.stopPropagation(),o.handleTravellerMoveKeyboard(j.key==="ArrowRight"?1:-1,i))},onFocus:function(){o.setState({isTravellerFocused:!0})},onBlur:function(){o.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(p,_))}},{key:"renderSlide",value:function(n,i){var s=this.props,a=s.y,o=s.height,c=s.stroke,u=s.travellerWidth,d=Math.min(n,i)+u,f=Math.max(Math.abs(i-n)-u,0);return D.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:a,width:f,height:o})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,s=n.endIndex,a=n.y,o=n.height,c=n.travellerWidth,u=n.stroke,d=this.state,f=d.startX,p=d.endX,m=5,y={pointerEvents:"none",fill:u};return D.createElement(Rt,{className:"recharts-brush-texts"},D.createElement(ud,A1({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,p)-m,y:a+o/2},y),this.getTextOfTick(i)),D.createElement(ud,A1({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,p)+c+m,y:a+o/2},y),this.getTextOfTick(s)))}},{key:"render",value:function(){var n=this.props,i=n.data,s=n.className,a=n.children,o=n.x,c=n.y,u=n.width,d=n.height,f=n.alwaysShowText,p=this.state,m=p.startX,y=p.endX,v=p.isTextActive,w=p.isSlideMoving,b=p.isTravellerMoving,_=p.isTravellerFocused;if(!i||!i.length||!xe(o)||!xe(c)||!xe(u)||!xe(d)||u<=0||d<=0)return null;var S=at("recharts-brush",s),N=D.Children.count(a)===1,j=qVe("userSelect","none");return D.createElement(Rt,{className:S,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:j},this.renderBackground(),N&&this.renderPanorama(),this.renderSlide(m,y),this.renderTravellerLayer(m,"startX"),this.renderTravellerLayer(y,"endX"),(v||w||b||_||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,s=n.y,a=n.width,o=n.height,c=n.stroke,u=Math.floor(s+o/2)-1;return D.createElement(D.Fragment,null,D.createElement("rect",{x:i,y:s,width:a,height:o,fill:c,stroke:"none"}),D.createElement("line",{x1:i+1,y1:u,x2:i+a-1,y2:u,fill:"none",stroke:"#fff"}),D.createElement("line",{x1:i+1,y1:u+2,x2:i+a-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var s;return D.isValidElement(n)?s=D.cloneElement(n,i):Je(n)?s=n(i):s=e.renderDefaultTraveller(i),s}},{key:"getDerivedStateFromProps",value:function(n,i){var s=n.data,a=n.width,o=n.x,c=n.travellerWidth,u=n.updateId,d=n.startIndex,f=n.endIndex;if(s!==i.prevData||u!==i.prevUpdateId)return XN({prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:o,prevWidth:a},s&&s.length?e9e({data:s,width:a,x:o,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(a!==i.prevWidth||o!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([o,o+a-c]);var p=i.scale.domain().map(function(m){return i.scale(m)});return{prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:o,prevWidth:a,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:p}}return null}},{key:"getIndexInRange",value:function(n,i){for(var s=n.length,a=0,o=s-1;o-a>1;){var c=Math.floor((a+o)/2);n[c]>i?o=c:a=c}return i>=n[o]?o:a}}])}
880(x.PureComponent);Li(Qh,"displayName","Brush");Li(Qh,"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 t9e=UM;function r9e(t,e){var r;return t9e(t,function(n,i,s){return r=e(n,i,s),!r}),!!r}var n9e=r9e,i9e=eJ,s9e=to,a9e=n9e,o9e=Mi,l9e=Fk;function c9e(t,e,r){var n=o9e(t)?i9e:a9e;return r&&l9e(t,e,r)&&(e=void 0),n(t,s9e(e))}var u9e=c9e;const d9e=St(u9e);var Wa=function(e,r){var n=e.alwaysShow,i=e.ifOverflow;return n&&(i="extendDomain"),i===r},XF=_J;function f9e(t,e,r){e=="__proto__"&&XF?XF(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var h9e=f9e,p9e=h9e,m9e=bJ,g9e=to;function v9e(t,e){var r={};return e=g9e(e),m9e(t,function(n,i,s){p9e(r,i,e(n,i,s))}),r}var y9e=v9e;const x9e=St(y9e);function b9e(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}var w9e=b9e,_9e=UM;function k9e(t,e){var r=!0;return _9e(t,function(n,i,s){return r=!!e(n,i,s),r}),r}var S9e=k9e,j9e=w9e,N9e=S9e,C9e=to,E9e=Mi,O9e=Fk;function T9e(t,e,r){var n=E9e(t)?j9e:N9e;return r&&O9e(t,e,r)&&(e=void 0),n(t,C9e(e))}var A9e=T9e;const hX=St(A9e);var P9e=["x","y"];function ey(t){"@babel/helpers - typeof";return ey=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ey(t)}function tA(){return tA=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},tA.apply(this,arguments)}function QF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Tm(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?QF(Object(r),!0).forEach(function(n){M9e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):QF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function M9e(t,e,r){return e=R9e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function R9e(t){var e=I9e(t,"string");return ey(e)=="symbol"?e:e+""}function I9e(t,e){if(ey(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ey(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function L9e(t,e){if(t==null)return{};var r=$9e(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function $9e(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function D9e(t,e){var r=t.x,n=t.y,i=L9e(t,P9e),s="".concat(r),a=parseInt(s,10),o="".concat(n),c=parseInt(o,10),u="".concat(e.height||i.height),d=parseInt(u,10),f="".concat(e.width||i.width),p=parseInt(f,10);return Tm(Tm(Tm(Tm(Tm({},e),i),a?{x:a}:{}),c?{y:c}:{}),{},{height:d,width:p,name:e.name,radius:e.radius})}function ez(t){return D.createElement(aX,tA({shapeType:"rectangle",propTransformer:D9e,activeClassName:"recharts-active-bar"},t))}var B9e=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof e=="number")return e;var s=xe(n)||dTe(n);return s?e(n,i):(s||fd(),r)}},F9e=["value","background"],pX;function ep(t){"@babel/helpers - typeof";return ep=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ep(t)}function z9e(t,e){if(t==null)return{};var r=U9e(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function U9e(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function M1(){return M1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];
vendor: 95,873 bytes, lines 880-884
880for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},M1.apply(this,arguments)}function tz(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Dr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?tz(Object(r),!0).forEach(function(n){Zl(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tz(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function H9e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rz(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,gX(n.key),n)}}function V9e(t,e,r){return e&&rz(t.prototype,e),r&&rz(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function W9e(t,e,r){return e=R1(e),q9e(t,mX()?Reflect.construct(e,r||[],R1(t).constructor):e.apply(t,r))}function q9e(t,e){if(e&&(ep(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return K9e(t)}function K9e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(mX=function(){return!!t})()}function R1(t){return R1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},R1(t)}function G9e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&rA(t,e)}function rA(t,e){return rA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},rA(t,e)}function Zl(t,e,r){return e=gX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gX(t){var e=Z9e(t,"string");return ep(e)=="symbol"?e:e+""}function Z9e(t,e){if(ep(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ep(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ed=function(t){function e(){var r;H9e(this,e);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=W9e(this,e,[].concat(i)),Zl(r,"state",{isAnimationFinished:!1}),Zl(r,"id",By("recharts-bar-")),Zl(r,"handleAnimationEnd",function(){var a=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),a&&a()}),Zl(r,"handleAnimationStart",function(){var a=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),a&&a()}),r}return G9e(e,t),V9e(e,[{key:"renderRectanglesStatically",value:function(n){var i=this,s=this.props,a=s.shape,o=s.dataKey,c=s.activeIndex,u=s.activeBar,d=Ge(this.props,!1);return n&&n.map(function(f,p){var m=p===c,y=m?u:a,v=Dr(Dr(Dr({},d),f),{},{isActive:m,option:y,index:p,dataKey:o,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return D.createElement(Rt,M1({className:"recharts-bar-rectangle"},cd(i.props,f,p),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(p)}),D.createElement(ez,v))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,i=this.props,s=i.data,a=i.layout,o=i.isAnimationActive,c=i.animationBegin,u=i.animationDuration,d=i.animationEasing,f=i.animationId,p=this.state.prevData;return D.createElement(Jo,{begin:c,duration:u,isActive:o,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(m){var y=m.t,v=s.map(function(w,b){var _=p&&p[b];if(_){var S=Nl(_.x,w.x),N=Nl(_.y,w.y),j=Nl(_.width,w.width),C=Nl(_.height,w.height);return Dr(Dr({},w),{},{x:S(y),y:N(y),width:j(y),height:C(y)})}if(a==="horizontal"){var O=Nl(0,w.height),P=O(y);return Dr(Dr({},w),{},{y:w.y+w.height-P,height:P})}var T=Nl(0,w.width),$=T(y);return Dr(Dr({},w),{},{width:$})});return D.createElement(Rt,null,n.renderRectanglesStatically(v))})}},{key:"renderRectangles",value:function(){var n=this.props,i=n.data,s=n.isAnimationActive,a=this.state.prevData;return s&&i&&i.length&&(!a||!Jk(a,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var n=this,i=this.props,s=i.data,a=i.dataKey,o=i.activeIndex,c=Ge(this.props.background,!1);return s.map(function(u,d){u.value;var f=u.background,p=z9e(u,F9e);if(!f)return null;var m=Dr(Dr(Dr(Dr(Dr({},p),{},{fill:"#eee"},f),c),cd(n.props,u,d)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:a,index:d,className:"recharts-bar-background-rectangle"});return D.createElement(ez,M1({key:"background-bar-".concat(d),option:n.props.background,isActive:d===o},m))})}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,a=s.data,o=s.xAxis,c=s.yAxis,u=s.layout,d=s.children,f=Ts(d,Qk);if(!f)return null;var p=u==="vertical"?a[0].height/2:a[0].width/2,m=function(w,b){var _=Array.isArray(w.value)?w.value[1]:w.value;return{x:w.x,y:w.y,value:_,errorVal:Un(w,b)}},y={clipPath:n?"url(#clipPath-".concat(i,")"):null};return D.createElement(Rt,y,f.map(function(v){return D.cloneElement(v,{key:"error-bar-".concat(i,"-").concat(v.props.dataKey),data:a,xAxis:o,yAxis:c,layout:u,offset:p,dataPointFormatter:m})}))}},{key:"render",value:function(){var n=this.props,i=n.hide,s=n.data,a=n.className,o=n.xAxis,c=n.yAxis,u=n.left,d=n.top,f=n.width,p=n.height,m=n.isAnimationActive,y=n.background,v=n.id;if(i||!s||!s.length)return null;var w=this.state.isAnimationFinished,b=at("recharts-bar",a),_=o&&o.allowDataOverflow,S=c&&c.allowDataOverflow,N=_||S,j=vt(v)?this.id:v;return D.createElement(Rt,{className:b},_||S?D.createElement("defs",null,D.createElement("clipPath",{id:"clipPath-".concat(j)},D.createElement("rect",{x:_?u:u-f/2,y:S?d:d-p/2,width:_?f:f*2,height:S?p:p*2}))):null,D.createElement(Rt,{className:"recharts-bar-rectangles",clipPath:N?"url(#clipPath-".concat(j,")"):null},y?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(N,j),(!m||w)&&hc.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:i.curData}:n.data!==i.curData?{curData:n.data}:null}}])}(x.PureComponent);pX=Ed;Zl(Ed,"displayName","Bar");Zl(Ed,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Ro.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Zl(Ed,"getComposedData",function(t){var e=t.props,r=t.item,n=t.barPosition,i=t.bandSize,s=t.xAxis,a=t.yAxis,o=t.xAxisTicks,c=t.yAxisTicks,u=t.stackedData,d=t.dataStartIndex,f=t.displayedData,p=t.offset,m=Oze(n,r);if(!m)return null;var y=e.layout,v=r.type.defaultProps,w=v!==void 0?Dr(Dr({},v),r.props):r.props,b=w.dataKey,_=w.children,S=w.minPointSize,N=y==="horizontal"?a:s,j=u?N.scale.domain():null,C=Lze({numericAxis:N}),O=Ts(_,Ev),P=f.map(function(T,$){var B,R,M,F,q,V;u?B=Tze(u[d+$],j):(B=Un(T,b),Array.isArray(B)||(B=[C,B]));var W=B9e(S,pX.defaultProps.minPointSize)(B[1],$);if(y==="horizontal"){var z,H=[a.scale(B[0]),a.scale(B[1])],G=H[0],Y=H[1];R=WB({axis:s,ticks:o,bandSize:i,offset:m.offset,entry:T,index:$}),M=(z=Y??G)!==null&&z!==void 0?z:void 0,F=m.size;var U=G-Y;if(q=Number.isNaN(U)?0:U,V={x:R,y:a.y,width:F,height:a.height},Math.abs(W)>0&&Math.abs(q)<Math.abs(W)){var J=ri(q||W)*(Math.abs(W)-Math.abs(q));M-=J,q+=J}}else{var te=[s.scale(B[0]),s.scale(B[1])],re=te[0],ae=te[1];if(R=re,M=WB({axis:a,ticks:c,bandSize:i,offset:m.offset,entry:T,index:$}),F=ae-re,q=m.size,V={x:s.x,y:M,width:s.width,height:q},Math.abs(W)>0&&Math.abs(F)<Math.abs(W)){var oe=ri(F||W)*(Math.abs(W)-Math.abs(F));F+=oe}}return Dr(Dr(Dr({},T),{},{x:R,y:M,width:F,height:q,value:u?B:B[1],payload:T,background:V},O&&O[$]&&O[$].props),{},{tooltipPayload:[DY(r,T)],tooltipPosition:{x:R+F/2,y:M+q/2}})});return Dr({data:P,layout:y},p)});function ty(t){"@babel/helpers - typeof";return ty=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ty(t)}function J9e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nz(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,vX(n.key),n)}}function Y9e(t,e,r){return e&&nz(t.prototype,e),r&&nz(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function iz(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function na(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?iz(Object(r),!0).forEach(function(n){aS(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):iz(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function aS(t,e,r){return e=vX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vX(t){var e=X9e(t,"string");return ty(e)=="symbol"?e:e+""}function X9e(t,e){if(ty(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ty(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Q9e=function(e,r,n,i,s){var a=e.width,o=e.height,c=e.layout,u=e.children,d=Object.keys(r),f={left:n.left,leftMirror:n.left,right:a-n.right,rightMirror:a-n.right,top:n.top,topMirror:n.top,bottom:o-n.bottom,bottomMirror:o-n.bottom},p=!!Di(u,Ed);return d.reduce(function(m,y){var v=r[y],w=v.orientation,b=v.domain,_=v.padding,S=_===void 0?{}:_,N=v.mirror,j=v.reversed,C="".concat(w).concat(N?"Mirror":""),O,P,T,$,B;if(v.type==="number"&&(v.padding==="gap"||v.padding==="no-gap")){var R=b[1]-b[0],M=1/0,F=v.categoricalDomain.sort(pTe);if(F.forEach(function(te,re){re>0&&(M=Math.min((te||0)-(F[re-1]||0),M))}),Number.isFinite(M)){var q=M/R,V=v.layout==="vertical"?n.height:n.width;if(v.padding==="gap"&&(O=q*V/2),v.padding==="no-gap"){var W=ni(e.barCategoryGap,q*V),z=q*V/2;O=z-W-(z-W)/V*W}}}i==="xAxis"?P=[n.left+(S.left||0)+(O||0),n.left+n.width-(S.right||0)-(O||0)]:i==="yAxis"?P=c==="horizontal"?[n.top+n.height-(S.bottom||0),n.top+(S.top||0)]:[n.top+(S.top||0)+(O||0),n.top+n.height-(S.bottom||0)-(O||0)]:P=v.range,j&&(P=[P[1],P[0]]);var H=RY(v,s,p),G=H.scale,Y=H.realScaleType;G.domain(b).range(P),IY(G);var U=LY(G,na(na({},v),{},{realScaleType:Y}));i==="xAxis"?(B=w==="top"&&!N||w==="bottom"&&N,T=n.left,$=f[C]-B*v.height):i==="yAxis"&&(B=w==="left"&&!N||w==="right"&&N,T=f[C]-B*v.width,$=n.top);var J=na(na(na({},v),U),{},{realScaleType:Y,x:T,y:$,scale:G,width:i==="xAxis"?n.width:v.width,height:i==="yAxis"?n.height:v.height});return J.bandSize=y1(J,U),!v.hide&&i==="xAxis"?f[C]+=(B?-1:1)*J.height:v.hide||(f[C]+=(B?-1:1)*J.width),na(na({},m),{},aS({},y,J))},{})},yX=function(e,r){var n=e.x,i=e.y,s=r.x,a=r.y;return{x:Math.min(n,s),y:Math.min(i,a),width:Math.abs(s-n),height:Math.abs(a-i)}},eWe=function(e){var r=e.x1,n=e.y1,i=e.x2,s=e.y2;return yX({x:r,y:n},{x:i,y:s})},xX=function(){function t(e){J9e(this,t),this.scale=e}return Y9e(t,[{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(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,s=n.position;if(r!==void 0){if(s)switch(s){case"start":return this.scale(r);case"middle":{var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+a}case"end":{var o=this.bandwidth?this.bandwidth():0;return this.scale(r)+o}default:return this.scale(r)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],s=n[n.length-1];return i<=s?r>=i&&r<=s:r>=s&&r<=i}}],[{key:"create",value:function(r){return new t(r)}}])}();aS(xX,"EPS",1e-4);var yR=function(e){var r=Object.keys(e).reduce(function(n,i){return na(na({},n),{},aS({},i,xX.create(e[i])))},{});return na(na({},r),{},{apply:function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=s.bandAware,o=s.position;return x9e(i,function(c,u){return r[u].apply(c,{bandAware:a,position:o})})},isInRange:function(i){return hX(i,function(s,a){return r[a].isInRange(s)})}})};function tWe(t){return(t%180+180)%180}var rWe=function(e){var r=e.width,n=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=tWe(i),a=s*Math.PI/180,o=Math.atan(n/r),c=a>o&&a<Math.PI-o?n/Math.sin(a):r/Math.cos(a);return Math.abs(c)},nWe=to,iWe=Fy,sWe=Dk;function aWe(t){return function(e,r,n){var i=Object(e);if(!iWe(e)){var s=nWe(r);e=sWe(e),r=function(o){return s(i[o],o,i)}}var a=t(e,r,n);return a>-1?i[s?e[a]:a]:void 0}}var oWe=aWe,lWe=cX;function cWe(t){var e=lWe(t),r=e%1;return e===e?r?e-r:e:0}var uWe=cWe,dWe=pJ,fWe=to,hWe=uWe,pWe=Math.max;function mWe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:hWe(r);return i<0&&(i=pWe(n+i,0)),dWe(t,fWe(e),i)}var gWe=mWe,vWe=oWe,yWe=gWe,xWe=vWe(yWe),bWe=xWe;const wWe=St(bWe);var _We=mOe(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),xR=x.createContext(void 0),bR=x.createContext(void 0),bX=x.createContext(void 0),wX=x.createContext({}),_X=x.createContext(void 0),kX=x.createContext(0),SX=x.createContext(0),sz=function(e){var r=e.state,n=r.xAxisMap,i=r.yAxisMap,s=r.offset,a=e.clipPathId,o=e.children,c=e.width,u=e.height,d=_We(s);return D.createElement(xR.Provider,{value:n},D.createElement(bR.Provider,{value:i},D.createElement(wX.Provider,{value:s},D.createElement(bX.Provider,{value:d},D.createElement(_X.Provider,{value:a},D.createElement(kX.Provider,{value:u},D.createElement(SX.Provider,{value:c},o)))))))},kWe=function(){return x.useContext(_X)},jX=function(e){var r=x.useContext(xR);r==null&&fd();var n=r[e];return n==null&&fd(),n},SWe=function(){var e=x.useContext(xR);return Ll(e)},jWe=function(){var e=x.useContext(bR),r=wWe(e,function(n){return hX(n.domain,Number.isFinite)});return r||Ll(e)},NX=function(e){var r=x.useContext(bR);r==null&&fd();var n=r[e];return n==null&&fd(),n},NWe=function(){var e=x.useContext(bX);return e},CWe=function(){return x.useContext(wX)},wR=function(){return x.useContext(SX)},_R=function(){return x.useContext(kX)};function tp(t){"@babel/helpers - typeof";return tp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tp(t)}function EWe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function OWe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,EX(n.key),n)}}function TWe(t,e,r){return e&&OWe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function AWe(t,e,r){return e=I1(e),PWe(t,CX()?Reflect.construct(e,r||[],I1(t).constructor):e.apply(t,r))}function PWe(t,e){if(e&&(tp(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return MWe(t)}function MWe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function CX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(CX=function(){return!!t})()}function I1(t){return I1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},I1(t)}function RWe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&nA(t,e)}function nA(t,e){return nA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},nA(t,e)}function az(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function oz(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?az(Object(r),!0).forEach(function(n){kR(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):az(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function kR(t,e,r){return e=EX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function EX(t){var e=IWe(t,"string");return tp(e)=="symbol"?e:e+""}function IWe(t,e){if(tp(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(tp(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function LWe(t,e){return FWe(t)||BWe(t,e)||DWe(t,e)||$We()}function $We(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
881In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DWe(t,e){if(t){if(typeof t=="string")return lz(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lz(t,e)}}function lz(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function BWe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function FWe(t){if(Array.isArray(t))return t}function iA(){return iA=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},iA.apply(this,arguments)}var zWe=function(e,r){var n;return D.isValidElement(e)?n=D.cloneElement(e,r):Je(e)?n=e(r):n=D.createElement("line",iA({},r,{className:"recharts-reference-line-line"})),n},UWe=function(e,r,n,i,s,a,o,c,u){var d=s.x,f=s.y,p=s.width,m=s.height;if(n){var y=u.y,v=e.y.apply(y,{position:a});if(Wa(u,"discard")&&!e.y.isInRange(v))return null;var w=[{x:d+p,y:v},{x:d,y:v}];return c==="left"?w.reverse():w}if(r){var b=u.x,_=e.x.apply(b,{position:a});if(Wa(u,"discard")&&!e.x.isInRange(_))return null;var S=[{x:_,y:f+m},{x:_,y:f}];return o==="top"?S.reverse():S}if(i){var N=u.segment,j=N.map(function(C){return e.apply(C,{position:a})});return Wa(u,"discard")&&d9e(j,function(C){return!e.isInRange(C)})?null:j}return null};function HWe(t){var e=t.x,r=t.y,n=t.segment,i=t.xAxisId,s=t.yAxisId,a=t.shape,o=t.className,c=t.alwaysShow,u=kWe(),d=jX(i),f=NX(s),p=NWe();if(!u||!p)return null;ua(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var m=yR({x:d.scale,y:f.scale}),y=en(e),v=en(r),w=n&&n.length===2,b=UWe(m,y,v,w,p,t.position,d.orientation,f.orientation,t);if(!b)return null;var _=LWe(b,2),S=_[0],N=S.x,j=S.y,C=_[1],O=C.x,P=C.y,T=Wa(t,"hidden")?"url(#".concat(u,")"):void 0,$=oz(oz({clipPath:T},Ge(t,!0)),{},{x1:N,y1:j,x2:O,y2:P});return D.createElement(Rt,{className:at("recharts-reference-line",o)},zWe(a,$),cn.renderCallByParent(t,eWe({x1:N,y1:j,x2:O,y2:P})))}var SR=function(t){function e(){return EWe(this,e),AWe(this,e,arguments)}return RWe(e,t),TWe(e,[{key:"render",value:function(){return D.createElement(HWe,this.props)}}])}(D.Component);kR(SR,"displayName","ReferenceLine");kR(SR,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function sA(){return sA=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},sA.apply(this,arguments)}function rp(t){"@babel/helpers - typeof";return rp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rp(t)}function cz(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function uz(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?cz(Object(r),!0).forEach(function(n){oS(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):cz(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function VWe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function WWe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,TX(n.key),n)}}function qWe(t,e,r){return e&&WWe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function KWe(t,e,r){return e=L1(e),GWe(t,OX()?Reflect.construct(e,r||[],L1(t).constructor):e.apply(t,r))}function GWe(t,e){if(e&&(rp(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ZWe(t)}function ZWe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function OX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OX=function(){return!!t})()}function L1(t){return L1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},L1(t)}function JWe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&aA(t,e)}function aA(t,e){return aA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},aA(t,e)}function oS(t,e,r){return e=TX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function TX(t){var e=YWe(t,"string");return rp(e)=="symbol"?e:e+""}function YWe(t,e){if(rp(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(rp(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var XWe=function(e){var r=e.x,n=e.y,i=e.xAxis,s=e.yAxis,a=yR({x:i.scale,y:s.scale}),o=a.apply({x:r,y:n},{bandAware:!0});return Wa(e,"discard")&&!a.isInRange(o)?null:o},lS=function(t){function e(){return VWe(this,e),KWe(this,e,arguments)}return JWe(e,t),qWe(e,[{key:"render",value:function(){var n=this.props,i=n.x,s=n.y,a=n.r,o=n.alwaysShow,c=n.clipPathId,u=en(i),d=en(s);if(ua(o===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=XWe(this.props);if(!f)return null;var p=f.x,m=f.y,y=this.props,v=y.shape,w=y.className,b=Wa(this.props,"hidden")?"url(#".concat(c,")"):void 0,_=uz(uz({clipPath:b},Ge(this.props,!0)),{},{cx:p,cy:m});return D.createElement(Rt,{className:at("recharts-reference-dot",w)},e.renderDot(v,_),cn.renderCallByParent(this.props,{x:p-a,y:m-a,width:2*a,height:2*a}))}}])}(D.Component);oS(lS,"displayName","ReferenceDot");oS(lS,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});oS(lS,"renderDot",function(t,e){var r;return D.isValidElement(t)?r=D.cloneElement(t,e):Je(t)?r=t(e):r=D.createElement(vR,sA({},e,{cx:e.cx,cy:e.cy,className:"recharts-reference-dot-dot"})),r});function oA(){return oA=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},oA.apply(this,arguments)}function np(t){"@babel/helpers - typeof";return np=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},np(t)}function dz(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function fz(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?dz(Object(r),!0).forEach(function(n){cS(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dz(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function QWe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function eqe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,PX(n.key),n)}}function tqe(t,e,r){return e&&eqe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function rqe(t,e,r){return e=$1(e),nqe(t,AX()?Reflect.construct(e,r||[],$1(t).constructor):e.apply(t,r))}function nqe(t,e){if(e&&(np(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return iqe(t)}function iqe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function AX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(AX=function(){return!!t})()}function $1(t){return $1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$1(t)}function sqe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lA(t,e)}function lA(t,e){return lA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},lA(t,e)}function cS(t,e,r){return e=PX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function PX(t){var e=aqe(t,"string");return np(e)=="symbol"?e:e+""}function aqe(t,e){if(np(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(np(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var oqe=function(e,r,n,i,s){var a=s.x1,o=s.x2,c=s.y1,u=s.y2,d=s.xAxis,f=s.yAxis;if(!d||!f)return null;var p=yR({x:d.scale,y:f.scale}),m={x:e?p.x.apply(a,{position:"start"}):p.x.rangeMin,y:n?p.y.apply(c,{position:"start"}):p.y.rangeMin},y={x:r?p.x.apply(o,{position:"end"}):p.x.rangeMax,y:i?p.y.apply(u,{position:"end"}):p.y.rangeMax};return Wa(s,"discard")&&(!p.isInRange(m)||!p.isInRange(y))?null:yX(m,y)},uS=function(t){function e(){return QWe(this,e),rqe(this,e,arguments)}return sqe(e,t),tqe(e,[{key:"render",value:function(){var n=this.props,i=n.x1,s=n.x2,a=n.y1,o=n.y2,c=n.className,u=n.alwaysShow,d=n.clipPathId;ua(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=en(i),p=en(s),m=en(a),y=en(o),v=this.props.shape;if(!f&&!p&&!m&&!y&&!v)return null;var w=oqe(f,p,m,y,this.props);if(!w&&!v)return null;var b=Wa(this.props,"hidden")?"url(#".concat(d,")"):void 0;return D.createElement(Rt,{className:at("recharts-reference-area",c)},e.renderRect(v,fz(fz({clipPath:b},Ge(this.props,!0)),w)),cn.renderCallByParent(this.props,w))}}])}(D.Component);cS(uS,"displayName","ReferenceArea");cS(uS,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});cS(uS,"renderRect",function(t,e){var r;return D.isValidElement(t)?r=D.cloneElement(t,e):Je(t)?r=t(e):r=D.createElement(gR,oA({},e,{className:"recharts-reference-area-rect"})),r});function MX(t,e,r){if(e<1)return[];if(e===1&&r===void 0)return t;for(var n=[],i=0;i<t.length;i+=e)n.push(t[i]);return n}function lqe(t,e,r){var n={width:t.width+e.width,height:t.height+e.height};return rWe(n,r)}function cqe(t,e,r){var n=r==="width",i=t.x,s=t.y,a=t.width,o=t.height;return e===1?{start:n?i:s,end:n?i+a:s+o}:{start:n?i+a:s+o,end:n?i:s}}function D1(t,e,r,n,i){if(t*e<t*n||t*e>t*i)return!1;var s=r();return t*(e-t*s/2-n)>=0&&t*(e+t*s/2-i)<=0}function uqe(t,e){return MX(t,e+1)}function dqe(t,e,r,n,i){for(var s=(n||[]).slice(),a=e.start,o=e.end,c=0,u=1,d=a,f=function(){var y=n==null?void 0:n[c];if(y===void 0)return{v:MX(n,u)};var v=c,w,b=function(){return w===void 0&&(w=r(y,v)),w},_=y.coordinate,S=c===0||D1(t,_,b,d,o);S||(c=0,d=a,u+=1),S&&(d=_+t*(b()/2+i),c+=u)},p;u<=s.length;)if(p=f(),p)return p.v;return[]}function ry(t){"@babel/helpers - typeof";return ry=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ry(t)}function hz(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Bn(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?hz(Object(r),!0).forEach(function(n){fqe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hz(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function fqe(t,e,r){return e=hqe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function hqe(t){var e=pqe(t,"string");return ry(e)=="symbol"?e:e+""}function pqe(t,e){if(ry(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ry(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function mqe(t,e,r,n,i){for(var s=(n||[]).slice(),a=s.length,o=e.start,c=e.end,u=function(p){var m=s[p],y,v=function(){return y===void 0&&(y=r(m,p)),y};if(p===a-1){var w=t*(m.coordinate+t*v()/2-c);s[p]=m=Bn(Bn({},m),{},{tickCoord:w>0?m.coordinate-w*t:m.coordinate})}else s[p]=m=Bn(Bn({},m),{},{tickCoord:m.coordinate});var b=D1(t,m.tickCoord,v,o,c);b&&(c=m.tickCoord-t*(v()/2+i),s[p]=Bn(Bn({},m),{},{isShow:!0}))},d=a-1;d>=0;d--)u(d);return s}function gqe(t,e,r,n,i,s){var a=(n||[]).slice(),o=a.length,c=e.start,u=e.end;if(s){var d=n[o-1],f=r(d,o-1),p=t*(d.coordinate+t*f/2-u);a[o-1]=d=Bn(Bn({},d),{},{tickCoord:p>0?d.coordinate-p*t:d.coordinate});var m=D1(t,d.tickCoord,function(){return f},c,u);m&&(u=d.tickCoord-t*(f/2+i),a[o-1]=Bn(Bn({},d),{},{isShow:!0}))}for(var y=s?o-1:o,v=function(_){var S=a[_],N,j=function(){return N===void 0&&(N=r(S,_)),N};if(_===0){var C=t*(S.coordinate-t*j()/2-c);a[_]=S=Bn(Bn({},S),{},{tickCoord:C<0?S.coordinate-C*t:S.coordinate})}else a[_]=S=Bn(Bn({},S),{},{tickCoord:S.coordinate});var O=D1(t,S.tickCoord,j,c,u);O&&(c=S.tickCoord+t*(j()/2+i),a[_]=Bn(Bn({},S),{},{isShow:!0}))},w=0;w<y;w++)v(w);return a}function jR(t,e,r){var n=t.tick,i=t.ticks,s=t.viewBox,a=t.minTickGap,o=t.orientation,c=t.interval,u=t.tickFormatter,d=t.unit,f=t.angle;if(!i||!i.length||!n)return[];if(xe(c)||Ro.isSsr)return uqe(i,typeof c=="number"&&xe(c)?c:0);var p=[],m=o==="top"||o==="bottom"?"width":"height",y=d&&m==="width"?yg(d,{fontSize:e,letterSpacing:r}):{width:0,height:0},v=function(S,N){var j=Je(u)?u(S.value,N):S.value;return m==="width"?lqe(yg(j,{fontSize:e,letterSpacing:r}),y,f):yg(j,{fontSize:e,letterSpacing:r})[m]},w=i.length>=2?ri(i[1].coordinate-i[0].coordinate):1,b=cqe(s,w,m);return c==="equidistantPreserveStart"?dqe(w,b,v,i,a):(c==="preserveStart"||c==="preserveStartEnd"?p=gqe(w,b,v,i,a,c==="preserveStartEnd"):p=mqe(w,b,v,i,a),p.filter(function(_){return _.isShow}))}var vqe=["viewBox"],yqe=["viewBox"],xqe=["ticks"];function ip(t){"@babel/helpers - typeof";return ip=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ip(t)}function If(){return If=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},If.apply(this,arguments)}function pz(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Gr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?pz(Object(r),!0).forEach(function(n){NR(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pz(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function QN(t,e){if(t==null)return{};var r=bqe(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function bqe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function wqe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mz(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,IX(n.key),n)}}function _qe(t,e,r){return e&&mz(t.prototype,e),r&&mz(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function kqe(t,e,r){return e=B1(e),Sqe(t,RX()?Reflect.construct(e,r||[],B1(t).constructor):e.apply(t,r))}function Sqe(t,e){if(e&&(ip(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jqe(t)}function jqe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function RX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(RX=function(){return!!t})()}function B1(t){return B1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},B1(t)}function Nqe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&cA(t,e)}function cA(t,e){return cA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},cA(t,e)}function NR(t,e,r){return e=IX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function IX(t){var e=Cqe(t,"string");return ip(e)=="symbol"?e:e+""}function Cqe(t,e){if(ip(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ip(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var zp=function(t){function e(r){var n;return wqe(this,e),n=kqe(this,e,[r]),n.state={fontSize:"",letterSpacing:""},n}return Nqe(e,t),_qe(e,[{key:"shouldComponentUpdate",value:function(n,i){var s=n.viewBox,a=QN(n,vqe),o=this.props,c=o.viewBox,u=QN(o,yqe);return!eh(s,c)||!eh(a,u)||!eh(i,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var i=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var i=this.props,s=i.x,a=i.y,o=i.width,c=i.height,u=i.orientation,d=i.tickSize,f=i.mirror,p=i.tickMargin,m,y,v,w,b,_,S=f?-1:1,N=n.tickSize||d,j=xe(n.tickCoord)?n.tickCoord:n.coordinate;switch(u){case"top":m=y=n.coordinate,w=a+ +!f*c,v=w-S*N,_=v-S*p,b=j;break;case"left":v=w=n.coordinate,y=s+ +!f*o,m=y-S*N,b=m-S*p,_=j;break;case"right":v=w=n.coordinate,y=s+ +f*o,m=y+S*N,b=m+S*p,_=j;break;default:m=y=n.coordinate,w=a+ +f*c,v=w+S*N,_=v+S*p,b=j;break}return{line:{x1:m,y1:v,x2:y,y2:w},tick:{x:b,y:_}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,i=n.orientation,s=n.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 n=this.props,i=n.orientation,s=n.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 n=this.props,i=n.x,s=n.y,a=n.width,o=n.height,c=n.orientation,u=n.mirror,d=n.axisLine,f=Gr(Gr(Gr({},Ge(this.props,!1)),Ge(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var p=+(c==="top"&&!u||c==="bottom"&&u);f=Gr(Gr({},f),{},{x1:i,y1:s+p*o,x2:i+a,y2:s+p*o})}else{var m=+(c==="left"&&!u||c==="right"&&u);f=Gr(Gr({},f),{},{x1:i+m*a,y1:s,x2:i+m*a,y2:s+o})}return D.createElement("line",If({},f,{className:at("recharts-cartesian-axis-line",Zi(d,"className"))}))}},{key:"renderTicks",value:function(n,i,s){var a=this,o=this.props,c=o.tickLine,u=o.stroke,d=o.tick,f=o.tickFormatter,p=o.unit,m=jR(Gr(Gr({},this.props),{},{ticks:n}),i,s),y=this.getTickTextAnchor(),v=this.getTickVerticalAnchor(),w=Ge(this.props,!1),b=Ge(d,!1),_=Gr(Gr({},w),{},{fill:"none"},Ge(c,!1)),S=m.map(function(N,j){var C=a.getTickLineCoord(N),O=C.line,P=C.tick,T=Gr(Gr(Gr(Gr({textAnchor:y,verticalAnchor:v},w),{},{stroke:"none",fill:u},b),P),{},{index:j,payload:N,visibleTicksCount:m.length,tickFormatter:f});return D.createElement(Rt,If({className:"recharts-cartesian-axis-tick",key:"tick-".concat(N.value,"-").concat(N.coordinate,"-").concat(N.tickCoord)},cd(a.props,N,j)),c&&D.createElement("line",If({},_,O,{className:at("recharts-cartesian-axis-tick-line",Zi(c,"className"))})),d&&e.renderTickItem(d,T,"".concat(Je(f)?f(N.value,j):N.value).concat(p||"")))});return D.createElement("g",{className:"recharts-cartesian-axis-ticks"},S)}},{key:"render",value:function(){var n=this,i=this.props,s=i.axisLine,a=i.width,o=i.height,c=i.ticksGenerator,u=i.className,d=i.hide;if(d)return null;var f=this.props,p=f.ticks,m=QN(f,xqe),y=p;return Je(c)&&(y=p&&p.length>0?c(this.props):c(m)),a<=0||o<=0||!y||!y.length?null:D.createElement(Rt,{className:at("recharts-cartesian-axis",u),ref:function(w){n.layerReference=w}},s&&this.renderAxisLine(),this.renderTicks(y,this.state.fontSize,this.state.letterSpacing),cn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,s){var a,o=at(i.className,"recharts-cartesian-axis-tick-value");return D.isValidElement(n)?a=D.cloneElement(n,Gr(Gr({},i),{},{className:o})):Je(n)?a=n(Gr(Gr({},i),{},{className:o})):a=D.createElement(ud,If({},i,{className:"recharts-cartesian-axis-tick-value"}),s),a}}])}(x.Component);NR(zp,"displayName","CartesianAxis");NR(zp,"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 Eqe=["x1","y1","x2","y2","key"],Oqe=["offset"];function hd(t){"@babel/helpers - typeof";return hd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hd(t)}function gz(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function zn(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?gz(Object(r),!0).forEach(function(n){Tqe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gz(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Tqe(t,e,r){return e=Aqe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Aqe(t){var e=Pqe(t,"string");return hd(e)=="symbol"?e:e+""}function Pqe(t,e){if(hd(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(hd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Eu(){return Eu=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Eu.apply(this,arguments)}function vz(t,e){if(t==null)return{};var r=Mqe(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Mqe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var Rqe=function(e){var r=e.fill;if(!r||r==="none")return null;var n=e.fillOpacity,i=e.x,s=e.y,a=e.width,o=e.height,c=e.ry;return D.createElement("rect",{x:i,y:s,ry:c,width:a,height:o,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function LX(t,e){var r;if(D.isValidElement(t))r=D.cloneElement(t,e);else if(Je(t))r=t(e);else{var n=e.x1,i=e.y1,s=e.x2,a=e.y2,o=e.key,c=vz(e,Eqe),u=Ge(c,!1);u.offset;var d=vz(u,Oqe);r=D.createElement("line",Eu({},d,{x1:n,y1:i,x2:s,y2:a,fill:"none",key:o}))}return r}function Iqe(t){var e=t.x,r=t.width,n=t.horizontal,i=n===void 0?!0:n,s=t.horizontalPoints;if(!i||!s||!s.length)return null;var a=s.map(function(o,c){var u=zn(zn({},t),{},{x1:e,y1:o,x2:e+r,y2:o,key:"line-".concat(c),index:c});return LX(i,u)});return D.createElement("g",{className:"recharts-cartesian-grid-horizontal"},a)}function Lqe(t){var e=t.y,r=t.height,n=t.vertical,i=n===void 0?!0:n,s=t.verticalPoints;if(!i||!s||!s.length)return null;var a=s.map(function(o,c){var u=zn(zn({},t),{},{x1:o,y1:e,x2:o,y2:e+r,key:"line-".concat(c),index:c});return LX(i,u)});return D.createElement("g",{className:"recharts-cartesian-grid-vertical"},a)}function $qe(t){var e=t.horizontalFill,r=t.fillOpacity,n=t.x,i=t.y,s=t.width,a=t.height,o=t.horizontalPoints,c=t.horizontal,u=c===void 0?!0:c;if(!u||!e||!e.length)return null;var d=o.map(function(p){return Math.round(p+i-i)}).sort(function(p,m){return p-m});i!==d[0]&&d.unshift(0);var f=d.map(function(p,m){var y=!d[m+1],v=y?i+a-p:d[m+1]-p;if(v<=0)return null;var w=m%e.length;return D.createElement("rect",{key:"react-".concat(m),y:p,x:n,height:v,width:s,stroke:"none",fill:e[w],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return D.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function Dqe(t){var e=t.vertical,r=e===void 0?!0:e,n=t.verticalFill,i=t.fillOpacity,s=t.x,a=t.y,o=t.width,c=t.height,u=t.verticalPoints;if(!r||!n||!n.length)return null;var d=u.map(function(p){return Math.round(p+s-s)}).sort(function(p,m){return p-m});s!==d[0]&&d.unshift(0);var f=d.map(function(p,m){var y=!d[m+1],v=y?s+o-p:d[m+1]-p;if(v<=0)return null;var w=m%n.length;return D.createElement("rect",{key:"react-".concat(m),x:p,y:a,width:v,height:c,stroke:"none",fill:n[w],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return D.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var Bqe=function(e,r){var n=e.xAxis,i=e.width,s=e.height,a=e.offset;return MY(jR(zn(zn(zn({},zp.defaultProps),n),{},{ticks:Oo(n,!0),viewBox:{x:0,y:0,width:i,height:s}})),a.left,a.left+a.width,r)},Fqe=function(e,r){var n=e.yAxis,i=e.width,s=e.height,a=e.offset;return MY(jR(zn(zn(zn({},zp.defaultProps),n),{},{ticks:Oo(n,!0),viewBox:{x:0,y:0,width:i,height:s}})),a.top,a.top+a.height,r)},nf={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function $X(t){var e,r,n,i,s,a,o=wR(),c=_R(),u=CWe(),d=zn(zn({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:nf.stroke,fill:(r=t.fill)!==null&&r!==void 0?r:nf.fill,horizontal:(n=t.horizontal)!==null&&n!==void 0?n:nf.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:nf.horizontalFill,vertical:(s=t.vertical)!==null&&s!==void 0?s:nf.vertical,verticalFill:(a=t.verticalFill)!==null&&a!==void 0?a:nf.verticalFill,x:xe(t.x)?t.x:u.left,y:xe(t.y)?t.y:u.top,width:xe(t.width)?t.width:u.width,height:xe(t.height)?t.height:u.height}),f=d.x,p=d.y,m=d.width,y=d.height,v=d.syncWithTicks,w=d.horizontalValues,b=d.verticalValues,_=SWe(),S=jWe();if(!xe(m)||m<=0||!xe(y)||y<=0||!xe(f)||f!==+f||!xe(p)||p!==+p)return null;var N=d.verticalCoordinatesGenerator||Bqe,j=d.horizontalCoordinatesGenerator||Fqe,C=d.horizontalPoints,O=d.verticalPoints;if((!C||!C.length)&&Je(j)){var P=w&&w.length,T=j({yAxis:S?zn(zn({},S),{},{ticks:P?w:S.ticks}):void 0,width:o,height:c,offset:u},P?!0:v);ua(Array.isArray(T),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(hd(T),"]")),Array.isArray(T)&&(C=T)}if((!O||!O.length)&&Je(N)){var $=b&&b.length,B=N({xAxis:_?zn(zn({},_),{},{ticks:$?b:_.ticks}):void 0,width:o,height:c,offset:u},$?!0:v);ua(Array.isArray(B),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(hd(B),"]")),Array.isArray(B)&&(O=B)}return D.createElement("g",{className:"recharts-cartesian-grid"},D.createElement(Rqe,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),D.createElement(Iqe,Eu({},d,{offset:u,horizontalPoints:C,xAxis:_,yAxis:S})),D.createElement(Lqe,Eu({},d,{offset:u,verticalPoints:O,xAxis:_,yAxis:S})),D.createElement($qe,Eu({},d,{horizontalPoints:C})),D.createElement(Dqe,Eu({},d,{verticalPoints:O})))}$X.displayName="CartesianGrid";function sp(t){"@babel/helpers - typeof";return sp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sp(t)}function zqe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Uqe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,FX(n.key),n)}}function Hqe(t,e,r){return e&&Uqe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Vqe(t,e,r){return e=F1(e),Wqe(t,DX()?Reflect.construct(e,r||[],F1(t).constructor):e.apply(t,r))}function Wqe(t,e){if(e&&(sp(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qqe(t)}function qqe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function DX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(DX=function(){return!!t})()}function F1(t){return F1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},F1(t)}function Kqe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&uA(t,e)}function uA(t,e){return uA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},uA(t,e)}function BX(t,e,r){return e=FX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function FX(t){var e=Gqe(t,"string");return sp(e)=="symbol"?e:e+""}function Gqe(t,e){if(sp(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(sp(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dA(){return dA=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},dA.apply(this,arguments)}function Zqe(t){var e=t.xAxisId,r=wR(),n=_R(),i=jX(e);return i==null?null:x.createElement(zp,dA({},i,{className:at("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(a){return Oo(a,!0)}}))}var dS=function(t){function e(){return zqe(this,e),Vqe(this,e,arguments)}return Kqe(e,t),Hqe(e,[{key:"render",value:function(){return x.createElement(Zqe,this.props)}}])}(x.Component);BX(dS,"displayName","XAxis");BX(dS,"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 ap(t){"@babel/helpers - typeof";return ap=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ap(t)}function Jqe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yqe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,HX(n.key),n)}}function Xqe(t,e,r){return e&&Yqe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Qqe(t,e,r){return e=z1(e),e7e(t,zX()?Reflect.construct(e,r||[],z1(t).constructor):e.apply(t,r))}function e7e(t,e){if(e&&(ap(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return t7e(t)}function t7e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function zX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zX=function(){return!!t})()}function z1(t){return z1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},z1(t)}function r7e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fA(t,e)}function fA(t,e){return fA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},fA(t,e)}function UX(t,e,r){return e=HX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function HX(t){var e=n7e(t,"string");return ap(e)=="symbol"?e:e+""}function n7e(t,e){if(ap(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ap(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function hA(){return hA=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},hA.apply(this,arguments)}var i7e=function(e){var r=e.yAxisId,n=wR(),i=_R(),s=NX(r);return s==null?null:x.createElement(zp,hA({},s,{className:at("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:n,height:i},ticksGenerator:function(o){return Oo(o,!0)}}))},fS=function(t){function e(){return Jqe(this,e),Qqe(this,e,arguments)}return r7e(e,t),Xqe(e,[{key:"render",value:function(){return x.createElement(i7e,this.props)}}])}(x.Component);UX(fS,"displayName","YAxis");UX(fS,"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 yz(t){return l7e(t)||o7e(t)||a7e(t)||s7e()}function s7e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
882In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a7e(t,e){if(t){if(typeof t=="string")return pA(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pA(t,e)}}function o7e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function l7e(t){if(Array.isArray(t))return pA(t)}function pA(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var mA=function(e,r,n,i,s){var a=Ts(e,SR),o=Ts(e,lS),c=[].concat(yz(a),yz(o)),u=Ts(e,uS),d="".concat(i,"Id"),f=i[0],p=r;if(c.length&&(p=c.reduce(function(v,w){if(w.props[d]===n&&Wa(w.props,"extendDomain")&&xe(w.props[f])){var b=w.props[f];return[Math.min(v[0],b),Math.max(v[1],b)]}return v},p)),u.length){var m="".concat(f,"1"),y="".concat(f,"2");p=u.reduce(function(v,w){if(w.props[d]===n&&Wa(w.props,"extendDomain")&&xe(w.props[m])&&xe(w.props[y])){var b=w.props[m],_=w.props[y];return[Math.min(v[0],b,_),Math.max(v[1],b,_)]}return v},p)}return s&&s.length&&(p=s.reduce(function(v,w){return xe(w)?[Math.min(v[0],w),Math.max(v[1],w)]:v},p)),p},VX={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function s(c,u,d,f,p){if(typeof d!="function")throw new TypeError("The listener must be a function");var m=new i(d,f||c,p),y=r?r+u:u;return c._events[y]?c._events[y].fn?c._events[y]=[c._events[y],m]:c._events[y].push(m):(c._events[y]=m,c._eventsCount++),c}function a(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)e.call(d,f)&&u.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},o.prototype.listeners=function(u){var d=r?r+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var p=0,m=f.length,y=new Array(m);p<m;p++)y[p]=f[p].fn;return y},o.prototype.listenerCount=function(u){var d=r?r+u:u,f=this._events[d];return f?f.fn?1:f.length:0},o.prototype.emit=function(u,d,f,p,m,y){var v=r?r+u:u;if(!this._events[v])return!1;var w=this._events[v],b=arguments.length,_,S;if(w.fn){switch(w.once&&this.removeListener(u,w.fn,void 0,!0),b){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,d),!0;case 3:return w.fn.call(w.context,d,f),!0;case 4:return w.fn.call(w.context,d,f,p),!0;case 5:return w.fn.call(w.context,d,f,p,m),!0;case 6:return w.fn.call(w.context,d,f,p,m,y),!0}for(S=1,_=new Array(b-1);S<b;S++)_[S-1]=arguments[S];w.fn.apply(w.context,_)}else{var N=w.length,j;for(S=0;S<N;S++)switch(w[S].once&&this.removeListener(u,w[S].fn,void 0,!0),b){case 1:w[S].fn.call(w[S].context);break;case 2:w[S].fn.call(w[S].context,d);break;case 3:w[S].fn.call(w[S].context,d,f);break;case 4:w[S].fn.call(w[S].context,d,f,p);break;default:if(!_)for(j=1,_=new Array(b-1);j<b;j++)_[j-1]=arguments[j];w[S].fn.apply(w[S].context,_)}}return!0},o.prototype.on=function(u,d,f){return s(this,u,d,f,!1)},o.prototype.once=function(u,d,f){return s(this,u,d,f,!0)},o.prototype.removeListener=function(u,d,f,p){var m=r?r+u:u;if(!this._events[m])return this;if(!d)return a(this,m),this;var y=this._events[m];if(y.fn)y.fn===d&&(!p||y.once)&&(!f||y.context===f)&&a(this,m);else{for(var v=0,w=[],b=y.length;v<b;v++)(y[v].fn!==d||p&&!y[v].once||f&&y[v].context!==f)&&w.push(y[v]);w.length?this._events[m]=w.length===1?w[0]:w:a(this,m)}return this},o.prototype.removeAllListeners=function(u){var d;return u?(d=r?r+u:u,this._events[d]&&a(this,d)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,t.exports=o})(VX);var c7e=VX.exports;const u7e=St(c7e);var eC=new u7e,tC="recharts.syncMouseEvents";function ny(t){"@babel/helpers - typeof";return ny=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ny(t)}function d7e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f7e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,WX(n.key),n)}}function h7e(t,e,r){return e&&f7e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function rC(t,e,r){return e=WX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function WX(t){var e=p7e(t,"string");return ny(e)=="symbol"?e:e+""}function p7e(t,e){if(ny(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ny(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var m7e=function(){function t(){d7e(this,t),rC(this,"activeIndex",0),rC(this,"coordinateList",[]),rC(this,"layout","horizontal")}return h7e(t,[{key:"setDetails",value:function(r){var n,i=r.coordinateList,s=i===void 0?null:i,a=r.container,o=a===void 0?null:a,c=r.layout,u=c===void 0?null:c,d=r.offset,f=d===void 0?null:d,p=r.mouseHandlerCallback,m=p===void 0?null:p;this.coordinateList=(n=s??this.coordinateList)!==null&&n!==void 0?n:[],this.container=o??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=m??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(r){if(this.coordinateList.length!==0)switch(r.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(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),s=i.x,a=i.y,o=i.height,c=this.coordinateList[this.activeIndex].coordinate,u=((r=window)===null||r===void 0?void 0:r.scrollX)||0,d=((n=window)===null||n===void 0?void 0:n.scrollY)||0,f=s+c+u,p=a+this.offset.top+o/2+d;this.mouseHandlerCallback({pageX:f,pageY:p})}}}])}();function g7e(t,e,r){if(r==="number"&&e===!0&&Array.isArray(t)){var n=t==null?void 0:t[0],i=t==null?void 0:t[1];if(n&&i&&xe(n)&&xe(i))return!0}return!1}function v7e(t,e,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:t==="horizontal"?e.x-i:r.left+.5,y:t==="horizontal"?r.top+.5:e.y-i,width:t==="horizontal"?n:r.width-1,height:t==="horizontal"?r.height-1:n}}function qX(t){var e=t.cx,r=t.cy,n=t.radius,i=t.startAngle,s=t.endAngle,a=Xt(e,r,n,i),o=Xt(e,r,n,s);return{points:[a,o],cx:e,cy:r,radius:n,startAngle:i,endAngle:s}}function y7e(t,e,r){var n,i,s,a;if(t==="horizontal")n=e.x,s=n,i=r.top,a=r.top+r.height;else if(t==="vertical")i=e.y,a=i,n=r.left,s=r.left+r.width;else if(e.cx!=null&&e.cy!=null)if(t==="centric"){var o=e.cx,c=e.cy,u=e.innerRadius,d=e.outerRadius,f=e.angle,p=Xt(o,c,u,f),m=Xt(o,c,d,f);n=p.x,i=p.y,s=m.x,a=m.y}else return qX(e);return[{x:n,y:i},{x:s,y:a}]}function iy(t){"@babel/helpers - typeof";return iy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},iy(t)}function xz(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function yb(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?xz(Object(r),!0).forEach(function(n){x7e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xz(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function x7e(t,e,r){return e=b7e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function b7e(t){var e=w7e(t,"string");return iy(e)=="symbol"?e:e+""}function w7e(t,e){if(iy(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(iy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function _7e(t){var e,r,n=t.element,i=t.tooltipEventType,s=t.isActive,a=t.activeCoordinate,o=t.activePayload,c=t.offset,u=t.activeTooltipIndex,d=t.tooltipAxisBandSize,f=t.layout,p=t.chartName,m=(e=n.props.cursor)!==null&&e!==void 0?e:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!m||!s||!a||p!=="ScatterChart"&&i!=="axis")return null;var y,v=DT;if(p==="ScatterChart")y=a,v=QUe;else if(p==="BarChart")y=v7e(f,a,c,d),v=gR;else if(f==="radial"){var w=qX(a),b=w.cx,_=w.cy,S=w.radius,N=w.startAngle,j=w.endAngle;y={cx:b,cy:_,startAngle:N,endAngle:j,innerRadius:S,outerRadius:S},v=VY}else y={points:y7e(f,a,c)},v=DT;var C=yb(yb(yb(yb({stroke:"#ccc",pointerEvents:"none"},c),y),Ge(m,!1)),{},{payload:o,payloadIndex:u,className:at("recharts-tooltip-cursor",m.className)});return x.isValidElement(m)?x.cloneElement(m,C):x.createElement(v,C)}var k7e=["item"],S7e=["children","className","width","height","style","compact","title","desc"];function op(t){"@babel/helpers - typeof";return op=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},op(t)}function Lf(){return Lf=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Lf.apply(this,arguments)}function bz(t,e){return C7e(t)||N7e(t,e)||GX(t,e)||j7e()}function j7e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
883In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function N7e(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function C7e(t){if(Array.isArray(t))return t}function wz(t,e){if(t==null)return{};var r=E7e(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function E7e(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function O7e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function T7e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ZX(n.key),n)}}function A7e(t,e,r){return e&&T7e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function P7e(t,e,r){return e=U1(e),M7e(t,KX()?Reflect.construct(e,r||[],U1(t).constructor):e.apply(t,r))}function M7e(t,e){if(e&&(op(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return R7e(t)}function R7e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function KX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KX=function(){return!!t})()}function U1(t){return U1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},U1(t)}function I7e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&gA(t,e)}function gA(t,e){return gA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},gA(t,e)}function lp(t){return D7e(t)||$7e(t)||GX(t)||L7e()}function L7e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
884In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GX(t,e){if(t){if(typeof t=="string")return vA(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vA(t,e)}}function $7e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function D7e(t){if(Array.isArray(t))return vA(t)}function vA(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _z(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function le(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?_z(Object(r),!0).forEach(function(n){We(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_z(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function We(t,e,r){return e=ZX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ZX(t){var e=B7e(t,"string");return op(e)=="symbol"?e:e+""}function B7e(t,e){if(op(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(op(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var F7e={xAxis:["bottom","top"],yAxis:["left","right"]},z7e={width:"100%",height:"100%"},JX={x:0,y:0};function xb(t){return t}var U7e=function(e,r){return r==="horizontal"?e.x:r==="vertical"?e.y:r==="centric"?e.angle:e.radius},H7e=function(e,r,n,i){var s=r.find(function(d){return d&&d.index===n});if(s){if(e==="horizontal")return{x:s.coordinate,y:i.y};if(e==="vertical")return{x:i.x,y:s.coordinate};if(e==="centric"){var a=s.coordinate,o=i.radius;return le(le(le({},i),Xt(i.cx,i.cy,o,a)),{},{angle:a,radius:o})}var c=s.coordinate,u=i.angle;return le(le(le({},i),Xt(i.cx,i.cy,c,u)),{},{angle:u,radius:c})}return JX},hS=function(e,r){var n=r.graphicalItems,i=r.dataStartIndex,s=r.dataEndIndex,a=(n??[]).reduce(function(o,c){var u=c.props.data;return u&&u.length?[].concat(lp(o),lp(u)):o},[]);return a.length>0?a:e&&e.length&&xe(i)&&xe(s)?e.slice(i,s+1):[]};function YX(t){return t==="number"?[0,"auto"]:void 0}var yA=function(e,r,n,i){var s=e.graphicalItems,a=e.tooltipAxis,o=hS(r,e);return n<0||!s||!s.length||n>=o.length?null:s.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:r;f&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=n&&(f=f.slice(e.dataStartIndex,e.dataEndIndex+1));var p;if(a.dataKey&&!a.allowDuplicatedCategory){var m=f===void 0?o:f;p=qO(m,a.dataKey,i)}else p=f&&f[n]||o[n];return p?[].concat(lp(c),[DY(u,p)]):c},[])},kz=function(e,r,n,i){var s=i||{x:e.chartX,y:e.chartY},a=U7e(s,n),o=e.orderedTooltipTicks,c=e.tooltipAxis,u=e.tooltipTicks,d=kze(a,o,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,p=yA(e,r,d,f),m=H7e(n,o,d,s);return{activeTooltipIndex:d,activeLabel:f,activePayload:p,activeCoordinate:m}}return null},V7e=function(e,r){var n=r.axes,i=r.graphicalItems,s=r.axisType,a=r.axisIdKey,o=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=e.layout,f=e.children,p=e.stackOffset,m=PY(d,s);return n.reduce(function(y,v){var w,b=v.type.defaultProps!==void 0?le(le({},v.type.defaultProps),v.props):v.props,_=b.type,S=b.dataKey,N=b.allowDataOverflow,j=b.allowDuplicatedCategory,C=b.scale,O=b.ticks,P=b.includeHidden,T=b[a];if(y[T])return y;var $=hS(e.data,{graphicalItems:i.filter(function(U){var J,te=a in U.props?U.props[a]:(J=U.type.defaultProps)===null||J===void 0?void 0:J[a];return te===T}),dataStartIndex:c,dataEndIndex:u}),B=$.length,R,M,F;g7e(b.domain,N,_)&&(R=MT(b.domain,null,N),m&&(_==="number"||C!=="auto")&&(F=bg($,S,"category")));var q=YX(_);if(!R||R.length===0){var V,W=(V=b.domain)!==null&&V!==void 0?V:q;if(S){if(R=bg($,S,_),_==="category"&&m){var z=hTe(R);j&&z?(M=R,R=T1(0,B)):j||(R=GB(W,R,v).reduce(function(U,J){return U.indexOf(J)>=0?U:[].concat(lp(U),[J])},[]))}else if(_==="category")j?R=R.filter(function(U){return U!==""&&!vt(U)}):R=GB(W,R,v).reduce(function(U,J){return U.indexOf(J)>=0||J===""||vt(J)?U:[].concat(lp(U),[J])},[]);else if(_==="number"){var H=Eze($,i.filter(function(U){var J,te,re=a in U.props?U.props[a]:(J=U.type.defaultProps)===null||J===void 0?void 0:J[a],ae="hide"in U.props?U.props.hide:(te=U.type.defaultProps)===null||te===void 0?void 0:te.hide;return re===T&&(P||!ae)}),S,s,d);H&&(R=H)}m&&(_==="number"||C!=="auto")&&(F=bg($,S,"category"))}else m?R=T1(0,B):o&&o[T]&&o[T].hasStack&&_==="number"?R=p==="expand"?[0,1]:$Y(o[T].stackGroups,c,u):R=AY($,i.filter(function(U){var J=a in U.props?U.props[a]:U.type.defaultProps[a],te="hide"in U.props?U.props.hide:U.type.defaultProps.hide;return J===T&&(P||!te)}),_,d,!0);if(_==="number")R=mA(f,R,T,s,O),W&&(R=MT(W,R,N));else if(_==="category"&&W){var G=W,Y=R.every(function(U){return G.indexOf(U)>=0});Y&&(R=G)}}return le(le({},y),{},We({},T,le(le({},b),{},{axisType:s,domain:R,categoricalDomain:F,duplicateDomain:M,originalDomain:(w=b.domain)!==null&&w!==void 0?w:q,isCategorical:m,layout:d})))},{})},W7e=function(e,r){var n=r.graphicalItems,i=r.Axis,s=r.axisType,a=r.axisIdKey,o=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=e.layout,f=e.children,p=hS(e.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:u}),m=p.length,y=PY(d,s),v=-1;return n.reduce(function(w,b){var _=b.type.defaultProps!==void 0?le(le({},b.type.defaultProps),b.props):b.props,S=_[a],N=YX("number");if(!w[S]){v++;var j;return y?j=T1(0,m):o&&o[S]&&o[S].hasStack?(j=$Y(o[S].stackGroups,c,u),j=mA(f,j,S,s)):(j=MT(N,AY(p,n.filter(function(C){var O,P,T=a in C.props?C.props[a]:(O=C.type.defaultProps)===null||O===void 0?void 0:O[a],$="hide"in C.props?C.props.hide:(P=C.type.defaultProps)===null||P===void 0?void 0:P.hide;return T===S&&!$}),"number",d),i.defaultProps.allowDataOverflow),j=mA(f,j,S,s)),le(le({},w),{},We({},S,le(le({axisType:s},i.defaultProps),{},{hide:!0,orientation:Zi(F7e,"".concat(s,".").concat(v%2),null),domain:j,originalDomain:N,isCategorical:y,layout:d})))}return w},{})},q7e=function(e,r){var n=r.axisType,i=n===void 0?"xAxis":n,s=r.AxisComp,a=r.graphicalItems,o=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=e.children,f="".concat(i,"Id"),p=Ts(d,s),m={};return p&&p.length?m=V7e(e,{axes:p,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:o,dataStartIndex:c,dataEndIndex:u}):a&&a.length&&(m=W7e(e,{Axis:s,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:o,dataStartIndex:c,dataEndIndex:u})),m},K7e=function(e){var r=Ll(e),n=Oo(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:HM(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:y1(r,n)}},Sz=function(e){var r=e.children,n=e.defaultShowTooltip,i=Di(r,Qh),s=0,a=0;return e.data&&e.data.length!==0&&(a=e.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:!!n}},G7e=function(e){return!e||!e.length?!1:e.some(function(r){var n=Mo(r&&r.type);return n&&n.indexOf("Bar")>=0})},jz=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Z7e=function(e,r){var n=e.props,i=e.graphicalItems,s=e.xAxisMap,a=s===void 0?{}:s,o=e.yAxisMap,c=o===void 0?{}:o,u=n.width,d=n.height,f=n.children,p=n.margin||{},m=Di(f,Qh),y=Di(f,th),v=Object.keys(c).reduce(function(j,C){var O=c[C],P=O.orientation;return!O.mirror&&!O.hide?le(le({},j),{},We({},P,j[P]+O.width)):j},{left:p.left||0,right:p.right||0}),w=Object.keys(a).reduce(function(j,C){var O=a[C],P=O.orientation;return!O.mirror&&!O.hide?le(le({},j),{},We({},P,Zi(j,"".concat(P))+O.height)):j},{top:p.top||0,bottom:p.bottom||0}),b=le(le({},w),v),_=b.bottom;m&&(b.bottom+=m.props.height||Qh.defaultProps.height),y&&r&&(b=Nze(b,i,n,r));var S=u-b.left-b.right,N=d-b.top-b.bottom;return le(le({brushBottom:_},b),{},{width:Math.max(S,0),height:Math.max(N,0)})},J7e=function(e,r){if(r==="xAxis")return e[r].width;if(r==="yAxis")return e[r].height},XX=function(e){var r=e.chartName,n=e.GraphicalChild,i=e.defaultTooltipEventType,s=i===void 0?"axis":i,a=e.validateTooltipEventTypes,o=a===void 0?["axis"]:a,c=e.axisComponents,u=e.legendContent,d=e.formatAxisMap,f=e.defaultProps,p=function(b,_){var S=_.graphicalItems,N=_.stackGroups,j=_.offset,C=_.updateId,O=_.dataStartIndex,P=_.dataEndIndex,T=b.barSize,$=b.layout,B=b.barGap,R=b.barCategoryGap,M=b.maxBarSize,F=jz($),q=F.numericAxisName,V=F.cateAxisName,W=G7e(S),z=[];return S.forEach(function(H,G){var Y=hS(b.data,{graphicalItems:[H],dataStartIndex:O,dataEndIndex:P}),U=H.type.defaultProps!==void 0?le(le({},H.type.defaultProps),H.props):H.props,J=U.dataKey,te=U.maxBarSize,re=U["".concat(q,"Id")],ae=U["".concat(V,"Id")],oe={},_e=c.reduce(function(ar,fr){var qr=_["".concat(fr.axisType,"Map")],Us=U["".concat(fr.axisType,"Id")];qr&&qr[Us]||fr.axisType==="zAxis"||fd();var Z=qr[Us];return le(le({},ar),{},We(We({},fr.axisType,Z),"".concat(fr.axisType,"Ticks"),Oo(Z)))},oe),ne=_e[V],ue=_e["".concat(V,"Ticks")],be=N&&N[re]&&N[re].hasStack&&$ze(H,N[re].stackGroups),Q=Mo(H.type).indexOf("Bar")>=0,He=y1(ne,ue),Ie=[],ft=W&&Sze({barSize:T,stackGroups:N,totalSize:J7e(_e,V)});if(Q){var ot,yt,Bt=vt(te)?M:te,Or=(ot=(yt=y1(ne,ue,!0))!==null&&yt!==void 0?yt:Bt)!==null&&ot!==void 0?ot:0;Ie=jze({barGap:B,barCategoryGap:R,bandSize:Or!==He?Or:He,sizeList:ft[ae],maxBarSize:Bt}),Or!==He&&(Ie=Ie.map(function(ar){return le(le({},ar),{},{position:le(le({},ar.position),{},{offset:ar.position.offset-Or/2})})}))}var xr=H&&H.type&&H.type.getComposedData;xr&&z.push({props:le(le({},xr(le(le({},_e),{},{displayedData:Y,props:b,dataKey:J,item:H,bandSize:He,barPosition:Ie,offset:j,stackedData:be,layout:$,dataStartIndex:O,dataEndIndex:P}))),{},We(We(We({key:H.key||"item-".concat(G)},q,_e[q]),V,_e[V]),"animationId",C)),childIndex:jTe(H,b.children),item:H})}),z},m=function(b,_){var S=b.props,N=b.dataStartIndex,j=b.dataEndIndex,C=b.updateId;if(!z3({props:S}))return null;var O=S.children,P=S.layout,T=S.stackOffset,$=S.data,B=S.reverseStackOrder,R=jz(P),M=R.numericAxisName,F=R.cateAxisName,q=Ts(O,n),V=Ize($,q,"".concat(M,"Id"),"".concat(F,"Id"),T,B),W=c.reduce(function(U,J){var te="".concat(J.axisType,"Map");return le(le({},U),{},We({},te,q7e(S,le(le({},J),{},{graphicalItems:q,stackGroups:J.axisType===M&&V,dataStartIndex:N,dataEndIndex:j}))))},{}),z=Z7e(le(le({},W),{},{props:S,graphicalItems:q}),_==null?void 0:_.legendBBox);Object.keys(W).forEach(function(U){W[U]=d(S,W[U],z,U.replace("Map",""),r)});var H=W["".concat(F,"Map")],G=K7e(H),Y=p(S,le(le({},W),{},{dataStartIndex:N,dataEndIndex:j,updateId:C,graphicalItems:q,stackGroups:V,offset:z}));return le(le({formattedGraphicalItems:Y,graphicalItems:q,offset:z,stackGroups:V},G),W)},y=function(w){function b(_){var S,N,j;return O7e(this,b),j=P7e(this,b,[_]),We(j,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),We(j,"accessibilityManager",new m7e),We(j,"handleLegendBBoxUpdate",function(C){if(C){var O=j.state,P=O.dataStartIndex,T=O.dataEndIndex,$=O.updateId;j.setState(le({legendBBox:C},m({props:j.props,dataStartIndex:P,dataEndIndex:T,updateId:$},le(le({},j.state),{},{legendBBox:C}))))}}),We(j,"handleReceiveSyncEvent",function(C,O,P){if(j.props.syncId===C){if(P===j.eventEmitterSymbol&&typeof j.props.syncMethod!="function")return;j.applySyncEvent(O)}}),We(j,"handleBrushChange",function(C){var O=C.startIndex,P=C.endIndex;if(O!==j.state.dataStartIndex||P!==j.state.dataEndIndex){var T=j.state.updateId;j.setState(function(){return le({dataStartIndex:O,dataEndIndex:P},m({props:j.props,dataStartIndex:O,dataEndIndex:P,updateId:T},j.state))}),j.triggerSyncEvent({dataStartIndex:O,dataEndIndex:P})}}),We(j,"handleMouseEnter",function(C){var O=j.getMouseInfo(C);if(O){var P=le(le({},O),{},{isTooltipActive:!0});j.setState(P),j.triggerSyncEvent(P);var T=j.props.onMouseEnter;Je(T)&&T(P,C)}}),We(j,"triggeredAfterMouseMove",function(C){var O=j.getMouseInfo(C),P=O?le(le({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};j.setState(P),j.triggerSyncEvent(P);var T=j.props.onMouseMove;Je(T)&&T(P,C)}),We(j,"handleItemMouseEnter",function(C){j.setState(function(){return{isTooltipActive:!0,activeItem:C,activePayload:C.tooltipPayload,activeCoordinate:C.tooltipPosition||{x:C.cx,y:C.cy}}})}),We(j,"handleItemMouseLeave",function(){j.setState(function(){return{isTooltipActive:!1}})}),We(j,"handleMouseMove",function(C){C.persist(),j.throttleTriggeredAfterMouseMove(C)}),We(j,"handleMouseLeave",function(C){j.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};j.setState(O),j.triggerSyncEvent(O);var P=j.props.onMouseLeave;Je(P)&&P(O,C)}),We(j,"handleOuterEvent",function(C){var O=STe(C),P=Zi(j.props,"".concat(O));if(O&&Je(P)){var T,$;/.*touch.*/i.test(O)?$=j.getMouseInfo(C.changedTouches[0]):$=j.getMouseInfo(C),P((T=$)!==null&&T!==void 0?T:{},C)}}),We(j,"handleClick",function(C){var O=j.getMouseInfo(C);if(O){var P=le(le({},O),{},{isTooltipActive:!0});j.setState(P),j.triggerSyncEvent(P);var T=j.props.onClick;Je(T)&&T(P,C)}}),We(j,"handleMouseDown",function(C){var O=j.props.onMouseDown;if(Je(O)){var P=j.getMouseInfo(C);O(P,C)}}),We(j,"handleMouseUp",function(C){var O=j.props.onMouseUp;if(Je(O)){var P=j.getMouseInfo(C);O(P,C)}}),We(j,"handleTouchMove",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&j.throttleTriggeredAfterMouseMove(C.changedTouches[0])}),We(j,"handleTouchStart",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&j.handleMouseDown(C.changedTouches[0])}),We(j,"handleTouchEnd",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&j.handleMouseUp(C.changedTouches[0])}),We(j,"handleDoubleClick",function(C){var O=j.props.onDoubleClick;if(Je(O)){var P=j.getMouseInfo(C);O(P,C)}}),We(j,"handleContextMenu",function(C){var O=j.props.onContextMenu;if(Je(O)){var P=j.getMouseInfo(C);O(P,C)}}),We(j,"triggerSyncEvent",function(C){j.props.syncId!==void 0&&eC.emit(tC,j.props.syncId,C,j.eventEmitterSymbol)}),We(j,"applySyncEvent",function(C){var O=j.props,P=O.layout,T=O.syncMethod,$=j.state.updateId,B=C.dataStartIndex,R=C.dataEndIndex;if(C.dataStartIndex!==void 0||C.dataEndIndex!==void 0)j.setState(le({dataStartIndex:B,dataEndIndex:R},m({props:j.props,dataStartIndex:B,dataEndIndex:R,updateId:$},j.state)));else if(C.activeTooltipIndex!==void 0){var M=C.chartX,F=C.chartY,q=C.activeTooltipIndex,V=j.state,W=V.offset,z=V.tooltipTicks;if(!W)return;if(typeof T=="function")q=T(z,C);else if(T==="value"){q=-1;for(var H=0;H<z.length;H++)if(z[H].value===C.activeLabel){q=H;break}}var G=le(le({},W),{},{x:W.left,y:W.top}),Y=Math.min(M,G.x+G.width),U=Math.min(F,G.y+G.height),J=z[q]&&z[q].value,te=yA(j.state,j.props.data,q),re=z[q]?{x:P==="horizontal"?z[q].coordinate:Y,y:P==="horizontal"?U:z[q].coordinate}:JX;j.setState(le(le({},C),{},{activeLabel:J,activeCoordinate:re,activePayload:te,activeTooltipIndex:q}))}else j.setState(C)}),We(j,"renderCursor",function(C){var O,P=j.state,T=P.isTooltipActive,$=P.activeCoordinate,B=P.activePayload,R=P.offset,M=P.activeTooltipIndex,F=P.tooltipAxisBandSize,q=j.getTooltipEventType(),V=(O=C.props.active)!==null&&O!==void 0?O:T,W=j.props.layout,z=C.key||"_recharts-cursor";return D.createElement(_7e,{key:z,activeCoordinate:$,activePayload:B,activeTooltipIndex:M,chartName:r,element:C,isActive:V,layout:W,offset:R,tooltipAxisBandSize:F,tooltipEventType:q})}),We(j,"renderPolarAxis",function(C,O,P){var T=Zi(C,"type.axisType"),$=Zi(j.state,"".concat(T,"Map")),B=C.type.defaultProps,R=B!==void 0?le(le({},B),C.props):C.props,M=$&&$[R["".concat(T,"Id")]];return x.cloneElement(C,le(le({},M),{},{className:at(T,M.className),key:C.key||"".concat(O,"-").concat(P),ticks:Oo(M,!0)}))}),We(j,"renderPolarGrid",function(C){var O=C.props,P=O.radialLines,T=O.polarAngles,$=O.polarRadius,B=j.state,R=B.radiusAxisMap,M=B.angleAxisMap,F=Ll(R),q=Ll(M),V=q.cx,W=q.cy,z=q.innerRadius,H=q.outerRadius;return x.cloneElement(C,{polarAngles:Array.isArray(T)?T:Oo(q,!0).map(function(G){return G.coordinate}),polarRadius:Array.isArray($)?$:Oo(F,!0).map(function(G){return G.coordinate}),cx:V,cy:W,innerRadius:z,outerRadius:H,key:C.key||"polar-grid",radialLines:P})}),We(j,"renderLegend",function(){var C=j.state.formattedGraphicalItems,O=j.props,P=O.children,T=O.width,$=O.height,B=j.props.margin||{},R=T-(B.left||0)-(B.right||0),M=OY({children:P,formattedGraphicalItems:C,legendWidth:R,legendContent:u});if(!M)return null;var F=M.item,q=wz(M,k7e);return x.cloneElement(F,le(le({},q),{},{chartWidth:T,chartHeight:$,margin:B,onBBoxUpdate:j.handleLegendBBoxUpdate}))}),We(j,"renderTooltip",function(){var C,O=j.props,P=O.children,T=O.accessibilityLayer,$=Di(P,Ta);if(!$)return null;var B=j.state,R=B.isTooltipActive,M=B.activeCoordinate,F=B.activePayload,q=B.activeLabel,V=B.offset,W=(C=$.props.active)!==null&&C!==void 0?C:R;return x.cloneElement($,{viewBox:le(le({},V),{},{x:V.left,y:V.top}),active:W,label:q,payload:W?F:[],coordinate:M,accessibilityLayer:T})}),We(j,"renderBrush",function(C){var O=j.props,P=O.margin,T=O.data,$=j.state,B=$.offset,R=$.dataStartIndex,M=$.dataEndIndex,F=$.updateId;return x.cloneElement(C,{key:C.key||"_recharts-brush",onChange:pb(j.handleBrushChange,C.props.onChange),data:T,x:xe(C.props.x)?C.props.x:B.left,y:xe(C.props.y)?C.props.y:B.top+B.height+B.brushBottom-(P.bottom||0),width:xe(C.props.width)?C.props.width:B.width,startIndex:R,endIndex:M,updateId:"brush-".concat(F)})}),We(j,"renderReferenceElement",function(C,O,P){if(!C)return null;var T=j,$=T.clipPathId,B=j.state,R=B.xAxisMap,M=B.yAxisMap,F=B.offset,q=C.type.defaultProps||{},V=C.props,W=V.xAxisId,z=W===void 0?q.xAxisId:W,H=V.yAxisId,G=H===void 0?q.yAxisId:H;return x.cloneElement(C,{key:C.key||"".concat(O,"-").concat(P),xAxis:R[z],yAxis:M[G],viewBox:{x:F.left,y:F.top,width:F.width,height:F.height},clipPathId:$})}),We(j,"renderActivePoints",function(C){var O=C.item,P=C.activePoint,T=C.basePoint,$=C.childIndex,B=C.isRange,R=[],M=O.props.key,F=O.item.type.defaultProps!==void 0?le(le({},O.item.type.defaultProps),O.item.props):O.item.props,q=F.activeDot,V=F.dataKey,W=le(le({index:$,dataKey:V,cx:P.x,cy:P.y,r:4,fill:mR(O.item),strokeWidth:2,stroke:"#fff",payload:P.payload,value:P.value},Ge(q,!1)),Ww(q));return R.push(b.renderActiveDot(q,W,"".concat(M,"-activePoint-").concat($))),T?R.push(b.renderActiveDot(q,le(le({},W),{},{cx:T.x,cy:T.y}),"".concat(M,"-basePoint-").concat($))):B&&R.push(null),R}),We(j,"renderGraphicChild",function(C,O,P){var T=j.filterFormatItem(C,O,P);if(!T)return null;var $=j.getTooltipEventType(),B=j.state,R=B.isTooltipActive,M=B.tooltipAxis,F=B.activeTooltipIndex,q=B.activeLabel,V=j.props.children,W=Di(V,Ta),z=T.props,H=z.points,G=z.isRange,Y=z.baseLine,U=T.item.type.defaultProps!==void 0?le(le({},T.item.type.defaultProps),T.item.props):T.item.props,J=U.activeDot,te=U.hide,re=U.activeBar,ae=U.activeShape,oe=!!(!te&&R&&W&&(J||re||ae)),_e={};$!=="axis"&&W&&W.props.trigger==="click"?_e={onClick:pb(j.handleItemMouseEnter,C.props.onClick)}:$!=="axis"&&(_e={onMouseLeave:pb(j.handleItemMouseLeave,C.props.onMouseLeave),onMouseEnter:pb(j.handleItemMouseEnter,C.props.onMouseEnter)});var ne=x.cloneElement(C,le(le({},T.props),_e));function ue(fr){return typeof M.dataKey=="function"?M.dataKey(fr.payload):null}if(oe)if(F>=0){var be,Q;if(M.dataKey&&!M.allowDuplicatedCategory){var He=typeof M.dataKey=="function"?ue:"payload.".concat(M.dataKey.toString());be=qO(H,He,q),Q=G&&Y&&qO(Y,He,q)}else be=H==null?void 0:H[F],Q=G&&Y&&Y[F];if(ae||re){var Ie=C.props.activeIndex!==void 0?C.props.activeIndex:F;return[x.cloneElement(C,le(le(le({},T.props),_e),{},{activeIndex:Ie})),null,null]}if(!vt(be))return[ne].concat(lp(j.renderActivePoints({item:T,activePoint:be,basePoint:Q,childIndex:F,isRange:G})))}else{var ft,ot=(ft=j.getItemByXY(j.state.activeCoordinate))!==null&&ft!==void 0?ft:{graphicalItem:ne},yt=ot.graphicalItem,Bt=yt.item,Or=Bt===void 0?C:Bt,xr=yt.childIndex,ar=le(le(le({},T.props),_e),{},{activeIndex:xr});return[x.cloneElement(Or,ar),null,null]}return G?[ne,null,null]:[ne,null]}),We(j,"renderCustomized",function(C,O,P){return x.cloneElement(C,le(le({key:"recharts-customized-".concat(P)},j.props),j.state))}),We(j,"renderMap",{CartesianGrid:{handler:xb,once:!0},ReferenceArea:{handler:j.renderReferenceElement},ReferenceLine:{handler:xb},ReferenceDot:{handler:j.renderReferenceElement},XAxis:{handler:xb},YAxis:{handler:xb},Brush:{handler:j.renderBrush,once:!0},Bar:{handler:j.renderGraphicChild},Line:{handler:j.renderGraphicChild},Area:{handler:j.renderGraphicChild},Radar:{handler:j.renderGraphicChild},RadialBar:{handler:j.renderGraphicChild},Scatter:{handler:j.renderGraphicChild},Pie:{handler:j.renderGraphicChild},Funnel:{handler:j.renderGraphicChild},Tooltip:{handler:j.renderCursor,once:!0},PolarGrid:{handler:j.renderPolarGrid,once:!0},PolarAngleAxis:{handler:j.renderPolarAxis},PolarRadiusAxis:{handler:j.renderPolarAxis},Customized:{handler:j.renderCustomized}}),j.clipPathId="".concat((S=_.id)!==null&&S!==void 0?S:By("recharts"),"-clip"),j.throttleTriggeredAfterMouseMove=EJ(j.triggeredAfterMouseMove,(N=_.throttleDelay)!==null&&N!==void 0?N:1e3/60),j.state={},j}return I7e(b,w),A7e(b,[{key:"componentDidMount",value:function(){var S,N;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(N=this.props.margin.top)!==null&&N!==void 0?N:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var S=this.props,N=S.children,j=S.data,C=S.height,O=S.layout,P=Di(N,Ta);if(P){var T=P.props.defaultIndex;if(!(typeof T!="number"||T<0||T>this.state.tooltipTicks.length-1)){var $=this.state.tooltipTicks[T]&&this.state.tooltipTicks[T].value,B=yA(this.state,j,T,$),R=this.state.tooltipTicks[T].coordinate,M=(this.state.offset.top+C)/2,F=O==="horizontal",q=F?{x:R,y:M}:{y:R,x:M},V=this.state.formattedGraphicalItems.find(function(z){var H=z.item;return H.type.name==="Scatter"});V&&(q=le(le({},q),V.props.points[T].tooltipPosition),B=V.props.points[T].tooltipPayload);var W={activeTooltipIndex:T,isTooltipActive:!0,activeLabel:$,activePayload:B,activeCoordinate:q};this.setState(W),this.renderCursor(P),this.accessibilityManager.setIndex(T)}}}},{key:"getSnapshotBeforeUpdate",value:function(S,N){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==N.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==S.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==S.margin){var j,C;this.accessibilityManager.setDetails({offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0}})}return null}},{key:"componentDidUpdate",value:function(S){GO([Di(S.children,Ta)],[Di(this.props.children,Ta)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var S=Di(this.props.children,Ta);if(S&&typeof S.props.shared=="boolean"){var N=S.props.shared?"axis":"item";return o.indexOf(N)>=0?N:s}return s}},{key:"getMouseInfo",value:function(S){if(!this.container)return null;var N=this.container,j=N.getBoundingClientRect(),C=Y4e(j),O={chartX:Math.round(S.pageX-C.left),chartY:Math.round(S.pageY-C.top)},P=j.width/N.offsetWidth||1,T=this.inRange(O.chartX,O.chartY,P);if(!T)return null;var $=this.state,B=$.xAxisMap,R=$.yAxisMap,M=this.getTooltipEventType(),F=kz(this.state,this.props.data,this.props.layout,T);if(M!=="axis"&&B&&R){var q=Ll(B).scale,V=Ll(R).scale,W=q&&q.invert?q.invert(O.chartX):null,z=V&&V.invert?V.invert(O.chartY):null;return le(le({},O),{},{xValue:W,yValue:z},F)}return F?le(le({},O),F):null}},{key:"inRange",value:function(S,N){var j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,C=this.props.layout,O=S/j,P=N/j;if(C==="horizontal"||C==="vertical"){var T=this.state.offset,$=O>=T.left&&O<=T.left+T.width&&P>=T.top&&P<=T.top+T.height;return $?{x:O,y:P}:null}var B=this.state,R=B.angleAxisMap,M=B.radiusAxisMap;if(R&&M){var F=Ll(R);return YB({x:O,y:P},F)}return null}},{key:"parseEventsOfWrapper",value:function(){var S=this.props.children,N=this.getTooltipEventType(),j=Di(S,Ta),C={};j&&N==="axis"&&(j.props.trigger==="click"?C={onClick:this.handleClick}:C={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 O=Ww(this.props,this.handleOuterEvent);return le(le({},O),C)}},{key:"addListener",value:function(){eC.on(tC,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){eC.removeListener(tC,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(S,N,j){for(var C=this.state.formattedGraphicalItems,O=0,P=C.length;O<P;O++){var T=C[O];if(T.item===S||T.props.key===S.key||N===Mo(T.item.type)&&j===T.childIndex)return T}return null}},{key:"renderClipPath",value:function(){var S=this.clipPathId,N=this.state.offset,j=N.left,C=N.top,O=N.height,P=N.width;return D.createElement("defs",null,D.createElement("clipPath",{id:S},D.createElement("rect",{x:j,y:C,height:O,width:P})))}},{key:"getXScales",value:function(){var S=this.state.xAxisMap;return S?Object.entries(S).reduce(function(N,j){var C=bz(j,2),O=C[0],P=C[1];return le(le({},N),{},We({},O,P.scale))},{}):null}},{key:"getYScales",value:function(){var S=this.state.yAxisMap;return S?Object.entries(S).reduce(function(N,j){var C=bz(j,2),O=C[0],P=C[1];return le(le({},N),{},We({},O,P.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(S){var N;return(N=this.state.xAxisMap)===null||N===void 0||(N=N[S])===null||N===void 0?void 0:N.scale}},{key:"getYScaleByAxisId",value:function(S){var N;return(N=this.state.yAxisMap)===null||N===void 0||(N=N[S])===null||N===void 0?void 0:N.scale}},{key:"getItemByXY",value:function(S){var N=this.state,j=N.formattedGraphicalItems,C=N.activeItem;if(j&&j.length)for(var O=0,P=j.length;O<P;O++){var T=j[O],$=T.props,B=T.item,R=B.type.defaultProps!==void 0?le(le({},B.type.defaultProps),B.props):B.props,M=Mo(B.type);if(M==="Bar"){var F=($.data||[]).find(function(z){return MUe(S,z)});if(F)return{graphicalItem:T,payload:F}}else if(M==="RadialBar"){var q=($.data||[]).find(function(z){return YB(S,z)});if(q)return{graphicalItem:T,payload:q}}else if(iS(T,C)||sS(T,C)||Xv(T,C)){var V=wVe({graphicalItem:T,activeTooltipItem:C,itemData:R.data}),W=R.activeIndex===void 0?V:R.activeIndex;return{graphicalItem:le(le({},T),{},{childIndex:W}),payload:Xv(T,C)?R.data[V]:T.props.data[V]}}}return null}},{key:"render",value:function(){var S=this;if(!z3(this))return null;var N=this.props,j=N.children,C=N.className,O=N.width,P=N.height,T=N.style,$=N.compact,B=N.title,R=N.desc,M=wz(N,S7e),F=Ge(M,!1);if($)return D.createElement(sz,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},D.createElement(JO,Lf({},F,{width:O,height:P,title:B,desc:R}),this.renderClipPath(),H3(j,this.renderMap)));if(this.props.accessibilityLayer){var q,V;F.tabIndex=(q=this.props.tabIndex)!==null&&q!==void 0?q:0,F.role=(V=this.props.role)!==null&&V!==void 0?V:"application",F.onKeyDown=function(z){S.accessibilityManager.keyboardEvent(z)},F.onFocus=function(){S.accessibilityManager.focus()}}var W=this.parseEventsOfWrapper();return D.createElement(sz,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},D.createElement("div",Lf({className:at("recharts-wrapper",C),style:le({position:"relative",curs
884or:"default",width:O,height:P},T)},W,{ref:function(H){S.container=H}}),D.createElement(JO,Lf({},F,{width:O,height:P,title:B,desc:R,style:z7e}),this.renderClipPath(),H3(j,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(x.Component);We(y,"displayName",r),We(y,"defaultProps",le({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),We(y,"getDerivedStateFromProps",function(w,b){var _=w.dataKey,S=w.data,N=w.children,j=w.width,C=w.height,O=w.layout,P=w.stackOffset,T=w.margin,$=b.dataStartIndex,B=b.dataEndIndex;if(b.updateId===void 0){var R=Sz(w);return le(le(le({},R),{},{updateId:0},m(le(le({props:w},R),{},{updateId:0}),b)),{},{prevDataKey:_,prevData:S,prevWidth:j,prevHeight:C,prevLayout:O,prevStackOffset:P,prevMargin:T,prevChildren:N})}if(_!==b.prevDataKey||S!==b.prevData||j!==b.prevWidth||C!==b.prevHeight||O!==b.prevLayout||P!==b.prevStackOffset||!eh(T,b.prevMargin)){var M=Sz(w),F={chartX:b.chartX,chartY:b.chartY,isTooltipActive:b.isTooltipActive},q=le(le({},kz(b,S,O)),{},{updateId:b.updateId+1}),V=le(le(le({},M),F),q);return le(le(le({},V),m(le({props:w},V),b)),{},{prevDataKey:_,prevData:S,prevWidth:j,prevHeight:C,prevLayout:O,prevStackOffset:P,prevMargin:T,prevChildren:N})}if(!GO(N,b.prevChildren)){var W,z,H,G,Y=Di(N,Qh),U=Y&&(W=(z=Y.props)===null||z===void 0?void 0:z.startIndex)!==null&&W!==void 0?W:$,J=Y&&(H=(G=Y.props)===null||G===void 0?void 0:G.endIndex)!==null&&H!==void 0?H:B,te=U!==$||J!==B,re=!vt(S),ae=re&&!te?b.updateId:b.updateId+1;return le(le({updateId:ae},m(le(le({props:w},b),{},{updateId:ae,dataStartIndex:U,dataEndIndex:J}),b)),{},{prevChildren:N,dataStartIndex:U,dataEndIndex:J})}return null}),We(y,"renderActiveDot",function(w,b,_){var S;return x.isValidElement(w)?S=x.cloneElement(w,b):Je(w)?S=w(b):S=D.createElement(vR,b),D.createElement(Rt,{className:"recharts-active-dot",key:_},S)});var v=x.forwardRef(function(b,_){return D.createElement(y,Lf({},b,{ref:_}))});return v.displayName=y.displayName,v},Y7e=XX({chartName:"BarChart",GraphicalChild:Ed,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:dS},{axisType:"yAxis",AxisComp:fS}],formatAxisMap:Q9e}),X7e=XX({chartName:"PieChart",GraphicalChild:sl,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:nS},{axisType:"radiusAxis",AxisComp:tS}],formatAxisMap:Kze,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const Q7e=[{label:"Intäkter senaste 12 mån",value:"4 250 000 kr",change:"+12.3%",icon:AH,color:"hsl(142, 70%, 50%)"},{label:"Totalt denna månad",value:"385 000 kr",change:"+5.7%",icon:vc,color:"hsl(252, 80%, 65%)"},{label:"Hyresintäkter",value:"3 620 000 kr",change:"+10.8%",icon:Ss,color:"hsl(190, 100%, 45%)"},{label:"Övriga intäkter",value:"630 000 kr",change:"+18.5%",icon:Noe,color:"hsl(45, 90%, 55%)"}],nC=[{month:"Aug",value:310},{month:"Sep",value:345},{month:"Okt",value:380},{month:"Nov",value:420},{month:"Dec",value:365},{month:"Jan",value:385}],iC=[{name:"Lägenheter",value:362e4,color:"hsl(252, 80%, 65%)",pct:"85.2%"},{name:"Fotografering",value:378e3,color:"hsl(35, 90%, 55%)",pct:"8.9%"},{name:"Städning",value:252e3,color:"hsl(142, 70%, 50%)",pct:"5.9%"}],eKe=[{id:"F-2024-0147",client:"Fastighets AB Norden",amount:"45 000 kr",status:"Betald",date:"2024-01-15"},{id:"F-2024-0146",client:"Stockholms Bostäder",amount:"82 000 kr",status:"Väntar",date:"2024-01-12"},{id:"F-2024-0145",client:"Nordic Properties",amount:"35 500 kr",status:"Betald",date:"2024-01-10"},{id:"F-2024-0144",client:"Hemnet Uthyrning",amount:"28 000 kr",status:"Förfallen",date:"2024-01-08"}];function tKe(){return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Ekonomi"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Översikt över intäkter, fakturor och tjänster"})]}),l.jsxs("button",{className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-border bg-card text-sm text-foreground hover:bg-secondary transition-colors",children:[l.jsx(roe,{className:"h-4 w-4"}),"Rapporter"]})]}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:Q7e.map(t=>l.jsxs("div",{className:"bg-card border border-border rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-start justify-between mb-3",children:[l.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color}20`},children:l.jsx(t.icon,{className:"h-5 w-5",style:{color:t.color}})}),l.jsxs("span",{className:"text-xs font-semibold flex items-center gap-1",style:{color:"hsl(142, 70%, 50%)"},children:[l.jsx(AH,{className:"h-3 w-3"}),t.change]})]}),l.jsx("p",{className:"text-2xl font-bold text-foreground",children:t.value}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t.label})]},t.label))}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"bg-card border border-border rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-6",children:[l.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Intäkter per månad"}),l.jsx("span",{className:"text-xs text-muted-foreground",children:"Senaste 6 månaderna"})]}),l.jsx(F5,{width:"100%",height:220,children:l.jsxs(Y7e,{data:nC,barSize:32,children:[l.jsx($X,{strokeDasharray:"3 3",stroke:"hsl(228, 14%, 20%)",vertical:!1}
884),l.jsx(dS,{dataKey:"month",axisLine:!1,tickLine:!1,tick:{fill:"hsl(220, 10%, 55%)",fontSize:12}}),l.jsx(fS,{axisLine:!1,tickLine:!1,tick:{fill:"hsl(220, 10%, 55%)",fontSize:12},tickFormatter:t=>`${t}k`}),l.jsx(Ta,{contentStyle:{background:"hsl(228, 16%, 14%)",border:"1px solid hsl(228, 14%, 20%)",borderRadius:8,color:"#fff"},formatter:t=>[`${t}k kr`,"Intäkter"]}),l.jsx(Ed,{dataKey:"value",radius:[6,6,0,0],children:nC.map((t,e)=>l.jsx(Ev,{fill:e===nC.length-1?"hsl(252, 80%, 65%)":"hsl(252, 40%, 30%)"},e))})]})})]}),l.jsxs("div",{className:"bg-card border border-border rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-6",children:[l.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Intäkter per tjänst"}),l.jsx("span",{className:"text-xs text-muted-foreground",children:"Senaste 12 månaderna"})]}),l.jsxs("div",{className:"flex items-center gap-6",children:[l.jsxs("div",{className:"relative",children:[l.jsx(F5,{width:180,height:180,children:l.jsx(X7e,{children:l.jsx(sl,{data:iC,cx:"50%",cy:"50%",innerRadius:55,outerRadius:85,paddingAngle:3,dataKey:"value",stroke:"none",children:iC.map((t,e)=>l.jsx(Ev,{fill:t.color},e))})})}),l.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[l.jsx("span",{className:"text-xl font-bold text-foreground",children:"4.3 mkr"}),l.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Totalt"})]})]}),l.jsx("div",{className:"flex-1 space-y-4",children:iC.map(t=>l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between text-sm",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"w-2.5 h-2.5 rounded-full",style:{backgroundColor:t.color}}),l.jsx("span",{className:"text-foreground",children:t.name})]}),l.jsxs("span",{className:"font-medium text-foreground",children:[(t.value/1e3).toLocaleString("sv")," 000 kr"]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex-1 h-1.5 bg-secondary rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full rounded-full",style:{width:t.pct,backgroundColor:t.color}})}),l.jsx("span",{className:"text-[10px] text-muted-foreground w-10 text-right",children:t.pct})]})]},t.name))})]})]})]}),l.jsxs("div",{className:"bg-card border border-border rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Senaste fakturor"}),l.jsxs("button",{className:"text-xs text-primary flex items-center gap-1 hover:underline",children:["Visa alla ",l.jsx(_h,{className:"h-3 w-3"})]})]}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border text-muted-foreground",children:[l.jsx("th",{className:"text-left py-2 font-medium",children:"Faktura"}),l.jsx("th",{className:"text-left py-2 font-medium",children:"Kund"}),l.jsx("th",{className:"text-left py-2 font-medium",children:"Belopp"}),l.jsx("th",{className:"text-left py-2 font-medium",children:"Status"}),l.jsx("th",{className:"text-left py-2 font-medium",children:"Datum"})]})}),l.jsx("tbody",{children:eKe.map(t=>l.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[l.jsx("td",{className:"py-3 text-foreground font-medium",children:t.id}),l.jsx("td",{className:"py-3 text-muted-foreground",children:t.client}),l.jsx("td",{className:"py-3 text-foreground",children:t.amount}),l.jsx("td",{className:"py-3",children:l.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-[11px] font-medium ${t.status==="Betald"?"bg-green-500/10 text-green-400":t.status==="Väntar"?"bg-amber-500/10 text-amber-400":"bg-red-500/10 text-red-400"}`,children:t.status})}),l.jsx("td",{className:"py-3 text-muted-foreground",children:t.date})]},t.id))})]})})]})]})}const rKe={"/admin/inkorg":"Inkorg","/admin/anvandare":"Alla användare","/admin/foretag":"Företag","/admin/uthyrare":"Uthyrare","/admin/hyresgaster":"Hyresgäster","/admin/objekt":"Alla objekt","/admin/godkannande":"Väntar på godkännande","/admin/flaggade":"Flaggade","/admin/bokningar":"Bokningar","/admin/visningar":"Visningar","/admin/sokprofiler":"Sökprofiler"};function hl(){const{pathname:t}=Oi(),e=rKe[t]||"Sida";return l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-foreground mb-4",children:e}),l.jsx("div",{className:"bg-card border border-border/60 rounded-xl p-8 text-center",children:l.jsx("p",{className:"text-muted-foreground",children:"Denna sida är under uppbyggnad."})})]})}async function sy(){const{data:t,error:e}=await ie.from("properties").select("display_order").eq("status","approved").not("display_order","is",null).order("display_order",{ascending:!0}).limit(1).maybeSingle();if(e)throw e;return(t==null?void 0:t.display_order)==null?10:t.display_order-10}async function nKe(t){const e=await sy(),{error:r}=await ie.from("properties").update({display_order:e}).eq("id",t);if(r)throw r}function iKe(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return x.useMemo(()=>n=>{e.forEach(i=>
884i(n))},e)}const pS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Up(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function CR(t){return"nodeType"in t}function Ri(t){var e,r;return t?Up(t)?t:CR(t)&&(e=(r=t.ownerDocument)==null?void 0:r.defaultView)!=null?e:window:window}function ER(t){const{Document:e}=Ri(t);return t instanceof e}function Wy(t){return Up(t)?!1:t instanceof Ri(t).HTMLElement}function QX(t){return t instanceof Ri(t).SVGElement}function Hp(t){return t?Up(t)?t.document:CR(t)?ER(t)?t:Wy(t)||QX(t)?t.ownerDocument:document:document:document}const Ya=pS?x.useLayoutEffect:x.useEffect;function OR(t){const e=x.useRef(t);return Ya(()=>{e.current=t}),x.useCallback(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.current==null?void 0:e.current(...n)},[])}function sKe(){const t=x.useRef(null),e=x.useCallback((n,i)=>{t.current=setInterval(n,i)},[]),r=x.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,r]}function ay(t,e){e===void 0&&(e=[t]);const r=x.useRef(t);return Ya(()=>{r.current!==t&&(r.current=t)},e),r}function qy(t,e){const r=x.useRef();return x.useMemo(()=>{const n=t(r.current);return r.current=n,n},[...e])}function H1(t){const e=OR(t),r=x.useRef(null),n=x.useCallback(i=>{i!==r.current&&(e==null||e(i,r.current)),r.current=i},[]);return[r,n]}function xA(t){const e=x.useRef();return x.useEffect(()=>{e.current=t},[t]),e.current}let sC={};function Ky(t,e){return x.useMemo(()=>{if(e)return e;const r=sC[t]==null?0:sC[t]+1;return sC[t]=r,t+"-"+r},[t,e])}function eQ(t){return function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return n.reduce((s,a)=>{const o=Object.entries(a);for(const[c,u]of o){const d=s[c];d!=null&&(s[c]=d+t*u)}return s},{...e})}}const ih=eQ(1),oy=eQ(-1);function aKe(t){return"clientX"in t&&"clientY"in t}function TR(t){if(!t)return!1;const{KeyboardEvent:e}=Ri(t.target);return e&&t instanceof e}function oKe(t){if(!t)return!1;const{TouchEvent:e}=Ri(t.target);return e&&t instanceof e}function bA(t){if(oKe(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:r}=t.touches[0];return{x:e,y:r}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:r}=t.changedTouches[0];return{x:e,y:r}}}return aKe(t)?{x:t.clientX,y:t.clientY}:null}const cp=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:r}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:r}=t;return"scaleX("+e+") scaleY("+r+")"}},Transform:{toString(t){if(t)return[cp.Translate.toString(t),cp.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:r,easing:n}=t;return e+" "+r+"ms "+n}}}),Nz="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function lKe(t){return t.matches(Nz)?t:t.querySelector(Nz)}const cKe={display:"none"};function uKe(t){let{id:e,value:r}=t;return D.createElement("div",{id:e,style:cKe},r)}function dKe(t){let{id:e,announcement:r,ariaLiveType:n="assertive"}=t;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return D.createElement("div",{id:e,style:i,role:"status","aria-live":n,"aria-atomic":!0},r)}function fKe(){const[t,e]=x.useState("");return{announce:x.useCallback(n=>{n!=null&&e(n)},[]),announcement:t}}const tQ=x.createContext(null);function hKe(t){const e=x.useContext(tQ);x.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function pKe(){const[t]=x.useState(()=>new Set),e=x.useCallback(n=>(t.add(n),()=>t.delete(n)),[t]);return[x.useCallback(n=>{let{type:i,event:s}=n;t.forEach(a=>{var o;return(o=a[i])==null?void 0:o.call(a,s)})},[t]),e]}const mKe={draggable:`
885    To pick up a draggable item, press the space bar.
886    While dragging, use the arrow keys to move the item.
887    Press space again to drop the item in its new position, or press escape to cancel.
888  `},gKe={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:r}=t;return r?"Draggable item "+e.id+" was moved over droppable area "+r.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:r}=t;return r?"Draggable item "+e.id+" was dropped over droppable area "+r.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function vKe(t){let{announcements:e=gKe,container:r,hiddenTextDescribedById:n,screenReaderInstructions:i=mKe}=t;const{announce:s,announcement:a}=fKe(),o=Ky("DndLiveRegion"),[c,u]=x.useState(!1);if(x.useEffect(()=>{u(!0)},[]),hKe(x.useMemo(()=>({onDragStart(f){let{active:p}=f;s(e.onDragStart({active:p}))},onDragMove(f){let{active:p,over:m}=f;e.onDragMove&&s(e.onDragMove({active:p,over:m}))},onDragOver(f){let{active:p,over:m}=f;s(e.onDragOver({active:p,over:m}))},onDragEnd(f){let{active:p,over:m}=f;s(e.onDragEnd({active:p,over:m}))},onDragCancel(f){let{active:p,over:m}=f;s(e.onDragCancel({active:p,over:m}))}}),[s,e])),!c)return null;const d=D.createElement(D.Fragment,null,D.createElement(uKe,{id:n,value:i.draggable}),D.createElement(dKe,{id:o,announcement:a}));return r?Vi.createPortal(d,r):d}var Xr;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Xr||(Xr={}));function V1(){}function W1(t,e){return x.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function rQ(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return x.useMemo(()=>[...e].filter(n=>n!=null),[...e])}const pa=Object.freeze({x:0,y:0});function nQ(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function iQ(t,e){let{data:{value:r}}=t,{data:{value:n}}=e;return r-n}function yKe(t,e){let{data:{value:r}}=t,{data:{value:n}}=e;return n-r}function Cz(t){let{left:e,top:r,height:n,width:i}=t;return[{x:e,y:r},{x:e+i,y:r},{x:e,y:r+n},{x:e+i,y:r+n}]}function sQ(t,e){if(!t||t.length===0)return null;const[r]=t;return r[e]}function Ez(t,e,r){return e===void 0&&(e=t.left),r===void 0&&(r=t.top),{x:e+t.width*.5,y:r+t.height*.5}}const aQ=t=>{let{collisionRect:e,droppableRects:r,droppableContainers:n}=t;const i=Ez(e,e.left,e.top),s=[];for(const a of n){const{id:o}=a,c=r.get(o);if(c){const u=nQ(Ez(c),i);s.push({id:o,data:{droppableContainer:a,value:u}})}}return s.sort(iQ)},xKe=t=>{let{collisionRect:e,droppableRects:r,droppableContainers:n}=t;const i=Cz(e),s=[];for(const a of n){const{id:o}=a,c=r.get(o);if(c){const u=Cz(c),d=i.reduce((p,m,y)=>p+nQ(u[y],m),0),f=Number((d/4).toFixed(4));s.push({id:o,data:{droppableContainer:a,value:f}})}}return s.sort(iQ)};function bKe(t,e){const r=Math.max(e.top,t.top),n=Math.max(e.left,t.left),i=Math.min(e.left+e.width,t.left+t.width),s=Math.min(e.top+e.height,t.top+t.height),a=i-n,o=s-r;if(n<i&&r<s){const c=e.width*e.height,u=t.width*t.height,d=a*o,f=d/(c+u-d);return Number(f.toFixed(4))}return 0}const wKe=t=>{let{collisionRect:e,droppableRects:r,droppableContainers:n}=t;const i=[];for(const s of n){const{id:a}=s,o=r.get(a);if(o){const c=bKe(o,e);c>0&&i.push({id:a,data:{droppableContainer:s,value:c}})}}return i.sort(yKe)};function _Ke(t,e,r){return{...t,scaleX:e&&r?e.width/r.width:1,scaleY:e&&r?e.height/r.height:1}}function oQ(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:pa}function kKe(t){return function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return i.reduce((a,o)=>({...a,top:a.top+t*o.y,bottom:a.bottom+t*o.y,left:a.left+t*o.x,right:a.right+t*o.x}),{...r})}}const SKe=kKe(1);function jKe(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function NKe(t,e,r){const n=jKe(e);if(!n)return t;const{scaleX:i,scaleY:s,x:a,y:o}=n,c=t.left-a-(1-i)*parseFloat(r),u=t.top-o-(1-s)*parseFloat(r.slice(r.indexOf(" ")+1)),d=i?t.width/i:t.width,f=s?t.he
888ight/s:t.height;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c}}const CKe={ignoreTransform:!1};function Vp(t,e){e===void 0&&(e=CKe);let r=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:u,transformOrigin:d}=Ri(t).getComputedStyle(t);u&&(r=NKe(r,u,d))}const{top:n,left:i,width:s,height:a,bottom:o,right:c}=r;return{top:n,left:i,width:s,height:a,bottom:o,right:c}}function Oz(t){return Vp(t,{ignoreTransform:!0})}function EKe(t){const e=t.innerWidth,r=t.innerHeight;return{top:0,left:0,right:e,bottom:r,width:e,height:r}}function OKe(t,e){return e===void 0&&(e=Ri(t).getComputedStyle(t)),e.position==="fixed"}function TKe(t,e){e===void 0&&(e=Ri(t).getComputedStyle(t));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const s=e[i];return typeof s=="string"?r.test(s):!1})}function mS(t,e){const r=[];function n(i){if(e!=null&&r.length>=e||!i)return r;if(ER(i)&&i.scrollingElement!=null&&!r.includes(i.scrollingElement))return r.push(i.scrollingElement),r;if(!Wy(i)||QX(i)||r.includes(i))return r;const s=Ri(t).getComputedStyle(i);return i!==t&&TKe(i,s)&&r.push(i),OKe(i,s)?r:n(i.parentNode)}return t?n(t):r}function lQ(t){const[e]=mS(t,1);return e??null}function aC(t){return!pS||!t?null:Up(t)?t:CR(t)?ER(t)||t===Hp(t).scrollingElement?window:Wy(t)?t:null:null}function cQ(t){return Up(t)?t.scrollX:t.scrollLeft}function uQ(t){return Up(t)?t.scrollY:t.scrollTop}function wA(t){return{x:cQ(t),y:uQ(t)}}var ln;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(ln||(ln={}));function dQ(t){return!pS||!t?!1:t===document.scrollingElement}function fQ(t){const e={x:0,y:0},r=dQ(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},n={x:t.scrollWidth-r.width,y:t.scrollHeight-r.height},i=t.scrollTop<=e.y,s=t.scrollLeft<=e.x,a=t.scrollTop>=n.y,o=t.scrollLeft>=n.x;return{isTop:i,isLeft:s,isBottom:a,isRight:o,maxScroll:n,minScroll:e}}const AKe={x:.2,y:.2};function PKe(t,e,r,n,i){let{top:s,left:a,right:o,bottom:c}=r;n===void 0&&(n=10),i===void 0&&(i=AKe);const{isTop:u,isBottom:d,isLeft:f,isRight:p}=fQ(t),m={x:0,y:0},y={x:0,y:0},v={height:e.height*i.y,width:e.width*i.x};return!u&&s<=e.top+v.height?(m.y=ln.Backward,y.y=n*Math.abs((e.top+v.height-s)/v.height)):!d&&c>=e.bottom-v.height&&(m.y=ln.Forward,y.y=n*Math.abs((e.bottom-v.height-c)/v.height)),!p&&o>=e.right-v.width?(m.x=ln.Forward,y.x=n*Math.abs((e.right-v.width-o)/v.width)):!f&&a<=e.left+v.width&&(m.x=ln.Backward,y.x=n*Math.abs((e.left+v.width-a)/v.width)),{direction:m,speed:y}}function MKe(t){if(t===document.scrollingElement){const{innerWidth:s,innerHeight:a}=window;return{top:0,left:0,right:s,bottom:a,width:s,height:a}}const{top:e,left:r,right:n,bottom:i}=t.getBoundingClientRect();return{top:e,left:r,right:n,bottom:i,width:t.clientWidth,height:t.clientHeight}}function hQ(t){return t.reduce((e,r)=>ih(e,wA(r)),pa)}function RKe(t){return t.reduce((e,r)=>e+cQ(r),0)}function IKe(t){return t.reduce((e,r)=>e+uQ(r),0)}function LKe(t,e){if(e===void 0&&(e=Vp),!t)return;const{top:r,left:n,bottom:i,right:s}=e(t);lQ(t)&&(i<=0||s<=0||r>=window.innerHeight||n>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const $Ke=[["x",["left","right"],RKe],["y",["top","bottom"],IKe]];class AR{constructor(e,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=mS(r),i=hQ(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[s,a,o]of $Ke)for(const c of a)Object.defineProperty(this,c,{get:()=>{const u=o(n),d=i[s]-u;return this.rect[c]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Sg{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=e}add(e,r,n){var i;(i=this.target)==null||i.addEventListener(e,r,n),this.listeners.push([e,r,n])}}function DKe(t){const{EventTarget:e}=Ri(t);return t instanceof e?t:Hp(t)}function oC(t,e){const r=Math.abs(t.x),n=Math.abs(t.y);return typeof e=="number"?Math.sqrt(r**2+n**2)>e:"x"in e&&"y"in e?r>e.x&&n>e.y:"x"in e?r>e.x:"y"in e?n>e.y:!1}var gs;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(gs||(gs={}));function Tz(t){t.preventDefault()}function BKe(t){t.stopPropagation()}var bt;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(bt||(bt={}));const pQ={start:[bt.Space,bt.Enter],cancel:[bt.Esc],end:[bt.Space,bt.Enter,bt.Tab]},FKe=(t,e)=>{let{currentCoordinates:r}=e;switch(t.code){case bt.Right:return{...r,x:r.x+25};case bt.Left:return{...r,x:r.x-25};case bt.Down:return{...r,y:r.y+25};case bt.Up:return{...r,y:r.y-25}}};class gS{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:r}}=e;this.props=e,this.listeners=new Sg(Hp(r)),this.windowListeners=new Sg(Ri(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(gs.Resize,this.handleCancel),this.windowListeners.add(gs.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(gs.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:r}=this.props,n=e.node.current;n&&LKe(n),r(pa)}handleKeyDown(e){if(TR(e)){const{active:r,context:n,options:i}=this.props,{keyboardCodes:s=pQ,coordinateGetter:a=FKe,scrollBehavior:o="smooth"}=i,{code:c}=e;if(s.end.includes(c)){this.handleEnd(e);return}if(s.cancel.includes(c)){this.handleCancel(e);return}const{collisionRect:u}=n.current,d=u?{x:u.left,y:u.top}:pa;this.referenceCoordinates||(this.referenceCoordinates=d);const f=a(e,{active:r,context:n.current,currentCoordinates:d});if(f){const p=oy(f,d),m={x:0,y:0},{scrollableAncestors:y}=n.current;for(const v of y){const w=e.code,{isTop:b,isRight:_,isLeft:S,isBottom:N,maxScroll:j,minScroll:C}=fQ(v),O=MKe(v),P={x:Math.min(w===bt.Right?O.right-O.width/2:O.right,Math.max(w===bt.Right?O.left:O.left+O.width/2,f.x)),y:Math.min(w===bt.Down?O.bottom-O.height/2:O.bottom,Math.max(w===bt.Down?O.top:O.top+O.height/2,f.y))},T=w===bt.Right&&!_||w===bt.Left&&!S,$=w===bt.Down&&!N||w===bt.Up&&!b;if(T&&P.x!==f.x){const B=v.scrollLeft+p.x,R=w===bt.Right&&B<=j.x||w===bt.Left&&B>=C.x;if(R&&!p.y){v.scrollTo({left:B,behavior:o});return}R?m.x=v.scrollLeft-B:m.x=w===bt.Right?v.scrollLeft-j.x:v.scrollLeft-C.x,m.x&&v.scrollBy({left:-m.x,behavior:o});break}else if($&&P.y!==f.y){const B=v.scrollTop+p.y,R=w===bt.Down&&B<=j.y||w===bt.Up&&B>=C.y;
888if(R&&!p.x){v.scrollTo({top:B,behavior:o});return}R?m.y=v.scrollTop-B:m.y=w===bt.Down?v.scrollTop-j.y:v.scrollTop-C.y,m.y&&v.scrollBy({top:-m.y,behavior:o});break}}this.handleMove(e,ih(oy(f,this.referenceCoordinates),m))}}}handleMove(e,r){const{onMove:n}=this.props;e.preventDefault(),n(r)}handleEnd(e){const{onEnd:r}=this.props;e.preventDefault(),this.detach(),r()}handleCancel(e){const{onCancel:r}=this.props;e.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}gS.activators=[{eventName:"onKeyDown",handler:(t,e,r)=>{let{keyboardCodes:n=pQ,onActivation:i}=e,{active:s}=r;const{code:a}=t.nativeEvent;if(n.start.includes(a)){const o=s.activatorNode.current;return o&&t.target!==o?!1:(t.preventDefault(),i==null||i({event:t.nativeEvent}),!0)}return!1}}];function Az(t){return!!(t&&"distance"in t)}function Pz(t){return!!(t&&"delay"in t)}class PR{constructor(e,r,n){var i;n===void 0&&(n=DKe(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=r;const{event:s}=e,{target:a}=s;this.props=e,this.events=r,this.document=Hp(a),this.documentListeners=new Sg(this.document),this.listeners=new Sg(n),this.windowListeners=new Sg(Ri(a)),this.initialCoordinates=(i=bA(s))!=null?i:pa,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(gs.Resize,this.handleCancel),this.windowListeners.add(gs.DragStart,Tz),this.windowListeners.add(gs.VisibilityChange,this.handleCancel),this.windowListeners.add(gs.ContextMenu,Tz),this.documentListeners.add(gs.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Pz(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Az(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,r){const{active:n,onPending:i}=this.props;i(n,e,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:e}=this,{onStart:r}=this.props;e&&(this.activated=!0,this.documentListeners.add(gs.Click,BKe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(gs.SelectionChange,this.removeTextSelection),r(e))}handleMove(e){var r;const{activated:n,initialCoordinates:i,props:s}=this,{onMove:a,options:{activationConstraint:o}}=s;if(!i)return;const c=(r=bA(e))!=null?r:pa,u=oy(i,c);if(!n&&o){if(Az(o)){if(o.tolerance!=null&&oC(u,o.tolerance))return this.handleCancel();if(oC(u,o.distance))return this.handleStart()}if(Pz(o)&&oC(u,o.tolerance))return this.handleCancel();this.handlePending(o,u);return}e.cancelable&&e.preventDefault(),a(c)}handleEnd(){const{onAbort:e,onEnd:r}=this.props;this.detach(),this.activated||e(this.props.active),r()}handleCancel(){const{onAbort:e,onCancel:r}=this.props;this.detach(),this.activated||e(this.props.active),r()}handleKeydown(e){e.code===bt.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const zKe={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class vS extends PR{constructor(e){const{event:r}=e,n=Hp(r.target);super(e,zKe,n)}}vS.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:r}=t,{onActivation:n}=e;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const UKe={move:{name:"mousemove"},end:{name:"mouseup"}};var _A;(function(t){t[t.RightClick=2]="RightClick"})(_A||(_A={}));class HKe extends PR{constructor(e){super(e,UKe,Hp(e.event.target))}}HKe.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:r}=t,{onActivation:n}=e;return r.button===_A.RightClick?!1:(n==null||n({event:r}),!0)}}];const lC={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class VKe extends PR{constructor(e){super(e,lC)}static setup(){return window.addEventListener(lC.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(lC.move.name,e)};function e(){}}}VKe.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:r}=t,{onActivation:n}=e;const{touches:i}=r;return i.length>1?!1:(n==null||n({event:r}),!0)}}];var jg;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(jg||(jg={}));var q1;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="Rever
888sedTreeOrder"})(q1||(q1={}));function WKe(t){let{acceleration:e,activator:r=jg.Pointer,canScroll:n,draggingRect:i,enabled:s,interval:a=5,order:o=q1.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:p}=t;const m=KKe({delta:f,disabled:!s}),[y,v]=sKe(),w=x.useRef({x:0,y:0}),b=x.useRef({x:0,y:0}),_=x.useMemo(()=>{switch(r){case jg.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case jg.DraggableRect:return i}},[r,i,c]),S=x.useRef(null),N=x.useCallback(()=>{const C=S.current;if(!C)return;const O=w.current.x*b.current.x,P=w.current.y*b.current.y;C.scrollBy(O,P)},[]),j=x.useMemo(()=>o===q1.TreeOrder?[...u].reverse():u,[o,u]);x.useEffect(()=>{if(!s||!u.length||!_){v();return}for(const C of j){if((n==null?void 0:n(C))===!1)continue;const O=u.indexOf(C),P=d[O];if(!P)continue;const{direction:T,speed:$}=PKe(C,P,_,e,p);for(const B of["x","y"])m[B][T[B]]||($[B]=0,T[B]=0);if($.x>0||$.y>0){v(),S.current=C,y(N,a),w.current=$,b.current=T;return}}w.current={x:0,y:0},b.current={x:0,y:0},v()},[e,N,n,v,s,a,JSON.stringify(_),JSON.stringify(m),y,u,j,d,JSON.stringify(p)])}const qKe={x:{[ln.Backward]:!1,[ln.Forward]:!1},y:{[ln.Backward]:!1,[ln.Forward]:!1}};function KKe(t){let{delta:e,disabled:r}=t;const n=xA(e);return qy(i=>{if(r||!n||!i)return qKe;const s={x:Math.sign(e.x-n.x),y:Math.sign(e.y-n.y)};return{x:{[ln.Backward]:i.x[ln.Backward]||s.x===-1,[ln.Forward]:i.x[ln.Forward]||s.x===1},y:{[ln.Backward]:i.y[ln.Backward]||s.y===-1,[ln.Forward]:i.y[ln.Forward]||s.y===1}}},[r,e,n])}function GKe(t,e){const r=e!=null?t.get(e):void 0,n=r?r.node.current:null;return qy(i=>{var s;return e==null?null:(s=n??i)!=null?s:null},[n,e])}function ZKe(t,e){return x.useMemo(()=>t.reduce((r,n)=>{const{sensor:i}=n,s=i.activators.map(a=>({eventName:a.eventName,handler:e(a.handler,n)}));return[...r,...s]},[]),[t,e])}var ly;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(ly||(ly={}));var kA;(function(t){t.Optimized="optimized"})(kA||(kA={}));const Mz=new Map;function JKe(t,e){let{dragging:r,dependencies:n,config:i}=e;const[s,a]=x.useState(null),{frequency:o,measure:c,strategy:u}=i,d=x.useRef(t),f=w(),p=ay(f),m=x.useCallback(function(b){b===void 0&&(b=[]),!p.current&&a(_=>_===null?b:_.concat(b.filter(S=>!_.includes(S))))},[p]),y=x.useRef(null),v=qy(b=>{if(f&&!r)return Mz;if(!b||b===Mz||d.current!==t||s!=null){const _=new Map;for(let S of t){if(!S)continue;if(s&&s.length>0&&!s.includes(S.id)&&S.rect.current){_.set(S.id,S.rect.current);continue}const N=S.node.current,j=N?new AR(c(N),N):null;S.rect.current=j,j&&_.set(S.id,j)}return _}return b},[t,s,r,f,c]);return x.useEffect(()=>{d.current=t},[t]),x.useEffect(()=>{f||m()},[r,f]),x.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),x.useEffect(()=>{f||typeof o!="number"||y.current!==null||(y.current=setTimeout(()=>{m(),y.current=null},o))},[o,f,m,...n]),{droppableRects:v,measureDroppableContainers:m,measuringScheduled:s!=null};function w(){switch(u){case ly.Always:return!1;case ly.BeforeDragging:return r;default:return!r}}}function mQ(t,e){return qy(r=>t?r||(typeof e=="function"?e(t):t):null,[e,t])}function YKe(t,e){return mQ(t,e)}function XKe(t){let{callback:e,disabled:r}=t;const n=OR(e),i=x.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(n)},[n,r]);return x.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function yS(t){let{callback:e,disabled:r}=t;const n=OR(e),i=x.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(n)},[r]);return x.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function QKe(t){return new AR(Vp(t),t)}function Rz(t,e,r){e===void 0&&(e=QKe);const[n,i]=x.useState(null);function s(){i(c=>{if(!t)return null;if(t.isConnected===!1){var u;return(u=c??r)!=null?u:null}const d=e(t);return JSON.stringify(c)===JSON.stringify(d)?c:d})}const a=XKe({callback(c){if(t)for(const u of c){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(t)){s();break}}}}),o=yS({callback:s});return Ya(()=>{s(),t?(o==null||o.observe(t),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(o==null||o.disconnect(),a==null||a.disconnect())},[t]),n}function eGe(t){const e=mQ(t);return oQ(t,e)}const Iz=[];function tGe(t){const e=x.useRef(t),r=qy(n=>t?n&&n!==Iz&&t&&e.current&&t.parentNode===e.current.parentNode?n:mS(t):Iz,[t]);return x.useEffect(()=>{e.current=t},[t]),r}
888function rGe(t){const[e,r]=x.useState(null),n=x.useRef(t),i=x.useCallback(s=>{const a=aC(s.target);a&&r(o=>o?(o.set(a,wA(a)),new Map(o)):null)},[]);return x.useEffect(()=>{const s=n.current;if(t!==s){a(s);const o=t.map(c=>{const u=aC(c);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,wA(u)]):null}).filter(c=>c!=null);r(o.length?new Map(o):null),n.current=t}return()=>{a(t),a(s)};function a(o){o.forEach(c=>{const u=aC(c);u==null||u.removeEventListener("scroll",i)})}},[i,t]),x.useMemo(()=>t.length?e?Array.from(e.values()).reduce((s,a)=>ih(s,a),pa):hQ(t):pa,[t,e])}function Lz(t,e){e===void 0&&(e=[]);const r=x.useRef(null);return x.useEffect(()=>{r.current=null},e),x.useEffect(()=>{const n=t!==pa;n&&!r.current&&(r.current=t),!n&&r.current&&(r.current=null)},[t]),r.current?oy(t,r.current):pa}function nGe(t){x.useEffect(()=>{if(!pS)return;const e=t.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of e)r==null||r()}},t.map(e=>{let{sensor:r}=e;return r}))}function iGe(t,e){return x.useMemo(()=>t.reduce((r,n)=>{let{eventName:i,handler:s}=n;return r[i]=a=>{s(a,e)},r},{}),[t,e])}function gQ(t){return x.useMemo(()=>t?EKe(t):null,[t])}const $z=[];function sGe(t,e){e===void 0&&(e=Vp);const[r]=t,n=gQ(r?Ri(r):null),[i,s]=x.useState($z);function a(){s(()=>t.length?t.map(c=>dQ(c)?n:new AR(e(c),c)):$z)}const o=yS({callback:a});return Ya(()=>{o==null||o.disconnect(),a(),t.forEach(c=>o==null?void 0:o.observe(c))},[t]),i}function aGe(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return Wy(e)?e:t}function oGe(t){let{measure:e}=t;const[r,n]=x.useState(null),i=x.useCallback(u=>{for(const{target:d}of u)if(Wy(d)){n(f=>{const p=e(d);return f?{...f,width:p.width,height:p.height}:p});break}},[e]),s=yS({callback:i}),a=x.useCallback(u=>{const d=aGe(u);s==null||s.disconnect(),d&&(s==null||s.observe(d)),n(d?e(d):null)},[e,s]),[o,c]=H1(a);return x.useMemo(()=>({nodeRef:o,rect:r,setRef:c}),[r,o,c])}const lGe=[{sensor:vS,options:{}},{sensor:gS,options:{}}],cGe={current:{}},Xb={draggable:{measure:Oz},droppable:{measure:Oz,strategy:ly.WhileDragging,frequency:kA.Optimized},dragOverlay:{measure:Vp}};class Ng extends Map{get(e){var r;return e!=null&&(r=super.get(e))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:r}=e;return!r})}getNodeFor(e){var r,n;return(r=(n=this.get(e))==null?void 0:n.node.current)!=null?r:void 0}}const uGe={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ng,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:V1},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Xb,measureDroppableContainers:V1,windowRect:null,measuringScheduled:!1},dGe={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:V1,draggableNodes:new Map,over:null,measureDroppableContainers:V1},xS=x.createContext(dGe),vQ=x.createContext(uGe);function fGe(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ng}}}function hGe(t,e){switch(e.type){case Xr.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Xr.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case Xr.DragEnd:case Xr.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Xr.RegisterDroppable:{const{element:r}=e,{id:n}=r,i=new Ng(t.droppable.containers);return i.set(n,r),{...t,droppable:{...t.droppable,containers:i}}}case Xr.SetDroppableDisabled:{const{id:r,key:n,disabled:i}=e,s=t.droppable.containers.get(r);if(!s||n!==s.key)return t;const a=new Ng(t.droppable.containers);return a.set(r,{...s,disabled:i}),{...t,droppable:{...t.droppable,containers:a}}}case Xr.UnregisterDroppable:{const{id:r,key:n}=e,i=t.droppable.containers.get(r);if(!i||n!==i.key)return t;
888const s=new Ng(t.droppable.containers);return s.delete(r),{...t,droppable:{...t.droppable,containers:s}}}default:return t}}function pGe(t){let{disabled:e}=t;const{active:r,activatorEvent:n,draggableNodes:i}=x.useContext(xS),s=xA(n),a=xA(r==null?void 0:r.id);return x.useEffect(()=>{if(!e&&!n&&s&&a!=null){if(!TR(s)||document.activeElement===s.target)return;const o=i.get(a);if(!o)return;const{activatorNode:c,node:u}=o;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[c.current,u.current]){if(!d)continue;const f=lKe(d);if(f){f.focus();break}}})}},[n,e,i,a,s]),null}function mGe(t,e){let{transform:r,...n}=e;return t!=null&&t.length?t.reduce((i,s)=>s({transform:i,...n}),r):r}function gGe(t){return x.useMemo(()=>({draggable:{...Xb.draggable,...t==null?void 0:t.draggable},droppable:{...Xb.droppable,...t==null?void 0:t.droppable},dragOverlay:{...Xb.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function vGe(t){let{activeNode:e,measure:r,initialRect:n,config:i=!0}=t;const s=x.useRef(!1),{x:a,y:o}=typeof i=="boolean"?{x:i,y:i}:i;Ya(()=>{if(!a&&!o||!e){s.current=!1;return}if(s.current||!n)return;const u=e==null?void 0:e.node.current;if(!u||u.isConnected===!1)return;const d=r(u),f=oQ(d,n);if(a||(f.x=0),o||(f.y=0),s.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const p=lQ(u);p&&p.scrollBy({top:f.y,left:f.x})}},[e,a,o,n,r])}const yQ=x.createContext({...pa,scaleX:1,scaleY:1});var El;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(El||(El={}));const xQ=x.memo(function(e){var r,n,i,s;let{id:a,accessibility:o,autoScroll:c=!0,children:u,sensors:d=lGe,collisionDetection:f=wKe,measuring:p,modifiers:m,...y}=e;const v=x.useReducer(hGe,void 0,fGe),[w,b]=v,[_,S]=pKe(),[N,j]=x.useState(El.Uninitialized),C=N===El.Initialized,{draggable:{active:O,nodes:P,translate:T},droppable:{containers:$}}=w,B=O!=null?P.get(O):null,R=x.useRef({initial:null,translated:null}),M=x.useMemo(()=>{var hr;return O!=null?{id:O,data:(hr=B==null?void 0:B.data)!=null?hr:cGe,rect:R}:null},[O,B]),F=x.useRef(null),[q,V]=x.useState(null),[W,z]=x.useState(null),H=ay(y,Object.values(y)),G=Ky("DndDescribedBy",a),Y=x.useMemo(()=>$.getEnabled(),[$]),U=gGe(p),{droppableRects:J,measureDroppableContainers:te,measuringScheduled:re}=JKe(Y,{dragging:C,dependencies:[T.x,T.y],config:U.droppable}),ae=GKe(P,O),oe=x.useMemo(()=>W?bA(W):null,[W]),_e=Ad(),ne=YKe(ae,U.draggable.measure);vGe({activeNode:O!=null?P.get(O):null,config:_e.layoutShiftCompensation,initialRect:ne,measure:U.draggable.measure});const ue=Rz(ae,U.draggable.measure,ne),be=Rz(ae?ae.parentElement:null),Q=x.useRef({activatorEvent:null,active:null,activeNode:ae,collisionRect:null,collisions:null,droppableRects:J,draggableNodes:P,draggingNode:null,draggingNodeRect:null,droppableContainers:$,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),He=$.getNodeFor((r=Q.current.over)==null?void 0:r.id),Ie=oGe({measure:U.dragOverlay.measure}),ft=(n=Ie.nodeRef.current)!=null?n:ae,ot=C?(i=Ie.rect)!=null?i:ue:null,yt=!!(Ie.nodeRef.current&&Ie.rect),Bt=eGe(yt?null:ue),Or=gQ(ft?Ri(ft):null),xr=tGe(C?He??ae:null),ar=sGe(xr),fr=mGe(m,{transform:{x:T.x-Bt.x,y:T.y-Bt.y,scaleX:1,scaleY:1},activatorEvent:W,active:M,activeNodeRect:ue,containerNodeRect:be,draggingNodeRect:ot,over:Q.current.over,overlayNodeRect:Ie.rect,scrollableAncestors:xr,scrollableAncestorRects:ar,windowRect:Or}),qr=oe?ih(oe,T):null,Us=rGe(xr),Z=Lz(Us),Le=Lz(Us,[ue]),ht=ih(fr,Z),Qt=ot?SKe(ot,fr):null,Ft=M&&Qt?f({active:M,collisionRect:Qt,droppableRects:J,droppableContainers:Y,pointerCoordinates:qr}):null,Kr=sQ(Ft,"id"),[pi,xa]=x.useState(null),zt=yt?fr:ih(fr,Le),Zn=_Ke(zt,(s=pi==null?void 0:pi.rect)!=null?s:null,ue),rs=x.useRef(null),mi=x.useCallback((hr,or)=>{let{sensor:yn,options:Fe}=or;if(F.current==null)return;const et=P.get(F.current);if(!et)return;const lt=hr.nativeEvent,lr=new yn({active:F.current,activeNode:et,event:lt,options:Fe,context:Q,onAbort($t){if(!P.get($t))return;const{onDragAbort:cr}=H.current,Rr={id:$t};cr==null||cr(Rr),_({type:"onDragAbort",event:Rr})},onPending($t,nn,cr,Rr){if(!P.get($t))return;const{onDragPending:Pe}=H.current,Hs={id:$t,constraint:nn,initialCoordinates:cr,offset:Rr};Pe==null||Pe(Hs),_({type:"onDragPending",event:Hs})},onStart($t){const nn=F.current;if(nn==null)return;const cr=P.get(nn);if(!cr)return;const{onDragStart:Rr}=H.current,Pn={activatorEvent:lt,active:{id:nn,data:cr.data,rect:R}};Vi.unstable_batchedUpdates(()=>{Rr==null||Rr(Pn),j(El.Initializing),b({type:Xr.DragStart,initialCoordinates:$t,active:nn}
888),_({type:"onDragStart",event:Pn}),V(rs.current),z(lt)})},onMove($t){b({type:Xr.DragMove,coordinates:$t})},onEnd:br(Xr.DragEnd),onCancel:br(Xr.DragCancel)});rs.current=lr;function br($t){return async function(){const{active:cr,collisions:Rr,over:Pn,scrollAdjustedTranslate:Pe}=Q.current;let Hs=null;if(cr&&Pe){const{cancelDrop:al}=H.current;Hs={activatorEvent:lt,active:cr,collisions:Rr,delta:Pe,over:Pn},$t===Xr.DragEnd&&typeof al=="function"&&await Promise.resolve(al(Hs))&&($t=Xr.DragCancel)}F.current=null,Vi.unstable_batchedUpdates(()=>{b({type:$t}),j(El.Uninitialized),xa(null),V(null),z(null),rs.current=null;const al=$t===Xr.DragEnd?"onDragEnd":"onDragCancel";if(Hs){const Pd=H.current[al];Pd==null||Pd(Hs),_({type:al,event:Hs})}})}}},[P]),ns=x.useCallback((hr,or)=>(yn,Fe)=>{const et=yn.nativeEvent,lt=P.get(Fe);if(F.current!==null||!lt||et.dndKit||et.defaultPrevented)return;const lr={active:lt};hr(yn,or.options,lr)===!0&&(et.dndKit={capturedBy:or.sensor},F.current=Fe,mi(yn,or))},[P,mi]),Od=ZKe(d,ns);nGe(d),Ya(()=>{ue&&N===El.Initializing&&j(El.Initialized)},[ue,N]),x.useEffect(()=>{const{onDragMove:hr}=H.current,{active:or,activatorEvent:yn,collisions:Fe,over:et}=Q.current;if(!or||!yn)return;const lt={active:or,activatorEvent:yn,collisions:Fe,delta:{x:ht.x,y:ht.y},over:et};Vi.unstable_batchedUpdates(()=>{hr==null||hr(lt),_({type:"onDragMove",event:lt})})},[ht.x,ht.y]),x.useEffect(()=>{const{active:hr,activatorEvent:or,collisions:yn,droppableContainers:Fe,scrollAdjustedTranslate:et}=Q.current;if(!hr||F.current==null||!or||!et)return;const{onDragOver:lt}=H.current,lr=Fe.get(Kr),br=lr&&lr.rect.current?{id:lr.id,rect:lr.rect.current,data:lr.data,disabled:lr.disabled}:null,$t={active:hr,activatorEvent:or,collisions:yn,delta:{x:et.x,y:et.y},over:br};Vi.unstable_batchedUpdates(()=>{xa(br),lt==null||lt($t),_({type:"onDragOver",event:$t})})},[Kr]),Ya(()=>{Q.current={activatorEvent:W,active:M,activeNode:ae,collisionRect:Qt,collisions:Ft,droppableRects:J,draggableNodes:P,draggingNode:ft,draggingNodeRect:ot,droppableContainers:$,over:pi,scrollableAncestors:xr,scrollAdjustedTranslate:ht},R.current={initial:ot,translated:Qt}},[M,ae,Ft,Qt,P,ft,ot,J,$,pi,xr,ht]),WKe({..._e,delta:T,draggingRect:Qt,pointerCoordinates:qr,scrollableAncestors:xr,scrollableAncestorRects:ar});const Td=x.useMemo(()=>({active:M,activeNode:ae,activeNodeRect:ue,activatorEvent:W,collisions:Ft,containerNodeRect:be,dragOverlay:Ie,draggableNodes:P,droppableContainers:$,droppableRects:J,over:pi,measureDroppableContainers:te,scrollableAncestors:xr,scrollableAncestorRects:ar,measuringConfiguration:U,measuringScheduled:re,windowRect:Or}),[M,ae,ue,W,Ft,be,Ie,P,$,J,pi,te,xr,ar,U,re,Or]),qc=x.useMemo(()=>({activatorEvent:W,activators:Od,active:M,activeNodeRect:ue,ariaDescribedById:{draggable:G},dispatch:b,draggableNodes:P,over:pi,measureDroppableContainers:te}),[W,Od,M,ue,b,G,P,pi,te]);return D.createElement(tQ.Provider,{value:S},D.createElement(xS.Provider,{value:qc},D.createElement(vQ.Provider,{value:Td},D.createElement(yQ.Provider,{value:Zn},u)),D.createElement(pGe,{disabled:(o==null?void 0:o.restoreFocus)===!1})),D.createElement(vKe,{...o,hiddenTextDescribedById:G}));function Ad(){const hr=(q==null?void 0:q.autoScrollEnabled)===!1,or=typeof c=="object"?c.enabled===!1:c===!1,yn=C&&!hr&&!or;return typeof c=="object"?{...c,enabled:yn}:{enabled:yn}}}),yGe=x.createContext(null),Dz="button",xGe="Draggable";function bGe(t){let{id:e,data:r,disabled:n=!1,attributes:i}=t;const s=Ky(xGe),{activators:a,activatorEvent:o,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:p}=x.useContext(xS),{role:m=Dz,roleDescription:y="draggable",tabIndex:v=0}=i??{},w=(c==null?void 0:c.id)===e,b=x.useContext(w?yQ:yGe),[_,S]=H1(),[N,j]=H1(),C=iGe(a,e),O=ay(r);Ya(()=>(f.set(e,{id:e,key:s,node:_,activatorNode:N,data:O}),()=>{const T=f.get(e);T&&T.key===s&&f.delete(e)}),[f,e]);const P=x.useMemo(()=>({role:m,tabIndex:v,"aria-disabled":n,"aria-pressed":w&&m===Dz?!0:void 0,"aria-roledescription":y,"aria-describedby":d.draggable}),[n,m,v,w,y,d.draggable]);return{active:c,activatorEvent:o,activeNodeRect:u,attributes:P,isDragging:w,listeners:n?void 0:C,node:_,over:p,setNodeRef:S,setActivatorNodeRef:j,transform:b}}function wGe(){return x.useContext(vQ)}const _Ge="Droppable",kGe={timeout:25};function SGe(t){let{data:e,disabled:r=!1,id:n,resizeObserverConfig:i}=t;const s=Ky(_Ge),{active:a,dispatch:o,over:c,measureDroppableContainers:u}=x.useContext(xS),d=x.useRef({disabled:r}),f=x.useRef(!1),p=x.useRef(null),m=x.useRef(null),{disabled:y,updateMeasurementsFor:v,timeout:w}={...kGe,...i},b=ay(v??n),_=x.useCallback(()=>
888{if(!f.current){f.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{u(Array.isArray(b.current)?b.current:[b.current]),m.current=null},w)},[w]),S=yS({callback:_,disabled:y||!a}),N=x.useCallback((P,T)=>{S&&(T&&(S.unobserve(T),f.current=!1),P&&S.observe(P))},[S]),[j,C]=H1(N),O=ay(e);return x.useEffect(()=>{!S||!j.current||(S.disconnect(),f.current=!1,S.observe(j.current))},[j,S]),x.useEffect(()=>(o({type:Xr.RegisterDroppable,element:{id:n,key:s,disabled:r,node:j,rect:p,data:O}}),()=>o({type:Xr.UnregisterDroppable,key:s,id:n})),[n]),x.useEffect(()=>{r!==d.current.disabled&&(o({type:Xr.SetDroppableDisabled,id:n,key:s,disabled:r}),d.current.disabled=r)},[n,s,r,o]),{active:a,rect:p,isOver:(c==null?void 0:c.id)===n,node:j,over:c,setNodeRef:C}}function bS(t,e,r){const n=t.slice();return n.splice(r<0?n.length+r:r,0,n.splice(e,1)[0]),n}function jGe(t,e){return t.reduce((r,n,i)=>{const s=e.get(n);return s&&(r[i]=s),r},Array(t.length))}function bb(t){return t!==null&&t>=0}function NGe(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function CGe(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const MR=t=>{let{rects:e,activeIndex:r,overIndex:n,index:i}=t;const s=bS(e,n,r),a=e[i],o=s[i];return!o||!a?null:{x:o.left-a.left,y:o.top-a.top,scaleX:o.width/a.width,scaleY:o.height/a.height}},wb={scaleX:1,scaleY:1},EGe=t=>{var e;let{activeIndex:r,activeNodeRect:n,index:i,rects:s,overIndex:a}=t;const o=(e=s[r])!=null?e:n;if(!o)return null;if(i===r){const u=s[a];return u?{x:0,y:r<a?u.top+u.height-(o.top+o.height):u.top-o.top,...wb}:null}const c=OGe(s,i,r);return i>r&&i<=a?{x:0,y:-o.height-c,...wb}:i<r&&i>=a?{x:0,y:o.height+c,...wb}:{x:0,y:0,...wb}};function OGe(t,e,r){const n=t[e],i=t[e-1],s=t[e+1];return n?r<e?i?n.top-(i.top+i.height):s?s.top-(n.top+n.height):0:s?s.top-(n.top+n.height):i?n.top-(i.top+i.height):0:0}const bQ="Sortable",wQ=D.createContext({activeIndex:-1,containerId:bQ,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:MR,disabled:{draggable:!1,droppable:!1}});function _Q(t){let{children:e,id:r,items:n,strategy:i=MR,disabled:s=!1}=t;const{active:a,dragOverlay:o,droppableRects:c,over:u,measureDroppableContainers:d}=wGe(),f=Ky(bQ,r),p=o.rect!==null,m=x.useMemo(()=>n.map(C=>typeof C=="object"&&"id"in C?C.id:C),[n]),y=a!=null,v=a?m.indexOf(a.id):-1,w=u?m.indexOf(u.id):-1,b=x.useRef(m),_=!NGe(m,b.current),S=w!==-1&&v===-1||_,N=CGe(s);Ya(()=>{_&&y&&d(m)},[_,m,y,d]),x.useEffect(()=>{b.current=m},[m]);const j=x.useMemo(()=>({activeIndex:v,containerId:f,disabled:N,disableTransforms:S,items:m,overIndex:w,useDragOverlay:p,sortedRects:jGe(m,c),strategy:i}),[v,f,N.draggable,N.droppable,S,m,w,c,p,i]);return D.createElement(wQ.Provider,{value:j},e)}const TGe=t=>{let{id:e,items:r,activeIndex:n,overIndex:i}=t;return bS(r,n,i).indexOf(e)},AGe=t=>{let{containerId:e,isSorting:r,wasDragging:n,index:i,items:s,newIndex:a,previousItems:o,previousContainerId:c,transition:u}=t;return!u||!n||o!==s&&i===a?!1:r?!0:a!==i&&e===c},PGe={duration:200,easing:"ease"},kQ="transform",MGe=cp.Transition.toString({property:kQ,duration:0,easing:"linear"}),RGe={roleDescription:"sortable"};function IGe(t){let{disabled:e,index:r,node:n,rect:i}=t;const[s,a]=x.useState(null),o=x.useRef(r);return Ya(()=>{if(!e&&r!==o.current&&n.current){const c=i.current;if(c){const u=Vp(n.current,{ignoreTransform:!0}),d={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(d.x||d.y)&&a(d)}}r!==o.current&&(o.current=r)},[e,r,n,i]),x.useEffect(()=>{s&&a(null)},[s]),s}function SQ(t){let{animateLayoutChanges:e=AGe,attributes:r,disabled:n,data:i,getNewIndex:s=TGe,id:a,strategy:o,resizeObserverConfig:c,transition:u=PGe}=t;const{items:d,containerId:f,activeIndex:p,disabled:m,disableTransforms:y,sortedRects:v,overIndex:w,useDragOverlay:b,strategy:_}=x.useContext(wQ),S=LGe(n,m),N=d.indexOf(a),j=x.useMemo(()=>({sortable:{containerId:f,index:N,items:d},...i}),[f,i,N,d]),C=x.useMemo(()=>d.slice(d.indexOf(a)),[d,a]),{rect:O,node:P,isOver:T,setNodeRef:$}=SGe({id:a,data:j,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...c}}),{active:B,activatorEvent:R,activeNodeRect:M,attributes:F,setNodeRef:q,listeners:V,isDragging:W,over:z,setActivatorNodeRef:H,transform:G}=bGe({id:a,data:j,attributes:{...RGe,...r},disabled:S.draggable}),Y=iKe($,q),U=!!B,J=U&&!y&&bb(p)&&bb(w),te=!b&&W,re=te&&J?G:null,oe=J?re??(o??_)({rects:v,activeNodeRect:M,activeIndex:p,overIndex:w,index:N}):null,_e=bb(p)&&bb(w)?s({id:a,items:d,activeIndex:p,overIndex:w}):N,ne=B==null?void 0:B.id,ue=x.useRef({activeId:ne,items:d,newIndex:_e,containerId:f}),be=d!==ue.current.items,Q=e({active:B,containerId:f,isDragging:W,isSorting:U,id:a,index:N,items:d,newIndex:ue.current.newIndex,previousItems:ue.current.items,previousContainerId:ue.current.containerId,transition:u,wasDragging:ue.current.activeId!=null}),He=IGe({disabled:!Q,index:N,node:P,rect:O});return x.useEffect(()=>{U&&ue.current.newIndex!==_e&&(ue.current.newIndex=_e),f!==ue.current.containerId&&(ue.current.containerId=f),d!==ue.current.items&&(ue.current.items=d)},[U,_e,f,d]),x.useEffect(()=>{if(ne===ue.current.activeId)return;if(ne!=null&&ue.current.activeId==null){ue.current.activeId=ne;return}const ft=setTimeout(()=>{ue.current.activeId=ne},50);return()=>clearTimeout(ft)},[ne]),{active:B,activeIndex:p,attributes:F,data:j,rect:O,index:N,newIndex:_e,items:d,isOver:T,isSorting:U,isDragging:W,listeners:V,node:P,overIndex:w,over:z,setNodeRef:Y,setActivatorNodeRef:H,setDroppableNodeRef:$,setDraggableNodeRef:q,transform:He??oe,transition:Ie()};function Ie(){if(He||be&&ue.current.newIndex===N)return MGe;if(!(te&&!TR(R)||!u)&&(U||Q))return cp.Transition.toString({...u,property:kQ})}}function LGe(t,e){var r,n;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(r=t==null?void 0:t.draggable)!=null?r:e.draggable,droppable:(n=t==null?void 0:t.droppable)!=null?n:e.droppable}}function K1(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.
888sortable)}const $Ge=[bt.Down,bt.Right,bt.Up,bt.Left],jQ=(t,e)=>{let{context:{active:r,collisionRect:n,droppableRects:i,droppableContainers:s,over:a,scrollableAncestors:o}}=e;if($Ge.includes(t.code)){if(t.preventDefault(),!r||!n)return;const c=[];s.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const p=i.get(f.id);if(p)switch(t.code){case bt.Down:n.top<p.top&&c.push(f);break;case bt.Up:n.top>p.top&&c.push(f);break;case bt.Left:n.left>p.left&&c.push(f);break;case bt.Right:n.left<p.left&&c.push(f);break}});const u=xKe({active:r,collisionRect:n,droppableRects:i,droppableContainers:c,pointerCoordinates:null});let d=sQ(u,"id");if(d===(a==null?void 0:a.id)&&u.length>1&&(d=u[1].id),d!=null){const f=s.get(r.id),p=s.get(d),m=p?i.get(p.id):null,y=p==null?void 0:p.node.current;if(y&&m&&f&&p){const w=mS(y).some((C,O)=>o[O]!==C),b=NQ(f,p),_=DGe(f,p),S=w||!b?{x:0,y:0}:{x:_?n.width-m.width:0,y:_?n.height-m.height:0},N={x:m.left,y:m.top};return S.x&&S.y?N:oy(N,S)}}}};function NQ(t,e){return!K1(t)||!K1(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function DGe(t,e){return!K1(t)||!K1(e)||!NQ(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}const BGe=({image:t,index:e,onRemove:r})=>{const{attributes:n,listeners:i,setNodeRef:s,transform:a,transition:o,isDragging:c}=SQ({id:t.id});return l.jsxs("div",{ref:s,style:{transform:cp.Transform.toString(a),transition:o},className:`relative group aspect-square rounded-md overflow-hidden bg-muted border border-border/60 ${c?"ring-2 ring-primary z-10 opacity-90":""}`,children:[l.jsx("img",{src:t.url,alt:"",className:"w-full h-full object-cover pointer-events-none"}),e===0&&l.jsx("span",{className:"absolute bottom-1 left-1 bg-primary text-primary-foreground text-[10px] font-semibold px-1.5 py-0.5 rounded",children:"Huvudbild"}),l.jsx("button",{type:"button",...n,...i,"aria-label":"Flytta bild",className:"absolute top-1 left-1 w-6 h-6 rounded-full bg-background/85 text-foreground flex items-center justify-center cursor-grab active:cursor-grabbing touch-none sm:opacity-0 sm:group-hover:opacity-100 transition-opacity",children:l.jsx(jH,{className:"h-3.5 w-3.5"})}),l.jsx("button",{type:"button",onClick:()=>r(t.id),"aria-label":"Ta bort bild",className:"absolute top-1 right-1 w-6 h-6 rounded-full bg-destructive text-destructive-foreground flex items-center justify-center sm:opacity-0 sm:group-hover:opacity-100 transition-opacity",children:l.jsx(Wi,{className:"h-3 w-3"})})]})},RR=({images:t,onReorder:e,onRemove:r,className:n})=>{const i=rQ(W1(vS,{activationConstraint:{distance:4}}),W1(gS,{coordinateGetter:jQ})),s=a=>{const{active:o,over:c}=a;if(!c||o.id===c.id)return;const u=t.findIndex(f=>f.id===o.id),d=t.findIndex(f=>f.id===c.id);u===-1||d===-1||e(bS(t,u,d))};return t.length===0?null:l.jsx(xQ,{sensors:i,collisionDetection:aQ,onDragEnd:s,children:l.jsx(_Q,{items:t.map(a=>a.id),strategy:MR,children:l.jsx("div",{className:n??"grid grid-cols-3 sm:grid-cols-4 gap-2",children:t.map((a,o)=>l.jsx(BGe,{image:a,index:o,onRemove:r},a.id))})})})},FGe=["lägenhet","villa","radhus","tomt","fritidshus","rum"],zGe=[{value:"pending",label:"Väntar på godkännande"},{value:"approved",label:"Godkänd / Publik"},{value:"rented",label:"Uthyrd"},{value:"rejected",label:"Avvisad"}],UGe=["Balkong","Diskmaskin","Tvättmaskin","Torktumlare","Hiss","Parkering","Kabel-TV","Bredband","Förråd","Husdjur tillåtna"],HGe=["El","Värme","Vatten","Bredband","Kabel-TV","Hushållsel"];function wS({propertyId:t,open:e,onOpenChange:r,onSaved:n}){const[i,s]=x.useState(!1),[a,o]=x.useState(!1),{cities:c}=Ep(),[u,d]=x.useState(!1),[f,p]=x.useState(null),[m,y]=x.useState(null),[v,w]=x.useState([]),[b,_]=x.useState(!1),[S,N]=x.useState("");x.useEffect(()=>{!e||!t||(async()=>{s(!0),_(!1);const[{data:T},{data:$}]=await Promise.all([ie.from("properties").select("*").eq("id",t).maybeSingle(),ie.from("profiles").select("user_id, first_name, last_name").order("first_name")]);p(T),N((T==null?void 0:T.rooms)!=null?String(T.rooms).replace(".",","):""),y((T==null?void 0:T.status)??null),w($||[]),s(!1)})()},[e,t]);const j=T=>p($=>$&&{...$,...T}),C=(T,$)=>
888{if(!f)return;const B=f[T]||[],R=B.includes($)?B.filter(M=>M!==$):[...B,$];j({[T]:R})},O=async()=>{if(!(f!=null&&f.id))return;d(!0);const{id:T,created_at:$,updated_at:B,...R}=f;if(m!=="approved"&&R.status==="approved")try{R.display_order=await sy()}catch{d(!1),ke.error("Kunde inte placera objektet högst upp");return}if(b)try{R.display_order=await sy()}catch{d(!1),ke.error("Kunde inte placera objektet högst upp");return}const{error:M}=await ie.from("properties").update(R).eq("id",T);if(d(!1),M){ke.error("Kunde inte spara: "+M.message);return}ke.success(b?"Objektet har uppdaterats och placerats överst":"Objektet har uppdaterats"),n==null||n(),r(!1)},P=async T=>{if(!T.target.files||!f)return;const $=Array.from(T.target.files);if(T.target.value="",!f.user_id){ke.error("Objektet saknar ägare – välj en ägare först.");return}o(!0);try{const B=[];for(const R of $){const M=R.name.split(".").pop(),F=`${f.user_id}/${crypto.randomUUID()}.${M}`,{error:q}=await ie.storage.from("property-images").upload(F,R);if(q)throw q;const{data:{publicUrl:V}}=ie.storage.from("property-images").getPublicUrl(F);B.push(V)}j({images:[...f.images||[],...B]}),ke.success(`${B.length} bild(er) uppladdade`)}catch(B){ke.error("Uppladdning misslyckades: "+B.message)}finally{o(!1)}};return l.jsx(Xi,{open:e,onOpenChange:r,children:l.jsxs(Ei,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[l.jsx(Ms,{children:l.jsxs(Rs,{className:"flex items-center gap-2",children:[l.jsx(P0,{className:"h-4 w-4 text-primary"}),"Redigera objekt (admin)"]})}),i||!f?l.jsx("div",{className:"py-12 text-center text-muted-foreground",children:"Laddar…"}):l.jsxs("div",{className:"space-y-6 py-2",children:[l.jsxs("section",{className:"bg-primary/5 border border-primary/20 rounded-lg p-4 space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(P0,{className:"h-4 w-4 text-primary"}),l.jsx("h3",{className:"font-semibold text-sm text-foreground",children:"Adminfält"}),l.jsx(Vt,{variant:"outline",className:"text-xs",children:"Endast synligt för admin"})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsx(_r,{label:"Status",children:l.jsxs(Nt,{value:f.status||"",onValueChange:T=>j({status:T}),children:[l.jsx(_t,{children:l.jsx(Ct,{})}),l.jsx(kt,{children:zGe.map(T=>l.jsx(De,{value:T.value,children:T.label},T.value))})]})}),l.jsx(_r,{label:"Ägare (uthyrare)",children:l.jsxs(Nt,{value:f.user_id||"",onValueChange:T=>j({user_id:T}),children:[l.jsx(_t,{children:l.jsx(Ct,{})}),l.jsx(kt,{children:v.map(T=>l.jsxs(De,{value:T.user_id,children:[T.first_name," ",T.last_name]},T.user_id))})]})}),l.jsx(_r,{label:"Prioritera",children:l.jsxs("div",{className:"flex items-center gap-2 h-10",children:[l.jsx(Ls,{id:"bump-to-top",checked:b,onCheckedChange:T=>_(!!T)}),l.jsx("label",{htmlFor:"bump-to-top",className:"text-sm text-foreground cursor-pointer select-none",children:"Visa överst som senast ändrat"})]})})]}),l.jsx(_r,{label:"Ansvarig uthyrare (visas på objektsidan)",children:l.jsxs(Nt,{value:f.assigned_agent||"annelie",onValueChange:T=>j({assigned_agent:T}),children:[l.jsx(_t,{children:l.jsx(Ct,{})}),l.jsx(kt,{children:Oq.map(T=>l.jsx(De,{value:T.key,children:T.name},T.key))})]})}),l.jsx(_r,{label:"Interna anteckningar",children:l.jsx(Is,{value:f.admin_notes||"",onChange:T=>j({admin_notes:T.target.value}),placeholder:"Synliga endast för admin – t.ex. anledning till avvisning, kontakt med uthyraren…",rows:3})}),f.status==="rented"&&l.jsx(_r,{label:"Uthyrd till och med (datum, valfritt)",children:l.jsx(ce,{type:"date",value:f.rented_until||"",onChange:T=>j({rented_until:T.target.value||null})})})]}),l.jsx(pl,{title:"Grunduppgifter",children:l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsx(_r,{label:"Bostadstyp",children:l.jsxs(Nt,{value:f.property_type||"",onValueChange:T=>j({property_type:T}),children:[l.jsx(_t,{children:l.jsx(Ct,{})}),l.jsx(kt,{children:FGe.map(T=>l.jsx(De,{value:T,children:T},T))})]})}),l.jsx(_r,{label:"Antal rum",children:l.jsx(ce,{type:"text",inputMode:"decimal",placeholder:"ex. 2 eller 2,5",value:S,onChange:T=>{const $=T.target.value.replace(/[^\d.,]/g,"");N($);const B=Number($.replace(",","."));j({rooms:$===""||isNaN(B)?null:B})}})}),l.jsx(_r,{label:"Sovrum",children:l.jsx(ce,{type:"number",min:0,value:f.bedrooms??"",onChange:T=>j({bedrooms:T.target.value?Number(T.target.value):null})})}),l.jsx(_r,{label:"Badrum",children:l.jsx(ce,{type:"number",min:0,value:f.bathrooms??"",onChange:T=>j({bathrooms:T.target.value?Number(T.target.value):null})})}),l.jsx(_r,{label:"Yta (m²)",children:l.jsx(ce,{type:"number",min:0,value:f.area_sqm??"",onChange:T=>j({area_sqm:T.target.value?Number(T.target.value):null})})}),l.jsx(_r,{label:"Biyta (m²)",children:l.jsx(ce,{type:"number",min:0,value:f.secondary_area_sqm??"",onChange:T=>j({secondary_area_sqm:T.target.value?Number(T.target.value):null})})}),l.jsx(_r,{label:"Trädgård (m²)",children:l.jsx(ce,{type:"number",min:0,value:f.garden_sqm??"",onChange:T=>j({garden_sqm:T.target.value?Number(T.target.value):null})})}),l.jsx(_r,{label:"Våning",children:l.jsx(ce,{value:f.floor||"",onChange:T=>j({floor:T.target.value})})}),l.jsx(_r,{label:"Byggår",children:l.jsx(ce,{type:"number",value:f.built_year??"",onChange:T=>j({built_year:T.target.value?Number(T.target.value):null})})}),l.jsx(_r,{label:"Renoverat år",children:l.jsx(ce,{type:"number",value:f.renovated_year??"",onChange:T=>j({renovated_year:T.target.value?Number(T.target.value):null})})})]})}),l.jsx(pl,{title:"Adress",children:l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsx(_r,{label:"Gatuadress",full:!0,children:l.jsx(ce,{value:f.street_address||"",onChange:T=>j({street_address:T.target.value})})}),l.jsx(_r,{label:"Postnummer",children:l.jsx(ce,{value:f.postal_code||"",onChange:T=>j({postal_code:T.target.value})})}),l.jsx(_r,{label:"Stad",children:l.jsx(H_,{value:f.city||"",onChange:T=>j({city:T}),options:c,placeholder:"Välj stad"})}),l.jsx(_r,{label:"Portkod (intern)",children:l.jsx(ce,{value:f.door_code||"",onChange:T=>j({door_code:T.target.value})})})]})}),l.jsx(pl,{title:"Hyra & möblering",children:l.jsxs("div",{className:"space-y-3",children:[l.jsx(uC,{label:"Möblerad",checked:!!f.furnished,rent:f.furnished_rent,onCheck:T=>j({furnished:T}),onRent:T=>j({furnished_rent:T})}),l.jsx(uC,{label:"Omöblerad",checked:!!f.unfurnished,rent:f.unfurnished_rent,onCheck:T=>j({unfurnished:T}),onRent:T=>j({unfurnished_rent:T})}),l.jsx(uC,{label:"Delvis möblerad",checked:!!f.partially_furnished,rent:f.partially_furnished_rent,onCheck:T=>j({partially_furnished:T}),onRent:T=>j({partially_furnished_rent:T})})]})}),l.jsxs(pl,{title:"Tillträde & avflyttning",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsx(_r,{label:"Inflyttningsdatum",children:l.jsx(ce,{type:"date",value:f.move_in_date||"",onChange:T=>j({move_in_date:T.target.value||null})})}),l.jsx(_r,{label:"Utflyttningsdatum",children:l.jsx(ce,{type:"date",value:f.move_out_date||"",onChange:T=>j({move_out_date:T.target.value||null})})})]}),l.jsxs("div",{className:"flex gap-4 mt-3",children:[l.jsx(cC,{label:"Omgående",checked:!!f.immediate,onChange:T=>j({immediate:T})}),l.jsx(cC,{label:"Tillsvidare",checked:!!f.indefinite,onChange:T=>j({indefinite:T})}),l.jsx(cC,{label:"Eventuellt längre",checked:!!f.possibly_longer,onChange:T=>j({possibly_longer:T})})]})]}),l.jsx(pl,{title:"Bekvämligheter",children:l.jsx("div",{className:"flex flex-wrap gap-2",children:UGe.map(T=>{const $=(f.amenities||[]).includes(T);return l.jsx("button",{type:"button",onClick:()=>C("amenities",T),className:`px-3 py-1.5 text-xs rounded-full border transition-colors ${$?"bg-primary text-primary-foreground border-primary":"bg-background border-border hover:bg-secondary"}`,children:T},T)})})}),l.jsx(pl,{title:"Ingår i hyran",children:l.jsx("div",{className:"flex flex-wrap gap-2",children:HGe.map(T=>{const $=(f.included_in_rent||[]).includes(T);return l.jsx("button",{type:"button",onClick:()=>C("included_in_rent",T),className:`px-3 py-1.5 text-xs rounded-full border transition-colors ${$?"bg-primary text-primary-foreground border-primary":"bg-background border-border hover:bg-secondary"}`,children:T},T)})})}),l.jsx(pl,{title:"Beskrivning",children:l.jsx(Is,{rows:6,value:f.description||"",onChange:T=>j({description:T.target.value})})}),l.jsxs(pl,{title:`Bilder (${(f.images||[]).length})`,children:[(f.images||[]).length===0?l.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Inga bilder uppladdade."}):l.jsx("div",{className:"mb-3",children:l.jsx(RR,{images:(f.images||[]).map((T,$)=>({id:`${$}-${T}`,url:T})),onReorder:T=>j({images:T.map($=>$.url)}),onRemove:T=>j({images:(f.images||[]).filter(($,B)=>`${B}-${$}`!==T)})})}),l.jsxs("label",{className:"inline-flex items-center gap-2 px-3 py-2 rounded-md border border-dashed border-border hover:bg-secondary cursor-pointer text-sm",children:[l.jsx($P,{className:"h-4 w-4"}),a?"Laddar upp…":"Lägg till bilder",l.jsx("input",{type:"file",accept:"image/*",multiple:!0,className:"hidden",disabled:a,onChange:P})]}),l.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:'Dra i handtaget för att ändra ordning – första bilden blir huvudbild. Klicka "Spara ändringar" nedan för att bekräfta.'})]})]}),l.jsxs(Vo,{className:"border-t pt-4",children:[l.jsx(se,{variant:"ghost",onClick:()=>r(!1),children:"Avbryt"}),l.jsxs(se,{onClick:O,disabled:u||i,className:"gap-2",children:[l.jsx(IP,{className:"h-4 w-4"}),u?"Sparar…":"Spara ändringar"]})]})]})})}function pl({title:t,children:e}){return l.jsxs("section",{children:[l.jsx("h3",{className:"font-semibold text-sm text-foreground mb-3",children:t}),e]})}function _r({label:t,children:e,full:r}
888){return l.jsxs("div",{className:`space-y-1.5 ${r?"col-span-2":""}`,children:[l.jsx(Ve,{className:"text-xs text-muted-foreground",children:t}),e]})}function cC({label:t,checked:e,onChange:r}){return l.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[l.jsx(Ls,{checked:e,onCheckedChange:n=>r(!!n)}),t]})}function uC({label:t,checked:e,rent:r,onCheck:n,onRent:i}){return l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer w-40",children:[l.jsx(Ls,{checked:e,onCheckedChange:s=>n(!!s)}),t]}),l.jsx(ce,{type:"number",placeholder:"Hyra kr/mån",value:r??"",onChange:s=>i(s.target.value?Number(s.target.value):null),onWheel:s=>s.currentTarget.blur(),disabled:!e,className:"max-w-xs"})]})}const VGe=t=>{const e={approved:"bg-green-500/15 text-green-600",pending:"bg-yellow-500/15 text-yellow-600",rented:"bg-blue-500/15 text-blue-600",rejected:"bg-red-500/15 text-red-600"},r={approved:"Godkänt",pending:"Väntar",rented:"Uthyrt",rejected:"Avvisat"};return l.jsx(Vt,{className:`${e[t]||""} border-0`,children:r[t]||t})};function CQ({userId:t,name:e,email:r,phone:n,open:i,onOpenChange:s}){const[a,o]=x.useState([]),[c,u]=x.useState(!1),[d,f]=x.useState(null),p=async()=>{if(!t)return;u(!0);const{data:m}=await ie.from("properties").select("*").eq("user_id",t).order("created_at",{ascending:!1});o(m||[]),u(!1)};return x.useEffect(()=>{i&&t&&p()},[i,t]),l.jsxs(l.Fragment,{children:[l.jsx(Xi,{open:i,onOpenChange:s,children:l.jsxs(Ei,{className:"max-w-3xl max-h-[85vh] overflow-y-auto",children:[l.jsx(Ms,{children:l.jsx(Rs,{children:e})}),l.jsxs("div",{className:"flex flex-wrap gap-4 text-sm text-muted-foreground py-2 border-y border-border",children:[r&&l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx(En,{className:"h-3.5 w-3.5"}),r]}),n&&l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx(ai,{className:"h-3.5 w-3.5"}),n]})]}),l.jsxs("div",{className:"space-y-3 pt-2",children:[l.jsxs("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[l.jsx(Ss,{className:"h-4 w-4 text-primary"}),"Objekt (",a.length,")"]}),c?l.jsx("p",{className:"text-sm text-muted-foreground py-6 text-center",children:"Laddar…"}):a.length===0?l.jsx("p",{className:"text-sm text-muted-foreground py-6 text-center",children:"Den här uthyraren har inga objekt än."}):l.jsx("div",{className:"space-y-2",children:a.map(m=>l.jsxs("div",{className:"flex items-center justify-between gap-3 p-3 rounded-lg border border-border hover:bg-secondary/30 transition-colors",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[VGe(m.status),l.jsxs("span",{className:"font-medium text-foreground truncate",children:[m.street_address||"Adress saknas",", ",m.city||"–"]})]}),l.jsxs("p",{className:"text-xs text-muted-foreground mt-1 flex items-center gap-3",children:[l.jsx("span",{children:m.property_type}),l.jsxs("span",{children:[m.rooms," rum"]}),m.area_sqm&&l.jsxs("span",{children:[m.area_sqm," m²"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(SE,{className:"h-3 w-3"}),new Date(m.created_at).toLocaleDateString("sv-SE")]})]})]}),l.jsxs(se,{size:"sm",variant:"ghost",className:"gap-1.5",onClick:()=>f(m.id),children:[l.jsx(zo,{className:"h-3.5 w-3.5"}),"Redigera"]})]},m.id))})]})]})}),l.jsx(wS,{propertyId:d,open:!!d,onOpenChange:m=>!m&&f(null),onSaved:p})]})}function WGe(){const[t,e]=x.useState([]),[r,n]=x.useState(!0),[i,s]=x.useState(null),[a,o]=x.useState(""),[c,u]=x.useState(null),[d,f]=x.useState(null),[p,m]=x.useState({first_name:"",last_name:"",phone:"",email:""}),[y,v]=x.useState(!1),w=C=>{f(C),m({first_name:C.first_name||"",last_name:C.last_name||"",phone:C.phone||"",email:C.email||""})},b=async()=>{if(!d)return;v(!0);const{error:C}=await ie.functions.invoke("admin-users",{method:"POST",body:{action:"update_user",user_id:d.user_id,...p}});if(v(!1),C){nt({title:"Kunde inte spara",description:C.message,variant:"destructive"});return}nt({title:"Uppgifter uppdaterade"}),e(O=>O.map(P=>P.user_id===d.user_id?{...P,...p}:P)),f(null)},_=async()=>{n(!0);const{data:C,error:O}=await ie.functions.invoke("admin-landlords",{method:"GET"});if(O){nt({title:"Kunde inte hämta uthyrare",description:O.message,variant:"destructive"}),n(!1);return}e((C==null?void 0:C.landlords)??[]),n(!1)};x.useEffect(()=>{_()},[]);const S=async C=>{s(C);const{data:{session:O}}=await ie.auth.getSession(),P=`https://wykzqbbuyabvltminuvj.supabase.co/functions/v1/admin-landlords?user_id=${C}`,T=await fetch(P,{method:"DELETE",headers:{Authorization:`Bearer ${O==null?void 0:O.access_token}`,apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Ind5a3pxYmJ1eWFidmx0bWludXZqIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzYwOTM4NzQsImV4cCI6MjA5MTY2OTg3NH0.zGoPN0q9zXf2degJhCILkJ3CcP9Fx5YRN3A_LZzgWFI"}});if(s(null),!T.ok){const $=await T.json().catch(()=>({}));nt({title:"Kunde inte avregistrera",description:$.error??"Okänt fel",variant:"destructive"});return}nt({title:"Uthyraren har avregistrerats"}),e($=>$.filter(B=>B.user_id!==C))},N=async(C,O)=>{if(!C){nt({title:"Saknar e-post",description:"Den här uthyraren har ingen e-postadress.",variant:"destructive"});return}const{error:P}=await ie.functions.invoke("admin-landlords",{method:"POST",body:{action:"reset_password",email:C}});if(P){nt({title:"Kunde inte skicka återställning",description:P.message,variant:"destructive"});return}nt({title:"Återställningsmejl skickat",description:`${O} (${C}) får ett mejl med en länk för att välja nytt lösenord.`})},j=t.filter(C=>{const O=a.trim().toLowerCase();return O?`${C.first_name} ${C.last_name}`.toLowerCase().includes(O)||(C.email||"").toLowerCase().includes(O)||(C.phone||"").toLowerCase().includes(O):!0}
888);return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[l.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/20 flex items-center justify-center",children:l.jsx(PH,{className:"h-5 w-5 text-primary"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Uthyrare"}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.length," registrerade uthyrare"]})]})]}),l.jsxs("div",{className:"relative mb-4 max-w-md",children:[l.jsx(ma,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),l.jsx(ce,{placeholder:"Sök på namn, e-post eller telefon…",value:a,onChange:C=>o(C.target.value),className:"pl-9"})]}),l.jsx("div",{className:"bg-card border border-border rounded-xl overflow-hidden",children:r?l.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Laddar…"}):j.length===0?l.jsx("div",{className:"p-8 text-center text-muted-foreground",children:t.length===0?"Inga uthyrare registrerade ännu.":"Inga uthyrare hittades."}):l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border text-muted-foreground",children:[l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Namn"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"E-post"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Telefon"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Objekt"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Registrerad"}),l.jsx("th",{className:"text-right py-3 px-4 font-medium",children:"Åtgärder"})]})}),l.jsx("tbody",{children:j.map(C=>l.jsxs("tr",{className:"border-b border-border/50 last:border-0 hover:bg-secondary/30 transition-colors cursor-pointer",onClick:()=>u(C),children:[l.jsxs("td",{className:"py-3 px-4 font-medium text-foreground",children:[C.first_name," ",C.last_name]}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground",children:C.email||"–"}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground",children:C.phone||"–"}),l.jsx("td",{className:"py-3 px-4",children:l.jsx(Vt,{variant:C.property_count>0?"default":"secondary",children:C.property_count})}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground",children:new Date(C.created_at).toLocaleDateString("sv-SE")}),l.jsx("td",{className:"py-3 px-4 text-right",onClick:O=>O.stopPropagation(),children:l.jsxs("div",{className:"flex items-center justify-end gap-1",children:[l.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-primary",title:"Redigera uppgifter",onClick:()=>w(C),children:l.jsx(zo,{className:"h-4 w-4"})}),l.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-primary",title:"Skicka återställningsmejl",onClick:()=>N(C.email,`${C.first_name} ${C.last_name}`),children:l.jsx(MP,{className:"h-4 w-4"})}),l.jsxs(_d,{children:[l.jsx(eK,{asChild:!0,children:l.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",disabled:i===C.user_id,title:"Avregistrera uthyrare",children:l.jsx(yd,{className:"h-4 w-4"})})}),l.jsxs(Pc,{children:[l.jsxs(Mc,{children:[l.jsx(Ic,{children:"Avregistrera uthyrare?"}),l.jsxs(Lc,{children:["Detta tar permanent bort ",C.first_name," ",C.last_name," (",C.email,") och alla deras objekt. Åtgärden kan inte ångras."]})]}),l.jsxs(Rc,{children:[l.jsx(Dc,{children:"Avbryt"}),l.jsx($c,{onClick:()=>S(C.user_id),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Avregistrera"})]})]})]})]})})]}
888,C.user_id))})]})})}),l.jsx(CQ,{userId:(c==null?void 0:c.user_id)??null,name:c?`${c.first_name} ${c.last_name}`:"",email:(c==null?void 0:c.email)??"",phone:(c==null?void 0:c.phone)??"",open:!!c,onOpenChange:C=>!C&&u(null)}),l.jsx(Xi,{open:!!d,onOpenChange:C=>!C&&f(null),children:l.jsxs(Ei,{children:[l.jsx(Ms,{children:l.jsx(Rs,{children:"Redigera uthyrare"})}),l.jsxs("div",{className:"space-y-4 py-2",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{htmlFor:"ll_first_name",children:"Förnamn"}),l.jsx(ce,{id:"ll_first_name",value:p.first_name,onChange:C=>m(O=>({...O,first_name:C.target.value}))})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{htmlFor:"ll_last_name",children:"Efternamn"}),l.jsx(ce,{id:"ll_last_name",value:p.last_name,onChange:C=>m(O=>({...O,last_name:C.target.value}))})]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{htmlFor:"ll_email",children:"E-post"}),l.jsx(ce,{id:"ll_email",type:"email",value:p.email,onChange:C=>m(O=>({...O,email:C.target.value}))})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{htmlFor:"ll_phone",children:"Telefon"}),l.jsx(ce,{id:"ll_phone",value:p.phone,onChange:C=>m(O=>({...O,phone:C.target.value}))})]})]}),l.jsxs(Vo,{children:[l.jsx(se,{variant:"outline",onClick:()=>f(null),disabled:y,children:"Avbryt"}),l.jsx(se,{onClick:b,disabled:y,children:y?"Sparar…":"Spara"})]})]})})]})}function qGe(){var N,j;const[t,e]=x.useState([]),[r,n]=x.useState(!0),[i,s]=x.useState(null),[a,o]=x.useState(0),[c,u]=x.useState(!1),[d,f]=x.useState(""),[p,m]=x.useState(null),y=async()=>{n(!0);const{data:C}=await ie.from("properties").select("*").eq("status","pending").order("created_at",{ascending:!1});if(!C||C.length===0){e([]),n(!1);return}const O=[...new Set(C.map($=>$.user_id))],{data:P}=await ie.from("profiles").select("user_id, first_name, last_name, phone").in("user_id",O),T={};P==null||P.forEach($=>{T[$.user_id]={first_name:$.first_name,last_name:$.last_name,phone:$.phone}}),e(C.map($=>{var B,R,M;return{...$,first_name:((B=T[$.user_id])==null?void 0:B.first_name)||"",last_name:((R=T[$.user_id])==null?void 0:R.last_name)||"",phone:((M=T[$.user_id])==null?void 0:M.phone)||""}})),n(!1)};x.useEffect(()=>{y()},[]);const v=async(C,O)=>{let P;if(O==="approved")try{P=await sy()}catch{ke.error("Kunde inte placera objektet högst upp");return}const{error:T}=await ie.from("properties").update({status:O,...P!==void 0?{display_order:P}:{}}).eq("id",C);if(T){ke.error("Kunde inte uppdatera status");return}if(O==="approved"){const $=t.find(B=>B.id===C);$&&ie.functions.invoke("send-landlord-email",{body:{type:"approved",user_id:$.user_id,first_name:$.first_name,address:[$.street_address,$.city].filter(Boolean).join(", ")||void 0,property_id:$.id}}).catch(B=>console.warn("approval email failed",B))}ke.success(O==="approved"?"Objekt godkänt!":"Objekt avvisat"),s(null),y()},w=C=>{s(C),o(0)},b=(i==null?void 0:i.images)||[],_=C=>C.furnished_rent?`${C.furnished_rent.toLocaleString("sv-SE")} kr/mån (möblerad)`:C.unfurnished_rent?`${C.unfurnished_rent.toLocaleString("sv-SE")} kr/mån (omöblerad)`:C.partially_furnished_rent?`${C.partially_furnished_rent.toLocaleString("sv-SE")} kr/mån (delmöblerad)`:"–",S=t.filter(C=>{const O=d.trim().toLowerCase();return O?(C.street_address||"").toLowerCase().includes(O)||(C.city||"").toLowerCase().includes(O)||(C.property_type||"").toLowerCase().includes(O)||`${C.first_name} ${C.last_name}`.toLowerCase().includes(O):!0});return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[l.jsx("div",{className:"w-10 h-10 rounded-lg bg-yellow-500/20 flex items-center justify-center",children:l.jsx(kH,{className:"h-5 w-5 text-yellow-500"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Väntar på godkännande"}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.length," objekt väntar"]})]})]}),l.jsxs("div",{className:"relative mb-4 max-w-md",children:[l.jsx(ma,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),l.jsx(ce,{placeholder:"Sök adress, stad, typ eller uthyrare…",value:d,onChange:C=>f(C.target.value),className:"pl-9"})]}),l.jsx("div",{className:"bg-card border border-border rounded-xl overflow-hidden",children:r?l.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Laddar…"}):S.length===0?l.jsx("div",{className:"p-8 text-center text-muted-foreground",children:t.length===0?"Inga objekt väntar på godkännande.":"Inga objekt hittades."}):l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border text-muted-foreground",children:[l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Typ"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Adress"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Rum"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Yta"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Uthyrare"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Skapad"}),l.jsx("th",{className:"text-right py-3 px-4 font-medium",children:"Åtgärd"})]})}),l.jsx("tbody",{children:S.map(C=>l.jsxs("tr",{className:"border-b border-border/50 last:border-0 hover:bg-secondary/30 transition-colors cursor-pointer",onClick:()=>w(C),children:[l.jsx("td",{className:"py-3 px-4",children:l.jsx(Vt,{variant:"secondary",children:C.property_type})}),l.jsxs("td",{className:"py-3 px-4 text-foreground",children:[C.street_address||"–",", ",C.city||"–"]}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground",children:C.rooms}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground",children:C.area_sqm?`${C.area_sqm} m²`:"–"}),l.jsxs("td",{className:"py-3 px-4 text-muted-foreground",children:[C.first_name," ",C.last_name]}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground",children:new Date(C.created_at).toLocaleDateString("sv-SE")}),l.jsx("td",{className:"py-3 px-4 text-right",children:l.jsxs("div",{className:"flex items-center justify-end gap-1",children:[l.jsxs(se,{size:"sm",variant:"ghost",className:"h-8 gap-1",onClick:O=>{O.stopPropagation(),w(C)},children:[l.jsx(Cc,{className:"h-3.5 w-3.5"}),"Granska"]}),l.jsxs(se,{size:"sm",variant:"outline",className:"h-8 gap-1",onClick:O=>{O.stopPropagation(),m(C.id)},children:[l.jsx(zo,{className:"h-3.5 w-3.5"}),"Redigera"]})]})})]},C.id))})]})})}),l.jsx(Xi,{open:!!i,onOpenChange:C=>!C&&s(null),children:l.jsx(Ei,{className:"max-w-3xl max-h-[90vh] overflow-y-auto p-0 gap-0 bg-card border-border",children:i&&l.jsxs(l.Fragment,{children:[b.length>0?l.jsxs("div",{className:"relative aspect-[16/9] bg-muted",children:[l.jsx("img",{src:b[a],alt:`Bild ${a+1}`,className:"w-full h-full object-cover cursor-pointer",onClick:()=>u(!0)}),b.length>1&&l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>o(C=>C===0?b.length-1:C-1),className:"absolute left-2 top-1/2 -translate-y-1/2 w-9 h-9 rounded-full bg-background/80 backdrop-blur-sm flex items-center justify-center",children:l.jsx(O0,{className:"h-4 w-4 text-foreground"})}),l.jsx("button",{onClick:()=>o(C=>C===b.length-1?0:C+1),className:"absolute right-2 top-1/2 -translate-y-1/2 w-9 h-9 rounded-full bg-background/80 backdrop-blur-sm flex items-center justify-center",children:l.jsx(kh,{className:"h-4 w-4 text-foreground"})})]}),l.jsxs("div",{className:"absolute bottom-2 right-2 bg-foreground
888/70 text-primary-foreground text-xs font-medium px-2.5 py-1 rounded-full backdrop-blur-sm",children:[a+1," / ",b.length]}),l.jsxs("button",{onClick:()=>u(!0),className:"absolute bottom-2 left-2 bg-foreground/70 text-primary-foreground text-xs font-medium px-2.5 py-1 rounded-full backdrop-blur-sm flex items-center gap-1",children:[l.jsx(A0,{className:"h-3 w-3"})," Förstora"]}),b.length>1&&l.jsx("div",{className:"absolute bottom-12 left-2 right-2 flex gap-1.5 overflow-x-auto",children:b.map((C,O)=>l.jsx("button",{onClick:()=>o(O),className:`shrink-0 w-14 h-10 rounded-md overflow-hidden border-2 transition-all ${O===a?"border-primary":"border-transparent opacity-60 hover:opacity-100"}`,children:l.jsx("img",{src:C,alt:"",className:"w-full h-full object-cover"})},O))})]}):l.jsx("div",{className:"aspect-[16/9] bg-muted flex items-center justify-center text-muted-foreground",children:l.jsx(Ss,{className:"h-10 w-10 opacity-30"})}),l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx(Vt,{variant:"secondary",className:"mb-2",children:i.property_type}),l.jsx("h2",{className:"text-xl font-bold text-foreground",children:i.street_address||"Adress saknas"}),l.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-1 mt-1",children:[l.jsx(Vn,{className:"h-3.5 w-3.5"}),i.postal_code," ",i.city]})]}),l.jsxs("div",{className:"text-right text-sm text-muted-foreground shrink-0",children:[l.jsxs("p",{className:"font-medium text-foreground",children:[i.first_name," ",i.last_name]}),i.phone&&l.jsx("p",{children:i.phone}),l.jsx("p",{children:new Date(i.created_at).toLocaleDateString("sv-SE")})]})]}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[{icon:doe,label:"Rum",value:`${i.rooms} rum`},{icon:vp,label:"Sovrum",value:i.bedrooms?`${i.bedrooms} st`:"–"},{icon:E0,label:"Badrum",value:i.bathrooms?`${i.bathrooms} st`:"–"},{icon:A0,label:"Yta",value:i.area_sqm?`${i.area_sqm} m²`:"–"}].map(({icon:C,label:O,value:P})=>l.jsxs("div",{className:"bg-secondary/50 rounded-lg p-3 text-center",children:[l.jsx(C,{className:"h-4 w-4 mx-auto mb-1 text-muted-foreground"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:O}),l.jsx("p",{className:"font-semibold text-foreground text-sm",children:P})]},O))}),l.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2 text-sm",children:[l.jsx(ho,{label:"Hyra",value:_(i)}),l.jsx(ho,{label:"Våning",value:i.floor||"–"}),l.jsx(ho,{label:"Biyta",value:i.secondary_area_sqm?`${i.secondary_area_sqm} m²`:"–"}),l.jsx(ho,{label:"Trädgård",value:i.garden_sqm?`${i.garden_sqm} m²`:"–"}),l.jsx(ho,{label:"Byggår",value:((N=i.built_year)==null?void 0:N.toString())||"–"}),l.jsx(ho,{label:"Renoverat",value:((j=i.renovated_year)==null?void 0:j.toString())||"–"}),l.jsx(ho,{label:"Inflyttning",value:i.immediate?"Omgående":i.move_in_date||"–"}),l.jsx(ho,{label:"Utflyttning",value:i.indefinite?"Tillsvidare":i.move_out_date||"–"}),i.possibly_longer&&l.jsx(ho,{label:"",value:"Eventuellt längre"})]}),i.amenities&&i.amenities.length>0&&l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Bekvämligheter"}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.amenities.map(C=>l.jsx(Vt,{variant:"outline",className:"text-xs",children:C},C))})]}),i.included_in_rent&&i.included_in_rent.length>0&&l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Ingår i hyran"}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.included_in_rent.map(C=>l.jsx(Vt,{variant:"outline",className:"text-xs",children:C},C))})]}),i.description&&l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Beskrivning"}),l.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line leading-relaxed",children:i.description})]}),l.jsxs("div",{className:"flex gap-3 pt-2 border-t border-border",children:[l.jsxs(se,{className:"flex-1 gap-2",onClick:()=>v(i.id,"approved"),children:[l.jsx(wH,{className:"h-4 w-4"}),"Godkänn objekt"]}),l.jsxs(se,{variant:"outline",className:"flex-1 gap-2",onClick:()=>{m(i.id),s(null)},children:[l.jsx(zo,{className:"h-4 w-4"}),"Redigera annons"]}),l.jsxs(se,{variant:"destructive",className:"flex-1 gap-2",onClick:()=>v(i.id,"rejected"),children:[l.jsx(Xae,{className:"h-4 w-4"}),"Avvisa objekt"]})]})]})]})})}),l.jsx(wS,{propertyId:p,open:!!p,onOpenChange:C=>!C&&m(null),onSaved:()=>{m(null),y()}}),l.jsx(Xi,{open:c,onOpenChange:u,children:l.jsx(Ei,{className:"max-w-[95vw] max-h-[95vh] p-0 bg-black/95 border-none",children:b.length>0&&l.jsxs("div",{className:"relative w-full h-[85vh] flex items-center justify-center",children:[l.jsx("img",{src:b[a],alt:`Bild ${a+1}`,className:"max-w-full max-h-full object-contain"}),b.length>1&&l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>o(C=>C===0?b.length-1:C-1),className:"absolute left-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 backdrop-blur-sm flex items-center justify-center hover:bg-white/20",children:l.jsx(O0,{className:"h-5 w-5 text-white"})}),l.jsx("button",{onClick:()=>o(C=>C===b.length-1?0:C+1),className:"absolute right-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 backdrop-blur-sm flex items-center justify-center hover:bg-white/20",children:l.jsx(kh,{className:"h-5 w-5 text-white"})})]}),l.jsxs("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 text-white/70 text-sm",children:[a+1," / ",b.length]})]})})})]})}function ho({label:t,value:e}){return l.jsxs("div",{className:"flex justify-between py-1.5 border-b border-border/30",children:[l.jsx("span",{className:"text-muted-foreground",children:t}),l.jsx("span",{className:"text-foreground font-medium",children:e})]})}function KGe({p:t,index:e}){const{attributes:r,listeners:n,setNodeRef:i,transform:s,transition:a,isDragging:o}=SQ({id:t.id}),c={transform:cp.Transform.toString(s),transition:a,opacity:o?.6:1},u=new Date(t.created_at).toLocaleDateString("sv-SE");return l.jsxs("div",{ref:i,style:c,className:"flex items-center gap-3 bg-card border border-border rounded-lg p-3 hover:bg-secondary/30",children:[l.jsx("button",{...r,...n,className:"cursor-grab active:cursor-grabbing text-muted-foreground hover:text-foreground p-1","aria-label":"Dra för att flytta",children:l.jsx(jH,{className:"h-4 w-4"})}),l.jsx("div",{className:"w-8 text-xs font-medium text-muted-foreground text-right",children:e+1}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"font-medium text-foreground truncate",children:t.street_address||"–"}),l.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:[t.city||"–"," · ",t.property_type," · ",t.rooms," rum · Skapad ",u]})]})]})}function GGe({properties:t,onChanged:e}){const r=x.useMemo(()=>[...t].sort((p,m)=>{const y=p.display_order,v=m.display_order;return y==null&&v==null?new Date(m.created_at).getTime()-new Date(p.created_at).getTime():y==null?1:v==null?-1:y-v}),[t]),[n,i]=x.useState(r),[s,a]=x.useState(!1);x.useEffect(()=>{i(r)},[r]);const o=rQ(W1(vS,{activationConstraint:{distance:5}}),W1(gS,{coordinateGetter:jQ})),c=async p=>{a(!0);const m=p.map((w,b)=>({id:w.id,display_order:(b+1)*10})),v=(await Promise.all(m.map(w=>ie.from("properties").update({display_order:w.display_order}).eq("id",w.id)))).filter(w=>w.error);return a(!1),v.length?(ke.error("Kunde inte spara ordningen"),!1):!0},u=async p=>{const{active:m,over:y}=p;
888if(!y||m.id===y.id)return;const v=n.findIndex(S=>S.id===m.id),w=n.findIndex(S=>S.id===y.id);if(v<0||w<0)return;const b=bS(n,v,w);i(b),await c(b)&&(ke.success("Ordningen sparades"),e())},d=async p=>{const m=n.findIndex(w=>w.id===p);if(m<=0)return;const y=[n[m],...n.filter((w,b)=>b!==m)];i(y),await c(y)&&(ke.success("Pushad till toppen"),e())},f=async()=>{a(!0);const{error:p}=await ie.from("properties").update({display_order:null}).not("display_order","is",null);if(a(!1),p){ke.error("Kunde inte återställa ordningen");return}ke.success("Ordningen är återställd till nyast först"),e()};return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3 flex-wrap",children:[l.jsx("div",{children:l.jsx("p",{className:"text-sm text-muted-foreground",children:"Dra i handtaget för att ändra ordningen på godkända objekt. Ändringar sparas direkt och påverkar hur objekten visas på sajten."})}),l.jsxs(se,{variant:"outline",size:"sm",onClick:f,disabled:s,className:"gap-1.5",children:[l.jsx(OH,{className:"h-4 w-4"}),"Återställ till nyast först"]})]}),n.length===0?l.jsx("div",{className:"p-8 text-center text-muted-foreground bg-card border border-border rounded-xl",children:"Inga godkända objekt att sortera."}):l.jsx(xQ,{sensors:o,collisionDetection:aQ,onDragEnd:u,children:l.jsx(_Q,{items:n.map(p=>p.id),strategy:EGe,children:l.jsx("div",{className:"space-y-2",children:n.map((p,m)=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex-1",children:l.jsx(KGe,{p,index:m})}),l.jsxs(se,{size:"sm",variant:"ghost",onClick:()=>d(p.id),disabled:m===0||s,className:"gap-1.5",title:"Pusha till toppen",children:[l.jsx(gH,{className:"h-3.5 w-3.5"}),"Toppen"]})]},p.id))})})})]})}async function Cg({action:t,propertyId:e,address:r,actorRole:n}){try{const{data:{user:i}}=await ie.auth.getUser();let s=(i==null?void 0:i.email)||"Okänd användare";if(i){const{data:a}=await ie.from("profiles").select("first_name, last_name").eq("user_id",i.id).maybeSingle(),o=[a==null?void 0:a.first_name,a==null?void 0:a.last_name].filter(Boolean).join(" ").trim();o&&(s=`${o} (${i.email})`)}await ie.functions.invoke("send-landlord-email",{body:{type:"internal_action",action:t,property_id:e,address:r||void 0,actor:s,actor_role:n}})}catch(i){console.error("notifyPropertyAction failed",i)}}const dC="Företagslogi";function ZGe({open:t,onOpenChange:e,properties:r,onSent:n}){const[i,s]=x.useState(""),[a,o]=x.useState(`Hej!
889
890Här kommer några objektförslag som vi tror passar er. Klicka på länkarna nedan för att läsa mer.
891
892Hör gärna av er om ni vill veta mer eller boka visning.
893
894Vänliga hälsningar,
895`+dC),[c,u]=x.useState(!1),d=window.location.origin,f=async()=>{var b;if(!i.trim()){ke.error("Ange kundens mejladress");return}u(!0);const{data:v}=await ie.auth.getUser(),{error:w}=await ie.functions.invoke("send-suggestion-email",{body:{to:i.trim(),message:a.trim(),baseUrl:d,properties:r}});if(w){ke.error("Kunde inte skicka mejl: "+w.message),u(!1);return}await ie.from("property_suggestions").insert({customer_email:i.trim(),message:a.trim(),property_ids:r.map(_=>_.id),sent_by:(b=v.user)==null?void 0:b.id,sent_via:"email"}),ke.success(`Objektförslag skickat till ${i.trim()}`),u(!1),e(!1),s(""),n==null||n()},p=v=>v.replace(/[<>&]/g,w=>({"<":"&lt;",">":"&gt;","&":"&amp;"})[w]),m=v=>v?new Date(v).toLocaleDateString("sv-SE"):"",y=()=>{const v=window.open("","_blank","width=900,height=1200");if(!v){ke.error("Popup blockerad. Tillåt popup-fönster för att skriva ut.");return}const w=r.map(b=>{const _=p([b.city,b.street_address].filter(Boolean).join(" – ")||"Bostad"),S=b.description?p(b.description.replace(/\s+/g," ").trim().slice(0,160))+(b.description.length>160?"…":""):"",N=[];b.unfurnished_rent&&N.push(`<div><b>Hyra omöblerad:</b> ${Number(b.unfurnished_rent).toLocaleString("sv-SE")} kr</div>`),b.partially_furnished_rent&&N.push(`<div><b>Hyra delvis möblerad:</b> ${Number(b.partially_furnished_rent).toLocaleString("sv-SE")} kr</div>`),b.furnished_rent&&N.push(`<div><b>Hyra möblerad:</b>
895 ${Number(b.furnished_rent).toLocaleString("sv-SE")} kr</div>`);const j=Y0(b.move_in_date)||b.immediate?"omgående":m(b.move_in_date)||"—",C=Y0(b.move_out_date)||b.indefinite?"Tillsvidare":m(b.move_out_date)||"—",O=(b.included_in_rent||[]).concat(b.amenities||[]),P=O.length?O.map(M=>`<div class="incl"><span class="chk">✓</span> ${p(String(M))}</div>`).join(""):'<div class="muted">—</div>',T=[b.first_name,b.last_name].filter(Boolean).join(" ")||"—",$=b.phone||"—",B=b.email||"—",R=[b.street_address,b.postal_code,b.city].filter(Boolean).join(", ")||"—";return`
896          <article class="card">
897            <header class="cardhead">
898              <h2>${_}</h2>
899              <span class="tag">DETALJER</span>
900            </header>
901            ${S?`<p class="sub">${S}</p>`:""}
902
903            <h3>Information om objektet</h3>
904            <div class="grid3">
905              <div class="col">
906                ${N.join("")||'<div class="muted">Hyra ej angiven</div>'}
907              </div>
908              <div class="col">
909                <div><b>Inflyttning:</b> <span class="v">${p(j)}</span></div>
910                <div><b>Utflyttning:</b> <span class="v">${p(C)}</span></div>
911              </div>
912              <div class="col">
913                <div><b>${p(b.property_type||"—")}</b></div>
914                <div><b>KVM:</b> ${b.area_sqm??"—"}</div>
915                <div><b>Sovrum:</b> ${b.bedrooms??b.rooms??"—"}</div>
916                <div><b>Badrum:</b> ${b.bathrooms??0}</div>
917              </div>
918            </div>
919
920            <h3>Ingår</h3>
921            <div class="grid2">${P}</div>
922
923            <h3>Kontakt</h3>
924            <div class="contact">
925              <div><b>Namn:</b> <span class="v">${p(T)}</span></div>
926              <div><b>Telefon:</b> <span class="v">${p($)}</span></div>
927              <div><b>E-post:</b> <span class="v">${p(B)}</span></div>
928              <div><b>Adress:</b> <span class="v">${p(R)}</span></div>
929            </div>
930          </article>`}).join("");v.document.write(`<!doctype html><html lang="sv"><head><meta charset="utf-8" />
931      <title>Objektförslag - ${dC}</title>
932      <style>
933        * { box-sizing: border-box; }
934        body { font-family: -apple-system, system-ui, Arial, sans-serif; color: #222; margin: 32px; font-size: 13px; line-height: 1.5; }
935        header.top { border-bottom: 1px solid #ccc; padding-bottom: 12px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: baseline; }
936        header.top h1 { margin: 0; font-size: 14px; font-weight: 600; }
937        header.top .date { color: #666; font-size: 12px; }
938        .card { border: 1px solid #ddd; border-radius: 4px; padding: 20px 24px; margin-bottom: 24px; page-break-inside: avoid; }
939        .cardhead { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding-bottom: 8px; margin-bottom: 10px; }
940        .cardhead h2 { margin: 0; font-size: 18px; font-weight: 600; }
941        .tag { font-size: 11px; letter-spacing: 1px; color: #888; }
942        .sub { margin: 0 0 18px; color: #2563eb; font-size: 13px; }
943        h3 { margin: 18px 0 10px; font-size: 14px; color: #888; font-weight: 500; }
944        .grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
945        .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; }
946        .col > div { margin-bottom: 4px; }
947        .v { color: #2563eb; }
948        .muted { color: #999; }
949        .incl { display: flex; align-items: center; gap: 6px; font-size: 13px; }
950        .chk { display: inline-flex; width: 14px; height: 14px; border: 1px solid #888; align-items: center; justify-content: center; font-size: 10px; color: #444; }
951        .contact > div { margin-bottom: 3px; }
952        @media print { body { margin: 14mm; } .card { break-inside: avoid; } }
953      </style></head><body>
954      <header class="top">
955        <h1>Objektförslag · ${dC}</h1>
956        <span class="date">${new Date().toLocaleDateString("sv-SE")} · ${r.length} objekt</span>
957      </header>
958      ${w}
959      <script>window.onload = () => setTimeout(() => window.print(), 300);<\/script>
960      </body></html>`),v.document.close()};return l.jsx(Xi,{open:t,onOpenChange:e,children:l.jsxs(Ei,{className:"max-w-2xl",children:[l.jsxs(Ms,{children:[l.jsxs(Rs,{className:"flex items-center gap-2",children:[l.jsx(En,{className:"h-5 w-5 text-primary"}),"Skicka objektförslag"]}),l.jsxs(xd,{children:[r.length," ",(r.length===1,"objekt")," valda. Mejlet skickas frÃ¥n [email protected] med kopia till [email protected]."]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(Ve,{htmlFor:"customer-email",children:"Kundens mejladress"}),l.jsx(ce,{id:"customer-email",type:"email",placeholder:"[email protected]",value:i,onChange:v=>s(v.target.value),className:"mt-1.5"})]}),l.jsxs("div",{children:[l.jsx(Ve,{htmlFor:"customer-message",children:"Meddelande"}),l.jsx(Is,{id:"customer-message",value:a,onChange:v=>o(v.target.value),rows:6,className:"mt-1.5"})]}),l.jsxs("div",{className:"rounded-lg border border-border bg-secondary/30 p-3 max-h-48 overflow-y-auto",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Valda objekt"}),l.jsx("ul",{className:"space-y-1.5",children:r.map(v=>l.jsxs("li",{className:"flex items-start gap-2 text-sm",children:[l.jsx(T0,{className:"h-3.5 w-3.5 mt-0.5 text-muted-foreground shrink-0"}),l.jsxs("span",{className:"text-foreground",children:[v.street_address||"Bostad",v.city?`, ${v.city}`:"",v.rooms?` · ${v.rooms} rok`:"",v.area_sqm?` · ${v.area_sqm} m²`:""]})]},v.id))})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"💡 Kunden fÃ¥r mejlet frÃ¥n [email protected]. Svar gÃ¥r till [email protected]."})]}),l.jsxs(Vo,{className:"gap-2 sm:gap-2",children:[l.jsx(se,{variant:"ghost",onClick:()=>
960e(!1),disabled:c,children:"Avbryt"}),l.jsxs(se,{variant:"outline",onClick:y,disabled:r.length===0,className:"gap-1.5",children:[l.jsx(RP,{className:"h-4 w-4"}),"Skriv ut"]}),l.jsxs(se,{onClick:f,disabled:c||!i.trim(),className:"gap-1.5",children:[l.jsx(En,{className:"h-4 w-4"}),c?"Skickar…":"Skicka mejl"]})]})]})})}const Bz=25;async function JGe(t,e){const r={total:0,properties_created:0,properties_skipped:0,landlords_created:0,landlords_reused:0,errors:[]};for(let n=0;n<t.length;n+=Bz){const i=t.slice(n,n+Bz),{data:s,error:a}=await ie.functions.invoke("bulk-import-legacy",{body:{rows:i,dryRun:e}});if(a)throw new Error(a.message);const o=s.report;r.total+=o.total,r.properties_created+=o.properties_created,r.properties_skipped+=o.properties_skipped,r.landlords_created+=o.landlords_created,r.landlords_reused+=o.landlords_reused,o.errors.forEach(c=>r.errors.push({...c,index:n+c.index}))}return r}function YGe(){const[t,e]=x.useState(!1),[r,n]=x.useState(null),[i,s]=x.useState(""),[a,o]=x.useState(!1),[c,u]=x.useState(null),[d,f]=x.useState(null),p=async y=>{try{const v=await y.text(),w=JSON.parse(v);if(!Array.isArray(w))throw new Error("JSON måste vara en lista");n(w),s(y.name),u(null),f(null),ke.success(`${w.length} rader laddade`)}catch(v){ke.error("Kunde inte läsa fil: "+v.message)}},m=async y=>{if(r){o(!0),f(y?"dry":"real"),u(null);try{const v=await JGe(r,y);u(v),ke.success(y?"Torrkörning klar":"Import klar")}catch(v){ke.error("Fel: "+v.message)}finally{o(!1)}}};return l.jsxs(Xi,{open:t,onOpenChange:e,children:[l.jsx(Qfe,{asChild:!0,children:l.jsxs(se,{variant:"outline",className:"gap-1.5",children:[l.jsx($P,{className:"h-4 w-4"}),"Importera legacy"]})}),l.jsxs(Ei,{className:"max-w-2xl",children:[l.jsxs(Ms,{children:[l.jsx(Rs,{children:"Importera objekt från gamla systemet"}),l.jsxs(xd,{children:["Ladda upp ",l.jsx("code",{children:"apartments_clean.json"}),'. Kör först en torrkörning för att se vad som händer. Inget skapas innan du klickar "Kör import".']})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("label",{className:"flex items-center gap-3 border-2 border-dashed border-border rounded-lg p-4 cursor-pointer hover:bg-muted/50",children:[l.jsx(toe,{className:"h-6 w-6 text-muted-foreground"}),l.jsxs("div",{className:"flex-1",children:[l.jsx("div",{className:"font-medium",children:i||"Välj JSON-fil"}),r&&l.jsxs("div",{className:"text-xs text-muted-foreground",children:[r.length," rader inlästa"]})]}),l.jsx("input",{type:"file",accept:"application/json,.json",className:"hidden",onChange:y=>{var v;return((v=y.target.files)==null?void 0:v[0])&&p(y.target.files[0])}})]}),c&&l.jsxs("div",{className:"rounded-lg border border-border p-4 text-sm space-y-1",children:[l.jsx("div",{className:"font-semibold mb-2",children:d==="dry"?"Torrkörning – inget sparat":"Import slutförd"}),l.jsxs("div",{children:["Totalt: ",l.jsx("b",{children:c.total})]}),l.jsxs("div",{children:["Objekt skapade: ",l.jsx("b",{children:c.properties_created})]}),l.jsxs("div",{children:["Objekt hoppade (redan importerade): ",l.jsx("b",{children:c.properties_skipped})]}),l.jsxs("div",{children:["Nya uthyrare: ",l.jsx("b",{children:c.landlords_created})]}),l.jsxs("div",{children:["Återanvända uthyrare: ",l.jsx("b",{children:c.landlords_reused})]}),c.errors.length>0&&l.jsxs("details",{className:"mt-2",children:[l.jsxs("summary",{className:"cursor-pointer text-destructive",children:["Fel: ",c.errors.length]}),l.jsx("ul",{className:"mt-2 max-h-48 overflow-auto text-xs space-y-1",children:c.errors.map((y,v)=>l.jsxs("li",{children:["#",y.index," (",y.legacy_id??"—","): ",y.error]},v))})]})]})]}),l.jsxs(Vo,{className:"gap-2",children:[l.jsxs(se,{variant:"outline",disabled:!r||a,onClick:()=>m(!0),children:[a&&d==="dry"?l.jsx(js,{className:"h-4 w-4 animate-spin mr-1.5"}):null,"Torrkörning"]}),l.jsxs(se,{disabled:!r||a,onClick:()=>m(!1),children:[a&&d==="real"?l.jsx(js,{className:"h-4 w-4 animate-spin mr-1.5"}):null,"Kör import"]})]})]})]})}const XGe=[{key:"all",label:"Alla"},{key:"approved",label:"Godkända"},{key:"pending",label:"Väntar"},{key:"rented",label:"Uthyrda"},{key:"rejected",label:"Avvisade"},{key:"archived",label:"Arkiv"}],QGe=t=>{switch(t){case"approved":return l.jsx(Vt,{className:"bg-green-500/15 text-green-600 hover:bg-green-500/20 border-0",children:"Godkänt"});
960case"pending":return l.jsx(Vt,{className:"bg-yellow-500/15 text-yellow-600 hover:bg-yellow-500/20 border-0",children:"Väntar"});case"rented":return l.jsx(Vt,{className:"bg-blue-500/15 text-blue-600 hover:bg-blue-500/20 border-0",children:"Uthyrd"});case"rejected":return l.jsx(Vt,{className:"bg-red-500/15 text-red-600 hover:bg-red-500/20 border-0",children:"Avvisat"});case"archived":return l.jsx(Vt,{className:"bg-slate-500/15 text-slate-600 hover:bg-slate-500/20 border-0",children:"Arkiverat"});default:return l.jsx(Vt,{variant:"secondary",children:t})}},Fz=t=>{const e=t.trim().replace(",",".");if(!e)return null;const r=Number(e);return isNaN(r)?null:r};function eZe(){const[t,e]=x.useState([]),[r,n]=x.useState(!0),[i,s]=x.useState("all"),[a,o]=x.useState("list"),[c,u]=x.useState(""),[d,f]=x.useState(null),[p,m]=x.useState(null),[y,v]=x.useState(""),[w,b]=x.useState(null),[_,S]=x.useState(new Set),[N,j]=x.useState(!1),[C,O]=x.useState(null),[P,T]=x.useState([]),[$,B]=x.useState("all"),[R,M]=x.useState(""),[F,q]=x.useState(""),[V,W]=x.use
960State(""),[z,H]=x.useState(""),[G,Y]=x.useState("all"),[U,J]=x.useState("0"),[te,re]=x.useState(!1),ae=async()=>{var xa;n(!0);const Z=new Date().toISOString().split("T")[0];await ie.from("properties").update({status:"approved",rented_until:null}).eq("status","rented").not("rented_until","is",null).lte("rented_until",Z);const{data:Le}=await ie.from("properties").select("*").order("created_at",{ascending:!1});if(!Le){e([]),n(!1);return}const ht=[...new Set(Le.map(zt=>zt.user_id))],[{data:Qt},Ft]=await Promise.all([ie.from("profiles").select("user_id, first_name, last_name, phone").in("user_id",ht),ie.functions.invoke("admin-landlords",{method:"GET"})]),Kr={};Qt==null||Qt.forEach(zt=>{Kr[zt.user_id]={first_name:zt.first_name,last_name:zt.last_name,phone:zt.phone||"",email:""}}),(((xa=Ft==null?void 0:Ft.data)==null?void 0:xa.landlords)??[]).forEach(zt=>{Kr[zt.user_id]?Kr[zt.user_id].email=zt.email||"":Kr[zt.user_id]={first_name:"",last_name:"",phone:"",email:zt.email||""}}),e(Le.map(zt=>{var Zn,rs,mi,ns;return{...zt,first_name:((Zn=Kr[zt.user_id])==null?void 0:Zn.first_name)||"",last_name:((rs=Kr[zt.user_id])==null?void 0:rs.last_name)||"",phone:((mi=Kr[zt.user_id])==null?void 0:mi.phone)||"",email:((ns=Kr[zt.user_id])==null?void 0:ns.email)||""}})),n(!1)};x.useEffect(()=>{ae()},[]);const oe=async()=>{if(!d)return;const{error:Z}=await ie.from("properties").delete().eq("id",d.id);if(Z){ke.error("Kunde inte ta bort objektet");return}Cg({action:"deleted",propertyId:d.id,address:[d.street_address,d.city].filter(Boolean).join(", "),actorRole:"Admin"}),ke.success("Objektet har tagits bort"),f(null),ae()},_e=Z=>{m(Z),v(Z.rented_until||"")},ne=async()=>{if(!p)return;const{error:Z}=await ie.from("properties").update({status:"rented",rented_until:y||null}).eq("id",p.id);if(Z){ke.error("Kunde inte markera som uthyrd");return}ke.success(y?`Markerad som uthyrd till ${new Date(y).toLocaleDateString("sv-SE")}`:"Markerad som uthyrd tills vidare"),m(null),v(""),ae()},ue=async Z=>{const{error:Le}=await ie.from("properties").update({status:"approved",rented_until:null}).eq("id",Z.id);if(Le){ke.error("Kunde inte återaktivera objektet");return}ke.success("Objektet är åter publikt"),ae()},be=async Z=>{const{error:Le}=await ie.from("properties").update({status:"archived"}).eq("id",Z.id);if(Le){ke.error("Kunde inte arkivera objektet");return}Cg({action:"archived",propertyId:Z.id,address:[Z.street_address,Z.city].filter(Boolean).join(", "),actorRole:"Admin"}),ke.success("Objektet är arkiverat"),ae()},Q=async Z=>{const{error:Le}=await ie.from("properties").update({status:"pending"}).eq("id",Z.id);if(Le){ke.error("Kunde inte återställa objektet");return}Cg({action:"unarchived",propertyId:Z.id,address:[Z.street_address,Z.city].filter(Boolean).join(", "),actorRole:"Admin"}),ke.success("Objektet ligger nu under Väntar"),ae()},He=async Z=>{try{await nKe(Z.id),ke.success("Objektet har placerats överst"),ae()}catch{ke.error("Kunde inte placera objektet överst")}},Ie=Array.from(new Set(t.map(Z=>Z.city).filter(Boolean))).sort((Z,Le)=>Z.localeCompare(Le,"sv")),ft=Array.from(new Set(t.map(Z=>Z.property_type).filter(Boolean))).sort((Z,Le)=>Z.localeCompare(Le,"sv")),ot=(Z,Le="all")=>{const Qt=(Le==="furnished"?[Z.furnished_rent]:Le==="partially"?[Z.partially_furnished_rent]:Le==="unfurnished"?[Z.unfurnished_rent]:[Z.furnished_rent,Z.partially_furnished_rent,Z.unfurnished_rent]).map(Ft=>Ft==null?null:Number(Ft)).filter(Ft=>Ft!=null&&!isNaN(Ft)&&Ft>0);return Qt.length?Math.min(...Qt):null},yt=t.filter(Z=>i==="all"?Z.status!=="archived":Z.status===i).filter(Z=>{var ht,Qt,Ft;if(!c.trim())return!0;const Le=c.toLowerCase();return((ht=Z.street_address)==null?void 0:ht.toLowerCase().includes(Le))||((Qt=Z.city)==null?void 0:Qt.toLowerCase().includes(Le))||((Ft=Z.property_type)==null?void 0:Ft.toLowerCase().includes(Le))||`${Z.first_name} ${Z.last_name}`.toLowerCase().includes(Le)}).filter(Z=>{if(P.length===0)return!0;if(!Z.city)return!1;const Le=Number(U)||0;return Le<=0?P.includes(Z.city):P.some(ht=>m2(ht,Z.city,Le))}).filter(Z=>$==="all"?!0:Z.property_type===$).filter(Z=>{const Le=Fz(R);return Le==null?!0:Number(Z.rooms??0)>=Le}).filter(Z=>{const Le=Fz(F);return Le==null?!0:Number(Z.rooms??0)<=Le}).filter(Z=>V?Number(Z.area_sqm??0)>=Number(V):!0).filter(Z=>{if(!z)return!0;const Le=ot(Z,G);return Le!=null&&Le<=Number(z)}).filter(Z=>G==="all"?!0:G==="furnished"?Z.furnished:G==="partially"?Z.partially_furnished:G==="unfurnished"?Z.unfurnished:!0),Bt=(P.length>0?1:0)+($!=="all"?1:0)+(R?1:0)+(F?1:0)+(V?1:0)+(z?1:0)+(G!=="all"?1:0)+(U!=="0"&&P.length>0?1:0),Or=()=>{T([]),B("all"),M(""),q(""),W(""),H(""),Y("all"),J("0")},xr=Z=>{S(Le=>{const ht=new Set(Le);return ht.has(Z)?ht.delete(Z):ht.add(Z),ht})},ar=()=>{const Z=yt.map(ht=>
960ht.id),Le=Z.every(ht=>_.has(ht));S(ht=>{const Qt=new Set(ht);return Le?Z.forEach(Ft=>Qt.delete(Ft)):Z.forEach(Ft=>Qt.add(Ft)),Qt})},fr=t.filter(Z=>_.has(Z.id)),qr=yt.length>0&&yt.every(Z=>_.has(Z.id)),Us={all:t.filter(Z=>Z.status!=="archived").length,approved:t.filter(Z=>Z.status==="approved").length,pending:t.filter(Z=>Z.status==="pending").length,rented:t.filter(Z=>Z.status==="rented").length,rejected:t.filter(Z=>Z.status==="rejected").length,archived:t.filter(Z=>Z.status==="archived").length};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between gap-3 mb-6",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/15 flex items-center justify-center",children:l.jsx(Ss,{className:"h-5 w-5 text-primary"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Alla objekt"}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.length," objekt totalt"]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(se,{variant:a==="reorder"?"default":"outline",size:"sm",onClick:()=>o(Z=>Z==="reorder"?"list":"reorder"),className:"gap-1.5",children:[l.jsx(Vae,{className:"h-4 w-4"}),a==="reorder"?"Klar med ordning":"Ändra ordning"]}),l.jsx(se,{asChild:!0,size:"sm",children:l.jsxs(Re,{to:"/admin/objekt/nytt",children:[l.jsx(qa,{className:"h-4 w-4"}),"Lägg till objekt"]})}),l.jsx(YGe,{})]})]}),a==="reorder"?l.jsx(GGe,{properties:t.filter(Z=>Z.status==="approved"),onChanged:ae}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4",children:[l.jsx("div",{className:"flex flex-wrap gap-1 bg-secondary/50 p-1 rounded-lg w-fit",children:XGe.map(Z=>l.jsxs("button",{onClick:()=>s(Z.key),className:`px-3 py-1.5 text-sm rounded-md transition-colors ${i===Z.key?"bg-background text-foreground shadow-sm font-medium":"text-muted-foreground hover:text-foreground"}`,children:[Z.label,l.jsx("span",{className:"ml-1.5 text-xs text-muted-foreground",children:Us[Z.key]})]},Z.key))}),l.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[l.jsxs(se,{variant:te||Bt>0?"default":"outline",size:"sm",onClick:()=>re(Z=>!Z),className:"gap-1.5",children:[l.jsx(LP,{className:"h-4 w-4"}),"Filter",Bt>0&&l.jsx("span",{className:"ml-1 inline-flex items-center justify-center min-w-5 h-5 px-1.5 rounded-full bg-background/20 text-xs",children:Bt})]}),l.jsxs("div",{className:"relative flex-1 sm:w-72",children:[l.jsx(ma,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),l.jsx(ce,{placeholder:"Sök adress, stad, uthyrare…",value:c,onChange:Z=>u(Z.target.value),className:"pl-9"})]})]})]}),te&&l.jsxs("div",{className:"bg-card border border-border rounded-xl p-4 mb-4",children:[l.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1 block",children:"Städer / områden"}),l.jsx(T2,{values:P,onChange:T,options:Ie,placeholder:"Alla städer"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1 block",children:"Utöka område med"}),l.jsxs(Nt,{value:U,onValueChange:J,disabled:P.length===0,children:[l.jsx(_t,{children:l.jsx(Ct,{})}),l.jsx(kt,{children:g2.map(Z=>l.jsx(De,{value:String(Z),children:Z===0?"Endast valda städer":`+ ${Z} km`},Z))})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1 block",children:"Typ"}),l.jsxs(Nt,{value:$,onValueChange:B,children:[l.jsx(_t,{children:l.jsx(Ct,{})}),l.jsxs(kt,{children:[l.jsx(De,{value:"all",children:"Alla typer"}),ft.map(Z=>l.jsx(De,{value:Z,children:Z},Z))]})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1 block",children:"Möblering"}),l.jsxs(Nt,{value:G,onValueChange:Y,children:[l.jsx(_t,{children:l.jsx(Ct,{})}),l.jsxs(kt,{children:[l.jsx(De,{value:"all",children:"Alla"}),l.jsx(De,{value:"furnished",children:"Möblerat"}),l.jsx(De,{value:"partially",children:"Delvis möblerat"}),l.jsx(De,{value:"unfurnished",children:"Omöblerat"})]})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1 block",children:"Max hyra (kr)"}),l.jsx(ce,{type:"number",placeholder:"ex. 25000",value:z,onChange:Z=>H(Z.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1 block",children:"Min rum"}),l.jsx(ce,{type:"text",inputMode:"decimal",placeholder:"ex. 2 eller 2,5",value:R,onChange:Z=>M(Z.target.value.replace(/[^\d.,]/g,""))})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1 block",children:"Max rum"}),l.jsx(ce,{type:"text",inputMode:"decimal",placeholder:"ex. 4 eller 4,5",value:F,onChange:Z=>q(Z.target.value.replace(/[^\d.,]/g,""))})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1 block",children:"Min yta (m²)"}),l.jsx(ce,{type:"number",placeholder:"ex. 50",value:V,onChange:Z=>W(Z.target.value)})]}),l.jsx("div",{className:"flex items-end",children:Bt>0&&l.jsxs(se,{variant:"ghost",size:"sm",onClick:Or,className:"gap-1.5",children:[l.jsx(Wi,{className:"h-4 w-4"}),"Rensa filter"]})})]}),l.jsxs("p",{className:"text-xs text-muted-foreground mt-3",children:[yt.length," matchande ",(yt.length===1,"objekt")," — markera dem för att skicka som förslag. Du k
960an välja flera städer och byta filter mellan valen: markerade objekt sparas tills du skickar."]})]}),fr.length>0&&l.jsxs("div",{className:"bg-primary/5 border border-primary/20 rounded-xl p-4 mb-4",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3 mb-2",children:[l.jsxs("p",{className:"text-sm font-medium text-foreground",children:["Valda objekt till objektförslag (",fr.length,")"]}),l.jsxs(se,{variant:"ghost",size:"sm",onClick:()=>S(new Set),className:"gap-1.5",children:[l.jsx(Wi,{className:"h-4 w-4"}),"Rensa val"]})]}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:fr.map(Z=>l.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-background border border-border px-2.5 py-1 text-xs text-foreground",children:[[Z.city,Z.street_address].filter(Boolean).join(" · ")||"Bostad",l.jsx("button",{type:"button",onClick:()=>xr(Z.id),className:"opacity-60 hover:opacity-100","aria-label":"Ta bort från val",children:l.jsx(Wi,{className:"h-3 w-3"})})]},Z.id))})]}),l.jsx("div",{className:"bg-card border border-border rounded-xl overflow-hidden",children:r?l.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Laddar…"}):yt.length===0?l.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Inga objekt hittades."}):l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border text-muted-foreground",children:[l.jsx("th",{className:"py-3 px-4 w-10",children:l.jsx(Ls,{checked:qr,onCheckedChange:ar,"aria-label":"Markera alla synliga"})}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Status"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Typ"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Adress"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Stad"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Rum"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Kvm"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Hyra"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Uthyrningstid"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Uthyrare"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Skapad"}),l.jsx("th",{className:"text-right py-3 px-4 font-medium",children:"Åtgärd"})]})}),l.jsx("tbody",{children:yt.map(Z=>l.jsxs("tr",{className:`border-b border-border/50 last:border-0 hover:bg-secondary/30 transition-colors ${_.has(Z.id)?"bg-primary/5":""}`,children:[l.jsx("td",{className:"py-3 px-4",children:l.jsx(Ls,{checked:_.has(Z.id),onCheckedChange:()=>xr(Z.id),"aria-label":"Välj objekt"})}),l.jsxs("td",{className:"py-3 px-4",children:[QGe(Z.status),Z.status==="rented"&&Z.rented_until&&l.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Ledig ",new Date(Z.rented_until).toLocaleDateString("sv-SE")]})]}),l.jsx("td",{className:"py-3 px-4",children:l.jsx(Vt,{variant:"secondary",children:Z.property_type})}),l.jsx("td",{className:"py-3 px-4 text-foreground",children:Z.street_address||"–"}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground",children:Z.city||"–"}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground",children:Z.rooms}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground whitespace-nowrap",children:Z.area_sqm?`${Z.area_sqm} m²`:"–"}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground whitespace-nowrap",children:(()=>{const Le=[Z.furnished_rent&&{l:"Möblerat",v:Z.furnished_rent},Z.partially_furnished_rent&&{l:"Delvis möblerat",v:Z.partially_furnished_rent},Z.unfurnished_rent&&{l:"Omöblerat",v:Z.unfurnished_rent}].filter(Boolean);return Le.length?l.jsx("div",{className:"space-y-0.5 text-xs",children:Le.map(ht=>l.jsxs("div",{children:[l.jsxs("span",{className:"text-muted-foreground/70",children:[ht.l,": "]}),Number(ht.v).toLocaleString("sv-SE")," kr"]},ht.l))}):l.jsx("span",{className:"text-muted-foreground",children:"–"})})()}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground whitespace-nowrap",children:l.jsxs("div",{className:"space-y-0.5 text-xs",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground
960/70",children:"Inflytt: "}),$q(Z.move_in_date,Z.immediate)]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground/70",children:"Utflytt: "}),Dq(Z.move_out_date,Z.indefinite)]})]})}),l.jsx("td",{className:"py-3 px-4",children:Z.first_name||Z.last_name?l.jsxs("button",{onClick:()=>O(Z),className:"text-primary hover:underline font-medium text-left",title:"Visa kontaktuppgifter",children:[Z.first_name," ",Z.last_name]}):l.jsx("span",{className:"text-muted-foreground",children:"–"})}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground",children:new Date(Z.created_at).toLocaleDateString("sv-SE")}),l.jsx("td",{className:"py-3 px-4 text-right",children:l.jsxs("div",{className:"flex justify-end gap-1",children:[Z.status==="approved"&&l.jsxs(l.Fragment,{children:[l.jsx(se,{size:"sm",variant:"ghost",className:"h-8 gap-1",asChild:!0,children:l.jsxs(Re,{to:`/bostad/${Z.id}`,target:"_blank",children:[l.jsx(Cc,{className:"h-3.5 w-3.5"}),"Visa"]})}),l.jsxs(se,{size:"sm",variant:"ghost",className:"h-8 gap-1 text-blue-600 hover:text-blue-700 hover:bg-blue-500/10",onClick:()=>_e(Z),children:[l.jsx(MP,{className:"h-3.5 w-3.5"}),"Uthyrd"]})]}),Z.status==="rented"&&l.jsxs(se,{size:"sm",variant:"ghost",className:"h-8 gap-1 text-green-600 hover:text-green-700 hover:bg-green-500/10",onClick:()=>ue(Z),children:[l.jsx(OH,{className:"h-3.5 w-3.5"}),"Återaktivera"]}),Z.status!=="archived"&&l.jsxs(se,{size:"sm",variant:"ghost",className:"h-8 gap-1 text-amber-600 hover:text-amber-700 hover:bg-amber-500/10",onClick:()=>He(Z),title:"Placera överst som senast ändrat",children:[l.jsx(gH,{className:"h-3.5 w-3.5"}),"Toppa"]}),l.jsxs(se,{size:"sm",variant:"ghost",className:"h-8 gap-1",onClick:()=>b(Z.id),title:"Redigera objektet",children:[l.jsx(zo,{className:"h-3.5 w-3.5"}),"Redigera"]}),Z.status==="archived"?l.jsxs(se,{size:"sm",variant:"ghost",className:"h-8 gap-1 text-green-600 hover:text-green-700 hover:bg-green-500/10",onClick:()=>Q(Z),title:"Ta tillbaka objektet från arkivet",children:[l.jsx(fH,{className:"h-3.5 w-3.5"}),"Återställ"]}):l.jsxs(se,{size:"sm",variant:"ghost",className:"h-8 gap-1 text-slate-600 hover:text-slate-700 hover:bg-slate-500/10",onClick:()=>be(Z),title:"Dölj objektet och spara det i arkivet",children:[l.jsx(hH,{className:"h-3.5 w-3.5"}),"Arkivera"]}),l.jsx(se,{size:"sm",variant:"ghost",className:"h-8 gap-1 text-red-600 hover:text-red-700 hover:bg-red-500/10",onClick:()=>f(Z),children:l.jsx(yd,{className:"h-3.5 w-3.5"})})]})})]},Z.id))})]})})})]}),l.jsx(Xi,{open:!!p,onOpenChange:Z=>!Z&&m(null),children:l.jsxs(Ei,{children:[l.jsxs(Ms,{children:[l.jsx(Rs,{children:"Markera som uthyrd"}),l.jsxs(xd,{children:[(p==null?void 0:p.street_address)||"Objektet"," kommer att döljas från sajten. Ange valfritt datum för när bostaden blir ledig igen — då återpubliceras den automatiskt."]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ve,{htmlFor:"rented-until",children:"Ledig igen (valfritt)"}),l.jsx(ce,{id:"rented-until",type:"date",value:y,min:new Date().toISOString().split("T")[0],onChange:Z=>v(Z.target.value)}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Lämna tomt för att markera som uthyrd tills vidare."})]}),l.jsxs(Vo,{children:[l.jsx(se,{variant:"ghost",onClick:()=>m(null),children:"Avbryt"}),l.jsx(se,{onClick:ne,children:"Markera som uthyrd"})]})]})}),l.jsx(_d,{open:!!d,onOpenChange:Z=>!Z&&f(null),children:l.jsxs(Pc,{children:[l.jsxs(Mc,{children:[l.jsx(Ic,{children:"Ta bort objektet?"}),l.jsxs(Lc,{children:["Detta tar permanent bort ",(d==null?void 0:d.street_address)||"objektet"," från databasen. Åtgärden kan inte ångras."]})]}),l.jsxs(Rc,{children:[l.jsx(Dc,{children:"Avbryt"}),l.jsx($c,{onClick:oe,className:"bg-red-600 hover:bg-red-700",children:"Ta bort"})]})]})}),l.jsx(wS,{propertyId:w,open:!!w,onOpenChange:Z=>!Z&&b(null),onSaved:ae}),_.size>0&&l.jsxs("div",{className:"fixed bottom-6 left-1/2 -translate-x-1/2 z-50 flex items-center gap-3 bg-foreground text-background px-5 py-3 rounded-full shadow-2xl border border-border/20 animate-in slide-in-from-bottom-4",children:[l.jsxs("span",{className:"text-sm font-medium",children:[_.size," ",_.size===1?"objekt valt":"objekt valda"]}),l.jsxs(se,{size:"sm",onClick:()=>j(!0),className:"bg-primary text-primary-foreground hover:bg-primary/90 gap-1.5 rounded-full",children:[l.jsx(En,{className:"h-4 w-4"}),"Skicka / Skriv ut"]}),l.jsx("button",{onClick:()=>S(new Set),className:"ml-1 opacity-70 hover:opacity-100 transition-opacity","aria-label":"Rensa val",children:l.jsx(Wi,{className:"h-4 w-4"})})]}),l.jsx(ZGe,{open:N,onOpenChange:j,properties:fr,onSent:()=>S(new Set)}
960),l.jsx(CQ,{userId:(C==null?void 0:C.user_id)??null,name:C?`${C.first_name} ${C.last_name}`.trim()||"Uthyrare":"",email:(C==null?void 0:C.email)??"",phone:(C==null?void 0:C.phone)??"",open:!!C,onOpenChange:Z=>!Z&&O(null)})]})}const tZe=["Lägenhet","Hus","Radhus","Villa","Rum","Stuga","Övrigt"],zz=Array.from({length:10},(t,e)=>String(e+1)),rZe=["1","1.5","2","2.5","3","3.5","4","4.5","5","5.5","6","6.5","7","7.5","8","8.5","9","9.5","10"],nZe=["El","Vatten","Värme","Kabel-tv","Bredband","Gas","P-plats","Garage"],iZe=["Egen ingång","Hiss finns","Badkar","Dusch","Extra badrum","Bastu","Ej barn","Ej rökare","Ej husdjur","Kök","Kokvrå","Pentry","Trinett","Diskmaskin","Tvättmaskin","Torktumlare","Öppenspis","Balkong","Fransk balkong","Uteplats","Trädgård","Gäst WC"];function sZe(){const t=Ti(),[e,r]=x.useState(!1),{cities:n}=Ep(),[i,s]=x.useState([]),[a,o]=x.useState([]),[c,u]=x.useState(""),[d,f]=x.useState(null),[p,m]=x.useState(!1),[y,v]=x.useState(!1),[w,b]=x.useState(!1),[_,S]=x.useState({email:"",first_name:"",last_name:"",phone:""}),[N,j]=x.useState({property_type:"Lägenhet",rooms:1,bedrooms:void 0,bathrooms:void 0,area_sqm:"",secondary_area_sqm:"",city:"",street_address:"",postal_code:"",floor:"",door_code:"",furnished:!1,furnished_rent:"",unfurnished:!1,unfurnished_rent:"",partially_furnished:!1,partially_furnished_rent:"",move_in_date:"",move_out_date:"",immediate:!1,possibly_longer:!1,indefinite:!1,included_in_rent:[],built_year:"",renovated_year:"",amenities:[],garden_sqm:"",description:""});x.useEffect(()=>{(async()=>{const{data:M}=await ie.from("profiles").select("user_id, first_name, last_name, phone").order("first_name");o(M||[])})()},[]);const C=(M,F)=>j(q=>({...q,[M]:F})),O=(M,F)=>{j(q=>({...q,[M]:q[M].includes(F)?q[M].filter(V=>V!==F):[...q[M],F]}))},P=M=>{if(M.target.files){const F=Array.from(M.target.files).map(q=>({id:crypto.randomUUID(),file:q,url:URL.createObjectURL(q)}));s(q=>[...q,...F])}},T=M=>s(F=>F.filter(q=>q.id!==M)),$=a.filter(M=>{if(!c.trim())return!0;const F=c.toLowerCase();return`${M.first_name} ${M.last_name}`.toLowerCase().includes(F)||(M.phone||"").toLowerCase().includes(F)}),B=async()=>{if(!_.email||!_.first_name){ke.error("E-post och förnamn krävs");return}b(!0);try{const{data:M,error:F}=await ie.functions.invoke("admin-create-landlord",{body:_});if(F)throw F;const q=M.user_id,V=M.existed;ke.success(V?"Användaren fanns redan – kopplad till objektet":"Ny uthyrare skapad");const W={user_id:q,first_name:_.first_name,last_name:_.last_name,phone:_.phone};o(z=>z.some(H=>H.user_id===q)?z:[W,...z]),f(W),v(!1),S({email:"",first_name:"",last_name:"",phone:""})}catch(M){ke.error(M.message||"Kunde inte skapa uthyrare")}finally{b(!1)}},R=async M=>{if(M.preventDefault(),!d){ke.error("Välj eller skapa en uthyrare först");return}r(!0);try{const F=d.user_id,q=await sy(),V=[];for(const{file:z}of i){const H=z.name.split(".").pop(),G=`${F}/${crypto.randomUUID()}.${H}`,{error:Y}=await ie.storage.from("property-images").upload(G,z);if(Y)throw Y;const{data:{publicUrl:U}}=ie.storage.from("property-images").getPublicUrl(G);V.push(U)}const{error:W}=await ie.from("properties").insert({user_id:F,status:"approved",display_order:q,property_type:N.property_type,rooms:N.rooms,bedrooms:N.bedrooms||null,bathrooms:N.bathrooms||null,area_sqm:N.area_sqm?Number(N.area_sqm):null,secondary_area_sqm:N.secondary_area_sqm?Number(N.secondary_area_sqm):null,city:N.city||null,street_address:N.street_address||null,postal_code:N.postal_code||null,floor:N.floor||null,door_code:N.door_code||null,furnished:N.furnished,furnished_rent:N.furnished_rent?Number(N.furnished_rent):null,unfurnished:N.unfurnished,unfurnished_rent:N.unfurnished_rent?Number(N.unfurnished_rent):null,partially_furnished:N.partially_furnished,partially_furnished_rent:N.partially_furnished_rent?Number(N.partially_furnished_rent):null,move_in_date:N.move_in_date||null,move_out_date:N.move_out_date||null,immediate:N.immediate,possibly_longer:N.possibly_longer,indefinite:N.indefinite,included_in_rent:N.included_in_rent,built_year:N.built_year?Number(N.built_year):null,renovated_year:N.renovated_year?Number(N.renovated_year):null,amenities:N.amenities,garden_sqm:N.garden_sqm?Number(N.garden_sqm):null,description:N.description||null,images:V});if(W)throw W;ke.success("Objekt skapat och publicerat"),t("/admin/objekt")}catch(F){ke.error(F.message||"Kunde inte spara objekt")}finally{r(!1)}};return l.jsxs("div",{children:[l.jsx("div",{className:"flex items-center gap-3 mb-6",children:l.jsxs(se,{variant:"ghost",size:"sm",onClick:()=>t("/admin/objekt"),className:"gap-1.5",children:[l.jsx(mH,{className:"h-4 w-4"}),"Tillbaka"]})}),l.jsxs("div",{className:"bg-card rounded-xl border border-border/60 shadow-card",children:[l.jsxs("div",{className:"border-b border-border/60 px-6 py-4",children:[l.jsx("h1",{className:"text-xl font-bold text-foreground",children:"Lägg till nytt objekt"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Skapa ett objekt åt en uthyrare. Objektet publiceras direkt (status: Godkänt)."})]}),l.jsxs("form",{onSubmit:R,className:"p-6 space-y-8",children:[l.jsx(po,{title:"Uthyrare",children:l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[l.jsxs(h2,{open:p,onOpenChange:m,children:[l.jsx(p2,{asChild:!0,children:l.jsxs(se,{type:"button",variant:"outline",className:"w-full sm:max-w-md justify-between",children:[d?`${d.first_name} ${d.last_name}`.trim():"Välj uthyrare…",l.jsx(qa,{className:"h-4 w-4 opacity-50"})]})}),l.jsxs(U_,{className:"p-0 w-[360px]",align:"start",children:[l.jsx("div",{className:"p-2 border-b",children:l.jsx(ce,{placeholder:"Sök namn eller telefon…",value:c,onChange:M=>u(M.target.value)})}),l.jsx("div",{className:"max-h-72 overflow-y-auto",children:$.length===0?l.jsx("div",{className:"p-3 text-sm text-muted-foreground",children:"Inga träffar"}):$.map(M=>l.jsxs("button",{type:"button",onClick:()=>{f(M),m(!1)},className:"w-full text-left px-3 py-2 hover:bg-muted text-sm",children:[l.jsx("div",{className:"font-medium",children:`${M.first_name} ${M.last_name}`.trim()||"(inget namn)"}),M.phone&&l.jsx("div",{className:"text-xs text-muted-foreground",children:M.phone})]}
960,M.user_id))})]})]}),l.jsxs(se,{type:"button",variant:"outline",onClick:()=>v(M=>!M),className:"gap-1.5",children:[l.jsx(MH,{className:"h-4 w-4"}),y?"Avbryt ny uthyrare":"Skapa ny uthyrare"]})]}),y&&l.jsxs("div",{className:"border border-border rounded-lg p-4 bg-muted/30 space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[l.jsx($r,{label:"Förnamn",required:!0,children:l.jsx(ce,{value:_.first_name,onChange:M=>S(F=>({...F,first_name:M.target.value}))})}),l.jsx($r,{label:"Efternamn",children:l.jsx(ce,{value:_.last_name,onChange:M=>S(F=>({...F,last_name:M.target.value}))})}),l.jsx($r,{label:"E-post",required:!0,children:l.jsx(ce,{type:"email",value:_.email,onChange:M=>S(F=>({...F,email:M.target.value}))})}),l.jsx($r,{label:"Telefon",children:l.jsx(ce,{value:_.phone,onChange:M=>S(F=>({...F,phone:M.target.value}))})})]}),l.jsx(se,{type:"button",onClick:B,disabled:w,size:"sm",children:w?"Skapar…":"Skapa uthyrare"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:'Användaren skapas med ett slumpat lösenord och bekräftad e-post. Hen kan logga in genom att använda "Glömt lösenord".'})]})]})}),l.jsx(po,{title:"Bostadstyp",children:l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[l.jsx($r,{label:"Bostadstyp",children:l.jsxs(Nt,{value:N.property_type,onValueChange:M=>C("property_type",M),children:[l.jsx(_t,{children:l.jsx(Ct,{})}),l.jsx(kt,{children:tZe.map(M=>l.jsx(De,{value:M,children:M},M))})]})}),l.jsx($r,{label:"Antal rum",required:!0,children:l.jsxs(Nt,{value:String(N.rooms),onValueChange:M=>C("rooms",Number(M)),children:[l.jsx(_t,{children:l.jsx(Ct,{})}),l.jsx(kt,{children:rZe.map(M=>l.jsx(De,{value:M,children:M},M))})]})}),l.jsx($r,{label:"Antal sovrum",children:l.jsxs(Nt,{value:N.bedrooms!==void 0?String(N.bedrooms):"",onValueChange:M=>C("bedrooms",Number(M)),children:[l.jsx(_t,{children:l.jsx(Ct,{placeholder:"Antal sovrum"})}),l.jsx(kt,{children:zz.map(M=>l.jsx(De,{value:M,children:M},M))})]})}),l.jsx($r,{label:"Antal badrum",children:l.jsxs(Nt,{value:N.bathrooms!==void 0?String(N.bathrooms):"",onValueChange:M=>C("bathrooms",Number(M)),children:[l.jsx(_t,{children:l.jsx(Ct,{placeholder:"Antal badrum"})}),l.jsx(kt,{children:zz.map(M=>l.jsx(De,{value:M,children:M},M))})]})}),l.jsx($r,{label:"Yta (KVM)",children:l.jsx(ce,{type:"number",value:N.area_sqm,onChange:M=>C("area_sqm",M.target.value)})}),l.jsx($r,{label:"Biyta (KVM)",children:l.jsx(ce,{type:"number",value:N.secondary_area_sqm,onChange:M=>C("secondary_area_sqm",M.target.value)})})]})}),l.jsx(po,{title:"Adress",children:l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[l.jsx($r,{label:"Stad",children:l.jsx(H_,{value:N.city,onChange:M=>C("city",M),options:n,placeholder:"Välj stad"})}),l.jsx($r,{label:"Gatuadress",children:l.jsx(ce,{value:N.street_address,onChange:M=>C("street_address",M.target.value)})}),l.jsx($r,{label:"Postnummer",children:l.jsx(ce,{value:N.postal_code,onChange:M=>C("postal_code",M.target.value)})}),l.jsx($r,{label:"Våning",children:l.jsx(ce,{value:N.floor,onChange:M=>C("floor",M.target.value)})}),l.jsx($r,{label:"Portkod",children:l.jsx(ce,{value:N.door_code,onChange:M=>C("door_code",M.target.value)})})]})}),l.jsx(po,{title:"Möblering och hyra",children:l.jsxs("div",{className:"space-y-4",children:[l.jsx(fC,{label:"Möblerat",checked:N.furnished,onCheck:M=>C("furnished",M),rent:N.furnished_rent,onRent:M=>C("furnished_rent",M)}),l.jsx(fC,{label:"Omöblerat",checked:N.unfurnished,onCheck:M=>C("unfurnished",M),rent:N.unfurnished_rent,onRent:M=>C("unfurnished_rent",M)}),l.jsx(fC,{label:"Delvis möblerat",checked:N.partially_furnished,onCheck:M=>C("partially_furnished",M),rent:N.partially_furnished_rent,onRent:M=>C("partially_furnished_rent",M)})]})}),l.jsxs(po,{title:"Period",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsx($r,{label:"Inflyttning",children:l.jsx(ce,{type:"date",value:N.move_in_date,onChange:M=>C("move_in_date",M.target.value)})}),l.jsx($r,{label:"Utflyttning",children:l.jsx(ce,{type:"date",value:N.move_out_date,onChange:M=>C("move_out_date",M.target.value)})})]}),l.jsxs("div",{className:"flex flex-wrap gap-6 mt-4",children:[l.jsx(mf,{label:"Omgående",checked:N.immediate,onCheck:M=>C("immediate",M)}),l.jsx(mf,{label:"Eventuellt längre",checked:N.possibly_longer,onCheck:M=>C("possibly_longer",M)}
960),l.jsx(mf,{label:"Tillsvidare",checked:N.indefinite,onCheck:M=>C("indefinite",M)})]})]}),l.jsx(po,{title:"Ingår i hyran",children:l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3",children:nZe.map(M=>l.jsx(mf,{label:M,checked:N.included_in_rent.includes(M),onCheck:()=>O("included_in_rent",M)},M))})}),l.jsxs(po,{title:"Övrig info",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4",children:[l.jsx($r,{label:"Byggt år",children:l.jsx(ce,{type:"number",value:N.built_year,onChange:M=>C("built_year",M.target.value)})}),l.jsx($r,{label:"Renoverat år",children:l.jsx(ce,{type:"number",value:N.renovated_year,onChange:M=>C("renovated_year",M.target.value)})})]}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3",children:iZe.map(M=>l.jsx(mf,{label:M,checked:N.amenities.includes(M),onCheck:()=>O("amenities",M)},M))}),l.jsx("div",{className:"mt-4 max-w-xs",children:l.jsx($r,{label:"Trädgård KVM",children:l.jsx(ce,{type:"number",value:N.garden_sqm,onChange:M=>C("garden_sqm",M.target.value)})})})]}),l.jsx(po,{title:"Beskrivning",children:l.jsx(Is,{rows:5,required:!0,value:N.description,onChange:M=>C("description",M.target.value)})}),l.jsx(po,{title:"Bilder (valfritt)",children:l.jsxs("div",{className:"space-y-3",children:[l.jsx(RR,{images:i.map(({id:M,url:F})=>({id:M,url:F})),onReorder:M=>s(M.map(F=>i.find(q=>q.id===F.id)).filter(Boolean)),onRemove:T}),i.length>0&&l.jsx("p",{className:"text-xs text-muted-foreground",children:"Dra i handtaget för att ändra ordning – första bilden blir huvudbild."}),l.jsxs("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-primary hover:underline",children:[l.jsx(qa,{className:"h-4 w-4"}),"Lägg till bild",l.jsx("input",{type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:P})]})]})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(se,{type:"submit",disabled:e,size:"lg",children:e?"Sparar…":"Spara och publicera"}),l.jsx(se,{type:"button",variant:"outline",onClick:()=>t("/admin/objekt"),children:"Avbryt"}),!d&&l.jsx("span",{className:"text-sm text-muted-foreground",children:"Välj en uthyrare högst upp först"})]})]})]})]})}function po({title:t,children:e}){return l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold text-foreground mb-1",children:t}),l.jsx("div",{className:"h-px bg-border/60 mb-4"}),e]})}function $r({label:t,required:e,children:r}){return l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs(Ve,{children:[t,e&&l.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),r]})}function fC({label:t,checked:e,onCheck:r,rent:n,onRent:i}){return l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("div",{className:"w-40",children:l.jsx(mf,{label:t,checked:e,onCheck:r})}),l.jsx(ce,{type:"number",placeholder:"SEK - Månadshyra",className:"max-w-[200px]",value:n,onChange:s=>i(s.target.value),disabled:!e})]})}function mf({label:t,checked:e,onCheck:r}){return l.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[l.jsx(Ls,{checked:e,onCheckedChange:n=>r(n===!0)}),l.jsx("span",{className:"text-sm text-foreground",children:t})]})}const aZe=()=>{const[t,e]=x.useState(""),[r,n]=x.useState(""),[i,s]=x.useState(!1),[a,o]=x.useState(!1),{toast:c}=Qo(),u=Ti(),d=async f=>{f.preventDefault(),o(!0);const{data:p,error:m}=await ie.auth.signInWithPassword({email:t,password:r});if(m){o(!1),c({title:"Inloggning misslyckades",description:m.message,variant:"destructive"});return}const{data:y}=await ie.from("user_roles").select("role").eq("user_id",p.user.id).eq("role","admin").maybeSingle();if(o(!1),!y){await ie.auth.signOut(),c({title:"Åtkomst nekad",description:"Detta konto är inte en administratör.",variant:"destructive"});return}c({title:"Inloggad som admin"}),u("/admin")};return l.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:l.jsx("div",{className:"w-full max-w-md",children:l.jsxs("div",{className:"bg-card rounded-xl border border-border/60 shadow-card p-6 sm:p-8",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[l.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/20 flex items-center justify-center",children:l.jsx(P0,{className:"h-5 w-5 text-primary"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Admin-inloggning"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Endast för administratörer"})]})]}),l.jsxs("form",{onSubmit:d,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{htmlFor:"email",children:"E-post"}),l.jsx(ce,{id:"email",type:"email",required:!0,value:t,onChange:f=>e(f.target.value),placeholder:"admin@..."})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{htmlFor:"password",children:"Lösenord"}),l.jsxs("div",{className:"relative",children:[l.jsx(ce,{id:"password",type:i?"text":"password",required:!0,value:r,onChange:f=>n(f.target.value),placeholder:"Lösenord"}),l.jsx("button",{type:"button",onClick:()=>s(!i),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:i?l.jsx(y_,{className:"h-4 w-4"}):l.jsx(Cc,{className:"h-4 w-4"})})]})]}),l.jsx(se,{variant:"hero",size:"lg",className:"w-full",type:"submit",disabled:a,children:a?"Loggar in...":"Logga in"}),l.jsx("div",{className:"text-center",children:l.jsx(Re,{to:"/glomt-losenord",className:"text-sm text-primary hover:underline",children:"Glömt lösenord?"})})]})]})})})};function oZe(){const[t,e]=x.useState([]),[r,n]=x.useState(""),[i,s]=x.useState(!0),[a,o]=x.useState(null),[c,u]=x.useState(""),[d,f]=x.use
960State(null),[p,m]=x.useState({first_name:"",last_name:"",phone:"",email:""}),[y,v]=x.useState(!1),[w,b]=x.useState(!1),[_,S]=x.useState(!1),[N,j]=x.useState({first_name:"",last_name:"",phone:"",email:"",password:"",is_admin:!0}),C=async()=>{if(!N.email||!N.password){nt({title:"E-post och lösenord krävs",variant:"destructive"});return}if(N.password.length<8){nt({title:"Lösenordet måste vara minst 8 tecken",variant:"destructive"});return}S(!0);const{error:R}=await ie.functions.invoke("admin-users",{method:"POST",body:{action:"create_user",...N}});if(S(!1),R){nt({title:"Kunde inte skapa användare",description:R.message,variant:"destructive"});return}nt({title:"Användaren skapades",description:N.email}),b(!1),j({first_name:"",last_name:"",phone:"",email:"",password:"",is_admin:!0}),T()},O=R=>{f(R),m({first_name:R.first_name||"",last_name:R.last_name||"",phone:R.phone||"",email:R.email||""})},P=async()=>{if(!d)return;v(!0);const{error:R}=await ie.functions.invoke("admin-users",{method:"POST",body:{action:"update_user",user_id:d.user_id,...p}});if(v(!1),R){nt({title:"Kunde inte spara",description:R.message,variant:"destructive"});return}nt({title:"Uppgifter uppdaterade"}),e(M=>M.map(F=>F.user_id===d.user_id?{...F,...p}:F)),f(null)},T=async()=>{s(!0);const{data:R,error:M}=await ie.functions.invoke("admin-users",{method:"GET"});if(M){nt({title:"Kunde inte hämta användare",description:M.message,variant:"destructive"}),s(!1);return}e((R==null?void 0:R.users)??[]),n((R==null?void 0:R.current_user_id)??""),s(!1)};x.useEffect(()=>{T()},[]);const $=async R=>{o(R.user_id);const M=R.is_admin?"remove_admin":"make_admin",{error:F}=await ie.functions.invoke("admin-users",{method:"POST",body:{action:M,user_id:R.user_id}});if(o(null),F){nt({title:"Åtgärden misslyckades",description:F.message,variant:"destructive"});return}nt({title:R.is_admin?"Admin-rollen togs bort":"Användaren är nu admin",description:`${R.first_name} ${R.last_name} (${R.email})`}),e(q=>q.map(V=>V.user_id===R.user_id?{...V,is_admin:!R.is_admin,roles:R.is_admin?V.roles.filter(W=>W!=="admin"):[...V.roles,"admin"]}:V))},B=t.filter(R=>{const M=c.trim().toLowerCase();return M?R.email.toLowerCase().includes(M)||`${R.first_name} ${R.last_name}`.toLowerCase().includes(M)||R.phone.toLowerCase().includes(M):!0});return l.jsxs("div",{children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-6",children:[l.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/20 flex items-center justify-center",children:l.jsx(jE,{className:"h-5 w-5 text-primary"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Alla användare"}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.length," användare totalt — ",t.filter(R=>R.is_admin).length," admin"]})]}),l.jsxs(se,{className:"ml-auto",onClick:()=>b(!0),children:[l.jsx(MH,{className:"h-4 w-4 mr-1.5"}),"Lägg till användare"]})]}),l.jsxs("div",{className:"relative mb-4 max-w-md",children:[l.jsx(ma,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),l.jsx(ce,{placeholder:"Sök på namn, e-post eller telefon…",value:c,onChange:R=>u(R.target.value),className:"pl-9"})]}),l.jsx("div",{className:"bg-card border border-border rounded-xl overflow-hidden",children:i?l.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Laddar…"}):B.length===0?l.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Inga användare hittades."}):l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border text-muted-foreground",children:[l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Namn"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"E-post"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Telefon"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Roll"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Objekt"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Registrerad"}),l.jsx("th",{className:"text-right py-3 px-4 font-medium",children:"Åtgärd"})]})}),l.jsx("tbody",{children:B.map(R=>{const M=R.user_id===r;return l.jsxs("tr",{className:"border-b border-border/50 last:border-0 hover:bg-secondary/30 transition-colors",children:[l.jsxs("td",{className:"py-3 px-4 font-medium text-foreground",children:[R.first_name||R.last_name?`${R.first_name} ${R.last_name}`:"–",M&&l.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:"(du)"})]}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground",children:R.email||"–"}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground",children:R.phone||"–"}),l.jsx("td",{className:"py-3 px-4",children:R.is_admin?l.jsx(Vt,{className:"bg-primary text-primary-foreground",children:"Admin"}):l.jsx(Vt,{variant:"secondary",children:"Uthyrare"})}),l.jsx("td",{className:"py-3 px-4",children:l.jsx(Vt,{variant:R.property_count>0?"default":"secondary",children:R.property_count})}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground",children:R.created_at?new Date(R.created_at).toLocaleDateString("sv-SE"):"–"}),l.jsx("td",{className:"py-3 px-4 text-right",children:l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsxs(se,{variant:"ghost",size:"sm",onClick:()=>O(R),children:[l.jsx(zo,{className:"h-3.5 w-3.5 mr-1.5"}),"Redigera"]}),M?l.jsx("span",{className:"text-xs text-muted-foreground",children:"–"}):l.jsxs(_d,{children:[l.jsx(eK,{asChild:!0,children:l.jsx(se,{variant:R.is_admin?"outline":"default",size:"sm",disabled:a===R.user_id,children:R.is_admin?l.jsxs(l.Fragment,{children:[l.jsx(Soe,{className:"h-3.5 w-3.5 mr-1.5"}),"Ta bort admin"]}):l.jsxs(l.Fragment,{children:[l.jsx(P0,{className:"h-3.5 w-3.5 mr-1.5"}),"Gör till admin"]})})}),l.jsxs(Pc,{children:[l.jsxs(Mc,{children:[l.jsx(Ic,{children:R.is_admin?"Ta bort admin-rollen?":"Ge admin-behörighet?"}),l.jsx(Lc,{children:R.is_admin?`${R.first_name} ${R.last_name} (${R.email}) kommer inte längre att kunna komma åt admin-panelen.`:`${R.first_name} ${R.last_name} (${R.email}) kommer att få full admin-behörighet och kan logga in via /admin/logga-in.`})]}),l.jsxs(Rc,{children:[l.jsx(Dc,{children:"Avbryt"}),l.jsx($c,{onClick:()=>$(R),children:"Bekräfta"})]})]})]})]})})]}
960,R.user_id)})})]})})}),l.jsx(Xi,{open:!!d,onOpenChange:R=>!R&&f(null),children:l.jsxs(Ei,{children:[l.jsx(Ms,{children:l.jsx(Rs,{children:"Redigera användare"})}),l.jsxs("div",{className:"space-y-4 py-2",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{htmlFor:"first_name",children:"Förnamn"}),l.jsx(ce,{id:"first_name",value:p.first_name,onChange:R=>m(M=>({...M,first_name:R.target.value}))})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{htmlFor:"last_name",children:"Efternamn"}),l.jsx(ce,{id:"last_name",value:p.last_name,onChange:R=>m(M=>({...M,last_name:R.target.value}))})]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{htmlFor:"email",children:"E-post"}),l.jsx(ce,{id:"email",type:"email",value:p.email,onChange:R=>m(M=>({...M,email:R.target.value}))})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{htmlFor:"phone",children:"Telefon"}),l.jsx(ce,{id:"phone",value:p.phone,onChange:R=>m(M=>({...M,phone:R.target.value}))})]})]}),l.jsxs(Vo,{children:[l.jsx(se,{variant:"outline",onClick:()=>f(null),disabled:y,children:"Avbryt"}),l.jsx(se,{onClick:P,disabled:y,children:y?"Sparar…":"Spara"})]})]})}),l.jsx(Xi,{open:w,onOpenChange:R=>!R&&b(!1),children:l.jsxs(Ei,{children:[l.jsx(Ms,{children:l.jsx(Rs,{children:"Lägg till användare"})}),l.jsxs("div",{className:"space-y-4 py-2",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{htmlFor:"c_first",children:"Förnamn"}),l.jsx(ce,{id:"c_first",value:N.first_name,onChange:R=>j(M=>({...M,first_name:R.target.value}))})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{htmlFor:"c_last",children:"Efternamn"}),l.jsx(ce,{id:"c_last",value:N.last_name,onChange:R=>j(M=>({...M,last_name:R.target.value}))})]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{htmlFor:"c_email",children:"E-post"}),l.jsx(ce,{id:"c_email",type:"email",value:N.email,onChange:R=>j(M=>({...M,email:R.target.value}))})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{htmlFor:"c_phone",children:"Telefon"}),l.jsx(ce,{id:"c_phone",value:N.phone,onChange:R=>j(M=>({...M,phone:R.target.value}))})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{htmlFor:"c_password",children:"Lösenord (minst 8 tecken)"}),l.jsx(ce,{id:"c_password",type:"text",value:N.password,onChange:R=>j(M=>({...M,password:R.target.value}))}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Dela lösenordet med den anställda — hen kan byta det senare."})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[l.jsx(Ls,{id:"c_admin",checked:N.is_admin,onCheckedChange:R=>j(M=>({...M,is_admin:!!R}))}),l.jsx(Ve,{htmlFor:"c_admin",className:"font-normal",children:"Ge admin-behörighet"})]})]}),l.jsxs(Vo,{children:[l.jsx(se,{variant:"outline",onClick:()=>b(!1),disabled:_,children:"Avbryt"}),l.jsx(se,{onClick:C,disabled:_,children:_?"Skapar…":"Skapa användare"})]})]})})]})}const IR=x.forwardRef(({className:t,...e},r)=>l.jsx("div",{className:"relative w-full overflow-auto",children:l.jsx("table",{ref:r,className:fe("w-full caption-bottom text-sm",t),...e})}));IR.displayName="Table";const LR=x.forwardRef(({className:t,...e},r)=>l.jsx("thead",{ref:r,className:fe("[&_tr]:border-b",t),...e}));LR.displayName="TableHeader";const $R=x.forwardRef(({className:t,...e},r)=>l.jsx("tbody",{ref:r,className:fe("[&_tr:last-child]:border-0",t),...e}));$R.displayName="TableBody";const lZe=x.forwardRef(({className:t,...e},r)=>l.jsx("tfoot",{ref:r,className:fe("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));lZe.displayName="TableFooter";const To=x.forwardRef(({className:t,...e},r)=>l.jsx("tr",{ref:r,className:fe("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",t),...e}));To.displayName="TableRow";const ei=x.forwardRef(({className:t,...e},r)=>l.jsx("th",{ref:r,className:fe("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...e}));ei.displayName="TableHead";const Jr=x.forwardRef(({className:t,...e},r)=>l.jsx("td",{ref:r,className:fe("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));Jr.displayName="TableCell";const cZe=x.forwardRef(({className:t,...e},r)=>l.jsx("caption",{ref:r,className:fe("mt-4 text-sm text-muted-foreground",t),...e}));cZe.displayName="TableCaption";const ml=t=>t.replace(/[<>&]/g,e=>({"<":"&lt;",">":"&gt;","&":"&amp;"})[e]);function EQ(t){const e=window.open("","_blank","width=900,height=1200");if(!e)return!1;const r=t.sections.map(i=>{const s=i.rows.filter(a=>a.value!==null&&a.value!==void 0&&String(a.value).trim()!=="");return s.length===0?"":`
961        <section class="block">
962          <h3>${ml(i.title)}</h3>
963          <div class="rows">
964            ${s.map(a=>`<div class="row"><span class="lbl">${ml(a.label)}</span><span class="val">${ml(String(a.value))}</span></div>`).join("")}
965          </div>
966        </section>`}).join(""),n=(t.freeText||[]).filter(i=>i.body&&i.body.trim()!=="").map(i=>`<section class="block"><h3>${ml(i.title)}</h3><p class="free">${ml(i.body)}</p></section>`).join("");return e.document.write(`<!doctype html><html lang="sv"><head><meta charset="utf-8" />
967    <title>${ml(t.title)}</title>
968    <style>
969      * { box-sizing: border-box; }
970      body { font-family: -apple-system, system-ui, Arial, sans-serif; color: #222; margin: 32px; font-size: 13px; line-height: 1.5; }
971      header.top { border-bottom: 1px solid #ccc; padding-bottom: 12px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: baseline; }
972      header.top h1 { margin: 0; font-size: 18px; font-weight: 600; }
973      header.top .date { color: #666; font-size: 12px; }
974      .sub { color: #666; margin: 0 0 20px; font-size: 12px; }
975      .block { border: 1px solid #ddd; border-radius: 4px; padding: 14px 18px; margin-bottom: 14px; page-break-inside: avoid; }
976      h3 { margin: 0 0 10px; font-size: 13px; color: #888; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
977      .rows { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; }
978      .row { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dotted #eee; padding-bottom: 2px; }
979      .lbl { color: #666; }
980      .val { color: #111; font-weight: 500; text-align: right; }
981      .free { margin: 0; white-space: pre-wrap; }
982      @media print { body { margin: 14mm; } .block { break-inside: avoid; } }
983    </style></head><body>
984    <header class="top">
985      <h1>${ml(t.heading)}</h1>
986      <span class="date">${new Date().toLocaleDateString("sv-SE")} · Företagslogi</span>
987    </header>
988    ${t.subheading?`<p class="sub">${ml(t.subheading)}</p>`:""}
989    ${r}
990    ${n}
991    <script>window.onload = () => setTimeout(() => window.print(), 300);<\/script>
992    </body></html>`),e.document.close(),!0}const SA={new:{label:"Ny",variant:"default"},in_progress:{label:"Pågår",variant:"secondary"},approved:{label:"Godkänd",variant:"outline"},done:{label:"Klar",variant:"outline"},archived:{label:"Arkiverad",variant:"outline"}},hC=t=>t==null?null:t?"Ja":"Nej";function uZe(t){var r;EQ({title:`Företagsförfrågan – ${t.company_name}`,heading:`Företagsförfrågan · ${t.company_name}`,subheading:`Inkommen ${new Date(t.created_at).toLocaleString("sv-SE")} · Org.nr ${t.org_nr} · Status: ${((r=SA[t.status])==null?void 0:r.label)??t.status}`,sections:[{title:"Företag",rows:[{label:"Företag",value:t.company_name},{label:"Org.nr",value:t.org_nr},{label:"Adress",value:`${t.street_address}${t.postal_code?", "+t.postal_code:""}`},{label:"Fakturaadress",value:t.invoice_address||"–"},{label:"Kontaktperson",value:t.contact_person},{label:"Position",value:t.position},{label:"E-post",value:t.email},{label:"Telefon",value:t.phone}]},{title:"Hyresgäst",rows:[{label:"Namn",value:t.tenant_name},{label:"E-post",value:t.tenant_email},{label:"Telefon",value:t.tenant_phone},{label:"Mobil",value:t.tenant_mobile},{label:"Nationalitet",value:t.nationality},{label:"Ålder",value:t.age},{label:"Barn",value:t.children},{label:"Husdjur",value:hC(t.pets)},{label:"Rökare",value:hC(t.smoker)}]},{title:"Bostadsönskemål",rows:[{label:"Områden",value:(t.areas??[]).join(", ")},{label:"Bostadstyp",value:t.housing_type},{label:"Möblering",value:t.furnishing},{label:"Minsta yta",value:t.min_sqm?`${t.min_sqm} m²`:null},{label:"Rum",value:t.rooms},{label:"Sovrum",value:t.bedrooms},{label:"Max hyra",value:t.max_rent}]},{title:"Hyresperiod",rows:[{label:"Inflytt",value:t.rent_from},{label:"Utflytt",value:t.rent_to},{label:"Tillsvidare",value:hC(t.indefinite)}]}],freeText:[{title:"Interna anteckningar",body:t.notes??""}]})||nt({title:"Popup blockerad",description:"Tillåt popup-fönster för att skriva ut."})}function dZe(){const[t,e]=x.useState([]),[r,n]=x.useState(!0),[i,s]=x.useState(""),[a,o]=x.useState("all"),[c,u]=x.useState(null),d=async()=>{n(!0);const{data:b,error:_}=await ie.from("company_inquiries").select("*").order("created_at",{ascending:!1});_?nt({title:"Kunde inte hämta förfrågningar",description:_.message,variant:"destructive"}):e(b??[]),n(!1)};x.useEffect(()=>{d()},[]);const f=async(b,_)=>{const{error:S}=await ie.from("company_inquiries").update({status:_}).eq("id",b);if(S){nt({title:"Kunde inte uppdatera",description:S.message,variant:"destructive"});return}e(N=>N.map(j=>j.id===b?{...j,status:_}:j)),(c==null?void 0:c.id)===b&&u({...c,status:_}),nt({title:"Status uppdaterad"})},p=async b=>{const{data:_}=await ie.from("companies").select("id").eq("inquiry_id",b.id).maybeSingle();if(!_){const{error:N}=await ie.from("companies").insert({inquiry_id:b.id,company_name:b.company_name,org_nr:b.org_nr,contact_person:b.contact_person,email:b.email,phone:b.phone,street_address:b.street_address,postal_code:b.postal_code,invoice_address:b.invoice_address??null,status:"active"});if(N){nt({title:"Kunde inte skapa företag",description:N.message,variant:"destructive"});return}}const{error:S}=await ie.from("company_inquiries").update({status:"approved"}).eq("id",b.id);if(S){nt({title:"Kunde inte uppdatera status",description:S.message,variant:"destructive"});return}e(N=>N.map(j=>j.id===b.id?{...j,status:"approved"}:j)),(c==null?void 0:c.id)===b.id&&u({...c,status:"approved"}),nt({title:"Förfrågan godkänd",description:`${b.company_name} har lagts till under Företag.`})},m=async(b,_)=>{const{error:S}=await ie.from("company_inquiries").update({notes:_}).eq("id",b);if(S){nt({title:"Kunde inte spara anteckning",description:S.message,variant:"destructive"});return}e(N=>N.map(j=>j.id===b?{...j,notes:_}:j)),nt({title:"Anteckning sparad"})},y=async b=>{if(!confirm("Vill du verkligen radera denna förfrågan?"))return;const{error:_}=await ie.from("company_inquiries").delete().eq("id",b);if(_){nt({title:"Kunde inte radera",description:_.message,variant:"destructive"});return}e(S=>S.filter(N=>N.id!==b)),u(null),nt({title:"Förfrågan raderad"})},v=()=>{const b=["Skapad","Status","Företag","Org.nr","Kontaktperson","E-post","Telefon","Adress","Postnr","Hyresgäst","Hyresgäst e-post","Hyresgäst tel","Områden","Bostadstyp","Möblering","Min m²","Rum","Sovrum","Inflytt","Utflytt","Tillsvidare","Max hyra","Anteckningar"],_=w.map(O=>{var P;
992return[new Date(O.created_at).toLocaleString("sv-SE"),((P=SA[O.status])==null?void 0:P.label)??O.status,O.company_name,O.org_nr,O.contact_person??"",O.email??"",O.phone,O.street_address,O.postal_code??"",O.tenant_name??"",O.tenant_email??"",O.tenant_phone??O.tenant_mobile??"",(O.areas??[]).join("; "),O.housing_type??"",O.furnishing??"",O.min_sqm??"",O.rooms??"",O.bedrooms??"",O.rent_from??"",O.rent_to??"",O.indefinite?"Ja":"Nej",O.max_rent??"",O.notes??""]}),S=[b,..._].map(O=>O.map(P=>`"${String(P).replace(/"/g,'""')}"`).join(",")).join(`
993`),N=new Blob(["\uFEFF"+S],{type:"text/csv;charset=utf-8;"}),j=URL.createObjectURL(N),C=document.createElement("a");C.href=j,C.download=`forfragningar-${new Date().toISOString().slice(0,10)}.csv`,C.click(),URL.revokeObjectURL(j)},w=t.filter(b=>{const _=a==="all"||b.status===a,S=i.trim().toLowerCase(),N=!S||b.company_name.toLowerCase().includes(S)||b.org_nr.toLowerCase().includes(S)||(b.contact_person??"").toLowerCase().includes(S)||(b.email??"").toLowerCase().includes(S)||(b.tenant_name??"").toLowerCase().includes(S);return _&&N});return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Förfrågningar bostadsförmedling"}),l.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[t.length," totalt · ",t.filter(b=>b.status==="new").length," nya"]})]}),l.jsxs(se,{onClick:v,variant:"outline",size:"sm",className:"gap-2",children:[l.jsx(SH,{className:"h-4 w-4"})," Exportera CSV"]})]}),l.jsxs("div",{className:"bg-card border border-border/60 rounded-xl p-4 mb-4 flex flex-col sm:flex-row gap-3",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx(ma,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),l.jsx(ce,{placeholder:"Sök företag, org.nr, kontakt...",value:i,onChange:b=>s(b.target.value),className:"pl-9"})]}),l.jsxs(Nt,{value:a,onValueChange:o,children:[l.jsx(_t,{className:"w-full sm:w-48",children:l.jsx(Ct,{placeholder:"Status"})}),l.jsxs(kt,{children:[l.jsx(De,{value:"all",children:"Alla statusar"}),l.jsx(De,{value:"new",children:"Ny"}),l.jsx(De,{value:"in_progress",children:"Pågår"}),l.jsx(De,{value:"done",children:"Klar"}),l.jsx(De,{value:"archived",children:"Arkiverad"})]})]})]}),l.jsx("div",{className:"bg-card border border-border/60 rounded-xl overflow-hidden",children:l.jsxs(IR,{children:[l.jsx(LR,{children:l.jsxs(To,{children:[l.jsx(ei,{children:"Datum"}),l.jsx(ei,{children:"Företag"}),l.jsx(ei,{children:"Kontakt"}),l.jsx(ei,{children:"Hyresgäst"}),l.jsx(ei,{children:"Områden"}),l.jsx(ei,{children:"Status"}),l.jsx(ei,{className:"text-right",children:"Åtgärd"})]})}),l.jsx($R,{children:r?l.jsx(To,{children:l.jsx(Jr,{colSpan:7,className:"text-center text-muted-foreground py-12",children:"Laddar..."})}):w.length===0?l.jsx(To,{children:l.jsx(Jr,{colSpan:7,className:"text-center text-muted-foreground py-12",children:"Inga förfrågningar hittades."})}):w.map(b=>{var S,N;const _=SA[b.status]??{label:b.status,variant:"outline"};return l.jsxs(To,{className:"cursor-pointer",onClick:()=>u(b),children:[l.jsx(Jr,{className:"text-sm text-muted-foreground whitespace-nowrap",children:new Date(b.created_at).toLocaleDateString("sv-SE")}),l.jsxs(Jr,{children:[l.jsx("div",{className:"font-medium text-foreground",children:b.company_name}),l.jsx("div",{className:"text-xs text-muted-foreground",children:b.org_nr})]}),l.jsxs(Jr,{children:[l.jsx("div",{className:"text-sm",children:b.contact_person??"—"}),l.jsx("div",{className:"text-xs text-muted-foreground",children:b.email??b.phone})]}),l.jsx(Jr,{className:"text-sm",children:b.tenant_name??"—"}),l.jsxs(Jr,{className:"text-sm",children:[(b.areas??[]).slice(0,2).join(", ")||"—",(((S=b.areas)==null?void 0:S.length)??0)>2&&` +${(((N=b.areas)==null?void 0:N.length)??0)-2}`]}),l.jsx(Jr,{children:l.jsx(Vt,{variant:_.variant,children:_.label})}),l.jsx(Jr,{className:"text-right",children:l.jsxs("div",{className:"flex justify-end gap-1",children:[b.status!=="approved"&&l.jsxs(se,{size:"sm",variant:"ghost",className:"h-8 gap-1 text-green-600 hover:text-green-700 hover:bg-green-500/10",onClick:j=>{j.stopPropagation(),p(b)},children:[l.jsx(Sh,{className:"h-3.5 w-3.5"}),"Godkänn"]}),l.jsx(se,{size:"sm",variant:"ghost",onClick:j=>{j.stopPropagation(),u(b)},children:l.jsx(Cc,{className:"h-4 w-4"})})]})})]},b.id)})})]})}),l.jsx(Xi,{open:!!c,onOpenChange:b=>!b&&u(null),children:l.jsx(Ei,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:c&&l.jsxs(l.Fragment,{children:[l.jsxs(Ms,{children:[l.jsx(Rs,{children:c.company_name}),l.jsxs(xd,{children:["Inkommen ",new Date(c.created_at).toLocaleStr
993ing("sv-SE")," · Org.nr ",c.org_nr]})]}),l.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[l.jsxs(Nt,{value:c.status,onValueChange:b=>f(c.id,b),children:[l.jsx(_t,{className:"w-48",children:l.jsx(Ct,{})}),l.jsxs(kt,{children:[l.jsx(De,{value:"new",children:"Ny"}),l.jsx(De,{value:"in_progress",children:"Pågår"}),l.jsx(De,{value:"approved",children:"Godkänd"}),l.jsx(De,{value:"done",children:"Klar"}),l.jsx(De,{value:"archived",children:"Arkiverad"})]})]}),c.status!=="approved"&&l.jsxs(se,{size:"sm",className:"bg-green-600 hover:bg-green-700 text-white gap-2",onClick:()=>p(c),children:[l.jsx(Sh,{className:"h-4 w-4"}),"Godkänn & lägg till företag"]}),l.jsxs(se,{variant:"outline",size:"sm",className:"gap-2",onClick:()=>uZe(c),children:[l.jsx(RP,{className:"h-4 w-4"})," Skriv ut"]}),l.jsxs(se,{variant:"ghost",size:"sm",className:"ml-auto text-destructive",onClick:()=>y(c.id),children:[l.jsx(yd,{className:"h-4 w-4 mr-2"})," Radera"]})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[l.jsxs(_b,{title:"Företag",children:[l.jsx(Ht,{label:"Företag",value:c.company_name}),l.jsx(Ht,{label:"Org.nr",value:c.org_nr}),l.jsx(Ht,{label:"Adress",value:`${c.street_address}${c.postal_code?", "+c.postal_code:""}`}),l.jsx(Ht,{label:"Fakturaadress",value:c.invoice_address||"–"}),l.jsx(Ht,{label:"Kontaktperson",value:c.contact_person}),l.jsx(Ht,{label:"Position",value:c.position}),l.jsx(Ht,{label:"E-post",value:c.email}),l.jsx(Ht,{label:"Telefon",value:c.phone})]}),l.jsxs(_b,{title:"Hyresgäst",children:[l.jsx(Ht,{label:"Namn",value:c.tenant_name}),l.jsx(Ht,{label:"E-post",value:c.tenant_email}),l.jsx(Ht,{label:"Telefon",value:c.tenant_phone}),l.jsx(Ht,{label:"Mobil",value:c.tenant_mobile}),l.jsx(Ht,{label:"Nationalitet",value:c.nationality}),l.jsx(Ht,{label:"Ålder",value:c.age}),l.jsx(Ht,{label:"Barn",value:c.children}),l.jsx(Ht,{label:"Husdjur",value:c.pets==null?null:c.pets?"Ja":"Nej"}),l.jsx(Ht,{label:"Rökare",value:c.smoker==null?null:c.smoker?"Ja":"Nej"})]}),l.jsxs(_b,{title:"Bostadsönskemål",children:[l.jsx(Ht,{label:"Områden",value:(c.areas??[]).join(", ")}),l.jsx(Ht,{label:"Bostadstyp",value:c.housing_type}),l.jsx(Ht,{label:"Möblering",value:c.furnishing}),l.jsx(Ht,{label:"Minsta yta",value:c.min_sqm?`${c.min_sqm} m²`:null}),l.jsx(Ht,{label:"Rum",value:c.rooms}),l.jsx(Ht,{label:"Sovrum",value:c.bedrooms}),l.jsx(Ht,{label:"Max hyra",value:c.max_rent})]}),l.jsxs(_b,{title:"Hyresperiod",children:[l.jsx(Ht,{label:"Inflytt",value:c.rent_from}),l.jsx(Ht,{label:"Utflytt",value:c.rent_to}),l.jsx(Ht,{label:"Tillsvidare",value:c.indefinite?"Ja":"Nej"})]})]}),l.jsxs("div",{className:"mt-4",children:[l.jsx("label",{className:"text-sm font-medium text-foreground",children:"Interna anteckningar"}),l.jsx(Is,{defaultValue:c.notes??"",placeholder:"Lägg till anteckning...",className:"mt-2",rows:4,onBlur:b=>{b.target.value!==(c.notes??"")&&m(c.id,b.target.value)}})]})]})})})]})}function _b({title:t,children:e}){return l.jsxs("div",{className:"bg-secondary/40 rounded-lg p-4",children:[l.jsx("h3",{className:"text-sm font-semibold text-foreground mb-3",children:t}),l.jsx("div",{className:"space-y-2",children:e})]})}function Ht({label:t,value:e}){return e==null||e===""?null:l.jsxs("div",{className:"flex justify-between gap-3 text-sm",children:[l.jsx("span",{className:"text-muted-foreground",children:t}),l.jsx("span",{className:"text-foreground text-right",children:e})]})}const fZe="id, city, street_address, postal_code, property_type, rooms, bedrooms, area_sqm, floor, status, furnished_rent, unfurnished_rent, partially_furnished_rent, move_in_date, move_out_date, images, assigned_agent",sh=t=>t?`${Number(t).toLocaleString("sv-SE")} kr/mån`:null,jA={new:{label:"Ny",variant:"default"},in_progress:{label:"Pågår",variant:"secondary"},done:{label:"Klar",variant:"outline"},archived:{label:"Arkiverad",variant:"outline"}};function hZe(t,e){var n;EQ({title:`Intresseanmälan – ${t.first_name} ${t.last_name}`,heading:`Intresseanmälan · ${t.first_name} ${t.last_name}
993`,subheading:`Inkommen ${new Date(t.created_at).toLocaleString("sv-SE")} · Status: ${((n=jA[t.status])==null?void 0:n.label)??t.status}`,sections:[{title:"Intressent",rows:[{label:"Förnamn",value:t.first_name},{label:"Efternamn",value:t.last_name},{label:"E-post",value:t.email},{label:"Telefon",value:t.phone}]},{title:"Period & pris",rows:[{label:"Inflyttning",value:t.move_in},{label:"Utflyttning",value:t.move_out},{label:"Beräknat pris",value:t.calculated_total!=null?`${Number(t.calculated_total).toLocaleString("sv-SE")} kr${t.calculated_months?` (${t.calculated_months} mån)`:""}`:null}]},{title:"Bostaden",rows:[{label:"Adress",value:[e==null?void 0:e.street_address,e==null?void 0:e.city].filter(Boolean).join(", ")},{label:"Postnummer",value:e==null?void 0:e.postal_code},{label:"Typ",value:e==null?void 0:e.property_type},{label:"Rum",value:e==null?void 0:e.rooms},{label:"Sovrum",value:e==null?void 0:e.bedrooms},{label:"Yta",value:(e==null?void 0:e.area_sqm)!=null?`${e.area_sqm} m²`:null},{label:"Våning",value:e==null?void 0:e.floor},{label:"Möblerat",value:sh(e==null?void 0:e.furnished_rent)},{label:"Delvis möblerat",value:sh(e==null?void 0:e.partially_furnished_rent)},{label:"Omöblerat",value:sh(e==null?void 0:e.unfurnished_rent)},{label:"Ledig från",value:e==null?void 0:e.move_in_date},{label:"Ledig till",value:e==null?void 0:e.move_out_date},{label:"Uthyrare",value:e==null?void 0:e.assigned_agent},{label:"Länk",value:e?`${window.location.origin}/bostad/${e.id}`:t.property_url}]}],freeText:[{title:"Meddelande",body:t.message??""},{title:"Interna anteckningar",body:t.notes??""}]})||nt({title:"Popup blockerad",description:"Tillåt popup-fönster för att skriva ut."})}function pZe(){const[t,e]=x.useState([]),[r,n]=x.useState({}),[i,s]=x.useState(!0),[a,o]=x.useState(""),[c,u]=x.useState("all"),[d,f]=x.useState(null),[p,m]=x.useState(null),y=async()=>{s(!0);const{data:j,error:C}=await ie.from("property_inquiries").select("*").order("created_at",{ascending:!1});if(C){nt({title:"Kunde inte hämta förfrågningar",description:C.message,variant:"destructive"}),s(!1);return}const O=j??[];e(O);const P=Array.from(new Set(O.map(T=>T.property_id).filter(Boolean)));if(P.length){const{data:T}=await ie.from("properties").select(fZe).in("id",P),$={};(T??[]).forEach(B=>$[B.id]=B),n($)}s(!1)};x.useEffect(()=>{y()},[]);const v=async(j,C)=>{const{error:O}=await ie.from("property_inquiries").update({status:C}).eq("id",j);if(O)return nt({title:"Kunde inte uppdatera",description:O.message,variant:"destructive"});e(P=>P.map(T=>T.id===j?{...T,status:C}:T)),(d==null?void 0:d.id)===j&&f({...d,status:C}),nt({title:"Status uppdaterad"})},w=async(j,C)=>{const{error:O}=await ie.from("property_inquiries").update({notes:C}).eq("id",j);if(O)return nt({title:"Kunde inte spara anteckning",description:O.message,variant:"destructive"});e(P=>P.map(T=>T.id===j?{...T,notes:C}:T)),nt({title:"Anteckning sparad"})},b=async j=>{if(!confirm("Vill du verkligen radera denna förfrågan?"))return;const{error:C}=await ie.from("property_inquiries").delete().eq("id",j);if(C)return nt({title:"Kunde inte radera",description:C.message,variant:"destructive"});e(O=>O.filter(P=>P.id!==j)),f(null),nt({title:"Förfrågan raderad"})},_=j=>{if(!j.property_id)return"—";const C=r[j.property_id];return C&&[C.street_address,C.city].filter(Boolean).join(", ")||j.property_id.slice(0,8)},S=()=>{const j=["Skapad","Status","Förnamn","Efternamn","E-post","Telefon","Inflyttning","Utflyttning","Objekt","Objekt-ID","Länk","Beräknat totalpris","Antal måna
993der","Meddelande","Anteckningar"],C=N.map(B=>{var R;return[new Date(B.created_at).toLocaleString("sv-SE"),((R=jA[B.status])==null?void 0:R.label)??B.status,B.first_name,B.last_name,B.email,B.phone??"",B.move_in??"",B.move_out??"",_(B),B.property_id??"",B.property_url??"",B.calculated_total??"",B.calculated_months??"",B.message??"",B.notes??""]}),O=[j,...C].map(B=>B.map(R=>`"${String(R).replace(/"/g,'""')}"`).join(",")).join(`
994`),P=new Blob(["\uFEFF"+O],{type:"text/csv;charset=utf-8;"}),T=URL.createObjectURL(P),$=document.createElement("a");$.href=T,$.download=`bostadsforfragningar-${new Date().toISOString().slice(0,10)}.csv`,$.click(),URL.revokeObjectURL(T)},N=t.filter(j=>{const C=c==="all"||j.status===c,O=a.trim().toLowerCase(),P=!O||j.first_name.toLowerCase().includes(O)||j.last_name.toLowerCase().includes(O)||j.email.toLowerCase().includes(O)||(j.phone??"").toLowerCase().includes(O)||_(j).toLowerCase().includes(O);return C&&P});return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Intresseanmälningar bostäder"}),l.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[t.length," totalt · ",t.filter(j=>j.status==="new").length," nya"]})]}),l.jsxs(se,{onClick:S,variant:"outline",size:"sm",className:"gap-2",children:[l.jsx(SH,{className:"h-4 w-4"})," Exportera CSV"]})]}),l.jsxs("div",{className:"bg-card border border-border/60 rounded-xl p-4 mb-4 flex flex-col sm:flex-row gap-3",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx(ma,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),l.jsx(ce,{placeholder:"Sök namn, e-post, objekt...",value:a,onChange:j=>o(j.target.value),className:"pl-9"})]}),l.jsxs(Nt,{value:c,onValueChange:u,children:[l.jsx(_t,{className:"w-full sm:w-48",children:l.jsx(Ct,{placeholder:"Status"})}),l.jsxs(kt,{children:[l.jsx(De,{value:"all",children:"Alla statusar"}),l.jsx(De,{value:"new",children:"Ny"}),l.jsx(De,{value:"in_progress",children:"Pågår"}),l.jsx(De,{value:"done",children:"Klar"}),l.jsx(De,{value:"archived",children:"Arkiverad"})]})]})]}),l.jsx("div",{className:"bg-card border border-border/60 rounded-xl overflow-hidden",children:l.jsxs(IR,{children:[l.jsx(LR,{children:l.jsxs(To,{children:[l.jsx(ei,{children:"Datum"}),l.jsx(ei,{children:"Namn"}),l.jsx(ei,{children:"Kontakt"}),l.jsx(ei,{children:"Objekt"}),l.jsx(ei,{children:"Period"}),l.jsx(ei,{children:"Status"}),l.jsx(ei,{className:"text-right",children:"Åtgärd"})]})}),l.jsx($R,{children:i?l.jsx(To,{children:l.jsx(Jr,{colSpan:7,className:"text-center text-muted-foreground py-12",children:"Laddar..."})}):N.length===0?l.jsx(To,{children:l.jsx(Jr,{colSpan:7,className:"text-center text-muted-foreground py-12",children:"Inga förfrågningar hittades."})}):N.map(j=>{const C=jA[j.status]??{label:j.status,variant:"outline"};return l.jsxs(To,{className:"cursor-pointer",onClick:()=>f(j),children:[l.jsx(Jr,{className:"text-sm text-muted-foreground whitespace-nowrap",children:new Date(j.created_at).toLocaleDateString("sv-SE")}),l.jsx(Jr,{children:l.jsxs("div",{className:"font-medium text-foreground",children:[j.first_name," ",j.last_name]})}),l.jsxs(Jr,{children:[l.jsx("div",{className:"text-sm",children:j.email}),l.jsx("div",{className:"text-xs text-muted-foreground",children:j.phone??"—"})]}),l.jsx(Jr,{className:"text-sm",children:l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"truncate max-w-[200px]",children:_(j)}),j.property_id&&l.jsx("a",{href:`/bostad/${j.property_id}`,target:"_blank",rel:"noreferrer",onClick:O=>O.stopPropagation(),className:"text-primary hover:opacity-80",children:l.jsx(T0,{className:"h-3.5 w-3.5"})})]})}),l.jsxs(Jr,{className:"text-sm whitespace-nowrap",children:[j.move_in||"—",j.move_out?` → ${j.move_out}`:""]}),l.jsx(Jr,{children:l.jsx(Vt,{variant:C.variant,children:C.label})}),l.jsx(Jr,{className:"text-right",children:l.jsx(se,{size:"sm",variant:"ghost",onClick:O=>{O.stopPropagation(),f(j)},children:l.jsx(Cc,{className:"h-4 w-4"})})})]},j.id)})})]})}),l.jsx(Xi,{open:!!d,onOpenChange:j=>!j&&f(null),children:l.jsx(Ei,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:d&&l.jsxs(l.Fragment,{children:[l.jsxs(Ms,{children:[l.jsxs(Rs,{children:[d.first_name," ",d.last_name]}),l.jsxs(xd,{children:["Inkommen ",new Date(d.created_at).toLocaleStr
994ing("sv-SE")]})]}),l.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[l.jsxs(Nt,{value:d.status,onValueChange:j=>v(d.id,j),children:[l.jsx(_t,{className:"w-48",children:l.jsx(Ct,{})}),l.jsxs(kt,{children:[l.jsx(De,{value:"new",children:"Ny"}),l.jsx(De,{value:"in_progress",children:"Pågår"}),l.jsx(De,{value:"done",children:"Klar"}),l.jsx(De,{value:"archived",children:"Arkiverad"})]})]}),l.jsxs(se,{variant:"outline",size:"sm",className:"gap-2",onClick:()=>hZe(d,d.property_id?r[d.property_id]:void 0),children:[l.jsx(RP,{className:"h-4 w-4"})," Skriv ut"]}),l.jsxs(se,{variant:"ghost",size:"sm",className:"ml-auto text-destructive",onClick:()=>b(d.id),children:[l.jsx(yd,{className:"h-4 w-4 mr-2"})," Radera"]})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[l.jsxs(Uz,{title:"Intressent",children:[l.jsx(wn,{label:"Förnamn",value:d.first_name}),l.jsx(wn,{label:"Efternamn",value:d.last_name}),l.jsx(wn,{label:"E-post",value:l.jsx("a",{href:`mailto:${d.email}`,className:"text-primary hover:underline",children:d.email})}),l.jsx(wn,{label:"Telefon",value:d.phone})]}),l.jsxs(Uz,{title:"Period & pris",children:[l.jsx(wn,{label:"Inflyttning",value:d.move_in}),l.jsx(wn,{label:"Utflyttning",value:d.move_out}),d.calculated_total!=null&&l.jsx(wn,{label:"Beräknat pris",value:`${Number(d.calculated_total).toLocaleString("sv-SE")} kr${d.calculated_months?` (${d.calculated_months} mån)`:""}`})]})]}),d.property_id&&l.jsxs("div",{className:"mt-4 bg-muted/30 rounded-lg border border-border/60 p-4",children:[l.jsx("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-3",children:"Bostaden"}),(()=>{var C;const j=r[d.property_id];return j?l.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[((C=j.images)==null?void 0:C[0])&&l.jsx("img",{src:j.images[0],alt:`Bild av ${j.street_address??"bostaden"}`,className:"w-full sm:w-40 h-32 object-cover rounded-lg border border-border/60"}),l.jsxs("div",{className:"flex-1 space-y-2",children:[l.jsxs("div",{children:[l.jsx("div",{className:"font-semibold text-foreground",children:[j.street_address,j.city].filter(Boolean).join(", ")||"Objekt"}),l.jsx("div",{className:"text-xs text-muted-foreground",children:[j.postal_code,j.property_type,j.status&&`Status: ${j.status}`].filter(Boolean).join(" · ")})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-x-4",children:[l.jsx(wn,{label:"Rum",value:j.rooms!=null?String(j.rooms):null}),l.jsx(wn,{label:"Sovrum",value:j.bedrooms!=null?String(j.bedrooms):null}),l.jsx(wn,{label:"Yta",value:j.area_sqm!=null?`${j.area_sqm} m²`:null}),l.jsx(wn,{label:"Våning",value:j.floor}),l.jsx(wn,{label:"Möblerat",value:sh(j.furnished_rent)}),l.jsx(wn,{label:"Omöblerat",value:sh(j.unfurnished_rent)}),l.jsx(wn,{label:"Delvis möblerat",value:sh(j.partially_furnished_rent)}),l.jsx(wn,{label:"Ledig från",value:j.move_in_date}),l.jsx(wn,{label:"Ledig till",value:j.move_out_date}),l.jsx(wn,{label:"Uthyrare",value:j.assigned_agent})]}),l.jsxs("div",{className:"flex items-center gap-3 pt-1 flex-wrap",children:[l.jsxs(se,{variant:"outline",size:"sm",onClick:()=>m(j.id),children:[l.jsx(zo,{className:"h-4 w-4 mr-2"})," Redigera annons"]}),l.jsxs("a",{href:`/bostad/${j.id}`,target:"_blank",rel:"noreferrer",className:"text-sm text-primary hover:underline inline-flex items-center gap-1",children:["Öppna objekt ",l.jsx(T0,{className:"h-3 w-3"})]}),l.jsxs("span",{className:"text-xs text-muted-foreground",children:["ID ",j.id.slice(0,8)]})]})]})]}):l.jsxs("div",{className:"text-sm text-muted-foreground",children:["Objektet hittades inte (ID ",d.property_id.slice(0,8),") – kan vara borttaget."]})})()]}),l.jsxs("div",{className:"mt-4",children:[l.jsx("div",{className:"text-sm font-semibold text-foreground mb-2",children:"Meddelande"}),l.jsx("div",{className:"text-sm whitespace-pre-wrap bg-muted/40 rounded-lg p-3 border border-border/60",children:d.message||l.jsx("span",{className:"text-muted-foreground",children:"—"})})]}),l.jsxs("div",{className:"mt-4",children:[l.jsx("label",{className:"text-sm font-medium text-foreground",children:"Interna anteckningar"}),l.jsx(Is,{defaultValue:d.notes??"",placeholder:"Lägg till anteckning...",className:"mt-2",rows:4,onBlur:j=>{j.target.value!==(d.notes??"")&&w(d.id,j.target.value)}})]})]})})}),l.jsx(wS,{propertyId:p,open:!!p,onOpenChange:j=>!j&&m(null),onSaved:()=>{m(null),y()}})]})}function Uz({title:t,children:e}){return l.jsxs("div",{className:"bg-muted/30 rounded-lg p-4 border border-border/60",children:[l.jsx("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-3",children:t}),l.jsx("div",{className:"space-y-2",children:e})]})}function wn({label:t,value:e}){return e==null||e===""?null:l.jsxs("div",{className:"flex justify-between gap-4 text-sm",children:[l.jsx("span",{className:"text-muted-foreground",children:t}),l.jsx("span",{className:"text-foreground text-right break-words",children:e})]})}function mZe(){const[t,e]=x.useState([]),[r,n]=x.useState(!0),[i,s]=x.useState(""),[a,o]=x.useState(null),c=async()=>{n(!0);const{data:f,error:p}=await ie.from("companies").select("*").order("created_at",{ascending:!1});p&&ke.error("Kunde inte hämta företag"),e(f||[]),n(!1)};x.useEffect(()=>{c()},[]);const u=async()=>
994{if(!a)return;const{error:f}=await ie.from("companies").delete().eq("id",a.id);if(f){ke.error("Kunde inte ta bort företaget");return}ke.success("Företaget borttaget"),o(null),c()},d=t.filter(f=>{var m,y,v,w;if(!i.trim())return!0;const p=i.toLowerCase();return((m=f.company_name)==null?void 0:m.toLowerCase().includes(p))||((y=f.org_nr)==null?void 0:y.toLowerCase().includes(p))||((v=f.contact_person)==null?void 0:v.toLowerCase().includes(p))||((w=f.email)==null?void 0:w.toLowerCase().includes(p))});return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[l.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/15 flex items-center justify-center",children:l.jsx(vc,{className:"h-5 w-5 text-primary"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Företag"}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.length," företag totalt"]})]})]}),l.jsx("div",{className:"flex justify-end mb-4",children:l.jsxs("div",{className:"relative w-full sm:w-72",children:[l.jsx(ma,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),l.jsx(ce,{placeholder:"Sök företag, org.nr, kontakt…",value:i,onChange:f=>s(f.target.value),className:"pl-9"})]})}),l.jsx("div",{className:"bg-card border border-border rounded-xl overflow-hidden",children:r?l.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Laddar…"}):d.length===0?l.jsxs("div",{className:"p-12 text-center",children:[l.jsx(vc,{className:"h-10 w-10 text-muted-foreground mx-auto mb-3"}),l.jsx("p",{className:"text-muted-foreground",children:"Inga företag ännu."}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Företag läggs till automatiskt när du godkänner en förfrågan."})]}):l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border text-muted-foreground",children:[l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Företag"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Org.nr"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Kontaktperson"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Kontakt"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Adress"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Status"}),l.jsx("th",{className:"text-left py-3 px-4 font-medium",children:"Tillagd"}),l.jsx("th",{className:"text-right py-3 px-4 font-medium",children:"Åtgärd"})]})}),l.jsx("tbody",{children:d.map(f=>l.jsxs("tr",{className:"border-b border-border/50 last:border-0 hover:bg-secondary/30 transition-colors",children:[l.jsx("td",{className:"py-3 px-4 font-medium text-foreground",children:f.company_name}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground",children:f.org_nr}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground",children:f.contact_person||"–"}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground",children:l.jsxs("div",{className:"space-y-0.5",children:[f.email&&l.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[l.jsx(En,{className:"h-3 w-3"}),f.email]}),f.phone&&l.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[l.jsx(ai,{className:"h-3 w-3"}),f.phone]})]})}),l.jsxs("td",{className:"py-3 px-4 text-muted-foreground text-xs",children:[f.street_address,f.postal_code?`, ${f.postal_code}`:""]}),l.jsx("td",{className:"py-3 px-4",children:l.jsx(Vt,{className:"bg-green-500/15 text-green-600 hover:bg-green-500/20 border-0",children:f.status==="active"?"Aktiv":f.status})}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground text-xs",children:new Date(f.created_at).toLocaleDateString("sv-SE")}),l.jsx("td",{className:"py-3 px-4 text-right",children:l.jsx(se,{size:"sm",variant:"ghost",className:"h-8 gap-1 text-red-600 hover:text-red-700 hover:bg-red-500/10",onClick:()=>o(f),children:l.jsx(yd,{className:"h-3.5 w-3.5"})})})]},f.id))})]})})}),l.jsx(_d,{open:!!a,onOpenChange:f=>!f&&o(null),children:l.jsxs(Pc,{children:[l.jsxs(Mc,{children:[l.jsx(Ic,{children:"Ta bort företaget?"}),l.jsxs(Lc,{children:["Detta tar permanent bort ",a==null?void 0:a.company_name," från företagslistan. Den ursprungliga förfrågan påverkas inte."]})]}),l.jsxs(Rc,{children:[l.jsx(Dc,{children:"Avbryt"}),l.jsx($c,{onClick:u,className:"bg-red-600 hover:bg-red-700",children:"Ta bort"})]})]})})]})}function gZe(){const[t,e]=x.useState([]),[r,n]=x.useState(!0),[i,s]=x.useState(""),[a,o]=x.useState(!1),[c,u]=x.useState(""),[d,f]=x.use
994State(!1),[p,m]=x.useState(null),[y,v]=x.useState(null),[w,b]=x.useState(!1),[_,S]=x.useState(null),N=Object.keys(V0),j=async()=>{n(!0);const{data:M}=await ie.from("cities").select("*").order("created_at",{ascending:!1});e((M||[]).map(F=>({...F,latitude:F.latitude!==null?Number(F.latitude):null,longitude:F.longitude!==null?Number(F.longitude):null}))),n(!1)};x.useEffect(()=>{j()},[]);const C=()=>{u(""),m(null),v(null),f(!1)},O=M=>{u(M),m(null),v(null)},P=async()=>{const M=c.trim();if(!M)return;f(!0),v(null);const{data:F,error:q}=await ie.functions.invoke("geocode-city",{body:{city:M}});if(f(!1),q){v("Kunde inte slå upp koordinater. Försök igen.");return}if(!(F!=null&&F.found)){v("Hittade inte staden i kartdatabasen. Du kan ändå spara den utan koordinater.");return}m({lat:F.latitude,lng:F.longitude,display:F.display_name})},T=async()=>{const M=c.trim();if(!M){ke.error("Ange ett stadsnamn");return}const F=M.toLowerCase();if(N.some(W=>W.toLowerCase()===F)){ke.error("Den staden finns redan i grundlistan");return}if(t.some(W=>W.name.toLowerCase()===F)){ke.error("Den staden finns redan tillagd");return}b(!0);const{data:{user:q}}=await ie.auth.getUser(),{error:V}=await ie.from("cities").insert({name:M,latitude:(p==null?void 0:p.lat)??null,longitude:(p==null?void 0:p.lng)??null,created_by:q==null?void 0:q.id});if(b(!1),V){ke.error("Kunde inte spara: "+V.message);return}ke.success(`${M} har lagts till i listan`),o(!1),C(),j()},$=async()=>{if(!_)return;const{error:M}=await ie.from("cities").delete().eq("id",_.id);if(M){ke.error("Kunde inte ta bort");return}ke.success(`${_.name} har tagits bort`),S(null),j()},B=t.filter(M=>M.name.toLowerCase().includes(i.trim().toLowerCase())),R=N.filter(M=>M.toLowerCase().includes(i.trim().toLowerCase())).sort((M,F)=>M.localeCompare(F,"sv"));return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between gap-3 mb-6",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/15 flex items-center justify-center",children:l.jsx(Vn,{className:"h-5 w-5 text-primary"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Städer & områden"}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:[N.length," grundstäder · ",t.length," tillagda"]})]})]}),l.jsxs(se,{onClick:()=>{C(),o(!0)},className:"gap-2",children:[l.jsx(qa,{className:"h-4 w-4"}),"Lägg till stad"]})]}),l.jsxs("div",{className:"relative mb-4 max-w-md",children:[l.jsx(ma,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),l.jsx(ce,{placeholder:"Sök stad eller område…",value:i,onChange:M=>s(M.target.value),className:"pl-9"})]}),l.jsxs("section",{className:"mb-8",children:[l.jsxs("h2",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:["Tillagda av admin",l.jsx(Vt,{variant:"secondary",className:"text-xs",children:B.length})]}),l.jsx("div",{className:"bg-card border border-border rounded-xl overflow-hidden",children:r?l.jsx("div",{className:"p-6 text-center text-muted-foreground text-sm",children:"Laddar…"}):B.length===0?l.jsx("div",{className:"p-6 text-center text-muted-foreground text-sm",children:t.length===0?'Inga städer tillagda än. Klicka på "Lägg till stad" för att utöka listan.':"Inga matchande städer."}):l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border text-muted-foreground text-xs",children:[l.jsx("th",{className:"text-left py-2.5 px-4 font-medium",children:"Namn"}),l.jsx("th",{className:"text-left py-2.5 px-4 font-medium",children:"Koordinater"}),l.jsx("th",{className:"text-left py-2.5 px-4 font-medium",children:"Tillagd"}),l.jsx("th",{className:"text-right py-2.5 px-4 font-medium",children:"Åtgärd"})]})}),l.jsx("tbody",{children:B.map(M=>l.jsxs("tr",{className:"border-b border-border/50 last:border-0 hover:bg-secondary/30",children:[l.jsx("td",{className:"py-3 px-4 font-medium text-foreground",children:M.name}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground text-xs",children:M.latitude!==null&&M.longitude!==null?l.jsxs("span",{children:[M.latitude.toFixed(4),", ",M.longitude.toFixed(4)]}):l.jsx("span",{className:"italic",children:"Saknas"})}),l.jsx("td",{className:"py-3 px-4 text-muted-foreground text-xs",children:new Date(M.created_at).toLocaleDateString("sv-SE")}),l.jsx("td",{className:"py-3 px-4 text-right",children:l.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",onClick:()=>S(M),children:l.jsx(yd,{className:"h-4 w-4"})})})]},M.id))})]})})]}),l.jsxs("section",{children:[l.jsxs("h2",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:["Grundlista",l.jsx(Vt,{variant:"outline",className:"text-xs",children:R.length})]}),l.jsxs("div",{className:"bg-card border border-border rounded-xl p-4",children:[l.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Dessa städer är inbyggda i systemet och kan inte tas bort."}),l.jsx("div",{className:"flex flex-wrap gap-1.5 max-h-72 overflow-y-auto",children:R.map(M=>l.jsx(Vt,{variant:"secondary",className:"text-xs font-normal",children:M},M))})]})]}),l.jsx(Xi,{open:a,onOpenChange:M=>{o(M),M||C()},children:l.jsxs(Ei,{children:[l.jsxs(Ms,{children:[l.jsx(Rs,{children:"Lägg till stad eller område"}),l.jsx(xd,{children:"Skriv in namnet och slå upp koordinaterna automatiskt. Staden blir genast tillgänglig i hela systemet."})]}),l.jsxs("div",{className:"space-y-4 py-2",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-sm font-medium",children:"Stadens / områdets namn"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(ce,{value:c,onChange:M=>O(M.target.value),placeholder:"t.ex. Enköping",maxLength:100,onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),P())}}),l.jsx(se,{type:"button",variant:"outline",onClick:P,disabled:!c.trim()||d,children:d?l.jsx(js,{className:"h-4 w-4 animate-spin"}):"Slå upp"})]})]}),p&&l.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg bg-green-500/10 text-green-700 dark:text-green-400 border border-green-500/20",children:[l.jsx(Sh,{className:"h-4 w-4 mt-0.5 shrink-0"}),l.jsxs("div",{className:"text-xs space-y-1",children:[l.jsx("p",{className:"font-medium",children:"Koordinater hittade"}),l.jsx("p",{className:"text-muted-foreground",children:p.display}),l.jsxs("p",{className:"font-mono",children:[p.lat.toFixed(4),", ",p.lng.toFixed(4)]})]})]}),y&&l.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg bg-yellow-500/10 text-yellow-700 dark:text-yellow-400 border border-yellow-500/20",children:[l.jsx(Jae,{className:"h-4 w-4 mt-0.5 shrink-0"}),l.jsx("p",{className:"text-xs",children:y})]})]}),l.jsxs(Vo,{children:[l.jsx(se,{variant:"ghost",onClick:()=>o(!1),children:"Avbryt"}),l.jsx(se,{onClick:T,disabled:w||!c.trim(),children:w?"Sparar…":"Spara stad"})]})]})}),l.jsx(_d,{open:!!_,onOpenChange:M=>!M&&S(null),children:l.jsxs(Pc,{children:[l.jsxs(Mc,{children:[l.jsxs(Ic,{children:["Ta bort ",_==null?void 0:_.name,"?"]}),l.jsx(Lc,{children:"Staden tas bort från listan och kommer inte längre att gå att välja vid nya förfrågningar och annonser. Befintliga objekt behålls oförändrade."})]}),l.jsxs(Rc,{children:[l.jsx(Dc,{children:"Avbryt"}),l.jsx($c,{onClick:$,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Ta bort"})]})]})})]})}function vZe(){const[t,e]=x.useState([]),[r,n]=x.useState(!0),{cities:i}=Ep(),s=async()=>{n(!0);const{data:o}=await ie.from("properties").select("legacy_city_id, city").not("legacy_city_id","is",null),{data:c}=await ie.from("legacy_city_map").select("legacy_city_id, city_name"),u=new Map((c??[]).map(p=>[p.legacy_city_id,p.city_name])),d=new Map;
994(o??[]).forEach(p=>{const m=p.legacy_city_id,y=d.get(m)??{count:0,current:null};y.count++,!y.current&&p.city&&(y.current=p.city),d.set(m,y)});const f=Array.from(d.entries()).map(([p,m])=>({legacy_city_id:p,property_count:m.count,current_city:m.current,city_name:u.get(p)??m.current??""})).sort((p,m)=>m.property_count-p.property_count);e(f),n(!1)};x.useEffect(()=>{s()},[]);const a=async o=>{const c=t[o],u=c.city_name.trim();if(!u){ke.error("Ange ett områdesnamn");return}e(d=>d.map((f,p)=>p===o?{...f,saving:!0}:f));try{const{error:d}=await ie.from("legacy_city_map").upsert({legacy_city_id:c.legacy_city_id,city_name:u},{onConflict:"legacy_city_id"});if(d)throw d;const{error:f}=await ie.from("properties").update({city:u}).eq("legacy_city_id",c.legacy_city_id);if(f)throw f;ke.success(`${c.property_count} objekt uppdaterade till ${u}`),e(p=>p.map((m,y)=>y===o?{...m,saving:!1,current_city:u,city_name:u}:m))}catch(d){ke.error("Fel: "+d.message),e(f=>f.map((p,m)=>m===o?{...p,saving:!1}:p))}};return l.jsxs("div",{className:"p-6 max-w-4xl",children:[l.jsxs("div",{className:"mb-6",children:[l.jsx("h1",{className:"text-2xl font-bold mb-1",children:"Områden från gamla systemet"}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:["Mappa varje gammalt ",l.jsx("code",{children:"city_id"})," till ett områdesnamn. När du sparar uppdateras alla berörda objekt direkt."]})]}),r?l.jsx(js,{className:"h-5 w-5 animate-spin"}):t.length===0?l.jsxs("p",{className:"text-sm text-muted-foreground",children:["Inga importerade objekt med ",l.jsx("code",{children:"legacy_city_id"})," hittades."]}):l.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{className:"bg-muted text-left text-xs uppercase tracking-wider text-muted-foreground",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-4 py-2",children:"Legacy ID"}),l.jsx("th",{className:"px-4 py-2",children:"Antal"}),l.jsx("th",{className:"px-4 py-2",children:"Nuvarande område"}),l.jsx("th",{className:"px-4 py-2",children:"Sätt område"}),l.jsx("th",{className:"px-4 py-2 w-32"})]})}),l.jsx("tbody",{children:t.map((o,c)=>l.jsxs("tr",{className:"border-t border-border",children:[l.jsx("td",{className:"px-4 py-2 font-mono",children:o.legacy_city_id}),l.jsx("td",{className:"px-4 py-2",children:o.property_count}),l.jsx("td",{className:"px-4 py-2 text-muted-foreground",children:o.current_city??"—"}),l.jsx("td",{className:"px-4 py-2",children:l.jsx(ce,{list:"legacy-city-suggestions",value:o.city_name,onChange:u=>e(d=>d.map((f,p)=>p===c?{...f,city_name:u.target.value}:f)),placeholder:"t.ex. Solna, Vasastan…"})}),l.jsx("td",{className:"px-4 py-2",children:l.jsx(se,{size:"sm",onClick:()=>a(c),disabled:o.saving||!o.city_name.trim(),children:o.saving?l.jsx(js,{className:"h-3.5 w-3.5 animate-spin"}):l.jsxs(l.Fragment,{children:[l.jsx(IP,{className:"h-3.5 w-3.5 mr-1"}),"Spara"]})})})]},o.legacy_city_id))})]}),l.jsx("datalist",{id:"legacy-city-suggestions",children:i.map(o=>l.jsx("option",{value:o},o))})]})]})}const yZe=[{label:"Granska mina objekt",path:"/mina-sidor",icon:Qae},{label:"Lägg in nytt objekt",path:"/mina-sidor/nytt-objekt",icon:qa},{label:"Mina kontaktuppgifter",path:"/mina-sidor/profil",icon:Toe}];function xZe(){var c,u;const[t,e]=x.useState(!0),[r,n]=x.useState(null),i=Ti(),{pathname:s}=Oi(),{toast:a}=Qo();x.useEffect(()=>{(async()=>{const{data:{session:p}}=await ie.auth.getSession();if(!p){i("/logga-in");return}const{data:m}=await ie.from("user_roles").select("role").eq("user_id",p.user.id).eq("role","admin").maybeSingle();if(m){i("/admin");return}n(p.user),e(!1)})();const{data:{subscription:f}}=ie.auth.onAuthStateChange((p,m)=>{m||i("/logga-in")});return()=>f.unsubscribe()},[i]);const o=async()=>{await ie.auth.signOut(),a({title:"Utloggad"}),i("/")};return t?l.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:l.jsx("div",{className:"w-8 h-8 border-2 border-primary border-t-transparent rounded-full animate-spin"})}):l.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[l.jsx(Pr,{}),l.jsx(Vr,{}),l.jsx("main",{className:"flex-1 pt-4 pb-16",children:l.jsx("div",{className:"container mx-auto px-4",children:l.jsxs("div",{className:"flex flex-col md:flex-row gap-8",children:[l.jsx("aside",{className:"w-full md:w-64 shrink-0",children:l.jsxs("div",{className:"bg-card rounded-xl border border-border/60 shadow-card p-4",children:[l.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-1",children:"Inloggad"}),l.jsxs("p",{className:"text-sm font-semibold text-foreground mb-4 truncate",children:[(c=r==null?void 0:r.user_metadata)==null?void 0:c.first_name," ",(u=r==null?void 0:r.user_metadata)==null?void 0:u.last_name]}),l.jsx("nav",{className:"space-y-1",children:yZe.map(d=>{const f=s===d.path;return l.jsxs(Re,{to:d.path,className:`flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm transition-colors ${f?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[l.jsx(d.icon,{className:"h-4 w-4"}),d.label]},d.path)})}),l.jsxs(se,{variant:"destructive",className:"w-full mt-4",onClick:o,children:[l.jsx(CH,{className:"h-4 w-4 mr-2"}),"Logga ut"]})]})}),l.jsx("div",{className:"flex-1 min-w-0",children:l.jsx($U,{})})]})})}),l.jsx(Mr,{})]})}const bZe=["Lägenhet","Hus","Radhus","Villa","Rum","Stuga","Övrigt"],Hz=Array.from({length:10},(t,e)=>String(e+1)),wZe=["1","1.5","2","2.5","3","3.5","4","4.5","5","5.5","6","6.5","7","7.5","8","8.5","9","9.5","10"],_Ze=["El","Vatten","Värme","Kabel-tv","Bredband","Gas","P-plats","Garage"],kZe=["Egen ingång","Hiss finns","Badkar","Dusch","Extra badrum","Bastu","Ej barn","Ej rökare","Ej husdjur","Kök","Kokvrå","Pentry","Trinett","Diskmaskin","Tvättmaskin","Torktumlare","Öppenspis","Balkong","Fransk balkong","Uteplats","Trädgård","Gäst WC"],Vz={property_type:"Lägenhet",rooms:1,bedrooms:void 0,bathrooms:void 0,area_sqm:"",secondary_area_sqm:"",city:"",street_address:"",postal_code:"",floor:"",door_code:"",furnished:!1,furnished_rent:"",unfurnished:!1,unfurnished_rent:"",partially_furnished:!1,partially_furnished_rent:"",move_in_date:"",move_out_date:"",immediate:!1,possibly_longer:!1,indef
994inite:!1,included_in_rent:[],built_year:"",renovated_year:"",amenities:[],garden_sqm:"",description:""};function Wz(){const{toast:t}=Qo(),e=Ti(),{id:r}=gy(),n=!!r,[i,s]=x.useState(!1),[a,o]=x.useState(!1),[c,u]=x.useState(n),[d,f]=x.useState([]),{cities:p}=Ep(),[m,y]=x.useState(Vz),v=(N,j)=>y(C=>({...C,[N]:j}));x.useEffect(()=>{if(!r){y(Vz),f([]),o(!1);return}(async()=>{const{data:{user:N}}=await ie.auth.getUser();if(!N){e("/mina-sidor");return}const{data:j,error:C}=await ie.from("properties").select("*").eq("id",r).eq("user_id",N.id).maybeSingle();if(C||!j){t({title:"Kunde inte hämta annonsen",variant:"destructive"}),e("/mina-sidor");return}y({property_type:j.property_type||"Lägenhet",rooms:Number(j.rooms)||1,bedrooms:j.bedrooms??void 0,bathrooms:j.bathrooms??void 0,area_sqm:j.area_sqm!=null?String(j.area_sqm):"",secondary_area_sqm:j.secondary_area_sqm!=null?String(j.secondary_area_sqm):"",city:j.city||"",street_address:j.street_address||"",postal_code:j.postal_code||"",floor:j.floor||"",door_code:j.door_code||"",furnished:!!j.furnished,furnished_rent:j.furnished_rent!=null?String(j.furnished_rent):"",unfurnished:!!j.unfurnished,unfurnished_rent:j.unfurnished_rent!=null?String(j.unfurnished_rent):"",partially_furnished:!!j.partially_furnished,partially_furnished_rent:j.partially_furnished_rent!=null?String(j.partially_furnished_rent):"",move_in_date:j.move_in_date||"",move_out_date:j.move_out_date||"",immediate:!!j.immediate,possibly_longer:!!j.possibly_longer,indefinite:!!j.indefinite,included_in_rent:j.included_in_rent||[],built_year:j.built_year!=null?String(j.built_year):"",renovated_year:j.renovated_year!=null?String(j.renovated_year):"",amenities:j.amenities||[],garden_sqm:j.garden_sqm!=null?String(j.garden_sqm):"",description:j.description||""}),f((j.images||[]).map((O,P)=>({id:`${P}-${O}`,url:O}))),u(!1)})()},[r]);const w=(N,j)=>{y(C=>({...C,[N]:C[N].includes(j)?C[N].filter(O=>O!==j):[...C[N],j]}))},b=N=>{if(N.target.files){const j=Array.from(N.target.files).map(C=>({id:crypto.randomUUID(),file:C,url:URL.createObjectURL(C)}));f(C=>[...C,...j])}},_=N=>f(j=>j.filter(C=>C.id!==N)),S=async N=>{N.preventDefault(),s(!0);try{const{data:{user:j}}=await ie.auth.getUser();if(!j)throw new Error("Ej inloggad");const C=[];for(const T of d){if(!T.file){C.push(T.url);continue}const $=T.file.name.split(".").pop(),B=`${j.id}/${crypto.randomUUID()}.${$}`,{error:R}=await ie.storage.from("property-images").upload(B,T.file);if(R)throw R;const{data:{publicUrl:M}}=ie.storage.from("property-images").getPublicUrl(B);C.push(M)}const O={property_type:m.property_type,rooms:m.rooms,bedrooms:m.bedrooms||null,bathrooms:m.bathrooms||null,area_sqm:m.area_sqm?Number(m.area_sqm):null,secondary_area_sqm:m.secondary_area_sqm?Number(m.secondary_area_sqm):null,city:m.city||null,street_address:m.street_address||null,postal_code:m.postal_code||null,floor:m.floor||null,door_code:m.door_code||null,furnished:m.furnished,furnished_rent:m.furnished_rent?Number(m.furnished_rent):null,unfurnished:m.unfurnished,unfurnished_rent:m.unfurnished_rent?Number(m.unfurnished_rent):null,partially_furnished:m.partially_furnished,partially_furnished_rent:m.partially_furnished_rent?Number(m.partially_furnished_rent):null,move_in_date:m.move_in_date||null,move_out_date:m.move_out_date||null,immediate:m.immediate,possibly_longer:m.possibly_longer,indefinite:m.indefinite,included_in_rent:m.included_in_rent,built_year:m.built_year?Number(m.built_year):null,renovated_year:m.renovated_year?Number(m.renovated_year):null,amenities:m.amenities,garden_sqm:m.garden_sqm?Number(m.garden_sqm):null,description:m.description||null,images:C};if(n&&r){const{error:T}=await ie.from("properties").update({...O,status:"pending"}).eq("id",r).eq("user_id",j.id);if(T)throw T;t({title:"Annons uppdaterad!",description:"Dina ändringar väntar nu på godkännande."}),e("/mina-sidor");return}const{error:P}=await ie.from("properties").insert({user_id:j.id,...O});if(P)throw P;ie.functions.invoke("send-landlord-email",{body:{type:"submission_confirmation",user_id:j.id,email:j.email,address:[m.street_address,m.city].filter(
994Boolean).join(", ")||void 0}}).catch(T=>console.warn("confirmation email failed",T)),t({title:"Objekt sparat!",description:"Ditt objekt väntar nu på godkännande."}),e("/mina-sidor")}catch(j){t({title:"Fel",description:j.message,variant:"destructive"})}finally{s(!1)}};return c?l.jsx("div",{className:"flex justify-center py-12",children:l.jsx("div",{className:"w-6 h-6 border-2 border-primary border-t-transparent rounded-full animate-spin"})}):l.jsxs("div",{className:"bg-card rounded-xl border border-border/60 shadow-card",children:[l.jsxs("div",{className:"border-b border-border/60 px-6 py-4",children:[l.jsx("h1",{className:"text-xl font-bold text-foreground",children:n?"Redigera annons":"Lägg in nytt objekt"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:n?"Ändra uppgifterna och spara – annonsen granskas sedan på nytt innan den visas.":"Fyll i uppgifterna om din bostad"})]}),l.jsxs("form",{onSubmit:S,className:"p-6 space-y-8",children:[l.jsx(gl,{title:"Bostadstyp",children:l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[l.jsx(Ln,{label:"Bostadstyp",children:l.jsxs(Nt,{value:m.property_type,onValueChange:N=>v("property_type",N),children:[l.jsx(_t,{children:l.jsx(Ct,{})}),l.jsx(kt,{children:bZe.map(N=>l.jsx(De,{value:N,children:N},N))})]})}),l.jsx(Ln,{label:"Antal rum",required:!0,children:l.jsxs(Nt,{value:String(m.rooms),onValueChange:N=>v("rooms",Number(N)),children:[l.jsx(_t,{children:l.jsx(Ct,{})}),l.jsx(kt,{children:wZe.map(N=>l.jsx(De,{value:N,children:N},N))})]})}),l.jsx(Ln,{label:"Antal sovrum",children:l.jsxs(Nt,{value:m.bedrooms!==void 0?String(m.bedrooms):"",onValueChange:N=>v("bedrooms",Number(N)),children:[l.jsx(_t,{children:l.jsx(Ct,{placeholder:"Antal sovrum"})}),l.jsx(kt,{children:Hz.map(N=>l.jsx(De,{value:N,children:N},N))})]})}),l.jsx(Ln,{label:"Antal badrum",children:l.jsxs(Nt,{value:m.bathrooms!==void 0?String(m.bathrooms):"",onValueChange:N=>v("bathrooms",Number(N)),children:[l.jsx(_t,{children:l.jsx(Ct,{placeholder:"Antal badrum"})}),l.jsx(kt,{children:Hz.map(N=>l.jsx(De,{value:N,children:N},N))})]})}),l.jsx(Ln,{label:"Yta (KVM)",children:l.jsx(ce,{type:"number",placeholder:"Yta (KVM)",value:m.area_sqm,onChange:N=>v("area_sqm",N.target.value)})}),l.jsx(Ln,{label:"Biyta (KVM)",children:l.jsx(ce,{type:"number",placeholder:"Biyta",value:m.secondary_area_sqm,onChange:N=>v("secondary_area_sqm",N.target.value)})})]})}),l.jsx(gl,{title:"Adress till bostaden",children:l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[l.jsx(Ln,{label:"Stad",children:l.jsx(H_,{value:m.city,onChange:N=>v("city",N),options:p,placeholder:"Välj stad"})}),l.jsx(Ln,{label:"Gatuadress",children:l.jsx(ce,{placeholder:"Gatuadress",value:m.street_address,onChange:N=>v("street_address",N.target.value)})}),l.jsx(Ln,{label:"Postnummer",children:l.jsx(ce,{placeholder:"Postnummer",value:m.postal_code,onChange:N=>v("postal_code",N.target.value)})}),l.jsx(Ln,{label:"Våning",children:l.jsx(ce,{placeholder:"Våning",value:m.floor,onChange:N=>v("floor",N.target.value)})}),l.jsx(Ln,{label:"Portkod",children:l.jsx(ce,{placeholder:"Portkod",value:m.door_code,onChange:N=>v("door_code",N.target.value)})})]})}),l.jsx(gl,{title:"Möblering och hyra",children:l.jsxs("div",{className:"space-y-4",children:[l.jsx(pC,{label:"Möblerat",checked:m.furnished,onCheck:N=>v("furnished",N),rent:m.furnished_rent,onRent:N=>v("furnished_rent",N)}),l.jsx(pC,{label:"Omöblerat",checked:m.unfurnished,onCheck:N=>v("unfurnished",N),rent:m.unfurnished_rent,onRent:N=>v("unfurnished_rent",N)}),l.jsx(pC,{label:"Delvis möblerat",checked:m.partially_furnished,onCheck:N=>v("partially_furnished",N),rent:m.partially_furnished_rent,onRent:N=>v("partially_furnished_rent",N)})]})}),l.jsxs(gl,{title:"Period",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsx(Ln,{label:"Inflyttning",children:l.jsx(ce,{type:"date",value:m.move_in_date,onChange:N=>v("move_in_date",N.target.value)})}),l.jsx(Ln,{label:"Utflyttning",children:l.jsx(ce,{type:"date",value:m.move_out_date,onChange:N=>v("move_out_date",N.target.value)})})]}),l.jsxs("div",{className:"flex flex-wrap gap-6 mt-4",children:[l.jsx(gf,{label:"Omgående",checked:m.immediate,onCheck:N=>v("immediate",N)}),l.jsx(gf,{label:"Eventuellt längre",checked:m.possibly_longer,onCheck:N=>v("possibly_longer",N)}),l.jsx(gf,{label:"Tillsvidare",checked:m.indefinite,onCheck:N=>
994v("indefinite",N)})]})]}),l.jsx(gl,{title:"Ingår i hyran",children:l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3",children:_Ze.map(N=>l.jsx(gf,{label:N,checked:m.included_in_rent.includes(N),onCheck:()=>w("included_in_rent",N)},N))})}),l.jsxs(gl,{title:"Övrig info",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4",children:[l.jsx(Ln,{label:"Byggt år",children:l.jsx(ce,{type:"number",placeholder:"Byggt år",value:m.built_year,onChange:N=>v("built_year",N.target.value)})}),l.jsx(Ln,{label:"Renoverat år",children:l.jsx(ce,{type:"number",placeholder:"Renoverat år",value:m.renovated_year,onChange:N=>v("renovated_year",N.target.value)})})]}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3",children:kZe.map(N=>l.jsx(gf,{label:N,checked:m.amenities.includes(N),onCheck:()=>w("amenities",N)},N))}),l.jsx("div",{className:"mt-4 max-w-xs",children:l.jsx(Ln,{label:"Trädgård KVM",children:l.jsx(ce,{type:"number",placeholder:"Trädgård KVM",value:m.garden_sqm,onChange:N=>v("garden_sqm",N.target.value)})})})]}),l.jsxs(gl,{title:"Beskriv ditt objekt",children:[l.jsx(Is,{placeholder:"Beskriv bostaden kort och konkret: läge, kommunikationer, storlek, planlösning och vad som ingår.",rows:6,required:!0,maxLength:1200,value:m.description,onChange:N=>v("description",N.target.value.slice(0,1200))}),l.jsxs("div",{className:"flex items-center justify-between mt-2 text-xs text-muted-foreground",children:[l.jsx("span",{children:"Rekommenderat: 600–1 200 tecken. Håll det sakligt, undvik emojis och versaler."}),l.jsxs("span",{className:m.description.length>1100?"text-destructive font-medium":"",children:[m.description.length," / 1200"]})]})]}),l.jsx(gl,{title:"Ladda upp bilder",children:l.jsxs("div",{className:"space-y-3",children:[l.jsx(RR,{images:d.map(({id:N,url:j})=>({id:N,url:j})),onReorder:N=>f(N.map(j=>d.find(C=>C.id===j.id)).filter(Boolean)),onRemove:_}),d.length>0&&l.jsx("p",{className:"text-xs text-muted-foreground",children:"Dra i handtaget för att ändra ordning – första bilden blir huvudbild i annonsen."}),l.jsxs("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-primary hover:underline",children:[l.jsx(qa,{className:"h-4 w-4"}),"Lägg till bild",l.jsx("input",{type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:b})]})]})}),l.jsxs("div",{className:"rounded-lg border border-primary/20 bg-primary/5 p-4 text-sm text-foreground leading-relaxed",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Betalning vid förmedling"})," — Du betalar först när vi hittat rätt hyresgäst."]}),l.jsxs("p",{className:"mt-1",children:["» ",l.jsx("strong",{children:"Förmedlingsavgift"})," — 15 % av första månadshyran för lägenheter. För villor och radhus är avgiften 50 % av första månadshyran."]})]}),l.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border/60 bg-muted/40 p-4",children:[l.jsx(Ls,{id:"accept-terms",checked:a,onCheckedChange:N=>o(N===!0),className:"mt-0.5"}),l.jsxs("label",{htmlFor:"accept-terms",className:"text-sm text-foreground cursor-pointer leading-relaxed",children:["Jag har läst och accepterar Företagslogis"," ",l.jsx("a",{href:"/anvandarvillkor",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2",children:"användarvillkor"})," ","och bekräftar att uppgifterna i annonsen är korrekta. ",l.jsx("span",{className:"text-destructive",children:"*"})]})]}),l.jsx(se,{variant:"hero",size:"lg",type:"submit",disabled:i||!a,className:"w-full sm:w-auto",children:i?"Sparar...":n?"Spara ändringar":"Spara annons"})]})]})}function gl({title:t,children:e}){return l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold text-foreground mb-1",children:t}),l.jsx("div",{className:"h-px bg-border/60 mb-4"}),e]})}function Ln({label:t,required:e,children:r}){return l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs(Ve,{children:[t,e&&l.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),r]})}function pC({label:t,checked:e,onCheck:r,rent:n,onRent:i}){return l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("div",{className:"w-40",children:l.jsx(gf,{label:t,checked:e,onCheck:r})}),l.jsx(ce,{type:"number",placeholder:"SEK - Månadshyra",className:"max-w-[200px]",value:n,onChange:s=>i(s.target.value),disabled:!e})]})}function gf({label:t,checked:e,onCheck:r}){return l.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[l.jsx(Ls,{checked:e,onCheckedChange:n=>r(n===!0)}),l.jsx("span",{className:"text-sm text-foreground",children:t})]})}const qz={pending:{label:"Väntar på godkännande",variant:"secondary"},approved:{label:"Godkänd",variant:"default"},rejected:{label:"Nekad",variant:"destructive"},draft:{label:"Utkast",variant:"outline"},rented:{label:"Uthyrd",variant:"outline"},archived:{label:"Arkiverad",variant:"outline"}};function SZe(){const[t,e]=x.useState([]),[r,n]=x.useState(!0),[i,s]=x.useState(null),a=async()=>{const{data:{user:d}}=await ie.auth.getUser();if(!d){e([]),n(!1);return}const{data:f}=await ie.from("properties").select("*").eq("user_id",d.id).order("created_at",{ascending:!1});e(f||[]),n(!1)};x.useEffect(()=>{a()},[]);const o=d=>
994[d.street_address,d.city].filter(Boolean).join(", "),c=async()=>{const d=i;if(!d)return;const{error:f}=await ie.from("properties").update({status:"archived"}).eq("id",d.id);if(f){ke.error("Kunde inte arkivera annonsen");return}Cg({action:"archived",propertyId:d.id,address:o(d),actorRole:"Uthyrare"}),ke.success("Annonsen är arkiverad"),s(null),a()},u=async d=>{const{error:f}=await ie.from("properties").update({status:"pending"}).eq("id",d.id);if(f){ke.error("Kunde inte återställa annonsen");return}Cg({action:"unarchived",propertyId:d.id,address:o(d),actorRole:"Uthyrare"}),ke.success("Annonsen är återställd och väntar på granskning"),a()};return r?l.jsx("div",{className:"flex justify-center py-12",children:l.jsx("div",{className:"w-6 h-6 border-2 border-primary border-t-transparent rounded-full animate-spin"})}):l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-6",children:[l.jsx("h1",{className:"text-xl font-bold text-foreground",children:"Mina objekt"}),l.jsx(se,{asChild:!0,children:l.jsxs(Re,{to:"/mina-sidor/nytt-objekt",children:[l.jsx(qa,{className:"h-4 w-4 mr-2"}),"Nytt objekt"]})})]}),t.length===0?l.jsxs("div",{className:"bg-card rounded-xl border border-border/60 shadow-card p-12 text-center",children:[l.jsx(Ss,{className:"h-10 w-10 text-muted-foreground mx-auto mb-3"}),l.jsx("p",{className:"text-muted-foreground mb-4",children:"Du har inga objekt ännu."}),l.jsx(se,{asChild:!0,children:l.jsxs(Re,{to:"/mina-sidor/nytt-objekt",children:[l.jsx(qa,{className:"h-4 w-4 mr-2"}),"Lägg in ditt första objekt"]})})]}):l.jsx("div",{className:"space-y-4",children:t.map(d=>{var m;const f=qz[d.status]||qz.draft,p=d.status==="archived";return l.jsxs("div",{className:"bg-card rounded-xl border border-border/60 shadow-card p-4 flex flex-col sm:flex-row gap-4",children:[((m=d.images)==null?void 0:m[0])&&l.jsx("img",{src:d.images[0],alt:"",className:"w-full sm:w-32 h-24 object-cover rounded-lg"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsxs("div",{children:[l.jsxs("h3",{className:"font-semibold text-foreground",children:[d.property_type," · ",d.rooms," rum"]}),d.street_address&&l.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-1 mt-0.5",children:[l.jsx(Vn,{className:"h-3.5 w-3.5"}),d.street_address,d.city?`, ${d.city}`:""]})]}),l.jsx(Vt,{variant:f.variant,children:f.label})]}),d.area_sqm&&l.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[d.area_sqm," m²"]}),l.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:p?l.jsxs(se,{variant:"outline",size:"sm",onClick:()=>u(d),children:[l.jsx(fH,{className:"h-4 w-4 mr-2"}),"Återställ annons"]}):l.jsxs(l.Fragment,{children:[l.jsx(se,{variant:"outline",size:"sm",asChild:!0,children:l.jsxs(Re,{to:`/mina-sidor/redigera/${d.id}`,children:[l.jsx(zo,{className:"h-4 w-4 mr-2"}),"Redigera annons"]})}),l.jsxs(se,{variant:"outline",size:"sm",onClick:()=>s(d),children:[l.jsx(hH,{className:"h-4 w-4 mr-2"}),"Arkivera annons"]})]})})]})]},d.id)})}),l.jsx(_d,{open:!!i,onOpenChange:d=>!d&&s(null),children:l.jsxs(Pc,{children:[l.jsxs(Mc,{children:[l.jsx(Ic,{children:"Arkivera annonsen?"}),l.jsx(Lc,{children:"Annonsen tas bort från sajten men sparas så att den kan tas fram igen senare. Du kan återställa den själv när du vill."})]}),l.jsxs(Rc,{children:[l.jsx(Dc,{children:"Avbryt"}),l.jsx($c,{onClick:c,children:"Arkivera"})]})]})})]})}function jZe(){const{toast:t}=Qo(),[e,r]=x.useState(!0),[n,i]=x.useState(!1),[s,a]=x.useState({first_name:"",last_name:"",phone:""});x.useEffect(()=>{(async()=>{const{data:{user:u}}=await ie.auth.getUser();if(!u)return;const{data:d}=await ie.from("profiles").select("*").eq("user_id",u.id).single();d&&a({first_name:d.first_name,last_name:d.last_name,phone:d.phone}),r(!1)})()},[]);const o=async c=>{c.preventDefault(),i(!0);const{data:{user:u}}=await ie.auth.getUser();if(!u)return;const{error:d}=await ie.from("profiles").update(s).eq("user_id",u.id);i(!1),t(d?{title:"Fel",description:d.message,variant:"destructive"}:{title:"Uppgifter sparade!"})};return e?l.jsx("div",{className:"flex justify-center py-12",children:l.jsx("div",{className:"w-6 h-6 border-2 border-primary border-t-transparent roun
994ded-full animate-spin"})}):l.jsxs("div",{className:"bg-card rounded-xl border border-border/60 shadow-card p-6",children:[l.jsx("h1",{className:"text-xl font-bold text-foreground mb-6",children:"Mina kontaktuppgifter"}),l.jsxs("form",{onSubmit:o,className:"space-y-4 max-w-md",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{children:"Förnamn"}),l.jsx(ce,{value:s.first_name,onChange:c=>a(u=>({...u,first_name:c.target.value}))})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{children:"Efternamn"}),l.jsx(ce,{value:s.last_name,onChange:c=>a(u=>({...u,last_name:c.target.value}))})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Ve,{children:"Telefon"}),l.jsx(ce,{value:s.phone,onChange:c=>a(u=>({...u,phone:c.target.value}))})]}),l.jsx(se,{type:"submit",disabled:n,children:n?"Sparar...":"Spara"})]})]})}const NZe=()=>l.jsxs("div",{className:"min-h-screen",children:[l.jsx(Pr,{}),l.jsx(Vr,{}),l.jsx("section",{className:"pt-4 sm:pt-6 pb-12 sm:pb-16 bg-accent",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14 max-w-3xl text-center",children:[l.jsx("p",{className:"text-xs sm:text-sm font-semibold text-primary uppercase tracking-wider mb-3",children:"Juridiskt"}),l.jsx("h1",{className:"text-3xl sm:text-4xl md:text-5xl font-extrabold mb-4",children:"Användarvillkor"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base",children:"Senast uppdaterad: 12 juli 2026"})]})}),l.jsx("section",{className:"py-14 sm:py-20",children:l.jsx("div",{className:"container mx-auto px-10 md:px-14 max-w-3xl prose prose-sm sm:prose-base",children:l.jsxs("div",{className:"space-y-6 text-sm sm:text-base text-muted-foreground leading-relaxed",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"1. Allmänt"}),l.jsx("p",{children:"Dessa användarvillkor reglerar användningen av Företagslogis tjänster. Företagslogi är en bifirma till Bostad för dig i Stockholm AB (org-nummer: 556555-8078). Genom att använda vÃ¥r tjänst accepterar du dessa villkor."})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"2. Tjänsten"}),l.jsx("p",{children:"Företagslogi förmedlar företagsbostäder i Stockholm mellan fastighetsägare och företag. Vi agerar som mellanhand och ansvarar inte för bostädernas skick eller hyresförhÃ¥llandet mellan parterna."})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"3. Användarkonto"}),l.jsx("p",{children:"Du ansvarar för att uppgifterna du lämnar är korrekta och att hÃ¥lla dina inloggningsuppgifter säkra. Konton som missbrukas kan stängas av utan förvarning."})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"4. Avgifter"}),l.jsx("p",{children:"Det är kostnadsfritt att söka bostad. Förmedlingsavgift faktureras först vid lyckad förmedling enligt separat avtal."})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"5. Ansvarsbegränsning"}),l.jsx("p",{children:"Företagslogi ansvarar inte för indirekta skador eller följdskador som uppstÃ¥r genom användning av tjänsten."})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"6. Ändringar"}),l.jsx("p",{children:"Vi förbehÃ¥ller oss rätten att uppdatera dessa villkor. Väsentliga ändringar meddelas via e-post eller pÃ¥ hemsidan."})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"7. Kontakt"}),l.jsxs("p",{children:["FrÃ¥gor om villkoren? Kontakta oss pÃ¥ ",l.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"}),"."]})]})]})})}),l.jsx(Mr,{})]}),CZe=()=>l.jsxs("div",{className:"min-h-screen",children:[l.jsx(Pr,{}),l.jsx(Vr,{}),l.jsx("section",{className:"pt-4 sm:pt-6 pb-12 sm:pb-16 bg-accent",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14 max-w-3xl text-center",children:[l.jsx("p",{className:"text-xs sm:text-sm font-semibold text-primary uppercase tracking-wider mb-3",children:"Juri
994diskt"}),l.jsx("h1",{className:"text-3xl sm:text-4xl md:text-5xl font-extrabold mb-4",children:"Integritetspolicy"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base",children:"Senast uppdaterad: 12 juli 2026"})]})}),l.jsx("section",{className:"py-14 sm:py-20",children:l.jsx("div",{className:"container mx-auto px-10 md:px-14 max-w-3xl",children:l.jsxs("div",{className:"space-y-6 text-sm sm:text-base text-muted-foreground leading-relaxed",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"Personuppgiftsansvarig"}),l.jsx("p",{children:"Bostad för dig i Stockholm AB (org-nummer: 556555-8078), Sveavägen 61, 113 59 Stockholm, är personuppgiftsansvarig för behandlingen av dina personuppgifter."})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"Vilka uppgifter vi samlar in"}),l.jsx("p",{children:"Vi samlar in namn, e-post, telefonnummer, företagsuppgifter och information om dina bostadsbehov. För fastighetsägare samlar vi även in uppgifter om bostäder."})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"ÄndamÃ¥l med behandlingen"}),l.jsx("p",{children:"Uppgifterna används för att förmedla bostäder, kommunicera med dig, hantera avtal och fakturering samt uppfylla rättsliga skyldigheter."})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"Rättslig grund"}),l.jsx("p",{children:"Behandlingen sker baserat pÃ¥ avtal, samtycke, berättigat intresse eller rättslig förpliktelse beroende pÃ¥ sammanhang."})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"Lagringstid"}),l.jsx("p",{children:"Vi sparar dina uppgifter sÃ¥ länge det är nödvändigt för ändamÃ¥let eller enligt lagkrav (t.ex. bokföringslagen, 7 Ã¥r)."})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"Dina rättigheter"}),l.jsxs("p",{children:["Du har rätt att begära tillgÃ¥ng, rättelse, radering, begränsning och dataportabilitet. Kontakta oss pÃ¥ ",l.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"}),". Du har även rätt att klaga hos Integritetsskyddsmyndigheten (IMY)."]})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"Säkerhet"}),l.jsx("p",{children:"Vi vidtar tekniska och organisatoriska Ã¥tgärder för att skydda dina uppgifter mot obehörig Ã¥tkomst, förlust eller ändring."})]})]})})}),l.jsx(Mr,{})]}),EZe=()=>l.jsxs("div",{className:"min-h-screen",children:[l.jsx(Pr,{}),l.jsx(Vr,{}),l.jsx("section",{className:"pt-4 sm:pt-6 pb-12 sm:pb-16 bg-accent",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14 max-w-3xl text-center",children:[l.jsx("p",{className:"text-xs sm:text-sm font-semibold text-primary uppercase tracking-wider mb-3",children:"Juridiskt"}),l.jsx("h1",{className:"text-3xl sm:text-4xl md:text-5xl font-extrabold mb-4",children:"Om GDPR"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base",children:"Hur vi följer dataskyddsförordningen"})]})}),l.jsx("section",{className:"py-14 sm:py-20",children:l.jsx("div",{className:"container mx-auto px-10 md:px-14 max-w-3xl",children:l.jsxs("div",{className:"space-y-6 text-sm sm:text-base text-muted-foreground leading-relaxed",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"Vad är GDPR?"}),l.jsx("p",{children:"GDPR (General Data Protection Regulation) är EU:s dataskyddsförordning som gäller sedan 25 maj 2018. Den stärker individers rättigheter när det gäller personuppgifter och ställer krav pÃ¥ företag som behandlar sÃ¥dana."})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"Hur Företagslogi följer GDPR"}),l.jsxs("p",{children:["Vi behandlar endast nödvändiga personuppgifter, har tydliga ändamÃ¥l för behandlingen, säkerställer ett gott skydd och respekterar dina rättigheter. Läs mer i vÃ¥r ",l.jsx("a",{href:"/integritetspolicy",className:"text-primary hover:underline",children:"integritetspolicy"}),"."]})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"Dina rättigheter enligt GDPR"}),l.jsxs("ul",{className:"list-disc list-inside space-y-2",children:[l.jsx("li",{children:"Rätt till information om hur dina uppgifter behandlas"}),l.jsx("li",{children:"Rätt till tillgÃ¥ng till dina personuppgifter (registerutdrag)"}),l.jsx("li",{children:"Rätt till rättelse av felaktiga uppgifter"}),l.jsx("li",{children:'Rätt till radering ("rätten att bli glömd")'}),l.jsx("li",{children:"Rätt till begränsning av behandlingen"}),l.jsx("li",{children:"Rätt till dataportabilitet"}),l.jsx("li",{children:"Rätt att invända mot behandling"}),l.jsx("li",{children:"Rätt att lämna klagomÃ¥l till tillsynsmyndighet (IMY)"})]})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"Utöva dina rättigheter"}),l.jsxs("p",{children:["Vill du utöva nÃ¥gon av dina rättigheter? Kontakta oss pÃ¥ ",l.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"}),". Vi svarar inom 30 dagar."]})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"Tillsynsmyndighet"}),l.jsxs("p",{children:["Integritetsskyddsmyndigheten (IMY) är tillsynsmyndighet för dataskydd i Sverige. Mer info finns pÃ¥ ",l.jsx("a",{href:"https://www.imy.se",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"imy.se"}),"."]})]})]})})}),l.jsx(Mr,{})]}),OZe=()=>l.jsxs("div",{className:"min-h-screen",children:[l.jsx(Pr,{}),l.jsx(Vr,{}),l.jsx("section",{className:"pt-4 sm:pt-6 pb-12 sm:pb-16 bg-accent",children:l.jsxs("div",{className:"container mx-auto px-10 md:px-14 max-w-3xl text-center",children:[l.jsx("p",{className:"text-xs sm:text-sm font-semibold text-primary uppercase tracking-wider mb-3",children:"Juri
994diskt"}),l.jsx("h1",{className:"text-3xl sm:text-4xl md:text-5xl font-extrabold mb-4",children:"Cookies"}),l.jsx("p",{className:"text-muted-foreground text-sm sm:text-base",children:"Hur vi använder cookies pÃ¥ foretagslogi.se"})]})}),l.jsx("section",{className:"py-14 sm:py-20",children:l.jsx("div",{className:"container mx-auto px-10 md:px-14 max-w-3xl",children:l.jsxs("div",{className:"space-y-6 text-sm sm:text-base text-muted-foreground leading-relaxed",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"Vad är cookies?"}),l.jsx("p",{children:"Cookies är smÃ¥ textfiler som lagras pÃ¥ din enhet när du besöker en webbplats. De hjälper oss att förbättra din upplevelse och förstÃ¥ hur sajten används."})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"Cookies vi använder"}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"font-semibold text-foreground mb-1",children:"Nödvändiga cookies"}),l.jsx("p",{children:"Krävs för att webbplatsen ska fungera, t.ex. för inloggning och säkerhet. Dessa kan inte stängas av."})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-semibold text-foreground mb-1",children:"Funktionella cookies"}),l.jsx("p",{children:"Sparar dina inställningar, t.ex. sprÃ¥kval och sökfilter, för en bättre upplevelse."})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-semibold text-foreground mb-1",children:"Analyscookies"}),l.jsx("p",{children:"Hjälper oss förstÃ¥ hur besökare använder sajten sÃ¥ vi kan förbättra den. Anonymiserad statistik."})]})]})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"Hantera cookies"}),l.jsx("p",{children:"Du kan när som helst ändra eller Ã¥terkalla ditt samtycke i din webbläsares inställningar. De flesta webbläsare lÃ¥ter dig blockera eller ta bort cookies. Observera att vissa funktioner kan sluta fungera om du blockerar nödvändiga cookies."})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"Tredjepartscookies"}),l.jsx("p",{children:"Vi använder enbart tjänster som följer GDPR. Tredjepartscookies kan sättas av t.ex. analystjänster och kartleverantörer."})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:"FrÃ¥gor"}),l.jsxs("p",{children:["Har du frÃ¥gor om vÃ¥r cookie-användning? Kontakta oss pÃ¥ ",l.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"}),"."]})]})]})})}),l.jsx(Mr,{})]}),TZe=()=>{const{pathname:t,hash:e}=Oi();return x.useEffect(()=>{"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual")},[]),x.useEffect(()=>{e||window.scrollTo({top:0,left:0,behavior:"auto"})},[t,e]),null},AZe=new sie,PZe=()=>l.jsx(oie,{client:AZe,children:l.jsxs(xV,{children:[l.jsx(hle,{}),l.jsx(qse,{}),l.jsxs(ose,{children:[l.jsx(TZe,{}),l.jsxs(Xie,{children:[l.jsx(Ke,{path:"/",element:l.jsx(Zge,{})}),l.jsx(Ke,{path:"/bostader",element:l.jsx(jxe,{})}),l.jsx(Ke,{path:"/bostader/:citySlug",element:l.jsx(Vge,{})}),l.jsx(Ke,{path:"/om-oss",element:l.jsx(Mxe,{})}),l.jsx(Ke,{path:"/kontakt",element:l.jsx(Rxe,{})}),l.jsx(Ke,{path:"/foretagsservice",element:l.jsx(Obe,{})}),l.jsx(Ke,{path:"/bostad/:id",element:l.jsx(Qye,{})}),l.jsx(Ke,{path:"/hyra-ut",element:l.jsx(Fbe,{})}),l.jsx(Ke,{path:"/medarbetare/annelie-permerin",element:l.jsx(nNe,{})}),l.jsx(Ke,{path:"/medarbetare/ulrika-nystrom",element:l.jsx(iNe,{})}),l.jsx(Ke,{path:"/registrera",element:l.jsx(Exe,{})}),l.jsx(Ke,{path:"/logga-in",element:l.jsx(Oxe,{})}),l.jsx(Ke,{path:"/glomt-losenord",element:l.jsx(Txe,{})}),l.jsx(Ke,{path:"/aterstall-losenord",element:l.jsx(Axe,{})}),l.jsx(Ke,{path:"/anvandarvillkor",element:l.jsx(NZe,{})}),l.jsx(Ke,{path:"/integritetspolicy",element:l.jsx(CZe,{})}),l.jsx(Ke,{path:"/om-gdpr",element:l.jsx(EZe,{})}),l.jsx(Ke,{path:"/cookies",element:l.jsx(OZe,{})}),l.jsxs(Ke,{path:"/mina-sidor",element:l.jsx(xZe,{}),children:[l.jsx(Ke,{index:!0,element:l.jsx(SZe,{})}),l.jsx(Ke,{path:"nytt-objekt",element:l.jsx(Wz,{})}),l.jsx(Ke,{path:"redigera/:id",element:l.jsx(Wz,{})}),l.jsx(Ke,{path:"profil",element:l.jsx(jZe,{})})]}),l.jsx(Ke,{path:"/admin/logga-in",element:l.jsx(aZe,{})}),l.jsxs(Ke,{path:"/admin",element:l.jsx(PNe,{}),children:[l.jsx(Ke,{index:!0,element:l.jsx(tKe,{})}),l.jsx(Ke,{path:"inkorg",element:l.jsx(hl,{})}),l.jsx(Ke,{path:"anvandare",element:l.jsx(oZe,{})}),l.jsx(Ke,{path:"foretag",element:l.jsx(mZe,{})}),l.jsx(Ke,{path:"uthyrare",element:l.jsx(WGe,{})}),l.jsx(Ke,{path:"hyresgaster",element:l.jsx(hl,{})}),l.jsx(Ke,{path:"objekt",element:l.jsx(eZe,{})}),l.jsx(Ke,{path:"objekt/nytt",element:l.jsx(sZe,{})}),l.jsx(Ke,{path:"godkannande",element:l.jsx(qGe,{})}),l.jsx(Ke,{path:"flaggade",element:l.jsx(hl,{})}),l.jsx(Ke,{path:"bokningar",element:l.jsx(hl,{})}),l.jsx(Ke,{path:"visningar",element:l.jsx(hl,{})}),l.jsx(Ke,{path:"sokprofiler",element:l.jsx(hl,{})}),l.jsx(Ke,{path:"forfragningar",element:l.jsx(dZe,{})}),l.jsx(Ke,{path:"bostadsforfragningar",element:l.jsx(pZe,{})}),l.jsx(Ke,{path:"stader",element:l.jsx(gZe,{})}),l.jsx(Ke,{path:"legacy-omraden",element:l.jsx(vZe,{})}),l.jsx(Ke,{path:"guider",element:l.jsx(e0e,{})}),l.jsx(Ke,{path:"guider/ny",element:l.jsx(j3,{})}),l.jsx(Ke,{path:"guider/:id",element:l.jsx(j3,{})}),l.jsx(Ke,{path:"fakturor",element:l.jsx(hl,{})}),l.jsx(Ke,{path:"rapporter",element:l.jsx(hl,{})})]}),l.jsx(Ke,{path:"*",element:l.jsx(Pxe,{})})]})]})]})}),MZe={nav:{bostader:"Företagslägenheter",foretagsservice:"Företagsservice",fastighetsagare:"Fastighetsägare",omOss:"Om oss",hyraUt:"Hyra ut",kontakt:"Kontakt",loggaIn:"Logga in",
994skickaForfragan:"Skicka förfrågan",skickaEnForfragan:"Skicka en förfrågan",stangMeny:"Stäng meny",oppnaMeny:"Öppna meny"},hero:{sedan:"Sedan 1999",titlePart1:"Hitta rätt företagsbostad –",titlePart2:"snabbt och smidigt",subtitle:"Vi hjälper företag, konsulter och organisationer att hitta skräddarsydda bostadslösningar i Stockholm och övriga delar av Sverige.",ctaPrimary:"Skicka förfrågan",ctaSecondary:"Se lediga bostäder",trustCities:"Företag i hela Sverige",trustFast:"Snabb process",trustListings:"100+ bostäder"},search:{title:"Hitta din bostad",subtitle:"Sök bland lediga företagsbostäder",propertyType:"Bostadstyp",all:"Alla",apartment:"Lägenhet",villa:"Villa",townhouse:"Radhus",room:"Rum",city:"Stad",cityPlaceholder:"Alla områden",maxRent:"Max hyra",rooms:"Antal rum",min:"Min",max:"Max",submit:"Hitta bostäder"},footer:{tagline:"Företagsbostäder i Stockholm – snabbt, enkelt och tryggt.",services:"Tjänster",myPages:"Mina sidor",about:"Om oss",privacy:"Integritet",rights:"Alla rättigheter förbehållna."},language:{label:"Språk",sv:"Svenska",en:"English"}};try{typeof window<"u"&&(window.localStorage.removeItem("lng"),window.localStorage.setItem("lng","sv"))}catch{}fi.use(Aue).init({resources:{sv:{translation:MZe}},lng:"sv",fallbackLng:"sv",supportedLngs:["sv"],interpolation:{escapeValue:!1}});typeof document<"u"&&(document.documentElement.lang="sv");hU(document.getElementById("root")).render(l.jsx(bU,{children:l.jsx(PZe,{})}));

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