vendor: 6,789 bytes, lines 1-9
1function yk(e,r){for(var i=0;i<r.length;i++){const n=r[i];if(typeof n!="string"&&!Array.isArray(n)){for(const o in n)if(o!=="default"&&!(o in e)){const a=Object.getOwnPropertyDescriptor(n,o);a&&Object.defineProperty(e,o,a.get?a:{enumerable:!0,get:()=>n[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function i(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(o){if(o.ep)return;o.ep=!0;const a=i(o);fetch(o.href,a)}})();const bk="modulepreload",vk=function(e){return"/"+e},O5={},Wr=function(r,i,n){let o=Promise.resolve();if(i&&i.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),d=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));o=Promise.allSettled(i.map(p=>{if(p=vk(p),p in O5)return;O5[p]=!0;const u=p.endsWith(".css"),g=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":bk,u||(h.as="script"),h.crossOrigin="",h.href=p,d&&h.setAttribute("nonce",d),document.head.appendChild(h),u)return new Promise((x,y)=>{h.addEventListener("load",x),h.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${p}`)))})}))}function a(l){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=l,window.dispatchEvent(d),!d.defaultPrevented)throw l}return o.then(l=>{for(const d of l||[])d.status==="rejected"&&a(d.reason);return r().catch(a)})};var jk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function C1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var z1={exports:{}},Th={},E1={exports:{}},Kt={};/** 2 * @license React 3 * react.production.min.js 4 * 5 * Copyright (c) Facebook, Inc. and its affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var dp=Symbol.for("react.element"),wk=Symbol.for("react.portal"),_k=Symbol.for("react.fragment"),Sk=Symbol.for("react.strict_mode"),kk=Symbol.for("react.profiler"),Ck=Symbol.for("react.provider"),zk=Symbol.for("react.context"),Ek=Symbol.for("react.forward_ref"),Rk=Symbol.for("react.suspense"),Ik=Symbol.for("react.memo"),Tk=Symbol.for("react.lazy"),L5=Symbol.iterator;function Ak(e){return e===null||typeof e!="object"?null:(e=L5&&e[L5]||e["@@iterator"],typeof e=="function"?e:null)}var R1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I1=Object.assign,T1={};function kd(e,r,i){this.props=e,this.context=r,this.refs=T1,this.updater=i||R1}kd.prototype.isReactComponent={};kd.prototype.setState=function(e,r){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,r,"setState")};kd.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function A1(){}A1.prototype=kd.prototype;function yx(e,r,i){this.props=e,this.context=r,this.refs=T1,this.updater=i||R1}var bx=yx.prototype=new A1;bx.constructor=yx;I1(bx,kd.prototype);bx.isPureReactComponent=!0;var $5=Array.isArray,P1=Object.prototype.hasOwnProperty,vx={current:null},F1={key:!0,ref:!0,__self:!0,__source:!0};function M1(e,r,i){var n,o={},a=null,l=null;if(r!=null)for(n in r.ref!==void 0&&(l=r.ref),r.key!==void 0&&(a=""+r.key),r)P1.call(r,n)&&!F1.hasOwnProperty(n)&&(o[n]=r[n]);var d=arguments.length-2;if(d===1)o.children=i;else if(1<d){for(var p=Array(d),u=0;u<d;u++)p[u]=arguments[u+2];o.children=p}if(e&&e.defaultProps)for(n in d=e.defaultProps,d)o[n]===void 0&&(o[n]=d[n]);return{$$typeof:dp,type:e,key:a,ref:l,props:o,_owner:vx.current}}function Pk(e,r){return{$$typeof:dp,type:e.type,key:r,ref:e.ref,props:e.props,_owner:e._owner}}function jx(e){return typeof e=="object"&&e!==null&&e.$$typeof===dp}function Fk(e){var r={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(i){return r[i]})}var W5=/\/+/g;function E0(e,r){return typeof e=="object"&&e!==null&&e.key!=null?Fk(""+e.key):r.toString(36)}function gu(e,r,i,n,o){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case dp:case wk:l=!0}}if(l)return l=e,o=o(l),e=n===""?"."+E0(l,0):n,$5(o)?(i="",e!=null&&(i=e.replace(W5,"$&/")+"/"),gu(o,r,i,"",function(u){return u})):o!=null&&(jx(o)&&(o=Pk(o,i+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(W5,"$&/")+"/")+e)),r.push(o)),1;if(l=0,n=n===""?".":n+":",$5(e))for(var d=0;d<e.length;d++){a=e[d];var p=n+E0(a,d);l+=gu(a,r,i,p,o)}else if(p=Ak(e),typeof p=="function")for(e=p.call(e),d=0;!(a=e.next()).done;)a=a.value,p=n+E0(a,d++),l+=gu(a,r,i,p,o);else if(a==="object")throw r=String(e),Error("Objects are not valid as a React child (found: "+(r==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.");return l}function $p(e,r,i){if(e==null)return e;var n=[],o=0;return gu(e,n,"","",function(a){return r.call(i,a,o++)}),n}function Mk(e){if(e._status===-1){var r=e._result;r=r(),r.then(function(i){(e._status===0||e._status===-1)&&(e._status=1,e._result=i)},function(i){(e._status===0||e._status===-1)&&(e._status=2,e._result=i)}),e._status===-1&&(e._status=0,e._result=r)}if(e._status===1)return e._result.default;throw e._result}var nn={current:null},fu={transition:null},Dk={ReactCurrentDispatcher:nn,ReactCurrentBatchConfig:fu,ReactCurrentOwner:vx};function D1(){throw Error("act(...) is not supported in production builds of React.")}Kt.Children={map:$p,forEach:function(e,r,i){$p(e,function(){r.apply(this,arguments)},i)},count:function(e){var r=0;return $p(e,function(){r++}),r},toArray:function(e){return $p(e,function(r){return r})||[]},only:function(e){if(!jx(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Kt.Component=kd;Kt.Fragment=_k;Kt.Profiler=kk;Kt.PureComponent=yx;Kt.StrictMode=Sk;Kt.Suspense=Rk;
vendor: 8,669 bytes, lines 9-33
9Kt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Dk;Kt.act=D1;Kt.cloneElement=function(e,r,i){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=I1({},e.props),o=e.key,a=e.ref,l=e._owner;if(r!=null){if(r.ref!==void 0&&(a=r.ref,l=vx.current),r.key!==void 0&&(o=""+r.key),e.type&&e.type.defaultProps)var d=e.type.defaultProps;for(p in r)P1.call(r,p)&&!F1.hasOwnProperty(p)&&(n[p]=r[p]===void 0&&d!==void 0?d[p]:r[p])}var p=arguments.length-2;if(p===1)n.children=i;else if(1<p){d=Array(p);for(var u=0;u<p;u++)d[u]=arguments[u+2];n.children=d}return{$$typeof:dp,type:e.type,key:o,ref:a,props:n,_owner:l}};Kt.createContext=function(e){return e={$$typeof:zk,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Ck,_context:e},e.Consumer=e};Kt.createElement=M1;Kt.createFactory=function(e){var r=M1.bind(null,e);return r.type=e,r};Kt.createRef=function(){return{current:null}};Kt.forwardRef=function(e){return{$$typeof:Ek,render:e}};Kt.isValidElement=jx;Kt.lazy=function(e){return{$$typeof:Tk,_payload:{_status:-1,_result:e},_init:Mk}};Kt.memo=function(e,r){return{$$typeof:Ik,type:e,compare:r===void 0?null:r}};Kt.startTransition=function(e){var r=fu.transition;fu.transition={};try{e()}finally{fu.transition=r}};Kt.unstable_act=D1;Kt.useCallback=function(e,r){return nn.current.useCallback(e,r)};Kt.useContext=function(e){return nn.current.useContext(e)};Kt.useDebugValue=function(){};Kt.useDeferredValue=function(e){return nn.current.useDeferredValue(e)};Kt.useEffect=function(e,r){return nn.current.useEffect(e,r)};Kt.useId=function(){return nn.current.useId()};Kt.useImperativeHandle=function(e,r,i){return nn.current.useImperativeHandle(e,r,i)};Kt.useInsertionEffect=function(e,r){return nn.current.useInsertionEffect(e,r)};Kt.useLayoutEffect=function(e,r){return nn.current.useLayoutEffect(e,r)};Kt.useMemo=function(e,r){return nn.current.useMemo(e,r)};Kt.useReducer=function(e,r,i){return nn.current.useReducer(e,r,i)};Kt.useRef=function(e){return nn.current.useRef(e)};Kt.useState=function(e){return nn.current.useState(e)};Kt.useSyncExternalStore=function(e,r,i){return nn.current.useSyncExternalStore(e,r,i)};Kt.useTransition=function(){return nn.current.useTransition()};Kt.version="18.3.1";E1.exports=Kt;var m=E1.exports;const Tr=C1(m),Bk=yk({__proto__:null,default:Tr},[m]);/** 10 * @license React 11 * react-jsx-runtime.production.min.js 12 * 13 * Copyright (c) Facebook, Inc. and its affiliates. 14 * 15 * This source code is licensed under the MIT license found in the 16 * LICENSE file in the root directory of this source tree. 17 */var Ok=m,Lk=Symbol.for("react.element"),$k=Symbol.for("react.fragment"),Wk=Object.prototype.hasOwnProperty,Nk=Ok.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Uk={key:!0,ref:!0,__self:!0,__source:!0};function B1(e,r,i){var n,o={},a=null,l=null;i!==void 0&&(a=""+i),r.key!==void 0&&(a=""+r.key),r.ref!==void 0&&(l=r.ref);for(n in r)Wk.call(r,n)&&!Uk.hasOwnProperty(n)&&(o[n]=r[n]);if(e&&e.defaultProps)for(n in r=e.defaultProps,r)o[n]===void 0&&(o[n]=r[n]);return{$$typeof:Lk,type:e,key:a,ref:l,props:o,_owner:Nk.current}}Th.Fragment=$k;Th.jsx=B1;Th.jsxs=B1;z1.exports=Th;var t=z1.exports,Ig={},O1={exports:{}},Mn={},L1={exports:{}},$1={};/** 18 * @license React 19 * scheduler.production.min.js 20 * 21 * Copyright (c) Facebook, Inc. and its affiliates. 22 * 23 * This source code is licensed under the MIT license found in the 24 * LICENSE file in the root directory of this source tree. 25 */(function(e){function r(G,le){var F=G.length;G.push(le);e:for(;0<F;){var A=F-1>>>1,M=G[A];if(0<o(M,le))G[A]=le,G[F]=M,F=A;else break e}}function i(G){return G.length===0?null:G[0]}function n(G){if(G.length===0)return null;var le=G[0],F=G.pop();if(F!==le){G[0]=F;e:for(var A=0,M=G.length,V=M>>>1;A<V;){var H=2*(A+1)-1,N=G[H],Z=H+1,ae=G[Z];if(0>o(N,F))Z<M&&0>o(ae,N)?(G[A]=ae,G[Z]=F,A=Z):(G[A]=N,G[H]=F,A=H);else if(Z<M&&0>o(ae,F))G[A]=ae,G[Z]=F,A=Z;else break e}}return le}function o(G,le){var F=G.sortIndex-le.sortIndex;return F!==0?F:G.id-le.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,d=l.now();e.unstable_now=function(){return l.now()-d}}var p=[],u=[],g=1,h=null,x=3,y=!1,_=!1,S=!1,k=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function j(G){for(var le=i(u);le!==null;){if(le.callback===null)n(u);else if(le.startTime<=G)n(u),le.sortIndex=le.expirationTime,r(p,le);else break;le=i(u)}}function T(G){if(S=!1,j(G),!_)if(i(p)!==null)_=!0,Re(P);else{var le=i(u);le!==null&&Q(T,le.startTime-G)}}function P(G,le){_=!1,S&&(S=!1,w(O),O=-1),y=!0;var F=x;try{for(j(le),h=i(p);h!==null&&(!(h.expirationTime>le)||G&&!B());){var A=h.callback;if(typeof A=="function"){h.callback=null,x=h.priorityLevel;var M=A(h.expirationTime<=le);le=e.unstable_now(),typeof M=="function"?h.callback=M:h===i(p)&&n(p),j(le)}else n(p);h=i(p)}if(h!==null)var V=!0;else{var H=i(u);H!==null&&Q(T,H.startTime-le),V=!1}return V}finally{h=null,x=F,y=!1}}var I=!1,R=null,O=-1,E=5,$=-1;function B(){return!(e.unstable_now()-$<E)}function ee(){if(R!==null){var G=e.unstable_now();$=G;var le=!0;try{le=R(!0,G)}finally{le?te():(I=!1,R=null)}}else I=!1}var te;if(typeof b=="function")te=function(){b(ee)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,ne=K.port2;K.port1.onmessage=ee,te=function(){ne.postMessage(null)}}else te=function(){k(ee,0)};function Re(G){R=G,I||(I=!0,te())}function Q(G,le){O=k(function(){G(e.unstable_now())},le)}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(G){G.callback=null},e.unstable_continueExecution=function(){_||y||(_=!0,Re(P))},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return i(p)},e.unstable_next=function(G){switch(x){case 1:case 2:case 3:var le=3;break;default:le=x}var F=x;x=le;try{return G()}finally{x=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(G,le){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var F=x;x=G;try{return le()}finally{x=F}},e.unstable_scheduleCallback=function(G,le,F){var A=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?A+F:A):F=A,G){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=F+M,G={id:g++,callback:le,priorityLevel:G,startTime:F,expirationTime:M,sortIndex:-1},F>A?(G.sortIndex=F,r(u,G),i(p)===null&&G===i(u)&&(S?(w(O),O=-1):S=!0,Q(T,F-A))):(G.sortIndex=M,r(p,G),_||y||(_=!0,Re(P))),G},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(G){var le=x;return function(){var F=x;x=le;try{return G.apply(this,arguments)}finally{x=F}}}})($1);L1.exports=$1;var Vk=L1.exports;/** 26 * @license React 27 * react-dom.production.min.js 28 * 29 * Copyright (c) Facebook, Inc. and its affiliates. 30 * 31 * This source code is licensed under the MIT license found in the 32 * LICENSE file in the root directory of this source tree. 33 */var qk=m,Tn=Vk;function Ye(e){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)r+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var W1=new Set,Ec={};function nl(e,r){ld(e,r),ld(e+"Capture",r)}function ld(e,r){for(Ec[e]=r,e=0;e<r.length;e++)W1.add(r[e])}var ps=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Tg=Object.prototype.hasOwnProperty,Hk=/^[: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]*$/,N5={},U5={};
vendor: 4,394 bytes, line 33
33function Gk(e){return Tg.call(U5,e)?!0:Tg.call(N5,e)?!1:Hk.test(e)?U5[e]=!0:(N5[e]=!0,!1)}function Jk(e,r,i,n){if(i!==null&&i.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return n?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Zk(e,r,i,n){if(r===null||typeof r>"u"||Jk(e,r,i,n))return!0;if(n)return!1;if(i!==null)switch(i.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function on(e,r,i,n,o,a,l){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=i,this.propertyName=e,this.type=r,this.sanitizeURL=a,this.removeEmptyString=l}var Wi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Wi[e]=new on(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var r=e[0];Wi[r]=new on(r,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Wi[e]=new on(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Wi[e]=new on(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){Wi[e]=new on(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Wi[e]=new on(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Wi[e]=new on(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Wi[e]=new on(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Wi[e]=new on(e,5,!1,e.toLowerCase(),null,!1,!1)});var wx=/[\-:]([a-z])/g;function _x(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 r=e.replace(wx,_x);Wi[r]=new on(r,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var r=e.replace(wx,_x);Wi[r]=new on(r,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var r=e.replace(wx,_x);Wi[r]=new on(r,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Wi[e]=new on(e,1,!1,e.toLowerCase(),null,!1,!1)});Wi.xlinkHref=new on("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Wi[e]=new on(e,1,!1,e.toLowerCase(),null,!0,!0)});function Sx(e,r,i,n){var o=Wi.hasOwnProperty(r)?Wi[r]:null;(o!==null?o.type!==0:n||!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(Zk(r,i,o,n)&&(i=null),n||o===null?Gk(r)&&(i===null?e.removeAttribute(r):e.setAttribute(r,""+i)):o.mustUseProperty?e[o.propertyName]=i===null?o.type===3?!1:"":i:(r=o.attributeName,n=o.attributeNamespace,i===null?e.removeAttribute(r):(o=o.type,i=o===3||o===4&&i===!0?"":""+i,n?e.setAttributeNS(n,r,i):e.setAttribute(r,i))))}
vendor: 5,498 bytes, lines 33-37
33var bs=qk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Wp=Symbol.for("react.element"),Rl=Symbol.for("react.portal"),Il=Symbol.for("react.fragment"),kx=Symbol.for("react.strict_mode"),Ag=Symbol.for("react.profiler"),N1=Symbol.for("react.provider"),U1=Symbol.for("react.context"),Cx=Symbol.for("react.forward_ref"),Pg=Symbol.for("react.suspense"),Fg=Symbol.for("react.suspense_list"),zx=Symbol.for("react.memo"),Ps=Symbol.for("react.lazy"),V1=Symbol.for("react.offscreen"),V5=Symbol.iterator;function Ld(e){return e===null||typeof e!="object"?null:(e=V5&&e[V5]||e["@@iterator"],typeof e=="function"?e:null)}var Gr=Object.assign,R0;function ec(e){if(R0===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);R0=r&&r[1]||""}return` 34`+R0+e}var I0=!1;function T0(e,r){if(!e||I0)return"";I0=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(r)if(r=function(){throw Error()},Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(r,[])}catch(u){var n=u}Reflect.construct(e,[],r)}else{try{r.call()}catch(u){n=u}e.call(r.prototype)}else{try{throw Error()}catch(u){n=u}e()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var o=u.stack.split(` 35`),a=n.stack.split(` 36`),l=o.length-1,d=a.length-1;1<=l&&0<=d&&o[l]!==a[d];)d--;for(;1<=l&&0<=d;l--,d--)if(o[l]!==a[d]){if(l!==1||d!==1)do if(l--,d--,0>d||o[l]!==a[d]){var p=` 37`+o[l].replace(" at new "," at ");return e.displayName&&p.includes("<anonymous>")&&(p=p.replace("<anonymous>",e.displayName)),p}while(1<=l&&0<=d);break}}}finally{I0=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?ec(e):""}function Yk(e){switch(e.tag){case 5:return ec(e.type);case 16:return ec("Lazy");case 13:return ec("Suspense");case 19:return ec("SuspenseList");case 0:case 2:case 15:return e=T0(e.type,!1),e;case 11:return e=T0(e.type.render,!1),e;case 1:return e=T0(e.type,!0),e;default:return""}}function Mg(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 Il:return"Fragment";case Rl:return"Portal";case Ag:return"Profiler";case kx:return"StrictMode";case Pg:return"Suspense";case Fg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case U1:return(e.displayName||"Context")+".Consumer";case N1:return(e._context.displayName||"Context")+".Provider";case Cx:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case zx:return r=e.displayName||null,r!==null?r:Mg(e.type)||"Memo";case Ps:r=e._payload,e=e._init;try{return Mg(e(r))}catch{}}return null}function Xk(e){var r=e.type;switch(e.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=r.render,e=e.displayName||e.name||"",r.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Mg(r);case 8:return r===kx?"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 r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function ea(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function q1(e){var r=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Kk(e){var r=q1(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,r),n=""+e[r];if(!e.hasOwnProperty(r)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var o=i.get,a=i.set;return Object.defineProperty(e,r,{configurable:!0,get:function(){return o.call(this)},set:function(l){n=""+l,a.call(this,l)}}),Object.defineProperty(e,r,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(l){n=""+l},stopTracking:function(){e._valueTracker=null,delete e[r]}}}}function Np(e){e._valueTracker||(e._valueTracker=Kk(e))}function H1(e){if(!e)return!1;var r=e._valueTracker;if(!r)return!0;var i=r.getValue(),n="";return e&&(n=q1(e)?e.checked?"true":"false":e.value),e=n,e!==i?(r.setValue(e),!0):!1}function Pu(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 Dg(e,r){var i=r.checked;return Gr({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function q5(e,r){var i=r.defaultValue==null?"":r.defaultValue,n=r.checked!=null?r.checked:r.defaultChecked;i=ea(r.value!=null?r.value:i),e._wrapperState={initialChecked:n,initialValue:i,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function G1(e,r){r=r.checked,r!=null&&Sx(e,"checked",r,!1)}function Bg(e,r){G1(e,r);var i=ea(r.value),n=r.type;if(i!=null)n==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}r.hasOwnProperty("value")?Og(e,r.type,i):r.hasOwnProperty("defaultValue")&&Og(e,r.type,ea(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(e.defaultChecked=!!r.defaultChecked)}
vendor: 4,187 bytes, line 37
37function H5(e,r,i){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var n=r.type;if(!(n!=="submit"&&n!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+e._wrapperState.initialValue,i||r===e.value||(e.value=r),e.defaultValue=r}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function Og(e,r,i){(r!=="number"||Pu(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var tc=Array.isArray;function Jl(e,r,i,n){if(e=e.options,r){r={};for(var o=0;o<i.length;o++)r["$"+i[o]]=!0;for(i=0;i<e.length;i++)o=r.hasOwnProperty("$"+e[i].value),e[i].selected!==o&&(e[i].selected=o),o&&n&&(e[i].defaultSelected=!0)}else{for(i=""+ea(i),r=null,o=0;o<e.length;o++){if(e[o].value===i){e[o].selected=!0,n&&(e[o].defaultSelected=!0);return}r!==null||e[o].disabled||(r=e[o])}r!==null&&(r.selected=!0)}}function Lg(e,r){if(r.dangerouslySetInnerHTML!=null)throw Error(Ye(91));return Gr({},r,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function G5(e,r){var i=r.value;if(i==null){if(i=r.children,r=r.defaultValue,i!=null){if(r!=null)throw Error(Ye(92));if(tc(i)){if(1<i.length)throw Error(Ye(93));i=i[0]}r=i}r==null&&(r=""),i=r}e._wrapperState={initialValue:ea(i)}}function J1(e,r){var i=ea(r.value),n=ea(r.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),r.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),n!=null&&(e.defaultValue=""+n)}function J5(e){var r=e.textContent;r===e._wrapperState.initialValue&&r!==""&&r!==null&&(e.value=r)}function Z1(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function $g(e,r){return e==null||e==="http://www.w3.org/1999/xhtml"?Z1(r):e==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Up,Y1=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(r,i,n,o){MSApp.execUnsafeLocalFunction(function(){return e(r,i,n,o)})}:e}(function(e,r){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=r;else{for(Up=Up||document.createElement("div"),Up.innerHTML="<svg>"+r.valueOf().toString()+"</svg>",r=Up.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;r.firstChild;)e.appendChild(r.firstChild)}});function Rc(e,r){if(r){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=r;return}}e.textContent=r}var pc={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},Qk=["Webkit","ms","Moz","O"];Object.keys(pc).forEach(function(e){Qk.forEach(function(r){r=r+e.charAt(0).toUpperCase()+e.substring(1),pc[r]=pc[e]})});function X1(e,r,i){return r==null||typeof r=="boolean"||r===""?"":i||typeof r!="number"||r===0||pc.hasOwnProperty(e)&&pc[e]?(""+r).trim():r+"px"}function K1(e,r){e=e.style;for(var i in r)if(r.hasOwnProperty(i)){var n=i.indexOf("--")===0,o=X1(i,r[i],n);i==="float"&&(i="cssFloat"),n?e.setProperty(i,o):e[i]=o}}var e4=Gr({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 Wg(e,r){if(r){if(e4[e]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(Ye(137,e));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(Ye(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(Ye(61))}if(r.style!=null&&typeof r.style!="object")throw Error(Ye(62))}}function Ng(e,r){if(e.indexOf("-")===-1)return typeof r.is=="str
37ing";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 Ug=null;function Ex(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vg=null,Zl=null,Yl=null;function Z5(e){if(e=up(e)){if(typeof Vg!="function")throw Error(Ye(280));var r=e.stateNode;r&&(r=Dh(r),Vg(e.stateNode,e.type,r))}}function Q1(e){Zl?Yl?Yl.push(e):Yl=[e]:Zl=e}function ev(){if(Zl){var e=Zl,r=Yl;if(Yl=Zl=null,Z5(e),r)for(e=0;e<r.length;e++)Z5(r[e])}}function tv(e,r){return e(r)}function rv(){}var A0=!1;function iv(e,r,i){if(A0)return e(r,i);A0=!0;try{return tv(e,r,i)}finally{A0=!1,(Zl!==null||Yl!==null)&&(rv(),ev())}}function Ic(e,r){var i=e.stateNode;if(i===null)return null;var n=Dh(i);if(n===null)return null;i=n[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(Ye(231,r,typeof i));return i}var qg=!1;if(ps)try{var $d={};Object.defineProperty($d,"passive",{get:function(){qg=!0}}),window.addEventListener("test",$d,$d),window.removeEventListener("test",$d,$d)}catch{qg=!1}function t4(e,r,i,n,o,a,l,d,p){var u=Array.prototype.slice.call(arguments,3);try{r.apply(i,u)}catch(g){this.onError(g)}}var uc=!1,Fu=null,Mu=!1,Hg=null,r4={onError:function(e){uc=!0,Fu=e}};function i4(e,r,i,n,o,a,l,d,p){uc=!1,Fu=null,t4.apply(r4,arguments)}function n4(e,r,i,n,o,a,l,d,p){if(i4.apply(this,arguments),uc){if(uc){var u=Fu;uc=!1,Fu=null}else throw Error(Ye(198));Mu||(Mu=!0,Hg=u)}}function ol(e){var r=e,i=e;if(e.alternate)for(;r.return;)r=r.return;else{e=r;do r=e,r.flags&4098&&(i=r.return),e=r.return;while(e)}return r.tag===3?i:null}function nv(e){if(e.tag===13){var r=e.memoizedState;if(r===null&&(e=e.alternate,e!==null&&(r=e.memoizedState)),r!==null)return r.dehydrated}return null}function Y5(e){if(ol(e)!==e)throw Error(Ye(188))}function o4(e){var r=e.alternate;if(!r){if(r=ol(e),r===null)throw Error(Ye(188));return r!==e?null:e}for(var i=e,n=r;;){var o=i.return;if(o===null)break;var a=o.alternate;if(a===null){if(n=o.return,n!==null){i=n;continue}break}if(o.child===a.child){for(a=o.child;a;){if(a===i)return Y5(o),e;if(a===n)return Y5(o),r;a=a.sibling}throw Error(Ye(188))}if(i.return!==n.return)i=o,n=a;else{for(var l=!1,d=o.child;d;){if(d===i){l=!0,i=o,n=a;break}if(d===n){l=!0,n=o,i=a;break}d=d.sibling}if(!l){for(d=a.child;d;){if(d===i){l=!0,i=a,n=o;break}if(d===n){l=!0,n=a,i=o;break}d=d.sibling}if(!l)throw Error(Ye(189))}}if(i.alternate!==n)throw Error(Ye(190))}if(i.tag!==3)throw Error(Ye(188));return i.stateNode.current===i?e:r}function ov(e){return e=o4(e),e!==null?sv(e):null}function sv(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var r=sv(e);if(r!==null)return r;e=e.sibling}return null}var av=Tn.unstable_scheduleCallback,X5=Tn.unstable_cancelCallback,s4=Tn.unstable_shouldYield,a4=Tn.unstable_requestPaint,di=Tn.unstable_now,l4=Tn.unstable_getCurrentPriorityLevel,Rx=Tn.unstable_ImmediatePriority,lv=Tn.unstable_UserBlockingPriority,Du=Tn.unstable_NormalPriority,d4=Tn.unstable_LowPriority,dv=Tn.unstable_IdlePriority,Ah=null,Do=null;function c4(e){if(Do&&typeof Do.onCommitFiberRoot=="function")try{Do.onCommitFiberRoot(Ah,e,void 0,(e.current.flags&128)===128)}catch{}}var jo=Math.clz32?Math.clz32:h4,p4=Math.log,u4=Math.LN2;function h4(e){return e>>>=0,e===0?32:31-(p4(e)/u4|0)|0}var Vp=64,qp=4194304;function rc(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 Bu(e,r){var i=e.pendingLanes;if(i===0)return 0;var n=0,o=e.suspendedLanes,a=e.pingedLanes,l=i&268435455;if(l!==0){var d=l&~o;d!==0?n=rc(d):(a&=l,a!==0&&(n=rc(a)))}else l=i&~o,l!==0?n=rc(l):a!==0&&(n=rc(a));if(n===0)return 0;if(r!==0&&r!==n&&!(r&o)&&(o=n&-n,a=r&-r,o>=a||o===16&&(a&4194240)!==0))return r;if(n&4&&(n|=i&16),r=e.entangledLanes,r!==0)for(e=e.entanglements,r&=n;0<r;)i=31-jo(r),o=1<<i,n|=e[i],r&=~o;return n}function g4(e,r){switch(e){case 1:case 2:case 4:return r+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function f4(e,r){for(var i=e.suspendedLanes,n=e.pingedLanes,o=e.expirationTimes,a=e.pendingLanes;0<a;){var l=31-jo(a),d=1<<l,p=o[l];p===-1?(!(d&i)||d&n)&&(o[l]=g4(d,r)):p<=r&&(e.expiredLanes|=d),a&=~d}}function Gg(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function cv(){var e=Vp;return Vp<<=1,!(Vp&4194240)&&(Vp=64),e}function P0(e){for(var r=[],i=0;31>i;i++)r.push(e);return r}function cp(e,r,i){e.pendingLanes|=r,r!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,r=31-jo(r),e[r]=i}function x4(e,r){var i=e.pendingLanes&~r;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=r,e.mutableReadLanes&=r,e.entangledLanes&=r,r=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<i;){var o=31-jo(i),a=1<<o;r[o]=0,n[o]=-1,e[o]=-1,i&=~a}}function Ix(e,r){var i=e.entangledLanes|=r;for(e=e.entanglements;i;){var n=31-jo(i),o=1<<n;o&r|e[n]&r&&(e[n]|=r),i&=~o}}var yr=0;function pv(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var uv,Tx,hv,gv,fv,Jg=!1,Hp=[],Hs=null,Gs=null,Js=null,Tc=new Map,Ac=new Map,Ds=[],m4="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function K5(e,r){switch(e){case"focusin":case"focusout":Hs=null;break;case"dragenter":case"dragleave":Gs=null;break;case"mouseover":case"mouseout":Js=null;break;case"pointerover":case"pointerout":Tc.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ac.delete(r.pointerId)}}function Wd(e,r,i,n,o,a){return e===null||e.nativeEvent!==a?(e={blockedOn:r,domEventName:i,eventSystemFlags:n,nativeEvent:a,targetContainers:[o]},r!==null&&(r=up(r),r!==null&&Tx(r)),e):(e.eventSystemFlags|=n,r=e.targetContainers,o!==null&&r.indexOf(o)===-1&&r.push(o),e)}function y4(e,r,i,n,o){switch(r){case"focusin":return Hs=Wd(Hs,e,r,i,n,o),!0;case"dragenter":return Gs=Wd(Gs,e,r,i,n,o),!0;case"mouseover":return Js=Wd(Js,e,r,i,n,o),!0;case"pointerover":var a=o.pointerId;return Tc.set(a,Wd(Tc.get(a)||null,e,r,i,n,o)),!0;case"gotpointercapture":return a=o.pointerId,Ac.set(a,Wd(Ac.get(a)||null,e,r,i,n,o)),!0}return!1}function xv(e){var r=Ra(e.target);if(r!==null){var i=ol(r);if(i!==null){if(r=i.tag,r===13){if(r=nv(i),r!==null){e.blockedOn=r,fv(e.priority,function(){hv(i)});return}}else if(r===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function xu(e){if(e.blockedOn!==null)return!1;for(var r=e.targetContainers;0<r.length;){var i=Zg(e.domEventName,e.eventSystemFlags,r[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var n=new i.constructor(i.type,i);Ug=n,i.target.dispatchEvent(n),Ug=null}else return r=up(i),r!==null&&Tx(r),e.blockedOn=i,!1;r.shift()}return!0}
vendor: 11,995 bytes, line 37
37function Q5(e,r,i){xu(e)&&i.delete(r)}function b4(){Jg=!1,Hs!==null&&xu(Hs)&&(Hs=null),Gs!==null&&xu(Gs)&&(Gs=null),Js!==null&&xu(Js)&&(Js=null),Tc.forEach(Q5),Ac.forEach(Q5)}function Nd(e,r){e.blockedOn===r&&(e.blockedOn=null,Jg||(Jg=!0,Tn.unstable_scheduleCallback(Tn.unstable_NormalPriority,b4)))}function Pc(e){function r(o){return Nd(o,e)}if(0<Hp.length){Nd(Hp[0],e);for(var i=1;i<Hp.length;i++){var n=Hp[i];n.blockedOn===e&&(n.blockedOn=null)}}for(Hs!==null&&Nd(Hs,e),Gs!==null&&Nd(Gs,e),Js!==null&&Nd(Js,e),Tc.forEach(r),Ac.forEach(r),i=0;i<Ds.length;i++)n=Ds[i],n.blockedOn===e&&(n.blockedOn=null);for(;0<Ds.length&&(i=Ds[0],i.blockedOn===null);)xv(i),i.blockedOn===null&&Ds.shift()}var Xl=bs.ReactCurrentBatchConfig,Ou=!0;function v4(e,r,i,n){var o=yr,a=Xl.transition;Xl.transition=null;try{yr=1,Ax(e,r,i,n)}finally{yr=o,Xl.transition=a}}function j4(e,r,i,n){var o=yr,a=Xl.transition;Xl.transition=null;try{yr=4,Ax(e,r,i,n)}finally{yr=o,Xl.transition=a}}function Ax(e,r,i,n){if(Ou){var o=Zg(e,r,i,n);if(o===null)U0(e,r,n,Lu,i),K5(e,n);else if(y4(o,e,r,i,n))n.stopPropagation();else if(K5(e,n),r&4&&-1<m4.indexOf(e)){for(;o!==null;){var a=up(o);if(a!==null&&uv(a),a=Zg(e,r,i,n),a===null&&U0(e,r,n,Lu,i),a===o)break;o=a}o!==null&&n.stopPropagation()}else U0(e,r,n,null,i)}}var Lu=null;function Zg(e,r,i,n){if(Lu=null,e=Ex(n),e=Ra(e),e!==null)if(r=ol(e),r===null)e=null;else if(i=r.tag,i===13){if(e=nv(r),e!==null)return e;e=null}else if(i===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;e=null}else r!==e&&(e=null);return Lu=e,null}function mv(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(l4()){case Rx:return 1;case lv:return 4;case Du:case d4:return 16;case dv:return 536870912;default:return 16}default:return 16}}var Ws=null,Px=null,mu=null;function yv(){if(mu)return mu;var e,r=Px,i=r.length,n,o="value"in Ws?Ws.value:Ws.textContent,a=o.length;for(e=0;e<i&&r[e]===o[e];e++);var l=i-e;for(n=1;n<=l&&r[i-n]===o[a-n];n++);return mu=o.slice(e,1<n?1-n:void 0)}function yu(e){var r=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&r===13&&(e=13)):e=r,e===10&&(e=13),32<=e||e===13?e:0}function Gp(){return!0}function ey(){return!1}function Dn(e){function r(i,n,o,a,l){this._reactName=i,this._targetInst=o,this.type=n,this.nativeEvent=a,this.target=l,this.currentTarget=null;for(var d in e)e.hasOwnProperty(d)&&(i=e[d],this[d]=i?i(a):a[d]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Gp:ey,this.isPropagationStopped=ey,this}return Gr(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Gp)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Gp)},persist:function(){},isPersistent:Gp}),r}var Cd={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fx=Dn(Cd),pp=Gr({},Cd,{view:0,detail:0}),w4=Dn(pp),F0,M0,Ud,Ph=Gr({},pp,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mx,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ud&&(Ud&&e.type==="mousemove"?(F0=e.screenX-Ud.screenX,M0=e.screenY-Ud.screenY):M0=F0=0,Ud=e),F0)},movementY:function(e){return"movementY"in e?e.movementY:M0}}),ty=Dn(Ph),_4=Gr({},Ph,{dataTransfer:0}),S4=Dn(_4),k4=Gr({},pp,{relatedTarget:0}),D0=Dn(k4),C4=Gr({},Cd,{animationName:0,elapsedTime:0,pseudoElement:0}),z4=Dn(C4),E4=Gr({},Cd,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),R4=Dn(E4),I4=Gr({},Cd,{data:0}),ry=Dn(I4),T4={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},A4={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},P4={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function F4(e){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(e):(e=P4[e])?!!r[e]:!1}function Mx(){return F4}var M4=Gr({},pp,{key:function(e){if(e.key){var r=T4[e.key]||e.key;if(r!=="Unidentified")return r}return e.type==="keypress"?(e=yu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?A4[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mx,charCode:function(e){return e.type==="keypress"?yu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?yu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),D4=Dn(M4),B4=Gr({},Ph,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),iy=Dn(B4),O4=Gr({},pp,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mx}),L4=Dn(O4),$4=Gr({},Cd,{propertyName:0,elapsedTime:0,pseudoElement:0}),W4=Dn($4),N4=Gr({},Ph,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),U4=Dn(N4),V4=[9,13,27,32],Dx=ps&&"CompositionEvent"in window,hc=null;ps&&"documentMode"in document&&(hc=document.documentMode);var q4=ps&&"TextEvent"in window&&!hc,bv=ps&&(!Dx||hc&&8<hc&&11>=hc),ny=" ",oy=!1;function vv(e,r){switch(e){case"keyup":return V4.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jv(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Tl=!1;function H4(e,r){switch(e){case"compositionend":return jv(r);case"keypress":return r.which!==32?null:(oy=!0,ny);case"textInput":return e=r.data,e===ny&&oy?null:e;default:return null}}function G4(e,r){if(Tl)return e==="compositionend"||!Dx&&vv(e,r)?(e=yv(),mu=Px=Ws=null,Tl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return bv&&r.locale!=="ko"?null:r.data;default:return null}}var J4={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function sy(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r==="input"?!!J4[e.type]:r==="textarea"}function wv(e,r,i,n){Q1(n),r=$u(r,"onChange"),0<r.length&&(i=new Fx("onChange","change",null,i,n),e.push({event:i,listeners:r}))}var gc=null,Fc=null;function Z4(e){Pv(e,0)}function Fh(e){var r=Fl(e);if(H1(r))return e}function Y4(e,r){if(e==="change")return r}var _v=!1;if(ps){var B0;if(ps){var O0="oninput"in document;if(!O0){var ay=document.createElement("div");ay.setAttribute("oninput","return;"),O0=typeof ay.oninput=="function"}B0=O0}else B0=!1;_v=B0&&(!document.documentMode||9<document.documentMode)}function ly(){gc&&(gc.detachEvent("onpropertychange",Sv),Fc=gc=null)}function Sv(e){if(e.propertyName==="value"&&Fh(Fc)){var r=[];wv(r,Fc,e,Ex(e)),iv(Z4,r)}}function X4(e,r,i){e==="focusin"?(ly(),gc=r,Fc=i,gc.attachEvent("onpropertychange",Sv)):e==="focusout"&&ly()}function K4(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Fh(Fc)}function Q4(e,r){if(e==="click")return Fh(r)}function e8(e,r){if(e==="input"||e==="change")return Fh(r)}function t8(e,r){return e===r&&(e!==0||1/e===1/r)||e!==e&&r!==r}var _o=typeof Object.is=="function"?Object.is:t8;function Mc(e,r){if(_o(e,r))return!0;if(typeof e!="object"||e===null||typeof r!="object"||r===null)return!1;var i=Object.keys(e),n=Object.keys(r);if(i.length!==n.length)return!1;for(n=0;n<i.length;n++){var o=i[n];if(!Tg.call(r,o)||!_o(e[o],r[o]))return!1}return!0}function dy(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cy(e,r){var i=dy(e);e=0;for(var n;i;){if(i.nodeType===3){if(n=e+i.textContent.length,e<=r&&n>=r)return{node:i,offset:r-e};e=n}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=dy(i)}}function kv(e,r){return e&&r?e===r?!0:e&&e.nodeType===3?!1:r&&r.nodeType===3?kv(e,r.parentNode):"contains"in e?e.contains(r):e.compareDocumentPosition?!!(e.compareDocumentPosition(r)&16):!1:!1}function Cv(){for(var e=window,r=Pu();r instanceof e.HTMLIFrameElement;){try{var i=typeof r.contentWindow.location.href=="string"}catch{i=!1}if(i)e=r.contentWindow;else break;r=Pu(e.document)}return r}function Bx(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r&&(r==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||r==="textarea"||e.contentEditable==="true")}function r8(e){var r=Cv(),i=e.focusedElem,n=e.selectionRange;if(r!==i&&i&&i.ownerDocument&&kv(i.ownerDocument.documentElement,i)){if(n!==null&&Bx(i)){if(r=n.start,e=n.end,e===void 0&&(e=r),"selectionStart"in i)i.selectionStart=r,i.selectionEnd=Math.min(e,i.value.length);else if(e=(r=i.ownerDocument||document)&&r.defaultView||window,e.getSelection){e=e.getSelection();var o=i.textContent.length,a=Math.min(n.start,o);n=n.end===void 0?a:Math.min(n.end,o),!e.extend&&a>n&&(o=n,n=a,a=o),o=cy(i,a);var l=cy(i,n);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(r=r.createRange(),r.setStart(o.node,o.offset),e.removeAllRanges(),a>n?(e.addRange(r),e.extend(l.node,l.offset)):(r.setEnd(l.node,l.offset),e.addRange(r)))}}for(r=[],e=i;e=e.parentNode;)e.nodeType===1&&r.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<r.length;i++)e=r[i],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var i8=ps&&"documentMode"in document&&11>=document.documentMode,Al=null,Yg=null,fc=null,Xg=!1;function py(e,r,i){var n=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Xg||Al==null||Al!==Pu(n)||(n=Al,"selectionStart"in n&&Bx(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focu
vendor: 4,383 bytes, line 37
37sNode:n.focusNode,focusOffset:n.focusOffset}),fc&&Mc(fc,n)||(fc=n,n=$u(Yg,"onSelect"),0<n.length&&(r=new Fx("onSelect","select",null,r,i),e.push({event:r,listeners:n}),r.target=Al)))}function Jp(e,r){var i={};return i[e.toLowerCase()]=r.toLowerCase(),i["Webkit"+e]="webkit"+r,i["Moz"+e]="moz"+r,i}var Pl={animationend:Jp("Animation","AnimationEnd"),animationiteration:Jp("Animation","AnimationIteration"),animationstart:Jp("Animation","AnimationStart"),transitionend:Jp("Transition","TransitionEnd")},L0={},zv={};ps&&(zv=document.createElement("div").style,"AnimationEvent"in window||(delete Pl.animationend.animation,delete Pl.animationiteration.animation,delete Pl.animationstart.animation),"TransitionEvent"in window||delete Pl.transitionend.transition);function Mh(e){if(L0[e])return L0[e];if(!Pl[e])return e;var r=Pl[e],i;for(i in r)if(r.hasOwnProperty(i)&&i in zv)return L0[e]=r[i];return e}var Ev=Mh("animationend"),Rv=Mh("animationiteration"),Iv=Mh("animationstart"),Tv=Mh("transitionend"),Av=new Map,uy="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function oa(e,r){Av.set(e,r),nl(r,[e])}for(var $0=0;$0<uy.length;$0++){var W0=uy[$0],n8=W0.toLowerCase(),o8=W0[0].toUpperCase()+W0.slice(1);oa(n8,"on"+o8)}oa(Ev,"onAnimationEnd");oa(Rv,"onAnimationIteration");oa(Iv,"onAnimationStart");oa("dblclick","onDoubleClick");oa("focusin","onFocus");oa("focusout","onBlur");oa(Tv,"onTransitionEnd");ld("onMouseEnter",["mouseout","mouseover"]);ld("onMouseLeave",["mouseout","mouseover"]);ld("onPointerEnter",["pointerout","pointerover"]);ld("onPointerLeave",["pointerout","pointerover"]);nl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));nl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));nl("onBeforeInput",["compositionend","keypress","textInput","paste"]);nl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));nl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));nl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ic="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),s8=new Set("cancel close invalid load scroll toggle".split(" ").concat(ic));function hy(e,r,i){var n=e.type||"unknown-event";e.currentTarget=i,n4(n,r,void 0,e),e.currentTarget=null}function Pv(e,r){r=(r&4)!==0;for(var i=0;i<e.length;i++){var n=e[i],o=n.event;n=n.listeners;e:{var a=void 0;if(r)for(var l=n.length-1;0<=l;l--){var d=n[l],p=d.instance,u=d.currentTarget;if(d=d.listener,p!==a&&o.isPropagationStopped())break e;hy(o,d,u),a=p}else for(l=0;l<n.length;l++){if(d=n[l],p=d.instance,u=d.currentTarget,d=d.listener,p!==a&&o.isPropagationStopped())break e;hy(o,d,u),a=p}}}if(Mu)throw e=Hg,Mu=!1,Hg=null,e}function Ir(e,r){var i=r[rf];i===void 0&&(i=r[rf]=new Set);var n=e+"__bubble";i.has(n)||(Fv(r,e,2,!1),i.add(n))}function N0(e,r,i){var n=0;r&&(n|=4),Fv(i,e,n,r)}var Zp="_reactListening"+Math.random().toString(36).slice(2);function Dc(e){if(!e[Zp]){e[Zp]=!0,W1.forEach(function(i){i!=="selectionchange"&&(s8.has(i)||N0(i,!1,e),N0(i,!0,e))});var r=e.nodeType===9?e:e.ownerDocument;r===null||r[Zp]||(r[Zp]=!0,N0("selectionchange",!1,r))}}function Fv(e,r,i,n){switch(mv(r)){case 1:var o=v4;break;case 4:o=j4;break;default:o=Ax}i=o.bind(null,r,i,e),o=void 0,!qg||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(o=!0),n?o!==void 0?e.addEventListener(r,i,{capture:!0,passive:o}):e.addEventListener(r,i,!0):o!==void 0?e.addEventListener(r,i,{passive:o}):e.addEventListener(r,i,!1)}function U0(e,r,i,n,o){var a=n;
vendor: 16,741 bytes, lines 37-38
37if(!(r&1)&&!(r&2)&&n!==null)e:for(;;){if(n===null)return;var l=n.tag;if(l===3||l===4){var d=n.stateNode.containerInfo;if(d===o||d.nodeType===8&&d.parentNode===o)break;if(l===4)for(l=n.return;l!==null;){var p=l.tag;if((p===3||p===4)&&(p=l.stateNode.containerInfo,p===o||p.nodeType===8&&p.parentNode===o))return;l=l.return}for(;d!==null;){if(l=Ra(d),l===null)return;if(p=l.tag,p===5||p===6){n=a=l;continue e}d=d.parentNode}}n=n.return}iv(function(){var u=a,g=Ex(i),h=[];e:{var x=Av.get(e);if(x!==void 0){var y=Fx,_=e;switch(e){case"keypress":if(yu(i)===0)break e;case"keydown":case"keyup":y=D4;break;case"focusin":_="focus",y=D0;break;case"focusout":_="blur",y=D0;break;case"beforeblur":case"afterblur":y=D0;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=ty;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=S4;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=L4;break;case Ev:case Rv:case Iv:y=z4;break;case Tv:y=W4;break;case"scroll":y=w4;break;case"wheel":y=U4;break;case"copy":case"cut":case"paste":y=R4;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=iy}var S=(r&4)!==0,k=!S&&e==="scroll",w=S?x!==null?x+"Capture":null:x;S=[];for(var b=u,j;b!==null;){j=b;var T=j.stateNode;if(j.tag===5&&T!==null&&(j=T,w!==null&&(T=Ic(b,w),T!=null&&S.push(Bc(b,T,j)))),k)break;b=b.return}0<S.length&&(x=new y(x,_,null,i,g),h.push({event:x,listeners:S}))}}if(!(r&7)){e:{if(x=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",x&&i!==Ug&&(_=i.relatedTarget||i.fromElement)&&(Ra(_)||_[us]))break e;if((y||x)&&(x=g.window===g?g:(x=g.ownerDocument)?x.defaultView||x.parentWindow:window,y?(_=i.relatedTarget||i.toElement,y=u,_=_?Ra(_):null,_!==null&&(k=ol(_),_!==k||_.tag!==5&&_.tag!==6)&&(_=null)):(y=null,_=u),y!==_)){if(S=ty,T="onMouseLeave",w="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(S=iy,T="onPointerLeave",w="onPointerEnter",b="pointer"),k=y==null?x:Fl(y),j=_==null?x:Fl(_),x=new S(T,b+"leave",y,i,g),x.target=k,x.relatedTarget=j,T=null,Ra(g)===u&&(S=new S(w,b+"enter",_,i,g),S.target=j,S.relatedTarget=k,T=S),k=T,y&&_)t:{for(S=y,w=_,b=0,j=S;j;j=yl(j))b++;for(j=0,T=w;T;T=yl(T))j++;for(;0<b-j;)S=yl(S),b--;for(;0<j-b;)w=yl(w),j--;for(;b--;){if(S===w||w!==null&&S===w.alternate)break t;S=yl(S),w=yl(w)}S=null}else S=null;y!==null&&gy(h,x,y,S,!1),_!==null&&k!==null&&gy(h,k,_,S,!0)}}e:{if(x=u?Fl(u):window,y=x.nodeName&&x.nodeName.toLowerCase(),y==="select"||y==="input"&&x.type==="file")var P=Y4;else if(sy(x))if(_v)P=e8;else{P=K4;var I=X4}else(y=x.nodeName)&&y.toLowerCase()==="input"&&(x.type==="checkbox"||x.type==="radio")&&(P=Q4);if(P&&(P=P(e,u))){wv(h,P,i,g);break e}I&&I(e,x,u),e==="focusout"&&(I=x._wrapperState)&&I.controlled&&x.type==="number"&&Og(x,"number",x.value)}switch(I=u?Fl(u):window,e){case"focusin":(sy(I)||I.contentEditable==="true")&&(Al=I,Yg=u,fc=null);break;case"focusout":fc=Yg=Al=null;break;case"mousedown":Xg=!0;break;case"contextmenu":case"mouseup":case"dragend":Xg=!1,py(h,i,g);break;case"selectionchange":if(i8)break;case"keydown":case"keyup":py(h,i,g)}var R;if(Dx)e:{switch(e){case"compositionstart":var O="onCompositionStart";break e;case"compositionend":O="onCompositionEnd";break e;case"compositionupdate":O="onCompositionUpdate";break e}O=void 0}else Tl?vv(e,i)&&(O="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(O="onCompositionStart");O&&(bv&&i.locale!=="ko"&&(Tl||O!=="onCompositionStart"?O==="onCompositionEnd"&&Tl&&(R=yv()):(Ws=g,Px="value"in Ws?Ws.value:Ws.textContent,Tl=!0)),I=$u(u,O),0<I.length&&(O=new ry(O,e,null,i,g),h.push({event:O,listeners:I}),R?O.data=R:(R=jv(i),R!==null&&(O.data=R)))),(R=q4?H4(e,i):G4(e,i))&&(u=$u(u,"onBeforeInput"),0<u.length&&(g=new ry("onBeforeInput","beforeinput",null,i,g),h.push({event:g,listeners:u}),g.data=R))}Pv(h,r)})}function Bc(e,r,i){return{instance:e,listener:r,currentTarget:i}}function $u(e,r){for(var i=r+"Capture",n=[];e!==null;){var o=e,a=o.stateNode;o.tag===5&&a!==null&&(o=a,a=Ic(e,i),a!=null&&n.unshift(Bc(e,a,o)),a=Ic(e,r),a!=null&&n.push(Bc(e,a,o))),e=e.return}return n}function yl(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function gy(e,r,i,n,o){for(var a=r._reactName,l=[];i!==null&&i!==n;){var d=i,p=d.alternate,u=d.stateNode;if(p!==null&&p===n)break;d.tag===5&&u!==null&&(d=u,o?(p=Ic(i,a),p!=null&&l.unshift(Bc(i,p,d))):o||(p=Ic(i,a),p!=null&&l.push(Bc(i,p,d)))),i=i.return}l.length!==0&&e.push({event:r,listeners:l})}var a8=/\r\n?/g,l8=/\u0000|\uFFFD/g;function fy(e){return(typeof e=="string"?e:""+e).replace(a8,` 38`).replace(l8,"")}function Yp(e,r,i){if(r=fy(r),fy(e)!==r&&i)throw Error(Ye(425))}function Wu(){}var Kg=null,Qg=null;function ef(e,r){return e==="textarea"||e==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var tf=typeof setTimeout=="function"?setTimeout:void 0,d8=typeof clearTimeout=="function"?clearTimeout:void 0,xy=typeof Promise=="function"?Promise:void 0,c8=typeof queueMicrotask=="function"?queueMicrotask:typeof xy<"u"?function(e){return xy.resolve(null).then(e).catch(p8)}:tf;function p8(e){setTimeout(function(){throw e})}function V0(e,r){var i=r,n=0;do{var o=i.nextSibling;if(e.removeChild(i),o&&o.nodeType===8)if(i=o.data,i==="/$"){if(n===0){e.removeChild(o),Pc(r);return}n--}else i!=="$"&&i!=="$?"&&i!=="$!"||n++;i=o}while(i);Pc(r)}function Zs(e){for(;e!=null;e=e.nextSibling){var r=e.nodeType;if(r===1||r===3)break;if(r===8){if(r=e.data,r==="$"||r==="$!"||r==="$?")break;if(r==="/$")return null}}return e}function my(e){e=e.previousSibling;for(var r=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(r===0)return e;r--}else i==="/$"&&r++}e=e.previousSibling}return null}var zd=Math.random().toString(36).slice(2),Fo="__reactFiber$"+zd,Oc="__reactProps$"+zd,us="__reactContainer$"+zd,rf="__reactEvents$"+zd,u8="__reactListeners$"+zd,h8="__reactHandles$"+zd;function Ra(e){var r=e[Fo];if(r)return r;for(var i=e.parentNode;i;){if(r=i[us]||i[Fo]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(e=my(e);e!==null;){if(i=e[Fo])return i;e=my(e)}return r}e=i,i=e.parentNode}return null}function up(e){return e=e[Fo]||e[us],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Fl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Ye(33))}function Dh(e){return e[Oc]||null}var nf=[],Ml=-1;function sa(e){return{current:e}}function Mr(e){0>Ml||(e.current=nf[Ml],nf[Ml]=null,Ml--)}function zr(e,r){Ml++,nf[Ml]=e.current,e.current=r}var ta={},Hi=sa(ta),hn=sa(!1),Ha=ta;function dd(e,r){var i=e.type.contextTypes;if(!i)return ta;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===r)return n.__reactInternalMemoizedMaskedChildContext;var o={},a;for(a in i)o[a]=r[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=o),o}function gn(e){return e=e.childContextTypes,e!=null}function Nu(){Mr(hn),Mr(Hi)}function yy(e,r,i){if(Hi.current!==ta)throw Error(Ye(168));zr(Hi,r),zr(hn,i)}function Mv(e,r,i){var n=e.stateNode;if(r=r.childContextTypes,typeof n.getChildContext!="function")return i;n=n.getChildContext();for(var o in n)if(!(o in r))throw Error(Ye(108,Xk(e)||"Unknown",o));return Gr({},i,n)}function Uu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ta,Ha=Hi.current,zr(Hi,e),zr(hn,hn.current),!0}function by(e,r,i){var n=e.stateNode;if(!n)throw Error(Ye(169));i?(e=Mv(e,r,Ha),n.__reactInternalMemoizedMergedChildContext=e,Mr(hn),Mr(Hi),zr(Hi,e)):Mr(hn),zr(hn,i)}var rs=null,Bh=!1,q0=!1;function Dv(e){rs===null?rs=[e]:rs.push(e)}function g8(e){Bh=!0,Dv(e)}function aa(){if(!q0&&rs!==null){q0=!0;var e=0,r=yr;try{var i=rs;for(yr=1;e<i.length;e++){var n=i[e];do n=n(!0);while(n!==null)}rs=null,Bh=!1}catch(o){throw rs!==null&&(rs=rs.slice(e+1)),av(Rx,aa),o}finally{yr=r,q0=!1}}return null}var Dl=[],Bl=0,Vu=null,qu=0,Jn=[],Zn=0,Ga=null,ns=1,os="";function va(e,r){Dl[Bl++]=qu,Dl[Bl++]=Vu,Vu=e,qu=r}function Bv(e,r,i){Jn[Zn++]=ns,Jn[Zn++]=os,Jn[Zn++]=Ga,Ga=e;var n=ns;e=os;var o=32-jo(n)-1;n&=~(1<<o),i+=1;var a=32-jo(r)+o;if(30<a){var l=o-o%5;a=(n&(1<<l)-1).toString(32),n>>=l,o-=l,ns=1<<32-jo(r)+o|i<<o|n,os=a+e}else ns=1<<a|i<<o|n,os=e}function Ox(e){e.return!==null&&(va(e,1),Bv(e,1,0))}function Lx(e){for(;e===Vu;)Vu=Dl[--Bl],Dl[Bl]=null,qu=Dl[--Bl],Dl[Bl]=null;for(;e===Ga;)Ga=Jn[--Zn],Jn[Zn]=null,os=Jn[--Zn],Jn[Zn]=null,ns=Jn[--Zn],Jn[Zn]=null}var Rn=null,zn=null,Lr=!1,vo=null;function Ov(e,r){var i=Yn(5,null,null,0);i.elementType="DELETED",i.stateNode=r,i.return=e,r=e.deletions,r===null?(e.deletions=[i],e.flags|=16):r.push(i)}function vy(e,r){switch(e.tag){case 5:var i=e.type;return r=r.nodeType!==1||i.toLowerCase()!==r.nodeName.toLowerCase()?null:r,r!==null?(e.stateNode=r,Rn=e,zn=Zs(r.firstChild),!0):!1;case 6:return r=e.pendingProps===""||r.nodeType!==3?null:r,r!==null?(e.stateNode=r,Rn=e,zn=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(i=Ga!==null?{id:ns,overflow:os}:null,e.memoizedState={dehydrated:r,treeContext:i,retryLane:1073741824},i=Yn(18,null,null,0),i.stateNode=r,i.return=e,e.child=i,Rn=e,zn=null,!0):!1;default:return!1}}function of(e){return(e.mode&1)!==0&&(e.flags&128)===0}function sf(e){if(Lr){var r=zn;if(r){var i=r;if(!vy(e,r)){if(of(e))throw Error(Ye(418));r=Zs(i.nextSibling);var n=Rn;r&&vy(e,r)?Ov(n,i):(e.flags=e.flags&-4097|2,Lr=!1,Rn=e)}}else{if(of(e))throw Error(Ye(418));e.flags=e.flags&-4097|2,Lr=!1,Rn=e}}}function jy(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Rn=e}function Xp(e){if(e!==Rn)return!1;if(!Lr)return jy(e),Lr=!0,!1;var r;if((r=e.tag!==3)&&!(r=e.tag!==5)&&(r=e.type,r=r!=="head"&&r!=="body"&&!ef(e.type,e.memoizedProps)),r&&(r=zn)){if(of(e))throw Lv(),Error(Ye(418));for(;r;)Ov(e,r),r=Zs(r.nextSibling)}if(jy(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Ye(317));e:{for(e=e.nextSibling,r=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(r===0){zn=Zs(e.nextSibling);break e}r--}else i!=="$"&&i!=="$!"&&i!=="$?"||r++}e=e.nextSibling}zn=null}}else zn=Rn?Zs(e.stateNode.nextSibling):null;return!0}function Lv(){for(var e=zn;e;)e=Zs(e.nextSibling)}function cd(){zn=Rn=null,Lr=!1}function $x(e){vo===null?vo=[e]:vo.push(e)}var f8=bs.ReactCurrentBatchConfig;function Vd(e,r,i){if(e=i.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(Ye(309));var n=i.stateNode}if(!n)throw Error(Ye(147,e));var o=n,a=""+e;return r!==null&&r.ref!==null&&typeof r.ref=="function"&&r.ref._stringRef===a?r.ref:(r=function(l){var d=o.refs;l===null?delete d[a]:d[a]=l},r._stringRef=a,r)}if(typeof e!="string")throw Error(Ye(284));if(!i._owner)throw Error(Ye(290,e))}return e}function Kp(e,r){throw e=Object.prototype.toString.call(r),Error(Ye(31,e==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":e))}function wy(e){var r=e._init;return r(e._payload)}function $v(e){function r(w,b){if(e){var j=w.deletions;j===null?(w.deletions=[b],w.flags|=16):j.push(b)}}function i(w,b){if(!e)return null;for(;b!==null;)r(w,b),b=b.sibling;return null}function n(w,b){for(w=new Map;b!==null;)b.key!==null?w.set(b.key,b):w.set(b.index,b),b=b.sibling;return w}function o(w,b){return w=Qs(w,b),w.index=0,w.sibling=null,w}function a(w,b,j){return w.index=j,e?(j=w.alternate,j!==null?(j=j.index,j<b?(w.flags|=2,b):j):(w.flags|=2,b)):(w.flags|=1048576,b)}function l(w){return e&&w.alternate===null&&(w.flags|=2),w}function d(w,b,j,T){return b===null||b.tag!==6?(b=K0(j,w.mode,T),b.return=w,b):(b=o(b,j),b.return=w,b)}function p(w,b,j,T){var P=j.type;return P===Il?g(w,b,j.props.children,T,j.key):b!==null&&(b.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Ps&&wy(P)===b.type)?(T=o(b,j.props),T.ref=Vd(w,b,j),T.return=w,T):(T=ku(j.type,j.key,j.props,null,w.mode,T),T.ref=Vd(w,b,j),T.return=w,T)}function u(w,b,j,T){return b===null||b.tag!==4||b.stateNode.containerInfo!==j.containerInfo||b.stateNode.implementation!==j.implementation?(b=Q0(j,w.mode,T),b.return=w,b):(b=o(b,j.children||[]),b.return=w,b)}function g(w,b,j,T,P){return b===null||b.tag!==7?(b=Oa(j,w.mode,T,P),b.return=w,b):(b=o(b,j),b.return=w,b)}function h(w,b,j){if(typeof b=="string"&&b!==""||typeof b=="number")return b=K0(""+b,w.mode,j),b.return=w,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Wp:return j=ku(b.type,b.key,b.props,null,w.mode,j),j.ref=Vd(w,null,b),j.return=w,j;case Rl:return b=Q0(b,w.mode,j),b.return=w,b;case Ps:var T=b._init;return h(w,T(b._payload),j)}if(tc(b)||Ld(b))return b=Oa(b,w.mode,j,null),b.return=w,b;Kp(w,b)}return null}function x(w,b,j,T){var P=b!==null?b.key:null;if(typeof j=="string"&&j!==""||typeof j=="number")return P!==null?null:d(w,b,""+j,T);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Wp:return j.key===P?p(w,b,j,T):null;case Rl:return j.key===P?u(w,b,j,T):null;case Ps:return P=j._init,x(w,b,P(j._payload),T)}if(tc(j)||Ld(j))return P!==null?null:g(w,b,j,T,null);Kp(w,j)}return null}function y(w,b,j,T,P){if(typeof T=="string"&&T!==""||typeof T=="number")return w=w.get(j)||null,d(b,w,""+T,P);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case Wp:return w=w.get(T.key===null?j:T.key)||null,p(b,w,T,P);case Rl:return w=w.get(T.key===null?j:T.key)||null,u(b,w,T,P);case Ps:var I=T._init;return y(w,b,j,I(T._payload),P)}if(tc(T)||Ld(T))return w=w.get(j)||null,g(b,w,T,P,null);Kp(b,T)}return null}function _(w,b,j,T){for(var P=null,I=null,R=b,O=b=0,E=null;R!==null&&O<j.length;O++){R.index>O?(E=R,R=null):E=R.sibling;var $=x(w,R,j[O],T);if($===null){R===null&&(R=E);break}e&&R&&$.alternate===null&&r(w,R),b=a($,b,O),I===null?P=$:I.sibling=$,I=$,R=E}if(O===j.length)return i(w,R),Lr&&va(w,O),P;if(R===null){for(;O<j.length;O++)R=h(w,j[O],T),R!==null&&(b=a(R,b,O),I===null?P=R:I.sibling=R,I=R);return Lr&&va(w,O),P}for(R=n(w,R);O<j.length;O++)E=y(R,w,O,j[O],T),E!==null&&(e&&E.alternate!==null&&R.delete(E.key===null?O:E.key),b=a(E,b,O),I===null?P=E:I.sibling=E,I=E);return e&&R.forEach(function(B){return r(w,B)}),Lr&&va(w,O),P}function S(w,b,j,T){var P=Ld(j);if(typeof P!="function")throw Error(Ye(150));if(j=P.call(j),j==null)throw Error(Ye(151));for(var I=P=null,R=b,O=b=0,E=null,$=j.next();R!==null&&!$.done;O++,$=j.next()){R.index>O?(E=R,R=null):E=R.sibling;var B=x(w,R,$.value,T);if(B===null){R===null&&(R=E);break}e&&R&&B.alternate===null&&r(w,R),b=a(B,b,O),I===null?P=B:I.sibling=B,I=B,R=E}if($.done)return i(w,R),Lr&&va(w,O),P;if(R===null){for(;!$.done;O++,$=j.next())$=h(w,$.value,T),$!==null&&(b=a($,b,O),I===null?P=$:I.sibling=$,I=$);return Lr&&va(w,O),P}for(R=n(w,R);!$.done;O++,$=j.next())$=y(R,w,O,$.value,T),$!==null&&(e&&$.alternate!==null&&R.delete($.key===null?O:$.key),b=a($,b,O),I===null?P=$:I.sibling=$,I=$);return e&&R.forEach(function(ee){return r(w,ee)}),Lr&&va(w,O),P}function k(w,b,j,T){if(typeof j=="object"&&j!==null&&j.type===Il&&j.key===null&&(j=j.props.children),typeof j=="object"&&j!==null){switch(j.$$typeof){case Wp:e:{for(var P=j.key,I=b;I!==null;){if(I.key===P){if(P=j.type,P===Il){if(I.tag===7){i(w,I.sibling),b=o(I,j.props.children),b.return=w,w=b;break e}}else if(I.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Ps&&wy(P)===I.type){i(w,I.sibling),b=o(I,j.props),b.ref=Vd(w,I,j),b.return=w,w=b;break e}i(w,I);break}else r(w,I);I=I.sibling}j.type===Il?(b=Oa(j.props.children,w.mode,T,j.key),b.return=w,w=b):(T=ku(j.type,j.key,j.props,null,w.mode,T),T.ref=Vd(w,b,j),T.return=w,w=T)}return l(w);case Rl:e:{for(I=j.key;b!==null;){if(b.key===I)if(b.tag===4&&b.stateNode.containerInfo===j.containerInfo&&b.stateNode.implementation===j.implementation){i(w,b.sibling),b=o(b,j.children||[]),b.return=w,w=b;break e}else{i(w,b);break}else r(w,b);b=b.sibling}b=Q0(j,w.mode,T),b.return=w,w=b}return l(w);case Ps:return I=j._init,k(w,b,I(j._payload),T)}if(tc(j))return _(w,b,j,T);if(Ld(j))return S(w,b,j,T);Kp(w,j)}return typeof j=="string"&&j!==""||typeof j=="number"?(j=""+j,b!==null&&b.tag===6?(i(w,b.sibling),b=o(b,j),b.return=w,w=b):(i(w,b),b=K0(j,w.mode,T),b.return=w,w=b),l(w)):i(w,b)}return k}var pd=$v(!0),Wv=$v(!1),Hu=sa(null),Gu=null,Ol=null,Wx=null;function Nx(){Wx=Ol=Gu=null}function Ux(e){var r=Hu.current;Mr(Hu),e._currentValue=r}function af(e,r,i){for(;e!==null;){var n=e.alternate;if((e.childLanes&r)!==r?(e.childLanes|=r,n!==null&&(n.childLanes|=r)):n!==null&&(n.childLanes&r)!==r&&(n.childLanes|=r),e===i)break;e=e.return}}
vendor: 2,416 bytes, line 38
38function Kl(e,r){Gu=e,Wx=Ol=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&r&&(un=!0),e.firstContext=null)}function eo(e){var r=e._currentValue;if(Wx!==e)if(e={context:e,memoizedValue:r,next:null},Ol===null){if(Gu===null)throw Error(Ye(308));Ol=e,Gu.dependencies={lanes:0,firstContext:e}}else Ol=Ol.next=e;return r}var Ia=null;function Vx(e){Ia===null?Ia=[e]:Ia.push(e)}function Nv(e,r,i,n){var o=r.interleaved;return o===null?(i.next=i,Vx(r)):(i.next=o.next,o.next=i),r.interleaved=i,hs(e,n)}function hs(e,r){e.lanes|=r;var i=e.alternate;for(i!==null&&(i.lanes|=r),i=e,e=e.return;e!==null;)e.childLanes|=r,i=e.alternate,i!==null&&(i.childLanes|=r),i=e,e=e.return;return i.tag===3?i.stateNode:null}var Fs=!1;function qx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Uv(e,r){e=e.updateQueue,r.updateQueue===e&&(r.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function as(e,r){return{eventTime:e,lane:r,tag:0,payload:null,callback:null,next:null}}function Ys(e,r,i){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ar&2){var o=n.pending;return o===null?r.next=r:(r.next=o.next,o.next=r),n.pending=r,hs(e,i)}return o=n.interleaved,o===null?(r.next=r,Vx(n)):(r.next=o.next,o.next=r),n.interleaved=r,hs(e,i)}function bu(e,r,i){if(r=r.updateQueue,r!==null&&(r=r.shared,(i&4194240)!==0)){var n=r.lanes;n&=e.pendingLanes,i|=n,r.lanes=i,Ix(e,i)}}function _y(e,r){var i=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,i===n)){var o=null,a=null;if(i=i.firstBaseUpdate,i!==null){do{var l={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};a===null?o=a=l:a=a.next=l,i=i.next}while(i!==null);a===null?o=a=r:a=a.next=r}else o=a=r;i={baseState:n.baseState,firstBaseUpdate:o,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=r:e.next=r,i.lastBaseUpdate=r}function Ju(e,r,i,n){var o=e.updateQueue;Fs=!1;var a=o.firstBaseUpdate,l=o.lastBaseUpdate,d=o.shared.pending;if(d!==null){o.shared.pending=null;var p=d,u=p.next;p.next=null,l===null?a=u:l.next=u,l=p;var g=e.alternate;g!==null&&(g=g.updateQueue,d=g.lastBaseUpdate,d!==l&&(d===null?g.firstBaseUpdate=u:d.next=u,g.lastBaseUpdate=p)
vendor: 5,795 bytes, line 38
38)}if(a!==null){var h=o.baseState;l=0,g=u=p=null,d=a;do{var x=d.lane,y=d.eventTime;if((n&x)===x){g!==null&&(g=g.next={eventTime:y,lane:0,tag:d.tag,payload:d.payload,callback:d.callback,next:null});e:{var _=e,S=d;switch(x=r,y=i,S.tag){case 1:if(_=S.payload,typeof _=="function"){h=_.call(y,h,x);break e}h=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=S.payload,x=typeof _=="function"?_.call(y,h,x):_,x==null)break e;h=Gr({},h,x);break e;case 2:Fs=!0}}d.callback!==null&&d.lane!==0&&(e.flags|=64,x=o.effects,x===null?o.effects=[d]:x.push(d))}else y={eventTime:y,lane:x,tag:d.tag,payload:d.payload,callback:d.callback,next:null},g===null?(u=g=y,p=h):g=g.next=y,l|=x;if(d=d.next,d===null){if(d=o.shared.pending,d===null)break;x=d,d=x.next,x.next=null,o.lastBaseUpdate=x,o.shared.pending=null}}while(!0);if(g===null&&(p=h),o.baseState=p,o.firstBaseUpdate=u,o.lastBaseUpdate=g,r=o.shared.interleaved,r!==null){o=r;do l|=o.lane,o=o.next;while(o!==r)}else a===null&&(o.shared.lanes=0);Za|=l,e.lanes=l,e.memoizedState=h}}function Sy(e,r,i){if(e=r.effects,r.effects=null,e!==null)for(r=0;r<e.length;r++){var n=e[r],o=n.callback;if(o!==null){if(n.callback=null,n=i,typeof o!="function")throw Error(Ye(191,o));o.call(n)}}}var hp={},Bo=sa(hp),Lc=sa(hp),$c=sa(hp);function Ta(e){if(e===hp)throw Error(Ye(174));return e}function Hx(e,r){switch(zr($c,r),zr(Lc,e),zr(Bo,hp),e=r.nodeType,e){case 9:case 11:r=(r=r.documentElement)?r.namespaceURI:$g(null,"");break;default:e=e===8?r.parentNode:r,r=e.namespaceURI||null,e=e.tagName,r=$g(r,e)}Mr(Bo),zr(Bo,r)}function ud(){Mr(Bo),Mr(Lc),Mr($c)}function Vv(e){Ta($c.current);var r=Ta(Bo.current),i=$g(r,e.type);r!==i&&(zr(Lc,e),zr(Bo,i))}function Gx(e){Lc.current===e&&(Mr(Bo),Mr(Lc))}var Nr=sa(0);function Zu(e){for(var r=e;r!==null;){if(r.tag===13){var i=r.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if(r.flags&128)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var H0=[];function Jx(){for(var e=0;e<H0.length;e++)H0[e]._workInProgressVersionPrimary=null;H0.length=0}var vu=bs.ReactCurrentDispatcher,G0=bs.ReactCurrentBatchConfig,Ja=0,qr=null,vi=null,Ei=null,Yu=!1,xc=!1,Wc=0,x8=0;function Ni(){throw Error(Ye(321))}function Zx(e,r){if(r===null)return!1;for(var i=0;i<r.length&&i<e.length;i++)if(!_o(e[i],r[i]))return!1;return!0}function Yx(e,r,i,n,o,a){if(Ja=a,qr=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,vu.current=e===null||e.memoizedState===null?v8:j8,e=i(n,o),xc){a=0;do{if(xc=!1,Wc=0,25<=a)throw Error(Ye(301));a+=1,Ei=vi=null,r.updateQueue=null,vu.current=w8,e=i(n,o)}while(xc)}if(vu.current=Xu,r=vi!==null&&vi.next!==null,Ja=0,Ei=vi=qr=null,Yu=!1,r)throw Error(Ye(300));return e}function Xx(){var e=Wc!==0;return Wc=0,e}function Ao(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ei===null?qr.memoizedState=Ei=e:Ei=Ei.next=e,Ei}function to(){if(vi===null){var e=qr.alternate;e=e!==null?e.memoizedState:null}else e=vi.next;var r=Ei===null?qr.memoizedState:Ei.next;if(r!==null)Ei=r,vi=e;else{if(e===null)throw Error(Ye(310));vi=e,e={memoizedState:vi.memoizedState,baseState:vi.baseState,baseQueue:vi.baseQueue,queue:vi.queue,next:null},Ei===null?qr.memoizedState=Ei=e:Ei=Ei.next=e}return Ei}function Nc(e,r){return typeof r=="function"?r(e):r}function J0(e){var r=to(),i=r.queue;if(i===null)throw Error(Ye(311));i.lastRenderedReducer=e;var n=vi,o=n.baseQueue,a=i.pending;if(a!==null){if(o!==null){var l=o.next;o.next=a.next,a.next=l}n.baseQueue=o=a,i.pending=null}if(o!==null){a=o.next,n=n.baseState;var d=l=null,p=null,u=a;do{var g=u.lane;if((Ja&g)===g)p!==null&&(p=p.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var h={lane:g,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};p===null?(d=p=h,l=n):p=p.next=h,qr.lanes|=g,Za|=g}u=u.next}while(u!==null&&u!==a);p===null?l=n:p.next=d,_o(n,r.memoizedState)||(un=!0),r.memoizedState=n,r.baseState=l,r.baseQueue=p,i.lastRenderedState=n}if(e=i.interleaved,e!==null){o=e;do a=o.lane,qr.lanes|=a,Za|=a,o=o.next;while(o!==e)}else o===null&&(i.lanes=0);return[r.memoizedState,i.dispatch]}function Z0(e){var r=to(),i=r.queue;if(i===null)throw Error(Ye(311));i.lastRenderedReducer=e;var n=i.dispatch,o=i.pending,a=r.memoizedState;if(o!==null){i.pending=null;var l=o=o.next;do a=e(a,l.action),l=l.next;while(l!==o);_o(a,r.memoizedState)||(un=!0),r.memoizedState=a,r.baseQueue===null&&(r.baseState=a),i.lastRenderedState=a}return[a,n]}function qv(){}function Hv(e,r){var i=qr,n=to(),o=r(),a=!_o(n.memoizedState,o);if(a&&(n.memoizedState=o,un=!0),n=n.queue,Kx(Zv.bind(null,i,n,e),[e]),n.getSnapshot!==r||a||Ei!==null&&Ei.memoizedState.tag&1){if(i.flags|=2048,Uc(9,Jv.bind(null,i,n,o,r),void 0,null),Ii===null)throw Error(Ye(349));Ja&30||Gv(i,r,o)}return o}function Gv(e,r,i){e.flags|=16384,e={getSnapshot:r,value:i},r=qr.updateQueue,r===null?(r={lastEffect:null,stores:null},qr.updateQueue=r,r.stores=[e]):(i=r.stores,i===null?r.stores=[e]:i.push(e))}function Jv(e,r,i,n){r.value=i,r.getSnapshot=n,Yv(r)&&Xv(e)}function Zv(e,r,i){return i(function(){Yv(r)&&Xv(e)})}function Yv(e){var r=e.getSnapshot;e=e.value;try{var i=r();return!_o(e,i)}catch{return!0}}function Xv(e){var r=hs(e,1);r!==null&&wo(r,e,1,-1)}function ky(e){var r=Ao();return typeof e=="function"&&(e=e()),r.memoizedState=r.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Nc,lastRenderedState:e},r.queue=e,e=e.dispatch=b8.bind(null,qr,e),[r.memoizedState,e]}
vendor: 4,521 bytes, line 38
38function Uc(e,r,i,n){return e={tag:e,create:r,destroy:i,deps:n,next:null},r=qr.updateQueue,r===null?(r={lastEffect:null,stores:null},qr.updateQueue=r,r.lastEffect=e.next=e):(i=r.lastEffect,i===null?r.lastEffect=e.next=e:(n=i.next,i.next=e,e.next=n,r.lastEffect=e)),e}function Kv(){return to().memoizedState}function ju(e,r,i,n){var o=Ao();qr.flags|=e,o.memoizedState=Uc(1|r,i,void 0,n===void 0?null:n)}function Oh(e,r,i,n){var o=to();n=n===void 0?null:n;var a=void 0;if(vi!==null){var l=vi.memoizedState;if(a=l.destroy,n!==null&&Zx(n,l.deps)){o.memoizedState=Uc(r,i,a,n);return}}qr.flags|=e,o.memoizedState=Uc(1|r,i,a,n)}function Cy(e,r){return ju(8390656,8,e,r)}function Kx(e,r){return Oh(2048,8,e,r)}function Qv(e,r){return Oh(4,2,e,r)}function ej(e,r){return Oh(4,4,e,r)}function tj(e,r){if(typeof r=="function")return e=e(),r(e),function(){r(null)};if(r!=null)return e=e(),r.current=e,function(){r.current=null}}function rj(e,r,i){return i=i!=null?i.concat([e]):null,Oh(4,4,tj.bind(null,r,e),i)}function Qx(){}function ij(e,r){var i=to();r=r===void 0?null:r;var n=i.memoizedState;return n!==null&&r!==null&&Zx(r,n[1])?n[0]:(i.memoizedState=[e,r],e)}function nj(e,r){var i=to();r=r===void 0?null:r;var n=i.memoizedState;return n!==null&&r!==null&&Zx(r,n[1])?n[0]:(e=e(),i.memoizedState=[e,r],e)}function oj(e,r,i){return Ja&21?(_o(i,r)||(i=cv(),qr.lanes|=i,Za|=i,e.baseState=!0),r):(e.baseState&&(e.baseState=!1,un=!0),e.memoizedState=i)}function m8(e,r){var i=yr;yr=i!==0&&4>i?i:4,e(!0);var n=G0.transition;G0.transition={};try{e(!1),r()}finally{yr=i,G0.transition=n}}function sj(){return to().memoizedState}function y8(e,r,i){var n=Ks(e);if(i={lane:n,action:i,hasEagerState:!1,eagerState:null,next:null},aj(e))lj(r,i);else if(i=Nv(e,r,i,n),i!==null){var o=tn();wo(i,e,n,o),dj(i,r,n)}}function b8(e,r,i){var n=Ks(e),o={lane:n,action:i,hasEagerState:!1,eagerState:null,next:null};if(aj(e))lj(r,o);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=r.lastRenderedReducer,a!==null))try{var l=r.lastRenderedState,d=a(l,i);if(o.hasEagerState=!0,o.eagerState=d,_o(d,l)){var p=r.interleaved;p===null?(o.next=o,Vx(r)):(o.next=p.next,p.next=o),r.interleaved=o;return}}catch{}finally{}i=Nv(e,r,o,n),i!==null&&(o=tn(),wo(i,e,n,o),dj(i,r,n))}}function aj(e){var r=e.alternate;return e===qr||r!==null&&r===qr}function lj(e,r){xc=Yu=!0;var i=e.pending;i===null?r.next=r:(r.next=i.next,i.next=r),e.pending=r}function dj(e,r,i){if(i&4194240){var n=r.lanes;n&=e.pendingLanes,i|=n,r.lanes=i,Ix(e,i)}}var Xu={readContext:eo,useCallback:Ni,useContext:Ni,useEffect:Ni,useImperativeHandle:Ni,useInsertionEffect:Ni,useLayoutEffect:Ni,useMemo:Ni,useReducer:Ni,useRef:Ni,useState:Ni,useDebugValue:Ni,useDeferredValue:Ni,useTransition:Ni,useMutableSource:Ni,useSyncExternalStore:Ni,useId:Ni,unstable_isNewReconciler:!1},v8={readContext:eo,useCallback:function(e,r){return Ao().memoizedState=[e,r===void 0?null:r],e},useContext:eo,useEffect:Cy,useImperativeHandle:function(e,r,i){return i=i!=null?i.concat([e]):null,ju(4194308,4,tj.bind(null,r,e),i)},useLayoutEffect:function(e,r){return ju(4194308,4,e,r)},useInsertionEffect:function(e,r){return ju(4,2,e,r)},useMemo:function(e,r){var i=Ao();return r=r===void 0?null:r,e=e(),i.memoizedState=[e,r],e},useReducer:function(e,r,i){var n=Ao();return r=i!==void 0?i(r):r,n.memoizedState=n.baseState=r,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},n.queue=e,e=e.dispatch=y8.bind(null,qr,e),[n.memoizedState,e]},useRef:function(e){var r=Ao();return e={current:e},r.memoizedState=e},useState:ky,useDebugValue:Qx,useDeferredValue:function(e){return Ao().memoizedState=e},useTransition:function(){var e=ky(!1),r=e[0];return e=m8.bind(null,e[1]),Ao().memoizedState=e,[r,e]},useMutableSource:function(){},useSyncExternalStore:function(e,r,i){var n=qr,o=Ao();if(Lr){if(i===void 0)throw Error(Ye(407));i=i()}else{if(i=r(),Ii===null)throw Error(Ye(349));Ja&30||Gv(n,r,i)}o.memoizedState=i;var a={value:i,getSnapshot:r};return o.queue=a,Cy(Zv.bind(null,n,a,e),[e]),n.flags|=2048,Uc(9,Jv.bind(null,n,a,i,r),void 0,null),i},useId:function(){var e=Ao(),r=Ii.identifierPrefix;if(Lr){var i=os,n=ns;i=(n&~(1<<32-jo(n)-1)).toString(32)+i,r=":"+r+"R"+i,i=Wc++,0<i&&(r+="H"+i.toString(32)),r+=":"}else i=x8++,r=":"+r+"r"+i.toString(32)+":";return e.memoizedState=r},unstable_isNewReconciler:!1},j8={readContext:eo,useCallback:ij,useContext:eo,useEffect:Kx,useImperativeHandle:rj,useInsertionEffect:Qv,useLayoutEffect:ej,useMemo:nj,useReducer:J0,useRef
vendor: 5,069 bytes, lines 38-40
38:Kv,useState:function(){return J0(Nc)},useDebugValue:Qx,useDeferredValue:function(e){var r=to();return oj(r,vi.memoizedState,e)},useTransition:function(){var e=J0(Nc)[0],r=to().memoizedState;return[e,r]},useMutableSource:qv,useSyncExternalStore:Hv,useId:sj,unstable_isNewReconciler:!1},w8={readContext:eo,useCallback:ij,useContext:eo,useEffect:Kx,useImperativeHandle:rj,useInsertionEffect:Qv,useLayoutEffect:ej,useMemo:nj,useReducer:Z0,useRef:Kv,useState:function(){return Z0(Nc)},useDebugValue:Qx,useDeferredValue:function(e){var r=to();return vi===null?r.memoizedState=e:oj(r,vi.memoizedState,e)},useTransition:function(){var e=Z0(Nc)[0],r=to().memoizedState;return[e,r]},useMutableSource:qv,useSyncExternalStore:Hv,useId:sj,unstable_isNewReconciler:!1};function xo(e,r){if(e&&e.defaultProps){r=Gr({},r),e=e.defaultProps;for(var i in e)r[i]===void 0&&(r[i]=e[i]);return r}return r}function lf(e,r,i,n){r=e.memoizedState,i=i(n,r),i=i==null?r:Gr({},r,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Lh={isMounted:function(e){return(e=e._reactInternals)?ol(e)===e:!1},enqueueSetState:function(e,r,i){e=e._reactInternals;var n=tn(),o=Ks(e),a=as(n,o);a.payload=r,i!=null&&(a.callback=i),r=Ys(e,a,o),r!==null&&(wo(r,e,o,n),bu(r,e,o))},enqueueReplaceState:function(e,r,i){e=e._reactInternals;var n=tn(),o=Ks(e),a=as(n,o);a.tag=1,a.payload=r,i!=null&&(a.callback=i),r=Ys(e,a,o),r!==null&&(wo(r,e,o,n),bu(r,e,o))},enqueueForceUpdate:function(e,r){e=e._reactInternals;var i=tn(),n=Ks(e),o=as(i,n);o.tag=2,r!=null&&(o.callback=r),r=Ys(e,o,n),r!==null&&(wo(r,e,n,i),bu(r,e,n))}};function zy(e,r,i,n,o,a,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,a,l):r.prototype&&r.prototype.isPureReactComponent?!Mc(i,n)||!Mc(o,a):!0}function cj(e,r,i){var n=!1,o=ta,a=r.contextType;return typeof a=="object"&&a!==null?a=eo(a):(o=gn(r)?Ha:Hi.current,n=r.contextTypes,a=(n=n!=null)?dd(e,o):ta),r=new r(i,a),e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Lh,e.stateNode=r,r._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=a),r}function Ey(e,r,i,n){e=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(i,n),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(i,n),r.state!==e&&Lh.enqueueReplaceState(r,r.state,null)}function df(e,r,i,n){var o=e.stateNode;o.props=i,o.state=e.memoizedState,o.refs={},qx(e);var a=r.contextType;typeof a=="object"&&a!==null?o.context=eo(a):(a=gn(r)?Ha:Hi.current,o.context=dd(e,a)),o.state=e.memoizedState,a=r.getDerivedStateFromProps,typeof a=="function"&&(lf(e,r,a,i),o.state=e.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(r=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),r!==o.state&&Lh.enqueueReplaceState(o,o.state,null),Ju(e,i,o,n),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function hd(e,r){try{var i="",n=r;do i+=Yk(n),n=n.return;while(n);var o=i}catch(a){o=` 39Error generating stack: `+a.message+` 40`+a.stack}return{value:e,source:r,stack:o,digest:null}}function Y0(e,r,i){return{value:e,source:null,stack:i??null,digest:r??null}}function cf(e,r){try{console.error(r.value)}catch(i){setTimeout(function(){throw i})}}var _8=typeof WeakMap=="function"?WeakMap:Map;function pj(e,r,i){i=as(-1,i),i.tag=3,i.payload={element:null};var n=r.value;return i.callback=function(){Qu||(Qu=!0,vf=n),cf(e,r)},i}function uj(e,r,i){i=as(-1,i),i.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var o=r.value;i.payload=function(){return n(o)},i.callback=function(){cf(e,r)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(i.callback=function(){cf(e,r),typeof n!="function"&&(Xs===null?Xs=new Set([this]):Xs.add(this));var l=r.stack;this.componentDidCatch(r.value,{componentStack:l!==null?l:""})}),i}function Ry(e,r,i){var n=e.pingCache;if(n===null){n=e.pingCache=new _8;var o=new Set;n.set(r,o)}else o=n.get(r),o===void 0&&(o=new Set,n.set(r,o));o.has(i)||(o.add(i),e=B8.bind(null,e,r,i),r.then(e,e))}function Iy(e){do{var r;if((r=e.tag===13)&&(r=e.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return e;e=e.return}while(e!==null);return null}function Ty(e,r,i,n,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===r?e.flags|=65536:(e.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(r=as(-1,1),r.tag=2,Ys(i,r,1))),i.lanes|=1),e)}var S8=bs.ReactCurrentOwner,un=!1;function Ki(e,r,i,n){r.child=e===null?Wv(r,null,i,n):pd(r,e.child,i,n)}function Ay(e,r,i,n,o){i=i.render;var a=r.ref;return Kl(r,o),n=Yx(e,r,i,n,a,o),i=Xx(),e!==null&&!un?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~o,gs(e,r,o)):(Lr&&i&&Ox(r),r.flags|=1,Ki(e,r,n,o),r.child)}
vendor: 10,378 bytes, line 40
40function Py(e,r,i,n,o){if(e===null){var a=i.type;return typeof a=="function"&&!am(a)&&a.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(r.tag=15,r.type=a,hj(e,r,a,n,o)):(e=ku(i.type,null,n,r,r.mode,o),e.ref=r.ref,e.return=r,r.child=e)}if(a=e.child,!(e.lanes&o)){var l=a.memoizedProps;if(i=i.compare,i=i!==null?i:Mc,i(l,n)&&e.ref===r.ref)return gs(e,r,o)}return r.flags|=1,e=Qs(a,n),e.ref=r.ref,e.return=r,r.child=e}function hj(e,r,i,n,o){if(e!==null){var a=e.memoizedProps;if(Mc(a,n)&&e.ref===r.ref)if(un=!1,r.pendingProps=n=a,(e.lanes&o)!==0)e.flags&131072&&(un=!0);else return r.lanes=e.lanes,gs(e,r,o)}return pf(e,r,i,n,o)}function gj(e,r,i){var n=r.pendingProps,o=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(r.mode&1))r.memoizedState={baseLanes:0,cachePool:null,transitions:null},zr($l,wn),wn|=i;else{if(!(i&1073741824))return e=a!==null?a.baseLanes|i:i,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:e,cachePool:null,transitions:null},r.updateQueue=null,zr($l,wn),wn|=e,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:i,zr($l,wn),wn|=n}else a!==null?(n=a.baseLanes|i,r.memoizedState=null):n=i,zr($l,wn),wn|=n;return Ki(e,r,o,i),r.child}function fj(e,r){var i=r.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(r.flags|=512,r.flags|=2097152)}function pf(e,r,i,n,o){var a=gn(i)?Ha:Hi.current;return a=dd(r,a),Kl(r,o),i=Yx(e,r,i,n,a,o),n=Xx(),e!==null&&!un?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~o,gs(e,r,o)):(Lr&&n&&Ox(r),r.flags|=1,Ki(e,r,i,o),r.child)}function Fy(e,r,i,n,o){if(gn(i)){var a=!0;Uu(r)}else a=!1;if(Kl(r,o),r.stateNode===null)wu(e,r),cj(r,i,n),df(r,i,n,o),n=!0;else if(e===null){var l=r.stateNode,d=r.memoizedProps;l.props=d;var p=l.context,u=i.contextType;typeof u=="object"&&u!==null?u=eo(u):(u=gn(i)?Ha:Hi.current,u=dd(r,u));var g=i.getDerivedStateFromProps,h=typeof g=="function"||typeof l.getSnapshotBeforeUpdate=="function";h||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(d!==n||p!==u)&&Ey(r,l,n,u),Fs=!1;var x=r.memoizedState;l.state=x,Ju(r,n,l,o),p=r.memoizedState,d!==n||x!==p||hn.current||Fs?(typeof g=="function"&&(lf(r,i,g,n),p=r.memoizedState),(d=Fs||zy(r,i,d,n,x,p,u))?(h||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(r.flags|=4194308)):(typeof l.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=n,r.memoizedState=p),l.props=n,l.state=p,l.context=u,n=d):(typeof l.componentDidMount=="function"&&(r.flags|=4194308),n=!1)}else{l=r.stateNode,Uv(e,r),d=r.memoizedProps,u=r.type===r.elementType?d:xo(r.type,d),l.props=u,h=r.pendingProps,x=l.context,p=i.contextType,typeof p=="object"&&p!==null?p=eo(p):(p=gn(i)?Ha:Hi.current,p=dd(r,p));var y=i.getDerivedStateFromProps;(g=typeof y=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(d!==h||x!==p)&&Ey(r,l,n,p),Fs=!1,x=r.memoizedState,l.state=x,Ju(r,n,l,o);var _=r.memoizedState;d!==h||x!==_||hn.current||Fs?(typeof y=="function"&&(lf(r,i,y,n),_=r.memoizedState),(u=Fs||zy(r,i,u,n,x,_,p)||!1)?(g||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(n,_,p),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(n,_,p)),typeof l.componentDidUpdate=="function"&&(r.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof l.componentDidUpdate!="function"||d===e.memoizedProps&&x===e.memoizedState||(r.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&x===e.memoizedState||(r.flags|=1024),r.memoizedProps=n,r.memoizedState=_),l.props=n,l.state=_,l.context=p,n=u):(typeof l.componentDidUpdate!="function"||d===e.memoizedProps&&x===e.memoizedState||(r.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&x===e.memoizedState||(r.flags|=1024),n=!1)}return uf(e,r,i,n,a,o)}function uf(e,r,i,n,o,a){fj(e,r);var l=(r.flags&128)!==0;if(!n&&!l)return o&&by(r,i,!1),gs(e,r,a);n=r.stateNode,S8.current=r;var d=l&&typeof i.getDerivedStateFromError!="function"?null:n.render();return r.flags|=1,e!==null&&l?(r.child=pd(r,e.child,null,a),r.child=pd(r,null,d,a)):Ki(e,r,d,a),r.memoizedState=n.state,o&&by(r,i,!0),r.child}function xj(e){var r=e.stateNode;r.pendingContext?yy(e,r.pendingContext,r.pendingContext!==r.context):r.context&&yy(e,r.context,!1),Hx(e,r.containerInfo)}function My(e,r,i,n,o){return cd(),$x(o),r.flags|=256,Ki(e,r,i,n),r.child}var hf={dehydrated:null,treeContext:null,retryLane:0};function gf(e){return{baseLanes:e,cachePool:null,transitions:null}}function mj(e,r,i){var n=r.pendingProps,o=Nr.current,a=!1,l=(r.flags&128)!==0,d;if((d=l)||(d=e!==null&&e.memoizedState===null?!1:(o&2)!==0),d?(a=!0,r.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),zr(Nr,o&1),e===null)return sf(r),e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(r.mode&1?e.data==="$!"?r.lanes=8:r.lanes=1073741824:r.lanes=1,null):(l=n.children,e=n.fallback,a?(n=r.mode,a=r.child,l={mode:"hidden",children:l},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=l):a=Nh(l,n,0,null),e=Oa(e,n,i,null),a.return=r,e.return=r,a.sibling=e,r.child=a,r.child.memoizedState=gf(i),r.memoizedState=hf,e):em(r,l));if(o=e.memoizedState,o!==null&&(d=o.dehydrated,d!==null))return k8(e,r,l,n,d,o,i);if(a){a=n.fallback,l=r.mode,o=e.child,d=o.sibling;var p={mode:"hidden",children:n.children};return!(l&1)&&r.child!==o?(n=r.child,n.childLanes=0,n.pendingProps=p,r.deletions=null):(n=Qs(o,p),n.subtreeFlags=o.subtreeFlags&14680064),d!==null?a=Qs(d,a):(a=Oa(a,l,i,null),a.flags|=2),a.return=r,n.return=r,n.sibling=a,r.child=n,n=a,a=r.child,l=e.child.memoizedState,l=l===null?gf(i):{baseLanes:l.baseLanes|i,cachePool:null,transitions:l.transitions},a.memoizedState=l,a.childLanes=e.childLanes&~i,r.memoizedState=hf,n}return a=e.child,e=a.sibling,n=Qs(a,{mode:"visible",children:n.children}),!(r.mode&1)&&(n.lanes=i),n.return=r,n.sibling=null,e!==null&&(i=r.deletions,i===null?(r.deletions=[e],r.flags|=16):i.push(e)),r.child=n,r.memoizedState=null,n}function em(e,r){return r=Nh({mode:"visible",children:r},e.mode,0,null),r.return=e,e.child=r}function Qp(e,r,i,n){return n!==null&&$x(n),pd(r,e.child,null,i),e=em(r,r.pendingProps.children),e.flags|=2,r.memoizedState=null,e}function k8(e,r,i,n,o,a,l){if(i)return r.flags&256?(r.flags&=-257,n=Y0(Error(Ye(422))),Qp(e,r,l,n)):r.memoizedState!==null?(r.child=e.child,r.flags|=128,null):(a=n.fallback,o=r.mode,n=Nh({mode:"visible",children:n.children},o,0,null),a=Oa(a,o,l,null),a.flags|=2,n.return=r,a.return=r,n.sibling=a,r.child=n,r.mode&1&&pd(r,e.child,null,l),r.child.memoizedState=gf(l),r.memoizedState=hf,a);if(!(r.mode&1))return Qp(e,r,l,null);if(o.data==="$!"){if(n=o.nextSibling&&o.nextSibling.dataset,n)var d=n.dgst;return n=d,a=Error(Ye(419)),n=Y0(a,n,void 0),Qp(e,r,l,n)}if(d=(l&e.childLanes)!==0,un||d){if(n=Ii,n!==null){switch(l&-l){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(n.suspendedLanes|l)?0:o,o!==0&&o!==a.retryLane&&(a.retryLane=o,hs(e,o),wo(n,e,o,-1))}return sm(),n=Y0(Error(Ye(421))),Qp(e,r,l,n)}return o.data==="$?"?(r.flags|=128,r.child=e.child,r=O8.bind(null,e),o._reactRetry=r,null):(e=a.treeContext,zn=Zs(o.nextSibling),Rn=r,Lr=!0,vo=null,e!==null&&(Jn[Zn++]=ns,Jn[Zn++]=os,Jn[Zn++]=Ga,ns=e.id,os=e.overflow,Ga=r),r=em(r,n.children),r.flags|=4096,r)}function Dy(e,r,i){e.lanes|=r;var n=e.alternate;n!==null&&(n.lanes|=r),af(e.return,r,i)}function X0(e,r,i,n,o){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:n,tail:i,tailMode:o}:(a.isBackwards=r,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=i,a.tailMode=o)}function yj(e,r,i){var n=r.pendingProps,o=n.revealOrder,a=n.tail;if(Ki(e,r,n.children,i),n=Nr.current,n&2)n=n&1|2,r.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=r.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Dy(e,i,r);else if(e.tag===19)Dy(e,i,r);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===r)break e;for(;e.sibling===null;){if(e.return===null||e.return===r)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(zr(Nr,n),!(r.mode&1))r.memoizedState=null;else switch(o){case"forwards":for(i=r.child,o=null;i!==null;)e=i.alternate,e!==null&&Zu(e)===null&&(o=i),i=i.sibling;i=o,i===null?(o=r.child,r.child=null):(o=i.sibling,i.sibling=null),X0(r,!1,o,i,a);break;case"backwards":for(i=null,o=r.child,r.child=null;o!==null;){if(e=o.alternate,e!==null&&Zu(e)===null){r.child=o;break}e=o.sibling,o.sibling=i,i=o,o=e}X0(r,!0,i,null,a);break;case"together":X0(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function wu(e,r){!(r.mode&1)&&e!==null&&(e.alternate=null,r.alternate=null,r.flags|=2)}function gs(e,r,i){if(e!==null&&(r.dependencies=e.dependencies),Za|=r.lanes,!(i&r.childLanes))return null;if(e!==null&&r.child!==e.child)throw Error(Ye(153));if(r.child!==null){for(e=r.child,i=Qs(e,e.pendingProps),r.child=i,i.return=r;e.sibling!==null;)e=e.sibling,i=i.sibling=Qs(e,e.pendingProps),i.return=r;i.sibling=null}return r.child}function C8(e,r,i){switch(r.tag){case 3:xj(r),cd();break;case 5:Vv(r);break;case 1:gn(r.type)&&Uu(r);break;case 4:Hx(r,r.stateNode.containerInfo);break;case 10:var n=r.type._context,o=r.memoizedProps.value;zr(Hu,n._currentValue),n._currentValue=o;break;case 13:if(n=r.memoizedState,n!==null)return n.dehydrated!==null?(zr(Nr,Nr.current&1),r.flags|=128,null):i&r.child.childLanes?mj(e,r,i):(zr(Nr,Nr.current&1),e=gs(e,r,i),e!==null?e.sibling:null);zr(Nr,Nr.current&1);break;case 19:if(n=(i&r.childLanes)!==0,e.flags&128){if(n)return yj(e,r,i);r.flags|=128}if(o=r.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),zr(Nr,Nr.current),n)break;return null;
vendor: 4,598 bytes, line 40
40case 22:case 23:return r.lanes=0,gj(e,r,i)}return gs(e,r,i)}var bj,ff,vj,jj;bj=function(e,r){for(var i=r.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};ff=function(){};vj=function(e,r,i,n){var o=e.memoizedProps;if(o!==n){e=r.stateNode,Ta(Bo.current);var a=null;switch(i){case"input":o=Dg(e,o),n=Dg(e,n),a=[];break;case"select":o=Gr({},o,{value:void 0}),n=Gr({},n,{value:void 0}),a=[];break;case"textarea":o=Lg(e,o),n=Lg(e,n),a=[];break;default:typeof o.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Wu)}Wg(i,n);var l;i=null;for(u in o)if(!n.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var d=o[u];for(l in d)d.hasOwnProperty(l)&&(i||(i={}),i[l]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ec.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in n){var p=n[u];if(d=o!=null?o[u]:void 0,n.hasOwnProperty(u)&&p!==d&&(p!=null||d!=null))if(u==="style")if(d){for(l in d)!d.hasOwnProperty(l)||p&&p.hasOwnProperty(l)||(i||(i={}),i[l]="");for(l in p)p.hasOwnProperty(l)&&d[l]!==p[l]&&(i||(i={}),i[l]=p[l])}else i||(a||(a=[]),a.push(u,i)),i=p;else u==="dangerouslySetInnerHTML"?(p=p?p.__html:void 0,d=d?d.__html:void 0,p!=null&&d!==p&&(a=a||[]).push(u,p)):u==="children"?typeof p!="string"&&typeof p!="number"||(a=a||[]).push(u,""+p):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ec.hasOwnProperty(u)?(p!=null&&u==="onScroll"&&Ir("scroll",e),a||d===p||(a=[])):(a=a||[]).push(u,p))}i&&(a=a||[]).push("style",i);var u=a;(r.updateQueue=u)&&(r.flags|=4)}};jj=function(e,r,i,n){i!==n&&(r.flags|=4)};function qd(e,r){if(!Lr)switch(e.tailMode){case"hidden":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var n=null;i!==null;)i.alternate!==null&&(n=i),i=i.sibling;n===null?r||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Ui(e){var r=e.alternate!==null&&e.alternate.child===e.child,i=0,n=0;if(r)for(var o=e.child;o!==null;)i|=o.lanes|o.childLanes,n|=o.subtreeFlags&14680064,n|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)i|=o.lanes|o.childLanes,n|=o.subtreeFlags,n|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=n,e.childLanes=i,r}function z8(e,r,i){var n=r.pendingProps;switch(Lx(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ui(r),null;case 1:return gn(r.type)&&Nu(),Ui(r),null;case 3:return n=r.stateNode,ud(),Mr(hn),Mr(Hi),Jx(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Xp(r)?r.flags|=4:e===null||e.memoizedState.isDehydrated&&!(r.flags&256)||(r.flags|=1024,vo!==null&&(_f(vo),vo=null))),ff(e,r),Ui(r),null;case 5:Gx(r);var o=Ta($c.current);if(i=r.type,e!==null&&r.stateNode!=null)vj(e,r,i,n,o),e.ref!==r.ref&&(r.flags|=512,r.flags|=2097152);else{if(!n){if(r.stateNode===null)throw Error(Ye(166));return Ui(r),null}if(e=Ta(Bo.current),Xp(r)){n=r.stateNode,i=r.type;var a=r.memoizedProps;switch(n[Fo]=r,n[Oc]=a,e=(r.mode&1)!==0,i){case"dialog":Ir("cancel",n),Ir("close",n);break;case"iframe":case"object":case"embed":Ir("load",n);break;case"video":case"audio":for(o=0;o<ic.length;o++)Ir(ic[o],n);break;case"source":Ir("error",n);break;case"img":case"image":case"link":Ir("error",n),Ir("load",n);break;case"details":Ir("toggle",n);break;case"input":q5(n,a),Ir("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},Ir("invalid",n);break;case"textarea":G5(n,a),Ir("invalid",n)}Wg(i,a),o=null;for(var l in a)if(a.hasOwnProperty(l)){var d=a[l];l==="children"?typeof d=="string"?n.textContent!==d&&(a.suppressHydrationWarning!==!0&&Yp(n.textContent,d,e),o=["children",d]):typeof d=="number"&&n.textContent!==""+d&&(a.suppressHydrationWarning!==!0&&Yp(n.textContent,d,e),o=["children",""+d]):Ec.hasOwnProperty(l)&&d!=null&&l==="onScroll"&&Ir("scroll",n)}switch(i){case"input":Np(n),H5(n,a,!0);break;case"textarea":Np(n),J5(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=Wu)}n=o,r.updateQueue=n,n!==null&&(r.flags|=4)}else{l=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Z1(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>
40",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=l.createElement(i,{is:n.is}):(e=l.createElement(i),i==="select"&&(l=e,n.multiple?l.multiple=!0:n.size&&(l.size=n.size))):e=l.createElementNS(e,i),e[Fo]=r,e[Oc]=n,bj(e,r,!1,!1),r.stateNode=e;e:{switch(l=Ng(i,n),i){case"dialog":Ir("cancel",e),Ir("close",e),o=n;break;case"iframe":case"object":case"embed":Ir("load",e),o=n;break;case"video":case"audio":for(o=0;o<ic.length;o++)Ir(ic[o],e);o=n;break;case"source":Ir("error",e),o=n;break;case"img":case"image":case"link":Ir("error",e),Ir("load",e),o=n;break;case"details":Ir("toggle",e),o=n;break;case"input":q5(e,n),o=Dg(e,n),Ir("invalid",e);break;case"option":o=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},o=Gr({},n,{value:void 0}),Ir("invalid",e);break;case"textarea":G5(e,n),o=Lg(e,n),Ir("invalid",e);break;default:o=n}Wg(i,o),d=o;for(a in d)if(d.hasOwnProperty(a)){var p=d[a];a==="style"?K1(e,p):a==="dangerouslySetInnerHTML"?(p=p?p.__html:void 0,p!=null&&Y1(e,p)):a==="children"?typeof p=="string"?(i!=="textarea"||p!=="")&&Rc(e,p):typeof p=="number"&&Rc(e,""+p):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Ec.hasOwnProperty(a)?p!=null&&a==="onScroll"&&Ir("scroll",e):p!=null&&Sx(e,a,p,l))}switch(i){case"input":Np(e),H5(e,n,!1);break;case"textarea":Np(e),J5(e);break;case"option":n.value!=null&&e.setAttribute("value",""+ea(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?Jl(e,!!n.multiple,a,!1):n.defaultValue!=null&&Jl(e,!!n.multiple,n.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Wu)}switch(i){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return Ui(r),null;case 6:if(e&&r.stateNode!=null)jj(e,r,e.memoizedProps,n);else{if(typeof n!="string"&&r.stateNode===null)throw Error(Ye(166));if(i=Ta($c.current),Ta(Bo.current),Xp(r)){if(n=r.stateNode,i=r.memoizedProps,n[Fo]=r,(a=n.nodeValue!==i)&&(e=Rn,e!==null))switch(e.tag){case 3:Yp(n.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Yp(n.nodeValue,i,(e.mode&1)!==0)}a&&(r.flags|=4)}else n=(i.nodeType===9?i:i.ownerDocument).createTextNode(n),n[Fo]=r,r.stateNode=n}return Ui(r),null;case 13:if(Mr(Nr),n=r.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Lr&&zn!==null&&r.mode&1&&!(r.flags&128))Lv(),cd(),r.flags|=98560,a=!1;else if(a=Xp(r),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(Ye(318));if(a=r.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(Ye(317));a[Fo]=r}else cd(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;Ui(r),a=!1}else vo!==null&&(_f(vo),vo=null),a=!0;if(!a)return r.flags&65536?r:null}return r.flags&128?(r.lanes=i,r):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(r.child.flags|=8192,r.mode&1&&(e===null||Nr.current&1?_i===0&&(_i=3):sm())),r.updateQueue!==null&&(r.flags|=4),Ui(r),null);case 4:return ud(),ff(e,r),e===null&&Dc(r.stateNode.containerInfo),Ui(r),null;case 10:return Ux(r.type._context),Ui(r),null;case 17:return gn(r.type)&&Nu(),Ui(r),null;case 19:if(Mr(Nr),a=r.memoizedState,a===null)return Ui(r),null;if(n=(r.flags&128)!==0,l=a.rendering,l===null)if(n)qd(a,!1);else{if(_i!==0||e!==null&&e.flags&128)for(e=r.child;e!==null;){if(l=Zu(e),l!==null){for(r.flags|=128,qd(a,!1),n=l.updateQueue,n!==null&&(r.updateQueue=n,r.flags|=4),r.subtreeFlags=0,n=i,i=r.child;i!==null;)a=i,e=n,a.flags&=14680066,l=a.alternate,l===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=l.childLanes,a.lanes=l.lanes,a.child=l.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=l.memoizedProps,a.memoizedState=l.memoizedState,a.updateQueue=l.updateQueue,a.type=l.type,e=l.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),i=i.sibling;return zr(Nr,Nr.current&1|2),r.child}e=e.sibling}a.tail!==null&&di()>gd&&(r.flags|=128,n=!0,qd(a,!1),r.lanes=4194304)}else{if(!n)if(e=Zu(l),e!==null){if(r.flags|=128,n=!0,i=e.updateQueue,i!==null&&(r.updateQueue=i,r.flags|=4),qd(a,!0),a.tail===null&&a.tailMode==="hidden"&&!l.alternate&&!Lr)return Ui(r),null}else 2*di()-a.renderingStartTime>gd&&i!==1073741824&&(r.flags|=128,n=!0,qd(a,!1),r.lanes=4194304);a.isBackwards?(l.sibling=r.child,r.child=l):(i=a.last,i!==null?i.sibling=l:r.child=l,a.last=l)}return a.tail!==null?(r=a.tail,a.rendering=r,a.tail=r.sibling,a.renderingStartTime=di(),r.sibling=null,i=Nr.current,zr(Nr,n?i&1|2:i&1),r):(Ui(r),null);case 22:case 23:return om(),n=r.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(r.flags|=8192),n&&r.mode&1?wn&1073741824&&(Ui(r),r.subtreeFlags&6&&(r.flags|=8192)):Ui(r),null;case 24:return null;case 25:return null}throw Error(Ye(156,r.tag))}function E8(e,r){switch(Lx(r),r.tag){case 1:return gn(r.type)&&Nu(),e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;
vendor: 22,698 bytes, line 40
40case 3:return ud(),Mr(hn),Mr(Hi),Jx(),e=r.flags,e&65536&&!(e&128)?(r.flags=e&-65537|128,r):null;case 5:return Gx(r),null;case 13:if(Mr(Nr),e=r.memoizedState,e!==null&&e.dehydrated!==null){if(r.alternate===null)throw Error(Ye(340));cd()}return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 19:return Mr(Nr),null;case 4:return ud(),null;case 10:return Ux(r.type._context),null;case 22:case 23:return om(),null;case 24:return null;default:return null}}var eu=!1,qi=!1,R8=typeof WeakSet=="function"?WeakSet:Set,ht=null;function Ll(e,r){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(n){ii(e,r,n)}else i.current=null}function xf(e,r,i){try{i()}catch(n){ii(e,r,n)}}var By=!1;function I8(e,r){if(Kg=Ou,e=Cv(),Bx(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var n=i.getSelection&&i.getSelection();if(n&&n.rangeCount!==0){i=n.anchorNode;var o=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{i.nodeType,a.nodeType}catch{i=null;break e}var l=0,d=-1,p=-1,u=0,g=0,h=e,x=null;t:for(;;){for(var y;h!==i||o!==0&&h.nodeType!==3||(d=l+o),h!==a||n!==0&&h.nodeType!==3||(p=l+n),h.nodeType===3&&(l+=h.nodeValue.length),(y=h.firstChild)!==null;)x=h,h=y;for(;;){if(h===e)break t;if(x===i&&++u===o&&(d=l),x===a&&++g===n&&(p=l),(y=h.nextSibling)!==null)break;h=x,x=h.parentNode}h=y}i=d===-1||p===-1?null:{start:d,end:p}}else i=null}i=i||{start:0,end:0}}else i=null;for(Qg={focusedElem:e,selectionRange:i},Ou=!1,ht=r;ht!==null;)if(r=ht,e=r.child,(r.subtreeFlags&1028)!==0&&e!==null)e.return=r,ht=e;else for(;ht!==null;){r=ht;try{var _=r.alternate;if(r.flags&1024)switch(r.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var S=_.memoizedProps,k=_.memoizedState,w=r.stateNode,b=w.getSnapshotBeforeUpdate(r.elementType===r.type?S:xo(r.type,S),k);w.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var j=r.stateNode.containerInfo;j.nodeType===1?j.textContent="":j.nodeType===9&&j.documentElement&&j.removeChild(j.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ye(163))}}catch(T){ii(r,r.return,T)}if(e=r.sibling,e!==null){e.return=r.return,ht=e;break}ht=r.return}return _=By,By=!1,_}function mc(e,r,i){var n=r.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var a=o.destroy;o.destroy=void 0,a!==void 0&&xf(r,i,a)}o=o.next}while(o!==n)}}function $h(e,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var n=i.create;i.destroy=n()}i=i.next}while(i!==r)}}function mf(e){var r=e.ref;if(r!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof r=="function"?r(e):r.current=e}}function wj(e){var r=e.alternate;r!==null&&(e.alternate=null,wj(r)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(r=e.stateNode,r!==null&&(delete r[Fo],delete r[Oc],delete r[rf],delete r[u8],delete r[h8])),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 _j(e){return e.tag===5||e.tag===3||e.tag===4}function Oy(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_j(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 yf(e,r,i){var n=e.tag;if(n===5||n===6)e=e.stateNode,r?i.nodeType===8?i.parentNode.insertBefore(e,r):i.insertBefore(e,r):(i.nodeType===8?(r=i.parentNode,r.insertBefore(e,i)):(r=i,r.appendChild(e)),i=i._reactRootContainer,i!=null||r.onclick!==null||(r.onclick=Wu));else if(n!==4&&(e=e.child,e!==null))for(yf(e,r,i),e=e.sibling;e!==null;)yf(e,r,i),e=e.sibling}function bf(e,r,i){var n=e.tag;if(n===5||n===6)e=e.stateNode,r?i.insertBefore(e,r):i.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(bf(e,r,i),e=e.sibling;e!==null;)bf(e,r,i),e=e.sibling}var Bi=null,yo=!1;function Es(e,r,i){for(i=i.child;i!==null;)Sj(e,r,i),i=i.sibling}function Sj(e,r,i){if(Do&&typeof Do.onCommitFiberUnmount=="function")try{Do.onCommitFiberUnmount(Ah,i)}catch{}switch(i.tag){case 5:qi||Ll(i,r);case 6:var n=Bi,o=yo;Bi=null,Es(e,r,i),Bi=n,yo=o,Bi!==null&&(yo?(e=Bi,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):Bi.removeChild(i.stateNode));break;case 18:Bi!==null&&(yo?(e=Bi,i=i.stateNode,e.nodeType===8?V0(e.parentNode,i):e.nodeType===1&&V0(e,i),Pc(e)):V0(Bi,i.stateNode));break;case 4:n=Bi,o=yo,Bi=i.stateNode.containerInfo,yo=!0,Es(e,r,i),Bi=n,yo=o;break;case 0:case 11:case 14:case 15:if(!qi&&(n=i.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){o=n=n.next;do{var a=o,l=a.destroy;a=a.tag,l!==void 0&&(a&2||a&4)&&xf(i,r,l),o=o.next}while(o!==n)}Es(e,r,i);break;case 1:if(!qi&&(Ll(i,r),n=i.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=i.memoizedProps,n.state=i.memoizedState,n.componentWillUnmount()}catch(d){ii(i,r,d)}Es(e,r,i);break;case 21:Es(e,r,i);break;case 22:i.mode&1?(qi=(n=qi)||i.memoizedState!==null,Es(e,r,i),qi=n):Es(e,r,i);break;default:Es(e,r,i)}}function Ly(e){var r=e.updateQueue;if(r!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new R8),r.forEach(function(n){var o=L8.bind(null,e,n);i.has(n)||(i.add(n),n.then(o,o))})}}function ho(e,r){var i=r.deletions;if(i!==null)for(var n=0;n<i.length;n++){var o=i[n];try{var a=e,l=r,d=l;e:for(;d!==null;){switch(d.tag){case 5:Bi=d.stateNode,yo=!1;break e;case 3:Bi=d.stateNode.containerInfo,yo=!0;break e;case 4:Bi=d.stateNode.containerInfo,yo=!0;break e}d=d.return}if(Bi===null)throw Error(Ye(160));Sj(a,l,o),Bi=null,yo=!1;var p=o.alternate;p!==null&&(p.return=null),o.return=null}catch(u){ii(o,r,u)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)kj(r,e),r=r.sibling}function kj(e,r){var i=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ho(r,e),Ro(e),n&4){try{mc(3,e,e.return),$h(3,e)}catch(S){ii(e,e.return,S)}try{mc(5,e,e.return)}catch(S){ii(e,e.return,S)}}break;case 1:ho(r,e),Ro(e),n&512&&i!==null&&Ll(i,i.return);break;case 5:if(ho(r,e),Ro(e),n&512&&i!==null&&Ll(i,i.return),e.flags&32){var o=e.stateNode;try{Rc(o,"")}catch(S){ii(e,e.return,S)}}if(n&4&&(o=e.stateNode,o!=null)){var a=e.memoizedProps,l=i!==null?i.memoizedProps:a,d=e.type,p=e.updateQueue;if(e.updateQueue=null,p!==null)try{d==="input"&&a.type==="radio"&&a.name!=null&&G1(o,a),Ng(d,l);var u=Ng(d,a);for(l=0;l<p.length;l+=2){var g=p[l],h=p[l+1];g==="style"?K1(o,h):g==="dangerouslySetInnerHTML"?Y1(o,h):g==="children"?Rc(o,h):Sx(o,g,h,u)}switch(d){case"input":Bg(o,a);break;case"textarea":J1(o,a);break;case"select":var x=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!a.multiple;var y=a.value;y!=null?Jl(o,!!a.multiple,y,!1):x!==!!a.multiple&&(a.defaultValue!=null?Jl(o,!!a.multiple,a.defaultValue,!0):Jl(o,!!a.multiple,a.multiple?[]:"",!1))}o[Oc]=a}catch(S){ii(e,e.return,S)}}break;case 6:if(ho(r,e),Ro(e),n&4){if(e.stateNode===null)throw Error(Ye(162));o=e.stateNode,a=e.memoizedProps;try{o.nodeValue=a}catch(S){ii(e,e.return,S)}}break;case 3:if(ho(r,e),Ro(e),n&4&&i!==null&&i.memoizedState.isDehydrated)try{Pc(r.containerInfo)}catch(S){ii(e,e.return,S)}break;case 4:ho(r,e),Ro(e);break;case 13:ho(r,e),Ro(e),o=e.child,o.flags&8192&&(a=o.memoizedState!==null,o.stateNode.isHidden=a,!a||o.alternate!==null&&o.alternate.memoizedState!==null||(im=di())),n&4&&Ly(e);break;case 22:if(g=i!==null&&i.memoizedState!==null,e.mode&1?(qi=(u=qi)||g,ho(r,e),qi=u):ho(r,e),Ro(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!g&&e.mode&1)for(ht=e,g=e.child;g!==null;){for(h=ht=g;ht!==null;){switch(x=ht,y=x.child,x.tag){case 0:case 11:case 14:case 15:mc(4,x,x.return);break;case 1:Ll(x,x.return);var _=x.stateNode;if(typeof _.componentWillUnmount=="function"){n=x,i=x.return;try{r=n,_.props=r.memoizedProps,_.state=r.memoizedState,_.componentWillUnmount()}catch(S){ii(n,i,S)}}break;case 5:Ll(x,x.return);break;case 22:if(x.memoizedState!==null){Wy(h);continue}}y!==null?(y.return=x,ht=y):Wy(h)}g=g.sibling}e:for(g=null,h=e;;){if(h.tag===5){if(g===null){g=h;try{o=h.stateNode,u?(a=o.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(d=h.stateNode,p=h.memoizedProps.style,l=p!=null&&p.hasOwnProperty("display")?p.display:null,d.style.display=X1("display",l))}catch(S){ii(e,e.return,S)}}}else if(h.tag===6){if(g===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(S){ii(e,e.return,S)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;g===h&&(g=null),h=h.return}g===h&&(g=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:ho(r,e),Ro(e),n&4&&Ly(e);break;case 21:break;default:ho(r,e),Ro(e)}}function Ro(e){var r=e.flags;if(r&2){try{e:{for(var i=e.return;i!==null;){if(_j(i)){var n=i;break e}i=i.return}throw Error(Ye(160))}switch(n.tag){case 5:var o=n.stateNode;n.flags&32&&(Rc(o,""),n.flags&=-33);var a=Oy(e);bf(e,a,o);break;case 3:case 4:var l=n.stateNode.containerInfo,d=Oy(e);yf(e,d,l);break;default:throw Error(Ye(161))}}catch(p){ii(e,e.return,p)}e.flags&=-3}r&4096&&(e.flags&=-4097)}function T8(e,r,i){ht=e,Cj(e)}function Cj(e,r,i){for(var n=(e.mode&1)!==0;ht!==null;){var o=ht,a=o.child;if(o.tag===22&&n){var l=o.memoizedState!==null||eu;if(!l){var d=o.alternate,p=d!==null&&d.memoizedState!==null||qi;d=eu;var u=qi;if(eu=l,(qi=p)&&!u)for(ht=o;ht!==null;)l=ht,p=l.child,l.tag===22&&l.memoizedState!==null?Ny(o):p!==null?(p.return=l,ht=p):Ny(o);for(;a!==null;)ht=a,Cj(a),a=a.sibling;ht=o,eu=d,qi=u}$y(e)}else o.subtreeFlags&8772&&a!==null?(a.return=o,ht=a):$y(e)}}function $y(e){for(;ht!==null;){var r=ht;if(r.flags&8772){var i=r.alternate;try{if(r.flags&8772)switch(r.tag){case 0:case 11:case 15:qi||$h(5,r);break;case 1:var n=r.stateNode;if(r.flags&4&&!qi)if(i===null)n.componentDidMount();else{var o=r.elementType===r.type?i.memoizedProps:xo(r.type,i.memoizedProps);n.componentDidUpdate(o,i.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=r.updateQueue;a!==null&&Sy(r,a,n);break;case 3:var l=r.updateQueue;if(l!==null){if(i=null,r.child!==null)switch(r.child.tag){case 5:i=r.child.stateNode;break;case 1:i=r.child.stateNode}Sy(r,l,i)}break;case 5:var d=r.stateNode;if(i===null&&r.flags&4){i=d;var p=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":p.autoFocus&&i.focus();break;case"img":p.src&&(i.src=p.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var u=r.alternate;if(u!==null){var g=u.memoizedState;if(g!==null){var h=g.dehydrated;h!==null&&Pc(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Ye(163))}qi||r.flags&512&&mf(r)}catch(x){ii(r,r.return,x)}}if(r===e){ht=null;break}if(i=r.sibling,i!==null){i.return=r.return,ht=i;break}ht=r.return}}function Wy(e){for(;ht!==null;){var r=ht;if(r===e){ht=null;break}var i=r.sibling;if(i!==null){i.return=r.return,ht=i;break}ht=r.return}}function Ny(e){for(;ht!==null;){var r=ht;try{switch(r.tag){case 0:case 11:case 15:var i=r.return;try{$h(4,r)}catch(p){ii(r,i,p)}break;case 1:var n=r.stateNode;if(typeof n.componentDidMount=="function"){var o=r.return;try{n.componentDidMount()}catch(p){ii(r,o,p)}}var a=r.return;try{mf(r)}catch(p){ii(r,a,p)}break;case 5:var l=r.return;try{mf(r)}catch(p){ii(r,l,p)}}}catch(p){ii(r,r.return,p)}if(r===e){ht=null;break}var d=r.sibling;if(d!==null){d.return=r.return,ht=d;break}ht=r.return}}var A8=Math.ceil,Ku=bs.ReactCurrentDispatcher,tm=bs.ReactCurrentOwner,Xn=bs.ReactCurrentBatchConfig,ar=0,Ii=null,gi=null,$i=0,wn=0,$l=sa(0),_i=0,Vc=null,Za=0,Wh=0,rm=0,yc=null,pn=null,im=0,gd=1/0,ts=null,Qu=!1,vf=null,Xs=null,tu=!1,Ns=null,eh=0,bc=0,jf=null,_u=-1,Su=0;function tn(){return ar&6?di():_u!==-1?_u:_u=di()}function Ks(e){return e.mode&1?ar&2&&$i!==0?$i&-$i:f8.transition!==null?(Su===0&&(Su=cv()),Su):(e=yr,e!==0||(e=window.event,e=e===void 0?16:mv(e.type)),e):1}function wo(e,r,i,n){if(50<bc)throw bc=0,jf=null,Error(Ye(185));cp(e,i,n),(!(ar&2)||e!==Ii)&&(e===Ii&&(!(ar&2)&&(Wh|=i),_i===4&&Bs(e,$i)),fn(e,n),i===1&&ar===0&&!(r.mode&1)&&(gd=di()+500,Bh&&aa()))}function fn(e,r){var i=e.callbackNode;f4(e,r);var n=Bu(e,e===Ii?$i:0);if(n===0)i!==null&&X5(i),e.callbackNode=null,e.callbackPriority=0;else if(r=n&-n,e.callbackPriority!==r){if(i!=null&&X5(i),r===1)e.tag===0?g8(Uy.bind(null,e)):Dv(Uy.bind(null,e)),c8(function(){!(ar&6)&&aa()}),i=null;else{switch(pv(n)){case 1:i=Rx;break;case 4:i=lv;break;case 16:i=Du;break;case 536870912:i=dv;break;default:i=Du}i=Fj(i,zj.bind(null,e))}e.callbackPriority=r,e.callbackNode=i}}function zj(e,r){if(_u=-1,Su=0,ar&6)throw Error(Ye(327));var i=e.callbackNode;if(Ql()&&e.callbackNode!==i)return null;var n=Bu(e,e===Ii?$i:0);if(n===0)return null;if(n&30||n&e.expiredLanes||r)r=th(e,n);else{r=n;var o=ar;ar|=2;var a=Rj();(Ii!==e||$i!==r)&&(ts=null,gd=di()+500,Ba(e,r));do try{M8();break}catch(d){Ej(e,d)}while(!0);Nx(),Ku.current=a,ar=o,gi!==null?r=0:(Ii=null,$i=0,r=_i)}if(r!==0){if(r===2&&(o=Gg(e),o!==0&&(n=o,r=wf(e,o))),r===1)throw i=Vc,Ba(e,0),Bs(e,n),fn(e,di()),i;if(r===6)Bs(e,n);else{if(o=e.current.alternate,!(n&30)&&!P8(o)&&(r=th(e,n),r===2&&(a=Gg(e),a!==0&&(n=a,r=wf(e,a))),r===1))throw i=Vc,Ba(e,0),Bs(e,n),fn(e,di()),i;switch(e.finishedWork=o,e.finishedLanes=n,r){case 0:case 1:throw Error(Ye(345));case 2:ja(e,pn,ts);break;case 3:if(Bs(e,n),(n&130023424)===n&&(r=im+500-di(),10<r)){if(Bu(e,0)!==0)break;if(o=e.suspendedLanes,(o&n)!==n){tn(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=tf(ja.bind(null,e,pn,ts),r);break}ja(e,pn,ts);break;case 4:if(Bs(e,n),(n&4194240)===n)break;for(r=e.eventTimes,o=-1;0<n;){var l=31-jo(n);a=1<<l,l=r[l],l>o&&(o=l),n&=~a}if(n=o,n=di()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*A8(n/1960))-n,10<n){e.timeoutHandle=tf(ja.bind(null,e,pn,ts),n);break}ja(e,pn,ts);break;case 5:ja(e,pn,ts);break;default:throw Error(Ye(329))}}}return fn(e,di()),e.callbackNode===i?zj.bind(null,e):null}function wf(e,r){var i=yc;return e.current.memoizedState.isDehydrated&&(Ba(e,r).flags|=256),e=th(e,r),e!==2&&(r=pn,pn=i,r!==null&&_f(r)),e}function _f(e){pn===null?pn=e:pn.push.apply(pn,e)}function P8(e){for(var r=e;;){if(r.flags&16384){var i=r.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var n=0;n<i.length;n++){var o=i[n],a=o.getSnapshot;o=o.value;try{if(!_o(a(),o))return!1}catch{return!1}}}if(i=r.child,r.subtreeFlags&16384&&i!==null)i.return=r,r=i;else{if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Bs(e,r){for(r&=~rm,r&=~Wh,e.suspendedLanes|=r,e.pingedLanes&=~r,e=e.expirationTimes;0<r;){var i=31-jo(r),n=1<<i;e[i]=-1,r&=~n}}function Uy(e){if(ar&6)throw Error(Ye(327));Ql();var r=Bu(e,0);if(!(r&1))return fn(e,di()),null;var i=th(e,r);if(e.tag!==0&&i===2){var n=Gg(e);n!==0&&(r=n,i=wf(e,n))}if(i===1)throw i=Vc,Ba(e,0),Bs(e,r),fn(e,di()),i;if(i===6)throw Error(Ye(345));return e.finishedWork=e.current.alternate,e.finishedLanes=r,ja(e,pn,ts),fn(e,di()),null}function nm(e,r){var i=ar;ar|=1;try{return e(r)}finally{ar=i,ar===0&&(gd=di()+500,Bh&&aa())}}function Ya(e){Ns!==null&&Ns.tag===0&&!(ar&6)&&Ql();var r=ar;ar|=1;var i=Xn.transition,n=yr;try{if(Xn.transition=null,yr=1,e)return e()}finally{yr=n,Xn.transition=i,ar=r,!(ar&6)&&aa()}}function om(){wn=$l.current,Mr($l)}function Ba(e,r){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,d8(i)),gi!==null)for(i=gi.return;i!==null;){var n=i;switch(Lx(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Nu();break;case 3:ud(),Mr(hn),Mr(Hi),Jx();break;case 5:Gx(n);break;case 4:ud();break;case 13:Mr(Nr);break;case 19:Mr(Nr);break;case 10:Ux(n.type._context);break;case 22:case 23:om()}i=i.return}if(Ii=e,gi=e=Qs(e.current,null),$i=wn=r,_i=0,Vc=null,rm=Wh=Za=0,pn=yc=null,Ia!==null){for(r=0;r<Ia.length;r++)if(i=Ia[r],n=i.interleaved,n!==null){i.interleaved=null;var o=n.next,a=i.pending;if(a!==null){var l=a.next;a.next=o,n.next=l}i.pending=n}Ia=null}return e}function Ej(e,r){do{var i=gi;try{if(Nx(),vu.current=Xu,Yu){for(var n=qr.memoizedState;n!==null;){var o=n.queue;o!==null&&(o.pending=null),n=n.next}Yu=!1}if(Ja=0,Ei=vi=qr=null,xc=!1,Wc=0,tm.current=null,i===null||i.return===null){_i=1,Vc=r,gi=null;break}e:{var a=e,l=i.return,d=i,p=r;if(r=$i,d.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){var u=p,g=d,h=g.tag;if(!(g.mode&1)&&(h===0||h===11||h===15)){var x=g.alternate;x?(g.updateQueue=x.updateQueue,g.memoizedState=x.memoizedState,g.lanes=x.lanes):(g.updateQueue=null,g.memoizedState=null)}var y=Iy(l);if(y!==null){y.flags&=-257,Ty(y,l,d,a,r),y.mode&1&&Ry(a,u,r),r=y,p=u;var _=r.updateQueue;if(_===null){var S=new Set;S.add(p),r.updateQueue=S}else _.add(p);break e}else{if(!(r&1)){Ry(a,u,r),sm();break e}p=Error(Ye(426))}}else if(Lr&&d.mode&1){var k=Iy(l);if(k!==null){!(k.flags&65536)&&(k.flags|=256),Ty(k,l,d,a,r),$x(hd(p,d));break e}}a=p=hd(p,d),_i!==4&&(_i=2),yc===null?yc=[a]:yc.push(a),a=l;do{switch(a.tag){case 3:a.flags|=65536,r&=-r,a.lanes|=r;var w=pj(a,p,r);_y(a,w);break e;case 1:d=p;var b=a.type,j=a.stateNode;if(!(a.flags&128)&&(typeof b.getDerivedStateFromError=="function"||j!==null&&typeof j.componentDidCatch=="function"&&(Xs===null||!Xs.has(j)))){a.flags|=65536,r&=-r,a.lanes|=r;var T=uj(a,d,r);_y(a,T);break e}}a=a.return}while(a!==null)}Tj(i)}catch(P){r=P,gi===i&&i!==null&&(gi=i=i.return);continue}break}while(!0)}function Rj(){var e=Ku.current;return Ku.current=Xu,e===null?Xu:e}function sm(){(_i===0||_i===3||_i===2)&&(_i=4),Ii===null||!(Za&268435455)&&!(Wh&268435455)||Bs(Ii,$i)}function th(e,r){var i=ar;ar|=2;var n=Rj();(Ii!==e||$i!==r)&&(ts=null,Ba(e,r));do try{F8();break}catch(o){Ej(e,o)}while(!0);if(Nx(),ar=i,Ku.current=n,gi!==null)throw Error(Ye(261));return Ii=null,$i=0,_i}function F8(){for(;gi!==null;)Ij(gi)}function M8(){for(;gi!==null&&!s4();)Ij(gi)}function Ij(e){var r=Pj(e.alternate,e,wn);e.memoizedProps=e.pendingProps,r===null?Tj(e):gi=r,tm.current=null}function Tj(e){var r=e;do{var i=r.alternate;if(e=r.return,r.flags&32768){if(i=E8(i,r),i!==null){i.flags&=32767,gi=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{_i=6,gi=null;return}}else if(i=z8(i,r,wn),i!==null){gi=i;return}if(r=r.sibling,r!==null){gi=r;return}gi=r=e}while(r!==null);_i===0&&(_i=5)}function ja(e,r,i){var n=yr,o=Xn.transition;try{Xn.transition=null,yr=1,D8(e,r,i,n)}finally{Xn.transition=o,yr=n}return null}function D8(e,r,i,n){do Ql();while(Ns!==null);if(ar&6)throw Error(Ye(327));i=e.finishedWork;var o=e.finishedLanes;if(i===null)return null;if(e.finishedWork=null,e.finishedLanes=0,i===e.current)throw Error(Ye(177));e.callbackNode=null,e.callbackPriority=0;var a=i.lanes|i.childLanes;if(x4(e,a),e===Ii&&(gi=Ii=null,$i=0),!(i.subtreeFlags&2064)&&!(i.flags&2064)||tu||(tu=!0,Fj(Du,function(){return Ql(),null})),a=(i.flags&15990)!==0,i.subtreeFlags&15990||a){a=Xn.transition,Xn.transition=null;var l=yr;yr=1;var d=ar;ar|=4,tm.current=null,I8(e,i),kj(i,e),r8(Qg),Ou=!!Kg,Qg=Kg=null,e.current=i,T8(i),a4(),ar=d,yr=l,Xn.transition=a}else e.current=i;if(tu&&(tu=!1,Ns=e,eh=o),a=e.pendingLanes,a===0&&(Xs=null),c4(i.stateNode),fn(e,di()),r!==null)for(n=e.onRecoverableError,i=0;i<r.length;i++)o=r[i],n(o.value,{componentStack:o.stack,digest:o.digest});if(Qu)throw Qu=!1,e=vf,vf=null,e;return eh&1&&e.tag!==0&&Ql(),a=e.pendingLanes,a&1?e===jf?bc++:(bc=0,jf=e):bc=0,aa(),null}function Ql(){if(Ns!==null){var e=pv(eh),r=Xn.transition,i=yr;try{if(Xn.transition=null,yr=16>e?16:e,Ns===null)var n=!1;else{if(e=Ns,Ns=null,eh=0,ar&6)throw Error(Ye(331));var o=ar;for(ar|=4,ht=e.current;ht!==null;){var a=ht,l=a.child;if(ht.flags&16){var d=a.deletions;if(d!==null){for(var p=0;p<d.length;p++){var u=d[p];for(ht=u;ht!==null;){var g=ht;switch(g.tag){case 0:case 11:case 15:mc(8,g,a)}var h=g.child;if(h!==null)h.return=g,ht=h;else for(;ht!==null;){g=ht;var x=g.sibling,y=g.return;if(wj(g),g===u){ht=null;break}if(x!==null){x.return=y,ht=x;break}ht=y}}}var _=a.alternate;if(_!==null){var S=_.child;if(S!==null){_.child=null;do{var k=S.sibling;S.sibling=null,S=k}while(S!==null)}}ht=a}}if(a.subtreeFlags&2064&&l!==null)l.return=a,ht=l;else e:for(;ht!==null;){if(a=ht,a.flags&2048)switch(a.tag){case 0:case 11:case 15:mc(9,a,a.return)}var w=a.sibling;if(w!==null){w.return=a.return,ht=w;break e}ht=a.return}}var b=e.current;for(ht=b;ht!==null;){l=ht;var j=l.child;if(l.subtreeFlags&2064&&j!==null)j.return=l,ht=j;else e:for(l=b;ht!==null;){if(d=ht,d.flags&2048)try{switch(d.tag){case 0:case 11:case 15:$h(9,d)}}catch(P){ii(d,d.return,P)}if(d===l){ht=null;break e}var T=d.sibling;if(T!==null){T.return=d.return,ht=T;break e}ht=d.return}}if(ar=o,aa(),Do&&typeof Do.onPostCommitFiberRoot=="function")try{Do.onPostCommitFiberRoot(Ah,e)}catch{}n=!0}return n}finally{yr=i,Xn.transition=r}}return!1}function Vy(e,r,i){r=hd(i,r),r=pj(e,r,1),e=Ys(e,r,1),r=tn(),e!==null&&(cp(e,1,r),fn(e,r))}function ii(e,r,i){if(e.tag===3)Vy(e,e,i);else for(;r!==null;){if(r.tag===3){Vy(r,e,i);break}else if(r.tag===1){var n=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Xs===null||!Xs.has(n))){e=hd(i,e),e=uj(r,e,1),r=Ys(r,e,1),e=tn(),r!==null&&(cp(r,1,e),fn(r,e));break}}r=r.return}}function B8(e,r,i){var n=e.pingCache;n!==null&&n.delete(r),r=tn(),e.pingedLanes|=e.suspendedLanes&i,Ii===e&&($i&i)===i&&(_i===4||_i===3&&($i&130023424)===$i&&500>di()-im?Ba(e,0):rm|=i),fn(e,r)}function Aj(e,r){r===0&&(e.mode&1?(r=qp,qp<<=1,!(qp&130023424)&&(qp=4194304)):r=1);var i=tn();e=hs(e,r),e!==null&&(cp(e,r,i),fn(e,i))}function O8(e){var r=e.memoizedState,i=0;r!==null&&(i=r.retryLane),Aj(e,i)}function L8(e,r){var i=0;switch(e.tag){case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(i=o.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(Ye(314))}n!==null&&n.delete(r),Aj(e,i)}var Pj;Pj=function(e,r,i){if(e!==null)if(e.memoizedProps!==r.pendingProps||hn.current)un=!0;else{if(!(e.lanes&i)&&!(r.flags&128))return un=!1,C8(e,r,i);un=!!(e.flags&131072)}else un=!1,Lr&&r.flags&1048576&&Bv(r,qu,r.index);switch(r.lanes=0,r.tag){case 2:var n=r.type;wu(e,r),e=r.pendingProps;var o=dd(r,Hi.current);Kl(r,i),o=Yx(null,r,n,e,o,i);var a=Xx();return r.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,gn(n)?(a=!0,Uu(r)):a=!1,r.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,qx(r),o.updater=Lh,r.stateNode=o,o._reactInternals=r,df(r,n,e,i),r=uf(null,r,n,!0,a,i)):(r.tag=0,Lr&&a&&Ox(r),Ki(null,r,o,i),r
vendor: 4,272 bytes, line 40
40=r.child),r;case 16:n=r.elementType;e:{switch(wu(e,r),e=r.pendingProps,o=n._init,n=o(n._payload),r.type=n,o=r.tag=W8(n),e=xo(n,e),o){case 0:r=pf(null,r,n,e,i);break e;case 1:r=Fy(null,r,n,e,i);break e;case 11:r=Ay(null,r,n,e,i);break e;case 14:r=Py(null,r,n,xo(n.type,e),i);break e}throw Error(Ye(306,n,""))}return r;case 0:return n=r.type,o=r.pendingProps,o=r.elementType===n?o:xo(n,o),pf(e,r,n,o,i);case 1:return n=r.type,o=r.pendingProps,o=r.elementType===n?o:xo(n,o),Fy(e,r,n,o,i);case 3:e:{if(xj(r),e===null)throw Error(Ye(387));n=r.pendingProps,a=r.memoizedState,o=a.element,Uv(e,r),Ju(r,n,null,i);var l=r.memoizedState;if(n=l.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},r.updateQueue.baseState=a,r.memoizedState=a,r.flags&256){o=hd(Error(Ye(423)),r),r=My(e,r,n,i,o);break e}else if(n!==o){o=hd(Error(Ye(424)),r),r=My(e,r,n,i,o);break e}else for(zn=Zs(r.stateNode.containerInfo.firstChild),Rn=r,Lr=!0,vo=null,i=Wv(r,null,n,i),r.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(cd(),n===o){r=gs(e,r,i);break e}Ki(e,r,n,i)}r=r.child}return r;case 5:return Vv(r),e===null&&sf(r),n=r.type,o=r.pendingProps,a=e!==null?e.memoizedProps:null,l=o.children,ef(n,o)?l=null:a!==null&&ef(n,a)&&(r.flags|=32),fj(e,r),Ki(e,r,l,i),r.child;case 6:return e===null&&sf(r),null;case 13:return mj(e,r,i);case 4:return Hx(r,r.stateNode.containerInfo),n=r.pendingProps,e===null?r.child=pd(r,null,n,i):Ki(e,r,n,i),r.child;case 11:return n=r.type,o=r.pendingProps,o=r.elementType===n?o:xo(n,o),Ay(e,r,n,o,i);case 7:return Ki(e,r,r.pendingProps,i),r.child;case 8:return Ki(e,r,r.pendingProps.children,i),r.child;case 12:return Ki(e,r,r.pendingProps.children,i),r.child;case 10:e:{if(n=r.type._context,o=r.pendingProps,a=r.memoizedProps,l=o.value,zr(Hu,n._currentValue),n._currentValue=l,a!==null)if(_o(a.value,l)){if(a.children===o.children&&!hn.current){r=gs(e,r,i);break e}}else for(a=r.child,a!==null&&(a.return=r);a!==null;){var d=a.dependencies;if(d!==null){l=a.child;for(var p=d.firstContext;p!==null;){if(p.context===n){if(a.tag===1){p=as(-1,i&-i),p.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var g=u.pending;g===null?p.next=p:(p.next=g.next,g.next=p),u.pending=p}}a.lanes|=i,p=a.alternate,p!==null&&(p.lanes|=i),af(a.return,i,r),d.lanes|=i;break}p=p.next}}else if(a.tag===10)l=a.type===r.type?null:a.child;else if(a.tag===18){if(l=a.return,l===null)throw Error(Ye(341));l.lanes|=i,d=l.alternate,d!==null&&(d.lanes|=i),af(l,i,r),l=a.sibling}else l=a.child;if(l!==null)l.return=a;else for(l=a;l!==null;){if(l===r){l=null;break}if(a=l.sibling,a!==null){a.return=l.return,l=a;break}l=l.return}a=l}Ki(e,r,o.children,i),r=r.child}return r;case 9:return o=r.type,n=r.pendingProps.children,Kl(r,i),o=eo(o),n=n(o),r.flags|=1,Ki(e,r,n,i),r.child;case 14:return n=r.type,o=xo(n,r.pendingProps),o=xo(n.type,o),Py(e,r,n,o,i);case 15:return hj(e,r,r.type,r.pendingProps,i);case 17:return n=r.type,o=r.pendingProps,o=r.elementType===n?o:xo(n,o),wu(e,r),r.tag=1,gn(n)?(e=!0,Uu(r)):e=!1,Kl(r,i),cj(r,n,o),df(r,n,o,i),uf(null,r,n,!0,e,i);case 19:return yj(e,r,i);case 22:return gj(e,r,i)}throw Error(Ye(156,r.tag))};function Fj(e,r){return av(e,r)}function $8(e,r,i,n){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yn(e,r,i,n){return new $8(e,r,i,n)}function am(e){return e=e.prototype,!(!e||!e.isReactComponent)}function W8(e){if(typeof e=="function")return am(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Cx)return 11;if(e===zx)return 14}return 2}function Qs(e,r){var i=e.alternate;return i===null?(i=Yn(e.tag,r,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=r,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&14680064,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,r=e.depen
vendor: 9,814 bytes, lines 40-49
40dencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function ku(e,r,i,n,o,a){var l=2;if(n=e,typeof e=="function")am(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Il:return Oa(i.children,o,a,r);case kx:l=8,o|=8;break;case Ag:return e=Yn(12,i,r,o|2),e.elementType=Ag,e.lanes=a,e;case Pg:return e=Yn(13,i,r,o),e.elementType=Pg,e.lanes=a,e;case Fg:return e=Yn(19,i,r,o),e.elementType=Fg,e.lanes=a,e;case V1:return Nh(i,o,a,r);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case N1:l=10;break e;case U1:l=9;break e;case Cx:l=11;break e;case zx:l=14;break e;case Ps:l=16,n=null;break e}throw Error(Ye(130,e==null?e:typeof e,""))}return r=Yn(l,i,r,o),r.elementType=e,r.type=n,r.lanes=a,r}function Oa(e,r,i,n){return e=Yn(7,e,n,r),e.lanes=i,e}function Nh(e,r,i,n){return e=Yn(22,e,n,r),e.elementType=V1,e.lanes=i,e.stateNode={isHidden:!1},e}function K0(e,r,i){return e=Yn(6,e,null,r),e.lanes=i,e}function Q0(e,r,i){return r=Yn(4,e.children!==null?e.children:[],e.key,r),r.lanes=i,r.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},r}function N8(e,r,i,n,o){this.tag=r,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=P0(0),this.expirationTimes=P0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=P0(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function lm(e,r,i,n,o,a,l,d,p){return e=new N8(e,r,i,d,p),r===1?(r=1,a===!0&&(r|=8)):r=0,a=Yn(3,null,null,r),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},qx(a),e}function U8(e,r,i){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Rl,key:n==null?null:""+n,children:e,containerInfo:r,implementation:i}}function Mj(e){if(!e)return ta;e=e._reactInternals;e:{if(ol(e)!==e||e.tag!==1)throw Error(Ye(170));var r=e;do{switch(r.tag){case 3:r=r.stateNode.context;break e;case 1:if(gn(r.type)){r=r.stateNode.__reactInternalMemoizedMergedChildContext;break e}}r=r.return}while(r!==null);throw Error(Ye(171))}if(e.tag===1){var i=e.type;if(gn(i))return Mv(e,i,r)}return r}function Dj(e,r,i,n,o,a,l,d,p){return e=lm(i,n,!0,e,o,a,l,d,p),e.context=Mj(null),i=e.current,n=tn(),o=Ks(i),a=as(n,o),a.callback=r??null,Ys(i,a,o),e.current.lanes=o,cp(e,o,n),fn(e,n),e}function Uh(e,r,i,n){var o=r.current,a=tn(),l=Ks(o);return i=Mj(i),r.context===null?r.context=i:r.pendingContext=i,r=as(a,l),r.payload={element:e},n=n===void 0?null:n,n!==null&&(r.callback=n),e=Ys(o,r,l),e!==null&&(wo(e,o,l,a),bu(e,o,l)),l}function rh(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function qy(e,r){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<r?i:r}}function dm(e,r){qy(e,r),(e=e.alternate)&&qy(e,r)}function V8(){return null}var Bj=typeof reportError=="function"?reportError:function(e){console.error(e)};function cm(e){this._internalRoot=e}Vh.prototype.render=cm.prototype.render=function(e){var r=this._internalRoot;if(r===null)throw Error(Ye(409));Uh(e,r,null,null)};Vh.prototype.unmount=cm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var r=e.containerInfo;Ya(function(){Uh(null,e,null,null)}),r[us]=null}};function Vh(e){this._internalRoot=e}Vh.prototype.unstable_scheduleHydration=function(e){if(e){var r=gv();e={blockedOn:null,target:e,priority:r};for(var i=0;i<Ds.length&&r!==0&&r<Ds[i].priority;i++);Ds.splice(i,0,e),i===0&&xv(e)}};function pm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function qh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Hy(){}function q8(e,r,i,n,o){if(o){if(typeof n=="function"){var a=n;n=function(){var u=rh(l);a.call(u)}}var l=Dj(r,n,e,0,null,!1,!1,"",Hy);return e._reactRootContainer=l,e[us]=l.current,Dc(e.nodeType===8?e.parentNode:e),Ya(),l}for(;o=e.lastChild;)e.removeChild(o);if(typeof n=="function"){var d=n;n=function(){var u=rh(p);d.call(u)}}var p=lm(e,0,!1,null,null,!1,!1,"",Hy);return e._reactRootContainer=p,e[us]=p.current,Dc(e.nodeType===8?e.parentNode:e),Ya(function(){Uh(r,p,i,n)}),p}function Hh(e,r,i,n,o){var a=i._reactRootContainer;if(a){var l=a;if(typeof o=="function"){var d=o;o=function(){var p=rh(l);d.call(p)}}Uh(r,l,e,o)}else l=q8(i,r,e,o,n);return rh(l)}uv=function(e){switch(e.tag){case 3:var r=e.stateNode;if(r.current.memoizedState.isDehydrated){var i=rc(r.pendingLanes);i!==0&&(Ix(r,i|1),fn(r,di()),!(ar&6)&&(gd=di()+500,aa()))}break;case 13:Ya(function(){var n=hs(e,1);if(n!==null){var o=tn();wo(n,e,1,o)}}),dm(e,1)}};Tx=function(e){if(e.tag===13){var r=hs(e,134217728);if(r!==null){var i=tn();wo(r,e,134217728,i)}dm(e,134217728)}};hv=function(e){if(e.tag===13){var r=Ks(e),i=hs(e,r);if(i!==null){var n=tn();wo(i,e,r,n)}dm(e,r)}};gv=function(){return yr};fv=function(e,r){var i=yr;try{return yr=e,r()}finally{yr=i}};Vg=function(e,r,i){switch(r){case"input":if(Bg(e,i),r=i.name,i.type==="radio"&&r!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<i.length;r++){var n=i[r];if(n!==e&&n.form===e.form){var o=Dh(n);if(!o)throw Error(Ye(90));H1(n),Bg(n,o)}}}break;case"textarea":J1(e,i);break;case"select":r=i.value,r!=null&&Jl(e,!!i.multiple,r,!1)}};tv=nm;rv=Ya;var H8={usingClientEntryPoint:!1,Events:[up,Fl,Dh,Q1,ev,nm]},Hd={findFiberByHostInstance:Ra,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},G8={bundleType:Hd.bundleType,version:Hd.version,rendererPackageName:Hd.rendererPackageName,rendererConfig:Hd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:bs.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ov(e),e===null?null:e.stateNode},findFiberByHostInstance:Hd.findFiberByHostInstance||V8,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ru=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ru.isDisabled&&ru.supportsFiber)try{Ah=ru.inject(G8),Do=ru}catch{}}Mn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H8;Mn.createPortal=function(e,r){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!pm(r))throw Error(Ye(200));return U8(e,r,null,i)};Mn.createRoot=function(e,r){if(!pm(e))throw Error(Ye(299));var i=!1,n="",o=Bj;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(n=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),r=lm(e,1,!1,null,null,i,!1,n,o),e[us]=r.current,Dc(e.nodeType===8?e.parentNode:e),new cm(r)};Mn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var r=e._reactInternals;if(r===void 0)throw typeof e.render=="function"?Error(Ye(188)):(e=Object.keys(e).join(","),Error(Ye(268,e)));return e=ov(r),e=e===null?null:e.stateNode,e};Mn.flushSync=function(e){return Ya(e)};Mn.hydrate=function(e,r,i){if(!qh(r))throw Error(Ye(200));return Hh(null,e,r,!0,i)};Mn.hydrateRoot=function(e,r,i){if(!pm(e))throw Error(Ye(405));var n=i!=null&&i.hydratedSources||null,o=!1,a="",l=Bj;if(i!=null&&(i.unstable_strictMode===!0&&(o=!0),i.identifierPrefix!==void 0&&(a=i.identifierPrefix),i.onRecoverableError!==void 0&&(l=i.onRecoverableError)),r=Dj(r,null,e,1,i??null,o,!1,a,l),e[us]=r.current,Dc(e),n)for(e=0;e<n.length;e++)i=n[e],o=i._getVersion,o=o(i._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[i,o]:r.mutableSourceEagerHydrationData.push(i,o);return new Vh(r)};Mn.render=function(e,r,i){if(!qh(r))throw Error(Ye(200));return Hh(null,e,r,!1,i)};Mn.unmountComponentAtNode=function(e){if(!qh(e))throw Error(Ye(40));return e._reactRootContainer?(Ya(function(){Hh(null,null,e,!1,function(){e._reactRootContainer=null,e[us]=null})}),!0):!1};Mn.unstable_batchedUpdates=nm;Mn.unstable_renderSubtreeIntoContainer=function(e,r,i,n){if(!qh(i))throw Error(Ye(200));if(e==null||e._reactInternals===void 0)throw Error(Ye(38));return Hh(e,r,i,!1,n)};Mn.version="18.3.1-next-f1338f8080-20240426";function Oj(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Oj)}catch(e){console.error(e)}}Oj(),O1.exports=Mn;var Xa=O1.exports,Gy=Xa;Ig.createRoot=Gy.createRoot,Ig.hydrateRoot=Gy.hydrateRoot;/** 41 * @remix-run/router v1.23.2 42 * 43 * Copyright (c) Remix Software Inc. 44 * 45 * This source code is licensed under the MIT license found in the 46 * LICENSE.md file in the root directory of this source tree. 47 * 48 * @license MIT 49 */function qc(){return qc=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},qc.apply(this,arguments)}var Us;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Us||(Us={}));const Jy="popstate";function J8(e){e===void 0&&(e={});function r(n,o){let{pathname:a,search:l,hash:d}=n.location;return Sf("",{pathname:a,search:l,hash:d},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}
vendor: 4,275 bytes, line 49
49function i(n,o){return typeof o=="string"?o:Lj(o)}return Y8(r,i,null,e)}function xi(e,r){if(e===!1||e===null||typeof e>"u")throw new Error(r)}function um(e,r){if(!e){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function Z8(){return Math.random().toString(36).substr(2,8)}function Zy(e,r){return{usr:e.state,key:e.key,idx:r}}function Sf(e,r,i,n){return i===void 0&&(i=null),qc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof r=="string"?Ed(r):r,{state:i,key:r&&r.key||n||Z8()})}function Lj(e){let{pathname:r="/",search:i="",hash:n=""}=e;return i&&i!=="?"&&(r+=i.charAt(0)==="?"?i:"?"+i),n&&n!=="#"&&(r+=n.charAt(0)==="#"?n:"#"+n),r}function Ed(e){let r={};if(e){let i=e.indexOf("#");i>=0&&(r.hash=e.substr(i),e=e.substr(0,i));let n=e.indexOf("?");n>=0&&(r.search=e.substr(n),e=e.substr(0,n)),e&&(r.pathname=e)}return r}function Y8(e,r,i,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:a=!1}=n,l=o.history,d=Us.Pop,p=null,u=g();u==null&&(u=0,l.replaceState(qc({},l.state,{idx:u}),""));function g(){return(l.state||{idx:null}).idx}function h(){d=Us.Pop;let k=g(),w=k==null?null:k-u;u=k,p&&p({action:d,location:S.location,delta:w})}function x(k,w){d=Us.Push;let b=Sf(S.location,k,w);u=g()+1;let j=Zy(b,u),T=S.createHref(b);try{l.pushState(j,"",T)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;o.location.assign(T)}a&&p&&p({action:d,location:S.location,delta:1})}function y(k,w){d=Us.Replace;let b=Sf(S.location,k,w);u=g();let j=Zy(b,u),T=S.createHref(b);l.replaceState(j,"",T),a&&p&&p({action:d,location:S.location,delta:0})}function _(k){let w=o.location.origin!=="null"?o.location.origin:o.location.href,b=typeof k=="string"?k:Lj(k);return b=b.replace(/ $/,"%20"),xi(w,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,w)}let S={get action(){return d},get location(){return e(o,l)},listen(k){if(p)throw new Error("A history only accepts one active listener");return o.addEventListener(Jy,h),p=k,()=>{o.removeEventListener(Jy,h),p=null}},createHref(k){return r(o,k)},createURL:_,encodeLocation(k){let w=_(k);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:x,replace:y,go(k){return l.go(k)}};return S}var Yy;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Yy||(Yy={}));function X8(e,r,i){return i===void 0&&(i="/"),K8(e,r,i)}function K8(e,r,i,n){let o=typeof r=="string"?Ed(r):r,a=Nj(o.pathname||"/",i);if(a==null)return null;let l=$j(e);Q8(l);let d=null;for(let p=0;d==null&&p<l.length;++p){let u=p6(a);d=l6(l[p],u)}return d}function $j(e,r,i,n){r===void 0&&(r=[]),i===void 0&&(i=[]),n===void 0&&(n="");let o=(a,l,d)=>{let p={relativePath:d===void 0?a.path||"":d,caseSensitive:a.caseSensitive===!0,childrenIndex:l,route:a};p.relativePath.startsWith("/")&&(xi(p.relativePath.startsWith(n),'Absolute route path "'+p.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),p.relativePath=p.relativePath.slice(n.length));let u=La([n,p.relativePath]),g=i.concat(p);a.children&&a.children.length>0&&(xi(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),$j(a.children,r,g,u)),!(a.path==null&&!a.index)&&r.push({path:u,score:s6(u,a.index),routesMeta:g})};return e.forEach((a,l)=>{var d;if(a.path===""||!((d=a.path)!=null&&d.includes("?")))o(a,l);else for(let p of Wj(a.path))o(a,l,p)}),r}function Wj(e){let r=e.split("/");if(r.length===0)return[];let[i,...n]=r,o=i.endsWith("?"),a=i.replace(/\?$/,"");if(n.length===0)return o?[a,""]:[a];let l=Wj(n.join("/")),d=[];return d.push(...l.map(p=>p===""?a:[a,p].join("/"))),o&&d.push(...l),d.map(p=>e.startsWith("/")&&p===""?"/":p)}function Q8(e){e.sort((r,i)=>r.score!==i.score?i.score-r.score:a6(r.routesMeta.map(n=>n.childrenIndex),i.routesMeta.map(n=>n.childrenIndex)))}const e6=/^:[\w-]+$/,t6=3,r6=2,i6=1,n6=10,o6=-2,Xy=e=>e==="*";function s6(e,r){let i=e.split("/"),n=i.length;return i.some(Xy)&&(n+=o6),r&&(n+=r6),i.filter(o=>!Xy(o)).reduce((o,a)=>o+(e6.test(a)?t6:a===""?i6:n6),n)}function a6(e,r){return e.length===r.length&&e.slice(0,-1).every((n,o)=>n===r[o])?e[e.length-1]-r[r.length-1]:0}
vendor: 7,059 bytes, lines 49-58
49function l6(e,r,i){let{routesMeta:n}=e,o={},a="/",l=[];for(let d=0;d<n.length;++d){let p=n[d],u=d===n.length-1,g=a==="/"?r:r.slice(a.length)||"/",h=d6({path:p.relativePath,caseSensitive:p.caseSensitive,end:u},g),x=p.route;if(!h)return null;Object.assign(o,h.params),l.push({params:o,pathname:La([a,h.pathname]),pathnameBase:x6(La([a,h.pathnameBase])),route:x}),h.pathnameBase!=="/"&&(a=La([a,h.pathnameBase]))}return l}function d6(e,r){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[i,n]=c6(e.path,e.caseSensitive,e.end),o=r.match(i);if(!o)return null;let a=o[0],l=a.replace(/(.)\/+$/,"$1"),d=o.slice(1);return{params:n.reduce((u,g,h)=>{let{paramName:x,isOptional:y}=g;if(x==="*"){let S=d[h]||"";l=a.slice(0,a.length-S.length).replace(/(.)\/+$/,"$1")}const _=d[h];return y&&!_?u[x]=void 0:u[x]=(_||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:l,pattern:e}}function c6(e,r,i){r===void 0&&(r=!1),i===void 0&&(i=!0),um(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,d,p)=>(n.push({paramName:d,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,r?void 0:"i"),n]}function p6(e){try{return e.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return um(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+r+").")),e}}function Nj(e,r){if(r==="/")return e;if(!e.toLowerCase().startsWith(r.toLowerCase()))return null;let i=r.endsWith("/")?r.length-1:r.length,n=e.charAt(i);return n&&n!=="/"?null:e.slice(i)||"/"}const u6=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,h6=e=>u6.test(e);function g6(e,r){r===void 0&&(r="/");let{pathname:i,search:n="",hash:o=""}=typeof e=="string"?Ed(e):e,a;if(i)if(h6(i))a=i;else{if(i.includes("//")){let l=i;i=i.replace(/\/\/+/g,"/"),um(!1,"Pathnames cannot have embedded double slashes - normalizing "+(l+" -> "+i))}i.startsWith("/")?a=Ky(i.substring(1),"/"):a=Ky(i,r)}else a=r;return{pathname:a,search:m6(n),hash:y6(o)}}function Ky(e,r){let i=r.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?i.length>1&&i.pop():o!=="."&&i.push(o)}),i.length>1?i.join("/"):"/"}function eg(e,r,i,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+r+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+i+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function f6(e){return e.filter((r,i)=>i===0||r.route.path&&r.route.path.length>0)}function Uj(e,r){let i=f6(e);return r?i.map((n,o)=>o===i.length-1?n.pathname:n.pathnameBase):i.map(n=>n.pathnameBase)}function Vj(e,r,i,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Ed(e):(o=qc({},e),xi(!o.pathname||!o.pathname.includes("?"),eg("?","pathname","search",o)),xi(!o.pathname||!o.pathname.includes("#"),eg("#","pathname","hash",o)),xi(!o.search||!o.search.includes("#"),eg("#","search","hash",o)));let a=e===""||o.pathname==="",l=a?"/":o.pathname,d;if(l==null)d=i;else{let h=r.length-1;if(!n&&l.startsWith("..")){let x=l.split("/");for(;x[0]==="..";)x.shift(),h-=1;o.pathname=x.join("/")}d=h>=0?r[h]:"/"}let p=g6(o,d),u=l&&l!=="/"&&l.endsWith("/"),g=(a||l===".")&&i.endsWith("/");return!p.pathname.endsWith("/")&&(u||g)&&(p.pathname+="/"),p}const La=e=>e.join("/").replace(/\/\/+/g,"/"),x6=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),m6=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,y6=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function b6(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const qj=["post","put","patch","delete"];new Set(qj);const v6=["get",...qj];new Set(v6);/** 50 * React Router v6.30.3 51 * 52 * Copyright (c) Remix Software Inc. 53 * 54 * This source code is licensed under the MIT license found in the 55 * LICENSE.md file in the root directory of this source tree. 56 * 57 * @license MIT 58 */function Hc(){return Hc=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},Hc.apply(this,arguments)}const hm=m.createContext(null),j6=m.createContext(null),gp=m.createContext(null),Gh=m.createContext(null),vs=m.createContext({outlet:null,matches:[],isDataRoute:!1}),Hj=m.createContext(null);function fp(){return m.useContext(Gh)!=null}function ko(){return fp()||xi(!1),m.useContext(Gh).location}function Gj(e){m.useContext(gp).static||m.useLayoutEffect(e)}function Lt(){let{isDataRoute:e}=m.useContext(vs);return e?D6():w6()}function w6(){fp()||xi(!1);let e=m.useContext(hm),{basename:r,future:i,navigator:n}=m.useContext(gp),{matches:o}=m.useContext(vs),{pathname:a}=ko(),l=JSON.stringify(Uj(o,i.v7_relativeSplatPath)),d=m.useRef(!1);return Gj(()=>{d.current=!0}),m.useCallback(function(u,g){if(g===void 0&&(g={}),!d.current)return;if(typeof u=="number"){n.go(u);return}let h=Vj(u,JSON.parse(l),a,g.relative==="path");e==null&&r!=="/"&&(h.pathname=h.pathname==="/"?r:La([r,h.pathname])),(g.replace?n.replace:n.push)(h,g.state,g)},[r,n,l,a,e])}const _6=m.createContext(null);function S6(e){let r=m.useContext(vs).outlet;return r&&m.createElement(_6.Provider,{value:e},r)}function Jj(){let{matches:e}=m.useContext(vs),r=e[e.length-1];return r?r.params:{}}function k6(e,r){return C6(e,r)}function C6(e,r,i,n){fp()||xi(!1);let{navigator:o}=m.useContext(gp),{matches:a}=m.useContext(vs),l=a[a.length-1],d=l?l.params:{};l&&l.pathname;let p=l?l.pathnameBase:"/";l&&l.route;let u=ko(),g;if(r){var h;let k=typeof r=="string"?Ed(r):r;p==="/"||(h=k.pathname)!=null&&h.startsWith(p)||xi(!1),g=k}else g=u;let x=g.pathname||"/",y=x;if(p!=="/"){let k=p.replace(/^\//,"").split("/");y="/"+x.replace(/^\//,"").split("/").slice(k.length).join("/")}let _=X8(e,{pathname:y}),S=T6(_&&_.map(k=>Object.assign({},k,{params:Object.assign({},d,k.params),pathname:La([p,o.encodeLocation?o.encodeLocation(k.pathname).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?p:La([p,o.encodeLocation?o.encodeLocation(k.pathnameBase).pathname:k.pathnameBase])})),a,i,n);return r&&S?m.createElement(Gh.Provider,{value:{location:Hc({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:Us.Pop}},S):S}function z6(){let e=M6(),r=b6(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),i=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application
58Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},r),i?m.createElement("pre",{style:o},i):null,null)}const E6=m.createElement(z6,null);class R6 extends m.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,i){return i.location!==r.location||i.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:i.error,location:i.location,revalidation:r.revalidation||i.revalidation}}componentDidCatch(r,i){console.error("React Router caught the following error during render",r,i)}render(){return this.state.error!==void 0?m.createElement(vs.Provider,{value:this.props.routeContext},m.createElement(Hj.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function I6(e){let{routeContext:r,match:i,children:n}=e,o=m.useContext(hm);return o&&o.static&&o.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=i.route.id),m.createElement(vs.Provider,{value:r},n)}function T6(e,r,i,n){var o;if(r===void 0&&(r=[]),i===void 0&&(i=null),n===void 0&&(n=null),e==null){var a;if(!i)return null;if(i.errors)e=i.matches;else if((a=n)!=null&&a.v7_partialHydration&&r.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let l=e,d=(o=i)==null?void 0:o.errors;if(d!=null){let g=l.findIndex(h=>h.route.id&&(d==null?void 0:d[h.route.id])!==void 0);g>=0||xi(!1),l=l.slice(0,Math.min(l.length,g+1))}let p=!1,u=-1;if(i&&n&&n.v7_partialHydration)for(let g=0;g<l.length;g++){let h=l[g];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=g),h.route.id){let{loaderData:x,errors:y}=i,_=h.route.loader&&x[h.route.id]===void 0&&(!y||y[h.route.id]===void 0);if(h.route.lazy||_){p=!0,u>=0?l=l.slice(0,u+1):l=[l[0]];break}}}return l.reduceRight((g,h,x)=>{let y,_=!1,S=null,k=null;i&&(y=d&&h.route.id?d[h.route.id]:void 0,S=h.route.errorElement||E6,p&&(u<0&&x===0?(B6("route-fallback"),_=!0,k=null):u===x&&(_=!0,k=h.route.hydrateFallbackElement||null)));let w=r.concat(l.slice(0,x+1)),b=()=>{let j;return y?j=S:_?j=k:h.route.Component?j=m.createElement(h.route.Component,null):h.route.element?j=h.route.element:j=g,m.createElement(I6,{match:h,routeContext:{outlet:g,matches:w,isDataRoute:i!=null},children:j})};return i&&(h.route.ErrorBoundary||h.route.errorElement||x===0)?m.createElement(R6,{location:i.location,revalidation:i.revalidation,component:S,error:y,children:b(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):b()},null)}var Zj=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Zj||{}),Yj=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}(Yj||{});function A6(e){let r=m.useContext(hm);return r||xi(!1),r}function P6(e){let r=m.useContext(j6);return r||xi(!1),r}function F6(e){let r=m.useContext(vs);return r||xi(!1),r}function Xj(e){let r=F6(),i=r.matches[r.matches.length-1];return i.route.id||xi(!1),i.route.id}function M6(){var e;let r=m.useContext(Hj),i=P6(),n=Xj();return r!==void 0?r:(e=i.errors)==null?void 0:e[n]}function D6(){let{router:e}=A6(Zj.UseNavigateStable),r=Xj(Yj.UseNavigateStable),i=m.useRef(!1);return Gj(()=>{i.current=!0}),m.useCallback(function(o,a){a===void 0&&(a={}),i.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Hc({fromRouteId:r},a)))},[e,r])}const Qy={};function B6(e,r,i){Qy[e]||(Qy[e]=!0)}function O6(e,r){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function ih(e){let{to:r,replace:i,state:n,relative:o}=e;fp()||xi(!1);let{future:a,static:l}=m.useContext(gp),{matches:d}=m.useContext(vs),{pathname:p}=ko(),u=Lt(),g=Vj(r,Uj(d,a.v7_relativeSplatPath),p,o==="path"),h=JSON.stringify(g);return m.useEffect(()=>u(JSON.parse(h),{replace:i,state:n,relative:o}),[u,h,o,i,n]),null}function Kj(e){return S6(e.context)}function $t(e){xi(!1)}function L6(e){let{basename:r="/",children:i=null,location:n,navigationType:o=Us.Pop,navigator:a,static:l=!1,future:d}=e;fp()&&xi(!1);let p=r.replace(/^\/*/,"/"),u=m.useMemo(()=>({basename:p,navigator:a,static:l,future:Hc({v7_relativeSplatPath:!1},d)}),[p,d,a,l]);typeof n=="string"&&(n=Ed(n));let{pathname:g="/",search:h="",hash:x="",state:y=null,key:_="default"}=n,S=m.useMemo(()=>{let k=Nj(g,p);return k==null?null:{location:{pathname:k,search:h,hash:x,state:y,key:_},navigationType:o}},[p,g,h,x,y,_,o]);return S==null?null:m.createElement(gp.Provider,{value:u},m.createElement(Gh.Provider,{children:i,value:S}))}function $6(e){let{children:r,location:i}=e;return k6(kf(r),i)}new Promise(()=>{});function kf(e,r){r===void 0&&(r=[]);let i=[];
58return m.Children.forEach(e,(n,o)=>{if(!m.isValidElement(n))return;let a=[...r,o];if(n.type===m.Fragment){i.push.apply(i,kf(n.props.children,a));return}n.type!==$t&&xi(!1),!n.props.index||!n.props.children||xi(!1);let l={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(l.children=kf(n.props.children,a)),i.push(l)}),i}/** 59 * React Router DOM v6.30.3 60 * 61 * Copyright (c) Remix Software Inc. 62 * 63 * This source code is licensed under the MIT license found in the 64 * LICENSE.md file in the root directory of this source tree. 65 * 66 * @license MIT 67 */const W6="6";try{window.__reactRouterVersion=W6}catch{}const N6="startTransition",e2=Bk[N6];function U6(e){let{basename:r,children:i,future:n,window:o}=e,a=m.useRef();a.current==null&&(a.current=J8({window:o,v5Compat:!0}));let l=a.current,[d,p]=m.useState({action:l.action,location:l.location}),{v7_startTransition:u}=n||{},g=m.useCallback(h=>{u&&e2?e2(()=>p(h)):p(h)},[p,u]);return m.useLayoutEffect(()=>l.listen(g),[l,g]),m.useEffect(()=>O6(n),[n]),m.createElement(L6,{basename:r,children:i,location:d.location,navigationType:d.action,navigator:l,future:n})}var t2;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(t2||(t2={}));var r2;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(r2||(r2={}));function Jh(e,r){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(i[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(i[n[o]]=e[n[o]]);return i}function V6(e,r,i,n){function o(a){return a instanceof i?a:new i(function(l){l(a)})}return new(i||(i=Promise))(function(a,l){function d(g){try{u(n.next(g))}catch(h){l(h)}}function p(g){try{u(n.throw(g))}catch(h){l(h)}}function u(g){g.done?a(g.value):o(g.value).then(d,p)}u((n=n.apply(e,r||[])).next())})}const q6=e=>e?(...r)=>e(...r):(...r)=>fetch(...r);class Zh extends Error{constructor(r,i="FunctionsError",n){super(r),this.name=i,this.context=n}}class Qj extends Zh{constructor(r){super("Failed to send a request to the Edge Function","FunctionsFetchError",r)}}class Cf extends Zh{constructor(r){super("Relay Error invoking the Edge Function","FunctionsRelayError",r)}}class zf extends Zh{constructor(r){super("Edge Function returned a non-2xx status code","FunctionsHttpError",r)}}var nh;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(nh||(nh={}));class H6{constructor(r,{headers:i={},customFetch:n,region:o=nh.Any}={}){this.url=r,this.headers=i,this.region=o,this.fetch=q6(n)}setAuth(r){this.headers.Authorization=`Bearer ${r}`}invoke(r){return V6(this,arguments,void 0,function*(i,n={}){var o;let a,l;try{const{headers:d,method:p,body:u,signal:g,timeout:h}=n;let x={},{region:y}=n;y||(y=this.region);const _=new URL(`${this.url}/${i}`);y&&y!=="any"&&(x["x-region"]=y,_.searchParams.set("forceFunctionRegion",y));let S;u&&(d&&!Object.prototype.hasOwnProperty.call(d,"Content-Type")||!d)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(x["Content-Type"]="application/octet-stream",S=u):typeof u=="string"?(x["Content-Type"]="text/plain",S=u):typeof FormData<"u"&&u instanceof FormData?S=u:(x["Content-Type"]="application/json",S=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?S=JSON.stringify(u):S=u;let k=g;h&&(l=new AbortController,a=setTimeout(()=>l.abort(),h),g?(k=l.signal,g.addEventListener("abort",()=>l.abort())):k=l.signal);const w=yield this.fetch(_.toString(),{method:p||"POST",headers:Object.assign(Object.assign(Object.assign({},x),this.headers),d),body:S,signal:k}).catch(P=>{throw new Qj(P)}),b=w.headers.get("x-relay-error");
67if(b&&b==="true")throw new Cf(w);if(!w.ok)throw new zf(w);let j=((o=w.headers.get("Content-Type"))!==null&&o!==void 0?o:"text/plain").split(";")[0].trim(),T;return j==="application/json"?T=yield w.json():j==="application/octet-stream"||j==="application/pdf"?T=yield w.blob():j==="text/event-stream"?T=w:j==="multipart/form-data"?T=yield w.formData():T=yield w.text(),{data:T,error:null,response:w}}catch(d){return{data:null,error:d,response:d instanceof zf||d instanceof Cf?d.context:void 0}}finally{a&&clearTimeout(a)}})}}var ew=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}},G6=class{constructor(e){var r,i;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(r=e.shouldThrowOnError)!==null&&r!==void 0?r:!1,this.signal=e.signal,this.isMaybeSingle=(i=e.isMaybeSingle)!==null&&i!==void 0?i:!1,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,r){return this.headers=new Headers(this.headers),this.headers.set(e,r),this}then(e,r){var i=this;this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const n=this.fetch;let o=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async a=>{let l=null,d=null,p=null,u=a.status,g=a.statusText;if(a.ok){var h,x;if(i.method!=="HEAD"){var y;const w=await a.text();w===""||(i.headers.get("Accept")==="text/csv"||i.headers.get("Accept")&&(!((y=i.headers.get("Accept"))===null||y===void 0)&&y.includes("application/vnd.pgrst.plan+text"))?d=w:d=JSON.parse(w))}const S=(h=i.headers.get("Prefer"))===null||h===void 0?void 0:h.match(/count=(exact|planned|estimated)/),k=(x=a.headers.get("content-range"))===null||x===void 0?void 0:x.split("/");S&&k&&k.length>1&&(p=parseInt(k[1])),i.isMaybeSingle&&i.method==="GET"&&Array.isArray(d)&&(d.length>1?(l={code:"PGRST116",details:`Results contain ${d.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},d=null,p=null,u=406,g="Not Acceptable"):d.length===1?d=d[0]:d=null)}else{var _;const S=await a.text();try{l=JSON.parse(S),Array.isArray(l)&&a.status===404&&(d=[],l=null,u=200,g="OK")}catch{a.status===404&&S===""?(u=204,g="No Content"):l={message:S}}if(l&&i.isMaybeSingle&&(!(l==null||(_=l.details)===null||_===void 0)&&_.includes("0 rows"))&&(l=null,u=200,g="OK"),l&&i.shouldThrowOnError)throw new ew(l)}return{error:l,data:d,count:p,status:u,statusText:g}});return this.shouldThrowOnError||(o=o.catch(a=>{var l;let d="";const p=a==null?void 0:a.cause;if(p){var u,g,h,x;const _=(u=p==null?void 0:p.message)!==null&&u!==void 0?u:"",S=(g=p==null?void 0:p.code)!==null&&g!==void 0?g:"";d=`${(h=a==null?void 0:a.name)!==null&&h!==void 0?h:"FetchError"}: ${a==null?void 0:a.message}`,d+=` 68 69Caused by: ${(x=p==null?void 0:p.name)!==null&&x!==void 0?x:"Error"}: ${_}`,S&&(d+=` (${S})`),p!=null&&p.stack&&(d+=` 70${p.stack}`)}else{var y;d=(y=a==null?void 0:a.stack)!==null&&y!==void 0?y:""}return{error:{message:`${(l=a==null?void 0:a.name)!==null&&l!==void 0?l:"FetchError"}: ${a==null?void 0:a.message}`,details:d,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),o.then(e,r)}returns(){return this}overrideTypes(){return this}},J6=class extends G6{select(e){let r=!1;const i=(e??"*").split("").map(n=>/\s/.test(n)&&!r?"":(n==='"'&&(r=!r),n)).join("");return this.url.searchParams.set("select",i),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:r=!0,nullsFirst:i,foreignTable:n,referencedTable:o=n}={}){const a=o?`${o}.order`:"order",l=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${l?`${l},`:""}${e}.${r?"asc":"desc"}${i===void 0?"":i?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:r,referencedTable:i=r}={}){const n=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(n,`${e}`),this}range(e,r,{foreignTable:i,referencedTable:n=i}={}){const o=typeof n>"u"?"offset":`${n}.offset`,a=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(a,`${r-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}
70explain({analyze:e=!1,verbose:r=!1,settings:i=!1,buffers:n=!1,wal:o=!1,format:a="text"}={}){var l;const d=[e?"analyze":null,r?"verbose":null,i?"settings":null,n?"buffers":null,o?"wal":null].filter(Boolean).join("|"),p=(l=this.headers.get("Accept"))!==null&&l!==void 0?l:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${a}; for="${p}"; options=${d};`),a==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const i2=new RegExp("[,()]");var Cl=class extends J6{eq(e,r){return this.url.searchParams.append(e,`eq.${r}`),this}neq(e,r){return this.url.searchParams.append(e,`neq.${r}`),this}gt(e,r){return this.url.searchParams.append(e,`gt.${r}`),this}gte(e,r){return this.url.searchParams.append(e,`gte.${r}`),this}lt(e,r){return this.url.searchParams.append(e,`lt.${r}`),this}lte(e,r){return this.url.searchParams.append(e,`lte.${r}`),this}like(e,r){return this.url.searchParams.append(e,`like.${r}`),this}likeAllOf(e,r){return this.url.searchParams.append(e,`like(all).{${r.join(",")}}`),this}likeAnyOf(e,r){return this.url.searchParams.append(e,`like(any).{${r.join(",")}}`),this}ilike(e,r){return this.url.searchParams.append(e,`ilike.${r}`),this}ilikeAllOf(e,r){return this.url.searchParams.append(e,`ilike(all).{${r.join(",")}}`),this}ilikeAnyOf(e,r){return this.url.searchParams.append(e,`ilike(any).{${r.join(",")}}`),this}regexMatch(e,r){return this.url.searchParams.append(e,`match.${r}`),this}regexIMatch(e,r){return this.url.searchParams.append(e,`imatch.${r}`),this}is(e,r){return this.url.searchParams.append(e,`is.${r}`),this}isDistinct(e,r){return this.url.searchParams.append(e,`isdistinct.${r}`),this}in(e,r){const i=Array.from(new Set(r)).map(n=>typeof n=="string"&&i2.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`in.(${i})`),this}notIn(e,r){const i=Array.from(new Set(r)).map(n=>typeof n=="string"&&i2.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`not.in.(${i})`),this}contains(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cs.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cs.{${r.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(r)}`),this}containedBy(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cd.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cd.{${r.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(r)}`),this}rangeGt(e,r){return this.url.searchParams.append(e,`sr.${r}`),this}rangeGte(e,r){return this.url.searchParams.append(e,`nxl.${r}`),this}rangeLt(e,r){return this.url.searchParams.append(e,`sl.${r}`),this}rangeLte(e,r){return this.url.searchParams.append(e,`nxr.${r}`),this}rangeAdjacent(e,r){return this.url.searchParams.append(e,`adj.${r}`),this}overlaps(e,r){return typeof r=="string"?this.url.searchParams.append(e,`ov.${r}`):this.url.searchParams.append(e,`ov.{${r.join(",")}}`),this}textSearch(e,r,{config:i,type:n}={}){let o="";n==="plain"?o="pl":n==="phrase"?o="ph":n==="websearch"&&(o="w");const a=i===void 0?"":`(${i})`;return this.url.searchParams.append(e,`${o}fts${a}.${r}`),this}match(e){return Object.entries(e).forEach(([r,i])=>{this.url.searchParams.append(r,`eq.${i}`)}),this}not(e,r,i){return this.url.searchParams.append(e,`not.${r}.${i}`),this}or(e,{foreignTable:r,referencedTable:i=r}={}){const n=i?`${i}.or`:"or";return this.url.searchParams.append(n,`(${e})`),this}filter(e,r,i){return this.url.searchParams.append(e,`${r}.${i}`),this}},Z6=class{constructor(e,{headers:r={},schema:i,fetch:n}){this.url=e,this.headers=new Headers(r),this.schema=i,this.fetch=n}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,r){const{head:i=!1,count:n}=r??{},o=i?"HEAD":"GET";let a=!1;const l=(e??"*").split("").map(u=>/\s/.test(u)&&!a?"":(u==='"'&&(a=!a),u)).join(""),{url:d,headers:p}=this.cloneRequestState();return d.searchParams.set("select",l),n&&p.append("Prefer",`count=${n}`),new Cl({method:o,url:d,headers:p,schema:this.schema,fetch:this.fetch})}insert(e,{count:r,defaultToNull:i=!0}={}){var n;const o="POST",{url:a,headers:l}=this.cloneRequestState();if(r&&l.append("Prefer",`count=${r}`),i||l.append("Prefer","missing=default"),Array.isArray(e)){const d=e.reduce((p,u)=>p.concat(Object.keys(u)),[]);if(d.length>0){const p=[...new Set(d)].map(u=>`"${u}"`);a.searchParams.set("columns",p.join(","))}}return new Cl({method:o,url:a,headers:l,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}upsert(e,{onConflict:r,ignoreDuplicates:i=!1,count:n,defaultToNull:o=!0}={}){var a;const l="POST",{url:d,headers:p}=this.cloneRequestState();if(p.append("Prefer",`resolution=${i?"ignore":"merge"}-duplicates`),r!==void 0&&d.searchParams.set("on_conflict",r),n&&p.append("Prefer",`count=${n}`),o||p.append("Prefer","missing=default"),Array.isArray(e)){const u=e.reduce((g,h)=>g.concat(Object.keys(h)),[]);if(u.length>0){const g=[...new Set(u)].map(h=>`"${h}"`);d.searchParams.set("columns",g.join(","))}}return new Cl({method:l,url:d,headers:p,schema:this.schema,body:e,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}update(e,{count:r}={}){var i;const n="PATCH",{url:o,headers:a}=this.cloneRequestState();return r&&a.append("Prefer",`count=${r}`),new Cl({method:n,url:o,headers:a,schema:this.schema,body:e,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}delete({count:e}={}){var r;const i="DELETE",{url:n,headers:o}=this.cloneRequestState();return e&&o.append("Prefer",`count=${e}`),new Cl({method:i,url:n,headers:o,schema:this.schema,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}},Y6=class tw{constructor(r,{headers:i={},schema:n,fetch:o}={}){this.url=r,this.headers=new Headers(i),this.schemaName=n,this.fetch=o}from(r){if(!r||typeof r!="string"||r.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new Z6(new URL(`${this.url}/${r}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(r){return new tw(this.url,{headers:this.headers,schema:r,fetch:this.fetch})}rpc(r,i={}
70,{head:n=!1,get:o=!1,count:a}={}){var l;let d;const p=new URL(`${this.url}/rpc/${r}`);let u;const g=y=>y!==null&&typeof y=="object"&&(!Array.isArray(y)||y.some(g)),h=n&&Object.values(i).some(g);h?(d="POST",u=i):n||o?(d=n?"HEAD":"GET",Object.entries(i).filter(([y,_])=>_!==void 0).map(([y,_])=>[y,Array.isArray(_)?`{${_.join(",")}}`:`${_}`]).forEach(([y,_])=>{p.searchParams.append(y,_)})):(d="POST",u=i);const x=new Headers(this.headers);return h?x.set("Prefer",a?`count=${a},return=minimal`:"return=minimal"):a&&x.set("Prefer",`count=${a}`),new Cl({method:d,url:p,headers:x,schema:this.schemaName,body:u,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch})}};class rw{constructor(){}static detectEnvironment(){var r;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((r=navigator.userAgent)===null||r===void 0)&&r.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const i=globalThis.process;if(i){const n=i.versions;if(n&&n.node){const o=n.node,a=parseInt(o.replace(/^v/,"").split(".")[0]);return a>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${a} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${a} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 71import ws from "ws" 72new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const r=this.detectEnvironment();if(r.constructor)return r.constructor;let i=r.error||"WebSocket not supported in this environment.";throw r.workaround&&(i+=` 73 74Suggested solution: ${r.workaround}`),new Error(i)}static createWebSocket(r,i){const n=this.getWebSocketConstructor();return new n(r,i)}static isWebSocketSupported(){try{const r=this.detectEnvironment();return r.type==="native"||r.type==="ws"}catch{return!1}}}const X6="2.93.3",K6=`realtime-js/${X6}`,Q6="1.0.0",iw="2.0.0",n2=iw,Ef=1e4,e3=1e3,t3=100;var Ms;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(Ms||(Ms={}));var bi;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(bi||(bi={}));var bo;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(bo||(bo={}));var Rf;(function(e){e.websocket="websocket"})(Rf||(Rf={}));var za;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(za||(za={}));class r3{constructor(r){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=r??[]}encode(r,i){if(r.event===this.BROADCAST_EVENT&&!(r.payload instanceof ArrayBuffer)&&typeof r.payload.event=="string")return i(this._binaryEncodeUserBroadcastPush(r));let n=[r.join_ref,r.ref,r.topic,r.event,r.payload];return i(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(r){var i;return this._isArrayBuffer((i=r.payload)===null||i===void 0?void 0:i.payload)?this._encodeBinaryUserBroadcastPush(r):this._encodeJsonUserBroadcastPush(r)}_encodeBinaryUserBroadcastPush(r){var i,n;const o=(n=(i=r.payload)===null||i===void 0?void 0:i.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(r,this.BINARY_ENCODING,o)}_encodeJsonUserBroadcastPush(r){var i,n;const o=(n=(i=r.payload)===null||i===void 0?void 0:i.payload)!==null&&n!==void 0?n:{},l=new TextEncoder().encode(JSON.stringify(o)).buffer;return this._encodeUserBroadcastPush(r,this.JSON_ENCODING,l)}_encodeUserBroadcastPush(r,i,n){var o,a;const l=r.topic,d=(o=r.ref)!==null&&o!==void 0?o:"",p=(a=r.join_ref)!==null&&a!==void 0?a:"",u=r.payload.event,g=this.allowedMetadataKeys?this._pick(r.payload,this.allowedMetadataKeys):{},h=Object.keys(g).length===0?"":JSON.stringify(g);if(p.length>255)throw new Error(`joinRef length ${p.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`ref length ${d.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`topic length ${l.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`metadata length ${h.length} exceeds maximum of 255`);const x=this.USER_BROADCAST_PUSH_META_LENGTH+p.length+d.length+l.length+u.length+h.length,y=new ArrayBuffer(this.HEADER_LENGTH+x);let _=new DataView(y),S=0;_.setUint8(S++,this.KINDS.userBroadcastPush),_.setUint8(S++,p.length),_.setUint8(S++,d.length),_.setUint8(S++,l.length),_.setUint8(S++,u.length),_.setUint8(S++,h.length),_.setUint8(S++,i),Array.from(p,w=>
74_.setUint8(S++,w.charCodeAt(0))),Array.from(d,w=>_.setUint8(S++,w.charCodeAt(0))),Array.from(l,w=>_.setUint8(S++,w.charCodeAt(0))),Array.from(u,w=>_.setUint8(S++,w.charCodeAt(0))),Array.from(h,w=>_.setUint8(S++,w.charCodeAt(0)));var k=new Uint8Array(y.byteLength+n.byteLength);return k.set(new Uint8Array(y),0),k.set(new Uint8Array(n),y.byteLength),k.buffer}decode(r,i){if(this._isArrayBuffer(r)){let n=this._binaryDecode(r);return i(n)}if(typeof r=="string"){const n=JSON.parse(r),[o,a,l,d,p]=n;return i({join_ref:o,ref:a,topic:l,event:d,payload:p})}return i({})}_binaryDecode(r){const i=new DataView(r),n=i.getUint8(0),o=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(r,i,o)}}_decodeUserBroadcast(r,i,n){const o=i.getUint8(1),a=i.getUint8(2),l=i.getUint8(3),d=i.getUint8(4);let p=this.HEADER_LENGTH+4;const u=n.decode(r.slice(p,p+o));p=p+o;const g=n.decode(r.slice(p,p+a));p=p+a;const h=n.decode(r.slice(p,p+l));p=p+l;const x=r.slice(p,r.byteLength),y=d===this.JSON_ENCODING?JSON.parse(n.decode(x)):x,_={type:this.BROADCAST_EVENT,event:g,payload:y};return l>0&&(_.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:_}}_isArrayBuffer(r){var i;return r instanceof ArrayBuffer||((i=r==null?void 0:r.constructor)===null||i===void 0?void 0:i.name)==="ArrayBuffer"}_pick(r,i){return!r||typeof r!="object"?{}:Object.fromEntries(Object.entries(r).filter(([n])=>i.includes(n)))}}class nw{constructor(r,i){this.callback=r,this.timerCalc=i,this.timer=void 0,this.tries=0,this.callback=r,this.timerCalc=i}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Cr;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(Cr||(Cr={}));const o2=(e,r,i={})=>{var n;const o=(n=i.skipTypes)!==null&&n!==void 0?n:[];return r?Object.keys(r).reduce((a,l)=>(a[l]=i3(l,e,r,o),a),{}):{}},i3=(e,r,i,n)=>{const o=r.find(d=>d.name===e),a=o==null?void 0:o.type,l=i[e];return a&&!n.includes(a)?ow(a,l):If(l)},ow=(e,r)=>{if(e.charAt(0)==="_"){const i=e.slice(1,e.length);return a3(r,i)}switch(e){case Cr.bool:return n3(r);case Cr.float4:case Cr.float8:case Cr.int2:case Cr.int4:case Cr.int8:case Cr.numeric:case Cr.oid:return o3(r);case Cr.json:case Cr.jsonb:return s3(r);case Cr.timestamp:return l3(r);case Cr.abstime:case Cr.date:case Cr.daterange:case Cr.int4range:case Cr.int8range:case Cr.money:case Cr.reltime:case Cr.text:case Cr.time:case Cr.timestamptz:case Cr.timetz:case Cr.tsrange:case Cr.tstzrange:return If(r);default:return If(r)}},If=e=>e,n3=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},o3=e=>{if(typeof e=="string"){const r=parseFloat(e);if(!Number.isNaN(r))return r}return e},s3=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},a3=(e,r)=>{if(typeof e!="string")return e;const i=e.length-1,n=e[i];if(e[0]==="{"&&n==="}"){let a;const l=e.slice(1,i);try{a=JSON.parse("["+l+"]")}catch{a=l?l.split(","):[]}return a.map(d=>ow(r,d))}return e},l3=e=>typeof e=="string"?e.replace(" ","T"):e,sw=e=>{const r=new URL(e);return r.protocol=r.protocol.replace(/^ws/i,"http"),r.pathname=r.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),r.pathname===""||r.pathname==="/"?r.pathname="/api/broadcast":r.pathname=r.pathname+"/api/broadcast",r.href};class tg{constructor(r,i,n={},o=Ef){this.channel=r,this.event=i,this.payload=n,this.timeout=o,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(r){this.timeout=r,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,j
74oin_ref:this.channel._joinRef()}))}updatePayload(r){this.payload=Object.assign(Object.assign({},this.payload),r)}receive(r,i){var n;return this._hasReceived(r)&&i((n=this.receivedResp)===null||n===void 0?void 0:n.response),this.recHooks.push({status:r,callback:i}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const r=i=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=i,this._matchReceive(i)};this.channel._on(this.refEvent,{},r),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(r,i){this.refEvent&&this.channel._trigger(this.refEvent,{status:r,response:i})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:r,response:i}){this.recHooks.filter(n=>n.status===r).forEach(n=>n.callback(i))}_hasReceived(r){return this.receivedResp&&this.receivedResp.status===r}}var Tf;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(Tf||(Tf={}));class ed{constructor(r,i){this.channel=r,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const n=(i==null?void 0:i.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},o=>{const{onJoin:a,onLeave:l,onSync:d}=this.caller;this.joinRef=this.channel._joinRef(),this.state=ed.syncState(this.state,o,a,l),this.pendingDiffs.forEach(p=>{this.state=ed.syncDiff(this.state,p,a,l)}),this.pendingDiffs=[],d()}),this.channel._on(n.diff,{},o=>{const{onJoin:a,onLeave:l,onSync:d}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(o):(this.state=ed.syncDiff(this.state,o,a,l),d())}),this.onJoin((o,a,l)=>{this.channel._trigger("presence",{event:"join",key:o,currentPresences:a,newPresences:l})}),this.onLeave((o,a,l)=>{this.channel._trigger("presence",{event:"leave",key:o,currentPresences:a,leftPresences:l})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(r,i,n,o){const a=this.cloneDeep(r),l=this.transformState(i),d={},p={};return this.map(a,(u,g)=>{l[u]||(p[u]=g)}),this.map(l,(u,g)=>{const h=a[u];if(h){const x=g.map(k=>k.presence_ref),y=h.map(k=>k.presence_ref),_=g.filter(k=>y.indexOf(k.presence_ref)<0),S=h.filter(k=>x.indexOf(k.presence_ref)<0);_.length>0&&(d[u]=_),S.length>0&&(p[u]=S)}else d[u]=g}),this.syncDiff(a,{joins:d,leaves:p},n,o)}static syncDiff(r,i,n,o){const{joins:a,leaves:l}={joins:this.transformState(i.joins),leaves:this.transformState(i.leaves)};return n||(n=()=>{}),o||(o=()=>{}),this.map(a,(d,p)=>{var u;const g=(u=r[d])!==null&&u!==void 0?u:[];if(r[d]=this.cloneDeep(p),g.length>0){const h=r[d].map(y=>y.presence_ref),x=g.filter(y=>h.indexOf(y.presence_ref)<0);r[d].unshift(...x)}n(d,g,p)}),this.map(l,(d,p)=>{let u=r[d];if(!u)return;const g=p.map(h=>h.presence_ref);u=u.filter(h=>g.indexOf(h.presence_ref)<0),r[d]=u,o(d,u,p),u.length===0&&delete r[d]}),r}static map(r,i){return Object.getOwnPropertyNames(r).map(n=>i(n,r[n]))}static transformState(r){return r=this.cloneDeep(r),Object.getOwnPropertyNames(r).reduce((i,n)=>{const o=r[n];return"metas"in o?i[n]=o.metas.map(a=>(a.presence_ref=a.phx_ref,delete a.phx_ref,delete a.phx_ref_prev,a)):i[n]=o,i},{})}static cloneDeep(r){return JSON.parse(JSON.stringify(r))}onJoin(r){this.caller.onJoin=r}onLeave(r){this.caller.onLeave=r}onSync(r){this.caller.onSync=r}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var Af;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(Af||(Af={}));var td;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(td||(td={}));var Po;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Po||(Po={}));class Aa{constructor(r,i={config:{}},n){var o,a;if(this.topic=r,this.params=i,this.socket=n,this.bindings={},this.state=bi.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=r.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},i.config),this.timeout=this.socket.timeout,this.joinPush=new tg(this,bo.join,this.params,this.timeout),this.rejoinTimer=new nw(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=bi.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(l=>l.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=bi.closed,this.socket._remove(this)}),this._onError(l=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,l),this.state=bi.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=bi.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",l=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,l),this.state=bi.errored,this.rejoinTimer.scheduleTimeout())}),this._on(bo.reply,{},(l,d)=>{this._trigger(this._replyEventName(d),l)}),this.presence=new ed(this),this.broadcastEndpointURL=sw(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((a=(o=this.params.config)===null||o===void 0?void 0:o.broadcast)===null||a===void 0)&&a.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(r,i=this.timeout){var n,o,a;if(this.socket.isConnected()||this.socket.connect(),this.state==bi.closed){const{config:{broadcast:l,presence:d,private:p}}=this.params,u=(o=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(y=>y.filter))!==null&&o!==void 0?o:[],g=!!this.bindings[td.PRESENCE]&&this.bindings[td.PRESENCE].length>0||((a=this.params.config.presence)===null||a===void 0?void 0:a.enabled)===!0,h={},x={broadcast:l,presence:Object.assign(Object.assign({},d),{enabled:g}),postgres_changes:u,private:p};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(y=>r==null?void 0:r(Po.CHANNEL_ERROR,y)),this._onClose(()=>r==null?void 0:r(Po.CLOSED)),this.updateJoinPayload(Object.assign({config:x},h)),this.joinedOnce=!0,this._rejoin(i),this.joinPush.receive("ok",async({postgres_changes:y})=>{var _;if(this.socket._isManualToken()||this.socket.setAuth(),y===void 0){r==null||r(Po.SUBSCRIBED);return}else{const S=this.bindings.postgres_changes,k=(_=S==null?void 0:S.length)!==null&&_!==void 0?_:0,w=[];for(let b=0;b<k;b++){const j=S[b],{filter:{event:T,schema:P,table:I,filter:R}}=j,O=y&&y[b];if(O&&O.event===T&&Aa.isFilterValueEqual(O.schema,P)&&Aa.isFilterValueEqual(O.table,I)&&Aa.isFilterValueEqual(O.filter,R))w.push(Object.assign(Object.assign({},j),{id:O.id}));else{this.unsubscribe(),this.state=bi.errored,r==null||r(Po.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=w,r&&r(Po.SUBSCRIBED);return}}).receive("error",y=>{this.state=bi.errored,r==null||r(Po.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(y).join(", ")||"error")))}).receive("timeout",()=>{r==null||r(Po.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(r,i={}){return await this.send({type:"presence",event:"track",payload:r},i.timeout||this.timeout)}async untrack(r={}){return await this.send({type:"presence",event:"untrack"},r)}on(r,i,n){return this.state===bi.joined&&r===td.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(r,i,n)}async httpSend(r,i,n={}){var o;if(i==null)return Promise.reject("Payload is required for httpSend()");const a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const l={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:r,payload:i,private:this.private}]})},d=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(o=n.timeout)!==null&&o!==void 0?o:this.timeout);if(d.status===202)return{success:!0};let p=d.statusText;
74try{const u=await d.json();p=u.error||u.message||p}catch{}return Promise.reject(new Error(p))}async send(r,i={}){var n,o;if(!this._canPush()&&r.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:a,payload:l}=r,d={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(d.Authorization=`Bearer ${this.socket.accessTokenValue}`);const p={method:"POST",headers:d,body:JSON.stringify({messages:[{topic:this.subTopic,event:a,payload:l,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,p,(n=i.timeout)!==null&&n!==void 0?n:this.timeout);return await((o=u.body)===null||o===void 0?void 0:o.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(a=>{var l,d,p;const u=this._push(r.type,r,i.timeout||this.timeout);r.type==="broadcast"&&!(!((p=(d=(l=this.params)===null||l===void 0?void 0:l.config)===null||d===void 0?void 0:d.broadcast)===null||p===void 0)&&p.ack)&&a("ok"),u.receive("ok",()=>a("ok")),u.receive("error",()=>a("error")),u.receive("timeout",()=>a("timed out"))})}updateJoinPayload(r){this.joinPush.updatePayload(r)}unsubscribe(r=this.timeout){this.state=bi.leaving;const i=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(bo.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(o=>{n=new tg(this,bo.leave,{},r),n.receive("ok",()=>{i(),o("ok")}).receive("timeout",()=>{i(),o("timed out")}).receive("error",()=>{o("error")}),n.send(),this._canPush()||n.trigger("ok",{})}).finally(()=>{n==null||n.destroy()})}teardown(){this.pushBuffer.forEach(r=>r.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=bi.closed,this.bindings={}}async _fetchWithTimeout(r,i,n){const o=new AbortController,a=setTimeout(()=>o.abort(),n),l=await this.socket.fetch(r,Object.assign(Object.assign({},i),{signal:o.signal}));return clearTimeout(a),l}_push(r,i,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${r}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let o=new tg(this,r,i,n);return this._canPush()?o.send():this._addToPushBuffer(o),o}_addToPushBuffer(r){if(r.startTimeout(),this.pushBuffer.push(r),this.pushBuffer.length>t3){const i=this.pushBuffer.shift();i&&(i.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${i.event}`,i.payload))}}_onMessage(r,i,n){return i}_isMember(r){return this.topic===r}_joinRef(){return this.joinPush.ref}_trigger(r,i,n){var o,a;const l=r.toLocaleLowerCase(),{close:d,error:p,leave:u,join:g}=bo;if(n&&[d,p,u,g].indexOf(l)>=0&&n!==this._joinRef())return;let x=this._onMessage(l,i,n);if(i&&!x)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(l)?(o=this.bindings.postgres_changes)===null||o===void 0||o.filter(y=>{var _,S,k;return((_=y.filter)===null||_===void 0?void 0:_.event)==="*"||((k=(S=y.filter)===null||S===void 0?void 0:S.event)===null||k===void 0?void 0:k.toLocaleLowerCase())===l}).map(y=>y.callback(x,n)):(a=this.bindings[l])===null||a===void 0||a.filter(y=>{var _,S,k,w,b,j;if(["broadcast","presence","postgres_changes"].includes(l))if("id"in y){const T=y.id,P=(_=y.filter)===null||_===void 0?void 0:_.event;return T&&((S=i.ids)===null||S===void 0?void 0:S.includes(T))&&(P==="*"||(P==null?void 0:P.toLocaleLowerCase())===((k=i.data)===null||k===void 0?void 0:k.type.toLocaleLowerCase()))}else{const T=(b=(w=y==null?void 0:y.filter)===null||w===void 0?void 0:w.event)===null||b===void 0?void 0:b.toLocaleLowerCase();return T==="*"||T===((j=i==null?void 0:i.event)===null||j===void 0?void 0:j.toLocaleLowerCase())}else return y.type.toLocaleLowerCase()===l}).map(y=>{if(typeof x=="object"&&"ids"in x){const _=x.data,{schema:S,table:k,commit_timestamp:w,type:b,errors:j}=_;x=Object.assign(Object.assign({},{schema:S,table:k,commit_timestamp:w,eventType:b,new:{},old:{},errors:j}),this._getPayloadRecords(_))}y.callback(x,n)})}_isClosed(){return this.state===bi.closed}_isJoined(){return this.state===bi.joined}_isJoining(){return this.state===bi.joining}_isLeaving(){return this.state===bi.leaving}_replyEventName(r){return`chan_reply_${r}`}_on(r,i,n){const o=r.toLocaleLowerCase(),a={type:o,filter:i,callback:n};return this.bindings[o]?this.bindings[o].push(a):this.bindings[o]=[a],this}_off(r,i){const n=r.toLocaleLowerCase();return this.bindings[n]&&(this.bindings[n]=this.bindings[n].filter(o=>{var a;return!(((a=o.type)===null||a===void 0?void 0:a.toLocaleLowerCase())===n&&Aa.isEqual(o.filter,i))})),this}static isEqual(r,i){if(Object.keys(r).length!==Object.keys(i).length)return!1;for(const n in r)if(r[n]!==i[n])return!1;return!0}static isFilterValueEqual(r,i){return(r??void 0)===(i??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(r){this._on(bo.close,{},r)}_onError(r){this._on(bo.error,{},i=>r(i))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(r=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=bi.joining,this.joinPush.resend(r))}_getPayloadRecords(r){const i={new:{},old:{}};
74return(r.type==="INSERT"||r.type==="UPDATE")&&(i.new=o2(r.columns,r.record)),(r.type==="UPDATE"||r.type==="DELETE")&&(i.old=o2(r.columns,r.old_record)),i}}const rg=()=>{},iu={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},d3=[1e3,2e3,5e3,1e4],c3=1e4,p3=` 75 addEventListener("message", (e) => { 76 if (e.data.event === "start") { 77 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 78 } 79 });`;class aw{constructor(r,i){var n;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=Ef,this.transport=null,this.heartbeatIntervalMs=iu.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=rg,this.ref=0,this.reconnectTimer=null,this.vsn=n2,this.logger=rg,this.conn=null,this.sendBuffer=[],this.serializer=new r3,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=o=>o?(...a)=>o(...a):(...a)=>fetch(...a),!(!((n=i==null?void 0:i.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=i.params.apikey,this.endPoint=`${r}/${Rf.websocket}`,this.httpEndpoint=sw(r),this._initializeOptions(i),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(i==null?void 0:i.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=rw.createWebSocket(this.endpointURL())}catch(r){this._setConnectionState("disconnected");const i=r.message;throw i.includes("Node.js")?new Error(`${i} 80 81To use Realtime in Node.js, you need to provide a WebSocket implementation: 82 83Option 1: Use Node.js 22+ which has native WebSocket support 84Option 2: Install and provide the "ws" package: 85 86 npm install ws 87 88 import ws from "ws" 89 const client = new RealtimeClient(url, { 90 ...options, 91 transport: ws 92 })`):new Error(`WebSocket not available: ${i}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(r,i){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const n=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(n),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(r?this.conn.close(r,i??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(r){const i=await r.unsubscribe();return this.channels.length===0&&this.disconnect(),i}async removeAllChannels(){const r=await Promise.all(this.channels.map(i=>i.unsubscribe()));return this.channels=[],this.disconnect(),r}log(r,i,n){this.logger(r,i,n)}connectionState(){switch(this.conn&&this.conn.readyState){case Ms.connecting:return za.Connecting;case Ms.open:return za.Open;case Ms.closing:return za.Closing;default:return za.Closed}}isConnected(){return this.connectionState()===za.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(r,i={config:{}}){const n=`realtime:${r}`,o=this.getChannels().find(a=>a.topic===n);if(o)return o;{const a=new Aa(`realtime:${r}`,i,this);return this.channels.push(a),a}}push(r){const{topic:i,event:n,payload:o,ref:a}=r,l=()=>{this.encode(r,d=>{var p;(p=this.conn)===null||p===void 0||p.send(d)})};this.log("push",`${i} ${n} (${a})`,o),this.isConnected()?l():this.sendBuffer.push(l)}async setAuth(r=null){this._authPromise=this._performAuth(r);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var r;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(i){this.log("error","error in heartbeat callback",i)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(i){this.log("error","error in heartbeat callback",i)}this._wasManualDisconnect=!1,(r=this.conn)===null||r===void 0||r.close(e3,"heartbeat timeout"),setTimeout(()=>{var i;this.isConnected()||(i=this.reconnectTimer)===null||i===void 0||i.scheduleTimeout()},iu.HEARTBEAT_TIMEOUT_FALLBACK);return}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(i){this.log("error","error in heartbeat callback",i)}this._setAuthSafely("heartbeat")}onHeartbeat(r){this.heartbeatCallback=r}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(r=>r()),this.sendBuffer=[])}_makeRef(){let r=this.ref+1;return r===this.ref?this.ref=0:this.ref=r,this.ref.toString()}_leaveOpenTopic(r){let i=this.channels.find(n=>n.topic===r&&(n._isJoined()||n._isJoining()));i&&(this.log("transport",`leaving duplicate topic "${r}"`),i.unsubscribe())}_remove(r){this.channels=this.channels.filter(i=>i.topic!==r.topic)}_onConnMessage(r){this.decode(r.data,i=>
92{if(i.topic==="phoenix"&&i.event==="phx_reply"&&i.ref&&i.ref===this.pendingHeartbeatRef){const u=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback(i.payload.status==="ok"?"ok":"error",u)}catch(g){this.log("error","error in heartbeat callback",g)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}const{topic:n,event:o,payload:a,ref:l}=i,d=l?`(${l})`:"",p=a.status||"";this.log("receive",`${p} ${n} ${o} ${d}`.trim(),a),this.channels.filter(u=>u._isMember(n)).forEach(u=>u._trigger(o,a,l)),this._triggerStateCallbacks("message",i)})}_clearTimer(r){var i;r==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):r==="reconnect"&&((i=this.reconnectTimer)===null||i===void 0||i.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=r=>this._onConnError(r),this.conn.onmessage=r=>this._onConnMessage(r),this.conn.onclose=r=>this._onConnClose(r),this.conn.readyState===Ms.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===Ms.open||this.conn.readyState===Ms.connecting)try{this.conn.close()}catch(r){this.log("error","Error closing connection",r)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(r=>r.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(i=>{this.log("error","error waiting for auth on connect",i),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const r=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(r),this.workerRef.onerror=i=>{this.log("worker","worker error",i.message),this._terminateWorker()},this.workerRef.onmessage=i=>{i.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_onConnClose(r){var i;this._setConnectionState("disconnected"),this.log("transport","close",r),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(i=this.reconnectTimer)===null||i===void 0||i.scheduleTimeout(),this._triggerStateCallbacks("close",r)}_onConnError(r){this._setConnectionState("disconnected"),this.log("transport",`${r}`),this._triggerChanError(),this._triggerStateCallbacks("error",r);try{this.heartbeatCallback("error")}catch(i){this.log("error","error in heartbeat callback",i)}}_triggerChanError(){this.channels.forEach(r=>r._trigger(bo.error))}_appendParams(r,i){if(Object.keys(i).length===0)return r;const n=r.match(/\?/)?"&":"?",o=new URLSearchParams(i);return`${r}${n}${o}`}_workerObjectUrl(r){let i;if(r)i=r;else{const n=new Blob([p3],{type:"application/javascript"});i=URL.createObjectURL(n)}return i}_setConnectionState(r,i=!1){this._connectionState=r,r==="connecting"?this._wasManualDisconnect=!1:r==="disconnecting"&&(this._wasManualDisconnect=i)}async _performAuth(r=null){let i,n=!1;if(r)i=r,n=!0;else if(this.accessToken)try{i=await this.accessToken()}catch(o){this.log("error","Error fetching access token from callback",o),i=this.accessTokenValue}else i=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=i&&(this.accessTokenValue=i,this.channels.forEac
92h(o=>{const a={access_token:i,version:K6};i&&o.updateJoinPayload(a),o.joinedOnce&&o._isJoined()&&o._push(bo.access_token,{access_token:i})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(r="general"){this._isManualToken()||this.setAuth().catch(i=>{this.log("error",`Error setting auth in ${r}`,i)})}_triggerStateCallbacks(r,i){try{this.stateChangeCallbacks[r].forEach(n=>{try{n(i)}catch(o){this.log("error",`error in ${r} callback`,o)}})}catch(n){this.log("error",`error triggering ${r} callbacks`,n)}}_setupReconnectionTimer(){this.reconnectTimer=new nw(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},iu.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(r){var i,n,o,a,l,d,p,u,g,h,x,y;switch(this.transport=(i=r==null?void 0:r.transport)!==null&&i!==void 0?i:null,this.timeout=(n=r==null?void 0:r.timeout)!==null&&n!==void 0?n:Ef,this.heartbeatIntervalMs=(o=r==null?void 0:r.heartbeatIntervalMs)!==null&&o!==void 0?o:iu.HEARTBEAT_INTERVAL,this.worker=(a=r==null?void 0:r.worker)!==null&&a!==void 0?a:!1,this.accessToken=(l=r==null?void 0:r.accessToken)!==null&&l!==void 0?l:null,this.heartbeatCallback=(d=r==null?void 0:r.heartbeatCallback)!==null&&d!==void 0?d:rg,this.vsn=(p=r==null?void 0:r.vsn)!==null&&p!==void 0?p:n2,r!=null&&r.params&&(this.params=r.params),r!=null&&r.logger&&(this.logger=r.logger),(r!=null&&r.logLevel||r!=null&&r.log_level)&&(this.logLevel=r.logLevel||r.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(u=r==null?void 0:r.reconnectAfterMs)!==null&&u!==void 0?u:_=>d3[_-1]||c3,this.vsn){case Q6:this.encode=(g=r==null?void 0:r.encode)!==null&&g!==void 0?g:(_,S)=>S(JSON.stringify(_)),this.decode=(h=r==null?void 0:r.decode)!==null&&h!==void 0?h:(_,S)=>S(JSON.parse(_));break;case iw:this.encode=(x=r==null?void 0:r.encode)!==null&&x!==void 0?x:this.serializer.encode.bind(this.serializer),this.decode=(y=r==null?void 0:r.decode)!==null&&y!==void 0?y:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=r==null?void 0:r.workerUrl}}}var Gc=class extends Error{constructor(e,r){var i;super(e),this.name="IcebergError",this.status=r.status,this.icebergType=r.icebergType,this.icebergCode=r.icebergCode,this.details=r.details,this.isCommitStateUnknown=r.icebergType==="CommitStateUnknownException"||[500,502,504].includes(r.status)&&((i=r.icebergType)==null?void 0:i.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function u3(e,r,i){const n=new URL(r,e);if(i)for(const[o,a]of Object.entries(i))a!==void 0&&n.searchParams.set(o,a);return n.toString()}async function h3(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function g3(e){const r=e.fetchImpl??globalThis.fetch;return{async request({method:i,path:n,query:o,body:a,headers:l}){const d=u3(e.baseUrl,n,o),p=await h3(e.auth),u=await r(d,{method:i,headers:{...a?{"Content-Type":"application/json"}:{},...p,...l},body:a?JSON.stringify(a):void 0}),g=await u.text(),h=(u.headers.get("content-type")||"").includes("application/json"),x=h&&g?JSON.parse(g):g;if(!u.ok){const y=h?x:void 0,_=y==null?void 0:y.error;throw new Gc((_==null?void 0:_.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:_==null?void 0:_.type,icebergCode:_==null?void 0:_.code,details:y})}return{status:u.status,headers:u.headers,data:x}}}}function nu(e){return e.join("�")}var f3=class{constructor(e,r=""){this.client=e,this.prefix=r}async listNamespaces(e){const r=e?{parent:nu(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:r})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(e,r){const i={namespace:e.namespace,properties:r==null?void 0:r.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:i})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${nu(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${nu(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${nu(e.namespace)}`}),!0}catch(r){if(r instanceof Gc&&r.status===404)return!1;throw r}}async createNamespaceIfNotExists(e,r){try{return await this.createNamespace(e,r)}catch(i){if(i instanceof Gc&&i.status===409)return;throw i}}};function bl(e){return e.join("�")}var x3=class{constructor(e,r="",i){this.client=e,this.prefix=r,this.accessDelegation=i}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${bl(e.namespace)}/tables`})).data.identifiers}async createTable(e,r){const i={};return this.accessDelegation&&(i["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${bl(e.namespace)}/tables`,body:r,headers:i})).data.metadata}async updateTable(e,r){const i=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${bl(e.namespace)}/tables/${e.name}`,body:r});return{"metadata-location":i.data["metadata-location"],metadata:i.data.metadata}}async dropTable(e,r){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${bl(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((r==null?void 0:r.purge)??!1)}})}async loadTable(e){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${bl(e.namespace)}/tables/${e.name}`,headers:r})).data.metadata}async tableExists(e){const r={};this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${bl(e.namespace)}/tables/${e.name}`,headers:r}),!0}catch(i){if(i instanceof Gc&&i.status===404)return!1;throw i}}async createTableIfNotExists(e,r){try{return await this.createTable(e,r)}catch(i){if(i instanceof Gc&&i.status===409)return await this.loadTable({namespace:e.namespace,name:r.name});throw i}}},m3=class{constructor(e){var n;let r="v1";e.catalogName&&(r+=`/${e.catalogName}`);const i=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=g3({baseUrl:i,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(n=e.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new f3(this.client,r),this.tableOps=new x3(this.client,r,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,r){return this.namespaceOps.createNamespace(e,r)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
92async createTable(e,r){return this.tableOps.createTable(e,r)}async updateTable(e,r){return this.tableOps.updateTable(e,r)}async dropTable(e,r){await this.tableOps.dropTable(e,r)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,r){return this.namespaceOps.createNamespaceIfNotExists(e,r)}async createTableIfNotExists(e,r){return this.tableOps.createTableIfNotExists(e,r)}},Yh=class extends Error{constructor(e,r="storage",i,n){super(e),this.__isStorageError=!0,this.namespace=r,this.name=r==="vectors"?"StorageVectorsError":"StorageError",this.status=i,this.statusCode=n}};function Xh(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var ou=class extends Yh{constructor(e,r,i,n="storage"){super(e,n,r,i),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=r,this.statusCode=i}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},lw=class extends Yh{constructor(e,r,i="storage"){super(e,i),this.name=i==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=r}};const y3=e=>e?(...r)=>e(...r):(...r)=>fetch(...r),b3=e=>{if(typeof e!="object"||e===null)return!1;const r=Object.getPrototypeOf(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Pf=e=>{if(Array.isArray(e))return e.map(i=>Pf(i));if(typeof e=="function"||e!==Object(e))return e;const r={};return Object.entries(e).forEach(([i,n])=>{const o=i.replace(/([-_][a-z])/gi,a=>a.toUpperCase().replace(/[-_]/g,""));r[o]=Pf(n)}),r},v3=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function Jc(e){"@babel/helpers - typeof";return Jc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Jc(e)}function j3(e,r){if(Jc(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var n=i.call(e,r);if(Jc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function w3(e){var r=j3(e,"string");return Jc(r)=="symbol"?r:r+""}function _3(e,r,i){return(r=w3(r))in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e}function s2(e,r){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),i.push.apply(i,n)}return i}function zt(e){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};r%2?s2(Object(i),!0).forEach(function(n){_3(e,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):s2(Object(i)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))})}return e}const a2=e=>{var r;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(r=e.error)===null||r===void 0?void 0:r.message)||JSON.stringify(e)},S3=async(e,r,i,n)=>{if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!(i!=null&&i.noResolveJson)){const o=e,a=o.status||500;if(typeof o.json=="function")o.json().then(l=>{const d=(l==null?void 0:l.statusCode)||(l==null?void 0:l.code)||a+"";r(new ou(a2(l),a,d,n))}).catch(()=>{if(n==="vectors"){const l=a+"";r(new ou(o.statusText||`HTTP ${a} error`,a,l,n))}else{const l=a+"";r(new ou(o.statusText||`HTTP ${a} error`,a,l,n))}});else{const l=a+"";r(new ou(o.statusText||`HTTP ${a} error`,a,l,n))}}else r(new lw(a2(e),e,n))},k3=(e,r,i,n)=>{const o={method:e,headers:(r==null?void 0:r.headers)||{}};return e==="GET"||e==="HEAD"||!n?zt(zt({},o),i):(b3(n)?(o.headers=zt({"Content-Type":"application/json"},r==null?void 0:r.headers),o.body=JSON.stringify(n)):o.body=n,r!=null&&r.duplex&&(o.duplex=r.duplex),zt(zt({},o),i))};async function Gd(e,r,i,n,o,a,l){return new Promise((d,p)=>{e(i,k3(r,n,o,a)).then(u=>{if(!u.ok)throw u;if(n!=null&&n.noResolveJson)return u;if(l==="vectors"){const g=u.headers.get("content-type");if(u.headers.get("content-length")==="0"||u.status===204)return{};if(!g||!g.includes("application/json"))return{}}return u.json()}).then(u=>d(u)).catch(u=>S3(u,p,n,l))})}function dw(e="storage"){return{get:async(r,i,n,o)=>Gd(r,"GET",i,n,o,void 0,e),post:async(r,i,n,o,a)=>Gd(r,"POST",i,o,a,n,e),put:async(r,i,n,o,a)=>Gd(r,"PUT",i,o,a,n,e),head:async(r,i,n,o)=>Gd(r,"HEAD",i,zt(zt({},n),{},{noResolveJson:!0}),o,void 0,e),remove:async(r,i,n,o,a)=>Gd(r,"DELETE",i,o,a,n,e)}}const C3=dw("storage"),{get:Zc,post:mo,put:Ff,head:z3,remove:gm}=C3,Cn=dw("vectors");var Rd=class{constructor(e,r={},i,n="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=r,this.fetch=y3(i),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}async handleOperation(e){var r=this;try{return{data:await e(),error:null}}catch(i){if(r.shouldThrowOnError)throw i;if(Xh(i))return{data:null,error:i};throw i}}},E3=class{constructor(e,r){this.downloadFn=e,this.shouldThrowOnError=r}then(e,r){return this.execute().then(e,r)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(Xh(r))return{data:null,error:r};throw r}}};let cw;cw=Symbol.toStringTag;var R3=class{constructor(e,r){this.downloadFn=e,this.shouldThrowOnError=r,this[cw]="BlobDownloadBuilder",this.promise=null}asStream(){return new E3(this.downloadFn,this.shouldThrowOnError)}then(e,r){return this.getPromise().then(e,r)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(Xh(r))return{data:null,error:r};throw r}}};const I3={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},l2={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var T3=class extends Rd{constructor(e,r={},i,n){super(e,r,n,"storage"),this.bucketId=i}async uploadOrUpdate(e,r,i,n){var o=this;return o.handleOperation(async()=>{let a;const l=zt(zt({},l2),n);let d=zt(zt({},o.headers),e==="POST"&&{"x-upsert":String(l.upsert)});const p=l.metadata;typeof Blob<"u"&&i instanceof Blob?(a=new FormData,a.append("cacheControl",l.cacheControl),p&&a.append("metadata",o.encodeMetadata(p)),a.append("",i)):typeof FormData<"u"&&i instanceof FormData?(a=i,a.has("cacheControl")||a.append("cacheControl",l.cacheControl),p&&!a.has("metadata")&&a.append("metadata",o.encodeMetadata(p))):(a=i,d["cache-control"]=`max-age=${l.cacheControl}`,d["content-type"]=l.contentType,p&&(d["x-metadata"]=o.toBase64(o.encodeMetadata(p))),(typeof ReadableStream<"u"&&a
92instanceof ReadableStream||a&&typeof a=="object"&&"pipe"in a&&typeof a.pipe=="function")&&!l.duplex&&(l.duplex="half")),n!=null&&n.headers&&(d=zt(zt({},d),n.headers));const u=o._removeEmptyFolders(r),g=o._getFinalPath(u),h=await(e=="PUT"?Ff:mo)(o.fetch,`${o.url}/object/${g}`,a,zt({headers:d},l!=null&&l.duplex?{duplex:l.duplex}:{}));return{path:u,id:h.Id,fullPath:h.Key}})}async upload(e,r,i){return this.uploadOrUpdate("POST",e,r,i)}async uploadToSignedUrl(e,r,i,n){var o=this;const a=o._removeEmptyFolders(e),l=o._getFinalPath(a),d=new URL(o.url+`/object/upload/sign/${l}`);return d.searchParams.set("token",r),o.handleOperation(async()=>{let p;const u=zt({upsert:l2.upsert},n),g=zt(zt({},o.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&i instanceof Blob?(p=new FormData,p.append("cacheControl",u.cacheControl),p.append("",i)):typeof FormData<"u"&&i instanceof FormData?(p=i,p.append("cacheControl",u.cacheControl)):(p=i,g["cache-control"]=`max-age=${u.cacheControl}`,g["content-type"]=u.contentType),{path:a,fullPath:(await Ff(o.fetch,d.toString(),p,{headers:g})).Key}})}async createSignedUploadUrl(e,r){var i=this;return i.handleOperation(async()=>{let n=i._getFinalPath(e);const o=zt({},i.headers);r!=null&&r.upsert&&(o["x-upsert"]="true");const a=await mo(i.fetch,`${i.url}/object/upload/sign/${n}`,{},{headers:o}),l=new URL(i.url+a.url),d=l.searchParams.get("token");if(!d)throw new Yh("No token returned by API");return{signedUrl:l.toString(),path:e,token:d}})}async update(e,r,i){return this.uploadOrUpdate("PUT",e,r,i)}async move(e,r,i){var n=this;return n.handleOperation(async()=>await mo(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:e,destinationKey:r,destinationBucket:i==null?void 0:i.destinationBucket},{headers:n.headers}))}async copy(e,r,i){var n=this;return n.handleOperation(async()=>({path:(await mo(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:e,destinationKey:r,destinationBucket:i==null?void 0:i.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(e,r,i){var n=this;return n.handleOperation(async()=>{let o=n._getFinalPath(e),a=await mo(n.fetch,`${n.url}/object/sign/${o}`,zt({expiresIn:r},i!=null&&i.transform?{transform:i.transform}:{}),{headers:n.headers});const l=i!=null&&i.download?`&download=${i.download===!0?"":i.download}`:"";return{signedUrl:encodeURI(`${n.url}${a.signedURL}${l}`)}})}async createSignedUrls(e,r,i){var n=this;return n.handleOperation(async()=>{const o=await mo(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:r,paths:e},{headers:n.headers}),a=i!=null&&i.download?`&download=${i.download===!0?"":i.download}`:"";return o.map(l=>zt(zt({},l),{},{signedUrl:l.signedURL?encodeURI(`${n.url}${l.signedURL}${a}`):null}))})}download(e,r){const i=typeof(r==null?void 0:r.transform)<"u"?"render/image/authenticated":"object",n=this.transformOptsToQueryString((r==null?void 0:r.transform)||{}),o=n?`?${n}`:"",a=this._getFinalPath(e),l=()=>Zc(this.fetch,`${this.url}/${i}/${a}${o}`,{headers:this.headers,noResolveJson:!0});return new R3(l,this.shouldThrowOnError)}async info(e){var r=this;const i=r._getFinalPath(e);return r.handleOperation(async()=>Pf(await Zc(r.fetch,`${r.url}/object/info/${i}`,{headers:r.headers})))}async exists(e){var r=this;const i=r._getFinalPath(e);try{return await z3(r.fetch,`${r.url}/object/${i}`,{headers:r.headers}),{data:!0,error:null}}catch(n){if(r.shouldThrowOnError)throw n;if(Xh(n)&&n instanceof lw){const o=n.originalError;if([400,404].includes(o==null?void 0:o.status))return{data:!1,error:n}}throw n}}getPublicUrl(e,r){const i=this._getFinalPath(e),n=[],o=r!=null&&r.download?`download=${r.download===!0?"":r.download}`:"";o!==""&&n.push(o);const a=typeof(r==null?void 0:r.transform)<"u"?"render/image":"object",l=this.transformOptsToQueryString((r==null?void 0:r.transform)||{});l!==""&&n.push(l);let d=n.join("&");return d!==""&&(d=`?${d}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${i}${d}`)}}}async remove(e){var r=this;return r.handleOperation(async()=>await gm(r.fetch,`${r.url}/object/${r.bucketId}`,{prefixes:e},{headers:r.headers}))}async list(e,r,i){var n=this;return n.handleOperation(async()=>{const o=zt(zt(zt({},I3),r),{},{prefix:e||""});return await mo(n.fetch,`${n.url}/object/list/${n.bucketId}`,o,{headers:n.headers},i)})}async listV2(e,r){var i=this;return i.handleOperation(async()=>{const n=zt({},e);return await mo(i.fetch,`${i.url}/object/list-v2/${i.bucketId}`,n,{headers:i.headers},r)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const r=[];return e.width&&r.push(`width=${e.width}`),e.height&&r.push(`height=${e.height}`),e.resize&&r.push(`resize=${e.resize}`),e.format&&r.push(`format=${e.format}`),e.quality&&r.push(`quality=${e.quality}`),r.join("&")}};const A3="2.93.3",xp={"X-Client-Info":`storage-js/${A3}`};var P3=class extends Rd{constructor(e,r={},i,n){const o=new URL(e);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(o.hostname)&&!o.hostname.includes("storage.supabase.")&&(o.hostname=o.hostname.replace("supabase.","storage.supabase."));const a=o.href.replace(/\/$/,""),l=zt(zt({},xp),r);super(a,l,i,"storage")}async listBuckets(e){var r=this;return r.handleOperation(async()=>{const i=r.listBucketOptionsToQueryString(e);return await Zc(r.fetch,`${r.url}/bucket${i}`,{headers:r.headers})})}async getBucket(e){var r=this;return r.handleOperation(async()=>await Zc(r.fetch,`${r.url}/bucket/${e}`,{headers:r.headers}))}async createBucket(e,r={public:!1}){var i=this;return i.handleOperation(async()=>await mo(i.fetch,`${i.url}/bucket`,{id:e,name:e,type:r.type,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:i.headers}))}async updateBucket(e,r){var i=this;return i.handleOperation(async()=>await Ff(i.fetch,`${i.url}/bucket/${e}`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:i.headers}))}async emptyBucket(e){var r=this;return r.handleOperation(async()=>await mo(r.fetch,`${r.url}/bucket/${e}/empty`,{},{headers:r.headers}))}async deleteBucket(e){var r=this;return r.handleOperation(async()=>await gm(r.fetch,`${r.url}/bucket/${e}`,{},{headers:r.headers}))}listBucketOptionsToQueryString(e){const r={};return e&&("limit"in e&&(r.limit=String(e.limit)),"offset"in e&&(r.offset=String(e.offset)),e.search&&(r.search=e.search),e.sortColumn&&(r.sortColumn=e.sortColumn),e.sortOrder&&(r.sortOrder=e.sortOrder)),Object.keys(r).length>0?"?"+new URLSearchParams(r).toString():""}},F3=class extends Rd{constructor(e,r={},i){const n=e.replace(/\/$/,""),o=zt(zt({},xp),r);super(n,o,i,"storage")}async createBucket(e){var r=this;return r.handleOperation(async()=>await mo(r.fetch,`${r.url}/bucket`,{name:e},{headers:r.headers}))}async listBuckets(e){var r=this;return r.handleOperation(async()=>{const i=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&i.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&i.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&i.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&i.set("sortOrder",e.sortOrder),e!=null&&e.search&&i.set("search",e.search);const n=i.toString(),o=n?`${r.url}/bucket?${n}`:`${r.url}/bucket`;return await Zc(r.fetch,o,{headers:r.headers})})}async deleteBucket(e){var r=this;return r.handleOperation(async()=>await gm(r.fetch,`${r.url}/bucket/${e}`,{},{headers:r.headers}))}from(e){var r=this;if(!v3(e))throw new Yh("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const i=new m3({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>r.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(i,{get(o,a){const l=o[a];return typeof l!="function"?l:async(...d)=>{try{return{data:await l.apply(o,d),error:null}}catch(p){if(n)throw p;return{data:null,error:p}}}}})}},M3=class extends Rd{constructor(e,r={},i){const n=e.replace(/\/$/,""),o=zt(zt({},xp),{},{"Content-Type":"application/json"},r);super(n,o,i,"vectors")}async createIndex(e){var r=this;return r.handleOperation(async()=>await Cn.post(r.fetch,`${r.url}/CreateIndex`,e,{headers:r.headers})||{})}async getIndex(e,r){var i=this;return i.handleOperation(async()=>await Cn.post(i.fetch,`${i.url}/GetIndex`,{vectorBucketName:e,indexName:r},{headers:i.headers}))}async listIndexes(e){var r=this;return r.handleOperation(async()=>await Cn.post(r.fetch,`${r.url}/ListIndexes`,e,{headers:r.headers}))}async deleteIndex(e,r){var i=this;return i.handleOperation(async()=>await Cn.post(i.fetch,`${i.url}/DeleteIndex`,{vectorBucketName:e,indexName:r},{headers:i.headers})||{})}},D3=class extends Rd{constructor(e,r={},i){const n=e.replace(/\/$/,""),o=zt(zt({},xp),{},{"Content-Type":"application/json"},r);super(n,o,i,"vectors")}async putVectors(e){var r=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return r.handleOperation(async()=>await Cn.post(r.fetch,`${r.url}/PutVectors`,e,{headers:r.headers})||{})}async getVectors(e){var r=this;return r.handleOperation(async()=>await Cn.post(r.fetch,`${r.url}/GetVectors`,e,{headers:r.headers}))}async listVectors(e){var r=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");
92if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return r.handleOperation(async()=>await Cn.post(r.fetch,`${r.url}/ListVectors`,e,{headers:r.headers}))}async queryVectors(e){var r=this;return r.handleOperation(async()=>await Cn.post(r.fetch,`${r.url}/QueryVectors`,e,{headers:r.headers}))}async deleteVectors(e){var r=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return r.handleOperation(async()=>await Cn.post(r.fetch,`${r.url}/DeleteVectors`,e,{headers:r.headers})||{})}},B3=class extends Rd{constructor(e,r={},i){const n=e.replace(/\/$/,""),o=zt(zt({},xp),{},{"Content-Type":"application/json"},r);super(n,o,i,"vectors")}async createBucket(e){var r=this;return r.handleOperation(async()=>await Cn.post(r.fetch,`${r.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:r.headers})||{})}async getBucket(e){var r=this;return r.handleOperation(async()=>await Cn.post(r.fetch,`${r.url}/GetVectorBucket`,{vectorBucketName:e},{headers:r.headers}))}async listBuckets(e={}){var r=this;return r.handleOperation(async()=>await Cn.post(r.fetch,`${r.url}/ListVectorBuckets`,e,{headers:r.headers}))}async deleteBucket(e){var r=this;return r.handleOperation(async()=>await Cn.post(r.fetch,`${r.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:r.headers})||{})}},O3=class extends B3{constructor(e,r={}){super(e,r.headers||{},r.fetch)}from(e){return new L3(this.url,this.headers,e,this.fetch)}async createBucket(e){var r=()=>super.createBucket,i=this;return r().call(i,e)}async getBucket(e){var r=()=>super.getBucket,i=this;return r().call(i,e)}async listBuckets(e={}){var r=()=>super.listBuckets,i=this;return r().call(i,e)}async deleteBucket(e){var r=()=>super.deleteBucket,i=this;return r().call(i,e)}},L3=class extends M3{constructor(e,r,i,n){super(e,r,n),this.vectorBucketName=i}async createIndex(e){var r=()=>super.createIndex,i=this;return r().call(i,zt(zt({},e),{},{vectorBucketName:i.vectorBucketName}))}async listIndexes(e={}){var r=()=>super.listIndexes,i=this;return r().call(i,zt(zt({},e),{},{vectorBucketName:i.vectorBucketName}))}async getIndex(e){var r=()=>super.getIndex,i=this;return r().call(i,i.vectorBucketName,e)}async deleteIndex(e){var r=()=>super.deleteIndex,i=this;return r().call(i,i.vectorBucketName,e)}index(e){return new $3(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},$3=class extends D3{constructor(e,r,i,n,o){super(e,r,o),this.vectorBucketName=i,this.indexName=n}async putVectors(e){var r=()=>super.putVectors,i=this;return r().call(i,zt(zt({},e),{},{vectorBucketName:i.vectorBucketName,indexName:i.indexName}))}async getVectors(e){var r=()=>super.getVectors,i=this;return r().call(i,zt(zt({},e),{},{vectorBucketName:i.vectorBucketName,indexName:i.indexName}))}async listVectors(e={}){var r=()=>super.listVectors,i=this;return r().call(i,zt(zt({},e),{},{vectorBucketName:i.vectorBucketName,indexName:i.indexName}))}async queryVectors(e){var r=()=>super.queryVectors,i=this;return r().call(i,zt(zt({},e),{},{vectorBucketName:i.vectorBucketName,indexName:i.indexName}))}async deleteVectors(e){var r=()=>super.deleteVectors,i=this;return r().call(i,zt(zt({},e),{},{vectorBucketName:i.vectorBucketName,indexName:i.indexName}))}},W3=class extends P3{constructor(e,r={},i,n){super(e,r,i,n)}from(e){return new T3(this.url,this.headers,e,this.fetch)}get vectors(){return new O3(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new F3(this.url+"/iceberg",this.headers,this.fetch)}};const pw="2.93.3",zl=30*1e3,Mf=3,ig=Mf*zl,N3="http://localhost:9999",U3="supabase.auth.token",V3={"X-Client-Info":`gotrue-js/${pw}`},Df="X-Supabase-Api-Version",uw={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},q3=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,H3=10*60*1e3;class fd extends Error{constructor(r,i,n){super(r),this.__isAuthError=!0,this.name="AuthError",this.status=i,this.code=n}}function xt(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class hw extends fd{constructor(r,i,n){super(r,i,n),this.name="AuthApiError",this.status=i,this.code=n}}function gw(e){return xt(e)&&e.name==="AuthApiError"}class Os extends fd{constructor(r,i){super(r),this.name="AuthUnknownError",this.originalError=i}}class Go extends fd{constructor(r,i,n,o){super(r,n,o),this.name=i,this.status=n}}class cn extends Go{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Cu(e){return xt(e)&&e.name==="AuthSessionMissingError"}class wa extends Go{constructor(){super("Auth session or user missing","AuthInvalidToken
92ResponseError",500,void 0)}}class nc extends Go{constructor(r){super(r,"AuthInvalidCredentialsError",400,void 0)}}class oc extends Go{constructor(r,i=null){super(r,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=i}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function fw(e){return xt(e)&&e.name==="AuthImplicitGrantRedirectError"}class Bf extends Go{constructor(r,i=null){super(r,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=i}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class xw extends Go{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class oh extends Go{constructor(r,i){super(r,"AuthRetryableFetchError",i,void 0)}}function zu(e){return xt(e)&&e.name==="AuthRetryableFetchError"}class Of extends Go{constructor(r,i,n){super(r,"AuthWeakPasswordError",i,"weak_password"),this.reasons=n}}class sh extends Go{constructor(r){super(r,"AuthInvalidJwtError",400,"invalid_jwt")}}const ah="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),d2=` 93\r=`.split(""),G3=(()=>{const e=new Array(128);for(let r=0;r<e.length;r+=1)e[r]=-1;for(let r=0;r<d2.length;r+=1)e[d2[r].charCodeAt(0)]=-2;for(let r=0;r<ah.length;r+=1)e[ah[r].charCodeAt(0)]=r;return e})();function c2(e,r,i){if(e!==null)for(r.queue=r.queue<<8|e,r.queuedBits+=8;r.queuedBits>=6;){const n=r.queue>>r.queuedBits-6&63;i(ah[n]),r.queuedBits-=6}else if(r.queuedBits>0)for(r.queue=r.queue<<6-r.queuedBits,r.queuedBits=6;r.queuedBits>=6;){const n=r.queue>>r.queuedBits-6&63;i(ah[n]),r.queuedBits-=6}}function mw(e,r,i){const n=G3[e];if(n>-1)for(r.queue=r.queue<<6|n,r.queuedBits+=6;r.queuedBits>=8;)i(r.queue>>r.queuedBits-8&255),r.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function p2(e){const r=[],i=l=>{r.push(String.fromCodePoint(l))},n={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},a=l=>{Y3(l,n,i)};for(let l=0;l<e.length;l+=1)mw(e.charCodeAt(l),o,a);return r.join("")}function J3(e,r){if(e<=127){r(e);return}else if(e<=2047){r(192|e>>6),r(128|e&63);return}else if(e<=65535){r(224|e>>12),r(128|e>>6&63),r(128|e&63);return}else if(e<=1114111){r(240|e>>18),r(128|e>>12&63),r(128|e>>6&63),r(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function Z3(e,r){for(let i=0;i<e.length;i+=1){let n=e.charCodeAt(i);if(n>55295&&n<=56319){const o=(n-55296)*1024&65535;n=(e.charCodeAt(i+1)-56320&65535|o)+65536,i+=1}J3(n,r)}}function Y3(e,r,i){if(r.utf8seq===0){if(e<=127){i(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){r.utf8seq=n;break}if(r.utf8seq===2)r.codepoint=e&31;else if(r.utf8seq===3)r.codepoint=e&15;else if(r.utf8seq===4)r.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");r.utf8seq-=1}else if(r.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");r.codepoint=r.codepoint<<6|e&63,r.utf8seq-=1,r.utf8seq===0&&i(r.codepoint)}}function rd(e){const r=[],i={queue:0,queuedBits:0},n=o=>{r.push(o)};for(let o=0;o<e.length;o+=1)mw(e.charCodeAt(o),i,n);return new Uint8Array(r)}function X3(e){const r=[];return Z3(e,i=>r.push(i)),new Uint8Array(r)}function Pa(e){const r=[],i={queue:0,queuedBits:0},n=o=>{r.push(o)};return e.forEach(o=>c2(o,i,n)),c2(null,i,n),r.join("")}function K3(e){return Math.round(Date.now()/1e3)+e}function Q3(){return Symbol("auth-callback")}const Di=()=>typeof window<"u"&&typeof document<"u",xa={tested:!1,writable:!1},yw=()=>{if(!Di())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(xa.tested)return xa.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),xa.tested=!0,xa.writable=!0}catch{xa.tested=!0,xa.writable=!1}return xa.writable};function eC(e){const r={},i=new URL(e);if(i.hash&&i.hash[0]==="#")try{new URLSearchParams(i.hash.substring(1)).forEac
93h((o,a)=>{r[a]=o})}catch{}return i.searchParams.forEach((n,o)=>{r[o]=n}),r}const bw=e=>e?(...r)=>e(...r):(...r)=>fetch(...r),tC=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",El=async(e,r,i)=>{await e.setItem(r,JSON.stringify(i))},ma=async(e,r)=>{const i=await e.getItem(r);if(!i)return null;try{return JSON.parse(i)}catch{return i}},Mi=async(e,r)=>{await e.removeItem(r)};class Kh{constructor(){this.promise=new Kh.promiseConstructor((r,i)=>{this.resolve=r,this.reject=i})}}Kh.promiseConstructor=Promise;function su(e){const r=e.split(".");if(r.length!==3)throw new sh("Invalid JWT structure");for(let n=0;n<r.length;n++)if(!q3.test(r[n]))throw new sh("JWT not in base64url format");return{header:JSON.parse(p2(r[0])),payload:JSON.parse(p2(r[1])),signature:rd(r[2]),raw:{header:r[0],payload:r[1]}}}async function rC(e){return await new Promise(r=>{setTimeout(()=>r(null),e)})}function iC(e,r){return new Promise((n,o)=>{(async()=>{for(let a=0;a<1/0;a++)try{const l=await e(a);if(!r(a,null,l)){n(l);return}}catch(l){if(!r(a,l)){o(l);return}}})()})}function nC(e){return("0"+e.toString(16)).substr(-2)}function oC(){const r=new Uint32Array(56);if(typeof crypto>"u"){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=i.length;let o="";for(let a=0;a<56;a++)o+=i.charAt(Math.floor(Math.random()*n));return o}return crypto.getRandomValues(r),Array.from(r,nC).join("")}async function sC(e){const i=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",i),o=new Uint8Array(n);return Array.from(o).map(a=>String.fromCharCode(a)).join("")}async function aC(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const i=await sC(e);return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function vl(e,r,i=!1){const n=oC();let o=n;i&&(o+="/PASSWORD_RECOVERY"),await El(e,`${r}-code-verifier`,o);const a=await aC(n);return[a,n===a?"plain":"s256"]}const lC=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function dC(e){const r=e.headers.get(Df);if(!r||!r.match(lC))return null;try{return new Date(`${r}T00:00:00.0Z`)}catch{return null}}function cC(e){if(!e)throw new Error("Missing exp claim");const r=Math.floor(Date.now()/1e3);if(e<=r)throw new Error("JWT has expired")}function pC(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const uC=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function jl(e){if(!uC.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function ng(){const e={};return new Proxy(e,{get:(r,i)=>{if(i==="__isUserNotAvailableProxy")return!0;if(typeof i=="symbol"){const n=i.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${i}" property of the session object is not supported. Please use getUser() instead.`)},set:(r,i)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${i}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(r,i)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${i}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function hC(e,r){return new Proxy(e,{get:(i,n,o)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const a=n.toString();if(a==="Symbol(Symbol.toPrimitive)"||a==="Symbol(Symbol.toStringTag)"||a==="Symbol(util.inspect.custom)"||a==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(i,n,o)}return!r.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),r.value=!0),Reflect.get(i,n,o)}})}function u2(e){return JSON.parse(JSON.stringify(e))}const _a=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),gC=[502,503,504];async function h2(e){var r;if(!tC(e))throw new oh(_a(e),0);if(gC.includes(e.status))throw new oh(_a(e),e.status);let i;try{i=await e.json()}catch(a){throw new Os(_a(a),a)}let n;const o=dC(e);if(o&&o.getTime()>=uw["2024-01-01"].timestamp&&typeof i=="object"&&i&&typeof i.code=="string"?n=i.code:typeof i=="object"&&i&&typeof i.error_code=="string"&&(n=i.error_code),n){if(n==="weak_password")throw new Of(_a(i),e.status,((r=i.weak_password)===null||r===void 0?void 0:r.reasons)||[]);if(n==="session_not_found")throw new cn}else if(typeof i=="object"&&i&&typeof i.weak_password=="object"&&i.weak_password&&Array.isArray(i.weak_password.reasons)&&i.weak_password.reasons.length&&i.weak_password.reasons.reduce((a,l)=>a&&typeof l=="string",!0))throw new Of(_a(i),e.status,i.weak_password.reasons);throw new hw(_a(i),e.status||500,n)}const fC=(e,r,i,n)=>{const o={method:e,headers:(r==null?void 0:r.headers)||{}};return e==="GET"?o:(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},r==null?void 0:r.headers),o.body=JSON.stringify(n),Object.assign(Object.assign({},o),i))};async function wt(e,r,i,n){var o;const a=Object.assign({},n==null?void 0:n.headers);a[Df]||(a[Df]=uw["2024-01-01"].name),n!=null&&n.jwt&&(a.Authorization=`Bearer ${n.jwt}`);const l=(o=n==null?void 0:n.query)!==null&&o!==void 0?o:{};n!=null&&n.redirectTo&&(l.redirect_to=n.redirectTo);const d=Object.keys(l).length?"?"+new URLSearchParams(l).toString():"",p=await xC(e,r,i+d,{headers:a,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(p):{data:Object.assign({},p),error:null}}async function xC(e,r,i,n,o,a){const l=fC(r,n,o,a);let d;try{d=await e(i,Object.assign({},l))}catch(p){throw console.error(p),new oh(_a(p),0)}if(d.ok||await h2(d),n!=null&&n.noResolveJson)return d;try{return await d.json()}catch(p){await h2(p)}}function go(e){var r;let i=null;bC(e)&&(i=Object.assign({},e),e.expires_at||(i.expires_at=K3(e.expires_in)));const n=(r=e.user)!==null&&r!==void 0?r:e;return{data:{session:i,user:n},error:null}}function g2(e){const r=go(e);return!r.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((i,n)=>i&&typeof n=="string",!0)&&(r.data.weak_password=e.weak_password),r}function Ls(e){var r;return{data:{user:(r=e.user)!==null&&r!==void 0?r:e},error:null}}function mC(e){return{data:e,error:null}}function yC(e){const{action_link:r,email_otp:i,hashed_token:n,redirect_to:o,verification_type:a}=e,l=Jh(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),d={action_link:r,email_otp:i,hashed_token:n,redirect_to:o,verification_type:a},p=Object.assign({},l);return{data:{properties:d,user:p},error:null}}function f2(e){return e}function bC(e){return e.access_token&&e.refresh_token&&e.expires_in}const Eu=["global","local","others"];class vw{constructor({url:r="",headers:i={},fetch:n}){this.url=r,this.headers=i,this.fetch=bw(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(r,i=Eu[0]){if(Eu.indexOf(i)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Eu.join(", ")}`);try{return await wt(this.fetch,"POST",`${this.url}/logout?scope=${i}`,{headers:this.headers,jwt:r,noResolveJson:!0}),{data:null,error:null}}catch(n){if(xt(n))return{data:null,error:n};throw n}}async inviteUserByEmail(r,i={}){try{return await wt(this.fetch,"POST",`${this.url}/invite`,{body:{email:r,data:i.data},headers:this.headers,redirectTo:i.redirectTo,xform:Ls})}catch(n){if(xt(n))return{data:{user:null},error:n};throw n}}async generateLink(r){try{const{options:i}=r,n=Jh(r,["options"]),o=Object.assign(Object.assign({},n),i);return"newEmail"in n&&(o.new_email=n==null?void 0:n.newEmail,delete o.newEmail),await wt(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:yC,redirectTo:i==null?void 0:i.redirectTo})}catch(i){if(xt(i))return{data:{properties:null,user:null},error:i};throw i}}async createUser(r){try{return await wt(this.fetch,"POST",`${this.url}/admin/users`,{body:r,headers:this.headers,xform:Ls})}catch(i){if(xt(i))return{data:{user:null},error:i};throw i}}async listUsers(r){var i,n,o,a,l,d,p;try{const u={nextPage:null,lastPage:0,total:0},g=await wt(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(i=r==null?void 0:r.page)===null||i===void 0?void 0:i.toString())!==null&&n!==void 0?n:"",per_page:(a=(o=r==null?void 0:r.perPage)===null||o===void 0?void 0:o.toString())!==null&&a!==void 0?a:""},xform:f2});if(g.error)throw g.error;const h=await g.json(),x=(l=g.headers.get("x-total-count"))!==null&&l!==void 0?l:0,y=(p=(d=g.headers.get("link"))===null||d===void 0?void 0:d.split(","))!==null&&p!==void 0?p:[];return y.length>0&&(y.forEach(_=>{const S=parseInt(_.split(";")[0].split("=")[1].substring(0,1)),k=JSON.parse(_.split(";")[1].split("=")[1]);u[`${k}Page`]=S}),u.total=parseInt(x)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(xt(u))return{data:{users:[]},error:u};throw u}}async getUserById(r){jl(r);try{return await wt(this.fetch,"GET",`${this.url}/admin/users/${r}`,{headers:this.headers,xform:Ls})}catch(i){if(xt(i))return{data:{user:null},error:i};throw i}}async updateUserById(r,i){jl(r);try{return await wt(this.fetch,"PUT",`${this.url}/admin/users/${r}`,{body:i,headers:this.headers,xform:Ls})}catch(n){if(xt(n))return{data:{user:null},error:n};throw n}}async deleteUser(r,i=!1){jl(r);
93try{return await wt(this.fetch,"DELETE",`${this.url}/admin/users/${r}`,{headers:this.headers,body:{should_soft_delete:i},xform:Ls})}catch(n){if(xt(n))return{data:{user:null},error:n};throw n}}async _listFactors(r){jl(r.userId);try{const{data:i,error:n}=await wt(this.fetch,"GET",`${this.url}/admin/users/${r.userId}/factors`,{headers:this.headers,xform:o=>({data:{factors:o},error:null})});return{data:i,error:n}}catch(i){if(xt(i))return{data:null,error:i};throw i}}async _deleteFactor(r){jl(r.userId),jl(r.id);try{return{data:await wt(this.fetch,"DELETE",`${this.url}/admin/users/${r.userId}/factors/${r.id}`,{headers:this.headers}),error:null}}catch(i){if(xt(i))return{data:null,error:i};throw i}}async _listOAuthClients(r){var i,n,o,a,l,d,p;try{const u={nextPage:null,lastPage:0,total:0},g=await wt(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(i=r==null?void 0:r.page)===null||i===void 0?void 0:i.toString())!==null&&n!==void 0?n:"",per_page:(a=(o=r==null?void 0:r.perPage)===null||o===void 0?void 0:o.toString())!==null&&a!==void 0?a:""},xform:f2});if(g.error)throw g.error;const h=await g.json(),x=(l=g.headers.get("x-total-count"))!==null&&l!==void 0?l:0,y=(p=(d=g.headers.get("link"))===null||d===void 0?void 0:d.split(","))!==null&&p!==void 0?p:[];return y.length>0&&(y.forEach(_=>{const S=parseInt(_.split(";")[0].split("=")[1].substring(0,1)),k=JSON.parse(_.split(";")[1].split("=")[1]);u[`${k}Page`]=S}),u.total=parseInt(x)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(xt(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(r){try{return await wt(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:r,headers:this.headers,xform:i=>({data:i,error:null})})}catch(i){if(xt(i))return{data:null,error:i};throw i}}async _getOAuthClient(r){try{return await wt(this.fetch,"GET",`${this.url}/admin/oauth/clients/${r}`,{headers:this.headers,xform:i=>({data:i,error:null})})}catch(i){if(xt(i))return{data:null,error:i};throw i}}async _updateOAuthClient(r,i){try{return await wt(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${r}`,{body:i,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(xt(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(r){try{return await wt(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${r}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(i){if(xt(i))return{data:null,error:i};throw i}}async _regenerateOAuthClientSecret(r){try{return await wt(this.fetch,"POST",`${this.url}/admin/oauth/clients/${r}/regenerate_secret`,{headers:this.headers,xform:i=>({data:i,error:null})})}catch(i){if(xt(i))return{data:null,error:i};throw i}}}function x2(e={}){return{getItem:r=>e[r]||null,setItem:(r,i)=>{e[r]=i},removeItem:r=>{delete e[r]}}}const Sa={debug:!!(globalThis&&yw()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};
93class jw extends Error{constructor(r){super(r),this.isAcquireTimeout=!0}}class ww extends jw{}async function _w(e,r,i){Sa.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,r);const n=new globalThis.AbortController;return r>0&&setTimeout(()=>{n.abort(),Sa.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},r),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,r===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async o=>{if(o){Sa.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,o.name);try{return await i()}finally{Sa.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,o.name)}}else{if(r===0)throw Sa.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new ww(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(Sa.debug)try{const a=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(a,null," "))}catch(a){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",a)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await i()}}))}function vC(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function Sw(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function jC(e){return parseInt(e,16)}function wC(e){const r=new TextEncoder().encode(e);return"0x"+Array.from(r,n=>n.toString(16).padStart(2,"0")).join("")}function _C(e){var r;const{chainId:i,domain:n,expirationTime:o,issuedAt:a=new Date,nonce:l,notBefore:d,requestId:p,resources:u,scheme:g,uri:h,version:x}=e;{if(!Number.isInteger(i))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${i}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(l&&l.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${l}`);if(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(x!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${x}`);if(!((r=e.statement)===null||r===void 0)&&r.includes(` 94`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const y=Sw(e.address),_=g?`${g}://${n}`:n,S=e.statement?`${e.statement} 95`:"",k=`${_} wants you to sign in with your Ethereum account: 96${y} 97 98${S}`;let w=`URI: ${h} 99Version: ${x} 100Chain ID: ${i}${l?` 101Nonce: ${l}`:""} 102Issued At: ${a.toISOString()}`;if(o&&(w+=` 103Expiration Time: ${o.toISOString()}`),d&&(w+=` 104Not Before: ${d.toISOString()}`),p&&(w+=` 105Request ID: ${p}`),u){let b=` 106Resources:`;for(const j of u){if(!j||typeof j!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${j}`);b+=` 107- ${j}`}w+=b}return`${k} 108${w}`}class hi extends Error{constructor({message:r,code:i,cause:n,name:o}){var a;super(r,{cause:n}),this.__isWebAuthnError=!0,this.name=(a=o??(n instanceof Error?n.name:void 0))!==null&&a!==void 0?a:"Unknown Error",this.code=i}}class lh extends hi{constructor(r,i){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:i,message:r}),this.name="WebAuthnUnknownError",this.originalError=i}}function SC({error:e,options:r}){var i,n,o;const{publicKey:a}=r;if(!a)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(r.signal instanceof AbortSignal)return new hi({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((i=a.authenticatorSelection)===null||i===void 0?void 0:i.requireResidentKey)===!0)return new hi({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(r.mediation==="conditional"&&((n=a.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new hi({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((o=a.authenticatorSelection)===null||o===void 0?void 0:o.userVerification)==="required")return new hi({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new hi({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new hi({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return a.pubKeyCredParams.filter(d=>d.type==="public-key").length===0?new hi({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new hi({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const l=window.location.hostname;if(kw(l)){if(a.rp.id!==l)return new hi({message:`The RP ID "${a.rp.id}
108" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new hi({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(a.user.id.byteLength<1||a.user.id.byteLength>64)return new hi({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new hi({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new hi({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function kC({error:e,options:r}){const{publicKey:i}=r;if(!i)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(r.signal instanceof AbortSignal)return new hi({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new hi({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const n=window.location.hostname;if(kw(n)){if(i.rpId!==n)return new hi({message:`The RP ID "${i.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new hi({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new hi({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new hi({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class CC{createNewAbortSignal(){if(this.controller){const i=new Error("Cancelling existing WebAuthn API call for new one");i.name="AbortError",this.controller.abort(i)}const r=new AbortController;return this.controller=r,r.signal}cancelCeremony(){if(this.controller){const r=new Error("Manually cancelling existing WebAuthn API call");r.name="AbortError",this.controller.abort(r),this.controller=void 0}}}const zC=new CC;function EC(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:r,user:i,excludeCredentials:n}=e,o=Jh(e,["challenge","user","excludeCredentials"]),a=rd(r).buffer,l=Object.assign(Object.assign({},i),{id:rd(i.id).buffer}),d=Object.assign(Object.assign({},o),{challenge:a,user:l});if(n&&n.length>0){d.excludeCredentials=new Array(n.length);for(let p=0;p<n.length;p++){const u=n[p];d.excludeCredentials[p]=Object.assign(Object.assign({},u),{id:rd(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return d}function RC(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:r,allowCredentials:i}=e,n=Jh(e,["challenge","allowCredentials"]),o=rd(r).buffer,a=Object.assign(Object.assign({},n),{challenge:o});if(i&&i.length>0){a.allowCredentials=new Array(i.length);for(let l=0;l<i.length;l++){const d=i[l];a.allowCredentials[l]=Object.assign(Object.assign({},d),{id:rd(d.id).buffer,type:d.type||"public-key",transports:d.transports})}}return a}function IC(e){var r;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const i=e;return{id:e.id,rawId:e.id,response:{attestationObject:Pa(new Uint8Array(e.response.attestationObject)),clientDataJSON:Pa(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(r=i.authenticatorAttachment)!==null&&r!==void 0?r:void 0}}function TC(e){var r;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const i=e,n=e.getClientExtensionResults(),o=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:Pa(new Uint8Array(o.authenticatorData)),clientDataJSON:Pa(new Uint8Array(o.clientDataJSON)),signature:Pa(new Uint8Array(o.signature)),userHandle:o.userHandle?Pa(new Uint8Array(o.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(r=i.authenticatorAttachment)!==null&&r!==void 0?r:void 0}}function kw(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function m2(){var e,r;return!!(Di()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((r=navigator==null?void 0:navigator.credentials)===null||r===void 0?void 0:r.get)=="function")}async function AC(e){try{const r=await navigator.credentials.create(e);return r?r instanceof PublicKeyCredential?{data:r,error:null}:{data:null,error:new lh("Browser returned unexpected credential type",r)}:{data:null,error:new lh("Empty credential response",r)}}catch(r){return{data:null,error:SC({error:r,options:e})}}}async function PC(e){try{const r=await navigator.credentials.get(e);return r?r instanceof PublicKeyCredential?{data:r,error:null}:{data:null,error:new lh("Browser returned unexpected credential type",r)}:{data:null,error:new lh("Empty credential response",r)}}catch(r){return{data:null,error:kC({error:r,options:e})}}}const FC={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},MC={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function dh(...e){const r=o=>o!==null&&typeof o=="object"&&!Array.isArray(o),i=o=>o instanceof ArrayBuffer||ArrayBuffer.isView(o),n={};for(const o of e)if(o)for(const a in o){const l=o[a];if(l!==void 0)if(Array.isArray(l))n[a]=l;else if(i(l))n[a]=l;else if(r(l)){const d=n[a];r(d)?n[a]=dh(d,l):n[a]=dh(l)}else n[a]=l}return n}function DC(e,r){return dh(FC,e,r||{})}function BC(e,r){return dh(MC,e,r||{})}class OC{constructor(r){this.client=r,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(r){return this.client.mfa.enroll(Object.assign(Object.assign({},r),{factorType:"webauthn"}))}async _challenge({factorId:r,webauthn:i,friendlyName:n,signal:o},a){var l;try{const{data:d,error:p}=await this.client.mfa.challenge({factorId:r,webauthn:i});if(!d)return{data:null,error:p};const u=o??zC.createNewAbortSignal();if(d.webauthn.type==="create"){const{user:g}=d.webauthn.credential_options.publicKey;if(!g.name){const h=n;if(h)g.name=`${g.id}:${h}`;else{const y=(await this.client.getUser()).data.user,_=((l=y==null?void 0:y.user_metadata)===null||l===void 0?void 0:l.name)||(y==null?void 0:y.email)||(y==null?void 0:y.id)||"User";g.name=`${g.id}:${_}`}}g.displayName||(g.displayName=g.name)}switch(d.webauthn.type){case"create":{const g=DC(d.webauthn.credential_options.publicKey,a==null?void 0:a.create),{data:h,error:x}=await AC({publicKey:g,signal:u});return h?{data:{factorId:r,challengeId:d.id,webauthn:{type:d.webauthn.type,credential_response:h}},error:null}:{data:null,error:x}}case"request":{const g=BC(d.webauthn.credential_options.publicKey,a==null?void 0:a.request),{data:h,error:x}=await PC(Object.assign(Object.assign({},d.webauthn.credential_options),{publicKey:g,signal:u}));return h?{data:{factorId:r,challengeId:d.id,webauthn:{type:d.webauthn.type,credential_response:h}},error:null}:{data:null,error:x}}}}catch(d){return xt(d)?{data:null,error:d}:{data:null,error:new Os("Unexpected error in challenge",d)}}}async _verify({challengeId:r,factorId:i,webauthn:n}){return this.client.mfa.verify({factorId:i,challengeId:r,webauthn:n})}async _authenticate({factorId:r,webauthn:{rpId:i=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},a){if(!i)return{data:null,error:new fd("rpId is required for WebAuthn authentication")};try{if(!m2())return{data:null,error:new Os("Browser does not support WebAuthn",null)};const{data:l,error:d}=await this.challenge({factorId:r,webauthn:{rpId:i,rpOrigins:n},signal:o},{request:a});if(!l)return{data:null,error:d};const{webauthn:p}=l;return this._verify({factorId:r,challengeId:l.challengeId,webauthn:{type:p.type,rpId:i,rpOrigins:n,credential_response:p.credential_response}})}catch(l){return xt(l)?{data:null,error:l}:{data:null,error:new Os("Unexpected error in authenticate",l)}
108}}async _register({friendlyName:r,webauthn:{rpId:i=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},a){if(!i)return{data:null,error:new fd("rpId is required for WebAuthn registration")};try{if(!m2())return{data:null,error:new Os("Browser does not support WebAuthn",null)};const{data:l,error:d}=await this._enroll({friendlyName:r});if(!l)return await this.client.mfa.listFactors().then(g=>{var h;return(h=g.data)===null||h===void 0?void 0:h.all.find(x=>x.factor_type==="webauthn"&&x.friendly_name===r&&x.status!=="unverified")}).then(g=>g?this.client.mfa.unenroll({factorId:g==null?void 0:g.id}):void 0),{data:null,error:d};const{data:p,error:u}=await this._challenge({factorId:l.id,friendlyName:l.friendly_name,webauthn:{rpId:i,rpOrigins:n},signal:o},{create:a});return p?this._verify({factorId:l.id,challengeId:p.challengeId,webauthn:{rpId:i,rpOrigins:n,type:p.webauthn.type,credential_response:p.webauthn.credential_response}}):{data:null,error:u}}catch(l){return xt(l)?{data:null,error:l}:{data:null,error:new Os("Unexpected error in register",l)}}}}vC();const LC={url:N3,storageKey:U3,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:V3,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:1e4};async function y2(e,r,i){return await i()}const wl={};class xd{get jwks(){var r,i;return(i=(r=wl[this.storageKey])===null||r===void 0?void 0:r.jwks)!==null&&i!==void 0?i:{keys:[]}}set jwks(r){wl[this.storageKey]=Object.assign(Object.assign({},wl[this.storageKey]),{jwks:r})}get jwks_cached_at(){var r,i;return(i=(r=wl[this.storageKey])===null||r===void 0?void 0:r.cachedAt)!==null&&i!==void 0?i:Number.MIN_SAFE_INTEGER}set jwks_cached_at(r){wl[this.storageKey]=Object.assign(Object.assign({},wl[this.storageKey]),{cachedAt:r})}constructor(r){var i,n,o;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const a=Object.assign(Object.assign({},LC),r);if(this.storageKey=a.storageKey,this.instanceID=(i=xd.nextInstanceID[this.storageKey])!==null&&i!==void 0?i:0,xd.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!a.debug,typeof a.debug=="function"&&(this.logger=a.debug),this.instanceID>0&&Di()){const l=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(l),this.logDebugMessages&&console.trace(l)}if(this.persistSession=a.persistSession,this.autoRefreshToken=a.autoRefreshToken,this.admin=new vw({url:a.url,headers:a.headers,fetch:a.fetch}),this.url=a.url,this.headers=a.headers,this.fetch=bw(a.fetch),this.lock=a.lock||y2,this.detectSessionInUrl=a.detectSessionInUrl,this.flowType=a.flowType,this.hasCustomAuthorizationHeader=a.hasCustomAuthorizationHeader,this.throwOnError=a.throwOnError,this.lockAcquireTimeout=a.lockAcquireTimeout,a.lock?this.lock=a.lock:this.persistSession&&Di()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=_w:this.lock=y2,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new OC(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(a.storage?this.storage=a.storage:yw()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=x2(this.memoryStorage)),a.userStorage&&(this.userStorage=a.userStorage)):(this.memoryStorage={},this.storage=x2(this.memoryStorage)),Di()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(l){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",l)}(o=this.broadcastChannel)===null||o===void 0||o.addEventListener("message",async l=>{this._debug("received broadcast notification from other tab or client",l);try{await this._notifyAllSubscribers(l.data.event,l.data.session,!1)}catch(d){this._debug("#broadcastChannel","error",d)}})}this.initialize().catch(l=>{this._debug("#initialize()","error",l)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(r){if(this.throwOnError&&r&&r.error)throw r.error;return r}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${pw}) ${new Date().toISOString()}`}_debug(...r){return this.logDebugMessages&&this.logger(this._logPrefix(),...r),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var r;try{let i={},n="none";if(Di()&&(i=eC(window.location.href),this._isImplicitGrantCallback(i)?n="implicit":await this._isPKCECallback(i)&&(n="pkce")),Di()&&this.detectSessionInUrl&&n!=="none"){const{data:o,error:a}=await this._getSessionFromURL(i,n);if(a){if(this._debug("#_initialize()","error detecting session from URL",a),fw(a)){const p=(r=a.details)===null||r===void 0?void 0:r.code;if(p==="identity_already_exists"||p==="identity_not_found"||p==="single_identity_not_deletable")return{error:a}}return{error:a}}const{session:l,redirectType:d}=o;return this._debug("#_initialize()","detected session in URL",l,"redirect type",d),await this._saveSession(l),setTimeout(async()=>{d==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",l):await this._notifyAllSubscribers("SIGNED_IN",l)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(i){return xt(i)?this._returnResult({error:i}):this._returnResult({error:new Os("Unexpected error during initialization",i)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(r){var i,n,o;try{const a=await wt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(i=r==null?void 0:r.options)===null||i===void 0?void 0:i.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(o=r==null?void 0:r.options)===null||o===void 0?void 0:o.captchaToken}},xform:go}),{data:l,error:d}=a;if(d||!l)return this._returnResult({data:{user:null,session:null},error:d});const p=l.session,u=l.user;return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",p)),this._returnResult({data:{user:u,session:p},error:null})}catch(a){if(xt(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signUp(r){var i,n,o;try{let a;if("email"in r){const{email:g,password:h,options:x}=r;let y=null,_=null;this.flowType==="pkce"&&([y,_]=await vl(this.storage,this.storageKey)),a=await wt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:x==null?void 0:x.emailRedirectTo,body:{email:g,password:h,data:(i=x==null?void 0:x.data)!==null&&i!==void 0?i:{},gotrue_meta_security:{captcha_token:x==null?void 0:x.captchaToken},code_challenge:y,code_challenge_method:_},xform:go})}else if("phone"in r){const{phone:g,password:h,options:x}=r;a=await wt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:g,password:h,data:(n=x==null?void 0:x.data)!==null&&n!==void 0?n:{},channel:(o=x==null?void 0:x.channel)!==null&&o!==void 0?o:"sms",gotrue_meta_security:{captcha_token:x==null?void 0:x.captchaToken}},xform:go})}else throw new nc("You must provide either an email or phone number and a password");const{data:l,error:d}=a;if(d||!l)return await Mi(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:d});const p=l.session,u=l.user;return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",p)),this._returnResult({data:{user:u,session:p},error:null})}catch(a){if(await Mi(this.storage,`${this.storageKey}-code-verifier`),xt(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithPassword(r){try{let i;if("email"in r){const{email:a,password:l,options:d}=r;i=await wt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:l,gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken}},xform:g2})}else if("phone"in r){const{phone:a,password:l,options:d}=r;i=await wt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:l,gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken}},xform:g2})}else throw new nc("You must provide either an email or phone number and a password");const{data:n,error:o}=i;if(o)return this._returnResult({data:{user:null,session:null},error:o});if(!n||!n.session||!n.user){const a=new wa;return this._returnResult({data:{user:null,session:null},error:a})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:o})}catch(i){if(xt(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithOAuth(r){var i,n,o,a;return await this._handleProviderSignIn(r.provider,{redirectTo:(i=r.options)===null||i===void 0?void 0:i.redirectTo,scopes:(n=r.options)===null||n===void 0?void 0:n.scopes,queryParams:(o=r.options)===null||o===void 0?void 0:o.queryParams,skipBrowserRedirect:(a=r.options)===null||a===void 0?void 0:a.skipBrowserRedirect})}async exchangeCodeForSession(r){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(r))}async signInWithWeb3(r){const{chain:i}=r;switch(i){case"ethereum":return await this.signInWithEthereum(r);case"solana":return await this.signInWithSolana(r);default:throw new Error(`@supabase/auth-js: Unsupported chain "${i}"`)}}async signInWithEthereum(r){var i,n,o,a,l,d,p,u,g,h,x;let y,_;if("message"in r)y=r.message,_=r.signature;else{const{chain:S,wallet:k,statement:w,options:b}=r;let j;if(Di())if(typeof k=="object")j=k;else{const E=window;if("ethereum"in E&&typeof E.ethereum=="object"&&"request"in E.ethereum&&typeof E.ethereum.request=="function")j=E.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof k!="object"||!(b!=null&&b.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");j=k}const T=new URL((i=b==null?void 0:b.url)!==null&&i!==void 0?i:window.location.href),P=await j.request({method:"eth_requestAccounts"}).then(E=>E).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!P||P.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const I=Sw(P[0]);let R=(n=b==null?void 0:b.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!R){const E=await j.request({method:"eth_chainId"});R=jC(E)}const O={domain:T.host,address:I,statement:w,uri:T.href,version:"1",chainId:R,nonce:(o=b==null?void 0:b.signInWithEthereum)===null||o===void 0?void 0:o.nonce,issuedAt:(l=(a=b==null?void 0:b.signInWithEthereum)===null||a===void 0?void 0:a.issuedAt)!==null&&l!==void 0?l:new Date,expirationTime:(d=b==null?void 0:b.signInWithEthereum)===null||d===void 0?void 0:d.expirationTime,notBefore:(p=b==null?void 0:b.signInWithEthereum)===null||p===void 0?void 0:p.notBefore,requestId:(u=b==null?void 0:b.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(g=b==null?void 0:b.signInWithEthereum)===null||g===void 0?void 0:g.resources};y=_C(O),_=await j.request({method:"personal_sign",params:[wC(y),I]})}try{const{data:S,error:k}=await wt(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:y,signature:_}
108,!((h=r.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(x=r.options)===null||x===void 0?void 0:x.captchaToken}}:null),xform:go});if(k)throw k;if(!S||!S.session||!S.user){const w=new wa;return this._returnResult({data:{user:null,session:null},error:w})}return S.session&&(await this._saveSession(S.session),await this._notifyAllSubscribers("SIGNED_IN",S.session)),this._returnResult({data:Object.assign({},S),error:k})}catch(S){if(xt(S))return this._returnResult({data:{user:null,session:null},error:S});throw S}}async signInWithSolana(r){var i,n,o,a,l,d,p,u,g,h,x,y;let _,S;if("message"in r)_=r.message,S=r.signature;else{const{chain:k,wallet:w,statement:b,options:j}=r;let T;if(Di())if(typeof w=="object")T=w;else{const I=window;if("solana"in I&&typeof I.solana=="object"&&("signIn"in I.solana&&typeof I.solana.signIn=="function"||"signMessage"in I.solana&&typeof I.solana.signMessage=="function"))T=I.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof w!="object"||!(j!=null&&j.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");T=w}const P=new URL((i=j==null?void 0:j.url)!==null&&i!==void 0?i:window.location.href);if("signIn"in T&&T.signIn){const I=await T.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},j==null?void 0:j.signInWithSolana),{version:"1",domain:P.host,uri:P.href}),b?{statement:b}:null));let R;if(Array.isArray(I)&&I[0]&&typeof I[0]=="object")R=I[0];else if(I&&typeof I=="object"&&"signedMessage"in I&&"signature"in I)R=I;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in R&&"signature"in R&&(typeof R.signedMessage=="string"||R.signedMessage instanceof Uint8Array)&&R.signature instanceof Uint8Array)_=typeof R.signedMessage=="string"?R.signedMessage:new TextDecoder().decode(R.signedMessage),S=R.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in T)||typeof T.signMessage!="function"||!("publicKey"in T)||typeof T!="object"||!T.publicKey||!("toBase58"in T.publicKey)||typeof T.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");_=[`${P.host} wants you to sign in with your Solana account:`,T.publicKey.toBase58(),...b?["",b,""]:[""],"Version: 1",`URI: ${P.href}`,`Issued At: ${(o=(n=j==null?void 0:j.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&o!==void 0?o:new Date().toISOString()}`,...!((a=j==null?void 0:j.signInWithSolana)===null||a===void 0)&&a.notBefore?[`Not Before: ${j.signInWithSolana.notBefore}`]:[],...!((l=j==null?void 0:j.signInWithSolana)===null||l===void 0)&&l.expirationTime?[`Expiration Time: ${j.signInWithSolana.expirationTime}`]:[],...!((d=j==null?void 0:j.signInWithSolana)===null||d===void 0)&&d.chainId?[`Chain ID: ${j.signInWithSolana.chainId}`]:[],...!((p=j==null?void 0:j.signInWithSolana)===null||p===void 0)&&p.nonce?[`Nonce: ${j.signInWithSolana.nonce}`]:[],...!((u=j==null?void 0:j.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${j.signInWithSolana.requestId}`]:[],...!((h=(g=j==null?void 0:j.signInWithSolana)===null||g===void 0?void 0:g.resources)===null||h===void 0)&&h.length?["Resources",...j.signInWithSolana.resources.map(R=>`- ${R}`)]:[]].join(` 109`);const I=await T.signMessage(new TextEncoder().encode(_),"utf8");if(!I||!(I instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");S=I}}try{const{data:k,error:w}=await wt(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:_,signature:Pa(S)},!((x=r.options)===null||x===void 0)&&x.captchaToken?{gotrue_meta_security:{captcha_token:(y=r.options)===null||y===void 0?void 0:y.captchaToken}}:null),xform:go});if(w)throw w;if(!k||!k.session||!k.user){const b=new wa;return this._returnResult({data:{user:null,session:null},error:b})}return k.session&&(await this._saveSession(k.session),await this._notifyAllSubscribers("SIGNED_IN",k.session)),this._returnResult({data:Object.assign({},k),error:w})}catch(k){if(xt(k))return this._returnResult({data:{user:null,session:null},error:k});throw k}}async _exchangeCodeForSession(r){const i=await ma(this.storage,`${this.storageKey}-code-verifier`),[n,o]=(i??"").split("/");try{if(!n&&this.flowType==="pkce")throw new xw;const{data:a,error:l}=await wt(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:r,code_verifier:n},xform:go});if(await Mi(this.storage,`${this.storageKey}-code-verifier`),l)throw l;if(!a||!a.session||!a.user){const d=new wa;return this._returnResult({data:{user:null,session:null,redirectType:null},error:d})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:Object.assign(Object.assign({},a),{redirectType:o??null}),error:l})}catch(a){if(await Mi(this.storage,`${this.storageKey}-code-verifier`),xt(a))return this._returnResult({data:{user:null,session:null,redirectType:null},error:a});throw a}}async signInWithIdToken(r){try{const{options:i,provider:n,token:o,access_token:a,nonce:l}=r,d=await wt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:o,access_token:a,nonce:l,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},xform:go}),{data:p,error:u}=d;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!p||!p.session||!p.user){const g=new wa;return this._returnResult({data:{user:null,session:null},error:g})}return p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("SIGNED_IN",p.session)),this._returnResult({data:p,error:u})}catch(i){if(xt(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithOtp(r){var i,n,o,a,l;try{if("email"in r){const{email:d,options:p}=r;let u=null,g=null;this.flowType==="pkce"&&([u,g]=await vl(this.storage,this.storageKey));const{error:h}=await wt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:d,data:(i=p==null?void 0:p.data)!==null&&i!==void 0?i:{},create_user:(n=p==null?void 0:p.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken},code_challenge:u,code_challenge_method:g},redirectTo:p==null?void 0:p.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in r){const{phone:d,options:p}=r,{data:u,error:g}=await wt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:d,data:(o=p==null?void 0:p.data)!==null&&o!==void 0?o:{},create_user:(a=p==null?void 0:p.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken},channel:(l=p==null?void 0:p.channel)!==null&&l!==void 0?l:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:g})}throw new nc("You must provide either an email or phone number.")}catch(d){if(await Mi(this.storage,`${this.storageKey}-code-verifier`),xt(d))return this._returnResult({data:{user:null,session:null},error:d});throw d}}async verifyOtp(r){var i,n;try{let o,a;"options"in r&&(o=(i=r.options)===null||i===void 0?void 0:i.redirectTo,a=(n=r.options)===null||n===void 0?void 0:n.captchaToken);const{data:l,error:d}=await wt(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},r),{gotrue_meta_security:{captcha_token:a}}),redirectTo:o,xform:go});if(d)throw d;if(!l)throw new Error("An error occurred on token verification.");const p=l.session,u=l.user;return p!=null&&p.access_token&&(await this._saveSession(p),await this._notifyAllSubscribers(r.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",p)),this._returnResult({data:{user:u,session:p},error:null})}catch(o){if(xt(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithSSO(r){var i,n,o,a,l;try{let d=null,p=null;this.flowType==="pkce"&&([d,p]=await vl(this.storage,this.storageKey));const u=await wt(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in r?{provider_id:r.providerId}:null),"domain"in r?{domain:r.domain}:null),{redirect_to:(n=(i=r.options)===null||i===void 0?void 0:i.redirectTo)!==null&&n!==void 0?n:void 0}),!((o=r==null?void 0:r.options)===null||o===void 0)&&o.captchaToken?{gotrue_meta_security:{captcha_token:r.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:d,code_challenge_method:p}),headers:this.headers,xform:mC});return!((a=u.data)===null||a===void 0)&&a.url&&Di()&&!(!((l=r.options)===null||l===void 0)&&l.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(d){if(await Mi(this.storage,`${this.storageKey}-code-verifier`),xt(d))return this._returnResult({data:null,error:d});throw d}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async r=>{const{data:{session:i},error:n}=r;if(n)throw n;if(!i)throw new cn;const{error:o}=await wt(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:i.access_token});return this._returnResult({data:{user:null,session:null},error:o})})}catch(r){if(xt(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async resend(r){try{const i=`${this.url}/resend`;if("email"in r){const{email:n,type:o,options:a}=r,{error:l}=await wt(this.fetch,"POST",i,{headers:this.headers,body:{email:n,type:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},redirectTo:a==null?void 0:a.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:l})}else if("phone"in r){const{phone:n,type:o,options:a}=r,{data:l,error:d}=await wt(this.fetch,"POST",i,{headers:this.headers,body:{phone:n,type:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:l==null?void 0:l.message_id},error:d})}throw new nc("You must provide either an email or phone number and a type")}catch(i){if(xt(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async i=>i))}async _acquireLock(r,i){this._debug("#_acquireLock","begin",r);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),o=(async()=>(await n,await i()))();return this.pendingInLock.push((async()=>{try{await o}catch{}})()),o}return await this.lock(`lock:${this.storageKey}`,r,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=i();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const o=[...this.pendingInLock];await Promise.all(o),this.pendingInLock.splice(0,o.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(r){this._debug("#_useSession","begin");try{const i=await this.__loadSession();return await r(i)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let r=null;const i=await ma(this.storage,this.storageKey);
109if(this._debug("#getSession()","session from storage",i),i!==null&&(this._isValidSession(i)?r=i:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!r)return{data:{session:null},error:null};const n=r.expires_at?r.expires_at*1e3-Date.now()<ig:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",r.expires_at),!n){if(this.userStorage){const l=await ma(this.userStorage,this.storageKey+"-user");l!=null&&l.user?r.user=l.user:r.user=ng()}if(this.storage.isServer&&r.user&&!r.user.__isUserNotAvailableProxy){const l={value:this.suppressGetSessionWarning};r.user=hC(r.user,l),l.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:r},error:null}}const{data:o,error:a}=await this._callRefreshToken(r.refresh_token);return a?this._returnResult({data:{session:null},error:a}):this._returnResult({data:{session:o},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(r){if(r)return await this._getUser(r);await this.initializePromise;const i=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return i.data.user&&(this.suppressGetSessionWarning=!0),i}async _getUser(r){try{return r?await wt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:r,xform:Ls}):await this._useSession(async i=>{var n,o,a;const{data:l,error:d}=i;if(d)throw d;return!(!((n=l.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new cn}:await wt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(a=(o=l.session)===null||o===void 0?void 0:o.access_token)!==null&&a!==void 0?a:void 0,xform:Ls})})}catch(i){if(xt(i))return Cu(i)&&(await this._removeSession(),await Mi(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:i});throw i}}async updateUser(r,i={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(r,i))}async _updateUser(r,i={}){try{return await this._useSession(async n=>{const{data:o,error:a}=n;if(a)throw a;if(!o.session)throw new cn;const l=o.session;let d=null,p=null;this.flowType==="pkce"&&r.email!=null&&([d,p]=await vl(this.storage,this.storageKey));const{data:u,error:g}=await wt(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:i==null?void 0:i.emailRedirectTo,body:Object.assign(Object.assign({},r),{code_challenge:d,code_challenge_method:p}),jwt:l.access_token,xform:Ls});if(g)throw g;return l.user=u.user,await this._saveSession(l),await this._notifyAllSubscribers("USER_UPDATED",l),this._returnResult({data:{user:l.user},error:null})})}catch(n){if(await Mi(this.storage,`${this.storageKey}-code-verifier`),xt(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(r){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(r))}async _setSession(r){try{if(!r.access_token||!r.refresh_token)throw new cn;const i=Date.now()/1e3;let n=i,o=!0,a=null;const{payload:l}=su(r.access_token);if(l.exp&&(n=l.exp,o=n<=i),o){const{data:d,error:p}=await this._callRefreshToken(r.refresh_token);if(p)return this._returnResult({data:{user:null,session:null},error:p});if(!d)return{data:{user:null,session:null},error:null};a=d}else{const{data:d,error:p}=await this._getUser(r.access_token);if(p)return this._returnResult({data:{user:null,session:null},error:p});a={access_token:r.access_token,refresh_token:r.refresh_token,user:d.user,token_type:"bearer",expires_in:n-i,expires_at:n},await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)}return this._returnResult({data:{user:a.user,session:a},error:null})}catch(i){if(xt(i))return this._returnResult({data:{session:null,user:null},error:i});throw i}}async refreshSession(r){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(r))}async _refreshSession(r){try{return await this._useSession(async i=>{var n;if(!r){const{data:l,error:d}=i;if(d)throw d;r=(n=l.session)!==null&&n!==void 0?n:void 0}if(!(r!=null&&r.refresh_token))throw new cn;const{data:o,error:a}=await this._callRefreshToken(r.refresh_token);return a?this._returnResult({data:{user:null,session:null},error:a}):o?this._returnResult({data:{user:o.user,session:o},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(i){if(xt(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async _getSessionFromURL(r,i){try{if(!Di())throw new oc("No browser detected.");
109if(r.error||r.error_description||r.error_code)throw new oc(r.error_description||"Error in URL with unspecified error_description",{error:r.error||"unspecified_error",code:r.error_code||"unspecified_code"});switch(i){case"implicit":if(this.flowType==="pkce")throw new Bf("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new oc("Not a valid implicit grant flow url.");break;default:}if(i==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!r.code)throw new Bf("No code detected.");const{data:b,error:j}=await this._exchangeCodeForSession(r.code);if(j)throw j;const T=new URL(window.location.href);return T.searchParams.delete("code"),window.history.replaceState(window.history.state,"",T.toString()),{data:{session:b.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:o,access_token:a,refresh_token:l,expires_in:d,expires_at:p,token_type:u}=r;if(!a||!d||!l||!u)throw new oc("No session defined in URL");const g=Math.round(Date.now()/1e3),h=parseInt(d);let x=g+h;p&&(x=parseInt(p));const y=x-g;y*1e3<=zl&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${y}s, should have been closer to ${h}s`);const _=x-h;g-_>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",_,x,g):g-_<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",_,x,g);const{data:S,error:k}=await this._getUser(a);if(k)throw k;const w={provider_token:n,provider_refresh_token:o,access_token:a,expires_in:h,expires_at:x,refresh_token:l,token_type:u,user:S.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:w,redirectType:r.type},error:null})}catch(n){if(xt(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(r){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),r):!!(r.access_token||r.error_description)}async _isPKCECallback(r){const i=await ma(this.storage,`${this.storageKey}-code-verifier`);return!!(r.code&&i)}async signOut(r={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(r))}async _signOut({scope:r}={scope:"global"}){return await this._useSession(async i=>{var n;const{data:o,error:a}=i;if(a&&!Cu(a))return this._returnResult({error:a});const l=(n=o.session)===null||n===void 0?void 0:n.access_token;if(l){const{error:d}=await this.admin.signOut(l,r);if(d&&!(gw(d)&&(d.status===404||d.status===401||d.status===403)||Cu(d)))return this._returnResult({error:d})}return r!=="others"&&(await this._removeSession(),await Mi(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(r){const i=Q3(),n={id:i,callback:r,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",i),this.stateChangeEmitters.delete(i)}};return this._debug("#onAuthStateChange()","registered callback with id",i),this.stateChangeEmitters.set(i,n),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(i)})))(),{data:{subscription:n}}}async _emitInitialSession(r){return await this._useSession(async i=>{var n,o;try{const{data:{session:a},error:l}=i;if(l)throw l;await((n=this.stateChangeEmitters.get(r))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",a)),this._debug("INITIAL_SESSION","callback id",r,"session",a)}catch(a){await((o=this.stateChangeEmitters.get(r))===null||o===void 0?void 0:o.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",r,"error",a),console.error(a)}})}async resetPasswordForEmail(r,i={}){let n=null,o=null;this.flowType==="pkce"&&([n,o]=await vl(this.storage,this.storageKey,!0));try{return await wt(this.fetch,"POST",`${this.url}/recover`,{body:{email:r,code_challenge:n,code_challenge_method:o,gotrue_meta_security:{captcha_token:i.captchaToken}},headers:this.headers,redirectTo:i.redirectTo})}catch(a){if(await Mi(this.storage,`${this.storageKey}-code-verifier`),xt(a))return this._returnResult({data:null,error:a});throw a}}async getUserIdentities(){var r;try{const{data:i,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(r=i.user.identities)!==null&&r!==void 0?r:[]},error:null})}catch(i){if(xt(i))return this._returnResult({data:null,error:i});throw i}}async linkIdentity(r){return"token"in r?this.linkIdentityIdToken(r):this.linkIdentityOAuth(r)}async linkIdentityOAuth(r){var i;try{const{data:n,error:o}=await this._useSession(async a=>{var l,d,p,u,g;const{data:h,error:x}=a;if(x)throw x;const y=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,r.provider,{redirectTo:(l=r.options)===null||l===void 0?void 0:l.redirectTo,scopes:(d=r.options)===null||d===void 0?void 0:d.scopes,queryParams:(p=r.options)===null||p===void 0?void 0:p.queryParams,skipBrowserRedirect:!0});return await wt(this.fetch,"GET",y,{headers:this.headers,jwt:(g=(u=h.session)===null||u===void 0?void 0:u.access_token)!==null&&g!==void 0?g:void 0})});if(o)throw o;return Di()&&!(!((i=r.options)===null||i===void 0)&&i.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:r.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(xt(n))return this._returnResult({data:{provider:r.provider,url:null},error:n});throw n}}async linkIdentityIdToken(r){return await this._useSession(async i=>{var n;try{const{error:o,data:{session:a}}=i;if(o)throw o;const{options:l,provider:d,token:p,access_token:u,nonce:g}=r,h=await wt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=a==null?void 0:a.access_token)!==null&&n!==void 0?n:void 0,body:{provider:d,id_token:p,access_token:u,nonce:g,link_identity:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:go}),{data:x,error:y}=h;return y?this._returnResult({data:{user:null,session:null},error:y}):!x||!x.session||!x.user?this._returnResult({data:{user:null,session:null},error:new wa}):(x.session&&(await this._saveSession(x.session),await this._notifyAllSubscribers("USER_UPDATED",x.session)),this._returnResult({data:x,error:y}))}catch(o){if(await Mi(this.storage,`${this.storageKey}-code-verifier`),xt(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}})}async unlinkIdentity(r){try{return await this._useSession(async i=>{var n,o;const{data:a,error:l}=i;if(l)throw l;
109return await wt(this.fetch,"DELETE",`${this.url}/user/identities/${r.identity_id}`,{headers:this.headers,jwt:(o=(n=a.session)===null||n===void 0?void 0:n.access_token)!==null&&o!==void 0?o:void 0})})}catch(i){if(xt(i))return this._returnResult({data:null,error:i});throw i}}async _refreshAccessToken(r){const i=`#_refreshAccessToken(${r.substring(0,5)}...)`;this._debug(i,"begin");try{const n=Date.now();return await iC(async o=>(o>0&&await rC(200*Math.pow(2,o-1)),this._debug(i,"refreshing attempt",o),await wt(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:r},headers:this.headers,xform:go})),(o,a)=>{const l=200*Math.pow(2,o);return a&&zu(a)&&Date.now()+l-n<zl})}catch(n){if(this._debug(i,"error",n),xt(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(i,"end")}}_isValidSession(r){return typeof r=="object"&&r!==null&&"access_token"in r&&"refresh_token"in r&&"expires_at"in r}async _handleProviderSignIn(r,i){const n=await this._getUrlForProvider(`${this.url}/authorize`,r,{redirectTo:i.redirectTo,scopes:i.scopes,queryParams:i.queryParams});return this._debug("#_handleProviderSignIn()","provider",r,"options",i,"url",n),Di()&&!i.skipBrowserRedirect&&window.location.assign(n),{data:{provider:r,url:n},error:null}}async _recoverAndRefresh(){var r,i;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const o=await ma(this.storage,this.storageKey);if(o&&this.userStorage){let l=await ma(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!l&&(l={user:o.user},await El(this.userStorage,this.storageKey+"-user",l)),o.user=(r=l==null?void 0:l.user)!==null&&r!==void 0?r:ng()}else if(o&&!o.user&&!o.user){const l=await ma(this.storage,this.storageKey+"-user");l&&(l!=null&&l.user)?(o.user=l.user,await Mi(this.storage,this.storageKey+"-user"),await El(this.storage,this.storageKey,o)):o.user=ng()}if(this._debug(n,"session from storage",o),!this._isValidSession(o)){this._debug(n,"session is not valid"),o!==null&&await this._removeSession();return}const a=((i=o.expires_at)!==null&&i!==void 0?i:1/0)*1e3-Date.now()<ig;if(this._debug(n,`session has${a?"":" not"} expired with margin of ${ig}s`),a){if(this.autoRefreshToken&&o.refresh_token){const{error:l}=await this._callRefreshToken(o.refresh_token);l&&(console.error(l),zu(l)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",l),await this._removeSession()))}}else if(o.user&&o.user.__isUserNotAvailableProxy===!0)try{const{data:l,error:d}=await this._getUser(o.access_token);!d&&(l!=null&&l.user)?(o.user=l.user,await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(l){console.error("Error getting user data:",l),this._debug(n,"error getting user data, skipping SIGNED_IN notification",l)}else await this._notifyAllSubscribers("SIGNED_IN",o)}catch(o){this._debug(n,"error",o),console.error(o);return}finally{this._debug(n,"end")}}async _callRefreshToken(r){var i,n;if(!r)throw new cn;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const o=`#_callRefreshToken(${r.substring(0,5)}...)`;this._debug(o,"begin");try{this.refreshingDeferred=new Kh;const{data:a,error:l}=await this._refreshAccessToken(r);if(l)throw l;if(!a.session)throw new cn;await this._saveSession(a.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",a.session);const d={data:a.session,error:null};return this.refreshingDeferred.resolve(d),d}catch(a){if(this._debug(o,"error",a),xt(a)){const l={data:null,error:a};return zu(a)||await this._removeSession(),(i=this.refreshingDeferred)===null||i===void 0||i.resolve(l),l}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(a),a}finally{this.refreshingDeferred=null,this._debug(o,"end")}}async _notifyAllSubscribers(r,i,n=!0){const o=`#_notifyAllSubscribers(${r})`;this._debug(o,"begin",i,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:r,session:i});const a=[],l=Array.from(this.stateChangeEmitters.values()).map(async d=>{try{await d.callback(r,i)}catch(p){a.push(p)}});if(await Promise.all(l),a.length>0){for(let d=0;d<a.length;d+=1)console.error(a[d]);throw a[0]}}finally{this._debug(o,"end")}}async _saveSession(r){this._debug("#_saveSession()",r),this.suppressGetSessionWarning=!0,await Mi(this.storage,`${this.storageKey}-code-verifier`);const i=Object.assign({},r),n=i.user&&i.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&i.user&&await El(this.userStorage,this.storageKey+"-user",{user:i.user});const o=Object.assign({},i);delete o.user;const a=u2(o);await El(this.storage,this.storageKey,a)}else{const o=u2(i);await El(this.storage,this.storageKey,o)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Mi(this.storage,this.storageKey),await Mi(this.storage,this.storageKey+"-code-verifier"),await Mi(this.storage,this.storageKey+"-user"),this.userStorage&&await Mi(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const r=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{r&&Di()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",r)}
109catch(i){console.error("removing visibilitychange callback failed",i)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const r=setInterval(()=>this._autoRefreshTokenTick(),zl);this.autoRefreshTicker=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r);const i=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=i,i&&typeof i=="object"&&typeof i.unref=="function"?i.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(i)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const r=this.autoRefreshTicker;this.autoRefreshTicker=null,r&&clearInterval(r);const i=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,i&&clearTimeout(i)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const r=Date.now();try{return await this._useSession(async i=>{const{data:{session:n}}=i;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const o=Math.floor((n.expires_at*1e3-r)/zl);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${zl}ms, refresh threshold is ${Mf} ticks`),o<=Mf&&await this._callRefreshToken(n.refresh_token)})}catch(i){console.error("Auto refresh tick failed with error. This is likely a transient error.",i)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(r){if(r.isAcquireTimeout||r instanceof jw)this._debug("auto refresh token tick lock not available");else throw r}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Di()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(r){this._debug("#visibilityChangedCallback","error",r)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(r){console.error("_handleVisibilityChange",r)}}async _onVisibilityChanged(r){const i=`#_onVisibilityChanged(${r})`;this._debug(i,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),r||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(i,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(r,i,n){const o=[`provider=${encodeURIComponent(i)}`];if(n!=null&&n.redirectTo&&o.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&o.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[a,l]=await vl(this.storage,this.storageKey),d=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(l)}`});o.push(d.toString())}if(n!=null&&n.queryParams){const a=new URLSearchParams(n.queryParams);o.push(a.toString())}return n!=null&&n.skipBrowserRedirect&&o.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${r}?${o.join("&")}`}async _unenroll(r){try{return await this._useSession(async i=>{var n;const{data:o,error:a}=i;return a?this._returnResult({data:null,error:a}):await wt(this.fetch,"DELETE",`${this.url}/factors/${r.factorId}`,{headers:this.headers,jwt:(n=o==null?void 0:o.session)===null||n===void 0?void 0:n.access_token})})}catch(i){if(xt(i))return this._returnResult({data:null,error:i});throw i}}async _enroll(r){try{return await this._useSession(async i=>{var n,o;const{data:a,error:l}=i;if(l)return this._returnResult({data:null,error:l});const d=Object.assign({friendly_name:r.friendlyName,factor_type:r.factorType},r.factorType==="phone"?{phone:r.phone}:r.factorType==="totp"?{issuer:r.issuer}:{}),{data:p,error:u}=await wt(this.fetch,"POST",`${this.url}/factors`,{body:d,headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(r.factorType==="totp"&&p.type==="totp"&&(!((o=p==null?void 0:p.totp)===null||o===void 0)&&o.qr_code)&&(p.totp.qr_code=`data:image/svg+xml;utf-8,${p.totp.qr_code}`),this._returnResult({data:p,error:null}))})}catch(i){if(xt(i))return this._returnResult({data:null,error:i});throw i}}async _verify(r){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async i=>{var n;const{data:o,error:a}=i;if(a)return this._returnResult({data:null,error:a});const l=Object.assign({challenge_id:r.challengeId},"webauthn"in r?{webauthn:Object.assign(Object.assign({},r.webauthn),{credential_response:r.webauthn.type==="create"?IC(r.webauthn.credential_response):TC(r.webauthn.credential_response)})}:{code:r.code}),{data:d,error:p}=await wt(this.fetch,"POST",`${this.url}/factors/${r.factorId}/verify`,{body:l,headers:this.headers,jwt:(n=o==null?void 0:o.session)===null||n===void 0?void 0:n.access_token});return p?this._returnResult({data:null,error:p}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+d.expires_in},d)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",d),this._returnResult({data:d,error:p}))})}catch(i){if(xt(i))return this._returnResult({data:null,error:i});throw i}})}async _challenge(r){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async i=>{var n;const{data:o,error:a}=i;if(a)return this._returnResult({data:null,error:a});const l=await wt(this.fetch,"POST",`${this.url}/factors/${r.factorId}/challenge`,{body:r,headers:this.headers,jwt:(n=o==null?void 0:o.session)===null||n===void 0?void 0:n.access_token});if(l.error)return l;const{data:d}=l;if(d.type!=="webauthn")return{data:d,error:null};switch(d.webauthn.type){case"create":return{data:Object.assign(Object.assign({},d),{webauthn:Object.assign(Object.assign({},d.webauthn),{credential_options:Object.assign(Object.assign({},d.webauthn.credential_options),{publicKey:EC(d.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},d),{webauthn:Object.assign(Object.assign({},d.webauthn),{credential_options:Object.assign(Object.assign({},d.webauthn.credential_options),{publicKey:RC(d.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(i){if(xt(i))return this._returnResult({data:null,error:i});throw i}})}async _challengeAndVerify(r){const{data:i,error:n}=await this._challenge({factorId:r.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:r.factorId,challengeId:i.id,code:r.code})}async _listFactors(){var r;const{data:{user:i},error:n}=await this.getUser();if(n)return{data:null,error:n};const o={all:[],phone:[],totp:[],webauthn:[]};for(const a of(r=i==null?void 0:i.factors)!==null&&r!==void 0?r:[])o.all.push(a),a.status==="verified"&&o[a.factor_type].push(a);return{data:o,error:null}}async _getAuthenticatorAssuranceLevel(r){var i,n,o,a;if(r)try{const{payload:y}=su(r);let _=null;y.aal&&(_=y.aal);let S=_;const{data:{user:k},error:w}=await this.getUser(r);if(w)return this._returnResult({data:null,error:w});((n=(i=k==null?void 0:k.factors)===null||i===void 0?void 0:i.filter(T=>T.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(S="aal2");const j=y.amr||[];return{data:{currentLevel:_,nextLevel:S,currentAuthenticationMethods:j},error:null}}catch(y){if(xt(y))return this._returnResult({data:null,error:y});throw y}const{data:{session:l},error:d}
109=await this.getSession();if(d)return this._returnResult({data:null,error:d});if(!l)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:p}=su(l.access_token);let u=null;p.aal&&(u=p.aal);let g=u;((a=(o=l.user.factors)===null||o===void 0?void 0:o.filter(y=>y.status==="verified"))!==null&&a!==void 0?a:[]).length>0&&(g="aal2");const x=p.amr||[];return{data:{currentLevel:u,nextLevel:g,currentAuthenticationMethods:x},error:null}}async _getAuthorizationDetails(r){try{return await this._useSession(async i=>{const{data:{session:n},error:o}=i;return o?this._returnResult({data:null,error:o}):n?await wt(this.fetch,"GET",`${this.url}/oauth/authorizations/${r}`,{headers:this.headers,jwt:n.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new cn})})}catch(i){if(xt(i))return this._returnResult({data:null,error:i});throw i}}async _approveAuthorization(r,i){try{return await this._useSession(async n=>{const{data:{session:o},error:a}=n;if(a)return this._returnResult({data:null,error:a});if(!o)return this._returnResult({data:null,error:new cn});const l=await wt(this.fetch,"POST",`${this.url}/oauth/authorizations/${r}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"approve"},xform:d=>({data:d,error:null})});return l.data&&l.data.redirect_url&&Di()&&!(i!=null&&i.skipBrowserRedirect)&&window.location.assign(l.data.redirect_url),l})}catch(n){if(xt(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(r,i){try{return await this._useSession(async n=>{const{data:{session:o},error:a}=n;if(a)return this._returnResult({data:null,error:a});if(!o)return this._returnResult({data:null,error:new cn});const l=await wt(this.fetch,"POST",`${this.url}/oauth/authorizations/${r}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"deny"},xform:d=>({data:d,error:null})});return l.data&&l.data.redirect_url&&Di()&&!(i!=null&&i.skipBrowserRedirect)&&window.location.assign(l.data.redirect_url),l})}catch(n){if(xt(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async r=>{const{data:{session:i},error:n}=r;return n?this._returnResult({data:null,error:n}):i?await wt(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:i.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new cn})})}catch(r){if(xt(r))return this._returnResult({data:null,error:r});throw r}}async _revokeOAuthGrant(r){try{return await this._useSession(async i=>{const{data:{session:n},error:o}=i;return o?this._returnResult({data:null,error:o}):n?(await wt(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:r.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new cn})})}catch(i){if(xt(i))return this._returnResult({data:null,error:i});throw i}}async fetchJwk(r,i={keys:[]}){let n=i.keys.find(d=>d.kid===r);if(n)return n;const o=Date.now();if(n=this.jwks.keys.find(d=>d.kid===r),n&&this.jwks_cached_at+H3>o)return n;const{data:a,error:l}=await wt(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(l)throw l;return!a.keys||a.keys.length===0||(this.jwks=a,this.jwks_cached_at=o,n=a.keys.find(d=>d.kid===r),!n)?null:n}async getClaims(r,i={}){try{let n=r;if(!n){const{data:y,error:_}
109=await this.getSession();if(_||!y.session)return this._returnResult({data:null,error:_});n=y.session.access_token}const{header:o,payload:a,signature:l,raw:{header:d,payload:p}}=su(n);i!=null&&i.allowExpired||cC(a.exp);const u=!o.alg||o.alg.startsWith("HS")||!o.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(o.kid,i!=null&&i.keys?{keys:i.keys}:i==null?void 0:i.jwks);if(!u){const{error:y}=await this.getUser(n);if(y)throw y;return{data:{claims:a,header:o,signature:l},error:null}}const g=pC(o.alg),h=await crypto.subtle.importKey("jwk",u,g,!0,["verify"]);if(!await crypto.subtle.verify(g,h,l,X3(`${d}.${p}`)))throw new sh("Invalid JWT signature");return{data:{claims:a,header:o,signature:l},error:null}}catch(n){if(xt(n))return this._returnResult({data:null,error:n});throw n}}}xd.nextInstanceID={};const Cw=xd,$C="2.93.3";let sc="";typeof Deno<"u"?sc="deno":typeof document<"u"?sc="web":typeof navigator<"u"&&navigator.product==="ReactNative"?sc="react-native":sc="node";const WC={"X-Client-Info":`supabase-js-${sc}/${$C}`},NC={headers:WC},UC={schema:"public"},VC={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},qC={};function Yc(e){"@babel/helpers - typeof";return Yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Yc(e)}function HC(e,r){if(Yc(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var n=i.call(e,r);if(Yc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function GC(e){var r=HC(e,"string");return Yc(r)=="symbol"?r:r+""}function JC(e,r,i){return(r=GC(r))in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e}function b2(e,r){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),i.push.apply(i,n)}return i}function ti(e){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};r%2?b2(Object(i),!0).forEach(function(n){JC(e,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):b2(Object(i)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))})}return e}const ZC=e=>e?(...r)=>e(...r):(...r)=>fetch(...r),YC=()=>Headers,XC=(e,r,i)=>{const n=ZC(i),o=YC();return async(a,l)=>{var d;const p=(d=await r())!==null&&d!==void 0?d:e;let u=new o(l==null?void 0:l.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${p}`),n(a,ti(ti({},l),{},{headers:u}))}};function KC(e){return e.endsWith("/")?e:e+"/"}function QC(e,r){var i,n;const{db:o,auth:a,realtime:l,global:d}=e,{db:p,auth:u,realtime:g,global:h}=r,x={db:ti(ti({},p),o),auth:ti(ti({},u),a),realtime:ti(ti({},g),l),storage:{},global:ti(ti(ti({},h),d),{},{headers:ti(ti({},(i=h==null?void 0:h.headers)!==null&&i!==void 0?i:{}),(n=d==null?void 0:d.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return e.accessToken?x.accessToken=e.accessToken:delete x.accessToken,x}function ez(e){const r=e==null?void 0:e.trim();if(!r)throw new Error("supabaseUrl is required.");if(!r.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(KC(r))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var tz=class extends Cw{constructor(e){super(e)}},zw=class{constructor(e,r,i){var n,o;this.supabaseUrl=e,this.supabaseKey=r;const a=ez(e);if(!r)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);const l=`sb-${a.hostname.split(".")[0]}-auth-token`,d={db:UC,realtime:qC,auth:ti(ti({},VC),{},{storageKey:l}),global:NC},p=QC(i??{},d);if(this.storageKey=(n=p.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(o=p.global.headers)!==null&&o!==void 0?o:{},p.accessToken)this.accessToken=p.accessToken,this.auth=new Proxy({},{get:(g,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=p.auth)!==null&&u!==void 0?u:{},this.headers,p.global.fetch)}this.fetch=XC(r,this._getAccessToken.bind(this),p.global.fetch),this.realtime=this._initRealtimeClient(ti({headers:this.headers,accessToken:this._getAccessToken.bind(this)},p.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(g=>this.realtime.setAuth(g)).catch(g=>console.warn("Failed to set initial Realtime auth token:",g)),this.rest=new Y6(new URL("rest/v1",a).href,{headers:this.headers,schema:p.db.schema,fetch:this.fetch}),this.storage=new W3(this.storageUrl.href,this.headers,this.fetch,i==null?void 0:i.storage),p.accessToken||this._listenForAuthEvents()}get functions(){return new H6(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,r={},i={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,r,i)}channel(e,r={config:{}}){return this.realtime.channel(e,r)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,r,i;if(e.accessToken)return await e.accessToken();const{data:n}=await e.auth.getSession();return(r=(i=n.session)===null||i===void 0?void 0:i.access_token)!==null&&r!==void 0?r:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:i,storage:n,userStorage:o,storageKey:a,flowType:l,lock:d,debug:p,throwOnError:u},g,h){const x={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new tz({url:this.authUrl.href,headers:ti(ti({},x),g),storageKey:a,autoRefreshToken:e,persistSession:r,detectSessionInUrl:i,storage:n,userStorage:o,flowType:l,lock:d,debug:p,throwOnError:u,fetch:h,hasCustomAuthorizationHeader:Object.keys(this.headers).some(y=>y.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new aw(this.realtimeUrl.href,ti(ti({},e),{},{params:ti(ti({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,r)=>{this._handleTokenChanged(e,"CLIENT",r==null?void 0:r.access_token)})}_handleTokenChanged(e,r,i){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==i?(this.changedAccessToken=i,this.realtime.setAuth(i)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const $a=(e,r,i)=>
109new zw(e,r,i);function rz(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const r=e.version;if(r==null)return!1;const i=r.match(/^v(\d+)\./);return i?parseInt(i[1],10)<=18:!1}rz()&&console.warn("â ï¸ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const Fa=Object.freeze(Object.defineProperty({__proto__:null,AuthApiError:hw,AuthClient:Cw,AuthError:fd,AuthImplicitGrantRedirectError:oc,AuthInvalidCredentialsError:nc,AuthInvalidJwtError:sh,AuthInvalidTokenResponseError:wa,AuthPKCECodeVerifierMissingError:xw,AuthPKCEGrantCodeExchangeError:Bf,AuthRetryableFetchError:oh,AuthSessionMissingError:cn,AuthUnknownError:Os,AuthWeakPasswordError:Of,CustomAuthError:Go,get FunctionRegion(){return nh},FunctionsError:Zh,FunctionsFetchError:Qj,FunctionsHttpError:zf,FunctionsRelayError:Cf,GoTrueAdminApi:vw,GoTrueClient:xd,NavigatorLockAcquireTimeoutError:ww,PostgrestError:ew,get REALTIME_LISTEN_TYPES(){return td},get REALTIME_POSTGRES_CHANGES_LISTEN_EVENT(){return Af},get REALTIME_PRESENCE_LISTEN_EVENTS(){return Tf},get REALTIME_SUBSCRIBE_STATES(){return Po},RealtimeChannel:Aa,RealtimeClient:aw,RealtimePresence:ed,SIGN_OUT_SCOPES:Eu,SupabaseClient:zw,WebSocketFactory:rw,createClient:$a,isAuthApiError:gw,isAuthError:xt,isAuthImplicitGrantRedirectError:fw,isAuthRetryableFetchError:zu,isAuthSessionMissingError:Cu,lockInternals:Sa,navigatorLock:_w},Symbol.toStringTag,{value:"Module"})),iz="https://bqfzljnhxblhiabyvpqm.supabase.co",nz="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4",D=$a(iz,nz,{auth:{persistSession:!0,autoRefreshToken:!0,detectSessionInUrl:!0,storageKey:"eros-auth-token",storage:{getItem:e=>{try{return localStorage.getItem(e)}catch{return console.warn("localStorage unavailable, using sessionStorage"),sessionStorage.getItem(e)}},setItem:(e,r)=>{try{localStorage.setItem(e,r)}catch{console.warn("localStorage unavailable, using sessionStorage"),sessionStorage.setItem(e,r)}},removeItem:e=>{try{localStorage.removeItem(e)}catch{sessionStorage.removeItem(e)}}}}}),Ew=["id","name","erox_name","friend_name","email","gender","birthdate","city","location","job","bio","tags","erox_tags","friend_tags","preferences","friend_preferences","erox_preferences","is_premium","role","created_at","updated_at","is_banned","restriction_status","restriction_reason","meetips_balance","verification_status","hidden_from_eros","hidden_from_erox","hidden_from_friend","is_discreet","photo","avatar_url","erox_avatar_url","friend_avatar_url","photos","friend_photos","erox_photos","prompts","animated_photo_url","erox_animated_photo_url","friend_animated_photo_url","voice_bio_url"].join(","),Lf=Ew,Xc={},li=e=>{try{return localStorage.getItem(e)}catch{return Xc[e]||null}},Or=(e,r)=>{try{localStorage.setItem(e,r)}catch{Xc[e]=r}},Wl=e=>{try{localStorage.removeItem(e)}catch{delete Xc[e]}},Kc=()=>{try{const e={};for(let r=0;r<localStorage.length;r++){const i=localStorage.key(r);i&&(i.startsWith("tutorial_seen_")||i==="meetips_tutorial_seen")&&(e[i]=localStorage.getItem(i))}localStorage.clear();for(const[r,i]of Object.entries(e))localStorage.setItem(r,i)}catch{Object.keys(Xc).forEach(e=>{!e.startsWith("tutorial_seen_")&&e!=="meetips_tutorial_seen"&&delete Xc[e]})}},oz=Object.freeze(Object.defineProperty({__proto__:null,safeClearStorage:Kc,safeGetItem:li,safeRemoveItem:Wl,safeSetItem:Or},Symbol.toStringTag,{value:"Module"})),Rw=m.createContext({}),gr=()=>m.useContext(Rw),sz=({children:e})=>{const[r,i]=m.useState(null),[n,o]=m.useState(()=>{try{const g=li("userProfile");return g?JSON.parse(g):null}catch(g){return console.error("Failed to parse local profile:",g),null}}),[a,l]=m.useState(!0);m.useEffect(()=>{(async()=>{const{data:{session:y}}=await D.auth.getSession();i((y==null?void 0:y.user)??null),y!=null&&y.user?(n&&l(!1),d(y.user.id,y.user)):l(!1)})();const{data:{subscription:h}}=D.auth.onAuthStateChange(async(y,_)=>{if(y==="PASSWORD_RECOVERY"){window.location.href="/update-password";return}if(i((_==null?void 0:_.user)??null),_!=null&&_.user){d(_.user.id,_.user);const S=localStorage.getItem("pendingWelcomeEmail");if(S)try{const{userId:k,email:w,name:b}=JSON.parse(S);localStorage.removeItem("pendingWelcomeEmail"),console.log("ð§ Scheduling welcome email in 15 minutes for",b),setTimeout(()=>{Wr(async()=>{const{sendWelcomeEmail:j}=await Promise.resolve().then(()=>na);return{sendWelcomeEmail:j}},void 0).then(({sendWelcomeEmail:j})=>{j(k,w,b).then(()=>console.log("â
Welcome email sent (15min delay)")).catch(T=>console.warn("Welcome email failed:",T))})},15*60*1e3)}catch(k){console.warn("Failed to parse pendingWelcomeEmail:",k),localStorage.removeItem("pendingWelcomeEmail")}}else o(null),l(!1)}),x=async()=>
109{if(document.visibilityState==="visible")try{const{data:{session:y}}=await D.auth.getSession();y!=null&&y.user&&(i(y.user),d(y.user.id,y.user))}catch(y){console.warn("[Auth] Session refresh on visibility failed:",y)}};return document.addEventListener("visibilitychange",x),()=>{h.unsubscribe(),document.removeEventListener("visibilitychange",x)}},[]);const d=async(g,h=null)=>{var x,y,_,S,k,w,b;try{let j=(h==null?void 0:h.user_metadata)||{};const T=(h==null?void 0:h.email)||"";if(!h)try{const{data:{user:E}}=await D.auth.getUser();j=(E==null?void 0:E.user_metadata)||{}}catch{console.warn("AuthContext: getUser fallback failed")}const P={id:g,email:T,name:j.name||(T==null?void 0:T.split("@")[0])||"Utilisateur",avatar_url:j.avatar_url||j.photo,photo:j.photo||j.avatar_url};let I={};try{const E=await Promise.race([D.from("profiles").select(Ew).eq("id",g).maybeSingle(),new Promise(($,B)=>setTimeout(()=>B(new Error("DB timeout")),8e3))]);E&&!E.error&&(I=E.data||{})}catch(E){console.warn("AuthContext: DB fetch failed:",E.message)}let R={...P};const O=JSON.parse(li("userProfile")||"{}");if(O.id===g&&["name","erox_name","friend_name","city","bio","job","phone","birthdate","gender","tags","erox_tags","avatar_url","photo","role","erox_avatar_url","friend_avatar_url","photos","erox_photos","friend_photos"].forEach($=>{O[$]&&(R[$]=O[$])}),I&&Object.keys(I).length>0&&Object.entries(I).forEach(([E,$])=>{$!=null&&(R[E]=$)}),!R.avatar_url){const E="https://bqfzljnhxblhiabyvpqm.supabase.co";R.avatar_url=`${E}/storage/v1/object/public/avatars/${g}/avatar_fixed.jpg`}R.avatar_url&&!R.photo&&(R.photo=R.avatar_url),!((x=R.tags)!=null&&x.length)&&((y=j.tags)==null?void 0:y.length)>0&&(R.tags=j.tags),!((_=R.erox_tags)!=null&&_.length)&&((S=j.erox_tags)==null?void 0:S.length)>0&&(R.erox_tags=j.erox_tags),o(R),Or("userProfile",JSON.stringify(R))}catch(j){console.error("AuthContext: Critical failure:",j);const T={id:g,name:((k=h==null?void 0:h.user_metadata)==null?void 0:k.name)||((w=h==null?void 0:h.email)==null?void 0:w.split("@")[0])||"Utilisateur",email:(h==null?void 0:h.email)||"",avatar_url:(b=h==null?void 0:h.user_metadata)==null?void 0:b.avatar_url,_emergency:!0};o(T),Or("userProfile",JSON.stringify(T))}finally{l(!1)}},p=async()=>{try{await D.auth.signOut()}catch(g){console.warn("Server sign-out failed (network issue?), forcing local cleanup.",g)}finally{Wl("userProfile"),Wl("localAvatar"),Wl("onboarding_selections"),Wl("isPremium");try{Kc()}catch{}i(null),o(null),window.location.reload()}},u=async()=>{const g=r==null?void 0:r.id;if(!g)throw new Error("Utilisateur non connecté");try{const{error:h}=await D.from("profiles").delete().eq("id",g);h&&console.warn("Profile deletion warning:",h.message),await D.from("user_gifts").delete().eq("sender_id",g),await D.from("user_gifts").delete().eq("receiver_id",g),await D.from("matches").delete().or(`user1_id.eq.${g},user2_id.eq.${g}`),await D.from("meetips_transactions").delete().eq("user_id",g);try{await D.rpc("delete_own_account")}catch(x){console.warn("RPC delete_own_account not available, signing out only:",x.message)}await D.auth.signOut()}catch(h){console.error("Account deletion error:",h)}finally{Kc(),i(null),o(null),window.location.href="/login"}};return t.jsx(Rw.Provider,{value:{user:r,profile:n,loading:a,signOut:p,deleteAccount:u,refreshProfile:()=>r&&d(r.id,r)},children:!a&&e})},az=()=>{let e=localStorage.getItem("meetyou_visitor_id");return e||(e=crypto.randomUUID?crypto.randomUUID():`v-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,localStorage.setItem("meetyou_visitor_id",e)),e};let og=null;const lz=()=>(og||(og=crypto.randomUUID?crypto.randomUUID():`s-${Date.now()}-${Math.random().toString(36).slice(2,10)}`),og),dz=async(e,r=null)=>{try{const{data:i,error:n}=await D.from("site_analytics").insert([{visitor_id:az(),user_id:r||null,page:e,referrer:document.referrer||"",user_agent:navigator.userAgent||"",session_id:lz(),duration_seconds:0}]).select("id").single();return n?(console.warn("Analytics track error:",n.message),null):(i==null?void 0:i.id)||null}catch(i){return console.warn("Analytics track exception:",i),null}},cz=async(e,r)=>{if(!(!e||r<=0))try{await D.from("site_analytics").update({duration_seconds:Math.round(r)}).eq("id",e)}catch{}},v2=async()=>{try{const e=new Date,r=new Date(e.getFullYear(),e.getMonth(),e.getDate()).toISOString(),i=new Date(e.getTime()-e.getDay()*864e5).toISOString(),n=new Date(e.getFullYear(),e.getMonth(),1).toISOString(),o=new Date(e.getTime()-30*864e5).toISOString(),{data:a,error:l}=await D.from("site_analytics").select("*").gte("created_at",o).order("created_at",{ascending:!1}).limit(5e3);if(l)return console.warn("Analytics summary error:",l.message),null;const d=a||[],p=new Set(d.filter(E=>E.created_at>=r).map(E=>E.visitor_id)).size,u=new Set(d.filter(E=>E.created_at>=i).map(E=>E.visitor_id)).size,g=new Set(d.filter(E=>E.created_at>=n).map(E=>E.visitor_id)).size,h=new Set(d.filter(E=>E.created_at>
109=r&&E.user_id).map(E=>E.user_id)).size,x=new Set(d.filter(E=>E.created_at>=i&&E.user_id).map(E=>E.user_id)).size,y=new Set(d.filter(E=>E.created_at>=n&&E.user_id).map(E=>E.user_id)).size,_=d.filter(E=>E.created_at>=r).length,S=d.filter(E=>E.created_at>=i).length,k=d.filter(E=>E.created_at>=n).length,w=d.filter(E=>E.duration_seconds>0),b=w.length>0?Math.round(w.reduce((E,$)=>E+$.duration_seconds,0)/w.length):0,j={},T={};d.forEach(E=>{j[E.page]=(j[E.page]||0)+1,E.duration_seconds>0&&(T[E.page]||(T[E.page]={total:0,count:0}),T[E.page].total+=E.duration_seconds,T[E.page].count+=1)});const P=Object.entries(j).map(([E,$])=>({page:E,count:$,avgDuration:T[E]?Math.round(T[E].total/T[E].count):0})).sort((E,$)=>$.count-E.count).slice(0,15),I=[];for(let E=6;E>=0;E--){const $=new Date(e);$.setDate($.getDate()-E);const B=new Date($.getFullYear(),$.getMonth(),$.getDate()).toISOString(),ee=new Date($.getFullYear(),$.getMonth(),$.getDate()+1).toISOString(),te=d.filter(K=>K.created_at>=B&&K.created_at<ee);I.push({date:$.toLocaleDateString("fr-FR",{weekday:"short",day:"numeric"}),visitors:new Set(te.map(K=>K.visitor_id)).size,pageViews:te.length,loggedIn:new Set(te.filter(K=>K.user_id).map(K=>K.user_id)).size})}const R=d.slice(0,20),O=d.filter(E=>E.created_at>=r&&E.page==="/"&&!E.user_id).length;return{visitorsToday:p,visitorsWeek:u,visitorsMonth:g,loggedInToday:h,loggedInWeek:x,loggedInMonth:y,pageViewsToday:_,pageViewsWeek:S,pageViewsMonth:k,avgDuration:b,topPages:P,dailyVisits:I,recentVisits:R,landingVisitorsToday:O}}catch(e){return console.warn("Analytics summary exception:",e),null}},pz=()=>{const e=ko(),{user:r}=gr(),i=m.useRef(null),n=m.useRef(null);m.useEffect(()=>{if(i.current&&n.current){const l=(Date.now()-n.current)/1e3;cz(i.current,l)}const o=e.pathname;n.current=Date.now(),dz(o,(r==null?void 0:r.id)||null).then(l=>{i.current=l});const a=()=>{if(i.current&&n.current){const l=(Date.now()-n.current)/1e3,d="https://bqfzljnhxblhiabyvpqm.supabase.co",p="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4";if(i.current){const u=`${d}/rest/v1/site_analytics?id=eq.${i.current}`,g=JSON.stringify({duration_seconds:Math.round(l)});try{navigator.sendBeacon(u,new Blob([g],{type:"application/json"}))}catch{fetch(u,{method:"PATCH",headers:{"Content-Type":"application/json",apikey:p,Authorization:`Bearer ${p}`,Prefer:"return=minimal"},body:g,keepalive:!0}).catch(()=>{})}}}};return window.addEventListener("beforeunload",a),()=>{window.removeEventListener("beforeunload",a)}},[e.pathname,r==null?void 0:r.id])},fm=m.createContext({});function mp(e){const r=m.useRef(null);return r.current===null&&(r.current=e()),r.current}const Qh=m.createContext(null),e0=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class uz extends m.Component{getSnapshotBeforeUpdate(r){const i=this.props.childRef.current;if(i&&r.isPresent&&!this.props.isPresent){const n=this.props.sizeRef.current;n.height=i.offsetHeight||0,n.width=i.offsetWidth||0,n.top=i.offsetTop,n.left=i.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function hz({children:e,isPresent:r}){const i=m.useId(),n=m.useRef(null),o=m.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=m.useContext(e0);return m.useInsertionEffect(()=>{const{width:l,height:d,top:p,left:u}=o.current;if(r||!n.current||!l||!d)return;n.current.dataset.motionPopId=i;const g=document.createElement("style");return a&&(g.nonce=a),document.head.appendChild(g),g.sheet&&g.sheet.insertRule(` 110 [data-motion-pop-id="${i}"] { 111 position: absolute !important; 112 width: ${l}px !important; 113 height: ${d}px !important; 114 top: ${p}px !important; 115 left: ${u}px !important; 116 } 117 `),()=>{document.head.removeChild(g)}},[r]),t.jsx(uz,{isPresent:r,childRef:n,sizeRef:o,children:m.cloneElement(e,{ref:n})})}const gz=({children:e,initial:r,isPresent:i,onExitComplete:n,custom:o,presenceAffectsLayout:a,mode:l})=>{const d=mp(fz),p=m.useId(),u=m.useCallback(h=>{d.set(h,!0);for(const x of d.values())if(!x)return;n&&n()},[d,n]),g=m.useMemo(()=>({id:p,initial:r,isPresent:i,custom:o,onExitComplete:u,register:h=>(d.set(h,!1),()=>d.delete(h))}),a?[Math.random(),u]:[i,u]);return m.useMemo(()=>{d.forEach((h,x)=>d.set(x,!1))},[i]),m.useEffect(()=>{!i&&!d.size&&n&&n()},[i]),l==="popLayout"&&(e=t.jsx(hz,{isPresent:i,children:e})),t.jsx(Qh.Provider,{value:g,children:e})};function fz(){return new Map}function Iw(e=!0){const r=m.useContext(Qh);if(r===null)return[!0,null];const{isPresent:i,onExitComplete:n,register:o}=r,a=m.useId();m.useEffect(()=>{e&&o(a)},[e]);const l=m.useCallback(()=>e&&n&&n(a),[a,n,e]);return!i&&n?[!1,l]:[!0]}const au=e=>e.key||"";function j2(e){const r=[];
vendor: 15,651 bytes, line 117
117return m.Children.forEach(e,i=>{m.isValidElement(i)&&r.push(i)}),r}const xm=typeof window<"u",mm=xm?m.useLayoutEffect:m.useEffect,tr=({children:e,custom:r,initial:i=!0,onExitComplete:n,presenceAffectsLayout:o=!0,mode:a="sync",propagate:l=!1})=>{const[d,p]=Iw(l),u=m.useMemo(()=>j2(e),[e]),g=l&&!d?[]:u.map(au),h=m.useRef(!0),x=m.useRef(u),y=mp(()=>new Map),[_,S]=m.useState(u),[k,w]=m.useState(u);mm(()=>{h.current=!1,x.current=u;for(let T=0;T<k.length;T++){const P=au(k[T]);g.includes(P)?y.delete(P):y.get(P)!==!0&&y.set(P,!1)}},[k,g.length,g.join("-")]);const b=[];if(u!==_){let T=[...u];for(let P=0;P<k.length;P++){const I=k[P],R=au(I);g.includes(R)||(T.splice(P,0,I),b.push(I))}a==="wait"&&b.length&&(T=b),w(j2(T)),S(u);return}const{forceRender:j}=m.useContext(fm);return t.jsx(t.Fragment,{children:k.map(T=>{const P=au(T),I=l&&!d?!1:u===k||g.includes(P),R=()=>{if(y.has(P))y.set(P,!0);else return;let O=!0;y.forEach(E=>{E||(O=!1)}),O&&(j==null||j(),w(x.current),l&&(p==null||p()),n&&n())};return t.jsx(gz,{isPresent:I,initial:!h.current||i?void 0:!1,custom:I?void 0:r,presenceAffectsLayout:o,mode:a,onExitComplete:I?void 0:R,children:T},P)})})},In=e=>e;let Tw=In;function ym(e){let r;return()=>(r===void 0&&(r=e()),r)}const Ka=(e,r,i)=>{const n=r-e;return n===0?1:(i-e)/n},Oo=e=>e*1e3,Lo=e=>e/1e3,xz={useManualTiming:!1};function mz(e){let r=new Set,i=new Set,n=!1,o=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function d(u){a.has(u)&&(p.schedule(u),e()),u(l)}const p={schedule:(u,g=!1,h=!1)=>{const y=h&&n?r:i;return g&&a.add(u),y.has(u)||y.add(u),u},cancel:u=>{i.delete(u),a.delete(u)},process:u=>{if(l=u,n){o=!0;return}n=!0,[r,i]=[i,r],r.forEach(d),r.clear(),n=!1,o&&(o=!1,p.process(u))}};return p}const lu=["read","resolveKeyframes","update","preRender","render","postRender"],yz=40;function Aw(e,r){let i=!1,n=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=()=>i=!0,l=lu.reduce((w,b)=>(w[b]=mz(a),w),{}),{read:d,resolveKeyframes:p,update:u,preRender:g,render:h,postRender:x}=l,y=()=>{const w=performance.now();i=!1,o.delta=n?1e3/60:Math.max(Math.min(w-o.timestamp,yz),1),o.timestamp=w,o.isProcessing=!0,d.process(o),p.process(o),u.process(o),g.process(o),h.process(o),x.process(o),o.isProcessing=!1,i&&r&&(n=!1,e(y))},_=()=>{i=!0,n=!0,o.isProcessing||e(y)};return{schedule:lu.reduce((w,b)=>{const j=l[b];return w[b]=(T,P=!1,I=!1)=>(i||_(),j.schedule(T,P,I)),w},{}),cancel:w=>{for(let b=0;b<lu.length;b++)l[lu[b]].cancel(w)},state:o,steps:l}}const{schedule:Er,cancel:fs,state:Oi,steps:sg}=Aw(typeof requestAnimationFrame<"u"?requestAnimationFrame:In,!0),Pw=m.createContext({strict:!1}),w2={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},md={};for(const e in w2)md[e]={isEnabled:r=>w2[e].some(i=>!!r[i])};function bz(e){for(const r in e)md[r]={...md[r],...e[r]}}const vz=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function ch(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||vz.has(e)}let Fw=e=>!ch(e);function jz(e){e&&(Fw=r=>r.startsWith("on")?!ch(r):e(r))}try{jz(require("@emotion/is-prop-valid").default)}catch{}function wz(e,r,i){const n={};for(const o in e)o==="values"&&typeof e.values=="object"||(Fw(o)||i===!0&&ch(o)||!r&&!ch(o)||e.draggable&&o.startsWith("onDrag"))&&(n[o]=e[o]);return n}function _z(e){if(typeof Proxy>"u")return e;const r=new Map,i=(...n)=>e(...n);return new Proxy(i,{get:(n,o)=>o==="create"?e:(r.has(o)||r.set(o,e(o)),r.get(o))})}const t0=m.createContext({});function Qc(e){return typeof e=="string"||Array.isArray(e)}function r0(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const bm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],vm=["initial",...bm];function i0(e){return r0(e.animate)||vm.some(r=>Qc(e[r]))}function Mw(e){return!!(i0(e)||e.variants)}function Sz(e,r){if(i0(e)){const{initial:i,animate:n}=e;return{initial:i===!1||Qc(i)?i:void 0,animate:Qc(n)?n:void 0}}return e.inherit!==!1?r:{}}function kz(e){const{initial:r,animate:i}=Sz(e,m.useContext(t0));return m.useMemo(()=>({initial:r,animate:i}),[_2(r),_2(i)])}function _2(e){return Array.isArray(e)?e.join(" "):e}const Cz=Symbol.for("motionComponentSymbol");function Nl(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function zz(e,r,i){return m.useCallback(n=>{n&&e.onMount&&e.onMount(n),r&&(n?r.mount(n):r.unmount()),i&&(typeof i=="function"?i(n):Nl(i)&&(i.current=n))},[r])}const jm=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ez="framerAppearId",Dw="data-"+jm(Ez),{schedule:wm}=Aw(queueMicrotask,!1),Bw=m.createContext({});function Rz(e,r,i,n,o){var a,l;const{visualElement:d}=m.useContext(t0),p=m.useContext(Pw),u=m.useContext(Qh),g=m.useContext(e0).reducedMotion,h=m.useRef(null);n=n||p.renderer,!h.current&&n&&(h.current=n(e,{visualState:r,parent:d,props:i,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:g}));const x=h.current,y=m.useContext(Bw);x&&!x.projection&&o&&(x.type==="html"||x.type==="svg")&&Iz(h.current,i,o,y);const _=m.useRef(!1);m.useInsertionEffect(()=>{x&&_.current&&x.update(i,u)});const S=i[Dw],k=m.useRef(!!S&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,S))&&((l=window.MotionHasOptimisedAnimation)===null||l===void 0?void 0:l.call(window,S)));return mm(()=>{x&&(_.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),wm.render(x.render),k.current&&x.animationState&&x.animationState.animateChanges())}),m.useEffect(()=>{x&&(!k.current&&x.animationState&&x.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{var w;(w=window.MotionHandoffMarkAsComplete)===null||w===void 0||w.call(window,S)}),k.current=!1))}),x}function Iz(e,r,i,n){const{layoutId:o,layout:a,drag:l,dragConstraints:d,layoutScroll:p,layoutRoot:u}=r;e.projection=new i(e.latestValues,r["data-framer-portal-id"]?void 0:Ow(e.parent)),e.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:!!l||d&&Nl(d),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:n,layoutScroll:p,layoutRoot:u})}function Ow(e){if(e)return e.options.allowProjection!==!1?e.projection:Ow(e.parent)}function Tz({preloadedFeatures:e,createVisualElement:r,useRender:i,useVisualState:n,Component:o}){var a,l;e&&bz(e);function d(u,g){let h;const x={...m.useContext(e0),...u,layoutId:Az(u)},{isStatic:y}=x,_=kz(u),S=n(u,y);if(!y&&xm){Pz();const k=Fz(x);h=k.MeasureLayout,_.visualElement=Rz(o,S,x,r,k.ProjectionNode)}return t.jsxs(t0.Provider,{value:_,children:[h&&_.visualElement?t.jsx(h,{visualElement:_.visualElement,...x}):null,i(o,u,zz(S,_.visualElement,g),S,y,_.visualElement)]})}d.displayName=`motion.${typeof o=="string"?o:`create(${(l=(a=o.displayName)!==null&&a!==void 0?a:o.name)!==null&&l!==void 0?l:""})`}`;const p=m.forwardRef(d);return p[Cz]=o,p}function Az({layoutId:e}){const r=m.useContext(fm).id;return r&&e!==void 0?r+"-"+e:e}function Pz(e,r){m.useContext(Pw).strict}function Fz(e){const{drag:r,layout:i}=md;if(!r&&!i)return{};const n={...r,...i};return{MeasureLayout:r!=null&&r.isEnabled(e)||i!=null&&i.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}const Mz=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function _m(e){return typeof e!="string"||e.includes("-")?!1:!!(Mz.indexOf(e)>-1||/[A-Z]/u.test(e))}function S2(e){const r=[{},{}];return e==null||e.values.forEach((i,n)=>{r[0][n]=i.get(),r[1][n]=i.getVelocity()}),r}function Sm(e,r,i,n){if(typeof r=="function"){const[o,a]=S2(n);r=r(i!==void 0?i:e.custom,o,a)}if(typeof r=="string"&&(r=e.variants&&e.variants[r]),typeof r=="function"){const[o,a]=S2(n);r=r(i!==void 0?i:e.custom,o,a)}return r}const $f=e=>Array.isArray(e),Dz=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),Bz=e=>$f(e)?e[e.length-1]||0:e,Ri=e=>!!(e&&e.getVelocity);function Ru(e){const r=Ri(e)?e.get():e;return Dz(r)?r.toValue():r}function Oz({scrapeMotionValuesFromProps:e,createRenderState:r,onUpdate:i},n,o,a){const l={latestValues:Lz(n,o,a,e),renderState:r()};return i&&(l.onMount=d=>i({props:n,current:d,...l}),l.onUpdate=d=>i(d)),l}const Lw=e=>(r,i)=>{const n=m.useContext(t0),o=m.useContext(Qh),a=()=>Oz(e,r,n,o);return i?a():mp(a)};function Lz(e,r,i,n){const o={},a=n(e,{});for(const x in a)o[x]=Ru(a[x]);let{initial:l,animate:d}=e;const p=i0(e),u=Mw(e);r&&u&&!p&&e.inherit!==!1&&(l===void 0&&(l=r.initial),d===void 0&&(d=r.animate));let g=i?i.initial===!1:!1;g=g||l===!1;const h=g?d:l;if(h&&typeof h!="boolean"&&!r0(h)){const x=Array.isArray(h)?h:[h];for(let y=0;y<x.length;y++){const _=Sm(e,x[y]);if(_){const{transitionEnd:S,transition:k,...w}=_;for(const b in w){let j=w[b];if(Array.isArray(j)){const T=g?j.length-1:0;j=j[T]}j!==null&&(o[b]=j)}for(const b in S)o[b]=S[b]}}}return o}const Id=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],sl=new Set(Id),$w=e=>r=>typeof r=="string"&&r.startsWith(e),Ww=$w("--"),$z=$w("var(--"),km=e=>$z(e)?Wz.test(e.split("/*")[0].trim()):!1,Wz=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Nw=(e,r)=>r&&typeof e=="number"?r.transform(e):e,xs=(e,r,i)=>i>r?r:i<e?e:i,Td={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ep={...Td,transform:e=>xs(0,1,e)},du={...Td,default:1},yp=e=>({test:r=>typeof r=="string"&&r.endsWith(e)&&r.split(" ").length===1,parse:parseFloat,transform:r=>`${r}${e}`}),Is=yp("deg"),$o=yp("%"),_t=yp("px"),Nz=yp("vh"),Uz=yp("vw"),k2={...$o,parse:e=>$o.parse(e)/100,transform:e=>$o.transform(e*100)},Vz={borderWidth:_t,borderTopWidth:_t,borderRightWidth:_t,borderBottomWidth:_t,borderLeftWidth:_t,borderRadius:_t,radius:_t,borderTopLeftRadius:_t,borderTopRightRadius:_t,borderBottomRightRadius:_t,borderBottomLeftRadius:_t,width:_t,maxWidth:_t,height:_t,maxHeight:_t,top:_t,right:_t,bottom:_t,left:_t,padding:_t,paddingTop:_t,paddingRight:_t,paddingBottom:_t,paddingLeft:_t,margin:_t,marginTop:_t,marginRight:_t,marginBottom:_t,marginLeft:_t,backgroundPositionX:_t,backgroundPositionY:_t},qz={rotate:Is,rotateX:Is,rotateY:Is,rotateZ:Is,scale:du,scaleX:du,scaleY:du,scaleZ:du,skew:Is,skewX:Is,skewY:Is,distance:_t,translateX:_t,translateY:_t,translateZ:_t,x:_t,y:_t,z:_t,perspective:_t,transformPerspective:_t,opacity:ep,originX:k2,originY:k2,originZ:_t},C2={...Td,transform:Math.round},Cm={...Vz,...qz,zIndex:C2,size:_t,fillOpacity:ep,strokeOpacity:ep,numOctaves:C2},Hz={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Gz=Id.length;function Jz(e,r,i){let n="",o=!0;for(let a=0;a<Gz;a++){const l=Id[a],d=e[l];if(d===void 0)continue;let p=!0;if(typeof d=="number"?p=d===(l.startsWith("scale")?1:0):p=parseFloat(d)===0,!p||i){const u=Nw(d,Cm[l]);if(!p){o=!1;const g=Hz[l]||l;n+=`${g}(${u}) `}i&&(r[l]=u)}}return n=n.trim(),i?n=i(r,o?"":n):o&&(n="none"),n}function zm(e,r,i){const{style:n,vars:o,transformOrigin:a}=e;let l=!1,d=!1;for(const p in r){const u=r[p];if(sl.has(p)){l=!0;continue}else if(Ww(p)){o[p]=u;continue}else{const g=Nw(u,Cm[p]);p.startsWith("origin")?(d=!0,a[p]=g):n[p]=g}}if(r.transform||(l||i?n.transform=Jz(r,e.transform,i):n.transform&&(n.transform="none")),d){const{originX:p="50%",originY:u="50%",originZ:g=0}=a;n.transformOrigin=`${p} ${u} ${g}`}}const Zz={offset:"stroke-dashoffset",array:"stroke-dasharray"},Yz={offset:"strokeDashoffset",array:"strokeDasharray"};function Xz(e,r,i=1,n=0,o=!0){e.pathLength=1;const a=o?Zz:Yz;e[a.offset]=_t.transform(-n);const l=_t.transform(r),d=_t.transform(i);e[a.array]=`${l} ${d}`}function z2(e,r,i){return typeof e=="string"?e:_t.transform(r+i*e)}function Kz(e,r,i){const n=z2(r,e.x,e.width),o=z2(i,e.y,e.height);return`${n} ${o}`}function Em(e,{attrX:r,attrY:i,attrScale:n,originX:o,originY:a,pathLength:l,pathSpacing:d=1,pathOffset:p=0,...u},g,h){if(zm(e,u,h),g){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:x,style:y,dimensions:_}=e;x.transform&&(_&&(y.transform=x.transform),delete x.transform),_&&(o!==void 0||a!==void 0||y.transform)&&(y.transformOrigin=Kz(_,o!==void 0?o:.5,a!==void 0?a:.5)),r!==void 0&&(x.x=r),i!==void 0&&(x.y=i),n!==void 0&&(x.scale=n),l!==void 0&&Xz(x,l,d,p,!1)}const Rm=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Uw=()=>({...Rm(),attrs:{}}),Im=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Vw(e,{style:r,vars:i},n,o){Object.assign(e.style,r,o&&o.getProjectionStyles(n));for(const a in i)e.style.setProperty(a,i[a])}const qw=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Hw(e,r,i,n){Vw(e,r,void 0,n);for(const o in r.attrs)e.setAttribute(qw.has(o)?o:jm(o),r.attrs[o])}const ph={};function Qz(e){Object.assign(ph,e)}function Gw(e,{layout:r,layoutId:i}){return sl.has(e)||e.startsWith("origin")||(r||i!==void 0)&&(!!ph[e]||e==="opacity")}function Tm(e,r,i){var n;const{style:o}=e,a={};for(const l in o)(Ri(o[l])||r.style&&Ri(r.style[l])||Gw(l,e)||((n=i==null?void 0:i.getValue(l))===null||n===void 0?void 0:n.liveStyle)!==void 0)&&(a[l]=o[l]);return a}function Jw(e,r,i){const n=Tm(e,r,i);for(const o in e)if(Ri(e[o])||Ri(r[o])){const a=Id.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;n[a]=e[o]}return n}function eE(e,r){try{r.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}}const E2=["x","y","width","height","cx","cy","r"],tE={useVisualState:Lw({scrapeMotionValuesFromProps:Jw,createRenderState:Uw,onUpdate:({props:e,prevProps:r,current:i,renderState:n,latestValues:o})=>{if(!i)return;let a=!!e.drag;if(!a){for(const d in o)if(sl.has(d)){a=!0;break}}if(!a)return;let l=!r;if(r)for(let d=0;d<E2.length;d++){const p=E2[d];e[p]!==r[p]&&(l=!0)}l&&Er.read(()=>{eE(i,n),Er.render(()=>{Em(n,o,Im(i.tagName),e.transformTemplate),Hw(i,n)})})}})},rE={useVisualState:Lw({scrapeMotionValuesFromProps:Tm,createRenderState:Rm})};function Zw(e,r,i){for(const n in r)!Ri(r[n])&&!Gw(n,i)&&(e[n]=r[n])}function iE({transformTemplate:e},r){return m.useMemo(()=>{const i=Rm();return zm(i,r,e),Object.assign({},i.vars,i.style)},[r])}function nE(e,r){const i=e.style||{},n={};return Zw(n,i,e),Object.assign(n,iE(e,r)),n}function oE(e,r){const i={},n=nE(e,r);return e.drag&&e.dragListener!==!1&&(i.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}
117`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(i.tabIndex=0),i.style=n,i}function sE(e,r,i,n){const o=m.useMemo(()=>{const a=Uw();return Em(a,r,Im(n),e.transformTemplate),{...a.attrs,style:{...a.style}}},[r]);if(e.style){const a={};Zw(a,e.style,e),o.style={...a,...o.style}}return o}function aE(e=!1){return(i,n,o,{latestValues:a},l)=>{const p=(_m(i)?sE:oE)(n,a,l,i),u=wz(n,typeof i=="string",e),g=i!==m.Fragment?{...u,...p,ref:o}:{},{children:h}=n,x=m.useMemo(()=>Ri(h)?h.get():h,[h]);return m.createElement(i,{...g,children:x})}}function lE(e,r){return function(n,{forwardMotionProps:o}={forwardMotionProps:!1}){const l={..._m(n)?tE:rE,preloadedFeatures:e,useRender:aE(o),createVisualElement:r,Component:n};return Tz(l)}}function Yw(e,r){if(!Array.isArray(r))return!1;const i=r.length;if(i!==e.length)return!1;for(let n=0;n<i;n++)if(r[n]!==e[n])return!1;return!0}function n0(e,r,i){const n=e.getProps();return Sm(n,r,i!==void 0?i:n.custom,e)}const dE=ym(()=>window.ScrollTimeline!==void 0);class cE{constructor(r){this.stop=()=>this.runAll("stop"),this.animations=r.filter(Boolean)}get finished(){return Promise.all(this.animations.map(r=>"finished"in r?r.finished:r))}getAll(r){return this.animations[0][r]}setAll(r,i){for(let n=0;n<this.animations.length;n++)this.animations[n][r]=i}attachTimeline(r,i){const n=this.animations.map(o=>{if(dE()&&o.attachTimeline)return o.attachTimeline(r);if(typeof i=="function")return i(o)});return()=>{n.forEach((o,a)=>{o&&o(),this.animations[a].stop()})}}get time(){return this.getAll("time")}set time(r){this.setAll("time",r)}get speed(){return this.getAll("speed")}set speed(r){this.setAll("speed",r)}get startTime(){return this.getAll("startTime")}get duration(){let r=0;for(let i=0;i<this.animations.length;i++)r=Math.max(r,this.animations[i].duration);return r}runAll(r){this.animations.forEach(i=>i[r]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Xw extends cE{then(r,i){return Promise.all(this.animations).then(r).catch(i)}}function Am(e,r){return e?e[r]||e.default||e:void 0}const uh=2e4;function Pm(e){let r=0;const i=50;let n=e.next(r);for(;!n.done&&r<uh;)r+=i,n=e.next(r);return r>=uh?1/0:r}function pE(e,r=100,i){const n=i({...e,keyframes:[0,r]}),o=Math.min(Pm(n),uh);return{type:"keyframes",ease:a=>n.next(o*a).value/r,duration:Lo(o)}}function o0(e){return typeof e=="function"}function R2(e,r){e.timeline=r,e.onfinish=null}const Fm=e=>Array.isArray(e)&&typeof e[0]=="number",uE={linearEasing:void 0};function hE(e,r){const i=ym(e);return()=>{var n;return(n=uE[r])!==null&&n!==void 0?n:i()}}const hh=hE(()=>{try{document.createElement("div").animate({opacity:0}
vendor: 15,335 bytes, line 117
117,{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Kw=(e,r,i=10)=>{let n="";const o=Math.max(Math.round(r/i),2);for(let a=0;a<o;a++)n+=e(Ka(0,o-1,a))+", ";return`linear(${n.substring(0,n.length-2)})`};function Qw(e){return!!(typeof e=="function"&&hh()||!e||typeof e=="string"&&(e in Wf||hh())||Fm(e)||Array.isArray(e)&&e.every(Qw))}const ac=([e,r,i,n])=>`cubic-bezier(${e}, ${r}, ${i}, ${n})`,Wf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ac([0,.65,.55,1]),circOut:ac([.55,0,1,.45]),backIn:ac([.31,.01,.66,-.59]),backOut:ac([.33,1.53,.69,.99])};function e_(e,r){if(e)return typeof e=="function"&&hh()?Kw(e,r):Fm(e)?ac(e):Array.isArray(e)?e.map(i=>e_(i,r)||Wf.easeOut):Wf[e]}const fo={x:!1,y:!1};function t_(){return fo.x||fo.y}function r_(e,r,i){var n;if(e instanceof Element)return[e];if(typeof e=="string"){let o=document;const a=(n=i==null?void 0:i[e])!==null&&n!==void 0?n:o.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e)}function i_(e,r){const i=r_(e),n=new AbortController,o={passive:!0,...r,signal:n.signal};return[i,o,()=>n.abort()]}function I2(e){return r=>{r.pointerType==="touch"||t_()||e(r)}}function gE(e,r,i={}){const[n,o,a]=i_(e,i),l=I2(d=>{const{target:p}=d,u=r(d);if(typeof u!="function"||!p)return;const g=I2(h=>{u(h),p.removeEventListener("pointerleave",g)});p.addEventListener("pointerleave",g,o)});return n.forEach(d=>{d.addEventListener("pointerenter",l,o)}),a}const n_=(e,r)=>r?e===r?!0:n_(e,r.parentElement):!1,Mm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,fE=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function xE(e){return fE.has(e.tagName)||e.tabIndex!==-1}const lc=new WeakSet;function T2(e){return r=>{r.key==="Enter"&&e(r)}}function ag(e,r){e.dispatchEvent(new PointerEvent("pointer"+r,{isPrimary:!0,bubbles:!0}))}const mE=(e,r)=>{const i=e.currentTarget;if(!i)return;const n=T2(()=>{if(lc.has(i))return;ag(i,"down");const o=T2(()=>{ag(i,"up")}),a=()=>ag(i,"cancel");i.addEventListener("keyup",o,r),i.addEventListener("blur",a,r)});i.addEventListener("keydown",n,r),i.addEventListener("blur",()=>i.removeEventListener("keydown",n),r)};function A2(e){return Mm(e)&&!t_()}function yE(e,r,i={}){const[n,o,a]=i_(e,i),l=d=>{const p=d.currentTarget;if(!A2(d)||lc.has(p))return;lc.add(p);const u=r(d),g=(y,_)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",x),!(!A2(y)||!lc.has(p))&&(lc.delete(p),typeof u=="function"&&u(y,{success:_}))},h=y=>{g(y,i.useGlobalTarget||n_(p,y.target))},x=y=>{g(y,!1)};window.addEventListener("pointerup",h,o),window.addEventListener("pointercancel",x,o)};return n.forEach(d=>{!xE(d)&&d.getAttribute("tabindex")===null&&(d.tabIndex=0),(i.useGlobalTarget?window:d).addEventListener("pointerdown",l,o),d.addEventListener("focus",u=>mE(u,o),o)}),a}function bE(e){return e==="x"||e==="y"?fo[e]?null:(fo[e]=!0,()=>{fo[e]=!1}):fo.x||fo.y?null:(fo.x=fo.y=!0,()=>{fo.x=fo.y=!1})}const o_=new Set(["width","height","top","left","right","bottom",...Id]);let Iu;function vE(){Iu=void 0}const Wo={now:()=>(Iu===void 0&&Wo.set(Oi.isProcessing||xz.useManualTiming?Oi.timestamp:performance.now()),Iu),set:e=>{Iu=e,queueMicrotask(vE)}};function Dm(e,r){e.indexOf(r)===-1&&e.push(r)}function s0(e,r){const i=e.indexOf(r);i>-1&&e.splice(i,1)}class Bm{constructor(){this.subscriptions=[]}add(r){return Dm(this.subscriptions,r),()=>s0(this.subscriptions,r)}notify(r,i,n){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](r,i,n);else for(let a=0;a<o;a++){const l=this.subscriptions[a];l&&l(r,i,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function s_(e,r){return r?e*(1e3/r):0}const P2=30,jE=e=>!isNaN(parseFloat(e)),vc={current:void 0};class wE{constructor(r,i={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(n,o=!0)=>{const a=Wo.now();this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(r),this.owner=i.owner}setCurrent(r){this.current=r,this.updatedAt=Wo.now(),this.canTrackVelocity===null&&r!==void 0&&(this.canTrackVelocity=jE(this.current))}setPrevFrameValue(r=this.current){this.prevFrameValue=r,this.prevUpdatedAt=this.updatedAt}onChange(r){return this.on("change",r)}on(r,i){this.events[r]||(this.events[r]=new Bm);const n=this.events[r].add(i);return r==="change"?()=>{n(),Er.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const r in this.events)this.events[r].clear()}attach(r,i){this.passiveEffect=r,this.stopPassiveEffect=i}set(r,i=!0){!i||!this.passiveEffect?this.updateAndNotify(r,i):this.passiveEffect(r,this.updateAndNotify)}setWithVelocity(r,i,n){this.set(i),this.prev=void 0,this.prevFrameValue=r,this.prevUpdatedAt=this.updatedAt-n}jump(r,i=!0){this.updateAndNotify(r),this.prev=r,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return vc.current&&vc.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const r=Wo.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||r-this.updatedAt>P2)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,P2);return s_(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(r){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=r(i),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function yd(e,r){return new wE(e,r)}function _E(e,r,i){e.hasValue(r)?e.getValue(r).set(i):e.addValue(r,yd(i))}function SE(e,r){const i=n0(e,r);let{transitionEnd:n={},transition:o={},...a}=i||{};a={...a,...n};for(const l in a){const d=Bz(a[l]);_E(e,l,d)}}function kE(e){return!!(Ri(e)&&e.add)}function Nf(e,r){const i=e.getValue("willChange");if(kE(i))return i.add(r)}function a_(e){return e.props[Dw]}const l_=(e,r,i)=>(((1-3*i+3*r)*e+(3*i-6*r))*e+3*r)*e,CE=1e-7,zE=12;function EE(e,r,i,n,o){let a,l,d=0;do l=r+(i-r)/2,a=l_(l,n,o)-e,a>0?i=l:r=l;while(Math.abs(a)>CE&&++d<zE);return l}function bp(e,r,i,n){if(e===r&&i===n)return In;const o=a=>EE(a,0,1,e,i);return a=>a===0||a===1?a:l_(o(a),r,n)}const d_=e=>r=>r<=.5?e(2*r)/2:(2-e(2*(1-r)))/2,c_=e=>r=>1-e(1-r),p_=bp(.33,1.53,.69,.99),Om=c_(p_),u_=d_(Om),h_=e=>(e*=2)<1?.5*Om(e):.5*(2-Math.pow(2,-10*(e-1))),Lm=e=>1-Math.sin(Math.acos(e)),g_=c_(Lm),f_=d_(Lm),x_=e=>/^0[^.\s]+$/u.test(e);function RE(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||x_(e):!0}const jc=e=>Math.round(e*1e5)/1e5,$m=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function IE(e){return e==null}const TE=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Wm=(e,r)=>i=>!!(typeof i=="string"&&TE.test(i)&&i.startsWith(e)||r&&!IE(i)&&Object.prototype.hasOwnProperty.call(i,r)),m_=(e,r,i)=>n=>{if(typeof n!="string")return n;const[o,a,l,d]=n.match($m);return{[e]:parseFloat(o),[r]:parseFloat(a),[i]:parseFloat(l),alpha:d!==void 0?parseFloat(d):1}},AE=e=>xs(0,255,e),lg={...Td,transform:e=>Math.round(AE(e))},Ma={test:Wm("rgb","red"),parse:m_("red","green","blue"),transform:({red:e,green:r,blue:i,alpha:n=1})=>"rgba("+lg.transform(e)+", "+lg.transform(r)+", "+lg.transform(i)+", "+jc(ep.transform(n))+")"};function PE(e){let r="",i="",n="",o="";return e.length>5?(r=e.substring(1,3),i=e.substring(3,5),n=e.substring(5,7),o=e.substring(7,9)):(r=e.substring(1,2),i=e.substring(2,3),n=e.substring(3,4),o=e.substring(4,5),r+=r,i+=i,n+=n,o+=o),{red:parseInt(r,16),green:parseInt(i,16),blue:parseInt(n,16),alpha:o?parseInt(o,16)/255:1}}const Uf={test:Wm("#"),parse:PE,transform:Ma.transform},Ul={test:Wm("hsl","hue"),parse:m_("hue","saturation","lightness"),transform:({hue:e,saturation:r,lightness:i,alpha:n=1})=>"hsla("+Math.round(e)+", "+$o.transform(jc(r))+", "+$o.transform(jc(i))+", "+jc(ep.transform(n))+")"},Vi={test:e=>Ma.test(e)||Uf.test(e)||Ul.test(e),parse:e=>Ma.test(e)?Ma.parse(e):Ul.test(e)?Ul.parse(e):Uf.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ma.transform(e):Ul.transform(e)},FE=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ME(e){var r,i;return isNaN(e)&&typeof e=="string"&&(((r=e.match($m))===null||r===void 0?void 0:r.length)||0)+(((i=e.match(FE))===null||i===void 0?void 0:i.length)||0)>0}const y_="number",b_="color",DE="var",BE="var(",F2="${}",OE=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function tp(e){const r=e.toString(),i=[],n={color:[],number:[],var:[]},o=[];let a=0;const d=r.replace(OE,p=>(Vi.test(p)?(n.color.push(a),o.push(b_),i.push(Vi.parse(p))):p.startsWith(BE)?(n.var.push(a),o.push(DE),i.push(p)):(n.number.push(a),o.push(y_),i.push(parseFloat(p))),++a,F2)).split(F2);return{values:i,split:d,indexes:n,types:o}}function v_(e){return tp(e).values}function j_(e){const{split:r,types:i}=tp(e),n=r.length;return o=>{let a="";for(let l=0;l<n;l++)if(a+=r[l],o[l]!==void 0){const d=i[l];d===y_?a+=jc(o[l]):d===b_?a+=Vi.transform(o[l]):a+=o[l]}return a}}const LE=e=>typeof e=="number"?0:e;function $E(e){const r=v_(e);return j_(e)(r.map(LE))}const ra={test:ME,parse:v_,createTransformer:j_,getAnimatableNone:$E},WE=new Set(["brightness","contrast","saturate","opacity"]);function NE(e){const[r,i]=e.slice(0,-1).split("(");if(r==="drop-shadow")return e;const[n]=i.match($m)||[];if(!n)return e;const o=i.replace(n,"");let a=WE.has(r)?1:0;return n!==i&&(a*=100),r+"("+a+o+")"}const UE=/\b([a-z-]*)\(.*?\)/gu,Vf={...ra,getAnimatableNone:e=>{const r=e.match(UE);return r?r.map(NE).join(" "):e}},VE={...Cm,color:Vi,backgroundColor:Vi,outlineColor:Vi,fill:Vi,stroke:Vi,borderColor:Vi,borderTopColor:Vi,borderRightColor:Vi,borderBottomColor:Vi,borderLeftColor:Vi,filter:Vf,WebkitFilter:Vf},Nm=e=>VE[e];function w_(e,r){let i=Nm(e);return i!==Vf&&(i=ra),i.getAnimatableNone?i.getAnimatableNone(r):void 0}const qE=new Set(["auto","none","0"]);function HE(e,r,i){let n=0,o;for(;n<e.length&&!o;){const a=e[n];typeof a=="string"&&!qE.has(a)&&tp(a).values.length&&(o=e[n]),n++}if(o&&i)for(const a of r)e[a]=w_(i,o)}const M2=e=>e===Td||e===_t,D2=(e,r)=>parseFloat(e.split(", ")[r]),B2=(e,r)=>(i,{transform:n})=>{if(n==="none"||!n)return 0;const o=n.match(/^matrix3d\((.+)\)$/u);if(o)return D2(o[1],r);{const a=n.match(/^matrix\((.+)\)$/u);return a?D2(a[1],e):0}},GE=new Set(["x","y","z"]),JE=Id.filter(e=>!GE.has(e));function ZE(e){const r=[];return JE.forEach(i=>{const n=e.getValue(i);n!==void 0&&(r.push([i,n.get()]),n.set(i.startsWith("scale")?1:0))}),r}const bd={width:({x:e},{paddingLeft:r="0",paddingRight:i="0"})=>e.max-e.min-parseFloat(r)-parseFloat(i),height:({y:e},{paddingTop:r="0",paddingBottom:i="0"})=>e.max-e.min-parseFloat(r)-parseFloat(i),top:(e,{top:r})=>parseFloat(r),left:(e,{left:r})=>parseFloat(r),bottom:({y:e},{top:r})=>parseFloat(r)+(e.max-e.min),right:({x:e},{left:r})=>parseFloat(r)+(e.max-e.min),x:B2(4,13),y:B2(5,14)};bd.translateX=bd.x;bd.translateY=bd.y;const Wa=new Set;let qf=!1,Hf=!1;function __(){if(Hf){const e=Array.from(Wa).filter(n=>n.needsMeasurement),r=new Set(e.map(n=>n.element)),i=new Map;r.forEach(n=>{const o=ZE(n);o.length&&(i.set(n,o),n.render())}),e.forEach(n=>n.measureInitialState()),r.forEach(n=>{n.render();const o=i.get(n);o&&o.forEach(([a,l])=>{var d;(d=n.getValue(a))===null||d===void 0||d.set(l)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}Hf=!1,qf=!1,Wa.forEach(e=>e.complete()),Wa.clear()}function S_(){Wa.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Hf=!0)})}function YE(){S_(),__()}class Um{constructor(r,i,n,o,a,l=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...r],this.onComplete=i,this.name=n,this.motionValue=o,this.element=a,this.isAsync=l}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Wa.add(this),qf||(qf=!0,Er.read(S_),Er.resolveKeyframes(__))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:r,name:i,element:n,motionValue:o}=this;for(let a=0;a<r.length;a++)if(r[a]===null)if(a===0){const l=o==null?void 0:o.get(),d=r[r.length-1];if(l!==void 0)r[0]=l;else if(n&&i){const p=n.readValue(i,d);p!=null&&(r[0]=p)}r[0]===void 0&&(r[0]=d),o&&l===void 0&&o.set(r[0])}else r[a]=r[a-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Wa.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Wa.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const k_=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),XE=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function KE(e){const r=XE.exec(e);if(!r)return[,];const[,i,n,o]=r;return[`--${i??n}`,o]}function C_(e,r,i=1){const[n,o]=KE(e);if(!n)return;const a=window.getComputedStyle(r).getPropertyValue(n);if(a){const l=a.trim();return k_(l)?parseFloat(l):l}return km(o)?C_(o,r,i+1):o}const z_=e=>r=>r.test(e),QE={test:e=>e==="auto",parse:e=>e},E_=[Td,_t,$o,Is,Uz,Nz,QE],O2=e=>E_.find(z_(e));class R_ extends Um{constructor(r,i,n,o,a){super(r,i,n,o,a,!0)}readKeyframes(){const{unresolvedKeyframes:r,element:i,name:n}=this;if(!i||!i.current)return;super.readKeyframes();for(let p=0;p<r.length;p++){let u=r[p];if(typeof u=="string"&&(u=u.trim(),km(u))){const g=C_(u,i.current);g!==void 0&&(r[p]=g),p===r.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!o_.has(n)||r.length!==2)return;const[o,a]=r,l=O2(o),d=O2(a);if(l!==d)if(M2(l)&&M2(d))for(let p=0;p<r.length;p++){const u=r[p];typeof u=="string"&&(r[p]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:r,name:i}=this,n=[];for(let o=0;o<r.length;o++)RE(r[o])&&n.push(o);n.length&&HE(r,n,i)}measureInitialState(){const{element:r,unresolvedKeyframes:i,name:n}=this;if(!r||!r.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=bd[n](r.measureViewportBox(),window.getComputedStyle(r.current)),i[0]=this.measuredOrigin;const o=i[i.length-1];o!==void 0&&r.getValue(n,o).jump(o,!1)}measureEndState(){var r;const{element:i,name:n,unresolvedKeyframes:o}=this;if(!i||!i.current)return;const a=i.getValue(n);a&&a.jump(this.measuredOrigin,!1);const l=o.length-1,d=o[l];o[l]=bd[n](i.measureViewportBox(),window.getComputedStyle(i.current)),d!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=d),!((r=this.removedTransforms)===null||r===void 0)&&r.length&&this.removedTransforms.forEac
vendor: 10,704 bytes, line 117
117h(([p,u])=>{i.getValue(p).set(u)}),this.resolveNoneKeyframes()}}const L2=(e,r)=>r==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ra.test(e)||e==="0")&&!e.startsWith("url("));function eR(e){const r=e[0];if(e.length===1)return!0;for(let i=0;i<e.length;i++)if(e[i]!==r)return!0}function tR(e,r,i,n){const o=e[0];if(o===null)return!1;if(r==="display"||r==="visibility")return!0;const a=e[e.length-1],l=L2(o,r),d=L2(a,r);return!l||!d?!1:eR(e)||(i==="spring"||o0(i))&&n}const rR=e=>e!==null;function a0(e,{repeat:r,repeatType:i="loop"},n){const o=e.filter(rR),a=r&&i!=="loop"&&r%2===1?0:o.length-1;return!a||n===void 0?o[a]:n}const iR=40;class I_{constructor({autoplay:r=!0,delay:i=0,type:n="keyframes",repeat:o=0,repeatDelay:a=0,repeatType:l="loop",...d}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Wo.now(),this.options={autoplay:r,delay:i,type:n,repeat:o,repeatDelay:a,repeatType:l,...d},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>iR?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&YE(),this._resolved}onKeyframesResolved(r,i){this.resolvedAt=Wo.now(),this.hasAttemptedResolve=!0;const{name:n,type:o,velocity:a,delay:l,onComplete:d,onUpdate:p,isGenerator:u}=this.options;if(!u&&!tR(r,n,o,a))if(l)this.options.duration=0;else{p&&p(a0(r,this.options,i)),d&&d(),this.resolveFinishedPromise();return}const g=this.initPlayback(r,i);g!==!1&&(this._resolved={keyframes:r,finalKeyframe:i,...g},this.onPostResolved())}onPostResolved(){}then(r,i){return this.currentFinishedPromise.then(r,i)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(r=>{this.resolveFinishedPromise=r})}}const $r=(e,r,i)=>e+(r-e)*i;function dg(e,r,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+(r-e)*6*i:i<1/2?r:i<2/3?e+(r-e)*(2/3-i)*6:e}function nR({hue:e,saturation:r,lightness:i,alpha:n}){e/=360,r/=100,i/=100;let o=0,a=0,l=0;if(!r)o=a=l=i;else{const d=i<.5?i*(1+r):i+r-i*r,p=2*i-d;o=dg(p,d,e+1/3),a=dg(p,d,e),l=dg(p,d,e-1/3)}return{red:Math.round(o*255),green:Math.round(a*255),blue:Math.round(l*255),alpha:n}}function gh(e,r){return i=>i>0?r:e}const cg=(e,r,i)=>{const n=e*e,o=i*(r*r-n)+n;return o<0?0:Math.sqrt(o)},oR=[Uf,Ma,Ul],sR=e=>oR.find(r=>r.test(e));function $2(e){const r=sR(e);if(!r)return!1;let i=r.parse(e);return r===Ul&&(i=nR(i)),i}const W2=(e,r)=>{const i=$2(e),n=$2(r);if(!i||!n)return gh(e,r);const o={...i};return a=>(o.red=cg(i.red,n.red,a),o.green=cg(i.green,n.green,a),o.blue=cg(i.blue,n.blue,a),o.alpha=$r(i.alpha,n.alpha,a),Ma.transform(o))},aR=(e,r)=>i=>r(e(i)),vp=(...e)=>e.reduce(aR),Gf=new Set(["none","hidden"]);function lR(e,r){return Gf.has(e)?i=>i<=0?e:r:i=>i>=1?r:e}function dR(e,r){return i=>$r(e,r,i)}function Vm(e){return typeof e=="number"?dR:typeof e=="string"?km(e)?gh:Vi.test(e)?W2:uR:Array.isArray(e)?T_:typeof e=="object"?Vi.test(e)?W2:cR:gh}function T_(e,r){const i=[...e],n=i.length,o=e.map((a,l)=>Vm(a)(a,r[l]));return a=>{for(let l=0;l<n;l++)i[l]=o[l](a);return i}}function cR(e,r){const i={...e,...r},n={};for(const o in i)e[o]!==void 0&&r[o]!==void 0&&(n[o]=Vm(e[o])(e[o],r[o]));return o=>{for(const a in n)i[a]=n[a](o);return i}}function pR(e,r){var i;const n=[],o={color:0,var:0,number:0};for(let a=0;a<r.values.length;a++){const l=r.types[a],d=e.indexes[l][o[l]],p=(i=e.values[d])!==null&&i!==void 0?i:0;n[a]=p,o[l]++}return n}const uR=(e,r)=>{const i=ra.createTransformer(r),n=tp(e),o=tp(r);return n.indexes.var.length===o.indexes.var.length&&n.indexes.color.length===o.indexes.color.length&&n.indexes.number.length>=o.indexes.number.length?Gf.has(e)&&!o.values.length||Gf.has(r)&&!n.values.length?lR(e,r):vp(T_(pR(n,o),o.values),i):gh(e,r)};function A_(e,r,i){return typeof e=="number"&&typeof r=="number"&&typeof i=="number"?$r(e,r,i):Vm(e)(e,r)}const hR=5;function P_(e,r,i){const n=Math.max(r-hR,0);return s_(i-e(n),r-n)}const ri={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},pg=.001;function gR({duration:e=ri.duration,bounce:r=ri.bounce,velocity:i=ri.velocity,mass:n=ri.mass}){let o,a,l=1-r;l=xs(ri.minDamping,ri.maxDamping,l),e=xs(ri.minDuration,ri.maxDuration,Lo(e)),l<1?(o=u=>{const g=u*l,h=g*e,x=g-i,y=Jf(u,l),_=Math.exp(-h);return pg-x/y*_},a=u=>{const h=u*l*e,x=h*i+i,y=Math.pow(l,2)*Math.pow(u,2)*e,_=Math.exp(-h),S=Jf(Math.pow(u,2),l);return(-o(u)+pg>0?-1:1)*((x-y)*_)/S}):(o=u=>{const g=Math.exp(-u*e),h=(u-i)*e+1;return-pg+g*h},a=u=>{const g=Math.exp(-u*e),h=(i-u)*(e*e);return g*h});const d=5/e,p=xR(o,a,d);if(e=Oo(e),isNaN(p))return{stiffness:ri.stiffness,damping:ri.damping,duration:e};{const u=Math.pow(p,2)*n;return{stiffness:u,damping:l*2*Math.sqrt(n*u),duration:e}}}const fR=12;function xR(e,r,i){let n=i;for(let o=1;o<fR;o++)n=n-e(n)/r(n);return n}function Jf(e,r){return e*Math.sqrt(1-r*r)}const mR=["duration","bounce"],yR=["stiffness","damping","mass"];function N2(e,r){return r.some(i=>e[i]!==void 0)}function bR(e){let r={velocity:ri.velocity,stiffness:ri.stiffness,damping:ri.damping,mass:ri.mass,isResolvedFromDuration:!1,...e};if(!N2(e,yR)&&N2(e,mR))if(e.visualDuration){const i=e.visualDuration,n=2*Math.PI/(i*1.2),o=n*n,a=2*xs(.05,1,1-(e.bounce||0))*Math.sqrt(o);r={...r,mass:ri.mass,stiffness:o,damping:a}}else{const i=gR(e);r={...r,...i,mass:ri.mass},r.isResolvedFromDuration=!0}return r}function qm(e=ri.visualDuration,r=ri.bounce){const i=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:r}:e;let{restSpeed:n,restDelta:o}=i;const a=i.keyframes[0],l=i.keyframes[i.keyframes.length-1],d={done:!1,value:a},{stiffness:p,damping:u,mass:g,duration:h,velocity:x,isResolvedFromDuration:y}=bR({...i,velocity:-Lo(i.velocity||0)}),_=x||0,S=u/(2*Math.sqrt(p*g)),k=l-a,w=Lo(Math.sqrt(p/g)),b=Math.abs(k)<5;n||(n=b?ri.restSpeed.granular:ri.restSpeed.default),o||(o=b?ri.restDelta.granular:ri.restDelta.default);let j;if(S<1){const P=Jf(w,S);j=I=>{const R=Math.exp(-S*w*I);return l-R*((_+S*w*k)/P*Math.sin(P*I)+k*Math.cos(P*I))}}else if(S===1)j=P=>l-Math.exp(-w*P)*(k+(_+w*k)*P);else{const P=w*Math.sqrt(S*S-1);j=I=>{const R=Math.exp(-S*w*I),O=Math.min(P*I,300);return l-R*((_+S*w*k)*Math.sinh(O)+P*k*Math.cosh(O))/P}}const T={calculatedDuration:y&&h||null,next:P=>{const I=j(P);if(y)d.done=P>=h;else{let R=0;S<1&&(R=P===0?Oo(_):P_(j,P,I));const O=Math.abs(R)<=n,E=Math.abs(l-I)<=o;d.done=O&&E}return d.value=d.done?l:I,d},toString:()=>{const P=Math.min(Pm(T),uh),I=Kw(R=>T.next(P*R).value,P,30);return P+"ms "+I}};return T}function U2({keyframes:e,velocity:r=0,power:i=.8,timeConstant:n=325,bounceDamping:o=10,bounceStiffness:a=500,modifyTarget:l,min:d,max:p,restDelta:u=.5,restSpeed:g}){const h=e[0],x={done:!1,value:h},y=O=>d!==void 0&&O<d||p!==void 0&&O>p,_=O=>d===void 0?p:p===void 0||Math.abs(d-O)<Math.abs(p-O)?d:p;let S=i*r;const k=h+S,w=l===void 0?k:l(k);w!==k&&(S=w-h);const b=O=>-S*Math.exp(-O/n),j=O=>w+b(O),T=O=>{const E=b(O),$=j(O);x.done=Math.abs(E)<=u,x.value=x.done?w:$};let P,I;const R=O=>{y(x.value)&&(P=O,I=qm({keyframes:[x.value,_(x.value)],velocity:P_(j,O,x.value),damping:o,stiffness:a,restDelta:u,restSpeed:g}))};return R(0),{calculatedDuration:null,next:O=>{let E=!1;return!I&&P===void 0&&(E=!0,T(O),R(O)),P!==void 0&&O>=P?I.next(O-P):(!E&&T(O),x)}}}const vR=bp(.42,0,1,1),jR=bp(0,0,.58,1),F_=bp(.42,0,.58,1),M_=e=>Array.isArray(e)&&typeof e[0]!="number",wR={linear:In,easeIn:vR,easeInOut:F_,easeOut:jR,circIn:Lm,circInOut:f_,circOut:g_,backIn:Om,backInOut:u_,backOut:p_,anticipate:h_},V2=e=>{if(Fm(e)){Tw(e.length===4);const[r,i,n,o]=e;return bp(r,i,n,o)}else if(typeof e=="string")return wR[e];return e};function _R(e,r,i){const n=[],o=i||A_,a=e.length-1;for(let l=0;l<a;l++){let d=o(e[l],e[l+1]);if(r){const p=Array.isArray(r)?r[l]||In:r;d=vp(p,d)}n.push(d)}return n}function D_(e,r,{clamp:i=!0,ease:n,mixer:o}={}){const a=e.length;if(Tw(a===r.length),a===1)return()=>r[0];if(a===2&&r[0]===r[1])return()=>r[1];const l=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),r=[...r].reverse());const d=_R(r,n,o),p=d.length,u=g=>{if(l&&g<e[0])return r[0];let h=0;if(p>1)for(;h<e.length-2&&!(g<e[h+1]);h++);const x=Ka(e[h],e[h+1],g);return d[h](x)};return i?g=>u(xs(e[0],e[a-1],g)):u}function B_(e,r){const i=e[e.length-1];for(let n=1;n<=r;n++){const o=Ka(0,r,n);e.push($r(i,1,o))}}function O_(e){const r=[0];return B_(r,e.length-1),r}function SR(e,r){return e.map(i=>i*r)}function kR(e,r){return e.map(()=>r||F_).splice(0,e.length-1)}function fh({duration:e=300,keyframes:r,times:i,ease:n="easeInOut"}){const o=M_(n)?n.map(V2):V2(n),a={done:!1,value:r[0]},l=SR(i&&i.length===r.length?i:O_(r),e),d=D_(l,r,{ease:Array.isArray(o)?o:kR(r,o)});return{calculatedDuration:e,next:p=>(a.value=d(p),a.done=p>=e,a)}}const CR=e=>{const r=({timestamp:i})=>e(i);return{start:()=>Er.update(r,!0),stop:()=>fs(r),now:()=>Oi.isProcessing?Oi.timestamp:Wo.now()}},zR={decay:U2,inertia:U2,tween:fh,keyframes:fh,spring:qm},ER=e=>e/100;class Hm extends I_{constructor(r){super(r),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:p}=this.options;p&&p()};const{name:i,motionValue:n,element:o,keyframes:a}=this.options,l=(o==null?void 0:o.KeyframeResolver)||Um,d=(p,u)=>this.onKeyframesResolved(p,u);this.resolver=new l(a,d,i,n,o),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(r){const{type:i="keyframes",repeat:n=0,repeatDelay:o=0,repeatType:a,velocity:l=0}=this.options,d=o0(i)?i:zR[i]||fh;let p,u;d!==fh&&typeof r[0]!="number"&&(p=vp(ER,A_(r[0],r[1])),r=[0,100]);const g=d({...this.options,keyframes:r});a==="mirror"&&(u=d({...this.options,keyframes:[...r].reverse(),velocity:-l})),g.calculatedDuration===null&&(g.calculatedDuration=Pm(g));const{calculatedDuration:h}=g,x=h+o,y=x*(n+1)-o;return{generator:g,mirroredGenerator:u,mapPercentToKeyframes:p,calculatedDuration:h,resolvedDuration:x,totalDuration:y}}onPostResolved(){const{autoplay:r=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!r?this.pause():this.state=this.pendingPlayState}tick(r,i=!1){const{resolved:n}=this;if(!n){const{keyframes:O}=this.options;return{done:!0,value:O[O.length-1]}}const{finalKeyframe:o,generator:a,mirroredGenerator:l,mapPercentToKeyframes:d,keyframes:p,calculatedDuration:u,totalDuration:g,resolvedDuration:h}=n;
vendor: 59,760 bytes, line 117
117if(this.startTime===null)return a.next(0);const{delay:x,repeat:y,repeatType:_,repeatDelay:S,onUpdate:k}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,r):this.speed<0&&(this.startTime=Math.min(r-g/this.speed,this.startTime)),i?this.currentTime=r:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(r-this.startTime)*this.speed;const w=this.currentTime-x*(this.speed>=0?1:-1),b=this.speed>=0?w<0:w>g;this.currentTime=Math.max(w,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=g);let j=this.currentTime,T=a;if(y){const O=Math.min(this.currentTime,g)/h;let E=Math.floor(O),$=O%1;!$&&O>=1&&($=1),$===1&&E--,E=Math.min(E,y+1),!!(E%2)&&(_==="reverse"?($=1-$,S&&($-=S/h)):_==="mirror"&&(T=l)),j=xs(0,1,$)*h}const P=b?{done:!1,value:p[0]}:T.next(j);d&&(P.value=d(P.value));let{done:I}=P;!b&&u!==null&&(I=this.speed>=0?this.currentTime>=g:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&I);return R&&o!==void 0&&(P.value=a0(p,this.options,o)),k&&k(P.value),R&&this.finish(),P}get duration(){const{resolved:r}=this;return r?Lo(r.calculatedDuration):0}get time(){return Lo(this.currentTime)}set time(r){r=Oo(r),this.currentTime=r,this.holdTime!==null||this.speed===0?this.holdTime=r:this.driver&&(this.startTime=this.driver.now()-r/this.speed)}get speed(){return this.playbackSpeed}set speed(r){const i=this.playbackSpeed!==r;this.playbackSpeed=r,i&&(this.time=Lo(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:r=CR,onPlay:i,startTime:n}=this.options;this.driver||(this.driver=r(a=>this.tick(a))),i&&i();const o=this.driver.now();this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=o):this.startTime=n??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var r;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(r=this.currentTime)!==null&&r!==void 0?r:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:r}=this.options;r&&r()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(r){return this.startTime=0,this.tick(r,!0)}}const RR=new Set(["opacity","clipPath","filter","transform"]);function IR(e,r,i,{delay:n=0,duration:o=300,repeat:a=0,repeatType:l="loop",ease:d="easeInOut",times:p}={}){const u={[r]:i};p&&(u.offset=p);const g=e_(d,o);return Array.isArray(g)&&(u.easing=g),e.animate(u,{delay:n,duration:o,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:a+1,direction:l==="reverse"?"alternate":"normal"})}const TR=ym(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),xh=10,AR=2e4;function PR(e){return o0(e.type)||e.type==="spring"||!Qw(e.ease)}function FR(e,r){const i=new Hm({...r,keyframes:e,repeat:0,delay:0,isGenerator:!0});let n={done:!1,value:e[0]};const o=[];let a=0;for(;!n.done&&a<AR;)n=i.sample(a),o.push(n.value),a+=xh;return{times:void 0,keyframes:o,duration:a-xh,ease:"linear"}}const L_={anticipate:h_,backInOut:u_,circInOut:f_};function MR(e){return e in L_}class q2 extends I_{constructor(r){super(r);const{name:i,motionValue:n,element:o,keyframes:a}=this.options;this.resolver=new R_(a,(l,d)=>this.onKeyframesResolved(l,d),i,n,o),this.resolver.scheduleResolve()}initPlayback(r,i){let{duration:n=300,times:o,ease:a,type:l,motionValue:d,name:p,startTime:u}=this.options;if(!d.owner||!d.owner.current)return!1;if(typeof a=="string"&&hh()&&MR(a)&&(a=L_[a]),PR(this.options)){const{onComplete:h,onUpdate:x,motionValue:y,element:_,...S}=this.options,k=FR(r,S);r=k.keyframes,r.length===1&&(r[1]=r[0]),n=k.duration,o=k.times,a=k.ease,l="keyframes"}const g=IR(d.owner.current,p,r,{...this.options,duration:n,times:o,ease:a});return g.startTime=u??this.calcStartTime(),this.pendingTimeline?(R2(g,this.pendingTimeline),this.pendingTimeline=void 0):g.onfinish=()=>{const{onComplete:h}=this.options;d.set(a0(r,this.options,i)),h&&h(),this.cancel(),this.resolveFinishedPromise()},{animation:g,duration:n,times:o,type:l,ease:a,keyframes:r}}get duration(){const{resolved:r}=this;if(!r)return 0;const{duration:i}=r;return Lo(i)}get time(){const{resolved:r}=this;if(!r)return 0;const{animation:i}=r;return Lo(i.currentTime||0)}set time(r){const{resolved:i}=this;if(!i)return;const{animation:n}=i;n.currentTime=Oo(r)}get speed(){const{resolved:r}=this;if(!r)return 1;const{animation:i}=r;return i.playbackRate}set speed(r){const{resolved:i}=this;if(!i)return;const{animation:n}=i;n.playbackRate=r}get state(){const{resolved:r}=this;if(!r)return"idle";const{animation:i}=r;return i.playState}get startTime(){const{resolved:r}=this;if(!r)return null;const{animation:i}=r;return i.startTime}attachTimeline(r){if(!this._resolved)this.pendingTimeline=r;else{const{resolved:i}=this;if(!i)return In;const{animation:n}=i;R2(n,r)}return In}play(){if(this.isStopped)return;const{resolved:r}=this;if(!r)return;const{animation:i}=r;i.playState==="finished"&&this.updateFinishedPromise(),i.play()}pause(){const{resolved:r}=this;if(!r)return;const{animation:i}=r;i.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:r}=this;if(!r)return;const{animation:i,keyframes:n,duration:o,type:a,ease:l,times:d}=r;if(i.playState==="idle"||i.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:g,onComplete:h,element:x,...y}=this.options,_=new Hm({...y,keyframes:n,duration:o,type:a,ease:l,times:d,isGenerator:!0}),S=Oo(this.time);u.setWithVelocity(_.sample(S-xh).value,_.sample(S).value,xh)}const{onStop:p}=this.options;p&&p(),this.cancel()}complete(){const{resolved:r}=this;r&&r.animation.finish()}cancel(){const{resolved:r}=this;r&&r.animation.cancel()}static supports(r){const{motionValue:i,name:n,repeatDelay:o,repeatType:a,damping:l,type:d}=r;if(!i||!i.owner||!(i.owner.current instanceof HTMLElement))return!1;const{onUpdate:p,transformTemplate:u}=i.owner.getProps();return TR()&&n&&RR.has(n)&&!p&&!u&&!o&&a!=="mirror"&&l!==0&&d!=="inertia"}}const DR={type:"spring",stiffness:500,damping:25,restSpeed:10},BR=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),OR={type:"keyframes",duration:.8},LR={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},$R=(e,{keyframes:r})=>r.length>2?OR:sl.has(e)?e.startsWith("scale")?BR(r[1]):DR:LR;function WR({when:e,delay:r,delayChildren:i,staggerChildren:n,staggerDirection:o,repeat:a,repeatType:l,repeatDelay:d,from:p,elapsed:u,...g}){return!!Object.keys(g).length}const Gm=(e,r,i,n={},o,a)=>l=>{const d=Am(n,e)||{},p=d.delay||n.delay||0;let{elapsed:u=0}=n;u=u-Oo(p);let g={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:r.getVelocity(),...d,delay:-u,onUpdate:x=>{r.set(x),d.onUpdate&&d.onUpdate(x)},onComplete:()=>{l(),d.onComplete&&d.onComplete()},name:e,motionValue:r,element:a?void 0:o};WR(d)||(g={...g,...$R(e,g)}),g.duration&&(g.duration=Oo(g.duration)),g.repeatDelay&&(g.repeatDelay=Oo(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let h=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(g.duration=0,g.delay===0&&(h=!0)),h&&!a&&r.get()!==void 0){const x=a0(g.keyframes,d);if(x!==void 0)return Er.update(()=>{g.onUpdate(x),g.onComplete()}),new Xw([])}return!a&&q2.supports(g)?new q2(g):new Hm(g)};function NR({protectedKeys:e,needsAnimating:r},i){const n=e.hasOwnProperty(i)&&r[i]!==!0;return r[i]=!1,n}function Jm(e,r,{delay:i=0,transitionOverride:n,type:o}={}){var a;let{transition:l=e.getDefaultTransition(),transitionEnd:d,...p}=r;n&&(l=n);const u=[],g=o&&e.animationState&&e.animationState.getState()[o];for(const h in p){const x=e.getValue(h,(a=e.latestValues[h])!==null&&a!==void 0?a:null),y=p[h];if(y===void 0||g&&NR(g,h))continue;const _={delay:i,...Am(l||{},h)};let S=!1;if(window.MotionHandoffAnimation){const w=a_(e);if(w){const b=window.MotionHandoffAnimation(w,h,Er);b!==null&&(_.startTime=b,S=!0)}}Nf(e,h),x.start(Gm(h,x,y,e.shouldReduceMotion&&o_.has(h)?{type:!1}:_,e,S));const k=x.animation;k&&u.push(k)}return d&&Promise.all(u).then(()=>{Er.update(()=>{d&&SE(e,d)})}),u}function Zf(e,r,i={}){var n;const o=n0(e,r,i.type==="exit"?(n=e.presenceContext)===null||n===void 0?void 0:n.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=o||{};i.transitionOverride&&(a=i.transitionOverride);const l=o?()=>Promise.all(Jm(e,o,i)):()=>Promise.resolve(),d=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:g=0,staggerChildren:h,staggerDirection:x}=a;return UR(e,r,g+u,h,x,i)}:()=>Promise.resolve(),{when:p}=a;if(p){const[u,g]=p==="beforeChildren"?[l,d]:[d,l];return u().then(()=>g())}else return Promise.all([l(),d(i.delay)])}function UR(e,r,i=0,n=0,o=1,a){const l=[],d=(e.variantChildren.size-1)*n,p=o===1?(u=0)=>u*n:(u=0)=>d-u*n;return Array.from(e.variantChildren).sort(VR).forEach((u,g)=>{u.notify("AnimationStart",r),l.push(Zf(u,r,{...a,delay:i+p(g)}).then(()=>u.notify("AnimationComplete",r)))}),Promise.all(l)}function VR(e,r){return e.sortNodePosition(r)}function qR(e,r,i={}){e.notify("AnimationStart",r);let n;if(Array.isArray(r)){const o=r.map(a=>Zf(e,a,i));n=Promise.all(o)}else if(typeof r=="string")n=Zf(e,r,i);else{const o=typeof r=="function"?n0(e,r,i.custom):r;n=Promise.all(Jm(e,o,i))}return n.then(()=>{e.notify("AnimationComplete",r)})}const HR=vm.length;function $_(e){if(!e)return;if(!e.isControllingVariants){const i=e.parent?$_(e.parent)||{}:{};return e.props.initial!==void 0&&(i.initial=e.props.initial),i}const r={};for(let i=0;i<HR;i++){const n=vm[i],o=e.props[n];(Qc(o)||o===!1)&&(r[n]=o)}return r}const GR=[...bm].reverse(),JR=bm.length;function ZR(e){return r=>Promise.all(r.map(({animation:i,options:n})=>qR(e,i,n)))}function YR(e){let r=ZR(e),i=H2(),n=!0;const o=p=>(u,g)=>{var h;const x=n0(e,g,p==="exit"?(h=e.presenceContext)===null||h===void 0?void 0:h.custom:void 0);if(x){const{transition:y,transitionEnd:_,...S}=x;u={...u,...S,..._}}return u};function a(p){r=p(e)}function l(p){const{props:u}=e,g=$_(e.parent)||{},h=[],x=new Set;let y={},_=1/0;for(let k=0;k<JR;k++){const w=GR[k],b=i[w],j=u[w]!==void 0?u[w]:g[w],T=Qc(j),P=w===p?b.isActive:null;P===!1&&(_=k);let I=j===g[w]&&j!==u[w]&&T;if(I&&n&&e.manuallyAnimateOnMount&&(I=!1),b.protectedKeys={...y},!b.isActive&&P===null||!j&&!b.prevProp||r0(j)||typeof j=="boolean")continue;const R=XR(b.prevProp,j);let O=R||w===p&&b.isActive&&!I&&T||k>_&&T,E=!1;const $=Array.isArray(j)?j:[j];let B=$.reduce(o(w),{});P===!1&&(B={});const{prevResolvedValues:ee={}}=b,te={...ee,...B},K=Q=>{O=!0,x.has(Q)&&(E=!0,x.delete(Q)),b.needsAnimating[Q]=!0;const G=e.getValue(Q);G&&(G.liveStyle=!1)};for(const Q in te){const G=B[Q],le=ee[Q];if(y.hasOwnProperty(Q))continue;let F=!1;$f(G)&&$f(le)?F=!Yw(G,le):F=G!==le,F?G!=null?K(Q):x.add(Q):G!==void 0&&x.has(Q)?K(Q):b.protectedKeys[Q]=!0}b.prevProp=j,b.prevResolvedValues=B,b.isActive&&(y={...y,...B}),n&&e.blockInitialAnimation&&(O=!1),O&&(!(I&&R)||E)&&h.push(...$.map(Q=>({animation:Q,options:{type:w}})))}if(x.size){const k={};x.forEach(w=>{const b=e.getBaseTarget(w),j=e.getValue(w);j&&(j.liveStyle=!0),k[w]=b??null}),h.push({animation:k})}let S=!!h.length;return n&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(S=!1),n=!1,S?r(h):Promise.resolve()}function d(p,u){var g;if(i[p].isActive===u)return Promise.resolve();(g=e.variantChildren)===null||g===void 0||g.forEach(x=>{var y;return(y=x.animationState)===null||y===void 0?void 0:y.setActive(p,u)}),i[p].isActive=u;const h=l(p);for(const x in i)i[x].protectedKeys={};return h}return{animateChanges:l,setActive:d,setAnimateFunction:a,getState:()=>i,reset:()=>{i=H2(),n=!0}}}function XR(e,r){return typeof r=="string"?r!==e:Array.isArray(r)?!Yw(r,e):!1}function ya(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function H2(){return{animate:ya(!0),whileInView:ya(),whileHover:ya(),whileTap:ya(),whileDrag:ya(),whileFocus:ya(),exit:ya()}}class la{constructor(r){this.isMounted=!1,this.node=r}update(){}}class KR extends la{constructor(r){super(r),r.animationState||(r.animationState=YR(r))}updateAnimationControlsSubscription(){const{animate:r}=this.node.getProps();r0(r)&&(this.unmountControls=r.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:r}=this.node.getProps(),{animate:i}=this.node.prevProps||{};r!==i&&this.updateAnimationControlsSubscription()}unmount(){var r;this.node.animationState.reset(),(r=this.unmountControls)===null||r===void 0||r.call(this)}}let QR=0;class eI extends la{constructor(){super(...arguments),this.id=QR++}update(){if(!this.node.presenceContext)return;const{isPresent:r,onExitComplete:i}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||r===n)return;const o=this.node.animationState.setActive("exit",!r);i&&!r&&o.then(()=>i(this.id))}mount(){const{register:r}=this.node.presenceContext||{};r&&(this.unmount=r(this.id))}unmount(){}}const tI={animation:{Feature:KR},exit:{Feature:eI}};function rp(e,r,i,n={passive:!0}){return e.addEventListener(r,i,n),()=>e.removeEventListener(r,i)}function jp(e){return{point:{x:e.pageX,y:e.pageY}}}const rI=e=>r=>Mm(r)&&e(r,jp(r));function wc(e,r,i,n){return rp(e,r,rI(i),n)}const G2=(e,r)=>Math.abs(e-r);function iI(e,r){const i=G2(e.x,r.x),n=G2(e.y,r.y);return Math.sqrt(i**2+n**2)}class W_{constructor(r,i,{transformPagePoint:n,contextWindow:o,dragSnapToOrigin:a=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=hg(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,y=iI(h.offset,{x:0,y:0})>=3;if(!x&&!y)return;const{point:_}=h,{timestamp:S}=Oi;this.history.push({..._,timestamp:S});const{onStart:k,onMove:w}=this.handlers;x||(k&&k(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,h)},this.handlePointerMove=(h,x)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=ug(x,this.transformPagePoint),Er.update(this.updatePoint,!0)},this.handlePointerUp=(h,x)=>{this.end();const{onEnd:y,onSessionEnd:_,resumeAnimation:S}=this.handlers;if(this.dragSnapToOrigin&&S&&S(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const k=hg(h.type==="pointercancel"?this.lastMoveEventInfo:ug(x,this.transformPagePoint),this.history);this.startEvent&&y&&y(h,k),_&&_(h,k)},!Mm(r))return;this.dragSnapToOrigin=a,this.handlers=i,this.transformPagePoint=n,this.contextWindow=o||window;const l=jp(r),d=ug(l,this.transformPagePoint),{point:p}=d,{timestamp:u}=Oi;this.history=[{...p,timestamp:u}];const{onSessionStart:g}=i;g&&g(r,hg(d,this.history)),this.removeListeners=vp(wc(this.contextWindow,"pointermove",this.handlePointerMove),wc(this.contextWindow,"pointerup",this.handlePointerUp),wc(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(r){this.handlers=r}end(){this.removeListeners&&this.removeListeners(),fs(this.updatePoint)}}function ug(e,r){return r?{point:r(e.point)}:e}function J2(e,r){return{x:e.x-r.x,y:e.y-r.y}}function hg({point:e},r){return{point:e,delta:J2(e,N_(r)),offset:J2(e,nI(r)),velocity:oI(r,.1)}}function nI(e){return e[0]}function N_(e){return e[e.length-1]}function oI(e,r){if(e.length<2)return{x:0,y:0};let i=e.length-1,n=null;const o=N_(e);for(;i>=0&&(n=e[i],!(o.timestamp-n.timestamp>Oo(r)));)i--;if(!n)return{x:0,y:0};const a=Lo(o.timestamp-n.timestamp);if(a===0)return{x:0,y:0};const l={x:(o.x-n.x)/a,y:(o.y-n.y)/a};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}const U_=1e-4,sI=1-U_,aI=1+U_,V_=.01,lI=0-V_,dI=0+V_;function An(e){return e.max-e.min}function cI(e,r,i){return Math.abs(e-r)<=i}function Z2(e,r,i,n=.5){e.origin=n,e.originPoint=$r(r.min,r.max,e.origin),e.scale=An(i)/An(r),e.translate=$r(i.min,i.max,e.origin)-e.originPoint,(e.scale>=sI&&e.scale<=aI||isNaN(e.scale))&&(e.scale=1),(e.translate>=lI&&e.translate<=dI||isNaN(e.translate))&&(e.translate=0)}function _c(e,r,i,n){Z2(e.x,r.x,i.x,n?n.originX:void 0),Z2(e.y,r.y,i.y,n?n.originY:void 0)}function Y2(e,r,i){e.min=i.min+r.min,e.max=e.min+An(r)}function pI(e,r,i){Y2(e.x,r.x,i.x),Y2(e.y,r.y,i.y)}function X2(e,r,i){e.min=r.min-i.min,e.max=e.min+An(r)}function Sc(e,r,i){X2(e.x,r.x,i.x),X2(e.y,r.y,i.y)}function uI(e,{min:r,max:i},n){return r!==void 0&&e<r?e=n?$r(r,e,n.min):Math.max(e,r):i!==void 0&&e>i&&(e=n?$r(i,e,n.max):Math.min(e,i)),e}function K2(e,r,i){return{min:r!==void 0?e.min+r:void 0,max:i!==void 0?e.max+i-(e.max-e.min):void 0}}function hI(e,{top:r,left:i,bottom:n,right:o}){return{x:K2(e.x,i,o),y:K2(e.y,r,n)}}function Q2(e,r){let i=r.min-e.min,n=r.max-e.max;return r.max-r.min<e.max-e.min&&([i,n]=[n,i]),{min:i,max:n}}function gI(e,r){return{x:Q2(e.x,r.x),y:Q2(e.y,r.y)}}function fI(e,r){let i=.5;const n=An(e),o=An(r);return o>n?i=Ka(r.min,r.max-n,e.min):n>o&&(i=Ka(e.min,e.max-o,r.min)),xs(0,1,i)}function xI(e,r){const i={};return r.min!==void 0&&(i.min=r.min-e.min),r.max!==void 0&&(i.max=r.max-e.min),i}const Yf=.35;function mI(e=Yf){return e===!1?e=0:e===!0&&(e=Yf),{x:eb(e,"left","right"),y:eb(e,"top","bottom")}}function eb(e,r,i){return{min:tb(e,r),max:tb(e,i)}}function tb(e,r){return typeof e=="number"?e:e[r]||0}const rb=()=>({translate:0,scale:1,origin:0,originPoint:0}),Vl=()=>({x:rb(),y:rb()}),ib=()=>({min:0,max:0}),ei=()=>({x:ib(),y:ib()});function Hn(e){return[e("x"),e("y")]}function q_({top:e,left:r,right:i,bottom:n}){return{x:{min:r,max:i},y:{min:e,max:n}}}function yI({x:e,y:r}){return{top:r.min,right:e.max,bottom:r.max,left:e.min}}function bI(e,r){if(!r)return e;const i=r({x:e.left,y:e.top}),n=r({x:e.right,y:e.bottom});return{top:i.y,left:i.x,bottom:n.y,right:n.x}}function gg(e){return e===void 0||e===1}function Xf({scale:e,scaleX:r,scaleY:i}){return!gg(e)||!gg(r)||!gg(i)}function ka(e){return Xf(e)||H_(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function H_(e){return nb(e.x)||nb(e.y)}function nb(e){return e&&e!=="0%"}function mh(e,r,i){const n=e-i,o=r*n;return i+o}function ob(e,r,i,n,o){return o!==void 0&&(e=mh(e,o,n)),mh(e,i,n)+r}function Kf(e,r=0,i=1,n,o){e.min=ob(e.min,r,i,n,o),e.max=ob(e.max,r,i,n,o)}function G_(e,{x:r,y:i}){Kf(e.x,r.translate,r.scale,r.originPoint),Kf(e.y,i.translate,i.scale,i.originPoint)}const sb=.999999999999,ab=1.0000000000001;function vI(e,r,i,n=!1){const o=i.length;if(!o)return;r.x=r.y=1;let a,l;for(let d=0;d<o;d++){a=i[d],l=a.projectionDelta;const{visualElement:p}=a.options;p&&p.props.style&&p.props.style.display==="contents"||(n&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Hl(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),l&&(r.x*=l.x.scale,r.y*=l.y.scale,G_(e,l)),n&&ka(a.latestValues)&&Hl(e,a.latestValues))}r.x<ab&&r.x>sb&&(r.x=1),r.y<ab&&r.y>sb&&(r.y=1)}function ql(e,r){e.min=e.min+r,e.max=e.max+r}function lb(e,r,i,n,o=.5){const a=$r(e.min,e.max,o);Kf(e,r,i,a,n)}function Hl(e,r){lb(e.x,r.x,r.scaleX,r.scale,r.originX),lb(e.y,r.y,r.scaleY,r.scale,r.originY)}function J_(e,r){return q_(bI(e.getBoundingClientRect(),r))}function jI(e,r,i){const n=J_(e,i),{scroll:o}=r;return o&&(ql(n.x,o.offset.x),ql(n.y,o.offset.y)),n}const Z_=({current:e})=>e?e.ownerDocument.defaultView:null,wI=new WeakMap;class _I{constructor(r){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ei(),this.visualElement=r}start(r,{snapToCursor:i=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;const o=g=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),i&&this.snapToCursor(jp(g).point)},a=(g,h)=>{const{drag:x,dragPropagation:y,onDragStart:_}=this.getProps();if(x&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=bE(x),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Hn(k=>{let w=this.getAxisMotionValue(k).get()||0;if($o.test(w)){const{projection:b}=this.visualElement;if(b&&b.layout){const j=b.layout.layoutBox[k];j&&(w=An(j)*(parseFloat(w)/100))}}this.originPoint[k]=w}),_&&Er.postRender(()=>_(g,h)),Nf(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},l=(g,h)=>{const{dragPropagation:x,dragDirectionLock:y,onDirectionLock:_,onDrag:S}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:k}=h;if(y&&this.currentDirection===null){this.currentDirection=SI(k),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",h.point,k),this.updateAxis("y",h.point,k),this.visualElement.render(),S&&S(g,h)},d=(g,h)=>this.stop(g,h),p=()=>Hn(g=>{var h;return this.getAnimationState(g)==="paused"&&((h=this.getAxisMotionValue(g).animation)===null||h===void 0?void 0:h.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new W_(r,{onSessionStart:o,onStart:a,onMove:l,onSessionEnd:d,resumeAnimation:p},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Z_(this.visualElement)})}stop(r,i){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&Er.postRender(()=>a(r,i))}cancel(){this.isDragging=!1;const{projection:r,animationState:i}=this.visualElement;r&&(r.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}updateAxis(r,i,n){const{drag:o}=this.getProps();if(!n||!cu(r,o,this.currentDirection))return;const a=this.getAxisMotionValue(r);let l=this.originPoint[r]+n[r];this.constraints&&this.constraints[r]&&(l=uI(l,this.constraints[r],this.elastic[r])),a.set(l)}resolveConstraints(){var r;const{dragConstraints:i,dragElastic:n}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(r=this.visualElement.projection)===null||r===void 0?void 0:r.layout,a=this.constraints;i&&Nl(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&o?this.constraints=hI(o.layoutBox,i):this.constraints=!1,this.elastic=mI(n),a!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&Hn(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=xI(o.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:r,onMeasureDragConstraints:i}=this.getProps();if(!r||!Nl(r))return!1;const n=r.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const a=jI(n,o.root,this.visualElement.getTransformPagePoint());let l=gI(o.layout.layoutBox,a);if(i){const d=i(yI(l));this.hasMutatedConstraints=!!d,d&&(l=q_(d))}return l}startAnimation(r){const{drag:i,dragMomentum:n,dragElastic:o,dragTransition:a,dragSnapToOrigin:l,onDragTransitionEnd:d}=this.getProps(),p=this.constraints||{},u=Hn(g=>{if(!cu(g,i,this.currentDirection))return;let h=p&&p[g]||{};l&&(h={min:0,max:0});const x=o?200:1e6,y=o?40:1e7,_={type:"inertia",velocity:n?r[g]:0,bounceStiffness:x,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...a,...h};return this.startAxisValueAnimation(g,_)});return Promise.all(u).then(d)}startAxisValueAnimation(r,i){const n=this.getAxisMotionValue(r);return Nf(this.visualElement,r),n.start(Gm(r,n,0,i,this.visualElement,!1))}stopAnimation(){Hn(r=>this.getAxisMotionValue(r).stop())}pauseAnimation(){Hn(r=>{var i;return(i=this.getAxisMotionValue(r).animation)===null||i===void 0?void 0:i.pause()})}getAnimationState(r){var i;return(i=this.getAxisMotionValue(r).animation)===null||i===void 0?void 0:i.state}getAxisMotionValue(r){const i=`_drag${r.toUpperCase()}`,n=this.visualElement.getProps(),o=n[i];return o||this.visualElement.getValue(r,(n.initial?n.initial[r]:void 0)||0)}snapToCursor(r){Hn(i=>{const{drag:n}=this.getProps();if(!cu(i,n,this.currentDirection))return;const{projection:o}=this.visualElement,a=this.getAxisMotionValue(i);if(o&&o.layout){const{min:l,max:d}=o.layout.layoutBox[i];a.set(r[i]-$r(l,d,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:r,dragConstraints:i}=this.getProps(),{projection:n}=this.visualElement;if(!Nl(i)||!n||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Hn(l=>{const d=this.getAxisMotionValue(l);if(d&&this.constraints!==!1){const p=d.get();o[l]=fI({min:p,max:p},this.constraints[l])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Hn(l=>{if(!cu(l,r,null))return;const d=this.getAxisMotionValue(l),{min:p,max:u}=this.constraints[l];d.set($r(p,u,o[l]))})}addListeners(){if(!this.visualElement.current)return;wI.set(this.visualElement,this);const r=this.visualElement.current,i=wc(r,"pointerdown",p=>{const{drag:u,dragListener:g=!0}=this.getProps();u&&g&&this.start(p)}),n=()=>{const{dragConstraints:p}=this.getProps();Nl(p)&&p.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,a=o.addEventListener("measure",n);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Er.read(n);const l=rp(window,"resize",()=>this.scalePositionWithinConstraints()),d=o.addEventListener("didUpdate",({delta:p,hasLayoutChanged:u})=>{this.isDragging&&u&&(Hn(g=>{const h=this.getAxisMotionValue(g);h&&(this.originPoint[g]+=p[g].translate,h.set(h.get()+p[g].translate))}),this.visualElement.render())});return()=>{l(),i(),a(),d&&d()}}getProps(){const r=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:n=!1,dragPropagation:o=!1,dragConstraints:a=!1,dragElastic:l=Yf,dragMomentum:d=!0}=r;return{...r,drag:i,dragDirectionLock:n,dragPropagation:o,dragConstraints:a,dragElastic:l,dragMomentum:d}}}function cu(e,r,i){return(r===!0||r===e)&&(i===null||i===e)}function SI(e,r=10){let i=null;return Math.abs(e.y)>r?i="y":Math.abs(e.x)>r&&(i="x"),i}class kI extends la{constructor(r){super(r),this.removeGroupControls=In,this.removeListeners=In,this.controls=new _I(r)}mount(){const{dragControls:r}=this.node.getProps();r&&(this.removeGroupControls=r.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||In}unmount(){this.removeGroupControls(),this.removeListeners()}}const db=e=>(r,i)=>{e&&Er.postRender(()=>e(r,i))};class CI extends la{constructor(){super(...arguments),this.removePointerDownListener=In}onPointerDown(r){this.session=new W_(r,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Z_(this.node)})}createPanHandlers(){const{onPanSessionStart:r,onPanStart:i,onPan:n,onPanEnd:o}=this.node.getProps();return{onSessionStart:db(r),onStart:db(i),onMove:n,onEnd:(a,l)=>{delete this.session,o&&Er.postRender(()=>o(a,l))}}}mount(){this.removePointerDownListener=wc(this.node.current,"pointerdown",r=>this.onPointerDown(r))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Tu={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function cb(e,r){return r.max===r.min?0:e/(r.max-r.min)*100}const Jd={correct:(e,r)=>{if(!r.target)return e;if(typeof e=="string")if(_t.test(e))e=parseFloat(e);else return e;const i=cb(e,r.target.x),n=cb(e,r.target.y);return`${i}% ${n}%`}},zI={correct:(e,{treeScale:r,projectionDelta:i})=>{const n=e,o=ra.parse(e);if(o.length>5)return n;const a=ra.createTransformer(e),l=typeof o[0]!="number"?1:0,d=i.x.scale*r.x,p=i.y.scale*r.y;o[0+l]/=d,o[1+l]/=p;const u=$r(d,p,.5);return typeof o[2+l]=="number"&&(o[2+l]/=u),typeof o[3+l]=="number"&&(o[3+l]/=u),a(o)}};class EI extends m.Component{componentDidMount(){const{visualElement:r,layoutGroup:i,switchLayoutGroup:n,layoutId:o}=this.props,{projection:a}=r;Qz(RI),a&&(i.group&&i.group.add(a),n&&n.register&&o&&n.register(a),a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),Tu.hasEverUpdated=!0}getSnapshotBeforeUpdate(r){const{layoutDependency:i,visualElement:n,drag:o,isPresent:a}=this.props,l=n.projection;return l&&(l.isPresent=a,o||r.layoutDependency!==i||i===void 0?l.willUpdate():this.safeToRemove(),r.isPresent!==a&&(a?l.promote():l.relegate()||Er.postRender(()=>{const d=l.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:r}=this.props.visualElement;r&&(r.root.didUpdate(),wm.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:r,layoutGroup:i,switchLayoutGroup:n}=this.props,{projection:o}=r;o&&(o.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(o),n&&n.deregister&&n.deregister(o))}safeToRemove(){const{safeToRemove:r}=this.props;r&&r()}render(){return null}}function Y_(e){const[r,i]=Iw(),n=m.useContext(fm);return t.jsx(EI,{...e,layoutGroup:n,switchLayoutGroup:m.useContext(Bw),isPresent:r,safeToRemove:i})}const RI={borderRadius:{...Jd,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Jd,borderTopRightRadius:Jd,borderBottomLeftRadius:Jd,borderBottomRightRadius:Jd,boxShadow:zI};function X_(e,r,i){const n=Ri(e)?e:yd(e);return n.start(Gm("",n,r,i)),n.animation}function K_(e){return e instanceof SVGElement&&e.tagName!=="svg"}const II=(e,r)=>e.depth-r.depth;class TI{constructor(){this.children=[],this.isDirty=!1}add(r){Dm(this.children,r),this.isDirty=!0}remove(r){s0(this.children,r),this.isDirty=!0}forEach(r){this.isDirty&&this.children.sort(II),this.isDirty=!1,this.children.forEach(r)}}function AI(e,r){const i=Wo.now(),n=({timestamp:o})=>{const a=o-i;a>=r&&(fs(n),e(a-r))};return Er.read(n,!0),()=>fs(n)}const Q_=["TopLeft","TopRight","BottomLeft","BottomRight"],PI=Q_.length,pb=e=>typeof e=="string"?parseFloat(e):e,ub=e=>typeof e=="number"||_t.test(e);function FI(e,r,i,n,o,a){o?(e.opacity=$r(0,i.opacity!==void 0?i.opacity:1,MI(n)),e.opacityExit=$r(r.opacity!==void 0?r.opacity:1,0,DI(n))):a&&(e.opacity=$r(r.opacity!==void 0?r.opacity:1,i.opacity!==void 0?i.opacity:1,n));for(let l=0;l<PI;l++){const d=`border${Q_[l]}Radius`;let p=hb(r,d),u=hb(i,d);if(p===void 0&&u===void 0)continue;p||(p=0),u||(u=0),p===0||u===0||ub(p)===ub(u)?(e[d]=Math.max($r(pb(p),pb(u),n),0),($o.test(u)||$o.test(p))&&(e[d]+="%")):e[d]=u}(r.rotate||i.rotate)&&(e.rotate=$r(r.rotate||0,i.rotate||0,n))}function hb(e,r){return e[r]!==void 0?e[r]:e.borderRadius}const MI=eS(0,.5,g_),DI=eS(.5,.95,In);function eS(e,r,i){return n=>n<e?0:n>r?1:i(Ka(e,r,n))}function gb(e,r){e.min=r.min,e.max=r.max}function qn(e,r){gb(e.x,r.x),gb(e.y,r.y)}function fb(e,r){e.translate=r.translate,e.scale=r.scale,e.originPoint=r.originPoint,e.origin=r.origin}function xb(e,r,i,n,o){return e-=r,e=mh(e,1/i,n),o!==void 0&&(e=mh(e,1/o,n)),e}function BI(e,r=0,i=1,n=.5,o,a=e,l=e){if($o.test(r)&&(r=parseFloat(r),r=$r(l.min,l.max,r/100)-l.min),typeof r!="number")return;let d=$r(a.min,a.max,n);e===a&&(d-=r),e.min=xb(e.min,r,i,d,o),e.max=xb(e.max,r,i,d,o)}function mb(e,r,[i,n,o],a,l){BI(e,r[i],r[n],r[o],r.scale,a,l)}const OI=["x","scaleX","originX"],LI=["y","scaleY","originY"];function yb(e,r,i,n){mb(e.x,r,OI,i?i.x:void 0,n?n.x:void 0),mb(e.y,r,LI,i?i.y:void 0,n?n.y:void 0)}function bb(e){return e.translate===0&&e.scale===1}function tS(e){return bb(e.x)&&bb(e.y)}function vb(e,r){return e.min===r.min&&e.max===r.max}function $I(e,r){return vb(e.x,r.x)&&vb(e.y,r.y)}function jb(e,r){return Math.round(e.min)===Math.round(r.min)&&Math.round(e.max)===Math.round(r.max)}function rS(e,r){return jb(e.x,r.x)&&jb(e.y,r.y)}function wb(e){return An(e.x)/An(e.y)}function _b(e,r){return e.translate===r.translate&&e.scale===r.scale&&e.originPoint===r.originPoint}class WI{constructor(){this.members=[]}add(r){Dm(this.members,r),r.scheduleRender()}remove(r){if(s0(this.members,r),r===this.prevLead&&(this.prevLead=void 0),r===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(r){const i=this.members.findIndex(o=>r===o);if(i===0)return!1;let n;for(let o=i;o>=0;o--){const a=this.members[o];if(a.isPresent!==!1){n=a;break}}return n?(this.promote(n),!0):!1}promote(r,i){const n=this.lead;if(r!==n&&(this.prevLead=n,this.lead=r,r.show(),n)){n.instance&&n.scheduleRender(),r.scheduleRender(),r.resumeFrom=n,i&&(r.resumeFrom.preserveOpacity=!0),n.snapshot&&(r.snapshot=n.snapshot,r.snapshot.latestValues=n.animationValues||n.latestValues),r.root&&r.root.isUpdating&&(r.isLayoutDirty=!0);const{crossfade:o}=r.options;o===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(r=>{const{options:i,resumingFrom:n}=r;i.onExitComplete&&i.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(r=>{r.instance&&r.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function NI(e,r,i){let n="";const o=e.x.translate/r.x,a=e.y.translate/r.y,l=(i==null?void 0:i.z)||0;if((o||a||l)&&(n=`translate3d(${o}px, ${a}px, ${l}px) `),(r.x!==1||r.y!==1)&&(n+=`scale(${1/r.x}, ${1/r.y}) `),i){const{transformPerspective:u,rotate:g,rotateX:h,rotateY:x,skewX:y,skewY:_}=i;u&&(n=`perspective(${u}px) ${n}`),g&&(n+=`rotate(${g}deg) `),h&&(n+=`rotateX(${h}deg) `),x&&(n+=`rotateY(${x}deg) `),y&&(n+=`skewX(${y}deg) `),_&&(n+=`skewY(${_}deg) `)}const d=e.x.scale*r.x,p=e.y.scale*r.y;return(d!==1||p!==1)&&(n+=`scale(${d}, ${p})`),n||"none"}const Ca={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},dc=typeof window<"u"&&window.MotionDebug!==void 0,fg=["","X","Y","Z"],UI={visibility:"hidden"},Sb=1e3;let VI=0;function xg(e,r,i,n){const{latestValues:o}=r;o[e]&&(i[e]=o[e],r.setStaticValue(e,0),n&&(n[e]=0))}function iS(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:r}=e.options;if(!r)return;const i=a_(r);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:o,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(i,"transform",Er,!(o||a))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&iS(n)}function nS({attachResizeListener:e,defaultParent:r,measureScroll:i,checkIsScrollRoot:n,resetTransform:o}){return class{constructor(l={},d=r==null?void 0:r()){this.id=VI++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,dc&&(Ca.totalNodes=Ca.resolvedTargetDeltas=Ca.recalculatedProjection=0),this.nodes.forEach(GI),this.nodes.forEach(KI),this.nodes.forEach(QI),this.nodes.forEach(JI),dc&&window.MotionDebug.record(Ca)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let p=0;p<this.path.length;p++)this.path[p].shouldResetTransform=!0;this.root===this&&(this.nodes=new TI)}addEventListener(l,d){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new Bm),this.eventHandlers.get(l).add(d)}notifyListeners(l,...d){const p=this.eventHandlers.get(l);p&&p.notify(...d)}hasListeners(l){return this.eventHandlers.has(l)}mount(l,d=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=K_(l),this.instance=l;const{layoutId:p,layout:u,visualElement:g}=this.options;if(g&&!g.current&&g.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),d&&(u||p)&&(this.isLayoutDirty=!0),e){let h;const x=()=>this.root.updateBlockedByResize=!1;e(l,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=AI(x,250),Tu.hasAnimatedSinceResize&&(Tu.hasAnimatedSinceResize=!1,this.nodes.forEach(Cb))})}p&&this.root.registerSharedNode(p,this),this.options.animate!==!1&&g&&(p||u)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:x,hasRelativeTargetChanged:y,layout:_})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||g.getDefaultTransition()||nT,{onLayoutAnimationStart:k,onLayoutAnimationComplete:w}=g.getProps(),b=!this.targetLayout||!rS(this.targetLayout,_)||y,j=!x&&y;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||j||x&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,j);const T={...Am(S,"layout"),onPlay:k,onComplete:w};(g.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T)}else x||Cb(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=_})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,fs(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(eT),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&iS(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const h=this.path[g];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:d,layout:p}=this.options;if(d===void 0&&!p)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(kb);return}this.isUpdating||this.nodes.forEach(YI),this.isUpdating=!1,this.nodes.forEach(XI),this.nodes.forEach(qI),this.nodes.forEach(HI),this.clearAllSnapshots();const d=Wo.now();Oi.delta=xs(0,1e3/60,d-Oi.timestamp),Oi.timestamp=d,Oi.isProcessing=!0,sg.update.process(Oi),sg.preRender.process(Oi),sg.render.process(Oi),Oi.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,wm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ZI),this.sharedNodes.forEach(tT)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Er.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Er.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let p=0;p<this.path.length;p++)this.path[p].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ei(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(d=!1),d){const p=n(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:p,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:p}}}resetTransform(){if(!o)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,d=this.projectionDelta&&!tS(this.projectionDelta),p=this.getTransformTemplate(),u=p?p(this.latestValues,""):void 0,g=u!==this.prevTransformTemplateValue;l&&(d||ka(this.latestValues)||g)&&(o(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const d=this.measurePageBox();let p=this.removeElementScroll(d);return l&&(p=this.removeTransform(p)),oT(p),{animationId:this.root.animationId,measuredBox:d,layoutBox:p,latestValues:{},source:this.id}}measurePageBox(){var l;const{visualElement:d}=this.options;if(!d)return ei();const p=d.measureViewportBox();if(!(((l=this.scroll)===null||l===void 0?void 0:l.wasRoot)||this.path.some(sT))){const{scroll:g}=this.root;g&&(ql(p.x,g.offset.x),ql(p.y,g.offset.y))}return p}removeElementScroll(l){var d;const p=ei();if(qn(p,l),!((d=this.scroll)===null||d===void 0)&&d.wasRoot)return p;for(let u=0;u<this.path.length;u++){const g=this.path[u],{scroll:h,options:x}=g;g!==this.root&&h&&x.layoutScroll&&(h.wasRoot&&qn(p,l),ql(p.x,h.offset.x),ql(p.y,h.offset.y))}return p}applyTransform(l,d=!1){const p=ei();qn(p,l);for(let u=0;u<this.path.length;u++){const g=this.path[u];!d&&g.options.layoutScroll&&g.scroll&&g!==g.root&&Hl(p,{x:-g.scroll.offset.x,y:-g.scroll.offset.y}),ka(g.latestValues)&&Hl(p,g.latestValues)}return ka(this.latestValues)&&Hl(p,this.latestValues),p}removeTransform(l){const d=ei();qn(d,l);for(let p=0;p<this.path.length;p++){const u=this.path[p];if(!u.instance||!ka(u.latestValues))continue;Xf(u.latestValues)&&u.updateSnapshot();const g=ei(),h=u.measurePageBox();qn(g,h),yb(d,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,g)}return ka(this.latestValues)&&yb(d,this.latestValues),d}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Oi.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){var d;const p=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=p.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=p.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=p.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==p;if(!(l||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((d=this.parent)===null||d===void 0)&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:x}=this.options;if(!(!this.layout||!(h||x))){if(this.resolvedRelativeTargetAt=Oi.timestamp,!this.targetDelta&&!this.relativeTarget){const y=this.getClosestProjectingParent();y&&y.layout&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ei(),this.relativeTargetOrigin=ei(),Sc(this.relativeTargetOrigin,this.layout.layoutBox,y.layout.layoutBox),qn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=ei(),this.targetWithTransforms=ei()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),pI(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):qn(this.target,this.layout.layoutBox),G_(this.target,this.targetDelta)):qn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const y=this.getClosestProjectingParent();y&&!!y.resumingFrom==!!this.resumingFrom&&!y.options.layoutScroll&&y.target&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ei(),this.relativeTargetOrigin=ei(),Sc(this.relativeTargetOrigin,this.target,y.target),qn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}dc&&Ca.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Xf(this.parent.latestValues)||H_(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var l;const d=this.getLead(),p=!!this.resumingFrom||this!==d;let u=!0;if((this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty)&&(u=!1),p&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Oi.timestamp&&(u=!1),u)return;const{layout:g,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(g||h))return;qn(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,y=this.treeScale.y;vI(this.layoutCorrected,this.treeScale,this.path,p),d.layout&&!d.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(d.target=d.layout.layoutBox,d.targetWithTransforms=ei());const{target:_}=d;if(!_){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(fb(this.prevProjectionDelta.x,this.projectionDelta.x),fb(this.prevProjectionDelta.y,this.projectionDelta.y)),_c(this.projectionDelta,this.layoutCorrected,_,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==y||!_b(this.projectionDelta.x,this.prevProjectionDelta.x)||!_b(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",_)),dc&&Ca.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){var d;if((d=this.options.visualElement)===null||d===void 0||d.scheduleRender(),l){const p=this.getStack();p&&p.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Vl(),this.projectionDelta=Vl(),this.projectionDeltaWithTransform=Vl()}setAnimationOrigin(l,d=!1){const p=this.snapshot,u=p?p.latestValues:{},g={...this.latestValues},h=Vl();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const x=ei(),y=p?p.source:void 0,_=this.layout?this.layout.source:void 0,S=y!==_,k=this.getStack(),w=!k||k.members.length<=1,b=!!(S&&!w&&this.options.crossfade===!0&&!this.path.some(iT));this.animationProgress=0;let j;this.mixTargetDelta=T=>{const P=T/1e3;zb(h.x,l.x,P),zb(h.y,l.y,P),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Sc(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),rT(this.relativeTarget,this.relativeTargetOrigin,x,P),j&&$I(this.relativeTarget,j)&&(this.isProjectionDirty=!1),j||(j=ei()),qn(j,this.relativeTarget)),S&&(this.animationValues=g,FI(g,u,this.latestValues,P,b,w)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(fs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Er.update(()=>{Tu.hasAnimatedSinceResize=!0,this.currentAnimation=X_(0,Sb,{...l,onUpdate:d=>{this.mixTargetDelta(d),l.onUpdate&&l.onUpdate(d)},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Sb),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:d,target:p,layout:u,latestValues:g}=l;if(!(!d||!p||!u)){if(this!==l&&this.layout&&u&&oS(this.options.animationType,this.layout.layoutBox,u.layoutBox)){p=this.target||ei();const h=An(this.layout.layoutBox.x);p.x.min=l.target.x.min,p.x.max=p.x.min+h;const x=An(this.layout.layoutBox.y);p.y.min=l.target.y.min,p.y.max=p.y.min+x}qn(d,p),Hl(d,g),_c(this.projectionDeltaWithTransform,this.layoutCorrected,d,g)}}registerSharedNode(l,d){this.sharedNodes.has(l)||this.sharedNodes.set(l,new WI),this.sharedNodes.get(l).add(d);const u=d.options.initialPromotionConfig;d.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(d):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){var l;const{layoutId:d}=this.options;return d?((l=this.getStack())===null||l===void 0?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:d}=this.options;return d?(l=this.getStack())===null||l===void 0?void 0:l.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:d,preserveFollowOpacity:p}={}){const u=this.getStack();u&&u.promote(this,p),l&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let d=!1;const{latestValues:p}=l;if((p.z||p.rotate||p.rotateX||p.rotateY||p.rotateZ||p.skewX||p.skewY)&&(d=!0),!d)return;const u={};p.z&&xg("z",l,u,this.animationValues);for(let g=0;g<fg.length;g++)xg(`rotate${fg[g]}`,l,u,this.animationValues),xg(`skew${fg[g]}`,l,u,this.animationValues);l.render();for(const g in u)l.setStaticValue(g,u[g]),this.animationValues&&(this.animationValues[g]=u[g]);l.scheduleRender()}getProjectionStyles(l){var d,p;if(!this.instance||this.isSVG)return;if(!this.isVisible)return UI;const u={visibility:""},g=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Ru(l==null?void 0:l.pointerEvents)||"",u.transform=g?g(this.latestValues,""):"none",u;const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){const S={};return this.options.layoutId&&(S.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,S.pointerEvents=Ru(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!ka(this.latestValues)&&(S.transform=g?g({},""):"none",this.hasProjected=!1),S}const x=h.animationValues||h.latestValues;this.applyTransformsToTarget(),u.transform=NI(this.projectionDeltaWithTransform,this.treeScale,x),g&&(u.transform=g(x,u.transform));const{x:y,y:_}=this.projectionDelta;u.transformOrigin=`${y.origin*100}% ${_.origin*100}% 0`,h.animationValues?u.opacity=h===this?(p=(d=x.opacity)!==null&&d!==void 0?d:this.latestValues.opacity)!==null&&p!==void 0?p:1:this.preserveOpacity?this.latestValues.opacity:x.opacityExit:u.opacity=h===this?x.opacity!==void 0?x.opacity:"":x.opacityExit!==void 0?x.opacityExit:0;for(const S in ph){if(x[S]===void 0)continue;const{correct:k,applyTo:w}=ph[S],b=u.transform==="none"?x[S]:k(x[S],h);if(w){const j=w.length;for(let T=0;T<j;T++)u[w[T]]=b}else u[S]=b}return this.options.layoutId&&(u.pointerEvents=h===this?Ru(l==null?void 0:l.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>{var d;return(d=l.currentAnimation)===null||d===void 0?void 0:d.stop()}),this.root.nodes.forEach(kb),this.root.sharedNodes.clear()}}}function qI(e){e.updateLayout()}function HI(e){var r;const i=((r=e.resumeFrom)===null||r===void 0?void 0:r.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&i&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:o}=e.layout,{animationType:a}=e.options,l=i.source!==e.layout.source;a==="size"?Hn(h=>{const x=l?i.measuredBox[h]:i.layoutBox[h],y=An(x);x.min=n[h].min,x.max=x.min+y}):oS(a,i.layoutBox,n)&&Hn(h=>{const x=l?i.measuredBox[h]:i.layoutBox[h],y=An(n[h]);x.max=x.min+y,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+y)});const d=Vl();_c(d,n,i.layoutBox);const p=Vl();l?_c(p,e.applyTransform(o,!0),i.measuredBox):_c(p,n,i.layoutBox);const u=!tS(d);let g=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:x,layout:y}=h;if(x&&y){const _=ei();Sc(_,i.layoutBox,x.layoutBox);const S=ei();Sc(S,n,y.layoutBox),rS(_,S)||(g=!0),h.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=_,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:i,delta:p,layoutDelta:d,hasLayoutChanged:u,hasRelativeTargetChanged:g})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function GI(e){dc&&Ca.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function JI(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ZI(e){e.clearSnapshot()}function kb(e){e.clearMeasurements()}function YI(e){e.isLayoutDirty=!1}function XI(e){const{visualElement:r}=e.options;r&&r.getProps().onBeforeLayoutMeasure&&r.notify("BeforeLayoutMeasure"),e.resetTransform()}function Cb(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function KI(e){e.resolveTargetDelta()}function QI(e){e.calcProjection()}function eT(e){e.resetSkewAndRotation()}function tT(e){e.removeLeadSnapshot()}function zb(e,r,i){e.translate=$r(r.translate,0,i),e.scale=$r(r.scale,1,i),e.origin=r.origin,e.originPoint=r.originPoint}function Eb(e,r,i,n){e.min=$r(r.min,i.min,n),e.max=$r(r.max,i.max,n)}function rT(e,r,i,n){Eb(e.x,r.x,i.x,n),Eb(e.y,r.y,i.y,n)}function iT(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const nT={duration:.45,ease:[.4,0,.1,1]},Rb=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ib=Rb("applewebkit/")&&!Rb("chrome/")?Math.round:In;function Tb(e){e.min=Ib(e.min),e.max=Ib(e.max)}function oT(e){Tb(e.x),Tb(e.y)}function oS(e,r,i){return e==="position"||e==="preserve-aspect"&&!cI(wb(r),wb(i),.2)}function sT(e){var r;return e!==e.root&&((r=e.scroll)===null||r===void 0?void 0:r.wasRoot)}const aT=nS({attachResizeListener:(e,r)=>rp(e,"resize",r),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),mg={current:void 0},sS=nS({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!mg.current){const e=new aT({});e.mount(window),e.setOptions({layoutScroll:!0}),mg.current=e}return mg.current},resetTransform:(e,r)=>{e.style.transform=r!==void 0?r:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),lT={pan:{Feature:CI},drag:{Feature:kI,ProjectionNode:sS,MeasureLayout:Y_}};function Ab(e,r,i){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",i==="Start");const o="onHover"+i,a=n[o];a&&Er.postRender(()=>a(r,jp(r)))}class dT extends la{mount(){const{current:r}=this.node;r&&(this.unmount=gE(r,i=>(Ab(this.node,i,"Start"),n=>Ab(this.node,n,"End"))))}unmount(){}}class cT extends la{constructor(){super(...arguments),this.isActive=!1}onFocus(){let r=!1;try{r=this.node.current.matches(":focus-visible")}catch{r=!0}!r||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=vp(rp(this.node.current,"focus",()=>this.onFocus()),rp(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Pb(e,r,i){const{props:n}=e;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",i==="Start");const o="onTap"+(i==="End"?"":i),a=n[o];a&&Er.postRender(()=>a(r,jp(r)))}class pT extends la{mount(){const{current:r}=this.node;r&&(this.unmount=yE(r,i=>(Pb(this.node,i,"Start"),(n,{success:o})=>Pb(this.node,n,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Qf=new WeakMap,yg=new WeakMap,uT=e=>{const r=Qf.get(e.target);r&&r(e)},hT=e=>{e.forEach(uT)};function gT({root:e,...r}){const i=e||document;yg.has(i)||yg.set(i,{});const n=yg.get(i),o=JSON.stringify(r);return n[o]||(n[o]=new IntersectionObserver(hT,{root:e,...r})),n[o]}function fT(e,r,i){const n=gT(r);return Qf.set(e,i),n.observe(e),()=>{Qf.delete(e),n.unobserve(e)}}const xT={some:0,all:1};class mT extends la{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:r={}}=this.node.getProps(),{root:i,margin:n,amount:o="some",once:a}=r,l={root:i?i.current:void 0,rootMargin:n,threshold:typeof o=="number"?o:xT[o]},d=p=>{const{isIntersecting:u}=p;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:g,onViewportLeave:h}=this.node.getProps(),x=u?g:h;x&&x(p)};return fT(this.node.current,l,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:r,prevProps:i}=this.node;["amount","margin","root"].some(yT(r,i))&&this.startObserver()}unmount(){}}function yT({viewport:e={}},{viewport:r={}}={}){return i=>e[i]!==r[i]}const bT={inView:{Feature:mT},tap:{Feature:pT},focus:{Feature:cT},hover:{Feature:dT}},vT={layout:{ProjectionNode:sS,MeasureLayout:Y_}},ex={current:null},aS={current:!1};
vendor: 5,193 bytes, line 117
117function jT(){if(aS.current=!0,!!xm)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),r=()=>ex.current=e.matches;e.addListener(r),r()}else ex.current=!1}const wT=[...E_,Vi,ra],_T=e=>wT.find(z_(e)),vd=new WeakMap;function ST(e,r,i){for(const n in r){const o=r[n],a=i[n];if(Ri(o))e.addValue(n,o);else if(Ri(a))e.addValue(n,yd(o,{owner:e}));else if(a!==o)if(e.hasValue(n)){const l=e.getValue(n);l.liveStyle===!0?l.jump(o):l.hasAnimated||l.set(o)}else{const l=e.getStaticValue(n);e.addValue(n,yd(l!==void 0?l:o,{owner:e}))}}for(const n in i)r[n]===void 0&&e.removeValue(n);return r}const Fb=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class lS{scrapeMotionValuesFromProps(r,i,n){return{}}constructor({parent:r,props:i,presenceContext:n,reducedMotionConfig:o,blockInitialAnimation:a,visualState:l},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Um,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=Wo.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,Er.render(this.render,!1,!0))};const{latestValues:p,renderState:u,onUpdate:g}=l;this.onUpdate=g,this.latestValues=p,this.baseTarget={...p},this.initialValues=i.initial?{...p}:{},this.renderState=u,this.parent=r,this.props=i,this.presenceContext=n,this.depth=r?r.depth+1:0,this.reducedMotionConfig=o,this.options=d,this.blockInitialAnimation=!!a,this.isControllingVariants=i0(i),this.isVariantNode=Mw(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(r&&r.current);const{willChange:h,...x}=this.scrapeMotionValuesFromProps(i,{},this);for(const y in x){const _=x[y];p[y]!==void 0&&Ri(_)&&_.set(p[y],!1)}}mount(r){this.current=r,vd.set(r,this),this.projection&&!this.projection.instance&&this.projection.mount(r),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,n)=>this.bindToMotionValue(n,i)),aS.current||jT(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ex.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){vd.delete(this.current),this.projection&&this.projection.unmount(),fs(this.notifyUpdate),fs(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const r in this.events)this.events[r].clear();for(const r in this.features){const i=this.features[r];i&&(i.unmount(),i.isMounted=!1)}this.current=null}bindToMotionValue(r,i){this.valueSubscriptions.has(r)&&this.valueSubscriptions.get(r)();const n=sl.has(r),o=i.on("change",d=>{this.latestValues[r]=d,this.props.onUpdate&&Er.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),a=i.on("renderRequest",this.scheduleRender);let l;window.MotionCheckAppearSync&&(l=window.MotionCheckAppearSync(this,r,i)),this.valueSubscriptions.set(r,()=>{o(),a(),l&&l(),i.owner&&i.stop()})}sortNodePosition(r){return!this.current||!this.sortInstanceNodePosition||this.type!==r.type?0:this.sortInstanceNodePosition(this.current,r.current)}updateFeatures(){let r="animation";for(r in md){const i=md[r];if(!i)continue;const{isEnabled:n,Feature:o}=i;if(!this.features[r]&&o&&n(this.props)&&(this.features[r]=new o(this)),this.features[r]){const a=this.features[r];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ei()}getStaticValue(r){return this.latestValues[r]}setStaticValue(r,i){this.latestValues[r]=i}update(r,i){(r.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=r,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let n=0;n<Fb.length;n++){const o=Fb[n];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const a="on"+o,l=r[a];l&&(this.propEventSubscriptions[o]=this.on(o,l))}this.prevMotionValues=ST(this,this.scrapeMotionValuesFromProps(r,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(r){return this.props.variants?this.props.variants[r]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}
vendor: 2,988 bytes, line 117
117addVariantChild(r){const i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(r),()=>i.variantChildren.delete(r)}addValue(r,i){const n=this.values.get(r);i!==n&&(n&&this.removeValue(r),this.bindToMotionValue(r,i),this.values.set(r,i),this.latestValues[r]=i.get())}removeValue(r){this.values.delete(r);const i=this.valueSubscriptions.get(r);i&&(i(),this.valueSubscriptions.delete(r)),delete this.latestValues[r],this.removeValueFromRenderState(r,this.renderState)}hasValue(r){return this.values.has(r)}getValue(r,i){if(this.props.values&&this.props.values[r])return this.props.values[r];let n=this.values.get(r);return n===void 0&&i!==void 0&&(n=yd(i===null?void 0:i,{owner:this}),this.addValue(r,n)),n}readValue(r,i){var n;let o=this.latestValues[r]!==void 0||!this.current?this.latestValues[r]:(n=this.getBaseTargetFromProps(this.props,r))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,r,this.options);return o!=null&&(typeof o=="string"&&(k_(o)||x_(o))?o=parseFloat(o):!_T(o)&&ra.test(i)&&(o=w_(r,i)),this.setBaseTarget(r,Ri(o)?o.get():o)),Ri(o)?o.get():o}setBaseTarget(r,i){this.baseTarget[r]=i}getBaseTarget(r){var i;const{initial:n}=this.props;let o;if(typeof n=="string"||typeof n=="object"){const l=Sm(this.props,n,(i=this.presenceContext)===null||i===void 0?void 0:i.custom);l&&(o=l[r])}if(n&&o!==void 0)return o;const a=this.getBaseTargetFromProps(this.props,r);return a!==void 0&&!Ri(a)?a:this.initialValues[r]!==void 0&&o===void 0?void 0:this.baseTarget[r]}on(r,i){return this.events[r]||(this.events[r]=new Bm),this.events[r].add(i)}notify(r,...i){this.events[r]&&this.events[r].notify(...i)}}class dS extends lS{constructor(){super(...arguments),this.KeyframeResolver=R_}sortInstanceNodePosition(r,i){return r.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(r,i){return r.style?r.style[i]:void 0}removeValueFromRenderState(r,{vars:i,style:n}){delete i[r],delete n[r]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:r}=this.props;Ri(r)&&(this.childSubscription=r.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function kT(e){return window.getComputedStyle(e)}class cS extends dS{constructor(){super(...arguments),this.type="html",this.renderInstance=Vw}readValueFromInstance(r,i){if(sl.has(i)){const n=Nm(i);return n&&n.default||0}else{const n=kT(r),o=(Ww(i)?n.getPropertyValue(i):n[i])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(r,{transformPagePoint:i}){return J_(r,i)}build(r,i,n){zm(r,i,n.transformTemplate)}scrapeMotionValuesFromProps(r,i,n){return Tm(r,i,n)}}class pS extends dS{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ei}getBaseTargetFromProps(r,i){return r[i]}readValueFromInstance(r,i){if(sl.has(i)){const n=Nm(i);return n&&n.default||0}return i=qw.has(i)?i:jm(i),r.getAttribute(i)}scrapeMotionValuesFromProps(r,i,n){return Jw(r,i,n)}
vendor: 4,551 bytes, line 117
117build(r,i,n){Em(r,i,this.isSVGTag,n.transformTemplate)}renderInstance(r,i,n,o){Hw(r,i,n,o)}mount(r){this.isSVGTag=Im(r.tagName),super.mount(r)}}const CT=(e,r)=>_m(e)?new pS(r):new cS(r,{allowProjection:e!==m.Fragment}),zT=lE({...tI,...bT,...lT,...vT},CT),ye=_z(zT);function Au(e){const r=mp(()=>yd(e)),{isStatic:i}=m.useContext(e0);if(i){const[,n]=m.useState(e);m.useEffect(()=>r.on("change",n),[])}return r}function uS(e,r){const i=Au(r()),n=()=>i.set(r());return n(),mm(()=>{const o=()=>Er.preRender(n,!1,!0),a=e.map(l=>l.on("change",o));return()=>{a.forEach(l=>l()),fs(n)}}),i}const ET=e=>e&&typeof e=="object"&&e.mix,RT=e=>ET(e)?e.mix:void 0;function IT(...e){const r=!Array.isArray(e[0]),i=r?0:-1,n=e[0+i],o=e[1+i],a=e[2+i],l=e[3+i],d=D_(o,a,{mixer:RT(a[0]),...l});return r?d(n):d}function TT(e){vc.current=[],e();const r=uS(vc.current,e);return vc.current=void 0,r}function _l(e,r,i,n){if(typeof e=="function")return TT(e);const o=typeof r=="function"?r:IT(r,i,n);return Array.isArray(e)?Mb(e,o):Mb([e],([a])=>o(a))}function Mb(e,r){const i=mp(()=>[]);return uS(e,()=>{i.length=0;const n=e.length;for(let o=0;o<n;o++)i[o]=e[o].get();return r(i)})}const AT=(e,r,i)=>{const n=r-e;return((i-e)%n+n)%n+e};function hS(e,r){return M_(e)?e[AT(0,e.length,r)]:e}function Zm(e){return typeof e=="object"&&!Array.isArray(e)}function gS(e,r,i,n){return typeof e=="string"&&Zm(r)?r_(e,i,n):e instanceof NodeList?Array.from(e):Array.isArray(e)?e:[e]}function PT(e,r,i){return e*(r+1)}function Db(e,r,i,n){var o;return typeof r=="number"?r:r.startsWith("-")||r.startsWith("+")?Math.max(0,e+parseFloat(r)):r==="<"?i:(o=n.get(r))!==null&&o!==void 0?o:e}function FT(e,r,i){for(let n=0;n<e.length;n++){const o=e[n];o.at>r&&o.at<i&&(s0(e,o),n--)}}function MT(e,r,i,n,o,a){FT(e,o,a);for(let l=0;l<r.length;l++)e.push({value:r[l],at:$r(o,a,n[l]),easing:hS(i,l)})}function DT(e,r){for(let i=0;i<e.length;i++)e[i]=e[i]/(r+1)}function BT(e,r){return e.at===r.at?e.value===null?1:r.value===null?-1:0:e.at-r.at}const OT="easeInOut";function LT(e,{defaultTransition:r={},...i}={},n,o){const a=r.duration||.3,l=new Map,d=new Map,p={},u=new Map;let g=0,h=0,x=0;for(let y=0;y<e.length;y++){const _=e[y];if(typeof _=="string"){u.set(_,h);continue}else if(!Array.isArray(_)){u.set(_.name,Db(h,_.at,g,u));continue}let[S,k,w={}]=_;w.at!==void 0&&(h=Db(h,w.at,g,u));let b=0;const j=(T,P,I,R=0,O=0)=>{const E=$T(T),{delay:$=0,times:B=O_(E),type:ee="keyframes",repeat:te,repeatType:K,repeatDelay:ne=0,...Re}=P;let{ease:Q=r.ease||"easeOut",duration:G}=P;const le=typeof $=="function"?$(R,O):$,F=E.length,A=o0(ee)?ee:o==null?void 0:o[ee];if(F<=2&&A){let N=100;if(F===2&&UT(E)){const X=E[1]-E[0];N=Math.abs(X)}const Z={...Re};G!==void 0&&(Z.duration=Oo(G));const ae=pE(Z,N,A);Q=ae.ease,G=ae.duration}G??(G=a);const M=h+le;B.length===1&&B[0]===0&&(B[1]=1);const V=B.length-E.length;if(V>0&&B_(B,V),E.length===1&&E.unshift(null),te){G=PT(G,te);const N=[...E],Z=[...B];Q=Array.isArray(Q)?[...Q]:[Q];const ae=[...Q];for(let X=0;X<te;X++){E.push(...N);for(let he=0;he<N.length;he++)B.push(Z[he]+(X+1)),Q.push(he===0?"linear":hS(ae,he-1))}DT(B,te)}const H=M+G;MT(I,E,Q,B,M,H),b=Math.max(le+G,b),x=Math.max(H,x)};if(Ri(S)){const T=Bb(S,d);j(k,w,Ob("default",T))}else{const T=gS(S,k,n,p),P=T.length;for(let I=0;I<P;I++){k=k,w=w;const R=T[I],O=Bb(R,d);for(const E in k)j(k[E],WT(w,E),Ob(E,O),I,P)}}g=h,h+=b}return d.forEach((y,_)=>{for(const S in y){const k=y[S];k.sort(BT);const w=[],b=[],j=[];for(let P=0;P<k.length;P++){const{at:I,value:R,easing:O}=k[P];w.push(R),b.push(Ka(0,x,I)),j.push(O||"easeOut")}b[0]!==0&&(b.unshift(0),w.unshift(w[0]),j.unshift(OT)),b[b.length-1]!==1&&(b.push(1),w.push(null)),l.has(_)||l.set(_,{keyframes:{},transition:{}});const T=l.get(_);T.keyframes[S]=w,T.transition[S]={...r,duration:x,ease:j,times:b,...i}}}),l}function Bb(e,r){return!r.has(e)&&r.set(e,{}),r.get(e)}function Ob(e,r){return r[e]||(r[e]=[]),r[e]}function $T(e){return Array.isArray(e)?e:[e]}function WT(e,r){return e&&e[r]?{...e,...e[r]}:{...e}}const NT=e=>typeof e=="number",UT=e=>e.every(NT);function VT(e,r){return e in r}class qT extends lS{constructor(){super(...arguments),this.type="object"}readValueFromInstance(r,i){if(VT(i,r)){const n=r[i];if(typeof n=="string"||typeof n=="number")return n}}getBaseTargetFromProps(){}removeValueFromRenderState(r,i){delete i.output[r]}measureInstanceViewportBox(){return ei()}build(r,i){Object.assign(r.output,i)}renderInstance(r,{output:i}){Object.assign(r,i)}sortInstanceNodePosition(){return 0}}function HT(e){const r={presenceContext:null,props:{}
117,visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},i=K_(e)?new pS(r):new cS(r);i.mount(e),vd.set(e,i)}function GT(e){const r={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},i=new qT(r);i.mount(e),vd.set(e,i)}function JT(e,r){return Ri(e)||typeof e=="number"||typeof e=="string"&&!Zm(r)}function fS(e,r,i,n){const o=[];if(JT(e,r))o.push(X_(e,Zm(r)&&r.default||r,i&&(i.default||i)));else{const a=gS(e,r,n),l=a.length;for(let d=0;d<l;d++){const p=a[d],u=p instanceof Element?HT:GT;vd.has(p)||u(p);const g=vd.get(p),h={...i};"delay"in h&&typeof h.delay=="function"&&(h.delay=h.delay(d,l)),o.push(...Jm(g,{...r,transition:h},{}))}}return o}function ZT(e,r,i){const n=[];return LT(e,r,i,{spring:qm}).forEach(({keyframes:a,transition:l},d)=>{n.push(...fS(d,a,l))}),n}function YT(e){return Array.isArray(e)&&e.some(Array.isArray)}function XT(e){function r(i,n,o){let a=[];return YT(i)?a=ZT(i,n,e):a=fS(i,n,o,e),new Xw(a)}return r}const Sl=XT(),xS=m.createContext(),dr=()=>m.useContext(xS),KT=({children:e})=>{const[r,i]=m.useState(()=>{try{const p=new URLSearchParams(window.location.search),u=p.get("mode");if(u&&["EROS","EROX","FRIEND"].includes(u)){Or("appMode",u),p.delete("mode");const g=p.toString()?`${window.location.pathname}?${p.toString()}${window.location.hash}`:`${window.location.pathname}${window.location.hash}`;return window.history.replaceState({},"",g),u}}catch{}return li("appMode")||"EROS"}),[n,o]=m.useState(()=>li("lightMode")==="true");m.useEffect(()=>{Or("appMode",r),document.body.classList.remove("theme-eros","theme-erox","theme-friend"),r==="EROS"?document.body.classList.add("theme-eros"):r==="EROX"?document.body.classList.add("theme-erox"):r==="FRIEND"&&document.body.classList.add("theme-friend")},[r]),m.useEffect(()=>{Or("lightMode",n),n?document.body.classList.add("light-mode"):document.body.classList.remove("light-mode")},[n]);const d={mode:r,setMode:i,toggleMode:()=>{i(p=>p==="EROS"?"EROX":p==="EROX"?"FRIEND":"EROS")},isEros:r==="EROS",isErox:r==="EROX",isFriend:r==="FRIEND",lightMode:n,setLightMode:o,toggleLightMode:()=>o(p=>!p)};return t.jsx(xS.Provider,{value:d,children:e})},xn=(e=768)=>{const[r,i]=m.useState(window.innerWidth<e);return m.useEffect(()=>{const n=()=>{i(window.innerWidth<e)};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),r};/*! Capacitor: https://capacitorjs.com/ - MIT License */var jd;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(jd||(jd={}));class bg extends Error{constructor(r,i,n){super(r),this.message=r,this.code=i,this.data=n}}const QT=e=>{var r,i;return e!=null&&e.androidBridge?"android":!((i=(r=e==null?void 0:e.webkit)===null||r===void 0?void 0:r.messageHandlers)===null||i===void 0)&&i.bridge?"ios":"web"},eA=e=>{const r=e.CapacitorCustomPlatform||null,i=e.Capacitor||{},n=i.Plugins=i.Plugins||{},o=()=>r!==null?r.name:QT(e),a=()=>o()!=="web",l=h=>{const x=u.get(h);return!!(x!=null&&x.platforms.has(o())||d(h))},d=h=>{var x;return(x=i.PluginHeaders)===null||x===void 0?void 0:x.find(y=>y.name===h)},p=h=>e.console.error(h),u=new Map,g=(h,x={})=>{const y=u.get(h);if(y)return console.warn(`Capacitor plugin "${h}" already registered. Cannot register plugins twice.`),y.proxy;const _=o(),S=d(h);let k;const w=async()=>(!k&&_ in x?k=typeof x[_]=="function"?k=await x[_]():k=x[_]:r!==null&&!k&&"web"in x&&(k=typeof x.web=="function"?k=await x.web():k=x.web),k),b=(O,E)=>{var $,B;if(S){const ee=S==null?void 0:S.methods.find(te=>E===te.name);if(ee)return ee.rtype==="promise"?te=>i.nativePromise(h,E.toString(),te):(te,K)=>i.nativeCallback(h,E.toString(),te,K);if(O)return($=O[E])===null||$===void 0?void 0:$.bind(O)}else{if(O)return(B=O[E])===null||B===void 0?void 0:B.bind(O);throw new bg(`"${h}" plugin is not implemented on ${_}`,jd.Unimplemented)}},j=O=>{let E;const $=(...B)=>{const ee=w().then(te=>{const K=b(te,O);if(K){const ne=K(...B);return E=ne==null?void 0:ne.remove,ne}else throw new bg(`"${h}.${O}()" is not implemented on ${_}`,jd.Unimplemented)});return O==="addListener"&&(ee.remove=async()=>E()),ee};return $.toString=()=>`${O.toString()}() { [capacitor code] }
117`,Object.defineProperty($,"name",{value:O,writable:!1,configurable:!1}),$},T=j("addListener"),P=j("removeListener"),I=(O,E)=>{const $=T({eventName:O},E),B=async()=>{const te=await $;P({eventName:O,callbackId:te},E)},ee=new Promise(te=>$.then(()=>te({remove:B})));return ee.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await B()},ee},R=new Proxy({},{get(O,E){switch(E){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return S?I:T;case"removeListener":return P;default:return j(E)}}});return n[h]=R,u.set(h,{name:h,proxy:R,platforms:new Set([...Object.keys(x),...S?[_]:[]])}),R};return i.convertFileSrc||(i.convertFileSrc=h=>h),i.getPlatform=o,i.handleError=p,i.isNativePlatform=a,i.isPluginAvailable=l,i.registerPlugin=g,i.Exception=bg,i.DEBUG=!!i.DEBUG,i.isLoggingEnabled=!!i.isLoggingEnabled,i},tA=e=>e.Capacitor=eA(e),Qa=tA(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Ym=Qa.registerPlugin;class Xm{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(r,i){let n=!1;this.listeners[r]||(this.listeners[r]=[],n=!0),this.listeners[r].push(i);const a=this.windowListeners[r];a&&!a.registered&&this.addWindowListener(a),n&&this.sendRetainedArgumentsForEvent(r);const l=async()=>this.removeListener(r,i);return Promise.resolve({remove:l})}async removeAllListeners(){this.listeners={};for(const r in this.windowListeners)this.removeWindowListener(this.windowListeners[r]);this.windowListeners={}}notifyListeners(r,i,n){const o=this.listeners[r];if(!o){if(n){let a=this.retainedEventArguments[r];a||(a=[]),a.push(i),this.retainedEventArguments[r]=a}return}o.forEach(a=>a(i))}hasListeners(r){var i;return!!(!((i=this.listeners[r])===null||i===void 0)&&i.length)}registerWindowListener(r,i){this.windowListeners[i]={registered:!1,windowEventName:r,pluginEventName:i,handler:n=>{this.notifyListeners(i,n)}}}unimplemented(r="not implemented"){return new Qa.Exception(r,jd.Unimplemented)}unavailable(r="not available"){return new Qa.Exception(r,jd.Unavailable)}async removeListener(r,i){const n=this.listeners[r];if(!n)return;const o=n.indexOf(i);this.listeners[r].splice(o,1),this.listeners[r].length||this.removeWindowListener(this.windowListeners[r])}addWindowListener(r){window.addEventListener(r.windowEventName,r.handler),r.registered=!0}removeWindowListener(r){r&&(window.removeEventListener(r.windowEventName,r.handler),r.registered=!1)}sendRetainedArgumentsForEvent(r){const i=this.retainedEventArguments[r];i&&(delete this.retainedEventArguments[r],i.forEach(n=>{this.notifyListeners(r,n)}))}}const Lb=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),$b=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class rA extends Xm{async getCookies(){const r=document.cookie,i={};return r.split(";").forEach(n=>{if(n.length<=0)return;let[o,a]=n.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");o=$b(o).trim(),a=$b(a).trim(),i[o]=a}),i}async setCookie(r){try{const i=Lb(r.key),n=Lb(r.value),o=r.expires?`; expires=${r.expires.replace("expires=","")}`:"",a=(r.path||"/").replace("path=",""),l=r.url!=null&&r.url.length>0?`domain=${r.url}`:"";document.cookie=`${i}=${n||""}${o}; path=${a}; ${l};`}catch(i){return Promise.reject(i)}}async deleteCookie(r){try{document.cookie=`${r.key}=; Max-Age=0`}catch(i){return Promise.reject(i)}}async clearCookies(){try{const r=document.cookie.split(";")||[];for(const i of r)document.cookie=i.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(r){return Promise.reject(r)}}async clearAllCookies(){try{await this.clearCookies()}catch(r){return Promise.reject(r)}}}Ym("CapacitorCookies",{web:()=>new rA});const iA=async e=>new Promise((r,i)=>{const n=new FileReader;n.onload=()=>{const o=n.result;r(o.indexOf(",")>=0?o.split(",")[1]:o)},n.onerror=o=>i(o),n.readAsDataURL(e)}),nA=(e={})=>{const r=Object.keys(e);return Object.keys(e).map(o=>o.toLocaleLowerCase()).reduce((o,a,l)=>(o[a]=e[r[l]],o),{})},oA=(e,r=!0)=>e?Object.entries(e).reduce((n,o)=>{const[a,l]=o;let d,p;return Array.isArray(l)?(p="",l.forEach(u=>{d=r?encodeURIComponent(u):u,p+=`${a}=${d}&`}),p.slice(0,-1)):(d=r?encodeURIComponent(l):l,p=`${a}=${d}`),`${n}&${p}`},"").substr(1):null,sA=(e,r={})=>{const i=Object.assign({method:e.method||"GET",headers:e.headers},r),o=nA(e.headers)["content-type"]||"";
117if(typeof e.data=="string")i.body=e.data;else if(o.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[l,d]of Object.entries(e.data||{}))a.set(l,d);i.body=a.toString()}else if(o.includes("multipart/form-data")||e.data instanceof FormData){const a=new FormData;if(e.data instanceof FormData)e.data.forEach((d,p)=>{a.append(p,d)});else for(const d of Object.keys(e.data))a.append(d,e.data[d]);i.body=a;const l=new Headers(i.headers);l.delete("content-type"),i.headers=l}else(o.includes("application/json")||typeof e.data=="object")&&(i.body=JSON.stringify(e.data));return i};class aA extends Xm{async request(r){const i=sA(r,r.webFetchExtra),n=oA(r.params,r.shouldEncodeUrlParams),o=n?`${r.url}?${n}`:r.url,a=await fetch(o,i),l=a.headers.get("content-type")||"";let{responseType:d="text"}=a.ok?r:{};l.includes("application/json")&&(d="json");let p,u;switch(d){case"arraybuffer":case"blob":u=await a.blob(),p=await iA(u);break;case"json":p=await a.json();break;case"document":case"text":default:p=await a.text()}const g={};return a.headers.forEach((h,x)=>{g[x]=h}),{data:p,headers:g,status:a.status,url:a.url}}async get(r){return this.request(Object.assign(Object.assign({},r),{method:"GET"}))}async post(r){return this.request(Object.assign(Object.assign({},r),{method:"POST"}))}async put(r){return this.request(Object.assign(Object.assign({},r),{method:"PUT"}))}async patch(r){return this.request(Object.assign(Object.assign({},r),{method:"PATCH"}))}async delete(r){return this.request(Object.assign(Object.assign({},r),{method:"DELETE"}))}}Ym("CapacitorHttp",{web:()=>new aA});var Wb;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(Wb||(Wb={}));var Nb;(function(e){e.StatusBar="StatusBar",e.NavigationBar="NavigationBar"})(Nb||(Nb={}));class lA extends Xm{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}Ym("SystemBars",{web:()=>new lA});const Jo=()=>Qa.isNativePlatform(),dA=()=>Qa.getPlatform(),cA=()=>Qa.getPlatform()==="ios",pA=()=>Qa.getPlatform()==="android";let ro=null;function Ad(){try{return localStorage.getItem("meeteros_sound_enabled")!=="false"}catch{return!0}}function uA(e){try{localStorage.setItem("meeteros_sound_enabled",e?"true":"false")}catch{}}async function wp(){if(!ro&&Jo())try{ro=(await Wr(()=>import("./index-DGi5IT2S.js"),[])).Haptics}catch{}}async function mr(){if(Ad()&&(await wp(),ro))try{ro.impact({style:"light"})}catch{}}async function Uo(){if(Ad()&&(await wp(),ro))try{ro.impact({style:"medium"})}catch{}}async function hA(){if(Ad()&&(await wp(),ro))try{ro.impact({style:"heavy"})}catch{}}async function id(){if(Ad()&&(await wp(),ro))try{ro.notification({type:"success"})}catch{}}async function gA(){if(Ad()&&(await wp(),ro))try{ro.notification({type:"error"})}catch{}}let kc=null;async function fA(){if(!kc&&Jo())try{kc=(await Wr(()=>import("./index-GFOHNpx9.js"),[])).StatusBar}catch{}}async function xA(){if(await fA(),kc)try{kc.setStyle({style:"DARK"}),pA()&&kc.setBackgroundColor({color:"#050507"})}catch(e){console.warn("[StatusBar] error:",e.message)}}let yh=null;async function mA(){if(!yh&&Jo())try{yh=(await Wr(()=>import("./index-CciaZa9k.js"),[])).SplashScreen}catch{}}async function yA(){if(await mA(),yh)try{yh.hide({fadeOutDuration:300})}catch{}}function bA(){if(Jo())try{console.log(`[Native] Platform: ${dA()}`),xA(),setTimeout(()=>{yA()},500)}catch(e){console.warn("[Native] initNativePlugins error (non-fatal):",e.message)}}/** 118 * @license lucide-react v0.330.0 - ISC 119 * 120 * This source code is licensed under the ISC license. 121 * See the LICENSE file in the root directory of this source tree. 122 */var vA={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"};/** 123 * @license lucide-react v0.330.0 - ISC 124 * 125 * This source code is licensed under the ISC license. 126 * See the LICENSE file in the root directory of this source tree. 127 */const jA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),_e=(e,r)=>{const i=m.forwardRef(({color:n="currentColor",size:o=24,strokeWidth:a=2,absoluteStrokeWidth:l,className:d="",children:p,...u},g)=>m.createElement("svg",{ref:g,...vA,width:o,height:o,stroke:n,strokeWidth:l?Number(a)*24/Number(o):a,className:["lucide",`lucide-${jA(e)}`,d].join(" "),...u},[...r.map(([h,x])=>m.createElement(h,x)),...Array.isArray(p)?p:[p]]));return i.displayName=`${e}`,i};/** 128 * @license lucide-react v0.330.0 - ISC 129 * 130 * This source code is licensed under the ISC license. 131 * See the LICENSE file in the root directory of this source tree. 132 */const ss=_e("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/** 133 * @license lucide-react v0.330.0 - ISC 134 * 135 * This source code is licensed under the ISC license. 136 * See the LICENSE file in the root directory of this source tree. 137 */const Km=_e("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** 138 * @license lucide-react v0.330.0 - ISC 139 * 140 * This source code is licensed under the ISC license. 141 * See the LICENSE file in the root directory of this source tree. 142 */const _n=_e("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 143 * @license lucide-react v0.330.0 - ISC 144 * 145 * This source code is licensed under the ISC license. 146 * See the LICENSE file in the root directory of this source tree. 147 */const Qm=_e("Anchor",[["path",{d:"M12 22V8",key:"qkxhtm"}],["path",{d:"M5 12H2a10 10 0 0 0 20 0h-3",key:"1hv3nh"}],["circle",{cx:"12",cy:"5",r:"3",key:"rqqgnr"}]]);/** 148 * @license lucide-react v0.330.0 - ISC 149 * 150 * This source code is licensed under the ISC license. 151 * See the LICENSE file in the root directory of this source tree. 152 */const wA=_e("ArrowDownRight",[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]);/** 153 * @license lucide-react v0.330.0 - ISC 154 * 155 * This source code is licensed under the ISC license. 156 * See the LICENSE file in the root directory of this source tree. 157 */const Hr=_e("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 158 * @license lucide-react v0.330.0 - ISC 159 * 160 * This source code is licensed under the ISC license. 161 * See the LICENSE file in the root directory of this source tree. 162 */const Pr=_e("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 163 * @license lucide-react v0.330.0 - ISC 164 * 165 * This source code is licensed under the ISC license. 166 * See the LICENSE file in the root directory of this source tree. 167 */const Ub=_e("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/** 168 * @license lucide-react v0.330.0 - ISC 169 * 170 * This source code is licensed under the ISC license. 171 * See the LICENSE file in the root directory of this source tree. 172 */const _A=_e("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** 173 * @license lucide-react v0.330.0 - ISC 174 * 175 * This source code is licensed under the ISC license. 176 * See the LICENSE file in the root directory of this source tree. 177 */const SA=_e("Atom",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z",key:"1l2ple"}],["path",{d:"M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z",key:"1wam0m"}]]);/** 178 * @license lucide-react v0.330.0 - ISC 179 * 180 * This source code is licensed under the ISC license. 181 * See the LICENSE file in the root directory of this source tree. 182 */const kA=_e("Award",[["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}],["path",{d:"M15.477 12.89 17 22l-5-3-5 3 1.523-9.11",key:"em7aur"}]]);/** 183 * @license lucide-react v0.330.0 - ISC 184 * 185 * This source code is licensed under the ISC license. 186 * See the LICENSE file in the root directory of this source tree. 187 */const ip=_e("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/** 188 * @license lucide-react v0.330.0 - ISC 189 * 190 * This source code is licensed under the ISC license. 191 * See the LICENSE file in the root directory of this source tree. 192 */const pu=_e("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** 193 * @license lucide-react v0.330.0 - ISC 194 * 195 * This source code is licensed under the ISC license. 196 * See the LICENSE file in the root directory of this source tree. 197 */const mS=_e("Beer",[["path",{d:"M17 11h1a3 3 0 0 1 0 6h-1",key:"1yp76v"}],["path",{d:"M9 12v6",key:"1u1cab"}],["path",{d:"M13 12v6",key:"1sugkk"}],["path",{d:"M14 7.5c-1 0-1.44.5-3 .5s-2-.5-3-.5-1.72.5-2.5.5a2.5 2.5 0 0 1 0-5c.78 0 1.57.5 2.5.5S9.44 2 11 2s2 1.5 3 1.5 1.72-.5 2.5-.5a2.5 2.5 0 0 1 0 5c-.78 0-1.5-.5-2.5-.5Z",key:"1510fo"}],["path",{d:"M5 8v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"19jb7n"}]]);/** 198 * @license lucide-react v0.330.0 - ISC 199 * 200 * This source code is licensed under the ISC license. 201 * See the LICENSE file in the root directory of this source tree. 202 */const Vb=_e("BellOff",[["path",{d:"M8.7 3A6 6 0 0 1 18 8a21.3 21.3 0 0 0 .6 5",key:"o7mx20"}],["path",{d:"M17 17H3s3-2 3-9a4.67 4.67 0 0 1 .3-1.7",key:"16f1lm"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** 203 * @license lucide-react v0.330.0 - ISC 204 * 205 * This source code is licensed under the ISC license. 206 * See the LICENSE file in the root directory of this source tree. 207 */const e5=_e("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** 208 * @license lucide-react v0.330.0 - ISC 209 * 210 * This source code is licensed under the ISC license. 211 * See the LICENSE file in the root directory of this source tree. 212 */const el=_e("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/** 213 * @license lucide-react v0.330.0 - ISC 214 * 215 * This source code is licensed under the ISC license. 216 * See the LICENSE file in the root directory of this source tree. 217 */const qb=_e("Book",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}]]);/** 218 * @license lucide-react v0.330.0 - ISC 219 * 220 * This source code is licensed under the ISC license. 221 * See the LICENSE file in the root directory of this source tree. 222 */const Kn=_e("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** 223 * @license lucide-react v0.330.0 - ISC 224 * 225 * This source code is licensed under the ISC license. 226 * See the LICENSE file in the root directory of this source tree. 227 */const Sn=_e("Brain",[["path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2Z",key:"1mhkh5"}],["path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2Z",key:"1d6s00"}]]);/** 228 * @license lucide-react v0.330.0 - ISC 229 * 230 * This source code is licensed under the ISC license. 231 * See the LICENSE file in the root directory of this source tree. 232 */const Qn=_e("Briefcase",[["rect",{width:"20",height:"14",x:"2",y:"7",rx:"2",ry:"2",key:"eto64e"}],["path",{d:"M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"zwj3tp"}]]);/** 233 * @license lucide-react v0.330.0 - ISC 234 * 235 * This source code is licensed under the ISC license. 236 * See the LICENSE file in the root directory of this source tree. 237 */const tx=_e("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/** 238 * @license lucide-react v0.330.0 - ISC 239 * 240 * This source code is licensed under the ISC license. 241 * See the LICENSE file in the root directory of this source tree. 242 */const cr=_e("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** 243 * @license lucide-react v0.330.0 - ISC 244 * 245 * This source code is licensed under the ISC license. 246 * See the LICENSE file in the root directory of this source tree. 247 */const pi=_e("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** 248 * @license lucide-react v0.330.0 - ISC 249 * 250 * This source code is licensed under the ISC license. 251 * See the LICENSE file in the root directory of this source tree. 252 */const rx=_e("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);/** 253 * @license lucide-react v0.330.0 - ISC 254 * 255 * This source code is licensed under the ISC license. 256 * See the LICENSE file in the root directory of this source tree. 257 */const CA=_e("Cat",[["path",{d:"M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z",key:"x6xyqk"}],["path",{d:"M8 14v.5",key:"1nzgdb"}],["path",{d:"M16 14v.5",key:"1lajdz"}],["path",{d:"M11.25 16.25h1.5L12 17l-.75-.75Z",key:"12kq1m"}]]);/** 258 * @license lucide-react v0.330.0 - ISC 259 * 260 * This source code is licensed under the ISC license. 261 * See the LICENSE file in the root directory of this source tree. 262 */const ms=_e("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** 263 * @license lucide-react v0.330.0 - ISC 264 * 265 * This source code is licensed under the ISC license. 266 * See the LICENSE file in the root directory of this source tree. 267 */const pr=_e("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 268 * @license lucide-react v0.330.0 - ISC 269 * 270 * This source code is licensed under the ISC license. 271 * See the LICENSE file in the root directory of this source tree. 272 */const zA=_e("ChefHat",[["path",{d:"M6 13.87A4 4 0 0 1 7.41 6a5.11 5.11 0 0 1 1.05-1.54 5 5 0 0 1 7.08 0A5.11 5.11 0 0 1 16.59 6 4 4 0 0 1 18 13.87V21H6Z",key:"z3ra2g"}],["line",{x1:"6",x2:"18",y1:"17",y2:"17",key:"12q60k"}]]);/** 273 * @license lucide-react v0.330.0 - ISC 274 * 275 * This source code is licensed under the ISC license. 276 * See the LICENSE file in the root directory of this source tree. 277 */const l0=_e("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 278 * @license lucide-react v0.330.0 - ISC 279 * 280 * This source code is licensed under the ISC license. 281 * See the LICENSE file in the root directory of this source tree. 282 */const t5=_e("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** 283 * @license lucide-react v0.330.0 - ISC 284 * 285 * This source code is licensed under the ISC license. 286 * See the LICENSE file in the root directory of this source tree. 287 */const En=_e("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 288 * @license lucide-react v0.330.0 - ISC 289 * 290 * This source code is licensed under the ISC license. 291 * See the LICE
291NSE file in the root directory of this source tree. 292 */const EA=_e("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 293 * @license lucide-react v0.330.0 - ISC 294 * 295 * This source code is licensed under the ISC license. 296 * See the LICENSE file in the root directory of this source tree. 297 */const Ea=_e("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 298 * @license lucide-react v0.330.0 - ISC 299 * 300 * This source code is licensed under the ISC license. 301 * See the LICENSE file in the root directory of this source tree. 302 */const Pn=_e("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 303 * @license lucide-react v0.330.0 - ISC 304 * 305 * This source code is licensed under the ISC license. 306 * See the LICENSE file in the root directory of this source tree. 307 */const Hb=_e("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/** 308 * @license lucide-react v0.330.0 - ISC 309 * 310 * This source code is licensed under the ISC license. 311 * See the LICENSE file in the root directory of this source tree. 312 */const Na=_e("Coffee",[["path",{d:"M17 8h1a4 4 0 1 1 0 8h-1",key:"jx4kbh"}],["path",{d:"M3 8h14v9a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4Z",key:"1bxrl0"}],["line",{x1:"6",x2:"6",y1:"2",y2:"4",key:"1cr9l3"}],["line",{x1:"10",x2:"10",y1:"2",y2:"4",key:"170wym"}],["line",{x1:"14",x2:"14",y1:"2",y2:"4",key:"1c5f70"}]]);/** 313 * @license lucide-react v0.330.0 - ISC 314 * 315 * This source code is licensed under the ISC license. 316 * See the LICENSE file in the root directory of this source tree. 317 */const RA=_e("Coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]);/** 318 * @license lucide-react v0.330.0 - ISC 319 * 320 * This source code is licensed under the ISC license. 321 * See the LICENSE file in the root directory of this source tree. 322 */const Qi=_e("Compass",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76",key:"m9r19z"}]]);/** 323 * @license lucide-react v0.330.0 - ISC 324 * 325 * This source code is licensed under the ISC license. 326 * See the LICENSE file in the root directory of this source tree. 327 */const IA=_e("Contrast",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 18a6 6 0 0 0 0-12v12z",key:"j4l70d"}]]);/** 328 * @license lucide-react v0.330.0 - ISC 329 * 330 * This source code is licensed under the ISC license. 331 * See the LICENSE file in the root directory of this source tree. 332 */const Vs=_e("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** 333 * @license lucide-react v0.330.0 - ISC 334 * 335 * This source code is licensed under the ISC license. 336 * See the LICENSE file in the root directory of this source tree. 337 */const Gb=_e("Crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]);/** 338 * @license lucide-react v0.330.0 - ISC 339 * 340 * This source code is licensed under the ISC license. 341 * See the LICENSE file in the root directory of this source tree. 342 */const ni=_e("Crown",[["path",{d:"m2 4 3 12h14l3-12-6 7-4-7-4 7-6-7zm3 16h14",key:"zkxr6b"}]]);/** 343 * @license lucide-react v0.330.0 - ISC 344 * 345 * This source code is licensed under the ISC license. 346 * See the LICENSE file in the root directory of this source tree. 347 */const tl=_e("Diamond",[["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z",key:"1f1r0c"}]]);/** 348 * @license lucide-react v0.330.0 - ISC 349 * 350 * This source code is licensed under the ISC license. 351 * See the LICENSE file in the root directory of this source tree. 352 */const ix=_e("Dog",[["path",{d:"M10 5.172C10 3.782 8.423 2.679 6.5 3c-2.823.47-4.113 6.006-4 7 .08.703 1.725 1.722 3.656 1 1.261-.472 1.96-1.45 2.344-2.5",key:"19br0u"}],["path",{d:"M14.267 5.172c0-1.39 1.577-2.493 3.5-2.172 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5",key:"11n1an"}],["path",{d:"M8 14v.5",key:"1nzgdb"}],["path",{d:"M16 14v.5",key:"1lajdz"}],["path",{d:"M11.25 16.25h1.5L12 17l-.75-.75Z",key:"12kq1m"}
352],["path",{d:"M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444c0-1.061-.162-2.2-.493-3.309m-9.243-6.082A8.801 8.801 0 0 1 12 5c.78 0 1.5.108 2.161.306",key:"wsu29d"}]]);/** 353 * @license lucide-react v0.330.0 - ISC 354 * 355 * This source code is licensed under the ISC license. 356 * See the LICENSE file in the root directory of this source tree. 357 */const Jb=_e("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/** 358 * @license lucide-react v0.330.0 - ISC 359 * 360 * This source code is licensed under the ISC license. 361 * See the LICENSE file in the root directory of this source tree. 362 */const nx=_e("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** 363 * @license lucide-react v0.330.0 - ISC 364 * 365 * This source code is licensed under the ISC license. 366 * See the LICENSE file in the root directory of this source tree. 367 */const TA=_e("Droplet",[["path",{d:"M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z",key:"c7niix"}]]);/** 368 * @license lucide-react v0.330.0 - ISC 369 * 370 * This source code is licensed under the ISC license. 371 * See the LICENSE file in the root directory of this source tree. 372 */const bh=_e("Droplets",[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]]);/** 373 * @license lucide-react v0.330.0 - ISC 374 * 375 * This source code is licensed under the ISC license. 376 * See the LICENSE file in the root directory of this source tree. 377 */const Ua=_e("Dumbbell",[["path",{d:"m6.5 6.5 11 11",key:"f7oqzb"}],["path",{d:"m21 21-1-1",key:"cpc6if"}],["path",{d:"m3 3 1 1",key:"d3rpuf"}],["path",{d:"m18 22 4-4",key:"1e32o6"}],["path",{d:"m2 6 4-4",key:"189tqz"}],["path",{d:"m3 10 7-7",key:"1bxui2"}],["path",{d:"m14 21 7-7",key:"16x78n"}]]);/** 378 * @license lucide-react v0.330.0 - ISC 379 * 380 * This source code is licensed under the ISC license. 381 * See the LICENSE file in the root directory of this source tree. 382 */const Gn=_e("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** 383 * @license lucide-react v0.330.0 - ISC 384 * 385 * This source code is licensed under the ISC license. 386 * See the LICENSE file in the root directory of this source tree. 387 */const al=_e("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/** 388 * @license lucide-react v0.330.0 - ISC 389 * 390 * This source code is licensed under the ISC license. 391 * See the LICENSE file in the root directory of this source tree. 392 */const rr=_e("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 393 * @license lucide-react v0.330.0 - ISC 394 * 395 * This source code is licensed under the ISC license. 396 * See the LICENSE file in the root directory of this source tree. 397 */const nd=_e("Feather",[["path",{d:"M20.24 12.24a6 6 0 0 0-8.49-8.49L5 10.5V19h8.5z",key:"u4sw5n"}],["line",{x1:"16",x2:"2",y1:"8",y2:"22",key:"1c47m2"}],["line",{x1:"17.5",x2:"9",y1:"15",y2:"15",key:"2fj3pr"}]]);/** 398 * @license lucide-react v0.330.0 - ISC 399 * 400 * This source code is licensed under the ISC license. 401 * See the LICENSE file in the root directory of this source tree. 402 */const AA=_e("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** 403 * @license lucide-react v0.330.0 - ISC 404 * 405 * This source code is licensed under the ISC license. 406 * See the LICENSE file in the root directory of this source tree. 407 */const vh=_e("Film",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]]);/** 408 * @license lucide-react v0.330.0 - ISC 409 * 410 * This source code is licensed under the ISC license. 411 * See the LICENSE file in the root directory of this source tree. 412 */const yS=_e("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** 413 * @license lucide-react v0.330.0 - ISC 414 * 415 * This source code is licensed under the ISC license. 416 * See the LICENSE file in the root directory of this source tree. 417 */const PA=_e("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);/** 418 * @license lucide-react v0.330.0 - ISC 419 * 420 * This source code is licensed under the ISC license. 421 * See the LICENSE file in the root directory of this source tree. 422 */const en=_e("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/** 423 * @license lucide-react v0.330.0 - ISC 424 * 425 * This source code is licensed under the ISC license. 426 * See the LICENSE file in the root directory of this source tree. 427 */const bS=_e("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** 428 * @license lucide-react v0.330.0 - ISC 429 * 430 * This source code is licensed under the ISC license. 431 * See the LICENSE file in the root directory of this source tree. 432 */const FA=_e("Flower",[["path",{d:"M12 7.5a4.5 4.5 0 1 1 4.5 4.5M12 7.5A4.5 4.5 0 1 0 7.5 12M12 7.5V9m-4.5 3a4.5 4.5 0 1 0 4.5 4.5M7.5 12H9m7.5 0a4.5 4.5 0 1 1-4.5 4.5m4.5-4.5H15m-3 4.5V15",key:"51z86h"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m8 16 1.5-1.5",key:"ce6zph"}],["path",{d:"M14.5 9.5 16 8",key:"1kzrzb"}],["path",{d:"m8 8 1.5 1.5",key:"1yv88w"}],["path",{d:"M14.5 14.5 16 16",key:"12xhjh"}]]);/** 433 * @license lucide-react v0.330.0 - ISC 434 * 435 * This source code is licensed under the ISC license. 436 * See the LICENSE file in the root directory of this source tree. 437 */const vS=_e("Gamepad",[["line",{x1:"6",x2:"10",y1:"12",y2:"12",key:"161bw2"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"15",x2:"15.01",y1:"13",y2:"13",key:"dqpgro"}],["line",{x1:"18",x2:"18.01",y1:"11",y2:"11",key:"meh2c"}],["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]]);/** 438 * @license lucide-react v0.330.0 - ISC 439 * 440 * This source code is licensed under the ISC license. 441 * See the LICENSE file in the root directory of this source tree. 442 */const r5=_e("Ghost",[["path",{d:"M9 10h.01",key:"qbtxuw"}],["path",{d:"M15 10h.01",key:"1qmjsl"}],["path",{d:"M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z",key:"uwwb07"}]]);/** 443 * @license lucide-react v0.330.0 - ISC 444 * 445 * This source code is licensed under the ISC license. 446 * See the LICENSE file in the root directory of this source tree. 447 */const Li=_e("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);/** 448 * @license lucide-react v0.330.0 - ISC 449 * 450 * This source code is licensed under the ISC license. 451 * See the LICENSE file in the root directory of this source tree. 452 */const np=_e("Glasses",[["circle",{cx:"6",cy:"15",r:"4",key:"vux9w4"}],["circle",{cx:"18",cy:"15",r:"4",key:"18o8ve"}],["path",{d:"M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2",key:"1ag4bs"}],["path",{d:"M2.5 13 5 7c.7-1.3 1.4-2 3-2",key:"1hm1gs"}],["path",{d:"M21.5 13 19 7c-.7-1.3-1.5-2-3-2",key:"1r31ai"}]]);/** 453 * @license lucide-react v0.330.0 - ISC 454 * 455 * This source code is licensed under the ISC license. 456 * See the LICENSE file in the root directory of this source tree. 457 */const Da=_e("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** 458 * @license lucide-react v0.330.0 - ISC 459 * 460 * This source code is licensed under the ISC license. 461 * See the LICENSE file in the root directory of this source tree. 462 */const MA=_e("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/** 463 * @license lucide-react v0.330.0 - ISC 464 * 465 * This source code is licensed under the ISC license. 466 * See the LICENSE file in the root directory of this source tree. 467 */const jh=_e("Handshake",[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]]);/** 468 * @license lucide-react v0.330.0 - ISC 469 * 470 * This source code is licensed under the ISC license. 471 * See the LICENSE file in the root directory of this source tree. 472 */const Bt=_e("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** 473 * @license lucide-react v0.330.0 - ISC 474 * 475 * This source code is licensed under the ISC license. 476 * See the LICENSE file in the root directory of this source tree. 477 */const op=_e("HelpCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 478 * @license lucide-react v0.330.0 - ISC 479 * 480 * This source code is licensed under the ISC license. 481 * See the LICENSE file in the root directory of this source tree. 482 */const od=_e("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]);/** 483 * @license lucide-react v0.330.0 - ISC 484 * 485 * This source code is licensed under the ISC license. 486 * See the LICENSE file in the root directory of this source tree. 487 */const wd=_e("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** 488 * @license lucide-react v0.330.0 - ISC 489 * 490 * This source code is licensed under the ISC license. 491 * See the LICENSE file in the root directory of this source tree. 492 */const vg=_e("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/** 493 * @license lucide-react v0.330.0 - ISC 494 * 495 * This source code is licensed under the ISC license. 496 * See the LICENSE file in the root directory of this source tree. 497 */const is=_e("Infinity",[["path",{d:"M12 12c-2-2.67-4-4-6-4a4 4 0 1 0 0 8c2 0 4-1.33 6-4Zm0 0c2 2.67 4 4 6 4a4 4 0 0 0 0-8c-2 0-4 1.33-6 4Z",key:"1z0uae"}]]);/** 498 * @license lucide-react v0.330.0 - ISC 499 * 500 * This source code is licensed under the ISC license. 501 * See the LICENSE file in the root directory of this source tree.
502 */const ox=_e("Key",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);/** 503 * @license lucide-react v0.330.0 - ISC 504 * 505 * This source code is licensed under the ISC license. 506 * See the LICENSE file in the root directory of this source tree. 507 */const wh=_e("Landmark",[["line",{x1:"3",x2:"21",y1:"22",y2:"22",key:"j8o0r"}],["line",{x1:"6",x2:"6",y1:"18",y2:"11",key:"10tf0k"}],["line",{x1:"10",x2:"10",y1:"18",y2:"11",key:"54lgf6"}],["line",{x1:"14",x2:"14",y1:"18",y2:"11",key:"380y"}],["line",{x1:"18",x2:"18",y1:"18",y2:"11",key:"1kevvc"}],["polygon",{points:"12 2 20 7 4 7",key:"jkujk7"}]]);/** 508 * @license lucide-react v0.330.0 - ISC 509 * 510 * This source code is licensed under the ISC license. 511 * See the LICENSE file in the root directory of this source tree. 512 */const Zb=_e("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/** 513 * @license lucide-react v0.330.0 - ISC 514 * 515 * This source code is licensed under the ISC license. 516 * See the LICENSE file in the root directory of this source tree. 517 */const Gl=_e("Leaf",[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]]);/** 518 * @license lucide-react v0.330.0 - ISC 519 * 520 * This source code is licensed under the ISC license. 521 * See the LICENSE file in the root directory of this source tree. 522 */const i5=_e("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/** 523 * @license lucide-react v0.330.0 - ISC 524 * 525 * This source code is licensed under the ISC license. 526 * See the LICENSE file in the root directory of this source tree. 527 */const Yb=_e("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/** 528 * @license lucide-react v0.330.0 - ISC 529 * 530 * This source code is licensed under the ISC license. 531 * See the LICENSE file in the root directory of this source tree. 532 */const DA=_e("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/** 533 * @license lucide-react v0.330.0 - ISC 534 * 535 * This source code is licensed under the ISC license. 536 * See the LICENSE file in the root directory of this source tree. 537 */const sx=_e("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 538 * @license lucide-react v0.330.0 - ISC 539 * 540 * This source code is licensed under the ISC license. 541 * See the LICENSE file in the root directory of this source tree. 542 */const qs=_e("Loader",[["line",{x1:"12",x2:"12",y1:"2",y2:"6",key:"gza1u7"}],["line",{x1:"12",x2:"12",y1:"18",y2:"22",key:"1qhbu9"}],["line",{x1:"4.93",x2:"7.76",y1:"4.93",y2:"7.76",key:"xae44r"}],["line",{x1:"16.24",x2:"19.07",y1:"16.24",y2:"19.07",key:"bxnmvf"}],["line",{x1:"2",x2:"6",y1:"12",y2:"12",key:"89khin"}],["line",{x1:"18",x2:"22",y1:"12",y2:"12",key:"pb8tfm"}],["line",{x1:"4.93",x2:"7.76",y1:"19.07",y2:"16.24",key:"1uxjnu"}],["line",{x1:"16.24",x2:"19.07",y1:"7.76",y2:"4.93",key:"6duxfx"}]]);/** 543 * @license lucide-react v0.330.0 - ISC 544 * 545 * This source code is licensed under the ISC license. 546 * See the LICENSE file in the root directory of this source tree. 547 */const Fr=_e("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** 548 * @license lucide-react v0.330.0 - ISC 549 * 550 * This source code is licensed under the ISC license. 551 * See the LICENSE file in the root directory of this source tree. 552 */const BA=_e("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** 553 * @license lucide-react v0.330.0 - ISC 554 * 555 * This source code is licensed under the ISC license. 556 * See the LICENSE file in the root directory of this source tree. 557 */const _h=_e("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** 558 * @license lucide-react v0.330.0 - ISC 559 * 560 * This source code is licensed under the ISC license. 561 * See the LICENSE file in the root directory of this source tree. 562 */const Vr=_e("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** 563 * @license lucide-react v0.330.0 - ISC 564 * 565 * This source code is licensed under the ISC license. 566 * See the LICENSE file in the root directory of this source tree. 567 */const ur=_e("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** 568 * @license lucide-react v0.330.0 - ISC 569 * 570 * This source code is licensed under the ISC license. 571 * See the LICENSE file in the root directory of this source tree. 572 */const Xb=_e("Map",[["polygon",{points:"3 6 9 3 15 6 21 3 21 18 15 21 9 18 3 21",key:"ok2ie8"}],["line",{x1:"9",x2:"9",y1:"3",y2:"18",key:"w34qz5"}],["line",{x1:"15",x2:"15",y1:"6",y2:"21",key:"volv9a"}]]);/** 573 * @license lucide-react v0.330.0 - ISC 574 * 575 * This source code is licensed under the ISC license. 576 * See the LICENSE file in the root directory of this source tree. 577 */const Sh=_e("Martini",[["path",{d:"M8 22h8",key:"rmew8v"}],["path",{d:"M12 11v11",key:"ur9y6a"}],["path",{d:"m19 3-7 8-7-8Z",key:"1sgpiw"}]]);/** 578 * @license lucide-react v0.330.0 - ISC 579 * 580 * This source code is licensed under the ISC license. 581 * See the LICENSE file in the root directory of this source tree. 582 */const n5=_e("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** 583 * @license lucide-react v0.330.0 - ISC 584 * 585 * This source code is licensed under the ISC license. 586 * See the LICENSE file in the root directory of this source tree. 587 */const Qt=_e("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** 588 * @license lucide-react v0.330.0 - ISC 589 * 590 * This source code is licensed under the ISC license. 591 * See the LICENSE file in the root directory of this source tree. 592 */const o5=_e("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** 593 * @license lucide-react v0.330.0 - ISC 594 * 595 * This source code is licensed under the ISC license. 596 * See the LICENSE file in the root directory of this source tree. 597 */const ls=_e("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/** 598 * @license lucide-react v0.330.0 - ISC 599 * 600 * This source code is licensed under the ISC license. 601 * See the LICENSE file in the root directory of this source tree. 602 */const Kb=_e("MinusCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);/** 603 * @license lucide-react v0.330.0 - ISC 604 * 605 * This source code is licensed under the ISC license. 606 * See the LICENSE file in the root directory of this source tree. 607 */const _d=_e("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** 608 * @license lucide-react v0.330.0 - ISC 609 * 610 * This source code is licensed under the ISC license. 611 * See the LICENSE file in the root directory of this source tree. 612 */const OA=_e("MoreVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/** 613 * @license lucide-react v0.330.0 - ISC 614 * 615 * This source code is licensed under the ISC license. 616 * See the LICENSE file in the root directory of this source tree. 617 */const Cc=_e("Mountain",[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]]);/** 618 * @license lucide-react v0.330.0 - ISC 619 * 620 * This source code is licensed under the ISC license. 621 * See the LICENSE file in the root directory of this source tree.
622 */const ds=_e("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/** 623 * @license lucide-react v0.330.0 - ISC 624 * 625 * This source code is licensed under the ISC license. 626 * See the LICENSE file in the root directory of this source tree. 627 */const d0=_e("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/** 628 * @license lucide-react v0.330.0 - ISC 629 * 630 * This source code is licensed under the ISC license. 631 * See the LICENSE file in the root directory of this source tree. 632 */const jS=_e("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** 633 * @license lucide-react v0.330.0 - ISC 634 * 635 * This source code is licensed under the ISC license. 636 * See the LICENSE file in the root directory of this source tree. 637 */const kh=_e("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** 638 * @license lucide-react v0.330.0 - ISC 639 * 640 * This source code is licensed under the ISC license. 641 * See the LICENSE file in the root directory of this source tree. 642 */const wS=_e("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]);/** 643 * @license lucide-react v0.330.0 - ISC 644 * 645 * This source code is licensed under the ISC license. 646 * See the LICENSE file in the root directory of this source tree. 647 */const Vo=_e("Pen",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}]]);/** 648 * @license lucide-react v0.330.0 - ISC 649 * 650 * This source code is licensed under the ISC license. 651 * See the LICENSE file in the root directory of this source tree. 652 */const sp=_e("Pencil",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** 653 * @license lucide-react v0.330.0 - ISC 654 * 655 * This source code is licensed under the ISC license. 656 * See the LICENSE file in the root directory of this source tree. 657 */const c0=_e("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** 658 * @license lucide-react v0.330.0 - ISC 659 * 660 * This source code is licensed under the ISC license. 661 * See the LICENSE file in the root directory of this source tree. 662 */const Zd=_e("PieChart",[["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}],["path",{d:"M22 12A10 10 0 0 0 12 2v10z",key:"1rfc4y"}]]);/** 663 * @license lucide-react v0.330.0 - ISC 664 * 665 * This source code is licensed under the ISC license. 666 * See the LICENSE file in the root directory of this source tree. 667 */const _S=_e("Pin",[["line",{x1:"12",x2:"12",y1:"17",y2:"22",key:"1jrz49"}],["path",{d:"M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z",key:"13yl11"}]]);/** 668 * @license lucide-react v0.330.0 - ISC 669 * 670 * This source code is licensed under the ISC license. 671 * See the LICENSE file in the root directory of this source tree. 672 */const Va=_e("Plane",[["path",{d:"M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z",key:"1v9wt8"}]]);/** 673 * @license lucide-react v0.330.0 - ISC 674 * 675 * This source code is licensed under the ISC license. 676 * See the LICENSE file in the root directory of this source tree. 677 */const p0=_e("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);/** 678 * @license lucide-react v0.330.0 - ISC 679 * 680 * This source code is licensed under the ISC license. 681 * See the LICENSE file in the root directory of this source tree. 682 */const Qb=_e("PlusCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/** 683 * @license lucide-react v0.330.0 - ISC 684 * 685 * This source code is licensed under the ISC license. 686 * See the LICENSE file in the root directory of this source tree. 687 */const No=_e("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 688 * @license lucide-react v0.330.0 - ISC 689 * 690 * This source code is licensed under the ISC license. 691 * See the LICENSE file in the root directory of this source tree. 692 */const LA=_e("Printer",[["polyline",{points:"6 9 6 2 18 2 18 9",key:"1306q4"}],["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}
692],["rect",{width:"12",height:"8",x:"6",y:"14",key:"5ipwut"}]]);/** 693 * @license lucide-react v0.330.0 - ISC 694 * 695 * This source code is licensed under the ISC license. 696 * See the LICENSE file in the root directory of this source tree. 697 */const kn=_e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** 698 * @license lucide-react v0.330.0 - ISC 699 * 700 * This source code is licensed under the ISC license. 701 * See the LICENSE file in the root directory of this source tree. 702 */const ax=_e("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** 703 * @license lucide-react v0.330.0 - ISC 704 * 705 * This source code is licensed under the ISC license. 706 * See the LICENSE file in the root directory of this source tree. 707 */const lx=_e("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** 708 * @license lucide-react v0.330.0 - ISC 709 * 710 * This source code is licensed under the ISC license. 711 * See the LICENSE file in the root directory of this source tree. 712 */const $A=_e("Ruler",[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]]);/** 713 * @license lucide-react v0.330.0 - ISC 714 * 715 * This source code is licensed under the ISC license. 716 * See the LICENSE file in the root directory of this source tree. 717 */const _p=_e("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/** 718 * @license lucide-react v0.330.0 - ISC 719 * 720 * This source code is licensed under the ISC license. 721 * See the LICENSE file in the root directory of this source tree. 722 */const qo=_e("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 723 * @license lucide-react v0.330.0 - ISC 724 * 725 * This source code is licensed under the ISC license. 726 * See the LICENSE file in the root directory of this source tree. 727 */const ji=_e("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/** 728 * @license lucide-react v0.330.0 - ISC 729 * 730 * This source code is licensed under the ISC license. 731 * See the LICENSE file in the root directory of this source tree. 732 */const jg=_e("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** 733 * @license lucide-react v0.330.0 - ISC 734 * 735 * This source code is licensed under the ISC license. 736 * See the LICENSE file in the root directory of this source tree. 737 */const dx=_e("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 738 * @license lucide-react v0.330.0 - ISC 739 * 740 * This source code is licensed under the ISC license. 741 * See the LICENSE file in the root directory of this source tree. 742 */const u0=_e("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** 743 * @license lucide-react v0.330.0 - ISC 744 * 745 * This source code is licensed under the ISC license. 746 * See the LICENSE file in the root directory of this source tree. 747 */const ap=_e("ShieldAlert",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/** 748 * @license lucide-react v0.330.0 - ISC 749 * 750 * This source code is licensed under the ISC license. 751 * See the LICENSE file in the root directory of this source tree. 752 */const fi=_e("ShieldCheck",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 753 * @license lucide-react v0.330.0 - ISC 754 * 755 * This source code is licensed under the ISC license. 756 * See the LICENSE file in the root directory of this source tree. 757 */const Sr=_e("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]]);/** 758 * @license lucide-react v0.330.0 - ISC 759 * 760 * This source code is licensed under the ISC license. 761 * See the LICENSE file in the root directory of this source tree. 762 */const ys=_e("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);/** 763 * @license lucide-react v0.330.0 - ISC 764 * 765 * This source code is licensed under the ISC license. 766 * See the LICENSE file in the root directory of this source tree. 767 */const WA=_e("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}
767],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);/** 768 * @license lucide-react v0.330.0 - ISC 769 * 770 * This source code is licensed under the ISC license. 771 * See the LICENSE file in the root directory of this source tree. 772 */const s5=_e("Sliders",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/** 773 * @license lucide-react v0.330.0 - ISC 774 * 775 * This source code is licensed under the ISC license. 776 * See the LICENSE file in the root directory of this source tree. 777 */const cs=_e("Smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);/** 778 * @license lucide-react v0.330.0 - ISC 779 * 780 * This source code is licensed under the ISC license. 781 * See the LICENSE file in the root directory of this source tree. 782 */const Xt=_e("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/** 783 * @license lucide-react v0.330.0 - ISC 784 * 785 * This source code is licensed under the ISC license. 786 * See the LICENSE file in the root directory of this source tree. 787 */const NA=_e("Speaker",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["circle",{cx:"12",cy:"14",r:"4",key:"1jruaj"}],["path",{d:"M12 14h.01",key:"1etili"}]]);/** 788 * @license lucide-react v0.330.0 - ISC 789 * 790 * This source code is licensed under the ISC license. 791 * See the LICENSE file in the root directory of this source tree. 792 */const UA=_e("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** 793 * @license lucide-react v0.330.0 - ISC 794 * 795 * This source code is licensed under the ISC license. 796 * See the LICENSE file in the root directory of this source tree. 797 */const nr=_e("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/** 798 * @license lucide-react v0.330.0 - ISC 799 * 800 * This source code is licensed under the ISC license. 801 * See the LICENSE file in the root directory of this source tree. 802 */const rl=_e("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** 803 * @license lucide-react v0.330.0 - ISC 804 * 805 * This source code is licensed under the ISC license. 806 * See the LICENSE file in the root directory of this source tree. 807 */const VA=_e("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** 808 * @license lucide-react v0.330.0 - ISC 809 * 810 * This source code is licensed under the ISC license. 811 * See the LICENSE file in the root directory of this source tree. 812 */const rn=_e("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}
812],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** 813 * @license lucide-react v0.330.0 - ISC 814 * 815 * This source code is licensed under the ISC license. 816 * See the LICENSE file in the root directory of this source tree. 817 */const Ch=_e("Trees",[["path",{d:"M10 10v.2A3 3 0 0 1 8.9 16v0H5v0h0a3 3 0 0 1-1-5.8V10a3 3 0 0 1 6 0Z",key:"yh07w9"}],["path",{d:"M7 16v6",key:"1a82de"}],["path",{d:"M13 19v3",key:"13sx9i"}],["path",{d:"M12 19h8.3a1 1 0 0 0 .7-1.7L18 14h.3a1 1 0 0 0 .7-1.7L16 9h.2a1 1 0 0 0 .8-1.7L13 3l-1.4 1.5",key:"1sj9kv"}]]);/** 818 * @license lucide-react v0.330.0 - ISC 819 * 820 * This source code is licensed under the ISC license. 821 * See the LICENSE file in the root directory of this source tree. 822 */const qA=_e("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/** 823 * @license lucide-react v0.330.0 - ISC 824 * 825 * This source code is licensed under the ISC license. 826 * See the LICENSE file in the root directory of this source tree. 827 */const ba=_e("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** 828 * @license lucide-react v0.330.0 - ISC 829 * 830 * This source code is licensed under the ISC license. 831 * See the LICENSE file in the root directory of this source tree. 832 */const SS=_e("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/** 833 * @license lucide-react v0.330.0 - ISC 834 * 835 * This source code is licensed under the ISC license. 836 * See the LICENSE file in the root directory of this source tree. 837 */const wg=_e("Tv",[["rect",{width:"20",height:"15",x:"2",y:"7",rx:"2",ry:"2",key:"10ag99"}],["polyline",{points:"17 2 12 7 7 2",key:"11pgbg"}]]);/** 838 * @license lucide-react v0.330.0 - ISC 839 * 840 * This source code is licensed under the ISC license. 841 * See the LICENSE file in the root directory of this source tree. 842 */const HA=_e("Umbrella",[["path",{d:"M22 12a10.06 10.06 1 0 0-20 0Z",key:"1teyop"}],["path",{d:"M12 12v8a2 2 0 0 0 4 0",key:"ulpmoc"}],["path",{d:"M12 2v1",key:"11qlp1"}]]);/** 843 * @license lucide-react v0.330.0 - ISC 844 * 845 * This source code is licensed under the ISC license. 846 * See the LICENSE file in the root directory of this source tree. 847 */const GA=_e("Unlock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);/** 848 * @license lucide-react v0.330.0 - ISC 849 * 850 * This source code is licensed under the ISC license. 851 * See the LICENSE file in the root directory of this source tree. 852 */const Sp=_e("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** 853 * @license lucide-react v0.330.0 - ISC 854 * 855 * This source code is licensed under the ISC license. 856 * See the LICENSE file in the root directory of this source tree. 857 */const sd=_e("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/** 858 * @license lucide-react v0.330.0 - ISC 859 * 860 * This source code is licensed under the ISC license. 861 * See the LICENSE file in the root directory of this source tree. 862 */const cx=_e("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/** 863 * @license lucide-react v0.330.0 - ISC 864 * 865 * This source code is licensed under the ISC license. 866 * See the LICENSE file in the root directory of this source tree. 867 */const ad=_e("UserX",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);/** 868 * @license lucide-react v0.330.0 - ISC 869 * 870 * This source code is licensed under the ISC license. 871 * See the LICENSE file in the root directory of this source tree. 872 */const Ur=_e("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** 873 * @license lucide-react v0.330.0 - ISC 874 * 875 * This source code is licensed under the ISC license. 876 * See the LICENSE file in the root directory of this source tree. 877 */const Ut=_e("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** 878 * @license lucide-react v0.330.0 - ISC 879 * 880 * This source code is licensed under the ISC license. 881 * See the LICENSE file in the root directory of this source tree. 882 */const lp=_e("Utensils",[["path",{d:"M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2",key:"cjf0a3"}],["path",{d:"M7 2v20",key:"1473qp"}
882],["path",{d:"M21 15V2v0a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7",key:"1ogz0v"}]]);/** 883 * @license lucide-react v0.330.0 - ISC 884 * 885 * This source code is licensed under the ISC license. 886 * See the LICENSE file in the root directory of this source tree. 887 */const ia=_e("Video",[["path",{d:"m22 8-6 4 6 4V8Z",key:"50v9me"}],["rect",{width:"14",height:"12",x:"2",y:"6",rx:"2",ry:"2",key:"1rqjg6"}]]);/** 888 * @license lucide-react v0.330.0 - ISC 889 * 890 * This source code is licensed under the ISC license. 891 * See the LICENSE file in the root directory of this source tree. 892 */const JA=_e("Volume2",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07",key:"ltjumu"}],["path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14",key:"1kegas"}]]);/** 893 * @license lucide-react v0.330.0 - ISC 894 * 895 * This source code is licensed under the ISC license. 896 * See the LICENSE file in the root directory of this source tree. 897 */const kS=_e("Wallet",[["path",{d:"M21 12V7H5a2 2 0 0 1 0-4h14v4",key:"195gfw"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h16v-5",key:"195n9w"}],["path",{d:"M18 12a2 2 0 0 0 0 4h4v-4Z",key:"vllfpd"}]]);/** 898 * @license lucide-react v0.330.0 - ISC 899 * 900 * This source code is licensed under the ISC license. 901 * See the LICENSE file in the root directory of this source tree. 902 */const zh=_e("Wand2",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72Z",key:"1bcowg"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/** 903 * @license lucide-react v0.330.0 - ISC 904 * 905 * This source code is licensed under the ISC license. 906 * See the LICENSE file in the root directory of this source tree. 907 */const Eh=_e("Wine",[["path",{d:"M8 22h8",key:"rmew8v"}],["path",{d:"M7 10h10",key:"1101jm"}],["path",{d:"M12 15v7",key:"t2xh3l"}],["path",{d:"M12 15a5 5 0 0 0 5-5c0-2-.5-4-2-8H9c-1.5 4-2 6-2 8a5 5 0 0 0 5 5Z",key:"10ffi3"}]]);/** 908 * @license lucide-react v0.330.0 - ISC 909 * 910 * This source code is licensed under the ISC license. 911 * See the LICENSE file in the root directory of this source tree. 912 */const CS=_e("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** 913 * @license lucide-react v0.330.0 - ISC 914 * 915 * This source code is licensed under the ISC license. 916 * See the LICENSE file in the root directory of this source tree. 917 */const zS=_e("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** 918 * @license lucide-react v0.330.0 - ISC 919 * 920 * This source code is licensed under the ISC license. 921 * See the LICENSE file in the root directory of this source tree. 922 */const mt=_e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 923 * @license lucide-react v0.330.0 - ISC 924 * 925 * This source code is licensed under the ISC license. 926 * See the LICENSE file in the root directory of this source tree. 927 */const oi=_e("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]),Fn=[{id:"iam",title:"Ce que je suis",color:"#FF6B6B",icon:Ur,items:[{id:"optimistic",label:"Optimiste",icon:rl},{id:"shy",label:"Timide",icon:r5},{id:"ambitious",label:"Ambitieux",icon:ax},{id:"zen",label:"Zen",icon:Gl},{id:"stressed",label:"Stressé",icon:ss},{id:"creative",label:"Créatif",icon:kh},{id:"intellectual",label:"Cérébral",icon:Sn},{id:"adventurous",label:"Aventurier",icon:Qi},{id:"homebody",label:"Casanier",icon:od},{id:"party_animal",label:"Fêtard",icon:oi},{id:"romantic",label:"Romantique",icon:Bt},{id:"spontaneous",label:"Spontané",icon:oi},{id:"organized",label:"Organisé",icon:cr},{id:"chaotic",label:"Bordélique",icon:is},{id:"independent",label:"Indépendant",icon:sd},{id:"social",label:"Sociable",icon:Ut},{id:"empathic",label:"Empathique",icon:Bt},{id:"athletic",label:"Sportif",icon:Ua},{id:"curvy",label:"Rondeurs",icon:Ea},{id:"tattooed",label:"Tatoué",icon:Vo},{id:"pierced",label:"Piercé",icon:_S},{id:"glasses",label:"Lunettes",icon:np},{id:"beard",label:"Barbe",icon:Ur},{id:"fashion",label:"Fashion",icon:ys},{id:"casual",label:"Casual",icon:Ur},{id:"rock",label:"Style Rock",icon:ds},{id:"boheme",label:"Bohème",icon:nd},{id:"student",label:"Ãtudiant",icon:el},{id:"worker",label:"Salarié",icon:Qn},{id:"freelance",label:"Freelance",icon:Zb},{id:"entrepreneur",label:"Entrepreneur",icon:i5}
927,{id:"night_owl",label:"Oiseau de nuit",icon:_d},{id:"early_bird",label:"Lève-tôt",icon:rl},{id:"parent",label:"Parent",icon:Ut},{id:"noparent",label:"Sans enfant",icon:Ur},{id:"want_kids",label:"Veut des enfants",icon:Ut},{id:"dont_want_kids",label:"Veut pas d'enfants",icon:Sr},{id:"smoker",label:"Fumeur",icon:Hb},{id:"vaper",label:"Vapoteur",icon:Hb},{id:"drinker",label:"Bon vivant",icon:Eh},{id:"social_drinker",label:"Verre social",icon:Sh},{id:"teetotaler",label:"Sobre",icon:bh},{id:"vegan",label:"Végan",icon:Gl},{id:"vegetarian",label:"Végé",icon:Gl},{id:"carnivore",label:"Viandard",icon:lp},{id:"religious",label:"Croyant",icon:qb},{id:"atheist",label:"Athée",icon:SA},{id:"spiritual",label:"Spirituel",icon:rr}]},{id:"ilike",title:"Ce que j'aime",color:"#4ECDC4",icon:Bt,items:[{id:"travel",label:"Voyages",icon:Va},{id:"roadtrip",label:"Roadtrips",icon:rx},{id:"camping",label:"Camping",icon:Qi},{id:"music",label:"Musique",icon:ds},{id:"concerts",label:"Concerts",icon:NA},{id:"festivals",label:"Festivals",icon:oi},{id:"movies",label:"Cinéma",icon:vh},{id:"netflix",label:"Séries",icon:wg},{id:"netflix_brand",label:"Netflix",icon:wg},{id:"bfm",label:"BFM TV",icon:wg},{id:"docs",label:"Documentaires",icon:vh},{id:"anime",label:"Animes",icon:rr},{id:"gaming",label:"Jeux Vidéo",icon:vS},{id:"boardgames",label:"Jeux de société",icon:jS},{id:"reading",label:"Lecture",icon:qb},{id:"comics",label:"BD/Manga",icon:el},{id:"writing",label:"Ãcriture",icon:Vo},{id:"cooking",label:"Cuisine",icon:zA},{id:"baking",label:"Pâtisserie",icon:Li},{id:"foodie",label:"Restos",icon:lp},{id:"wine_lover",label:"Ånologie",icon:Eh},{id:"craft_beer",label:"Bières Craft",icon:mS},{id:"coffee",label:"Café",icon:Na},{id:"tea",label:"Thé",icon:Na},{id:"sports",label:"Sport",icon:ia},{id:"gym",label:"Muscu",icon:Ua},{id:"running",label:"Running",icon:ss},{id:"yoga",label:"Yoga",icon:ss},{id:"hiking",label:"Rando",icon:Cc},{id:"climbing",label:"Escalade",icon:Cc},{id:"swimming",label:"Natation",icon:bh},{id:"football",label:"Foot",icon:SS},{id:"dance",label:"Danse",icon:ds},{id:"art",label:"Art",icon:kh},{id:"museums",label:"Musées",icon:wh},{id:"theater",label:"Théâtre",icon:Ur},{id:"photography",label:"Photo",icon:pi},{id:"diy",label:"Bricolage",icon:CS},{id:"gardening",label:"Jardinage",icon:FA},{id:"tech",label:"Tech",icon:Zb},{id:"coding",label:"Code",icon:n5},{id:"science",label:"Science",icon:bS},{id:"astro",label:"Astronomie",icon:_d},{id:"astrology",label:"Astrologie",icon:nr},{id:"history",label:"Histoire",icon:wh},{id:"politics",label:"Politique",icon:Da},{id:"ecology",label:"Ãcologie",icon:Gl},{id:"animals",label:"Animaux",icon:ix},{id:"cats",label:"Chats",icon:CA},{id:"dogs",label:"Chiens",icon:ix},{id:"nature",label:"Nature",icon:Ch},{id:"beach",label:"Plage",icon:HA},{id:"mountains",label:"Montagne",icon:Cc},{id:"city",label:"Ville",icon:od},{id:"shopping",label:"Shopping",icon:ys},{id:"luxury",label:"Luxe",icon:tl},{id:"simplicity",label:"Simplicité",icon:nd}]},{id:"iseek",title:"Ce que je recherche",color:"#FFE66D",icon:qo,items:[{id:"seek_man",label:"Homme",icon:Ur},{id:"seek_woman",label:"Femme",icon:Ur},{id:"seek_any_gender",label:"Peu importe",icon:Ut},{id:"seek_kids_yes",label:"Avec enfants",icon:Ut},{id:"seek_kids_no",label:"Sans enfant",icon:sd},{id:"seek_kids_any",label:"Peu importe (Enfants)",icon:is},{id:"dist_10",label:"< 10 km",icon:Xb},{id:"dist_20",label:"< 20 km",icon:Xb},{id:"dist_50",label:"< 50 km",icon:Qi},{id:"dist_100",label:"< 100 km",icon:Da},{id:"dist_any",label:"Peu importe (Km)",icon:Va},{id:"age_18_25",label:"18 - 25 ans",icon:cr},{id:"age_25_35",label:"25 - 35 ans",icon:cr},{id:"age_35_45",label:"35 - 45 ans",icon:cr},{id:"age_45_55",label:"45 - 55 ans",icon:cr},{id:"age_55_plus",label:"55 ans et +",icon:cr},{id:"serious",label:"Sérieux",icon:Bt},{id:"fun",label:"Fun",icon:cs},{id:"friendship",label:"Amitié",icon:Ut},{id:"casual",label:"Sans prise de tête",icon:Na},{id:"open",label:"Relation libre",icon:is},{id:"marriage",label:"Mariage",icon:tl},{id:"cocooning",label:"Cocooning",icon:od},{id:"adventurer",label:"Baroudeur",icon:Qi},{id:"intellectual_connect",label:"Connexion Intellectuelle",icon:Sn},{id:"deep_talks",label:"Discussions Profondes",icon:Qt},{id:"party_partner",label:"Partenaire de soirée",icon:Sh},{id:"sport_buddy",label:"Partenaire de sport",icon:Ua},{id:"travel_buddy",label:"Compagnon de voyage",icon:Va},{id:"honesty",label:"Honnêteté",icon:Sr},{id:"loyalty",label:"Loyauté",icon:ox},{id:"humor_req",label:"Humour",icon:cs},{id:"ambition_req",label:"Ambition",icon:ax},{id:"generosity",label:"Générosité",icon:Li},{id:"sensitivity",label:"Sensibilité",icon:Bt},{id:"stability",label:"Stabilité",icon:Qm},{id:"independence",label:"Indépendance",icon:sd},{id:"confidence",label:"Confiance",icon:nr},{id:"kindness",label:"Gentillesse",icon:Bt},{id:"tall_req",label:"Grand(e)",icon:_A},{id:"chartm",label:"Charisme",icon:nr},{id:"smile",label:"Beau sourire",icon:cs},{id:"eyes",label:"Regard",icon:rr}]}],So=[{id:"iam_erox",title:"Ce que je suis",color:"#ff3333",icon:Ur,items:[{id:"single",label:"Célibataire",icon:Ur},{id:"couple",label:"En Couple",icon:Ut},{id:"trouple",label:"En Trouple",icon:Ut},{id:"libertine",label:"Libertin(e)",icon:is},{id:"hetero",label:"Hétéro",icon:sd},{id:"gay",label:"Homo",icon:cx},{id:"bi",label:"Bi",icon:is},{id:"pan",label:"Pan",icon:Da},{id:"curious",label:"Curieux",icon:rr},{id:"slim",label:"Mince",icon:nd},{id:"average",label:"Moyenne",icon:Ea},{id:"athletic",label:"Athlétique",icon:Ua},{id:"curvy",label:"Ronde",icon:Ea},{id:"bbw",label:"Généreuse",icon:Ea},{id:"young",label:"18-25",icon:cr},{id:"mid20",label:"25-35",icon:cr},{id:"mid30",label:"35-45",icon:cr},{id:"mature",label:"45+",icon:cr},{id:"exp_novice",label:"Débutant(e)",icon:nr},{id:"exp_intermediate",label:"Initié(e)",icon:Qi},{id:"exp_expert",label:"Expérimenté(e)",icon:SS},{id:"vibe_discrete",label:"Discret(e)",icon:Fr},{id:"vibe_open",label:"Open Mind",icon:Da},{id:"vibe_epicurean",label:"Ãpicurien(ne)",icon:Eh},{id:"vibe_demanding",label:"Exigeant(e)",icon:tl},{id:"vibe_select",label:"Sélectif(ve)",icon:Sr},{id:"hygiene_plus",label:"Hygiène +++",icon:bh}]},{id:"iseek_erox",title:"Ce que je recherche",color:"#990000",icon:qo,items:[{id:"seek_man",label:"Homme",icon:Ur},{id:"seek_woman",label:"Femme",icon:Ur},{id:"seek_couple",label:"Couple",icon:Ut},{id:"seek_trans",label:"Trans",icon:cx},{id:"seek_any",label:"Tout",icon:Da},{id:"seek_18_25",label:"18-25",icon:cr},{id:"seek_25_40",label:"25-40",icon:cr},{id:"seek_40_plus",label:"40+",icon:cr},{id:"seek_any_age",label:"Peu importe",icon:is},{id:"seek_slim",label:"Mince",icon:nd},{id:"seek_curvy",label:"Rondeurs",icon:Ea},{id:"seek_athletic",label:"Musclé",icon:Ua},{id:"seek_any_body",label:"Peu importe",icon:Bt},{id:"seek_classy",label:"Classe",icon:tl},{id:"seek_trash",label:"Trash",icon:oi},{id:"seek_goth",label:"Goth",icon:_d},{id:"seek_bdsm",label:"BDSM",icon:Fr},{id:"seek_natural",label:"Naturel",icon:Gl},{id:"seek_natural",label:"Naturel",icon:Gl},{id:"seek_mentor",label:"Mentorat",icon:el},{id:"seek_discovery",label:"Découverte",icon:Qi},{id:"seek_teaching",label:"Initiation",icon:i5},{id:"seek_alchemy",label:"Alchimie",icon:bS},{id:"seek_fun",label:"Fun Ãphémère",icon:oi},{id:"seek_private",label:"Privé",icon:od},{id:"seek_club",label:"Club / Soirée",icon:ds},{id:"seek_travel",label:"Voyage Coquin",icon:Va},{id:"seek_virtual",label:"Virtuel / Cam",icon:ia},{id:"seek_outdoor",label:"Extérieur / Nature",icon:Ch},{id:"seek_hosted",label:"Hébergement OK",icon:ox},{id:"seek_mobile",label:"Véhiculé(e)",icon:rx},{id:"seek_discrete",label:"Discrétion Totale",icon:Fr},{id:"seek_safe",label:"Sécurité Avant Tout",icon:Sr}
927,{id:"seek_hygiene",label:"Hygiène Irréprochable",icon:bh}]},{id:"ilike_erox",title:"Mes Plaisirs & Pratiques",color:"#550000",icon:en,items:[{id:"soft",label:"Doux / Vanille",icon:nd},{id:"romantic",label:"Romantique",icon:Bt},{id:"passion",label:"Passionnel",icon:en},{id:"wild",label:"Bestial",icon:oi},{id:"slow",label:"Slow Sex",icon:Pn},{id:"trio",label:"Trio",icon:Ut},{id:"gangbang",label:"Pluralité / Orgie",icon:Ut},{id:"candelism",label:"Candau / Cuck",icon:rr},{id:"libertine_club",label:"Club Libertin",icon:Sh},{id:"exhibition",label:"Exhibition",icon:rr},{id:"voyeurism",label:"Voyeurisme",icon:np},{id:"dominator",label:"Dominant(e)",icon:ni},{id:"submissive",label:"Soumis(e)",icon:Fr},{id:"switch",label:"Switch",icon:is},{id:"master",label:"Maître(sse)",icon:ni},{id:"slave",label:"Esclave",icon:Fr},{id:"brat",label:"Brat (Pest)",icon:cs},{id:"daddy_mommy",label:"Daddy / Mommy",icon:sd},{id:"petplay",label:"Pet Play",icon:ix},{id:"bondage",label:"Bondage / Cordes",icon:Qm},{id:"shibari",label:"Shibari Art",icon:is},{id:"spanking",label:"Fessée / Impact",icon:oi},{id:"blindfold",label:"Yeux Bandés",icon:np},{id:"leather",label:"Cuir / Latex",icon:Sr},{id:"lingerie",label:"Lingerie / Talons",icon:Li},{id:"feet",label:"Pieds",icon:_S},{id:"toys",label:"Jouets / Sextoys",icon:ax},{id:"roleplay",label:"Jeu de Rôle",icon:ia},{id:"gloryhole",label:"Glory Hole",icon:Ea},{id:"public",label:"Lieux Publics",icon:Da},{id:"nature",label:"Nature / Outdoor",icon:Ch},{id:"hotel",label:"Hôtel",icon:ox},{id:"car",label:"Voiture",icon:rx}]}],a5=[{id:"evt_ambiance",title:"Ambiance",color:"#FF6B6B",icon:nr,items:[{id:"evt_party",label:"Soirée / Fête",icon:oi},{id:"evt_chill",label:"Chill & Relax",icon:Na},{id:"evt_dinner",label:"Dîner / Resto",icon:lp},{id:"evt_drink",label:"Apéro / Drink",icon:Sh},{id:"evt_culture",label:"Culture & Arts",icon:wh},{id:"evt_nature",label:"Nature / Plein Air",icon:Ch},{id:"evt_sport",label:"Sport / Action",icon:ss},{id:"evt_workshop",label:"Atelier / Workshop",icon:CS},{id:"evt_music",label:"Live Music / Concert",icon:ds},{id:"evt_vip",label:"VIP / Privé",icon:ni},{id:"evt_dating",label:"Dating / Rencontre",icon:Bt}]},{id:"evt_dresscode",title:"Dress Code & Vibe",color:"#4ECDC4",icon:ys,items:[{id:"evt_chic",label:"Chic / Ãlégant",icon:tl},{id:"evt_casual",label:"Décontracté",icon:cs},{id:"evt_costume",label:"Déguisé / Thème",icon:r5},{id:"evt_white",label:"Soirée Blanche",icon:rl},{id:"evt_mask",label:"Masqué",icon:np}]}],l5=[{id:"evt_erox_type",title:"Type d'événement",color:"#ff3333",icon:en,items:[{id:"evt_libertine",label:"Soirée Libertine",icon:is},{id:"evt_initiation",label:"Initiation",icon:i5},{id:"evt_gangbang",label:"Gangbang / Orgie",icon:Ut},{id:"evt_bdsm",label:"BDSM / Fetish",icon:Fr},{id:"evt_shibari",label:"Shibari / Cordes",icon:Qm},{id:"evt_massage",label:"Massage Tantra",icon:nd},{id:"evt_exhibition",label:"Exhibition / Voyeur",icon:rr}]},{id:"evt_erox_access",title:"Accès & Public",color:"#990000",icon:Sr,items:[{id:"evt_couples_only",label:"Couples Uniquement",icon:Ut},{id:"evt_women_prio",label:"Priorité Femmes",icon:Ur},{id:"evt_select",label:"Sélection Stricte",icon:Sr},{id:"evt_mask_req",label:"Masque Obligatoire",icon:np},{id:"evt_dress_sexy",label:"Dress Code Sexy",icon:ys}]}],il=[{id:"iam_friend",title:"Ma Vibe Amicale",color:"#FF7043",icon:Ur,items:[{id:"f_chill",label:"Chill",icon:Na},{id:"f_party",label:"Fêtard(e)",icon:oi},{id:"f_adventurer",label:"Baroudeur",icon:Qi},{id:"f_nerd",label:"Geek / Nerd",icon:vS},{id:"f_artist",label:"Artiste",icon:kh},{id:"f_sporty",label:"Sportif(ve)",icon:Ua},{id:"f_foodie",label:"Gourmet",icon:lp},{id:"f_listener",label:"Bonne Oreille",icon:Qt}]},{id:"ilike_friend",title:"Mes Sorties Préférées",color:"#FF4081",icon:nr,items:[{id:"out_bar",label:"Bar / Verre",icon:mS},{id:"out_dinner",label:"Resto",icon:lp},{id:"out_cinema",label:"Ciné",icon:vh},{id:"out_hike",label:"Rando",icon:Cc},{id:"out_concert",label:"Concert",icon:ds},{id:"out_museum",label:"Expo / Musée",icon:wh},{id:"out_club",label:"Clubbing",icon:oi},{id:"out_home",label:"Soirée Appart",icon:od},{id:"out_travel",label:"Voyage",icon:Va},{id:"out_coffee",label:"Café",icon:Na}]},{id:"iseek_friend",title:"Je recherche (Amis)",color:"#FFAB91",icon:qo,items:[{id:"lf_gang",label:"Une Bande",icon:Ut},{id:"lf_duo",label:"Un(e) Meilleur(e) Ami(e)",icon:sd},{id:"lf_activity",label:"Partenaire d'activité",icon:ss},{id:"lf_confidant",label:"Confident(e)",icon:Qt},{id:"lf_travel",label:"Compagnon de Voyage",icon:Va}]}],px=({style:e={}})=>{const r=Lt(),i=xn();return i?null:t.jsxs("div",{style:{paddingTop:i?"30px":"60px",paddingBottom:i?"100px":"20px",width:"100%",display:"flex",flexDirection:i?"column":"row",justifyContent:"center",alignItems:"center",textAlign:"center",gap:i?"15px":"30px",fontSize:"0.8rem",color:"rgba(255,255,255,0.4)",borderTop:"1px solid rgba(255,255,255,0.05)",zIndex:10,...e},children:[t.jsx("span",{style:{cursor:"pointer"},onClick:()=>r("/terms"),children:"CGU & Mentions Légales"}),t.jsx("span",{style:{cursor:"pointer"},onClick:()=>r("/privacy"),children:"Politique de Confidentialité"}),t.jsx("span",{style:{cursor:"pointer"},onClick:()=>r("/help"),children:"Aide & Support"}),t.jsx("span",{children:"© 2026 MEET YOU - MEETYOUEVENT"})]})},e1=({icon:e,color:r,delay:i,x:n,y:o,size:a=20})=>t.jsx(ye.div,{initial:{opacity:0,scale:0,y:o+20}
927,animate:{opacity:[0,.6,.4,.6,0],scale:[.5,1,.9,1.1,.5],y:[o+20,o-30,o-60,o-90,o-130],x:[n,n+10,n-8,n+5,n]},transition:{duration:8+Math.random()*4,delay:i,repeat:1/0,ease:"easeInOut"},style:{position:"absolute",left:`${n}%`,top:`${o}%`,pointerEvents:"none",filter:`drop-shadow(0 0 8px ${r}40)`,zIndex:1},children:t.jsx(e,{size:a,color:r,strokeWidth:1.2})}),uu=({color:e,size:r,x:i,y:n,delay:o})=>t.jsx(ye.div,{animate:{scale:[1,1.3,1],opacity:[.15,.3,.15]},transition:{duration:4+Math.random()*2,delay:o,repeat:1/0,ease:"easeInOut"},style:{position:"absolute",left:`${i}%`,top:`${n}%`,width:`${r}px`,height:`${r}px`,borderRadius:"50%",background:`radial-gradient(circle, ${e}30, transparent 70%)`,filter:"blur(20px)",pointerEvents:"none",zIndex:0}}),ZA=({icon:e,text:r,color:i,delay:n})=>t.jsxs(ye.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:n,duration:.4},style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 14px",borderRadius:"20px",background:`${i}10`,border:`1px solid ${i}25`,backdropFilter:"blur(10px)"},children:[t.jsx(e,{size:14,color:i}),t.jsx("span",{style:{fontSize:"0.72rem",color:i,fontWeight:"600",letterSpacing:"0.3px"},children:r})]}),YA=()=>{var E,$;const e=Lt(),{setMode:r}=dr(),{user:i}=gr(),n=xn();m.useEffect(()=>{i&&e("/matches",{replace:!0})},[i,e]);const[o,a]=m.useState("EROS"),[l,d]=m.useState("signup"),[p,u]=m.useState({email:"",password:""}),[g,h]=m.useState(!1),[x,y]=m.useState(null),[_,S]=m.useState(!1),k=m.useMemo(()=>({EROS:[{icon:Bt,color:"#D4C4A880",x:8,y:20,delay:0,size:22},{icon:nr,color:"#C5A06580",x:75,y:35,delay:1.5,size:18},{icon:Xt,color:"#D4C4A860",x:85,y:15,delay:3,size:16},{icon:Sn,color:"#8a7e6b60",x:20,y:65,delay:2,size:20},{icon:tl,color:"#C5A06550",x:60,y:75,delay:4,size:14},{icon:Qi,color:"#D4C4A850",x:40,y:45,delay:5,size:16},{icon:Qt,color:"#C5A06540",x:90,y:55,delay:3.5,size:18},{icon:cs,color:"#D4C4A840",x:5,y:80,delay:6,size:15}],FRIEND:[{icon:Ut,color:"#26A69A80",x:10,y:25,delay:0,size:22},{icon:Na,color:"#80CBC480",x:80,y:30,delay:1.5,size:18},{icon:ds,color:"#26A69A60",x:70,y:60,delay:3,size:16},{icon:Va,color:"#80CBC460",x:25,y:70,delay:2,size:20},{icon:Cc,color:"#26A69A50",x:55,y:45,delay:4,size:14},{icon:pi,color:"#80CBC440",x:92,y:15,delay:5,size:16},{icon:Ua,color:"#26A69A40",x:5,y:85,delay:3.5,size:18},{icon:oi,color:"#80CBC440",x:45,y:20,delay:6,size:15}],EROX:[{icon:en,color:"#ff333380",x:12,y:22,delay:0,size:22},{icon:ni,color:"#ff666680",x:78,y:28,delay:1.5,size:18},{icon:rr,color:"#ff333360",x:88,y:55,delay:3,size:16},{icon:Sr,color:"#ff999960",x:22,y:68,delay:2,size:20},{icon:Eh,color:"#ff333350",x:58,y:42,delay:4,size:14},{icon:oi,color:"#ff666640",x:5,y:40,delay:5,size:16},{icon:tl,color:"#ff333340",x:65,y:80,delay:3.5,size:18},{icon:nr,color:"#ff999940",x:42,y:15,delay:6,size:15}]}),[]),b={EROS:{primary:"#D4C4A8",secondary:"#8a7e6b",bg:"#070715",gradient:"radial-gradient(circle at 50% 30%, rgba(212, 196, 168, 0.12), transparent 60%)",text:"#F5F5DC",accent:"#C5A065",tagline:"L'Amour par Affinités",subtitle:"RENCONTRES AUTHENTIQUES",description:"Notre IA analyse votre personnalité pour créer des connexions qui ont du sens. Trouvez l'amour, pas le hasard.",features:[{icon:Sn,text:"Matching par affinités"},{icon:Sr,text:"Profils vérifiés"},{icon:Xt,text:"Ãvénements exclusifs"}]},FRIEND:{primary:"#26A69A",secondary:"#00695C",bg:"#0A0F1C",gradient:"radial-gradient(circle at 50% 30%, rgba(38, 166, 154, 0.15), transparent 60%)",text:"#E0F2F1",accent:"#80CBC4",tagline:"Vibrez avec votre Tribu",subtitle:"AMITIÃS & SORTIES",description:"Trouvez des potes, partagez des activités, créez des souvenirs. L'espace idéal pour élargir votre cercle social.",features:[{icon:Ut,text:"Groupes & sorties"},{icon:Qi,text:"Activités locales"},{icon:oi,text:"Soirées & events"}]},EROX:{primary:"#ff3333",secondary:"#550000",bg:"#050005",gradient:"radial-gradient(circle at 50% 30%, rgba(255, 51, 51, 0.12), transparent 60%)",text:"#ffcccc",accent:"#ff3333",tagline:"Explorez vos Désirs",subtitle:"ZONE DÃCOMPLEXÃE",description:"Un espace confidentiel où la passion et la liberté sont reines. Rencontrez des partenaires qui partagent vos envies.",features:[{icon:Sr,text:"Discrétion totale"},{icon:ni,text:"Sélection stricte"},{icon:rr,text:"Profils certifiés"}]}}[o],j=B=>{a(B),r(B)},T=B=>{u({...p,[B.target.name]:B.target.value}),y(null)},P=async B=>{B.preventDefault(),S(!0),y(null);try{localStorage.removeItem("userProfile");const{error:ee}=await D.auth.signInWithPassword({email:p.email,password:p.password});if(ee)throw ee;e("/matches")}catch(ee){y(ee.message==="Invalid login credentials"?"Email ou mot de passe incorrect.":ee.message)}finally{S(!1)}};if(n){const[B,ee]=m.useState(!1),[te,K]=m.useState("EROS"),[ne,Re]=m.useState(null),[Q,G]=m.useState(!1),F={EROS:{primary:"#D4C4A8",accent:"#C5A065",bg:"rgba(212, 196, 168, 0.12)",gradient:"linear-gradient(135deg, #D4C4A8, #C5A065)",tagline:t.jsxs(t.Fragment,{children:["L'Amour par",t.jsx("br",{}),"Affinités."]}),subtitle:"Notre IA analyse vos affinités pour créer des connexions qui ont du sens.",logo:"/logo_meeteros_gold.png",orbs:[{color:"#D4C4A8",size:200,x:-10,y:10},{color:"#C5A065",size:150,x:75,y:65},{color:"#D4C4A8",size:100,x:50,y:35}]},FRIEND:{primary:"#26A69A",accent:"#80CBC4",bg:"rgba(38, 166, 154, 0.12)",gradient:"linear-gradient(135deg, #26A69A, #80CBC4)",tagline:t.jsxs(t.Fragment,{children:["Vibrez avec",t.jsx("br",{}),"votre Tribu."]}),subtitle:"Ãlargissez votre cercle social autour d'activités, sorties et passions partagées.",logo:"/logo_meet_friend.png",orbs:[{color:"#26A69A",size:200,x:-10,y:10},{color:"#80CBC4",size:150,x:75,y:65},{color:"#26A69A",size:100,x:50,y:35}]},EROX:{primary:"#ff3333",accent:"#ff6666",bg:"rgba(255, 51, 51, 0.12)",gradient:"linear-gradient(135deg, #ff3333, #ff6666)",tagline:t.jsxs(t.Fragment,{children:["Explorez vos",t.jsx("br",{}),"Désirs."]}),subtitle:"Un espace confidentiel et décomplexé. Discrétion totale, profils certifiés.",logo:"/logo_meet_erox_new.png",orbs:[{color:"#ff3333",size:200,x:-10,y:10},{color:"#ff6666",size:150,x:75,y:65},{color:"#ff3333",size:100,x:50,y:35}]}}[te];return t.jsxs("div",{style:{width:"100vw",background:"#070715",color:"white",overflowX:"hidden"},children:[t.jsxs("div",{style:{minHeight:"100dvh",position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"0 24px",overflow:"hidden"},children:[t.jsx(ye.div,{initial:{opacity:0}
927,animate:{opacity:1},transition:{duration:.8},style:{position:"absolute",inset:0,background:`radial-gradient(circle at 50% 30%, ${F.bg}, transparent 60%)`,pointerEvents:"none"}},`bg-${te}`),F.orbs.map((A,M)=>t.jsx(uu,{color:A.color,size:A.size,x:A.x,y:A.y,delay:M*2},`${te}-orb-${M}`)),(E=k[te==="FRIEND"?"EROS":te])==null?void 0:E.map((A,M)=>t.jsx(e1,{...A},`hero-${te}-${M}`)),t.jsx("img",{src:"/logo_meetapps.png",alt:"MEETApps",style:{height:"40px",objectFit:"contain",opacity:.6,marginBottom:"10px",position:"relative",zIndex:10},onError:A=>{A.target.style.display="none",document.getElementById("mobile-fallback-title").style.display="block"}}),t.jsx("h1",{id:"mobile-fallback-title",style:{display:"none",fontFamily:"Playfair Display, serif",fontSize:"2.8rem",color:"#F5F5DC",marginBottom:"10px",position:"relative",zIndex:10},children:"MEETApps"}),t.jsx("p",{style:{fontSize:"1.1rem",color:"rgba(245, 245, 220, 0.7)",textAlign:"center",marginBottom:"16px",position:"relative",zIndex:10,fontFamily:"Outfit"},children:"La plateforme de toutes les rencontres."}),t.jsx("p",{style:{fontSize:"0.85rem",color:"rgba(255, 255, 255, 0.5)",textAlign:"center",marginBottom:"20px",position:"relative",zIndex:10,textTransform:"uppercase",letterSpacing:"2px",fontFamily:"Outfit"},children:"Choisissez votre espace"}),t.jsx(ye.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:.1},style:{display:"flex",gap:"8px",position:"relative",zIndex:10,marginBottom:"35px",background:"rgba(255,255,255,0.05)",borderRadius:"50px",padding:"4px",border:"1px solid rgba(255,255,255,0.08)"},children:[{id:"EROS",label:"Amour",icon:Bt,color:"#D4C4A8"},{id:"FRIEND",label:"Social",icon:Ut,color:"#26A69A"},{id:"EROX",label:"Désirs",icon:en,color:"#ff3333"}].map(A=>t.jsxs("button",{onClick:()=>{K(A.id),j(A.id)},style:{display:"flex",alignItems:"center",gap:"6px",padding:"8px 16px",borderRadius:"50px",border:"none",background:te===A.id?`${A.color}20`:"transparent",color:te===A.id?A.color:"rgba(255,255,255,0.35)",fontSize:"0.8rem",fontWeight:te===A.id?"700":"500",fontFamily:"Outfit",cursor:"pointer",transition:"all 0.3s",position:"relative"},children:[t.jsx(A.icon,{size:14}),A.label,te===A.id&&t.jsx(ye.div,{layoutId:"heroModeIndicator",style:{position:"absolute",inset:0,borderRadius:"50px",border:`1.5px solid ${A.color}40`,pointerEvents:"none"}})]},A.id))}),t.jsx(tr,{mode:"wait",children:t.jsx(ye.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.4,type:"spring"},style:{position:"relative",zIndex:10,marginBottom:"20px"},children:t.jsx("img",{src:F.logo,alt:"MEETapps",style:{height:"100px",objectFit:"contain"}})},`logo-${te}`)}),t.jsx(tr,{mode:"wait",children:t.jsx(ye.h1,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.4},style:{fontFamily:"Playfair Display, serif",fontSize:"2.8rem",lineHeight:1.15,textAlign:"center",color:"#F5F5DC",letterSpacing:"-0.5px",margin:"0 0 12px",position:"relative",zIndex:10},children:F.tagline},`tagline-${te}`)}),t.jsx(tr,{mode:"wait",children:t.jsx(ye.p,{initial:{opacity:0}
927,animate:{opacity:.7},exit:{opacity:0},transition:{duration:.3},style:{fontSize:"1rem",color:"rgba(245, 245, 220, 0.65)",textAlign:"center",lineHeight:1.6,margin:"0 0 32px",maxWidth:"320px",position:"relative",zIndex:10},children:F.subtitle},`sub-${te}`)}),t.jsxs(ye.button,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},transition:{delay:.3},whileTap:{scale:.97},onClick:()=>e("/signup",{state:{initialMode:te}}),style:{padding:"18px 56px",borderRadius:"50px",background:F.gradient,border:"none",color:"#000",fontWeight:"800",cursor:"pointer",fontSize:"1.15rem",fontFamily:"Outfit",letterSpacing:"0.5px",boxShadow:`0 8px 30px ${F.primary}30`,display:"flex",alignItems:"center",gap:"10px",position:"relative",zIndex:10,marginBottom:"16px",transition:"background 0.5s, box-shadow 0.5s"},children:["Commencer ",t.jsx(Pr,{size:20})]}),t.jsxs(ye.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.4},onClick:()=>G(!0),style:{fontSize:"0.85rem",color:`${F.primary}80`,cursor:"pointer",position:"relative",zIndex:10,marginBottom:"40px",transition:"color 0.5s"},children:["Déjà inscrit ? ",t.jsx("span",{onClick:()=>G(!0),style:{textDecoration:"underline",color:F.primary,transition:"color 0.5s",cursor:"pointer"},children:"Se connecter"})]}),t.jsxs(ye.div,{animate:{y:[0,10,0]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},style:{position:"absolute",bottom:"30px",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",color:"rgba(255,255,255,0.25)",zIndex:10},children:[t.jsx("span",{style:{fontSize:"0.7rem",letterSpacing:"2px",textTransform:"uppercase"},children:"Découvrir"}),t.jsx("svg",{width:"20",height:"12",viewBox:"0 0 20 12",fill:"none",children:t.jsx("path",{d:"M1 1L10 10L19 1",stroke:`${F.primary}60`,strokeWidth:"2",strokeLinecap:"round"})})]})]}),t.jsxs("div",{style:{padding:"70px 24px",background:"linear-gradient(180deg, #070715 0%, #0c0c1a 100%)"},children:[t.jsxs(ye.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-50px"},transition:{duration:.6},children:[t.jsx("p",{style:{fontSize:"0.7rem",letterSpacing:"3px",textTransform:"uppercase",color:"#D4C4A8",textAlign:"center",marginBottom:"8px",opacity:.6},children:"Comment ça marche"}),t.jsxs("h2",{style:{fontFamily:"Playfair Display, serif",fontSize:"1.8rem",textAlign:"center",color:"#F5F5DC",marginBottom:"40px",lineHeight:1.2},children:["Simple, Intelligent,",t.jsx("br",{}),"Authentique."]})]}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"24px"},children:[{icon:Sn,title:"Matching intelligent",desc:"Notre IA analyse vos affinités, vos passions et votre personnalité pour vous proposer les profils les plus compatibles.",color:"#D4C4A8",num:"01"},{icon:Qi,title:"3 espaces, 3 ambiances",desc:"Amour, Amitié ou Désirs : choisissez l'espace qui vous correspond. Changez de mode à tout moment.",color:"#26A69A",num:"02"},{icon:Xt,title:"Ãvénements exclusifs",desc:"Des soirées et sorties pour vous rencontrer en vrai. Parce que la vraie connexion se vit hors écran.",color:"#C5A065",num:"03"}].map((A,M)=>t.jsxs(ye.div,{initial:{opacity:0,x:M%2===0?-20:20},whileInView:{opacity:1,x:0},viewport:{once:!0,margin:"-30px"},transition:{duration:.5,delay:M*.1},style:{background:"rgba(255,255,255,0.03)",border:`1px solid ${A.color}15`,borderRadius:"20px",padding:"24px",position:"relative",overflow:"hidden"},children:[t.jsx("span",{style:{position:"absolute",top:"-5px",right:"12px",fontSize:"4rem",fontWeight:"900",color:`${A.color}08`,fontFamily:"Outfit",lineHeight:1,pointerEvents:"none"},children:A.num}),t.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"16px"},children:[t.jsx("div",{style:{width:"48px",height:"48px",borderRadius:"14px",background:`${A.color}12`,border:`1px solid ${A.color}25`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t.jsx(A.icon,{size:24,color:A.color,strokeWidth:1.5})}),t.jsxs("div",{children:[t.jsx("h3",{style:{fontSize:"1.05rem",fontWeight:"700",color:"#F5F5DC",margin:"0 0 6px",fontFamily:"Outfit"},children:A.title}),t.jsx("p",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.5)",lineHeight:1.6,margin:0},children:A.desc})]})]})]},M))})]}),t.jsxs("div",{style:{padding:"60px 24px",background:"linear-gradient(180deg, #0c0c1a 0%, #0a0a18 100%)"},children:[t.jsxs(ye.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-50px"},transition:{duration:.6},children:[t.jsx("p",{style:{fontSize:"0.7rem",letterSpacing:"3px",textTransform:"uppercase",color:"#C5A065",textAlign:"center",marginBottom:"8px",opacity:.6},children:"Un univers, trois espaces"}),t.jsxs("h2",{style:{fontFamily:"Playfair Display, serif",fontSize:"1.8rem",textAlign:"center",color:"#F5F5DC",marginBottom:"32px",lineHeight:1.2},children:["Choisissez votre",t.jsx("br",{}),"Espace."]})]}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[{id:"EROS",icon:Bt,color:"#D4C4A8",accent:"#C5A065",t
927itle:"EROS",subtitle:"Amour",tagline:"L'Amour par Affinités",desc:"Trouvez votre moitié grâce au matching intelligent.",logo:"/logo_meeteros_gold.png",features:[{icon:Sn,text:"Matching IA basé sur 50+ critères de compatibilité"},{icon:nr,text:"Profils vérifiés et certifiés"},{icon:Qi,text:"Ãvénements & soirées exclusives entre membres"},{icon:Qt,text:"Messagerie privée avec icebreakers intelligents"},{icon:Sr,text:"Environnement bienveillant et modéré"}]},{id:"FRIEND",icon:Ut,color:"#26A69A",accent:"#80CBC4",title:"FRIEND",subtitle:"Social",tagline:"Vibrez avec votre Tribu",desc:"Ãlargissez votre cercle social autour de passions partagées.",logo:"/logo_meet_friend.png",features:[{icon:Ut,text:"Rencontres amicales par centres d'intérêt"},{icon:Qi,text:"Activités et sorties de groupe organisées"},{icon:ds,text:"Communautés par passion (sport, musique, voyageâ¦)"},{icon:Qt,text:"Groupes de discussion thématiques"},{icon:cs,text:"Ambiance détendue, zéro pression"}]},{id:"EROX",icon:en,color:"#ff3333",accent:"#ff6666",title:"EROX",subtitle:"Désirs",tagline:"Explorez vos Désirs",desc:"Un espace confidentiel et décomplexé.",logo:"/logo_meet_erox_new.png",features:[{icon:rr,text:"Profils discrets avec mode incognito"},{icon:Sr,text:"Confidentialité totale & données chiffrées"},{icon:en,text:"Matching par désirs et affinités intimes"},{icon:Fr,text:"Photos privées avec accès contrôlé"},{icon:oi,text:"Rencontres express & événements privés"}]}].map((A,M)=>{const V=ne===A.id;return t.jsxs(ye.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-30px"},transition:{duration:.5,delay:M*.1},style:{background:V?`linear-gradient(135deg, ${A.color}14, ${A.color}06)`:`linear-gradient(135deg, ${A.color}08, ${A.color}03)`,border:`1px solid ${V?`${A.color}40`:`${A.color}20`}`,borderRadius:"20px",padding:"24px",position:"relative",overflow:"hidden",transition:"all 0.4s"},children:[t.jsx("div",{style:{position:"absolute",top:"-30px",right:"-30px",width:V?"160px":"100px",height:V?"160px":"100px",borderRadius:"50%",background:`${A.color}${V?"12":"08"}`,filter:"blur(30px)",pointerEvents:"none",transition:"all 0.4s"}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"14px",marginBottom:"10px"},children:[t.jsx("div",{style:{width:"44px",height:"44px",borderRadius:"50%",background:`linear-gradient(135deg, ${A.color}20, ${A.color}08)`,border:`1.5px solid ${A.color}40`,display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(A.icon,{size:22,color:A.color})}),t.jsxs("div",{style:{flex:1},children:[t.jsxs("h3",{style:{fontSize:"1rem",fontWeight:"700",color:A.color,margin:0,fontFamily:"Outfit"},children:[A.title," ",t.jsxs("span",{style:{fontWeight:"400",opacity:.7},children:["â ",A.subtitle]})]}),t.jsx("p",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.4)",margin:"2px 0 0",fontStyle:"italic"},children:A.tagline})]})]}),t.jsx("p",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.55)",lineHeight:1.6,margin:"0 0 14px"},children:A.desc}),!V&&t.jsxs("button",{onClick:()=>Re(A.id),style:{display:"flex",alignItems:"center",gap:"6px",background:`${A.color}15`,border:`1px solid ${A.color}30`,borderRadius:"50px",padding:"8px 20px",color:A.color,fontSize:"0.8rem",fontWeight:"600",fontFamily:"Outfit",cursor:"pointer",transition:"all 0.3s"},children:[t.jsx(rr,{size:14}),"Découvrir"]}),t.jsx(tr,{children:V&&t.jsxs(ye.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.4,ease:"easeInOut"},style:{overflow:"hidden"},children:[t.jsxs("div",{style:{marginTop:"8px",borderTop:`1px solid ${A.color}15`,paddingTop:"16px",display:"flex",flexDirection:"column",gap:"12px"},children:[t.jsx("p",{style:{fontSize:"0.7rem",letterSpacing:"2px",textTransform:"uppercase",color:A.color,opacity:.6,margin:"0 0 4px"},children:"Ce qui vous attend"}),A.features.map((H,N)=>t.jsxs(ye.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:N*.08},style:{display:"flex",alignItems:"center",gap:"12px"},children:[t.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"10px",background:`${A.color}10`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t.jsx(H.icon,{size:16,color:A.color,strokeWidth:1.5})}),t.jsx("span",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.65)",lineHeight:1.5},children:H.text})]},N))]}),t.jsxs("div",{style:{display:"flex",gap:"12px",marginTop:"20px"},children:[t.jsxs("button",{onClick:()=>{j(A.id),e("/signup",{state:{initialMode:A.id}})},style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",background:`linear-gradient(135deg, ${A.color}, ${A.accent})`,border:"none",borderRadius:"50px",padding:"14px 24px",color:A.id==="EROS"?"#000":"#fff",fontSize:"0.95rem",fontWeight:"700",fontFamily:"Outfit",curs
927or:"pointer",boxShadow:`0 6px 24px ${A.color}30`},children:["Rejoindre ",t.jsx(Pr,{size:18})]}),t.jsx("button",{onClick:()=>Re(null),style:{background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"50px",padding:"14px 18px",color:"rgba(255,255,255,0.5)",fontSize:"0.8rem",fontFamily:"Outfit",cursor:"pointer"},children:"Fermer"})]})]})})]},A.id)})})]}),t.jsxs("div",{style:{padding:"50px 24px",background:"linear-gradient(180deg, #070715 0%, #0a0a18 100%)"},children:[t.jsxs(ye.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-50px"},transition:{duration:.6},children:[t.jsx("p",{style:{fontSize:"0.7rem",letterSpacing:"3px",textTransform:"uppercase",color:"#26A69A",textAlign:"center",marginBottom:"8px",opacity:.6},children:"Votre sécurité avant tout"}),t.jsxs("h2",{style:{fontFamily:"Playfair Display, serif",fontSize:"1.6rem",textAlign:"center",color:"#F5F5DC",marginBottom:"28px",lineHeight:1.2},children:["Rencontrez en toute",t.jsx("br",{}),"sérénité."]})]}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"14px"},children:[{icon:Sr,title:"Profils vérifiés",desc:"Chaque profil est vérifié pour garantir des rencontres authentiques.",color:"#26A69A"},{icon:Fr,title:"Données chiffrées",desc:"Vos données personnelles sont protégées avec un chiffrement de bout en bout.",color:"#D4C4A8"},{icon:rr,title:"Modération active",desc:"Notre équipe modère en continu pour un espace bienveillant et respectueux.",color:"#C5A065"}].map((A,M)=>t.jsxs(ye.div,{initial:{opacity:0,x:-15},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.4,delay:M*.1},style:{display:"flex",alignItems:"center",gap:"16px",padding:"18px",background:"rgba(255,255,255,0.02)",borderRadius:"16px",border:"1px solid rgba(255,255,255,0.05)"},children:[t.jsx("div",{style:{width:"42px",height:"42px",borderRadius:"12px",background:`${A.color}10`,border:`1px solid ${A.color}20`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t.jsx(A.icon,{size:20,color:A.color})}),t.jsxs("div",{children:[t.jsx("h4",{style:{fontSize:"0.95rem",fontWeight:"700",color:"#F5F5DC",margin:"0 0 3px"},children:A.title}),t.jsx("p",{style:{fontSize:"0.78rem",color:"rgba(255,255,255,0.4)",lineHeight:1.5,margin:0},children:A.desc})]})]},M))})]}),t.jsxs("div",{style:{padding:"60px 24px 40px",background:"linear-gradient(180deg, #0a0a18 0%, #070715 100%)",textAlign:"center"},children:[t.jsxs(ye.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-50px"},transition:{duration:.6},children:[t.jsxs("h2",{style:{fontFamily:"Playfair Display, serif",fontSize:"1.8rem",color:"#F5F5DC",marginBottom:"10px",lineHeight:1.2},children:["Prêt(e) à rencontrer",t.jsx("br",{}),"quelqu'un ?"]}),t.jsx("p",{style:{fontSize:"0.88rem",color:"rgba(255,255,255,0.45)",marginBottom:"28px",lineHeight:1.5},children:"Inscrivez-vous gratuitement et commencez à faire de belles rencontres."}),t.jsxs(ye.button,{whileTap:{scale:.97},onClick:()=>e("/signup",{state:{initialMode:"EROS"}}),style:{padding:"18px 40px",borderRadius:"50px",background:"linear-gradient(135deg, #D4C4A8, #C5A065)",border:"none",color:"#000",fontWeight:"800",cursor:"pointer",fontSize:"1.05rem",fontFamily:"Outfit",boxShadow:"0 8px 30px rgba(212,196,168,0.3)",display:"inline-flex",alignItems:"center",gap:"10px",marginBottom:"12px"},children:["Rejoindre MEETapps ",t.jsx(Pr,{size:20})]}),t.jsx("p",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.25)",marginBottom:"32px"},children:"Gratuit · 2 min d'inscription · Sans engagement"})]}),t.jsx("div",{style:{borderTop:"1px solid rgba(255,255,255,0.06)",paddingTop:"28px",textAlign:"center"},children:t.jsx("button",{onClick:()=>G(!0),style:{background:"transparent",border:"1.5px solid rgba(212,196,168,0.25)",borderRadius:"50px",padding:"14px 32px",color:"#D4C4A8",cursor:"pointer",fontSize:"0.9rem",fontFamily:"Inter, sans-serif",fontWeight:"600"},children:"Déjà inscrit ? Se connecter"})})]}),t.jsx(px,{style:{borderTop:"1px solid rgba(255,255,255,0.05)"}}),t.jsx(tr,{children:Q&&t.jsxs(t.Fragment,{children:[t.jsx(ye.div,{initial:{opacity:0}
927,animate:{opacity:1},exit:{opacity:0},transition:{duration:.25},onClick:()=>G(!1),style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.65)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",zIndex:9998}}),t.jsxs(ye.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{type:"spring",damping:28,stiffness:350},style:{position:"fixed",bottom:0,left:0,right:0,background:"linear-gradient(180deg, #14142a 0%, #0c0c1a 100%)",borderRadius:"24px 24px 0 0",padding:"12px 24px 40px",zIndex:9999,maxHeight:"85vh",overflowY:"auto",border:"1px solid rgba(212,196,168,0.12)",borderBottom:"none",boxShadow:"0 -8px 40px rgba(0,0,0,0.5)"},children:[t.jsx("div",{style:{display:"flex",justifyContent:"center",marginBottom:"16px"},children:t.jsx("div",{style:{width:"40px",height:"4px",borderRadius:"2px",background:"rgba(255,255,255,0.15)"}})}),t.jsx("h3",{style:{fontSize:"1.2rem",fontWeight:"700",color:"#F5F5DC",margin:"0 0 20px",textAlign:"center",fontFamily:"Inter, sans-serif"},children:"Connexion"}),t.jsx("form",{onSubmit:P,children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",background:"rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"14px",padding:"4px 14px"},children:[t.jsx(Vr,{size:16,color:"#D4C4A8",style:{opacity:.7,flexShrink:0}}),t.jsx("input",{type:"email",name:"email",placeholder:"Email",required:!0,value:p.email,onChange:T,onFocus:()=>mr(),style:{width:"100%",padding:"14px 10px",background:"transparent",border:"none",color:"white",outline:"none",fontSize:"0.95rem"}})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",background:"rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"14px",padding:"4px 14px"},children:[t.jsx(Fr,{size:16,color:"#D4C4A8",style:{opacity:.7,flexShrink:0}}),t.jsx("input",{type:g?"text":"password",name:"password",placeholder:"Mot de passe",required:!0,value:p.password,onChange:T,onFocus:()=>mr(),style:{width:"100%",padding:"14px 10px",background:"transparent",border:"none",color:"white",outline:"none",fontSize:"0.95rem"}}),t.jsx("button",{type:"button",onClick:()=>h(!g),style:{background:"none",border:"none",color:"rgba(255,255,255,0.3)",cursor:"pointer",padding:"4px",flexShrink:0},children:t.jsx(rr,{size:16})})]}),t.jsx("div",{style:{textAlign:"right"},children:t.jsx("span",{onClick:()=>{G(!1),e("/forgot-password")},style:{fontSize:"0.73rem",color:"rgba(255,255,255,0.35)",cursor:"pointer"},children:"Mot de passe oublié ?"})}),x&&t.jsx("div",{style:{color:"#ff6b6b",background:"rgba(255,107,107,0.1)",padding:"10px",borderRadius:"10px",textAlign:"center",fontSize:"0.82rem"},children:x}),t.jsxs(ye.button,{type:"submit",disabled:_,whileTap:{scale:.97},style:{padding:"16px",borderRadius:"14px",background:"linear-gradient(135deg, #D4C4A8, #C5A065)",border:"none",color:"#000",fontWeight:"700",cursor:"pointer",display:"flex",justifyContent:"center",gap:"8px",boxShadow:"0 6px 20px rgba(212,196,168,0.25)",fontSize:"1rem",fontFamily:"Inter, sans-serif",opacity:_?.7:1},children:[_?"Connexion...":"Se connecter",!_&&t.jsx(Pr,{size:18})]})]})})]})]})})]})}const I=[{id:"EROS",icon:Bt,color:"#D4C4A8",accent:"#C5A065",title:"EROS",subtitle:"Amour",tagline:"L'Amour par Affinités",desc:"Trouvez votre moitié grâce au matching intelligent basé sur vos affinités profondes.",logo:"/logo_meeteros_gold.png",features:[{icon:Sn,text:"Matching IA basé sur 50+ critères"},{icon:nr,text:"Profils vérifiés et certifiés"},{icon:Qi,text:"Ãvénements exclusifs entre membres"},{icon:Qt,text:"Icebreakers intelligents"}]},{id:"FRIEND",icon:Ut,color:"#26A69A",accent:"#80CBC4",title:"FRIEND",subtitle:"Social",tagline:"Vibrez avec votre Tribu",desc:"Ãlargissez votre cercle social autour de passions et activités partagées.",logo:"/logo_meet_friend.png",features:[{icon:Ut,text:"Rencontres amicales par affinités"},{icon:Qi,text:"Sorties de groupe organisées"},{icon:ds,text:"Communautés par passion"},{icon:cs,text:"Ambiance détendue, zéro pression"}]},{id:"EROX",icon:en,color:"#ff3333",accent:"#ff6666",title:"EROX",subtitle:"Désirs",tagline:"Explorez vos Désirs",desc:"Un espace confidentiel et décomplexé. Discrétion totale, profils certifiés.",logo:"/logo_meet_erox_new.png",features:[{icon:rr,text:"Mode incognito & discrétion"},{icon:Sr,text:"Données chiffrées de bout en bout"},{icon:en,text:"Matching par affinités intimes"},{icon:Fr,text:"Photos privées à accès contrôlé"}]}],[R,O]=m.useState(null);return t.jsxs("div",{style:{width:"100vw",background:"#070715",color:"white",overflowX:"hidden",overflowY:"auto"},children:[t.jsxs("div",{style:{minHeight:"100vh",position:"relative",display:"flex",alignItems:"center",overflow:"hidden",padding:"0 8%"},children:[t.jsx(ye.div,{initial:{opacity:0}
927,animate:{opacity:1},transition:{duration:1.2},style:{position:"absolute",inset:0,background:b.gradient,pointerEvents:"none"}},`dbg-${o}`),($=k[o])==null?void 0:$.map((B,ee)=>t.jsx(e1,{...B,size:B.size+4},`desk-${o}-${ee}`)),t.jsx(uu,{color:b.primary,size:300,x:10,y:20,delay:0}),t.jsx(uu,{color:b.accent,size:200,x:75,y:60,delay:2}),t.jsx(uu,{color:b.primary,size:150,x:50,y:80,delay:4}),t.jsxs("div",{style:{position:"relative",zIndex:10,width:"100%",display:"grid",gridTemplateColumns:"1fr 1fr",gap:"60px",alignItems:"center"},children:[t.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsxs(ye.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},style:{width:"100%",maxWidth:"420px",background:"rgba(10, 10, 20, 0.45)",backdropFilter:"blur(30px)",WebkitBackdropFilter:"blur(30px)",border:`1px solid ${b.primary}25`,borderRadius:"32px",padding:"40px",boxShadow:`0 30px 80px -15px rgba(0,0,0,0.8), 0 0 0 1px ${b.primary}08`,position:"relative",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"1px",background:`linear-gradient(90deg, transparent, ${b.primary}60, transparent)`}}),t.jsx("div",{style:{textAlign:"center",marginBottom:"28px"},children:o==="FRIEND"?t.jsx("img",{src:"/logo_meet_friend.png",alt:"MEET Friend",style:{height:"90px",objectFit:"contain"}}):o==="EROX"?t.jsx("img",{src:"/logo_meet_erox_new.png",alt:"MEET Erox",style:{height:"100px",objectFit:"contain"}}):t.jsx("img",{src:"/logo_meeteros_gold.png",alt:"MEET Eros",style:{height:"100px",objectFit:"contain"}})}),t.jsx("div",{style:{display:"flex",marginBottom:"25px",borderBottom:`1px solid ${b.primary}20`},children:["signup","login"].map(B=>t.jsx("button",{onClick:()=>d(B),style:{flex:1,padding:"12px",border:"none",background:"transparent",color:l===B?b.primary:"rgba(255,255,255,0.4)",borderBottom:l===B?`2px solid ${b.primary}`:"2px solid transparent",cursor:"pointer",fontSize:"0.95rem",fontFamily:"Outfit",transition:"all 0.3s"},children:B==="signup"?"⨠Rejoindre":"Connexion"},B))}),t.jsx("form",{onSubmit:l==="login"?P:B=>{B.preventDefault(),e("/signup",{state:{initialMode:o}})},children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"18px"},children:[l==="login"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",background:"rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"14px",padding:"5px 15px"},children:[t.jsx(Vr,{size:18,color:b.primary,style:{opacity:.7}}),t.jsx("input",{type:"email",name:"email",placeholder:"Email",required:!0,value:p.email,onChange:T,onFocus:()=>mr(),style:{width:"100%",padding:"14px",background:"transparent",border:"none",color:"white",outline:"none"}})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",background:"rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"14px",padding:"5px 15px"},children:[t.jsx(Fr,{size:18,color:b.primary,style:{opacity:.7}}),t.jsx("input",{type:g?"text":"password",name:"password",placeholder:"Mot de passe",required:!0,value:p.password,onChange:T,onFocus:()=>mr(),style:{width:"100%",padding:"14px",background:"transparent",border:"none",color:"white",outline:"none"}}),t.jsx("button",{type:"button",onClick:()=>h(!g),style:{background:"none",border:"none",color:"rgba(255,255,255,0.3)",cursor:"pointer"},children:t.jsx(rr,{size:18})})]}),t.jsx("div",{style:{textAlign:"right"},children:t.jsx("span",{onClick:()=>e("/forgot-password"),style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",cursor:"pointer"},children:"Mot de passe oublié ?"})})]}),l==="signup"&&t.jsxs(t.Fragment,{children:[t.jsx("p",{style:{fontSize:"1rem",color:"rgba(255,255,255,0.75)",lineHeight:"1.6",textAlign:"center",margin:0},children:b.description}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"10px",justifyContent:"center"},children:b.features.map((B,ee)=>t.jsx(ZA,{icon:B.icon,text:B.text,color:b.primary,delay:.15*ee},ee))})]}),x&&t.jsx("div",{style:{color:"#ff6b6b",background:"rgba(255,107,107,0.1)",padding:"10px",borderRadius:"8px",textAlign:"center"},children:x}),t.jsxs(ye.button,{type:"submit",disabled:_,whileHover:{scale:1.02},whileTap:{scale:.98},style:{padding:"18px",borderRadius:"14px",background:`linear-gradient(135deg, ${b.primary}, ${b.accent})`,border:"none",color:o==="EROX"?"white":"#000",fontWeight:"700",cursor:"pointer",display:"flex",justifyContent:"center",gap:"10px",boxShadow:`0 10px 40px -5px ${b.primary}40`,transition:"all 0.3s",fontSize:"1rem",fontFamily:"Outfit",opacity:_?.7:1}
927,children:[_?"Connexion...":l==="login"?"Se connecter":"Commencer l'expérience",!_&&t.jsx(Pr,{size:20})]}),l==="signup"&&t.jsx("p",{style:{textAlign:"center",fontSize:"0.78rem",color:"rgba(255,255,255,0.3)",margin:0},children:"Gratuit · 2 min d'inscription · Sans engagement"})]})})]},o)}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",paddingLeft:"40px",textAlign:"left"},children:[t.jsxs("div",{style:{marginBottom:"40px"},children:[t.jsx("img",{src:"/logo_meetapps.png",alt:"MEETApps",style:{height:"45px",opacity:.6,marginBottom:"16px",objectFit:"contain"},onError:B=>{B.target.style.display="none",document.getElementById("desk-fallback").style.display="block"}}),t.jsx("h1",{id:"desk-fallback",style:{display:"none",fontFamily:"Playfair Display, serif",fontSize:"3.5rem",color:"#FFF",marginBottom:"16px"},children:"MEETApps"}),t.jsx("p",{style:{fontSize:"1.3rem",color:"rgba(220,220,230,0.8)",fontFamily:"Outfit",marginBottom:"8px"},children:"La plateforme de toutes les rencontres."}),t.jsx("p",{style:{fontSize:"0.9rem",color:"rgba(255,255,255,0.5)",textTransform:"uppercase",letterSpacing:"2px",fontFamily:"Outfit"},children:"Choisissez votre espace"})]}),t.jsx("div",{style:{marginBottom:"40px"},children:t.jsx("div",{style:{display:"flex",gap:"14px"},children:[{id:"FRIEND",label:"SOCIAL",icon:Ut,color:"#26A69A"},{id:"EROS",label:"AMOUR",icon:Bt,color:"#D4C4A8"},{id:"EROX",label:"DÃSIRS",icon:en,color:"#ff3333"}].map(B=>{const ee=o===B.id;return t.jsxs(ye.button,{onClick:()=>j(B.id),whileHover:{scale:1.05,y:-2},whileTap:{scale:.97},style:{flex:1,padding:"15px 10px",borderRadius:"18px",background:ee?`linear-gradient(135deg, ${B.color}20, ${B.color}08)`:"rgba(255,255,255,0.03)",border:`1.5px solid ${ee?B.color:"rgba(255,255,255,0.08)"}`,cursor:"pointer",transition:"background 0.3s, border 0.3s",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",boxShadow:ee?`0 8px 30px ${B.color}20`:"none"},children:[t.jsx(B.icon,{size:20,color:ee?B.color:"rgba(255,255,255,0.35)"}),t.jsx("span",{style:{fontSize:"0.9rem",fontWeight:ee?"700":"500",color:ee?B.color:"rgba(255,255,255,0.35)",letterSpacing:"1px",fontFamily:"Outfit"},children:B.label})]},B.id)})})}),t.jsx(tr,{mode:"wait",children:t.jsxs(ye.div,{initial:{opacity:0,x:30},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.6},children:[t.jsx("div",{style:{display:"flex",alignItems:"center",gap:"16px",marginBottom:"20px"},children:t.jsxs("h2",{style:{fontSize:"0.85rem",textTransform:"uppercase",letterSpacing:"4px",color:b.primary,display:"flex",alignItems:"center",gap:"12px"},children:[t.jsx("span",{style:{width:"40px",height:"1px",background:b.primary}}),b.subtitle]})}),t.jsxs("h1",{style:{fontFamily:"Playfair Display, serif",fontSize:"clamp(2.5rem, 4vw, 4rem)",lineHeight:"1.08",marginBottom:"24px",color:b.text},children:[b.tagline,"."]}),t.jsx("p",{style:{fontSize:"1.15rem",color:"rgba(220, 220, 230, 0.65)",maxWidth:"520px",lineHeight:"1.7",fontWeight:"300"},children:b.description})]},o)})]})]}),t.jsxs(ye.div,{animate:{y:[0,12,0]},transition:{duration:2.5,repeat:1/0,ease:"easeInOut"},style:{position:"absolute",bottom:"40px",left:"50%",transform:"translateX(-50%)",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",color:"rgba(255,255,255,0.2)",zIndex:10},children:[t.jsx("span",{style:{fontSize:"0.7rem",letterSpacing:"3px",textTransform:"uppercase"},children:"Découvrir"}),t.jsx("svg",{width:"20",height:"12",viewBox:"0 0 20 12",fill:"none",children:t.jsx("path",{d:"M1 1L10 10L19 1",stroke:`${b.primary}50`,strokeWidth:"2",strokeLinecap:"round"})})]})]}),t.jsxs("div",{style:{padding:"120px 8%",background:"linear-gradient(180deg, #070715 0%, #0c0c1a 100%)",position:"relative"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:"15%",right:"15%",height:"1px",background:"linear-gradient(90deg, transparent, rgba(212,196,168,0.15), transparent)"}}),t.jsxs(ye.div,{initial:{opacity:0,y:40},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{duration:.7},children:[t.jsx("p",{style:{fontSize:"0.8rem",letterSpacing:"4px",textTransform:"uppercase",color:"#D4C4A8",textAlign:"center",marginBottom:"12px",opacity:.5},children:"Comment ça marche"}),t.jsx("h2",{style:{fontFamily:"Playfair Display, serif",fontSize:"3rem",textAlign:"center",color:"#F5F5DC",marginBottom:"60px",lineHeight:1.15},children:"Simple, Intelligent, Authentique."})]}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:"30px",maxWidth:"1100px",margin:"0 auto"},children:[{icon:Sn,title:"Matching intelligent",desc:"Notre IA analyse vos affinités, passions et personnalité pour des profils ultra-compatibles.",color:"#D4C4A8",num:"01"}
927,{icon:Qi,title:"3 espaces, 3 ambiances",desc:"Amour, Amitié ou Désirs : choisissez l'espace qui vous correspond. Changez à tout moment.",color:"#26A69A",num:"02"},{icon:Xt,title:"Ãvénements exclusifs",desc:"Soirées et sorties pour vous rencontrer en vrai. La vraie connexion se vit hors écran.",color:"#C5A065",num:"03"}].map((B,ee)=>t.jsxs(ye.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-50px"},transition:{duration:.5,delay:ee*.15},whileHover:{y:-8,transition:{duration:.3}},style:{background:"rgba(255,255,255,0.025)",border:`1px solid ${B.color}12`,borderRadius:"24px",padding:"40px 30px",position:"relative",overflow:"hidden",transition:"border-color 0.3s"},children:[t.jsx("span",{style:{position:"absolute",top:"-10px",right:"15px",fontSize:"5rem",fontWeight:"900",color:`${B.color}06`,fontFamily:"Outfit",lineHeight:1,pointerEvents:"none"},children:B.num}),t.jsx("div",{style:{width:"56px",height:"56px",borderRadius:"16px",background:`${B.color}10`,border:`1px solid ${B.color}20`,display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"20px"},children:t.jsx(B.icon,{size:28,color:B.color,strokeWidth:1.5})}),t.jsx("h3",{style:{fontSize:"1.2rem",fontWeight:"700",color:"#F5F5DC",margin:"0 0 10px",fontFamily:"Outfit"},children:B.title}),t.jsx("p",{style:{fontSize:"0.92rem",color:"rgba(255,255,255,0.45)",lineHeight:1.7,margin:0},children:B.desc})]},ee))})]}),t.jsxs("div",{style:{padding:"100px 8%",background:"linear-gradient(180deg, #0c0c1a 0%, #0a0a18 100%)"},children:[t.jsxs(ye.div,{initial:{opacity:0,y:40},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{duration:.7},children:[t.jsx("p",{style:{fontSize:"0.8rem",letterSpacing:"4px",textTransform:"uppercase",color:"#C5A065",textAlign:"center",marginBottom:"12px",opacity:.5},children:"Un univers, trois espaces"}),t.jsx("h2",{style:{fontFamily:"Playfair Display, serif",fontSize:"3rem",textAlign:"center",color:"#F5F5DC",marginBottom:"60px",lineHeight:1.15},children:"Choisissez votre Espace."})]}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:"28px",maxWidth:"1200px",margin:"0 auto"},children:I.map((B,ee)=>t.jsxs(ye.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-50px"},transition:{duration:.5,delay:ee*.12},whileHover:{y:-6},onMouseEnter:()=>O(B.id),onMouseLeave:()=>O(null),style:{background:R===B.id?`linear-gradient(135deg, ${B.color}10, ${B.color}04)`:`linear-gradient(135deg, ${B.color}06, ${B.color}02)`,border:`1px solid ${R===B.id?`${B.color}35`:`${B.color}15`}`,borderRadius:"24px",padding:"36px",position:"relative",overflow:"hidden",transition:"all 0.4s"},children:[t.jsx("div",{style:{position:"absolute",top:"-30px",right:"-30px",width:R===B.id?"180px":"100px",height:R===B.id?"180px":"100px",borderRadius:"50%",background:`${B.color}${R===B.id?"10":"06"}`,filter:"blur(40px)",pointerEvents:"none",transition:"all 0.4s"}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"14px",marginBottom:"16px"},children:[t.jsx("div",{style:{width:"50px",height:"50px",borderRadius:"50%",background:`linear-gradient(135deg, ${B.color}18, ${B.color}06)`,border:`1.5px solid ${B.color}35`,display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(B.icon,{size:24,color:B.color})}),t.jsxs("div",{children:[t.jsxs("h3",{style:{fontSize:"1.1rem",fontWeight:"700",color:B.color,margin:0,fontFamily:"Outfit"},children:[B.title," ",t.jsxs("span",{style:{fontWeight:"400",opacity:.7},children:["â ",B.subtitle]})]}),t.jsx("p",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.35)",margin:"3px 0 0",fontStyle:"italic"},children:B.tagline})]})]}),t.jsx("p",{style:{fontSize:"0.9rem",color:"rgba(255,255,255,0.5)",lineHeight:1.6,margin:"0 0 20px"},children:B.desc}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px",borderTop:`1px solid ${B.color}10`,paddingTop:"18px"},children:B.features.map((te,K)=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx("div",{style:{width:"30px",height:"30px",borderRadius:"10px",background:`${B.color}0A`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t.jsx(te.icon,{size:14,color:B.color,strokeWidth:1.5})}),t.jsx("span",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.55)",lineHeight:1.4},children:te.text})]},K))}),t.jsxs(ye.button,{whileHover:{scale:1.03},whileTap:{scale:.97},onClick:()=>{j(B.id),e("/signup",{state:{initialMode:B.id}})},style:{width:"100%",marginTop:"24px",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",background:`linear-gradient(135deg, ${B.color}, ${B.accent})`,border:"none",borderRadius:"14px",padding:"14px",color:B.id==="EROS"?"#000":"#fff",fontSize:"0.95rem",fontWeight:"700",fontFamily:"Outfit",curs
927or:"pointer",boxShadow:`0 6px 24px ${B.color}25`},children:["Rejoindre ",t.jsx(Pr,{size:18})]})]},B.id))})]}),t.jsxs("div",{style:{padding:"100px 8%",background:"linear-gradient(180deg, #070715 0%, #0a0a18 100%)"},children:[t.jsxs(ye.div,{initial:{opacity:0,y:40},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{duration:.7},children:[t.jsx("p",{style:{fontSize:"0.8rem",letterSpacing:"4px",textTransform:"uppercase",color:"#26A69A",textAlign:"center",marginBottom:"12px",opacity:.5},children:"Votre sécurité avant tout"}),t.jsx("h2",{style:{fontFamily:"Playfair Display, serif",fontSize:"3rem",textAlign:"center",color:"#F5F5DC",marginBottom:"60px",lineHeight:1.15},children:"Rencontrez en toute sérénité."})]}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:"28px",maxWidth:"1000px",margin:"0 auto"},children:[{icon:Sr,title:"Profils vérifiés",desc:"Chaque profil est vérifié pour garantir des rencontres authentiques et de confiance.",color:"#26A69A"},{icon:Fr,title:"Données chiffrées",desc:"Vos données personnelles sont protégées avec un chiffrement de bout en bout.",color:"#D4C4A8"},{icon:rr,title:"Modération active",desc:"Notre équipe modère en continu pour un espace bienveillant et respectueux.",color:"#C5A065"}].map((B,ee)=>t.jsxs(ye.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4,delay:ee*.1},whileHover:{y:-5},style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",padding:"36px 24px",background:"rgba(255,255,255,0.02)",borderRadius:"20px",border:"1px solid rgba(255,255,255,0.05)",transition:"all 0.3s"},children:[t.jsx("div",{style:{width:"56px",height:"56px",borderRadius:"16px",background:`${B.color}10`,border:`1px solid ${B.color}20`,display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"18px"},children:t.jsx(B.icon,{size:26,color:B.color})}),t.jsx("h4",{style:{fontSize:"1.1rem",fontWeight:"700",color:"#F5F5DC",margin:"0 0 8px",fontFamily:"Outfit"},children:B.title}),t.jsx("p",{style:{fontSize:"0.88rem",color:"rgba(255,255,255,0.4)",lineHeight:1.6,margin:0},children:B.desc})]},ee))})]}),t.jsx("div",{style:{padding:"100px 8% 60px",background:"linear-gradient(180deg, #0a0a18 0%, #070715 100%)",textAlign:"center"},children:t.jsxs(ye.div,{initial:{opacity:0,y:40},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{duration:.7},children:[t.jsxs("h2",{style:{fontFamily:"Playfair Display, serif",fontSize:"3rem",color:"#F5F5DC",marginBottom:"16px",lineHeight:1.15},children:["Prêt(e) à rencontrer",t.jsx("br",{}),"quelqu'un ?"]}),t.jsx("p",{style:{fontSize:"1.1rem",color:"rgba(255,255,255,0.45)",marginBottom:"40px",lineHeight:1.6},children:"Inscrivez-vous gratuitement et commencez à faire de belles rencontres."}),t.jsxs(ye.button,{whileHover:{scale:1.05},whileTap:{scale:.97},onClick:()=>e("/signup",{state:{initialMode:"EROS"}}),style:{padding:"20px 50px",borderRadius:"50px",background:"linear-gradient(135deg, #D4C4A8, #C5A065)",border:"none",color:"#000",fontWeight:"800",cursor:"pointer",fontSize:"1.15rem",fontFamily:"Outfit",boxShadow:"0 10px 40px rgba(212,196,168,0.3)",display:"inline-flex",alignItems:"center",gap:"12px",marginBottom:"14px"},children:["Rejoindre MEETapps ",t.jsx(Pr,{size:22})]}),t.jsx("p",{style:{fontSize:"0.78rem",color:"rgba(255,255,255,0.25)"},children:"Gratuit · 2 min d'inscription · Sans engagement"})]})}),t.jsx(px,{style:{borderTop:"1px solid rgba(255,255,255,0.05)"}})]})},XA={success:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:t.jsx("path",{d:"M20 6L9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),error:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:t.jsx("path",{d:"M18 6L6 18M6 6l12 12",strokeLinecap:"round",strokeLinejoin:"round"})}),warning:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:t.jsx("path",{d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z",strokeLinecap:"round",strokeLinejoin:"round"})}),info:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[t.jsx("circle",{cx:"12",cy:"12",r:"10"}),t.jsx("path",{d:"M12 16v-4m0-4h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},KA=({id:e,message:r,type:i="info",onClose:n})=>{const[o,a]=m.useState(!1),l=()=>{a(!0),setTimeout(()=>n(),300)};return t.jsxs("div",{className:`toast toast-${i} ${o?"toast-exit":""}`,children:[t.jsx("div",{className:"toast-icon",children:XA[i]}),t.jsx("div",{className:"toast-content",children:t.jsx("p",{className:"toast-message",children:r})}),t.jsx("button",{className:"toast-close",onClick:l,"aria-label":"Fermer",children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:t.jsx("path",{d:"M18 6L6 18M6 6l12 12",strokeLinecap:"round",strokeLinejoin:"round"})})})]})},ES=m.createContext(null),si=()=>{const e=m.useContext(ES);if(!e)throw new Error("useToast must be used within a ToastProvider");return e},QA=({children:e})=>{const[r,i]=m.useState([]),n=m.useCallback((u,g="info",h=4e3)=>{const x=Date.now()+Math.random();return i(y=>[...y,{id:x,message:u,type:g,duration:h}]),setTimeout(()=>{i(y=>y.filter(_=>_.id!==x))},h),x},[]),o=m.useCallback(u=>{i(g=>g.filter(h=>h.id!==u))},[]),a=m.useCallback((u,g)=>(id(),n(u,"success",g)),[n]),l=m.useCallback((u,g)=>(gA(),n(u,"error",g)),[n]),d=m.useCallback((u,g)=>(mr(),n(u,"warning",g)),[n]),p=m.useCallback((u,g)=>n(u,"info",g),[n]);return t.jsxs(ES.Provider,{value:{success:a,error:l,warning:d,info:p,removeToast:o},children:[e,t.jsx("div",{className:"toast-container",children:r.map(u=>t.jsx(KA,{...u,onClose:()=>o(u.id)},u.id))})]})},e7=()=>{si();const e=Lt();if(xn())return t.jsx(ih,{to:"/",replace:!0});const[i,n]=m.useState({email:"",password:""}),[o,a]=m.useState(!1),[l,d]=m.useState(!1),p=g=>{const{name:h,value:x}=g.target;n(y=>({...y,[h]:x}))},u=async g=>{g.preventDefault(),d(!0);try{localStorage.removeItem("userProfile"),localStorage.removeItem("localAvatar");const{data:{user:h},error:x}=await D.auth.signInWithPassword({email:i.email,password:i.password});if(x)throw x;let y=null;try{const{data:_}=await D.from("profiles").select("role").eq("id",h.id).maybeSingle();y=_==null?void 0:_.role}catch(_){console.warn("Role fetch failed (ignored):",_)}console.log("Login Role Check:",y),e(y==="admin"?"/admin":"/matches")}catch(h){alert("Erreur de connexion : "+h.message)}finally{d(!1)}};return t.jsxs("div",{style:{minHeight:"100vh",background:"var(--bg-deep)",padding:"20px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[t.jsxs("button",{onClick:()=>e("/"),style:{position:"absolute",top:"20px",left:"20px",background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",display:"flex",alignItems:"center",gap:"5px"},children:[t.jsx(Hr,{size:20})," Retour"]}
927),t.jsxs("div",{className:"glass-panel animate-fade-in",style:{maxWidth:"400px",width:"100%",padding:"40px",borderRadius:"var(--radius-lg)"},children:[t.jsxs("div",{style:{textAlign:"center",marginBottom:"30px"},children:[t.jsx("img",{src:"/logo_meeteros_gold.png",alt:"MEET Eros",style:{height:"60px",marginBottom:"20px",objectFit:"contain"}}),t.jsx("p",{style:{color:"var(--text-muted)"},children:"Heureux de vous revoir."})]}),t.jsxs("form",{onSubmit:u,style:{display:"flex",flexDirection:"column",gap:"20px"},children:[t.jsxs("div",{className:"input-group",children:[t.jsx("label",{style:{display:"block",marginBottom:"8px",fontSize:"0.9rem",color:"var(--text-muted)"},children:"Email"}),t.jsxs("div",{style:{position:"relative"},children:[t.jsx(Vr,{size:18,style:{position:"absolute",left:"15px",top:"50%",transform:"translateY(-50%)",color:"rgba(255,255,255,0.5)"}}),t.jsx("input",{type:"email",name:"email",required:!0,value:i.email,onChange:p,onFocus:()=>mr(),style:{width:"100%",padding:"12px 12px 12px 45px",borderRadius:"var(--radius-sm)",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.2)",color:"white"},placeholder:"[email protected]"})]})]}),t.jsxs("div",{className:"input-group",children:[t.jsx("label",{style:{display:"block",marginBottom:"8px",fontSize:"0.9rem",color:"var(--text-muted)"},children:"Mot de passe"}),t.jsxs("div",{style:{position:"relative"},children:[t.jsx(Fr,{size:18,style:{position:"absolute",left:"15px",top:"50%",transform:"translateY(-50%)",color:"rgba(255,255,255,0.5)"}}),t.jsx("input",{type:o?"text":"password",name:"password",required:!0,value:i.password,onChange:p,onFocus:()=>mr(),style:{width:"100%",padding:"12px 45px 12px 45px",borderRadius:"var(--radius-sm)",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.2)",color:"white"},placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢"}),t.jsx("button",{type:"button",onClick:()=>a(!o),style:{position:"absolute",right:"15px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",color:"rgba(255,255,255,0.5)",cursor:"pointer",padding:0},children:o?t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),t.jsx("circle",{cx:"12",cy:"12",r:"3"})]}):t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),t.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]})})]}),t.jsx("div",{style:{textAlign:"right",marginTop:"5px"},children:t.jsx("span",{onClick:()=>e("/forgot-password"),style:{fontSize:"0.8rem",color:"var(--text-muted)",cursor:"pointer",textDecoration:"underline"},children:"Mot de passe oublié ?"})})]}),t.jsxs("button",{type:"submit",className:"btn-primary",disabled:l,style:{marginTop:"10px",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",opacity:l?.7:1},children:[l?"Connexion...":"Se connecter"," ",!l&&t.jsx(BA,{size:20})]}),t.jsxs("p",{style:{textAlign:"center",fontSize:"0.9rem",color:"var(--text-muted)",marginTop:"20px"},children:["Pas encore de compte ? ",t.jsx("span",{onClick:()=>e("/chat"),style:{color:"var(--primary)",cursor:"pointer",textDecoration:"underline"},children:"Commencer l'expérience"})]})]})]})]})},t7=()=>{const e=Lt(),[r,i]=m.useState(""),[n,o]=m.useState(!1),[a,l]=m.useState(!1),[d,p]=m.useState(null),u=async g=>{g.preventDefault(),o(!0),p(null),l(!1);try{const{sendPasswordReset:h}=await Wr(async()=>{const{sendPasswordReset:x}=await Promise.resolve().then(()=>na);return{sendPasswordReset:x}},void 0);await h(r),l(!0)}catch(h){console.error("Password reset error:",h),p(h.message||"Une erreur est survenue.")}finally{o(!1)}};return t.jsxs("div",{style:{minHeight:"100vh",background:"var(--bg-deep)",padding:"20px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[t.jsxs("button",{onClick:()=>e("/login"),style:{position:"absolute",top:"20px",left:"20px",background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",display:"flex",alignItems:"center",gap:"5px"},children:[t.jsx(Hr,{size:20})," Retour"]}
927),t.jsxs("div",{className:"glass-panel animate-fade-in",style:{maxWidth:"450px",width:"100%",padding:"40px",borderRadius:"var(--radius-lg)"},children:[t.jsxs("div",{style:{textAlign:"center",marginBottom:"30px"},children:[t.jsx("h1",{style:{fontFamily:"Outfit",fontSize:"2rem",marginBottom:"10px"},children:"Mot de passe oublié ?"}),t.jsx("p",{style:{color:"var(--text-muted)"},children:"Pas de panique. Entrez votre email et nous vous enverrons un lien pour le réinitialiser."})]}),a?t.jsxs("div",{style:{textAlign:"center",padding:"20px",background:"rgba(76, 175, 80, 0.1)",borderRadius:"10px",border:"1px solid #4CAF50"},children:[t.jsx(ms,{size:48,color:"#4CAF50",style:{marginBottom:"15px"}}),t.jsx("h3",{style:{color:"#4CAF50",marginBottom:"10px"},children:"Email envoyé !"}),t.jsx("p",{style:{fontSize:"0.9rem",color:"#ccc"},children:"Vérifiez votre boîte de réception (et vos spams). Cliquez sur le lien pour créer un nouveau mot de passe."}),t.jsx("button",{onClick:()=>e("/login"),style:{marginTop:"20px",padding:"10px 20px",background:"transparent",border:"1px solid rgba(255,255,255,0.2)",borderRadius:"20px",color:"white",cursor:"pointer"},children:"Retour à la connexion"})]}):t.jsxs("form",{onSubmit:u,style:{display:"flex",flexDirection:"column",gap:"20px"},children:[d&&t.jsx("div",{style:{padding:"10px",background:"rgba(255, 77, 77, 0.1)",border:"1px solid #ff4d4d",borderRadius:"8px",color:"#ff4d4d",fontSize:"0.9rem"},children:d}),t.jsxs("div",{className:"input-group",children:[t.jsx("label",{style:{display:"block",marginBottom:"8px",fontSize:"0.9rem",color:"var(--text-muted)"},children:"Email"}),t.jsxs("div",{style:{position:"relative"},children:[t.jsx(Vr,{size:18,style:{position:"absolute",left:"15px",top:"50%",transform:"translateY(-50%)",color:"rgba(255,255,255,0.5)"}}),t.jsx("input",{type:"email",required:!0,value:r,onChange:g=>i(g.target.value),style:{width:"100%",padding:"12px 12px 12px 45px",borderRadius:"var(--radius-sm)",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.2)",color:"white"},placeholder:"[email protected]"})]})]}),t.jsx("button",{type:"submit",disabled:n,className:"btn-primary",style:{marginTop:"10px",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px"},children:n?"Envoi en cours...":t.jsxs(t.Fragment,{children:["Envoyer le lien ",t.jsx(ji,{size:18})]})})]})]})]})},r7=()=>{const e=Lt(),[r,i]=m.useState(""),[n,o]=m.useState(!1),[a,l]=m.useState(!1),[d,p]=m.useState(null),[u,g]=m.useState(!1);m.useEffect(()=>{D.auth.getSession().then(({data:{session:y}})=>{y?console.log("Session found:",y):console.log("No session found initially.")});const{data:{subscription:x}}=D.auth.onAuthStateChange(async(y,_)=>{console.log("Auth event:",y)});return()=>x.unsubscribe()},[]);const h=async x=>{x.preventDefault(),l(!0),p(null);const{data:{session:y}}=await D.auth.getSession();if(!y){p("Session expirée ou invalide. Veuillez redemander un lien."),l(!1);return}try{const{error:_}=await D.auth.updateUser({password:r});if(_)throw _;g(!0),setTimeout(()=>e("/matches"),2e3)}catch(_){console.error("Update password error:",_),p(_.message)}finally{l(!1)}};return t.jsx("div",{style:{minHeight:"100vh",background:"var(--bg-deep)",padding:"20px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:t.jsxs("div",{className:"glass-panel animate-fade-in",style:{maxWidth:"450px",width:"100%",padding:"40px",borderRadius:"var(--radius-lg)"},children:[t.jsxs("div",{style:{textAlign:"center",marginBottom:"30px"},children:[t.jsx("h1",{style:{fontFamily:"Outfit",fontSize:"2rem",marginBottom:"10px"},children:"Nouveau mot de passe"}),t.jsx("p",{style:{color:"var(--text-muted)"},children:"Choississez un mot de passe sécurisé pour votre compte."})]}),u?t.jsxs("div",{style:{textAlign:"center",padding:"20px",background:"rgba(76, 175, 80, 0.1)",borderRadius:"10px",border:"1px solid #4CAF50"},children:[t.jsx("h3",{style:{color:"#4CAF50"},children:"Mot de passe mis à jour !"}),t.jsx("p",{style:{color:"#ccc"},children:"Redirection en cours..."})]}):t.jsxs("form",{onSubmit:h,style:{display:"flex",flexDirection:"column",gap:"20px"},children:[d&&t.jsx("div",{style:{padding:"10px",background:"rgba(255, 77, 77, 0.1)",border:"1px solid #ff4d4d",borderRadius:"8px",color:"#ff4d4d",fontSize:"0.9rem"},children:d}),t.jsxs("div",{className:"input-group",children:[t.jsx("label",{style:{display:"block",marginBottom:"8px",fontSize:"0.9rem",color:"var(--text-muted)"},children:"Nouveau mot de passe"}),t.jsxs("div",{style:{position:"relative"},children:[t.jsx(Fr,{size:18,style:{position:"absolute",left:"15px",top:"50%",transform:"translateY(-50%)",color:"rgba(255,255,255,0.5)"}}),t.jsx("input",{type:n?"text":"password",required:!0,minLength:6,value:r,onChange:x=>i(x.target.value),style:{width:"100%",padding:"12px 40px 12px 45px",borderRadius:"var(--radius-sm)",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.2)",color:"white"},placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢"}),t.jsx("button",{type:"button",onClick:()=>o(!n),style:{position:"absolute",right:"10px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",color:"rgba(255,255,255,0.5)",cursor:"pointer"},children:n?t.jsx(al,{size:18}):t.jsx(rr,{size:18})})]})]}),t.jsx("button",{type:"submit",disabled:a,className:"btn-primary",style:{marginTop:"10px",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px"},children:a?"Enregistrement...":t.jsxs(t.Fragment,{children:["Enregistrer ",t.jsx(_p,{size:18})]})})]})]})})},i7=({onVerify:e})=>{const[r,i]=m.useState(!1),{mode:n}=dr(),a={EROS:"MEET Eros",FRIEND:"MEET Friend",EROX:"MEET Erox"}[n]||"MEET Eros";m.useEffect(()=>{localStorage.getItem("ageVerified")||(i(!0),document.body.style.overflow="hidden")},[]);const l=()=>{localStorage.setItem("ageVerified","true"),i(!1),document.body.style.overflow="auto",e&&e()},d=()=>{window.location.href="https://www.google.com"};return r?t.jsx(tr,{children:t.jsx(ye.div,{initial:{opacity:0}
927,animate:{opacity:1},style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(12px)",zIndex:99999,display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},children:t.jsxs(ye.div,{initial:{scale:.9,y:20},animate:{scale:1,y:0},style:{maxWidth:"450px",width:"100%",background:"rgba(20, 20, 30, 0.85)",borderRadius:"24px",padding:"40px",border:"1px solid rgba(212, 196, 168, 0.3)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.5)",textAlign:"center",color:"#F5F5DC",backdropFilter:"blur(10px)"},children:[t.jsx("div",{style:{marginBottom:"20px"},children:t.jsx(Sr,{size:50,color:"#D4C4A8",strokeWidth:1.5})}),t.jsx("h1",{style:{fontFamily:"Playfair Display",color:"#D4C4A8",fontSize:"1.8rem",marginBottom:"15px"},children:"Accès Réservé"}),t.jsxs("p",{style:{fontSize:"1rem",lineHeight:"1.6",marginBottom:"25px",color:"rgba(255,255,255,0.7)"},children:["Pour accéder à l'expérience ",t.jsx("strong",{children:a}),", vous devez certifier être majeur(e)."]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[t.jsx("button",{onClick:l,style:{padding:"14px 24px",fontSize:"1rem",fontWeight:"600",backgroundColor:"#D4C4A8",color:"#1a1a2e",border:"none",borderRadius:"30px",cursor:"pointer",transition:"all 0.2s",fontFamily:"Outfit"},onMouseOver:p=>{p.currentTarget.style.transform="translateY(-2px)",p.currentTarget.style.boxShadow="0 5px 15px rgba(212, 196, 168, 0.3)"},onMouseOut:p=>{p.currentTarget.style.transform="translateY(0)",p.currentTarget.style.boxShadow="none"},children:"Je suis majeur(e) +18"}),t.jsx("button",{onClick:d,style:{padding:"14px 24px",fontSize:"0.9rem",backgroundColor:"transparent",color:"rgba(255,255,255,0.5)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"30px",cursor:"pointer",fontFamily:"Outfit"},children:"Quitter le site"})]})]})})}):null},n7=({item:e,isSelected:r,onClick:i,color:n})=>{const o=e.icon||nr;return t.jsxs(ye.div,{whileHover:{scale:1.15,rotate:[0,-2,2,0],y:-5,boxShadow:`0 10px 20px ${r?n:"rgba(255,255,255,0.1)"}`},transition:{type:"spring",stiffness:300,damping:15},whileTap:{scale:.95},onClick:i,style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"15px",background:r?n:"rgba(255,255,255,0.05)",borderRadius:"15px",cursor:"pointer",border:r?`2px solid ${n}`:"1px solid rgba(255,255,255,0.1)",boxShadow:r?`0 0 20px ${n}66`:"none",position:"relative",height:"100px",width:"100px"},initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:[t.jsx("div",{style:{marginBottom:"8px",color:r?"black":"var(--text-main)"},children:t.jsx(o,{size:32,strokeWidth:1.5})}),t.jsx("span",{style:{fontSize:"0.75rem",textAlign:"center",color:r?"black":"var(--text-muted)",fontWeight:r?"bold":"normal",lineHeight:"1.2"},children:e.label}),r&&t.jsx(ye.div,{initial:{scale:0,opacity:0},animate:{scale:1.5,opacity:0},transition:{duration:.5},style:{position:"absolute",top:0,left:0,right:0,bottom:0,border:`2px solid ${n}`,borderRadius:"15px",pointerEvents:"none"}})]})},o7=()=>{const e=Lt(),r=ko(),{setMode:i}=dr(),[n,o]=m.useState("EROS"),[a,l]=m.useState(0),[d,p]=m.useState([]),[u,g]=m.useState(""),[h,x]=m.useState({}),[y,_]=m.useState(!1),[S,k]=m.useState(!1),[w,b]=m.useState(null),j=n==="EROX"?So:Fn;m.useEffect(()=>{var O;(O=r.state)!=null&&O.initialMode&&(o(r.state.initialMode),i(r.state.initialMode)),(async()=>{localStorage.removeItem("userProfile"),localStorage.removeItem("localAvatar"),localStorage.removeItem("onboarding_selections");const{error:E}=await D.auth.signOut();E&&console.warn("Onboarding cleanup signout:",E)})()},[r.state,i]);const T=R=>{x(O=>{const E={...O};return E[R]?delete E[R]:E[R]=!0,E}),b(null)},P=()=>{const R=[];return j.forEach(O=>{O.items.forEach(E=>{h[E.id]&&R.push({...E,color:O.color})})}),R},I=()=>{for(const O of j)if(!O.items.some($=>h[$.id])){b(`Oups ! Tu dois choisir au moins un pictogramme dans la section "${O.title}" pour continuer.`);const $=document.getElementById(O.id);$?$.scrollIntoView({behavior:"smooth"}):window.scrollTo({top:0,behavior:"smooth"});return}k(!0);const R={id:"user_me",name:"Moi",tags:n==="EROS"?Object.keys(h):[],erox_tags:n==="EROX"?Object.keys(h):[],location:{lat:48.8566,lng:2.3522},isCompleted:!0};localStorage.setItem("userProfile",JSON.stringify(R)),localStorage.setItem("onboarding_selections",JSON.stringify(Object.keys(h))),localStorage.setItem("onboarding_mode",n),setTimeout(()=>{e("/complete-profile")},4e3)};return t.jsxs("div",{style:{minHeight:"100vh",background:"#0a0d14",padding:"20px",paddingBottom:"100px",color:"white"},children:[t.jsx(i7,{}),t.jsx(ye.h1,{initial:{opacity:0,y:-20}
927,animate:{opacity:1,y:0},style:{fontFamily:"var(--font-logo)",fontSize:"2rem",textAlign:"center",marginBottom:"10px",background:"var(--gradient-main)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:"Préparation de votre Profil"}),t.jsx("p",{style:{textAlign:"center",color:"var(--text-muted)",marginBottom:"40px",fontSize:"1.1rem",lineHeight:"1.5",maxWidth:"600px",margin:"0 auto 40px auto"},children:"Avant toute chose, merci de sélectionner les pictos qui vous concernent pour vous proposer les meilleurs matchs !"}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"50px",maxWidth:"800px",margin:"0 auto"},children:j.map(R=>t.jsxs("div",{id:R.id,children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"20px",borderBottom:`1px solid ${R.color}44`,paddingBottom:"10px"},children:[t.jsx(R.icon,{color:R.color,size:28}),t.jsx("h2",{style:{margin:0,fontSize:"1.4rem",color:"white"},children:R.title})]}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"15px",justifyContent:"center"},children:R.items.map(O=>t.jsx(n7,{item:O,isSelected:!!h[O.id],onClick:()=>T(O.id),color:R.color},O.id))})]},R.id))}),t.jsxs("div",{style:{position:"fixed",bottom:0,left:0,right:0,padding:"120px 20px 30px 20px",background:"linear-gradient(to top, rgba(10,13,20,1) 0%, rgba(10,13,20,0.9) 40%, rgba(10,13,20,0.6) 70%, rgba(10,13,20,0) 100%)",display:"flex",flexDirection:"column",alignItems:"center",pointerEvents:"none",zIndex:50},children:[w&&t.jsx(ye.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},style:{background:"#ff4d4d",color:"white",padding:"10px 20px",borderRadius:"20px",marginBottom:"10px",fontWeight:"bold",boxShadow:"0 5px 15px rgba(255, 77, 77, 0.4)"},children:w}),t.jsx(ye.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:I,style:{pointerEvents:"auto",padding:"15px 50px",fontSize:"1.2rem",borderRadius:"30px",border:"none",background:"var(--gradient-main)",color:"white",fontWeight:"bold",cursor:"pointer",boxShadow:"0 4px 20px rgba(124, 77, 255, 0.4)"},children:"Lancer l'Analyse"})]}),t.jsx(tr,{children:S&&t.jsx(ye.div,{initial:{opacity:0}
927,animate:{opacity:1},exit:{opacity:0},style:{position:"fixed",inset:0,background:"rgba(10,13,20,0.98)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},children:t.jsx(s7,{items:P()})})})]})},s7=({items:e})=>t.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:[e.map((r,i)=>{const n=r.icon||nr,o=i/e.length*2*Math.PI,a=300+Math.random()*200,l=Math.cos(o)*a,d=Math.sin(o)*a;return t.jsx(ye.div,{initial:{x:l,y:d,opacity:1,scale:1,rotate:0},animate:{x:0,y:0,opacity:[1,1,0],scale:[1,1.5,0],rotate:720+Math.random()*360},transition:{duration:2.5,ease:"easeInOut",delay:Math.random()*.2},style:{position:"absolute",color:r.color},children:t.jsx(n,{size:40})},r.id)}),t.jsxs(ye.div,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},transition:{delay:2.2,duration:.5,type:"spring"},style:{textAlign:"center",zIndex:10},children:[t.jsx("div",{style:{fontSize:"4rem",marginBottom:"20px"},children:"â¨"}),t.jsx("h2",{style:{fontFamily:"var(--font-logo)",fontSize:"2.5rem",background:"var(--gradient-main)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",marginBottom:"10px"},children:"Analyse Terminée !"}),t.jsx("p",{style:{color:"var(--text-muted)",fontSize:"1.2rem"},children:"Poursuivons l'inscription..."})]})]}),a7=()=>{const[e,r]=m.useState(null),[i,n]=m.useState(!0),o=Lt();return m.useEffect(()=>{const a=localStorage.getItem("userProfile");a?setTimeout(()=>{r(JSON.parse(a)),n(!1)},3e3):o("/chat")},[o]),i?t.jsxs("div",{style:{height:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"var(--bg-deep)"},children:[t.jsx("div",{className:"spinner",style:{width:"80px",height:"80px",borderRadius:"50%",border:"4px solid rgba(255,255,255,0.1)",borderTopColor:"var(--primary)",animation:"spin 1s infinite linear",marginBottom:"20px"}}),t.jsx("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"}),t.jsx("h2",{style:{color:"var(--text-main)",fontWeight:300},children:"Analyse de vos réponses..."}),t.jsx("p",{style:{color:"var(--text-muted)"},children:"Construction de votre ADN amoureux"})]}):t.jsxs("div",{style:{padding:"30px",minHeight:"100vh",background:"var(--bg-deep)",display:"flex",flexDirection:"column",alignItems:"center"},children:[t.jsx("h1",{className:"animate-fade-in",style:{textAlign:"center",margin:"20px 0",fontSize:"2rem",background:"var(--gradient-gold)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:"Votre Portrait Amoureux"}),t.jsxs("div",{className:"glass-panel animate-fade-in",style:{padding:"40px",borderRadius:"var(--radius-lg)",maxWidth:"600px",width:"100%",display:"flex",flexDirection:"column",alignItems:"center",gap:"20px",animationDelay:"0.2s"},children:[t.jsx(Sn,{size:64,color:"#ffd700",style:{filter:"drop-shadow(0 0 10px rgba(255, 215, 0, 0.5))"}}),t.jsx("h2",{style:{fontSize:"2.5rem",textAlign:"center"},children:e.archetype}),t.jsx("div",{style:{display:"flex",gap:"10px",flexWrap:"wrap",justifyContent:"center"},children:e.traits.map((a,l)=>t.jsx("span",{style:{background:"rgba(255,255,255,0.1)",padding:"8px 16px",borderRadius:"20px",border:"1px solid rgba(255,255,255,0.2)",fontSize:"0.9rem"},children:a},l))}),t.jsx("p",{style:{textAlign:"center",color:"var(--text-muted)",fontSize:"1.1rem",lineHeight:"1.8"},children:e.description}),t.jsx("div",{style:{width:"100%",height:"1px",background:"rgba(255,255,255,0.1)",margin:"10px 0"}}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[t.jsxs("div",{children:[t.jsx("span",{style:{display:"block",textTransform:"uppercase",fontSize:"0.7rem",color:"var(--text-muted)",letterSpacing:"1px"},children:"Valeurs Clés"}),t.jsx("div",{children:e.values.join(", ")})]}),t.jsxs("div",{style:{textAlign:"right"},children:[t.jsx("span",{style:{display:"block",textTransform:"uppercase",fontSize:"0.7rem",color:"var(--text-muted)",letterSpacing:"1px"},children:"Compatibilité Moyenne"}),t.jsxs("div",{style:{color:"#00e5ff",fontWeight:"bold"},children:[e.compatibilityScore,"%"]})]})]})]}),t.jsxs("button",{className:"btn-primary animate-fade-in",style:{marginTop:"40px",display:"flex",alignItems:"center",gap:"10px",animationDelay:"0.5s"},onClick:()=>o("/complete-profile"),children:[t.jsx(Xt,{size:20}),"Finaliser mon profil",t.jsx(Pr,{size:20})]})]})},Jt=({size:e=16,style:r={},className:i=""})=>t.jsx("img",{src:"/meetips_logo.png",alt:"Meetips",className:i,style:{width:`${e}px`,height:`${e}px`,objectFit:"contain",verticalAlign:"middle",display:"inline-block",...r}}),l7=4e3,ux=({name:e,city:r,email:i,search_mode:n,onboarding_completed:o})=>{const a={};e&&(a.name=e),r&&(a.city=r),i&&(a.email=i),n&&(a.search_mode=n),o!==void 0&&(a.onboarding_completed=o);const l=JSON.stringify(a).length;return l>l7?(console.error(`[sanitize] Auth metadata too large (${l} chars), truncating...`),{name:a.name,city:a.city}):a},d7=[{id:"original",name:"Original",icon:wd},{id:"blur",name:"Flou",icon:TA},{id:"pixelate",name:"Pixel",icon:MA},{id:"noir",name:"N&B",icon:IA},{id:"flash",name:"Flash",icon:rl},{id:"incognito",name:"Masqué",icon:ad}],h0=({imageSrc:e,onClose:r,onSave:i})=>{const n=m.useRef(null),[o,a]=m.useState("original"),[l,d]=m.useState(50),[p,u]=m.useState(e||"");m.useEffect(()=>{p&&h()},[p,o,l]);const g=_=>{const S=_.target.files[0];if(!S)return;const k=new FileReader;k.onload=w=>{const b=new Image;b.crossOrigin="anonymous",b.src=w.target.result,b.onload=()=>{const j=document.createElement("canvas"),T=600;let P=b.width,I=b.height;P>I?P>T&&(I*=T/P,P=T):I>
927T&&(P*=T/I,I=T),j.width=P,j.height=I,j.getContext("2d").drawImage(b,0,0,P,I),u(j.toDataURL("image/jpeg",.8))}},k.readAsDataURL(S)},h=()=>{const _=n.current;if(!_||!p)return;const S=_.getContext("2d"),k=new Image;k.crossOrigin="anonymous",k.src=p,k.onload=()=>{let b=k.width,j=k.height;if(b>j?b>600&&(j*=600/b,b=600):j>600&&(b*=600/j,j=600),_.width=b,_.height=j,S.clearRect(0,0,b,j),S.filter="none",o==="original")S.drawImage(k,0,0,b,j);else if(o==="blur")S.filter=`blur(${l/5}px)`,S.drawImage(k,0,0,b,j);else if(o==="noir"){S.filter="grayscale(100%) contrast(120%)",S.drawImage(k,0,0,b,j);const T=S.getImageData(0,0,b,j),P=T.data;for(let I=0;I<P.length;I+=4){const R=(Math.random()-.5)*(l/2);P[I]+=R,P[I+1]+=R,P[I+2]+=R}S.putImageData(T,0,0)}else if(o==="incognito")S.filter="invert(100%) contrast(150%) hue-rotate(180deg)",S.drawImage(k,0,0,b,j);else if(o==="flash")S.filter="brightness(150%) contrast(110%) saturate(0)",S.drawImage(k,0,0,b,j);else if(o==="pixelate"){const T=Math.floor(b/(l/5+5)),P=Math.floor(j/(l/5+5));S.imageSmoothingEnabled=!1,S.drawImage(k,0,0,T,P),S.drawImage(_,0,0,T,P,0,0,b,j)}}},x=()=>{const _=n.current;if(!_||!p)return;const S=_.toDataURL("image/jpeg",.8);i(S)},y=!!p;return t.jsxs("div",{style:{position:"fixed",inset:0,zIndex:2e3,background:"rgba(0,0,0,0.85)",backdropFilter:"blur(15px)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"20px"},children:[t.jsxs("div",{className:"glass-panel animate-scale-in",style:{width:"100%",maxWidth:"500px",maxHeight:"95dvh",background:"linear-gradient(145deg, rgba(30,30,40,0.95) 0%, rgba(20,20,30,0.98) 100%)",borderRadius:"24px",border:"1px solid rgba(255,255,255,0.1)",boxShadow:"0 20px 50px rgba(0,0,0,0.5)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"15px 25px",borderBottom:"1px solid rgba(255,255,255,0.05)"},children:[t.jsx("button",{onClick:r,style:{background:"rgba(255,255,255,0.1)",border:"none",color:"white",cursor:"pointer",padding:"8px",borderRadius:"50%",display:"flex"},children:t.jsx(mt,{size:20})}),t.jsx("h3",{style:{margin:0,fontFamily:"Outfit",fontSize:"1.2rem",background:"var(--gradient-gold)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",fontWeight:"bold"},children:"Studio Photo"}),t.jsx("button",{onClick:x,disabled:!y,style:{background:y?"var(--gradient-gold)":"rgba(255,255,255,0.1)",border:"none",color:y?"black":"rgba(255,255,255,0.3)",cursor:y?"pointer":"not-allowed",padding:"8px",borderRadius:"50%",display:"flex",boxShadow:y?"0 0 15px rgba(255, 215, 0, 0.3)":"none"},children:t.jsx(pr,{size:20})})]}),t.jsx("div",{style:{position:"relative",width:"100%",flex:1,minHeight:"200px",display:"flex",alignItems:"center",justifyContent:"center",padding:"12px",background:"radial-gradient(circle at center, rgba(255,255,255,0.05) 0%, transparent 70%)",overflow:"hidden"},children:y?t.jsx("canvas",{ref:n,style:{maxWidth:"100%",maxHeight:"100%",borderRadius:"12px",boxShadow:"0 10px 30px rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.1)"}}):t.jsxs("label",{htmlFor:"studio-upload",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"16px",width:"80%",maxWidth:"280px",aspectRatio:"3/4",border:"2px dashed rgba(255,255,255,0.15)",borderRadius:"20px",cursor:"pointer",background:"rgba(255,255,255,0.02)",transition:"all 0.3s"},children:[t.jsx("div",{style:{width:"64px",height:"64px",borderRadius:"50%",background:"rgba(255,215,0,0.08)",border:"1px solid rgba(255,215,0,0.2)",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(pi,{size:28,color:"rgba(255,215,0,0.6)"})}),t.jsx("span",{style:{color:"rgba(255,255,255,0.5)",fontSize:"0.9rem",fontWeight:"600",fontFamily:"Outfit"},children:"Charger une photo"}),t.jsx("span",{style:{color:"rgba(255,255,255,0.25)",fontSize:"0.75rem",textAlign:"center",lineHeight:1.4,padding:"0 20px"},children:"Sélectionnez une photo depuis votre galerie pour la retoucher"}),t.jsx("input",{id:"studio-upload",type:"file",accept:"image/*",onChange:g,style:{display:"none"}})]})}),t.jsxs("div",{style:{padding:"20px",background:"rgba(0,0,0,0.2)"},children:[t.jsx("div",{style:{display:"flex",gap:"6px",overflowX:"auto",paddingBottom:"10px",scrollbarWidth:"none",justifyContent:"center"},children:d7.map(_=>{const S=o===_.id;return t.jsxs("button",{onClick:()=>a(_.id),disabled:!y,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"5px",background:S?"var(--gradient-primary)":"rgba(255,255,255,0.05)",border:S?"none":"1px solid rgba(255,255,255,0.1)",borderRadius:"14px",padding:"8px 10px",minWidth:"54px",cursor:y?"pointer":"not-allowed",color:S?"white":"var(--text-muted)",opacity:y?1:.4,transition:"all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1)",transform:S?"translateY(-2px)":"none",boxShadow:S?"0 5px 15px rgba(124, 77, 255, 0.4)":"none"},children:[t.jsx(_.icon,{size:18,strokeWidth:S?2:1.5}),t.jsx("span",{style:{fontSize:"0.65rem",fontWeight:S?"bold":"normal",whiteSpace:"nowrap"},children:_.name})]},_.id)})}),y&&(o==="blur"||o==="pixelate"||o==="noir")&&t.jsxs("div",{style:{marginTop:"15p
927x",padding:"0 10px"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"5px",fontSize:"0.8rem",color:"var(--text-muted)"},children:[t.jsx("span",{children:"Faible"}),t.jsx("span",{children:"Intensité"}),t.jsx("span",{children:"Fort"})]}),t.jsx("input",{type:"range",min:"0",max:"100",value:l,onChange:_=>d(parseInt(_.target.value)),style:{width:"100%",height:"6px",borderRadius:"3px",background:"rgba(255,255,255,0.1)",outline:"none",appearance:"none",cursor:"pointer"}})]})]})]}),t.jsx("p",{style:{marginTop:"15px",color:"rgba(255,255,255,0.5)",fontSize:"0.85rem"},children:y?t.jsxs(t.Fragment,{children:["Appuyez sur ",t.jsx(pr,{size:12,style:{display:"inline"}})," pour valider"]}):"Importez une photo pour commencer"})]})},wi={supabase:D,async getBalance(e){const{data:r,error:i}=await D.from("profiles").select("meetips_balance").eq("id",e).single();return i?0:(r==null?void 0:r.meetips_balance)||0},async getUnseenGiftsCount(e){const{count:r,error:i}=await D.from("user_gifts").select("*",{count:"exact",head:!0}).eq("receiver_id",e).eq("is_seen",!1);return i?0:r||0},async buyPack(e,r){try{const{costEur:i,amountMeetips:n}=r,{error:o}=await D.from("meetips_transactions").insert({user_id:e,amount:n,description:`Achat Pack ${i}â¬`});if(o)throw o;const l=await this.getBalance(e)+n,{error:d}=await D.from("profiles").update({meetips_balance:l}).eq("id",e);if(d)throw d;return{success:!0,newBalance:l}}catch(i){return console.error("Buy pack failed:",i),{success:!1,error:i.message}}},async sendGift(e,r,i){try{const{type:n,cost:o,name:a}=i,l=await this.getBalance(e);if(l<o)return{success:!1,error:"Solde insuffisant"};const{error:d}=await D.from("meetips_transactions").insert({user_id:e,amount:-o,description:`Cadeau envoyé: ${a}`});if(d)throw d;const p=l-o,{error:u}=await D.from("profiles").update({meetips_balance:p}).eq("id",e);if(u)throw u;const{error:g}=await D.from("user_gifts").insert({sender_id:e,receiver_id:r,gift_type:n,cost:o,status:"sent",is_seen:!1});if(g)throw g;try{await this.sendMessage(e,r,`ð Je t'ai offert un cadeau : ${a} !`)}catch(h){console.warn("Gift message insert failed (non-blocking):",h)}return{success:!0,newBalance:p}}catch(n){return console.error("Send gift failed:",n),{success:!1,error:n.message}}},async unlockProfile(e,r){try{const n=await this.getBalance(e);if(n<15)return{success:!1,error:`Solde insuffisant (${n}/15 Meetips)`};const{error:o}=await D.from("meetips_transactions").insert({user_id:e,amount:-15,description:"Déverrouillage profil"});if(o)throw o;const a=n-15,{error:l}=await D.from("profiles").update({meetips_balance:a}).eq("id",e);if(l)throw l;return{success:!0,newBalance:a}}catch(n){return console.error("Unlock profile failed:",n),{success:!1,error:n.message}}},async getReceivedGifts(e){try{const{data:r,error:i}=await D.from("user_gifts").select("*").eq("receiver_id",e).order("created_at",{ascending:!1});if(i)throw i;if(!r||r.length===0)return[];const{data:n,error:o}=await D.rpc("get_my_gift_senders");return o&&console.error("RPC Error fetching senders:",o),r.map(l=>{const d=n==null?void 0:n.find(p=>p.id===l.sender_id);return{...l,sender:d||null}})}catch(r){return console.error("Fetch gifts failed:",r),[]}},async markGiftsAsSeen(e){if(!(!e||e.length===0))try{await D.from("user_gifts").update({is_seen:!0}).in("id",e)}catch(r){console.error("Mark seen error:",r)}},async sendMessage(e,r,i){try{const n=[e,r].sort().join("_"),{error:o}=await D.from("messages").insert({sender_id:e,receiver_id:r,conversation_id:n,content:i,is_read:!1});if(o)throw o;return{success:!0}}catch(n){return console.error("Send message failed:",n),{success:!1,error:n.message}}}},c7=Object.freeze(Object.defineProperty({__proto__:null,MeetipsService:wi},Symbol.toStringTag,{value:"Module"})),Yd=8,p7="https://bqfzljnhxblhiabyvpqm.supabase.co",hu=`${p7}/functions/v1/animate-photo`,Ts={async generateAnimation(e,r){try{const i={"Content-Type":"application/json",apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4"};r&&r("Envoi de la demande à l'IA...");const n=await fetch(hu,{method:"POST",headers:i,body:JSON.stringify({action:"generate",image_url:e})});if(!n.ok){const p=await n.json().catch(()=>({}));return console.error("Edge Function submit error:",n.status,p),{success:!1,error:p.error||`Erreur serveur (${n.status})`}}const o=await n.json();if((o==null?void 0:o.status)==="completed"&&(o!=null&&o.video_url))return{success:!0,videoUrl:o.video_url};if(!(o!=null&&o.request_id))return{success:!1,error:(o==null?void 0:o.error)||"Pas de request_id reçu"};const a=o.request_id,l=60,d=5e3;for(let p=1;p<=l;p++){r&&r(`Génération en cours... (${p*5}s)`),await new Promise(u=>setTimeout(u,d));try{const u=await fetch(hu,{method:"POST",headers:i,body:JSON.stringify({action:"poll",request_id:a})});if(!u.ok){console.warn(`Poll attempt ${p} error`);continue}const g=await u.json();if((g==null?void 0:g.status)==="completed"&&(g!=null&&g.video_url))return r&&r("Vidéo générée !"),{success:!0,videoUrl:g.video_url};console.log(`Poll attempt ${p}: still processing...`)}catch(u){console.warn(`Poll attempt ${p} network error:`,u.message)}}return{success:!1,error:"Timeout: la génération prend trop de temps. Réessayez."}}catch(i){return console.error("generateAnimation error:",i),{success:!1,error:`Erreur réseau: ${i.message}`}}},async uploadAnimatedPhoto(e,r){var l;let i,n="mp4";if(r instanceof File||r instanceof Blob)i=r,n=((l=r.name)==null?void 0:l.split(".").pop())||"mp4";else if(typeof r=="string")try{console.log("Downloading video via Edge Function proxy...");const p=await fetch(hu,{method:"POST",headers:{"Content-Type":"application/json",apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4"},body:JSON.stringify({action:"download",video_url:r})});if(!p.ok){const x=await p.json().catch(()=>({}));return console.error("Download proxy error:",x),{success:!1,error:"Impossible de télécharger la vidéo générée"}}const u=await p.json();if(!u.video_base64)return{success:!1,error:"Pas de données vidéo reçues"};const g=atob(u.video_base64),h=new Uint8Array(g.length);for(let x=0;x<g.length;x++)h[x]=g.charCodeAt(x);i=new Blob([h],{type:u.content_type||"video/mp4"}),console.log(`Video downloaded: ${i.size} bytes`)}catch(d){return console.error("Video download error:",d),{success:!1,error:"Impossible de télécharger la vidéo générée"}}
927else return{success:!1,error:"Source vidéo invalide"};const o=`animated_${e}_${Date.now()}.${n}`,a=i.type||"video/mp4";console.log(`Uploading animated video: ${o}, size: ${i.size}, type: ${a}`);try{const{data:d,error:p}=await D.storage.from("avatars").upload(o,i,{upsert:!0,contentType:a});if(p)return console.error("Upload error details:",JSON.stringify(p)),{success:!1,error:`Upload échoué: ${p.message}`};const{data:{publicUrl:u}}=D.storage.from("avatars").getPublicUrl(o);return console.log("Animated photo uploaded successfully:",u),{success:!0,url:u}}catch(d){return console.error("Upload exception:",d),{success:!1,error:`Upload échoué: ${d.message}`}}},async downloadAndUpload(e,r){try{const n=await fetch(hu,{method:"POST",headers:{"Content-Type":"application/json",apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4"},body:JSON.stringify({action:"download_and_upload",video_url:r,user_id:e})});if(!n.ok){const a=await n.json().catch(()=>({}));return console.error("downloadAndUpload error:",a),{success:!1,error:a.error||`Erreur serveur (${n.status})`}}const o=await n.json();return!o.success||!o.public_url?{success:!1,error:o.error||"URL publique non reçue"}:{success:!0,url:o.public_url}}catch(i){return console.error("downloadAndUpload error:",i),{success:!1,error:`Erreur: ${i.message}`}}},async generateAndSave(e,r){const i=await this.generateAnimation(r);if(!i.success)return i;const n=await this.uploadAnimatedPhoto(e,i.videoUrl);if(!n.success)return n;const o=await this.saveAnimatedPhotoUrl(e,n.url);return o.success?{success:!0,url:n.url}:o},async purchaseAnimation(e){try{const r=await wi.getBalance(e);if(r<Yd)return{success:!1,error:`Solde insuffisant (${r}/${Yd} Meetips)`};const{error:i}=await D.from("meetips_transactions").insert({user_id:e,amount:-Yd,description:"⨠Animation photo de profil"});if(i)throw i;const n=r-Yd,{error:o}=await D.from("profiles").update({meetips_balance:n}).eq("id",e);if(o)throw o;return{success:!0,newBalance:n}}catch(r){return console.error("Purchase animation failed:",r),{success:!1,error:r.message}}},async saveAnimatedPhotoUrl(e,r,i="animated_photo_url"){const n={[i]:r};i==="animated_photo_url"&&(n.avatar_url=null,n.photo=null);const{error:o}=await D.from("profiles").update(n).eq("id",e);return o?(console.error("Save animated photo URL failed:",o),{success:!1,error:o.message}):{success:!0}},async deleteAnimatedPhoto(e,r="animated_photo_url"){const{error:i}=await D.from("profiles").update({[r]:null}).eq("id",e);return i?(console.error("Delete animated photo failed:",i),{success:!1,error:i.message}):{success:!0}},isApiConfigured(){return!0},async generateAndSaveForBot(e,r){try{console.log("[Bot Animation] Step 1: Generating video for bot",e);const i=await this.generateAnimation(r);if(!i.success)return console.error("[Bot Animation] Generation failed:",i.error),{success:!1,error:`Génération échouée: ${i.error}`};console.log("[Bot Animation] Step 1 OK - Video URL:",i.videoUrl),console.log("[Bot Animation] Step 2: Server-side download & upload");const n=await this.downloadAndUpload(`bot_${e}`,i.videoUrl);if(!n.success)return console.error("[Bot Animation] Upload failed:",n.error),{success:!1,error:`Upload échoué: ${n.error}`};console.log("[Bot Animation] Step 2 OK - Public URL:",n.url),console.log("[Bot Animation] Step 3: Saving to database");const o=await this.saveBotAnimatedPhotoUrl(e,n.url);return o.success?(console.log("[Bot Animation] Step 3 OK - All done!"),{success:!0,url:n.url}):(console.error("[Bot Animation] DB save failed:",o.error),{success:!1,error:`Sauvegarde DB échouée: ${o.error}`})}catch(i){return console.error("[Bot Animation] Unexpected error:",i),{success:!1,error:`Erreur inattendue: ${i.message}`}}},async saveBotAnimatedPhotoUrl(e,r){const{error:i}=await D.from("matches").update({animated_photo_url:r}).eq("id",e);return i?(console.error("Save bot animated photo URL failed:",i),{success:!1,error:i.message}):{success:!0}},async deleteBotAnimatedPhoto(e){const{error:r}=await D.from("matches").update({animated_photo_url:null}).eq("id",e);return r?(console.error("Delete bot animated photo failed:",r),{success:!1,error:r.message}):{success:!0}},ANIMATION_COST:Yd},d5=({currentPhoto:e,currentAnimatedUrl:r,onClose:i,onSuccess:n,animatedColumn:o="animated_photo_url"})=>{const{user:a,profile:l,refreshProfile:d}=gr(),p=Lt(),[u,g]=m.useState(r?"existing":"choose"),[h,x]=m.useState(null),[y,_]=m.useState(null),[S,k]=m.useState(null),[w,b]=m.useState(!1),[j,T]=m.useState(""),[P,I]=m.useState(null),R=Ts.isApiConfigured(),O=()=>{i(),p("/shop")};m.useEffect(()=>{a&&wi.getBalance(a.id).then(_)}
927,[a]);const E=async()=>{if(!(!a||!e)){b(!0),k(null),g("generating");try{T("Débit de 6 Meetips...");const K=await Ts.purchaseAnimation(a.id);if(!K.success){k(K.error),g("choose"),b(!1);return}const ne=await wi.getBalance(a.id);_(ne),T("Création de l'animation IA...");const Re=await Ts.generateAnimation(e,T);if(!Re.success){k(Re.error),g("choose"),b(!1);return}T("Téléchargement et sauvegarde de la vidéo...");const Q=await Ts.downloadAndUpload(a.id,Re.videoUrl);if(!Q.success){k(Q.error),g("choose"),b(!1);return}I(Q.url),x(Q.url),g("result")}catch(K){k(K.message),g("choose")}finally{b(!1)}}},$=async()=>{if(!(!a||!P)){b(!0),k(null);try{await Ts.saveAnimatedPhotoUrl(a.id,P,o),await d(),n(P)}catch(K){k(K.message)}finally{b(!1)}}},B=async()=>{const K=P||r;if(K)try{const Re=await(await fetch(K)).blob(),Q=URL.createObjectURL(Re),G=document.createElement("a");G.href=Q,G.download=`photo_animee_${Date.now()}.mp4`,document.body.appendChild(G),G.click(),document.body.removeChild(G),URL.revokeObjectURL(Q)}catch{k("Erreur lors du téléchargement")}},ee=async()=>{if(!a)return;b(!0);const K=await Ts.deleteAnimatedPhoto(a.id,o);K.success?(await d(),n(null)):k(K.error),b(!1)},te=y!==null&&y>=Ts.ANIMATION_COST;return t.jsx(tr,{children:t.jsx(ye.div,{initial:{opacity:0}
927,animate:{opacity:1},exit:{opacity:0},onClick:i,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",zIndex:9998,display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsxs(ye.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},onClick:K=>K.stopPropagation(),style:{width:"90%",maxWidth:"440px",background:"linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%)",borderRadius:"24px",border:"1px solid rgba(255,255,255,0.1)",boxShadow:"0 25px 60px rgba(0,0,0,0.5), 0 0 40px rgba(139,92,246,0.15)",overflow:"hidden",maxHeight:"90vh",overflowY:"auto"},children:[t.jsxs("div",{style:{padding:"20px 24px",borderBottom:"1px solid rgba(255,255,255,0.08)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx("div",{style:{background:"linear-gradient(135deg, #8b5cf6, #ec4899)",borderRadius:"12px",padding:"8px",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(Xt,{size:20,color:"white"})}),t.jsxs("div",{children:[t.jsx("h3",{style:{margin:0,fontSize:"1.1rem",fontWeight:700,color:"white"},children:"Photo Animée"}),t.jsx("span",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.5)"},children:"Animation IA de votre profil"})]})]}),t.jsx("button",{onClick:i,style:{background:"rgba(255,255,255,0.08)",border:"none",borderRadius:"50%",width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center",color:"white",cursor:"pointer"},children:t.jsx(mt,{size:18})})]}),t.jsxs("div",{style:{padding:"24px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",background:"rgba(255,255,255,0.05)",borderRadius:"14px",padding:"12px 16px",marginBottom:"20px",border:"1px solid rgba(255,255,255,0.06)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(RA,{size:18,color:"#FFD700"}),t.jsx("span",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.6)"},children:"Votre solde"})]}),t.jsx("span",{style:{fontWeight:700,fontSize:"1rem",color:te?"#FFD700":"#ef4444"},children:y!==null?`${y} Meetips`:"..."})]}),u==="existing"&&t.jsxs("div",{style:{textAlign:"center"},children:[t.jsxs("div",{style:{borderRadius:"16px",overflow:"hidden",border:"2px solid rgba(139,92,246,0.4)",boxShadow:"0 0 30px rgba(139,92,246,0.2)",marginBottom:"16px",position:"relative"},children:[t.jsx("video",{src:r,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,style:{width:"100%",maxHeight:"280px",objectFit:"cover"}}),t.jsxs("div",{style:{position:"absolute",top:"10px",right:"10px",background:"linear-gradient(135deg, #8b5cf6, #ec4899)",padding:"4px 10px",borderRadius:"20px",fontSize:"0.7rem",fontWeight:700,color:"white",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(Xt,{size:12})," ANIMÃE"]})]}),t.jsx("p",{style:{color:"rgba(255,255,255,0.5)",fontSize:"0.85rem",marginBottom:"16px"},children:"Votre photo est actuellement animée â¨"}),t.jsxs("div",{style:{display:"flex",gap:"10px"},children:[t.jsxs("button",{onClick:B,style:{flex:1,padding:"12px",borderRadius:"12px",background:"rgba(59,130,246,0.15)",border:"1px solid rgba(59,130,246,0.3)",color:"#60a5fa",cursor:"pointer",fontWeight:600,fontSize:"0.85rem",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"},children:[t.jsx(nx,{size:14})," Télécharger"]}),t.jsx("button",{onClick:()=>g("choose"),style:{flex:1,padding:"12px",borderRadius:"12px",background:"rgba(139,92,246,0.15)",border:"1px solid rgba(139,92,246,0.3)",color:"#a78bfa",cursor:"pointer",fontWeight:600,fontSize:"0.85rem"},children:"Remplacer"}),t.jsx("button",{onClick:ee,disabled:w,style:{padding:"12px 16px",borderRadius:"12px",background:"rgba(239,68,68,0.1)",border:"1px solid rgba(239,68,68,0.2)",color:"#ef4444",cursor:"pointer",fontSize:"0.85rem",display:"flex",alignItems:"center",gap:"6px",opacity:w?.5:1},children:t.jsx(rn,{size:14})})]})]}),u==="choose"&&t.jsxs("div",{children:[e&&t.jsx("div",{style:{borderRadius:"16px",overflow:"hidden",marginBottom:"16
927px",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.3)",display:"flex",justifyContent:"center"},children:t.jsx("img",{src:e,alt:"Photo actuelle",style:{width:"100%",maxHeight:"280px",objectFit:"contain"}})}),R&&t.jsxs("button",{onClick:E,disabled:!te||w,style:{width:"100%",padding:"18px",borderRadius:"16px",cursor:te?"pointer":"not-allowed",background:te?"linear-gradient(135deg, #8b5cf6, #ec4899)":"rgba(255,255,255,0.05)",border:"none",color:"white",fontSize:"1rem",fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",boxShadow:te?"0 4px 25px rgba(139,92,246,0.4)":"none",transition:"all 0.3s",marginBottom:"12px"},children:[t.jsx(zh,{size:22}),"Animer avec l'IA â 6 Meetips"]}),!te&&y!==null&&t.jsxs("button",{onClick:O,style:{width:"100%",padding:"14px",marginTop:"8px",borderRadius:"14px",cursor:"pointer",background:"linear-gradient(135deg, #f59e0b, #f97316)",border:"none",color:"white",fontSize:"0.9rem",fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",boxShadow:"0 4px 20px rgba(245,158,11,0.3)",transition:"all 0.3s"},children:[t.jsx(ys,{size:18}),"Recharger mes Meetips"]}),t.jsxs("div",{style:{textAlign:"center",marginTop:"14px",fontSize:"0.75rem",color:"rgba(255,255,255,0.35)"},children:["Coût : ",t.jsx("strong",{style:{color:"#FFD700"},children:"6 Meetips"})," par animation"]})]}),u==="generating"&&t.jsxs("div",{style:{textAlign:"center",padding:"30px 0"},children:[t.jsx(ye.div,{animate:{rotate:360},transition:{duration:2,repeat:1/0,ease:"linear"},style:{display:"inline-block",marginBottom:"20px"},children:t.jsx(zh,{size:48,color:"#8b5cf6"})}),t.jsx("h4",{style:{color:"white",margin:"0 0 10px",fontSize:"1.1rem"},children:"Génération en cours..."}),t.jsx("p",{style:{color:"rgba(255,255,255,0.5)",fontSize:"0.85rem",margin:0},children:j||"Préparation..."}),t.jsx("div",{style:{width:"80%",height:"4px",borderRadius:"2px",background:"rgba(255,255,255,0.1)",margin:"20px auto 0",overflow:"hidden"},children:t.jsx(ye.div,{animate:{x:["-100%","100%"]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut"},style:{width:"50%",height:"100%",background:"linear-gradient(90deg, #8b5cf6, #ec4899)",borderRadius:"2px"}})}),t.jsx("p",{style:{color:"rgba(255,255,255,0.3)",fontSize:"0.7rem",marginTop:"15px"},children:"â± Cela peut prendre 30 à 60 secondes"})]}),u==="result"&&h&&t.jsxs("div",{style:{textAlign:"center"},children:[t.jsxs(ye.div,{initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:200,damping:15},style:{display:"inline-flex",alignItems:"center",gap:"8px",background:"rgba(34,197,94,0.15)",border:"1px solid rgba(34,197,94,0.3)",borderRadius:"30px",padding:"8px 18px",marginBottom:"16px",color:"#22c55e",fontWeight:700,fontSize:"0.85rem"},children:[t.jsx(ms,{size:18})," Animation générée !"]}),t.jsxs("div",{style:{borderRadius:"16px",overflow:"hidden",border:"2px solid rgba(139,92,246,0.4)",boxShadow:"0 0 30px rgba(139,92,246,0.2)",marginBottom:"16px",position:"relative"},children:[t.jsx("video",{src:h,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,style:{width:"100%",maxHeight:"300px",objectFit:"cover"}}),t.jsxs("div",{style:{position:"absolute",top:"10px",left:"10px",background:"rgba(0,0,0,0.6)",backdropFilter:"blur(5px)",padding:"4px 10px",borderRadius:"20px",fontSize:"0.7rem",fontWeight:600,color:"white",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(p0,{size:12})," Aperçu"]})]}),t.jsx("p",{style:{color:"rgba(255,255,255,0.5)",fontSize:"0.85rem",marginBottom:"16px"},children:"Votre animation sera visible par tous les prétendants ð«"}),t.jsxs("div",{style:{display:"flex",gap:"10px",marginBottom:"12px"},children:[t.jsx("button",{onClick:$,disabled:w,style:{flex:2,padding:"16px",borderRadius:"14px",background:"linear-gradient(135deg, #22c55e, #16a34a)",border:"none",color:"white",cursor:"pointer",fontWeight:700,fontSize:"0.95rem",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",boxShadow:"0 4px 20px rgba(34,197,94,0.4)",opacity:w?.6:1,transition:"all 0.3s"},children:w?t.jsx(t.Fragment,{children:"â³ Sauvegarde..."}):t.jsxs(t.Fragment,{children:[t.jsx(ms,{size:20})," Valider"]})}),t.jsxs("button",{onClick:B,style:{flex:1,padding:"16px",borderRadius:"14px",background:"rgba(59,130,246,0.15)",border:"1px solid rgba(59,130,246,0.3)",color:"#60a5fa",cursor:"pointer",fontWeight:600,fontSize:"0.85rem",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",transition:"all 0.3s"},children:[t.jsx(nx,{size:18})," Télécharger"]})]}),t.jsx("button",{onClick:()=>{g("choose"),x(null),I(null)},style:{width:"100%",padding:"10px",borderRadius:"10px",background:"transparent",border:"none",color:"rgba(255,255,255,0.4)",cursor:"pointer",fontSize:"0.8rem",fontWeight:500},children:"â© Pas satisfait ? Regénérer (6 Meetips)"})]}),S&&t.jsxs("div",{style:{background:"rgba(239,68,68,0.1)",borderRadius:"10px",padding:"10px 14px",marginTop:"12px",border:"1px solid rgba(239,68,68,0.2)",fontSize:"0.8rem",color:"#ef4444",dis
927play:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(_n,{size:16})," ",S]})]})]})})})},c5=({onClose:e,onSuccess:r,profileId:i,mode:n})=>{const{user:o,profile:a,refreshProfile:l}=gr(),d=m.useRef(null),p=m.useRef(null),u=m.useRef(null),g=m.useRef(null),h=m.useRef([]),[x,y]=m.useState("camera"),[_,S]=m.useState(3),[k,w]=m.useState(null),[b,j]=m.useState(null),[T,P]=m.useState(null),[I,R]=m.useState(0),[O,E]=m.useState(0),$=m.useRef(null);m.useEffect(()=>(B(),()=>{ee(),b&&URL.revokeObjectURL(b),$.current&&clearInterval($.current)}),[]);const B=async()=>{try{const G=await navigator.mediaDevices.getUserMedia({video:{facingMode:"user",width:{ideal:720},height:{ideal:720},frameRate:{ideal:30}},audio:!1});g.current=G,d.current&&(d.current.srcObject=G),P(null)}catch(G){console.error("Camera access denied:",G),P("Impossible d'accéder à la caméra. Vérifiez les permissions.")}},ee=()=>{g.current&&(g.current.getTracks().forEach(G=>G.stop()),g.current=null)},te=()=>{y("countdown"),S(3);let G=3;const le=setInterval(()=>{G--,S(G),G<=0&&(clearInterval(le),K())},1e3)},K=()=>{y("recording"),E(0),h.current=[];const G=g.current;if(!G)return;const le=MediaRecorder.isTypeSupported("video/webm;codecs=vp9")?"video/webm;codecs=vp9":MediaRecorder.isTypeSupported("video/webm")?"video/webm":"video/mp4",F=new MediaRecorder(G,{mimeType:le,videoBitsPerSecond:15e5});u.current=F,F.ondataavailable=A=>{A.data.size>0&&h.current.push(A.data)},F.onstop=()=>{$.current&&clearInterval($.current);const A=new Blob(h.current,{type:le});console.log("[Photobooth] Recording stopped, blob size:",A.size,"type:",A.type),w(A);const M=URL.createObjectURL(A);j(M),d.current&&(d.current.srcObject=null),y("preview")},F.start(),$.current=setInterval(()=>{E(A=>A+.1)},100),setTimeout(()=>{F.state==="recording"&&F.stop()},3e3)},ne=()=>{b&&URL.revokeObjectURL(b),w(null),j(null),E(0),P(null),y("camera"),g.current||B()},Re=async()=>{var le;let G=i||(o==null?void 0:o.id)||(a==null?void 0:a.id);if(!G)try{const{data:{session:F}}=await D.auth.getSession();G=(le=F==null?void 0:F.user)==null?void 0:le.id,console.log("[Photobooth] Fallback session userId:",G)}catch(F){console.warn("[Photobooth] Session fallback failed:",F)}if(console.log("[Photobooth] Validate clicked. recordedBlob:",!!k,"userId:",G,"sources:",{propProfileId:i,authUser:o==null?void 0:o.id,authProfile:a==null?void 0:a.id}),!k||!G){console.error("[Photobooth] Cannot validate: recordedBlob=",!!k,"userId=",G),P("Erreur: impossible d'identifier votre compte. Rafraîchissez la page et réessayez.");return}y("uploading"),P(null),R(10);try{let F=k;const A=F.size/(1024*1024);console.log(`[Photobooth] Video selfie size: ${A.toFixed(2)} MB`),R(30);const M=F.type.includes("mp4")?"mp4":"webm",V=`${G}/video_selfie.${M}`,Z=$a("https://bqfzljnhxblhiabyvpqm.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4"),{error:ae}=await Z.storage.from("avatars").upload(V,F,{upsert:!0,contentType:F.type});if(ae)throw ae;R(70);const{data:X}=D.storage.from("avatars").getPublicUrl(V),he=X.publicUrl+"?t="+Date.now();R(85);const Ae=n==="EROX",ze=n==="FRIEND",xe={[Ae?"erox_avatar_url":ze?"friend_avatar_url":"avatar_url"]:he,animated_photo_url:he,photo:he};(Ae||ze)&&(xe.avatar_url=xe.avatar_url||he);const{error:ke}=await D.from("profiles").update(xe).eq("id",G);if(ke)throw ke;R(100),await l(),ee(),r(he)}catch(F){console.error("Video upload error:",F),P("Erreur d'envoi : "+F.message),y("preview")}},Q=x==="camera"||x==="countdown"||x==="recording";return t.jsxs("div",{style:{position:"fixed",inset:0,zIndex:99999,background:"rgba(0,0,0,0.7)",backdropFilter:"blur(12px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"20px",fontFamily:"Outfit, sans-serif"},children:[t.jsxs("div",{style:{width:"100%",maxWidth:"420px",background:"linear-gradient(180deg, #1a1a2e 0%, #16162a 50%, #0f0f1d 100%)",borderRadius:"28px",overflow:"hidden",border:"1px solid rgba(139,92,246,0.2)",boxShadow:"0 25px 80px rgba(0,0,0,0.6), 0 0 60px rgba(139,92,246,0.1)",animation:"fadeInScale 0.3s ease-out"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px 20px",background:"linear-gradient(90deg, rgba(139,92,246,0.15), rgba(236,72,153,0.15))",borderBottom:"1px solid rgba(139,92,246,0.1)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx("div",{style:{width:"36px",height:"36px",borderRadius:"12px",background:"linear-gradient(135deg, #8b5cf6, #ec4899)",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(pi,{size:18,color:"white"})}),t.jsxs("div",{children:[t.jsx("h3",{style:{margin:0,color:"white",fontSize:"1rem",fontWeight:"700"},children:"Photobooth ð¬"}),t.jsx("span",{style:{color:"rgba(255,255,255,0.4)",fontSize:"0.72rem"},children:"Selfie vidéo 3 secondes"})]})]}),t.jsx("button",{onClick:()=>{ee(),e()},style:{background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"50%",width:"34px",height:"34px",display:"flex",alignItems:"center",justifyContent:"center",color:"rgba(255,255,255,0.6)",cursor:"pointer",transition:"all 0.2s"},children:t.jsx(mt,{size:16})})]}),t.jsx("div",{style:{position:"relative",width:"100%",aspectRatio:"1",background:"#000",overflow:"hidden"},children:T&&!b?t.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"30px",textAlign:"center"},children:[t.jsx("div",{style:{width:"60px",height:"60px",borderRadius:"50%",background:"rgba(255,107,107,0.15)",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"16
927px"},children:t.jsx(pi,{size:28,color:"#ff6b6b"})}),t.jsx("p",{style:{color:"#ff6b6b",marginBottom:"16px",fontSize:"0.9rem",lineHeight:1.5},children:T}),t.jsxs("button",{onClick:()=>{P(null),B()},style:{background:"rgba(139,92,246,0.2)",border:"1px solid rgba(139,92,246,0.4)",color:"white",padding:"10px 24px",borderRadius:"25px",cursor:"pointer",fontSize:"0.88rem",fontWeight:"600",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(lx,{size:14})," Réessayer"]})]}):t.jsxs(t.Fragment,{children:[Q?t.jsx("video",{ref:d,autoPlay:!0,playsInline:!0,muted:!0,style:{width:"100%",height:"100%",objectFit:"cover",transform:"scaleX(-1)"}}):t.jsx("video",{ref:p,src:b,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,style:{width:"100%",height:"100%",objectFit:"cover",transform:"scaleX(-1)"}}),T&&b&&t.jsxs("div",{style:{position:"absolute",bottom:"16px",left:"16px",right:"16px",background:"rgba(239,68,68,0.9)",backdropFilter:"blur(4px)",padding:"10px 16px",borderRadius:"12px",display:"flex",alignItems:"center",gap:"8px",animation:"fadeInScale 0.3s ease-out"},children:[t.jsx("span",{style:{color:"white",fontSize:"0.8rem",flex:1},children:T}),t.jsx("button",{onClick:()=>P(null),style:{background:"none",border:"none",color:"white",cursor:"pointer",padding:"2px"},children:t.jsx(mt,{size:14})})]}),Q&&t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{position:"absolute",top:"12px",left:"12px",width:"24px",height:"24px",borderTop:"2px solid rgba(139,92,246,0.6)",borderLeft:"2px solid rgba(139,92,246,0.6)",borderRadius:"4px 0 0 0"}}),t.jsx("div",{style:{position:"absolute",top:"12px",right:"12px",width:"24px",height:"24px",borderTop:"2px solid rgba(139,92,246,0.6)",borderRight:"2px solid rgba(139,92,246,0.6)",borderRadius:"0 4px 0 0"}}),t.jsx("div",{style:{position:"absolute",bottom:"12px",left:"12px",width:"24px",height:"24px",borderBottom:"2px solid rgba(139,92,246,0.6)",borderLeft:"2px solid rgba(139,92,246,0.6)",borderRadius:"0 0 0 4px"}}),t.jsx("div",{style:{position:"absolute",bottom:"12px",right:"12px",width:"24px",height:"24px",borderBottom:"2px solid rgba(139,92,246,0.6)",borderRight:"2px solid rgba(139,92,246,0.6)",borderRadius:"0 0 4px 0"}})]}),x==="countdown"&&t.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.4)"},children:t.jsx("div",{style:{width:"120px",height:"120px",borderRadius:"50%",background:"rgba(139,92,246,0.25)",backdropFilter:"blur(8px)",border:"3px solid rgba(139,92,246,0.6)",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 0 50px rgba(139,92,246,0.4)"},children:t.jsx("span",{style:{fontSize:"4rem",fontWeight:"900",color:"white",textShadow:"0 0 30px rgba(139,92,246,0.8)",lineHeight:1},children:_})})}),x==="recording"&&t.jsxs("div",{style:{position:"absolute",top:"16px",left:"50%",transform:"translateX(-50%)",display:"flex",alignItems:"center",gap:"8px",background:"rgba(239,68,68,0.9)",padding:"6px 14px",borderRadius:"20px",backdropFilter:"blur(4px)"},children:[t.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",background:"#fff",animation:"boothPulse 0.8s ease-in-out infinite"}}),t.jsxs("span",{style:{color:"white",fontSize:"0.8rem",fontWeight:"700",fontVariantNumeric:"tabular-nums"},children:[Math.min(O,3).toFixed(1),"s / 3s"]})]}),x==="recording"&&t.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:"4px",background:"rgba(255,255,255,0.1)"},children:t.jsx("div",{style:{height:"100%",width:`${Math.min(O/3*100,100)}%`,background:"linear-gradient(90deg, #8b5cf6, #ec4899)",transition:"width 0.1s linear"}})}),x==="uploading"&&t.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.7)",backdropFilter:"blur(4px)"},children:[t.jsx("div",{style:{width:"64px",height:"64px",borderRadius:"50%",border:"3px solid rgba(139,92,246,0.3)",borderTopColor:"#8b5cf6",animation:"boothSpin 1s linear infinite",marginBottom:"16px"}}),t.jsx("div",{style:{width:"180px",height:"4px",borderRadius:"2px",background:"rgba(255,255,255,0.1)",overflow:"hidden"},children:t.jsx("div",{style:{width:`${I}%`,height:"100%",background:"linear-gradient(90deg, #8b5cf6, #ec4899)",transition:"width 0.3s ease",borderRadius:"2px"}})}),t.jsxs("span",{style:{color:"rgba(255,255,255,0.7)",marginTop:"10px",fontSize:"0.82rem"},children:["Envoi en cours... ",I,"%"]})]})]})}),t.jsxs("div",{style:{padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px",background:"rgba(0,0,0,0.3)"},children:[x==="camera"&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:te,style:{width:"100%",padding:"14px",background:"linear-gradient(135deg, #8b5cf6, #ec4899)",border:"none",borderRadius:"16px",color:"white",fontSize:"1rem",fontWeight:"700",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",boxShadow:"0 4px 25px rgba(139,92,246,0.35)",transition:"all 0.2s"},children:[t.jsx(Ea,{size:20,fill:"white",color:"white"})," Enregistrer mon selfie"]}),t.jsx("p",{style:{color:"rgba(255,255,255,0.35)",fontSize:"0.75rem",textAlign:"center",margin:0,lineHeight:1.5},children:"Appuyez pour démarrer le compte à rebours 3-2-1 puis 3 secondes d'enregistrement"})]}),x==="preview"&&t.jsxs("div",{style:{display:"flex",gap:"10px"},children:[t.jsxs("button",{onClick:ne,style:{flex:1,padding:"14px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.15)",borderRadius:"16px",color:"white",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",fontSize:"0.95rem",fontWeight:"600",transition:"all 0.2s"},children:[t.jsx(lx,{size:17})," Refaire"]}),t.jsxs("button",{onClick:()=>
927{if(k){b&&URL.revokeObjectURL(b);const G=URL.createObjectURL(k);j(G)}},style:{flex:1,padding:"14px",background:"rgba(139,92,246,0.15)",border:"1px solid rgba(139,92,246,0.3)",borderRadius:"16px",color:"white",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",fontSize:"0.95rem",fontWeight:"600",transition:"all 0.2s"},children:[t.jsx(p0,{size:17})," Revoir"]}),t.jsxs("button",{onClick:Re,style:{flex:1.3,padding:"14px",background:"linear-gradient(135deg, #10b981, #059669)",border:"none",borderRadius:"16px",color:"white",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",fontSize:"0.95rem",fontWeight:"700",boxShadow:"0 4px 20px rgba(16,185,129,0.35)",transition:"all 0.2s"},children:[t.jsx(pr,{size:17})," Valider â¨"]})]}),(x==="countdown"||x==="recording")&&t.jsx("div",{style:{textAlign:"center",padding:"10px",color:"rgba(255,255,255,0.5)",fontSize:"0.88rem",fontWeight:"500"},children:x==="countdown"?"ð¬ Préparez-vous...":"ð Souriez !"}),x==="uploading"&&t.jsx("div",{style:{textAlign:"center",padding:"10px",color:"rgba(255,255,255,0.4)",fontSize:"0.85rem"},children:"Votre vidéo est en cours de sauvegarde..."})]})]}),t.jsx("style",{children:` 928 @keyframes fadeInScale { 929 from { opacity: 0; transform: scale(0.9); } 930 to { opacity: 1; transform: scale(1); } 931 } 932 @keyframes boothPulse { 933 0%, 100% { opacity: 1; } 934 50% { opacity: 0.3; } 935 } 936 @keyframes boothSpin { 937 from { transform: rotate(0deg); } 938 to { transform: rotate(360deg); } 939 } 940 `})]})},t1=["Mon talent caché inutile est...","Je ne peux pas dormir sans...","Ma plus grande aventure a été...","Un fait surprenant sur moi...","Ce qui me fait rire à coup sûr...","Mon plat signature est...","Le dimanche idéal pour moi c'est...","Je suis obsédé(e) par...","Ma destination de rêve...","La BO de ma vie serait..."],r1=()=>{const e=Lt(),{user:r,profile:i,refreshProfile:n}=gr(),o=si(),{mode:a,isErox:l,isFriend:d}=dr(),p=xn(),[u,g]=m.useState({name:"",birthdate:"",gender:"female",city:"",phone:"",email:"",password:"",job:"",bio:"",tags:[],is_discreet:!1}),[h,x]=m.useState(null),[y,_]=m.useState([]),[S,k]=m.useState([]),[w,b]=m.useState({}),[j,T]=m.useState(null),[P,I]=m.useState(null),[R,O]=m.useState(!1),[E,$]=m.useState(!1),[B,ee]=m.useState(null),[te,K]=m.useState(!1),[ne,Re]=m.useState(!1),[Q,G]=m.useState(!1),[le,F]=m.useState(null),[A,M]=m.useState(null),[V,H]=m.useState(!1),[N,Z]=m.useState(""),[ae,X]=m.useState(""),[he,Ae]=m.useState(!1),ze=l?"erox_name":d?"friend_name":"name",ue=l?"#ff4d4d":d?"#26A69A":"#c9a0ff",xe=l?"Erox":d?"Friend":"Eros",ke=l?i==null?void 0:i.erox_avatar_url:d?i==null?void 0:i.friend_avatar_url:i==null?void 0:i.avatar_url,[Pe,Ce]=m.useState(!1),[Me,Le]=m.useState(()=>(localStorage.getItem("appMode")||localStorage.getItem("onboardingMode")||localStorage.getItem("onboarding_mode")||"EROS").toUpperCase());m.useEffect(()=>{a&&Le(a.toUpperCase())},[a]);const rt=localStorage.getItem("isPremium")==="true",Fe=m.useRef(null);m.useEffect(()=>{var pe,$e,Xe,tt,gt,at,Pt,vt;if(r&&i){O(!0);const ut=(l?i.erox_name:d?i.friend_name:i.name)||"";Z(ut),X(ut),g({name:i.name||((pe=r.user_metadata)==null?void 0:pe.name)||"",birthdate:i.birthdate||(($e=r.user_metadata)==null?void 0:$e.birthdate)||"",gender:i.gender||((Xe=r.user_metadata)==null?void 0:Xe.gender)||"female",city:i.city||((tt=i.location)==null?void 0:tt.city)||((gt=r.user_metadata)==null?void 0:gt.city)||"",phone:i.phone||((at=r.user_metadata)==null?void 0:at.phone)||"",email:r.email||"",password:"",job:i.job||"",bio:i.bio||"",tags:i.tags||((Pt=r.user_metadata)==null?void 0:Pt.tags)||[],is_discreet:i.is_discreet||!1});const Wt=Me?Me.toLowerCase():"eros";let dt=null,Rr=[];console.log(`[ProfileCompletion] Loading for mode: ${Wt} `),console.log("[ProfileCompletion] Profile Data:",i),i&&(async()=>{const Rt=async(br,Ht)=>{if(!Ht||!Array.isArray(Ht)||!Ht.some(St=>St&&St.startsWith("data:")))return;console.log(`[AutoRepair] Fixing ${br}...`);const Ze=$a("https://bqfzljnhxblhiabyvpqm.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4"),Ue=(await Promise.all(Ht.map(async(St,At)=>{if(!St)return null;if(St.startsWith("http"))return St;if(St.startsWith("data:"))try{const Gt=await(await fetch(St)).blob(),fr=`${r.id}/${br}_${At}_repaired.jpg`,{error:It}=await Ze.storage.from("avatars").upload(fr,Gt,{upsert:!0});if(It)throw It;const{data:jt}=Ze.storage.from("avatars").getPublicUrl(fr);return jt.publicUrl}catch(Ft){return console.error("Repair failed for item",At,Ft),null}return St}))).filter(St=>St);if(Ue.length>0){const St={};St[br]=Ue,await D.from("profiles").update(St).eq("id",r.id),console.log(`[AutoRepair] Fixed ${br}!`)}};await Rt("friend_photos",i.friend_photos),await Rt("erox_photos",i.erox_photos),await Rt("photos",i.photos)})(),Wt==="friend"?(dt=i.friend_avatar_url,Rr=i.friend_photos):Wt==="erox"?(dt=i.erox_avatar_url,Rr=i.erox_photos):(dt=i.avatar_url||i.photo,Rr=i.photos),console.log(`[ProfileCompletion] Specific Avatar for ${Wt}:`,dt),x(Wt!=="eros"?dt||null:dt||localStorage.getItem(`localAvatar_${r.id}`)||null),_(Rr||[]);const Dr=i.prompts||i.intro_prompts||((vt=r.user_metadata)==null?void 0:vt.intro_prompts);if(Dr&&Array.isArray(Dr)&&Dr.length>0){const Rt=Dr.map(Ht=>Ht.question);k(Rt);const br={};Dr.forEach(Ht=>br[Ht.question]=Ht.answer),b(br)}else{const Rt=[...t1].sort(()=>.5-Math.random());k(Rt.slice(0,3))}}else{const ut=[...t1].sort(()=>.5-Math.random());k(ut.slice(0,3))}},[r,i]);
940const ft=pe=>{const{name:$e,value:Xe}=pe.target;g(tt=>({...tt,[$e]:Xe})),T(null)},De=(pe,$e)=>{b(Xe=>({...Xe,[pe]:$e}))},Be=pe=>new Promise($e=>{const Xe=new FileReader;Xe.readAsDataURL(pe),Xe.onload=tt=>{const gt=new Image;gt.src=tt.target.result,gt.onload=()=>{const at=document.createElement("canvas"),Pt=600,vt=800;let ut=gt.width,Wt=gt.height;ut>Pt&&(Wt=Math.round(Wt*Pt/ut),ut=Pt),Wt>vt&&(ut=Math.round(ut*vt/Wt),Wt=vt),at.width=ut,at.height=Wt,at.getContext("2d").drawImage(gt,0,0,ut,Wt);const Rr=at.toDataURL("image/jpeg",.55);$e(Rr)}}}),re=async pe=>{const $e=pe.target.files[0];if($e)try{const Xe=await Be($e);x(Xe),T(null)}catch(Xe){console.error("Compression failed:",Xe),T("Erreur image.")}},He=(pe=-1)=>{F(pe),Ce(!0)},be=pe=>{le===-1?x(pe):_($e=>{const Xe=[...$e];return Xe[le]=pe,Xe}),Ce(!1)},nt=pe=>{var $e;M(pe),($e=Fe.current)==null||$e.click()},J=async pe=>{const $e=pe.target.files[0];if($e)try{const Xe=await Be($e);A===-1?x(Xe):A!==null&&_(tt=>{const gt=[...tt];return gt[A]=Xe,gt}),M(null)}catch(Xe){console.error("Replacement failed:",Xe)}},Ie=async pe=>{const $e=pe.target.files[0];if($e)try{const Xe=await Be($e);_(tt=>[...tt,Xe])}catch(Xe){console.error("Gallery upload failed:",Xe)}},z=pe=>{_($e=>$e.filter((Xe,tt)=>tt!==pe))},Y=async()=>{n?await D.auth.signOut():await D.auth.signOut(),e("/")},ce=async()=>{if(confirm("Avez-vous bien corrigé les éléments demandés ?"))try{const{error:pe}=await D.from("profiles").update({restriction_status:"pending_review"}).eq("id",r.id);if(pe)throw pe;const Xe={...JSON.parse(localStorage.getItem("userProfile")||"{}"),restriction_status:"pending_review"};localStorage.setItem("userProfile",JSON.stringify(Xe)),o.success("Votre demande de révision a été envoyée aux modérateurs."),n&&n(),window.location.reload()}catch(pe){o.error("Erreur: "+pe.message)}},ve=async pe=>{var tt,gt;if(pe.preventDefault(),T(""),Me==="EROX"&&(!u.password||u.password.length<6)&&!R){T("Le mot de passe doit faire au moins 6 caractères.");return}if(!u.name)return T("Le nom est obligatoire.");if(!u.city)return T("La ville est obligatoire.");if(Me==="FRIEND"&&!u.job)return T("Votre métier est obligatoire pour le mode Friend.");const $e=new Date(u.birthdate);if(new Date().getFullYear()-$e.getFullYear()<18)return T("Vous devez avoir 18 ans.");try{H(!0);let at=r==null?void 0:r.id,Pt=u.tags;const vt=ux({name:u.name,city:u.city,email:u.email,search_mode:Me,onboarding_completed:!0});if(R)try{const{error:Rt}=await D.auth.updateUser({data:vt});if(Rt)throw Rt}catch(Rt){console.warn("Auth update metadata failed:",Rt)}else{const{data:Rt,error:br}=await D.auth.signUp({email:u.email,password:u.password,options:{data:vt,emailRedirectTo:`${window.location.origin}/matches?mode=${Me}`}});if(br)throw br;at=Rt.user.id;try{await D.from("profiles").update({meetips_balance:5}).eq("id",at),console.log("â
5 Meetips offerts au nouveau compte")}catch(Ht){console.warn("Meetips credit on signup failed (will retry):",Ht)}if(!Rt.session){console.log("No session â saving data via save-onboarding Edge Function");const Ht="https://bqfzljnhxblhiabyvpqm.supabase.co",or="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4",sr={"Content-Type":"application/json",apikey:or,Authorization:`Bearer ${or}`};try{const Ze={userId:at,profileData:{name:u.name,gender:u.gender,city:u.city,birthdate:u.birthdate||null,job:u.job||null,bio:u.bio||null,phone:u.phone||null,tags:Me==="EROX"?void 0:u.tags,erox_tags:Me==="EROX"?u.tags:void 0,prompts:S.map(St=>({question:St,answer:w[St]||""})),meetips_balance:5,onboardingMode:Me}};Object.keys(Ze.profileData).forEach(St=>{Ze.profileData[St]===void 0&&delete Ze.profileData[St]}),console.log("Step 1: Saving profile text data...",Object.keys(Ze.profileData));const Ue=await(await fetch(`${Ht}/functions/v1/save-onboarding`,{method:"POST",headers:sr,body:JSON.stringify(Ze)})).json();((tt=Ue.errors)==null?void 0:tt.length)>0?console.warn("Step 1 partial errors:",Ue.errors):console.log("â
Step 1: Profile text data saved:",Ue.results)}catch(Ze){console.error("Step 1 (text data) failed:",Ze)}const Ne=[h,...y].filter(Ze=>Ze);if(Ne.length>0)try{console.log(`Step 2: Uploading ${Ne.length} photo(s)...`);const Ze={userId:at,profileData:{onboardingMode:Me},photos:Ne},Ue=await(await fetch(`${Ht}/functions/v1/save-onboarding`,{method:"POST",headers:sr,body:JSON.stringify(Ze)})).json();((gt=Ue.errors)==null?void 0:gt.length)>0?console.warn("Step 2 photo errors:",Ue.errors):console.log("â
Step 2: Photos saved:",Ue.results)}catch(Ze){console.error("Step 2 (photos) failed:",Ze)}localStorage.setItem("userProfile",JSON.stringify({id:at,name:u.name,email:u.email,avatar_url:h,tags:u.tags,birthdate:u.birthdate,job:u.job,bio:u.bio}
940)),localStorage.setItem("pendingWelcomeEmail",JSON.stringify({userId:at,email:u.email,name:u.name,scheduledAt:Date.now()})),G(!0),H(!1);return}}const ut=JSON.parse(localStorage.getItem("userProfile")||"{}");let Wt={lat:48.8566,lng:2.3522,city:u.city};try{if(u.city){const Rt=new AbortController,br=setTimeout(()=>Rt.abort(),3e3),Ht=await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(u.city)}`,{signal:Rt.signal});clearTimeout(br);const or=await Ht.json();(or==null?void 0:or.length)>0&&(Wt={lat:parseFloat(or[0].lat),lng:parseFloat(or[0].lon),city:u.city})}}catch(Rt){console.warn("Geocoding failed:",Rt.message)}const dt={name:u.name,...N.trim()&&l?{erox_name:N.trim()}:{},...N.trim()&&d?{friend_name:N.trim()}:{},gender:u.gender,city:u.city,birthdate:u.birthdate,prompts:S.map(Rt=>({question:Rt,answer:w[Rt]})),location:Wt,job:u.job,bio:u.bio,phone:u.phone,tags:Me==="EROX"?void 0:Pt,erox_tags:Me==="EROX"?Pt:void 0};Me==="FRIEND"?(dt.friend_avatar_url=h,dt.friend_photos=y):Me==="EROX"?(dt.erox_avatar_url=h,dt.erox_photos=y):(dt.avatar_url=h,dt.photos=y);
940const Rr={...ut,...dt,id:at};localStorage.setItem("userProfile",JSON.stringify(Rr)),h&&(Me==="EROS"||!Me)&&(localStorage.setItem(`localAvatar_${at}`,h),localStorage.removeItem("localAvatar"));let Dr=null;try{let Rt=dt.location;Rt&&typeof Rt=="object"&&(isNaN(parseFloat(Rt.lat))||isNaN(parseFloat(Rt.lng)))&&(Rt=null,console.warn("DEBUG: Invalid Location override to NULL"));const br=Ne=>Ne===""||Ne===void 0?null:Ne,Ht=Ne=>{const Ze={};return Object.keys(Ne).forEach(Et=>{const Ue=Ne[Et];Ue!=null&&Ue!==""&&(Ze[Et]=Ue)}),Ze},or=[];if(dt.name&&dt.name!==(ut==null?void 0:ut.name)){const{error:Ne}=await D.from("profiles").update({name:dt.name}).eq("id",at);Ne&&(console.error("Failed to update Name:",Ne),or.push("Le nom n'a pas pu être modifié."))}if(dt.city){const{error:Ne}=await D.from("profiles").update({city:dt.city}).eq("id",at);Ne&&(console.error("Failed to update City:",Ne),or.push("La ville n'a pas pu être modifiée."))}if(dt.gender){const{error:Ne}=await D.from("profiles").update({gender:dt.gender}).eq("id",at);Ne&&(console.error("Failed to update Gender:",Ne),or.push("Le genre n'a pas pu être modifié."))}if(dt.birthdate){const{error:Ne}=await D.from("profiles").update({birthdate:dt.birthdate}).eq("id",at);Ne&&(console.error("Failed to update Birthdate:",Ne),or.push("La date de naissance n'a pas pu être modifiée."))}if(dt.phone){const{error:Ne}=await D.from("profiles").update({phone:dt.phone}).eq("id",at);Ne&&(console.error("Failed to update Phone:",Ne),or.push("Le téléphone n'a pas pu être modifié."))}await D.from("profiles").update({updated_at:new Date().toISOString()}).eq("id",at),console.log("DEBUG: Resilient Steps Finished. Errors:",or);try{const Ne={bio:br(dt.bio),job:br(dt.job),location:Rt};dt.is_discreet!==void 0&&(Ne.is_discreet=dt.is_discreet),Dr=Ne,console.log("DEBUG: Saving Step 2 (Details)...");const{error:Ze}=await D.from("profiles").update(Ne).eq("id",at);Ze&&(console.error("Failed Step 2:",Ze),or.push("Détails (Bio/Job) non sauvegardés."))}catch(Ne){console.error("Crash Step 2:",Ne),or.push("Erreur critique Bio/Job.")}try{const Ne={};if(dt.tags&&(Ne.tags=dt.tags),dt.erox_tags&&(Ne.erox_tags=dt.erox_tags),dt.friend_tags&&(Ne.friend_tags=dt.friend_tags),dt.prompts&&(Ne.prompts=dt.prompts),dt.preferences&&(Ne.preferences=dt.preferences),dt.friend_preferences&&(Ne.friend_preferences=dt.friend_preferences),dt.erox_preferences&&(Ne.erox_preferences=dt.erox_preferences),Object.keys(Ne).length>0){Dr=Ne,console.log("DEBUG: Saving Step 3 (Tags)...");const{error:Ze}=await D.from("profiles").update(Ne).eq("id",at);Ze&&(console.error("Failed Step 3:",Ze),or.push("Tags/Préférences non sauvegardés."))}}catch(Ne){console.error("Crash Step 3:",Ne),or.push("Erreur critique Tags.")}console.log("DEBUG: All Steps Finished. Errors:",or),or.length>0&&o.warning("Sauvegarde partielle. Certains champs non mis à jour.");let sr="avatar_url";if(Me==="FRIEND"&&(sr="friend_avatar_url"),Me==="EROX"&&(sr="erox_avatar_url"),console.log(`[ProfileCompletion] Saving Avatar. Mode: ${Me}, Target: ${sr}`),h&&h.startsWith("data:"))try{console.log("Attempting Direct Storage Upload (Bypass)..."),console.log("Using standard fetch for blob...");const Ze=await(await fetch(h)).blob();let Et="avatar";sr!=="avatar_url"&&(Et=sr);const Ue=`${at}/${Et}_fixed.jpg`;console.log("Creating Anon Client for Bypass...");const Ft=$a("https://bqfzljnhxblhiabyvpqm.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4"),{error:Gt}=await Ft.storage.from("avatars").upload(Ue,Ze,{upsert:!0});if(Gt)console.error("Storage Upload Failed:",Gt),console.error("Upload Debug:",{userId:at,blobSize:Ze.size,filePath:Ue,error:Gt.message}),o.error("Erreur d'upload photo: "+Gt.message);else{console.log("â
Storage Upload Success!");const{data:fr}=D.storage.from("avatars").getPublicUrl(Ue),It=fr.publicUrl+"?t="+Date.now(),jt={};jt[sr]=It,sr==="avatar_url"&&(jt.animated_photo_url=null,jt.photo=It);const{error:Dt}=await D.from("profiles").update(jt).eq("id",at);if(Dt)console.error("Photo DB update failed:",Dt),o.error("Photo uploadée mais pas sauvegardée en base.");else{console.log(`â
Photo saved to ${sr}:`,It),o.success("ð¸ Photo de profil mise à jour !");try{const Nt=JSON.parse(localStorage.getItem("userProfile")||"{}");Nt[sr]=It,sr==="avatar_url"&&(Nt.photo=It),localStorage.setItem("userProfile",JSON.stringify(Nt))}catch(Nt){console.warn("localStorage photo sync failed:",Nt)}}}}catch(Ne){console.error("Photo Save Critical Error:",Ne)}else if(h&&h.startsWith("http")){const Ne={};Ne[sr]=h;const{error:Ze}=await D.from("profiles").update(Ne).eq("id",at);Ze&&console.error("URL DB Update Failed:",Ze)}if(y&&y.length>0){let Ne="photos";Me==="FRIEND"&&(Ne="friend_photos"),Me==="EROX"&&(Ne="erox_photos"),console.log(`Saving Gallery to ${Ne} via Anon Upload...`);const Ue=$a("https://bqfzljnhxblhiabyvpqm.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4"),At=(await Promise.all(y.map(async(fr,It)=>{if(!fr)return null;if(fr.startsWith("http"))return fr;if(fr.startsWith("data:"))try{const Dt=await(await fetch(fr)).blob(),Nt=`${at}/${Ne}_${It}_fixed.jpg`,{error:jr}=await Ue.storage.from("avatars").upload(Nt,Dt,{upsert:!0});if(jr)return console.error(`Gallery upload ${It} failed:`,jr),null;const{data:Zt}=Ue.storage.from("avatars").getPublicUrl(Nt);
940return Zt.publicUrl+"?t="+Date.now()}catch(jt){return console.error("Gallery conversion Error:",jt),null}return null}))).filter(fr=>fr),Ft={};Ft[Ne]=At;const{error:Gt}=await D.from("profiles").update(Ft).eq("id",at);Gt?console.error("Gallery DB Update Failed:",Gt):console.log("â
Gallery Saved Successfully:",At.length)}console.log("Update Process Finished."),or.length>0?o.warning("Sauvegarde partielle. Photos OK, certains champs non mis à jour."):o.success("Profil mis à jour avec succès !"),n&&await n(),e(R?"/matches":"/preferences")}catch(Rt){console.error("Update Error:",Rt),I({step:"STEP 1 (Identity)",message:Rt.message,details:Rt.details||"No details",hint:Rt.hint,code:Rt.code,userId:at,sentPayload:Dr}),o.error("Erreur technique lors de la sauvegarde.")}}catch(at){console.error("Global Error:",at),T("Erreur : "+at.message),window.scrollTo(0,0)}};return t.jsxs("div",{style:{minHeight:"100vh",background:"var(--bg-deep)",padding:"40px 20px",display:"flex",flexDirection:"column",alignItems:"center"},children:[t.jsxs("div",{className:"glass-panel animate-fade-in",style:{maxWidth:"600px",width:"100%",padding:"40px",borderRadius:"var(--radius-lg)"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"10px"},children:[t.jsx("h1",{style:{marginBottom:0,fontSize:"2rem",fontFamily:"Outfit"},children:R?"Modifier mon profil":"Finalisez votre profil"}),R&&t.jsx("button",{onClick:Y,style:{fontSize:"0.8rem",background:"rgba(255,255,255,0.1)",border:"none",color:"var(--text-muted)",padding:"5px 10px",borderRadius:"5px",cursor:"pointer"},children:"Me déconnecter / Recommencer"})]}),t.jsx("p",{style:{textAlign:"center",color:"var(--text-muted)",marginBottom:"30px"},children:R?"Mettez à jour vos informations.":"Dites-nous en plus pour trouver votre compatibilité parfaite."}),(i==null?void 0:i.restriction_status)==="restricted"&&t.jsxs("div",{className:"animate-pulse",style:{background:"rgba(255, 77, 77, 0.15)",border:"2px solid #ff4d4d",borderRadius:"15px",padding:"20px",marginBottom:"30px",textAlign:"center"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",color:"#ff4d4d",fontSize:"1.2rem",fontWeight:"bold",marginBottom:"10px"},children:[t.jsx(ap,{size:32})," COMPTE RESTREINT"]}),t.jsxs("p",{style:{color:"#ffcccc",marginBottom:"20px"},children:["Votre compte a été restreint pour le motif suivant :",t.jsx("br",{}),t.jsxs("strong",{children:['"',(i==null?void 0:i.restriction_reason)||"Non précisé",'"']})]}),t.jsx("p",{style:{color:"var(--text-muted)",marginBottom:"20px",fontSize:"0.9rem"},children:"Veuillez modifier votre profil pour respecter nos règles. Une fois corrigé, cliquez ci-dessous."}),t.jsxs("button",{type:"button",onClick:ce,className:"btn-primary",style:{background:"#ff4d4d",border:"none",width:"100%",display:"flex",justifyContent:"center",gap:"10px"},children:[t.jsx(ap,{size:18})," J'ai corrigé mon profil, demander la validation"]})]}),(i==null?void 0:i.restriction_status)==="pending_review"&&t.jsxs("div",{style:{background:"rgba(51, 153, 255, 0.15)",border:"2px solid #3399ff",borderRadius:"15px",padding:"20px",marginBottom:"30px",textAlign:"center"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",color:"#3399ff",fontSize:"1.2rem",fontWeight:"bold",marginBottom:"10px"},children:[t.jsx(nr,{size:32})," EN ATTENTE DE VALIDATION"]}),t.jsxs("p",{style:{color:"#cce5ff"},children:["Votre demande est en cours d'examen par nos modérateurs.",t.jsx("br",{}),"Vous serez notifié dès que votre compte sera réactivé."]})]}),j&&t.jsxs("div",{style:{background:"rgba(255, 77, 77, 0.1)",border:"1px solid #ff4d4d",color:"#ff4d4d",padding:"15px",borderRadius:"10px",marginBottom:"20px",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(_n,{size:20}),t.jsx("span",{children:j})]}),t.jsxs("form",{onSubmit:ve,autoComplete:"off",style:{display:"flex",flexDirection:"column",gap:"20px"},children:[t.jsxs("div",{className:"glass-panel",style:{padding:p?"18px":"28px",borderRadius:"20px",marginBottom:"20px",border:"1px solid rgba(255,215,0,0.15)",background:"rgba(255,255,255,0.02)"},children:[t.jsxs("h2",{style:{fontSize:"1.3rem",fontWeight:"800",marginBottom:"6px",fontFamily:"Outfit",textAlign:"center",color:l?"#ff4d4d":d?"#26A69A":"#c9a0ff"},children:[l?"ð¥":d?"ð¥":"ð"," ",R?`Photo pour MEET${l?"Erox":d?"Friend":"Eros"}`:"ð¸ Ma Photo de Profil"]}),t.jsx("p",{style:{color:"rgba(255,255,255,0.5)",fontSize:"0.82rem",textAlign:"center",margin:"0 0 20px"},children:R?t.jsxs("span",{children:["Modifiez votre photo pour l'espace ",t.jsx("strong",{style:{color:l?"#ff4d4d":d?"#26A69A":"#c9a0ff"},children:l?"Erox":d?"Friend":"Eros"}),". Visible uniquement dans cet espace."]}):"Votre photo est la première chose que les autres voient. Soignez-la !"}),t.jsxs("div",{style:{display:"flex",gap:"20px",flexDirection:p?"column":"row",alignItems:p?"center":"flex-start"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"12px",flexShrink:0},children:[t.jsxs("div",{style:{position:"relative"},children:[i!=null&&i.animated_photo_url&&!h?t.jsx("video",{src:i.animated_photo_url,autoPlay:!0,loop:!0,muted:!0,playsInl
940ine:!0,style:{width:"160px",height:"160px",borderRadius:"20px",objectFit:"cover",border:"3px solid #8b5cf6",boxShadow:"0 8px 30px rgba(139,92,246,0.3)",filter:u.is_discreet?"blur(5px)":"none",transition:"filter 0.3s"}}):t.jsx("img",{src:h||ke||"",alt:"Photo de profil",style:{width:"160px",height:"160px",borderRadius:"20px",objectFit:"cover",border:"3px solid #c9a0ff",boxShadow:"0 8px 30px rgba(0,0,0,0.4)",filter:u.is_discreet?"blur(5px)":"none",transition:"filter 0.3s"}}),!h&&!ke&&!(i!=null&&i.animated_photo_url)&&t.jsx("div",{style:{position:"absolute",inset:0,borderRadius:"20px",display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.5)"},children:t.jsx(pi,{size:40,color:"var(--primary)"})}),(i==null?void 0:i.animated_photo_url)&&!h&&t.jsx("div",{style:{position:"absolute",top:"-6px",right:"-6px",background:"linear-gradient(135deg, #8b5cf6, #ec4899)",borderRadius:"10px",padding:"3px 8px",fontSize:"0.6rem",fontWeight:700,color:"white",boxShadow:"0 2px 8px rgba(139,92,246,0.4)"},children:"⨠ANIMÃE"})]}),(i==null?void 0:i.animated_photo_url)&&!h&&ke&&t.jsx("div",{style:{width:"48px",height:"48px",borderRadius:"50%",overflow:"hidden",border:"2px solid #c9a0ff",opacity:.7},children:t.jsx("img",{src:ke,alt:"Photo statique",style:{width:"100%",height:"100%",objectFit:"cover"}})})]}),t.jsxs("div",{style:{flex:1,width:p?"100%":"auto",display:"flex",flexDirection:"column",gap:"8px"},children:[t.jsxs("div",{onClick:()=>ee(B==="change"?null:"change"),style:{background:B==="change"?"rgba(255,255,255,0.12)":"rgba(255,255,255,0.07)",border:B==="change"?"1px solid rgba(255,255,255,0.3)":"1px solid rgba(255,255,255,0.12)",borderRadius:"14px",padding:"12px 16px",cursor:"pointer",transition:"all 0.2s"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(pi,{size:18,color:"#60a5fa"}),t.jsx("span",{style:{fontWeight:"700",fontSize:"0.92rem",color:"white"},children:"Changer ma photo"})]}),B==="change"&&t.jsxs("div",{style:{marginTop:"10px"},onClick:pe=>pe.stopPropagation(),children:[t.jsx("p",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",margin:"0 0 10px"},children:"Téléchargez une nouvelle photo depuis votre galerie. Choisissez un portrait net et bien éclairé."}),t.jsxs("label",{htmlFor:"photo-upload-pc",style:{display:"inline-flex",alignItems:"center",gap:"8px",background:"rgba(96,165,250,0.2)",border:"1px solid rgba(96,165,250,0.4)",color:"white",padding:"10px 20px",borderRadius:"25px",cursor:"pointer",fontSize:"0.88rem",fontWeight:"600"},children:[t.jsx(Sp,{size:16})," Choisir une photo"]}),t.jsx("input",{id:"photo-upload-pc",type:"file",accept:"image/*",onChange:re,style:{display:"none"}})]})]}),t.jsxs("div",{onClick:()=>{(h||ke)&&ee(B==="studio"?null:"studio")},style:{background:B==="studio"?"rgba(124,77,255,0.12)":"rgba(255,255,255,0.07)",border:B==="studio"?"1px solid rgba(124,77,255,0.3)":"1px solid rgba(255,255,255,0.12)",borderRadius:"14px",padding:"12px 16px",cursor:h||ke?"pointer":"not-allowed",opacity:h||ke?1:.4,transition:"all 0.2s"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(sp,{size:18,color:"#a78bfa"}),t.jsx("span",{style:{fontWeight:"700",fontSize:"0.92rem",color:"white"},children:"Studio Photo"}),t.jsx("span",{style:{fontSize:"0.65rem",background:"rgba(124,77,255,0.2)",color:"#a78bfa",padding:"2px 8px",borderRadius:"8px",fontWeight:"600"},children:"GRATUIT"})]}),B==="studio"&&t.jsxs("div",{style:{marginTop:"10px"},onClick:pe=>pe.stopPropagation(),children:[t.jsx("p",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",margin:"0 0 10px"},children:"Retouchez votre photo avec des filtres, du cadrage et des ajustements de luminosité pour un rendu professionnel."}),t.jsxs("button",{type:"button",onClick:pe=>{pe.stopPropagation(),Ce(!0),F(-1)},style:{background:"rgba(124,77,255,0.2)",border:"1px solid rgba(124,77,255,0.4)",color:"white",padding:"10px 20px",borderRadius:"25px",cursor:"pointer",fontSize:"0.88rem",fontWeight:"600",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(sp,{size:16})," Ouvrir le Studio"]})]})]}),R&&t.jsxs("div",{onClick:()=>{(h||ke)&&ee(B==="animate"?null:"animate")},style:{background:B==="animate"?"rgba(139,92,246,0.12)":"rgba(255,255,255,0.07)",border:B==="animate"?"1px solid rgba(139,92,246,0.3)":"1px solid rgba(255,255,255,0.12)",borderRadius:"14px",padding:"12px 16px",cursor:h||ke?"pointer":"not-allowed",opacity:h||ke?1:.4,transition:"all 0.2s"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(Xt,{size:18,color:"#c084fc"}),t.jsx("span",{style:{fontWeight:"700",fontSize:"0.92rem",color:"white"},children:"Animer avec l'IA"}),t.jsxs("span",{style:{fontSize:"0.65rem",background:"linear-gradient(135deg, rgba(139,92,246,0.3), rgba(236,72,153,0.3))",color:"#e879f9",padding:"2px 8px",borderRadius:"8px",fontWeight:"700"},children:["8 ",t.jsx(Jt,{size:12})]})]}),B==="animate"&&t.jsxs("div",{style:{marginTop:"10px"},onClick:pe=>pe.stopPropagation(),children:[t.jsxs("p",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",margin:"0 0 10px"},children:["L'intelligence artificielle anime votre photo statique en une courte vidéo vivante. Votre profil attire ",t.jsx("strong",{style:{color:"#c084fc"},children:"3x plus d'attention"})," avec une photo animée !"]}),t.jsxs("button",{type:"button",onClick:pe=>{pe.stopPropagation(),$(!0)},style:{background:"linear-gradient(135deg, rgba(139,92,246,0.3), rgba(236,72,153,0.3))",border:"1px solid rgba(139,92,246,0.4)",color:"white",padding:"10px 20px",borderRadius:"25px",cursor:"pointer",fontSize:"0.88rem",fontWeight:"600",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(Xt,{size:16})," ",i!=null&&i.animated_photo_url?"Gérer l'animation":"Animer ma photo"]})]})]}),t.jsxs("div",{onClick:()=>ee(B==="video"?null:"video"),style:{background:B==="video"?"rgba(236,72,153,0.1)":"rgba(255,255,255,0.03)",border:B==="video"?"1px solid rgba(236,72,153,0.3)":"1px solid rgba(255,255,255,0.06)",borderRadius:"14px",padding:"12px 16px",cursor:"pointer",transition:"all 0.2s"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(ia,{size:18,color:"#f472b6"}),t.jsx("span",{style:{fontWeight:"700",fontSize:"0.92rem",color:"white"},children:"Video Selfie"}),t.jsx("span",{style:{fontSize:"0.65rem",background:"rgba(236,72,153,0.2)",color:"#f472b6",padding:"2px 8px",borderRadius:"8px",fontWeight:"600"},children:"GRATUIT"})]}),B==="video"&&t.jsxs("div",{style:{marginTop:"10px"},onClick:pe=>pe.stopPropagation(),children:[t.jsxs("p",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",margin:"0 0 10px"},children:["Prenez un selfie vidéo de ",t.jsx("strong",{style:{color:"#f472b6"},children:"3 secondes"})," directement avec votre caméra. Plus authentique qu'une simple photo, c'est le format le plus engageant !"]}),t.jsxs("button",{type:"button",onClick:pe=>{pe.stopPropagation(),K(!0)},style:{background:"rgba(236,72,153,0.2)",border:"1px solid rgba(236,72,153,0.4)",color:"white",padding:"10px 20px",borderRadius:"25px",cursor:"pointer",fontSize:"0.88rem",fontWeight:"600",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(ia,{size:16})," Lancer la caméra"]})]})]})]})]}),t.jsxs("div",{style:{marginTop:"18px",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",padding:"10px 16px",borderRadius:"12px",background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.06)"},children:[t.jsx("input",{type:"checkbox",id:"discreet-mode",name:"is_discreet",checked:u.is_discreet,onChange:pe=>g($e=>({...$e,is_discreet:pe.target.checked})),style:{width:"18px",height:"18px",cursor:"pointer",accentColor:"var(--primary)"}}),t.jsxs("label",{htmlFor:"discreet-mode",style:{cursor:"pointer",fontSize:"0.9rem",color:u.is_discreet?"white":"var(--text-muted)",display:"flex",alignItems:"center",gap:"5px"},children:[u.is_discreet?t.jsx(al,{size:16}):t.jsx(rr,{size:16}),"Mode Discret (Flouter ma photo)"]})]})]}),t.jsxs("div",{style:{padding:"20px",background:"rgba(255,215,0,0.05)",borderRadius:"12px",border:"1px solid rgba(255,215,0,0.2)",position:"relative",overflow:"hidden",marginBottom:"20px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"15px"},children:[t.jsx(nr,{size:20,className:"text-gold"}),t.jsxs("h3",{style:{fontSize:"1.1rem",margin:0,color:"var(--gold)"},children:["Galerie Photo ",rt?"(Premium 5 Photos)":"(Gratuit 3 Photos)"]})]}),t.jsx("p",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.7)",marginBottom:"15px"},children:rt?"Ajoutez jusqu'à 5 photos pour montrer votre univers.":"Ajoutez jusqu'à 3 photos. Passez Premium pour en avoir 5 !"}
940),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"15px"},children:[y.map((pe,$e)=>t.jsxs("div",{style:{width:"90px",display:"flex",flexDirection:"column",gap:"8px"},children:[t.jsx("div",{style:{width:"90px",height:"90px",borderRadius:"10px",overflow:"hidden",position:"relative",border:"1px solid rgba(255,255,255,0.1)"},children:t.jsx("img",{src:pe,alt:`Galerie ${$e}`,style:{width:"100%",height:"100%",objectFit:"cover"}})}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"0 2px"},children:[t.jsx("button",{type:"button",onClick:()=>He($e),title:"Retoucher",style:{background:"rgba(255,255,255,0.1)",border:"none",color:"white",borderRadius:"6px",width:"26px",height:"26px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:t.jsx(Vo,{size:14})}),t.jsx("button",{type:"button",onClick:()=>nt($e),title:"Remplacer",style:{background:"rgba(255,255,255,0.1)",border:"none",color:"white",borderRadius:"6px",width:"26px",height:"26px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:t.jsx(kn,{size:14})}),t.jsx("button",{type:"button",onClick:()=>z($e),title:"Supprimer",style:{background:"rgba(255, 77, 77, 0.2)",border:"none",color:"#ff4d4d",borderRadius:"6px",width:"26px",height:"26px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:t.jsx(rn,{size:14})})]})]},$e)),y.length<(rt?5:3)&&t.jsxs("label",{style:{width:"80px",height:"80px",borderRadius:"10px",border:"1px dashed rgba(255,255,255,0.3)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",background:"rgba(0,0,0,0.2)"},children:[t.jsx("span",{style:{fontSize:"1.5rem",color:"rgba(255,255,255,0.5)"},children:"+"}),t.jsx("input",{type:"file",accept:"image/*",onChange:Ie,style:{display:"none"}})]}),!rt&&y.length>=3&&y.length<5&&t.jsx("div",{style:{width:"80px",height:"80px",borderRadius:"10px",border:"1px solid rgba(255,255,255,0.1)",display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.2)",opacity:.5},children:t.jsx(Fr,{size:20,color:"var(--text-muted)"})})]}),!rt&&y.length>=3&&t.jsx("div",{style:{marginTop:"15px"},children:t.jsx("button",{type:"button",onClick:()=>e("/subscription"),style:{fontSize:"0.8rem",padding:"5px 10px",background:"var(--gradient-gold)",color:"black",border:"none",borderRadius:"5px",cursor:"pointer"},children:"Débloquer +2 Photos (Premium)"})})]}),R&&t.jsxs("div",{style:{marginBottom:"20px",padding:"16px 18px",borderRadius:"16px",background:`linear-gradient(135deg, rgba(255,255,255,0.03), ${ue}08)`,border:`1px solid ${ue}25`},children:[t.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px",fontSize:"0.92rem",fontWeight:"700",color:"white"},children:[l?"ð¥":d?"ð¥":"ð"," Pseudo pour MEET",xe]}),t.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center"},children:[t.jsx("input",{type:"text",value:N,onChange:pe=>Z(pe.target.value),placeholder:(i==null?void 0:i.name)||`Ex: Mon pseudo ${xe}...`,maxLength:30,style:{flex:1,padding:"12px 16px",borderRadius:"12px",background:"rgba(255,255,255,0.06)",border:`1.5px solid ${ue}40`,color:"white",fontSize:"0.95rem",fontFamily:"Outfit",outline:"none",transition:"border-color 0.2s"},onFocus:pe=>pe.target.style.borderColor=ue,onBlur:pe=>pe.target.style.borderColor=`${ue}40`}),t.jsxs("span",{style:{color:"rgba(255,255,255,0.3)",fontSize:"0.7rem",flexShrink:0},children:[N.length,"/30"]}),N.trim()&&N!==ae&&t.jsx("button",{type:"button",onClick:async()=>{if(!(!(r!=null&&r.id)||he)){Ae(!0);try{const{error:pe}=await D.from("profiles").update({[ze]:N.trim()}).eq("id",r.id);pe?o.error("Erreur: "+pe.message):(o.success(`Pseudo ${xe} sauvegardé !`),X(N.trim()),n&&await n())}catch{o.error("Erreur réseau")}finally{Ae(!1)}}},disabled:he,style:{background:ue,color:"white",border:"none",borderRadius:"10px",padding:"10px 16px",cursor:"pointer",fontWeight:"700",fontSize:"0.85rem",flexShrink:0,opacity:he?.6:1,transition:"opacity 0.2s"},children:he?"...":"Valider"})]}),t.jsxs("p",{style:{color:"rgba(255,255,255,0.45)",fontSize:"0.75rem",margin:"8px 0 0",lineHeight:1.5},children:["ð¡ Ce pseudo sera affiché ",t.jsxs("strong",{style:{color:ue},children:["uniquement dans l'espace ",xe]}),". Si vous ne le modifiez pas, votre prénom sera utilisé par défaut."]})]}),R&&t.jsxs("div",{style:{padding:"16px 20px",borderRadius:"16px",marginBottom:"14px",background:"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.06)",opacity:.65},children:[t.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"8px",fontSize:"0.82rem",fontWeight:"600",color:"rgba(255,255,255,0.5)"}
940,children:"ð Informations communes aux 3 espaces"}),t.jsx("p",{style:{margin:0,fontSize:"0.7rem",color:"rgba(255,255,255,0.3)",lineHeight:1.4},children:"Les champs ci-dessous (prénom, ville, âge, genre) sont partagés entre Eros, Erox et Friend. Pour un pseudo propre à cet espace, utilisez le champ Pseudo ci-dessus."})]}),t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"20px",opacity:R?.55:1,transition:"opacity 0.3s"},children:[t.jsxs("div",{className:"input-group",children:[t.jsxs("label",{style:{display:"block",marginBottom:"8px",fontSize:"0.9rem",color:"var(--text-muted)"},children:["Prénom * ",R&&t.jsx("span",{style:{fontSize:"0.65rem",color:"rgba(255,255,255,0.3)"},children:"(commun)"})]}),t.jsxs("div",{style:{position:"relative"},children:[t.jsx(Ur,{size:18,style:{position:"absolute",left:"15px",top:"50%",transform:"translateY(-50%)",color:"rgba(255,255,255,0.5)"}}),t.jsx("input",{type:"text",name:"name",value:u.name,onChange:ft,style:{width:"100%",padding:"12px 12px 12px 45px",borderRadius:"var(--radius-sm)",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.2)",color:"white"},placeholder:"Prénom"})]})]}),t.jsxs("div",{className:"input-group",children:[t.jsxs("label",{style:{display:"block",marginBottom:"8px",fontSize:"0.9rem",color:"var(--text-muted)"},children:["Ville * ",R&&t.jsx("span",{style:{fontSize:"0.65rem",color:"rgba(255,255,255,0.3)"},children:"(commun)"})]}),t.jsxs("div",{style:{position:"relative"},children:[t.jsx(ur,{size:18,style:{position:"absolute",left:"15px",top:"50%",transform:"translateY(-50%)",color:"rgba(255,255,255,0.5)"}}),t.jsx("input",{type:"text",name:"city",value:u.city,onChange:ft,style:{width:"100%",padding:"12px 12px 12px 45px",borderRadius:"var(--radius-sm)",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.2)",color:"white"},placeholder:"Paris"})]})]})]}),t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"20px",opacity:R?.55:1,transition:"opacity 0.3s"},children:[t.jsxs("div",{className:"input-group",children:[t.jsxs("label",{style:{display:"block",marginBottom:"8px",fontSize:"0.9rem",color:"var(--text-muted)"},children:["Date de naissance ",R&&t.jsx("span",{style:{fontSize:"0.65rem",color:"rgba(255,255,255,0.3)"},children:"(commun)"})]}),t.jsxs("div",{style:{position:"relative"},children:[t.jsx(cr,{size:18,style:{position:"absolute",left:"15px",top:"50%",transform:"translateY(-50%)",color:"rgba(255,255,255,0.5)"}}),t.jsx("input",{type:"date",name:"birthdate",value:u.birthdate,onChange:ft,style:{width:"100%",padding:"12px 12px 12px 45px",borderRadius:"var(--radius-sm)",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.2)",color:"white",colorScheme:"dark"}})]})]}),t.jsxs("div",{className:"input-group",children:[t.jsxs("label",{style:{display:"block",marginBottom:"8px",fontSize:"0.9rem",color:"var(--text-muted)"},children:["Genre * ",R&&t.jsx("span",{style:{fontSize:"0.65rem",color:"rgba(255,255,255,0.3)"},children:"(commun)"})]}),t.jsxs("select",{name:"gender",value:u.gender,onChange:ft,style:{width:"100%",padding:"12px",borderRadius:"var(--radius-sm)",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.2)",color:"white"},children:[t.jsx("option",{value:"female",children:"Femme"}),t.jsx("option",{value:"male",children:"Homme"}),t.jsx("option",{value:"non-binary",children:"Non-binaire"})]})]})]}),t.jsxs("div",{className:"input-group",children:[t.jsx("label",{style:{display:"block",marginBottom:"8px",fontSize:"0.9rem",color:"var(--text-muted)"},children:"Téléphone"}),t.jsxs("div",{style:{position:"relative"},children:[t.jsx(c0,{size:18,style:{position:"absolute",left:"15px",top:"50%",transform:"translateY(-50%)",color:"rgba(255,255,255,0.5)"}}),t.jsx("input",{type:"tel",name:"phone",value:u.phone,onChange:ft,style:{width:"100%",padding:"12px 12px 12px 45px",borderRadius:"var(--radius-sm)",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.2)",color:"white"},placeholder:"06 12 34 56 78"})]})]}),!R&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"input-group",children:[t.jsx("label",{style:{display:"block",marginBottom:"8px",fontSize:"0.9rem",color:"var(--text-muted)"},children:"Email *"}),t.jsxs("div",{style:{position:"relative"},children:[t.jsx(Vr,{size:18,style:{position:"absolute",left:"15px",top:"50%",transform:"translateY(-50%)",color:"rgba(255,255,255,0.5)"}}),t.jsx("input",{type:"email",name:"email",value:u.email,onChange:ft,style:{width:"100%",padding:"12px 12px 12px 45px",borderRadius:"var(--radius-sm)",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.2)",color:"white"},placeholder:"[email protected]"})]})]}),t.jsxs("div",{className:"input-group",children:[t.jsx("label",{style:{display:"block",marginBottom:"8px",fontSize:"0.9rem",color:"var(--text-muted)"},children:"Mot de passe *"}),t.jsxs("div",{style:{position:"relative"},children:[t.jsx(Fr,{size:18,style:{position:"absolute",left:"15px",top:"50%",transform:"translateY(-50%)",color:"rgba(255,255,255,0.5)"}}),t.jsx("input",{type:ne?"text":"password",name:"password",value:u.password,onChange:ft,style:{width:"100%",padding:"12px 45px 12px 45px",borderRadius:"var(--radius-sm)",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.2)",color:"white"},placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢"}),t.jsx("button",{type:"button",onClick:()=>Re(!ne),style:{position:"absolute",right:"15px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",color:"rgba(255,255,255,0.5)",cursor:"pointer",padding:0},children:ne?t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),t.jsx("circle",{cx:"12",cy:"12",r:"3"})]}):t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),t.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]})})]})]})]}),t.jsxs("div",{style:{marginTop:"20px",borderTop:"1px solid rgba(255,255,255,0.1)",paddingTop:"20px"},children:[t.jsxs("h3",{style:{fontSize:"1.2rem",marginBottom:"15px",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(o5,{size:20,color:"var(--primary)"})," ",R?"Mettre à jour les questions (Optionnel)":"Questions pour briser la glace (Optionnel)",R&&t.jsx("span",{style:{fontSize:"0.6rem",color:"rgba(255,255,255,0.35)",fontWeight:"400"},children:"(commun)"})]}),S.map((pe,$e)=>t.jsxs("div",{style:{marginBottom:"15px"},children:[t.jsx("label",{style:{display:"block",marginBottom:"8px",fontSize:"0.9rem",color:"var(--text-muted)"},children:pe}),t.jsx("input",{type:"text",placeholder:"Votre réponse...",style:{width:"100%",padding:"12px",borderRadius:"var(--radius-sm)",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.2)",color:"white"},onChange:Xe=>De(pe,Xe.target.value)})]},$e))]}),t.jsxs("div",{className:"input-group",style:{opacity:R?.55:1,transition:"opacity 0.3s"},children:[t.jsxs("label",{style:{display:"block",marginBottom:"8px",fontSize:"0.9rem",color:"var(--text-muted)"},children:["Profession / Job ",R&&t.jsx("span",{style:{fontSize:"0.65rem",color:"rgba(255,255,255,0.3)"},children:"(commun)"})]}),t.jsxs("div",{style:{position:"relative"},children:[t.jsx(Qn,{size:18,style:{position:"absolute",left:"15px",top:"50%",transform:"translateY(-50%)",color:"rgba(255,255,255,0.5)"}}),t.jsx("input",{type:"text",name:"job",value:u.job,onChange:ft,style:{width:"100%",padding:"12px 12px 12px 45px",borderRadius:"var(--radius-sm)",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.2)",color:"white"},placeholder:"Ex: Architecte, Ãtudiant..."})]})]}),t.jsxs("div",{className:"input-group",style:{opacity:R?.55:1,transition:"opacity 0.3s"},children:[t.jsxs("label",{style:{display:"block",marginBottom:"8px",fontSize:"0.9rem",color:"var(--text-muted)"},children:["Bio / Description ",R&&t.jsx("span",{style:{fontSize:"0.65rem",color:"rgba(255,255,255,0.3)"},children:"(commun)"})]}),t.jsx("textarea",{name:"bio",value:u.bio,onChange:ft,rows:4,style:{width:"100%",padding:"12px",borderRadius:"var(--radius-sm)",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.2)",color:"white",resize:"none"},placeholder:"Dites-en un peu plus sur vous..."})]}),R&&t.jsxs("div",{style:{padding:"20px",borderRadius:"12px",textAlign:"center",background:`linear-gradient(135deg, rgba(255,255,255,0.05), ${l?"rgba(255,77,77,0.08)":d?"rgba(38,166,
940154,0.08)":"rgba(255,215,0,0.08)"})`,border:`1px solid ${l?"rgba(255,77,77,0.2)":d?"rgba(38,166,154,0.2)":"rgba(255,215,0,0.2)"}`},children:[t.jsxs("h3",{style:{fontSize:"1.1rem",marginBottom:"6px",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",color:l?"#ff4d4d":d?"#26A69A":"#c9a0ff"},children:[t.jsx(Qn,{size:20})," Pictogrammes ",l?"Erox":d?"Friend":"Eros"]}),t.jsxs("p",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.5)",marginBottom:"4px"},children:["Modifiez vos passions et préférences pour l'espace ",t.jsx("strong",{style:{color:l?"#ff4d4d":d?"#26A69A":"#c9a0ff"},children:l?"Erox":d?"Friend":"Eros"}),"."]}),t.jsx("p",{style:{fontSize:"0.7rem",color:l?"#ff4d4d":d?"#26A69A":"#c9a0ff",marginBottom:"15px",fontWeight:"600"},children:"⨠Propre à cet espace uniquement"}),t.jsxs("button",{type:"button",onClick:()=>e("/edit-criteria"),style:{padding:"10px 20px",borderRadius:"30px",border:"1px solid var(--primary)",background:"rgba(124, 77, 255, 0.1)",color:"var(--primary)",cursor:"pointer",fontWeight:"bold",display:"flex",alignItems:"center",gap:"8px",margin:"0 auto"},children:[t.jsx(Qn,{size:16})," Modifier mes Pictos"]})]}),t.jsx("button",{type:"submit",className:"btn-primary",style:{marginTop:"20px",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px"},children:R?t.jsxs(t.Fragment,{children:["Enregistrer ",t.jsx(_p,{size:20})]}):t.jsxs(t.Fragment,{children:["Créer mon compte ",t.jsx(Pr,{size:20})]})}),P&&t.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.9)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsxs("div",{style:{background:"#330000",border:"2px solid red",padding:"30px",maxWidth:"600px",width:"90%",borderRadius:"10px",color:"white",overflow:"auto",maxHeight:"90vh"},children:[t.jsx("h2",{style:{color:"red",marginTop:0},children:"ERREUR TECHNIQUE"}),t.jsx("p",{children:"Une erreur empêche la sauvegarde. Merci de faire une capture d'écran de ceci :"}),t.jsx("pre",{style:{background:"black",padding:"15px",overflow:"auto",border:"1px solid #555"},children:JSON.stringify(P,null,2)}),t.jsx("button",{type:"button",onClick:()=>I(null),style:{marginTop:"20px",padding:"10px 20px",cursor:"pointer",background:"white",color:"black",border:"none",borderRadius:"5px"},children:"Fermer"})]})}),t.jsx("input",{type:"file",ref:Fe,onChange:J,accept:"image/*",style:{display:"none"}})]})]}),Q&&t.jsx("div",{style:{position:"fixed",inset:0,zIndex:1e3,background:"rgba(0,0,0,0.6)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},children:t.jsxs("div",{className:"glass-panel animate-fade-in",style:{maxWidth:"450px",width:"100%",padding:"40px",borderRadius:"var(--radius-lg)",textAlign:"center",border:"1px solid rgba(124, 77, 255, 0.3)",boxShadow:"0 0 50px rgba(124, 77, 255, 0.2)"},children:[t.jsx("div",{style:{width:"80px",height:"80px",borderRadius:"50%",background:"var(--gradient-primary)",margin:"0 auto 20px",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 10px 20px rgba(124, 77, 255, 0.3)"},children:t.jsx(Vr,{size:40,color:"white"})}),t.jsxs("h2",{style:{fontSize:"1.8rem",fontFamily:"Outfit",marginBottom:"10px",color:"white"},children:["Bienvenue ",u.name," ! ð"]}),t.jsxs("p",{style:{fontSize:"1.1rem",color:"var(--text-muted)",marginBottom:"30px",lineHeight:"1.6"},children:["Votre compte a été créé avec succès.",t.jsx("br",{}),"Pour activer votre accès, ",t.jsx("strong",{children:"cliquez sur le lien"})," que nous venons de vous envoyer par email."]}),t.jsxs("button",{onClick:()=>{G(!1),e("/login")},className:"btn-primary",style:{width:"100%",maxWidth:"250px",margin:"0 auto",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:["J'ai compris ",t.jsx(Pr,{size:18})]})]})}),Pe&&t.jsx(h0,{imageSrc:le===-1?h||ke:y[le],onClose:()=>Ce(!1),onSave:be}),E&&t.jsx(d5,{currentPhoto:h||ke,currentAnimatedUrl:l?i==null?void 0:i.erox_animated_photo_url:d?i==null?void 0:i.friend_animated_photo_url:i==null?void 0:i.animated_photo_url,animatedColumn:l?"erox_animated_photo_url":d?"friend_animated_photo_url":"animated_photo_url",onClose:()=>$(!1),onSuccess:pe=>{$(!1)}}),te&&t.jsx(c5,{onClose:()=>K(!1),onSuccess:pe=>{K(!1),o.success("ð¥ Video selfie enregistrée !")}})]})},u7=()=>{const e=Lt(),[r,i]=m.useState(null);return m.useEffect(()=>{const n=localStorage.getItem("userProfile");n?i(JSON.parse(n)):e("/")},[e]),r?t.jsxs("div",{style:{minHeight:"100vh",background:"var(--bg-deep)",padding:"20px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[t.jsxs("div",{className:"glass-panel animate-fade-in",style:{maxWidth:"500px",width:"100%",padding:"40px",borderRadius:"var(--radius-lg)",textAlign:"center"},children:[t.jsx("div",{style:{width:"80px",height:"80px",borderRadius:"50%",background:"rgba(124, 77, 255, 0.2)",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 20px auto",color:"var(--primary)"},children:t.jsx(Vr,{size:40})}),t.jsx("h1",{style:{marginBottom:"15px",fontSize:"1.8rem",fontFamily:"Outfit"},children:"Vérifiez vos emails"}),t.jsxs("p",{style:{color:"var(--text-muted)",lineHeight:"1.6",marginBottom:"30px"},children:["Un lien de confirmation a été envoyé à ",t.jsx("strong",{children:r.email}),".",t.jsx("br",{}),"Cliquez sur le lien pour activer votre compte et découvrir vos âmes soeurs."]})]}),t.jsx("p",{style:{marginTop:"20px",color:"var(--text-muted)",fontSize:"0.9rem",cursor:"pointer"},children:"Renvoyer l'email"})]}):null},h7=()=>{const e=Lt(),[r,i]=m.useState(1),[n,o]=m.useState(null),a=()=>{const d={...JSON.parse(localStorage.getItem("userProfile")||"{}"),notificationMethod:n||"email"};localStorage.setItem("userProfile",JSON.stringify(d)),e("/matches")};return t.jsx("div",{style:{minHeight:"100vh",background:"var(--bg-deep)",padding:"20px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:t.jsxs("div",{className:"glass-panel animate-fade-in",style:{maxWidth:"600px",width:"100%",padding:"40px",borderRadius:"var(--radius-lg)",position:"relative"},children:[r===1&&t.jsxs("div",{className:"animate-fade-in",children:[t.jsx("div",{style:{display:"flex",justifyContent:"center",marginBottom:"20px"},children:t.jsx("div",{style:{width:"60px",height:"60px",borderRadius:"50%",background:"var(--gradient-gold)",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 0 20px rgba(255, 215, 0, 0.3)"},children:t.jsx(Xt,{size:30,color:"white"})})}),t.jsx("h1",{style:{textAlign:"center",marginBottom:"20px",fontSize:"1.8rem",fontFamily:"Outfit"},children:"Pas de place pour le hasard."}),t.jsx("p",{style:{color:"var(--text-main)",fontSize:"1.1rem",lineHeight:"1.6",marginBottom:"15px"},children:"Je suis exigeant. Très exigeant."}),t.jsxs("p",{style:{color:"var(--text-muted)",lineHeight:"1.6",marginBottom:"30px"},children:['Je ne vais pas inonder votre écran de profils "moyens". Mon algorithme ne vous présentera ',t.jsx("strong",{children:"QUE"}
940)," les personnes avec qui vous avez une compatibilité psychologique supérieure à ",t.jsx("strong",{style:{color:"var(--primary)"},children:"80%"}),"."]}),t.jsx("div",{style:{background:"rgba(255,255,255,0.05)",padding:"15px",borderRadius:"var(--radius-md)",marginBottom:"30px",borderLeft:"3px solid var(--primary)"},children:t.jsx("p",{style:{fontStyle:"italic",fontSize:"0.9rem",color:"var(--text-muted)",margin:0},children:`"Mieux vaut être seul que mal accompagné. Mais mieux vaut être deux quand c'est une évidence." â Eros`})}),t.jsxs("button",{onClick:()=>i(2),className:"btn-primary",style:{width:"100%",display:"flex",justifyContent:"center",alignItems:"center",gap:"10px"},children:["Compris, épatez-moi ",t.jsx(Pr,{size:20})]})]}),r===2&&t.jsxs("div",{className:"animate-fade-in",children:[t.jsx("div",{style:{display:"flex",justifyContent:"center",marginBottom:"20px"},children:t.jsx("div",{style:{width:"60px",height:"60px",borderRadius:"50%",background:"rgba(124, 77, 255, 0.2)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--primary)"},children:t.jsx(e5,{size:30})})}),t.jsx("h1",{style:{textAlign:"center",marginBottom:"10px",fontSize:"1.8rem",fontFamily:"Outfit"},children:"Ne manquez pas l'étincelle."}),t.jsx("p",{style:{textAlign:"center",color:"var(--text-muted)",marginBottom:"30px"},children:"Quand je trouve cette perle rare, comment dois-je vous prévenir ?"}),t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"20px",marginBottom:"30px"},children:[t.jsxs("div",{onClick:()=>o("sms"),style:{padding:"20px",borderRadius:"var(--radius-md)",cursor:"pointer",border:`2px solid ${n==="sms"?"var(--primary)":"transparent"}`,background:n==="sms"?"rgba(124, 77, 255, 0.1)":"rgba(255,255,255,0.05)",transition:"all 0.3s",textAlign:"center"},children:[t.jsx(o5,{size:32,style:{marginBottom:"10px",color:n==="sms"?"var(--primary)":"var(--text-muted)"}}),t.jsx("h3",{style:{fontSize:"1rem",margin:"0 0 5px 0"},children:"Par SMS"}),t.jsx("p",{style:{fontSize:"0.8rem",color:"var(--text-muted)",margin:0},children:"Immédiat"})]}),t.jsxs("div",{onClick:()=>o("email"),style:{padding:"20px",borderRadius:"var(--radius-md)",cursor:"pointer",border:`2px solid ${n==="email"?"var(--primary)":"transparent"}`,background:n==="email"?"rgba(124, 77, 255, 0.1)":"rgba(255,255,255,0.05)",transition:"all 0.3s",textAlign:"center"},children:[t.jsx(Vr,{size:32,style:{marginBottom:"10px",color:n==="email"?"var(--primary)":"var(--text-muted)"}}),t.jsx("h3",{style:{fontSize:"1rem",margin:"0 0 5px 0"},children:"Par Email"}),t.jsx("p",{style:{fontSize:"0.8rem",color:"var(--text-muted)",margin:0},children:"Discret"})]})]}),t.jsxs("button",{onClick:a,disabled:!n,className:"btn-primary",style:{width:"100%",display:"flex",justifyContent:"center",alignItems:"center",gap:"10px",opacity:n?1:.5,cursor:n?"pointer":"not-allowed"},children:["Lancer la recherche ",t.jsx(Pr,{size:20})]})]})]})})},Mo=({photoUrl:e,animatedUrl:r,alt:i="Avatar",size:n=40,borderColor:o="var(--primary)",borderWidth:a=2,style:l={}})=>{const d=m.useRef(null),p={width:`${n}px`,height:`${n}px`,borderRadius:"50%",border:`${a}px solid ${o}`,overflow:"hidden",position:"relative",flexShrink:0,...l};return t.jsx("div",{style:p,children:r?t.jsxs(t.Fragment,{children:[t.jsx("video",{ref:d,src:r,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,style:{width:"100%",height:"100%",objectFit:"cover",position:"absolute",inset:0}}),t.jsx("div",{style:{position:"absolute",bottom:"-1px",right:"-1px",width:n>50?"16px":"12px",height:n>50?"16px":"12px",borderRadius:"50%",background:"linear-gradient(135deg, #8b5cf6, #ec4899)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:n>50?"8px":"6px",zIndex:2},children:"â¨"})]}):e?t.jsx("img",{src:e,alt:i,onError:u=>{u.target.onerror=null,u.target.style.display="none",u.target.nextSibling&&(u.target.nextSibling.style.display="flex")},style:{width:"100%",height:"100%",objectFit:"cover",position:"absolute",inset:0}}):t.jsx("div",{style:{width:"100%",height:"100%",position:"absolute",inset:0,background:"rgba(255,255,255,0.06)",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsxs("svg",{width:Math.round(n*.5),height:Math.round(n*.5),viewB
940ox:"0 0 24 24",fill:"none",stroke:`${o}90`,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),t.jsx("circle",{cx:"12",cy:"7",r:"4"})]})})})},_g={lat:48.8566,lng:2.3522},g7=(e,r)=>{if(!e||!r)return 1e3;const i=6371,n=(r.lat-e.lat)*(Math.PI/180),o=(r.lng-e.lng)*(Math.PI/180),a=Math.sin(n/2)*Math.sin(n/2)+Math.cos(e.lat*(Math.PI/180))*Math.cos(r.lat*(Math.PI/180))*Math.sin(o/2)*Math.sin(o/2),l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return i*l},hx=async(e=null,r="EROS")=>{var i;try{const n=r==="EROX"?"erox_tags":r==="FRIEND"?"friend_tags":"tags",{data:{session:o}}=await D.auth.getSession();let a=[],l=_g;if(e)a=e[n]||[],e.location&&(l=e.location);else if(o){const{data:b}=await D.from("profiles").select(Lf).eq("id",o.user.id).single();b&&(a=b[n]||[])}else{const b=localStorage.getItem("userProfile");b&&(a=JSON.parse(b)[n]||[])}const d=(e==null?void 0:e.id)||((i=o==null?void 0:o.user)==null?void 0:i.id);if(!d)return console.warn("Matching: Impossible d'identifier l'utilisateur courant pour l'exclusion."),[];const{data:p}=await D.from("blocked_users").select("blocked_id").eq("blocker_id",d),u=p?p.map(b=>b.blocked_id).filter(b=>b):[];let g=D.from("profiles").select(Lf).neq("id",d);u.length>0&&(g=g.not("id","in",`(${u.join(",")})`));const{data:h,error:x}=await g;x&&console.error("Erreur récupération profils:",x);const _={EROS:"EROS",EROX:"EROX",FRIEND:"FRIEND"}[r]||"EROS";let S=[];try{const{data:b}=await D.from("bot_assignments").select("bot_id").eq("user_id",d).eq("space",_).single();if(b){const{data:j}=await D.from("matches").select("id, name, photo_url, photos_eros, photos_erox, photos_friend, bio, age, location, tags, erox_tags, friend_tags, gender, compatibility_score, space, personality, is_ghost").eq("id",b.bot_id).single();j&&!j.is_ghost&&(S=[j])}}catch(b){console.warn("Bot assignment lookup fallback:",b);const{data:j}=await D.from("matches").select("id, name, photo_url, photos_eros, photos_erox, photos_friend, bio, age, location, tags, erox_tags, friend_tags, gender, compatibility_score, space, personality, is_ghost");S=(j||[]).filter(T=>(!T.space||T.space===_)&&!T.is_ghost)}return[...h||[],...S.map(b=>{var j,T,P;return{...b,is_bot:!0,avatar_url:((j=b.photos_eros)==null?void 0:j[0])||b.photo_url,erox_avatar_url:((T=b.photos_erox)==null?void 0:T[0])||b.photo_url,friend_avatar_url:((P=b.photos_friend)==null?void 0:P[0])||b.photo_url,city:"",location:typeof b.location=="string"?(()=>{try{return JSON.parse(b.location)}catch{return null}})():b.location}})].filter(b=>!(!b.name||!b.is_bot&&!(b.city&&b.city.trim().length>0||b.location&&b.location.lat&&b.location.lng&&b.location.lat!==48.8566)||r==="EROX"&&(b.erox_tags||[]).length===0||r==="FRIEND"&&(b.friend_tags||[]).length===0)).map(b=>{const j=b[n]||[];let T=b.age;if(!T&&b.birthdate){const ee=new Date(b.birthdate),te=new Date;T=te.getFullYear()-ee.getFullYear();const K=te.getMonth()-ee.getMonth();(K<0||K===0&&te.getDate()<ee.getDate())&&T--}T||(T=25);let P=j.filter(ee=>a.includes(ee)).length,I=a.length>0?Math.round(P/Math.max(j.length,5)*80):Math.floor(Math.random()*40)+40;I>80&&(I=80);let R=b.location;if(typeof R=="string")try{R=JSON.parse(R)}catch{}const O=g7(l,R||_g);let E=0;O<50?E=20:O<100&&(E=10);const $=I+E;let B="Compatibilité mystère...";return E>15?B="Vous êtes très proches géographiquement !":P>2&&(B="Vous avez des goûts très similaires."),{...b,age:T,location:R||_g,photo:(r==="EROX"?b.erox_avatar_url:null)||b.avatar_url||b.photo_url||b.photo,isLocked:b.is_locked_by_default,prompts:Array.isArray(b.prompts)?b.prompts:[],matchScore:$,matchingReason:B,dist_km:Math.round(O)}}).sort((b,j)=>j.matchScore-b.matchScore)}catch(n){return console.error("Erreur globale matching:",n),[]}},gx=async(e,r,i="EROS")=>{try{const{data:n}=await D.from("likes").select("id").eq("sender_id",e).eq("receiver_id",r).eq("mode",i);if(n&&n.length>0)return await D.from("likes").delete().eq("sender_id",e).eq("receiver_id",r).eq("mode",i),{status:"removed",isMatch:!1};{await D.from("likes").insert({sender_id:e,receiver_id:r,mode:i});const{data:o}=await D.from("likes").select("id").eq("sender_id",r).eq("receiver_id",e).eq("mode",i).single();return{status:"added",isMatch:!!o}}}catch(n){return console.error("Error toggling like:",n),{status:"error",isMatch:!1}}},f7=async(e,r="EROS")=>{try{const{data:i,error:n}=await D.from("likes").select("sender_id, mode, created_at").eq("receiver_id",e).order("created_at",{ascending:!1});if(n)throw n;if(!i||i.length===0)return[];const o={};for(const h of i)h.sender_id&&!o[h.sender_id]&&(o[h.sender_id]=h.mode||"EROS");const a=Object.keys(o);if(a.length===0)return[];const{data:l,error:d}=await D.from("profiles").select(Lf).in("id",a);if(d)throw d;const p=new Set((l||[]).map(h=>h.id)),u=a.filter(h=>!p.has(h));let g=[...l||[]];if(u.length>0)try{const{data:h}=await D.from("matches").select("id, name, photo_url, photos_eros, photos_erox, photos_friend, age, bio, tags, erox_tags, friend_tags, gender, city").in("id",u);h&&h.length>0&&g.push(...h.map(x=>{var y,_,S;return{...x,is_bot:!0,avatar_url:((y=x.photos_eros)==null?void 0:y[0])||x.photo_url,erox_avatar_url:((_=x.photos_erox)==null?void 0:_[0])||x.photo_url,friend_avatar_url:((S=x.photos_friend)==null?void 0:S[0])||x.photo_url}}))}catch(h){console.warn("getReceivedLikes: Bot lookup failed:",h)}return g.map(h=>({...h,like_mode:o[h.id]||"EROS"}))}catch(i){return console.warn("Error getting received likes (ignored):",i),[]}},RS=async(e,r="EROS")=>{try{const{data:i,error:n}=await D.from("likes").select("receiver_id, mode, created_at").eq("sender_id",e).order("created_at",{ascending:!1});if(n)throw n;if(!i)return[];const o={},a=[];for(const l of i)l.receiver_id&&!o[l.receiver_id]&&(o[l.receiver_id]=l.mode||"EROS",a.push(l.receiver_id));return a._givenLikeModes=o,a}catch(i){return console.warn("Error getting given likes (ignored):",i),[]}},x7=async(e,r,i="EROS")=>{if(!(!e||!r))try{const{error:n}=await D.from("passed_profiles").upsert({user_id:e,passed_user_id:r,mode:i},{onConflict:"user_id, passed_user_id, mode"});n&&console.error("Error saving pass:",n)}catch(n){console.error("Exception saving pass:",n)}},m7=async(e,r="EROS")=>{if(!e)return[];try{const{data:i,error:n}=await D.from("passed_profiles").select("passed_user_id").eq("user_id",e).eq("mode",r);if(n)throw n;return i?i.map(o=>o.passed_user_id):[]}catch(i){return console.warn("Error getting passed profiles:",i),[]}},y7=async(e,r,i="EROS")=>{if(!(!e||!r))try{const{error:n}=await D.from("passed_profiles").delete().eq("user_id",e).eq("passed_user_id",r);n&&console.error("Error removing pass:",n)}catch(n){console.error("Exception removing pass:",n)}},Ho={bienveillant:{label:"ð¤ Bienveillant",color:"#10b981",description:"Chaleureux, encourageant, toujours positif",greetings:["Coucou ! ð Je suis l'animateur de cet espace et je suis content de t'accueillir ! Je suis là pour toi, que ce soit pour discuter, te donner des conseils ou te guider dans tes rencontres. N'hésite surtout pas ! ð","Hey ! Bienvenue ⨠Je suis ton animateur perso sur cet espace ! Mon rôle c'est de t'écouter, te conseiller et rendre ton expérience la plus agréable possible. Raconte-moi, qu'est-ce que tu recherches ? ð¤","Salut ! ð¸ Enchanté ! Je suis l'animateur de cet espace et je suis à ton écoute. Mon job c'est de t'aider à t'y retrouver, te donner des tips et être de bon conseil. Alors, dis-moi tout
940! ð"],responses:{default:["C'est vraiment intéressant ce que tu dis ! ð Continue, je t'écoute...","J'adore discuter avec toi ! Tu as l'air d'être quelqu'un de super ð«","Merci de partager ça avec moi ! C'est génial de pouvoir échanger comme ça ð¤","Tu sais quoi ? Je pense que tu vas trouver ce que tu cherches ici, j'en suis sûr ! â¨","Ohhh c'est trop chou ce que tu dis ! ð¥°","J'aime bien ta façon de voir les choses ! ð"],question:["Super question ! ð¤ Hmmm, laisse-moi y réfléchir...","Bonne question ! Je dirais que le plus important c'est d'être toi-même ð","Ah, j'adore quand on me pose des questions ! ð"],short:["Dis-m'en plus ! J'suis curieux ð","Et après ? Continue ! ð¤","Intéressant ! Tu peux développer ? â¨"],compliment:["Ohhhh merci ! 𥺠Tu es adorable ! ð","C'est trop gentil ! Tu me fais rougir ð","Awww merci ! Toi aussi tu es incroyable ! â¨"]},tips:["ð¡ Petit conseil : Un profil avec une bio originale attire 3x plus de monde !","ð¡ Tu savais ? Les messages envoyés le soir ont 40% plus de chances d'avoir une réponse !","ð¡ Astuce : Pose une question ouverte dans ton premier message, ça marche à tous les coups !"]},coach:{label:"ðª Coach",color:"#f59e0b",description:"Motivant, donne des conseils, pousse à l'action",greetings:["Yo ! ðª Bienvenue ! Je suis l'animateur/trice coach de cet espace ! Mon rôle c'est de te pousser vers le haut, te donner des conseils concrets et t'aider à cartonner dans tes rencontres. Prêt(e) ? ð","Salut ! ð Moi c'est ton animateur/trice perso ici, et je suis surtout un(e) super coach ! Je suis à ton écoute et j'ai plein de bons conseils pour toi. Alors, dis-moi ce que tu cherches ! ðª","Hey ! Bienvenue sur cet espace ! ð Je suis animateur/trice et je suis là pour t'accompagner. Conseils, astuces, écoute... tu peux tout me demander, je suis de bon conseil ! ð¤"],responses:{default:["OK je vois ! ðª Voici ce que je te conseille : sois authentique et fonce !","C'est bien ça ! Continue sur cette lancée, t'es sur la bonne voie ð","Top ! Tu sais ce qui marche ? La confiance en soi. Et toi t'en as ! ð«","Allez, on lâche rien ! Chaque conversation est une opportunité ð","J'aime ton énergie ! Avec cette attitude, tu vas tout déchirer ðª"],question:["Excellente question ! Mon conseil : fais le premier pas, toujours ðª","Ah ça c'est la question à 1 million ! La clé c'est d'être toi-même ð¯","Bonne question ! Règle n°1 du dating : l'authenticité paie toujours ð"],short:["T'es timide ? ð Allez, développe un peu ! Je suis là pour t'aider !","Dis-m'en plus, je vais te donner un conseil de pro ! ðª","Allez, lâche-toi ! On est entre nous ð¤"],compliment:["Merci ! Mais c'est toi la star ici ! ð","Hey merci ! Mais concentre-toi sur tes matchs ððª","C'est gentil ! J'espère que tu dis la même chose à tes matchs ð"]},tips:["ð¯ Règle d'or : Ton premier message doit être unique. Oublie le 'Salut ça va' !","ð¯ Pro tip : Regarde les tags communs et parle de ce qui vous rapproche !","ð¯ Conseil Coach : Un compliment sincère + une question = la formule magique !"]},fun:{label:"ð Fun",color:"#ec4899",description:"Drôle, taquin, crée une ambiance légère",greetings:["Héhé, salut toi ! ð Bienvenue ! Moi c'est l'animateur/trice fun de l'espace ! Je suis là pour que tu passes un super moment, te donner des conseils avec le sourire et être à ton écoute. On va bien s'entendre ! ð","Ohhh un nouveau ! ð Trop cool ! Je suis l'animateur/trice de cet espace et mon job c'est de t'accueillir, t'écouter et te filer des tips géniaux. Bref, je suis ton allié(e) ici ! ð","Hey ! ð Bienvenue dans l'espace ! Moi c'est ton animateur/trice, toujours de bonne humeur et toujours de bon conseil ! Dis-moi ce que tu cherches, je suis tout(e) ouïe ! ð"],responses:{default:["Hahaha j'adore ! ð T'es drôle toi !","Ok ok, je vois le genre ð J'aime bien !","Mais c'est que t'es intéressant(e) en plus ! ð¤","Ahah pas mal ! Tu me fais marrer ð","Hmmm, je te donne un 8/10 pour cette réponse ð"],question:["Oula, une question existentielle ! ð¤ Attends je consulte mes tarots... ð","Ahah bonne question ! La réponse est... 42 ! Non je rigole ð","Hmm question piège ! Je dirais... ça dépend de ton signe astro ðð"],short:["C'est tout ?! ð± Allez, fais un effort ! ð","Wow, quelle éloquence ð J'attends la suite !","Hé, moi j'ai fait l'effort de te parler, à ton tour ! ð"],compliment:["Ohoh, du charme ? J'achète ! ðð","Hahaha flatteur/flatteuse ! J'aime ça ð","Stop, tu vas me faire disjoncter ! ð¤ð¥ð"]},tips:["ð Astuce Fun : Envoie un GIF ou un emoji décalé en premier message !","ð Fun fact : Les profils avec de l'humour dans la bio ont 60% plus de likes !","ð Truc de ouf : Propose un défi rigolo à ton match, ça crée du lien !"]},mysterieux:{label:"ð Mystérieux",color:"#8b5cf6",description:"Intrigant, poét
940ique, fait réfléchir",greetings:["Bonsoir... ⨠Je suis l'animateur/trice de cet espace, et quelque chose me dit qu'on va bien s'entendre. Je suis là pour t'écouter, te guider et te donner les meilleurs conseils. Dis-moi ce qui t'amène...","Tiens, tiens... ð Bienvenue ! Je suis l'animateur/trice ici, toujours à l'écoute et plein(e) de bons conseils. Parle-moi de toi, je suis curieux/curieuse de te connaître...","Les étoiles t'ont guidé(e) jusqu'ici... ð Et moi, en tant qu'animateur/trice, je serai ta boussole. Conseils, écoute, bienveillance... je suis là pour toi. Alors, que cherches-tu ?"],responses:{default:["Intéressant... ð Continue, tu m'intrigues...","Hmm, il y a quelque chose chez toi... je n'arrive pas à mettre le doigt dessus â¨","Tu sais, les meilleures connexions naissent de l'inattendu... ð","Il y a plus que ce que tu laisses paraître, je le sens... ð®","Les mots que tu choisis en disent long sur qui tu es vraiment... â¨"],question:["Question profonde... ð La réponse est peut-être en toi...","Hmm, excellente question. Mais la vraie question est : qu'est-ce que TOI tu en penses ? ð®","Tu poses les bonnes questions... C'est rare de nos jours â¨"],short:["Le silence en dit parfois plus que les mots... mais j'aimerais t'entendre ð","Mystérieux(se) toi aussi ? J'aime ça... ð","Quelques mots suffisent parfois... mais pas cette fois. Dis-m'en plus â¨"],compliment:["Tu es perspicace... ça me plaît ð","Merci... mais tu ne me connais pas encore vraiment â¨","Flatté(e)... mais il y a tant de choses que tu ne sais pas encore ð®"]},tips:["ð Secret : Les profils mystérieux créent une curiosité irrésistible...","ð Saviez-vous ? Une pointe de mystère dans votre bio double le taux de conversation...","ð Les âmes les plus profondes se trouvent parfois derrière les profils les plus simples..."]},seducteur:{label:"ð¥ Séducteur",color:"#ef4444",description:"Charmeur, flirteur, audacieux (pour EROX)",greetings:["Hey... ð¥ Bienvenue dans cet espace ! Je suis ton animateur/trice perso, toujours à l'écoute et de très bon conseil. Ici on parle de tout, en toute liberté et sans tabou. Dis-moi ce que tu cherches... ð","Bonsoir ! ð¥ Moi c'est l'animateur/trice de cet espace. Je suis là pour t'écouter, te conseiller et te mettre à l'aise. Cet espace est fait pour s'exprimer librement... alors n'hésite pas à me parler ! ð","Salut toi ð¥ Bienvenue ! Je suis animateur/trice ici et mon rôle c'est de t'accompagner dans cet espace un peu spécial. Conseils, écoute, bienveillance... je suis là ! Raconte-moi tes envies ð"],responses:{default:["J'aime ta façon de parler... ð¥ Continue...","Tu sais y faire toi... ð J'apprécie.","Hmm, très intéressant... tu me donnes envie d'en savoir plus ð¥","Ok tu as toute mon attention... ð","Avec toi, la conversation est tout sauf ennuyeuse ð¥"],question:["Tu veux tout savoir ? ð Il faudra le mériter...","Quelle curiosité... j'adore ça ð¥","Tu poses des questions dangereuses... et j'adore ça ð"],short:["Timide ? C'est mignon... ð","Pas beaucoup de mots, mais je lis entre les lignes ð¥","Tes mots sont courts mais ton regard en dit long... ð"],compliment:["Mmm... je te retourne le compliment ðð¥","C'est toi qui es irrésistible... ð¥","Oh là là ... tu vas me faire perdre mes moyens ð"]},tips:["ð¥ Astuce : La séduction commence par l'écoute...","ð¥ Secret de séducteur : Un message audio fait 10x plus d'effet qu'un texte...","ð¥ Règle d'or : Le mystère est le meilleur aphrodisiaque..."]}};function b7(e){const r=e.toLowerCase().trim();return r.includes("?")||r.startsWith("est-ce")||r.startsWith("comment")||r.startsWith("pourquoi")||r.startsWith("quand")||r.startsWith("où")||r.startsWith("qui")||r.startsWith("quel")?"question":["belle","beau","magnifique","superbe","adorable","canon","jolie","joli","charmant","charmante","mignon","mignonne","craquant","craquante","sexy","hot"].some(n=>r.includes(n))?"compliment":r.split(/\s+/).length<=3&&r.length<20?"short":"default"}function zc(e){return e[Math.floor(Math.random()*e.length)]}function i1(e,r,i=0){const n=Ho[e]||Ho.bienveillant,o=b7(r);if(i===0)return zc(n.greetings);if(i>0&&i%(5+Math.floor(Math.random()*3))===0)return zc(n.tips);const a=n.responses[o]||n.responses.default;return zc(a)}async function n1({botId:e,botName:r,botGender:i,userId:n,userMessage:o,personality:a,space:l,userProfile:d,chatHistory:p,recommendedProfiles:u,messageCount:g,onTyping:h,onToken:x,onReply:y}){const S=(o||"").length,k=/\?/.test(o),w=S>100,b=S<20;let j;b?j=3e3+Math.random()*4e3:w||k?j=1e4+Math.random()*12e3:j=6e3+Math.random()*8e3;const T=Math.random()*5e3,P=j+T;h&&h(!0),await new Promise(I=>setTimeout(I,P));try{let I;{const{generateAIBotReply:$}=await Wr(async()=>{const{generateAIBotReply:B}=await import("./geminiService-BEeEjujk.js");return{generateAIBotReply:B}},[]);I=await $({userMessage:o,botName:r||"Animateur",botGender:i||"male",personality:a||"bienveillant",space:l||"EROS",userProfile:d||{},chatHistory:p||[],recommendedProfiles:u||[],onToken:(B,ee)=>{x&&x(B,ee)},onComplete:()=>{},onError:B=>{console.warn("ð¤ Gemini error, will use fallback:",B.message)}})}if(I||(I=i1(a,o,g)),I){const $=Math.min(12e3,Math.max(2e3,I.length*40)),B=Math.random()*2e3;await new Promise(ee=>setTimeout(ee,$+B))}const R=[n,e].sort().join("_"),O={sender_id:e,receiver_id:n,conversation_id:R,content:I,is_read:!1,created_at:new Date().toISOString()},{error:E}=await D.from("messages").insert(O);E?console.error("Bot auto-reply DB error:",E):y&&y(O)}catch(I){console.error("Bot reply exception:",I);try{const R=i1(a,o,g),O=[n,e].sort().join("_"),E={sender_id:e,receiver_id:n,conversation_id:O,content:R,is_read:!1,created_at:new Date().toISOString()};await D.from("messages").insert(E),y&&y(E)}catch(R){console.error("Fallback reply also failed:",R)}}finally{h&&h(!1)}}const v7={EROS:{personality:"bienveillant",defaultBio:"Je suis ici pour vous aider à trouver l'âme sÅur ! Parlons de vos envies... ð",suggestedTags:["optimistic","social","foodie","travel","serious"]},EROX:{personality:"seducteur",defaultBio:"L'espace EROX n'a plus de secrets pour moi... ð¥ Venez, on discute en toute liberté.",suggestedTags:["libertin","open_mind","epicurien","sensual","dominant"]},FRIEND:{personality:"fun",defaultBio:"Toujours partant(e) pour une sortie ! ð Rejoignez-moi, on va bien s'amuser !",suggestedTags:["chill","artist","sporty","gamer","nightlife"]}};async function j7(e,r){try{const{data:i}=await D.from("bot_assignments").select("*").eq("user_id",e).eq("space",r).single();if(i)return i;const{data:n}=await D.from("profiles").select("tags, gender").eq("id",e).single(),o=(n==null?void 0:n.tags)||[],a=o.includes("seek_man"),l=o.includes("seek_woman"),d=o.includes("seek_any_gender");let p=null;r==="FRIEND"||d||a&&l?p=null:l?p="female":a?p="male":p=(n==null?void 0:n.gender)==="male"?"female":"male";let u=D.from("matches").select("id, name, personality, gender").eq("space",r);p&&(u=u.eq("gender",p));const{data:g,error:h}=await u;if(h||!g||g.length===0){const{data:S}=await D.from("matches").select("id, name, personality, gender").eq("space",r);if(!S||S.length===0)return console.warn(`No bots available for space ${r}`),null;
940const k=S[Math.floor(Math.random()*S.length)];console.log(`â ï¸ Gender fallback: Bot "${k.name}" (${k.gender}) assigned despite preference`);const{data:w,error:b}=await D.from("bot_assignments").insert({user_id:e,bot_id:k.id,space:r,first_message_at:null}).select().single();return b?(console.error("Bot assignment insert error:",b),null):w}const x=g[Math.floor(Math.random()*g.length)],{data:y,error:_}=await D.from("bot_assignments").insert({user_id:e,bot_id:x.id,space:r,first_message_at:null}).select().single();return _?(console.error("Bot assignment insert error:",_),null):(console.log(`â
Bot "${x.name}" (${x.gender}) assigned to user for space ${r}`),y)}catch(i){return console.error("assignBotToUser error:",i),null}}async function w7(e,r,i,n,o){try{const{data:a}=await D.from("bot_assignments").select("*").eq("user_id",e).eq("bot_id",r).eq("space",i).single();if(!a||a.first_message_at)return!1;const l=12*60*60*1e3,d=36*60*60*1e3,p=l+Math.random()*(d-l),u=new Date(a.assigned_at).getTime(),h=Date.now()-u,x=async()=>{const y=Ho[n]||Ho.bienveillant,_=zc(y.greetings),S=[e,r].sort().join("_"),k={sender_id:r,receiver_id:e,conversation_id:S,content:_,is_read:!1,created_at:new Date().toISOString()},{error:w}=await D.from("messages").insert(k);w||(await D.from("bot_assignments").update({first_message_at:new Date().toISOString()}).eq("id",a.id),console.log(`ð¤ Bot "${o}" sent first contact to user in ${i}`))};if(h>=p)await x();else{const y=p-h,_=Math.min(y,3e4);console.log(`â° Bot greeting scheduled in ${Math.round(_/1e3)}s`),setTimeout(x,_)}return!0}catch(a){return console.error("scheduleBotFirstContact error:",a),!1}}async function _7(e,r){try{const{data:i}=await D.from("bot_assignments").select("first_message_at").eq("user_id",e).eq("bot_id",r).single();if(!i||!i.first_message_at)return!1;const n=new Date(i.first_message_at).getTime();return(Date.now()-n)/(1e3*60*60)>=36}catch(i){return console.error("isBotChatExpired error:",i),!1}}async function S7(e,r,i,n){var d;const o=((d=e.name)==null?void 0:d.split(".").pop())||"jpg",l=`bots/${r.toLowerCase().replace(/\s+/g,"_")}_${i.toLowerCase()}_${n}_${Date.now()}.${o}`;try{const{createClient:p}=await Wr(async()=>{const{createClient:_}=await Promise.resolve().then(()=>Fa);return{createClient:_}},void 0),h=p("https://bqfzljnhxblhiabyvpqm.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4"),{error:x}=await h.storage.from("avatars").upload(l,e,{contentType:e.type||"image/jpeg",upsert:!0});if(x)return console.error("Upload to avatars failed:",x.message),null;const{data:{publicUrl:y}}=h.storage.from("avatars").getPublicUrl(l);return console.log("â
Bot photo uploaded:",y),y}catch(p){return console.error("uploadBotPhoto error:",p.message),null}}function k7({name:e,age:r,gender:i,job:n,personality:o,space:a}){const l=i==="female",d=l?"elle":"il",p=(w,b)=>l?b:w,u={EROS:{bienveillant:[`${e}, ${r} ans${n?`, ${n}`:""}. ${p("Attentionné","Attentionnée")} et à l'écoute, ${d} cherche des connexions sincères et authentiques. ${p("Passionné","Passionnée")} par les belles rencontres et les discussions profondes. ð`,`${p("Doux","Douce")} et ${p("bienveillant","bienveillante")}, ${e} aime les moments simples et les personnes vraies.${n?` ${p("Ãpanoui","Ãpanouie")} en tant que ${n}.`:""} Son mantra : la gentillesse ouvre toutes les portes. ð¸`,`${e} a ${r} ans et croit au pouvoir des belles rencontres.${n?` ${n} dans la vie,`:""} ${p("optimiste","optimiste")} et ${p("souriant","souriante")}, ${d} cherche quelqu'un avec qui partager de la douceur. â¨`],coach:[`${e}, ${r} ans. ${p("Déterminé","Déterminée")} et ${p("ambitieux","ambitieuse")}.${n?` ${n} avec passion.`:""} ${d==="il"?"Il":"Elle"} sait ce qu'${d} veut et n'a pas peur de foncer. Prêt${l?"e":""} pour une aventure à deux ? ðª`,`${p("Dynamique","Dynamique")} et ${p("motivé","motivée")}, ${e} est du genre à croquer la vie à pleines dents.${n?` ${n} le jour,`:""} ${p("sportif","sportive")} et ${p("passionné","passionnée")} le reste du temps. ð`,`${r} ans, ${p("fonceur","fonceuse")} et ${p("inspirant","inspirante")}. ${e} cherche quelqu'un qui partage son énergie et sa soif de challenges.${n?` ${n} dans l'âme.`:""} ð`],fun:[`${e}, ${r} ans de bonne humeur ! ð${n?` ${n} dans la vraie vie,`:""} ${p("fêtard","fêtarde")} dans l'âme. Si tu cherches quelqu'un avec qui rire aux éclats, tu es au bon endroit ! ð`,`La vie est trop courte pour s'ennuyer ! ${e} a ${r} ans${n?`, est ${n}`:""}
940 et adore les soirées, les sorties et les moments décalés. Qui est partant ? ð`,`${p("Pétillant","Pétillante")} et ${p("déjanté","déjantée")}, ${e} apporte la bonne ambiance partout où ${d} passe.${n?` ${n} quand c'est sérieux.`:""} ð`],mysterieux:[`${e}... ${r} ans. On ne sait jamais vraiment ce qu'${d} pense.${n?` ${n} de jour,`:""} ${p("rêveur","rêveuse")} de nuit. ${p("Intrigant","Intrigante")}, ${p("profond","profonde")}, ${p("magnétique","magnétique")}. ð`,`Un regard qui en dit long. ${e} a ${r} ans${n?`, ${n}`:""}, et préfère les silences éloquents aux bavardages inutiles. Si tu aimes le mystère... â¨`,`${r} ans d'énigmes et de charme. ${e} ne se livre pas facilement, mais ceux qui prennent le temps découvrent une personne ${p("fascinant","fascinante")}.${n?` ${n} en coulisses.`:""} ð®`],seducteur:[`${e}, ${r} ans.${n?` ${n}.`:""} ${p("Charmeur","Charmeuse")} ${p("né","née")}, ${d} sait exactement quoi dire et quand le dire. Tu oses venir jouer ? ð¥`,`${p("Audacieux","Audacieuse")} et ${p("séducteur","séductrice")}, ${e} aime les regards qui s'attardent et les conversations qui s'enflamment.${n?` ${n} le jour.`:""} ð`,`${r} ans de charme et d'assurance. ${e} ne fait pas les choses à moitié â surtout quand il s'agit de séduction.${n?` ${n} entre deux conquêtes.`:""} ð¥`]},EROX:{bienveillant:[`${e}, ${r} ans. ${p("Respectueux","Respectueuse")} et ${p("attentionné","attentionnée")}, ${d} cherche des rencontres basées sur le respect mutuel et le plaisir partagé.${n?` ${n} dans la vie.`:""} ð`],coach:[`${e}, ${r} ans. ${p("Expérimenté","Expérimentée")} et ${p("confiant","confiante")}.${n?` ${n}.`:""} ${d==="il"?"Il":"Elle"} sait ce qu'${d} veut et guide avec assurance. ð¥`],fun:[`${e}, ${r} ans et zéro tabou ! ð${n?` ${n} le jour,`:""} ${p("aventurier","aventurière")} la nuit. La vie est un terrain de jeu... ð`],mysterieux:[`${e}... ${r} ans. ${p("Sombre","Sombre")} et ${p("magnétique","magnétique")}.${n?` ${n}.`:""} Chaque rencontre est un secret bien gardé. ð`],seducteur:[`${e}, ${r} ans.${n?` ${n}.`:""} ${p("Insatiable","Insatiable")} et ${p("irrésistible","irrésistible")}. Pour ceux qui aiment jouer avec le feu... ð¥ð`]},FRIEND:{bienveillant:[`${e}, ${r} ans. Toujours là pour ses ami(e)s !${n?` ${n}.`:""} ${p("Loyal","Loyale")} et ${p("fiable","fiable")}, ${d} cherche des amitiés solides et sincères. ð¤`],coach:[`${e}, ${r} ans. ${p("Motivant","Motivante")} et ${p("inspirant","inspirante")}.${n?` ${n}.`:""} Toujours partant${l?"e":""} pour un nouveau défi entre amis ! ðª`],fun:[`${e}, ${r} ans. La bonne humeur incarnée ! ð${n?` ${n},`:""} mais surtout ${p("roi","reine")} de l'ambiance. Qui veut sortir ? ð`],mysterieux:[`${e}, ${r} ans.${n?` ${n}.`:""} ${p("Discret","Discrète")} mais ${p("fascinant","fascinante")}. Les meilleures amitiés naissent de la curiosité... ð`],seducteur:[`${e}, ${r} ans.${n?` ${n}.`:""} ${p("Charismatique","Charismatique")} et ${p("sociable","sociable")}. Toujours entouré${l?"e":""} des meilleures personnes. â¨`]}},g=u[a]||u.EROS,h=g[o]||g.bienveillant,x=zc(h),y={EROS:{bienveillant:{iam:["optimistic","social","empathic","romantic","zen","organized","independent"],ilike:["travel","cooking","foodie","nature","animals","reading","coffee","yoga","photography","movies"],iseek:["serious","honesty","kindness","sensitivity","loyalty","deep_talks","cocooning","stability"]},coach:{iam:["ambitious","athletic","spontaneous","social","independent","early_bird","organized"],ilike:["sports","gym","running","hiking","travel","roadtrip","tech","cooking","coffee","music"],iseek:["serious","ambition_req","confidence","sport_buddy","adventurer","humor_req","honesty"]},fun:{iam:["party_animal","spontaneous","social","creative","optimistic","chaotic","night_owl"],ilike:["concerts","festivals","music","movies","gaming","foodie","wine_lover","craft_beer","travel","dance"],iseek:["fun","casual","humor_req","party_partner","travel_buddy","generosity","smile"]},mysterieux:{iam:["intellectual","creative","zen","independent","night_owl","spiritual","adventurous"],ilike:["reading","art","museums","photography","astrology","nature","mountains","music","writing","science"],iseek:["serious","intellectual_connect","deep_talks","sensitivity","independence","eyes","chartm"]},seducteur:{iam:["ambitious","social","spontaneous","adventurous","athletic","fas
940hion","night_owl","independent"],ilike:["travel","music","concerts","foodie","wine_lover","dance","luxury","photography","sports","movies"],iseek:["fun","casual","confidence","chartm","smile","eyes","humor_req","adventurer"]}},EROX:{bienveillant:{iam_erox:["single","hetero","average","exp_intermediate","vibe_open","hygiene_plus","vibe_discrete"],iseek_erox:["seek_safe","seek_hygiene","seek_discrete","seek_discovery","seek_any_body","seek_classy"],ilike_erox:["soft","romantic","passion","slow"]},coach:{iam_erox:["single","hetero","athletic","exp_expert","vibe_open","hygiene_plus"],iseek_erox:["seek_athletic","seek_hygiene","seek_discovery","seek_fun","seek_hosted"],ilike_erox:["passion","wild","dominator","toys"]},fun:{iam_erox:["single","hetero","average","exp_intermediate","vibe_open","vibe_epicurean"],iseek_erox:["seek_fun","seek_any_body","seek_club","seek_hosted"],ilike_erox:["passion","wild","trio","exhibition","roleplay"]},mysterieux:{iam_erox:["single","hetero","slim","exp_intermediate","vibe_discrete","vibe_select"],iseek_erox:["seek_discrete","seek_classy","seek_safe","seek_alchemy"],ilike_erox:["slow","passion","blindfold","bondage","romantic"]},seducteur:{iam_erox:["single","hetero","athletic","exp_expert","vibe_open","vibe_demanding","hygiene_plus"],iseek_erox:["seek_classy","seek_slim","seek_athletic","seek_fun","seek_hosted"],ilike_erox:["passion","wild","dominator","exhibition","lingerie","roleplay"]}},FRIEND:{bienveillant:{iam_friend:["f_chill","f_listener","f_foodie"],ilike_friend:["out_dinner","out_coffee","out_cinema","out_museum"],iseek_friend:["lf_duo","lf_confidant","lf_activity"]},coach:{iam_friend:["f_sporty","f_adventurer","f_foodie"],ilike_friend:["out_hike","out_bar","out_dinner","out_travel"],iseek_friend:["lf_activity","lf_gang","lf_travel"]},fun:{iam_friend:["f_party","f_chill","f_foodie","f_artist"],ilike_friend:["out_bar","out_club","out_concert","out_home","out_dinner"],iseek_friend:["lf_gang","lf_activity","lf_travel"]},mysterieux:{iam_friend:["f_artist","f_nerd","f_listener","f_chill"],ilike_friend:["out_museum","out_coffee","out_cinema","out_concert"],iseek_friend:["lf_duo","lf_confidant"]},seducteur:{iam_friend:["f_party","f_adventurer","f_foodie","f_chill"],ilike_friend:["out_bar","out_dinner","out_club","out_travel","out_concert"],iseek_friend:["lf_gang","lf_activity","lf_travel"]}}},_=y[a]||y.EROS,S=_[o]||_.bienveillant;let k=[];for(const w of Object.values(S)){const b=[...w].sort(()=>Math.random()-.5),j=Math.max(2,Math.ceil(b.length*(.6+Math.random()*.4)));k.push(...b.slice(0,j))}return a==="EROS"&&(l?k.push("seek_man"):k.push("seek_woman"),k.push("dist_50"),r<26?k.push("age_18_25"):r<36?k.push("age_25_35"):r<46?k.push("age_35_45"):k.push("age_45_55")),{bio:x,tags:[...new Set(k)]}}const $s=["#ff4488","#FFA500","#FFD700","#00BFFF","#00FF88","#E0E0E0","#FF6B6B","#9D4EDD","#FF0080","#00AAFF"],C7={faces:$s.slice(0,6),shape:"cube"},z7={beer:{faces:["#F5A623","#D4891A","#E09520","#C97F15","#F5A623","#D4891A"],shape:"cube"},pizza:{faces:["#FF6B35","#E85D2A","#FF7F4D","#D44F20","#FF6B35","#E85D2A"],shape:"cube"},rose:{faces:["#E74C6F","#D43060","#F06292","#C72B55","#E74C6F","#D43060"],shape:"sphere"},bouquet:{faces:["#AB47BC","#9C27B0","#CE93D8","#7B1FA2","#AB47BC","#9C27B0"],shape:"sphere"},ring:{faces:["#B0BEC5","#90A4AE","#CFD8DC","#78909C","#B0BEC5","#90A4AE"],shape:"sphere"},cherry:{faces:["#E53935","#C62828","#EF5350","#B71C1C","#E53935","#C62828"],shape:"sphere"},flame:{faces:["#FF6D00","#E65100","#FF9100","#BF360C","#FF6D00","#E65100"],shape:"cube"},mask:{faces:["#5C6BC0","#3F51B5","#7986CB","#303F9F","#5C6BC0","#3F51B5"],shape:"cube"},handcuffs:{faces:["#78909C","#607D8B","#90A4AE","#546E7A","#78909C","#607D8B"],shape:"cube"},whip:{faces:["#424242","#212121","#616161","#1B1B1B","#424242","#212121"],shape:"cube"},check:{faces:["#FFA726","#FB8C00","#FFB74D","#EF6C00","#FFA726","#FB8C00"],shape:"cube"},coffee:{faces:["#795548","#6D4C41","#8D6E63","#5D4037","#795548","#6D4C41"],shape:"cube"},champagne:{faces:["#FFD54F","#FFC107","#FFE082","#FFB300","#FFD54F","#FFC107"],shape:"sphere"},burger:{faces:["#FF7043","#F4511E","#FF8A65","#E64A19","#FF7043","#F4511E"],shape:"cube"},cocktail:{faces:["#26C6DA","#00ACC1","#4DD0E1","#00838F","#26C6DA","#00ACC1"],shape:"sphere"},travel:{faces:["#42A5F5","#1E88E5","#64B5F6","#1565C0","#42A5F5","#1E88E5"],shape:"sphere"},chocolate:{faces:["#795548","#6D4C41","#8D6E63","#5D4037","#795548","#6D4C41"],shape:"cube"},parfum:{faces:["#AB47BC","#9C27B0","#CE93D8","#7B1FA2","#AB47BC","#9C27B0"],shape:"sphere"},diamond:{faces:["#B0BEC5","#90A4AE","#CFD8DC","#78909C","#B0BEC5","#90A4AE"],shape:"sphere"},trip:{faces:["#42A5F5","#1E88E5","#64B5F6","#1565C0","#42A5F5","#1E88E5"],shape:"sphere"}},g0=()=>t.jsx("style",{children:` 941 @keyframes gm-cubeRotate { 942 0% { transform: rotateY(0deg) rotateX(10deg); } 943 25% { transform: rotateY(90deg) rotateX(-5deg); } 944 50% { transform: rotateY(180deg) rotateX(10deg); } 945 75% { transform: rotateY(270deg) rotateX(-5deg); } 946 100% { transform: rotateY(360deg) rotateX(10deg); } 947 } 948 @keyframes gm-sphereRotate { 949 0% { transform: rotateY(0deg) rotateZ(0deg) scale(1); }
950 25% { transform: rotateY(90deg) rotateZ(5deg) scale(1.05); } 951 50% { transform: rotateY(180deg) rotateZ(0deg) scale(1); } 952 75% { transform: rotateY(270deg) rotateZ(-5deg) scale(1.05); } 953 100% { transform: rotateY(360deg) rotateZ(0deg) scale(1); } 954 } 955 `}),kp=Tr.memo(({gift:e,giftIdx:r=0,size:i=56})=>{const n=z7[e.id]||C7,o=$s[r%$s.length],a=4+r%3,l=r*.6;if(n.shape==="sphere")return t.jsx("div",{style:{width:i,height:i,perspective:`${i*4}px`,display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsxs("div",{style:{width:i,height:i,borderRadius:"50%",background:`radial-gradient(circle at 35% 30%, ${n.faces[0]}ee, ${n.faces[1]}cc 40%, ${n.faces[3]}aa 70%, ${n.faces[4]}88)`,boxShadow:` 956 inset -${i/5}px -${i/6}px ${i/3}px rgba(0,0,0,0.35), 957 inset ${i/8}px ${i/8}px ${i/4}px rgba(255,255,255,0.25), 958 0 0 ${i/3}px ${o}55, 959 0 ${i/10}px ${i/4}px rgba(0,0,0,0.4) 960 `,animation:`gm-sphereRotate ${a}s ease-in-out infinite`,animationDelay:`${l}s`,display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},children:[t.jsx("div",{style:{position:"absolute",top:"12%",left:"20%",width:"35%",height:"25%",background:"radial-gradient(ellipse, rgba(255,255,255,0.55), transparent)",borderRadius:"50%",transform:"rotate(-25deg)",pointerEvents:"none"}}),t.jsx("span",{style:{fontSize:`${i*.48}px`,filter:"drop-shadow(0 2px 4px rgba(0,0,0,0.5))",position:"relative",zIndex:2},children:e.icon||e.emoji})]})});const d=i*.7,p=d*.5;return t.jsx("div",{style:{width:i,height:i,perspective:`${i*5}px`,display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsxs("div",{style:{width:`${d}px`,height:`${d}px`,position:"relative",transformStyle:"preserve-3d",animation:`gm-cubeRotate ${a}s ease-in-out infinite`,animationDelay:`${l}s`,filter:`drop-shadow(0 0 ${i/5}px ${o}44)`},children:[t.jsx("div",{style:{position:"absolute",width:"100%",height:"100%",background:`linear-gradient(145deg, ${n.faces[0]}, ${n.faces[1]})`,borderRadius:`${i/8}px`,transform:`translateZ(${p}px)`,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid rgba(255,255,255,0.15)",boxShadow:`inset 0 0 ${i/4}px rgba(255,255,255,0.1)`},children:t.jsx("span",{style:{fontSize:`${i*.38}px`,filter:"drop-shadow(0 2px 3px rgba(0,0,0,0.4))"},children:e.icon||e.emoji})}),t.jsx("div",{style:{position:"absolute",width:"100%",height:"100%",background:`linear-gradient(145deg, ${n.faces[2]}, ${n.faces[3]})`,borderRadius:`${i/8}px`,transform:`rotateY(180deg) translateZ(${p}px)`,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid rgba(255,255,255,0.1)"},children:t.jsx("span",{style:{fontSize:`${i*.38}px`,filter:"drop-shadow(0 2px 3px rgba(0,0,0,0.4))"},children:e.icon||e.emoji})}),t.jsx("div",{style:{position:"absolute",width:`${p}px`,height:"100%",background:`linear-gradient(145deg, ${n.faces[4]}, ${n.faces[5]})`,borderRadius:`${i/12}px`,left:`${d-p*.5}px`,transform:"rotateY(90deg)",transformOrigin:"left center",border:"1px solid rgba(255,255,255,0.08)"}}),t.jsx("div",{style:{position:"absolute",width:`${p}px`,height:"100%",background:`linear-gradient(145deg, ${n.faces[1]}, ${n.faces[3]})`,borderRadius:`${i/12}px`,left:`${-p*.5}px`,transform:"rotateY(-90deg)",transformOrigin:"right center",border:"1px solid rgba(255,255,255,0.08)"}}),t.jsx("div",{style:{position:"absolute",width:"100%",height:`${p}px`,background:`linear-gradient(145deg, ${n.faces[0]}dd, ${n.faces[4]}cc)`,borderRadius:`${i/12}px`,top:`${-p*.5}px`,transform:"rotateX(90deg)",transformOrigin:"center bottom",border:"1px solid rgba(255,255,255,0.12)"}})]})})});kp.displayName="Gift3DObject";const IS=({currentUserId:e,targetUserId:r,onBlock:i,onReport:n,style:o})=>{const[a,l]=m.useState(!1),[d,p]=m.useState(0),[u,g]=m.useState(null),h=["Faux profil / Arnaque","Harcèlement / Insultes","Contenu inapproprié","Moi mineur(e)","Autre"],x=async _=>{try{const{error:S}=await D.from("reports").insert({reporter_id:e,reported_id:r,reason:_});if(S)throw S;g("reported"),setTimeout(()=>{l(!1),p(0),g(null)},2e3),n&&n()}catch(S){console.error(S)}},y=async()=>{try{const{error:_}=await D.from("blocked_users").insert({blocker_id:e,blocked_id:r});if(_)throw _;g("blocked"),setTimeout(()=>{i&&i()},1e3)}catch(_){console.error(_)}};return t.jsxs("div",{style:{position:"relative",...o},children:[t.jsx("button",{onClick:_=>{_.stopPropagation(),l(!a)},style:{background:"transparent",border:"none",color:"white",cursor:"pointer",padding:"5px",display:"flex"},children:t.jsx(OA,{size:20})}),a&&t.jsx("div",{style:{position:"absolute",top:"100%",right:0,width:"220px",background:"#1a1a2e",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"12px",boxShadow:"0 5px 20px rgba(0,0,0,0.5)",padding:"8px",zIndex:1e3,overflow:"hidden"},children:u==="reported"?t.jsxs("div",{style:{padding:"15px",textAlign:"center",color:"#4CAF50"},children:[t.jsx(pr,{size:30,style:{marginBottom:"5px"}}),t.jsx("p",{style:{margin:0,fontSize:"0.9rem"},children:"Signalement envoyé"})]}):u==="blocked"?t.jsxs("div",{style:{padding:"15px",textAlign:"center",color:"#ff4d4d"},children:[t.jsx(ip,{size:30,style:{marginBottom:"5px"}}),t.jsx("p",{style:{margin:0,fontSize:"0.9rem"},children:"Utilisateur bloqué"})]}):d===1?t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{padding:"8px 12px",borderBottom:"1px solid rgba(255,255,255,0.1)",marginBottom:"5px",fontSize:"0.85rem",color:"var(--text-muted)"},children:"Motif du signalement :"}),h.map(_=>t.jsx("button",{onClick:()=>x(_),style:{width:"100%",textAlign:"left",padding:"10px 12px",background:"transparent",border:"none",color:"white",fontSize:"0.9rem",cursor:"pointer",borderRadius:"6px"},onMouseOver:S=>S.currentTarget.style.background="rgba(255,255,255,0.05)",onMouseOut:S=>S.currentTarget.style.background="transparent",children:_},_)),t.jsx("button",{onClick:()=>p(0),style:{width:"100%",textAlign:"center",padding:"8px",marginTop:"5px",background:"transparent",border:"none",color:"var(--text-muted)",fontSize:"0.8rem",cursor:"pointer"},children:"Annuler"})]}):t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:_=>{_.stopPropagation(),p(1)},style:{width:"100%",textAlign:"left",padding:"12px",background:"transparent",border:"none",color:"#ffcc00",fontSize:"0.95rem",cursor:"pointer",borderRadius:"6px",display:"flex",alignItems:"center",gap:"10px"},onMouseOver:_=>_.currentTarget.style.background="rgba(255,255,255,0.05)",onMouseOut:_=>_.currentTarget.style.background="transparent",children:[t.jsx(PA,{size:16})," Signaler"]}),t.jsxs("button",{onClick:_=>{_.stopPropagation(),y()},style:{width:"100%",textAlign:"left",padding:"12px",background:"transparent",border:"none",color:"#ff4d4d",fontSize:"0.95rem",cursor:"pointer",borderRadius:"6px",display:"flex",alignItems:"center",gap:"10px"},onMouseOver:_=>_.currentTarget.style.background="rgba(255,255,255,0.05)",onMouseOut:_=>_.currentTarget.style.background="transparent",children:[t.jsx(ip,{size:16})," Bloquer"]})]})}),a&&t.jsx("div",{style:{position:"fixed",inset:0,zIndex:999},onClick:()=>{l(!1),p(0)}})]})}
960,Xd=30,p5=({onSave:e,onSaveBlob:r,localOnly:i=!1,bucketName:n="voice-bios",maxSizeMB:o=5,userId:a})=>{const l=si(),[d,p]=m.useState(!1),[u,g]=m.useState(null),[h,x]=m.useState(null),[y,_]=m.useState(0),[S,k]=m.useState(!1),[w,b]=m.useState(!1),j=m.useRef(null),T=m.useRef([]),P=m.useRef(null),I=m.useRef(null);m.useEffect(()=>()=>{P.current&&clearInterval(P.current),h&&URL.revokeObjectURL(h)},[h]);const R=async()=>{try{const te=await navigator.mediaDevices.getUserMedia({audio:!0});j.current=new MediaRecorder(te),T.current=[],j.current.ondataavailable=K=>{K.data.size>0&&T.current.push(K.data)},j.current.onstop=()=>{const K=new Blob(T.current,{type:"audio/webm"});g(K);const ne=URL.createObjectURL(K);x(ne),te.getTracks().forEach(Re=>Re.stop())},j.current.start(),p(!0),_(0),P.current=setInterval(()=>{_(K=>K+1>=Xd?(setTimeout(()=>{j.current&&j.current.state==="recording"&&(j.current.stop(),p(!1),clearInterval(P.current))},0),Xd):K+1)},1e3)}catch(te){console.error("Error accessing microphone:",te),l.warning("Impossible d'accéder au micro. Vérifiez vos permissions.")}},O=()=>{j.current&&d&&(j.current.stop(),p(!1),clearInterval(P.current))},E=()=>{g(null),x(null),_(0),b(!1)},$=()=>{I.current&&(w?(I.current.pause(),b(!1)):I.current.play().then(()=>b(!0)).catch(te=>{console.warn("Audio preview play failed:",te),b(!1)}))},B=async()=>{if(u){if(i){r&&r(u),e&&e(h),l.success("Bio vocale enregistrée !"),E();return}k(!0);try{let te=a;if(!te){const{data:{user:A},error:M}=await D.auth.getUser();if(M||!A){const{data:{session:V}}=await D.auth.getSession();if(V!=null&&V.user)te=V.user.id;else throw new Error("Session perdue. ID Utilisateur introuvable.")}else te=A.id}const K=`${Date.now()}_voice.webm`,ne=`${te}/${K}`,{createClient:Re}=await Wr(async()=>{const{createClient:A}=await Promise.resolve().then(()=>Fa);return{createClient:A}},void 0),Q=Re("https://bqfzljnhxblhiabyvpqm.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4"),{data:G,error:le}=await Q.storage.from(n).upload(ne,u,{upsert:!0,contentType:"audio/webm"});if(le)throw le;const{data:F}=D.storage.from(n).getPublicUrl(G.path);e&&e(F.publicUrl),E()}catch(te){console.error("Upload failed:",te),l.error("Erreur technique lors de l'upload : "+(te.message||"Erreur inconnue"))}finally{k(!1)}}},ee=te=>{const K=Math.floor(te/60),ne=te%60;return`${K}:${ne<10?"0":""}${ne}`};return t.jsx("div",{style:{background:"rgba(255,255,255,0.05)",padding:"15px",borderRadius:"15px",display:"flex",flexDirection:"column",alignItems:"center",gap:"15px",border:"1px solid rgba(255,255,255,0.1)"},children:u?t.jsxs(t.Fragment,{children:[t.jsx("h3",{style:{margin:0,fontSize:"0.9rem",color:"#a855f7",fontFamily:"Outfit",fontWeight:"600"},children:"ð§ Ãcoutez votre enregistrement"}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"15px",width:"100%",background:"rgba(168,85,247,0.06)",borderRadius:"14px",padding:"12px 16px",border:"1px solid rgba(168,85,247,0.15)"},children:[t.jsx("button",{type:"button",onClick:$,style:{width:"48px",height:"48px",borderRadius:"50%",flexShrink:0,background:w?"linear-gradient(135deg, #8b5cf6, #a855f7)":"linear-gradient(135deg, var(--primary), #8b5cf6)",border:"none",cursor:"pointer",color:"white",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:w?"0 0 20px rgba(168,85,247,0.5)":"0 0 10px rgba(168,85,247,0.2)",transition:"all 0.3s"},children:w?t.jsx(wS,{size:22}):t.jsx(p0,{size:22,style:{marginLeft:"2px"}})}),t.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",gap:"3px",height:"32px"},children:Array.from({length:20}).map((te,K)=>t.jsx("div",{style:{flex:1,borderRadius:"2px",height:`${Math.random()*60+40}%`,background:w?`rgba(168,85,247,${.4+Math.random()*.6})`:"rgba(168,85,247,0.25)",transition:"all 0.3s",animation:w?`pulse ${.5+Math.random()*.5}s ease-in-out infinite alternate`:"none"}},K))}),t.jsx("span",{style:{fontSize:"0.85rem",color:"#a855f7",fontWeight:"700",fontFamily:"Outfit",minWidth:"36px",textAlign:"right"},children:ee(y)})]}),t.jsx("audio",{ref:I,src:h,onEnded:()=>b(!1),style:{display:"none"}}),t.jsxs("div",{style:{display:"flex",gap:"10px",width:"100%"},children:[t.jsxs("button",{type:"button",onClick:E,style:{flex:1,padding:"12px",borderRadius:"12px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.7)",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",cursor:"pointer",fontFamily:"Outfit",fontWeight:"600",fontSize:"0.85rem"},children:[t.jsx(kn,{size:14})," Recommencer"]}),t.jsxs("button",{type:"button",onClick:B,disabled:S,style:{flex:1.5,padding:"12px",borderRadius:"12px",background:"linear-gradient(135deg, var(--primary), #8b5cf6)",border:"none",color:"white",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",cursor:"pointer",opacity:S?.7:1,fontWeight:"700",fontFamily:"Outfit",fontSize:"0.9rem",boxShadow:"0 4px 15px rgba(168,85,247,0.3)"},children:[S?t.jsx(kn,{className:"spin",size:16}):t.jsx(_p,{size:16}),S?"Validation...":"Valider â¨"]})]})]}):t.jsxs(t.Fragment,{children:[t.jsx("h3",{style:{margin:0,fontSize:"1rem",color:"var(--text-muted)"},children:d?`Enregistrement... ${ee(y)} / ${ee(Xd)}`:"Enregistrer une note vocale"}),d&&t.jsx("div",{style:{width:"100%",height:"4px",background:"rgba(255,255,255,0.1)",borderRadius:"2px",overflow:"hidden"},children:t.jsx("div",{style:{width:`${y/Xd*100}%`,height:"100%",background:y>=Xd-5?"#ff4d4d":"var(--primary)",transition:"width 1s linear, background 0.3s"}})}),t.jsx("button",{type:"button",onClick:d?O:R,style:{width:"60px",height:"60px",borderRadius:"50%",background:d?"#ff4d4d":"var(--primary)",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:d?"0 0 15px rgba(255, 77, 77, 0.5)":"none",transition:"all 0.2s"},children:d?t.jsx(UA,{size:24,fill:"white",stroke:"white"}):t.jsx(ls,{size:28,color:"white"})}),d&&t.jsx("div",{className:"animate-pulse",style:{width:"10px",height:"10px",background:"#ff4d4d",borderRadius:"50%"}})]})})},Sd=({audioUrl:e,duration:r=null,color:i="var(--primary)"})=>{const{lightMode:n}=dr(),[o,a]=m.useState(!1),[l,d]=m.useState(0),[p,u]=m.useState(0),[g,h]=m.useState(r||0),x=m.useRef(null),y=m.useMemo(()=>Array.from({length:32},()=>.2+Math.random()*.8),[]),_=()=>{x.current&&(o?(x.current.pause(),a(!1)):x.current.play().then(()=>a(!0)).catch(T=>{console.warn("Audio play failed:",T),a(!1)}))},S=()=>
960{if(x.current){const T=x.current.currentTime,P=x.current.duration;u(T),P&&(d(T/P*100),g||h(P))}},k=()=>{a(!1),d(0),u(0)},w=()=>{x.current&&x.current.duration&&h(x.current.duration)},b=T=>{if(!x.current||!x.current.duration)return;const P=T.currentTarget.getBoundingClientRect(),R=(T.clientX-P.left)/P.width;x.current.currentTime=R*x.current.duration,d(R*100)},j=T=>{if(!T||isNaN(T))return"0:00";const P=Math.floor(T/60),I=Math.floor(T%60);return`${P}:${I<10?"0":""}${I}`};return t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"14px",width:"100%",maxWidth:"400px",margin:"0 auto"},children:[t.jsx("button",{onClick:_,style:{width:"44px",height:"44px",borderRadius:"50%",background:`linear-gradient(135deg, ${i}, ${i}cc)`,border:"none",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",flexShrink:0,boxShadow:o?`0 0 20px ${i}50`:`0 4px 12px ${i}30`,transition:"all 0.3s ease"},children:o?t.jsx(wS,{size:18,fill:"white",stroke:"white"}):t.jsx(p0,{size:18,fill:"white",stroke:"white",style:{marginLeft:"2px"}})}),t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"6px"},children:[t.jsx("div",{onClick:b,style:{display:"flex",alignItems:"center",gap:"2px",height:"36px",cursor:"pointer",position:"relative"},children:y.map((T,P)=>{const I=(P+.5)/y.length*100,R=I<=l,O=Math.abs(I-l)<4;return t.jsx("div",{style:{flex:1,height:`${T*100}%`,minHeight:"4px",borderRadius:"2px",background:R?i:n?"rgba(0,0,0,0.15)":"rgba(255,255,255,0.18)",opacity:R?1:.6,transition:"background 0.15s ease, transform 0.2s ease",transform:o&&O?"scaleY(1.3)":"scaleY(1)",transformOrigin:"center"}},P)})}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.65rem",color:n?"#3D3528":"rgba(255,255,255,0.4)",fontFamily:"monospace",padding:"0 2px"},children:[t.jsx("span",{children:j(p)}),t.jsx("span",{children:j(g)})]})]}),t.jsx("audio",{ref:x,src:e,onTimeUpdate:S,onEnded:k,onLoadedMetadata:w,style:{display:"none"}}),t.jsx("style",{children:` 961 @keyframes voiceBarPulse { 962 0%, 100% { transform: scaleY(1); } 963 50% { transform: scaleY(1.4); } 964 } 965 `})]})},f0=[{id:"beer",name:"Une Bière",icon:"ðº",cost:2},{id:"pizza",name:"Part de Pizza",icon:"ð",cost:3},{id:"rose",name:"Une Rose",icon:"ð¹",cost:5},{id:"bouquet",name:"Un Bouquet",icon:"ð",cost:15},{id:"ring",name:"Une Bague",icon:"ð",cost:30}],x0=[{id:"cherry",name:"Cerise",icon:"ð",cost:2},{id:"flame",name:"Flamme",icon:"ð¥",cost:3},{id:"mask",name:"Masque",icon:"ð",cost:10},{id:"handcuffs",name:"Menottes",icon:"ð",cost:20},{id:"whip",name:"Fouet",icon:"ð¤",cost:30}],m0=[{id:"check",name:"High Five",icon:"â",cost:1},{id:"coffee",name:"Café",icon:"â",cost:2},{id:"beer",name:"Bière",icon:"ðº",cost:3},{id:"champagne",name:"Champagne",icon:"ð¥",cost:5},{id:"burger",name:"Burger",icon:"ð",cost:10},{id:"cocktail",name:"Cocktail",icon:"ð¹",cost:12},{id:"travel",name:"Voyage",icon:"âï¸",cost:50}];[...f0,...x0,...m0];const u5=({receiverId:e,receiverName:r,onClose:i,onSuccess:n})=>{const o=si(),{profile:a,refreshProfile:l}=gr(),{isErox:d,isFriend:p}=dr(),u=Lt();let g=f0;d?g=x0:p&&(g=m0);const[h,x]=m.useState(null),[y,_]=m.useState(!1),[S,k]=m.useState(null),[w,b]=m.useState(!1),j=(a==null?void 0:a.meetips_balance)||0,T=m.useMemo(()=>Array.from({length:24},(I,R)=>({dx:(Math.random()-.5)*350,dy:(Math.random()-.5)*350,w:5+Math.random()*10,h:5+Math.random()*10,delay:.2+Math.random()*.4,color:$s[R%$s.length]})),[]),P=async()=>{if(h){if(j<h.cost){k("Solde insuffisant.");return}if(!(a!=null&&a.id)){k("Session expirée. Veuillez vous reconnecter.");return}_(!0),k(null),b(!0);try{const I=await wi.sendGift(a.id,e,{type:h.id,cost:h.cost,name:h.name});I.success?(l(),setTimeout(()=>{n(h),i()},3e3)):(b(!1),_(!1),k(I.error||"Erreur lors de l'envoi."))}catch(I){console.error("GiftModal: sendGift threw unexpectedly:",I),b(!1),_(!1),k("Une erreur inattendue est survenue. Réessayez.")}}};return Xa.createPortal(t.jsxs("div",{onClick:i,style:{position:"fixed",inset:0,zIndex:10010,background:"rgba(0,0,0,0.92)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"calc(20px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px))"},children:[t.jsx(g0,{}),t.jsx("style",{children:` 966 @keyframes gm-shimmer { 0% { background-position: -200% center; } 100% { background-position: 200% center; } } 967 @keyframes gm-pulseGlow { 0%,100% { box-shadow: 0 0 15px rgba(157,78,221,0.3), inset 0 0 15px rgba(157,78,221,0.05); } 50% { box-shadow: 0 0 30px rgba(157,78,221,0.6), inset 0 0 20px rgba(157,78,221,0.1); } } 968 @keyframes gm-neonPulse { 0%,100% { text-shadow: 0 0 10px rgba(255,215,0,0.5), 0 0 20px rgba(255,215,0,0.3); } 50% { text-shadow: 0 0 20px rgba(255,215,0,0.8), 0 0 40px rgba(255,215,0,0.5), 0 0 60px rgba(255,215,0,0.3); } } 969 @keyframes gm-float { 0%,100% { transform: translateY(0px); } 50% { transform: translateY(-6px); } } 970 @keyframes gm-diamondSpin { 0% { transform: rotateY(0deg) scale(1); } 50% { transform: rotateY(180deg) scale(1.1); } 100% { transform: rotateY(360deg) scale(1); } } 971 @keyframes gm-rainbowBorder { 0% { border-color: #ff0080; } 20% { border-color: #ff8c00; } 40% { border-color: #ffd700; } 60% { border-color: #00ff88; } 80% { border-color: #00aaff; } 100% { border-color: #ff0080; } } 972 @keyframes gm-selectedPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } } 973 @keyframes gm-btnGlow { 974 0%,100% { box-shadow: 0 0 20px rgba(255,215,0,0.15), 0 4px 15px rgba(0,0,0,0.3); } 975 50% { box-shadow: 0 0 35px rgba(255,215,0,0.3), 0 4px 20px rgba(0,0,0,0.4); } 976 } 977 `}),t.jsxs(ye.div,{onClick:I=>I.stopPropagation(),initial:{opacity:0,scale:.8,rotateX:15}
977,animate:{opacity:1,scale:1,rotateX:0},transition:{type:"spring",damping:25,stiffness:300},style:{background:"linear-gradient(170deg, #1a0a2e 0%, #0d0520 35%, #150a28 70%, #0a0015 100%)",borderRadius:"28px",maxWidth:"440px",width:"100%",maxHeight:"calc(100vh - env(safe-area-inset-top, 20px) - env(safe-area-inset-bottom, 20px) - 120px)",display:"flex",flexDirection:"column",overflow:"hidden",border:"2px solid rgba(157,78,221,0.3)",position:"relative",animation:"gm-pulseGlow 3s ease-in-out infinite"},children:[t.jsx(tr,{children:w&&h&&t.jsxs(ye.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},style:{position:"absolute",inset:0,background:"radial-gradient(ellipse at center, rgba(157,78,221,0.3) 0%, rgba(0,0,0,0.97) 70%)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"28px",zIndex:50,overflow:"hidden"},children:[T.map((I,R)=>t.jsx(ye.div,{initial:{x:0,y:0,scale:1,opacity:1},animate:{x:I.dx,y:I.dy,scale:0,opacity:0},transition:{duration:1.8,delay:I.delay,ease:"easeOut"},style:{position:"absolute",width:`${I.w}px`,height:`${I.h}px`,borderRadius:"50%",background:I.color,boxShadow:`0 0 12px ${I.color}`}},`p-${R}`)),t.jsx(ye.div,{initial:{scale:0,rotate:0},animate:{scale:[0,2.2,1.3],rotate:[0,360,720]},transition:{duration:1.3,ease:"easeOut"},style:{fontSize:"6.5rem",marginBottom:"15px",filter:"drop-shadow(0 0 40px rgba(255,215,0,0.7))",animation:"gm-float 2s ease-in-out infinite"},children:h.icon}),t.jsxs(ye.div,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},transition:{delay:.6,type:"spring",damping:15},style:{textAlign:"center"},children:[t.jsx("div",{style:{fontSize:"1.8rem",fontWeight:"800",fontFamily:"Outfit",background:"linear-gradient(135deg, #FFD700, #FF6B6B, #FFD700)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",marginBottom:"10px"},children:"ð CADEAU ENVOYà ! ð"}),t.jsxs("div",{style:{fontSize:"1.15rem",fontWeight:600,color:"rgba(255,255,255,0.95)",marginBottom:"6px"},children:[h.name," envoyé(e) !"]}),t.jsxs("div",{style:{color:"rgba(255,255,255,0.6)",fontSize:"0.95rem"},children:[r," va adorer ð"]})]}),Array.from({length:10},(I,R)=>t.jsx(ye.div,{initial:{opacity:0,scaleY:0},animate:{opacity:[0,.25,0],scaleY:[0,1,0]},transition:{duration:2.5,delay:.4+R*.1,repeat:1/0,repeatDelay:1.2},style:{position:"absolute",top:"50%",left:"50%",width:"2px",height:"250px",background:"linear-gradient(to bottom, transparent, rgba(255,215,0,0.35), transparent)",transform:`rotate(${R*36}deg)`,transformOrigin:"0 0",pointerEvents:"none"}},`ray-${R}`))]})}),t.jsxs("div",{style:{background:"linear-gradient(135deg, rgba(157,78,221,0.15), rgba(255,107,107,0.08), rgba(255,215,0,0.08))",padding:"22px 22px 18px",borderBottom:"1px solid rgba(157,78,221,0.2)",position:"relative",overflow:"hidden"},children:[Array.from({length:6},(I,R)=>t.jsx("div",{style:{position:"absolute",width:"3px",height:"3px",background:$s[R],borderRadius:"50%",top:`${20+R*11%60}%`,left:`${10+R*14}%`,animation:`gm-float ${2+R*.3}s ease-in-out infinite`,animationDelay:`${R*.2}s`,opacity:.6}},`dot-${R}`)),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"1.5rem",fontWeight:"800",fontFamily:"Outfit",background:"linear-gradient(135deg, #FFD700, #FFA500, #FF6B6B)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",animation:"gm-neonPulse 2s ease-in-out infinite",letterSpacing:"0.5px"},children:"ðï¸ BOUTIQUE DES CADEAUX"}),t.jsxs("p",{style:{margin:"6px 0 0",fontSize:"0.88rem",color:"rgba(255,255,255,0.7)",fontWeight:500},children:["Offrir à ",t.jsx("span",{style:{color:"#FFD700",fontWeight:700},children:r})]})]}),t.jsx("button",{onClick:i,style:{background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.15)",borderRadius:"50%",width:"38px",height:"38px",display:"flex",alignItems:"center",justifyContent:"center",color:"white",cursor:"pointer",marginTop:"2px"},children:t.jsx(mt,{size:20})})]})]}),t.jsxs("div",{className:"custom-scrollbar",style:{padding:"18px 22px 22px",overflowY:"auto",flex:1},children:[t.jsxs("div",{style:{background:"linear-gradient(135deg, rgba(255,215,0,0.12), rgba(255,107,107,0.08))",border:"1.5px solid rgba(255,215,0,0.3)",borderRadius:"18px",padding:"14px 18px",marginBottom:"20px",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.55)",textTransform:"uppercase",letterSpacing:"1.5px",fontWeight:600},children:"Votre Solde"}),t.jsxs("div",{style:{fontSize:"1.5rem",fontWeight:"800",color:j<((h==null?void 0:h.cost)||0)?"#ff4d4d":"#FFD700",fontFamily:"Outfit"},children:[j," ",t.jsx("span",{style:{fontSize:"0.8rem",opacity:.7},children:"Meetips"})]})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[j<((h==null?void 0:h.cost)||0)&&t.jsx("button",{onClick:()=>u("/shop"),style:{fontSize:"0.75rem",background:"linear-gradient(135deg, #FFD700, #FFA500)",border:"none",color:"#1a0a2e",padding:"6px 12px",borderRadius:"10px",cursor:"pointer",fontWeight:700},children:"Recharger"}),t.jsx("div",{style:{fontSize:"2rem",animation:"gm-diamondSpin 3s ease-in-out infinite",perspective:"100px"},children:t.jsx(Jt,{size:20})})]})]}),t.jsxs("div",{style:{marginBottom:"18px"},children:[t.jsxs("h4",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.45)",textTransform:"uppercase",letterSpacing:"2px",fontWeight:600,display:"flex",alignItems:"center",gap:"8px",margin:"0 0 14px"},children:[t.jsx("span",{style:{color:"#FFD700"},children:"â¦"})," Choisir un cadeau ",t.jsx("span",{style:{color:"#FFD700"},children:"â¦"})]}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"10px"},children:g.map((I,R)=>{const O=$s[R%$s.length],E=j>=I.cost,$=(h==null?void 0:h.id)===I.id;return t.jsxs(ye.div,{whileHover:E?{scale:1.08,y:-3}:{},whileTap:E?{scale:.93}:{},onClick:()=>{E&&(mr(),x(I),k(null))},style:{background:$?`linear-gradient(160deg, ${O}30, rgba(20,10,40,0.85))`:E?`linear-gradient(160deg, ${O}15, rgba(20,10,40,0.9))`:"rgba(20,10,40,0.5)",border:$?`2.5px solid ${O}`:E?`1.5px solid ${O}44`:"1px solid rgba(255,255,255,0.05)",borderRadius:"18px",padding:"14px 6px 12px",display:"flex",flexDirection:"column",alignItems:"center",gap:"5px",cursor:E?"pointer":"not-allowed",opacity:E?1:.35,position:"relative",overflow:"hidden",boxShadow:$?`0 0 25px ${O}44, inset 0 0 15px ${O}15`:E?`0 4px 18px ${O}18`:"none",transition:"box-shadow 0.3s, border 0.3s",animation:$?"gm-selectedPulse 1.5s ease-in-out infinite":"none"},children:[E&&t.jsx("div",{style:{position:"absolute",inset:0,borderRadius:"18px",background:"linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.06) 45%, rgba(255,255,255,0.14) 50%, rgba(255,255,255,0.06) 55%, transparent 70%)",backgroundSize:"200% 100%",animation:"gm-shimmer 3s linear infinite",animationDelay:`${R*.5}s`,pointerEvents:"none"}}),E?t.jsx(kp,{gift:I,giftIdx:R,size:54}):t.jsx("div",{style:{fontSize:"2.2rem",filter:"grayscale(0.8)",opacity:.5},children:I.icon}),t.jsx("div",{style:{fontSize:"0.72rem",fontWeight:"700",color:$?"white":"rgba(255,255,255,0.9)",letterSpacing:"0.3px",textAlign:"center"},children:I.name}),t.jsxs("div",{style:{fontSize:"0.68rem",fontWeight:"700",color:"#FFD700",display:"flex",alignItems:"center",gap:"3px",background:$?"rgba(255,215,0,0.18)":"rgba(255,215,0,0.08)",padding:"3px 9px",borderRadius:"10px",border:"1px solid rgba(255,215,0,0.2)"},children:[I.cost," ",t.jsx(Jt,{size:14})]})]},I.id)})})]}),t.jsx("button",{onClick:()=>{var I;return(I=document.getElementById("gm-meetips-packs"))==null?void 0:I.scrollIntoView({behavior:"smooth"})},style:{width:"100%",padding:"12px",marginBottom:"18px",background:"transparent",border:"1.5px solid rgba(255,215,0,0.35)",borderRadius:"14px",color:"#FFD700",fontWeight:"700",cursor:"pointer",fontSize:"0.85rem",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",boxShadow:"0 0 12px rgba(255,215,0,0.06)"},children:"ð³ Recharger mon solde"}),t.jsxs("div",{id:"gm-meetips-packs",style:{scrollMarginTop:"10px"},children:[t.jsxs("h4",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.45)",textTransform:"uppercase",letterSpacing:"2px",fontWeight:600,display:"flex",alignItems:"center",gap:"8px",margin:"0 0 10px"},children:[t.jsx("span",{style:{color:"#FFD700"},children:"â¦"})," Acheter des Meetips ",t.jsx("span",{style:{color:"#FFD700"},children:"â¦"})]}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"8px"},children:[{id:"starter",amount:60,price:"10â¬"},{id:"regular",amount:95,price:"15â¬",popular:!0},{id:"pro",amount:130,price:"20â¬"},{id:"ultimate",amount:350,price:"50â¬"}].map((I,R)=>{const O=()=>{const $={starter:"https://buy.stripe.com/7sY9AS3LhdqJbQVa8iffy02",regular:"https://buy.stripe.com/eVq4gy1D94Ud2gl3JUffy03",pro:"https://buy.stripe.com/aFa9AS1D92M53kp4NYffy04",ultimate:"https://buy.stripe.com/cNieVc5TpfyRaMR4NYffy05"}[I.id];if(!$||$.includes("placeholder")){o.info("Lien de paiement non configuré. Contactez le support.");return}localStorage.setItem("paymentType","buy_pack"),localStorage.setItem("pendingPackId",I.id);const B=500,ee=700,te=(window.innerWidth-B)/2,K=(window.innerHeight-ee)/2;window.open($,"StripePayment",`width=${B},height=${ee},top=${K},left=${te},scrollbars=yes`)};return t.jsxs(ye.div,{whileHover:{scale:1.05,y:-2},whileTap:{scale:.95},onClick:O,style:{background:I.popular?"linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,107,0,0.1))":"linear-gradient(135deg, rgba(157,78,221,0.08), rgba(20,10,40,0.9))",border:I.popular?"2px solid rgba(255,215,0,0.5)":"1px solid rgba(157,78,221,0.2)",borderRadius:"14px",padding:"10px 4px",display:"flex",flexDirection:"column",alignItems:"center",gap:"3px",cursor:"pointer",position:"relative",overflow:"hidden",boxShadow:I.popular?"0 0 18px rgba(255,215,0,0.12)":"none",animation:I.popular?"gm-rainbowBorder 4s linear infinite":"none"},children:[I.popular&&t.jsx("div",{style:{position:"absolute",top:"-1px",right:"6px",background:"linear-gradient(135deg, #FFD700, #FFA500)",padding:"2px 6px",borderRadius:"0 0 6px 6px",fontSize:"0.5rem",fontWeight:"800",color:"#1a0a2e",letterSpacing:"0.5px"},children:"â"}),t.jsx("div",{style:{fontSize:"1rem",animation:"gm-diamondSpin 4s ease-in-out infinite",animationDelay:`${R*.5}s`},children:t.jsx(Jt,{size:18})}),t.jsx("div",{style:{fontWeight:"800",fontSize:"0.75rem",color:"#FFD700"},children:I.amount}),t.jsx("div",{style:{background:"linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.05)
977)",padding:"3px 8px",borderRadius:"10px",fontWeight:"700",fontSize:"0.6rem",border:"1px solid rgba(255,255,255,0.12)",color:"rgba(255,255,255,0.9)"},children:I.price})]},I.id)})})]})]}),t.jsxs("div",{style:{padding:"16px 22px calc(22px + env(safe-area-inset-bottom, 0px))",background:"linear-gradient(to top, rgba(10,0,21,0.98), rgba(10,0,21,0.85))",borderTop:"1px solid rgba(157,78,221,0.15)",display:"flex",flexDirection:"column",gap:"10px"},children:[S&&t.jsxs("div",{style:{color:"#ff4d4d",textAlign:"center",fontSize:"0.85rem",fontWeight:600},children:["â ï¸ ",S]}),t.jsx(ye.button,{whileHover:h&&!y&&j>=((h==null?void 0:h.cost)||0)?{scale:1.03,y:-1}:{},whileTap:h&&!y&&j>=((h==null?void 0:h.cost)||0)?{scale:.97}:{},disabled:!h||y||j<((h==null?void 0:h.cost)||0),onClick:()=>{Uo(),P()},style:{width:"100%",padding:"17px",borderRadius:"18px",background:h&&j>=((h==null?void 0:h.cost)||0)?"linear-gradient(135deg, #FFD700, #FFA500, #FF6B6B)":"linear-gradient(135deg, rgba(157,78,221,0.35), rgba(255,107,107,0.2), rgba(157,78,221,0.35))",border:h&&j>=((h==null?void 0:h.cost)||0)?"2px solid rgba(255,215,0,0.6)":"2px solid rgba(157,78,221,0.4)",color:h&&j>=((h==null?void 0:h.cost)||0)?"#1a0a2e":"rgba(255,255,255,0.75)",fontWeight:"800",fontSize:"1.05rem",cursor:h?"pointer":"default",opacity:y?.7:1,fontFamily:"Outfit",letterSpacing:"0.5px",boxShadow:h&&j>=((h==null?void 0:h.cost)||0)?"0 0 30px rgba(255,215,0,0.35), 0 6px 20px rgba(0,0,0,0.4)":"0 0 20px rgba(157,78,221,0.15), 0 4px 15px rgba(0,0,0,0.3)",transition:"all 0.3s",animation:h?"none":"gm-btnGlow 2.5s ease-in-out infinite"},children:y?"â³ Envoi...":h?`ð Offrir ${h.name} (${h.cost} M)`:"⦠Choisissez un cadeau â¦"})]})]})]}),document.body)},ll=({match:e,onClose:r})=>{const{user:i,profile:n}=gr(),o=Lt(),{isErox:a,isFriend:l,lightMode:d}=dr(),[p,u]=m.useState(!1),g=(n==null?void 0:n.is_premium)||!1;m.useEffect(()=>{!(e!=null&&e.is_bot)||!i||g||_7(i.id,e.id).then(Q=>{Q&&u(!0)})},[e,i,g]);const h=(a?e.erox_avatar_url:null)||(l?e.friend_avatar_url:null)||e.photo||e.avatar_url||null,[x,y]=m.useState(""),[_,S]=m.useState([]),[k,w]=m.useState(!1),[b,j]=m.useState(""),T=m.useRef(0),P=m.useRef(null),[I,R]=m.useState(!1),E=!i||!e?null:[i.id,e.id].sort().join("_");m.useEffect(()=>{if(!E||!i)return;const Q=async()=>{if(!i)return;const{error:F}=await D.from("messages").update({is_read:!0}).eq("receiver_id",i.id).eq("sender_id",e.id).is("is_read",!1);F?console.error("Error marking messages as read:",F):window.dispatchEvent(new Event("messages-read"))};(async()=>{const{data:F,error:A}=await D.from("messages").select("*").eq("conversation_id",E).order("created_at",{ascending:!0});if(A)console.error("Error fetching messages:",A);else if(S(F||[]),Q(),!g&&F&&F.length>0){const M=F[0],V=new Date(M.created_at).getTime();(Date.now()-V)/(1e3*60*60)>24&&u(!0)}})();const le=D.channel(`chat:${E}`).on("postgres_changes",{event:"INSERT",schema:"public",table:"messages",filter:`conversation_id=eq.${E}`},F=>{const A=F.new;S(M=>[...M,A]),A.receiver_id===i.id&&D.from("messages").update({is_read:!0}).eq("id",A.id).then(()=>{window.dispatchEvent(new Event("messages-read"))})}).subscribe();return()=>{D.removeChannel(le)}},[E,i]),m.useEffect(()=>{P.current&&(P.current.scrollTop=P.current.scrollHeight)},[_,b]);const $=async()=>{if(!x.trim()||!i)return;const Q=x;y("");const G={sender_id:i.id,receiver_id:e.id,conversation_id:E,content:Q,is_read:!1,created_at:new Date().toISOString()},{error:le}=await D.from("messages").insert(G);if(le)console.error("Error sending message:",le),y(Q);else if(S(F=>[...F,G]),await D.from("hidden_conversations").delete().eq("user_id",i.id).eq("match_id",e.id),e.is_bot){T.current+=1,j("");const F=[..._,G].map(A=>({role:A.sender_id===i.id?"user":"bot",content:A.content})).slice(-20);n1({botId:e.id,botName:e.name,botGender:e.gender,userId:i.id,userMessage:Q,personality:e.personality||"bienveillant",space:a?"EROX":l?"FRIEND":"EROS",userProfile:n,chatHistory:F,recommendedProfiles:[],messageCount:T.current,onTyping:A=>{w(A),A||j("")},onToken:(A,M)=>{j(M)},onReply:A=>{j(""),S(M=>[...M,A])}})}},B=async Q=>{if(te(!1),!i)return;const G={sender_id:i.id,receiver_id:e.id,conversation_id:E,content:"Message vocal",is_read:!1,created_at:new Date().toISOString(),type:"audio",audio_url:Q},{error:le}=await D.from("messages").insert(G);le?console.error("Error sending audio:",le):S(F=>[...F,G])},[ee,te]=m.useState(!1),[K,ne]=m.useState(!1),Re=t.jsxs(tr,{children:[t.jsx(ye.div,{initial:{opacity:0}
977,animate:{opacity:1},exit:{opacity:0},onClick:r,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.4)",backdropFilter:"blur(6px)",WebkitBackdropFilter:"blur(6px)",zIndex:1e4}}),t.jsxs(ye.div,{initial:{opacity:0,y:50,scale:.9},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:50,scale:.9},style:{position:"fixed",bottom:window.innerWidth<=768?"calc(80px + env(safe-area-inset-bottom, 0px))":"20px",right:window.innerWidth<=768?"10px":"20px",left:window.innerWidth<=768?"10px":"auto",width:window.innerWidth<=768?"auto":"400px",maxWidth:"calc(100vw - 20px)",height:window.innerWidth<=768?"calc(100vh - 160px - env(safe-area-inset-bottom, 0px))":"600px",maxHeight:"calc(100vh - 40px)",background:"var(--bg-deep)",borderRadius:"var(--radius-lg)",boxShadow:"0 10px 40px rgba(0,0,0,0.5)",display:"flex",flexDirection:"column",zIndex:10001,border:"1px solid rgba(255,255,255,0.1)",overflow:"hidden"},children:[t.jsxs("div",{style:{padding:"14px 16px",background:d?"linear-gradient(180deg, #f8f5f0 0%, #f3efe8 100%)":"linear-gradient(180deg, rgba(40, 35, 55, 0.98) 0%, rgba(30, 28, 45, 0.95) 100%)",display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:d?"1p
977x solid rgba(0,0,0,0.1)":"1px solid rgba(255,255,255,0.12)",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",cursor:"pointer"},onClick:()=>{r(),o(`/profile-view/${e.id}`)},children:[t.jsxs("div",{style:{position:"relative"},children:[t.jsx("img",{src:h,alt:e.name,style:{width:"44px",height:"44px",borderRadius:"50%",objectFit:"cover",border:"2px solid rgba(255,255,255,0.15)",boxShadow:"0 2px 8px rgba(0,0,0,0.3)"}}),t.jsx("div",{style:{position:"absolute",bottom:"1px",right:"1px",width:"11px",height:"11px",background:"#4CAF50",borderRadius:"50%",border:"2.5px solid rgba(30, 28, 45, 0.95)",boxShadow:"0 0 6px rgba(76, 175, 80, 0.5)"}})]}),t.jsxs("div",{children:[t.jsx("h4",{style:{margin:0,fontSize:"0.95rem",fontWeight:700,color:d?"#1A1510":"white",fontFamily:"Outfit"},children:e.name}),t.jsx("span",{style:{fontSize:"0.72rem",color:d?"#8C7A60":"rgba(255,255,255,0.5)",fontWeight:500},children:"En ligne ⢠Voir le profil"})]})]}),t.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[i&&e&&t.jsx(IS,{currentUserId:i.id,targetUserId:e.id,onBlock:r}),t.jsx("button",{onClick:r,style:{width:"32px",height:"32px",borderRadius:"50%",background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.1)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"rgba(255,255,255,0.6)",transition:"all 0.2s"},children:t.jsx(mt,{size:16})})]})]}),t.jsxs("div",{ref:P,style:{flex:1,padding:"16px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"10px",background:d?"linear-gradient(180deg, #f5f1ec 0%, #eee9e2 100%)":"linear-gradient(180deg, rgba(18, 16, 30, 0.95) 0%, rgba(12, 10, 22, 0.98) 100%)"},children:[_.length===0&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flex:1,gap:"12px"},children:[t.jsx("div",{style:{width:"64px",height:"64px",borderRadius:"50%",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.06)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.6rem"},children:"ð"}),t.jsxs("p",{style:{textAlign:"center",color:"rgba(255,255,255,0.4)",fontSize:"0.85rem",fontFamily:"Outfit",margin:0},children:["Dites bonjour à ",e.name]})]}),_.map(Q=>{var A;const G=Q.sender_id===(i==null?void 0:i.id),le=M=>{const V=/\[([^\]]+)\]\(profile:([^)]+)\)/g,H=[];let N=0,Z;for(;(Z=V.exec(M))!==null;)Z.index>N&&H.push(M.slice(N,Z.index)),H.push(t.jsx("span",{onClick:()=>{r(),o(`/profile-view/${Z[2]}`)},style:{color:"#8b5cf6",cursor:"pointer",textDecoration:"underline",fontWeight:"600"},children:Z[1]},Z.index)),N=Z.index+Z[0].length;return N<M.length&&H.push(M.slice(N)),H.length>0?H:M},F=(A=Q.content)==null?void 0:A.match(/^\[GIFT:([^:]+):([^:]+):([^\]]+)\]$/);if(F){const[,M,V,H]=F;return t.jsxs("div",{style:{alignSelf:"center",maxWidth:"75%",textAlign:"center"},children:[t.jsxs("div",{style:{padding:"16px 24px",borderRadius:"20px",background:"linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,140,0,0.08))",border:"1px solid rgba(255,215,0,0.25)",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",boxShadow:"0 4px 20px rgba(255,215,0,0.1)"},children:[t.jsx("span",{style:{fontSize:"2rem"},children:V}),t.jsx("span",{style:{fontSize:"0.82rem",color:"rgba(255,255,255,0.7)",fontWeight:500},children:G?`Vous avez offert ${H}`:`${e.name||"Quelqu'un"} vous a offert ${H}`})]}),t.jsx("span",{style:{fontSize:"0.6rem",color:"rgba(255,255,255,0.3)",display:"block",marginTop:"3px"},children:new Date(Q.created_at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]},Q.id||Math.random())}return t.jsxs("div",{style:{alignSelf:G?"flex-end":"flex-start",maxWidth:"80%"},children:[t.jsx("div",{className:"chat-bubble",style:{padding:"10px 14px",borderRadius:G?"16px 16px 4px 16px":"16px 16px 16px 4px",background:G?"linear-gradient(135deg, var(--primary), rgba(212, 196, 168, 0.85))":d?"#ffffff":"rgba(255,255,255,0.08)",color:G?"#1a1a2e":d?"#1A1510":"rgba(255,255,255,0.9)",fontSize:"0.88rem",fontWeight:G?500:400,lineHeight:1.45,border:G?"none":d?"1p
977x solid rgba(0,0,0,0.08)":"1px solid rgba(255,255,255,0.06)",boxShadow:G?"0 2px 10px rgba(212, 196, 168, 0.2)":d?"0 2px 8px rgba(0,0,0,0.06)":"none"},children:Q.type==="audio"||Q.audio_url?t.jsx(Sd,{audioUrl:Q.audio_url,color:"var(--primary)"}):le(Q.content)}),t.jsxs("span",{style:{fontSize:"0.6rem",color:d?"#8C7A60":"rgba(255,255,255,0.3)",display:"block",marginTop:"3px",textAlign:G?"right":"left",paddingLeft:G?0:"4px",paddingRight:G?"4px":0},children:[new Date(Q.created_at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),!G&&e.is_bot&&t.jsx(Kn,{size:10,style:{marginLeft:"4px",opacity:.5}})]})]},Q.id||Math.random())}),k&&t.jsxs("div",{style:{alignSelf:"flex-start",maxWidth:"80%"},children:[t.jsxs("div",{style:{padding:"10px 15px",borderRadius:"16px 16px 16px 4px",background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.06)",color:"white",fontSize:"0.88rem",minHeight:"20px",minWidth:"60px"},children:[b?t.jsxs("span",{children:[b,t.jsx("span",{style:{display:"inline-block",width:"2px",height:"14px",background:"#a855f7",marginLeft:"2px",animation:"blink 0.8s infinite",verticalAlign:"text-bottom"}})]}):t.jsxs("div",{style:{display:"flex",gap:"4px",alignItems:"center"},children:[t.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",background:"rgba(255,255,255,0.4)",animation:"botDot 1.4s infinite ease-in-out",animationDelay:"0s"}}),t.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",background:"rgba(255,255,255,0.4)",animation:"botDot 1.4s infinite ease-in-out",animationDelay:"0.2s"}}),t.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",background:"rgba(255,255,255,0.4)",animation:"botDot 1.4s infinite ease-in-out",animationDelay:"0.4s"}})]}),t.jsx("style",{children:` 978 @keyframes botDot { 979 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 980 40% { transform: scale(1); opacity: 1; } 981 } 982 @keyframes blink { 983 0%, 100% { opacity: 1; } 984 50% { opacity: 0; } 985 } 986 .chat-input-field::placeholder { 987 color: ${d?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.45)"} !important; 988 } 989 `})]}),t.jsxs("span",{style:{fontSize:"0.6rem",color:"rgba(255,255,255,0.3)",display:"flex",alignItems:"center",gap:"3px",marginTop:"3px"},children:[t.jsx(Kn,{size:10})," ",e.name," ",b?"écrit...":"réfléchit..."]})]})]}),p&&t.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.9)",backdropFilter:"blur(5px)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"30px",textAlign:"center",zIndex:10},children:[t.jsx(Fr,{size:48,color:"#8a2be2",style:{marginBottom:"20px"}}),t.jsx("h3",{style:{fontSize:"1.3rem",marginBottom:"10px"},children:"Période d'essai terminée"}),t.jsxs("p",{style:{color:"var(--text-muted)",fontSize:"0.9rem",marginBottom:"25px",lineHeight:1.5},children:["Vous avez pu discuter avec ",e.name," pendant 36h gratuitement.",t.jsx("br",{}),"Passez Premium pour envoyer des messages illimités !"]}),t.jsxs("button",{onClick:()=>{r(),o("/subscription")},style:{background:"linear-gradient(135deg, #8a2be2 0%, #ff007f 100%)",border:"none",padding:"12px 30px",borderRadius:"30px",color:"white",fontWeight:"bold",cursor:"pointer",display:"flex",alignItems:"center",gap:"10px",boxShadow:"0 5px 20px rgba(138, 43, 226, 0.4)"},children:[t.jsx(ni,{size:20})," Passer Premium"]}),t.jsx("button",{onClick:r,style:{background:"transparent",border:"none",color:"var(--text-muted)",marginTop:"15px",cursor:"pointer",fontSize:"0.8rem"},children:"Peut-être plus tard"})]}),t.jsxs("div",{style:{padding:"10px 14px 12px",background:d?"linear-gradient(180deg, #f8f5f0 0%, #f3efe8 100%)":"linear-gradient(180deg, rgba(35, 32, 50, 0.95) 0%, rgba(28, 25, 42, 0.98) 100%)",borderTop:d?"1px solid rgba(0,0,0,0.08)":"1px solid rgba(255,255,255,0.1)",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)"},children:[t.jsx(tr,{children:K&&t.jsx(ye.div,{initial:{height:0,opacity:0}
989,animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},style:{background:"rgba(255,255,255,0.06)",borderRadius:"14px",marginBottom:"8px",border:"1px solid rgba(255,255,255,0.1)",overflow:"hidden"},children:t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(8, 1fr)",gap:"2px",padding:"8px"},children:["ð","ð","â¤ï¸","ð","ð¥°","ð","ð¥","ð","ð","ð¤©","ð","ð¤","ð","â¨","ð","ð","ð","ð","ð¯","ð¹","ð","ð¸","ðµ","ð"].map((Q,G)=>t.jsx("button",{onClick:()=>{mr(),y(le=>le+Q)},style:{background:"none",border:"none",fontSize:"1.2rem",cursor:"pointer",padding:"4px",borderRadius:"8px",transition:"all 0.15s"},onMouseEnter:le=>{le.currentTarget.style.background="rgba(255,255,255,0.1)",le.currentTarget.style.transform="scale(1.25)"},onMouseLeave:le=>{le.currentTarget.style.background="none",le.currentTarget.style.transform="scale(1)"},children:Q},G))})})}),ee?t.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center",justifyContent:"center"},children:[t.jsx("div",{style:{flex:1},children:t.jsx(p5,{onSave:B,bucketName:"audio-messages"})}),t.jsx("button",{onClick:()=>te(!1),style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",padding:"5px"},children:t.jsx(mt,{size:20})})]}):t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx("button",{onClick:()=>ne(Q=>!Q),style:{width:"36px",height:"36px",minWidth:"36px",borderRadius:"50%",flexShrink:0,background:K?"rgba(138,43,226,0.2)":"rgba(255,255,255,0.06)",border:K?"1px solid rgba(138,43,226,0.4)":"1px solid rgba(255,255,255,0.08)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},children:t.jsx(cs,{size:18,color:K?"#8a2be2":"rgba(255,255,255,0.5)"})}),t.jsx("button",{onClick:()=>{te(!0),ne(!1)},style:{width:"36px",height:"36px",minWidth:"36px",borderRadius:"50%",flexShrink:0,background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.08)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},children:t.jsx(ls,{size:18,color:"rgba(255,255,255,0.5)"})}),t.jsx("button",{onClick:()=>{Uo(),R(!0),ne(!1)},style:{width:"36px",height:"36px",minWidth:"36px",borderRadius:"50%",flexShrink:0,background:"rgba(233,30,99,0.12)",border:"1px solid rgba(233,30,99,0.2)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},onMouseEnter:Q=>{Q.currentTarget.style.background="rgba(233,30,99,0.25)",Q.currentTarget.style.transform="scale(1.1)"},onMouseLeave:Q=>{Q.currentTarget.style.background="rgba(233,30,99,0.12)",Q.currentTarget.style.transform="scale(1)"},title:"Offrir un cadeau",children:t.jsx(Li,{size:18,color:"#E91E63"})}),t.jsx("input",{type:"text",value:x,onChange:Q=>y(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&$(),placeholder:"Ãcrivez un message...",className:"chat-input-field",style:{flex:1,minWidth:0,background:d?"#ffffff":"rgba(255,255,255,0.10)",border:d?"2px solid rgba(0,0,0,0.15)":"1px solid rgba(255,255,255,0.15)",padding:"10px 16px",borderRadius:"22px",color:d?"#1A1510":"white",outline:"none",fontSize:"0.88rem",fontFamily:"Outfit",transition:"border-color 0.2s"},onFocus:Q=>{ne(!1),Q.target.style.borderColor="rgba(212, 196, 168, 0.4)"},onBlur:Q=>{Q.target.style.borderColor="rgba(255,255,255,0.1)"}}),t.jsx("button",{onClick:()=>{mr(),$()},style:{width:"42px",height:"42px",minWidth:"42px",minHeight:"42px",flexShrink:0,borderRadius:"50%",background:"linear-gradient(135deg, var(--primary), #c9a96e)",border:"none",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",boxShadow:"0 2px 10px rgba(212, 196, 168, 0.3)",transition:"all 0.2s"},children:t.jsx(ji,{size:18,color:"#1a1a2e"})})]})]})]})]});return t.jsxs(t.Fragment,{children:[Re,I&&t.jsx(u5,{receiverId:e.id,receiverName:e.name||e.display_name||"Utilisateur",onClose:()=>R(!1),onSuccess:async Q=>{R(!1);const G=`[GIFT:${Q.id}:${Q.icon||Q.emoji||"ð"}:${Q.name}]`,le={sender_id:i.id,receiver_id:e.id,conversation_id:E,content:G,is_read:!1,created_at:new Date().toISOString()},{error:F}=await D.from("messages").insert(le);if(!F&&(S(A=>[...A,le]),e.is_bot)){const A=`[L'utilisateur vient de t'offrir un cadeau : "${Q.name}". Réagis avec joie et gratitude de manière naturelle et spontanée, en 1-2 phrases maximum. Sois touchée/touché par ce geste. N'utilise pas de crochets ni de format spécial.]`;setTimeout(()=>{n1({botId:e.id,botName:e.name,botGender:e.gender,userId:i.id,userMessage:A,personality:e.personality||"bienveillant",space:e.space==="EROX"?"EROX":e.space==="FRIEND"?"FRIEND":"EROS",userProfile:n,chatHistory:[..._,le].map(M=>({role:M.sender_id===i.id?"user":"bot",content:M.content})).slice(-20),recommendedProfiles:[],messageCount:((T==null?void 0:T.current)||0)+1,onTyping:M=>{w(M),M||j("")},onToken:(M,V)=>{j(V)},onReply:M=>{j(""),S(V=>[...V,M])}})},1500)}}})]})},Sg=15,E7=({item:e,price:r,onClose:i,userId:n,meetipsBalance:o,onMeetipsUnlock:a})=>{const l=Lt(),[d,p]=m.useState(!1),[u,g]=m.useState(!1),[h,x]=m.useState(null),[y,_]=m.useState(!1),S=o>=Sg;Tr.useEffect(()=>{const b=j=>{j.data==="PAYMENT_COMPLETE"&&(_(!1),i())};return window.addEventListener("message",b),()=>window.removeEventListener("message",b)},[i]);const k=async()=>
989{if(!(!S||u)){g(!0),x(null);try{const b=await wi.unlockProfile(n,e.id);b.success?a(b.newBalance):x(b.error||"Erreur lors du déblocage")}catch{x("Une erreur est survenue")}finally{g(!1)}}},w=()=>{p(!0),x(null);{x("Configuration manquante : Lien Stripe introuvable."),p(!1);return}};return t.jsx("div",{style:{position:"fixed",inset:0,zIndex:1e3,background:"rgba(0,0,0,0.85)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},children:t.jsxs(ye.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},style:{background:"#141422",width:"100%",maxWidth:"420px",borderRadius:"24px",overflow:"hidden",border:"1px solid rgba(255,255,255,0.08)",boxShadow:"0 25px 60px rgba(0,0,0,0.6)"},children:[t.jsxs("div",{style:{padding:"18px 20px",display:"flex",justifyContent:"space-between",alignItems:"center",borderBottom:"1px solid rgba(255,255,255,0.06)"},children:[t.jsxs("h3",{style:{margin:0,display:"flex",alignItems:"center",gap:"8px",fontSize:"1rem",color:"white"},children:[t.jsx(fi,{size:18,color:"#4CAF50"})," Débloquer le profil"]}),t.jsx("button",{onClick:i,style:{background:"none",border:"none",color:"rgba(255,255,255,0.5)",cursor:"pointer"},children:t.jsx(mt,{size:22})})]}),t.jsx("div",{style:{padding:"24px 22px"},children:y?t.jsxs("div",{style:{textAlign:"center",padding:"20px 0"},children:[t.jsx("div",{style:{fontSize:"3rem",marginBottom:"16px",animation:"pulse 2s infinite"},children:"â³"}),t.jsx("h2",{style:{fontSize:"1.2rem",marginBottom:"8px",color:"white"},children:"Finalisation..."}),t.jsx("p",{style:{color:"rgba(255,255,255,0.5)",fontSize:"0.85rem",marginBottom:"20px"},children:"La fenêtre de paiement sécurisé est ouverte."}),t.jsx("button",{onClick:()=>_(!1),style:{background:"rgba(255,255,255,0.08)",border:"none",padding:"10px 20px",borderRadius:"20px",color:"rgba(255,255,255,0.6)",cursor:"pointer",fontSize:"0.85rem"},children:"J'ai annulé"})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{textAlign:"center",marginBottom:"22px"},children:[t.jsx("div",{style:{width:"72px",height:"72px",borderRadius:"50%",overflow:"hidden",margin:"0 auto 12px",border:"2px solid var(--gold)"},children:t.jsx("img",{src:e.photo||e.avatar_url,alt:"Profile",style:{width:"100%",height:"100%",objectFit:"cover",filter:"blur(12px)",transform:"scale(1.2)"}})}),t.jsxs("h2",{style:{fontSize:"1.2rem",margin:"0 0 4px",color:"white"},children:["Débloquer ",e.name||"ce profil"]}),t.jsx("p",{style:{color:"rgba(255,255,255,0.45)",fontSize:"0.82rem",margin:0},children:"Accédez à toutes ses photos et informations"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px",marginBottom:"18px"},children:[t.jsxs("button",{onClick:k,disabled:!S||u,style:{width:"100%",padding:"16px 18px",borderRadius:"16px",background:S?"linear-gradient(135deg, rgba(255,215,0,0.12), rgba(255,180,0,0.06))":"rgba(255,255,255,0.02)",border:S?"1px solid rgba(255,215,0,0.3)":"1px solid rgba(255,255,255,0.06)",cursor:S?"pointer":"not-allowed",display:"flex",alignItems:"center",gap:"14px",textAlign:"left",transition:"all 0.2s",position:"relative",overflow:"hidden"},children:[S&&t.jsx("div",{style:{position:"absolute",top:"8px",right:"10px",background:"rgba(255,215,0,0.15)",padding:"2px 8px",borderRadius:"8px",fontSize:"0.6rem",fontWeight:"700",color:"#FFD700",textTransform:"uppercase",letterSpacing:"0.5px"},children:"â¡ Instantané"}),t.jsx("div",{style:{width:"44px",height:"44px",borderRadius:"12px",background:S?"rgba(255,215,0,0.15)":"rgba(255,255,255,0.05)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t.jsx(Jt,{size:22})}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{fontSize:"1rem",fontWeight:"700",color:S?"#FFD700":"rgba(255,255,255,0.3)",marginBottom:"2px"},children:u?"Déblocage...":`${Sg} Meetips`}),t.jsx("div",{style:{fontSize:"0.75rem",color:S?"rgba(255,255,255,0.5)":"rgba(255,255,255,0.25)"},children:S?`Votre solde : ${o} Meetips`:`Solde insuffisant (${o}/${Sg})`})]})]}),!S&&t.jsxs("button",{onClick:()=>{i(),l("/shop")},style:{background:"none",border:"none",color:"#FFD700",fontSize:"0.78rem",cursor:"pointer",textAlign:"center",padding:"2px 0",marginTop:"-4px"},children:[t.jsx(ys,{size:12,style:{verticalAlign:"middle",marginRight:"4px"}}),"Recharger mes Meetips"]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",margin:"2px 0"},children:[t.jsx("div",{style:{flex:1,height:"1px",background:"rgba(255,255,255,0.06)"}}),t.jsx("span",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.25)",textTransform:"uppercase",letterSpacing:"1px"},children:"ou"}),t.jsx("div",{style:{flex:1,height:"1px",background:"rgba(255,255,255,0.06)"}})]}),t.jsxs("button",{onClick:w,disabled:d,style:{width:"100%",padding:"16px 18px",borderRadius:"16px",background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.08)",cursor:"pointer",display:"flex",alignItems:"center",gap:"14px",textAlign:"left",transition:"all 0.2s"},children:[t.jsx("div",{style:{width:"44px",height:"44px",borderRadius:"12px",background:"rgba(99,102,241,0.12)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t.jsx(Vs,{size:20,color:"#818cf8"})}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{fontSize:"1rem",fontWeight:"700",color:"white",marginBottom:"2px"},children:d?"Ouverture...":"2,90 â¬"}),t.jsx("div",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.4)"},children:"Paiement sécurisé par carte"})]})]})]}),h&&t.jsx("div",{style:{background:"rgba(255,0,0,0.08)",color:"#ff6b6b",padding:"10px 14px",borderRadius:"10px",fontSize:"0.82rem",marginBottom:"10px",textAlign:"center"},children:h}),t.jsx("p",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.25)",textAlign:"center",margin:0},children:"Le déblocage est définitif pour ce profil"})]})})]})})},R7=({userId:e,isErox:r,isFriend:i,refreshKey:n=0})=>{const[o,a]=m.useState([]);return m.useEffect(()=>{e&&(async()=>{try{const d=await wi.getReceivedGifts(e);let p=f0;r?p=x0:i&&(p=m0);const u={};d.forEach(h=>{p.find(y=>
989y.id===h.gift_type)&&(u[h.gift_type]=(u[h.gift_type]||0)+1)});const g=Object.keys(u).map(h=>({...p.find(y=>y.id===h),count:u[h]}));a(g)}catch(d){console.error("Error fetching gifts:",d)}})()},[e,r,n]),o.length===0?t.jsxs("div",{style:{marginTop:"20px",paddingTop:"20px",borderTop:"1px solid rgba(255,255,255,0.1)",textAlign:"center"},children:[t.jsx("h4",{style:{fontSize:"0.8rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:"10px"},children:"Cadeaux Reçus"}),t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.4)",fontStyle:"italic"},children:"Aucun cadeau reçu pour l'instant"})]}):t.jsxs("div",{style:{marginTop:"20px",paddingTop:"20px",borderTop:"1px solid rgba(255,255,255,0.1)"},children:[t.jsx(g0,{}),t.jsx("h4",{style:{fontSize:"0.8rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:"10px",textAlign:"center"},children:"Cadeaux Reçus"}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"15px",justifyContent:"center"},children:o.map((l,d)=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px",background:"rgba(255,255,255,0.05)",padding:"5px 10px",borderRadius:"15px"},children:[t.jsx(kp,{gift:l,giftIdx:d,size:28}),t.jsx("span",{style:{fontWeight:"bold",fontSize:"0.9rem"},children:l.count})]},l.id))})]})},TS=({message:e,type:r="success",onClose:i,duration:n=4e3})=>{m.useEffect(()=>{if(n){const a=setTimeout(i,n);return()=>clearTimeout(a)}},[n,i]);const o=r==="success";return t.jsxs("div",{style:{position:"fixed",top:"30px",left:"50%",transform:"translateX(-50%)",background:o?"rgba(30, 200, 100, 0.95)":"rgba(255, 77, 77, 0.95)",color:"white",padding:"15px 25px",borderRadius:"50px",boxShadow:"0 10px 40px rgba(0,0,0,0.3)",zIndex:1e4,display:"flex",alignItems:"center",gap:"15px",backdropFilter:"blur(10px)",border:"1px solid rgba(255,255,255,0.2)",minWidth:"300px",maxWidth:"90vw",animation:"slideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275)"},children:[o?t.jsx(ms,{size:24,color:"white"}):t.jsx(Km,{size:24,color:"white"}),t.jsx("span",{style:{fontSize:"0.95rem",fontWeight:"500",flex:1},children:e}),t.jsx("button",{onClick:i,style:{background:"none",border:"none",color:"white",cursor:"pointer",display:"flex"},children:t.jsx(mt,{size:18})}),t.jsx("style",{children:` 990 @keyframes slideDown { 991 from { transform: translate(-50%, -100%); opacity: 0; } 992 to { transform: translate(-50%, 0); opacity: 1; } 993 } 994 `})]})};var h5={};(function e(r,i,n,o){var a=!!(r.Worker&&r.Blob&&r.Promise&&r.OffscreenCanvas&&r.OffscreenCanvasRenderingContext2D&&r.HTMLCanvasElement&&r.HTMLCanvasElement.prototype.transferControlToOffscreen&&r.URL&&r.URL.createObjectURL),l=typeof Path2D=="function"&&typeof DOMMatrix=="function",d=function(){if(!r.OffscreenCanvas)return!1;try{var F=new OffscreenCanvas(1,1),A=F.getContext("2d");A.fillRect(0,0,1,1);var M=F.transferToImageBitmap();A.createPattern(M,"no-repeat")}catch{return!1}return!0}();function p(){}function u(F){var A=i.exports.Promise,M=A!==void 0?A:r.Promise;return typeof M=="function"?new M(F):(F(p,p),null)}var g=function(F,A){return{transform:function(M){if(F)return M;if(A.has(M))return A.get(M);var V=new OffscreenCanvas(M.width,M.height),H=V.getContext("2d");return H.drawImage(M,0,0),A.set(M,V),V},clear:function(){A.clear()}}}(d,new Map),h=function(){var F=Math.floor(16.666666666666668),A,M,V={},H=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(A=function(N){var Z=Math.random();return V[Z]=requestAnimationFrame(function ae(X){H===X||H+F-1<X?(H=X,delete V[Z],N()):V[Z]=requestAnimationFrame(ae)}),Z},M=function(N){V[N]&&cancelAnimationFrame(V[N])}):(A=function(N){return setTimeout(N,F)},M=function(N){return clearTimeout(N)}),{frame:A,cancel:M}}(),x=function(){var F,A,M={};function V(H){function N(Z,ae){H.postMessage({options:Z||{},callback:ae})}H.init=function(ae){var X=ae.transferControlToOffscreen();H.postMessage({canvas:X},[X])},H.fire=function(ae,X,he){if(A)return N(ae,null),A;var Ae=Math.random().toString(36).slice(2);return A=u(function(ze){function ue(xe){xe.data.callback===Ae&&(delete M[Ae],H.removeEventListener("message",ue),A=null,g.clear(),he(),ze())}H.addEventListener("message",ue),N(ae,Ae),M[Ae]=ue.bind(null,{data:{callback:Ae}})}),A},H.reset=function(){H.postMessage({reset:!0});for(var ae in M)M[ae](),delete M[ae]}}return function(){if(F)return F;if(!n&&a){var H=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(` 995`);try{F=new Worker(URL.createObjectURL(new Blob([H])))}catch(N){return typeof console<"u"&&typeof console.warn=="function"&&console.warn("ð Could not load worker",N),null}V(F)}return F}}(),y={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function _(F,A){return A?A(F):F}function S(F){return F!=null}function k(F,A,M){return _(F&&S(F[A])?F[A]:y[A],M)}function w(F){return F<0?0:Math.floor(F)}function b(F,A){return Math.floor(Math.random()*(A-F))+F}function j(F){return parseInt(F,16)}function T(F){return F.map(P)}function P(F){var A=String(F).replace(/[^0-9a-f]/gi,"");return A.length<6&&(A=A[0]+A[0]+A[1]+A[1]+A[2]+A[2]),{r:j(A.substring(0,2)),g:j(A.substring(2,4)),b:j(A.substring(4,6))}}function I(F){var A=k(F,"origin",Object);return A.x=k(A,"x",Number),A.y=k(A,"y",Number),A}function R(F){F.width=document.documentElement.clientWidth,F.height=document.documentElement.clientHeight}function O(F){var A=F.getBoundingClientRect();F.width=A.width,F.height=A.height}function E(F){var A=document.createElement("canvas");
vendor: 4,886 bytes, line 995
995return A.style.position="fixed",A.style.top="0px",A.style.left="0px",A.style.pointerEvents="none",A.style.zIndex=F,A}function $(F,A,M,V,H,N,Z,ae,X){F.save(),F.translate(A,M),F.rotate(N),F.scale(V,H),F.arc(0,0,1,Z,ae,X),F.restore()}function B(F){var A=F.angle*(Math.PI/180),M=F.spread*(Math.PI/180);return{x:F.x,y:F.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:F.startVelocity*.5+Math.random()*F.startVelocity,angle2D:-A+(.5*M-Math.random()*M),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:F.color,shape:F.shape,tick:0,totalTicks:F.ticks,decay:F.decay,drift:F.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:F.gravity*3,ovalScalar:.6,scalar:F.scalar,flat:F.flat}}function ee(F,A){A.x+=Math.cos(A.angle2D)*A.velocity+A.drift,A.y+=Math.sin(A.angle2D)*A.velocity+A.gravity,A.velocity*=A.decay,A.flat?(A.wobble=0,A.wobbleX=A.x+10*A.scalar,A.wobbleY=A.y+10*A.scalar,A.tiltSin=0,A.tiltCos=0,A.random=1):(A.wobble+=A.wobbleSpeed,A.wobbleX=A.x+10*A.scalar*Math.cos(A.wobble),A.wobbleY=A.y+10*A.scalar*Math.sin(A.wobble),A.tiltAngle+=.1,A.tiltSin=Math.sin(A.tiltAngle),A.tiltCos=Math.cos(A.tiltAngle),A.random=Math.random()+2);var M=A.tick++/A.totalTicks,V=A.x+A.random*A.tiltCos,H=A.y+A.random*A.tiltSin,N=A.wobbleX+A.random*A.tiltCos,Z=A.wobbleY+A.random*A.tiltSin;if(F.fillStyle="rgba("+A.color.r+", "+A.color.g+", "+A.color.b+", "+(1-M)+")",F.beginPath(),l&&A.shape.type==="path"&&typeof A.shape.path=="string"&&Array.isArray(A.shape.matrix))F.fill(Q(A.shape.path,A.shape.matrix,A.x,A.y,Math.abs(N-V)*.1,Math.abs(Z-H)*.1,Math.PI/10*A.wobble));else if(A.shape.type==="bitmap"){var ae=Math.PI/10*A.wobble,X=Math.abs(N-V)*.1,he=Math.abs(Z-H)*.1,Ae=A.shape.bitmap.width*A.scalar,ze=A.shape.bitmap.height*A.scalar,ue=new DOMMatrix([Math.cos(ae)*X,Math.sin(ae)*X,-Math.sin(ae)*he,Math.cos(ae)*he,A.x,A.y]);ue.multiplySelf(new DOMMatrix(A.shape.matrix));var xe=F.createPattern(g.transform(A.shape.bitmap),"no-repeat");xe.setTransform(ue),F.globalAlpha=1-M,F.fillStyle=xe,F.fillRect(A.x-Ae/2,A.y-ze/2,Ae,ze),F.globalAlpha=1}else if(A.shape==="circle")F.ellipse?F.ellipse(A.x,A.y,Math.abs(N-V)*A.ovalScalar,Math.abs(Z-H)*A.ovalScalar,Math.PI/10*A.wobble,0,2*Math.PI):$(F,A.x,A.y,Math.abs(N-V)*A.ovalScalar,Math.abs(Z-H)*A.ovalScalar,Math.PI/10*A.wobble,0,2*Math.PI);else if(A.shape==="star")for(var ke=Math.PI/2*3,Pe=4*A.scalar,Ce=8*A.scalar,Me=A.x,Le=A.y,rt=5,Fe=Math.PI/rt;rt--;)Me=A.x+Math.cos(ke)*Ce,Le=A.y+Math.sin(ke)*Ce,F.lineTo(Me,Le),ke+=Fe,Me=A.x+Math.cos(ke)*Pe,Le=A.y+Math.sin(ke)*Pe,F.lineTo(Me,Le),ke+=Fe;else F.moveTo(Math.floor(A.x),Math.floor(A.y)),F.lineTo(Math.floor(A.wobbleX),Math.floor(H)),F.lineTo(Math.floor(N),Math.floor(Z)),F.lineTo(Math.floor(V),Math.floor(A.wobbleY));return F.closePath(),F.fill(),A.tick<A.totalTicks}function te(F,A,M,V,H){var N=A.slice(),Z=F.getContext("2d"),ae,X,he=u(function(Ae){function ze(){ae=X=null,Z.clearRect(0,0,V.width,V.height),g.clear(),H(),Ae()}function ue(){n&&!(V.width===o.width&&V.height===o.height)&&(V.width=F.width=o.width,V.height=F.height=o.height),!V.width&&!V.height&&(M(F),V.width=F.width,V.height=F.height),Z.clearRect(0,0,V.width,V.height),N=N.filter(function(xe){return ee(Z,xe)}),N.length?ae=h.frame(ue):ze()}ae=h.frame(ue),X=ze});return{addFettis:function(Ae){return N=N.concat(Ae),he},canvas:F,promise:he,reset:function(){ae&&h.cancel(ae),X&&X()}}}function K(F,A){var M=!F,V=!!k(A||{},"resize"),H=!1,N=k(A,"disableForReducedMotion",Boolean),Z=a&&!!k(A||{},"useWorker"),ae=Z?x():null,X=M?R:O,he=F&&ae?!!F.__confetti_initialized:!1,Ae=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,ze;function ue(ke,Pe,Ce){for(var Me=k(ke,"particleCount",w),Le=k(ke,"angle",Number),rt=k(ke,"spread",Number),Fe=k(ke,"startVelocity",Number),ft=k(ke,"decay",Number),De=k(ke,"gravity",Number),Be=k(ke,"drift",Number),re=k(ke,"colors",T),He=k(ke,"ticks",Number),be=k(ke,"shapes"),nt=k(ke,"scalar"),J=!!k(ke,"flat"),Ie=I(ke),z=Me,Y=[],ce=F.width*Ie.x,ve=F.height*Ie.y;z--;)Y.push(B({x:ce,y:ve,angle:Le,spread:rt,startVelocity:Fe,color:re[z%re.length],shape:be[b(0,be.length)],ticks:He,decay:ft,gravity:De,drift:Be,scalar:nt,flat:J}));return ze?ze.addFettis(Y):(ze=te(F,Y,X,Pe,Ce),ze.promise)}function xe(ke){var Pe=N||k(ke,"disableForReducedMotion",Boolean),Ce=k(ke,"zIndex",Number);if(Pe&&Ae)return u(function(Fe){Fe()});M&&ze?F=ze.canvas:M&&!F&&(F=E(Ce),document.body.appendChild(F)),V&&!he&&X(F);var Me={width:F.width,height:F.height};ae&&!he&&ae.init(F),he=!0,ae&&(F.__confetti_initialized=!0);function Le(){if(ae){var Fe={getBoundingClientRect:function(){if(!M)return F.getBoundingClientRect()}};X(Fe),ae.postMessage({resize:{width:Fe.width,height:Fe.height}});return}Me.width=Me.height=null}function rt(){ze=null,V&&(H=!1,r.removeEventListener("resize",Le)),M&&F&&(document.body.contains(F)&&document.body.removeChild(F),F=null,he=!1)}
995return V&&!H&&(H=!0,r.addEventListener("resize",Le,!1)),ae?ae.fire(ke,Me,rt):ue(ke,Me,rt)}return xe.reset=function(){ae&&ae.reset(),ze&&ze.reset()},xe}var ne;function Re(){return ne||(ne=K(null,{useWorker:!0,resize:!0})),ne}function Q(F,A,M,V,H,N,Z){var ae=new Path2D(F),X=new Path2D;X.addPath(ae,new DOMMatrix(A));var he=new Path2D;return he.addPath(X,new DOMMatrix([Math.cos(Z)*H,Math.sin(Z)*H,-Math.sin(Z)*N,Math.cos(Z)*N,M,V])),he}function G(F){if(!l)throw new Error("path confetti are not supported in this browser");var A,M;typeof F=="string"?A=F:(A=F.path,M=F.matrix);var V=new Path2D(A),H=document.createElement("canvas"),N=H.getContext("2d");if(!M){for(var Z=1e3,ae=Z,X=Z,he=0,Ae=0,ze,ue,xe=0;xe<Z;xe+=2)for(var ke=0;ke<Z;ke+=2)N.isPointInPath(V,xe,ke,"nonzero")&&(ae=Math.min(ae,xe),X=Math.min(X,ke),he=Math.max(he,xe),Ae=Math.max(Ae,ke));ze=he-ae,ue=Ae-X;var Pe=10,Ce=Math.min(Pe/ze,Pe/ue);M=[Ce,0,0,Ce,-Math.round(ze/2+ae)*Ce,-Math.round(ue/2+X)*Ce]}return{type:"path",path:A,matrix:M}}function le(F){var A,M=1,V="#000000",H='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof F=="string"?A=F:(A=F.text,M="scalar"in F?F.scalar:M,H="fontFamily"in F?F.fontFamily:H,V="color"in F?F.color:V);var N=10*M,Z=""+N+"px "+H,ae=new OffscreenCanvas(N,N),X=ae.getContext("2d");X.font=Z;var he=X.measureText(A),Ae=Math.ceil(he.actualBoundingBoxRight+he.actualBoundingBoxLeft),ze=Math.ceil(he.actualBoundingBoxAscent+he.actualBoundingBoxDescent),ue=2,xe=he.actualBoundingBoxLeft+ue,ke=he.actualBoundingBoxAscent+ue;Ae+=ue+ue,ze+=ue+ue,ae=new OffscreenCanvas(Ae,ze),X=ae.getContext("2d"),X.font=Z,X.fillStyle=V,X.fillText(A,xe,ke);var Pe=1/M;return{type:"bitmap",bitmap:ae.transferToImageBitmap(),matrix:[Pe,0,0,Pe,-Ae*Pe/2,-ze*Pe/2]}}i.exports=function(){return Re().apply(this,arguments)},i.exports.reset=function(){Re().reset()},i.exports.create=K,i.exports.shapeFromPath=G,i.exports.shapeFromText=le})(function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}(),h5,!1);const cc=h5.exports;h5.exports.create;const Rh=({sections:e,details:r,match:i,targetTags:n,mode:o="full"})=>{var h,x;const[a,l]=m.useState(!1),d=((h=i.compatibility)==null?void 0:h.total)??((x=i.compatibility)==null?void 0:x.score)??Math.round(e.reduce((y,_)=>{var S;return y+(((S=r==null?void 0:r[_.id])==null?void 0:S.score)||0)},0)/(e.length||1)),p=d>=60?"#4CAF50":d>=40?"#FF9800":"#F44336",u=d>=60?"76,175,80":d>=40?"255,152,0":"244,67,54",g=(y,_)=>{var b;const S=(r==null?void 0:r[y.id])||{score:0,commonItems:[]},k=((b=S.commonItems)==null?void 0:b.map(j=>j.id))||[],w=y.items.filter(j=>k.includes(j.id));return t.jsxs(ye.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},transition:{delay:_*.08},style:{background:`linear-gradient(180deg, ${y.color}11 0%, rgba(0,0,0,0) 100%)`,borderTop:`1px solid ${y.color}44`,padding:"18px",borderRadius:"16px",marginBottom:"12px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"12px"},children:[t.jsx("div",{style:{width:"36px",height:"36px",borderRadius:"50%",background:`linear-gradient(135deg, ${y.color}33 0%, rgba(0,0,0,0.4) 100%)`,border:`2px solid ${y.color}`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t.jsx(y.icon,{size:18,color:"white",strokeWidth:1.5})}),t.jsx("h5",{style:{color:y.color,margin:0,fontSize:"0.9rem",fontWeight:"600",flex:1},children:y.title}),t.jsxs("div",{style:{background:y.color,color:"black",fontWeight:"bold",fontSize:"0.75rem",padding:"3px 10px",borderRadius:"12px",boxShadow:"0 2px 5px rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.2)"},children:[S.score||0,"%"]})]}),w.length>0?t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:w.map((j,T)=>{var I;const P=(I=S.commonItems)==null?void 0:I.some(R=>R.id===j.id);return t.jsxs(ye.div,{initial:{scale:.8,opacity:0}
995,animate:{scale:1,opacity:1},transition:{delay:_*.08+T*.03},style:{background:P?y.color:"rgba(255,255,255,0.1)",border:P?"none":`1px solid ${y.color}44`,padding:"6px 12px",borderRadius:"20px",display:"inline-flex",alignItems:"center",gap:"6px",color:P?"#000":"white",fontSize:"0.8rem",fontWeight:P?"bold":"normal",whiteSpace:"nowrap",boxShadow:P?`0 2px 10px ${y.color}66`:"0 2px 5px rgba(0,0,0,0.2)"},children:[j.icon?t.jsx(j.icon,{size:14,color:P?"#000":y.color}):null,t.jsx("span",{children:j.label})]},j.id)})}):t.jsx("p",{style:{color:"rgba(255,255,255,0.3)",fontStyle:"italic",fontSize:"0.85rem",margin:0},children:"Aucun pictogramme dans cette catégorie"})]},y.id)};return o==="badge"?t.jsxs(t.Fragment,{children:[t.jsxs(ye.button,{whileTap:{scale:.9},onClick:y=>{y.stopPropagation(),l(!0)},"aria-label":"Voir le détail de compatibilité",style:{background:`rgba(${u},0.25)`,border:`1.5px solid rgba(${u},0.6)`,backdropFilter:"blur(10px)",padding:"8px 16px",borderRadius:"30px",display:"flex",alignItems:"center",gap:"8px",color:"white",cursor:"pointer",boxShadow:`0 4px 15px rgba(${u},0.3)`},children:[t.jsx("div",{style:{position:"relative",width:"24px",height:"24px"},children:t.jsxs("svg",{viewBox:"0 0 36 36",style:{transform:"rotate(-90deg)"},children:[t.jsx("path",{d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",fill:"none",stroke:"#444",strokeWidth:"4"}),t.jsx("path",{d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",fill:"none",stroke:p,strokeWidth:"4",strokeDasharray:`${d}, 100`})]})}),t.jsxs("span",{style:{fontWeight:"bold",fontSize:"1rem"},children:[d,"%"]})]}),Xa.createPortal(t.jsx(tr,{children:a&&t.jsxs(ye.div,{initial:{opacity:0,y:100},animate:{opacity:1,y:0},exit:{opacity:0,y:100},onClick:y=>{y.stopPropagation(),l(!1)},style:{position:"fixed",inset:0,zIndex:1e4,background:"rgba(0,0,0,0.95)",backdropFilter:"blur(20px)",display:"flex",flexDirection:"column",overflowY:"auto"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"calc(env(safe-area-inset-top, 12px) + 16px) 20px 0",position:"sticky",top:0,zIndex:10,background:"linear-gradient(180deg, rgba(0,0,0,0.98) 60%, transparent 100%)",paddingBottom:"15px"},children:[t.jsx("button",{onClick:y=>{y.stopPropagation(),l(!1)},"aria-label":"Retour",style:{background:"rgba(255,255,255,0.1)",border:"1px solid rgba(255,255,255,0.15)",borderRadius:"50%",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",color:"white",cursor:"pointer",flexShrink:0},children:t.jsx(Hr,{size:22})}),t.jsx("h2",{style:{color:"white",textAlign:"center",margin:0,flex:1,fontSize:"1.2rem",fontFamily:"Outfit"},children:"Détail de Compatibilité"}),t.jsx("button",{onClick:y=>{y.stopPropagation(),l(!1)},"aria-label":"Fermer",style:{background:"rgba(255,255,255,0.1)",border:"1px solid rgba(255,255,255,0.15)",borderRadius:"50%",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",color:"white",cursor:"pointer",flexShrink:0},children:t.jsx(mt,{size:22})})]}),t.jsx("div",{onClick:y=>y.stopPropagation(),style:{padding:"10px 20px 40px"},children:t.jsx(Rh,{sections:e,details:r,match:i,targetTags:n,mode:"full"})})]})}),document.body)]}):t.jsxs("div",{style:{width:"100%"},children:[t.jsx("div",{style:{display:"flex",justifyContent:"space-around",alignItems:"flex-start",marginBottom:"25px"},children:e.map((y,_)=>{const S=(r==null?void 0:r[y.id])||{score:0};return t.jsxs(ye.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:_*.1},style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"},children:[t.jsx("div",{style:{width:"55px",height:"55px",borderRadius:"50%",background:`linear-gradient(135deg, ${y.color}22 0%, rgba(0,0,0,0.5) 100%)`,border:`2px solid ${y.color}`,display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:"blur(5px)"},children:t.jsx(y.icon,{size:22,color:"white",strokeWidth:1.5})}),t.jsxs("div",{style:{background:y.color,color:"black",fontWeight:"bold",fontSize:"0.7rem",padding:"2px 6px",borderRadius:"12px",marginTop:"-10px",zIndex:10,minWidth:"30px",textAlign:"center",boxShadow:"0 2px 5px rgba(0,0,0,0.5)",border:"1px solid rgba(255,255,255,0.2)"},children:[S.score||0,"%"]}),t.jsx("span",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.5)"},children:y.title})]},y.id)})}),e.map((y,_)=>g(y,_))]})},I7="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400' viewB
995ox='0 0 400 400'%3E%3Cdefs%3E%3ClinearGradient id='bg' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0%25' stop-color='%23162033'/%3E%3Cstop offset='100%25' stop-color='%230d1520'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='400' height='400' fill='url(%23bg)'/%3E%3Ccircle cx='200' cy='140' r='62' fill='%23253a52'/%3E%3Cellipse cx='200' cy='320' rx='105' ry='85' fill='%23253a52'/%3E%3Ccircle cx='200' cy='140' r='55' fill='%231e3044'/%3E%3Crect x='145' y='85' width='110' height='25' rx='12' fill='%23253a52'/%3E%3C/svg%3E",T7="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400' viewBox='0 0 400 400'%3E%3Cdefs%3E%3ClinearGradient id='bg' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0%25' stop-color='%23261628'/%3E%3Cstop offset='100%25' stop-color='%23180d1e'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='400' height='400' fill='url(%23bg)'/%3E%3Cellipse cx='200' cy='155' rx='68' ry='72' fill='%23382040'/%3E%3Cellipse cx='200' cy='320' rx='95' ry='82' fill='%23382040'/%3E%3Ccircle cx='200' cy='145' r='55' fill='%23301838'/%3E%3Cellipse cx='155' cy='130' rx='22' ry='75' fill='%23382040'/%3E%3Cellipse cx='245' cy='130' rx='22' ry='75' fill='%23382040'/%3E%3C/svg%3E",A7="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400' viewBox='0 0 400 400'%3E%3Cdefs%3E%3ClinearGradient id='bg' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0%25' stop-color='%231a1525'/%3E%3Cstop offset='100%25' stop-color='%230d0a1a'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='400' height='400' fill='url(%23bg)'/%3E%3Ccircle cx='200' cy='145' r='58' fill='%23302540'/%3E%3Cellipse cx='200' cy='320' rx='100' ry='82' fill='%23302540'/%3E%3C/svg%3E",P7=e=>e==="male"?I7:e==="female"?T7:A7,F7=({match:e,isLocked:r,isLiked:i,isPremium:n,isBlocked:o,favorites:a,onToggleLike:l,onPass:d,onSelect:p,onUnlock:u,onOpenChat:g,onGift:h,onPlayVoice:x,unreadCount:y})=>{const _=Lt(),[S,k]=m.useState(0),[w,b]=m.useState(!1),j=P7(e.gender),T=e.photo||e.avatar_url||null;let P=[T].filter(Boolean);if(e.photos&&Array.isArray(e.photos)){const E=e.photos.filter($=>$&&$!==T);P=[...P,...E]}const I=P.slice(0,3),R=!w&&I[S]||!w&&T||j,O=E=>{E.target.src=j,b(!0)};return e.is_bot?t.jsxs("div",{style:{display:"flex",flexDirection:"column",borderRadius:"24px",overflow:"hidden",border:"1px solid rgba(168,85,247,0.2)",background:"rgba(168,85,247,0.03)",transition:"transform 0.3s, box-shadow 0.3s",position:"relative",height:"500px",boxShadow:"0 4px 30px rgba(168,85,247,0.15)"},children:[t.jsxs("div",{style:{flex:"0 0 66.6%",position:"relative",cursor:"pointer",overflow:"hidden"},onClick:()=>p(e),children:[t.jsx("img",{src:R,alt:e.name,onError:O,style:{width:"100%",height:"100%",objectFit:"cover",transition:"transform 0.5s"},className:"hover-zoom"}),e.animated_photo_url&&t.jsx("video",{src:e.animated_photo_url,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",zIndex:0}}),t.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.2) 30%, rgba(0,0,0,0) 60%)"}}),t.jsxs("div",{style:{position:"absolute",top:"12px",left:"12px",background:"linear-gradient(135deg, rgba(168,85,247,0.9), rgba(139,92,246,0.9))",backdropFilter:"blur(10px)",padding:"5px 12px",borderRadius:"20px",display:"flex",alignItems:"center",gap:"6px",boxShadow:"0 2px 10px rgba(168,85,247,0.4)"},children:[t.jsx(Kn,{size:14,color:"white"}),t.jsx("span",{style:{fontSize:"0.7rem",fontWeight:"700",color:"white",letterSpacing:"0.5px",textTransform:"uppercase"},children:"Animateur"})]}),t.jsx("div",{style:{position:"absolute",top:"15px",right:"15px",width:"10px",height:"10px",borderRadius:"50%",background:"#22c55e",boxShadow:"0 0 10px rgba(34,197,94,0.8)",animation:"pulse 2s ease-in-out infinite"}}),t.jsxs("div",{style:{position:"absolute",bottom:0,left:0,right:0,padding:"20px"},children:[t.jsx("h3",{style:{fontSize:"1.6rem",margin:0,fontWeight:"700",display:"flex",alignItems:"center",gap:"8px",textShadow:"0 2px 8px rgba(0,0,0,0.8)"},children:e.name}),t.jsx("p",{style:{color:"rgba(255,255,255,0.7)",fontSize:"0.85rem",marginTop:"4px",fontStyle:"italic"},children:e.personality==="coach"?"ðª Coach motivation":e.personality==="fun"?"ð Ambiance fun":e.personality==="mysterieux"?"ð Mystérieux·se":e.personality==="seducteur"?"ð¥ Séducteur·rice":"ð¤ Bienveillant·e"})]})]}),t.jsxs("div",{style:{flex:"0 0 33.4%",padding:"16px 20px",background:"linear-gradient(180deg, rgba(10,0,20,0.95) 0%, rgba(20,5,40,0.95) 100%)",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[t.jsx("p",{style:{color:"rgba(255,255,255,0.6)",fontSize:"0.8rem",lineHeight:1.5,margin:0,display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.bio||"Je suis là pour t'aider à briller et trouver ton bon
995heur sur Kinetic ! ð«"}),t.jsxs("button",{onClick:()=>p(e),style:{width:"100%",padding:"12px",background:"linear-gradient(135deg, #a855f7, #8b5cf6)",border:"none",borderRadius:"14px",color:"white",fontWeight:"700",fontSize:"0.85rem",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",boxShadow:"0 4px 15px rgba(168,85,247,0.3)",transition:"all 0.2s"},children:[t.jsx(Qt,{size:16})," Discuter"]})]}),t.jsx("style",{children:` 996 @keyframes pulse { 997 0%, 100% { opacity: 1; transform: scale(1); } 998 50% { opacity: 0.6; transform: scale(1.3); } 999 } 1000 `})]}):t.jsxs("div",{className:"glass-panel",style:{display:"flex",flexDirection:"column",borderRadius:"24px",overflow:"hidden",border:"1px solid rgba(255,255,255,0.08)",background:r?"rgba(0,0,0,0.3)":"rgba(255,255,255,0.03)",transition:"transform 0.3s, box-shadow 0.3s",position:"relative",height:"500px"},children:[t.jsxs("div",{style:{flex:1,position:"relative",cursor:"pointer",overflow:"hidden"},onClick:()=>!r&&p(e),children:[t.jsx("img",{src:R,alt:e.name,onError:O,style:{width:"100%",height:"100%",objectFit:"cover",filter:r?"blur(15px)":"none",transition:"transform 0.5s"},className:"hover-zoom"}),e.animated_photo_url&&!r&&S===0&&t.jsx("video",{src:e.animated_photo_url,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",zIndex:0}}),t.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 50%)"}}),!r&&t.jsxs("div",{style:{position:"absolute",top:"15px",right:"15px",background:"rgba(0,0,0,0.6)",backdropFilter:"blur(10px)",border:"1px solid rgba(255,215,0,0.3)",padding:"5px 10px",borderRadius:"15px",display:"flex",alignItems:"center",gap:"5px"},children:[t.jsx(Xt,{size:14,color:"var(--gold)"}),t.jsxs("span",{style:{fontWeight:"bold",fontSize:"0.9rem",color:"white"},children:[e.matchScore||e.score||0,"%"]})]}),t.jsxs("div",{style:{position:"absolute",bottom:"0",left:"0",right:"0",padding:"20px"},children:[t.jsxs("h3",{style:{fontSize:"1.8rem",margin:0,display:"flex",alignItems:"center",gap:"8px",textShadow:"0 2px 5px rgba(0,0,0,0.5)"},children:[e.name,", ",e.age,e.verification_status==="verified"&&t.jsx(fi,{size:20,fill:"#26A69A",color:"#103030"})]}),t.jsxs("p",{style:{color:"rgba(255,255,255,0.8)",fontSize:"0.95rem",marginTop:"5px",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(Qn,{size:14})," ",e.job||"Membre Mystère"]}),t.jsxs("p",{style:{color:"rgba(255,255,255,0.65)",fontSize:"0.85rem",marginTop:"3px",display:"flex",alignItems:"center",gap:"5px"},children:["ð ",e.city||"Non renseignée",e.distance!==void 0?`, ${e.distance<1?(e.distance*1e3).toFixed(0)+" m":e.distance.toFixed(1)+" km"}`:""]})]})]}),t.jsxs("div",{style:{padding:"15px",background:"rgba(0,0,0,0.4)",display:"flex",justifyContent:"space-between",alignItems:"center",borderTop:"1px solid rgba(255,255,255,0.05)"},children:[t.jsx("div",{style:{display:"flex",gap:"8px"},children:I.map((E,$)=>t.jsx("div",{onClick:B=>{B.preventDefault(),B.stopPropagation(),k($)},style:{width:"30px",height:"30px",borderRadius:"8px",overflow:"hidden",border:S===$?"1px solid var(--gold)":"1px solid rgba(255,255,255,0.2)",cursor:"pointer"},children:t.jsx("img",{src:E||j,onError:B=>{B.target.src=j},style:{width:"100%",height:"100%",objectFit:"cover"}})},$))}),t.jsxs("div",{style:{display:"flex",gap:"10px"},children:[t.jsx("button",{onClick:E=>{E.preventDefault(),E.stopPropagation(),d(e.id)},style:{width:"40px",height:"40px",borderRadius:"50%",background:o?"rgba(76, 175, 80, 0.2)":"rgba(255,255,255,0.1)",border:o?"1px solid #4CAF50":"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"background 0.2s"},title:o?"Réintégrer":"Passer",className:o?"hover-bg-green":"hover-bg-red",children:o?t.jsx(kn,{size:20,color:"#4CAF50"}
1000):t.jsx(ip,{size:20,color:"#ff4d4d"})}),t.jsx("button",{onClick:E=>{E.stopPropagation(),l(e.id)},style:{width:"40px",height:"40px",borderRadius:"50%",background:i?"var(--primary)":"rgba(255,255,255,0.1)",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},title:"Liker",children:t.jsx(Bt,{size:20,fill:i?"white":"none",color:"white"})}),e.voice_bio_url&&x&&t.jsx("button",{onClick:E=>{E.stopPropagation(),x(e)},style:{width:"40px",height:"40px",borderRadius:"50%",background:"linear-gradient(135deg, rgba(138,43,226,0.3), rgba(233,30,99,0.2))",border:"1.5px solid rgba(138,43,226,0.5)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},title:"Ãcouter la bio vocale",className:"hover-bg-purple",children:t.jsx(ls,{size:20,color:"#a855f7"})}),t.jsx("button",{onClick:E=>{E.stopPropagation(),!r&&p(e)},style:{width:"40px",height:"40px",borderRadius:"50%",background:"var(--gradient-gold)",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 10px rgba(255,215,0,0.3)"},title:"Détails",children:t.jsx(Pr,{size:20,color:"black"})})]})]}),r&&t.jsxs("div",{style:{position:"absolute",inset:0,background:"linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.85) 60%, rgba(10,5,30,0.95) 100%)",backdropFilter:"blur(6px)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",zIndex:10,gap:"6px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",background:"rgba(255,215,0,0.12)",border:"1px solid rgba(255,215,0,0.25)",backdropFilter:"blur(10px)",padding:"6px 16px",borderRadius:"20px",marginBottom:"8px",animation:"pulseScore 2.5s ease-in-out infinite"},children:[t.jsx(Xt,{size:16,color:"#FFD700"}),t.jsxs("span",{style:{fontWeight:"800",fontSize:"1rem",background:"linear-gradient(135deg, #FFD700, #FFA500)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:[e.matchScore||e.score||0,"% compatible"]})]}),t.jsx("div",{style:{fontSize:"2.8rem",marginBottom:"4px",animation:"floatDiamond 3s ease-in-out infinite",filter:"drop-shadow(0 0 15px rgba(255,215,0,0.4))"},children:t.jsx(Jt,{size:24})}),t.jsx("p",{style:{color:"white",fontWeight:"800",fontSize:"1.1rem",margin:"0 0 2px",letterSpacing:"0.3px"},children:"Profil Mystère"}),t.jsx("p",{style:{color:"rgba(255,255,255,0.45)",fontSize:"0.75rem",margin:"0 0 14px",textAlign:"center",padding:"0 30px"},children:"Débloquez pour voir ses photos et infos"}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px",width:"80%"},children:[t.jsxs("button",{onClick:()=>u(e),style:{background:"linear-gradient(135deg, #FFD700, #FFA500)",border:"none",padding:"13px 20px",borderRadius:"16px",fontWeight:"800",cursor:"pointer",width:"100%",color:"#1a1a2e",fontSize:"0.95rem",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",boxShadow:"0 4px 20px rgba(255,215,0,0.35), 0 0 40px rgba(255,215,0,0.1)",transition:"all 0.25s ease",letterSpacing:"0.3px"},children:[t.jsx(Jt,{size:18}),n?"Voir le profil":"15 Meetips"]}),!n&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",width:"100%"},children:[t.jsx("div",{style:{flex:1,height:"1px",background:"rgba(255,255,255,0.1)"}}),t.jsx("span",{style:{fontSize:"0.65rem",color:"rgba(255,255,255,0.3)",textTransform:"uppercase",letterSpacing:"1px",whiteSpace:"nowrap"},children:"ou"}),t.jsx("div",{style:{flex:1,height:"1px",background:"rgba(255,255,255,0.1)"}})]}),!n&&t.jsxs("button",{onClick:()=>_("/subscription"),style:{background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.7)",padding:"11px 20px",borderRadius:"14px",fontWeight:"600",cursor:"pointer",width:"100%",fontSize:"0.82rem",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",transition:"all 0.2s"},children:[t.jsx(ni,{size:14,color:"#FFD700"})," Tout débloquer â Premium"]})]}),t.jsx("style",{children:` 1001 @keyframes floatDiamond { 1002 0%, 100% { transform: translateY(0) rotate(0deg); } 1003 25% { transform: translateY(-6px) rotate(-3deg); } 1004 75% { transform: translateY(-3px) rotate(3deg); } 1005 } 1006 @keyframes pulseScore { 1007 0%, 100% { box-shadow: 0 0 8px rgba(255,215,0,0.15); } 1008 50% { box-shadow: 0 0 20px rgba(255,215,0,0.35), 0 0 40px rgba(255,215,0,0.1); } 1009 } 1010 `})]})]})},o1=({variant:e="stat",count:r=1,isMobile:i=!1})=>{const n=Array.from({length:r},(o,a)=>a);return e==="stat"?n.map(o=>t.jsxs("div",{style:{flex:"1 1 45%",minWidth:i?"calc(50% - 6px)":"140px",background:"rgba(255,255,255,0.03)",borderRadius:"20px",padding:i?"16px 14px":"20px 18px",position:"relative",overflow:"hidden"},children:[t.jsx("div",{className:"skeleton",style:{width:"38px",height:"38px",borderRadius:"12px",marginBottom:"10px"}}),t.jsx("div",{className:"skeleton",style:{width:"50px",height:"28px",borderRadius:"8px",marginBottom:"8px"}}),t.jsx("div",{className:"skeleton",style:{width:"80px",height:"12px",borderRadius:"6px"}})]},o)):e==="profile"?t.jsxs("div",{style:{width:"100%",height:"100%",minHeight:"400px",background:"rgba(255,255,255,0.03)",borderRadius:"24px",overflow:"hidden",position:"relative"},children:[t.jsx("div",{className:"skeleton",style:{width:"100%",height:"65%",borderRadius:"0"}}),t.jsxs("div",{style:{padding:"20px"},children:[t.jsx("div",{className:"skeleton",style:{width:"60%",height:"24px",borderRadius:"8px",marginBottom:"12px"}}),t.jsx("div",{className:"skeleton",style:{width:"90%",height:"14px",borderRadius:"6px",marginBottom:"8px"}}),t.jsx("div",{className:"skeleton",style:{width:"70%",height:"14px",borderRadius:"6px"}})]})]}):e==="event"?n.map(o=>t.jsxs("div",{style:{flex:"0 0 auto",width:i?"155px":"180px",background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.06)",borderRadius:"16px",overflow:"hidden"},children:[t.jsx("div",{className:"skeleton",style:{height:"78px",borderRadius:"0"}}),t.jsx("div",{style:{padding:"10px 12px"},children:t.jsx("div",{className:"skeleton",style:{width:"80%",height:"12px",borderRadius:"6px"}})})]},o)):null},yi=44,s1=5,a1=({value:e,min:r=18,max:i=99,onChange:n,label:o,color:a="#1a1a2e"})=>{const l=m.useRef(null),d=m.useRef({isDragging:!1,startY:0,startOffset:0}),[p,u]=m.useState(0),g=m.useRef(null),h=m.useRef(0),x=m.useRef(0),y=m.useRef(0),_=[];for(let R=r;R<=i;
1010R++)_.push(R);const S=Math.floor(s1/2),k=m.useCallback(R=>-(R-r)*yi,[r]),w=m.useCallback((R,O=0)=>{let E=R+O*8;const $=0,B=-(i-r)*yi;E=Math.max(B,Math.min($,E));const ee=Math.round(-E/yi),te=-ee*yi,K=r+ee,ne=R,Re=Date.now(),Q=300,G=()=>{const le=Date.now()-Re,F=Math.min(1,le/Q),A=1-Math.pow(1-F,3),M=ne+(te-ne)*A;u(M),F<1?g.current=requestAnimationFrame(G):(u(te),K>=r&&K<=i&&K!==e&&(n==null||n(K)))};g.current&&cancelAnimationFrame(g.current),g.current=requestAnimationFrame(G)},[r,i,e,n]);m.useEffect(()=>{u(k(e))},[e,k]);const b=m.useCallback(R=>{R.stopPropagation(),g.current&&cancelAnimationFrame(g.current);const O=R.touches[0];d.current={isDragging:!0,startY:O.clientY,startOffset:p},x.current=O.clientY,y.current=Date.now(),h.current=0},[p]),j=m.useCallback(R=>{if(R.stopPropagation(),R.preventDefault(),!d.current.isDragging)return;const O=R.touches[0],E=O.clientY-d.current.startY,$=d.current.startOffset+E,B=Date.now(),ee=B-y.current;ee>0&&(h.current=(O.clientY-x.current)/ee),x.current=O.clientY,y.current=B;const te=yi,K=-(i-r)*yi-yi,ne=Math.max(K,Math.min(te,$));u(ne)},[i,r]),T=m.useCallback(R=>{R.stopPropagation(),d.current.isDragging&&(d.current.isDragging=!1,w(p,h.current*100))},[p,w]),P=m.useCallback(R=>{R.stopPropagation(),R.preventDefault(),g.current&&cancelAnimationFrame(g.current),d.current={isDragging:!0,startY:R.clientY,startOffset:p},h.current=0;const O=$=>{if(!d.current.isDragging)return;const B=$.clientY-d.current.startY,ee=d.current.startOffset+B,te=yi,K=-(i-r)*yi-yi;u(Math.max(K,Math.min(te,ee)))},E=()=>{d.current.isDragging=!1,w(p),window.removeEventListener("mousemove",O),window.removeEventListener("mouseup",E)};window.addEventListener("mousemove",O),window.addEventListener("mouseup",E)},[p,i,r,w]),I=s1*yi;return t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px"},children:[o&&t.jsx("div",{style:{fontSize:"0.7rem",color:"rgba(26,26,46,0.5)",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.5px"},children:o}),t.jsxs("div",{ref:l,onTouchStart:b,onTouchMove:j,onTouchEnd:T,onMouseDown:P,style:{width:"72px",height:`${I}px`,overflow:"hidden",position:"relative",borderRadius:"14px",background:"rgba(0,0,0,0.15)",cursor:"grab",userSelect:"none",WebkitUserSelect:"none",touchAction:"none"},children:[t.jsx("div",{style:{position:"absolute",top:`${S*yi}px`,left:"4px",right:"4px",height:`${yi}px`,borderRadius:"10px",background:"rgba(0,0,0,0.2)",border:`2px solid ${a}`,pointerEvents:"none",zIndex:1}}),t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:`${S*yi}px`,background:"linear-gradient(180deg, rgba(255,255,255,0.6) 0%, transparent 100%)",pointerEvents:"none",zIndex:2}}),t.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:`${S*yi}px`,background:"linear-gradient(0deg, rgba(255,255,255,0.6) 0%, transparent 100%)",pointerEvents:"none",zIndex:2}}),t.jsx("div",{style:{position:"absolute",top:`${S*yi}px`,left:0,right:0,transform:`translateY(${p}px)`,willChange:"transform"},children:_.map(R=>{const O=(R-r)*yi+p,E=Math.abs(O)/yi,$=Math.max(.15,1-E*.3),B=Math.max(.7,1-E*.1);return t.jsx("div",{style:{height:`${yi}px`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:E<.5?"1.3rem":"1rem",fontWeight:E<.5?800:500,color:a,opacity:$,transform:`scale(${B})`,fontFamily:"Outfit, sans-serif",transition:"font-size 0.1s",pointerEvents:"none"},children:R},R)})})]})]})},l1=({children:e,onClick:r,style:i,className:n=""})=>{const[o,a]=m.useState(!1),l=m.useCallback(d=>{a(!0),setTimeout(()=>a(!1),400),r&&r(d)},[r]);return t.jsxs("button",{onClick:l,className:`hub-btn ${n}`,style:{...i,transform:o?"scale(0.94)":"scale(1)",transition:"transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s, border-color 0.3s"},children:[t.jsx("div",{className:"hub-btn-glow"}),e]})},d1=({isErox:e=!1,isFriend:r=!1,favoritesCount:i=0,passedCount:n=0,previewPhotos:o=[],matchCount:a=0,onRefresh:l,onViewFavorites:d,onViewReceivedLikes:p,onViewPassed:u,onEditCriteria:g,onViewBlocked:h,onViewMap:x,matchedCount:y=0,onViewMatches:_,likesReceivedCount:S=0,distFilter:k=100,setDistFilter:w,ageFilter:b={min:18,max:99},setAgeFilter:j,genderFilter:T="all",setGenderFilter:P,onRefreshGP
1010S:I,isLocating:R=!1})=>{const[O,E]=m.useState(!1),{lightMode:$}=dr(),B=typeof window<"u"&&window.innerWidth<768,ee=e?{a:"#cc2222",al:"#e63333",ad:"#991111",rgb:"204,34,34",g:"rgba(204,34,34,0.4)"}:r?{a:"#26A69A",al:"#4DB6AC",ad:"#00796B",rgb:"38,166,154",g:"rgba(38,166,154,0.4)"}:{a:"#D4B896",al:"#E8D5B7",ad:"#B8956A",rgb:"212,184,150",g:"rgba(212,184,150,0.45)"},te=o.length>0?[...o,...o,...o]:[],K=[{value:"female",label:"Femme"},{value:"male",label:"Homme"},{value:"all",label:"Tous"}],ne=(k-5)/195*100,Re=(b.min-18)/62*100,Q=(b.max-18)/62*100,G=$?"#3D3528":"#1a1a2e",le=$?"rgba(61,53,40,0.7)":"rgba(26,26,46,0.6)",F=$?"rgba(61,53,40,0.35)":"rgba(26,26,46,0.3)",A=$?"rgba(61,53,40,0.12)":"rgba(26,26,46,0.15)",M=$?"rgba(61,53,40,0.45)":"rgba(26,26,46,0.5)";return t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",padding:"0 16px",paddingTop:"86px",paddingBottom:"130px",height:"100%",overflowY:"auto",WebkitOverflowScrolling:"touch",width:"100%",maxWidth:"440px",margin:"0 auto",gap:"10px"},children:[t.jsxs("div",{style:{width:"100%",borderRadius:"22px",background:`linear-gradient(145deg, ${ee.al}cc 0%, ${ee.a}bb 50%, ${ee.ad}aa 100%)`,position:"relative",overflow:"visible",boxShadow:`0 8px 28px ${ee.g}, inset 0 1px 0 rgba(255,255,255,0.15)`,padding:"14px 18px 16px"},children:[t.jsx("div",{className:"shimmer-bar"}),te.length>0&&t.jsxs("div",{style:{overflow:"hidden",marginBottom:"6px",position:"relative",marginLeft:"-16px",marginRight:"-16px"},children:[t.jsx("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:"40px",background:`linear-gradient(90deg, ${ee.al}, transparent)`,zIndex:2,pointerEvents:"none"}}),t.jsx("div",{style:{position:"absolute",right:0,top:0,bottom:0,width:"40px",background:`linear-gradient(270deg, ${ee.a}cc, transparent)`,zIndex:2,pointerEvents:"none"}}),t.jsx("div",{className:"photo-scroll-strip",style:{display:"flex",gap:"6px",width:"max-content",padding:"2px 0"},children:te.map((V,H)=>t.jsx("div",{style:{width:"52px",height:"52px",borderRadius:"50%",backgroundImage:`url(${V})`,backgroundSize:"cover",backgroundPosition:"center",border:"2px solid rgba(255,255,255,0.45)",boxShadow:"0 2px 6px rgba(0,0,0,0.2)",flexShrink:0}},H))})]}),!B&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"6px"},children:[t.jsx("button",{onClick:V=>{V.stopPropagation(),I==null||I()},disabled:R,style:{width:"38px",height:"38px",borderRadius:"10px",flexShrink:0,border:`1.5px solid ${F}`,background:"rgba(255,255,255,0.2)",color:G,cursor:R?"wait":"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(Gb,{size:18,className:R?"spin-icon":""})}),t.jsxs("div",{style:{flex:1,position:"relative",height:"36px",display:"flex",alignItems:"center"},children:[t.jsx("div",{style:{position:"absolute",left:0,right:0,height:"10px",borderRadius:"5px",background:A}}),t.jsx("div",{style:{position:"absolute",left:0,width:`${ne}%`,height:"10px",borderRadius:"5px",background:M}}),t.jsx("input",{type:"range",min:5,max:200,value:k,onClick:V=>V.stopPropagation(),onChange:V=>{V.stopPropagation(),w==null||w(Number(V.target.value))},style:{position:"absolute",width:"100%",height:"36px",opacity:0,cursor:"pointer",margin:0,zIndex:2}}),t.jsx("div",{style:{position:"absolute",left:`calc(${ne}% - 11px)`,width:"22px",height:"22px",borderRadius:"50%",background:G,border:"2.5px solid rgba(255,255,255,0.7)",boxShadow:"0 2px 6px rgba(0,0,0,0.3)",pointerEvents:"none",zIndex:1}})]}),t.jsxs("span",{style:{fontSize:"1rem",fontWeight:800,color:G,minWidth:"50px",textAlign:"right",fontFamily:"Outfit"},children:[k>=200?"200+":k," km"]})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"8px"},children:[t.jsx("span",{style:{fontSize:"0.95rem",color:le,width:"38px",textAlign:"center",flexShrink:0,fontWeight:700},children:"Ãge"}),t.jsxs("div",{style:{flex:1,position:"relative",height:"44px",display:"flex",alignItems:"center",marginRight:"24px",overflow:"visible"},children:[t.jsx("div",{style:{position:"absolute",left:0,right:0,height:"10px",borderRadius:"5px",background:A}}),t.jsx("div",{style:{position:"absolute",left:`${Re}%`,width:`${Math.max(0,Q-Re)}%`,height:"10px",borderRadius:"5px",background:M}}),t.jsx("input",{type:"range",min:18,max:80,value:b.min,onClick:V=>V.stopPropagation(),onChange:V=>{V.stopPropagation();const H=Number(V.target.value);H<b.max-1&&(j==null||j({...b,min:H}))},style:{position:"absolute",left:0,width:"100%",height:"44px",opacity:0,cursor:"pointer",margin:0,zIndex:Re>50?5:3,WebkitAppearance:"none",appearance:"none"}}),t.jsx("input",{type:"range",min:18,max:80,value:b.max,onClick:V=>V.stopPropagation(),onChange:V=>{V.stopPropagation();const H=Number(V.target.value);H>b.min+1&&(j==null||j({...b,max:H}))},style:{position:"absolute",left:0,width:"100%",height:"44px",opacity:0,cursor:"pointer",margin:0,zIndex:4,WebkitAppearance:"none",appearance:"none"}}),t.jsx("div",{style:{position:"absolute",left:`calc(${Re}% - 11px)`,width:"22px",height:"22px",borderRadius:"50%",background:G,border:"2.5px solid rgba(255,255,255,0.7)",boxShadow:"0 2px 6px rgba(0,0,0,0.3)",pointerEvents:"none",zIndex:2}}),t.jsx("div",{style:{position:"absolute",left:`calc(${Q}% - 11px)`,width:"22px",height:"22px",borderRadius:"50%",background:G,border:"2.5px solid rgba(255,255,255,0.7)",boxShadow:"0 2px 6px rgba(0,0,0,0.3)",pointerEvents:"none",zIndex:2}})]}),t.jsxs("span",{style:{fontSize:"0.9rem",fontWeight:800,color:G,minWidth:"75px",textAlign:"right",fontFamily:"Outfit",flexShrink:0},children:[b.min," â ",b.max]})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[K.map(V=>{const H=T===V.value;return t.jsx("button",{onClick:N=>{N.stopPropagation(),P==null||P(V.value)},style:{padding:"8px 8px",borderRadius:"10px",border:H?`2px solid ${G}`:`1px solid ${F}`,background:H?"rgba(26,26,46,0.2)":"rgba(255,255,255,0.12)",color:H?G:le,fontSize:"0.7rem",fontWeight:H?700:500,cursor:"pointer",transition:"all 0.15s",whiteSpace:"nowrap"},children:V.label},V.value)}),t.jsxs("button",{onClick:l,style:{flex:1,padding:"10px 12px",borderRadius:"12px",background:G,color:"white",border:"none",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",cursor:"pointer",boxShadow:"0 4px 16px rgba(0,0,0,0.35)",fontFamily:"Outfit, sans-serif"},children:[a>0&&t.jsxs("span",{style:{background:G,borderRadius:"7px",padding:"2px 7px",fontSize:"0.7rem",fontWeight:800,display:"flex",alignItems:"center",gap:"3px",color:ee.a,border:`1px solid ${ee.a}`},children:[t.jsx(Ut,{size:10}),a]}),t.jsx("span",{style:{fontSize:"0.8rem",fontWeight:700},children:"Voir les nouveaux profils"}),t.jsx(Pr,{size:14})]})]})]}),B&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:O?"12px":"0"},children:[t.jsxs("button",{onClick:V=>{V.stopPropagation(),E(H=>!H)},style:{padding:"10px 14px",borderRadius:"12px",border:O?`2px solid ${G}`:`2px solid ${$?"rgba(140,115,75,0.35)":F}`,background:O?"rgba(26,26,46,0.2)":$?"rgba(255,255,255,0.6)":"rgba(255,255,255,0.15)",color:G,cursor:"pointer",display:"flex",alignItems:"center",gap:"6px",fontFamily:"Outfit, sans-serif",flexShrink:0,transition:"all 0.2s"},children:[t.jsx(s5,{size:14}),t.jsx("span",{style:{fontSize:"0.75rem",fontWeight:700},children:"Filtres"})]}),t.jsxs("button",{onClick:l,style:{flex:1,padding:"14px 16px",borderRadius:"14px",background:$?"linear-gradient(135deg, #D4C4A8, #B8956A)":G,color:$?"#2A2520":"white",border:$?"2px solid rgba(120,95,55,0.5)":"none",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",cursor:"pointer",boxShadow:$?"0 4px 16px rgba(180,140,90,0.3)":"0 4px 16px rgba(0,0,0,0.35)",fontFamily:"Outfit, sans-serif"},children:[a>0&&t.jsxs("span",{style:{background:G,borderRadius:"7px",padding:"2px 7px",fontSize:"0.75rem",fontWeight:800,display:"flex",alignItems:"center",gap:"3px",color:ee.a,border:`1px solid ${ee.a}`},children:[t.jsx(Ut,{size:12}),a]}),t.jsx("span",{style:{fontSize:"0.9rem",fontWeight:700},children:"Voir les nouveaux profils"}),t.jsx(Pr,{size:16})]})]}),O&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"14px",padding:"4px 0"},children:[t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"0.75rem",color:le,fontWeight:700,marginBottom:"6px",textTransform:"uppercase",letterSpacing:"0.5px"},children:"ð Distance"}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx("button",{onClick:V=>{V.stopPropagation(),I==null||I()},disabled:R,style:{width:"38px",height:"38px",borderRadius:"10px",flexShrink:0,border:`1.5px solid ${F}`,background:"rgba(255,255,255,0.2)",color:G,cursor:R?"wait":"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(Gb,{size:18,className:R?"spin-icon":""})}),t.jsxs("div",{style:{flex:1,position:"relative",height:"36px",display:"flex",alignItems:"center"},children:[t.jsx("div",{style:{position:"absolute",left:0,right:0,height:"10px",borderRadius:"5px",background:A}}),t.jsx("div",{style:{position:"absolute",left:0,width:`${ne}%`,height:"10px",borderRadius:"5px",background:M}}),t.jsx("input",{type:"range",min:5,max:200,value:k,onClick:V=>V.stopPropagation(),onChange:V=>{V.stopPropagation(),w==null||w(Number(V.target.value))},style:{position:"absolute",width:"100%",height:"36px",opacity:0,cursor:"pointer",margin:0,zIndex:2}}),t.jsx("div",{style:{position:"absolute",left:`calc(${ne}% - 11px)`,width:"22px",height:"22px",borderRadius:"50%",background:G,border:"2.5px solid rgba(255,255,255,0.7)",boxShadow:"0 2px 6px rgba(0,0,0,0.3)",pointerEvents:"none",zIndex:1}})]}),t.jsxs("span",{style:{fontSize:"1rem",fontWeight:800,color:G,minWidth:"55px",textAlign:"right",fontFamily:"Outfit"},children:[k>=200?"200+":k," km"]})]})]}),t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"0.75rem",color:le,fontWeight:700,marginBottom:"8px",textTransform:"uppercase",letterSpacing:"0.5px"},children:"ð Tranche d'âge"}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"16px"},children:[t.jsx(a1,{value:b.min,min:18,max:b.max-1,onChange:V=>j==null?void 0:j({...b,min:V}),label:"Min",color:G}),t.jsx("span",{style:{color:le,fontWeight:800,fontSize:"1.3rem",marginTop:"16px"},children:"â"}),t.jsx(a1,{value:b.max,min:b.min+1,max:99,onChange:V=>j==null?void 0:j({...b,max:V}),label:"Max",color:G})]})]}),t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"0.75rem",color:le,fontWeight:700,marginBottom:"6px",textTransform:"uppercase",letterSpacing:"0.5px"},children:"ð¤ Genre"}),t.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:K.map(V=>{const H=T===V.value;return t.jsx("button",{onClick:N=>{N.stopPropagation(),P==null||P(V.value)},style:{flex:1,padding:"12px 8px",borderRadius:"12px",border:H?`2px solid ${G}`:`1.5px solid ${F}`,background:H?"rgba(26,26,46,0.2)":"rgba(255,255,255,0.12)",color:H?G:le,fontSize:"0.85rem",fontWeight:H?700:500,cursor:"pointer",transition:"all 0.15s",whiteSpace:"nowrap"},children:V.label},V.value)})})]})]})]})]}),t.jsxs(l1,{onClick:x,style:{width:"100%",padding:"60px 24px",borderRadius:"22px",border:$?"2px solid rgba(140,115,75,0.4)":`1.5px solid rgba(${ee.rgb},0.3)`,backgroundImage:$?"url('https://a.basemaps.cartocdn.com/rastertiles/voyager/13/4185/2837.png')":"linear-gradient(135deg, rgba(10,8,20,0.35) 0%, rgba(10,8,20,0.08) 40%, rgba(10,8,20,0.35) 100%), url('https://a.basemaps.cartocdn.com/dark_all/13/4185/2837.png')",backgroundSize:"cover",backgroundPosition:"center",color:$?"#3D3528":"white",fontSize:"1.15rem",fontWeight:700,fontFamily:"Outfit, sans-serif",curs
1010or:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"14px",boxShadow:$?"0 6px 24px rgba(100,80,40,0.15)":"0 10px 36px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.1)",filter:"none",position:"relative",overflow:"hidden"},children:[t.jsx(ur,{size:24,color:$?"#9B8462":ee.a,fill:$?"#9B8462":ee.a,style:{position:"relative",zIndex:1,filter:$?"none":`drop-shadow(0 0 8px ${ee.g})`}}),t.jsx("span",{style:{position:"relative",zIndex:1,textShadow:$?"none":"0 2px 6px rgba(0,0,0,0.5)"},children:"Explorer la carte"}),t.jsx(Pr,{size:18,style:{position:"relative",zIndex:1,opacity:.5}})]}),t.jsxs(l1,{onClick:_,style:{width:"100%",padding:"20px 24px",borderRadius:"16px",border:$?"1px solid rgba(245,215,110,0.5)":"1.5px solid rgba(255,215,0,0.3)",background:$?"linear-gradient(135deg, #B8860B 0%, #D4AF37 25%, #F5D76E 50%, #D4AF37 75%, #B8860B 100%)":"linear-gradient(145deg, rgba(255,215,0,0.15) 0%, rgba(255,215,0,0.06) 100%)",color:$?"#1a1a2e":"white",WebkitTextFillColor:$?"#1a1a2e":"white",fontSize:"1.05rem",fontWeight:700,fontFamily:"Outfit, sans-serif",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",boxShadow:$?"0 4px 20px rgba(212,175,55,0.3), inset 0 1px 0 rgba(255,255,255,0.3), inset 0 -1px 0 rgba(0,0,0,0.15)":"0 4px 20px rgba(255,215,0,0.12)",position:"relative",overflow:"hidden"},children:[t.jsx(Xt,{size:20,color:$?"#1a1a2e":"#FFD700",fill:$?"#1a1a2e":"#FFD700",style:{position:"relative",zIndex:1}}),t.jsx("span",{style:{position:"relative",zIndex:1},children:"Mes Matchs"}),y>0&&t.jsx("span",{style:{background:$?"#9B8462":"#FFD700",borderRadius:"10px",padding:"2px 10px",fontSize:"0.8rem",fontWeight:800,color:$?"#FAF7F2":"#1a1a2e",position:"relative",zIndex:1},children:y}),t.jsx(Pr,{size:16,style:{position:"relative",zIndex:1,opacity:.4}})]}),t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:"8px",width:"100%"},children:[t.jsx(kg,{icon:al,label:"Ãcartés",iconColor:"#C4A572",rgb:"196,165,114",count:n,muted:!0,onClick:u}),t.jsx(kg,{icon:Bt,label:"Coups de cÅur",iconColor:"#C4A572",rgb:"196,165,114",count:i,muted:!0,onClick:d}),t.jsx(kg,{icon:nr,label:"Likes reçus",iconColor:"#C4A572",rgb:"196,165,114",count:S,muted:!0,onClick:p})]}),t.jsxs("button",{onClick:g,style:{width:"100%",padding:"12px 20px",borderRadius:"12px",border:$?"1.5px solid rgba(155,132,98,0.25)":"1px solid rgba(196,165,114,0.12)",background:$?"rgba(155,132,98,0.06)":"rgba(196,165,114,0.04)",color:$?"#8C7A60":"rgba(196,165,114,0.45)",fontSize:"0.85rem",fontWeight:$?600:500,fontFamily:"Outfit, sans-serif",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",transition:"all 0.2s"},children:[t.jsx(Vo,{size:13,style:{opacity:$?.8:.6}}),t.jsx("span",{children:"Modifier mes critères"})]}),t.jsx("style",{children:` 1011 @keyframes shimmerSlide { 1012 0% { transform: translateX(-100%); } 1013 60% { transform: translateX(100%); } 1014 100% { transform: translateX(100%); } 1015 } 1016 @keyframes scrollPhotos { 1017 0% { transform: translateX(100vw); } 1018 100% { transform: translateX(-100%); } 1019 } 1020 @keyframes spinGPS { 1021 to { transform: rotate(360deg); } 1022 } 1023 .shimmer-bar { 1024 position: absolute; inset: 0; z-index: 0; 1025 background: linear-gradient(105deg, transparent 25%, rgba(255,255,255,0.18) 50%, transparent 75%); 1026 animation: shimmerSlide 3s ease-in-out infinite; 1027 } 1028 .photo-scroll-strip { 1029 animation: scrollPhotos 45s linear infinite; 1030 } 1031 .hub-btn { 1032 -webkit-tap-highlight-color: transparent; 1033 } 1034 .hub-btn-glow { 1035 position: absolute; inset: 0; 1036 border-radius: inherit; opacity: 0; 1037 background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.15), transparent 70%); 1038 transition: opacity 0.35s; 1039 pointer-events: none; z-index: 0; 1040 } 1041 .hub-btn:hover .hub-btn-glow, 1042 .hub-btn:active .hub-btn-glow { opacity: 1; } 1043 .hub-btn:active { transform: scale(0.94) !important; } 1044 .spin-icon { animation: spinGPS 1s linear infinite; } 1045 `})]})},kg=({icon:e,label:r,iconColor:i,rgb:n,count:o,filled:a,muted:l,onClick:d})=>{const[p,u]=m.useState(!1),{lightMode:g}=dr(),h=m.useCallback(x=>{u(!0),setTimeout(()=>u(!1),400),d&&d(x)},[d]);return t.jsxs("button",{onClick:h,className:"hub-btn",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",padding:"16px 8px",borderRadius:"16px",border:l?g?"1.5px solid rgba(155,132,98,0.2)":"1px solid rgba(255,255,255,0.06)":`1px solid rgba(${n},0.2)`,background:l?g?"rgba(155,132,98,0.04)":"rgba(255,255,255,0.03)":`linear-gradient(160deg, rgba(${n},0.1) 0%, rgba(${n},0.03) 100%)`,boxShadow:g?"0 2px 8px rgba(120,100,60,0.08)":"0 2px 12px rgba(0,0,0,0.2)",cursor:"pointer",position:"relative",color:g?"#3D3528":"white",overflow:"hidden",transform:p?"scale(0.92)":"scale(1)",transition:"transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s"},children:[t.jsx("div",{className:"hub-btn-glow"}),t.jsx("div",{style:{width:"44px",height:"44px",borderRadius:"14px",background:l?"rgba(255,255,255,0.06)":`linear-gradient(135deg, rgba(${n},0.3), rgba(${n},0.1))`,display:"flex",alignItems:"center",justifyContent:"center",position:"relative",zIndex:1},children:t.jsx(e,{size:22,color:i,fill:a?i:"none"})}),t.jsx("span",{style:{fontSize:"0.78rem",fontWeight:600,textAlign:"center",lineHeight:1.2,color:l?g?"#8C7A60":"rgba(255,255,255,0.5)":g?"#3D3528":"rgba(255,255,255,0.85)",position:"relative",zIndex:1},children:r}),o>
10450&&t.jsx("div",{style:{position:"absolute",top:"5px",right:"5px",zIndex:2,background:l?"rgba(255,255,255,0.2)":i,borderRadius:"9px",padding:"1px 7px",fontSize:"0.68rem",fontWeight:800,color:l?"white":"#1a1a2e",minWidth:"20px",textAlign:"center"},children:o})]})};var fx={exports:{}};/* @preserve 1046 * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com 1047 * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade 1048 */(function(e,r){(function(i,n){n(r)})(jk,function(i){var n="1.9.4";function o(s){var c,f,v,C;for(f=1,v=arguments.length;f<v;f++){C=arguments[f];for(c in C)s[c]=C[c]}return s}var a=Object.create||function(){function s(){}return function(c){return s.prototype=c,new s}}();function l(s,c){var f=Array.prototype.slice;if(s.bind)return s.bind.apply(s,f.call(arguments,1));var v=f.call(arguments,2);return function(){return s.apply(c,v.length?v.concat(f.call(arguments)):arguments)}}var d=0;function p(s){return"_leaflet_id"in s||(s._leaflet_id=++d),s._leaflet_id}function u(s,c,f){var v,C,U,de;return de=function(){v=!1,C&&(U.apply(f,C),C=!1)},U=function(){v?C=arguments:(s.apply(f,arguments),setTimeout(de,c),v=!0)},U}function g(s,c,f){var v=c[1],C=c[0],U=v-C;return s===v&&f?s:((s-C)%U+U)%U+C}function h(){return!1}function x(s,c){if(c===!1)return s;var f=Math.pow(10,c===void 0?6:c);return Math.round(s*f)/f}function y(s){return s.trim?s.trim():s.replace(/^\s+|\s+$/g,"")}function _(s){return y(s).split(/\s+/)}function S(s,c){Object.prototype.hasOwnProperty.call(s,"options")||(s.options=s.options?a(s.options):{});for(var f in c)s.options[f]=c[f];return s.options}function k(s,c,f){var v=[];for(var C in s)v.push(encodeURIComponent(f?C.toUpperCase():C)+"="+encodeURIComponent(s[C]));return(!c||c.indexOf("?")===-1?"?":"&")+v.join("&")}var w=/\{ *([\w_ -]+) *\}/g;function b(s,c){return s.replace(w,function(f,v){var C=c[v];if(C===void 0)throw new Error("No value provided for variable "+f);return typeof C=="function"&&(C=C(c)),C})}var j=Array.isArray||function(s){return Object.prototype.toString.call(s)==="[object Array]"};function T(s,c){for(var f=0;f<s.length;f++)if(s[f]===c)return f;return-1}var P="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function I(s){return window["webkit"+s]||window["moz"+s]||window["ms"+s]}var R=0;function O(s){var c=+new Date,f=Math.max(0,16-(c-R));return R=c+f,window.setTimeout(s,f)}var E=window.requestAnimationFrame||I("RequestAnimationFrame")||O,$=window.cancelAnimationFrame||I("CancelAnimationFrame")||I("CancelRequestAnimationFrame")||function(s){window.clearTimeout(s)};function B(s,c,f){if(f&&E===O)s.call(c);else return E.call(window,l(s,c))}function ee(s){s&&$.call(window,s)}var te={__proto__:null,extend:o,create:a,bind:l,get lastId(){return d},stamp:p,throttle:u,wrapNum:g,falseFn:h,formatNum:x,trim:y,splitWords:_,setOptions:S,getParamString:k,template:b,isArray:j,indexOf:T,emptyImageUrl:P,requestFn:E,cancelFn:$,requestAnimFrame:B,cancelAnimFrame:ee};function K(){}K.extend=function(s){var c=function(){S(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},f=c.__super__=this.prototype,v=a(f);v.constructor=c,c.prototype=v;for(var C in this)Object.prototype.hasOwnProperty.call(this,C)&&C!=="prototype"&&C!=="__super__"&&(c[C]=this[C]);return s.statics&&o(c,s.statics),s.includes&&(ne(s.includes),o.apply(null,[v].concat(s.includes))),o(v,s),delete v.statics,delete v.includes,v.options&&(v.options=f.options?a(f.options):{},o(v.options,s.options)),v._initHooks=[],v.callInitHooks=function(){if(!this._initHooksCalled){f.callInitHooks&&f.callInitHooks.call(this),this._initHooksCalled=!0;for(var U=0,de=v._initHooks.length;U<de;U++)v._initHooks[U].call(this)}},c},K.include=function(s){var c=this.prototype.options;return o(this.prototype,s),s.options&&(this.prototype.options=c,this.mergeOptions(s.options)),this},K.mergeOptions=function(s){return o(this.prototype.options,s),this},K.addInitHook=function(s){var c=Array.prototype.slice.call(arguments,1),f=typeof s=="function"?s:function(){this[s].apply(this,c)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(f),this};function ne(s){if(!(typeof L>"u"||!L||!L.Mixin)){s=j(s)?s:[s];for(var c=0;c<s.length;
1048c++)s[c]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var Re={on:function(s,c,f){if(typeof s=="object")for(var v in s)this._on(v,s[v],c);else{s=_(s);for(var C=0,U=s.length;C<U;C++)this._on(s[C],c,f)}return this},off:function(s,c,f){if(!arguments.length)delete this._events;else if(typeof s=="object")for(var v in s)this._off(v,s[v],c);else{s=_(s);for(var C=arguments.length===1,U=0,de=s.length;U<de;U++)C?this._off(s[U]):this._off(s[U],c,f)}return this},_on:function(s,c,f,v){if(typeof c!="function"){console.warn("wrong listener type: "+typeof c);return}if(this._listens(s,c,f)===!1){f===this&&(f=void 0);var C={fn:c,ctx:f};v&&(C.once=!0),this._events=this._events||{},this._events[s]=this._events[s]||[],this._events[s].push(C)}},_off:function(s,c,f){var v,C,U;if(this._events&&(v=this._events[s],!!v)){if(arguments.length===1){if(this._firingCount)for(C=0,U=v.length;C<U;C++)v[C].fn=h;delete this._events[s];return}if(typeof c!="function"){console.warn("wrong listener type: "+typeof c);return}var de=this._listens(s,c,f);if(de!==!1){var je=v[de];this._firingCount&&(je.fn=h,this._events[s]=v=v.slice()),v.splice(de,1)}}},fire:function(s,c,f){if(!this.listens(s,f))return this;var v=o({},c,{type:s,target:this,sourceTarget:c&&c.sourceTarget||this});if(this._events){var C=this._events[s];if(C){this._firingCount=this._firingCount+1||1;for(var U=0,de=C.length;U<de;U++){var je=C[U],Te=je.fn;je.once&&this.off(s,Te,je.ctx),Te.call(je.ctx||this,v)}this._firingCount--}}return f&&this._propagateEvent(v),this},listens:function(s,c,f,v){typeof s!="string"&&console.warn('"string" type argument expected');var C=c;typeof c!="function"&&(v=!!c,C=void 0,f=void 0);var U=this._events&&this._events[s];if(U&&U.length&&this._listens(s,C,f)!==!1)return!0;if(v){for(var de in this._eventParents)if(this._eventParents[de].listens(s,c,f,v))return!0}return!1},_listens:function(s,c,f){if(!this._events)return!1;var v=this._events[s]||[];if(!c)return!!v.length;f===this&&(f=void 0);for(var C=0,U=v.length;C<U;C++)if(v[C].fn===c&&v[C].ctx===f)return C;return!1},once:function(s,c,f){if(typeof s=="object")for(var v in s)this._on(v,s[v],c,!0);else{s=_(s);for(var C=0,U=s.length;C<U;C++)this._on(s[C],c,f,!0)}return this},addEventParent:function(s){return this._eventParents=this._eventParents||{},this._eventParents[p(s)]=s,this},removeEventParent:function(s){return this._eventParents&&delete this._eventParents[p(s)],this},_propagateEvent:function(s){for(var c in this._eventParents)this._eventParents[c].fire(s.type,o({layer:s.target,propagatedFrom:s.target},s),!0)}};Re.addEventListener=Re.on,Re.removeEventListener=Re.clearAllEventListeners=Re.off,Re.addOneTimeEventListener=Re.once,Re.fireEvent=Re.fire,Re.hasEventListeners=Re.listens;var Q=K.extend(Re);function G(s,c,f){this.x=f?Math.round(s):s,this.y=f?Math.round(c):c}var le=Math.trunc||function(s){return s>0?Math.floor(s):Math.ceil(s)};G.prototype={clone:function(){return new G(this.x,this.y)},add:function(s){return this.clone()._add(F(s))},_add:function(s){return this.x+=s.x,this.y+=s.y,this},subtract:function(s){return this.clone()._subtract(F(s))},_subtract:function(s){return this.x-=s.x,this.y-=s.y,this},divideBy:function(s){return this.clone()._divideBy(s)},_divideBy:function(s){return this.x/=s,this.y/=s,this},multiplyBy:function(s){return this.clone()._multiplyBy(s)},_multiplyBy:function(s){return this.x*=s,this.y*=s,this},scaleBy:function(s){return new G(this.x*s.x,this.y*s.y)},unscaleBy:function(s){return new G(this.x/s.x,this.y/s.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=le(this.x),this.y=le(this.y),this},distanceTo:function(s){s=F(s);var c=s.x-this.x,f=s.y-this.y;return Math.sqrt(c*c+f*f)},equals:function(s){return s=F(s),s.x===this.x&&s.y===this.y},contains:function(s){return s=F(s),Math.abs(s.x)<=Math.abs(this.x)&&Math.abs(s.y)<=Math.abs(this.y)},toString:function(){return"Point("+x(this.x)+", "+x(this.y)+")"}};function F(s,c,f){return s instanceof G?s:j(s)?new G(s[0],s[1]):s==null?s:typeof s=="object"&&"x"in s&&"y"in s?new G(s.x,s.y):new G(s,c,f)}function A(s,c){if(s)for(var f=c?[s,c]:s,v=0,C=f.length;v<C;v++)this.extend(f[v])}A.prototype={extend:function(s){var c,f;if(!s)return this;if(s instanceof G||typeof s[0]=="number"||"x"in s)c=f=F(s);else if(s=M(s),c=s.min,f=s.max,!c||!f)return this;return!this.min&&!this.max?(this.min=c.clone(),this.max=f.clone()):(this.min.x=Math.min(c.x,this.min.x),this.max.x=Math.max(f.x,this.max.x),this.min.y=Math.min(c.y,this.min.y),this.max.y=Math.max(f.y,this.max.y)),this},getCenter:function(s){return F((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,s)},getBottomLeft:function(){return F(this.min.x,this.max.y)},getTopRight:function(){return F(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(s){var c,f;return typeof s[0]=="number"||s instanceof G?s=F(s):s=M(s),s instanceof A?(c=s.min,f=s.max):c=f=s,c.x>=this.min.x&&f.x<=this.max.x&&c.y>=this.min.y&&f.y<=this.max.y},intersects:function(s){s=M(s);var c=this.min,f=this.max,v=s.min,C=s.max,U=C.x>=c.x&&v.x<=f.x,de=C.y>=c.y&&v.y<=f.y;return U&&de},overlaps:function(s){s=M(s);var c=this.min,f=this.max,v=s.min,C=s.max,U=C.x>c.x&&v.x<f.x,de=C.y>c.y&&v.y<f.y;return U&&de},isValid:function(){return!!(this.min&&this.max)},pad:function(s){var c=this.min,f=this.max,v=Math.abs(c.x-f.x)*s,C=Math.abs(c.y-f.y)*s;return M(F(c.x-v,c.y-C),F(f.x+v,f.y+C))},equals:function(s){return s?(s=M(s),this.min.equals(s.getTopLeft())&&this.max.equals(s.getBottomRight())):!1}};function M(s,c){return!s||s instanceof A?s:new A(s,c)}function V(s,c){if(s)for(var f=c?[s,c]:s,v=0,C=f.length;v<C;v++)this.extend(f[v])}V.prototype={extend:function(s){var c=this._southWest,f=this._northEast,v,C;if(s instanceof N)v=s,C=s;else if(s instanceof V){if(v=s._southWest,C=s._northEast,!v||!C)return this}else return s?this.extend(Z(s)||H(s)):this;return!c&&!f?(this._southWest=new N(v.lat,v.lng),this._northEast=new N(C.lat,C.lng)):(c.lat=Math.min(v.lat,c.lat),c.lng=Math.min(v.lng,c.lng),f.lat=Math.max(C.lat,f.lat),f.lng=Math.max(C.lng,f.lng)),this},pad:function(s){var c=this._southWest,f=this._northEast,v=Math.abs(c.lat-f.lat)*s,C=Math.abs(c.lng-f.lng)*s;return new V(new N(c.lat-v,c.lng-C),new N(f.lat+v,f.lng+C))},getCenter:function(){return new N((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new N(this.getNorth(),this.getWest())},getSouthEast:function(){return new N(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat}
1048,getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(s){typeof s[0]=="number"||s instanceof N||"lat"in s?s=Z(s):s=H(s);var c=this._southWest,f=this._northEast,v,C;return s instanceof V?(v=s.getSouthWest(),C=s.getNorthEast()):v=C=s,v.lat>=c.lat&&C.lat<=f.lat&&v.lng>=c.lng&&C.lng<=f.lng},intersects:function(s){s=H(s);var c=this._southWest,f=this._northEast,v=s.getSouthWest(),C=s.getNorthEast(),U=C.lat>=c.lat&&v.lat<=f.lat,de=C.lng>=c.lng&&v.lng<=f.lng;return U&&de},overlaps:function(s){s=H(s);var c=this._southWest,f=this._northEast,v=s.getSouthWest(),C=s.getNorthEast(),U=C.lat>c.lat&&v.lat<f.lat,de=C.lng>c.lng&&v.lng<f.lng;return U&&de},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(s,c){return s?(s=H(s),this._southWest.equals(s.getSouthWest(),c)&&this._northEast.equals(s.getNorthEast(),c)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function H(s,c){return s instanceof V?s:new V(s,c)}function N(s,c,f){if(isNaN(s)||isNaN(c))throw new Error("Invalid LatLng object: ("+s+", "+c+")");this.lat=+s,this.lng=+c,f!==void 0&&(this.alt=+f)}N.prototype={equals:function(s,c){if(!s)return!1;s=Z(s);var f=Math.max(Math.abs(this.lat-s.lat),Math.abs(this.lng-s.lng));return f<=(c===void 0?1e-9:c)},toString:function(s){return"LatLng("+x(this.lat,s)+", "+x(this.lng,s)+")"},distanceTo:function(s){return X.distance(this,Z(s))},wrap:function(){return X.wrapLatLng(this)},toBounds:function(s){var c=180*s/40075017,f=c/Math.cos(Math.PI/180*this.lat);return H([this.lat-c,this.lng-f],[this.lat+c,this.lng+f])},clone:function(){return new N(this.lat,this.lng,this.alt)}};function Z(s,c,f){return s instanceof N?s:j(s)&&typeof s[0]!="object"?s.length===3?new N(s[0],s[1],s[2]):s.length===2?new N(s[0],s[1]):null:s==null?s:typeof s=="object"&&"lat"in s?new N(s.lat,"lng"in s?s.lng:s.lon,s.alt):c===void 0?null:new N(s,c,f)}var ae={latLngToPoint:function(s,c){var f=this.projection.project(s),v=this.scale(c);return this.transformation._transform(f,v)},pointToLatLng:function(s,c){var f=this.scale(c),v=this.transformation.untransform(s,f);return this.projection.unproject(v)},project:function(s){return this.projection.project(s)},unproject:function(s){return this.projection.unproject(s)},scale:function(s){return 256*Math.pow(2,s)},zoom:function(s){return Math.log(s/256)/Math.LN2},getProjectedBounds:function(s){if(this.infinite)return null;var c=this.projection.bounds,f=this.scale(s),v=this.transformation.transform(c.min,f),C=this.transformation.transform(c.max,f);return new A(v,C)},infinite:!1,wrapLatLng:function(s){var c=this.wrapLng?g(s.lng,this.wrapLng,!0):s.lng,f=this.wrapLat?g(s.lat,this.wrapLat,!0):s.lat,v=s.alt;return new N(f,c,v)},wrapLatLngBounds:function(s){var c=s.getCenter(),f=this.wrapLatLng(c),v=c.lat-f.lat,C=c.lng-f.lng;if(v===0&&C===0)return s;
1048var U=s.getSouthWest(),de=s.getNorthEast(),je=new N(U.lat-v,U.lng-C),Te=new N(de.lat-v,de.lng-C);return new V(je,Te)}},X=o({},ae,{wrapLng:[-180,180],R:6371e3,distance:function(s,c){var f=Math.PI/180,v=s.lat*f,C=c.lat*f,U=Math.sin((c.lat-s.lat)*f/2),de=Math.sin((c.lng-s.lng)*f/2),je=U*U+Math.cos(v)*Math.cos(C)*de*de,Te=2*Math.atan2(Math.sqrt(je),Math.sqrt(1-je));return this.R*Te}}),he=6378137,Ae={R:he,MAX_LATITUDE:85.0511287798,project:function(s){var c=Math.PI/180,f=this.MAX_LATITUDE,v=Math.max(Math.min(f,s.lat),-f),C=Math.sin(v*c);return new G(this.R*s.lng*c,this.R*Math.log((1+C)/(1-C))/2)},unproject:function(s){var c=180/Math.PI;return new N((2*Math.atan(Math.exp(s.y/this.R))-Math.PI/2)*c,s.x*c/this.R)},bounds:function(){var s=he*Math.PI;return new A([-s,-s],[s,s])}()};function ze(s,c,f,v){if(j(s)){this._a=s[0],this._b=s[1],this._c=s[2],this._d=s[3];return}this._a=s,this._b=c,this._c=f,this._d=v}ze.prototype={transform:function(s,c){return this._transform(s.clone(),c)},_transform:function(s,c){return c=c||1,s.x=c*(this._a*s.x+this._b),s.y=c*(this._c*s.y+this._d),s},untransform:function(s,c){return c=c||1,new G((s.x/c-this._b)/this._a,(s.y/c-this._d)/this._c)}};function ue(s,c,f,v){return new ze(s,c,f,v)}var xe=o({},X,{code:"EPSG:3857",projection:Ae,transformation:function(){var s=.5/(Math.PI*Ae.R);return ue(s,.5,-s,.5)}()}),ke=o({},xe,{code:"EPSG:900913"});function Pe(s){return document.createElementNS("http://www.w3.org/2000/svg",s)}function Ce(s,c){var f="",v,C,U,de,je,Te;for(v=0,U=s.length;v<U;v++){for(je=s[v],C=0,de=je.length;C<de;C++)Te=je[C],f+=(C?"L":"M")+Te.x+" "+Te.y;f+=c?Ue.svg?"z":"x":""}return f||"M0 0"}var Me=document.documentElement.style,Le="ActiveXObject"in window,rt=Le&&!document.addEventListener,Fe="msLaunchUri"in navigator&&!("documentMode"in document),ft=Et("webkit"),De=Et("android"),Be=Et("android 2")||Et("android 3"),re=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),He=De&&Et("Google")&&re<537&&!("AudioNode"in window),be=!!window.opera,nt=!Fe&&Et("chrome"),J=Et("gecko")&&!ft&&!be&&!Le,Ie=!nt&&Et("safari"),z=Et("phantom"),Y="OTransition"in Me,ce=navigator.platform.indexOf("Win")===0,ve=Le&&"transition"in Me,pe="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!Be,$e="MozPerspective"in Me,Xe=!window.L_DISABLE_3D&&(ve||pe||$e)&&!Y&&!z,tt=typeof orientation<"u"||Et("mobile"),gt=tt&&ft,at=tt&&pe,Pt=!window.PointerEvent&&window.MSPointerEvent,vt=!!(window.PointerEvent||Pt),ut="ontouchstart"in window||!!window.TouchEvent,Wt=!window.L_NO_TOUCH&&(ut||vt),dt=tt&&be,Rr=tt&&J,Dr=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Rt=function(){var s=!1;try{var c=Object.defineProperty({},"passive",{get:function(){s=!0}});window.addEventListener("testPassiveEventSupport",h,c),window.removeEventListener("testPassiveEventSupport",h,c)}catch{}return s}(),br=function(){return!!document.createElement("canvas").getContext}(),Ht=!!(document.createElementNS&&Pe("svg").createSVGRect),or=!!Ht&&function(){var s=document.createElement("div");return s.innerHTML="<svg/>",(s.firstChild&&s.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),sr=!Ht&&function(){try{var s=document.createElement("div");s.innerHTML='<v:shape adj="1"/>';var c=s.firstChild;return c.style.behavior="url(#default#VML)",c&&typeof c.adj=="object"}catch{return!1}}(),Ne=navigator.platform.indexOf("Mac")===0,Ze=navigator.platform.indexOf("Linux")===0;function Et(s){return navigator.userAgent.toLowerCase().indexOf(s)>=0}var Ue={ie:Le,ielt9:rt,edge:Fe,webkit:ft,android:De,android23:Be,androidStock:He,opera:be,chrome:nt,gecko:J,safari:Ie,phantom:z,opera12:Y,win:ce,ie3d:ve,webkit3d:pe,gecko3d:$e,any3d:Xe,mobile:tt,mobileWebkit:gt,mobileWebkit3d:at,msPointer:Pt,pointer:vt,touch:Wt,touchNative:ut,mobileOpera:dt,mobileGecko:Rr,retina:Dr,passiveEvents:Rt,canvas:br,svg:Ht,vml:sr,inlineSvg:or,mac:Ne,linux:Ze},St=Ue.msPointer?"MSPointerDown":"pointerdown",At=Ue.msPointer?"MSPointerMove":"pointermove",Ft=Ue.msPointer?"MSPointerUp":"pointerup",Gt=Ue.msPointer?"MSPointerCancel":"pointercancel",fr={touchstart:St,touchmove:At,touchend:Ft,touchcancel:Gt},It={touchstart:Zo,touchmove:Ti,touchend:Ti,touchcancel:Ti},jt={},Dt=!1;function Nt(s,c,f){return c==="touchstart"&&Bn(),It[c]?(f=It[c].bind(this,f),s.addEventListener(fr[c],f,!1),f):(console.warn("wrong event specified:",c),h)}function jr(s,c,f){if(!fr[c]){console.warn("wrong event specified:",c);return}s.removeEventListener(fr[c],f,!1)}function Zt(s){jt[s.pointerId]=s}function kr(s){jt[s.pointerId]&&(jt[s.pointerId]=s)}function xr(s){delete jt[s.pointerId]}function Bn(){Dt||(document.addEventListener(St,Zt,!0),document.addEventListener(At,kr,!0),document.addEventListener(Ft,xr,!0),document.addEventListener(Gt,xr,!0),Dt=!0)}function Ti(s,c){if(c.pointerType!==(c.MSPOINTER_TYPE_MOUSE||"mouse")){c.touches=[];for(var f in jt)c.touches.push(jt[f]);c.changedTouches=[c],s(c)}}function Zo(s,c){c.MSPOINTER_TYPE_TOUCH&&c.pointerType===c.MSPOINTER_TYPE_TOUCH&&Xr(c),Ti(s,c)}function no(s){var c={},f,v;for(v in s)f=s[v],c[v]=f&&f.bind?f.bind(s):f;return s=c,c.type="dblclick",c.detail=2,c.isTrusted=!1,c._simulated=!0,c}var Yo=200;
1048function Xo(s,c){s.addEventListener("dblclick",c);var f=0,v;function C(U){if(U.detail!==1){v=U.detail;return}if(!(U.pointerType==="mouse"||U.sourceCapabilities&&!U.sourceCapabilities.firesTouchEvents)){var de=ha(U);if(!(de.some(function(Te){return Te instanceof HTMLLabelElement&&Te.attributes.for})&&!de.some(function(Te){return Te instanceof HTMLInputElement||Te instanceof HTMLSelectElement}))){var je=Date.now();je-f<=Yo?(v++,v===2&&c(no(U))):v=1,f=je}}}return s.addEventListener("click",C),{dblclick:c,simDblclick:C}}function On(s,c){s.removeEventListener("dblclick",c.dblclick),s.removeEventListener("click",c.simDblclick)}var Ln=Co(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),mn=Co(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),yn=mn==="webkitTransition"||mn==="OTransition"?mn+"End":"transitionend";function oo(s){return typeof s=="string"?document.getElementById(s):s}function $n(s,c){var f=s.style[c]||s.currentStyle&&s.currentStyle[c];if((!f||f==="auto")&&document.defaultView){var v=document.defaultView.getComputedStyle(s,null);f=v?v[c]:null}return f==="auto"?null:f}function Vt(s,c,f){var v=document.createElement(s);return v.className=c||"",f&&f.appendChild(v),v}function qt(s){var c=s.parentNode;c&&c.removeChild(s)}function Ai(s){for(;s.firstChild;)s.removeChild(s.firstChild)}function bn(s){var c=s.parentNode;c&&c.lastChild!==s&&c.appendChild(s)}function so(s){var c=s.parentNode;c&&c.firstChild!==s&&c.insertBefore(s,c.firstChild)}function Jr(s,c){if(s.classList!==void 0)return s.classList.contains(c);var f=lo(s);return f.length>0&&new RegExp("(^|\\s)"+c+"(\\s|$)").test(f)}function Tt(s,c){if(s.classList!==void 0)for(var f=_(c),v=0,C=f.length;v<C;v++)s.classList.add(f[v]);else if(!Jr(s,c)){var U=lo(s);ao(s,(U?U+" ":"")+c)}}function wr(s,c){s.classList!==void 0?s.classList.remove(c):ao(s,y((" "+lo(s)+" ").replace(" "+c+" "," ")))}function ao(s,c){s.className.baseVal===void 0?s.className=c:s.className.baseVal=c}function lo(s){return s.correspondingElement&&(s=s.correspondingElement),s.className.baseVal===void 0?s.className:s.className.baseVal}function ai(s,c){"opacity"in s.style?s.style.opacity=c:"filter"in s.style&&co(s,c)}function co(s,c){var f=!1,v="DXImageTransform.Microsoft.Alpha";try{f=s.filters.item(v)}catch{if(c===1)return}c=Math.round(c*100),f?(f.Enabled=c!==100,f.Opacity=c):s.style.filter+=" progid:"+v+"(opacity="+c+")"}function Co(s){for(var c=document.documentElement.style,f=0;f<s.length;f++)if(s[f]in c)return s[f];return!1}function Si(s,c,f){var v=c||new G(0,0);s.style[Ln]=(Ue.ie3d?"translate("+v.x+"px,"+v.y+"px)":"translate3d("+v.x+"px,"+v.y+"px,0)")+(f?" scale("+f+")":"")}function Br(s,c){s._leaflet_pos=c,Ue.any3d?Si(s,c):(s.style.left=c.x+"px",s.style.top=c.y+"px")}function ot(s){return s._leaflet_pos||new G(0,0)}var Zr,vr,da;if("onselectstart"in document)Zr=function(){kt(window,"selectstart",Xr)},vr=function(){hr(window,"selectstart",Xr)};else{var Yr=Co(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Zr=function(){if(Yr){var s=document.documentElement.style;da=s[Yr],s[Yr]="none"}},vr=function(){Yr&&(document.documentElement.style[Yr]=da,da=void 0)}}function js(){kt(window,"dragstart",Xr)}function vn(){hr(window,"dragstart",Xr)}var Gi,Wn;function ws(s){for(;s.tabIndex===-1;)s=s.parentNode;s.style&&(an(),Gi=s,Wn=s.style.outlineStyle,s.style.outlineStyle="none",kt(window,"keydown",an))}function an(){Gi&&(Gi.style.outlineStyle=Wn,Gi=void 0,Wn=void 0,hr(window,"keydown",an))}function _s(s){do s=s.parentNode;while((!s.offsetWidth||!s.offsetHeight)&&s!==document.body);return s}function Ss(s){var c=s.getBoundingClientRect();return{x:c.width/s.offsetWidth||1,y:c.height/s.offsetHeight||1,boundingClientRect:c}}var po={__proto__:null,TRANSFORM:Ln,TRANSITION:mn,TRANSITION_END:yn,get:oo,getStyle:$n,create:Vt,remove:qt,empty:Ai,toFront:bn,toBack:so,hasClass:Jr,addClass:Tt,removeClass:wr,setClass:ao,getClass:lo,setOpacity:ai,testProp:Co,setTransform:Si,setPosition:Br,getPosition:ot,get disableTextSelection(){return Zr},get enableTextSelection(){return vr},disableImageDrag:js,enableImageDrag:vn,preventOutline:ws,restoreOutline:an,get
1048SizedParentNode:_s,getScale:Ss};function kt(s,c,f,v){if(c&&typeof c=="object")for(var C in c)pa(s,C,c[C],f);else{c=_(c);for(var U=0,de=c.length;U<de;U++)pa(s,c[U],f,v)}return this}var Ji="_leaflet_events";function hr(s,c,f,v){if(arguments.length===1)dl(s),delete s[Ji];else if(c&&typeof c=="object")for(var C in c)ks(s,C,c[C],f);else if(c=_(c),arguments.length===2)dl(s,function(je){return T(c,je)!==-1});else for(var U=0,de=c.length;U<de;U++)ks(s,c[U],f,v);return this}function dl(s,c){for(var f in s[Ji]){var v=f.split(/\d/)[0];(!c||c(v))&&ks(s,v,null,null,f)}}var ca={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function pa(s,c,f,v){var C=c+p(f)+(v?"_"+p(v):"");if(s[Ji]&&s[Ji][C])return this;var U=function(je){return f.call(v||s,je||window.event)},de=U;!Ue.touchNative&&Ue.pointer&&c.indexOf("touch")===0?U=Nt(s,c,U):Ue.touch&&c==="dblclick"?U=Xo(s,U):"addEventListener"in s?c==="touchstart"||c==="touchmove"||c==="wheel"||c==="mousewheel"?s.addEventListener(ca[c]||c,U,Ue.passiveEvents?{passive:!1}:!1):c==="mouseenter"||c==="mouseleave"?(U=function(je){je=je||window.event,q(s,je)&&de(je)},s.addEventListener(ca[c],U,!1)):s.addEventListener(c,de,!1):s.attachEvent("on"+c,U),s[Ji]=s[Ji]||{},s[Ji][C]=U}function ks(s,c,f,v,C){C=C||c+p(f)+(v?"_"+p(v):"");var U=s[Ji]&&s[Ji][C];if(!U)return this;!Ue.touchNative&&Ue.pointer&&c.indexOf("touch")===0?jr(s,c,U):Ue.touch&&c==="dblclick"?On(s,U):"removeEventListener"in s?s.removeEventListener(ca[c]||c,U,!1):s.detachEvent("on"+c,U),s[Ji][C]=null}function ln(s){return s.stopPropagation?s.stopPropagation():s.originalEvent?s.originalEvent._stopped=!0:s.cancelBubble=!0,this}function ua(s){return pa(s,"wheel",ln),this}function Zi(s){return kt(s,"mousedown touchstart dblclick contextmenu",ln),s._leaflet_disable_click=!0,this}function Xr(s){return s.preventDefault?s.preventDefault():s.returnValue=!1,this}function Nn(s){return Xr(s),ln(s),this}function ha(s){if(s.composedPath)return s.composedPath();for(var c=[],f=s.target;f;)c.push(f),f=f.parentNode;return c}function Cs(s,c){if(!c)return new G(s.clientX,s.clientY);var f=Ss(c),v=f.boundingClientRect;return new G((s.clientX-v.left)/f.x-c.clientLeft,(s.clientY-v.top)/f.y-c.clientTop)}var cl=Ue.linux&&Ue.chrome?window.devicePixelRatio:Ue.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function jn(s){return Ue.edge?s.wheelDeltaY/2:s.deltaY&&s.deltaMode===0?-s.deltaY/cl:s.deltaY&&s.deltaMode===1?-s.deltaY*20:s.deltaY&&s.deltaMode===2?-s.deltaY*60:s.deltaX||s.deltaZ?0:s.wheelDelta?(s.wheelDeltaY||s.wheelDelta)/2:s.detail&&Math.abs(s.detail)<32765?-s.detail*20:s.detail?s.detail/-32765*60:0}function q(s,c){var f=c.relatedTarget;if(!f)return!0;try{for(;f&&f!==s;)f=f.parentNode}catch{return!1}return f!==s}var Ge={__proto__:null,on:kt,off:hr,stopPropagation:ln,disableScrollPropagation:ua,disableClickPropagation:Zi,preventDefault:Xr,stop:Nn,getPropagationPath:ha,getMousePosition:Cs,getWheelDelta:jn,isExternalTarget:q,addListener:kt,removeListener:hr},ct=Q.extend({run:function(s,c,f,v){this.stop(),this._el=s,this._inProgress=!0,this._duration=f||.25,this._easeOutPower=1/Math.max(v||.5,.2),this._startPos=ot(s),this._offset=c.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=B(this._animate,this),this._step()},_step:function(s){var c=+new Date-this._startTime,f=this._duration*1e3;c<f?this._runFrame(this._easeOut(c/f),s):(this._runFrame(1),this._complete())},_runFrame:function(s,c){var f=this._startPos.add(this._offset.multiplyBy(s));c&&f._round(),Br(this._el,f),this.fire("step")},_complete:function(){ee(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(s){return 1-Math.pow(1-s,this._easeOutPower)}}),et=Q.extend({options:{crs:xe,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(s,c){c=S(this,c),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(s),this._initLayout(),this._onResize=l(this._onResize,this),this._initEvents(),c.maxBounds&&this.setMaxBounds(c.maxBounds),c.zoom!==void 0&&(this._zoom=this._limitZoom(c.zoom)),c.center&&c.zoom!==void 0&&this.setView(Z(c.center),c.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=mn&&Ue.any3d&&!Ue.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),kt(this._proxy,yn,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)}
vendor: 8,648 bytes, line 1048
1048,setView:function(s,c,f){if(c=c===void 0?this._zoom:this._limitZoom(c),s=this._limitCenter(Z(s),c,this.options.maxBounds),f=f||{},this._stop(),this._loaded&&!f.reset&&f!==!0){f.animate!==void 0&&(f.zoom=o({animate:f.animate},f.zoom),f.pan=o({animate:f.animate,duration:f.duration},f.pan));var v=this._zoom!==c?this._tryAnimatedZoom&&this._tryAnimatedZoom(s,c,f.zoom):this._tryAnimatedPan(s,f.pan);if(v)return clearTimeout(this._sizeTimer),this}return this._resetView(s,c,f.pan&&f.pan.noMoveStart),this},setZoom:function(s,c){return this._loaded?this.setView(this.getCenter(),s,{zoom:c}):(this._zoom=s,this)},zoomIn:function(s,c){return s=s||(Ue.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+s,c)},zoomOut:function(s,c){return s=s||(Ue.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-s,c)},setZoomAround:function(s,c,f){var v=this.getZoomScale(c),C=this.getSize().divideBy(2),U=s instanceof G?s:this.latLngToContainerPoint(s),de=U.subtract(C).multiplyBy(1-1/v),je=this.containerPointToLatLng(C.add(de));return this.setView(je,c,{zoom:f})},_getBoundsCenterZoom:function(s,c){c=c||{},s=s.getBounds?s.getBounds():H(s);var f=F(c.paddingTopLeft||c.padding||[0,0]),v=F(c.paddingBottomRight||c.padding||[0,0]),C=this.getBoundsZoom(s,!1,f.add(v));if(C=typeof c.maxZoom=="number"?Math.min(c.maxZoom,C):C,C===1/0)return{center:s.getCenter(),zoom:C};var U=v.subtract(f).divideBy(2),de=this.project(s.getSouthWest(),C),je=this.project(s.getNorthEast(),C),Te=this.unproject(de.add(je).divideBy(2).add(U),C);return{center:Te,zoom:C}},fitBounds:function(s,c){if(s=H(s),!s.isValid())throw new Error("Bounds are not valid.");var f=this._getBoundsCenterZoom(s,c);return this.setView(f.center,f.zoom,c)},fitWorld:function(s){return this.fitBounds([[-90,-180],[90,180]],s)},panTo:function(s,c){return this.setView(s,this._zoom,{pan:c})},panBy:function(s,c){if(s=F(s).round(),c=c||{},!s.x&&!s.y)return this.fire("moveend");if(c.animate!==!0&&!this.getSize().contains(s))return this._resetView(this.unproject(this.project(this.getCenter()).add(s)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ct,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),c.noMoveStart||this.fire("movestart"),c.animate!==!1){Tt(this._mapPane,"leaflet-pan-anim");var f=this._getMapPanePos().subtract(s).round();this._panAnim.run(this._mapPane,f,c.duration||.25,c.easeLinearity)}else this._rawPanBy(s),this.fire("move").fire("moveend");return this},flyTo:function(s,c,f){if(f=f||{},f.animate===!1||!Ue.any3d)return this.setView(s,c,f);this._stop();var v=this.project(this.getCenter()),C=this.project(s),U=this.getSize(),de=this._zoom;s=Z(s),c=c===void 0?de:c;var je=Math.max(U.x,U.y),Te=je*this.getZoomScale(de,c),qe=C.distanceTo(v)||1,lt=1.42,Ct=lt*lt;function Yt(ui){var Lp=ui?-1:1,gk=ui?Te:je,fk=Te*Te-je*je+Lp*Ct*Ct*qe*qe,xk=2*gk*Ct*qe,z0=fk/xk,B5=Math.sqrt(z0*z0+1)-z0,mk=B5<1e-9?-18:Math.log(B5);return mk}function Xi(ui){return(Math.exp(ui)-Math.exp(-ui))/2}function zi(ui){return(Math.exp(ui)+Math.exp(-ui))/2}function Vn(ui){return Xi(ui)/zi(ui)}var dn=Yt(0);function ml(ui){return je*(zi(dn)/zi(dn+lt*ui))}function ck(ui){return je*(zi(dn)*Vn(dn+lt*ui)-Xi(dn))/Ct}function pk(ui){return 1-Math.pow(1-ui,1.5)}var uk=Date.now(),M5=(Yt(1)-dn)/lt,hk=f.duration?1e3*f.duration:1e3*M5*.8;function D5(){var ui=(Date.now()-uk)/hk,Lp=pk(ui)*M5;ui<=1?(this._flyToFrame=B(D5,this),this._move(this.unproject(v.add(C.subtract(v).multiplyBy(ck(Lp)/qe)),de),this.getScaleZoom(je/ml(Lp),de),{flyTo:!0})):this._move(s,c)._moveEnd(!0)}return this._moveStart(!0,f.noMoveStart),D5.call(this),this},flyToBounds:function(s,c){var f=this._getBoundsCenterZoom(s,c);return this.flyTo(f.center,f.zoom,c)},setMaxBounds:function(s){return s=H(s),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),s.isValid()?(this.options.maxBounds=s,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(s){var c=this.options.minZoom;return this.options.minZoom=s,this._loaded&&c!==s&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(s):this},setMaxZoom:function(s){var c=this.options.maxZoom;return this.options.maxZoom=s,this._loaded&&c!==s&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(s):this},panInsideBounds:function(s,c){this._enforcingBounds=!0;var f=this.getCenter(),v=this._limitCenter(f,this._zoom,H(s));return f.equals(v)||this.panTo(v,c),this._enforcingBounds=!1,this},panInside:function(s,c){c=c||{};var f=F(c.paddingTopLeft||c.padding||[0,0]),v=F(c.paddingBottomRight||c.padding||[0,0]),C=this.project(this.getCenter()),U=this.project(s),de=this.getPixelBounds(),je=M([de.min.add(f),de.max.subtract(v)]),Te=je.getSize();if(!je.contains(U)){this._enforcingBounds=!0;var qe=U.subtract(je.getCenter()),lt=je.extend(U).getSize().subtract(Te);C.x+=qe.x<0?-lt.x:lt.x,C.y+=qe.y<0?-lt.y:lt.y,this.panTo(this.unproject(C),c),this._enforcingBounds=!1}return this},invalidateSize:function(s){if(!this._loaded)return this;s=o({animate:!1,pan:!0},s===!0?{animate:!0}:s);var c=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var f=this.getSize(),v=c.divideBy(2).round(),C=f.divideBy(2).round(),U=v.subtract(C);return!U.x&&!U.y?this:(s.animate&&s.pan?this.panBy(U):(s.pan&&this._rawPanBy(U),this.fire("move"),s.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(l(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:c,newSize:f}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(s){if(s=this._locateOptions=o({timeout:1e4,watch:!1},s),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var c=l(this._handleGeolocationResponse,this),f=l(this._handleGeolocationError,this);return s.watch?this._locationWatchId=navigator.geolocation.watchPosition(c,f,s):navigator.geolocation.getCurrentPosition(c,f,s),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(s){if(this._container._leaflet_id){var c=s.code,f=s.message||(c===1?"permission denied":c===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:c,message:"Geolocation error: "+f+"."})}},_handleGeolocationResponse:function(s){if(this._container._leaflet_id){var c=s.coords.latitude,f=s.coords.longitude,v=new N(c,f),C=v.toBounds(s.coords.accuracy*2),U=this._locateOptions;if(U.setView){var de=this.getBoundsZoom(C);this.setView(v,U.maxZoom?Math.min(de,U.maxZoom):de)}var je={latlng:v,bounds:C,timestamp:s.timestamp};for(var Te in s.coords)typeof s.coords[Te]=="number"&&(je[Te]=s.coords[Te]);this.fire("locationfound",je)}},addHandler:function(s,c){if(!c)return this;var f=this[s]=new c(this);return this._handlers.push(f),this.options[s]&&f.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),qt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(ee(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var s;for(s in this._layers)this._layers[s].remove();for(s in this._panes)qt(this._panes[s]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(s,c){var f="leaflet-pane"+(s?" leaflet-"+s.replace("Pane","")+"-pane":""),v=Vt("div",f,c||this._mapPane);return s&&(this._panes[s]=v),v},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var s=this.getPixelBounds(),c=this.unproject(s.getBottomLeft()),f=this.unproject(s.getTopRight());return new V(c,f)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZo
1048om===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(s,c,f){s=H(s),f=F(f||[0,0]);var v=this.getZoom()||0,C=this.getMinZoom(),U=this.getMaxZoom(),de=s.getNorthWest(),je=s.getSouthEast(),Te=this.getSize().subtract(f),qe=M(this.project(je,v),this.project(de,v)).getSize(),lt=Ue.any3d?this.options.zoomSnap:1,Ct=Te.x/qe.x,Yt=Te.y/qe.y,Xi=c?Math.max(Ct,Yt):Math.min(Ct,Yt);return v=this.getScaleZoom(Xi,v),lt&&(v=Math.round(v/(lt/100))*(lt/100),v=c?Math.ceil(v/lt)*lt:Math.floor(v/lt)*lt),Math.max(C,Math.min(U,v))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new G(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(s,c){var f=this._getTopLeftPoint(s,c);return new A(f,f.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(s){return this.options.crs.getProjectedBounds(s===void 0?this.getZoom():s)},getPane:function(s){return typeof s=="string"?this._panes[s]:s},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(s,c){var f=this.options.crs;return c=c===void 0?this._zoom:c,f.scale(s)/f.scale(c)},getScaleZoom:function(s,c){var f=this.options.crs;c=c===void 0?this._zoom:c;var v=f.zoom(s*f.scale(c));return isNaN(v)?1/0:v},project:function(s,c){return c=c===void 0?this._zoom:c,this.options.crs.latLngToPoint(Z(s),c)},unproject:function(s,c){return c=c===void 0?this._zoom:c,this.options.crs.pointToLatLng(F(s),c)},layerPointToLatLng:function(s){var c=F(s).add(this.getPixelOrigin());return this.unproject(c)},latLngToLayerPoint:function(s){var c=this.project(Z(s))._round();return c._subtract(this.getPixelOrigin())},wrapLatLng:function(s){return this.options.crs.wrapLatLng(Z(s))},wrapLatLngBounds:function(s){return this.options.crs.wrapLatLngBounds(H(s))},distance:function(s,c){return this.options.crs.distance(Z(s),Z(c))},containerPointToLayerPoint:function(s){return F(s).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(s){return F(s).add(this._getMapPanePos())},containerPointToLatLng:function(s){var c=this.containerPointToLayerPoint(F(s));return this.layerPointToLatLng(c)},latLngToContainerPoint:function(s){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Z(s)))},mouseEventToContainerPoint:function(s){return Cs(s,this._container)},mouseEventToLayerPoint:function(s){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(s))},mouseEventToLatLng:function(s){return this.layerPointToLatLng(this.mouseEventToLayerPoint(s))},_initContainer:function(s){var c=this._container=oo(s);if(c){if(c._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");kt(c,"scroll",this._onScroll,this),this._containerId=p(c)},_initLayout:function(){var s=this._container;this._fadeAnimated=this.options.fadeAnimation&&Ue.any3d,Tt(s,"leaflet-container"+(Ue.touch?" leaflet-touch":"")+(Ue.retina?" leaflet-retina":"")+(Ue.ielt9?" leaflet-oldie":"")+(Ue.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var c=$n(s,"position");c!=="absolute"&&c!=="relative"&&c!=="fixed"&&c!=="sticky"&&(s.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var s=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Br(this._mapPane,new G(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Tt(s.markerPane,"leaflet-zoom-hide"),Tt(s.shadowPane,"leaflet-zoom-hide"))},_resetView:function(s,c,f){Br(this._mapPane,new G(0,0));var v=!this._loaded;this._loaded=!0,c=this._limitZoom(c),this.fire("viewprereset");var C=this._zoom!==c;this._moveStart(C,f)._move(s,c)._moveEnd(C),this.fire("viewreset"),v&&this.fire("load")},_moveStart:function(s,c){return s&&this.fire("zoomstart"),c||this.fire("movestart"),this},_move:function(s,c,f,v){c===void 0&&(c=this._zoom);var C=this._zoom!==c;return this._zoom=c,this._lastCenter=s,this._pixelOrigin=this._getNewPixelOrigin(s),v?f&&f.pinch&&this.fire("zoom",f):((C||f&&f.pinch)&&this.fire("zoom",f),this.fire("move",f)),this},_moveEnd:function(s){return s&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return ee(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(s){Br(this._mapPane,this._getMapPanePos().subtract(s))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(s){this._targets={},this._targets[p(this._container)]=this;var c=s?hr:kt;c(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&c(window,"resize",this._onResize,this),Ue.any3d&&this.options.transform3DLimit&&(s?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){ee(this._resizeRequest),this._resizeRequest=B(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var s=this._getMapPanePos();Math.max(Math.abs(s.x),Math.abs(s.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(s,c){for(var f=[],v,C=c==="mouseout"||c==="mouseover",U=s.target||s.srcElement,de=!1;U;){if(v=this._targets[p(U)],v&&(c==="click"||c==="preclick")&&this._draggableMoved(v)){de=!0;break}
1048if(v&&v.listens(c,!0)&&(C&&!q(U,s)||(f.push(v),C))||U===this._container)break;U=U.parentNode}return!f.length&&!de&&!C&&this.listens(c,!0)&&(f=[this]),f},_isClickDisabled:function(s){for(;s&&s!==this._container;){if(s._leaflet_disable_click)return!0;s=s.parentNode}},_handleDOMEvent:function(s){var c=s.target||s.srcElement;if(!(!this._loaded||c._leaflet_disable_events||s.type==="click"&&this._isClickDisabled(c))){var f=s.type;f==="mousedown"&&ws(c),this._fireDOMEvent(s,f)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(s,c,f){if(s.type==="click"){var v=o({},s);v.type="preclick",this._fireDOMEvent(v,v.type,f)}var C=this._findEventTargets(s,c);if(f){for(var U=[],de=0;de<f.length;de++)f[de].listens(c,!0)&&U.push(f[de]);C=U.concat(C)}if(C.length){c==="contextmenu"&&Xr(s);var je=C[0],Te={originalEvent:s};if(s.type!=="keypress"&&s.type!=="keydown"&&s.type!=="keyup"){var qe=je.getLatLng&&(!je._radius||je._radius<=10);Te.containerPoint=qe?this.latLngToContainerPoint(je.getLatLng()):this.mouseEventToContainerPoint(s),Te.layerPoint=this.containerPointToLayerPoint(Te.containerPoint),Te.latlng=qe?je.getLatLng():this.layerPointToLatLng(Te.layerPoint)}for(de=0;de<C.length;de++)if(C[de].fire(c,Te,!0),Te.originalEvent._stopped||C[de].options.bubblingMouseEvents===!1&&T(this._mouseEvents,c)!==-1)return}},_draggableMoved:function(s){return s=s.dragging&&s.dragging.enabled()?s:this,s.dragging&&s.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var s=0,c=this._handlers.length;s<c;s++)this._handlers[s].disable()},whenReady:function(s,c){return this._loaded?s.call(c||this,{target:this}):this.on("load",s,c),this},_getMapPanePos:function(){return ot(this._mapPane)||new G(0,0)},_moved:function(){var s=this._getMapPanePos();return s&&!s.equals([0,0])},_getTopLeftPoint:function(s,c){var f=s&&c!==void 0?this._getNewPixelOrigin(s,c):this.getPixelOrigin();return f.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(s,c){var f=this.getSize()._divideBy(2);return this.project(s,c)._subtract(f)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(s,c,f){var v=this._getNewPixelOrigin(f,c);return this.project(s,c)._subtract(v)},_latLngBoundsToNewLayerBounds:function(s,c,f){var v=this._getNewPixelOrigin(f,c);
vendor: 14,325 bytes, line 1048
1048return M([this.project(s.getSouthWest(),c)._subtract(v),this.project(s.getNorthWest(),c)._subtract(v),this.project(s.getSouthEast(),c)._subtract(v),this.project(s.getNorthEast(),c)._subtract(v)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(s){return this.latLngToLayerPoint(s).subtract(this._getCenterLayerPoint())},_limitCenter:function(s,c,f){if(!f)return s;var v=this.project(s,c),C=this.getSize().divideBy(2),U=new A(v.subtract(C),v.add(C)),de=this._getBoundsOffset(U,f,c);return Math.abs(de.x)<=1&&Math.abs(de.y)<=1?s:this.unproject(v.add(de),c)},_limitOffset:function(s,c){if(!c)return s;var f=this.getPixelBounds(),v=new A(f.min.add(s),f.max.add(s));return s.add(this._getBoundsOffset(v,c))},_getBoundsOffset:function(s,c,f){var v=M(this.project(c.getNorthEast(),f),this.project(c.getSouthWest(),f)),C=v.min.subtract(s.min),U=v.max.subtract(s.max),de=this._rebound(C.x,-U.x),je=this._rebound(C.y,-U.y);return new G(de,je)},_rebound:function(s,c){return s+c>0?Math.round(s-c)/2:Math.max(0,Math.ceil(s))-Math.max(0,Math.floor(c))},_limitZoom:function(s){var c=this.getMinZoom(),f=this.getMaxZoom(),v=Ue.any3d?this.options.zoomSnap:1;return v&&(s=Math.round(s/v)*v),Math.max(c,Math.min(f,s))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){wr(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(s,c){var f=this._getCenterOffset(s)._trunc();return(c&&c.animate)!==!0&&!this.getSize().contains(f)?!1:(this.panBy(f,c),!0)},_createAnimProxy:function(){var s=this._proxy=Vt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(s),this.on("zoomanim",function(c){var f=Ln,v=this._proxy.style[f];Si(this._proxy,this.project(c.center,c.zoom),this.getZoomScale(c.zoom,1)),v===this._proxy.style[f]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){qt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var s=this.getCenter(),c=this.getZoom();Si(this._proxy,this.project(s,c),this.getZoomScale(c,1))},_catchTransitionEnd:function(s){this._animatingZoom&&s.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(s,c,f){if(this._animatingZoom)return!0;if(f=f||{},!this._zoomAnimated||f.animate===!1||this._nothingToAnimate()||Math.abs(c-this._zoom)>this.options.zoomAnimationThreshold)return!1;var v=this.getZoomScale(c),C=this._getCenterOffset(s)._divideBy(1-1/v);return f.animate!==!0&&!this.getSize().contains(C)?!1:(B(function(){this._moveStart(!0,f.noMoveStart||!1)._animateZoom(s,c,!0)},this),!0)},_animateZoom:function(s,c,f,v){this._mapPane&&(f&&(this._animatingZoom=!0,this._animateToCenter=s,this._animateToZoom=c,Tt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:s,zoom:c,noUpdate:v}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(l(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&wr(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Qe(s,c){return new et(s,c)}var bt=K.extend({options:{position:"topright"},initialize:function(s){S(this,s)},getPosition:function(){return this.options.position},setPosition:function(s){var c=this._map;return c&&c.removeControl(this),this.options.position=s,c&&c.addControl(this),this},getContainer:function(){return this._container},addTo:function(s){this.remove(),this._map=s;var c=this._container=this.onAdd(s),f=this.getPosition(),v=s._controlCorners[f];return Tt(c,"leaflet-control"),f.indexOf("bottom")!==-1?v.insertBefore(c,v.firstChild):v.appendChild(c),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(qt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(s){this._map&&s&&s.screenX>0&&s.screenY>0&&this._map.getContainer().focus()}}),Ee=function(s){return new bt(s)};et.include({addControl:function(s){return s.addTo(this),this},removeControl:function(s){return s.remove(),this},_initControlPos:function(){var s=this._controlCorners={},c="leaflet-",f=this._controlContainer=Vt("div",c+"control-container",this._container);function v(C,U){var de=c+C+" "+c+U;s[C+U]=Vt("div",de,f)}v("top","left"),v("top","right"),v("bottom","left"),v("bottom","right")},_clearControlPos:function(){for(var s in this._controlCorners)qt(this._controlCorners[s]);qt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var We=bt.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(s,c,f,v){return f<v?-1:v<f?1:0}},initialize:function(s,c,f){S(this,f),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var v in s)this._addLayer(s[v],v);for(v in c)this._addLayer(c[v],v,!0)},onAdd:function(s){this._initLayout(),this._update(),this._map=s,s.on("zoomend",this._checkDisabledLayers,this);for(var c=0;c<this._layers.length;c++)this._layers[c].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(s){return bt.prototype.addTo.call(this,s),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var s=0;s<this._layers.length;s++)this._layers[s].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(s,c){return this._addLayer(s,c),this._map?this._update():this},addOverlay:function(s,c){return this._addLayer(s,c,!0),this._map?this._update():this},removeLayer:function(s){s.off("add remove",this._onLayerChange,this);var c=this._getLayer(p(s));return c&&this._layers.splice(this._layers.indexOf(c),1),this._map?this._update():this},expand:function(){Tt(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var s=this._map.getSize().y-(this._container.offsetTop+50);return s<this._section.clientHeight?(Tt(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=s+"px"):wr(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return wr(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var s="leaflet-control-layers",c=this._container=Vt("div",s),f=this.options.collapsed;c.setAttribute("aria-haspopup",!0),Zi(c),ua(c);var v=this._section=Vt("section",s+"-list");f&&(this._map.on("click",this.collapse,this),kt(c,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var C=this._layersLink=Vt("a",s+"-toggle",c);C.href="#",C.title="Layers",C.setAttribute("role","button"),kt(C,{keydown:function(U){U.keyCode===13&&this._expandSafely()},click:function(U){Xr(U),this._expandSafely()}},this),f||this.expand(),this._baseLayersList=Vt("div",s+"-base",v),this._separator=Vt("div",s+"-separator",v),this._overlaysList=Vt("div",s+"-overlays",v),c.appendChild(v)},_getLayer:function(s){for(var c=0;c<this._layers.length;c++)if(this._layers[c]&&p(this._layers[c].layer)===s)return this._layers[c]},_addLayer:function(s,c,f){this._map&&s.on("add remove",this._onLayerChange,this),this._layers.push({layer:s,name:c,overlay:f}),this.options.sortLayers&&this._layers.sort(l(function(v,C){return this.options.sortFunction(v.layer,C.layer,v.name,C.name)},this)),this.options.autoZIndex&&s.setZIndex&&(this._lastZIndex++,s.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Ai(this._baseLayersList),Ai(this._overlaysList),this._layerControlInputs=[];var s,c,f,v,C=0;for(f=0;f<this._layers.length;f++)v=this._layers[f],this._addItem(v),c=c||v.overlay,s=s||!v.overlay,C+=v.overlay?0:1;return this.options.hideSingleBase&&(s=s&&C>1,this._baseLayersList.style.display=s?"":"none"),this._separator.style.display=c&&s?"":"none",this},_onLayerChange:function(s){this._handlingClick||this._update();var c=this._getLayer(p(s.target)),f=c.overlay?s.type==="add"?"overlayadd":"overlayremove":s.type==="add"?"baselayerchange":null;f&&this._map.fire(f,c)},_createRadioElement:function(s,c){var f='<input type="radio" class="leaflet-control-layers-selector" name="'+s+'"'+(c?' checked="checked"':"")+"/>",v=document.createElement("div");return v.innerHTML=f,v.firstChild},_addItem:function(s){var c=document.createElement("label"),f=this._map.hasLayer(s.layer),v;s.overlay?(v=document.createElement("input"),v.type="checkbox",v.className="leaflet-control-layers-selector",v.defaultChecked=f):v=this._createRadioElement("leaflet-base-layers_"+p(this),f),this._layerControlInputs.push(v),v.layerId=p(s.layer),kt(v,"click",this._onInputClick,this);var C=document.createElement("span");C.innerHTML=" "+s.name;var U=document.createElement("span");c.appendChild(U),U.appendChild(v),U.appendChild(C);var de=s.overlay?this._overlaysList:this._baseLayersList;return de.appendChild(c),this._checkDisabledLayers(),c},_onInputClick:function(){if(!this._preventClick){var s=this._layerControlInputs,c,f,v=[],C=[];this._handlingClick=!0;for(var U=s.length-1;U>=0;U--)c=s[U],f=this._getLayer(c.layerId).layer,c.checked?v.push(f):c.checked||C.push(f);for(U=0;U<C.length;U++)this._map.hasLayer(C[U])&&this._map.removeLayer(C[U]);for(U=0;U<v.length;U++)this._map.hasLayer(v[U])||this._map.addLayer(v[U]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var s=this._layerControlInputs,c,f,v=this._map.getZoom(),C=s.length-1;C>=0;C--)c=s[C],f=this._getLayer(c.layerId).layer,c.disabled=f.options.minZoom!==void 0&&v<f.options.minZoom||f.options.maxZoom!==void 0&&v>f.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var s=this._section;this._preventClick=!0,kt(s,"click",Xr),this.expand();var c=this;setTimeout(function(){hr(s,"click",Xr),c._preventClick=!1})}}),fe=function(s,c,f){return new We(s,c,f)},Se=bt.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(s){var c="leaflet-control-zoom",f=Vt("div",c+" leaflet-bar"),v=this.options;return this._zoomInButton=this._createButton(v.zoomInText,v.zoomInTitle,c+"-in",f,this._zoomIn),this._zoomOutButton=this._createButton(v.zoomOutText,v.zoomOutTitle,c+"-out",f,this._zoomOut),this._updateDisabled(),s.on("zoomend zoomlevelschange",this._updateDisabled,this),f},onRemove:function(s){s.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(s){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(s.shiftKey?3:1))},_zoomOut:function(s){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(s.shiftKey?3:1))},_createButton:function(s,c,f,v,C){var U=Vt("a",f,v);return U.innerHTML=s,U.href="#",U.title=c,U.setAttribute("role","button"),U.setAttribute("aria-label",c),Zi(U),kt(U,"click",Nn),kt(U,"click",C,this),kt(U,"click",this._refocusOnMap,this),U},_updateDisabled:function(){var s=this._map,c="leaflet-disabled";wr(this._zoomInButton,c),wr(this._zoomOutButton,c),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||s._zoom===s.getMinZoom())&&(Tt(this._zoomOutButton,c),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||s._zoom===s.getMaxZoom())&&(Tt(this._zoomInButton,c),this._zoomInButton.setAttribute("aria-disabled","true"))}});et.mergeOptions({zoomControl:!0}),et.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Se,this.addControl(this.zoomControl))});var me=function(s){return new Se(s)},Je=bt.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(s){var c="leaflet-control-scale",f=Vt("div",c),v=this.options;return this._addScales(v,c+"-line",f),s.on(v.updateWhenIdle?"moveend":"move",this._update,this),s.whenReady(this._update,this),f},onRemove:function(s){s.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(s,c,f){s.metric&&(this._mScale=Vt("div",c,f)),s.imperial&&(this._iScale=Vt("div",c,f))},_update:function(){var s=this._map,c=s.getSize().y/2,f=s.distance(s.containerPointToLatLng([0,c]),s.containerPointToLatLng([this.options.maxWidth,c]));this._updateScales(f)},_updateScales:function(s){this.options.metric&&s&&this._updateMetric(s),this.options.imperial&&s&&this._updateImperial(s)},_updateMetric:function(s){var c=this._getRoundNum(s),f=c<1e3?c+" m":c/1e3+" km";this._updateScale(this._mScale,f,c/s)},_updateImperial:function(s){var c=s*3.2808399,f,v,C;c>5280?(f=c/5280,v=this._getRoundNum(f),this._updateScale(this._iScale,v+" mi",v/f)):(C=this._getRoundNum(c),this._updateScale(this._iScale,C+" ft",C/c))},_updateScale:function(s,c,f){s.style.width=Math.round(this.options.maxWidth*f)+"px",s.innerHTML=c},_getRoundNum:function(s){var c=Math.pow(10,(Math.floor(s)+"").length-1),f=s/c;return f=f>=10?10:f>=5?5:f>=3?3:f>=2?2:1,c*f}}),pt=function(s){return new Je(s)},it='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Ke=bt.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Ue.inlineSvg?it+" ":"")+"Leaflet</a>"},initialize:function(s){S(this,s),this._attributions={}}
1048,onAdd:function(s){s.attributionControl=this,this._container=Vt("div","leaflet-control-attribution"),Zi(this._container);for(var c in s._layers)s._layers[c].getAttribution&&this.addAttribution(s._layers[c].getAttribution());return this._update(),s.on("layeradd",this._addAttribution,this),this._container},onRemove:function(s){s.off("layeradd",this._addAttribution,this)},_addAttribution:function(s){s.layer.getAttribution&&(this.addAttribution(s.layer.getAttribution()),s.layer.once("remove",function(){this.removeAttribution(s.layer.getAttribution())},this))},setPrefix:function(s){return this.options.prefix=s,this._update(),this},addAttribution:function(s){return s?(this._attributions[s]||(this._attributions[s]=0),this._attributions[s]++,this._update(),this):this},removeAttribution:function(s){return s?(this._attributions[s]&&(this._attributions[s]--,this._update()),this):this},_update:function(){if(this._map){var s=[];for(var c in this._attributions)this._attributions[c]&&s.push(c);var f=[];this.options.prefix&&f.push(this.options.prefix),s.length&&f.push(s.join(", ")),this._container.innerHTML=f.join(' <span aria-hidden="true">|</span> ')}}});et.mergeOptions({attributionControl:!0}),et.addInitHook(function(){this.options.attributionControl&&new Ke().addTo(this)});var W=function(s){return new Ke(s)};bt.Layers=We,bt.Zoom=Se,bt.Scale=Je,bt.Attribution=Ke,Ee.layers=fe,Ee.zoom=me,Ee.scale=pt,Ee.attribution=W;var se=K.extend({initialize:function(s){this._map=s},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});se.addTo=function(s,c){return s.addHandler(c,this),this};var we={Events:Re},ge=Ue.touch?"touchstart mousedown":"mousedown",oe=Q.extend({options:{clickTolerance:3},initialize:function(s,c,f,v){S(this,v),this._element=s,this._dragStartTarget=c||s,this._preventOutline=f},enable:function(){this._enabled||(kt(this._dragStartTarget,ge,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(oe._dragging===this&&this.finishDrag(!0),hr(this._dragStartTarget,ge,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(s){if(this._enabled&&(this._moved=!1,!Jr(this._element,"leaflet-zoom-anim"))){if(s.touches&&s.touches.length!==1){oe._dragging===this&&this.finishDrag();return}if(!(oe._dragging||s.shiftKey||s.which!==1&&s.button!==1&&!s.touches)&&(oe._dragging=this,this._preventOutline&&ws(this._element),js(),Zr(),!this._moving)){this.fire("down");var c=s.touches?s.touches[0]:s,f=_s(this._element);this._startPoint=new G(c.clientX,c.clientY),this._startPos=ot(this._element),this._parentScale=Ss(f);var v=s.type==="mousedown";kt(document,v?"mousemove":"touchmove",this._onMove,this),kt(document,v?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(s){if(this._enabled){if(s.touches&&s.touches.length>1){this._moved=!0;return}var c=s.touches&&s.touches.length===1?s.touches[0]:s,f=new G(c.clientX,c.clientY)._subtract(this._startPoint);!f.x&&!f.y||Math.abs(f.x)+Math.abs(f.y)<this.options.clickTolerance||(f.x/=this._parentScale.x,f.y/=this._parentScale.y,Xr(s),this._moved||(this.fire("dragstart"),this._moved=!0,Tt(document.body,"leaflet-dragging"),this._lastTarget=s.target||s.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),Tt(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(f),this._moving=!0,this._lastEvent=s,this._updatePosition())}},_updatePosition:function(){var s={originalEvent:this._lastEvent};this.fire("predrag",s),Br(this._element,this._newPos),this.fire("drag",s)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(s){wr(document.body,"leaflet-dragging"),this._lastTarget&&(wr(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),hr(document,"mousemove touchmove",this._onMove,this),hr(document,"mouseup touchend touchcancel",this._onUp,this),vn(),vr();var c=this._moved&&this._moving;this._moving=!1,oe._dragging=!1,c&&this.fire("dragend",{noInertia:s,distance:this._newPos.distanceTo(this._startPos)})}});function ie(s,c,f){var v,C=[1,4,2,8],U,de,je,Te,qe,lt,Ct,Yt;for(U=0,lt=s.length;U<lt;U++)s[U]._code=er(s[U],c);for(je=0;je<4;je++){for(Ct=C[je],v=[],U=0,lt=s.length,de=lt-1;U<lt;de=U++)Te=s[U],qe=s[de],Te._code&Ct?qe._code&Ct||(Yt=st(qe,Te,Ct,c,f),Yt._code=er(Yt,c),v.push(Yt)):(qe._code&Ct&&(Yt=st(qe,Te,Ct,c,f),Yt._code=er(Yt,c),v.push(Yt)),v.push(Te));s=v}return s}function Oe(s,c){var f,v,C,U,de,je,Te,qe,lt;if(!s||s.length===0)throw new Error("latlngs not passed");Qr(s)||(console.warn("latlngs are not flat! Only the first ring will be used"),s=s[0]);var Ct=Z([0,0]),Yt=H(s),Xi=Yt.getNorthWest().distanceTo(Yt.getSouthWest
1048())*Yt.getNorthEast().distanceTo(Yt.getNorthWest());Xi<1700&&(Ct=Ve(s));var zi=s.length,Vn=[];for(f=0;f<zi;f++){var dn=Z(s[f]);Vn.push(c.project(Z([dn.lat-Ct.lat,dn.lng-Ct.lng])))}for(je=Te=qe=0,f=0,v=zi-1;f<zi;v=f++)C=Vn[f],U=Vn[v],de=C.y*U.x-U.y*C.x,Te+=(C.x+U.x)*de,qe+=(C.y+U.y)*de,je+=de*3;je===0?lt=Vn[0]:lt=[Te/je,qe/je];var ml=c.unproject(F(lt));return Z([ml.lat+Ct.lat,ml.lng+Ct.lng])}function Ve(s){for(var c=0,f=0,v=0,C=0;C<s.length;C++){var U=Z(s[C]);c+=U.lat,f+=U.lng,v++}return Z([c/v,f/v])}var yt={__proto__:null,clipPolygon:ie,polygonCenter:Oe,centroid:Ve};function Mt(s,c){if(!c||!s.length)return s.slice();var f=c*c;return s=Yi(s,f),s=Pi(s,f),s}function lr(s,c,f){return Math.sqrt(Kr(s,c,f,!0))}function Ot(s,c,f){return Kr(s,c,f)}function Pi(s,c){var f=s.length,v=typeof Uint8Array<"u"?Uint8Array:Array,C=new v(f);C[0]=C[f-1]=1,mi(s,C,c,0,f-1);var U,de=[];for(U=0;U<f;U++)C[U]&&de.push(s[U]);return de}function mi(s,c,f,v,C){var U=0,de,je,Te;for(je=v+1;je<=C-1;je++)Te=Kr(s[je],s[v],s[C],!0),Te>U&&(de=je,U=Te);U>f&&(c[de]=1,mi(s,c,f,v,de),mi(s,c,f,de,C))}function Yi(s,c){for(var f=[s[0]],v=1,C=0,U=s.length;v<U;v++)ir(s[v],s[C])>c&&(f.push(s[v]),C=v);return C<U-1&&f.push(s[U-1]),f}var Fi;function Un(s,c,f,v,C){var U=v?Fi:er(s,f),de=er(c,f),je,Te,qe;for(Fi=de;;){if(!(U|de))return[s,c];if(U&de)return!1;je=U||de,Te=st(s,c,je,f,C),qe=er(Te,f),je===U?(s=Te,U=qe):(c=Te,de=qe)}}function st(s,c,f,v,C){var U=c.x-s.x,de=c.y-s.y,je=v.min,Te=v.max,qe,lt;return f&8?(qe=s.x+U*(Te.y-s.y)/de,lt=Te.y):f&4?(qe=s.x+U*(je.y-s.y)/de,lt=je.y):f&2?(qe=Te.x,lt=s.y+de*(Te.x-s.x)/U):f&1&&(qe=je.x,lt=s.y+de*(je.x-s.x)/U),new G(qe,lt,C)}function er(s,c){var f=0;return s.x<c.min.x?f|=1:s.x>c.max.x&&(f|=2),s.y<c.min.y?f|=4:s.y>c.max.y&&(f|=8),f}function ir(s,c){var f=c.x-s.x,v=c.y-s.y;return f*f+v*v}function Kr(s,c,f,v){var C=c.x,U=c.y,de=f.x-C,je=f.y-U,Te=de*de+je*je,qe;return Te>0&&(qe=((s.x-C)*de+(s.y-U)*je)/Te,qe>1?(C=f.x,U=f.y):qe>0&&(C+=de*qe,U+=je*qe)),de=s.x-C,je=s.y-U,v?de*de+je*je:new G(C,U)}function Qr(s){return!j(s[0])||typeof s[0][0]!="object"&&typeof s[0][0]<"u"}function ga(s){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Qr(s)}function pl(s,c){var f,v,C,U,de,je,Te,qe;if(!s||s.length===0)throw new Error("latlngs not passed");Qr(s)||(console.warn("latlngs are not flat! Only the first ring will be used"),s=s[0]);var lt=Z([0,0]),Ct=H(s),Yt=Ct.getNorthWest().distanceTo(Ct.getSouthWest
vendor: 4,252 bytes, line 1048
1048())*Ct.getNorthEast().distanceTo(Ct.getNorthWest());Yt<1700&&(lt=Ve(s));var Xi=s.length,zi=[];for(f=0;f<Xi;f++){var Vn=Z(s[f]);zi.push(c.project(Z([Vn.lat-lt.lat,Vn.lng-lt.lng])))}for(f=0,v=0;f<Xi-1;f++)v+=zi[f].distanceTo(zi[f+1])/2;if(v===0)qe=zi[0];else for(f=0,U=0;f<Xi-1;f++)if(de=zi[f],je=zi[f+1],C=de.distanceTo(je),U+=C,U>v){Te=(U-v)/C,qe=[je.x-Te*(je.x-de.x),je.y-Te*(je.y-de.y)];break}var dn=c.unproject(F(qe));return Z([dn.lat+lt.lat,dn.lng+lt.lng])}var fa={__proto__:null,simplify:Mt,pointToSegmentDistance:lr,closestPointOnSegment:Ot,clipSegment:Un,_getEdgeIntersection:st,_getBitCode:er,_sqClosestPointOnSegment:Kr,isFlat:Qr,_flat:ga,polylineCenter:pl},Pd={project:function(s){return new G(s.lng,s.lat)},unproject:function(s){return new N(s.y,s.x)},bounds:new A([-180,-90],[180,90])},ul={R:6378137,R_MINOR:6356752314245179e-9,bounds:new A([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(s){var c=Math.PI/180,f=this.R,v=s.lat*c,C=this.R_MINOR/f,U=Math.sqrt(1-C*C),de=U*Math.sin(v),je=Math.tan(Math.PI/4-v/2)/Math.pow((1-de)/(1+de),U/2);return v=-f*Math.log(Math.max(je,1e-10)),new G(s.lng*c*f,v)},unproject:function(s){for(var c=180/Math.PI,f=this.R,v=this.R_MINOR/f,C=Math.sqrt(1-v*v),U=Math.exp(-s.y/f),de=Math.PI/2-2*Math.atan(U),je=0,Te=.1,qe;je<15&&Math.abs(Te)>1e-7;je++)qe=C*Math.sin(de),qe=Math.pow((1-qe)/(1+qe),C/2),Te=Math.PI/2-2*Math.atan(U*qe)-de,de+=Te;return new N(de*c,s.x*c/f)}},j0={__proto__:null,LonLat:Pd,Mercator:ul,SphericalMercator:Ae},w0=o({},X,{code:"EPSG:3395",projection:ul,transformation:function(){var s=.5/(Math.PI*ul.R);return ue(s,.5,-s,.5)}()}),_r=o({},X,{code:"EPSG:4326",projection:Pd,transformation:ue(1/180,1,-1/180,.5)}),ki=o({},ae,{projection:Pd,transformation:ue(1,0,-1,0),scale:function(s){return Math.pow(2,s)},zoom:function(s){return Math.log(s)/Math.LN2},distance:function(s,c){var f=c.lng-s.lng,v=c.lat-s.lat;return Math.sqrt(f*f+v*v)},infinite:!0});ae.Earth=X,ae.EPSG3395=w0,ae.EPSG3857=xe,ae.EPSG900913=ke,ae.EPSG4326=_r,ae.Simple=ki;var Ci=Q.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(s){return s.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(s){return s&&s.removeLayer(this),this},getPane:function(s){return this._map.getPane(s?this.options[s]||s:this.options.pane)},addInteractiveTarget:function(s){return this._map._targets[p(s)]=this,this},removeInteractiveTarget:function(s){return delete this._map._targets[p(s)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(s){var c=s.target;if(c.hasLayer(this)){if(this._map=c,this._zoomAnimated=c._zoomAnimated,this.getEvents){var f=this.getEvents();c.on(f,this),this.once("remove",function(){c.off(f,this)},this)}this.onAdd(c),this.fire("add"),c.fire("layeradd",{layer:this})}}});et.include({addLayer:function(s){if(!s._layerAdd)throw new Error("The provided object is not a Layer.");var c=p(s);return this._layers[c]?this:(this._layers[c]=s,s._mapToAdd=this,s.beforeAdd&&s.beforeAdd(this),this.whenReady(s._layerAdd,s),this)},removeLayer:function(s){var c=p(s);return this._layers[c]?(this._loaded&&s.onRemove(this),delete this._layers[c],this._loaded&&(this.fire("layerremove",{layer:s}),s.fire("remove")),s._map=s._mapToAdd=null,this):this},hasLayer:function(s){return p(s)in this._layers},eachLayer:function(s,c){for(var f in this._layers)s.call(c,this._layers[f]);return this},_addLayers:function(s){s=s?j(s)?s:[s]:[];for(var c=0,f=s.length;c<f;c++)this.addLayer(s[c])},_addZoomLimit:function(s){(!isNaN(s.options.maxZoom)||!isNaN(s.options.minZoom))&&(this._zoomBoundLayers[p(s)]=s,this._updateZoomLevels())},_removeZoomLimit:function(s){var c=p(s);this._zoomBoundLayers[c]&&(delete this._zoomBoundLayers[c],this._updateZoomLevels())},_updateZoomLevels:function(){var s=1/0,c=-1/0,f=this._getZoomSpan();for(var v in this._zoomBoundLayers){var C=this._zoomBoundLayers[v].options;s=C.minZoom===void 0?s:Math.min(s,C.minZoom),c=C.maxZoom===void 0?c:Math.max(c,C.maxZoom)}this._layersMaxZoom=c===-1/0?void 0:c,this._layersMinZoom=s===1/0?void 0:s,f!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZo
vendor: 12,785 bytes, line 1048
1048om&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var zo=Ci.extend({initialize:function(s,c){S(this,c),this._layers={};var f,v;if(s)for(f=0,v=s.length;f<v;f++)this.addLayer(s[f])},addLayer:function(s){var c=this.getLayerId(s);return this._layers[c]=s,this._map&&this._map.addLayer(s),this},removeLayer:function(s){var c=s in this._layers?s:this.getLayerId(s);return this._map&&this._layers[c]&&this._map.removeLayer(this._layers[c]),delete this._layers[c],this},hasLayer:function(s){var c=typeof s=="number"?s:this.getLayerId(s);return c in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(s){var c=Array.prototype.slice.call(arguments,1),f,v;for(f in this._layers)v=this._layers[f],v[s]&&v[s].apply(v,c);return this},onAdd:function(s){this.eachLayer(s.addLayer,s)},onRemove:function(s){this.eachLayer(s.removeLayer,s)},eachLayer:function(s,c){for(var f in this._layers)s.call(c,this._layers[f]);return this},getLayer:function(s){return this._layers[s]},getLayers:function(){var s=[];return this.eachLayer(s.push,s),s},setZIndex:function(s){return this.invoke("setZIndex",s)},getLayerId:function(s){return p(s)}}),Fd=function(s,c){return new zo(s,c)},uo=zo.extend({addLayer:function(s){return this.hasLayer(s)?this:(s.addEventParent(this),zo.prototype.addLayer.call(this,s),this.fire("layeradd",{layer:s}))},removeLayer:function(s){return this.hasLayer(s)?(s in this._layers&&(s=this._layers[s]),s.removeEventParent(this),zo.prototype.removeLayer.call(this,s),this.fire("layerremove",{layer:s})):this},setStyle:function(s){return this.invoke("setStyle",s)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var s=new V;for(var c in this._layers){var f=this._layers[c];s.extend(f.getBounds?f.getBounds():f.getLatLng())}return s}}),Ep=function(s,c){return new uo(s,c)},hl=K.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(s){S(this,s)},createIcon:function(s){return this._createIcon("icon",s)},createShadow:function(s){return this._createIcon("shadow",s)},_createIcon:function(s,c){var f=this._getIconUrl(s);if(!f){if(s==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var v=this._createImg(f,c&&c.tagName==="IMG"?c:null);return this._setIconStyles(v,s),(this.options.crossOrigin||this.options.crossOrigin==="")&&(v.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),v},_setIconStyles:function(s,c){var f=this.options,v=f[c+"Size"];typeof v=="number"&&(v=[v,v]);var C=F(v),U=F(c==="shadow"&&f.shadowAnchor||f.iconAnchor||C&&C.divideBy(2,!0));s.className="leaflet-marker-"+c+" "+(f.className||""),U&&(s.style.marginLeft=-U.x+"px",s.style.marginTop=-U.y+"px"),C&&(s.style.width=C.x+"px",s.style.height=C.y+"px")},_createImg:function(s,c){return c=c||document.createElement("img"),c.src=s,c},_getIconUrl:function(s){return Ue.retina&&this.options[s+"RetinaUrl"]||this.options[s+"Url"]}});function qS(s){return new hl(s)}var Md=hl.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(s){return typeof Md.imagePath!="string"&&(Md.imagePath=this._detectIconPath()),(this.options.imagePath||Md.imagePath)+hl.prototype._getIconUrl.call(this,s)},_stripUrl:function(s){var c=function(f,v,C){var U=v.exec(f);return U&&U[C]};return s=c(s,/^url\((['"])?(.+)\1\)$/,2),s&&c(s,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var s=Vt("div","leaflet-default-icon-path",document.body),c=$n(s,"background-image")||$n(s,"backgroundImage");if(document.body.removeChild(s),c=this._stripUrl(c),c)return c;var f=document.querySelector('link[href$="leaflet.css"]');return f?f.href.substring(0,f.href.length-11-1):""}}),x5=se.extend({initialize:function(s){this._marker=s},addHooks:function(){var s=this._marker._icon;this._draggable||(this._draggable=new oe(s,s,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),Tt(s,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&wr(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(s){var c=this._marker,f=c._map,v=this._marker.options.autoPanSpeed,C=this._marker.options.autoPanPadding,U=ot(c._icon),de=f.getPixelBounds(),je=f.getPixelOrigin(),Te=M(de.min._subtract(je).add(C),de.max._subtract(je).subtract(C));if(!Te.contains(U)){var qe=F((Math.max(Te.max.x,U.x)-Te.max.x)/(de.max.x-Te.max.x)-(Math.min(Te.min.x,U.x)-Te.min.x)/(de.min.x-Te.min.x),(Math.max(Te.max.y,U.y)-Te.max.y)/(de.max.y-Te.max.y)-(Math.min(Te.min.y,U.y)-Te.min.y)/(de.min.y-Te.min.y)).multiplyBy(v);f.panBy(qe,{animate:!1}),this._draggable._newPos._add(qe),this._draggable._startPos._add(qe),Br(c._icon,this._draggable._newPos),this._onDrag(s),this._panRequest=B(this._adjustPan.bind(this,s))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(s){this._marker.options.autoPan&&(ee(this._panRequest),this._panRequest=B(this._adjustPan.bind(this,s)))},_onDrag:function(s){var c=this._marker,f=c._shadow,v=ot(c._icon),C=c._map.layerPointToLatLng(v);f&&Br(f,v),c._latlng=C,s.latlng=C,s.oldLatLng=this._oldLatLng,c.fire("move",s).fire("drag",s)},_onDragEnd:function(s){ee(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",s)}}),Rp=Ci.extend({options:{icon:new Md,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(s,c){S(this,c),this._latlng=Z(s)},onAdd:function(s){this._zoomAnimated=this._zoomAnimated&&s.options.markerZoomAnimation,this._zoomAnimated&&s.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(s){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&s.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(s){var c=this._latlng;return this._latlng=Z(s),this.update(),this.fire("move",{oldLatLng:c,latlng:this._latlng})},setZIndexOffset:function(s){return this.options.zIndexOffset=s,this.update()},getIcon:function(){return this.options.icon},setIcon:function(s){return this.options.icon=s,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var s=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(s)}return this},_initIcon:function(){var s=this.options,c="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),f=s.icon.createIcon(this._icon),v=!1;f!==this._icon&&(this._icon&&this._removeIcon(),v=!0,s.title&&(f.title=s.title),f.tagName==="IMG"&&(f.alt=s.alt||"")),Tt(f,c),s.keyboard&&(f.tabIndex="0",f.setAttribute("role","button")),this._icon=f,s.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&kt(f,"focus",this._panOnFocus,this);var C=s.icon.createShadow(this._shadow),U=!1;C!==this._shadow&&(this._removeShadow(),U=!0),C&&(Tt(C,c),C.alt=""),this._shadow=C,s.opacity<1&&this._updateOpacity(),v&&this.getPane().appendChild(this._icon),this._initInteraction(),C&&U&&this.getPane(s.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&hr(this._icon,"focus",this._panOnFocus,this),qt(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&qt(this._shadow),this._shadow=null},_setPos:function(s){this._icon&&Br(this._icon,s),this._shadow&&Br(this._shadow,s),this._zIndex=s.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(s){this._icon&&(this._icon.style.zIndex=this._zIndex+s)},_animateZoom:function(s){var c=this._map._latLngToNewLayerPoint(this._latlng,s.zoom,s.center).round();this._setPos(c)},_initInteraction:function(){if(this.options.interactive&&(Tt(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),x5)){var s=this.options.draggable;this.dragging&&(s=this.dragging.enabled(),this.dragging.disable()),this.dragging=new x5(this),s&&this.dragging.enable()}},setOpacity:function(s){return this.options.opacity=s,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var s=this.options.opacity;this._icon&&ai(this._icon,s),this._shadow&&ai(this._shadow,s)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var s=this._map;if(s){var c=this.options.icon.options,f=c.iconSize?F(c.iconSize):F(0,0),v=c.iconAnchor?F(c.iconAnchor):F(0,0);s.panInside(this._latlng,{paddingTopLeft:v,paddingBottomRight:f.subtract(v)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function HS(s,c){return new Rp(s,c)}var zs=Ci.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(s){this._renderer=s.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(s){return S(this,s),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&s&&Object.prototype.hasOwnProperty.call(s,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),Ip=zs.extend({options:{fill:!0,radius:10},initialize:function(s,c){S(this,c),this._latlng=Z(s),this._radius=this.options.radius},setLatLng:function(s){var c=this._latlng;return this._latlng=Z(s),this.redraw(),this.fire("move",{oldLatLng:c,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(s){return this.options.radius=this._radius=s,this.redraw()},getRadius:function(){return this._radius},setStyle:function(s){var c=s&&s.radius||this._radius;return zs.prototype.setStyle.call(this,s),this.setRadius(c),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var s=this._radius,c=this._radiusY||s,f=this._clickTolerance(),v=[s+f,c+f];this._pxBounds=new A(this._point.subtract(v),this._point.add(v))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(s){return s.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function GS(s,c){return new Ip(s,c)}var _0=Ip.extend({initialize:function(s,c,f){if(typeof c=="number"&&(c=o({},f,{radius:c})),S(this,c),this._latlng=Z(s),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(s){return this._mRadius=s,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var s=[this._radius,this._radiusY||this._radius];return new V(this._map.layerPointToLatLng(this._point.subtract(s)),this._map.layerPointToLatLng(this._point.add(s)))},setStyle:zs.prototype.setStyle,_project:function(){var s=this._latlng.lng,c=this._latlng.lat,f=this._map,v=f.options.crs;
1048if(v.distance===X.distance){var C=Math.PI/180,U=this._mRadius/X.R/C,de=f.project([c+U,s]),je=f.project([c-U,s]),Te=de.add(je).divideBy(2),qe=f.unproject(Te).lat,lt=Math.acos((Math.cos(U*C)-Math.sin(c*C)*Math.sin(qe*C))/(Math.cos(c*C)*Math.cos(qe*C)))/C;(isNaN(lt)||lt===0)&&(lt=U/Math.cos(Math.PI/180*c)),this._point=Te.subtract(f.getPixelOrigin()),this._radius=isNaN(lt)?0:Te.x-f.project([qe,s-lt]).x,this._radiusY=Te.y-de.y}else{var Ct=v.unproject(v.project(this._latlng).subtract([this._mRadius,0]));this._point=f.latLngToLayerPoint(this._latlng),this._radius=this._point.x-f.latLngToLayerPoint(Ct).x}this._updateBounds()}});function JS(s,c,f){return new _0(s,c,f)}var Ko=zs.extend({options:{smoothFactor:1,noClip:!1},initialize:function(s,c){S(this,c),this._setLatLngs(s)},getLatLngs:function(){return this._latlngs},setLatLngs:function(s){return this._setLatLngs(s),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(s){for(var c=1/0,f=null,v=Kr,C,U,de=0,je=this._parts.length;de<je;de++)for(var Te=this._parts[de],qe=1,lt=Te.length;qe<lt;qe++){C=Te[qe-1],U=Te[qe];var Ct=v(s,C,U,!0);Ct<c&&(c=Ct,f=v(s,C,U))}return f&&(f.distance=Math.sqrt(c)),f}
1048,getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return pl(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(s,c){return c=c||this._defaultShape(),s=Z(s),c.push(s),this._bounds.extend(s),this.redraw()},_setLatLngs:function(s){this._bounds=new V,this._latlngs=this._convertLatLngs(s)},_defaultShape:function(){return Qr(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(s){for(var c=[],f=Qr(s),v=0,C=s.length;v<C;v++)f?(c[v]=Z(s[v]),this._bounds.extend(c[v])):c[v]=this._convertLatLngs(s[v]);return c},_project:function(){var s=new A;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,s),this._bounds.isValid()&&s.isValid()&&(this._rawPxBounds=s,this._updateBounds())},_updateBounds:function(){var s=this._clickTolerance(),c=new G(s,s);this._rawPxBounds&&(this._pxBounds=new A([this._rawPxBounds.min.subtract(c),this._rawPxBounds.max.add(c)]))},_projectLatlngs:function(s,c,f){var v=s[0]instanceof N,C=s.length,U,de;if(v){for(de=[],U=0;U<C;U++)de[U]=this._map.latLngToLayerPoint(s[U]),f.extend(de[U]);c.push(de)}else for(U=0;U<C;U++)this._projectLatlngs(s[U],c,f)},_clipPoints:function(){var s=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(s))){if(this.options.noClip){this._parts=this._rings;return}var c=this._parts,f,v,C,U,de,je,Te;for(f=0,C=0,U=this._rings.length;f<U;f++)for(Te=this._rings[f],v=0,de=Te.length;v<de-1;v++)je=Un(Te[v],Te[v+1],s,v,!0),je&&(c[C]=c[C]||[],c[C].push(je[0]),(je[1]!==Te[v+1]||v===de-2)&&(c[C].push(je[1]),C++))}},_simplifyPoints:function(){for(var s=this._parts,c=this.options.smoothFactor,f=0,v=s.length;f<v;f++)s[f]=Mt(s[f],c)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(s,c){var f,v,C,U,de,je,Te=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(s))return!1;for(f=0,U=this._parts.length;f<U;f++)for(je=this._parts[f],v=0,de=je.length,C=de-1;v<de;C=v++)if(!(!c&&v===0)&&lr(s,je[C],je[v])<=Te)return!0;return!1}});function ZS(s,c){return new Ko(s,c)}Ko._flat=ga;var gl=Ko.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length}
1048,getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Oe(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(s){var c=Ko.prototype._convertLatLngs.call(this,s),f=c.length;return f>=2&&c[0]instanceof N&&c[0].equals(c[f-1])&&c.pop(),c},_setLatLngs:function(s){Ko.prototype._setLatLngs.call(this,s),Qr(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Qr(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var s=this._renderer._bounds,c=this.options.weight,f=new G(c,c);if(s=new A(s.min.subtract(f),s.max.add(f)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(s))){if(this.options.noClip){this._parts=this._rings;return}for(var v=0,C=this._rings.length,U;v<C;v++)U=ie(this._rings[v],s,!0),U.length&&this._parts.push(U)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(s){var c=!1,f,v,C,U,de,je,Te,qe;if(!this._pxBounds||!this._pxBounds.contains(s))return!1;for(U=0,Te=this._parts.length;U<Te;U++)for(f=this._parts[U],de=0,qe=f.length,je=qe-1;de<qe;je=de++)v=f[de],C=f[je],v.y>s.y!=C.y>s.y&&s.x<(C.x-v.x)*(s.y-v.y)/(C.y-v.y)+v.x&&(c=!c);return c||Ko.prototype._containsPoint.call(this,s,!0)}});function YS(s,c){return new gl(s,c)}var Qo=uo.extend({initialize:function(s,c){S(this,c),this._layers={},s&&this.addData(s)},addData:function(s){var c=j(s)?s:s.features,f,v,C;if(c){for(f=0,v=c.length;f<v;f++)C=c[f],(C.geometries||C.geometry||C.features||C.coordinates)&&this.addData(C);return this}var U=this.options;if(U.filter&&!U.filter(s))return this;var de=Tp(s,U);return de?(de.feature=Fp(s),de.defaultOptions=de.options,this.resetStyle(de),U.onEachFeature&&U.onEachFeature(s,de),this.addLayer(de)):this},resetStyle:function(s){return s===void 0?this.eachLayer(this.resetStyle,this):(s.options=o({},s.defaultOptions),this._setLayerStyle(s,this.options.style),this)},setStyle:function(s){return this.eachLayer(function(c){this._setLayerStyle(c,s)},this)},_setLayerStyle:function(s,c){s.setStyle&&(typeof c=="function"&&(c=c(s.feature)),s.setStyle(c))}});function Tp(s,c){var f=s.type==="Feature"?s.geometry:s,v=f?f.coordinates:null,C=[],U=c&&c.pointToLayer,de=c&&c.coordsToLatLng||S0,je,Te,qe,lt;if(!v&&!f)return null;switch(f.type){case"Point":return je=de(v),m5(U,s,je,c);case"MultiPoint":for(qe=0,lt=v.length;qe<lt;qe++)je=de(v[qe]),C.push(m5(U,s,je,c));return new uo(C);case"LineString":case"MultiLineString":return Te=Ap(v,f.type==="LineString"?0:1,de),new Ko(Te,c);case"Polygon":case"MultiPolygon":return Te=Ap(v,f.type==="Polygon"?1:2,de),new gl(Te,c);case"GeometryCollection":for(qe=0,lt=f.geometries.length;qe<lt;qe++){var Ct=Tp({geometry:f.geometries[qe],type:"Feature",properties:s.properties},c);Ct&&C.push(Ct)}return new uo(C);case"FeatureCollection":for(qe=0,lt=f.features.length;qe<lt;qe++){var Yt=Tp(f.features[qe],c);Yt&&C.push(Yt)}return new uo(C);default:throw new Error("Invalid GeoJSON object.")}}function m5(s,c,f,v){return s?s(c,f):new Rp(f,v&&v.markersInheritOptions&&v)}function S0(s){return new N(s[1],s[0],s[2])}function Ap(s,c,f){for(var v=[],C=0,U=s.length,de;C<U;C++)de=c?Ap(s[C],c-1,f):(f||S0)(s[C]),v.push(de);return v}function k0(s,c){return s=Z(s),s.alt!==void 0?[x(s.lng,c),x(s.lat,c),x(s.alt,c)]:[x(s.lng,c),x(s.lat,c)]}function Pp(s,c,f,v){for(var C=[],U=0,de=s.length;U<de;U++)C.push(c?Pp(s[U],Qr(s[U])?0:c-1,f,v):k0(s[U],v));return!c&&f&&C.length>0&&C.push(C[0].slice()),C}function fl(s,c){return s.feature?o({},s.feature,{geometry:c}):Fp(c)}function Fp(s){return s.type==="Feature"||s.type==="FeatureCollection"?s:{type:"Feature",properties:{},geometry:s}}var C0={toGeoJSON:function(s){return fl(this,{type:"Point",coordinates:k0(this.getLatLng(),s)})}};Rp.include(C0),_0.include(C0),Ip.include(C0),Ko.include({toGeoJSON:function(s){var c=!Qr(this._latlngs),f=Pp(this._latlngs,c?1:0,!1,s);return fl(this,{type:(c?"Multi":"")+"LineString",coordinates:f})}}),gl.include({toGeoJSON:function(s){var c=!Qr(this._latlngs),f=c&&!Qr(this._latlngs[0]),v=Pp(this._latlngs,f?2:c?1:0,!0,s);return c||(v=[v]),fl(this,{type:(f?"Multi":"")+"Polygon",coordinates:v})}}),zo.include({toMultiPoint:function(s){var c=[];return this.eachLayer(function(f){c.push(f.toGeoJSON(s).geometry.coordinates)}),fl(this,{type:"MultiPoint",coordinates:c})},toGeoJSON:function(s){var c=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(c==="MultiPoint")return this.toMultiPoint(s);var f=c==="GeometryCollection",v=[];return this.eachLayer(function(C){if(C.toGeoJSON){var U=C.toGeoJSON(s);if(f)v.push(U.geometry);else{var de=Fp(U);de.type==="FeatureCollection"?v.push.apply(v,de.features):v.push(de)}}}),f?fl(this,{geometries:v,type:"GeometryCollection"}):{type:"FeatureCollection",features:v}}});function y5(s,c){return new Qo(s,c)}var XS=y5,Mp=Ci.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(s,c,f){this._url=s,this._bounds=H(c),S(this,f)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Tt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){qt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(s){return this.options.opacity=s,this._image&&this._updateOpacity(),this},setStyle:function(s){return s.opacity&&this.setOpacity(s.opacity),this},bringToFront:function(){return this._map&&bn(this._image),this},bringToBack:function(){return this._map&&so(this._image),this},setUrl:function(s){return this._url=s,this._image&&(this._image.src=s),this},setBounds:function(s){return this._bounds=H(s),this._map&&this._reset(),this},getEvents:function(){var s={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(s.zoomanim=this._animateZoom),s},setZIndex:function(s){return this.options.zIndex=s,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var s=this._url.tagName==="IMG",c=this._image=s?this._url:Vt("img");if(Tt(c,"leaflet-image-layer"),this._zoomAnimated&&Tt(c,"leaflet-zoom-animated"),this.options.className&&Tt(c,this.options.className),c.onselectstart=h,c.onmousemove=h,c.onload=l(this.fire,this,"load"),c.onerror=l(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(c.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),s){this._url=c.src;return}c.src=this._url,c.alt=this.options.alt},_animateZoom:function(s){var c=this._map.getZoomScale(s.zoom),f=this._map._latLngBoundsToNewLayerBounds(this._bounds,s.zoom,s.center).min;Si(this._image,f,c)},_reset:function(){var s=this._image,c=new A(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),f=c.getSize();Br(s,c.min),s.style.width=f.x+"px",s.style.height=f.y+"px"},_updateOpacity:function(){ai(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var s=this.options.errorOverlayUrl;s&&this._url!==s&&(this._url=s,this._image.src=s)},getCenter:function(){return this._bounds.getCenter()}}),KS=function(s,c,f){return new Mp(s,c,f)},b5=Mp.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInl
vendor: 5,696 bytes, line 1048
1048ine:!0},_initImage:function(){var s=this._url.tagName==="VIDEO",c=this._image=s?this._url:Vt("video");if(Tt(c,"leaflet-image-layer"),this._zoomAnimated&&Tt(c,"leaflet-zoom-animated"),this.options.className&&Tt(c,this.options.className),c.onselectstart=h,c.onmousemove=h,c.onloadeddata=l(this.fire,this,"load"),s){for(var f=c.getElementsByTagName("source"),v=[],C=0;C<f.length;C++)v.push(f[C].src);this._url=f.length>0?v:[c.src];return}j(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(c.style,"objectFit")&&(c.style.objectFit="fill"),c.autoplay=!!this.options.autoplay,c.loop=!!this.options.loop,c.muted=!!this.options.muted,c.playsInline=!!this.options.playsInline;for(var U=0;U<this._url.length;U++){var de=Vt("source");de.src=this._url[U],c.appendChild(de)}}});function QS(s,c,f){return new b5(s,c,f)}var v5=Mp.extend({_initImage:function(){var s=this._image=this._url;Tt(s,"leaflet-image-layer"),this._zoomAnimated&&Tt(s,"leaflet-zoom-animated"),this.options.className&&Tt(s,this.options.className),s.onselectstart=h,s.onmousemove=h}});function ek(s,c,f){return new v5(s,c,f)}var Eo=Ci.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(s,c){s&&(s instanceof N||j(s))?(this._latlng=Z(s),S(this,c)):(S(this,s),this._source=c),this.options.content&&(this._content=this.options.content)},openOn:function(s){return s=arguments.length?s:this._source._map,s.hasLayer(this)||s.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(s){return this._map?this.close():(arguments.length?this._source=s:s=this._source,this._prepareOpen(),this.openOn(s._map)),this},onAdd:function(s){this._zoomAnimated=s._zoomAnimated,this._container||this._initLayout(),s._fadeAnimated&&ai(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),s._fadeAnimated&&ai(this._container,1),this.bringToFront(),this.options.interactive&&(Tt(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(s){s._fadeAnimated?(ai(this._container,0),this._removeTimeout=setTimeout(l(qt,void 0,this._container),200)):qt(this._container),this.options.interactive&&(wr(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(s){return this._latlng=Z(s),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(s){return this._content=s,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var s={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(s.zoomanim=this._animateZoom),s},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&bn(this._container),this},bringToBack:function(){return this._map&&so(this._container),this},_prepareOpen:function(s){var c=this._source;if(!c._map)return!1;if(c instanceof uo){c=null;var f=this._source._layers;for(var v in f)if(f[v]._map){c=f[v];break}if(!c)return!1;this._source=c}if(!s)if(c.getCenter)s=c.getCenter();else if(c.getLatLng)s=c.getLatLng();else if(c.getBounds)s=c.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(s),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var s=this._contentNode,c=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof c=="string")s.innerHTML=c;else{for(;s.hasChildNodes();)s.removeChild(s.firstChild);s.appendChild(c)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var s=this._map.latLngToLayerPoint(this._latlng),c=F(this.options.offset),f=this._getAnchor();this._zoomAnimated?Br(this._container,s.add(f)):c=c.add(s).add(f);var v=this._containerBottom=-c.y,C=this._containerLeft=-Math.round(this._containerWidth/2)+c.x;this._container.style.bottom=v+"px",this._container.style.left=C+"px"}},_getAnchor:function(){return[0,0]}});et.include({_initOverlay:function(s,c,f,v){var C=c;return C instanceof s||(C=new s(v).setContent(c)),f&&C.setLatLng(f),C}}),Ci.include({_initOverlay:function(s,c,f,v){var C=f;return C instanceof s?(S(C,v),C._source=this):(C=c&&!v?c:new s(v,this),C.setContent(f)),C}});var Dp=Eo.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(s){return s=arguments.length?s:this._source._map,!s.hasLayer(this)&&s._popup&&s._popup.options.autoClose&&s.removeLayer(s._popup),s._popup=this,Eo.prototype.openOn.call(this,s)},onAdd:function(s){Eo.prototype.onAdd.call(this,s),s.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof zs||this._source.on("preclick",ln))},onRemove:function(s){Eo.prototype.onRemove.call(this,s),s.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof zs||this._source.off("preclick",ln))},getEvents:function(){var s=Eo.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(s.preclick=this.close),this.options.keepInView&&
1048(s.moveend=this._adjustPan),s},_initLayout:function(){var s="leaflet-popup",c=this._container=Vt("div",s+" "+(this.options.className||"")+" leaflet-zoom-animated"),f=this._wrapper=Vt("div",s+"-content-wrapper",c);if(this._contentNode=Vt("div",s+"-content",f),Zi(c),ua(this._contentNode),kt(c,"contextmenu",ln),this._tipContainer=Vt("div",s+"-tip-container",c),this._tip=Vt("div",s+"-tip",this._tipContainer),this.options.closeButton){var v=this._closeButton=Vt("a",s+"-close-button",c);v.setAttribute("role","button"),v.setAttribute("aria-label","Close popup"),v.href="#close",v.innerHTML='<span aria-hidden="true">×</span>',kt(v,"click",function(C){Xr(C),this.close()},this)}},_updateLayout:function(){var s=this._contentNode,c=s.style;c.width="",c.whiteSpace="nowrap";var f=s.offsetWidth;f=Math.min(f,this.options.maxWidth),f=Math.max(f,this.options.minWidth),c.width=f+1+"px",c.whiteSpace="",c.height="";var v=s.offsetHeight,C=this.options.maxHeight,U="leaflet-popup-scrolled";C&&v>C?(c.height=C+"px",Tt(s,U)):wr(s,U),this._containerWidth=this._container.offsetWidth},_animateZoom:function(s){var c=this._map._latLngToNewLayerPoint(this._latlng,s.zoom,s.center),f=this._getAnchor();Br(this._container,c.add(f))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var s=this._map,c=parseInt($n(this._container,"marginBottom"),10)||0,f=this._container.offsetHeight+c,v=this._containerWidth,C=new G(this._containerLeft,-f-this._containerBottom);C._add(ot(this._container));var U=s.layerPointToContainerPoint(C),de=F(this.options.autoPanPadding),je=F(this.options.autoPanPaddingTopLeft||de),Te=F(this.options.autoPanPaddingBottomRight||de),qe=s.getSize(),lt=0,Ct=0;U.x+v+Te.x>qe.x&&(lt=U.x+v-qe.x+Te.x),U.x-lt-je.x<0&&(lt=U.x-je.x),U.y+f+Te.y>qe.y&&(Ct=U.y+f-qe.y+Te.y),U.y-Ct-je.y<0&&(Ct=U.y-je.y),(lt||Ct)&&(this.options.keepInView&&(this._autopanning=!0),s.fire("autopanstart").panBy([lt,Ct]))}},_getAnchor:function(){return F(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),tk=function(s,c){return new Dp(s,c)};et.mergeOptions({closePopupOnClick:!0}),et.include({openPopup:function(s,c,f){return this._initOverlay(Dp,s,c,f).openOn(this),this},closePopup:function(s){return s=arguments.length?s:this._popup,s&&s.close(),this}}),Ci.include({bindPopup:function(s,c){return this._popup=this._initOverlay(Dp,this._popup,s,c),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(s){return this._popup&&(this instanceof uo||(this._popup._source=this),this._popup._prepareOpen(s||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(s){return this._popup&&this._popup.setContent(s),this},getPopup:function(){return this._popup},_openPopup:function(s){if(!(!this._popup||!this._map)){Nn(s);var c=s.layer||s.target;if(this._popup._source===c&&!(c instanceof zs)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(s.latlng);return}this._popup._source=c,this.openPopup(s.latlng)}},_movePopup:function(s){this._popup.setLatLng(s.latlng)},_onKeyPress:function(s){s.originalEvent.keyCode===13&&this._openPopup(s)}});var Bp=Eo.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(s){Eo.prototype.onAdd.call(this,s),this.setOpacity(this.options.opacity),s.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(s){Eo.prototype.onRemove.call(this,s),s.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var s=Eo.prototype.getEvents.call(this);return this.options.permanent||(s.preclick=this.close),s},_initLayout:function(){var s="leaflet-tooltip",c=s+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Vt("div",c),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+p(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(s){var c,f,v=this._map,C=this._container,U=v.latLngToContainerPoint(v.getCenter()),de=v.layerPointToContainerPoint(s),je=this.options.direction,Te=C.offsetWidth,qe=C.offsetHeight,lt=F(this.options.offset),Ct=this._getAnchor();je==="top"?(c=Te/2,f=qe):je==="bottom"?(c=Te/2,f=0):je==="center"?(c=Te/2,f=qe/2):je==="right"?(c=0,f=qe/2):je==="left"?
1048(c=Te,f=qe/2):de.x<U.x?(je="right",c=0,f=qe/2):(je="left",c=Te+(lt.x+Ct.x)*2,f=qe/2),s=s.subtract(F(c,f,!0)).add(lt).add(Ct),wr(C,"leaflet-tooltip-right"),wr(C,"leaflet-tooltip-left"),wr(C,"leaflet-tooltip-top"),wr(C,"leaflet-tooltip-bottom"),Tt(C,"leaflet-tooltip-"+je),Br(C,s)},_updatePosition:function(){var s=this._map.latLngToLayerPoint(this._latlng);this._setPosition(s)},setOpacity:function(s){this.options.opacity=s,this._container&&ai(this._container,s)},_animateZoom:function(s){var c=this._map._latLngToNewLayerPoint(this._latlng,s.zoom,s.center);this._setPosition(c)},_getAnchor:function(){return F(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),rk=function(s,c){return new Bp(s,c)};et.include({openTooltip:function(s,c,f){return this._initOverlay(Bp,s,c,f).openOn(this),this},closeTooltip:function(s){return s.close(),this}}),Ci.include({bindTooltip:function(s,c){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Bp,this._tooltip,s,c),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(s){if(!(!s&&this._tooltipHandlersAdded)){var c=s?"off":"on",f={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?f.add=this._openTooltip:(f.mouseover=this._openTooltip,f.mouseout=this.closeTooltip,f.click=this._openTooltip,this._map?this._addFocusListeners():f.add=this._addFocusListeners),this._tooltip.options.sticky&&(f.mousemove=this._moveTooltip),this[c](f),this._tooltipHandlersAdded=!s}},openTooltip:function(s){return this._tooltip&&(this instanceof uo||(this._tooltip._source=this),this._tooltip._prepareOpen(s)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(s){return this._tooltip&&this._tooltip.setContent(s),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(s){var c=typeof s.getElement=="function"&&s.getElement();c&&(kt(c,"focus",function(){this._tooltip._source=s,this.openTooltip()},this),kt(c,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(s){var c=typeof s.getElement=="function"&&s.getElement();c&&c.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(s){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var c=this;this._map.once("moveend",function(){c._openOnceFlag=!1,c._openTooltip(s)});return}this._tooltip._source=s.layer||s.target,this.openTooltip(this._tooltip.options.sticky?s.latlng:void 0)}},_moveTooltip:function(s){var c=s.latlng,f,v;this._tooltip.options.sticky&&s.originalEvent&&(f=this._map.mouseEventToContainerPoint(s.originalEvent),v=this._map.containerPointToLayerPoint(f),c=this._map.layerPointToLatLng(v)),this._tooltip.setLatLng(c)}});var j5=hl.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(s){var c=s&&s.tagName==="DIV"?s:document.createElement("div"),f=this.options;if(f.html instanceof Element?(Ai(c),c.appendChild(f.html)):c.innerHTML=f.html!==!1?f.html:"",f.bgPos){var v=F(f.bgPos);c.style.backgroundPosition=-v.x+"px "+-v.y+"px"}return this._setIconStyles(c,"icon"),c},createShadow:function(){return null}});function ik(s){return new j5(s)}hl.Default=Md;var Dd=Ci.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Ue.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(s){S(this,s)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()}
1048,beforeAdd:function(s){s._addZoomLimit(this)},onRemove:function(s){this._removeAllTiles(),qt(this._container),s._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(bn(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(so(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(s){return this.options.opacity=s,this._updateOpacity(),this},setZIndex:function(s){return this.options.zIndex=s,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var s=this._clampZoom(this._map.getZoom());s!==this._tileZoom&&(this._tileZoom=s,this._updateLevels()),this._update()}return this},getEvents:function(){var s={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=u(this._onMoveEnd,this.options.updateInterval,this)),s.move=this._onMove),this._zoomAnimated&&(s.zoomanim=this._animateZoom),s},createTile:function(){return document.createElement("div")},getTileSize:function(){var s=this.options.tileSize;return s instanceof G?s:new G(s,s)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(s){for(var c=this.getPane().children,f=-s(-1/0,1/0),v=0,C=c.length,U;v<C;v++)U=c[v].style.zIndex,c[v]!==this._container&&U&&(f=s(f,+U));isFinite(f)&&(this.options.zIndex=f+s(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Ue.ielt9){ai(this._container,this.options.opacity);var s=+new Date,c=!1,f=!1;for(var v in this._tiles){var C=this._tiles[v];if(!(!C.current||!C.loaded)){var U=Math.min(1,(s-C.loaded)/200);ai(C.el,U),U<1?c=!0:(C.active?f=!0:this._onOpaqueTile(C),C.active=!0)}}f&&!this._noPrune&&this._pruneTiles(),c&&(ee(this._fadeFrame),this._fadeFrame=B(this._updateOpacity,this))}},_onOpaqueTile:h,_initContainer:function(){this._container||(this._container=Vt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var s=this._tileZoom,c=this.options.maxZoom;if(s!==void 0){for(var f in this._levels)f=Number(f),this._levels[f].el.children.length||f===s?(this._levels[f].el.style.zIndex=c-Math.abs(s-f),this._onUpdateLevel(f)):(qt(this._levels[f].el),this._removeTilesAtZoom(f),this._onRemoveLevel(f),delete this._levels[f]);var v=this._levels[s],C=this._map;return v||(v=this._levels[s]={},v.el=Vt("div","leaflet-tile-container leaflet-zoom-animated",this._container),v.el.style.zIndex=c,v.origin=C.project(C.unproject(C.getPixelOrigin()),s).round(),v.zoom=s,this._setZoomTransform(v,C.getCenter(),C.getZoom()),h(v.el.offsetWidth),this._onCreateLevel(v)),this._level=v,v}},_onUpdateLevel:h,_onRemoveLevel:h,_onCreateLevel:h,_pruneTiles:function(){if(this._map){var s,c,f=this._map.getZoom();if(f>this.options.maxZoom||f<this.options.minZoom){this._removeAllTiles();return}for(s in this._tiles)c=this._tiles[s],c.retain=c.current;for(s in this._tiles)if(c=this._tiles[s],c.current&&!c.active){var v=c.coords;this._retainParent(v.x,v.y,v.z,v.z-5)||this._retainChildren(v.x,v.y,v.z,v.z+2)}for(s in this._tiles)this._tiles[s].retain||this._removeTile(s)}},_removeTilesAtZoom:function(s){for(var c in this._tiles)this._tiles[c].coords.z===s&&this._removeTile(c)},_removeAllTiles:function(){for(var s in this._tiles)this._removeTile(s)},_invalidateAll:function(){for(var s in this._levels)qt(this._levels[s].el),this._onRemoveLevel(Number(s)),delete this._levels[s];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(s,c,f,v){var C=Math.floor(s/2),U=Math.floor(c/2),de=f-1,je=new G(+C,+U);je.z=+de;var Te=this._tileCoordsToKey(je),qe=this._tiles[Te];return qe&&qe.active?(qe.retain=!0,!0):(qe&&qe.loaded&&(qe.retain=!0),de>v?this._retainParent(C,U,de,v):!1)},_retainChildren:function(s,c,f,v){for(var C=2*s;C<2*s+2;C++)for(var U=2*c;U<2*c+2;U++){var de=new G(C,U);de.z=f+1;var je=this._tileCoordsToKey(de),Te=this._tiles[je];if(Te&&Te.active){Te.retain=!0;continue}else Te&&Te.loaded&&(Te.retain=!0);f+1<v&&this._retainChildren(C,U,f+1,v)}},_resetView:function(s){var c=s&&(s.pinch||s.flyTo);
vendor: 5,923 bytes, line 1048
1048this._setView(this._map.getCenter(),this._map.getZoom(),c,c)},_animateZoom:function(s){this._setView(s.center,s.zoom,!0,s.noUpdate)},_clampZoom:function(s){var c=this.options;return c.minNativeZoom!==void 0&&s<c.minNativeZoom?c.minNativeZoom:c.maxNativeZoom!==void 0&&c.maxNativeZoom<s?c.maxNativeZoom:s},_setView:function(s,c,f,v){var C=Math.round(c);this.options.maxZoom!==void 0&&C>this.options.maxZoom||this.options.minZoom!==void 0&&C<this.options.minZoom?C=void 0:C=this._clampZoom(C);var U=this.options.updateWhenZooming&&C!==this._tileZoom;(!v||U)&&(this._tileZoom=C,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),C!==void 0&&this._update(s),f||this._pruneTiles(),this._noPrune=!!f),this._setZoomTransforms(s,c)},_setZoomTransforms:function(s,c){for(var f in this._levels)this._setZoomTransform(this._levels[f],s,c)},_setZoomTransform:function(s,c,f){var v=this._map.getZoomScale(f,s.zoom),C=s.origin.multiplyBy(v).subtract(this._map._getNewPixelOrigin(c,f)).round();Ue.any3d?Si(s.el,C,v):Br(s.el,C)},_resetGrid:function(){var s=this._map,c=s.options.crs,f=this._tileSize=this.getTileSize(),v=this._tileZoom,C=this._map.getPixelWorldBounds(this._tileZoom);C&&(this._globalTileRange=this._pxBoundsToTileRange(C)),this._wrapX=c.wrapLng&&!this.options.noWrap&&[Math.floor(s.project([0,c.wrapLng[0]],v).x/f.x),Math.ceil(s.project([0,c.wrapLng[1]],v).x/f.y)],this._wrapY=c.wrapLat&&!this.options.noWrap&&[Math.floor(s.project([c.wrapLat[0],0],v).y/f.x),Math.ceil(s.project([c.wrapLat[1],0],v).y/f.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(s){var c=this._map,f=c._animatingZoom?Math.max(c._animateToZoom,c.getZoom()):c.getZoom(),v=c.getZoomScale(f,this._tileZoom),C=c.project(s,this._tileZoom).floor(),U=c.getSize().divideBy(v*2);return new A(C.subtract(U),C.add(U))},_update:function(s){var c=this._map;if(c){var f=this._clampZoom(c.getZoom());if(s===void 0&&(s=c.getCenter()),this._tileZoom!==void 0){var v=this._getTiledPixelBounds(s),C=this._pxBoundsToTileRange(v),U=C.getCenter(),de=[],je=this.options.keepBuffer,Te=new A(C.getBottomLeft().subtract([je,-je]),C.getTopRight().add([je,-je]));if(!(isFinite(C.min.x)&&isFinite(C.min.y)&&isFinite(C.max.x)&&isFinite(C.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var qe in this._tiles){var lt=this._tiles[qe].coords;(lt.z!==this._tileZoom||!Te.contains(new G(lt.x,lt.y)))&&(this._tiles[qe].current=!1)}if(Math.abs(f-this._tileZoom)>1){this._setView(s,f);return}for(var Ct=C.min.y;Ct<=C.max.y;Ct++)for(var Yt=C.min.x;Yt<=C.max.x;Yt++){var Xi=new G(Yt,Ct);if(Xi.z=this._tileZoom,!!this._isValidTile(Xi)){var zi=this._tiles[this._tileCoordsToKey(Xi)];zi?zi.current=!0:de.push(Xi)}}if(de.sort(function(dn,ml){return dn.distanceTo(U)-ml.distanceTo(U)}),de.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Vn=document.createDocumentFragment();for(Yt=0;Yt<de.length;Yt++)this._addTile(de[Yt],Vn);this._level.el.appendChild(Vn)}}}},_isValidTile:function(s){var c=this._map.options.crs;if(!c.infinite){var f=this._globalTileRange;if(!c.wrapLng&&(s.x<f.min.x||s.x>f.max.x)||!c.wrapLat&&(s.y<f.min.y||s.y>f.max.y))return!1}if(!this.options.bounds)return!0;var v=this._tileCoordsToBounds(s);return H(this.options.bounds).overlaps(v)},_keyToBounds:function(s){return this._tileCoordsToBounds(this._keyToTileCoords(s))},_tileCoordsToNwSe:function(s){var c=this._map,f=this.getTileSize(),v=s.scaleBy(f),C=v.add(f),U=c.unproject(v,s.z),de=c.unproject(C,s.z);return[U,de]},_tileCoordsToBounds:function(s){var c=this._tileCoordsToNwSe(s),f=new V(c[0],c[1]);return this.options.noWrap||(f=this._map.wrapLatLngBounds(f)),f},_tileCoordsToKey:function(s){return s.x+":"+s.y+":"+s.z},_keyToTileCoords:function(s){var c=s.split(":"),f=new G(+c[0],+c[1]);return f.z=+c[2],f},_removeTile:function(s){var c=this._tiles[s];c&&(qt(c.el),delete this._tiles[s],this.fire("tileunload",{tile:c.el,coords:this._keyToTileCoords(s)}))},_initTile:function(s){Tt(s,"leaflet-tile");var c=this.getTileSize();s.style.width=c.x+"px",s.style.height=c.y+"px",s.onselectstart=h,s.onmousemove=h,Ue.ielt9&&this.options.opacity<1&&ai(s,this.options.opacity)},_addTile:function(s,c){var f=this._getTilePos(s),v=this._tileCoordsToKey(s),C=this.createTile(this._wrapCoords(s),l(this._tileReady,this,s));this._initTile(C),this.createTile.length<2&&B(l(this._tileReady,this,s,null,C)),Br(C,f),this._tiles[v]={el:C,coords:s,current:!0},c.appendChild(C),this.fire("tileloadstart",{tile:C,coords:s})},_tileReady:function(s,c,f){c&&this.fire("tileerror",{error:c,tile:f,coords:s});var v=this._tileCoordsToKey(s);f=this._tiles[v],f&&(f.loaded=+new Date,this._map._fadeAnimated?(ai(f.el,0),ee(this._fadeFrame),this._fadeFrame=B(this._updateOpacity,this)):(f.active=!0,this._pruneTiles()),c||(Tt(f.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:f.el,coords:s})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Ue.ielt9||!this._map._fadeAnimated?B(this._pruneTiles,this):setTimeout(l(this._pruneTiles,this),250)))},_getTilePos:function(s){return s.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(s){var c=new G(this._wrapX?g(s.x,this._wrapX):s.x,this._wrapY?g(s.y,this._wrapY):s.y);return c.z=s.z,c},_pxBoundsToTileRange:function(s){var c=this.getTileSize();return new A(s.min.unscaleBy(c).floor(),s.max.unscaleBy(c).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var s in this._tiles)if(!this._tiles[s].loaded)return!1;return!0}});function nk(s){return new Dd(s)}var xl=Dd.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(s,c){this._url=s,c=S(this,c),c.detectRetina&&Ue.retina&&c.maxZoom>0?(c.tileSize=Math.floor(c.tileSize/2),c.zoomReverse?(c.zoomOffset--,c.minZoom=Math.min(c.maxZoom,c.minZ
vendor: 4,674 bytes, line 1048
1048oom+1)):(c.zoomOffset++,c.maxZoom=Math.max(c.minZoom,c.maxZoom-1)),c.minZoom=Math.max(0,c.minZoom)):c.zoomReverse?c.minZoom=Math.min(c.maxZoom,c.minZoom):c.maxZoom=Math.max(c.minZoom,c.maxZoom),typeof c.subdomains=="string"&&(c.subdomains=c.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(s,c){return this._url===s&&c===void 0&&(c=!0),this._url=s,c||this.redraw(),this},createTile:function(s,c){var f=document.createElement("img");return kt(f,"load",l(this._tileOnLoad,this,c,f)),kt(f,"error",l(this._tileOnError,this,c,f)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(f.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(f.referrerPolicy=this.options.referrerPolicy),f.alt="",f.src=this.getTileUrl(s),f},getTileUrl:function(s){var c={r:Ue.retina?"@2x":"",s:this._getSubdomain(s),x:s.x,y:s.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var f=this._globalTileRange.max.y-s.y;this.options.tms&&(c.y=f),c["-y"]=f}return b(this._url,o(c,this.options))},_tileOnLoad:function(s,c){Ue.ielt9?setTimeout(l(s,this,null,c),0):s(null,c)},_tileOnError:function(s,c,f){var v=this.options.errorTileUrl;v&&c.getAttribute("src")!==v&&(c.src=v),s(f,c)},_onTileRemove:function(s){s.tile.onload=null},_getZoomForUrl:function(){var s=this._tileZoom,c=this.options.maxZoom,f=this.options.zoomReverse,v=this.options.zoomOffset;return f&&(s=c-s),s+v},_getSubdomain:function(s){var c=Math.abs(s.x+s.y)%this.options.subdomains.length;return this.options.subdomains[c]},_abortLoading:function(){var s,c;for(s in this._tiles)if(this._tiles[s].coords.z!==this._tileZoom&&(c=this._tiles[s].el,c.onload=h,c.onerror=h,!c.complete)){c.src=P;var f=this._tiles[s].coords;qt(c),delete this._tiles[s],this.fire("tileabort",{tile:c,coords:f})}},_removeTile:function(s){var c=this._tiles[s];if(c)return c.el.setAttribute("src",P),Dd.prototype._removeTile.call(this,s)},_tileReady:function(s,c,f){if(!(!this._map||f&&f.getAttribute("src")===P))return Dd.prototype._tileReady.call(this,s,c,f)}});function w5(s,c){return new xl(s,c)}var _5=xl.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(s,c){this._url=s;var f=o({},this.defaultWmsParams);for(var v in c)v in this.options||(f[v]=c[v]);c=S(this,c);var C=c.detectRetina&&Ue.retina?2:1,U=this.getTileSize();f.width=U.x*C,f.height=U.y*C,this.wmsParams=f},onAdd:function(s){this._crs=this.options.crs||s.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var c=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[c]=this._crs.code,xl.prototype.onAdd.call(this,s)},getTileUrl:function(s){var c=this._tileCoordsToNwSe(s),f=this._crs,v=M(f.project(c[0]),f.project(c[1])),C=v.min,U=v.max,de=(this._wmsVersion>=1.3&&this._crs===_r?[C.y,C.x,U.y,U.x]:[C.x,C.y,U.x,U.y]).join(","),je=xl.prototype.getTileUrl.call(this,s);return je+k(this.wmsParams,je,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+de},setParams:function(s,c){return o(this.wmsParams,s),c||this.redraw(),this}});function ok(s,c){return new _5(s,c)}xl.WMS=_5,w5.wms=ok;var es=Ci.extend({options:{padding:.1},initialize:function(s){S(this,s),p(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Tt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var s={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(s.zoomanim=this._onAnimZoom),s},_onAnimZoom:function(s){this._updateTransform(s.center,s.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(s,c){var f=this._map.getZoomScale(c,this._zoom),v=this._map.getSize().multiplyBy(.5+this.options.padding),C=this._map.project(this._center,c),U=v.multiplyBy(-f).add(C).subtract(this._map._getNewPixelOrigin(s,c));Ue.any3d?Si(this._container,U,f):Br(this._container,U)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var s in this._layers)this._layers[s]._reset()},_onZoomEnd:function(){for(var s in this._layers)this._layers[s]._project()},_updatePaths:function(){for(var s in this._layers)this._layers[s]._update()},_update:function(){var s=this.options.padding,c=this._map.getSize(),f=this._map.containerPointToLayerPoint(c.multiplyBy(-s)).round();
vendor: 4,463 bytes, line 1048
1048this._bounds=new A(f,f.add(c.multiplyBy(1+s*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),S5=es.extend({options:{tolerance:0},getEvents:function(){var s=es.prototype.getEvents.call(this);return s.viewprereset=this._onViewPreReset,s},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){es.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var s=this._container=document.createElement("canvas");kt(s,"mousemove",this._onMouseMove,this),kt(s,"click dblclick mousedown mouseup contextmenu",this._onClick,this),kt(s,"mouseout",this._handleMouseOut,this),s._leaflet_disable_events=!0,this._ctx=s.getContext("2d")},_destroyContainer:function(){ee(this._redrawRequest),delete this._ctx,qt(this._container),hr(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var s;this._redrawBounds=null;for(var c in this._layers)s=this._layers[c],s._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){es.prototype._update.call(this);var s=this._bounds,c=this._container,f=s.getSize(),v=Ue.retina?2:1;Br(c,s.min),c.width=v*f.x,c.height=v*f.y,c.style.width=f.x+"px",c.style.height=f.y+"px",Ue.retina&&this._ctx.scale(2,2),this._ctx.translate(-s.min.x,-s.min.y),this.fire("update")}},_reset:function(){es.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(s){this._updateDashArray(s),this._layers[p(s)]=s;var c=s._order={layer:s,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=c),this._drawLast=c,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(s){this._requestRedraw(s)},_removePath:function(s){var c=s._order,f=c.next,v=c.prev;f?f.prev=v:this._drawLast=v,v?v.next=f:this._drawFirst=f,delete s._order,delete this._layers[p(s)],this._requestRedraw(s)},_updatePath:function(s){this._extendRedrawBounds(s),s._project(),s._update(),this._requestRedraw(s)},_updateStyle:function(s){this._updateDashArray(s),this._requestRedraw(s)},_updateDashArray:function(s){if(typeof s.options.dashArray=="string"){var c=s.options.dashArray.split(/[, ]+/),f=[],v,C;for(C=0;C<c.length;C++){if(v=Number(c[C]),isNaN(v))return;f.push(v)}s.options._dashArray=f}else s.options._dashArray=s.options.dashArray},_requestRedraw:function(s){this._map&&(this._extendRedrawBounds(s),this._redrawRequest=this._redrawRequest||B(this._redraw,this))},_extendRedrawBounds:function(s){if(s._pxBounds){var c=(s.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new A,this._redrawBounds.extend(s._pxBounds.min.subtract([c,c])),this._redrawBounds.extend(s._pxBounds.max.add([c,c]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var s=this._redrawBounds;if(s){var c=s.getSize();this._ctx.clearRect(s.min.x,s.min.y,c.x,c.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var s,c=this._redrawBounds;if(this._ctx.save(),c){var f=c.getSize();this._ctx.beginPath(),this._ctx.rect(c.min.x,c.min.y,f.x,f.y),this._ctx.clip()}this._drawing=!0;for(var v=this._drawFirst;v;v=v.next)s=v.layer,(!c||s._pxBounds&&s._pxBounds.intersects(c))&&s._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(s,c){if(this._drawing){var f,v,C,U,de=s._parts,je=de.length,Te=this._ctx;if(je){for(Te.beginPath(),f=0;f<je;f++){for(v=0,C=de[f].length;v<C;v++)U=de[f][v],Te[v?"lineTo":"moveTo"](U.x,U.y);c&&Te.closePath()}this._fillStroke(Te,s)}}},_updateCircle:function(s){if(!(!this._drawing||s._empty())){var c=s._point,f=this._ctx,v=Math.max(Math.round(s._radius),1),C=(Math.max(Math.round(s._radiusY),1)||v)/v;C!==1&&(f.save(),f.scale(1,C)),f.beginPath(),f.arc(c.x,c.y/C,v,0,Math.PI*2,!1),C!==1&&f.restore(),this._fillStroke(f,s)}},_fillStroke:function(s,c){var f=c.options;f.fill&&(s.globalAlpha=f.fillOpacity,s.fillStyle=f.fillColor||f.color,s.fill(f.fillRule||"evenodd")),f.stroke&&f.weight!==0&&(s.setLineDash&&s.setLineDash(c.options&&c.options._dashArray||[]),s.globalAlpha=f.opacity,s.lineWidth=f.weight,s.strokeStyle=f.color,s.lineCap=f.lineCap,s.lineJoin=f.lineJoin,s.stroke())},_onClick:function(s){for(var c=this._map.mouseEventToLayerPoint(s),f,v,C=this._drawFirst;C;
vendor: 5,475 bytes, line 1048
1048C=C.next)f=C.layer,f.options.interactive&&f._containsPoint(c)&&(!(s.type==="click"||s.type==="preclick")||!this._map._draggableMoved(f))&&(v=f);this._fireEvent(v?[v]:!1,s)},_onMouseMove:function(s){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var c=this._map.mouseEventToLayerPoint(s);this._handleMouseHover(s,c)}},_handleMouseOut:function(s){var c=this._hoveredLayer;c&&(wr(this._container,"leaflet-interactive"),this._fireEvent([c],s,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(s,c){if(!this._mouseHoverThrottled){for(var f,v,C=this._drawFirst;C;C=C.next)f=C.layer,f.options.interactive&&f._containsPoint(c)&&(v=f);v!==this._hoveredLayer&&(this._handleMouseOut(s),v&&(Tt(this._container,"leaflet-interactive"),this._fireEvent([v],s,"mouseover"),this._hoveredLayer=v)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,s),this._mouseHoverThrottled=!0,setTimeout(l(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(s,c,f){this._map._fireDOMEvent(c,f||c.type,s)},_bringToFront:function(s){var c=s._order;if(c){var f=c.next,v=c.prev;if(f)f.prev=v;else return;v?v.next=f:f&&(this._drawFirst=f),c.prev=this._drawLast,this._drawLast.next=c,c.next=null,this._drawLast=c,this._requestRedraw(s)}},_bringToBack:function(s){var c=s._order;if(c){var f=c.next,v=c.prev;if(v)v.next=f;else return;f?f.prev=v:v&&(this._drawLast=v),c.prev=null,c.next=this._drawFirst,this._drawFirst.prev=c,this._drawFirst=c,this._requestRedraw(s)}}});function k5(s){return Ue.canvas?new S5(s):null}var Bd=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(s){return document.createElement("<lvml:"+s+' class="lvml">')}}catch{}return function(s){return document.createElement("<"+s+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),sk={_initContainer:function(){this._container=Vt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(es.prototype._update.call(this),this.fire("update"))},_initPath:function(s){var c=s._container=Bd("shape");Tt(c,"leaflet-vml-shape "+(this.options.className||"")),c.coordsize="1 1",s._path=Bd("path"),c.appendChild(s._path),this._updateStyle(s),this._layers[p(s)]=s},_addPath:function(s){var c=s._container;this._container.appendChild(c),s.options.interactive&&s.addInteractiveTarget(c)},_removePath:function(s){var c=s._container;qt(c),s.removeInteractiveTarget(c),delete this._layers[p(s)]},_updateStyle:function(s){var c=s._stroke,f=s._fill,v=s.options,C=s._container;C.stroked=!!v.stroke,C.filled=!!v.fill,v.stroke?(c||(c=s._stroke=Bd("stroke")),C.appendChild(c),c.weight=v.weight+"px",c.color=v.color,c.opacity=v.opacity,v.dashArray?c.dashStyle=j(v.dashArray)?v.dashArray.join(" "):v.dashArray.replace(/( *, *)/g," "):c.dashStyle="",c.endcap=v.lineCap.replace("butt","flat"),c.joinstyle=v.lineJoin):c&&(C.removeChild(c),s._stroke=null),v.fill?(f||(f=s._fill=Bd("fill")),C.appendChild(f),f.color=v.fillColor||v.color,f.opacity=v.fillOpacity):f&&(C.removeChild(f),s._fill=null)},_updateCircle:function(s){var c=s._point.round(),f=Math.round(s._radius),v=Math.round(s._radiusY||f);this._setPath(s,s._empty()?"M0 0":"AL "+c.x+","+c.y+" "+f+","+v+" 0,"+65535*360)},_setPath:function(s,c){s._path.v=c},_bringToFront:function(s){bn(s._container)},_bringToBack:function(s){so(s._container)}},Op=Ue.vml?Bd:Pe,Od=es.extend({_initContainer:function(){this._container=Op("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Op("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){qt(this._container),hr(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){es.prototype._update.call(this);var s=this._bounds,c=s.getSize(),f=this._container;(!this._svgSize||!this._svgSize.equals(c))&&(this._svgSize=c,f.setAttribute("width",c.x),f.setAttribute("height",c.y)),Br(f,s.min),f.setAttribute("viewBox",[s.min.x,s.min.y,c.x,c.y].join(" ")),this.fire("update")}},_initPath:function(s){var c=s._path=Op("path");s.options.className&&Tt(c,s.options.className),s.options.interactive&&Tt(c,"leaflet-interactive"),this._updateStyle(s),this._layers[p(s)]=s},_addPath:function(s){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(s._path),s.addInteractiveTarget(s._path)},_removePath:function(s){qt(s._path),s.removeInteractiveTarget(s._path),delete this._layers[p(s)]},_updatePath:function(s){s._project(),s._update()},_updateStyle:function(s){var c=s._path,f=s.options;c&&(f.stroke?(c.setAttribute("stroke",f.color),c.setAttribute("stroke-opacity",f.opacity),c.setAttribute("stroke-width",f.weight),c.setAttribute("stroke-linecap",f.lineCap),c.setAttribute("stroke-linejoin",f.lineJoin),f.dashArray?c.setAttribute("stroke-dasharray",f.dashArray):c.removeAttribute("stroke-dasharray"),f.dashOffset?c.setAttribute("stroke-dashoffset",f.dashOffset):c.removeAttribute("stroke-dashoffset")):c.setAttribute("stroke","none"),f.fill?(c.setAttribute("fill",f.fillColor||f.color),c.setAttribute("fill-opacity",f.fillOpacity),c.setAttribute("fill-rule",f.fillRule||"evenodd")):c.setAttribute("fill","none"))},_updatePoly:function(s,c){this._setPath(s,Ce(s._parts,c))},_updateCircle:function(s){var c=s._point,f=Math.max(Math.round(s._radius),1),v=Math.max(Math.round(s._radiusY),1)||f,C="a"+f+","+v+" 0 1,0 ",U=s._empty()?"M0 0":"M"+(c.x-f)+","+c.y+C+f*2
1048+",0 "+C+-f*2+",0 ";this._setPath(s,U)},_setPath:function(s,c){s._path.setAttribute("d",c)},_bringToFront:function(s){bn(s._path)},_bringToBack:function(s){so(s._path)}});Ue.vml&&Od.include(sk);function C5(s){return Ue.svg||Ue.vml?new Od(s):null}et.include({getRenderer:function(s){var c=s.options.renderer||this._getPaneRenderer(s.options.pane)||this.options.renderer||this._renderer;return c||(c=this._renderer=this._createRenderer()),this.hasLayer(c)||this.addLayer(c),c},_getPaneRenderer:function(s){if(s==="overlayPane"||s===void 0)return!1;var c=this._paneRenderers[s];return c===void 0&&(c=this._createRenderer({pane:s}),this._paneRenderers[s]=c),c},_createRenderer:function(s){return this.options.preferCanvas&&k5(s)||C5(s)}});var z5=gl.extend({initialize:function(s,c){gl.prototype.initialize.call(this,this._boundsToLatLngs(s),c)},setBounds:function(s){return this.setLatLngs(this._boundsToLatLngs(s))},_boundsToLatLngs:function(s){return s=H(s),[s.getSouthWest(),s.getNorthWest(),s.getNorthEast(),s.getSouthEast()]}});function ak(s,c){return new z5(s,c)}Od.create=Op,Od.pointsToPath=Ce,Qo.geometryToLayer=Tp,Qo.coordsToLatLng=S0,Qo.coordsToLatLngs=Ap,Qo.latLngToCoords=k0,Qo.latLngsToCoords=Pp,Qo.getFeature=fl,Qo.asFeature=Fp,et.mergeOptions({boxZoom:!0});var E5=se.extend({initialize:function(s){this._map=s,this._container=s._container,this._pane=s._panes.overlayPane,this._resetStateTimeout=0,s.on("unload",this._destroy,this)},addHooks:function(){kt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){hr(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){qt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(s){if(!s.shiftKey||s.which!==1&&s.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Zr(),js(),this._startPoint=this._map.mouseEventToContainerPoint(s),kt(document,{contextmenu:Nn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(s){this._moved||(this._moved=!0,this._box=Vt("div","leaflet-zoom-box",this._container),Tt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(s);var c=new A(this._point,this._startPoint),f=c.getSize();Br(this._box,c.min),this._box.style.width=f.x+"px",this._box.style.height=f.y+"px"},_finish:function(){this._moved&&(qt(this._box),wr(this._container,"leaflet-crosshair")),vr(),vn(),hr(document,{contextmenu:Nn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(s){if(!(s.which!==1&&s.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(l(this._resetState,this),0);var c=new V(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(c).fire("boxzoomend",{boxZoomBounds:c})}},_onKeyDown:function(s){s.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});et.addInitHook("addHandler","boxZoom",E5),et.mergeOptions({doubleClickZoom:!0});var R5=se.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(s){var c=this._map,f=c.getZoom(),v=c.options.zoomDelta,C=s.originalEvent.shiftKey?f-v:f+v;c.options.doubleClickZoom==="center"?c.setZoom(C):c.setZoomAround(s.containerPoint,C)}});et.addInitHook("addHandler","doubleClickZoom",R5),et.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var I5=se.extend({addHooks:function(){if(!this._draggable){var s=this._map;this._draggable=new oe(s._mapPane,s._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),s.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),s.on("zoomend",this._onZoomEnd,this),s.whenReady(this._onZoomEnd,this))}Tt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){wr(this._map._container,"leaflet-grab"),wr(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved}
vendor: 7,898 bytes, line 1048
1048,moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var s=this._map;if(s._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var c=H(this._map.options.maxBounds);this._offsetLimit=M(this._map.latLngToContainerPoint(c.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(c.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;s.fire("movestart").fire("dragstart"),s.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(s){if(this._map.options.inertia){var c=this._lastTime=+new Date,f=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(f),this._times.push(c),this._prunePositions(c)}this._map.fire("move",s).fire("drag",s)},_prunePositions:function(s){for(;this._positions.length>1&&s-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var s=this._map.getSize().divideBy(2),c=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=c.subtract(s).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(s,c){return s-(s-c)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var s=this._draggable._newPos.subtract(this._draggable._startPos),c=this._offsetLimit;s.x<c.min.x&&(s.x=this._viscousLimit(s.x,c.min.x)),s.y<c.min.y&&(s.y=this._viscousLimit(s.y,c.min.y)),s.x>c.max.x&&(s.x=this._viscousLimit(s.x,c.max.x)),s.y>c.max.y&&(s.y=this._viscousLimit(s.y,c.max.y)),this._draggable._newPos=this._draggable._startPos.add(s)}},_onPreDragWrap:function(){var s=this._worldWidth,c=Math.round(s/2),f=this._initialWorldOffset,v=this._draggable._newPos.x,C=(v-c+f)%s+c-f,U=(v+c+f)%s-c-f,de=Math.abs(C+f)<Math.abs(U+f)?C:U;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=de},_onDragEnd:function(s){var c=this._map,f=c.options,v=!f.inertia||s.noInertia||this._times.length<2;if(c.fire("dragend",s),v)c.fire("moveend");else{this._prunePositions(+new Date);var C=this._lastPos.subtract(this._positions[0]),U=(this._lastTime-this._times[0])/1e3,de=f.easeLinearity,je=C.multiplyBy(de/U),Te=je.distanceTo([0,0]),qe=Math.min(f.inertiaMaxSpeed,Te),lt=je.multiplyBy(qe/Te),Ct=qe/(f.inertiaDeceleration*de),Yt=lt.multiplyBy(-Ct/2).round();!Yt.x&&!Yt.y?c.fire("moveend"):(Yt=c._limitOffset(Yt,c.options.maxBounds),B(function(){c.panBy(Yt,{duration:Ct,easeLinearity:de,noMoveStart:!0,animate:!0})}))}}});et.addInitHook("addHandler","dragging",I5),et.mergeOptions({keyboard:!0,keyboardPanDelta:80});var T5=se.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(s){this._map=s,this._setPanDelta(s.options.keyboardPanDelta),this._setZoomDelta(s.options.zoomDelta)},addHooks:function(){var s=this._map._container;s.tabIndex<=0&&(s.tabIndex="0"),kt(s,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),hr(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var s=document.body,c=document.documentElement,f=s.scrollTop||c.scrollTop,v=s.scrollLeft||c.scrollLeft;this._map._container.focus(),window.scrollTo(v,f)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(s){var c=this._panKeys={},f=this.keyCodes,v,C;for(v=0,C=f.left.length;v<C;v++)c[f.left[v]]=[-1*s,0];for(v=0,C=f.right.length;v<C;v++)c[f.right[v]]=[s,0];for(v=0,C=f.down.length;v<C;v++)c[f.down[v]]=[0,s];for(v=0,C=f.up.length;v<C;v++)c[f.up[v]]=[0,-1*s]},_setZoomDelta:function(s){var c=this._zoomKeys={},f=this.keyCodes,v,C;for(v=0,C=f.zoomIn.length;v<C;v++)c[f.zoomIn[v]]=s;for(v=0,C=f.zoomOut.length;v<C;v++)c[f.zoomOut[v]]=-s},_addHooks:function(){kt(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){hr(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(s){if(!(s.altKey||s.ctrlKey||s.metaKey)){var c=s.keyCode,f=this._map,v;if(c in this._panKeys){if(!f._panAnim||!f._panAnim._inProgress)if(v=this._panKeys[c],s.shiftKey&&(v=F(v).multiplyBy(3)),f.options.maxBounds&&(v=f._limitOffset(F(v),f.options.maxBounds)),f.options.worldCopyJump){var C=f.wrapLatLng(f.unproject(f.project(f.getCenter()).add(v)));f.panTo(C)}else f.panBy(v)}else if(c in this._zoomKeys)f.setZoom(f.getZoom()+(s.shiftKey?3:1)*this._zoomKeys[c]);else if(c===27&&f._popup&&f._popup.options.closeOnEscapeKey)f.closePopup();else return;Nn(s)}}});et.addInitHook("addHandler","keyboard",T5),et.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var A5=se.extend({addHooks:function(){kt(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){hr(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(s){var c=jn(s),f=this._map.options.wheelDebounceTime;this._delta+=c,this._lastMousePos=this._map.mouseEventToContainerPoint(s),this._startTime||(this._startTime=+new Date);var v=Math.max(f-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(l(this._performZoom,this),v),Nn(s)},_performZoom:function(){var s=this._map,c=s.getZoom(),f=this._map.options.zoomSnap||0;s._stop();var v=this._delta/(this._map.options.wheelPxPerZoomLevel*4),C=4*Math.log(2/(1+Math.exp(-Math.abs(v))))/Math.LN2,U=f?Math.ceil(C/f)*f:C,de=s._limitZoom(c+(this._delta>0?U:-U))-c;this._delta=0,this._startTime=null,de&&(s.options.scrollWheelZoom==="center"?s.setZoom(c+de):s.setZoomAround(this._lastMousePos,c+de))}});et.addInitHook("addHandler","scrollWheelZoom",A5);var lk=600;et.mergeOptions({tapHold:Ue.touchNative&&Ue.safari&&Ue.mobile,tapTolerance:15});var P5=se.extend({addHooks:function(){kt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){hr(this._map._container,"touchstart",this._onDown,this)},_onDown:function(s){if(clearTimeout(this._holdTimeout),s.touches.length===1){var c=s.touches[0];this._startPos=this._newPos=new G(c.clientX,c.clientY),this._holdTimeout=setTimeout(l(function(){this._cancel(),this._isTapValid()&&(kt(document,"touchend",Xr),kt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",c))},this),lk),kt(document,"touchend touchcancel contextmenu",this._cancel,this),kt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function s(){hr(document,"touchend",Xr),hr(document,"touchend touchcancel",s)},_cancel:function(){clearTimeout(this._holdTimeout),hr(document,"touchend touchcancel contextmenu",this._cancel,this),hr(document,"touchmove",this._onMove,this)},_onMove:function(s){var c=s.touches[0];this._newPos=new G(c.clientX,c.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(s,c){var f=new MouseEvent(s,{bubbles:!0,cancelable:!0,view:window,screenX:c.screenX,screenY:c.screenY,clientX:c.clientX,clientY:c.clientY});f._simulated=!0,c.target.dispatchEvent(f)}});et.addInitHook("addHandler","tapHold",P5),et.mergeOptions({touchZoom:Ue.touch,bounceAtZoomLimits:!0});var F5=se.extend({addHooks:function(){Tt(this._map._container,"leaflet-touch-zoom"),kt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){wr(this._map._container,"leaflet-touch-zoom"),hr(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(s){var c=this._map;if(!(!s.touches||s.touches.length!==2||c._animatingZoom||this._zooming)){var f=c.mouseEventToContainerPoint(s.touches[0]),v=c.mouseEventToContainerPoint(s.touches[1]);
1048this._centerPoint=c.getSize()._divideBy(2),this._startLatLng=c.containerPointToLatLng(this._centerPoint),c.options.touchZoom!=="center"&&(this._pinchStartLatLng=c.containerPointToLatLng(f.add(v)._divideBy(2))),this._startDist=f.distanceTo(v),this._startZoom=c.getZoom(),this._moved=!1,this._zooming=!0,c._stop(),kt(document,"touchmove",this._onTouchMove,this),kt(document,"touchend touchcancel",this._onTouchEnd,this),Xr(s)}},_onTouchMove:function(s){if(!(!s.touches||s.touches.length!==2||!this._zooming)){var c=this._map,f=c.mouseEventToContainerPoint(s.touches[0]),v=c.mouseEventToContainerPoint(s.touches[1]),C=f.distanceTo(v)/this._startDist;if(this._zoom=c.getScaleZoom(C,this._startZoom),!c.options.bounceAtZoomLimits&&(this._zoom<c.getMinZoom()&&C<1||this._zoom>c.getMaxZoom()&&C>1)&&(this._zoom=c._limitZoom(this._zoom)),c.options.touchZoom==="center"){if(this._center=this._startLatLng,C===1)return}else{var U=f._add(v)._divideBy(2)._subtract(this._centerPoint);if(C===1&&U.x===0&&U.y===0)return;this._center=c.unproject(c.project(this._pinchStartLatLng,this._zoom).subtract(U),this._zoom)}this._moved||(c._moveStart(!0,!1),this._moved=!0),ee(this._animRequest);var de=l(c._move,c,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=B(de,this,!0),Xr(s)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,ee(this._animRequest),hr(document,"touchmove",this._onTouchMove,this),hr(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});et.addInitHook("addHandler","touchZoom",F5),et.BoxZoom=E5,et.DoubleClickZoom=R5,et.Drag=I5,et.Keyboard=T5,et.ScrollWheelZoom=A5,et.TapHold=P5,et.TouchZoom=F5,i.Bounds=A,i.Browser=Ue,i.CRS=ae,i.Canvas=S5,i.Circle=_0,i.CircleMarker=Ip,i.Class=K,i.Control=bt,i.DivIcon=j5,i.DivOverlay=Eo,i.DomEvent=Ge,i.DomUtil=po,i.Draggable=oe,i.Evented=Q,i.FeatureGroup=uo,i.GeoJSON=Qo,i.GridLayer=Dd,i.Handler=se,i.Icon=hl,i.ImageOverlay=Mp,i.LatLng=N,i.LatLngBounds=V,i.Layer=Ci,i.LayerGroup=zo,i.LineUtil=fa,i.Map=et,i.Marker=Rp,i.Mixin=we,i.Path=zs,i.Point=G,i.PolyUtil=yt,i.Polygon=gl,i.Polyline=Ko,i.Popup=Dp,i.PosAnimation=ct,i.Projection=j0,i.Rectangle=z5,i.Renderer=es,i.SVG=Od,i.SVGOverlay=v5,i.TileLayer=xl,i.Tooltip=Bp,i.Transformation=ze,i.Util=te,i.VideoOverlay=b5,i.bind=l,i.bounds=M,i.canvas=k5,i.circle=JS,i.circleMarker=GS,i.control=Ee,i.divIcon=ik,i.extend=o,i.featureGroup=Ep,i.geoJSON=y5,i.geoJson=XS,i.gridLayer=nk,i.icon=qS,i.imageOverlay=KS,i.latLng=Z,i.latLngBounds=H,i.layerGroup=Fd,i.map=Qe,i.marker=HS,i.point=F,i.polygon=YS,i.polyline=ZS,i.popup=tk,i.rectangle=ak,i.setOptions=S,i.stamp=p,i.svg=C5,i.svgOverlay=ek,i.tileLayer=w5,i.tooltip=rk,i.transformation=ue,i.version=n,i.videoOverlay=QS;var dk=window.L;i.noConflict=function(){return window.L=dk,this},window.L=i})})(fx,fx.exports);var M7=fx.exports;const Rs=C1(M7),D7=e=>{let r=0;for(let o=0;o<e.length;o++)r=(r<<5)-r+e.charCodeAt(o)|0;const i=((r&65535)/65535-.5)*.015,n=((r>>16&65535)/65535-.5)*.02;return{latOff:i,lngOff:n}},B7=({onSelectMember:e,matches:r=[]})=>{const i=si(),{user:n,profile:o}=gr(),{mode:a,isErox:l,isFriend:d,lightMode:p}=dr(),u=m.useRef(null),g=m.useRef(null),h=m.useRef([]),x=m.useRef(null),[y,_]=m.useState([]),[S,k]=m.useState(!0),[w,b]=m.useState(!0),[j,T]=m.useState(!1),P=l?"#ff3333":d?"#26A69A":"#D4C4A8",I=(()=>
1048{if(!(o!=null&&o.location))return[48.8566,2.3522];let O=o.location;if(typeof O=="string")try{O=JSON.parse(O)}catch{return[48.8566,2.3522]}return O!=null&&O.lat&&(O!=null&&O.lng)?[O.lat,O.lng]:[48.8566,2.3522]})();m.useEffect(()=>{if(!u.current||g.current)return;const O=Rs.map(u.current,{center:I,zoom:11,zoomControl:!1,attributionControl:!1});Rs.control.zoom({position:"topleft"}).addTo(O);const E="https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png";x.current=Rs.tileLayer(E,{subdomains:"abcd",maxZoom:19,className:p?"":"dark-map-tiles"}).addTo(O);const $=Rs.divIcon({className:"you-are-here-marker",iconSize:[80,50],iconAnchor:[40,50],html:` 1049 <div style="display:flex;flex-direction:column;align-items:center;"> 1050 <div style=" 1051 background:rgba(220,38,38,0.9); color:white; 1052 padding:4px 12px; border-radius:12px; 1053 font-size:0.72rem; font-weight:700; font-family:Outfit,sans-serif; 1054 white-space:nowrap; text-align:center; 1055 border:1.5px solid rgba(255,100,100,0.6); 1056 box-shadow:0 2px 12px rgba(220,38,38,0.5); 1057 ">ð Vous êtes ici</div> 1058 <div style=" 1059 width:12px; height:12px; border-radius:50%; 1060 background:rgba(220,38,38,0.9); border:2px solid white; 1061 margin-top:4px; 1062 box-shadow:0 0 0 4px rgba(220,38,38,0.25), 0 0 0 8px rgba(220,38,38,0.1); 1063 animation:pulseRing 2s ease-out infinite; 1064 "></div> 1065 </div> 1066 `});return Rs.marker(I,{icon:$,zIndexOffset:1e3}).addTo(O),g.current=O,setTimeout(()=>O.invalidateSize(),200),()=>{O.remove(),g.current=null}},[]),m.useEffect(()=>{const O=g.current;if(!O||!x.current)return;O.removeLayer(x.current);const E="https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png";x.current=Rs.tileLayer(E,{subdomains:"abcd",maxZoom:19,className:p?"":"dark-map-tiles"}).addTo(O)},[p]),m.useEffect(()=>{g.current&&g.current.setView(I,11,{animate:!0})},[I]),m.useEffect(()=>{o&&b(o.show_on_map!==!1)},[o]),m.useEffect(()=>{n&&(async()=>{k(!0);try{const{data:E,error:$}=await D.from("profiles").select("*").eq("show_on_map",!0);if($)throw $;const B=l?"erox_tags":d?"friend_tags":"tags",ee=(E||[]).filter(te=>{if(te.id===(n==null?void 0:n.id)||!te.location||(Array.isArray(te[B])?te[B]:[]).length===0)return!1;let ne=te.location;if(typeof ne=="string")try{ne=JSON.parse(ne)}catch{return!1}return typeof ne!="object"||!ne?!1:ne.lat&&ne.lng}).map(te=>{let K=typeof te.location=="string"?JSON.parse(te.location):te.location;const ne=D7(te.id);let Re=te.name,Q=te.avatar_url||te.photo;return l?(Re=te.erox_name||te.name,Q=te.erox_avatar_url||te.avatar_url||te.photo):d&&(Re=te.friend_name||te.name,Q=te.friend_avatar_url||te.avatar_url||te.photo),{...te,displayName:Re,displayPhoto:Q,genderColor:te.gender==="female"?"#E91E8C":te.gender==="male"?"#3B82F6":P,fuzzyLat:K.lat+ne.latOff,fuzzyLng:K.lng+ne.lngOff,city:K.city||te.city||""}});_(ee)}catch(E){console.error("[MapView] Load error:",E)}finally{k(!1)}})()},[n,a]),m.useEffect(()=>{const O=g.current;if(!O)return;h.current.forEach($=>O.removeLayer($)),h.current=[];const E="data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22%3E%3Ccircle cx=%2250%22 cy=%2236%22 r=%2220%22 fill=%22%23555%22/%3E%3Cellipse cx=%2250%22 cy=%2290%22 rx=%2235%22 ry=%2228%22 fill=%22%23555%22/%3E%3C/svg%3E";y.forEach($=>{const B=$.genderColor||P,ee=Rs.divIcon({className:"custom-map-marker",iconSize:[42,52],iconAnchor:[21,52],popupAnchor:[0,-48],html:` 1067 <div style=" 1068 width:42px; height:42px; border-radius:50%; 1069 border:3px solid ${B}; 1070 overflow:hidden; box-shadow:0 2px 12px rgba(0,0,0,0.5), 0 0 8px ${B}40; 1071 background:#1a1a2e; 1072 ">
1073 <img src="${$.displayPhoto||E}" 1074 style="width:100%;height:100%;object-fit:cover;display:block;" 1075 onerror="this.onerror=null;this.src='${E}'" /> 1076 </div> 1077 <div style=" 1078 width:0; height:0; 1079 border-left:6px solid transparent; border-right:6px solid transparent; 1080 border-top:8px solid ${B}; 1081 margin:-1px auto 0; 1082 "></div> 1083 `}),te=` 1084 <div class="map-popup-card" data-member-id="${$.id}" style=" 1085 display:flex; align-items:center; gap:12px; 1086 padding:10px 14px; cursor:pointer; 1087 background:rgba(20,18,35,0.95); 1088 border-radius:14px; 1089 border:1px solid ${B}33; 1090 min-width:180px; 1091 "> 1092 <img src="${$.displayPhoto||E}" 1093 style="width:48px;height:48px;border-radius:50%;object-fit:cover;border:2px solid ${B};flex-shrink:0;" 1094 onerror="this.onerror=null;this.src='${E}'" /> 1095 <div style="flex:1;min-width:0;"> 1096 <div style="font-weight:700;font-size:0.9rem;color:white;font-family:Outfit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"> 1097 ${$.displayName}${$.age?`, ${$.age}`:""} 1098 </div> 1099 ${$.city?`<div style="font-size:0.72rem;color:rgba(255,255,255,0.45);display:flex;align-items:center;gap:4px;margin-top:2px;">ð ${$.city}</div>`:""} 1100 <div style="font-size:0.65rem;color:${B};margin-top:3px;font-weight:600;">Voir le profil â</div> 1101 </div> 1102 </div> 1103 `,K=Rs.marker([$.fuzzyLat,$.fuzzyLng],{icon:ee}).bindPopup(te,{className:"custom-map-popup",closeButton:!1,maxWidth:260}).addTo(O);K.on("popupopen",()=>{const ne=document.querySelector(`.map-popup-card[data-member-id="${$.id}"]`);ne&&ne.addEventListener("click",()=>{const Re=r.find(Q=>Q.id===$.id);e(Re||{id:$.id,name:$.displayName,photo_url:$.displayPhoto,age:$.age,city:$.city,tags:$.tags||[],erox_tags:$.erox_tags||[],friend_tags:$.friend_tags||[],avatar_url:$.avatar_url,erox_avatar_url:$.erox_avatar_url,friend_avatar_url:$.friend_avatar_url,animated_photo_url:$.animated_photo_url,photos_eros:$.photos_eros||[],bio:$.bio||""})})}),h.current.push(K)})},[y,P,r,e]);const R=m.useCallback(async()=>{if(j)return;T(!0);const O=!w;b(O);try{const{error:E}=await D.from("profiles").update({show_on_map:O}).eq("id",n.id);E?(b(!O),i.error("Erreur : "+E.message)):i.success(O?"ð Vous êtes visible sur la carte":"ð Vous êtes invisible sur la carte")}catch(E){b(!O),i.error("Erreur : "+(E.message||"Erreur inconnue"))}finally{T(!1)}},[w,n,i,j]);return m.useEffect(()=>{const O=setTimeout(()=>{g.current&&g.current.invalidateSize()},300);return()=>clearTimeout(O)},[]),t.jsxs("div",{style:{width:"100%",height:"100%",position:"relative"},children:[t.jsx("div",{ref:u,style:{width:"100%",height:"100%"}}),t.jsxs("button",{onClick:R,disabled:j,style:{position:"absolute",top:"80px",right:"16px",zIndex:1e3,display:"flex",alignItems:"center",gap:"6px",background:w?"rgba(34,197,94,0.15)":"rgba(255,77,77,0.15)",border:`1px solid ${w?"rgba(34,197,94,0.3)":"rgba(255,77,77,0.3)"}`,borderRadius:"20px",padding:"8px 16px",color:w?"#22c55e":"#ff4d4d",fontSize:"0.78rem",fontWeight:"600",cursor:j?"wait":"pointer",backdropFilter:"blur(12px)",transition:"all 0.3s",boxShadow:"0 4px 16px rgba(0,0,0,0.3)"},children:[w?t.jsx(rr,{size:14}):t.jsx(al,{size:14}),w?"Visible":"Invisible"]}),t.jsxs("div",{style:{position:"absolute",top:"80px",left:"60px",zIndex:1e3,display:"flex",alignItems:"center",gap:"6px",background:"rgba(10,8,20,0.8)",backdropFilter:"blur(12px)",borderRadius:"16px",padding:"6px 14px",fontSize:"0.78rem",color:"rgba(255,255,255,0.7)",fontWeight:"600",boxShadow:"0 4px 16px rgba(0,0,0,0.3)"},children:[t.jsx(Ut,{size:14,color:P}),t.jsxs("span",{children:[y.length," membres"]})]}),S&&t.jsx("div",{style:{position:"absolute",inset:0,zIndex:999,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(10,8,20,0.8)",backdropFilter:"blur(8px)"},children:t.jsxs("div",{style:{textAlign:"center"},children:[t.jsx(qs,{size:32,color:P,style:{animation:"spin 1s linear infinite"}}),t.jsx("p",{style:{color:"rgba(255,255,255,0.5)",marginTop:"12px",fontSize:"0.85rem"},children:"Chargement des membres..."})]})}),t.jsx("div",{style:{position:"absolute",bottom:"12px",left:"50%",transform:"translateX(-50%)",zIndex:1e3,background:"rgba(10,8,20,0.75)",backdropFilter:"blur(8px)",padding:"4px 14px",borderRadius:"12px",fontSize:"0.62rem",color:"rgba(255,255,255,0.4)",whiteSpace:"nowrap",pointerEvents:"none"},children:"ð Les positions sont volontairement approximatives pour la confidentialité des membres"}),t.jsx("style",{children:` 1104 .custom-map-marker { 1105 background: none !important; 1106 border: none !important; 1107 } 1108 .leaflet-top.leaflet-left { 1109 top: 70px !important; 1110 } 1111 .leaflet-control-zoom { 1112 border: none !important; 1113 border-radius: 14px !important; 1114 overflow: hidden !important; 1115 box-shadow: 0 4px 20px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.06) !important; 1116 } 1117 .leaflet-control-zoom a { 1118 background: rgba(20,18,35,0.85) !important; 1119 backdrop-filter: blur(12px) !important; 1120 -webkit-backdrop-filter: blur(12px) !important; 1121 color: rgba(212,184,150,0.9) !important; 1122 border: none !important; 1123 border-bottom: 1px solid rgba(255,255,255,0.06) !important; 1124 width: 42px !important; 1125 height: 42px !important; 1126 line-height: 42px !important; 1127 font-size: 20px !important; 1128 font-weight: 300 !important; 1129 transition: all 0.2s ease !important; 1130 } 1131 .leaflet-control-zoom a:last-child { 1132 border-bottom: none !important; 1133 } 1134 .leaflet-control-zoom a:hover { 1135 background: rgba(212,184,150,0.2) !important; 1136 color: #D4B896 !important; 1137 } 1138 .leaflet-control-zoom a:active { 1139 background: rgba(212,184,150,0.3) !important; 1140 transform: scale(0.95); 1141 } 1142 .custom-map-popup .leaflet-popup-content-wrapper { 1143 background: transparent !important; 1144 box-shadow: none !important; 1145 border-radius: 14px !important; 1146 padding: 0 !important; 1147 } 1148 .custom-map-popup .leaflet-popup-content { 1149 margin: 0 !important; 1150 line-height: 1.4 !important; 1151 } 1152 .custom-map-popup .leaflet-popup-tip { 1153 background: rgba(20,18,35,0.95) !important; 1154 box-shadow: none !important; 1155 } 1156 @keyframes spin { 1157 from { transform: rotate(0deg); } 1158 to { transform: rotate(360deg); } 1159 } 1160 @keyframes pulseRing { 1161 0% { box-shadow: 0 0 0 0 rgba(220,38,38,0.5), 0 0 0 0 rgba(220,38,38,0.2); } 1162 70% { box-shadow: 0 0 0 10px rgba(220,38,38,0), 0 0 0 20px rgba(220,38,38,0); } 1163 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0), 0 0 0 0 rgba(220,38,38,0); } 1164 } 1165 .you-are-here-marker { 1166 background: none !important; 1167 border: none !important; 1168 } 1169 .dark-map-tiles { 1170 filter: brightness(0.82) contrast(1.1) saturate(0.3) !important; 1171 } 1172 `})]})};function y0(e){const[r,i]=m.useState(!1);return m.useEffect(()=>{if(!e)return;if(!li(`tutorial_seen_${e}`)){const a=setTimeout(()=>i(!0),500);return()=>clearTimeout(a)}},[e]),{showTutorial:r,markAsSeen:()=>{e&&(Or(`tutorial_seen_${e}`,"true"),i(!1))}}}const b0=({isOpen:e,onClose:r,steps:i})=>{const[n,o]=m.useState(0),[a,l]=m.useState({top:0,left:0,arrowDir:"none"}),[d,p]=m.useState(null),{mode:u,lightMode:g}=dr(),h=u==="EROX",x=u==="FRIEND",y=h?"#ff3333":x?"#26A69A":"#D4C4A8",_=h||x?"#ffffff"
1172:"#000000",S=m.useCallback(()=>{if(!e||!i||i.length===0)return;const I=i[n],R=I==null?void 0:I.targetRef;if(R!=null&&R.current){const O=R.current.getBoundingClientRect(),E=12,$=200,B=Math.min(340,window.innerWidth-32),ee=window.innerWidth,te=window.innerHeight,K=16;p({top:O.top-E,left:O.left-E,width:O.width+E*2,height:O.height+E*2,borderRadius:16});const ne=te-O.bottom,Re=O.top,Q=ne>$+30,G=Re>$+30;let le,F;Q?(le=O.bottom+K,F="up"):G?(le=O.top-$-K,F="down"):(le=Math.max(K,(te-$)/2),F="none"),le=Math.max(K,Math.min(le,te-$-K));const A=Math.max(K,Math.min(O.left+O.width/2-B/2,ee-B-K));l({top:le,left:A,arrowDir:F})}else p(null),l({top:0,left:0,arrowDir:"none"})},[e,i,n]);if(m.useEffect(()=>(S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)),[S]),m.useEffect(()=>{var R;if(!e||!i||i.length===0)return;const I=(R=i[n])==null?void 0:R.targetRef;if(I!=null&&I.current){I.current.scrollIntoView({behavior:"smooth",block:"center"});const O=setTimeout(S,400);return()=>clearTimeout(O)}},[n,e,i,S]),!e||!i||i.length===0)return null;const k=n===i.length-1,w=i[n].icon,b=a.arrowDir==="none",j=()=>{k?(o(0),r()):o(I=>I+1)},T=t.jsxs(t.Fragment,{children:[a.arrowDir==="up"&&t.jsx("div",{style:{position:"absolute",top:"-8px",left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"10px solid transparent",borderRight:"10px solid transparent",borderBottom:`10px solid ${y}50`}}),a.arrowDir==="down"&&t.jsx("div",{style:{position:"absolute",bottom:"-8px",left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"10px solid transparent",borderRight:"10px solid transparent",borderTop:`10px solid ${y}50`}}),t.jsx("div",{style:{position:"absolute",top:"30px",left:"50%",transform:"translateX(-50%)",width:"100px",height:"100px",background:y,filter:"blur(70px)",opacity:.12,borderRadius:"50%",pointerEvents:"none"}}),t.jsx("div",{style:{width:"44px",height:"44px",borderRadius:"14px",background:`${y}15`,border:`1px solid ${y}30`,display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 10px",color:y},children:w&&t.jsx(w,{size:22})}),t.jsx("h3",{style:{margin:"0 0 6px",fontSize:"1.05rem",fontFamily:"Playfair Display, serif",fontWeight:"600",color:g?"#2A2520":"white"},children:i[n].title}),t.jsx("p",{style:{margin:"0 0 14px",fontSize:"0.82rem",lineHeight:1.45,color:g?"#5C4A30":"rgba(255,255,255,0.6)",fontFamily:"Outfit, sans-serif"},children:i[n].description}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[i.length>1&&t.jsx("div",{style:{display:"flex",gap:"5px",flex:"0 0 auto"},children:i.map((I,R)=>t.jsx("div",{style:{width:R===n?"16px":"5px",height:"5px",borderRadius:"3px",background:R===n?y:g?"rgba(140,115,75,0.25)":"rgba(255,255,255,0.2)",transition:"all 0.3s"}},R))}),t.jsx(ye.button,{whileTap:{scale:.96},onClick:j,style:{flex:1,padding:"12px 16px",borderRadius:"12px",background:k?y:g?"rgba(140,115,75,0.1)":"rgba(255,255,255,0.08)",color:k?_:g?"#3D3528":"white",border:"none",fontSize:"0.9rem",fontWeight:"600",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",cursor:"pointer",transition:"background 0.3s"},children:k?t.jsxs(t.Fragment,{children:["C'est compris ",t.jsx(pr,{size:16})]}):t.jsxs(t.Fragment,{children:["Suivant ",t.jsx(En,{size:16})]})})]})]}),P={position:"relative",width:"100%",maxWidth:"360px",background:g?"linear-gradient(180deg, rgba(250, 247, 242, 0.98) 0%, rgba(240, 235, 225, 0.98) 100%)":"linear-gradient(180deg, rgba(30, 30, 35, 0.98) 0%, rgba(15, 15, 20, 0.98) 100%)",border:g?"2px solid rgba(140,115,75,0.25)":`1px solid ${y}30`,borderRadius:"20px",padding:"18px 16px",textAlign:"center",boxShadow:g?"0 20px 50px -10px rgba(120,100,60,0.2), 0 0 30px rgba(140,115,75,0.08)":`0 20px 50px -10px rgba(0,0,0,0.8), 0 0 30px ${y}15`,color:g?"#2A2520":"white",overflow:"hidden"};return t.jsxs("div",{style:{position:"fixed",inset:0,zIndex:9999,pointerEvents:"auto"},children:[!d&&t.jsx("div",{onClick:r,style:{position:"absolute",inset:0,background:g?"rgba(5, 5, 7, 0.5)":"rgba(5, 5, 7, 0.85)"}}),d&&t.jsx("div",{onClick:r,style:{position:"absolute",inset:0}}
1172),d&&t.jsx("div",{style:{position:"fixed",top:d.top,left:d.left,width:d.width,height:d.height,borderRadius:d.borderRadius,boxShadow:`0 0 0 9999px rgba(5, 5, 7, 0.85), 0 0 40px 10px ${y}50`,border:`2px solid ${y}90`,pointerEvents:"none",transition:"all 0.4s ease",zIndex:1e4}}),b&&t.jsx("div",{style:{position:"fixed",inset:0,zIndex:10001,display:"flex",alignItems:"center",justifyContent:"center",padding:"24px",pointerEvents:"none"},children:t.jsx(tr,{mode:"wait",children:t.jsx(ye.div,{initial:{opacity:0,y:15,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.97},transition:{type:"spring",bounce:.25,duration:.4},onClick:I=>I.stopPropagation(),style:{...P,pointerEvents:"auto"},children:T},n)})}),!b&&t.jsx(tr,{mode:"wait",children:t.jsx(ye.div,{initial:{opacity:0,y:15,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.97},transition:{type:"spring",bounce:.25,duration:.4},onClick:I=>I.stopPropagation(),style:{...P,position:"fixed",top:a.top,left:a.left,width:"85vw",maxWidth:"340px",zIndex:10001},children:T},n)})]})},O7=({profile:e,enrichedProfile:r,isPremium:i,isMobile:n,isErox:o,isFriend:a,mode:l,showMobileSidebar:d,setShowMobileSidebar:p,viewMode:u,setViewMode:g,topProfilesCount:h,likesReceivedCount:x,favoritesCount:y,passedMatchesCount:_,isFiltersOpen:S,setIsFiltersOpen:k,distFilter:w,setDistFilter:b,ageFilter:j,setAgeFilter:T,genderFilter:P,setGenderFilter:I,handleNearbyClick:R,isCriteriaOpen:O,setIsCriteriaOpen:E,activeSections:$,targetTagColumn:B,getActiveStyle:ee,navigate:te})=>t.jsxs("div",{className:`glass-panel custom-scrollbar ${d?"mobile-visible":""}`,style:{width:n?"85vw":"320px",minWidth:n?"auto":"320px",maxWidth:"320px",padding:n?"55px 0 0 0":"85px 0 0 0",display:"flex",flexDirection:"column",borderRight:"1px solid rgba(255,255,255,0.15)",background:o?"linear-gradient(180deg, #1a0505 0%, #000000 100%)":a?"linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%)":"linear-gradient(180deg, #0A1015 0%, #020508 100%)",color:"white",backdropFilter:"blur(30px)",zIndex:101,boxShadow:"10px 0 30px rgba(0,0,0,0.3)",overflowY:"auto",position:n?"fixed":"relative",height:"100%",top:0,left:0,transform:n?d?"translateX(0)":"translateX(-100%)":"none",transition:"transform 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},children:[n&&t.jsx("button",{onClick:()=>p(!1),"aria-label":"Fermer le menu",style:{position:"absolute",top:"20px",right:"20px",background:"rgba(255,255,255,0.1)",border:"none",borderRadius:"50%",padding:"8px",color:"white",cursor:"pointer"},children:t.jsx(mt,{size:24})}),t.jsxs("div",{style:{padding:n?"15px 18px":"30px",borderBottom:"1px solid rgba(255,255,255,0.1)"},children:[t.jsxs("h4",{style:{fontSize:"0.75rem",color:"var(--gold)",letterSpacing:"2px",textTransform:"uppercase",marginBottom:"20px",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx("span",{style:{width:"20px",height:"1px",background:"var(--gold)"}}),"Mon Espace"]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:n?"15px":"25px"},children:[t.jsxs("div",{style:{position:"relative"},children:[t.jsx(Mo,{photoUrl:o?e.erox_avatar_url||null:a?e.friend_avatar_url||null:e.avatar_url||e.photo||null,animatedUrl:!o&&!a?e.animated_photo_url:null,alt:"Profile",size:56,borderColor:"transparent",borderWidth:0}),i&&t.jsx("div",{style:{position:"absolute",bottom:"-2px",right:"-2px",background:"var(--gold)",borderRadius:"50%",padding:"4px",border:"2px solid var(--bg-dark)"},children:t.jsx(ni,{size:12,fill:"black"})})]}),t.jsxs("div",{children:[t.jsxs("h2",{style:{fontSize:"1.4rem",margin:0,fontFamily:"Outfit",display:"flex",alignItems:"center",gap:"8px"},children:[(o?e.erox_name||e.name:a&&e.friend_name||e.name)||"Utilisateur",e.verification_status==="verified"&&t.jsx(fi,{size:20,fill:"#26A69A",color:"#103030"})]}),t.jsx("span",{style:{fontSize:"0.85rem",color:"var(--text-muted)"},children:i?"Membre Premium":"Membre Gratuit"})]})]}),t.jsxs("div",{role:"navigation","aria-label":"Filtres de profils",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:n?"6px":"10px",marginBottom:n?"6px":"10px"},children:[t.jsxs("div",{onClick:()=>{g(K=>K==="score_filter"?"standard":"score_filter"),n&&p(!1)},role:"button","aria-label":"Filtrer les top profils","aria-current":u==="score_filter"?"true":void 0,style:{...ee(u==="score_filter"),padding:n?"10px 8px":"15px 10px",borderRadius:"15p
1172x",textAlign:"center",cursor:"pointer",transition:"all 0.3s",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[t.jsx("div",{style:{fontSize:"1.4rem",fontWeight:"bold",color:u==="score_filter"?"white":"var(--gold)"},children:h}),t.jsx("div",{style:{fontSize:"0.65rem",color:"var(--text-muted)",marginTop:"5px"},children:"Top Profils >80%"})]}),t.jsxs("div",{onClick:()=>{g(K=>K==="received_likes"?"standard":"received_likes"),n&&p(!1)},role:"button","aria-label":"Voir les likes reçus","aria-current":u==="received_likes"?"true":void 0,style:{background:u==="received_likes"?a?"rgba(38, 166, 154, 0.2)":"rgba(255, 77, 77, 0.15)":"rgba(255, 255, 255, 0.05)",border:u==="received_likes"?a?"1px solid #26A69A":"1px solid #ff4d4d":"1px solid rgba(255, 255, 255, 0.05)",padding:n?"10px 8px":"15px 10px",borderRadius:"15px",textAlign:"center",cursor:"pointer",transition:"all 0.3s",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[t.jsx("div",{style:{fontSize:"1.4rem",fontWeight:"bold",color:a?"#26A69A":"#ff4d4d"},children:x}),t.jsx("div",{style:{fontSize:"0.65rem",color:"var(--text-muted)",marginTop:"5px"},children:"Likes Reçus"})]}),t.jsxs("div",{onClick:()=>{g(K=>K==="given_likes"?"standard":"given_likes"),n&&p(!1)},role:"button","aria-label":"Voir les likes donnés","aria-current":u==="given_likes"?"true":void 0,style:{background:u==="given_likes"?a?"rgba(38, 166, 154, 0.2)":o?"rgba(255, 77, 77, 0.15)":"rgba(0, 191, 255, 0.15)":"rgba(255, 255, 255, 0.05)",border:u==="given_likes"?a?"1px solid #26A69A":o?"1px solid #ff4d4d":"1px solid #00BFFF":"1px solid rgba(255, 255, 255, 0.05)",padding:n?"10px 8px":"15px 10px",borderRadius:"15px",textAlign:"center",cursor:"pointer",transition:"all 0.3s",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[t.jsx("div",{style:{fontSize:"1.4rem",fontWeight:"bold",color:u==="given_likes"?"white":a?"#80CBC4":o?"#ff4d4d":"var(--primary-light)"},children:y}),t.jsx("div",{style:{fontSize:"0.65rem",color:"var(--text-muted)",marginTop:"5px"},children:"Coups de CÅur"})]}),t.jsxs("div",{onClick:()=>{g(K=>K==="blocked"?"standard":"blocked"),n&&p(!1)},role:"button","aria-label":"Voir les profils écartés","aria-current":u==="blocked"?"true":void 0,style:{background:u==="blocked"?a?"rgba(38, 166, 154, 0.2)":"rgba(255, 51, 51, 0.15)":"rgba(255, 255, 255, 0.05)",border:u==="blocked"?a?"1px solid #26A69A":"1px solid #ff3333":"1px solid rgba(255, 255, 255, 0.05)",color:u==="blocked"?"white":"var(--text-muted)",padding:n?"10px 8px":"15px 10px",borderRadius:"15px",textAlign:"center",cursor:"pointer",transition:"all 0.3s",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",boxShadow:u==="blocked"?a?"0 0 15px rgba(38, 166, 154, 0.2)":"0 0 15px rgba(255, 51, 51, 0.2)":"none"},children:[t.jsx("div",{style:{fontSize:"1.4rem",fontWeight:"bold",color:u==="blocked"?a?"#26A69A":"#ff4d4d":"var(--text-muted)"},children:_}),t.jsx("div",{style:{fontSize:"0.65rem",color:"var(--text-muted)",marginTop:"5px"},children:"Profils Ãcartés"})]}),t.jsxs("div",{onClick:()=>g(K=>K==="map"?"standard":"map"),role:"button","aria-label":"Ouvrir la carte","aria-current":u==="map"?"true":void 0,style:{gridColumn:"span 2",backgroundImage:"linear-gradient(0deg, rgba(10,8,20,0.5) 0%, rgba(10,8,20,0.1) 50%, rgba(10,8,20,0.35) 100%), url('https://a.basemaps.cartocdn.com/dark_all/13/4185/2837.png')",backgroundSize:"cover",backgroundPosition:"center",border:u==="map"?"1px solid rgba(34, 197, 94, 0.4)":"1px solid rgba(255, 255, 255, 0.1)",padding:n?"10px 8px":"15px 10px",borderRadius:"15px",textAlign:"center",cursor:"pointer",transition:"all 0.3s",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"visible",boxShadow:u==="map"?"0 0 12px rgba(34,197,94,0.25)":"none"},children:[t.jsx("div",{style:{fontSize:"1.4rem",fontWeight:"bold",color:u==="map"?"#22c55e":"var(--gold)",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(ur,{size:24})}),t.jsx("div",{style:{fontSize:"0.65rem",color:u==="map"?"#22c55e":"rgba(255,255,255,0.7)",marginTop:"5px",fontWeight:600},children:"Carte"})]})]}),t.jsxs("div",{style:{marginBottom:"25px",background:"rgba(0, 191, 255, 0.08)",padding:"15px",borderRadius:"15p
1172x",border:"1px solid rgba(0, 191, 255, 0.2)",transition:"all 0.3s ease"},children:[t.jsxs("h4",{style:{fontSize:"0.85rem",color:"#00BFFF",margin:"0 0 15px",textTransform:"uppercase",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(s5,{size:14})," Filtres"]}),t.jsxs("div",{style:{width:"100%",marginBottom:"15px"},children:[t.jsxs("label",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.75rem",color:"var(--text-muted)",marginBottom:"5px"},children:[t.jsx("span",{children:"Distance max"}),t.jsxs("span",{style:{color:"var(--gold)"},children:[w," km"]})]}),t.jsx("input",{type:"range",min:"1",max:"500",value:w,onChange:K=>{b(Number(K.target.value)),u==="nearby"&&g("standard")},"aria-label":"Distance maximale",style:{width:"100%",accentColor:"var(--gold)",height:"4px",background:"rgba(255,255,255,0.1)",borderRadius:"5px",appearance:"auto",cursor:"pointer"}})]}),t.jsxs("div",{style:{width:"100%",marginBottom:"15px"},children:[t.jsx("label",{style:{display:"block",fontSize:"0.75rem",color:"var(--text-muted)",marginBottom:"5px"},children:"Tranche d'âge"}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx("input",{type:"number",min:"18",max:"99",value:j.min,onChange:K=>T(ne=>({...ne,min:Number(K.target.value)})),"aria-label":"Ãge minimum",style:{width:"100%",background:"rgba(0,0,0,0.3)",border:"1px solid rgba(255,255,255,0.1)",color:"white",padding:"5px",borderRadius:"8px",textAlign:"center",fontSize:"0.8rem"}}),t.jsx("span",{style:{color:"var(--text-muted)"},children:"-"}),t.jsx("input",{type:"number",min:"18",max:"99",value:j.max,onChange:K=>T(ne=>({...ne,max:Number(K.target.value)})),"aria-label":"Ãge maximum",style:{width:"100%",background:"rgba(0,0,0,0.3)",border:"1px solid rgba(255,255,255,0.1)",color:"white",padding:"5px",borderRadius:"8px",textAlign:"center",fontSize:"0.8rem"}})]})]}),t.jsxs("div",{style:{width:"100%"},children:[t.jsx("label",{style:{display:"block",fontSize:"0.75rem",color:"var(--text-muted)",marginBottom:"8px"},children:"Genre recherché"}),t.jsx("div",{style:{display:"flex",gap:"6px"},children:[{value:"all",label:"ð¥ Tous"},{value:"female",label:"â Femmes"},{value:"male",label:"â Hommes"}].map(K=>t.jsx("button",{onClick:()=>I&&I(K.value),style:{flex:1,padding:"8px 6px",borderRadius:"10px",border:`1px solid ${(P||"all")===K.value?"#00BFFF":"rgba(255,255,255,0.1)"}`,background:(P||"all")===K.value?"rgba(0, 191, 255, 0.15)":"rgba(0,0,0,0.2)",color:(P||"all")===K.value?"#00BFFF":"rgba(255,255,255,0.5)",fontSize:"0.75rem",fontWeight:(P||"all")===K.value?"700":"500",cursor:"pointer",transition:"all 0.2s"},children:K.label},K.value))})]})]})]}),t.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"0 30px 30px 30px"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"15px",borderBottom:"1px solid rgba(255,255,255,0.1)",paddingBottom:"5px",marginTop:"30px"},children:[t.jsxs("h4",{onClick:()=>E(!O),role:"button","aria-expanded":O,style:{fontSize:"0.85rem",color:"var(--text-muted)",textTransform:"uppercase",margin:0,cursor:"pointer",display:"flex",alignItems:"center",gap:"5px"},children:["Ce que je suis / Vos Critères",t.jsx(ye.div,{animate:{rotate:O?180:0},children:t.jsx(Pr,{size:12,style:{transform:"rotate(90deg)"}})})]}),t.jsxs("button",{onClick:()=>te("/edit-criteria"),"aria-label":"Modifier mes critères",style:{background:"none",border:"none",cursor:"pointer",color:"var(--gold)",fontSize:"0.75rem",display:"flex",alignItems:"center",gap:"4px",padding:"5px",borderRadius:"5px",transition:"background 0.2s"},className:"hover-bg",children:[t.jsx(Vo,{size:12})," Modifier"]})]}),t.jsx(tr,{children:O&&t.jsx(ye.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},style:{overflow:"hidden"},children:$.map(K=>{const ne=Array.isArray(r[B])?r[B]:[],Re=K.items.filter(Q=>ne.includes(Q.id));return Re.length===0?null:t.jsxs("div",{style:{marginBottom:"15px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",color:K.color,marginBottom:"8px",fontSize:"0.8rem",fontWeight:"600"},children:[t.jsx(K.icon,{size:14})," ",K.title]}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:Re.map(Q=>t.jsxs("div",{style:{background:"rgba(255,255,255,0.05)",padding:"5px 10px",borderRadius:"15p
1172x",fontSize:"0.7rem",color:"rgba(255,255,255,0.7)",border:`1px solid ${K.color}30`},children:[Q.icon&&t.jsx(Q.icon,{size:10,style:{marginRight:"4px",verticalAlign:"text-top"}}),Q.label]},Q.id))})]},K.id)})})})]})]}),L7=()=>{var Se,me,Je,pt,it,Ke;const e=si(),r=Lt(),i=ko(),{profile:n,user:o,loading:a,error:l,refreshProfile:d}=gr(),{mode:p,setMode:u,isErox:g,isFriend:h,lightMode:x}=dr(),y=Tr.useMemo(()=>{var W,se;if(n)return n;try{const we=JSON.parse(li("userProfile"));if(we)return we}catch(we){console.error("Error parsing local profile",we)}return o?(console.warn("MatchDashboard: No profile found, creating emergency profile from user metadata"),{id:o.id,email:o.email,name:((W=o.user_metadata)==null?void 0:W.name)||((se=o.email)==null?void 0:se.split("@")[0])||"Utilisateur",...o.user_metadata}):null},[n,o]);m.useEffect(()=>{!n&&y&&o&&Or("userProfile",JSON.stringify(y))},[y,n,o]);const _=W=>W&&/\.(webm|mp4|mov|avi|mkv)(\?|$)/i.test(W),[S,k]=m.useState([]),[w,b]=m.useState(!0),[j,T]=m.useState([]),[P,I]=m.useState([]),[R,O]=m.useState(null),[E,$]=m.useState(null),[B,ee]=m.useState(null),[te,K]=m.useState([]),[ne,Re]=m.useState(()=>li("isPremium")==="true"),[Q,G]=m.useState({}),[le,F]=m.useState(0),A=m.useRef([]),M=m.useRef({}),[V,H]=m.useState(!1),[N,Z]=m.useState(null),[ae,X]=m.useState(null),[he,Ae]=m.useState(0),[ze,ue]=m.useState(null),[xe,ke]=m.useState(null),Pe=xn(),[Ce,Me]=m.useState(!1),[Le,rt]=m.useState(()=>"standard"),[Fe,ft]=m.useState(0),[De,Be]=m.useState(null),[re,He]=m.useState(null),[be,nt]=m.useState([]),[J,Ie]=m.useState(null),[z,Y]=m.useState(()=>{try{return!li("swipeTutorialSeen")}catch{return!1}}),ce=Au(0),ve=Au(0),pe=_l(ce,[-200,0,200],[-15,0,15]),$e=_l(ce,[0,80,150],[0,.7,1]),Xe=_l(ce,[0,-80,-150],[0,.7,1]),tt=_l(ce,[0,50,150],[0,.15,.5]),gt=_l(ce,[0,-50,-150],[0,.15,.5]);_l(ce,[-150,-50,0,50,150],[.8,.5,0,.5,.8]);const[at,Pt]=m.useState(!1),[vt,ut]=m.useState(()=>{try{const W=li("matchFilter_age");return W?JSON.parse(W):{min:18,max:99}}catch{return{min:18,max:99}}}),[Wt,dt]=m.useState(()=>{try{const W=li("matchFilter_dist");return W?Number(W):100}catch{return 100}}),[Rr,Dr]=m.useState(!1),[Rt,br]=m.useState(null),[Ht,or]=m.useState(()=>{try{return li("matchFilter_gender")||"all"}catch{return"all"}}),[sr,Ne]=m.useState(()=>{try{return JSON.parse(li("seenProfiles")||"[]")}catch{return[]}}),[Ze,Et]=m.useState(!1),[Ue,St]=m.useState(null),[At,Ft]=m.useState(0);m.useEffect(()=>{try{Or("matchFilter_age",JSON.stringify(vt))}catch{}},[vt]),m.useEffect(()=>{try{Or("matchFilter_dist",String(Wt))}catch{}},[Wt]),m.useEffect(()=>{try{Or("matchFilter_gender",Ht)}catch{}},[Ht]);const[Gt,fr]=m.useState(null),[It,jt]=m.useState(!1);Tr.useRef(null);const[Dt,Nt]=m.useState(null),[jr,Zt]=m.useState(!1),[kr,xr]=m.useState(!1),[Bn,Ti]=m.useState(0),[Zo,no]=m.useState(!1),[Yo,Xo]=m.useState({}),[On,Ln]=m.useState(""),[mn,yn]=m.useState(!1),[oo,$n]=m.useState(null),[Vt,qt]=m.useState([]),Ai=Tr.useRef(null),[bn,so]=m.useState(null),[Jr,Tt]=m.useState(!1),wr=Tr.useRef({x:0,y:0,time:0}),ao=Tr.useRef(0),lo=Tr.useRef(!1),ai=Tr.useRef(null),[co,Co]=m.useState(new Set),Si=Tr.useCallback(W=>{Co(se=>new Set(se).add(W))},[]),Br=W=>(W==null?void 0:W.split(" ").map(se=>se[0]).join("").slice(0,2).toUpperCase())||"?";Au(0);const[ot,Zr]=m.useState(null),[vr,da]=m.useState(()=>{try{return JSON.parse(localStorage.getItem("matchedProfileIds")||"[]")}catch{return[]}}),Yr=Tr.useRef(!1);Tr.useEffect(()=>{Ai.current&&Ai.current.scrollIntoView({behavior:"smooth"})},[Yo]),Tr.useEffect(()=>
1172{if(!(re!=null&&re.id)){$n(null),qt([]);return}D.from("event_ratings").select("rating, comment, created_at, user_id").eq("organizer_id",re.id).order("created_at",{ascending:!1}).then(async({data:W})=>{if(W&&W.length>0){const se=W.reduce((oe,ie)=>oe+ie.rating,0)/W.length;$n({avg:se,count:W.length});const we=[...new Set(W.map(oe=>oe.user_id).filter(Boolean))];let ge={};if(we.length>0){const{data:oe}=await D.from("profiles").select("id, name, photo, avatar_url").in("id",we);oe&&oe.forEach(ie=>{ge[ie.id]=ie})}qt(W.slice(0,5).map(oe=>({...oe,user:ge[oe.user_id]||null})))}else $n(null),qt([])}).catch(()=>{$n(null),qt([])})},[re==null?void 0:re.id]),Tr.useEffect(()=>{const W=se=>{if(se.data==="PAYMENT_COMPLETE"){xr(!1);const we=li("pendingPackId"),oe={starter:60,regular:95,pro:130,ultimate:350}[we]||60;Ft(ie=>ie+oe),Zt(!1),fr({emoji:"ð°",name:`${oe} Meetips`,recipientName:"votre compte"}),jt(!0),setTimeout(()=>jt(!1),4e3),Wl("pendingPackId")}};return window.addEventListener("message",W),()=>window.removeEventListener("message",W)},[]);const js=h?"friend_tags":g?"erox_tags":"tags",vn=h?"friend_tags":g?"erox_tags":"tags",Gi=h?il:g?So:Fn;m.useEffect(()=>{if(y)if(p==="FRIEND"){const W=Array.isArray(y.friend_tags)&&y.friend_tags.length>0;ue(W?null:"FRIEND")}else if(p==="EROX"){const W=Array.isArray(y.erox_tags)&&y.erox_tags.length>0;ue(W?null:"EROX")}else ue(null)},[p,(Se=y==null?void 0:y.friend_tags)==null?void 0:Se.length,(me=y==null?void 0:y.erox_tags)==null?void 0:me.length,y==null?void 0:y.id]),m.useEffect(()=>{new URLSearchParams(i.search).get("view")==="hub"&&Pe&&rt("hub")},[i.search,Pe]);const{showTutorial:Wn,markAsSeen:ws}=y0("tuto_match"),an=Tr.useRef(null),_s=Tr.useRef(null),Ss=[{title:"ð Bienvenue dans les Rencontres",description:"Prêt(e) à faire de belles rencontres ? Fais glisser les profils vers la droite pour Mettre en Favoris, ou vers la gauche pour Passer (totalement anonyme !).",icon:Bt},{title:"Le Menu Côté",description:"Sur ta gauche (ou via le bouton menu sur mobile), tu retrouveras tes critères, ainsi que les filtres avancés d'âge et de distance.",icon:s5,targetRef
1172:an},{title:"Affinities & Tags",description:"Les bulles colorées sous la photo indiquent vos points communs basés sur vos critères. Plus il y en a, plus ça matche !",icon:oi,targetRef:_s}],po={seek_kids_yes:["parent"],seek_kids_no:["noparent"],seek_kids_any:["parent","noparent"],seek_man:["male"],seek_woman:["female"],seek_single:["single"],seek_couple:["couple"],seek_mentor:["exp_expert"],seek_teaching:["exp_novice","exp_intermediate"],seek_discovery:["exp_novice","exp_intermediate","exp_expert"],seek_discrete:["vibe_discrete","seek_discrete"],seek_alchemy:["vibe_open","vibe_epicurean"],seek_fun:["vibe_epicurean","vibe_open"],seek_mobile:["seek_mobile"],seek_hosted:["seek_hosted"],seek_any_body:["slim","average","athletic","curvy","bbw"],seek_any_age:["young","mid20","mid30","mature"]},kt=async(W,se,we=!1)=>{we&&so(W==="right"?"tapLike":"tapPass"),W==="right"?Uo():mr(),Be(W),Ie(W==="right"?"like":"nope"),W==="right"?await jn(se.id):W==="left"&&q(se.id),we&&setTimeout(()=>{ce.set(0),ve.set(0),ft(ge=>ge+1),Be(null),Ie(null),ln(null),so(null)},450)},Ji=()=>Zo||Ue||V||R||ot,hr=W=>{Ji()||Yr.current||(lo.current=!1,wr.current={x:W.clientX,y:W.clientY,time:Date.now()})},dl=W=>{if(Ji()||Yr.current)return;const{x:se,y:we,time:ge}=wr.current,oe=W.clientX-se,ie=Math.abs(oe),Oe=Math.abs(W.clientY-we);if(Date.now()-ge<250&&ie<15&&Oe<15){if(Date.now()-ao.current<3e3||lo.current||ai.current&&ai.current.scrollTop>50)return;const yt=W.currentTarget.getBoundingClientRect(),Mt=W.clientX-yt.left;if(W.clientY-yt.top>yt.height*.65)return;const Ot=Mt>yt.width/2;fe[Fe]&&kt(Ot?"right":"left",fe[Fe],!0)}},ca=async(W,se)=>{if(Yr.current=!1,lo.current){Sl(ce,0,{type:"spring",stiffness:500,damping:30}),Sl(ve,0,{type:"spring",stiffness:500,damping:30});return}const we=120,ge=se.velocity.x,oe=se.offset.x;if(oe>we||ge>500){if(await Sl(ce,500,{type:"tween",duration:.2,ease:"easeOut"}),fe[Fe]){const ie=fe[Fe];Uo(),Be("right"),Ie("like"),await jn(ie.id)}ce.set(0),ve.set(0),ft(ie=>ie+1),Be(null),Ie(null)}else if(oe<-we||ge<-500){if(await Sl(ce,-500,{type:"tween",duration:.2,ease:"easeOut"}),fe[Fe]){const ie=fe[Fe];mr(),Be("left"),Ie("nope"),q(ie.id)}ce.set(0),ve.set(0),ft(ie=>ie+1),Be(null),Ie(null)}else Sl(ce,0,{type:"spring",stiffness:500,damping:30}),Sl(ve,0,{type:"spring",stiffness:500,damping:30})},pa=()=>{Yr.current=!0},[ks,ln]=m.useState(null),ua={enter:()=>({x:0,y:0,opacity:1,scale:1,rotate:0}),center:{zIndex:1,x:0,y:0,opacity:1,scale:1,rotate:0,transition:{duration:0}},exit:()=>({zIndex:0,opacity:0,transition:{duration:.15}}),vaporize:{scale:[1,1.1,1.5,2],opacity:[1,.8,.4,0],filter:["blur(0px)","blur(2px)","blur(10px)","blur(20px)"],transition:{duration:.6,ease:"easeInOut"}},exitLike:{scale:[1,.85,.4,.15],x:[0,20,60,80],y:[0,50,150,250],opacity:[1,.9,.6,0],rotate:[0,5,12,20],transition:{duration:.5,ease:[.4,0,.2,1]}},exitPass:{scale:[1,1.03,1.08,1.15],opacity:[1,.7,.3,0],filter:["blur(0px) brightness(1)","blur(3px) brightness(1.2)","blur(10px) brightness(0.8)","blur(25px) brightness(0.4)"],transition:{duration:.5,ease:"easeOut"}}},Zi=(W,se)=>{if(!W||!se)return{total:0,details:{}};let we=0,ge={},oe=0,ie=vn,Oe=Gi;const Ve=Array.isArray(se[vn])?se[vn]:[],yt=Array.isArray(W[vn])?W[vn]:[];return(Ve.length===0||yt.length===0)&&(ie="tags",Oe=Fn),Oe.forEach(Mt=>{const lr=Array.isArray(se[ie])?se[ie]:[],Ot=Array.isArray(W[ie])?W[ie]:[],Pi=Mt.items.map(ir=>ir.id),mi=lr.filter(ir=>Pi.includes(ir));let Yi=0,Fi=[],Un=Ot.filter(ir=>Pi.includes(ir));if(Mt.id==="iseek"||Mt.id==="iseek_erox"){if(mi.length>0){let ir=0,Kr=0;mi.forEach(Qr=>{if(Qr.startsWith("dist_")||Qr.startsWith("age_")||Qr.startsWith("seek_age_"))return;Kr++;const ga=po[Qr];ga?ga.some(fa=>!!(Ot.includes(fa)||fa==="male"&&W.gender==="male"||fa==="female"&&W.gender==="female"))&&ir++:Kr--}),Yi=Kr>0?Math.round(ir/Kr*100):0,Fi=[]}}else{const ir=Ot.filter(Kr=>Pi.includes(Kr));if(mi.length>0){const Kr=mi.filter(Qr=>ir.includes(Qr));Yi=Math.round(Kr.length/mi.length*100),Fi=Mt.items.filter(Qr=>Kr.includes(Qr.id))}Un=ir}const er=Mt.items.filter(ir=>Un.includes(ir.id));mi.length>0&&(ge[Mt.id]={score:Yi,commonItems:Fi,matchItems:er},we+=Yi,oe++)}),{total:oe>0?Math.round(we/oe):0,details:ge}},Xr=(W,se)=>{if(!W||!se)return 1e3;const we=6371,ge=(se.lat-W.lat)*(Math.PI/180),oe=(se.lng-W.lng)*(Math.PI/180),ie=Math.sin(ge/2)*Math.sin(ge/2)+Math.cos(W.lat*(Math.PI/180)
1172)*Math.cos(se.lat*(Math.PI/180))*Math.sin(oe/2)*Math.sin(oe/2),Oe=2*Math.atan2(Math.sqrt(ie),Math.sqrt(1-ie));return we*Oe},Nn=()=>{if(Le==="nearby"){rt("standard"),ft(0);return}if(Pe&&Me(!1),!navigator.geolocation){e.warning("La géolocalisation n'est pas supportée par votre navigateur.");return}navigator.geolocation.getCurrentPosition(W=>{br({lat:W.coords.latitude,lng:W.coords.longitude}),ft(0),rt("nearby"),X({message:"Position actualisée !",type:"success"})},W=>{console.error("GPS Error:",W),e.error("Impossible de récupérer votre position. Vérifiez vos autorisations.")})},ha=()=>{if(!navigator.geolocation){e.warning("La géolocalisation n'est pas supportée par votre navigateur.");return}Et(!0),navigator.geolocation.getCurrentPosition(W=>{br({lat:W.coords.latitude,lng:W.coords.longitude}),Et(!1),X({message:"ð Position actualisée !",type:"success"})},W=>{console.error("GPS Error:",W),Et(!1),e.error("Impossible de récupérer votre position.")})},Cs=W=>{ao.current=Date.now(),ee({item:W,price:2.9})},cl=async W=>{if(!(y!=null&&y.id))return;if(At<15){e.error(`Solde insuffisant (${At}/15 Meetips)`);return}const se=await wi.unlockProfile(y.id,W.id);if(se.success){ao.current=Date.now(),lo.current=!0;const we=[...te,W.id];K(we),Or("unlockedMatches",JSON.stringify(we)),Ft(se.newBalance),e.success("Profil débloqué ! (-15 Meetips)")}else e.error(se.error||"Erreur lors du déverrouillage")},jn=async W=>{let se;if(P.includes(W)?se=P.filter(we=>we!==W):(se=[...P,W],be.includes(W)&&Ge(W)),I(se),Or("favoriteMatches",JSON.stringify(se)),y!=null&&y.id)try{const we=await gx(y.id,W,p);if(we&&we.isMatch){id();const ge=j.find(oe=>oe.id===W)||S.find(oe=>oe.id===W);ge&&(da(oe=>{const ie=[...new Set([...oe,W])];return localStorage.setItem("matchedProfileIds",JSON.stringify(ie)),ie}),Zr({matchName:ge.name,matchPhoto:ge.photo,matchId:W}),Wr(async()=>{const{sendMatchNotification:oe}=await Promise.resolve().then(()=>na);return{sendMatchNotification:oe}},void 0).then(({sendMatchNotification:oe})=>{oe(W,ge.name,ge.photo,p).catch(console.error)}))}}catch(we){console.error("Failed to sync like to DB",we)}},q=W=>{if(P.includes(W)){const we=P.filter(ge=>ge!==W);I(we),Or("favoriteMatches",JSON.stringify(we)),y!=null&&y.id&&gx(y.id,W,p).catch(console.error)}nt(we=>we.includes(W)?we:[...we,W]);const se=JSON.parse(li("passedMatches")||"[]");se.includes(W)||(Or("passedMatches",JSON.stringify([...se,W])),y!=null&&y.id&&x7(y.id,W,p)),(re==null?void 0:re.id)===W&&He(null)},Ge=async W=>{nt(se=>{const we=se.filter(ge=>ge!==W);return Or("passedMatches",JSON.stringify(we)),we}),y!=null&&y.id&&await y7(y.id,W,p)};m.useEffect(()=>{k([]),y&&(async()=>{if(y){b(!0);const ge=await hx(y,p);Array.isArray(ge)?k(ge):k([]);try{const oe=await j7(y.id,p);oe&&oe.bot_id&&await w7(y.id,oe.bot_id,p,oe.personality||"bienveillant","Bot")}catch(oe){console.warn("Bot assignment skipped:",oe)}b(!1)}})();const se=new URLSearchParams(window.location.search);se.get("view")==="received_likes"?rt("received_likes"):se.get("view")==="given_likes"?rt("given_likes"):se.get("view")==="profile_viewers"&&rt("profile_viewers");const we=se.get("viewProfile");if(we){const ge=j.find(oe=>oe.id===we)||S.find(oe=>oe.id===we);ge?He(ge):D.from("profiles").select("id, name, erox_name, friend_name, avatar_url, erox_avatar_url, friend_avatar_url, gender, city, birthdate, bio, job, photos, erox_photos, friend_photos, voice_bio_url, tags, verification_status").eq("id",we).single().then(({data:oe,error:ie})=>{if(oe&&!ie){const Oe=Ot=>Ot&&/\.(webm|mp4|mov|avi|mkv)(\?|$)/i.test(Ot),Ve=(g?oe.erox_avatar_url:h?oe.friend_avatar_url:null)||oe.avatar_url||"",yt=(g?oe.erox_name:h?oe.friend_name:null)||oe.name||"Inconnu",Mt=oe.birthdate?new Date(oe.birthdate).getFullYear():null,lr=Mt?new Date().getFullYear()-Mt:null;He({...oe,photo:Ve,name:yt,age:lr,isVideoSelfie:Oe(Ve)})}}),window.history.replaceState({},"",window.location.pathname)}},[y,p]),m.useEffect(()=>{new URLSearchParams(i.search).get("reset")==="1"&&(rt("standard"),r("/matches",{replace:!0}))},[i.search]),m.useEffect(()=>{if(!(y!=null&&y.id))return;I(JSON.parse(li("favoriteMatches")||"[]")),K(JSON.parse(li("unlockedMatches")||"[]")),nt(JSON.parse(li("passedMatches")||"[]"));const W=(y==null?void 0:y.is_premium)===!0,se=li("isPremium")==="true";Re(W||se),W&&Or("isPremium","true"),(async()=>{const oe=await f7(y.id,p);A.current=oe,F(oe.length);const ie=await RS(y.id,p);M.current=ie._givenLikeModes||{},I(ie),Or("favoriteMatches",JSON.stringify(ie));const Oe=await m7(y.id,p),Ve=JSON.parse(li("passedMatches")||"[]"),yt=[...new Set([...Ve,...Oe])];nt(yt),Or("passedMatches",JSON.stringify(yt))})(),wi.getBalance(y.id).then(oe=>Ft(oe))},[y==null?void 0:y.id,p]),m.useEffect(()=>{if(!y)return;let W=!1;return["given_likes","received_likes","blocked"].includes(Le)&&T([]),(async()=>{let we=[];Le==="received_likes"?we=A.current:we=S,Array.isArray(we)||(we=[]);const ge=we.map(ie=>{var yt,Mt,lr;const Oe=Zi(ie,y),Ve=(g?ie.erox_avatar_url||((yt=ie.erox_photos)==null?void 0:yt[0]):h?ie.friend_avatar_url||((Mt=ie.friend_photos)==null?void 0:Mt[0]):null)||ie.animated_photo_url||ie.photo||ie.avatar_url||((lr=ie.photos)==null?void 0:lr[0])||ie.photo_url||null;return{...ie,photo:Ve,isVideoSelfie:_(Ve),compatibility:Oe,score:Oe.total}});ge.sort((ie,Oe)=>
1172{const Ve=new Date(ie.created_at).getTime(),yt=new Date(Oe.created_at).getTime();return yt!==Ve?yt-Ve:Oe.score-ie.score});let oe=ge;if(Le==="standard")oe=ge.filter(ie=>{if(ie.score<=0||be.includes(ie.id)||P.includes(ie.id)&&(M.current[ie.id]||p)===p)return!1;const Oe=ie.age||25,Ve=Oe>=vt.min&&Oe<=vt.max,Mt=(ie.dist_km!==void 0?ie.dist_km:ie.distance!==void 0?ie.distance:1e3)<=Wt,lr=Ht==="all"||ie.gender&&ie.gender.toLowerCase()===Ht;return Ve&&Mt&&lr});else if(Le==="score_filter")oe=ge.filter(ie=>{if(ie.score<=80||be.includes(ie.id)||P.includes(ie.id)&&(M.current[ie.id]||p)===p)return!1;const Oe=ie.age||25,Ve=Oe>=vt.min&&Oe<=vt.max,Mt=(ie.dist_km!==void 0?ie.dist_km:ie.distance!==void 0?ie.distance:1e3)<=Wt;return Ve&&Mt});else if(Le==="all_candidates")oe=ge.filter(ie=>{if(ie.score<=0||be.includes(ie.id)||P.includes(ie.id)||sr.includes(ie.id))return!1;const Oe=ie.age||25,Ve=Oe>=vt.min&&Oe<=vt.max,Mt=(ie.dist_km!==void 0?ie.dist_km:ie.distance!==void 0?ie.distance:1e3)<=Wt,lr=Ht==="all"||ie.gender&&ie.gender.toLowerCase()===Ht;return Ve&&Mt&&lr});else if(Le==="received_likes")oe=ge;else if(Le==="given_likes")if(P.length>0)try{const{data:ie,error:Oe}=await D.from("profiles").select("id, name, erox_name, friend_name, avatar_url, animated_photo_url, erox_avatar_url, friend_avatar_url, photo, city, birthdate, gender, tags, erox_tags, friend_tags, bio, job, created_at").in("id",P);if(W)return;!Oe&&ie?oe=ie.map(Ve=>{const yt=(g?Ve.erox_avatar_url:h?Ve.friend_avatar_url:null)||Ve.animated_photo_url||Ve.avatar_url||Ve.photo||null,Mt=Ve.birthdate?Math.floor((Date.now()-new Date(Ve.birthdate).getTime())/(365.25*24*60*60*1e3)):null,lr=(g?Ve.erox_name:h?Ve.friend_name:null)||Ve.name||"Inconnu",Ot=Zi(Ve,y);return{...Ve,photo:yt,isVideoSelfie:_(yt),name:lr,age:Mt,score:Ot.total,compatibility:Ot,like_mode:M.current[Ve.id]||p}}):oe=ge.filter(Ve=>P.includes(Ve.id))}catch(ie){console.warn("Failed to fetch liked profiles:",ie),oe=ge.filter(Oe=>P.includes(Oe.id))}else oe=[];else if(Le==="blocked")if(be.length>0)try{const{data:ie,error:Oe}=await D.from("profiles").select("id, name, erox_name, friend_name, avatar_url, animated_photo_url, erox_avatar_url, friend_avatar_url, photo, city, birthdate, gender, tags, erox_tags, friend_tags, bio, job, created_at").in("id",be);if(W)return;!Oe&&ie?oe=ie.map(Ve=>{const yt=(g?Ve.erox_avatar_url:h?Ve.friend_avatar_url:null)||Ve.animated_photo_url||Ve.avatar_url||Ve.photo||null,Mt=Ve.birthdate?Math.floor((Date.now()-new Date(Ve.birthdate).getTime())/(365.25*24*60*60*1e3)):null,lr=(g?Ve.erox_name:h?Ve.friend_name:null)||Ve.name||"Inconnu",Ot=Zi(Ve,y);return{...Ve,photo:yt,isVideoSelfie:_(yt),name:lr,age:Mt,score:Ot.total,compatibility:Ot}}).filter(Ve=>!P.includes(Ve.id)):oe=ge.filter(Ve=>be.includes(Ve.id))}catch(ie){console.warn("Failed to fetch passed profiles:",ie),oe=ge.filter(Oe=>be.includes(Oe.id))}else oe=[];else if(Le==="profile_viewers")try{const{data:ie,error:Oe}=await D.from("profile_views").select("viewer_id, created_at").eq("viewed_id",y.id).order("created_at",{ascending:!1});if(W)return;if(!Oe&&ie&&ie.length>0){const Ve=[...new Set(ie.map(Ot=>Ot.viewer_id))],yt={};ie.forEach(Ot=>{yt[Ot.viewer_id]||(yt[Ot.viewer_id]=Ot.created_at)});const{data:Mt,error:lr}=await D.from("profiles").select("id, name, erox_name, friend_name, avatar_url, animated_photo_url, erox_avatar_url, friend_avatar_url, photo, city, birthdate, gender, tags, erox_tags, friend_tags, bio, job, created_at").in("id",Ve);if(W)return;!lr&&Mt&&(oe=Mt.map(Ot=>{const Pi=(g?Ot.erox_avatar_url:h?Ot.friend_avatar_url:null)||Ot.animated_photo_url||Ot.avatar_url||Ot.photo||null,mi=Ot.birthdate?Math.floor((Date.now()-new Date(Ot.birthdate).getTime())/(365.25*24*60*60*1e3)):null,Yi=(g?Ot.erox_name:h?Ot.friend_name:null)||Ot.name||"Inconnu",Fi=Zi(Ot,y);return{...Ot,photo:Pi,isVideoSelfie:_(Pi),name:Yi,age:mi,score:Fi.total,compatibility:Fi,viewed_at:yt[Ot.id]}}).sort((Ot,Pi)=>new Date(Pi.viewed_at)-new Date(Ot.viewed_at)))}else oe=[]}catch(ie){console.warn("Failed to fetch profile viewers:",ie),oe=[]}else Le==="nearby"?oe=ge.filter(ie=>{let Oe=1e3;
1172Rt&&ie.location?Oe=Xr(Rt,ie.location):Oe=ie.dist_km!==void 0?ie.dist_km:ie.distance!==void 0?ie.distance:1e3;const Ve=ie.age||25,yt=Ve>=vt.min&&Ve<=vt.max;return Oe<=1&&!be.includes(ie.id)&&!P.includes(ie.id)&&yt}):oe=ge.filter(ie=>{if(ie.score<=0||be.includes(ie.id)||P.includes(ie.id)&&(M.current[ie.id]||p)===p)return!1;const Oe=ie.age||25,Ve=Oe>=vt.min&&Oe<=vt.max,Mt=(ie.dist_km!==void 0?ie.dist_km:ie.distance!==void 0?ie.distance:1e3)<=Wt,lr=Ht==="all"||ie.gender&&ie.gender.toLowerCase()===Ht;return Ve&&Mt&&lr});W||T(oe)})(),()=>{W=!0}},[y,S,Le,P,be,sr,Rt,vt,Wt,Ht,le]);const ct=y||{};if(!y&&a)return t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",background:"#000",padding:"40px 20px"},children:[t.jsx("div",{style:{width:"100%",maxWidth:"380px"},children:t.jsx(o1,{variant:"profile"})}),t.jsx("p",{style:{marginTop:"20px",fontFamily:"Inter, sans-serif",color:"#D4AF37",fontSize:"0.85rem",opacity:.7},children:"Chargement..."})]});const et=W=>({background:W?"rgba(255, 215, 0, 0.08)":"rgba(0,0,0,0.4)",border:W?"2px solid #D4AF37":"1px solid rgba(255,255,255,0.05)",color:W?"white":"inherit",transform:"scale(1)",boxShadow:"none"}),Qe=async()=>{if(ft(0),y){const W=await hx(y,p);k(W||[])}rt("all_candidates")};if(a)return t.jsxs("div",{style:{height:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"#000",padding:"40px 20px"},children:[t.jsx("div",{style:{width:"100%",maxWidth:"380px"},children:t.jsx(o1,{variant:"profile"})}),t.jsx("p",{style:{marginTop:"20px",color:"white",fontSize:"0.85rem",opacity:.6},children:"Connexion sécurisée..."})]});if(!y)return t.jsxs("div",{style:{height:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"white",padding:"20px",textAlign:"center"},children:[t.jsx(fi,{size:48,color:"#ff4d4d",style:{marginBottom:"20px"}}),t.jsx("h2",{style:{marginBottom:"10px"},children:"Impossible de charger le profil"}),t.jsx("p",{style:{color:"rgba(255,255,255,0.7)",marginBottom:"20px"},children:"Le serveur ne répond pas ou votre session a expiré."}),l&&t.jsxs("div",{style:{padding:"10px",background:"rgba(255, 77, 77, 0.1)",border:"1px solid #ff4d4d",borderRadius:"8px",marginBottom:"20px",maxWidth:"80%"},children:[t.jsx("strong",{style:{color:"#ff4d4d",display:"block",marginBottom:"5px"},children:"Erreur Détectée :"}),t.jsx("span",{style:{fontSize:"0.9rem"},children:typeof l=="string"?l:JSON.stringify(l.message||l)})]}),t.jsxs("div",{style:{marginBottom:"20px",padding:"10px",background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",fontSize:"10px",textAlign:"left",borderRadius:"8px"},children:[t.jsxs("p",{children:["User ID: ",(o==null?void 0:o.id)||"NULL"]}),t.jsxs("p",{children:["Auth Status: ",o?"Authenticated":"No Session"]})]}),t.jsxs("div",{style:{display:"flex",gap:"15px",flexWrap:"wrap",justifyContent:"center"},children:[t.jsx("button",{onClick:()=>window.location.reload(),style:{padding:"12px 25px",background:"var(--primary)",border:"none",borderRadius:"30px",color:"white",fontWeight:"bold",cursor:"pointer"},children:"Réessayer"}),t.jsx("button",{onClick:()=>{try{Kc()}catch{}window.location.reload()},style:{padding:"12px 25px",background:"rgba(255, 165, 0, 0.2)",border:"1px solid orange",borderRadius:"30px",color:"orange",cursor:"pointer"},children:"𧹠Vider Cache"}),t.jsx("button",{onClick:async()=>{try{Kc()}catch{}await D.auth.signOut(),window.location.href="/login"},style:{padding:"12px 25px",background:"rgba(255,255,255,0.1)",border:"none",borderRadius:"30px",color:"white",cursor:"pointer"},children:"Se Déconnecter"})]})]});const bt=p==="EROX"?1:p==="FRIEND"||h?10:3,Ee=Tr.useRef([]),We=Tr.useRef(Le);if(We.current!==Le&&(Ee.current=[],We.current=Le),Ee.current.length===0&&j.length>0){const W=j.filter(se=>Le==="given_likes"?P.includes(se.id):Le==="all_candidates"?!sr.includes(se.id):!0);Ee.current=!ne&&Le!=="given_likes"&&Le!=="all_candidates"?W.slice(0,bt):W}const fe=Ee.current;return t.jsxs("div",{style:{display:"flex",height:"100vh",background:x?"#FAF7F2":h?"linear-gradient(180deg, #0A0F1C 0%, #151B2E 100%)":"var(--bg-dark)",color:x?"#2A2520":"white",overflow:"hidden",flexDirection:"row"},children:[t.jsx(b0,{isOpen:Wn,onClose:ws,steps:Ss}),Pe&&Ce&&t.jsx("div",{onClick:()=>Me(!1),style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.6)",backdropFilter:"blur(3px)",zIndex:100}}),t.jsx("div",{ref:an,children:t.jsx(O7,{profile:y,enrichedProfile:ct,isPremium:ne,isMobile:Pe,isErox:g,isFriend:h,mode:p,showMobileSidebar:Ce,setShowMobileSidebar:Me,viewM
1172ode:Le,setViewMode:rt,topProfilesCount:S.map(W=>Zi(W,y).total).filter(W=>W>80).length,likesReceivedCount:le,favoritesCount:P.length,passedMatchesCount:be.length,isFiltersOpen:Rr,setIsFiltersOpen:Dr,distFilter:Wt,setDistFilter:dt,ageFilter:vt,setAgeFilter:ut,genderFilter:Ht,setGenderFilter:or,handleNearbyClick:Nn,isCriteriaOpen:at,setIsCriteriaOpen:Pt,activeSections:Gi,targetTagColumn:vn,getActiveStyle:et,navigate:r})}),t.jsxs("div",{ref:_s,className:"custom-scrollbar",style:{flex:1,padding:Pe&&["standard","score_filter","hub","map"].includes(Le)?0:Pe?"80px 20px 20px 20px":"120px 40px 40px 40px",overflowY:Pe&&["standard","score_filter","hub","map"].includes(Le)?"hidden":"auto",background:x?"#FAF7F2":h?"linear-gradient(180deg, #0A0F1C 0%, #151B2E 100%)":"var(--bg-deep)",position:"relative",height:Pe&&["standard","score_filter","hub","map"].includes(Le)?"100vh":"auto"},children:[Le==="map"&&t.jsx("div",{style:{position:"absolute",inset:0,zIndex:50},children:t.jsx(B7,{onSelectMember:W=>{if(!W.compatibility||!W.compatibility.details||Object.keys(W.compatibility.details).length===0){const se=Zi(W,y);He({...W,compatibility:se,score:se.total})}else He(W)},matches:j})}),Pe&&Le==="hub"?t.jsx(d1,{isErox:g,isFriend:h,favoritesCount:P.length,passedCount:be.filter(W=>!P.includes(W)).length,previewPhotos:[...new Set((j.length>0?j:S).slice(0,20).map(W=>W.photo||W.avatar_url||W.photo_url).filter(Boolean))],matchCount:j.filter(W=>!be.includes(W.id)&&!P.includes(W.id)&&!sr.includes(W.id)).length,onRefresh:()=>{ft(0),rt("all_candidates"),Qe()},onViewFavorites:()=>rt("given_likes"),onViewReceivedLikes:()=>rt("received_likes"),likesReceivedCount:le,onViewPassed:()=>rt("blocked"),onEditCriteria:()=>r("/edit-criteria"),onViewBlocked:()=>r("/blocked-users"),onViewMap:()=>rt("map"),matchedCount:vr.length,onViewMatches:()=>r("/favorites?tab=matches"),distFilter:Wt,setDistFilter:dt,ageFilter:vt,setAgeFilter:ut,genderFilter:Ht,setGenderFilter:or,onRefreshGPS:ha,isLocating:Ze}):Pe&&["standard","score_filter","all_candidates","nearby"].includes(Le)?t.jsxs("div",{style:{flex:1,overflow:"hidden",position:"relative",background:x?"#FAF7F2":"black",width:"100%",height:"100%"},children:[t.jsxs("div",{style:{position:"absolute",top:"15px",left:"10px",right:"10px",display:"flex",justifyContent:"space-between",zIndex:60,pointerEvents:"none"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",pointerEvents:"auto"},children:[t.jsx("button",{onClick:W=>{W.stopPropagation(),rt("hub")},style:{background:x?"rgba(250,247,242,0.92)":"rgba(0,0,0,0.5)",border:x?"1.5px solid rgba(140,115,75,0.3)":"1px solid rgba(255,255,255,0.2)",borderRadius:"20px",padding:"6px 14px",color:x?"#3D3528":"white",fontSize:"0.8rem",fontWeight:600,cursor:"pointer",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",fontFamily:"Outfit, sans-serif",boxShadow:x?"0 2px 8px rgba(120,100,60,0.12)":"none"},children:"â Retour"}),t.jsx("button",{onClick:W=>{W.stopPropagation(),Nn()},style:{background:Le==="nearby"?"var(--gold)":x?"rgba(250,247,242,0.92)":"rgba(0,0,0,0.5)",border:x?"1.5px solid rgba(140,115,75,0.3)":"1px solid rgba(255,255,255,0.2)",borderRadius:"50%",width:"45px",height:"45px",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:x?"0 2px 8px rgba(120,100,60,0.12)":"0 4px 10px rgba(0,0,0,0.3)",color:Le==="nearby"?"black":x?"#3D3528":"white"},children:t.jsx(ur,{size:20})})]}),t.jsx("button",{onClick:W=>{W.stopPropagation(),Fe<fe.length-1?(Be(1),ft(se=>se+1)):(rt("hub"),ft(0))},style:{background:x?"rgba(250,247,242,0.92)":"rgba(0,0,0,0.5)",border:x?"1.5px solid rgba(140,115,75,0.3)":"1px solid rgba(255,255,255,0.2)",borderRadius:"22px",padding:"8px 16px",height:"45px",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",boxShadow:x?"0 2px 8px rgba(120,100,60,0.12)":"0 4px 10px rgba(0,0,0,0.3)",color:x?"#3D3528":"white",pointerEvents:"auto",fontSize:"0.8rem",fontWeight:600,fontFamily:"Outfit",letterSpacing:"0.5px"},children:"Suivant â"})]}),fe[Fe+1]&&(()=>{const W=fe[Fe+1];return t.jsxs("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",borderRadius:"20px",overflow:"hidden",zIndex:1,border:x?"3px solid rgba(140,115,75,0.12)":"3px solid rgba(255,255,255,0.12)",boxShadow:x?"0 6px 20px rgba(120,100,60,0.1
1172)":"0 10px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05)",background:x?"#FAF7F2":"#0d0a1a"},children:[t.jsxs("div",{style:{position:"relative",minHeight:"65vh",backgroundSize:"cover",backgroundPosition:"center",backgroundImage:W.photo&&!co.has(W.photo)?`url(${W.photo})`:"linear-gradient(145deg, #2d1b4e 0%, #1a1035 40%, #0d0a1a 100%)"},children:[(!W.photo||co.has(W.photo))&&t.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx("div",{style:{width:"80px",height:"80px",borderRadius:"50%",background:"linear-gradient(135deg, rgba(201,160,255,0.3), rgba(201,160,255,0.08))",border:"2px solid rgba(201,160,255,0.25)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"2rem",fontWeight:800,color:"rgba(201,160,255,0.7)",fontFamily:"Outfit"},children:Br(W.name)})}),W.photo&&!co.has(W.photo)&&t.jsx("img",{src:W.photo,onError:()=>Si(W.photo),style:{display:"none"},alt:""}),t.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:"50%",background:x?"linear-gradient(to top, #FAF7F2 0%, rgba(250,247,242,0.6) 50%, transparent 100%)":"linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 50%, transparent 100%)"}})]}),t.jsx("div",{style:{padding:"0 20px",background:x?"#FAF7F2":"#0d0a1a"},children:t.jsxs("div",{style:{color:x?"#3D3528":"white",fontFamily:"Outfit",marginTop:"-60px",position:"relative",zIndex:2},children:[t.jsxs("div",{style:{fontSize:"1.5rem",fontWeight:700,textShadow:"0 2px 8px rgba(0,0,0,0.8)"},children:[W.name,", ",W.age]}),W.job&&t.jsx("div",{style:{fontSize:"0.85rem",opacity:.7,marginTop:"4px"},children:W.job})]})}),t.jsxs("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",justifyContent:"center",alignItems:"center",gap:"14px",padding:"18px 12px calc(env(safe-area-inset-bottom, 0px) + 110px)",background:x?"linear-gradient(to top, rgba(250,247,242,0.98) 0%, rgba(250,247,242,0.92) 40%, rgba(250,247,242,0.6) 75%, transparent 100%)":"linear-gradient(to top, rgba(0,0,0,0.98) 0%, rgba(0,0,0,0.92) 40%, rgba(0,0,0,0.6) 75%, transparent 100%)",zIndex:4,pointerEvents:"none"},children:[t.jsx("div",{style:{width:"52px",height:"52px",borderRadius:"50%",background:"rgba(30,30,40,0.85)",border:"2px solid rgba(255,152,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx("span",{style:{fontSize:"0.8rem",fontWeight:800,color:"#FF9800",lineHeight:1},children:"â%"})}),t.jsx("div",{style:{width:"60px",height:"60px",borderRadius:"50%",background:"rgba(30,30,40,0.85)",border:"2px solid rgba(255,77,77,0.35)",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"#ff4d4d",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),t.jsx("div",{style:{width:"52px",height:"52px",borderRadius:"50%",background:"rgba(30,30,40,0.85)",border:"2px solid rgba(156,39,176,0.35)",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"#CE93D8",stroke:"#CE93D8",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M20 12v10H4V12"}),t.jsx("path",{d:"M2 7h20v5H2z"}),t.jsx("path",{d:"M12 22V7"}),t.jsx("path",{d:"M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z"}),t.jsx("path",{d:"M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z"})]})}),t.jsx("div",{style:{width:"60px",height:"60px",borderRadius:"50%",background:"rgba(30,30,40,0.85)",border:"2px solid rgba(0,230,118,0.35)",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"#00e676",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"})})}),t.jsx("div",{style:{width:"52px",height:"52px",borderRadius:"50%",background:"rgba(30,30,40,0.85)",border:"2px s
1172olid rgba(0,191,255,0.35)",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#00BFFF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})})]})]})})(),fe[Fe]?(()=>{var we,ge,oe,ie,Oe,Ve,yt,Mt,lr,Ot,Pi,mi,Yi,Fi,Un;const W=p==="EROX"?1:h?10:3,se=!ne&&!te.includes(fe[Fe].id)&&Fe>=W;return t.jsx(ye.div,{drag:!se,dragMomentum:!1,onDragStart:pa,onDragEnd:ca,onPointerDown:hr,onPointerUp:dl,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",zIndex:10,borderRadius:"20px",border:x?"3px solid rgba(140,115,75,0.15)":"3px solid rgba(255,255,255,0.12)",boxShadow:x?"0 6px 24px rgba(120,100,60,0.12)":"0 10px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05)",background:fe[Fe].photo?`url(${fe[Fe].photo}) center/cover no-repeat ${x?"#FAF7F2":"#0d0a1a"}`:x?"#FAF7F2":"#0d0a1a",x:ce,y:ve,rotate:pe,cursor:"grab"},children:se?t.jsxs("div",{onPointerDown:st=>st.stopPropagation(),onPointerUp:st=>st.stopPropagation(),onClick:st=>st.stopPropagation(),style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",zIndex:20},children:[t.jsx("div",{style:{position:"absolute",inset:0,backgroundImage:`url(${fe[Fe].photo||""})`,backgroundSize:"cover",backgroundPosition:"center",filter:"blur(25px) brightness(0.4)",transform:"scale(1.1)"}}),t.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(10,5,30,0.85) 70%, rgba(10,5,30,0.95) 100%)"}}),t.jsxs("div",{style:{position:"relative",zIndex:2,display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",padding:"0 40px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",background:"rgba(255,215,0,0.12)",border:"1px solid rgba(255,215,0,0.25)",backdropFilter:"blur(10px)",padding:"8px 20px",borderRadius:"20px",marginBottom:"12px",animation:"pulseScore 2.5s ease-in-out infinite"},children:[t.jsx(Xt,{size:18,color:"#FFD700"}),t.jsxs("span",{style:{fontWeight:"800",fontSize:"1.1rem",background:"linear-gradient(135deg, #FFD700, #FFA500)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:[((we=fe[Fe].compatibility)==null?void 0:we.total)??fe[Fe].matchScore??fe[Fe].score??0,"% compatible"]})]}),t.jsx("div",{style:{fontSize:"4rem",marginBottom:"8px",animation:"floatDiamond 3s ease-in-out infinite",filter:"drop-shadow(0 0 20px rgba(255,215,0,0.4))"},children:t.jsx(Jt,{size:48})}),t.jsx("p",{style:{color:"white",fontWeight:"800",fontSize:"1.5rem",margin:"0 0 4px",letterSpacing:"0.3px"},children:"Profil Mystère"}),t.jsx("p",{style:{color:"rgba(255,255,255,0.5)",fontSize:"0.85rem",margin:"0 0 20px",textAlign:"center"},children:"Débloquez pour voir ses photos et infos"}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px",width:"100%"},children:[t.jsxs("button",{onClick:st=>{st.stopPropagation(),ne?Cs(fe[Fe]):cl(fe[Fe])},style:{background:"linear-gradient(135deg, #FFD700, #FFA500)",border:"none",padding:"16px 24px",borderRadius:"18px",fontWeight:"800",cursor:"pointer",width:"100%",color:"#1a1a2e",fontSize:"1.05rem",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",boxShadow:"0 4px 25px rgba(255,215,0,0.4), 0 0 50px rgba(255,215,0,0.1)",letterSpacing:"0.3px"},children:[t.jsx(Jt,{size:20}),ne?"Voir le profil":"15 Meetips"]}),!ne&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx("div",{style:{flex:1,height:"1px",background:"rgba(255,255,255,0.1)"}}),t.jsx("span",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.3)",textTransform:"uppercase",letterSpacing:"1px"},children:"ou"}),t.jsx("div",{style:{flex:1,height:"1px",background:"rgba(255,255,255,0.1)"}})]}),t.jsxs("button",{onClick:st=>{st.stopPropagation(),r("/subscription")},style:{background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.7)",padding:"14px 24px",borderRadius:"16px",fontWeight:"600",cursor:"pointer",width:"100%",fontSize:"0.88rem",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:[t.jsx(ni,{size:16,color:"#FFD700"})," Tout débloquer â Premium"]})]}),t.jsx("button",{onClick:st=>{st.stopPropagation(),q(fe[Fe])},style:{background:"transparent",border:"none",color:"rgba(255,255,255,0.35)",padding:"10px",cursor:"pointer",fontSize:"0.8rem",fontWeight:"500"},children:"Passer â"})]})]}),t.jsx("style",{children:` 1173 @keyframes floatDiamond { 1174 0%, 100% { transform: translateY(0) rotate(0deg); } 1175 25% { transform: translateY(-8px) rotate(-3deg); } 1176 75% { transform: translateY(-4px) rotate(3deg); } 1177 } 1178 @keyframes pulseScore { 1179 0%, 100% { box-shadow: 0 0 8px rgba(255,215,0,0.15); } 1180 50% { box-shadow: 0 0 20px rgba(255,215,0,0.35), 0 0 40px rgba(255,215,0,0.1); } 1181 } 1182 `})]}):t.jsxs(t.Fragment,{children:[t.jsx(ye.div,{style:{position:"absolute",top:"15%",left:"10%",zIndex:60,border:"5px solid #00e676",borderRadius:"14px",padding:"10px 25px",transform:"rotate(-20deg)",opacity:$e,pointerEvents:"none"},children:t.jsx("span",{style:{fontSize:"2rem",fontWeight:"900",color:"#00e676",fontFamily:"Outfit",letterSpacing:"3px",textShadow:"0 0 30px rgba(0,230,118,0.8)",textTransform:"uppercase"},children:"COUP DE CÅUR"})}),t.jsx(ye.div,{style:{position:"absolute",top:"15%",right:"10%",zIndex:60,border:"5px solid #ff4d4d",borderRadius:"14px",padding:"10px 25px",transform:"rotate(20deg)",opacity:Xe,pointerEvents:"none"},children:t.jsx("span",{style:{fontSize:"2rem",fontWeight:"900",color:"#ff4d4d",fontFamily:"Outfit",letterSpacing:"3px",textShadow:"0 0 30px rgba(255,77,77,0.8)",textTransform:"uppercase"},children:"NOPE"})}),t.jsx(ye.div,{style:{position:"absolute",inset:0,zIndex:55,pointerEvents:"none",background:"radial-gradient(circle at 25% 40%, rgba(0,230,118,0.4) 0%, transparent 60%)",opacity:tt}}),t.jsx(ye.div,{style:{position:"absolute",inset:0,zIndex:55,pointerEvents:"none",background:"radial-gradient(circle at 75% 40%, rgba(255,77,77,0.4) 0%, transparent 60%)",opacity:gt}}),t.jsxs("div",{ref:ai,style:{position:"absolute",inset:0,overflowY:"auto",WebkitOverflowScrolling:"touch",zIndex:1,paddingBottom:"180px",touchAction:"pan-y"},children:[t.jsxs("div",{style:{position:"relative",minHeight:"65vh",backgroundSize:"cover",backgroundPosition:"center",backgroundImage:fe[Fe].photo&&!co.has(fe[Fe].photo)?`url(${fe[Fe].photo})`:"linear-gradient(145deg, #2d1b4e 0%, #1a1035 40%, #0d0a1a 100%)"},children:[fe[Fe].photo&&!co.has(fe[Fe].photo)&&t.jsx("img",{src:fe[Fe].photo,onError:()=>Si(fe[Fe].photo),style:{display:"none"},alt:""}),(!fe[Fe].photo||co.has(fe[Fe].photo))&&t.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"16px"},children:[t.jsx("div",{style:{width:"100px",height:"100px",borderRadius:"50%",background:"linear-gradient(135deg, rgba(201,160,255,0.3), rgba(201,160,255,0.08))",border:"2px s
1182olid rgba(201,160,255,0.25)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"2.5rem",fontWeight:"800",color:"rgba(201,160,255,0.7)",fontFamily:"Outfit",letterSpacing:"2px"},children:((ge=fe[Fe].name)==null?void 0:ge.split(" ").map(st=>st[0]).join("").slice(0,2).toUpperCase())||"?"}),t.jsxs("div",{style:{fontSize:"0.85rem",color:"rgba(201,160,255,0.45)",textAlign:"center",padding:"0 20px",lineHeight:1.4,fontStyle:"italic"},children:["ð· En attente de la photo de ",((oe=fe[Fe].name)==null?void 0:oe.split(" ")[0])||"..."]})]}),fe[Fe].animated_photo_url&&t.jsx("video",{src:fe[Fe].animated_photo_url,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}),t.jsx("div",{style:{position:"absolute",bottom:0,left:0,width:"100%",height:"60%",background:x?"linear-gradient(to top, #FAF7F2 0%, rgba(250,247,242,0.85) 30%, transparent 100%)":"linear-gradient(to top, #000 0%, rgba(0,0,0,0.85) 30%, transparent 100%)",pointerEvents:"none",zIndex:1}}),t.jsxs("div",{style:{position:"absolute",bottom:"20px",left:"20px",right:"20px",pointerEvents:"none",zIndex:2},children:[t.jsxs("h2",{style:{fontSize:"2.2rem",fontWeight:"bold",lineHeight:1.1,marginBottom:"5px",display:"flex",alignItems:"center",gap:"8px",textShadow:"0 2px 8px rgba(0,0,0,0.6)"},children:[fe[Fe].name,", ",fe[Fe].age,fe[Fe].verification_status==="verified"&&t.jsx(fi,{size:28,fill:"#26A69A",color:"#103030"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"15px",fontSize:"0.95rem",opacity:.9,textShadow:"0 1px 4px rgba(0,0,0,0.6)"},children:[fe[Fe].job&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[t.jsx(Qn,{size:16,color:"var(--primary)"}),t.jsx("span",{children:fe[Fe].job})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[t.jsx(ur,{size:16,color:"var(--primary)"}),t.jsx("span",{children:fe[Fe].city||fe[Fe].dist_km+" km"})]})]})]})]}),t.jsxs("div",{style:{background:x?"#FAF7F2":"#000",padding:"10px 20px 160px",textShadow:x?"none":"0 1px 2px rgba(0,0,0,0.8)",color:x?"#2A2520":void 0},children:[t.jsx("p",{style:{fontSize:"1rem",lineHeight:1.6,opacity:.9,marginBottom:"16px"},children:fe[Fe].bio||"Pas de bio renseignée."}),fe[Fe].voice_bio_url&&t.jsxs("div",{onClick:st=>{st.stopPropagation(),ke(fe[Fe])},style:{marginBottom:"20px",padding:"12px 16px",background:"linear-gradient(135deg, rgba(138,43,226,0.15), rgba(138,43,226,0.05))",borderRadius:"14px",display:"flex",alignItems:"center",gap:"12px",border:"1px solid rgba(138,43,226,0.3)",cursor:"pointer",transition:"all 0.25s"},children:[t.jsx("div",{style:{width:"38px",height:"38px",borderRadius:"50%",background:"linear-gradient(135deg, #8a2be2, #E91E63)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,fontSize:"1.1rem"},children:"ðï¸"}),t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"0.9rem",color:"white",fontWeight:"600"},children:"Bio Vocale"}),t.jsx("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.45)"},children:"Appuyez pour écouter"})]})]}),(()=>{var ir;const st=((ir=fe[Fe].compatibility)==null?void 0:ir.total)||0,er=st>=60?"76,175,80":st>=40?"255,152,0":"244,67,54";return t.jsxs("button",{onClick:Kr=>{Kr.stopPropagation(),no(!0)},style:{width:"100%",padding:"14px",borderRadius:"16px",background:`linear-gradient(135deg, rgba(${er},0.25), rgba(${er},0.1))`,border:`1px solid rgba(${er},0.45)`,color:"white",fontWeight:600,fontSize:"0.95rem",display:"flex",justifyContent:"center",alignItems:"center",gap:"10px",cursor:"pointer",marginBottom:"24px",boxShadow:`0 4px 15px rgba(${er},0.2)`},children:[t.jsx(Sn,{size:20,color:`rgb(${er})`}),"Compatibilité : ",st||"â","%"]})})(),Xa.createPortal(t.jsx(tr,{children:Zo&&t.jsxs(ye.div,{initial:{opacity:0,y:100},animate:{opacity:1,y:0},exit:{opacity:0,y:100},onClick:st=>{st.stopPropagation(),no(!1)},style:{position:"fixed",inset:0,zIndex:1e4,background:"rgba(0,0,0,0.95)",backdropFilter:"blur(20px)",display:"flex",flexDirection:"column",overflowY:"auto"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"calc(env(safe-area-inset-top, 12px) + 16px) 20px 15px",position:"sticky",top:0,zIndex:10,background:"linear-gradient(180deg, rgba(0,0,0,0.98) 60%, transparent 100%)"},children:[t.jsx("button",{onClick:st=>{st.stopPropagation(),no(!1)},"aria-label":"Retour",style:{background:"rgba(255,255,255,0.1)",border:"1px solid rgba(255,255,255,0.15)",borderRadius:"50%",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",color:"white",cursor:"pointer",flexShrink:0},children:t.jsx(Hr,{size:22})}),t.jsxs("h2",{style:{color:"white",textAlign:"center",margin:0,flex:1,fontSize:"1.1rem",fontFamily:"Outfit"},children:["Compatibilité avec ",(ie=fe[Fe])==null?void 0:ie.name]}),t.jsx("button",{onClick:st=>{st.stopPropagation(),no(!1)},"aria-label":"Fermer",style:{background:"rgba(255,255,255,0.1)",border:"1px solid rgba(255,255,255,0.15)",borderRadius:"50%",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",color:"white",cursor:"pointer",flexShrink:0},children:t.jsx(mt,{size:22})})]}),t.jsxs("div",{style:{textAlign:"center",marginBottom:"20px",fontSize:"2rem",fontWeight:"bold",color:(()=>{var er,ir;const st=((ir=(er=fe[Fe])==null?void 0:er.compatibility)==null?void 0:ir.total)||0;return st>=60?"#4CAF50":st>=40?"#FF9800":"#F44336"})()},children:[((Ve=(Oe=fe[Fe])==null?void 0:Oe.compatibility)==null?void 0:Ve.total)||0,"%"]}),t.jsx("div",{onClick:st=>st.stopPropagation(),style:{padding:"0 20px 40px"},children:t.jsx(Rh,{sections:Gi,details:(Mt=(yt=fe[Fe])==null?void 0:yt.compatibility)==null?void 0:Mt.details,match:fe[Fe],targetTags:js,mode:"full"})})]})}),document.body),t.jsxs("div",{style:{marginBottom:"24px"},children:[t.jsx("h4",{style:{fontSize:"0.8rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"1px",marginBottom:"14px"},children:"ð¬ Ses réponses"}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:(fe[Fe].prompts||fe[Fe].qa||[]).filter(st=>st.answer).map((st,er)=>t.jsxs("div",{style:{background:"rgba(255,255,255,0.04)",padding:"14px",borderRadius:"14px",borderLeft:"3px solid var(--primary)"},children:[t.jsx("div",{style:{fontSize:"0.78rem",color:"var(--primary)",marginBottom:"6px",fontWeight:500},children:st.question}),t.jsx("div",{style:{fontSize:"0.95rem",lineHeight:1.4},children:st.answer})]},er))})]}),t.jsxs("div",{style:{marginBottom:"24px"},children:[t.jsx("h4",{style:{fontSize:"0.8rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"1px",marginBottom:"14px"},children:"ð¸ Ses photos"}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"}
1182,children:(fe[Fe].photos||[fe[Fe].photo]).filter(Boolean).map((st,er)=>t.jsx("div",{onClick:ir=>{ir.stopPropagation(),Ti(er),St(st)},style:{width:"100%",aspectRatio:"4/5",borderRadius:"18px",backgroundImage:`url(${st})`,backgroundSize:"cover",backgroundPosition:"center",border:"1px solid rgba(255,255,255,0.08)",cursor:"pointer",boxShadow:"0 4px 20px rgba(0,0,0,0.3)"}},er))})]}),fe[Fe].events&&fe[Fe].events.length>0&&t.jsxs("div",{style:{marginBottom:"24px"},children:[t.jsx("h4",{style:{fontSize:"0.8rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"1px",marginBottom:"14px"},children:"ð Ãvénements"}),fe[Fe].events.map(st=>t.jsxs("div",{style:{background:"rgba(255,255,255,0.04)",padding:"12px 14px",borderRadius:"14px",display:"flex",alignItems:"center",gap:"12px",border:st.role==="Organise"?"1px solid var(--gold)":"1px solid rgba(255,255,255,0.08)",marginBottom:"8px"},children:[t.jsx("div",{style:{fontSize:"1.5rem"},children:st.emoji}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{fontWeight:600,fontSize:"0.9rem"},children:st.title}),t.jsxs("div",{style:{fontSize:"0.75rem",color:"var(--text-muted)",marginTop:"2px"},children:[st.date," ⢠",t.jsx("span",{style:{color:st.role==="Organise"?"var(--gold)":"var(--primary)"},children:st.role})]})]})]},st.id))]}),t.jsxs("div",{style:{display:"flex",gap:"10px"},children:[t.jsxs("button",{onClick:st=>{st.stopPropagation(),O(fe[Fe])},style:{flex:1,padding:"14px",borderRadius:"16px",background:"transparent",border:"1px solid var(--primary)",color:"var(--primary)",fontWeight:600,fontSize:"0.9rem",display:"flex",justifyContent:"center",alignItems:"center",gap:"8px",cursor:"pointer"},children:[t.jsx(Qt,{size:18})," Message"]}),t.jsxs("button",{onClick:st=>{st.stopPropagation(),Z(fe[Fe]),H(!0)},style:{flex:1,padding:"14px",borderRadius:"16px",background:"linear-gradient(135deg, rgba(156,39,176,0.2), rgba(156,39,176,0.1))",border:"1px solid rgba(156,39,176,0.3)",color:"#CE93D8",fontWeight:600,fontSize:"0.9rem",display:"flex",justifyContent:"center",alignItems:"center",gap:"8px",cursor:"pointer"},children:[t.jsx(Li,{size:18})," Cadeau"]})]})]})]}),t.jsxs("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",justifyContent:"center",alignItems:"center",gap:"14px",padding:"18px 12px calc(env(safe-area-inset-bottom, 0px) + 110px)",background:x?"linear-gradient(to top, rgba(250,247,242,0.98) 0%, rgba(250,247,242,0.92) 40%, rgba(250,247,242,0.6) 75%, transparent 100%)":"linear-gradient(to top, rgba(0,0,0,0.98) 0%, rgba(0,0,0,0.92) 40%, rgba(0,0,0,0.6) 75%, transparent 100%)",zIndex:30,pointerEvents:"auto"},children:[t.jsx(ye.button,{onClick:st=>{st.stopPropagation(),no(!0)},whileTap:{scale:.85},style:{width:"52px",height:"52px",borderRadius:"50%",background:x?"rgba(250,247,242,0.92)":"rgba(30,30,40,0.85)",border:`2px solid rgba(${(()=>{var er,ir;const st=((ir=(er=fe[Fe])==null?void 0:er.compatibility)==null?void 0:ir.total)||0;return st>=60?"76,175,80":st>=40?"255,152,0":"244,67,54"})()},0.5)`,boxShadow:x?"0 2px 8px rgba(120,100,60,0.1)":"0 4px 15px rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",flexDirection:"column",gap:"0"},children:t.jsxs("span",{style:{fontSize:"0.8rem",fontWeight:800,color:(()=>{var er,ir;const st=((ir=(er=fe[Fe])==null?void 0:er.compatibility)==null?void 0:ir.total)||0;return st>=60?"#4CAF50":st>=40?"#FF9800":"#F44336"})(),lineHeight:1},children:[((Ot=(lr=fe[Fe])==null?void 0:lr.compatibility)==null?void 0:Ot.total)||0,"%"]})}),t.jsx(ye.button,{onClick:st=>{st.stopPropagation(),ln("pass"),setTimeout(()=>ln(null),500),kt("left",fe[Fe])},animate:ks==="pass"?{scale:[1,.8,1.15,1],rotate:[0,-15,10,0]}:{},transition:{duration:.45,ease:"easeInOut"},whileTap:{scale:.85},style:{width:"60px",height:"60px",borderRadius:"50%",background:x?"rgba(250,247,242,0.92)":"rgba(30,30,40,0.85)",border:"2px solid rgba(255,77,77,0.35)",boxShadow:x?"0 2px 8px rgba(120,100,60,0.1)":"0 4px 15px rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:t.jsx(mt,{size:28,color:"#ff4d4d",strokeWidth:2.5})}),t.jsx(ye.button,{onClick:st=>{st.stopPropagation(),Z(fe[Fe]),H(!0)},whileTap:{scale:.85,rotate:15},style:{width:"52px",height:"52px",borderRadius:"50%",background:x?"rgba(250,247,242,0.92)":"rgba(30,30,40,0.85)",border:"2px s
1182olid rgba(156,39,176,0.35)",boxShadow:x?"0 2px 8px rgba(120,100,60,0.1)":"0 4px 15px rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:t.jsx(Li,{size:24,color:"#CE93D8",fill:"#CE93D8"})}),t.jsx(ye.button,{onClick:st=>{st.stopPropagation(),ln("like"),kt("right",fe[Fe])},animate:ks==="like"?{scale:[1,1.25,.9,1.1,1]}:{},transition:{duration:.5,ease:"easeInOut"},whileTap:{scale:.85},style:{width:"60px",height:"60px",borderRadius:"50%",background:P.includes((Pi=fe[Fe])==null?void 0:Pi.id)?"#E91E63":x?"rgba(250,247,242,0.92)":"rgba(30,30,40,0.85)",border:P.includes((mi=fe[Fe])==null?void 0:mi.id)?"2px solid #E91E63":"2px solid rgba(0,230,118,0.35)",boxShadow:P.includes((Yi=fe[Fe])==null?void 0:Yi.id)?"0 4px 20px rgba(233,30,99,0.4)":x?"0 2px 8px rgba(120,100,60,0.1)":"0 4px 15px rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"background 0.3s, border 0.3s, box-shadow 0.3s"},children:t.jsx(Bt,{size:28,color:P.includes((Fi=fe[Fe])==null?void 0:Fi.id)?"white":"#00e676",fill:P.includes((Un=fe[Fe])==null?void 0:Un.id)?"white":"none",strokeWidth:2})}),t.jsx(ye.button,{onClick:st=>{st.stopPropagation(),O(fe[Fe])},whileTap:{scale:.85},style:{width:"52px",height:"52px",borderRadius:"50%",background:x?"rgba(250,247,242,0.92)":"rgba(30,30,40,0.85)",border:"2px solid rgba(0,191,255,0.35)",boxShadow:x?"0 2px 8px rgba(120,100,60,0.1)":"0 4px 15px rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:t.jsx(Qt,{size:24,color:"#00BFFF",strokeWidth:2})})]}),t.jsxs(tr,{children:[bn==="tapLike"&&t.jsx(ye.div,{initial:{opacity:0}
1182,animate:{opacity:1},exit:{opacity:0},style:{position:"absolute",inset:0,zIndex:55,pointerEvents:"none",background:"radial-gradient(circle at 75% 30%, rgba(0,230,118,0.5) 0%, rgba(0,230,118,0.15) 40%, transparent 70%)"},children:t.jsx(ye.div,{initial:{scale:0,rotate:30},animate:{scale:1,rotate:20},style:{position:"absolute",top:"25%",right:"12%",border:"5px solid #00e676",borderRadius:"14px",padding:"10px 25px"},children:t.jsx("span",{style:{fontSize:"2rem",fontWeight:"900",color:"#00e676",fontFamily:"Outfit",letterSpacing:"3px",textShadow:"0 0 30px rgba(0,230,118,0.8)",textTransform:"uppercase"},children:"COUP DE CÅUR"})})}),bn==="tapPass"&&t.jsx(ye.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},style:{position:"absolute",inset:0,zIndex:55,pointerEvents:"none",background:"radial-gradient(circle at 25% 30%, rgba(255,23,68,0.5) 0%, rgba(255,23,68,0.15) 40%, transparent 70%)"},children:t.jsx(ye.div,{initial:{scale:0,rotate:-30},animate:{scale:1,rotate:-20},style:{position:"absolute",top:"25%",left:"8%",border:"5px solid #ff1744",borderRadius:"14px",padding:"10px 25px"},children:t.jsx("span",{style:{fontSize:"2rem",fontWeight:"900",color:"#ff1744",fontFamily:"Outfit",letterSpacing:"3px",textShadow:"0 0 30px rgba(255,23,68,0.8)",textTransform:"uppercase"},children:"ÃCARTÃ"})})})]})]})},fe[Fe].id)})():Pe?t.jsxs("div",{ref:W=>{W&&!sessionStorage.getItem("bravoConfettiFired")&&(sessionStorage.setItem("bravoConfettiFired","true"),setTimeout(()=>{cc({particleCount:80,spread:70,origin:{y:.3},zIndex:100,colors:["#D4B896","#FFD700","#00e676","#ff6b6b","#00BFFF"]}),setTimeout(()=>cc({particleCount:40,spread:100,origin:{y:.35,x:.3},zIndex:100}),300),setTimeout(()=>cc({particleCount:40,spread:100,origin:{y:.35,x:.7},zIndex:100}),500)},200))},style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",gap:"24px",color:x?"#2A2520":"white",padding:"0 24px",textAlign:"center"},children:[t.jsx("div",{style:{fontSize:"4rem",opacity:x?.9:.5},children:"ð"}),t.jsx("h2",{style:{fontFamily:"Outfit",fontSize:"1.8rem",fontWeight:800,margin:0,color:x?"#B8860B":"#D4B896",lineHeight:1.2},children:"Bravo !"}),t.jsx("p",{style:{fontFamily:"Outfit",fontSize:"1.1rem",color:x?"#6B5F50":"rgba(255,255,255,0.6)",margin:0,lineHeight:1.6,maxWidth:"320px"},children:"Tu as exploré tous les profils disponibles !"}),t.jsx("p",{style:{fontFamily:"Outfit",fontSize:"0.88rem",color:x?"#8C7A60":"rgba(255,255,255,0.4)",margin:"12px 0 0",lineHeight:1.5,maxWidth:"300px"},children:"ð¡ Pourquoi ne pas revoir tes coups de cÅur pour leur envoyer un message, ou découvrir les prochaines sorties ?"}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"14px",width:"100%",maxWidth:"320px",marginTop:"8px"},children:[t.jsxs("button",{onClick:()=>rt("given_likes"),style:{width:"100%",padding:"18px 24px",borderRadius:"18px",background:x?"linear-gradient(135deg, #26A69A 0%, #2BB5A0 100%)":"linear-gradient(135deg, rgba(0,230,118,0.2) 0%, rgba(0,230,118,0.08) 100%)",border:x?"none":"2px solid rgba(0,230,118,0.4)",color:x?"white":"#00e676",fontSize:"1.15rem",fontWeight:700,fontFamily:"Outfit",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"12px",boxShadow:x?"0 4px 16px rgba(38,166,154,0.35)":"0 4px 20px rgba(0,230,118,0.15)",transition:"transform 0.2s, box-shadow 0.2s"},children:[t.jsx(Bt,{size:24,fill:x?"white":"#00e676",color:x?"white":"#00e676"}),"Mes coups de cÅur"]}),t.jsx("button",{onClick:()=>r("/events"),style:{width:"100%",padding:"18px 24px",borderRadius:"18px",background:x?"linear-gradient(135deg, #7C4DFF 0%, #651FFF 100%)":"linear-gradient(135deg, rgba(124,77,255,0.2) 0%, rgba(124,77,255,0.08) 100%)",border:x?"none":"2px solid rgba(124,77,255,0.4)",color:x?"white":"#b388ff",fontSize:"1.15rem",fontWeight:700,fontFamily:"Outfit",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"12px",boxShadow:x?"0 4px 16px rgba(124,77,255,0.3)":"0 4px 20px rgba(124,77,255,0.15)",transition:"transform 0.2s, box-shadow 0.2s"},children:"ð Prochaines sorties"}),t.jsxs("button",{onClick:()=>rt("blocked"),style:{width:"100%",padding:"18px 24px",borderRadius:"18px",background:x?"linear-gradient(135deg, #E53935 0%, #EF5350 100%)":"linear-gradient(135deg, rgba(255,77,77,0.15) 0%, rgba(255,77,77,0.05) 100%)",border:x?"none":"2px s
1182olid rgba(255,77,77,0.3)",color:x?"white":"#ff6b6b",fontSize:"1.15rem",fontWeight:700,fontFamily:"Outfit",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"12px",boxShadow:x?"0 4px 16px rgba(229,57,53,0.3)":"0 4px 20px rgba(255,77,77,0.1)",transition:"transform 0.2s, box-shadow 0.2s"},children:[t.jsx(al,{size:24,color:x?"white":"#ff6b6b"}),"Revoir mes écartés"]})]}),t.jsx("button",{onClick:()=>{rt("hub"),ft(0)},style:{background:"none",border:"none",color:x?"#8C7A60":"rgba(255,255,255,0.35)",cursor:"pointer",fontSize:"0.9rem",fontFamily:"Outfit",fontWeight:500,marginTop:"4px",padding:"8px 16px"},children:"â Retour au menu"})]}):t.jsx(d1,{isErox:g,isFriend:h,favoritesCount:P.length,passedCount:be.filter(W=>!P.includes(W)).length,onRefresh:Qe,onViewFavorites:()=>rt(W=>W==="given_likes"?"standard":"given_likes"),onViewReceivedLikes:()=>rt(W=>W==="received_likes"?"standard":"received_likes"),onViewPassed:()=>rt(W=>W==="blocked"?"standard":"blocked"),onEditCriteria:()=>r("/edit-criteria"),onViewBlocked:()=>r("/blocked-users"),onViewMap:()=>rt("map"),matchedCount:vr.length,onViewMatches:()=>r("/favorites?tab=matches"),distFilter:Wt,setDistFilter:dt,ageFilter:vt,setAgeFilter:ut,genderFilter:Ht,setGenderFilter:or,onRefreshGPS:ha,isLocating:Ze}),z&&Le==="standard"&&fe[Fe]&&t.jsxs(ye.div,{initial:{opacity:0}
1182,animate:{opacity:1},exit:{opacity:0},onClick:()=>{Y(!1);try{Or("swipeTutorialSeen","true")}catch{}},style:{position:"absolute",inset:0,zIndex:200,background:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRadius:"24px"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%",padding:"0 30px",marginBottom:"25px"},children:[t.jsxs(ye.div,{animate:{x:[-5,-20,-5]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut"},style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"12px"},children:[t.jsx("div",{style:{fontSize:"3.5rem",lineHeight:1,color:"#ff4d4d",textShadow:"0 0 25px rgba(255,77,77,0.7)"},children:"â"}),t.jsx("div",{style:{background:"rgba(255,77,77,0.2)",border:"1.5px solid rgba(255,77,77,0.5)",borderRadius:"14px",padding:"10px 20px",backdropFilter:"blur(10px)"},children:t.jsx("span",{style:{color:"#ff6b6b",fontWeight:700,fontSize:"1rem",fontFamily:"Outfit"},children:"Ãcarter"})})]}),t.jsxs(ye.div,{animate:{x:[5,20,5]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut"},style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"12px"},children:[t.jsx("div",{style:{fontSize:"3.5rem",lineHeight:1,color:"#00e676",textShadow:"0 0 25px rgba(0,230,118,0.7)"},children:"â"}),t.jsx("div",{style:{background:"rgba(0,230,118,0.2)",border:"1.5px solid rgba(0,230,118,0.5)",borderRadius:"14px",padding:"10px 20px",backdropFilter:"blur(10px)"},children:t.jsx("span",{style:{color:"#69f0ae",fontWeight:700,fontSize:"1rem",fontFamily:"Outfit"},children:"Sélectionner"})})]})]}),t.jsx("p",{style:{color:"white",fontSize:"1rem",fontWeight:600,fontFamily:"Outfit",marginBottom:"8px",textAlign:"center",textShadow:"0 2px 8px rgba(0,0,0,0.5)"},children:"Tapez ou glissez le profil pour choisir"}),t.jsx(ye.p,{animate:{opacity:[.4,1,.4]},transition:{duration:2,repeat:1/0},style:{color:"rgba(255,255,255,0.6)",fontSize:"0.85rem",fontFamily:"Outfit"},children:"Touchez pour continuer"})]})]}):t.jsxs(t.Fragment,{children:[Pe&&Le!=="blocked"&&t.jsx("button",{onClick:()=>Me(!0),style:{position:"absolute",top:"20px",left:"20px",background:"rgba(255,255,255,0.1)",border:"none",borderRadius:"50%",padding:"10px",color:"white",zIndex:20,backdropFilter:"blur(5px)"},children:t.jsx(n5,{size:24})}),t.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"30px",marginTop:Pe?"20px":"0"},children:t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[["blocked","given_likes","received_likes","profile_viewers"].includes(Le)&&t.jsx("button",{onClick:()=>rt(Pe?"hub":"standard"),style:{background:"rgba(255,255,255,0.1)",border:"1px solid rgba(255,255,255,0.15)",borderRadius:"50%",width:"42px",height:"42px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"white",backdropFilter:"blur(5px)",transition:"all 0.2s"},children:t.jsx(Hr,{size:22})}),t.jsxs("div",{children:[t.jsx("h2",{style:{fontFamily:"Outfit",fontSize:Pe?"1.5rem":"2.5rem",marginBottom:"10px"},children:Le==="blocked"?"Profils Ãcartés":Le==="received_likes"?"Likes Reçus":Le==="given_likes"?"Coups de CÅur":Le==="profile_viewers"?"Qui a vu mon profil ðï¸":"Vos Prétendant(e)s"}),t.jsxs("p",{style:{color:"var(--text-muted)",fontSize:Pe?"0.85rem":"1rem",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx("span",{style:{borderLeft:"3px solid var(--accent)",paddingLeft:"15px"},children:Le==="blocked"?"Réintégrez ou discutez avec un profil":Le==="given_likes"?"Vos profils likés":Le==="received_likes"?"Ils vous ont liké !":Le==="profile_viewers"?"Ces personnes ont consulté votre profil":"Classés par compatibilité algorithmique"}),!ne&&t.jsx("span",{style:{background:"var(--gold)",color:"black",fontSize:"0.7rem",padding:"2px 6px",borderRadius:"4px",fontWeight:"bold",cursor:"pointer"},onClick:()=>r("/subscription"),children:"PASSER PREMIUM"})]})]})]})}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:["blocked","given_likes","received_likes","profile_viewers"].includes(Le)?Pe?"repeat(2, 1fr)":"repeat(auto-fill, minmax(180px, 1fr))":Pe?"1fr":"repeat(auto-fill, minmax(340px, 1fr))",gap:["blocked","given_likes","received_likes","profile_viewers"].includes(Le)?"12px":"25px",paddingBottom:"100px"},children:(()=>
1182{if(w)return t.jsxs("div",{style:{gridColumn:"1 / -1",padding:"100px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",color:"var(--text-muted)"},children:[t.jsx("div",{style:{width:"40px",height:"40px",border:"3px solid rgba(255,255,255,0.1)",borderTopColor:"var(--gold)",borderRadius:"50%",animation:"spin 1s linear infinite",marginBottom:"20px"}}),t.jsx("p",{children:"Recherche des meilleures compatibilités..."})]});const W=["standard","score_filter"].includes(Le)?j.filter(se=>!be.includes(se.id)):j;if(W.length===0){const we={blocked:{title:"Aucun profil écarté",desc:"Vous n'avez encore écarté personne."},given_likes:{title:"Aucun coup de cÅur",desc:"Likez des profils pour les retrouver ici."},received_likes:{title:"Aucun like reçu",desc:"Personne ne vous a encore liké, ça va venir !"}}[Le]||{title:"C'est le calme plat...",desc:"Nous n'avons trouvé personne correspondant à vos critères actuels (ou vous avez tout vu !)."};return t.jsxs("div",{style:{gridColumn:"1 / -1",padding:"60px",textAlign:"center",color:"var(--text-muted)",display:"flex",flexDirection:"column",alignItems:"center",background:"rgba(255,255,255,0.03)",borderRadius:"20px"},children:[t.jsx(r5,{size:64,style:{opacity:.3,marginBottom:"20px"}}),t.jsx("p",{style:{fontSize:"1.4rem",marginBottom:"10px",fontWeight:"300"},children:we.title}),t.jsx("p",{style:{fontSize:"1rem",marginBottom:"30px",maxWidth:"400px"},children:we.desc}),!["blocked","given_likes","received_likes","profile_viewers"].includes(Le)&&t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:Qe,style:{background:"var(--gradient-gold)",color:"black",border:"none",padding:"12px 30px",borderRadius:"30px",cursor:"pointer",fontSize:"1rem",fontWeight:"bold",boxShadow:"0 5px 20px rgba(255, 215, 0, 0.3)"},children:"Revoir tout le monde"}),t.jsxs("div",{style:{marginTop:"32px",maxWidth:"420px",width:"100%"},children:[t.jsxs("p",{style:{fontSize:"0.95rem",color:x?"#6B5F50":"rgba(255,255,255,0.5)",marginBottom:"16px",lineHeight:1.6,fontFamily:"Outfit"},children:["ð¡ En attendant, pourquoi ne pas revoir tes ",t.jsx("strong",{style:{color:x?"#B8860B":"#D4B896"},children:"coups de cÅur"})," pour leur envoyer un message, ou découvrir les ",t.jsx("strong",{style:{color:x?"#B8860B":"#D4B896"},children:"prochaines sorties"})," ?"]}),t.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"center",flexWrap:"wrap"},children:[t.jsx("button",{onClick:()=>rt("given_likes"),style:{padding:"12px 24px",borderRadius:"16px",background:x?"linear-gradient(135deg, #26A69A, #2BB5A0)":"linear-gradient(135deg, rgba(0,230,118,0.15), rgba(0,230,118,0.05))",border:x?"none":"2px solid rgba(0,230,118,0.3)",color:x?"white":"#69f0ae",fontSize:"0.95rem",fontWeight:700,fontFamily:"Outfit",cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",boxShadow:x?"0 4px 16px rgba(38,166,154,0.3)":"0 4px 15px rgba(0,230,118,0.1)",transition:"transform 0.2s"},onMouseEnter:ge=>ge.currentTarget.style.transform="translateY(-2px)",onMouseLeave:ge=>ge.currentTarget.style.transform="translateY(0)",children:"â¤ï¸ Mes coups de cÅur"}),t.jsx("button",{onClick:()=>r("/events"),style:{padding:"12px 24px",borderRadius:"16px",background:x?"linear-gradient(135deg, #7C4DFF, #651FFF)":"linear-gradient(135deg, rgba(124,77,255,0.15), rgba(124,77,255,0.05))",border:x?"none":"2px solid rgba(124,77,255,0.3)",color:x?"white":"#b388ff",fontSize:"0.95rem",fontWeight:700,fontFamily:"Outfit",cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",boxShadow:x?"0 4px 16px rgba(124,77,255,0.3)":"0 4px 15px rgba(124,77,255,0.1)",transition:"transform 0.2s"},onMouseEnter:ge=>ge.currentTarget.style.transform="translateY(-2px)",onMouseLeave:ge=>ge.currentTarget.style.transform="translateY(0)",children:"ð Prochaines sorties"})]})]})]})]})}return["blocked","given_likes","received_likes","profile_viewers"].includes(Le)?W.map(se=>{var we,ge;return t.jsxs(ye.div,{layout:!0,initial:{opacity:0,scale:.85},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},style:{borderRadius:"16px",overflow:"hidden",background:"rgba(25, 22, 40, 0.95)",border:"1px solid rgba(255,255,255,0.08)",display:"flex",flexDirection:"column"},children:[t.jsxs("div",{style:{position:"relative",aspectRatio:"3 / 3.5",overflow:"hidden",cursor:"pointer"},onClick:()=>{(Le==="received_likes"||Le==="given_likes")&&se.like_mode&&se.like_mode!==p?$({match:se,action:"profile",targetMode:se.like_mode}):He(se)},children:[se.photo&&!co.has(se.photo)?se.isVideoSelfie?t.jsx("video",{src:se.photo,autoPlay:!0,muted:!0,loop:!0,playsInl
1182ine:!0,style:{width:"100%",height:"100%",objectFit:"cover"}}):t.jsx("img",{src:se.photo,alt:se.name,onError:()=>Si(se.photo),style:{width:"100%",height:"100%",objectFit:"cover"}}):t.jsxs("div",{style:{width:"100%",height:"100%",background:"linear-gradient(145deg, #2d1b4e 0%, #1a1035 40%, #0d0a1a 100%)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"12px"},children:[t.jsx("div",{style:{width:"70px",height:"70px",borderRadius:"50%",background:"linear-gradient(135deg, rgba(201,160,255,0.3), rgba(201,160,255,0.08))",border:"2px solid rgba(201,160,255,0.25)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.6rem",fontWeight:"800",color:"rgba(201,160,255,0.7)",fontFamily:"Outfit",letterSpacing:"1px"},children:((we=se.name)==null?void 0:we.split(" ").map(oe=>oe[0]).join("").slice(0,2).toUpperCase())||"?"}),t.jsxs("div",{style:{fontSize:"0.7rem",color:"rgba(201,160,255,0.4)",textAlign:"center",padding:"0 12px",lineHeight:1.4,fontStyle:"italic"},children:["ð· En attente de la photo de ",((ge=se.name)==null?void 0:ge.split(" ")[0])||"..."]})]}),t.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:"50%",background:"linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 100%)"}}),t.jsxs("div",{style:{position:"absolute",bottom:"10px",left:"10px",right:"10px"},children:[t.jsxs("div",{style:{fontSize:"0.95rem",fontWeight:700,color:"white",fontFamily:"Outfit",textShadow:"0 1px 4px rgba(0,0,0,0.6)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[se.name,se.age?`, ${se.age}`:""]}),se.city&&t.jsxs("div",{style:{fontSize:"0.68rem",color:"rgba(255,255,255,0.65)",marginTop:"2px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",gap:"3px"},children:["ð ",se.city]})]}),se.voice_bio_url&&t.jsx("div",{onClick:oe=>{oe.stopPropagation(),ke(se)},style:{position:"absolute",top:"8px",right:"8px",width:"32px",height:"32px",borderRadius:"50%",background:"linear-gradient(135deg, rgba(138,43,226,0.85), rgba(233,30,99,0.85))",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:"0.85rem",boxShadow:"0 2px 8px rgba(138,43,226,0.4)",border:"1.5px solid rgba(255,255,255,0.2)",zIndex:2},title:"Ãcouter la bio vocale",children:"ðï¸"}),(Le==="received_likes"||Le==="given_likes")&&se.like_mode&&t.jsxs("div",{style:{position:"absolute",top:"8px",left:"8px",background:se.like_mode==="EROX"?"rgba(220,38,38,0.9)":se.like_mode==="FRIEND"?"rgba(38,166,154,0.9)":"rgba(138,43,226,0.85)",backdropFilter:"blur(8px)",borderRadius:"8px",padding:"3px 8px",display:"flex",alignItems:"center",gap:"4px",fontSize:"0.62rem",fontWeight:700,color:"white",zIndex:2,border:"1px solid rgba(255,255,255,0.2)",boxShadow:"0 2px 6px rgba(0,0,0,0.3)"},children:[se.like_mode==="EROX"?"ð¥":se.like_mode==="FRIEND"?"ð¥":"ð",se.like_mode==="EROX"?"Erox":se.like_mode==="FRIEND"?"Friend":"Eros"]})]}),t.jsxs("div",{style:{display:"flex",gap:"6px",padding:"8px 8px 10px"},children:[t.jsxs("button",{onClick:oe=>{oe.stopPropagation(),(Le==="received_likes"||Le==="given_likes")&&se.like_mode&&se.like_mode!==p?$({match:se,action:"chat",targetMode:se.like_mode}):O(se)},style:{flex:1,height:"34px",borderRadius:"10px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",cursor:"pointer",color:"rgba(255,255,255,0.8)",fontSize:"0.72rem",fontWeight:600,fontFamily:"Outfit",transition:"all 0.2s"},onMouseEnter:oe=>{oe.currentTarget.style.background="rgba(255,255,255,0.12)",oe.currentTarget.style.borderColor="rgba(255,255,255,0.2)"},onMouseLeave:oe=>{oe.currentTarget.style.background="rgba(255,255,255,0.06)",oe.currentTarget.style.borderColor="rgba(255,255,255,0.1)"},title:"Discuter",children:[t.jsx(Qt,{size:14})," Chat"]}),Le==="blocked"&&t.jsxs("button",{onClick:oe=>{oe.stopPropagation(),Ge(se.id)},style:{flex:1,height:"34px",borderRadius:"10px",background:"rgba(76, 175, 80, 0.15)",border:"1px solid rgba(76, 175, 80, 0.3)",display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",cursor:"pointer",color:"#6fd374",fontSize:"0.72rem",fontWeight:600,fontFamily:"Outfit",transition:"all 0.2s"},onMouseEnter:oe=>{oe.currentTarget.style.background="rgba(76, 175, 80, 0.25)"},onMouseLeave:oe=>{oe.currentTarget.style.background="rgba(76, 175, 80, 0.15)"},title:"Réintégrer",children:[t.jsx(kn,{size:14})," Revalider"]}),Le==="given_likes"&&t.jsxs("button",{onClick:oe=>{oe.stopPropagation(),jn(se.id)},style:{flex:1,height:"34px",borderRadius:"10px",background:"rgba(255, 77, 77, 0.15)",border:"1px solid rgba(255, 77, 77, 0.3)",display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",cursor:"pointer",color:"#ff7b7b",fontSize:"0.72rem",fontWeight:600,fontFamily:"Outfit",transition:"all 0.2s"},onMouseEnter:oe=>{oe.currentTarget.style.background="rgba(255, 77, 77, 0.25)"},onMouseLeave:oe=>{oe.currentTarget.style.background="rgba(255, 77, 77, 0.15)"},title:"Retirer le like",children:[t.jsx(Bt,{size:14,fill:"currentColor"})," Unlike"]}),Le==="profile_viewers"&&(()=>{const oe=P.includes(se.id);return t.jsxs("button",{onClick:ie=>{ie.stopPropagation(),jn(se.id)},style:{flex:1,height:"34px",borderRadius:"10px",background:oe?"rgba(255, 77, 106, 0.2)":"rgba(76, 175, 80, 0.15)",border:`1px solid ${oe?"rgba(255, 77, 106, 0.4)":"rgba(76, 175, 80, 0.3)"}`,display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",cursor:"pointer",color:oe?"#ff4d6a":"#6fd374",fontSize:"0.72rem",fontWeight:600,fontFamily:"Outfit",transition:"all 0.2s"},children:[t.jsx(Bt,{size:14,fill:oe?"currentColor":"none"})," ",oe?"Unlike":"Like"]})})(),Le==="received_likes"&&(()=>{const oe=P.includes(se.id);return t.jsxs("button",{onClick:ie=>{ie.stopPropagation(),jn(se.id)},style:{flex:1,height:"34px",borderRadius:"10px",background:oe?"rgba(255, 77, 106, 0.2)":"rgba(76, 175, 80, 0.15)",border:`1px solid ${oe?"rgba(255, 77, 106, 0.4)":"rgba(76, 175, 80, 0.3)"}`,display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",cursor:"pointer",color:oe?"#ff4d6a":"#6fd374",fontSize:"0.72rem",fontWeight:600,fontFamily:"Outfit",transition:"all 0.2s"},title:oe?"Match mutuel !":"Liker en retour",children:[t.jsx(Bt,{size:14,fill:oe?"currentColor":"none"})," ",oe?"Match !":"Liker"]})})()]})]},se.id)}):t.jsx(tr,{mode:"popLayout",children:W.map((se,we)=>{const ge=p==="EROX"?1:h?10:3,oe=!ne&&!te.includes(se.id)&&we>=ge;return t.jsx(ye.div,{layout:!0,initial:{opacity:0,scale:.8}
1182,animate:{opacity:1,scale:1},exit:"vaporize",variants:ua,children:t.jsx(F7,{match:se,isLocked:oe,isLiked:P.includes(se.id),isPremium:ne,isBlocked:!1,onToggleLike:jn,onPass:q,onSelect:He,onUnlock:ie=>ne?Cs(ie):cl(ie),onPlayVoice:ie=>ke(ie)})},se.id)})})})()})]})]}),t.jsx(tr,{children:re&&t.jsxs(t.Fragment,{children:[t.jsx(ye.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>He(null),style:{position:"fixed",top:Pe?"70px":0,left:0,width:"100%",bottom:Pe?"65px":0,background:"rgba(0,0,0,0.5)",backdropFilter:"blur(3px)",zIndex:997}}),t.jsx(ye.div,{initial:Pe?{y:"100%"}:{x:"100%"},animate:Pe?{y:0}:{x:0},exit:Pe?{y:"100%"}:{x:"100%"},transition:{type:"spring",damping:25,stiffness:200},style:{position:"fixed",top:Pe?"70px":0,right:0,left:Pe?0:"auto",bottom:Pe?"65px":0,height:"auto",width:Pe?"100%":"560px",background:"rgba(20, 20, 30, 0.98)",borderLeft:Pe?"none":"1px solid rgba(255,255,255,0.1)",borderRadius:"0",boxShadow:Pe?"0 -10px 30px rgba(0,0,0,0.5)":"-10px 0 30px rgba(0,0,0,0.5)",zIndex:998,display:"flex",flexDirection:"column",overflow:"hidden"},children:Pe?t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:()=>He(null),style:{position:"absolute",top:"12px",left:"15px",background:"white",border:"none",boxShadow:"0 2px 10px rgba(0,0,0,0.3)",color:"#1a1a2e",borderRadius:"50%",width:"42px",height:"42px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:1002,transition:"all 0.2s"},children:t.jsx(Hr,{size:20})}),t.jsx("button",{onClick:()=>He(null),style:{position:"absolute",top:"12px",right:"15px",background:"white",border:"none",boxShadow:"0 2px 10px rgba(0,0,0,0.3)",color:"#1a1a2e",borderRadius:"50%",width:"42px",height:"42px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:1002,transition:"all 0.2s"},children:t.jsx(mt,{size:20})}),t.jsxs("div",{className:"custom-scrollbar",style:{position:"absolute",inset:0,overflowY:"auto",WebkitOverflowScrolling:"touch",zIndex:1,paddingBottom:"100px"},children:[t.jsxs("div",{style:{position:"relative",minHeight:"65vh",overflow:"hidden",..._((g?re.erox_avatar_url:h?re.friend_avatar_url:null)||re.photo||re.avatar_url)?{}:{backgroundSize:"cover",backgroundPosition:"center",backgroundImage:`url(${(g?re.erox_avatar_url:h?re.friend_avatar_url:null)||re.photo||re.avatar_url||""})`}},children:[_((g?re.erox_avatar_url:h?re.friend_avatar_url:null)||re.photo||re.avatar_url)&&t.jsx("video",{src:(g?re.erox_avatar_url:h?re.friend_avatar_url:null)||re.photo||re.avatar_url,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",zIndex:0}}),re.animated_photo_url&&t.jsx("video",{src:re.animated_photo_url,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}),t.jsx("div",{style:{position:"absolute",bottom:0,left:0,width:"100%",height:"60%",background:"linear-gradient(to top, #000 0%, rgba(0,0,0,0.85) 30%, transparent 100%)",pointerEvents:"none",zIndex:1}}),t.jsxs("div",{style:{position:"absolute",bottom:"20px",left:"20px",right:"20px",pointerEvents:"none",zIndex:2},children:[t.jsxs("h2",{style:{fontSize:"2.2rem",fontWeight:"bold",lineHeight:1.1,marginBottom:"5px",display:"flex",alignItems:"center",gap:"8px",textShadow:"0 2px 8px rgba(0,0,0,0.6)"},children:[re.name,", ",re.age,re.verification_status==="verified"&&t.jsx(fi,{size:28,fill:"#26A69A",color:"#103030"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"15px",fontSize:"0.95rem",color:"rgba(255,255,255,0.95)",textShadow:"0 2px 6px rgba(0,0,0,0.8)"},children:[re.job&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[t.jsx(Qn,{size:16,color:"var(--primary)"}),t.jsx("span",{style:{fontWeight:600},children:re.job})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[t.jsx(ur,{size:16,color:"var(--primary)"}),t.jsx("span",{style:{fontWeight:600},children:re.city||re.dist_km+" km"})]})]})]})]}),t.jsxs("div",{style:{background:"#000",padding:"10px 20px 160px",textShadow:"0 1px 2px rgba(0,0,0,0.8)"},children:[t.jsx("p",{style:{fontSize:"0.95rem",lineHeight:1.7,color:"rgba(255,255,255,0.88)",marginBottom:"20px"},children:re.bio||"Pas de bio renseignée."}),(()=>{var we,ge;const W=((we=re.compatibility)==null?void 0:we.total)||0,se=W>=60?"#4CAF50":W>=40?"#FF9800":"#F44336";return t.jsxs(t.Fragment,{children:[t.jsxs("div",{onClick:oe=>{oe.stopPropagation(),Nt(ie=>ie==="compatibility"?null:"compatibility")},style:{display:"flex",alignItems:"center",gap:"12px",background:`linear-gradient(135deg, ${se}15, rgba(0,0,0,0.3))`,border:`1px solid ${se}44`,borderRadius:"16px",padding:"14px 18px",marginBottom:Dt==="compatibility"?"0":"16px",cursor:"pointer"},children:[t.jsxs("div",{style:{fontSize:"1.5rem",fontWeight:"bold",color:se},children:[W,"%"]}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{fontSize:"0.85rem",fontWeight:600,color:"white"},children:"Compatibilité"}),t.jsx("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.5)"},children:Dt==="compatibility"?"Appuyez pour fermer":"Appuyez pour les détails"})]})]}),Dt==="compatibility"&&t.jsx("div",{style:{background:`linear-gradient(135deg, ${se}08, rgba(0,0,0,0.2))`,border:`1px solid ${se}22`,borderTop:"none",borderRadius:"0 0 16px 16px",padding:"16px",marginBottom:"16
1182px"},children:t.jsx(Rh,{sections:Gi,details:(ge=re.compatibility)==null?void 0:ge.details,match:re,targetTags:js,mode:"full"})})]})})(),(re.prompts||re.qa||[]).filter(W=>W.answer).length>0&&t.jsxs("div",{style:{marginBottom:"16px"},children:[t.jsx("h4",{style:{fontSize:"0.7rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"1px",marginBottom:"8px",margin:"0 0 8px"},children:"ð¯ Ses réponses"}),(re.prompts||re.qa||[]).filter(W=>W.answer).slice(0,3).map((W,se)=>t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",padding:"10px 12px",borderRadius:"10px",borderLeft:"2px solid var(--gold)",marginBottom:"6px"},children:[t.jsx("div",{style:{fontSize:"0.7rem",color:"var(--gold)",fontWeight:600,marginBottom:"3px"},children:W.question}),t.jsx("div",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.9)"},children:W.answer})]},se))]}),(re.photos||[re.photo]).filter(Boolean).length>0&&t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px",marginBottom:"16px"},children:(re.photos||[re.photo]).filter(Boolean).map((W,se)=>t.jsx("div",{onClick:we=>{we.stopPropagation(),Ti(se),St(W)},style:{borderRadius:"10px",overflow:"hidden",aspectRatio:"1",cursor:"pointer"},children:t.jsx("img",{src:W,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}})},se))}),re.events&&re.events.length>0&&t.jsxs("div",{style:{marginBottom:"16px"},children:[t.jsx("h4",{style:{fontSize:"0.7rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"1px",marginBottom:"8px",margin:"0 0 8px"},children:"ð Ãvénements"}),re.events.map(W=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",background:"rgba(255,255,255,0.03)",padding:"10px 12px",borderRadius:"10px",marginBottom:"4px"},children:[t.jsx("span",{style:{fontSize:"1.3rem"},children:W.emoji}),t.jsxs("div",{children:[t.jsx("div",{style:{fontWeight:600,fontSize:"0.85rem"},children:W.title}),t.jsxs("div",{style:{fontSize:"0.7rem",color:"var(--text-muted)"},children:[W.date," ⢠",W.role]})]})]},W.id))]}),t.jsxs("div",{style:{display:"flex",gap:"10px",marginBottom:"20px"},children:[t.jsxs("button",{onClick:W=>{W.stopPropagation(),O(re)},style:{flex:1,padding:"14px",borderRadius:"16px",background:"linear-gradient(135deg, rgba(100,181,246,0.15), rgba(100,181,246,0.08))",border:"1px solid rgba(100,181,246,0.25)",color:"#90CAF9",fontWeight:600,fontSize:"0.9rem",display:"flex",justifyContent:"center",alignItems:"center",gap:"8px",cursor:"pointer"},children:[t.jsx(Qt,{size:18})," Message"]}),t.jsxs("button",{onClick:W=>{W.stopPropagation(),Z(re),H(!0)},style:{flex:1,padding:"14px",borderRadius:"16px",background:"linear-gradient(135deg, rgba(156,39,176,0.2), rgba(156,39,176,0.1))",border:"1px solid rgba(156,39,176,0.3)",color:"#CE93D8",fontWeight:600,fontSize:"0.9rem",display:"flex",justifyContent:"center",alignItems:"center",gap:"8px",cursor:"pointer"},children:[t.jsx(Li,{size:18})," Cadeau"]})]})]})]}),t.jsxs("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",justifyContent:"center",alignItems:"center",gap:"14px",padding:"20px 0 40px",background:"linear-gradient(to top, rgba(0,0,0,0.98) 0%, rgba(0,0,0,0.9) 40%, rgba(0,0,0,0.6) 75%, transparent 100%)",zIndex:50,pointerEvents:"auto"},children:[(()=>{var we;const W=((we=re.compatibility)==null?void 0:we.total)||0,se=W>=60?"#4CAF50":W>=40?"#FF9800":"#F44336";return t.jsx(ye.button,{onClick:ge=>{ge.stopPropagation(),Nt(oe=>oe==="compatibility"?null:"compatibility")},whileTap:{scale:.85},style:{width:"50px",height:"50px",borderRadius:"50%",background:"rgba(30,30,40,0.85)",border:`2px solid ${se}60`,boxShadow:"0 5px 20px rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",flexDirection:"column"},children:t.jsxs("span",{style:{fontSize:"0.85rem",fontWeight:800,color:se,fontFamily:"Outfit",lineHeight:1},children:[W,"%"]})})})(),t.jsx(ye.button,{onClick:W=>{W.stopPropagation(),He(null)},whileTap:{scale:.85},style:{width:"56px",height:"56px",borderRadius:"50%",background:"rgba(30,30,40,0.85)",border:"2px solid rgba(255,77,77,0.35)",boxShadow:"0 5px 20px rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:t.jsx(mt,{size:28,color:"#ff4d4d",strokeWidth:2.5})}),t.jsx(ye.button,{onClick:W=>{W.stopPropagation(),Z(re),H(!0)},whileTap:{scale:.85,rotate:15},style:{width:"50px",height:"50px",borderRadius:"50%",background:"white",border:"2px s
1182olid rgba(156,39,176,0.15)",boxShadow:"0 5px 20px rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:t.jsx(Li,{size:24,color:"#9C27B0",fill:"#9C27B0"})}),t.jsx(ye.button,{onClick:W=>{W.stopPropagation(),jn(re)},whileTap:{scale:.85},style:{width:"56px",height:"56px",borderRadius:"50%",background:P.includes(re==null?void 0:re.id)?"#E91E63":"rgba(30,30,40,0.85)",border:P.includes(re==null?void 0:re.id)?"2px solid #E91E63":"2px solid rgba(255,77,77,0.35)",boxShadow:P.includes(re==null?void 0:re.id)?"0 5px 25px rgba(233,30,99,0.5), 0 0 15px rgba(233,30,99,0.3)":"0 5px 20px rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"background 0.3s, border 0.3s, box-shadow 0.3s"},children:t.jsx(Bt,{size:28,color:P.includes(re==null?void 0:re.id)?"white":"#ff4d4d",fill:P.includes(re==null?void 0:re.id)?"white":"none",strokeWidth:2})}),t.jsx(ye.button,{onClick:W=>{W.stopPropagation(),O(re)},whileTap:{scale:.85},style:{width:"50px",height:"50px",borderRadius:"50%",background:"rgba(30,30,40,0.85)",border:"2px solid rgba(100,181,246,0.35)",boxShadow:"0 5px 20px rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:t.jsx(Qt,{size:22,color:"#64B5F6"})})]})]}):t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:()=>He(null),style:{position:"absolute",top:"15px",right:"15px",background:"rgba(0,0,0,0.5)",border:"1px solid rgba(255,255,255,0.15)",backdropFilter:"blur(10px)",color:"white",borderRadius:"50%",width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:30,transition:"all 0.2s"},onMouseEnter:W=>{W.currentTarget.style.background="rgba(255,77,77,0.4)",W.currentTarget.style.transform="scale(1.1)"},onMouseLeave:W=>{W.currentTarget.style.background="rgba(0,0,0,0.5)",W.currentTarget.style.transform="scale(1)"},children:t.jsx(mt,{size:18})}),t.jsxs("div",{className:"custom-scrollbar",style:{flex:1,overflowY:"auto",paddingBottom:"100px"},children:[t.jsx("div",{style:{position:"relative"},children:(()=>{const W=(g?re.erox_avatar_url:h?re.friend_avatar_url:null)||re.photo||re.avatar_url,se=(re.photos||[]).filter(ie=>ie&&ie!==W),we=[W,...se].filter(Boolean),ge=re._displayPhoto||W,oe=ge===W;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{onClick:()=>{Ti(we.indexOf(ge)),St(ge)},style:{width:"100%",height:"500px",backgroundImage:`url(${ge})`,backgroundSize:"cover",backgroundPosition:"center top",cursor:"zoom-in",position:"relative"},children:[re.animated_photo_url&&oe&&t.jsx("video",{src:re.animated_photo_url,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",zIndex:0}}),t.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:"180px",background:"linear-gradient(to top, rgba(20,20,30,1) 0%, rgba(20,20,30,0.7) 50%, transparent 100%)",pointerEvents:"none",zIndex:1}}),t.jsxs("div",{style:{position:"absolute",bottom:"18px",left:"20px",right:"140px",zIndex:2},children:[t.jsxs("h2",{style:{fontSize:"1.7rem",margin:"0 0 4px",color:"white",fontFamily:"Outfit",fontWeight:"700",textShadow:"0 2px 8px rgba(0,0,0,0.5)"},children:[re.name,", ",re.age]}),re.job&&t.jsxs("p",{style:{color:"var(--gold)",margin:"0 0 4px",fontSize:"0.88rem",display:"flex",alignItems:"center",gap:"5px"},children:["ð¼ ",re.job]}),t.jsxs("p",{style:{color:"rgba(255,255,255,0.7)",margin:0,display:"flex",alignItems:"center",gap:"4px",fontSize:"0.82rem"},children:[t.jsx(ur,{size:12})," ",re.city||"Paris",", ",re.dist_km||"?","km"]})]})]}),t.jsxs("div",{style:{position:"absolute",bottom:"12px",right:"12px",display:"flex",gap:"6px",zIndex:3},children:[we.slice(0,5).map((ie,Oe)=>t.jsx("div",{onClick:Ve=>{Ve.stopPropagation(),He(yt=>({...yt,_displayPhoto:ie}))},style:{width:"48px",height:"48px",borderRadius:"10px",overflow:"hidden",position:"relative",border:ge===ie?"2.5px solid var(--gold)":"2px solid rgba(255,255,255,0.3)",cursor:"pointer",transition:"all 0.25s cubic-bezier(0.4, 0, 0.2, 1)",opacity:ge===ie?1:.75,boxSh
1182adow:ge===ie?"0 0 14px rgba(255, 215, 0, 0.5)":"0 2px 8px rgba(0,0,0,0.4)"},onMouseEnter:Ve=>{ge!==ie&&(Ve.currentTarget.style.opacity="1",Ve.currentTarget.style.transform="scale(1.12)",Ve.currentTarget.style.borderColor="rgba(255,255,255,0.7)")},onMouseLeave:Ve=>{ge!==ie&&(Ve.currentTarget.style.opacity="0.75",Ve.currentTarget.style.transform="scale(1)",Ve.currentTarget.style.borderColor="rgba(255,255,255,0.3)")},children:Oe===0&&re.animated_photo_url?t.jsx("video",{src:re.animated_photo_url,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,style:{width:"100%",height:"100%",objectFit:"cover"}}):t.jsx("img",{src:ie,style:{width:"100%",height:"100%",objectFit:"cover"},alt:""})},Oe)),re.voice_bio_url&&t.jsx("div",{onClick:ie=>{ie.stopPropagation(),ke(re)},style:{width:"48px",height:"48px",borderRadius:"10px",overflow:"hidden",position:"relative",border:"2px solid rgba(138,43,226,0.6)",cursor:"pointer",transition:"all 0.25s cubic-bezier(0.4, 0, 0.2, 1)",background:"linear-gradient(135deg, rgba(138,43,226,0.4), rgba(233,30,99,0.3))",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.2rem",boxShadow:"0 2px 10px rgba(138,43,226,0.3)"},onMouseEnter:ie=>{ie.currentTarget.style.transform="scale(1.12)",ie.currentTarget.style.borderColor="rgba(138,43,226,0.9)",ie.currentTarget.style.boxShadow="0 0 16px rgba(138,43,226,0.6)"},onMouseLeave:ie=>{ie.currentTarget.style.transform="scale(1)",ie.currentTarget.style.borderColor="rgba(138,43,226,0.6)",ie.currentTarget.style.boxShadow="0 2px 10px rgba(138,43,226,0.3)"},title:"Ãcouter la bio vocale",children:"ðï¸"})]})]})})()}),t.jsxs("div",{style:{padding:"20px 22px 30px"},children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",marginBottom:"22px"},children:[re.job&&t.jsxs("div",{style:{background:"rgba(255,255,255,0.04)",backdropFilter:"blur(12px)",padding:"8px 14px",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.06)",fontSize:"0.82rem",color:"rgba(255,255,255,0.8)",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(Qn,{size:13,color:"var(--gold)"})," ",re.job]}),re.height&&t.jsxs("div",{style:{background:"rgba(255,255,255,0.04)",backdropFilter:"blur(12px)",padding:"8px 14px",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.06)",fontSize:"0.82rem",color:"rgba(255,255,255,0.8)",display:"flex",alignItems:"center",gap:"6px"},children:["ð ",re.height," cm"]}),re.zodiac&&t.jsxs("div",{style:{background:"rgba(255,255,255,0.04)",backdropFilter:"blur(12px)",padding:"8px 14px",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.06)",fontSize:"0.82rem",color:"rgba(255,255,255,0.8)",display:"flex",alignItems:"center",gap:"6px"},children:["â ",re.zodiac]}),re.languages&&t.jsxs("div",{style:{background:"rgba(255,255,255,0.04)",backdropFilter:"blur(12px)",padding:"8px 14px",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.06)",fontSize:"0.82rem",color:"rgba(255,255,255,0.8)",display:"flex",alignItems:"center",gap:"6px"},children:["ð ",Array.isArray(re.languages)?re.languages.join(", "):re.languages]}),re.smoking!==void 0&&t.jsxs("div",{style:{background:"rgba(255,255,255,0.04)",backdropFilter:"blur(12px)",padding:"8px 14px",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.06)",fontSize:"0.82rem",color:"rgba(255,255,255,0.8)",display:"flex",alignItems:"center",gap:"6px"},children:["ð¬ ",re.smoking?"Fumeur":"Non-fumeur"]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.04)",backdropFilter:"blur(12px)",padding:"8px 14px",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.06)",fontSize:"0.82rem",color:"rgba(255,255,255,0.8)",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(ur,{size:13,color:"var(--gold)"})," ",re.city||"Paris"," · ",re.dist_km||"?","km"]})]}),t.jsxs("div",{style:{marginBottom:"22px",position:"relative",background:"rgba(255,255,255,0.03)",backdropFilter:"blur(20px)",padding:"20px",borderRadius:"18px",border:"1px solid rgba(255,255,255,0.06)",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"2px",background:"linear-gradient(90deg, transparent, var(--gold), transparent)",opacity:.4}}),t.jsx("h4",{style:{fontSize:"0.72rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"1.5px",margin:"0 0 12px",display:"flex",alignItems:"center",gap:"6px"},children:"ð¬ à propos"}),t.jsx("p",{style:{lineHeight:"1.75",color:"rgba(255,255,255,0.88)",fontSize:"0.92rem",margin:0},children:re.bio||"Aucune description renseignée."}),re.voice_bio_url&&t.jsxs("div",{onClick:W=>{W.stopPropagation(),ke(re)},style:{marginTop:"14px",padding:"12px 16px",background:"linear-gradient(135deg, rgba(138,43,226,0.1), rgba(138,43,226,0.04))",borderRadius:"14px",display:"flex",alignItems:"center",gap:"12px",border:"1px solid rgba(138,43,226,0.2)",cursor:"pointer",transition:"all 0.25s"},children:[t.jsx("div",{style:{width:"36px",height:"36px",borderRadius:"50%",background:"linear-gradient(135deg, #8a2be2, #E91E63)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:"ðï¸"}),t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"0.85rem",color:"white",fontWeight:"600"},children:"Bio Vocale"}),t.jsx("div",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.4)"},children:"Appuyez pour écouter"})]})]})]}),oo&&t.jsxs("div",{style:{marginBottom:"22px",background:"linear-gradient(135deg, rgba(255,215,0,0.04), rgba(255,180,0,0.02))",backdropFilter:"blur(20px)",padding:"20px",borderRadius:"18px",border:"1px solid rgba(255,215,0,0.12)",overflow:"hidden",position:"relative"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"2px",background:"linear-gradient(90deg, transparent, #FFD700, transparent)",opacity:.5}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"16
1182px"},children:[t.jsx("h4",{style:{fontSize:"0.72rem",color:"#FFD700",textTransform:"uppercase",letterSpacing:"1.5px",margin:0,display:"flex",alignItems:"center",gap:"6px"},children:"â Avis Organisateur"}),t.jsxs("div",{style:{background:"rgba(255,215,0,0.1)",padding:"5px 12px",borderRadius:"10px",border:"1px solid rgba(255,215,0,0.2)"},children:[t.jsx("span",{style:{fontSize:"1rem",fontWeight:"800",color:"#FFD700"},children:oo.avg.toFixed(1)}),t.jsx("span",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.4)",marginLeft:"4px"},children:"/ 5"})]})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginBottom:"16px"},children:[Array.from({length:5},(W,se)=>t.jsx(nr,{size:20,fill:se<Math.round(oo.avg)?"#FFD700":"transparent",color:se<Math.round(oo.avg)?"#FFD700":"rgba(255,255,255,0.15)"},se)),t.jsxs("span",{style:{fontSize:"0.82rem",color:"rgba(255,255,255,0.5)",marginLeft:"8px"},children:[oo.count," avis"]})]}),Vt&&Vt.length>0&&t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:Vt.slice(0,5).map((W,se)=>{var we,ge,oe;return t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",padding:"14px",borderRadius:"14px",border:"1px solid rgba(255,255,255,0.05)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginBottom:W.comment?"8px":0},children:[t.jsx("img",{src:((we=W.user)==null?void 0:we.avatar_url)||((ge=W.user)==null?void 0:ge.photo)||"https://via.placeholder.com/30",alt:"",style:{width:"32px",height:"32px",borderRadius:"50%",objectFit:"cover",border:"1px solid rgba(255,255,255,0.1)"}}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{fontSize:"0.82rem",fontWeight:"600",color:"rgba(255,255,255,0.8)"},children:((oe=W.user)==null?void 0:oe.name)||"Anonyme"}),t.jsx("div",{style:{display:"flex",alignItems:"center",gap:"2px"},children:Array.from({length:5},(ie,Oe)=>t.jsx(nr,{size:10,fill:Oe<W.rating?"#FFD700":"transparent",color:Oe<W.rating?"#FFD700":"rgba(255,255,255,0.15)"},Oe))})]}),W.created_at&&t.jsx("span",{style:{fontSize:"0.65rem",color:"rgba(255,255,255,0.25)"},children:new Date(W.created_at).toLocaleDateString("fr-FR",{day:"numeric",month:"short"})})]}),W.comment&&t.jsxs("p",{style:{margin:0,fontSize:"0.82rem",color:"rgba(255,255,255,0.6)",lineHeight:1.5,fontStyle:"italic"},children:['"',W.comment,'"']})]},se)})})]}),(re.prompts||re.qa)&&(re.prompts||re.qa).filter(W=>W.answer).length>0&&t.jsxs("div",{style:{marginBottom:"20px"},children:[t.jsx("h4",{style:{fontSize:"0.75rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:"12px",letterSpacing:"1.5px",margin:"0 0 12px",display:"flex",alignItems:"center",gap:"6px"},children:"ð¯ Ses réponses"}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:(re.prompts||re.qa||[]).filter(W=>W.answer).slice(0,3).map((W,se)=>t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",padding:"13px",borderRadius:"12px",borderLeft:"3px solid var(--gold)"},children:[t.jsx("div",{style:{fontSize:"0.72rem",color:"var(--gold)",marginBottom:"6px",fontWeight:"600"},children:W.question}),t.jsx("div",{style:{color:"rgba(255,255,255,0.9)",fontSize:"0.88rem",lineHeight:1.5},children:W.answer})]},se))})]}),re.events&&re.events.length>0&&t.jsxs("div",{style:{marginBottom:"20px"},children:[t.jsx("h4",{style:{fontSize:"0.75rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:"12px",letterSpacing:"1.5px",margin:"0 0 12px",display:"flex",alignItems:"center",gap:"6px"},children:"ð Ãvénements"}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:re.events.map(W=>t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",padding:"12px 14px",borderRadius:"12px",display:"flex",alignItems:"center",gap:"12px",border:W.role==="Organise"?"1px solid rgba(255,215,0,0.3)":"1px solid rgba(255,255,255,0.06)",transition:"all 0.2s"},children:[t.jsx("div",{style:{fontSize:"1.4rem"},children:W.emoji}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{fontWeight:"600",fontSize:"0.88rem",color:"white"},children:W.title}),t.jsxs("div",{style:{fontSize:"0.72rem",color:"var(--text-muted)",marginTop:"2px"},children:[W.date," ⢠",t.jsx("span",{style:{color:W.role==="Organise"?"var(--gold)":"#64B5F6"},children:W.role})]})]})]},W.id))})]}),t.jsxs("div",{style:{marginBottom:"20px"},children:[t.jsxs("h4",{style:{fontSize:"0.75rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:"12px",letterSpacing:"1.5px",margin:"0 0 12px",display:"flex",alignItems:"center",gap:"6px"},children:["⨠Compatibilité â ",((Je=re.compatibility)==null?void 0:Je.total)||85,"%"]}),t.jsx("p",{style:{fontSize:"0.78rem",color:"rgba(255,255,255,0.45)",margin:"0 0 12px",fontStyle:"italic"},children:"Vous avez en commun ces caractéristiques"}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[Gi.map(W=>{var ge,oe;const se=(oe=(ge=re.compatibility)==null?void 0:ge.details)==null?void 0:oe[W.id],we=(se==null?void 0:se.commonItems)||[];return!se||we.length===0?null:t.jsxs("div",{style:{background:"rgba(255,255,255,0.02)",padding:"12px",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.04)"},children:[t.jsxs("div",{style:{fontSize:"0.72rem",color:W.color,marginBottom:"10px",fontWeight:"bold",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(W.icon,{size:14})," ",W.title]}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:we.slice(0,8).map(ie=>t.jsxs("span",{title:`${ie.label} : ${ie.description||""}`,style:{background:`${W.color}20`,border:`1px solid ${W.color}`,color:"white",padding:"5px 11px",borderRadius:"20px",fontSize:"0.72rem",cursor:"help",display:"flex",alignItems:"center",gap:"4px",transition:"all 0.2s"},children:[ie.icon&&t.jsx(ie.icon,{size:11})," ",ie.label," â"]},ie.id))})]},W.id)}),(!((pt=re.compatibility)!=null&&pt.details)||Object.keys(re.compatibility.details).length===0)&&t.jsx("span",{style:{color:"var(--text-muted)",fontStyle:"italic",fontSize:"0.9rem"},children:"Aucune info renseignée."})]})]})]})]}),Dt&&t.jsx("div",{onClick:()=>Nt(null),style:{position:"fixed",inset:0,zIndex:19,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",background:"rgba(0,0,0,0.35)",transition:"all 0.3s"}}),t.jsx(tr,{children:Dt&&t.jsx(ye.div,{initial:{height:0,opacity:0,y:30},animate:{height:"auto",opacity:1,y:0},exit:{height:0,opacity:0,y:30},transition:{type:"spring",damping:26,stiffness:200},style:{position:"absolute",bottom:"105px",left:"12px",right:"12px",background:"rgba(15, 15, 25, 0.88)",backdropFilter:"blur(36px) saturate(200%)",WebkitBackdropFilter:"blur(36px) saturate(200%)",borderRadius:"22px",border:"1px solid rgba(255, 255, 255, 0.12)",boxShadow:"0 16px 56px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.1)",zIndex:30,overflow:"hidden"},children:t.jsxs("div",{style:{padding:"20px 18px",maxHeight:"520px",overflowY:"auto"},className:"custom-scrollbar",children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16
1182px",paddingBottom:"12px",borderBottom:"1px solid rgba(255,255,255,0.08)"},children:[t.jsxs("h4",{style:{margin:0,fontSize:"0.95rem",color:"white",fontWeight:"700",display:"flex",alignItems:"center",gap:"8px"},children:[Dt==="compatibility"&&t.jsxs(t.Fragment,{children:[t.jsx(Xt,{size:18,color:"#FFD700"})," Compatibilité â ",((it=re.compatibility)==null?void 0:it.total)||85,"%"]}),Dt==="gifts"&&t.jsxs(t.Fragment,{children:[t.jsx(Li,{size:18,color:"#E91E63"})," Offrir un Cadeau"]}),Dt==="chat"&&t.jsxs(t.Fragment,{children:[t.jsx(Qt,{size:18,color:"#64B5F6"})," Message à ",re.name]})]}),t.jsx("button",{onClick:()=>{Nt(null),yn(!1)},style:{background:"rgba(255,255,255,0.08)",border:"none",color:"white",borderRadius:"50%",width:"30px",height:"30px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:"0.85rem",transition:"all 0.2s"},onMouseEnter:W=>W.currentTarget.style.background="rgba(255,255,255,0.2)",onMouseLeave:W=>W.currentTarget.style.background="rgba(255,255,255,0.08)",children:"â"})]}),Dt==="compatibility"&&t.jsxs("div",{children:[t.jsx("p",{style:{fontSize:"0.82rem",color:"rgba(255,255,255,0.5)",margin:"0 0 16px",fontStyle:"italic"},children:"Vos points en commun"}),Gi.map(W=>{var ge,oe;const se=(oe=(ge=re.compatibility)==null?void 0:ge.details)==null?void 0:oe[W.id],we=(se==null?void 0:se.commonItems)||[];return!se||we.length===0?null:t.jsxs("div",{style:{marginBottom:"16px"},children:[t.jsxs("div",{style:{fontSize:"0.78rem",color:W.color,marginBottom:"10px",fontWeight:"bold",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(W.icon,{size:15})," ",W.title]}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"7px"},children:we.map(ie=>t.jsxs("div",{style:{background:`${W.color}15`,border:`1.5px solid ${W.color}`,color:"white",padding:"7px 14px",borderRadius:"20px",fontSize:"0.78rem",cursor:"default",display:"flex",alignItems:"center",gap:"5px",transition:"all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1)",position:"relative"},onMouseEnter:Oe=>{Oe.currentTarget.style.transform="scale(1.18)",Oe.currentTarget.style.zIndex="10",Oe.currentTarget.style.boxShadow=`0 4px 20px ${W.color}30`;const Ve=Oe.currentTarget.querySelector(".compat-tip");Ve&&(Ve.style.opacity="1")},onMouseLeave:Oe=>{Oe.currentTarget.style.transform="scale(1)",Oe.currentTarget.style.zIndex="1",Oe.currentTarget.style.boxShadow="none";const Ve=Oe.currentTarget.querySelector(".compat-tip");Ve&&(Ve.style.opacity="0")},children:[ie.icon&&t.jsx(ie.icon,{size:13}),ie.label,t.jsx("span",{style:{color:"#4CAF50",fontSize:"0.65rem"},children:"â"}),ie.description&&t.jsx("span",{className:"compat-tip",style:{position:"absolute",bottom:"110%",left:"50%",transform:"translateX(-50%)",opacity:0,background:"rgba(0,0,0,0.9)",color:"white",padding:"5px 12px",borderRadius:"8px",fontSize:"0.7rem",whiteSpace:"nowrap",pointerEvents:"none",transition:"opacity 0.2s",zIndex:50},children:ie.description})]},ie.id))})]},W.id)}
1182),(!((Ke=re.compatibility)!=null&&Ke.details)||Object.keys(re.compatibility.details).length===0)&&t.jsx("span",{style:{color:"var(--text-muted)",fontStyle:"italic",fontSize:"0.85rem"},children:"Aucune donnée de compatibilité."})]}),Dt==="gifts"&&t.jsxs("div",{children:[t.jsx(g0,{}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",background:"rgba(255,215,0,0.08)",padding:"12px 16px",borderRadius:"14px",marginBottom:"16px",border:"1px solid rgba(255,215,0,0.2)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx("span",{style:{fontSize:"1.4rem"},children:"ð°"}),t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"0.75rem",color:"var(--text-muted)"},children:"Solde disponible"}),t.jsxs("div",{style:{fontSize:"1.2rem",fontWeight:"800",color:"var(--gold)"},children:[At," Meetips"]})]})]}),t.jsx("button",{onClick:()=>Zt(W=>!W),style:{background:jr?"rgba(255,255,255,0.15)":"linear-gradient(135deg, #FFD700, #FF8C00)",border:jr?"1px solid rgba(255,215,0,0.4)":"none",borderRadius:"10px",padding:"8px 16px",color:jr?"#FFD700":"black",fontWeight:"700",fontSize:"0.75rem",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:W=>W.currentTarget.style.transform="scale(1.05)",onMouseLeave:W=>W.currentTarget.style.transform="scale(1)",children:jr?"â Cadeaux":"+ Recharger"})]}),jr?t.jsxs("div",{children:[t.jsx("p",{style:{fontSize:"0.78rem",color:"rgba(255,255,255,0.5)",marginBottom:"14px",textAlign:"center"},children:"Choisissez un pack pour recharger vos Meetips â¨"}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"10px"},children:[{id:"starter",cost:10,amount:60,name:"Découverte",emoji:"ð±"},{id:"regular",cost:15,amount:95,name:"Plaisir",emoji:"ð",popular:!0},{id:"pro",cost:20,amount:130,name:"Séducteur",emoji:"ð¥"},{id:"ultimate",cost:50,amount:350,name:"Expert",emoji:"ð"}].map(W=>t.jsxs("button",{onClick:()=>{const we={starter:"https://buy.stripe.com/7sY9AS3LhdqJbQVa8iffy02",regular:"https://buy.stripe.com/eVq4gy1D94Ud2gl3JUffy03",pro:"https://buy.stripe.com/aFa9AS1D92M53kp4NYffy04",ultimate:"https://buy.stripe.com/cNieVc5TpfyRaMR4NYffy05"}[W.id];if(!we||we.includes("placeholder")){Ft(Ve=>Ve+W.amount),Zt(!1),fr({emoji:"ð°",name:`${W.amount} Meetips`,recipientName:"votre compte"}),jt(!0),setTimeout(()=>jt(!1),4e3);return}Or("paymentType","buy_pack"),Or("pendingPackId",W.id),xr(!0);const ge=600,oe=800,ie=(window.innerWidth-ge)/2,Oe=(window.innerHeight-oe)/2;window.open(we,"StripePayment",`width=${ge},height=${oe},top=${Oe},left=${ie},scrollbars=yes,status=yes,resizable=yes`)},style:{background:W.popular?"linear-gradient(135deg, rgba(138,43,226,0.25), rgba(255,215,0,0.12))":"rgba(255,255,255,0.05)",border:W.popular?"1px solid rgba(138,43,226,0.5)":"1px solid rgba(255,255,255,0.08)",borderRadius:"14px",padding:"14px 10px",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",cursor:"pointer",color:"white",transition:"all 0.25s",position:"relative"},onMouseEnter:se=>{se.currentTarget.style.transform="scale(1.05)",se.currentTarget.style.boxShadow="0 8px 24px rgba(138,43,226,0.3)"},onMouseLeave:se=>{se.currentTarget.style.transform="scale(1)",se.currentTarget.style.boxShadow="none"},children:[W.popular&&t.jsx("div",{style:{position:"absolute",top:"-8px",background:"linear-gradient(135deg, #8a2be2, #E91E63)",color:"white",fontSize:"0.55rem",fontWeight:"800",padding:"2px 10px",borderRadius:"10px",letterSpacing:"0.5px"},children:"POPULAIRE"}),t.jsx("span",{style:{fontSize:"1.6rem"},children:W.emoji}),t.jsx("span",{style:{fontSize:"0.72rem",fontWeight:"600",opacity:.8},children:W.name}),t.jsx("span",{style:{fontSize:"1.3rem",fontWeight:"800",color:"#FFD700"},children:W.amount}),t.jsx("span",{style:{fontSize:"0.65rem",color:"rgba(255,255,255,0.5)"},children:"Meetips"}),t.jsxs("div",{style:{background:"linear-gradient(135deg, #FFD700, #FF8C00)",color:"black",fontWeight:"800",fontSize:"0.8rem",padding:"6px 18px",borderRadius:"10px",marginTop:"4px"},children:[W.cost,"â¬"]})]},W.id))}),t.jsx("p",{style:{fontSize:"0.65rem",color:"rgba(255,255,255,0.35)",marginTop:"12px",textAlign:"center"},children:"ð Paiement sécurisé par Stripe"})]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"12px"},children:[{id:"rose",emoji:"ð¹",name:"Rose",price:5},{id:"chocolate",emoji:"ð«",name:"Chocolat",price:10},{id:"cocktail",emoji:"ð¸",name:"Cocktail",price:15},{id:"parfum",emoji:"ð",name:"Bouquet",price:25},{id:"diamond",emoji:"ð",name:"Diamant",price:50},{id:"trip",emoji:"âï¸",name:"Voyage",price:100}].map((W,se)=>t.jsxs("button",{onClick:()=>
1182{if(At>=W.price){Ft(oe=>oe-W.price);const we=new Date().toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"}),ge={text:`ð Cadeau envoyé : ${W.emoji} ${W.name}`,fromMe:!0,time:we,isSystem:!0};Xo(oe=>({...oe,[re.id]:[...oe[re.id]||[],ge]})),setTimeout(()=>{const oe={text:`Merci beaucoup pour ${W.emoji} ${W.name} ! C'est adorable ð¥°`,fromMe:!1,time:new Date().toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"})};Xo(ie=>({...ie,[re.id]:[...ie[re.id]||[],oe]}))},2e3+Math.random()*2e3),fr({emoji:W.emoji,name:W.name,recipientName:re.name}),jt(!0),Nt(null),Zt(!1),setTimeout(()=>jt(!1),4e3)}},disabled:At<W.price,style:{background:At>=W.price?"rgba(255,255,255,0.05)":"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"14px",padding:"16px 8px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",cursor:At>=W.price?"pointer":"not-allowed",opacity:At>=W.price?1:.4,transition:"all 0.25s",color:"white"},onMouseEnter:we=>{At>=W.price&&(we.currentTarget.style.transform="scale(1.08)",we.currentTarget.style.borderColor="#E91E63")},onMouseLeave:we=>{we.currentTarget.style.transform="scale(1)",we.currentTarget.style.borderColor="rgba(255,255,255,0.08)"},children:[t.jsx(kp,{gift:W,giftIdx:se,size:48}),t.jsx("span",{style:{fontSize:"0.8rem",fontWeight:"600"},children:W.name}),t.jsxs("span",{style:{fontSize:"0.72rem",color:"var(--gold)",fontWeight:"700",background:"rgba(255,215,0,0.1)",padding:"3px 10px",borderRadius:"8px"},children:[W.price," â¦"]})]},W.id))})]}),Dt==="chat"&&(()=>{const W=re.id,se=Yo[W]||[],we=["ð","ð","â¤ï¸","ð","ð¥°","ð","ð¥","ð","ð","ð¤©","ð","ð¤","ð","â¨","ð","ð","ð","ð","ð¯","ð¹","ð","ð¸","ðµ","ð¸","ð","âï¸","ð","âï¸","ð¦","ð«"],ge=()=>{const oe=On.trim();if(!oe)return;const ie={text:oe,fromMe:!0,time:new Date().toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"})};Xo(Oe=>({...Oe,[W]:[...Oe[W]||[],ie]})),Ln(""),yn(!1),setTimeout(()=>{const Oe=["Merci pour ton message ! ð","C'est super sympa ça ! â¨","Ah oui ? Dis m'en plus ð¤","Haha ð trop drôle !","J'adorerais en discuter ! ð","Oh c'est gentil ! ð¥°","On se voit bientôt ? ð¹"],Ve={text:Oe[Math.floor(Math.random()*Oe.length)],fromMe:!1,time:new Date().toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"})};Xo(yt=>({...yt,[W]:[...yt[W]||[],Ve]}))},1500+Math.random()*1500)};return t.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"420px"},children:[t.jsxs("div",{style:{flex:1,overflowY:"auto",overflowX:"hidden",background:"rgba(255,255,255,0.03)",borderRadius:"16px",padding:"14px",marginBottom:"12px",border:"1px solid rgba(255,255,255,0.06)",display:"flex",flexDirection:"column",gap:"8px"},className:"custom-scrollbar",children:[se.length===0?t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"var(--text-muted)",gap:"10px"},children:[t.jsx("div",{style:{fontSize:"2.5rem",opacity:.5},children:"ð¬"}),t.jsxs("div",{style:{fontSize:"0.85rem",textAlign:"center"},children:["Démarrez la conversation",t.jsx("br",{}),"avec ",t.jsx("strong",{style:{color:"#64B5F6"},children:re.name})]}),t.jsx("div",{style:{fontSize:"0.72rem",opacity:.6},children:"Envoyez un message ou un emoji !"})]}):se.map((oe,ie)=>t.jsxs("div",{style:{display:"flex",justifyContent:oe.fromMe?"flex-end":"flex-start",animation:"fadeInUp 0.3s ease-out"},children:[!oe.fromMe&&t.jsx("div",{style:{width:"28px",height:"28px",borderRadius:"50%",backgroundImage:`url(${re.photo})`,backgroundSize:"cover",backgroundPosition:"center",flexShrink:0,marginRight:"8px",marginTop:"4px"}}),t.jsxs("div",{style:{maxWidth:"75%",padding:oe.isSystem?"8px 14px":"10px 16px",borderRadius:oe.fromMe?"18px 18px 4px 18px":"18px 18px 18px 4px",background:oe.isSystem?"linear-gradient(135deg, rgba(233,30,99,0.25), rgba(255,64,129,0.15))":oe.fromMe?"linear-gradient(135deg, #4A90D9, #357ABD)":"rgba(255,255,255,0.08)",color:"white",fontSize:"0.85rem",lineHeight:"1.4",border:oe.isSystem?"1px solid rgba(233,30,99,0.3)":"none",boxShadow:oe.fromMe?"0 2px 8px rgba(74,144,217,0.3)":"none"},children:[oe.text,t.jsx("div",{style:{fontSize:"0.62rem",opacity:.6,marginTop:"4px",textAlign:oe.fromMe?"right":"left"},children:oe.time})]})]},ie)),t.jsx("div",{ref:Ai})]}),t.jsx(tr,{children:mn&&t.jsx(ye.div,{initial:{height:0,opacity:0}
1182,animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},style:{background:"rgba(255,255,255,0.05)",borderRadius:"14px",marginBottom:"8px",border:"1px solid rgba(255,255,255,0.08)",overflow:"hidden"},children:t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",padding:"10px"},children:we.map((oe,ie)=>t.jsx("button",{onClick:Oe=>{Oe.stopPropagation(),Ln(Ve=>Ve+oe)},style:{background:"none",border:"none",fontSize:"1.3rem",cursor:"pointer",padding:"4px",borderRadius:"8px",transition:"all 0.15s"},onMouseEnter:Oe=>{Oe.currentTarget.style.background="rgba(255,255,255,0.1)",Oe.currentTarget.style.transform="scale(1.3)"},onMouseLeave:Oe=>{Oe.currentTarget.style.background="none",Oe.currentTarget.style.transform="scale(1)"},children:oe},ie))})})}),t.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[t.jsx("button",{onClick:oe=>{oe.stopPropagation(),yn(ie=>!ie)},style:{background:mn?"rgba(100,181,246,0.2)":"rgba(255,255,255,0.06)",border:mn?"1px solid rgba(100,181,246,0.4)":"1px solid rgba(255,255,255,0.1)",borderRadius:"12px",width:"44px",height:"44px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:"1.2rem",transition:"all 0.2s",flexShrink:0},onMouseEnter:oe=>oe.currentTarget.style.background="rgba(100,181,246,0.15)",onMouseLeave:oe=>oe.currentTarget.style.background=mn?"rgba(100,181,246,0.2)":"rgba(255,255,255,0.06)",children:"ð"}),t.jsx("input",{type:"text",value:On,onChange:oe=>Ln(oe.target.value),onKeyDown:oe=>{oe.key==="Enter"&&ge()},placeholder:`Message à ${re.name}â¦`,style:{flex:1,padding:"12px 16px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"14px",color:"white",fontSize:"0.88rem",outline:"none",transition:"border-color 0.2s"},onFocus:oe=>oe.target.style.borderColor="#64B5F6",onBlur:oe=>oe.target.style.borderColor="rgba(255,255,255,0.1)",onClick:oe=>oe.stopPropagation()}),t.jsx("button",{onClick:ge,disabled:!On.trim(),style:{background:On.trim()?"linear-gradient(135deg, #64B5F6, #42A5F5)":"rgba(255,255,255,0.06)",border:"none",borderRadius:"14px",padding:"0 20px",height:"44px",color:On.trim()?"white":"rgba(255,255,255,0.3)",fontWeight:"700",cursor:On.trim()?"pointer":"default",fontSize:"0.85rem",transition:"all 0.2s",flexShrink:0},onMouseEnter:oe=>{On.trim()&&(oe.currentTarget.style.transform="scale(1.05)")},onMouseLeave:oe=>oe.currentTarget.style.transform="scale(1)",children:"Envoyer"})]})]})})()]})})}),t.jsx("div",{style:{position:"absolute",bottom:"20px",left:"50%",transform:"translateX(-50%)",display:"flex",alignItems:"flex-end",justifyContent:"center",gap:"12px",padding:"12px 28px",background:"rgba(255, 255, 255, 0.07)",backdropFilter:"blur(24px) saturate(180%)",WebkitBackdropFilter:"blur(24px) saturate(180%)",borderRadius:"24px",border:"1px solid rgba(255, 255, 255, 0.13)",boxShadow:"0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.12)",zIndex:25},children:(()=>{var se,we;return[{key:"compatibility",label:`${((se=re.compatibility)==null?void 0:se.total)||85}%`,color:"#FFD700",bgHover:"rgba(255, 215, 0, 0.25)",icon:t.jsxs(t.Fragment,{children:[t.jsx(Xt,{size:24}),t.jsxs("span",{style:{fontSize:"0.58rem",fontWeight:"800",marginTop:"-3px",letterSpacing:"-0.5px"},children:[((we=re.compatibility)==null?void 0:we.total)||85,"%"]})]}),onClick:()=>Nt(ge=>ge==="compatibility"?null:"compatibility")},{key:"pass",label:"Passer",color:"#ff4d4d",bgHover:"rgba(255, 77, 77, 0.25)",icon:t.jsx(ip,{size:24}),onClick:()=>q(re.id)},{key:"chat",label:"Chat",color:"#64B5F6",bgHover:"rgba(100, 181, 246, 0.25)",icon:t.jsx(Qt,{size:24}),onClick:()=>O(re)},{key:"gifts",label:"Cadeau",color:"#E91E63",bgHover:"rgba(233, 30, 99, 0.25)",icon:t.jsx(Li,{size:24}),onClick:()=>Nt(ge=>ge==="gifts"?null:"gifts")},{key:"like",label:"Liker",color:P.includes(re.id)?"#4CAF50":"#ff6b81",bgHover:P.includes(re.id)?"rgba(76, 175, 80, 0.25)":"rgba(255, 107, 129, 0.25)",icon:t.jsx(Bt,{size:24,fill:P.includes(re.id)?"currentColor":"none"}),onClick:()=>jn(re.id)}].map((ge,oe)=>t.jsxs("button",{onClick:ge.onClick,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"3px",background:"none",border:"none",color:ge.color,cursor:"pointer",padding:"6px 8px",transition:"all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1)",position:"relative"},onMouseEnter:ie=>{ie.currentTarget.style.transform="scale(1.35) translateY(-10px)",ie.currentTarget.querySelector(".dock-icon-bg").style.background=ge.bgHover,ie.currentTarget.querySelector(".dock-icon-bg").style.boxShadow=`0 0 24px ${ge.color}40, 0 0 48px ${ge.color}15`,ie.currentTarget.querySelector(".dock-label").style.opacity="1",ie.currentTarget.querySelector(".dock-label").style.transform="translateY(-4px) scale(0.8)",ie.currentTarget.parentElement.querySelectorAll("button").forEach((yt,Mt)=>
1182{if(Mt!==oe){const lr=Math.abs(Mt-oe);lr===1?yt.style.transform="scale(1.15) translateY(-4px)":lr===2&&(yt.style.transform="scale(1.05) translateY(-1px)")}})},onMouseLeave:ie=>{ie.currentTarget.style.transform="scale(1) translateY(0)",ie.currentTarget.querySelector(".dock-icon-bg").style.background=Dt===ge.key?ge.bgHover:"rgba(255,255,255,0.06)",ie.currentTarget.querySelector(".dock-icon-bg").style.boxShadow="none",ie.currentTarget.querySelector(".dock-label").style.opacity="0",ie.currentTarget.querySelector(".dock-label").style.transform="translateY(4px) scale(0.8)",ie.currentTarget.parentElement.querySelectorAll("button").forEach(yt=>{yt.style.transform="scale(1) translateY(0)"})},children:[t.jsx("span",{className:"dock-label",style:{fontSize:"0.68rem",fontWeight:"600",opacity:0,transition:"all 0.25s",transform:"translateY(4px) scale(0.8)",pointerEvents:"none",whiteSpace:"nowrap",color:"white",background:"rgba(0,0,0,0.75)",padding:"3px 10px",borderRadius:"8px"},children:ge.label}),t.jsx("div",{className:"dock-icon-bg",style:{width:"56px",height:"56px",borderRadius:"16px",background:Dt===ge.key?ge.bgHover:"rgba(255,255,255,0.06)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",transition:"all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1)",border:Dt===ge.key?`1px solid ${ge.color}40`:"1px solid rgba(255,255,255,0.1)"},children:ge.icon})]},ge.key))})()}),It&&t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",zIndex:9999,overflow:"hidden"},children:Array.from({length:60}).map((W,se)=>{const we=["#FFD700","#E91E63","#4CAF50","#2196F3","#FF9800","#9C27B0","#00BCD4","#FF5722"],ge=we[Math.floor(Math.random()*we.length)],oe=Math.random()*100,ie=Math.random()*1.5,Oe=2+Math.random()*2,Ve=6+Math.random()*8,yt=Math.random()*360,Mt=Math.random()>.5?"50%":"2px";return t.jsx("div",{style:{position:"absolute",left:`${oe}%`,top:"-10px",width:`${Ve}px`,height:`${Ve}px`,backgroundColor:ge,borderRadius:Mt,transform:`rotate(${yt}deg)`,animation:`confettiFall ${Oe}s ease-in ${ie}s forwards`,opacity:.9}},se)})}),t.jsx(tr,{children:ot&&t.jsxs(ye.div,{initial:{opacity:0}
1182,animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},onClick:()=>Zr(null),style:{position:"fixed",inset:0,zIndex:99999,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"radial-gradient(ellipse at center, rgba(212,175,55,0.25) 0%, rgba(10,5,20,0.97) 70%)",backdropFilter:"blur(20px)",cursor:"pointer",overflow:"hidden"},children:[Array.from({length:40}).map((W,se)=>{const we=["#FFD700","#FF6B6B","#4CAF50","#64B5F6","#E91E63","#FF9800","#9C27B0","#00BCD4"],ge=we[se%we.length],oe=Math.random()*100,ie=Math.random()*2,Oe=2.5+Math.random()*2,Ve=6+Math.random()*8,yt=Math.random()*360;return t.jsx("div",{style:{position:"absolute",top:"-20px",left:`${oe}%`,width:`${Ve}px`,height:`${Ve*.6}px`,background:ge,borderRadius:"2px",transform:`rotate(${yt}deg)`,animation:`confettiFall ${Oe}s ease-in ${ie}s infinite`,opacity:.9,pointerEvents:"none",zIndex:0}},se)}),t.jsx("style",{children:` 1183 @keyframes confettiFall { 1184 0% { transform: translateY(0) rotate(0deg); opacity: 1; } 1185 100% { transform: translateY(100vh) rotate(720deg); opacity: 0; } 1186 } 1187 `}),t.jsx("div",{style:{position:"absolute",top:"30%",left:"50%",transform:"translate(-50%, -50%)",width:"300px",height:"300px",borderRadius:"50%",background:"radial-gradient(circle, rgba(212,175,55,0.3) 0%, transparent 70%)",filter:"blur(60px)",pointerEvents:"none"}}),t.jsxs(ye.div,{initial:{scale:0,rotate:-20},animate:{scale:1,rotate:0},transition:{type:"spring",stiffness:200,damping:12,delay:.2},style:{marginBottom:"20px",textAlign:"center",zIndex:1},children:[t.jsx("div",{style:{fontSize:"4rem",fontWeight:"900",fontFamily:"Outfit",background:"linear-gradient(135deg, #FFD700 0%, #FFA500 30%, #FFD700 60%, #fff 100%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",letterSpacing:"8px",textShadow:"0 0 60px rgba(255,215,0,0.5)",filter:"drop-shadow(0 4px 20px rgba(255,215,0,0.4))"},children:"MEET !"}),t.jsx("div",{style:{fontSize:"1.1rem",color:"rgba(255,255,255,0.85)",fontWeight:600,marginTop:"4px",fontFamily:"Outfit"},children:"ð Félicitations ! C'est un Match ! ð"}),t.jsx("div",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.5)",fontWeight:400,marginTop:"4px",fontFamily:"Outfit"},children:"Vous vous êtes mutuellement choisis !"})]}),t.jsx(ye.div,{initial:{scale:0,y:50},animate:{scale:1,y:0},transition:{type:"spring",stiffness:200,damping:15,delay:.4},style:{width:"140px",height:"140px",borderRadius:"50%",backgroundImage:ot.matchPhoto?`url(${ot.matchPhoto})`:"linear-gradient(135deg, #2d1b4e, #0d0a1a)",backgroundSize:"cover",backgroundPosition:"center",border:"4px solid #FFD700",boxShadow:"0 0 40px rgba(255,215,0,0.4), 0 10px 30px rgba(0,0,0,0.5), 0 0 80px rgba(255,215,0,0.2)",marginBottom:"16px",zIndex:1}}),t.jsx(ye.p,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.6},style:{fontSize:"1.6rem",fontWeight:700,color:"white",fontFamily:"Outfit",margin:"0 0 28px",zIndex:1},children:ot.matchName}),t.jsxs(ye.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.8},style:{display:"flex",gap:"12px",zIndex:1,flexWrap:"wrap",justifyContent:"center",padding:"0 20px"},children:[t.jsxs("button",{onClick:W=>{W.stopPropagation();const se=j.find(we=>we.id===ot.matchId)||S.find(we=>we.id===ot.matchId);Zr(null),se&&He(se)},style:{background:"rgba(255,255,255,0.1)",border:"2px solid rgba(255,255,255,0.3)",padding:"14px 28px",borderRadius:"50px",color:"white",fontWeight:700,fontSize:"1rem",cursor:"pointer",fontFamily:"Outfit",display:"flex",alignItems:"center",gap:"10px",backdropFilter:"blur(10px)",transition:"all 0.2s"},children:[t.jsx(rr,{size:20})," Voir le profil"]}),t.jsxs("button",{onClick:W=>{W.stopPropagation();const se=j.find(we=>we.id===ot.matchId)||S.find(we=>we.id===ot.matchId);Zr(null),se&&O(se)},style:{background:"linear-gradient(135deg, #FFD700, #FFA500)",border:"none",padding:"14px 28px",borderRadius:"50px",color:"#1a1a2e",fontWeight:800,fontSize:"1rem",cursor:"pointer",fontFamily:"Outfit",display:"flex",alignItems:"center",gap:"10px",boxShadow:"0 6px 30px rgba(255,215,0,0.4)",letterSpacing:"0.5px"},children:[t.jsx(Qt,{size:20})," Message"]})]}),t.jsx(ye.p,{initial:{opacity:0}
1187,animate:{opacity:1},transition:{delay:1.2},style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.3)",marginTop:"24px",fontFamily:"Outfit",zIndex:1},children:"Touchez n'importe où pour fermer"})]})}),t.jsx(tr,{children:Gt&&t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},children:t.jsxs(ye.div,{initial:{opacity:0,scale:.7},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.7},transition:{type:"spring",damping:20,stiffness:300},style:{zIndex:1e4,background:"rgba(15, 15, 25, 0.95)",backdropFilter:"blur(30px)",WebkitBackdropFilter:"blur(30px)",borderRadius:"24px",border:"1px solid rgba(255, 215, 0, 0.3)",boxShadow:"0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(255,215,0,0.15)",padding:"30px 24px",textAlign:"center",width:"85%",maxWidth:"360px"},onClick:W=>W.stopPropagation(),children:[t.jsx("div",{style:{fontSize:"3.5rem",marginBottom:"12px"},children:Gt.emoji}),t.jsx("h3",{style:{margin:"0 0 8px",fontSize:"1.15rem",fontWeight:"800",color:"white",fontFamily:"Inter, sans-serif"},children:"Cadeau envoyé ! ð"}),t.jsxs("p",{style:{margin:"0 0 6px",fontSize:"0.88rem",color:"rgba(255,255,255,0.8)",lineHeight:"1.5"},children:["Merci pour votre ",t.jsx("strong",{style:{color:"#FFD700"},children:Gt.name})," pour ",t.jsx("strong",{style:{color:"#64B5F6"},children:Gt.recipientName})," !"]}),t.jsx("p",{style:{margin:"0 0 20px",fontSize:"0.78rem",color:"rgba(255,255,255,0.5)",lineHeight:"1.4"},children:"Cette personne en sera avertie par un message dans sa boîte de dialogue. ð"}),t.jsx("button",{onClick:()=>fr(null),style:{background:"linear-gradient(135deg, #FFD700, #FF8C00)",border:"none",borderRadius:"14px",padding:"12px 36px",color:"black",fontWeight:"800",fontSize:"0.9rem",cursor:"pointer",transition:"all 0.2s",boxShadow:"0 4px 16px rgba(255,215,0,0.3)"},onMouseEnter:W=>W.currentTarget.style.transform="scale(1.05)",onMouseLeave:W=>W.currentTarget.style.transform="scale(1)",children:"Super ! â¨"})]})})})]})})]})}),R&&t.jsx(ll,{match:R,onClose:()=>O(null)}),E&&(()=>{const{match:W,action:se,targetMode:we}=E,ge=we==="EROX"?"MEETapps Erox":we==="FRIEND"?"MEETapps Friend":"MEETapps Eros",oe=we==="EROX"?"#ff3333":we==="FRIEND"?"#26A69A":"#8B5CF6",ie=we==="EROX"?"ð¥":we==="FRIEND"?"ð¥":"ð";return Xa.createPortal(t.jsx(tr,{children:t.jsx(ye.div,{initial:{opacity:0}
1187,animate:{opacity:1},exit:{opacity:0},onClick:()=>$(null),style:{position:"fixed",inset:0,zIndex:9999,background:"rgba(0,0,0,0.7)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},children:t.jsx(ye.div,{initial:{opacity:0,scale:.85,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.85},onClick:Oe=>Oe.stopPropagation(),style:{width:"90%",maxWidth:"380px",background:"linear-gradient(135deg, #1a1a2e, #16213e)",borderRadius:"24px",overflow:"hidden",border:`1px solid ${oe}40`,boxShadow:`0 20px 50px rgba(0,0,0,0.5), 0 0 30px ${oe}20`},children:t.jsxs("div",{style:{padding:"24px",textAlign:"center"},children:[t.jsx("div",{style:{width:"56px",height:"56px",borderRadius:"50%",background:`${oe}20`,border:`2px solid ${oe}50`,display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 16px",fontSize:"1.5rem"},children:ie}),t.jsx("h3",{style:{color:"white",margin:"0 0 8px",fontSize:"1.1rem",fontWeight:700},children:"Changer d'espace ?"}),t.jsxs("p",{style:{color:"rgba(255,255,255,0.6)",fontSize:"0.85rem",margin:"0 0 20px",lineHeight:1.5},children:["Ce like vient de ",t.jsx("strong",{style:{color:oe},children:ge}),".",t.jsx("br",{}),"Pour ",se==="chat"?"discuter":"voir le profil",", vous allez basculer vers cet espace."]}),t.jsxs("div",{style:{display:"flex",gap:"10px"},children:[t.jsx("button",{onClick:()=>$(null),style:{flex:1,padding:"14px",borderRadius:"14px",background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.15)",color:"rgba(255,255,255,0.7)",cursor:"pointer",fontWeight:600,fontSize:"0.9rem",fontFamily:"Outfit"},children:"Annuler"}),t.jsxs("button",{onClick:()=>{u(we),$(null),setTimeout(()=>{se==="chat"?O(W):He(W)},300)},style:{flex:1,padding:"14px",borderRadius:"14px",background:`linear-gradient(135deg, ${oe}, ${oe}cc)`,border:"none",color:"white",cursor:"pointer",fontWeight:700,fontSize:"0.9rem",fontFamily:"Outfit",boxShadow:`0 4px 20px ${oe}40`},children:[ie," Basculer"]})]})]})})})}),document.body)})(),B&&t.jsx(E7,{item:B.item,price:B.price,userId:y==null?void 0:y.id,meetipsBalance:At,onMeetipsUnlock:W=>{ao.current=Date.now();const se=[...te,B.item.id];K(se),Or("unlockedMatches",JSON.stringify(se)),Ft(W),ee(null)},onClose:()=>ee(null)}),xe&&t.jsx("div",{style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",background:"rgba(0,0,0,0.8)",backdropFilter:"blur(5px)",zIndex:1e4,display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>ke(null),children:t.jsxs(ye.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},onClick:W=>W.stopPropagation(),className:"glass-panel",style:{padding:"30px",borderRadius:"30px",display:"flex",flexDirection:"column",alignItems:"center",gap:"20px",minWidth:"300px",border:"1px solid var(--primary)"},children:[t.jsx("div",{style:{width:"80px",height:"80px",borderRadius:"40px",overflow:"hidden",border:"2px solid var(--primary)"},children:t.jsx("img",{src:xe.photo,style:{width:"100%",height:"100%",objectFit:"cover"}})}),t.jsxs("div",{style:{textAlign:"center"},children:[t.jsx("h3",{style:{margin:0,color:"white"},children:xe.name}),t.jsx("p",{style:{margin:"5px 0 0",color:"var(--primary)",fontSize:"0.9rem",fontStyle:"italic"},children:"Bio Vocale"})]}),t.jsx(Sd,{audioUrl:xe.voice_bio_url,color:"var(--primary)"}),t.jsx("button",{onClick:()=>ke(null),style:{marginTop:"10px",background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:"0.9rem",textDecoration:"underline"},children:"Fermer"})]})}),V&&N&&t.jsx(u5,{receiverId:N.id,receiverName:N.name,onClose:()=>{H(!1),Z(null)},onSuccess:W=>{cc({particleCount:100,spread:70,origin:{y:.6},zIndex:1e4}),Ae(se=>se+1),X({message:`Vous avez offert ${W.name} à ${N.name} ! Il/Elle sera notifié(e) instantanément.`,type:"success"}),H(!1)}}),ae&&t.jsx(TS,{message:ae.message,type:ae.type,onClose:()=>X(null)}),ze&&t.jsx("div",{style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",background:"rgba(0,0,0,0.85)",backdropFilter:"blur(15px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",animation:"fadeIn 0.5s"},children:t.jsxs(ye.div,{initial:{scale:.9,opacity:0}
1187,animate:{scale:1,opacity:1},className:"glass-panel",style:{padding:"40px",borderRadius:"30px",maxWidth:"500px",width:"90%",textAlign:"center",border:`1px solid ${ze==="FRIEND"?"#26A69A":"#ff3333"}`,boxShadow:`0 0 50px ${ze==="FRIEND"?"rgba(38, 166, 154, 0.3)":"rgba(255, 51, 51, 0.3)"}`},children:[t.jsx("div",{style:{fontSize:"4rem",marginBottom:"20px"},children:ze==="FRIEND"?"ð¤":"ð¥"}),t.jsxs("h2",{style:{fontSize:"2rem",marginBottom:"15px",background:ze==="FRIEND"?"linear-gradient(135deg, #26A69A, #80CBC4)":"linear-gradient(135deg, #ff3333, #800000)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:["Bienvenue dans l'espace ",ze==="FRIEND"?"Friend":"Erox"]}),t.jsxs("p",{style:{color:"var(--text-muted)",fontSize:"1.1rem",marginBottom:"30px",lineHeight:"1.6"},children:["Pour profiter pleinement de cette expérience, nous avons besoin de connaître vos ",ze==="FRIEND"?"centres d'intérêts":"désirs",".",t.jsx("br",{}),"Cela ne prendra qu'une minute."]}),t.jsxs("button",{onClick:()=>r("/edit-criteria"),className:"btn-primary",style:{width:"100%",padding:"15px",fontSize:"1.1rem",background:ze==="FRIEND"?"linear-gradient(135deg, #26A69A, #00695C)":"linear-gradient(135deg, #ff3333, #550000)",color:"white",border:"none",boxShadow:"none"},children:["Configurer mon profil ",ze==="FRIEND"?"Social":"Erox"," ",t.jsx(Pr,{size:20,style:{marginLeft:"10px"}})]})]})}),Ue&&(re||fe[Fe])&&(()=>{const W=re||fe[Fe],se=[W.photo,...W.photos||[]].filter(Boolean),we=Bn,ge=we>0,oe=we<se.length-1,ie=Oe=>({position:"absolute",top:"50%",transform:"translateY(-50%)",[Oe==="prev"?"left":"right"]:"24px",background:"rgba(255,255,255,0.12)",border:"none",borderRadius:"50%",width:"52px",height:"52px",display:"flex",alignItems:"center",justifyContent:"center",color:"white",cursor:"pointer",fontSize:"1.5rem",backdropFilter:"blur(10px)",transition:"all 0.2s",zIndex:10001});return t.jsxs("div",{onClick:()=>St(null),style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.95)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",cursor:"zoom-out",padding:"20px"},children:[t.jsx("button",{onClick:()=>St(null),style:{position:"absolute",top:"20px",right:"20px",background:"rgba(255,255,255,0.1)",border:"none",borderRadius:"50%",width:"50px",height:"50px",display:"flex",alignItems:"center",justifyContent:"center",color:"white",cursor:"pointer",zIndex:10001},children:t.jsx(mt,{size:28})}),ge&&t.jsx("button",{onClick:Oe=>{Oe.stopPropagation();const Ve=we-1;Ti(Ve),St(se[Ve])},style:ie("prev"),onMouseEnter:Oe=>{Oe.currentTarget.style.background="rgba(255,255,255,0.25)",Oe.currentTarget.style.transform="translateY(-50%) scale(1.1)"},onMouseLeave:Oe=>{Oe.currentTarget.style.background="rgba(255,255,255,0.12)",Oe.currentTarget.style.transform="translateY(-50%) scale(1)"},children:"â¹"}),t.jsx("img",{src:se[we],alt:"Photo agrandie",style:{maxWidth:"90vw",maxHeight:"85vh",borderRadius:"15px",objectFit:"contain",boxShadow:"0 20px 60px rgba(0,0,0,0.5)"},onClick:Oe=>Oe.stopPropagation()}),oe&&t.jsx("button",{onClick:Oe=>{Oe.stopPropagation();const Ve=we+1;Ti(Ve),St(se[Ve])},style:ie("next"),onMouseEnter:Oe=>{Oe.currentTarget.style.background="rgba(255,255,255,0.25)",Oe.currentTarget.style.transform="translateY(-50%) scale(1.1)"},onMouseLeave:Oe=>{Oe.currentTarget.style.background="rgba(255,255,255,0.12)",Oe.currentTarget.style.transform="translateY(-50%) scale(1)"},children:"âº"}),se.length>1&&t.jsxs("div",{style:{position:"absolute",bottom:"28px",left:"50%",transform:"translateX(-50%)",background:"rgba(0,0,0,0.6)",backdropFilter:"blur(10px)",padding:"6px 16px",borderRadius:"20px",color:"white",fontSize:"0.85rem",fontWeight:"600",zIndex:10001},children:[we+1," / ",se.length]})]})})()]})},Cp=({userId:e=null,onClose:r=null})=>{const{id:i}=Jj(),n=e||i,o=Lt(),{mode:a,isErox:l,isFriend:d}=dr(),p=xn(),{profile:u,user:g}=gr(),[h,x]=m.useState(null),[y,_]=m.useState(!0),[S,k]=m.useState(!1),[w,b]=m.useState(!1),[j,T]=m.useState(null),[P,I]=m.useState(!1),[R,O]=m.useState([]),[E,$]=m.useState(0),[B,ee]=m.useState(null),[te,K]=m.useState(!1),ne=u,[Re,Q]=m.useState([]),[G,le]=m.useState([]),[F,A]=m.useState(0);m.useEffect(()=>{n&&(async()=>{var he,Ae,ze,ue;if(g&&n===g.id&&u)x(u),_(!1);else try{const{data:xe,error:ke}=await D.from("profiles").select("*").eq("id",n).single();if(ke||!xe){const{data:Pe,error:Ce}=await D.from("matches").select("*").eq("id",n).single();if(Ce||!Pe)throw ke||Ce;const Me=(Pe.space||"eros").toLowerCase(),Le=Pe[`photos_${Me}`]||[],rt=Pe.photo_url||Le[0]||null;
1187x({...Pe,avatar_url:rt,photo:rt,photos:Le,erox_photos:Pe.photos_erox||[],friend_photos:Pe.photos_friend||[],erox_avatar_url:((he=Pe.photos_erox)==null?void 0:he[0])||rt,friend_avatar_url:((Ae=Pe.photos_friend)==null?void 0:Ae[0])||rt,location:Pe.city||Pe.location,is_bot:!0})}else x(xe);if(g){const{data:Pe}=await D.from("likes").select("id").eq("sender_id",g.id).eq("receiver_id",n);b(Pe&&Pe.length>0);const Ce=`viewed_profile_${n}`;n!==g.id&&!sessionStorage.getItem(Ce)&&(sessionStorage.setItem(Ce,"true"),D.rpc("track_profile_view",{target_id:n}).then(()=>console.log("Profile view tracked")).catch(Me=>console.warn("Profile view tracking failed:",Me.message)))}}catch(xe){console.error("Error loading profile:",xe)}finally{_(!1)}try{const{data:xe}=await D.from("events").select("*").eq("creator_id",n).gte("date",new Date().toISOString()).order("date",{ascending:!0}),{data:ke}=await D.from("event_participants").select("event:events(*)").eq("user_id",n).eq("status","approved"),Pe=(ke==null?void 0:ke.map(Me=>Me.event).filter(Me=>Me&&new Date(Me.date)>=new Date))||[],Ce=[...xe||[],...Pe].filter((Me,Le,rt)=>Le===rt.findIndex(Fe=>Fe.id===Me.id)).sort((Me,Le)=>new Date(Me.date)-new Date(Le.date));Q(Ce)}catch(xe){console.error("Error fetching user events:",xe)}try{const{data:xe}=await D.from("event_ratings").select("id, rating, comment, created_at, user_id, event_id, event:events!event_id(id, title)").eq("organizer_id",n).order("created_at",{ascending:!1}),{data:ke}=await D.from("entraide_ratings").select("id, stars, comment, created_at, rater_id, service_id, service:entraide_services!service_id(id, title)").eq("rated_id",n).order("created_at",{ascending:!1}),Pe=[];if(xe)for(const Ce of xe)Pe.push({id:Ce.id,rating:Ce.rating,comment:Ce.comment,created_at:Ce.created_at,user_id:Ce.user_id,context_label:((ze=Ce.event)==null?void 0:ze.title)||null,context_type:"event"});if(ke)for(const Ce of ke)Pe.push({id:Ce.id,rating:Ce.stars,comment:Ce.comment,created_at:Ce.created_at,user_id:Ce.rater_id,context_label:((ue=Ce.service)==null?void 0:ue.title)||null,context_type:"entraide"});if(Pe.sort((Ce,Me)=>new Date(Me.created_at)-new Date(Ce.created_at)),Pe.length>0){const Ce=[...new Set(Pe.map(Fe=>Fe.user_id).filter(Boolean))],{data:Me}=await D.from("profiles").select("id, name, avatar_url, photo").in("id",Ce),Le=Pe.map(Fe=>({...Fe,user:Me==null?void 0:Me.find(ft=>ft.id===Fe.user_id)}));le(Le);const rt=Le.reduce((Fe,ft)=>Fe+ft.rating,0)/Le.length;A(rt)}}catch(xe){console.warn("Organizer ratings fetch failed:",xe)}})(),n&&g&&n===g.id&&wi.getReceivedGifts(g.id).then(O)},[n,g]);const M={seek_kids_yes:["parent"],seek_kids_no:["noparent"],seek_kids_any:["parent","noparent"],seek_man:["male"],seek_woman:["female"],seek_single:["single"],seek_couple:["couple"],seek_mentor:["exp_expert"],seek_teaching:["exp_novice","exp_intermediate"],seek_discovery:["exp_novice","exp_intermediate","exp_expert"],seek_discrete:["vibe_discrete","seek_discrete"],seek_alchemy:["vibe_open","vibe_epicurean"],seek_fun:["vibe_epicurean","vibe_open"],seek_mobile:["seek_mobile"],seek_hosted:["seek_hosted"],seek_any_body:["slim","average","athletic","curvy","bbw"],seek_any_age:["young","mid20","mid30","mature"]},H=(()=>
1187{if(!h||!ne)return{total:0,details:{}};const X=l?So:d?il:Fn,he=l?"erox_tags":d?"friend_tags":"tags";let Ae=0,ze=0,ue={};return X.forEach(xe=>{const ke=Array.isArray(ne[he])?ne[he]:[],Pe=Array.isArray(h[he])?h[he]:[],Ce=xe.items.map(Be=>Be.id),Me=ke.filter(Be=>Ce.includes(Be));let Le=0,rt=[],Fe=Pe.filter(Be=>Ce.includes(Be));if(xe.id==="iseek"||xe.id==="iseek_erox"){if(Me.length>0){let Be=0,re=0;Me.forEach(He=>{if(He.startsWith("dist_")||He.startsWith("age_")||He.startsWith("seek_age_"))return;re++;const be=M[He];be?be.some(J=>!!(Pe.includes(J)||J==="male"&&h.gender==="male"||J==="female"&&h.gender==="female"))&&Be++:re--}),Le=re>0?Math.round(Be/re*100):0,rt=[]}}else{const Be=Pe.filter(re=>Ce.includes(re));if(Me.length>0){const re=Me.filter(He=>Be.includes(He));Le=Math.round(re.length/Me.length*100),rt=xe.items.filter(He=>re.includes(He.id))}Fe=Be}const De=xe.items.filter(Be=>Fe.includes(Be.id));Me.length>0&&(ue[xe.id]={score:Le,commonItems:rt,matchItems:De},Ae+=Le,ze++)}),{total:ze>0?Math.round(Ae/ze):0,details:ue}})(),N=async()=>{const X=!w;X?Uo():mr(),b(X);const he=JSON.parse(localStorage.getItem("favoriteMatches")||"[]");let Ae;if(X?Ae=[...he,n]:Ae=he.filter(ze=>ze!==n),localStorage.setItem("favoriteMatches",JSON.stringify(Ae)),ne){const ze=await gx(ne.id,n);ze&&ze.isMatch&&h&&Wr(async()=>{const{sendMatchNotification:ue}=await Promise.resolve().then(()=>na);return{sendMatchNotification:ue}},void 0).then(({sendMatchNotification:ue})=>{ue(n,h.name,h.photo,a).catch(console.error)})}};if(y)return t.jsx("div",{className:"flex items-center justify-center h-screen bg-black text-white",children:"Chargement du profil..."});if(!h)return t.jsx("div",{className:"flex items-center justify-center h-screen bg-black text-white",children:"Profil introuvable."});const Z=l?So:d?il:Fn,ae=l?"erox_tags":d?"friend_tags":"tags";return Array.isArray(h[ae])&&h[ae],t.jsxs("div",{style:{background:d?"linear-gradient(180deg, #0A0F1C 0%, #151B2E 100%)":"var(--bg-dark)",minHeight:"100vh",color:"white",fontFamily:"Outfit, sans-serif"},children:[t.jsxs("div",{style:{position:r?"sticky":"fixed",top:0,left:0,right:0,paddingTop:"calc(env(safe-area-inset-top, 0px) + 70px)",paddingLeft:"20px",paddingRight:"20px",paddingBottom:"20px",display:"flex",justifyContent:"space-between",zIndex:1050,background:"linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0) 100%)",pointerEvents:"none"},children:[t.jsx("button",{onClick:()=>r?r():o(-1),style:{pointerEvents:"auto",background:"rgba(0,0,0,0.5)",border:"none",borderRadius:"50%",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",color:"white",cursor:"pointer",backdropFilter:"blur(5px)"},children:r?t.jsx(mt,{size:20}):t.jsx(Hr,{size:20})}),t.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center"},children:[h.voice_bio_url&&t.jsx("button",{onClick:()=>K(X=>!X),style:{pointerEvents:"auto",background:te?"rgba(168,85,247,0.6)":"rgba(0,0,0,0.5)",border:te?"2px solid #a855f7":"none",borderRadius:"50%",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",color:"white",cursor:"pointer",backdropFilter:"blur(5px)",transition:"all 0.2s",boxShadow:te?"0 0 12px rgba(168,85,247,0.4)":"none"},title:"Bio vocale",children:t.jsx(ls,{size:18})}),t.jsx("button",{style:{pointerEvents:"auto",background:"rgba(0,0,0,0.5)",border:"none",borderRadius:"50%",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",color:"white",cursor:"pointer",backdropFilter:"blur(5px)"},children:t.jsx(u0,{size:20})}),ne&&h&&ne.id!==h.id&&t.jsx(IS,{currentUserId:ne.id,targetUserId:h.id,onBlock:()=>o("/home"),style:{background:"rgba(0,0,0,0.5)",borderRadius:"50%",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:"blur(5px)"}})]})]}),te&&h.voice_bio_url&&t.jsxs("div",{style:{position:"fixed",top:"75px",right:"20px",zIndex:100,background:"rgba(15,10,30,0.9)",backdropFilter:"blur(20px)",borderRadius:"16px",padding:"12px 16px",border:"1px solid rgba(168,85,247,0.3)",boxShadow:"0 8px 32px rgba(168,85,247,0.2)",display:"flex",alignItems:"center",gap:"12px",animation:"fadeInDown 0.3s ease"},children:[t.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"50%",background:"linear-gradient(135deg, #a85
11875f7, #8b5cf6)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t.jsx(ls,{size:14,color:"white"})}),t.jsxs("div",{children:[t.jsx("span",{style:{display:"block",fontSize:"0.7rem",color:"rgba(255,255,255,0.5)",marginBottom:"4px"},children:"Bio Vocale"}),t.jsx(Sd,{audioUrl:h.voice_bio_url,color:"#a855f7"})]}),t.jsx("button",{onClick:()=>K(!1),style:{background:"none",border:"none",color:"rgba(255,255,255,0.4)",cursor:"pointer",padding:"4px"},children:t.jsx(mt,{size:14})})]}),t.jsxs("div",{style:{height:p?"60vh":"70vh",paddingTop:"0",position:"relative",overflow:"visible",zIndex:10},children:[h.animated_photo_url?t.jsxs(t.Fragment,{children:[t.jsx("video",{src:h.animated_photo_url,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,style:{width:"100%",height:"100%",objectFit:"cover",maskImage:"linear-gradient(to bottom, black 80%, transparent 100%)"}}),t.jsx("div",{style:{position:"absolute",top:"70px",right:"20px",zIndex:25,background:"linear-gradient(135deg, #8b5cf6, #ec4899)",padding:"5px 12px",borderRadius:"20px",fontSize:"0.7rem",fontWeight:700,color:"white",display:"flex",alignItems:"center",gap:"5px",boxShadow:"0 4px 15px rgba(139,92,246,0.4)"},children:"⨠Photo Animée"})]}):t.jsx("img",{src:l?h.erox_avatar_url||h.avatar_url||h.photo||null:d?h.friend_avatar_url||h.avatar_url||h.photo||null:h.avatar_url||h.photo||null,alt:h.name,style:{width:"100%",height:"100%",objectFit:"cover",maskImage:"linear-gradient(to bottom, black 80%, transparent 100%)"}}),t.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(0deg, var(--bg-dark) 5%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.4) 100%)"}}),t.jsxs("div",{style:{position:"absolute",bottom:"20px",left:"25px",right:"25px",zIndex:20},children:[t.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"12px",flexWrap:"wrap"},children:[t.jsxs("h1",{style:{fontSize:p?"2rem":"3rem",fontWeight:800,margin:0,textShadow:"0 2px 10px rgba(0,0,0,0.5)",display:"flex",alignItems:"center",gap:"10px"},children:[h.name,h.verification_status==="verified"&&t.jsx(fi,{size:p?22:32,fill:"#26A69A",color:"#103030"})]}),t.jsx("span",{style:{fontSize:p?"1.3rem":"1.8rem",fontWeight:300,opacity:.85},children:h.age})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"10px",flexWrap:"wrap"},children:[t.jsxs("div",{style:{background:"var(--gradient-gold)",color:"black",padding:"5px 14px",borderRadius:"20px",fontWeight:"bold",fontSize:p?"0.85rem":"0.95rem",boxShadow:"0 4px 15px rgba(255, 215, 0, 0.3)"},children:[H.total,"% Compatible"]}),G.length>0&&t.jsxs("div",{style:{background:"rgba(0,0,0,0.5)",backdropFilter:"blur(8px)",padding:"5px 12px",borderRadius:"20px",border:"1px solid rgba(255,215,0,0.2)",display:"flex",alignItems:"center",gap:"5px",fontSize:p?"0.8rem":"0.88rem",fontWeight:"700"},children:[t.jsx(nr,{size:14,fill:"#FFD700",color:"#FFD700"}),t.jsx("span",{style:{color:"#FFD700"},children:F.toFixed(1)}),t.jsxs("span",{style:{color:"rgba(255,255,255,0.4)",fontSize:"0.72rem",fontWeight:"400"},children:["orga · ",G.length," avis"]})]}),ne&&ne.id!==h.id&&t.jsxs("button",{onClick:()=>I(!0),className:"btn-glass",style:{background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.15)",color:"white",padding:"5px 14px",borderRadius:"20px",display:"flex",alignItems:"center",gap:"6px",backdropFilter:"blur(5px)",cursor:"pointer",fontSize:p?"0.8rem":"0.9rem",fontWeight:"600"},children:[t.jsx(Li,{size:16}),"Offrir un Cadeau"]})]}),t.jsxs("div",{style:{display:"flex",gap:"14px",marginTop:"10px",fontSize:"0.95rem",opacity:.85},children:[h.job&&t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(Qn,{size:16})," ",h.job]}),h.location&&t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(ur,{size:16})," ",typeof h.location=="object"?h.location.city:h.location,h.dist_km||h.distance_km?` (${Math.round(h.dist_km||h.distance_km)} km)`:""]}),h.height&&t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx($A,{size:16})," ",h.height," cm"]})]})]})]}),j&&t.jsx("div",{onClick:()=>T(null),style:{position:"fixed",inset:0,zIndex:9999,background:"rgba(0,0,0,0.85)",backdropFilter:"blur(16px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:p?"24px 16px":"40px"},children:t.jsxs("div",{onClick:X=>X.stopPropagation(),style:{position:"relative",maxWidth:p?"82vw":"80vw",maxHeight:p?"5
11875vh":"80vh",borderRadius:"20px",overflow:"hidden",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.12)",boxShadow:"0 8px 60px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1)",backdropFilter:"blur(20px)"},children:[t.jsx("button",{onClick:()=>T(null),style:{position:"absolute",top:"10px",right:"10px",zIndex:1e4,background:"rgba(0,0,0,0.5)",border:"1px solid rgba(255,255,255,0.25)",borderRadius:"50%",width:"36px",height:"36px",color:"white",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:"1.1rem",fontWeight:"800",backdropFilter:"blur(8px)"},children:"â"}),t.jsx("img",{src:j,alt:"Zoom",style:{width:"100%",height:"100%",maxHeight:p?"53vh":"78vh",objectFit:"contain",display:"block"}})]})}),t.jsxs("div",{style:{padding:p?"10px 18px 20px":"10px 40px 20px",maxWidth:"1000px",margin:"-10px auto 0",display:"flex",flexDirection:"column",gap:"28px",position:"relative",zIndex:11},children:[t.jsx("div",{className:"animate-fade-in-up",style:{animationDelay:"0.1s"},children:t.jsx(Rh,{sections:Z,details:H.details,match:h,targetTags:ae})}),(()=>{const X=[];if(h.is_bot){const Ae=l?h.erox_photos||h.photos_erox:d?h.friend_photos||h.photos_friend:h.photos||h.photos_eros;Array.isArray(Ae)&&Ae.forEach(ze=>{ze&&!X.includes(ze)&&X.push(ze)})}else[h.photo_1,h.photo_2,h.photo_3].forEach(Ae=>{Ae&&!X.includes(Ae)&&X.push(Ae)});const he=l?h.erox_avatar_url||h.avatar_url:d?h.friend_avatar_url||h.avatar_url:h.avatar_url||h.photo;return he&&!X.includes(he)&&X.unshift(he),X.length<=1?null:t.jsxs("div",{className:"animate-fade-in-up",style:{animationDelay:"0.12s"},children:[t.jsxs("h3",{style:{fontSize:"0.78rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"1.5px",margin:"0 0 14px",display:"flex",alignItems:"center",gap:"8px"},children:["ð¸ Photos",t.jsx("span",{style:{background:"rgba(255,215,0,0.1)",color:"#FFD700",padding:"2px 10px",borderRadius:"10px",fontSize:"0.72rem",fontWeight:"700"},children:X.length})]}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:p?"repeat(3, 1fr)":"repeat(4, 1fr)",gap:"10px"},children:X.map((Ae,ze)=>t.jsx("div",{onClick:()=>T(Ae),style:{aspectRatio:"1",borderRadius:"14px",overflow:"hidden",cursor:"pointer",border:"1px solid rgba(255,255,255,0.08)",transition:"all 0.25s",position:"relative"},onMouseEnter:ue=>{ue.currentTarget.style.transform="scale(1.03)",ue.currentTarget.style.borderColor="rgba(255,215,0,0.3)"},onMouseLeave:ue=>{ue.currentTarget.style.transform="scale(1)",ue.currentTarget.style.borderColor="rgba(255,255,255,0.08)"},children:t.jsx("img",{src:Ae,alt:`Photo ${ze+1}`,style:{width:"100%",height:"100%",objectFit:"cover"},loading:"lazy"})},ze))})]})})(),t.jsxs("div",{className:"animate-fade-in-up",style:{animationDelay:"0.15s",background:"rgba(255,255,255,0.03)",backdropFilter:"blur(20px)",padding:p?"18px":"24px",borderRadius:"20px",border:"1px solid rgba(255,255,255,0.06)",position:"relative",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"2px",background:"linear-gradient(90deg, transparent, var(--gold, #FFD700), transparent)",opacity:.4}}),t.jsx("h3",{style:{fontSize:"0.78rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"1.5px",margin:"0 0 14px",display:"flex",alignItems:"center",gap:"8px"},children:"ð¬ à propos"}),t.jsx("p",{style:{fontSize:p?"1rem":"1.15rem",lineHeight:"1.7",color:"rgba(255,255,255,0.88)",whiteSpace:"pre-line",margin:0},children:h.bio||"Cet utilisateur n'a pas encore renseigné sa description."}),h.voice_bio_url&&t.jsxs("div",{style:{marginTop:"16px",padding:"14px 18px",background:"linear-gradient(135deg, rgba(138,43,226,0.1), rgba(138,43,226,0.03))",borderRadius:"16px",display:"flex",alignItems:"center",gap:"14px",border:"1px solid rgba(138,43,226,0.2)",cursor:"pointer",transition:"all 0.25s"},children:[t.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"50%",background:"linear-gradient(135deg, #8a2be2, #E91E63)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,boxShadow:"0 4px 12px rgba(138,43,226,0.3)"},children:t.jsx(ls,{size:18,color:"white"})}),t.jsxs("div",{style:{flex:1},children:[t.jsx("span",{style:{display:"block",fontSize:"0.85rem",color:"white",fontWeight:"600",marginBottom:"4px"},children:"Bio Vocale"}),t.jsx(Sd,{audioUrl:h.voice_bio_url})]})]})]}),t.jsxs("div",{className:"animate-fade-in-up",style:{animationDelay:"0.2s",background:"linear-gradient(135deg, rgba(255,215,0,0.04), rgba(255,180,0,0.02))",backdropFilter:"blur(20px)",padding:p?"18px":"24px",borderRadius:"20px",border:"1px solid rgba(255,215,0,0.12)",position:"relative",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"2px",background:"linear-gradient(90deg, transparent, #FFD700, transparent)",opacity:.5}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"18px",flexWrap:"wrap",gap:"10px"},children:[t.jsx("h3",{style:{fontSize:"0.78rem",color:"#FFD700",textTransform:"uppercase",letterSpacing:"1.5px",margin:0,display:"flex",alignItems:"center",gap:"8px"},children:"â Avis Organisateur"}),t.jsx("div",{style:{background:G.length>0?"rgba(255,215,0,0.1)":"rgba(255,255,255,0.06)",padding:"6px 14px",borderRadius:"12px",border:`1px solid ${G.length>0?"rgba(255,215,0,0.2)":"rgba(255,255,255,0.1)"}`,display:"flex",alignItems:"center",gap:"8px"},children:G.length>0?t.jsxs(t.Fragment,{children:[t.jsx("span",{style:{fontSize:"1.1rem",fontWeight:"800",color:"#FFD700"},children:F.toFixed(1)}),t.jsx("span",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.4)"},children:"/ 5"})]}):t.jsx("span",{style:{fontSize:"0.8rem",fontWeight:"600",color:"rgba(255,215,0,0.6)"},children:"Nouveau"})})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginBottom:G.length>0?"18px":"0"},children:[Array.from({length:5},(X,he)=>t.jsx(nr,{size:22,fill:G.length>0&&he<Math.round(F)?"#FFD700":"transparent",color:G.length>0&&he<Math.round(F)?"#FFD700":"rgba(255,255,255,0.15)"},he)),t.jsx("span",{style:{fontSize:"0.88rem",color:"rgba(255,255,255,0.5)",marginLeft:"10px"},children:G.length>0?`${G.length} avis`:"Pas encore d'avis"})]}),G.length>0&&t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:G.slice(0,6).map(X=>{var he,Ae,ze;return t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",padding:"16px",borderRadius:"16px",border:"1px solid rgba(255,255,255,0.05)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:X.comment?"10px":0},children:[t.jsx("img",{src:((he=X.user)==null?void 0:he.avatar_url)||((Ae=X.user)==null?void 0:Ae.photo)||"https://via.placeholder.com/36",alt:"",style:{width:"38px",height:"38px",borderRadius:"50%",objectFit:"cover",flexShrink:0,border:"2px s
1187olid rgba(255,255,255,0.08)"}}),t.jsxs("div",{style:{flex:1},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginBottom:"3px",flexWrap:"wrap"},children:[t.jsx("span",{style:{fontSize:"0.9rem",fontWeight:"600",color:"rgba(255,255,255,0.85)"},children:((ze=X.user)==null?void 0:ze.name)||"Anonyme"}),X.context_label&&t.jsxs("span",{style:{fontSize:"0.68rem",fontWeight:"600",color:X.context_type==="entraide"?"#4DD0E1":"#c084fc",background:X.context_type==="entraide"?"rgba(38,166,154,0.12)":"rgba(139,92,246,0.12)",padding:"1px 8px",borderRadius:"8px",border:`1px solid ${X.context_type==="entraide"?"rgba(38,166,154,0.25)":"rgba(139,92,246,0.25)"}`,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"160px"},children:[X.context_type==="entraide"?"ð¤":"ð"," ",X.context_label]})]}),t.jsx("div",{style:{display:"flex",alignItems:"center",gap:"3px"},children:Array.from({length:5},(ue,xe)=>t.jsx(nr,{size:12,fill:xe<X.rating?"#FFD700":"transparent",color:xe<X.rating?"#FFD700":"rgba(255,255,255,0.15)"},xe))})]}),t.jsx("span",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.25)"},children:new Date(X.created_at).toLocaleDateString("fr-FR",{day:"numeric",month:"short"})})]}),X.comment&&t.jsxs("p",{style:{margin:0,fontSize:"0.9rem",color:"rgba(255,255,255,0.55)",lineHeight:"1.6",fontStyle:"italic",paddingLeft:"50px"}
1187,children:['"',X.comment,'"']})]},X.id)})})]}),t.jsxs("div",{className:"animate-fade-in-up",style:{animationDelay:"0.25s"},children:[t.jsxs("h3",{style:{fontSize:"0.78rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"1.5px",margin:"0 0 14px",display:"flex",alignItems:"center",gap:"8px"},children:["ð Ãvénements",Re.length>0&&t.jsx("span",{style:{background:"rgba(255,215,0,0.1)",color:"#FFD700",padding:"2px 10px",borderRadius:"10px",fontSize:"0.72rem",fontWeight:"700"},children:Re.length})]}),Re.length>0?t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:Re.map(X=>{const he=X.creator_id===n,Ae=(X.mode||"eros").toUpperCase(),ze=Ae==="EROX"?"#ff3333":"#FFD700",ue=new Date(X.date),xe=ue.toLocaleString("fr-FR",{hour:"2-digit",minute:"2-digit"});return t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",backdropFilter:"blur(12px)",borderRadius:"16px",padding:"14px",border:"1px solid rgba(255,255,255,0.06)",display:"flex",gap:"12px",alignItems:"center",cursor:"pointer",transition:"all 0.25s",borderLeft:`3px solid ${ze}`},onClick:()=>o("/events?rate="+X.id),onMouseEnter:ke=>{ke.currentTarget.style.background="rgba(255,255,255,0.06)",ke.currentTarget.style.transform="translateX(4px)"},onMouseLeave:ke=>{ke.currentTarget.style.background="rgba(255,255,255,0.03)",ke.currentTarget.style.transform="translateX(0)"},children:[t.jsx("div",{style:{width:"56px",height:"56px",borderRadius:"14px",overflow:"hidden",flexShrink:0,background:X.image_url?"transparent":"linear-gradient(135deg, rgba(255,215,0,0.12), rgba(255,215,0,0.04))",border:"1px solid rgba(255,255,255,0.08)",position:"relative"},children:X.image_url?t.jsx("img",{src:X.image_url,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}}):t.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[t.jsx("span",{style:{fontSize:"1.15rem",fontWeight:"bold",lineHeight:"1",color:ze},children:ue.getDate()}),t.jsx("span",{style:{fontSize:"0.55rem",textTransform:"uppercase",color:`${ze}99`,fontWeight:"bold"},children:ue.toLocaleString("fr-FR",{month:"short"}).replace(".","")})]})}),t.jsxs("div",{style:{flex:1,overflow:"hidden",minWidth:0},children:[t.jsx("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginBottom:"3px"},children:t.jsx("h4",{style:{margin:0,fontSize:"0.95rem",fontWeight:"600",color:"white",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:X.title})}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"3px",color:"var(--text-muted)",fontSize:"0.75rem"},children:[t.jsx(cr,{size:11})," ",ue.toLocaleDateString("fr-FR",{day:"numeric",month:"short"})," · ",xe]}),X.location&&t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"3px",color:"var(--text-muted)",fontSize:"0.75rem"},children:[t.jsx(ur,{size:11})," ",X.location]})]})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",flexShrink:0},children:[t.jsx("div",{style:{padding:"3px 10px",borderRadius:"10px",background:he?"rgba(255,215,0,0.12)":"rgba(100,200,255,0.1)",border:`1px solid ${he?"rgba(255,215,0,0.25)":"rgba(100,200,255,0.2)"}`,fontSize:"0.65rem",fontWeight:"700",color:he?"#FFD700":"#64C8FF",textTransform:"uppercase",letterSpacing:"0.5px",whiteSpace:"nowrap"},children:he?"ð Organise":"ð« Participe"}),t.jsx("span",{style:{fontSize:"0.6rem",color:`${ze}88`,fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px"},children:Ae})]})]},X.id)})}):t.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic",fontSize:"0.95rem"},children:"Aucun événement prévu pour le moment."})]}),h.prompts&&Array.isArray(h.prompts)&&h.prompts.length>0&&t.jsxs("div",{className:"animate-fade-in-up",style:{animationDelay:"0.3s"},children:[t.jsx("h3",{style:{fontSize:"0.78rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"1.5px",margin:"0 0 14px",display:"flex",alignItems:"center",gap:"8px"},children:"ð¯ En savoir plus"}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:p?"1fr":"1fr 1fr",gap:p?"10px":"14px"},children:h.prompts.map((X,he)=>t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",backdropFilter:"blur(12px)",padding:p?"16px":"20px",borderRadius:"16px",borderLeft:"3px solid var(--gold, #FFD700)",border:"1px solid rgba(255,255,255,0.05)",borderLeftColor:"var(--gold, #FFD700)"},children:[t.jsx("span",{style:{display:"block",fontSize:"0.72rem",color:"var(--gold, #FFD700)",marginBottom:"8px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px"},children:X.question}),t.jsxs("p",{style:{fontSize:p?"0.95rem":"1.05rem",fontWeight:"500",margin:0,lineHeight:1.5,color:"rgba(255,255,255,0.9)"},children:['"',X.answer,'"']})]},he))})]}),t.jsx("div",{style:{padding:"0 0 20px"},children:t.jsx(R7,{userId:h.id,isErox:l,isFriend:d,refreshKey:E})}),!r&&t.jsx("div",{style:{height:p?"180px":"100px"}})]}),t.jsx("div",{style:{position:r?"sticky":"fixed",bottom:r?"0":p?"calc(env(safe-area-inset-bottom, 0px) + 72px)":"30px",left:r?"auto":"50%",transform:r?"none":"translateX(-50%)",background:"rgba(20, 20, 30, 0.95)",backdropFilter:"blur(20px)",padding:r?"12px 20px":p?"8px 16px":"10px 20px",borderRadius:r?"0":"50px",border:"1px solid rgba(255,255,255,0.1)",display:"flex",alignItems:"center",justifyContent:"center",gap:p?"14px":"20px",boxShadow:"0 10px 40px -10px rgba(0,0,0,0.5), 0 0 20px rgba(0,0,0,0.3)",zIndex:9999},children:ne&&ne.id===h.id?t.jsxs("button",{onClick:()=>o("/complete-profile"),className:"btn-primary",style:{height:p?"45px":"60px",padding:p?"0 20px":"0 40px",borderRadius:"30px",fontSize:p?"0.9rem":"1.1rem",fontWeight:"bold",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(Vo,{size:p?18:24})," Modifier mon profil"]}):t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:N,style:{width:p?"48px":"60px",height:p?"48px":"60px",borderRadius:"50%",border:"none",cursor:"pointer",background:w?"#ff4d4d":"rgba(255,255,255,0.1)",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)",transform:w?"scale(1.1)":"scale(1)"},children:t.jsx(Bt,{size:p?22:28,fill:w?"white":"none",color:w?"white":"#ff4d4d"})}),p&&t.jsx("button",{onClick:()=>I(!0),style:{width:"40px",height:"40px",borderRadius:"50%",border:"none",cursor:"pointer",background:"rgba(255,255,255,0.1)",display:"flex",alignItems:"center",justifyContent:"center",color:l?"#ff4d4d":d?"var(--primary)":"var(--gold)"},children:t.jsx(Li,{size:18})}),t.jsxs("button",{onClick:()=>k(!0),className:"btn-primary",style:{height:p?"48px":"60px",padding:p?"0 20px":"0 40px",borderRadius:"30px",fontSize:p?"0.95rem":"1.1rem",fontWeight:"bold",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(Qt,{size:p?20:24})," ",p?"":"Discussion"]})]})}),S&&t.jsx(ll,{match:h,onClose:()=>k(!1)}),P&&t.jsx(u5,{receiverId:h.id,receiverName:h.name,onClose:()=>I(!1),onSuccess:X=>{cc({particleCount:100,spread:70,origin:{y:.6},zIndex:1e4}),$(he=>he+1),ee({message:`Vous avez offert ${X.name} à ${h.name} ! Il/Elle sera notifié(e) instantanément.`,type:"success"}),I(!1)}}),B&&t.jsx(TS,{message:B.message,type:B.type,onClose:()=>ee(null)})]})},$7=({event:e,onClick:r})=>{const i=Lt(),{lightMode:n}=dr(),[o,a]=m.useState(0),[l,d]=m.useState([]),[p,u]=m.useState(0),[g,h]=m.useState(0),[x,y]=m.useState(null),_=new Date(e.date)<new Date;m.useEffect(()=>{(async()=>{const{count:R,error:O}=await D.from("event_participants").select("*",{count:"exact",head:!0}).eq("event_id",e.id).eq("status","approved");if(O||a(R||0),!e.requires_approval){const{data:E}=await D.from("event_participants").select("user_id, profiles(id, name, photo, avatar_url)").eq("event_id",e.id).eq("status","approved").limit(5);E&&d(E)}if(e.creator_id){const{data:E}=await D.from("event_ratings").select("rating").eq("organizer_id",e.creator_id);if(E&&E.length>0){const $=E.reduce((B,ee)=>B+ee.rating,0)/E.length;u($),h(E.length)}}})()},[e.id,e.requires_approval,e.creator_id]);
1187const S=new Date(e.date),k=S.getDate(),w=S.toLocaleString("fr-FR",{month:"short"}).toUpperCase().replace(".",""),b=S.toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"}),j=e.mode==="erox",T=j?"#ff4d6a":"#FFD700",P=j?"rgba(255,77,106,0.3)":"rgba(255,215,0,0.3)";try{return t.jsxs(t.Fragment,{children:[t.jsxs("div",{onClick:r,style:{borderRadius:"20px",overflow:"hidden",background:n?"rgba(255,255,255,0.85)":"rgba(255,255,255,0.06)",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)",border:n?"2px solid rgba(140,115,75,0.3)":`1px solid ${T}20`,transition:"all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1)",cursor:"pointer",position:"relative",boxShadow:n?"0 4px 16px rgba(120,100,60,0.1)":"0 8px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.04), inset 0 1px 0 rgba(255,255,255,0.06)"},onMouseOver:I=>{I.currentTarget.style.transform="translateY(-4px)",I.currentTarget.style.boxShadow=`0 16px 40px rgba(0,0,0,0.4), 0 0 20px ${P}`,I.currentTarget.style.borderColor=`${T}40`},onMouseOut:I=>{I.currentTarget.style.transform="translateY(0)",I.currentTarget.style.boxShadow="0 4px 20px rgba(0,0,0,0.15)",I.currentTarget.style.borderColor="rgba(255,255,255,0.08)"},children:[t.jsx("div",{style:{height:"2px",background:j?"linear-gradient(90deg, transparent, #ff4d6a, #ff6b8a, transparent)":"linear-gradient(90deg, transparent, #FFD700, #FFA000, transparent)",opacity:.6}}),t.jsxs("div",{style:{height:"90px",position:"relative"},children:[e.image_url?t.jsx("img",{src:e.image_url,alt:e.title,style:{width:"100%",height:"100%",objectFit:"cover"}}):t.jsxs("div",{style:{width:"100%",height:"100%",background:j?"linear-gradient(135deg, #1a0000, #4a0015 40%, #8b0025 70%, #2d0a1e)":"linear-gradient(135deg, #0d0d2b, #1a1040 40%, #2d1b4e 70%, #1a0d30)",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",top:"-20px",right:"-20px",width:"100px",height:"100px",borderRadius:"50%",background:`${T}10`,filter:"blur(20px)"}}),t.jsx("div",{style:{position:"absolute",bottom:"-15px",left:"-15px",width:"70px",height:"70px",borderRadius:"50%",background:"rgba(138,43,226,0.08)",filter:"blur(15px)"}}),t.jsx("span",{style:{fontSize:"2.2rem",filter:"drop-shadow(0 2px 8px rgba(0,0,0,0.3))"},children:j?"ð¥":"â¨"})]}),t.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:"50px",background:n?"linear-gradient(transparent, rgba(250,247,242,0.9))":"linear-gradient(transparent, rgba(15,15,25,0.9))"}}),t.jsx("div",{style:{position:"absolute",top:"10px",right:"10px",background:n?"rgba(250,247,242,0.85)":"rgba(0,0,0,0.5)",backdropFilter:"blur(12px)",padding:"4px 10px",borderRadius:"20px",fontSize:"0.7rem",fontWeight:"700",color:n?"#3D3528":"white",border:n?"1.5px solid rgba(140,115,75,0.25)":`1px solid ${T}30`,zIndex:5},children:j?"ð¥ EROX":"â¤ï¸ EROS"}),e.creator&&t.jsxs("div",{onClick:I=>{var R;I.stopPropagation(),y(((R=e.creator)==null?void 0:R.id)||e.creator_id)},style:{position:"absolute",top:"10px",left:"10px",display:"flex",alignItems:"center",gap:"6px",zIndex:5,cursor:"pointer",transition:"transform 0.2s",background:n?"rgba(250,247,242,0.85)":"rgba(0,0,0,0.5)",backdropFilter:"blur(12px)",borderRadius:"20px",padding:"3px 10px 3px 3px",border:n?"1.5px solid rgba(140,115,75,0.2)":"1px solid rgba(255,255,255,0.1)"},onMouseOver:I=>I.currentTarget.style.transform="scale(1.05)",onMouseOut:I=>I.currentTarget.style.transform="none",children:[t.jsx("div",{style:{width:"28px",height:"28px",borderRadius:"50%",overflow:"hidden",flexShrink:0},children:t.jsx(Mo,{photoUrl:e.creator.avatar_url||e.creator.photo||"https://via.placeholder.com/28",animatedUrl:e.creator.animated_photo_url,alt:e.creator.name,size:28,borderColor:"rgba(255,255,255,0.2)",borderWidth:1.5})}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0px"},children:[t.jsx("span",{style:{fontSize:"0.65rem",fontWeight:"600",color:n?"#3D3528":"white",whiteSpace:"nowrap",maxWidth:"80px",overflow:"hidden",textOverflow:"ellipsis"},children:e.creator.name||"Organisateur"}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1px"},children:[Array.from({length:5},(I,R)=>t.jsx(nr,{size:8,fill:R<Math.round(p)?"#FFD700":"transparent",color:R<Math.round(p)?"#FFD700":"rgba(255,255,255,0.2)"},R)),t.jsx("span",{style:{fontSize:"0.55rem",color:g>0?"#FFD700":"rgba(255,255,255,0.3)",fontWeight:"700",marginLeft:"2px"},children:g>0?p.toFixed(1):"New"})]})]})]}),t.jsxs("div",{style:{position:"absolute",bottom:"8px",left:"10px",display:"flex",gap:"6px",zIndex:5},children:[e.requires_approval&&t.jsxs("div",{style:{background:"rgba(211,47,47,0.85)",backdropFilter:"blur(8px)",color:"white",padding:"3px 8px",borderRadius:"10px",fontSize:"0.6rem",fontWeight:"700",letterSpacing:"0.5px",display:"flex",alignItems:"center",gap:"3px"},children:[t.jsx(fi,{size:9})," PRIVÃ"]}),_&&t.jsx("div",{style:{background:"rgba(100,100,100,0.85)",backdropFilter:"blur(8px)",color:"white",padding:"3px 8px",borderRadius:"10px",fontSize:"0.6rem",fontWeight:"700",letterSpacing:"0.5px"},children:"â TERMINÃ"}),e.max_participants>0&&o>=e.max_participants&&t.jsx("div",{style:{background:"rgba(255,77,77,0.2)",backdropFilter:"blur(8px)",color:"#ff4d4d",padding:"3px 8px",borderRadius:"10px",fontSize:"0.6rem",fontWeight:"700",letterSpacing:"0.5px",border:"1px solid rgba(255,77,77,0.3)"},children:"COMPLET"})]})]}),t.jsxs("div",{style:{padding:"14px 16px 12px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"flex-start",ga
1187p:"12px",marginBottom:"10px"},children:[t.jsxs("div",{style:{background:`${T}12`,border:`1px solid ${T}25`,borderRadius:"12px",padding:"6px 10px",textAlign:"center",flexShrink:0,minWidth:"44px"},children:[t.jsx("div",{style:{fontSize:"1.15rem",fontWeight:"800",lineHeight:1,color:n?"#3D3528":"white"},children:k}),t.jsx("div",{style:{fontSize:"0.6rem",fontWeight:"700",color:n?"#7B6840":T,letterSpacing:"0.5px",marginTop:"2px"},children:w})]}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsx("h3",{style:{margin:0,fontSize:"1rem",fontWeight:"700",lineHeight:1.25,color:n?"#2A2520":"white",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:e.title}),e.venue_name&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"0.75rem",color:n?"#6B5F50":"rgba(255,255,255,0.4)",marginTop:"3px"},children:[t.jsx(d0,{size:10}),t.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.venue_name})]})]})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginBottom:"10px",flexWrap:"wrap"},children:[t.jsxs("div",{style:{background:n?"rgba(140,115,75,0.06)":"rgba(255,255,255,0.1)",backdropFilter:"blur(8px)",padding:"4px 10px",borderRadius:"10px",border:n?"1.5px solid rgba(140,115,75,0.25)":"1px solid rgba(255,255,255,0.2)",fontSize:"0.72rem",color:n?"#3D3528":"rgba(255,255,255,0.7)",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(Pn,{size:10,color:T})," ",b]}),t.jsxs("div",{style:{background:n?"rgba(140,115,75,0.06)":"rgba(255,255,255,0.1)",backdropFilter:"blur(8px)",padding:"4px 10px",borderRadius:"10px",border:n?"1.5px solid rgba(140,115,75,0.25)":"1px solid rgba(255,255,255,0.2)",fontSize:"0.72rem",color:e.max_participants>0&&o>=e.max_participants?"#ff4d4d":n?"#3D3528":"rgba(255,255,255,0.7)",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(Ut,{size:10,color:T}),o,e.max_participants>0?`/${e.max_participants}`:""]}),e.location&&t.jsxs("div",{style:{background:n?"rgba(140,115,75,0.06)":"rgba(255,255,255,0.1)",backdropFilter:"blur(8px)",padding:"4px 10px",borderRadius:"10px",border:n?"1.5px solid rgba(140,115,75,0.25)":"1px solid rgba(255,255,255,0.2)",fontSize:"0.72rem",color:n?"#3D3528":"rgba(255,255,255,0.7)",display:"flex",alignItems:"center",gap:"4px",flex:1,minWidth:0},children:[t.jsx(ur,{size:10,color:T,style:{flexShrink:0}}),t.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.location})]})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[!e.requires_approval&&l.length>0?t.jsxs("div",{style:{display:"flex"},children:[l.slice(0,4).map((I,R)=>{var O,E,$;return t.jsx("div",{onClick:B=>{B.stopPropagation(),i(`/profile-view/${I.profiles.id}`)},style:{width:"30px",height:"30px",borderRadius:"50%",border:"2px solid rgba(20,20,30,0.9)",marginLeft:R>0?"-10px":"0",overflow:"hidden",cursor:"pointer",zIndex:5-R,background:"#333",transition:"transform 0.2s"},onMouseOver:B=>B.currentTarget.style.transform="translateY(-2px) scale(1.1)",onMouseOut:B=>B.currentTarget.style.transform="none",title:(O=I.profiles)==null?void 0:O.name,children:t.jsx("img",{src:((E=I.profiles)==null?void 0:E.avatar_url)||(($=I.profiles)==null?void 0:$.photo)||"https://via.placeholder.com/30",alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}})},R)}),o>4&&t.jsxs("div",{style:{width:"30px",height:"30px",borderRadius:"50%",background:"rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.6)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.65rem",fontWeight:"700",marginLeft:"-10px",zIndex:0,border:"2px solid rgba(20,20,30,0.9)"},children:["+",o-4]})]}):t.jsx("div",{}),e.tags&&e.tags.length>0&&t.jsx("div",{style:{display:"flex",gap:"4px"},children:e.tags.slice(0,3).map(I=>{const O=[...(Fn||[]).flatMap($=>$.items||[]),...(So||[]).flatMap($=>$.items||[]),...(a5||[]).flatMap($=>$.items||[]),...(l5||[]).flatMap($=>$.items||[])].find($=>$.id===I);if(!O)return null;const E=O.icon;return t.jsx("div",{style:{background:n?"rgba(140,115,75,0.08)":"rgba(255,255,255,0.12)",border:n?"1.5px solid rgba(140,115,75,0.25)":"1px solid rgba(255,255,255,0.25)",borderRadius:"8px",padding:"5px",display:"flex"},children:t.jsx(E,{size:11,color:n?"#6B5F50":"rgba(255,255,255,0.75)"})},I)})})]})]})]}),x&&t.jsx("div",{onClick:I=>{I.stopPropagation(),y(null)},style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.7)",backdropFilter:"blur(8px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",padding:"20px",animation:"fadeIn 0.2s ease-out"},children:t.jsxs("div",{onClick:I=>I.stopPropagation(),style:{width:"100%",maxWidth:"600px",maxHeight:"85vh",overflowY:"auto",borderRadius:"24px",background:"rgba(25,25,35,0.98)",border:"1px solid rgba(255,255,255,0.1)",boxShadow:"0 25px 60px rgba(0,0,0,0.6)",position:"relative"},className:"custom-scrollbar",children:[t.jsx("button",{onClick:I=>{I.stopPropagation(),y(null)},style:{position:"sticky",top:"12px",right:"12px",float:"right",zIndex:10,background:"rgba(255,255,255,0.1)",border:"none",borderRadius:"50%",width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"white",margin:"12px"},children:t.jsx(mt,{size:18})}),t.jsx(Cp,{userId:x,onClose:()=>y(null)})]})})]})}catch(I){return console.error("EventCard render error:",I),t.jsx("div",{style:{padding:"20px",color:"red"},children:"Error loading card"})}},c1=[{url:"https://images.unsplash.com/photo-1533174072545-7a4b6ad7a6c3?w=800&q=80",label:"Soirée"},{url:"https://images.unsplash.com/photo-1414235077428-338989a2e8c0?w=800&q=80",label:"Restaurant"},{url:"https://images.unsplash.com/photo-1551632436-cbf8dd35adfa?w=800&q=80",label:"Cocktail"},{url:"https://images.unsplash.com/photo-1470225620780-dba8ba36b745?w=800&q=80",label:"Musique"},{url:"https://images.unsplash.com/photo-1504674900247-0877df9cc836?w=800&q=80",label:"Cuisine"},{url:"https://images.unsplash.com/photo-1551882547-ff40c63fe5fa?w=800&q=80",label:"Hôtel"},{url:"https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=800&q=80",label:"Montagne"},{url:"https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=800&q=80",label:"Plage"},{url:"https://images.unsplash.com/photo-1543269865-cbf427effbad?w=800&q=80",label:"Amis"},{url:"https://images.unsplash.com/photo-1517457373958-b7bdd4587205?w=800&q=80",label:"Fête"},{url:"https://images.unsplash.com/photo-1571019613454-1cb2f99b2d8b?w=800&q=80",label:"Fitness"},{url:"https://images.unsplash.com/photo-1445116572660-236099ec97a0?w=800&q=80",label:"Café"}],W7=[{gradient:"linear-gradient(135deg, #667eea, #764ba2)",label:"Violet"},{gradient:"linear-gradient(135deg, #f093fb, #f5576c)",label:"Rose"},{gradient:"linear-gradient(135deg, #4facfe, #00f2fe)",label:"Azur"},{gradient:"linear-gradient(135deg, #43e97b, #38f9d7)",label:"Ãmeraude"},{gradient:"linear-gradient(135deg, #fa709a, #fee140)",label:"Sunset"},{gradient:"linear-gradient(135deg, #a18cd1, #fbc2eb)",label:"Pastel"},{gradient:"linear-gradient(135deg, #ff9a9e, #fecfef)",label:"Doux"},{gradient:"linear-gradient(135deg, #ffecd2, #fcb69f)",label:"Pêche"},{gradient:"linear-gradient(135deg, #0c3483, #a2b6df)",label:"Nuit"},{gradient:"linear-gradient(135deg, #e53935, #880e4f)",label:"Passion"},{gradient:"linear-gradient(135deg, #FFD700, #FFA000)",label:"Or"},{gradient:"linear-gradient(135deg, #1a1a2e, #2d1b4e)",label:"Mystère"}],p1=[{id:1,emoji:"ð",title:"Quoi ?"},{id:2,emoji:"ð
",title:"Quand ?"},{id:3,emoji:"ð",title:"Où ?"},{id:4,emoji:"âï¸",title:"Détails"}],N7=[{id:"eros",label:"MEETapps Eros",icon:Bt,color:"#C5A065",gradient:"linear-gradient(135deg, #C5A065, #B8A88C)"}
1187,{id:"friend",label:"MEETapps Friend",icon:Ut,color:"#26A69A",gradient:"linear-gradient(135deg, #26A69A, #1a7a70)"},{id:"erox",label:"MEETapps Erox",icon:en,color:"#ff3333",gradient:"linear-gradient(135deg, #ff3333, #cc0000)"}],U7=({onClose:e,onSuccess:r,initialData:i=null})=>{const n=si(),{mode:o}=dr(),a=o?o.toLowerCase():"eros",l=!!i,[d,p]=m.useState(1),[u,g]=m.useState(!1),[h,x]=m.useState([]),[y,_]=m.useState(!1),[S,k]=m.useState("upload"),[w,b]=m.useState(!1),[j,T]=m.useState(""),[P,I]=m.useState(!1),[R,O]=m.useState([a]),[E,$]=m.useState({title:"",description:"",date:"",end_time:"",location:"",venue_name:"",address:"",ticketing_link:"",requires_approval:!1,image_url:"",image_gradient:"",max_participants:0,meetips_price:0,tags:[]});m.useEffect(()=>{i&&($({title:i.title||"",description:i.description||"",date:i.date?i.date.slice(0,16):"",end_time:i.end_time?i.end_time.slice(0,16):"",location:i.location||"",venue_name:i.venue_name||"",address:i.address||"",ticketing_link:i.ticketing_link||"",requires_approval:i.requires_approval||!1,image_url:i.image_url||"",image_gradient:i.image_gradient||"",max_participants:i.max_participants||0,meetips_price:i.meetips_price||0,tags:i.tags||[]}),i.mode&&O([i.mode]))},[i]),m.useEffect(()=>{l||O([a])},[a]);const B=N=>new Promise(Z=>{const ae=new FileReader;
1187ae.readAsDataURL(N),ae.onload=X=>{const he=new window.Image;he.src=X.target.result,he.onload=()=>{const Ae=document.createElement("canvas"),ze=600;let ue=he.width,xe=he.height;ue>xe?ue>ze&&(xe*=ze/ue,ue=ze):xe>ze&&(ue*=ze/xe,xe=ze),Ae.width=ue,Ae.height=xe,Ae.getContext("2d").drawImage(he,0,0,ue,xe),Z(Ae.toDataURL("image/jpeg",.55))}}});m.useEffect(()=>{const N=setTimeout(async()=>{if(E.address.length>3&&y)try{const Z=await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(E.address)}&countrycodes=fr&limit=5`);x(await Z.json())}catch(Z){console.error("Address search failed:",Z)}else E.address.length<=3&&x([])},400);return()=>clearTimeout(N)},[E.address,y]);const ee=N=>{const Z=N.display_name.split(", "),ae=Z.length>2?Z[Z.length-3]:Z[0];$(X=>({...X,address:N.display_name,location:X.location||ae})),_(!1),x([])},te=async N=>{const Z=N.target.files[0];if(Z)try{const ae=await B(Z);$(X=>({...X,image_url:ae,image_gradient:""})),b(!1)}catch{n.error("Erreur lors du traitement de l'image")}},K=N=>{$(Z=>({...Z,image_url:N,image_gradient:""})),b(!1),n.success("Image sélectionnée !")},ne=N=>{$(Z=>({...Z,image_url:"",image_gradient:N})),b(!1),n.success("Fond sélectionné !")},Re=async()=>{var N;if(j.trim())try{const Z=JSON.parse(localStorage.getItem("userProfile"));if(!Z){n.error("Vous devez être connecté");return}const{data:ae}=await D.from("profiles").select("meetips").eq("id",Z.id).single();if(!ae||(ae.meetips||0)<5){n.error("Vous n'avez pas assez de Meetips (5 requis)");return}I(!0),await D.from("profiles").update({meetips:(ae.meetips||0)-5}).eq("id",Z.id);const X=await fetch(`https://api.unsplash.com/search/photos?query=${encodeURIComponent(j)}&per_page=1&client_id=demo`,{headers:{"Accept-Version":"v1"}});if(X.ok){const he=await X.json();((N=he.results)==null?void 0:N.length)>0?($(Ae=>({...Ae,image_url:he.results[0].urls.regular,image_gradient:""})),n.success("Image générée ! 5 Meetips déduits â¨"),b(!1)):(await D.from("profiles").update({meetips:ae.meetips}).eq("id",Z.id),n.error("Aucune image trouvée"))}else{const he=c1.find(Ae=>j.toLowerCase().includes(Ae.label.toLowerCase()));he?($(Ae=>({...Ae,image_url:he.url,image_gradient:""})),n.success("Image trouvée ! 5 Meetips déduits â¨"),b(!1)):(await D.from("profiles").update({meetips:ae.meetips}).eq("id",Z.id),n.error("Service indisponible"))}}catch{n.error("Erreur lors de la génération")}finally{I(!1)}},Q=async()=>{if(R.length===0){n.error("Sélectionnez au moins un espace");return}g(!0);try{const N=JSON.parse(localStorage.getItem("userProfile"));if(!N)throw new Error("Vous devez être connecté");const Z={title:E.title,description:E.description,date:new Date(E.date).toISOString(),end_time:E.end_time?new Date(E.end_time).toISOString():null,location:E.location,venue_name:E.venue_name,address:E.address,ticketing_link:E.ticketing_link,requires_approval:E.requires_approval,image_url:E.image_url,max_participants:E.max_participants,meetips_price:E.meetips_price||0,tags:E.tags};if(l){const{error:ae}=await D.from("events").update({...Z,spaces:R}).eq("id",i.id);if(ae)throw ae}else{const{error:ae}=await D.from("events").insert([{creator_id:N.id,mode:R[0],space
1187s:R,...Z}]);if(ae)throw ae}n.success(l?"Ãvénement modifié !":`Ãvénement publié dans ${R.length} espace${R.length>1?"s":""} ! ð`),r(),e()}catch(N){console.error(N),n.error("Erreur : "+N.message)}finally{g(!1)}},G=N=>{O(Z=>Z.includes(N)?Z.filter(ae=>ae!==N):[...Z,N])},le=o==="EROX"?"#ff3333":o==="FRIEND"?"#26A69A":"#C5A065",F=E.image_url||E.image_gradient,A=()=>d===1?E.title.trim().length>0:d===2?E.date.length>0:d===3?E.location.trim().length>0:!0,M={width:"100%",padding:"14px 16px",borderRadius:"12px",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.1)",color:"white",fontSize:"0.95rem",outline:"none",transition:"border-color 0.2s, box-shadow 0.2s",boxSizing:"border-box"},V={display:"flex",alignItems:"center",gap:"6px",marginBottom:"8px",color:"rgba(255,255,255,0.6)",fontSize:"0.85rem",fontWeight:"600"},H=(N,Z,ae)=>t.jsxs("button",{type:"button",onClick:()=>k(N),style:{flex:1,padding:"8px 4px",borderRadius:"10px",border:S===N?"1px solid rgba(255,215,0,0.3)":"1px solid transparent",background:S===N?"rgba(255,215,0,0.08)":"rgba(255,255,255,0.03)",color:S===N?"#FFD700":"rgba(255,255,255,0.5)",cursor:"pointer",fontSize:"0.72rem",fontWeight:"600",display:"flex",flexDirection:"column",alignItems:"center",gap:"3px",transition:"all 0.2s"},children:[t.jsx("span",{style:{fontSize:"1rem"},children:Z}),ae]},N);try{return Xa.createPortal(t.jsx("div",{style:{position:"fixed",inset:0,zIndex:1e4,background:"rgba(0,0,0,0.85)",display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:"blur(8px)",padding:"env(safe-area-inset-top, 8px) 0 env(safe-area-inset-bottom, 8px)"},children:t.jsxs("div",{style:{width:"calc(100% - 16px)",maxWidth:"580px",maxHeight:"calc(100vh - 24px)",display:"flex",flexDirection:"column",background:"linear-gradient(180deg, #1a1a2e 0%, #141422 100%)",borderRadius:"20px",border:"1px solid rgba(255,255,255,0.08)",boxShadow:"0 25px 60px rgba(0,0,0,0.6)",overflow:"hidden"},children:[t.jsxs("div",{style:{padding:"14px 16px",borderBottom:"1px solid rgba(255,255,255,0.06)",display:"flex",justifyContent:"space-between",alignItems:"center",background:"rgba(26,26,46,0.98)",flexShrink:0},children:[t.jsxs("div",{children:[t.jsx("h2",{style:{margin:0,fontFamily:"Outfit",fontSize:"1.15rem",fontWeight:"700"},children:l?"âï¸ Modifier":"⨠Nouvel événement"}),t.jsxs("span",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.35)"},children:["Ãtape ",d,"/4 â ",p1[d-1].title]})]}),t.jsx("button",{onClick:e,style:{background:"rgba(255,255,255,0.06)",border:"none",color:"white",cursor:"pointer",width:"34px",height:"34px",borderRadius:"10px",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(mt,{size:18})})]}),t.jsxs("div",{className:"custom-scrollbar",style:{flex:1,overflowY:"auto",minHeight:0},children:[t.jsx("div",{style:{padding:"12px 16px 6px",display:"flex",gap:"6px"},children:p1.map(N=>t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",gap:"4px"},children:[t.jsx("div",{style:{width:"30px",height:"30px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.8rem",fontWeight:"800",transition:"all 0.3s",background:N.id<d?le:N.id===d?`${le}30`:"rgba(255,255,255,0.06)",color:N.id<d?"white":N.id===d?le:"rgba(255,255,255,0.25)",border:N.id===d?`2px solid ${le}`:"2px solid transparent",boxShadow:N.id===d?`0 0 12px ${le}30`:"none"},children:N.id<d?t.jsx(pr,{size:14}):N.emoji}),t.jsx("span",{style:{fontSize:"0.58rem",fontWeight:"600",color:N.id===d?"rgba(255,255,255,0.7)":"rgba(255,255,255,0.25)"},children:N.title})]},N.id))}),t.jsx("div",{style:{margin:"0 16px 12px",height:"3px",borderRadius:"3px",background:"rgba(255,255,255,0.06)"},children:t.jsx("div",{style:{height:"100%",borderRadius:"3px",background:`linear-gradient(90deg, ${le}, ${le}80)`,width:`${d/4*100}%`,transition:"width 0.3s ease"}})}),t.jsxs("div",{style:{padding:"0 16px 16px",minHeight:"200px"},children:[d===1&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[t.jsxs("div",{children:[t.jsx("label",{style:V,children:"ð Titre de l'événement *"}),t.jsx("input",{required:!0,type:"text",placeholder:"Soirée Cocktail, Rando, Atelier cuisine...",value:E.title,onChange:N=>$({...E,title:N.target.value}),style:M})]}),t.jsxs("div",{children:[t.jsx("label",{style:V,children:"ð Description *"}),t.jsx("textarea",{required:!0,rows:4,placeholder:"Décrivez l'ambiance, le dress code, ce qui est prévu...",value:E.description,onChange:N=>$({...E,description:N.target.value}),style:{...M,resize:"vertical",minHeight:"100px"}})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.02)",borderRadius:"16px",padding:"18px",border:"1px solid rgba(255,255,255,0.06)"},children:[t.jsxs("label",{style:{...V,marginBottom:"12px",fontSize:"0.9rem",color:"rgba(255,255,255,0.8)"},children:[t.jsx(wd,{size:16,color:le})," Image de couverture",t.jsx("span",{style:{color:"rgba(255,255,255,0.3)",fontWeight:"400",fontSize:"0.75rem"},children:"(optionnel)"})]}),F&&t.jsxs("div",{style:{position:"relative",marginBottom:"12px"},children:[t.jsx("div",{style:{height:"120px",borderRadius:"14px",overflow:"hidden",border:"1px solid rgba(255,255,255,0.1)"},children:E.image_url?t.jsx("img",{src:E.image_url,alt:"Aperçu",style:{width:"100%",height:"100%",objectFit:"cover"}}):t.jsx("div",{style:{width:"100%",height:"100%",background:E.image_gradient,display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx("span",{style:{fontSize:"2rem",opacity:.5},children:"â¨"})})}),t.jsx("button",{type:"button",onClick:()=>$(N=>({...N,image_url:"",image_gradient:""})),style:{position:"absolute",top:"8px",right:"8px",background:"rgba(0,0,0,0.6)",border:"none",borderRadius:"50%",width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"white"},children:t.jsx(mt,{size:14})})]}),w?t.jsxs("div",{children:[t.jsxs("div",{style:{display:"flex",gap:"6px",marginBottom:"14px"},children:[H("stock","ð¸","Photos"),H("gradient","ð¨","Couleurs"),H("ai","â¨",t.jsxs("span",{children:["IA (5",t.jsx(Jt,{size:10}),")"]})),t.jsx("button",{type:"button",onClick:()=>b(!1),style:{padding:"8px 12px",borderRadius:"10px",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(255,255,255,0.03)",color:"rgba(255,255,255,0.4)",cursor:"pointer",fontSize:"0.72rem",fontWeight:"600"},children:t.jsx(mt,{size:14})})]}),S==="stock"&&t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"8px",maxHeight:"200px",overflowY:"auto",padding:"4px"},className:"custom-scrollbar",children:c1.map((N,Z)=>t.jsxs("div",{onClick:()=>K(N.url),style:{height:"70px",borderRadius:"10px",overflow:"hidden",cursor:"pointer",border:"2px s
1187olid transparent",position:"relative"},onMouseEnter:ae=>{ae.currentTarget.style.borderColor="#FFD700",ae.currentTarget.style.transform="scale(1.03)"},onMouseLeave:ae=>{ae.currentTarget.style.borderColor="transparent",ae.currentTarget.style.transform="none"},children:[t.jsx("img",{src:N.url,alt:N.label,style:{width:"100%",height:"100%",objectFit:"cover"}}),t.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,background:"linear-gradient(transparent, rgba(0,0,0,0.7))",padding:"4px 6px",fontSize:"0.6rem",color:"white",fontWeight:"600"},children:N.label})]},Z))}),S==="gradient"&&t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"8px",maxHeight:"200px",overflowY:"auto",padding:"4px"},className:"custom-scrollbar",children:W7.map((N,Z)=>t.jsx("div",{onClick:()=>ne(N.gradient),style:{height:"50px",borderRadius:"10px",background:N.gradient,cursor:"pointer",border:"2px solid transparent",display:"flex",alignItems:"flex-end",padding:"4px 6px"},onMouseEnter:ae=>{ae.currentTarget.style.borderColor="white",ae.currentTarget.style.transform="scale(1.05)"},onMouseLeave:ae=>{ae.currentTarget.style.borderColor="transparent",ae.currentTarget.style.transform="none"},children:t.jsx("span",{style:{fontSize:"0.58rem",color:"white",fontWeight:"700",textShadow:"0 1px 3px rgba(0,0,0,0.5)"},children:N.label})},Z))}),S==="ai"&&t.jsxs("div",{style:{background:"rgba(138,43,226,0.06)",borderRadius:"12px",padding:"14px",border:"1px solid rgba(138,43,226,0.15)"},children:[t.jsxs("div",{style:{fontSize:"0.78rem",color:"rgba(255,255,255,0.5)",marginBottom:"10px",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(Xt,{size:13,color:"#a855f7"})," Décrivez l'image â ",t.jsxs("strong",{style:{color:"#FFD700"},children:["5 Meetips ",t.jsx(Jt,{size:13})]})]}),t.jsxs("div",{style:{display:"flex",gap:"8px"},children:[t.jsx("input",{type:"text",placeholder:"Ex: soirée cocktail rooftop",value:j,onChange:N=>T(N.target.value),style:{...M,borderColor:"rgba(138,43,226,0.2)",flex:1}}),t.jsx("button",{type:"button",onClick:Re,disabled:P||!j.trim(),style:{padding:"10px 18px",borderRadius:"12px",background:P?"#555":"linear-gradient(135deg, #a855f7, #7c3aed)",border:"none",color:"white",fontWeight:"700",cursor:P?"wait":"pointer",fontSize:"0.85rem",whiteSpace:"nowrap",opacity:j.trim()?1:.5,display:"flex",alignItems:"center",gap:"5px"},children:P?"â³":t.jsxs(t.Fragment,{children:[t.jsx(Xt,{size:14})," Go"]})})]})]})]}):t.jsxs("div",{style:{display:"flex",gap:"8px"},children:[t.jsxs("label",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",padding:"12px",borderRadius:"12px",cursor:"pointer",background:"rgba(255,255,255,0.04)",border:"1px dashed rgba(255,255,255,0.15)",color:"rgba(255,255,255,0.6)",fontSize:"0.82rem",fontWeight:"500"},children:[t.jsx(Sp,{size:15})," Importer",t.jsx("input",{type:"file",accept:"image/*",onChange:te,style:{display:"none"}})]}),t.jsxs("button",{type:"button",onClick:()=>b(!0),style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",padding:"12px",borderRadius:"12px",cursor:"pointer",background:"rgba(255,215,0,0.06)",border:"1px solid rgba(255,215,0,0.15)",color:"#FFD700",fontSize:"0.82rem",fontWeight:"600"},children:[t.jsx(kh,{size:15})," Banque d'images"]})]})]})]}),d===2&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[t.jsxs("div",{style:{background:"rgba(255,255,255,0.02)",borderRadius:"16px",padding:"20px",border:"1px solid rgba(255,255,255,0.06)"},children:[t.jsxs("label",{style:{...V,marginBottom:"14px",fontSize:"0.9rem",color:"rgba(255,255,255,0.8)"},children:[t.jsx(cr,{size:16,color:le})," Date & Horaires"]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"14px"},children:[t.jsxs("div",{style:{padding:"14px 16px",borderRadius:"14px",background:"rgba(16,185,129,0.06)",border:"1px solid rgba(16,185,129,0.2)",borderLeft:"4px solid #10b981"},children:[t.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px",fontSize:"0.88rem",fontWeight:"700",color:"#10b981"},children:["ð¢ Début ",t.jsx("span",{style:{color:"#ef4444",fontSize:"0.75rem"},children:"*"})]}),t.jsx("input",{required:!0,type:"datetime-local",value:E.date,onChange:N=>$({...E,date:N.target.value}),style:{...M,borderColor:"rgba(16,185,129,0.25)",fontSize:"0.9rem"}})]}),t.jsxs("div",{style:{padding:"14px 16px",borderRadius:"14px",background:"rgba(239,68,68,0.04)",border:"1px solid rgba(239,68,68,0.15)",borderLeft:"4px solid rgba(239,68,68,0.5)"},children:[t.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px",fontSize:"0.88rem",fontWeight:"700",color:"rgba(239,68,68,0.8)"},children:["ð´ Fin ",t.jsx("span",{style:{color:"rgba(255,255,255,0.3)",fontWeight:"400",fontSize:"0.72rem"},children:"(optionnel)"})]}),t.jsx("input",{type:"datetime-local",value:E.end_time,onChange:N=>$({...E,end_time:N.target.value}),style:{...M,borderColor:"rgba(239,68,68,0.15)",fontSize:"0.9rem"}})]})]})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.02)",borderRadius:"16px",padding:"20px",border:"1px solid rgba(255,255,255,0.06)",textAlign:"center"},children:[t.jsx("div",{style:{fontSize:"3rem",marginBottom:"8px"},children:"ð
"}),t.jsx("p",{style:{margin:0,color:"rgba(255,255,255,0.4)",fontSize:"0.85rem"},children:E.date?`Prévu le ${new Date(E.date).toLocaleDateString("fr-FR",{weekday:"long",day:"numeric",month:"long",hour:"2-digit",minute:"2-digit"})}`:"Choisissez une date pour votre événement"})]})]}),d===3&&t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:t.jsxs("div",{style:{background:"rgba(255,255,255,0.02)",borderRadius:"16px",padding:"20px",border:"1px solid rgba(255,255,255,0.06)"},children:[t.jsxs("label",{style:{...V,marginBottom:"14px",fontSize:"0.9rem",color:"rgba(255,255,255,0.8)"},children:[t.jsx(ur,{size:16,color:le})," Localisation"]}),t.jsxs("div",{style:{marginBottom:"14px"},children:[t.jsx("label",{style:{...V,fontSize:"0.78rem"},children:"Ville *"}),t.jsx("input",{required:!0,type:"text",placeholder:"Paris, Lyon, Marseille...",value:E.location,onChange:N=>$({...E,location:N.target.value}),style:M})]}),t.jsxs("div",{style:{marginBottom:"14px"},children:[t.jsxs("label",{style:{...V,fontSize:"0.78rem"},children:[t.jsx(d0,{size:12})," Nom du lieu"]}),t.jsx("input",{type:"text",placeholder:"Restaurant Le Comptoir, Bar Le Sunset...",value:E.venue_name,onChange:N=>$({...E,venue_name:N.target.value}),style:M})]}),t.jsxs("div",{style:{position:"relative"},children:[t.jsxs("label",{style:{...V,fontSize:"0.78rem"},children:[t.jsx(ap,{size:12,color:"var(--gold)"})," Adresse exacte (privée)"]}),t.jsx("input",{type:"text",placeholder:"12 rue de la Paix, 75002 Paris...",value:E.address,onChange:N=>{$({...E,address:N.target.value}),_(!0)},onBlur:()=>setTimeout(()=>_(!1),250),style:M}),y&&h.length>0&&t.jsx("div",{style:{position:"absolute",zIndex:20,width:"100%",marginTop:"4px",background:"rgba(30,30,50,0.98)",backdropFilter:"blur(10px)",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.1)",overflow:"hidden",boxShadow:"0 8px 25px rgba(0,0,0,0.5)"},children:h.slice(0,5).map((N,Z)=>t.jsxs("div",{onClick:()=>ee(N),style:{padding:"12px 16px",cursor:"pointer",borderBottom:Z<h.length-1?"1px solid rgba(255,255,255,0.04)":"none",color:"#ddd",fontSize:"0.85rem",display:"flex",alignItems:"center",gap:"10px"},onMouseEnter:ae=>ae.currentTarget.style.background="rgba(255,255,255,0.06)",onMouseLeave:ae=>ae.currentTarget.style.background="transparent",children:[t.jsx(ur,{size:14,color:"rgba(255,255,255,0.3)",style:{flexShrink:0}}),t.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis"},children:N.display_name})]},Z))}),t.jsx("div",{style:{fontSize:"0.72rem",color:"rgba(255,215,0,0.5)",marginTop:"4px",display:"flex",alignItems:"center",gap:"4px"},children:"ð Visible uniquement par les participants validés."})]})]})}),d===4&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[t.jsxs("div",{style:{background:"rgba(255,255,255,0.02)",borderRadius:"16px",padding:"18px",border:"1px solid rgba(255,255,255,0.06)"},children:[t.jsx("label",{style:{...V,marginBottom:"14px",fontSize:"0.9rem",color:"rgba(255,255,255,0.8)"},children:"ð Publier dans quels espaces ?"}),t.jsx("div",{style:{display:"flex",gap:"10px",flexWrap:"wrap"},children:N7.map(N=>{const Z=R.includes(N.id),ae=N.icon;return t.jsxs("button",{type:"button",onClick:()=>G(N.id),style:{flex:1,minWidth:"100px",padding:"14px 12px",borderRadius:"14px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",cursor:"pointer",transition:"all 0.2s",background:Z?`${N.color}
118715`:"rgba(255,255,255,0.02)",border:Z?`2px solid ${N.color}`:"2px solid rgba(255,255,255,0.08)",color:Z?N.color:"rgba(255,255,255,0.4)",boxShadow:Z?`0 4px 15px ${N.color}20`:"none"},children:[t.jsx("div",{style:{width:"36px",height:"36px",borderRadius:"50%",background:Z?N.gradient:"rgba(255,255,255,0.06)",display:"flex",alignItems:"center",justifyContent:"center"},children:Z?t.jsx(pr,{size:16,color:"white"}):t.jsx(ae,{size:16})}),t.jsx("span",{style:{fontSize:"0.78rem",fontWeight:"700"},children:N.label})]},N.id)})}),t.jsx("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.35)",marginTop:"10px",textAlign:"center"},children:R.length===0?"â ï¸ Sélectionnez au moins un espace":`Sera visible dans ${R.length} espace${R.length>1?"s":""}`})]}),t.jsxs("div",{children:[t.jsxs("label",{style:V,children:[t.jsx(Ut,{size:14})," Participants Max ",t.jsx("span",{style:{color:"rgba(255,255,255,0.3)",fontWeight:"400"},children:"(0 = Illimité)"})]}),t.jsx("input",{type:"number",min:"0",placeholder:"Ex: 50",value:E.max_participants,onChange:N=>$({...E,max_participants:parseInt(N.target.value)||0}),style:{...M,maxWidth:"150px"}})]}),t.jsxs("div",{style:{background:"linear-gradient(135deg, rgba(255,215,0,0.04), rgba(255,180,0,0.02))",padding:"16px",borderRadius:"14px",border:"1px solid rgba(255,215,0,0.12)"},children:[t.jsxs("label",{style:{...V,color:"#FFD700"},children:[t.jsx(Jt,{size:16})," Prix d'entrée en Meetips ",t.jsx("span",{style:{color:"rgba(255,255,255,0.3)",fontWeight:"400"},children:"(0 = Gratuit)"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx("input",{type:"number",min:"0",max:"100",step:"5",placeholder:"0",value:E.meetips_price,onChange:N=>$({...E,meetips_price:parseInt(N.target.value)||0}),style:{...M,maxWidth:"120px",borderColor:"rgba(255,215,0,0.2)"}}),t.jsx("span",{style:{color:"rgba(255,255,255,0.5)",fontSize:"0.85rem",fontWeight:"600"},children:"Meetips"})]})]}),t.jsxs("div",{children:[t.jsxs("label",{style:V,children:[t.jsx(DA,{size:14})," Lien billetterie ",t.jsx("span",{style:{color:"rgba(255,255,255,0.3)",fontWeight:"400"},children:"(optionnel)"})]}),t.jsx("input",{type:"url",placeholder:"https://billetweb.fr/mon-event...",value:E.ticketing_link,onChange:N=>$({...E,ticketing_link:N.target.value}),style:M})]}),t.jsxs("div",{children:[t.jsxs("label",{style:V,children:["ð¨ Tags ",t.jsx("span",{style:{color:"rgba(255,255,255,0.3)",fontWeight:"400"},children:"(Max 5)"})]}),t.jsx("div",{className:"custom-scrollbar",style:{display:"flex",flexWrap:"wrap",gap:"8px",maxHeight:"120px",overflowY:"auto",padding:"12px",background:"rgba(0,0,0,0.15)",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.04)"},children:((o==="EROX"?l5:a5)||[]).flatMap(N=>(N==null?void 0:N.items)||[]).map(N=>{if(!(N!=null&&N.icon))return null;const Z=E.tags.includes(N.id),ae=N.icon;return t.jsxs("button",{type:"button",onClick:()=>{Z?$({...E,tags:E.tags.filter(X=>X!==N.id)}):E.tags.length<5&&$({...E,tags:[...E.tags,N.id]})},style:{padding:"6px 14px",borderRadius:"20px",border:Z?`1px solid ${le}`:"1px solid rgba(255,255,255,0.08)",background:Z?`${le}20`:"rgba(255,255,255,0.03)",color:Z?le:"rgba(255,255,255,0.5)",display:"flex",alignItems:"center",gap:"6px",cursor:"pointer",fontSize:"0.8rem",fontWeight:Z?"600":"400"},children:[t.jsx(ae,{size:13}),N.label]},N.id)})})]}),t.jsx("div",{style:{background:"rgba(255,215,0,0.04)",padding:"18px",borderRadius:"14px",border:"1px solid rgba(255,215,0,0.15)"},children:t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[t.jsx(ap,{size:24,color:"var(--gold)"}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{fontWeight:"700",color:"var(--gold)",marginBottom:"3px",fontSize:"0.92rem"},children:"Validation Requise"}),t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.4)"},children:"Vous validez manuellement chaque inscription."})]}),t.jsxs("label",{className:"switch",children:[t.jsx("input",{type:"checkbox",checked:E.requires_approval,onChange:N=>$({...E,requires_approval:N.target.checked})}),t.jsx("span",{className:"slider round"})]})]})})]})]})]}),t.jsxs("div",{style:{padding:"12px 16px calc(12px + env(safe-area-inset-bottom, 0px))",display:"flex",gap:"10px",borderTop:"1px solid rgba(255,255,255,0.06)",background:"rgba(20,20,34,0.98)",flexShrink:0},children:[d>1&&t.jsxs("button",{type:"button",onClick:()=>p(d-1),style:{padding:"14px 20px",borderRadius:"14px",fontWeight:"700",fontSize:"0.95rem",border:"1px solid rgba(255,255,255,0.12)",background:"rgba(255,255,255,0.04)",color:"rgba(255,255,255,0.7)",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(t5,{size:18})," Retour"]}
1187),d<4?t.jsxs("button",{type:"button",onClick:()=>A()&&p(d+1),disabled:!A(),style:{flex:1,padding:"14px",borderRadius:"14px",fontWeight:"700",fontSize:"1rem",border:"none",cursor:A()?"pointer":"not-allowed",background:A()?`linear-gradient(135deg, ${le}, ${le}cc)`:"rgba(255,255,255,0.06)",color:A()?o==="EROS"?"#1a1608":"white":"rgba(255,255,255,0.25)",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",boxShadow:A()?`0 6px 20px ${le}30`:"none",transition:"all 0.2s"},children:["Suivant ",t.jsx(En,{size:18})]}):t.jsx("button",{type:"button",onClick:()=>{Uo(),Q()},disabled:u||R.length===0,style:{flex:1,padding:"16px",borderRadius:"14px",fontWeight:"700",fontSize:"1.05rem",border:"none",cursor:u||R.length===0?"wait":"pointer",background:R.length===0?"rgba(255,255,255,0.06)":`linear-gradient(135deg, ${le}, ${le}cc)`,color:R.length===0?"rgba(255,255,255,0.25)":o==="EROS"?"#1a1608":"white",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",boxShadow:`0 6px 20px ${le}30`},children:u?"â³ Publication...":t.jsxs(t.Fragment,{children:[l?"Enregistrer":"Publier"," ",t.jsx(_p,{size:18})]})})]}),t.jsx("style",{children:` 1188 .switch { position: relative; display: inline-block; width: 50px; height: 26px; } 1189 .switch input { opacity: 0; width: 0; height: 0; } 1190 .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.2); transition: .4s; border-radius: 34px; } 1191 .slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; } 1192 input:checked + .slider { background-color: var(--primary); } 1193 input:checked + .slider:before { transform: translateX(24px); } 1194 `})]})}),document.body)}catch(N){return console.error("CreateEventModal render error:",N),Xa.createPortal(t.jsxs("div",{style:{position:"fixed",inset:0,zIndex:1e4,background:"rgba(0,0,0,0.9)",color:"white",display:"flex",justifyContent:"center",alignItems:"center"},children:["Une erreur est survenue: ",N.message,t.jsx("button",{onClick:e,style:{marginLeft:"20px",padding:"10px",background:"red",border:"none",color:"white",borderRadius:"8px",cursor:"pointer"},children:"Fermer"})]}),document.body)}},sn=()=>typeof window<"u"?window.location.origin:"https://meetapps.ai",io=(e,r="Notification MEETapps")=>{const i=sn();return` 1195 <!DOCTYPE html> 1196 <html> 1197 <head> 1198 <meta charset="utf-8"> 1199 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 1200 <title>${r}</title> 1201 <style> 1202 body { margin: 0; padding: 0; font-family: 'Helvetica Neue', Arial, sans-serif; background-color: #0a0a0f; color: #ffffff; } 1203 .container { max-width: 600px; margin: 0 auto; background-color: #13131a; border-radius: 12px; overflow: hidden; } 1204 .header { padding: 30px; text-align: center; border-bottom: 2px solid #D4AF37; background: linear-gradient(180deg, #1a1a2e 0%, #13131a 100%); } 1205 .content { padding: 40px 30px; line-height: 1.7; font-size: 16px; color: #d0d0d8; } 1206 .footer { padding: 25px 30px; text-align: center; font-size: 12px; color: #555; border-top: 1px solid #222; } 1207 .button { display: inline-block; padding: 14px 30px; background: linear-gradient(135deg, #D4AF37, #AA8A2E); color: #1a1a2e; text-decoration: none; border-radius: 30px; font-weight: bold; margin-top: 20px; font-size: 16px; letter-spacing: 0.3px; } 1208 .highlight { color: #D4AF37; font-weight: bold; } 1209 .card { background: #1e1e2a; padding: 20px; border-radius: 12px; border: 1px solid #2a2a3a; margin: 20px 0; } 1210 .avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 2px solid #D4AF37; } 1211 .info-block { background: #111118; padding: 20px; border-radius: 10px; border-left: 4px solid #D4AF37; margin: 20px 0; } 1212 </style> 1213 </head> 1214 <body> 1215 <div class="container"> 1216 <!-- HEADER --> 1217 <div class="header"> 1218 <img src="${i}/logo_meetapps.png" alt="MEETApps" style="max-height: 50px; width: auto; height: auto;"> 1219 </div> 1220 1221 <!-- CONTENT --> 1222 <div class="content"> 1223 ${e} 1224 </div> 1225 1226 <!-- FOOTER --> 1227 <div class="footer"> 1228 <p>© ${new Date().getFullYear()} MEETapps. Tous droits réservés.</p> 1229 <p style="color: #444; margin-top: 8px;"> 1230 <a href="${i}" style="color: #666; text-decoration: none;">meetapps.ai</a> 1231 ⢠1232 <a href="mailto:[email protected]" style="color: #666; text-decoration: none;">[email protected]</a> 1233 </p> 1234 </div> 1235 </div> 1236 </body> 1237 </html> 1238 `},xx=(e,r,i)=>{const n=sn(),o=zp(i),a=r?`<img src="${r}" alt="${e}" style="width: 100px; height: 100px; border-radius: 50%; border: 3px solid ${o.primary}; object-fit: cover; margin-bottom: 15px;">`:`<div style="width: 100px; height: 100px; border-radius: 50%; border: 3px solid ${o.primary}; background: ${o.gradient}; display: flex; align-items: center; justify-content: center; margin: 0 auto 15px; font-size: 42px; color: ${o.btnColor}; font-weight: bold;">${(e||"?").charAt(0).toUpperCase()}</div>`,l=o.label,d=` 1239 <h2 style="color: ${o.primary}; margin-top: 0;">Félicitations ! ð¥</h2> 1240 <p>Le destin (et notre algorithme) a frappé. Vous avez un nouveau <strong>Meet</strong> sur <strong>MEETapps</strong> â espace <span style="color: ${o.primary}; font-weight: bold;">${l}</span>.</p> 1241 1242 <div style="background: #1e1e2a; padding: 25px; border-radius: 15px; text-align: center; margin: 30px 0; border: 1px solid ${o.primary}30;"> 1243 ${a} 1244 <h3 style="margin: 0; font-size: 20px; color: white;">${e}</h3> 1245 <p style="margin: 5px 0 0 0; color: #888;">attend votre message...</p> 1246 </div> 1247 1248 <p>Ne laissez pas retomber le soufflé. La première impression est souvent la bonne.</p> 1249 1250 <div style="text-align: center;"> 1251 <a href="${n}/messages" class="button">Lancer la discussion</a> 1252 </div> 1253 `;return v0(d,"Nouveau Meet !",i)},AS=(e,r,i)=>{const n=sn(),o=i?`<img src="${i}" style="width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 2px solid #555;">`:`<div style="width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, #555, #333); display: flex; align-items: center; justify-content: center; font-size: 24px; color: white; font-weight: bold;">${(r||"?").charAt(0).toUpperCase()}</div>`,a=` 1254 <h2 style="color: #fff; margin-top: 0;">Nouvelle demande ð©</h2> 1255 <p><strong>${r}</strong> souhaite rejoindre votre événement <span class="highlight">"${e}"</span>.</p> 1256 1257 <div style="background: #1e1e2a; padding: 20px; border-radius: 12px; margin: 25px 0;"> 1258 <table cellpadding="0" cellspacing="0"><tr> 1259 <td style="vertical-align: middle; padding-right: 15px;">${o}</td> 1260 <td style="vertical-align: middle;"> 1261 <strong style="display: block; font-size: 18px; color: white;">${r}</strong>
1262 <span style="color: #888; font-size: 14px;">Membre MEETapps</span> 1263 </td> 1264 </tr></table> 1265 </div> 1266 1267 <p>Consultez son profil avant de valider ou refuser sa présence.</p> 1268 1269 <div style="text-align: center;"> 1270 <a href="${n}/events" class="button">Gérer les inscriptions</a> 1271 </div> 1272 `;return io(a,`Demande pour ${e}`)},V7=(e,r,i,n)=>{const o=sn(),a=` 1273 <h2 style="color: #4CAF50; margin-top: 0;">Inscription Confirmée ! ð«</h2> 1274 <p>Bonne nouvelle, l'organisateur vous a accepté pour l'événement <span class="highlight">"${e}"</span>.</p> 1275 1276 ${`<img src="${n}" style="width: 100%; height: 150px; object-fit: cover; border-radius: 10px; margin: 20px 0; opacity: 0.85;" />`} 1277 1278 <div class="info-block"> 1279 <p style="margin: 5px 0; font-size: 14px; color: #888;">ð DATE</p> 1280 <p style="margin: 0 0 15px 0; font-weight: bold; font-size: 16px; color: #fff;">${r}</p> 1281 1282 <p style="margin: 5px 0; font-size: 14px; color: #888;">ð ADRESSE</p> 1283 <p style="margin: 0; font-weight: bold; font-size: 16px; color: #fff;">${i}</p> 1284 </div> 1285 1286 <p>Préparez-vous pour une soirée mémorable. Soyez à l'heure !</p> 1287 1288 <div style="text-align: center;"> 1289 <a href="${o}/events" class="button">Voir mon billet</a> 1290 </div> 1291 `;return io(a,`Inscription validée : ${e}`)},q7=()=>io(` 1292 <h2 style="color: #fff; margin-top: 0;">Réinitialisation ð</h2> 1293 <p>Vous avez demandé à réinitialiser votre mot de passe <strong>MEETapps</strong>.</p> 1294 1295 <p>Si c'est bien vous, cliquez simplement sur le bouton ci-dessous pour en définir un nouveau.</p> 1296 1297 <div style="text-align: center; margin: 30px 0;"> 1298 <a href="{{RESET_LINK}}" class="button">Changer mon mot de passe</a> 1299 </div> 1300 1301 <p style="font-size: 13px; color: #666;">Si vous n'êtes pas à l'origine de cette demande, ignorez cet email. Votre compte reste sécurisé.</p> 1302 `,"Réinitialisation du mot de passe"),H7=e=>{const r=` 1303 <h2 style="color: #ff4d4d; margin-top: 0;">Compte Suspendu ð</h2> 1304 <p>Votre compte a été suspendu suite à des signalements répétés ou une violation grave de nos conditions d'utilisation.</p> 1305 1306 <div style="background: #1e1e2a; padding: 20px; border-radius: 10px; border-left: 4px solid #ff4d4d; margin: 20px 0;"> 1307 <p style="margin: 5px 0; font-size: 14px; color: #888;">MOTIF DE LA SUSPENSION</p> 1308 <p style="margin: 0; font-weight: bold; font-size: 16px; color: #fff;">${e||"Non-respect des règles de la communauté"}</p> 1309 </div> 1310 1311 <p>Cette décision est définitive. Si vous pensez qu'il s'agit d'une erreur, vous pouvez contacter le support.</p> 1312 1313 <div style="text-align: center;"> 1314 <a href="mailto:[email protected]" class="button" style="background: linear-gradient(135deg, #444, #333); color: #fff;">Contacter le support</a> 1315 </div> 1316 `;return io(r,"Suspension de votre compte MEETapps")},G7=(e,r)=>{const i=sn(),n=` 1317 <h2 style="color: #ffcc00; margin-top: 0;">Avertissement â ï¸</h2> 1318 <p>Nous avons reçu des signalements concernant votre comportement sur l'application.</p> 1319 1320 <div style="background: #1e1e2a; padding: 20px; border-radius: 10px; border-left: 4px solid #ffcc00; margin: 20px 0;"> 1321 <p style="margin: 5px 0; font-size: 14px; color: #888;">MOTIF</p> 1322 <p style="margin: 0 0 10px 0; font-weight: bold; font-size: 16px; color: #fff;">${e}</p> 1323 ${r?`<p style="margin: 0; font-size: 14px; color: #ccc;">"${r}"</p>`:""} 1324 </div> 1325 1326 <p>Ceci est un avertissement formel. De nouveaux signalements pourraient entraîner la suspension définitive de votre compte.</p> 1327 <p>Merci de respecter notre charte de bonne conduite. La bienveillance est notre priorité.</p> 1328 1329 <div style="text-align: center;"> 1330 <a href="${i}/dashboard" class="button">Accéder à mon espace</a> 1331 </div> 1332 `;return io(n,"Avertissement concernant votre compte")},J7=e=>{const r=sn(),i=` 1333 <h2 style="color: #ffaa00; margin-top: 0;">
1333Compte Restreint ð</h2> 1334 <p>Votre profil a été temporairement restreint par nos modérateurs car il ne respecte pas entièrement nos standards de qualité.</p> 1335 1336 <div style="background: #1e1e2a; padding: 20px; border-radius: 10px; border-left: 4px solid #ffaa00; margin: 20px 0;"> 1337 <p style="margin: 5px 0; font-size: 14px; color: #888;">RAISON DE LA RESTRICTION</p> 1338 <p style="margin: 0; font-weight: bold; font-size: 16px; color: #fff;">"${e}"</p> 1339 </div> 1340 1341 <p>Pour retrouver l'accès complet à l'application, vous devez modifier votre profil (photo, bio, etc.) pour corriger ce problème.</p> 1342 1343 <div style="text-align: center;"> 1344 <a href="${r}/edit-criteria" class="button">Corriger mon profil</a> 1345 </div> 1346 `;return io(i,"Action requise : Votre compte est restreint")},Z7=()=>{const r=` 1347 <h2 style="color: #4CAF50; margin-top: 0;">Compte Réhabilité ! â </h2> 1348 <p>Bonne nouvelle ! Nos modérateurs ont validé vos modifications.</p> 1349 1350 <p>Votre compte est de nouveau <strong>pleinement actif</strong>. Vous pouvez dès maintenant reprendre vos échanges et faire de nouvelles rencontres.</p> 1351 1352 <p>Merci de votre réactivité et bons Meets !</p> 1353 1354 <div style="text-align: center;"> 1355 <a href="${sn()}/dashboard" class="button">Accéder à mon espace</a> 1356 </div> 1357 `;return io(r,"Votre compte a été validé !")},Y7=()=>{const r=` 1358 <h2 style="color: #26A69A; margin-top: 0;">Profil Vérifié ! ð¡ï¸</h2> 1359 <p>Excellente nouvelle ! Votre demande de vérification a été acceptée par notre équipe.</p> 1360 1361 <p>Le <strong>Badge de Confiance</strong> apparaît désormais sur votre profil. C'est un gage de sérieux qui rassure les autres membres et augmente vos chances de Meets.</p> 1362 1363 <div style="background: #1e1e2a; padding: 20px; border-radius: 10px; border-left: 4px solid #26A69A; margin: 20px 0;"> 1364 <table cellpadding="0" cellspacing="0"><tr> 1365 <td style="vertical-align: middle; padding-right: 15px;"> 1366 <div style="background: rgba(38, 166, 154, 0.2); width: 50px; height: 50px; border-radius: 50%; text-align: center; line-height: 50px;"> 1367 <span style="font-size: 24px;">ð¡ï¸</span> 1368 </div> 1369 </td> 1370 <td style="vertical-align: middle;"> 1371 <p style="margin: 0; font-weight: bold; font-size: 16px; color: #fff;">Identité Confirmée</p> 1372 <p style="margin: 4px 0 0; font-size: 14px; color: #888;">Merci d'aider à garder la communauté sûre.</p> 1373 </td> 1374 </tr></table> 1375 </div> 1376 1377 <div style="text-align: center;"> 1378 <a href="${sn()}/account" class="button" style="background: linear-gradient(135deg, #26A69A, #1a7a70); color: white;">Voir mon profil</a> 1379 </div> 1380 `;return io(r,"Félicitations ! Votre profil est vérifié")},X7=e=>{const r=sn(),i=` 1381 <h2 style="color: #3B82F6; margin-top: 0;">Vérification Non Validée ð¸</h2> 1382 <p>Votre demande de badge de confiance n'a pas pu être validée par notre équipe.</p> 1383 1384 <div style="background: #1e1e2a; padding: 20px; border-radius: 10px; border-left: 4px solid #3B82F6; margin: 20px 0;"> 1385 <p style="margin: 5px 0; font-size: 14px; color: #888;">RAISON</p> 1386 <p style="margin: 0; font-weight: bold; font-size: 16px; color: #fff;">${e||"Le selfie ne correspond pas suffisamment à vos photos de profil"}</p> 1387 </div> 1388 1389 <p><strong>Ce n'est pas grave !</strong> Vous pouvez retenter votre chance :</p> 1390 <ul style="color: #ccc; line-height: 1.8;"> 1391 <li>Prenez le selfie dans un endroit bien éclairé</li> 1392 <li>Montrez clairement votre visage (pas de lunettes de soleil, chapeau...)</li> 1393 <li>Assurez-vous que vos photos de profil vous représentent bien</li> 1394 </ul> 1395 1396 <div style="text-align: center;"> 1397 <a href="${r}/account" class="button" style="background: linear-gradient(135deg, #3B82F6, #1E40AF); color: white;">Refaire ma vérification</a> 1398 </div> 1399 `;return io(i,"Nouvelle tentative requise")},zp=e=>{const r=(e||"eros").toLowerCase();return r==="erox"?{primary:"#ff3333",gradient:"linear-gradient(135deg, #ff3333, #990000)",gradientLight:"linear-gradient(135deg, rgba(255,51,51,0.15), rgba(153,0,0,0.1))",border:"#ff3333",label:"MEET EROX",emoji:"ð¥",btnColor:"#fff"}:r==="friend"?{primary:"#3B82F6",gradient:"linear-gradient(135deg, #3B82F6, #1E40AF)",gradientLight:"linear-gradient(135deg, rgba(59,130,246,0.15), rgba(30,64,175,0.1))",border:"#3B82F6",label:"MEET FRIEND",emoji:"ð¤",btnColor:"#fff"}:{primary:"#D4AF37",gradient:"linear-gradient(135deg, #D4AF37, #AA8A2E)",gradientLight:"linear-gradient(135deg, rgba(212,175,55,0.15), rgba(170,138,46,0.1))",border:"#D4AF37",label:"MEET EROS",emoji:"â¤ï¸",btnColor:"#1a1a2e"}},v0=(e,r,i)=>{const n=sn(),o=zp(i);return` 1400 <!DOCTYPE html> 1401 <html> 1402 <head> 1403 <meta charset="utf-8"> 1404 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 1405 <title>${r}</title> 1406 <style> 1407 body { margin: 0; padding: 0; font-family: 'Helvetica Neue', Arial, sans-serif; background-color: #0a0a0f; color: #ffffff; } 1408 .container { max-width: 600px; margin: 0 auto; background-color: #13131a; border-radius: 12px; overflow: hidden; } 1409 .header { padding: 20px 25px; border-bottom: 2px solid ${o.primary}; background: linear-gradient(180deg, #1a1a2e 0%, #13131a 100%); } 1410 .header-inner { display: flex; align-items: center; justify-content: space-between; } 1411 .content { padding: 40px 30px; line-height: 1.7; font-size: 16px; color: #d0d0d8; } 1412 .footer { padding: 25px 30px; text-align: center; font-size: 12px; color: #555; border-top: 1px solid #222; } 1413 .button { display: inline-block; padding: 14px 30px; background: ${o.gradient}; color: ${o.btnColor}; text-decoration: none; border-radius: 30px; font-weight: bold; margin-top: 20px; font-size: 16px; letter-spacing: 0.3px; } 1414 .highlight { color: ${o.primary}; font-weight: bold; } 1415 .mode-badge { display: inline-block; padding: 5px 14px; border-radius: 20px; background: ${o.gradientLight}; border: 1px solid ${o.primary}; color: ${o.primary}; font-size: 12px; font-weight: bold; letter-spacing: 1px; } 1416 </style> 1417 </head> 1418 <body> 1419 <div class="container"> 1420 <div class="header"> 1421 <table width="100%" cellpadding="0" cellspacing="0"><tr> 1422 <td><img src="${n}/logo_meetapps.png" alt="MEETApps" style="max-height: 40px; width: auto; height: auto;"></td> 1423 <td style="text-align: right;"><span class="mode-badge">${o.emoji} ${o.label}</span></td> 1424 </tr></table> 1425 </div> 1426 <div class="content"> 1427 ${e} 1428 </div> 1429 <div class="footer"> 1430 <p>© ${new Date().getFullYear()} MEETapps. Tous droits réservés.</p> 1431 <p style="color: #444; margin-top: 8px;"> 1432 <a href="${n}" style="color: #666; text-decoration: none;">meetapps.ai</a> 1433 ⢠1434 <a href="mailto:[email protected]" style="color: #666; text-decoration: none;">[email protected]</a> 1435 </p> 1436 </div> 1437 </div> 1438 </body> 1439 </html> 1440 `},PS=(e,r,i,n,o,a,l)=>{const d=sn(),p=zp(a),u=` 1441 <h2 style="color: ${p.primary}; margin-top: 0;">Bienvenue ! ${p.emoji}</h2> 1442 <p>Vous êtes inscrit(e) à l'événement <span class="highlight">"${e}"</span>. Préparez-vous pour un moment inoubliable !</p> 1443 1444 ${o?`<img src="${o}" style="width: 100%; height: 180px; object-fit: cover; border-radius: 12px; margin: 20px 0; border: 1px solid #2a2a3a;" />`:""} 1445 1446 <div style="background: #111118; padding: 25px; border-radius: 12px; border-left: 4px solid ${p.primary}; margin: 25px 0;"> 1447 <table width="100%" cellpadding="0" cellspacing="0" style="font-size: 15px;"> 1448 <tr> 1449 <td style="padding: 8px 0; color: #888; width: 30px; vertical-align: top;">ð </td> 1450 <td style="padding: 8px 0;">
1451 <span style="color: #888; font-size: 12px; text-transform: uppercase; letter-spacing: 1px;">Date</span><br> 1452 <strong style="color: #fff; font-size: 16px;">${r}</strong> 1453 </td> 1454 </tr> 1455 <tr> 1456 <td style="padding: 8px 0; color: #888; vertical-align: top;">â°</td> 1457 <td style="padding: 8px 0;"> 1458 <span style="color: #888; font-size: 12px; text-transform: uppercase; letter-spacing: 1px;">Heure</span><br> 1459 <strong style="color: #fff; font-size: 16px;">${i}</strong> 1460 </td> 1461 </tr> 1462 <tr> 1463 <td style="padding: 8px 0; color: #888; vertical-align: top;">ð</td> 1464 <td style="padding: 8px 0;"> 1465 <span style="color: #888; font-size: 12px; text-transform: uppercase; letter-spacing: 1px;">Lieu</span><br> 1466 <strong style="color: #fff; font-size: 16px;">${n}</strong> 1467 </td> 1468 </tr> 1469 </table> 1470 </div> 1471 1472 <div style="background: #1e1e2a; padding: 15px 20px; border-radius: 10px; margin: 20px 0;"> 1473 <table cellpadding="0" cellspacing="0"><tr> 1474 <td style="vertical-align: middle; padding-right: 10px; font-size: 20px;">ð¤</td> 1475 <td style="vertical-align: middle; color: #ccc;">Organisé par <strong style="color: ${p.primary};">${l}</strong></td> 1476 </tr></table> 1477 </div> 1478 1479 <p style="color: #888; font-size: 14px;">Soyez à l'heure et profitez de cette expérience unique. N'hésitez pas à consulter les détails de l'événement sur l'application.</p> 1480 1481 <div style="text-align: center;"> 1482 <a href="${d}/events" class="button">Voir l'événement</a> 1483 </div> 1484 `;return v0(u,`Inscription confirmée : ${e}`,a)},FS=(e,r,i,n,o,a)=>{const l=sn(),d=zp(o),p=`${l}/events?rate=${a||""}`,u=n?`<img src="${n}" alt="${i}" style="width: 80px; height: 80px; border-radius: 50%; border: 3px solid ${d.primary}; object-fit: cover; margin-bottom: 12px;">`:`<div style="width: 80px; height: 80px; border-radius: 50%; border: 3px solid ${d.primary}; background: linear-gradient(135deg, ${d.primary}, #333); margin: 0 auto 12px; text-align: center; line-height: 80px; font-size: 32px; color: white; font-weight: bold;">${(i||"?").charAt(0).toUpperCase()}</div>`,g=` 1485 <h2 style="color: ${d.primary}; margin-top: 0;">Comment c'était ? â</h2> 1486 <p>L'événement <span class="highlight">"${e}"</span> du <strong>${r}</strong> est terminé. Votre avis compte !</p> 1487 1488 <div style="background: #1e1e2a; padding: 25px; border-radius: 15px; text-align: center; margin: 30px 0; border: 1px solid #2a2a3a;"> 1489 ${u} 1490 <h3 style="margin: 0; font-size: 18px; color: white;">${i}</h3> 1491 <p style="margin: 5px 0 15px; color: #888; font-size: 14px;">Organisateur</p> 1492 1493 <div style="margin: 15px 0;"> 1494 <span style="font-size: 28px; letter-spacing: 5px;">âââââ</span> 1495 </div> 1496 <p style="color: #666; font-size: 13px;">Notez l'expérience de 1 à 5 étoiles</p> 1497 </div> 1498 1499 <p>Votre note et votre commentaire aident les futurs participants à choisir les meilleurs événements. C'est aussi un moyen de remercier (ou alerter) la communauté.</p> 1500 1501 <div style="text-align: center;"> 1502 <a href="${p}" class="button">Donner mon avis â</a> 1503 </div> 1504 1505 <p style="color: #555; font-size: 13px; margin-top: 30px; text-align: center;">Si vous avez déjà noté cet événement, ignorez cet email.</p> 1506 `;return v0(g,`Votre avis sur "${e}"`,o)},Ih=(e="Nouveau membre")=>{const r=sn(),i=` 1507 <!-- HERO WELCOME --> 1508 <div style="text-align: center; padding: 10px 0 30px;"> 1509 <h1 style="font-size: 28px; color: #D4AF37; margin: 0 0 5px; font-weight: 300; letter-spacing: 1px;">Bienvenue sur</h1> 1510 <h1 style="font-size: 36px; color: #F5F5DC; margin: 0 0 15px; font-weight: 700; letter-spacing: 2px;">MEETApps</h1> 1511 <p style="color: #888; font-size: 15px; margin: 0;">La plateforme de toutes les rencontres.</p> 1512 </div> 1513 1514 <p style="font-size: 17px; color: #d0d0d8; text-align: center; line-height: 1.8;"> 1515 Bonjour <span style="color: #D4AF37; font-weight: bold;">${e}</span> ð<br> 1516 Votre compte est créé ! Voici tout ce que vous devez savoir pour profiter pleinement de l'expérience. 1517 </p> 1518 1519 <!-- âââ SÃPARATEUR âââ --> 1520 <div style="border-top: 1px solid #2a2a3a; margin: 35px 0;"></div> 1521 1522 <!-- âââ SECTION 1 : 3 ESPACES âââ --> 1523 <h2 style="color: #F5F5DC; font-size: 20px; text-align: center; margin-bottom: 5px; letter-spacing: 1px;">ð UN COMPTE, TROIS ESPACES</h2> 1524 <p style="color: #666; font-size: 13px; text-align: center; margin-bottom: 25px;">Changez d'espace à tout moment d'un simple glissement</p> 1525 1526 <!-- EROS --> 1527 <div style="background: linear-gradient(135deg, rgba(212,175,55,0.08), rgba(0,0,0,0.3)); border: 1px solid rgba(212,175,55,0.25); border-radius: 16px; padding: 22px; margin-bottom: 14px;"> 1528 <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr> 1529 <td width="50" valign="top"> 1530 <div style="width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #D4AF37, #AA8A2E); text-align: center; line-height: 44px; font-size: 22px;">â¤ï¸</div> 1531 </td> 1532 <td style="padding-left: 14px;"> 1533 <h3 style="color: #D4AF37; margin: 0 0 4px; font-size: 16px;">MEET EROS â <span style="font-weight: 400; color: #c0a050;">Amour</span></h3> 1534 <p style="color: #999; margin: 0; font-size: 13px; line-height: 1.6;">Trouvez votre moitié grâce au matching intelligent. Notre IA analyse vos affinités et votre personnalité pour créer des connexions authentiques. Profils vérifiés, événements exclusifs.</p> 1535 </td> 1536 </tr></table> 1537 </div> 1538 1539 <!-- FRIEND --> 1540 <div style="background: linear-gradient(135deg, rgba(38,166,
1540154,0.08), rgba(0,0,0,0.3)); border: 1px solid rgba(38,166,154,0.25); border-radius: 16px; padding: 22px; margin-bottom: 14px;"> 1541 <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr> 1542 <td width="50" valign="top"> 1543 <div style="width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #26A69A, #00695C); text-align: center; line-height: 44px; font-size: 22px;">ð¥</div> 1544 </td> 1545 <td style="padding-left: 14px;"> 1546 <h3 style="color: #26A69A; margin: 0 0 4px; font-size: 16px;">MEET FRIEND â <span style="font-weight: 400; color: #80CBC4;">Social</span></h3> 1547 <p style="color: #999; margin: 0; font-size: 13px; line-height: 1.6;">Ãlargissez votre cercle social ! Rencontres amicales par centres d'intérêt, sorties de groupe, communautés par passion. Ambiance détendue, zéro pression.</p> 1548 </td> 1549 </tr></table> 1550 </div> 1551 1552 <!-- EROX --> 1553 <div style="background: linear-gradient(135deg, rgba(255,51,51,0.08), rgba(0,0,0,0.3)); border: 1px solid rgba(255,51,51,0.25); border-radius: 16px; padding: 22px; margin-bottom: 14px;"> 1554 <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr> 1555 <td width="50" valign="top"> 1556 <div style="width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #ff3333, #880000); text-align: center; line-height: 44px; font-size: 22px;">ð¥</div> 1557 </td> 1558 <td style="padding-left: 14px;"> 1559 <h3 style="color: #ff3333; margin: 0 0 4px; font-size: 16px;">MEET EROX â <span style="font-weight: 400; color: #ff6666;">Désirs</span></h3> 1560 <p style="color: #999; margin: 0; font-size: 13px; line-height: 1.6;">Un espace confidentiel et décomplexé. Discrétion totale, données chiffrées, matching par affinités intimes. Profils certifiés, photos privées à accès contrôlé.</p> 1561 </td> 1562 </tr></table> 1563 </div> 1564 1565 <!-- âââ SÃPARATEUR âââ --> 1566 <div style="border-top: 1px solid #2a2a3a; margin: 35px 0;"></div> 1567 1568 <!-- âââ SECTION 2 : COMPATIBILITà âââ --> 1569 <h2 style="color: #F5F5DC; font-size: 20px; text-align: center; margin-bottom: 5px;">ð COMPATIBILITà INTELLIGENTE</h2> 1570 <p style="color: #666; font-size: 13px; text-align: center; margin-bottom: 25px;">Un score calculé sur vos vrais points communs</p> 1571 1572 <div style="background: #111118; border-radius: 16px; padding: 24px; border: 1px solid #2a2a3a;"> 1573 <p style="color: #d0d0d8; font-size: 14px; margin: 0 0 18px; line-height: 1.7; text-align: center;"> 1574 Chaque profil affiche un <span style="color: #D4AF37; font-weight: bold;">pourcentage de compatibilité</span> basé sur 3 catégories : 1575 </p> 1576 <!-- 3 Bubbles --> 1577 <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr> 1578 <td width="33%" style="text-align: center; padding: 5px;"> 1579 <div style="width: 52px; height: 52px; border-radius: 50%; border: 2px solid #D4AF37; background: rgba(212,175,55,0.1); margin: 0 auto 8px; line-height: 52px; font-size: 20px;">â¤ï¸</div> 1580 <div style="font-size: 11px; color: #D4AF37; font-weight: 600;">Ce que j'aime</div> 1581 <div style="font-size: 10px; color: #666; margin-top: 3px;">Passions, loisirs</div> 1582 </td> 1583 <td width="33%" style="text-align: center; padding: 5px;"> 1584 <div style="width: 52px; height: 52px; border-radius: 50%; border: 2px solid #4CAF50; background: rgba(76,175,80,0.1); margin: 0 auto 8px; line-height: 52px; font-size: 20px;">ð</div> 1585 <div style="font-size: 11px; color: #4CAF50; font-weight: 600;">Ce que je recherche</div> 1586 <div style="font-size: 10px; color: #666; margin-top: 3px;">Critères, valeurs</div> 1587 </td> 1588 <td width="33%" style="text-align: center; padding: 5px;"> 1589 <div style="width: 52px; height: 52px; border-radius: 50%; border: 2px solid #AB47BC; background: rgba(171,71,188,0.1); margin: 0 auto 8px; line-height: 52px; font-size: 20px;">â¨</div> 1590 <div style="font-size: 11px; color: #AB47BC; font-weight: 600;">Ma personnalité</div> 1591 <div style="font-size: 10px; color: #666; margin-top: 3px;">
1591Traits, caractère</div> 1592 </td> 1593 </tr></table> 1594 <p style="color: #888; font-size: 12px; text-align: center; margin: 18px 0 0; line-height: 1.6;"> 1595 Plus vous complétez votre profil avec des pictogrammes, plus le matching est précis !<br> 1596 Seuls les <span style="color: #D4AF37;">points en commun</span> s'affichent sur les profils. 1597 </p> 1598 </div> 1599 1600 <!-- âââ SÃPARATEUR âââ --> 1601 <div style="border-top: 1px solid #2a2a3a; margin: 35px 0;"></div> 1602 1603 <!-- âââ SECTION 3 : MEETIPS âââ --> 1604 <h2 style="color: #F5F5DC; font-size: 20px; text-align: center; margin-bottom: 5px;">ð LES MEETIPS</h2> 1605 <p style="color: #666; font-size: 13px; text-align: center; margin-bottom: 25px;">La monnaie virtuelle de MEETapps</p> 1606 1607 <div style="background: linear-gradient(135deg, rgba(212,175,55,0.12), rgba(0,0,0,0.5)); border: 1px solid rgba(212,175,55,0.3); border-radius: 16px; padding: 24px;"> 1608 <p style="color: #d0d0d8; font-size: 14px; margin: 0 0 18px; line-height: 1.7;"> 1609 Les <span style="color: #D4AF37; font-weight: bold;">MEETips</span> vous permettent d'interagir de manière unique sur la plateforme : 1610 </p> 1611 <table cellpadding="0" cellspacing="0" border="0" width="100%"> 1612 <tr> 1613 <td style="padding: 8px 0;" valign="top"> 1614 <span style="color: #D4AF37; font-size: 18px;">ð</span> 1615 </td> 1616 <td style="padding: 8px 0 8px 12px;"> 1617 <span style="color: #F5F5DC; font-size: 14px; font-weight: 600;">Envoyer des cadeaux 3D</span> 1618 <span style="color: #888; font-size: 13px;"> â Offrez des cadeaux holographiques animés pour vous démarquer !</span> 1619 </td> 1620 </tr> 1621 <tr> 1622 <td style="padding: 8px 0;" valign="top"> 1623 <span style="color: #D4AF37; font-size: 18px;">ð</span> 1624 </td> 1625 <td style="padding: 8px 0 8px 12px;"> 1626 <span style="color: #F5F5DC; font-size: 14px; font-weight: 600;">Débloquer des profils</span> 1627 <span style="color: #888; font-size: 13px;"> â Accédez aux profils exclusifs qui ont attiré votre curiosité.</span> 1628 </td> 1629 </tr> 1630 <tr> 1631 <td style="padding: 8px 0;" valign="top"> 1632 <span style="color: #D4AF37; font-size: 18px;">ð¤</span> 1633 </td> 1634 <td style="padding: 8px 0 8px 12px;"> 1635 <span style="color: #F5F5DC; font-size: 14px; font-weight: 600;">Payer des services d'Entraide</span> 1636 <span style="color: #888; font-size: 13px;"> â Ãchangez des services entre membres (voir ci-dessous).</span> 1637 </td> 1638 </tr> 1639 </table> 1640 <p style="color: #777; font-size: 12px; text-align: center; margin: 15px 0 0; border-top: 1px solid #2a2a3a; padding-top: 15px;"> 1641 ð¡ Gagnez vos premiers MEETips en complétant votre profil et en vérifiant votre identité. 1642 </p> 1643 </div> 1644 1645 <!-- âââ SÃPARATEUR âââ --> 1646 <div style="border-top: 1px solid #2a2a3a; margin: 35px 0;"></div> 1647 1648 <!-- âââ SECTION 4 : ENTRAIDE âââ --> 1649 <h2 style="color: #F5F5DC; font-size: 20px; text-align: center; margin-bottom: 5px;">ð¤ L'ENTRAIDE <span style="color: #26A69A; font-size: 14px; font-weight: 400;">(MEETfriend)</span></h2> 1650 <p style="color: #666; font-size: 13px; text-align: center; margin-bottom: 25px;">La marketplace de services entre membres</p> 1651 1652 <div style="background: linear-gradient(135deg, rgba(38,166,154,0.10), rgba(0,0,0,0.5)); border: 1px solid rgba(38,166,154,0.3); border-radius: 16px; padding: 24px;"> 1653 <p style="color: #d0d0d8; font-size: 14px; margin: 0 0 15px; line-height: 1.7;"> 1654 Dans l'espace <span style="color: #26A69A; font-weight: bold;">MEETfriend</span>, vous pouvez proposer ou demander des services à la communauté, payés en <span style="color: #D4AF37; font-weight: bold;">MEETips</span> : 1655 </p> 1656 1657 <!-- Services examples --> 1658 <table cellpadding="0" cellspacing="0" border="0" width="100%"> 1659 <tr> 1660 <td style="padding: 6px 0; font-size: 14px;">ð <span style="color: #ccc;">Cours particuliers</span></td> 1661 <td style="padding: 6px 0; font-size: 14px;">ð§ <span style="color: #ccc;">Réparations</span></td> 1662 </tr> 1663 <tr> 1664 <td style="padding: 6px 0; font-size: 14px;">ð¸ <span style="color: #ccc;">Photographie</span></td> 1665 <td style="padding: 6px 0; font-size: 14px;">ðï¸ <span style="color: #ccc;">Coaching sportif</span></td> 1666 </tr> 1667 <tr> 1668 <td style="padding: 6px 0; font-size: 14px;">ð¶ <span style="color: #ccc;">Baby-sitting</span></td> 1669 <td style="padding: 6px 0; font-size: 14px;">
1669ð <span style="color: #ccc;">Déménagement</span></td> 1670 </tr> 1671 <tr> 1672 <td style="padding: 6px 0; font-size: 14px;">ð¨ <span style="color: #ccc;">Arts & Créatif</span></td> 1673 <td style="padding: 6px 0; font-size: 14px;">ð¿ <span style="color: #ccc;">Jardinage</span></td> 1674 </tr> 1675 </table> 1676 1677 <div style="background: rgba(38,166,154,0.12); border-radius: 12px; padding: 16px; margin-top: 18px; border: 1px solid rgba(38,166,154,0.2);"> 1678 <p style="color: #26A69A; font-size: 13px; font-weight: 700; margin: 0 0 8px;">ð Comment ça marche ?</p> 1679 <table cellpadding="0" cellspacing="0" border="0" width="100%"> 1680 <tr><td style="color: #aaa; font-size: 12px; padding: 4px 0; line-height: 1.6;"><span style="color: #D4AF37; font-weight: bold;">1.</span> Parcourez les offres ou publiez votre demande d'aide</td></tr> 1681 <tr><td style="color: #aaa; font-size: 12px; padding: 4px 0; line-height: 1.6;"><span style="color: #D4AF37; font-weight: bold;">2.</span> Réservez un service â vos MEETips sont bloqués en garantie</td></tr> 1682 <tr><td style="color: #aaa; font-size: 12px; padding: 4px 0; line-height: 1.6;"><span style="color: #D4AF37; font-weight: bold;">3.</span> Le prestataire confirme et réalise le service</td></tr> 1683 <tr><td style="color: #aaa; font-size: 12px; padding: 4px 0; line-height: 1.6;"><span style="color: #D4AF37; font-weight: bold;">4.</span> Service terminé â notation mutuelle (â) et paiement libéré</td></tr> 1684 <tr><td style="color: #aaa; font-size: 12px; padding: 4px 0; line-height: 1.6;"><span style="color: #D4AF37; font-weight: bold;">5.</span> En cas de litige : 24h pour signaler â médiation de l'équipe</td></tr> 1685 </table> 1686 </div> 1687 </div> 1688 1689 <!-- âââ SÃPARATEUR âââ --> 1690 <div style="border-top: 1px solid #2a2a3a; margin: 35px 0;"></div> 1691 1692 <!-- âââ SECTION 5 : PREMIERS PAS âââ --> 1693 <h2 style="color: #F5F5DC; font-size: 20px; text-align: center; margin-bottom: 25px;">ð VOS PREMIERS PAS</h2> 1694 1695 <table cellpadding="0" cellspacing="0" border="0" width="100%"> 1696 <tr> 1697 <td style="padding: 10px 0; vertical-align: top;"> 1698 <div style="background: #1e1e2a; border-radius: 14px; padding: 18px; border: 1px solid #2a2a3a;"> 1699 <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr> 1700 <td width="36" valign="top"><div style="width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #D4AF37, #AA8A2E); text-align: center; line-height: 30px; font-size: 14px; font-weight: bold; color: #000;">1</div></td> 1701 <td style="padding-left: 12px;"><span style="color: #F5F5DC; font-size: 14px; font-weight: 600;">Complétez votre profil</span><br><span style="color: #888; font-size: 12px;">Ajoutez vos photos, vos pictogrammes et votre bio pour un matching optimal.</span></td> 1702 </tr></table> 1703 </div> 1704 </td> 1705 </tr> 1706 <tr> 1707 <td style="padding: 10px 0; vertical-align: top;"> 1708 <div style="background: #1e1e2a; border-radius: 14px; padding: 18px; border: 1px solid #2a2a3a;"> 1709 <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr> 1710 <td width="36" valign="top"><div style="width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #D4AF37, #AA8A2E); text-align: center; line-height: 30px; font-size: 14px; font-weight: bold; color: #000;">2</div></td> 1711 <td style="padding-left: 12px;"><span style="color: #F5F5DC; font-size: 14px; font-weight: 600;">Vérifiez votre identité</span><br><span style="color: #888; font-size: 12px;">Un selfie rapide pour obtenir le badge vérifié ð¡ï¸ et gagner des MEETips bonus.</span></td> 1712 </tr></table> 1713 </div> 1714 </td> 1715 </tr> 1716 <tr> 1717 <td style="padding: 10px 0; vertical-align: top;"> 1718 <div style="background: #1e1e2a; border-radius: 14px; padding: 18px; border: 1px solid #2a2a3a;"> 1719 <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr> 1720 <td width="36" valign="top"><div style="width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #D4AF37, #AA8A2E); text-align: center; line-height: 30px; font-size: 14px; font-weight: bold; color: #000;">3</div></td> 1721 <td style="padding-left: 12px;"><span style="color: #F5F5DC; font-size: 14px; font-weight: 600;">
1721Explorez les 3 espaces</span><br><span style="color: #888; font-size: 12px;">Swipez les profils, consultez la carte, participez aux événements. Changez d'espace d'un glissement !</span></td> 1722 </tr></table> 1723 </div> 1724 </td> 1725 </tr> 1726 </table> 1727 1728 <!-- CTA BUTTON --> 1729 <div style="text-align: center; margin: 35px 0 10px;"> 1730 <a href="${r}" class="button" style="display: inline-block; padding: 16px 40px; background: linear-gradient(135deg, #D4AF37, #AA8A2E); color: #1a1a2e; text-decoration: none; border-radius: 30px; font-weight: bold; font-size: 16px; letter-spacing: 0.5px;"> 1731 Commencer l'aventure ð 1732 </a> 1733 </div> 1734 1735 <p style="color: #555; font-size: 12px; text-align: center; margin-top: 25px; line-height: 1.6;"> 1736 Des questions ? Notre équipe est là pour vous accompagner.<br> 1737 Ãcrivez-nous à <a href="mailto:[email protected]" style="color: #D4AF37; text-decoration: none;">[email protected]</a> 1738 </p> 1739 `;return io(i,"Bienvenue sur MEETapps !")},u1=(e,r="eros")=>{const i=sn(),n=zp(r),o=` 1740 <div style="line-height: 1.8; font-size: 16px; color: #d0d0d8;"> 1741 ${e} 1742 </div> 1743 <div style="text-align: center; margin-top: 30px;"> 1744 <a href="${i}" style="display: inline-block; padding: 14px 30px; background: ${n.gradient}; color: ${n.btnColor}; text-decoration: none; border-radius: 30px; font-weight: bold; font-size: 16px; letter-spacing: 0.3px;"> 1745 Ouvrir MEETapps 1746 </a> 1747 </div> 1748 `;return r==="eros"?io(o,"MEETapps"):v0(o,"MEETapps",r)},K7=(e="Un membre",r="")=>{const i=sn(),n=r?`${i}?ref=${encodeURIComponent(r)}`:i,o=` 1749 <div style="text-align: center; padding: 10px 0 25px;"> 1750 <div style="width: 70px; height: 70px; border-radius: 50%; background: linear-gradient(135deg, #D4AF37, #AA8A2E); margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; line-height: 70px; text-align: center;"> 1751 <span style="font-size: 32px;">ð</span> 1752 </div> 1753 <h1 style="font-size: 26px; color: #F5F5DC; margin: 0 0 8px; font-weight: 700;">Vous êtes invité(e) !</h1> 1754 <p style="color: #888; font-size: 15px; margin: 0;">par <strong style="color: #D4AF37;">${e}</strong></p> 1755 </div> 1756 1757 <div style="background: linear-gradient(135deg, rgba(212,175,55,0.10), rgba(0,0,0,0.4)); border: 1px solid rgba(212,175,55,0.25); border-radius: 16px; padding: 24px; margin: 20px 0;"> 1758 <p style="color: #d0d0d8; font-size: 16px; margin: 0 0 10px; line-height: 1.7; text-align: center;"> 1759 <strong style="color: #D4AF37;">${e}</strong> vous invite à rejoindre <strong>MEETapps</strong>, la plateforme de toutes les rencontres. 1760 </p> 1761 <p style="color: #999; font-size: 14px; margin: 0; text-align: center; line-height: 1.6;"> 1762 Amour, amitié ou aventure â découvrez 3 univers uniques pour connecter avec des personnes qui vous correspondent vraiment. 1763 </p> 1764 </div> 1765 1766 <!-- 3 Spaces --> 1767 <div style="margin: 25px 0;"> 1768 <table cellpadding="0" cellspacing="0" border="0" width="100%"> 1769 <tr> 1770 <td style="padding: 6px 0;"> 1771 <div style="background: rgba(212,175,55,0.08); border: 1px solid rgba(212,175,55,0.2); border-radius: 12px; padding: 14px 18px;"> 1772 <table cellpadding="0" cellspacing="0"><tr> 1773 <td style="vertical-align: middle; padding-right: 12px;"><span style="font-size: 24px;">â¤ï¸</span></td> 1774 <td><span style="color: #D4AF37; font-weight: 700; font-size: 14px;">MEET EROS</span> <span style="color: #999; font-size: 13px;">â Amour & rencontres sérieuses</span></td> 1775 </tr></table> 1776 </div> 1777 </td> 1778 </tr> 1779 <tr> 1780 <td style="padding: 6px 0;">
1781 <div style="background: rgba(38,166,154,0.08); border: 1px solid rgba(38,166,154,0.2); border-radius: 12px; padding: 14px 18px;"> 1782 <table cellpadding="0" cellspacing="0"><tr> 1783 <td style="vertical-align: middle; padding-right: 12px;"><span style="font-size: 24px;">ð¤</span></td> 1784 <td><span style="color: #26A69A; font-weight: 700; font-size: 14px;">MEET FRIEND</span> <span style="color: #999; font-size: 13px;">â Amitié & sorties de groupe</span></td> 1785 </tr></table> 1786 </div> 1787 </td> 1788 </tr> 1789 <tr> 1790 <td style="padding: 6px 0;"> 1791 <div style="background: rgba(255,51,51,0.08); border: 1px solid rgba(255,51,51,0.2); border-radius: 12px; padding: 14px 18px;"> 1792 <table cellpadding="0" cellspacing="0"><tr> 1793 <td style="vertical-align: middle; padding-right: 12px;"><span style="font-size: 24px;">ð¥</span></td> 1794 <td><span style="color: #ff3333; font-weight: 700; font-size: 14px;">MEET EROX</span> <span style="color: #999; font-size: 13px;">â Désirs & rencontres décomplexées</span></td> 1795 </tr></table> 1796 </div> 1797 </td> 1798 </tr> 1799 </table> 1800 </div> 1801 1802 <div style="background: #111118; border-radius: 12px; padding: 18px; border-left: 4px solid #22c55e; margin: 20px 0;"> 1803 <p style="color: #22c55e; font-weight: 700; margin: 0 0 6px; font-size: 14px;">ð Bonus de bienvenue</p> 1804 <p style="color: #ccc; margin: 0; font-size: 14px; line-height: 1.6;"> 1805 En vous inscrivant via cette invitation, vous recevrez des <strong style="color: #D4AF37;">MEETips bonus</strong> pour bien démarrer votre aventure ! 1806 </p> 1807 </div> 1808 1809 <div style="text-align: center; margin: 30px 0 10px;"> 1810 <a href="${n}" style="display: inline-block; padding: 16px 40px; background: linear-gradient(135deg, #D4AF37, #AA8A2E); color: #1a1a2e; text-decoration: none; border-radius: 30px; font-weight: bold; font-size: 16px; letter-spacing: 0.5px;"> 1811 Rejoindre MEETapps ð 1812 </a> 1813 </div> 1814 1815 <p style="color: #555; font-size: 12px; text-align: center; margin-top: 20px; line-height: 1.6;"> 1816 Si vous ne connaissez pas ${e}, vous pouvez ignorer cet email. 1817 </p> 1818 `;return io(o,`${e} vous invite sur MEETapps`)},Q7=[{id:"custom",label:"âï¸ Message libre",desc:"Rédigez votre propre message",subject:"",body:""},{id:"welcome",label:"ð Bienvenue",desc:"Présentation complète de MEETapps",subject:"Bienvenue sur MEETapps ! ð",body:"__WELCOME__"},{id:"event",label:"ð Ãvénement",desc:"Annonce d'un événement à venir",subject:"ð Nouvel événement sur MEETapps !",body:`<h2 style="color: #D4AF37; margin-top: 0;">Nouvel Ãvénement ! ð</h2> 1819<p>Un événement exclusif est disponible sur <strong>MEETapps</strong>.</p> 1820<div style="background: #1e1e2a; padding: 20px; border-radius: 12px; border-left: 4px solid #D4AF37; margin: 20px 0;"> 1821 <p style="margin: 5px 0; font-size: 14px; color: #888;">ð DATE</p> 1822 <p style="margin: 0 0 12px; font-weight: bold; color: #fff;">[Date de l'événement]</p> 1823 <p style="margin: 5px 0; font-size: 14px; color: #888;">ð LIEU</p> 1824 <p style="margin: 0 0 12px; font-weight: bold; color: #fff;">[Lieu de l'événement]</p> 1825 <p style="margin: 5px 0; font-size: 14px; color: #888;">ð¬ DESCRIPTION</p> 1826 <p style="margin: 0; color: #ccc;">[Description de l'événement]</p> 1827</div> 1828<p>Les places sont limitées, inscrivez-vous vite !</p>`},{id:"promo",label:"ð Promotion",desc:"Offre spéciale / réduction",subject:"ð Offre spéciale MEETapps !",body:`<h2 style="color: #D4AF37; margin-top: 0;">Offre Exclusive ! ð</h2> 1829<p>Profitez d'une offre limitée réservée aux membres <strong>MEETapps</strong>.</p> 1830<div style="background: linear-gradient(135deg, rgba(212,175,55,0.12), rgba(0,0,0,0.5)); border: 1px solid rgba(212,175,55,0.3); border-radius: 16px; padding: 24px; text-align: center; margin: 20px 0;"> 1831 <h3 style="color: #D4AF37; margin: 0 0 10px; font-size: 24px;">[Votre offre ici]</h3> 1832 <p style="color: #ccc; margin: 0; font-size: 14px;">[Détails et conditions]</p> 1833</div> 1834<p>N'attendez plus, cette offre est valable pour une <strong>durée limitée</strong> !</p>`},{id:"newsletter",label:"ð° Newsletter",desc:"Actualités de la communauté",subject:"ð° Les news MEETapps !",body:`<h2 style="color: #D4AF37; margin-top: 0;">Quoi de neuf ? ð°</h2> 1835<p>Bonjour ! Voici les dernières actualités de la communauté <strong>MEETapps</strong>.</p> 1836 1837<h3 style="color: #F5F5DC; font-size: 16px; margin: 25px 0 10px;">ð Nouveautés</h3> 1838<div style="background: #1e1e2a; padding: 16px; border-radius: 12px; margin-bottom: 15px;"> 1839 <p style="margin: 0; color: #ccc;">[Décrivez les nouvelles fonctionnalités ou mises à jour]</p> 1840</div> 1841 1842<h3 style="color: #F5F5DC; font-size: 16px; margin: 25px 0 10px;">ð Chiffres clés</h3> 1843<div style="background: #1e1e2a; padding: 16px; border-radius: 12px; margin-bottom: 15px;"> 1844 <p style="margin: 0; color: #ccc;">[Stats intéressantes de la communauté]</p> 1845</div> 1846 1847<h3 style="color: #F5F5DC; font-size: 16px; margin: 25px 0 10px;">ð¯ à venir</h3> 1848<div style="background: #1e1e2a; padding: 16px; border-radius: 12px;"> 1849 <p style="margin: 0; color: #ccc;">[Teasez les prochaines features ou événements]</p> 1850</div>`},{id:"beta",label:"ð Beta Testers",desc:"Remerciement des premiers membres",subject:"Personne n'est parfait ! ð",body:`<!-- MASCOT PORTRAIT --> 1851<div style="text-align: center; padding: 10px 0 5px;"> 1852 <img src="https://meetapps.ai/mascot_meetapps.png" alt="L'équipe MEETapps" style="width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 3px solid #D4AF37; box-shadow: 0 4px 20px rgba(212,175,55,0.3);"> 1853 <p style="color: #D4AF37; font-weight: 700; font-size: 15px; margin: 12px 0 2px;">Marc</p> 1854 <p style="color: #888; font-size: 13px; margin: 0;">Co-fondateur, MEETapps</p> 1855</div> 1856 1857<!-- TITRE --> 1858<h1 style="color: #F5F5DC; font-size: 26px; text-align: center; margin: 25px 0 5px; font-weight: 700; letter-spacing: 0.5px;">Personne n'est parfait !</h1> 1859<p style="color: #D4AF37; text-align: center; font-size: 14px; margin: 0 0 25px; font-style: italic;">...et c'est justement pour ça qu'on a besoin de vous.</p> 1860 1861<!-- MESSAGE PRINCIPAL --> 1862<div style="background: linear-gradient(135deg, rgba(212,175,55,0.08), rgba(0,0,0,0.3)); border: 1px solid rgba(212,175,55,0.2); border-radius: 16px; padding: 24px; margin: 20px 0;"> 1863 <p style="color: #d0d0d8; font-size: 15px; line-height: 1.8; margin: 0 0 15px;"> 1864 Bonjour ð, 1865 </p> 1866 <p style="color: #d0d0d8; font-size: 15px; line-height: 1.8; margin: 0 0 15px;">
1867 Avant tout, <strong style="color: #D4AF37;">merci</strong>. Merci d'être parmi les tout premiers à tester <strong>MEETapps.ai</strong>. 1868 </p> 1869 <p style="color: #d0d0d8; font-size: 15px; line-height: 1.8; margin: 0 0 15px;"> 1870 Nous avons lancé le site officieusement il y a quelques jours, et vous faites partie de cette <strong style="color: #D4AF37;">première vague de pionniers</strong>. Oui, c'est encore une version <strong>bêta</strong> â tout n'est pas encore parfait, et c'est normal. 1871 </p> 1872 <p style="color: #d0d0d8; font-size: 15px; line-height: 1.8; margin: 0;"> 1873 Mais grâce à <strong style="color: #D4AF37;">vous</strong>, chaque jour nous corrigeons des petits bugs, améliorons le design, et rendons l'expérience plus fluide et agréable. Vous n'êtes pas juste des utilisateurs â vous êtes nos <strong style="color: #D4AF37;">co-créateurs</strong>. ð 1874 </p> 1875</div> 1876 1877<!-- SÃPARATEUR --> 1878<div style="border-top: 1px solid #2a2a3a; margin: 30px 0;"></div> 1879 1880<!-- CE QUE VOUS POUVEZ FAIRE --> 1881<h2 style="color: #F5F5DC; font-size: 18px; text-align: center; margin-bottom: 5px;">⨠Ce que MEETapps vous offre</h2> 1882<p style="color: #666; font-size: 13px; text-align: center; margin-bottom: 20px;">Un seul compte, trois univers de rencontres</p> 1883 1884<!-- EROS --> 1885<div style="background: linear-gradient(135deg, rgba(212,175,55,0.08), rgba(0,0,0,0.3)); border: 1px solid rgba(212,175,55,0.2); border-radius: 14px; padding: 16px 20px; margin-bottom: 10px;"> 1886 <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr> 1887 <td width="40" valign="top"><div style="width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #D4AF37, #AA8A2E); text-align: center; line-height: 36px; font-size: 18px;">â¤ï¸</div></td> 1888 <td style="padding-left: 12px;"><span style="color: #D4AF37; font-weight: 700; font-size: 14px;">MEET EROS</span> <span style="color: #999; font-size: 13px;">â Amour & rencontres sérieuses</span></td> 1889 </tr></table> 1890</div> 1891 1892<!-- FRIEND --> 1893<div style="background: linear-gradient(135deg, rgba(38,166,154,0.08), rgba(0,0,0,0.3)); border: 1px solid rgba(38,166,154,0.2); border-radius: 14px; padding: 16px 20px; margin-bottom: 10px;"> 1894 <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr> 1895 <td width="40" valign="top"><div style="width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #26A69A, #00695C); text-align: center; line-height: 36px; font-size: 18px;">ð¤</div></td> 1896 <td style="padding-left: 12px;"><span style="color: #26A69A; font-weight: 700; font-size: 14px;">MEET FRIEND</span> <span style="color: #999; font-size: 13px;">â Amitié, sorties & entraide</span></td> 1897 </tr></table> 1898</div> 1899 1900<!-- EROX --> 1901<div style="background: linear-gradient(135deg, rgba(255,51,51,0.08), rgba(0,0,0,0.3)); border: 1px solid rgba(255,51,51,0.2); border-radius: 14px; padding: 16px 20px; margin-bottom: 10px;"> 1902 <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr> 1903 <td width="40" valign="top"><div style="width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #ff3333, #880000); text-align: center; line-height: 36px; font-size: 18px;">ð¥</div></td> 1904 <td style="padding-left: 12px;"><span style="color: #ff3333; font-weight: 700; font-size: 14px;">MEET EROX</span> <span style="color: #999; font-size: 13px;">â Rencontres décomplexées entre adultes</span></td> 1905 </tr></table> 1906</div> 1907 1908<!-- FONCTIONNALITÃS CLÃS --> 1909<div style="background: #111118; border-radius: 14px; padding: 20px; border: 1px solid #2a2a3a; margin: 20px 0;"> 1910 <table cellpadding="0" cellspacing="0" border="0" width="100%"> 1911 <tr><td style="padding: 8px 0;" valign="top"><span style="font-size: 18px;">ð</span></td><td style="padding: 8px 0 8px 12px;"><span style="color: #F5F5DC; font-size: 14px; font-weight: 600;">Cadeaux holographiques 3D</span><span style="color: #888; font-size: 13px;"> â Offrez des cadeaux animés pour vous démarquer</span></td></tr> 1912 <tr><td style="padding: 8px 0;" valign="top"><span style="font-size: 18px;">ðºï¸</span></td><td style="padding: 8px 0 8px 12px;"><span style="color: #F5F5DC; font-size: 14px; font-weight: 600;">Carte interactive</span><span style="color: #888; font-size: 13px;"> â Trouvez les membres près de chez vous</span></td></tr> 1913 <tr><td style="padding: 8px 0;" valign="top"><span style="font-size: 18px;">ð¤</span></td><td style="padding: 8px 0 8px 12px;"><span style="color: #F5F5DC; font-size: 14px; font-weight: 600;">Matching IA</span><span style="color: #888; font-size: 13px;"> â Notre IA analyse vos affinités pour des connexions authentiques</span></td></tr> 1914 <tr><td style="padding: 8px 0;" valign="top"><span style="font-size: 18px;">ð¤</span></td><td style="padding: 8px 0 8px 12px;"><span style="color: #F5F5DC; font-size: 14px; font-weight: 600;">Bio vocale</span><span style="color: #888; font-size: 13px;"> â Ajoutez une touche personnelle avec votre voix</span></td></tr> 1915 <tr><td style="padding: 8px 0;" valign="top"><span style="font-size: 18px;">ð</span></td><td style="padding: 8px 0 8px 12px;"><span style="color: #F5F5DC; font-size: 14px; font-weight: 600;">Ãvénements exclusifs</span><span style="color: #888; font-size: 13px;"> â Organisez et participez à des rencontres IRL</span></td></tr> 1916 </table> 1917</div> 1918 1919<!-- SÃPARATEUR --> 1920<div style="border-top: 1px solid #2a2a3a; margin: 30px 0;"></div> 1921 1922<!-- CADEAU : CODE PROMO --> 1923<h2 style="color: #F5F5DC; font-size: 18px; text-align: center; margin-bottom: 5px;">ð Notre cadeau pour vous remercier</h2> 1924<p style="color: #666; font-size: 13px; text-align: center; margin-bottom: 20px;">Parce que les premiers méritent le meilleur</p> 1925 1926<div style="background: linear-gradient(135deg, rgba(212,175,55,0.15), rgba(170,138,46,0.08)); border: 2px solid rgba(212,175,55,0.4); border-radius: 20px; padding: 30px; text-align: center; margin: 20px 0;"> 1927 <p style="color: #D4AF37; font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; margin: 0 0 10px;">Code exclusif</p> 1928 <div style="background: #0a0a0f; border: 2px dashed #D4AF37; border-radius: 14px; padding: 16px 30px; display: inline-block; margin: 0 0 15px;">
1929 <span style="color: #D4AF37; font-size: 28px; font-weight: 800; letter-spacing: 4px; font-family: monospace;">BIENVENUE20</span> 1930 </div> 1931 <p style="color: #F5F5DC; font-size: 18px; font-weight: 700; margin: 0 0 5px;">+20 MEETips offerts ! ð</p> 1932 <p style="color: #888; font-size: 13px; margin: 0;">Entrez ce code dans votre profil pour recevoir vos MEETips bonus</p> 1933</div> 1934 1935<!-- SÃPARATEUR --> 1936<div style="border-top: 1px solid #2a2a3a; margin: 30px 0;"></div> 1937 1938<!-- PARRAINEZ VOS AMIS --> 1939<h2 style="color: #F5F5DC; font-size: 18px; text-align: center; margin-bottom: 5px;">ð¥ Parrainez vos amis</h2> 1940<p style="color: #666; font-size: 13px; text-align: center; margin-bottom: 20px;">Gagnez encore plus de MEETips</p> 1941 1942<div style="background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(0,0,0,0.3)); border: 1px solid rgba(16,185,129,0.25); border-radius: 16px; padding: 22px; margin: 20px 0;"> 1943 <p style="color: #d0d0d8; font-size: 14px; line-height: 1.7; margin: 0 0 12px;"> 1944 Invitez vos amis à rejoindre <strong>MEETapps</strong> grâce à votre <strong style="color: #10b981;">lien de parrainage</strong> (disponible dans votre profil). 1945 </p> 1946 <p style="color: #d0d0d8; font-size: 14px; line-height: 1.7; margin: 0;"> 1947 Pour chaque ami inscrit, vous recevez tous les deux des <strong style="color: #D4AF37;">MEETips bonus</strong>
1947. Plus vous parrainez, plus vous gagnez ! ð 1948 </p> 1949</div> 1950 1951<!-- SÃPARATEUR --> 1952<div style="border-top: 1px solid #2a2a3a; margin: 30px 0;"></div> 1953 1954<!-- VOTRE AVIS COMPTE --> 1955<div style="background: linear-gradient(135deg, rgba(139,92,246,0.10), rgba(0,0,0,0.4)); border: 1px solid rgba(139,92,246,0.3); border-radius: 16px; padding: 24px; text-align: center; margin: 20px 0;"> 1956 <div style="width: 60px; height: 60px; border-radius: 50%; background: rgba(139,92,246,0.15); margin: 0 auto 16px; text-align: center; line-height: 60px; font-size: 28px;">ð¬</div> 1957 <h3 style="color: #F5F5DC; font-size: 17px; margin: 0 0 10px;">Votre avis compte énormément</h3> 1958 <p style="color: #bbb; font-size: 14px; line-height: 1.7; margin: 0 0 15px;"> 1959 Un bug ? Une idée d'amélioration ? Une fonctionnalité que vous aimeriez voir ?<br> 1960 <strong style="color: #8b5cf6;">On vous écoute.</strong> Vraiment. 1961 </p> 1962 <a href="mailto:[email protected]" style="display: inline-block; padding: 12px 28px; background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: white; text-decoration: none; border-radius: 25px; font-weight: 700; font-size: 14px; letter-spacing: 0.3px;"> 1963 âï¸ Ãcrivez-nous : [email protected] 1964 </a> 1965</div> 1966 1967<!-- MESSAGE DE FIN --> 1968<div style="text-align: center; padding: 20px 0 10px;"> 1969 <p style="color: #d0d0d8; font-size: 15px; line-height: 1.8; margin: 0 0 5px;"> 1970 Nous avons <strong style="color: #D4AF37;">besoin de vous</strong> pour construire la meilleure plateforme de rencontres possible. 1971 </p> 1972 <p style="color: #888; font-size: 14px; margin: 0 0 25px;"> 1973 Ensemble, on va faire quelque chose d'extraordinaire. ð 1974 </p> 1975 <p style="color: #888; font-size: 14px; font-style: italic; margin: 0;">â L'équipe MEETapps</p> 1976</div>`},{id:"meetblog",label:"ð MEETblog",desc:"Dernier article du blog",subject:"ð MEETblog : Article de la semaine",body:"__MEETBLOG__"}];function g5(){try{return localStorage.getItem("meeteros_email_alerts")!=="false"}catch{return!0}}function MS(e){try{localStorage.setItem("meeteros_email_alerts",e?"true":"false")}catch{}}const ci=async({toUserId:e,toEmail:r,subject:i,html:n})=>{try{const o={subject:i,html:n};if(e&&(o.toUserId=e),r&&(o.toEmail=r),!e&&!r)throw new Error("Mu
1976st provide toUserId or toEmail");let a,l;try{const d=await D.functions.invoke("send-email",{body:o});a=d.data,l=d.error}catch(d){console.warn("supabase.functions.invoke threw, will try direct fetch:",d.message),l=d}if(l){console.warn("supabase.functions.invoke error, using direct fetch fallback:",l.message||l);const d="https://bqfzljnhxblhiabyvpqm.supabase.co",p="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4",u=await fetch(`${d}/functions/v1/send-email`,{method:"POST",headers:{"Content-Type":"application/json",apikey:p,Authorization:`Bearer ${p}`},body:JSON.stringify(o)});a=await u.json(),l=u.ok?null:a}if(l)throw l;return console.log("Email sent successfully:",a),{success:!0,data:a}}catch(o){return console.error("Failed to send email:",o),{success:!1,error:o}}},eP=async(e,r,i,n)=>{if(!g5())return console.log("ð§ Email alerts disabled â skipping match notification"),{success:!0,skipped:!0};const o=xx(r,i,n);return ci({toUserId:e,subject:"C'est un match ! ð¥",html:o})},tP=async(e,r,i,n)=>{const o=AS(r,i,n);return ci({toUserId:e,subject:`Nouvelle demande pour ${r}`,html:o})},rP=async e=>{const r=window.location.origin,i={toEmail:e,subject:"Réinitialisation de votre mot de passe",html:q7(),action:"reset_password",origin:r},{data:n,error:o}=await D.functions.invoke("send-email",{body:i});if(o)throw o;return n},DS=async(e,r,i)=>{const n=H7(i);return ci({toUserId:e,toEmail:r,subject:"Suspension de votre compte ð",html:n})},BS=async(e,r,i,n)=>{const o=G7(i,n);return ci({toUserId:e,toEmail:r,subject:"Avertissement important â ï¸",html:o})},OS=async(e,r,i)=>{const n=J7(i);return ci({toUserId:e,toEmail:r,subject:"Action requise : Compte restreint ð",html:n})},LS=async(e,r)=>{const i=Z7();return ci({toUserId:e,toEmail:r,subject:"Compte réhabilité ! â ",html:i})},$S=async(e,r)=>{const i=Y7();return ci({toUserId:e,toEmail:r,subject:"Félicitations ! Profil vérifié ð¡ï¸",html:i})},WS=async(e,r,i)=>{const n=X7(i);return ci({toUserId:e,toEmail:r,subject:"Vérification : Nouvelle tentative requise ð¸",html:n})},iP=async(e,r)=>{var d;const i=new Date(r.date),n=i.toLocaleDateString("fr-FR",{weekday:"long",day:"numeric",month:"long",year:"numeric"}),o=i.toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"}),a=((d=r.creator)==null?void 0:d.name)||"l'organisateur",l=PS(r.title,n,o,r.location||r.address||"à confirmer",r.image_url||null,r.mode||"eros",a);return ci({toUserId:e,subject:`Inscription confirmée : ${r.title} ð«`,html:l})},nP=async(e,r,i)=>{const o=new Date(r.date).toLocaleDateString("fr-FR",{weekday:"long",day:"numeric",month:"long"}),a=FS(r.title,o,(i==null?void 0:i.name)||"l'organisateur",(i==null?void 0:i.avatar_url)||(i==null?void 0:i.photo)||null,r.mode||"eros",r.id);return ci({toUserId:e,subject:`Comment était "${r.title}" ? â`,html:a})},oP=async(e,r,i)=>{const n=Ih(i);return ci({toUserId:e,toEmail:r,subject:"Bienvenue sur MEETapps ! ð",html:n})},NS=async(e,r)=>{var l;const i=new Date(r.published_at).toLocaleDateString("fr-FR",{day:"numeric",month:"long",year:"numeric"}),n=`https://meeteros.ai/blog/${r.slug}`,o=r.excerpt||((l=r.content)==null?void 0:l.slice(0,200))+"...",a=` 1977 <div style="font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; max-width: 600px; margin: 0 auto; background: #0a0815; border-radius: 16px; overflow: hidden;"> 1978 <!-- Header --> 1979 <div style="background: linear-gradient(135deg, #1a1a2e, #16213e); padding: 28px 24px; text-align: center;"> 1980 <h1 style="margin: 0; font-size: 28px; font-weight: 900;"> 1981 <span style="color: #FFD700;">MEET</span><span style="color: white;">blog</span> 1982 </h1> 1983 <p style="color: rgba(255,255,255,0.4); font-size: 13px; margin: 6px 0 0;">L'article de la semaine</p> 1984 </div> 1985 1986 <!-- Cover Image --> 1987 ${r.cover_image_url?`<img src="${r.cover_image_url}" alt="${r.title}" style="width: 100%; height: 240px; object-fit: cover;" />`:""} 1988 1989 <!-- Article Content --> 1990 <div style="padding: 28px 24px;">
1991 <span style="background: rgba(255,215,0,0.15); color: #FFD700; padding: 4px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; text-transform: capitalize;">${r.category||"rencontres"}</span> 1992 <span style="color: rgba(255,255,255,0.3); font-size: 12px; margin-left: 8px;">${i}</span> 1993 1994 <h2 style="color: white; font-size: 22px; font-weight: 800; margin: 16px 0 12px; line-height: 1.3;">${r.title}</h2> 1995 1996 <p style="color: rgba(255,255,255,0.6); font-size: 15px; line-height: 1.6; margin: 0 0 24px;">${o}</p> 1997 1998 <!-- CTA Button --> 1999 <div style="text-align: center;"> 2000 <a href="${n}" style="display: inline-block; background: linear-gradient(135deg, #FFD700, #FFA500); color: #0a0815; text-decoration: none; padding: 14px 32px; border-radius: 12px; font-weight: 800; font-size: 15px;"> 2001 ð Lire l'article complet 2002 </a> 2003 </div> 2004 </div> 2005 2006 <!-- Footer --> 2007 <div style="padding: 20px 24px; text-align: center; border-top: 1px solid rgba(255,255,255,0.06);"> 2008 <a href="https://meeteros.ai/blog" style="color: #FFD700; text-decoration: none; font-size: 13px; font-weight: 600;">Voir tous les articles â</a> 2009 <p style="color: rgba(255,255,255,0.2); font-size: 11px; margin: 12px 0 0;">MEETEros â L'art de la rencontre</p> 2010 </div> 2011 </div> 2012 `;return ci({toEmail:e,subject:`ð MEETblog : ${r.title}`,html:a})},na=Object.freeze(Object.defineProperty({__proto__:null,isEmailAlertEnabled:g5,sendBanNotification:DS,sendBlogNewsletter:NS,sendEmail:ci,sendEventWelcome:iP,sendMatchNotification:eP,sendParticipationRequest:tP,sendPasswordReset:rP,sendPostEventRating:nP,sendRestorationNotification:LS,sendRestrictionNotification:OS,sendVerificationRejectedNotification:WS,sendVerificationSuccessNotification:$S,sendWarningNotification:BS,sendWelcomeEmail:oP,setEmailAlertEnabled:MS},Symbol.toStringTag,{value:"Module"})),sP=({event:e,onClose:r})=>{var N,Z,ae;const i=si(),[n,o]=m.useState({approved:[],pending:[]}),[a,l]=m.useState(null),[d,p]=m.useState(null),[u,g]=m.useState(!0),[h,x]=m.useState(null),[y,_]=m.useState(null),[S,k]=m.useState(""),[w,b]=m.useState(!1),[j,T]=m.useState(!1),[P,I]=m.useState(""),[R,O]=m.useState(!1),[E,$]=m.useState(!1),[B,ee]=m.useState(""),[te,K]=m.useState(""),[ne,Re]=m.useState(!1),Q=async()=>{x(null);try{const{data:X,error:he}=await D.from("event_participants").select("*").eq("event_id",e.id);if(he)throw he;if(!X||X.length===0){o({approved:[],pending:[]});return}const Ae=X.map(Ce=>Ce.user_id),{data:ze,error:ue}=await D.from("profiles").select("id, name, photo, avatar_url").in("id",Ae);if(ue)throw ue;const xe=X.map(Ce=>{const Me=ze==null?void 0:ze.find(Le=>Le.id===Ce.user_id);return{...Ce,user:Me||{name:"Utilisateur inconnu",photo:null}}}),ke=xe.filter(Ce=>Ce.status==="approved"),Pe=xe.filter(Ce=>Ce.status==="pending");o({approved:ke,pending:Pe})}catch(X){console.error(X),x(X.message)}finally{g(!1)}};m.useEffect(()=>{Q()},[e]);const G=async(X,he)=>{try{const{error:Ae}=await D.from("event_participants").update({status:he}).eq("id",X);if(Ae)throw Ae;if(Q(),he==="approved"){const ze=[...n.pending,...n.approved].find(ue=>ue.id===X);ze&&ze.user_id&&Wr(async()=>{const{sendEventWelcome:ue}=await Promise.resolve().then(()=>na);return{sendEventWelcome:ue}},void 0).then(({sendEventWelcome:ue})=>{ue(ze.user_id,e).catch(console.error)})}}catch(Ae){console.error(Ae),i.error("Erreur lors de la mise à jour")}},le=async()=>{var X,he;if(y){b(!0);try{const{error:Ae}=await D.from("event_participants").update({status:"rejected"}).eq("id",y.id);if(Ae)throw Ae;y.user_id&&S.trim()&&await ci({toUserId:y.user_id,subject:`Participation refusée : ${e.title}`,html:` 2013 <div style="font-family: 'Outfit', sans-serif; background: #1a1a2e; color: white; padding: 30px; border-radius: 15px;"> 2014 <h2 style="color: #FFD700;">Participation refusée</h2> 2015 <p>
2015Bonjour ${((X=y.user)==null?void 0:X.name)||""},</p> 2016 <p>Votre participation à l'événement <strong>"${e.title}"</strong> a été refusée par l'organisateur.</p> 2017 <div style="background: rgba(255,77,77,0.1); border: 1px solid rgba(255,77,77,0.3); border-radius: 10px; padding: 15px; margin: 15px 0;"> 2018 <strong style="color: #ff4d4d;">Motif :</strong><br/> 2019 <p style="margin: 8px 0 0; color: #ccc;">${S}</p> 2020 </div> 2021 <p style="color: #888; font-size: 0.9rem;">N'hésitez pas à consulter d'autres événements disponibles sur la plateforme.</p> 2022 </div> 2023 `}),i.success(`${(he=y.user)==null?void 0:he.name} a été refusé(e)`),_(null),k(""),Q()}catch(Ae){console.error(Ae),i.error("Erreur lors du refus")}finally{b(!1)}}},F=async X=>{var ze,ue;const he=prompt(`Sujet du mail pour ${(ze=X.user)==null?void 0:ze.name} :`,`à propos de "${e.title}"`);if(!he)return;const Ae=prompt("Contenu du message :");if(Ae)try{await ci({toUserId:X.user_id,subject:he,html:` 2024 <div style="font-family: 'Outfit', sans-serif; background: #1a1a2e; color: white; padding: 30px; border-radius: 15px;"> 2025 <h2 style="color: #FFD700;">${e.title}</h2> 2026 <p>${Ae.replace(/\n/g,"<br/>")}</p> 2027 <hr style="border-color: rgba(255,255,255,0.1); margin: 20px 0;" /> 2028 <p style="color: #888; font-size: 0.85rem;">â L'organisateur de l'événement</p> 2029 </div> 2030 `}),i.success(`Mail envoyé à ${(ue=X.user)==null?void 0:ue.name}`)}catch{i.error("Erreur d'envoi")}},A=async()=>{if(P.trim()){O(!0);try{for(const X of n.approved)await D.from("messages").insert({sender_id:e.creator_id,receiver_id:X.user_id,content:P,event_id:e.id});i.success(`Message envoyé à ${n.approved.length} participant(s) !`),T(!1),I("")}catch(X){console.error(X),i.error("Erreur lors de l'envoi des messages")}finally{O(!1)}}},M=async()=>{if(!(!B.trim()||!te.trim())){Re(!0);try{for(const X of n.approved)await ci({toUserId:X.user_id,subject:B,html:` 2031 <div style="font-family: 'Outfit', sans-serif; background: #1a1a2e; color: white; padding: 30px; border-radius: 15px;"> 2032 <h2 style="color: #FFD700;">${e.title}</h2> 2033 <p>${te.replace(/\n/g,"<br/>")}</p> 2034 <hr style="border-color: rgba(255,255,255,0.1); margin: 20px 0;" /> 2035 <p style="color: #888; font-size: 0.85rem;">â L'organisateur de l'événement</p> 2036 </div> 2037 `});i.success(`Email envoyé à ${n.approved.length} participant(s) !`),$(!1),ee(""),K("")}catch(X){console.error(X),i.error("Erreur lors de l'envoi des emails")}finally{Re(!1)}}},V=()=>{const X=e.date?new Date(e.date).toLocaleDateString("fr-FR",{weekday:"long",day:"numeric",month:"long",year:"numeric"}):"â",he=e.date?new Date(e.date).toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"}):"",Ae=[...n.approved,...n.pending],ze=window.open("","_blank");ze.document.write(` 2038<!DOCTYPE html> 2039<html> 2040<head> 2041<meta charset="utf-8"> 2042<title>Fiche d'accueil â ${e.title}</title> 2043<style> 2044 @import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;800&display=swap'); 2045 * { margin: 0; padding: 0; box-sizing: border-box; } 2046 body { 2047 font-family: 'Outfit', sans-serif; 2048 background: white; color: #1a1a2e; 2049 padding: 30px 40px; 2050 -webkit-print-color-adjust: exact !important; 2051 print-color-adjust: exact !important; 2052 } 2053 @media print { 2054 body { padding: 20px; } 2055 .no-print { display: none !important; } 2056 } 2057 2058 /* Header */ 2059 .header { 2060 background: linear-gradient(135deg, #1a1a2e, #2a1a4e); 2061 color: white; padding: 28px 32px; 2062 border-radius: 16px; margin-bottom: 24px; 2063 position: relative; overflow: hidden; 2064 } 2065 .header::after { 2066 content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; 2067 background: linear-gradient(90deg, #FFD700, #FFA000, #FFD700); 2068 } 2069 .header h1 { 2070 font-size: 1.8rem; font-weight: 800; 2071 margin-bottom: 6px; 2072 } 2073 .header .gold { color: #FFD700; } 2074 .event-meta { 2075 display: flex; gap: 24px; margin-top: 12px; 2076 flex-wrap: wrap; 2077 } 2078 .meta-item { 2079 font-size: 0.95rem; opacity: 0.9; 2080 display: flex; align-items: center; gap: 6px; 2081 } 2082 .meta-item .label { font-weight: 600; color: #FFD700; } 2083 2084 /* Stats bar */ 2085 .stats-bar { 2086 display: flex; gap: 12px; margin-bottom: 24px; 2087 } 2088 .stat-box { 2089 flex: 1; background: #f8f7ff; border: 1px solid #e0dff5; 2090 border-radius: 12px; padding: 14px 18px; text-align: center; 2091 } 2092 .stat-box .num { 2093 font-size: 1.8rem; font-weight: 800; color: #1a1a2e; 2094 } 2095 .stat-box .txt { 2096 font-size: 0.78rem; color: #888; 2097 text-transform: uppercase; letter-spacing: 1px; 2098 } 2099 .stat-box.gold { border-color: #FFD700; background: #FFFDE0; } 2100 .stat-box.gold .num { color: #B8860B; } 2101 .stat-box.green { border-color: #4CAF50; background: #F0FFF0; } 2102 .stat-box.green .num { color: #2E7D32; } 2103 2104 /* Table */ 2105 .table-section { 2106 margin-bottom: 24px; 2107 } 2108 .table-section h2 { 2109 font-size: 0.85rem; text-transform: uppercase; 2110 letter-spacing: 1.5px; color: #888; 2111 border-bottom: 2px solid #1a1a2e; padding-bottom: 8px; 2112 margin-bottom: 0; 2113 } 2114 table { 2115 width: 100%; border-collapse: collapse; 2116 } 2117 th { 2118 background: #1a1a2e; color: white; 2119 font-size: 0.78rem; text-transform: uppercase; 2120 letter-spacing: 1px; padding: 10px 14px; 2121 text-align: left; 2122 } 2123 th:last-child, td:last-child { text-align: center; } 2124 td { 2125 padding: 12px 14px; border-bottom: 1px solid #eee; 2126 font-size: 0.92rem; 2127 } 2128 tr:nth-child(even) td { background: #fafafa; } 2129 .checkbox-cell { 2130 width: 28px; height: 28px; 2131 border: 2px solid #1a1a2e; border-radius: 6px; 2132 display: inline-block; 2133 } 2134 .status-badge { 2135 display: inline-block; padding: 3px 10px; 2136 border-radius: 20px; font-size: 0.75rem; font-weight: 600; 2137 } 2138 .status-approved { background: #E8F5E9; color: #2E7D32; } 2139 .status-pending { background: #FFF3E0; color: #E65100; } 2140 .space-badge { 2141 display: inline-block; padding: 2px 8px; 2142 border-radius: 12px; font-size: 0.7rem; font-weight: 600; 2143 } 2144 .space-eros { background: #FFF8E1; color: #B8860B; } 2145 .space-friend { background: #E0F2F1; color: #00796B; } 2146 .space-erox { background: #FFEBEE; color: #C62828; } 2147 2148 /* Notes */ 2149 .notes-section { 2150 border: 2px dashed #ddd; border-radius: 12px; 2151 padding: 20px; margin-top: 8px; 2152 } 2153 .notes-section h3 { 2154 font-size: 0.85rem; text-transform: uppercase; 2155 letter-spacing: 1.5px; color: #888; 2156 margin-bottom: 12px; 2157 } 2158 .note-lines { 2159 border-bottom: 1px solid #eee; 2160 height: 32px; 2161 } 2162 2163 /* Footer */ 2164 .footer { 2165 margin-top: 24px; text-align: center; 2166 color: #bbb; font-size: 0.75rem; 2167 border-top: 1px solid #eee; padding-top: 12px; 2168 } 2169 2170 /* Print button */ 2171 .print-btn { 2172 position: fixed; bottom: 30px; right: 30px; 2173 background: linear-gradient(135deg, #1a1a2e, #2a1a4e); 2174 color: #FFD700; border: none; 2175 padding: 14px 28px; border-radius: 30px; 2176 font-family: 'Outfit', sans-serif; 2177 font-size: 1rem; font-weight: 700; 2178 cursor: pointer; box-shadow: 0 8px 25px rgba(0,0,0,0.3); 2179 display: flex; align-items: center; gap: 8px; 2180 } 2181</style> 2182</head> 2183<body> 2184 2185 <div class="header"> 2186 <h1>${e.title}</h1> 2187 <div class="event-meta"> 2188 <div class="meta-item"><span class="label">ð Date :</span> ${X}</div> 2189 ${he?`<div class="meta-item"><span class="label">ð Heure :</span> ${he}</div>`:""} 2190 ${e.address?`<div class="meta-item"><span class="label">ð Lieu :</span> ${e.address}</div>`:""} 2191 </div> 2192 ${e.description?`<p style="margin-top: 14px; font-size: 0.9rem; opacity: 0.8; line-height: 1.5;">${e.description}</p>`:""} 2193 </div> 2194 2195 <div class="stats-bar"> 2196 <div class="stat-box gold"> 2197 <div class="num">${Ae.length}</div> 2198 <div class="txt">Total inscrits</div> 2199 </div> 2200 <div class="stat-box green"> 2201 <div class="num">${n.approved.length}</div> 2202 <div class="txt">Validés</div> 2203 </div> 2204 <div class="stat-box"> 2205 <div class="num">${n.pending.length}</div> 2206 <div class="txt">En attente</div> 2207 </div> 2208 </div> 2209 2210 <div class="table-section"> 2211 <h2>Liste des participants â Feuille d'émargement</h2> 2212 <table> 2213 <thead> 2214 <tr> 2215 <th style="width: 40px;">#</th> 2216 <th>Nom</th> 2217 <th style="width: 90px;">Espace</th> 2218 <th style="width: 100px;">Statut</th> 2219 <th style="width: 80px;">Présent</th> 2220 <th style="width: 80px;">Heure</th> 2221 <th style="width: 100px;">Signature</th> 2222 </tr> 2223 </thead> 2224 <tbody> 2225 ${Ae.map((ue,xe)=>{var Me;const ke=ue.joined_from||"eros",Pe=ke==="erox"?"ð¥ Erox":ke==="friend"?"ð¥ Friend":"â¤ï¸ Eros",Ce=ke==="erox"?"space-erox":ke==="friend"?"space-friend":"space-eros";return` 2226 <tr> 2227 <td style="font-weight: 700; color: #888;">${xe+1}</td> 2228 <td style="font-weight: 600;">${((Me=ue.user)==null?void 0:Me.name)||"Inconnu"}</td> 2229 <td><span class="space-badge ${Ce}">${Pe}</span></td> 2230 <td><span class="status-badge ${ue.status==="approved"?"status-approved":"status-pending"}">${ue.status==="approved"?"â Validé":"â³ Attente"}</span></td> 2231 <td style="text-align: center;"><div class="checkbox-cell"></div></td> 2232 <td></td> 2233 <td></td> 2234 </tr> 2235 `}).join("")} 2236 </tbody> 2237 </table> 2238 </div> 2239 2240 <div class="notes-section"> 2241 <h3>ð Notes de l'organisateur</h3> 2242 <div class="note-lines"></div> 2243 <div class="note-lines"></div> 2244 <div class="note-lines"></div> 2245 <div class="note-lines"></div> 2246 <div class="note-lines"></div> 2247 </div> 2248 2249 <div class="footer"> 2250 Fiche générée le ${new Date().toLocaleDateString("fr-FR",{day:"numeric",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"})} 2251 â MeetYou 2252 </div> 2253 2254 <button class="print-btn no-print" onclick="window.print()"> 2255 ð¨ï¸ Imprimer / Sauvegarder en PDF 2256 </button> 2257 2258</body> 2259</html> 2260 `),ze.document.close()},H=({icon:X,color:he,title:Ae,onClick:ze,size:ue=15})=>t.jsx("button",{onClick:xe=>{xe.stopPropagation(),ze()},title:Ae,style:{background:`${he}15`,border:`1px solid ${he}30`,borderRadius:"8px",width:"34px",height:"34px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:he,transition:"all 0.2s"},onMouseEnter:xe=>{xe.currentTarget.style.background=`${he}30`},onMouseLeave:xe=>{xe.currentTarget.style.background=`${he}15`},children:t.jsx(X,{size:ue})});return t.jsxs("div",{style:{position:"fixed",inset:0,zIndex:2e3,background:"rgba(0,0,0,0.8)",display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:"blur(5px)"},children:[t.jsxs("div",{className:"glass-panel",style:{width:"90%",maxWidth:"550px",maxHeight:"85vh",display:"flex",flexDirection:"column",background:"#1a1a2e",border:"1px solid rgba(255,255,255,0.1)"},children:[t.jsxs("div",{style:{padding:"20px",borderBottom:"1px solid rgba(255,255,255,0.1)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t.jsx("h3",{style:{margin:0,fontSize:"1.2rem"},children:"Gestion des Inscrits"}),t.jsx("button",{onClick:r,style:{background:"none",border:"none",color:"white",cursor:"pointer"},children:t.jsx(mt,{size:24})})]}),n.approved.length>0&&t.jsxs("div",{style:{padding:"12px 20px",borderBottom:"1px solid rgba(255,255,255,0.06)",display:"flex",gap:"10px",flexWrap:"wrap"},children:[t.jsxs("button",{onClick:()=>T(!0),style:{flex:1,minWidth:"180px",background:"rgba(138,43,226,0.12)",border:"1px solid rgba(138,43,226,0.25)",color:"#a85
22605f7",padding:"10px 16px",borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",cursor:"pointer",fontSize:"0.85rem",fontWeight:"600",transition:"all 0.2s"},children:[t.jsx(Qt,{size:16})," Message à tous"]}),t.jsxs("button",{onClick:()=>{ee(`Info : ${e.title}`),$(!0)},style:{flex:1,minWidth:"180px",background:"rgba(255,215,0,0.08)",border:"1px solid rgba(255,215,0,0.2)",color:"#FFD700",padding:"10px 16px",borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",cursor:"pointer",fontSize:"0.85rem",fontWeight:"600",transition:"all 0.2s"},children:[t.jsx(Vr,{size:16})," Mail à tous"]}),t.jsxs("button",{onClick:V,style:{flex:1,minWidth:"140px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.15)",color:"white",padding:"10px 16px",borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",cursor:"pointer",fontSize:"0.85rem",fontWeight:"600",transition:"all 0.2s"},children:[t.jsx(LA,{size:16})," Fiche PDF"]})]}),t.jsxs("div",{className:"custom-scrollbar",style:{flex:1,overflowY:"auto",padding:"20px"},children:[h&&t.jsxs("div",{style:{padding:"15px",background:"rgba(255,0,0,0.1)",border:"1px solid rgba(255,0,0,0.3)",color:"#ff4d4d",borderRadius:"10px",marginBottom:"20px",fontSize:"0.9rem"},children:["Erreur de chargement : ",h]}),n.pending.length>0&&t.jsxs("div",{style:{marginBottom:"30px"},children:[t.jsxs("h4",{style:{color:"var(--gold)",marginBottom:"15px",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(Sr,{size:16})," En attente de validation (",n.pending.length,")"]}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:n.pending.map(X=>{var he,Ae,ze,ue;return t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",background:"rgba(255,255,255,0.05)",padding:"12px",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.06)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer",flex:1},onClick:()=>l(X.user_id),title:"Voir le profil",children:[t.jsx("img",{src:((he=X.user)==null?void 0:he.avatar_url)||((Ae=X.user)==null?void 0:Ae.photo)||"https://via.placeholder.com/40",alt:(ze=X.user)==null?void 0:ze.name,style:{width:"40px",height:"40px",borderRadius:"50%",objectFit:"cover",border:"2px solid var(--gold)"}}),t.jsxs("div",{children:[t.jsx("div",{style:{fontWeight:"bold",textDecoration:"underline",textDecorationColor:"rgba(255,255,255,0.3)"},children:(ue=X.user)==null?void 0:ue.name}),t.jsxs("div",{style:{fontSize:"0.72rem",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx("span",{style:{color:"#888"},children:"En attente"}),X.joined_from&&t.jsxs("span",{style:{padding:"1px 8px",borderRadius:"8px",fontSize:"0.68rem",fontWeight:"600",background:X.joined_from==="erox"?"rgba(255,51,51,0.15)":X.joined_from==="friend"?"rgba(38,166,154,0.15)":"rgba(197,160,101,0.15)",color:X.joined_from==="erox"?"#ff3333":X.joined_from==="friend"?"#26A69A":"#C5A065"},children:["via ",X.joined_from==="erox"?"Erox":X.joined_from==="friend"?"Friend":"Eros"]})]})]})]}),t.jsxs("div",{style:{display:"flex",gap:"6px"},children:[t.jsx(H,{icon:pr,color:"#4CAF50",title:"Valider",onClick:()=>G(X.id,"approved")}),t.jsx(H,{icon:ad,color:"#ff4d4d",title:"Refuser",onClick:()=>{_(X),k("")}})]})]},X.id)})})]}),t.jsxs("div",{children:[t.jsxs("h4",{style:{color:"white",marginBottom:"15px",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(pr,{size:16,color:"#4CAF50"})," Participants Validés (",n.approved.length,")"]}),n.approved.length===0?t.jsx("p",{style:{color:"#666",fontStyle:"italic"},children:"Aucun participant validé pour le moment."}):t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:n.approved.map(X=>{var he,Ae,ze,ue;return t.jsxs("div",{style:{display:"flex",alignItems:"center",background:"rgba(255,255,255,0.03)",padding:"12px",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.05)",transition:"background 0.2s"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer",flex:1},onClick:()=>
2260l(X.user_id),title:"Voir le profil",children:[t.jsx("img",{src:((he=X.user)==null?void 0:he.avatar_url)||((Ae=X.user)==null?void 0:Ae.photo)||"https://via.placeholder.com/40",alt:(ze=X.user)==null?void 0:ze.name,style:{width:"40px",height:"40px",borderRadius:"50%",objectFit:"cover",border:"2px solid #4CAF50"}}),t.jsxs("div",{children:[t.jsx("span",{style:{fontWeight:"500",fontSize:"0.95rem"},children:(ue=X.user)==null?void 0:ue.name}),X.joined_from&&t.jsxs("span",{style:{marginLeft:"8px",padding:"1px 8px",borderRadius:"8px",fontSize:"0.68rem",fontWeight:"600",background:X.joined_from==="erox"?"rgba(255,51,51,0.15)":X.joined_from==="friend"?"rgba(38,166,154,0.15)":"rgba(197,160,101,0.15)",color:X.joined_from==="erox"?"#ff3333":X.joined_from==="friend"?"#26A69A":"#C5A065"},children:["via ",X.joined_from==="erox"?"Erox":X.joined_from==="friend"?"Friend":"Eros"]})]})]}),t.jsxs("div",{style:{display:"flex",gap:"6px",flexShrink:0},children:[t.jsx(H,{icon:Qt,color:"#a855f7",title:"Envoyer un message",onClick:()=>{var xe,ke,Pe;return p({id:X.user_id,name:(xe=X.user)==null?void 0:xe.name,avatar_url:((ke=X.user)==null?void 0:ke.avatar_url)||((Pe=X.user)==null?void 0:Pe.photo)})}}),t.jsx(H,{icon:Vr,color:"#FFD700",title:"Envoyer un mail",onClick:()=>F(X)}),t.jsx(H,{icon:ad,color:"#ff4d4d",title:"Refuser ce participant",onClick:()=>{_(X),k("")}})]})]},X.id)})})]})]})]}),y&&t.jsx("div",{style:{position:"fixed",inset:0,zIndex:3e3,background:"rgba(0,0,0,0.85)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},children:t.jsxs("div",{style:{width:"100%",maxWidth:"450px",background:"#1e1e35",borderRadius:"20px",border:"1px solid rgba(255,77,77,0.2)",overflow:"hidden"},children:[t.jsxs("div",{style:{padding:"20px",borderBottom:"1px solid rgba(255,255,255,0.06)",display:"flex",alignItems:"center",gap:"12px"},children:[t.jsx("img",{src:((N=y.user)==null?void 0:N.avatar_url)||((Z=y.user)==null?void 0:Z.photo)||"https://via.placeholder.com/40",alt:"",style:{width:"40px",height:"40px",borderRadius:"50%",objectFit:"cover"}}),t.jsxs("div",{style:{flex:1},children:[t.jsxs("div",{style:{fontWeight:"600",fontSize:"1rem",color:"white"},children:["Refuser ",(ae=y.user)==null?void 0:ae.name]}),t.jsx("div",{style:{fontSize:"0.8rem",color:"#888"},children:"Un email sera envoyé avec votre explication"})]}),t.jsx("button",{onClick:()=>_(null),style:{background:"none",border:"none",color:"#888",cursor:"pointer"},children:t.jsx(mt,{size:20})})]}),t.jsxs("div",{style:{padding:"20px"},children:[t.jsx("label",{style:{display:"block",fontSize:"0.8rem",color:"#aaa",textTransform:"uppercase",letterSpacing:"1px",marginBottom:"10px"},children:"Motif du refus"}),t.jsx("textarea",{value:S,onChange:X=>k(X.target.value),placeholder:"Expliquez la raison du refus...",rows:4,style:{width:"100%",background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"12px",padding:"14px",color:"white",fontSize:"0.95rem",resize:"vertical",fontFamily:"Outfit, sans-serif",outline:"none"}})]}),t.jsxs("div",{style:{padding:"16px 20px",borderTop:"1px solid rgba(255,255,255,0.06)",display:"flex",gap:"10px",justifyContent:"flex-end"},children:[t.jsx("button",{onClick:()=>_(null),style:{background:"rgba(255,255,255,0.06)",border:"none",color:"#aaa",padding:"10px 20px",borderRadius:"10px",cursor:"pointer",fontSize:"0.9rem"},children:"Annuler"}),t.jsxs("button",{onClick:le,disabled:w,style:{background:w?"#666":"linear-gradient(135deg, #ff4d4d, #e53935)",border:"none",color:"white",padding:"10px 20px",borderRadius:"10px",cursor:w?"not-allowed":"pointer",fontSize:"0.9rem",fontWeight:"600",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(ad,{size:16})," ",w?"En cours...":"Refuser"]})]})]})}),j&&t.jsx("div",{style:{position:"fixed",inset:0,zIndex:3e3,background:"rgba(0,0,0,0.85)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},children:t.jsxs("div",{style:{width:"100%",maxWidth:"450px",background:"#1e1e35",borderRadius:"20px",border:"1px solid rgba(138,43,226,0.2)",overflow:"hidden"},children:[t.jsxs("div",{style:{padding:"20px",borderBottom:"1px solid rgba(255,255,255,0.06)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[t.jsxs("div",{children:[t.jsxs("h3",{style:{margin:0,fontSize:"1.1rem",color:"white"},children:[t.jsx(Qt,{size:18,style:{verticalAlign:"middle",marginRight:"8px",color:"#a85
22605f7"}}),"Message à tous"]}),t.jsxs("span",{style:{fontSize:"0.8rem",color:"#888"},children:[n.approved.length," participant(s)"]})]}),t.jsx("button",{onClick:()=>T(!1),style:{background:"none",border:"none",color:"#888",cursor:"pointer"},children:t.jsx(mt,{size:20})})]}),t.jsx("div",{style:{padding:"20px"},children:t.jsx("textarea",{value:P,onChange:X=>I(X.target.value),placeholder:"Votre message pour tous les participants...",rows:4,style:{width:"100%",background:"rgba(255,255,255,0.05)",border:"1px solid rgba(138,43,226,0.2)",borderRadius:"12px",padding:"14px",color:"white",fontSize:"0.95rem",resize:"vertical",fontFamily:"Outfit, sans-serif",outline:"none"}})}),t.jsxs("div",{style:{padding:"16px 20px",borderTop:"1px solid rgba(255,255,255,0.06)",display:"flex",gap:"10px",justifyContent:"flex-end"},children:[t.jsx("button",{onClick:()=>T(!1),style:{background:"rgba(255,255,255,0.06)",border:"none",color:"#aaa",padding:"10px 20px",borderRadius:"10px",cursor:"pointer",fontSize:"0.9rem"},children:"Annuler"}),t.jsxs("button",{onClick:A,disabled:R||!P.trim(),style:{background:R?"#666":"linear-gradient(135deg, #a855f7, #8b5cf6)",border:"none",color:"white",padding:"10px 20px",borderRadius:"10px",cursor:R?"not-allowed":"pointer",fontSize:"0.9rem",fontWeight:"600",display:"flex",alignItems:"center",gap:"6px",opacity:P.trim()?1:.5},children:[t.jsx(ji,{size:16})," ",R?"Envoi...":"Envoyer"]})]})]})}),E&&t.jsx("div",{style:{position:"fixed",inset:0,zIndex:3e3,background:"rgba(0,0,0,0.85)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},children:t.jsxs("div",{style:{width:"100%",maxWidth:"450px",background:"#1e1e35",borderRadius:"20px",border:"1px solid rgba(255,215,0,0.2)",overflow:"hidden"},children:[t.jsxs("div",{style:{padding:"20px",borderBottom:"1px solid rgba(255,255,255,0.06)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[t.jsxs("div",{children:[t.jsxs("h3",{style:{margin:0,fontSize:"1.1rem",color:"white"},children:[t.jsx(Vr,{size:18,style:{verticalAlign:"middle",marginRight:"8px",color:"#FFD700"}}),"Email à tous"]}),t.jsxs("span",{style:{fontSize:"0.8rem",color:"#888"},children:[n.approved.length," destinataire(s)"]})]}),t.jsx("button",{onClick:()=>$(!1),style:{background:"none",border:"none",color:"#888",cursor:"pointer"},children:t.jsx(mt,{size:20})})]}),t.jsxs("div",{style:{padding:"20px",display:"flex",flexDirection:"column",gap:"12px"},children:[t.jsx("input",{value:B,onChange:X=>ee(X.target.value),placeholder:"Sujet du mail",style:{width:"100%",background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,215,0,0.15)",borderRadius:"10px",padding:"12px 14px",color:"white",fontSize:"0.95rem",fontFamily:"Outfit, sans-serif",outline:"none"}}),t.jsx("textarea",{value:te,onChange:X=>K(X.target.value),placeholder:"Contenu du mail...",rows:5,style:{width:"100%",background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,215,0,0.15)",borderRadius:"12px",padding:"14px",color:"white",fontSize:"0.95rem",resize:"vertical",fontFamily:"Outfit, sans-serif",outline:"none"}})]}),t.jsxs("div",{style:{padding:"16px 20px",borderTop:"1px solid rgba(255,255,255,0.06)",display:"flex",gap:"10px",justifyContent:"flex-end"},children:[t.jsx("button",{onClick:()=>$(!1),style:{background:"rgba(255,255,255,0.06)",border:"none",color:"#aaa",padding:"10px 20px",borderRadius:"10px",cursor:"pointer",fontSize:"0.9rem"},children:"Annuler"}),t.jsxs("button",{onClick:M,disabled:ne||!B.trim()||!te.trim(),style:{background:ne?"#666":"linear-gradient(135deg, #FFD700, #FFA000)",border:"none",color:"black",padding:"10px 20px",borderRadius:"10px",cursor:ne?"not-allowed":"pointer",fontSize:"0.9rem",fontWeight:"700",display:"flex",alignItems:"center",gap:"6px",opacity:!B.trim()||!te.trim()?.5:1},children:[t.jsx(Vr,{size:16})," ",ne?"Envoi...":"Envoyer"]})]})]})}),a&&t.jsx("div",{style:{position:"fixed",inset:0,zIndex:3e3,background:"rgba(0,0,0,0.85)",backdropFilter:"blur(5px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},children:t.jsx("div",{style:{width:"100%",maxWidth:"600px",height:"85vh",borderRadius:"20px",overflow:"hidden",boxShadow:"0 20px 50px rgba(0,0,0,0.5)",position:"relative"},children:t.jsx("div",{className:"custom-scrollbar",style:{height:"100%",overflowY:"auto",background:"var(--bg-dark)"},children:t.jsx(Cp,{userId:a,onClose:()=>l(null),isModal:!0})})})}),d&&t.jsx(ll,{match:d,onClose:()=>p(null)})]})},aP=({event:e,onClose:r,onConfirm:i})=>e?t.jsx("div",{style:{position:"fixed",inset:0,zIndex:1e4,background:"rgba(0,0,0,0.6)",backdropFilter:"blur(5px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},children:t.jsxs(ye.div,{initial:{opacity:0,scale:.9,y:20}
2260,animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},style:{background:"var(--bg-deep)",border:"1px solid rgba(255, 77, 77, 0.3)",borderRadius:"20px",padding:"30px",maxWidth:"400px",width:"100%",position:"relative",boxShadow:"0 20px 50px rgba(0,0,0,0.5)"},children:[t.jsx("div",{style:{width:"60px",height:"60px",borderRadius:"50%",background:"rgba(255, 77, 77, 0.1)",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 20px auto",border:"1px solid rgba(255, 77, 77, 0.2)"},children:t.jsx(_n,{size:32,color:"#ff4d4d"})}),t.jsx("h2",{style:{textAlign:"center",fontSize:"1.5rem",marginBottom:"10px",color:"white"},children:"Supprimer l'événement ?"}),t.jsxs("p",{style:{textAlign:"center",color:"var(--text-muted)",marginBottom:"30px",fontSize:"0.95rem"},children:["Vous êtes sur le point de supprimer ",t.jsxs("strong",{children:['"',e.title,'"']}),". Cette action est irréversible et supprimera également la liste des participants."]}),t.jsxs("div",{style:{display:"flex",gap:"15px"},children:[t.jsx("button",{onClick:r,style:{flex:1,padding:"12px",background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"12px",color:"white",cursor:"pointer",fontWeight:"bold"},children:"Annuler"}),t.jsxs("button",{onClick:i,style:{flex:1,padding:"12px",background:"linear-gradient(45deg, #ff4d4d, #cc0000)",border:"none",borderRadius:"12px",color:"white",cursor:"pointer",fontWeight:"bold",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",boxShadow:"0 5px 15px rgba(255, 77, 77, 0.3)"},children:[t.jsx(rn,{size:18})," Supprimer"]})]}),t.jsx("button",{onClick:r,style:{position:"absolute",top:"15px",right:"15px",background:"none",border:"none",color:"rgba(255,255,255,0.3)",cursor:"pointer"},children:t.jsx(mt,{size:20})})]})}):null,lP=({event:e,onClose:r,onManage:i,onRequestDelete:n})=>{const o=si(),{mode:a,lightMode:l}=dr(),[d]=m.useState(JSON.parse(localStorage.getItem("userProfile"))),[p,u]=m.useState([]),[g,h]=m.useState(null),[x,y]=m.useState(!1),[_,S]=m.useState(!1),[k,w]=m.useState([]),[b,j]=m.useState(""),[T,P]=m.useState(!1),I=m.useRef(null),[R,O]=m.useState([]),[E,$]=m.useState(null),[B,ee]=m.useState(0),[te,K]=m.useState(""),[ne,Re]=m.useState(0),[Q,G]=m.useState(!1),[le,F]=m.useState(0),[A,M]=m.useState(0),[V,H]=m.useState(null),[N,Z]=m.useState(!1),ae=(d==null?void 0:d.id)===e.creator_id,X=new Date(e.date)<new Date,he=async()=>{const{data:z}=await D.from("event_participants").select("user_id, status").eq("event_id",e.id);if(z&&z.length>0){const Y=z.map($e=>$e.user_id),{data:ce}=await D.from("profiles").select("id, photo, name, avatar_url").in("id",Y),ve=z.map($e=>{const Xe=ce==null?void 0:ce.find(tt=>tt.id===$e.user_id);return{...$e,profiles:Xe}});u(ve);const pe=ve.find($e=>$e.user_id===(d==null?void 0:d.id));pe&&h(pe.status)}else u([])},Ae=async()=>{try{const{data:z}=await D.from("event_comments").select("id, content, created_at, user_id").eq("event_id",e.id).order("created_at",{ascending:!0});if(z&&z.length>0){const Y=[...new Set(z.map(pe=>pe.user_id))],{data:ce}=await D.from("profiles").select("id, name, avatar_url, photo").in("id",Y),ve=z.map(pe=>({...pe,user:ce==null?void 0:ce.find($e=>$e.id===pe.user_id)}));w(ve)}else w([])}catch(z){console.warn("Comments fetch failed:",z)}},ze=async()=>{try{const{data:z}=await D.from("event_ratings").select("id, rating, comment, created_at, user_id").eq("event_id",e.id);if(z){const ce=[...new Set(z.map(ve=>ve.user_id))];if(ce.length>0){const{data:ve}=await D.from("profiles").select("id, name, avatar_url, photo").in("id",ce),pe=z.map(Xe=>({...Xe,user:ve==null?void 0:ve.find(tt=>tt.id===Xe.user_id)}));O(pe);const $e=pe.find(Xe=>Xe.user_id===(d==null?void 0:d.id));$e&&($($e),ee($e.rating),K($e.comment||""))}}const{data:Y}=await D.from("event_ratings").select("rating").eq("organizer_id",e.creator_id);if(Y&&Y.length>0){const ce=Y.reduce((ve,pe)=>ve+pe.rating,0)/Y.length;F(ce),M(Y.length)}}catch(z){console.warn("Ratings fetch failed:",z)}};m.useEffect(()=>{he(),Ae(),ze()},[e.id]),m.useEffect(()=>{const z=D.channel(`event-comments-${e.id}`).on("postgres_changes",{event:"INSERT",schema:"public",table:"event_comments",filter:`event_id=eq.${e.id}`},()=>{Ae()}).subscribe();return()=>{D.removeChannel(z)}},[e.id]),m.useEffect(()=>{I.current&&I.current.scrollIntoView({behavior:"smooth"})},[k]);
2260const ue=new Date(e.date),xe=ue.getDate(),ke=ue.toLocaleString("fr-FR",{month:"short"}).toUpperCase(),Pe=ue.toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"}),Ce=e.end_time?new Date(e.end_time).toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"}):null,Me=ue.toLocaleDateString("fr-FR",{weekday:"long",day:"numeric",month:"long",year:"numeric"}),Le=async()=>{y(!0);try{const z=e.meetips_price||0;if(z>0){const pe=await wi.getBalance(d.id);if(pe<z){o.error(`Solde insuffisant : ${pe}/${z} Meetips`),y(!1);return}const{error:$e}=await D.from("meetips_transactions").insert({user_id:d.id,amount:-z,description:`Inscription event: ${e.title}`});if($e)throw $e;const Xe=pe-z;if(await D.from("profiles").update({meetips_balance:Xe}).eq("id",d.id),e.creator_id){const tt=await wi.getBalance(e.creator_id);await D.from("meetips_transactions").insert({user_id:e.creator_id,amount:z,description:`Inscription reçue: ${e.title}`}),await D.from("profiles").update({meetips_balance:tt+z}).eq("id",e.creator_id)}}const Y=e.requires_approval?"pending":"approved",ce=a?a.toLowerCase():"eros",{error:ve}=await D.from("event_participants").insert([{event_id:e.id,user_id:d.id,status:Y,joined_from:ce}]);if(ve)throw ve;h(Y),he(),Y==="pending"&&e.creator_id?Wr(async()=>{const{sendParticipationRequest:pe}=await Promise.resolve().then(()=>na);return{sendParticipationRequest:pe}},void 0).then(({sendParticipationRequest:pe})=>{pe(e.creator_id,e.title,d.name,d.avatar_url||d.photo).catch(console.error)}):Y==="approved"&&Wr(async()=>{const{sendEventWelcome:pe}=await Promise.resolve().then(()=>na);return{sendEventWelcome:pe}},void 0).then(({sendEventWelcome:pe})=>{pe(d.id,e).catch(console.error)})}catch(z){o.error("Erreur: "+z.message)}finally{y(!1)}},rt=async()=>{y(!0);try{await D.from("event_participants").delete().eq("event_id",e.id).eq("user_id",d.id),h(null),he()}catch(z){console.error(z)}finally{y(!1)}},Fe=()=>{n&&n(e)},ft=async()=>{if(!(!b.trim()||T)){P(!0);try{const{error:z}=await D.from("event_comments").insert([{event_id:e.id,user_id:d.id,content:b.trim()}]);if(z)throw z;j(""),Ae()}catch(z){o.error("Erreur: "+z.message)}finally{P(!1)}}},De=async()=>{if(!(B===0||Q)){G(!0);try{if(E){const{error:z}=await D.from("event_ratings").update({rating:B,comment:te}).eq("id",E.id);if(z)throw z}else{const{error:z}=await D.from("event_ratings").insert([{event_id:e.id,user_id:d.id,organizer_id:e.creator_id,rating:B,comment:te}]);if(z)throw z}o.success("Merci pour votre avis ! â"),ze()}catch(z){o.error("Erreur: "+z.message)}finally{G(!1)}}},Be=p.filter(z=>z.status==="approved"),re=e.max_participants>0&&Be.length>=e.max_participants,He=X&&!ae&&g==="approved",be=z=>{if(!(z!=null&&z.profiles)&&!(z!=null&&z.user))return"https://via.placeholder.com/30";const Y=z.profiles||z.user;return(Y==null?void 0:Y.avatar_url)||(Y==null?void 0:Y.photo)||"https://via.placeholder.com/30"},nt=e.mode==="erox"?"#ff3333":"var(--primary)",J=(z,Y=14)=>Array.from({length:5},(ce,ve)=>t.jsx(nr,{size:Y,fill:ve<Math.round(z)?"#FFD700":"transparent",color:ve<Math.round(z)?"#FFD700":"rgba(255,255,255,0.2)"},ve)),Ie=z=>{const Y=new Date(z),ve=new Date-Y,pe=Math.floor(ve/6e4);if(pe<1)return"à l'instant";if(pe<60)return`${pe}min`;const $e=Math.floor(pe/60);return $e<24?`${$e}h`:Y.toLocaleDateString("fr-FR",{day:"numeric",month:"short"})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{position:"fixed",inset:0,zIndex:1e3,background:"rgba(0,0,0,0.85)",display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:"blur(8px)",padding:"15px"},onClick:z=>{z.target===z.currentTarget&&r()},children:[t.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column",borderRadius:"24px",overflow:"hidden",background:l?"linear-gradient(180deg, #FAF7F2 0%, #F5F0E8 100%)":"linear-gradient(180deg, #1a1a2e 0%, #141422 100%)",border:l?"2px solid rgba(140,115,75,0.2)":"1px solid rgba(255,255,255,0.08)",width:"100%",maxWidth:"720px",maxHeight:"92vh",boxShadow:l?"0 20px 50px rgba(120,100,60,0.15)":"0 25px 60px rgba(0,0,0,0.6)"},children:[t.jsx("button",{onClick:r,style:{position:"absolute",top:"15p
2260x",right:"15px",zIndex:20,background:l?"rgba(250,247,242,0.85)":"rgba(0,0,0,0.6)",width:"34px",height:"34px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",border:l?"1px solid rgba(140,115,75,0.2)":"none",color:l?"#3D3528":"white",cursor:"pointer",backdropFilter:"blur(5px)"},children:t.jsx(mt,{size:18})}),t.jsxs("div",{style:{flex:1,overflowY:"auto",display:"flex",flexDirection:"column"},className:"custom-scrollbar",children:[t.jsxs("div",{style:{height:"320px",position:"relative",background:"#111",cursor:"pointer",flexShrink:0},onClick:()=>S(!0),children:[t.jsx("img",{src:e.image_url||"https://images.unsplash.com/photo-1533174072545-e8d4aa97edf9?ixlib=rb-1.2.1&auto=format&fit=crop&w=1000&q=80",alt:e.title,style:{width:"100%",height:"100%",objectFit:"cover"}}),t.jsx("div",{style:{position:"absolute",inset:0,background:l?"linear-gradient(180deg, transparent 0%, transparent 30%, rgba(250,247,242,0.4) 55%, rgba(250,247,242,0.85) 80%, #FAF7F2 100%)":"linear-gradient(180deg, transparent 0%, transparent 30%, rgba(20,20,34,0.4) 55%, rgba(20,20,34,0.85) 80%, #141422 100%)"}}),t.jsx("div",{style:{position:"absolute",inset:0,background:`linear-gradient(180deg, transparent 70%, ${nt}10 100%)`}}),t.jsxs("div",{style:{position:"absolute",top:"14px",left:"14px",right:"55px",display:"flex",gap:"8px",flexWrap:"wrap",zIndex:5},children:[t.jsx("div",{style:{background:"rgba(0,0,0,0.45)",backdropFilter:"blur(12px)",padding:"5px 14px",borderRadius:"20px",color:"white",fontSize:"0.78rem",fontWeight:"700",border:`1px solid ${nt}30`},children:e.mode==="erox"?"ð¥ EROX":"â¤ï¸ EROS"}),e.requires_approval&&t.jsxs("div",{style:{background:"rgba(211,47,47,0.25)",backdropFilter:"blur(12px)",color:"#ff8a80",padding:"5px 12px",borderRadius:"20px",fontSize:"0.75rem",fontWeight:"700",display:"flex",alignItems:"center",gap:"4px",border:"1px solid rgba(255,100,80,0.2)"},children:[t.jsx(fi,{size:13})," PRIVÃ"]}),X&&t.jsx("div",{style:{background:"rgba(100,100,100,0.35)",backdropFilter:"blur(12px)",color:"#aaa",padding:"5px 12px",borderRadius:"20px",fontSize:"0.75rem",fontWeight:"700",border:"1px solid rgba(255,255,255,0.08)"},children:"â Terminé"})]}),t.jsxs("div",{style:{position:"absolute",bottom:"14px",left:"20px",right:"20px",zIndex:5,display:"flex",justifyContent:"space-between",alignItems:"flex-end",gap:"12px"},children:[t.jsxs("div",{style:{flex:1},children:[t.jsx("h2",{style:{margin:"0 0 4px 0",fontSize:"1.5rem",fontFamily:"Outfit",fontWeight:"800",lineHeight:"1.15",color:l?"#2A2520":"white",textShadow:l?"none":"0 2px 12px rgba(0,0,0,0.6)"},children:e.title}),t.jsxs("div",{style:{fontSize:"0.8rem",color:l?"#6B5F50":"rgba(255,255,255,0.65)",textTransform:"capitalize",textShadow:l?"none":"0 1px 6px rgba(0,0,0,0.5)",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(cr,{size:13,color:nt}),Me]})]}),t.jsxs("div",{style:{background:"rgba(0,0,0,0.35)",backdropFilter:"blur(16px)",padding:"8px 14px",borderRadius:"14px",textAlign:"center",border:`1px solid ${nt}25`,flexShrink:0,boxShadow:"0 4px 20px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.08)"},children:[t.jsx("div",{style:{fontSize:"1.4rem",fontWeight:"800",lineHeight:"1",color:"white"},children:xe}),t.jsx("div",{style:{fontSize:"0.72rem",color:nt,fontWeight:"700",textTransform:"uppercase",letterSpacing:"0.5px"},children:ke})]})]})]}),t.jsxs("div",{style:{padding:"0 0 22px 0",flex:1},children:[t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"1px",background:l?"rgba(140,115,75,0.06)":"rgba(255,255,255,0.06)",borderBottom:l?"1px solid rgba(140,115,75,0.12)":"1px solid rgba(255,255,255,0.06)"},children:[t.jsxs("div",{style:{background:l?"#FAF7F2":"#141422",padding:"14px 16px",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px"},children:[t.jsx(Pn,{size:18,color:nt}),t.jsx("div",{style:{fontSize:"1rem",fontWeight:"700",color:l?"#2A2520":"white"},children:Pe}),Ce&&t.jsxs("div",{style:{fontSize:"0.7rem",color:l?"#8C7A60":"rgba(255,255,255,0.4)"},children:["â ",Ce]})]}),t.jsxs("div",{style:{background:l?"#FAF7F2":"#141422",padding:"14px 16px",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",textAlign:"center"},children:[t.jsx(ur,{size:18,color:nt}),t.jsx("div",{style:{fontSize:"0.85rem",fontWeight:"700",color:l?"#2A2520":"white",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%",textTransform:"uppercase",letterSpacing:"0.3px"},children:e.location})]}),t.jsxs("div",{style:{background:l?"#FAF7F2":"#141422",padding:"14px 16px",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px"},children:[t.jsx(Ut,{size:18,color:nt}),t.jsxs("div",{style:{fontSize:"1rem",fontWeight:"700",color:re?"#ff4d4d":l?"#2A2520":"white"},children:[Be.length,e.max_participants>0?t.jsxs("span",{style:{color:l?"#8C7A60":"rgba(255,255,255,0.4)",fontWeight:"400"},children:[" / ",e.max_participants]}):""]}),t.jsx("div",{style:{fontSize:"0.65rem",color:l?"#8C7A60":"rgba(255,255,255,0.35)",textTransform:"uppercase",letterSpacing:"0.5px"},children:"inscrits"})]})]}),e.creator&&t.jsx("div",{style:{padding:"14px 22px",borderBottom:l?"1px solid rgba(140,115,75,0.12)":"1px solid rgba(255,255,255,0.06)"},children:t.jsxs("div",{onClick:()=>{var z;return H(((z=e.creator)==null?void 0:z.id)||e.creator_id)},style:{display:"flex",alignItems:"center",gap:"12px",cursor:"pointer",transition:"all 0.25s ease",padding:"10px 14px",borderRadius:"14px",background:l?"rgba(140,115,75,0.04)":"rgba(255,255,255,0.03)",border:l?"1.5px solid rgba(140,115,75,0.15)":"1px solid rgba(255,255,255,0.07)"},onMouseOver:z=>{z.currentTarget.style.background="rgba(255,255,255,0.06)",z.currentTarget.style.borderColor=`${nt}30`},onMouseOut:z=>{z.currentTarget.style.background="rgba(255,255,255,0.03)",z.currentTarget.style.borderColor="rgba(255,255,255,0.07)"},children:[t.jsx(Mo,{photoUrl:e.creator.avatar_url||e.creator.photo||"https://via.placeholder.com/40",animatedUrl:e.creator.animated_photo_url,alt:e.creator.name,size:48,borderColor:`${nt}50`,borderWidth:2}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsx("div",{style:{fontSize:"0.9rem",fontWeight:"700",color:l?"#2A2520":"white"},children:e.creator.name}),t.jsxs("div",{onClick:z=>{z.stopPropagation();const Y=document.getElementById("event-reviews-section");Y&&Y.scrollIntoView({behavior:"smooth",block:"start"})},style:{display:"flex",alignItems:"center",gap:"4px",marginTop:"3px",cursor:A>0?"pointer":"default"},children:[Array.from({length:5},(z,Y)=>t.jsx(nr,{size:13,fill:Y<Math.round(le)?"#FFD700":"transparent",color:Y<Math.round(le)?"#FFD700":"rgba(255,255,255,0.2)"},Y)),t.jsx("span",{style:{fontSize:"0.75rem",color:A>0?"#B8860B":l?"#8C7A60":"rgba(255,255,255,0.35)",marginLeft:"4px"},children:A>0?`${le.toFixed(1)} · ${A} avis`:"Nouveau"})]})]}),t.jsx("div",{style:{fontSize:"0.72rem",color:l?"#8C7A60":"rgba(255,255,255,0.3)"},children:"Voir âº"})]})}),(e.venue_name||(ae||g==="approved")&&e.address)&&t.jsxs("div",{style:{padding:"14px 22px",borderBottom:l?"1px solid rgba(140,115,75,0.12)":"1px solid rgba(255,255,255,0.06)"},children:[e.venue_name&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontSize:"0.85rem",color:l?"#5C4A30":"#ddd",marginBottom:e.address?"8px":0},children:[t.jsx(d0,{size:14,color:nt}),t.jsxs("span",{children:[t.jsx("strong",{style:{color:l?"#2A2520":"white"},children:"RDV :"})," ",e.venue_name]})]}),(ae||g==="approved")&&e.address&&t.jsxs("div",{children:[t.jsxs("div",{style:{display:"flex",alignItems:"flex-start",ga
2260p:"8px",fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",background:"rgba(255,255,255,0.03)",padding:"10px 12px",borderRadius:"10px",border:"1px solid rgba(255,255,255,0.08)"},children:[t.jsx(ur,{size:14,style:{flexShrink:0,marginTop:"2px",color:"rgba(255,255,255,0.4)"}}),t.jsxs("span",{style:{flex:1},children:[t.jsx("strong",{style:{color:"rgba(255,255,255,0.6)"},children:"Adresse :"})," ",e.address]})]}),t.jsxs("div",{style:{display:"flex",gap:"6px",marginTop:"8px"},children:[t.jsx("a",{href:`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(e.address)}`,target:"_blank",rel:"noreferrer",style:{display:"flex",alignItems:"center",gap:"5px",padding:"7px 12px",borderRadius:"10px",background:"rgba(66,133,244,0.1)",border:"1px solid rgba(66,133,244,0.2)",color:"#8ab4f8",fontSize:"0.75rem",fontWeight:"600",textDecoration:"none",transition:"all 0.2s"},children:"ð Google Maps"}),t.jsx("a",{href:`https://waze.com/ul?q=${encodeURIComponent(e.address)}&navigate=yes`,target:"_blank",rel:"noreferrer",style:{display:"flex",alignItems:"center",gap:"5px",padding:"7px 12px",borderRadius:"10px",background:"rgba(51,191,255,0.1)",border:"1px solid rgba(51,191,255,0.2)",color:"#33bfff",fontSize:"0.75rem",fontWeight:"600",textDecoration:"none",transition:"all 0.2s"},children:"ðºï¸ Waze"})]})]})]}),e.tags&&e.tags.length>0&&t.jsx("div",{style:{padding:"14px 22px",borderBottom:"1px solid rgba(255,255,255,0.06)"},children:t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:e.tags.map(z=>{const ce=[...(Fn||[]).flatMap(pe=>(pe==null?void 0:pe.items)||[]),...(So||[]).flatMap(pe=>(pe==null?void 0:pe.items)||[]),...(a5||[]).flatMap(pe=>(pe==null?void 0:pe.items)||[]),...(l5||[]).flatMap(pe=>(pe==null?void 0:pe.items)||[])].find(pe=>(pe==null?void 0:pe.id)===z);if(!ce)return null;const ve=ce.icon;return t.jsxs("div",{style:{background:`${nt}12`,borderRadius:"20px",padding:"6px 14px",fontSize:"0.8rem",display:"flex",alignItems:"center",gap:"5px",color:nt,border:`1px solid ${nt}25`,fontWeight:"600"},children:[t.jsx(ve,{size:13})," ",ce.label]},z)})})}),e.description&&t.jsxs("div",{style:{padding:"16px 22px",borderBottom:l?"1px solid rgba(140,115,75,0.12)":"1px solid rgba(255,255,255,0.06)"},children:[t.jsx("div",{style:{fontSize:"0.72rem",color:l?"#8C7A60":"rgba(255,255,255,0.35)",textTransform:"uppercase",letterSpacing:"1px",fontWeight:"700",marginBottom:"10px"},children:"Description"}),t.jsx("div",{style:{lineHeight:"1.7",fontSize:"0.9rem",color:l?"#2A2520":"#d0d0d0",whiteSpace:"pre-wrap"},children:e.description})]}),g==="approved"&&e.ticketing_link&&t.jsxs("div",{style:{margin:"0 22px",marginTop:"14px",padding:"10px 14px",background:"rgba(78,205,196,0.06)",borderRadius:"10px",border:"1px solid rgba(78,205,196,0.15)",fontSize:"0.82rem",display:"flex",gap:"8px",alignItems:"center",color:"#4ECDC4"},children:[t.jsx(Km,{size:16}),t.jsx("span",{children:"Inscription validée ! N'oubliez pas votre billet."})]}),t.jsxs("div",{style:{padding:"16px 22px",borderBottom:l?"1px solid rgba(140,115,75,0.12)":"1px solid rgba(255,255,255,0.06)"},children:[t.jsxs("div",{style:{fontSize:"0.72rem",color:l?"#8C7A60":"rgba(255,255,255,0.35)",textTransform:"uppercase",letterSpacing:"1px",fontWeight:"700",marginBottom:"12px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t.jsxs("span",{children:["Participants (",Be.length,")"]}),e.requires_approval&&t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"4px",color:"var(--gold)",textTransform:"none",fontSize:"0.72rem",letterSpacing:"0"},children:[t.jsx(fi,{size:12})," Validation requise"]})]}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"10px"},children:[Be.map((z,Y)=>{var ce,ve;return t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",width:"52px"},children:[t.jsx("img",{src:be(z),title:((ce=z.profiles)==null?void 0:ce.name)||"",style:{width:"42px",height:"42px",borderRadius:"50%",border:l?"2px solid rgba(140,115,75,0.15)":"2px solid rgba(255,255,255,0.1)",objectFit:"cover",background:l?"#EDE8DF":"#333"}}),t.jsx("span",{style:{fontSize:"0.65rem",color:l?"#5C4A30":"rgba(255,255,255,0.5)",marginTop:"4px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"52px",textAlign:"center"},children:(ve=z.profiles)==null?void 0:ve.name})]},Y)}),Be.length===0&&t.jsx("span",{style:{color:"rgba(255,255,255,0.3)",fontSize:"0.82rem",fontStyle:"italic"},children:"Aucun participant pour le moment."})]})]}),t.jsxs("div",{style:{padding:"16px 22px",borderBottom:l?"1px solid rgba(140,115,75,0.12)":"1px solid rgba(255,255,255,0.06)"},children:[t.jsxs("div",{onClick:()=>Z(!N),style:{fontSize:"0.72rem",color:l?"#8C7A60":"rgba(255,255,255,0.35)",textTransform:"uppercase",letterSpacing:"1px",fontWeight:"700",marginBottom:N?"12px":"0",display:"flex",alignItems:"center",gap:"6px",cursor:"pointer",userSelect:"none",transition:"margin 0.2s"},children:[t.jsx(Qt,{size:13,color:nt}),"Discussion (",k.length,")",t.jsx(l0,{size:13,color:l?"#8C7A60":"rgba(255,255,255,0.3)",style:{marginLeft:"auto",transition:"transform 0.3s",transform:N?"rotate(180deg)":"rotate(0deg)"}})]}),N&&t.jsxs("div",{style:{background:l?"rgba(140,115,75,0.04)":"rgba(255,255,255,0.02)",borderRadius:"14px",border:l?"1.5px solid rgba(140,115,75,0.2)":"1px solid rgba(255,255,255,0.06)",overflow:"hidden"},children:[t.jsxs("div",{style:{maxHeight:"240px",overflowY:"auto",padding:"12px 14px"},className:"custom-scrollbar",children:[k.length===0?t.jsxs("div",{style:{textAlign:"center",padding:"24px 0",color:l?"#8C7A60":"rgba(255,255,255,0.25)",fontSize:"0.82rem"},children:[t.jsx(Qt,{size:20,style:{marginBottom:"6px",opacity:.3}}),t.jsx("br",{}),"Soyez le premier à commenter ! ð¬"]}):k.map(z=>{var Y,ce,ve;return t.jsxs("div",{style:{display:"flex",gap:"10px",marginBottom:"12px",alignItems:z.user_id===(d==null?void 0:d.id)?"flex-end":"flex-start",flexDirection:z.user_id===(d==null?void 0:d.id)?"row-reverse":"row"},children:[t.jsx("img",{src:((Y=z.user)==null?void 0:Y.avatar_url)||((ce=z.user)==null?void 0:ce.photo)||"https://via.placeholder.com/28",style:{width:"28px",height:"28px",borderRadius:"50%",objectFit:"cover",flexShrink:0},alt:""}),t.jsxs("div",{style:{maxWidth:"75%",background:z.user_id===(d==null?void 0:d.id)?`${nt}18`:"rgba(255,255,255,0.05)",padding:"10px 14px",borderRadius:"14px",border:z.user_id===(d==null?void 0:d.id)?`1px solid ${nt}30`:"1px solid rgba(255,255,255,0.06)"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"3px",gap:"10px"},children:[t.jsx("span",{style:{fontSize:"0.72rem",fontWeight:"600",color:z.user_id===(d==null?void 0:d.id)?nt:"rgba(255,255,255,0.6)"},children:((ve=z.user)==null?void 0:ve.name)||"Inconnu"}),t.jsx("span",{style:{fontSize:"0.65rem",color:"rgba(255,255,255,0.25)"},children:Ie(z.created_at)})]}),t.jsx("div",{style:{fontSize:"0.85rem",color:"#ddd",lineHeight:"1.45"},children:z.content})]})]},z.id)}),t.jsx("div",{ref:I})]}),(g==="approved"||ae)&&t.jsxs("div",{style:{padding:"10px 14px",borderTop:l?"1px solid rgba(140,115,75,0.12)":"1px solid rgba(255,255,255,0.06)",display:"flex",gap:"8px",alignItems:"center"},children:[t.jsx("input",{type:"text",placeholder:"Ãcrire un message...",value:b,onChange:z=>j(z.target.value),onKeyDown:z=>{z.key==="Enter"&&ft()},style:{flex:1,padding:"10px 14px",borderRadius:"10px",background:l?"rgba(140,115,75,0.05)":"rgba(255,255,255,0.04)",border:l?"1.5px solid rgba(140,115,75,0.2)":"1px solid rgba(255,255,255,0.08)",color:l?"#2A2520":"white",fontSize:"0.85rem",outline:"none"}}),t.jsx("button",{onClick:ft,disabled:!b.trim()||T,style:{width:"38px",height:"38px",borderRadius:"10px",background:b.trim()?nt:l?"rgba(140,115,75,0.08)":"rgba(255,255,255,0.05)",border:l?"1.5px solid rgba(140,115,75,0.2)":"none",color:l?"#3D3528":"white",cursor:b.trim()?"pointer":"default",display:"flex",alignItems:"center",justifyContent:"center",transition:"background 0.2s"},children:t.jsx(ji,{size:16})})]}),!g&&!ae&&t.jsx("div",{style:{padding:"10px 14px",textAlign:"center",fontSize:"0.75rem",color:"rgba(255,255,255,0.3)",borderTop:"1px solid rgba(255,255,255,0.04)"},children:"ð Inscrivez-vous pour participer à la discussion"})]})]}),He&&t.jsxs("div",{style:{padding:"16px 22px",borderBottom:"1px solid rgba(255,255,255,0.06)"},children:[t.jsxs("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.35)",textTransform:"uppercase",letterSpacing:"1px",fontWeight:"700",marginBottom:"12px",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(nr,{size:13,fill:"#FFD700",color:"#FFD700"}),E?"Modifier votre avis":"Notez l'organisateur"]}),t.jsxs("div",{style:{background:"rgba(255,215,0,0.04)",borderRadius:"14px",border:"1px solid rgba(255,215,0,0.12)",padding:"16px"},children:[t.jsxs("div",{style:{display:"flex",gap:"6px",marginBottom:"14px",alignItems:"center"},children:[[1,2,3,4,5].map(z=>t.jsx(nr,{size:28,fill:(ne||B)>=z?"#FFD700":"transparent",color:(ne||B)>=z?"#FFD700":"rgba(255,255,255,0.2)",style:{cursor:"pointer",transition:"transform 0.15s"},onMouseEnter:()=>Re(z),onMouseLeave:()=>Re(0),onClick:()=>ee(z)},z)),B>0&&t.jsxs("span",{style:{marginLeft:"8px",fontSize:"0.85rem",color:"rgba(255,255,255,0.5)"},children:[B===1?"ð":B===2?"ð":B===3?"ð":B===4?"ð":"ð¤©"," ",B,"/5"]})]}),t.jsx("textarea",{placeholder:"Un commentaire sur l'organisation ? (optionnel)",value:te,onChange:z=>K(z.target.value),rows:2,style:{width:"100%",padding:"12px 14px",borderRadius:"10px",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",color:"white",fontSize:"0.85rem",outline:"none",resize:"none",boxSizing:"border-box",marginBottom:"12px"}}),t.jsx("button",{onClick:De,disabled:B===0||Q,style:{padding:"10px 20px",borderRadius:"10px",background:B>0?"var(--gradient-gold)":"rgba(255,255,255,0.05)",border:"none",color:B>0?"black":"rgba(255,255,255,0.3)",fontWeight:"700",fontSize:"0.85rem",cursor:B>0?"pointer":"default",transition:"all 0.2s"},children:Q?"â³...":E?"Mettre à jour":"Envoyer mon avis â"})]})]}),R.length>0&&t.jsxs("div",{id:"event-reviews-section",style:{padding:"16px 22px"},children:[t.jsxs("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.35)",textTransform:"uppercase",letterSpacing:"1px",fontWeight:"700",marginBottom:"12px"},children:["Avis des participants (",R.length,")"]}),R.slice(0,5).map(z=>{var Y,ce,ve;return t.jsxs("div",{style:{display:"flex",gap:"10px",marginBottom:"10px",background:"rgba(255,255,255,0.02)",padding:"12px 14px",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.04)"},children:[t.jsx("img",{src:((Y=z.user)==null?void 0:Y.avatar_url)||((ce=z.user)==null?void 0:ce.photo)||"https://via.placeholder.com/30",style:{width:"30px",height:"30px",borderRadius:"50%",objectFit:"cover",flexShrink:0},alt:""}),t.jsxs("div",{style:{flex:1},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"4px"},children:[t.jsx("span",{style:{fontSize:"0.78rem",fontWeight:"600",color:"rgba(255,255,255,0.7)"},children:((ve=z.user)==null?void 0:ve.name)||"Anonyme"}),t.jsx("div",{style:{display:"flex",gap:"1px"},children:J(z.rating,11)})]}),z.comment&&t.jsx("div",{style:{fontSize:"0.82rem",color:"rgba(255,255,255,0.5)",lineHeight:"1.4"},children:z.comment})]})]},z.id)})]})]})]}),t.jsxs("div",{style:{marginTop:"auto",display:"flex",gap:"8px",flexWrap:"wrap",padding:"14px 22px",paddingBottom:"84px",background:l?"rgba(250,247,242,0.95)":"rgba(15,15,28,0.92)",backdropFilter:"blur(16px)",borderTop:l?"1px solid rgba(140,115,75,0.15)":`1px solid ${nt}15`,zIndex:15},children:[t.jsx("button",{onClick:async()=>{const z={title:e.title,text:`Viens avec moi à cette soirée : ${e.title} !`,url:window.location.href};try{navigator.share?await navigator.share(z):o.info("Le partage n'est pas supporté sur ce navigateur.")}catch(Y){console.error(Y)}},style:{padding:"11px",borderRadius:"12px",background:"rgba(255,255,255,0.04)",backdropFilter:"blur(8px)",border:"1px solid rgba(255,255,255,0.08)",color:"white",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},children:t.jsx(u0,{size:17})}),(g==="approved"||ae)&&e.ticketing_link&&t.jsxs("a",{href:e.ticketing_link,target:"_blank",rel:"noreferrer",style:{padding:"11px 14px",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.08)",color:"white",display:"flex",alignItems:"center",gap:"5px",textDecoration:"none",fontSize:"0.82rem",background:"rgba(255,255,255,0.04)",backdropFilter:"blur(8px)"},children:[t.jsx(Gn,{size:15})," Billetterie"]}
2260),ae?t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:()=>i(e),style:{flex:1,padding:"11px 14px",borderRadius:"12px",background:"rgba(255,215,0,0.06)",backdropFilter:"blur(8px)",border:"1px solid rgba(255,215,0,0.2)",color:"var(--gold)",fontWeight:"700",cursor:"pointer",fontSize:"0.85rem"},children:"Gérer Participants"}),t.jsx("button",{onClick:()=>i(e,!0),style:{padding:"11px",borderRadius:"12px",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",color:"white",cursor:"pointer"},children:"âï¸"}),t.jsx("button",{onClick:Fe,style:{padding:"11px",borderRadius:"12px",background:"rgba(255,0,0,0.04)",border:"1px solid rgba(255,0,0,0.15)",color:"#ff4d4d",cursor:"pointer"},children:t.jsx(rn,{size:17})})]}):x?t.jsx("button",{disabled:!0,style:{flex:1,padding:"11px",borderRadius:"12px",background:"#222",border:"none",color:"#666",fontSize:"0.85rem"},children:"â³ ..."}):g?t.jsx("button",{onClick:rt,style:{flex:1,padding:"11px 14px",borderRadius:"12px",background:g==="approved"?"rgba(76,175,80,0.08)":"rgba(255,152,0,0.08)",border:`1px solid ${g==="approved"?"rgba(76,175,80,0.25)":"rgba(255,152,0,0.25)"}`,color:g==="approved"?"#4CAF50":"#FF9800",fontWeight:"700",cursor:"pointer",fontSize:"0.85rem",backdropFilter:"blur(8px)"},children:g==="approved"?"â Inscrit (Se désinscrire)":"â³ En attente (Annuler)"}):t.jsx("button",{onClick:re?void 0:()=>{Uo(),Le()},disabled:re,style:{flex:1,padding:"13px 16px",borderRadius:"14px",background:re?"rgba(255,255,255,0.04)":`linear-gradient(135deg, ${nt}, ${nt}cc)`,border:re?"1px solid rgba(255,255,255,0.08)":"none",color:re?"rgba(255,255,255,0.35)":"white",fontWeight:"800",cursor:re?"not-allowed":"pointer",fontSize:"0.95rem",letterSpacing:"0.3px",boxShadow:re?"none":`0 4px 20px ${nt}50, 0 0 40px ${nt}15`,transition:"all 0.3s ease"},children:re?"COMPLET":e.meetips_price>0?e.requires_approval?t.jsxs(t.Fragment,{children:["Demander · ",e.meetips_price," ",t.jsx(Jt,{size:14})]}):t.jsxs(t.Fragment,{children:["S'inscrire · ",e.meetips_price," ",t.jsx(Jt,{size:14})]}):e.requires_approval?"Demander à participer":"S'inscrire ð"})]})]}),_&&t.jsxs("div",{onClick:()=>S(!1),style:{position:"fixed",inset:0,zIndex:9999,background:"rgba(0,0,0,0.95)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"zoom-out"},children:[t.jsx("img",{src:e.image_url||"https://images.unsplash.com/photo-1533174072545-e8d4aa97edf9?ixlib=rb-1.2.1&auto=format&fit=crop&w=1000&q=80",alt:e.title,style:{maxWidth:"90%",maxHeight:"90%",borderRadius:"12px",boxShadow:"0 0 50px rgba(0,0,0,0.5)"}}),t.jsx("button",{onClick:()=>S(!1),style:{position:"absolute",top:"20px",right:"20px",background:"none",border:"none",color:"white",cursor:"pointer"},children:t.jsx(mt,{size:40})})]})]}),V&&t.jsx("div",{onClick:()=>H(null),style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.7)",backdropFilter:"blur(8px)",zIndex:1e4,display:"flex",alignItems:"center",justifyContent:"center",padding:"20px",animation:"fadeIn 0.2s ease-out"},children:t.jsxs("div",{onClick:z=>z.stopPropagation(),style:{width:"100%",maxWidth:"600px",maxHeight:"85vh",overflowY:"auto",borderRadius:"24px",background:"rgba(25,25,35,0.98)",border:"1px solid rgba(255,255,255,0.1)",boxShadow:"0 25px 60px rgba(0,0,0,0.6)",position:"relative"},className:"custom-scrollbar",children:[t.jsx("button",{onClick:()=>H(null),style:{position:"sticky",top:"12px",right:"12px",float:"right",zIndex:10,background:"rgba(255,255,255,0.1)",border:"none",borderRadius:"50%",width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"white",margin:"12px"},children:t.jsx(mt,{size:18})}),t.jsx(Cp,{userId:V,onClose:()=>H(null)})]})})]})},dP=()=>{const e=si(),{mode:r,lightMode:i}=dr(),n=xn(),o=Lt(),[a,l]=m.useState({city:"",theme:"all",ageMax:100}),[d,p]=m.useState(!1),[u,g]=m.useState(!1),[h,x]=m.useState(!1),[y,_]=m.useState(null),[S,k]=m.useState(0),[w,b]=m.useState({}),[j,T]=m.useState(!1),[P,I]=m.useState([]),[R,O]=m.useState(!0),[E,$]=m.useState(!1),[B,ee]=m.useState(null),[te,K]=m.useState(null),[ne,Re]=m.useState(null),[Q,G]=m.useState(null),[le,F]=m.useState([]),{showTutorial:A,markAsSeen:M}=y0("tuto_events"),V=[{title:"ð Bienvenue dans les Sorties !",description:"Découvre et participe aux super événements organisés par la communauté. Tu as une idée ? Crée ta propre sortie, c'est le meilleur moyen de rencontrer du monde en vrai !",icon:cr},{title:"Créer et Valider",description:"Tu peux soumettre une sortie, mais attention : elle n'est visible que pour les contacts de ton Espace et demande parfois la validation des participants.",icon:nr}],H=async()=>{O(!0);try{let ue=D.from("events").select("*, creator:profiles(id, name, photo, avatar_url, animated_photo_url)").or(`spaces.cs.["${r.toLowerCase()}"],mode.eq.${r.toLowerCase()}`);u?ue=ue.lt("date",new Date().toISOString()).order("date",{ascending:!1}):ue=ue.gte("date",new Date().toISOString()).order("date",{ascending:!0});const{data:xe,error:ke}=await ue;if(ke){console.error("Error fetching events:",ke),I([]);return}I(xe||[])}catch(ue){console.error("Error fetching events:",ue),I([])}finally{O(!1)}},N=async()=>
2260{if(Q)try{const{error:ue}=await D.from("events").delete().eq("id",Q.id);if(ue)throw ue;G(null),H()}catch(ue){console.error("Error deleting event:",ue),e.error("Erreur lors de la suppression.")}};m.useEffect(()=>{H()},[r,u]),m.useEffect(()=>{if(!R)return;const ue=setTimeout(()=>{O(!1)},1e4);return()=>clearTimeout(ue)},[R]),m.useEffect(()=>{const xe=new URLSearchParams(window.location.search).get("rate");if(!xe)return;(async()=>{try{const{data:Pe}=await D.from("events").select("*, creator:profiles(id, name, photo, avatar_url, animated_photo_url)").eq("id",xe).single();Pe&&(g(!0),ee(Pe),window.history.replaceState({},"",window.location.pathname))}catch(Pe){console.warn("Could not open event for rating:",Pe)}})()},[]),m.useEffect(()=>{(async()=>{try{const xe=JSON.parse(localStorage.getItem("userProfile")),ke=xe==null?void 0:xe.location,Pe=(typeof ke=="string"?ke:(ke==null?void 0:ke.city)||(ke==null?void 0:ke.name)||"").toLowerCase(),{data:Ce}=await D.from("events").select("creator_id").not("creator_id","is",null);if(!Ce||Ce.length===0)return;const Me=[...new Set(Ce.map(De=>De.creator_id))],{data:Le}=await D.from("profiles").select("id, name, avatar_url, photo, animated_photo_url, location").in("id",Me);if(!Le||Le.length===0)return;const{data:rt}=await D.from("event_ratings").select("organizer_id, rating"),Fe={};(rt||[]).forEach(De=>{Fe[De.organizer_id]||(Fe[De.organizer_id]=[]),Fe[De.organizer_id].push(De.rating)});const ft=Le.map(De=>{var nt,J;const Be=Fe[De.id]||[],re=Be.length>0?Be.reduce((Ie,z)=>Ie+z,0)/Be.length:0,He=typeof De.location=="string"?De.location:((nt=De.location)==null?void 0:nt.city)||((J=De.location)==null?void 0:J.name)||"",be=Pe&&He&&He.toLowerCase().includes(Pe);return{...De,avg:re,count:Be.length,isNearby:be}});ft.sort((De,Be)=>De.count>0&&Be.count===0?-1:De.count===0&&Be.count>0?1:De.count>0&&Be.count>0?Be.avg!==De.avg?Be.avg-De.avg:Be.count-De.count:De.isNearby&&!Be.isNearby?-1:!De.isNearby&&Be.isNearby?1:0),F(ft.slice(0,20))}catch(xe){console.warn("Failed to fetch top organizers:",xe)}})()},[]),m.useEffect(()=>{(async()=>{try{const xe=JSON.parse(localStorage.getItem("userProfile")||"{}");if(!(xe!=null&&xe.id))return;const{data:ke}=await D.from("event_participants").select("event_id, status").eq("user_id",xe.id).eq("status","approved");if(!ke||ke.length===0)return;const Pe=ke.map(Be=>Be.event_id),{data:Ce}=await D.from("events").select("*, creator:profiles(id, name, avatar_url, photo, animated_photo_url)").in("id",Pe).lt("date",new Date().toISOString());if(!Ce||Ce.length===0)return;const{data:Me}=await D.from("event_ratings").select("event_id").eq("user_id",xe.id).in("event_id",Ce.map(Be=>Be.id)),Le=new Set((Me||[]).map(Be=>Be.event_id)),rt=new Set(JSON.parse(localStorage.getItem("postEventNotified")||"[]")),Fe=Ce.filter(Be=>!Le.has(Be.id)&&!rt.has(Be.id));if(Fe.length===0)return;const ft=Fe.slice(0,3),De=[...rt];for(const Be of ft)try{const{data:re}=await D.functions.invoke("send-push-notification",{body:{type:"EVENT_RATING",targetUserId:xe.id,eventName:Be.title}});if((re==null?void 0:re.hasPush)===!1){const{sendPostEventRating:He}=await Wr(async()=>{const{sendPostEventRating:be}=await Promise.resolve().then(()=>na);return{sendPostEventRating:be}},void 0);await He(xe.id,Be,Be.creator)}De.push(Be.id)}catch(re){console.warn("Post-event notification failed for",Be.title,re)}localStorage.setItem("postEventNotified",JSON.stringify(De))}catch(xe){console.warn("Post-event notification check failed:",xe)}})()},[]);const Z=r==="FRIEND",ae=(ue,xe,ke,Pe)=>{const Me=(ke-ue)*Math.PI/180,Le=(Pe-xe)*Math.PI/180,rt=Math.sin(Me/2)**2+Math.cos(ue*Math.PI/180)*Math.cos(ke*Math.PI/180)*Math.sin(Le/2)**2;return 6371*2*Math.atan2(Math.sqrt(rt),Math.sqrt(1-rt))};m.useEffect(()=>{if(S===0||!y)return;const ue=P.filter(ke=>ke.location&&!w[ke.location.toLowerCase().trim()]);if(ue.length===0)return;const xe=[...new Set(ue.map(ke=>ke.location.toLowerCase().trim()))];Promise.all(xe.map(async ke=>{try{const Ce=await(await fetch(`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(ke)}&format=json&limit=1`)).json();if(Ce[0])return{city:ke,lat:parseFloat(Ce[0].lat),lon:parseFloat(Ce[0].lon)}}catch{}return null})).then(ke=>{const Pe={...w};
2260ke.filter(Boolean).forEach(Ce=>{Pe[Ce.city]={lat:Ce.lat,lon:Ce.lon}}),b(Pe)})},[P,S,y]);const X=()=>{y||(T(!0),navigator.geolocation.getCurrentPosition(ue=>{_({lat:ue.coords.latitude,lon:ue.coords.longitude}),T(!1)},()=>{T(!1)},{enableHighAccuracy:!1,timeout:8e3}))},he=r==="EROX"?{accent:"#ff4d4d",accentSoft:"#ff6b6b",accentBg:"rgba(255,0,0,0.2)",gradient:"linear-gradient(45deg, #ff0000, #990000)",btnColor:"white",iconColor:"#ff3333",spinnerColor:"#ff3333",emptyIcon:"rgba(255,51,51,0.3)"}:r==="FRIEND"?{accent:"#26A69A",accentSoft:"#4DB6AC",accentBg:"rgba(38,166,154,0.2)",gradient:"linear-gradient(135deg, #26A69A, #00796B)",btnColor:"white",iconColor:"#26A69A",spinnerColor:"#26A69A",emptyIcon:"rgba(38,166,154,0.3)"}:{accent:"#D4A574",accentSoft:"#E8C9A0",accentBg:"rgba(212,165,116,0.2)",gradient:"linear-gradient(135deg, #D4A574, #C5935E)",btnColor:"#1a1a2e",iconColor:"#D4A574",spinnerColor:"#D4A574",emptyIcon:"rgba(212,165,116,0.3)"},Ae=P.filter(ue=>{const xe=a.city===""||ue.location&&ue.location.toLowerCase().includes(a.city.toLowerCase()),ke=a.theme==="all"||ue.tags&&ue.tags.includes(a.theme);let Pe=!0;if(S>0&&y&&ue.location){const Ce=w[ue.location.toLowerCase().trim()];Ce&&(Pe=ae(y.lat,y.lon,Ce.lat,Ce.lon)<=S)}return xe&&ke&&Pe}),ze=r==="EROX"?So.flatMap(ue=>ue.items):Fn.flatMap(ue=>ue.items);return t.jsxs("div",{style:{height:"100vh",paddingTop:n?"70px":"100px",boxSizing:"border-box",background:i?"#FAF7F2":Z?"linear-gradient(180deg, #0A0F1C 0%, #151B2E 100%)":"var(--bg-dark)",color:i?"#2A2520":"white",display:"flex",flexDirection:"column",overflow:"hidden"},children:[t.jsx(b0,{isOpen:A,onClose:M,steps:V}),t.jsxs("div",{style:{padding:n?"12px 16px":"20px 40px",borderBottom:i?"1px solid rgba(140,115,75,0.15)":"1px solid rgba(255,255,255,0.05)",background:i?"rgba(250,247,242,0.7)":"rgba(20,20,30,0.5)",backdropFilter:"blur(10px)"},children:[t.jsxs("h1",{style:{fontFamily:"Outfit",fontSize:n?"1.3rem":"2.2rem",margin:0,display:"flex",alignItems:"center",gap:n?"8px":"15px"},children:[t.jsx(cr,{size:n?22:36,color:he.iconColor}),"Sorties ",r==="EROX"?"Erox":r==="FRIEND"?"Friend":"Eros"]}),!n&&t.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.9rem",margin:"4px 0 0"},children:"Découvrez les soirées et sorties exclusives de la communauté."})]}),t.jsxs("div",{style:{padding:n?"8px 16px":"8px 40px",borderBottom:i?"1px solid rgba(140,115,75,0.12)":"1px solid rgba(255,255,255,0.04)",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",background:i?"rgba(140,115,75,0.03)":"rgba(255,255,255,0.015)"},children:[le.length>0?t.jsxs("div",{onClick:()=>{mr(),x(!h)},style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 14px",borderRadius:"12px",background:h?i?"rgba(140,115,75,0.1)":"rgba(255,215,0,0.1)":i?"rgba(140,115,75,0.04)":"rgba(255,215,0,0.04)",border:h?i?"1.5px solid rgba(140,115,75,0.3)":"1px solid rgba(255,215,0,0.2)":i?"1.5px solid rgba(140,115,75,0.2)":"1px solid rgba(255,215,0,0.1)",cursor:"pointer",userSelect:"none",transition:"all 0.2s"},children:[t.jsx(kA,{size:13,color:"#FFD700"}),t.jsx("span",{style:{fontSize:"0.75rem",fontWeight:"700",color:i?"#5C4A30":"rgba(255,255,255,0.6)",fontFamily:"Outfit"},children:"ð Top Organisateurs"}),t.jsx(l0,{size:12,color:"rgba(255,255,255,0.3)",style:{transition:"transform 0.3s",transform:h?"rotate(180deg)":"rotate(0deg)"}})]}):t.jsx("div",{}),t.jsxs("button",{onClick:()=>{mr(),p(!d)},style:{display:"flex",alignItems:"center",gap:"6px",padding:"8px 14px",borderRadius:"12px",background:d?he.accentBg:i?"rgba(140,115,75,0.04)":"rgba(255,255,255,0.04)",border:d?`1.5px solid ${he.accent}40`:i?"1.5px solid rgba(140,115,75,0.2)":"1px solid rgba(255,255,255,0.08)",color:d?he.accent:i?"#5C4A30":"rgba(255,255,255,0.6)",cursor:"pointer",fontSize:"0.75rem",fontWeight:"700",fontFamily:"Outfit",transition:"all 0.2s"},children:[t.jsx(yS,{size:13})," Filtres"]})]}),h&&le.length>0&&t.jsx("div",{style:{padding:n?"8px 16px 10px":"8px 40px 10px",borderBottom:"1px solid rgba(255,255,255,0.04)",background:"rgba(255,215,0,0.02)",animation:"fadeIn 0.3s ease-out"},children:t.jsx("div",{className:"custom-scrollbar",style:{display:"flex",gap:"8px",flexWrap:n?"nowrap":"wrap",overflowX:n?"auto":"visible",overflowY:"hidden",paddingBottom:"4px",WebkitOverflowScrolling:"touch",msOverflowStyle:"none"},children:le.map((ue,xe)=>t.jsxs("div",{onClick:()=>o(`/profile-view/${ue.id}`),style:{flexShrink:0,background:xe===0?"linear-gradient(135deg, rgba(255,215,0,0.12), rgba(255,140,0,0.06))":"rgba(255,255,255,0.03)",border:xe===0?"1px solid rgba(255,215,0,0.25)":"1px solid rgba(255,255,255,0.06)",borderRadius:"12px",padding:"6px 12px 6px 6px",display:"flex",alignItems:"center",gap:"8px",cursor:"pointer",transition:"all 0.25s"},onMouseEnter:ke=>{ke.currentTarget.style.transform="translateY(-2px)",ke.currentTarget.style.boxShadow="0 4px 15px rgba(255,215,0,0.12)"},onMouseLeave:ke=>{ke.currentTarget.style.transform="none",ke.currentTarget.style.boxShadow="none"},children:[t.jsxs("div",{style:{position:"relative",flexShrink:0},children:[t.jsxs("div",{style:{width:"32px",height:"32px",borderRadius:"50%",overflow:"hidden",border:xe===0?"2px solid #FFD700":"1.5px solid rgba(255,255,255,0.12)",position:"relative"},children:[t.jsx("img",{src:ue.avatar_url||ue.photo||"https://via.placeholder.com/32",alt:ue.name,style:{width:"100%",height:"100%",objectFit:"cover"}}),ue.animated_photo_url&&t.jsx("video",{src:ue.animated_photo_url,autoPlay:!0,loop:!0,muted:!0,playsInl
2260ine:!0,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",zIndex:1}})]}),xe<3&&t.jsx("div",{style:{position:"absolute",top:"-4px",right:"-4px",width:"16px",height:"16px",borderRadius:"50%",background:xe===0?"linear-gradient(135deg, #FFD700, #FF8C00)":xe===1?"linear-gradient(135deg, #C0C0C0, #888)":"linear-gradient(135deg, #CD7F32, #8B5A2B)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.5rem",fontWeight:"800",color:xe===0?"black":"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)"},children:xe+1})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1px",minWidth:0},children:[t.jsx("span",{style:{fontSize:"0.75rem",fontWeight:"600",color:"white",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100px"},children:ue.name||"Anonyme"}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"3px"},children:[ue.count>0?t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{display:"flex"},children:Array.from({length:5},(ke,Pe)=>t.jsx(nr,{size:8,fill:Pe<Math.round(ue.avg)?"#FFD700":"transparent",color:Pe<Math.round(ue.avg)?"#FFD700":"rgba(255,255,255,0.15)"},Pe))}),t.jsxs("span",{style:{fontSize:"0.6rem",color:"rgba(255,255,255,0.35)"},children:["(",ue.count,")"]})]}):t.jsx("span",{style:{fontSize:"0.6rem",color:"rgba(255,255,255,0.3)",fontStyle:"italic"},children:"Nouveau"}),ue.isNearby&&t.jsx("span",{style:{fontSize:"0.55rem",background:"rgba(100,200,255,0.15)",color:"#7ac8ff",padding:"0px 4px",borderRadius:"4px"},children:"ð"})]})]})]},ue.id))})}),d&&t.jsx("div",{style:{padding:n?"10px 16px":"10px 40px",borderBottom:"1px solid rgba(255,255,255,0.04)",background:"rgba(20,20,30,0.3)",animation:"fadeIn 0.3s ease-out"},children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[t.jsxs("div",{style:{display:"flex",borderRadius:"12px",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",overflow:"hidden"},children:[t.jsx("button",{onClick:()=>{mr(),g(!1)},style:{flex:1,padding:"9px",border:"none",cursor:"pointer",fontSize:"0.8rem",fontWeight:"600",background:u?"transparent":he.accentBg,color:u?"rgba(255,255,255,0.4)":"white",transition:"all 0.2s"},children:"ð
à venir"}),t.jsx("button",{onClick:()=>{mr(),g(!0)},style:{flex:1,padding:"9px",border:"none",cursor:"pointer",fontSize:"0.8rem",fontWeight:"600",background:u?"rgba(255,255,255,0.1)":"transparent",color:u?"white":"rgba(255,255,255,0.4)",transition:"all 0.2s"},children:"â Passés"})]}),t.jsxs("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:[t.jsxs("div",{style:{flex:1,minWidth:"140px",background:"rgba(0,0,0,0.3)",borderRadius:"12px",padding:"9px 14px",display:"flex",alignItems:"center",gap:"6px",border:"1px solid rgba(255,255,255,0.1)"},children:[t.jsx(ur,{size:14,color:"#666"}),t.jsx("input",{type:"text",placeholder:"Ville...",value:a.city,onChange:ue=>l({...a,city:ue.target.value}),style:{background:"transparent",border:"none",color:"white",fontSize:"0.82rem",width:"100%",outline:"none"}})]}),t.jsxs("div",{style:{position:"relative",minWidth:"130px",flex:1},children:[t.jsxs("select",{value:a.theme,onChange:ue=>l({...a,theme:ue.target.value}),style:{width:"100%",padding:"9px 14px",borderRadius:"12px",background:"rgba(0,0,0,0.3)",border:"1px solid rgba(255,255,255,0.1)",color:"white",appearance:"none",cursor:"pointer",fontSize:"0.82rem"},children:[t.jsx("option",{value:"all",children:"Tous les thèmes"}),ze.map(ue=>t.jsx("option",{value:ue.id,children:ue.label},ue.id))]}),t.jsx("div",{style:{position:"absolute",right:"10px",top:"50%",transform:"translateY(-50%)",pointerEvents:"none",color:"#666",fontSize:"0.65rem"},children:"â¼"})]})]}),t.jsxs("div",{style:{background:"rgba(0,0,0,0.3)",borderRadius:"12px",padding:"10px 14px",border:"1px solid rgba(255,255,255,0.1)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"6px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(d0,{size:13,color:he.accent}),t.jsx("span",{style:{fontSize:"0.8rem",fontWeight:"600",color:"rgba(255,255,255,0.7)"},children:"Autour de moi"})]}),t.jsx("span",{style:{fontSize:"0.75rem",fontWeight:"700",color:S>0?he.accent:"rgba(255,255,255,0.3)"},children:S===0?"Désactivé":`${S} km`})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx("span",{style:{fontSize:"0.65rem",color:"rgba(255,255,255,0.3)"},children:"Off"}),t.jsx("input",{type:"range",min:"0",max:"200",step:"10",value:S,onChange:ue=>{const xe=parseInt(ue.target.value);k(xe),xe>0&&X()},style:{flex:1,height:"4px",accentColor:he.accent,cursor:"pointer"}}),t.jsx("span",{style:{fontSize:"0.65rem",color:"rgba(255,255,255,0.3)"},children:"200km"})]}),j&&t.jsx("div",{style:{fontSize:"0.7rem",color:he.accentSoft,marginTop:"4px"},children:"ð¡ Localisation en cours..."}),S>0&&!y&&!j&&t.jsx("div",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.4)",marginTop:"4px"},children:"â ï¸ Activez la géolocalisation"})]})]})}),t.jsx("div",{className:"custom-scrollbar",style:{flex:1,overflowY:"auto",padding:n?"16px":"40px",paddingBottom:"100px"},children:R?t.jsxs("div",{style:{textAlign:"center",padding:"80px 20px",color:"rgba(255,255,255,0.5)"},children:[t.jsx("div",{style:{width:"48px",height:"48px",border:"3px solid rgba(255,255,255,0.15)",borderTop:`3px solid ${he.spinnerColor}`,borderRadius:"50%",animation:"spin 1s linear infinite",margin:"0 auto 20px"}}),t.jsx("style",{children:"@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }"}),t.jsx("p",{style:{fontSize:"1rem",margin:0},children:"Chargement des événements..."})]}):Ae.length===0?t.jsxs("div",{style:{textAlign:"center",padding:n?"50px 20px":"80px",border:"2px dashed rgba(255,255,255,0.12)",borderRadius:"24px",background:"rgba(255,255,255,0.02)"},children:[t.jsx(cr,{size:60,style:{marginBottom:"20px",color:he.emptyIcon}}),t.jsx("h3",{style:{fontSize:n?"1.15rem":"1.4rem",marginBottom:"8px",fontFamily:"Outfit",color:"rgba(255,255,255,0.8)"},children:u?"Aucun événement passé":"Aucun événement à venir"}),t.jsx("p",{style:{color:"rgba(255,255,255,0.45)",marginBottom:"25px",fontSize:"0.9rem"},children:u?"Les événements terminés apparaîtront ici.":"Soyez le premier à créer un événement ! ð"}),!u&&t.jsxs("button",{onClick:()=>$(!0),style:{padding:"12px 28px",borderRadius:"20px",background:he.gradient,color:he.btnColor,border:"none",cursor:"pointer",fontWeight:"700",fontSize:"0.9rem"},children:[t.jsx(No,{size:16,style:{verticalAlign:"middle",marginRight:"6px"}})," Créer un événement"]}),(a.city||a.theme!=="all")&&t.jsx("button",{onClick:()=>l({city:"",theme:"all",ageMax:100}),style:{padding:"10px 20px",borderRadius:"20px",border:"1px solid rgba(255,255,255,0.15)",background:"transparent",color:"rgba(255,255,255,0.5)",cursor:"pointer",fontSize:"0.82rem",marginLeft:"10px"},children:"Réinitialiser les filtres"})]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:n?"1fr":"repeat(auto-fill, minmax(340px, 1fr))",gap:"16px"},children:Ae.map(ue=>
2260t.jsx($7,{event:ue,onClick:()=>ee(ue)},ue.id))})}),t.jsx("button",{onClick:()=>{mr(),$(!0)},style:{position:"fixed",bottom:n?"90px":"32px",right:n?"20px":"32px",width:"56px",height:"56px",borderRadius:"50%",background:he.gradient,color:he.btnColor,border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:`0 6px 24px ${he.accent}60, 0 2px 8px rgba(0,0,0,0.3)`,zIndex:50,transition:"transform 0.2s, box-shadow 0.2s"},onMouseEnter:ue=>{ue.currentTarget.style.transform="scale(1.1)"},onMouseLeave:ue=>{ue.currentTarget.style.transform="scale(1)"},children:t.jsx(No,{size:26,strokeWidth:2.5})}),B&&t.jsx(lP,{event:B,onClose:()=>ee(null),onManage:(ue,xe)=>{ee(null),xe?Re(ue):K(ue)},onRequestDelete:ue=>{ee(null),G(ue)}}),(E||ne)&&t.jsx(U7,{initialData:ne,onClose:()=>{$(!1),Re(null)},onSuccess:H}),te&&t.jsx(sP,{event:te,onClose:()=>K(null)}),Q&&t.jsx(aP,{event:Q,onClose:()=>G(null),onConfirm:N})]})},cP=({onCapture:e,onCancel:r})=>{const i=m.useRef(null),n=m.useRef(null),[o,a]=m.useState(null),[l,d]=m.useState(null),[p,u]=m.useState(null),[g,h]=m.useState(!0),x=m.useCallback(async()=>{h(!0),u(null);try{const w=await navigator.mediaDevices.getUserMedia({video:{facingMode:"user",width:640,height:480}});a(w),i.current&&(i.current.srcObject=w)}catch(w){console.error("Camera access error:",w),u("Impossible d'accéder à la caméra. Vérifiez les permissions.")}finally{h(!1)}},[]),y=m.useCallback(()=>{o&&(o.getTracks().forEach(w=>w.stop()),a(null))},[o]);m.useEffect(()=>(x(),()=>y()),[]);const _=()=>{if(!i.current||!n.current)return;const w=i.current,b=n.current,j=b.getContext("2d");b.width=w.videoWidth,b.height=w.videoHeight,j.translate(b.width,0),j.scale(-1,1),j.drawImage(w,0,0);const T=b.toDataURL("image/jpeg",.8);d(T),y()},S=()=>{d(null),x()},k=async()=>{if(!l)return;const b=await(await fetch(l)).blob();e(b)};return t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"20px",padding:"20px"},children:[t.jsx("div",{style:{width:"280px",height:"280px",borderRadius:"50%",overflow:"hidden",border:"4px solid var(--primary)",background:"rgba(0,0,0,0.5)",position:"relative"},children:p?t.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",textAlign:"center",padding:"20px",color:"#ff4d4d",fontSize:"0.9rem"},children:p}):g?t.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:t.jsx(kn,{size:32,className:"spin",color:"var(--primary)"})}):l?t.jsx("img",{src:l,alt:"Selfie capturé",style:{width:"100%",height:"100%",objectFit:"cover"}}):t.jsx("video",{ref:i,autoPlay:!0,playsInline:!0,muted:!0,style:{width:"100%",height:"100%",objectFit:"cover",transform:"scaleX(-1)"}})}),t.jsx("canvas",{ref:n,style:{display:"none"}}),t.jsx("p",{style:{textAlign:"center",color:"var(--text-muted)",fontSize:"0.85rem",maxWidth:"280px",lineHeight:1.5},children:l?"Vérifiez que votre visage est bien visible":"Cadrez votre visage dans le cercle"}),t.jsx("div",{style:{display:"flex",gap:"15px"},children:l?t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:S,style:{padding:"12px 24px",borderRadius:"30px",background:"rgba(255,255,255,0.1)",border:"1px solid rgba(255,255,255,0.2)",color:"white",cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",fontSize:"0.9rem"},children:[t.jsx(kn,{size:16})," Reprendre"]}),t.jsxs("button",{onClick:k,style:{padding:"12px 24px",borderRadius:"30px",background:"linear-gradient(135deg, #3B82F6, #2563EB)",border:"none",color:"white",cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",fontSize:"0.9rem",fontWeight:"600",boxShadow:"0 4px 15px rgba(59, 130, 246, 0.4)"},children:[t.jsx(pr,{size:16})," Valider"]})]}):t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:r,style:{padding:"12px 24px",borderRadius:"30px",background:"transparent",border:"1px solid rgba(255,255,255,0.2)",color:"rgba(255,255,255,0.7)",cursor:"pointer",fontSize:"0.9rem"},children:"Annuler"}),t.jsxs("button",{onClick:_,disabled:g||p,style:{padding:"12px 30px",borderRadius:"30px",background:g||p?"rgba(255,255,255,0.1)":"linear-gradient(135deg, #3B82F6, #2563EB)",border:"none",color:"white",cursor:g||p?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",fontSize:"0.95rem",fontWeight:"600",boxShadow:g||p?"none":"0 4px 15px rgba(59, 130, 246, 0.4)"},children:[t.jsx(pi,{size:18})," Prendre la photo"]})]})}),t.jsx("style",{children:` 2261 @keyframes spin { 2262 to { transform: rotate(360deg); } 2263 } 2264 .spin { 2265 animation: spin 1s linear infinite; 2266 } 2267 `})]})},pP=({onClose:e,onUpload:r,uploading:i})=>{const{profile:n}=gr(),[o,a]=m.useState("explain"),[l,d]=m.useState(!1),p=async u=>
2267{if(!(n!=null&&n.id)){console.error("No profile ID!"),alert("Erreur: Pas de profil utilisateur");return}d(!0);try{const g=`${n.id}/verification_selfie.jpg`,y=$a("https://bqfzljnhxblhiabyvpqm.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4"),{error:_}=await y.storage.from("avatars").upload(g,u,{upsert:!0,contentType:"image/jpeg"});if(_)throw console.error("Storage upload error:",_),new Error("Upload du selfie échoué: "+_.message);const{data:S}=D.storage.from("avatars").getPublicUrl(g),k=S.publicUrl,{error:w}=await D.from("profiles").update({verification_status:"pending",verification_photo_url:k}).eq("id",n.id);if(w)throw console.error("Profile update error:",w),new Error(w.message||"Erreur mise à jour profil");d(!1),a("success"),setTimeout(()=>{window.location.reload()},4e3)}catch(g){console.error("=== VERIFICATION ERROR ===",g),alert(`Erreur: ${g.message}`),d(!1)}};return t.jsx("div",{style:{position:"fixed",inset:0,zIndex:1e3,display:"flex",alignItems:"center",justifyContent:"center",padding:"20px",background:"rgba(0,0,0,0.85)",backdropFilter:"blur(10px)"},children:t.jsxs(ye.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},style:{width:"100%",maxWidth:o==="capture"?"450px":"400px",background:"var(--bg-card)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"24px",padding:"30px",position:"relative",overflow:"hidden",boxShadow:"0 20px 50px rgba(0,0,0,0.5)"},children:[t.jsx("button",{onClick:e,style:{position:"absolute",top:"15px",right:"15px",background:"rgba(255,255,255,0.1)",border:"none",borderRadius:"50%",width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",color:"white",cursor:"pointer",zIndex:10},children:t.jsx(mt,{size:16})}),o==="explain"?t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{textAlign:"center",marginBottom:"25px"},children:[t.jsx("div",{style:{width:"80px",height:"80px",borderRadius:"50%",background:"rgba(59, 130, 246, 0.15)",margin:"0 auto 15px",display:"flex",alignItems:"center",justifyContent:"center",border:"2px solid rgba(59, 130, 246, 0.3)"},children:t.jsx(Sr,{size:40,color:"#3B82F6"})}),t.jsx("h2",{style:{fontSize:"1.5rem",margin:"0 0 5px",fontFamily:"Outfit"},children:"Badge de Confiance"}),t.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.9rem",margin:0},children:"Prouvez que c'est bien vous !"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px",marginBottom:"30px"},children:[t.jsxs("div",{style:{display:"flex",gap:"15px"},children:[t.jsx("div",{style:{width:"36px",height:"36px",borderRadius:"50%",background:"rgba(59, 130, 246, 0.2)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,fontWeight:"bold",border:"1px solid rgba(59, 130, 246, 0.3)",color:"#3B82F6"},children:"1"}),t.jsxs("div",{children:[t.jsx("h4",{style:{margin:"0 0 5px",fontSize:"1rem"},children:"Prenez un Selfie"}),t.jsx("p",{style:{margin:0,fontSize:"0.85rem",color:"var(--text-muted)"},children:"Activez votre webcam et prenez une photo en direct. Aucun upload depuis votre PC."})]})]}),t.jsxs("div",{style:{display:"flex",gap:"15px"},children:[t.jsx("div",{style:{width:"36px",height:"36px",borderRadius:"50%",background:"rgba(255,255,255,0.1)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,fontWeight:"bold",border:"1px solid rgba(255,255,255,0.05)"},children:"2"}),t.jsxs("div",{children:[t.jsx("h4",{style:{margin:"0 0 5px",fontSize:"1rem"},children:"Validation Admin"}),t.jsx("p",{style:{margin:0,fontSize:"0.85rem",color:"var(--text-muted)"},children:"Nos modérateurs comparent votre selfie avec vos photos de profil."})]})]}),t.jsxs("div",{style:{display:"flex",gap:"15px"},children:[t.jsx("div",{style:{width:"36px",height:"36px",borderRadius:"50%",background:"rgba(255,255,255,0.1)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,fontWeight:"bold",border:"1px solid rgba(255,255,255,0.05)"},children:"3"}),t.jsxs("div",{children:[t.jsx("h4",{style:{margin:"0 0 5px",fontSize:"1rem"},children:"Badge Validé !"}),t.jsxs("p",{style:{margin:0,fontSize:"0.85rem",color:"var(--text-muted)"},children:["Le badge ",t.jsx(Sr,{size:12,style:{verticalAlign:"middle"},color:"#3B82F6"})," apparaît sur votre profil."]})]})]})]}),t.jsxs("button",{onClick:()=>a("capture"),style:{width:"100%",height:"55px",borderRadius:"30px",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",fontSize:"1.1rem",fontWeight:"bold",cursor:"pointer",background:"linear-gradient(135deg, #3B82F6, #2563EB)",border:"none",color:"white",boxShadow:"0 4px 20px rgba(59, 130, 246, 0.4)"},children:[t.jsx(pi,{size:22})," Ouvrir ma Webcam"]}
2267),t.jsx("p",{style:{marginTop:"15px",textAlign:"center",fontSize:"0.75rem",color:"rgba(255,255,255,0.3)"},children:"Votre selfie sera supprimé après validation."})]}):o==="success"?t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{textAlign:"center",padding:"40px 20px",position:"relative",overflow:"hidden"},children:[t.jsx("div",{className:"confetti-container",children:[...Array(50)].map((u,g)=>t.jsx("div",{className:"confetti",style:{left:`${Math.random()*100}%`,animationDelay:`${Math.random()*2}s`,backgroundColor:["#3B82F6","#10B981","#F59E0B","#EF4444","#8B5CF6","#EC4899"][g%6]}},g))}),t.jsx(ye.div,{initial:{scale:0},animate:{scale:1},transition:{type:"spring",bounce:.5,duration:.6},style:{width:"100px",height:"100px",borderRadius:"50%",background:"linear-gradient(135deg, #10B981, #059669)",margin:"0 auto 25px",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 10px 40px rgba(16, 185, 129, 0.4)"},children:t.jsx(ms,{size:50,color:"white"})}),t.jsx(ye.h2,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3},style:{fontSize:"1.6rem",margin:"0 0 10px",fontFamily:"Outfit",color:"#10B981"},children:"Selfie Envoyé ! ð"}),t.jsxs(ye.p,{initial:{opacity:0}
2267,animate:{opacity:1},transition:{delay:.5},style:{color:"var(--text-muted)",fontSize:"0.95rem",margin:"0 0 20px",lineHeight:1.5},children:["Votre demande de vérification est en cours.",t.jsx("br",{}),"Nos modérateurs vous répondront rapidement."]}),t.jsxs(ye.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.7},style:{display:"inline-flex",alignItems:"center",gap:"8px",padding:"10px 20px",background:"rgba(59, 130, 246, 0.15)",borderRadius:"20px",color:"#3B82F6",fontSize:"0.85rem"},children:[t.jsx(Sr,{size:16})," Badge en attente de validation"]})]}),t.jsx("style",{children:` 2268 .confetti-container { 2269 position: absolute; 2270 top: 0; left: 0; right: 0; bottom: 0; 2271 overflow: hidden; 2272 pointer-events: none; 2273 } 2274 .confetti { 2275 position: absolute; 2276 width: 10px; 2277 height: 10px; 2278 top: -10px; 2279 border-radius: 2px; 2280 animation: confetti-fall 3s linear forwards; 2281 } 2282 @keyframes confetti-fall { 2283 0% { transform: translateY(0) rotate(0deg); opacity: 1; } 2284 100% { transform: translateY(400px) rotate(720deg); opacity: 0; } 2285 } 2286 `})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{textAlign:"center",marginBottom:"10px"},children:[t.jsx("h2",{style:{fontSize:"1.3rem",margin:"0 0 5px",fontFamily:"Outfit"},children:"Prenez votre selfie"}),t.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.85rem",margin:0},children:"Regardez la caméra et souriez !"})]}),l?t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"60px 0",gap:"15px"},children:[t.jsx(qs,{size:40,className:"spin",color:"#3B82F6"}),t.jsx("p",{style:{color:"var(--text-muted)"},children:"Envoi en cours..."})]}):t.jsx(cP,{onCapture:p,onCancel:()=>a("explain")}),t.jsx("style",{children:` 2287 @keyframes spin { 2288 to { transform: rotate(360deg); } 2289 } 2290 .spin { 2291 animation: spin 1s linear infinite; 2292 } 2293 `})]})]})})},uP=()=>{const e=si(),r=Lt(),{profile:i,signOut:n}=gr(),{isErox:o,isFriend:a,lightMode:l}=dr(),d=i||JSON.parse(localStorage.getItem("userProfile")||"null"),p=localStorage.getItem("isPremium")==="true",u=o?d==null?void 0:d.erox_avatar_url:a?d==null?void 0:d.friend_avatar_url:(d==null?void 0:d.avatar_url)||(d==null?void 0:d.photo),g=o?"Erox":a?"Friend":"Eros",h=o?"#ff4d4d":a?"#26A69A":"#D4A574",x=o?{t1:"#ff4d4d",t2:"#ff6b6b",t3:"#e63939",t4:"#cc0000",t5:"#ff9999",t6:"#ff3333",bg1:"rgba(255,77,77,0.12)",bg2:"rgba(255,107,107,0.12)",bg3:"rgba(230,57,57,0.12)",bg4:"rgba(204,0,0,0.12)",bg5:"rgba(255,153,153,0.10)",bg6:"rgba(255,51,51,0.12)",gradient:"linear-gradient(135deg, #ff4d4d, #cc0000)"}:a?{t1:"#26A69A",t2:"#4DB6AC",t3:"#00897B",t4:"#00796B",t5:"#80CBC4",t6:"#009688",bg1:"rgba(38,166,154,0.12)",bg2:"rgba(77,182,172,0.12)",bg3:"rgba(0,137,123,0.12)",bg4:"rgba(0,121,107,0.12)",bg5:"rgba(128,203,196,0.10)",bg6:"rgba(0,150,136,0.12)",gradient:"linear-gradient(135deg, #26A69A, #00796B)"}:{t1:"#D4A574",t2:"#E8C9A0",t3:"#C5935E",t4:"#B8864A",t5:"#DAB68C",t6:"#A67C52",bg1:"rgba(212,165,116,0.12)",bg2:"rgba(232,201,160,0.12)",bg3:"rgba(197,147,94,0.12)",bg4:"rgba(184,134,74,0.12)",bg5:"rgba(218,182,140,0.10)",bg6:"rgba(166,124,82,0.12)",gradient:"linear-gradient(135deg, #D4A574, #C5935E)"},[y,_]=m.useState(0),[S,k]=m.useState(0),[w,b]=m.useState(0),[j,T]=m.useState(!1),[P,I]=m.useState(!1),[R,O]=m.useState([]),[E,$]=m.useState(null),[B,ee]=m.useState(!1),te=11,K=async M=>{try{const V=d.meetips_balance||0;if(V<te){e.error(`Solde insuffisant (${V}/${te} Meetips)`);return}const H=V-te,{error:N}=await D.from("meetips_transactions").insert({user_id:d.id,amount:-te,description:"ðï¸ Bio vocale"});if(N)throw N;const{error:Z}=await D.from("profiles").update({voice_bio_url:M,meetips_balance:H}).eq("id",d.id);if(Z)throw Z;const ae=JSON.parse(localStorage.getItem("userProfile")||"{}");localStorage.setItem("userProfile",JSON.stringify({...ae,voice_bio_url:M,meetips_balance:H})),id(),e.success(`Bio vocale enregistrée ! (-${te} Meetips)`),ee(!1),setTimeout(()=>window.location.reload(),600)}catch(V){console.error("Error saving voice bio",V),e.error("Erreur lors de la sauvegarde: "+V.message)}},ne=async()=>
2293{if(confirm("Supprimer votre bio vocale ? (Aucun remboursement)"))try{const{error:M}=await D.from("profiles").update({voice_bio_url:null}).eq("id",d.id);if(M)throw M;const V=JSON.parse(localStorage.getItem("userProfile")||"{}");localStorage.setItem("userProfile",JSON.stringify({...V,voice_bio_url:null})),e.success("Bio vocale supprimée."),setTimeout(()=>window.location.reload(),600)}catch(M){console.error("Error deleting voice bio",M),e.error("Erreur lors de la suppression: "+M.message)}};m.useEffect(()=>{if(!(d!=null&&d.id))return;(async()=>{try{const{count:H}=await D.from("likes").select("*",{count:"exact",head:!0}).eq("sender_id",d.id),{count:N}=await D.from("likes").select("*",{count:"exact",head:!0}).eq("receiver_id",d.id);_(H||0),k(N||0);const{count:Z}=await D.from("profile_views").select("*",{count:"exact",head:!0}).eq("viewed_id",d.id);b(Z||0)}catch(H){console.error("Error fetching stats:",H)}})(),(async()=>{try{const{data:H}=await D.from("bot_assignments").select("bot_id, space").eq("user_id",d.id);if(H&&H.length>0){const N=H.map(ae=>ae.bot_id),{data:Z}=await D.from("matches").select("id, name, photo_url, photos_eros, photos_erox, photos_friend, bio, age, tags, gender, personality, space, animated_photo_url").in("id",N);if(Z){const ae=Z.map(X=>{var Ae;const he=H.find(ze=>ze.bot_id===X.id);return{...X,is_bot:!0,assigned_space:(he==null?void 0:he.space)||X.space||"EROS",avatar_url:((Ae=X.photos_eros)==null?void 0:Ae[0])||X.photo_url}});O(ae)}}}catch{try{const{data:N}=await D.from("matches").select("id, name, photo_url, photos_eros, photos_erox, photos_friend, bio, age, tags, gender, personality, space, animated_photo_url");N&&N.length>0&&O(N.map(Z=>{var ae;return{...Z,is_bot:!0,assigned_space:Z.space||"EROS",avatar_url:((ae=Z.photos_eros)==null?void 0:ae[0])||Z.photo_url}}))}catch(N){console.error("Error fetching bots fallback:",N)}}})()},[d==null?void 0:d.id]);const Re=async M=>{const V=M.target.files[0];if(V){T(!0);try{const H=V.name.split(".").pop(),N=`${d.id}_verification_${Date.now()}.${H}`,{error:Z}=await D.storage.from("verification_photos").upload(N,V);if(Z)throw Z;const{data:{publicUrl:ae}}=D.storage.from("verification_photos").getPublicUrl(N),{error:X}=await D.from("profiles").update({verification_status:"pending",verification_photo_url:ae}).eq("id",d.id);if(X)throw X;window.location.reload()}catch(H){console.error("Error uploading verification:",H),e.error("Erreur lors de l'envoi. Réessayez.")}finally{T(!1)}}},{loading:Q}=gr();if(Q)return t.jsxs("div",{style:{height:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"white",background:"var(--bg-deep)"},children:[t.jsx("div",{style:{fontSize:"2rem",marginBottom:"16px",animation:"gm-float 1.5s ease-in-out infinite"},children:"â³"}),t.jsx("p",{style:{color:"rgba(255,255,255,0.5)"},children:"Chargement du profil..."})]});if(!d)return t.jsxs("div",{style:{height:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"white",background:"var(--bg-deep)"},children:[t.jsx("p",{children:"Profil introuvable ou erreur de chargement."}),t.jsx("button",{onClick:()=>window.location.reload(),style:{marginTop:"10px",padding:"10px 20px",borderRadius:"8px",background:"var(--primary)",border:"none",color:"white",cursor:"pointer"},children:"Rafraîchir"})]});const G=d.meetips_balance||0,le=[{icon:rr,label:"Voir Profil",color:x.t1,bg:x.bg1,onClick:()=>r(`/profile-view/${d.id}`)},{icon:Vo,label:"Modifier",color:x.t2,bg:x.bg2,onClick:()=>r("/complete-profile")},{icon:pi,label:"Photos",color:x.t3,bg:x.bg3,onClick:()=>r("/edit-criteria")},{icon:dx,label:"Paramètres",color:x.t6,bg:x.bg6,onClick:()=>r("/settings")}],F=[{icon:rr,value:w,label:"Vues du profil",color:x.t1,bg:x.bg1,onClick:()=>r("/matches?view=profile_viewers")},{icon:Bt,value:y,label:"Coups de CÅur",color:x.t2,bg:x.bg2,onClick:()=>r("/matches?view=given_likes")},{icon:Bt,value:S,label:"Likes Reçus",color:x.t3,bg:x.bg3,fill:!0,onClick:()=>r("/matches?view=received_likes")},{icon:p?ni:oi,value:p?"PREMIUM":"FREE",label:p?"Actif":"Basic",color:x.t4,bg:x.bg4,onClick:()=>r("/subscription")},{icon:Sr,value:d.verification_status==="verified"?"Vérifié":d.verification_status==="pending"?"En cours":"Vérifier",label:"Badge confiance",color:x.t5,bg:x.bg5,fill:d.verification_status==="verified",onClick:()=>!d.verification_status||d.verification_status==="none"||d.verification_status==="rejected"?I(!0):null},{icon:Xt,value:G,label:"Meetips",color:x.t6,bg:x.bg6,onClick:()=>r("/shop")}],A=[...d.role==="admin"?[{icon:Sr,color:x.t5,bg:x.bg5,label:"Administration",sub:"Gestion utilisateurs & Reports",path:"/admin"}]:[],{icon:p?ni:oi,color:p?x.t2:"rgba(255,255,255,0.5)",bg:p?x.bg2:"rgba(255,255,255,0.05)",label:p?"Membre Premium":"Devenir Premium",sub:p?"Gérer mon abonnement":"Débloquez tout le potentiel",path:"/subscription",gold:p}];return t.jsxs("div",{style:{minHeight:"100vh",background:"var(--bg-deep)",paddingBottom:"100px",overflowX:"hidden"},children:[t.jsxs("div",{style:{position:"relative",width:"100%",height:"420px",marginTop:"-70px",overflow:"hidden"}
2293,children:[!o&&!a&&d.animated_photo_url?t.jsx("video",{src:d.animated_photo_url,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"center 20%"}}):u?t.jsx("img",{src:u,alt:d.name,style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"center 20%"}}):t.jsxs("div",{onClick:()=>r("/edit-criteria"),style:{width:"100%",height:"100%",paddingTop:"80px",background:"linear-gradient(180deg, rgba(30,30,40,0.95), rgba(15,15,25,0.98))",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"16px",cursor:"pointer",position:"relative",zIndex:3},children:[t.jsx("div",{style:{width:"80px",height:"80px",borderRadius:"50%",border:`3px dashed ${h}50`,background:"rgba(255,255,255,0.03)",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(pi,{size:32,color:`${h}70`})}),t.jsxs("span",{style:{color:"rgba(255,255,255,0.5)",fontSize:"0.95rem",fontWeight:"600",fontFamily:"Outfit"},children:["Ajouter votre photo ",g]}),t.jsx("span",{style:{color:"rgba(255,255,255,0.25)",fontSize:"0.75rem"},children:"Appuyez pour télécharger"})]}),t.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:"65%",background:"linear-gradient(to top, var(--bg-deep) 0%, rgba(10,8,20,0.85) 30%, rgba(10,8,20,0.4) 60%, transparent 100%)",pointerEvents:"none"}}),t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"120px",background:"linear-gradient(to bottom, rgba(0,0,0,0.4), transparent)",pointerEvents:"none"}}),t.jsxs("div",{style:{position:"absolute",bottom:"20px",left:0,right:0,textAlign:"center",zIndex:2},children:[p&&t.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"6px",background:"linear-gradient(135deg, rgba(251,191,36,0.25), rgba(245,158,11,0.15))",border:"1px solid rgba(251,191,36,0.4)",padding:"5px 14px",borderRadius:"20px",marginBottom:"10px",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},children:[t.jsx(ni,{size:14,color:"#fbbf24",fill:"#fbbf24"}),t.jsx("span",{style:{fontSize:"0.72rem",fontWeight:"700",color:"#fbbf24",fontFamily:"Outfit"},children:"Premium"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"center",marginBottom:"4px"},children:[t.jsx("h1",{style:{fontFamily:"Outfit",fontSize:"2.2rem",margin:0,fontWeight:"800",color:"white",textShadow:"0 2px 10px rgba(0,0,0,0.5)"},children:o?d.erox_name||d.name:a&&d.friend_name||d.name}),d.verification_status==="verified"&&t.jsx(Sr,{size:22,fill:"#26A69A",color:"#103030",style:{filter:"drop-shadow(0 2px 4px rgba(0,0,0,0.3))"}})]}),t.jsxs("p",{style:{color:"rgba(255,255,255,0.65)",fontSize:"0.92rem",margin:0,display:"flex",alignItems:"center",gap:"8px",justifyContent:"center",textShadow:"0 1px 6px rgba(0,0,0,0.5)"},children:[t.jsx(Xt,{size:14,color:h})," ",d.archetype||"Explorateur Cosmique"]})]})]}),t.jsx("div",{style:{padding:"0 20px",marginTop:"16px",marginBottom:"28px",display:"flex",justifyContent:"center",gap:"20px"},children:le.map((M,V)=>t.jsxs("div",{onClick:M.onClick,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",cursor:"pointer",transition:"transform 0.2s"},onMouseEnter:H=>H.currentTarget.style.transform="translateY(-3px)",onMouseLeave:H=>H.currentTarget.style.transform="translateY(0)",children:[t.jsx("div",{style:{width:"56px",height:"56px",borderRadius:"18px",background:l?M.color:M.bg,border:l?`2px solid ${M.color}`:`1px solid ${M.color}33`,display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)",boxShadow:l?`0 4px 14px ${M.color}40`:`0 4px 20px ${M.color}15`,transition:"all 0.3s"},children:t.jsx(M.icon,{size:22,color:l?"white":M.color})}),t.jsx("span",{style:{fontSize:"0.72rem",color:l?"#3D3528":"rgba(255,255,255,0.5)",fontWeight:"600"},children:M.label})]},V))}),t.jsx("div",{style:{padding:"0 20px",marginBottom:"24px"},children:t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"10px"},children:F.map((M,V)=>t.jsxs("div",{onClick:M.onClick,style:{padding:"18px 10px",borderRadius:"18px",background:l?`${M.color}12`:M.bg,border:l?`2px solid ${M.color}`:`1px solid ${M.color}18`,display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",cursor:M.onClick?"pointer":"default",backdropFilter:"blur(16px)",WebkitBackdropFilter:"blur(16px)",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",boxShadow:l?`0 3px 12px ${M.color}20`:"none"},onMouseEnter:H=>{H.currentTarget.style.transform="scale(1.05)",H.currentTarget.style.boxShadow=`0 8px 30px ${M.color}30`},onMouseLeave:H=>{H.currentTarget.style.transform="scale(1)",H.currentTarget.style.boxShadow=l?`0 3px 12px ${M.color}20`:"none"},children:[t.jsx(M.icon,{size:20,color:M.color,fill:M.fill?M.color:"none",style:{marginBottom:"6px"}}),t.jsx("span",{style:{fontSize:typeof M.value=="number"?"1.5rem":"0.85rem",fontWeight:"800",color:l?t
2293ypeof M.value=="number"?"#1A1510":M.color:typeof M.value=="number"?"white":M.color,lineHeight:1},children:M.value}),t.jsx("span",{style:{fontSize:"0.68rem",color:l?"#6B5D4F":"rgba(255,255,255,0.35)",marginTop:"4px"},children:M.label})]},V))})}),t.jsx("div",{style:{padding:"0 20px",marginBottom:"24px"},children:t.jsx("div",{style:{borderRadius:"22px",overflow:"hidden",background:l?`linear-gradient(135deg, ${h}10, ${h}05)`:`linear-gradient(135deg, ${x.bg1} 0%, ${x.bg6} 100%)`,border:l?`2.5px solid ${h}`:`1px solid ${h}25`,backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)",padding:"24px",boxShadow:l?`0 4px 20px ${h}20`:"none"},children:t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t.jsxs("div",{children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"6px"},children:[t.jsx(kS,{size:20,color:x.t1}),t.jsx("span",{style:{fontFamily:"Outfit",fontWeight:"700",fontSize:"1rem",color:l?"#1A1510":"rgba(255,255,255,0.7)"},children:"Portefeuille Meetips"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"6px"},children:[t.jsx("span",{style:{fontFamily:"Outfit",fontSize:"2.4rem",fontWeight:"900",color:x.t1},children:G}),t.jsx("span",{style:{color:l?"#6B5D4F":"rgba(255,255,255,0.3)",fontSize:"0.9rem"},children:"Meetips"})]})]}),t.jsxs("button",{onClick:()=>r("/shop"),style:{background:x.gradient,border:"none",color:o||a?"white":"#1a1a2e",padding:"12px 20px",borderRadius:"14px",fontFamily:"Outfit",fontWeight:"700",fontSize:"0.85rem",cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",boxShadow:`0 4px 20px ${h}50`,transition:"transform 0.2s"},onMouseEnter:M=>M.currentTarget.style.transform="scale(1.05)",onMouseLeave:M=>M.currentTarget.style.transform="scale(1)",children:[t.jsx(ys,{size:16})," Recharger"]})]})})}),R.length>0&&t.jsxs("div",{style:{padding:"0 20px",marginBottom:"24px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"14px",padding:"0 4px"},children:[t.jsx(Kn,{size:20,color:x.t2}),t.jsx("h3",{style:{margin:0,fontSize:"1.1rem",fontFamily:"Outfit",fontWeight:"700"},children:"Mes Animateurs IA"}),t.jsxs("span",{style:{fontSize:"0.7rem",padding:"3px 8px",borderRadius:"8px",background:x.bg2,color:x.t2,fontWeight:"600"},children:[R.length," dédié",R.length>1?"s":""]})]}),t.jsx("div",{style:{display:"flex",gap:"12px",overflowX:"auto",paddingBottom:"8px"},children:R.map((M,V)=>{const H=Ho[M.personality]||Ho.bienveillant,Z={EROS:"â¤ï¸ Eros",EROX:"ð¥ Erox",FRIEND:"ð¤ Friend"}[M.assigned_space]||"â¤ï¸ Eros";return t.jsxs("div",{style:{minWidth:"220px",maxWidth:"240px",height:"340px",borderRadius:"20px",overflow:"hidden",background:"rgba(0,0,0,0.3)",border:`1px solid ${H.color}25`,display:"flex",flexDirection:"column",transition:"all 0.3s",cursor:"pointer",position:"relative"},onClick:()=>$(M),onMouseEnter:ae=>{ae.currentTarget.style.transform="translateY(-4px)",ae.currentTarget.style.boxShadow=`0 12px 40px ${H.color}20`,ae.currentTarget.style.borderColor=`${H.color}50`},onMouseLeave:ae=>{ae.currentTarget.style.transform="translateY(0)",ae.currentTarget.style.boxShadow="none",ae.currentTarget.style.borderColor=`${H.color}25`},children:[t.jsxs("div",{style:{flex:"0 0 66%",position:"relative",overflow:"hidden"},children:[t.jsx("img",{src:M.avatar_url||M.photo_url,alt:M.name,style:{width:"100%",height:"100%",objectFit:"cover"}}),M.animated_photo_url&&t.jsx("video",{src:M.animated_photo_url,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",zIndex:1}}),t.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.1) 40%, transparent 60%)",zIndex:2}}),t.jsx("div",{style:{position:"absolute",top:"10px",right:"10px",zIndex:3,width:"8px",height:"8px",borderRadius:"50%",background:"#22c55e",boxShadow:"0 0 8px rgba(34,197,94,0.8)",animation:"pulse 2s ease-in-out infinite"}}),t.jsxs("div",{style:{position:"absolute",top:"10px",left:"10px",zIndex:3,background:`${H.color}cc`,backdropFilter:"blur(8px)",padding:"3px 8px",borderRadius:"12px",fontSize:"0.6rem",fontWeight:"700",color:"white",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(Kn,{size:10})," IA"]}),t.jsxs("div",{style:{position:"absolute",bottom:0,left:0,right:0,padding:"12px 14px",zIndex:3},children:[t.jsx("h4",{style:{margin:0,fontSize:"1.2rem",fontWeight:"700",fontFamily:"Outfit",textShadow:"0 2px 6px rgba(0,0,0,0.8)"},children:M.name}),t.jsx("p",{style:{margin:"2px 0 0",fontSize:"0.75rem",color:"rgba(255,255,255,0.7)",fontStyle:"italic"},children:H.label})]})]}),t.jsxs("div",{style:{flex:"0 0 34%",padding:"12px 14px",display:"flex",flexDirection:"column",justifyContent:"space-between",background:"linear-gradient(180deg, rgba(10,0,20,0.95) 0%, rgba(15,5,30,0.95) 100%)"},children:[t.jsxs("div",{style:{display:"flex",gap:"6px",flexWrap:"wrap"},children:[t.jsx("span",{style:{fontSize:"0.6rem",padding:"3px 8px",borderRadius:"8px",background:`${H.color}15`,color:H.color,fontWeight:"600"},children:H.label}),t.jsx("span",{style:{fontSize:"0.6rem",padding:"3px 8px",borderRadius:"8px",background:"rgba(255,255,255,0.05)",color:"rgba(255,255,255,0.5)",fontWeight:"500"},children:Z})]}),t.jsxs("button",{onClick:ae=>{ae.stopPropagation(),$(M)},style:{width:"100%",background:`linear-gradient(135deg, ${H.color}, ${H.color}cc)`,border:"none",color:"white",padding:"10px",borderRadius:"12px",fontFamily:"Outfit",fontWeight:"700",fontSize:"0.8rem",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",boxShadow:`0 4px 15px ${H.color}35`,transition:"all 0.2s"},children:[t.jsx(Qt,{size:14})," Discuter"]})]}),t.jsx("style",{children:` 2294 @keyframes pulse { 2295 0%, 100% { opacity: 1; transform: scale(1); } 2296 50% { opacity: 0.6; transform: scale(1.3); } 2297 } 2298 `})]},M.id||V)})})]}),t.jsx("div",{style:{padding:"0 20px",marginBottom:"24px"},children:t.jsxs("div",{style:{borderRadius:"22px",padding:"22px",background:l?`linear-gradient(145deg, ${h}10, ${h}05)`:`linear-gradient(145deg, ${x.bg1} 0%, ${x.bg3} 100%)`,border:l?`2.5px solid ${h}`:`1px solid ${h}30`,boxShadow:l?`0 4px 20px ${h}20`:`0 4px 24px ${h}10`,position:"relative",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:l?"3px":"2px",background:`linear-gradient(90deg, transparent, ${x.t1}, ${x.t3}, transparent)`,opacity:l?1:.6}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"14px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[t.jsx("div",{style:{width:"42px",height:"42px",borderRadius:"14px",background:l?h:`linear-gradient(135deg, ${x.bg1}, ${x.bg3})`,border:l?"none":`1px solid ${h}50`,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:l?`0 3px 10px ${h}40`:"none"},children:t.jsx(ls,{size:20,color:l?"white":x.t2})}),t.jsxs("div",{children:[t.jsx("h3",{style:{margin:0,fontSize:"1.05rem",fontFamily:"Outfit",fontWeight:"700",color:l?"#1A1510":"white"},children:"Ma Bio Vocale"}),t.jsx("p",{style:{margin:0,fontSize:"0.72rem",color:l?"#6B5D4F":"rgba(255,255,255,0.45)"},children:"Présentez-vous en audio à vos matchs"})]})]}),t.jsxs("span",{style:{fontSize:"0.72rem",padding:"5px 12px",borderRadius:"12px",background:l?`${h}15`:x.bg2,border:l?`2px solid ${h}`:`1px solid ${h}50`,color:x.t2,fontWeight:"700",display:"flex",alignItems:"center",gap:"5px"},children:[t.jsx(Xt,{size:11})," ",te," Meetips"]})]}),d.voice_bio_url&&!B?t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"10px 14px",borderRadius:"14px",background:l?"rgba(34,197,94,0.15)":"rgba(34,197,94,0.12)",border:l?"2px solid #22c55e":"1px solid rgba(34,197,94,0.25)"},children:[t.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",background:"#22c55e",boxShadow:"0 0 8px rgba(34,197,94,0.6)",animation:"pulse 2s ease-in-out infinite"}}),t.jsx("span",{style:{fontSize:"0.85rem",color:l?"#16a34a":"#4ade80",fontFamily:"Outfit",fontWeight:"700"},children:"Bio vocale en ligne"})]}),t.jsx("div",{style:{padding:"16px",borderRadius:"14px",background:l?"rgba(0,0,0,0.04)":"rgba(255,255,255,0.06)",border:l?`2px solid ${h}40`:"1px solid rgba(255,255,255,0.1)",display:"flex",justifyContent:"center"},children:t.jsx(Sd,{audioUrl:d.voice_bio_url})}),t.jsxs("div",{style:{display:"flex",gap:"10px"},children:[t.jsxs("button",{onClick:()=>ee(!0),style:{flex:1,fontSize:"0.82rem",color:l?"white":x.t2,background:l?h:x.bg2,border:l?"none":`1px solid ${h}50`,padding:"11px 14px",borderRadius:"14px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",fontFamily:"Outfit",fontWeight:"700",transition:"all 0.2s",boxShadow:l?`0 3px 12px ${h}40`:"none"},children:[t.jsx(ls,{size:14})," Réenregistrer (",te," ",t.jsx(Jt,{size:14}),")"]}),t.jsxs("button",{onClick:ne,style:{fontSize:"0.82rem",color:l?"white":"#ff6b6b",background:l?"linear-gradient(135deg, #ef4444, #dc2626)":"rgba(255,77,77,0.1)",border:l?"none":"1px solid rgba(255,77,77,0.25)",padding:"11px 14px",borderRadius:"14px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",fontFamily:"Outfit",fontWeight:"700",boxShadow:l?"0 3px 12px rgba(239,68,68,0.3)":"none"},children:[t.jsx(rn,{size:13})," Supprimer"]})]})]}):B||!d.voice_bio_url?t.jsxs("div",{children:[t.jsxs("div",{style:{textAlign:"center",marginBottom:"14px",padding:"12px 14px",borderRadius:"14px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",fontSize:"0.82rem",color:"rgba(255,255,255,0.6)",lineHeight:1.5},children:["ðï¸ Enregistrez autant de fois que vous voulez ! Seule la ",t.jsx("strong",{style:{color:x.t1}
2298,children:"validation"})," coûte ",te," Meetips.",t.jsx("br",{}),t.jsx("span",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.4)"},children:"Limite : 30 secondes"})]}),t.jsx(p5,{onSave:K,userId:d.id}),B&&t.jsx("button",{onClick:()=>ee(!1),style:{marginTop:"10px",width:"100%",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.12)",color:"rgba(255,255,255,0.5)",padding:"10px",borderRadius:"14px",cursor:"pointer",fontSize:"0.82rem",fontFamily:"Outfit",fontWeight:"500"},children:"Annuler"})]}):null]})}),t.jsxs("div",{style:{padding:"0 20px",marginBottom:"24px"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px",padding:"0 4px"},children:[t.jsx("h3",{style:{margin:0,fontSize:"1.1rem",fontFamily:"Outfit",fontWeight:"700"},children:"Mes Univers"}),t.jsxs("button",{onClick:()=>r("/edit-criteria"),style:{background:"none",border:"none",color:h,display:"flex",alignItems:"center",gap:"5px",fontSize:"0.85rem",cursor:"pointer",fontWeight:"600"},children:[t.jsx(Vo,{size:14})," Modifier"]})]}),t.jsx("div",{style:{borderRadius:"22px",padding:"22px",background:l?"rgba(0,0,0,0.02)":"rgba(255,255,255,0.02)",border:l?`2px solid ${h}50`:"1px solid rgba(255,255,255,0.06)",backdropFilter:"blur(16px)",WebkitBackdropFilter:"blur(16px)"},children:!d.tags||d.tags.length===0?t.jsx("p",{style:{textAlign:"center",color:l?"#8C7A60":"rgba(255,255,255,0.3)",fontSize:"0.9rem"},children:"Aucun univers sélectionné."}):t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"18px"},children:Fn.map(M=>{const V=Array.isArray(d.tags)?d.tags:[],H=M.items.filter(N=>V.includes(N.id));return H.length===0?null:t.jsxs("div",{children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",color:M.color,marginBottom:"10px",fontSize:"0.85rem",fontWeight:"700"},children:[t.jsx(M.icon,{size:15})," ",M.title]}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:H.map(N=>t.jsxs("div",{style:{background:l?`${M.color}15`:"rgba(255,255,255,0.04)",padding:"6px 13px",borderRadius:"12px",fontSize:"0.78rem",color:l?"#2A2520":"rgba(255,255,255,0.8)",border:l?`1.5px solid ${M.color}60`:"1px solid rgba(255,255,255,0.06)",display:"flex",alignItems:"center",gap:"6px"},children:[N.icon&&t.jsx(N.icon,{size:12}),N.label]},N.id))})]},M.id)})})})]}),t.jsx("div",{style:{padding:"0 20px",display:"flex",flexDirection:"column",gap:"12px",marginBottom:"20px"},children:A.map((M,V)=>t.jsxs("div",{onClick:()=>r(M.path),style:{padding:"18px 20px",borderRadius:"18px",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",background:l?`linear-gradient(135deg, ${M.color}25, ${M.color}15)`:"rgba(255,255,255,0.02)",border:l?`2.5px solid ${M.color}`:M.gold?`1px solid ${h}30`:"1px solid rgba(255,255,255,0.05)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",transition:"all 0.2s",boxShadow:l?`0 4px 16px ${M.color}25`:"none"},onMouseEnter:H=>{H.currentTarget.style.transform="translateX(4px)",H.currentTarget.style.background=l?`${M.color}30`:"rgba(255,255,255,0.04)"},onMouseLeave:H=>{H.currentTarget.style.transform="translateX(0)",H.currentTarget.style.background=l?`${M.color}18`:"rgba(255,255,255,0.02)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"14px"},children:[t.jsx("div",{style:{width:"42px",height:"42px",borderRadius:"14px",background:l?M.color:M.bg,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:l?`0 3px 10px ${M.color}50`:"none"},children:t.jsx(M.icon,{size:20,color:l?"white":M.color})}),t.jsxs("div",{children:[t.jsx("h4",{style:{margin:0,fontSize:"0.95rem",fontWeight:"700",fontFamily:"Outfit",color:l?"#1A1510":M.gold?x.t2:"white"},children:M.label}),t.jsx("span",{style:{fontSize:"0.78rem",color:l?"#6B5D4F":"rgba(255,255,255,0.3)"},children:M.sub})]})]}),t.jsx(En,{size:18,color:l?M.color:"rgba(255,255,255,0.2)"})]},V))}),t.jsx("div",{style:{padding:"0 20px"},children:t.jsxs("button",{onClick:async()=>{try{await n(),window.location.href="/"}catch{window.location.href="/"}},style:{width:"100%",marginTop:"5px",background:l?"linear-gradient(135deg, #ef4444, #dc2626)":"rgba(255,77,77,0.06)",border:l?"none":"1px solid rgba(255,77,77,0.15)",color:l?"white":"#ff4d4d",padding:"14px",borderRadius:"16px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",fontWeight:"700",fontSize:"0.9rem",fontFamily:"Outfit",transition:"all 0.2s",boxShadow:l?"0 4px 16px rgba(239,68,68,0.35)":"none"},onMouseEnter:M=>M.currentTarget.style.background=l?"linear-gradient(135deg, #dc2626, #b91c1c)":"rgba(255,77,77,0.12)",onMouseLeave:M=>M.currentTarget.style.background=l?"linear-gradient(135deg, #ef4444, #dc2626)":"rgba(255,77,77,0.06)",children:[t.jsx(_h,{size:18})," Se Déconnecter"]})}),P&&t.jsx(pP,{onClose:()=>I(!1),onUpload:Re,uploading:j}),E&&t.jsx(ll,{match:E,onClose:()=>$(null)}),t.jsx("style",{children:` 2299 @keyframes orbFloat1 { 2300 0%, 100% { transform: translate(0, 0) scale(1); } 2301 50% { transform: translate(20px, -30px) scale(1.1); } 2302 } 2303 @keyframes orbFloat2 { 2304 0%, 100% { transform: translate(0, 0) scale(1); } 2305 50% { transform: translate(-25px, 20px) scale(1.15); } 2306 } 2307 @keyframes avatarGlow { 2308 0% { box-shadow: 0 0 30px rgba(168,85,247,0.15), 0 0 60px rgba(168,85,247,0.05); } 2309 100% { box-shadow: 0 0 40px rgba(168,85,247,0.25), 0 0 80px rgba(168,85,247,0.1); } 2310 } 2311 `})]})},hP="BEl62iUYgUivxIkv69yViEuiBIa-Ib9-SkvMeAtA3LFgDzkrxZJjSgSnfckjBJuBkr3qBUYIHBQFLXYp5Nksh8U";function gP(e){const r="=".repeat((4-e.length%4)%4),i=(e+r).replace(/-/g,"+").replace(/_/g,"/"),n=window.atob(i),o=new Uint8Array(n.length);for(let a=0;a<n.length;++a)o[a]=n.charCodeAt(a);return o}
2311function f5(){return Jo()?!0:"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}function US(){return"Notification"in window?Notification.permission:"unsupported"}async function fP(){if(!f5())return console.warn("Push notifications not supported"),"unsupported";const e=await Notification.requestPermission();return console.log("[Push] Permission:",e),e}async function xP(e){if(!f5())throw new Error("Push notifications not supported");if(Jo())return mP(e);if(await fP()!=="granted")throw new Error("Notification permission denied");try{const i=await navigator.serviceWorker.ready;let n=await i.pushManager.getSubscription();return n?console.log("[Push] Using existing subscription"):(n=await i.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:gP(hP)}),console.log("[Push] New subscription created")),await bP(e,n),localStorage.setItem("pushSubscription",JSON.stringify(n.toJSON())),localStorage.setItem("pushNotificationsEnabled","true"),n}catch(i){throw console.error("[Push] Subscription error:",i),i}}async function mP(e){try{const{PushNotifications:r}=await Wr(async()=>{const{PushNotifications:n}=await import("./index-D5ZaYwlm.js");return{PushNotifications:n}},[]);if((await r.requestPermissions()).receive!=="granted")throw new Error("Push notification permission denied");return await r.register(),new Promise((n,o)=>{r.addListener("registration",async a=>{console.log("[Push Native] Token:",a.value);try{const{error:l}=await D.from("push_subscriptions").upsert({user_id:e,endpoint:`native://${a.value}`,p256dh:"",auth:a.value},{onConflict:"user_id,endpoint",ignoreDuplicates:!1});l&&console.error("[Push Native] Failed to save token:",l)}catch(l){console.warn("[Push Native] Token save error:",l)}localStorage.setItem("pushNotificationsEnabled","true"),n(a)}),r.addListener("registrationError",a=>{console.error("[Push Native] Registration error:",a),o(a)}),r.addListener("pushNotificationActionPerformed",a=>{var d,p;const l=(p=(d=a.notification)==null?void 0:d.data)==null?void 0:p.url;l&&(window.location.hash=l)})})}catch(r){throw console.error("[Push Native] Error:",r),r}}async function yP(e){try{const i=await(await navigator.serviceWorker.ready).pushManager.getSubscription();return i&&(await i.unsubscribe(),e&&await D.from("push_subscriptions").delete().eq("user_id",e).eq("endpoint",i.endpoint)),localStorage.removeItem("pushSubscription"),localStorage.setItem("pushNotificationsEnabled","false"),console.log("[Push] Unsubscribed successfully"),!0}catch(r){throw console.error("[Push] Unsubscribe error:",r),r}}async function bP(e,r){var o,a;const i=r.toJSON(),n={user_id:e,endpoint:i.endpoint,p256dh:((o=i.keys)==null?void 0:o.p256dh)||"",auth:((a=i.keys)==null?void 0:a.auth)||""};try{const{error:l}=await D.from("push_subscriptions").upsert(n,{onConflict:"user_id,endpoint",ignoreDuplicates:!1});l?console.error("[Push] Failed to save subscription:",l):console.log("[Push] Subscription saved to server")}catch(l){console.warn("[Push] Server save failed (will retry later):",l.message),localStorage.setItem("pendingPushSub
2311scription",JSON.stringify(n))}}function vP(){return localStorage.getItem("pushNotificationsEnabled")==="true"&&US()==="granted"}const jP=()=>{const{profile:e}=gr(),[r,i]=m.useState(vP()),[n,o]=m.useState(!1),[a,l]=m.useState(US()),d=async()=>{if(e!=null&&e.id){o(!0);try{r?(await yP(e.id),i(!1)):(await xP(e.id),i(!0),l("granted"))}catch(p){console.error("Toggle error:",p),p.message.includes("denied")&&l("denied")}finally{o(!1)}}};return f5()?a==="denied"?t.jsxs("div",{style:{padding:"15px",background:"rgba(255, 77, 77, 0.1)",borderRadius:"12px",border:"1px solid rgba(255, 77, 77, 0.2)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"8px"},children:[t.jsx(Vb,{size:20,color:"#ff4d4d"}),t.jsx("span",{style:{fontWeight:"600",color:"#ff4d4d"},children:"Notifications bloquées"})]}),t.jsx("p",{style:{margin:0,fontSize:"0.85rem",color:"var(--text-muted)"},children:"Autorisez les notifications dans les paramètres de votre navigateur pour les recevoir."})]}):t.jsxs("div",{onClick:d,style:{padding:"15px",background:"rgba(255,255,255,0.05)",borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:n?"wait":"pointer",opacity:n?.7:1,transition:"background 0.2s"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[t.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:r?"rgba(255, 215, 0, 0.2)":"rgba(255,255,255,0.1)",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(e5,{size:20,color:r?"var(--gold)":"white"})}),t.jsxs("div",{children:[t.jsx("div",{style:{fontWeight:"600",marginBottom:"2px"},children:"Notifications Push"}),t.jsx("div",{style:{fontSize:"0.8rem",color:"var(--text-muted)"},children:"Likes, messages, nouveaux matchs"})]})]}),t.jsx("div",{style:{width:"50px",height:"28px",borderRadius:"14px",background:r?"linear-gradient(135deg, #FFD700, #FFA500)":"rgba(255,255,255,0.2)",position:"relative",transition:"background 0.3s"},children:t.jsx("div",{style:{position:"absolute",top:"3px",left:r?"25px":"3px",width:"22px",height:"22px",borderRadius:"50%",background:"white",transition:"left 0.3s",boxShadow:"0 2px 5px rgba(0,0,0,0.2)"}})})]}):t.jsxs("div",{style:{padding:"15px",background:"rgba(255,255,255,0.05)",borderRadius:"12px",display:"flex",alignItems:"center",gap:"12px",color:"var(--text-muted)"},children:[t.jsx(Vb,{size:20}),t.jsx("span",{style:{fontSize:"0.9rem"},children:"Notifications non supportées sur ce navigateur"})]})},wP=()=>{const e=si(),r=Lt(),{profile:i,signOut:n,deleteAccount:o}=gr(),[a,l]=m.useState(g5()),[d,p]=m.useState(Ad()),{lightMode:u,toggleLightMode:g}=dr(),[h,x]=m.useState(!1),[y,_]=m.useState(1),[S,k]=m.useState(""),[w,b]=m.useState(!1),j=i==null?void 0:i.is_premium,T=async()=>{window.confirm("Voulez-vous vraiment vous déconnecter ?")&&await n()},P=()=>{window.open("https://billing.stripe.com/p/login/cNi7sKgy3fyRaMRbcmffy00","_blank")},I=async()=>{if(S==="SUPPRIMER"){b(!0);try{await o()}catch(ee){console.error("Failed to delete account:",ee),e.error("Une erreur est survenue. Veuillez réessayer."),b(!1)}}},R=[{icon:"ð",text:"Tous vos matchs et conversations seront supprimés"},{icon:"ð¬",text:"Vos messages privés seront effacés définitivement"},{icon:t.jsx(Jt,{size:16}),text:`Vos ${(i==null?void 0:i.meetips_balance)||0} Meetips seront perdus`},{icon:"ð",text:"Vos cadeaux envoyés et reçus seront supprimés"},{icon:"ð¸",text:"Vos photos et données personnelles seront effacées"},{icon:"ð",text:"Votre abonnement sera annulé sans remboursement"},{icon:"â ï¸",text:"Cette action est irréversible et définitive"}],O={padding:"20px",borderBottom:"1px solid rgba(255,255,255,0.05)"},E=(ee,te,K)=>t.jsxs("h2",{style:{fontSize:"1.1rem",marginBottom:"15px",display:"flex",alignItems:"center",gap:"10px",color:K},children:[ee," ",te]}),$={display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"15px"},B={background:"rgba(255,255,255,0.05)",border:"none",padding:"12px",borderRadius:"8px",color:"white",width:"100%",textAlign:"left",cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center"};return t.jsxs("div",{className:"settings-page",style:{minHeight:"100vh",background:"var(--bg-deep)",padding:"20px",paddingBottom:"80px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:"30px"},children:[t.jsx("button",{onClick:()=>r(-1),style:{background:"none",border:"none",color:"white",cursor:"pointer",marginRight:"15px"},children:t.jsx(Hr,{size:24})}),t.jsx("h1",{style:{fontFamily:"Outfit",fontSize:"1.8rem",margin:0},children:"Paramètres"})]}),t.jsxs("div",{className:"glass-panel",style:{borderRadius:"var(--radius-lg)",padding:"0",overflow:"hidden"},children:[t.jsxs("div",{style:O,children:[E(t.jsx(Da,{size:20}),"Général","var(--gold)"),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t.jsxs("span",{style:{color:"var(--text-main)",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(JA,{size:16})," Sons & Vibrations"]}),t.jsx("input",{type:"checkbox",checked:d,onChange:ee=>{mr(),p(ee.target.checked),uA(ee.target.checked)},style:{transform:"scale(1.2)"}})]}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:"15p
2311x"},children:[t.jsxs("span",{style:{color:"var(--text-main)",display:"flex",alignItems:"center",gap:"8px"},children:[u?t.jsx(rl,{size:16}):t.jsx(_d,{size:16})," Mode ",u?"Jour":"Nuit"]}),t.jsxs("button",{onClick:()=>{mr(),g()},style:{background:u?"linear-gradient(135deg, #FFD700, #FFA500)":"linear-gradient(135deg, #334, #112)",border:"1px solid "+(u?"rgba(255,165,0,0.3)":"rgba(255,255,255,0.15)"),borderRadius:"20px",padding:"6px 16px",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px",color:u?"#333":"#fff",fontWeight:"600",fontSize:"0.85rem",transition:"all 0.3s ease"},children:[u?t.jsx(rl,{size:14}):t.jsx(_d,{size:14}),u?"âï¸":"ð"]})]})]}),t.jsxs("div",{style:O,children:[E(t.jsx(e5,{size:20}),"Notifications","var(--primary)"),t.jsx("div",{style:{marginBottom:"15px"},children:t.jsx(jP,{})}),t.jsxs("div",{style:$,children:[t.jsx("span",{style:{color:"var(--text-main)"},children:"Alertes Email"}),t.jsx("input",{type:"checkbox",checked:a,onChange:ee=>{mr(),l(ee.target.checked),MS(ee.target.checked)},style:{transform:"scale(1.2)"}})]})]}),t.jsxs("div",{style:O,children:[E(t.jsx(op,{size:20}),"Aide & Légal","#00bcd4"),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"15px"},children:[t.jsxs("div",{onClick:()=>r("/terms"),style:{display:"flex",alignItems:"center",gap:"10px",color:"var(--text-main)",cursor:"pointer"},children:[t.jsx(AA,{size:16,color:"var(--text-muted)"})," Conditions Générales d'Utilisation"]}),t.jsxs("div",{onClick:()=>r("/privacy"),style:{display:"flex",alignItems:"center",gap:"10px",color:"var(--text-main)",cursor:"pointer"},children:[t.jsx(Fr,{size:16,color:"var(--text-muted)"})," Politique de Confidentialité"]}),t.jsxs("div",{onClick:()=>r("/help-chat"),style:{display:"flex",alignItems:"center",gap:"10px",color:"var(--text-main)",cursor:"pointer"},children:[t.jsx(op,{size:16,color:"var(--text-muted)"})," Centre d'Aide"]})]})]}),t.jsxs("div",{style:O,children:[E(t.jsx(Fr,{size:20}),"Sécurité","var(--primary)"),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[t.jsx("button",{style:B,children:t.jsx("span",{children:"Changer le mot de passe"})}),t.jsxs("button",{onClick:()=>r("/blocked-users"),style:B,children:[t.jsx("span",{style:{display:"flex",alignItems:"center",gap:"10px"},children:"Utilisateurs Bloqués"}),t.jsx(rr,{size:16,color:"var(--text-muted)"})]})]})]}),t.jsxs("div",{style:O,children:[E(t.jsx(ni,{size:20}),"Mon Abonnement","#fbbf24"),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"16px",borderRadius:"12px",marginBottom:"16px",background:j?"linear-gradient(135deg, rgba(251,191,36,0.12), rgba(251,191,36,0.04))":"rgba(255,255,255,0.03)",border:j?"1px solid rgba(251,191,36,0.25)":"1px solid rgba(255,255,255,0.06)"},children:[t.jsx("div",{style:{width:"44px",height:"44px",borderRadius:"12px",background:j?"linear-gradient(135deg, #fbbf24, #f59e0b)":"rgba(255,255,255,0.06)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.4rem"},children:j?"ð":"ð"}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{fontFamily:"Outfit",fontWeight:"700",fontSize:"1rem",color:"white"},children:j?"Premium Actif":"Découverte (Gratuit)"}),t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.4)",marginTop:"2px"},children:j?"Accès complet à toutes les fonctionnalités":"MeetFriend + 3 profils Eros offerts + 1 profil Erox offert"})]}),t.jsx("div",{style:{padding:"4px 10px",borderRadius:"20px",background:j?"rgba(34,197,94,0.15)":"rgba(255,255,255,0.06)",color:j?"#22c55e":"rgba(255,255,255,0.4)",fontSize:"0.7rem",fontWeight:"600"},children:j?"â Actif":"Gratuit"})]}),!j&&t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",marginBottom:"16px"},children:[{emoji:"â¡",name:"Curieux",price:"7,50â¬/sem",desc:"Tout Premium pendant 1 semaine",color:"#8B5CF6",border:"rgba(139,92,246,0.2)",bg:"rgba(139,92,246,0.06)"},{emoji:"ð",name:"Premium",price:"19,90â¬/mois",desc:"Illimité + Coach IA + Events Premium",color:"#FFD700",border:"rgba(255,215,0,0.25)",bg:"linear-gradient(135deg, rgba(255,215,0,0.08), rgba(255,180,0,0.03))",popular:!0}].map((ee,te)=>t.jsxs("div",{onClick:()=>r("/subscription"),style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px 14px",borderRadius:"12px",background:ee.bg,border:`1px solid ${ee.border}`,cursor:"pointer",transition:"all 0.2s",position:"relative"},children:[t.jsx("span",{style:{fontSize:"1.2rem"},children:ee.emoji}),t.jsxs("div",{style:{flex:1},children:[t.jsxs("div",{style:{fontWeight:"700",fontSize:"0.88rem",color:"white",display:"flex",alignItems:"center",gap:"6px"},children:[ee.name,ee.popular&&t.jsx("span",{style:{fontSize:"0.55rem",background:"var(--gradient-gold)",color:"black",padding:"1px 6px",borderRadius:"6px",fontWeight:"800",textTransform:"uppercase",letterSpacing:"0.5px"},children:"Populaire"})]}),t.jsx("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.4)",marginTop:"1px"},children:ee.desc})]}),t.jsx("span",{style:{fontWeight:"800",fontSize:"0.9rem",color:ee.color,whiteSpace:"nowrap"},children:ee.price})]},te))}),j?t.jsxs("button",{onClick:P,style:{width:"100%",padding:"14px",borderRadius:"12px",background:"rgba(255,255,255,0.05)",border:"1px solid rgba(251,191,36,0.2)",color:"#fbbf24",fontFamily:"Outfit",fontWeight:"600",fontSize:"0.9rem",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",transition:"all 0.2s"},children:[t.jsx(Vs,{size:18}),"Gérer mon abonnement",t.jsx(Gn,{size:14,style:{opacity:.5}})]}):t.jsxs("button",{onClick:()=>r("/subscription"),style:{width:"100%",padding:"14px",borderRadius:"12px",background:"linear-gradient(135deg, #fbbf24, #f59e0b)",border:"none",color:"#1a1a2e",fontFamily:"Outfit",fontWeight:"700",fontSize:"0.95rem",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",boxShadow:"0 4px 20px rgba(251,191,36,0.3)",transition:"all 0.3s"},children:[t.jsx(ni,{size:18}),"Voir tous les abonnements"]}),j&&t.jsx("p",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.3)",marginTop:"10px",textAlign:"center"},children:"Annulez à tout moment. Votre accès reste actif jusqu'à la fin de votre période."})]}),t.jsxs("div",{style:{padding:"20px",display:"flex",flexDirection:"column",gap:"15p
2311x"},children:[t.jsxs("button",{onClick:T,style:{background:"rgba(255, 255, 255, 0.1)",border:"1px solid rgba(255,255,255,0.2)",color:"white",padding:"12px",borderRadius:"8px",width:"100%",cursor:"pointer",display:"flex",justifyContent:"center",alignItems:"center",gap:"10px",fontWeight:"bold"},children:[t.jsx(_h,{size:18})," Se Déconnecter"]}),t.jsxs("button",{onClick:()=>{hA(),x(!0),_(1),k("")},style:{background:"rgba(255, 77, 77, 0.1)",border:"1px solid #ff4d4d",color:"#ff4d4d",padding:"12px",borderRadius:"8px",width:"100%",cursor:"pointer",display:"flex",justifyContent:"center",alignItems:"center",gap:"10px"},children:[t.jsx(rn,{size:18})," Supprimer mon compte"]}),t.jsx("p",{style:{textAlign:"center",color:"var(--text-muted)",fontSize:"0.8rem",marginTop:"10px"},children:"Version 1.2.0 ⢠Build 2024"})]})]}),h&&t.jsxs("div",{style:{position:"fixed",inset:0,zIndex:1e4,display:"flex",alignItems:"center",justifyContent:"center",animation:"fadeIn 0.3s"},children:[t.jsx("div",{onClick:()=>!w&&x(!1),style:{position:"absolute",inset:0,background:"rgba(0,0,0,0.8)",backdropFilter:"blur(16px)",WebkitBackdropFilter:"blur(16px)"}}),t.jsxs("div",{style:{position:"relative",zIndex:2,width:"92%",maxWidth:"440px",borderRadius:"24px",overflow:"hidden",background:"linear-gradient(160deg, rgba(40,10,10,0.95) 0%, rgba(20,5,5,0.98) 100%)",border:"1px solid rgba(255,77,77,0.2)",boxShadow:"0 8px 40px rgba(255,77,77,0.15), 0 0 0 1px rgba(255,77,77,0.05)",animation:"liquidCardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1)"},children:[t.jsx("div",{style:{height:"3px",background:"linear-gradient(90deg, transparent, #ff4d4d, #ff6b6b, #ff4d4d, transparent)"}}),!w&&t.jsx("button",{onClick:()=>x(!1),style:{position:"absolute",top:"14px",right:"14px",zIndex:3,background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.4)",borderRadius:"10px",width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:"0.9rem"},children:t.jsx(mt,{size:16})}),t.jsx("div",{style:{padding:"36px 28px 28px",textAlign:"center"},children:y===1?t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{width:"80px",height:"80px",borderRadius:"50%",margin:"0 auto 20px",background:"radial-gradient(circle, rgba(255,77,77,0.2) 0%, transparent 70%)",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx("div",{style:{width:"56px",height:"56px",borderRadius:"50%",background:"linear-gradient(135deg, #ff4d4d, #dc2626)",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 20px rgba(255,77,77,0.4)"},children:t.jsx(_n,{size:28,color:"white"})})}),t.jsx("h2",{style:{fontFamily:"Outfit",fontWeight:"800",fontSize:"1.3rem",color:"#ff6b6b",marginBottom:"8px"},children:"Supprimer votre compte ?"}),t.jsx("p",{style:{color:"rgba(255,255,255,0.45)",fontSize:"0.85rem",marginBottom:"24px",lineHeight:1.5},children:"Cette action est définitive. Vous perdrez :"}),t.jsx("div",{style:{background:"rgba(255,77,77,0.06)",borderRadius:"16px",padding:"4px 0",marginBottom:"24px",border:"1px solid rgba(255,77,77,0.1)"},children:R.map((ee,te)=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px 18px",borderBottom:te<R.length-1?"1px solid rgba(255,77,77,0.06)":"none"},children:[t.jsx("span",{style:{fontSize:"1rem",flexShrink:0},children:ee.icon}),t.jsx("span",{style:{fontSize:"0.82rem",color:"rgba(255,255,255,0.6)",textAlign:"left"},children:ee.text})]},te))}),t.jsxs("div",{style:{display:"flex",gap:"12px"},children:[t.jsx("button",{onClick:()=>x(!1),style:{flex:1,padding:"14px",borderRadius:"14px",background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.1)",color:"white",fontFamily:"Outfit",fontWeight:"600",fontSize:"0.9rem",cursor:"pointer"},children:"Annuler"}),t.jsx("button",{onClick:()=>_(2),style:{flex:1,padding:"14px",borderRadius:"14px",background:"linear-gradient(135deg, #dc2626, #b91c1c)",border:"none",color:"white",fontFamily:"Outfit",fontWeight:"700",fontSize:"0.9rem",cursor:"pointer",boxShadow:"0 4px 16px rgba(255,77,77,0.3)"},children:"Je comprends"})]})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{fontSize:"3rem",marginBottom:"16
2311px"},children:"ðï¸"}),t.jsx("h2",{style:{fontFamily:"Outfit",fontWeight:"800",fontSize:"1.2rem",color:"#ff6b6b",marginBottom:"8px"},children:"Confirmation finale"}),t.jsxs("p",{style:{color:"rgba(255,255,255,0.45)",fontSize:"0.85rem",marginBottom:"24px",lineHeight:1.5},children:["Tapez ",t.jsx("strong",{style:{color:"#ff4d4d"},children:"SUPPRIMER"})," pour confirmer la suppression définitive de votre compte."]}),t.jsx("input",{type:"text",value:S,onChange:ee=>k(ee.target.value.toUpperCase()),placeholder:"Tapez SUPPRIMER ici",disabled:w,style:{width:"100%",padding:"14px 16px",borderRadius:"14px",background:"rgba(255,77,77,0.06)",border:S==="SUPPRIMER"?"2px solid #ff4d4d":"1px solid rgba(255,77,77,0.15)",color:"#ff6b6b",fontFamily:"Outfit",fontWeight:"700",fontSize:"1.1rem",textAlign:"center",letterSpacing:"3px",outline:"none",marginBottom:"24px",boxSizing:"border-box",transition:"border-color 0.2s"}}),t.jsxs("div",{style:{display:"flex",gap:"12px"},children:[t.jsx("button",{onClick:()=>{_(1),k("")},disabled:w,style:{flex:1,padding:"14px",borderRadius:"14px",background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.1)",color:"white",fontFamily:"Outfit",fontWeight:"600",fontSize:"0.9rem",cursor:w?"not-allowed":"pointer",opacity:w?.5:1},children:"Retour"}),t.jsx("button",{onClick:I,disabled:S!=="SUPPRIMER"||w,style:{flex:1,padding:"14px",borderRadius:"14px",background:S==="SUPPRIMER"?"linear-gradient(135deg, #dc2626, #991b1b)":"rgba(255,77,77,0.1)",border:"none",color:S==="SUPPRIMER"?"white":"rgba(255,77,77,0.3)",fontFamily:"Outfit",fontWeight:"700",fontSize:"0.9rem",cursor:S==="SUPPRIMER"&&!w?"pointer":"not-allowed",boxShadow:S==="SUPPRIMER"?"0 4px 16px rgba(255,77,77,0.4)":"none",transition:"all 0.3s",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:w?t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{width:"16px",height:"16px",border:"2px solid rgba(255,255,255,0.3)",borderTopColor:"white",borderRadius:"50%",animation:"spinRing 0.8s linear infinite"}}),"Suppression..."]}):t.jsxs(t.Fragment,{children:[t.jsx(rn,{size:16}),"Supprimer"]})})]})]})})]})]}),t.jsx("style",{children:` 2312 @keyframes fadeIn { 2313 from { opacity: 0; } 2314 to { opacity: 1; } 2315 } 2316 @keyframes liquidCardIn { 2317 from { opacity: 0; transform: scale(0.9) translateY(20px); } 2318 to { opacity: 1; transform: scale(1) translateY(0); } 2319 } 2320 @keyframes spinRing { 2321 from { transform: rotate(0deg); } 2322 to { transform: rotate(360deg); } 2323 } 2324 `})]})},_P=()=>{const e=Lt(),r=[{id:99,name:"Julie",age:29,reason:"Délai de réponse expiré",date:"Il y a 2 jours"},{id:98,name:"Marc",age:31,reason:"Incompatibilité valeurs",date:"Il y a 1 semaine"}];return t.jsxs("div",{style:{minHeight:"100vh",background:"var(--bg-deep)",padding:"20px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:"30px"},children:[t.jsx("button",{onClick:()=>e(-1),style:{background:"none",border:"none",color:"white",cursor:"pointer",marginRight:"15px"},children:t.jsx(Hr,{size:24})}),t.jsx("h1",{style:{fontFamily:"Outfit",fontSize:"1.8rem",margin:0},children:"Matchs Archivés"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"15px"},children:[r.map(i=>t.jsxs("div",{className:"glass-panel",style:{padding:"20px",borderRadius:"var(--radius-md)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t.jsxs("div",{children:[t.jsxs("h3",{style:{margin:"0 0 5px 0"},children:[i.name,", ",i.age]}),t.jsxs("p",{style:{margin:0,color:"var(--text-muted)",fontSize:"0.9rem",display:"flex",alignItems:"center",gap:"5px"},children:[t.jsx(zS,{size:14,color:"#ff4d4d"}),i.reason]})]}),t.jsx("span",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.3)"},children:i.date})]},i.id)),r.length===0&&t.jsxs("div",{style:{textAlign:"center",padding:"40px",color:"var(--text-muted)"}
2324,children:[t.jsx(Pn,{size:40,style:{marginBottom:"10px",opacity:.5}}),t.jsx("p",{children:"Aucune archive pour le moment."})]})]})]})},SP=()=>{const e=si(),r=Lt(),{profile:i}=gr(),{mode:n,isErox:o,isFriend:a,lightMode:l}=dr(),[d,p]=m.useState([]),[u,g]=m.useState(null),[h,x]=m.useState(()=>{try{return JSON.parse(localStorage.getItem("unlockedMatchIds")||"[]")}catch{return[]}}),y=localStorage.getItem("isPremium")==="true",_=(()=>{try{return JSON.parse(localStorage.getItem("matchedProfileIds")||"[]")}catch{return[]}})(),S=d.filter(w=>_.includes(w.id));m.useEffect(()=>{(async()=>{if(i)try{const b=await RS(i.id,n);if(b.length===0){p([]);return}const{data:j,error:T}=await D.from("profiles").select("id, name, erox_name, friend_name, avatar_url, erox_avatar_url, friend_avatar_url, gender, city, birthdate, bio, job, photos, erox_photos, friend_photos").in("id",b);if(T)throw T;const P=R=>R&&/\.(webm|mp4|mov|avi|mkv)(\?|$)/i.test(R),I=j.map(R=>{const O=(o?R.erox_avatar_url:a?R.friend_avatar_url:null)||R.avatar_url||R.photo||"https://via.placeholder.com/150",E=(o?R.erox_name:a?R.friend_name:null)||R.name||"Inconnu";return{...R,matchScore:85,photo:O,isVideoSelfie:P(O),name:E}});p(I),localStorage.setItem("favoriteMatches",JSON.stringify(b))}catch(b){console.error("Erreur chargement favoris:",b)}})()},[i,n]);const k=w=>{const b=parseInt(localStorage.getItem("meetips_balance")||"0");if(b<15){e.error("Pas assez de Meetips ! Rechargez votre solde.");return}localStorage.setItem("meetips_balance",String(b-15));const j=[...h,w];x(j),localStorage.setItem("unlockedMatchIds",JSON.stringify(j)),e.info("Profil débloqué ! ð")};return t.jsxs("div",{style:{padding:"120px 20px 100px 20px",minHeight:"100vh",background:l?"#FAF7F2":a?"linear-gradient(180deg, #0A0F1C 0%, #151B2E 100%)":"var(--bg-deep)",color:l?"#2A2520":"white"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:"24px"},children:[t.jsx("button",{onClick:()=>r(-1),style:{background:"none",border:"none",color:l?"#3D3528":"white",cursor:"pointer",marginRight:"15px"},children:t.jsx(Hr,{size:24})}),t.jsxs("h1",{style:{fontFamily:"Outfit",fontSize:"1.8rem",margin:0,display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(Xt,{size:24,color:"#FFD700"})," Mes Matchs"]})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",marginBottom:"28px",padding:"14px 24px",background:"linear-gradient(135deg, #B8860B 0%, #D4AF37 25%, #F5D76E 50%, #D4AF37 75%, #B8860B 100%)",border:"1px solid rgba(245,215,110,0.5)",borderRadius:"16px",boxShadow:"0 4px 20px rgba(212,175,55,0.3), inset 0 1px 0 rgba(255,255,255,0.3), inset 0 -1px 0 rgba(0,0,0,0.15)"},children:[t.jsx(Xt,{size:18,color:"#1a1a2e"}),t.jsxs("span",{style:{fontFamily:"Outfit",fontWeight:800,fontSize:"1rem",color:"#1a1a2e",textShadow:"0 1px 0 rgba(255,255,255,0.3)",letterSpacing:"0.5px"},children:["Matchs mutuels (",S.length,")"]})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[S.map((w,b)=>{if(!w)return null;const T=!y&&!(b===0)&&!h.includes(w.id);return t.jsxs("div",{style:{position:"relative",borderRadius:"20px",overflow:"hidden",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,215,0,0.15)",boxShadow:"0 4px 20px rgba(0,0,0,0.3)"},children:[t.jsx("div",{style:{background:"linear-gradient(135deg, #FFD700, #FFA500, #FFD700)",color:"#1a1a2e",fontWeight:800,fontSize:"0.75rem",textAlign:"center",padding:"6px 10px",letterSpacing:"2px",fontFamily:"Outfit",textTransform:"uppercase"},children:"⨠MEET â¨"}),t.jsxs("div",{style:{padding:"18px",filter:T?"blur(12px)":"none",pointerEvents:T?"none":"auto",transition:"filter 0.3s"},children:[t.jsxs("div",{style:{display:"flex",gap:"16px",alignItems:"center",marginBottom:"16px"},children:[w.isVideoSelfie?t.jsx("video",{src:w.photo,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,style:{width:"80px",height:"80px",borderRadius:"50%",objectFit:"cover",border:"3px solid rgba(255,215,0,0.3)"}}):t.jsx("img",{src:w.photo,alt:w.name,style:{width:"80px",height:"80px",borderRadius:"50%",objectFit:"cover",border:"3px solid rgba(255,215,0,0.3)"}}),t.jsxs("div",{style:{flex:1},children:[t.jsx("h3",{style:{margin:"0 0 4px",fontFamily:"Outfit",fontSize:"1.2rem",fontWeight:700},children:w.name}),w.job&&t.jsx("p",{style:{color:"var(--primary)",fontSize:"0.9rem",margin:"0 0 6px",opacity:.8},children:w.job}),w.city&&t.jsxs("p",{style:{color:"rgba(255,255,255,0.5)",fontSize:"0.8rem",margin:0},children:["ð ",w.city]})]})]}),t.jsxs("div",{style:{display:"flex",gap:"10px"},children:[t.jsxs("button",{onClick:()=>r(`/matches?viewProfile=${w.id}`),style:{flex:1,padding:"12px 16px",borderRadius:"14px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.15)",color:"white",fontWeight:600,fontSize:"0.9rem",fontFamily:"Outfit",curs
2324or:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:[t.jsx(rr,{size:18})," Voir le profil"]}),t.jsxs("button",{onClick:()=>g(w),style:{flex:1,padding:"12px 16px",borderRadius:"14px",background:"linear-gradient(135deg, rgba(212,175,55,0.2), rgba(212,175,55,0.08))",border:"1px solid rgba(212,175,55,0.35)",color:"#D4AF37",fontWeight:600,fontSize:"0.9rem",fontFamily:"Outfit",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:[t.jsx(Qt,{size:18})," Message"]})]})]}),T&&t.jsxs("div",{style:{position:"absolute",inset:0,top:"30px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"12px",zIndex:5},children:[t.jsx(Fr,{size:32,color:"rgba(255,215,0,0.7)"}),t.jsx("p",{style:{fontFamily:"Outfit",fontWeight:700,fontSize:"1rem",color:"white",margin:0},children:"Match verrouillé"}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px",width:"80%",maxWidth:"280px"},children:[t.jsxs("button",{onClick:()=>k(w.id),style:{padding:"14px 20px",borderRadius:"16px",background:"linear-gradient(135deg, #FFD700, #FFA500)",border:"none",color:"#1a1a2e",fontWeight:800,fontSize:"0.95rem",fontFamily:"Outfit",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",boxShadow:"0 4px 20px rgba(255,215,0,0.3)"},children:[t.jsx(Jt,{size:18})," 15 Meetips"]}),t.jsxs("button",{onClick:()=>r("/subscription"),style:{padding:"12px 20px",borderRadius:"14px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.15)",color:"rgba(255,255,255,0.7)",fontWeight:600,fontSize:"0.85rem",fontFamily:"Outfit",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:[t.jsx(ni,{size:16,color:"#FFD700"})," Tout débloquer â Premium"]})]})]})]},w.id)}),S.length===0&&t.jsxs("div",{style:{textAlign:"center",padding:"60px 20px",display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"},children:[t.jsx("div",{style:{fontSize:"3rem",opacity:.3},children:"ð«"}),t.jsxs("p",{style:{fontFamily:"Outfit",fontSize:"1.1rem",color:l?"#6B5F50":"rgba(255,255,255,0.5)",margin:0,lineHeight:1.6},children:["Aucun match mutuel pour le moment.",t.jsx("br",{}),"Continuez à explorer et à liker !"]}),t.jsxs("button",{onClick:()=>r("/matches"),style:{padding:"14px 28px",borderRadius:"16px",background:l?"linear-gradient(135deg, rgba(155,132,98,0.15), rgba(155,132,98,0.08))":"linear-gradient(135deg, rgba(210,190,150,0.18), rgba(210,190,150,0.06))",border:l?"2px solid rgba(120,95,55,0.5)":"1px solid rgba(210,190,150,0.3)",color:l?"#2A1F14":"#D2BE96",WebkitTextFillColor:l?"#2A1F14":"#D2BE96",fontWeight:800,fontSize:"1rem",fontFamily:"Outfit",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px"},children:[t.jsx(Bt,{size:20,color:l?"#5C4A30":"#D2BE96"})," Explorer les profils"]})]})]}),u&&t.jsx(ll,{match:u,onClose:()=>g(null)})]})},kP={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_STRIPE_CUSTOMER_PORTAL_URL:"https://billing.stripe.com/p/login/cNi7sKgy3fyRaMRbcmffy00",VITE_STRIPE_LINK_PACK_PRO:"https://buy.stripe.com/aFa9AS1D92M53kp4NYffy04",VITE_STRIPE_LINK_PACK_REGULAR:"https://buy.stripe.com/eVq4gy1D94Ud2gl3JUffy03",VITE_STRIPE_LINK_PACK_STARTER:"https://buy.stripe.com/7sY9AS3LhdqJbQVa8iffy02",VITE_STRIPE_LINK_PACK_ULTIMATE:"https://buy.stripe.com/cNieVc5TpfyRaMR4NYffy05",VITE_STRIPE_LINK_SUBSCRIPTION:"https://buy.stripe.com/cNi7sKgy3fyRaMRbcmffy00",VITE_STRIPE_LINK_WEEKLY:"https://buy.stripe.com/bJefZg95B5Yh8EJ94effy01",VITE_SUPABASE_ANON_KEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4",VITE_SUPABASE_URL:"https://bqfzljnhxblhiabyvpqm.supabase.co",VITE_VERCEL_DEPLOYMENT_ID:"dpl_2iNibkiSwVVKAbzVqcg7tGwdMF7m",VITE_VERCEL_ENV:"production",VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"",VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:"Guillaume",VITE_VERCEL_GIT_COMMIT_MESSAGE:"feat: avatars genrés homme/femme pour profils s
2324ans photo",VITE_VERCEL_GIT_COMMIT_REF:"main",VITE_VERCEL_GIT_COMMIT_SHA:"cc30527a915b6576f92a9b4074d0605c9aabbd86",VITE_VERCEL_GIT_PREVIOUS_SHA:"",VITE_VERCEL_GIT_PROVIDER:"github",VITE_VERCEL_GIT_PULL_REQUEST_ID:"",VITE_VERCEL_GIT_REPO_ID:"",VITE_VERCEL_GIT_REPO_OWNER:"meetyouevent",VITE_VERCEL_GIT_REPO_SLUG:"meeteros",VITE_VERCEL_OBSERVABILITY_CLIENT_CONFIG:'{"analytics":{"scriptSrc":"48dfdbff15a1ff0a/script.js","viewEndpoint":"48dfdbff15a1ff0a/view","eventEndpoint":"48dfdbff15a1ff0a/event","sessionEndpoint":"48dfdbff15a1ff0a/session"},"speedInsights":{"scriptSrc":"335abd5f92e268da/script.js","endpoint":"335abd5f92e268da/vitals"}}',VITE_VERCEL_PROJECT_ID:"prj_6MbUSdC86vlVocY0EIuYVwethqw5",VITE_VERCEL_PROJECT_PRODUCTION_URL:"meetapps.ai",VITE_VERCEL_TARGET_ENV:"production",VITE_VERCEL_URL:"solitary-kepler-50807nzdm-meet-you.vercel.app"},CP=[{id:"free",name:"Gratuit",emoji:"ð«",price:"0â¬",period:"Pour toujours",subtitle:"Découvre l'appli à ton rythme",color:"#26A69A",gradient:"linear-gradient(135deg, #26A69A 0%, #00897B 100%)",borderColor:"rgba(38, 166, 154, 0.4)",glowColor:"rgba(38, 166, 154, 0.15)",features:[{text:"Espace Friend illimité",included:!0},{text:"Espace Eros : 3 profils offerts",included:!0},{text:"Espace Erox : 1 profil offert",included:!0},{text:"Messagerie limitée",included:!0},{text:"5 Meetips offerts",included:!0},{text:"Profils psycho détaillés",included:!1},{text:"Expert Eros IA",included:!1},{text:"Likes illimités",included:!1}],cta:"Commencer gratuitement",popular:!1,stripeEnv:null},{id:"weekly",name:"Hebdo",emoji:"â¡",price:"7.90â¬",period:"/ semaine",subtitle:"Idéal pour tester sans engagement",color:"#00BFFF",gradient:"linear-gradient(135deg, #00BFFF 0%, #0077CC 100%)",borderColor:"rgba(0, 191, 255, 0.5)",glowColor:"rgba(0, 191, 255, 0.2)",features:[{text:"Accès aux 3 espaces",included:!0},{text:"Profils illimités",included:!0},{text:"Likes illimités",included:!0},{text:"Messagerie illimitée",included:!0},{text:"Profils psycho détaillés",included:!0},{text:"Expert Eros IA",included:!0},{text:"Mise en avant du profil",included:!0},{text:"10 Meetips offerts",included:!0}],cta:"S'abonner à la semaine",popular:!1,stripeEnv:"VITE_STRIPE_LINK_WEEKLY"},{id:"monthly",name:"Mensuel",emoji:"ð",price:"19.90â¬",period:"/ mois",subtitle:"Le meilleur rapport qualité-prix",color:"#FFD700",gradient:"linear-gradient(135deg, #FFD700 0%, #FFA500 100%)",borderColor:"rgba(255, 215, 0, 0.5)",glowColor:"rgba(255, 215, 0, 0.2)",features:[{text:"Accès aux 3 espaces",included:!0},{text:"Profils illimités",included:!0},{text:"Likes illimités",included:!0},{text:"Messagerie illimitée",included:!0},{text:"Profils psycho détaillés",included:!0},{text:"Expert Eros IA",included:!0},{text:"Mise en avant du profil",included:!0},{text:"10 Meetips offerts",included:!0}],cta:"Choisir le Mensuel",popular:!0,stripeEnv:"VITE_STRIPE_LINK_SUBSCRIPTION",badge:"ð 10 Meetips offerts à l'inscription"}],zP=()=>{const e=Lt(),{isFriend:r,isErox:i}=dr(),n=xn(),[o,a]=m.useState(null),[l,d]=m.useState(!1);Tr.useEffect(()=>{const g=h=>{h.data==="PAYMENT_COMPLETE"&&(d(!1),e("/matches"))};return window.addEventListener("message",g),()=>window.removeEventListener("message",g)},[e]);const p=g=>{if(g.id==="discovery"){e("/matches");return}a(g.id);const h=g.stripeEnv?kP[g.stripeEnv]:null;if(!h){console.error("Stripe link missing for plan:",g.id),a(null);return}localStorage.setItem("paymentType","subscription"),d(!0);const x=600,y=800,_=(window.innerWidth-x)/2,S=(window.innerHeight-y)/2;window.open(h,"StripeSubscription",`width=${x},height=${y},top=${S},left=${_},scrollbars=yes,status=yes,resizable=yes`),a(null)},u=i?"#ff3333":r?"#26A69A":"#FFD700";return t.jsxs("div",{style:{minHeight:"100vh",background:"linear-gradient(180deg, #0a0814 0%, #0d0b1a 50%, #0a0f17 100%)",paddingTop:n?"calc(env(safe-area-inset-top, 0px) + 20px)":"20px",paddingBottom:n?"calc(env(safe-area-inset-bottom, 0px) + 40px)":"60px",paddingLeft:n?"12px":"20px",paddingRight:n?"12px":"20px",overflowX:"hidden"},children:[t.jsx("div",{style:{position:"fixed",top:"-100px",right:"-80px",width:"300px",height:"300px",borderRadius:"50%",background:"radial-gradient(circle, rgba(168,85,247,0.12), transparent 70%)",pointerEvents:"none",filter:"blur(50px)"}}),t.jsx("div",{style:{position:"fixed",bottom:"10%",left:"-60px",width:"250px",height:"250px",borderRadius:"50%",background:"radial-gradient(circle, rgba(255,215,0,0.08), transparent 70%)",pointerEvents:"none",filter:"blur(40px)"}}),t.jsx("button",{onClick:()=>e(-1),style:{background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"white",borderRadius:"12px",width:"42px",height:"42px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",marginBottom:"20px"},children:t.jsx(Hr,{size:20})}),t.jsxs("div",{style:{textAlign:"center",marginBottom:n?"25px":"40px"},children:[t.jsx("h1",{style:{fontFamily:"Outfit",fontSize:n?"1.8rem":"2.5rem",fontWeight:"800",marginBottom:"10px",background:`linear-gradient(135deg, white, ${u}
2324)`,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",lineHeight:1.2},children:"Passez à l'étape supérieure"}),t.jsx("p",{style:{color:"rgba(255,255,255,0.5)",fontSize:n?"0.9rem":"1rem",maxWidth:"400px",margin:"0 auto"},children:"Choisissez l'offre qui vous correspond et débloquez tout le potentiel de MEET Eros."})]}),t.jsx("div",{style:{display:"flex",flexDirection:n?"column":"row",gap:n?"16px":"20px",maxWidth:"1000px",margin:"0 auto",alignItems:"stretch",justifyContent:"center"},children:CP.map(g=>t.jsxs("div",{style:{flex:n?"none":"1",maxWidth:n?"100%":"340px",background:"linear-gradient(160deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.015) 100%)",borderRadius:"24px",border:g.popular?`2px solid ${g.borderColor}`:"1px solid rgba(255,255,255,0.08)",padding:n?"24px 20px":"30px 24px",position:"relative",overflow:"hidden",boxShadow:g.popular?`0 0 40px ${g.glowColor}, 0 20px 60px rgba(0,0,0,0.4)`:"0 10px 30px rgba(0,0,0,0.3)",transition:"all 0.3s",transform:g.popular&&!n?"scale(1.05)":"none"},children:[g.popular&&t.jsx("div",{style:{position:"absolute",top:"0",left:"0",right:"0",height:"3px",background:g.gradient}}),g.badge&&t.jsxs("div",{style:{background:"rgba(76, 175, 80, 0.15)",border:"1px solid rgba(76, 175, 80, 0.3)",borderRadius:"20px",padding:"4px 12px",fontSize:"0.7rem",color:"#4CAF50",fontWeight:"600",textAlign:"center",marginBottom:"16px",display:"inline-block"},children:["⨠",g.badge]}),t.jsxs("div",{style:{marginBottom:"20px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"8px"},children:[t.jsx("span",{style:{fontSize:"1.5rem"},children:g.emoji}),t.jsx("h3",{style:{fontFamily:"Outfit",fontSize:"1.3rem",fontWeight:"700",color:"white",margin:0},children:g.name}),g.popular&&t.jsx("span",{style:{background:g.gradient,color:"black",fontSize:"0.65rem",fontWeight:"800",padding:"3px 8px",borderRadius:"8px",textTransform:"uppercase"},children:"Populaire"})]}),t.jsx("p",{style:{color:"rgba(255,255,255,0.4)",fontSize:"0.82rem",margin:0},children:g.subtitle})]}),t.jsxs("div",{style:{marginBottom:"24px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"8px"},children:[g.oldPrice&&t.jsx("span",{style:{fontSize:"1.1rem",textDecoration:"line-through",color:"rgba(255,255,255,0.3)"},children:g.oldPrice}),t.jsx("span",{style:{fontSize:"2.5rem",fontWeight:"800",fontFamily:"Outfit",background:g.gradient,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:g.price})]}),t.jsx("span",{style:{color:"rgba(255,255,255,0.4)",fontSize:"0.85rem"},children:g.period})]}),t.jsx("ul",{style:{listStyle:"none",padding:0,margin:"0 0 24px 0",display:"flex",flexDirection:"column",gap:"12px"},children:g.features.map((h,x)=>t.jsxs("li",{style:{display:"flex",gap:"10px",alignItems:"center",opacity:h.included?1:.35},children:[t.jsx("div",{style:{width:"22px",height:"22px",borderRadius:"50%",background:h.included?`${g.color}25`:"rgba(255,255,255,0.05)",border:`1px solid ${h.included?`${g.color}50`:"rgba(255,255,255,0.1)"}`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:h.included?t.jsx(pr,{size:12,color:g.color,strokeWidth:3}):t.jsx(mt,{size:10,color:"rgba(255,255,255,0.3)",strokeWidth:2})}),t.jsx("span",{style:{fontSize:"0.88rem",color:h.included?"rgba(255,255,255,0.85)":"rgba(255,255,255,0.3)",fontWeight:h.included?"500":"400"},children:h.text})]},x))}),t.jsx("button",{onClick:()=>p(g),disabled:o===g.id,style:{width:"100%",padding:"14px 20px",borderRadius:"16px",border:g.popular?"none":`1px solid ${g.borderColor}`,background:g.popular?g.gradient:"transparent",color:g.popular?"black":g.color,fontWeight:"700",fontSize:"0.95rem",cursor:o===g.id?"wait":"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.3s",opacity:o===g.id?.7:1,boxShadow:g.popular?`0 4px 20px ${g.glowColor}`:"none",fontFamily:"Inter, sans-serif"},children:o===g.id?t.jsx(qs,{size:18,className:"animate-spin"}):t.jsxs(t.Fragment,{children:[g.id==="vip"&&t.jsx(Xt,{size:16}),g.id==="premium"&&t.jsx(ni,{size:16}),g.cta]})})]},g.id))}),t.jsxs("div",{style:{display:"flex",gap:"30px",justifyContent:"center",marginTop:n?"30px":"50px",color:"rgba(255,255,255,0.25)"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"6px"},children:[t.jsx(Sr,{size:22}),t.jsx("span",{style:{fontSize:"0.65rem"},children:"Sécurisé"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"6px"},children:[t.jsx(oi,{size:22}),t.jsx("span",{style:{fontSize:"0.65rem"},children:"Instantané"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"6px"},children:[t.jsx(nr,{size:22}),t.jsx("span",{style:{fontSize:"0.65rem"},children:"Sans engagement"})]})]}),t.jsx("p",{style:{textAlign:"center",fontSize:"0.75rem",color:"rgba(255,255,255,0.2)",marginTop:"20px"},children:"Paiement sécurisé par Stripe. Annulable à tout moment."}),l&&t.jsx("div",{style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",background:"rgba(0,0,0,0.6)",backdropFilter:"blur(10px)",zIndex:9998,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",animation:"fadeIn 0.5s"},children:t.jsxs("div",{className:"glass-panel",style:{padding:"40px",borderRadius:"20px",textAlign:"center",border:`1px solid ${u}40`},children:[t.jsx("div",{className:"animate-pulse",style:{fontSize:"3rem",marginBottom:"20px"},children:"ð"}),t.jsx("h2",{style:{marginBottom:"10px"},children:"Abonnement en cours..."}),t.jsx("p",{style:{color:"rgba(255,255,255,0.5)",marginBottom:"30px"},children:"Validation du paiement sécurisé dans la fenêtre Stripe."}),t.jsx("button",{onClick:()=>d(!1),style:{background:"transparent",border:"1px solid rgba(255,255,255,0.2)",color:"rgba(255,255,255,0.5)",padding:"10px 20px",borderRadius:"30px",cursor:"pointer"},children:"Fermer"})]})})]})},VS=({isModal:e=!1})=>{var P;const{profile:r}=gr(),{mode:i}=dr(),n=i==="EROX"?{accent:"#ff4d4d",accentRgb:"255,77,77",badge:"linear-gradient(135deg, #ff4d4d, #cc0000)"}:i==="FRIEND"?{accent:"#26A69A",accentRgb:"38,166,154",badge:"linear-gradient(135deg, #26A69A, #00796B)"}:{accent:"#D4A574",accentRgb:"212,165,116",badge:"linear-gradient(135deg, #D4A574, #C5935E)"},[o,a]=m.useState([]),[l,d]=m.useState(null),[p,u]=m.useState(null),[g,h]=m.useState(""),[x,y]=m.useState(null),{showTutorial:_,markAsSeen:S}=y0("tuto_messages"),k=[{title:"ð¬ Bienvenue dans tes Discussions",de
2324scription:"C'est ici que la magie opère ! Retrouve tous tes Matchs et tes conversations privées au même endroit.",icon:Qt},{title:"Tri Automatique",description:"Les nouveaux messages remontent automatiquement. Si tu supprimes une discussion, elle disparaîtra mais reviendra si tu reçois un nouveau message.",icon:Pn}];m.useEffect(()=>{if(!(r!=null&&r.id))return;(async()=>{const R=await hx(r),O=R.map(F=>F.id);try{const{data:F}=await D.from("messages").select("receiver_id").eq("sender_id",r.id),{data:A}=await D.from("messages").select("sender_id").eq("receiver_id",r.id),M=new Set;F==null||F.forEach(H=>M.add(H.receiver_id)),A==null||A.forEach(H=>M.add(H.sender_id));const V=[...M].filter(H=>H&&!O.includes(H));if(V.length>0){const{data:H}=await D.from("matches").select("id, name, photo_url, photos_eros, photos_erox, photos_friend, bio, age, location, tags, erox_tags, friend_tags, gender, compatibility_score, space, personality").in("id",V);(H==null?void 0:H.length)>0&&H.forEach(N=>{var Z,ae;R.push({...N,is_bot:!0,avatar_url:((Z=N.photos_eros)==null?void 0:Z[0])||N.photo_url,photo:((ae=N.photos_eros)==null?void 0:ae[0])||N.photo_url,city:""})})}}catch(F){console.warn("Bot conversation lookup failed:",F)}const{data:E}=await D.from("hidden_conversations").select("match_id, created_at").eq("user_id",r.id),{data:$}=await D.from("blocked_users").select("blocked_id").eq("blocker_id",r.id),B=$?$.map(F=>F.blocked_id):[],ee={};
2324E==null||E.forEach(F=>ee[F.match_id]=new Date(F.created_at));const te=[];for(const F of Object.keys(ee)){const A=ee[F],{data:M}=await D.from("messages").select("created_at").or(`and(sender_id.eq.${r.id},receiver_id.eq.${F}),and(sender_id.eq.${F},receiver_id.eq.${r.id})`).gt("created_at",A.toISOString()).limit(1).maybeSingle();M?D.from("hidden_conversations").delete().eq("user_id",r.id).eq("match_id",F).then():te.push(F)}const{data:K}=await D.from("messages").select("sender_id").eq("receiver_id",r.id).eq("is_read",!1),ne={};K&&K.forEach(F=>{ne[F.sender_id]=(ne[F.sender_id]||0)+1});const Q=R.filter(F=>!te.includes(F.id)).filter(F=>!B.includes(F.id)).map(async F=>{const A=[r.id,F.id].sort().join("_"),{data:M}=await D.from("messages").select("content, created_at, sender_id, type").eq("conversation_id",A).order("created_at",{ascending:!1}).limit(1),V=(M==null?void 0:M[0])||null,H=F.photo||F.avatar_url||null;let N="Nouvelle connexion ! Dites coucou ð",Z=null,ae=null;if(V){V.type==="audio"?N=V.sender_id===r.id?"ðï¸ Vous : Message vocal":"ðï¸ Message vocal":N=V.sender_id===r.id?`Vous : ${V.content}`:V.content;const X=new Date(V.created_at),he=new Date,Ae=X.toDateString()===he.toDateString(),ze=new Date(he);ze.setDate(ze.getDate()-1);const ue=X.toDateString()===ze.toDateString();Z=X.toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"}),Ae?ae="Aujourd'hui":ue?ae="Hier":ae=X.toLocaleDateString("fr-FR",{day:"2-digit",month:"2-digit",year:"2-digit"})}return{...F,photo:H,unreadCount:ne[F.id]||0,lastMessage:N,lastTime:Z,lastDate:ae,lastTimestamp:V?new Date(V.created_at).getTime():0}}),G=await Promise.all(Q);G.sort((F,A)=>A.lastTimestamp-F.lastTimestamp),a(G);const le=G.map(F=>F.id);if(K&&K.length>0){const F=[...new Set(K.map(A=>A.sender_id).filter(A=>!le.includes(A)))];if(F.length>0){console.log("Messenger: Cleaning up orphan unread messages from:",F);for(const A of F)await D.from("messages").update({is_read:!0}).eq("receiver_id",r.id).eq("sender_id",A).eq("is_read",!1);window.dispatchEvent(new Event("messages-read"))}}})()},[r==null?void 0:r.id]);const w=async I=>{if(mr(),d(I),I.unreadCount>0&&(a(R=>R.map(O=>O.id===I.id?{...O,unreadCount:0}:O)),r!=null&&r.id)){const{error:R}=await D.from("messages").update({is_read:!0}).eq("receiver_id",r.id).eq("sender_id",I.id);R||window.dispatchEvent(new Event("messages-read"))}},b=async I=>{if(a(R=>R.filter(O=>O.id!==I)),u(null),r!=null&&r.id){const{error:R}=await D.from("hidden_conversations").insert({user_id:r.id,match_id:I});await D.from("messages").update({is_read:!0}).eq("receiver_id",r.id).eq("sender_id",I),window.dispatchEvent(new Event("messages-read")),R&&console.error("Error hiding conversation:",R)}localStorage.removeItem(`chat_${I}`)},j=async I=>{if(h(I),!I.trim()){y(null);return}const R=I.toLowerCase().trim(),O=o.filter($=>{var B;return(B=$.name)==null?void 0:B.toLowerCase().includes(R)});let E=[];if(r!=null&&r.id&&R.length>=2){const{data:$}=await D.from("messages").select("content, created_at, sender_id, receiver_id, conversation_id").or(`sender_id.eq.${r.id},receiver_id.eq.${r.id}`).ilike("content",`%${R}%`).order("created_at",{ascending:!1}).limit(20);if($){const B={};$.forEach(ee=>{const te=ee.sender_id===r.id?ee.receiver_id:ee.sender_id;if(!B[te]){const K=o.find(ne=>ne.id===te);B[te]={matchId:te,matchName:(K==null?void 0:K.name)||"Inconnu",matchPhoto:K==null?void 0:K.photo,messages:[],conv:K}}B[te].messages.push(ee)}),E=Object.values(B)}}y({nameMatches:O,messageMatches:E})},T=g.trim()&&(x!=null&&x.nameMatches)?x.nameMatches:o;return t.jsxs("div",{style:{minHeight:e?"auto":"100vh",background:e?"transparent":"var(--bg-deep)"},children:[t.jsx(b0,{isOpen:_,onClose:S,steps:k}),t.jsxs("div",{style:{maxWidth:"800px",margin:"0 auto",padding:e?"20px":"40px 20px"},children:[t.jsxs("h1",{style:{fontFamily:"Outfit",fontSize:e?"1.5rem":"2rem",marginBottom:"30px",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(Qt,{size:24,color:n.accent}),"Vos Discussions"]}),t.jsxs("div",{style:{position:"relative",marginBottom:"24px"},children:[t.jsx(qo,{size:20,style:{position:"absolute",left:"15px",top:"50%",transform:"translateY(-50%)",color:"var(--text-muted)"}}),t.jsx("input",{type:"text",value:g,onChange:I=>j(I.target.value),placeholder:"Rechercher une personne ou un mot...",style:{width:"100%",padding:"15px 15px 15px 45px",background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"15p
2324x",color:"white",fontSize:"1rem",transition:"border-color 0.2s",outline:"none"},onFocus:I=>I.target.style.borderColor=`rgba(${n.accentRgb},0.5)`,onBlur:I=>I.target.style.borderColor="rgba(255,255,255,0.08)"}),g&&t.jsx("button",{onClick:()=>{h(""),y(null)},style:{position:"absolute",right:"12px",top:"50%",transform:"translateY(-50%)",background:"rgba(255,255,255,0.1)",border:"none",borderRadius:"50%",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",color:"white",cursor:"pointer",fontSize:"0.8rem"},children:"â"})]}),((P=x==null?void 0:x.messageMatches)==null?void 0:P.length)>0&&t.jsxs("div",{style:{marginBottom:"24px"},children:[t.jsxs("h3",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.5)",fontWeight:"600",marginBottom:"12px",textTransform:"uppercase",letterSpacing:"0.5px"},children:['ð¬ Messages contenant "',g,'"']}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:x.messageMatches.map(I=>t.jsxs("div",{onClick:()=>I.conv&&w(I.conv),style:{padding:"14px 18px",borderRadius:"14px",background:`rgba(${n.accentRgb},0.08)`,border:`1px solid rgba(${n.accentRgb},0.15)`,cursor:I.conv?"pointer":"default",transition:"all 0.2s"},onMouseEnter:R=>{R.currentTarget.style.background=`rgba(${n.accentRgb},0.15)`,R.currentTarget.style.transform="scale(1.01)"},onMouseLeave:R=>{R.currentTarget.style.background=`rgba(${n.accentRgb},0.08)`,R.currentTarget.style.transform="scale(1)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"6px"},children:[I.matchPhoto&&t.jsx("img",{src:I.matchPhoto,alt:"",style:{width:"28px",height:"28px",borderRadius:"50%",objectFit:"cover"}}),t.jsx("span",{style:{fontWeight:"600",fontSize:"0.9rem"},children:I.matchName}),t.jsxs("span",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.4)"},children:[I.messages.length," résultat",I.messages.length>1?"s":""]})]}),I.messages.slice(0,2).map((R,O)=>t.jsxs("p",{style:{margin:"4px 0 0 38px",fontSize:"0.82rem",color:"rgba(255,255,255,0.6)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[t.jsx("span",{style:{color:"rgba(255,255,255,0.3)",fontSize:"0.7rem",marginRight:"6px"},children:new Date(R.created_at).toLocaleDateString("fr-FR",{day:"2-digit",month:"2-digit"})}),'"',R.content,'"']},O))]},I.matchId))})]}),g&&(x==null?void 0:x.nameMatches)&&t.jsxs("h3",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.5)",fontWeight:"600",marginBottom:"12px",textTransform:"uppercase",letterSpacing:"0.5px"},children:["ð¤ Conversations ",x.nameMatches.length>0?`(${x.nameMatches.length})`:""]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[T.map(I=>t.jsxs(ye.div,{layout:!0,initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,x:-100},onClick:()=>w(I),className:"glass-panel",style:{padding:"18px 20px",borderRadius:"18px",display:"flex",alignItems:"center",gap:"16px",cursor:"pointer",transition:"transform 0.2s, border-color 0.2s",border:I.unreadCount>0?`1px solid rgba(${n.accentRgb},0.4)`:"1px solid rgba(255,255,255,0.06)",borderLeft:I.unreadCount>0?`4px solid ${n.accent}`:"1px solid rgba(255,255,255,0.06)",background:I.unreadCount>0?`rgba(${n.accentRgb},0.08)`:void 0,boxShadow:I.unreadCount>0?`0 0 20px rgba(${n.accentRgb},0.15), inset 0 0 30px rgba(${n.accentRgb},0.03)`:void 0},onMouseEnter:R=>R.currentTarget.style.transform="scale(1.015)",onMouseLeave:R=>R.currentTarget.style.transform="scale(1)",children:[t.jsxs("div",{style:{position:"relative",flexShrink:0},children:[t.jsx("img",{src:I.photo,alt:I.name,style:{width:"56px",height:"56px",borderRadius:"50%",objectFit:"cover"}}),I.unreadCount>0&&t.jsx("div",{style:{position:"absolute",top:-4,right:-4,background:n.badge,color:"white",borderRadius:"50%",width:"22px",height:"22px",fontSize:"0.72rem",fontWeight:"bold",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:`0 2px 8px rgba(${n.accentRgb},0.4)`,border:"2px solid var(--bg-deep)"},children:I.unreadCount})]}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"4px"},children:[t.jsx("h3",{style:{margin:0,fontSize:"1.05rem",fontWeight:
2324I.unreadCount>0?"700":"600"},children:I.name}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:"2px",flexShrink:0},children:[I.lastDate&&t.jsx("span",{style:{fontSize:"0.72rem",color:I.unreadCount>0?n.accent:"rgba(255,255,255,0.35)",fontWeight:I.unreadCount>0?"600":"400"},children:I.lastDate}),I.lastTime&&t.jsxs("span",{style:{fontSize:"0.68rem",color:"rgba(255,255,255,0.3)",display:"flex",alignItems:"center",gap:"3px"},children:[t.jsx(Pn,{size:10})," ",I.lastTime]})]})]}),t.jsx("p",{style:{margin:0,fontSize:"0.85rem",color:I.unreadCount>0?"white":"var(--text-muted)",fontWeight:I.unreadCount>0?"600":"normal",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:I.lastMessage})]}),t.jsx("button",{onClick:R=>{R.stopPropagation(),u(I)},title:"Supprimer la discussion",style:{background:"transparent",border:"none",color:"#ff4d4d",cursor:"pointer",opacity:.4,padding:"8px",borderRadius:"10px",transition:"all 0.2s",flexShrink:0,display:"flex",alignItems:"center"},onMouseEnter:R=>{R.currentTarget.style.opacity="1",R.currentTarget.style.background="rgba(255,77,77,0.1)"},onMouseLeave:R=>{R.currentTarget.style.opacity="0.4",R.currentTarget.style.background="transparent"},children:t.jsx(rn,{size:18})})]},I.id)),T.length===0&&!g&&t.jsxs("div",{style:{textAlign:"center",marginTop:"60px"},children:[t.jsx(Qt,{size:48,color:"rgba(255,255,255,0.15)",style:{marginBottom:"16px"}}),t.jsx("p",{style:{color:"var(--text-muted)",fontSize:"1rem"},children:"Aucune conversation pour le moment."}),t.jsx("p",{style:{color:"rgba(255,255,255,0.3)",fontSize:"0.85rem"},children:"Commencez à discuter avec vos matchs !"})]}),T.length===0&&g&&t.jsxs("div",{style:{textAlign:"center",marginTop:"40px"},children:[t.jsx(qo,{size:40,color:"rgba(255,255,255,0.15)",style:{marginBottom:"12px"}}),t.jsxs("p",{style:{color:"var(--text-muted)",fontSize:"0.95rem"},children:['Aucun résultat pour "',g,'"']})]})]})]}),t.jsx(tr,{children:p&&t.jsx(ye.div,{initial:{opacity:0}
2324,animate:{opacity:1},exit:{opacity:0},style:{position:"fixed",inset:0,zIndex:2e3,background:"rgba(0,0,0,0.7)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>u(null),children:t.jsxs(ye.div,{initial:{scale:.85,opacity:0,y:20},animate:{scale:1,opacity:1,y:0},exit:{scale:.85,opacity:0,y:20},transition:{type:"spring",damping:25,stiffness:300},onClick:I=>I.stopPropagation(),style:{background:"linear-gradient(135deg, rgba(30,30,50,0.98), rgba(20,15,35,0.98))",borderRadius:"24px",border:"1px solid rgba(255,255,255,0.1)",boxShadow:"0 25px 60px rgba(0,0,0,0.6)",padding:"32px",width:"90%",maxWidth:"420px",textAlign:"center"},children:[t.jsx("div",{style:{width:"64px",height:"64px",borderRadius:"50%",background:"rgba(255,77,77,0.15)",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 20px"},children:t.jsx(_n,{size:32,color:"#ff4d4d"})}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"12px",marginBottom:"16px"},children:[t.jsx("img",{src:p.photo,alt:p.name,style:{width:"44px",height:"44px",borderRadius:"50%",objectFit:"cover"}}),t.jsx("span",{style:{fontWeight:"700",fontSize:"1.1rem"},children:p.name})]}),t.jsx("h3",{style:{fontSize:"1.15rem",fontWeight:"700",marginBottom:"10px"},children:"Supprimer cette discussion ?"}),t.jsxs("p",{style:{color:"rgba(255,255,255,0.55)",fontSize:"0.9rem",lineHeight:1.5,marginBottom:"28px"},children:["Ãtes-vous sûr de vouloir supprimer cette discussion ?",t.jsx("br",{}),t.jsx("span",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.35)"},children:"La conversation sera masquée mais réapparaîtra si un nouveau message arrive."})]}),t.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"center"},children:[t.jsx("button",{onClick:()=>u(null),style:{flex:1,padding:"14px 24px",borderRadius:"14px",background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.12)",color:"white",fontWeight:"600",fontSize:"0.95rem",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:I=>I.currentTarget.style.background="rgba(255,255,255,0.15)",onMouseLeave:I=>I.currentTarget.style.background="rgba(255,255,255,0.08)",children:"Annuler"}),t.jsx("button",{onClick:()=>b(p.id),style:{flex:1,padding:"14px 24px",borderRadius:"14px",background:"linear-gradient(135deg, #ff4d4d, #cc0000)",border:"none",color:"white",fontWeight:"700",fontSize:"0.95rem",cursor:"pointer",transition:"all 0.2s",boxShadow:"0 4px 16px rgba(255,77,77,0.3)"},onMouseEnter:I=>I.currentTarget.style.transform="scale(1.03)",onMouseLeave:I=>I.currentTarget.style.transform="scale(1)",children:"ðï¸ Supprimer"})]})]})})}),l&&t.jsx(ll,{match:l,onClose:()=>d(null)})]})},EP=()=>{const e=Lt(),r={marginBottom:"30px"},i={color:"var(--primary)",fontSize:"1.3rem",marginBottom:"12px",fontFamily:"Outfit, sans-serif",fontWeight:"700"};return t.jsx("div",{style:{minHeight:"100vh",background:"var(--bg-deep)",paddingBottom:"40px"},children:t.jsxs("div",{style:{maxWidth:"800px",margin:"40px auto",padding:"0 20px"},children:[t.jsxs("button",{onClick:()=>window.history.length>1?e(-1):window.close(),style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",marginBottom:"20px"},children:[t.jsx(Hr,{size:20})," Retour"]}),t.jsx("h1",{style:{fontFamily:"Outfit, sans-serif",fontSize:"2rem",marginBottom:"30px",color:"var(--primary)",fontWeight:"800"},children:"Conditions Générales d'Utilisation (CGU)"}),t.jsxs("div",{className:"glass-panel",style:{padding:"30px",borderRadius:"var(--radius-lg)",color:"var(--text-main)",lineHeight:"1.7",fontSize:"0.92rem"},children:[t.jsxs("div",{style:{background:"rgba(255, 51, 51, 0.1)",borderLeft:"4px solid #ff3333",padding:"16px 20px",marginBottom:"30px",borderRadius:"0 8px 8px 0"},children:[t.jsx("h3",{style:{color:"#ff3333",marginTop:0,marginBottom:"8px",fontSize:"1rem"},children:"â ï¸ AVERTISSEMENT â PLATEFORME RÃSERVÃE AUX MAJEURS"}),t.jsx("p",{style:{margin:0,fontSize:"0.88rem"},children:"L'accès à la plateforme MEETapps (incluant les espaces Eros, Erox et Friend) est strictement réservé aux personnes physiques âgées de dix-huit (18) ans révolus. En créant un compte, vous déclarez sur l'honneur avoir l'âge légal requis. L'espace Erox peut contenir des contenus à caractère érotique et sensuel ; son accès nécessite un consentement explicite et éclairé."})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 1 â Ãditeur et Mentions Légales"}),t.jsxs("p",{children:[t.jsx("strong",{children:"Ãditeur :"})," MEET YOU, marque commerciale de la société ",t.jsx("strong",{children:"MEETYOUEVENT"}),t.jsx("br",{}),t.jsx("strong",{children:"Forme juridique :"})," SARL à associé unique (EURL)",t.jsx("br",{}),t.jsx("strong",{children:"Capital social :"})," 5 000,00 â¬",t.jsx("br",{}),t.jsx("strong",{children:"Siège social :"})," 16 rue Notre Dame, 59400 Estourmel, France",t.jsx("br",{}),t.jsx("strong",{children:"RCS :"})," 838 708 196 R.C.S. Douai",t.jsx("br",{}),t.jsx("strong",{children:"N° TVA intracommunautaire :"})," FR 83 838708196",t.jsx("br",{}),t.jsx("strong",{children:"Directeur de la publication :"})," M. Guillaume GERGAUD",t.jsx("br",{}),t.jsx("strong",{children:"Contact :"})," [email protected]",t.jsx("br",{}),t.jsx("strong",{children:"Site web :"})," https://meetapps.ai",t.jsx("br",{}),t.jsx("strong",{children:"Hébergeur :"})," Supabase Inc. (backend/BDD) â OVH SAS, 2 rue Kellermann, 59100 Roubaix, France (DNS/domaine) â Netlify Inc. (frontend)"]})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 2 â Objet et Champ d'Application"}),t.jsxs("p",{children:["Les présentes Conditions Générales d'Utilisation (ci-après « CGU ») ont pour objet de définir les modalités et conditions d'accès et d'utilisation de la plateforme de mise en relation MEETapps (ci-après « la Plateforme »), accessible depuis le site web ",t.jsx("strong",{children:"meetapps.ai"})," et les applications mobiles associées (iOS et Android)."]}),t.jsx("p",{children:"La Plateforme propose trois espaces distincts :"}),t.jsxs("ul",{style:{paddingLeft:"20px"},children:[t.jsxs("li",{children:[t.jsx("strong",{children:"MEETapps Eros :"})," espace de rencontres romantiques et amoureuses."]}),t.jsxs("li",{children:[t.jsx("strong",{children:"MEETapps Erox :"})," espace réservé aux adultes consentants, pouvant contenir des contenus à caractère érotique et sensuel."]}),t.jsxs("li",{children:[t.jsx("strong",{children:"MEETapps Friend :"})," espace de rencontres amicales et de networking social."]})]}),t.jsx("p",{children:"L'inscription sur la Plateforme implique l'acceptation pleine et entière des présentes CGU. Si vous n'acceptez pas ces conditions, vous ne devez pas utiliser la Plateforme."})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 3 â Conditions d'Inscription"}),t.jsx("p",{children:"Pour s'inscrire sur la Plateforme, l'utilisateur doit :"}),t.jsxs("ul",{style:{paddingLeft:"20px"},children:[t.jsxs("li",{children:["Ãtre une personne physique âgée d'au moins ",t.jsx("strong",{children:"18 ans révolus"}),"."]}),t.jsx("li",{children:"Fournir des informations exactes, complètes et à jour."}),t.jsx("li",{children:"Utiliser une adresse email valide et personnelle."}),t.jsx("li",{children:"Accepter les présentes CGU et, le cas échéant, les Conditions Générales de Vente (CGV
2324)."}),t.jsx("li",{children:"Ne pas avoir été précédemment banni de la Plateforme."})]}),t.jsxs("p",{children:["L'utilisateur est seul responsable de la confidentialité de ses identifiants de connexion. Toute utilisation de son compte est réputée faite par lui-même. En cas d'utilisation frauduleuse, l'utilisateur doit immédiatement en informer l'Ãditeur à l'adresse ",t.jsx("strong",{children:"[email protected]"}),"."]})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 4 â Description des Services"}),t.jsx("p",{children:"La Plateforme propose les services suivants :"}),t.jsxs("ul",{style:{paddingLeft:"20px"},children:[t.jsxs("li",{children:[t.jsx("strong",{children:"Création de profil :"})," nom, photos, bio écrite et vocale, centres d'intérêt (tags), localisation."]}),t.jsxs("li",{children:[t.jsx("strong",{children:"Mise en relation :"})," algorithme de matching basé sur les critères de recherche, localisation et affinités."]}),t.jsxs("li",{children:[t.jsx("strong",{children:"Messagerie instantanée :"})," chat textuel, emojis, envoi de cadeaux virtuels (hologrammes 3D)."]}),t.jsxs("li",{children:[t.jsx("strong",{children:"Carte interactive :"})," visualisation des membres à proximité."]}),t.jsxs("li",{children:[t.jsx("strong",{children:"Ãvénements :"})," création et participation à des événements communautaires."]}),t.jsxs("li",{children:[t.jsx("strong",{children:"Entraide :"})," marketplace de services entre membres."]}),t.jsxs("li",{children:[t.jsx("strong",{children:"Badge de confiance :"})," vérification d'identité par selfie."]}),t.jsxs("li",{children:[t.jsx("strong",{children:"Monnaie virtuelle (MEETips) :"})," système de crédits permettant l'achat de fonctionnalités premium (cadeaux, bio vocale, mise en avant)."]})]})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 5 â Charte de Bonne Conduite"}),t.jsxs("p",{children:["L'utilisateur s'engage à utiliser la Plateforme de manière respectueuse et conforme aux lois en vigueur. Sont ",t.jsx("strong",{children:"strictement interdits"})," :"]}),t.jsxs("ul",{style:{paddingLeft:"20px"},children:[t.jsx("li",{children:"Tout propos haineux, raciste, homophobe, sexiste ou discriminatoire."}),t.jsx("li",{children:"Le harcèlement, l'intimidation, le « stalking » ou toute forme de pression psychologique."}),t.jsx("li",{children:"La diffusion de contenus pédopornographiques ou impliquant des mineurs (signalement immédiat aux autorités : Pharos, CNIL)."}),t.jsx("li",{children:"La promotion de la prostitution, du proxénétisme ou de toute activité illicite."}),t.jsx("li",{children:"L'usurpation d'identité (« catfishing ») ou l'utilisation de photos ne représentant pas l'utilisateur."}),t.jsx("li",{children:"Le spam, la publicité non sollicitée, les arnaques et le phishing."}),t.jsx("li",{children:"La collecte, l'extraction ou le scraping de données personnelles d'autres utilisateurs."}),t.jsx("li",{children:"L'utilisation de bots, scripts ou tout procédé automatisé sans autorisation."}),t.jsx("li",{children:"La diffusion de contenus violents, gore ou incitant à la haine."})]}),t.jsxs("p",{children:["Tout manquement à cette charte pourra entraîner un ",t.jsx("strong",{children:"avertissement, une suspension temporaire ou une suppression définitive du compte"}),", sans préavis ni remboursement des MEETips acquis."]})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 6 â Espace Erox â Dispositions Spécifiques"}),t.jsx("p",{children:"L'espace MEETapps Erox est un espace réservé aux adultes consentants (18 ans et plus). En accédant à cet espace, l'utilisateur reconnaît et accepte que :"}),t.jsxs("ul",{style:{paddingLeft:"20px"},children:[t.jsx("li",{children:"Des contenus à caractère érotique, sensuel ou suggestif peuvent être présents."}),t.jsx("li",{children:"L'utilisateur est seul responsable des photos et contenus qu'il partage sur cet espace."}),t.jsx("li",{children:"Il est interdit de partager les contenus d'autres utilisateurs en dehors de la Plateforme sans leur consentement explicite."}),t.jsx("li",{children:"Le non-respect du consentement d'un autre utilisateur constitue une infraction pénale et sera signalé aux autorités compétentes."})]})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 7 â Propriété Intellectuelle"}),t.jsx("p",{children:"L'ensemble des éléments constituant la Plateforme (design, code, textes, logos, icônes, images, hologrammes 3D, algorithmes, base de données) est la propriété exclusive de MEETYOUEVENT ou de ses partenaires et est protégé par le droit de la propriété intellectuelle."}),t.jsxs("p",{children:["L'utilisateur conserve ses droits sur les contenus qu'il publie (photos, textes, bio vocale) mais accorde à MEETYOUEVENT une ",t.jsx("strong",{children:"licence non exclusive, mondiale et gratuite"})," d'utilisation dans le cadre du fonctionnement de la Plateforme."]})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 8 â Signalement et Modération"}),t.jsx("p",{children:"Conformément à la loi n° 2004-575 du 21 juin 2004 pour la confiance dans l'économie numérique (LCEN), MEETYOUEVENT met à disposition un dispositif de signalement :"}),t.jsxs("ul",{style:{paddingLeft:"20px"},children:[t.jsxs("li",{children:[t.jsx("strong",{children:"Bouton « Signaler »"})," présent sur chaque profil et dans chaque conversation."]}),t.jsxs("li",{children:[t.jsx("strong",{children:"Contact direct :"})," [email protected]"]}),t.jsxs("li",{children:[t.jsx("strong",{children:"Signalement d'abus :"})," [email protected]"]})]}),t.jsx("p",{children:"MEETYOUEVENT s'engage à traiter tout signalement dans un délai raisonnable et à supprimer promptement tout contenu manifestement illicite. La société se réserve le droit de transmettre aux autorités compétentes les données nécessaires en cas d'infraction pénale."})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 9 â Protection des Données Personnelles"}),t.jsxs("p",{children:["Le traitement des données personnelles par MEETYOUEVENT est conforme au Règlement Général sur la Protection des Données (RGPD â Règlement UE 2016/679). L'utilisateur est invité à consulter notre ",t.jsx("strong",{children:"Politique de Confidentialité"})," accessible à l'adresse ",t.jsx("a",{href:"/privacy",style:{color:"var(--primary)"},children:"meetapps.ai/privacy"})," pour connaître les modalités de collecte, traitement et conservation de ses données."]}),t.jsxs("p",{children:[t.jsx("strong",{children:"Responsable de traitement :"})," MEETYOUEVENT â RCS Douai 838 708 196",t.jsx("br",{}),t.jsx("strong",{children:"DPO :"})," [email protected]",t.jsx("br",{}),t.jsx("strong",{children:"Droits :"})," accès, rectification, effacement, portabilité, limitation, opposition. Ces droits peuvent être exercés depuis les Paramètres du compte ou par email."]})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 10 â Limitation de Responsabilité"}),t.jsx("p",{children:"MEETYOUEVENT agit en qualité d'hébergeur au sens de la LCEN. La société ne saurait être tenue responsable :"}),t.jsxs("ul",{style:{paddingLeft:"20px"},children:[t.jsx("li",{children:"Des contenus publiés par les utilisateurs."}),t.jsx("li",{children:"Des interactions, rencontres ou échanges entre utilisateurs en dehors de la Plateforme."}),t.jsx("li",{children:"Des dommages directs ou indirects résultant de l'utilisation ou de l'impossibilité d'utiliser la Plateforme."}),t.jsx("li",{children:"Des interruptions temporaires de service pour maintenance ou mises à jour."}),t.jsx("li",{children:"De la véracité des informations fournies par les utilisateurs."})]}),t.jsx("p",{children:"L'utilisateur reconnaît que les rencontres en ligne comportent des risques inhérents et s'engage à faire preuve de prudence dans ses interactions."})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 11 â Résiliation et Suppression de Compte"}),t.jsx("p",{children:"L'utilisateur peut supprimer son compte à tout moment depuis les Paramètres de l'application. La suppression entraîne l'effacement définitif et irréversible de l'ensemble de ses données, dans un délai maximal de 30 jours, conformément au RGPD."}),t.jsx("p",{children:"MEETYOUEVENT se réserve le droit de suspendre ou supprimer tout compte en violation des présentes CGU, sans préavis ni indemnité."})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 12 â Droit Applicable et Juridiction Compétente"}
2324),t.jsxs("p",{children:["Les présentes CGU sont régies par le ",t.jsx("strong",{children:"droit français"}),". En cas de litige, les parties s'efforceront de trouver une solution amiable. à défaut, les tribunaux du ressort du ",t.jsx("strong",{children:"Tribunal Judiciaire de Douai"})," seront seuls compétents."]}),t.jsxs("p",{children:["Conformément aux dispositions du Code de la consommation, l'utilisateur peut recourir gratuitement à un médiateur de la consommation en vue de la résolution amiable du litige. Le médiateur compétent est : ",t.jsx("strong",{children:"Centre de Médiation et d'Arbitrage de Paris (CMAP)"})," â www.cmap.fr."]})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 13 â Modification des CGU"}),t.jsx("p",{children:"MEETYOUEVENT se réserve le droit de modifier les présentes CGU à tout moment. Les utilisateurs seront informés de toute modification substantielle par notification dans l'application ou par email. La poursuite de l'utilisation de la Plateforme après notification vaut acceptation des CGU modifiées."})]}),t.jsxs("p",{style:{fontSize:"0.8rem",color:"var(--text-muted)",marginTop:"40px",borderTop:"1px solid rgba(255,255,255,0.1)",paddingTop:"20px"},children:["Dernière mise à jour : 5 mars 2026. Version 2.0.",t.jsx("br",{}),"Loi applicable : Droit Français | Juridiction : Tribunal Judiciaire de Douai"]})]})]})})},RP=()=>{const e=Lt();return t.jsx("div",{style:{minHeight:"100vh",background:"var(--bg-deep)",paddingBottom:"40px"},children:t.jsxs("div",{style:{maxWidth:"800px",margin:"40px auto",padding:"0 20px"},children:[t.jsxs("button",{onClick:()=>window.history.length>1?e(-1):window.close(),style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",marginBottom:"20px"},children:[t.jsx(Hr,{size:20})," Retour"]}),t.jsx("h1",{style:{fontFamily:"Playfair Display",fontSize:"2.5rem",marginBottom:"30px",color:"var(--primary)"},children:"Politique de Confidentialité"}),t.jsxs("div",{className:"glass-panel",style:{padding:"40px",borderRadius:"var(--radius-lg)",color:"var(--text-main)",lineHeight:"1.6"},children:[t.jsxs("p",{style:{marginBottom:"20px"},children:["La protection de vos données personnelles est une priorité pour ",t.jsx("strong",{children:"MEET YOU"}),". En conformité avec le Règlement Général sur la Protection des Données (RGPD), voici comment nous traitons vos informations."]}),t.jsxs("section",{style:{marginBottom:"30px"},children:[t.jsx("h2",{style:{color:"var(--primary)",fontSize:"1.5rem",marginBottom:"15px",fontFamily:"Playfair Display"},children:"1. Responsable de Traitement"}),t.jsxs("p",{children:["Le responsable du traitement des données est la société ",t.jsx("strong",{children:"MEETYOUEVENT"})," (RCS Douai 838 708 196).",t.jsx("br",{}),t.jsx("strong",{children:"Délégué à la Protection des Données (DPO) :"})," [email protected]"]})]}),t.jsxs("section",{style:{marginBottom:"30px"},children:[t.jsx("h2",{style:{color:"var(--primary)",fontSize:"1.5rem",marginBottom:"15px",fontFamily:"Playfair Display"},children:"2. Données Sensibles"}),t.jsxs("p",{children:['En utilisant MEET YOU, vous pouvez être amené à communiquer des données dites "sensibles" (orientation sexuelle, préférences, croyances). En remplissant votre profil, vous donnez votre ',t.jsx("strong",{children:"consentement explicite"}),' au traitement de ces données pour la finalité de "Matching" (Mise en relation).']})]}),t.jsxs("section",{style:{marginBottom:"30px"},children:[t.jsx("h2",{style:{color:"var(--primary)",fontSize:"1.5rem",marginBottom:"15px",fontFamily:"Playfair Display"},children:"3. Conservation des Données"}),t.jsx("p",{children:"Vos données sont conservées pendant toute la durée d'utilisation du compte. En cas d'inactivité prolongée (24 mois), elles seront automatiquement anonymisées ou supprimées."})]}),t.jsxs("section",{style:{marginBottom:"30px"},children:[t.jsx("h2",{style:{color:"var(--primary)",fontSize:"1.5rem",marginBottom:"15px",fontFamily:"Playfair Display"},children:"4. Vos Droits"}),t.jsx("p",{children:`Vous disposez d'un droit d'accès, de rectification, d'effacement (droit à l'oubli) et de portabilité de vos données. Vous pouvez exercer ces droits directement depuis vos "Paramètres" ou en écrivant au DPO.`}),t.jsx("p",{style:{marginTop:"10px"},children:"Vous avez également le droit d'introduire une réclamation auprès de la CNIL (Commission Nationale de l'Informatique et des Libertés) si vous estimez que vos droits ne sont pas respectés."})]}),t.jsxs("section",{style:{marginBottom:"30px"},children:[t.jsx("h2",{style:{color:"var(--primary)",fontSize:"1.5rem",marginBottom:"15px",fontFamily:"Playfair Display"},children:"5. Sécurité"}),t.jsx("p",{children:"Nous mettons en Åuvre des mesures techniques (chiffrement SSL, hachage des mots de passe) pour protéger vos données contre tout accès non autorisé. Cependant, rappelez-vous que la sécurité sur Internet n'est jamais absolue."})]})]})]})})},IP=()=>{const e=Lt(),r={marginBottom:"30px"},i={color:"var(--primary)",fontSize:"1.3rem",marginBottom:"12px",fontFamily:"Outfit, sans-serif",fontWeight:"700"};return t.jsx("div",{style:{minHeight:"100vh",background:"var(--bg-deep)",paddingBottom:"40px"},children:t.jsxs("div",{style:{maxWidth:"800px",margin:"40px auto",padding:"0 20px"},children:[t.jsxs("button",{onClick:()=>window.history.length>1?e(-1):window.close(),style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",marginBottom:"20px"},children:[t.jsx(Hr,{size:20})," Retour"]}
2324),t.jsx("h1",{style:{fontFamily:"Outfit, sans-serif",fontSize:"2rem",marginBottom:"30px",color:"var(--primary)",fontWeight:"800"},children:"Conditions Générales de Vente (CGV)"}),t.jsxs("div",{className:"glass-panel",style:{padding:"30px",borderRadius:"var(--radius-lg)",color:"var(--text-main)",lineHeight:"1.7",fontSize:"0.92rem"},children:[t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 1 â Vendeur"}),t.jsxs("p",{children:[t.jsx("strong",{children:"Vendeur :"})," MEETYOUEVENT, SARL à associé unique (EURL)",t.jsx("br",{}),t.jsx("strong",{children:"Capital social :"})," 5 000,00 â¬",t.jsx("br",{}),t.jsx("strong",{children:"Siège social :"})," 16 rue Notre Dame, 59400 Estourmel, France",t.jsx("br",{}),t.jsx("strong",{children:"RCS :"})," 838 708 196 R.C.S. Douai",t.jsx("br",{}),t.jsx("strong",{children:"N° TVA intracommunautaire :"})," FR 83 838708196",t.jsx("br",{}),t.jsx("strong",{children:"Contact :"})," [email protected]",t.jsx("br",{}),t.jsx("strong",{children:"Directeur de la publication :"})," M. Guillaume GERGAUD"]})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 2 â Objet"}),t.jsxs("p",{children:["Les présentes Conditions Générales de Vente (ci-après « CGV ») régissent les ventes de ",t.jsx("strong",{children:"monnaie virtuelle « MEETips »"})," et de tout service premium proposé sur la plateforme MEETapps, accessible depuis le site web ",t.jsx("strong",{children:"meetapps.ai"})," et les applications mobiles iOS et Android associées."]}
2324),t.jsx("p",{children:"Toute commande implique l'acceptation sans réserve par l'acheteur des présentes CGV, qui prévalent sur tout autre document."})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 3 â Produits et Tarifs"}),t.jsxs("p",{children:["MEETYOUEVENT commercialise des crédits virtuels dénommés ",t.jsx("strong",{children:"« MEETips »"}),", utilisables exclusivement au sein de la Plateforme. Les MEETips permettent d'accéder à des fonctionnalités premium telles que l'envoi de cadeaux virtuels holographiques, l'enregistrement d'une bio vocale, la mise en avant du profil, et d'autres services."]}),t.jsx("p",{children:"Les packs disponibles, à la date de mise à jour des présentes CGV, sont :"}),t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",marginTop:"12px",marginBottom:"12px"},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{borderBottom:"1px solid rgba(255,255,255,0.15)"},children:[t.jsx("th",{style:{padding:"10px",textAlign:"left",color:"var(--primary)"},children:"Pack"}),t.jsx("th",{style:{padding:"10px",textAlign:"center",color:"var(--primary)"},children:"MEETips"}),t.jsx("th",{style:{padding:"10px",textAlign:"center",color:"var(--primary)"},children:"Prix TTC"})]})}),t.jsxs("tbody",{children:[t.jsxs("tr",{style:{borderBottom:"1px solid rgba(255,255,255,0.06)"},children:[t.jsx("td",{style:{padding:"10px"},children:"⨠Pack Découverte"}),t.jsx("td",{style:{padding:"10px",textAlign:"center"},children:"60 MEETips"}),t.jsx("td",{style:{padding:"10px",textAlign:"center",fontWeight:"700"},children:"10,00 â¬"})]}),t.jsxs("tr",{style:{borderBottom:"1px solid rgba(255,255,255,0.06)"},children:[t.jsx("td",{style:{padding:"10px"},children:"ð Pack Plaisir"}),t.jsxs("td",{style:{padding:"10px",textAlign:"center"},children:["95 MEETips ",t.jsx("span",{style:{color:"#a855f7",fontSize:"0.8rem"},children:"(+15 bonus)"})]}),t.jsx("td",{style:{padding:"10px",textAlign:"center",fontWeight:"700"},children:"15,00 â¬"})]}),t.jsxs("tr",{style:{borderBottom:"1px solid rgba(255,255,255,0.06)"},children:[t.jsx("td",{style:{padding:"10px"},children:"ð¥ Pack Séducteur"}),t.jsxs("td",{style:{padding:"10px",textAlign:"center"},children:["130 MEETips ",t.jsx("span",{style:{color:"#f97316",fontSize:"0.8rem"},children:"(+20 bonus)"})]}),t.jsx("td",{style:{padding:"10px",textAlign:"center",fontWeight:"700"},children:"20,00 â¬"})]}),t.jsxs("tr",{children:[t.jsx("td",{style:{padding:"10px"},children:"ð Pack Expert"}),t.jsxs("td",{style:{padding:"10px",textAlign:"center"},children:["350 MEETips ",t.jsx("span",{style:{color:"#eab308",fontSize:"0.8rem"},children:"(+50 bonus)"})]}),t.jsx("td",{style:{padding:"10px",textAlign:"center",fontWeight:"700"},children:"50,00 â¬"})]})]})]}),t.jsx("p",{children:"Les prix sont indiqués en euros, toutes taxes comprises (TTC). MEETYOUEVENT se réserve le droit de modifier ses tarifs à tout moment ; les tarifs applicables sont ceux en vigueur au moment de la commande."})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 4 â Processus de Commande"}),t.jsx("p",{children:"La commande de MEETips s'effectue selon les étapes suivantes :"}),t.jsxs("ol",{style:{paddingLeft:"20px"},children:[t.jsx("li",{children:"Sélection du pack souhaité dans la Boutique (section « MEETips »)."}),t.jsxs("li",{children:["Redirection vers la plateforme de paiement sécurisée ",t.jsx("strong",{children:"Stripe"}),"."]}),t.jsx("li",{children:"Saisie des informations de paiement et validation."}),t.jsx("li",{children:"Confirmation de la commande et crédit immédiat des MEETips sur le compte de l'utilisateur."})]}),t.jsx("p",{children:"Le clic sur le bouton « Acheter » constitue une acceptation irrévocable de la commande et des présentes CGV."})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 5 â Paiement"}),t.jsxs("p",{children:["Les paiements sont traités par ",t.jsx("strong",{children:"Stripe, Inc."}),", prestataire de paiement certifié ",t.jsx("strong",{children:"PCI DSS Niveau 1"}),". MEETYOUEVENT ne collecte ni ne stocke directement les données bancaires de ses utilisateurs."]}),t.jsx("p",{children:"Moyens de paiement acceptés :"}),t.jsxs("ul",{style:{paddingLeft:"20px"},children:[t.jsx("li",{children:"Carte bancaire (Visa, Mastercard, American Express)"}),t.jsx("li",{children:"Apple Pay / Google Pay (selon disponibilité)"})]}),t.jsx("p",{children:"Toute commande est payable en euros (â¬). Le paiement est exigible immédiatement à la commande. La transaction est sécurisée par le protocole SSL/TLS."})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 6 â Livraison"}),t.jsxs("p",{children:["Les MEETips étant un contenu numérique, leur livraison est ",t.jsx("strong",{children:"instantanée"})," après validation du paiement. Les crédits sont immédiatement disponibles sur le compte de l'utilisateur au sein de la Plateforme."]})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 7 â Droit de Rétractation"}),t.jsx("div",{style:{background:"rgba(245,158,11,0.1)",borderLeft:"4px solid #f59e0b",padding:"16px 20px",marginBottom:"12px",borderRadius:"0 8px 8px 0"},children:t.jsxs("p",{style:{margin:0},children:[t.jsx("strong",{children:"â ï¸ Conformément à l'article L.221-28 du Code de la consommation"}),", le droit de rétractation ne peut être exercé pour les contrats de fourniture de ",t.jsx("strong",{children:"contenu numérique non fourni sur un support matériel dont l'exécution a commencé avec l'accord préalable et exprès du consommateur"}),", et moyennant sa renonciation expresse à son droit de rétractation."]})}),t.jsxs("p",{children:["En validant l'achat de MEETips, l'utilisateur reconnaît que la fourniture du contenu numérique commence immédiatement après la confirmation du paiement et ",t.jsx("strong",{children:"renonce expressément à son droit de rétractation"}),"."]}),t.jsxs("p",{children:[t.jsx("strong",{children:"Exception :"})," en cas d'erreur technique avérée (double facturation, MEETips non crédités malgré le paiement), l'utilisateur peut contacter le support à ",t.jsx("strong",{children:"[email protected]"})," pour un remboursement ou une régularisation dans un délai de 14 jours suivant la transaction."]})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 8 â Nature des MEETips"}),t.jsx("p",{children:"Les MEETips sont une monnaie virtuelle interne à la Plateforme. L'utilisateur reconnaît et accepte que :"}),t.jsxs("ul",{style:{paddingLeft:"20px"},children:[t.jsxs("li",{children:["Les MEETips ",t.jsx("strong",{children:"ne sont pas remboursables"})," (sauf exception prévue à l'article 7)."]}),t.jsxs("li",{children:["Les MEETips ",t.jsx("strong",{children:"ne sont pas échangeables"})," contre de l'argent réel, des biens ou des services en dehors de la Plateforme."]}),t.jsxs("li",{children:["Les MEETips ",t.jsx("strong",{children:"ne sont pas transférables"})," d'un compte à un autre."]}),t.jsxs("li",{children:["Les MEETips n'ont ",t.jsx("strong",{children:"aucune valeur monétaire"})," en dehors de la Plateforme."]}),t.jsxs("li",{children:["En cas de suppression du compte (volontaire ou suite à une violation des CGU), les MEETips restants sont ",t.jsx("strong",{children:"définitivement perdus"})," sans droit à remboursement."]}),t.jsx("li",{children:"MEETYOUEVENT se réserve le droit de modifier la valeur d'échange des MEETips au sein de la Plateforme."})]})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 9 â Facture et Preuve d'Achat"}),t.jsxs("p",{children:["Un reçu de paiement est envoyé par email via Stripe après chaque transaction. L'utilisateur peut demander une facture détaillée en contactant ",t.jsx("strong",{children:"[email protected]"}),"."]})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 10 â Protection des Consommateurs"}),t.jsx("p",{children:"En cas de contestation de paiement (« chargeback ») non justifiée, MEETYOUEVENT se réserve le droit de suspendre immédiatement le compte de l'utilisateur et ses MEETips associés, dans l'attente de la résolution du litige par Stripe."})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 11 â Garanties"}),t.jsx("p",{children:"MEETYOUEVENT garantit la conformité de ses services numériques aux descriptions présentées sur la Plateforme, conformément aux articles L.217-1 et suivants du Code de la consommation. En cas de non-conformité avérée (MEETips non crédités, fonctionnalité premium non fournie malgré le paiement), l'utilisateur dispose d'un délai de 2 ans pour faire valoir la garantie légale de conformité."})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 12 â Médiation et Litiges"}),t.jsxs("p",{children:["En cas de litige relatif à un achat, l'utilisateur peut dans un premier temps contacter le service client à ",t.jsx("strong",{children:"[email protected]"}),"."]}),t.jsxs("p",{children:["Conformément aux articles L.611-1 et R.612-1 du Code de la consommation, l'utilisateur peut recourir gratuitement au service de médiation suivant :",t.jsx("br",{}),t.jsx("strong",{children:"Centre de Médiation et d'Arbitrage de Paris (CMAP)"}
2324)," â www.cmap.fr",t.jsx("br",{}),t.jsx("strong",{children:"Plateforme européenne de règlement en ligne des litiges :"})," ",t.jsx("a",{href:"https://ec.europa.eu/consumers/odr",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--primary)"},children:"https://ec.europa.eu/consumers/odr"})]}),t.jsxs("p",{children:["à défaut de résolution amiable, les tribunaux du ressort du ",t.jsx("strong",{children:"Tribunal Judiciaire de Douai"})," seront compétents, sous réserve des règles de compétence d'ordre public applicables au consommateur."]})]}),t.jsxs("section",{style:r,children:[t.jsx("h2",{style:i,children:"Article 13 â Modification des CGV"}),t.jsx("p",{children:"MEETYOUEVENT se réserve le droit de modifier les présentes CGV. Les conditions applicables sont celles en vigueur à la date de la commande. Toute modification substantielle fera l'objet d'une notification aux utilisateurs."})]}),t.jsxs("p",{style:{fontSize:"0.8rem",color:"var(--text-muted)",marginTop:"40px",borderTop:"1px solid rgba(255,255,255,0.1)",paddingTop:"20px"},children:["Dernière mise à jour : 5 mars 2026. Version 1.0.",t.jsx("br",{}),"Loi applicable : Droit Français | Juridiction : Tribunal Judiciaire de Douai"]})]})]})})},TP=`Tu es l'assistant de support de MEETapps, l'application de rencontres. 2325Tu t'appelles Lia et tu es là pour aider les utilisateurs avec leurs questions sur l'application. 2326 2327Tu dois répondre de manière naturelle, chaleureuse et concise en français. 2328 2329CONNAISSANCE COMPLÃTE DE L'APPLICATION : 2330 2331ð ESPACES : 2332- EROS (â¤ï¸) : Rencontres amoureuses sérieuses. Profils soignés, conversations profondes. Pour ceux qui cherchent l'amour. 2333- EROX (ð¥) : Rencontres coquines et libertines. Espace sans tabou, en toute liberté et discrétion. 2334- FRIEND (ð¤) : Amitié uniquement. Sorties, activités, bons plans. Zéro drague. 2335 2336ðª MEETIPS (monnaie virtuelle) : 2337- Chaque utilisateur reçoit des Meetips gratuitement 2338- Bio vocale = 11 Meetips 2339- Photo animée = coût variable 2340- Les Meetips s'achètent en packs : Starter (4.99â¬), Regular (7.99â¬), Pro (12.99â¬), Ultimate (29.99â¬) 2341 2342ð CADEAUX : 2343- Envoyer des cadeaux virtuels à ses matchs 2344- Apparaissent sur le profil du destinataire 2345- Bon moyen d'attirer l'attention 2346 2347ðï¸ BIO VOCALE : 2348- Enregistrement audio de 30 secondes max 2349- Coûte 11 Meetips, réenregistrement possible 2350 2351ð¸ PHOTOS : 2352- Chaque espace a ses propres photos (Eros, Erox, Friend) 2353- Photo animée : version animée de la photo de profil 2354- Photo de vérification : selfie pour prouver son identité â badge vérifié â 2355 2356â PREMIUM (9.99â¬/mois) : 2357- Messages illimités 2358- Accès à toutes les fonctionnalités 2359- Pas de publicités 2360- Voir qui t'a liké 2361 2362ð FONCTIONNEMENT : 2363- Swipe pour liker/passer les profils 2364- Match quand deux personnes se likent mutuellement 2365- Chat privé entre les matchs 2366- Ãvénements : soirées, activités organisées par la communauté 2367- Favoris : sauvegarder des profils pour plus tard 2368 2369ð SÃCURITà : 2370- Vérification d'identité par selfie 2371- Signalement des profils inappropriés 2372- Blocage d'utilisateurs 2373- Modération active par l'équipe 2374 2375ð BOUTIQUE : 2376- Packs de Meetips 2377- Abonnement Premium 2378- Cadeaux virtuels 2379 2380âï¸ PARAMÃTRES : 2381- Notifications (push, email, SMS) 2382- Langue 2383- Mode jour/nuit 2384- Gestion de l'abonnement 2385- Suppression de compte 2386 2387ð± NAVIGATION : 2388- Page d'accueil avec les matchs 2389- Messagerie pour discuter 2390- Ãvénements pour participer aux soirées 2391- Profil pour modifier ses infos 2392- Paramètres pour les réglages 2393 2394RÃGLES DE RÃPONSE : 23951. Sois concise (2-4 phrases max sauf question complexe) 23962. Sois chaleureuse et utilise des emojis avec parcimonie (1-2 max) 23973. Si tu ne connais PAS la réponse ou si la question nécessite une intervention humaine (problème de paiement, bug technique, suppression de données, plainte), dis clairement : "Pour cette question, je te recommande de contacter notre équipe directement. Clique sur 'Contacter le support' en bas de la page ð" 23984. Ne fais JAMAIS de listes longues, reste naturelle 23995. Tu tutoies toujours 24006. Tu ne donnes JAMAIS d'informations personnelles sur d'autres utilisateurs 24017. Pour les problèmes de compte (mot de passe oublié, etc.) â guide-les étape par étape 24028. Tu es un assistant IA, tu peux le dire si on te le demande 2403 2404EMAIL DE CONTACT : [email protected]`,h1=()=>{var $;const e=Lt(),r=si(),{profile:i}=gr(),{currentMode:n}=dr(),o=m.useRef(null),a=m.useRef(null),[l,d]=m.useState([{role:"bot",content:`Salut${i!=null&&i.name?` ${i.name}`:""} ! ð Je suis Lia, l'assistante de MEETapps. Comment je peux t'aider aujourd'hui ?`}]),[p,u]=m.useState(""),[g,h]=m.useState(!1),[x,y]=m.useState(!1),[_,S]=m.useState(""),[k,w]=m.useState(""),[b,j]=m.useState(!1),[T,P]=m.useState(!1),I=[{label:t.jsxs(t.Fragment,{children:[t.jsx(Jt,{size:14})," Les Meetips"]}),question:"C'est quoi les Meetips et comment ça marche ?"},{label:"â Premium",question:"Qu'est-ce que l'abonnement Premium inclut ?"},{label:"ð¸ Vérification",question:"Comment vérifier mon profil ?"},{label:"ð Sécurité",question:"Comment signaler ou bloquer quelqu'un ?"}];m.useEffect(()=>{var B;(B=o.current)==null||B.scrollIntoView({behavior:"smooth"})},[l]);const R=async B=>{var te,K,ne,Re,Q;if(!B.trim()||g)return;const ee=B.trim();u(""),d(G=>[...G,{role:"user",content:ee}]),h(!0);try{const G=l.map(X=>({role:X.role==="bot"?"model":"user",parts:[{text:X.content}]}
2404));G.push({role:"user",parts:[{text:ee}]});const le={systemPrompt:TP,contents:G,generationConfig:{temperature:.7,topP:.9,maxOutputTokens:500},safetySettings:[{category:"HARM_CATEGORY_HARASSMENT",threshold:"BLOCK_NONE"},{category:"HARM_CATEGORY_HATE_SPEECH",threshold:"BLOCK_NONE"},{category:"HARM_CATEGORY_SEXUALLY_EXPLICIT",threshold:"BLOCK_NONE"},{category:"HARM_CATEGORY_DANGEROUS_CONTENT",threshold:"BLOCK_NONE"}]},{data:{session:F}}=await D.auth.getSession(),A="https://bqfzljnhxblhiabyvpqm.supabase.co",M="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4",V=await fetch(`${A}/functions/v1/gemini-proxy`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${(F==null?void 0:F.access_token)||M}`,apikey:M},body:JSON.stringify(le)});if(!V.ok)throw new Error(`API error: ${V.status}`);const H=V.body.getReader(),N=new TextDecoder;let Z="",ae="";for(d(X=>[...X,{role:"bot",content:""}]);;){const{done:X,value:he}=await H.read();if(X)break;ae+=N.decode(he,{stream:!0});const Ae=ae.split(` 2405`);ae=Ae.pop()||"";for(const ze of Ae){if(!ze.startsWith("data: "))continue;const ue=ze.slice(6).trim();if(!(!ue||ue==="[DONE]"))try{const xe=JSON.parse(ue),ke=(Q=(Re=(ne=(K=(te=xe==null?void 0:xe.candidates)==null?void 0:te[0])==null?void 0:K.content)==null?void 0:ne.parts)==null?void 0:Re[0])==null?void 0:Q.text;ke&&(Z+=ke,d(Pe=>{const Ce=[...Pe];return Ce[Ce.length-1]={role:"bot",content:Z},Ce}))}catch{}}}Z||d(X=>{const he=[...X];return he[he.length-1]={role:"bot",content:"Hmm, je n'ai pas pu répondre. Essaie de reformuler ta question ð"},he})}catch(G){console.error("Help AI error:",G),d(le=>[...le,{role:"bot",content:"Oups, un petit souci technique de mon côté ð Tu peux réessayer ou contacter directement notre équipe via le bouton en bas !"}])}finally{h(!1)}},O=async B=>{if(B.preventDefault(),!!k.trim()){j(!0);try{const{data:{user:ee}}=await D.auth.getUser(),te={user_id:(ee==null?void 0:ee.id)||null,user_name:(i==null?void 0:i.name)||"Anonyme",user_email:(i==null?void 0:i.email)||(ee==null?void 0:ee.email)||"non renseigné",subject:_||"Demande d'aide",message:k.trim(),status:"open"},{error:K}=await D.from("support_tickets").insert([te]);K&&(console.error("DB insert error:",K),r.error("Erreur BDD: "+K.message));const ne=` 2406 <div style="font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; max-width: 600px; margin: 0 auto; background: #0a0a12; padding: 32px; border-radius: 16px;"> 2407 <h2 style="color: #f43f5e; margin-bottom: 24px;">ð© Nouvelle demande de support</h2> 2408 <div style="background: rgba(255,255,255,0.05); border-radius: 12px; padding: 20px; margin-bottom: 16px;"> 2409 <p style="color: #aaa; margin: 0 0 8px 0; font-size: 13px;">Utilisateur</p> 2410 <p style="color: white; margin: 0; font-size: 16px; font-weight: 600;">${(i==null?void 0:i.name)||"Anonyme"} (${(i==null?void 0:i.email)||"non renseigné"})</p> 2411 </div> 2412 <div style="background: rgba(255,255,255,0.05); border-radius: 12px; padding: 20px; margin-bottom: 16px;"> 2413 <p style="color: #aaa; margin: 0 0 8px 0; font-size: 13px;">Sujet</p> 2414 <p style="color: white; margin: 0; font-size: 16px;">${_||"Demande d'aide"}</p> 2415 </div> 2416 <div style="background: rgba(255,255,255,0.05); border-radius: 12px; padding: 20px;"> 2417 <p style="color: #aaa; margin: 0 0 8px 0; font-size: 13px;">Message</p> 2418 <p style="color: white; margin: 0; font-size: 15px; line-height: 1.6; white-space: pre-wrap;">${k.trim()}</p> 2419 </div> 2420 </div> 2421 `;await ci({toEmail:"[email protected]",subject:`[Support] ${_||"Demande d'aide"} â ${(i==null?void 0:i.name)||"Utilisateur"}`,html:ne}),P(!0),r.success("Message envoyé ! Notre équipe te répondra bientôt ð")}catch(ee){console.error("Ticket send error:",ee),r.error("Erreur lors de l'envoi. Réessaie dans quelques instants.")}finally{j(!1)}}},E=n==="erox"?"#ef4444":n==="friend"?"#10b981":"#f43f5e";return t.jsxs("div",{style:{minHeight:"100vh",background:"var(--bg-deep, #0a0a12)",display:"flex",flexDirection:"column",fontFamily:"'Inter', 'Outfit', sans-serif",color:"white"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"14px",padding:"16px 20px",borderBottom:"1px solid rgba(255,255,255,0.06)",background:"rgba(0,0,0,0.3)",backdropFilter:"blur(20px)",position:"sticky",top:0,zIndex:10},children:[t.jsx("button",{onClick:()=>e(-1),style:{background:"rgba(255,255,255,0.08)",border:"none",borderRadius:"12px",padding:"10px",cursor:"pointer",color:"white",display:"flex"},children:t.jsx(Hr,{size:20})}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flex:1},children:[t.jsx("div",{style:{width:"38px",height:"38px",borderRadius:"12px",background:`linear-gradient(135deg, ${E}, ${E}80)`,display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(op,{size:20,color:"white"})}),t.jsxs("div",{children:[t.jsx("h1",{style:{margin:0,fontSize:"1.1rem",fontFamily:"Outfit",fontWeight:"700"},children:"Centre d'Aide"}),t.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"rgba(255,255,255,0.4)"},children:"Lia â Assistante IA"})]})]})]}),t.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"20px",display:"flex",flexDirection:"column",gap:"16px"},children:[l.length<=1&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",justifyContent:"center",marginBottom:"8px"},children:I.map((B,ee)=>t.jsx("button",{onClick:()=>{mr(),R(B.question)},style:{padding:"8px 14px",borderRadius:"20px",background:`${E}15`,border:`1px solid ${E}30`,color:E,cursor:"pointer",fontSize:"0.82rem",fontWeight:"600",transition:"all 0.2s"},onMouseEnter:te=>{te.currentTarget.style.background=`${E}25`},onMouseLeave:te=>{te.currentTarget.style.background=`${E}15`},children:B.label},ee))}),l.map((B,ee)=>t.jsxs("div",{style:{display:"flex",gap:"10px",justifyContent:B.role==="user"?"flex-end":"flex-start",animation:"fadeSlideUp 0.3s ease-out"},children:[B.role==="bot"&&t.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"10px",flexShrink:0,background:`linear-gradient(135deg, ${E}, ${E}60)`,display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(Kn,{size:16,color:"white"})}),t.jsx("div",{style:{maxWidth:"80%",padding:"12px 16px",borderRadius:"16px",background:B.role==="user"?`linear-gradient(135deg, ${E}, ${E}cc)`:"rgba(255,255,255,0.06)",border:B.role==="user"?"none":"1px solid rgba(255,255,255,0.08)",fontSize:"0.9rem",lineHeight:"1.5",color:B.role==="user"?"white":"rgba(255,255,255,0.9)",borderTopRightRadius:B.role==="user"?"4px":"16px",borderTopLeftRadius:B.role==="bot"?"4px":"16px",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:B.content}),B.role==="user"&&t.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"10px",flexShrink:0,background:"rgba(255,255,255,0.1)",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},children:i!=null&&i.photo||i!=null&&i.avatar_url?t.jsx("img",{src:i.photo||i.avatar_url,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}}):t.jsx(Ur,{size:16,color:"rgba(255,255,255,0.5)"})})]},ee)),g&&(($=l[l.length-1])==null?void 0:$.role)!=="bot"&&t.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center"},children:[t.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"10px",background:`linear-gradient(135deg, ${E}, ${E}60)`,display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(Kn,{size:16,color:"white"})}),t.jsx("div",{style:{padding:"12px 20px",borderRadius:"16px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.08)",display:"flex",gap:"6px"},children:[0,1,2].map(B=>t.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",background:E,opacity:.6,animation:`pulse 1.2s ${B*.2}s infinite`}},B))})]}),t.jsx("div",{ref:o})]}),!x&&t.jsx("div",{style:{padding:"0 20px 8px 20px"},children:t.jsxs("button",{onClick:()=>y(!0),style:{width:"100%",padding:"10px",borderRadius:"12px",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.5)",cursor:"pointer",fontSize:"0.82rem",fontWeight:"500",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s"},onMouseEnter:B=>{B.currentTarget.style.background="rgba(255,255,255,0.08)",B.currentTarget.style.color="rgba(255,255,255,0.8)"},onMouseLeave:B=>
2421{B.currentTarget.style.background="rgba(255,255,255,0.04)",B.currentTarget.style.color="rgba(255,255,255,0.5)"},children:[t.jsx(Vr,{size:15})," Contacter le support humain"]})}),x&&t.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",backdropFilter:"blur(8px)",zIndex:100,display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},children:t.jsxs("div",{style:{background:"#12121f",borderRadius:"24px",border:"1px solid rgba(255,255,255,0.08)",padding:"28px",width:"100%",maxWidth:"460px",position:"relative",animation:"fadeSlideUp 0.3s ease-out"},children:[t.jsx("button",{onClick:()=>{y(!1),P(!1)},style:{position:"absolute",top:"16px",right:"16px",background:"rgba(255,255,255,0.08)",border:"none",borderRadius:"10px",padding:"8px",cursor:"pointer",color:"white",display:"flex"},children:t.jsx(mt,{size:18})}),T?t.jsxs("div",{style:{textAlign:"center",padding:"20px 0"},children:[t.jsx(ms,{size:56,color:"#10b981",style:{marginBottom:"16px"}}),t.jsx("h3",{style:{fontFamily:"Outfit",fontSize:"1.3rem",marginBottom:"8px"},children:"Message envoyé !"}),t.jsxs("p",{style:{color:"rgba(255,255,255,0.5)",fontSize:"0.9rem",lineHeight:"1.5"},children:["Notre équipe te répondra à ",t.jsx("strong",{style:{color:"rgba(255,255,255,0.8)"},children:(i==null?void 0:i.email)||"ton email"})," dans les plus brefs délais."]})]}):t.jsxs("form",{onSubmit:O,children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[t.jsx("div",{style:{width:"44px",height:"44px",borderRadius:"14px",background:`linear-gradient(135deg, ${E}, ${E}60)`,display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(Vr,{size:22,color:"white"})}),t.jsxs("div",{children:[t.jsx("h3",{style:{margin:0,fontFamily:"Outfit",fontSize:"1.15rem"},children:"Contacter le support"}),t.jsx("p",{style:{margin:0,fontSize:"0.8rem",color:"rgba(255,255,255,0.4)"},children:"[email protected]"})]})]}),t.jsxs("div",{style:{marginBottom:"16px"},children:[t.jsx("label",{style:{display:"block",fontSize:"0.82rem",color:"rgba(255,255,255,0.5)",marginBottom:"6px",fontWeight:"600"},children:"Sujet"}),t.jsx("input",{type:"text",value:_,onChange:B=>S(B.target.value),placeholder:"Ex: Problème de connexion",style:{width:"100%",padding:"12px 14px",borderRadius:"12px",background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",color:"white",fontSize:"0.9rem",outline:"none",boxSizing:"border-box",transition:"border-color 0.2s"},onFocus:B=>B.target.style.borderColor=E,onBlur:B=>B.target.style.borderColor="rgba(255,255,255,0.1)"})]}),t.jsxs("div",{style:{marginBottom:"20px"},children:[t.jsx("label",{style:{display:"block",fontSize:"0.82rem",color:"rgba(255,255,255,0.5)",marginBottom:"6px",fontWeight:"600"},children:"Message *"}),t.jsx("textarea",{value:k,onChange:B=>w(B.target.value),placeholder:"Décris ton problème en détail...",rows:5,required:!0,style:{width:"100%",padding:"12px 14px",borderRadius:"12px",background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",color:"white",fontSize:"0.9rem",outline:"none",resize:"vertical",boxSizing:"border-box",lineHeight:"1.5",transition:"border-color 0.2s"},onFocus:B=>B.target.style.borderColor=E,onBlur:B=>B.target.style.borderColor="rgba(255,255,255,0.1)"})]}),t.jsx("button",{type:"submit",disabled:b||!k.trim(),style:{width:"100%",padding:"14px",borderRadius:"14px",background:b?"rgba(255,255,255,0.1)":`linear-gradient(135deg, ${E}, ${E}cc)`,border:"none",color:"white",cursor:b?"not-allowed":"pointer",fontWeight:"700",fontSize:"0.95rem",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s",opacity:k.trim()?1:.5},children:b?t.jsxs(t.Fragment,{children:[t.jsx(sx,{size:18,style:{animation:"spin 1s linear infinite"}})," Envoi..."]}):t.jsxs(t.Fragment,{children:[t.jsx(ji,{size:18})," Envoyer"]})})]})]})}),t.jsx("div",{style:{padding:"12px 20px 20px 20px",borderTop:"1px solid rgba(255,255,255,0.06)",background:"rgba(0,0,0,0.3)",backdropFilter:"blur(20px)"},children:t.jsxs("form",{onSubmit:B=>{B.preventDefault(),R(p)},style:{display:"flex",gap:"10px",alignItems:"center"},children:[t.jsx("input",{ref:a,type:"text",value:p,onChange:B=>u(B.target.value),placeholder:"Pose ta question...",disabled:g,style:{flex:1,padding:"14px 18px",borderRadius:"16px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"white",fontSize:"0.9rem",outline:"none",transition:"border-color 0.2s"},onFocus:B=>B.target.style.borderColor=E,onBlur:B=>B.target.style.borderColor="rgba(255,255,255,0.1)"}),t.jsx("button",{type:"submit",disabled:g||!p.trim(),style:{width:"48px",height:"48px",borderRadius:"14px",background:p.trim()?`linear-gradient(135deg, ${E}, ${E}cc)`:"rgba(255,255,255,0.06)",border:"none",cursor:p.trim()?"pointer":"default",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,color:"white"},children:t.jsx(ji,{size:20})})]})}),t.jsx("style",{children:` 2422 @keyframes fadeSlideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } } 2423 @keyframes pulse { 0%, 100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); } } 2424 @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } 2425 `})]})},g1={intro:[{id:"i1",text:"Pour commencer, qu'est-ce qui vous a le plus manqué dans vos relations passées ?"},{id:"i2",text:"Quelle est la première chose que vous remarquez chez quelqu'un ?"},{id:"i3",text:"Si vous deviez décrire votre vie amoureuse actuelle en un mot, lequel choisiriez-vous ?"}],childhood:[{id:"c1",text:"Parlons de vos racines. Comment décririez-vous l'ambiance affective de votre enfance ?"},{id:"c2",text:"Quel modèle de couple vos parents vous ont-ils transmis ?"},{id:"c3",text:"Enfant, vous sentiez-vous plutôt protégé(e) ou livré(e) à vous-même ?"},{id:"c4",text:"Quel est votre plus beau souvenir familial ?"}
2425],past:[{id:"p1",text:"Revenons à vos expériences. Quelle a été la cause principale de votre dernière rupture ?"},{id:"p2",text:"Avez-vous déjà eu l'impression de répéter le même schéma amoureux ? Si oui, lequel ?"},{id:"p3",text:"Quel est le plus grand sacrifice que vous ayez fait par amour ?"},{id:"p4",text:"Pensez-vous avoir totalement guéri de vos blessures passées ?"}],values:[{id:"v1",text:"La fidélité est-elle pour vous un concept absolu ou négociable ?"},{id:"v2",text:"Dans un couple, qu'est-ce qui est impardonnable à vos yeux ?"},{id:"v3",text:"Quelle place accordez-vous à la spiritualité ou aux croyances communes ?"}],lifestyle:[{id:"l1",text:"Projetons-nous. à quoi ressemble votre dimanche idéal en couple ?"},{id:"l2",text:"Comment gérez-vous l'argent au sein du couple ? Est-ce un sujet tabou ?"},{id:"l3",text:"Quelle importance accordez-vous à la réussite professionnelle de votre partenaire ?"}]},AP=()=>{const e=Lt(),[r,i]=m.useState([]),[n,o]=m.useState(""),[a,l]=m.useState(!1),[d,p]=m.useState(!1),[u,g]=m.useState(0),h=m.useRef(null),x=m.useRef(!1),y=m.useRef(new Set);m.useEffect(()=>{if(!x.current){x.current=!0,S("Bonjour. Je suis Eros, votre psychologue expert en relations amoureuses.",500),S("Nous allons procéder à une analyse approfondie en 15 étapes pour déconstruire vos mécanismes inconscients.",1500);const b=g1.intro[0];y.current.add(b.id),S(b.text,3e3)}},[]);const _=()=>{var b;(b=h.current)==null||b.scrollIntoView({behavior:"smooth"})};m.useEffect(()=>{_()},[r,a]);const S=(b,j=0)=>{setTimeout(()=>{l(!0),setTimeout(()=>{l(!1),i(T=>[...T,{id:Date.now(),text:b,sender:"bot"}])},1e3+b.length*15)},j)},k=b=>{if(b.preventDefault(),!n.trim())return;const j=n.trim();i(P=>[...P,{id:Date.now(),text:j,sender:"user"}]),o("");const T=u+1;g(T),w(j,T)},w=(b,j)=>{const T=b.toLowerCase();let P="";T.length>50?P="Je vois, c'est très détaillé. ":T.includes("je ne sais pas")?P="Prenez le temps d'y réfléchir. ":(T.includes("triste")||T.includes("pain")||T.includes("mal"))&&(P="Je sens une blessure encore vive. ");let I="intro";if(j>=3&&j<7?I="childhood":j>=7&&j<11?I="past":j>=11&&j<14?I="values":j>=14&&(I="lifestyle"),j<15){const R=g1[I].filter(E=>!y.current.has(E.id));let O;R.length>0?T.includes("père")||T.includes("mère")?O=R.find(E=>E.id==="c2")||R[0]:T.includes("argent")?O=R.find(E=>E.id==="l2")||R[0]:O=R[Math.floor(Math.random()*R.length)]:O={id:"generic",text:"Dites-m'en plus à ce sujet..."},O&&O.id!=="generic"&&y.current.add(O.id),setTimeout(()=>{S((P?P+" ":"")+O.text,500)},500)}else S("Merci. Cette plongée dans votre psychisme est terminée. J'ai rassemblé tous les éléments nécessaires.",500),setTimeout(()=>{p(!0),S("Voici votre Certification Eros : une cartographie précise de votre âme amoureuse.",500)},2500)};return t.jsxs("div",{style:{minHeight:"100vh",background:"var(--bg-deep)",display:"flex",flexDirection:"column"},children:[t.jsxs("header",{style:{padding:"20px",background:"rgba(10, 10, 20, 0.95)",borderBottom:"1px solid rgba(255,255,255,0.05)",display:"flex",alignItems:"center",justifyContent:"space-between",position:"sticky",top:0,zIndex:10},children:[t.jsx("button",{onClick:()=>e(-1),style:{background:"none",border:"none",color:"white",cursor:"pointer"},children:t.jsx(Hr,{size:24})}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[t.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"50%",background:"var(--gradient-gold)",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(Sn,{size:24,color:"black"})}),t.jsxs("div",{children:[t.jsx("h1",{style:{fontSize:"1.2rem",margin:0},children:"Eros Expert"}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx("span",{style:{fontSize:"0.8rem",color:"var(--text-muted)"},children:"Dr. IA en Psychologie"}),!d&&t.jsxs("div",{style:{fontSize:"0.7rem",color:"var(--gold)",border:"1px solid var(--gold)",padding:"2px 6px",borderRadius:"4px"},children:["Question ",Math.min(u+1,15)," / 15"]})]})]})]}),t.jsx("div",{style:{width:"24px"}})]}),t.jsxs("div",{className:"custom-scrollbar",style:{flex:1,padding:"20px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"20px",maxWidth:"800px",margin:"0 auto",width:"100%"},children:[r.map(b=>t.jsx(ye.div,{initial:{opacity:0,y:10}
2425,animate:{opacity:1,y:0},style:{alignSelf:b.sender==="user"?"flex-end":"flex-start",maxWidth:"80%"},children:t.jsx("div",{style:{padding:"15px 20px",borderRadius:"18px",background:b.sender==="user"?"var(--primary)":"rgba(255,255,255,0.05)",color:"white",borderBottomRightRadius:b.sender==="user"?"4px":"18px",borderBottomLeftRadius:b.sender==="bot"?"4px":"18px"},children:b.text})},b.id)),a&&t.jsx(ye.div,{initial:{opacity:0},animate:{opacity:1},style:{alignSelf:"flex-start",background:"rgba(255,255,255,0.05)",padding:"10px 20px",borderRadius:"18px"},children:t.jsx("span",{className:"typing-dots",children:"..."})}),d&&t.jsxs(ye.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},transition:{duration:.8},className:"print-section",style:{marginTop:"20px",padding:"40px",background:"white",color:"black",borderRadius:"10px",fontFamily:"serif",boxShadow:"0 0 50px rgba(255, 215, 0, 0.2)",position:"relative",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"10px",background:"var(--gradient-gold)"}}),t.jsxs("div",{style:{textAlign:"center",marginBottom:"30px"},children:[t.jsx(Sn,{size:40,color:"black",style:{marginBottom:"10px"}}),t.jsx("h2",{style:{fontSize:"2rem",fontFamily:"Outfit",textTransform:"uppercase",letterSpacing:"4px",margin:"0"},children:"Certification Eros"}),t.jsx("p",{style:{fontStyle:"italic",color:"#666"},children:"Profil Psychologique & Amoureux ⢠Analyse Complète"})]}),t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"30px",marginBottom:"30px",borderBottom:"1px solid #eee",paddingBottom:"30px"},children:[t.jsxs("div",{children:[t.jsx("h3",{style:{fontSize:"1rem",textTransform:"uppercase",color:"#888",marginBottom:"10px"},children:"Archétype Dominant"}),t.jsx("div",{style:{fontSize:"1.5rem",fontWeight:"bold",color:"#2c3e50"},children:"L'Idéaliste Anxieux"}),t.jsx("p",{style:{fontSize:"0.9rem",lineHeight:"1.6",marginTop:"10px"},children:"Votre structure émotionnelle révèle une tension entre un désir absolu de fusion et une peur archaïque de l'abandon. Cette dynamique crée une intensité passionnante mais épuisante."})]}),t.jsxs("div",{children:[t.jsx("h3",{style:{fontSize:"1rem",textTransform:"uppercase",color:"#888",marginBottom:"10px"},children:"Structure Inconsciente"}),t.jsxs("ul",{style:{fontSize:"0.95rem",lineHeight:"1.8",paddingLeft:"20px"},children:[t.jsxs("li",{children:["Besoin de validation externe : ",t.jsx("strong",{children:"Ãlevé"})]}),t.jsxs("li",{children:["Style d'attachement : ",t.jsx("strong",{children:"Préoccupé"})]}),t.jsxs("li",{children:["Mécanisme de défense : ",t.jsx("strong",{children:"Intellectualisation"})]})]})]})]}),t.jsxs("div",{style:{marginBottom:"30px"},children:[t.jsx("h3",{style:{fontSize:"1.2rem",fontWeight:"bold",marginBottom:"15px"},children:"Prescription Thérapeutique"}),t.jsx("div",{style:{background:"#f9f9f9",padding:"25px",borderRadius:"8px",borderLeft:"4px solid gold"},children:t.jsx("p",{style:{fontSize:"0.95rem",lineHeight:"1.6",margin:0,fontStyle:"italic"},children:`"Votre défi majeur est d'apprendre l'auto-apaisement. Vous cherchez chez l'autre une réparation de vos blessures d'enfance (probablement liées à une figure parentale distante). Pour votre prochaine relation, privilégiez un partenaire au profil 'Sécure' qui ne jouera pas au chat et à la souris. Fuyez l'ambiguïté qui, bien qu'excitante pour vous, est toxique."`})})]}),t.jsxs("div",{style:{textAlign:"center",fontSize:"0.8rem",color:"#999",marginTop:"40px"},children:["Analyse certifiée par l'IA Eros ⢠",new Date().toLocaleDateString()]})]}),t.jsx("div",{ref:h})]}),!d&&t.jsxs("form",{onSubmit:k,style:{padding:"20px",background:"rgba(0,0,0,0.3)",backdropFilter:"blur(10px)",display:"flex",gap:"10px"},children:[t.jsx("input",{type:"text",value:n,onChange:b=>o(b.target.value),placeholder:`Réponse ${u+1}/15...`,disabled:a,style:{flex:1,padding:"15px 25px",borderRadius:"30px",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(255,255,255,0.05)",color:"white",fontSize:"1rem"}}),t.jsx("button",{type:"submit",disabled:!n.trim()||a,style:{width:"50px",height:"50px",borderRadius:"50%",background:"var(--primary)",border:"none",color:"white",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",opacity:!n.trim()||a?.5:1},children:t.jsx(ji,{size:24})})]}),d&&t.jsxs("div",{style:{padding:"20px",background:"rgba(0,0,0,0.8)",display:"flex",gap:"15p
2425x",justifyContent:"center"},children:[t.jsxs("button",{onClick:()=>window.print(),className:"btn-primary",style:{display:"flex",alignItems:"center",gap:"10px",padding:"15px 30px"},children:[t.jsx(nx,{size:20})," Télécharger le PDF"]}),t.jsx("button",{onClick:()=>e("/matches"),className:"btn-secondary",style:{display:"flex",alignItems:"center",gap:"10px",padding:"15px 30px"},children:"Retour aux Matchs"})]}),t.jsx("style",{children:` 2426 @media print { 2427 body * { visibility: hidden; } 2428 .print-section, .print-section * { visibility: visible; } 2429 .print-section { position: absolute; left: 0; top: 0; width: 100%; margin: 0; padding: 40px; box-shadow: none !important; border: none !important; } 2430 } 2431 `})]})},PP=()=>{var nt;const e=si(),r=Lt(),{user:i,profile:n,refreshProfile:o}=gr(),{mode:a,isErox:l,isFriend:d}=dr(),[p,u]=m.useState([]),[g,h]=m.useState([]),[x,y]=m.useState(!1),[_,S]=m.useState(!1),[k,w]=m.useState(null),[b,j]=m.useState(null),[T,P]=m.useState([]),[I,R]=m.useState(!1),[O,E]=m.useState(!1),[$,B]=m.useState(!1),[ee,te]=m.useState(!1),[K,ne]=m.useState(null),[Re,Q]=m.useState(""),[G,le]=m.useState(""),[F,A]=m.useState(!1),[M,V]=m.useState([]),H=J=>V(Ie=>[...Ie,`${new Date().toLocaleTimeString()} - ${J}`]),N=xn();let Z=Fn,ae="tags",X="Modification de mes préférences";l?(Z=So,ae="erox_tags",X="Mes Désirs (EROX)"):d&&(Z=il,ae="friend_tags",X="Ma Vibe & Sorties (MeetFriend)");const he=l?"erox_name":d?"friend_name":"name";m.useEffect(()=>{if(n){const J=n[ae]||[];u(J);const Ie=n[he]||"";Q(Ie),le(Ie),h(J);let z=null;l?z=n.erox_avatar_url:d?z=n.friend_avatar_url:z=n.avatar_url||n.photo,j(z);let Y=[];l?Y=n.erox_photos||[]:d?Y=n.friend_photos||[]:Y=n.photos||[],Array.isArray(Y)&&P(Y)}},[ae,l,d,n]);const Ae=J=>{u(Ie=>Ie.includes(J)?Ie.filter(z=>z!==J):[...Ie,J])},ze=async()=>{y(!0);let J="";try{if(k&&await Ce(),i)try{const{error:z}=await D.auth.updateUser({data:ux({[ae]:void 0})});z&&console.warn("Auth Update Failed (ignored): "+z.message)}catch(z){console.warn("Auth Update Exception (ignored):",z)}else console.warn("EditCriteria: No active session. Saving to LocalStorage only.");const Ie=localStorage.getItem("userProfile");if(Ie){const Y={...JSON.parse(Ie),[ae]:p};localStorage.setItem("userProfile",JSON.stringify(Y))}try{const{data:z,error:Y}=await D.from("profiles").update({[ae]:p}).eq("id",i.id).select("id");Y?console.warn("Preference update failed:",Y.message):!z||z.length===0?console.warn("Preference update: 0 rows affected (RLS issue?)"):console.log("Preferences updated successfully")}catch(z){console.warn("Preference update exception:",z)}if(Re.trim())try{const{error:z}=await D.from("profiles").update({[he]:Re.trim()}).eq("id",i.id);z?console.warn(`Name update (${he}) failed:`,z.message):console.log(`Pseudo (${he}) updated to: ${Re.trim()}`)}catch(z){console.warn("Name update exception:",z)}o&&await o(),e.success("Préférences sauvegardées !"),r("/matches")}catch(Ie){if(console.error("Error saving tags:",Ie),Ie.message&&Ie.message.includes("Failed to fetch")){o&&await o(),r("/matches");return}alert("Erreur lors de la sauvegarde : "+(Ie.message||J||"Erreur inconnue"))}finally{y(!1)}},[ue,xe]=m.useState(null),ke=J=>new Promise(Ie=>{const z=new FileReader;z.readAsDataURL(J),z.onload=Y=>{const ce=new Image;ce.src=Y.target.result,ce.onload=()=>{const ve=document.createElement("canvas"),pe=300,$e=300;let Xe=ce.width,tt=ce.height;Xe>tt?Xe>pe&&(tt*=pe/Xe,Xe=pe):tt>$e&&(Xe*=$e/tt,tt=$e),ve.width=Xe,ve.height=tt,ve.getContext("2d").drawImage(ce,0,0,Xe,tt);const at=ve.toDataURL("image/jpeg",.6);Ie(at)}}}),Pe=async J=>{const Ie=J.target.files[0];if(Ie){xe(Ie);try{const z=await ke(Ie);w(z)}catch(z){console.error("Compression failed",z)}}},Ce=async()=>{R(!0),H("Starting photo save...");try{const J=localStorage.getItem("appMode");let Ie="avatar_url";J==="EROX"?Ie="erox_avatar_url":J==="FRIEND"&&(Ie="friend_avatar_url"),H(`Mode: ${J}, Target: ${Ie}`);const z=k||b;if(!z){H("No photo to save.");return}let Y=z;if(z.startsWith("data:")){H("Uploading to Storage...");try{const Xe=await(await fetch(z)).blob();let tt="avatar";Ie==="erox_avatar_url"?tt="erox_avatar_url":Ie==="friend_avatar_url"&&(tt="friend_avatar_url");const gt=`${i.id}/${tt}_fixed.jpg`,{error:at}=await D.storage.from("avatars").upload(gt,Xe,{upsert:!0});if(at)console.error("Storage upload failed:",at),H(`Storage error: ${at.message}`);else{const{data:Pt}=D.storage.from("avatars").getPublicUrl(gt);
2431Y=Pt.publicUrl+"?t="+Date.now(),H("Storage upload OK â URL saved.")}}catch($e){console.error("Storage upload exception:",$e),H(`Storage exception: ${$e.message}`)}}H(`Saving to DB (${Ie})...`);const ce={[Ie]:Y};Ie==="avatar_url"&&(ce.animated_photo_url=null,ce.photo=Y);const{error:ve}=await D.from("profiles").update(ce).eq("id",i.id);if(ve){console.warn("DB update failed, retrying:",ve.message);const{error:$e}=await D.from("profiles").update(ce).eq("id",i.id);if($e)throw new Error(`Sauvegarde échouée : ${$e.message}`)}try{await D.auth.updateUser({data:ux({})})}catch($e){console.warn("Auth metadata update failed (non-blocking):",$e)}Ie==="avatar_url"&&localStorage.setItem(`localAvatar_${i.id}`,Y);const pe=JSON.parse(localStorage.getItem("userProfile")||"{}");pe[Ie]=Y,localStorage.setItem("userProfile",JSON.stringify(pe)),await o(),e.success("Photo enregistrée avec succès !"),w(null)}catch(J){console.error("Error finalizing photo:",J),H(`ERROR: ${J.message}`),e.error("Erreur : "+J.message)}finally{R(!1)}},Me=async(J,Ie)=>{const z=J.target.files[0];if(z){E(!0);try{const Y=await ke(z),ce=[...T];ce[Ie]=Y;const ve=ce.filter(Boolean);console.log("Uploading gallery item...");let pe="photos";l?pe="erox_photos":d&&(pe="friend_photos");const{error:$e}=await D.rpc("save_gallery_asset",{target_column:pe,new_images:ve});if($e){console.error("Gallery RPC Update Failed:",$e),alert("Erreur sauvegarde galerie (RPC): "+$e.message),E(!1);return}console.log("Gallery RPC Update Success. Refreshing..."),await o(),E(!1)}catch(Y){console.error("Gallery upload error:",Y),alert("Erreur upload galerie: "+(Y.message||"Erreur inconnue")),E(!1)}}},Le=async J=>{if(confirm("Supprimer cette photo ?")){E(!0);try{const Ie=T.filter((ce,ve)=>ve!==J);let z="photos";l?z="erox_photos":d&&(z="friend_photos");const{error:Y}=await D.rpc("save_gallery_asset",{target_column:z,new_images:Ie});if(Y)throw Y;console.log("Gallery Delete Success. Refreshing..."),await o(),E(!1)}catch(Ie){console.error("Delete error",Ie),alert("Erreur suppression: "+Ie.message),E(!1)}}},ft=(i==null?void 0:i.is_premium)||(()=>{const J=localStorage.getItem("userProfile");return J?JSON.parse(J).is_premium:!1})(),De=()=>{u(g)};if(_&&k)return t.jsx(h0,{imageSrc:k,onClose:()=>S(!1),onSave:J=>{w(J),S(!1)}});const Be=l?"Erox":d?"Friend":"Eros",re=l?"ð¥":d?"ð¥":"â¨",He=l?"#ff4d4d":d?"#26A69A":"#D4A574",be=l?{accent:"#ff4d4d",accentSoft:"#ff6b6b",headerBg:"linear-gradient(90deg, #1a0505 0%, #330000 100%)",panelBorder:"rgba(255,60,60,0.15)",panelBg:"rgba(255,40,40,0.03)",tabActive:"rgba(255,77,77,0.14)",tabBorder:"rgba(255,77,77,0.35)",tabInactive:"rgba(255,40,40,0.05)",tabInactiveBorder:"rgba(255,60,60,0.12)",textSoft:"rgba(255,120,120,0.5)",saveBg:"linear-gradient(45deg, #ff0000, #990000)",saveColor:"white",floatBg:"rgba(30, 0, 0, 0.95)",floatBorder:"rgba(255, 0, 0, 0.3)",galleryBorder:"rgba(255,77,77,0.2)",lockColor:"#ff6b6b"}:d?{accent:"#26A69A",accentSoft:"#4DB6AC",headerBg:"linear-gradient(90deg, #0A0F1C 0%, #004D40 100%)",panelBorder:"rgba(38,166,154,0.15)",panelBg:"rgba(38,166,154,0.03)",tabActive:"rgba(38,166,154,0.14)",tabBorder:"rgba(38,166,154,0.35)",tabInactive:"rgba(38,166,154,0.05)",tabInactiveBorder:"rgba(38,166,154,0.12)",textSoft:"rgba(77,182,172,0.5)",saveBg:"linear-gradient(135deg, #26A69A 0%, #00695C 100%)",saveColor:"white",floatBg:"rgba(10, 15, 28, 0.95)",floatBorder:"rgba(38, 166, 154, 0.3)",galleryBorder:"rgba(38,166,154,0.2)",lockColor:"#4DB6AC"}:{accent:"#D4A574",accentSoft:"#E8C9A0",headerBg:"linear-gradient(90deg, rgba(35,25,15,0.95) 0%, rgba(50,35,20,0.9) 100%)",panelBorder:"rgba(212,165,116,0.18)",panelBg:"rgba(212,165,116,0.04)",tabActive:"rgba(212,165,116,0.14)",tabBorder:"rgba(212,165,116,0.35)",tabInactive:"rgba(212,165,116,0.04)",tabInactiveBorder:"rgba(212,165,116,0.12)",textSoft:"rgba(232,201,160,0.5)",saveBg:"linear-gradient(135deg, #D4A574, #B8885A)",saveColor:"#1a1208",floatBg:"rgba(35, 25, 15, 0.95)",floatBorder:"rgba(212,165,116,0.3)",galleryBorder:"rgba(212,165,116,0.2)",lockColor:"#D4A574"};return t.jsxs("div",{style:{minHeight:"100vh",background:"var(--bg-deep)",paddingBottom:"140px",display:"flex",flexDirection:"column"},children:[t.jsxs("div",{className:"glass",style:{padding:N?"15px":"20px",position:"sticky",top:0,zIndex:100,display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid rgba(255,255,255,0.05)",background:be.headerBg},children:[t.jsxs("button",{onClick:()=>r("/matches"),style:{background:"none",border:"none",color:"white",cursor:"pointer",display:"flex",alignItems:"center",gap:"5px"},children:[t.jsx(Hr,{size:24})," ",N?"":"Retour"]}
2431),t.jsx("h2",{style:{fontSize:N?"1rem":"1.2rem",fontFamily:"Outfit",margin:0,color:be.accent,textAlign:"center",flex:1},children:X}),t.jsx("div",{style:{width:"24px"}})," "]}),t.jsxs("div",{style:{padding:N?"15px":"20px",maxWidth:"800px",margin:"0 auto",width:"100%"},children:[t.jsxs("div",{className:"glass-panel",style:{padding:N?"18px":"28px",borderRadius:"20px",marginBottom:"30px",border:`1px solid ${be.panelBorder}`,background:be.panelBg},children:[t.jsxs("h2",{style:{fontSize:"1.3rem",fontWeight:"800",marginBottom:"6px",fontFamily:"Outfit",textAlign:"center",color:He},children:[re," Photo pour MEET",Be]}),t.jsxs("p",{style:{color:"rgba(255,255,255,0.5)",fontSize:"0.82rem",textAlign:"center",margin:"0 0 20px"},children:["Modifiez votre photo de profil pour l'espace ",t.jsx("strong",{style:{color:He},children:Be}),". Cette photo sera visible uniquement dans cet espace."]}),t.jsxs("div",{style:{marginBottom:"20px",padding:"16px 18px",borderRadius:"16px",background:`linear-gradient(135deg, rgba(255,255,255,0.03), ${He}08)`,border:`1px solid ${He}25`},children:[t.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px",fontSize:"0.92rem",fontWeight:"700",color:"white"},children:[re," Pseudo pour MEET",Be]}),t.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center"},children:[t.jsx("input",{type:"text",value:Re,onChange:J=>Q(J.target.value),placeholder:(n==null?void 0:n.name)||`Ex: Mon pseudo ${Be}...`,maxLength:30,style:{flex:1,padding:"12px 16px",borderRadius:"12px",background:"rgba(255,255,255,0.06)",border:`1.5px solid ${He}40`,color:"white",fontSize:"0.95rem",fontFamily:"Outfit",outline:"none",transition:"border-color 0.2s"},onFocus:J=>J.target.style.borderColor=He,onBlur:J=>J.target.style.borderColor=`${He}40`}),t.jsxs("span",{style:{color:"rgba(255,255,255,0.3)",fontSize:"0.7rem",flexShrink:0},children:[Re.length,"/30"]}),Re.trim()&&Re!==G&&t.jsx("button",{onClick:async()=>{if(!(!(i!=null&&i.id)||F)){A(!0);try{const{error:J}=await D.from("profiles").update({[he]:Re.trim()}).eq("id",i.id);J?e.error("Erreur: "+J.message):(e.success(`Pseudo ${Be} sauvegardé !`),le(Re.trim()),o&&await o())}catch{e.error("Erreur réseau")}finally{A(!1)}}},disabled:F,style:{background:He,color:"white",border:"none",borderRadius:"10px",padding:"10px 16px",cursor:"pointer",fontWeight:"700",fontSize:"0.85rem",flexShrink:0,opacity:F?.6:1,transition:"opacity 0.2s"},children:F?"...":"Valider"})]}),t.jsxs("p",{style:{color:"rgba(255,255,255,0.45)",fontSize:"0.75rem",margin:"8px 0 0",lineHeight:1.5},children:["ð¡ Ce pseudo sera affiché ",t.jsxs("strong",{style:{color:He},children:["uniquement dans l'espace ",Be]}),". Si vous ne le modifiez pas, votre prénom sera utilisé par défaut."]})]}),t.jsxs("div",{style:{display:"flex",gap:"20px",flexDirection:N?"column":"row",alignItems:N?"center":"flex-start"},children:[t.jsx("input",{id:"photo-upload-inline",type:"file",accept:"image/*",onChange:Pe,style:{display:"none"}}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"12px",flexShrink:0},children:[t.jsxs("div",{style:{position:"relative"},children:[!l&&!d&&(n!=null&&n.animated_photo_url)&&!k?t.jsx("video",{src:n.animated_photo_url,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,style:{width:"160px",height:"160px",borderRadius:"20px",objectFit:"cover",border:"3px solid #8b5cf6",boxShadow:"0 8px 30px rgba(139,92,246,0.3)"}}):k||b?(()=>{const J=k||b;return J&&(J.includes("video_selfie")||J.match(/\.(webm|mp4)(\?|$)/i))?t.jsx("video",{src:J,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,style:{width:"160px",height:"160px",borderRadius:"20px",objectFit:"cover",border:`3px solid ${l?"#ff4d4d":d?"#26A69A":"var(--gold, #FFD700)"}`,boxShadow:"0 8px 30px rgba(0,0,0,0.4)"}}):t.jsx("img",{src:J,alt:"Photo de profil",style:{width:"160px",height:"160px",borderRadius:"20px",objectFit:"cover",border:`3px solid ${l?"#ff4d4d":d?"#26A69A":"var(--gold, #FFD700)"}`,boxShadow:"0 8px 30px rgba(0,0,0,0.4)"}})})():t.jsxs("div",{onClick:()=>{var J;return(J=document.getElementById("photo-upload-inline"))==null?void 0:J.click()},style:{width:"160px",height:"160px",borderRadius:"20px",border:`3px dashed ${l?"#ff4d4d60":d?"#26A69A60":"rgba(255,215,0,0.35)"}`,background:"rgba(255,255,255,0.03)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10px",cursor:"pointer",transition:"all 0.3s"},children:[t.jsx(pi,{size:36,color:l?"#ff4d4d80":d?"#26A69A80":"rgba(255,215,0,0.45)"}),t.jsx("span",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.5)",textAlign:"center",lineHeight:1.3,padding:"0 10px"},children:"Appuyez pour ajouter une photo"})]}),k&&t.jsx("div",{style:{position:"absolute",bottom:"-6px",right:"-6px",background:"#10b981",borderRadius:"50%",padding:"6px",border:"2px s
2431olid var(--bg-deep, #111)"},children:t.jsx(pr,{size:14,color:"white"})}),(n==null?void 0:n.animated_photo_url)&&!k&&t.jsx("div",{style:{position:"absolute",top:"-6px",right:"-6px",background:"linear-gradient(135deg, #8b5cf6, #ec4899)",borderRadius:"10px",padding:"3px 8px",fontSize:"0.6rem",fontWeight:700,color:"white",boxShadow:"0 2px 8px rgba(139,92,246,0.4)"},children:"⨠ANIMÃE"})]}),(n==null?void 0:n.animated_photo_url)&&!k&&b&&t.jsx("div",{style:{width:"48px",height:"48px",borderRadius:"50%",overflow:"hidden",border:`2px solid ${l?"#ff4d4d":d?"#26A69A":"var(--gold, #FFD700)"}`,opacity:.7},children:t.jsx("img",{src:b,alt:"Photo statique",style:{width:"100%",height:"100%",objectFit:"cover"}})})]}),t.jsxs("div",{style:{flex:1,width:N?"100%":"auto",display:"flex",flexDirection:"column",gap:"8px"},children:[t.jsxs("div",{onClick:()=>ne(K==="change"?null:"change"),style:{background:K==="change"?be.tabActive:be.tabInactive,border:K==="change"?`1px solid ${be.tabBorder}`:`1px solid ${be.tabInactiveBorder}`,borderRadius:"14px",padding:"12px 16px",cursor:"pointer",transition:"all 0.2s"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(pi,{size:18,color:be.accent}),t.jsx("span",{style:{fontWeight:"700",fontSize:"0.92rem",color:"white"},children:"Changer ma photo"})]}),K==="change"&&t.jsxs("div",{style:{marginTop:"10px"},onClick:J=>J.stopPropagation(),children:[t.jsx("p",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",margin:"0 0 10px"},children:"Téléchargez une nouvelle photo depuis votre galerie. Choisissez un portrait net et bien éclairé."}),t.jsxs("label",{htmlFor:"photo-upload-inline",style:{display:"inline-flex",alignItems:"center",gap:"8px",background:`${be.accent}25`,border:`1px solid ${be.accent}55`,color:"white",padding:"10px 20px",borderRadius:"25px",cursor:"pointer",fontSize:"0.88rem",fontWeight:"600"},children:[t.jsx(Sp,{size:16})," Choisir une photo"]})]})]}),t.jsxs("div",{onClick:()=>{(k||b)&&ne(K==="studio"?null:"studio")},style:{background:K==="studio"?be.tabActive:be.tabInactive,border:K==="studio"?`1px solid ${be.tabBorder}`:`1px solid ${be.tabInactiveBorder}`,borderRadius:"14px",padding:"12px 16px",cursor:k||b?"pointer":"not-allowed",opacity:k||b?1:.4,transition:"all 0.2s"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(sp,{size:18,color:be.accentSoft}),t.jsx("span",{style:{fontWeight:"700",fontSize:"0.92rem",color:"white"},children:"Studio Photo"}),t.jsx("span",{style:{fontSize:"0.65rem",background:`${be.accent}25`,color:be.accentSoft,padding:"2px 8px",borderRadius:"8px",fontWeight:"600"},children:"GRATUIT"})]}),K==="studio"&&t.jsxs("div",{style:{marginTop:"10px"},onClick:J=>J.stopPropagation(),children:[t.jsx("p",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",margin:"0 0 10px"},children:"Retouchez votre photo avec des filtres, du cadrage et des ajustements de luminosité pour un rendu professionnel."}),t.jsxs("button",{onClick:J=>{J.stopPropagation(),S(!0)},style:{background:`${be.accent}25`,border:`1px solid ${be.accent}55`,color:"white",padding:"10px 20px",borderRadius:"25px",cursor:"pointer",fontSize:"0.88rem",fontWeight:"600",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(sp,{size:16})," Ouvrir le Studio"]})]})]}),t.jsxs("div",{onClick:()=>{b&&ne(K==="animate"?null:"animate")},style:{background:K==="animate"?be.tabActive:be.tabInactive,border:K==="animate"?`1px solid ${be.tabBorder}`:`1px solid ${be.tabInactiveBorder}`,borderRadius:"14px",padding:"12px 16px",cursor:b?"pointer":"not-allowed",opacity:b?1:.4,transition:"all 0.2s"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(Xt,{size:18,color:be.accentSoft}),t.jsx("span",{style:{fontWeight:"700",fontSize:"0.92rem",color:"white"},children:"Animer avec l'IA"}),t.jsxs("span",{style:{fontSize:"0.65rem",background:`${be.accent}30`,color:be.accentSoft,padding:"2px 8px",borderRadius:"8px",fontWeight:"700"},children:["8 ",t.jsx(Jt,{size:12})]})]}),K==="animate"&&t.jsxs("div",{style:{marginTop:"10px"},onClick:J=>J.stopPropagation(),children:[t.jsxs("p",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",margin:"0 0 10px"},children:["L'intelligence artificielle anime votre photo statique en une courte vidéo vivante. Votre profil attire ",t.jsx("strong",{style:{color:"#c084fc"},children:"3x plus d'attention"})," avec une photo animée !"]}),t.jsxs("button",{onClick:J=>{J.stopPropagation(),B(!0)},style:{background:`${be.accent}30`,border:`1px solid ${be.accent}55`,color:"white",padding:"10px 20px",borderRadius:"25px",cursor:"pointer",fontSize:"0.88rem",fontWeight:"600",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(Xt,{size:16})," ",n!=null&&n.animated_photo_url?"Gérer l'animation":"Animer ma photo"]})]})]}),t.jsxs("div",{onClick:()=>ne(K==="video"?null:"video"),style:{background:K==="video"?be.tabActive:be.tabInactive,border:K==="video"?`1px solid ${be.tabBorder}`:`1px solid ${be.tabInactiveBorder}`,borderRadius:"14px",padding:"12px 16px",cursor:"pointer",transition:"all 0.2s"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(ia,{size:18,color:be.accentSoft}),t.jsx("span",{style:{fontWeight:"700",fontSize:"0.92rem",color:"white"},children:"Video Selfie"}),t.jsx("span",{style:{fontSize:"0.65rem",background:`${be.accent}25`,color:be.accentSoft,padding:"2px 8px",borderRadius:"8px",fontWeight:"600"},children:"GRATUIT"})]}),K==="video"&&t.jsxs("div",{style:{marginTop:"10px"},onClick:J=>J.stopPropagation(),children:[t.jsxs("p",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",margin:"0 0 10px"},children:["Prenez un selfie vidéo de ",t.jsx("strong",{style:{color:"#f472b6"},children:"3 secondes"})," directement avec votre caméra. Plus authentique qu'une simple photo, c'est le format le plus engageant !"]}),t.jsxs("button",{onClick:J=>{J.stopPropagation(),te(!0)},style:{background:`${be.accent}25`,border:`1px solid ${be.accent}55`,color:"white",padding:"10px 20px",borderRadius:"25px",cursor:"pointer",fontSize:"0.88rem",fontWeight:"600",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(ia,{size:16})," Lancer la caméra"]})]})]})]})]}),b&&t.jsxs("div",{style:{marginTop:"18px",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",padding:"10px 16px",borderRadius:"12px",background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.06)"},children:[t.jsx(al,{size:16,color:"rgba(255,255,255,0.4)"}),t.jsx("span",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.6)"},children:"Mode Discret (Flouter ma photo)"})]}),k&&t.jsx("button",{onClick:Ce,disabled:I,style:{marginTop:"16px",width:"100%",background:be.saveBg,color:be.saveColor,border:"none",padding:"14px",borderRadius:"14px",cursor:"pointer",fontSize:"1rem",fontWeight:"700",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:I?"Sauvegarde...":"â
Valider cette photo"})]}),t.jsxs("div",{className:"glass-panel",style:{padding:N?"18px":"28px",borderRadius:"20px",marginBottom:"30px",border:`1px solid ${be.panelBorder}`,background:be.panelBg},children:[t.jsxs("h3",{style:{fontSize:"1rem",fontWeight:"700",marginBottom:"4px",display:"flex",alignItems:"center",gap:"8px",color:be.accentSoft},children:["â Galerie Photo ",t.jsx("span",{style:{fontSize:"0.75rem",color:be.textSoft,fontWeight:"400"},children:"(Gratuit 3 Photos)"})]}),t.jsx("p",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.4)",margin:"0 0 16px"},children:"Ajoutez jusqu'Ã 3 photos. Passez Premium pour en avoir 5 !"}),t.jsx("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap"},children:[0,1,2,3,4].map(J=>{const Ie=!ft&&J>=3,z=T[J];return Ie?t.jsxs("div",{style:{width:"80px",height:"80px",borderRadius:"14px",background:"rgba(0,0,0,0.3)",border:`1px dashed ${be.galleryB
2431order}`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"not-allowed",gap:"4px"},children:[t.jsx(Fr,{size:16,color:be.lockColor}),t.jsx("span",{style:{fontSize:"0.55rem",color:be.lockColor},children:"Premium"})]},J):z?t.jsxs("div",{style:{position:"relative"},children:[t.jsx("img",{src:z,style:{width:"80px",height:"80px",borderRadius:"14px",objectFit:"cover",border:"1px solid rgba(255,255,255,0.1)"}}),t.jsx("button",{onClick:()=>Le(J),style:{position:"absolute",top:-6,right:-6,width:"22px",height:"22px",borderRadius:"50%",background:"#ef4444",border:"2px solid var(--bg-deep, #111)",color:"white",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0,minHeight:"unset",fontSize:"0.7rem"},children:t.jsx(mt,{size:12})})]},J):t.jsxs("label",{style:{width:"80px",height:"80px",borderRadius:"14px",background:`${be.accent}08`,border:`1px dashed ${be.galleryBorder}`,display:"flex",alignItems:"center",justifyContent:"center",cursor:O?"wait":"pointer"},children:[O?t.jsx("span",{className:"spin",style:{width:12,height:12,border:"2px solid white",borderRadius:"50%",borderTopColor:"transparent"}}):t.jsx("span",{style:{fontSize:"24px",color:"rgba(255,255,255,0.3)"},children:"+"}),t.jsx("input",{type:"file",accept:"image/*",onChange:Y=>Me(Y,J),style:{display:"none"},disabled:O})]},J)})})]}),t.jsxs("div",{style:{padding:"16px 20px",borderRadius:"16px",marginBottom:"24px",background:be.panelBg,border:`1px solid ${be.panelBorder}`,opacity:.65},children:[t.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px",fontSize:"0.85rem",fontWeight:"600",color:"rgba(255,255,255,0.5)"},children:"ð Informations communes aux 3 espaces"}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:[{label:(n==null?void 0:n.name)||"Prénom",icon:"ð¤"},{label:n!=null&&n.age?`${n.age} ans`:"Ãge",icon:"ð"},{label:(typeof(n==null?void 0:n.location)=="object"?(nt=n==null?void 0:n.location)==null?void 0:nt.city:n==null?void 0:n.location)||(n==null?void 0:n.city)||"Ville",icon:"ð"},{label:(n==null?void 0:n.gender)==="male"?"Homme":(n==null?void 0:n.gender)==="female"?"Femme":"Genre",icon:"â§ï¸"}].map((J,Ie)=>t.jsxs("div",{style:{padding:"6px 14px",borderRadius:"10px",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",fontSize:"0.78rem",color:"rgba(255,255,255,0.45)",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx("span",{children:J.icon})," ",J.label]},Ie))}),t.jsx("p",{style:{margin:"10px 0 0",fontSize:"0.7rem",color:"rgba(255,255,255,0.3)",lineHeight:1.4},children:"Ces informations sont partagées entre vos espaces Eros, Erox et Friend. Seuls le pseudo, la photo et les préférences sont propres à chaque espace."})]}),t.jsx("p",{style:{color:"var(--text-muted)",marginBottom:"30px",textAlign:"center",fontSize:N?"0.9rem":"1rem"},children:l?"Confessez vos désirs pour trouver l'âme sÅur ou le corps complice.":"Ajustez vos préférences pour affiner l'algorithme de compatibilité."}),Z.map(J=>t.jsxs("div",{className:"glass-panel",style:{padding:N?"15px":"25px",borderRadius:"var(--radius-lg)",marginBottom:"30px",border:`1px solid ${be.panelBorder}`,background:be.panelBg},children:[t.jsxs("h3",{style:{fontSize:"1.2rem",color:l||d?be.accent:J.color,marginBottom:"20px",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(J.icon,{size:24,color:l||d?be.accent:J.color})," ",J.title]}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(100px, 1fr))",gap:"12px"},children:J.items.map(Ie=>{const z=p.includes(Ie.id),Y=l||d?be.accent:J.color;return t.jsxs("div",{onClick:()=>Ae(Ie.id),className:"animate-scale",style:{background:z?`${Y}22`:"rgba(255,255,255,0.03)",border:z?`1px solid ${Y}`:"1px solid rgba(255,255,255,0.05)",borderRadius:"12px",padding:"15px 10px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px",cursor:"pointer",transition:"all 0.2s",boxShadow:z?`0 0 15px ${Y}33`:"none"},children:[t.jsx(Ie.icon,{size:24,color:z?Y:"var(--text-muted)"}),t.jsx("span",{style:{fontSize:"0.8rem",textAlign:"center",color:z?"white":"var(--text-muted)",fontWeight:z?"bold":"normal"},children:Ie.label})]},Ie.id)})})]},J.id))]}),t.jsxs("div",{style:{position:"fixed",bottom:N?"calc(env(safe-area-inset-bottom, 0px) + 80px)":"calc(env(safe-area-inset-bottom, 0px) + 20px)",left:"50%",transform:"translateX(-50%)",width:N?"calc(100% - 32px)":"auto",background:be.floatBg,padding:N?"12px 20px":"15px 30px",borderRadius:"40px",display:"flex",gap:N?"10px":"20px",alignItems:"center",justifyContent:"center",backdropFilter:"blur(10px)",border:`1px solid ${be.floatBorder}`,boxShadow:"0 10px 30px rgba(0,0,0,0.5)",zIndex:100},children:[t.jsxs("button",{onClick:De,style:{background:"transparent",border:"1px solid rgba(255,255,255,0.2)",color:"white",padding:"10px 20px",borderRadius:"20px",cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",flex:N?1:"unset",justifyContent:"center"},children:[t.jsx(lx,{size:18})," ",N?"":"Réinitialiser"]}
2431),t.jsxs("button",{onClick:()=>{Uo(),ze()},className:"btn-primary",style:{padding:"10px 30px",borderRadius:"20px",display:"flex",alignItems:"center",gap:"8px",background:be.saveBg,color:be.saveColor,flex:N?1:"unset",justifyContent:"center"},children:[t.jsx(_p,{size:18})," ",N?"Sauver":"Enregistrer"]})]}),ee&&t.jsx(c5,{profileId:n==null?void 0:n.id,mode:l?"EROX":d?"FRIEND":"EROS",onClose:()=>te(!1),onSuccess:J=>{te(!1),j(J),e.success("ð¥ Video selfie enregistrée !")}}),$&&t.jsx(d5,{currentPhoto:b,currentAnimatedUrl:l?n==null?void 0:n.erox_animated_photo_url:d?n==null?void 0:n.friend_animated_photo_url:n==null?void 0:n.animated_photo_url,animatedColumn:l?"erox_animated_photo_url":d?"friend_animated_photo_url":"animated_photo_url",onClose:()=>B(!1),onSuccess:J=>{B(!1),e.success(J?"⨠Photo animée activée !":"ðï¸ Animation supprimée")}})]})},mx=24*60*60*1e3;async function FP(e="EROS"){var r;try{const i=new Date(Date.now()-mx).toISOString(),{data:n,error:o}=await D.from("stories").select("*, author:profiles!user_id(id, name, avatar_url, photo, animated_photo_url)").eq("space",e).gte("created_at",i).order("created_at",{ascending:!1});if(o)return console.error("Error fetching stories:",o),[];if(!(n!=null&&n.length))return[];const a=n.map(_=>_.id),{data:{session:l}}=await D.auth.getSession(),d=(r=l==null?void 0:l.user)==null?void 0:r.id,[p,u,g]=await Promise.all([D.from("story_likes").select("story_id").in("story_id",a),D.from("story_comments").select("story_id").in("story_id",a),d?D.from("story_likes").select("story_id").eq("user_id",d).in("story_id",a):{data:[]}]),h={};(p.data||[]).forEach(_=>{h[_.story_id]=(h[_.story_id]||0)+1});const x={};(u.data||[]).forEach(_=>{x[_.story_id]=(x[_.story_id]||0)+1});const y=new Set((g.data||[]).map(_=>_.story_id));return n.map(_=>({..._,author:_.author||{name:"Anonyme",avatar_url:null},likes_count:h[_.id]||0,comments_count:x[_.id]||0,is_liked:y.has(_.id),expires_at:new Date(new Date(_.created_at).getTime()+mx)}))}catch(i){return console.error("getStories error:",i),[]}}async function MP({space:e,contentType:r,textContent:i,imageUrl:n}){var d;const{data:{session:o}}=await D.auth.getSession();if(!((d=o==null?void 0:o.user)!=null&&d.id))throw new Error("Not authenticated");const{data:a,error:l}=await D.from("stories").insert({user_id:o.user.id,space:e,content_type:r,text_content:i||null,image_url:n||null}).select().single();if(l)throw l;return a}async function DP(e){const{error:r}=await D.from("stories").delete().eq("id",e);if(r)throw r}async function BP(e){var o;const{data:{session:r}}=await D.auth.getSession();if(!((o=r==null?void 0:r.user)!=null&&o.id))return;const i=r.user.id,{data:n}=await D.from("story_likes").select("id").eq("story_id",e).eq("user_id",i).single();return n?(await D.from("story_likes").delete().eq("id",n.id),!1):(await D.from("story_likes").insert({story_id:e,user_id:i}),!0)}async function OP(e){const{data:r,error:i}=await D.from("story_comments").select("*, author:profiles!user_id(id, name, avatar_url, photo, animated_photo_url)").eq("story_id",e).order("created_at",{ascending:!0});return i?(console.error("Error fetching comments:",i),[]):r||[]}async function LP(e,r){var a;const{data:{session:i}}=await D.auth.getSession();if(!((a=i==null?void 0:i.user)!=null&&a.id))throw new Error("Not authenticated");const{data:n,error:o}=await D.from("story_comments").insert({story_id:e,user_id:i.user.id,text:r}).select("*, author:profiles!user_id(id, name, avatar_url, photo, animated_photo_url)").single();if(o)throw o;return n}function $P(e,r=800,i=.55){return new Promise((n,o)=>{const a=new window.Image;a.onload=()=>{let{width:l,height:d}=a;(l>r||d>r)&&(l>d?(d=Math.round(d*r/l),l=r):(l=Math.round(l*r/d),d=r));const p=document.createElement("canvas");p.width=l,p.height=d,p.getContext("2d").drawImage(a,0,0,l,d),p.toBlob(g=>{if(!g){o(new Error("Compression failed"));return}console.log(`[Stories] Image compressed: ${(e.size/1024).toFixed(0)}KB â ${(g.size/1024).toFixed(0)}KB`),n(g)},"image/jpeg",i)},a.onerror=()=>o(new Error("Failed to load image")),a.src=URL.createObjectURL(e)})}async function WP(e){var u;const{data:{session:r}}=await D.auth.getSession();if(!((u=r==null?void 0:r.user)!=null&&u.id))throw new Error("Not authenticated");let i=e,n=e.type||"image/jpeg";try{i=await $P(e),n="image/jpeg"}catch(g){console.warn("[Stories] Compression failed, uploading original:",g)}const{createClient:o}=await Wr(async()=>{const{createClient:g}=await Promise.resolve().then(()=>Fa);return{createClient:g}},void 0),a=o("https://bqfzljnhxblhiabyvpqm.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4"),l=`${r.user.id}/story_${Date.now()}.jpg`,{error:d}=await a.storage.from("avatars").upload(l,i,{contentType:n,upsert:!0});if(d)throw console.error("[Stories] Upload error:",d),new Error(`Upload échoué: ${d.message}`);const{data:p}=a.storage.from("avatars").getPublicUrl(l);return p.publicUrl}function f1(e){const r=Math.floor((Date.now()-new Date(e).getTime())/1e3);return r<60?"à l'instant":r<3600?`il y a ${Math.floor(r/60)}min`:`il y a ${Math.floor(r/3600)}h`}function NP(e){const i=new Date(e).getTime()+mx-Date.now();if(i<=0)return"Expiré";const n=Math.floor(i/(60*60*1e3)),o=Math.floor(i%(60*60*1e3)/(60*1e3));return n>0?`${n}h`:`${o}min`}const Cg=280,UP=({space:e="EROS",refreshKey:r})=>{const{profile:i}=gr(),n=si(),o=Lt(),[a,l]=m.useState([]),[d,p]=m.useState(!0),[u,g]=m.useState(null),[h,x]=m.useState([]),[y,_]=m.useState(""),[S,k]=m.useState(!1),w=m.useRef(null),[b,j]=m.useState(""),[T,P]=m.useState(!1),[I,R]=m.useState(null),[O,E]=m.useState(null),[$,B]=m.useState(!1),ee=m.useRef(null),te=m.useRef(null);m.useEffect(()=>{K()},[e,r]);const K=async()=>{p(!0);const Z=await FP(e);l(Z),p(!1)},ne=async()=>
2431{if(!$&&!(!b.trim()&&!I)){B(!0);try{let Z=null;I&&(Z=await WP(I)),await MP({space:e,contentType:I?"photo":"text",textContent:b.trim()||null,imageUrl:Z}),n.success("Publié ! â¨"),j(""),R(null),E(null),P(!1),await K()}catch(Z){console.error("Publish error:",Z),n.error(Z.message||"Erreur lors de la publication")}B(!1)}},Re=Z=>{var he;const ae=(he=Z.target.files)==null?void 0:he[0];if(!ae)return;R(ae),P(!0);const X=new FileReader;X.onload=Ae=>E(Ae.target.result),X.readAsDataURL(ae)},Q=()=>{R(null),E(null)},G=async Z=>{l(ae=>ae.map(X=>X.id===Z?{...X,is_liked:!X.is_liked,likes_count:X.is_liked?X.likes_count-1:X.likes_count+1}:X)),await BP(Z)},le=async Z=>{if(u===Z){g(null);return}g(Z);const ae=await OP(Z);x(ae),setTimeout(()=>{var X;return(X=w.current)==null?void 0:X.focus()},200)},F=async Z=>{if(!(!y.trim()||S)){k(!0);try{const ae=await LP(Z,y.trim());x(X=>[...X,ae]),_(""),l(X=>X.map(he=>he.id===Z?{...he,comments_count:he.comments_count+1}:he))}catch(ae){console.error("Comment error:",ae)}k(!1)}},A=async Z=>{confirm("Supprimer cette publication ?")&&(await DP(Z),l(ae=>ae.filter(X=>X.id!==Z)))},M={EROS:{accent:"#D4A574",accentSoft:"#E8C9A0",accentDeep:"#C5935E",like:"#D4A574",comment:"#C5A880",headerBg:"linear-gradient(135deg, #D4A574, #C5935E)",cardBorder:"rgba(212,165,116,0.25)",cardBg:"rgba(212,165,116,0.08)",composerBorder:"rgba(212,165,116,0.28)",cardShadow:"0 2px 16px rgba(212,165,116,0.08)"},EROX:{accent:"#ff4d4d",accentSoft:"#ff6b6b",accentDeep:"#cc0000",like:"#ff4d4d",comment:"#ff9999",headerBg:"linear-gradient(135deg, #ff4d4d, #cc0000)",cardBorder:"rgba(255,77,77,0.25)",cardBg:"rgba(255,77,77,0.08)",composerBorder:"rgba(255,77,77,0.28)",cardShadow:"0 2px 16px rgba(255,77,77,0.08)"},FRIEND:{accent:"#26A69A",accentSoft:"#4DB6AC",accentDeep:"#00796B",like:"#26A69A",comment:"#80CBC4",headerBg:"linear-gradient(135deg, #26A69A, #00796B)",cardBorder:"rgba(38,166,154,0.25)",cardBg:"rgba(38,166,154,0.08)",composerBorder:"rgba(38,166,154,0.28)",cardShadow:"0 2px 16px rgba(38,166,154,0.08)"}},V=M[e]||M.EROS,H=(i==null?void 0:i.avatar_url)||(i==null?void 0:i.photo)||null,N=b.trim().length>0||!!I;return t.jsxs("div",{children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},children:[t.jsxs("h3",{style:{margin:0,fontSize:"0.95rem",fontWeight:700,display:"flex",alignItems:"center",gap:"8px",fontFamily:"Outfit, sans-serif"},children:[t.jsx("span",{style:{background:V.headerBg,borderRadius:"8px",padding:"4px 6px",display:"flex",alignItems:"center"},children:t.jsx(pi,{size:14,color:"white"})}),"Stories"]}),t.jsx("span",{style:{fontSize:"0.65rem",background:`${V.accent}18`,color:V.accentSoft,padding:"2px 8px",borderRadius:8,fontWeight:600,border:`1px solid ${V.accent}25`},children:"Ãphémère 24h"})]}),t.jsxs("div",{style:{background:V.cardBg,borderRadius:16,overflow:"hidden",border:`1px solid ${V.composerBorder}`,marginBottom:16},children:[t.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:10,padding:"12px 14px"},children:[t.jsx(Mo,{photoUrl:H,animatedUrl:i==null?void 0:i.animated_photo_url,alt:"Profile",size:38,borderColor:`${V.accent}33`,borderWidth:2,style:{marginTop:2}}),t.jsx("textarea",{ref:ee,value:b,onChange:Z=>{Z.target.value.length<=Cg&&j(Z.target.value)},onFocus:()=>P(!0),placeholder:"Quoi de neuf ?",rows:T?3:1,style:{flex:1,background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.08)",borderRadius:T?14:24,padding:T?"10px 14px":"9px 16px",color:"white",fontSize:"0.9rem",lineHeight:1.5,outline:"none",resize:"none",fontFamily:"Outfit, sans-serif",transition:"all 0.25s ease",minHeight:T?70:38,boxSizing:"border-box"}}),!T&&t.jsx(ye.button,{whileTap:{scale:.9},onClick:()=>{var Z;return(Z=te.current)==null?void 0:Z.click()},style:{background:"none",border:"none",cursor:"pointer",padding:8,flexShrink:0,marginTop:2},children:t.jsx(wd,{size:22,color:V.accent,style:{opacity:.7}})})]}),O&&t.jsxs("div",{style:{padding:"0 14px 10px",position:"relative"},children:[t.jsx("img",{src:O,alt:"preview",style:{width:"100%",maxHeight:200,objectFit:"contain",borderRadius:12,border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.3)"}}),t.jsx("button",{onClick:Q,style:{position:"absolute",top:8,right:22,background:"rgba(0,0,0,0.7)",border:"none",borderRadius:"50%",width:26,height:26,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"white"},children:t.jsx(mt,{size:13})})]}),t.jsx(tr,{children:T&&t.jsx(ye.div,{initial:{height:0,opacity:0}
2431,animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},style:{overflow:"hidden"},children:t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 14px 12px",gap:10},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[t.jsxs(ye.button,{whileTap:{scale:.9},onClick:()=>{var Z;return(Z=te.current)==null?void 0:Z.click()},style:{background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:10,padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",gap:5,color:"rgba(255,255,255,0.5)",fontSize:"0.78rem"},children:[t.jsx(wd,{size:15,color:V.accent})," Photo"]}),t.jsxs("span",{style:{fontSize:"0.7rem",color:b.length>Cg*.9?"#f43f5e":"rgba(255,255,255,0.2)"},children:[b.length,"/",Cg]})]}),t.jsxs("div",{style:{display:"flex",gap:8},children:[t.jsx("button",{onClick:()=>{P(!1),j(""),Q()},style:{background:"none",border:"1px solid rgba(255,255,255,0.1)",borderRadius:10,padding:"6px 14px",color:"rgba(255,255,255,0.4)",fontSize:"0.8rem",cursor:"pointer"},children:"Annuler"}),t.jsx(ye.button,{whileTap:{scale:N?.93:1},onClick:ne,disabled:!N||$,style:{background:N?"linear-gradient(135deg, #3B82F6, #2563EB)":"rgba(255,255,255,0.08)",border:"none",borderRadius:10,padding:"6px 18px",cursor:N?"pointer":"not-allowed",color:N?"white":"rgba(255,255,255,0.25)",fontWeight:600,fontSize:"0.83rem",display:"flex",alignItems:"center",gap:5,transition:"all 0.2s"},children:$?t.jsx(ye.div,{animate:{rotate:360},transition:{repeat:1/0,duration:.8,ease:"linear"},style:{width:14,height:14,border:"2px solid rgba(255,255,255,0.3)",borderTop:"2px solid white",borderRadius:"50%"}}):t.jsxs(t.Fragment,{children:[t.jsx(ji,{size:13})," Publier"]})})]})]})})}),t.jsx("input",{ref:te,type:"file",accept:"image/*",onChange:Re,style:{display:"none"}})]}),d&&t.jsx("div",{style:{padding:"24px",textAlign:"center"},children:t.jsx(ye.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1,ease:"linear"},style:{width:28,height:28,border:"3px solid rgba(255,255,255,0.08)",borderTop:`3px solid ${V.accent}`,borderRadius:"50%",margin:"0 auto"}})}),!d&&a.length===0&&t.jsx(ye.div,{initial:{opacity:0}
2431,animate:{opacity:1},style:{textAlign:"center",padding:"24px 20px",color:"rgba(255,255,255,0.3)",fontSize:"0.85rem"},children:"Aucune publication pour le moment"}),!d&&a.length>0&&t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:t.jsx(tr,{children:a.map((Z,ae)=>{var X,he,Ae,ze,ue;return t.jsxs(ye.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},exit:{opacity:0,scale:.95},transition:{delay:ae*.04},style:{background:V.cardBg,borderRadius:16,overflow:"hidden",border:`1px solid ${V.cardBorder}`,boxShadow:V.cardShadow},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"12px 14px",gap:10},children:[t.jsx("div",{onClick:()=>{var xe;return o(`/profile/${(xe=Z.author)==null?void 0:xe.id}`)},style:{cursor:"pointer",borderRadius:"50%"},children:t.jsx(Mo,{photoUrl:((X=Z.author)==null?void 0:X.avatar_url)||((he=Z.author)==null?void 0:he.photo)||null,animatedUrl:(Ae=Z.author)==null?void 0:Ae.animated_photo_url,alt:(ze=Z.author)==null?void 0:ze.name,size:38,borderColor:`${V.accent}33`,borderWidth:2})}),t.jsxs("div",{style:{flex:1},children:[t.jsx("span",{onClick:()=>{var xe;return o(`/profile/${(xe=Z.author)==null?void 0:xe.id}`)},style:{fontWeight:600,fontSize:"0.9rem",cursor:"pointer",color:"white"},children:((ue=Z.author)==null?void 0:ue.name)||"Anonyme"}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:"0.72rem",color:"rgba(255,255,255,0.3)"},children:[t.jsx("span",{children:f1(Z.created_at)}),t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:3},children:[t.jsx(Pn,{size:9})," ",NP(Z.created_at)]})]})]}),Z.user_id===(i==null?void 0:i.id)&&t.jsx("button",{onClick:()=>A(Z.id),style:{background:"none",border:"none",cursor:"pointer",color:"rgba(255,255,255,0.2)",padding:4},children:t.jsx(rn,{size:15})})]}),Z.text_content&&t.jsx("div",{style:{padding:"0 14px 10px",fontSize:"0.92rem",lineHeight:1.55,color:"rgba(255,255,255,0.85)"},children:Z.text_content}),Z.content_type==="photo"&&Z.image_url&&t.jsx("img",{src:Z.image_url,alt:"",style:{width:"100%",maxHeight:400,objectFit:"contain",background:"rgba(0,0,0,0.3)"}}),t.jsxs("div",{style:{display:"flex",borderTop:"1px solid rgba(255,255,255,0.06)"},children:[t.jsxs(ye.button,{whileTap:{scale:1.15},onClick:()=>G(Z.id),style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"10px 0",background:"none",border:"none",cursor:"pointer",fontSize:"0.83rem",fontFamily:"Outfit, sans-serif",color:Z.is_liked?V.like:"rgba(255,255,255,0.45)",fontWeight:Z.is_liked?600:400,borderRight:`1px solid ${V.cardBorder}`,transition:"color 0.2s"},children:[t.jsx(Bt,{size:16,fill:Z.is_liked?V.like:"none",color:Z.is_liked?V.like:"rgba(255,255,255,0.45)"}),"J'aime",Z.likes_count>0?` · ${Z.likes_count}`:""]}),t.jsxs("button",{onClick:()=>le(Z.id),style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"10px 0",background:"none",border:"none",cursor:"pointer",fontSize:"0.83rem",fontFamily:"Outfit, sans-serif",color:u===Z.id?V.comment:"rgba(255,255,255,0.45)",transition:"color 0.2s"},children:[t.jsx(Qt,{size:16,color:u===Z.id?V.comment:"rgba(255,255,255,0.45)"}),"Commenter",Z.comments_count>0?` · ${Z.comments_count}`:""]})]}),t.jsx(tr,{children:u===Z.id&&t.jsxs(ye.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},style:{overflow:"hidden",borderTop:"1px solid rgba(255,255,255,0.05)"},children:[t.jsxs("div",{style:{padding:"8px 14px",maxHeight:180,overflowY:"auto"},children:[h.length===0&&t.jsx("p",{style:{color:"rgba(255,255,255,0.25)",fontSize:"0.8rem",textAlign:"center",margin:"8px 0"},children:"Aucun commentaire"}),h.map(xe=>{var ke,Pe,Ce,Me;return t.jsxs("div",{style:{display:"flex",gap:8,marginBottom:8},children:[t.jsx(Mo,{photoUrl:((ke=xe.author)==null?void 0:ke.avatar_url)||((Pe=xe.author)==null?void 0:Pe.photo)||null,animatedUrl:(Ce=xe.author)==null?void 0:Ce.animated_photo_url,size:26,borderColor:"transparent",borderWidth:0,style:{marginTop:2}}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.06)",borderRadius:14,padding:"6px 12px",flex:1},children:[t.jsxs("span",{style:{fontWeight:600,fontSize:"0.78rem",color:"white"},children:[(Me=xe.author)==null?void 0:Me.name," "]}),t.jsx("span",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.7)"},children:xe.text}),t.jsx("div",{style:{fontSize:"0.63rem",color:"rgba(255,255,255,0.2)",marginTop:3},children:f1(xe.created_at)})]})]},xe.id)})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 14px 10px",background:"rgba(0,0,0,0.15)"},children:[t.jsx(Mo,{photoUrl:H,animatedUrl:i==null?void 0:i.animated_photo_url,size:26,borderColor:"transparent",borderWidth:0}),t.jsx("input",{ref:w,value:y,onChange:xe=>_(xe.target.value),onKeyDown:xe=>xe.key==="Enter"&&F(Z.id),placeholder:"Ãcrire un commentaire...",style:{flex:1,background:"rgba(255,255,255,0.08)",border:"none",borderRadius:20,padding:"8px 14px",color:"white",fontSize:"0.82rem",outline:"none"}}),t.jsx(ye.button,{whileTap:{scale:.85},onClick:()=>F(Z.id),disabled:!y.trim()||S,style:{background:V.accent,border:"none",borderRadius:"50%",width:30,height:30,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",opacity:y.trim()?1:.3,flexShrink:0},children:t.jsx(ji,{size:13,color:"white"})})]})]})})]}
2431,Z.id)})})})]})},VP=[{url:"https://images.unsplash.com/photo-1523240795612-9a054b0db644?w=600&q=80",label:"Cours"},{url:"https://images.unsplash.com/photo-1581092160607-ee22621dd758?w=600&q=80",label:"Réparation"},{url:"https://images.unsplash.com/photo-1558618666-fcd25c85f82e?w=600&q=80",label:"Bricolage"},{url:"https://images.unsplash.com/photo-1517694712202-14dd9538aa97?w=600&q=80",label:"Informatique"},{url:"https://images.unsplash.com/photo-1556909114-f6e7ad7d3136?w=600&q=80",label:"Cuisine"},{url:"https://images.unsplash.com/photo-1416879595882-3373a0480b5b?w=600&q=80",label:"Jardinage"},{url:"https://images.unsplash.com/photo-1581578731548-c64695cc6952?w=600&q=80",label:"Ménage"},{url:"https://images.unsplash.com/photo-1449965408869-ebd3fee7710d?w=600&q=80",label:"Transport"},{url:"https://images.unsplash.com/photo-1571019614242-c5c5dee9f50b?w=600&q=80",label:"Coaching"},{url:"https://images.unsplash.com/photo-1560066984-138dadb4c035?w=600&q=80",label:"Beauté"},{url:"https://images.unsplash.com/photo-1554048612-b6a482bc67e5?w=600&q=80",label:"Photo"},{url:"https://images.unsplash.com/photo-1511379938547-c1f69419868d?w=600&q=80",label:"Musique"},{url:"https://images.unsplash.com/photo-1450778869180-41d0601e046e?w=600&q=80",label:"Animaux"},{url:"https://images.unsplash.com/photo-1587614382346-4ec70e388b28?w=600&q=80",label:"Baby-sitting"},{url:"https://images.unsplash.com/photo-1600518464441-9154a4dea21b?w=600&q=80",label:"Déménagement"},{url:"https://images.unsplash.com/photo-1513364776144-60967b0f800f?w=600&q=80",label:"Arts"}],qP=["sexe","sexuel","sexual","porn","porno","escort","prostitu","drogue","drug","cannabis","cocaïne","cocaine","héroïne","heroin","meth","crack","ecstasy","lsd","opium","shit","arme","weapon","gun","fusil","pistolet","nude","nue","nu ","nudité","fellation","sodomie","massage sensuel","massage érotique","happy ending","contrefaçon","faux papier","faux document"],qa=[{id:"cours",emoji:"ð",label:"Cours Particuliers",color:"#3B82F6"},{id:"reparation",emoji:"ð§",label:"Réparations",color:"#F97316"},{id:"bricolage",emoji:"ð ",label:"Bricolage",color:"#84CC16"},{id:"informatique",emoji:"ð»",label:"Informatique",color:"#6366F1"},{id:"cuisine",emoji:"ð³",label:"Cuisine",color:"#EF4444"},{id:"jardinage",emoji:"ð¿",label:"Jardinage",color:"#22C55E"},{id:"menage",emoji:"ð§¹",label:"Ménage",color:"#06B6D4"},{id:"transport",emoji:"ð",label:"Transport",color:"#8B5CF6"},{id:"coaching",emoji:"ðª",label:"Coaching",color:"#EC4899"},{id:"beaute",emoji:"ð",label:"Beauté/Bien-être",color:"#F472B6"},{id:"photo",emoji:"ð¸",label:"Photo/Vidéo",color:"#A855F7"},{id:"musique",emoji:"ðµ",label:"Musique",color:"#F59E0B"},{id:"animaux",emoji:"ð¾",label:"Animaux",color:"#78716C"},{id:"babysitting",emoji:"ð¶",label:"Baby-sitting",color:"#FB923C"},{id:"demenagement",emoji:"ð¦",label:"Déménagement",color:"#64748B"},{id:"arts",emoji:"ð¨",label:"Arts/Créatif",color:"#E11D48"},{id:"autre",emoji:"ð",label:"Autre",color:"#94A3B8"}],HP=[{label:"Service simple (~1h)",min:10,max:30},{label:"Service moyen (~2-3h)",min:30,max:80},{label:"Service complexe (journée)",min:80,max:200}];function Io(e){if(!e)return!1;const r=e.toLowerCase();return qP.some(i=>r.includes(i))}function GP(e){return new Promise((r,i)=>{const n=new FileReader;n.onload=o=>{const a=new window.Image;a.onload=()=>{const l=document.createElement("canvas"),d=600;let p=a.width,u=a.height;(p>d||u>d)&&(p>u?(u=Math.round(u*d/p),p=d):(p=Math.round(p*d/u),u=d)),l.width=p,l.height=u,l.getContext("2d").drawImage(a,0,0,p,u),r(l.toDataURL("image/jpeg",.7))},a.onerror=i,a.src=o.target.result},n.onerror=i,n.readAsDataURL(e)})}const Ar={async getServices({category:e,search:r,sortBy:i="created_at",limit:n=50}={}){try{let o=D.from("entraide_services").select(` 2432 *, 2433 provider:profiles!provider_id (id, name, avatar_url, friend_avatar_url, verification_status) 2434 `).eq("status","active").order(i,{ascending:i==="price_meetips"}).limit(n);e&&(o=o.eq("category",e)),r&&(o=o.or(`title.ilike.%${r}%,description.ilike.%${r}%`));const{data:a,error:l}=await o;
2434if(l)throw l;const d=a||[];if(d.length>0){const p=d.map(w=>w.id),{data:u,error:g}=await D.from("entraide_ratings").select("service_id, rated_id, stars").in("service_id",p);g&&console.warn("[Entraide] Failed to fetch service ratings (RLS?):",g.message);const h=[...new Set(d.map(w=>w.provider_id))],{data:x,error:y}=await D.from("entraide_ratings").select("rated_id, booking_id, stars").in("rated_id",h).is("service_id",null);y&&console.warn("[Entraide] Failed to fetch legacy ratings (RLS?):",y.message);const{data:_,error:S}=await D.from("entraide_ratings").select("rated_id, stars").in("rated_id",h);S&&console.warn("[Entraide] Failed to fetch all provider ratings:",S.message),console.log("[Entraide] Ratings debug:",{serviceRatings:(u==null?void 0:u.length)||0,legacyRatings:(x==null?void 0:x.length)||0,allProviderRatings:(_==null?void 0:_.length)||0,ratingsErr:g==null?void 0:g.message,legacyErr:y==null?void 0:y.message});const k={};if(u)for(const w of u)k[w.service_id]||(k[w.service_id]=[]),k[w.service_id].push(w.stars);if(x&&x.length>0)for(const w of d){const b=x.filter(j=>j.rated_id===w.provider_id);if(b.length>0){k[w.id]||(k[w.id]=[]);for(const j of b)k[w.id].push(j.stars)}}if(_&&_.length>0){for(const w of d)if(!k[w.id]||k[w.id].length===0){const b=_.filter(j=>j.rated_id===w.provider_id);b.length>0&&(k[w.id]=b.map(j=>j.stars))}}for(const w of d){const b=k[w.id];if(b&&b.length>0){const j=b.reduce((T,P)=>T+P,0)/b.length;w.avg_rating=Math.round(j*10)/10,w.total_ratings=b.length}}}return{success:!0,data:d}}catch(o){return console.error("EntraideService.getServices error:",o),{success:!1,error:o.message,data:[]}}},async getServiceById(e){try{const{data:r,error:i}=await D.from("entraide_services").select(` 2435 *, 2436 provider:profiles!provider_id (id, name, avatar_url, friend_avatar_url, verification_status) 2437 `).eq("id",e).single();if(i)throw i;const{data:n}=await D.from("entraide_ratings").select(` 2438 *, 2439 rater:profiles!rater_id (id, name, avatar_url, friend_avatar_url) 2440 `).eq("rated_id",r.provider_id).order("created_at",{ascending:!1}).limit(20);return{success:!0,data:{...r,ratings:n||[]}}}catch(r){return console.error("EntraideService.getServiceById error:",r),{success:!1,error:r.message}}},async createService({providerId:e,category:r,title:i,description:n,priceMeetips:o,priceEuros:a,priceType:l="meetips",location:d,imageUrl:p,availableSlots:u}){if(Io(i)||Io(n))return{success:!1,error:"Votre annonce contient des mots interdits. Veuillez reformuler."};try{const{data:g,error:h}=await D.from("entraide_services").insert({provider_id:e,category:r,title:i,description:n,price_meetips:l==="meetips"?o:null,price_euros:l==="euros"?a:null,price_type:l,location:d||null,image_url:p||null,available_slots:u||null,status:"active"}).select().single();if(h)throw h;return{success:!0,data:g}}catch(g){return console.error("EntraideService.createService error:",g),{success:!1,error:g.message}}},async updateService(e,r){if(Io(r.title)||Io(r.description))return{success:!1,error:"Votre annonce contient des mots interdits. Veuillez reformuler."};try{const{data:i,error:n}=await D.from("entraide_services").update(r).eq("id",e).select().single();if(n)throw n;return{success:!0,data:i}}catch(i){return console.error("EntraideService.updateService error:",i),{success:!1,error:i.message}}},async deleteService(e){try{const{error:r}=await D.from("entraide_services").delete().eq("id",e);if(r)throw r;return{success:!0}}catch(r){return console.error("EntraideService.deleteService error:",r),{success:!1,error:r.message}}},async getMyServices(e){try{const{data:r,error:i}=await D.from("entraide_services").select(`*, 2441 provider:profiles!provider_id (id, name, avatar_url, friend_avatar_url, verification_status) 2442 `).eq("provider_id",e).order("created_at",{ascending:!1});if(i)throw i;const n=r||[];if(n.length>0){const o=n.map(p=>p.id),{data:a}=await D.from("entraide_ratings").select("service_id, rated_id, stars").in("service_id",o),{data:l}
2442=await D.from("entraide_ratings").select("rated_id, stars").eq("rated_id",e),d={};if(a)for(const p of a)d[p.service_id]||(d[p.service_id]=[]),d[p.service_id].push(p.stars);if(l&&l.length>0)for(const p of n)(!d[p.id]||d[p.id].length===0)&&(d[p.id]=l.map(u=>u.stars));for(const p of n){const u=d[p.id];if(u&&u.length>0){const g=u.reduce((h,x)=>h+x,0)/u.length;p.avg_rating=Math.round(g*10)/10,p.total_ratings=u.length}}}return{success:!0,data:n}}catch(r){return console.error("EntraideService.getMyServices error:",r),{success:!1,error:r.message,data:[]}}},async bookService(e,r){try{const{data:i,error:n}=await D.from("entraide_services").select("*").eq("id",e).single();if(n)throw n;if(i.provider_id===r)return{success:!1,error:"Vous ne pouvez pas réserver votre propre service."};const{data:o,error:a}=await D.from("profiles").select("meetips_balance").eq("id",r).single();if(a)throw a;if((o.meetips_balance||0)<i.price_meetips)return{success:!1,error:`Solde insuffisant (${o.meetips_balance||0}/${i.price_meetips} Meetips)`};const l=(o.meetips_balance||0)-i.price_meetips,{error:d}=await D.from("profiles").update({meetips_balance:l}).eq("id",r);if(d)throw d;await D.from("meetips_transactions").insert({user_id:r,amount:-i.price_meetips,description:`Réservation Entraide: ${i.title}`});const{data:p,error:u}=await D.from("entraide_bookings").insert({service_id:e,client_id:r,provider_id:i.provider_id,price_meetips:i.price_meetips,status:"pending",meetips_held:!0}).select().single();if(u)throw u;return{success:!0,data:p,newBalance:l}}catch(i){return console.error("EntraideService.bookService error:",i),{success:!1,error:i.message}}},async confirmBooking(e,r){try{const{data:i,error:n}=await D.from("entraide_bookings").update({status:"confirmed"}).eq("id",e).eq("provider_id",r).eq("status","pending").select().single();if(n)throw n;return{success:!0,data:i}}catch(i){return console.error("EntraideService.confirmBooking error:",i),{success:!1,error:i.message}}},async cancelBooking(e,r){try{const{data:i,error:n}=await D.from("entraide_bookings").select("*").eq("id",e).single();if(n)throw n;if(!["pending","confirmed"].includes(i.status))return{success:!1,error:"Cette réservation ne peut plus être annulée."};if(i.client_id!==r&&i.provider_id!==r)return{success:!1,error:"Non autorisé."};const{data:o}=await D.from("profiles").select("meetips_balance").eq("id",i.client_id).single(),a=((o==null?void 0:o.meetips_balance)||0)+i.price_meetips;await D.from("profiles").update({meetips_balance:a}).eq("id",i.client_id),await D.from("meetips_transactions").insert({user_id:i.client_id,amount:i.price_meetips,description:"Remboursement Entraide (annulation)"});const{error:l}=await D.from("entraide_bookings").update({status:"cancelled"}).eq("id",e);if(l)throw l;return{success:!0,refundBalance:a}}catch(i){return console.error("EntraideService.cancelBooking error:",i),{success:!1,error:i.message}}},async completeBooking(e,r){try{const i=new Date(Date.now()+864e5).toISOString(),{data:n,error:o}=await D.from("entraide_bookings").update({status:"completed",completed_at:new Date().toISOString(),release_at:i}).eq("id",e).eq("provider_id",r).eq("status","confirmed").select().single();if(o)throw o;return{success:!0,data:n}}catch(i){return console.error("EntraideService.completeBooking error:",i),{success:!1,error:i.message}}},async releasePayment(e){try{const{data:r,error:i}=await D.from("entraide_bookings").select("*").eq("id",e).eq("status","completed").eq("meetips_held",!0).single();if(i)throw i;if(new Date(r.release_at)>new Date)return{success:!1,error:"Le délai de 24h n'est pas encore écoulé."};const{data:n}=await D.from("entraide_ratings").select("id").eq("booking_id",e).eq("has_dispute",!0);if(n&&n.length>0)return await D.from("entraide_bookings").update({status:"disputed"}).eq("id",e),{success:!1,error:"Un litige est en cours. Meetips bloqués."};const{data:o}=await D.from("profiles").select("meetips_balance").eq("id",r.provider_id).single(),a=((o==null?void 0:o.meetips_balance)||0)+r.price_meetips;return await D.from("profiles").update({meetips_balance:a}).eq("id",r.provider_id),await D.from("meetips_transactions").insert({user_id:r.provider_id,amount:r.price_meetips,description:"Paiement Entraide reçu"}),await D.from("entraide_bookings").update({meetips_held:!1,status:"released"}).eq("id",e),{success:!0,newProviderBalance:a}}catch(r){return console.error("EntraideService.releasePayment error:",r),{success:!1,error:r.message}}},async rateService({bookingId:e,raterId:r,ratedId:i,stars:n,comment:o,hasDispute:a=!1,disputeReason:l=""}){try{const{data:d}=await D.from("entraide_ratings").select("id").eq("booking_id",e).eq("rater_id",r);
2442if(d&&d.length>0)return{success:!1,error:"Vous avez déjà noté ce service."};const{data:p}=await D.from("entraide_bookings").select("service_id").eq("id",e).single(),u=p==null?void 0:p.service_id,{data:g,error:h}=await D.from("entraide_ratings").insert({booking_id:e,service_id:u||null,rater_id:r,rated_id:i,stars:n,comment:o||null,has_dispute:a,dispute_reason:a?l:null}).select().single();if(h)throw h;if(a&&await D.from("entraide_bookings").update({status:"disputed"}).eq("id",e),u){const{data:x}=await D.from("entraide_ratings").select("stars").eq("service_id",u);if(x&&x.length>0){const y=x.reduce((_,S)=>_+S.stars,0)/x.length;await D.from("entraide_services").update({avg_rating:parseFloat(y.toFixed(1)),total_ratings:x.length}).eq("id",u)}}return{success:!0,data:g}}catch(d){return console.error("EntraideService.rateService error:",d),{success:!1,error:d.message}}},async getMyBookings(e){try{const{data:r,error:i}=await D.from("entraide_bookings").select(` 2443 *, 2444 service:entraide_services (*), 2445 provider:profiles!provider_id (id, name, avatar_url, friend_avatar_url) 2446 `).eq("client_id",e).order("created_at",{ascending:!1});if(i)throw i;return{success:!0,data:r||[]}}catch(r){return console.error("EntraideService.getMyBookings error:",r),{success:!1,error:r.message,data:[]}}},async getProviderBookings(e){try{const{data:r,error:i}=await D.from("entraide_bookings").select(` 2447 *, 2448 service:entraide_services (*), 2449 client:profiles!client_id (id, name, avatar_url, friend_avatar_url) 2450 `).eq("provider_id",e).order("created_at",{ascending:!1});if(i)throw i;return{success:!0,data:r||[]}}catch(r){return console.error("EntraideService.getProviderBookings error:",r),{success:!1,error:r.message,data:[]}}},async hasRated(e,r){try{const{data:i}=await D.from("entraide_ratings").select("id").eq("booking_id",e).eq("rater_id",r);return i&&i.length>0}catch{return!1}},async sendMessage({serviceId:e,senderId:r,receiverId:i,content:n}){if(Io(n))return{success:!1,error:"Message contient des mots interdits."};try{const{data:o,error:a}=await D.from("entraide_messages").insert({service_id:e,sender_id:r,receiver_id:i,content:n}).select(` 2451 *, 2452 sender:profiles!sender_id (id, name, avatar_url, friend_avatar_url) 2453 `).single();if(a)throw a;return{success:!0,data:o}}catch(o){return console.error("EntraideService.sendMessage error:",o),{success:!1,error:o.message}}},async getMessages(e,r){try{const{data:i,error:n}=await D.from("entraide_messages").select(` 2454 *, 2455 sender:profiles!sender_id (id, name, avatar_url, friend_avatar_url) 2456 `).eq("service_id",e).or(`sender_id.eq.${r},receiver_id.eq.${r}`).order("created_at",{ascending:!0});if(n)throw n;return{success:!0,data:i||[]}}catch(i){return console.error("EntraideService.getMessages error:",i),{success:!1,error:i.message,data:[]}}},async getRequests({category:e,city:r,search:i,limit:n=50}={}){try{let o=D.from("entraide_requests").select(` 2457 *, 2458 requester:profiles!requester_id (id, name, avatar_url, friend_avatar_url), 2459 responses:entraide_request_responses (id) 2460 `).eq("status","open").order("created_at",{ascending:!1}).limit(n);e&&(o=o.eq("category",e)),r&&(o=o.ilike("city",`%${r}%`)),i&&(o=o.or(`title.ilike.%${i}%,description.ilike.%${i}%`));const{data:a,error:l}=await o;if(l)throw l;return{success:!0,data:a||[]}}catch(o){return console.error("EntraideService.getRequests error:",o),{success:!1,error:o.message,data:[]}}},async createRequest({requesterId:e,category:r,title:i,description:n,city:o}){if(Io(i)||Io(n))return{success:!1,error:"Votre demande contient des mots interdits."};try{const{data:a,error:l}=await D.from("entraide_requests").insert({requester_id:e,category:r,title:i,description:n||null,city:o||null,status:"open"}).select().single();if(l)throw l;return{success:!0,data:a}}catch(a){return console.error("EntraideService.createRequest error:",a),{success:!1,error:a.message}}},async getMyRequests(e){try{const{data:r,error:i}=await D.from("entraide_requests").select(` 2461 *, 2462 responses:entraide_request_responses ( 2463 id, price_meetips, message, status, created_at, 2464 responder:profiles!responder_id (id, name, avatar_url, friend_avatar_url) 2465 ) 2466 `).eq("requester_id",e).order("created_at",{ascending:!1});if(i)throw i;return{success:!0,data:r||[]}}catch(r){return console.error("EntraideService.getMyRequests error:",r),{success:!1,error:r.message,data:[]}}},async deleteRequest(e){try{await D.from("entraide_request_responses").delete().eq("request_id",e);const{error:r}=await D.from("entraide_requests").delete().eq("id",e);if(r)throw r;return{success:!0}}catch(r){return console.error("EntraideService.deleteRequest error:",r),{success:!1,error:r.message}}}
2466,async updateRequest(e,{title:r,description:i,city:n,category:o}){if(r&&Io(r))return{success:!1,error:"Contenu interdit."};if(i&&Io(i))return{success:!1,error:"Contenu interdit."};try{const a={};r&&(a.title=r),i!==void 0&&(a.description=i),n!==void 0&&(a.city=n),o&&(a.category=o);const{data:l,error:d}=await D.from("entraide_requests").update(a).eq("id",e).select().single();if(d)throw d;return{success:!0,data:l}}catch(a){return console.error("EntraideService.updateRequest error:",a),{success:!1,error:a.message}}},async respondToRequest({requestId:e,responderId:r,priceMeetips:i,priceEuros:n,priceType:o="meetips",message:a}){if(a&&Io(a))return{success:!1,error:"Votre message contient des mots interdits."};try{const{data:l,error:d}=await D.from("entraide_request_responses").insert({request_id:e,responder_id:r,price_meetips:o==="meetips"?i:null,price_euros:o==="euros"?n:null,price_type:o,message:a||null,status:"proposed"}).select().single();if(d)throw d;return{success:!0,data:l}}catch(l){return console.error("EntraideService.respondToRequest error:",l),{success:!1,error:l.message}}},async acceptResponse(e,r){try{const{error:i}=await D.from("entraide_request_responses").update({status:"accepted"}).eq("id",e);if(i)throw i;await D.from("entraide_request_responses").update({status:"declined"}).eq("request_id",r).neq("id",e).eq("status","proposed");const{error:n}=await D.from("entraide_requests").update({status:"fulfilled",updated_at:new Date().toISOString()}).eq("id",r);if(n)throw n;return{success:!0}}catch(i){return console.error("EntraideService.acceptResponse error:",i),{success:!1,error:i.message}}},async getRequestResponses(e){try{const{data:r,error:i}=await D.from("entraide_request_responses").select(` 2467 *, 2468 responder:profiles!responder_id (id, name, avatar_url, friend_avatar_url) 2469 `).eq("request_id",e).order("created_at",{ascending:!0});if(i)throw i;return{success:!0,data:r||[]}}catch(r){return console.error("EntraideService.getRequestResponses error:",r),{success:!1,error:r.message,data:[]}}}},JP=({segments:e,speed:r=80,onFinish:i})=>{const[n,o]=m.useState(0),{lightMode:a}=dr(),l=e.reduce((p,u)=>p+u.text.split(" ").filter(Boolean).length,0);m.useEffect(()=>{o(0);const p=setInterval(()=>{o(u=>u>=l?(clearInterval(p),i==null||i(),u):u+1)},r);return()=>clearInterval(p)},[e,r,l]);let d=0;return t.jsxs("div",{style:{fontSize:"0.95rem",lineHeight:1.65,fontWeight:"600",textAlign:"left",padding:"0",textShadow:a?"none":"0 2px 8px rgba(0,0,0,0.5)"},children:[e.map((p,u)=>p.text.split(" ").filter(Boolean).map((h,x)=>{const y=d++,_=y<n,S=y===n-1;return t.jsxs(ye.span,{initial:{opacity:0,scale:1.15,y:4},animate:_?{opacity:1,scale:1,y:0}:{opacity:0,scale:1.15,y:4},transition:{duration:.18,ease:"easeOut"},style:{display:"inline",color:p.color||(a?"rgba(60,50,35,0.9)":"rgba(255,255,255,0.9)"),fontWeight:p.bold?"800":"600",fontSize:p.big?"1.15rem":void 0,...S?{filter:"brightness(1.3)"}:{}},children:[h," "]},`${u}-${x}`)})),n<l&&t.jsx(ye.span,{animate:{opacity:[1,0,1]},transition:{repeat:1/0,duration:.8},style:{color:"#FFD700",fontWeight:"800"},children:"â"})]})},ZP=()=>{var Fe,ft;const e=Lt(),{mode:r,setMode:i,lightMode:n}=dr(),{profile:o,user:a}=gr(),l=xn(),[d,p]=m.useState({profileViews:0,likesReceived:0,unreadMessages:0,upcomingEvents:0}),[u,g]=m.useState(null),[h,x]=m.useState(null),[y,_]=m.useState([]),[S,k]=m.useState([]),[w,b]=m.useState(!1),[j,T]=m.useState(!1),[P,I]=m.useState(!1),[R,O]=m.useState(null),[E,$]=m.useState(!0),[B,ee]=m.useState(0),[te,K]=m.useState([]),[ne,Re]=m.useState(null),[Q,G]=m.useState([]),[le,F]=m.useState(""),[A,M]=m.useState(!1),[V,H]=m.useState(0),{showTutorial:N,markAsSeen:Z}=y0("tuto_home"),ae=m.useRef(null),X=m.useRef(null),he=[{title:"⨠Bienvenue sur l'Accueil ! â¨",description:"Ravi de te voir ! C'est ici que tu peux suivre l'actualité de ton Espace et découvrir en un clin d'Åil ce qui se passe près de toi.",icon:Xt},{title:"Ton Assistant IA",description:"En haut de la page se trouve ton animateur virtuel. Clique dessus pour discuter, il est là pour t'aider et te conseiller !",icon:Kn,targetRef
2469:ae},{title:"Les Stories",description:"Partage des photos ou des pensées éphémères (24h) avec les membres de ton Espace. C'est l'endroit idéal pour briser la glace !",icon:pi,targetRef:X}],Ae=(r==="EROX"?o==null?void 0:o.erox_name:r==="FRIEND"?o==null?void 0:o.friend_name:null)||(o==null?void 0:o.name)||((Fe=a==null?void 0:a.user_metadata)==null?void 0:Fe.name)||((ft=a==null?void 0:a.email)==null?void 0:ft.split("@")[0])||"Membre";m.useEffect(()=>{window.scrollTo(0,0)},[]);const ze=m.useRef(Math.random());m.useEffect(()=>{ze.current=Math.random(),I(!1)},[r]),m.useEffect(()=>{const De=(o==null?void 0:o.id)||(a==null?void 0:a.id);if(!De)return;const Be=r.toLowerCase();(async()=>{var He,be;$(!0),x(null),g(null);try{const nt=await Promise.allSettled([D.from("profile_views").select("*",{count:"exact",head:!0}).eq("viewed_id",De),D.from("likes").select("*",{count:"exact",head:!0}).eq("receiver_id",De),D.from("events").select("id, title, date, image_url, mode, spaces").or(`spaces.cs.["${Be}"],mode.eq.${Be}`).gte("date",new Date().toISOString()).order("date",{ascending:!0}).limit(5),D.from("messages").select("*",{count:"exact",head:!0}).eq("receiver_id",De).eq("is_read",!1),D.from("bot_assignments").select("bot_id, space").eq("user_id",De),D.from("profiles").select("id, name, avatar_url, photo, age, tags, erox_tags, friend_tags, city, animated_photo_url, friend_avatar_url, erox_avatar_url").neq("id",De).limit(20),D.from("likes").select("receiver_id").eq("sender_id",De),D.from("entraide_services").select("id, title, category, price_meetips, price_euros, price_type, image_url, avg_rating, total_ratings, location, provider:profiles!provider_id (id, name, avatar_url, friend_avatar_url)").eq("status","active").order("created_at",{ascending:!1}).limit(10)]),J=vt=>{var ut;return((ut=nt[vt])==null?void 0:ut.status)==="fulfilled"?nt[vt].value:null},Ie=J(0),z=J(1),Y=J(2),ce=J(3),ve=J(4),pe=J(5),$e=J(6),Xe=J(7);k((Xe==null?void 0:Xe.data)||[]),p({profileViews:(Ie==null?void 0:Ie.count)||0,likesReceived:(z==null?void 0:z.count)||0,upcomingEvents:((He=Y==null?void 0:Y.data)==null?void 0:He.length)||0,unreadMessages:(ce==null?void 0:ce.count)||0}),_((Y==null?void 0:Y.data)||[]);const tt=(ve==null?void 0:ve.data)||[],gt=tt.find(vt=>{var ut;return((ut=vt.space)==null?void 0:ut.toUpperCase())===r})||tt[0];if(gt){const vt=gt.bot_id,{data:ut}=await D.from("matches").select("id, name, photo_url, photos_eros, animated_photo_url, personality").eq("id",vt).maybeSingle();ut&&g({...ut,avatar_url:((be=ut.photos_eros)==null?void 0:be[0])||ut.photo_url})}const at=new Set((($e==null?void 0:$e.data)||[]).map(vt=>vt.receiver_id)),Pt=((pe==null?void 0:pe.data)||[]).filter(vt=>!at.has(vt.id)&&vt.name);if(Pt.length>0&&(o!=null&&o.tags)){const vt=new Set(Array.isArray(o.tags)?o.tags:[]),ut=Pt.map(Wt=>{const Rr=(Array.isArray(Wt.tags)?Wt.tags:[]).filter(Dr=>vt.has(Dr));return{...Wt,commonTags:Rr.length,commonTagsList:Rr}}).sort((Wt,dt)=>dt.commonTags-Wt.commonTags);x(ut[0].commonTags>0?ut[0]:ut[Math.floor(Math.random()*Math.min(5,ut.length))])}}catch(nt){console.error("Home fetchAll error:",nt)}finally{$(!1)}})()},[o==null?void 0:o.id,a==null?void 0:a.id,r]),m.useEffect(()=>{(async()=>{const{data:Be}=await D.from("blog_posts").select("id, title, slug, excerpt, cover_image_url, category, author_name, published_at, likes_count, content").lte("published_at",new Date().toISOString()).order("published_at",{ascending:!1}).limit(8);Be&&K(Be)})()},[]);const ue=async De=>{Re(De),H(De.likes_count||0),M(!1),F("");const{data:Be}=await D.from("blog_comments").select("*").eq("post_id",De.id).order("created_at",{ascending:!0});if(G(Be||[]),a!=null&&a.id){const{data:re}=await D.from("blog_likes").select("id").eq("post_id",De.id).eq("user_id",a.id).maybeSingle();M(!!re)}},xe=async()=>{!(a!=null&&a.id)||!ne||(A?(await D.from("blog_likes").delete().eq("post_id",ne.id).eq("user_id",a.id),M(!1),H(De=>Math.max(0,De-1))):(await D.from("blog_likes").insert({post_id:ne.id,user_id:a.id}),M(!0),H(De=>De+1)))},ke=async()=>{if(!(a!=null&&a.id)||!ne||!le.trim())return;const De=(o==null?void 0:o.name)||(o==null?void 0:o.first_name)||"Membre",Be=(o==null?void 0:o.photo_url)||(o==null?void 0:o.avatar_url)||"",{data:re,error:He}=await D.from("blog_comments").insert({post_id:ne.id,user_id:a.id,user_name:De,user_avatar:Be,content:le.trim()}).select().single();!He&&re&&(G(be=>[...be,re]),F(""))},Pe=De=>{const Be=[];let re=De,He=0;for(;re.length>0;){const be=re.match(/\*\*(.+?)\*\*/),nt=re.match(new RegExp("(?<!\\*)\\*(?!\\*)(.+?)(?<!\\*)\\*(?!\\*)")),J=[be,nt].filter(
2469Boolean).sort((z,Y)=>re.indexOf(z[0])-re.indexOf(Y[0]))[0];if(!J){Be.push(t.jsx("span",{children:re},He++));break}const Ie=re.indexOf(J[0]);Ie>0&&Be.push(t.jsx("span",{children:re.slice(0,Ie)},He++)),J===be?Be.push(t.jsx("strong",{style:{color:"white",fontWeight:700},children:J[1]},He++)):Be.push(t.jsx("em",{style:{fontStyle:"italic",color:"rgba(255,255,255,0.6)"},children:J[1]},He++)),re=re.slice(Ie+J[0].length)}return Be},Ce=De=>De?De.split(` 2470`).map((Be,re)=>{const He=Be.trim();return He.startsWith("#### ")?t.jsx("h4",{style:{fontSize:"1rem",fontWeight:700,color:"#D4C5A0",margin:"18px 0 6px"},children:Pe(He.slice(5))},re):He.startsWith("### ")?t.jsx("h3",{style:{fontSize:"1.1rem",fontWeight:800,color:"#D4C5A0",margin:"20px 0 8px"},children:Pe(He.slice(4))},re):He.startsWith("## ")?t.jsx("h2",{style:{fontSize:"1.3rem",fontWeight:900,color:"white",margin:"24px 0 10px"},children:Pe(He.slice(3))},re):He.startsWith("> ")?t.jsx("blockquote",{style:{borderLeft:"3px solid #D4C5A0",paddingLeft:"14px",margin:"16px 0",fontStyle:"italic",color:"rgba(255,255,255,0.6)"},children:Pe(He.slice(2))},re):He==="---"?t.jsx("hr",{style:{border:"none",borderTop:"1px solid rgba(255,255,255,0.1)",margin:"20px 0"}},re):He.startsWith("- ")?t.jsxs("div",{style:{display:"flex",gap:"6px",margin:"4px 0",paddingLeft:"4px"},children:[t.jsx("span",{style:{color:"#D4C5A0"},children:"â¢"}),t.jsx("span",{style:{color:"rgba(255,255,255,0.7)",lineHeight:1.5},children:Pe(He.slice(2))})]},re):He===""?t.jsx("div",{style:{height:"6px"}},re):t.jsx("p",{style:{color:"rgba(255,255,255,0.7)",lineHeight:1.6,margin:"6px 0",fontSize:"0.92rem"},children:Pe(He)},re)}):null,Me=m.useMemo(()=>{if(E)return[];const De=J=>J[Math.floor(ze.current*J.length)],Be=[],re=new Date().getHours(),He=J=>n?`rgba(60,50,35,${J})`:`rgba(255,255,255,${J})`,be={EROS:re<12?["Salut","Coucou","Hey"]:re<18?["Hey","Coucou","Salut"]:["Bonsoir","Hey","Coucou"],FRIEND:re<12?["Salut","Yo","Hey"]:re<18?["Hey","Salut","Coucou"]:["Hey","Salut","Bonsoir"],EROX:re<12?["Hey","Salut toi","Coucou"]:re<18?["Hey","Salut toi","Coucou"]:["Bonsoir","Hey toi","Salut"]};Be.push({text:De(be[r]||be.EROS),color:He(.85)}),Be.push({text:`${Ae}`,color:"#c084fc",bold:!0,big:!0}),Be.push({text:r==="EROX"?"! ð":r==="FRIEND"?"! ð":"! â¨",color:He(.9)});const nt=d.profileViews>0||d.likesReceived>0;if(nt){const J={EROS:["Ãcoute, j'ai de bonnes nouvelles pour toi...","J'ai quelques petites choses à te raconter...","Devine quoi ? Des choses sympas se sont passées !"],FRIEND:["Alors, du nouveau dans la commu...","La team s'agrandit, regarde un peu...","Y'a du mouvement par ici..."],EROX:["Ãa bouge pas mal de ton côté...","J'ai des news croustillantes pour toi...","Laisse-moi te dire, ça chauffe..."]};Be.push({text:De(J[r]||J.EROS),color:He(.65)})}if(d.profileViews>0){const J={EROS:d.profileViews>=10?"Tu fais tourner des têtes :":null,FRIEND:d.profileViews>=10?"Ta bonne humeur attire du monde :":null,EROX:d.profileViews>=10?"Ton profil fait parler de lui :":null};J[r]&&Be.push({text:J[r],color:He(.7)}),Be.push({text:`${d.profileViews}`,color:"#FFD700",bold:!0,big:!0}),Be.push({text:d.profileViews>1?"personnes ont vu ton profil ! ð":"personne a vu ton profil.",color:He(.7)})}if(d.likesReceived>0)if(d.likesReceived>=3){const J={EROS:"Et entre nous... tu plais beaucoup ð",FRIEND:"On dirait que t'as la cote ! ð¤",EROX:"Ãa chauffe pour toi... ð¥"};Be.push({text:`${d.likesReceived}`,color:"#ff6b9d",bold:!0,big:!0}),Be.push({text:J[r]||J.EROS,color:He(.75)})}else Be.push({text:"Tu as reçu",color:He(.7)}),Be.push({text:`${d.likesReceived}`,color:"#ff6b9d",bold:!0,big:!0}),Be.push({text:d.likesReceived>1?"likes ! â¤ï¸":"like ! â¤ï¸",color:He(.75)});if(d.upcomingEvents>0){const J={EROS:["Au fait, il y a","Sinon j'ai vu que","Une info sympa :"],FRIEND:["Côté sorties,","Pour s'amuser,","Hey,"],EROX:["Pour pimenter les choses,","Côté soirées,","Un truc qui devrait te plaire :"]};Be.push({text:De(J[r]||J.EROS),color:He(.6)}),Be.push({text:`${d.upcomingEvents}`,color:"#8B5CF6",bold:!0,big:!0}),Be.push({text:d.upcomingEvents>1?"sorties arrivent bientôt ð":"sortie arrive bientôt ð",color:He(.7)})}if(h){const J={EROS:["Entre nous, je crois que tu pourrais craquer pour","J'ai repéré un profil intéressant :","Tiens, quelqu'un qui devrait te plaire :"],FRIEND:["Je pense que tu pourrais bien t'entendre avec","Y'a quelqu'un de cool à découvrir :","Jette un Åil à ce profil :"],EROX:["Celui-là devrait te faire de l'effet :","J'ai trouvé quelqu'un d'irrésistible :","Regarde un peu ce profil ð"]};Be.push({text:De(J[r]||J.EROS),color:He(.65)}),Be.push({text:h.name,color:"#4DD0E1",bold:!0,big:!0}),h.commonTags>0&&(Be.push({text:"â",color:He(.4)}),Be.push({text:`${h.commonTags}`,color:"#FFD700",bold:!0}),Be.push({text:h.commonTags>1?"passions en commun ! â¨":"passion en commun ! â¨",color:He(.7)}))}if(!nt&&!h){const J={EROS:"C'est calme pour le moment, mais les belles rencontres arrivent souvent quand on s'y attend le moins... ð",FRIEND:"Rien de nouveau pour le moment, mais la commu est active, reste dans le coin ! ð¤",EROX:"C'est tranquille pour l'instant... mais ça ne va pas durer longtemps ð"};Be.push({text:J[r]||J.EROS,color:He(.6)})}return Be},[E,Ae,d.profileViews,d.likesReceived,d.upcomingEvents,h==null?void 0:h.id,r,n]);u&&(Ho[u.personality]||Ho.bienveillant);const Le=r==="EROX"?{glowA:"rgba(255,51,51,0.1)",glowB:"rgba(255,100,100,0.06)",accentBar:"linear-gradient(90deg, transparent, #ff4d4d, #ff6b6b, #ff9999, transparent)",suggestGradient:"linear-gradient(135deg, rgba(255,77,77,0.08), rgba(255,100,100,0.05))",suggestBorder:"rgba(255,77,77,0.15)",suggestAccent:"#ff4d4d",suggestBadgeBg:"linear-gradient(135deg, #ff4d4d, #cc0000)",eventsHeaderBg:"linear-gradient(135deg, #ff4d4d, #cc0000)",seeAllColor:"#ff6b6b"}
2470:r==="FRIEND"?{glowA:"rgba(38,166,154,0.1)",glowB:"rgba(77,182,172,0.06)",accentBar:"linear-gradient(90deg, transparent, #26A69A, #4DB6AC, #80CBC4, transparent)",suggestGradient:"linear-gradient(135deg, rgba(38,166,154,0.08), rgba(77,182,172,0.05))",suggestBorder:"rgba(38,166,154,0.15)",suggestAccent:"#26A69A",suggestBadgeBg:"linear-gradient(135deg, #26A69A, #00796B)",eventsHeaderBg:"linear-gradient(135deg, #26A69A, #00796B)",seeAllColor:"#4DB6AC"}:{glowA:"rgba(212,165,116,0.1)",glowB:"rgba(232,201,160,0.06)",accentBar:"linear-gradient(90deg, transparent, #D4A574, #E8C9A0, #FFD700, transparent)",suggestGradient:"linear-gradient(135deg, rgba(212,165,116,0.08), rgba(197,168,128,0.05))",suggestBorder:"rgba(212,165,116,0.15)",suggestAccent:"#D4A574",suggestBadgeBg:"linear-gradient(135deg, #D4A574, #C5935E)",eventsHeaderBg:"linear-gradient(135deg, #D4A574, #C5935E)",seeAllColor:"#E8C9A0"},rt=[{icon:cr,label:"Créer une sortie",color:"#8B5CF6",path:"/events"},{icon:jh,label:"Proposer un service",color:"#26A69A",path:"/entraide"},{icon:qo,label:"Chercher un service",color:"#06B6D4",path:"/entraide"},{icon:pi,label:"Ajouter une photo",color:"#EC4899",path:"/edit-criteria"},{icon:ys,label:"Recharger Meetips",color:"#FFD700",path:"/shop"}];return t.jsxs("div",{style:{minHeight:"100vh",width:"100%",background:n?"#FAF7F2":"#0A0A14",fontFamily:"Outfit, sans-serif",color:n?"#2A2520":"white",overflowX:"hidden",paddingTop:l?"75px":"85px"},children:[t.jsx(b0,{isOpen:N,onClose:Z,steps:he}),t.jsx("div",{style:{position:"fixed",top:"-100px",left:"-60px",width:"300px",height:"300px",background:`radial-gradient(circle, ${Le.glowA}, transparent 70%)`,pointerEvents:"none",zIndex:0,filter:"blur(40px)"}}),t.jsx("div",{style:{position:"fixed",bottom:"100px",right:"-80px",width:"300px",height:"300px",background:`radial-gradient(circle, ${Le.glowB}, transparent 70%)`,pointerEvents:"none",zIndex:0,filter:"blur(40px)"}}),t.jsxs("div",{style:{maxWidth:"600px",margin:"0 auto",padding:l?"8px 16px 120px":"20px 30px 120px",position:"relative",zIndex:1},children:[t.jsxs(ye.div,{ref:ae,initial:{opacity:0,y:-15},animate:{opacity:1,y:0},transition:{duration:.6},style:{borderRadius:"20px",overflow:"hidden",background:n?"linear-gradient(135deg, rgba(250,247,242,0.98) 0%, rgba(240,235,225,0.98) 100%)":"linear-gradient(135deg, rgba(15,8,30,0.95) 0%, rgba(10,10,20,0.98) 100%)",border:n?"2px solid rgba(140,115,75,0.35)":"1px solid rgba(139,92,246,0.2)",marginBottom:"20px",position:"relative",boxShadow:n?"0 4px 20px rgba(120,100,60,0.1)":"0 8px 40px rgba(0,0,0,0.4)"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"3px",background:Le.accentBar,opacity:.8,zIndex:3}}),t.jsxs("div",{style:{display:"flex",flexDirection:l?"column":"row",minHeight:l?"auto":"200px"},children:[t.jsxs(ye.div,{initial:{scale:1.05,opacity:0},animate:{scale:1,opacity:1},transition:{delay:.15,duration:.5},onClick:()=>{u&&O({...u,is_bot:!0,assigned_space:r})},style:{flex:l?"none":"0 0 45%",position:"relative",overflow:"hidden",aspectRatio:"16/9",background:n?"#F5F0E8":"#0a0515",cursor:u?"pointer":"default"},children:[u!=null&&u.animated_photo_url?t.jsx("video",{src:u.animated_photo_url,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"center 20%"}}):t.jsx("img",{src:(u==null?void 0:u.avatar_url)||(u==null?void 0:u.photo_url)||"",alt:(u==null?void 0:u.name)||"Assistant",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"center 20%"}}),t.jsx("div",{style:{position:"absolute",inset:0,background:l?n?"linear-gradient(to top, rgba(250,247,242,0.9) 0%, transparent 50%)":"linear-gradient(to top, rgba(10,5,20,0.9) 0%, transparent 50%)":n?"linear-gradient(to right, transparent 50%, rgba(250,247,242,0.95) 100%)":"linear-gradient(to right, transparent 50%, rgba(10,5,20,0.95) 100%)",pointerEvents:"none"}}),t.jsxs("div",{style:{position:"absolute",top:"12px",left:"12px",zIndex:4,display:"flex",alignItems:"center",gap:"6px",background:n?"rgba(250,247,242,0.85)":"rgba(0,0,0,0.6)",backdropFilter:"blur(8px)",borderRadius:"10px",padding:"4px 10px"},children:[t.jsx("div",{style:{width:"7px",height:"7px",borderRadius:"50%",background:"#22c55e",boxShadow:"0 0 8px rgba(34,197,94,0.8)",animation:"pulse 2s ease-in-out infinite"}}),t.jsx("span",{style:{fontSize:"0.62rem",fontWeight:"800",color:"#22c55e",letterSpacing:"1px"},children:"EN DIRECT"})]}),t.jsxs("div",{style:{position:"absolute",bottom:"10px",left:"10px",zIndex:4,background:r==="EROX"?"rgba(220,38,38,0.9)":r==="FRIEND"?"rgba(38,166,
2470154,0.9)":"rgba(197,160,101,0.9)",backdropFilter:"blur(8px)",borderRadius:"10px",padding:"4px 12px",display:"flex",alignItems:"center",gap:"5px"},children:[t.jsx(Kn,{size:11,color:"white"}),t.jsxs("span",{style:{fontSize:"0.7rem",fontWeight:"800",color:"white"},children:[(u==null?void 0:u.name)||"Assistant",", ton référent sur l'espace ",r==="EROX"?"MEETapps Erox":r==="FRIEND"?"MEETapps Friend":"MEETapps Eros"]})]})]}),t.jsx("div",{style:{flex:1,padding:l?"16px 16px 18px":"20px 22px",display:"flex",flexDirection:"column",justifyContent:"center",position:"relative",minHeight:l?"100px":"auto"},children:E?t.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},children:t.jsx(ye.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1,ease:"linear"},children:t.jsx(Xt,{size:22,color:"#8B5CF6"})})}):t.jsx(ye.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.4},children:t.jsx(JP,{segments:Me,speed:75,onFinish:()=>I(!0)})})})]}),t.jsx("style",{children:` 2471 @keyframes pulse { 2472 0%, 100% { opacity: 1; transform: scale(1); } 2473 50% { opacity: 0.5; transform: scale(1.4); } 2474 } 2475 `})]}),t.jsx(tr,{children:h&&t.jsxs(ye.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},transition:{delay:.5},style:{marginBottom:"20px"},children:[t.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"10px"},children:t.jsxs("h3",{style:{margin:0,fontSize:"0.95rem",fontWeight:"700",display:"flex",alignItems:"center",gap:"8px",fontFamily:"Outfit, sans-serif"},children:[t.jsx("span",{style:{background:Le.suggestBadgeBg,borderRadius:"8px",padding:"4px 6px",display:"flex",alignItems:"center"},children:t.jsx(Xt,{size:14,color:"white"})}),"Profil repéré pour toi"]})}),t.jsxs(ye.div,{whileTap:{scale:.98},onClick:()=>e(`/profile-view/${h.id}`),style:{background:n?"rgba(140,115,75,0.06)":Le.suggestGradient,border:n?"2px solid rgba(140,115,75,0.3)":`1px solid ${Le.suggestBorder}`,borderRadius:"20px",padding:"16px",cursor:"pointer",display:"flex",alignItems:"center",gap:"14px",transition:"all 0.3s"},children:[t.jsx(Mo,{photoUrl:r==="EROX"?h.erox_avatar_url||h.avatar_url||h.photo:r==="FRIEND"?h.friend_avatar_url||h.avatar_url||h.photo:h.avatar_url||h.photo,animatedUrl:h.animated_photo_url,alt:h.name,size:60,borderColor:Le.suggestAccent}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsxs("div",{style:{fontSize:"1.05rem",fontWeight:"700",color:n?"#2A2520":"white",marginBottom:"3px",display:"flex",alignItems:"center",gap:"6px"},children:[h.name,h.age&&t.jsxs("span",{style:{fontSize:"0.82rem",color:n?"#8C7A60":"rgba(255,255,255,0.4)",fontWeight:"500"},children:[h.age," ans"]})]}),h.city&&t.jsxs("div",{style:{fontSize:"0.75rem",color:n?"#8C7A60":"rgba(255,255,255,0.4)",display:"flex",alignItems:"center",gap:"3px",marginBottom:"6px"},children:[t.jsx(ur,{size:11})," ",h.city]}),h.commonTags>0&&t.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"5px",background:"rgba(255,215,0,0.12)",border:"1px solid rgba(255,215,0,0.2)",borderRadius:"10px",padding:"3px 10px",fontSize:"0.72rem",fontWeight:"700",color:"#FFD700"},children:[t.jsx(nr,{size:11,fill:"#FFD700"}),h.commonTags," passion",h.commonTags>1?"s":""," en commun"]})]}),t.jsx(En,{size:18,style:{color:"rgba(255,255,255,0.2)",flexShrink:0}})]})]})}),y.length>0&&t.jsxs(ye.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.6},style:{marginBottom:"24px"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"},children:[t.jsxs("h3",{style:{margin:0,fontSize:"0.95rem",fontWeight:"700",display:"flex",alignItems:"center",gap:"8px",fontFamily:"Outfit, sans-serif"},children:[t.jsx("span",{style:{background:Le.eventsHeaderBg,borderRadius:"8px",padding:"4px 6px",display:"flex",alignItems:"center"},children:t.jsx(cr,{size:14,color:"white"})}),"Prochaines sorties"]}),t.jsxs("span",{onClick:()=>e("/events"),style:{fontSize:"0.78rem",color:Le.seeAllColor,cursor:"pointer",display:"flex",alignItems:"center",gap:"4px",fontWeight:"600"},children:["Tout voir ",t.jsx(En,{size:14})]})]}),t.jsx("div",{style:{display:"flex",gap:"10px",overflowX:"auto",paddingBottom:"4px"},children:y.map((De,Be)=>{const re=new Date(De.date),He=re.getDate(),be=re.toLocaleDateString("fr-FR",{month:"short"}),nt=De.mode==="erox"?"#ff3333":De.mode==="friend"?"#26A69A":"#8B
24755CF6";return t.jsxs(ye.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.65+Be*.1},onClick:()=>e("/events"),style:{flex:"0 0 auto",width:l?"155px":"180px",background:n?"rgba(140,115,75,0.06)":`linear-gradient(180deg, ${nt}15, rgba(255,255,255,0.02))`,border:n?"2px solid rgba(140,115,75,0.3)":`1px solid ${nt}20`,borderRadius:"16px",overflow:"hidden",cursor:"pointer",transition:"all 0.3s"},children:[t.jsx("div",{style:{height:"78px",background:De.image_url?`url(${De.image_url}) center/cover`:`linear-gradient(135deg, ${nt}40, ${nt}15)`,position:"relative"},children:t.jsxs("div",{style:{position:"absolute",bottom:"6px",left:"6px",background:"rgba(0,0,0,0.75)",backdropFilter:"blur(8px)",borderRadius:"8px",padding:"3px 8px",fontSize:"0.7rem",fontWeight:"700",color:"white"},children:[He," ",be]})}),t.jsx("div",{style:{padding:"10px 12px"},children:t.jsx("div",{style:{fontSize:"0.78rem",fontWeight:"600",color:n?"#2A2520":"white",lineHeight:1.3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:De.title})})]},De.id)})})]}),S.length>0&&t.jsxs(ye.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.65},style:{marginBottom:"24px"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"},children:[t.jsxs("h3",{style:{margin:0,fontSize:"0.95rem",fontWeight:"700",display:"flex",alignItems:"center",gap:"8px",fontFamily:"Outfit, sans-serif"},children:[t.jsx("span",{style:{background:"linear-gradient(135deg, #26A69A, #00796B)",borderRadius:"8px",padding:"4px 6px",display:"flex",alignItems:"center"},children:t.jsx(jh,{size:14,color:"white"})}),"Services"]}),t.jsxs("span",{onClick:()=>{r!=="FRIEND"?T(!0):e("/entraide")},style:{fontSize:"0.78rem",color:"#26A69A",cursor:"pointer",display:"flex",alignItems:"center",gap:"4px",fontWeight:"600"},children:["Tout voir ",t.jsx(En,{size:14})]})]}),t.jsx("div",{style:{display:"flex",gap:"10px",overflowX:"auto",paddingBottom:"4px",scrollSnapType:"x mandatory"},children:S.map((De,Be)=>{var z,Y;const re=qa.find(ce=>ce.id===De.category),He=(re==null?void 0:re.color)||"#26A69A",be=(re==null?void 0:re.emoji)||"ð",nt=(re==null?void 0:re.label)||De.category,J=((z=De.provider)==null?void 0:z.friend_avatar_url)||((Y=De.provider)==null?void 0:Y.avatar_url),Ie=De.price_type==="euros"?`${De.price_euros||0}â¬`:`${De.price_meetips||0} Meetips`;return t.jsxs(ye.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.7+Be*.08},onClick:()=>{r!=="FRIEND"?T(!0):e("/entraide")},style:{flex:"0 0 auto",width:l?"155px":"180px",background:n?"rgba(38,166,154,0.06)":`linear-gradient(180deg, ${He}15, rgba(255,255,255,0.02))`,border:n?"2px solid rgba(38,166,154,0.25)":`1px solid ${He}25`,borderRadius:"16px",overflow:"hidden",cursor:"pointer",transition:"all 0.3s",scrollSnapAlign:"start"},children:[t.jsxs("div",{style:{height:"85px",background:De.image_url?`url(${De.image_url}) center/cover`:`linear-gradient(135deg, ${He}40, ${He}15)`,position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[!De.image_url&&t.jsx("span",{style:{fontSize:"2rem"},children:be}),t.jsxs("div",{style:{position:"absolute",bottom:"6px",left:"6px",background:He,borderRadius:"8px",padding:"2px 8px",fontSize:"0.6rem",fontWeight:"700",color:"white",display:"flex",alignItems:"center",gap:"3px"},children:[be," ",nt]}),J&&t.jsx("div",{style:{position:"absolute",top:"6px",right:"6px",width:"28px",height:"28px",borderRadius:"50%",backgroundImage:`url(${J})`,backgroundSize:"cover",backgroundPosition:"center",border:"2px solid white",boxShadow:"0 2px 8px rgba(0,0,0,0.3)"}})]}),t.jsxs("div",{style:{padding:"10px 12px"},children:[t.jsx("div",{style:{fontSize:"0.76rem",fontWeight:"600",color:n?"#2A2520":"white",lineHeight:1.3,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",marginBottom:"4px"},children:De.title}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t.jsx("span",{style:{fontSize:"0.7rem",fontWeight:"800",color:He},children:Ie}),De.avg_rating>0&&t.jsxs("span",{style:{fontSize:"0.65rem",color:n?"#8C7A60":"rgba(255,255,255,0.4)",display:"flex",alignItems:"center",gap:"2px"},children:["â ",De.avg_rating]})]})]})]},De.id)})})]}),te.length>0&&t.jsxs(ye.div,{initial:{opacity:0,y:12}
2475,animate:{opacity:1,y:0},transition:{delay:.7},style:{marginBottom:"24px"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"},children:[t.jsxs("h3",{style:{margin:0,fontSize:"0.95rem",fontWeight:"700",display:"flex",alignItems:"center",gap:"8px",fontFamily:"Outfit, sans-serif"},children:[t.jsx("span",{style:{background:"linear-gradient(135deg, #D4C5A0, #BBA57A)",borderRadius:"8px",padding:"4px 6px",display:"flex",alignItems:"center"},children:t.jsx(el,{size:14,color:"#0a0815"})}),"MEETblog"]}),t.jsxs("span",{onClick:()=>e("/app-blog"),style:{fontSize:"0.78rem",color:"#D4C5A0",cursor:"pointer",display:"flex",alignItems:"center",gap:"4px",fontWeight:"600"},children:["Tout voir ",t.jsx(En,{size:14})]})]}),t.jsx("div",{style:{display:"flex",gap:"10px",overflowX:"auto",paddingBottom:"4px",scrollSnapType:"x mandatory"},children:te.map((De,Be)=>t.jsxs(ye.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.75+Be*.08},onClick:()=>ue(De),style:{flex:"0 0 auto",width:l?"155px":"180px",background:n?"rgba(140,115,75,0.06)":"linear-gradient(180deg, rgba(212,197,160,0.08), rgba(255,255,255,0.02))",border:n?"2px solid rgba(140,115,75,0.3)":"1px solid rgba(212,197,160,0.12)",borderRadius:"16px",overflow:"hidden",cursor:"pointer",transition:"all 0.3s",scrollSnapAlign:"start"},children:[t.jsx("div",{style:{height:"85px",background:De.cover_image_url?`url(${De.cover_image_url}) center/cover`:"linear-gradient(135deg, rgba(212,197,160,0.3), rgba(187,165,122,0.15))",position:"relative"},children:t.jsx("div",{style:{position:"absolute",bottom:"6px",left:"6px",background:"rgba(0,0,0,0.75)",backdropFilter:"blur(8px)",borderRadius:"8px",padding:"2px 8px",fontSize:"0.62rem",fontWeight:"700",color:"#D4C5A0",textTransform:"capitalize"},children:De.category})}),t.jsx("div",{style:{padding:"10px 12px"},children:t.jsx("div",{style:{fontSize:"0.76rem",fontWeight:"600",color:n?"#2A2520":"white",lineHeight:1.3,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:De.title})})]},De.id))})]}),t.jsx(tr,{children:ne&&t.jsx(ye.div,{initial:{opacity:0}
2475,animate:{opacity:1},exit:{opacity:0},onClick:()=>Re(null),style:{position:"fixed",inset:0,zIndex:10002,background:"rgba(0,0,0,0.85)",backdropFilter:"blur(8px)",display:"flex",alignItems:"flex-end",justifyContent:"center",padding:l?"0":"20px"},children:t.jsxs(ye.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{type:"spring",damping:25,stiffness:300},onClick:De=>De.stopPropagation(),style:{background:"#0a0815",borderRadius:l?"20px 20px 0 0":"20px",width:"100%",maxWidth:"640px",maxHeight:l?"92vh":"85vh",overflowY:"auto",position:"relative"},children:[t.jsx("button",{onClick:()=>Re(null),style:{position:"sticky",top:"12px",left:"calc(100% - 48px)",zIndex:10,width:"36px",height:"36px",borderRadius:"50%",background:"rgba(0,0,0,0.6)",backdropFilter:"blur(8px)",border:"1px solid rgba(255,255,255,0.15)",color:"white",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(mt,{size:18})}),ne.cover_image_url&&t.jsx("div",{style:{height:"200px",marginTop:"-48px",backgroundImage:`url(${ne.cover_image_url})`,backgroundSize:"cover",backgroundPosition:"center",position:"relative"},children:t.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(transparent 40%, #0a0815 100%)"}})}),t.jsxs("div",{style:{padding:"0 24px 30px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"10px"},children:[t.jsx("span",{style:{background:"rgba(212,197,160,0.15)",color:"#D4C5A0",padding:"3px 12px",borderRadius:"10px",fontSize:"0.72rem",fontWeight:700,textTransform:"capitalize"},children:ne.category}),t.jsx("span",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.3)"},children:new Date(ne.published_at).toLocaleDateString("fr-FR",{day:"numeric",month:"long"})})]}),t.jsx("h2",{style:{fontSize:"clamp(1.2rem, 3.5vw, 1.6rem)",fontWeight:900,lineHeight:1.2,margin:"0 0 6px"},children:ne.title}),t.jsxs("p",{style:{fontSize:"0.78rem",color:"rgba(255,255,255,0.35)",marginBottom:"20px"},children:["Par ",ne.author_name]}),t.jsx("div",{children:Ce(ne.content)}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginTop:"28px",paddingTop:"14px",borderTop:"1px solid rgba(255,255,255,0.08)"},children:[t.jsxs("button",{onClick:xe,style:{display:"flex",alignItems:"center",gap:"5px",background:A?"rgba(255,71,87,0.15)":"rgba(255,255,255,0.06)",border:A?"1px solid rgba(255,71,87,0.3)":"1px solid rgba(255,255,255,0.08)",color:A?"#ff4757":"rgba(255,255,255,0.5)",padding:"8px 14px",borderRadius:"10px",cursor:"pointer",fontFamily:"Outfit",fontWeight:600,fontSize:"0.82rem"},children:[t.jsx(Bt,{size:15,fill:A?"#ff4757":"none"})," ",V]}),t.jsxs("button",{onClick:()=>{const De=`https://meeteros.ai/blog/${ne.slug}`;navigator.share?navigator.share({title:ne.title,url:De}):(navigator.clipboard.writeText(De),alert("Lien copié !"))},style:{display:"flex",alignItems:"center",gap:"5px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.5)",padding:"8px 14px",borderRadius:"10px",cursor:"pointer",fontFamily:"Outfit",fontWeight:600,fontSize:"0.82rem"},children:[t.jsx(u0,{size:14})," Partager"]}),t.jsxs("span",{style:{marginLeft:"auto",color:"rgba(255,255,255,0.25)",fontSize:"0.78rem",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(Qt,{size:13})," ",Q.length]})]}),t.jsxs("div",{style:{marginTop:"20px"},children:[t.jsxs("h4",{style:{fontSize:"1rem",fontWeight:700,marginBottom:"14px"},children:["ð¬ Commentaires (",Q.length,")"]}),a!=null&&a.id?t.jsxs("div",{style:{display:"flex",gap:"10px",marginBottom:"16px"},children:[t.jsx("input",{value:le,onChange:De=>F(De.target.value),placeholder:"Votre avis...",onKeyDown:De=>De.key==="Enter"&&ke(),style:{flex:1,padding:"10px 14px",borderRadius:"12px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"white",fontSize:"0.85rem",fontFamily:"Outfit",outline:"none"}}),t.jsx("button",{onClick:ke,disabled:!le.trim(),style:{padding:"10px 16px",borderRadius:"12px",background:le.trim()?"linear-gradient(135deg, #D4C5A0, #BBA57A)":"rgba(255,255,255,0.06)",border:"none",color:le.trim()?"#0a0815":"rgba(255,255,255,0.3)",fontWeight:700,cursor:le.trim()?"pointer":"default",fontFamily:"Outfit",display:"flex",alignItems:"center",gap:"4px"},children:t.jsx(ji,{size:14})})]}):t.jsx("p",{style:{color:"rgba(255,255,255,0.3)",fontSize:"0.82rem",textAlign:"center",margin:"0 0 12px"},children:"Connectez-vous pour commenter"}),Q.length===0?t.jsx("p",{style:{color:"rgba(255,255,255,0.25)",textAlign:"center",fontSize:"0.82rem"},children:"Soyez le premier à commenter ! ð"}):t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:Q.map(De=>t.jsxs("div",{style:{display:"flex",gap:"10px",padding:"10px",borderRadius:"12px",background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.05)"},children:[t.jsx("div",{style:{width:"30px",height:"30px",borderRadius:"50%",flexShrink:0,background:De.user_avatar?`url(${De.user_avatar}) center/cover`:"linear-gradient(135deg, #667eea, #764ba2)"}}),t.jsxs("div",{style:{flex:1},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginBottom:"3px"},children:[t.jsx("span",{style:{fontWeight:700,fontSize:"0.8rem"},children:De.user_name}),t.jsx("span",{style:{fontSize:"0.65rem",color:"rgba(255,255,255,0.2)"},children:new Date(De.created_at).toLocaleDateString("fr-FR",{day:"numeric",month:"short"})})]}),t.jsx("p",{style:{margin:0,fontSize:"0.82rem",color:"rgba(255,255,255,0.6)",lineHeight:1.4},children:De.content})]})]},De.id))})]})]})]})})}),t.jsx(ye.div,{ref:X,initial:{opacity:0,y:12}
2475,animate:{opacity:1,y:0},transition:{delay:.65},style:{marginBottom:"24px"},children:t.jsx(UP,{space:r},`stories-${r}-${B}`)})]}),t.jsxs("div",{style:{position:"fixed",bottom:l?"calc(105px + env(safe-area-inset-bottom, 0px))":"30px",right:"20px",zIndex:999},children:[t.jsx(tr,{children:w&&t.jsxs(t.Fragment,{children:[t.jsx(ye.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>b(!1),style:{position:"fixed",inset:0,zIndex:998,background:n?"rgba(250,247,242,0.85)":"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"}}),t.jsx("div",{style:{position:"absolute",bottom:"68px",right:0,zIndex:1e3,display:"flex",flexDirection:"column",gap:"8px",alignItems:"flex-end"},children:rt.map((De,Be)=>t.jsxs(ye.div,{initial:{opacity:0,y:20,scale:.8},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.8},transition:{delay:Be*.05},onClick:()=>{b(!1),De.path==="/entraide"&&r!=="FRIEND"?T(!0):e(De.path)},style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer",userSelect:"none"},children:[t.jsx("span",{style:{background:n?"rgba(250,247,242,0.95)":"rgba(20,10,40,0.95)",backdropFilter:"blur(12px)",border:n?`1.5px solid ${De.color}50`:`1px solid ${De.color}30`,borderRadius:"12px",padding:"8px 14px",fontSize:"0.82rem",fontWeight:"700",color:n?"#2A2520":"white",whiteSpace:"nowrap",boxShadow:n?"0 4px 16px rgba(120,100,60,0.15)":"0 4px 16px rgba(0,0,0,0.4)"},children:De.label}),t.jsx("div",{style:{width:"46px",height:"46px",borderRadius:"50%",background:`linear-gradient(135deg, ${De.color}, ${De.color}cc)`,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:`0 4px 20px ${De.color}40`,flexShrink:0},children:t.jsx(De.icon,{size:20,color:"white"})})]},De.label))})]})}),j&&t.jsx("div",{style:{position:"fixed",inset:0,zIndex:10001,background:"rgba(0,0,0,0.8)",backdropFilter:"blur(6px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},onClick:()=>T(!1),children:t.jsxs(ye.div,{initial:{scale:.8,opacity:0}
2475,animate:{scale:1,opacity:1},exit:{scale:.8,opacity:0},onClick:De=>De.stopPropagation(),style:{background:"linear-gradient(180deg, #1a1a2e 0%, #141422 100%)",borderRadius:"24px",padding:"30px 28px",maxWidth:"380px",width:"100%",border:"1px solid rgba(38,166,154,0.2)",boxShadow:"0 20px 60px rgba(0,0,0,0.5)",textAlign:"center"},children:[t.jsx("div",{style:{fontSize:"3rem",marginBottom:"12px"},children:"ð¤"}),t.jsx("h3",{style:{fontFamily:"Outfit",fontSize:"1.3rem",fontWeight:"700",marginBottom:"10px"},children:"Entraide & Services"}),t.jsx("p",{style:{color:"rgba(255,255,255,0.6)",fontSize:"0.9rem",lineHeight:1.6,marginBottom:"6px"},children:"Propose ou cherche un service auprès de la communauté : cours de cuisine, coaching sportif, aide déménagement..."}),t.jsxs("p",{style:{color:"rgba(255,255,255,0.45)",fontSize:"0.82rem",lineHeight:1.5,marginBottom:"24px"},children:["Cette fonctionnalité est disponible dans l'espace ",t.jsx("strong",{style:{color:"#26A69A"},children:"MEETFriend ð¥"}),", l'espace dédié à l'amitié et au partage."]}),t.jsx("button",{onClick:()=>{T(!1),i("FRIEND"),e("/home"),setTimeout(()=>e("/entraide"),100)},style:{width:"100%",padding:"14px",borderRadius:"14px",background:"linear-gradient(135deg, #26A69A, #1a7a70)",border:"none",color:"white",fontWeight:"700",fontSize:"1rem",cursor:"pointer",boxShadow:"0 6px 20px rgba(38,166,154,0.3)",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"transform 0.2s"},children:"ð¥ Aller dans MEETFriend"}),t.jsx("button",{onClick:()=>T(!1),style:{width:"100%",padding:"12px",marginTop:"10px",borderRadius:"12px",background:"transparent",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.5)",fontWeight:"600",fontSize:"0.85rem",cursor:"pointer"},children:"Annuler"})]})}),t.jsx(ye.button,{whileTap:{scale:.9},onClick:()=>{mr(),b(!w)},animate:{rotate:w?45:0},style:{width:"58px",height:"58px",borderRadius:"50%",background:w?"linear-gradient(135deg, #ef4444, #dc2626)":r==="EROX"?"linear-gradient(135deg, #ff3333, #cc0000)":r==="FRIEND"?"linear-gradient(135deg, #26A69A, #1a7a70)":"linear-gradient(135deg, #D4C4A8, #B8A88C)",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:w?"0 6px 30px rgba(239,68,68,0.4)":r==="EROX"?"0 6px 30px rgba(255,51,51,0.4)":r==="FRIEND"?"0 6px 30px rgba(38,166,154,0.4)":"0 6px 30px rgba(212,196,168,0.4)",position:"relative",zIndex:1001,transition:"background 0.3s, box-shadow 0.3s"},children:t.jsx(No,{size:26,color:"white",strokeWidth:2.5})})]}),R&&t.jsx(ll,{match:R,onClose:()=>O(null)}),t.jsx("style",{children:` 2476 @keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } } 2477 `})]})};function YP(e,r){const{gender:i="female",age:n=25,hairColor:o="",hairStyle:a="",ethnicity:l="",bodyType:d="",clothingStyle:p="",customDescription:u=""}=r;let h=`a ${i==="female"?"woman":"man"}, ${n} years old`;return l&&(h+=`, ${l} appearance`),o&&(h+=`, ${o} hair`),a&&(h+=`, ${a} hairstyle`),d&&(h+=`, ${d} body type`),p&&(h+=`, wearing ${p} clothes`),u&&(h+=`. ${u}`),[`Close-up portrait photo of ${h}. Looking at the camera with a natural warm smile. Soft studio-like lighting, slightly blurred background. Perfect for a dating app profile picture. Head and shoulders framing. High quality, shot on iPhone.`,`Lifestyle photo of ${h}. Sitting at a trendy café or restaurant, holding a coffee or drink, looking relaxed and happy. Natural daylight, candid feel. Upper body visible. Shot on smartphone, authentic look.`,`Outdoor photo of ${h}. Walking in a beautiful park or by the water during golden hour. Natural setting, genuine smile, relaxed posture. Full or 3/4 body shot. Warm natural lighting, lifestyle photography style.`][e]+" The person must look real, natural, and approachable. Ultra-realistic photography. No text, no watermark, no artificial elements. Portrait orientation (3:4 aspect ratio)."}async function XP(e){var d,p,u;console.log("ð¨ Generating image with prompt:",e.substring(0,100)+"...");const{data:{session:r}}=await D.auth.getSession(),i="https://bqfzljnhxblhiabyvpqm.supabase.co",n="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4",o=await fetch(`${i}/functions/v1/gemini-proxy`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${(r==null?void 0:r.access_token)||n}`,apikey:n},body:JSON.stringify({model:"gemini-2.5-flash-image",contents:[{parts:[{text:e}]}],generationConfig:{responseModalities:["Text","Image"]},noStream:!0})});if(!o.ok){const g=await o.text();console.error("Gemini Image API error:",o.status,g);try{const x=((d=JSON.parse(g).error)==null?void 0:d.message)||g;throw new Error(x)}catch(h){throw h.message.includes("Gemini")?h:new Error(`Erreur API Gemini (${o.status}): ${g.substring(0,200)}`)}}const a=await o.json();console.log("ð¸ Gemini response received, parsing...");const l=a.candidates||[];for(const g of l){const h=((p=g.content)==null?void 0:p.parts)||[];for(const x of h)if(x.inlineData)return console.log("â Image found, mimeType:",x.inlineData.mimeType),{base64:x.inlineData.data,mimeType:x.inlineData.mimeType||"image/png"}}console.error("â No image in response:",JSON.stringify(a).substring(0,500));for(const g of l){const h=((u=g.content)==null?void 0:u.parts)||[];for(const x of h)if(x.text)throw console.warn("Got text instead of image:",x.text),new Error("Gemini a refusé de générer l'image. Essayez un style différent.");if(g.finishReason==="SAFETY")throw new Error("Image bloquée par les filtres de sécurité. Modifiez la description.")}throw new Error("Aucune image retournée par Gemini. Réessayez.")}
2477async function KP({style:e={},onProgress:r}){const i=[];for(let n=0;n<3;n++){r&&r(n,"generating");const o=YP(n,e);try{const{base64:a,mimeType:l}=await XP(o),d=`data:${l};base64,${a}`;i.push(d),r&&r(n,"done")}catch(a){if(console.error(`Error generating photo ${n+1}:`,a),i.push(null),r&&r(n,"error"),n===0)throw a}}return{previews:i.filter(Boolean)}}const Kd={hairColors:["Blond","Brun","Châtain","Roux","Noir","Gris/Poivre et sel"],hairStyles:["Court","Mi-long","Long","Bouclé","Frisé","Rasé","Dreadlocks","Queue de cheval"],ethnicities:["Européen(ne)","Africain(e)","Asiatique","Latino/Hispanique","Moyen-Oriental(e)","Métisse","Indien(ne)"],bodyTypes:["Mince","Athlétique","Normal","Rond(e)","Musclé(e)"],clothingStyles:["Décontracté/casual","Chic/élégant","Sportif","Bohème","Professionnel/Business"]},x1={eros:{label:"Eros",icon:Bt,color:"#f43f5e",bg:"rgba(244,63,94,0.12)",border:"rgba(244,63,94,0.3)",avatarField:"avatar_url",photosField:"photos",photoFields:["photo_1","photo_2","photo_3"],tagsField:"tags",bioField:"bio"},erox:{label:"Erox",icon:en,color:"#f97316",bg:"rgba(249,115,22,0.12)",border:"rgba(249,115,22,0.3)",avatarField:"erox_avatar_url",photosField:"erox_photos",photoFields:["erox_photo_1","erox_photo_2","erox_photo_3"],tagsField:"erox_tags",bioField:"erox_bio"},friend:{label:"Friend",icon:Ut,color:"#22d3ee",bg:"rgba(34,211,238,0.12)",border:"rgba(34,211,238,0.3)",avatarField:"friend_avatar_url",photosField:"friend_photos",photoFields:["friend_photo_1","friend_photo_2","friend_photo_3"],tagsField:"friend_tags",bioField:"friend_bio"}},QP=({user:e,onClose:r,onUpdate:i})=>{const n=si(),[o,a]=m.useState(!1),[l,d]=m.useState("eros"),u=(()=>{const k=[];for(const[w,b]of Object.entries(x1)){const j=e[b.avatarField],T=e[b.photosField],P=b.photoFields.map(E=>e[E]).filter(Boolean),I=e[b.tagsField],R=e[b.bioField],O=j||T&&T.length>0||P.length>0||I&&I.length>0||R;k.push({key:w,...b,hasContent:O,avatar:j,photos:T||[],photoFields:P,tags:I||[],bio:R})}return k})(),g=u.find(k=>k.key===l)||u[0],h=k=>{const w=[];return k.avatar&&w.push(k.avatar),k.key==="eros"&&e.photo&&!w.includes(e.photo)&&w.push(e.photo),k.photoFields.forEach(b=>{b&&!w.includes(b)&&w.push(b)}),k.photos.forEach(b=>{b&&!w.includes(b)&&w.push(b)}),w},x=h(g),y=async(k,w)=>{var b;if(confirm("Voulez-vous vraiment supprimer cette photo ?"))try{a(!0);const j={},T=x1[w.key];if((b=e[T.photosField])!=null&&b.includes(k)&&(j[T.photosField]=e[T.photosField].filter(P=>P!==k)),e[T.avatarField]===k&&(j[T.avatarField]=null),T.photoFields.forEach(P=>{e[P]===k&&(j[P]=null)}),w.key==="eros"&&e.photo===k&&(j.photo=null),Object.keys(j).length>0){const{error:P}=await D.from("profiles").update(j).eq("id",e.id);if(P)throw P;i({...e,...j}),n.success("Photo supprimée.")}}catch(j){console.error("Error deleting photo:",j),n.error("Erreur: "+j.message)}finally{a(!1)}},_=async()=>{const k=prompt("Raison de la restriction (visible par l'utilisateur) :","Photo inappropriée");if(k)try{a(!0);const{error:w}=await D.rpc("admin_restrict_user",{target_user_id:e.id,reason:k});if(w)throw w;const b={...e,restriction_status:"restricted",restriction_reason:k};i(b),await OS(e.id,e.email,k),alert("Utilisateur restreint et notifié par email.")}catch(w){console.error("Error restricting user:",w),n.error("Erreur: "+w.message)}finally{a(!1)}},S=async()=>{if(confirm("Voulez-vous lever la restriction et réhabiliter ce compte ?"))try{a(!0);const{error:k}=await D.rpc("admin_restore_user",{target_user_id:e.id});if(k)throw k;const w={...e,restriction_status:"none",restriction_reason:null};i(w),await LS(e.id,e.email),n.success("Compte réhabilité et utilisateur notifié.")}catch(k){console.error("Error restoring user:",k),n.error("Erreur: "+k.message)}finally{a(!1)}};return t.jsx("div",{style:{position:"fixed",inset:0,zIndex:2e3,background:"rgba(0,0,0,0.85)",backdropFilter:"blur(5px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},onClick:r,children:t.jsxs("div",{className:"glass-panel animate-fade-in",onClick:k=>k.stopPropagation(),style:{width:"100%",maxWidth:"900px",maxHeight:"90vh",overflowY:"auto",borderRadius:"20px",position:"relative",padding:"0"},children:[t.jsxs("div",{style:{height:"150px",background:`linear-gradient(135deg, ${g.color}33, #1a1a1a)`,position:"relative",transition:"background 0.3s"},children:[t.jsx("button",{onClick:r,style:{position:"absolute",top:"20px",right:"20px",background:"rgba(0,0,0,0.5)",border:"none",borderRadius:"50%",width:"40px",height:"40px",color:"white",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(mt,{size:24})}),t.jsxs("div",{style:{position:"absolute",bottom:"-50px",left:"40px",display:"flex",alignItems:"end",gap:"20px"},children:[t.jsx("img",{src:g.avatar||e.avatar_url||e.photo||"https://via.placeholder.com/150",alt:e.name,style:{width:"120px",height:"120px",borderRadius:"50%",border:`4px solid ${g.color}`,objectFit:"cover",background:"#333",transition:"border-color 0.3s"}}),t.jsx("div",{style:{marginBottom:"60px"},children:t.jsx("h2",{style:{fontSize:"2rem",textShadow:"0 2px 4px rgba(0,0,0,0.5)"},children:e.name})})]})]}),t.jsxs("div",{style:{padding:"60px 40px 40px 40px"},children:[t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"20px",marginBottom:"30px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",color:"var(--text-muted)"},children:[t.jsx(Vr,{size:18})," ",e.email]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",color:"var(--text-muted)"},children:[t.jsx(c0,{size:18})," ",e.phone||"Non renseigné"]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",color:"var(--text-muted)"},children:[t.jsx(cr,{size:18})," ",e.age?`${e.age} ans`:"?"," ",e.birthdate?`(${new Date(e.birthdate).toLocaleDateString()})`:""]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",color:"var(--text-muted)"},children:[t.jsx(ur,{size:18})," ",e.city||"Non renseigné"]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",color:"var(--text-muted)"},children:[t.jsx(Qn,{size:18})," ",e.job||"Non renseigné"]})]}),t.jsx("div",{style:{display:"flex",gap:"10px",marginBottom:"25px",flexWrap:"wrap"},children:u.map(k=>{const w=k.icon,b=l===k.key,j=h(k).length;return t.jsxs("button",{onClick:()=>d(k.key),style:{display:"flex",alignItems:"center",gap:"8px",padding:"10px 18px",borderRadius:"12px",background:b?k.bg:"rgba(255,255,255,0.05)",border:`2px solid ${b?k.color:"transparent"}`,color:b?k.color:"var(--text-muted)",cursor:"pointer",fontWeight:b?"700":"500",transition:"all 0.2s",fontSize:"0.9rem",opacity:k.hasContent?1:.4},children:[t.jsx(w,{size:18}),t.jsx("span",{children:k.label}),k.hasContent?t.jsxs("span",{style:{background:k.color,color:"white",borderRadius:"8px",padding:"2px 8px",fontSize:"0.7rem",fontWeight:"700"},children:[j," ð¸"]}):t.jsx("span",{style:{fontSize:"0.7rem",opacity:.6},children:"â"})]},k.key)})}),e.restriction_status==="restricted"&&t.jsxs("div",{style:{padding:"10px",background:"#ff4d4d",color:"white",borderRadius:"10px",marginBottom:"20px",fontWeight:"bold",textAlign:"center"},children:["â COMPTE RESTREINT : ",e.restriction_reason]}),e.restriction_status==="pending_review"&&t.jsx("div",{style:{padding:"10px",background:"#3399ff",color:"white",borderRadius:"10px",marginBottom:"20px",fontWeight:"bold",textAlign:"center"},children:"COMPTE EN ATTENTE DE VALIDATION ð®ââï¸"}),t.jsxs("div",{style:{marginBottom:"25px",background:"rgba(255,255,255,0.05)",padding:"20px",borderRadius:"12px"},children:[t.jsxs("h4",{style:{color:g.color,marginBottom:"10px",textTransform:"uppercase",fontSize:"0.8rem"},children:["Bio ",g.label]}),t.jsxs("p",{style:{fontStyle:"italic",lineHeight:"1.6"},children:['"',g.bio||e.bio||"Aucune bio...",'"']})]}),g.tags.length>0&&t.jsxs("div",{style:{marginBottom:"25px"},children:[t.jsxs("h4",{style:{color:g.color,marginBottom:"10px",textTransform:"uppercase",fontSize:"0.8rem"},children:["Tags ",g.label]}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:g.tags.map((k,w)=>t.jsx("span",{style:{padding:"5px 12px",borderRadius:"20px",fontSize:"0.8rem",background:g.bg,color:g.color,border:`1px solid ${g.border}`},children:typeof k=="string"?k:(k==null?void 0:k.label)||(k==null?void 0:k.name)||JSON.stringify(k)},w))})]}),t.jsxs("div",{style:{marginBottom:"25px"},children:[t.jsxs("h4",{style:{color:g.color,marginBottom:"15px",textTransform:"uppercase",fontSize:"0.8rem",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(pi,{size:16})," Photos ",g.label," (",x.length,")"]}),x.length===0?t.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Aucune photo dans cet espace."}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(140px, 1fr))",gap:"15p
2477x"},children:x.map((k,w)=>t.jsxs("div",{style:{position:"relative",borderRadius:"12px",overflow:"hidden",aspectRatio:"2/3",border:`2px solid ${g.border}`},children:[t.jsx("img",{src:k,alt:`${g.label} ${w}`,style:{width:"100%",height:"100%",objectFit:"cover"},onError:b=>{b.target.src="https://via.placeholder.com/150?text=Erreur"}}),w===0&&t.jsx("span",{style:{position:"absolute",bottom:"8px",left:"8px",background:g.color,color:"white",padding:"2px 8px",borderRadius:"6px",fontSize:"0.65rem",fontWeight:"700"},children:"AVATAR"}),t.jsx("button",{onClick:()=>y(k,g),disabled:o,title:"Supprimer cette photo",style:{position:"absolute",top:"8px",right:"8px",background:"rgba(255, 0, 0, 0.8)",color:"white",border:"none",borderRadius:"50%",width:"30px",height:"30px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 2px 5px rgba(0,0,0,0.3)"},children:t.jsx(rn,{size:14})})]},w))})]}),t.jsx("div",{style:{borderTop:"1px solid rgba(255,255,255,0.1)",paddingTop:"20px",display:"flex",gap:"15px"},children:e.restriction_status==="none"||!e.restriction_status?t.jsxs("button",{onClick:_,disabled:o,style:{flex:1,padding:"12px",borderRadius:"8px",background:"rgba(255, 165, 0, 0.15)",color:"orange",border:"1px solid orange",fontWeight:"bold",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px"},children:[t.jsx(ap,{size:18})," Restreindre"]}):t.jsxs("button",{onClick:S,disabled:o,style:{flex:1,padding:"12px",borderRadius:"8px",background:"rgba(50, 205, 50, 0.15)",color:"#32cd32",border:"1px solid #32cd32",fontWeight:"bold",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px"},children:[t.jsx(fi,{size:18})," Réhabiliter (Approuver)"]})})]})]})})},eF=(e,r=1200)=>{const[i,n]=m.useState(0);return m.useEffect(()=>{if(e===0){n(0);return}let o=0;const a=Math.ceil(e/(r/16)),l=setInterval(()=>{o+=a,o>=e?(n(e),clearInterval(l)):n(o)},16);return()=>clearInterval(l)},[e,r]),i},To=({icon:e,label:r,value:i,gradient:n,iconColor:o,delay:a=0,onClick:l})=>{const d=eF(i);return t.jsxs("div",{style:{background:n,borderRadius:"20px",padding:"24px",position:"relative",overflow:"hidden",cursor:l?"pointer":"default",border:"1px solid rgba(255,255,255,0.08)",boxShadow:"0 8px 32px rgba(0,0,0,0.3)",animation:`fadeSlideUp 0.5s ${a}s both ease-out`,transition:"transform 0.3s, box-shadow 0.3s"},onClick:l,onMouseEnter:p=>{p.currentTarget.style.transform="translateY(-4px)",p.currentTarget.style.boxShadow="0 12px 40px rgba(0,0,0,0.4)"},onMouseLeave:p=>{p.currentTarget.style.transform="translateY(0)",p.currentTarget.style.boxShadow="0 8px 32px rgba(0,0,0,0.3)"},children:[t.jsx("div",{style:{position:"absolute",top:"-20px",right:"-20px",opacity:.06},children:t.jsx(e,{size:120})}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px",position:"relative",zIndex:1},children:[t.jsx("div",{style:{background:"rgba(255,255,255,0.15)",borderRadius:"16px",padding:"14px",backdropFilter:"blur(10px)"},children:t.jsx(e,{size:26,color:o||"white"})}),t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"2.2rem",fontWeight:"800",fontFamily:"Outfit",lineHeight:1,letterSpacing:"-1px"},children:d}),t.jsx("div",{style:{fontSize:"0.85rem",opacity:.8,marginTop:"4px",fontWeight:"500"},children:r})]})]})]})},tF=({icon:e,label:r,active:i,onClick:n,badge:o,color:a})=>t.jsxs("button",{onClick:n,className:"admin-tab-btn","data-active":i?"true":"false",style:{display:"flex",alignItems:"center",gap:"10px",padding:"14px 20px",borderRadius:"14px",border:"none",cursor:"pointer",width:"100%",textAlign:"left",background:i?`${a}18`:"transparent",color:i?a:"rgba(255,255,255,0.6)",fontWeight:i?"700":"500",fontSize:"0.9rem",transition:"all 0.25s",position:"relative",borderLeft:i?`3px solid ${a}`:"3px solid transparent"},children:[t.jsx(e,{size:20})," ",t.jsx("span",{className:"tab-label",children:r}),o>0&&t.jsx("span",{style:{marginLeft:"auto",background:a,color:"white",borderRadius:"10px",padding:"2px 8px",fontSize:"0.75rem",fontWeight:"700",minWidth:"22px",textAlign:"center",animation:"pulse 2s infinite"},children:o})]}),rF=()=>{const e=si(),r=Lt(),[i,n]=m.useState({users:0,matches:0,reports:0,premium:0,pending:0,verifications:0}),[o,a]=m.useState("overview"),[l,d]=m.useState([]),[p,u]=m.useState([]),[g,h]=m.useState([]),[x,y]=m.useState([]),[_,S]=m.useState([]),[k,w]=m.useState(!0),[b,j]=m.useState(""),[T,P]=m.useState("all"),[I,R]=m.useState(null),[O,E]=m.useState(!1),[$,B]=m.useState(0),[ee,te]=m.useState([]),[K,ne]=m.useState({male:0,female:0,other:0}
2477),[Re,Q]=m.useState(!1),[G,le]=m.useState([null,null,null]),[F,A]=m.useState([null,null,null]),[M,V]=m.useState(null),[H,N]=m.useState("custom"),[Z,ae]=m.useState(!1),[X,he]=m.useState({sent:0,failed:0,total:0}),[Ae,ze]=m.useState([]),[ue,xe]=m.useState(!1),[ke,Pe]=m.useState(!1),[Ce,Me]=m.useState({space:"all",gender:"all",recentDays:null,city:""}),[Le,rt]=m.useState(""),[Fe,ft]=m.useState(""),[De,Be]=m.useState(""),[re,He]=m.useState(!1),[be,nt]=m.useState(1),[J,Ie]=m.useState("filter"),[z,Y]=m.useState(new Set),[ce,ve]=m.useState(""),[pe,$e]=m.useState([]),[Xe,tt]=m.useState(!1),[gt,at]=m.useState(null),[Pt,vt]=m.useState([]),[ut,Wt]=m.useState(null),[dt,Rr]=m.useState(""),[Dr,Rt]=m.useState(!1),[br,Ht]=m.useState(!1),[or,sr]=m.useState(!1),[Ne,Ze]=m.useState("referrals"),[Et,Ue]=m.useState([]),[St,At]=m.useState([]),[Ft,Gt]=m.useState([]),[fr,It]=m.useState(!1),[jt,Dt]=m.useState(!1),[Nt,jr]=m.useState({code:"",meetips_reward:10,max_uses:"",expires_at:""}),[Zt,kr]=m.useState(null),[xr,Bn]=m.useState(null),[Ti,Zo]=m.useState(null),[no,Yo]=m.useState(null),[Xo,On]=m.useState("Le selfie ne correspond pas à vos photos."),[Ln,mn]=m.useState(!1),[yn,oo]=m.useState(!1),[$n,Vt]=m.useState(""),[qt,Ai]=m.useState({gender:"female",age:25,hairColor:"",hairStyle:"",ethnicity:"",bodyType:"",clothingStyle:"",customDescription:""}),[bn,so]=m.useState(!1),[Jr,Tt]=m.useState(null),[wr,ao]=m.useState(null),[lo,ai]=m.useState(!1),[co,Co]=m.useState(!1),[Si,Br]=m.useState("today"),[ot,Zr]=m.useState({name:"",age:25,gender:"female",job:"",bio:"",space:"EROS",personality:"bienveillant",tags:[],erox_tags:[],friend_tags:[],location:JSON.stringify({lat:48.8566,lng:2.3522})}),[vr,da]=m.useState({transactions:[],gifts:[],dailyRevenue:0,monthlyRevenue:0,yearlyRevenue:0,totalGiftsSent:0,totalGiftsValue:0,totalPacksPurchased:0,recentTransactions:[],userGrowth:[],messagesCount:0,dailySignups:0,weeklySignups:0,monthlySignups:0}),[Yr,js]=m.useState({animatedPhotosCount:0,totalUsers:0,premiumUsers:0,totalPackRevenue:0,totalPremiumRevenue:0,totalUnlockRevenue:0}),[vn,Gi]=m.useState([]),[Wn,ws]=m.useState({}),[an,_s]=m.useState(null),Ss=l.filter(q=>(q.name||"").toLowerCase().includes(b.toLowerCase())||(q.email||"").toLowerCase().includes(b.toLowerCase())?T==="all"?!0:T==="banned"?q.is_banned:T==="restricted"?q.restriction_status==="restricted":T==="pending_review"?q.restriction_status==="pending_review":T==="verified"?q.verification_status==="verified":!0:!1);m.useEffect(()=>{po()},[]);const po=async()=>{try{w(!0);const{count:q}=await D.from("profiles").select("*",{count:"exact",head:!0}),{count:Ge}=await D.from("matches").select("*",{count:"exact",head:!0}),{count:ct}=await D.from("reports").select("*",{count:"exact",head:!0}).eq("status","pending"),{count:et}=await D.from("profiles").select("*",{count:"exact",head:!0}).eq("restriction_status","pending_review"),{count:Qe}=await D.from("profiles").select("*",{count:"exact",head:!0}).eq("verification_status","pending"),{count:bt}=await D.from("profiles").select("*",{count:"exact",head:!0}).eq("is_premium",!0);let Ee=0,We=[];try{const ge=await D.from("support_tickets").select("*",{count:"exact",head:!0}).eq("status","open");ge.error||(Ee=ge.count||0);const oe=await D.from("support_tickets").select("*").order("created_at",{ascending:!1}).limit(50);oe.error||(We=oe.data||[])}catch{}n({users:q||0,matches:Ge||0,reports:ct||0,pending:et||0,verifications:Qe||0,premium:bt||0,support:Ee||0}),Gi(We);const[fe,Se,me,Je,pt]=await Promise.allSettled([D.from("profiles").select("*").order("created_at",{ascending:!1}).limit(50),D.from("matches").select("*").order("created_at",{ascending:!1}),D.from("reports").select("*").order("created_at",{ascending:!1}),D.from("profiles").select("*").eq("restriction_status","pending_review").order("updated_at",{ascending:!1}),D.from("profiles").select("*").eq("verification_status","pending").order("updated_at",{ascending:!1})]),it=fe.status==="fulfilled"&&!fe.value.error?fe.value.data:[],Ke=Se.status==="fulfilled"&&!Se.value.error?Se.value.data:[],W=me.status==="fulfilled"&&!me.value.error?me.value.data:[],se=Je.status==="fulfilled"&&!Je.value.error?Je.value.data:[],we=pt.status==="fulfilled"&&!pt.value.error?pt.value.data:[];if([fe,Se,me,Je,pt].forEach((ge,oe)=>{var ie;ge.status==="rejected"?console.warn(`Admin query ${oe} rejected:`,ge.reason):(ie=ge.value)!=null&&ie.error&&console.warn(`Admin query ${oe} error:`,ge.value.error.message)}),y(se),S(we),it){const ge=it.filter(ie=>ie.gender==="male").length,oe=it.filter(ie=>ie.gender==="female").length;ne({male:ge,female:oe,other:it.length-ge-oe})}if(W&&W.length>0){const ge=[...new Set([...W.map(Oe=>Oe.reporter_id),...W.map(Oe=>Oe.reported_id)])],{data:oe}=await D.from("profiles").select("id, name, email, photo, avatar_url, is_banned").in("id",ge),ie={};oe==null||oe.forEach(Oe=>ie[Oe.id]=Oe),h(W.map(Oe=>({...Oe,reporter:ie[Oe.reporter_id]||{name:"Inconnu"},reported:ie[Oe.reported_id]||{name:"Inconnu"}})))}else h([]);it&&te(it.slice(0,8));try{const ge=new Date,oe=new Date(ge.getFullYear(),ge.getMonth(),ge.getDate()).toISOString(),ie=new Date(ge.getFullYear(),ge.getMonth(),1).toISOString(),Oe=new Date(ge.getFullYear(),0,1).toISOString(),Ve=new Date(ge.setDate(ge.getDate()-ge.getDay())).toISOString(),yt={starter:4.99,regular:7.99,pro:12.99,ultimate:29.99},Mt={60:4.99,95:7.99,130:12.99,350:29.99},lr=9.99,Ot=2.9,[Pi,mi,Yi]=await Promise.allSettled([D.from("meetips_transactions").select("*").order("created_at",{ascending:!1}).limit(200),D.from("user_gifts").select("*").order("created_at",{ascending:!1}).limit(200),D.from("messages").select("*",{count:"exact",head:!0})]),Fi=Pi.status==="fulfilled"&&!Pi.value.error?Pi.value.data:[],Un=mi.status==="fulfilled"&&!mi.value.error?mi.value.data:[],st=Yi.status==="fulfilled"&&!Yi.value.error?Yi.value.count:0,er=Fi.filter(_r=>{var ki;return _r.amount>0&&((ki=_r.description)==null?void 0:ki.startsWith("Achat Pack"))}),ir=(_r,ki)=>_r.filter(Ci=>new Date(Ci.created_at)>=new Date(ki)).reduce((Ci,zo)=>{const Fd=Mt[zo.amount]||0;return Ci+Fd},0),Kr=(it||[]).filter(_r=>_r.is_premium),ga=Kr.filter(_r=>new Date(_r.updated_at||_r.created_at)>=new Date(ie)).length*lr,pl=(it||[]).filter(_r=>new Date(_r.created_at)>=new Date(oe)).length,fa=(it||[]).filter(_r=>new Date(_r.created_at)>=new Date(Ve)).length,Pd=(it||[]).filter(_r=>new Date(_r.created_at)>=new Date(ie)).length,ul=[];for(let _r=5;_r>=0;_r--){const ki=new Date;ki.setMonth(ki.getMonth()-_r);const Ci=new Date(ki.getFullYear(),ki.getMonth(),1),zo=new Date(ki.getFullYear(),ki.getMonth()+1,0),Fd=(it||[]).filter(uo=>
2477{const Ep=new Date(uo.created_at);return Ep>=Ci&&Ep<=zo}).length;ul.push({month:Ci.toLocaleDateString("fr-FR",{month:"short"}),count:Fd})}da({transactions:Fi,gifts:Un,dailyRevenue:ir(er,oe)+(pl>0,0),monthlyRevenue:ir(er,ie)+ga,yearlyRevenue:ir(er,Oe)+Kr.length*lr,totalGiftsSent:Un.length,totalGiftsValue:Un.reduce((_r,ki)=>_r+(ki.cost||0),0),totalPacksPurchased:er.length,recentTransactions:Fi.slice(0,15),userGrowth:ul,messagesCount:st||0,dailySignups:pl,weeklySignups:fa,monthlySignups:Pd});const{count:j0}=await D.from("profiles").select("*",{count:"exact",head:!0}).not("animated_photo_url","is",null),w0=Fi.filter(_r=>{var ki;return _r.amount<0&&((ki=_r.description)==null?void 0:ki.includes("Déverrouillage"))});js({animatedPhotosCount:j0||0,totalUsers:(it==null?void 0:it.length)||0,premiumUsers:Kr.length,totalPackRevenue:ir(er,Oe),totalPremiumRevenue:Kr.length*lr,totalUnlockRevenue:w0.length*Ot})}catch(ge){console.warn("Revenue fetch error:",ge)}d(it||[]),u(Ke||[])}catch(q){console.error("ADMIN FETCH ERROR:",q)}finally{w(!1)}},kt=()=>{Zr({name:"",age:25,gender:"female",job:"",bio:"",space:"EROS",personality:"bienveillant",tags:[],erox_tags:[],friend_tags:[],location:JSON.stringify({lat:48.8566,lng:2.3522})}),le([null,null,null]),A([null,null,null]),V(null)},Ji=(q,Ge)=>{if(!Ge)return;const ct=[...G];ct[q]=Ge,le(ct);const et=[...F];et[q]=URL.createObjectURL(Ge),A(et)},hr=q=>{V(q.id),Zr({name:q.name||"",age:q.age||25,gender:q.gender||"female",job:q.job||"",bio:q.bio||"",space:q.space||"EROS",personality:q.personality||"bienveillant",tags:q.tags||[],erox_tags:q.erox_tags||[],friend_tags:q.friend_tags||[],location:typeof q.location=="string"?q.location:JSON.stringify(q.location||{lat:48.8566,lng:2.3522})});const Ge=(q.space||"EROS").toLowerCase(),ct=q[`photos_${Ge}`]||[];A([ct[0]||q.photo_url||null,ct[1]||null,ct[2]||null]),le([null,null,null]),B(0),E(!0)},dl=(q,Ge)=>{console.log("handleDeleteBot called:",q,Ge),Tt({type:"delete",botId:q,botName:Ge})},ca=(q,Ge,ct)=>{console.log("handleGhostBot called:",q,Ge,ct),Tt({type:"ghost",botId:q,botName:Ge,isGhost:!!ct})},pa=async()=>{var Qe,bt;if(!Jr)return;const{type:q,botId:Ge,botName:ct,isGhost:et}=Jr;if(Tt(null),q==="delete")try{e.info("ð Suppression en cours...");const Ee=[D.from("bot_assignments").delete().eq("bot_id",Ge),D.from("user_gifts").delete().or(`sender_id.eq.${Ge},receiver_id.eq.${Ge}`),D.from("likes").delete().or(`liker_id.eq.${Ge},liked_id.eq.${Ge}`),D.from("messages").delete().or(`sender_id.eq.${Ge},receiver_id.eq.${Ge}`)];await Promise.allSettled(Ee);const{error:We}=await D.from("matches").delete().eq("id",Ge);if(We)throw We;u(fe=>fe.filter(Se=>Se.id!==Ge)),n(fe=>({...fe,matches:Math.max(0,fe.matches-1)})),e.success(`ðï¸ Bot "${ct}" supprimé !`)}catch(Ee){console.error("Delete bot error:",Ee),e.error("Erreur suppression: "+Ee.message)}else if(q==="ghost"){const Ee=!et;try{const{error:We}=await D.from("matches").update({is_ghost:Ee}).eq("id",Ge);if(We){if((Qe=We.message)!=null&&Qe.includes("is_ghost")||We.code==="42703"||(bt=We.message)!=null&&bt.includes("column")){e.error("â Colonne is_ghost manquante ! Exécute dans Supabase SQL: ALTER TABLE matches ADD COLUMN IF NOT EXISTS is_ghost BOOLEAN DEFAULT false;");return}throw We}u(fe=>fe.map(Se=>Se.id===Ge?{...Se,is_ghost:Ee}:Se)),e.success(`${Ee?"ð»":"ðï¸"} Bot "${ct}" ${Ee?"masqué":"remis en ligne"} !`)}catch(We){console.error("Ghost bot error:",We),e.error("Erreur: "+We.message)}}},ks=async q=>{q.preventDefault();try{if(!ot.name)return e.warning("Nom obligatoire");const Ge=G.some(We=>We!==null),ct=F.some(We=>We!==null);if(!Ge&&!ct)return e.warning("Au moins une photo obligatoire");Q(!0);const et=ot.space.toLowerCase(),Qe=[];for(let We=0;We<3;We++){const fe=G[We];if(fe){const Se=await S7(fe,ot.name,ot.space,We);Se?Qe.push(Se):e.warning(`â ï¸ Ãchec upload photo ${We+1} â vérifiez le bucket Storage`)}else F[We]&&Qe.push(F[We])}const bt=Qe[0]||null,Ee={name:ot.name,age:ot.age,gender:ot.gender,job:ot.job,bio:ot.bio,photo_url:bt,avatar_url:bt,[`photos_${et}`]:Qe,space:ot.space,personality:ot.personality,tags:ot.tags,erox_tags:ot.erox_tags,friend_tags:ot.friend_tags,location:ot.location,is_locked_by_default:!0};if(M){const{data:We,error:fe}=await D.from("matches").update(Ee).eq("id",M).select().single();if(fe)throw fe;u(p.map(Se=>Se.id===M?We:Se)),e.success(`âï¸ Bot "${ot.name}" modifié !`)}else{const{data:We,error:fe}=await D.from("matches").insert([Ee]).select();if(fe)throw fe;u([We[0],...p]),n(Se=>({...Se,matches:Se.matches+1})),e.success(`ð¤ Bot "${ot.name}" créé pour l'espace ${ot.space} !`)}E(!1),B(0),kt()}catch(Ge){e.error("Erreur: "+Ge.message)}finally{Q(!1)}},ln=(q,Ge)=>{Zr(ct=>{const et=ct[Ge]||[];return{...ct,[Ge]:et.includes(q)?et.filter(Qe=>Qe!==q):[...et,q]}})},ua=q=>{d(l.map(Ge=>Ge.id===q.id?q:Ge)),R(q)},Zi=(q,Ge)=>{if(Ge==="verified"){Zo({user:q,status:Ge});return}On("Le selfie ne correspond pas à vos photos."),Yo({user:q})},Xr=async(q,Ge,ct=null)=>{try{const et={verification_status:Ge};Ge==="rejected"&&(et.verification_photo_url=null);const{data:Qe,error:bt}=await D.from("profiles").update(et).eq("id",q.id).select("id");if(bt)throw bt;if(!Qe||Qe.length===0){e.error("Permissions insuffisantes â vérifiez les politiques RLS admin dans Supabase."),console.error("RLS silent failure: update returned 0 rows for",q.id);return}Ge==="verified"?(e.success(`${q.name} vérifié !`),$S(q.id,q.email).catch(Ee=>console.warn("Email non envoyé:",Ee))):(e.info(`Vérification refusée pour ${q.name}.`),WS(q.id,q.email,ct).catch(Ee=>console.warn("Email non envoyé:",Ee))),po()}catch(et){console.error("Verify error:",et),e.error("Erreur de mise à jour.")}},Nn=async q=>{if(confirm(`Bannir ${q.reported.name} ?`))try{await D.from("profiles").update({is_banned:!0}).eq("id",q.reported_id),await D.from("reports").update({status:"resolved"}).eq("id",q.id),e.success("Utilisateur banni."),DS(q.reported_id,q.reported.email,q.reason).catch(Ge=>console.warn("Email non envoyé:",Ge)),po()}catch(Ge){console.error("Ban error:",Ge),e.error("Erreur.")}},ha=async q=>{const Ge=prompt("Message d'avertissement :","Veuillez respecter les règles.");if(Ge!==null)try{await D.from("reports").update({status:"reviewed"}).eq("id",q.id),e.success("Avertissement envoyé."),BS(q.reported_id,q.reported.email,q.reason,Ge).catch(ct=>console.warn("Email non envoyé:",ct)),po()}catch(ct){console.error("Warn error:",ct),e.error("Erreur.")}},Cs=(q,Ge)=>{Bn({userId:q,userName:Ge})},cl=async()=>{var ct;if(!xr)return;const{userId:q,userName:Ge}=xr;Bn(null),d(et=>et.filter(Qe=>Qe.id!==q));try{const et="https://bqfzljnhxblhiabyvpqm.supabase.co",Qe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4",bt=await fetch(`${et}/functions/v1/delete-user`,{method:"POST",headers:{"Content-Type":"application/json",apikey:Qe,Authorization:`Bearer ${Qe}`},body:JSON.stringify({userId:q})}),Ee=await bt.json();if(!bt.ok)throw new Error(Ee.error||`HTTP ${bt.status}`);((ct=Ee.errors)==null?void 0:ct.length)>
24770?(console.warn("Partial deletion errors:",Ee.errors),e.warning(`${Ge} supprimé avec ${Ee.errors.length} avertissement(s). Détails dans la console.`)):e.info(`${Ge} supprimé définitivement.`),n(We=>({...We,total:Math.max(0,(We.total||0)-1)}))}catch(et){e.error("Erreur suppression: "+et.message),po()}},jn=[{id:"overview",icon:pu,label:"Vue d'ensemble",color:"#8b5cf6"},{id:"reports",icon:_n,label:"Signalements",color:"#f59e0b",badge:i.reports},{id:"verifications",icon:fi,label:"Vérifications",color:"#10b981",badge:i.verifications},{id:"pending",icon:kn,label:"Revalidation",color:"#3b82f6",badge:i.pending},{id:"matches",icon:Bt,label:"Gérer Matchs",color:"#ec4899"},{id:"activity",icon:ss,label:"Activité",color:"#06b6d4"},{id:"revenue",icon:Jb,label:"Revenus",color:"#22c55e"},{id:"finances",icon:Zd,label:"Finances",color:"#f97316"},{id:"partenaires",icon:Yb,label:"Partenaires",color:"#06b6d4"},{id:"support",icon:Vr,label:"Support",color:"#f43f5e",badge:i.support},{id:"emails",icon:ji,label:"Emails",color:"#D4AF37"},{id:"inbox",icon:vg,label:"Boîte de réception",color:"#8b5cf6",badge:Pt.filter(q=>!q.read).length||void 0},{id:"marketing",icon:ba,label:"Marketing",color:"#f97316"},{id:"analytics",icon:rr,label:"Analytics",color:"#14b8a6"}];return m.useEffect(()=>{const q=document.createElement("style");return q.textContent=` 2478 @keyframes fadeSlideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } } 2479 @keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.7; } } 2480 @keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } } 2481 .admin-row:hover { background: rgba(255,255,255,0.06) !important; } 2482 .admin-action-btn:hover { transform: scale(1.05); filter: brightness(1.2); } 2483 2484 /* âââ MOBILE RESPONSIVE âââ */ 2485 @media (max-width: 768px) { 2486 .admin-topbar { padding: 10px 14px !important; } 2487 .admin-topbar h1 { font-size: 1rem !important; } 2488 .admin-topbar .admin-subtitle { display: none !important; } 2489 .admin-topbar .admin-refresh-btn span { display: none; } 2490 2491 .admin-layout { flex-direction: column !important; } 2492 2493 .admin-sidebar { 2494 width: 100% !important; 2495 flex-direction: row !important; 2496 padding: 8px 10px !important; 2497 overflow-x: auto !important; 2498 border-right: none !important; 2499 border-bottom: 1px solid rgba(255,255,255,0.06) !important; 2500 gap: 4px !important; 2501 -webkit-overflow-scrolling: touch; 2502 scrollbar-width: none; 2503 min-height: auto !important; 2504 } 2505 .admin-sidebar::-webkit-scrollbar { display: none; } 2506 .admin-sidebar .admin-sidebar-footer { display: none !important; } 2507 2508 .admin-tab-btn { 2509 padding: 8px 14px !important; 2510 white-space: nowrap !important; 2511 border-left: none !important; 2512 border-bottom: 3px solid transparent !important; 2513 font-size: 0.78rem !important; 2514 gap: 6px !important; 2515 min-width: max-content !important; 2516 } 2517 .admin-tab-btn[data-active="true"] { 2518 border-left: none !important; 2519 border-bottom-color: currentColor !important; 2520 } 2521 2522 .admin-main { padding: 14px !important; } 2523 2524 .admin-stat-grid { 2525 grid-template-columns: repeat(2, 1fr) !important; 2526 gap: 10px !important; 2527 margin-bottom: 18px !important; 2528 } 2529 .admin-stat-grid > div { padding: 14px !important; border-radius: 14px !important; } 2530 .admin-stat-grid > div .stat-value { font-size: 1.5rem !important; } 2531 .admin-stat-grid > div .stat-icon-bg { padding: 10px !important; } 2532 2533 .admin-tab-content { padding: 16px !important; border-radius: 14px !important; min-height: auto !important; } 2534 2535 .admin-grid-2col { grid-template-columns: 1fr !important; } 2536 .admin-grid-3col { grid-template-columns: 1fr !important; } 2537 .admin-grid-4col { grid-template-columns: 1fr 1fr !important; } 2538 .admin-grid-auto { grid-template-columns: 1fr !important; } 2539 .admin-grid-partners { grid-template-columns: 1fr !important; } 2540 2541 .admin-search-bar { flex-direction: column !important; align-items: stretch !important; } 2542 .admin-search-bar input { width: 100% !important; } 2543 .admin-search-bar select { width: 100% !important; } 2544 .admin-section-header { flex-direction: column !important; align-items: flex-start !important; } 2545 2546 .admin-table-scroll { overflow-x: auto !important; -webkit-overflow-scrolling: touch; } 2547 .admin-table-scroll > div { min-width: 500px; } 2548 2549 .admin-verification-card { flex-direction: column !important; } 2550 .admin-verification-card > div:first-child { width: 100% !important; } 2551 .admin-verification-images { flex-direction: column !important; } 2552 .admin-verification-images img { width: 100% !important; height: auto !important; } 2553 2554 .admin-bot-grid { grid-template-columns: 1fr !important; } 2555 2556 .admin-user-row { flex-direction: column !important; align-items: flex-start !important; gap: 8px !important; } 2557 .admin-user-actions { width: 100% !important; justify-content: flex-start !important; } 2558 2559 .admin-modal-content { width: 95vw !important; max-width: none !important; max-height: 90vh !important; padding: 16px !important; } 2560 .admin-modal-grid { grid-template-columns: 1fr !important; } 2561 2562 .admin-revenue-card { padding: 14px !important; } 2563 } 2564 2565 @media (max-width: 480px) { 2566 .admin-stat-grid { grid-template-columns: 1fr !important; } 2567 .admin-topbar h1 { font-size: 0.9rem !important; } 2568 .admin-tab-btn span.tab-label { display: none; } 2569 } 2570 `,document.head.appendChild(q),()=>document.head.removeChild(q)},[]),k?t.jsx("div",{style:{minHeight:"100vh",background:"#0a0a12",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsxs("div",{style:{textAlign:"center"},children:[t.jsx(ni,{size:48,color:"#f59e0b",style:{animation:"pulse 1.5s infinite"}}),t.jsx("p",{style:{color:"rgba(255,255,255,0.6)",marginTop:"16px",fontFamily:"Outfit"},children:"Chargement du panneau admin..."})]})}):t.jsxs("div",{style:{minHeight:"100vh",background:"linear-gradient(135deg, #0a0a12 0%, #0f0a1a 50%, #0a0f15 100%)",color:"white",fontFamily:"'Inter', 'Outfit', sans-serif"},children:[t.jsxs("div",{className:"admin-topbar",style:{padding:"16px 30px",display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid rgba(255,255,255,0.06)",background:"rgba(0,0,0,0.3)",backdropFilter:"blur(20px)",position:"sticky",top:0,zIndex:100},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px"},children:[t.jsx("button",{onClick:()=>r("/matches"),style:{background:"rgba(255,255,255,0.08)",border:"none",borderRadius:"12px",padding:"10px",cursor:"pointer",color:"white",display:"flex"},children:t.jsx(Hr,{size:20})}),t.jsxs("div",{children:[t.jsxs("h1",{style:{margin:0,fontSize:"1.4rem",fontFamily:"Outfit",fontWeight:"700",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(ni,{size:24,color:"#f59e0b"})," Administration"]}),t.jsx("p",{className:"admin-subtitle",style:{margin:0,fontSize:"0.8rem",color:"rgba(255,255,255,0.4)"},children:"MEETYOU.AI â Panneau de contrôle"})]})]}),t.jsxs("button",{className:"admin-refresh-btn",onClick:po,style:{background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"12px",padding:"10px 18px",cursor:"pointer",color:"white",display:"flex",alignItems:"center",gap:"8px",fontSize:"0.85rem",transition:"all 0.2s"},children:[t.jsx(kn,{size:16})," ",t.jsx("span",{children:"Actualiser"})]})]}),t.jsxs("div",{className:"admin-layout",style:{display:"flex",minHeight:"calc(100vh - 65px)"},children:[t.jsxs("div",{className:"admin-sidebar",style:{width:"240px",padding:"24px 16px",borderRight:"1px solid rgba(255,255,255,0.06)",background:"rgba(0,0,0,0.2)",flexShrink:0,display:"flex",flexDirection:"column",gap:"6px"},children:[jn.map(q=>t.jsx(tF,{icon:q.icon,label:q.label,active:o===q.id,onClick:()=>a(q.id),badge:q.badge,color:q.color},q.id)),t.jsxs("div",{className:"admin-sidebar-footer",style:{marginTop:"auto",padding:"16px",borderRadius:"14px",background:"linear-gradient(135deg, rgba(245,158,11,0.1), rgba(245,158,11,0.02))",border:"1px solid rgba(245,158,11,0.15)"},children:[t.jsx("div",{style:{fontSize:"0.75rem",color:"#f59e0b",fontWeight:"600",marginBottom:"4px"},children:"MEETYOU.AI"}),t.jsx("div",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.4)"},children:"Admin Panel v2.0"})]})]}),t.jsxs("div",{className:"admin-main",style:{flex:1,padding:"28px",overflowY:"auto"},children:[t.jsxs("div",{className:"admin-stat-grid",style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"18px",marginBottom:"32px"},children:[t.jsx(To,{icon:Ut,label:"Utilisateurs",value:i.users,gradient:"linear-gradient(135deg, #1e1046 0%, #2d1b69 100%)",iconColor:"#a78bfa",delay:0,onClick:()=>a("overview")}),t.jsx(To,{icon:Bt,label:"Matchs",value:i.matches,gradient:"linear-gradient(135deg, #3b1032 0%, #5c1a4d 100%)",iconColor:"#f472b6",delay:.05,onClick:()=>a("matches")}),t.jsx(To,{icon:_n,label:"Signalements",value:i.reports,gradient:"linear-gradient(135deg, #3b2506 0%, #5c3a0e 100%)",iconColor:"#fbbf24",delay:.1,onClick:()=>a("reports")}),t.jsx(To,{icon:fi,label:"Vérifications",value:i.verifications,gradient:"linear-gradient(135deg, #052e16 0%, #0a4a27 100%)",iconColor:"#34d399",delay:.15,onClick:()=>a("verifications")}),t.jsx(To,{icon:kn,label:"Revalidation",value:i.pending,gradient:"linear-gradient(135deg, #0c1d3a 0%, #122d5c 100%)",iconColor:"#60a5fa",delay:.2,onClick:()=>a("pending")}),t.jsx(To,{icon:ni,label:"Premium",value:i.premium,gradient:"linear-gradient(135deg, #3b2e06 0%, #5c4a0e 100%)",iconColor:"#f59e0b",delay:.25,onClick:()=>a("overview")})]}),t.jsxs("div",{className:"admin-tab-content",style:{background:"rgba(255,255,255,0.02)",borderRadius:"20px",border:"1px solid rgba(255,255,255,0.06)",padding:"28px",minHeight:"500px",animation:"fadeSlideUp 0.3s ease-out"},children:[o==="overview"&&t.jsxs("div",{children:[t.jsxs("div",{className:"admin-section-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"24px",flexWrap:"wrap",gap:"12px"},children:[t.jsxs("h2",{style:{margin:0,fontFamily:"Outfit",fontSize:"1.3rem",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(Ut,{size:22,color:"#8b5cf6"})," Gestion des Utilisateurs"]}
2570),t.jsxs("div",{className:"admin-search-bar",style:{display:"flex",gap:"10px"},children:[t.jsxs("div",{style:{position:"relative"},children:[t.jsx(qo,{size:16,style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:"rgba(255,255,255,0.3)"}}),t.jsx("input",{type:"text",placeholder:"Rechercher...",value:b,onChange:q=>j(q.target.value),style:{padding:"10px 10px 10px 38px",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.3)",color:"white",fontSize:"0.85rem",width:"220px"}})]}),t.jsxs("select",{value:T,onChange:q=>P(q.target.value),style:{padding:"10px 14px",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.3)",color:"white",fontSize:"0.85rem"},children:[t.jsx("option",{value:"all",children:"Tous"}),t.jsx("option",{value:"restricted",children:"Restreints"}),t.jsx("option",{value:"banned",children:"Bannis"}),t.jsx("option",{value:"pending_review",children:"En attente"}),t.jsx("option",{value:"verified",children:"Vérifiés"})]})]})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[Ss.length===0&&t.jsx("p",{style:{color:"rgba(255,255,255,0.4)",textAlign:"center",padding:"40px"},children:"Aucun utilisateur trouvé."}),Ss.map(q=>t.jsx(m1,{user:q,onDelete:Cs,onView:R},q.id))]})]}),o==="reports"&&t.jsxs("div",{children:[t.jsxs("h2",{style:{margin:"0 0 24px 0",fontFamily:"Outfit",fontSize:"1.3rem",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(_n,{size:22,color:"#f59e0b"})," Signalements"]}),g.length===0&&t.jsxs("div",{style:{textAlign:"center",padding:"60px",color:"rgba(255,255,255,0.4)"},children:[t.jsx(ms,{size:48,color:"#10b981",style:{marginBottom:"16px"}}),t.jsx("p",{children:"Aucun signalement. Tout est calme ! ð"})]}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:g.map(q=>t.jsxs("div",{style:{background:"rgba(245,158,11,0.04)",borderRadius:"16px",border:"1px solid rgba(245,158,11,0.1)",padding:"20px",transition:"all 0.2s"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"12px"},children:[t.jsxs("div",{children:[t.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center",marginBottom:"6px",flexWrap:"wrap"},children:[t.jsx("span",{style:{color:"#ef4444",fontWeight:"700"},children:q.reported.name}),t.jsx("span",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.4)"},children:"signalé par"}),t.jsx("span",{style:{color:"#8b5cf6",fontWeight:"600"},children:q.reporter.name})]}),t.jsx("div",{style:{fontSize:"1rem",fontWeight:"600",marginBottom:"4px"},children:q.reason}),t.jsxs("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.4)"},children:[new Date(q.created_at).toLocaleString()," ⢠",q.status]})]}),q.reported.is_banned&&t.jsx("span",{style:{padding:"4px 10px",background:"#ef4444",borderRadius:"8px",fontSize:"0.75rem",fontWeight:"700"},children:"BANNI"})]}),!q.reported.is_banned&&q.status!=="resolved"&&t.jsxs("div",{style:{display:"flex",gap:"10px",borderTop:"1px solid rgba(255,255,255,0.06)",paddingTop:"14px",flexWrap:"wrap"},children:[t.jsxs("button",{className:"admin-action-btn",onClick:()=>R(q.reported),style:{flex:1,padding:"10px",borderRadius:"10px",background:"rgba(255,255,255,0.08)",border:"none",color:"white",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",fontWeight:"600",fontSize:"0.85rem",transition:"all 0.2s"},children:[t.jsx(rr,{size:16})," Profil"]}),t.jsxs("button",{className:"admin-action-btn",onClick:()=>Nn(q),style:{flex:1,padding:"10px",borderRadius:"10px",background:"rgba(239,68,68,0.15)",border:"1px solid rgba(239,68,68,0.3)",color:"#ef4444",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",fontWeight:"600",fontSize:"0.85rem",transition:"all 0.2s"},children:[t.jsx(ip,{size:16})," Bannir"]}),t.jsxs("button",{className:"admin-action-btn",onClick:()=>ha(q),style:{flex:1,padding:"10px",borderRadius:"10px",background:"rgba(245,158,11,0.15)",border:"1px solid rgba(245,158,11,0.3)",color:"#f59e0b",curs
2570or:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",fontWeight:"600",fontSize:"0.85rem",transition:"all 0.2s"},children:[t.jsx(_n,{size:16})," Avertir"]}),t.jsx("button",{className:"admin-action-btn",onClick:()=>D.from("reports").update({status:"resolved"}).eq("id",q.id).then(po),style:{padding:"10px 16px",borderRadius:"10px",background:"rgba(255,255,255,0.05)",border:"none",color:"rgba(255,255,255,0.4)",cursor:"pointer",fontSize:"0.85rem",transition:"all 0.2s"},children:"Ignorer"})]})]},q.id))})]}),o==="verifications"&&t.jsxs("div",{children:[t.jsxs("h2",{style:{margin:"0 0 24px 0",fontFamily:"Outfit",fontSize:"1.3rem",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(fi,{size:22,color:"#10b981"})," Vérifications d'Identité"]}),_.length===0&&t.jsxs("div",{style:{textAlign:"center",padding:"60px",color:"rgba(255,255,255,0.4)"},children:[t.jsx(Sr,{size:48,color:"#10b981",style:{marginBottom:"16px",opacity:.5}}),t.jsx("p",{children:"Aucune demande en attente."})]}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:_.map(q=>t.jsxs("div",{className:"admin-verification-card",style:{background:"rgba(16,185,129,0.04)",borderRadius:"16px",border:"1px solid rgba(16,185,129,0.12)",padding:"24px",display:"flex",gap:"24px",alignItems:"center",flexWrap:"wrap"},children:[t.jsxs("div",{style:{flex:1,minWidth:"200px"},children:[t.jsxs("h3",{style:{margin:"0 0 16px 0",fontFamily:"Outfit",display:"flex",alignItems:"center",gap:"8px"},children:[q.name," ",t.jsx("span",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.4)",fontWeight:"400"},children:q.email})]}),t.jsxs("div",{style:{display:"flex",gap:"24px"},children:[t.jsxs("div",{style:{textAlign:"center"},children:[t.jsx("div",{style:{marginBottom:"8px",color:"rgba(255,255,255,0.5)",fontSize:"0.8rem",fontWeight:"600"},children:"Photo Profil"}),t.jsx("img",{src:q.photo||q.avatar_url||"https://via.placeholder.com/120",style:{width:"130px",height:"130px",objectFit:"cover",borderRadius:"14px",border:"2px solid rgba(255,255,255,0.1)"}})]}),t.jsxs("div",{style:{textAlign:"center"},children:[t.jsx("div",{style:{marginBottom:"8px",color:"#10b981",fontSize:"0.8rem",fontWeight:"600"},children:"Selfie Vérification"}),t.jsx("img",{src:q.verification_photo_url,onClick:()=>window.open(q.verification_photo_url,"_blank"),style:{width:"130px",height:"130px",objectFit:"cover",borderRadius:"14px",border:"2px solid rgba(16,185,129,0.4)",cursor:"pointer"}})]})]})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px",minWidth:"160px"},children:[t.jsx("button",{className:"admin-action-btn",onClick:()=>Zi(q,"verified"),style:{padding:"14px",background:"linear-gradient(135deg, #059669, #10b981)",color:"white",border:"none",borderRadius:"12px",cursor:"pointer",fontWeight:"700",fontSize:"0.9rem",transition:"all 0.2s"},children:"â
Valider"}),t.jsx("button",{className:"admin-action-btn",onClick:()=>Zi(q,"rejected"),style:{padding:"14px",background:"rgba(239,68,68,0.15)",color:"#ef4444",border:"1px solid rgba(239,68,68,0.3)",borderRadius:"12px",cursor:"pointer",fontWeight:"700",fontSize:"0.9rem",transition:"all 0.2s"},children:"â Refuser"}),t.jsx("button",{className:"admin-action-btn",onClick:()=>R(q),style:{padding:"10px",background:"rgba(255,255,255,0.06)",color:"rgba(255,255,255,0.7)",border:"none",borderRadius:"12px",cursor:"pointer",fontSize:"0.85rem",transition:"all 0.2s"},children:"Voir Profil"})]})]},q.id))})]}),o==="pending"&&t.jsxs("div",{children:[t.jsxs("h2",{style:{margin:"0 0 8px 0",fontFamily:"Outfit",fontSize:"1.3rem",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(kn,{size:22,color:"#3b82f6"})," Revalidation"]}),t.jsx("p",{style:{color:"rgba(255,255,255,0.4)",marginBottom:"24px",fontSize:"0.9rem"},children:"Profils modifiés après restriction, en attente de vérification."}),x.length===0&&t.jsx("p",{style:{color:"rgba(255,255,255,0.4)",textAlign:"center",padding:"40px"},children:"Aucun compte à revalider."}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:x.map(q=>t.jsx(m1,{user:q,onDelete:Cs,onView:R},q.id))})]}),o==="matches"&&t.jsxs("div",{children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"24px"},children:[t.jsxs("h2",{style:{margin:0,fontFamily:"Outfit",fontSize:"1.3rem",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(Kn,{size:22,color:"#ec4899"})," Profils Bots IA"]}),t.jsxs("button",{onClick:()=>{kt(),B(0),E(!0)},style:{display:"flex",alignItems:"center",gap:"8px",padding:"10px 20px",borderRadius:"12px",background:"linear-gradient(135deg, #ec4899, #8b5cf6)",border:"none",color:"white",cursor:"pointer",fontWeight:"600",fontSize:"0.85rem",transition:"all 0.2s"},children:[t.jsx(No,{size:18})," Créer un Bot IA"]})]}),t.jsx("div",{className:"admin-bot-grid",style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))",gap:"16px"},children:p.map(q=>{var Qe,bt,Ee,We;const ct={EROS:"#ec4899",EROX:"#ef4444",FRIEND:"#10b981"}[q.space]||"#8b5cf6",et=Ho[q.personality];return t.jsxs("div",{style:{background:q.is_ghost?"rgba(255,255,255,0.02)":`${ct}08`,borderRadius:"16px",border:`1px solid ${q.is_ghost?"rgba(255,255,255,0.08)":`${ct}20`}`,padding:"18px",transition:"all 0.2s",opacity:q.is_ghost?.6:1,position:"relative"},children:[q.is_ghost&&t.jsx("div",{style:{position:"absolute",top:"10px",right:"10px",background:"rgba(156,163,175,0.2)",border:"1px solid rgba(156,163,175,0.3)",borderRadius:"8px",padding:"3px 8px",display:"flex",alignItems:"center",gap:"4px",fontSize:"0.65rem",color:"#9ca3af",fontWeight:"600"},children:"ð» Fantôme"}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"14px",marginBottom:"12px"},children:[t.jsx("img",{src:q.photo_url||((Qe=q.photos_eros)==null?void 0:Qe[0])||((bt=q.photos_erox)==null?void 0:bt[0])||((Ee=q.photos_friend)==null?void 0:Ee[0])||"https://via.placeholder.com/54",alt:q.name,style:{width:"54px",height:"54px",borderRadius:"14px",objectFit:"cover",border:`2px solid ${q.is_ghost?"rgba(156,163,175,0.3)":`${ct}50`}`,filter:q.is_ghost?"grayscale(0.5)":"none"}}),t.jsxs("div",{style:{flex:1},children:[t.jsxs("div",{style:{fontWeight:"700",fontSize:"0.95rem",display:"flex",alignItems:"center",gap:"6px"},children:[q.name,", ",q.age,t.jsx(Kn,{size:14,color:q.is_ghost?"#9ca3af":ct})]}),t.jsxs("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.4)"},children:[q.job||"Pas de métier",q.city?` ⢠${q.city}`:""]})]}),t.jsx("span",{style:{fontSize:"0.75rem",padding:"4px 10px",borderRadius:"8px",background:q.gender==="female"?"rgba(236,72,153,0.15)":"rgba(59,130,246,0.15)",color:q.gender==="female"?"#ec4899":"#3b82f6"},children:q.gender==="female"?"â":"â"})]}),t.jsxs("div",{style:{display:"flex",gap:"6px",flexWrap:"wrap",marginBottom:"10px"},children:[q.space&&t.jsx("span",{style:{fontSize:"0.7rem",padding:"3px 8px",borderRadius:"6px",background:`${ct}20`,color:ct,fontWeight:"700"},children:q.space}),et&&t.jsx("span",{style:{fontSize:"0.7rem",padding:"3px 8px",borderRadius:"6px",background:`${et.color}20`,color:et.color,fontWeight:"600"},children:et.label}),((We=q.tags)==null?void 0:We.length)>0&&t.jsxs("span",{style:{fontSize:"0.65rem",padding:"3px 6px",borderRadius:"5px",background:"rgba(255,255,255,0.05)",color:"rgba(255,255,255,0.4)"},children:[q.tags.length," pictos"]})]}),t.jsxs("div",{style:{display:"flex",gap:"6px"},children:[t.jsxs("button",{type:"button",onClick:fe=>{fe.stopPropagation(),fe.preventDefault(),hr(q)},style:{flex:1,padding:"7px",borderRadius:"8px",background:"rgba(139,92,246,0.12)",border:"1px solid rgba(139,92,246,0.25)",color:"#a78bfa",cursor:"pointer",fontWeight:"600",fontSize:"0.75rem",display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",transition:"all 0.2s"},children:[t.jsx(sp,{size:13})," Modifier"]}),t.jsxs("button",{type:"button",onClick:fe=>{fe.stopPropagation(),fe.preventDefault(),r(`/profile-view/${q.id}`)},style:{padding:"7px 12px",borderRadius:"8px",background:"rgba(100,181,246,0.1)",border:"1px solid rgba(100,181,246,0.2)",color:"#64B5F6",cursor:"pointer",fontWeight:"600",fontSize:"0.75rem",display:"flex",alignItems:"center",gap:"4px",transition:"all 0.2s"},children:[t.jsx(rr,{size:13})," Profil"]}),t.jsxs("button",{type:"button",onClick:fe=>{fe.stopPropagation(),fe.preventDefault(),ca(q.id,q.name,q.is_ghost)},title:q.is_ghost?"Remettre en ligne":"Mode fantôme",style:{padding:"7px 12px",borderRadius:"8px",background:q.is_ghost?"rgba(34,197,94,0.1)":"rgba(156,163,175,0.1)",border:`1px solid ${q.is_ghost?"rgba(34,197,94,0.25)":"rgba(156,163,175,0.2)"}`,color:q.is_ghost?"#22c55e":"#9ca3af",cursor:"pointer",fontSize:"0.75rem",display:"flex",alignItems:"center",gap:"4px",transition:"all 0.2s"},children:[q.is_ghost?t.jsx(rr,{size:13}):t.jsx(al,{size:13})," ",q.is_ghost?"":"ð»"]}
2570),t.jsx("button",{type:"button",onClick:fe=>{fe.stopPropagation(),fe.preventDefault(),dl(q.id,q.name)},style:{padding:"7px 12px",borderRadius:"8px",background:"rgba(239,68,68,0.1)",border:"1px solid rgba(239,68,68,0.2)",color:"#ef4444",cursor:"pointer",fontSize:"0.75rem",display:"flex",alignItems:"center",gap:"4px",transition:"all 0.2s"},children:t.jsx(rn,{size:13})})]})]},q.id)})})]}),o==="activity"&&t.jsxs("div",{children:[t.jsxs("h2",{style:{margin:"0 0 24px 0",fontFamily:"Outfit",fontSize:"1.3rem",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(ss,{size:22,color:"#06b6d4"})," Activité & Statistiques"]}),t.jsxs("div",{className:"admin-grid-2col",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"20px",marginBottom:"28px"},children:[t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"16px",border:"1px solid rgba(255,255,255,0.06)",padding:"24px"},children:[t.jsx("h3",{style:{margin:"0 0 20px 0",fontSize:"1rem",fontWeight:"600",color:"rgba(255,255,255,0.7)"},children:"Répartition par Genre"}),t.jsx("div",{style:{display:"flex",gap:"12px",marginBottom:"16px"},children:[{l:"Femmes",v:K.female,c:"#ec4899"},{l:"Hommes",v:K.male,c:"#3b82f6"},{l:"Autre",v:K.other,c:"#a78bfa"}].map(q=>t.jsxs("div",{style:{flex:1,textAlign:"center",padding:"16px",borderRadius:"12px",background:`${q.c}10`,border:`1px solid ${q.c}25`},children:[t.jsx("div",{style:{fontSize:"1.8rem",fontWeight:"800",color:q.c,fontFamily:"Outfit"},children:q.v}),t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",marginTop:"4px"},children:q.l})]},q.l))}),l.length>0&&t.jsxs("div",{style:{height:"12px",borderRadius:"6px",overflow:"hidden",display:"flex",background:"rgba(255,255,255,0.05)"},children:[t.jsx("div",{style:{width:`${K.female/l.length*100}%`,background:"#ec4899",transition:"width 1s"}}),t.jsx("div",{style:{width:`${K.male/l.length*100}%`,background:"#3b82f6",transition:"width 1s"}}),t.jsx("div",{style:{width:`${K.other/l.length*100}%`,background:"#a78bfa",transition:"width 1s"}})]})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"16px",border:"1px solid rgba(255,255,255,0.06)",padding:"24px"},children:[t.jsx("h3",{style:{margin:"0 0 20px 0",fontSize:"1rem",fontWeight:"600",color:"rgba(255,255,255,0.7)"},children:"Aperçu Rapide"}),[{l:"Ratio Matchs/Users",v:i.users>0?(i.matches/i.users).toFixed(1):"0",c:"#ec4899",ic:Bt},{l:"Taux Vérification",v:`${i.users>0?Math.round(l.filter(q=>q.verification_status==="verified").length/i.users*100):0}%`,c:"#10b981",ic:fi},{l:"Signalements actifs",v:i.reports,c:"#f59e0b",ic:_n}].map(q=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",borderRadius:"10px",marginBottom:"8px",background:`${q.c}08`},children:[t.jsx(q.ic,{size:18,color:q.c}),t.jsx("span",{style:{flex:1,fontSize:"0.85rem",color:"rgba(255,255,255,0.6)"},children:q.l}),t.jsx("span",{style:{fontWeight:"700",color:q.c,fontSize:"1.1rem"},children:q.v})]},q.l))]})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"16px",border:"1px solid rgba(255,255,255,0.06)",padding:"24px"},children:[t.jsxs("h3",{style:{margin:"0 0 16px 0",fontSize:"1rem",fontWeight:"600",color:"rgba(255,255,255,0.7)",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(cx,{size:18,color:"#06b6d4"})," Dernières inscriptions"]}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:ee.map(q=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"10px",borderRadius:"10px",transition:"all 0.2s"},className:"admin-row",children:[t.jsx("img",{src:q.photo||q.avatar_url||"https://via.placeholder.com/36",style:{width:"36px",height:"36px",borderRadius:"10px",objectFit:"cover"}}),t.jsxs("div",{style:{flex:1},children:[t.jsx("span",{style:{fontWeight:"600",fontSize:"0.9rem"},children:q.name||"Sans nom"}),t.jsx("span",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.3)",marginLeft:"8px"},children:q.city||""})]}),t.jsx("span",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.3)"},children:new Date(q.created_at).toLocaleDateString()}),q.is_premium&&t.jsx(ni,{size:14,color:"#f59e0b"})]},q.id))})]})]}),o==="revenue"&&t.jsxs("div",{children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"24px",flexWrap:"wrap",gap:"12px"},children:[t.jsxs("h2",{style:{margin:0,fontFamily:"Outfit",fontSize:"1.3rem",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(Jb,{size:22,color:"#22c55e"})," Revenus & Finances"]}),t.jsxs("a",{href:"https://dashboard.stripe.com",target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"8px",padding:"10px 18px",borderRadius:"12px",background:"linear-gradient(135deg, #635bff, #7c3aed)",border:"none",color:"white",textDecoration:"none",fontSize:"0.85rem",fontWeight:"600",transition:"all 0.2s"},children:[t.jsx(Vs,{size:16})," Dashboard Stripe ",t.jsx(Gn,{size:14})]})]}),t.jsx("div",{className:"admin-stat-grid",style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"16px",marginBottom:"28px"},children:[{label:"Aujourd'hui",value:`${vr.dailyRevenue.toFixed(2)}â¬`,icon:cr,gradient:"linear-gradient(135deg, #064e3b, #065f46)",color:"#34d399",sub:`${vr.dailySignups} inscription(s)`},{label:"Ce mois",value:`${vr.monthlyRevenue.toFixed(2)}â¬`,icon:ba,gradient:"linear-gradient(135deg, #1e3a5f, #1e40af)",color:"#60a5fa",sub:`${vr.monthlySignups} inscriptions`},{label:"Cette année",value:`${vr.yearlyRevenue.toFixed(2)}â¬`,icon:kS,gradient:"linear-gradient(135deg, #3b1d78, #5b21b6)",color:"#a78bfa",sub:`${i.premium} premium actifs`},{label:"Packs vendus",value:vr.totalPacksPurchased,icon:oi,gradient:"linear-gradient(135deg, #78350f, #92400e)",color:"#fbbf24",sub:"Meetips distribués"}].map((q,Ge)=>t.jsxs("div",{style:{background:q.gradient,borderRadius:"16px",padding:"22px",border:"1px solid rgba(255,255,255,0.06)",position:"relative",overflow:"hidden"},children:[t.jsx(q.icon,{size:48,color:q.color,style:{position:"absolute",right:"-6px",bottom:"-6px",opacity:.08}}),t.jsx("div",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.5)",textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:"8px"},children:q.label}),t.jsx("div",{style:{fontSize:"2rem",fontWeight:"800",color:q.color,fontFamily:"Outfit",lineHeight:1},children:q.value}),t.jsx("div",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.35)",marginTop:"8px"},children:q.sub})]},Ge))}),t.jsxs("div",{className:"admin-grid-2col",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"20px",marginBottom:"28px"},children:[t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"16px",border:"1px solid rgba(255,255,255,0.06)",padding:"24px"},children:[t.jsxs("h3",{style:{margin:"0 0 20px 0",fontSize:"1rem",fontWeight:"600",color:"rgba(255,255,255,0.7)",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(ba,{size:18,color:"#22c55e"})," Croissance Utilisateurs"]}
2570),t.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:"8px",height:"140px",padding:"0 4px"},children:vr.userGrowth.map((q,Ge)=>{const ct=Math.max(...vr.userGrowth.map(Qe=>Qe.count),1),et=q.count/ct*100;return t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",gap:"6px"},children:[t.jsx("span",{style:{fontSize:"0.7rem",fontWeight:"700",color:"#22c55e"},children:q.count}),t.jsx("div",{style:{width:"100%",borderRadius:"8px 8px 4px 4px",background:Ge===vr.userGrowth.length-1?"linear-gradient(180deg, #22c55e, #059669)":"linear-gradient(180deg, rgba(34,197,94,0.4), rgba(5,150,105,0.2))",height:`${Math.max(et,8)}%`,transition:"height 0.8s ease-out",border:"1px solid rgba(34,197,94,0.15)"}}),t.jsx("span",{style:{fontSize:"0.65rem",color:"rgba(255,255,255,0.4)",textTransform:"capitalize"},children:q.month})]},Ge)})})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"16px",border:"1px solid rgba(255,255,255,0.06)",padding:"24px"},children:[t.jsxs("h3",{style:{margin:"0 0 20px 0",fontSize:"1rem",fontWeight:"600",color:"rgba(255,255,255,0.7)",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(Ub,{size:18,color:"#f59e0b"})," Taux de Conversion"]}),[{label:"Inscrits Total",value:i.users,color:"#8b5cf6",pct:100},{label:"Profil Vérifié",value:l.filter(q=>q.verification_status==="verified").length,color:"#10b981",pct:i.users>0?Math.round(l.filter(q=>q.verification_status==="verified").length/i.users*100):0},{label:"Premium",value:i.premium,color:"#f59e0b",pct:i.users>0?Math.round(i.premium/i.users*100):0}].map((q,Ge)=>t.jsxs("div",{style:{marginBottom:"16px"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"6px"},children:[t.jsx("span",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.6)"},children:q.label}),t.jsxs("span",{style:{fontSize:"0.85rem",fontWeight:"700",color:q.color},children:[q.value," (",q.pct,"%)"]})]}),t.jsx("div",{style:{height:"8px",borderRadius:"4px",background:"rgba(255,255,255,0.05)",overflow:"hidden"},children:t.jsx("div",{style:{width:`${q.pct}%`,height:"100%",borderRadius:"4px",background:q.color,transition:"width 1s ease-out"}})})]},Ge))]})]}),t.jsxs("div",{className:"admin-grid-2col",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"20px",marginBottom:"28px"},children:[t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"16px",border:"1px solid rgba(255,255,255,0.06)",padding:"24px"},children:[t.jsxs("h3",{style:{margin:"0 0 20px 0",fontSize:"1rem",fontWeight:"600",color:"rgba(255,255,255,0.7)",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(Li,{size:18,color:"#ec4899"})," Ãconomie des Cadeaux"]}),[{label:"Cadeaux envoyés",value:vr.totalGiftsSent,color:"#ec4899",icon:Li},{label:"Meetips dépensés (cadeaux)",value:vr.totalGiftsValue,color:"#f97316",icon:oi},{label:"Messages échangés",value:vr.messagesCount,color:"#06b6d4",icon:Qt}].map((q,Ge)=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",borderRadius:"10px",marginBottom:"8px",background:`${q.color}08`},children:[t.jsx(q.icon,{size:18,color:q.color}),t.jsx("span",{style:{flex:1,fontSize:"0.85rem",color:"rgba(255,255,255,0.6)"},children:q.label}),t.jsx("span",{style:{fontWeight:"700",color:q.color,fontSize:"1.1rem"},children:typeof q.value=="number"&&q.value>999?`${(q.value/1e3).toFixed(1)}k`:q.value})]},Ge))]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"16px",border:"1px solid rgba(255,255,255,0.06)",padding:"24px"},children:[t.jsxs("h3",{style:{margin:"0 0 20px 0",fontSize:"1rem",fontWeight:"600",color:"rgba(255,255,255,0.7)",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(ss,{size:18,color:"#8b5cf6"})," KPIs Engagement"]}),[{label:"Matchs / Utilisateur",value:i.users>0?(i.matches/i.users).toFixed(1):"0",color:"#ec4899"},{label:"Messages / Utilisateur",value:i.users>0?Math.round(vr.messagesCount/i.users):0,color:"#06b6d4"},{label:"Cadeaux / Utilisateur",value:i.users>0?(vr.totalGiftsSent/i.users).toFixed(1):"0",color:"#f97316"},{label:"Inscriptions cette semaine",value:vr.weeklySignups,color:"#22c55e"},{label:"Revenu moyen / user premium",value:i.premium>0?`${(vr.yearlyRevenue/i.premium).toFixed(2)}
2570â¬`:"0â¬",color:"#f59e0b"}].map((q,Ge)=>t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",borderRadius:"8px",marginBottom:"6px",background:"rgba(255,255,255,0.02)"},children:[t.jsx("span",{style:{fontSize:"0.82rem",color:"rgba(255,255,255,0.5)"},children:q.label}),t.jsx("span",{style:{fontWeight:"700",color:q.color,fontSize:"1rem",fontFamily:"Outfit"},children:q.value})]},Ge))]})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"16px",border:"1px solid rgba(255,255,255,0.06)",padding:"24px"},children:[t.jsxs("h3",{style:{margin:"0 0 16px 0",fontSize:"1rem",fontWeight:"600",color:"rgba(255,255,255,0.7)",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(Vs,{size:18,color:"#a78bfa"})," Dernières Transactions Meetips"]}),vr.recentTransactions.length===0?t.jsx("div",{style:{textAlign:"center",padding:"40px",color:"rgba(255,255,255,0.3)"},children:"Aucune transaction pour le moment."}):t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 2fr 1fr 1fr",padding:"8px 14px",fontSize:"0.7rem",color:"rgba(255,255,255,0.3)",textTransform:"uppercase",letterSpacing:"0.5px",borderBottom:"1px solid rgba(255,255,255,0.06)"},children:[t.jsx("span",{children:"Date"}),t.jsx("span",{children:"Description"}),t.jsx("span",{style:{textAlign:"right"},children:"Montant"}),t.jsx("span",{style:{textAlign:"right"},children:"Valeur â¬"})]}),vr.recentTransactions.map((q,Ge)=>{const ct=q.amount>0,Qe=ct&&{60:4.99,95:7.99,130:12.99,350:29.99}[q.amount]||null;return t.jsxs("div",{className:"admin-row",style:{display:"grid",gridTemplateColumns:"1fr 2fr 1fr 1fr",padding:"12px 14px",borderRadius:"8px",alignItems:"center",transition:"all 0.15s"},children:[t.jsx("span",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.4)"},children:new Date(q.created_at).toLocaleDateString("fr-FR",{day:"2-digit",month:"short"})}),t.jsx("span",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.7)"},children:q.description||"â"}),t.jsxs("span",{style:{textAlign:"right",fontWeight:"700",fontSize:"0.9rem",color:ct?"#22c55e":"#ef4444",display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"4px"},children:[ct?t.jsx(Ub,{size:14}):t.jsx(wA,{size:14}),ct?"+":"",q.amount]}),t.jsx("span",{style:{textAlign:"right",fontSize:"0.8rem",color:Qe?"#22c55e":"rgba(255,255,255,0.2)"},children:Qe?`${Qe.toFixed(2)}â¬`:"â"})]},q.id||Ge)})]})]}),t.jsxs("div",{style:{marginTop:"20px",padding:"20px 24px",borderRadius:"14px",background:"linear-gradient(135deg, rgba(99,91,255,0.1), rgba(124,58,237,0.05))",border:"1px solid rgba(99,91,255,0.2)",display:"flex",alignItems:"center",gap:"16px"},children:[t.jsx(Vs,{size:28,color:"#635bff"}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{fontWeight:"600",fontSize:"0.95rem",marginBottom:"4px"},children:"Revenus Stripe détaillés"}),t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.45)"},children:"Pour les revenus réels (abonnements, déverrouillages, packs), consultez votre Dashboard Stripe où toutes les transactions sont enregistrées avec détails complets."})]}),t.jsxs("a",{href:"https://dashboard.stripe.com/test/payments",target:"_blank",rel:"noopener noreferrer",style:{padding:"10px 20px",borderRadius:"10px",background:"#635bff",color:"white",textDecoration:"none",fontWeight:"600",fontSize:"0.85rem",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"6px"},children:["Voir les paiements ",t.jsx(Gn,{size:14})]})]})]}),o==="finances"&&(()=>{const We=Yr.animatedPhotosCount*.08,fe=vr.totalPacksPurchased,Se=Yr.premiumUsers,me=fe+Se,Je=Yr.totalPackRevenue+Yr.totalPremiumRevenue+Yr.totalUnlockRevenue,pt=me*.3+Je*.029,it=25+6.67+0+20+We+pt,Ke=Je-it,W=Ke>=0,se=[{label:"Supabase (BDD + Storage + Edge)",amount:25,icon:jg,color:"#3ecf8e",type:"fixed",detail:"Plan Pro mensuel"},{label:"Domaine & DNS",amount:6.67,icon:jg,color:"#60a5fa",type:"fixed",detail:"~18â¬/an"},{label:`Animations IA (${Yr.animatedPhotosCount} photos)`,amount:We,icon:vh,color:"#a78bfa",type:"variable",detail:`${Yr.animatedPhotosCount} à $${.08} (Replicate Wan 2.1)`},{label:`Frais Stripe (${me} transactions)`,amount:pt,icon:Vs,color:"#635bff",type:"variable",detail:"2.9% + 0.30â¬/tx"},{label:"Hébergement Vercel",amount:0,icon:jg,color:"#06b6d4",type:"fixed",detail
2570:"Gratuit (Free tier)"},{label:"Service Email (Resend Pro)",amount:20,icon:Vr,color:"#f97316",type:"fixed",detail:"Transactional Pro â 50k emails/mois"}],we=[{label:"Ventes de Packs Meetips",amount:Yr.totalPackRevenue,icon:oi,color:"#22c55e",detail:`${fe} packs vendus`},{label:"Abonnements Premium",amount:Yr.totalPremiumRevenue,icon:ni,color:"#f59e0b",detail:`${Yr.premiumUsers} abonnés à 9.99â¬`},{label:"Déverrouillages profils",amount:Yr.totalUnlockRevenue,icon:rr,color:"#ec4899",detail:"2.90⬠par déverrouillage"}];return t.jsxs("div",{children:[t.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"24px"},children:t.jsxs("h2",{style:{margin:0,fontFamily:"Outfit",fontSize:"1.3rem",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(Zd,{size:22,color:"#f97316"})," Finances â Coûts & Bénéfices"]})}),t.jsxs("div",{className:"admin-grid-3col",style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"16px",marginBottom:"28px"},children:[t.jsxs("div",{style:{background:"linear-gradient(135deg, #064e3b, #065f46)",borderRadius:"16px",padding:"22px",border:"1px solid rgba(34,197,94,0.15)",position:"relative",overflow:"hidden"},children:[t.jsx(Qb,{size:48,style:{position:"absolute",right:"-6px",bottom:"-6px",opacity:.08,color:"#22c55e"}}),t.jsx("div",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.5)",textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:"8px"},children:"Revenus Totaux"}),t.jsxs("div",{style:{fontSize:"2.2rem",fontWeight:"800",color:"#22c55e",fontFamily:"Outfit",lineHeight:1},children:[Je.toFixed(2),"â¬"]}),t.jsx("div",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.35)",marginTop:"8px"},children:"Depuis le début de l'année"})]}),t.jsxs("div",{style:{background:"linear-gradient(135deg, #4a1515, #5c1a1a)",borderRadius:"16px",padding:"22px",border:"1px solid rgba(239,68,68,0.15)",position:"relative",overflow:"hidden"},children:[t.jsx(Kb,{size:48,style:{position:"absolute",right:"-6px",bottom:"-6px",opacity:.08,color:"#ef4444"}}),t.jsx("div",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.5)",textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:"8px"},children:"Coûts Totaux"}),t.jsxs("div",{style:{fontSize:"2.2rem",fontWeight:"800",color:"#ef4444",fontFamily:"Outfit",lineHeight:1},children:[it.toFixed(2),"â¬"]}),t.jsx("div",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.35)",marginTop:"8px"},children:"Fixes + variables cumulés"})]}),t.jsxs("div",{style:{background:W?"linear-gradient(135deg, #1a3a2a, #1e4d3a)":"linear-gradient(135deg, #3b1515, #4a1a1a)",borderRadius:"16px",padding:"22px",border:`1px solid ${W?"rgba(34,197,94,0.2)":"rgba(239,68,68,0.2)"}`,position:"relative",overflow:"hidden"},children:[W?t.jsx(ba,{size:48,style:{position:"absolute",right:"-6px",bottom:"-6px",opacity:.08,color:"#22c55e"}}):t.jsx(qA,{size:48,style:{position:"absolute",right:"-6px",bottom:"-6px",opacity:.08,color:"#ef4444"}}),t.jsx("div",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.5)",textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:"8px"},children:W?"â
Bénéfice Net":"â ï¸ Perte Nette"}),t.jsxs("div",{style:{fontSize:"2.2rem",fontWeight:"800",color:W?"#22c55e":"#ef4444",fontFamily:"Outfit",lineHeight:1},children:[W?"+":"",Ke.toFixed(2),"â¬"]}),t.jsx("div",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.35)",marginTop:"8px"},children:"Revenus â Coûts"})]})]}),t.jsxs("div",{className:"admin-grid-2col",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"20px",marginBottom:"28px"},children:[t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"16px",border:"1px solid rgba(255,255,255,0.06)",padding:"24px"},children:[t.jsxs("h3",{style:{margin:"0 0 20px 0",fontSize:"1rem",fontWeight:"600",color:"rgba(255,255,255,0.7)",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(Kb,{size:18,color:"#ef4444"})," Détail des Coûts"]}),se.map((ge,oe)=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"14px",borderRadius:"10px",marginBottom:"8px",background:"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.04)"},children:[t.jsx("div",{style:{width:"36px",height:"36px",borderRadius:"10px",background:`${ge.color}15`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t.jsx(ge.icon,{size:18,color:ge.color})}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.7)",fontWeight:"500"},children:ge.label}),t.jsx("div",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.35)",marginTop:"2px"},children:ge.detail})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:[t.jsx("span",{style:{fontWeight:"700",color:ge.amount>0?"#ef4444":"rgba(255,255,255,0.3)",fontSize:"1rem",fontFamily:"Outfit"},children:ge.amount>0?`-${ge.amount.toFixed(2)}â¬`:"Gratuit"}),t.jsx("span",{style:{fontSize:"0.65rem",color:"rgba(255,255,255,0.25)",marginTop:"2px"},children:ge.type==="fixed"?"ð Fixe":"ð Variable"})]})]},oe)),t.jsxs("div",{style:{marginTop:"16px",padding:"14px 18px",borderRadius:"12px",background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.15)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t.jsx("span",{style:{fontWeight:"600",color:"rgba(255,255,255,0.7)",fontSize:"0.9rem"},children:"Total Coûts"}),t.jsxs("span",{style:{fontWeight:"800",color:"#ef4444",fontSize:"1.2rem",fontFamily:"Outfit"}
2570,children:["-",it.toFixed(2),"â¬"]})]})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"16px",border:"1px solid rgba(255,255,255,0.06)",padding:"24px"},children:[t.jsxs("h3",{style:{margin:"0 0 20px 0",fontSize:"1rem",fontWeight:"600",color:"rgba(255,255,255,0.7)",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(Qb,{size:18,color:"#22c55e"})," Sources de Revenus"]}),we.map((ge,oe)=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"14px",borderRadius:"10px",marginBottom:"8px",background:"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.04)"},children:[t.jsx("div",{style:{width:"36px",height:"36px",borderRadius:"10px",background:`${ge.color}15`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t.jsx(ge.icon,{size:18,color:ge.color})}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.7)",fontWeight:"500"},children:ge.label}),t.jsx("div",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.35)",marginTop:"2px"},children:ge.detail})]}),t.jsx("span",{style:{fontWeight:"700",color:ge.amount>0?"#22c55e":"rgba(255,255,255,0.3)",fontSize:"1rem",fontFamily:"Outfit"},children:ge.amount>0?`+${ge.amount.toFixed(2)}â¬`:"0.00â¬"})]},oe)),t.jsxs("div",{style:{marginTop:"16px",padding:"14px 18px",borderRadius:"12px",background:"rgba(34,197,94,0.08)",border:"1px solid rgba(34,197,94,0.15)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t.jsx("span",{style:{fontWeight:"600",color:"rgba(255,255,255,0.7)",fontSize:"0.9rem"},children:"Total Revenus"}),t.jsxs("span",{style:{fontWeight:"800",color:"#22c55e",fontSize:"1.2rem",fontFamily:"Outfit"},children:["+",Je.toFixed(2),"â¬"]})]})]})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"16px",border:"1px solid rgba(255,255,255,0.06)",padding:"24px"},children:[t.jsxs("h3",{style:{margin:"0 0 20px 0",fontSize:"1rem",fontWeight:"600",color:"rgba(255,255,255,0.7)",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(Zd,{size:18,color:"#f97316"})," Balance Bénéfices / Pertes"]}),t.jsxs("div",{style:{display:"flex",gap:"4px",height:"32px",borderRadius:"8px",overflow:"hidden",marginBottom:"12px"},children:[Je>0&&t.jsx("div",{style:{width:`${Je/(Je+it)*100}%`,background:"linear-gradient(90deg, #22c55e, #16a34a)",borderRadius:"8px 0 0 8px",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx("span",{style:{fontSize:"0.75rem",fontWeight:"700",color:"white"},children:"Revenus"})}),it>0&&t.jsx("div",{style:{width:`${it/(Je+it)*100}%`,background:"linear-gradient(90deg, #ef4444, #dc2626)",borderRadius:"0 8px 8px 0",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx("span",{style:{fontSize:"0.75rem",fontWeight:"700",color:"white"},children:"Coûts"})})]}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.8rem",color:"rgba(255,255,255,0.5)"},children:[t.jsxs("span",{children:["+",Je.toFixed(2),"⬠revenus"]}),t.jsxs("span",{style:{fontWeight:"700",color:W?"#22c55e":"#ef4444",fontSize:"0.9rem"},children:["Résultat : ",W?"+":"",Ke.toFixed(2),"â¬"]}),t.jsxs("span",{children:["-",it.toFixed(2),"⬠coûts"]})]})]}),t.jsxs("div",{style:{marginTop:"20px",padding:"20px 24px",borderRadius:"14px",background:"linear-gradient(135deg, rgba(249,115,22,0.1), rgba(249,115,22,0.02))",border:"1px solid rgba(249,115,22,0.15)",display:"flex",alignItems:"flex-start",gap:"16px"},children:[t.jsx(Zd,{size:28,color:"#f97316",style:{flexShrink:0,marginTop:"2px"}}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{fontWeight:"600",fontSize:"0.95rem",marginBottom:"6px"},children:"ð Note sur les coûts"}),t.jsxs("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.45)",lineHeight:1.5},children:["Les coûts affichés sont des estimations basées sur les prix actuels des services. Les coûts variables (animations IA, frais Stripe) sont calculés dynamiquement. Les coûts fixes (Supabase, domaine) sont des constantes configurables dans le code. Pour les frais Stripe exacts, consultez votre ",t.jsx("a",{href:"https://dashboard.stripe.com",target:"_blank",rel:"noopener noreferrer",style:{color:"#635bff",textDecoration:"underline"},children:"Dashboard Stripe"}),"."]})]})]})]})})(),o==="partenaires"&&t.jsxs("div",{children:[t.jsxs("h2",{style:{margin:"0 0 8px 0",fontSize:"1.4rem",fontWeight:"700",fontFamily:"Outfit",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(Yb,{size:24,color:"#06b6d4"})," Partenaires & Services"]}),t.jsx("p",{style:{margin:"0 0 28px 0",fontSize:"0.85rem",color:"rgba(255,255,255,0.45)"},children:"Tous les services tiers utilisés pour faire fonctionner MEETYOU.AI â avec coûts, rôles et liens utiles."}),t.jsxs("div",{className:"admin-grid-partners",style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(360px, 1fr))",gap:"20px"},children:[t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"20px",border:"1px solid rgba(62,207,142,0.15)",padding:"24px",position:"relative",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"3px",background:"linear-gradient(90deg, #3ecf8e, #1c8656)"}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"16
2570px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[t.jsx("div",{style:{width:"48px",height:"48px",borderRadius:"14px",background:"linear-gradient(135deg, rgba(62,207,142,0.2), rgba(62,207,142,0.05))",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.4rem"},children:"ð¢"}),t.jsxs("div",{children:[t.jsx("h3",{style:{margin:0,fontSize:"1.1rem",fontWeight:"700"},children:"Supabase"}),t.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"rgba(255,255,255,0.4)"},children:"Backend-as-a-Service"})]})]}),t.jsx("span",{style:{padding:"4px 10px",borderRadius:"8px",background:"rgba(34,197,94,0.15)",color:"#22c55e",fontSize:"0.7rem",fontWeight:"700"},children:"ACTIF"})]}),t.jsxs("div",{style:{marginBottom:"16px"},children:[t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.6)",marginBottom:"8px",fontWeight:"600"},children:"ð¯ Rôle :"}),t.jsxs("ul",{style:{margin:0,paddingLeft:"16px",fontSize:"0.78rem",color:"rgba(255,255,255,0.5)",lineHeight:1.8},children:[t.jsx("li",{children:"Base de données PostgreSQL (profiles, matches, messages...)"}),t.jsx("li",{children:"Authentification (inscription, login, OAuth)"}),t.jsx("li",{children:"Stockage fichiers (photos, vidéos animées)"}),t.jsx("li",{children:"Edge Functions (send-email, animate-photo, send-push-notification)"}),t.jsx("li",{children:"Realtime (notifications temps réel)"})]})]}),t.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",marginBottom:"12px"},children:t.jsx("span",{style:{padding:"4px 10px",borderRadius:"8px",background:"rgba(62,207,142,0.1)",color:"#3ecf8e",fontSize:"0.7rem",fontWeight:"600"},children:"ð° Free tier â $25/mois (Pro)"})}),t.jsxs("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.35)",marginBottom:"12px"},children:[t.jsx("strong",{children:"Clé API :"})," ",t.jsx("code",{style:{background:"rgba(255,255,255,0.08)",padding:"2px 6px",borderRadius:"4px",fontSize:"0.7rem"},children:"VITE_SUPABASE_URL"})," + ",t.jsx("code",{style:{background:"rgba(255,255,255,0.08)",padding:"2px 6px",borderRadius:"4px",fontSize:"0.7rem"},children:"VITE_SUPABASE_ANON_KEY"})," dans .env"]}),t.jsxs("a",{href:"https://supabase.com/dashboard",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:"6px",fontSize:"0.8rem",color:"#3ecf8e",textDecoration:"none",fontWeight:"600"},children:[t.jsx(Gn,{size:14})," Dashboard Supabase â"]})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"20px",border:"1px solid rgba(99,91,255,0.15)",padding:"24px",position:"relative",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"3px",background:"linear-gradient(90deg, #635bff, #7a73ff)"}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"16px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[t.jsx("div",{style:{width:"48px",height:"48px",borderRadius:"14px",background:"linear-gradient(135deg, rgba(99,91,255,0.2), rgba(99,91,255,0.05))",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.4rem"},children:"ð³"}),t.jsxs("div",{children:[t.jsx("h3",{style:{margin:0,fontSize:"1.1rem",fontWeight:"700"},children:"Stripe"}),t.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"rgba(255,255,255,0.4)"},children:"Paiements en ligne"})]})]}),t.jsx("span",{style:{padding:"4px 10px",borderRadius:"8px",background:"rgba(34,197,94,0.15)",color:"#22c55e",fontSize:"0.7rem",fontWeight:"700"},children:"ACTIF"})]}),t.jsxs("div",{style:{marginBottom:"16px"},children:[t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.6)",marginBottom:"8px",fontWeight:"600"},children:"ð¯ Rôle :"}),t.jsxs("ul",{style:{margin:0,paddingLeft:"16px",fontSize:"0.78rem",color:"rgba(255,255,255,0.5)",lineHeight:1.8},children:[t.jsx("li",{children:"Paiement des packs Meetips (Starter, Regular, Pro, Ultimate)"}),t.jsx("li",{children:"Abonnement Premium mensuel"}),t.jsx("li",{children:"Déblocage de profils (paiement unique)"}),t.jsx("li",{children:"Payment Links (pages de paiement hébergées)"}),t.jsx("li",{children:"Customer Portal (gestion abonnement)"})]})]}),t.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",marginBottom:"12px"},children:t.jsx("span",{style:{padding:"4px 10px",borderRadius:"8px",background:"rgba(99,91,255,0.1)",color:"#635bff",fontSize:"0.7rem",fontWeight:"600"},children:"ð° Commission : 1.4% + 0.25⬠/ transaction"})}),t.jsxs("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.35)",marginBottom:"12px"},children:[t.jsx("strong",{children:"Clé API :"})," ",t.jsx("code",{style:{background:"rgba(255,255,255,0.08)",padding:"2px 6px",borderRadius:"4px",fontSize:"0.7rem"},children:"VITE_STRIPE_PUBLIC_KEY"})," dans .env + divers ",t.jsx("code",{style:{background:"rgba(255,255,255,0.08)",padding:"2px 6px",borderRadius:"4px",fontSize:"0.7rem"},children:"VITE_STRIPE_LINK_*"})]}),t.jsxs("a",{href:"https://dashboard.stripe.com",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:"6px",fontSize:"0.8rem",color:"#635bff",textDecoration:"none",fontWeight:"600"},children:[t.jsx(Gn,{size:14})," Dashboard Stripe â"]})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"20px",border:"1px solid rgba(0,0,0,0.15)",padding:"24px",position:"relative",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"3px",background:"linear-gradient(90deg, #000, #333)"}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"16
2570px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[t.jsx("div",{style:{width:"48px",height:"48px",borderRadius:"14px",background:"linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.03))",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.4rem"},children:"ð§"}),t.jsxs("div",{children:[t.jsx("h3",{style:{margin:0,fontSize:"1.1rem",fontWeight:"700"},children:"Resend"}),t.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"rgba(255,255,255,0.4)"},children:"Service d'emails transactionnels"})]})]}),t.jsx("span",{style:{padding:"4px 10px",borderRadius:"8px",background:"rgba(34,197,94,0.15)",color:"#22c55e",fontSize:"0.7rem",fontWeight:"700"},children:"ACTIF"})]}),t.jsxs("div",{style:{marginBottom:"16px"},children:[t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.6)",marginBottom:"8px",fontWeight:"600"},children:"ð¯ Rôle :"}),t.jsxs("ul",{style:{margin:0,paddingLeft:"16px",fontSize:"0.78rem",color:"rgba(255,255,255,0.5)",lineHeight:1.8},children:[t.jsx("li",{children:"Emails de bienvenue aux nouveaux inscrits"}),t.jsx("li",{children:"Notifications de bannissement / avertissement"}),t.jsx("li",{children:"Emails de vérification d'identité (accepté/refusé)"}),t.jsx("li",{children:"Reset de mot de passe"})]})]}),t.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",marginBottom:"12px"},children:t.jsx("span",{style:{padding:"4px 10px",borderRadius:"8px",background:"rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.6)",fontSize:"0.7rem",fontWeight:"600"},children:"ð° $20/mois â Transactional Pro (50 000 emails/mois)"})}),t.jsxs("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.35)",marginBottom:"12px"},children:[t.jsx("strong",{children:"Clé API :"})," ",t.jsx("code",{style:{background:"rgba(255,255,255,0.08)",padding:"2px 6px",borderRadius:"4px",fontSize:"0.7rem"},children:"RESEND_API_KEY"})," dans Supabase Secrets (Edge Function: send-email)"]}),t.jsxs("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.35)",marginBottom:"12px"},children:[t.jsx("strong",{children:"â
Domaines vérifiés :"})," ",t.jsx("code",{style:{background:"rgba(34,197,94,0.15)",padding:"2px 6px",borderRadius:"4px",fontSize:"0.7rem",color:"#22c55e"},children:"meeteros.ai"})," + ",t.jsx("code",{style:{background:"rgba(34,197,94,0.15)",padding:"2px 6px",borderRadius:"4px",fontSize:"0.7rem",color:"#22c55e"},children:"meetapps.ai"})," â Envoi depuis ",t.jsx("code",{style:{background:"rgba(255,255,255,0.08)",padding:"2px 6px",borderRadius:"4px",fontSize:"0.7rem"},children:"[email protected]"})]}),t.jsxs("a",{href:"https://resend.com/emails",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:"6px",fontSize:"0.8rem",color:"white",textDecoration:"none",fontWeight:"600"},children:[t.jsx(Gn,{size:14})," Dashboard Resend â"]})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"20px",border:"1px solid rgba(239,68,68,0.15)",padding:"24px",position:"relative",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"3px",background:"linear-gradient(90deg, #ef4444, #b91c1c)"}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"16px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[t.jsx("div",{style:{width:"48px",height:"48px",borderRadius:"14px",background:"linear-gradient(135deg, rgba(239,68,68,0.2), rgba(239,68,68,0.05))",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.4rem"},children:"ð¬"}),t.jsxs("div",{children:[t.jsx("h3",{style:{margin:0,fontSize:"1.1rem",fontWeight:"700"},children:"xAI (Grok)"}),t.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"rgba(255,255,255,0.4)"},children:"Animation photo â vidéo IA"})]})]}),t.jsx("span",{style:{padding:"4px 10px",borderRadius:"8px",background:"rgba(34,197,94,0.15)",color:"#22c55e",fontSize:"0.7rem",fontWeight:"700"},children:"ACTIF"})]}
2570),t.jsxs("div",{style:{marginBottom:"16px"},children:[t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.6)",marginBottom:"8px",fontWeight:"600"},children:"ð¯ Rôle :"}),t.jsxs("ul",{style:{margin:0,paddingLeft:"16px",fontSize:"0.78rem",color:"rgba(255,255,255,0.5)",lineHeight:1.8},children:[t.jsx("li",{children:"Génération de vidéos animées à partir de photos de profil"}),t.jsx("li",{children:"Animation des photos de bots (admin)"}),t.jsx("li",{children:"Animation des photos d'utilisateurs (coût en Meetips)"}),t.jsx("li",{children:"API asynchrone : submit â polling â résultat"})]})]}),t.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",marginBottom:"12px"},children:t.jsx("span",{style:{padding:"4px 10px",borderRadius:"8px",background:"rgba(239,68,68,0.1)",color:"#ef4444",fontSize:"0.7rem",fontWeight:"600"},children:"ð° ~$0.05 par animation (pay-per-use)"})}),t.jsxs("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.35)",marginBottom:"12px"},children:[t.jsx("strong",{children:"Clé API :"})," ",t.jsx("code",{style:{background:"rgba(255,255,255,0.08)",padding:"2px 6px",borderRadius:"4px",fontSize:"0.7rem"},children:"VITE_XAI_API_KEY"})," dans .env â proxied via Edge Function ",t.jsx("code",{style:{background:"rgba(255,255,255,0.08)",padding:"2px 6px",borderRadius:"4px",fontSize:"0.7rem"},children:"animate-photo"})]}),t.jsxs("a",{href:"https://console.x.ai",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:"6px",fontSize:"0.8rem",color:"#ef4444",textDecoration:"none",fontWeight:"600"},children:[t.jsx(Gn,{size:14})," Console xAI â"]})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"20px",border:"1px solid rgba(66,133,244,0.15)",padding:"24px",position:"relative",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"3px",background:"linear-gradient(90deg, #4285f4, #34a853, #fbbc05, #ea4335)"}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"16px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[t.jsx("div",{style:{width:"48px",height:"48px",borderRadius:"14px",background:"linear-gradient(135deg, rgba(66,133,244,0.2), rgba(66,133,244,0.05))",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.4rem"},children:"ð¤"}),t.jsxs("div",{children:[t.jsx("h3",{style:{margin:0,fontSize:"1.1rem",fontWeight:"700"},children:"Google Gemini"}),t.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"rgba(255,255,255,0.4)"},children:"IA conversationnelle (chatbot)"})]})]}),t.jsx("span",{style:{padding:"4px 10px",borderRadius:"8px",background:"rgba(34,197,94,0.15)",color:"#22c55e",fontSize:"0.7rem",fontWeight:"700"},children:"ACTIF"})]}),t.jsxs("div",{style:{marginBottom:"16px"},children:[t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.6)",marginBottom:"8px",fontWeight:"600"},children:"ð¯ Rôle :"}),t.jsxs("ul",{style:{margin:0,paddingLeft:"16px",fontSize:"0.78rem",color:"rgba(255,255,255,0.5)",lineHeight:1.8},children:[t.jsx("li",{children:"Conversations IA des bots animateurs (chat en streaming)"}),t.jsx("li",{children:"Personnalités dynamiques (bienveillant, taquin, sage, audacieux)"}),t.jsx("li",{children:"Contexte utilisateur injecté (profil, préférences)"}),t.jsxs("li",{children:["Modèle : ",t.jsx("strong",{children:"Gemini 2.0 Flash"})," (rapide, économique)"]})]})]}),t.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",marginBottom:"12px"},children:t.jsx("span",{style:{padding:"4px 10px",borderRadius:"8px",background:"rgba(66,133,244,0.1)",color:"#4285f4",fontSize:"0.7rem",fontWeight:"600"},children:"ð° Gratuit : 15 req/min â Pay-as-you-go (~$0.0001/message)"})}),t.jsxs("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.35)",marginBottom:"12px"},children:[t.jsx("strong",{children:"Clé API :"})," ",t.jsx("code",{style:{background:"rgba(255,255,255,0.08)",padding:"2px 6px",borderRadius:"4px",fontSize:"0.7rem"},children:"VITE_GEMINI_API_KEY"})," dans .env â appel direct côté client (streaming)"]}),t.jsxs("a",{href:"https://aistudio.google.com/apikey",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:"6px",fontSize:"0.8rem",color:"#4285f4",textDecoration:"none",fontWeight:"600"},children:[t.jsx(Gn,{size:14})," Google AI Studio â"]})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"20px",border:"1px solid rgba(124,179,66,0.15)",padding:"24px",position:"relative",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"3px",background:"linear-gradient(90deg, #7cb342, #558b2f)"}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"16
2570px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[t.jsx("div",{style:{width:"48px",height:"48px",borderRadius:"14px",background:"linear-gradient(135deg, rgba(124,179,66,0.2), rgba(124,179,66,0.05))",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.4rem"},children:"ð"}),t.jsxs("div",{children:[t.jsx("h3",{style:{margin:0,fontSize:"1.1rem",fontWeight:"700"},children:"Nominatim (OSM)"}),t.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"rgba(255,255,255,0.4)"},children:"Géocodage / localisation"})]})]}),t.jsx("span",{style:{padding:"4px 10px",borderRadius:"8px",background:"rgba(34,197,94,0.15)",color:"#22c55e",fontSize:"0.7rem",fontWeight:"700"},children:"ACTIF"})]}),t.jsxs("div",{style:{marginBottom:"16px"},children:[t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.6)",marginBottom:"8px",fontWeight:"600"},children:"ð¯ Rôle :"}),t.jsxs("ul",{style:{margin:0,paddingLeft:"16px",fontSize:"0.78rem",color:"rgba(255,255,255,0.5)",lineHeight:1.8},children:[t.jsx("li",{children:"Conversion ville â coordonnées GPS (géocodage)"}),t.jsx("li",{children:"Conversion GPS â nom de ville (reverse geocoding)"}),t.jsx("li",{children:"Calcul de distance entre utilisateurs pour le matching"})]})]}),t.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",marginBottom:"12px"},children:t.jsx("span",{style:{padding:"4px 10px",borderRadius:"8px",background:"rgba(124,179,66,0.1)",color:"#7cb342",fontSize:"0.7rem",fontWeight:"600"},children:"ð° 100% GRATUIT (open source) â max 1 req/sec"})}),t.jsxs("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.35)",marginBottom:"12px"},children:[t.jsx("strong",{children:"Pas de clé API"})," â API publique OpenStreetMap, juste un User-Agent requis"]}),t.jsxs("a",{href:"https://nominatim.openstreetmap.org",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:"6px",fontSize:"0.8rem",color:"#7cb342",textDecoration:"none",fontWeight:"600"},children:[t.jsx(Gn,{size:14})," Nominatim OSM â"]})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"20px",border:"1px solid rgba(251,146,60,0.15)",padding:"24px",position:"relative",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"3px",background:"linear-gradient(90deg, #fb923c, #ea580c)"}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"16px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[t.jsx("div",{style:{width:"48px",height:"48px",borderRadius:"14px",background:"linear-gradient(135deg, rgba(251,146,60,0.2), rgba(251,146,60,0.05))",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.4rem"},children:"ð"}),t.jsxs("div",{children:[t.jsx("h3",{style:{margin:0,fontSize:"1.1rem",fontWeight:"700"},children:"Web Push (VAPID)"}),t.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"rgba(255,255,255,0.4)"},children:"Notifications push navigateur"})]})]}),t.jsx("span",{style:{padding:"4px 10px",borderRadius:"8px",background:"rgba(34,197,94,0.15)",color:"#22c55e",fontSize:"0.7rem",fontWeight:"700"},children:"ACTIF"})]}),t.jsxs("div",{style:{marginBottom:"16px"},children:[t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.6)",marginBottom:"8px",fontWeight:"600"},children:"ð¯ Rôle :"}),t.jsxs("ul",{style:{margin:0,paddingLeft:"16px",fontSize:"0.78rem",color:"rgba(255,255,255,0.5)",lineHeight:1.8},children:[t.jsx("li",{children:"Notifications push dans le navigateur (nouveaux messages, matchs)"}),t.jsxs("li",{children:["Edge Function : ",t.jsx("code",{style:{background:"rgba(255,255,255,0.08)",padding:"2px 4px",borderRadius:"3px"},children:"send-push-notification"})]}),t.jsx("li",{children:"Protocole VAPID (clé publique + clé privée)"})]})]}),t.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",marginBottom:"12px"},children:t.jsx("span",{style:{padding:"4px 10px",borderRadius:"8px",background:"rgba(251,146,60,0.1)",color:"#fb923c",fontSize:"0.7rem",fontWeight:"600"},children:"ð° 100% GRATUIT (standard Web Push)"})}),t.jsxs("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.35)",marginBottom:"12px"},children:[t.jsx("strong",{children:"Clé API :"})," ",t.jsx("code",{style:{background:"rgba(255,255,255,0.08)",padding:"2px 6px",borderRadius:"4px",fontSize:"0.7rem"},children:"VITE_VAPID_PUBLIC_KEY"})," dans .env + private key dans Supabase Secrets"]})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"20px",border:"1px solid rgba(255,255,255,0.15)",padding:"24px",position:"relative",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"3px",background:"linear-gradient(90deg, #000, #fff)"}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"16
2570px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[t.jsx("div",{style:{width:"48px",height:"48px",borderRadius:"14px",background:"linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.03))",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.4rem"},children:"â²"}),t.jsxs("div",{children:[t.jsx("h3",{style:{margin:0,fontSize:"1.1rem",fontWeight:"700"},children:"Vercel"}),t.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"rgba(255,255,255,0.4)"},children:"Hébergement Frontend (CDN)"})]})]}),t.jsx("span",{style:{padding:"4px 10px",borderRadius:"8px",background:"rgba(34,197,94,0.15)",color:"#22c55e",fontSize:"0.7rem",fontWeight:"700"},children:"ACTIF"})]}),t.jsxs("div",{style:{marginBottom:"16px"},children:[t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.6)",marginBottom:"8px",fontWeight:"600"},children:"ð¯ Rôle :"}),t.jsxs("ul",{style:{margin:0,paddingLeft:"16px",fontSize:"0.78rem",color:"rgba(255,255,255,0.5)",lineHeight:1.8},children:[t.jsx("li",{children:"Hébergement de l'application React (fichiers statiques)"}),t.jsx("li",{children:"CDN mondial (50+ datacenters) â chargement ultra rapide"}),t.jsxs("li",{children:["Déploiement en une commande (",t.jsx("code",{style:{background:"rgba(255,255,255,0.08)",padding:"2px 4px",borderRadius:"3px"},children:"vercel --prod"}),")"]}),t.jsx("li",{children:"Preview deployments pour chaque mise à jour"}),t.jsx("li",{children:"HTTPS automatique"})]})]}),t.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",marginBottom:"12px"},children:t.jsx("span",{style:{padding:"4px 10px",borderRadius:"8px",background:"rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.6)",fontSize:"0.7rem",fontWeight:"600"},children:"ð° Gratuit (Hobby) â $20/mois (Pro)"})}),t.jsxs("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.35)",marginBottom:"12px"},children:[t.jsx("strong",{children:"Projet :"})," ",t.jsx("code",{style:{background:"rgba(255,255,255,0.08)",padding:"2px 6px",borderRadius:"4px",fontSize:"0.7rem"},children:"solitary-kepler"})," â URL : ",t.jsx("code",{style:{background:"rgba(255,255,255,0.08)",padding:"2px 6px",borderRadius:"4px",fontSize:"0.7rem"},children:"solitary-kepler.vercel.app"})]}),t.jsxs("a",{href:"https://vercel.com/meet-you",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:"6px",fontSize:"0.8rem",color:"white",textDecoration:"none",fontWeight:"600"},children:[t.jsx(Gn,{size:14})," Dashboard Vercel â"]})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"20px",border:"1px solid rgba(0,62,140,0.25)",padding:"24px",position:"relative",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"3px",background:"linear-gradient(90deg, #003e8c, #0050b3)"}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"16px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[t.jsx("div",{style:{width:"48px",height:"48px",borderRadius:"14px",background:"linear-gradient(135deg, rgba(0,62,140,0.25), rgba(0,62,140,0.05))",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.4rem"},children:"ð"}),t.jsxs("div",{children:[t.jsx("h3",{style:{margin:0,fontSize:"1.1rem",fontWeight:"700"},children:"OVHcloud"}),t.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"rgba(255,255,255,0.4)"},children:"Noms de domaine & DNS"})]})]}),t.jsx("span",{style:{padding:"4px 10px",borderRadius:"8px",background:"rgba(245,158,11,0.15)",color:"#f59e0b",fontSize:"0.7rem",fontWeight:"700"},children:"EN COURS"})]}),t.jsxs("div",{style:{marginBottom:"16px"},children:[t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.6)",marginBottom:"8px",fontWeight:"600"},children:"ð¯ Rôle :"}),t.jsxs("ul",{style:{margin:0,paddingLeft:"16px",fontSize:"0.78rem",color:"rgba(255,255,255,0.5)",lineHeight:1.8},children:[t.jsx("li",{children:"Gestion des noms de domaine de la marque"}),t.jsx("li",{children:"Configuration DNS (pointage vers Vercel)"}
2570),t.jsx("li",{children:"Protection de la marque (domaines multiples)"}),t.jsx("li",{children:"Email professionnel inclus (1 Zimbra Starter / domaine)"})]})]}),t.jsxs("div",{style:{marginBottom:"16px"},children:[t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.6)",marginBottom:"8px",fontWeight:"600"},children:"ð Domaines achetés :"}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:["meetapps.ai","meeteros.fr","meetfriend.fr","meetx.fr","meeterox.com","meeterox.fr"].map(q=>t.jsxs("span",{style:{padding:"4px 10px",borderRadius:"8px",background:q==="meetapps.ai"?"rgba(0,62,140,0.2)":"rgba(255,255,255,0.05)",border:`1px solid ${q==="meetapps.ai"?"rgba(0,62,140,0.4)":"rgba(255,255,255,0.08)"}`,color:q==="meetapps.ai"?"#60a5fa":"rgba(255,255,255,0.5)",fontSize:"0.75rem",fontWeight:q==="meetapps.ai"?"700":"500"},children:[q==="meetapps.ai"&&"â ",q]},q))})]}),t.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",marginBottom:"12px"},children:t.jsx("span",{style:{padding:"4px 10px",borderRadius:"8px",background:"rgba(0,62,140,0.1)",color:"#60a5fa",fontSize:"0.7rem",fontWeight:"600"},children:"ð° ~10-15â¬/an par domaine (.fr) · ~25â¬/an (.ai)"})}),t.jsxs("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.35)",marginBottom:"12px"},children:[t.jsx("strong",{children:"âï¸ Config DNS :"})," Ajouter un enregistrement ",t.jsx("code",{style:{background:"rgba(255,255,255,0.08)",padding:"2px 6px",borderRadius:"4px",fontSize:"0.7rem"},children:"A â 76.76.21.21"})," + ",t.jsx("code",{style:{background:"rgba(255,255,255,0.08)",padding:"2px 6px",borderRadius:"4px",fontSize:"0.7rem"},children:"CNAME www â cname.vercel-dns.com"})]}),t.jsxs("a",{href:"https://manager.eu.ovhcloud.com",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:"6px",fontSize:"0.8rem",color:"#60a5fa",textDecoration:"none",fontWeight:"600"},children:[t.jsx(Gn,{size:14})," Espace Client OVH â"]})]})]}),t.jsxs("div",{style:{marginTop:"28px",padding:"24px",borderRadius:"16px",background:"linear-gradient(135deg, rgba(6,182,212,0.08), rgba(6,182,212,0.02))",border:"1px solid rgba(6,182,212,0.15)"},children:[t.jsxs("h3",{style:{margin:"0 0 16px",fontSize:"1rem",fontWeight:"700",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(Zd,{size:18,color:"#06b6d4"})," Résumé des coûts mensuels estimés"]}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"12px"},children:[{name:"Supabase",cost:"Free â $25",color:"#3ecf8e"},{name:"Stripe",cost:"1.4% + 0.25â¬/tx",color:"#635bff"},{name:"Resend",cost:"$20/mois (Pro)",color:"white"},{name:"xAI",cost:"~$0.05/anim",color:"#ef4444"},{name:"Gemini",cost:"Free â ~$0.01",color:"#4285f4"},{name:"Nominatim",cost:"Gratuit",color:"#7cb342"},{name:"Web Push",cost:"Gratuit",color:"#fb923c"},{name:"Vercel",cost:"Free â $20",color:"white"},{name:"OVHcloud",cost:"~80â¬/an (6 domaines)",color:"#60a5fa"}].map(q=>t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"10px 14px",borderRadius:"10px",background:"rgba(255,255,255,0.04)"},children:[t.jsx("span",{style:{fontSize:"0.8rem",fontWeight:"600",color:q.color},children:q.name}),t.jsx("span",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.5)",fontWeight:"500"},children:q.cost})]},q.name))}),t.jsxs("div",{style:{marginTop:"16px",fontSize:"0.78rem",color:"rgba(255,255,255,0.4)",lineHeight:1.6},children:["ð¡ ",t.jsx("strong",{children:"En phase de lancement"}),", la plupart des services sont en ",t.jsx("strong",{children:"free tier"}),". Les coûts augmenteront avec le nombre d'utilisateurs. Stripe est le seul coût obligatoire (commission par transaction)."]})]})]}),o==="support"&&t.jsxs("div",{children:[t.jsxs("h2",{style:{margin:"0 0 8px 0",fontFamily:"Outfit",fontSize:"1.3rem",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(Vr,{size:22,color:"#f43f5e"})," Support â Demandes d'aide"]}),t.jsxs("p",{style:{color:"rgba(255,255,255,0.4)",marginBottom:"24px",fontSize:"0.9rem"},children:["Messages reçus des utilisateurs via le chatbot d'aide. Email: ",t.jsx("strong",{style:{color:"#f43f5e"},children:"[email protected]"})]}),vn.length===0&&t.jsxs("div",{style:{textAlign:"center",padding:"60px",color:"rgba(255,255,255,0.4)"},children:[t.jsx(ms,{size:48,color:"#10b981",style:{marginBottom:"16
2570px"}}),t.jsx("p",{children:"Aucune demande de support. Tout roule ! ð"})]}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:vn.map(q=>{var bt,Ee,We,fe;const Ge=q.status==="open",ct=q.status==="replied",et=Ge?"#f59e0b":ct?"#10b981":"rgba(255,255,255,0.3)",Qe=Ge?"En attente":ct?"Répondu":"Fermé";return t.jsxs("div",{style:{background:Ge?"rgba(244,63,94,0.08)":ct?"rgba(16,185,129,0.05)":"rgba(255,255,255,0.04)",borderRadius:"16px",border:`1px solid ${Ge?"rgba(244,63,94,0.25)":ct?"rgba(16,185,129,0.2)":"rgba(255,255,255,0.1)"}`,padding:"20px",transition:"all 0.2s",boxShadow:Ge?"0 2px 12px rgba(244,63,94,0.08)":"0 1px 6px rgba(0,0,0,0.2)"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"12px",flexWrap:"wrap",gap:"8px"},children:[t.jsxs("div",{children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"6px"},children:[t.jsx("span",{style:{fontWeight:"700",fontSize:"1rem",color:"white"},children:q.user_name||"Anonyme"}),t.jsx("span",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.4)"},children:q.user_email})]}),t.jsx("div",{style:{fontSize:"0.95rem",fontWeight:"600",color:"#f43f5e",marginBottom:"4px"},children:q.subject||"Sans sujet"}),t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.4)"},children:new Date(q.created_at).toLocaleString("fr-FR")})]}),t.jsx("span",{style:{padding:"4px 12px",borderRadius:"8px",fontSize:"0.75rem",fontWeight:"700",background:`${et}20`,color:et,border:`1px solid ${et}40`},children:Qe})]}),t.jsx("div",{style:{padding:"14px",borderRadius:"12px",background:"rgba(255,255,255,0.07)",border:"1px solid rgba(255,255,255,0.12)",marginBottom:"12px",fontSize:"0.9rem",lineHeight:"1.6",color:"rgba(255,255,255,0.9)",whiteSpace:"pre-wrap"},children:q.message}),q.admin_reply&&t.jsxs("div",{style:{padding:"14px",borderRadius:"12px",background:"rgba(16,185,129,0.1)",border:"1px solid rgba(16,185,129,0.25)",marginBottom:"12px",fontSize:"0.85rem",lineHeight:"1.6",color:"rgba(255,255,255,0.85)"},children:[t.jsx("div",{style:{fontSize:"0.75rem",color:"#10b981",fontWeight:"700",marginBottom:"6px"},children:"â³ Votre réponse :"}),t.jsx("div",{style:{whiteSpace:"pre-wrap"},children:q.admin_reply}),q.replied_at&&t.jsx("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.3)",marginTop:"8px"},children:new Date(q.replied_at).toLocaleString("fr-FR")})]}),t.jsxs("div",{style:{display:"flex",gap:"10px",flexWrap:"wrap"},children:[q.status!=="closed"&&t.jsxs("button",{onClick:()=>_s(an===q.id?null:q.id),style:{flex:1,padding:"10px",borderRadius:"10px",background:an===q.id?"rgba(244,63,94,0.15)":"rgba(255,255,255,0.08)",border:an===q.id?"1px solid rgba(244,63,94,0.3)":"1px solid rgba(255,255,255,0.15)",color:an===q.id?"#f43f5e":"white",cursor:"pointer",fontWeight:"600",fontSize:"0.85rem",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",transition:"all 0.2s"},children:[t.jsx(Qt,{size:16})," ",an===q.id?"Annuler":"Répondre"]}),q.status!=="closed"&&t.jsx("button",{onClick:async()=>{const{error:Se}=await D.from("support_tickets").update({status:"closed"}).eq("id",q.id);Se||(Gi(me=>me.map(Je=>Je.id===q.id?{...Je,status:"closed"}:Je)),e.info("Ticket fermé."),n(me=>({...me,support:Math.max(0,(me.support||0)-1)})))},style:{padding:"10px 16px",borderRadius:"10px",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.4)",cursor:"pointer",fontSize:"0.85rem",transition:"all 0.2s"},children:"Fermer"})]}),an===q.id&&t.jsxs("div",{style:{marginTop:"14px",padding:"16px",borderRadius:"12px",background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.08)"},children:[t.jsx("textarea",{value:Wn[q.id]||"",onChange:Se=>ws(me=>({...me,[q.id]:Se.target.value})),placeholder:"Votre réponse au client...",rows:4,style:{width:"100%",padding:"12px",borderRadius:"10px",background:"rgba(0,0,0,0.3)",border:"1px solid rgba(255,255,255,0.1)",color:"white",fontSize:"0.9rem",outline:"none",resize:"vertical",boxSizing:"border-box",marginBottom:"10px",lineHeight:"1.5"}}),t.jsxs("button",{onClick:async()=>{var me,Je;
2570const Se=(me=Wn[q.id])==null?void 0:me.trim();if(Se)try{await D.from("support_tickets").update({admin_reply:Se,status:"replied",replied_at:new Date().toISOString()}).eq("id",q.id);try{const pt=`<div style="font-family:'Segoe UI',sans-serif;max-width:600px;margin:0 auto;background:#0a0a12;padding:32px;border-radius:16px;"> 2571 <h2 style="color:#f43f5e;margin-bottom:24px;">Réponse du Support MEETapps</h2> 2572 <div style="background:rgba(255,255,255,0.05);border-radius:12px;padding:20px;margin-bottom:16px;"> 2573 <p style="color:#aaa;margin:0 0 8px 0;font-size:13px;">Bonjour ${q.user_name||"utilisateur"},</p> 2574 <p style="color:white;margin:0;font-size:15px;line-height:1.6;white-space:pre-wrap;">${Se}</p> 2575 </div> 2576 <div style="background:rgba(255,255,255,0.03);border-radius:12px;padding:16px;margin-bottom:16px;"> 2577 <p style="color:#666;margin:0 0 4px 0;font-size:12px;">Votre message original :</p> 2578 <p style="color:#888;margin:0;font-size:13px;font-style:italic;">${q.message}</p> 2579 </div> 2580 <p style="color:rgba(255,255,255,0.3);font-size:12px;text-align:center;margin-top:24px;">L'équipe MEETapps â [email protected]</p> 2581 </div>`,it=`Re: ${q.subject||"Votre demande de support"}`,Ke=q.user_id?await ci({toUserId:q.user_id,subject:it,html:pt}):await ci({toEmail:q.user_email,subject:it,html:pt});console.log("Email result:",Ke),(Je=Ke==null?void 0:Ke.data)!=null&&Je.mocked?e.error("â ï¸ Email simulé (RESEND_API_KEY non configurée)"):Ke!=null&&Ke.success||e.error("Email non envoyé: "+JSON.stringify((Ke==null?void 0:Ke.error)||"erreur inconnue"))}catch(pt){console.error("Email reply error:",pt),e.error("Ticket mis à jour mais email non envoyé: "+pt.message)}Gi(pt=>pt.map(it=>it.id===q.id?{...it,admin_reply:Se,status:"replied",replied_at:new Date().toISOString()}:it)),ws(pt=>({...pt,[q.id]:""})),_s(null),n(pt=>({...pt,support:Math.max(0,(pt.support||0)-1)})),e.success("Réponse envoyée ! ð§")}catch(pt){console.error("Reply error:",pt),e.error("Erreur: "+pt.message)}},disabled:!((bt=Wn[q.id])!=null&&bt.trim()),style:{padding:"10px 24px",borderRadius:"10px",background:(Ee=Wn[q.id])!=null&&Ee.trim()?"linear-gradient(135deg, #f43f5e, #e11d48)":"rgba(255,255,255,0.05)",border:"none",color:"white",cursor:(We=Wn[q.id])!=null&&We.trim()?"pointer":"default",fontWeight:"700",fontSize:"0.85rem",display:"flex",alignItems:"center",gap:"6px",opacity:(fe=Wn[q.id])!=null&&fe.trim()?1:.5,transition:"all 0.2s"},children:[t.jsx(ji,{size:15})," Envoyer la réponse"]})]})]},q.id)})})]}),o==="emails"&&(()=>{const q=J==="manual"?l.filter(me=>me.email&&z.has(me.id)):l.filter(me=>{var Je,pt;if(!me.email)return!1;if(Ce.space!=="all"){const it=(((Je=me.raw_user_meta_data)==null?void 0:Je.search_mode)||me.search_mode||"EROS").toUpperCase();if(Ce.space==="eros"&&it!=="EROS"||Ce.space==="friend"&&it!=="FRIEND"||Ce.space==="erox"&&it!=="EROX")return!1}if(Ce.gender!=="all"){const it=(me.gender||"").toLowerCase();if(Ce.gender==="male"&&it!=="male"||Ce.gender==="female"&&it!=="female")return!1}if(Ce.recentDays){const it=new Date(Date.now()-Ce.recentDays*24*60*60*1e3);if(new Date(me.created_at)<it)return!1}return!(Ce.city&&!(me.city||((pt=me.location)==null?void 0:pt.city)||"").toLowerCase().includes(Ce.city.toLowerCase()))}),Ge=l.filter(me=>{if(!me.email)return!1;if(!ce)return!0;const Je=ce.toLowerCase();return(me.name||"").toLowerCase().includes(Je)||(me.email||"").toLowerCase().includes(Je)||(me.city||"").toLowerCase().includes(Je)}),ct=[...new Set(l.map(me=>{var Je;return me.city||((Je=me.location)==null?void 0:Je.city)}
2581).filter(Boolean))].sort(),et=()=>H==="welcome"?Ih("{{NOM}}"):u1(Fe||"<p>Votre message ici...</p>",Ce.space!=="all"?Ce.space:"eros"),Qe=()=>{Be(et()),He(!0),nt(3)},bt=async()=>{var me;xe(!1),ae(!0),he({sent:0,failed:0,total:q.length}),ze([]);for(let Je=0;Je<q.length;Je++){const pt=q[Je];try{let it="",Ke=Le||"MEETapps";if(H==="welcome")it=Ih(pt.name||"Nouveau membre"),Ke="Bienvenue sur MEETapps ! ð";else if(H==="meetblog"){if(Je===0){const{data:Oe}=await D.from("blog_posts").select("*").lte("published_at",new Date().toISOString()).order("published_at",{ascending:!1}).limit(1).single();if(!Oe)throw new Error("Aucun article publié trouvé");window._meetblogArticle=Oe}const oe=window._meetblogArticle,ie=await NS(pt.email,oe);if(!(ie!=null&&ie.success))throw new Error(((me=ie==null?void 0:ie.error)==null?void 0:me.message)||"Erreur envoi");he(Oe=>({...Oe,sent:Oe.sent+1})),ze(Oe=>[...Oe,{name:pt.name,status:"ok"}]),await new Promise(Oe=>setTimeout(Oe,400));continue}else it=u1(Fe,Ce.space!=="all"?Ce.space:"eros");const W="https://bqfzljnhxblhiabyvpqm.supabase.co",se="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4",we=await fetch(`${W}/functions/v1/send-email`,{method:"POST",headers:{"Content-Type":"application/json",apikey:se,Authorization:`Bearer ${se}`},body:JSON.stringify({toUserId:pt.id,toEmail:pt.email,subject:Ke,html:it})}),ge=await we.json();if(!we.ok)throw new Error(ge.error||`HTTP ${we.status}`);he(oe=>({...oe,sent:oe.sent+1})),ze(oe=>[...oe,{name:pt.name,status:"ok"}])}catch(it){he(Ke=>({...Ke,failed:Ke.failed+1})),ze(Ke=>[...Ke,{name:pt.name,status:"error",error:it.message}])}await new Promise(it=>setTimeout(it,400))}ae(!1),Pe(!0);try{const Je=q.map((se,we)=>{const ge=Ae[we]||{};return{user_id:se.id,email:se.email,name:se.name||"",status:ge.status||"unknown"}}),pt=[];ze(se=>(pt.push(...se),se)),await new Promise(se=>setTimeout(se,100));const it=q.map((se,we)=>{var ge;return{user_id:se.id,email:se.email,name:se.name||"",status:((ge=pt[we])==null?void 0:ge.status)||"unknown"}}),Ke=it.filter(se=>se.status==="ok").length,W=it.filter(se=>se.status!=="ok").length;await D.from("email_campaigns").insert({subject:Le||(H==="welcome"?"Bienvenue sur MEETapps !":H==="meetblog"?"MEETblog Newsletter":"MEETapps"),body_html:Fe?Fe.substring(0,500):"",template_type:H,sent_count:Ke,failed_count:W,recipients:it,filters:Ce}),tt(!1)}catch(Je){console.error("Campaign save error:",Je)}},Ee=X.total>0?Math.round((X.sent+X.failed)/X.total*100):0,We={width:"100%",padding:"12px 14px",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.3)",color:"white",fontSize:"0.9rem",outline:"none",fontFamily:"inherit",boxSizing:"border-box"},fe=me=>({padding:"8px 16px",borderRadius:"20px",cursor:"pointer",border:`1.5px solid ${me?"#D4AF37":"rgba(255,255,255,0.1)"}`,background:me?"rgba(212,175,55,0.15)":"rgba(255,255,255,0.03)",color:me?"#D4AF37":"rgba(255,255,255,0.5)",fontSize:"0.85rem",fontWeight:me?"700":"500",transition:"all 0.2s"}),Se=(me,Je)=>({display:"flex",alignItems:"center",gap:"8px",padding:"10px 18px",borderRadius:"25px",background:be>=me?"rgba(212,175,55,0.12)":"rgba(255,255,255,0.03)",border:`1.5px solid ${be>=me?"#D4AF37":"rgba(255,255,255,0.08)"}`,color:be>=me?"#D4AF37":"rgba(255,255,255,0.3)",fontSize:"0.85rem",fontWeight:"600",cursor:"pointer",transition:"all 0.2s"});return t.jsxs("div",{children:[t.jsxs("div",{style:{display:"flex",gap:"10px",marginBottom:"24px",flexWrap:"wrap"},children:[t.jsxs("div",{onClick:()=>nt(1),style:Se(1),children:[t.jsx(Ut,{size:16})," 1. Destinataires"]}),t.jsxs("div",{onClick:()=>nt(2),style:Se(2),children:[t.jsx(Vr,{size:16})," 2. Rédaction"]}),t.jsxs("div",{onClick:()=>{(Fe||H==="welcome"||H==="meetblog")&&Qe()},style:Se(3),children:[t.jsx(rr,{size:16})," 3. Preview & Envoi"]}),t.jsxs("div",{onClick:()=>{nt(4),tt(!1)},style:Se(4),children:[t.jsx(pu,{size:16})," 4. Historique"]})]}),be===4&&(()=>{Xe||(async()=>{try{const{data:Ke}=await D.from("email_campaigns").select("*").order("created_at",{ascending:!1}).limit(50);if($e(Ke||[]),Ke!=null&&Ke.length){const{data:W}=await D.from("email_opens").select("campaign_id, user_id, email, opened_at");if(W){const se={};W.forEach(we=>{se[we.campaign_id]||(se[we.campaign_id]=[]),se[we.campaign_id].push(we)}),$e(we=>we.map(ge=>
2581({...ge,opens:se[ge.id]||[],open_count:(se[ge.id]||[]).length})))}}}catch(Ke){console.error("Fetch campaigns error:",Ke)}tt(!0)})();const Je=pe.reduce((Ke,W)=>Ke+(W.sent_count||0),0),pt=pe.reduce((Ke,W)=>Ke+(W.open_count||0),0),it=Je>0?Math.round(pt/Je*100):0;return t.jsxs("div",{children:[t.jsxs("h2",{style:{margin:"0 0 8px",fontFamily:"Outfit",fontSize:"1.2rem",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(pu,{size:20,color:"#D4AF37"})," Historique des campagnes"]}),t.jsx("p",{style:{color:"rgba(255,255,255,0.4)",marginBottom:"20px",fontSize:"0.85rem"},children:"Suivi des envois et statistiques d'ouverture"}),t.jsx("div",{style:{display:"flex",gap:"12px",marginBottom:"24px",flexWrap:"wrap"},children:[{label:"Campagnes",val:pe.length,color:"#D4AF37",icon:"ð§"},{label:"Emails envoyés",val:Je,color:"#10b981",icon:"â
"},{label:"Ouvertures",val:pt,color:"#8b5cf6",icon:"ðï¸"},{label:"Taux d'ouverture",val:`${it}%`,color:"#f97316",icon:"ð"}].map((Ke,W)=>t.jsxs("div",{style:{flex:1,minWidth:"120px",padding:"18px",borderRadius:"14px",background:`${Ke.color}08`,border:`1px solid ${Ke.color}25`,textAlign:"center"},children:[t.jsx("div",{style:{fontSize:"0.9rem",marginBottom:"6px"},children:Ke.icon}),t.jsx("div",{style:{fontSize:"1.8rem",fontWeight:"800",color:Ke.color},children:Ke.val}),t.jsx("div",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.5)",marginTop:"4px"},children:Ke.label})]},W))}),gt&&(()=>{const Ke=gt,W=Ke.recipients||[],se=W.filter(ie=>ie.status==="ok");W.filter(ie=>ie.status!=="ok");const we=Ke.opens||[],ge=new Set(we.map(ie=>ie.email||ie.user_id)),oe=se.length>0?Math.round(we.length/se.length*100):0;return t.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",backdropFilter:"blur(6px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:()=>at(null),children:t.jsxs("div",{style:{background:"#1a1a2e",borderRadius:"20px",border:"1px solid rgba(212,175,55,0.3)",padding:"32px",maxWidth:"600px",width:"90%",maxHeight:"80vh",overflow:"auto"},onClick:ie=>ie.stopPropagation(),children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"20px"},children:[t.jsxs("div",{children:[t.jsx("h3",{style:{margin:"0 0 6px",fontFamily:"Outfit",fontSize:"1.1rem",color:"white"},children:Ke.subject||"Sans sujet"}),t.jsxs("p",{style:{color:"rgba(255,255,255,0.4)",fontSize:"0.8rem",margin:0},children:[new Date(Ke.created_at).toLocaleString("fr-FR")," ⢠",Ke.template_type]})]}),t.jsx("button",{onClick:()=>at(null),style:{background:"none",border:"none",color:"rgba(255,255,255,0.4)",cursor:"pointer",fontSize:"1.2rem"},children:"â"})]}),t.jsxs("div",{style:{display:"flex",gap:"10px",marginBottom:"20px",flexWrap:"wrap"},children:[t.jsxs("div",{style:{flex:1,minWidth:"80px",padding:"14px",borderRadius:"12px",background:"rgba(16,185,129,0.08)",border:"1px solid rgba(16,185,129,0.2)",textAlign:"center"},children:[t.jsx("div",{style:{fontSize:"1.5rem",fontWeight:"800",color:"#10b981"},children:Ke.sent_count||0}),t.jsx("div",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.4)"},children:"Envoyés"})]}),t.jsxs("div",{style:{flex:1,minWidth:"80px",padding:"14px",borderRadius:"12px",background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.2)",textAlign:"center"},children:[t.jsx("div",{style:{fontSize:"1.5rem",fontWeight:"800",color:"#ef4444"},children:Ke.failed_count||0}),t.jsx("div",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.4)"},children:"Ãchecs"})]}),t.jsxs("div",{style:{flex:1,minWidth:"80px",padding:"14px",borderRadius:"12px",background:"rgba(139,92,246,0.08)",border:"1px solid rgba(139,92,246,0.2)",textAlign:"center"},children:[t.jsx("div",{style:{fontSize:"1.5rem",fontWeight:"800",color:"#8b5cf6"},children:we.length}),t.jsx("div",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.4)"},children:"Ouvertures"})]}),t.jsxs("div",{style:{flex:1,minWidth:"80px",padding:"14px",borderRadius:"12px",background:"rgba(249,115,22,0.08)",border:"1px solid rgba(249,115,22,0.2)",textAlign:"center"},children:[t.jsxs("div",{style:{fontSize:"1.5rem",fontWeight:"800",color:"#f97316"},children:[oe,"%"]}),t.jsx("div",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.4)"},children:"Taux d'ouv."})]})]}),t.jsxs("div",{style:{marginBottom:"20px"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.8rem",marginBottom:"6px"},children:[t.jsx("span",{style:{color:"rgba(255,255,255,0.5)"},children:"Taux d'ouverture"}),t.jsxs("span",{style:{color:"#8b5cf6",fontWeight:"700"},children:[we.length,"/",se.length]})]}),t.jsx("div",{style:{height:"8px",borderRadius:"8px",background:"rgba(255,255,255,0.06)",overflow:"hidden"},children:t.jsx("div",{style:{height:"100%",width:`${oe}%`,borderRadius:"8px",background:"linear-gradient(90deg, #8b5cf6, #a855f7)",transition:"width 0.5s ease"}})})]}),t.jsxs("div",{style:{fontWeight:"600",color:"rgba(255,255,255,0.6)",fontSize:"0.85rem",marginBottom:"10px"},children:["Destinataires (",W.length,")"]}),t.jsx("div",{style:{maxHeight:"250px",overflow:"auto",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.06)"},children:W.map((ie,Oe)=>{const Ve=ge.has(ie.email)||ge.has(ie.user_id),yt=we.find(Mt=>Mt.email===ie.email||Mt.user_id===ie.user_id);return t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"10px 14px",borderBottom:"1px solid rgba(255,255,255,0.04)",fontSize:"0.85rem"},children:[t.jsx("span",{style:{fontSize:"1rem"},children:ie.status==="ok"?Ve?"ðï¸":"â
":"â"}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{color:"white",fontWeight:"600"},children:ie.name||"Sans nom"}),t.jsx("div",{style:{color:"rgba(255,255,255,0.3)",fontSize:"0.75rem"},children:ie.email})]}),t.jsx("div",{style:{textAlign:"right"},children:ie.status==="ok"?Ve?t.jsxs("span",{style:{color:"#8b5cf6",fontSize:"0.75rem",fontWeight:"600"}
2581,children:["Ouvert ",yt?new Date(yt.opened_at).toLocaleDateString("fr-FR"):""]}):t.jsx("span",{style:{color:"rgba(255,255,255,0.3)",fontSize:"0.75rem"},children:"Pas encore ouvert"}):t.jsx("span",{style:{color:"#ef4444",fontSize:"0.75rem"},children:"Ãchec"})})]},Oe)})}),t.jsx("div",{style:{textAlign:"center",marginTop:"20px"},children:t.jsx("button",{onClick:()=>at(null),style:{padding:"12px 28px",borderRadius:"12px",background:"linear-gradient(135deg, #D4AF37, #AA8A2E)",border:"none",color:"#1a1a2e",cursor:"pointer",fontWeight:"700",fontSize:"0.9rem"},children:"Fermer"})})]})})})(),pe.length>0?t.jsxs("div",{style:{borderRadius:"14px",border:"1px solid rgba(255,255,255,0.06)",overflow:"hidden"},children:[t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 90px 90px 90px 90px 110px",gap:"6px",padding:"12px 16px",background:"rgba(255,255,255,0.03)",fontSize:"0.72rem",color:"rgba(255,255,255,0.4)",fontWeight:"600",textTransform:"uppercase"},children:[t.jsx("div",{children:"Campagne"}),t.jsx("div",{style:{textAlign:"center"},children:"Envoyés"}),t.jsx("div",{style:{textAlign:"center"},children:"Ãchecs"}),t.jsx("div",{style:{textAlign:"center"},children:"Ouvertures"}),t.jsx("div",{style:{textAlign:"center"},children:"Taux"}),t.jsx("div",{style:{textAlign:"center"},children:"Date"})]}),pe.map(Ke=>{const W=Ke.open_count||0,se=Ke.sent_count>0?Math.round(W/Ke.sent_count*100):0;return t.jsxs("div",{onClick:()=>at(Ke),style:{display:"grid",gridTemplateColumns:"1fr 90px 90px 90px 90px 110px",gap:"6px",padding:"14px 16px",borderTop:"1px solid rgba(255,255,255,0.04)",alignItems:"center",cursor:"pointer",transition:"background 0.2s"},onMouseEnter:we=>we.currentTarget.style.background="rgba(212,175,55,0.04)",onMouseLeave:we=>we.currentTarget.style.background="transparent",children:[t.jsxs("div",{children:[t.jsx("div",{style:{fontWeight:"600",color:"white",fontSize:"0.9rem",marginBottom:"2px"},children:Ke.subject||"Sans sujet"}),t.jsx("div",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.3)"},children:Ke.template_type})]}),t.jsx("div",{style:{textAlign:"center",fontWeight:"700",color:"#10b981"},children:Ke.sent_count||0}),t.jsx("div",{style:{textAlign:"center",fontWeight:"700",color:Ke.failed_count>0?"#ef4444":"rgba(255,255,255,0.2)"},children:Ke.failed_count||0}),t.jsx("div",{style:{textAlign:"center",fontWeight:"700",color:"#8b5cf6"},children:W}),t.jsx("div",{style:{textAlign:"center"},children:t.jsx("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"3px 8px",borderRadius:"6px",background:se>30?"rgba(16,185,129,0.12)":se>10?"rgba(249,115,22,0.12)":"rgba(239,68,68,0.12)",border:`1px solid ${se>30?"rgba(16,185,129,0.25)":se>10?"rgba(249,115,22,0.25)":"rgba(239,68,68,0.25)"}`},children:t.jsxs("span",{style:{fontWeight:"700",fontSize:"0.8rem",color:se>30?"#10b981":se>10?"#f97316":"#ef4444"},children:[se,"%"]})})}),t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.4)",textAlign:"center"},children:new Date(Ke.created_at).toLocaleDateString("fr-FR")})]},Ke.id)})]}):t.jsxs("div",{style:{textAlign:"center",padding:"50px 20px",color:"rgba(255,255,255,0.3)"},children:[t.jsx("div",{style:{fontSize:"3rem",marginBottom:"12px"},children:"ð"}),t.jsx("div",{children:"Aucune campagne envoyée"}),t.jsx("div",{style:{fontSize:"0.8rem",marginTop:"6px"},children:"Les prochaines campagnes apparaîtront ici avec leurs statistiques"})]})]})})(),be===1&&t.jsxs("div",{children:[t.jsxs("h2",{style:{margin:"0 0 8px",fontFamily:"Outfit",fontSize:"1.2rem",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(Ut,{size:20,color:"#D4AF37"})," Sélection des destinataires"]}),t.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"20px"},children:[t.jsx("button",{onClick:()=>Ie("filter"),style:{...fe(J==="filter"),flex:1,textAlign:"center",padding:"12px"},children:"ð Par filtres"}),t.jsx("button",{onClick:()=>Ie("manual"),style:{...fe(J==="manual"),flex:1,textAlign:"center",padding:"12px"},children:"â
Sélection manuelle"})]}),J==="filter"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{marginBottom:"18px"},children:[t.jsx("label",{style:{display:"block",color:"rgba(255,255,255,0.6)",fontSize:"0.8rem",fontWeight:"600",marginBottom:"8px",textTransform:"uppercase",letterSpacing:"0.5px"},children:"Espace"}),t.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:[{id:"all",label:"ð Tous"},{id:"eros",label:"â¤ï¸ Eros"},{id:"friend",label:"ð¤ Friend"},{id:"erox",label:"ð¥ Erox"}].map(me=>
2581t.jsx("button",{onClick:()=>Me(Je=>({...Je,space:me.id})),style:fe(Ce.space===me.id),children:me.label},me.id))})]}),t.jsxs("div",{style:{marginBottom:"18px"},children:[t.jsx("label",{style:{display:"block",color:"rgba(255,255,255,0.6)",fontSize:"0.8rem",fontWeight:"600",marginBottom:"8px",textTransform:"uppercase",letterSpacing:"0.5px"},children:"Genre"}),t.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:[{id:"all",label:"ð¥ Tous"},{id:"male",label:"ð¨ Hommes"},{id:"female",label:"ð© Femmes"}].map(me=>t.jsx("button",{onClick:()=>Me(Je=>({...Je,gender:me.id})),style:fe(Ce.gender===me.id),children:me.label},me.id))})]}),t.jsxs("div",{style:{marginBottom:"18px"},children:[t.jsx("label",{style:{display:"block",color:"rgba(255,255,255,0.6)",fontSize:"0.8rem",fontWeight:"600",marginBottom:"8px",textTransform:"uppercase",letterSpacing:"0.5px"},children:"Inscrits depuis"}),t.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:[{id:null,label:"â Tous"},{id:1,label:"24h"},{id:7,label:"7 jours"},{id:30,label:"30 jours"},{id:90,label:"3 mois"}].map(me=>t.jsx("button",{onClick:()=>Me(Je=>({...Je,recentDays:me.id})),style:fe(Ce.recentDays===me.id),children:me.label},me.id||"all"))})]}),t.jsxs("div",{style:{marginBottom:"24px"},children:[t.jsx("label",{style:{display:"block",color:"rgba(255,255,255,0.6)",fontSize:"0.8rem",fontWeight:"600",marginBottom:"8px",textTransform:"uppercase",letterSpacing:"0.5px"},children:"Ville"}),t.jsx("input",{type:"text",value:Ce.city,onChange:me=>Me(Je=>({...Je,city:me.target.value})),placeholder:"Tapez une ville (ex: Paris, Lyon...)",list:"admin-cities",style:We}),t.jsx("datalist",{id:"admin-cities",children:ct.map(me=>t.jsx("option",{value:me},me))})]})]}),J==="manual"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{marginBottom:"12px",position:"relative"},children:[t.jsx(qo,{size:16,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:"rgba(255,255,255,0.3)"}}),t.jsx("input",{type:"text",value:ce,onChange:me=>ve(me.target.value),placeholder:"Rechercher par nom, email, ville...",style:{...We,paddingLeft:"38px"}})]}),t.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"12px"},children:[t.jsxs("button",{onClick:()=>Y(new Set(Ge.map(me=>me.id))),style:{padding:"6px 14px",borderRadius:"8px",background:"rgba(212,175,55,0.1)",border:"1px solid rgba(212,175,55,0.2)",color:"#D4AF37",cursor:"pointer",fontSize:"0.8rem",fontWeight:"600"},children:["Tout sélectionner (",Ge.length,")"]}),t.jsx("button",{onClick:()=>Y(new Set),style:{padding:"6px 14px",borderRadius:"8px",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.5)",cursor:"pointer",fontSize:"0.8rem"},children:"Tout désélectionner"})]}),t.jsxs("div",{style:{maxHeight:"350px",overflowY:"auto",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.06)",background:"rgba(0,0,0,0.2)"},children:[Ge.map(me=>{const Je=z.has(me.id),pt=me.avatar_url||me.photo;return t.jsxs("div",{onClick:()=>{Y(it=>{const Ke=new Set(it);return Ke.has(me.id)?Ke.delete(me.id):Ke.add(me.id),Ke})},style:{display:"flex",alignItems:"center",gap:"12px",padding:"10px 14px",cursor:"pointer",borderBottom:"1px solid rgba(255,255,255,0.04)",background:Je?"rgba(212,175,55,0.08)":"transparent",transition:"background 0.15s"},children:[t.jsx("div",{style:{width:"22px",height:"22px",borderRadius:"6px",border:`2px solid ${Je?"#D4AF37":"rgba(255,255,255,0.15)"}`,background:Je?"#D4AF37":"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"all 0.15s"},children:Je&&t.jsx(pr,{size:14,color:"#1a1a2e",strokeWidth:3})}),pt?t.jsx("img",{src:pt,alt:"",style:{width:"34px",height:"34px",borderRadius:"50%",objectFit:"cover",border:"1px solid rgba(255,255,255,0.1)",flexShrink:0}}):t.jsx("div",{style:{width:"34px",height:"34px",borderRadius:"50%",background:"linear-gradient(135deg, #D4AF37, #AA8A2E)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"14px",fontWeight:"700",color:"#1a1a2e",flexShrink:0},children:(me.name||"?")[0].toUpperCase()}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsx("div",{style:{fontSize:"0.9rem",fontWeight:"600",color:"white",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:me.name||"Sans nom"}),t.jsxs("div",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.4)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[me.email,me.city?` · ${me.city}`:""]})]}),t.jsx("div",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.3)",flexShrink:0},children:me.gender==="male"?"ð¨":me.gender==="female"?"ð©":""})]},me.id)}),Ge.length===0&&t.jsx("div",{style:{padding:"20px",textAlign:"center",color:"rgba(255,255,255,0.3)",fontSize:"0.85rem"},children:"Aucun résultat"})]})]}),t.jsxs("div",{style:{padding:"18px",borderRadius:"14px",background:"linear-gradient(135deg, rgba(212,175,55,0.08), rgba(0,0,0,0.3))",border:"1px solid rgba(212,175,55,0.2)",display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:"16px",marginBottom:"20px"},children:[t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"2rem",fontWeight:"800",color:"#D4AF37"},children:q.length}),t.jsx("div",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.5)"},children:"destinataires sélectionnés"})]}),t.jsxs("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.3)"},children:["sur ",l.length," total"]})]}),t.jsxs("button",{onClick:()=>nt(2),disabled:q.length===0,style:{width:"100%",padding:"16px",borderRadius:"14px",cursor:q.length===0?"not-allowed":"pointer",background:q.length===0?"rgba(255,255,255,0.05)":"linear-gradient(135deg, #D4AF37, #AA8A2E)",border:"none",color:q.length===0?"rgba(255,255,255,0.3)":"#1a1a2e",fontWeight:"800",fontSize:"1rem",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:["Suivant â Rédaction ",t.jsx(Pr,{size:18})]})]}),be===2&&t.jsxs("div",{children:[t.jsxs("h2",{style:{margin:"0 0 8px",fontFamily:"Outfit",fontSize:"1.2rem",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(Vr,{size:20,color:"#D4AF37"})," Rédaction de l'email"]}),t.jsxs("p",{style:{color:"rgba(255,255,255,0.4)",marginBottom:"20px",fontSize:"0.85rem"},children:["Choisissez un template ou rédigez votre message (",q.length," destinataires)"]}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(160px, 1fr))",gap:"10px",marginBottom:"20px"},children:Q7.map(me=>
2581t.jsxs("button",{onClick:()=>{N(me.id),me.subject&&rt(me.subject),me.body&&me.body!=="__WELCOME__"&&ft(me.body),me.id==="welcome"&&ft("")},style:{padding:"14px",borderRadius:"12px",cursor:"pointer",textAlign:"left",background:H===me.id?"rgba(212,175,55,0.15)":"rgba(255,255,255,0.03)",border:`2px solid ${H===me.id?"#D4AF37":"rgba(255,255,255,0.08)"}`,color:H===me.id?"#D4AF37":"rgba(255,255,255,0.6)",transition:"all 0.2s"},children:[t.jsx("div",{style:{fontSize:"0.95rem",fontWeight:"700",marginBottom:"3px"},children:me.label}),t.jsx("div",{style:{fontSize:"0.75rem",opacity:.7},children:me.desc})]},me.id))}),H!=="welcome"&&H!=="meetblog"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{marginBottom:"16px"},children:[t.jsx("label",{style:{display:"block",color:"rgba(255,255,255,0.6)",fontSize:"0.8rem",fontWeight:"600",marginBottom:"6px"},children:"Sujet"}),t.jsx("input",{type:"text",value:Le,onChange:me=>rt(me.target.value),placeholder:"Objet de l'email...",style:We})]}),t.jsxs("div",{style:{marginBottom:"20px"},children:[t.jsx("label",{style:{display:"block",color:"rgba(255,255,255,0.6)",fontSize:"0.8rem",fontWeight:"600",marginBottom:"6px"},children:"Contenu (HTML supporté)"}),t.jsx("textarea",{value:Fe,onChange:me=>ft(me.target.value),rows:12,placeholder:"Rédigez votre email... Le HTML est supporté. Le contenu sera encapsulé dans le template MEETapps (logo, footer, couleurs).",style:{...We,resize:"vertical",minHeight:"200px",lineHeight:"1.6"}})]})]}),H==="welcome"&&t.jsx("div",{style:{padding:"20px",borderRadius:"14px",background:"rgba(212,175,55,0.06)",border:"1px solid rgba(212,175,55,0.15)",marginBottom:"20px"},children:t.jsxs("p",{style:{margin:0,color:"rgba(255,255,255,0.6)",fontSize:"0.9rem"},children:["ð§ Le template ",t.jsx("strong",{style:{color:"#D4AF37"},children:"Bienvenue"})," est prédéfini avec la présentation complète de MEETapps (3 espaces, pictos, MEETips, entraide). Le nom du destinataire sera automatiquement personnalisé."]})}),H==="meetblog"&&t.jsx("div",{style:{padding:"20px",borderRadius:"14px",background:"rgba(255,215,0,0.06)",border:"1px solid rgba(255,215,0,0.15)",marginBottom:"20px"},children:t.jsxs("p",{style:{margin:0,color:"rgba(255,255,255,0.6)",fontSize:"0.9rem"},children:["ð Le template ",t.jsx("strong",{style:{color:"#FFD700"},children:"MEETblog"})," enverra automatiquement le ",t.jsx("strong",{style:{color:"#FFD700"},children:"dernier article publié"})," du blog avec son image de couverture, un extrait, et un bouton CTA vers l'article complet."]})}),t.jsxs("div",{style:{display:"flex",gap:"12px"},children:[t.jsx("button",{onClick:()=>nt(1),style:{flex:1,padding:"14px",borderRadius:"12px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.6)",cursor:"pointer",fontWeight:"700",fontSize:"0.9rem"},children:"â Retour"}),t.jsxs("button",{onClick:Qe,disabled:H!=="welcome"&&H!=="meetblog"&&(!Le||!Fe),style:{flex:2,padding:"14px",borderRadius:"12px",cursor:H!=="welcome"&&H!=="meetblog"&&(!Le||!Fe)?"not-allowed":"pointer",background:H!=="welcome"&&H!=="meetblog"&&(!Le||!Fe)?"rgba(255,255,255,0.05)":"linear-gradient(135deg, #D4AF37, #AA8A2E)",border:"none",color:H!=="welcome"&&H!=="meetblog"&&(!Le||!Fe)?"rgba(255,255,255,0.3)":"#1a1a2e",fontWeight:"800",fontSize:"0.95rem",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:[t.jsx(rr,{size:18})," Prévisualiser â"]})]})]}),be===3&&t.jsxs("div",{children:[t.jsxs("h2",{style:{margin:"0 0 8px",fontFamily:"Outfit",fontSize:"1.2rem",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(rr,{size:20,color:"#D4AF37"})," Preview & Envoi"]}),t.jsxs("p",{style:{color:"rgba(255,255,255,0.4)",marginBottom:"16px",fontSize:"0.85rem"},children:["Vérifiez le rendu de l'email avant l'envoi à ",t.jsxs("strong",{style:{color:"#D4AF37"},children:[q.length," destinataires"]})]}),t.jsxs("div",{style:{borderRadius:"14px",overflow:"hidden",border:"1px solid rgba(255,255,255,0.1)",marginBottom:"20px",background:"#0a0a0f"},children:[t.jsxs("div",{style:{padding:"10px 16px",background:"rgba(255,255,255,0.04)",borderBottom:"1px solid rgba(255,255,255,0.06)",display:"flex",alignItems:"center",gap:"8px",fontSize:"0.8rem",color:"rgba(255,255,255,0.4)"},children:[t.jsx(Vr,{size:14})," ",t.jsx("strong",{children:"Sujet :"})," ",H==="welcome"?"Bienvenue sur MEETapps ! ð":Le]}),t.jsx("iframe",{srcDoc:De,style:{width:"100%",height:"500px",border:"none",background:"#0a0a0f"},title:"Email Preview"})]}),t.jsxs("div",{style:{display:"flex",gap:"12px"},children:[t.jsx("button",{onClick:()=>nt(2),style:{flex:1,padding:"14px",borderRadius:"12px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.6)",cursor:"pointer",fontWeight:"700",fontSize:"0.9rem"},children:"â Modifier"}),t.jsx("button",{onClick:()=>xe(!0),disabled:Z,style:{flex:2,padding:"16px",borderRadius:"14px",cursor:Z?"not-allowed":"pointer",background:Z?"rgba(255,255,255,0.05)":"linear-gradient(135deg, #D4AF37, #AA8A2E)",border:"none",color:Z?"rgba(255,255,255,0.4)":"#1a1a2e",fontWeight:"800",fontSize:"1rem",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px"},children:Z?t.jsxs(t.Fragment,{children:[t.jsx(qs,{size:20,style:{animation:"pulse 1s infinite"}})," Envoi... ",X.sent+X.failed,"/",X.total]}):t.jsxs(t.Fragment,{children:[t.jsx(ji,{size:20})," Envoyer à ",q.length," destinataires"]})})]}),(Z||X.total>0)&&t.jsxs("div",{style:{marginTop:"20px"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px",fontSize:"0.85rem"},children:[t.jsxs("span",{style:{color:"#22c55e"},children:["â
",X.sent," envoyés"]}
2581),t.jsxs("span",{style:{color:"#ef4444"},children:["â ",X.failed," échecs"]}),t.jsxs("span",{style:{color:"rgba(255,255,255,0.4)"},children:[Ee,"%"]})]}),t.jsx("div",{style:{height:"8px",borderRadius:"4px",background:"rgba(255,255,255,0.05)",overflow:"hidden"},children:t.jsx("div",{style:{height:"100%",borderRadius:"4px",transition:"width 0.3s",width:`${Ee}%`,background:X.failed>0?"linear-gradient(90deg, #22c55e, #f59e0b)":"#22c55e"}})})]}),Ae.length>0&&t.jsxs("div",{style:{marginTop:"20px",maxHeight:"250px",overflowY:"auto",background:"rgba(0,0,0,0.3)",borderRadius:"12px",padding:"14px",border:"1px solid rgba(255,255,255,0.06)"},children:[t.jsx("div",{style:{fontSize:"0.8rem",fontWeight:"600",color:"rgba(255,255,255,0.5)",marginBottom:"10px"},children:"Journal d'envoi"}),Ae.map((me,Je)=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"4px 0",fontSize:"0.8rem",borderBottom:"1px solid rgba(255,255,255,0.03)"},children:[t.jsx("span",{children:me.status==="ok"?"â
":"â"}),t.jsx("span",{style:{color:me.status==="ok"?"rgba(255,255,255,0.6)":"#ef4444",flex:1},children:me.name||"Sans nom"}),me.error&&t.jsx("span",{style:{color:"#ef4444",fontSize:"0.7rem"},children:me.error})]},Je))]})]}),ue&&t.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",backdropFilter:"blur(6px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},children:t.jsxs("div",{style:{background:"#1a1a2e",borderRadius:"20px",border:"1px solid rgba(212,175,55,0.3)",padding:"32px",maxWidth:"440px",width:"90%",textAlign:"center"},children:[t.jsx("div",{style:{width:"64px",height:"64px",borderRadius:"50%",background:"rgba(212,175,55,0.12)",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 20px"},children:t.jsx(ji,{size:28,color:"#D4AF37"})}),t.jsx("h3",{style:{margin:"0 0 12px",fontFamily:"Outfit",fontSize:"1.2rem",color:"white"},children:"Confirmer l'envoi"}),t.jsxs("p",{style:{color:"rgba(255,255,255,0.6)",fontSize:"0.95rem",margin:"0 0 24px",lineHeight:"1.5"},children:["Tu es sur le point d'envoyer l'email à ",t.jsxs("strong",{style:{color:"#D4AF37"},children:[q.length," destinataires"]}),".",Ce.space!=="all"&&t.jsxs(t.Fragment,{children:[t.jsx("br",{}),t.jsxs("span",{style:{fontSize:"0.85rem"},children:["Espace : ",t.jsx("strong",{children:Ce.space.toUpperCase()})]})]}),Ce.gender!=="all"&&t.jsxs(t.Fragment,{children:[t.jsx("br",{}),t.jsxs("span",{style:{fontSize:"0.85rem"},children:["Genre : ",t.jsx("strong",{children:Ce.gender==="male"?"Hommes":"Femmes"})]})]}),Ce.city&&t.jsxs(t.Fragment,{children:[t.jsx("br",{}),t.jsxs("span",{style:{fontSize:"0.85rem"},children:["Ville : ",t.jsx("strong",{children:Ce.city})]})]})]}),t.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"center"},children:[t.jsx("button",{onClick:()=>xe(!1),style:{padding:"14px 28px",borderRadius:"12px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.6)",cursor:"pointer",fontWeight:"700",fontSize:"0.95rem"},children:"Annuler"}),t.jsxs("button",{onClick:bt,style:{padding:"14px 28px",borderRadius:"12px",background:"linear-gradient(135deg, #D4AF37, #AA8A2E)",border:"none",color:"#1a1a2e",cursor:"pointer",fontWeight:"800",fontSize:"0.95rem",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(ji,{size:16})," Confirmer"]})]})]})}),ke&&t.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",backdropFilter:"blur(6px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},children:t.jsxs("div",{style:{background:"#1a1a2e",borderRadius:"20px",border:"1px solid rgba(16,185,129,0.3)",padding:"32px",maxWidth:"480px",width:"90%",textAlign:"center"},children:[t.jsx("div",{style:{width:"64px",height:"64px",borderRadius:"50%",background:X.failed>0?"rgba(245,158,11,0.12)":"rgba(16,185,129,0.12)",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 20px"},children:X.failed>0?t.jsx(_n,{size:28,color:"#f59e0b"}):t.jsx(pr,{size:28,color:"#10b981"})}),t.jsx("h3",{style:{margin:"0 0 12px",fontFamily:"Outfit",fontSize:"1.2rem",color:"white"},children:"Envoi terminé !"}),t.jsxs("div",{style:{display:"flex",gap:"16px",justifyContent:"center",marginBottom:"24px"},children:[t.jsxs("div",{style:{padding:"16px 24px",borderRadius:"14px",background:"rgba(16,185,129,0.08)",border:"1px solid rgba(16,185,129,0.2)"},children:[t.jsx("div",{style:{fontSize:"1.8rem",fontWeight:"800",color:"#10b981"},children:X.sent}),t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)"},children:"envoyés"})]}),t.jsxs("div",{style:{padding:"16px 24px",borderRadius:"14px",background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.2)"},children:[t.jsx("div",{style:{fontSize:"1.8rem",fontWeight:"800",color:"#ef4444"},children:X.failed}),t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)"},children:"échecs"})]})]}),t.jsx("button",{onClick:()=>{Pe(!1),nt(1),he({sent:0,failed:0,total:0}),ze([])},style:{padding:"14px 32px",borderRadius:"12px",background:"linear-gradient(135deg, #10b981, #059669)",border:"none",color:"white",cursor:"pointer",fontWeight:"800",fontSize:"0.95rem"},children:"Fermer"})]})})]})})(),o==="inbox"&&(()=>{const q=async()=>{Rt(!0);try{const{data:Qe,error:bt}=await D.from("inbound_emails").select("*").order("received_at",{ascending:!1}).limit(100);if(bt)throw bt;vt(Qe||[])}catch(Qe){console.error("Inbox fetch error:",Qe)}Rt(!1),sr(!0)},Ge=async Qe=>{await D.from("inbound_emails").update({read:!0}).eq("id",Qe),vt(bt=>bt.map(Ee=>Ee.id===Qe?{...Ee,read:!0}:Ee))},ct=async()=>
2581{if(!(!ut||!dt.trim())){Ht(!0);try{const Qe="https://bqfzljnhxblhiabyvpqm.supabase.co",bt="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4",Ee=`<div style="font-family: sans-serif; line-height: 1.6; color: #333;"><p>${dt.replace(/\n/g,"<br/>")}</p><hr style="border: none; border-top: 1px solid #ddd; margin: 20px 0;"/><p style="color: #888; font-size: 12px;">â MEETapps Team</p></div>`;if(!(await fetch(`${Qe}/functions/v1/send-email`,{method:"POST",headers:{"Content-Type":"application/json",apikey:bt,Authorization:`Bearer ${bt}`},body:JSON.stringify({toEmail:ut.from_email,subject:`Re: ${ut.subject||"(sans sujet)"}`,html:Ee})})).ok)throw new Error("Erreur envoi");await D.from("inbound_emails").update({replied:!0,reply_text:dt,replied_at:new Date().toISOString()}).eq("id",ut.id),vt(fe=>fe.map(Se=>Se.id===ut.id?{...Se,replied:!0,reply_text:dt,replied_at:new Date().toISOString()}:Se)),Wt(fe=>({...fe,replied:!0,reply_text:dt})),Rr(""),e.success("Réponse envoyée !")}catch(Qe){e.error("Erreur: "+Qe.message)}Ht(!1)}};!or&&!Dr&&q();const et={width:"100%",padding:"12px 14px",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.3)",color:"white",fontSize:"0.9rem",outline:"none",fontFamily:"inherit",boxSizing:"border-box"};return t.jsxs("div",{children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"20px"},children:[t.jsxs("h2",{style:{margin:0,fontFamily:"Outfit",fontSize:"1.2rem",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(vg,{size:20,color:"#8b5cf6"})," Boîte de réception"]}),t.jsxs("button",{onClick:q,disabled:Dr,style:{padding:"8px 16px",borderRadius:"10px",background:"rgba(139,92,246,0.12)",border:"1px solid rgba(139,92,246,0.25)",color:"#8b5cf6",cursor:"pointer",fontWeight:"600",fontSize:"0.85rem",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(kn,{size:14,style:{animation:Dr?"spin 1s linear infinite":"none"}})," Rafraîchir"]})]}),ut?t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>{Wt(null),Rr("")},style:{padding:"8px 14px",borderRadius:"10px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.6)",cursor:"pointer",fontWeight:"600",fontSize:"0.85rem",marginBottom:"16px",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(Hr,{size:14})," Retour"]}),t.jsxs("div",{style:{padding:"20px",borderRadius:"14px",background:"rgba(0,0,0,0.3)",border:"1px solid rgba(255,255,255,0.06)",marginBottom:"16px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"12px"},children:[t.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"50%",background:"linear-gradient(135deg, #8b5cf6, #6d28d9)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"16px",fontWeight:"700",color:"white",flexShrink:0},children:(ut.from_name||ut.from_email||"?")[0].toUpperCase()}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{fontWeight:"700",color:"white",fontSize:"0.95rem"},children:ut.from_name||ut.from_email}),t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.4)"},children:ut.from_email})]}),t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.3)"},children:new Date(ut.received_at).toLocaleDateString("fr-FR",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})})]}),t.jsx("div",{style:{fontSize:"1.1rem",fontWeight:"700",color:"white",fontFamily:"Outfit"},children:ut.subject||"(sans sujet)"}),ut.replied&&t.jsxs("div",{style:{marginTop:"8px",display:"inline-flex",alignItems:"center",gap:"4px",padding:"3px 10px",borderRadius:"6px",background:"rgba(16,185,129,0.1)",border:"1px solid rgba(16,185,129,0.2)",fontSize:"0.75rem",color:"#10b981"},children:[t.jsx(pr,{size:12})," Répondu"]})]}),t.jsx("div",{style:{padding:"20px",borderRadius:"14px",background:"rgba(0,0,0,0.2)",border:"1px solid rgba(255,255,255,0.04)",marginBottom:"16
2581px",minHeight:"150px"},children:ut.body_html?t.jsx("iframe",{srcDoc:ut.body_html,style:{width:"100%",minHeight:"300px",border:"none",background:"white",borderRadius:"8px"},title:"Email content"}):t.jsx("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word",color:"rgba(255,255,255,0.7)",fontSize:"0.9rem",lineHeight:"1.6",margin:0,fontFamily:"inherit"},children:ut.body_text||"(contenu vide)"})}),ut.replied&&ut.reply_text&&t.jsxs("div",{style:{padding:"16px",borderRadius:"12px",background:"rgba(16,185,129,0.05)",border:"1px solid rgba(16,185,129,0.15)",marginBottom:"16px"},children:[t.jsx("div",{style:{fontSize:"0.8rem",fontWeight:"600",color:"#10b981",marginBottom:"8px"},children:"âï¸ Votre réponse :"}),t.jsx("pre",{style:{whiteSpace:"pre-wrap",color:"rgba(255,255,255,0.6)",fontSize:"0.85rem",lineHeight:"1.5",margin:0,fontFamily:"inherit"},children:ut.reply_text})]}),t.jsxs("div",{style:{padding:"20px",borderRadius:"14px",background:"rgba(139,92,246,0.04)",border:"1px solid rgba(139,92,246,0.15)"},children:[t.jsxs("label",{style:{display:"block",fontSize:"0.85rem",fontWeight:"700",color:"rgba(255,255,255,0.6)",marginBottom:"8px"},children:["ð¬ Répondre à ",ut.from_name||ut.from_email]}),t.jsx("textarea",{value:dt,onChange:Qe=>Rr(Qe.target.value),rows:5,placeholder:"Tapez votre réponse...",style:{...et,resize:"vertical",minHeight:"100px",lineHeight:"1.6",marginBottom:"12px"}}),t.jsx("button",{onClick:ct,disabled:!dt.trim()||br,style:{padding:"14px 28px",borderRadius:"12px",cursor:!dt.trim()||br?"not-allowed":"pointer",background:!dt.trim()||br?"rgba(255,255,255,0.05)":"linear-gradient(135deg, #8b5cf6, #6d28d9)",border:"none",color:!dt.trim()||br?"rgba(255,255,255,0.3)":"white",fontWeight:"800",fontSize:"0.95rem",display:"flex",alignItems:"center",gap:"8px"},children:br?t.jsxs(t.Fragment,{children:[t.jsx(qs,{size:16,style:{animation:"spin 1s linear infinite"}})," Envoi..."]}):t.jsxs(t.Fragment,{children:[t.jsx(ji,{size:16})," Envoyer la réponse"]})})]})]}):t.jsx("div",{children:Dr&&Pt.length===0?t.jsxs("div",{style:{textAlign:"center",padding:"60px 20px",color:"rgba(255,255,255,0.3)"},children:[t.jsx(qs,{size:28,style:{animation:"spin 1s linear infinite",marginBottom:"12px"}}),t.jsx("div",{children:"Chargement..."})]}):Pt.length===0?t.jsxs("div",{style:{textAlign:"center",padding:"60px 20px"},children:[t.jsx(vg,{size:40,color:"rgba(255,255,255,0.15)",style:{marginBottom:"12px"}}),t.jsx("div",{style:{color:"rgba(255,255,255,0.3)",fontSize:"0.95rem"},children:"Aucun email reçu"}),t.jsx("div",{style:{color:"rgba(255,255,255,0.2)",fontSize:"0.8rem",marginTop:"4px"},children:"Les emails envoyés à [email protected] apparaîtront ici"})]}):t.jsx("div",{style:{borderRadius:"14px",border:"1px solid rgba(255,255,255,0.06)",overflow:"hidden"},children:Pt.map(Qe=>t.jsxs("div",{onClick:()=>{Wt(Qe),Rr(""),Qe.read||Ge(Qe.id)},style:{display:"flex",alignItems:"center",gap:"14px",padding:"14px 18px",cursor:"pointer",borderBottom:"1px solid rgba(255,255,255,0.04)",background:Qe.read?"transparent":"rgba(139,92,246,0.06)",transition:"background 0.15s"},children:[t.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",background:Qe.read?"transparent":"#8b5cf6",flexShrink:0}}),t.jsx("div",{style:{width:"36px",height:"36px",borderRadius:"50%",background:"linear-gradient(135deg, #8b5cf6, #6d28d9)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"14px",fontWeight:"700",color:"white",flexShrink:0},children:(Qe.from_name||Qe.from_email||"?")[0].toUpperCase()}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"2px"},children:[t.jsx("span",{style:{fontWeight:Qe.read?"500":"700",color:"white",fontSize:"0.9rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Qe.from_name||Qe.from_email}),t.jsx("span",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.3)",flexShrink:0,marginLeft:"8px"},children:new Date(Qe.received_at).toLocaleDateString("fr-FR",{day:"2-digit",month:"short"})})]}),t.jsx("div",{style:{fontWeight:Qe.read?"400":"600",color:Qe.read?"rgba(255,255,255,0.5)":"rgba(255,255,255,0.8)",fontSize:"0.85rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Qe.subject||"(sans sujet)"}),t.jsx("div",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.3)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:"2px"},children:(Qe.body_text||"").slice(0,80)})]}),t.jsx("div",{style:{display:"flex",gap:"4px",flexShrink:0},children:Qe.replied&&t.jsx("div",{style:{padding:"2px 8px",borderRadius:"6px",background:"rgba(16,185,129,0.1)",border:"1px solid rgba(16,185,129,0.2)",fontSize:"0.7rem",color:"#10b981"},children:"Répondu"})})]},Qe.id))})})]})})(),o==="marketing"&&(()=>{const q=async()=>{It(!0);try{const{data:Se}=await D.from("referrals").select("*, referrer:referrer_id(name, email, referral_code), referred:referred_id(name, email)").order("created_at",{ascending:!1}).limit(100);Ue(Se||[]);const{data:me}=await D.from("promo_codes").select("*").order("created_at",{ascending:!1});At(me||[]);const{data:Je}=await D.from("profiles").select("utm_source, utm_medium, utm_campaign").not("utm_source","is",null),pt={};
2581(Je||[]).forEach(it=>{const Ke=it.utm_source||"direct";pt[Ke]||(pt[Ke]={source:Ke,count:0,campaigns:{}}),pt[Ke].count++,it.utm_campaign&&(pt[Ke].campaigns[it.utm_campaign]=(pt[Ke].campaigns[it.utm_campaign]||0)+1)}),Gt(Object.values(pt).sort((it,Ke)=>Ke.count-it.count))}catch(Se){console.error("Marketing fetch error:",Se)}It(!1),Dt(!0)};!jt&&!fr&&q();const Ge=Se=>({padding:"10px 20px",borderRadius:"12px",cursor:"pointer",border:`1.5px solid ${Se?"#f97316":"rgba(255,255,255,0.08)"}`,background:Se?"rgba(249,115,22,0.12)":"rgba(255,255,255,0.03)",color:Se?"#f97316":"rgba(255,255,255,0.5)",fontSize:"0.85rem",fontWeight:Se?"700":"500",transition:"all 0.2s"}),ct={width:"100%",padding:"12px 14px",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.3)",color:"white",fontSize:"0.9rem",outline:"none",fontFamily:"inherit",boxSizing:"border-box"},et={};Et.forEach(Se=>{var Je,pt,it;const me=Se.referrer_id;et[me]||(et[me]={name:((Je=Se.referrer)==null?void 0:Je.name)||"?",email:((pt=Se.referrer)==null?void 0:pt.email)||"",code:((it=Se.referrer)==null?void 0:it.referral_code)||"",count:0,totalMeetips:0}),et[me].count++,et[me].totalMeetips+=Se.meetips_rewarded||10});const Qe=Object.values(et).sort((Se,me)=>me.count-Se.count),bt=async()=>{Nt.code.trim()&&(await D.from("promo_codes").insert({code:Nt.code.toUpperCase().trim(),meetips_reward:parseInt(Nt.meetips_reward)||10,max_uses:Nt.max_uses?parseInt(Nt.max_uses):null,expires_at:Nt.expires_at||null}),jr({code:"",meetips_reward:10,max_uses:"",expires_at:""}),q())},Ee=async(Se,me)=>{await D.from("promo_codes").update({active:!me}).eq("id",Se),At(Je=>Je.map(pt=>pt.id===Se?{...pt,active:!me}:pt))},We=async()=>{if(!Zt)return;const Se={meetips_reward:parseInt(Zt.meetips_reward)||10,max_uses:Zt.max_uses?parseInt(Zt.max_uses):null,expires_at:Zt.expires_at||null};await D.from("promo_codes").update(Se).eq("id",Zt.id),At(me=>me.map(Je=>Je.id===Zt.id?{...Je,...Se}:Je)),kr(null)},fe=async Se=>{window.confirm("Supprimer ce code promo définitivement ?")&&(await D.from("promo_codes").delete().eq("id",Se),At(me=>me.filter(Je=>Je.id!==Se)),(Zt==null?void 0:Zt.id)===Se&&kr(null))};return t.jsxs("div",{children:[t.jsxs("h2",{style:{margin:"0 0 8px",fontFamily:"Outfit",fontSize:"1.2rem",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(ba,{size:20,color:"#f97316"})," Marketing & Acquisition"]}),t.jsx("p",{style:{color:"rgba(255,255,255,0.4)",marginBottom:"20px",fontSize:"0.85rem"},children:"Parrainage, codes promo et sources d'acquisition"}),t.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"24px",flexWrap:"wrap"},children:[t.jsx("button",{onClick:()=>Ze("referrals"),style:Ge(Ne==="referrals"),children:"ð Parrainage"}),t.jsx("button",{onClick:()=>Ze("promo"),style:Ge(Ne==="promo"),children:"ðï¸ Codes Promo"}),t.jsx("button",{onClick:()=>Ze("utm"),style:Ge(Ne==="utm"),children:"ð Sources UTM"}),t.jsx("button",{onClick:()=>Ze("facebook"),style:Ge(Ne==="facebook"),children:"ð± Facebook"})]}),Ne==="referrals"&&t.jsxs("div",{children:[t.jsx("div",{style:{display:"flex",gap:"12px",marginBottom:"20px",flexWrap:"wrap"},children:[{label:"parrainages total",val:Et.length},{label:"parrains actifs",val:Qe.length},{label:"Meetips distribués",val:Et.reduce((Se,me)=>Se+(me.meetips_rewarded||10),0)}].map((Se,me)=>t.jsxs("div",{style:{flex:1,minWidth:"130px",padding:"18px",borderRadius:"14px",background:"rgba(249,115,22,0.06)",border:"1px solid rgba(249,115,22,0.15)",textAlign:"center"},children:[t.jsx("div",{style:{fontSize:"2rem",fontWeight:"800",color:"#f97316"},children:Se.val}),t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)"},children:Se.label})]},me))}),Qe.length>0?t.jsxs("div",{style:{borderRadius:"14px",border:"1px solid rgba(255,255,255,0.06)",overflow:"hidden"},children:[t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"40px 1fr 1fr 70px 70px",gap:"8px",padding:"12px 16px",background:"rgba(255,255,255,0.03)",fontSize:"0.75rem",color:"rgba(255,255,255,0.4)",fontWeight:"600",textTransform:"uppercase"},children:[t.jsx("div",{children:"#"}),t.jsx("div",{children:"Parrain"}),t.jsx("div",{children:"Code"}),t.jsx("div",{children:"Filleuls"}),t.jsx("div",{children:"Meetips"})]}),Qe.map((Se,me)=>t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"40px 1fr 1fr 70px 70px",gap:"8px",padding:"12px 16px",borderTop:"1px solid rgba(255,255,255,0.04)",alignItems:"center"},children:[t.jsx("div",{style:{fontWeight:"700",color:me<3?"#f97316":"rgba(255,255,255,0.4)"},children:me+1}),t.jsxs("div",{children:[t.jsx("div",{style:{fontWeight:"600",color:"white",fontSize:"0.9rem"},children:Se.name}),t.jsx("div",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.3)"},children:Se.email})]}),t.jsxs("div",{style:{fontSize:"0.85rem",color:"#f97316",fontFamily:"monospace",cursor:"pointer"},onClick:()=>{navigator.clipboard.writeText(`https://meetapps.ai/?ref=${Se.code}`),e.success("Lien copié !")},children:[Se.code," ð"]}),t.jsx("div",{style:{fontWeight:"700",color:"white",textAlign:"center"},children:Se.count}),t.jsxs("div",{style:{fontWeight:"700",color:"#22c55e",textAlign:"center"},children:["+",Se.totalMeetips]})]},me))]}):t.jsx("div",{style:{textAlign:"center",padding:"40px",color:"rgba(255,255,255,0.3)"},children:"Aucun parrainage encore"})]}),Ne==="promo"&&t.jsxs("div",{children:[t.jsxs("div",{style:{padding:"20px",borderRadius:"14px",background:"rgba(249,115,22,0.04)",border:"1px solid rgba(249,115,22,0.15)",marginBottom:"20px"},children:[t.jsx("div",{style:{fontWeight:"700",color:"rgba(255,255,255,0.7)",marginBottom:"12px",fontSize:"0.9rem"},children:"â Créer un code promo"}),t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"10px",marginBottom:"12px"},children:[t.jsx("input",{value:Nt.code,onChange:Se=>jr(me=>({...me,code:Se.target.value})),placeholder:"Code (ex: MEETLYON2026)",style:ct}),t.jsx("input",{type:"number",value:Nt.meetips_reward,onChange:Se=>jr(me=>({...me,meetips_reward:Se.target.value})),placeholder:"Meetips offerts",style:ct}),t.jsx("input",{type:"number",value:Nt.max_uses,onChange:Se=>jr(me=>({...me,max_uses:Se.target.value})),placeholder:"Max utilisations (vide = illimité)",style:ct}),t.jsx("input",{type:"date",value:Nt.expires_at,onChange:Se=>jr(me=>({...me,expires_at:Se.target.value})),style:ct})]}),t.jsx("button",{onClick:bt,disabled:!Nt.code.trim(),style:{padding:"12px 24px",borderRadius:"12px",background:Nt.code.trim()?"linear-gradient(135deg, #f97316, #ea580c)":"rgba(255,255,255,0.05)",border:"none",color:Nt.code.trim()?"white":"rgba(255,255,255,0.3)",fontWeight:"800",cursor:Nt.code.trim()?"pointer":"not-allowed",fontSize:"0.9rem"},children:"Créer le code"})]}),St.length>0?t.jsxs("div",{style:{borderRadius:"14px",border:"1px solid rgba(255,255,255,0.06)",overflow:"hidden"},children:[t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 80px 100px 100px 80px 40px",gap:"8px",padding:"12px 16px",background:"rgba(255,255,255,0.03)",fontSize:"0.75rem",color:"rgba(255,255,255,0.4)",fontWeight:"600",textTransform:"uppercase"},children:[t.jsx("div",{children:"Code"}),t.jsx("div",{children:"Meetips"}),t.jsx("div",{children:"Utilisation"}),t.jsx("div",{children:"Expire"}),t.jsx("div",{children:"Statut"}),t.jsx("div",{})]}),St.map(Se=>{const me=Se.expires_at&&new Date(Se.expires_at)<new Date,Je=Se.max_uses&&Se.current_uses>=Se.max_uses;return(Zt==null?void 0:Zt.id)===Se.id?t.jsxs("div",{style:{borderTop:"1px solid rgba(249,115,22,0.2)",background:"rgba(249,115,22,0.04)"},children:[t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 80px 100px 100px 80px 40px",gap:"8px",padding:"12px 16px",alignItems:"center"},children:[t.jsx("div",{style:{fontWeight:"700",color:"#f97316",fontFamily:"monospace",fontSize:"0.95rem"},children:Se.code}),t.jsx("div",{children:t.jsx("input",{type:"number",value:Zt.meetips_reward,onChange:it=>kr(Ke=>({...Ke,meetips_reward:it.target.value})),style:{width:"60px",padding:"4px 6px",borderRadius:"6px",border:"1px solid rgba(249,115,22,0.3)",background:"rgba(0,0,0,0.3)",color:"#22c55e",fontSize:"0.85rem",textAlign:"center",outline:"none",fontWeight:"600"}})}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"center"},children:[t.jsxs("span",{style:{color:"rgba(255,255,255,0.4)",fontSize:"0.8rem"},children:[Se.current_uses||0,"/"]}),t.jsx("input",{type:"number",value:Zt.max_uses,onChange:it=>kr(Ke=>({...Ke,max_uses:it.target.value})),placeholder:"â",style:{width:"50px",padding:"4px 6px",borderRadius:"6px",border:"1px solid rgba(249,115,22,0.3)",background:"rgba(0,0,0,0.3)",color:"white",fontSize:"0.8rem",textAlign:"center",outline:"none"}})]}),t.jsx("div",{children:t.jsx("input",{type:"date",value:Zt.expires_at||"",onChange:it=>kr(Ke=>({...Ke,expires_at:it.target.value})),style:{width:"100%",padding:"4px 6px",borderRadius:"6px",border:"1px solid rgba(249,115,22,0.3)",background:"rgba(0,0,0,0.3)",color:"white",fontSize:"0.75rem",outline:"none",fontFamily:"inherit"}})}),t.jsx("div",{children:t.jsx("button",{onClick:()=>Ee(Se.id,Se.active),style:{padding:"4px 10px",borderRadius:"6px",background:Se.active?"rgba(16,185,129,0.15)":"rgba(239,68,68,0.15)",border:`1px solid ${Se.active?"rgba(16,185,129,0.3)":"rgba(239,68,68,0.3)"}`,color:Se.active?"#10b981":"#ef4444",fontSize:"0.75rem",cursor:"pointer",fontWeight:"600"},children:Se.active?"Actif":"Off"})}),t.jsx("div",{})]}),t.jsxs("div",{style:{display:"flex",gap:"8px",padding:"0 16px 12px",justifyContent:"flex-end"},children:[t.jsx("button",{onClick:()=>fe(Se.id),style:{padding:"6px 14px",borderRadius:"8px",background:"rgba(239,68,68,0.1)",border:"1px solid rgba(239,68,68,0.3)",color:"#ef4444",fontSize:"0.8rem",cursor:"pointer",fontWeight:"600"},children:"ðï¸ Supprimer"}),t.jsx("button",{onClick:()=>kr(null),style:{padding:"6px 14px",borderRadius:"8px",background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.5)",fontSize:"0.8rem",cursor:"pointer",fontWeight:"600"},children:"Annuler"}),t.jsx("button",{onClick:We,style:{padding:"6px 14px",borderRadius:"8px",background:"linear-gradient(135deg, #f97316, #ea580c)",border:"none",color:"white",fontSize:"0.8rem",cursor:"pointer",fontWeight:"700"},children:"â
Enregistrer"})]})]},Se.id):t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 80px 100px 100px 80px 40px",gap:"8px",padding:"12px 16px",borderTop:"1px solid rgba(255,255,255,0.04)",alignItems:"center",opacity:!Se.active||me||Je?.5:1},children:[t.jsx("div",{style:{fontWeight:"700",color:"#f97316",fontFamily:"monospace",fontSize:"0.95rem"},children:Se.code}),t.jsxs("div",{style:{textAlign:"center",color:"#22c55e",fontWeight:"600"},children:["+",Se.meetips_reward]}),t.jsxs("div",{style:{textAlign:"center",color:"white"},children:[Se.current_uses||0,Se.max_uses?`/${Se.max_uses}`:" / â"]}),t.jsx("div",{style:{fontSize:"0.8rem",color:me?"#ef4444":"rgba(255,255,255,0.4)"},children:Se.expires_at?new Date(Se.expires_at).toLocaleDateString("fr-FR"):"â"}),t.jsx("div",{children:t.jsx("button",{onClick:()=>Ee(Se.id,Se.active),style:{padding:"4px 10px",borderRadius:"6px",background:Se.active?"rgba(16,185,129,0.15)":"rgba(239,68,68,0.15)",border:`1px solid ${Se.active?"rgba(16,185,129,0.3)":"rgba(239,68,68,0.3)"}`,color:Se.active?"#10b981":"#ef4444",fontSize:"0.75rem",cursor:"pointer",fontWeight:"600"},children:Se.active?"Actif":"Off"})}),t.jsx("div",{children:t.jsx("button",{onClick:()=>kr({id:Se.id,meetips_reward:Se.meetips_reward,max_uses:Se.max_uses||"",expires_at:Se.expires_at?Se.expires_at.split("T")[0]:""}),style:{background:"none",border:"none",cursor:"pointer",fontSize:"1rem",padding:"2px",opacity:.5},title:"Modifier",children:"âï¸"})})]},Se.id)})]}):t.jsx("div",{style:{textAlign:"center",padding:"40px",color:"rgba(255,255,255,0.3)"},children:"Aucun code promo créé"})]}),Ne==="utm"&&t.jsx("div",{children:Ft.length>0?t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{marginBottom:"24px"},children:(()=>{const Se=Math.max(...Ft.map(me=>me.count),1);return Ft.map((me,Je)=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"10px"},children:[t.jsx("div",{style:{width:"120px",fontSize:"0.85rem",color:"rgba(255,255,255,0.7)",fontWeight:"600",textAlign:"right",flexShrink:0},children:me.source}),t.jsx("div",{style:{flex:1,height:"28px",borderRadius:"8px",background:"rgba(255,255,255,0.04)",overflow:"hidden"},children:t.jsx("div",{style:{height:"100%",width:`${me.count/Se*100}%`,borderRadius:"8px",background:`linear-gradient(90deg, hsl(${Je*60%360}, 70%, 55%), hsl(${(Je*60+30)%360}, 70%, 45%))`,display:"flex",alignItems:"center",justifyContent:"flex-end",paddingRight:"8px",transition:"width 0.5s ease"},children:t.jsx("span",{style:{fontSize:"0.75rem",fontWeight:"700",color:"white"},children:me.count})})})]},Je))})()}),t.jsxs("div",{style:{borderRadius:"14px",border:"1px solid rgba(255,255,255,0.06)",overflow:"hidden"},children:[t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 80px 1fr",gap:"8px",padding:"12px 16px",background:"rgba(255,255,255,0.03)",fontSize:"0.75rem",color:"rgba(255,255,255,0.4)",fontWeight:"600",textTransform:"uppercase"},children:[t.jsx("div",{children:"Source"}),t.jsx("div",{children:"Inscrits"}),t.jsx("div",{children:"Campagnes"})]}),Ft.map((Se,me)=>t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 80px 1fr",gap:"8px",padding:"12px 16px",borderTop:"1px solid rgba(255,255,255,0.04)",alignItems:"center"},children:[t.jsx("div",{style:{fontWeight:"700",color:"white"}
2581,children:Se.source}),t.jsx("div",{style:{fontWeight:"700",color:"#f97316",textAlign:"center"},children:Se.count}),t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.4)"},children:Object.entries(Se.campaigns).map(([Je,pt])=>`${Je} (${pt})`).join(", ")||"â"})]},me))]})]}):t.jsxs("div",{style:{textAlign:"center",padding:"40px",color:"rgba(255,255,255,0.3)"},children:[t.jsx(ba,{size:40,color:"rgba(255,255,255,0.1)",style:{marginBottom:"12px"}}),t.jsx("div",{children:"Aucune donnée UTM"}),t.jsx("div",{style:{fontSize:"0.8rem",marginTop:"4px"},children:"Les sources apparaîtront quand des utilisateurs s'inscriront via des liens trackés"}),t.jsxs("div",{style:{fontSize:"0.8rem",marginTop:"8px",color:"rgba(255,255,255,0.5)"},children:["Exemple : ",t.jsx("code",{style:{background:"rgba(255,255,255,0.08)",padding:"2px 6px",borderRadius:"4px"},children:"meetapps.ai/?utm_source=instagram&utm_campaign=launch"})]})]})}),Ne==="facebook"&&(()=>{const Se=`ð Découvrez MEETapps.ai â la plateforme de TOUTES les rencontres ! ð 2582 2583ð¡ Un seul site, 3 univers : 2584 2585â¤ï¸ MEET EROS â Amour & rencontres sérieuses 2586ð¤ MEET FRIEND â Amitié & sorties de groupe 2587ð¥ MEET EROX â Rencontres décomplexées entre adultes 2588 2589⨠Ce qui rend MEETapps unique : 2590ð Offrez des cadeaux virtuels à vos matchs 2591ðºï¸ Retrouvez les membres proches de chez vous sur une carte 2592ð¤ Trouvez votre match idéal grâce à l'IA 2593ð¤ Ajoutez une bio vocale pour vous démarquer 2594 2595ð° Les MEETips, c'est quoi ? 2596Chaque membre reçoit 5 MEETips gratuits à l'inscription. 2597Les MEETips permettent d'envoyer des cadeaux et d'accéder aux fonctionnalités premium. 2598 2599ð OFFRE SPÃCIALE : 5 MEETips OFFERTS pour toute inscription ! 2600 2601ð Inscrivez-vous gratuitement : https://meetapps.ai 2602 2603#rencontres #dating #amour #amitie #meetapps`,me=()=>{navigator.clipboard.writeText(Se),e.success("Message copié ! ð")};return t.jsxs("div",{children:[t.jsxs("div",{style:{marginBottom:"20px"},children:[t.jsx("div",{style:{fontWeight:"700",color:"rgba(255,255,255,0.7)",marginBottom:"8px",fontSize:"0.9rem"},children:"ð± Message prêt à poster dans un groupe Facebook"}),t.jsx("p",{style:{color:"rgba(255,255,255,0.4)",fontSize:"0.8rem",margin:"0 0 16px"},children:"Copiez ce message et collez-le dans un groupe Facebook pour promouvoir MEETapps. L'image promo est téléchargeable ci-dessous."})]}),t.jsxs("div",{style:{marginBottom:"20px",textAlign:"center"},children:[t.jsx("img",{src:"/facebook_promo_banner.png",alt:"MEETapps Promo",style:{maxWidth:"100%",borderRadius:"14px",border:"1px solid rgba(255,255,255,0.1)",marginBottom:"12px"}}),t.jsx("div",{style:{display:"flex",gap:"10px",justifyContent:"center"},children:t.jsx("a",{href:"/facebook_promo_banner.png",download:"MEETapps_Promo_Facebook.png",style:{padding:"10px 20px",borderRadius:"10px",background:"rgba(59,130,246,0.15)",border:"1px solid rgba(59,130,246,0.3)",color:"#3b82f6",fontSize:"0.85rem",fontWeight:"600",textDecoration:"none",display:"inline-flex",alignItems:"center",gap:"6px"},children:"ð¥ Télécharger l'image"})})]}),t.jsx("div",{style:{padding:"20px",borderRadius:"14px",background:"rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.08)",marginBottom:"16px",position:"relative"},children:t.jsx("pre",{style:{margin:0,whiteSpace:"pre-wrap",wordWrap:"break-word",fontFamily:"inherit",fontSize:"0.88rem",color:"rgba(255,255,255,0.75)",lineHeight:1.7},children:Se})}),t.jsx("button",{onClick:me,style:{width:"100%",padding:"16px",borderRadius:"14px",border:"none",background:"linear-gradient(135deg, #1877f2, #0d65d9)",color:"white",fontWeight:"700",fontSize:"1rem",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",boxShadow:"0 4px 20px rgba(24,119,242,0.3)",transition:"all 0.2s"},onMouseEnter:Je=>{Je.currentTarget.style.transform="scale(1.02)"},onMouseLeave:Je=>{Je.currentTarget.style.transform="scale(1)"},children:"ð Copier le message Facebook"}),t.jsxs("div",{style:{marginTop:"16px",padding:"14px 18px",borderRadius:"12px",background:"rgba(245,158,11,0.06)",border:"1px solid rgba(245,158,11,0.15)",fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",lineHeight:1.6},children:["ð¡ ",t.jsx("strong",{style:{color:"#f59e0b"},children:"Astuce :"}),` Postez d'abord l'image, puis collez le message dans la description du post. Les groupes Facebook locaux ("Rencontres Lyon", "Célibataires Paris"...) sont les plus efficaces.`]})]})})()]})})(),o==="analytics"&&(()=>{if(co||(Co(!0),ai(!0),v2().then(fe=>{ao(fe),ai(!1)})),lo||!wr)return t.jsxs("div",{style:{textAlign:"center",padding:"60px 0",color:"rgba(255,255,255,0.4)"},children:[t.jsx("div",{style:{fontSize:"2rem",marginBottom:"10px",animation:"pulse 1.5s infinite"},children:"ð"}),"Chargement des analytics..."]});const q=wr,Ge=Si==="today"?"Today":Si==="week"?"Week":"Month",ct=q[`visitors${Ge}`],et=q[`loggedIn${Ge}`],Qe=q[`pageViews${Ge}`],bt=fe=>{if(fe<60)return`${fe}s`;const Se=Math.floor(fe/60),me=fe%60;return`${Se}m ${me}s`},Ee={"/":"ð Accueil (Landing)","/login":"ð Connexion","/signup":"ð Inscription","/matches":"ð Profils / Swipe","/messages":"ð¬ Messagerie","/home":"ð¡ Tableau de bord","/events":"ð Ãvénements","/favorites":"â Coups de cÅur","/settings":"âï¸ Paramètres","/account":"ð¤ Mon profil","/shop":"ðï¸ Boutique","/entraide":"ð¤ Entraide","/map":"ðºï¸ Carte","/blog":"ð° Blog","/subscription":"ð Abonnement","/eros-expert":"ð¤ Eros Expert","/help-chat":"â Aide","/edit-criteria":"ð¯ Critères"},We=Math.max(...q.dailyVisits.map(fe=>fe.pageViews),1);return t.jsxs("div",{children:[t.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"20px",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between"},children:[t.jsx("div",{style:{display:"flex",gap:"8px"},children:[{id:"today",label:"Aujourd'hui"},{id:"week",label:"Cette semaine"},{id:"month",label:"Ce mois"}].map(fe=>t.jsx("button",{onClick:()=>Br(fe.id),style:{padding:"8px 18px",borderRadius:"10px",fontSize:"0.82rem",fontWeight:Si===fe.id?"700":"500",background:Si===fe.id?"rgba(20,184,166,0.18)":"rgba(255,255,255,0.04)",border:Si===fe.id?"1p
2603x solid rgba(20,184,166,0.4)":"1px solid rgba(255,255,255,0.08)",color:Si===fe.id?"#2dd4bf":"rgba(255,255,255,0.5)",cursor:"pointer",transition:"all 0.2s"},children:fe.label},fe.id))}),t.jsxs("button",{onClick:()=>{Co(!1),ai(!0),v2().then(fe=>{ao(fe),ai(!1),Co(!0)})},style:{padding:"8px 16px",borderRadius:"10px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.6)",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px",fontSize:"0.82rem"},children:[t.jsx(kn,{size:14})," Actualiser"]})]}),t.jsxs("div",{className:"admin-stat-grid",style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"14px",marginBottom:"24px"},children:[t.jsx(To,{icon:rr,label:"Visiteurs uniques",value:ct,gradient:"linear-gradient(135deg, #0f766e, #115e59)",iconColor:"#2dd4bf",delay:0}),t.jsx(To,{icon:Ut,label:"Utilisateurs connectés",value:et,gradient:"linear-gradient(135deg, #1e40af, #1e3a5f)",iconColor:"#60a5fa",delay:.1}),t.jsx(To,{icon:ss,label:"Pages vues",value:Qe,gradient:"linear-gradient(135deg, #7e22ce, #581c87)",iconColor:"#c084fc",delay:.2}),t.jsx(To,{icon:Pn,label:"Durée moy.",value:q.avgDuration,gradient:"linear-gradient(135deg, #b45309, #78350f)",iconColor:"#fbbf24",delay:.3})]}),t.jsxs("div",{style:{padding:"14px 18px",borderRadius:"14px",background:"linear-gradient(135deg, rgba(20,184,166,0.08), rgba(20,184,166,0.02))",border:"1px solid rgba(20,184,166,0.2)",marginBottom:"20px",display:"flex",alignItems:"center",gap:"12px"},children:[t.jsx("div",{style:{fontSize:"1.5rem"},children:"ð "}),t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"0.82rem",color:"rgba(255,255,255,0.5)",marginBottom:"2px"},children:"Visiteurs page d'accueil (non connectés) aujourd'hui"}),t.jsx("div",{style:{fontSize:"1.3rem",fontWeight:"800",color:"#2dd4bf",fontFamily:"Outfit"},children:q.landingVisitorsToday})]})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"16px",padding:"20px",border:"1px solid rgba(255,255,255,0.06)",marginBottom:"20px"},children:[t.jsxs("h3",{style:{margin:"0 0 16px",fontSize:"1rem",fontFamily:"Outfit",fontWeight:"700",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(ba,{size:18,color:"#2dd4bf"})," Tendance des 7 derniers jours"]}),t.jsx("div",{style:{display:"flex",gap:"8px",alignItems:"flex-end",height:"140px"},children:q.dailyVisits.map((fe,Se)=>t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",gap:"6px"},children:[t.jsx("div",{style:{fontSize:"0.7rem",fontWeight:"700",color:"#2dd4bf"},children:fe.pageViews}),t.jsx("div",{style:{width:"100%",borderRadius:"6px 6px 0 0",background:"linear-gradient(180deg, #14b8a6, #0f766e)",height:`${Math.max(4,fe.pageViews/We*100)}px`,transition:"height 0.5s ease",opacity:.85}}),t.jsx("div",{style:{fontSize:"0.65rem",color:"rgba(255,255,255,0.4)",textAlign:"center",lineHeight:1.2},children:fe.date})]},Se))}),t.jsx("div",{style:{display:"flex",gap:"16px",marginTop:"12px",justifyContent:"center"},children:q.dailyVisits.map((fe,Se)=>t.jsxs("div",{style:{fontSize:"0.65rem",color:"rgba(255,255,255,0.35)",textAlign:"center"},children:[t.jsx("span",{style:{color:"#60a5fa"},children:fe.loggedIn})," connectés ⢠",t.jsx("span",{style:{color:"#2dd4bf"},children:fe.visitors})," uniq."]},Se))})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"16px",padding:"20px",border:"1px solid rgba(255,255,255,0.06)",marginBottom:"20px"},children:[t.jsxs("h3",{style:{margin:"0 0 16px",fontSize:"1rem",fontFamily:"Outfit",fontWeight:"700",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(pu,{size:18,color:"#c084fc"})," Pages les plus visitées"]}),t.jsx("div",{className:"admin-table-scroll",children:t.jsxs("div",{children:[t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"2fr 1fr 1fr 2fr",gap:"8px",padding:"8px 12px",borderBottom:"1px solid rgba(255,255,255,0.08)",fontSize:"0.72rem",fontWeight:"700",color:"rgba(255,255,255,0.4)",textTransform:"uppercase"},children:[t.jsx("span",{children:"Page"}),t.jsx("span",{style:{textAlign:"center"},children:"Visites"}),t.jsx("span",{style:{textAlign:"center"},children:"Durée moy."}),t.jsx("span",{children:"Barre"})]}),q.topPages.map((fe,Se)=>{var Je;const me=((Je=q.topPages[0])==null?void 0:Je.count)||1;return t.jsxs("div",{className:"admin-row",style:{display:"grid",gridTemplateColumns:"2fr 1fr 1fr 2fr",gap:"8px",padding:"10px 12px",alignItems:"center",borderBottom:"1px solid rgba(255,255,255,0.03)"},children:[t.jsx("span",{style:{fontSize:"0.82rem",fontWeight:"600",color:"rgba(255,255,255,0.8)"},children:Ee[fe.page]||fe.page}),t.jsx("span",{style:{textAlign:"center",fontWeight:"800",color:"#2dd4bf",fontSize:"0.9rem"},children:fe.count}),t.jsx("span",{style:{textAlign:"center",fontSize:"0.78rem",color:"rgba(255,255,255,0.5)"},children:bt(fe.avgDuration)}),t.jsx("div",{style:{background:"rgba(255,255,255,0.06)",borderRadius:"4px",overflow:"hidden",height:"8px"},children:t.jsx("div",{style:{width:`${fe.count/me*100}%`,height:"100%",background:"linear-gradient(90deg, #14b8a6, #2dd4bf)",borderRadius:"4px",transition:"width 0.5s ease"}})})]},Se)})]})})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"16px",padding:"20px",border:"1px solid rgba(255,255,255,0.06)"},children:[t.jsxs("h3",{style:{margin:"0 0 16px",fontSize:"1rem",fontFamily:"Outfit",fontWeight:"700",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(Pn,{size:18,color:"#fbbf24"})," Activité récente"]}),t.jsx("div",{className:"admin-table-scroll",children:t.jsxs("div",{children:[t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"2fr 1fr 1fr 1fr",gap:"8px",padding:"8px 12px",borderBottom:"1px solid rgba(255,255,255,0.08)",fontSize:"0.72rem",fontWeight:"700",color:"rgba(255,255,255,0.4)",textTransform:"uppercase"},children:[t.jsx("span",{children:"Page"}),t.jsx("span",{children:"Type"}),t.jsx("span",{children:"Durée"}),t.jsx("span",{children:"Heure"})]}),q.recentVisits.map((fe,Se)=>t.jsxs("div",{className:"admin-row",style:{display:"grid",gridTemplateColumns:"2fr 1fr 1fr 1fr",gap:"8px",padding:"10px 12px",alignItems:"center",borderBottom:"1px solid rgba(255,255,255,0.03)"},children:[t.jsx("span",{style:{fontSize:"0.82rem",color:"rgba(255,255,255,0.7)"},children:Ee[fe.page]||fe.page}),t.jsx("span",{style:{fontSize:"0.72rem",fontWeight:"700",padding:"3px 10px",borderRadius:"8px",background:fe.user_id?"rgba(96,165,250,0.15)":"rgba(255,255,255,0.06)",color:fe.user_id?"#60a5fa":"rgba(255,255,255,0.4)",border:`1px solid ${fe.user_id?"rgba(96,165,250,0.3)":"rgba(255,255,255,0.08)"}`,textAlign:"center"},children:fe.user_id?"ð¤ Connecté":"ðï¸ Visiteur"}),t.jsx("span",{style:{fontSize:"0.78rem",color:"rgba(255,255,255,0.5)"},children:bt(fe.duration_seconds||0)}),t.jsx("span",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.35)"}
2603,children:new Date(fe.created_at).toLocaleString("fr-FR",{hour:"2-digit",minute:"2-digit",day:"2-digit",month:"2-digit"})})]},Se))]})})]})]})})()]},o)]})]}),Jr&&t.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",backdropFilter:"blur(6px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},onClick:()=>Tt(null),children:t.jsxs("div",{style:{background:"linear-gradient(145deg, #1e1e2e, #252540)",borderRadius:"20px",padding:"32px",maxWidth:"420px",width:"100%",border:"1px solid rgba(255,255,255,0.1)",boxShadow:"0 20px 60px rgba(0,0,0,0.5)"},onClick:q=>q.stopPropagation(),children:[t.jsxs("div",{style:{textAlign:"center",marginBottom:"20px"},children:[t.jsx("div",{style:{fontSize:"2.5rem",marginBottom:"12px"},children:Jr.type==="delete"?"ðï¸":Jr.isGhost?"ðï¸":"ð»"}),t.jsx("h3",{style:{margin:"0 0 8px",fontFamily:"Outfit",fontSize:"1.2rem",color:"white"},children:Jr.type==="delete"?`Supprimer "${Jr.botName}" ?`:Jr.isGhost?`Remettre "${Jr.botName}" en ligne ?`:`Masquer "${Jr.botName}" ?`}),t.jsx("p",{style:{margin:0,color:"rgba(255,255,255,0.5)",fontSize:"0.85rem",lineHeight:1.5},children:Jr.type==="delete"?"Cette action est irréversible. Tous les messages et interactions du bot seront supprimés.":Jr.isGhost?"Le bot redeviendra visible pour les utilisateurs.":"Le bot ne sera plus visible mais ses conversations passées resteront intactes."})]}),t.jsxs("div",{style:{display:"flex",gap:"12px"},children:[t.jsx("button",{type:"button",onClick:()=>Tt(null),style:{flex:1,padding:"12px",borderRadius:"12px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.7)",cursor:"pointer",fontWeight:"600",fontSize:"0.9rem",transition:"all 0.2s"},children:"Annuler"}),t.jsx("button",{type:"button",onClick:pa,style:{flex:1,padding:"12px",borderRadius:"12px",background:Jr.type==="delete"?"linear-gradient(135deg, #ef4444, #dc2626)":Jr.isGhost?"linear-gradient(135deg, #22c55e, #16a34a)":"linear-gradient(135deg, #6b7280, #4b5563)",border:"none",color:"white",cursor:"pointer",fontWeight:"700",fontSize:"0.9rem",transition:"all 0.2s",boxShadow:Jr.type==="delete"?"0 4px 16px rgba(239,68,68,0.3)":"0 4px 16px rgba(0,0,0,0.3)"},children:Jr.type==="delete"?"ðï¸ Supprimer":Jr.isGhost?"ðï¸ Remettre":"ð» Masquer"})]})]})}),O&&(()=>{var bt;const q=[{label:"Identité",icon:Ut},{label:"Photos",icon:wd},{label:"Personnalité",icon:Xt},{label:"Pictos",icon:VA}],Ge=ot.space==="EROX"?So:ot.space==="FRIEND"?il:Fn,ct=ot.space==="EROX"?"erox_tags":ot.space==="FRIEND"?"friend_tags":"tags",Qe={EROS:"#ec4899",EROX:"#ef4444",FRIEND:"#10b981"}[ot.space]||"#ec4899";return t.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.85)",backdropFilter:"blur(12px)",zIndex:1e3,display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsxs("div",{style:{width:"95%",maxWidth:"680px",borderRadius:"24px",background:"linear-gradient(140deg, #0f0a1a 0%, #1a1030 50%, #0f0a1a 100%)",border:`1px solid ${Qe}30`,maxHeight:"92vh",display:"flex",flexDirection:"column",overflow:"hidden"},children:[t.jsxs("div",{style:{padding:"24px 28px 0",borderBottom:"1px solid rgba(255,255,255,0.06)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"20px"},children:[t.jsxs("h2",{style:{margin:0,fontFamily:"Outfit",fontSize:"1.3rem",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(Kn,{size:24,color:Qe})," ",M?"Modifier le Bot":"Créer un Bot IA"]}),t.jsx("button",{onClick:()=>E(!1),style:{background:"rgba(255,255,255,0.06)",border:"none",color:"rgba(255,255,255,0.5)",width:"36px",height:"36px",borderRadius:"10px",cursor:"pointer",fontSize:"1.1rem"},children:"â"})]}),t.jsx("div",{style:{display:"flex",gap:"4px",paddingBottom:"16px"},children:q.map((Ee,We)=>t.jsxs("button",{onClick:()=>B(We),style:{flex:1,padding:"8px 4px",borderRadius:"8px",background:We===$?`${Qe}25`:"rgba(255,255,255,0.03)",border:`1px solid ${We===$?Qe+"50":"transparent"}`,color:We===$?Qe:"rgba(255,255,255,0.35)",cursor:"pointer",fontSize:"0.75rem",fontWeight:We===$?"700":"500",display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",transition:"all 0.2s"},children:[t.jsx(Ee.icon,{size:14}),t.jsx("span",{style:{display:We===$?"inline":"none"},children:Ee.label}),We!==$&&t.jsx("span",{children:We+1})]},We))})]}),t.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"24px 28px"},children:[$===0&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"14px"},children:[t.jsx("input",{className:"input-field",value:ot.name,onChange:Ee=>Zr({...ot,name:Ee.target.value}),placeholder:"Prénom du bot",style:{fontSize:"1rem",padding:"14px 16px"}}),t.jsxs("div",{className:"admin-grid-3col",style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:"12px"},children:[t.jsxs("div",{children:[t.jsx("label",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.4)",marginBottom:"6px",display:"block"},children:"Ãge"}),t.jsx("input",{type:"number",className:"input-field",value:ot.age,onChange:Ee=>Zr({...ot,age:parseInt(Ee.target.value)||25}),style:{width:"100%"}})]}),t.jsxs("div",{children:[t.jsx("label",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.4)",marginBottom:"6px",display:"block"},children:"Genre"}
2603),t.jsxs("select",{className:"input-field",value:ot.gender,onChange:Ee=>Zr({...ot,gender:Ee.target.value}),style:{width:"100%"},children:[t.jsx("option",{value:"female",children:"Femme"}),t.jsx("option",{value:"male",children:"Homme"})]})]}),t.jsxs("div",{children:[t.jsx("label",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.4)",marginBottom:"6px",display:"block"},children:"Espace"}),t.jsxs("select",{className:"input-field",value:ot.space,onChange:Ee=>Zr({...ot,space:Ee.target.value}),style:{width:"100%",color:Qe},children:[t.jsx("option",{value:"EROS",children:"⥠EROS"}),t.jsx("option",{value:"EROX",children:"ð¥ EROX"}),t.jsx("option",{value:"FRIEND",children:"ð¤ FRIEND"})]})]})]}),t.jsx("input",{className:"input-field",value:ot.job,onChange:Ee=>Zr({...ot,job:Ee.target.value}),placeholder:"Métier"}),t.jsx("textarea",{className:"input-field",value:ot.bio,onChange:Ee=>Zr({...ot,bio:Ee.target.value}),placeholder:((bt=v7[ot.space])==null?void 0:bt.defaultBio)||"Bio du bot...",rows:3}),t.jsxs("button",{type:"button",onClick:()=>{if(!ot.name){e.warning("Remplis le nom d'abord !");return}const Ee=k7({name:ot.name,age:ot.age,gender:ot.gender,job:ot.job,personality:ot.personality,space:ot.space}),We=ot.space==="EROX"?"erox_tags":ot.space==="FRIEND"?"friend_tags":"tags";Zr(fe=>({...fe,bio:Ee.bio,[We]:Ee.tags})),e.success(`ðª Bio + ${Ee.tags.length} pictos générés automatiquement !`)},style:{background:"linear-gradient(135deg, #8b5cf6, #ec4899)",border:"none",borderRadius:"10px",padding:"10px 18px",color:"white",fontWeight:"700",fontSize:"0.85rem",cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",transition:"all 0.2s",boxShadow:"0 4px 15px rgba(139,92,246,0.3)"},onMouseEnter:Ee=>Ee.currentTarget.style.transform="scale(1.02)",onMouseLeave:Ee=>Ee.currentTarget.style.transform="scale(1)",children:[t.jsx(zh,{size:16})," ðª Auto-remplir Bio + Pictos"]})]}),$===1&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[t.jsxs("p",{style:{color:"rgba(255,255,255,0.5)",fontSize:"0.85rem",margin:0},children:["Téléchargez jusqu'à 3 photos pour l'espace ",t.jsx("strong",{style:{color:Qe},children:ot.space})]}),t.jsx("div",{style:{display:"flex",gap:"12px",justifyContent:"center"},children:[0,1,2].map(Ee=>t.jsxs("label",{style:{width:"100px",height:"100px",borderRadius:"14px",border:`2px dashed ${F[Ee]?Qe:"rgba(255,255,255,0.15)"}`,background:F[Ee]?"none":"rgba(255,255,255,0.03)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",position:"relative",transition:"all 0.2s"},children:[F[Ee]?t.jsx("img",{src:F[Ee],alt:`photo-${Ee}`,style:{width:"100%",height:"100%",objectFit:"cover"}}):t.jsxs("div",{style:{textAlign:"center",color:"rgba(255,255,255,0.25)"},children:[t.jsx(Sp,{size:22}),t.jsxs("div",{style:{fontSize:"0.65rem",marginTop:"4px"},children:["Photo ",Ee+1]})]}),t.jsx("input",{type:"file",accept:"image/*",style:{display:"none"},onChange:We=>Ji(Ee,We.target.files[0])})]},Ee))}),t.jsxs("div",{style:{marginTop:"12px",background:"rgba(59,130,246,0.05)",border:"1px solid rgba(59,130,246,0.15)",borderRadius:"14px",padding:"14px"},children:[t.jsxs("button",{type:"button",onClick:()=>so(!bn),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",background:"none",border:"none",color:"#60a5fa",cursor:"pointer",fontFamily:"Outfit",fontWeight:"700",fontSize:"0.85rem",padding:"4px 0"},children:[t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(Xt,{size:16})," ð¨ Générer 3 photos IA"]}),t.jsx(l0,{size:16,style:{transform:bn?"rotate(180deg)":"none",transition:"transform 0.2s"}})]}),bn&&t.jsxs("div",{style:{marginTop:"12px",display:"flex",flexDirection:"column",gap:"10px"},children:[t.jsx("p",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.45)",margin:"0 0 4px"},children:"Décrivez l'avatar souhaité :"}),t.jsxs("div",{style:{display:"flex",gap:"8px"},children:[t.jsxs("div",{style:{flex:1},children:[t.jsx("label",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.4)",marginBottom:"4px",display:"block"},children:"Genre"}
2603),t.jsxs("select",{value:qt.gender,onChange:Ee=>Ai(We=>({...We,gender:Ee.target.value})),style:{width:"100%",padding:"8px",borderRadius:"8px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"white",fontSize:"0.8rem",fontFamily:"Outfit"},children:[t.jsx("option",{value:"female",children:"ð© Femme"}),t.jsx("option",{value:"male",children:"ð¨ Homme"})]})]}),t.jsxs("div",{style:{flex:1},children:[t.jsx("label",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.4)",marginBottom:"4px",display:"block"},children:"Ãge"}),t.jsx("input",{type:"number",min:"18",max:"65",value:qt.age,onChange:Ee=>Ai(We=>({...We,age:parseInt(Ee.target.value)||25})),style:{width:"100%",padding:"8px",borderRadius:"8px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"white",fontSize:"0.8rem",fontFamily:"Outfit"}})]})]}),t.jsxs("div",{style:{display:"flex",gap:"8px"},children:[t.jsxs("div",{style:{flex:1},children:[t.jsx("label",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.4)",marginBottom:"4px",display:"block"},children:"Couleur cheveux"}),t.jsxs("select",{value:qt.hairColor,onChange:Ee=>Ai(We=>({...We,hairColor:Ee.target.value})),style:{width:"100%",padding:"8px",borderRadius:"8px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"white",fontSize:"0.8rem",fontFamily:"Outfit"},children:[t.jsx("option",{value:"",children:"â Aléatoire â"}),Kd.hairColors.map(Ee=>t.jsx("option",{value:Ee,children:Ee},Ee))]})]}),t.jsxs("div",{style:{flex:1},children:[t.jsx("label",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.4)",marginBottom:"4px",display:"block"},children:"Coiffure"}),t.jsxs("select",{value:qt.hairStyle,onChange:Ee=>Ai(We=>({...We,hairStyle:Ee.target.value})),style:{width:"100%",padding:"8px",borderRadius:"8px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"white",fontSize:"0.8rem",fontFamily:"Outfit"},children:[t.jsx("option",{value:"",children:"â Aléatoire â"}),Kd.hairStyles.map(Ee=>t.jsx("option",{value:Ee,children:Ee},Ee))]})]})]}),t.jsxs("div",{style:{display:"flex",gap:"8px"},children:[t.jsxs("div",{style:{flex:1},children:[t.jsx("label",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.4)",marginBottom:"4px",display:"block"},children:"Origine"}),t.jsxs("select",{value:qt.ethnicity,onChange:Ee=>Ai(We=>({...We,ethnicity:Ee.target.value})),style:{width:"100%",padding:"8px",borderRadius:"8px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"white",fontSize:"0.8rem",fontFamily:"Outfit"},children:[t.jsx("option",{value:"",children:"â Aléatoire â"}),Kd.ethnicities.map(Ee=>t.jsx("option",{value:Ee,children:Ee},Ee))]})]}),t.jsxs("div",{style:{flex:1},children:[t.jsx("label",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.4)",marginBottom:"4px",display:"block"},children:"Morphologie"}),t.jsxs("select",{value:qt.bodyType,onChange:Ee=>Ai(We=>({...We,bodyType:Ee.target.value})),style:{width:"100%",padding:"8px",borderRadius:"8px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"white",fontSize:"0.8rem",fontFamily:"Outfit"},children:[t.jsx("option",{value:"",children:"â Aléatoire â"}),Kd.bodyTypes.map(Ee=>t.jsx("option",{value:Ee,children:Ee},Ee))]})]})]}),t.jsxs("div",{children:[t.jsx("label",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.4)",marginBottom:"4px",display:"block"},children:"Style vestimentaire"}),t.jsxs("select",{value:qt.clothingStyle,onChange:Ee=>Ai(We=>({...We,clothingStyle:Ee.target.value})),style:{width:"100%",padding:"8px",borderRadius:"8px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"white",fontSize:"0.8rem",fontFamily:"Outfit"},children:[t.jsx("option",{value:"",children:"â Aléatoire â"}),Kd.clothingStyles.map(Ee=>t.jsx("option",{value:Ee,children:Ee},Ee))]})]}),t.jsxs("div",{children:[t.jsx("label",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.4)",marginBottom:"4px",display:"block"},children:"Description libre (optionnel)"}),t.jsx("textarea",{value:qt.customDescription,onChange:Ee=>Ai(We=>({...We,customDescription:Ee.target.value})),placeholder:"Ex: yeux verts, avec des lunettes, tatouage sur le bras...",rows:2,style:{width:"100%",padding:"8px",borderRadius:"8px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"white",fontSize:"0.8rem",fontFamily:"Outfit",resize:"vertical"}})]}),t.jsx("button",{type:"button",onClick:async Ee=>{if(Ee.stopPropagation(),Ee.preventDefault(),!yn){oo(!0),Vt("Préparation...");try{const We=await KP({style:{...qt,gender:ot.gender||qt.gender,age:ot.age||qt.age},onProgress:(fe,Se)=>{const me={generating:"Génération IA",uploading:"Upload",done:"â",error:"â"};Vt(`Photo ${fe+1}/3 : ${me[Se]||Se}...`)}});if(We.previews.length>0){const fe=[...F];We.previews.forEach((me,Je)=>{me&&Je<3&&(fe[Je]=me)}),A(fe);const Se=[...G];for(let me=0;me<We.previews.length&&me<3;me++)if(We.previews[me]){const pt=await(await fetch(We.previews[me])).blob();Se[me]=new File([pt],`ai_photo_${me}.png`,{type:pt.type})}le(Se),e.success(`ð¨ ${We.previews.length} photo(s) générée(s) !`)}else e.error("Aucune photo générée. Essayez un autre style.")}catch(We){console.error("Photo gen error:",We),e.error("Erreur : "+We.message)}finally{oo(!1),Vt("")}}},disabled:yn,style:{width:"100%",padding:"14px 16px",background:yn?"linear-gradient(135deg, rgba(59,130,246,0.1), rgba(37,99,235,0.1
2603))":"linear-gradient(135deg, #3b82f6, #8b5cf6)",border:"none",borderRadius:"12px",color:"white",fontFamily:"Outfit",fontWeight:"700",fontSize:"0.85rem",cursor:yn?"wait":"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s",boxShadow:yn?"none":"0 4px 16px rgba(59,130,246,0.3)"},children:yn?t.jsxs(t.Fragment,{children:[t.jsx(sx,{size:16,style:{animation:"spin 1s linear infinite"}})," ",$n]}):t.jsxs(t.Fragment,{children:[t.jsx(Xt,{size:16})," Générer les 3 photos"]})}),t.jsx("p",{style:{fontSize:"0.65rem",color:"rgba(255,255,255,0.3)",textAlign:"center",margin:"2px 0 0"},children:"ð¸ Portrait ⢠â Lifestyle ⢠ð³ Extérieur â Gemini IA (gratuit)"})]})]}),M&&F[0]&&t.jsxs("div",{style:{marginTop:"8px"},children:[t.jsx("button",{onClick:async()=>{if(!Ln){mn(!0);try{const Ee=F[0];e.info("ð¬ Animation en cours... (30-60s)");const We=await Ts.generateAndSaveForBot(M,Ee);We.success?(u(fe=>fe.map(Se=>Se.id===M?{...Se,animated_photo_url:We.url}:Se)),e.success("⨠Photo animée créée !")):e.error(We.error||"Ãchec animation")}catch(Ee){e.error("Erreur: "+Ee.message)}finally{mn(!1)}}},disabled:Ln,style:{width:"100%",padding:"12px 16px",background:"linear-gradient(135deg, rgba(168,85,247,0.15), rgba(139,92,246,0.15))",border:"1px solid rgba(168,85,247,0.3)",borderRadius:"12px",color:"#a855f7",fontFamily:"Outfit",fontWeight:"700",fontSize:"0.85rem",cursor:Ln?"wait":"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s"},children:Ln?t.jsxs(t.Fragment,{children:[t.jsx(sx,{size:16,style:{animation:"spin 1s linear infinite"}})," Animation en cours..."]}):t.jsxs(t.Fragment,{children:[t.jsx(zh,{size:16})," ⨠Animer la photo du bot"]})}),t.jsx("p",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.35)",textAlign:"center",marginTop:"6px"},children:"Utilise xAI pour donner vie à la photo principale"})]})]}),$===2&&t.jsxs("div",{children:[t.jsx("p",{style:{color:"rgba(255,255,255,0.5)",fontSize:"0.85rem",margin:"0 0 16px 0"},children:"Choisissez la personnalité de ce bot. Elle détermine son ton, ses réponses et son style de conversation."}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"},children:Object.entries(Ho).map(([Ee,We])=>t.jsxs("button",{type:"button",onClick:()=>Zr({...ot,personality:Ee}),style:{padding:"18px 16px",borderRadius:"14px",textAlign:"left",cursor:"pointer",transition:"all 0.2s",background:ot.personality===Ee?`${We.color}18`:"rgba(255,255,255,0.02)",border:`2px solid ${ot.personality===Ee?We.color:"rgba(255,255,255,0.06)"}`,color:"white"},children:[t.jsx("div",{style:{fontSize:"1.1rem",fontWeight:"700",marginBottom:"4px",color:ot.personality===Ee?We.color:"white"},children:We.label}),t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.45)",lineHeight:"1.3"},children:We.description}),ot.personality===Ee&&t.jsxs("div",{style:{marginTop:"10px",padding:"8px 10px",borderRadius:"8px",background:`${We.color}10`,fontSize:"0.75rem",color:`${We.color}cc`,fontStyle:"italic"},children:['"',We.greetings[0].substring(0,60),'..."']})]},Ee))})]}),$===3&&t.jsxs("div",{children:[t.jsxs("p",{style:{color:"rgba(255,255,255,0.5)",fontSize:"0.85rem",margin:"0 0 8px 0"},children:["Sélectionnez les pictos pour l'espace ",t.jsx("strong",{style:{color:Qe},children:ot.space}),".",t.jsxs("span",{style:{marginLeft:"8px",color:Qe,fontWeight:"700"},children:[(ot[ct]||[]).length," sélectionnés"]})]}),Ge.map(Ee=>t.jsxs("div",{style:{marginBottom:"20px"},children:[t.jsxs("div",{style:{fontSize:"0.85rem",fontWeight:"700",color:Ee.color,marginBottom:"10px",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(Ee.icon,{size:16})," ",Ee.title]}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:Ee.items.map(We=>{const fe=(ot[ct]||[]).includes(We.id);return t.jsxs("button",{type:"button",onClick:()=>ln(We.id,ct),style:{padding:"6px 12px",borderRadius:"20px",fontSize:"0.78rem",cursor:"pointer",transition:"all 0.15s",display:"flex",alignItems:"center",gap:"5px",background:fe?`${Ee.color}25`:"rgba(255,255,255,0.04)",border:`1px solid ${fe?Ee.color:"rgba(255,255,255,0.08)"}`,color:fe?Ee.color:"rgba(255,255,255,0.5)",fontWeight:fe?"600":"400"},children:[t.jsx(We.icon,{size:13}),We.label]},We.id)})})]},Ee.id))]})]}),t.jsxs("div",{style:{padding:"16px 28px",borderTop:"1px solid rgba(255,255,255,0.06)",display:"flex",gap:"10px",justifyContent:"space-between"},children:[t.jsx("button",{type:"button",onClick:()=>{$>0?B($-1):E(!1)},style:{padding:"12px 20px",borderRadius:"12px",background:"rgba(255,255,255,0.06)",border:"none",color:"rgba(255,255,255,0.6)",cursor:"pointer",fontWeight:"500",fontSize:"0.85rem"},children:$===0?"Annuler":"â Retour"}),t.jsx("div",{style:{display:"flex",gap:"8px"},children:$<3?t.jsxs("button",{type:"button",onClick:()=>B($+1),style:{padding:"12px 24px",borderRadius:"12px",background:`linear-gradient(135deg, ${Qe}, #8b5cf6)`,border:"none",color:"white",cursor:"pointer",fontWeight:"700",fontSize:"0.85rem",display:"flex",alignItems:"center",gap:"6px"},children:["Suivant ",t.jsx(En,{size:16})]}):t.jsx("button",{type:"button",onClick:ks,disabled:Re,style:{padding:"12px 28px",borderRadius:"12px",background:Re?"rgba(255,255,255,0.1)":`linear-gradient(135deg, ${Qe}, #8b5cf6)`,border:"none",color:"white",cursor:Re?"wait":"pointer",fontWeight:"700",fontSize:"0.9rem",display:"flex",alignItems:"center",gap:"6px",opacity:Re?.7:1},children:Re?t.jsxs(t.Fragment,{children:[t.jsx(qs,{size:16,className:"spin"})," Upload en cours..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Xt,{size:16})," Créer le Bot"]})})})]})]})})})(),xr&&t.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",backdropFilter:"blur(6px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:()=>Bn(null),children:t.jsxs("div",{onClick:q=>q.stopPropagation(),style:{background:"#1a1a2e",borderRadius:"20px",border:"1px solid rgba(239,68,68,0.3)",padding:"32px",maxWidth:"440px",width:"90%",textAlign:"center"},children:[t.jsx("div",{style:{width:"64px",height:"64px",borderRadius:"50%",background:"rgba(239,68,68,0.12)",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 20px"},children:t.jsx(rn,{size:28,color:"#ef4444"})}),t.jsx("h3",{style:{margin:"0 0 12px",fontFamily:"Outfit",fontSize:"1.2rem",color:"white"},children:"Supprimer définitivement ?"}),t.jsxs("p",{style:{color:"rgba(255,255,255,0.6)",fontSize:"0.95rem",margin:"0 0 24px",lineHeight:"1.5"},children:["Tu es sur le point de supprimer ",t.jsx("strong",{style:{color:"#ef4444"},children:xr.userName})," et toutes ses données associées. Cette action est irréversible."]}),t.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"center"},children:[t.jsx("button",{onClick:()=>Bn(null),style:{padding:"14px 28px",borderRadius:"12px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.6)",cursor:"pointer",fontWeight:"700",fontSize:"0.95rem"},children:"Annuler"}),t.jsxs("button",{onClick:cl,style:{padding:"14px 28px",borderRadius:"12px",background:"linear-gradient(135deg, #ef4444, #dc2626)",border:"none",color:"white",cursor:"pointer",fontWeight:"800",fontSize:"0.95rem",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(rn,{size:16})," Supprimer"]})]})]})}),Ti&&t.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",backdropFilter:"blur(6px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:()=>Zo(null),children:t.jsxs("div",{onClick:q=>q.stopPropagation(),style:{background:"#1a1a2e",borderRadius:"20px",border:"1px solid rgba(16,185,129,0.3)",padding:"32px",maxWidth:"440px",width:"90%",textAlign:"center"},children:[t.jsx("div",{style:{width:"64px",height:"64px",borderRadius:"50%",background:"rgba(16,185,129,0.12)",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 20px"},children:t.jsx(fi,{size:28,color:"#10b981"})}),t.jsx("h3",{style:{margin:"0 0 12px",fontFamily:"Outfit",fontSize:"1.2rem",color:"white"},children:"Valider le badge de confiance ?"}),t.jsxs("p",{style:{color:"rgba(255,255,255,0.6)",fontSize:"0.95rem",margin:"0 0 24px",lineHeight:"1.5"},children:["Tu confirmes que le selfie de ",t.jsx("strong",{style:{color:"#10b981"},children:Ti.user.name})," correspond à ses photos de profil."]}),t.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"center"},children:[t.jsx("button",{onClick:()=>Zo(null),style:{padding:"14px 28px",borderRadius:"12px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.6)",cursor:"pointer",fontWeight:"700",fontSize:"0.95rem"},children:"Annuler"}),t.jsx("button",{onClick:()=>{Xr(Ti.user,Ti.status),Zo(null)},style:{padding:"14px 28px",borderRadius:"12px",background:"linear-gradient(135deg, #059669, #10b981)",border:"none",color:"white",cursor:"pointer",fontWeight:"800",fontSize:"0.95rem",display:"flex",alignItems:"center",gap:"8px"},children:"â
Valider"})]})]})}),no&&t.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",backdropFilter:"blur(6px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:()=>Yo(null),children:t.jsxs("div",{onClick:q=>q.stopPropagation(),style:{background:"#1a1a2e",borderRadius:"20px",border:"1px solid rgba(239,68,68,0.3)",padding:"32px",maxWidth:"500px",width:"90%"},children:[t.jsx("div",{style:{width:"64px",height:"64px",borderRadius:"50%",background:"rgba(239,68,68,0.12)",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 20px"},children:t.jsx(zS,{size:28,color:"#ef4444"})}),t.jsx("h3",{style:{margin:"0 0 8px",fontFamily:"Outfit",fontSize:"1.2rem",color:"white",textAlign:"center"},children:"Refuser la vérification"}),t.jsxs("p",{style:{color:"rgba(255,255,255,0.5)",fontSize:"0.9rem",margin:"0 0 20px",textAlign:"center"},children:["Explique à ",t.jsx("strong",{style:{color:"#ef4444"},children:no.user.name})," pourquoi le badge ne peut pas être attribué."]}),t.jsx("textarea",{value:Xo,onChange:q=>On(q.target.value),rows:4,style:{width:"100%",padding:"14px",borderRadius:"12px",border:"1px solid rgba(239,68,68,0.25)",background:"rgba(0,0,0,0.3)",color:"white",fontSize:"0.9rem",fontFamily:"Outfit",resize:"vertical",outline:"none",boxSizing:"border-box",marginBottom:"20px"},placeholder:"Raison du refus..."}),t.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"center"},children:[t.jsx("button",{onClick:()=>Yo(null),style:{padding:"14px 28px",borderRadius:"12px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.6)",cursor:"pointer",fontWeight:"700",fontSize:"0.95rem"},children:"Annuler"}),t.jsx("button",{onClick:()=>{Xr(no.user,"rejected",Xo),Yo(null)},style:{padding:"14px 28px",borderRadius:"12px",background:"linear-gradient(135deg, #dc2626, #ef4444)",border:"none",color:"white",cursor:"pointer",fontWeight:"800",fontSize:"0.95rem",display:"flex",alignItems:"center",gap:"8px"},children:"â Refuser et envoyer"})]})]})}),I&&t.jsx(QP,{user:I,onClose:()=>R(null),onUpdate:ua})]})},iF=({user:e})=>{const[r,i]=m.useState("eros"),n=[{key:"eros",label:"Eros",icon:"â¤ï¸",color:"#f43f5e",bg:"rgba(244,63,94,0.12)",border:"rgba(244,63,94,0.3)",avatar:"avatar_url",ph
2603otos:"photos",photoFields:["photo_1","photo_2","photo_3"],tags:"tags",bio:"bio"},{key:"erox",label:"Erox",icon:"ð¥",color:"#f97316",bg:"rgba(249,115,22,0.12)",border:"rgba(249,115,22,0.3)",avatar:"erox_avatar_url",photos:"erox_photos",photoFields:["erox_photo_1","erox_photo_2","erox_photo_3"],tags:"erox_tags",bio:"erox_bio"},{key:"friend",label:"Friend",icon:"ð¥",color:"#22d3ee",bg:"rgba(34,211,238,0.12)",border:"rgba(34,211,238,0.3)",avatar:"friend_avatar_url",photos:"friend_photos",photoFields:["friend_photo_1","friend_photo_2","friend_photo_3"],tags:"friend_tags",bio:"friend_bio"}],o=h=>{const x=[];return e[h.avatar]&&x.push(e[h.avatar]),h.key==="eros"&&e.photo&&!x.includes(e.photo)&&x.push(e.photo),h.photoFields.forEach(y=>{e[y]&&!x.includes(e[y])&&x.push(e[y])}),(e[h.photos]||[]).forEach(y=>{y&&!x.includes(y)&&x.push(y)}),x},a=h=>e[h.tags]||[],l=h=>e[h.bio]||(h.key==="eros"?e.bio:null),d=n.find(h=>h.key===r),p=o(d),u=a(d),g=l(d);return t.jsxs("div",{style:{marginBottom:"18px",background:"rgba(255,255,255,0.02)",borderRadius:"14px",padding:"16px",border:"1px solid rgba(255,255,255,0.06)"},children:[t.jsx("div",{style:{display:"flex",gap:"8px",marginBottom:"14px",flexWrap:"wrap"},children:n.map(h=>{const x=o(h),y=r===h.key,_=x.length>0||a(h).length>0||l(h);return t.jsxs("button",{onClick:()=>i(h.key),style:{display:"flex",alignItems:"center",gap:"6px",padding:"8px 14px",borderRadius:"10px",background:y?h.bg:"rgba(255,255,255,0.04)",border:`2px solid ${y?h.color:"transparent"}`,color:y?h.color:"rgba(255,255,255,0.4)",cursor:"pointer",fontWeight:y?"700":"500",transition:"all 0.2s",fontSize:"0.82rem",opacity:_?1:.35},children:[t.jsx("span",{children:h.icon}),t.jsx("span",{children:h.label}),t.jsx("span",{style:{background:y?h.color:"rgba(255,255,255,0.1)",color:y?"white":"rgba(255,255,255,0.5)",borderRadius:"6px",padding:"1px 7px",fontSize:"0.7rem",fontWeight:"700"},children:x.length})]},h.key)})}),p.length>0?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(100px, 1fr))",gap:"10px",marginBottom:u.length>0||g?"14px":"0"},children:p.map((h,x)=>t.jsxs("div",{style:{position:"relative",borderRadius:"10px",overflow:"hidden",aspectRatio:"3/4",border:`2px solid ${d.border}`},children:[t.jsx("img",{src:h,alt:`${d.label} ${x}`,style:{width:"100%",height:"100%",objectFit:"cover"},onError:y=>{y.target.src="https://via.placeholder.com/100?text=?"}}),x===0&&t.jsx("span",{style:{position:"absolute",bottom:"4px",left:"4px",background:d.color,color:"white",padding:"1px 6px",borderRadius:"4px",fontSize:"0.6rem",fontWeight:"700"},children:"AVATAR"})]},x))}):t.jsxs("p",{style:{color:"rgba(255,255,255,0.3)",fontSize:"0.82rem",fontStyle:"italic",marginBottom:"4px"},children:["Aucun contenu dans l'espace ",d.label]}),u.length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px",marginBottom:g?"10px":"0"},children:u.map((h,x)=>t.jsx("span",{style:{padding:"3px 10px",borderRadius:"14px",fontSize:"0.72rem",background:d.bg,color:d.color,border:`1px solid ${d.border}`},children:typeof h=="string"?h:(h==null?void 0:h.label)||(h==null?void 0:h.name)||JSON.stringify(h)},x))}),g&&t.jsxs("p",{style:{fontSize:"0.82rem",color:"rgba(255,255,255,0.5)",fontStyle:"italic",margin:"0"},children:['"',g,'"']})]})},m1=({user:e,onDelete:r,onView:i})=>{const[n,o]=m.useState(!1),[a,l]=m.useState(null),[d,p]=m.useState(!1),u=e.is_banned?"#ef4444":e.restriction_status==="restricted"?"#f59e0b":e.restriction_status==="pending_review"?"#3b82f6":null,g=async()=>{if(!(a||d)){p(!0);try{const{data:x}=await D.from("matches").select("id"),y=(x||[]).map(N=>N.id);let _=0,S=0;if(y.length>0){const{count:N}=await D.from("messages").select("*",{count:"exact",head:!0}).eq("receiver_id",e.id).in("sender_id",y);_=N||0;const{count:Z}=await D.from("messages").select("*",{count:"exact",head:!0}).eq("sender_id",e.id).in("receiver_id",y);S=Z||0}const k=[e.avatar_url,...e.photo_1?[e.photo_1]:[],...e.photo_2?[e.photo_2]:[],...e.photo_3?[e.photo_3]:[]].filter(Boolean).length,{count:w}=await D.from("messages").select("*",{count:"exact",head:!0}).eq("sender_id",e.id).ilike("content","%animated_photo%"),{data:b}=await D.from("meetips_transactions").select("amount, description").eq("user_id",e.id),{data:j}=await D.from("user_gifts").select("cost").eq("sender_id",e.id),{data:T}=await D.from("user_gifts").select("cost").eq("receiver_id",e.id),P=S*100*.1/1e6,I=_*150*.4/1e6,R=P+I,O=w||0,E=O*.04,$=500/1024/1024*.021,B=k*$,te=((S+_)*2+50)*1e-5,K=e.is_premium?10:5,ne=K*.16,Re=R+E+B+te+ne,Q=(b||[]).filter(N=>N.amount>0&&(N.description||"").toLowerCase().includes("achat")).reduce((N,Z)=>N+Z.amount,0),G=(b||[]).filter(N=>N.amount<0).reduce((N,Z)=>N+Math.abs(Z.amount),0),le=(j||[]).reduce((N,Z)=>N+(Z.cost||0),0),F=(T||[]).reduce((N,Z)=>N+(Z.cost||0),0),A=e.is_premium?19.9:0,M=e.is_premium?"mensuel":null,V=Q*.16,H=A+V;l({botMsgCount:_,userMsgToBots:S,photoCount:k,animPhotoCount:O,geminiChatCost:R,geminiImageCost:E,storageCost:B,dbCost:te,freeMeetips:K,freeMeetipsCost:ne,totalCost:Re,meetipsPurchased:Q,meetipsSpent:G,totalG
2603iftsSent:le,totalGiftsReceived:F,premiumRevenue:A,premiumPlan:M,meetipsRevenue:V,totalRevenue:H,transactions:b||[]})}catch(x){console.error("Error loading cost data:",x),l({error:!0})}p(!1)}},h=()=>{const x=!n;o(x),x&&g()};return t.jsxs("div",{className:"admin-row",style:{borderRadius:"14px",border:`1px solid ${u?u+"20":"rgba(255,255,255,0.04)"}`,overflow:"hidden",transition:"all 0.2s",borderLeft:u?`3px solid ${u}`:"3px solid transparent"},children:[t.jsxs("div",{onClick:h,style:{padding:"14px 18px",display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"14px"},children:[t.jsx("img",{src:e.photo||e.avatar_url||"https://via.placeholder.com/40",style:{width:"42px",height:"42px",borderRadius:"12px",objectFit:"cover",border:"2px solid rgba(255,255,255,0.08)"}}),t.jsxs("div",{children:[t.jsxs("div",{style:{fontWeight:"600",fontSize:"0.95rem",display:"flex",alignItems:"center",gap:"8px"},children:[e.name||"Sans Nom",e.is_premium&&t.jsx(ni,{size:13,color:"#f59e0b"}),e.verification_status==="verified"&&t.jsx(fi,{size:13,color:"#10b981"}),e.is_banned&&t.jsx("span",{style:{fontSize:"0.65rem",background:"#ef4444",padding:"1px 6px",borderRadius:"4px",fontWeight:"700"},children:"BANNI"}),e.restriction_status==="restricted"&&t.jsx("span",{style:{fontSize:"0.65rem",background:"#f59e0b",color:"#000",padding:"1px 6px",borderRadius:"4px",fontWeight:"700"},children:"RESTREINT"}),e.restriction_status==="pending_review"&&t.jsx("span",{style:{fontSize:"0.65rem",background:"#3b82f6",padding:"1px 6px",borderRadius:"4px",fontWeight:"700"},children:"EN ATTENTE"})]}),t.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.35)"},children:e.email})]})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[t.jsx("span",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.3)"},children:new Date(e.created_at).toLocaleDateString()}),n?t.jsx(EA,{size:18,color:"rgba(255,255,255,0.3)"}):t.jsx(l0,{size:18,color:"rgba(255,255,255,0.3)"})]})]}),n&&t.jsxs("div",{style:{padding:"18px",borderTop:"1px solid rgba(255,255,255,0.04)",background:"rgba(0,0,0,0.15)"},children:[t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"18px",marginBottom:"18px"},children:[t.jsxs("div",{children:[t.jsx("h4",{style:{color:"#8b5cf6",marginBottom:"10px",fontSize:"0.8rem",textTransform:"uppercase",letterSpacing:"0.5px"},children:"Informations"}),[{ic:cr,t:e.birthdate?`${new Date().getFullYear()-new Date(e.birthdate).getFullYear()} ans`:"Ãge ?"},{ic:ur,t:e.city||"Ville ?"},{ic:Qn,t:e.job||"â"},{ic:c0,t:e.phone||"â"}].map((x,y)=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontSize:"0.85rem",color:"rgba(255,255,255,0.6)",marginBottom:"6px"},children:[t.jsx(x.ic,{size:14,color:"rgba(255,255,255,0.3)"})," ",x.t]},y))]}),t.jsxs("div",{children:[t.jsx("h4",{style:{color:"#8b5cf6",marginBottom:"10px",fontSize:"0.8rem",textTransform:"uppercase",letterSpacing:"0.5px"},children:"Genre"}),t.jsx("span",{style:{padding:"4px 12px",borderRadius:"8px",fontSize:"0.85rem",background:e.gender==="female"?"rgba(236,72,153,0.12)":"rgba(59,130,246,0.12)",color:e.gender==="female"?"#ec4899":"#3b82f6"},children:e.gender==="female"?"â Femme":e.gender==="male"?"â Homme":e.gender||"?"})]})]}),t.jsx(iF,{user:e}),t.jsxs("div",{style:{background:"linear-gradient(135deg, rgba(30,25,50,0.95), rgba(20,15,40,0.95))",border:"1px solid rgba(255,255,255,0.12)",borderRadius:"14px",padding:"18px",marginBottom:"16px",boxShadow:"0 4px 20px rgba(0,0,0,0.3)"},children:[t.jsx("h4",{style:{color:"#fbbf24",marginBottom:"16px",fontSize:"0.85rem",textTransform:"uppercase",letterSpacing:"1px",display:"flex",alignItems:"center",gap:"8px",fontWeight:"800"},children:"ð Rentabilité"}),d&&t.jsx("div",{style:{textAlign:"center",padding:"24px",color:"rgba(255,255,255,0.6)",fontSize:"0.9rem"},children:"â³ Calcul en cours..."}),a&&!a.error&&t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px"},children:[t.jsxs("div",{style:{background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.2)",borderRadius:"12px",padding:"14px"},children:[t.jsx("div",{style:{fontSize:"0.75rem",color:"#fca5a5",fontWeight:"800",marginBottom:"12px",textTransform:"uppercase",letterSpacing:"0.8px"},children:"ð¸ Coûts estimés"}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.82rem"},children:[t.jsxs("span",{style:{color:"#fecaca"}
2603,children:["ð¤ Chat IA (",a.botMsgCount+a.userMsgToBots," msgs)"]}),t.jsxs("span",{style:{fontWeight:"700",color:"#fca5a5"},children:[a.geminiChatCost.toFixed(4),"â¬"]})]}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.82rem"},children:[t.jsxs("span",{style:{color:"#fecaca"},children:["ð¨ Photos IA (",a.animPhotoCount,")"]}),t.jsxs("span",{style:{fontWeight:"700",color:"#fca5a5"},children:[a.geminiImageCost.toFixed(4),"â¬"]})]}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.82rem"},children:[t.jsxs("span",{style:{color:"#fecaca"},children:["ð¦ Stockage (",a.photoCount," photos)"]}),t.jsxs("span",{style:{fontWeight:"700",color:"#fca5a5"},children:[a.storageCost.toFixed(4),"â¬"]})]}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.82rem"},children:[t.jsx("span",{style:{color:"#fecaca"},children:"ðï¸ Base de données"}),t.jsxs("span",{style:{fontWeight:"700",color:"#fca5a5"},children:[a.dbCost.toFixed(4),"â¬"]})]}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.82rem"},children:[t.jsxs("span",{style:{color:"#fecaca"},children:["ð Meetips offerts (",a.freeMeetips,")"]}),t.jsxs("span",{style:{fontWeight:"700",color:"#fca5a5"},children:[a.freeMeetipsCost.toFixed(2),"â¬"]})]}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.9rem",borderTop:"1px solid rgba(239,68,68,0.25)",paddingTop:"10px",marginTop:"4px"},children:[t.jsx("span",{style:{fontWeight:"800",color:"#f87171"},children:"Total"}),t.jsxs("span",{style:{fontWeight:"900",color:"#f87171",fontSize:"1rem"},children:[a.totalCost.toFixed(4),"â¬"]})]})]})]}),t.jsxs("div",{style:{background:"rgba(16,185,129,0.08)",border:"1px solid rgba(16,185,129,0.2)",borderRadius:"12px",padding:"14px"},children:[t.jsx("div",{style:{fontSize:"0.75rem",color:"#6ee7b7",fontWeight:"800",marginBottom:"12px",textTransform:"uppercase",letterSpacing:"0.8px"},children:"ð° Revenus"}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.82rem"},children:[t.jsx("span",{style:{color:"#a7f3d0"},children:"ð Premium"}),t.jsx("span",{style:{fontWeight:"700",color:a.premiumRevenue>0?"#6ee7b7":"rgba(255,255,255,0.35)"},children:a.premiumRevenue>0?"19.90â¬/mois":"â"})]}),a.premiumRevenue>0&&t.jsx("div",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.3)",fontStyle:"italic",marginTop:"-4px",paddingLeft:"24px"},children:"ou 7.90â¬/sem si hebdo"}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.82rem"},children:[t.jsxs("span",{style:{color:"#a7f3d0"},children:[t.jsx(Jt,{size:14})," Meetips (",a.meetipsPurchased,")"]}),t.jsx("span",{style:{fontWeight:"700",color:a.meetipsRevenue>0?"#6ee7b7":"rgba(255,255,255,0.35)"},children:a.meetipsRevenue>0?`${a.meetipsRevenue.toFixed(2)}â¬`:"â"})]}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.82rem"},children:[t.jsx("span",{style:{color:"#a7f3d0"},children:"ð Cadeaux envoyés"}),t.jsxs("span",{style:{fontWeight:"700",color:"#6ee7b7"},children:[a.totalGiftsSent," ",t.jsx(Jt,{size:13})]})]}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.82rem"},children:[t.jsx("span",{style:{color:"#a7f3d0"},children:"ð Cadeaux reçus"}),t.jsxs("span",{style:{fontWeight:"700",color:"#6ee7b7"},children:[a.totalGiftsReceived," ",t.jsx(Jt,{size:13})]})]}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.9rem",borderTop:"1px solid rgba(16,185,129,0.25)",paddingTop:"10px",marginTop:"4px"},children:[t.jsx("span",{style:{fontWeight:"800",color:"#34d399"},children:"Total"}),t.jsxs("span",{style:{fontWeight:"900",color:"#34d399",fontSize:"1rem"},children:[a.totalRevenue.toFixed(2),"â¬"]})]})]})]})]}),a&&!a.error&&(()=>{const x=a.totalRevenue-a.totalCost,y=x>=0;return t.jsxs("div",{style:{marginTop:"14px",padding:"12px 18px",borderRadius:"12px",background:y?"linear-gradient(135deg, rgba(16,185,129,0.15), rgba(52,211,153,0.08))":"linear-gradient(135deg, rgba(239,68,68,0.15), rgba(248,113,113,0.08))",border:`1px solid ${y?"rgba(52,211,153,0.35)":"rgba(248,113,113,0.35)"}`,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t.jsx("span",{style:{fontSize:"0.9rem",fontWeight:"800",color:y?"#a7f3d0":"#fecaca"}
2603,children:y?"ð Bénéfice net":"ð Perte nette"}),t.jsxs("span",{style:{fontSize:"1.2rem",fontWeight:"900",color:y?"#34d399":"#f87171"},children:[y?"+":"",x.toFixed(4),"â¬"]})]})})(),(a==null?void 0:a.error)&&t.jsx("div",{style:{textAlign:"center",padding:"14px",color:"#fca5a5",fontSize:"0.85rem"},children:"â Erreur lors du calcul"}),a&&!a.error&&t.jsxs("div",{style:{marginTop:"14px",display:"flex",gap:"8px",flexWrap:"wrap"},children:[a.meetipsSpent>0&&t.jsxs("span",{style:{fontSize:"0.72rem",padding:"4px 12px",borderRadius:"10px",background:"rgba(167,139,250,0.15)",border:"1px solid rgba(167,139,250,0.25)",color:"#c4b5fd",fontWeight:"600"},children:[t.jsx(Jt,{size:12})," ",a.meetipsSpent," meetips dépensés"]}),(e.meetips_balance||0)>0&&t.jsxs("span",{style:{fontSize:"0.72rem",padding:"4px 12px",borderRadius:"10px",background:"rgba(96,165,250,0.15)",border:"1px solid rgba(96,165,250,0.25)",color:"#93c5fd",fontWeight:"600"},children:[t.jsx(Jt,{size:12})," Solde: ",e.meetips_balance]}),a.botMsgCount>0&&t.jsxs("span",{style:{fontSize:"0.72rem",padding:"4px 12px",borderRadius:"10px",background:"rgba(192,132,252,0.15)",border:"1px solid rgba(192,132,252,0.25)",color:"#d8b4fe",fontWeight:"600"},children:["ð¤ ",a.botMsgCount," réponses IA"]})]})]}),t.jsxs("div",{style:{display:"flex",gap:"10px",borderTop:"1px solid rgba(255,255,255,0.05)",paddingTop:"14px"},children:[t.jsxs("button",{className:"admin-action-btn",onClick:x=>{x.stopPropagation(),i(e)},style:{flex:1,padding:"10px",borderRadius:"10px",background:"rgba(139,92,246,0.12)",border:"1px solid rgba(139,92,246,0.25)",color:"#a78bfa",cursor:"pointer",fontWeight:"600",fontSize:"0.85rem",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",transition:"all 0.2s"},children:[t.jsx(rr,{size:16})," Profil"]}),t.jsxs("a",{href:`mailto:${e.email}`,className:"admin-action-btn",style:{flex:1,padding:"10px",borderRadius:"10px",background:"rgba(6,182,212,0.12)",border:"1px solid rgba(6,182,212,0.25)",color:"#22d3ee",textDecoration:"none",fontWeight:"600",fontSize:"0.85rem",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",transition:"all 0.2s"},children:[t.jsx(Vr,{size:16})," Email"]}),t.jsx("button",{className:"admin-action-btn",onClick:x=>{x.stopPropagation(),r(e.id,e.name)},style:{padding:"10px 16px",borderRadius:"10px",background:"rgba(239,68,68,0.1)",border:"1px solid rgba(239,68,68,0.2)",color:"#ef4444",cursor:"pointer",fontWeight:"600",fontSize:"0.85rem",display:"flex",alignItems:"center",gap:"6px",transition:"all 0.2s"},children:t.jsx(rn,{size:16})})]})]})]})},nF=()=>{const e=Lt(),{user:r,refreshProfile:i}=gr(),[n,o]=m.useState(!0),[a,l]=m.useState("Paiement Réussi !"),[d,p]=m.useState("Vos privilèges sont en cours d'activation...");return m.useEffect(()=>{(async()=>{try{const g=localStorage.getItem("paymentType"),h=localStorage.getItem("pendingUnlockMatchId");if(g==="unlock_profile"){if(l("Profil Débloqué !"),p("Vous avez maintenant accès aux détails de ce profil."),h){const x=JSON.parse(localStorage.getItem("unlockedMatches")||"[]");if(!x.includes(h)){const y=[...x,h];localStorage.setItem("unlockedMatches",JSON.stringify(y))}}localStorage.removeItem("paymentType"),localStorage.removeItem("pendingUnlockMatchId")}else if(g==="buy_pack"){const x=localStorage.getItem("pendingPackId"),_={starter:{amount:60,name:"Pack Découverte"},regular:{amount:95,name:"Pack Plaisir"},pro:{amount:130,name:"Pack Séducteur"},ultimate:{amount:350,name:"Pack Expert"}}[x];if(_&&r){l("Compte Rechargé !"),p(`${_.amount} Meetips ont été ajoutés à votre compte.`);const{MeetipsService:S}=await Wr(async()=>{const{MeetipsService:k}=await Promise.resolve().then(()=>c7);return{MeetipsService:k}},void 0);await S.buyPack(r.id,{costEur:0,amountMeetips:_.amount}),await i()}else l("Paiement Reçu"),p("Votre compte sera mis à jour sous peu.");localStorage.removeItem("paymentType"),localStorage.removeItem("pendingPackId")}else{if(l("Bienvenue dans le cercle EROS Premium"),p("Vos privilèges sont en cours d'activation..."),localStorage.setItem("isPremium","true"),r){const{error:x}=await D.from("profiles").update({is_premium:!0}).eq("id",r.id);x&&console.error("Error updating premium status in DB:",x),await i()}localStorage.removeItem("paymentType")}window.opener?(window.opener.postMessage("PAYMENT_COMPLETE","*"),l("Paiement Validé !"),p("Cette fenêtre va se fermer automatiquement..."),setTimeout(()=>{window.close()},2e3)):setTimeout(()=>{e("/matches")},4e3)}catch(g){console.error("Activation error:",g),window.opener||setTimeout(()=>e("/matches"),3e3)}finally{o(!1)}})()},[r,e,i]),t.jsx("div",{style:{height:"100vh",background:"black",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"white",fontFamily:"Outfit"},children:t.jsxs("div",{style:{background:"rgba(255,255,255,0.05)",padding:"40px",borderRadius:"20px",textAlign:"center",border:"1px solid rgba(255, 215, 0, 0.3)",boxShadow:"0 0 30px rgba(255, 215, 0, 0.1)"},children:[t.jsx("div",{style:{marginBottom:"20px",color:"#00ff88"},children:t.jsx(ms,{size:64})}),t.jsx("h1",{style:{fontSize:"2rem",marginBottom:"10px"},children:a}),t.jsx("p",{style:{color:"#aaa",marginBottom:"30px"},children:d}),n&&t.jsx(qs,{className:"animate-spin",style:{margin:"0 auto"}})]})})},oF=({children:e})=>{const{user:r,profile:i,loading:n}=gr();return n?t.jsx("div",{style:{height:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-deep)"},children:t.jsx("div",{className:"spinner"})}):r?i&&i.role!=="admin"?(console.log("AdminRoute: User is not admin. Role:",i.role),t.jsxs("div",{style:{padding:50,color:"white",textAlign:"center"},children:[t.jsx("h1",{children:"Accès Refusé"}),t.jsxs("p",{children:["Votre rôle actuel est : ",t.jsx("strong",{children:i.role||"Aucun"})]}),t.jsxs("p",{children:["Le système attend : ",t.jsx("strong",{children:"admin"})]}),t.jsxs("p",{children:["â ï¸ ",t.jsx("strong",{children:"Solution :"})," Déconnectez-vous et reconnectez-vous pour mettre à jour votre profil."]}),t.jsx("button",{onClick:()=>{Wr(()=>Promise.resolve().then(()=>oz),void 0).then(o=>o.safeClearStorage()),window.location.href="/login"},style:{padding:"10px 20px",marginTop:20,background:"gold",border:"none",borderRadius:5,cursor:"pointer"},children:"Se Déconnecter et Réessayer"})]})):e:(console.log("AdminRoute: No user, redirecting to login"),t.jsx(ih,{to:"/login",replace:!0}))},sF=({children:e})=>{var o;const{user:r,loading:i}=gr(),n=ko();return i?t.jsx("div",{style:{height:"100vh",width:"100vw",background:"var(--bg-deep)",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx("div",{className:"spinner",style:{width:"40px",height:"40px",border:"3px solid rgba(255,255,255,0.1)",borderTop:"3px solid var(--primary)",borderRadius:"50%",animation:"spin 1s linear infinite"}})}):r?(o=r.identities)!=null&&o.some(a=>a.provider==="email")&&!r.email_confirmed_at?t.jsx(ih,{to:"/check-email",replace:!0}):e:t.jsx(ih,{to:"/login",state:{from:n},replace:!0})},aF=()=>{const[e,r]=m.useState("match"),[i,n]=m.useState("eros"),o={name:"Julie",photo:"https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-1.2.1&auto=format&fit=crop&w=200&q=80",eventName:"Soirée Masquée Ãlite",eventDate:"Vendredi 25 Octobre 2025",eventTime:"22:00",eventAddress:"12 Avenue Montaigne, 75008 Paris",eventImage:"https://images.unsplash.com/photo-1514525253440-b393452e2347?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80",organizerName:"Alexandre D.",organizerPhoto:"https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?ixlib=rb-1.2.1&auto=format&fit=crop&w=200&q=80"};let a="";switch(e){case"match":a=xx(o.name,o.photo,i);break;case"request":a=AS(o.eventName,o.name,o.photo);break;case"approved":a=V7(o.eventName,o.eventDate,o.eventAddress,o.eventImage);break;case"welcome":a=PS(o.eventName,o.eventDate,o.eventTime,o.eventAddress,o.eventImage,i,o.organizerName);break;case"rating":a=FS(o.eventName,o.eventDate,o.organizerName,o.organizerPhoto,i,"mock-event-id-123");break;case"onboarding":a=Ih("Guillaume");break;default:a=xx(o.name,o.photo,i)}return t.jsxs("div",{style:{display:"flex",height:"100vh",flexDirection:"column",fontFamily:"sans-serif",paddingTop:"80px"},children:[t.jsxs("div",{style:{padding:"20px",background:"#222",color:"white",display:"flex",gap:"10px",alignItems:"center",flexWrap:"wrap",position:"sticky",top:"80px",zIndex:100},children:[t.jsx("h2",{style:{margin:0,marginRight:"15px"},children:"Email Previews"}),t.jsx("button",{onClick:()=>r("match"),style:kl(e==="match"),children:"Match"}),t.jsx("button",{onClick:()=>r("request"),style:kl(e==="request"),children:"Demande"}),t.jsx("button",{onClick:()=>r("approved"),style:kl(e==="approved"),children:"Confirmé"}),t.jsx("button",{onClick:()=>r("welcome"),style:kl(e==="welcome"),children:"ð« Bienvenue Event"}),t.jsx("button",{onClick:()=>r("rating"),style:kl(e==="rating"),children:"â Noter Orga"}),t.jsx("button",{onClick:()=>r("onboarding"),style:kl(e==="onboarding"),children:"ð Bienvenue"}),(e==="match"||e==="welcome"||e==="rating")&&t.jsx("div",{style:{display:"flex",gap:"5px",marginLeft:"15px",padding:"3px",background:"#333",borderRadius:"8px"},children:["eros","erox","friend"].map(l=>t.jsx("button",{onClick:()=>n(l),style:{padding:"6px 12px",border:"none",borderRadius:"6px",cursor:"pointer",fontWeight:"bold",fontSize:"0.8rem",background:i===l?l==="eros"?"#D4AF37":l==="erox"?"#ff3333":"#3B82F6":"transparent",color:i===l?l==="eros"?"#000":"#fff":"#888"},children:l.toUpperCase()},l))})]}),t.jsx("div",{style:{flex:1,background:"#e0e0e0",padding:"40px",display:"flex",justifyContent:"center"},children:t.jsx("iframe",{title:"preview",srcDoc:a,style:{width:"100%",maxWidth:"650px",height:"100%",border:"none",background:"white",boxShadow:"0 0 20px rgba(0,0,0,0.2)"}})})]})},kl=e=>({padding:"8px 16px",borderRadius:"5px",border:"none",background:e?"#D4AF37":"#444",color:e?"black":"white",cursor:"pointer",fontWeight:"bold",fontSize:"0.85rem"}
2603),lF=({isOpen:e,onClose:r,onConfirm:i,title:n,message:o,confirmText:a="Confirmer",cancelText:l="Annuler",isDanger:d=!1})=>e?t.jsx("div",{style:{position:"fixed",inset:0,zIndex:1e3,background:"rgba(0,0,0,0.6)",backdropFilter:"blur(5px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},children:t.jsxs("div",{className:"glass-panel animate-fade-in",style:{maxWidth:"400px",width:"100%",padding:"30px",borderRadius:"20px",textAlign:"center",border:"1px solid rgba(255,255,255,0.1)",boxShadow:"0 20px 50px rgba(0,0,0,0.5)",background:"var(--bg-card)"},children:[t.jsx("div",{style:{width:"60px",height:"60px",borderRadius:"50%",background:d?"rgba(255, 77, 77, 0.2)":"rgba(51, 153, 255, 0.2)",color:d?"#ff4d4d":"#3399ff",margin:"0 auto 20px",display:"flex",alignItems:"center",justifyContent:"center"},children:d?t.jsx(_n,{size:32}):t.jsx(pr,{size:32})}),t.jsx("h3",{style:{fontSize:"1.4rem",fontFamily:"Outfit",marginBottom:"10px",color:"white"},children:n}),t.jsx("p",{style:{color:"var(--text-muted)",marginBottom:"30px",lineHeight:"1.5"},children:o}),t.jsxs("div",{style:{display:"flex",gap:"15px"},children:[t.jsx("button",{onClick:r,style:{flex:1,padding:"12px",borderRadius:"12px",background:"rgba(255,255,255,0.05)",border:"none",color:"white",cursor:"pointer",fontWeight:"bold"},children:l}),t.jsx("button",{onClick:()=>{i(),r()},style:{flex:1,padding:"12px",borderRadius:"12px",background:d?"#ff4d4d":"var(--primary)",border:"none",color:"white",cursor:"pointer",fontWeight:"bold",boxShadow:d?"0 5px 15px rgba(255, 77, 77, 0.4)":"0 5px 15px rgba(124, 77, 255, 0.4)"},children:a})]})]})}):null,dF=()=>{const e=si(),r=Lt(),{user:i,loading:n}=gr(),[o,a]=m.useState([]),[l,d]=m.useState(!0),[p,u]=m.useState(!1),[g,h]=m.useState(null);m.useEffect(()=>{i&&x()},[i]);const x=async()=>{console.log("Fetching blocked users (Fixed)...");try{d(!0);const{data:S,error:k}=await D.from("blocked_users").select("id, blocked_id, created_at").eq("blocker_id",i.id);if(k)throw k;if(!S||S.length===0){a([]);return}const w=S.map(I=>I.blocked_id),{data:b,error:j}=await D.from("profiles").select("id, name, photo, avatar_url, birthdate, job").in("id",w);if(j)throw console.error("Profile fetch error:",j),j;const T={};b.forEach(I=>{let R="??";if(I.birthdate){const O=new Date(I.birthdate),E=new Date;R=E.getFullYear()-O.getFullYear();const $=E.getMonth()-O.getMonth();($<0||$===0&&E.getDate()<O.getDate())&&R--}T[I.id]={...I,age:R}});const P=S.map(I=>({...I,blocked:T[I.blocked_id]||null})).filter(I=>I.blocked!==null);a(P)}catch(S){console.error("Full Error:",S),e.error("Erreur: "+(S.message||"Problème inconnu"))}finally{d(!1)}},y=(S,k)=>{h({id:S,name:k}),u(!0)},_=async()=>{if(g)try{const{error:S}=await D.from("blocked_users").delete().eq("id",g.id);if(S)throw S;a(o.filter(k=>k.id!==g.id))}catch(S){console.error("Error unblocking user:",S),e.error("Erreur lors du déblocage.")}};return t.jsxs("div",{style:{minHeight:"100vh",background:"var(--bg-deep)",padding:"20px",paddingTop:"100px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:"30px"},children:[t.jsx("button",{onClick:()=>r(-1),style:{background:"none",border:"none",color:"white",cursor:"pointer",marginRight:"15px"},children:t.jsx(Hr,{size:24})}),t.jsxs("h1",{style:{fontFamily:"Outfit",fontSize:"1.5rem",margin:0,display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(ad,{size:24,color:"#ff4d4d"}),"Utilisateurs Bloqués"]})]}),t.jsx("div",{className:"glass-panel",style:{borderRadius:"20px",padding:"20px",minHeight:"300px"},children:l?t.jsx("div",{className:"spinner",style:{margin:"50px auto"}}):o.length===0?t.jsxs("div",{style:{textAlign:"center",padding:"40px",color:"var(--text-muted)"},children:[t.jsx(Km,{size:48,style:{marginBottom:"15px",opacity:.5}}),t.jsx("p",{children:"Vous n'avez bloqué personne."}),t.jsx("p",{style:{fontSize:"0.85rem"},children:"C'est beau l'amour ! âï¸"})]}):t.jsx("div",{style:{display:"grid",gap:"15px"},children:o.map(S=>{const k=S.blocked;return k?t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"15px",background:"rgba(255,255,255,0.05)",padding:"15px",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.05)"},children:[k.photo||k.avatar_url?t.jsx("img",{src:k.photo||k.avatar_url,alt:k.name,onError:w=>{w.target.onerror=null,w.target.style.display="none",w.target.nextSibling.style.display="flex"},style:{width:"50px",height:"50px",borderRadius:"50%",objectFit:"cover"}}):null,t.jsx("div",{style:{width:"50px",height:"50px",borderRadius:"50%",background:"rgba(255,255,255,0.1)",display:k.photo||k.avatar_url?"none":"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(ad,{size:24,color:"var(--text-muted)"})}),t.jsxs("div",{style:{flex:1},children:[t.jsxs("div",{style:{fontWeight:"bold"},children:[k.name,", ",k.age]}),t.jsx("div",{style:{fontSize:"0.8rem",color:"var(--text-muted)"},children:k.job})]}),t.jsxs("button",{onClick:()=>y(S.id,k.name),style:{padding:"8px 15px",borderRadius:"20px",background:"rgba(255,255,255,0.1)",border:"1px solid rgba(255,255,255,0.2)",color:"white",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px",fontSize:"0.85rem"},children:[t.jsx(GA,{size:14})," Débloquer"]})]},S.id):null})})}),t.jsx(lF,{isOpen:p,onClose:()=>u(!1),onConfirm:_,title:"Débloquer cet utilisateur ?",message:`Ãtes-vous sûr de vouloir débloquer ${g==null?void 0:g.name} ? Ils pourront à nouveau voir votre profil et vous contacter.`,confirmText:"Oui, débloquer",cancelText:"Annuler",isDanger:!1})]})},cF=[{id:"starter",cost:10,amount:60,name:"Pack Découverte",emoji:"â¨",bonus:null,accent:"#06b6d4",gradient:"linear-gradient(135deg, #06b6d4, #22d3ee)"},{id:"regular",cost:15,amount:95,name:"Pack Plaisir",emoji:"ð",popular:!0,bonus:"+15 bonus",accent:"#a85
26035f7",gradient:"linear-gradient(135deg, #a855f7, #c084fc)"},{id:"pro",cost:20,amount:130,name:"Pack Séducteur",emoji:"ð¥",bonus:"+20 bonus",accent:"#f97316",gradient:"linear-gradient(135deg, #f97316, #fb923c)"},{id:"ultimate",cost:50,amount:350,name:"Pack Expert",emoji:"ð",bonus:"+50 bonus",best:!0,accent:"#eab308",gradient:"linear-gradient(135deg, #eab308, #facc15)"}],pF={beer:"#f59e0b",pizza:"#ef4444",rose:"#ec4899",bouquet:"#a855f7",ring:"#06b6d4",cherry:"#ef4444",flame:"#f97316",mask:"#8b5cf6",handcuffs:"#64748b",whip:"#6366f1",check:"#22c55e",coffee:"#a16207",champagne:"#eab308",burger:"#f97316",cocktail:"#ec4899",travel:"#06b6d4"},uF=()=>{const e=si(),{profile:r,refreshProfile:i}=gr(),{isErox:n,isFriend:o}=dr(),a=Lt(),l=xn(),[d,p]=m.useState(0),[u,g]=m.useState(!1),[h,x]=m.useState([]),[y,_]=m.useState(null),[S,k]=m.useState(null),[w,b]=m.useState(!1),[j,T]=m.useState(null),[P,I]=m.useState(null),[R,O]=m.useState([]),[E,$]=m.useState(""),[B,ee]=m.useState(!1),[te,K]=m.useState(null),[ne,Re]=m.useState(""),[Q,G]=m.useState(!1),[le,F]=m.useState(null),[A,M]=m.useState([]),[V,H]=m.useState(()=>!li("meetips_tutorial_seen")),N=()=>{Or("meetips_tutorial_seen","true"),H(!1)};m.useEffect(()=>{r!=null&&r.id&&(ae(),X(),ke());const J=Ie=>{Ie.data==="PAYMENT_COMPLETE"&&ae().then(z=>{const Y=P;Y&&Ae(Y,z)})};return window.addEventListener("message",J),()=>window.removeEventListener("message",J)},[r,n,o]),m.useEffect(()=>{if(!P)return;const J=d,Ie=async()=>{if(document.visibilityState==="visible"&&P){await new Promise(Y=>setTimeout(Y,1500));const z=await wi.getBalance(r.id);z>J&&(p(z),Ae(P,z),I(null))}};return document.addEventListener("visibilitychange",Ie),()=>document.removeEventListener("visibilitychange",Ie)},[P,d,r]);const Z=n?x0:o?m0:f0,ae=async()=>{if(!(r!=null&&r.id))return 0;const J=await wi.getBalance(r.id);return p(J),J},X=async()=>{if(!(r!=null&&r.id))return;const J=await wi.getReceivedGifts(r.id);x(J)},he=(J,Ie="success")=>{_({message:J,type:Ie}),setTimeout(()=>_(null),3e3)},Ae=(J,Ie)=>{id(),T({pack:J,newBalance:Ie}),re(window.innerWidth/2,window.innerHeight/2);const z=Array.from({length:60},(Y,ce)=>({id:ce,x:Math.random()*100,delay:Math.random()*.8,duration:1.5+Math.random()*1.5,rotation:Math.random()*720-360,color:["#f472b6","#818cf8","#34d399","#fbbf24","#f87171","#22d3ee","#a78bfa","#fb923c"][Math.floor(Math.random()*8)],size:6+Math.random()*8}));O(z)},ze=()=>{T(null),O([]),I(null)},ue=async J=>{mr();const z={starter:"https://buy.stripe.com/7sY9AS3LhdqJbQVa8iffy02",regular:"https://buy.stripe.com/eVq4gy1D94Ud2gl3JUffy03",pro:"https://buy.stripe.com/aFa9AS1D92M53kp4NYffy04",ultimate:"https://buy.stripe.com/cNieVc5TpfyRaMR4NYffy05"}[J.id];if(!z||z.includes("placeholder")){e.info("Le lien de paiement n'est pas encore configuré pour ce pack. (Voir .env)");return}localStorage.setItem("paymentType","buy_pack"),localStorage.setItem("pendingPackId",J.id),I(J),window.open(z,"_blank")},xe=async()=>{const J=E.trim().toUpperCase();if(J){if(!(r!=null&&r.id)){K({success:!1,message:"Vous devez être connecté."});return}ee(!0),K(null);try{const{data:Ie,error:z}=await D.from("promo_codes").select("*").eq("code",J).eq("active",!0).maybeSingle();if(z)throw z;if(!Ie){K({success:!1,message:"Code promo invalide ou expiré."});return}if(Ie.max_uses&&Ie.current_uses>=Ie.max_uses){K({success:!1,message:"Ce code promo a atteint son nombre maximum d'utilisations."});return}if(Ie.expires_at&&new Date(Ie.expires_at)<new Date){K({success:!1,message:"Ce code promo a expiré."});return}const{data:Y}=await D.from("promo_code_uses").select("id").eq("user_id",r.id).eq("promo_code_id",Ie.id).maybeSingle();if(Y){K({success:!1,message:"Vous avez déjà utilisé ce code promo."});return}const ce=Ie.meetips_reward||10,{data:ve}=await D.from("profiles").select("meetips_balance").eq("id",r.id).maybeSingle(),pe=((ve==null?void 0:ve.meetips_balance)||0)+ce;await D.from("profiles").update({meetips_balance:pe}).eq("id",r.id),await D.from("promo_codes").update({current_uses:(Ie.current_uses||0)+1}).eq("id",Ie.id),await D.from("promo_code_uses").insert({user_id:r.id,promo_code_id:Ie.id,code:Ie.code,meetips_awarded:ce}),p(pe),$(""),K({success:!0,message:`ð +${ce} Meetips crédités sur votre compte !`}),id(),i&&i()}catch(Ie){console.error("Promo code error:",Ie),K({success:!1,message:"Erreur lors de la vérification du code."})}finally{ee(!1)}}},ke=async()=>
2603{if(r!=null&&r.id)try{const{data:J}=await D.from("referral_invites").select("*").eq("referrer_id",r.id).order("created_at",{ascending:!1}).limit(20);M(J||[])}catch(J){console.warn("Could not load referral history:",J)}},Pe=async()=>{var z,Y;const J=ne.trim().toLowerCase();if(!J)return;if(!(r!=null&&r.id)){F({success:!1,message:"Vous devez être connecté."});return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(J)){F({success:!1,message:"Adresse email invalide."});return}if(J===r.email){F({success:!1,message:"Vous ne pouvez pas vous inviter vous-même ð"});return}G(!0),F(null);try{const{data:ce}=await D.from("referral_invites").select("id").eq("referrer_id",r.id).eq("invited_email",J).maybeSingle();if(ce){F({success:!1,message:"Vous avez déjà invité cette personne."});return}const ve=new Date;ve.setHours(0,0,0,0);const{count:pe}=await D.from("referral_invites").select("*",{count:"exact",head:!0}).eq("referrer_id",r.id).gte("created_at",ve.toISOString());if(pe>=10){F({success:!1,message:"Limite de 10 invitations par jour atteinte. Réessayez demain !"});return}const $e=r.referral_code||"",Xe=r.name||"Un membre MEETapps",tt=K7(Xe,$e);console.log("ð§ Sending referral invite to:",J);const gt=await ci({toEmail:J,subject:`${Xe} vous invite sur MEETapps ! ð`,html:tt});if(console.log("ð§ Email result:",gt),!gt.success){const at=((z=gt.error)==null?void 0:z.message)||((Y=gt.error)==null?void 0:Y.error)||JSON.stringify(gt.error)||"Erreur inconnue";console.error("ð§ Referral email failed:",at),F({success:!1,message:`Erreur d'envoi : ${at}`});return}await D.from("referral_invites").insert({referrer_id:r.id,invited_email:J,referral_code:$e,meetips_awarded:0,status:"sent"}),Re(""),F({success:!0,message:"ð Invitation envoyée ! Vous gagnerez 3 Meetips quand votre ami s'inscrit."}),id(),ke(),i&&i()}catch(ce){console.error("Referral invite error:",ce),F({success:!1,message:"Erreur lors de l'envoi."})}finally{G(!1)}},Ce={};Z.forEach(J=>{Ce[J.id]=h.filter(Ie=>Ie.gift_type===J.id)});const Me=n?"#ff4d4d":o?"#FF7043":"#8a2be2",Le=n?"linear-gradient(135deg, #ff4d4d, #ff6b6b)":o?"linear-gradient(135deg, #FF7043, #FF9800)":"linear-gradient(135deg, #8a2be2, #a855f7)",rt=h.filter(J=>J.sender).sort((J,Ie)=>!J.is_seen&&Ie.is_seen?-1:J.is_seen&&!Ie.is_seen?1:new Date(Ie.created_at)-new Date(J.created_at)),Fe=h.filter(J=>!J.is_seen).length,ft=h.length,[De,Be]=m.useState([]),re=(J,Ie)=>{const z=Date.now(),Y=Array.from({length:5}).map((ce,ve)=>({id:z+ve,x:J,y:Ie,delay:ve*.1,offsetX:(Math.random()-.5)*60,rotation:(Math.random()-.5)*30}));Be(ce=>[...ce,...Y]),setTimeout(()=>Be(ce=>ce.filter(ve=>ve.id<z)),1500)},He=async(J,Ie)=>{var ve;if(!J.sender)return;if(mr(),Ie){const pe=Ie.target.getBoundingClientRect();re(pe.left+pe.width/2,pe.top)}const Y=`Merci pour ton cadeau (${((ve=Z.find(pe=>pe.id===J.gift_type))==null?void 0:ve.name)||"cadeau"}) ! C'est très gentil. ð`,ce=await wi.sendMessage(r==null?void 0:r.id,J.sender_id,Y);ce.success?(he("Message de remerciement envoyé !","success"),J.is_seen||await wi.markGiftsAsSeen([J.id]),x(pe=>pe.map($e=>$e.id===J.id?{...$e,is_seen:!0,thankful:!0}:$e)),i&&i()):he("Erreur lors de l'envoi : "+ce.error,"error")},be=async J=>{J.is_seen||(await wi.markGiftsAsSeen([J.id]),i(),x(Ie=>Ie.map(z=>z.id===J.id?{...z,is_seen:!0}:z))),a(`/profile-view/${J.sender_id}`)},nt=n?"EROX":o?"FRIEND":"EROS";return t.jsxs(t.Fragment,{children:[t.jsx(tr,{children:V&&t.jsx(ye.div,{initial:{opacity:0}
2603,animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.7)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",zIndex:1e4,display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},children:t.jsxs(ye.div,{initial:{scale:.8,opacity:0,y:30},animate:{scale:1,opacity:1,y:0},exit:{scale:.9,opacity:0,y:20},transition:{type:"spring",damping:22,stiffness:300},onClick:J=>J.stopPropagation(),style:{maxWidth:"420px",width:"100%",background:"linear-gradient(160deg, rgba(30,25,55,0.97) 0%, rgba(20,18,40,0.98) 100%)",borderRadius:"28px",border:"1px solid rgba(255,215,0,0.25)",padding:l?"28px 22px":"36px 32px",boxShadow:"0 25px 80px rgba(0,0,0,0.6), 0 0 60px rgba(255,215,0,0.08), inset 0 1px 0 rgba(255,255,255,0.08)",position:"relative",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",top:"-40px",right:"-40px",width:"140px",height:"140px",borderRadius:"50%",background:"radial-gradient(circle, rgba(255,215,0,0.15), transparent 70%)",pointerEvents:"none"}}),t.jsx("div",{style:{position:"absolute",bottom:"-30px",left:"-30px",width:"100px",height:"100px",borderRadius:"50%",background:"radial-gradient(circle, rgba(168,85,247,0.1), transparent 70%)",pointerEvents:"none"}}),t.jsx("div",{style:{textAlign:"center",marginBottom:l?"14px":"20px"},children:t.jsx("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:l?"64px":"80px",height:l?"64px":"80px",borderRadius:"50%",background:"linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,165,0,0.1))",border:"2px solid rgba(255,215,0,0.3)",boxShadow:"0 0 30px rgba(255,215,0,0.15)",animation:"gm-float 3s ease-in-out infinite"},children:t.jsx(Jt,{size:l?32:40})})}),t.jsx("h2",{style:{fontFamily:"Outfit",fontSize:l?"1.25rem":"1.5rem",fontWeight:800,textAlign:"center",marginBottom:"6px",background:"linear-gradient(135deg, #FFD700, #FFA500)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:"Les MEETips"}),t.jsxs("p",{style:{textAlign:"center",color:"rgba(255,255,255,0.5)",fontSize:l?"0.78rem":"0.85rem",marginBottom:l?"14px":"20px",lineHeight:1.5},children:["Votre monnaie locale sur MEETApps â¨",t.jsx("br",{}),t.jsx("span",{style:{fontSize:"0.75rem"},children:"Elle vous sert notamment à :"})]}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:l?"8px":"12px",marginBottom:l?"14px":"24px"},children:[{emoji:"ð",text:"Offrir des cadeaux à vos prétendants"},{emoji:"ð",text:"Débloquer de nouveaux profils"},{emoji:"ð¸",text:"Animer vos photos de profil"},{emoji:"ð¤",text:"Payer des services de la communauté"}].map((J,Ie)=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:l?"10px":"14px",background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.06)",borderRadius:"12px",padding:l?"10px 12px":"12px 16px"},children:[t.jsx("span",{style:{fontSize:l?"1.1rem":"1.4rem",flexShrink:0},children:J.emoji}),t.jsx("span",{style:{fontSize:l?"0.8rem":"0.9rem",color:"rgba(255,255,255,0.85)",fontWeight:500},children:J.text})]},Ie))}),t.jsxs("div",{style:{background:"linear-gradient(135deg, rgba(34,197,94,0.08), rgba(16,185,129,0.04))",border:"1px solid rgba(34,197,94,0.15)",borderRadius:"12px",padding:l?"10px 12px":"12px 16px",marginBottom:l?"16px":"24px",display:"flex",alignItems:"flex-start",gap:"10px"},children:[t.jsx("span",{style:{fontSize:l?"1.1rem":"1.3rem",flexShrink:0},children:"ð°"}),t.jsxs("span",{style:{fontSize:l?"0.78rem":"0.85rem",color:"rgba(255,255,255,0.7)",lineHeight:1.5},children:["Vous pouvez aussi en ",t.jsx("strong",{style:{color:"#22c55e"},children:"gagner"})," en organisant des sorties et en proposant des services !"]})]}),t.jsxs("button",{onClick:N,style:{width:"100%",padding:l?"12px 20px":"15px 24px",borderRadius:"14px",border:"none",background:"linear-gradient(135deg, #FFD700, #FFA500)",color:"#1a1a2e",fontWeight:800,fontSize:l?"0.9rem":"1rem",fontFamily:"Outfit",cursor:"pointer",boxShadow:"0 4px 20px rgba(255,215,0,0.25)",transition:"all 0.2s",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:[t.jsx(Xt,{size:18})," C'est compris !"]})]})})}),t.jsxs("div",{className:"shop-page",style:{padding:l?"70px 14px 40px":"80px 20px 60px",minHeight:"100vh",background:"linear-gradient(180deg, #0d0b1a 0%, #12101f 30%, #0e1117 100%)",color:"white",fontFamily:"'Inter', 'Outfit', sans-serif",position:"relative",overflow:"hidden"},children:[t.jsx(g0,{}),t.jsx("div",{style:{position:"absolute",top:"5%",left:"10%",width:"400px",height:"400px",borderRadius:"50%",background:`radial-gradient(circle, ${Me}12, transparent 70%)`,pointerEvents:"none",filter:"blur(60px)"}}),t.jsx("div",{style:{position:"absolute",top:"40%",right:"5%",width:"350px",height:"350px",borderRadius:"50%",background:"radial-gradient(circle, rgba(236,72,153,0.08), transparent 70%)",pointerEvents:"none",filter:"blur(60px)"}}),t.jsx("div",{style:{position:"absolute",bottom:"10%",left:"30%",width:"300px",height:"300px",borderRadius:"50%",background:"radial-gradient(circle, rgba(6,182,212,0.06), transparent 70%)",pointerEvents:"none",filter:"blur(60px)"}}),t.jsxs("div",{style:{maxWidth:"1100px",margin:"0 auto"},children:[y&&t.jsxs("div",{style:{position:"fixed",top:"90px",left:"50%",transform:"translateX(-50%)",background:y.type==="error"?"linear-gradient(135deg, #ef4444, #dc2626)":Le,color:"white",padding:"14px 28px",borderRadius:"16px",boxShadow:"0 12px 40px rgba(0,0,0,0.5)",zIndex:1e3,fontWeight:"600",fontSize:"0.9rem",display:"flex",alignItems:"center",gap:"10px",animation:"slideDown 0.3s ease-out",backdropFilter:"blur(20px)"},children:[y.type==="success"?"ð":"â ï¸"," ",y.message]}),t.jsxs("div",{style:{textAlign:"center",marginBottom:l?"28px":"48px",position:"relative",zIndex:1},children:[t.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"10px",background:`linear-gradient(135deg, ${Me}20, rgba(236,72,153,0.12))`,border:`1px solid ${Me}30`,borderRadius:"50px",padding:l?"6px 16px":"8px 20px",marginBottom:"12px",fontSize:l?"0.72rem":"0.8rem",color:Me,fontWeight:"600",boxShadow:`0 0 20px ${Me}15`},children:[t.jsx(Li,{size:14})," ⨠Espace ",nt]}),t.jsx("h1",{style:{fontFamily:"Outfit",fontSize:l?"2rem":"2.8rem",fontWeight:"800",margin:"0 0 10px 0",background:`linear-gradient(135deg, #ffffff 20%, ${Me}
2603 50%, #ec4899 80%, #f97316)`,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",letterSpacing:"-0.5px"},children:"Mes Cadeaux ð"}),t.jsx("p",{style:{color:"rgba(255,255,255,0.55)",fontSize:l?"0.85rem":"1rem",maxWidth:"500px",margin:"0 auto",lineHeight:1.6,padding:l?"0 8px":0},children:"Découvrez qui vous a offert un cadeau et rechargez vos Meetips pour faire plaisir."})]}),t.jsxs("div",{style:{background:`linear-gradient(135deg, ${Me}18, rgba(236,72,153,0.08), rgba(6,182,212,0.06))`,border:`1px solid ${Me}28`,borderRadius:l?"16px":"20px",padding:l?"18px 16px":"24px 32px",marginBottom:l?"28px":"40px",display:"flex",alignItems:l?"flex-start":"center",justifyContent:"space-between",flexDirection:l?"column":"row",gap:l?"14px":"16px",position:"relative",zIndex:1,boxShadow:`0 0 40px ${Me}08`},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"14px"},children:[t.jsx("div",{style:{width:l?"46px":"56px",height:l?"46px":"56px",borderRadius:"14px",background:`linear-gradient(135deg, ${Me}, #ec4899)`,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:`0 4px 24px ${Me}50`,animation:"pulse 3s infinite"},children:t.jsx(oi,{size:l?22:26,color:"white"})}),t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.55)",textTransform:"uppercase",letterSpacing:"0.5px",fontWeight:"600"},children:"â¡ Votre Solde"}),t.jsxs("div",{style:{fontSize:l?"1.7rem":"2.2rem",fontWeight:"800",fontFamily:"Outfit",background:"linear-gradient(90deg, #ffffff, #e0e7ff)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:[d," ",t.jsx("span",{style:{fontSize:l?"0.9rem":"1.1rem",fontWeight:"500"},children:"Meetips"})]})]})]}),t.jsxs("div",{style:{display:"flex",gap:"10px",width:l?"100%":"auto"},children:[t.jsxs("button",{onClick:()=>{var J;return(J=document.getElementById("packs-section"))==null?void 0:J.scrollIntoView({behavior:"smooth"})},style:{background:`linear-gradient(135deg, ${Me}, #ec4899)`,border:"none",color:"white",padding:l?"12px 0":"14px 28px",borderRadius:"14px",fontWeight:"700",fontSize:"0.9rem",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.25s",boxShadow:`0 4px 20px ${Me}40`,letterSpacing:"0.3px",flex:l?1:"none"},onMouseEnter:J=>{J.currentTarget.style.transform="scale(1.03)"},onMouseLeave:J=>{J.currentTarget.style.transform="scale(1)"},children:[t.jsx(Vs,{size:18})," ð³ Recharger"]}),t.jsxs("button",{onClick:()=>{var J;return(J=document.getElementById("promo-section"))==null?void 0:J.scrollIntoView({behavior:"smooth"})},style:{background:"linear-gradient(135deg, rgba(255,215,0,0.15), rgba(245,158,11,0.1))",border:"1px solid rgba(255,215,0,0.3)",color:"#FFD700",padding:l?"12px 0":"14px 28px",borderRadius:"14px",fontWeight:"700",fontSize:"0.9rem",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.25s",letterSpacing:"0.3px",flex:l?1:"none"},onMouseEnter:J=>{J.currentTarget.style.transform="scale(1.03)"},onMouseLeave:J=>{J.currentTarget.style.transform="scale(1)"},children:[t.jsx(Li,{size:18})," ð Code Promo"]}),t.jsxs("button",{onClick:()=>{var J;return(J=document.getElementById("referral-section"))==null?void 0:J.scrollIntoView({behavior:"smooth"})},style:{background:"linear-gradient(135deg, rgba(34,197,94,0.15), rgba(16,185,129,0.1))",border:"1px solid rgba(34,197,94,0.3)",color:"#22c55e",padding:l?"12px 0":"14px 28px",borderRadius:"14px",fontWeight:"700",fontSize:"0.9rem",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.25s",letterSpacing:"0.3px",flex:l?1:"none"},onMouseEnter:J=>{J.currentTarget.style.transform="scale(1.03)"},onMouseLeave:J=>{J.currentTarget.style.transform="scale(1)"},children:[t.jsx(Ut,{size:18})," ð¥ Parrainer"]})]})]}),t.jsxs("div",{style:{marginBottom:"56px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"24px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[t.jsx("div",{style:{width:"4px",height:"28px",borderRadius:"4px",background:Le}}),t.jsx("h2",{style:{margin:0,fontFamily:"Outfit",fontSize:"1.4rem",fontWeight:"700"},children:"Cadeaux Reçus"}),Fe>0&&t.jsxs("div",{style:{background:Le,color:"white",padding:"4px 12px",borderRadius:"20px",fontSize:"0.75rem",fontWeight:"700",animation:"pulse 2s infinite"},children:[Fe," nouveau",Fe>1?"x":""]})]}),t.jsxs("div",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.35)"}
2603,children:[ft," cadeau",ft!==1?"x":""," au total"]})]}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:l?"repeat(3, 1fr)":"repeat(auto-fit, minmax(140px, 1fr))",gap:l?"10px":"14px",marginBottom:"24px",position:"relative",zIndex:1},children:Z.map((J,Ie)=>{var pe,$e;const z=((pe=Ce[J.id])==null?void 0:pe.length)||0,Y=(($e=Ce[J.id])==null?void 0:$e.filter(Xe=>!Xe.is_seen).length)||0,ce=S===J.id,ve=pF[J.id]||Me;return t.jsxs("div",{onClick:()=>z>0&&k(ce?null:J.id),style:{background:ce?`linear-gradient(160deg, ${ve}20, ${ve}08)`:"linear-gradient(160deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01))",border:`1px solid ${ce?`${ve}50`:"rgba(255,255,255,0.08)"}`,borderRadius:"18px",padding:l?"14px 8px":"20px 16px",cursor:z>0?"pointer":"default",opacity:z>0?1:.35,transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",position:"relative",textAlign:"center",boxShadow:ce?`0 0 20px ${ve}15`:"none"},onMouseEnter:Xe=>z>0&&(Xe.currentTarget.style.transform="translateY(-4px) scale(1.02)",Xe.currentTarget.style.boxShadow=`0 10px 28px ${ve}20`,Xe.currentTarget.style.borderColor=`${ve}40`),onMouseLeave:Xe=>z>0&&(Xe.currentTarget.style.transform="translateY(0) scale(1)",Xe.currentTarget.style.boxShadow=ce?`0 0 20px ${ve}15`:"none",Xe.currentTarget.style.borderColor=ce?`${ve}50`:"rgba(255,255,255,0.08)"),children:[Y>0&&t.jsxs("div",{style:{position:"absolute",top:"-8px",right:"-4px",background:`linear-gradient(135deg, ${ve}, ${ve}cc)`,color:"white",fontSize:"0.62rem",fontWeight:"800",padding:"3px 10px",borderRadius:"12px",boxShadow:`0 2px 10px ${ve}60`,animation:"pulse 2s infinite",letterSpacing:"0.3px"},children:["ð ",Y]}),t.jsx("div",{style:{marginBottom:"6px",display:"flex",justifyContent:"center",filter:z>0?"none":"grayscale(1)"},children:t.jsx(kp,{gift:J,giftIdx:Ie,size:l?42:56})}),t.jsx("div",{style:{fontSize:l?"1.3rem":"1.7rem",fontWeight:"800",fontFamily:"Outfit",color:z>0?ve:"rgba(255,255,255,0.2)"},children:z}),t.jsx("div",{style:{fontSize:"0.73rem",color:z>0?"rgba(255,255,255,0.55)":"rgba(255,255,255,0.25)",marginTop:"3px",fontWeight:"500"},children:J.name})]},J.id)})}),(()=>{var Y;const J=S?Ce[S]||[]:rt,Ie=w?J:J.slice(0,6),z=S?(Y=Z.find(ce=>ce.id===S))==null?void 0:Y.name:null;return J.length===0&&!S?t.jsxs("div",{style:{textAlign:"center",padding:"56px 24px",background:"linear-gradient(160deg, rgba(255,255,255,0.03), rgba(236,72,153,0.03))",borderRadius:"24px",border:"1px solid rgba(255,255,255,0.06)",position:"relative",zIndex:1},children:[t.jsx("div",{style:{fontSize:"3.5rem",marginBottom:"16px"},children:"ð"}),t.jsx("div",{style:{fontSize:"1.15rem",fontWeight:"600",color:"rgba(255,255,255,0.55)",marginBottom:"8px"},children:"Pas encore de cadeaux reçus"}),t.jsx("div",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.35)"},children:"Les cadeaux de vos matchs apparaîtront ici â¨"})]}):t.jsxs("div",{style:{background:"rgba(255,255,255,0.02)",borderRadius:"20px",border:"1px solid rgba(255,255,255,0.06)",overflow:"hidden"},children:[t.jsxs("div",{style:{padding:"18px 24px",borderBottom:"1px solid rgba(255,255,255,0.06)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(Bt,{size:18,color:Me}),t.jsx("span",{style:{fontWeight:"600",fontSize:"0.95rem"},children:z?`Qui vous a offert : ${z}`:"Tous vos admirateurs"})]}),S&&t.jsxs("button",{onClick:()=>k(null),style:{background:"rgba(255,255,255,0.06)",border:"none",color:"rgba(255,255,255,0.5)",padding:"6px 14px",borderRadius:"8px",cursor:"pointer",fontSize:"0.8rem",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(mt,{size:14})," Voir tout"]})]}),t.jsxs("div",{style:{padding:"16px"},children:[t.jsx("div",{style:{display:"grid",gridTemplateColumns:l?"1fr":"repeat(auto-fill, minmax(320px, 1fr))",gap:"10px"},children:Ie.map(ce=>{var $e,Xe,tt,gt,at;const ve=Z.find(Pt=>Pt.id===ce.gift_type),pe=!ce.is_seen;return t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"14px",padding:"14px 16px",borderRadius:"14px",background:pe?`linear-gradient(135deg, ${Me}12, ${Me}06)`:"rgba(255,255,255,0.02)",border:pe?`1.5px solid ${Me}35`:"1px solid rgba(255,255,255,0.04)",transition:"all 0.2s",position:"relative"},onMouseEnter:Pt=>Pt.currentTarget.style.background=pe?`${Me}18`:"rgba(255,255,255,0.04)",onMouseLeave:Pt=>Pt.currentTarget.style.background=pe?`${Me}0c`:"rgba(255,255,255,0.02)",children:[pe&&t.jsx("div",{style:{position:"absolute",top:"-6px",right:"12px",background:Le,color:"white",fontSize:"0.6rem",fontWeight:"800",padding:"2px 10px",borderRadius:"8px",letterSpacing:"0.5px",boxShadow:`0 2px 8px ${Me}50`,animation:"pulse 2s infinite"},children:"⨠NOUVEAU"}),t.jsxs("div",{style:{position:"relative",flexShrink:0},onClick:()=>be(ce),children:[t.jsx(Mo,{photoUrl:(n?($e=ce.sender)==null?void 0:$e.erox_avatar_url:(Xe=ce.sender)==null?void 0:Xe.avatar_url)||null,animatedUrl:(tt=ce.sender)==null?void 0:tt.animated_photo_url,alt:"User",size:48,borderColor:pe?Me:"rgba(255,255,255,0.08)",borderWidth:2,style:{borderRadius:"14px",cursor:"pointer"}}),t.jsx("div",{style:{position:"absolute",bottom:"-4px",right:"-4px",fontSize:"1.1rem",lineHeight:1,background:"#0a0a12",borderRadius:"50%",padding:"2px"},children:(ve==null?void 0:ve.icon)||"ð"})]}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsx("div",{style:{fontWeight:"600",fontSize:"0.9rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:pe?"white":"rgba(255,255,255,0.7)"},children:((gt=ce.sender)==null?void 0:gt.name)||t.jsx("span",{style:{fontStyle:"italic",opacity:.4},children:"Profil inaccessible"})}),t.jsxs("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.3)",marginTop:"2px",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx("span",{children:(ve==null?void 0:ve.name)||"Cadeau"}),t.jsx("span",{children:"â¢"}),t.jsx("span",{children:new Date(ce.created_at).toLocaleDateString("fr-FR",{day:"numeric",month:"short"})})]})]}),t.jsxs("div",{style:{display:"flex",gap:"6px",flexShrink:0},children:[((at=ce.sender)==null?void 0:at.name)&&t.jsx("button",{onClick:Pt=>{Pt.stopPropagation(),He(ce,Pt)},disabled:ce.thankful,title:"Remercier",style:{background:ce.thankful?"rgba(34,197,94,0.15)":"rgba(34,197,94,0.12)",border:ce.thankful?"1px solid rgba(34,197,94,0.3)":"1px solid rgba(34,197,94,0.15)",color:(ce.thankful,"#22c55e"),padding:"8px 14px",borderRadius:"10px",cursor:ce.thankful?"default":"pointer",fontSize:"0.75rem",fontWeight:"600",display:"flex",alignItems:"center",gap:"4px",transition:"all 0.2s",opacity:ce.thankful?.6:1},children:ce.thankful?t.jsxs(t.Fragment,{children:[t.jsx(pr,{size:14})," Merci"]}):t.jsxs(t.Fragment,{children:[t.jsx(Qt,{size:14})," Merci"]})}),t.jsxs("button",{onClick:()=>be(ce),style:{background:`${Me}15`,border:`1px solid ${Me}25`,color:Me,padding:"8px 14px",borderRadius:"10px",cursor:"pointer",fontSize:"0.75rem",fontWeight:"600",display:"flex",alignItems:"center",gap:"4px",transition:"all 0.2s"},children:[t.jsx(rr,{size:14})," Voir"]})]})]},ce.id)})}),J.length>6&&t.jsx("div",{style:{textAlign:"center",paddingTop:"16px"},children:t.jsx("button",{onClick:()=>b(!w),style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.5)",padding:"10px 24px",borderRadius:"12px",cursor:"pointer",fontSize:"0.85rem",fontWeight:"500",transition:"all 0.2s"},children:w?"Voir moins":`Voir les ${J.length-6} autres`})})]})]})})()]}),t.jsxs("div",{id:"promo-section",style:{marginBottom:l?"28px":"40px",padding:l?"20px 16px":"24px 28px",borderRadius:"18px",background:"linear-gradient(135deg, rgba(255,215,0,0.06), rgba(245,158,11,0.04))",border:"1px solid rgba(255,215,0,0.15)",position:"relative",zIndex:1},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"14px"},children:[t.jsx(Li,{size:20,color:"#FFD700"}),t.jsx("span",{style:{fontWeight:"700",fontSize:"1rem",fontFamily:"Outfit",color:"white"},children:"Code Promo"})]}),t.jsx("p",{style:{color:"rgba(255,255,255,0.45)",fontSize:"0.85rem",margin:"0 0 16px",lineHeight:1.5},children:"Vous avez un code promo ? Entrez-le ici pour recevoir des Meetips gratuits !"}),t.jsxs("div",{style:{display:"flex",gap:"10px",flexDirection:l?"column":"row"},children:[t.jsx("input",{type:"text",placeholder:"Ex: MEETLYON2026",value:E,onChange:J=>$(J.target.value.toUpperCase()),onKeyDown:J=>J.key==="Enter"&&xe(),style:{flex:1,padding:"14px 18px",borderRadius:"12px",border:"1px solid rgba(255,215,0,0.2)",background:"rgba(0,0,0,0.3)",color:"white",fontSize:"0.95rem",fontFamily:"Outfit",fontWeight:"600",letterSpacing:"1px",outline:"none",textTransform:"uppercase"}}),t.jsx("button",{onClick:xe,disabled:B||!E.trim(),style:{padding:"14px 24px",borderRadius:"12px",border:"none",background:B||!E.trim()?"rgba(255,255,255,0.08)":"linear-gradient(135deg, #FFD700, #FFA500)",color:B||!E.trim()?"rgba(255,255,255,0.3)":"#1a1a2e",fontWeight:"700",fontSize:"0.9rem",fontFamily:"Outfit",curs
2603or:B||!E.trim()?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s",minWidth:"140px"},children:B?t.jsxs(t.Fragment,{children:[t.jsx("span",{style:{animation:"pulse 1s infinite"},children:"â³"})," Vérification..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Xt,{size:16})," Valider"]})})]}),te&&t.jsxs("div",{style:{marginTop:"12px",padding:"12px 16px",borderRadius:"12px",background:te.success?"rgba(34,197,94,0.1)":"rgba(239,68,68,0.1)",border:`1px solid ${te.success?"rgba(34,197,94,0.25)":"rgba(239,68,68,0.25)"}`,color:te.success?"#22c55e":"#ef4444",fontSize:"0.9rem",fontWeight:"600",display:"flex",alignItems:"center",gap:"8px"},children:[te.success?t.jsx(pr,{size:18}):t.jsx(mt,{size:18}),te.message]})]}),t.jsxs("div",{id:"referral-section",style:{marginBottom:l?"28px":"40px",padding:l?"20px 16px":"24px 28px",borderRadius:"18px",background:"linear-gradient(135deg, rgba(34,197,94,0.06), rgba(16,185,129,0.04))",border:"1px solid rgba(34,197,94,0.15)",position:"relative",zIndex:1},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"6px"},children:[t.jsx(Ut,{size:20,color:"#22c55e"}),t.jsx("span",{style:{fontWeight:"700",fontSize:"1rem",fontFamily:"Outfit",color:"white"},children:"Parrainer un ami"}),A.filter(J=>J.status==="converted").length>0&&t.jsxs("span",{style:{background:"rgba(34,197,94,0.15)",border:"1px solid rgba(34,197,94,0.25)",borderRadius:"20px",padding:"2px 10px",fontSize:"0.72rem",fontWeight:"700",color:"#22c55e"},children:["+",A.filter(J=>J.status==="converted").length*3," Meetips gagnés"]})]}),t.jsxs("p",{style:{color:"rgba(255,255,255,0.45)",fontSize:"0.85rem",margin:"0 0 16px",lineHeight:1.5},children:["Invitez un ami par email et gagnez ",t.jsx("strong",{style:{color:"#22c55e"},children:"3 Meetips"})," quand il s'inscrit !"]}),t.jsxs("div",{style:{display:"flex",gap:"10px",flexDirection:l?"column":"row"},children:[t.jsx("input",{type:"email",placeholder:"[email protected]",value:ne,onChange:J=>Re(J.target.value),onKeyDown:J=>J.key==="Enter"&&Pe(),style:{flex:1,padding:"14px 18px",borderRadius:"12px",border:"1px solid rgba(34,197,94,0.2)",background:"rgba(0,0,0,0.3)",color:"white",fontSize:"0.95rem",fontFamily:"Outfit",fontWeight:"500",outline:"none"}}),t.jsx("button",{onClick:Pe,disabled:Q||!ne.trim(),style:{padding:"14px 24px",borderRadius:"12px",border:"none",background:Q||!ne.trim()?"rgba(255,255,255,0.08)":"linear-gradient(135deg, #22c55e, #16a34a)",color:Q||!ne.trim()?"rgba(255,255,255,0.3)":"white",fontWeight:"700",fontSize:"0.9rem",fontFamily:"Outfit",cursor:Q||!ne.trim()?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s",minWidth:"150px",boxShadow:Q||!ne.trim()?"none":"0 4px 16px rgba(34,197,94,0.3)"},children:Q?t.jsxs(t.Fragment,{children:[t.jsx("span",{style:{animation:"pulse 1s infinite"},children:"â³"})," Envoi..."]}):t.jsxs(t.Fragment,{children:[t.jsx(ji,{size:16})," Inviter"]})})]}),le&&t.jsxs("div",{style:{marginTop:"12px",padding:"12px 16px",borderRadius:"12px",background:le.success?"rgba(34,197,94,0.1)":"rgba(239,68,68,0.1)",border:`1px solid ${le.success?"rgba(34,197,94,0.25)":"rgba(239,68,68,0.25)"}`,color:le.success?"#22c55e":"#ef4444",fontSize:"0.9rem",fontWeight:"600",display:"flex",alignItems:"center",gap:"8px"},children:[le.success?t.jsx(pr,{size:18}):t.jsx(mt,{size:18}),le.message]}),A.length>0&&t.jsxs("div",{style:{marginTop:"16px",borderTop:"1px solid rgba(34,197,94,0.1)",paddingTop:"14px"},children:[t.jsxs("div",{style:{fontSize:"0.78rem",color:"rgba(255,255,255,0.4)",fontWeight:"600",marginBottom:"10px",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(Pn,{size:13})," ",A.length," invitation",A.length>1?"s":""," envoyée",A.length>1?"s":""]}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:[A.slice(0,8).map((J,Ie)=>t.jsxs("div",{style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.06)",borderRadius:"10px",padding:"8px 14px",fontSize:"0.78rem",color:"rgba(255,255,255,0.5)",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(pr,{size:12,color:"#22c55e"}),J.invited_email]},J.id||Ie)),A.length>8&&t.jsxs("div",{style:{background:"rgba(255,255,255,0.04)",borderRadius:"10px",padding:"8px 14px",fontSize:"0.78rem",color:"rgba(255,255,255,0.35)"},children:["+",A.length-8," autres"]})]})]})]}),t.jsxs("div",{id:"packs-section",style:{marginBottom:"40px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"12px"},children:[t.jsx("div",{style:{width:"4px",height:"28px",borderRadius:"4px",background:Le}}),t.jsx("h2",{style:{margin:0,fontFamily:"Outfit",fontSize:"1.4rem",fontWeight:"700"},children:"Recharger en Meetips"})]}),t.jsx("p",{style:{color:"rgba(255,255,255,0.35)",fontSize:"0.9rem",marginBottom:"28px",paddingLeft:"16px"},children:"Offrez des cadeaux à vos matchs pour montrer votre intérêt. Paiement sécurisé par Stripe."}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:l?"repeat(2, 1fr)":"repeat(auto-fit, minmax(240px, 1fr))",gap:l?"10px":"16px",position:"relative",zIndex:1},children:cF.map((J,Ie)=>t.jsxs("div",{onClick:()=>ue(J),style:{background:`linear-gradient(160deg, ${J.accent}10, ${J.accent}04, rgba(255,255,255,0.02))`,border:`1px solid ${J.accent}22`,borderRadius:"22px",padding:l?"18px 14px":"28px 24px",position:"relative",curs
2603or:"pointer",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",overflow:"hidden"},onMouseEnter:z=>{z.currentTarget.style.transform="translateY(-6px) scale(1.02)",z.currentTarget.style.boxShadow=`0 16px 40px ${J.accent}20`,z.currentTarget.style.borderColor=`${J.accent}40`},onMouseLeave:z=>{z.currentTarget.style.transform="translateY(0) scale(1)",z.currentTarget.style.boxShadow="none",z.currentTarget.style.borderColor=`${J.accent}22`},children:[J.popular&&t.jsx("div",{style:{position:"absolute",top:"14px",right:"14px",background:J.gradient,color:"white",fontSize:"0.65rem",fontWeight:"700",padding:"5px 12px",borderRadius:"10px",letterSpacing:"0.5px",boxShadow:`0 2px 10px ${J.accent}40`},children:"â POPULAIRE"}),J.best&&t.jsx("div",{style:{position:"absolute",top:"14px",right:"14px",background:J.gradient,color:"white",fontSize:"0.65rem",fontWeight:"700",padding:"5px 12px",borderRadius:"10px",letterSpacing:"0.5px",boxShadow:`0 2px 10px ${J.accent}40`},children:"ð MEILLEUR PRIX"}),t.jsx("div",{style:{fontSize:"2rem",marginBottom:"8px"},children:J.emoji}),t.jsx("div",{style:{fontSize:"1rem",fontWeight:"600",color:"rgba(255,255,255,0.75)",marginBottom:"16px"},children:J.name}),t.jsx("div",{style:{fontSize:"2.8rem",fontWeight:"800",fontFamily:"Outfit",color:J.accent,lineHeight:1,marginBottom:"4px",textShadow:`0 0 30px ${J.accent}30`},children:J.amount}),t.jsxs("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.45)",marginBottom:"20px"},children:["Meetips ",J.bonus&&t.jsxs("span",{style:{color:J.accent,fontWeight:"700"},children:["(",J.bonus,")"]})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",background:`${J.accent}08`,borderRadius:"14px",border:`1px solid ${J.accent}15`},children:[t.jsxs("div",{children:[t.jsxs("div",{style:{fontSize:"1.5rem",fontWeight:"800",fontFamily:"Outfit",color:"white"},children:[J.cost,"â¬"]}),t.jsxs("div",{style:{fontSize:"0.68rem",color:"rgba(255,255,255,0.4)"},children:[(J.cost/J.amount*100).toFixed(1)," centimes/meetip"]})]}),t.jsx("div",{style:{background:J.gradient,width:"42px",height:"42px",borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:`0 4px 16px ${J.accent}40`},children:t.jsx(Pr,{size:20,color:"white"})})]})]},J.id))}),t.jsxs("div",{style:{marginTop:"24px",padding:"18px 28px",borderRadius:"16px",background:"linear-gradient(135deg, rgba(99,91,255,0.08), rgba(6,182,212,0.05))",border:"1px solid rgba(99,91,255,0.15)",display:"flex",alignItems:"center",gap:"14px",justifyContent:"center"},children:[t.jsx(Vs,{size:20,color:"#818cf8"}),t.jsxs("span",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.5)"},children:["ð Paiement sécurisé par ",t.jsx("strong",{style:{color:"#818cf8"},children:"Stripe"})," â Vos données bancaires ne sont jamais stockées"]})]})]})]}),j&&(()=>{const J=j.pack,Ie=(J==null?void 0:J.accent)||Me,z=(J==null?void 0:J.gradient)||Le;return t.jsxs("div",{style:{position:"fixed",inset:0,zIndex:1e4,display:"flex",alignItems:"center",justifyContent:"center",animation:"liquidGlassIn 0.5s cubic-bezier(0.16, 1, 0.3, 1)"},children:[t.jsx("div",{onClick:ze,style:{position:"absolute",inset:0,background:"radial-gradient(ellipse at center, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.85) 100%)",backdropFilter:"blur(24px) saturate(1.4)",WebkitBackdropFilter:"blur(24px) saturate(1.4)"}}),R.map(Y=>t.jsx("div",{style:{position:"absolute",top:"-10px",left:`${Y.x}%`,width:`${Y.size}px`,height:`${Y.size}px`,borderRadius:Y.id%3===0?"50%":"2px",background:Y.color,animation:`confettiFall ${Y.duration}s ease-in forwards`,animationDelay:`${Y.delay}s`,pointerEvents:"none",zIndex:10001,opacity:0,transform:`rotate(${Y.rotation}deg)`}},Y.id)),t.jsxs("div",{style:{position:"relative",zIndex:2,width:l?"92%":"440px",borderRadius:l?"24px":"32px",overflow:"hidden",background:"linear-gradient(160deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 40%, rgba(255,255,255,0.04) 100%)",border:"1px solid rgba(255,255,255,0.12)",boxShadow:` 2604 0 0 0 1px rgba(255,255,255,0.05), 2605 0 8px 40px rgba(0,0,0,0.5), 2606 0 0 80px ${Ie}15, 2607 inset 0 1px 0 rgba(255,255,255,0.1), 2608 inset 0 -1px 0 rgba(0,0,0,0.2) 2609 `,backdropFilter:"blur(40px) saturate(1.5)",WebkitBackdropFilter:"blur(40px) saturate(1.5)",animation:"liquidCardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1)"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:"5%",right:"5%",height:"1px",background:`linear-gradient(90deg, transparent, rgba(255,255,255,0.3), ${Ie}40, rgba(255,255,255,0.3), transparent)`}}),t.jsxs("div",{style:{padding:l?"40px 24px 32px":"52px 44px 40px",textAlign:"center"},children:[t.jsxs("div",{style:{width:"110px",height:"110px",borderRadius:"50%",margin:"0 auto 28px",background:"radial-gradient(circle, rgba(34,197,94,0.2) 0%, rgba(34,197,94,0.05) 60%, transparent 100%)",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",animation:"successPop 0.6s cubic-bezier(0.16, 1, 0.3, 1)",boxShadow:"0 0 60px rgba(34,197,94,0.2)"},children:[t.jsx("div",{style:{width:"80px",height:"80px",borderRadius:"50%",background:"linear-gradient(135deg, #22c55e, #10b981)",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 24px rgba(34,197,94,0.4)",animation:"pulse 2s ease-in-out infinite"},children:t.jsx("span",{style:{fontSize:"2.5rem"},children:"â"})}),t.jsx("div",{style:{position:"absolute",inset:"-6px",borderRadius:"50%",border:"2px s
2609olid rgba(34,197,94,0.3)",animation:"successRing 1.5s ease-out forwards"}})]}),t.jsx("div",{style:{fontSize:"2rem",marginBottom:"12px"},children:(J==null?void 0:J.emoji)||"â¨"}),t.jsx("h2",{style:{fontFamily:"Outfit",fontWeight:"800",fontSize:"1.5rem",color:"white",marginBottom:"8px",background:`linear-gradient(135deg, #22c55e, ${Ie})`,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text"},children:"Paiement confirmé !"}),t.jsx("p",{style:{color:"rgba(255,255,255,0.5)",fontSize:"0.9rem",marginBottom:"28px",lineHeight:1.5},children:"Votre compte a été rechargé avec succès"}),t.jsxs("div",{style:{background:"linear-gradient(135deg, rgba(34,197,94,0.12), rgba(34,197,94,0.04))",borderRadius:"20px",padding:"20px 28px",marginBottom:"20px",border:"1px solid rgba(34,197,94,0.2)",boxShadow:"0 0 30px rgba(34,197,94,0.08)"},children:[t.jsx("div",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.45)",marginBottom:"6px",fontWeight:"500",textTransform:"uppercase",letterSpacing:"1px"},children:"Nouveau solde"}),t.jsxs("div",{style:{fontFamily:"Outfit",fontWeight:"800",fontSize:"2.2rem",color:"#22c55e",animation:"countUp 0.8s ease-out"},children:[j.newBalance," ",t.jsx("span",{style:{fontSize:"1rem",color:"rgba(255,255,255,0.4)"},children:"Meetips"})]})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.03)",borderRadius:"14px",padding:"14px 20px",marginBottom:"28px",border:"1px solid rgba(255,255,255,0.06)",display:"flex",alignItems:"center",justifyContent:"center",gap:"12px"},children:[t.jsx("span",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.4)"},children:J==null?void 0:J.name}),t.jsx("span",{style:{color:"rgba(255,255,255,0.15)"},children:"â¢"}),t.jsxs("span",{style:{color:Ie,fontWeight:"700",fontSize:"0.85rem"},children:["+",J==null?void 0:J.amount," Meetips"]}),t.jsx("span",{style:{color:"rgba(255,255,255,0.15)"},children:"â¢"}),t.jsxs("span",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.4)"},children:[J==null?void 0:J.cost,"â¬"]})]}),t.jsx("button",{onClick:ze,style:{width:"100%",padding:"16px 24px",borderRadius:"16px",border:"none",background:z,color:"white",fontFamily:"Outfit",fontWeight:"700",fontSize:"1rem",cursor:"pointer",transition:"all 0.3s",boxShadow:`0 4px 20px ${Ie}40`,display:"flex",alignItems:"center",justifyContent:"center",gap:"10px"},onMouseEnter:Y=>{Y.currentTarget.style.transform="translateY(-2px)",Y.currentTarget.style.boxShadow=`0 8px 30px ${Ie}50`},onMouseLeave:Y=>{Y.currentTarget.style.transform="translateY(0)",Y.currentTarget.style.boxShadow=`0 4px 20px ${Ie}40`},children:"ð C'est parti !"})]})]})]})})(),t.jsx("div",{style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:9999,overflow:"hidden"},children:De.map(J=>t.jsx("div",{style:{position:"absolute",left:J.x,top:J.y,fontSize:"24px",color:"#ff4d4d",transform:`translate(-50%, -50%) rotate(${J.rotation}deg)`,animation:"floatUp 1s ease-out forwards",animationDelay:`${J.delay}s`,"--offset-x":`${J.offsetX}px`},children:"â¤ï¸"},J.id))}),t.jsx("style",{children:` 2610 @keyframes floatUp { 2611 0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; margin-top: 0; margin-left: 0; } 2612 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); } 2613 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); margin-top: -150px; margin-left: var(--offset-x); } 2614 } 2615 @keyframes slideDown { 2616 from { opacity: 0; transform: translateX(-50%) translateY(-20px); } 2617 to { opacity: 1; transform: translateX(-50%) translateY(0); } 2618 } 2619 @keyframes pulse { 2620 0%, 100% { opacity: 1; } 2621 50% { opacity: 0.7; } 2622 } 2623 @keyframes fadeIn { 2624 from { opacity: 0; } 2625 to { opacity: 1; } 2626 } 2627 @keyframes liquidGlassIn { 2628 from { opacity: 0; } 2629 to { opacity: 1; } 2630 } 2631 @keyframes liquidCardIn { 2632 from { opacity: 0; transform: scale(0.92) translateY(20px); } 2633 to { opacity: 1; transform: scale(1) translateY(0); } 2634 } 2635 @keyframes shimmer { 2636 0% { background-position: -200% 0; } 2637 100% { background-position: 200% 0; } 2638 } 2639 @keyframes orbFloat1 { 2640 0%, 100% { transform: translate(0, 0) scale(1); } 2641 50% { transform: translate(20px, -30px) scale(1.1); } 2642 } 2643 @keyframes orbFloat2 { 2644 0%, 100% { transform: translate(0, 0) scale(1); } 2645 50% { transform: translate(-25px, 20px) scale(1.15); } 2646 } 2647 @keyframes spinRing { 2648 from { transform: rotate(0deg); } 2649 to { transform: rotate(360deg); } 2650 } 2651 @keyframes dotPulse { 2652 0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); } 2653 40% { opacity: 1; transform: scale(1.2); } 2654 } 2655 @keyframes confettiFall { 2656 0% { opacity: 1; transform: translateY(0) rotate(0deg); } 2657 100% { opacity: 0; transform: translateY(100vh) rotate(720deg); } 2658 } 2659 @keyframes successPop { 2660 0% { transform: scale(0); opacity: 0; } 2661 60% { transform: scale(1.15); } 2662 100% { transform: scale(1); opacity: 1; } 2663 } 2664 @keyframes successRing { 2665 0% { transform: scale(0.8); opacity: 1; } 2666 100% { transform: scale(1.4);
2666 opacity: 0; } 2667 } 2668 @keyframes countUp { 2669 0% { opacity: 0; transform: translateY(10px); } 2670 100% { opacity: 1; transform: translateY(0); } 2671 } 2672 @keyframes gm-float { 2673 0%, 100% { transform: translateY(0); } 2674 50% { transform: translateY(-8px); } 2675 } 2676 `})]})]})},Qd=13,y1={EROS:{primary:"#D4C4A8",gradient:"linear-gradient(135deg, #D4C4A8, #C5A065)",accent:"#C5A065",glow:"rgba(212,196,168,0.3)",bg:"#050507"},FRIEND:{primary:"#26A69A",gradient:"linear-gradient(135deg, #26A69A, #80CBC4)",accent:"#80CBC4",glow:"rgba(38,166,154,0.3)",bg:"#050507"},EROX:{primary:"#ff3333",gradient:"linear-gradient(135deg, #ff3333, #ff6666)",accent:"#ff6666",glow:"rgba(255,51,51,0.3)",bg:"#050507"}},hF={enter:e=>({x:e>0?"100%":"-100%",opacity:0}),center:{x:0,opacity:1},exit:e=>({x:e>0?"-50%":"50%",opacity:0})},gF={type:"spring",stiffness:300,damping:30,mass:.8},fF=({step:e,total:r,theme:i})=>t.jsx("div",{style:{width:"100%",height:"4px",background:"rgba(255,255,255,0.08)",borderRadius:"2px",overflow:"hidden",marginBottom:"8px"},children:t.jsx(ye.div,{style:{height:"100%",background:i.gradient,borderRadius:"2px"},animate:{width:`${e/r*100}%`},transition:{type:"spring",stiffness:200,damping:25}})}),xF=({step:e,total:r,onBack:i,canSkip:n,onSkip:o})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 0",marginBottom:"8px"},children:[e>1?t.jsx("button",{onClick:i,style:{background:"none",border:"none",color:"white",cursor:"pointer",padding:"8px",marginLeft:"-8px",display:"flex",alignItems:"center"},children:t.jsx(t5,{size:24})}):t.jsx("div",{style:{width:"40px"}}),t.jsxs("span",{style:{fontSize:"0.85rem",color:"var(--text-muted)",fontFamily:"Outfit",fontWeight:"500"},children:[e," / ",r]}),n?t.jsx("button",{onClick:o,style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:"0.9rem",fontWeight:"500",padding:"8px"},children:"Passer"}):t.jsx("div",{style:{width:"50px"}})]}),As=({icon:e,theme:r,type:i="text",...n})=>t.jsxs("div",{style:{position:"relative",width:"100%"},children:[e&&t.jsx(e,{size:20,style:{position:"absolute",left:"16px",top:"50%",transform:"translateY(-50%)",color:"rgba(255,255,255,0.3)"}}),t.jsx("input",{type:i,style:{width:"100%",padding:e?"16px 16px 16px 48px":"16px",fontSize:"1.1rem",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"14px",color:"white",outline:"none",fontFamily:"Inter, sans-serif",transition:"border-color 0.2s, box-shadow 0.2s",colorScheme:"dark"},onFocus:o=>{o.target.style.borderColor=(r==null?void 0:r.primary)||"var(--primary)",o.target.style.boxShadow=`0 0 0 3px ${(r==null?void 0:r.primary)||"#D4C4A8"}20`},onBlur:o=>{o.target.style.borderColor="rgba(255,255,255,0.1)",o.target.style.boxShadow="none"},...n})]}),zg=({label:e,selected:r,onClick:i,icon:n,theme:o})=>t.jsxs(ye.button,{onClick:i,whileTap:{scale:.96},style:{width:"100%",padding:"16px 20px",background:r?`${o.primary}18`:"rgba(255,255,255,0.04)",border:`2px solid ${r?o.primary:"rgba(255,255,255,0.08)"}`,borderRadius:"14px",color:r?o.primary:"var(--text-muted)",fontSize:"1rem",fontFamily:"Inter, sans-serif",fontWeight:r?"600":"400",cursor:"pointer",display:"flex",alignItems:"center",gap:"12px",transition:"all 0.2s"},children:[n&&t.jsx(n,{size:22}),t.jsx("span",{style:{flex:1,textAlign:"left"},children:e}),r&&t.jsx(ye.div,{initial:{scale:0},animate:{scale:1},style:{width:"24px",height:"24px",borderRadius:"50%",background:o.gradient,display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(pr,{size:14,color:"#000",strokeWidth:3})})]}),mF=({value:e,onChange:r,onCityConfirm:i,theme:n})=>{const[o,a]=m.useState([]),[l,d]=m.useState(null),[p,u]=m.useState(!1),[g,h]=m.useState("France"),x=m.useRef(null),y=m.useCallback(async k=>{if(k.length<2){a([]);return}u(!0);try{const j=(await(await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(k)},${g}&addressdetails=1&limit=5`)).json()).filter(P=>P.address&&(P.type==="city"||P.type==="town"||P.type==="village"||P.class==="place"||P.class==="boundary")).map(P=>({name:P.address.city||P.address.town||P.address.village||P.display_name.split(",")[0],country:P.address.country||g,lat:parseFloat(P.lat),lng:parseFloat(P.lon),display:`${P.address.city||P.address.town||P.address.village||P.display_name.split(",")[0]}, ${P.address.country||g}`})),T=[...new Map(j.map(P=>[P.name,P])).values()];a(T)}catch(w){console.warn("Geocoding error:",w)}finally{u(!1)}},[g]),_=k=>{const w=k.target.value;r(w),d(null),clearTimeout(x.current),x.current=setTimeout(()=>y(w),400)},S=k=>{r(k.name),d(k),a([]),i&&i(k)};return t.jsxs("div",{children:[t.jsx("div",{style:{display:"flex",gap:"8px",marginBottom:"12px"},children:["France","Belgique","Suisse","Canada"].map(k=>t.jsx("button",{onClick:()=>{h(k),d(null)},style:{padding:"6px 14px",borderRadius:"20px",fontSize:"0.8rem",border:`1px solid ${g===k?n.primary:"rgba(255,255,255,0.1)"}`,background:g===k?`${n.primary}15`:"transparent",color:g===k?n.primary:"var(--text-muted)",cursor:"pointer",transition:"all 0.2s"},children:k},k))}
2676),t.jsx(As,{icon:ur,theme:n,placeholder:"Ta ville",value:e,onChange:_,autoFocus:!0}),o.length>0&&!l&&t.jsx("div",{style:{marginTop:"8px",borderRadius:"12px",overflow:"hidden",border:"1px solid rgba(255,255,255,0.08)",background:"rgba(20,20,30,0.95)"},children:o.map((k,w)=>t.jsxs("button",{onClick:()=>S(k),style:{width:"100%",padding:"14px 16px",border:"none",background:"transparent",color:"white",cursor:"pointer",display:"flex",alignItems:"center",gap:"10px",borderBottom:w<o.length-1?"1px solid rgba(255,255,255,0.05)":"none",fontSize:"0.95rem",textAlign:"left"},children:[t.jsx(ur,{size:16,color:n.primary,style:{flexShrink:0}}),t.jsx("span",{children:k.display})]},w))}),p&&t.jsx("p",{style:{fontSize:"0.8rem",color:"var(--text-muted)",marginTop:"8px"},children:"Recherche..."}),l&&t.jsxs(ye.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},style:{marginTop:"12px",padding:"12px 16px",borderRadius:"12px",background:`${n.primary}10`,border:`1px solid ${n.primary}30`,display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(pr,{size:18,color:n.primary}),t.jsxs("div",{children:[t.jsxs("p",{style:{margin:0,fontSize:"0.95rem",color:"white",fontWeight:"600"},children:["ð ",l.name]}),t.jsx("p",{style:{margin:0,fontSize:"0.8rem",color:"var(--text-muted)"},children:l.country})]})]})]})},yF=({photos:e,onAdd:r,onRemove:i,theme:n,onStudio:o})=>{const a=m.useRef(null),[l,d]=m.useState(null),p=h=>new Promise(x=>{const y=new FileReader;y.readAsDataURL(h),y.onload=_=>{const S=new Image;S.src=_.target.result,S.onload=()=>{const k=document.createElement("canvas"),w=800;let b=S.width,j=S.height;b>j?b>w&&(j*=w/b,b=w):j>w&&(b*=w/j,j=w),k.width=b,k.height=j,k.getContext("2d").drawImage(S,0,0,b,j),x(k.toDataURL("image/jpeg",.75))}}}),u=async h=>{const x=h.target.files[0];if(!x)return;const y=await p(x);r(y,l),h.target.value=""},g=h=>{d(h),setTimeout(()=>{var x;return(x=a.current)==null?void 0:x.click()},50)};return t.jsxs(t.Fragment,{children:[t.jsx("input",{ref:a,type:"file",accept:"image/*",onChange:u,style:{display:"none"}}),t.jsx("div",{onClick:()=>!e[0]&&g(0),style:{width:"100%",maxWidth:"260px",margin:"0 auto",aspectRatio:"3/4",borderRadius:"20px",overflow:"hidden",border:e[0]?"none":`2px dashed ${n.primary}40`,background:e[0]?"none":"rgba(255,255,255,0.03)",cursor:e[0]?"default":"pointer",position:"relative"},children:e[0]?t.jsxs(t.Fragment,{children:[t.jsx("img",{src:e[0],alt:"Principale",style:{width:"100%",height:"100%",objectFit:"cover"}}),t.jsx("button",{onClick:h=>{h.stopPropagation(),i(0)},style:{position:"absolute",top:"8px",right:"8px",width:"28px",height:"28px",borderRadius:"50%",background:"rgba(0,0,0,0.6)",border:"1.5px solid rgba(255,255,255,0.3)",color:"white",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(mt,{size:14})}),t.jsx("div",{style:{position:"absolute",bottom:"8px",left:"8px",background:"rgba(0,0,0,0.6)",borderRadius:"8px",padding:"4px 10px",fontSize:"0.75rem",color:n.primary,fontWeight:"600"},children:"ð¸ Photo principale"})]}):t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",gap:"12px"},children:[t.jsx("div",{style:{width:"48px",height:"48px",borderRadius:"50%",background:n.gradient,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:`0 4px 16px ${n.glow}`},children:t.jsx(pi,{size:24,color:"#000"})}),t.jsx("p",{style:{fontSize:"0.9rem",color:"white",fontWeight:"600",margin:0},children:"Photo principale"}),t.jsx("p",{style:{fontSize:"0.75rem",color:"var(--text-muted)",margin:0},children:"Appuie pour ajouter"})]})}),t.jsx("div",{style:{display:"flex",gap:"10px",justifyContent:"center",marginTop:"12px"},children:[1,2,3].map(h=>t.jsx("div",{onClick:()=>!e[h]&&g(h),style:{width:"90px",height:"120px",borderRadius:"14px",overflow:"hidden",border:e[h]?"none":"1.5px dashed rgba(255,255,255,0.15)",background:e[h]?"none":"rgba(255,255,255,0.03)",cursor:e[h]?"default":"pointer",position:"relative"},children:e[h]?t.jsxs(t.Fragment,{children:[t.jsx("img",{src:e[h],alt:`Photo ${h+1}`,style:{width:"100%",height:"100%",objectFit:"cover"}}),t.jsx("button",{onClick:x=>{x.stopPropagation(),i(h)},style:{position:"absolute",top:"4px",right:"4px",width:"22px",height:"22px",borderRadius:"50%",background:"rgba(0,0,0,0.6)",border:"1px solid rgba(255,255,255,0.3)",color:"white",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(mt,{size:12})})]}):t.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:t.jsx(No,{size:20,color:"rgba(255,255,255,0.3)"})})},h))}),t.jsxs("button",{onClick:()=>{const h=e.findIndex(x=>x!==null);h>=0&&o&&o(h)},disabled:!e.some(h=>h!==null),style:{marginTop:"16px",width:"100%",padding:"14px",borderRadius:"14px",background:e.some(h=>h!==null)?"rgba(255,255,255,0.04)":"rgba(255,255,255,0.02)",border:`1px solid ${e.some(h=>h!==null)?"rgba(255,255,255,0.12)":"rgba(255,255,255,0.05)"}`,color:e.some(h=>h!==null)?"white":"rgba(255,255,255,0.25)",cursor:e.some(h=>h!==null)?"pointer":"not-allowed",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",fontSize:"0.9rem",transition:"all 0.2s"},children:[t.jsx(Vo,{size:18,color:e.some(h=>h!==null)?n.primary:"rgba(255,255,255,0.25)"}),t.jsx("span",{children:"Studio Photo"}),!e.some(h=>h!==null)&&t.jsx("span",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.2)"},children:"· ajoute une photo d'abord"})]}),t.jsx("p",{style:{textAlign:"center",fontSize:"0.8rem",color:"var(--text-muted)",marginTop:"8px"},children:"1 photo principale requise · 3 optionnelles"})]})},Eg=({section:e,selectedTags:r,onToggle:i,theme:n})=>{var o;return e?t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",maxHeight:"380px",overflowY:"auto",paddingRight:"4px"},children:(o=e.items)==null?void 0:o.map(a=>{const l=r.includes(a.id),d=e.color;return t.jsxs(ye.button,{onClick:()=>i(a.id),whileTap:{scale:.93},style:{padding:"10px 16px",borderRadius:"22px",border:`1.5px solid ${l?d:"rgba(255,255,255,0.1)"}`,background:l?`${d}15`:"rgba(255,255,255,0.03)",color:l?d:"var(--text-muted)",fontSize:"0.88rem",cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",transition:"all 0.2s"},children:[a.icon&&t.jsx(a.icon,{size:18}),a.label,l&&t.jsx(pr,{size:14,strokeWidth:3})]},a.id)})}):null},bF=()=>{var Ie;const e=Lt(),i=((Ie=ko().state)==null?void 0:Ie.initialMode)||localStorage.getItem("appMode")||"EROS",[n]=m.useState(i.toUpperCase()),o=y1[n]||y1.EROS,[a,l]=m.useState(1),[d,p]=m.useState(1),[u,g]=m.useState(!1),[h,x]=m.useState(""),[y,_]=m.useState({name:"",birthdate:"",gender:"",city:"",job:"",bio:"",email:"",password:"",passwordConfirm:"",phone:""}
2676),[S,k]=m.useState(null),[w,b]=m.useState([null,null,null,null]),[j,T]=m.useState([]),[P,I]=m.useState(null),R=m.useRef(null),O=m.useRef(null),E=m.useRef(null),[$,B]=m.useState(null),[ee,te]=m.useState(!1),[K,ne]=m.useState(null),[Re,Q]=m.useState(null),[G,le]=m.useState(!1),[F,A]=m.useState(null),[M,V]=m.useState(null),H=["Mon talent caché inutile est...","Un fait surprenant sur moi...","Le dimanche idéal pour moi c'est..."],[N,Z]=m.useState({}),[ae,X]=m.useState(!1),[he,Ae]=m.useState(!1),[ze,ue]=m.useState(!1),xe=m.useMemo(()=>n==="EROX"?So:n==="FRIEND"?il:Fn,[n]),ke=m.useCallback(()=>{p(1),l(z=>Math.min(z+1,Qd)),x("");try{mr()}catch{}},[]),Pe=m.useCallback(()=>{p(-1),l(z=>Math.max(z-1,1)),x("")},[]),Ce=m.useCallback((z,Y)=>{_(ce=>({...ce,[z]:Y}))},[]),Me=m.useCallback((z,Y)=>{b(ce=>{const ve=[...ce];if(Y!=null&&Y<4)ve[Y]=z;else{const pe=ve.findIndex($e=>!$e);pe>=0&&(ve[pe]=z)}return ve})},[]),Le=m.useCallback(z=>{b(Y=>{const ce=[...Y];return ce[z]=null,ce})},[]),rt=m.useCallback(z=>{T(Y=>Y.includes(z)?Y.filter(ce=>ce!==z):[...Y,z])},[]),Fe=async()=>{var z;ne(null);try{const Y=await navigator.mediaDevices.getUserMedia({video:{facingMode:"user",width:{ideal:640},height:{ideal:640}},audio:!1});B(Y),te(!0),setTimeout(()=>{O.current&&(O.current.srcObject=Y,O.current.play().catch(()=>{}))},100)}catch(Y){console.warn("Camera access denied, falling back to file picker:",Y),ne("camera_denied"),(z=R.current)==null||z.click()}},ft=m.useCallback(()=>{$&&($.getTracks().forEach(z=>z.stop()),B(null)),te(!1)},[$]),De=()=>{if(!O.current||!E.current)return;const z=O.current,Y=E.current,ce=Math.min(z.videoWidth,z.videoHeight);Y.width=ce,Y.height=ce;const ve=Y.getContext("2d"),pe=(z.videoWidth-ce)/2,$e=(z.videoHeight-ce)/2;ve.translate(ce,0),ve.scale(-1,1),ve.drawImage(z,pe,$e,ce,ce,0,0,ce,ce);const Xe=Y.toDataURL("image/jpeg",.85);I(Xe),ft()};m.useEffect(()=>{a!==11&&ee&&ft()},[a,ee,ft]),m.useEffect(()=>{a===12&&ee&&ft()},[a,ee,ft]);const Be=async z=>{const Y=z.target.files[0];if(!Y)return;const ce=new FileReader;ce.onload=ve=>I(ve.target.result),ce.readAsDataURL(Y)},re=()=>{switch(a){case 1:return y.name.trim().length>=2;case 2:{if(!y.birthdate)return!1;const z=new Date(y.birthdate),Y=new Date;let ce=Y.getFullYear()-z.getFullYear();const ve=Y.getMonth()-z.getMonth();return(ve<0||ve===0&&Y.getDate()<z.getDate())&&ce--,ce>=18}case 3:return!!y.gender;case 4:return!!S;case 5:return!0;case 6:return w.some(z=>z!==null);case 7:return!0;case 8:return!0;case 9:return!0;case 10:return!0;case 11:return!0;case 12:return!0;case 13:return y.email.includes("@")&&y.password.length>=6&&y.password===y.passwordConfirm&&ae&&he&&ze;default:return!0}},He=[5,7,11,12].includes(a),be=async()=>{var z,Y,ce,ve;if(re()){g(!0),x("");try{const pe={name:y.name,city:y.city,search_mode:n,onboarding_completed:!0,tags:n==="EROS"?j:[],erox_tags:n==="EROX"?j:[],friend_tags:n==="FRIEND"?j:[]},{data:$e,error:Xe}=await D.auth.signUp({email:y.email,password:y.password,options:{data:pe,emailRedirectTo:`${window.location.origin}/matches?mode=${n}`}});if(Xe)throw Xe;const tt=$e.user.id;let gt=$e.session;if(!gt){console.log("No session after signUp (email confirmation enabled?), signing in...");const{data:Ne,error:Ze}=await D.auth.signInWithPassword({email:y.email,password:y.password});!Ze&&(Ne!=null&&Ne.session)?(gt=Ne.session,console.log("Sign-in successful, got session for profile writes")):console.warn("Sign-in after signUp failed:",Ze==null?void 0:Ze.message)}const{createClient:at}=await Wr(async()=>{const{createClient:Ne}=await Promise.resolve().then(()=>Fa);return{createClient:Ne}},void 0),Pt=gt?at("https://bqfzljnhxblhiabyvpqm.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4",{global:{headers:{Authorization:`Bearer ${gt.access_token}`}}}):D,ut=await(async(Ne,Ze=10)=>{for(let Et=0;Et<Ze;Et++){const{data:Ue}=await Pt.from("profiles").select("id").eq("id",Ne).maybeSingle();if(Ue)return!0;await new Promise(St=>setTimeout(St,300))}return!1})(tt);console.log("Profile row exists after wait:",ut);const Wt=S?{lat:S.lat,lng:S.lng,city:S.name}:{lat:48.8566,lng:2.3522,city:y.city};let dt=null;if(y.birthdate){const Ne=new Date(y.birthdate),Ze=new Date;dt=Ze.getFullYear()-Ne.getFullYear();const Et=Ze.getMonth()-Ne.getMonth();(Et<0||Et===0&&Ze.getDate()<Ne.getDate())&&dt--}const Rr=localStorage.getItem("meetapps_ref"),Dr=localStorage.getItem("meetapps_promo"),Rt=localStorage.getItem("meetapps_utm_source"),br=localStorage.getItem("meetapps_utm_medium"),Ht=localStorage.getItem("meetapps_utm_campaign"),or=(y.name||"MEET").replace(/[^a-zA-Z]/g,"").slice(0,4).toUpperCase()+Math.floor(1e3+Math.random()*9e3),sr={id:tt,name:y.name,gender:y.gender,city:y.city,birthdate:y.birthdate||null,age:dt,job:y.job||null,bio:y.bio||null,phone:y.phone||null,location:Wt,meetips_balance:5,tags:n==="EROS"?j:void 0,erox_tags:n==="EROX"?j:void 0,friend_tags:n==="FRIEND"?j:void 0,prompts:H.map(Ne=>({question:Ne,answer:N[Ne]||""})),updated_at:new Date().toISOString(),referral_code:or,referred_by:Rr||null,utm_source:Rt||null,utm_medium:br||null,utm_campaign:Ht||null};if(Object.keys(sr).forEach(Ne=>{sr[Ne]===void 0&&delete sr[Ne]}),ut){if(gt){const{error:Ne}=await Pt.from("profiles").update(sr).eq("id",tt);Ne&&(console.error("Profile update failed, trying upsert:",Ne),await Pt.from("profiles").upsert(sr,{onConflict:"id"}))}}else gt&&(console.warn("Profile row not found after 3s â using upsert fallback"),await Pt.from("profiles").upsert(sr,{onConflict:"id"}));if(gt){if(gt){const Ne=w.filter(Ze=>Ze);if(Ne.length>0){const{createClient:Ze}=await Wr(async()=>{const{createClient:It}=await Promise.resolve().then(()=>Fa);return{createClient:It}},void 0),Et=gt.access_token,Ue=Ze("https://bqfzljnhxblhiabyvpqm.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4",{global:{headers:{Authorization:`Bearer ${Et}`}}}),St=n==="FRIEND"?"friend_avatar_url":n==="EROX"?"erox_avatar_url":"avatar_url",At=n==="FRIEND"?"friend_photos":n==="EROX"?"erox_photos":"photos",Ft=[],Gt=It=>
2676{if(It.startsWith("data:")){const[jt,Dt]=It.split(","),Nt=jt.match(/data:(.*?);/),jr=Nt?Nt[1]:"image/jpeg",Zt=atob(Dt),kr=new Uint8Array(Zt.length);for(let xr=0;xr<Zt.length;xr++)kr[xr]=Zt.charCodeAt(xr);return new Blob([kr],{type:jr})}return null},fr=(It,jt=400,Dt=.4)=>new Promise(Nt=>{const jr=new Image;jr.src=It,jr.onload=()=>{const Zt=document.createElement("canvas");let kr=jr.width,xr=jr.height;kr>xr?kr>jt&&(xr*=jt/kr,kr=jt):xr>jt&&(kr*=jt/xr,xr=jt),Zt.width=kr,Zt.height=xr,Zt.getContext("2d").drawImage(jr,0,0,kr,xr),Nt(Zt.toDataURL("image/jpeg",Dt))},jr.onerror=()=>Nt(null)});for(let It=0;It<Ne.length;It++){const jt=Ne[It];if(jt.startsWith("http")){Ft.push(jt);continue}try{let Dt=Gt(jt);Dt||(Dt=await(await fetch(jt)).blob());const Nt="jpg",jr="image/jpeg",Zt=`${tt}/${It===0?"avatar":`gallery_${It}`}.${Nt}`;let{error:kr}=await Ue.storage.from("avatars").upload(Zt,Dt,{upsert:!0,contentType:jr});if(kr&&jt.startsWith("data:")){console.warn(`Photo ${It} upload failed (${(Dt.size/1024).toFixed(0)}KB), retrying with compression...`);const xr=await fr(jt,400,.4);if(xr){const Bn=Gt(xr);if(Bn){console.log(`Retry: ${(Bn.size/1024).toFixed(0)}KB (was ${(Dt.size/1024).toFixed(0)}KB)`);const{error:Ti}=await Ue.storage.from("avatars").upload(Zt,Bn,{upsert:!0,contentType:"image/jpeg"});kr=Ti}}}if(kr)console.error(`Photo ${It} upload failed after retry:`,kr);else{const{data:xr}=Ue.storage.from("avatars").getPublicUrl(Zt);Ft.push(xr.publicUrl)}}catch(Dt){console.error(`Photo ${It} failed:`,Dt)}}if(Ft.length>0){const It={};It[St]=Ft[0],It.photo=Ft[0],Ft.length>1&&(It[At]=Ft.slice(1),Ft.slice(1).forEach((jt,Dt)=>{Dt<3&&(It[`photo_${Dt+1}`]=jt)})),await Pt.from("profiles").update(It).eq("id",tt)}}if(P)try{const{createClient:Ze}=await Wr(async()=>{const{createClient:Ft}=await Promise.resolve().then(()=>Fa);return{createClient:Ft}},void 0),Et=Ze("https://bqfzljnhxblhiabyvpqm.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4",{global:{headers:{Authorization:`Bearer ${gt.access_token}`}}});let Ue;if(P.startsWith("data:")){const[Ft,Gt]=P.split(","),fr=((ce=Ft.match(/data:(.*?);/))==null?void 0:ce[1])||"image/jpeg",It=atob(Gt),jt=new Uint8Array(It.length);for(let Dt=0;Dt<It.length;Dt++)jt[Dt]=It.charCodeAt(Dt);Ue=new Blob([jt],{type:fr})}else Ue=await(await fetch(P)).blob();const St=`${tt}_verification_${Date.now()}.jpg`,{error:At}=await Et.storage.from("verification_photos").upload(St,Ue,{upsert:!0,contentType:"image/jpeg"});if(!At){const{data:{publicUrl:Ft}}=Et.storage.from("verification_photos").getPublicUrl(St);await Pt.from("profiles").update({verification_status:"pending",verification_photo_url:Ft}).eq("id",tt)}}catch(Ze){console.warn("Selfie upload failed:",Ze)}if(M||F)try{let Ze=F;if(M){const{createClient:Et}=await Wr(async()=>{const{createClient:Gt}=await Promise.resolve().then(()=>Fa);return{createClient:Gt}},void 0),Ue=Et("https://bqfzljnhxblhiabyvpqm.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4",{global:{headers:{Authorization:`Bearer ${gt.access_token}`}}}),St=`${tt}/${Date.now()}_voice.webm`,{data:At,error:Ft}=await Ue.storage.from("voice-bios").upload(St,M,{upsert:!0,contentType:"audio/webm"});if(!Ft){const{data:Gt}=D.storage.from("voice-bios").getPublicUrl(At.path);Ze=Gt.publicUrl}}Ze&&!Ze.startsWith("blob:")&&await Pt.from("profiles").update({voice_bio_url:Ze}).eq("id",tt)}catch(Ze){console.warn("Voice bio save failed:",Ze)}}}else{console.log("No session â saving ALL data via Edge Function (split payload)");const Ne="https://bqfzljnhxblhiabyvpqm.supabase.co",Ze="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJxZnpsam5oeGJsaGlhYnl2cHFtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MDM3NjQsImV4cCI6MjA4Mzk3OTc2NH0.jWaWbpO4yrhm2aAkvlwWuH7pTaSbcvZUebkiRjuXYg4",Et={"Content-Type":"application/json",apikey:Ze,Authorization:`Bearer ${Ze}`};try{const At={userId:tt,profileData:{...sr,onboardingMode:n}};delete At.profileData.id,console.log("Step 1: Saving profile text data...",Object.keys(At.profileData)),console.log("Step 1 full payload keys:",JSON.stringify(Object.keys(At.profileData)));const Gt=await(await fetch(`${Ne}/functions/v1/save-onboarding`,{method:"POST",headers:Et,body:JSON.stringify(At)})).json();console.log("ð´ Step 1 FULL response:",JSON.stringify(Gt)),Gt.error&&console.error("Step 1 Edge Function error:",Gt.error),((z=Gt.errors)==null?void 0:z.length)>0?console.warn("Step 1 partial errors:",Gt.errors):console.log("â
Step 1: Profile text data saved:",Gt.results)}catch(At){console.error("Step 1 (text data) EXCEPTION:",At)}const Ue=w.filter(At=>At);if(Ue.length>0||P||M||F)try{const At={userId:tt,profileData:{onboardingMode:n},photos:Ue.length>0?Ue:void 0,selfie:P||void 0};if(M){const fr=await new Promise(It=>{const jt=new FileReader;jt.onloadend=()=>
2676It(jt.result),jt.readAsDataURL(M)});At.voiceBio=fr}console.log(`Step 2: Uploading media (${Ue.length} photos, selfie: ${!!P}, voice: ${!!M})...`);const Gt=await(await fetch(`${Ne}/functions/v1/save-onboarding`,{method:"POST",headers:Et,body:JSON.stringify(At)})).json();((Y=Gt.errors)==null?void 0:Y.length)>0?console.warn("Step 2 media errors:",Gt.errors):console.log("â
Step 2: Media saved:",Gt.results)}catch(At){console.error("Step 2 (media) failed:",At)}}localStorage.setItem("userProfile",JSON.stringify({...sr,id:tt}));try{const Ne=gt?Pt:D;if(Rr){const{data:Ze}=await Ne.from("profiles").select("id, meetips_balance").eq("referral_code",Rr).maybeSingle();if(Ze){await Ne.from("profiles").update({meetips_balance:(Ze.meetips_balance||0)+10}).eq("id",Ze.id),await Ne.from("referrals").insert({referrer_id:Ze.id,referred_id:tt,referral_code:Rr,meetips_rewarded:10}),await Ne.from("profiles").update({meetips_balance:15}).eq("id",tt),console.log("â
Referral applied: parrain",Ze.id,"+",10,"Meetips");try{const Ue=(ve=y.email)==null?void 0:ve.toLowerCase();if(Ue){const{data:St}=await Ne.from("referral_invites").select("id").eq("referrer_id",Ze.id).eq("invited_email",Ue).eq("status","sent").maybeSingle();if(St){const{data:Ft}=await Ne.from("profiles").select("meetips_balance").eq("id",Ze.id).maybeSingle();await Ne.from("profiles").update({meetips_balance:((Ft==null?void 0:Ft.meetips_balance)||0)+3}).eq("id",Ze.id),await Ne.from("referral_invites").update({status:"converted",meetips_awarded:3}).eq("id",St.id),console.log("â
Email invite converted: parrain",Ze.id,"+",3,"bonus Meetips")}}}catch(Ue){console.warn("Email invite conversion check failed (non-blocking):",Ue)}}}if(Dr){const{data:Ze}=await Ne.from("promo_codes").select("*").eq("code",Dr.toUpperCase()).eq("active",!0).maybeSingle();if(Ze&&(!Ze.max_uses||Ze.current_uses<Ze.max_uses)&&(!Ze.expires_at||new Date(Ze.expires_at)>new Date)){const Et=Ze.meetips_reward||10,{data:Ue}=await Ne.from("profiles").select("meetips_balance").eq("id",tt).maybeSingle();await Ne.from("profiles").update({meetips_balance:((Ue==null?void 0:Ue.meetips_balance)||5)+Et}).eq("id",tt),await Ne.from("promo_codes").update({current_uses:(Ze.current_uses||0)+1}).eq("id",Ze.id),console.log("â
Promo code applied:",Dr,"+",Et,"Meetips")}}["meetapps_ref","meetapps_promo","meetapps_utm_source","meetapps_utm_medium","meetapps_utm_campaign"].forEach(Ze=>localStorage.removeItem(Ze))}catch(Ne){console.warn("Marketing hooks error (non-blocking):",Ne)}if(localStorage.setItem("pendingWelcomeEmail",JSON.stringify({userId:tt,email:y.email,name:y.name,scheduledAt:Date.now()})),!$e.session){e("/check-email");return}e("/preferences")}catch(pe){console.error("Signup error:",pe),x(pe.message||"Une erreur est survenue")}finally{g(!1)}}},nt=()=>{a===Qd?be():ke()},J=()=>{const z=vF;switch(a){case 1:return t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center"},children:[t.jsx("h1",{style:z.title,children:"Comment tu t'appelles ?"}),t.jsx("p",{style:z.subtitle,children:"Ton prénom sera visible sur ton profil."}),t.jsx("div",{style:{marginTop:"32px"},children:t.jsx(As,{icon:Ur,theme:o,placeholder:"Ton prénom",value:y.name,onChange:Y=>Ce("name",Y.target.value),autoFocus:!0})})]});case 2:return t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center"},children:[t.jsx("h1",{style:z.title,children:"Ta date de naissance"}),t.jsx("p",{style:z.subtitle,children:"Tu dois avoir au moins 18 ans. Ton âge sera visible."}),t.jsx("div",{style:{marginTop:"32px"},children:t.jsx(As,{icon:cr,theme:o,type:"date",value:y.birthdate,onChange:Y=>Ce("birthdate",Y.target.value)})}),y.birthdate&&(()=>{const Y=new Date(y.birthdate),ce=new Date;let ve=ce.getFullYear()-Y.getFullYear();const pe=ce.getMonth()-Y.getMonth();return(pe<0||pe===0&&ce.getDate()<Y.getDate())&&ve--,ve<18?t.jsx("p",{style:{color:"#FF3B5C",marginTop:"12px",fontSize:"0.9rem"},children:"Tu dois avoir au moins 18 ans."}):t.jsxs("p",{style:{color:o.primary,marginTop:"12px",fontSize:"0.9rem"},children:[ve," ans"]})})()]});case 3:return t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center"},children:[t.jsx("h1",{style:z.title,children:"Tu es..."}),t.jsx("p",{style:z.subtitle,children:"Voici comment tu apparaîtras."}),t.jsxs("div",{style:{marginTop:"32px",display:"flex",flexDirection:"column",gap:"12px"},children:[t.jsx(zg,{label:"Une femme",icon:Bt,theme:o,selected:y.gender==="female",onClick:()=>{Ce("gender","female"),setTimeout(ke,300)}}),t.jsx(zg,{label:"Un homme",icon:Ur,theme:o,selected:y.gender==="male",onClick:()=>{Ce("gender","male"),setTimeout(ke,300)}}),t.jsx(zg,{label:"Non-binaire",icon:Xt,theme:o,selected:y.gender==="non-binary",onClick:()=>{Ce("gender","non-binary"),setTimeout(ke,300)}})]})]});case 4:return t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center"},children:[t.jsx("h1",{style:z.title,children:"Tu habites où ?"}),t.jsx("p",{style:z.subtitle,children:"On cherchera des profils autour de toi."}),t.jsx("div",{style:{marginTop:"24px"},children:t.jsx(mF,{value:y.city,onChange:Y=>{Ce("city",Y),k(null)},onCityConfirm:Y=>{k(Y),Ce("city",Y.name)},theme:o})})]});case 5:return t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center"},children:[t.jsx("h1",{style:z.title,children:"Ton métier"}),t.jsx("p",{style:z.subtitle,children:"Ãa aide à connecter des esprits similaires."}),t.jsx("div",{style:{marginTop:"32px"},children:t.jsx(As,{icon:Qn,theme:o,placeholder:"Ex: Designer, Chef, Ingénieur...",value:y.job,onChange:Y=>Ce("job",Y.target.value),autoFocus:!0})})]});case 6:return t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:[t.jsx("h1",{style:z.title,children:"Ajoute tes photos"}),t.jsx("p",{style:z.subtitle,children:"La première sera ta photo principale."}),t.jsx("div",{style:{marginTop:"20px",flex:1},children:t.jsx(yF,{photos:w,onAdd:Me,onRemove:Le,theme:o,onStudio:Y=>{Q(Y),le(!0)}})}),G&&Re!==null&&w[Re]&&t.jsx(h0,{imageSrc:w[Re],onClose:()=>{le(!1),Q(null)},onSave:Y=>{Me(Y,Re),le(!1),Q(null)}})]});case 7:return t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflowY:"auto"},children:[t.jsx("h1",{style:z.title,children:"Parle-nous de toi"}),t.jsx("p",{style:z.subtitle,children:"L'authenticité, ça paye."}),t.jsxs("div",{style:{marginTop:"20px",display:"flex",flexDirection:"column",gap:"16px"},children:[t.jsx("textarea",{placeholder:"Quelques mots sur toi...",value:y.bio,onChange:Y=>Ce("bio",Y.target.value),maxLength:300,style:{width:"100%",minHeight:"90px",padding:"16px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"14px",color:"white",fontSize:"1rem",fontFamily:"Inter, sans-serif",resize:"none",outline:"none"}}),t.jsxs("p",{style:{fontSize:"0.8rem",color:"var(--text-muted)",textAlign:"right",margin:0},children:[y.bio.length,"/300"]}),H.map(Y=>t.jsxs("div",{children:[t.jsxs("p",{style:{fontSize:"0.85rem",fontWeight:"600",color:o.primary,marginBottom:"6px",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(o5,{size:14})," ",Y]}),t.jsx("input",{type:"text",placeholder:"Ta réponse...",value:N[Y]||"",onChange:ce=>Z(ve=>({...ve,[Y]:ce.target.value})),style:{width:"100%",padding:"12px",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"10px",color:"white",fontSize:"0.9rem",fontFamily:"Inter, sans-serif",outline:"none"}})]},Y))]})]});case 8:{const Y=xe[0];return t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:[t.jsx("h1",{style:{...z.title,color:(Y==null?void 0:Y.color)||o.primary},children:(Y==null?void 0:Y.title)||"Ce que je suis"}),t.jsx("p",{style:z.subtitle,children:"Sélectionne ce qui te correspond le mieux."}),t.jsx("div",{style:{marginTop:"16px",flex:1,overflowY:"auto"},children:t.jsx(Eg,{section:Y,selectedTags:j,onToggle:rt,theme:o})})]})}case 9:{const Y=xe[1];return t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:[t.jsx("h1",{style:{...z.title,color:(Y==null?void 0:Y.color)||o.primary},children:(Y==null?void 0:Y.title)||"Ce que j'aime"}),t.jsx("p",{style:z.subtitle,children:"Loisirs, passions, centres d'intérêt..."}),t.jsx("div",{style:{marginTop:"16px",flex:1,overflowY:"auto"},children:t.jsx(Eg,{section:Y,selectedTags:j,onToggle:rt,theme:o})})]})}case 10:{const Y=xe[2];return t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:[t.jsx("h1",{style:{...z.title,color:(Y==null?void 0:Y.color)||o.primary},children:(Y==null?void 0:Y.title)||"Ce que je recherche"}),t.jsx("p",{style:z.subtitle,children:"Dis-nous ce qui compte pour toi."}),t.jsx("div",{style:{marginTop:"16px",flex:1,overflowY:"auto"},children:t.jsx(Eg,{section:Y,selectedTags:j,onToggle:rt,theme:o})})]})}case 11:return t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[t.jsx("div",{style:{width:"80px",height:"80px",borderRadius:"50%",background:"rgba(74,222,128,0.12)",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"24px"},children:t.jsx(fi,{size:40,color:"#4ADE80"})}),t.jsx("h1",{style:{...z.title,textAlign:"center"},children:"Badge de confiance"}
2676),t.jsx("p",{style:{...z.subtitle,textAlign:"center",maxWidth:"300px"},children:"Prends un selfie pour vérifier ton identité et obtenir le badge â"}),t.jsxs("div",{style:{marginTop:"24px",width:"100%",maxWidth:"280px"},children:[P?t.jsxs("div",{style:{position:"relative"},children:[t.jsx("img",{src:P,alt:"Selfie",style:{width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:"20px",border:"2px solid #4ADE80"}}),t.jsx("button",{onClick:()=>I(null),style:{position:"absolute",top:"8px",right:"8px",width:"28px",height:"28px",borderRadius:"50%",background:"rgba(0,0,0,0.6)",border:"none",color:"white",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(mt,{size:14})}),t.jsxs("div",{style:{position:"absolute",bottom:"8px",left:"50%",transform:"translateX(-50%)",background:"rgba(0,0,0,0.7)",borderRadius:"20px",padding:"6px 16px",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(pr,{size:14,color:"#4ADE80"}),t.jsx("span",{style:{fontSize:"0.8rem",color:"#4ADE80",fontWeight:"600"},children:"Selfie ajouté"})]})]}):ee?t.jsxs("div",{style:{position:"relative"},children:[t.jsx("video",{ref:O,autoPlay:!0,playsInline:!0,muted:!0,style:{width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:"20px",border:"2px solid #4ADE80",transform:"scaleX(-1)"}}),t.jsx("canvas",{ref:E,style:{display:"none"}}),t.jsx("button",{onClick:De,style:{position:"absolute",bottom:"16px",left:"50%",transform:"translateX(-50%)",width:"64px",height:"64px",borderRadius:"50%",background:"rgba(74,222,128,0.2)",border:"4px solid #4ADE80",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 20px rgba(74,222,128,0.3)"},children:t.jsx("div",{style:{width:"48px",height:"48px",borderRadius:"50%",background:"#4ADE80"}})}),t.jsx("button",{onClick:ft,style:{position:"absolute",top:"8px",right:"8px",width:"28px",height:"28px",borderRadius:"50%",background:"rgba(0,0,0,0.6)",border:"none",color:"white",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(mt,{size:14})})]}):t.jsxs("button",{onClick:Fe,style:{width:"100%",aspectRatio:"1",borderRadius:"20px",border:"2px dashed rgba(74,222,128,0.3)",background:"rgba(74,222,128,0.05)",cursor:"pointer",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"12px"},children:[t.jsx(pi,{size:32,color:"#4ADE80"}),t.jsx("span",{style:{fontSize:"0.9rem",color:"#4ADE80",fontWeight:"600"},children:"Prendre un selfie"}),t.jsx("span",{style:{fontSize:"0.75rem",color:"var(--text-muted)",maxWidth:"200px",textAlign:"center"},children:"Regarde la caméra et assure-toi d'être bien éclairé(e)"})]}),t.jsx("input",{ref:R,type:"file",accept:"image/*",capture:"user",onChange:Be,style:{display:"none"}})]}),t.jsx("p",{style:{fontSize:"0.8rem",color:"var(--text-muted)",textAlign:"center",marginTop:"16px"},children:"Tu pourras le faire plus tard dans ton profil."})]});case 12:return t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[t.jsx("div",{style:{width:"80px",height:"80px",borderRadius:"50%",background:"rgba(168,85,247,0.12)",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"24px"},children:t.jsx(ls,{size:40,color:"#a855f7"})}),t.jsx("h1",{style:{...z.title,textAlign:"center"},children:"Bio vocale"}),t.jsx("p",{style:{...z.subtitle,textAlign:"center",maxWidth:"320px"},children:"Enregistre un court message vocal pour te présenter. Les membres adorent ça !"}),t.jsx("div",{style:{marginTop:"24px",width:"100%",maxWidth:"340px",background:"rgba(168,85,247,0.06)",borderRadius:"20px",border:"1px solid rgba(168,85,247,0.15)",padding:"20px"},children:F?t.jsxs("div",{style:{textAlign:"center"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"12px 20px",background:"rgba(74,222,128,0.1)",borderRadius:"14px",border:"1px solid rgba(74,222,128,0.2)",marginBottom:"12px"},children:[t.jsx(pr,{size:18,color:"#4ADE80"}),t.jsx("span",{style:{color:"#4ADE80",fontWeight:"600",fontSize:"0.95rem"},children:"Bio vocale enregistrée !"})]}),t.jsx("div",{style:{padding:"12px 16px",background:"rgba(168,85,247,0.08)",borderRadius:"12px",border:"1px solid rgba(168,85,247,0.15)",marginBottom:"12px"}
2676,children:t.jsx(Sd,{audioUrl:F,color:"#a855f7"})}),t.jsx("button",{onClick:()=>{A(null),V(null)},style:{background:"none",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"10px",color:"rgba(255,255,255,0.4)",padding:"8px 16px",cursor:"pointer",fontSize:"0.8rem"},children:"Recommencer"})]}):t.jsx(p5,{localOnly:!0,onSave:Y=>A(Y),onSaveBlob:Y=>V(Y)})}),t.jsx("div",{style:{marginTop:"20px",padding:"12px 18px",borderRadius:"12px",background:"rgba(245,158,11,0.08)",border:"1px solid rgba(245,158,11,0.15)",maxWidth:"320px"},children:t.jsxs("p",{style:{margin:0,fontSize:"0.78rem",color:"rgba(255,255,255,0.5)",textAlign:"center",lineHeight:"1.5"},children:["ð ",t.jsx("strong",{style:{color:"#F59E0B"},children:"Gratuit pendant l'inscription !"}),t.jsx("br",{}),"Si tu passes cette étape, tu pourras l'enregistrer plus tard depuis ton profil pour 11 Meetips."]})})]});case 13:return t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center"},children:[t.jsx("h1",{style:z.title,children:"Crée ton compte"}),t.jsxs("p",{style:z.subtitle,children:["Plus qu'une étape pour rejoindre MEET",n==="FRIEND"?"Friend":n==="EROX"?"Erox":"Eros"," !"]}),t.jsxs("div",{style:{marginTop:"24px",display:"flex",flexDirection:"column",gap:"14px"},children:[t.jsx(As,{icon:Vr,theme:o,type:"email",placeholder:"Ton email",value:y.email,onChange:Y=>Ce("email",Y.target.value),autoFocus:!0}),t.jsx(As,{icon:Fr,theme:o,type:"password",placeholder:"Mot de passe (6 car. min.)",value:y.password,onChange:Y=>Ce("password",Y.target.value)}),t.jsx(As,{icon:Fr,theme:o,type:"password",placeholder:"Confirmer le mot de passe",value:y.passwordConfirm,onChange:Y=>Ce("passwordConfirm",Y.target.value)}),y.passwordConfirm&&y.password!==y.passwordConfirm&&t.jsx("p",{style:{color:"#FF3B5C",fontSize:"0.85rem",margin:0},children:"Les mots de passe ne correspondent pas."}),t.jsxs("div",{children:[t.jsx(As,{icon:c0,theme:o,type:"tel",placeholder:"Téléphone (optionnel)",value:y.phone,onChange:Y=>Ce("phone",Y.target.value)}),t.jsx("p",{style:{fontSize:"0.75rem",color:"var(--text-muted)",marginTop:"4px",marginLeft:"4px"},children:"Optionnel â pour la récupération de compte"})]})]}),t.jsxs("div",{style:{marginTop:"20px",display:"flex",flexDirection:"column",gap:"12px"},children:[t.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"12px",cursor:"pointer",fontSize:"0.85rem",color:"var(--text-main)"},onClick:()=>X(!ae),children:[t.jsx("div",{style:{width:"22px",height:"22px",borderRadius:"6px",flexShrink:0,marginTop:"1px",border:ae?`2px solid ${o.primary}`:"2px solid rgba(255,255,255,0.2)",background:ae?`${o.primary}20`:"transparent",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},children:ae&&t.jsx("span",{style:{color:o.primary,fontSize:"14px",fontWeight:"800"},children:"â"})}),t.jsxs("span",{children:["Je certifie avoir ",t.jsx("strong",{children:"au moins 18 ans"})," révolus."]})]}),t.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"12px",cursor:"pointer",fontSize:"0.85rem",color:"var(--text-main)"},onClick:()=>Ae(!he),children:[t.jsx("div",{style:{width:"22px",height:"22px",borderRadius:"6px",flexShrink:0,marginTop:"1px",border:he?`2px solid ${o.primary}`:"2px solid rgba(255,255,255,0.2)",background:he?`${o.primary}20`:"transparent",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},children:he&&t.jsx("span",{style:{color:o.primary,fontSize:"14px",fontWeight:"800"},children:"â"})}),t.jsxs("span",{children:["J'accepte les"," ",t.jsx("a",{href:"/terms",target:"_blank",rel:"noopener noreferrer",onClick:Y=>Y.stopPropagation(),style:{color:o.primary,textDecoration:"underline",fontWeight:"600"},children:"Conditions Générales d'Utilisation"}),"."]})]}),t.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"12px",cursor:"pointer",fontSize:"0.85rem",color:"var(--text-main)"},onClick:()=>ue(!ze),children:[t.jsx("div",{style:{width:"22px",height:"22px",borderRadius:"6px",flexShrink:0,marginTop:"1px",border:ze?`2px solid ${o.primary}`:"2px solid rgba(255,255,255,0.2)",background:ze?`${o.primary}20`:"transparent",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},children:ze&&t.jsx("span",{style:{color:o.primary,fontSize:"14px",fontWeight:"800"},children:"â"})}),t.jsxs("span",{children:["J'accepte les"," ",t.jsx("a",{href:"/cgv",target:"_blank",rel:"noopener noreferrer",onClick:Y=>Y.stopPropagation(),style:{color:o.primary,textDecoration:"underline",fontWeight:"600"},children:"Conditions Générales de Vente"})," ","et la"," ",t.jsx("a",{href:"/privacy",target:"_blank",rel:"noopener noreferrer",onClick:Y=>Y.stopPropagation(),style:{color:o.primary,textDecoration:"underline",fontWeight:"600"},children:"Politique de Confidentialité"}),"."]})]})]}),h&&t.jsx("p",{style:{color:"#FF3B5C",fontSize:"0.9rem",marginTop:"12px",textAlign:"center"},children:h})]});default:return null}};return t.jsxs("div",{style:{minHeight:"100dvh",background:o.bg,display:"flex",flexDirection:"column",padding:"env(safe-area-inset-top, 0) 20px env(safe-area-inset-bottom, 0)"},children:[t.jsxs("div",{style:{paddingTop:"12px"},children:[t.jsx(fF,{step:a,total:Qd,theme:o}),t.jsx(xF,{step:a,total:Qd,onBack:Pe,canSkip:He,onSkip:ke})]}),t.jsx("div",{style:{flex:1,display:"flex",overflow:"hidden"},children:t.jsx(tr,{mode:"wait",custom:d,children:t.jsx(ye.div,{custom:d,variants:hF,initial:"enter",animate:"center",exit:"exit",transition:gF,style:{width:"100%",display:"flex",flexDirection:"column"},children:J()},a)})}),t.jsx("div",{style:{padding:"16px 0",paddingBottom:"calc(env(safe-area-inset-bottom, 0px) + 16px)",position:"sticky",bottom:0,zIndex:10,background:o.bg},children:t.jsx(ye.button,{onClick:nt,disabled:!re()||u,whileTap:{scale:.97},style:{width:"100%",padding:"16px",borderRadius:"14px",border:"none",background:re()?o.gradient:"rgba(255,255,255,0.06)",color:re()?n==="EROX"?"#fff":"#000":"rgba(255,255,255,0.3)",fontSize:"1rem",fontWeight:"600",fontFamily:"Outfit, sans-serif",curs
2676or:re()?"pointer":"not-allowed",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.3s",opacity:u?.6:1},children:u?t.jsx("div",{style:{width:"20px",height:"20px",borderRadius:"50%",border:"2.5px solid rgba(0,0,0,0.2)",borderTopColor:"#000",animation:"spin 0.8s linear infinite"}}):a===Qd?t.jsxs(t.Fragment,{children:["Lancer la recherche ",t.jsx(Pr,{size:20})]}):t.jsx(t.Fragment,{children:"Suivant"})})})]})},vF={title:{fontSize:"1.8rem",fontFamily:"Outfit, sans-serif",fontWeight:"700",lineHeight:"1.2",letterSpacing:"-0.02em",color:"#F5F5DC",margin:0},subtitle:{fontSize:"0.95rem",color:"var(--text-muted)",lineHeight:"1.5",marginTop:"8px"}},jF=[{id:"explore",label:"Découvrir",icon:qo,emoji:"ð"},{id:"requests",label:"Besoin d'aide",icon:op,emoji:"ð"},{id:"my-services",label:"Mes offres",icon:jS,emoji:"ð¦"},{id:"my-bookings",label:"Suivi",icon:WA,emoji:"ðï¸"}],wF={pending:{label:"En attente",color:"#F59E0B",emoji:"â³"},confirmed:{label:"Confirmé",color:"#3B82F6",emoji:"â
"},completed:{label:"Terminé",color:"#22C55E",emoji:"ð"},disputed:{label:"Litige",color:"#EF4444",emoji:"â ï¸"},cancelled:{label:"Annulé",color:"#6B7280",emoji:"â"},released:{label:"Payé",color:"#10B981",emoji:"ð°"}},_F=()=>{const{profile:e,user:r}=gr(),{mode:i,lightMode:n}=dr(),o=si(),a=Lt(),l=e||(r?{id:r.id,...r.user_metadata}:null),[d,p]=m.useState("explore"),[u,g]=m.useState([]),[h,x]=m.useState([]),[y,_]=m.useState([]),[S,k]=m.useState([]),[w,b]=m.useState(!0),[j,T]=m.useState(null),[P,I]=m.useState(""),[R,O]=m.useState(!1),[E,$]=m.useState(null),[B,ee]=m.useState(null),[te,K]=m.useState(null),[ne,Re]=m.useState((l==null?void 0:l.meetips_balance)||0),[Q,G]=m.useState([]),[le,F]=m.useState([]),[A,M]=m.useState(""),[V,H]=m.useState(!1),[N,Z]=m.useState(null),[ae,X]=m.useState(null),[he,Ae]=m.useState(null),[ze,ue]=m.useState(null),[xe,ke]=m.useState("received"),[Pe,Ce]=m.useState(null);m.useEffect(()=>{i!=="FRIEND"&&a("/matches")},[i,a]),m.useEffect(()=>{l!=null&&l.id&&Me()},[l==null?void 0:l.id]);const Me=async()=>{b(!0);const[z,Y,ce,ve,pe,$e]=await Promise.all([Ar.getServices({category:j,search:P}),Ar.getMyServices(l.id),Ar.getMyBookings(l.id),Ar.getProviderBookings(l.id),Ar.getRequests({category:j,city:A}),Ar.getMyRequests(l.id)]);g(z.data||[]),x(Y.data||[]),_(ce.data||[]),k(ve.data||[]),G(pe.data||[]),F($e.data||[]),b(!1)};m.useEffect(()=>{l!=null&&l.id&&Ar.getServices({category:j,search:P}).then(z=>g(z.data||[]))},[j,P]);const Le=async z=>{if(!(l!=null&&l.id))return;const Y=await Ar.bookService(z.id,l.id);Y.success?(o.success(`Réservé ! -${z.price_meetips} Meetips`),Re(Y.newBalance),$(null),Me()):o.error(Y.error)},rt=async z=>{const Y=await Ar.confirmBooking(z,l.id);Y.success?(o.success("Réservation confirmée !"),Me()):o.error(Y.error)},Fe=async z=>{const Y=await Ar.completeBooking(z,l.id);Y.success?(o.success("Service terminé ! Paiement dans 24h."),Me()):o.error(Y.error)},ft=async z=>{const Y=await Ar.cancelBooking(z,l.id);Y.success?(o.success("Annulé et remboursé !"),Y.refundBalance&&Re(Y.refundBalance),Me()):o.error(Y.error)},De=async z=>{if(!window.confirm("Supprimer ce service ?"))return;const Y=await Ar.deleteService(z);Y.success?(o.success("Service supprimé"),Me()):o.error(Y.error)},Be=z=>qa.find(Y=>Y.id===z)||{emoji:"â",label:z,color:"#888"},re=(z,Y=.65)=>{const ce=z.replace("#",""),ve=Math.round(parseInt(ce.substring(0,2),16)*Y),pe=Math.round(parseInt(ce.substring(2,4),16)*Y),$e=Math.round(parseInt(ce.substring(4,6),16)*Y);return`#${ve.toString(16).padStart(2,"0")}${pe.toString(16).padStart(2,"0")}${$e.toString(16).padStart(2,"0")}`},He=(z,Y=.4)=>{const ce=z.replace("#",""),ve=Math.round(parseInt(ce.substring(0,2),16)+(255-parseInt(ce.substring(0,2),16))*Y),pe=Math.round(parseInt(ce.substring(2,4),16)+(255-parseInt(ce.substring(2,4),16))*Y),$e=Math.round(parseInt(ce.substring(4,6),16)+(255-parseInt(ce.substring(4,6),16))*Y);return`#${ve.toString(16).padStart(2,"0")}${pe.toString(16).padStart(2,"0")}${$e.toString(16).padStart(2,"0")}`},be={page:{minHeight:"100vh",background:n?"#FAF7F2":"linear-gradient(160deg, #0a1628 0%, #0d1117 40%, #091015 100%)",color:n?"#2A2520":"white",fontFamily:"'Inter', sans-serif",paddingTop:"110px",paddingBottom:"100px"},container:{maxWidth:"900px",margin:"0 auto",padding:"0 16px"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"20px",padding:"16px 20px",background:n?"rgba(140,115,75,0.06)":"rgba(255,255,255,0.03)",borderRadius:"16px",border:n?"2.5px solid rgba(120,100,60,0.5)":"1px solid rgba(255,255,255,0.06)",backdropFilter:"blur(16px)"},title:{fontFamily:"Outfit",fontSize:"1.5rem",fontWeight:"800",background:"linear-gradient(135deg, #26A69A, #4DD0E1)",WebkitBackgroun
2676dClip:"text",WebkitTextFillColor:"transparent",margin:0},subtitle:{color:n?"#8C7A60":"rgba(255,255,255,0.4)",fontSize:"0.72rem",margin:"3px 0 0",lineHeight:"1.3"},tabs:{display:"flex",gap:"4px",marginBottom:"16px",background:n?"rgba(140,115,75,0.08)":"rgba(255,255,255,0.04)",borderRadius:"14px",padding:"4px",border:n?"2.5px solid rgba(120,100,60,0.5)":"1px solid rgba(255,255,255,0.06)",overflowX:"auto",WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},tabBtn:z=>({padding:"9px 12px",borderRadius:"10px",border:z?n?"2.5px solid #00695C":"1px solid rgba(77,208,225,0.3)":n?"2px solid rgba(120,100,60,0.4)":"1px solid transparent",background:z?n?"linear-gradient(135deg, #26A69A, #00897B)":"rgba(38,166,154,0.18)":n?"rgba(140,115,75,0.08)":"rgba(255,255,255,0.04)",color:z?n?"white":"#4DD0E1":n?"#2A2520":"rgba(255,255,255,0.5)",cursor:"pointer",fontSize:"0.72rem",fontWeight:z?"700":"600",display:"flex",alignItems:"center",gap:"4px",whiteSpace:"nowrap",transition:"all 0.25s ease",flex:"1 1 0",minWidth:0,justifyContent:"center",boxShadow:z?n?"0 3px 12px rgba(0,121,107,0.3)":"0 2px 12px rgba(38,166,154,0.2), inset 0 1px 0 rgba(255,255,255,0.1)":"none",backdropFilter:z?"blur(10px)":"none"}),card:{background:n?"rgba(140,115,75,0.06)":"rgba(255,255,255,0.07)",borderRadius:"14px",border:n?"2.5px solid rgba(120,100,60,0.45)":"1px solid rgba(255,255,255,0.09)",overflow:"hidden",transition:"all 0.3s cubic-bezier(0.4,0,0.2,1)",cursor:"pointer",backdropFilter:"blur(12px)"},grid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(270px, 1fr))",gap:"16px"},badge:z=>({display:"inline-flex",alignItems:"center",gap:"5px",padding:"5px 12px",borderRadius:"10px",fontSize:"0.78rem",fontWeight:"700",background:`${z}25`,color:z,border:`1px solid ${z}50`}),fab:{position:"fixed",bottom:"90px",right:"20px",width:"52px",height:"52px",borderRadius:"14px",background:"linear-gradient(135deg, #26A69A, #00897B)",border:"none",color:"white",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 20px rgba(38,166,154,0.4)",zIndex:100,fontSize:"1.3rem",transition:"transform 0.2s"},modal:{position:"fixed",inset:0,zIndex:9999,background:n?"rgba(250,247,242,0.9)":"rgba(0,0,0,0.8)",backdropFilter:"blur(10px)",display:"flex",alignItems:"flex-start",justifyContent:"center",padding:"20px",overflowY:"auto",WebkitOverflowScrolling:"touch"},modalContent:{background:n?"linear-gradient(135deg, #FAF7F2, #F0EBE1)":"linear-gradient(135deg, #141420, #0d1117)",borderRadius:"20px",border:n?"2.5px solid rgba(120,100,60,0.4)":"1px solid rgba(255,255,255,0.1)",maxWidth:"500px",width:"100%",padding:"28px",marginTop:"10px",marginBottom:"20px",flexShrink:0},input:{width:"100%",padding:"12px 16px",borderRadius:"12px",border:n?"2px solid rgba(120,100,60,0.4)":"1px solid rgba(255,255,255,0.1)",background:n?"rgba(140,115,75,0.06)":"rgba(255,255,255,0.05)",color:n?"#2A2520":"white",fontSize:"0.9rem",outline:"none",boxSizing:"border-box",transition:"border-color 0.2s, box-shadow 0.2s"},btnPrimary:{padding:"12px 24px",borderRadius:"12px",background:"linear-gradient(135deg, #26A69A, #00897B)",border:"none",color:"white",fontWeight:"700",cursor:"pointer",fontSize:"0.9rem",width:"100%",transition:"transform 0.15s, box-shadow 0.15s"},btnSecondary:{padding:"10px 20px",borderRadius:"12px",background:n?"rgba(140,115,75,0.06)":"rgba(255,255,255,0.06)",border:n?"1.5px solid rgba(140,115,75,0.2)":"1px solid rgba(255,255,255,0.12)",color:n?"#3D3528":"rgba(255,255,255,0.7)",cursor:"pointer",fontSize:"0.85rem",transition:"all 0.2s"},stars:{display:"flex",gap:"4px"}},nt=({rating:z=0,size:Y=14,interactive:ce=!1,onChange:ve})=>t.jsx("div",{style:be.stars,children:[1,2,3,4,5].map(pe=>t.jsx(nr,{size:Y,fill:pe<=z?"#FFD700":n?"white":"transparent",color:pe<=z?"#FFD700":n?"rgba(255,255,255,0.5)":"rgba(255,255,255,0.2)",style:{cursor:ce?"pointer":"default"},onClick:()=>ce&&(ve==null?void 0:ve(pe))},pe))}),J=({svc:z,showActions:Y,onEdit:ce,onDelete:ve})=>{var gt;const pe=Be(z.category),$e=re(pe.color,.7),Xe=re(pe.color,.5),tt={background:`linear-gradient(135deg, ${$e}, ${Xe})`,border:`2px solid ${re(pe.color,.4)}`,boxShadow:`0 4px 16px ${Xe}40`,position:"relative",overflow:"hidden"};return t.jsxs("div",{className:"entraide-card entraide-colored",style:{...be.card,...tt},onClick:()=>!Y&&$(z),children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"55%",background:"linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.06) 50%, transparent 100%)",borderRadius:"14px 14px 0 0",pointerEvents:"none",zIndex:1}}),t.jsxs("div",{style:{display:"flex",gap:"12px",padding:"12px",position:"relative",zIndex:2},children:[z.image_url?t.jsx("div",{style:{width:"80px",height:"80px",borderRadius:"10px",overflow:"hidden",flexShrink:0},children:t.jsx("img",{src:z.image_url,alt:z.title,style:{width:"100%",height:"100%",objectFit:"cover"}})}):t.jsx("div",{style:{width:"80px",height:"80px",borderRadius:"10px",flexShrink:0,background:"rgba(255,255,255,0.25)",border:"2px s
2676olid rgba(255,255,255,0.4)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.6rem"},children:pe.emoji}),t.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"4px"},children:[t.jsxs("span",{style:{...be.badge(pe.color),padding:"2px 8px",fontSize:"0.68rem",borderRadius:"6px",background:"rgba(255,255,255,0.25)",color:"white",border:"1px solid rgba(255,255,255,0.5)"},children:[pe.emoji," ",pe.label]}),t.jsx("span",{style:{fontWeight:"800",color:"#F5F5F5",fontSize:"1.1rem",textShadow:"0 1px 3px rgba(0,0,0,0.25)"},children:z.price_type==="euros"?`${z.price_euros}â¬`:t.jsxs(t.Fragment,{children:[z.price_meetips," ",t.jsx(Jt,{size:18})]})})]}),t.jsx("h3",{style:{margin:"0 0 2px",fontSize:"1.1rem",fontWeight:"800",color:"#F5F5F5",lineHeight:1.2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textTransform:"uppercase",letterSpacing:"0.5px",textShadow:"0 1px 4px rgba(0,0,0,0.3)"},children:z.title}),t.jsx("p",{style:{margin:"0 0 4px",fontSize:"0.82rem",color:"rgba(255,255,255,0.95)",lineHeight:1.3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:z.description}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"6px"},children:[t.jsxs("div",{onClick:at=>{at.stopPropagation(),z.provider_id&&ue(z.provider_id)},style:{display:"flex",alignItems:"center",gap:"5px",cursor:"pointer",minWidth:0},children:[z.provider&&t.jsx("img",{src:z.provider.friend_avatar_url||z.provider.avatar_url||"",alt:"",style:{width:"18px",height:"18px",borderRadius:"50%",objectFit:"cover",border:"1px solid rgba(255,255,255,0.4)",flexShrink:0}}),t.jsx("span",{style:{fontSize:"0.7rem",color:"white",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:((gt=z.provider)==null?void 0:gt.name)||"Anonyme"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"3px",flexShrink:0},children:[t.jsx(nt,{rating:Math.round(z.avg_rating||0),size:14}),t.jsx("span",{style:{fontSize:"0.62rem",color:"white"},children:z.total_ratings>0?`(${z.total_ratings})`:""})]})]})]})]}),z.location&&t.jsxs("div",{style:{padding:"0 12px 8px",display:"flex",alignItems:"center",gap:"4px",fontSize:"0.82rem",color:"#F5F5F5",fontWeight:"600",position:"relative",zIndex:2,textShadow:"0 1px 2px rgba(0,0,0,0.2)"},children:[t.jsx(ur,{size:14})," ",z.location]}),Y&&t.jsxs("div",{style:{display:"flex",gap:"8px",padding:"0 12px 12px",borderTop:"1px solid rgba(255,255,255,0.35)",marginTop:"4px",paddingTop:"10px",position:"relative",zIndex:2},children:[t.jsx("button",{onClick:at=>{at.stopPropagation(),ce==null||ce(z)},style:{...be.btnSecondary,flex:1,fontSize:"0.85rem",padding:"10px",fontWeight:"700",background:"rgba(255,255,255,0.35)",border:"2px solid rgba(255,255,255,0.7)",color:"white",borderRadius:"10px"},children:"âï¸ Modifier"}),t.jsx("button",{onClick:at=>{at.stopPropagation(),ve==null||ve(z.id)},style:{...be.btnSecondary,flex:1,fontSize:"0.85rem",padding:"10px",fontWeight:"700",color:"#FFCCCC",background:"rgba(255,200,200,0.2)",border:"2px solid rgba(255,200,200,0.6)",borderRadius:"10px"},children:"ðï¸ Supprimer"})]})]})},Ie=({booking:z,isProvider:Y})=>{var Xe,tt;const ce=wF[z.status]||{label:z.status,color:"#888",emoji:"â"},ve=Y?z.client:z.provider,pe=z._rated,$e=n?{background:"linear-gradient(135deg, #26A69A, #00796B)",border:"2px solid #00695C",boxShadow:"0 4px 16px rgba(0,105,92,0.25)"}:{};return t.jsxs("div",{style:{...be.card,cursor:"default",padding:"18px",...$e},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"},children:[t.jsxs("span",{style:{...be.badge(ce.color),...n?{background:"rgba(255,255,255,0.2)",color:"white",border:"1px solid rgba(255,255,255,0.4)"}:{}},children:[ce.emoji," ",ce.label]}),t.jsxs("span",{style:{fontWeight:"800",color:n?"white":"#4DD0E1",fontSize:"1.05rem"},children:[z.price_meetips," ",t.jsx(Jt,{size:16})]})]}),t.jsx("h4",{style:{margin:"0 0 8px",fontSize:"1.05rem",fontWeight:"700",color:"white"},children:((Xe=z.service)==null?void 0:Xe.title)||"Service"}),t.jsxs("div",{onClick:()=>{const gt=Y?z.client_id:z.provider_id;gt&&ue(gt)},style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"14px",padding:"8px 12px",background:n?"rgba(255,255,255,0.15)":"rgba(255,255,255,0.04)",borderRadius:"10px",cursor:"pointer",transition:"background 0.2s",border:n?"1px solid rgba(255,255,255,0.25)":"none"},children:[ve&&t.jsx("img",{src:ve.friend_avatar_url||ve.avatar_url||"",alt:"",style:{width:"26px",height:"26px",borderRadius:"50%",objectFit:"cover",border:"2px s
2676olid rgba(255,255,255,0.4)"}}),t.jsxs("div",{style:{flex:1},children:[t.jsx("span",{style:{fontSize:"0.7rem",color:n?"rgba(255,255,255,0.7)":"rgba(255,255,255,0.4)",display:"block"},children:Y?"Client":"Prestataire"}),t.jsx("span",{style:{fontSize:"0.85rem",color:n?"white":"rgba(255,255,255,0.8)",fontWeight:"600"},children:(ve==null?void 0:ve.name)||"?"})]}),t.jsx(En,{size:14,style:{color:n?"rgba(255,255,255,0.5)":"rgba(255,255,255,0.2)",flexShrink:0}})]}),((tt=z.service)==null?void 0:tt.available_slots)&&z.service.available_slots.length>0&&t.jsxs("div",{style:{marginBottom:"12px",padding:"8px 12px",background:n?"rgba(255,255,255,0.15)":"rgba(38,166,154,0.06)",borderRadius:"10px",border:n?"1px solid rgba(255,255,255,0.25)":"1px solid rgba(38,166,154,0.12)"},children:[t.jsxs("div",{style:{fontSize:"0.7rem",fontWeight:"700",color:n?"white":"#4DD0E1",marginBottom:"5px",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(Pn,{size:11})," Créneaux demandés"]}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"5px"},children:z.service.available_slots.map((gt,at)=>t.jsxs("span",{style:{fontSize:"0.72rem",color:n?"rgba(255,255,255,0.9)":"rgba(255,255,255,0.6)",background:n?"rgba(255,255,255,0.15)":"rgba(255,255,255,0.06)",padding:"3px 8px",borderRadius:"6px",display:"inline-flex",alignItems:"center",gap:"4px"},children:["ð ",gt.day," ",gt.start||gt.startTime," â ",gt.end||gt.endTime]},at))})]}),t.jsxs("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:[["pending","confirmed","completed"].includes(z.status)&&z.service&&t.jsx("button",{onClick:()=>$({...z.service,_openChat:!0}),style:{...be.btnSecondary,fontSize:"0.8rem",display:"flex",alignItems:"center",gap:"6px",...n?{background:"rgba(255,255,255,0.2)",color:"white",border:"1px solid rgba(255,255,255,0.4)"}:{color:"#4DD0E1",borderColor:"rgba(77,208,225,0.3)",background:"rgba(77,208,225,0.08)"}},children:"ð¬ Discuter"}),Y&&z.status==="pending"&&t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:()=>rt(z.id),style:{...be.btnSecondary,fontSize:"0.8rem",...n?{background:"rgba(255,255,255,0.2)",color:"white",border:"1px solid rgba(255,255,255,0.4)"}:{color:"#22C55E",borderColor:"rgba(34,197,94,0.3)",background:"rgba(34,197,94,0.08)"}},children:"â Confirmer"}),t.jsx("button",{onClick:()=>ft(z.id),style:{...be.btnSecondary,fontSize:"0.8rem",...n?{background:"rgba(255,255,255,0.2)",color:"#FFD0D0",border:"1px solid rgba(255,255,255,0.4)"}:{color:"#EF4444",borderColor:"rgba(239,68,68,0.2)",background:"rgba(239,68,68,0.06)"}},children:"â Refuser"})]}),Y&&z.status==="confirmed"&&t.jsx("button",{onClick:()=>Fe(z.id),style:{...be.btnSecondary,fontSize:"0.8rem",...n?{background:"rgba(255,255,255,0.2)",color:"white",border:"1px solid rgba(255,255,255,0.4)"}:{color:"#26A69A",borderColor:"rgba(38,166,154,0.3)",background:"rgba(38,166,154,0.08)"}},children:"ð Terminé"}),!Y&&z.status==="pending"&&t.jsx("button",{onClick:()=>ft(z.id),style:{...be.btnSecondary,fontSize:"0.8rem",...n?{background:"rgba(255,255,255,0.2)",color:"#FFD0D0",border:"1px solid rgba(255,255,255,0.4)"}:{color:"#EF4444",borderColor:"rgba(239,68,68,0.2)",background:"rgba(239,68,68,0.06)"}},children:"Annuler"}),!Y&&z.status==="completed"&&!pe&&t.jsx("button",{onClick:()=>ee(z),style:{...be.btnSecondary,fontSize:"0.8rem",...n?{background:"rgba(255,255,255,0.2)",color:"white",border:"1px solid rgba(255,255,255,0.4)"}:{color:"#F59E0B",borderColor:"rgba(245,158,11,0.3)",background:"rgba(245,158,11,0.08)"}},children:"â Noter"})]}),z.release_at&&z.status==="completed"&&t.jsxs("div",{style:{marginTop:"10px",fontSize:"0.72rem",color:n?"rgba(255,255,255,0.7)":"rgba(255,255,255,0.35)",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(Pn,{size:12})," Paiement: ",new Date(z.release_at).toLocaleString("fr-FR",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"})]})]})};return i!=="FRIEND"?null:t.jsxs("div",{style:be.page,children:[t.jsx("style",{children:` 2677 @keyframes spin { to { transform: rotate(360deg); } } 2678 @keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } } 2679 .entraide-card:hover { border-color: rgba(38,166,
2679154,0.3) !important; transform: translateY(-3px) !important; box-shadow: 0 8px 32px rgba(38,166,154,0.12) !important; } 2680 .entraide-search:focus { border-color: rgba(38,166,154,0.4) !important; box-shadow: 0 0 0 3px rgba(38,166,154,0.1) !important; } 2681 .entraide-fab:hover { transform: scale(1.08) !important; } 2682 .entraide-fab:active { transform: scale(0.95) !important; } 2683 .cat-strip { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; -webkit-overflow-scrolling: touch; scrollbar-width: none; } 2684 .cat-strip::-webkit-scrollbar { display: none; } 2685 `}),t.jsxs("div",{style:be.container,children:[t.jsxs("div",{style:be.header,children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[t.jsx("div",{style:{fontSize:"1.8rem"},children:"ð¤"}),t.jsxs("div",{children:[t.jsx("h1",{style:be.title,children:"Entraide"}),t.jsxs("p",{style:be.subtitle,children:["Proposez ou trouvez un service entre membres.",t.jsx("br",{}),"Tout se paie en Meetips ",t.jsx(Jt,{size:14})]})]})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 14px",background:"rgba(38,166,154,0.12)",borderRadius:"10px",border:"1px solid rgba(38,166,154,0.2)"},children:[t.jsx(Jt,{size:18}),t.jsx("span",{style:{fontWeight:"800",fontSize:"0.95rem",color:"#4DD0E1"},children:ne})]})]}),t.jsx("div",{className:"entraide-tabs",style:be.tabs,children:jF.map(z=>t.jsxs("button",{onClick:()=>{mr(),p(z.id),Ce(null)},style:be.tabBtn(d===z.id),children:[z.emoji," ",z.label,z.id==="requests"&&le.reduce((Y,ce)=>{var ve;return Y+(((ve=ce.responses)==null?void 0:ve.length)||0)},0)>0&&t.jsx("span",{style:{background:"#F59E0B",color:"white",borderRadius:"50%",width:"18px",height:"18px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.65rem",fontWeight:"800",marginLeft:"2px"},children:le.reduce((Y,ce)=>{var ve;return Y+(((ve=ce.responses)==null?void 0:ve.length)||0)},0)}),z.id==="my-bookings"&&S.filter(Y=>Y.status==="pending").length>0&&t.jsx("span",{style:{background:"#EF4444",color:"white",borderRadius:"50%",width:"18px",height:"18px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.65rem",fontWeight:"800",marginLeft:"2px"},children:S.filter(Y=>Y.status==="pending").length})]},z.id))}),w?t.jsxs("div",{style:{textAlign:"center",padding:"60px 0",color:"rgba(255,255,255,0.4)"},children:[t.jsx("div",{style:{fontSize:"2rem",marginBottom:"10px",animation:"spin 1s linear infinite"},children:"â³"}),"Chargement..."]}):t.jsxs(t.Fragment,{children:[d==="explore"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{position:"relative",marginBottom:"12px"},children:[t.jsx(qo,{size:16,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:"rgba(255,255,255,0.25)"}}),t.jsx("input",{className:"entraide-search",type:"text",placeholder:"Rechercher un service...",value:P,onChange:z=>I(z.target.value),style:{...be.input,paddingLeft:"38px",background:"rgba(255,255,255,0.04)",borderColor:"rgba(255,255,255,0.08)"}})]}),t.jsxs("div",{className:"cat-strip",children:[t.jsx("button",{onClick:()=>T(null),style:{...be.btnSecondary,fontSize:"0.78rem",padding:"8px 18px",borderRadius:"20px",whiteSpace:"nowrap",flexShrink:0,background:j?n?"rgba(140,115,75,0.08)":"rgba(255,255,255,0.15)":"rgba(38,166,154,0.3)",borderColor:j?n?"rgba(120,100,60,0.5)":"rgba(255,255,255,0.3)":"#26A69A",color:j?n?"#2A2520":"rgba(255,255,255,0.85)":n?"#00796B":"#4DD0E1",fontWeight:"700",border:j?n?"2px solid rgba(120,100,60,0.5)":void 0:n?"2.5px solid #00796B":void 0},children:"Tous"}),qa.map(z=>t.jsxs("button",{onClick:()=>T(j===z.id?null:z.id),style:{...be.btnSecondary,fontSize:"0.78rem",padding:"8px 18px",borderRadius:"20px",whiteSpace:"nowrap",flexShrink:0,background:j===z.id?`${z.color}35`:n?"rgba(140,115,75,0.08)":"rgba(255,255,255,0.15)",borderColor:j===z.id?`${z.color}`:n?"rgba(120,100,60,0.5)":"rgba(255,255,255,0.3)",color:j===z.id?z.color:n?"#2A2520":"rgba(255,255,255,0.85)",fontWeight:"700",border:n?j===z.id?`2.5px solid ${z.color}
2685`:"2px solid rgba(120,100,60,0.5)":void 0},children:[z.emoji," ",z.label]},z.id))]}),(()=>{const z=Q.filter(ce=>ce.requester_id!==(l==null?void 0:l.id)),Y=[...u.map(ce=>({...ce,_type:"service",_sortDate:ce.created_at})),...z.map(ce=>({...ce,_type:"request",_sortDate:ce.created_at}))].sort((ce,ve)=>new Date(ve._sortDate)-new Date(ce._sortDate));return Y.length===0?t.jsxs("div",{style:{textAlign:"center",padding:"60px 0",color:"rgba(255,255,255,0.3)"},children:[t.jsx("div",{style:{fontSize:"3.5rem",marginBottom:"14px",opacity:.6},children:"ð"}),t.jsx("p",{style:{fontWeight:"600",marginBottom:"4px"},children:"Aucun service ou demande trouvé"}),t.jsx("p",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.25)"},children:"Soyez le premier à proposer un service !"})]}):t.jsx("div",{style:be.grid,children:Y.map(ce=>{var gt,at,Pt,vt;if(ce._type==="service")return t.jsx(J,{svc:ce},`svc-${ce.id}`);const ve=Be(ce.category),pe=re(ve.color,.7),$e=re(ve.color,.5),Xe=((gt=ce.responses)==null?void 0:gt.length)||0,tt=((at=ce.requester)==null?void 0:at.friend_avatar_url)||((Pt=ce.requester)==null?void 0:Pt.avatar_url);return t.jsxs("div",{className:"entraide-card entraide-colored",style:{...be.card,background:`linear-gradient(135deg, ${pe}, ${$e})`,border:`2px solid ${re(ve.color,.4)}`,boxShadow:`0 4px 16px ${$e}40`,position:"relative",overflow:"hidden"},onClick:()=>X(ce),children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:"5px",background:`linear-gradient(180deg, ${ve.color}, ${re(ve.color,.3)})`,zIndex:3}}),t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"55%",background:"linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.04) 50%, transparent 100%)",borderRadius:"14px 14px 0 0",pointerEvents:"none",zIndex:1}}),t.jsx("div",{style:{position:"absolute",top:"8px",right:"8px",background:"rgba(245,158,11,0.3)",border:"1px solid rgba(245,158,11,0.6)",borderRadius:"8px",padding:"2px 8px",fontSize:"0.62rem",fontWeight:"800",color:"#FCD34D",zIndex:3},children:"ð Demande"}),t.jsxs("div",{style:{padding:"14px 14px 14px 18px",position:"relative",zIndex:2},children:[t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"5px",padding:"2px 8px",borderRadius:"6px",fontSize:"0.68rem",fontWeight:"700",background:"rgba(255,255,255,0.25)",color:"white",border:"1px solid rgba(255,255,255,0.5)",marginBottom:"8px"},children:[ve.emoji," ",ve.label]}),t.jsx("h3",{style:{margin:"6px 0 4px",fontSize:"1.05rem",fontWeight:"800",color:"#F5F5F5",textTransform:"uppercase",letterSpacing:"0.5px",textShadow:"0 1px 4px rgba(0,0,0,0.3)",lineHeight:1.2},children:ce.title}),ce.description&&t.jsx("p",{style:{margin:"0 0 10px",fontSize:"0.8rem",color:"rgba(255,255,255,0.85)",lineHeight:1.3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:ce.description}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[tt&&t.jsx("img",{src:tt,alt:"",style:{width:"20px",height:"20px",borderRadius:"50%",objectFit:"cover",border:"1px solid rgba(255,255,255,0.4)"}}),t.jsx("span",{style:{fontSize:"0.72rem",color:"white",fontWeight:"600"},children:((vt=ce.requester)==null?void 0:vt.name)||"Membre"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontSize:"0.7rem",color:"rgba(255,255,255,0.7)"},children:[ce.city&&t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"3px"},children:[t.jsx(ur,{size:11})," ",ce.city]}),t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"3px"},children:["ð¬ ",Xe]})]})]})]})]},`req-${ce.id}`)})})})()]}),d==="my-services"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[t.jsxs("div",{children:[t.jsxs("h2",{style:{margin:0,fontSize:"1.1rem",fontWeight:"700"},children:["Mes offres (",h.length,")"]}),t.jsx("p",{style:{margin:"2px 0 0",fontSize:"0.72rem",color:"rgba(255,255,255,0.35)"},children:"Les services que vous proposez à la communauté"})]}),t.jsxs("button",{onClick:()=>{K(null),O(!0)},style:{...be.btnSecondary,display:"flex",alignItems:"center",gap:"6px",color:"#26A69A",borderColor:"rgba(38,166,
2685154,0.3)"},children:[t.jsx(No,{size:16})," Proposer"]})]}),h.length===0?t.jsxs("div",{style:{textAlign:"center",padding:"50px 0",color:"rgba(255,255,255,0.3)"},children:[t.jsx("div",{style:{fontSize:"3rem",marginBottom:"12px"},children:"ð¦"}),t.jsx("p",{children:"Vous n'avez pas encore de services"}),t.jsx("button",{onClick:()=>O(!0),style:{...be.btnPrimary,width:"auto",marginTop:"10px"},children:"+ Proposez votre service"})]}):t.jsx("div",{style:be.grid,children:h.map(z=>t.jsx(J,{svc:z,showActions:!0,onEdit:Y=>{K(Y),O(!0)},onDelete:De},z.id))})]}),d==="my-bookings"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:"flex",gap:"6px",marginBottom:"16px",background:n?"rgba(140,115,75,0.06)":"rgba(255,255,255,0.06)",borderRadius:"12px",padding:"5px",border:n?"2px solid rgba(140,115,75,0.3)":"1px solid rgba(255,255,255,0.1)",backdropFilter:"blur(20px)",boxShadow:n?"0 2px 8px rgba(120,100,60,0.08)":"inset 0 1px 0 rgba(255,255,255,0.08), 0 4px 16px rgba(0,0,0,0.15)"},children:[t.jsxs("button",{onClick:()=>ke("received"),style:{flex:1,padding:"10px 12px",borderRadius:"10px",border:xe==="received"?n?"2px solid #00796B":"1px solid rgba(77,208,225,0.3)":n?"1.5px solid rgba(140,115,75,0.2)":"1px solid transparent",fontSize:"0.78rem",fontWeight:xe==="received"?"700":"500",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",transition:"all 0.25s",background:xe==="received"?n?"linear-gradient(135deg, #26A69A, #00897B)":"rgba(38,166,154,0.18)":n?"rgba(140,115,75,0.06)":"rgba(255,255,255,0.04)",color:xe==="received"?n?"white":"#4DD0E1":n?"#2A2520":"rgba(255,255,255,0.5)",boxShadow:xe==="received"?n?"0 3px 12px rgba(0,121,107,0.3)":"0 2px 12px rgba(38,166,154,0.2), inset 0 1px 0 rgba(255,255,255,0.1)":"none"},children:["ð¥ Demandes reçues ",S.filter(z=>z.status==="pending").length>0&&t.jsx("span",{style:{background:"rgba(239,68,68,0.25)",color:"#f87171",padding:"1px 7px",borderRadius:"10px",fontSize:"0.7rem",fontWeight:"800"},children:S.filter(z=>z.status==="pending").length})]}),t.jsxs("button",{onClick:()=>ke("mine"),style:{flex:1,padding:"10px 12px",borderRadius:"10px",border:xe==="mine"?n?"2px solid #00796B":"1px solid rgba(77,208,225,0.3)":n?"1.5px solid rgba(140,115,75,0.2)":"1px solid transparent",fontSize:"0.78rem",fontWeight:xe==="mine"?"700":"500",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",transition:"all 0.25s",background:xe==="mine"?n?"linear-gradient(135deg, #26A69A, #00897B)":"rgba(38,166,154,0.18)":n?"rgba(140,115,75,0.06)":"rgba(255,255,255,0.04)",color:xe==="mine"?n?"white":"#4DD0E1":n?"#2A2520":"rgba(255,255,255,0.5)",boxShadow:xe==="mine"?n?"0 3px 12px rgba(0,121,107,0.3)":"0 2px 12px rgba(38,166,154,0.2), inset 0 1px 0 rgba(255,255,255,0.1)":"none"},children:["ð¤ Mes réservations ",y.filter(z=>z.status==="pending").length>0&&t.jsx("span",{style:{background:"rgba(239,68,68,0.25)",color:"#f87171",padding:"1px 7px",borderRadius:"10px",fontSize:"0.7rem",fontWeight:"800"},children:y.filter(z=>z.status==="pending").length})]})]}),xe==="received"&&(S.length===0?t.jsxs("div",{style:{textAlign:"center",padding:"40px 0",color:"rgba(255,255,255,0.3)"},children:[t.jsx("div",{style:{fontSize:"2.5rem",marginBottom:"8px"},children:"ð¥"}),t.jsx("p",{children:"Aucune demande reçue"})]}):t.jsx("div",{style:be.grid,children:S.map(z=>t.jsx(Ie,{booking:z,isProvider:!0},z.id))})),xe==="mine"&&(y.length===0?t.jsxs("div",{style:{textAlign:"center",padding:"40px 0",color:"rgba(255,255,255,0.3)"},children:[t.jsx("div",{style:{fontSize:"2.5rem",marginBottom:"8px"},children:"ð¤"}),t.jsx("p",{children:"Aucune réservation"})]}):t.jsx("div",{style:be.grid,children:y.map(z=>t.jsx(Ie,{booking:{...z,_rated:!1},isProvider:!1},z.id))}))]}),d==="requests"&&t.jsxs(t.Fragment,{children:[!Pe&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"14px",animation:"fadeUp 0.35s ease-out"},children:[t.jsx("p",{style:{fontSize:"0.82rem",color:n?"rgba(60,50,35,0.6)":"rgba(255,255,255,0.45)",textAlign:"center",margin:"8px 0 4px",lineHeight:"1.5"},children:"Besoin d'un coup de main ? Ou envie d'aider quelqu'un près de chez vous ?"}),t.jsxs("div",{onClick:()=>Ce("ask"),className:"entraide-card",style:{...be.card,padding:"24px",cursor:"pointer",background:n?"linear-gradient(135deg, #F59E0B, #E8850A)":"linear-gradient(135deg, rgba(245,158,11,0.08), rgba(217,119,6,0.04))",border:n?"2px solid #D97706":"1px solid rgba(245,158,11,0.2)",display:"flex",alignItems:"center",gap:"16px"},children:[t.jsx("div",{style:{width:"56px",height:"56px",borderRadius:"16px",flexShrink:0,background:n?"rgba(255,255,255,0.3)":"rgba(245,158,11,0.15)",border:n?"2px solid rgba(255,255,255,0.5)":"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.6rem"},children:"ð"}),t.jsxs("div",{style:{flex:1},children:[t.jsx("h3",{style:{margin:"0 0 4px",fontSize:"1.05rem",fontWeight:"800",color:n?"white":"#F59
2685E0B"},children:"Demander de l'aide"}),t.jsx("p",{style:{margin:0,fontSize:"0.78rem",color:n?"rgba(255,255,255,0.9)":"rgba(255,255,255,0.45)",lineHeight:"1.4"},children:"Publiez votre demande et recevez des propositions de membres proches de chez vous."}),le.length>0&&t.jsxs("span",{style:{display:"inline-block",marginTop:"8px",padding:"3px 10px",borderRadius:"8px",background:n?"rgba(255,255,255,0.25)":"rgba(245,158,11,0.12)",color:n?"white":"#F59E0B",fontSize:"0.7rem",fontWeight:"700",border:n?"1px solid rgba(255,255,255,0.4)":"none"},children:[le.length," demande",le.length>1?"s":""," en cours"]})]}),t.jsx(En,{size:20,color:n?"rgba(255,255,255,0.7)":"rgba(245,158,11,0.5)"})]}),t.jsxs("div",{onClick:()=>Ce("help"),className:"entraide-card",style:{...be.card,padding:"24px",cursor:"pointer",background:n?"linear-gradient(135deg, #26A69A, #00897B)":"linear-gradient(135deg, rgba(38,166,154,0.08), rgba(0,137,123,0.04))",border:n?"2px solid #00796B":"1px solid rgba(38,166,154,0.2)",display:"flex",alignItems:"center",gap:"16px"},children:[t.jsx("div",{style:{width:"56px",height:"56px",borderRadius:"16px",flexShrink:0,background:n?"rgba(255,255,255,0.3)":"rgba(38,166,154,0.15)",border:n?"2px solid rgba(255,255,255,0.5)":"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.6rem"},children:"ð¤"}),t.jsxs("div",{style:{flex:1},children:[t.jsx("h3",{style:{margin:"0 0 4px",fontSize:"1.05rem",fontWeight:"800",color:n?"white":"#4DD0E1"},children:"Aidez les membres"}),t.jsx("p",{style:{margin:0,fontSize:"0.78rem",color:n?"rgba(255,255,255,0.9)":"rgba(255,255,255,0.45)",lineHeight:"1.4"},children:"Découvrez qui a besoin d'aide près de chez vous et proposez vos compétences."}),Q.filter(z=>z.requester_id!==(l==null?void 0:l.id)).length>0&&t.jsxs("span",{style:{display:"inline-block",marginTop:"8px",padding:"3px 10px",borderRadius:"8px",background:n?"rgba(255,255,255,0.25)":"rgba(38,166,154,0.12)",color:n?"white":"#4DD0E1",fontSize:"0.7rem",fontWeight:"700",border:n?"1px solid rgba(255,255,255,0.4)":"none"},children:[Q.filter(z=>z.requester_id!==(l==null?void 0:l.id)).length," demande",Q.filter(z=>z.requester_id!==(l==null?void 0:l.id)).length>1?"s":""," à proximité"]})]}),t.jsx(En,{size:20,color:n?"rgba(255,255,255,0.7)":"rgba(38,166,154,0.5)"})]})]}),Pe==="ask"&&t.jsxs("div",{style:{animation:"fadeUp 0.3s ease-out"},children:[t.jsxs("button",{onClick:()=>Ce(null),style:{...be.btnSecondary,display:"flex",alignItems:"center",gap:"6px",marginBottom:"16px",padding:"8px 14px",fontSize:"0.78rem"},children:[t.jsx(Hr,{size:14})," Retour"]}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[t.jsxs("div",{children:[t.jsx("h3",{style:{fontSize:"1.05rem",fontWeight:"700",margin:0,color:"#F59E0B"},children:"ð Mes demandes d'aide"}),t.jsx("p",{style:{margin:"2px 0 0",fontSize:"0.72rem",color:"rgba(255,255,255,0.35)"},children:"Publiez une demande et attendez les propositions"})]}),t.jsxs("button",{onClick:()=>H(!0),style:{...be.btnPrimary,width:"auto",padding:"10px 18px",display:"flex",alignItems:"center",gap:"8px",background:"linear-gradient(135deg, #F59E0B, #D97706)",fontSize:"0.82rem",fontWeight:"800",boxShadow:"0 4px 15px rgba(245,158,11,0.35)",borderRadius:"14px"},children:[t.jsx(No,{size:16})," Nouvelle demande"]})]}),le.length===0?t.jsxs("div",{style:{textAlign:"center",padding:"50px 0",color:"rgba(255,255,255,0.3)"},children:[t.jsx("div",{style:{fontSize:"3rem",marginBottom:"12px"},children:"ð"}),t.jsx("p",{style:{fontWeight:"600",marginBottom:"6px"},children:"Vous n'avez pas encore de demande"}),t.jsx("p",{style:{fontSize:"0.78rem",color:"rgba(255,255,255,0.25)"},children:"Créez votre première demande d'aide !"})]}):t.jsx("div",{style:be.grid,children:le.map(z=>{var ve;const Y=Be(z.category),ce=((ve=z.responses)==null?void 0:ve.length)||0;return t.jsxs("div",{className:"entraide-card entraide-colored",style:{...be.card,cursor:"pointer",padding:"18px",animation:"fadeUp 0.4s ease-out",background:`linear-gradient(135deg, ${re(Y.color,.7)}, ${re(Y.color,.5)})`,border:`2px solid ${re(Y.color,.4)}`,boxShadow:`0 4px 16px ${re(Y.color,.5)}40`,position:"relative",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"55%",background:"linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.04) 50%, transparent 100%)",borderRadius:"14px 14px 0 0",pointerEvents:"none",zIndex:1}}),t.jsxs("div",{style:{position:"relative",zIndex:2},onClick:()=>Ae(z),children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"10px"},children:[t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"5px",padding:"5px 12px",borderRadius:"10px",fontSize:"0.78rem",fontWeight:"700",background:"rgba(255,255,255,0.25)",color:"white",border:"1px solid rgba(255,255,255,0.5)"},children:[Y.emoji," ",Y.label]}),t.jsx("span",{style:{fontSize:"0.72rem",padding:"4px 10px",borderRadius:"8px",fontWeight:"700",background:z.status==="open"?"rgba(34,197,94,0.25)":"rgba(255,255,255,0.15)",color:z.status==="open"?"#4ADE80":"rgba(255,255,255,0.6)",border:`1px solid ${z.status==="open"?"rgba(34,197,94,0.5)":"rgba(255,255,255,0.2)"}`},children:z.status==="open"?"ð¢ Ouverte":"â
Résolue"})]}),t.jsx("h4",{style:{margin:"0 0 6px",fontSize:"1rem",fontWeight:"800",color:"#F5F5F5",textTransform:"uppercase",letterSpacing:"0.5px",textShadow:"0 1px 4px rgba(0,0,0,0.3)"},children:z.title}),z.description&&t.jsx("p",{style:{margin:"0 0 10px",fontSize:"0.82rem",color:"rgba(255,255,255,0.85)",lineHeight:1.4},children:z.description}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",fontSize:"0.78rem",color:"rgba(255,255,255,0.7)"},children:[z.city&&t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(ur,{size:12})," ",z.city]}),t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"4px",color:ce>0?"#4DD0E1":"rgba(255,255,255,0.5)"},children:["ð¬ ",ce," réponse",ce!==1?"s":""]})]})]}),t.jsxs("div",{style:{display:"flex",gap:"8px",marginTop:"12px",borderTop:"1px solid rgba(255,255,255,0.2)",paddingTop:"12px",position:"relative",zIndex:2},children:[t.jsx("button",{onClick:pe=>{pe.stopPropagation(),Z(z),H(!0)},style:{flex:1,padding:"9px",borderRadius:"10px",fontSize:"0.82rem",fontWeight:"700",background:"rgba(255,255,255,0.25)",border:"2px s
2685olid rgba(255,255,255,0.5)",color:"white",cursor:"pointer"},children:"âï¸ Modifier"}),t.jsx("button",{onClick:async pe=>{if(pe.stopPropagation(),!window.confirm("Supprimer cette demande ?"))return;const $e=await Ar.deleteRequest(z.id);$e.success?(o.success("Demande supprimée"),Me()):o.error($e.error)},style:{flex:1,padding:"9px",borderRadius:"10px",fontSize:"0.82rem",fontWeight:"700",background:"rgba(255,200,200,0.2)",border:"2px solid rgba(255,200,200,0.5)",color:"#FFCCCC",cursor:"pointer"},children:"ðï¸ Supprimer"})]})]},z.id)})})]}),Pe==="help"&&t.jsxs("div",{style:{animation:"fadeUp 0.3s ease-out"},children:[t.jsxs("button",{onClick:()=>Ce(null),style:{...be.btnSecondary,display:"flex",alignItems:"center",gap:"6px",marginBottom:"16px",padding:"8px 14px",fontSize:"0.78rem"},children:[t.jsx(Hr,{size:14})," Retour"]}),t.jsxs("div",{style:{marginBottom:"16px"},children:[t.jsx("h3",{style:{fontSize:"1.05rem",fontWeight:"700",margin:"0 0 4px",color:"#4DD0E1"},children:"ð¤ Aidez les membres"}),t.jsx("p",{style:{margin:"0 0 14px",fontSize:"0.72rem",color:"rgba(255,255,255,0.35)"},children:"Découvrez qui a besoin d'aide autour de vous"})]}),t.jsxs("div",{style:{display:"flex",gap:"10px",marginBottom:"12px",alignItems:"center"},children:[t.jsxs("div",{style:{flex:1,position:"relative"},children:[t.jsx(ur,{size:16,style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:"rgba(255,255,255,0.3)"}}),t.jsx("input",{value:A,onChange:z=>{M(z.target.value)},placeholder:"Filtrer par ville...",className:"entraide-search",style:{...be.input,paddingLeft:"36px",fontSize:"0.88rem"}})]}),t.jsxs("button",{onClick:()=>Ar.getRequests({city:A,category:j}).then(z=>G(z.data||[])),style:{...be.btnSecondary,padding:"10px 16px",display:"flex",alignItems:"center",gap:"6px",whiteSpace:"nowrap"},children:[t.jsx(yS,{size:14})," Filtrer"]})]}),t.jsxs("div",{className:"cat-strip",style:{marginBottom:"16px"},children:[t.jsx("button",{onClick:()=>{T(null),Ar.getRequests({city:A}).then(z=>G(z.data||[]))},style:{...be.btnSecondary,fontSize:"0.74rem",padding:"7px 16px",borderRadius:"20px",whiteSpace:"nowrap",flexShrink:0,background:j?"rgba(255,255,255,0.1)":"rgba(38,166,154,0.3)",borderColor:j?"rgba(255,255,255,0.2)":"rgba(38,166,154,0.7)",color:j?"rgba(255,255,255,0.7)":"#4DD0E1",fontWeight:"700"},children:"Toutes"}),qa.map(z=>t.jsxs("button",{onClick:()=>{T(z.id),Ar.getRequests({category:z.id,city:A}).then(Y=>G(Y.data||[]))},style:{...be.btnSecondary,fontSize:"0.74rem",padding:"7px 16px",borderRadius:"20px",whiteSpace:"nowrap",flexShrink:0,background:j===z.id?`${z.color}30`:"rgba(255,255,255,0.1)",borderColor:j===z.id?`${z.color}70`:"rgba(255,255,255,0.2)",color:j===z.id?z.color:"rgba(255,255,255,0.7)",fontWeight:"700"},children:[z.emoji," ",z.label]},z.id))]}),Q.filter(z=>z.requester_id!==(l==null?void 0:l.id)).length===0?t.jsxs("div",{style:{textAlign:"center",padding:"50px 0",color:"rgba(255,255,255,0.3)"},children:[t.jsx("div",{style:{fontSize:"3rem",marginBottom:"12px"},children:"ð¤·"}),t.jsx("p",{children:"Aucune demande d'aide pour le moment"})]}):t.jsx("div",{style:be.grid,children:Q.filter(z=>z.requester_id!==(l==null?void 0:l.id)).map(z=>{var pe,$e,Xe,tt;const Y=Be(z.category),ce=((pe=z.responses)==null?void 0:pe.length)||0,ve=(($e=z.requester)==null?void 0:$e.friend_avatar_url)||((Xe=z.requester)==null?void 0:Xe.avatar_url);return t.jsxs("div",{className:"entraide-card entraide-colored",style:{...be.card,padding:"18px",animation:"fadeUp 0.4s ease-out",background:`linear-gradient(135deg, ${re(Y.color,.7)}, ${re(Y.color,.5)})`,border:`2px solid ${re(Y.color,.4)}`,boxShadow:`0 4px 16px ${re(Y.color,.5)}40`,position:"relative",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"55%",background:"linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.04) 50%, transparent 100%)",borderRadius:"14px 14px 0 0",pointerEvents:"none",zIndex:1}}),t.jsx("div",{style:{position:"absolute",top:"10px",right:"10px",background:"rgba(34,197,94,0.25)",border:"1px solid rgba(34,197,94,0.5)",borderRadius:"8px",padding:"3px 10px",fontSize:"0.65rem",fontWeight:"800",color:"#4ADE80",zIndex:3,display:"flex",alignItems:"center",gap:"4px"},children:"ð¢ Ouverte"}),t.jsxs("div",{style:{position:"relative",zIndex:2},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"10px"},children:[t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"5px",padding:"5px 12px",borderRadius:"10px",fontSize:"0.78rem",fontWeight:"700",background:"rgba(255,255,255,0.25)",color:"white",border:"1px solid rgba(255,255,255,0.5)"},children:[Y.emoji," ",Y.label]}),t.jsx("span",{style:{fontSize:"0.68rem",color:"rgba(255,255,255,0.6)"},children:new Date(z.created_at).toLocaleDateString("fr-FR",{day:"numeric",month:"short"})})]}),t.jsx("h4",{style:{margin:"0 0 6px",fontSize:"1rem",fontWeight:"800",color:"#F5F5F5",textTransform:"uppercase",letterSpacing:"0.5px",textShadow:"0 1px 4px rgba(0,0,0,0.3)"},children:z.title}),z.description&&t.jsx("p",{style:{margin:"0 0 12px",fontSize:"0.82rem",color:"rgba(255,255,255,0.85)",lineHeight:1.4},children:z.description}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"14px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[ve&&t.jsx("img",{src:ve,alt:"",style:{width:"26px",height:"26px",borderRadius:"50%",objectFit:"cover",border:"2px s
2685olid rgba(255,255,255,0.4)"}}),t.jsx("span",{style:{fontSize:"0.78rem",color:"white",fontWeight:"600"},children:((tt=z.requester)==null?void 0:tt.name)||"Membre"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"0.75rem",color:"rgba(255,255,255,0.7)"},children:[z.city&&t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"3px"},children:[t.jsx(ur,{size:11})," ",z.city]}),t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"3px"},children:["ð¬ ",ce]})]})]}),t.jsx("button",{onClick:()=>X(z),style:{...be.btnPrimary,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",fontSize:"0.88rem",padding:"11px",background:"rgba(255,255,255,0.25)",border:"2px solid rgba(255,255,255,0.5)"},children:"ð¤ Répondre à cette demande"})]})]},z.id)})})]})]})]})]}),d==="explore"&&t.jsx("button",{className:"entraide-fab",onClick:()=>{K(null),O(!0)},style:be.fab,children:t.jsx(No,{size:24})}),d==="requests"&&t.jsx("button",{className:"entraide-fab",onClick:()=>H(!0),style:{...be.fab,background:"linear-gradient(135deg, #F59E0B, #D97706)"},children:t.jsx(op,{size:24})}),R&&t.jsx(kF,{profile:l,editService:te,onClose:()=>O(!1),onSave:()=>{O(!1),Me()},styles:be,toast:o}),E&&t.jsx(CF,{service:E,profile:l,onClose:()=>$(null),onBook:Le,styles:be,StarRating:nt,getCat:Be,toast:o,onViewProfile:z=>ue(z),lightMode:n,darkenHex:re,lightenHex:He}),B&&t.jsx(zF,{booking:B,profile:l,onClose:()=>ee(null),onRate:()=>{ee(null),Me()},styles:be,StarRating:nt,toast:o}),V&&t.jsx(EF,{profile:l,editRequest:N,onClose:()=>{H(!1),Z(null)},onSave:()=>{H(!1),Z(null),Me()},styles:be,toast:o}),ae&&t.jsx(RF,{request:ae,profile:l,onClose:()=>X(null),onSave:()=>{X(null),Me()},styles:be,toast:o}),he&&t.jsx(IF,{request:he,profile:l,onClose:()=>Ae(null),onAccept:()=>{Ae(null),Me()},styles:be,toast:o,getCat:Be}),ze&&t.jsxs("div",{onClick:()=>ue(null),style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.85)",backdropFilter:"blur(12px)",zIndex:99999,display:"flex",flexDirection:"column",animation:"fadeIn 0.2s ease-out"},children:[t.jsx("div",{style:{display:"flex",justifyContent:"flex-end",padding:"12px 16px",flexShrink:0},children:t.jsx("button",{onClick:()=>ue(null),style:{background:"rgba(255,255,255,0.15)",border:"1px solid rgba(255,255,255,0.2)",borderRadius:"50%",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"white",backdropFilter:"blur(8px)"},children:t.jsx(mt,{size:20})})}),t.jsx("div",{onClick:z=>z.stopPropagation(),style:{flex:1,overflowY:"auto",paddingBottom:"20px"},className:"custom-scrollbar",children:t.jsx(Cp,{userId:ze,onClose:()=>ue(null)})})]})]})},b1=[{label:"Catégorie",emoji:"ð"},{label:"Description",emoji:"âï¸"},{label:"Détails",emoji:"ð"},{label:"Confirmer",emoji:"â
"}],SF=["Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche"],kF=({profile:e,editService:r,onClose:i,onSave:n,styles:o,toast:a})=>{const[l,d]=m.useState(1),[p,u]=m.useState((r==null?void 0:r.category)||""),[g,h]=m.useState((r==null?void 0:r.title)||""),[x,y]=m.useState((r==null?void 0:r.description)||""),[_,S]=m.useState((r==null?void 0:r.price_meetips)||(r==null?void 0:r.price_euros)||20),[k,w]=m.useState((r==null?void 0:r.price_type)||"meetips"),[b,j]=m.useState((r==null?void 0:r.location)||""),[T,P]=m.useState((r==null?void 0:r.image_url)||""),[I,R]=m.useState(!1),[O,E]=m.useState((r==null?void 0:r.available_slots)||[]),[$,B]=m.useState(!1),ee=m.useRef(null),te=async M=>{var H;const V=(H=M.target.files)==null?void 0:H[0];if(V)try{const N=await GP(V);P(N)}catch{a.error("Erreur lors du traitement de l'image")}},K=()=>E(M=>[...M,{day:"Lundi",startTime:"09:00",endTime:"12:00"}]),ne=M=>E(V=>V.filter((H,N)=>N!==M)),Re=(M,V,H)=>E(N=>N.map((Z,ae)=>ae===M?{...Z,[V]:H}:Z)),Q=()=>l===1?p&&g.trim():l===2?!0:l===3?_>=1:!0,G=async()=>{B(!0);let M;const V=O.length>0?O:null;r?M=await Ar.updateService(r.id,{category:p,title:g,description:x,price_meetips:k==="meetips"?_:null,price_euros:k==="euros"?_:null,price_type:k,location:b||null,image_url:T||null,available_slots:V}):M=await Ar.createService({providerId:e.id,category:p,title:g,description:x,priceMeetips:k==="meetips"?_:null,priceEuros:k==="euros"?_:null,priceType:k,location:b,imageUrl:T,availableSlots:V}),B(!1),M.success?(a.success(r?"Service modifié !":"Service publié ! ð"),n()):a.error(M.error)},F=(M=>qa.find(V=>V.id===M)||{label:M,emoji:"ð¦",color:"#888"})(p),A={fontSize:"0.82rem",color:"rgba(255,255,255,0.6)",marginBottom:"8px",display:"block",fontWeight:"600"};return t.jsx("div",{style:o.modal,onClick:i,children:t.jsxs("div",{style:{...o.modalContent,position:"relative"},onClick:M=>M.stopPropagation(),children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"6px"},children:[t.jsx("h2",{style:{margin:0,fontSize:"1.15rem",fontWeight:"700"},children:r?"âï¸ Modifier mon offre":"ð¤ Proposez votre service"}),t.jsx("button",{onClick:i,style:{background:"none",border:"none",color:"rgba(255,255,255,0.5)",cursor:"pointer"},children:t.jsx(mt,{size:20})})]}),t.jsx("div",{style:{display:"flex",alignItems:"center",gap:"0",marginBottom:"24px",padding:"12px 0"},children:b1.map((M,V)=>{const H=V+1,N=l>H,Z=l===H;return t.jsxs(Tr.Fragment,{children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",flex:1,cursor:N?"pointer":"default"},onClick:()=>N&&d(H),children:[t.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"50%",background:N?"linear-gradient(135deg, #26A69A, #00897B)":Z?"rgba(38,166,
2685154,0.2)":"rgba(255,255,255,0.06)",border:Z||N?"2px solid #26A69A":"2px solid rgba(255,255,255,0.1)",display:"flex",alignItems:"center",justifyContent:"center",color:N?"white":Z?"#4DD0E1":"rgba(255,255,255,0.3)",fontSize:"0.8rem",fontWeight:"700",transition:"all 0.3s"},children:N?t.jsx(pr,{size:16}):H}),t.jsx("span",{style:{fontSize:"0.62rem",color:Z?"#4DD0E1":N?"rgba(255,255,255,0.6)":"rgba(255,255,255,0.25)",fontWeight:Z?"700":"500",whiteSpace:"nowrap"},children:M.label})]}),V<b1.length-1&&t.jsx("div",{style:{flex:.6,height:"2px",background:N?"#26A69A":"rgba(255,255,255,0.08)",borderRadius:"1px",transition:"background 0.3s",marginBottom:"16px"}})]},H)})}),l===1&&t.jsxs("div",{style:{animation:"fadeUp 0.3s ease-out"},children:[t.jsx("label",{style:A,children:"Catégorie *"}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",marginBottom:"20px"},children:qa.map(M=>t.jsxs("button",{onClick:()=>u(M.id),style:{padding:"8px 16px",borderRadius:"20px",fontSize:"0.8rem",fontWeight:"700",border:p===M.id?`2px solid ${M.color}`:"2px solid rgba(255,255,255,0.12)",background:p===M.id?`${M.color}25`:"rgba(255,255,255,0.06)",color:p===M.id?M.color:"rgba(255,255,255,0.6)",cursor:"pointer",transition:"all 0.2s"},children:[M.emoji," ",M.label]},M.id))}),t.jsx("label",{style:A,children:"Titre du service *"}),t.jsx("input",{value:g,onChange:M=>h(M.target.value),placeholder:"Ex: Cours de guitare pour débutants",style:{...o.input,fontSize:"1rem",padding:"14px 16px"}})]}),l===2&&t.jsxs("div",{style:{animation:"fadeUp 0.3s ease-out"},children:[t.jsx("label",{style:A,children:"Description"}),t.jsx("textarea",{value:x,onChange:M=>y(M.target.value),placeholder:"Décrivez votre service, votre expérience, ce que vous proposez...",rows:4,style:{...o.input,resize:"vertical",marginBottom:"20px",fontSize:"0.9rem",lineHeight:"1.5"}}),t.jsx("label",{style:A,children:"Photo d'illustration"}),T?t.jsxs("div",{style:{position:"relative",marginBottom:"8px",borderRadius:"14px",overflow:"hidden",border:"1px solid rgba(38,166,154,0.2)"},children:[t.jsx("img",{src:T,alt:"",style:{width:"100%",height:"180px",objectFit:"cover"}}),t.jsx("button",{onClick:()=>P(""),style:{position:"absolute",top:"10px",right:"10px",background:"rgba(0,0,0,0.7)",border:"none",borderRadius:"50%",width:"30px",height:"30px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"white"},children:t.jsx(mt,{size:14})})]}):t.jsxs("div",{children:[t.jsxs("div",{style:{display:"flex",gap:"10px",marginBottom:"10px"},children:[t.jsxs("button",{onClick:()=>{var M;return(M=ee.current)==null?void 0:M.click()},style:{...o.btnSecondary,display:"flex",alignItems:"center",gap:"6px",fontSize:"0.82rem",padding:"10px 16px"},children:[t.jsx(Sp,{size:15})," Uploader"]}),t.jsxs("button",{onClick:()=>R(!I),style:{...o.btnSecondary,display:"flex",alignItems:"center",gap:"6px",fontSize:"0.82rem",padding:"10px 16px"},children:[t.jsx(wd,{size:15})," Galerie"]}),t.jsx("input",{ref:ee,type:"file",accept:"image/*",onChange:te,style:{display:"none"}})]}),I&&t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"8px",maxHeight:"200px",overflow:"auto",padding:"4px"},children:VP.map((M,V)=>t.jsxs("div",{onClick:()=>{P(M.url),R(!1)},style:{cursor:"pointer",borderRadius:"10px",overflow:"hidden",border:"2px solid transparent",transition:"border 0.2s"},onMouseEnter:H=>H.currentTarget.style.borderColor="#26A69A",onMouseLeave:H=>H.currentTarget.style.borderColor="transparent",children:[t.jsx("img",{src:M.url,alt:M.label,style:{width:"100%",height:"65px",objectFit:"cover"}}),t.jsx("div",{style:{fontSize:"0.62rem",textAlign:"center",padding:"3px",color:"rgba(255,255,255,0.4)"},children:M.label})]},V))})]})]}),l===3&&t.jsxs("div",{style:{animation:"fadeUp 0.3s ease-out"},children:[t.jsx("label",{style:A,children:"Type de prix *"}),t.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"16px"},children:[t.jsxs("button",{onClick:()=>w("meetips"),style:{flex:1,padding:"12px",borderRadius:"12px",fontSize:"0.9rem",fontWeight:"700",cursor:"pointer",transition:"all 0.2s",border:k==="meetips"?"2px solid #26A69A":"2px s
2685olid rgba(255,255,255,0.12)",background:k==="meetips"?"rgba(38,166,154,0.15)":"rgba(255,255,255,0.04)",color:k==="meetips"?"#4DD0E1":"rgba(255,255,255,0.5)"},children:[t.jsx(Jt,{size:16})," Meetips"]}),t.jsx("button",{onClick:()=>w("euros"),style:{flex:1,padding:"12px",borderRadius:"12px",fontSize:"0.9rem",fontWeight:"700",cursor:"pointer",transition:"all 0.2s",border:k==="euros"?"2px solid #F59E0B":"2px solid rgba(255,255,255,0.12)",background:k==="euros"?"rgba(245,158,11,0.15)":"rgba(255,255,255,0.04)",color:k==="euros"?"#F59E0B":"rgba(255,255,255,0.5)"},children:"ð¶ Euros (â¬)"})]}),t.jsxs("label",{style:A,children:["Prix en ",k==="meetips"?"Meetips":"Euros (â¬)"," *"]}),t.jsxs("div",{style:{position:"relative"},children:[t.jsx("input",{type:"number",min:1,value:_,onChange:M=>S(Math.max(1,parseInt(M.target.value)||1)),style:{...o.input,marginBottom:"8px",fontSize:"1.1rem",fontWeight:"700",paddingRight:"50px"}}),t.jsx("span",{style:{position:"absolute",right:"16px",top:"14px",fontSize:"1rem",fontWeight:"700",color:k==="meetips"?"#26A69A":"#F59E0B"},children:k==="meetips"?t.jsx(Jt,{size:18}):"â¬"})]}),k==="meetips"&&t.jsx("div",{style:{display:"flex",gap:"6px",marginBottom:"20px",flexWrap:"wrap"},children:HP.map(M=>t.jsxs("span",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.35)",background:"rgba(255,255,255,0.05)",padding:"4px 10px",borderRadius:"8px"},children:[M.label,": ",M.min,"-",M.max," ",t.jsx(Jt,{size:12})]},M.label))}),k==="euros"&&t.jsx("p",{style:{fontSize:"0.72rem",color:"rgba(245,158,11,0.6)",marginBottom:"20px"},children:"ð¡ Ce prix sera payable directement au prestataire, sur place."}),t.jsx("label",{style:A,children:"Localisation"}),t.jsx("input",{value:b,onChange:M=>j(M.target.value),placeholder:"Ex: Paris 11e, en ligne...",style:{...o.input,marginBottom:"20px"}}),t.jsxs("label",{style:A,children:[t.jsx(tx,{size:14,style:{verticalAlign:"middle",marginRight:"6px"}}),"Créneaux disponibles (optionnel)"]}),t.jsx("p",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.3)",margin:"0 0 12px"},children:"Ajoutez vos disponibilités pour faciliter la réservation"}),O.map((M,V)=>t.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center",marginBottom:"8px",padding:"10px 12px",background:"rgba(38,166,154,0.06)",borderRadius:"12px",border:"1px solid rgba(38,166,154,0.12)"},children:[t.jsx("select",{value:M.day,onChange:H=>Re(V,"day",H.target.value),style:{...o.input,flex:1,padding:"8px",fontSize:"0.8rem",appearance:"auto"},children:SF.map(H=>t.jsx("option",{value:H,children:H},H))}),t.jsx("input",{type:"time",value:M.startTime,onChange:H=>Re(V,"startTime",H.target.value),style:{...o.input,width:"90px",padding:"8px",fontSize:"0.8rem",textAlign:"center"}}),t.jsx("span",{style:{color:"rgba(255,255,255,0.3)",fontSize:"0.8rem"},children:"â"}),t.jsx("input",{type:"time",value:M.endTime,onChange:H=>Re(V,"endTime",H.target.value),style:{...o.input,width:"90px",padding:"8px",fontSize:"0.8rem",textAlign:"center"}}),t.jsx("button",{onClick:()=>ne(V),style:{background:"none",border:"none",cursor:"pointer",color:"rgba(239,68,68,0.6)",padding:"4px"},children:t.jsx(rn,{size:16})})]},V)),t.jsxs("button",{onClick:K,style:{...o.btnSecondary,display:"flex",alignItems:"center",gap:"6px",fontSize:"0.8rem",width:"100%",justifyContent:"center",padding:"10px"},children:[t.jsx(No,{size:14})," Ajouter un créneau"]})]}),l===4&&t.jsx("div",{style:{animation:"fadeUp 0.3s ease-out"},children:t.jsxs("div",{style:{background:"rgba(255,255,255,0.04)",borderRadius:"16px",border:"1px solid rgba(255,255,255,0.1)",overflow:"hidden",marginBottom:"16px"},children:[T&&t.jsx("img",{src:T,alt:"",style:{width:"100%",height:"160px",objectFit:"cover"}}),t.jsxs("div",{style:{padding:"18px"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"},children:[t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"5px",padding:"5px 14px",borderRadius:"12px",fontSize:"0.8rem",fontWeight:"700",background:`${F.color}25`,color:F.color,border:`1px solid ${F.color}50`},children:[F.emoji," ",F.label]}),t.jsxs("span",{style:{fontWeight:"800",color:"#4DD0E1",fontSize:"1.15rem"},children:[_," ",k==="euros"?"â¬":t.jsx(Jt,{size:18})]})]}),t.jsx("h3",{style:{margin:"0 0 8px",fontSize:"1.1rem",fontWeight:"700",color:"white"},children:g}),x&&t.jsx("p",{style:{margin:"0 0 12px",fontSize:"0.85rem",color:"rgba(255,255,255,0.5)",lineHeight:1.5},children:x}),b&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"0.8rem",color:"rgba(255,255,255,0.4)",marginBottom:"8px"},children:[t.jsx(ur,{size:14})," ",b]}),O.length>0&&t.jsxs("div",{style:{marginTop:"12px",padding:"12px",background:"rgba(38,166,
2685154,0.06)",borderRadius:"12px",border:"1px solid rgba(38,166,154,0.12)"},children:[t.jsxs("div",{style:{fontSize:"0.78rem",fontWeight:"700",color:"#4DD0E1",marginBottom:"8px",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(tx,{size:14})," Disponibilités"]}),O.map((M,V)=>t.jsxs("div",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.6)",padding:"3px 0"},children:["ð
",M.day," â ",M.startTime," â ",M.endTime]},V))]})]})]})}),t.jsxs("div",{style:{display:"flex",gap:"10px",marginTop:"20px"},children:[l>1&&t.jsxs("button",{onClick:()=>d(l-1),style:{...o.btnSecondary,flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",padding:"12px",fontSize:"0.88rem"},children:[t.jsx(t5,{size:18})," Retour"]}),l<4?t.jsxs("button",{onClick:()=>Q()&&d(l+1),disabled:!Q(),style:{...o.btnPrimary,flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",padding:"12px",fontSize:"0.88rem",opacity:Q()?1:.4,cursor:Q()?"pointer":"not-allowed"},children:["Suivant ",t.jsx(En,{size:18})]}):t.jsx("button",{onClick:G,disabled:$,style:{...o.btnPrimary,flex:2,padding:"14px",fontSize:"0.95rem",fontWeight:"800",opacity:$?.6:1},children:$?"â³ Publication...":r?"ð¾ Enregistrer les modifications":"ð Publier mon service"})]})]})})},CF=({service:e,profile:r,onClose:i,onBook:n,styles:o,StarRating:a,getCat:l,toast:d,onViewProfile:p,lightMode:u,darkenHex:g,lightenHex:h})=>{var te;const x=l(e.category),y=e.provider_id===(r==null?void 0:r.id),[_,S]=m.useState([]),[k,w]=m.useState(""),[b,j]=m.useState(!1),[T,P]=m.useState(!!e._openChat),I=m.useRef(null),R=g?g(x.color,.7):x.color,O=g?g(x.color,.5):x.color,E=h?h(x.color,.3):x.color,$={background:`linear-gradient(135deg, ${R}, ${O})`,border:`2px solid ${g?g(x.color,.4):x.color}`,position:"relative",overflow:"hidden"},B=async()=>{if(!(r!=null&&r.id))return;const K=await Ar.getMessages(e.id,r.id);K.success&&S(K.data)};m.useEffect(()=>{T&&B()},[T]),m.useEffect(()=>{var K;(K=I.current)==null||K.scrollIntoView({behavior:"smooth"})},[_]);const ee=async()=>{if(!k.trim()||b)return;j(!0);const K=await Ar.sendMessage({serviceId:e.id,senderId:r.id,receiverId:e.provider_id,content:k.trim()});j(!1),K.success?(w(""),S(ne=>[...ne,K.data])):d.error(K.error)};return t.jsx("div",{style:o.modal,onClick:i,children:t.jsxs("div",{className:"entraide-colored",style:{...o.modalContent,position:"relative",...$,paddingBottom:"36px"},onClick:K=>K.stopPropagation(),children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"45%",background:"linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.04) 50%, transparent 100%)",borderRadius:"20px 20px 0 0",pointerEvents:"none",zIndex:1}}),t.jsxs("div",{style:{position:"relative",zIndex:2},children:[t.jsx("button",{onClick:i,style:{position:"absolute",top:"0",right:"0",background:"none",border:"none",color:"rgba(255,255,255,0.7)",cursor:"pointer",zIndex:2},children:t.jsx(mt,{size:20})}),e.image_url&&t.jsx("div",{style:{margin:"-28px -28px 16px",borderRadius:"20px 20px 0 0",overflow:"hidden"},children:t.jsx("img",{src:e.image_url,alt:"",style:{width:"100%",height:"180px",objectFit:"cover"}})}),t.jsxs("span",{style:{...o.badge(x.color),background:"rgba(255,255,255,0.25)",color:"white",border:"1px solid rgba(255,255,255,0.5)"},children:[x.emoji," ",x.label]}),t.jsx("h2",{style:{margin:"12px 0 8px",fontSize:"1.2rem",fontWeight:"800",color:"#F5F5F5",textTransform:"uppercase",letterSpacing:"0.5px",textShadow:"0 1px 4px rgba(0,0,0,0.3)"},children:e.title}),t.jsxs("div",{onClick:()=>p==null?void 0:p(e.provider_id),style:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"16px",cursor:"pointer",padding:"8px",margin:"0 -8px 16px",borderRadius:"12px",transition:"background 0.2s",background:E,border:`1px solid ${h?h(x.color,.5):x.color}`},children:[e.provider&&t.jsx("img",{src:e.provider.friend_avatar_url||e.provider.avatar_url,alt:"",style:{width:"40px",height:"40px",borderRadius:"50%",objectFit:"cover",border:"2px solid rgba(255,255,255,0.6)",boxShadow:"0 0 10px rgba(0,0,0,0.15)"}}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{fontWeight:"700",fontSize:"0.9rem",color:"white",textShadow:"0 1px 2px rgba(0,0,0,0.2)"},children:(te=e.provider)==null?void 0:te.name}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",marginTop:"2px"},children:[t.jsx(a,{rating:Math.round(e.avg_rating||0),size:12}),t.jsx("span",{style:{fontSize:"0.72rem",color:"white"},children:e.total_ratings>0?`${e.avg_rating}/5 (${e.total_ratings} avis)`:"Nouveau"})]})]}),t.jsx(En,{size:16,style:{color:"white"}})]}),t.jsx("p",{style:{fontSize:"0.88rem",color:"rgba(255,255,255,0.9)",lineHeight:1.6,marginBottom:"16
2685px"},children:e.description||"Pas de description"}),e.location&&t.jsxs("p",{style:{fontSize:"0.8rem",color:"#F5F5F5",display:"flex",alignItems:"center",gap:"6px",marginBottom:"16px",textShadow:"0 1px 2px rgba(0,0,0,0.2)"},children:[t.jsx(ur,{size:14})," ",e.location]}),e.available_slots&&e.available_slots.length>0&&t.jsxs("div",{style:{background:u?"rgba(255,255,255,0.92)":"rgba(255,255,255,0.04)",borderRadius:"14px",padding:"14px",marginBottom:"16px",border:u?"2px solid rgba(120,100,60,0.4)":"1px solid rgba(255,255,255,0.08)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginBottom:"10px",fontSize:"0.82rem",fontWeight:"700",color:u?"#3D3528":"#4DD0E1"},children:[t.jsx(tx,{size:14})," Créneaux disponibles"]}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:e.available_slots.map((K,ne)=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 14px",borderRadius:"10px",background:u?"rgba(255,255,255,0.9)":"rgba(38,166,154,0.1)",border:u?"2px solid rgba(0,121,107,0.4)":"1px solid rgba(38,166,154,0.25)",fontSize:"0.78rem",fontWeight:"600",color:u?"#3D3528":"rgba(255,255,255,0.7)"},children:[t.jsx("span",{style:{fontWeight:"800",color:u?"#00796B":"#26A69A"},children:K.day}),t.jsx("span",{style:{color:u?"rgba(60,50,35,0.4)":"rgba(255,255,255,0.35)"},children:"â¢"}),t.jsx(Pn,{size:11,style:{color:u?"rgba(60,50,35,0.5)":"rgba(255,255,255,0.4)"}}),t.jsxs("span",{children:[K.startTime||K.start," â ",K.endTime||K.end]})]},ne))})]}),t.jsxs("button",{onClick:()=>P(!T),style:{...o.btnSecondary,width:"100%",marginBottom:"12px",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",background:E,border:`1px solid ${h?h(x.color,.5):x.color}`,color:"white",fontWeight:"700",textShadow:"0 1px 2px rgba(0,0,0,0.2)"},children:[t.jsx(Qt,{size:16})," ",T?"Masquer la discussion":y?"ð¬ Voir les messages":"ð¬ Discuter avant de réserver"]}),T&&t.jsxs("div",{style:{background:u?"rgba(255,255,255,0.92)":"rgba(0,0,0,0.2)",borderRadius:"14px",border:u?"2px solid rgba(120,100,60,0.3)":"1px solid rgba(255,255,255,0.06)",marginBottom:"16px",overflow:"hidden"},children:[t.jsxs("div",{style:{maxHeight:"200px",overflow:"auto",padding:"12px"},children:[_.length===0&&t.jsx("p",{style:{fontSize:"0.78rem",color:u?"#8C7A60":"rgba(255,255,255,0.3)",textAlign:"center",margin:"16px 0"},children:"Envoyez un message au prestataire ð¬"}),_.map(K=>{var Re;const ne=K.sender_id===r.id;return t.jsx("div",{style:{display:"flex",justifyContent:ne?"flex-end":"flex-start",marginBottom:"8px"},children:t.jsxs("div",{style:{maxWidth:"75%",padding:"8px 12px",borderRadius:ne?"14px 14px 4px 14px":"14px 14px 14px 4px",background:ne?"rgba(38,166,154,0.2)":u?"rgba(255,255,255,0.85)":"rgba(255,255,255,0.06)",border:`1px solid ${ne?"rgba(38,166,154,0.3)":u?"rgba(120,100,60,0.3)":"rgba(255,255,255,0.08)"}`},children:[!ne&&t.jsx("div",{style:{fontSize:"0.68rem",fontWeight:"600",color:u?"#00796B":"#26A69A",marginBottom:"2px"},children:(Re=K.sender)==null?void 0:Re.name}),t.jsx("div",{style:{fontSize:"0.82rem",color:u?"#2A2520":"rgba(255,255,255,0.8)",lineHeight:1.4},children:K.content}),t.jsx("div",{style:{fontSize:"0.6rem",color:u?"rgba(60,50,35,0.4)":"rgba(255,255,255,0.2)",marginTop:"4px",textAlign:"right"},children:new Date(K.created_at).toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"})})]})},K.id)}),t.jsx("div",{ref:I})]}),t.jsxs("div",{style:{display:"flex",gap:"8px",padding:"8px 12px",borderTop:u?"2px solid rgba(120,100,60,0.2)":"1px solid rgba(255,255,255,0.06)"},children:[t.jsx("input",{value:k,onChange:K=>w(K.target.value),placeholder:"Votre message...",onKeyDown:K=>K.key==="Enter"&&ee(),style:{...o.input,flex:1,padding:"8px 12px",fontSize:"0.82rem",background:u?"white":void 0,color:u?"#2A2520":"white",border:u?"2px solid rgba(120,100,60,0.35)":void 0}}),t.jsx("button",{onClick:ee,disabled:b||!k.trim(),style:{background:"linear-gradient(135deg, #26A69A, #00897B)",border:"none",borderRadius:"10px",padding:"8px 12px",color:"white",cursor:"pointer",opacity:b||!k.trim()?.4:1},children:t.jsx(ji,{size:16})})]})]}),t.jsxs("div",{style:{background:E,borderRadius:"14px",padding:"16px",border:`1px solid ${h?h(x.color,.5):x.color}`,textAlign:"center"},children:[t.jsxs("div",{style:{fontSize:"1.5rem",fontWeight:"800",color:"white",marginBottom:"8px",textShadow:"0 1px 3px rgba(0,0,0,0.25)"},children:[e.price_type==="euros"?`${e.price_euros} â¬`:t.jsxs(t.Fragment,{children:[e.price_meetips," ",t.jsx(Jt,{size:22})]})," ",e.price_type==="euros"?"":"Meetips"]}),!y&&t.jsx("button",{onClick:()=>n(e),style:{...o.btnPrimary,background:"rgba(255,255,255,0.3)",border:"2px s
2685olid rgba(255,255,255,0.5)"},children:"ð¤ Réserver ce service"}),y&&t.jsx("p",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.7)",margin:"8px 0 0"},children:"C'est votre service"})]})]})]})})},zF=({booking:e,profile:r,onClose:i,onRate:n,styles:o,StarRating:a,toast:l})=>{var b;const[d,p]=m.useState(0),[u,g]=m.useState(""),[h,x]=m.useState(!1),[y,_]=m.useState(""),[S,k]=m.useState(!1),w=async()=>{if(d===0){l.error("Donnez une note de 1 à 5 étoiles");return}if(h&&!y.trim()){l.error("Décrivez le problème rencontré");return}k(!0);const j=await Ar.rateService({bookingId:e.id,raterId:r.id,ratedId:e.provider_id,stars:d,comment:u,hasDispute:h,disputeReason:y});k(!1),j.success?(l.success(h?"Signalement envoyé":"Merci pour votre avis !"),n()):l.error(j.error)};return t.jsx("div",{style:o.modal,onClick:i,children:t.jsxs("div",{style:o.modalContent,onClick:j=>j.stopPropagation(),children:[t.jsx("h2",{style:{margin:"0 0 16px",fontSize:"1.15rem",fontWeight:"700"},children:"â Noter le service"}),t.jsx("p",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.5)",marginBottom:"16px"},children:(b=e.service)==null?void 0:b.title}),t.jsx("div",{style:{textAlign:"center",marginBottom:"20px"},children:t.jsx(a,{rating:d,size:32,interactive:!0,onChange:p})}),t.jsx("label",{style:{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",marginBottom:"6px",display:"block"},children:"Commentaire (optionnel)"}),t.jsx("textarea",{value:u,onChange:j=>g(j.target.value),placeholder:"Partagez votre expérience...",rows:2,style:{...o.input,resize:"vertical",marginBottom:"16px"}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"12px",cursor:"pointer"},onClick:()=>x(!h),children:[t.jsx("div",{style:{width:"20px",height:"20px",borderRadius:"4px",border:h?"1px solid #EF4444":"1px solid rgba(255,255,255,0.2)",background:h?"rgba(239,68,68,0.2)":"transparent",display:"flex",alignItems:"center",justifyContent:"center"},children:h&&t.jsx(_n,{size:12,color:"#EF4444"})}),t.jsx("span",{style:{fontSize:"0.85rem",color:h?"#EF4444":"rgba(255,255,255,0.6)"},children:"Signaler un problème"})]}),h&&t.jsx("textarea",{value:y,onChange:j=>_(j.target.value),placeholder:"Décrivez le problème...",rows:2,style:{...o.input,borderColor:"rgba(239,68,68,0.3)",marginBottom:"16px",resize:"vertical"}}),t.jsx("button",{onClick:w,disabled:S,style:{...o.btnPrimary,opacity:S?.6:1},children:S?"â³ Envoi...":h?"â ï¸ Envoyer le signalement":"â
Envoyer mon avis"})]})})},EF=({profile:e,editRequest:r,onClose:i,onSave:n,styles:o,toast:a})=>{const[l,d]=m.useState((r==null?void 0:r.category)||""),[p,u]=m.useState((r==null?void 0:r.title)||""),[g,h]=m.useState((r==null?void 0:r.description)||""),[x,y]=m.useState((r==null?void 0:r.city)||""),[_,S]=m.useState(!1),k=async()=>{if(!l||!p.trim())return;S(!0);let w;r?w=await Ar.updateRequest(r.id,{category:l,title:p.trim(),description:g.trim(),city:x.trim()}):w=await Ar.createRequest({requesterId:e.id,category:l,title:p.trim(),description:g.trim(),city:x.trim()}),S(!1),w.success?(a.success(r?"Demande modifiée !":"Demande publiée !"),n()):a.error(w.error)};return t.jsx("div",{style:o.modal,onClick:i,children:t.jsxs("div",{style:{...o.modalContent,maxWidth:"520px",animation:"slideUp 0.3s ease-out"},onClick:w=>w.stopPropagation(),children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},children:[t.jsx("h3",{style:{margin:0,fontSize:"1.1rem",fontWeight:"800"},children:r?"âï¸ Modifier ma demande":"ð Demander de l'aide"}),t.jsx("button",{onClick:i,style:{background:"none",border:"none",color:"rgba(255,255,255,0.5)",cursor:"pointer",padding:"6px"},children:t.jsx(mt,{size:20})})]}),t.jsx("label",{style:{fontSize:"0.82rem",fontWeight:"700",color:"rgba(255,255,255,0.5)",marginBottom:"8px",display:"block"},children:"Catégorie *"}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",marginBottom:"16px"},children:qa.map(w=>t.jsxs("button",{onClick:()=>d(w.id),style:{padding:"7px 14px",borderRadius:"14px",fontSize:"0.78rem",fontWeight:"700",border:`1.5px solid ${l===w.id?w.color:"rgba(255,255,255,0.15)"}`,background:l===w.id?`${w.color}25`:"rgba(255,255,255,0.04)",color:l===w.id?w.color:"rgba(255,255,255,0.6)",cursor:"pointer",transition:"all 0.2s"},children:[w.emoji," ",w.label]},w.id))}),t.jsx("label",{style:{fontSize:"0.82rem",fontWeight:"700",color:"rgba(255,255,255,0.5)",marginBottom:"6px",display:"block"},children:"Titre *"}),t.jsx("input",{value:p,onChange:w=>u(w.target.value),placeholder:"Ex: Besoin d'un cours de guitare",style:{...o.input,marginBottom:"14px"},maxLength:100}),t.jsx("label",{style:{fontSize:"0.82rem",fontWeight:"700",color:"rgba(255,255,255,0.5)",marginBottom:"6px",display:"block"},children:"Description"}),t.jsx("textarea",{value:g,onChange:w=>h(w.target.value),placeholder:"Décrivez votre besoin en détail...",rows:3,style:{...o.input,resize:"vertical",marginBottom:"14px",minHeight:"80px"}}),t.jsx("label",{style:{fontSize:"0.82rem",fontWeight:"700",color:"rgba(255,255,255,0.5)",marginBottom:"6px",display:"block"},children:"Ville"}),t.jsxs("div",{style:{position:"relative",marginBottom:"20px"},children:[t.jsx(ur,{size:14,style:{position:"absolute",left:"12px",to
2685p:"50%",transform:"translateY(-50%)",color:"rgba(255,255,255,0.3)"}}),t.jsx("input",{value:x,onChange:w=>y(w.target.value),placeholder:"Paris, Lyon, Marseille...",style:{...o.input,paddingLeft:"34px"}})]}),t.jsx("button",{onClick:k,disabled:!l||!p.trim()||_,style:{...o.btnPrimary,width:"100%",opacity:!l||!p.trim()||_?.4:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:_?r?"Modification...":"Publication...":r?"âï¸ Modifier ma demande":"ð Publier ma demande"})]})})},RF=({request:e,profile:r,onClose:i,onSave:n,styles:o,toast:a})=>{const[l,d]=m.useState(""),[p,u]=m.useState("meetips"),[g,h]=m.useState(""),[x,y]=m.useState(!1),_=async()=>{const w=parseFloat(l);if(!w||w<1){a.error("Entrez un prix valide");return}y(!0);const b=await Ar.respondToRequest({requestId:e.id,responderId:r.id,priceMeetips:p==="meetips"?parseInt(l,10):null,priceEuros:p==="euros"?parseFloat(l):null,priceType:p,message:g.trim()});if(y(!1),b.success){a.success("Proposition envoyée !");try{const j=r.name||"Un membre",T=p==="euros"?`${l}â¬`:`${l} Meetips`;ci({toUserId:e.requester_id,subject:`Nouvelle réponse à votre demande : ${e.title} ð¤`,html:` 2686 <div style="font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; max-width: 600px; margin: 0 auto; background: #0a0a12; padding: 32px; border-radius: 16px;"> 2687 <div style="text-align: center; margin-bottom: 24px;"> 2688 <h2 style="color: #4DD0E1; margin: 0;">Quelqu'un veut vous aider ! ð¤</h2> 2689 </div> 2690 <div style="background: rgba(255,255,255,0.05); border-radius: 12px; padding: 20px; margin-bottom: 16px;"> 2691 <p style="color: #aaa; margin: 0 0 12px; font-size: 14px;">Votre demande <strong style="color: white;">"${e.title}"</strong> a reçu une réponse !</p> 2692 <p style="color: white; margin: 0 0 8px; font-size: 15px;"><strong>${j}</strong> propose son aide pour <strong style="color: #F59E0B;">${T}</strong></p> 2693 ${g.trim()?`<p style="color: rgba(255,255,255,0.6); margin: 10px 0 0; font-size: 13px; font-style: italic; border-left: 3px solid rgba(255,255,255,0.1); padding-left: 12px;">"${g.trim()}"</p>`:""} 2694 </div> 2695 <div style="text-align: center; margin-top: 20px;"> 2696 <a href="https://meetapps.ai/services" style="display: inline-block; padding: 12px 32px; background: linear-gradient(135deg, #26A69A, #00897B); color: white; border-radius: 12px; text-decoration: none; font-weight: 700; font-size: 14px;">Voir la réponse</a> 2697 </div> 2698 <div style="text-align: center; margin-top: 20px;"> 2699 <p style="color: rgba(255,255,255,0.3); font-size: 12px;">L'équipe MEETapps â Entraide</p> 2700 </div> 2701 </div> 2702 `})}catch(j){console.warn("Email notification failed:",j)}n()}else a.error(b.error)},S=[10,20,30,50,80],k=[5,10,15,20,50];return t.jsx("div",{style:o.modal,onClick:i,children:t.jsxs("div",{style:{...o.modalContent,maxWidth:"480px",animation:"slideUp 0.3s ease-out"},onClick:w=>w.stopPropagation(),children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},children:[t.jsx("h3",{style:{margin:0,fontSize:"1.1rem",fontWeight:"800"},children:"ð¤ Proposer mon aide"}),t.jsx("button",{onClick:i,style:{background:"none",border:"none",color:"rgba(255,255,255,0.5)",cursor:"pointer",padding:"6px"},children:t.jsx(mt,{size:20})})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.04)",borderRadius:"14px",padding:"14px",marginBottom:"18px",border:"1px solid rgba(255,255,255,0.08)"},children:[t.jsx("p",{style:{margin:"0 0 4px",fontSize:"0.88rem",fontWeight:"700",color:"white"},children:e.title}),e.description&&t.jsx("p",{style:{margin:0,fontSize:"0.78rem",color:"rgba(255,255,255,0.4)",lineHeight:1.4},children:e.description}),e.city&&t.jsxs("p",{style:{margin:"6px 0 0",fontSize:"0.75rem",color:"rgba(255,255,255,0.3)",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(ur,{size:11})," ",e.city]})]}),t.jsx("label",{style:{fontSize:"0.82rem",fontWeight:"700",color:"rgba(255,255,255,0.5)",marginBottom:"8px",display:"block"},children:"Type de prix *"}),t.jsxs("div",{style:{display:"flex",gap:"6px",marginBottom:"14px",background:"rgba(255,255,255,0.04)",borderRadius:"12px",padding:"4px",border:"1px solid rgba(255,255,255,0.08)"},children:[t.jsxs("button",{onClick:()=>{u("meetips"),d("")},style:{flex:1,padding:"10px",borderRadius:"10px",border:p==="meetips"?"1px solid rgba(77,208,225,0.4)":"1px solid transparent",fontSize:"0.82rem",fontWeight:"700",cursor:"pointer",background:p==="meetips"?"rgba(38,166,
2702154,0.2)":"transparent",color:p==="meetips"?"#4DD0E1":"rgba(255,255,255,0.4)",transition:"all 0.2s",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"},children:[t.jsx(Jt,{size:16})," Meetips"]}),t.jsx("button",{onClick:()=>{u("euros"),d("")},style:{flex:1,padding:"10px",borderRadius:"10px",border:p==="euros"?"1px solid rgba(245,158,11,0.4)":"1px solid transparent",fontSize:"0.82rem",fontWeight:"700",cursor:"pointer",background:p==="euros"?"rgba(245,158,11,0.15)":"transparent",color:p==="euros"?"#F59E0B":"rgba(255,255,255,0.4)",transition:"all 0.2s",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"},children:"ð¶ Euros (â¬)"})]}),t.jsxs("label",{style:{fontSize:"0.82rem",fontWeight:"700",color:"rgba(255,255,255,0.5)",marginBottom:"6px",display:"block"},children:["Mon prix en ",p==="meetips"?"Meetips":"Euros"," *"]}),t.jsxs("div",{style:{position:"relative",marginBottom:"14px"},children:[t.jsx("input",{type:"number",value:l,onChange:w=>d(w.target.value),placeholder:p==="meetips"?"30":"15",min:1,style:{...o.input,paddingRight:"80px"}}),t.jsx("span",{style:{position:"absolute",right:"14px",top:"50%",transform:"translateY(-50%)",fontSize:"0.78rem",color:"rgba(255,255,255,0.3)",fontWeight:"700"},children:p==="meetips"?"Meetips":"â¬"})]}),t.jsx("div",{style:{display:"flex",gap:"8px",marginBottom:"16px",flexWrap:"wrap"},children:(p==="meetips"?S:k).map(w=>t.jsxs("button",{onClick:()=>d(String(w)),style:{padding:"5px 12px",borderRadius:"10px",fontSize:"0.75rem",fontWeight:"700",border:`1px solid ${l===String(w)?p==="meetips"?"#26A69A":"#F59E0B":"rgba(255,255,255,0.1)"}`,background:l===String(w)?p==="meetips"?"rgba(38,166,154,0.2)":"rgba(245,158,11,0.15)":"rgba(255,255,255,0.04)",color:l===String(w)?p==="meetips"?"#4DD0E1":"#F59E0B":"rgba(255,255,255,0.5)",cursor:"pointer"},children:[w," ",p==="meetips"?t.jsx(Jt,{size:12}):"â¬"]},w))}),p==="euros"&&t.jsx("p",{style:{fontSize:"0.72rem",color:"rgba(245,158,11,0.6)",margin:"-8px 0 14px",fontStyle:"italic"},children:"ð¡ Le paiement en euros se fait sur place, directement entre vous."}),t.jsx("label",{style:{fontSize:"0.82rem",fontWeight:"700",color:"rgba(255,255,255,0.5)",marginBottom:"6px",display:"block"},children:"Message (optionnel)"}),t.jsx("textarea",{value:g,onChange:w=>h(w.target.value),placeholder:"Décrivez votre expérience, vos disponibilités...",rows:3,style:{...o.input,resize:"vertical",marginBottom:"20px",minHeight:"70px"}}),t.jsx("button",{onClick:_,disabled:!l||x,style:{...o.btnPrimary,width:"100%",opacity:!l||x?.4:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:x?"Envoi...":`ð¤ Proposer pour ${l||"?"} ${p==="meetips"?"Meetips":"â¬"}`})]})})},IF=({request:e,profile:r,onClose:i,onAccept:n,styles:o,toast:a,getCat:l})=>{const d=l(e.category),p=e.responses||[],u=async g=>{if(!window.confirm("Accepter cette proposition ?"))return;const h=await Ar.acceptResponse(g,e.id);h.success?(a.success("Proposition acceptée ! ð"),n()):a.error(h.error)};return t.jsx("div",{style:o.modal,onClick:i,children:t.jsxs("div",{style:{...o.modalContent,maxWidth:"540px",animation:"slideUp 0.3s ease-out"},onClick:g=>g.stopPropagation(),children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[t.jsx("h3",{style:{margin:0,fontSize:"1.1rem",fontWeight:"800"},children:"ð Ma demande"}),t.jsx("button",{onClick:i,style:{background:"none",border:"none",color:"rgba(255,255,255,0.5)",cursor:"pointer",padding:"6px"},children:t.jsx(mt,{size:20})})]}),t.jsxs("div",{style:{background:"rgba(255,255,255,0.04)",borderRadius:"14px",padding:"16px",marginBottom:"20px",border:"1px solid rgba(255,255,255,0.08)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"8px"},children:[t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"5px",padding:"4px 10px",borderRadius:"10px",fontSize:"0.75rem",fontWeight:"700",background:`${d.color}25`,color:d.color},children:[d.emoji," ",d.label]}),t.jsx("span",{style:{fontSize:"0.72rem",padding:"3px 8px",borderRadius:"8px",fontWeight:"700",background:e.status==="open"?"rgba(34,197,94,0.15)":"rgba(168,85,247,0.15)",color:e.status==="open"?"#22c55e":"#a855f7"},children:e.status==="open"?"ð¢ Ouverte":"â
Résolue"})]}),t.jsx("h4",{style:{margin:"0 0 6px",fontSize:"1rem",fontWeight:"700",color:"white"},children:e.title}),e.description&&t.jsx("p",{style:{margin:"0 0 8px",fontSize:"0.82rem",color:"rgba(255,255,255,0.45)",lineHeight:1.4},children:e.description}),e.city&&t.jsxs("p",{style:{margin:0,fontSize:"0.75rem",color:"rgba(255,255,255,0.3)",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(ur,{size:11})," ",e.city]})]}),t.jsxs("h4",{style:{margin:"0 0 14px",fontSize:"0.92rem",fontWeight:"700",color:"white"},children:["ð¬ ",p.length," réponse",p.length!==1?"s":""," reçue",p.length!==1?"s":""]}),p.length===0?t.jsxs("div",{style:{textAlign:"center",padding:"30px 0",color:"rgba(255,255,255,0.25)"},children:[t.jsx("div",{style:{fontSize:"2rem",marginBottom:"8px"},children:"â³"}),t.jsx("p",{style:{margin:0,fontSize:"0.82rem"},children:"Aucune réponse pour le moment"})]}):t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px",maxHeight:"350px",overflowY:"auto"},children:p.map(g=>{var _,S,k;const h=((_=g.responder)==null?void 0:_.friend_avatar_url)||((S=g.responder)==null?void 0:S.avatar_url),x=g.status==="accepted",y=g.status==="declined";return t.jsxs("div",{style:{background:x?"rgba(34,197,94,0.08)":"rgba(255,255,255,0.03)",borderRadius:"14px",padding:"14px",border:`1px solid ${x?"rgba(34,197,94,0.3)":"rgba(255,255,255,0.08)"}`,opacity:y?.4:1},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[h&&t.jsx("img",{src:h,alt:"",style:{width:"30px",height:"30px",borderRadius:"50%",objectFit:"cover",border:"1.5px solid rgba(255,255,255,0.15)"}}),t.jsx("span",{style:{fontSize:"0.85rem",fontWeight:"700",color:"white"},children:((k=g.responder)==null?void 0:k.name)||"Membre"})]}),t.jsxs("span",{style:{fontSize:"0.88rem",fontWeight:"800",color:"#4DD0E1"},children:[g.price_meetips," ",t.jsx(Jt,{size:14})]})]}),g.message&&t.jsx("p",{style:{margin:"0 0 10px",fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",lineHeight:1.4},children:g.message}),e.status==="open"&&g.status==="proposed"&&t.jsx("button",{onClick:()=>u(g.id),style:{...o.btnPrimary,width:"100%",fontSize:"0.82rem",padding:"9px",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"},children:"â
Accepter cette proposition"}),x&&t.jsx("div",{style:{textAlign:"center",fontSize:"0.78rem",color:"#22c55e",fontWeight:"700",padding:"6px 0"},children:"â
Acceptée"}),y&&t.jsx("div",{style:{textAlign:"center",fontSize:"0.78rem",color:"rgba(255,255,255,0.3)",fontWeight:"600",padding:"4px 0"},children:"Déclinée"})]},g.id)})})]})})},v1=[{value:"all",label:"Tous",emoji:"ð¥"},{value:"rencontres",label:"Rencontres",emoji:"ð"},{value:"conseils",label:"Conseils",emoji:"ð¡"},{value:"celibat",label:"Célibat",emoji:"ð§"},{value:"lifestyle",label:"Lifestyle",emoji:"â¨"}],j1=()=>{const e=Lt(),[r,i]=m.useState([]),[n,o]=m.useState(!0),[a,l]=m.useState("all");m.useEffect(()=>{document.title="MEETblog â Conseils Rencontres & Célibat | MEETEros";const p=document.querySelector('meta[name="description"]');p&&p.setAttribute("content","MEETblog : articles et conseils sur les rencontres, le célibat et les relations. Le blog de la communauté MEETEros."),(async()=>{o(!0);let g=D.from("blog_posts").select("id, title, slug, excerpt, cover_image_url, category, author_name, published_at, likes_count").lte("published_at",new Date().toISOString()).order("published_at",{ascending:!1});a!=="all"&&(g=g.eq("category",a));const{data:h,error:x}=await g;!x&&h&&i(h),o(!1)})()},[a]);const d=p=>new Date(p).toLocaleDateString("fr-FR",{day:"numeric",month:"long",year:"numeric"});return t.jsxs("div",{style:{minHeight:"100vh",background:"linear-gradient(180deg, #0a0815 0%, #12101f 50%, #0a0815 100%)",color:"white",fontFamily:"Outfit, sans-serif"},children:[t.jsxs("div",{style:{padding:"60px 20px 40px",textAlign:"center",background:"radial-gradient(ellipse at center top, rgba(212,197,160,0.08) 0%, transparent 60%)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"12px",marginBottom:"12px"},children:[t.jsx(el,{size:28,color:"#D4C5A0"}),t.jsx("h1",{style:{fontSize:"clamp(1.8rem, 5vw, 2.8rem)",fontWeight:900,background:"linear-gradient(135deg, #D4C5A0, #BBA57A)",WebkitBackgroun
2702dClip:"text",WebkitTextFillColor:"transparent",margin:0},children:"MEETblog"})]}),t.jsx("p",{style:{fontSize:"1.05rem",color:"rgba(255,255,255,0.55)",maxWidth:"500px",margin:"0 auto",lineHeight:1.5},children:"Conseils, réflexions et inspirations pour vivre vos rencontres autrement."}),t.jsx("button",{onClick:()=>e("/"),style:{marginTop:"16px",background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.6)",padding:"8px 20px",borderRadius:"20px",cursor:"pointer",fontSize:"0.85rem",fontFamily:"Outfit"},children:"â Retour à MEETEros"})]}),t.jsx("div",{style:{display:"flex",gap:"8px",padding:"0 20px 24px",overflowX:"auto",justifyContent:"center",flexWrap:"wrap"},children:v1.map(p=>{const u=a===p.value;return t.jsxs("button",{onClick:()=>l(p.value),style:{padding:"10px 18px",borderRadius:"20px",background:u?"linear-gradient(135deg, #D4C5A0, #BBA57A)":"rgba(255,255,255,0.06)",color:u?"#0a0815":"rgba(255,255,255,0.6)",border:u?"none":"1px solid rgba(255,255,255,0.1)",fontWeight:u?800:500,fontSize:"0.85rem",cursor:"pointer",fontFamily:"Outfit",transition:"all 0.2s",whiteSpace:"nowrap"},children:[p.emoji," ",p.label]},p.value)})}),t.jsx("div",{style:{maxWidth:"900px",margin:"0 auto",padding:"0 20px 60px",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:"24px"},children:n?[...Array(4)].map((p,u)=>t.jsx("div",{style:{borderRadius:"16px",background:"rgba(255,255,255,0.04)",height:"380px",animation:"pulse 1.5s infinite"}},u)):r.length===0?t.jsxs("div",{style:{gridColumn:"1 / -1",textAlign:"center",padding:"60px 20px",color:"rgba(255,255,255,0.4)"},children:[t.jsx(el,{size:48,style:{marginBottom:"12px",opacity:.3}}),t.jsx("p",{children:"Aucun article dans cette catégorie pour le moment."})]}):r.map(p=>{var u;return t.jsxs("article",{onClick:()=>e(`/blog/${p.slug}`),style:{borderRadius:"16px",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",overflow:"hidden",cursor:"pointer",transition:"all 0.3s ease",display:"flex",flexDirection:"column"},onMouseEnter:g=>{g.currentTarget.style.transform="translateY(-4px)",g.currentTarget.style.boxShadow="0 12px 40px rgba(212,197,160,0.1)",g.currentTarget.style.borderColor="rgba(212,197,160,0.2)"},onMouseLeave:g=>{g.currentTarget.style.transform="translateY(0)",g.currentTarget.style.boxShadow="none",g.currentTarget.style.borderColor="rgba(255,255,255,0.08)"},children:[t.jsxs("div",{style:{height:"180px",backgroundImage:`url(${p.cover_image_url})`,backgroundSize:"cover",backgroundPosition:"center",position:"relative"},children:[t.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:"60px",background:"linear-gradient(transparent, rgba(10,8,21,0.9))"}}),t.jsxs("span",{style:{position:"absolute",top:"12px",left:"12px",background:"rgba(0,0,0,0.6)",backdropFilter:"blur(8px)",padding:"4px 12px",borderRadius:"12px",fontSize:"0.75rem",fontWeight:600,color:"#D4C5A0",textTransform:"capitalize"},children:[(u=v1.find(g=>g.value===p.category))==null?void 0:u.emoji," ",p.category]})]}),t.jsxs("div",{style:{padding:"16px 18px 18px",flex:1,display:"flex",flexDirection:"column"},children:[t.jsx("h2",{style:{fontSize:"1.1rem",fontWeight:800,margin:"0 0 8px",lineHeight:1.3,color:"white"},children:p.title}),t.jsx("p",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.45)",lineHeight:1.5,margin:"0 0 16px",flex:1,display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden"},children:p.excerpt}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderTop:"1px solid rgba(255,255,255,0.06)",paddingTop:"12px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(cr,{size:13,color:"rgba(255,255,255,0.3)"}),t.jsx("span",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.35)"},children:d(p.published_at)})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[p.likes_count>0&&t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"3px",fontSize:"0.75rem",color:"rgba(255,255,255,0.3)"},children:[t.jsx(Bt,{size:12})," ",p.likes_count]}),t.jsx(Pr,{size:16,color:"#D4C5A0"})]})]})]})]}
2702,p.id)})}),t.jsx("style",{children:` 2703 @keyframes pulse { 2704 0%, 100% { opacity: 0.4; } 2705 50% { opacity: 0.8; } 2706 } 2707 `})]})},w1=()=>{const{slug:e}=Jj(),r=Lt(),[i,n]=m.useState(null),[o,a]=m.useState([]),[l,d]=m.useState(!0),[p,u]=m.useState(""),[g,h]=m.useState(!1),[x,y]=m.useState(!1),[_,S]=m.useState(0),[k,w]=m.useState(null),[b,j]=m.useState(null);m.useEffect(()=>{(async()=>{d(!0);const{data:{user:B}}=await D.auth.getUser();if(w(B),B){const{data:ne}=await D.from("profiles").select("first_name, photo_url, avatar_url").eq("id",B.id).single();j(ne)}const{data:ee,error:te}=await D.from("blog_posts").select("*").eq("slug",e).lte("published_at",new Date().toISOString()).single();if(te||!ee){d(!1);return}if(n(ee),S(ee.likes_count||0),document.title=`${ee.title} â MEETblog`,B){const{data:ne}=await D.from("blog_likes").select("id").eq("post_id",ee.id).eq("user_id",B.id).maybeSingle();y(!!ne)}const{data:K}=await D.from("blog_comments").select("*").eq("post_id",ee.id).order("created_at",{ascending:!0});K&&a(K),d(!1)})()},[e]);const T=m.useCallback(async()=>{!k||!i||(x?(await D.from("blog_likes").delete().eq("post_id",i.id).eq("user_id",k.id),y(!1),S($=>Math.max(0,$-1)),await D.from("blog_posts").update({likes_count:Math.max(0,_-1)}).eq("id",i.id)):(await D.from("blog_likes").insert({post_id:i.id,user_id:k.id}),y(!0),S($=>$+1),await D.from("blog_posts").update({likes_count:_+1}).eq("id",i.id)))},[k,i,x,_]),P=m.useCallback(async()=>{if(!k||!i||!p.trim())return;h(!0);const $=(b==null?void 0:b.first_name)||"Membre",B=(b==null?void 0:b.photo_url)||(b==null?void 0:b.avatar_url)||"",{data:ee,error:te}=await D.from("blog_comments").insert({post_id:i.id,user_id:k.id,user_name:$,user_avatar:B,content:p.trim()}).select().single();!te&&ee&&(a(K=>[...K,ee]),u("")),h(!1)},[k,i,p,b]),I=()=>{const $=window.location.href;navigator.share?navigator.share({title:i==null?void 0:i.title,url:$}):(navigator.clipboard.writeText($),alert("Lien copié !"))},R=$=>{if(!$)return null;const B=$.split(` 2708`),ee=[];return B.forEach((te,K)=>{const ne=te.trim();ne.startsWith("### ")?ee.push(t.jsx("h3",{style:{fontSize:"1.2rem",fontWeight:800,color:"#D4C5A0",margin:"28px 0 12px"},children:ne.slice(4)},K)):ne.startsWith("## ")?ee.push(t.jsx("h2",{style:{fontSize:"1.5rem",fontWeight:900,color:"white",margin:"32px 0 16px"},children:ne.slice(3)},K)):ne.startsWith("> ")?ee.push(t.jsx("blockquote",{style:{borderLeft:"3px solid #D4C5A0",paddingLeft:"16px",margin:"20px 0",fontStyle:"italic",color:"rgba(255,255,255,0.7)",fontSize:"1.05rem"},children:O(ne.slice(2))},K)):ne==="---"?ee.push(t.jsx("hr",{style:{border:"none",borderTop:"1px solid rgba(255,255,255,0.1)",margin:"28px 0"}},K)):ne.startsWith("- ")?ee.push(t.jsxs("div",{style:{display:"flex",gap:"8px",margin:"6px 0",paddingLeft:"4px"},children:[t.jsx("span",{style:{color:"#D4C5A0",flexShrink:0},children:"â¢"}),t.jsx("span",{style:{color:"rgba(255,255,255,0.75)",lineHeight:1.6},children:O(ne.slice(2))})]},K)):ne===""?ee.push(t.jsx("div",{style:{height:"8px"}},K)):ee.push(t.jsx("p",{style:{color:"rgba(255,255,255,0.75)",lineHeight:1.7,margin:"8px 0",fontSize:"1rem"},children:O(ne)},K))}),ee},O=$=>{const B=[];let ee=$,te=0;for(;ee.length>0;){const K=ee.match(/\*\*(.+?)\*\*/),ne=ee.match(new RegExp("(?<!\\*)\\*(?!\\*)(.+?)(?<!\\*)\\*(?!\\*)")),Re=[K,ne].filter(Boolean).sort((G,le)=>
2708ee.indexOf(G[0])-ee.indexOf(le[0]))[0];if(!Re){B.push(t.jsx("span",{children:ee},te++));break}const Q=ee.indexOf(Re[0]);Q>0&&B.push(t.jsx("span",{children:ee.slice(0,Q)},te++)),Re===K?B.push(t.jsx("strong",{style:{color:"white",fontWeight:700},children:Re[1]},te++)):B.push(t.jsx("em",{style:{fontStyle:"italic",color:"rgba(255,255,255,0.6)"},children:Re[1]},te++)),ee=ee.slice(Q+Re[0].length)}return B},E=$=>new Date($).toLocaleDateString("fr-FR",{day:"numeric",month:"long",year:"numeric"});return l?t.jsxs("div",{style:{minHeight:"100vh",background:"#0a0815",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx("div",{style:{width:"40px",height:"40px",border:"3px solid rgba(212,197,160,0.3)",borderTop:"3px solid #D4C5A0",borderRadius:"50%",animation:"spin 0.8s linear infinite"}}),t.jsx("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]}):i?t.jsxs("div",{style:{minHeight:"100vh",background:"linear-gradient(180deg, #0a0815 0%, #12101f 50%, #0a0815 100%)",color:"white",fontFamily:"Outfit, sans-serif"},children:[t.jsxs("div",{style:{height:"clamp(200px, 40vh, 400px)",backgroundImage:`url(${i.cover_image_url})`,backgroundSize:"cover",backgroundPosition:"center",position:"relative"},children:[t.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(transparent 40%, #0a0815 100%)"}}),t.jsxs("button",{onClick:()=>r("/blog"),style:{position:"absolute",top:"20px",left:"20px",background:"rgba(0,0,0,0.5)",backdropFilter:"blur(8px)",border:"1px solid rgba(255,255,255,0.15)",borderRadius:"12px",padding:"10px 16px",color:"white",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px",fontFamily:"Outfit",fontSize:"0.85rem",fontWeight:600},children:[t.jsx(Hr,{size:16})," Retour"]})]}),t.jsxs("div",{style:{maxWidth:"720px",margin:"0 auto",padding:"0 24px 60px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"12px"},children:[t.jsx("span",{style:{background:"rgba(212,197,160,0.15)",color:"#D4C5A0",padding:"4px 14px",borderRadius:"12px",fontSize:"0.8rem",fontWeight:600,textTransform:"capitalize"},children:i.category}),t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"0.8rem",color:"rgba(255,255,255,0.35)"},children:[t.jsx(cr,{size:13})," ",E(i.published_at)]})]}),t.jsx("h1",{style:{fontSize:"clamp(1.5rem, 4vw, 2.2rem)",fontWeight:900,lineHeight:1.2,margin:"0 0 8px"},children:i.title}),t.jsxs("p",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.4)",marginBottom:"32px"},children:["Par ",i.author_name]}),t.jsx("div",{children:R(i.content)}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px",margin:"40px 0 32px",padding:"16px 0",borderTop:"1px solid rgba(255,255,255,0.1)",borderBottom:"1px solid rgba(255,255,255,0.1)"},children:[t.jsxs("button",{onClick:k?T:()=>r("/login"),style:{display:"flex",alignItems:"center",gap:"6px",background:x?"rgba(255,71,87,0.15)":"rgba(255,255,255,0.06)",border:x?"1px solid rgba(255,71,87,0.3)":"1px solid rgba(255,255,255,0.1)",color:x?"#ff4757":"rgba(255,255,255,0.5)",padding:"10px 18px",borderRadius:"12px",cursor:"pointer",fontFamily:"Outfit",fontWeight:600,fontSize:"0.9rem",transition:"all 0.2s"},children:[t.jsx(Bt,{size:18,fill:x?"#ff4757":"none"})," ",_]}),t.jsxs("button",{onClick:I,style:{display:"flex",alignItems:"center",gap:"6px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.5)",padding:"10px 18px",borderRadius:"12px",cursor:"pointer",fontFamily:"Outfit",fontWeight:600,fontSize:"0.9rem"},children:[t.jsx(u0,{size:16})," Partager"]}),t.jsxs("span",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:"4px",color:"rgba(255,255,255,0.3)",fontSize:"0.85rem"},children:[t.jsx(Qt,{size:14})," ",o.length]})]}),t.jsxs("div",{children:[t.jsxs("h3",{style:{fontSize:"1.2rem",fontWeight:800,marginBottom:"20px"},children:["ð¬ Commentaires (",o.length,")"]}),k?t.jsxs("div",{style:{display:"flex",gap:"12px",marginBottom:"24px",background:"rgba(255,255,255,0.04)",borderRadius:"14px",padding:"14px",border:"1px solid rgba(255,255,255,0.08)"},children:[t.jsx("div",{style:{width:"36px",height:"36px",borderRadius:"50%",flexShrink:0,background:b!=null&&b.photo_url?`url(${b.photo_url}) center/cover`:"linear-gradient(135deg, #D4C5A0, #BBA57A)",display:"flex",alignItems:"center",justifyContent:"center"},children:!(b!=null&&b.photo_url)&&t.jsx(Ur,{size:16,color:"#0a0815"})}),t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"8px"},children:[t.jsx("textarea",{value:p,onChange:$=>u($.target.value),placeholder:"Partagez votre avis...",rows:2,style:{width:"100%",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"10px",padding:"10px 12px",color:"white",fontSize:"0.9rem",fontFamily:"Outfit",resize:"vertical",outline:"none"},onFocus:$=>$.target.style.borderColor="rgba(212,197,160,0.4)",onBlur:$=>$.target.style.borderColor="rgba(255,255,255,0.1)"}),t.jsxs("button",{onClick:P,disabled:!p.trim()||g,style:{alignSelf:"flex-end",background:p.trim()?"linear-gradient(135deg, #D4C5A0, #BBA57A)":"rgba(255,255,255,0.1)",color:p.trim()?"#0a0815":"rgba(255,255,255,0.3)",border:"none",padding:"8px 20px",borderRadius:"10px",fontWeight:700,cursor:p.trim()?"pointer":"default",fontFamily:"Outfit",fontSize:"0.85rem",display:"flex",alignItems:"center",gap:"6px"},children:[t.jsx(ji,{size:14})," ",g?"Envoi...":"Publier"]})]})]}):t.jsxs("div",{style:{textAlign:"center",padding:"24px",marginBottom:"24px",background:"rgba(255,255,255,0.04)",borderRadius:"14px",border:"1px solid rgba(255,255,255,0.08)"},children:[t.jsx("p",{style:{color:"rgba(255,255,255,0.5)",marginBottom:"12px"},children:"Connectez-vous pour laisser un commentaire"}),t.jsx("button",{onClick:()=>r("/login"),style:{background:"linear-gradient(135deg, #D4C5A0, #BBA57A)",color:"#0a0815",border:"none",padding:"10px 24px",borderRadius:"12px",fontWeight:700,cursor:"pointer",fontFamily:"Outfit"},children:"Se connecter"})]}),o.length===0?t.jsx("p",{style:{color:"rgba(255,255,255,0.3)",textAlign:"center",padding:"20px"},children:"Soyez le premier à commenter ! ð"}):t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:o.map($=>t.jsxs("div",{style:{display:"flex",gap:"12px",padding:"14px",borderRadius:"14px",background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.06)"},children:[t.jsx("div",{style:{width:"36px",height:"36px",borderRadius:"50%",flexShrink:0,background:$.user_avatar?`url(${$.user_avatar}) center/cover`:"linear-gradient(135deg, #667eea, #764ba2)",display:"flex",alignItems:"center",justifyContent:"center"},children:!$.user_avatar&&t.jsx(Ur,{size:16,color:"white"})}),t.jsxs("div",{style:{flex:1},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"4px"},children:[t.jsx("span",{style:{fontWeight:700,fontSize:"0.9rem",color:"white"},children:$.user_name}),t.jsx("span",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.25)"},children:new Date($.created_at).toLocaleDateString("fr-FR",{day:"numeric",month:"short"})})]}),t.jsx("p",{style:{fontSize:"0.9rem",color:"rgba(255,255,255,0.65)",lineHeight:1.5,margin:0},children:$.content})]})]},$.id))})]})]})]}):t.jsxs("div",{style:{minHeight:"100vh",background:"#0a0815",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:"16px",color:"white",fontFamily:"Outfit"},children:[t.jsx(el,{size:48,color:"rgba(255,255,255,0.3)"}),t.jsx("p",{style:{color:"rgba(255,255,255,0.5)"},children:"Article introuvable"}),t.jsx("button",{onClick:()=>r("/blog"),style:{background:"linear-gradient(135deg, #D4C5A0, #BBA57A)",color:"#0a0815",border:"none",padding:"12px 24px",borderRadius:"12px",fontWeight:700,cursor:"pointer",fontFamily:"Outfit"},children:"â Retour au blog"})]})}
2708,_1=[{id:"FRIEND",label:"Friend",menuLabel:"ð¥ Friend",icon:Ut,activeGradient:"linear-gradient(135deg, #2DD4BF 0%, #14B8A6 50%, #0D9488 100%)",menuGradient:"linear-gradient(135deg, #FF7043, #FF4081)",menuColor:"#FF7043",activeColor:"white",glowColor:"rgba(38,166,154,0.55)"},{id:"EROS",label:"EROS",menuLabel:"ð Eros",icon:Bt,activeGradient:"linear-gradient(135deg, #F5D06E 0%, #D4A843 50%, #C5A065 100%)",menuGradient:"linear-gradient(135deg, #a855f7, #ec4899)",menuColor:"#a855f7",activeColor:"#1a1608",glowColor:"rgba(212,196,168,0.55)"},{id:"EROX",label:"EROX",menuLabel:"ð¥ Erox",icon:en,activeGradient:"linear-gradient(135deg, #FF4D4D 0%, #EF2020 50%, #DC1818 100%)",menuGradient:"linear-gradient(135deg, #ff3333, #dc2626)",menuColor:"#ff3333",activeColor:"white",glowColor:"rgba(255,60,60,0.55)"}],TF=e=>({display:"flex",background:e?"rgba(140,115,75,0.08)":"rgba(255,255,255,0.06)",borderRadius:"22px",padding:"4px",border:e?"2px solid rgba(140,115,75,0.3)":"1px solid rgba(255,255,255,0.12)",backdropFilter:"blur(20px) saturate(1.4)",WebkitBackdropFilter:"blur(20px) saturate(1.4)",boxShadow:e?"0 2px 12px rgba(120,100,60,0.1)":"0 4px 20px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.1)"}),S1=(e,r,i,n=!1)=>{const o=n?"rgba(140,115,75,0.06)":"rgba(255,255,255,0.03)",a={border:"none",borderRadius:"18px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.3s"};return i==="compact"?{...a,background:r?e.activeGradient:n?"rgba(140,115,75,0.06)":o,color:r?e.activeColor:n?"rgba(100,80,50,0.5)":"rgba(255,255,255,0.35)",padding:"8px 16px",transform:r?"scale(1.08)":"scale(0.95)",opacity:r?1:n?.7:.45,filter:r?"none":"blur(0.3px)",boxShadow:r?`0 4px 18px ${e.glowColor}, inset 0 1px 0 rgba(255,255,255,0.25)`:"none"}:i==="full"?{...a,background:r?e.activeGradient:o,color:r?e.activeColor:"rgba(255,255,255,0.35)",padding:"6px 14px",fontSize:"0.75rem",fontWeight:"bold",gap:"5px",transform:r?"scale(1.05)":"scale(0.95)",opacity:r?1:.45,filter:r?"none":"blur(0.3px)",boxShadow:r?`0 4px 18px ${e.glowColor}, inset 0 1px 0 rgba(255,255,255,0.3)`:"none"}:{...a,flex:1,padding:"10px 0",borderRadius:"12px",background:r?e.menuGradient:"rgba(255,255,255,0.04)",border:r?"none":"1px solid rgba(255,255,255,0.08)",color:r?"white":"rgba(255,255,255,0.5)",fontWeight:r?"700":"500",fontSize:"0.82rem",boxShadow:r?`0 4px 16px ${e.menuColor}35`:"none",fontFamily:"Inter, sans-serif"}},Rg=({mode:e,onSwitch:r,variant:i="compact"})=>{const{lightMode:n}=dr();if(i==="menu")return t.jsx("div",{style:{display:"flex",gap:"8px"},children:_1.map(a=>t.jsx("button",{onClick:()=>{Uo(),r(a.id)},style:S1(a,e===a.id,"menu",n),children:a.menuLabel},a.id))});const o=i==="compact"?18:13;return t.jsx("div",{style:TF(n),children:_1.map(a=>{const l=e===a.id,d=a.icon;return t.jsxs("button",{onClick:()=>{Uo(),r(a.id)},style:S1(a,l,i,n),children:[t.jsx(d,{size:o,fill:l?a.activeColor==="#1a1608"?"#1a1608":"white":"none",strokeWidth:l?2.5:1.8}),i==="full"&&a.label]},a.id)})})},k1={EROS:{label:"MeetEros",icon:Bt,color:"#D4AF37",gradient:"linear-gradient(135deg, #D4AF37, #F5D76E)",tagCol:"tags",avatarCol:"avatar_url",galleryCol:"photos",nameCol:null,sections:Fn,textColor:"#000"},EROX:{label:"MeetErox",icon:en,color:"#ff3333",gradient:"linear-gradient(135deg, #ff3333, #dc2626)",tagCol:"erox_tags",avatarCol:"erox_avatar_url",galleryCol:"erox_photos",nameCol:"erox_name",sections:So,textColor:"#fff"},FRIEND:{label:"MeetFriend",icon:Ut,color:"#FF7043",gradient:"linear-gradient(135deg, #FF7043, #FF4081)",tagCol:"friend_tags",avatarCol:"friend_avatar_url",galleryCol:"friend_photos",nameCol:"friend_name",sections:il,textColor:"#fff"}},AF=(e,r=800,i=.75)=>new Promise(n=>{const o=new FileReader;o.readAsDataURL(e),o.onload=a=>{const l=new Image;l.src=a.target.result,l.onload=()=>{const d=document.createElement("canvas");let p=l.width,u=l.height;p>u?p>r&&(u*=r/p,p=r):u>r&&(p*=r/u,u=r),d.width=p,d.height=u,d.getContext("2d").drawImage(l,0,0,p,u),n(d.toDataURL("image/jpeg",i))}}}),PF=e=>{var l;if(!e||!e.startsWith("data:"))return null;const[r,i]=e.split(","),n=((l=r.match(/data:(.*?);/))==null?void 0:l[1])||"image/jpeg",o=atob(i),a=new Uint8Array(o.length);for(let d=0;d<o.length;
2708d++)a[d]=o.charCodeAt(d);return new Blob([a],{type:n})},FF=({targetMode:e,userProfile:r,onComplete:i,onCancel:n})=>{const[o,a]=m.useState(1),[l,d]=m.useState(!1),p=(r==null?void 0:r.avatar_url)||(r==null?void 0:r.photo)||null,[u,g]=m.useState(!0),[h,x]=m.useState([null,null,null,null]),[y,_]=m.useState(!1),[S,k]=m.useState(null),[w,b]=m.useState(!1),[j,T]=m.useState(!1),P=m.useRef(null),[I,R]=m.useState(null),O=(r==null?void 0:r.name)||"",[E,$]=m.useState("keep"),[B,ee]=m.useState(""),[te,K]=m.useState([]),ne=k1[e]||k1.EROS,Re=ne.icon,Q=V=>{var H;R(V),(H=P.current)==null||H.click()},G=m.useCallback(async V=>{const H=V.target.files[0];if(!H)return;const N=await AF(H);x(Z=>{const ae=[...Z];if(I!==null&&I<4)ae[I]=N;else{const X=ae.findIndex(he=>!he);X>=0&&(ae[X]=N)}return ae}),g(!1),V.target.value=""},[I]),le=V=>{x(H=>{const N=[...H];return N[V]=null,N})},F=V=>{K(H=>H.includes(V)?H.filter(N=>N!==V):[...H,V])},A=u?!!p:h.some(V=>V!==null),M=async()=>{d(!0);try{const V=r.id,H={};if(u&&p)H[ne.avatarCol]=p;else{const Z=h.filter(ae=>ae!==null);if(Z.length>0){const ae=[];for(let X=0;X<Z.length;X++){const he=Z[X];if(he.startsWith("http")){ae.push(he);continue}try{let Ae=PF(he);if(!Ae)continue;const ze=`${V}/${e.toLowerCase()}_${X===0?"avatar":`gallery_${X}`}.jpg`,{error:ue}=await D.storage.from("avatars").upload(ze,Ae,{upsert:!0,contentType:"image/jpeg"});if(!ue){const{data:xe}=D.storage.from("avatars").getPublicUrl(ze);ae.push(xe.publicUrl)}}catch(Ae){console.error(`Photo ${X} failed:`,Ae)}}ae.length>0&&(H[ne.avatarCol]=ae[0],ae.length>1&&(H[ne.galleryCol]=ae.slice(1)))}else p&&(H[ne.avatarCol]=p)}E==="new"&&B.trim().length>=2&&ne.nameCol&&(H[ne.nameCol]=B.trim()),H[ne.tagCol]=te;const{error:N}=await D.from("profiles").update(H).eq("id",V);if(N)throw N;i(e)}catch(V){console.error("Space setup save error:",V),alert("Erreur lors de la sauvegarde. Réessayez.")}finally{d(!1)}};return t.jsxs("div",{style:{position:"fixed",inset:0,zIndex:99999,background:"rgba(0,0,0,0.85)",backdropFilter:"blur(15px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},children:[t.jsxs("div",{style:{maxWidth:"520px",width:"100%",background:"linear-gradient(180deg, #141420 0%, #0a0a14 100%)",borderRadius:"24px",border:`1px solid ${ne.color}30`,boxShadow:`0 0 60px ${ne.color}15`,overflow:"hidden",maxHeight:"90dvh",display:"flex",flexDirection:"column"},children:[t.jsxs("div",{style:{padding:"24px 28px 16px",borderBottom:`1px solid ${ne.color}20`,position:"relative"},children:[t.jsx("button",{onClick:n,style:{position:"absolute",top:"16px",right:"16px",background:"rgba(255,255,255,0.08)",border:"none",borderRadius:"50%",width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"white"},children:t.jsx(mt,{size:16})}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"12px"},children:[t.jsx("div",{style:{width:"44px",height:"44px",borderRadius:"14px",background:ne.gradient,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:`0 4px 16px ${ne.color}40`},children:t.jsx(Re,{size:22,color:"white"})}),t.jsxs("div",{children:[t.jsxs("div",{style:{fontFamily:"Outfit",fontWeight:"800",fontSize:"1.2rem",color:"white"},children:["Bienvenue sur ",ne.label]}),t.jsx("div",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.4)"},children:"Configure ton profil pour cet espace"})]})]}),t.jsx("div",{style:{display:"flex",gap:"6px"},children:[1,2,3].map(V=>t.jsx("div",{style:{flex:1,height:"3px",borderRadius:"2px",background:V<=o?ne.color:"rgba(255,255,255,0.08)",transition:"background 0.3s"}},V))}),t.jsxs("div",{style:{fontSize:"0.72rem",color:ne.color,marginTop:"8px",fontWeight:"600"},children:["Ãtape ",o,"/3 â ",o===1?"Tes photos":o===2?"Ton pseudo":"Tes préférences"]})]}),t.jsxs("div",{style:{flex:1,overflow:"auto",padding:"24px 28px"},children:[o===1&&t.jsxs("div",{children:[t.jsxs("h3",{style:{fontFamily:"Outfit",fontSize:"1.1rem",color:"white",margin:"0 0 8px",fontWeight:"700"},children:["ð· Tes photos pour ",ne.label]}),t.jsx("p",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.5)",margin:"0 0 16px",lineHeight:1.5},children:"Garde tes photos actuelles ou ajoutes-en de nouvelles."}),p&&t.jsxs("div",{onClick:()=>{g(!0),x([null,null,null,null])},style:{padding:"14px",borderRadius:"16px",border:u?`2px solid ${ne.color}
2708`:"2px solid rgba(255,255,255,0.08)",background:u?`${ne.color}10`:"rgba(255,255,255,0.03)",cursor:"pointer",display:"flex",alignItems:"center",gap:"14px",marginBottom:"12px",transition:"all 0.2s"},children:[t.jsx("img",{src:p,alt:"",style:{width:"56px",height:"56px",borderRadius:"14px",objectFit:"cover",border:`2px solid ${ne.color}40`}}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{fontWeight:"600",color:"white",fontSize:"0.9rem"},children:"Garder mes photos actuelles"}),t.jsx("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.4)",marginTop:"2px"},children:"Utiliser les mêmes photos"})]}),u&&t.jsx(pr,{size:20,color:ne.color})]}),t.jsxs("div",{onClick:()=>{u&&g(!1)},style:{padding:"14px",borderRadius:"16px",border:u?"2px solid rgba(255,255,255,0.08)":`2px solid ${ne.color}`,background:u?"rgba(255,255,255,0.03)":`${ne.color}08`,cursor:"pointer",transition:"all 0.2s"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"14px",marginBottom:u?0:"14px"},children:[t.jsx("div",{style:{width:"56px",height:"56px",borderRadius:"14px",background:`${ne.color}15`,display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(pi,{size:24,color:ne.color})}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{fontWeight:"600",color:"white",fontSize:"0.9rem"},children:"Choisir de nouvelles photos"}),t.jsx("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.4)",marginTop:"2px"},children:"1 principale + 3 optionnelles"})]}),!u&&t.jsx(pr,{size:20,color:ne.color})]}),!u&&t.jsxs("div",{children:[t.jsx("div",{onClick:V=>{V.stopPropagation(),h[0]||Q(0)},style:{width:"100%",maxWidth:"200px",margin:"0 auto",aspectRatio:"3/4",borderRadius:"16px",overflow:"hidden",border:h[0]?"none":`2px dashed ${ne.color}40`,background:h[0]?"none":"rgba(255,255,255,0.03)",cursor:h[0]?"default":"pointer",position:"relative"},children:h[0]?t.jsxs(t.Fragment,{children:[t.jsx("img",{src:h[0],alt:"Principale",style:{width:"100%",height:"100%",objectFit:"cover"}}),t.jsx("button",{onClick:V=>{V.stopPropagation(),le(0)},style:{position:"absolute",top:"6px",right:"6px",width:"24px",height:"24px",borderRadius:"50%",background:"rgba(0,0,0,0.6)",border:"none",color:"white",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(mt,{size:12})}),t.jsx("div",{style:{position:"absolute",bottom:"6px",left:"6px",background:"rgba(0,0,0,0.6)",borderRadius:"6px",padding:"3px 8px",fontSize:"0.65rem",color:ne.color,fontWeight:"600"},children:"ð¸ Principale"})]}):t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",gap:"8px"},children:[t.jsx(pi,{size:24,color:ne.color}),t.jsx("span",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.4)"},children:"Photo principale"})]})}),t.jsx("div",{style:{display:"flex",gap:"8px",justifyContent:"center",marginTop:"10px"},children:[1,2,3].map(V=>t.jsx("div",{onClick:H=>{H.stopPropagation(),h[V]||Q(V)},style:{width:"70px",height:"90px",borderRadius:"10px",overflow:"hidden",border:h[V]?"none":"1.5px dashed rgba(255,255,255,0.15)",background:h[V]?"none":"rgba(255,255,255,0.03)",cursor:h[V]?"default":"pointer",position:"relative"},children:h[V]?t.jsxs(t.Fragment,{children:[t.jsx("img",{src:h[V],alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}}),t.jsx("button",{onClick:H=>{H.stopPropagation(),le(V)},style:{position:"absolute",top:"3px",right:"3px",width:"18px",height:"18px",borderRadius:"50%",background:"rgba(0,0,0,0.6)",border:"none",color:"white",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(mt,{size:10})})]}):t.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:t.jsx(No,{size:16,color:"rgba(255,255,255,0.3)"})})},V))}),t.jsxs("button",{onClick:V=>{V.stopPropagation();const H=h.findIndex(N=>N!==null);H>=0&&(k(H),_(!0))},disabled:!h.some(V=>V!==null),style:{marginTop:"10px",width:"100%",padding:"10px",borderRadius:"10px",background:"rgba(255,255,255,0.04)",border:`1px solid rgba(255,255,255,${h.some(V=>V)?"0.12":"0.05"})`,color:h.some(V=>V)?"white":"rgba(255,255,255,0.25)",cursor:h.some(V=>V)?"pointer":"not-allowed",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",fontSize:"0.8rem"},children:[t.jsx(Vo,{size:14,color:h.some(V=>V)?ne.color:"rgba(255,255,255,0.25)"}),"Studio Photo"]})]})]}),t.jsxs("div",{style:{marginTop:"12px",display:"flex",gap:"10px"},children:[t.jsxs("button",{onClick:()=>b(!0),style:{flex:1,padding:"14px 10px",borderRadius:"16px",border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",cursor:"pointer",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",transition:"all 0.2s"},children:[t.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"50%",background:"rgba(239,68,68,0.1)",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(ia,{size:20,color:"#ef4444"})}),t.jsxs("div",{style:{textAlign:"center"},children:[t.jsx("div",{style:{fontWeight:"600",color:"white",fontSize:"0.8rem"},children:"Video Selfie"}),t.jsx("div",{style:{fontSize:"0.65rem",color:"rgba(255,255,255,0.4)",marginTop:"2px"},children:"Avatar animé"})]})]}),t.jsxs("button",{onClick:()=>T(!0),disabled:!A,style:{flex:1,padding:"14px 10px",borderRadius:"16px",border:`1px solid rgba(255,255,255,${A?"0.08":"0.04"})`,background:"rgba(255,255,255,0.03)",cursor:A?"pointer":"not-allowed",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",transition:"all 0.2s",opacity:A?1:.4}
2708,children:[t.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"50%",background:"rgba(168,85,247,0.1)",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(Xt,{size:20,color:"#a855f7"})}),t.jsxs("div",{style:{textAlign:"center"},children:[t.jsx("div",{style:{fontWeight:"600",color:"white",fontSize:"0.8rem"},children:"Photo Animée"}),t.jsx("div",{style:{fontSize:"0.65rem",color:"rgba(255,255,255,0.4)",marginTop:"2px"},children:"IA · 1 Meetip"})]})]})]}),t.jsx("input",{ref:P,type:"file",accept:"image/*",onChange:G,style:{display:"none"}})]}),o===2&&t.jsxs("div",{children:[t.jsxs("h3",{style:{fontFamily:"Outfit",fontSize:"1.1rem",color:"white",margin:"0 0 8px",fontWeight:"700"},children:["âï¸ Ton pseudo pour ",ne.label]}),t.jsx("p",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.5)",margin:"0 0 20px",lineHeight:1.5},children:"Tu peux utiliser un pseudo différent pour cet espace."}),t.jsxs("div",{onClick:()=>$("keep"),style:{padding:"16px",borderRadius:"16px",border:E==="keep"?`2px solid ${ne.color}`:"2px solid rgba(255,255,255,0.08)",background:E==="keep"?`${ne.color}10`:"rgba(255,255,255,0.03)",cursor:"pointer",display:"flex",alignItems:"center",gap:"14px",marginBottom:"12px",transition:"all 0.2s"},children:[t.jsx("div",{style:{width:"48px",height:"48px",borderRadius:"50%",background:`${ne.color}15`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.2rem",fontWeight:"800",color:ne.color,fontFamily:"Outfit"},children:O.charAt(0).toUpperCase()}),t.jsxs("div",{style:{flex:1},children:[t.jsxs("div",{style:{fontWeight:"600",color:"white",fontSize:"0.9rem"},children:["Garder « ",O," »"]}),t.jsx("div",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.4)",marginTop:"2px"},children:"Même pseudo que ton profil principal"})]}),E==="keep"&&t.jsx(pr,{size:20,color:ne.color})]}),t.jsxs("div",{onClick:()=>$("new"),style:{padding:"16px",borderRadius:"16px",border:E==="new"?`2px solid ${ne.color}`:"2px solid rgba(255,255,255,0.08)",background:E==="new"?`${ne.color}10`:"rgba(255,255,255,0.03)",cursor:"pointer",transition:"all 0.2s"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"14px",marginBottom:E==="new"?"14px":0},children:[t.jsx("div",{style:{width:"48px",height:"48px",borderRadius:"50%",background:"rgba(255,255,255,0.06)",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx(Ur,{size:22,color:"rgba(255,255,255,0.5)"})}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{fontWeight:"600",color:"white",fontSize:"0.9rem"},children:"Choisir un autre pseudo"}),t.jsx("div",{style:{fontSize:"0.75rem",color:"rgba(255,255,255,0.4)",marginTop:"2px"},children:"Pour rester discret ou changer d'identité"})]}),E==="new"&&t.jsx(pr,{size:20,color:ne.color})]}),E==="new"&&t.jsx("input",{type:"text",value:B,onChange:V=>ee(V.target.value),placeholder:"Ton nouveau pseudoâ¦",autoFocus:!0,style:{width:"100%",padding:"12px 14px",background:"rgba(255,255,255,0.06)",border:`1px solid ${ne.color}30`,borderRadius:"10px",color:"white",fontSize:"0.95rem",fontFamily:"Outfit",outline:"none",boxSizing:"border-box"}})]})]}),o===3&&t.jsxs("div",{children:[t.jsxs("h3",{style:{fontFamily:"Outfit",fontSize:"1.1rem",color:"white",margin:"0 0 8px",fontWeight:"700"},children:["ð·ï¸ Tes préférences ",ne.label]}),t.jsx("p",{style:{fontSize:"0.85rem",color:"rgba(255,255,255,0.5)",margin:"0 0 16px",lineHeight:1.5},children:"Sélectionne au moins 1 tag pour commencer."}),ne.sections.map(V=>t.jsxs("div",{style:{marginBottom:"20px"},children:[t.jsx("div",{style:{fontSize:"0.8rem",fontWeight:"700",color:V.color||ne.color,marginBottom:"10px",fontFamily:"Outfit",letterSpacing:"0.5px"},children:V.title}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:V.items.map(H=>{const N=te.includes(H.id),Z=H.icon;return t.jsxs("button",{onClick:()=>F(H.id),style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 14px",borderRadius:"20px",border:N?`1.5px solid ${V.color||ne.color}`:"1px solid rgba(255,255,255,0.1)",background:N?`${V.color||ne.color}18`:"rgba(255,255,255,0.04)",color:N?V.color||ne.color:"rgba(255,255,255,0.7)",fontSize:"0.78rem",fontFamily:"Inter, sans-serif",curs
2708or:"pointer",transition:"all 0.15s",fontWeight:N?"600":"400"},children:[t.jsx(Z,{size:14}),H.label,N&&t.jsx(pr,{size:12})]},H.id)})})]},V.id))]})]}),t.jsxs("div",{style:{padding:"16px 28px 20px",borderTop:"1px solid rgba(255,255,255,0.06)",display:"flex",gap:"12px"},children:[o>1&&t.jsx("button",{onClick:()=>a(V=>V-1),style:{padding:"14px 20px",borderRadius:"14px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"white",fontSize:"0.9rem",cursor:"pointer",fontFamily:"Outfit"},children:"Retour"}),t.jsx("button",{onClick:()=>{o<3?a(V=>V+1):M()},disabled:o===3&&(te.length===0||l)||o===1&&!A,style:{flex:1,padding:"14px",borderRadius:"14px",background:o===3&&te.length===0||o===1&&!A?"rgba(255,255,255,0.06)":ne.gradient,border:"none",color:o===3&&te.length===0||o===1&&!A?"rgba(255,255,255,0.3)":ne.textColor,fontSize:"0.95rem",fontWeight:"700",cursor:o===3&&te.length===0||o===1&&!A?"not-allowed":"pointer",fontFamily:"Outfit",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",opacity:l?.6:1,transition:"all 0.2s"},children:l?t.jsx("div",{style:{width:"20px",height:"20px",borderRadius:"50%",border:"2.5px solid rgba(0,0,0,0.2)",borderTopColor:ne.textColor,animation:"spin 0.8s linear infinite"}}):o<3?t.jsxs(t.Fragment,{children:["Suivant ",t.jsx(Pr,{size:18})]}):t.jsxs(t.Fragment,{children:["C'est parti ! ",t.jsx(Pr,{size:18})]})})]}),t.jsx("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]}),y&&S!==null&&h[S]&&t.jsx(h0,{imageUrl:h[S],onClose:()=>{_(!1),k(null)},onSave:V=>{x(H=>{const N=[...H];return N[S]=V,N}),_(!1),k(null)}}),w&&t.jsx(c5,{profileId:r==null?void 0:r.id,mode:e,onClose:()=>b(!1),onSuccess:()=>b(!1)}),j&&t.jsx(d5,{currentPhoto:u?p:h.find(V=>V)||p,currentAnimatedUrl:r==null?void 0:r.animated_photo_url,onClose:()=>T(!1),onSuccess:()=>T(!1)})]})},MF=({userProfile:e,onOpenMessenger:r})=>{const i=Lt(),n=ko(),{mode:o,setMode:a,lightMode:l,toggleLightMode:d}=dr(),{signOut:p,refreshProfile:u}=gr(),[g,h]=m.useState(!1),[x,y]=m.useState(0),[_,S]=m.useState(0),[k,w]=m.useState(!1),[b,j]=m.useState(0),[T,P]=m.useState(!1),I=m.useRef(null),R=xn(),[O,E]=m.useState(!1),[$,B]=m.useState(null),ee=o==="EROX"?(e==null?void 0:e.erox_name)||(e==null?void 0:e.name):o==="FRIEND"&&(e==null?void 0:e.friend_name)||(e==null?void 0:e.name);m.useEffect(()=>{if(!(e!=null&&e.id))return;const Q=async()=>{try{const{data:M,error:V}=await D.from("hidden_conversations").select("match_id").eq("user_id",e.id);if(V)throw V;const H=M?M.map(ze=>ze.match_id):[],{data:N}=await D.from("blocked_users").select("blocked_id").eq("blocker_id",e.id),Z=N?N.map(ze=>ze.blocked_id):[],ae=[...new Set([...H,...Z])];let X=D.from("messages").select("*",{count:"exact",head:!0}).eq("receiver_id",e.id).eq("is_read",!1);ae.length>0&&(X=X.not("sender_id","in",`(${ae.join(",")})`));const{count:he,error:Ae}=await X;!Ae&&he!==null&&y(he)}catch(M){console.warn("Header: Error fetching unread count (ignored for stability):",M)}},G=async()=>{if(e)try{const{data:M,error:V}=await D.from("events").select("id").eq("creator_id",e.id);if(V)throw V;if(M&&M.length>0){const H=M.map(ae=>ae.id),{count:N,error:Z}=await D.from("event_participants").select("id",{count:"exact",head:!0}).in("event_id",H).eq("status","pending");!Z&&N>0?w(!0):w(!1)}else w(!1)}catch(M){console.warn("Header: Error checking notifications (ignored for stability):",M),w(!1)}};Q(),G();let le;try{le=D.channel("global_unread_badges").on("postgres_changes",{event:"*",schema:"public",table:"messages",filter:`receiver_id=eq.${e.id}`},()=>Q()).subscribe()}catch(M){console.warn("Header: Realtime sub failed",M)}const F=setInterval(G,15e3),A=()=>Q();return window.addEventListener("messages-read",A),()=>{le&&D.removeChannel(le),window.removeEventListener("messages-read",A),clearInterval(F)}},[e==null?void 0:e.id,n.pathname]),m.useEffect(()=>{h(localStorage.getItem("isPremium")==="true");const Q=()=>{h(localStorage.getItem("isPremium")==="true")};return window.addEventListener("storage",Q),()=>window.removeEventListener("storage",Q)},[n.pathname]),m.useEffect(()=>{const Q=async()=>
2708{if(e!=null&&e.id)try{const le=await wi.getUnseenGiftsCount(e.id);S(le)}catch(le){console.warn("Header: Failed to fetch gifts count",le)}};Q();const G=setInterval(Q,3e4);return()=>clearInterval(G)},[e]),m.useEffect(()=>{const Q=async()=>{if(e!=null&&e.id&&o==="FRIEND")try{const{count:le,error:F}=await D.from("entraide_bookings").select("*",{count:"exact",head:!0}).eq("provider_id",e.id).eq("status","pending");F||j(le||0)}catch(le){console.warn("Header: Failed to fetch entraide pending",le)}};Q();const G=setInterval(Q,3e4);return()=>clearInterval(G)},[e==null?void 0:e.id,o]),m.useEffect(()=>{try{const Q=document.querySelector("link[rel*='icon']")||document.createElement("link");Q.type="image/png",Q.rel="shortcut icon",o==="FRIEND"?Q.href="/logo_wing_blue.png":o==="EROX"?Q.href="/logo_wing_red.png":Q.href="/logo_wing_gold.png",document.getElementsByTagName("head")[0].appendChild(Q)}catch{}},[o]);const te=Q=>Q.startsWith("/profile-view")&&e?n.pathname===`/profile-view/${e.id}`:n.pathname===Q,K=[{icon:Bt,label:"Profils",path:"/matches"},{icon:cr,label:"Ãvénements",path:"/events",badge:k},{icon:nr,label:"Favoris",path:"/favorites"},...(e==null?void 0:e.role)==="admin"?[{icon:Sr,label:"Admin",path:"/admin"}]:[],{icon:Sn,label:"Expert Eros",path:"/eros-expert",special:!0},{icon:Qt,label:"Messenger",path:"/messages"},{icon:Ur,label:"Perso",path:"/account"},{icon:ys,label:"Mes Cadeaux",path:"/shop",badge:_>0?_:null},...o==="FRIEND"?[{icon:jh,label:"Entraide",path:"/entraide",badge:b>0?b:null}]:[]],ne=Q=>{if(o!==Q){if(!e){a(Q);return}if(Q==="EROX"){if(!(Array.isArray(e.erox_tags)&&e.erox_tags.length>0)){B("EROX");return}}else if(Q==="FRIEND"){if(!(Array.isArray(e.friend_tags)&&e.friend_tags.length>0)){B("FRIEND");return}}else if(Q==="EROS"&&!(Array.isArray(e.tags)&&e.tags.length>0)){B("EROS");return}a(Q),i("/home"),R&&E(!1)}},Re=Q=>{a(Q),B(null),u(),i("/matches"),R&&E(!1)};return m.useEffect(()=>{((e==null?void 0:e.restriction_status)==="restricted"||(e==null?void 0:e.restriction_status)==="pending_review")&&n.pathname!=="/complete-profile"&&n.pathname!=="/login"&&i("/complete-profile")},[e==null?void 0:e.restriction_status,n.pathname,i]),m.useEffect(()=>{const Q=G=>{I.current&&!I.current.contains(G.target)&&P(!1)};return T&&document.addEventListener("mousedown",Q),()=>document.removeEventListener("mousedown",Q)},[T]),t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"glass",style:{padding:R?"10px 12px":"10px 30px",paddingTop:R?"calc(env(safe-area-inset-top, 0px) + 10px)":"10px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:R?"8px":"0",borderBottom:"1px solid rgba(255,255,255,0.05)",position:"fixed",top:0,left:0,width:"100%",zIndex:1e3,background:o==="EROX"?"linear-gradient(180deg, #1a0505 0%, #000000 100%)":o==="FRIEND"?"linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%)":"linear-gradient(180deg, #0A1015 0%, #020508 100%)",color:"white",backdropFilter:"blur(30px)",boxSizing:"border-box"},children:[t.jsx("div",{onClick:()=>i("/home"),style:{cursor:"pointer",display:"flex",alignItems:"center",flexShrink:0},children:t.jsx("img",{src:o==="FRIEND"?"/logo_full_friend.png":o==="EROX"?"/logo_full_erox.png":"/logo_full_eros.png",alt:"MEET App",style:{height:R?"38px":"50px",objectFit:"contain",transition:"all 0.3s"}},o)}),(e==null?void 0:e.restriction_status)==="restricted"||(e==null?void 0:e.restriction_status)==="pending_review"?t.jsxs("div",{style:{color:"#ff4d4d",fontWeight:"bold",display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx(Sr,{size:20})," COMPTE RESTREINT"]}):t.jsxs(t.Fragment,{children:[R&&t.jsx("div",{style:{flex:1,display:"flex",justifyContent:"center"},children:t.jsx(Rg,{mode:o,onSwitch:ne,variant:"compact"})}),!R&&t.jsx("div",{style:{display:"flex",gap:"20px"},children:K.map(Q=>{const G=Q.label==="Expert Eros",le=G&&!g;return te(Q.path),te(Q.path),t.jsxs("div",{onClick:F=>{Q.label==="Messenger"&&y(0),Q.path==="/messages"&&r?(F.preventDefault(),r()):i(G&&!g?"/subscription":Q.path)},style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"5px",cursor:"pointer",color:te(Q.path)?o==="FRIEND"?"#26A69A":"var(--primary)":o==="FRIEND"?"#80CBC4":"var(--text-muted)",transition:"color 0.2s",padding:"5px 10px",borderBottom:te(Q.path)?`2px solid ${o==="FRIEND"?"#26A69A":"var(--primary)"}
2708`:"2px solid transparent",position:"relative"},children:[t.jsxs("div",{style:{position:"relative"},children:[t.jsx(Q.icon,{size:20,color:te(Q.path)?o==="FRIEND"?"#26A69A":"var(--primary)":o==="FRIEND"?"#80CBC4":"currentColor"}),le&&t.jsx("div",{style:{position:"absolute",top:-5,right:-8,background:"#222",borderRadius:"50%",padding:"2px"},children:t.jsx(Fr,{size:10,color:"white"})}),Q.label==="Messenger"&&x>0&&t.jsx("span",{style:{position:"absolute",top:"-8px",right:"-8px",background:"#ff4d4d",color:"white",borderRadius:"50%",width:"16px",height:"16px",fontSize:"0.65rem",display:"flex",alignItems:"center",justifyContent:"center",opacity:1,transform:"scale(1)",transition:"all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)"},children:x}),Q.badge&&t.jsx("span",{style:{position:"absolute",top:"-5px",right:"-8px",background:"#ff4d4d",width:"10px",height:"10px",borderRadius:"50%",border:"1px solid white"}}),Q.label==="Boutique"&&(e==null?void 0:e.meetips_balance)>0&&t.jsx("div",{style:{position:"absolute",top:-10,right:-12,background:"#8a2be2",color:"white",borderRadius:"10px",padding:"2px 5px",fontSize:"0.6rem",fontWeight:"bold"},children:e.meetips_balance})]}),t.jsx("span",{style:{fontSize:"0.7rem"},children:Q.label})]},Q.label)})})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R?"8px":"20px",flexShrink:0},children:[!R&&e&&t.jsx(Rg,{mode:o,onSwitch:ne,variant:"full"}),e&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",position:"relative"},ref:I,children:[!R&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",lineHeight:"1.2"},children:[t.jsxs("span",{style:{fontSize:"0.9rem",color:"white",fontWeight:"bold",display:"flex",alignItems:"center",gap:"5px"},children:[ee,e.verification_status==="verified"&&t.jsx(fi,{size:14,fill:"#26A69A",color:"#103030"})]}),t.jsxs("span",{onClick:()=>i("/shop"),style:{fontSize:"0.75rem",color:o==="EROX"?"#ff4d4d":o==="FRIEND"?"#FF7043":"#8a2be2",fontWeight:"bold",display:"flex",alignItems:"center",gap:"4px",cursor:"pointer"},onMouseEnter:Q=>Q.currentTarget.style.opacity="0.7",onMouseLeave:Q=>Q.currentTarget.style.opacity="1",children:[t.jsx(Jt,{size:14})," ",e.meetips_balance||0," Meetips"]})]}),t.jsx("div",{onClick:()=>R?E(!0):P(!T),style:{cursor:"pointer"},children:(()=>{const Q=o==="EROX"?e.erox_avatar_url:o==="FRIEND"?e.friend_avatar_url:e.animated_photo_url||e.avatar_url||e.photo;if(Q)return t.jsx(Mo,{photoUrl:Q,animatedUrl:o==="EROS"&&e.animated_photo_url||null,alt:"Me",size:40,borderColor:o==="EROX"?"#ff4d4d":o==="FRIEND"?"#26A69A":"var(--primary)"});const G=o==="EROX"?"#ff4d4d":o==="FRIEND"?"#26A69A":"var(--primary)";return t.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"50%",border:`2px dashed ${G}80`,background:"rgba(255,255,255,0.05)",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:`${G}90`,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),t.jsx("circle",{cx:"12",cy:"7",r:"4"})]})})})()}),T&&t.jsxs("div",{style:{position:"absolute",top:"55px",right:0,background:"rgba(20, 20, 35, 0.98)",backdropFilter:"blur(20px)",borderRadius:"16px",border:"1px solid rgba(255,255,255,0.1)",boxShadow:"0 15px 40px rgba(0,0,0,0.6)",minWidth:"220px",overflow:"hidden",animation:"menuSlideIn 0.2s ease-out",zIndex:9999},children:[t.jsx("style",{children:"@keyframes menuSlideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }"}),t.jsxs("div",{style:{padding:"16px 18px",borderBottom:"1px solid rgba(255,255,255,0.08)",display:"flex",alignItems:"center",gap:"12px"},children:[(()=>{const Q=o==="EROX"?e.erox_avatar_url:o==="FRIEND"?e.friend_avatar_url:e.animated_photo_url||e.avatar_url||e.photo,G=o==="EROX"?"#ff4d4d":o==="FRIEND"?"#26A69A":"var(--primary)";return Q?t.jsx("img",{src:Q,style:{width:"36px",height:"36px",borderRadius:"50%",objectFit:"cover",border:`2px solid ${G}`},alt:""}):t.jsx("div",{style:{width:"36px",height:"36px",borderRadius:"50%",border:`2px dashed ${G}80`,background:"rgba(255,255,255,0.05)",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:`${G}90`,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),t.jsx("circle",{cx:"12",cy:"7",r:"4"})]})})})(),t.jsxs("div",{children:[t.jsx("div",{style:{fontWeight:"700",fontSize:"0.9rem",color:"white"},children:ee}),t.jsx("div",{style:{fontSize:"0.72rem",color:"rgba(255,255,255,0.4)"},children:e.email||""})]})]}),[{icon:Ur,label:"Perso",action:()=>{i("/account"),P(!1)}},{icon:dx,label:"Réglages",action:()=>{i("/settings"),P(!1)}}].map((Q,G)=>t.jsxs("div",{onClick:Q.action,style:{padding:"12px 18px",display:"flex",alignItems:"center",gap:"12px",cursor:"pointer",color:"rgba(255,255,255,0.8)",fontSize:"0.88rem",transition:"background 0.15s"},onMouseEnter:le=>le.currentTarget.style.background="rgba(255,255,255,0.06)",onMouseLeave:le=>le.currentTarget.style.background="transparent",children:[t.jsx(Q.icon,{size:18,color:"rgba(255,255,255,0.5)"}),Q.label]},G)),t.jsx("div",{style:{borderTop:"1px solid rgba(255,255,255,0.08)"},children:t.jsxs("div",{onClick:()=>{P(!1),p()},style:{padding:"12px 18px",display:"flex",alignItems:"center",gap:"12px",cursor:"pointer",color:"#ff4d4d",fontSize:"0.88rem",transition:"background 0.15s"},onMouseEnter:Q=>Q.currentTarget.style.background="rgba(255,0,0,0.06)",onMouseLeave:Q=>Q.currentTarget.style.background="transparent",children:[t.jsx(_h,{size:18,color:"#ff4d4d"}),"Déconnexion"]})})]})]}),R&&t.jsxs("button",{onClick:()=>E(!0),style:{background:"rgba(255,255,255,0.1)",border:"none",padding:"8px",borderRadius:"8px",color:"white",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx(n5,{size:24}),x>0&&t.jsx("div",{style:{position:"absolute",top:"10px",right:"10px",width:"8px",height:"8px",background:"red",borderRadius:"50%"}})]})]})]})]}),R&&O&&(()=>{const Q=o==="EROX"?"#ff3333":o==="FRIEND"?"#FF7043":"#a855f7",G=o==="EROX"?"linear-gradient(135deg, #ff3333, #dc2626)":o==="FRIEND"?"linear-gradient(135deg, #FF7043, #FF4081)":"linear-gradient(135deg, #a85
27085f7, #ec4899)",le={Matches:"ð",Ãvénements:"ð ",Favoris:"â",Admin:"ð¡ï¸","Expert Eros":"ð§ ",Messenger:"ð¬",Perso:"ð¤","Mes Cadeaux":"ð",Entraide:"ð¤",Profils:"ð"},F={Matches:"Vos affinités",Ãvénements:"Sorties & soirées",Favoris:"Profils sauvegardés",Admin:"Tableau de bord","Expert Eros":"IA séduction",Messenger:"Conversations",Perso:"Votre espace","Mes Cadeaux":"Cadeaux & Meetips",Entraide:"Services entre amis",Profils:"Vos affinités"},A={Matches:"#a855f7",Ãvénements:"#06b6d4",Favoris:"#eab308",Admin:"#22c55e","Expert Eros":"#f97316",Messenger:"#3b82f6",Perso:"#ec4899","Mes Cadeaux":"#8b5cf6",Entraide:"#26A69A",Profils:"#a855f7"};return t.jsxs("div",{style:{position:"fixed",inset:0,zIndex:9999,background:l?"linear-gradient(180deg, #FAF7F2 0%, #F0EBE1 40%, #FAF7F2 100%)":"linear-gradient(180deg, #0a0814 0%, #0d0b1a 40%, #0a0f17 100%)",backdropFilter:"blur(20px)",display:"flex",flexDirection:"column",animation:"menuSlideIn 0.3s ease-out",overflow:"auto"},children:[t.jsx("style",{children:` 2709 @keyframes menuSlideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } } 2710 @keyframes menuCardIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } } 2711 @keyframes glowPulse { 0%, 100% { box-shadow: 0 0 12px ${Q}30; } 50% { box-shadow: 0 0 24px ${Q}50; } } 2712 @keyframes badgeBounce { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } } 2713 `}),t.jsx("div",{style:{position:"absolute",top:"-50px",right:"-60px",width:"250px",height:"250px",borderRadius:"50%",background:`radial-gradient(circle, ${Q}15, transparent 70%)`,pointerEvents:"none",filter:"blur(40px)"}}),t.jsx("div",{style:{position:"absolute",bottom:"10%",left:"-40px",width:"200px",height:"200px",borderRadius:"50%",background:"radial-gradient(circle, rgba(6,182,212,0.1), transparent 70%)",pointerEvents:"none",filter:"blur(40px)"}}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px 20px",paddingTop:"calc(env(safe-area-inset-top, 0px) + 16px)",position:"relative",zIndex:2},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[t.jsx("div",{style:{width:"44px",height:"44px",borderRadius:"14px",background:G,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:`0 4px 16px ${Q}40`},children:o==="EROX"?t.jsx(en,{size:22,color:"white"}):o==="FRIEND"?t.jsx(Ut,{size:22,color:"white"}):t.jsx(Bt,{size:22,color:"white"})}),t.jsxs("div",{children:[t.jsxs("div",{style:{fontFamily:"Outfit",fontWeight:"800",fontSize:"1.15rem",background:l?`linear-gradient(135deg, #2A2520, ${Q})`:`linear-gradient(135deg, white, ${Q})`,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:["MEET ",o==="EROX"?"Erox":o==="FRIEND"?"Friend":"Eros"]}),t.jsx("div",{style:{fontSize:"0.68rem",color:l?"#8C7A60":"rgba(255,255,255,0.4)",fontWeight:"500"},children:"Navigation"})]})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx("button",{onClick:d,style:{background:l?"rgba(245,185,50,0.15)":"rgba(100,140,230,0.15)",border:l?"1.5px solid rgba(245,185,50,0.35)":"1.5px solid rgba(100,140,230,0.3)",color:l?"#F5B932":"#8BAAF0",borderRadius:"12px",width:"42px",height:"42px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.3s"},children:l?t.jsx(rl,{size:20}):t.jsx(_d,{size:20})}),t.jsx("button",{onClick:()=>E(!1),style:{background:l?"rgba(140,115,75,0.08)":"rgba(255,255,255,0.06)",border:l?"1.5px solid rgba(140,115,75,0.2)":"1px solid rgba(255,255,255,0.1)",color:l?"#3D3528":"white",borderRadius:"12px",width:"42px",height:"42px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.2s"},children:t.jsx(mt,{size:22})})]})]}),t.jsx("div",{style:{padding:"0 20px",marginBottom:"20px",position:"relative",zIndex:2},children:t.jsx(Rg,{mode:o,onSwitch:ne,variant:"menu"})}),t.jsx("div",{style:{padding:"0 16px",flex:1,position:"relative",zIndex:2},children:t.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"10px"},children:K.map((M,V)=>{const H=M.label==="Expert Eros"&&!g,N=A[M.label]||Q,Z=te(M.path);return t.jsxs("div",{onClick:ae=>
2713{E(!1),M.path==="/messages"&&r?(ae.preventDefault(),r()):i(H?"/subscription":M.path)},style:{background:Z?`linear-gradient(160deg, ${N}18, ${N}08)`:l?"rgba(140,115,75,0.04)":"linear-gradient(160deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015))",padding:"18px 14px",borderRadius:"18px",display:"flex",flexDirection:"column",gap:"8px",border:Z?`1.5px solid ${N}40`:l?"2px solid rgba(140,115,75,0.25)":"1px solid rgba(255,255,255,0.06)",cursor:"pointer",transition:"all 0.25s",position:"relative",overflow:"hidden",animation:`menuCardIn 0.3s ease-out ${V*.04}s both`,boxShadow:Z?`0 0 20px ${N}15`:"none"},children:[Z&&t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"2px",background:`linear-gradient(90deg, transparent, ${N}, transparent)`}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[t.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:Z?`${N}20`:l?"rgba(140,115,75,0.06)":"rgba(255,255,255,0.05)",display:"flex",alignItems:"center",justifyContent:"center",border:`1px solid ${Z?`${N}30`:l?"rgba(140,115,75,0.15)":"rgba(255,255,255,0.06)"}`,transition:"all 0.25s"},children:t.jsx(M.icon,{size:20,color:Z?N:l?"#3D3528":"rgba(255,255,255,0.6)"})}),M.label==="Messenger"&&x>0&&t.jsx("div",{style:{background:"linear-gradient(135deg, #ef4444, #f97316)",color:"white",fontSize:"0.65rem",fontWeight:"800",padding:"3px 8px",borderRadius:"10px",animation:"badgeBounce 2s infinite",boxShadow:"0 2px 8px rgba(239,68,68,0.4)"},children:x}),M.label==="Mes Cadeaux"&&_>0&&t.jsxs("div",{style:{background:"linear-gradient(135deg, #a855f7, #ec4899)",color:"white",fontSize:"0.65rem",fontWeight:"800",padding:"3px 8px",borderRadius:"10px",animation:"badgeBounce 2s infinite",boxShadow:"0 2px 8px rgba(168,85,247,0.4)"},children:["ð ",_]}),M.label==="Ãvénements"&&k&&t.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",background:"#06b6d4",boxShadow:"0 0 8px #06b6d4"}}),M.label==="Entraide"&&b>0&&t.jsxs("div",{style:{background:"linear-gradient(135deg, #26A69A, #00897B)",color:"white",fontSize:"0.65rem",fontWeight:"800",padding:"3px 8px",borderRadius:"10px",animation:"badgeBounce 2s infinite",boxShadow:"0 2px 8px rgba(38,166,154,0.4)"},children:["ð ",b]})]}),t.jsxs("div",{children:[t.jsxs("div",{style:{fontWeight:"600",fontSize:"0.9rem",color:Z?l?"#2A2520":"white":l?"#3D3528":"rgba(255,255,255,0.75)",display:"flex",alignItems:"center",gap:"6px",marginBottom:"2px"},children:[t.jsx("span",{children:le[M.label]||"ð±"}),t.jsx("span",{children:M.label}),H&&t.jsx(Fr,{size:12,color:"rgba(255,255,255,0.3)"})]}),t.jsx("div",{style:{fontSize:"0.67rem",color:l?"#8C7A60":"rgba(255,255,255,0.3)",fontWeight:"400"},children:F[M.label]||""})]})]},M.label)})})}),t.jsxs("div",{style:{margin:"16px 16px 20px",padding:"16px 18px",background:l?"linear-gradient(135deg, rgba(140,115,75,0.06), rgba(140,115,75,0.02))":"linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02))",borderRadius:"18px",border:l?"2px solid rgba(140,115,75,0.2)":"1px solid rgba(255,255,255,0.08)",display:"flex",alignItems:"center",gap:"14px",position:"relative",zIndex:2,backdropFilter:"blur(20px)"},children:[t.jsxs("div",{style:{position:"relative"},children:[(()=>{const M=o==="EROX"?e==null?void 0:e.erox_avatar_url:o==="FRIEND"?e==null?void 0:e.friend_avatar_url:(e==null?void 0:e.animated_photo_url)||(e==null?void 0:e.photo)||(e==null?void 0:e.avatar_url);return M?t.jsx("img",{src:M,style:{width:"52px",height:"52px",borderRadius:"16px",objectFit:"cover",border:`2px solid ${Q}50`,boxShadow:`0 0 16px ${Q}20`}}):t.jsx("div",{style:{width:"52px",height:"52px",borderRadius:"16px",border:`2px dashed ${Q}60`,background:"rgba(255,255,255,0.05)",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:`${Q}90`,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),t.jsx("circle",{cx:"12",cy:"7",r:"4"})]})})})(),(e==null?void 0:e.verification_status)==="verified"&&t.jsx("div",{style:{position:"absolute",bottom:"-3px",right:"-3px",background:"#0a0814",borderRadius:"50%",padding:"1px"},children:t.jsx(fi,{size:16,fill:"#26A69A",color:"#103030"})})]}),t.jsxs("div",{style:{flex:1},children:[t.jsxs("div",{style:{fontWeight:"700",fontSize:"1rem",fontFamily:"Outfit",color:l?"#2A2520":"white",marginBottom:"2px"},children:[ee,(e==null?void 0:e.role)==="admin"&&t.jsx("span",{style:{fontSize:"0.62rem",color:Q,fontWeight:"600",marginLeft:"6px",background:`${Q}15`,padding:"2px 8px",borderRadius:"6px"},children:"Admin"})]}),t.jsxs("div",{onClick:()=>{E(!1),i("/shop")},style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"0.8rem",cursor:"pointer"}
2713,children:[t.jsxs("span",{style:{background:G,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",fontWeight:"700"},children:[t.jsx(Jt,{size:14})," ",(e==null?void 0:e.meetips_balance)||0]}),t.jsx("span",{style:{color:l?"#8C7A60":"rgba(255,255,255,0.35)"},children:"Meetips"})]})]}),t.jsxs("div",{style:{display:"flex",gap:"8px"},children:[t.jsx("div",{style:{background:`${Q}12`,border:`1px solid ${Q}25`,borderRadius:"10px",padding:"8px 12px",fontSize:"0.72rem",color:Q,fontWeight:"600",cursor:"pointer"},onClick:()=>{E(!1),i("/settings")},children:t.jsx(dx,{size:16})}),t.jsx("div",{style:{background:"rgba(255,77,77,0.1)",border:"1px solid rgba(255,77,77,0.25)",borderRadius:"10px",padding:"8px 12px",fontSize:"0.72rem",color:"#ff4d4d",fontWeight:"600",cursor:"pointer"},onClick:()=>{E(!1),p()},children:t.jsx(_h,{size:16})})]})]})]})})(),$&&t.jsx(FF,{targetMode:$,userProfile:e,onComplete:Re,onCancel:()=>B(null)})]})},DF=({count:e,color:r})=>!e||e<=0?null:t.jsx(ye.div,{initial:{scale:0},animate:{scale:1},style:{position:"absolute",top:"-2px",right:"-6px",minWidth:"18px",height:"18px",borderRadius:"9px",background:"#FF3B5C",color:"#fff",fontSize:"10px",fontWeight:"700",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 4px",border:"2px solid rgba(10, 10, 20, 0.9)",boxShadow:"0 2px 8px rgba(255, 59, 92, 0.4)",letterSpacing:"-0.2px"},children:e>99?"99+":e}),BF=()=>{const e=Lt(),r=ko(),{mode:i,lightMode:n}=dr();if(!xn()&&!Jo())return null;const a=i==="EROX"?"#ff3333":i==="FRIEND"?"#26A69A":"#D4C4A8",l=[{icon:od,label:"Accueil",path:"/home",badge:0},{icon:Bt,label:"Profils",path:"/matches",badge:0},{icon:cr,label:"Sorties",path:"/events",badge:0},{icon:Qt,label:"Messages",path:"/messages",badge:0},{icon:Ur,label:"Perso",path:"/account",badge:0}],d=m.useCallback((p,u)=>{mr(),p.path==="/matches"?e("/matches?view=hub",{replace:u}):e(p.path)},[e]);return t.jsx("div",{style:{position:"fixed",bottom:0,left:0,right:0,zIndex:9998,background:n?"linear-gradient(180deg, rgba(250, 247, 242, 0.92) 0%, rgba(240, 235, 225, 0.97) 100%)":"linear-gradient(180deg, rgba(15, 15, 25, 0.75) 0%, rgba(8, 8, 16, 0.92) 100%)",backdropFilter:"blur(40px) saturate(1.8)",WebkitBackdropFilter:"blur(40px) saturate(1.8)",borderTop:n?"1.5px solid rgba(140, 115, 75, 0.25)":"0.5px solid rgba(255, 255, 255, 0.12)",display:"flex",justifyContent:"space-around",alignItems:"stretch",paddingTop:"6px",paddingLeft:"4px",paddingRight:"4px",paddingBottom:"calc(env(safe-area-inset-bottom, 0px) + 8px)",boxShadow:n?"0 -4px 20px rgba(120, 100, 60, 0.08)":"0 -8px 40px rgba(0, 0, 0, 0.35)"},children:l.map(p=>{const u=r.pathname===p.path,g=p.icon;return t.jsxs(ye.button,{onClick:()=>d(p,u),whileTap:{scale:.88},transition:{type:"spring",stiffness:500,damping:20},style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",gap:"2px",background:"none",border:"none",cursor:"pointer",padding:"2px 2px 4px",position:"relative",WebkitTapHighlightColor:"transparent"},children:[u&&t.jsx(ye.div,{layoutId:"activeTabPill",style:{position:"absolute",top:"-6px",width:"32px",height:"3px",borderRadius:"2px",background:`linear-gradient(90deg, ${a}CC, ${a})`,boxShadow:`0 0 16px ${a}60, 0 0 6px ${a}`},transition:{type:"spring",stiffness:350,damping:30}}),t.jsxs("div",{style:{position:"relative"},children:[t.jsx(ye.div,{animate:{scale:1,y:u?-1:0},style:{width:"36px",height:"36px",borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center",background:u?`${a}18`:"transparent",transition:"background 0.3s ease"},children:t.jsx(g,{size:u?26:24,color:u?a:n?"#3D3528":"rgba(255, 255, 255, 0.65)",fill:u?`${a}`:"none",strokeWidth:u?2.4:2,style:{transition:"all 0.25s ease"}})}),t.jsx(DF,{count:p.badge,color:a})]}),t.jsx("span",{style:{fontSize:"11px",fontWeight:u?"700":"500",color:u?a:n?"#4A3F30":"rgba(255, 255, 255, 0.55)",letterSpacing:"0.1px",transition:"all 0.25s ease",lineHeight:"1.2"},children:p.label})]},p.path)})})},OF=({onClose:e})=>t.jsx(ye.div,{initial:{opacity:0}
2713,animate:{opacity:1},exit:{opacity:0},style:{position:"fixed",inset:0,zIndex:1e3,background:"rgba(0,0,0,0.8)",backdropFilter:"blur(5px)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:e,children:t.jsxs(ye.div,{initial:{scale:.9,opacity:0,y:20},animate:{scale:1,opacity:1,y:0},exit:{scale:.9,opacity:0,y:20},style:{width:"90%",maxWidth:"1000px",height:"85vh",background:"var(--bg-deep)",borderRadius:"24px",border:"1px solid rgba(255,255,255,0.1)",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.5)",overflow:"hidden",position:"relative",display:"flex",flexDirection:"column"},onClick:r=>r.stopPropagation(),children:[t.jsx("button",{onClick:e,style:{position:"absolute",top:"20px",right:"20px",zIndex:10,background:"rgba(255,255,255,0.1)",border:"none",borderRadius:"50%",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",color:"white",cursor:"pointer"},children:t.jsx(mt,{size:20})}),t.jsx("div",{style:{flex:1,overflowY:"auto",paddingBottom:"20px"},children:t.jsx(VS,{isModal:!0})})]})}),LF=()=>{const{profile:e}=gr(),{mode:r}=dr(),i=si(),[n,o]=m.useState([]),[a,l]=m.useState(0),[d,p]=m.useState(0),[u,g]=m.useState(0),[h,x]=m.useState(""),[y,_]=m.useState(!1),[S,k]=m.useState(!1);m.useEffect(()=>{if(!(e!=null&&e.id))return;const R=localStorage.getItem("ratingPopupLastShown");if(R&&Date.now()-parseInt(R)<24*60*60*1e3)return;(async()=>{const E=[];try{const{data:$}=await D.from("entraide_bookings").select("id, service_id, provider_id, price_meetips").eq("client_id",e.id).eq("status","completed");if($&&$.length>0){const{data:B}=await D.from("entraide_ratings").select("booking_id").eq("rater_id",e.id),ee=new Set((B||[]).map(K=>K.booking_id)),te=$.filter(K=>!ee.has(K.id));if(te.length>0){const K=[...new Set(te.map(F=>F.service_id))],ne=[...new Set(te.map(F=>F.provider_id))],[{data:Re},{data:Q},{data:G}]=await Promise.all([D.from("entraide_services").select("id, title, avg_rating, total_ratings").in("id",K),D.from("profiles").select("id, name, avatar_url, friend_avatar_url").in("id",ne),D.from("entraide_ratings").select("rated_id, stars").in("rated_id",ne)]),le={};(G||[]).forEach(F=>
2713{le[F.rated_id]||(le[F.rated_id]={sum:0,count:0}),le[F.rated_id].sum+=F.stars,le[F.rated_id].count++});for(const F of te){const A=Re==null?void 0:Re.find(H=>H.id===F.service_id),M=Q==null?void 0:Q.find(H=>H.id===F.provider_id),V=le[F.provider_id];E.push({type:"entraide",id:F.id,serviceId:F.service_id,providerId:F.provider_id,title:(A==null?void 0:A.title)||"Service d'entraide",name:(M==null?void 0:M.name)||"Prestataire",avatarUrl:(M==null?void 0:M.friend_avatar_url)||(M==null?void 0:M.avatar_url),avgRating:V?Math.round(V.sum/V.count*10)/10:0,ratingCount:V?V.count:0})}}}}catch($){console.warn("[RatingPopup] Entraide check failed:",$)}try{const $=new Date().toISOString(),{data:B}=await D.from("event_participants").select("event_id").eq("user_id",e.id).eq("status","approved");if(B&&B.length>0){const ee=B.map(K=>K.event_id),{data:te}=await D.from("events").select("id, title, date, creator_id").in("id",ee).lt("date",$).neq("creator_id",e.id);if(te&&te.length>0){const K=te.map(G=>G.id),{data:ne}=await D.from("event_ratings").select("event_id").eq("user_id",e.id).in("event_id",K),Re=new Set((ne||[]).map(G=>G.event_id)),Q=te.filter(G=>!Re.has(G.id));if(Q.length>0){const G=[...new Set(Q.map(M=>M.creator_id))],[{data:le},{data:F}]=await Promise.all([D.from("profiles").select("id, name, avatar_url, friend_avatar_url").in("id",G),D.from("event_ratings").select("organizer_id, rating").in("organizer_id",G)]),A={};(F||[]).forEach(M=>{A[M.organizer_id]||(A[M.organizer_id]={sum:0,count:0}),A[M.organizer_id].sum+=M.rating,A[M.organizer_id].count++});for(const M of Q){const V=le==null?void 0:le.find(N=>N.id===M.creator_id),H=A[M.creator_id];E.push({type:"event",id:M.id,creatorId:M.creator_id,title:M.title,name:(V==null?void 0:V.name)||"Organisateur",avatarUrl:(V==null?void 0:V.friend_avatar_url)||(V==null?void 0:V.avatar_url),avgRating:H?Math.round(H.sum/H.count*10)/10:0,ratingCount:H?H.count:0})}}}}}catch($){console.warn("[RatingPopup] Events check failed:",$)}E.length>0&&(o(E),localStorage.setItem("ratingPopupLastShown",Date.now().toString()))})()},[e==null?void 0:e.id]);const w=async()=>{if(d===0){i.error("Donnez une note â");return}_(!0);const R=n[a];try{if(R.type==="entraide"){const{error:O}=await D.from("entraide_ratings").insert({booking_id:R.id,rater_id:e.id,rated_id:R.providerId,stars:d,comment:h.trim()||null});if(O)throw O;const{data:E}=await D.from("entraide_bookings").select("id").eq("service_id",R.serviceId);if(E&&E.length>0){const $=E.map(ee=>ee.id),{data:B}=await D.from("entraide_ratings").select("stars").in("booking_id",$);if(B&&B.length>0){const ee=B.reduce((te,K)=>te+K.stars,0)/B.length;await D.from("entraide_services").update({avg_rating:Math.round(ee*10)/10,total_ratings:B.length}).eq("id",R.serviceId)}}}else if(R.type==="event"){const{error:O}=await D.from("event_ratings").insert({event_id:R.id,user_id:e.id,organizer_id:R.creatorId,rating:d,comment:h.trim()||null});if(O)throw O}i.success("Merci pour votre avis ! â"),b()}catch(O){i.error("Erreur: "+O.message)}finally{_(!1)}},b=()=>{p(0),g(0),x(""),a+1<n.length?l(a+1):k(!0)},j=()=>{k(!0)};if(S||n.length===0)return null;const T=n[a],P=T.type==="entraide",I=P?"#26A69A":"var(--primary, #E91E63)";return t.jsxs("div",{style:{position:"fixed",inset:0,zIndex:1e4,background:"rgba(0,0,0,0.75)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"20px",animation:"fadeIn 0.3s ease-out"},children:[t.jsxs("div",{style:{background:"linear-gradient(145deg, #1a1a2e, #141422)",borderRadius:"24px",border:"1px solid rgba(255,255,255,0.1)",maxWidth:"420px",width:"100%",padding:"28px",boxShadow:"0 25px 60px rgba(0,0,0,0.5)",animation:"slideUp 0.4s ease-out"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"20px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx("div",{style:{width:"42px",height:"42px",borderRadius:"14px",background:`${I}20`,border:`1px solid ${I}40`,display:"flex",alignItems:"center",justifyContent:"center"},children:P?t.jsx(jh,{size:20,color:I}):t.jsx(cr,{size:20,color:I})}),t.jsxs("div",{children:[t.jsx("p",{style:{margin:0,fontSize:"0.92rem",fontWeight:"800",color:"white"},children:"Comment c'était ? â"}),t.jsx("p",{style:{margin:0,fontSize:"0.72rem",color:"rgba(255,255,255,0.35)"},children:n.length>1?`${a+1} / ${n.length}`:P?"Service terminé":"Ãvénement passé"})]})]}),t.jsx("button",{onClick:j,style:{background:"none",border:"none",color:"rgba(255,255,255,0.3)",cursor:"pointer",padding:"4px"},children:t.jsx(mt,{size:18})})]}),t.jsx("div",{style:{background:"rgba(255,255,255,0.04)",borderRadius:"16px",padding:"16px",marginBottom:"20px",border:`1px solid ${I}
271320`},children:t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[T.avatarUrl&&t.jsxs("div",{style:{position:"relative",flexShrink:0},children:[t.jsx("img",{src:T.avatarUrl,alt:"",style:{width:"52px",height:"52px",borderRadius:"50%",objectFit:"cover",border:`2px solid ${I}50`,boxShadow:`0 0 12px ${I}25`}}),T.ratingCount>0&&t.jsxs("div",{style:{position:"absolute",bottom:"-4px",right:"-4px",background:"linear-gradient(135deg, #1a1a2e, #222)",border:"1px solid rgba(255,215,0,0.4)",borderRadius:"8px",padding:"1px 5px",display:"flex",alignItems:"center",gap:"2px",boxShadow:"0 2px 8px rgba(0,0,0,0.5)"},children:[t.jsx(nr,{size:9,fill:"#FFD700",color:"#FFD700"}),t.jsx("span",{style:{fontSize:"0.62rem",fontWeight:"800",color:"#FFD700"},children:T.avgRating})]})]}),t.jsxs("div",{style:{flex:1},children:[t.jsx("p",{style:{margin:"0 0 3px",fontSize:"0.95rem",fontWeight:"700",color:"white",lineHeight:1.2},children:T.title}),t.jsx("p",{style:{margin:0,fontSize:"0.78rem",color:"rgba(255,255,255,0.4)"},children:P?`par ${T.name}`:`organisé par ${T.name}`}),T.ratingCount>0&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"3px",marginTop:"4px"},children:[[1,2,3,4,5].map(R=>t.jsx(nr,{size:11,fill:R<=Math.round(T.avgRating)?"#FFD700":"transparent",color:R<=Math.round(T.avgRating)?"#FFD700":"rgba(255,255,255,0.15)"},R)),t.jsxs("span",{style:{fontSize:"0.7rem",color:"rgba(255,255,255,0.35)",marginLeft:"4px"},children:[T.avgRating,"/5 (",T.ratingCount," avis)"]})]})]})]})}),t.jsx("div",{style:{display:"flex",justifyContent:"center",gap:"8px",marginBottom:"6px"},children:[1,2,3,4,5].map(R=>t.jsx(nr,{size:36,fill:(u||d)>=R?"#FFD700":"transparent",color:(u||d)>=R?"#FFD700":"rgba(255,255,255,0.15)",style:{cursor:"pointer",transition:"transform 0.15s, color 0.15s"},onMouseEnter:()=>g(R),onMouseLeave:()=>g(0),onClick:()=>p(R)},R))}),t.jsx("div",{style:{textAlign:"center",marginBottom:"16px",fontSize:"0.82rem",color:"rgba(255,255,255,0.35)",minHeight:"20px"},children:d===1?"ð Décevant":d===2?"ð Moyen":d===3?"ð Bien":d===4?"ð Super":d===5?"𤩠Exceptionnel !":"Touchez une étoile"}),d>0&&t.jsx("textarea",{value:h,onChange:R=>x(R.target.value),placeholder:"Un commentaire ? (optionnel)",rows:2,style:{width:"100%",padding:"12px 14px",borderRadius:"12px",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.1)",color:"white",fontSize:"0.88rem",outline:"none",resize:"none",boxSizing:"border-box",marginBottom:"16px",transition:"all 0.2s"}}),t.jsxs("div",{style:{display:"flex",gap:"10px"},children:[t.jsx("button",{onClick:b,style:{flex:1,padding:"12px",borderRadius:"12px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.5)",cursor:"pointer",fontSize:"0.85rem",fontWeight:"600",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"},children:"Plus tard"}),t.jsx("button",{onClick:w,disabled:d===0||y,style:{flex:2,padding:"12px",borderRadius:"12px",background:d>0?`linear-gradient(135deg, ${I}, ${I}cc)`:"rgba(255,255,255,0.06)",border:"none",color:"white",cursor:d>0?"pointer":"default",fontSize:"0.9rem",fontWeight:"700",opacity:d===0||y?.4:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s"},children:y?"Envoi...":"â Envoyer mon avis"})]}),n.length>1&&t.jsx("div",{style:{display:"flex",justifyContent:"center",gap:"6px",marginTop:"16px"},children:n.map((R,O)=>t.jsx("div",{style:{width:O===a?"20px":"6px",height:"6px",borderRadius:"3px",background:O===a?I:O<a?"rgba(255,255,255,0.3)":"rgba(255,255,255,0.1)",transition:"all 0.3s"}},O))})]}),t.jsx("style",{children:` 2714 @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } 2715 @keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } } 2716 `})]})},$F=()=>{const[e,r]=m.useState(!1),{profile:i,loading:n}=gr(),o=xn();ko();const a=o||Jo();if(n)return t.jsx("div",{style:{height:"100vh",width:"100vw",background:"var(--bg-deep)",display:"flex",alignItems:"center",justifyContent:"center"},children:t.jsx("div",{className:"spinner",style:{width:"40px",height:"40px",border:"3px solid rgba(255,255,255,0.1)",borderTop:"3px solid var(--primary)",borderRadius:"50%",animation:"spin 1s linear infinite"}})});const l=i||JSON.parse(localStorage.getItem("userProfile")||"null");return t.jsxs("div",{style:{minHeight:"100vh",background:"var(--bg-deep)",display:"flex",flexDirection:"column"}
2716,children:[t.jsx(MF,{userProfile:l,onOpenMessenger:()=>r(!0)}),t.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",paddingBottom:a?"calc(80px + env(safe-area-inset-bottom, 0px))":"0"},children:t.jsx("div",{style:{width:"100%",minHeight:"100%",flex:1,display:"flex",flexDirection:"column"},children:t.jsx(Kj,{})})}),t.jsx(BF,{}),t.jsx(tr,{children:e&&t.jsx(OF,{onClose:()=>r(!1)})}),t.jsx(LF,{})]})},WF=()=>t.jsxs("div",{style:{minHeight:"100vh",background:"#070715",color:"white",display:"flex",flexDirection:"column"},children:[t.jsx("div",{style:{flex:1,padding:"40px"},children:t.jsx(Kj,{})}),t.jsx(px,{style:{marginTop:"auto",background:"#050510"}})]});let NF=class extends Tr.Component{constructor(r){super(r),this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,i){console.error("ErrorBoundary caught an error:",r,i)}render(){return this.state.hasError?t.jsxs("div",{style:{minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"#0a0815",color:"white",padding:"20px",textAlign:"center"},children:[t.jsx("h2",{children:"Oups, un problème est survenu."}),t.jsx("p",{style:{color:"rgba(255,255,255,0.6)",maxWidth:"400px",marginBottom:"24px"},children:"La page n'a pas pu être chargée correctement. Veuillez rafraîchir la page ou retourner à l'accueil."}),t.jsxs("div",{style:{display:"flex",gap:"12px"},children:[t.jsx("button",{onClick:()=>window.location.reload(),style:{background:"linear-gradient(135deg, #a855f7, #ec4899)",color:"white",border:"none",padding:"12px 24px",borderRadius:"12px",fontWeight:"bold",cursor:"pointer"},children:"Rafraîchir"}),t.jsx("button",{onClick:()=>window.location.href="/matches",style:{background:"rgba(255,255,255,0.1)",color:"white",border:"1px solid rgba(255,255,255,0.2)",padding:"12px 24px",borderRadius:"12px",fontWeight:"bold",cursor:"pointer"},children:"Accueil"})]})]}):this.props.children}};const UF=Tr.lazy(()=>Wr(()=>import("./MembersMap-Cz4bwtEV.js"),[]));function VF(){return pz(),m.useEffect(()=>{const e=new URLSearchParams(window.location.search),r=e.get("ref"),i=e.get("promo"),n=e.get("utm_source"),o=e.get("utm_medium"),a=e.get("utm_campaign");r&&localStorage.setItem("meetapps_ref",r),i&&localStorage.setItem("meetapps_promo",i),n&&localStorage.setItem("meetapps_utm_source",n),o&&localStorage.setItem("meetapps_utm_medium",o),a&&localStorage.setItem("meetapps_utm_campaign",a)},[]),t.jsx(QA,{children:t.jsx("div",{className:"app",children:t.jsx(NF,{children:t.jsxs($6,{children:[t.jsx($t,{path:"/admin",element:t.jsx(oF,{children:t.jsx(rF,{})})}),t.jsx($t,{path:"/",element:t.jsx(YA,{})}),t.jsx($t,{path:"/login",element:t.jsx(e7,{})}),t.jsx($t,{path:"/forgot-password",element:t.jsx(t7,{})}),t.jsx($t,{path:"/update-password",element:t.jsx(r7,{})}),t.jsx($t,{path:"/signup",element:t.jsx(bF,{})}),t.jsx($t,{path:"/chat",element:t.jsx(o7,{})}),t.jsx($t,{path:"/complete-profile",element:t.jsx(r1,{})}),t.jsx($t,{path:"/profile",element:t.jsx(a7,{})}),t.jsx($t,{path:"/check-email",element:t.jsx(u7,{})}),t.jsx($t,{path:"/blog",element:t.jsx(j1,{})}),t.jsx($t,{path:"/blog/:slug",element:t.jsx(w1,{})}),t.jsxs($t,{element:t.jsx(sF,{children:t.jsx($F,{})}),children:[t.jsx($t,{path:"/app-blog",element:t.jsx(j1,{})}),t.jsx($t,{path:"/app-blog/:slug",element:t.jsx(w1,{})}),t.jsx($t,{path:"/preferences",element:t.jsx(h7,{})}),t.jsx($t,{path:"/matches",element:t.jsx(L7,{})}),t.jsx($t,{path:"/complete-profile",element:t.jsx(r1,{})}),t.jsx($t,{path:"/events",element:t.jsx(dP,{})}),t.jsx($t,{path:"/favorites",element:t.jsx(SP,{})}),t.jsx($t,{path:"/settings",element:t.jsx(wP,{})}),t.jsx($t,{path:"/shop",element:t.jsx(uF,{})}),t.jsx($t,{path:"/blocked-users",element:t.jsx(dF,{})}),t.jsx($t,{path:"/archives",element:t.jsx(_P,{})}),t.jsx($t,{path:"/subscription",element:t.jsx(zP,{})}),t.jsx($t,{path:"/account",element:t.jsx(uP,{})}),t.jsx($t,{path:"/messages",element:t.jsx(VS,{})}),t.jsx($t,{path:"/eros-expert",element:t.jsx(AP,{})}),t.jsx($t,{path:"/home",element:t.jsx(ZP,{})}),t.jsx($t,{path:"/edit-criteria",element:t.jsx(PP,{})}),t.jsx($t,{path:"/profile-view/:id",element:t.jsx(Cp,{})}),t.jsx($t,{path:"/payment-success",element:t.jsx(nF,{})}),t.jsx($t,{path:"/email-previews",element:t.jsx(aF,{})}),t.jsx($t,{path:"/help-chat",element:t.jsx(h1,{})}),t.jsx($t,{path:"/entraide",element:t.jsx(_F,{})}),t.jsx($t,{path:"/map",element:t.jsx(m.Suspense,{fallback:t.jsx("div",{style:{minHeight:"100vh",background:"#0a0815",display:"flex",alignItems:"center",justifyContent:"center",color:"rgba(255,255,255,0.5)"},children:"Chargement de la carte..."}),children:t.jsx(UF,{})})})]}),t.jsxs($t,{element:t.jsx(WF,{}),children:[t.jsx($t,{path:"/terms",element:t.jsx(EP,{})}),t.jsx($t,{path:"/cgv",element:t.jsx(IP,{})}),t.jsx($t,{path:"/privacy",element:t.jsx(RP,{})}),t.jsx($t,{path:"/help",element:t.jsx(h1,{})})]})]})})})})}bA();Jo()&&cA()&&Wr(async()=>{const{Keyboard:e}=await import("./index-Aj1l-TIt.js");return{Keyboard:e}},[]).then(({Keyboard:e})=>{e.addListener("keyboardWillShow",r=>{document.documentElement.style.setProperty("--keyboard-height",`${r.keyboardHeight}px`),document.body.classList.add("keyboard-open"),setTimeout(()=>{const i=document.activeElement;i&&(i.tagName==="INPUT"||i.tagName==="TEXTAREA")&&i.scrollIntoView({behavior:"smooth",block:"center"})},100)}),e.addListener("keyboardWillHide",()=>{document.documentElement.style.setProperty("--keyboard-height","0px"),document.body.classList.remove("keyboard-open")})}).catch(()=>{});class qF extends Tr.Component{constructor(r){super(r),this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}render(){var r,i;return this.state.hasError?t.jsxs("div",{style:{minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"#050507",color:"#F5F5DC",fontFamily:"Inter, sans-serif",padding:"2rem",textAlign:"center"},children:[t.jsx("div",{style:{fontSize:"3rem",marginBottom:"1rem"},children:"â ï¸"}),t.jsx("h1",{style:{fontFamily:"Playfair Display, serif",color:"#D4C4A8",fontSize:"1.8rem",marginBottom:"0.5rem"},children:"Oops, une erreur est survenue"}),t.jsx("p",{style:{color:"#a1a1aa",maxWidth:"400px",marginBottom:"1.5rem",lineHeight:1.6},children:"L'application a rencontré un problème. Essayez de recharger la page."}),t.jsx("button",{onClick:()=>window.location.reload(),style:{background:"linear-gradient(135deg, #D4C4A8 0%, #C5A065 100%)",border:"none",color:"#000",padding:"12px 32px",borderRadius:"16px",fontWeight:600,fontSize:"1rem",cursor:"pointer",boxShadow:"0 4px 15px rgba(212, 196, 168, 0.4)",transition:"transform 0.2s"},onMouseOver:n=>n.target.style.transform="translateY(-2px)",onMouseOut:n=>n.target.style.transform="translateY(0)",children:"Recharger la page"}),t.jsxs("details",{style:{marginTop:"2rem",color:"#666",fontSize:"0.8rem",maxWidth:"600px"},open:!0,children:[t.jsx("summary",{style:{cursor:"pointer"},children:"Détails techniques"}),t.jsxs("pre",{style:{whiteSpace:"pre-wrap",textAlign:"left",marginTop:"0.5rem"},children:[(r=this.state.error)==null?void 0:r.toString(),` 2717`,(i=this.state.error)==null?void 0:i.stack]})]})]}):this.props.children}}Ig.createRoot(document.getElementById("root")).render(t.jsx(Tr.StrictMode,{children:t.jsx(qF,{children:t.jsx(sz,{children:t.jsx(KT,{children:t.jsx(U6,{children:t.jsx(VF,{})})})})})}));
2717"serviceWorker"in navigator&&!Jo()&&window.addEventListener("load",async()=>{try{const e=await navigator.serviceWorker.register("/sw.js");console.log("[SW] registered:",e.scope),e.update(),setInterval(()=>e.update(),30*60*1e3),e.addEventListener("updatefound",()=>{const r=e.installing;r&&r.addEventListener("statechange",()=>{if(r.state==="activated"&&navigator.serviceWorker.controller){console.log("[SW] New version ready â will reload on next navigation"),window.__swUpdatePending=!0;const i=()=>{document.visibilityState==="visible"&&window.__swUpdatePending&&(window.__swUpdatePending=!1,document.removeEventListener("visibilitychange",i),window.location.reload())};document.addEventListener("visibilitychange",i)}})})}catch(e){console.warn("[SW] registration failed:",e)}});export{Hr as A,rr as E,Rs as L,ur as M,b0 as T,Ut as U,Xm as W,mt as X,Wr as _,si as a,gr as b,dr as c,xn as d,m as e,y0 as f,al as g,qs as h,tr as i,t as j,Qt as k,ye as m,Ym as r,D as s,Lt as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.