var Jw=Object.defineProperty;var Yd=e=>{throw TypeError(e)};var ex=(e,t,n)=>t in e?Jw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var xr=(e,t,n)=>ex(e,typeof t!="symbol"?t+"":t,n),vl=(e,t,n)=>t.has(e)||Yd("Cannot "+n);var A=(e,t,n)=>(vl(e,t,"read from private field"),n?n.call(e):t.get(e)),pe=(e,t,n)=>t.has(e)?Yd("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),J=(e,t,n,r)=>(vl(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ge=(e,t,n)=>(vl(e,t,"access private method"),n);var si=(e,t,n,r)=>({set _(o){J(e,t,o,n)},get _(){return A(e,t,r)}});function tx(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function ph(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hh={exports:{}},La={},mh={exports:{}},le={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ys=Symbol.for("react.element"),nx=Symbol.for("react.portal"),rx=Symbol.for("react.fragment"),ox=Symbol.for("react.strict_mode"),sx=Symbol.for("react.profiler"),ix=Symbol.for("react.provider"),ax=Symbol.for("react.context"),lx=Symbol.for("react.forward_ref"),cx=Symbol.for("react.suspense"),ux=Symbol.for("react.memo"),dx=Symbol.for("react.lazy"),Xd=Symbol.iterator;function fx(e){return e===null||typeof e!="object"?null:(e=Xd&&e[Xd]||e["@@iterator"],typeof e=="function"?e:null)}var gh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vh=Object.assign,yh={};function Bo(e,t,n){this.props=e,this.context=t,this.refs=yh,this.updater=n||gh}Bo.prototype.isReactComponent={};Bo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Bo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function wh(){}wh.prototype=Bo.prototype;function Cu(e,t,n){this.props=e,this.context=t,this.refs=yh,this.updater=n||gh}var Eu=Cu.prototype=new wh;Eu.constructor=Cu;vh(Eu,Bo.prototype);Eu.isPureReactComponent=!0;var Zd=Array.isArray,xh=Object.prototype.hasOwnProperty,ku={current:null},bh={key:!0,ref:!0,__self:!0,__source:!0};function Sh(e,t,n){var r,o={},s=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(s=""+t.key),t)xh.call(t,r)&&!bh.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1>>1,H=T[Y];if(0>>1;Yo(fe,$))ueo(z,fe)?(T[Y]=z,T[ue]=$,Y=ue):(T[Y]=fe,T[Q]=$,Y=Q);else if(ueo(z,$))T[Y]=z,T[ue]=$,Y=ue;else break e}}return P}function o(T,P){var $=T.sortIndex-P.sortIndex;return $!==0?$:T.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var l=[],c=[],d=1,m=null,y=3,p=!1,b=!1,g=!1,x=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(T){for(var P=n(c);P!==null;){if(P.callback===null)r(c);else if(P.startTime<=T)r(c),P.sortIndex=P.expirationTime,t(l,P);else break;P=n(c)}}function S(T){if(g=!1,w(T),!b)if(n(l)!==null)b=!0,V(C);else{var P=n(c);P!==null&&K(S,P.startTime-T)}}function C(T,P){b=!1,g&&(g=!1,v(j),j=-1),p=!0;var $=y;try{for(w(P),m=n(l);m!==null&&(!(m.expirationTime>P)||T&&!U());){var Y=m.callback;if(typeof Y=="function"){m.callback=null,y=m.priorityLevel;var H=Y(m.expirationTime<=P);P=e.unstable_now(),typeof H=="function"?m.callback=H:m===n(l)&&r(l),w(P)}else r(l);m=n(l)}if(m!==null)var X=!0;else{var Q=n(c);Q!==null&&K(S,Q.startTime-P),X=!1}return X}finally{m=null,y=$,p=!1}}var k=!1,E=null,j=-1,_=5,R=-1;function U(){return!(e.unstable_now()-R<_)}function F(){if(E!==null){var T=e.unstable_now();R=T;var P=!0;try{P=E(!0,T)}finally{P?q():(k=!1,E=null)}}else k=!1}var q;if(typeof h=="function")q=function(){h(F)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,G=L.port2;L.port1.onmessage=F,q=function(){G.postMessage(null)}}else q=function(){x(F,0)};function V(T){E=T,k||(k=!0,q())}function K(T,P){j=x(function(){T(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(T){T.callback=null},e.unstable_continueExecution=function(){b||p||(b=!0,V(C))},e.unstable_forceFrameRate=function(T){0>T||125Y?(T.sortIndex=$,t(c,T),n(l)===null&&T===n(c)&&(g?(v(j),j=-1):g=!0,K(S,$-Y))):(T.sortIndex=H,t(l,T),b||p||(b=!0,V(C))),T},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(T){var P=y;return function(){var $=y;y=P;try{return T.apply(this,arguments)}finally{y=$}}}})(Ph);Th.exports=Ph;var Cx=Th.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ex=f,Ct=Cx;function I(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),uc=Object.prototype.hasOwnProperty,kx=/^[: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]*$/,ef={},tf={};function Tx(e){return uc.call(tf,e)?!0:uc.call(ef,e)?!1:kx.test(e)?tf[e]=!0:(ef[e]=!0,!1)}function Px(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Nx(e,t,n,r){if(t===null||typeof t>"u"||Px(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function at(e,t,n,r,o,s,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=i}var Qe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Qe[e]=new at(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Qe[t]=new at(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Qe[e]=new at(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Qe[e]=new at(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Qe[e]=new at(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Qe[e]=new at(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Qe[e]=new at(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Qe[e]=new at(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Qe[e]=new at(e,5,!1,e.toLowerCase(),null,!1,!1)});var Nu=/[\-:]([a-z])/g;function ju(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Nu,ju);Qe[t]=new at(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Nu,ju);Qe[t]=new at(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Nu,ju);Qe[t]=new at(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Qe[e]=new at(e,1,!1,e.toLowerCase(),null,!1,!1)});Qe.xlinkHref=new at("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Qe[e]=new at(e,1,!1,e.toLowerCase(),null,!0,!0)});function Au(e,t,n,r){var o=Qe.hasOwnProperty(t)?Qe[t]:null;(o!==null?o.type!==0:r||!(2a||o[i]!==s[a]){var l=` `+o[i].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=i&&0<=a);break}}}finally{xl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?as(e):""}function jx(e){switch(e.tag){case 5:return as(e.type);case 16:return as("Lazy");case 13:return as("Suspense");case 19:return as("SuspenseList");case 0:case 2:case 15:return e=bl(e.type,!1),e;case 11:return e=bl(e.type.render,!1),e;case 1:return e=bl(e.type,!0),e;default:return""}}function hc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case no:return"Fragment";case to:return"Portal";case dc:return"Profiler";case Ru:return"StrictMode";case fc:return"Suspense";case pc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ah:return(e.displayName||"Context")+".Consumer";case jh:return(e._context.displayName||"Context")+".Provider";case _u:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Iu:return t=e.displayName||null,t!==null?t:hc(e.type)||"Memo";case Wn:t=e._payload,e=e._init;try{return hc(e(t))}catch{}}return null}function Ax(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return hc(t);case 8:return t===Ru?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ur(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _h(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Rx(e){var t=_h(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){r=""+i,s.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function li(e){e._valueTracker||(e._valueTracker=Rx(e))}function Ih(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=_h(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function na(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function mc(e,t){var n=t.checked;return je({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function rf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ur(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Oh(e,t){t=t.checked,t!=null&&Au(e,"checked",t,!1)}function gc(e,t){Oh(e,t);var n=ur(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?vc(e,t.type,n):t.hasOwnProperty("defaultValue")&&vc(e,t.type,ur(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function of(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function vc(e,t,n){(t!=="number"||na(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ls=Array.isArray;function ho(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=ci.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Cs(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var fs={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},_x=["Webkit","ms","Moz","O"];Object.keys(fs).forEach(function(e){_x.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),fs[t]=fs[e]})});function Fh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||fs.hasOwnProperty(e)&&fs[e]?(""+t).trim():t+"px"}function zh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Fh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Ix=je({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 xc(e,t){if(t){if(Ix[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(I(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(I(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(I(61))}if(t.style!=null&&typeof t.style!="object")throw Error(I(62))}}function bc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Sc=null;function Ou(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cc=null,mo=null,go=null;function lf(e){if(e=Js(e)){if(typeof Cc!="function")throw Error(I(280));var t=e.stateNode;t&&(t=$a(t),Cc(e.stateNode,e.type,t))}}function $h(e){mo?go?go.push(e):go=[e]:mo=e}function Bh(){if(mo){var e=mo,t=go;if(go=mo=null,lf(e),t)for(e=0;e>>=0,e===0?32:31-(Wx(e)/Hx|0)|0}var ui=64,di=4194304;function cs(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ia(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,s=e.pingedLanes,i=n&268435455;if(i!==0){var a=i&~o;a!==0?r=cs(a):(s&=i,s!==0&&(r=cs(s)))}else i=n&~o,i!==0?r=cs(i):s!==0&&(r=cs(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,s=t&-t,o>=s||o===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Xs(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Yt(t),e[t]=n}function qx(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=hs),vf=" ",yf=!1;function am(e,t){switch(e){case"keyup":return C0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ro=!1;function k0(e,t){switch(e){case"compositionend":return lm(t);case"keypress":return t.which!==32?null:(yf=!0,vf);case"textInput":return e=t.data,e===vf&&yf?null:e;default:return null}}function T0(e,t){if(ro)return e==="compositionend"||!Uu&&am(e,t)?(e=sm(),Fi=zu=Jn=null,ro=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Sf(n)}}function fm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?fm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function pm(){for(var e=window,t=na();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=na(e.document)}return t}function Vu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function L0(e){var t=pm(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&fm(n.ownerDocument.documentElement,n)){if(r!==null&&Vu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,s=Math.min(r.start,o);r=r.end===void 0?s:Math.min(r.end,o),!e.extend&&s>r&&(o=r,r=s,s=o),o=Cf(n,s);var i=Cf(n,r);o&&i&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,oo=null,jc=null,gs=null,Ac=!1;function Ef(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ac||oo==null||oo!==na(r)||(r=oo,"selectionStart"in r&&Vu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),gs&&js(gs,r)||(gs=r,r=ca(jc,"onSelect"),0ao||(e.current=Mc[ao],Mc[ao]=null,ao--)}function we(e,t){ao++,Mc[ao]=e.current,e.current=t}var dr={},Je=mr(dr),pt=mr(!1),Mr=dr;function _o(e,t){var n=e.type.contextTypes;if(!n)return dr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},s;for(s in n)o[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function ht(e){return e=e.childContextTypes,e!=null}function da(){Ce(pt),Ce(Je)}function Rf(e,t,n){if(Je.current!==dr)throw Error(I(168));we(Je,t),we(pt,n)}function Sm(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(I(108,Ax(e)||"Unknown",o));return je({},n,r)}function fa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||dr,Mr=Je.current,we(Je,e),we(pt,pt.current),!0}function _f(e,t,n){var r=e.stateNode;if(!r)throw Error(I(169));n?(e=Sm(e,t,Mr),r.__reactInternalMemoizedMergedChildContext=e,Ce(pt),Ce(Je),we(Je,e)):Ce(pt),we(pt,n)}var Cn=null,Ba=!1,Ll=!1;function Cm(e){Cn===null?Cn=[e]:Cn.push(e)}function Q0(e){Ba=!0,Cm(e)}function gr(){if(!Ll&&Cn!==null){Ll=!0;var e=0,t=ge;try{var n=Cn;for(ge=1;e>=i,o-=i,kn=1<<32-Yt(t)+o|n<j?(_=E,E=null):_=E.sibling;var R=y(v,E,w[j],S);if(R===null){E===null&&(E=_);break}e&&E&&R.alternate===null&&t(v,E),h=s(R,h,j),k===null?C=R:k.sibling=R,k=R,E=_}if(j===w.length)return n(v,E),ke&&br(v,j),C;if(E===null){for(;jj?(_=E,E=null):_=E.sibling;var U=y(v,E,R.value,S);if(U===null){E===null&&(E=_);break}e&&E&&U.alternate===null&&t(v,E),h=s(U,h,j),k===null?C=U:k.sibling=U,k=U,E=_}if(R.done)return n(v,E),ke&&br(v,j),C;if(E===null){for(;!R.done;j++,R=w.next())R=m(v,R.value,S),R!==null&&(h=s(R,h,j),k===null?C=R:k.sibling=R,k=R);return ke&&br(v,j),C}for(E=r(v,E);!R.done;j++,R=w.next())R=p(E,v,j,R.value,S),R!==null&&(e&&R.alternate!==null&&E.delete(R.key===null?j:R.key),h=s(R,h,j),k===null?C=R:k.sibling=R,k=R);return e&&E.forEach(function(F){return t(v,F)}),ke&&br(v,j),C}function x(v,h,w,S){if(typeof w=="object"&&w!==null&&w.type===no&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case ai:e:{for(var C=w.key,k=h;k!==null;){if(k.key===C){if(C=w.type,C===no){if(k.tag===7){n(v,k.sibling),h=o(k,w.props.children),h.return=v,v=h;break e}}else if(k.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Wn&&Lf(C)===k.type){n(v,k.sibling),h=o(k,w.props),h.ref=ns(v,k,w),h.return=v,v=h;break e}n(v,k);break}else t(v,k);k=k.sibling}w.type===no?(h=Lr(w.props.children,v.mode,S,w.key),h.return=v,v=h):(S=Ki(w.type,w.key,w.props,null,v.mode,S),S.ref=ns(v,h,w),S.return=v,v=S)}return i(v);case to:e:{for(k=w.key;h!==null;){if(h.key===k)if(h.tag===4&&h.stateNode.containerInfo===w.containerInfo&&h.stateNode.implementation===w.implementation){n(v,h.sibling),h=o(h,w.children||[]),h.return=v,v=h;break e}else{n(v,h);break}else t(v,h);h=h.sibling}h=Vl(w,v.mode,S),h.return=v,v=h}return i(v);case Wn:return k=w._init,x(v,h,k(w._payload),S)}if(ls(w))return b(v,h,w,S);if(Xo(w))return g(v,h,w,S);yi(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,h!==null&&h.tag===6?(n(v,h.sibling),h=o(h,w),h.return=v,v=h):(n(v,h),h=Ul(w,v.mode,S),h.return=v,v=h),i(v)):n(v,h)}return x}var Oo=Pm(!0),Nm=Pm(!1),ma=mr(null),ga=null,uo=null,Qu=null;function Gu(){Qu=uo=ga=null}function qu(e){var t=ma.current;Ce(ma),e._currentValue=t}function zc(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function yo(e,t){ga=e,Qu=uo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ft=!0),e.firstContext=null)}function _t(e){var t=e._currentValue;if(Qu!==e)if(e={context:e,memoizedValue:t,next:null},uo===null){if(ga===null)throw Error(I(308));uo=e,ga.dependencies={lanes:0,firstContext:e}}else uo=uo.next=e;return t}var Er=null;function Yu(e){Er===null?Er=[e]:Er.push(e)}function jm(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Yu(t)):(n.next=o.next,o.next=n),t.interleaved=n,An(e,r)}function An(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Hn=!1;function Xu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Am(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Pn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function sr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,de&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,An(e,n)}return o=r.interleaved,o===null?(t.next=t,Yu(r)):(t.next=o.next,o.next=t),r.interleaved=t,An(e,n)}function $i(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mu(e,n)}}function Mf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?o=s=i:s=s.next=i,n=n.next}while(n!==null);s===null?o=s=t:s=s.next=t}else o=s=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function va(e,t,n,r){var o=e.updateQueue;Hn=!1;var s=o.firstBaseUpdate,i=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,c=l.next;l.next=null,i===null?s=c:i.next=c,i=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==i&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(s!==null){var m=o.baseState;i=0,d=c=l=null,a=s;do{var y=a.lane,p=a.eventTime;if((r&y)===y){d!==null&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var b=e,g=a;switch(y=t,p=n,g.tag){case 1:if(b=g.payload,typeof b=="function"){m=b.call(p,m,y);break e}m=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=g.payload,y=typeof b=="function"?b.call(p,m,y):b,y==null)break e;m=je({},m,y);break e;case 2:Hn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,y=o.effects,y===null?o.effects=[a]:y.push(a))}else p={eventTime:p,lane:y,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=p,l=m):d=d.next=p,i|=y;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;y=a,a=y.next,y.next=null,o.lastBaseUpdate=y,o.shared.pending=null}}while(!0);if(d===null&&(l=m),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do i|=o.lane,o=o.next;while(o!==t)}else s===null&&(o.shared.lanes=0);zr|=i,e.lanes=i,e.memoizedState=m}}function Df(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Dl.transition;Dl.transition={};try{e(!1),t()}finally{ge=n,Dl.transition=r}}function Qm(){return It().memoizedState}function X0(e,t,n){var r=ar(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Gm(e))qm(t,n);else if(n=jm(e,t,n,r),n!==null){var o=st();Xt(n,e,r,o),Ym(n,t,r)}}function Z0(e,t,n){var r=ar(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Gm(e))qm(t,o);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var i=t.lastRenderedState,a=s(i,n);if(o.hasEagerState=!0,o.eagerState=a,Zt(a,i)){var l=t.interleaved;l===null?(o.next=o,Yu(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=jm(e,t,o,r),n!==null&&(o=st(),Xt(n,e,r,o),Ym(n,t,r))}}function Gm(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function qm(e,t){vs=wa=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ym(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mu(e,n)}}var xa={readContext:_t,useCallback:qe,useContext:qe,useEffect:qe,useImperativeHandle:qe,useInsertionEffect:qe,useLayoutEffect:qe,useMemo:qe,useReducer:qe,useRef:qe,useState:qe,useDebugValue:qe,useDeferredValue:qe,useTransition:qe,useMutableSource:qe,useSyncExternalStore:qe,useId:qe,unstable_isNewReconciler:!1},J0={readContext:_t,useCallback:function(e,t){return on().memoizedState=[e,t===void 0?null:t],e},useContext:_t,useEffect:zf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ui(4194308,4,Um.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ui(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ui(4,2,e,t)},useMemo:function(e,t){var n=on();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=on();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=X0.bind(null,Ne,e),[r.memoizedState,e]},useRef:function(e){var t=on();return e={current:e},t.memoizedState=e},useState:Ff,useDebugValue:sd,useDeferredValue:function(e){return on().memoizedState=e},useTransition:function(){var e=Ff(!1),t=e[0];return e=Y0.bind(null,e[1]),on().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ne,o=on();if(ke){if(n===void 0)throw Error(I(407));n=n()}else{if(n=t(),Be===null)throw Error(I(349));Fr&30||Om(r,t,n)}o.memoizedState=n;var s={value:n,getSnapshot:t};return o.queue=s,zf(Mm.bind(null,r,s,e),[e]),r.flags|=2048,Ds(9,Lm.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=on(),t=Be.identifierPrefix;if(ke){var n=Tn,r=kn;n=(r&~(1<<32-Yt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ls++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[cn]=t,e[_s]=r,ig(e,t,!1,!1),t.stateNode=e;e:{switch(i=bc(n,r),n){case"dialog":Se("cancel",e),Se("close",e),o=r;break;case"iframe":case"object":case"embed":Se("load",e),o=r;break;case"video":case"audio":for(o=0;oDo&&(t.flags|=128,r=!0,rs(s,!1),t.lanes=4194304)}else{if(!r)if(e=ya(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),rs(s,!0),s.tail===null&&s.tailMode==="hidden"&&!i.alternate&&!ke)return Ye(t),null}else 2*_e()-s.renderingStartTime>Do&&n!==1073741824&&(t.flags|=128,r=!0,rs(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(n=s.last,n!==null?n.sibling=i:t.child=i,s.last=i)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=_e(),t.sibling=null,n=Pe.current,we(Pe,r?n&1|2:n&1),t):(Ye(t),null);case 22:case 23:return dd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?yt&1073741824&&(Ye(t),t.subtreeFlags&6&&(t.flags|=8192)):Ye(t),null;case 24:return null;case 25:return null}throw Error(I(156,t.tag))}function ab(e,t){switch(Hu(t),t.tag){case 1:return ht(t.type)&&da(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Lo(),Ce(pt),Ce(Je),ed(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ju(t),null;case 13:if(Ce(Pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(I(340));Io()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ce(Pe),null;case 4:return Lo(),null;case 10:return qu(t.type._context),null;case 22:case 23:return dd(),null;case 24:return null;default:return null}}var xi=!1,Ze=!1,lb=typeof WeakSet=="function"?WeakSet:Set,W=null;function fo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Re(e,t,r)}else n.current=null}function Gc(e,t,n){try{n()}catch(r){Re(e,t,r)}}var Yf=!1;function cb(e,t){if(Rc=aa,e=pm(),Vu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var i=0,a=-1,l=-1,c=0,d=0,m=e,y=null;t:for(;;){for(var p;m!==n||o!==0&&m.nodeType!==3||(a=i+o),m!==s||r!==0&&m.nodeType!==3||(l=i+r),m.nodeType===3&&(i+=m.nodeValue.length),(p=m.firstChild)!==null;)y=m,m=p;for(;;){if(m===e)break t;if(y===n&&++c===o&&(a=i),y===s&&++d===r&&(l=i),(p=m.nextSibling)!==null)break;m=y,y=m.parentNode}m=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(_c={focusedElem:e,selectionRange:n},aa=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var g=b.memoizedProps,x=b.memoizedState,v=t.stateNode,h=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:Wt(t.type,g),x);v.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(I(163))}}catch(S){Re(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return b=Yf,Yf=!1,b}function ys(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var s=o.destroy;o.destroy=void 0,s!==void 0&&Gc(t,n,s)}o=o.next}while(o!==r)}}function Wa(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function qc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function cg(e){var t=e.alternate;t!==null&&(e.alternate=null,cg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[cn],delete t[_s],delete t[Lc],delete t[H0],delete t[K0])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ug(e){return e.tag===5||e.tag===3||e.tag===4}function Xf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ug(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ua));else if(r!==4&&(e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}var We=null,Gt=!1;function zn(e,t,n){for(n=n.child;n!==null;)dg(e,t,n),n=n.sibling}function dg(e,t,n){if(fn&&typeof fn.onCommitFiberUnmount=="function")try{fn.onCommitFiberUnmount(Ma,n)}catch{}switch(n.tag){case 5:Ze||fo(n,t);case 6:var r=We,o=Gt;We=null,zn(e,t,n),We=r,Gt=o,We!==null&&(Gt?(e=We,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):We.removeChild(n.stateNode));break;case 18:We!==null&&(Gt?(e=We,n=n.stateNode,e.nodeType===8?Ol(e.parentNode,n):e.nodeType===1&&Ol(e,n),Ps(e)):Ol(We,n.stateNode));break;case 4:r=We,o=Gt,We=n.stateNode.containerInfo,Gt=!0,zn(e,t,n),We=r,Gt=o;break;case 0:case 11:case 14:case 15:if(!Ze&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var s=o,i=s.destroy;s=s.tag,i!==void 0&&(s&2||s&4)&&Gc(n,t,i),o=o.next}while(o!==r)}zn(e,t,n);break;case 1:if(!Ze&&(fo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Re(n,t,a)}zn(e,t,n);break;case 21:zn(e,t,n);break;case 22:n.mode&1?(Ze=(r=Ze)||n.memoizedState!==null,zn(e,t,n),Ze=r):zn(e,t,n);break;default:zn(e,t,n)}}function Zf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new lb),t.forEach(function(r){var o=yb.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Bt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=i),r&=~s}if(r=o,r=_e()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*db(r/1960))-r,10e?16:e,er===null)var r=!1;else{if(e=er,er=null,Ca=0,de&6)throw Error(I(331));var o=de;for(de|=4,W=e.current;W!==null;){var s=W,i=s.child;if(W.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l_e()-cd?Or(e,0):ld|=n),mt(e,t)}function wg(e,t){t===0&&(e.mode&1?(t=di,di<<=1,!(di&130023424)&&(di=4194304)):t=1);var n=st();e=An(e,t),e!==null&&(Xs(e,t,n),mt(e,n))}function vb(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),wg(e,n)}function yb(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(I(314))}r!==null&&r.delete(t),wg(e,n)}var xg;xg=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||pt.current)ft=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ft=!1,sb(e,t,n);ft=!!(e.flags&131072)}else ft=!1,ke&&t.flags&1048576&&Em(t,ha,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Vi(e,t),e=t.pendingProps;var o=_o(t,Je.current);yo(t,n),o=nd(null,t,r,e,o,n);var s=rd();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ht(r)?(s=!0,fa(t)):s=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Xu(t),o.updater=Va,t.stateNode=o,o._reactInternals=t,Bc(t,r,e,n),t=Wc(null,t,r,!0,s,n)):(t.tag=0,ke&&s&&Wu(t),rt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Vi(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=xb(r),e=Wt(r,e),o){case 0:t=Vc(null,t,r,e,n);break e;case 1:t=Qf(null,t,r,e,n);break e;case 11:t=Hf(null,t,r,e,n);break e;case 14:t=Kf(null,t,r,Wt(r.type,e),n);break e}throw Error(I(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Wt(r,o),Vc(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Wt(r,o),Qf(e,t,r,o,n);case 3:e:{if(rg(t),e===null)throw Error(I(387));r=t.pendingProps,s=t.memoizedState,o=s.element,Am(e,t),va(t,r,null,n);var i=t.memoizedState;if(r=i.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){o=Mo(Error(I(423)),t),t=Gf(e,t,r,n,o);break e}else if(r!==o){o=Mo(Error(I(424)),t),t=Gf(e,t,r,n,o);break e}else for(xt=or(t.stateNode.containerInfo.firstChild),bt=t,ke=!0,qt=null,n=Nm(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Io(),r===o){t=Rn(e,t,n);break e}rt(e,t,r,n)}t=t.child}return t;case 5:return Rm(t),e===null&&Fc(t),r=t.type,o=t.pendingProps,s=e!==null?e.memoizedProps:null,i=o.children,Ic(r,o)?i=null:s!==null&&Ic(r,s)&&(t.flags|=32),ng(e,t),rt(e,t,i,n),t.child;case 6:return e===null&&Fc(t),null;case 13:return og(e,t,n);case 4:return Zu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Oo(t,null,r,n):rt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Wt(r,o),Hf(e,t,r,o,n);case 7:return rt(e,t,t.pendingProps,n),t.child;case 8:return rt(e,t,t.pendingProps.children,n),t.child;case 12:return rt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value,we(ma,r._currentValue),r._currentValue=i,s!==null)if(Zt(s.value,i)){if(s.children===o.children&&!pt.current){t=Rn(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){i=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=Pn(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),zc(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)i=s.type===t.type?null:s.child;else if(s.tag===18){if(i=s.return,i===null)throw Error(I(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),zc(i,n,t),i=s.sibling}else i=s.child;if(i!==null)i.return=s;else for(i=s;i!==null;){if(i===t){i=null;break}if(s=i.sibling,s!==null){s.return=i.return,i=s;break}i=i.return}s=i}rt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,yo(t,n),o=_t(o),r=r(o),t.flags|=1,rt(e,t,r,n),t.child;case 14:return r=t.type,o=Wt(r,t.pendingProps),o=Wt(r.type,o),Kf(e,t,r,o,n);case 15:return eg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Wt(r,o),Vi(e,t),t.tag=1,ht(r)?(e=!0,fa(t)):e=!1,yo(t,n),Xm(t,r,o),Bc(t,r,o,n),Wc(null,t,r,!0,e,n);case 19:return sg(e,t,n);case 22:return tg(e,t,n)}throw Error(I(156,t.tag))};function bg(e,t){return Gh(e,t)}function wb(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function At(e,t,n,r){return new wb(e,t,n,r)}function pd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function xb(e){if(typeof e=="function")return pd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===_u)return 11;if(e===Iu)return 14}return 2}function lr(e,t){var n=e.alternate;return n===null?(n=At(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ki(e,t,n,r,o,s){var i=2;if(r=e,typeof e=="function")pd(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case no:return Lr(n.children,o,s,t);case Ru:i=8,o|=8;break;case dc:return e=At(12,n,t,o|2),e.elementType=dc,e.lanes=s,e;case fc:return e=At(13,n,t,o),e.elementType=fc,e.lanes=s,e;case pc:return e=At(19,n,t,o),e.elementType=pc,e.lanes=s,e;case Rh:return Ka(n,o,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case jh:i=10;break e;case Ah:i=9;break e;case _u:i=11;break e;case Iu:i=14;break e;case Wn:i=16,r=null;break e}throw Error(I(130,e==null?e:typeof e,""))}return t=At(i,n,t,o),t.elementType=e,t.type=r,t.lanes=s,t}function Lr(e,t,n,r){return e=At(7,e,r,t),e.lanes=n,e}function Ka(e,t,n,r){return e=At(22,e,r,t),e.elementType=Rh,e.lanes=n,e.stateNode={isHidden:!1},e}function Ul(e,t,n){return e=At(6,e,null,t),e.lanes=n,e}function Vl(e,t,n){return t=At(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function bb(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Cl(0),this.expirationTimes=Cl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Cl(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function hd(e,t,n,r,o,s,i,a,l){return e=new bb(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=At(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xu(s),e}function Sb(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(kg)}catch(e){console.error(e)}}kg(),kh.exports=Et;var Kr=kh.exports;const Tg=ph(Kr);var Pg,ip=Kr;Pg=ip.createRoot,ip.hydrateRoot;const Pb=1,Nb=1e6;let Wl=0;function jb(){return Wl=(Wl+1)%Number.MAX_SAFE_INTEGER,Wl.toString()}const Hl=new Map,ap=e=>{if(Hl.has(e))return;const t=setTimeout(()=>{Hl.delete(e),bs({type:"REMOVE_TOAST",toastId:e})},Nb);Hl.set(e,t)},Ab=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Pb)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?ap(n):e.toasts.forEach(r=>{ap(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Qi=[];let Gi={toasts:[]};function bs(e){Gi=Ab(Gi,e),Qi.forEach(t=>{t(Gi)})}function Rb({...e}){const t=jb(),n=o=>bs({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>bs({type:"DISMISS_TOAST",toastId:t});return bs({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function Ng(){const[e,t]=f.useState(Gi);return f.useEffect(()=>(Qi.push(t),()=>{const n=Qi.indexOf(t);n>-1&&Qi.splice(n,1)}),[e]),{...e,toast:Rb,dismiss:n=>bs({type:"DISMISS_TOAST",toastId:n})}}function ie(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function lp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function jg(...e){return t=>{let n=!1;const r=e.map(o=>{const s=lp(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o{var v;const{scope:y,children:p,...b}=m,g=((v=y==null?void 0:y[e])==null?void 0:v[l])||a,x=f.useMemo(()=>b,Object.values(b));return u.jsx(g.Provider,{value:x,children:p})};c.displayName=s+"Provider";function d(m,y){var g;const p=((g=y==null?void 0:y[e])==null?void 0:g[l])||a,b=f.useContext(p);if(b)return b;if(i!==void 0)return i;throw new Error(`\`${m}\` must be used within \`${s}\``)}return[c,d]}const o=()=>{const s=n.map(i=>f.createContext(i));return function(a){const l=(a==null?void 0:a[e])||s;return f.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,_b(o,...t)]}function _b(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:c})=>{const m=l(s)[`__scope${c}`];return{...a,...m}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function zs(e){const t=Ob(e),n=f.forwardRef((r,o)=>{const{children:s,...i}=r,a=f.Children.toArray(s),l=a.find(Mb);if(l){const c=l.props.children,d=a.map(m=>m===l?f.Children.count(c)>1?f.Children.only(null):f.isValidElement(c)?c.props.children:null:m);return u.jsx(t,{...i,ref:o,children:f.isValidElement(c)?f.cloneElement(c,void 0,d):null})}return u.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var Ib=zs("Slot");function Ob(e){const t=f.forwardRef((n,r)=>{const{children:o,...s}=n;if(f.isValidElement(o)){const i=Fb(o),a=Db(s,o.props);return o.type!==f.Fragment&&(a.ref=r?jg(r,i):i),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ag=Symbol("radix.slottable");function Lb(e){const t=({children:n})=>u.jsx(u.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Ag,t}function Mb(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ag}function Db(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Fb(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Rg(e){const t=e+"CollectionProvider",[n,r]=Qr(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:x,children:v}=g,h=O.useRef(null),w=O.useRef(new Map).current;return u.jsx(o,{scope:x,itemMap:w,collectionRef:h,children:v})};i.displayName=t;const a=e+"CollectionSlot",l=zs(a),c=O.forwardRef((g,x)=>{const{scope:v,children:h}=g,w=s(a,v),S=Te(x,w.collectionRef);return u.jsx(l,{ref:S,children:h})});c.displayName=a;const d=e+"CollectionItemSlot",m="data-radix-collection-item",y=zs(d),p=O.forwardRef((g,x)=>{const{scope:v,children:h,...w}=g,S=O.useRef(null),C=Te(x,S),k=s(d,v);return O.useEffect(()=>(k.itemMap.set(S,{ref:S,...w}),()=>void k.itemMap.delete(S))),u.jsx(y,{[m]:"",ref:C,children:h})});p.displayName=d;function b(g){const x=s(e+"CollectionConsumer",g);return O.useCallback(()=>{const h=x.collectionRef.current;if(!h)return[];const w=Array.from(h.querySelectorAll(`[${m}]`));return Array.from(x.itemMap.values()).sort((k,E)=>w.indexOf(k.ref.current)-w.indexOf(E.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:i,Slot:c,ItemSlot:p},b,r]}var zb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ce=zb.reduce((e,t)=>{const n=zs(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:i,...a}=o,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function _g(e,t){e&&Kr.flushSync(()=>e.dispatchEvent(t))}function Ot(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function $b(e,t=globalThis==null?void 0:globalThis.document){const n=Ot(e);f.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Bb="DismissableLayer",nu="dismissableLayer.update",Ub="dismissableLayer.pointerDownOutside",Vb="dismissableLayer.focusOutside",cp,Ig=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xa=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,c=f.useContext(Ig),[d,m]=f.useState(null),y=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=f.useState({}),b=Te(t,E=>m(E)),g=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(x),h=d?g.indexOf(d):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,S=h>=v,C=Hb(E=>{const j=E.target,_=[...c.branches].some(R=>R.contains(j));!S||_||(o==null||o(E),i==null||i(E),E.defaultPrevented||a==null||a())},y),k=Kb(E=>{const j=E.target;[...c.branches].some(R=>R.contains(j))||(s==null||s(E),i==null||i(E),E.defaultPrevented||a==null||a())},y);return $b(E=>{h===c.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},y),f.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(cp=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),up(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=cp)}},[d,y,n,c]),f.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),up())},[d,c]),f.useEffect(()=>{const E=()=>p({});return document.addEventListener(nu,E),()=>document.removeEventListener(nu,E)},[]),u.jsx(ce.div,{...l,ref:b,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:ie(e.onFocusCapture,k.onFocusCapture),onBlurCapture:ie(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:ie(e.onPointerDownCapture,C.onPointerDownCapture)})});Xa.displayName=Bb;var Wb="DismissableLayerBranch",Og=f.forwardRef((e,t)=>{const n=f.useContext(Ig),r=f.useRef(null),o=Te(t,r);return f.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),u.jsx(ce.div,{...e,ref:o})});Og.displayName=Wb;function Hb(e,t=globalThis==null?void 0:globalThis.document){const n=Ot(e),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){Lg(Ub,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Kb(e,t=globalThis==null?void 0:globalThis.document){const n=Ot(e),r=f.useRef(!1);return f.useEffect(()=>{const o=s=>{s.target&&!r.current&&Lg(Vb,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function up(){const e=new CustomEvent(nu);document.dispatchEvent(e)}function Lg(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?_g(o,s):o.dispatchEvent(s)}var Qb=Xa,Gb=Og,Oe=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},qb="Portal",yd=f.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=f.useState(!1);Oe(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Tg.createPortal(u.jsx(ce.div,{...r,ref:t}),i):null});yd.displayName=qb;function Yb(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var Za=e=>{const{present:t,children:n}=e,r=Xb(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),s=Te(r.ref,Zb(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:s}):null};Za.displayName="Presence";function Xb(e){const[t,n]=f.useState(),r=f.useRef(null),o=f.useRef(e),s=f.useRef("none"),i=e?"mounted":"unmounted",[a,l]=Yb(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const c=Ci(r.current);s.current=a==="mounted"?c:"none"},[a]),Oe(()=>{const c=r.current,d=o.current;if(d!==e){const y=s.current,p=Ci(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&y!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Oe(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,m=p=>{const g=Ci(r.current).includes(p.animationName);if(p.target===t&&g&&(l("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},y=p=>{p.target===t&&(s.current=Ci(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:f.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Ci(e){return(e==null?void 0:e.animationName)||"none"}function Zb(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Jb=Pu[" useInsertionEffect ".trim().toString()]||Oe;function Ta({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=eS({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const d=f.useRef(e!==void 0);f.useEffect(()=>{const m=d.current;m!==a&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,r])}const c=f.useCallback(d=>{var m;if(a){const y=tS(d)?d(e):d;y!==e&&((m=i.current)==null||m.call(i,y))}else s(d)},[a,e,s,i]);return[l,c]}function eS({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),o=f.useRef(n),s=f.useRef(t);return Jb(()=>{s.current=t},[t]),f.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}function tS(e){return typeof e=="function"}var Mg=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"}),nS="VisuallyHidden",Ja=f.forwardRef((e,t)=>u.jsx(ce.span,{...e,ref:t,style:{...Mg,...e.style}}));Ja.displayName=nS;var rS=Ja,wd="ToastProvider",[xd,oS,sS]=Rg("Toast"),[Dg,hN]=Qr("Toast",[sS]),[iS,el]=Dg(wd),Fg=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:i}=e,[a,l]=f.useState(null),[c,d]=f.useState(0),m=f.useRef(!1),y=f.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${wd}\`. Expected non-empty \`string\`.`),u.jsx(xd.Provider,{scope:t,children:u.jsx(iS,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:s,toastCount:c,viewport:a,onViewportChange:l,onToastAdd:f.useCallback(()=>d(p=>p+1),[]),onToastRemove:f.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:m,isClosePausedRef:y,children:i})})};Fg.displayName=wd;var zg="ToastViewport",aS=["F8"],ru="toast.viewportPause",ou="toast.viewportResume",$g=f.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=aS,label:o="Notifications ({hotkey})",...s}=e,i=el(zg,n),a=oS(n),l=f.useRef(null),c=f.useRef(null),d=f.useRef(null),m=f.useRef(null),y=Te(t,m,i.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=i.toastCount>0;f.useEffect(()=>{const x=v=>{var w;r.length!==0&&r.every(S=>v[S]||v.code===S)&&((w=m.current)==null||w.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),f.useEffect(()=>{const x=l.current,v=m.current;if(b&&x&&v){const h=()=>{if(!i.isClosePausedRef.current){const k=new CustomEvent(ru);v.dispatchEvent(k),i.isClosePausedRef.current=!0}},w=()=>{if(i.isClosePausedRef.current){const k=new CustomEvent(ou);v.dispatchEvent(k),i.isClosePausedRef.current=!1}},S=k=>{!x.contains(k.relatedTarget)&&w()},C=()=>{x.contains(document.activeElement)||w()};return x.addEventListener("focusin",h),x.addEventListener("focusout",S),x.addEventListener("pointermove",h),x.addEventListener("pointerleave",C),window.addEventListener("blur",h),window.addEventListener("focus",w),()=>{x.removeEventListener("focusin",h),x.removeEventListener("focusout",S),x.removeEventListener("pointermove",h),x.removeEventListener("pointerleave",C),window.removeEventListener("blur",h),window.removeEventListener("focus",w)}}},[b,i.isClosePausedRef]);const g=f.useCallback(({tabbingDirection:x})=>{const h=a().map(w=>{const S=w.ref.current,C=[S,...xS(S)];return x==="forwards"?C:C.reverse()});return(x==="forwards"?h.reverse():h).flat()},[a]);return f.useEffect(()=>{const x=m.current;if(x){const v=h=>{var C,k,E;const w=h.altKey||h.ctrlKey||h.metaKey;if(h.key==="Tab"&&!w){const j=document.activeElement,_=h.shiftKey;if(h.target===x&&_){(C=c.current)==null||C.focus();return}const F=g({tabbingDirection:_?"backwards":"forwards"}),q=F.findIndex(L=>L===j);Kl(F.slice(q+1))?h.preventDefault():_?(k=c.current)==null||k.focus():(E=d.current)==null||E.focus()}};return x.addEventListener("keydown",v),()=>x.removeEventListener("keydown",v)}},[a,g]),u.jsxs(Gb,{ref:l,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&u.jsx(su,{ref:c,onFocusFromOutsideViewport:()=>{const x=g({tabbingDirection:"forwards"});Kl(x)}}),u.jsx(xd.Slot,{scope:n,children:u.jsx(ce.ol,{tabIndex:-1,...s,ref:y})}),b&&u.jsx(su,{ref:d,onFocusFromOutsideViewport:()=>{const x=g({tabbingDirection:"backwards"});Kl(x)}})]})});$g.displayName=zg;var Bg="ToastFocusProxy",su=f.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=el(Bg,n);return u.jsx(Ja,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{var c;const a=i.relatedTarget;!((c=s.viewport)!=null&&c.contains(a))&&r()}})});su.displayName=Bg;var ti="Toast",lS="toast.swipeStart",cS="toast.swipeMove",uS="toast.swipeCancel",dS="toast.swipeEnd",Ug=f.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a,l]=Ta({prop:r,defaultProp:o??!0,onChange:s,caller:ti});return u.jsx(Za,{present:n||a,children:u.jsx(hS,{open:a,...i,ref:t,onClose:()=>l(!1),onPause:Ot(e.onPause),onResume:Ot(e.onResume),onSwipeStart:ie(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ie(e.onSwipeMove,c=>{const{x:d,y:m}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${m}px`)}),onSwipeCancel:ie(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ie(e.onSwipeEnd,c=>{const{x:d,y:m}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${m}px`),l(!1)})})})});Ug.displayName=ti;var[fS,pS]=Dg(ti,{onClose(){}}),hS=f.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:s,onClose:i,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:d,onSwipeMove:m,onSwipeCancel:y,onSwipeEnd:p,...b}=e,g=el(ti,n),[x,v]=f.useState(null),h=Te(t,L=>v(L)),w=f.useRef(null),S=f.useRef(null),C=o||g.duration,k=f.useRef(0),E=f.useRef(C),j=f.useRef(0),{onToastAdd:_,onToastRemove:R}=g,U=Ot(()=>{var G;(x==null?void 0:x.contains(document.activeElement))&&((G=g.viewport)==null||G.focus()),i()}),F=f.useCallback(L=>{!L||L===1/0||(window.clearTimeout(j.current),k.current=new Date().getTime(),j.current=window.setTimeout(U,L))},[U]);f.useEffect(()=>{const L=g.viewport;if(L){const G=()=>{F(E.current),c==null||c()},V=()=>{const K=new Date().getTime()-k.current;E.current=E.current-K,window.clearTimeout(j.current),l==null||l()};return L.addEventListener(ru,V),L.addEventListener(ou,G),()=>{L.removeEventListener(ru,V),L.removeEventListener(ou,G)}}},[g.viewport,C,l,c,F]),f.useEffect(()=>{s&&!g.isClosePausedRef.current&&F(C)},[s,C,g.isClosePausedRef,F]),f.useEffect(()=>(_(),()=>R()),[_,R]);const q=f.useMemo(()=>x?qg(x):null,[x]);return g.viewport?u.jsxs(u.Fragment,{children:[q&&u.jsx(mS,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:q}),u.jsx(fS,{scope:n,onClose:U,children:Kr.createPortal(u.jsx(xd.ItemSlot,{scope:n,children:u.jsx(Qb,{asChild:!0,onEscapeKeyDown:ie(a,()=>{g.isFocusedToastEscapeKeyDownRef.current||U(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:u.jsx(ce.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":g.swipeDirection,...b,ref:h,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ie(e.onKeyDown,L=>{L.key==="Escape"&&(a==null||a(L.nativeEvent),L.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,U()))}),onPointerDown:ie(e.onPointerDown,L=>{L.button===0&&(w.current={x:L.clientX,y:L.clientY})}),onPointerMove:ie(e.onPointerMove,L=>{if(!w.current)return;const G=L.clientX-w.current.x,V=L.clientY-w.current.y,K=!!S.current,T=["left","right"].includes(g.swipeDirection),P=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,$=T?P(0,G):0,Y=T?0:P(0,V),H=L.pointerType==="touch"?10:2,X={x:$,y:Y},Q={originalEvent:L,delta:X};K?(S.current=X,Ei(cS,m,Q,{discrete:!1})):dp(X,g.swipeDirection,H)?(S.current=X,Ei(lS,d,Q,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(G)>H||Math.abs(V)>H)&&(w.current=null)}),onPointerUp:ie(e.onPointerUp,L=>{const G=S.current,V=L.target;if(V.hasPointerCapture(L.pointerId)&&V.releasePointerCapture(L.pointerId),S.current=null,w.current=null,G){const K=L.currentTarget,T={originalEvent:L,delta:G};dp(G,g.swipeDirection,g.swipeThreshold)?Ei(dS,p,T,{discrete:!0}):Ei(uS,y,T,{discrete:!0}),K.addEventListener("click",P=>P.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),mS=e=>{const{__scopeToast:t,children:n,...r}=e,o=el(ti,t),[s,i]=f.useState(!1),[a,l]=f.useState(!1);return yS(()=>i(!0)),f.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:u.jsx(yd,{asChild:!0,children:u.jsx(Ja,{...r,children:s&&u.jsxs(u.Fragment,{children:[o.label," ",n]})})})},gS="ToastTitle",Vg=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return u.jsx(ce.div,{...r,ref:t})});Vg.displayName=gS;var vS="ToastDescription",Wg=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return u.jsx(ce.div,{...r,ref:t})});Wg.displayName=vS;var Hg="ToastAction",Kg=f.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?u.jsx(Gg,{altText:n,asChild:!0,children:u.jsx(bd,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Hg}\`. Expected non-empty \`string\`.`),null)});Kg.displayName=Hg;var Qg="ToastClose",bd=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=pS(Qg,n);return u.jsx(Gg,{asChild:!0,children:u.jsx(ce.button,{type:"button",...r,ref:t,onClick:ie(e.onClick,o.onClose)})})});bd.displayName=Qg;var Gg=f.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return u.jsx(ce.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function qg(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),wS(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!o)if(s){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...qg(r))}}),t}function Ei(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?_g(o,s):o.dispatchEvent(s)}var dp=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),s=r>o;return t==="left"||t==="right"?s&&r>n:!s&&o>n};function yS(e=()=>{}){const t=Ot(e);Oe(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function wS(e){return e.nodeType===e.ELEMENT_NODE}function xS(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Kl(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var bS=Fg,Yg=$g,Xg=Ug,Zg=Vg,Jg=Wg,ev=Kg,tv=bd;function nv(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;ttypeof e=="boolean"?`${e}`:e===0?"0":e,pp=rv,Sd=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return pp(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(c=>{const d=n==null?void 0:n[c],m=s==null?void 0:s[c];if(d===null)return null;const y=fp(d)||fp(m);return o[c][y]}),a=n&&Object.entries(n).reduce((c,d)=>{let[m,y]=d;return y===void 0||(c[m]=y),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:m,className:y,...p}=d;return Object.entries(p).every(b=>{let[g,x]=b;return Array.isArray(x)?x.includes({...s,...a}[g]):{...s,...a}[g]===x})?[...c,m,y]:c},[]);return pp(e,i,l,n==null?void 0:n.class,n==null?void 0:n.className)};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const SS=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ov=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var CS={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ES=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},l)=>f.createElement("svg",{ref:l,...CS,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ov("lucide",o),...a},[...i.map(([c,d])=>f.createElement(c,d)),...Array.isArray(s)?s:[s]]));/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tn=(e,t)=>{const n=f.forwardRef(({className:r,...o},s)=>f.createElement(ES,{ref:s,iconNode:t,className:ov(`lucide-${SS(e)}`,r),...o}));return n.displayName=`${e}`,n};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qi=tn("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $s=tn("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const sv=tn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kS=tn("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const TS=tn("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Yi=tn("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const PS=tn("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const NS=tn("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const hp=tn("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jS=tn("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Pa=tn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Cd="-",AS=e=>{const t=_S(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Cd);return a[0]===""&&a.length!==1&&a.shift(),iv(a,t)||RS(i)},getConflictingClassGroupIds:(i,a)=>{const l=n[i]||[];return a&&r[i]?[...l,...r[i]]:l}}},iv=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?iv(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Cd);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},mp=/^\[(.+)\]$/,RS=e=>{if(mp.test(e)){const t=mp.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},_S=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return OS(Object.entries(e.classGroups),n).forEach(([s,i])=>{iu(i,r,s,t)}),r},iu=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:gp(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(IS(o)){iu(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{iu(i,gp(t,s),n,r)})})},gp=(e,t)=>{let n=e;return t.split(Cd).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},IS=e=>e.isThemeGetter,OS=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,LS=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},av="!",MS=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const l=[];let c=0,d=0,m;for(let x=0;xd?m-d:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:b,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:i}):i},DS=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},FS=e=>({cache:LS(e.cacheSize),parseClassName:MS(e),...AS(e)}),zS=/\s+/,$S=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(zS);let a="";for(let l=i.length-1;l>=0;l-=1){const c=i[l],{modifiers:d,hasImportantModifier:m,baseClassName:y,maybePostfixModifierPosition:p}=n(c);let b=!!p,g=r(b?y.substring(0,p):y);if(!g){if(!b){a=c+(a.length>0?" "+a:a);continue}if(g=r(y),!g){a=c+(a.length>0?" "+a:a);continue}b=!1}const x=DS(d).join(":"),v=m?x+av:x,h=v+g;if(s.includes(h))continue;s.push(h);const w=o(g,b);for(let S=0;S0?" "+a:a)}return a};function BS(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rm(d),e());return n=FS(c),r=n.cache.get,o=n.cache.set,s=a,a(l)}function a(l){const c=r(l);if(c)return c;const d=$S(l,n);return o(l,d),d}return function(){return s(BS.apply(null,arguments))}}const be=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},cv=/^\[(?:([a-z-]+):)?(.+)\]$/i,VS=/^\d+\/\d+$/,WS=new Set(["px","full","screen"]),HS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,KS=/\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$/,QS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,GS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qS=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xn=e=>xo(e)||WS.has(e)||VS.test(e),$n=e=>Wo(e,"length",r1),xo=e=>!!e&&!Number.isNaN(Number(e)),Ql=e=>Wo(e,"number",xo),ss=e=>!!e&&Number.isInteger(Number(e)),YS=e=>e.endsWith("%")&&xo(e.slice(0,-1)),te=e=>cv.test(e),Bn=e=>HS.test(e),XS=new Set(["length","size","percentage"]),ZS=e=>Wo(e,XS,uv),JS=e=>Wo(e,"position",uv),e1=new Set(["image","url"]),t1=e=>Wo(e,e1,s1),n1=e=>Wo(e,"",o1),is=()=>!0,Wo=(e,t,n)=>{const r=cv.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},r1=e=>KS.test(e)&&!QS.test(e),uv=()=>!1,o1=e=>GS.test(e),s1=e=>qS.test(e),i1=()=>{const e=be("colors"),t=be("spacing"),n=be("blur"),r=be("brightness"),o=be("borderColor"),s=be("borderRadius"),i=be("borderSpacing"),a=be("borderWidth"),l=be("contrast"),c=be("grayscale"),d=be("hueRotate"),m=be("invert"),y=be("gap"),p=be("gradientColorStops"),b=be("gradientColorStopPositions"),g=be("inset"),x=be("margin"),v=be("opacity"),h=be("padding"),w=be("saturate"),S=be("scale"),C=be("sepia"),k=be("skew"),E=be("space"),j=be("translate"),_=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto",te,t],F=()=>[te,t],q=()=>["",xn,$n],L=()=>["auto",xo,te],G=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],V=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],T=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",te],$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[xo,te];return{cacheSize:500,separator:":",theme:{colors:[is],spacing:[xn,$n],blur:["none","",Bn,te],brightness:Y(),borderColor:[e],borderRadius:["none","","full",Bn,te],borderSpacing:F(),borderWidth:q(),contrast:Y(),grayscale:P(),hueRotate:Y(),invert:P(),gap:F(),gradientColorStops:[e],gradientColorStopPositions:[YS,$n],inset:U(),margin:U(),opacity:Y(),padding:F(),saturate:Y(),scale:Y(),sepia:P(),skew:Y(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",te]}],container:["container"],columns:[{columns:[Bn]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"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:[...G(),te]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ss,te]}],basis:[{basis:U()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",te]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",ss,te]}],"grid-cols":[{"grid-cols":[is]}],"col-start-end":[{col:["auto",{span:["full",ss,te]},te]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[is]}],"row-start-end":[{row:["auto",{span:[ss,te]},te]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",te]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",te]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...T()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...T(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...T(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[h]}],px:[{px:[h]}],py:[{py:[h]}],ps:[{ps:[h]}],pe:[{pe:[h]}],pt:[{pt:[h]}],pr:[{pr:[h]}],pb:[{pb:[h]}],pl:[{pl:[h]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",te,t]}],"min-w":[{"min-w":[te,t,"min","max","fit"]}],"max-w":[{"max-w":[te,t,"none","full","min","max","fit","prose",{screen:[Bn]},Bn]}],h:[{h:[te,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[te,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[te,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[te,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Bn,$n]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ql]}],"font-family":[{font:[is]}],"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",te]}],"line-clamp":[{"line-clamp":["none",xo,Ql]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",xn,te]}],"list-image":[{"list-image":["none",te]}],"list-style-type":[{list:["none","disc","decimal",te]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",xn,$n]}],"underline-offset":[{"underline-offset":["auto",xn,te]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",te]}],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",te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...G(),JS]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ZS]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},t1]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],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:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...V(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:V()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...V()]}],"outline-offset":[{"outline-offset":[xn,te]}],"outline-w":[{outline:[xn,$n]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[xn,$n]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Bn,n1]}],"shadow-color":[{shadow:[is]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Bn,te]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[m]}],saturate:[{saturate:[w]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",te]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",te]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",te]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[ss,te]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",te]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",te]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",te]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[xn,$n,Ql]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},a1=US(i1);function he(...e){return a1(rv(e))}const l1=bS,dv=f.forwardRef(({className:e,...t},n)=>u.jsx(Yg,{ref:n,className:he("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));dv.displayName=Yg.displayName;const c1=Sd("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"}}),fv=f.forwardRef(({className:e,variant:t,...n},r)=>u.jsx(Xg,{ref:r,className:he(c1({variant:t}),e),...n}));fv.displayName=Xg.displayName;const u1=f.forwardRef(({className:e,...t},n)=>u.jsx(ev,{ref:n,className:he("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 hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));u1.displayName=ev.displayName;const pv=f.forwardRef(({className:e,...t},n)=>u.jsx(tv,{ref:n,className:he("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:u.jsx(Pa,{className:"h-4 w-4"})}));pv.displayName=tv.displayName;const hv=f.forwardRef(({className:e,...t},n)=>u.jsx(Zg,{ref:n,className:he("text-sm font-semibold",e),...t}));hv.displayName=Zg.displayName;const mv=f.forwardRef(({className:e,...t},n)=>u.jsx(Jg,{ref:n,className:he("text-sm opacity-90",e),...t}));mv.displayName=Jg.displayName;function d1(){const{toasts:e}=Ng();return u.jsxs(l1,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return u.jsxs(fv,{...s,children:[u.jsxs("div",{className:"grid gap-1",children:[n&&u.jsx(hv,{children:n}),r&&u.jsx(mv,{children:r})]}),o,u.jsx(pv,{})]},t)}),u.jsx(dv,{})]})}var vp=["light","dark"],f1="(prefers-color-scheme: dark)",p1=f.createContext(void 0),h1={setTheme:e=>{},themes:[]},m1=()=>{var e;return(e=f.useContext(p1))!=null?e:h1};f.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:s,value:i,attrs:a,nonce:l})=>{let c=s==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(b=>`'${b}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,m=o?vp.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",y=(b,g=!1,x=!0)=>{let v=i?i[b]:b,h=g?b+"|| ''":`'${v}'`,w="";return o&&x&&!g&&vp.includes(b)&&(w+=`d.style.colorScheme = '${b}';`),n==="class"?g||v?w+=`c.add(${h})`:w+="null":v&&(w+=`d[s](n,${h})`),w},p=e?`!function(){${d}${y(e)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${c})){var t='${f1}',m=window.matchMedia(t);if(m.media!==t||m.matches){${y("dark")}}else{${y("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${y(i?"x[e]":"e",!0)}}${c?"":"else{"+y(s,!1,!1)+"}"}${m}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${y(i?"x[e]":"e",!0)}}else{${y(s,!1,!1)};}${m}}catch(t){}}();`;return f.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})});var g1=e=>{switch(e){case"success":return w1;case"info":return b1;case"warning":return x1;case"error":return S1;default:return null}},v1=Array(12).fill(0),y1=({visible:e,className:t})=>O.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},O.createElement("div",{className:"sonner-spinner"},v1.map((n,r)=>O.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),w1=O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},O.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"})),x1=O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},O.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"})),b1=O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},O.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"})),S1=O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},O.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"})),C1=O.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"},O.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),O.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),E1=()=>{let[e,t]=O.useState(document.hidden);return O.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},au=1,k1=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:au++,s=this.toasts.find(a=>a.id===o),i=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),s?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:i,title:n}):a):this.addToast({title:n,...r,dismissible:i,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0,s,i=r.then(async l=>{if(s=["resolve",l],O.isValidElement(l))o=!1,this.create({id:n,type:"default",message:l});else if(P1(l)&&!l.ok){o=!1;let c=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:c,description:d})}else if(t.success!==void 0){o=!1;let c=typeof t.success=="function"?await t.success(l):t.success,d=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:c,description:d})}}).catch(async l=>{if(s=["reject",l],t.error!==void 0){o=!1;let c=typeof t.error=="function"?await t.error(l):t.error,d=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:c,description:d})}}).finally(()=>{var l;o&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),a=()=>new Promise((l,c)=>i.then(()=>s[0]==="reject"?c(s[1]):l(s[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||au++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ct=new k1,T1=(e,t)=>{let n=(t==null?void 0:t.id)||au++;return ct.addToast({title:e,...t,id:n}),n},P1=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",N1=T1,j1=()=>ct.toasts,A1=()=>ct.getActiveToasts(),ze=Object.assign(N1,{success:ct.success,info:ct.info,warning:ct.warning,error:ct.error,custom:ct.custom,message:ct.message,promise:ct.promise,dismiss:ct.dismiss,loading:ct.loading},{getHistory:j1,getToasts:A1});function R1(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}R1(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} `);function ki(e){return e.label!==void 0}var _1=3,I1="32px",O1="16px",yp=4e3,L1=356,M1=14,D1=20,F1=200;function Ut(...e){return e.filter(Boolean).join(" ")}function z1(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var $1=e=>{var t,n,r,o,s,i,a,l,c,d,m;let{invert:y,toast:p,unstyled:b,interacting:g,setHeights:x,visibleToasts:v,heights:h,index:w,toasts:S,expanded:C,removeToast:k,defaultRichColors:E,closeButton:j,style:_,cancelButtonStyle:R,actionButtonStyle:U,className:F="",descriptionClassName:q="",duration:L,position:G,gap:V,loadingIcon:K,expandByDefault:T,classNames:P,icons:$,closeButtonAriaLabel:Y="Close toast",pauseWhenPageIsHidden:H}=e,[X,Q]=O.useState(null),[fe,ue]=O.useState(null),[z,ne]=O.useState(!1),[ve,se]=O.useState(!1),[re,oe]=O.useState(!1),[xe,Fe]=O.useState(!1),[Lt,vt]=O.useState(!1),[Mt,yn]=O.useState(0),[nn,Gr]=O.useState(0),wn=O.useRef(p.duration||L||yp),qr=O.useRef(null),Dt=O.useRef(null),M=w===0,N=w+1<=v,D=p.type,B=p.dismissible!==!1,ae=p.className||"",ee=p.descriptionClassName||"",et=O.useMemo(()=>h.findIndex(Z=>Z.toastId===p.id)||0,[h,p.id]),tt=O.useMemo(()=>{var Z;return(Z=p.closeButton)!=null?Z:j},[p.closeButton,j]),Ln=O.useMemo(()=>p.duration||L||yp,[p.duration,L]),Ue=O.useRef(0),Ve=O.useRef(0),Qd=O.useRef(0),Yr=O.useRef(null),[qw,Yw]=G.split("-"),Gd=O.useMemo(()=>h.reduce((Z,ye,Ee)=>Ee>=et?Z:Z+ye.height,0),[h,et]),qd=E1(),Xw=p.invert||y,gl=D==="loading";Ve.current=O.useMemo(()=>et*V+Gd,[et,Gd]),O.useEffect(()=>{wn.current=Ln},[Ln]),O.useEffect(()=>{ne(!0)},[]),O.useEffect(()=>{let Z=Dt.current;if(Z){let ye=Z.getBoundingClientRect().height;return Gr(ye),x(Ee=>[{toastId:p.id,height:ye,position:p.position},...Ee]),()=>x(Ee=>Ee.filter(Ft=>Ft.toastId!==p.id))}},[x,p.id]),O.useLayoutEffect(()=>{if(!z)return;let Z=Dt.current,ye=Z.style.height;Z.style.height="auto";let Ee=Z.getBoundingClientRect().height;Z.style.height=ye,Gr(Ee),x(Ft=>Ft.find(zt=>zt.toastId===p.id)?Ft.map(zt=>zt.toastId===p.id?{...zt,height:Ee}:zt):[{toastId:p.id,height:Ee,position:p.position},...Ft])},[z,p.title,p.description,x,p.id]);let Mn=O.useCallback(()=>{se(!0),yn(Ve.current),x(Z=>Z.filter(ye=>ye.toastId!==p.id)),setTimeout(()=>{k(p)},F1)},[p,k,x,Ve]);O.useEffect(()=>{if(p.promise&&D==="loading"||p.duration===1/0||p.type==="loading")return;let Z;return C||g||H&&qd?(()=>{if(Qd.current{var ye;(ye=p.onAutoClose)==null||ye.call(p,p),Mn()},wn.current)),()=>clearTimeout(Z)},[C,g,p,D,H,qd,Mn]),O.useEffect(()=>{p.delete&&Mn()},[Mn,p.delete]);function Zw(){var Z,ye,Ee;return $!=null&&$.loading?O.createElement("div",{className:Ut(P==null?void 0:P.loader,(Z=p==null?void 0:p.classNames)==null?void 0:Z.loader,"sonner-loader"),"data-visible":D==="loading"},$.loading):K?O.createElement("div",{className:Ut(P==null?void 0:P.loader,(ye=p==null?void 0:p.classNames)==null?void 0:ye.loader,"sonner-loader"),"data-visible":D==="loading"},K):O.createElement(y1,{className:Ut(P==null?void 0:P.loader,(Ee=p==null?void 0:p.classNames)==null?void 0:Ee.loader),visible:D==="loading"})}return O.createElement("li",{tabIndex:0,ref:Dt,className:Ut(F,ae,P==null?void 0:P.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,P==null?void 0:P.default,P==null?void 0:P[D],(n=p==null?void 0:p.classNames)==null?void 0:n[D]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:E,"data-styled":!(p.jsx||p.unstyled||b),"data-mounted":z,"data-promise":!!p.promise,"data-swiped":Lt,"data-removed":ve,"data-visible":N,"data-y-position":qw,"data-x-position":Yw,"data-index":w,"data-front":M,"data-swiping":re,"data-dismissible":B,"data-type":D,"data-invert":Xw,"data-swipe-out":xe,"data-swipe-direction":fe,"data-expanded":!!(C||T&&z),style:{"--index":w,"--toasts-before":w,"--z-index":S.length-w,"--offset":`${ve?Mt:Ve.current}px`,"--initial-height":T?"auto":`${nn}px`,..._,...p.style},onDragEnd:()=>{oe(!1),Q(null),Yr.current=null},onPointerDown:Z=>{gl||!B||(qr.current=new Date,yn(Ve.current),Z.target.setPointerCapture(Z.pointerId),Z.target.tagName!=="BUTTON"&&(oe(!0),Yr.current={x:Z.clientX,y:Z.clientY}))},onPointerUp:()=>{var Z,ye,Ee,Ft;if(xe||!B)return;Yr.current=null;let zt=Number(((Z=Dt.current)==null?void 0:Z.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Dn=Number(((ye=Dt.current)==null?void 0:ye.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),wr=new Date().getTime()-((Ee=qr.current)==null?void 0:Ee.getTime()),$t=X==="x"?zt:Dn,Fn=Math.abs($t)/wr;if(Math.abs($t)>=D1||Fn>.11){yn(Ve.current),(Ft=p.onDismiss)==null||Ft.call(p,p),ue(X==="x"?zt>0?"right":"left":Dn>0?"down":"up"),Mn(),Fe(!0),vt(!1);return}oe(!1),Q(null)},onPointerMove:Z=>{var ye,Ee,Ft,zt;if(!Yr.current||!B||((ye=window.getSelection())==null?void 0:ye.toString().length)>0)return;let Dn=Z.clientY-Yr.current.y,wr=Z.clientX-Yr.current.x,$t=(Ee=e.swipeDirections)!=null?Ee:z1(G);!X&&(Math.abs(wr)>1||Math.abs(Dn)>1)&&Q(Math.abs(wr)>Math.abs(Dn)?"x":"y");let Fn={x:0,y:0};X==="y"?($t.includes("top")||$t.includes("bottom"))&&($t.includes("top")&&Dn<0||$t.includes("bottom")&&Dn>0)&&(Fn.y=Dn):X==="x"&&($t.includes("left")||$t.includes("right"))&&($t.includes("left")&&wr<0||$t.includes("right")&&wr>0)&&(Fn.x=wr),(Math.abs(Fn.x)>0||Math.abs(Fn.y)>0)&&vt(!0),(Ft=Dt.current)==null||Ft.style.setProperty("--swipe-amount-x",`${Fn.x}px`),(zt=Dt.current)==null||zt.style.setProperty("--swipe-amount-y",`${Fn.y}px`)}},tt&&!p.jsx?O.createElement("button",{"aria-label":Y,"data-disabled":gl,"data-close-button":!0,onClick:gl||!B?()=>{}:()=>{var Z;Mn(),(Z=p.onDismiss)==null||Z.call(p,p)},className:Ut(P==null?void 0:P.closeButton,(o=p==null?void 0:p.classNames)==null?void 0:o.closeButton)},(s=$==null?void 0:$.close)!=null?s:C1):null,p.jsx||f.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:O.createElement(O.Fragment,null,D||p.icon||p.promise?O.createElement("div",{"data-icon":"",className:Ut(P==null?void 0:P.icon,(i=p==null?void 0:p.classNames)==null?void 0:i.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Zw():null,p.type!=="loading"?p.icon||($==null?void 0:$[D])||g1(D):null):null,O.createElement("div",{"data-content":"",className:Ut(P==null?void 0:P.content,(a=p==null?void 0:p.classNames)==null?void 0:a.content)},O.createElement("div",{"data-title":"",className:Ut(P==null?void 0:P.title,(l=p==null?void 0:p.classNames)==null?void 0:l.title)},typeof p.title=="function"?p.title():p.title),p.description?O.createElement("div",{"data-description":"",className:Ut(q,ee,P==null?void 0:P.description,(c=p==null?void 0:p.classNames)==null?void 0:c.description)},typeof p.description=="function"?p.description():p.description):null),f.isValidElement(p.cancel)?p.cancel:p.cancel&&ki(p.cancel)?O.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||R,onClick:Z=>{var ye,Ee;ki(p.cancel)&&B&&((Ee=(ye=p.cancel).onClick)==null||Ee.call(ye,Z),Mn())},className:Ut(P==null?void 0:P.cancelButton,(d=p==null?void 0:p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,f.isValidElement(p.action)?p.action:p.action&&ki(p.action)?O.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||U,onClick:Z=>{var ye,Ee;ki(p.action)&&((Ee=(ye=p.action).onClick)==null||Ee.call(ye,Z),!Z.defaultPrevented&&Mn())},className:Ut(P==null?void 0:P.actionButton,(m=p==null?void 0:p.classNames)==null?void 0:m.actionButton)},p.action.label):null))};function wp(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function B1(e,t){let n={};return[e,t].forEach((r,o)=>{let s=o===1,i=s?"--mobile-offset":"--offset",a=s?O1:I1;function l(c){["top","right","bottom","left"].forEach(d=>{n[`${i}-${d}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${i}-${c}`]=a:n[`${i}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(a)}),n}var U1=f.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:s,closeButton:i,className:a,offset:l,mobileOffset:c,theme:d="light",richColors:m,duration:y,style:p,visibleToasts:b=_1,toastOptions:g,dir:x=wp(),gap:v=M1,loadingIcon:h,icons:w,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:C}=e,[k,E]=O.useState([]),j=O.useMemo(()=>Array.from(new Set([r].concat(k.filter(H=>H.position).map(H=>H.position)))),[k,r]),[_,R]=O.useState([]),[U,F]=O.useState(!1),[q,L]=O.useState(!1),[G,V]=O.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=O.useRef(null),T=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=O.useRef(null),$=O.useRef(!1),Y=O.useCallback(H=>{E(X=>{var Q;return(Q=X.find(fe=>fe.id===H.id))!=null&&Q.delete||ct.dismiss(H.id),X.filter(({id:fe})=>fe!==H.id)})},[]);return O.useEffect(()=>ct.subscribe(H=>{if(H.dismiss){E(X=>X.map(Q=>Q.id===H.id?{...Q,delete:!0}:Q));return}setTimeout(()=>{Tg.flushSync(()=>{E(X=>{let Q=X.findIndex(fe=>fe.id===H.id);return Q!==-1?[...X.slice(0,Q),{...X[Q],...H},...X.slice(Q+1)]:[H,...X]})})})}),[]),O.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 H=window.matchMedia("(prefers-color-scheme: dark)");try{H.addEventListener("change",({matches:X})=>{V(X?"dark":"light")})}catch{H.addListener(({matches:Q})=>{try{V(Q?"dark":"light")}catch(fe){console.error(fe)}})}},[d]),O.useEffect(()=>{k.length<=1&&F(!1)},[k]),O.useEffect(()=>{let H=X=>{var Q,fe;o.every(ue=>X[ue]||X.code===ue)&&(F(!0),(Q=K.current)==null||Q.focus()),X.code==="Escape"&&(document.activeElement===K.current||(fe=K.current)!=null&&fe.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[o]),O.useEffect(()=>{if(K.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,$.current=!1)}},[K.current]),O.createElement("section",{ref:t,"aria-label":`${S} ${T}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},j.map((H,X)=>{var Q;let[fe,ue]=H.split("-");return k.length?O.createElement("ol",{key:H,dir:x==="auto"?wp():x,tabIndex:-1,ref:K,className:a,"data-sonner-toaster":!0,"data-theme":G,"data-y-position":fe,"data-lifted":U&&k.length>1&&!s,"data-x-position":ue,style:{"--front-toast-height":`${((Q=_[0])==null?void 0:Q.height)||0}px`,"--width":`${L1}px`,"--gap":`${v}px`,...p,...B1(l,c)},onBlur:z=>{$.current&&!z.currentTarget.contains(z.relatedTarget)&&($.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:z=>{z.target instanceof HTMLElement&&z.target.dataset.dismissible==="false"||$.current||($.current=!0,P.current=z.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{q||F(!1)},onDragEnd:()=>F(!1),onPointerDown:z=>{z.target instanceof HTMLElement&&z.target.dataset.dismissible==="false"||L(!0)},onPointerUp:()=>L(!1)},k.filter(z=>!z.position&&X===0||z.position===H).map((z,ne)=>{var ve,se;return O.createElement($1,{key:z.id,icons:w,index:ne,toast:z,defaultRichColors:m,duration:(ve=g==null?void 0:g.duration)!=null?ve:y,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:b,closeButton:(se=g==null?void 0:g.closeButton)!=null?se:i,interacting:q,position:H,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:Y,toasts:k.filter(re=>re.position==z.position),heights:_.filter(re=>re.position==z.position),setHeights:R,expandByDefault:s,gap:v,loadingIcon:h,expanded:U,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))});const V1=({...e})=>{const{theme:t="system"}=m1();return u.jsx(U1,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var W1=Pu[" useId ".trim().toString()]||(()=>{}),H1=0;function Ed(e){const[t,n]=f.useState(W1());return Oe(()=>{n(r=>r??String(H1++))},[e]),t?`radix-${t}`:""}const K1=["top","right","bottom","left"],fr=Math.min,wt=Math.max,Na=Math.round,Ti=Math.floor,hn=e=>({x:e,y:e}),Q1={left:"right",right:"left",bottom:"top",top:"bottom"},G1={start:"end",end:"start"};function lu(e,t,n){return wt(e,fr(t,n))}function _n(e,t){return typeof e=="function"?e(t):e}function In(e){return e.split("-")[0]}function Ho(e){return e.split("-")[1]}function kd(e){return e==="x"?"y":"x"}function Td(e){return e==="y"?"height":"width"}const q1=new Set(["top","bottom"]);function dn(e){return q1.has(In(e))?"y":"x"}function Pd(e){return kd(dn(e))}function Y1(e,t,n){n===void 0&&(n=!1);const r=Ho(e),o=Pd(e),s=Td(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=ja(i)),[i,ja(i)]}function X1(e){const t=ja(e);return[cu(e),t,cu(t)]}function cu(e){return e.replace(/start|end/g,t=>G1[t])}const xp=["left","right"],bp=["right","left"],Z1=["top","bottom"],J1=["bottom","top"];function eC(e,t,n){switch(e){case"top":case"bottom":return n?t?bp:xp:t?xp:bp;case"left":case"right":return t?Z1:J1;default:return[]}}function tC(e,t,n,r){const o=Ho(e);let s=eC(In(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(cu)))),s}function ja(e){return e.replace(/left|right|bottom|top/g,t=>Q1[t])}function nC(e){return{top:0,right:0,bottom:0,left:0,...e}}function gv(e){return typeof e!="number"?nC(e):{top:e,right:e,bottom:e,left:e}}function Aa(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Sp(e,t,n){let{reference:r,floating:o}=e;const s=dn(t),i=Pd(t),a=Td(i),l=In(t),c=s==="y",d=r.x+r.width/2-o.width/2,m=r.y+r.height/2-o.height/2,y=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:m};break;case"left":p={x:r.x-o.width,y:m};break;default:p={x:r.x,y:r.y}}switch(Ho(t)){case"start":p[i]-=y*(n&&c?-1:1);break;case"end":p[i]+=y*(n&&c?-1:1);break}return p}const rC=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:m}=Sp(c,r,l),y=r,p={},b=0;for(let g=0;g({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=_n(e,t)||{};if(c==null)return{};const m=gv(d),y={x:n,y:r},p=Pd(o),b=Td(p),g=await i.getDimensions(c),x=p==="y",v=x?"top":"left",h=x?"bottom":"right",w=x?"clientHeight":"clientWidth",S=s.reference[b]+s.reference[p]-y[p]-s.floating[b],C=y[p]-s.reference[p],k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let E=k?k[w]:0;(!E||!await(i.isElement==null?void 0:i.isElement(k)))&&(E=a.floating[w]||s.floating[b]);const j=S/2-C/2,_=E/2-g[b]/2-1,R=fr(m[v],_),U=fr(m[h],_),F=R,q=E-g[b]-U,L=E/2-g[b]/2+j,G=lu(F,L,q),V=!l.arrow&&Ho(o)!=null&&L!==G&&s.reference[b]/2-(LL<=0)){var U,F;const L=(((U=s.flip)==null?void 0:U.index)||0)+1,G=E[L];if(G&&(!(m==="alignment"?h!==dn(G):!1)||R.every(T=>T.overflows[0]>0&&dn(T.placement)===h)))return{data:{index:L,overflows:R},reset:{placement:G}};let V=(F=R.filter(K=>K.overflows[0]<=0).sort((K,T)=>K.overflows[1]-T.overflows[1])[0])==null?void 0:F.placement;if(!V)switch(p){case"bestFit":{var q;const K=(q=R.filter(T=>{if(k){const P=dn(T.placement);return P===h||P==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(P=>P>0).reduce((P,$)=>P+$,0)]).sort((T,P)=>T[1]-P[1])[0])==null?void 0:q[0];K&&(V=K);break}case"initialPlacement":V=a;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function Cp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ep(e){return K1.some(t=>e[t]>=0)}const iC=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=_n(e,t);switch(r){case"referenceHidden":{const s=await Bs(t,{...o,elementContext:"reference"}),i=Cp(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Ep(i)}}}case"escaped":{const s=await Bs(t,{...o,altBoundary:!0}),i=Cp(s,n.floating);return{data:{escapedOffsets:i,escaped:Ep(i)}}}default:return{}}}}},vv=new Set(["left","top"]);async function aC(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=In(n),a=Ho(n),l=dn(n)==="y",c=vv.has(i)?-1:1,d=s&&l?-1:1,m=_n(t,e);let{mainAxis:y,crossAxis:p,alignmentAxis:b}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return a&&typeof b=="number"&&(p=a==="end"?b*-1:b),l?{x:p*d,y:y*c}:{x:y*c,y:p*d}}const lC=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await aC(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},cC=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:x=>{let{x:v,y:h}=x;return{x:v,y:h}}},...l}=_n(e,t),c={x:n,y:r},d=await Bs(t,l),m=dn(In(o)),y=kd(m);let p=c[y],b=c[m];if(s){const x=y==="y"?"top":"left",v=y==="y"?"bottom":"right",h=p+d[x],w=p-d[v];p=lu(h,p,w)}if(i){const x=m==="y"?"top":"left",v=m==="y"?"bottom":"right",h=b+d[x],w=b-d[v];b=lu(h,b,w)}const g=a.fn({...t,[y]:p,[m]:b});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[y]:s,[m]:i}}}}}},uC=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=_n(e,t),d={x:n,y:r},m=dn(o),y=kd(m);let p=d[y],b=d[m];const g=_n(a,t),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const w=y==="y"?"height":"width",S=s.reference[y]-s.floating[w]+x.mainAxis,C=s.reference[y]+s.reference[w]-x.mainAxis;pC&&(p=C)}if(c){var v,h;const w=y==="y"?"width":"height",S=vv.has(In(o)),C=s.reference[m]-s.floating[w]+(S&&((v=i.offset)==null?void 0:v[m])||0)+(S?0:x.crossAxis),k=s.reference[m]+s.reference[w]+(S?0:((h=i.offset)==null?void 0:h[m])||0)-(S?x.crossAxis:0);bk&&(b=k)}return{[y]:p,[m]:b}}}},dC=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...c}=_n(e,t),d=await Bs(t,c),m=In(o),y=Ho(o),p=dn(o)==="y",{width:b,height:g}=s.floating;let x,v;m==="top"||m==="bottom"?(x=m,v=y===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(v=m,x=y==="end"?"top":"bottom");const h=g-d.top-d.bottom,w=b-d.left-d.right,S=fr(g-d[x],h),C=fr(b-d[v],w),k=!t.middlewareData.shift;let E=S,j=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(j=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=h),k&&!y){const R=wt(d.left,0),U=wt(d.right,0),F=wt(d.top,0),q=wt(d.bottom,0);p?j=b-2*(R!==0||U!==0?R+U:wt(d.left,d.right)):E=g-2*(F!==0||q!==0?F+q:wt(d.top,d.bottom))}await l({...t,availableWidth:j,availableHeight:E});const _=await i.getDimensions(a.floating);return b!==_.width||g!==_.height?{reset:{rects:!0}}:{}}}};function tl(){return typeof window<"u"}function Ko(e){return yv(e)?(e.nodeName||"").toLowerCase():"#document"}function St(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vn(e){var t;return(t=(yv(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yv(e){return tl()?e instanceof Node||e instanceof St(e).Node:!1}function Jt(e){return tl()?e instanceof Element||e instanceof St(e).Element:!1}function gn(e){return tl()?e instanceof HTMLElement||e instanceof St(e).HTMLElement:!1}function kp(e){return!tl()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof St(e).ShadowRoot}const fC=new Set(["inline","contents"]);function ni(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=en(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!fC.has(o)}const pC=new Set(["table","td","th"]);function hC(e){return pC.has(Ko(e))}const mC=[":popover-open",":modal"];function nl(e){return mC.some(t=>{try{return e.matches(t)}catch{return!1}})}const gC=["transform","translate","scale","rotate","perspective"],vC=["transform","translate","scale","rotate","perspective","filter"],yC=["paint","layout","strict","content"];function Nd(e){const t=jd(),n=Jt(e)?en(e):e;return gC.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||vC.some(r=>(n.willChange||"").includes(r))||yC.some(r=>(n.contain||"").includes(r))}function wC(e){let t=pr(e);for(;gn(t)&&!Fo(t);){if(Nd(t))return t;if(nl(t))return null;t=pr(t)}return null}function jd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const xC=new Set(["html","body","#document"]);function Fo(e){return xC.has(Ko(e))}function en(e){return St(e).getComputedStyle(e)}function rl(e){return Jt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function pr(e){if(Ko(e)==="html")return e;const t=e.assignedSlot||e.parentNode||kp(e)&&e.host||vn(e);return kp(t)?t.host:t}function wv(e){const t=pr(e);return Fo(t)?e.ownerDocument?e.ownerDocument.body:e.body:gn(t)&&ni(t)?t:wv(t)}function Us(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=wv(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=St(o);if(s){const a=uu(i);return t.concat(i,i.visualViewport||[],ni(o)?o:[],a&&n?Us(a):[])}return t.concat(o,Us(o,[],n))}function uu(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function xv(e){const t=en(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=gn(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Na(n)!==s||Na(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Ad(e){return Jt(e)?e:e.contextElement}function bo(e){const t=Ad(e);if(!gn(t))return hn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=xv(t);let i=(s?Na(n.width):n.width)/r,a=(s?Na(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const bC=hn(0);function bv(e){const t=St(e);return!jd()||!t.visualViewport?bC:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function SC(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==St(e)?!1:t}function Br(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Ad(e);let i=hn(1);t&&(r?Jt(r)&&(i=bo(r)):i=bo(e));const a=SC(s,n,r)?bv(s):hn(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,d=o.width/i.x,m=o.height/i.y;if(s){const y=St(s),p=r&&Jt(r)?St(r):r;let b=y,g=uu(b);for(;g&&r&&p!==b;){const x=bo(g),v=g.getBoundingClientRect(),h=en(g),w=v.left+(g.clientLeft+parseFloat(h.paddingLeft))*x.x,S=v.top+(g.clientTop+parseFloat(h.paddingTop))*x.y;l*=x.x,c*=x.y,d*=x.x,m*=x.y,l+=w,c+=S,b=St(g),g=uu(b)}}return Aa({width:d,height:m,x:l,y:c})}function Rd(e,t){const n=rl(e).scrollLeft;return t?t.left+n:Br(vn(e)).left+n}function Sv(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Rd(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function CC(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=vn(r),a=t?nl(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=hn(1);const d=hn(0),m=gn(r);if((m||!m&&!s)&&((Ko(r)!=="body"||ni(i))&&(l=rl(r)),gn(r))){const p=Br(r);c=bo(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const y=i&&!m&&!s?Sv(i,l,!0):hn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+y.x,y:n.y*c.y-l.scrollTop*c.y+d.y+y.y}}function EC(e){return Array.from(e.getClientRects())}function kC(e){const t=vn(e),n=rl(e),r=e.ownerDocument.body,o=wt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=wt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Rd(e);const a=-n.scrollTop;return en(r).direction==="rtl"&&(i+=wt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function TC(e,t){const n=St(e),r=vn(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const c=jd();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}const PC=new Set(["absolute","fixed"]);function NC(e,t){const n=Br(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=gn(e)?bo(e):hn(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function Tp(e,t,n){let r;if(t==="viewport")r=TC(e,n);else if(t==="document")r=kC(vn(e));else if(Jt(t))r=NC(t,n);else{const o=bv(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Aa(r)}function Cv(e,t){const n=pr(e);return n===t||!Jt(n)||Fo(n)?!1:en(n).position==="fixed"||Cv(n,t)}function jC(e,t){const n=t.get(e);if(n)return n;let r=Us(e,[],!1).filter(a=>Jt(a)&&Ko(a)!=="body"),o=null;const s=en(e).position==="fixed";let i=s?pr(e):e;for(;Jt(i)&&!Fo(i);){const a=en(i),l=Nd(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&PC.has(o.position)||ni(i)&&!l&&Cv(e,i))?r=r.filter(d=>d!==i):o=a,i=pr(i)}return t.set(e,r),r}function AC(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?nl(t)?[]:jC(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,d)=>{const m=Tp(t,d,o);return c.top=wt(m.top,c.top),c.right=fr(m.right,c.right),c.bottom=fr(m.bottom,c.bottom),c.left=wt(m.left,c.left),c},Tp(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function RC(e){const{width:t,height:n}=xv(e);return{width:t,height:n}}function _C(e,t,n){const r=gn(t),o=vn(t),s=n==="fixed",i=Br(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=hn(0);function c(){l.x=Rd(o)}if(r||!r&&!s)if((Ko(t)!=="body"||ni(o))&&(a=rl(t)),r){const p=Br(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&c();s&&!r&&o&&c();const d=o&&!r&&!s?Sv(o,a):hn(0),m=i.left+a.scrollLeft-l.x-d.x,y=i.top+a.scrollTop-l.y-d.y;return{x:m,y,width:i.width,height:i.height}}function Gl(e){return en(e).position==="static"}function Pp(e,t){if(!gn(e)||en(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return vn(e)===n&&(n=n.ownerDocument.body),n}function Ev(e,t){const n=St(e);if(nl(e))return n;if(!gn(e)){let o=pr(e);for(;o&&!Fo(o);){if(Jt(o)&&!Gl(o))return o;o=pr(o)}return n}let r=Pp(e,t);for(;r&&hC(r)&&Gl(r);)r=Pp(r,t);return r&&Fo(r)&&Gl(r)&&!Nd(r)?n:r||wC(e)||n}const IC=async function(e){const t=this.getOffsetParent||Ev,n=this.getDimensions,r=await n(e.floating);return{reference:_C(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function OC(e){return en(e).direction==="rtl"}const LC={convertOffsetParentRelativeRectToViewportRelativeRect:CC,getDocumentElement:vn,getClippingRect:AC,getOffsetParent:Ev,getElementRects:IC,getClientRects:EC,getDimensions:RC,getScale:bo,isElement:Jt,isRTL:OC};function kv(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function MC(e,t){let n=null,r;const o=vn(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=e.getBoundingClientRect(),{left:d,top:m,width:y,height:p}=c;if(a||t(),!y||!p)return;const b=Ti(m),g=Ti(o.clientWidth-(d+y)),x=Ti(o.clientHeight-(m+p)),v=Ti(d),w={rootMargin:-b+"px "+-g+"px "+-x+"px "+-v+"px",threshold:wt(0,fr(1,l))||1};let S=!0;function C(k){const E=k[0].intersectionRatio;if(E!==l){if(!S)return i();E?i(!1,E):r=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!kv(c,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return i(!0),s}function DC(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Ad(e),d=o||s?[...c?Us(c):[],...Us(t)]:[];d.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const m=c&&a?MC(c,n):null;let y=-1,p=null;i&&(p=new ResizeObserver(v=>{let[h]=v;h&&h.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let b,g=l?Br(e):null;l&&x();function x(){const v=Br(e);g&&!kv(g,v)&&n(),g=v,b=requestAnimationFrame(x)}return n(),()=>{var v;d.forEach(h=>{o&&h.removeEventListener("scroll",n),s&&h.removeEventListener("resize",n)}),m==null||m(),(v=p)==null||v.disconnect(),p=null,l&&cancelAnimationFrame(b)}}const FC=lC,zC=cC,$C=sC,BC=dC,UC=iC,Np=oC,VC=uC,WC=(e,t,n)=>{const r=new Map,o={platform:LC,...n},s={...o.platform,_c:r};return rC(e,t,{...o,platform:s})};var HC=typeof document<"u",KC=function(){},Xi=HC?f.useLayoutEffect:KC;function Ra(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ra(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Ra(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Tv(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jp(e,t){const n=Tv(e);return Math.round(t*n)/n}function ql(e){const t=f.useRef(e);return Xi(()=>{t.current=e}),t}function QC(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,m]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,p]=f.useState(r);Ra(y,r)||p(r);const[b,g]=f.useState(null),[x,v]=f.useState(null),h=f.useCallback(T=>{T!==k.current&&(k.current=T,g(T))},[]),w=f.useCallback(T=>{T!==E.current&&(E.current=T,v(T))},[]),S=s||b,C=i||x,k=f.useRef(null),E=f.useRef(null),j=f.useRef(d),_=l!=null,R=ql(l),U=ql(o),F=ql(c),q=f.useCallback(()=>{if(!k.current||!E.current)return;const T={placement:t,strategy:n,middleware:y};U.current&&(T.platform=U.current),WC(k.current,E.current,T).then(P=>{const $={...P,isPositioned:F.current!==!1};L.current&&!Ra(j.current,$)&&(j.current=$,Kr.flushSync(()=>{m($)}))})},[y,t,n,U,F]);Xi(()=>{c===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,m(T=>({...T,isPositioned:!1})))},[c]);const L=f.useRef(!1);Xi(()=>(L.current=!0,()=>{L.current=!1}),[]),Xi(()=>{if(S&&(k.current=S),C&&(E.current=C),S&&C){if(R.current)return R.current(S,C,q);q()}},[S,C,q,R,_]);const G=f.useMemo(()=>({reference:k,floating:E,setReference:h,setFloating:w}),[h,w]),V=f.useMemo(()=>({reference:S,floating:C}),[S,C]),K=f.useMemo(()=>{const T={position:n,left:0,top:0};if(!V.floating)return T;const P=jp(V.floating,d.x),$=jp(V.floating,d.y);return a?{...T,transform:"translate("+P+"px, "+$+"px)",...Tv(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:P,top:$}},[n,a,V.floating,d.x,d.y]);return f.useMemo(()=>({...d,update:q,refs:G,elements:V,floatingStyles:K}),[d,q,G,V,K])}const GC=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Np({element:r.current,padding:o}).fn(n):{}:r?Np({element:r,padding:o}).fn(n):{}}}},qC=(e,t)=>({...FC(e),options:[e,t]}),YC=(e,t)=>({...zC(e),options:[e,t]}),XC=(e,t)=>({...VC(e),options:[e,t]}),ZC=(e,t)=>({...$C(e),options:[e,t]}),JC=(e,t)=>({...BC(e),options:[e,t]}),eE=(e,t)=>({...UC(e),options:[e,t]}),tE=(e,t)=>({...GC(e),options:[e,t]});var nE="Arrow",Pv=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return u.jsx(ce.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});Pv.displayName=nE;var rE=Pv;function Nv(e){const[t,n]=f.useState(void 0);return Oe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var _d="Popper",[jv,ol]=Qr(_d),[oE,Av]=jv(_d),Rv=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return u.jsx(oE,{scope:t,anchor:r,onAnchorChange:o,children:n})};Rv.displayName=_d;var _v="PopperAnchor",Iv=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Av(_v,n),i=f.useRef(null),a=Te(t,i);return f.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:u.jsx(ce.div,{...o,ref:a})});Iv.displayName=_v;var Id="PopperContent",[sE,iE]=jv(Id),Ov=f.forwardRef((e,t)=>{var z,ne,ve,se,re,oe;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:m="partial",hideWhenDetached:y=!1,updatePositionStrategy:p="optimized",onPlaced:b,...g}=e,x=Av(Id,n),[v,h]=f.useState(null),w=Te(t,xe=>h(xe)),[S,C]=f.useState(null),k=Nv(S),E=(k==null?void 0:k.width)??0,j=(k==null?void 0:k.height)??0,_=r+(s!=="center"?"-"+s:""),R=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},U=Array.isArray(c)?c:[c],F=U.length>0,q={padding:R,boundary:U.filter(lE),altBoundary:F},{refs:L,floatingStyles:G,placement:V,isPositioned:K,middlewareData:T}=QC({strategy:"fixed",placement:_,whileElementsMounted:(...xe)=>DC(...xe,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[qC({mainAxis:o+j,alignmentAxis:i}),l&&YC({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?XC():void 0,...q}),l&&ZC({...q}),JC({...q,apply:({elements:xe,rects:Fe,availableWidth:Lt,availableHeight:vt})=>{const{width:Mt,height:yn}=Fe.reference,nn=xe.floating.style;nn.setProperty("--radix-popper-available-width",`${Lt}px`),nn.setProperty("--radix-popper-available-height",`${vt}px`),nn.setProperty("--radix-popper-anchor-width",`${Mt}px`),nn.setProperty("--radix-popper-anchor-height",`${yn}px`)}}),S&&tE({element:S,padding:a}),cE({arrowWidth:E,arrowHeight:j}),y&&eE({strategy:"referenceHidden",...q})]}),[P,$]=Dv(V),Y=Ot(b);Oe(()=>{K&&(Y==null||Y())},[K,Y]);const H=(z=T.arrow)==null?void 0:z.x,X=(ne=T.arrow)==null?void 0:ne.y,Q=((ve=T.arrow)==null?void 0:ve.centerOffset)!==0,[fe,ue]=f.useState();return Oe(()=>{v&&ue(window.getComputedStyle(v).zIndex)},[v]),u.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:K?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(se=T.transformOrigin)==null?void 0:se.x,(re=T.transformOrigin)==null?void 0:re.y].join(" "),...((oe=T.hide)==null?void 0:oe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(sE,{scope:n,placedSide:P,onArrowChange:C,arrowX:H,arrowY:X,shouldHideArrow:Q,children:u.jsx(ce.div,{"data-side":P,"data-align":$,...g,ref:w,style:{...g.style,animation:K?void 0:"none"}})})})});Ov.displayName=Id;var Lv="PopperArrow",aE={top:"bottom",right:"left",bottom:"top",left:"right"},Mv=f.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=iE(Lv,r),i=aE[s.placedSide];return u.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]: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:u.jsx(rE,{...o,ref:n,style:{...o.style,display:"block"}})})});Mv.displayName=Lv;function lE(e){return e!==null}var cE=e=>({name:"transformOrigin",options:e,fn(t){var x,v,h;const{placement:n,rects:r,middlewareData:o}=t,i=((x=o.arrow)==null?void 0:x.centerOffset)!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,d]=Dv(n),m={start:"0%",center:"50%",end:"100%"}[d],y=(((v=o.arrow)==null?void 0:v.x)??0)+a/2,p=(((h=o.arrow)==null?void 0:h.y)??0)+l/2;let b="",g="";return c==="bottom"?(b=i?m:`${y}px`,g=`${-l}px`):c==="top"?(b=i?m:`${y}px`,g=`${r.floating.height+l}px`):c==="right"?(b=`${-l}px`,g=i?m:`${p}px`):c==="left"&&(b=`${r.floating.width+l}px`,g=i?m:`${p}px`),{data:{x:b,y:g}}}});function Dv(e){const[t,n="center"]=e.split("-");return[t,n]}var uE=Rv,Fv=Iv,zv=Ov,$v=Mv,[sl,mN]=Qr("Tooltip",[ol]),Od=ol(),Bv="TooltipProvider",dE=700,Ap="tooltip.open",[fE,Uv]=sl(Bv),Vv=e=>{const{__scopeTooltip:t,delayDuration:n=dE,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=f.useRef(!0),a=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),u.jsx(fE,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:f.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:s})};Vv.displayName=Bv;var Wv="Tooltip",[gN,il]=sl(Wv),du="TooltipTrigger",pE=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=il(du,n),s=Uv(du,n),i=Od(n),a=f.useRef(null),l=Te(t,a,o.onTriggerChange),c=f.useRef(!1),d=f.useRef(!1),m=f.useCallback(()=>c.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),u.jsx(Fv,{asChild:!0,...i,children:u.jsx(ce.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:ie(e.onPointerMove,y=>{y.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:ie(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:ie(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:ie(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:ie(e.onBlur,o.onClose),onClick:ie(e.onClick,o.onClose)})})});pE.displayName=du;var hE="TooltipPortal",[vN,mE]=sl(hE,{forceMount:void 0}),zo="TooltipContent",Hv=f.forwardRef((e,t)=>{const n=mE(zo,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=il(zo,e.__scopeTooltip);return u.jsx(Za,{present:r||i.open,children:i.disableHoverableContent?u.jsx(Kv,{side:o,...s,ref:t}):u.jsx(gE,{side:o,...s,ref:t})})}),gE=f.forwardRef((e,t)=>{const n=il(zo,e.__scopeTooltip),r=Uv(zo,e.__scopeTooltip),o=f.useRef(null),s=Te(t,o),[i,a]=f.useState(null),{trigger:l,onClose:c}=n,d=o.current,{onPointerInTransitChange:m}=r,y=f.useCallback(()=>{a(null),m(!1)},[m]),p=f.useCallback((b,g)=>{const x=b.currentTarget,v={x:b.clientX,y:b.clientY},h=bE(v,x.getBoundingClientRect()),w=SE(v,h),S=CE(g.getBoundingClientRect()),C=kE([...w,...S]);a(C),m(!0)},[m]);return f.useEffect(()=>()=>y(),[y]),f.useEffect(()=>{if(l&&d){const b=x=>p(x,d),g=x=>p(x,l);return l.addEventListener("pointerleave",b),d.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",b),d.removeEventListener("pointerleave",g)}}},[l,d,p,y]),f.useEffect(()=>{if(i){const b=g=>{const x=g.target,v={x:g.clientX,y:g.clientY},h=(l==null?void 0:l.contains(x))||(d==null?void 0:d.contains(x)),w=!EE(v,i);h?y():w&&(y(),c())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[l,d,i,c,y]),u.jsx(Kv,{...e,ref:s})}),[vE,yE]=sl(Wv,{isInside:!1}),wE=Lb("TooltipContent"),Kv=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,l=il(zo,n),c=Od(n),{onClose:d}=l;return f.useEffect(()=>(document.addEventListener(Ap,d),()=>document.removeEventListener(Ap,d)),[d]),f.useEffect(()=>{if(l.trigger){const m=y=>{const p=y.target;p!=null&&p.contains(l.trigger)&&d()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[l.trigger,d]),u.jsx(Xa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:m=>m.preventDefault(),onDismiss:d,children:u.jsxs(zv,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(wE,{children:r}),u.jsx(vE,{scope:n,isInside:!0,children:u.jsx(rS,{id:l.contentId,role:"tooltip",children:o||r})})]})})});Hv.displayName=zo;var Qv="TooltipArrow",xE=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Od(n);return yE(Qv,n).isInside?null:u.jsx($v,{...o,...r,ref:t})});xE.displayName=Qv;function bE(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function SE(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function CE(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function EE(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;sr!=y>r&&n<(m-c)*(r-d)/(y-d)+c&&(o=!o)}return o}function kE(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),TE(t)}function TE(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var PE=Vv,Gv=Hv;const NE=PE,jE=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>u.jsx(Gv,{ref:r,sideOffset:t,className:he("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));jE.displayName=Gv.displayName;var al=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ll=typeof window>"u"||"Deno"in globalThis;function Ht(){}function AE(e,t){return typeof e=="function"?e(t):e}function RE(e){return typeof e=="number"&&e>=0&&e!==1/0}function _E(e,t){return Math.max(e+(t||0)-Date.now(),0)}function fu(e,t){return typeof e=="function"?e(t):e}function IE(e,t){return typeof e=="function"?e(t):e}function Rp(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Ld(i,t.options))return!1}else if(!Ws(t.queryKey,i))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function _p(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Vs(t.options.mutationKey)!==Vs(s))return!1}else if(!Ws(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Ld(e,t){return((t==null?void 0:t.queryKeyHashFn)||Vs)(e)}function Vs(e){return JSON.stringify(e,(t,n)=>pu(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Ws(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ws(e[n],t[n])):!1}function qv(e,t){if(e===t)return e;const n=Ip(e)&&Ip(t);if(n||pu(e)&&pu(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,a=n?[]:{},l=new Set(r);let c=0;for(let d=0;d{setTimeout(t,e)})}function LE(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?qv(e,t):t}function ME(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function DE(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Md=Symbol();function Yv(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Md?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Pr,Gn,Co,sh,FE=(sh=class extends al{constructor(){super();pe(this,Pr);pe(this,Gn);pe(this,Co);J(this,Co,t=>{if(!ll&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){A(this,Gn)||this.setEventListener(A(this,Co))}onUnsubscribe(){var t;this.hasListeners()||((t=A(this,Gn))==null||t.call(this),J(this,Gn,void 0))}setEventListener(t){var n;J(this,Co,t),(n=A(this,Gn))==null||n.call(this),J(this,Gn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){A(this,Pr)!==t&&(J(this,Pr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof A(this,Pr)=="boolean"?A(this,Pr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Pr=new WeakMap,Gn=new WeakMap,Co=new WeakMap,sh),Xv=new FE,Eo,qn,ko,ih,zE=(ih=class extends al{constructor(){super();pe(this,Eo,!0);pe(this,qn);pe(this,ko);J(this,ko,t=>{if(!ll&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){A(this,qn)||this.setEventListener(A(this,ko))}onUnsubscribe(){var t;this.hasListeners()||((t=A(this,qn))==null||t.call(this),J(this,qn,void 0))}setEventListener(t){var n;J(this,ko,t),(n=A(this,qn))==null||n.call(this),J(this,qn,t(this.setOnline.bind(this)))}setOnline(t){A(this,Eo)!==t&&(J(this,Eo,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return A(this,Eo)}},Eo=new WeakMap,qn=new WeakMap,ko=new WeakMap,ih),_a=new zE;function $E(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function BE(e){return Math.min(1e3*2**e,3e4)}function Zv(e){return(e??"online")==="online"?_a.isOnline():!0}var Jv=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Yl(e){return e instanceof Jv}function ey(e){let t=!1,n=0,r=!1,o;const s=$E(),i=g=>{var x;r||(y(new Jv(g)),(x=e.abort)==null||x.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>Xv.isFocused()&&(e.networkMode==="always"||_a.isOnline())&&e.canRun(),d=()=>Zv(e.networkMode)&&e.canRun(),m=g=>{var x;r||(r=!0,(x=e.onSuccess)==null||x.call(e,g),o==null||o(),s.resolve(g))},y=g=>{var x;r||(r=!0,(x=e.onError)==null||x.call(e,g),o==null||o(),s.reject(g))},p=()=>new Promise(g=>{var x;o=v=>{(r||c())&&g(v)},(x=e.onPause)==null||x.call(e)}).then(()=>{var g;o=void 0,r||(g=e.onContinue)==null||g.call(e)}),b=()=>{if(r)return;let g;const x=n===0?e.initialPromise:void 0;try{g=x??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(m).catch(v=>{var k;if(r)return;const h=e.retry??(ll?0:3),w=e.retryDelay??BE,S=typeof w=="function"?w(n,v):w,C=h===!0||typeof h=="number"&&nc()?void 0:p()).then(()=>{t?y(v):b()})})};return{promise:s,cancel:i,continue:()=>(o==null||o(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?b():p().then(b),s)}}var UE=e=>setTimeout(e,0);function VE(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=UE;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||i()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var ot=VE(),Nr,ah,ty=(ah=class{constructor(){pe(this,Nr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),RE(this.gcTime)&&J(this,Nr,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ll?1/0:5*60*1e3))}clearGcTimeout(){A(this,Nr)&&(clearTimeout(A(this,Nr)),J(this,Nr,void 0))}},Nr=new WeakMap,ah),To,jr,Pt,Ar,Xe,Gs,Rr,Kt,bn,lh,WE=(lh=class extends ty{constructor(t){super();pe(this,Kt);pe(this,To);pe(this,jr);pe(this,Pt);pe(this,Ar);pe(this,Xe);pe(this,Gs);pe(this,Rr);J(this,Rr,!1),J(this,Gs,t.defaultOptions),this.setOptions(t.options),this.observers=[],J(this,Ar,t.client),J(this,Pt,A(this,Ar).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,J(this,To,KE(this.options)),this.state=t.state??A(this,To),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=A(this,Xe))==null?void 0:t.promise}setOptions(t){this.options={...A(this,Gs),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&A(this,Pt).remove(this)}setData(t,n){const r=LE(this.state.data,t,this.options);return Ge(this,Kt,bn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ge(this,Kt,bn).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=A(this,Xe))==null?void 0:r.promise;return(o=A(this,Xe))==null||o.cancel(t),n?n.then(Ht).catch(Ht):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(A(this,To))}isActive(){return this.observers.some(t=>IE(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Md||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>fu(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!_E(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=A(this,Xe))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=A(this,Xe))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),A(this,Pt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(A(this,Xe)&&(A(this,Rr)?A(this,Xe).cancel({revert:!0}):A(this,Xe).cancelRetry()),this.scheduleGc()),A(this,Pt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ge(this,Kt,bn).call(this,{type:"invalidate"})}fetch(t,n){var c,d,m;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(A(this,Xe))return A(this,Xe).continueRetry(),A(this,Xe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const y=this.observers.find(p=>p.options.queryFn);y&&this.setOptions(y.options)}const r=new AbortController,o=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(J(this,Rr,!0),r.signal)})},s=()=>{const y=Yv(this.options,n),b=(()=>{const g={client:A(this,Ar),queryKey:this.queryKey,meta:this.meta};return o(g),g})();return J(this,Rr,!1),this.options.persister?this.options.persister(y,b,this):y(b)},a=(()=>{const y={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:A(this,Ar),state:this.state,fetchFn:s};return o(y),y})();(c=this.options.behavior)==null||c.onFetch(a,this),J(this,jr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&Ge(this,Kt,bn).call(this,{type:"fetch",meta:(m=a.fetchOptions)==null?void 0:m.meta});const l=y=>{var p,b,g,x;Yl(y)&&y.silent||Ge(this,Kt,bn).call(this,{type:"error",error:y}),Yl(y)||((b=(p=A(this,Pt).config).onError)==null||b.call(p,y,this),(x=(g=A(this,Pt).config).onSettled)==null||x.call(g,this.state.data,y,this)),this.scheduleGc()};return J(this,Xe,ey({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:y=>{var p,b,g,x;if(y===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(y)}catch(v){l(v);return}(b=(p=A(this,Pt).config).onSuccess)==null||b.call(p,y,this),(x=(g=A(this,Pt).config).onSettled)==null||x.call(g,y,this.state.error,this),this.scheduleGc()},onError:l,onFail:(y,p)=>{Ge(this,Kt,bn).call(this,{type:"failed",failureCount:y,error:p})},onPause:()=>{Ge(this,Kt,bn).call(this,{type:"pause"})},onContinue:()=>{Ge(this,Kt,bn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),A(this,Xe).start()}},To=new WeakMap,jr=new WeakMap,Pt=new WeakMap,Ar=new WeakMap,Xe=new WeakMap,Gs=new WeakMap,Rr=new WeakMap,Kt=new WeakSet,bn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...HE(r.data,this.options),fetchMeta:t.meta??null};case"success":return J(this,jr,void 0),{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Yl(o)&&o.revert&&A(this,jr)?{...A(this,jr),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ot.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),A(this,Pt).notify({query:this,type:"updated",action:t})})},lh);function HE(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Zv(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function KE(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var sn,ch,QE=(ch=class extends al{constructor(t={}){super();pe(this,sn);this.config=t,J(this,sn,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??Ld(o,n);let i=this.get(s);return i||(i=new WE({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){A(this,sn).has(t.queryHash)||(A(this,sn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=A(this,sn).get(t.queryHash);n&&(t.destroy(),n===t&&A(this,sn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ot.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return A(this,sn).get(t)}getAll(){return[...A(this,sn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Rp(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Rp(t,r)):n}notify(t){ot.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ot.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ot.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},sn=new WeakMap,ch),an,nt,_r,ln,Un,uh,GE=(uh=class extends ty{constructor(t){super();pe(this,ln);pe(this,an);pe(this,nt);pe(this,_r);this.mutationId=t.mutationId,J(this,nt,t.mutationCache),J(this,an,[]),this.state=t.state||qE(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){A(this,an).includes(t)||(A(this,an).push(t),this.clearGcTimeout(),A(this,nt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){J(this,an,A(this,an).filter(n=>n!==t)),this.scheduleGc(),A(this,nt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){A(this,an).length||(this.state.status==="pending"?this.scheduleGc():A(this,nt).remove(this))}continue(){var t;return((t=A(this,_r))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,i,a,l,c,d,m,y,p,b,g,x,v,h,w,S,C,k,E,j;const n=()=>{Ge(this,ln,Un).call(this,{type:"continue"})};J(this,_r,ey({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(_,R)=>{Ge(this,ln,Un).call(this,{type:"failed",failureCount:_,error:R})},onPause:()=>{Ge(this,ln,Un).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>A(this,nt).canRun(this)}));const r=this.state.status==="pending",o=!A(this,_r).canStart();try{if(r)n();else{Ge(this,ln,Un).call(this,{type:"pending",variables:t,isPaused:o}),await((i=(s=A(this,nt).config).onMutate)==null?void 0:i.call(s,t,this));const R=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,t));R!==this.state.context&&Ge(this,ln,Un).call(this,{type:"pending",context:R,variables:t,isPaused:o})}const _=await A(this,_r).start();return await((d=(c=A(this,nt).config).onSuccess)==null?void 0:d.call(c,_,t,this.state.context,this)),await((y=(m=this.options).onSuccess)==null?void 0:y.call(m,_,t,this.state.context)),await((b=(p=A(this,nt).config).onSettled)==null?void 0:b.call(p,_,null,this.state.variables,this.state.context,this)),await((x=(g=this.options).onSettled)==null?void 0:x.call(g,_,null,t,this.state.context)),Ge(this,ln,Un).call(this,{type:"success",data:_}),_}catch(_){try{throw await((h=(v=A(this,nt).config).onError)==null?void 0:h.call(v,_,t,this.state.context,this)),await((S=(w=this.options).onError)==null?void 0:S.call(w,_,t,this.state.context)),await((k=(C=A(this,nt).config).onSettled)==null?void 0:k.call(C,void 0,_,this.state.variables,this.state.context,this)),await((j=(E=this.options).onSettled)==null?void 0:j.call(E,void 0,_,t,this.state.context)),_}finally{Ge(this,ln,Un).call(this,{type:"error",error:_})}}finally{A(this,nt).runNext(this)}}},an=new WeakMap,nt=new WeakMap,_r=new WeakMap,ln=new WeakSet,Un=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ot.batch(()=>{A(this,an).forEach(r=>{r.onMutationUpdate(t)}),A(this,nt).notify({mutation:this,type:"updated",action:t})})},uh);function qE(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var En,Qt,qs,dh,YE=(dh=class extends al{constructor(t={}){super();pe(this,En);pe(this,Qt);pe(this,qs);this.config=t,J(this,En,new Set),J(this,Qt,new Map),J(this,qs,0)}build(t,n,r){const o=new GE({mutationCache:this,mutationId:++si(this,qs)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){A(this,En).add(t);const n=Pi(t);if(typeof n=="string"){const r=A(this,Qt).get(n);r?r.push(t):A(this,Qt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(A(this,En).delete(t)){const n=Pi(t);if(typeof n=="string"){const r=A(this,Qt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&A(this,Qt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Pi(t);if(typeof n=="string"){const r=A(this,Qt).get(n),o=r==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=Pi(t);if(typeof n=="string"){const o=(r=A(this,Qt).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ot.batch(()=>{A(this,En).forEach(t=>{this.notify({type:"removed",mutation:t})}),A(this,En).clear(),A(this,Qt).clear()})}getAll(){return Array.from(A(this,En))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>_p(n,r))}findAll(t={}){return this.getAll().filter(n=>_p(t,n))}notify(t){ot.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ot.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ht))))}},En=new WeakMap,Qt=new WeakMap,qs=new WeakMap,dh);function Pi(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Lp(e){return{onFetch:(t,n)=>{var d,m,y,p,b;const r=t.options,o=(y=(m=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:m.fetchMore)==null?void 0:y.direction,s=((p=t.state.data)==null?void 0:p.pages)||[],i=((b=t.state.data)==null?void 0:b.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let g=!1;const x=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},v=Yv(t.options,t.fetchOptions),h=async(w,S,C)=>{if(g)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const E=(()=>{const U={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return x(U),U})(),j=await v(E),{maxPages:_}=t.options,R=C?DE:ME;return{pages:R(w.pages,j,_),pageParams:R(w.pageParams,S,_)}};if(o&&s.length){const w=o==="backward",S=w?XE:Mp,C={pages:s,pageParams:i},k=S(r,C);a=await h(C,k,w)}else{const w=e??s.length;do{const S=l===0?i[0]??r.initialPageParam:Mp(r,a);if(l>0&&S==null)break;a=await h(a,S),l++}while(l{var g,x;return(x=(g=t.options).persister)==null?void 0:x.call(g,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Mp(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function XE(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Ae,Yn,Xn,Po,No,Zn,jo,Ao,fh,ZE=(fh=class{constructor(e={}){pe(this,Ae);pe(this,Yn);pe(this,Xn);pe(this,Po);pe(this,No);pe(this,Zn);pe(this,jo);pe(this,Ao);J(this,Ae,e.queryCache||new QE),J(this,Yn,e.mutationCache||new YE),J(this,Xn,e.defaultOptions||{}),J(this,Po,new Map),J(this,No,new Map),J(this,Zn,0)}mount(){si(this,Zn)._++,A(this,Zn)===1&&(J(this,jo,Xv.subscribe(async e=>{e&&(await this.resumePausedMutations(),A(this,Ae).onFocus())})),J(this,Ao,_a.subscribe(async e=>{e&&(await this.resumePausedMutations(),A(this,Ae).onOnline())})))}unmount(){var e,t;si(this,Zn)._--,A(this,Zn)===0&&((e=A(this,jo))==null||e.call(this),J(this,jo,void 0),(t=A(this,Ao))==null||t.call(this),J(this,Ao,void 0))}isFetching(e){return A(this,Ae).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return A(this,Yn).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=A(this,Ae).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=A(this,Ae).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(fu(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return A(this,Ae).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=A(this,Ae).get(r.queryHash),s=o==null?void 0:o.state.data,i=AE(t,s);if(i!==void 0)return A(this,Ae).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return ot.batch(()=>A(this,Ae).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=A(this,Ae).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=A(this,Ae);ot.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=A(this,Ae);return ot.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ot.batch(()=>A(this,Ae).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Ht).catch(Ht)}invalidateQueries(e,t={}){return ot.batch(()=>(A(this,Ae).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ot.batch(()=>A(this,Ae).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(Ht)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ht)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=A(this,Ae).build(this,t);return n.isStaleByTime(fu(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ht).catch(Ht)}fetchInfiniteQuery(e){return e.behavior=Lp(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ht).catch(Ht)}ensureInfiniteQueryData(e){return e.behavior=Lp(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return _a.isOnline()?A(this,Yn).resumePausedMutations():Promise.resolve()}getQueryCache(){return A(this,Ae)}getMutationCache(){return A(this,Yn)}getDefaultOptions(){return A(this,Xn)}setDefaultOptions(e){J(this,Xn,e)}setQueryDefaults(e,t){A(this,Po).set(Vs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...A(this,Po).values()],n={};return t.forEach(r=>{Ws(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){A(this,No).set(Vs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...A(this,No).values()],n={};return t.forEach(r=>{Ws(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...A(this,Xn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ld(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Md&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...A(this,Xn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){A(this,Ae).clear(),A(this,Yn).clear()}},Ae=new WeakMap,Yn=new WeakMap,Xn=new WeakMap,Po=new WeakMap,No=new WeakMap,Zn=new WeakMap,jo=new WeakMap,Ao=new WeakMap,fh),JE=f.createContext(void 0),ek=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(JE.Provider,{value:e,children:t}));/** * @remix-run/router v1.23.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Hs(){return Hs=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function nk(){return Math.random().toString(36).substr(2,8)}function Fp(e,t){return{usr:e.state,key:e.key,idx:t}}function hu(e,t,n,r){return n===void 0&&(n=null),Hs({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?cl(t):t,{state:n,key:t&&t.key||r||nk()})}function ny(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function cl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function rk(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:s=!1}=r,i=o.history,a=Tr.Pop,l=null,c=d();c==null&&(c=0,i.replaceState(Hs({},i.state,{idx:c}),""));function d(){return(i.state||{idx:null}).idx}function m(){a=Tr.Pop;let x=d(),v=x==null?null:x-c;c=x,l&&l({action:a,location:g.location,delta:v})}function y(x,v){a=Tr.Push;let h=hu(g.location,x,v);c=d()+1;let w=Fp(h,c),S=g.createHref(h);try{i.pushState(w,"",S)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(S)}s&&l&&l({action:a,location:g.location,delta:1})}function p(x,v){a=Tr.Replace;let h=hu(g.location,x,v);c=d();let w=Fp(h,c),S=g.createHref(h);i.replaceState(w,"",S),s&&l&&l({action:a,location:g.location,delta:0})}function b(x){let v=o.location.origin!=="null"?o.location.origin:o.location.href,h=typeof x=="string"?x:ny(x);return h=h.replace(/ $/,"%20"),mn(v,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,v)}let g={get action(){return a},get location(){return e(o,i)},listen(x){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(Dp,m),l=x,()=>{o.removeEventListener(Dp,m),l=null}},createHref(x){return t(o,x)},createURL:b,encodeLocation(x){let v=b(x);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:y,replace:p,go(x){return i.go(x)}};return g}var zp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(zp||(zp={}));function ok(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function sk(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?cl(e):e;return{pathname:n?n.startsWith("/")?n:ik(n,t):t,search:dk(r),hash:fk(o)}}function ik(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Xl(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function ak(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function lk(e,t){let n=ak(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function ck(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=cl(e):(o=Hs({},e),mn(!o.pathname||!o.pathname.includes("?"),Xl("?","pathname","search",o)),mn(!o.pathname||!o.pathname.includes("#"),Xl("#","pathname","hash",o)),mn(!o.search||!o.search.includes("#"),Xl("#","search","hash",o)));let s=e===""||o.pathname==="",i=s?"/":o.pathname,a;if(i==null)a=n;else{let m=t.length-1;if(!r&&i.startsWith("..")){let y=i.split("/");for(;y[0]==="..";)y.shift(),m-=1;o.pathname=y.join("/")}a=m>=0?t[m]:"/"}let l=sk(o,a),c=i&&i!=="/"&&i.endsWith("/"),d=(s||i===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||d)&&(l.pathname+="/"),l}const uk=e=>e.join("/").replace(/\/\/+/g,"/"),dk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,fk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ry=["post","put","patch","delete"];new Set(ry);const pk=["get",...ry];new Set(pk);/** * React Router v6.30.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Ia(){return Ia=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),f.useCallback(function(c,d){if(d===void 0&&(d={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let m=ck(c,JSON.parse(i),s,d.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:uk([t,m.pathname])),(d.replace?r.replace:r.push)(m,d.state,d)},[t,r,i,s,e])}var ay=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ay||{}),ly=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ly||{});function gk(e){let t=f.useContext(oy);return t||mn(!1),t}function vk(e){let t=f.useContext(zd);return t||mn(!1),t}function yk(e){let t=vk(),n=t.matches[t.matches.length-1];return n.route.id||mn(!1),n.route.id}function wk(){let{router:e}=gk(ay.UseNavigateStable),t=yk(ly.UseNavigateStable),n=f.useRef(!1);return sy(()=>{n.current=!0}),f.useCallback(function(o,s){s===void 0&&(s={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Ia({fromRouteId:t},s)))},[e,t])}function xk(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function bk(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Tr.Pop,navigator:s,static:i=!1,future:a}=e;$d()&&mn(!1);let l=t.replace(/^\/*/,"/"),c=f.useMemo(()=>({basename:l,navigator:s,static:i,future:Ia({v7_relativeSplatPath:!1},a)}),[l,a,s,i]);typeof r=="string"&&(r=cl(r));let{pathname:d="/",search:m="",hash:y="",state:p=null,key:b="default"}=r,g=f.useMemo(()=>{let x=ok(d,l);return x==null?null:{location:{pathname:x,search:m,hash:y,state:p,key:b},navigationType:o}},[l,d,m,y,p,b,o]);return g==null?null:f.createElement(Dd.Provider,{value:c},f.createElement(Fd.Provider,{children:n,value:g}))}new Promise(()=>{});/** * React Router DOM v6.30.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */const Sk="6";try{window.__reactRouterVersion=Sk}catch{}const Ck="startTransition",$p=Pu[Ck];function Ek(e){let{basename:t,children:n,future:r,window:o}=e,s=f.useRef();s.current==null&&(s.current=tk({window:o,v5Compat:!0}));let i=s.current,[a,l]=f.useState({action:i.action,location:i.location}),{v7_startTransition:c}=r||{},d=f.useCallback(m=>{c&&$p?$p(()=>l(m)):l(m)},[l,c]);return f.useLayoutEffect(()=>i.listen(d),[i,d]),f.useEffect(()=>xk(r),[r]),f.createElement(bk,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:i,future:r})}var Bp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Bp||(Bp={}));var Up;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Up||(Up={}));var cy=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(cy||{}),Zl={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"]}};Object.values(cy);var Bd={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"};Object.entries(Bd).reduce((e,[t,n])=>(e[n]=t,e),{});var Ks="data-rh",kk=e=>Array.isArray(e)?e.join(""):e,Tk=(e,t)=>{const n=Object.keys(e);for(let r=0;rArray.isArray(e)?e.reduce((n,r)=>(Tk(r,t)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:e,priority:[]},Pk=["noscript","script","style"],mu=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),uy=e=>Object.keys(e).reduce((t,n)=>{const r=typeof e[n]<"u"?`${n}="${e[n]}"`:`${n}`;return t?`${t} ${r}`:r},""),Nk=(e,t,n,r)=>{const o=uy(n),s=kk(t);return o?`<${e} ${Ks}="true" ${o}>${mu(s,r)}`:`<${e} ${Ks}="true">${mu(s,r)}`},jk=(e,t,n=!0)=>t.reduce((r,o)=>{const s=o,i=Object.keys(s).filter(c=>!(c==="innerHTML"||c==="cssText")).reduce((c,d)=>{const m=typeof s[d]>"u"?d:`${d}="${mu(s[d],n)}"`;return c?`${c} ${m}`:m},""),a=s.innerHTML||s.cssText||"",l=Pk.indexOf(e)===-1;return`${r}<${e} ${Ks}="true" ${i}${l?"/>":`>${a}`}`},""),dy=(e,t={})=>Object.keys(e).reduce((n,r)=>{const o=Bd[r];return n[o||r]=e[r],n},t),Ak=(e,t,n)=>{const r={key:t,[Ks]:!0},o=dy(n,r);return[O.createElement("title",o,t)]},Zi=(e,t)=>t.map((n,r)=>{const o={key:r,[Ks]:!0};return Object.keys(n).forEach(s=>{const a=Bd[s]||s;if(a==="innerHTML"||a==="cssText"){const l=n.innerHTML||n.cssText;o.dangerouslySetInnerHTML={__html:l}}else o[a]=n[s]}),O.createElement(e,o)}),Tt=(e,t,n=!0)=>{switch(e){case"title":return{toComponent:()=>Ak(e,t.title,t.titleAttributes),toString:()=>Nk(e,t.title,t.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>dy(t),toString:()=>uy(t)};default:return{toComponent:()=>Zi(e,t),toString:()=>jk(e,t,n)}}},Rk=({metaTags:e,linkTags:t,scriptTags:n,encode:r})=>{const o=Jl(e,Zl.meta),s=Jl(t,Zl.link),i=Jl(n,Zl.script);return{priorityMethods:{toComponent:()=>[...Zi("meta",o.priority),...Zi("link",s.priority),...Zi("script",i.priority)],toString:()=>`${Tt("meta",o.priority,r)} ${Tt("link",s.priority,r)} ${Tt("script",i.priority,r)}`},metaTags:o.default,linkTags:s.default,scriptTags:i.default}},_k=e=>{const{baseTag:t,bodyAttributes:n,encode:r=!0,htmlAttributes:o,noscriptTags:s,styleTags:i,title:a="",titleAttributes:l,prioritizeSeoTags:c}=e;let{linkTags:d,metaTags:m,scriptTags:y}=e,p={toComponent:()=>{},toString:()=>""};return c&&({priorityMethods:p,linkTags:d,metaTags:m,scriptTags:y}=Rk(e)),{priority:p,base:Tt("base",t,r),bodyAttributes:Tt("bodyAttributes",n,r),htmlAttributes:Tt("htmlAttributes",o,r),link:Tt("link",d,r),meta:Tt("meta",m,r),noscript:Tt("noscript",s,r),script:Tt("script",y,r),style:Tt("style",i,r),title:Tt("title",{title:a,titleAttributes:l},r)}},Ik=_k,Ni=[],fy=!!(typeof window<"u"&&window.document&&window.document.createElement),Ok=class{constructor(e,t){xr(this,"instances",[]);xr(this,"canUseDOM",fy);xr(this,"context");xr(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?Ni:this.instances,add:e=>{(this.canUseDOM?Ni:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?Ni:this.instances).indexOf(e);(this.canUseDOM?Ni:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=Ik({baseTag:[],bodyAttributes:{},htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Lk={},Mk=O.createContext(Lk),Ir,Dk=(Ir=class extends f.Component{constructor(n){super(n);xr(this,"helmetData");this.helmetData=new Ok(this.props.context||{},Ir.canUseDOM)}render(){return O.createElement(Mk.Provider,{value:this.helmetData.value},this.props.children)}},xr(Ir,"canUseDOM",fy),Ir);const Fk=f.createContext(void 0),zk={de:{"nav.home":"Startseite","nav.services":"Leistungen","nav.testimonials":"Kundenstimmen","nav.blog":"Blog","nav.contact":"Kontakt","nav.team":"Team","hero.title":"KI-gestützte Content-Automatisierung","hero.subtitle":"Revolutioniere deine Content-Strategie mit unserem KI-Assistenten","hero.description":"KImaschine automatisiert deine Website-, Blog- und Social-Media-Inhalte mithilfe fortschrittlicher KI. Spare Zeit, steigere die Effizienz und bleibe im digitalen Wettbewerb vorne.","hero.cta":"Starte jetzt","hero.secondary":"Mehr erfahren","hero.badge.technology":"AI-Technologie","hero.badge.madeIn":"Made in Germany","hero.badge.saving":"80%","hero.badge.savingText":"Zeitersparnis","hero.badge.branding":"AI Branding","hero.badge.brandingText":"Tailored to your brand","hero.badge.gdpr":"DSGVO","hero.badge.gdprText":"Konform","features.title":"Warum KImaschine?","features.subtitle":"Unsere Vorteile","features.unified.title":"Einheitliche Plattform","features.unified.description":"Eine zentrale Lösung für alle deine Content-Kanäle","features.ai.title":"KI-gesteuerte Erstellung","features.ai.description":"Hochwertige Inhalte durch fortschrittliche Künstliche Intelligenz","features.multichannel.title":"Kanalübergreifend","features.multichannel.description":"Nahtlose Veröffentlichung auf Website, Blog, LinkedIn, Instagram und mehr","features.time.title":"Zeitersparnis","features.time.description":"Automatisierung spart bis zu 80% deiner Content-Erstellungszeit","services.title":"Unsere Leistungen","services.subtitle":"Was wir bieten","services.intro1":"Wir entwerfen KI mit Wirkung.","services.intro2":"Als KI Architecture Studio entwickeln wir intelligente Assistenzsysteme, die Marketing- und Vertriebsprozesse nicht nur automatisieren, sondern strategisch verstärken.","services.focus":"Unsere Schwerpunkte:","services.architecture.title":"Individuelle KI-Systemarchitektur","services.architecture.desc":"Maßgeschneiderte Lösungen für deinen Marketing- und Sales-Workflow – effizient, skalierbar, zukunftsfähig.","services.architecture.list1":"Kundenspezifische Architektur","services.architecture.list2":"Zukunftsfähige Technologien","services.architecture.list3":"Skalierbare Lösungen","services.sales.title":"KI-gestützte Sales-Assistenz","services.sales.desc":"Automatisierung, Lead-Scoring und personalisierte Kundenansprache auf einem neuen Level.","services.sales.list1":"Automatisierte Lead-Qualifizierung","services.sales.list2":"Prädiktives Lead-Scoring","services.sales.list3":"Personalisierte Kundenansprache","services.marketing.title":"Intelligentes Marketing mit KI","services.marketing.desc":"Von Content-Generierung über Kampagnenoptimierung bis zur Zielgruppenerkennung – datengetrieben und präzise.","services.marketing.list1":"KI-gestützte Content-Erstellung","services.marketing.list2":"Kampagnenoptimierung in Echtzeit","services.marketing.list3":"Präzise Zielgruppenerkennung","services.integration.title":"Nahtlose Integration in bestehende Tools","services.integration.desc":"Unsere Systeme sind kompatibel mit gängigen Plattformen und passen sich deinem Tech-Stack flexibel an.","services.integration.list1":"API-Integration mit bestehenden Systemen","services.integration.list2":"Flexible Anpassung an deinen Tech-Stack","services.integration.list3":"Nahtlose Workflows","services.cta":"Jetzt anfragen","terms.title":"Allgemeine Geschäftsbedingungen","terms.metaTitle":"AGB | K.I. Maschine","terms.metaDescription":"Allgemeine Geschäftsbedingungen der KImaschine","terms.section1.title":"1. Geltungsbereich","terms.section1.text":'Diese Allgemeinen Geschäftsbedingungen (nachfolgend "AGB") gelten für alle Verträge zwischen der KImaschine GmbH (nachfolgend "KImaschine" oder "wir") und ihren Kunden (nachfolgend "Kunde" oder "Sie") über die Nutzung unserer Dienstleistungen und Produkte im Bereich künstlicher Intelligenz.',"terms.section2.title":"2. Vertragsgegenstand","terms.section2.text":"Gegenstand dieses Vertrags ist die Bereitstellung von KI-basierten Dienstleistungen und Produkten durch KImaschine gemäß der im jeweiligen Angebot beschriebenen Leistungsbeschreibung.","terms.section3.title":"3. Vertragsschluss","terms.section3.text":"Die Präsentation unserer Dienstleistungen auf unserer Website stellt kein bindendes Angebot dar. Ein Vertrag kommt erst durch eine schriftliche Auftragsbestätigung oder durch die tatsächliche Erbringung der Leistung zustande.","terms.section4.title":"4. Preise und Zahlungsbedingungen","terms.section4.text":"Die Preise für unsere Dienstleistungen entnehmen Sie bitte dem jeweiligen Angebot. Sofern nicht anders vereinbart, sind alle Rechnungen innerhalb von 14 Tagen ab Rechnungsdatum ohne Abzug zur Zahlung fällig.","terms.section5.title":"5. Nutzungsrechte","terms.section5.text":"Mit vollständiger Bezahlung der vereinbarten Vergütung erhält der Kunde das nicht-ausschließliche, zeitlich unbeschränkte Recht, die von KImaschine entwickelten KI-Lösungen im vereinbarten Umfang zu nutzen.","terms.section6.title":"6. Datenschutz","terms.section6.text":"Wir verarbeiten personenbezogene Daten unserer Kunden gemäß unserer Datenschutzerklärung und unter Beachtung der geltenden datenschutzrechtlichen Bestimmungen.","terms.section7.title":"7. Haftung","terms.section7.text":"KImaschine haftet unbeschränkt für Vorsatz und grobe Fahrlässigkeit. Bei leichter Fahrlässigkeit haftet KImaschine nur für Schäden aus der Verletzung des Lebens, des Körpers oder der Gesundheit und für Schäden aus der Verletzung einer wesentlichen Vertragspflicht.","terms.section8.title":"8. Schlussbestimmungen","terms.section8.text":"Es gilt das Recht der Bundesrepublik Deutschland unter Ausschluss des UN-Kaufrechts. Gerichtsstand für alle Streitigkeiten aus dem Vertragsverhältnis ist, soweit gesetzlich zulässig, der Sitz von KImaschine.","terms.stand":"Stand: Mai 2024","team.title":"Unser Team","team.subtitle":"Unsere Experten","team.position.ceo":"CEO","team.bio.ceo":"Gründer und Entwickler der K.I. Maschine ","team.position.cto":"CTO","team.bio.cto":"Gründer und Entwickler der K.I. Maschine ","team.values.title":"Unsere Werte","team.values.quality.title":"Qualität","team.values.quality.description":"Wir streben nach höchster Qualität in allem, was wir tun. Verlässlichkeit, Präzision und Exzellenz sind die Grundlagen unserer Arbeit.","team.values.innovation.title":"Innovation","team.values.innovation.description":"Technologischer Fortschritt ist unser Antrieb. Wir denken weiter, um intelligente, zukunftsweisende Lösungen zu schaffen","team.values.teamwork.title":"Teamwork","team.values.teamwork.description":"Gemeinsam erreichen wir mehr. Vertrauen, Respekt und offene Zusammenarbeit bilden das Herzstück unseres Erfolgs.","testimonials.title":"Kundenstimmen","testimonials.subtitle":"Was unsere Kunden sagen","gdpr.consent":"Durch die Nutzung dieses Formulars stimmst du unserer Datenschutzerklärung zu.","gdpr.policy":"Datenschutzerklärung","contact.title":"Kontaktiere uns","contact.subtitle":"Wir freuen uns von dir zu hören","contact.name":"Name","contact.email":"E-Mail","contact.message":"Nachricht","contact.submit":"Absenden","contact.interest":"Interesse an","contact.website":"Website-Automatisierung","contact.blog":"Blog-Automatisierung","contact.social":"Social-Media-Automatisierung","contact.other":"Sonstiges","contact.budget":"Budget","contact.company":"Unternehmen","newsletter.title":"Newsletter anmelden","newsletter.description":"Erhalte die neuesten Updates zu KI und Content-Automatisierung","newsletter.placeholder":"Deine E-Mail-Adresse","newsletter.submit":"Anmelden","footer.rights":"Alle Rechte vorbehalten","footer.privacy":"Datenschutz","footer.terms":"AGB","footer.imprint":"Impressum","servicesSection.title":"Unsere Leistungen","servicesSection.intro1":"Wir entwerfen KI mit Wirkung.","servicesSection.intro2":"Als KI Architecture Studio entwickeln wir intelligente Assistenzsysteme, die Marketing- und Vertriebsprozesse nicht nur automatisieren, sondern strategisch verstärken.","servicesSection.details":"Details","servicesSection.cta":"Alle Leistungen entdecken","servicesSection.architecture.title":"Individuelle KI-Systemarchitektur","servicesSection.architecture.description":"Maßgeschneiderte Lösungen für deinen Marketing- und Sales-Workflow – effizient, skalierbar, zukunftsfähig.","servicesSection.architecture.feature1":"Kundenspezifische Architektur","servicesSection.architecture.feature2":"Zukunftsfähige Technologien","servicesSection.architecture.feature3":"Skalierbare Lösungen","servicesSection.sales.title":"KI-gestützte Sales-Assistenz","servicesSection.sales.description":"Automatisierung, Lead-Scoring und personalisierte Kundenansprache auf einem neuen Level.","servicesSection.sales.feature1":"Automatisierte Lead-Qualifizierung","servicesSection.sales.feature2":"Prädiktives Lead-Scoring","servicesSection.sales.feature3":"Personalisierte Kundenansprache","servicesSection.marketing.title":"Intelligentes Marketing mit KI","servicesSection.marketing.description":"Von Content-Generierung über Kampagnenoptimierung bis zur Zielgruppenerkennung – datengetrieben und präzise.","servicesSection.marketing.feature1":"KI-gestützte Content-Erstellung","servicesSection.marketing.feature2":"Kampagnenoptimierung in Echtzeit","servicesSection.marketing.feature3":"Präzise Zielgruppenerkennung","servicesSection.integration.title":"Nahtlose Integration","servicesSection.integration.description":"Unsere Systeme sind kompatibel mit gängigen Plattformen und passen sich deinem Tech-Stack flexibel an.","servicesSection.integration.feature1":"API-Integration","servicesSection.integration.feature2":"Flexible Anpassung","servicesSection.integration.feature3":"Nahtlose Workflows","blog.pageTitle":"Blog","blog.metaDescription":"Aktuelle Informationen zu KI, Content-Automatisierung und digitalen Marketing-Trends","blog.title":"Unser Blog","blog.subtitle":"Entdecken Sie unsere neuesten Gedanken zu KI, Content-Automatisierung und digitalen Marketing-Trends","blog.search":"Suchen","blog.searchPlaceholder":"Suche nach Themen, Tags...","blog.searchResultsCount":"{{count}} Ergebnisse gefunden","blog.noSearchResults":"Keine Ergebnisse gefunden. Versuchen Sie es mit einer anderen Suche.","blog.noPosts":"Derzeit sind keine Blogbeiträge verfügbar.","blog.minuteRead":"Min. Lesezeit","blog.readMore":"Weiterlesen","blog.backToBlog":"Zurück zum Blog","blog.relatedPosts":"Das könnte Sie auch interessieren","blog.postNotFound":"Der gesuchte Blogbeitrag wurde nicht gefunden.","blog.filterByTag":"Nach Schlagwort filtern"},en:{"nav.home":"Home","nav.services":"Services","nav.testimonials":"Testimonials","nav.blog":"Blog","nav.contact":"Contact","nav.team":"Team","hero.title":"AI-powered Content Automation","hero.subtitle":"Revolutionize your content strategy with our AI assistant","hero.description":"KImaschine automates your website, blog, and social media content using advanced AI. Save time, increase efficiency, and stay ahead in the digital competition.","hero.cta":"Get Started","hero.secondary":"Learn More","hero.badge.technology":"AI Technology","hero.badge.madeIn":"Made in Germany","hero.badge.saving":"80%","hero.badge.savingText":"Time saving","hero.badge.branding":"AI Branding","hero.badge.brandingText":"Tailored to your brand","hero.badge.gdpr":"GDPR","hero.badge.gdprText":"Compliant","features.title":"Why KImaschine?","features.subtitle":"Our advantages","features.unified.title":"Unified Platform","features.unified.description":"One central solution for all your content channels","features.ai.title":"AI-Driven Creation","features.ai.description":"High-quality content through advanced artificial intelligence","features.multichannel.title":"Cross-Channel","features.multichannel.description":"Seamless publishing on website, blog, LinkedIn, Instagram and more","features.time.title":"Time Savings","features.time.description":"Automation saves up to 80% of your content creation time","services.title":"Our Services","services.subtitle":"What we offer","services.intro1":"We design AI with impact.","services.intro2":"As an AI architecture studio, we develop intelligent assistant systems that not only automate marketing and sales processes but also strategically enhance them.","services.focus":"Our focus areas:","services.architecture.title":"Custom AI System Architecture","services.architecture.desc":"Tailored solutions for your marketing and sales workflow – efficient, scalable, future-proof.","services.architecture.list1":"Custom architecture","services.architecture.list2":"Future-proof technologies","services.architecture.list3":"Scalable solutions","services.sales.title":"AI-powered Sales Assistance","services.sales.desc":"Automation, lead scoring, and personalized customer engagement at a new level.","services.sales.list1":"Automated lead qualification","services.sales.list2":"Predictive lead scoring","services.sales.list3":"Personalized customer engagement","services.marketing.title":"Smart Marketing with AI","services.marketing.desc":"From content generation to campaign optimization and audience targeting – data-driven and precise.","services.marketing.list1":"AI-powered content creation","services.marketing.list2":"Real-time campaign optimization","services.marketing.list3":"Precise audience targeting","services.integration.title":"Seamless Integration with Existing Tools","services.integration.desc":"Our systems are compatible with common platforms and flexibly adapt to your tech stack.","services.integration.list1":"API integration with existing systems","services.integration.list2":"Flexible adaptation to your tech stack","services.integration.list3":"Seamless workflows","services.cta":"Request now","terms.title":"Terms and Conditions","terms.metaTitle":"Terms | K.I. Maschine","terms.metaDescription":"Terms and conditions of KImaschine","terms.section1.title":"1. Scope","terms.section1.text":'These terms and conditions (hereinafter "Terms") apply to all contracts between KImaschine GmbH (hereinafter "KImaschine" or "we") and its customers (hereinafter "Customer" or "you") regarding the use of our services and products in the field of artificial intelligence.',"terms.section2.title":"2. Subject Matter","terms.section2.text":"The subject of this contract is the provision of AI-based services and products by KImaschine as described in the respective offer.","terms.section3.title":"3. Conclusion of Contract","terms.section3.text":"The presentation of our services on our website does not constitute a binding offer. A contract is only concluded by written order confirmation or by actual performance of the service.","terms.section4.title":"4. Prices and Payment Terms","terms.section4.text":"The prices for our services can be found in the respective offer. Unless otherwise agreed, all invoices are payable within 14 days from the invoice date without deduction.","terms.section5.title":"5. Rights of Use","terms.section5.text":"Upon full payment of the agreed remuneration, the customer receives the non-exclusive, unlimited right to use the AI solutions developed by KImaschine to the agreed extent.","terms.section6.title":"6. Data Protection","terms.section6.text":"We process personal data of our customers in accordance with our privacy policy and in compliance with applicable data protection regulations.","terms.section7.title":"7. Liability","terms.section7.text":"KImaschine is liable without limitation for intent and gross negligence. In the case of slight negligence, KImaschine is only liable for damages resulting from injury to life, body or health and for damages resulting from the breach of an essential contractual obligation.","terms.section8.title":"8. Final Provisions","terms.section8.text":"The law of the Federal Republic of Germany shall apply to the exclusion of the UN Sales Convention. The place of jurisdiction for all disputes arising from the contractual relationship is, as far as legally permissible, the registered office of KImaschine.","terms.stand":"As of: May 2024","team.title":"Our Team","team.subtitle":"Our Experts","team.position.ceo":"CEO","team.bio.ceo":"Founder and developer of the K.I. Maschine","team.position.cto":"CTO","team.bio.cto":"Founder and developer of the K.I. Maschine","team.values.title":"Our Values","team.values.quality.title":"Quality","team.values.quality.description":"We strive for the highest quality in everything we do. Reliability, precision, and excellence form the foundation of our work.","team.values.innovation.title":"Innovation","team.values.innovation.description":"Technological progress drives us. We think ahead to create intelligent, future-ready solutions.","team.values.teamwork.title":"Teamwork","team.values.teamwork.description":"Together we achieve more. Trust, respect, and open collaboration are at the heart of our success.","testimonials.title":"Testimonials","testimonials.subtitle":"What our customers say","gdpr.consent":"By using this form, you agree to our privacy policy.","gdpr.policy":"Privacy Policy","contact.title":"Contact us","contact.subtitle":"We'd love to hear from you","contact.name":"Name","contact.email":"Email","contact.message":"Message","contact.submit":"Submit","contact.interest":"Interested in","contact.website":"Website Automation","contact.blog":"Blog Automation","contact.social":"Social Media Automation","contact.other":"Other","contact.budget":"Budget","contact.company":"Company","newsletter.title":"Subscribe to newsletter","newsletter.description":"Get the latest updates on AI and content automation","newsletter.placeholder":"Your email address","newsletter.submit":"Subscribe","footer.rights":"All rights reserved","footer.privacy":"Privacy Policy","footer.terms":"Terms of Service","footer.imprint":"Imprint","servicesSection.title":"Our Services","servicesSection.intro1":"We design AI with impact.","servicesSection.intro2":"As an AI architecture studio, we develop intelligent assistant systems that not only automate marketing and sales processes but also strategically enhance them.","servicesSection.details":"Details","servicesSection.cta":"Discover all services","servicesSection.architecture.title":"Custom AI System Architecture","servicesSection.architecture.description":"Tailored solutions for your marketing and sales workflow – efficient, scalable, future-proof.","servicesSection.architecture.feature1":"Custom architecture","servicesSection.architecture.feature2":"Future-proof technologies","servicesSection.architecture.feature3":"Scalable solutions","servicesSection.sales.title":"AI-powered Sales Assistance","servicesSection.sales.description":"Automation, lead scoring, and personalized customer engagement at a new level.","servicesSection.sales.feature1":"Automated lead qualification","servicesSection.sales.feature2":"Predictive lead scoring","servicesSection.sales.feature3":"Personalized customer engagement","servicesSection.marketing.title":"Smart Marketing with AI","servicesSection.marketing.description":"From content generation to campaign optimization and audience targeting – data-driven and precise.","servicesSection.marketing.feature1":"AI-powered content creation","servicesSection.marketing.feature2":"Real-time campaign optimization","servicesSection.marketing.feature3":"Precise audience targeting","servicesSection.integration.title":"Seamless Integration","servicesSection.integration.description":"Our systems are compatible with common platforms and flexibly adapt to your tech stack.","servicesSection.integration.feature1":"API integration","servicesSection.integration.feature2":"Flexible adaptation","servicesSection.integration.feature3":"Seamless workflows","blog.pageTitle":"Blog","blog.metaDescription":"Latest information on AI, content automation, and digital marketing trends","blog.title":"Our Blog","blog.subtitle":"Explore our latest thoughts on AI, content automation, and digital marketing trends","blog.search":"Search","blog.searchPlaceholder":"Search for topics, tags...","blog.searchResultsCount":"{{count}} results found","blog.noSearchResults":"No results found. Try a different search.","blog.noPosts":"No blog posts are currently available.","blog.minuteRead":"min read","blog.readMore":"Read more","blog.backToBlog":"Back to blog","blog.relatedPosts":"You might also like","blog.postNotFound":"The blog post you're looking for couldn't be found.","blog.filterByTag":"Filter by tag"},es:{"nav.home":"Inicio","nav.services":"Servicios","nav.testimonials":"Testimonios","nav.blog":"Blog","nav.contact":"Contacto","nav.team":"Equipo","hero.title":"Automatización de contenido impulsada por IA","hero.subtitle":"Revoluciona tu estrategia de contenido con nuestro asistente de IA","hero.description":"KImaschine automatiza el contenido de tu sitio web, blog y redes sociales utilizando IA avanzada. Ahorra tiempo, aumenta la eficiencia y mantente a la vanguardia en la competencia digital.","hero.cta":"Comenzar","hero.secondary":"Saber más","hero.badge.technology":"Tecnología IA","hero.badge.madeIn":"Hecho en Alemania","hero.badge.saving":"80%","hero.badge.savingText":"Ahorro de tiempo","hero.badge.branding":"Branding IA","hero.badge.brandingText":"Adaptado a tu marca","hero.badge.gdpr":"RGPD","hero.badge.gdprText":"Conforme","features.title":"¿Por qué KImaschine?","features.subtitle":"Nuestras ventajas","features.unified.title":"Plataforma unificada","features.unified.description":"Una solución central para todos tus canales de contenido","features.ai.title":"Creación impulsada por IA","features.ai.description":"Contenido de alta calidad a través de inteligencia artificial avanzada","features.multichannel.title":"Multicanal","features.multichannel.description":"Publicación fluida en sitio web, blog, LinkedIn, Instagram y más","features.time.title":"Ahorro de tiempo","features.time.description":"La automatización ahorra hasta el 80% del tiempo de creación de contenido","services.title":"Nuestros servicios","services.subtitle":"Lo que ofrecemos","services.intro1":"Diseñamos IA con impacto.","services.intro2":"Como estudio de arquitectura de IA, desarrollamos sistemas inteligentes de asistencia que no solo automatizan los procesos de marketing y ventas, sino que también los refuerzan estratégicamente.","services.focus":"Nuestras áreas de enfoque:","services.architecture.title":"Arquitectura de sistemas de IA personalizada","services.architecture.desc":"Soluciones a medida para tu flujo de trabajo de marketing y ventas: eficientes, escalables y preparadas para el futuro.","services.architecture.list1":"Arquitectura personalizada","services.architecture.list2":"Tecnologías preparadas para el futuro","services.architecture.list3":"Soluciones escalables","services.sales.title":"Asistencia de ventas impulsada por IA","services.sales.desc":"Automatización, puntuación de leads y atención personalizada al cliente a un nuevo nivel.","services.sales.list1":"Cualificación automática de leads","services.sales.list2":"Puntuación predictiva de leads","services.sales.list3":"Atención personalizada al cliente","services.marketing.title":"Marketing inteligente con IA","services.marketing.desc":"Desde la generación de contenidos hasta la optimización de campañas y la identificación de audiencias: basado en datos y preciso.","services.marketing.list1":"Creación de contenidos con IA","services.marketing.list2":"Optimización de campañas en tiempo real","services.marketing.list3":"Identificación precisa de audiencias","services.integration.title":"Integración perfecta en herramientas existentes","services.integration.desc":"Nuestros sistemas son compatibles con las plataformas más comunes y se adaptan de forma flexible a tu stack tecnológico.","services.integration.list1":"Integración API con sistemas existentes","services.integration.list2":"Adaptación flexible a tu stack tecnológico","services.integration.list3":"Flujos de trabajo integrados","services.cta":"Solicitar ahora","terms.title":"Términos y condiciones","terms.metaTitle":"Términos | K.I. Maschine","terms.metaDescription":"Términos y condiciones de KImaschine","terms.section1.title":"1. Ámbito de aplicación","terms.section1.text":'Estos términos y condiciones (en adelante, "Términos") se aplican a todos los contratos entre KImaschine GmbH (en adelante, "KImaschine" o "nosotros") y sus clientes (en adelante, "Cliente" o "usted") en relación con el uso de nuestros servicios y productos en el ámbito de la inteligencia artificial.',"terms.section2.title":"2. Objeto del contrato","terms.section2.text":"El objeto de este contrato es la prestación de servicios y productos basados en IA por parte de KImaschine según lo descrito en la oferta correspondiente.","terms.section3.title":"3. Celebración del contrato","terms.section3.text":"La presentación de nuestros servicios en nuestro sitio web no constituye una oferta vinculante. Un contrato solo se concluye mediante confirmación escrita del pedido o mediante la prestación efectiva del servicio.","terms.section4.title":"4. Precios y condiciones de pago","terms.section4.text":"Los precios de nuestros servicios se pueden consultar en la oferta correspondiente. Salvo acuerdo en contrario, todas las facturas deberán abonarse en un plazo de 14 días a partir de la fecha de la factura sin deducción.","terms.section5.title":"5. Derechos de uso","terms.section5.text":"Tras el pago íntegro de la remuneración acordada, el cliente recibe el derecho no exclusivo e ilimitado de utilizar las soluciones de IA desarrolladas por KImaschine en la medida acordada.","terms.section6.title":"6. Protección de datos","terms.section6.text":"Procesamos los datos personales de nuestros clientes de acuerdo con nuestra política de privacidad y cumpliendo con la normativa de protección de datos aplicable.","terms.section7.title":"7. Responsabilidad","terms.section7.text":"KImaschine es responsable sin limitación por dolo y negligencia grave. En caso de negligencia leve, KImaschine solo será responsable de los daños derivados de lesiones a la vida, la integridad física o la salud y de los daños derivados del incumplimiento de una obligación contractual esencial.","terms.section8.title":"8. Disposiciones finales","terms.section8.text":"Se aplicará la legislación de la República Federal de Alemania con exclusión de la Convención de las Naciones Unidas sobre los Contratos de Compraventa Internacional de Mercaderías. El lugar de jurisdicción para todas las disputas derivadas de la relación contractual será, en la medida en que la ley lo permita, la sede de KImaschine.","terms.stand":"Fecha: mayo de 2024","team.title":"Nuestro Equipo","team.subtitle":"Nuestros Expertos","team.position.ceo":"CEO","team.bio.ceo":"Fundador y desarrollador de la K.I. Maschine","team.position.cto":"CTO","team.bio.cto":"Fundador y desarrollador de la K.I. Maschine","team.values.title":"Nuestros Valores","team.values.quality.title":"Calidad","team.values.quality.description":"Nos esforzamos por alcanzar la máxima calidad en todo lo que hacemos. La fiabilidad, la precisión y la excelencia son la base de nuestro trabajo.","team.values.innovation.title":"Innovación","team.values.innovation.description":"El progreso tecnológico nos impulsa. Pensamos en el futuro para crear soluciones inteligentes y preparadas para el mañana.","team.values.teamwork.title":"Trabajo en Equipo","team.values.teamwork.description":"Juntos logramos más. La confianza, el respeto y la colaboración abierta están en el corazón de nuestro éxito.","testimonials.title":"Testimonios","testimonials.subtitle":"Lo que dicen nuestros clientes","gdpr.consent":"Al utilizar este formulario, aceptas nuestra política de privacidad.","gdpr.policy":"Política de privacidad","contact.title":"Contáctanos","contact.subtitle":"Nos encantaría saber de ti","contact.name":"Nombre","contact.email":"Correo electrónico","contact.message":"Mensaje","contact.submit":"Enviar","contact.interest":"Interesado en","contact.website":"Automatización de sitio web","contact.blog":"Automatización de blog","contact.social":"Automatización de redes sociales","contact.other":"Otro","contact.budget":"Presupuesto","contact.company":"Empresa","newsletter.title":"Suscríbete al boletín","newsletter.description":"Recibe las últimas actualizaciones sobre IA y automatización de contenido","newsletter.placeholder":"Tu dirección de correo electrónico","newsletter.submit":"Suscribirse","footer.rights":"Todos los derechos reservados","footer.privacy":"Política de privacidad","footer.terms":"Términos de servicio","footer.imprint":"Aviso legal","servicesSection.title":"Nuestros servicios","servicesSection.intro1":"Diseñamos IA con impacto.","servicesSection.intro2":"Como estudio de arquitectura de IA, desarrollamos sistemas inteligentes de asistencia que no solo automatizan los procesos de marketing y ventas, sino que también los refuerzan estratégicamente.","servicesSection.details":"Detalles","servicesSection.cta":"Descubre todos los servicios","servicesSection.architecture.title":"Arquitectura de sistemas de IA personalizada","servicesSection.architecture.description":"Soluciones a medida para tu flujo de trabajo de marketing y ventas: eficientes, escalables y preparadas para el futuro.","servicesSection.architecture.feature1":"Arquitectura personalizada","servicesSection.architecture.feature2":"Tecnologías preparadas para el futuro","servicesSection.architecture.feature3":"Soluciones escalables","servicesSection.sales.title":"Asistencia de ventas impulsada por IA","servicesSection.sales.description":"Automatización, puntuación de leads y atención personalizada al cliente a un nuevo nivel.","servicesSection.sales.feature1":"Cualificación automática de leads","servicesSection.sales.feature2":"Puntuación predictiva de leads","servicesSection.sales.feature3":"Atención personalizada al cliente","servicesSection.marketing.title":"Marketing inteligente con IA","servicesSection.marketing.description":"Desde la generación de contenidos hasta la optimización de campañas y la identificación de audiencias: basado en datos y preciso.","servicesSection.marketing.feature1":"Creación de contenidos con IA","servicesSection.marketing.feature2":"Optimización de campañas en tiempo real","servicesSection.marketing.feature3":"Identificación precisa de audiencias","servicesSection.integration.title":"Integración perfecta","servicesSection.integration.description":"Nuestros sistemas son compatibles con las plataformas más comunes y se adaptan de forma flexible a tu stack tecnológico.","servicesSection.integration.feature1":"Integración API","servicesSection.integration.feature2":"Adaptación flexible","servicesSection.integration.feature3":"Flujos de trabajo integrados","blog.pageTitle":"Blog","blog.metaDescription":"Información actualizada sobre IA, automatización de contenidos y tendencias de marketing digital","blog.title":"Nuestro Blog","blog.subtitle":"Explore nuestros últimos pensamientos sobre IA, automatización de contenido y tendencias de marketing digital","blog.search":"Buscar","blog.searchPlaceholder":"Buscar temas, etiquetas...","blog.searchResultsCount":"{{count}} resultados encontrados","blog.noSearchResults":"No se encontraron resultados. Intente con una búsqueda diferente.","blog.noPosts":"No hay publicaciones de blog disponibles actualmente.","blog.minuteRead":"min de lectura","blog.readMore":"Leer más","blog.backToBlog":"Volver al blog","blog.relatedPosts":"También te puede interesar","blog.postNotFound":"No se pudo encontrar la publicación de blog que estás buscando.","blog.filterByTag":"Filtrar por etiqueta"}},$k=({children:e})=>{const t=()=>{const a=navigator.language.split("-")[0];return a==="de"?"de":a==="es"?"es":"en"},[n,r]=f.useState(()=>{const a=localStorage.getItem("kimaschine-language");if(a==="de"||a==="en"||a==="es")return a;try{return t()}catch{return"de"}}),i={language:n,setLanguage:a=>{r(a),localStorage.setItem("kimaschine-language",a)},t:a=>zk[n][a]||a};return u.jsx(Fk.Provider,{value:i,children:e})},py=f.createContext(void 0),ul=()=>{const e=f.useContext(py);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e},Bk=({children:e})=>{const[t,n]=f.useState(null),[r,o]=f.useState(!1);f.useEffect(()=>{const a=localStorage.getItem("auth_user");a&&n(JSON.parse(a))},[]);const s=async(a,l)=>{o(!0);try{console.log("Login url:","https://pa-kima.kimaschine.de/webhook/auth/login");const c=await fetch("https://pa-kima.kimaschine.de/webhook/auth_login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:a,password:l})});if(!c.ok)throw new Error("Login fehlgeschlagen");const d=await c.json(),m=d.token,y=d.user||{id:"1",email:a,name:a.split("@")[0]};if(!m)throw new Error("Kein Token erhalten");localStorage.setItem("auth_token",m),n(y),localStorage.setItem("auth_user",JSON.stringify(y))}catch(c){throw new Error(c.message||"Login failed")}finally{o(!1)}},i=()=>{n(null),localStorage.removeItem("auth_user"),localStorage.removeItem("auth_token")};return u.jsx(py.Provider,{value:{user:t,login:s,logout:i,isLoading:r},children:e})},Uk=Sd("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),me=f.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?Ib:"button";return u.jsx(i,{className:he(Uk({variant:t,size:n,className:e})),ref:s,...o})});me.displayName="Button";const Qo=f.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:he("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Qo.displayName="Card";const Go=f.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:he("flex flex-col space-y-1.5 p-6",e),...t}));Go.displayName="CardHeader";const qo=f.forwardRef(({className:e,...t},n)=>u.jsx("h3",{ref:n,className:he("text-2xl font-semibold leading-none tracking-tight",e),...t}));qo.displayName="CardTitle";const hy=f.forwardRef(({className:e,...t},n)=>u.jsx("p",{ref:n,className:he("text-sm text-muted-foreground",e),...t}));hy.displayName="CardDescription";const ri=f.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:he("p-6 pt-0",e),...t}));ri.displayName="CardContent";const Vk=f.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:he("flex items-center p-6 pt-0",e),...t}));Vk.displayName="CardFooter";const ut=f.forwardRef(({className:e,type:t,...n},r)=>u.jsx("input",{type:t,className:he("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));ut.displayName="Input";const Qs=f.forwardRef(({className:e,...t},n)=>u.jsx("textarea",{className:he("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Qs.displayName="Textarea";var Wk="Label",my=f.forwardRef((e,t)=>u.jsx(ce.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));my.displayName=Wk;var gy=my;const Hk=Sd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),He=f.forwardRef(({className:e,...t},n)=>u.jsx(gy,{ref:n,className:he(Hk(),e),...t}));He.displayName=gy.displayName;function Vp(e,[t,n]){return Math.min(n,Math.max(t,e))}var Kk=f.createContext(void 0);function Qk(e){const t=f.useContext(Kk);return e||t||"ltr"}var ec=0;function Gk(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Wp()),document.body.insertAdjacentElement("beforeend",e[1]??Wp()),ec++,()=>{ec===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ec--}},[])}function Wp(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var tc="focusScope.autoFocusOnMount",nc="focusScope.autoFocusOnUnmount",Hp={bubbles:!1,cancelable:!0},qk="FocusScope",vy=f.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,l]=f.useState(null),c=Ot(o),d=Ot(s),m=f.useRef(null),y=Te(t,g=>l(g)),p=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let g=function(w){if(p.paused||!a)return;const S=w.target;a.contains(S)?m.current=S:Vn(m.current,{select:!0})},x=function(w){if(p.paused||!a)return;const S=w.relatedTarget;S!==null&&(a.contains(S)||Vn(m.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&Vn(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const h=new MutationObserver(v);return a&&h.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),h.disconnect()}}},[r,a,p.paused]),f.useEffect(()=>{if(a){Qp.add(p);const g=document.activeElement;if(!a.contains(g)){const v=new CustomEvent(tc,Hp);a.addEventListener(tc,c),a.dispatchEvent(v),v.defaultPrevented||(Yk(tT(yy(a)),{select:!0}),document.activeElement===g&&Vn(a))}return()=>{a.removeEventListener(tc,c),setTimeout(()=>{const v=new CustomEvent(nc,Hp);a.addEventListener(nc,d),a.dispatchEvent(v),v.defaultPrevented||Vn(g??document.body,{select:!0}),a.removeEventListener(nc,d),Qp.remove(p)},0)}}},[a,c,d,p]);const b=f.useCallback(g=>{if(!n&&!r||p.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(x&&v){const h=g.currentTarget,[w,S]=Xk(h);w&&S?!g.shiftKey&&v===S?(g.preventDefault(),n&&Vn(w,{select:!0})):g.shiftKey&&v===w&&(g.preventDefault(),n&&Vn(S,{select:!0})):v===h&&g.preventDefault()}},[n,r,p.paused]);return u.jsx(ce.div,{tabIndex:-1,...i,ref:y,onKeyDown:b})});vy.displayName=qk;function Yk(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Vn(r,{select:t}),document.activeElement!==n)return}function Xk(e){const t=yy(e),n=Kp(t,e),r=Kp(t.reverse(),e);return[n,r]}function yy(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Kp(e,t){for(const n of e)if(!Zk(n,{upTo:t}))return n}function Zk(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Jk(e){return e instanceof HTMLInputElement&&"select"in e}function Vn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Jk(e)&&t&&e.select()}}var Qp=eT();function eT(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Gp(e,t),e.unshift(t)},remove(t){var n;e=Gp(e,t),(n=e[0])==null||n.resume()}}}function Gp(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function tT(e){return e.filter(t=>t.tagName!=="A")}function wy(e){const t=f.useRef({value:e,previous:e});return f.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var nT=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Zr=new WeakMap,ji=new WeakMap,Ai={},rc=0,xy=function(e){return e&&(e.host||xy(e.parentNode))},rT=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=xy(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},oT=function(e,t,n,r){var o=rT(t,Array.isArray(e)?e:[e]);Ai[n]||(Ai[n]=new WeakMap);var s=Ai[n],i=[],a=new Set,l=new Set(o),c=function(m){!m||a.has(m)||(a.add(m),c(m.parentNode))};o.forEach(c);var d=function(m){!m||l.has(m)||Array.prototype.forEach.call(m.children,function(y){if(a.has(y))d(y);else try{var p=y.getAttribute(r),b=p!==null&&p!=="false",g=(Zr.get(y)||0)+1,x=(s.get(y)||0)+1;Zr.set(y,g),s.set(y,x),i.push(y),g===1&&b&&ji.set(y,!0),x===1&&y.setAttribute(n,"true"),b||y.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",y,v)}})};return d(t),a.clear(),rc++,function(){i.forEach(function(m){var y=Zr.get(m)-1,p=s.get(m)-1;Zr.set(m,y),s.set(m,p),y||(ji.has(m)||m.removeAttribute(r),ji.delete(m)),p||m.removeAttribute(n)}),rc--,rc||(Zr=new WeakMap,Zr=new WeakMap,ji=new WeakMap,Ai={})}},sT=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=nT(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),oT(r,o,n,"aria-hidden")):function(){return null}},un=function(){return un=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return ST;var t=CT(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},kT=Ey(),So="data-scroll-locked",TT=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),` .`.concat(aT,` { overflow: hidden `).concat(r,`; padding-right: `).concat(a,"px ").concat(r,`; } body[`).concat(So,`] { overflow: hidden `).concat(r,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` padding-left: `.concat(o,`px; padding-top: `).concat(s,`px; padding-right: `).concat(i,`px; margin-left:0; margin-top:0; margin-right: `).concat(a,"px ").concat(r,`; `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` } .`).concat(Ji,` { right: `).concat(a,"px ").concat(r,`; } .`).concat(ea,` { margin-right: `).concat(a,"px ").concat(r,`; } .`).concat(Ji," .").concat(Ji,` { right: 0 `).concat(r,`; } .`).concat(ea," .").concat(ea,` { margin-right: 0 `).concat(r,`; } body[`).concat(So,`] { `).concat(lT,": ").concat(a,`px; } `)},Yp=function(){var e=parseInt(document.body.getAttribute(So)||"0",10);return isFinite(e)?e:0},PT=function(){f.useEffect(function(){return document.body.setAttribute(So,(Yp()+1).toString()),function(){var e=Yp()-1;e<=0?document.body.removeAttribute(So):document.body.setAttribute(So,e.toString())}},[])},NT=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;PT();var s=f.useMemo(function(){return ET(o)},[o]);return f.createElement(kT,{styles:TT(s,!t,o,n?"":"!important")})},gu=!1;if(typeof window<"u")try{var Ri=Object.defineProperty({},"passive",{get:function(){return gu=!0,!0}});window.addEventListener("test",Ri,Ri),window.removeEventListener("test",Ri,Ri)}catch{gu=!1}var Jr=gu?{passive:!1}:!1,jT=function(e){return e.tagName==="TEXTAREA"},ky=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!jT(e)&&n[t]==="visible")},AT=function(e){return ky(e,"overflowY")},RT=function(e){return ky(e,"overflowX")},Xp=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Ty(e,r);if(o){var s=Py(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},_T=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},IT=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ty=function(e,t){return e==="v"?AT(t):RT(t)},Py=function(e,t){return e==="v"?_T(t):IT(t)},OT=function(e,t){return e==="h"&&t==="rtl"?-1:1},LT=function(e,t,n,r,o){var s=OT(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,l=t.contains(a),c=!1,d=i>0,m=0,y=0;do{if(!a)break;var p=Py(e,a),b=p[0],g=p[1],x=p[2],v=g-x-s*b;(b||v)&&Ty(e,a)&&(m+=v,y+=b);var h=a.parentNode;a=h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE?h.host:h}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&Math.abs(m)<1||!d&&Math.abs(y)<1)&&(c=!0),c},_i=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Zp=function(e){return[e.deltaX,e.deltaY]},Jp=function(e){return e&&"current"in e?e.current:e},MT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},DT=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},FT=0,eo=[];function zT(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),o=f.useState(FT++)[0],s=f.useState(Ey)[0],i=f.useRef(e);f.useEffect(function(){i.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=iT([e.lockRef.current],(e.shards||[]).map(Jp),!0).filter(Boolean);return g.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=f.useCallback(function(g,x){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var v=_i(g),h=n.current,w="deltaX"in g?g.deltaX:h[0]-v[0],S="deltaY"in g?g.deltaY:h[1]-v[1],C,k=g.target,E=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in g&&E==="h"&&k.type==="range")return!1;var j=Xp(E,k);if(!j)return!0;if(j?C=E:(C=E==="v"?"h":"v",j=Xp(E,k)),!j)return!1;if(!r.current&&"changedTouches"in g&&(w||S)&&(r.current=C),!C)return!0;var _=r.current||C;return LT(_,x,g,_==="h"?w:S)},[]),l=f.useCallback(function(g){var x=g;if(!(!eo.length||eo[eo.length-1]!==s)){var v="deltaY"in x?Zp(x):_i(x),h=t.current.filter(function(C){return C.name===x.type&&(C.target===x.target||x.target===C.shadowParent)&&MT(C.delta,v)})[0];if(h&&h.should){x.cancelable&&x.preventDefault();return}if(!h){var w=(i.current.shards||[]).map(Jp).filter(Boolean).filter(function(C){return C.contains(x.target)}),S=w.length>0?a(x,w[0]):!i.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),c=f.useCallback(function(g,x,v,h){var w={name:g,delta:x,target:v,should:h,shadowParent:$T(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),d=f.useCallback(function(g){n.current=_i(g),r.current=void 0},[]),m=f.useCallback(function(g){c(g.type,Zp(g),g.target,a(g,e.lockRef.current))},[]),y=f.useCallback(function(g){c(g.type,_i(g),g.target,a(g,e.lockRef.current))},[]);f.useEffect(function(){return eo.push(s),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:y}),document.addEventListener("wheel",l,Jr),document.addEventListener("touchmove",l,Jr),document.addEventListener("touchstart",d,Jr),function(){eo=eo.filter(function(g){return g!==s}),document.removeEventListener("wheel",l,Jr),document.removeEventListener("touchmove",l,Jr),document.removeEventListener("touchstart",d,Jr)}},[]);var p=e.removeScrollBar,b=e.inert;return f.createElement(f.Fragment,null,b?f.createElement(s,{styles:DT(o)}):null,p?f.createElement(NT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function $T(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const BT=mT(Cy,zT);var Ny=f.forwardRef(function(e,t){return f.createElement(dl,un({},e,{ref:t,sideCar:BT}))});Ny.classNames=dl.classNames;var UT=[" ","Enter","ArrowUp","ArrowDown"],VT=[" ","Enter"],Ur="Select",[fl,pl,WT]=Rg(Ur),[Yo,yN]=Qr(Ur,[WT,ol]),hl=ol(),[HT,vr]=Yo(Ur),[KT,QT]=Yo(Ur),jy=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:l,dir:c,name:d,autoComplete:m,disabled:y,required:p,form:b}=e,g=hl(t),[x,v]=f.useState(null),[h,w]=f.useState(null),[S,C]=f.useState(!1),k=Qk(c),[E,j]=Ta({prop:r,defaultProp:o??!1,onChange:s,caller:Ur}),[_,R]=Ta({prop:i,defaultProp:a,onChange:l,caller:Ur}),U=f.useRef(null),F=x?b||!!x.closest("form"):!0,[q,L]=f.useState(new Set),G=Array.from(q).map(V=>V.props.value).join(";");return u.jsx(uE,{...g,children:u.jsxs(HT,{required:p,scope:t,trigger:x,onTriggerChange:v,valueNode:h,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Ed(),value:_,onValueChange:R,open:E,onOpenChange:j,dir:k,triggerPointerDownPosRef:U,disabled:y,children:[u.jsx(fl.Provider,{scope:t,children:u.jsx(KT,{scope:e.__scopeSelect,onNativeOptionAdd:f.useCallback(V=>{L(K=>new Set(K).add(V))},[]),onNativeOptionRemove:f.useCallback(V=>{L(K=>{const T=new Set(K);return T.delete(V),T})},[]),children:n})}),F?u.jsxs(Jy,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:m,value:_,onChange:V=>R(V.target.value),disabled:y,form:b,children:[_===void 0?u.jsx("option",{value:""}):null,Array.from(q)]},G):null]})})};jy.displayName=Ur;var Ay="SelectTrigger",Ry=f.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=hl(n),i=vr(Ay,n),a=i.disabled||r,l=Te(t,i.onTriggerChange),c=pl(n),d=f.useRef("touch"),[m,y,p]=tw(g=>{const x=c().filter(w=>!w.disabled),v=x.find(w=>w.value===i.value),h=nw(x,g,v);h!==void 0&&i.onValueChange(h.value)}),b=g=>{a||(i.onOpenChange(!0),p()),g&&(i.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return u.jsx(Fv,{asChild:!0,...s,children:u.jsx(ce.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":ew(i.value)?"":void 0,...o,ref:l,onClick:ie(o.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&b(g)}),onPointerDown:ie(o.onPointerDown,g=>{d.current=g.pointerType;const x=g.target;x.hasPointerCapture(g.pointerId)&&x.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(b(g),g.preventDefault())}),onKeyDown:ie(o.onKeyDown,g=>{const x=m.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&y(g.key),!(x&&g.key===" ")&&UT.includes(g.key)&&(b(),g.preventDefault())})})})});Ry.displayName=Ay;var _y="SelectValue",Iy=f.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,l=vr(_y,n),{onValueNodeHasChildrenChange:c}=l,d=s!==void 0,m=Te(t,l.onValueNodeChange);return Oe(()=>{c(d)},[c,d]),u.jsx(ce.span,{...a,ref:m,style:{pointerEvents:"none"},children:ew(l.value)?u.jsx(u.Fragment,{children:i}):s})});Iy.displayName=_y;var GT="SelectIcon",Oy=f.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return u.jsx(ce.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Oy.displayName=GT;var qT="SelectPortal",Ly=e=>u.jsx(yd,{asChild:!0,...e});Ly.displayName=qT;var Vr="SelectContent",My=f.forwardRef((e,t)=>{const n=vr(Vr,e.__scopeSelect),[r,o]=f.useState();if(Oe(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?Kr.createPortal(u.jsx(Dy,{scope:e.__scopeSelect,children:u.jsx(fl.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),s):null}return u.jsx(Fy,{...e,ref:t})});My.displayName=Vr;var Vt=10,[Dy,yr]=Yo(Vr),YT="SelectContentImpl",XT=zs("SelectContent.RemoveScroll"),Fy=f.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:m,collisionBoundary:y,collisionPadding:p,sticky:b,hideWhenDetached:g,avoidCollisions:x,...v}=e,h=vr(Vr,n),[w,S]=f.useState(null),[C,k]=f.useState(null),E=Te(t,z=>S(z)),[j,_]=f.useState(null),[R,U]=f.useState(null),F=pl(n),[q,L]=f.useState(!1),G=f.useRef(!1);f.useEffect(()=>{if(w)return sT(w)},[w]),Gk();const V=f.useCallback(z=>{const[ne,...ve]=F().map(oe=>oe.ref.current),[se]=ve.slice(-1),re=document.activeElement;for(const oe of z)if(oe===re||(oe==null||oe.scrollIntoView({block:"nearest"}),oe===ne&&C&&(C.scrollTop=0),oe===se&&C&&(C.scrollTop=C.scrollHeight),oe==null||oe.focus(),document.activeElement!==re))return},[F,C]),K=f.useCallback(()=>V([j,w]),[V,j,w]);f.useEffect(()=>{q&&K()},[q,K]);const{onOpenChange:T,triggerPointerDownPosRef:P}=h;f.useEffect(()=>{if(w){let z={x:0,y:0};const ne=se=>{var re,oe;z={x:Math.abs(Math.round(se.pageX)-(((re=P.current)==null?void 0:re.x)??0)),y:Math.abs(Math.round(se.pageY)-(((oe=P.current)==null?void 0:oe.y)??0))}},ve=se=>{z.x<=10&&z.y<=10?se.preventDefault():w.contains(se.target)||T(!1),document.removeEventListener("pointermove",ne),P.current=null};return P.current!==null&&(document.addEventListener("pointermove",ne),document.addEventListener("pointerup",ve,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ne),document.removeEventListener("pointerup",ve,{capture:!0})}}},[w,T,P]),f.useEffect(()=>{const z=()=>T(!1);return window.addEventListener("blur",z),window.addEventListener("resize",z),()=>{window.removeEventListener("blur",z),window.removeEventListener("resize",z)}},[T]);const[$,Y]=tw(z=>{const ne=F().filter(re=>!re.disabled),ve=ne.find(re=>re.ref.current===document.activeElement),se=nw(ne,z,ve);se&&setTimeout(()=>se.ref.current.focus())}),H=f.useCallback((z,ne,ve)=>{const se=!G.current&&!ve;(h.value!==void 0&&h.value===ne||se)&&(_(z),se&&(G.current=!0))},[h.value]),X=f.useCallback(()=>w==null?void 0:w.focus(),[w]),Q=f.useCallback((z,ne,ve)=>{const se=!G.current&&!ve;(h.value!==void 0&&h.value===ne||se)&&U(z)},[h.value]),fe=r==="popper"?vu:zy,ue=fe===vu?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:m,collisionBoundary:y,collisionPadding:p,sticky:b,hideWhenDetached:g,avoidCollisions:x}:{};return u.jsx(Dy,{scope:n,content:w,viewport:C,onViewportChange:k,itemRefCallback:H,selectedItem:j,onItemLeave:X,itemTextRefCallback:Q,focusSelectedItem:K,selectedItemText:R,position:r,isPositioned:q,searchRef:$,children:u.jsx(Ny,{as:XT,allowPinchZoom:!0,children:u.jsx(vy,{asChild:!0,trapped:h.open,onMountAutoFocus:z=>{z.preventDefault()},onUnmountAutoFocus:ie(o,z=>{var ne;(ne=h.trigger)==null||ne.focus({preventScroll:!0}),z.preventDefault()}),children:u.jsx(Xa,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:z=>z.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:u.jsx(fe,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:z=>z.preventDefault(),...v,...ue,onPlaced:()=>L(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:ie(v.onKeyDown,z=>{const ne=z.ctrlKey||z.altKey||z.metaKey;if(z.key==="Tab"&&z.preventDefault(),!ne&&z.key.length===1&&Y(z.key),["ArrowUp","ArrowDown","Home","End"].includes(z.key)){let se=F().filter(re=>!re.disabled).map(re=>re.ref.current);if(["ArrowUp","End"].includes(z.key)&&(se=se.slice().reverse()),["ArrowUp","ArrowDown"].includes(z.key)){const re=z.target,oe=se.indexOf(re);se=se.slice(oe+1)}setTimeout(()=>V(se)),z.preventDefault()}})})})})})})});Fy.displayName=YT;var ZT="SelectItemAlignedPosition",zy=f.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=vr(Vr,n),i=yr(Vr,n),[a,l]=f.useState(null),[c,d]=f.useState(null),m=Te(t,E=>d(E)),y=pl(n),p=f.useRef(!1),b=f.useRef(!0),{viewport:g,selectedItem:x,selectedItemText:v,focusSelectedItem:h}=i,w=f.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&c&&g&&x&&v){const E=s.trigger.getBoundingClientRect(),j=c.getBoundingClientRect(),_=s.valueNode.getBoundingClientRect(),R=v.getBoundingClientRect();if(s.dir!=="rtl"){const re=R.left-j.left,oe=_.left-re,xe=E.left-oe,Fe=E.width+xe,Lt=Math.max(Fe,j.width),vt=window.innerWidth-Vt,Mt=Vp(oe,[Vt,Math.max(Vt,vt-Lt)]);a.style.minWidth=Fe+"px",a.style.left=Mt+"px"}else{const re=j.right-R.right,oe=window.innerWidth-_.right-re,xe=window.innerWidth-E.right-oe,Fe=E.width+xe,Lt=Math.max(Fe,j.width),vt=window.innerWidth-Vt,Mt=Vp(oe,[Vt,Math.max(Vt,vt-Lt)]);a.style.minWidth=Fe+"px",a.style.right=Mt+"px"}const U=y(),F=window.innerHeight-Vt*2,q=g.scrollHeight,L=window.getComputedStyle(c),G=parseInt(L.borderTopWidth,10),V=parseInt(L.paddingTop,10),K=parseInt(L.borderBottomWidth,10),T=parseInt(L.paddingBottom,10),P=G+V+q+T+K,$=Math.min(x.offsetHeight*5,P),Y=window.getComputedStyle(g),H=parseInt(Y.paddingTop,10),X=parseInt(Y.paddingBottom,10),Q=E.top+E.height/2-Vt,fe=F-Q,ue=x.offsetHeight/2,z=x.offsetTop+ue,ne=G+V+z,ve=P-ne;if(ne<=Q){const re=U.length>0&&x===U[U.length-1].ref.current;a.style.bottom="0px";const oe=c.clientHeight-g.offsetTop-g.offsetHeight,xe=Math.max(fe,ue+(re?X:0)+oe+K),Fe=ne+xe;a.style.height=Fe+"px"}else{const re=U.length>0&&x===U[0].ref.current;a.style.top="0px";const xe=Math.max(Q,G+g.offsetTop+(re?H:0)+ue)+ve;a.style.height=xe+"px",g.scrollTop=ne-Q+g.offsetTop}a.style.margin=`${Vt}px 0`,a.style.minHeight=$+"px",a.style.maxHeight=F+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[y,s.trigger,s.valueNode,a,c,g,x,v,s.dir,r]);Oe(()=>w(),[w]);const[S,C]=f.useState();Oe(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const k=f.useCallback(E=>{E&&b.current===!0&&(w(),h==null||h(),b.current=!1)},[w,h]);return u.jsx(eP,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:k,children:u.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:u.jsx(ce.div,{...o,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});zy.displayName=ZT;var JT="SelectPopperPosition",vu=f.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Vt,...s}=e,i=hl(n);return u.jsx(zv,{...i,...s,ref:t,align:r,collisionPadding:o,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)"}})});vu.displayName=JT;var[eP,Ud]=Yo(Vr,{}),yu="SelectViewport",$y=f.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=yr(yu,n),i=Ud(yu,n),a=Te(t,s.onViewportChange),l=f.useRef(0);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),u.jsx(fl.Slot,{scope:n,children:u.jsx(ce.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ie(o.onScroll,c=>{const d=c.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:y}=i;if(y!=null&&y.current&&m){const p=Math.abs(l.current-d.scrollTop);if(p>0){const b=window.innerHeight-Vt*2,g=parseFloat(m.style.minHeight),x=parseFloat(m.style.height),v=Math.max(g,x);if(v0?S:0,m.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});$y.displayName=yu;var By="SelectGroup",[tP,nP]=Yo(By),rP=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ed();return u.jsx(tP,{scope:n,id:o,children:u.jsx(ce.div,{role:"group","aria-labelledby":o,...r,ref:t})})});rP.displayName=By;var Uy="SelectLabel",Vy=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=nP(Uy,n);return u.jsx(ce.div,{id:o.id,...r,ref:t})});Vy.displayName=Uy;var Oa="SelectItem",[oP,Wy]=Yo(Oa),Hy=f.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=vr(Oa,n),l=yr(Oa,n),c=a.value===r,[d,m]=f.useState(s??""),[y,p]=f.useState(!1),b=Te(t,h=>{var w;return(w=l.itemRefCallback)==null?void 0:w.call(l,h,r,o)}),g=Ed(),x=f.useRef("touch"),v=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A 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 u.jsx(oP,{scope:n,value:r,disabled:o,textId:g,isSelected:c,onItemTextChange:f.useCallback(h=>{m(w=>w||((h==null?void 0:h.textContent)??"").trim())},[]),children:u.jsx(fl.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:u.jsx(ce.div,{role:"option","aria-labelledby":g,"data-highlighted":y?"":void 0,"aria-selected":c&&y,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:b,onFocus:ie(i.onFocus,()=>p(!0)),onBlur:ie(i.onBlur,()=>p(!1)),onClick:ie(i.onClick,()=>{x.current!=="mouse"&&v()}),onPointerUp:ie(i.onPointerUp,()=>{x.current==="mouse"&&v()}),onPointerDown:ie(i.onPointerDown,h=>{x.current=h.pointerType}),onPointerMove:ie(i.onPointerMove,h=>{var w;x.current=h.pointerType,o?(w=l.onItemLeave)==null||w.call(l):x.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ie(i.onPointerLeave,h=>{var w;h.currentTarget===document.activeElement&&((w=l.onItemLeave)==null||w.call(l))}),onKeyDown:ie(i.onKeyDown,h=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&h.key===" "||(VT.includes(h.key)&&v(),h.key===" "&&h.preventDefault())})})})})});Hy.displayName=Oa;var ds="SelectItemText",Ky=f.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=vr(ds,n),a=yr(ds,n),l=Wy(ds,n),c=QT(ds,n),[d,m]=f.useState(null),y=Te(t,v=>m(v),l.onItemTextChange,v=>{var h;return(h=a.itemTextRefCallback)==null?void 0:h.call(a,v,l.value,l.disabled)}),p=d==null?void 0:d.textContent,b=f.useMemo(()=>u.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:g,onNativeOptionRemove:x}=c;return Oe(()=>(g(b),()=>x(b)),[g,x,b]),u.jsxs(u.Fragment,{children:[u.jsx(ce.span,{id:l.textId,...s,ref:y}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Kr.createPortal(s.children,i.valueNode):null]})});Ky.displayName=ds;var Qy="SelectItemIndicator",Gy=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Wy(Qy,n).isSelected?u.jsx(ce.span,{"aria-hidden":!0,...r,ref:t}):null});Gy.displayName=Qy;var wu="SelectScrollUpButton",qy=f.forwardRef((e,t)=>{const n=yr(wu,e.__scopeSelect),r=Ud(wu,e.__scopeSelect),[o,s]=f.useState(!1),i=Te(t,r.onScrollButtonChange);return Oe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;s(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?u.jsx(Xy,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});qy.displayName=wu;var xu="SelectScrollDownButton",Yy=f.forwardRef((e,t)=>{const n=yr(xu,e.__scopeSelect),r=Ud(xu,e.__scopeSelect),[o,s]=f.useState(!1),i=Te(t,r.onScrollButtonChange);return Oe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?u.jsx(Xy,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});Yy.displayName=xu;var Xy=f.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=yr("SelectScrollButton",n),i=f.useRef(null),a=pl(n),l=f.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return f.useEffect(()=>()=>l(),[l]),Oe(()=>{var d;const c=a().find(m=>m.ref.current===document.activeElement);(d=c==null?void 0:c.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),u.jsx(ce.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:ie(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:ie(o.onPointerMove,()=>{var c;(c=s.onItemLeave)==null||c.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:ie(o.onPointerLeave,()=>{l()})})}),sP="SelectSeparator",Zy=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u.jsx(ce.div,{"aria-hidden":!0,...r,ref:t})});Zy.displayName=sP;var bu="SelectArrow",iP=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=hl(n),s=vr(bu,n),i=yr(bu,n);return s.open&&i.position==="popper"?u.jsx($v,{...o,...r,ref:t}):null});iP.displayName=bu;var aP="SelectBubbleInput",Jy=f.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=f.useRef(null),s=Te(r,o),i=wy(t);return f.useEffect(()=>{const a=o.current;if(!a)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==t&&d){const m=new Event("change",{bubbles:!0});d.call(a,t),a.dispatchEvent(m)}},[i,t]),u.jsx(ce.select,{...n,style:{...Mg,...n.style},ref:s,defaultValue:t})});Jy.displayName=aP;function ew(e){return e===""||e===void 0}function tw(e){const t=Ot(e),n=f.useRef(""),r=f.useRef(0),o=f.useCallback(i=>{const a=n.current+i;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),s=f.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function nw(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=lP(e,Math.max(s,0));o.length===1&&(i=i.filter(c=>c!==n));const l=i.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function lP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var cP=jy,rw=Ry,uP=Iy,dP=Oy,fP=Ly,ow=My,pP=$y,sw=Vy,iw=Hy,hP=Ky,mP=Gy,aw=qy,lw=Yy,cw=Zy;const gP=cP,vP=uP,uw=f.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(rw,{ref:r,className:he("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,u.jsx(dP,{asChild:!0,children:u.jsx(sv,{className:"h-4 w-4 opacity-50"})})]}));uw.displayName=rw.displayName;const dw=f.forwardRef(({className:e,...t},n)=>u.jsx(aw,{ref:n,className:he("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(kS,{className:"h-4 w-4"})}));dw.displayName=aw.displayName;const fw=f.forwardRef(({className:e,...t},n)=>u.jsx(lw,{ref:n,className:he("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(sv,{className:"h-4 w-4"})}));fw.displayName=lw.displayName;const pw=f.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>u.jsx(fP,{children:u.jsxs(ow,{ref:o,className:he("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[u.jsx(dw,{}),u.jsx(pP,{className:he("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(fw,{})]})}));pw.displayName=ow.displayName;const yP=f.forwardRef(({className:e,...t},n)=>u.jsx(sw,{ref:n,className:he("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));yP.displayName=sw.displayName;const hw=f.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(iw,{ref:r,className:he("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(mP,{children:u.jsx($s,{className:"h-4 w-4"})})}),u.jsx(hP,{children:t})]}));hw.displayName=iw.displayName;const wP=f.forwardRef(({className:e,...t},n)=>u.jsx(cw,{ref:n,className:he("-mx-1 my-1 h-px bg-muted",e),...t}));wP.displayName=cw.displayName;const xP="modulepreload",bP=function(e){return"/"+e},eh={},Le=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),a=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));o=Promise.allSettled(n.map(l=>{if(l=bP(l),l in eh)return;eh[l]=!0;const c=l.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const m=document.createElement("link");if(m.rel=c?"stylesheet":xP,c||(m.as="script"),m.crossOrigin="",m.href=l,a&&m.setAttribute("nonce",a),document.head.appendChild(m),c)return new Promise((y,p)=>{m.addEventListener("load",y),m.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return o.then(i=>{for(const a of i||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})};function gt(){return"https://pa-kima.kimaschine.de/webhook"}const oi=Object.freeze(Object.defineProperty({__proto__:null,getWebhookUrl:gt},Symbol.toStringTag,{value:"Module"})),mw=async(e,t)=>{const n=new FormData;n.append("file",e),n.append("blog_id",t);try{const{apiFetch:r}=await Le(async()=>{const{apiFetch:i}=await Promise.resolve().then(()=>lt);return{apiFetch:i}},void 0),o=await r(`${gt()}/file_upload_blog`,{method:"POST",body:n});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const s=await o.json();return{success:!0,message:"File uploaded successfully",url:s.url,fileUrl:s.url,...s}}catch(r){return console.error("Error uploading file:",r),{success:!1,message:r instanceof Error?r.message:"Failed to upload file"}}},gw=async(e,t)=>{const n=new FormData;n.append("file",e),n.append("event_id",t);try{const{apiFetch:r}=await Le(async()=>{const{apiFetch:i}=await Promise.resolve().then(()=>lt);return{apiFetch:i}},void 0),o=await r(`${gt()}/file_upload_event`,{method:"POST",body:n});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const s=await o.json();return{success:!0,message:"File uploaded successfully",url:s.url,fileUrl:s.url,...s}}catch(r){return console.error("Error uploading file:",r),{success:!1,message:r instanceof Error?r.message:"Failed to upload file"}}},vw=async(e,t)=>{try{const{apiFetch:n}=await Le(async()=>{const{apiFetch:s}=await Promise.resolve().then(()=>lt);return{apiFetch:s}},void 0),r=await n(`${gt()}/media/image_generator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({blog_id:e,title:t})});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);const o=await r.json();return{success:!0,message:"Blog post image generated successfully",url:o.url||o.imageUrl,fileUrl:o.url||o.imageUrl,...o}}catch(n){return console.error("Error generating blog post image:",n),{success:!1,message:n instanceof Error?n.message:"Failed to generate blog post image"}}},ta=async()=>{try{const{apiFetch:e}=await Le(async()=>{const{apiFetch:o}=await Promise.resolve().then(()=>lt);return{apiFetch:o}},void 0),{getWebhookUrl:t}=await Le(async()=>{const{getWebhookUrl:o}=await Promise.resolve().then(()=>oi);return{getWebhookUrl:o}},void 0),n=await e(`${t()}/blog/new_blog`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const r=await n.json();return r.id||r.blog_id||null}catch(e){return console.error("Error creating new blog:",e),null}},yw=async({blogId:e,publishDate:t,publishToSocialMedia:n,socialMediaChannels:r,socialMediaLanguages:o})=>{try{const{apiFetch:s}=await Le(async()=>{const{apiFetch:l}=await Promise.resolve().then(()=>lt);return{apiFetch:l}},void 0),{getWebhookUrl:i}=await Le(async()=>{const{getWebhookUrl:l}=await Promise.resolve().then(()=>oi);return{getWebhookUrl:l}},void 0),a=await s(`${i()}/blog/publish`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({blog_id:e,publish_date:t||new Date().toISOString().split("T")[0],publish_socialmedia:n,socialmedia_channels:r,socialmedia_languages:o})});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return await a.json()}catch(s){throw console.error("Error publishing blog post:",s),s}},ww=async({blogId:e,content:t})=>{try{const{apiFetch:n}=await Le(async()=>{const{apiFetch:s}=await Promise.resolve().then(()=>lt);return{apiFetch:s}},void 0),{getWebhookUrl:r}=await Le(async()=>{const{getWebhookUrl:s}=await Promise.resolve().then(()=>oi);return{getWebhookUrl:s}},void 0),o=await n(`${r()}/blog/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({blog_id:e,content:t})});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);return await o.json()}catch(n){throw console.error("Error updating blog post:",n),n}},xw=async({blog_Id:e,topic:t,tonality:n,languages:r})=>{try{const{apiFetch:o}=await Le(async()=>{const{apiFetch:a}=await Promise.resolve().then(()=>lt);return{apiFetch:a}},void 0),{getWebhookUrl:s}=await Le(async()=>{const{getWebhookUrl:a}=await Promise.resolve().then(()=>oi);return{getWebhookUrl:a}},void 0),i=await o(`${s()}/blog/generate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({blog_Id:e,topic:t,tonality:n,languages:r})});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);return await i.json()}catch(o){throw console.error("Error generating blog post:",o),o}},bw=async()=>{try{const{apiFetch:e}=await Le(async()=>{const{apiFetch:s}=await Promise.resolve().then(()=>lt);return{apiFetch:s}},void 0),{getWebhookUrl:t}=await Le(async()=>{const{getWebhookUrl:s}=await Promise.resolve().then(()=>oi);return{getWebhookUrl:s}},void 0),n=await e(`${t()}/blog/topic_suggestion`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const r=await n.json(),o=(r==null?void 0:r.topics)||r;return Array.isArray(o)?o.slice(0,4):null}catch(e){return console.error("Error fetching blog topic suggestions:",e),null}},SP=({languages:e,selectedLangs:t,activeLang:n,onSelect:r})=>u.jsx("div",{className:"flex gap-2 flex-wrap",children:t.map(o=>{var i;const s=((i=e.find(a=>a.code===o))==null?void 0:i.label)||o;return u.jsx(me,{variant:n===o?"default":"outline",size:"sm",onClick:()=>r(o),children:s},o)})}),CP=({showSocial:e,onToggleSocial:t,socialChannels:n,selectedChannels:r,onToggleChannel:o,languages:s,selectedLangs:i,editedContents:a,initialContents:l,activeLang:c,setActiveLang:d,setEditedContents:m,scheduledTime:y,setScheduledTime:p,onPublish:b,canPublish:g})=>u.jsxs("div",{className:"w-full max-w-3xl mx-auto mt-4 space-y-4",children:[u.jsxs("section",{className:"rounded-lg border bg-muted/30 p-4",children:[u.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[u.jsx("input",{type:"checkbox",checked:e,onChange:t,className:"accent-primary"}),"Poste Social Media"]}),u.jsxs("div",{className:`overflow-hidden transition-all duration-300 ${e?"max-h-96 opacity-100 mt-2":"max-h-0 opacity-0"}`,children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("span",{className:"text-sm font-medium mr-1",children:"Kanäle:"}),n.map(x=>u.jsx(me,{variant:r.includes(x)?"default":"outline",size:"sm",onClick:()=>o(x),children:x},x))]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-4",children:[u.jsx("span",{className:"text-sm font-medium mr-1",children:"Sprachen:"}),s.map(x=>u.jsxs("label",{className:"flex items-center gap-1 cursor-pointer select-none",children:[u.jsx("input",{type:"checkbox",checked:Object.keys(a).includes(x.code),disabled:!i.includes(x.code),onChange:v=>{v.target.checked?(m(h=>({...h,[x.code]:l[x.code]||""})),d(x.code)):m(h=>{const w={...h};if(delete w[x.code],c===x.code){const S=Object.keys(w)[0]||"";d(S)}return w})},className:"accent-primary"}),x.label]},x.code))]})]})]}),u.jsxs("section",{className:"rounded-lg border bg-muted/30 p-4",children:[u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("input",{type:"radio",id:"publishNow",name:"publishOption",checked:!y,onChange:()=>p(""),className:"h-4 w-4 text-primary focus:ring-primary"}),u.jsx("label",{htmlFor:"publishNow",className:"text-sm font-medium",children:"Sofort veröffentlichen"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("input",{type:"radio",id:"schedulePublish",name:"publishOption",checked:!!y,onChange:()=>p(new Date().toISOString().split("T")[0]),className:"h-4 w-4 text-primary focus:ring-primary"}),u.jsx("label",{htmlFor:"schedulePublish",className:"text-sm font-medium",children:"Senden planen"})]})]}),y&&u.jsx("div",{className:"flex items-center gap-2 mt-2",children:u.jsx(ut,{type:"date",value:y.split("T")[0],onChange:x=>p(x.target.value),className:"flex-1"})})]}),u.jsx("div",{className:"flex justify-end",children:u.jsx(me,{onClick:b,disabled:!g,children:"Veröffentlichen"})})]}),th=["Informativ","Inspirierend","Unterhaltsam","Formell"],Ii=[{code:"de",label:"Deutsch"},{code:"en",label:"English"},{code:"es",label:"Español"}],EP=["LinkedIn","Twitter","Facebook","Instagram"],kP=({onComplete:e,onNewBlog:t,onGenerate:n,onUpdate:r,onPublish:o,onFetchSuggestions:s,onUploadFile:i,onGenerateImage:a})=>{var M;const[l,c]=f.useState("topic"),[d,m]=f.useState(""),[y,p]=f.useState(th[0]),[b,g]=f.useState(Ii.map(N=>N.code)),[x,v]=f.useState(!1),[h,w]=f.useState(null),[S,C]=f.useState({}),[k,E]=f.useState({}),[j,_]=f.useState(""),[R,U]=f.useState([]),[F,q]=f.useState(null),[L,G]=f.useState(null),[V,K]=f.useState(!1),[T,P]=f.useState(!1),[$,Y]=f.useState([]),[H,X]=f.useState(!1),[Q,fe]=f.useState(""),[ue,z]=f.useState(!1),[ne,ve]=f.useState([]),[se,re]=f.useState(""),oe=f.useRef(null),xe=O.useCallback(()=>Object.keys(S).length===0?!1:Object.keys(S).some(N=>S[N]!==(k[N]||"")),[S,k]),Fe=O.useCallback(async()=>{if(!(!xe()||!Q)){X(!0);try{r?await r({blogId:Q,content:S}):await ww({blogId:Q,content:S}),E({...S})}catch(N){console.error("Error saving changes:",N)}finally{X(!1)}}},[Q,S,xe]),Lt=async()=>{try{if(!Q)return;xe()&&await Fe(),o?await o({blogId:Q,publishDate:se||void 0,publishToSocialMedia:ue&&ne.length>0,socialMediaChannels:ue?ne:[],socialMediaLanguages:Object.keys(S)}):await yw({blogId:Q,publishDate:se||void 0,publishToSocialMedia:ue&&ne.length>0,socialMediaChannels:ue?ne:[],socialMediaLanguages:Object.keys(S)}),e()}catch(N){console.error("Error publishing blog post:",N)}},vt=(N,D)=>{D.stopPropagation(),U(B=>B.filter(ae=>ae.id!==N)),F===N&&q(R.length>1?R[0].id:null)},Mt=(N,D)=>{D.stopPropagation(),q(N)},yn=(N,D)=>{N.stopPropagation(),G(D)},nn=async N=>{var B;if(!((B=N.target.files)!=null&&B[0]))return;const D=N.target.files[0];if(!D.type.startsWith("image/"))return alert("Nur Bilder erlaubt");try{let ae=Q;if(!ae){if(ae=t?await t():await ta(),!ae)return;fe(ae)}const ee=i?await i(D,ae):await mw(D,ae);if(ee.success&&(ee.url||ee.fileUrl)){const et={id:`file-${Date.now()}`,url:ee.url||ee.fileUrl||"",type:"image"};U(tt=>[...tt,et]),q(et.id)}}catch(ae){console.error("Error uploading file:",ae),alert("Fehler beim Hochladen der Datei")}},Gr=async()=>{if(!d.trim()){alert("Bitte geben Sie zuerst ein Thema ein");return}K(!0);try{let N=Q;if(!N){if(N=t?await t():await ta(),!N)return;fe(N)}const D=a?await a(N,d):await vw(N,d);if(D.success&&(D.url||D.fileUrl)){const B={id:`gen-${Date.now()}`,url:D.url||D.fileUrl||"",type:"image"};U(ae=>[...ae,B]),q(B.id)}}catch(N){console.error("Error generating image:",N),alert("Fehler beim Generieren des Bildes")}finally{K(!1)}},wn=async()=>{var N;if(!d.trim()||b.length===0){alert("Bitte füllen Sie alle erforderlichen Felder aus");return}if(!F){alert("Bitte wählen Sie ein Bild aus");return}c("loading"),v(!0);try{const D=t?await t():await ta();if(!D)throw new Error("Could not create a new blog entry");fe(D);const B=n?await n({blog_Id:D,topic:d,tonality:y,languages:b}):await xw({blog_Id:D,topic:d,tonality:y,languages:b});let ae=null,ee=B;if(Array.isArray(B)&&((N=B[0])!=null&&N.blog)?(ae=B[0].blog,ee=B[0]):B!=null&&B.blog&&Array.isArray(B.blog)&&(ae=B.blog),w(ee),ae){const et={};ae.forEach(tt=>{et[tt.language]=tt.content}),C(et),E(et),_(b[0]||"")}else typeof ee=="string"&&(C({de:ee}),E({de:ee}),_("de"));c("result")}catch(D){console.error("Error generating blog post:",D),c("topic"),alert("Fehler beim Generieren des Blogbeitrags. Bitte versuchen Sie es erneut.")}finally{v(!1)}},qr=async()=>{P(!0);try{const N=s?await s():await bw();N&&Y(N)}catch(N){console.error("Error fetching topic suggestions:",N)}finally{P(!1)}},Dt=N=>{m(N),Y([])};return u.jsxs(u.Fragment,{children:[u.jsxs(Qo,{className:"w-full max-w-3xl mx-auto",children:[u.jsx(Go,{children:u.jsx(qo,{children:l==="result"?"Neuen Blogbeitrag erstellen":"Beitragsvorschau"})}),u.jsx(ri,{children:l==="result"?u.jsxs("div",{className:"space-y-6",children:[u.jsx("div",{className:"flex justify-between items-center",children:u.jsxs(me,{variant:"outline",onClick:()=>c("topic"),className:"flex items-center gap-2",children:[u.jsx(qi,{className:"h-4 w-4"}),"Zurück"]})}),u.jsxs("div",{className:"space-y-4",children:[u.jsx(SP,{languages:Ii,selectedLangs:b,activeLang:j,onSelect:_}),j?u.jsx(Qs,{value:S[j]||"",onChange:N=>C({...S,[j]:N.target.value}),rows:14,className:"w-full text-sm"}):u.jsx("p",{className:"text-muted-foreground",children:"Kein Inhalt verfügbar"}),u.jsx("div",{className:"flex",children:u.jsx(me,{variant:"outline",onClick:Fe,disabled:!xe()||H,children:H?u.jsxs(u.Fragment,{children:[u.jsx(Yi,{className:"mr-2 h-4 w-4 animate-spin"}),"Wird gespeichert..."]}):"Änderungen speichern"})})]}),F&&u.jsxs("div",{className:"mt-6",children:[u.jsx("h3",{className:"text-lg font-medium mb-2",children:"Ausgewähltes Bild"}),u.jsx("div",{className:"relative w-full max-w-md aspect-video rounded-lg overflow-hidden border",children:u.jsx("img",{src:(M=R.find(N=>N.id===F))==null?void 0:M.url,alt:"Ausgewähltes Blog-Bild",className:"w-full h-full object-cover"})})]})]}):l==="loading"?u.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[u.jsx(Yi,{className:"h-8 w-8 animate-spin text-primary mb-4"}),u.jsx("p",{className:"text-muted-foreground",children:"Beitrag wird generiert..."})]}):u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(He,{htmlFor:"topic",children:"Thema des Blogbeitrags"}),u.jsx(me,{type:"button",variant:"ghost",size:"sm",className:"text-sm text-muted-foreground",onClick:qr,disabled:T,children:T?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"h-4 w-4 border-2 border-muted-foreground/50 border-t-primary rounded-full animate-spin mr-2"}),"Lade Vorschläge..."]}):u.jsxs(u.Fragment,{children:[u.jsx(hp,{className:"h-4 w-4 mr-1.5"}),"Thema vorschlagen lassen"]})})]}),u.jsxs("div",{className:"relative",children:[u.jsx(ut,{id:"topic",placeholder:"Zum Beispiel: Die besten Tipps für erfolgreiches Social Media Marketing",value:d,onChange:N=>m(N.target.value)}),$.length>0&&u.jsxs("div",{className:"absolute z-10 w-full mt-1 bg-white dark:bg-gray-800 border rounded-md shadow-lg",children:[u.jsx("div",{className:"p-2 text-sm text-muted-foreground",children:"Themenvorschläge:"}),$.map((N,D)=>u.jsx("button",{type:"button",className:"w-full text-left px-4 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700",onClick:()=>Dt(N),children:N},D))]})]})]}),u.jsx("div",{className:"flex flex-col space-y-4",children:u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(He,{children:"Ton"}),u.jsxs(gP,{value:y,onValueChange:p,children:[u.jsx(uw,{children:u.jsx(vP,{placeholder:"Ton auswählen"})}),u.jsx(pw,{children:th.map(N=>u.jsx(hw,{value:N,children:N},N))})]})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(He,{children:"Sprachen"}),u.jsx("div",{className:"flex items-center space-x-4",children:Ii.map(N=>u.jsxs("div",{className:"flex items-center space-x-1.5",children:[u.jsx("input",{type:"checkbox",id:`lang-${N.code}`,checked:b.includes(N.code),onChange:D=>{D.target.checked?g([...b,N.code]):g(b.filter(B=>B!==N.code))},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"}),u.jsx(He,{htmlFor:`lang-${N.code}`,className:"text-sm font-medium leading-none",children:N.label})]},N.code))})]})]})}),u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("div",{className:"flex items-center space-x-2",children:u.jsx(He,{children:"Medien"})}),u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsxs(me,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>{var N;return(N=oe.current)==null?void 0:N.click()},children:[u.jsx(jS,{className:"h-3.5 w-3.5 mr-1.5"}),"Hochladen"]}),u.jsx("input",{ref:oe,type:"file",className:"hidden",accept:"image/*",onChange:nn}),u.jsxs(me,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:Gr,disabled:!d.trim()||V,children:[V?u.jsx(Yi,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}):u.jsx(hp,{className:"h-3.5 w-3.5 mr-1.5"}),"KI-Bild generieren"]})]})]}),R.length>0&&u.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:R.map(N=>{const D=F===N.id;return u.jsxs("div",{onClick:B=>yn(B,N.url),className:`relative group rounded-md overflow-hidden border-2 cursor-pointer transition-all ${D?"border-primary ring-2 ring-primary":"border-transparent hover:border-muted-foreground/30"}`,children:[u.jsx("div",{className:"aspect-square bg-muted/50 flex items-center justify-center",children:u.jsx(TS,{className:"h-8 w-8 text-muted-foreground"})}),u.jsx("img",{src:N.url,alt:"",className:"absolute inset-0 w-full h-full object-cover"}),u.jsx("div",{onClick:B=>Mt(N.id,B),className:`absolute top-1 right-1 w-5 h-5 rounded flex items-center justify-center transition-colors ${D?"bg-primary text-primary-foreground":"bg-background/90 text-foreground/50 hover:bg-background/80 hover:text-foreground/70"}`,children:D&&u.jsx($s,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:B=>vt(N.id,B),className:"absolute top-1 left-1 p-1 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity",children:u.jsx(Pa,{className:"h-3 w-3"})})]},N.id)})})]}),u.jsx("div",{className:"flex justify-end",children:u.jsx(me,{onClick:wn,disabled:!d.trim()||x||!F,children:x?"Wird generiert...":"Beitrag generieren"})})]})})]}),l==="result"&&u.jsx(CP,{showSocial:ue,onToggleSocial:()=>z(N=>!N),socialChannels:EP,selectedChannels:ne,onToggleChannel:N=>ve(D=>D.includes(N)?D.filter(B=>B!==N):[...D,N]),languages:Ii,selectedLangs:b,editedContents:S,initialContents:k,activeLang:j,setActiveLang:_,setEditedContents:C,scheduledTime:se,setScheduledTime:re,onPublish:Lt,canPublish:!xe()}),L&&u.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-50 p-4",onClick:()=>G(null),children:u.jsxs("div",{className:"relative max-w-4xl w-full max-h-[90vh]",children:[u.jsx("button",{className:"absolute -top-10 right-0 text-white hover:text-gray-300",onClick:N=>{N.stopPropagation(),G(null)},children:u.jsx(Pa,{className:"w-6 h-6"})}),u.jsx("div",{className:"bg-background rounded-lg overflow-hidden",children:u.jsx("img",{src:L,alt:"Vorschau",className:"w-full h-auto max-h-[80vh] object-contain mx-auto",onClick:N=>N.stopPropagation()})})]})})]})},TP=({onComplete:e})=>{const t=async()=>{const l=await ta();if(!l)throw new Error("Konnte keinen neuen Blog erstellen");return l},n=async l=>{try{return await xw(l)}catch(c){throw ze.error("Fehler beim Generieren des Blogbeitrags"),c}},r=async l=>{try{const c=await ww(l);return ze.success("Änderungen erfolgreich gespeichert"),c}catch(c){throw ze.error("Fehler beim Speichern der Änderungen"),c}},o=async l=>{try{const c=await yw(l);return ze.success(l.publishDate?"Blog erfolgreich geplant":"Blog erfolgreich veröffentlicht"),e==null||e(),c}catch(c){throw ze.error("Fehler beim Veröffentlichen des Blogbeitrags"),c}},s=async()=>{try{return await bw()}catch{return ze.error("Fehler beim Laden der Themenvorschläge"),null}},i=async(l,c)=>{try{const d=await mw(l,c);if(!d.success)throw new Error(d.message);return d}catch(d){throw ze.error("Fehler beim Hochladen der Datei"),d}},a=async(l,c)=>{try{const d=await vw(l,c);if(!d.success)throw new Error(d.message);return d}catch(d){throw ze.error("Fehler beim Generieren des Bildes"),d}};return u.jsx(kP,{onComplete:e,onNewBlog:t,onGenerate:n,onUpdate:r,onPublish:o,onFetchSuggestions:s,onUploadFile:i,onGenerateImage:a})},PP=async e=>{try{const{apiFetch:t}=await Le(async()=>{const{apiFetch:o}=await Promise.resolve().then(()=>lt);return{apiFetch:o}},void 0),n=await t(`${gt()}/event/new_manual`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e})});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(t){throw console.error("Error creating event manually:",t),t}},NP=async e=>{try{const{apiFetch:t}=await Le(async()=>{const{apiFetch:o}=await Promise.resolve().then(()=>lt);return{apiFetch:o}},void 0),n=await t(`${gt()}/event/new_fromurl`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e,command:"eventmodus_extract_from_url"})});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const r=await n.json();return r.message_from_ai||r}catch(t){throw console.error("Error creating event from URL:",t),t}},nh=e=>e?new Date(e).toISOString().split("T")[0]:"",jP=async e=>{console.log("Uploading file");const t=new FormData;t.append("file",e);for(let[n,r]of t.entries())console.log(n,r);try{const{apiFetch:n}=await Le(async()=>{const{apiFetch:s}=await Promise.resolve().then(()=>lt);return{apiFetch:s}},void 0),r=await n(`${gt()}/upload_tmp`,{method:"POST",body:t});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);const o=await r.json();return{success:!0,message:"File uploaded successfully",url:o.url,fileUrl:o.url,...o}}catch(n){return console.error("Error uploading file:",n),toast.error("Failed to upload file"),{success:!1,message:n instanceof Error?n.message:"Failed to upload file"}}},rh={name:"",description:"",location:"",url:"",image:"",manager_name:"",manager_email:"",guests:"",begin_date:"",end_date:""},AP=({onSuccess:e,onCancel:t,loading:n})=>{const[r,o]=f.useState(!1),[s,i]=f.useState(rh),[a,l]=f.useState(!1),[c,d]=f.useState(null),[m,y]=f.useState(!1),p=O.useRef(null);f.useEffect(()=>()=>{i(rh),o(!1),d(null),l(!1)},[]);const b=v=>{i({...s,[v.target.name]:v.target.value})},g=async v=>{v.preventDefault();try{l(!0),await PP({name:s.name,description:s.description||void 0,location:s.location||void 0,url:s.url||void 0,image:s.image||void 0,manager_name:s.manager_name||void 0,manager_email:s.manager_email||void 0,begin_date:s.begin_date||void 0,end_date:s.end_date||void 0}),e==null||e()}catch{d("Fehler beim Erstellen des Events")}finally{l(!1)}},x=async v=>{if(v.preventDefault(),!s.url){d("Bitte geben Sie eine URL ein");return}try{l(!0),d(null);const h=await NP(s.url);i({...s,name:h.name||s.name,description:h.description||s.description,location:h.location||s.location,url:h.url||s.url,image:h.image||s.image,manager_name:h.manager_name||s.manager_name,manager_email:h.manager_email||s.manager_email,begin_date:h.begin_date?nh(h.begin_date):s.begin_date,end_date:h.end_date?nh(h.end_date):s.end_date}),o(!1)}catch{d("Fehler beim Erstellen des Events von der URL")}finally{l(!1)}};return u.jsx("div",{className:"rounded-lg border p-4",children:u.jsxs("form",{onSubmit:g,className:"space-y-3",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(He,{htmlFor:"name",children:"Name *"}),u.jsx(ut,{id:"name",name:"name",value:s.name,onChange:b,required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(He,{htmlFor:"description",children:"Beschreibung"}),u.jsx(Qs,{id:"description",name:"description",value:s.description,onChange:b,rows:2})]}),u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(He,{htmlFor:"location",children:"Ort"}),u.jsx(ut,{id:"location",name:"location",value:s.location,onChange:b})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(He,{htmlFor:"url",children:"URL"}),r?u.jsxs("div",{className:"flex gap-2",children:[u.jsx(ut,{id:"url",name:"url",value:s.url,onChange:b,placeholder:"https://..."}),u.jsx(me,{type:"button",variant:"outline",onClick:()=>o(!1),disabled:a,children:"Abbrechen"}),u.jsx(me,{type:"button",onClick:x,disabled:!s.url||a,children:a?"Wird geladen...":"Go"})]}):u.jsxs("div",{className:"flex gap-2",children:[u.jsx(ut,{id:"url",name:"url",value:s.url,onChange:b,placeholder:"https://..."}),u.jsx(me,{type:"button",variant:"outline",onClick:()=>o(!0),children:"Von URL importieren"})]})]})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(He,{children:"Bild"}),u.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 items-start sm:items-center",children:[u.jsx(ut,{placeholder:"Bild-URL",value:s.image,onChange:v=>i({...s,image:v.target.value})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("input",{ref:p,type:"file",accept:"image/*",className:"hidden",onChange:async v=>{var w;const h=(w=v.target.files)==null?void 0:w[0];if(h){y(!0);try{const S=await jP(h);S.success&&(S.url||S.fileUrl)&&i(C=>({...C,image:S.url||S.fileUrl||""}))}finally{y(!1)}}}}),u.jsx(me,{type:"button",variant:"outline",onClick:()=>{var v;return(v=p.current)==null?void 0:v.click()},disabled:m,children:m?"Wird hochgeladen...":"Bild hochladen"})]})]}),s.image&&u.jsx("div",{className:"mt-2",children:u.jsx("img",{src:s.image,alt:"Event Bild",className:"h-24 rounded border object-cover"})})]}),u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(He,{htmlFor:"manager_name",children:"Manager Name"}),u.jsx(ut,{id:"manager_name",name:"manager_name",value:s.manager_name,onChange:b})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(He,{htmlFor:"manager_email",children:"Manager Email"}),u.jsx(ut,{id:"manager_email",name:"manager_email",value:s.manager_email,onChange:b,type:"email"})]})]}),u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(He,{htmlFor:"begin_date",children:"Beginn"}),u.jsx(ut,{id:"begin_date",name:"begin_date",value:s.begin_date,onChange:b,type:"date"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(He,{htmlFor:"end_date",children:"Ende"}),u.jsx(ut,{id:"end_date",name:"end_date",value:s.end_date,onChange:b,type:"date"})]})]}),c&&u.jsx("div",{className:"text-sm text-destructive",children:c}),u.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 pt-2",children:[u.jsx(me,{type:"submit",className:"flex-1",disabled:n||a,children:a?"Wird verarbeitet...":"Speichern"}),t&&u.jsx(me,{type:"button",variant:"outline",className:"flex-1",onClick:t,children:"Abbrechen"})]})]})})};var ml="Checkbox",[RP,wN]=Qr(ml),[_P,Vd]=RP(ml);function IP(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:l,required:c,value:d="on",internal_do_not_use_render:m}=e,[y,p]=Ta({prop:n,defaultProp:o??!1,onChange:l,caller:ml}),[b,g]=f.useState(null),[x,v]=f.useState(null),h=f.useRef(!1),w=b?!!i||!!b.closest("form"):!0,S={checked:y,disabled:s,setChecked:p,control:b,setControl:g,name:a,form:i,value:d,hasConsumerStoppedPropagationRef:h,required:c,defaultChecked:cr(o)?!1:o,isFormControl:w,bubbleInput:x,setBubbleInput:v};return u.jsx(_P,{scope:t,...S,children:OP(m)?m(S):r})}var Sw="CheckboxTrigger",Cw=f.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:s,value:i,disabled:a,checked:l,required:c,setControl:d,setChecked:m,hasConsumerStoppedPropagationRef:y,isFormControl:p,bubbleInput:b}=Vd(Sw,e),g=Te(o,d),x=f.useRef(l);return f.useEffect(()=>{const v=s==null?void 0:s.form;if(v){const h=()=>m(x.current);return v.addEventListener("reset",h),()=>v.removeEventListener("reset",h)}},[s,m]),u.jsx(ce.button,{type:"button",role:"checkbox","aria-checked":cr(l)?"mixed":l,"aria-required":c,"data-state":Nw(l),"data-disabled":a?"":void 0,disabled:a,value:i,...r,ref:g,onKeyDown:ie(t,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:ie(n,v=>{m(h=>cr(h)?!0:!h),b&&p&&(y.current=v.isPropagationStopped(),y.current||v.stopPropagation())})})});Cw.displayName=Sw;var Wd=f.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:l,onCheckedChange:c,form:d,...m}=e;return u.jsx(IP,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:a,required:i,onCheckedChange:c,name:r,form:d,value:l,internal_do_not_use_render:({isFormControl:y})=>u.jsxs(u.Fragment,{children:[u.jsx(Cw,{...m,ref:t,__scopeCheckbox:n}),y&&u.jsx(Pw,{__scopeCheckbox:n})]})})});Wd.displayName=ml;var Ew="CheckboxIndicator",kw=f.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=Vd(Ew,n);return u.jsx(Za,{present:r||cr(s.checked)||s.checked===!0,children:u.jsx(ce.span,{"data-state":Nw(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});kw.displayName=Ew;var Tw="CheckboxBubbleInput",Pw=f.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:i,required:a,disabled:l,name:c,value:d,form:m,bubbleInput:y,setBubbleInput:p}=Vd(Tw,e),b=Te(n,p),g=wy(s),x=Nv(r);f.useEffect(()=>{const h=y;if(!h)return;const w=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(w,"checked").set,k=!o.current;if(g!==s&&C){const E=new Event("click",{bubbles:k});h.indeterminate=cr(s),C.call(h,cr(s)?!1:s),h.dispatchEvent(E)}},[y,g,s,o]);const v=f.useRef(cr(s)?!1:s);return u.jsx(ce.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??v.current,required:a,disabled:l,name:c,value:d,form:m,...t,tabIndex:-1,ref:b,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Pw.displayName=Tw;function OP(e){return typeof e=="function"}function cr(e){return e==="indeterminate"}function Nw(e){return cr(e)?"indeterminate":e?"checked":"unchecked"}const jw=f.forwardRef(({className:e,...t},n)=>u.jsx(Wd,{ref:n,className:he("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:u.jsx(kw,{className:he("flex items-center justify-center text-current"),children:u.jsx($s,{className:"h-4 w-4"})})}));jw.displayName=Wd.displayName;var Aw={exports:{}},Rw={};/** * @license React * use-sync-external-store-shim.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var $o=f;function LP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var MP=typeof Object.is=="function"?Object.is:LP,DP=$o.useState,FP=$o.useEffect,zP=$o.useLayoutEffect,$P=$o.useDebugValue;function BP(e,t){var n=t(),r=DP({inst:{value:n,getSnapshot:t}}),o=r[0].inst,s=r[1];return zP(function(){o.value=n,o.getSnapshot=t,ac(o)&&s({inst:o})},[e,n,t]),FP(function(){return ac(o)&&s({inst:o}),e(function(){ac(o)&&s({inst:o})})},[e]),$P(n),n}function ac(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!MP(e,n)}catch{return!0}}function UP(e,t){return t()}var VP=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?UP:BP;Rw.useSyncExternalStore=$o.useSyncExternalStore!==void 0?$o.useSyncExternalStore:VP;Aw.exports=Rw;var WP=Aw.exports;function HP(){return WP.useSyncExternalStore(KP,()=>!0,()=>!1)}function KP(){return()=>{}}var Hd="Avatar",[QP,xN]=Qr(Hd),[GP,_w]=QP(Hd),Iw=f.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,s]=f.useState("idle");return u.jsx(GP,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:s,children:u.jsx(ce.span,{...r,ref:t})})});Iw.displayName=Hd;var Ow="AvatarImage",Lw=f.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...s}=e,i=_w(Ow,n),a=qP(r,s),l=Ot(c=>{o(c),i.onImageLoadingStatusChange(c)});return Oe(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?u.jsx(ce.img,{...s,ref:t,src:r}):null});Lw.displayName=Ow;var Mw="AvatarFallback",Dw=f.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,s=_w(Mw,n),[i,a]=f.useState(r===void 0);return f.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),i&&s.imageLoadingStatus!=="loaded"?u.jsx(ce.span,{...o,ref:t}):null});Dw.displayName=Mw;function oh(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function qP(e,{referrerPolicy:t,crossOrigin:n}){const r=HP(),o=f.useRef(null),s=r?(o.current||(o.current=new window.Image),o.current):null,[i,a]=f.useState(()=>oh(s,e));return Oe(()=>{a(oh(s,e))},[s,e]),Oe(()=>{const l=m=>()=>{a(m)};if(!s)return;const c=l("loaded"),d=l("error");return s.addEventListener("load",c),s.addEventListener("error",d),t&&(s.referrerPolicy=t),typeof n=="string"&&(s.crossOrigin=n),()=>{s.removeEventListener("load",c),s.removeEventListener("error",d)}},[s,n,t]),i}var Fw=Iw,zw=Lw,$w=Dw;const Bw=f.forwardRef(({className:e,...t},n)=>u.jsx(Fw,{ref:n,className:he("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Bw.displayName=Fw.displayName;const Uw=f.forwardRef(({className:e,...t},n)=>u.jsx(zw,{ref:n,className:he("aspect-square h-full w-full",e),...t}));Uw.displayName=zw.displayName;const Vw=f.forwardRef(({className:e,...t},n)=>u.jsx($w,{ref:n,className:he("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Vw.displayName=$w.displayName;const Ww=async e=>{if(!e)return[];const t=`${gt()}/event/get_event_media?event_id=${encodeURIComponent(e)}`;try{const{apiFetch:n}=await Le(async()=>{const{apiFetch:i}=await Promise.resolve().then(()=>lt);return{apiFetch:i}},void 0),r=await n(t,{method:"GET",headers:{"Content-Type":"application/json"}});if(!r.ok)throw new Error("Fehler beim Laden der Event Bilder!");const o=await r.json();let s=[];if(Array.isArray(o)&&o.length>0&&typeof o[0].output=="string")try{s=JSON.parse(o[0].output).map((a,l)=>{var c;return{id:((c=a.id)==null?void 0:c.toString())||`remote-${l}`,url:a.url||a.file_url}})}catch(i){console.error("Fehler beim Parsen von data[0].output:",i)}else Array.isArray(o)&&(s=o.map((i,a)=>{var l;return{id:((l=i.id)==null?void 0:l.toString())||`remote-${a}`,url:i.url||i.file_url}}));return s}catch(n){return console.error("Fehler beim Laden der Event Bilder",n),[]}},Hw=async e=>{try{const{apiFetch:t}=await Le(async()=>{const{apiFetch:r}=await Promise.resolve().then(()=>lt);return{apiFetch:r}},void 0),n=await t(`${gt()}/socialmedia/post2event`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(t){return console.error("Error generating social media posts:",t),null}},Su=async({postId:e,posts:t,images:n,scheduledTime:r})=>{try{const{apiFetch:o}=await Le(async()=>{const{apiFetch:i}=await Promise.resolve().then(()=>lt);return{apiFetch:i}},void 0),s=await o(`${gt()}/socialmedia/publish_post`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({postId:e,posts:t,images:n,scheduledTime:r})});if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return await s.json()}catch(o){return console.error("Error publishing social media post:",o),null}},Kw=async e=>{console.log("Uploading audio for speech-to-text");const t=new FormData;t.append("file",e);for(let[n,r]of t.entries())console.log(n,r);try{const{apiFetch:n}=await Le(async()=>{const{apiFetch:s}=await Promise.resolve().then(()=>lt);return{apiFetch:s}},void 0),r=await n(`${gt()}/tools/speech2text`,{method:"POST",body:t});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);const o=await r.json();return{success:!0,message:"Transcription successful",transcription:o.transcription||o.text||o.result||"",...o}}catch(n){return console.error("Error transcribing audio:",n),{success:!1,message:n instanceof Error?n.message:"Failed to transcribe audio"}}},Oi=["LinkedIn","Twitter","Facebook","Instagram"],YP=({className:e="w-5 h-5 sm:w-6 sm:h-6"})=>u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("path",{d:"M12 1.75a3.25 3.25 0 013.25 3.25v6a3.25 3.25 0 11-6.5 0v-6A3.25 3.25 0 0112 1.75z"}),u.jsx("path",{d:"M5.75 11.75a6.25 6.25 0 0012.5 0"}),u.jsx("path",{d:"M12 18v4"}),u.jsx("path",{d:"M8 22h8"})]}),Qw=({eventId:e,onComplete:t,images:n=[],participants:r=[],onFetchEventImages:o,onUploadEventFile:s,onGenerateSocialPosts:i,onPublishSocialPost:a,onSpeechToText:l})=>{const[c,d]=f.useState("media"),[m,y]=f.useState(n),[p,b]=f.useState(n),[g,x]=f.useState([]),[v,h]=f.useState(""),[w,S]=f.useState([]),[C,k]=f.useState(Oi),[E,j]=f.useState(!1),[_,R]=f.useState(!1),[U,F]=f.useState(""),[q,L]=f.useState(null),[G,V]=f.useState({}),[K,T]=f.useState("de"),[P,$]=f.useState(""),Y=[{code:"de",label:"Deutsch"},{code:"en",label:"Englisch"},{code:"es",label:"Spanisch"}],[H,X]=f.useState(!1),[Q,fe]=f.useState(null),[ue,z]=f.useState(!1),ne=f.useRef(null),ve=f.useRef([]),se=f.useRef(null),[re,oe]=f.useState(null),xe=(M,N)=>{M.stopPropagation(),oe(N)},Fe=(M,N)=>{N.stopPropagation(),x(D=>D.includes(M)?D.filter(B=>B!==M):[...D,M])},Lt=g.length>0&&v.trim().length>0,vt=f.useMemo(()=>[...m,...p].filter(M=>g.includes(M.id)),[m,p,g]);f.useEffect(()=>{(async()=>{try{const N=o?await o(e):await Ww(e);if(N){const D=Array.isArray(N)?N.map((B,ae)=>{var ee;return typeof B=="string"?{id:`remote-${ae}`,url:B}:{id:((ee=B.id)==null?void 0:ee.toString())||`remote-${ae}`,url:B.url||B.file_url}}):N;y(D)}}catch(N){console.error("Fehler beim Laden der Event Bilder",N)}})()},[e,o]),f.useEffect(()=>{n&&b(M=>{const N=new Map;for(const B of M)N.set(B.id,B);for(const B of n)N.set(B.id,B);const D=Array.from(N.values());return D.length===M.length&&D.every((B,ae)=>B.id===M[ae].id&&B.url===M[ae].url)?M:D})},[n]);const Mt=async()=>{fe(null),z(!1);try{const M=await navigator.mediaDevices.getUserMedia({audio:!0}),N=new MediaRecorder(M);ne.current=N,ve.current=[],N.ondataavailable=D=>{D.data.size>0&&ve.current.push(D.data)},N.onstop=async()=>{z(!0);const D=new Blob(ve.current,{type:"audio/webm"});fe(D);try{const B=new File([D],`voice_${Date.now()}.webm`,{type:"audio/webm"}),ae=l?await l(B):await Kw(B);ae.success&&ae.transcription&&h(ee=>ee?`${ee} ${ae.transcription}`:ae.transcription)}catch(B){console.error("Error converting speech to text:",B)}finally{z(!1)}},N.start(),X(!0)}catch(M){console.error("Error accessing microphone:",M),alert("Konnte nicht auf das Mikrofon zugreifen.")}},yn=()=>{ne.current&&H&&(ne.current.stop(),X(!1))};f.useEffect(()=>()=>{if(Q){const M=URL.createObjectURL(Q);URL.revokeObjectURL(M)}},[Q]);const nn=()=>{var M;return(M=se.current)==null?void 0:M.click()},Gr=async M=>{if(M.target.files&&M.target.files[0]){const N=M.target.files[0];if(!N.type.startsWith("image/")){alert("Nur Bilddateien erlaubt.");return}if(N.size===0){alert("Datei ist leer (0 Bytes).");return}const D=s?await s(N,String(e)):await gw(N,String(e));if(D.success&&(D.url||D.fileUrl)){const B=D.url||D.fileUrl,ae={id:D.id||`up-${Date.now()}`,url:B};b(ee=>[...ee,ae]),x(ee=>[...ee,ae.id])}}M.target.value=""},wn=async()=>{var M,N,D;j(!0),L(null);try{const B={eventId:e,images:g.map(Ln=>{var Ue;return(Ue=[...m,...p].find(Ve=>Ve.id===Ln))==null?void 0:Ue.id}).filter(Boolean),description:v,participants:w.map(Ln=>{var Ue;return(Ue=r.find(Ve=>Ve.id===Ln))==null?void 0:Ue.name}).filter(Boolean),channels:Oi},ae=i?await i(B):await Hw(B),ee=Array.isArray(ae)?ae[0]:ae,et=ee!=null&&ee.output?ee.output:ee,tt={de:{},en:{},es:{}};for(const Ln of Oi){const Ue=Ln.toLowerCase(),Ve=et==null?void 0:et[Ue];Array.isArray(Ve)&&((M=Ve[0])!=null&&M.text)&&Ve[0].text[0]?(tt.de[Ue]=Ve[0].text[0].de||"",tt.en[Ue]=Ve[0].text[0].en||"",tt.es[Ue]=Ve[0].text[0].es||""):(tt.de[Ue]="",tt.en[Ue]="",tt.es[Ue]="")}$((ee==null?void 0:ee.id)||(ee==null?void 0:ee.postId)||((N=ee==null?void 0:ee.data)==null?void 0:N.id)||((D=ee==null?void 0:ee.data)==null?void 0:D.postId)||""),L(tt),V(tt),d("review")}catch(B){console.error("Error generating posts",B),d("media")}finally{j(!1)}},qr=async()=>{if(!_){R(!0);try{if(!P)return;const M=a?await a({postId:P,posts:G,images:g,scheduledTime:new Date().toISOString()}):await Su({postId:P,posts:G,images:g,scheduledTime:new Date().toISOString()});(M==null?void 0:M.status)==="sucess"&&t()}finally{R(!1)}}},Dt=async()=>{if(!_){R(!0);try{if(!U||!P)return;const M=a?await a({postId:P,posts:G,images:g,scheduledTime:U}):await Su({postId:P,posts:G,images:g,scheduledTime:U});(M==null?void 0:M.status)==="sucess"&&t()}finally{R(!1)}}};return u.jsxs(u.Fragment,{children:[u.jsxs(Qo,{className:"w-full max-w-4xl mx-auto",children:[u.jsx(Go,{children:u.jsxs(qo,{children:["Quick Post für Event #",String(e)]})}),u.jsxs(ri,{children:[c==="media"&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex justify-between items-center mb-2",children:[u.jsx("div",{className:"font-semibold",children:"Bilder aus diesem Event"}),[...m,...p].length>0&&u.jsxs("span",{className:"text-sm text-muted-foreground",children:[g.length," ",g.length===1?"Bild":"Bilder"," ausgewählt"]})]}),u.jsx("div",{className:"grid grid-cols-4 sm:grid-cols-6 gap-2 mb-3",children:m.length>0?m.map(M=>{const N=g.includes(M.id);return u.jsxs("div",{onClick:D=>xe(D,M.url),className:`relative group rounded-md overflow-hidden border-2 cursor-pointer transition-all ${N?"border-primary ring-2 ring-primary":"border-transparent hover:border-muted-foreground/30"} aspect-square`,children:[u.jsx("img",{src:M.url,alt:"Event",className:"absolute inset-0 w-full h-full object-cover"}),u.jsx("div",{onClick:D=>Fe(M.id,D),className:`absolute top-1 right-1 w-5 h-5 rounded flex items-center justify-center transition-colors ${N?"bg-primary text-primary-foreground":"bg-background/90 text-foreground/50 hover:bg-background/80 hover:text-foreground/70"}`,children:N&&u.jsx($s,{className:"h-3.5 w-3.5"})})]},M.id)}):u.jsx("div",{className:"col-span-full text-center py-4 text-sm text-muted-foreground",children:"Keine Bilder in diesem Event vorhanden."})}),u.jsx("div",{className:"font-semibold mb-1",children:"Bilder aus dieser Session"}),u.jsxs("div",{className:"flex flex-wrap gap-2 mb-2 items-center",children:[u.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:nn,className:"h-16 w-16 flex items-center justify-center p-0 text-xl",title:"Bild hochladen",children:"+"}),u.jsx("input",{type:"file",accept:"image/*",ref:se,style:{display:"none"},onChange:Gr}),p.length===0&&u.jsx("span",{className:"text-xs text-muted-foreground",children:"Keine Bilder in dieser Session."}),u.jsx("div",{className:"grid grid-cols-4 sm:grid-cols-6 gap-2 flex-1 min-w-full",children:p.map(M=>{const N=g.includes(M.id);return u.jsxs("div",{onClick:D=>xe(D,M.url),className:`relative group rounded-md overflow-hidden border-2 cursor-pointer transition-all ${N?"border-primary ring-2 ring-primary":"border-transparent hover:border-muted-foreground/30"} aspect-square`,children:[u.jsx("img",{src:M.url,alt:"Session",className:"absolute inset-0 w-full h-full object-cover"}),u.jsx("div",{onClick:D=>Fe(M.id,D),className:`absolute top-1 right-1 w-5 h-5 rounded flex items-center justify-center transition-colors ${N?"bg-primary text-primary-foreground":"bg-background/90 text-foreground/50 hover:bg-background/80 hover:text-foreground/70"}`,children:N&&u.jsx($s,{className:"h-3.5 w-3.5"})})]},M.id)})})]}),u.jsx("div",{className:"font-semibold mb-1 mt-2",children:"Wer ist dabei?"}),u.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:r.map(M=>u.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[u.jsx(jw,{checked:w.includes(M.id),onCheckedChange:()=>S(N=>N.includes(M.id)?N.filter(D=>D!==M.id):[...N,M.id])}),u.jsx(Bw,{className:"w-6 h-6",children:M.avatar?u.jsx(Uw,{src:M.avatar,alt:M.name}):u.jsx(Vw,{children:M.name[0]})}),u.jsx("span",{className:"text-xs",children:M.name})]},M.id))}),u.jsx("div",{className:"font-semibold mb-1 mt-2",children:"Situation beschreiben"}),u.jsxs("div",{className:"relative mb-2",children:[u.jsx(Qs,{value:v,onChange:M=>h(M.target.value),rows:3,placeholder:"Was passiert auf dem Foto? Wer ist zu sehen?",disabled:ue,className:`pr-10 ${ue?"opacity-60 cursor-not-allowed":""}`}),u.jsx("button",{type:"button",onClick:H?yn:Mt,disabled:ue,className:`absolute bottom-2 right-2 focus:outline-none ${ue?"cursor-wait":"cursor-pointer"}`,title:H?"Aufnahme stoppen":"Aufnahme starten",children:ue?u.jsxs("svg",{className:"animate-spin h-5 w-5 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[u.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),u.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):H?u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 text-red-600",viewBox:"0 0 24 24",fill:"currentColor",children:u.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}):u.jsx(YP,{})})]}),u.jsx("div",{className:"flex justify-end",children:u.jsx(me,{onClick:async()=>{d("loading"),await wn()},disabled:!Lt||E,children:"Vorschläge generieren"})})]}),c==="loading"&&u.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[u.jsx(Yi,{className:"h-8 w-8 animate-spin text-primary mb-4"}),u.jsx("p",{className:"text-muted-foreground",children:"Bitte warten, Beiträge werden generiert..."})]}),c==="review"&&u.jsxs("div",{className:"space-y-4",children:[u.jsx("div",{className:"text-sm text-muted-foreground",children:"Vorschau"}),u.jsxs("div",{className:"rounded-lg border p-4",children:[u.jsx("div",{className:"text-sm font-medium mb-2",children:"Beschreibung"}),u.jsx("div",{className:"text-sm whitespace-pre-wrap",children:v}),vt.length>0&&u.jsx("div",{className:"mt-4 flex gap-2 overflow-x-auto",children:vt.map(M=>u.jsx("img",{src:M.url,className:"h-20 rounded border object-cover"},M.id))})]}),q&&u.jsxs("div",{className:"mt-4",children:[u.jsx("div",{className:"font-semibold text-sm sm:text-base mb-2",children:"KI-Vorschläge für Social Media:"}),u.jsx("div",{className:"flex gap-2 mb-3",children:Y.map(M=>u.jsx("button",{className:`px-2 py-1 rounded text-xs sm:text-sm transition-colors duration-150 ${K===M.code?"bg-blue-500 text-white":"bg-gray-200 text-gray-700"}`,onClick:()=>T(M.code),type:"button",children:M.label},M.code))}),Oi.map(M=>{var N;return u.jsxs("div",{className:"mb-2",children:[u.jsxs("div",{className:"text-xs font-bold",children:[M,":"]}),u.jsx(Qs,{value:((N=G[K])==null?void 0:N[M.toLowerCase()])||"",onChange:D=>V(B=>({...B,[K]:{...B[K]||{},[M.toLowerCase()]:D.target.value}})),className:"text-xs bg-muted",rows:2})]},M)})]}),u.jsxs("div",{className:"flex justify-between",children:[u.jsx(me,{variant:"outline",onClick:()=>d("media"),children:"Zurück"}),u.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full sm:w-auto",children:[u.jsx(me,{type:"button",className:"w-full sm:w-auto",onClick:qr,disabled:_,children:"Sofort senden"}),u.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[u.jsx("input",{type:"datetime-local",value:U,onChange:M=>F(M.target.value),className:"border rounded px-2 py-1 w-full sm:w-auto text-xs"}),u.jsx(me,{variant:"outline",className:"w-full",onClick:Dt,disabled:_||!U,children:"Später posten"})]})]})]})]})]})]}),re&&u.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-50 p-4",onClick:()=>oe(null),children:u.jsxs("div",{className:"relative max-w-4xl w-full max-h-[90vh]",children:[u.jsx("button",{className:"absolute -top-10 right-0 text-white hover:text-gray-300",onClick:M=>{M.stopPropagation(),oe(null)},children:u.jsx(Pa,{className:"w-6 h-6"})}),u.jsx("div",{className:"bg-background rounded-lg overflow-hidden",children:u.jsx("img",{src:re,alt:"Vorschau",className:"w-full h-auto max-h-[80vh] object-contain mx-auto",onClick:M=>M.stopPropagation()})})]})})]})},XP=({onComplete:e,events:t,loading:n,error:r,onReload:o})=>{const[s,i]=f.useState(null),[a,l]=f.useState(!1);f.useEffect(()=>{o()},[o]);const c=f.useMemo(()=>t.length?[...t].sort((p,b)=>{const g=p!=null&&p.begin_date?new Date(p.begin_date).getTime():0,x=b!=null&&b.begin_date?new Date(b.begin_date).getTime():0;return g-x}):[],[t]),d=f.useRef(null),m=f.useMemo(()=>{if(!c.length)return-1;const p=new Date;return c.findIndex(b=>{const g=b!=null&&b.begin_date?new Date(b.begin_date):null,x=b!=null&&b.end_date?new Date(b.end_date):null;return g&&x?g<=p&&p<=x:g&&!x?g<=p:!g&&x?p<=x:!1})},[c]);f.useEffect(()=>{m!==-1&&d.current&&d.current.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})},[m,c]);const y=p=>{if(!p)return"";const b=new Date(p);return Number.isNaN(b.getTime())?p:b.toLocaleDateString("de-DE",{day:"2-digit",month:"2-digit",year:"numeric"})};return u.jsxs(Qo,{className:"w-full mx-auto md:max-w-5xl",children:[u.jsx(Go,{children:u.jsx("div",{className:"flex items-center justify-between",children:u.jsx(qo,{children:"Veranstaltungen"})})}),u.jsx(ri,{children:s?u.jsxs("div",{className:"space-y-4",children:[u.jsx("div",{className:"flex items-center justify-between",children:u.jsx(me,{variant:"ghost",onClick:()=>i(null),children:"Zurück zur Timeline"})}),u.jsx(Qw,{eventId:s,onComplete:()=>i(null)})]}):n?u.jsx("div",{className:"text-sm text-muted-foreground py-10",children:"Events werden geladen..."}):r?u.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 px-4 py-3 text-sm text-destructive",children:r}):u.jsxs("div",{className:"space-y-6",children:[u.jsx("div",{className:"pb-2",children:u.jsxs("div",{className:"relative sm:min-h-[200px]",children:[u.jsx("div",{className:"hidden sm:block absolute left-0 right-0 top-1/2 h-px -translate-y-1/2 bg-muted-foreground/30"}),u.jsx("div",{className:"relative -mx-4 sm:mx-0 px-4 sm:px-0 overflow-x-auto py-4 sm:py-8",children:u.jsx("div",{className:"flex flex-row gap-4 sm:gap-6",children:c.map((p,b)=>{const g=b===m&&m!==-1;return u.jsxs("div",{ref:g?d:void 0,className:"flex w-[220px] sm:w-auto flex-shrink-0 sm:flex-shrink min-w-0 sm:min-w-[240px] flex-col items-stretch sm:items-center text-left sm:text-center cursor-pointer",onClick:()=>{const x=p.id??`${p.name||"event"}-${b}`;i(x)},children:[u.jsx("div",{className:`hidden sm:block h-3 w-3 rounded-full border-2 ${g?"border-primary bg-primary":"border-muted-foreground/40 bg-background"}`}),u.jsxs("div",{className:`mt-2 sm:mt-4 w-full rounded-lg border p-4 text-left transition-shadow ${g?"border-primary/60 shadow-lg":"border-border"}`,children:[u.jsx("div",{className:"text-sm font-semibold leading-tight line-clamp-2",children:p.name||"Unbenanntes Event"}),u.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:[y(p.begin_date)," – ",y(p.end_date)]}),p.location&&u.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["📍 ",p.location]}),p.description&&u.jsx("div",{className:"mt-3 text-xs text-muted-foreground line-clamp-3",children:p.description})]})]},p.id||`${p.name}-${b}`)})})})]})}),u.jsx("div",{className:"flex justify-center",children:u.jsx(me,{onClick:()=>l(!0),children:"Neu erstellen"})}),a&&u.jsx(AP,{onSuccess:async()=>{l(!1),o()},onCancel:()=>l(!1)})]})})]})},lc="auth_token",cc={getToken(){try{return localStorage.getItem(lc)}catch{return null}},setToken(e){try{localStorage.setItem(lc,e)}catch{}},clear(){try{localStorage.removeItem(lc)}catch{}}};async function ZP(){const e=`${gt()}/auth/rnjwt`,t=await fetch(e,{method:"GET",credentials:"include"});if(!t.ok)return null;try{const n=await t.json();return typeof(n==null?void 0:n.token)=="string"?n.token:null}catch{return null}}async function Gw(e,t={},n){const r=t.skipAuthHandling;let o=cc.getToken();const s={...t,credentials:"include",headers:{...t.headers||{},...o?{Authorization:`Bearer ${o}`}:{}}};let i=await fetch(e,s);if(i.status===401&&!r){const a=await ZP();if(a){cc.setToken(a);const l={...s,headers:{...s.headers||{},Authorization:`Bearer ${a}`}};if(i=await fetch(e,l),i.status!==401)return i}throw n&&n(),cc.clear(),new Error("Session abgelaufen. Bitte erneut einloggen.")}return i}function Kd(){const{logout:e}=ul();return f.useCallback((t,n={})=>Gw(t,n,e),[e])}const lt=Object.freeze(Object.defineProperty({__proto__:null,apiFetch:Gw,useApiFetch:Kd},Symbol.toStringTag,{value:"Module"})),JP=async e=>{const t=`${gt()}/events/get_current`;try{const n=await e(t,{method:"GET",headers:{"Content-Type":"application/json"}});if(!n.ok)throw new Error("Failed to fetch events");const r=await n.json();return Array.isArray(r)?r:r?[r]:[]}catch(n){throw console.error("Error fetching events:",n),n}},eN=async e=>{const t=`${gt()}/events`;try{const n=await e(t,{method:"GET",headers:{"Content-Type":"application/json"}});if(!n.ok)throw new Error("Failed to fetch events");const r=await n.json();return Array.isArray(r)?r:r?[r]:[]}catch(n){throw console.error("Error fetching events:",n),n}},tN=({onComplete:e})=>{const t=Kd(),[n,r]=f.useState([]),[o,s]=f.useState(!1),[i,a]=f.useState(null),l=f.useCallback(async()=>{s(!0),a(null);try{const c=await eN(t);r(Array.isArray(c)?c:[])}catch(c){const d=(c==null?void 0:c.message)||"Fehler beim Laden der Veranstaltungen";a(d),ze.error(d)}finally{s(!1)}},[t]);return u.jsx(XP,{onComplete:e,events:n,loading:o,error:i,onReload:l})},nN=({eventId:e,onComplete:t})=>{const n=async a=>{try{const l=await Ww(a);return Array.isArray(l)?l:[]}catch{return ze.error("Fehler beim Laden der Event Bilder"),[]}},r=async(a,l)=>{try{const c=await gw(a,l);return c.success||ze.error(c.message||"Upload fehlgeschlagen"),c}catch(c){return ze.error((c==null?void 0:c.message)||"Upload fehlgeschlagen"),{success:!1,message:(c==null?void 0:c.message)||"Upload fehlgeschlagen"}}},o=async a=>{try{const l=await Hw(a);if(!l)throw new Error("Keine Antwort");return l}catch(l){throw ze.error("Fehler beim Generieren"),l}},s=async a=>{try{const l=await Su(a);return(l==null?void 0:l.status)==="sucess"?ze.success(a.scheduledTime?"Erfolgreich geplant!":"Erfolgreich veröffentlicht!"):ze.error("Fehler beim Senden!"),l}catch(l){throw ze.error("Fehler beim Senden!"),l}},i=async a=>{try{const l=await Kw(a);return l.success||ze.error(l.message||"Transkription fehlgeschlagen"),l}catch(l){return ze.error((l==null?void 0:l.message)||"Transkription fehlgeschlagen"),{success:!1,message:(l==null?void 0:l.message)||"Transkription fehlgeschlagen"}}};return u.jsx(Qw,{eventId:e,onComplete:t,onFetchEventImages:n,onUploadEventFile:r,onGenerateSocialPosts:o,onPublishSocialPost:s,onSpeechToText:i})},rN=({title:e,description:t,onClick:n,illustration:r})=>u.jsxs(Qo,{className:"hover:shadow-md transition-shadow cursor-pointer h-full relative overflow-hidden",onClick:n,children:[u.jsx("div",{className:"pointer-events-none absolute -left-20 -top-20 h-56 w-56 rounded-full bg-gradient-to-br from-primary/25 via-primary/10 to-transparent blur-3xl"}),r&&u.jsx("div",{className:"hidden md:block pointer-events-none absolute inset-0",style:{backgroundImage:`url(${r})`,backgroundRepeat:"no-repeat",backgroundPosition:"right bottom",backgroundSize:"auto 80%",opacity:.9,filter:"drop-shadow(0 8px 16px rgba(0,0,0,0.15))"}}),u.jsxs(Go,{className:"pb-2 pr-6 relative z-10",children:[u.jsx("div",{className:"flex items-center",children:u.jsx(qo,{className:"text-lg",children:e})}),u.jsx(hy,{className:"text-sm",children:t})]}),r&&u.jsx("div",{className:"md:hidden px-6 pb-4 relative z-10",children:u.jsx("img",{src:r,alt:"",className:"mt-2 w-full h-auto object-contain"})})]}),oN=({onActionClick:e,hasActiveEvent:t,currentEvent:n})=>{const[r,o]=f.useState(null),s=f.useCallback(()=>{o("event")},[]),i=!!((n==null?void 0:n.id)??(n==null?void 0:n._id)??(n==null?void 0:n.uuid)),l=n!=null&&n.image&&String(n.image).trim()!==""?n.image:"/default_event.png",c=[{id:"event",title:"Veranstaltung",description:"Verwalte deine Veranstaltungen",illustration:"/images/robo/robo_event.png",onClick:s},{id:"blog",title:"Blog",description:"Erstelle und verwalte Blogbeiträge",illustration:"/images/robo/robo_blogauthor.png",onClick:()=>o("blog")},...i&&n?[{id:"quick-post",title:n.name,description:n.description||"Aktuelles Event",illustration:l,onClick:()=>o("quick-post")}]:[]],d=()=>{if(r==="blog")return u.jsxs("div",{className:"space-y-6",children:[u.jsxs(me,{variant:"ghost",className:"mb-4",onClick:()=>o(null),children:[u.jsx(qi,{className:"mr-2 h-4 w-4"}),"Zurück zur Übersicht"]}),u.jsx(TP,{onComplete:()=>o(null)})]});if(r==="event")return u.jsxs("div",{className:"space-y-6",children:[u.jsxs(me,{variant:"ghost",className:"mb-4",onClick:()=>o(null),children:[u.jsx(qi,{className:"mr-2 h-4 w-4"}),"Zurück zur Übersicht"]}),u.jsx(tN,{onComplete:()=>o(null)})]});if(r==="quick-post"&&n){const m=n.id??(n==null?void 0:n._id)??(n==null?void 0:n.uuid)??"";return u.jsxs("div",{className:"space-y-6",children:[u.jsxs(me,{variant:"ghost",className:"mb-4",onClick:()=>o(null),children:[u.jsx(qi,{className:"mr-2 h-4 w-4"}),"Zurück zur Übersicht"]}),u.jsx(nN,{eventId:m,onComplete:()=>o(null)})]})}return u.jsxs("div",{className:"space-y-6",children:[u.jsx("div",{className:"flex items-center justify-between",children:u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Willkommen zurück"}),u.jsx("p",{className:"text-muted-foreground",children:"Was möchtest du heute tun?"})]})}),u.jsx("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-2",children:c.map(m=>u.jsx(rN,{title:m.title,description:m.description,onClick:m.onClick,illustration:m.illustration},m.id))})]})};return u.jsx("div",{className:"p-6",children:d()})},sN=oN,iN=({onActionClick:e,hasActiveEvent:t})=>{const n=Kd(),[r,o]=f.useState(null);return f.useEffect(()=>{let s=!0;return(async()=>{try{const i=await JP(n);if(!s)return;const l=(Array.isArray(i)?i:[]).find(c=>c&&(c.id??c._id??c.uuid))||null;o(l)}catch{if(!s)return;o(null)}})(),()=>{s=!1}},[n]),u.jsx(sN,{onActionClick:e,hasActiveEvent:t,currentEvent:r})},aN=()=>{var l;const{user:e,logout:t}=ul(),n=iy(),[r,o]=f.useState(!1),[s,i]=f.useState(!1);f.useEffect(()=>{(async()=>{try{o(!1)}catch(d){console.error("Error checking active events:",d)}})()},[]);const a=c=>{console.log("Selected action:",c)};return u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx("header",{className:"sticky top-0 z-40 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:u.jsxs("div",{className:"container flex h-16 items-center justify-between px-4",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(me,{variant:"ghost",size:"icon",className:"md:hidden",onClick:()=>i(!s),children:[u.jsx(NS,{className:"h-5 w-5"}),u.jsx("span",{className:"sr-only",children:"Toggle menu"})]}),u.jsx("div",{className:"flex items-center gap-2 cursor-pointer",onClick:()=>n("/"),children:u.jsx("img",{src:"/Logo.png",alt:"Logo",className:"h-10 w-auto object-contain"})})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("div",{className:"hidden md:block text-sm text-muted-foreground",children:["Hallo, ",((l=e==null?void 0:e.name)==null?void 0:l.split(" ")[0])||"Benutzer"]}),u.jsxs(me,{variant:"outline",size:"sm",className:"gap-1.5 text-sm",onClick:t,children:[u.jsx(PS,{className:"h-4 w-4"}),u.jsx("span",{className:"hidden sm:inline",children:"Abmelden"})]})]})]})}),u.jsx("main",{className:"container py-6 px-0 md:px-4",children:u.jsx("div",{className:"mx-auto md:max-w-5xl",children:u.jsx(iN,{onActionClick:a,hasActiveEvent:r})})})]})},lN=({onSubmit:e,isLoading:t,defaultEmail:n,defaultPassword:r})=>{const[o,s]=f.useState(n??""),[i,a]=f.useState(r??""),[l,c]=f.useState(t??!1),d=async m=>{m.preventDefault(),c(!0);try{await(e==null?void 0:e(o,i))}finally{c(!1)}};return u.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-primary/20 to-secondary/20",children:u.jsxs(Qo,{className:"w-full max-w-md",children:[u.jsxs(Go,{children:[u.jsx("img",{src:"/Logo.png",alt:"Logo",className:"mx-auto mb-2 h-24 w-40 object-contain"}),u.jsx(qo,{className:"text-2xl font-bold text-center",children:"Sign in to your AI Assistant"})]}),u.jsx(ri,{children:u.jsxs("form",{onSubmit:d,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(He,{htmlFor:"email",children:"Email"}),u.jsx(ut,{id:"email",type:"email",placeholder:"Enter your email",value:o,onChange:m=>s(m.target.value),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(He,{htmlFor:"password",children:"Password"}),u.jsx(ut,{id:"password",type:"password",placeholder:"Enter your password",value:i,onChange:m=>a(m.target.value),required:!0})]}),u.jsx(me,{type:"submit",className:"w-full",disabled:l,children:l?"Signing in...":"Sign In"})]})})]})})},cN=()=>{const{toast:e}=Ng(),t=iy(),{login:n,isLoading:r}=ul(),o=async(s,i)=>{if(!s||!i){e({title:"Error",description:"Please fill in all fields",variant:"destructive"});return}try{await n(s,i),t("/dashboard")}catch(a){e({title:"Login fehlgeschlagen",description:(a==null?void 0:a.message)||"Unbekannter Fehler",variant:"destructive"})}};return u.jsx(lN,{onSubmit:o,isLoading:r,defaultEmail:"sokolowski.android@gmail.com",defaultPassword:"Time2work"})},uN=new ZE,dN=()=>{const{user:e}=ul();return e?u.jsx(aN,{}):u.jsx(cN,{})},fN=()=>u.jsx(Dk,{children:u.jsx(ek,{client:uN,children:u.jsx(NE,{children:u.jsx($k,{children:u.jsxs(Bk,{children:[u.jsx(d1,{}),u.jsx(V1,{}),u.jsx(Ek,{children:u.jsx(dN,{})})]})})})})});Pg(document.getElementById("root")).render(u.jsx(fN,{}));