fix: Register /api/altcha-challenge/ route and return real display_name for own guest session signups
This commit is contained in:
1 parent
26eaa637a7
commit
c8aed130b8
8 files changed
+46
-19
No files matched your search
Binary file not shown.
@@ -13,23 +13,47 @@ class SkillSerializer(serializers.ModelSerializer):
|
||||
class ShiftSignupSerializer(serializers.ModelSerializer):
|
||||
display_name = serializers.SerializerMethodField()
|
||||
is_guest = serializers.SerializerMethodField()
|
||||
is_self = serializers.SerializerMethodField()
|
||||
|
||||
class Meta:
|
||||
model = ShiftSignup
|
||||
fields = ['id', 'display_name', 'is_guest', 'created_at']
|
||||
fields = ['id', 'display_name', 'is_guest', 'is_self', 'created_at']
|
||||
|
||||
def get_is_guest(self, obj):
|
||||
return obj.user is None
|
||||
|
||||
def _is_own_signup(self, obj, request):
|
||||
if not request:
|
||||
return False
|
||||
if request.user and request.user.is_authenticated:
|
||||
return obj.user_id == request.user.id
|
||||
|
||||
# Check session key for guest user
|
||||
session_key = getattr(request.session, 'session_key', None)
|
||||
if session_key and obj.guest_session_key and obj.guest_session_key == session_key:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def get_is_self(self, obj):
|
||||
request = self.context.get('request')
|
||||
return self._is_own_signup(obj, request)
|
||||
|
||||
def get_display_name(self, obj):
|
||||
request = self.context.get('request')
|
||||
# PRIVACY RULE: Guests (unauthenticated users) MUST NOT see who signed up where
|
||||
if request and not request.user.is_authenticated:
|
||||
return "Belegt (Anonym)"
|
||||
|
||||
if obj.user:
|
||||
return obj.user.get_display_name()
|
||||
return obj.guest_name or "Gast"
|
||||
# Authenticated users see real names of all participants
|
||||
if request and request.user and request.user.is_authenticated:
|
||||
if obj.user:
|
||||
return obj.user.get_display_name()
|
||||
return obj.guest_name or "Gast"
|
||||
|
||||
# Guest users see their own real name for their own signups
|
||||
if request and self._is_own_signup(obj, request):
|
||||
return obj.guest_name or "Gast"
|
||||
|
||||
# Other participants are anonymized for privacy
|
||||
return "Belegt (Anonym)"
|
||||
|
||||
class ShiftSerializer(serializers.ModelSerializer):
|
||||
required_skills = SkillSerializer(many=True, read_only=True)
|
||||
|
||||
Binary file not shown.
@@ -1,8 +1,11 @@
|
||||
from django.contrib import admin
|
||||
from django.urls import path, include
|
||||
from apps.events.views import AltchaChallengeView
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path('api/altcha-challenge/', AltchaChallengeView.as_view(), name='altcha-challenge-top'),
|
||||
path('api/events/altcha-challenge/', AltchaChallengeView.as_view(), name='altcha-challenge-alias'),
|
||||
path('api/users/', include('apps.users.urls')),
|
||||
path('api/', include('apps.events.urls')),
|
||||
path('api/branding/', include('apps.branding.urls')),
|
||||
|
||||
+9
-9
@@ -22,7 +22,7 @@ var k0=Object.defineProperty;var Bf=e=>{throw TypeError(e)};var _0=(e,t,n)=>t in
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/(function(e){function t(M,U){var x=M.length;M.push(U);e:for(;0<x;){var $=x-1>>>1,I=M[$];if(0<s(I,U))M[$]=U,M[x]=I,x=$;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var U=M[0],x=M.pop();if(x!==U){M[0]=x;e:for(var $=0,I=M.length,K=I>>>1;$<K;){var W=2*($+1)-1,ee=M[W],Ae=W+1,gt=M[Ae];if(0>s(ee,x))Ae<I&&0>s(gt,ee)?(M[$]=gt,M[Ae]=x,$=Ae):(M[$]=ee,M[W]=x,$=W);else if(Ae<I&&0>s(gt,x))M[$]=gt,M[Ae]=x,$=Ae;else break e}}return U}function s(M,U){var x=M.sortIndex-U.sortIndex;return x!==0?x:M.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var u=[],c=[],f=1,g=null,d=3,w=!1,y=!1,N=!1,R=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(M){for(var U=n(c);U!==null;){if(U.callback===null)r(c);else if(U.startTime<=M)r(c),U.sortIndex=U.expirationTime,t(u,U);else break;U=n(c)}}function _(M){if(N=!1,m(M),!y)if(n(u)!==null)y=!0,Te(C);else{var U=n(c);U!==null&&V(_,U.startTime-M)}}function C(M,U){y=!1,N&&(N=!1,v(P),P=-1),w=!0;var x=d;try{for(m(U),g=n(u);g!==null&&(!(g.expirationTime>U)||M&&!Y());){var $=g.callback;if(typeof $=="function"){g.callback=null,d=g.priorityLevel;var I=$(g.expirationTime<=U);U=e.unstable_now(),typeof I=="function"?g.callback=I:g===n(u)&&r(u),m(U)}else r(u);g=n(u)}if(g!==null)var K=!0;else{var W=n(c);W!==null&&V(_,W.startTime-U),K=!1}return K}finally{g=null,d=x,w=!1}}var E=!1,j=null,P=-1,G=5,L=-1;function Y(){return!(e.unstable_now()-L<G)}function ae(){if(j!==null){var M=e.unstable_now();L=M;var U=!0;try{U=j(!0,M)}finally{U?le():(E=!1,j=null)}}else E=!1}var le;if(typeof h=="function")le=function(){h(ae)};else if(typeof MessageChannel<"u"){var ke=new MessageChannel,ue=ke.port2;ke.port1.onmessage=ae,le=function(){ue.postMessage(null)}}else le=function(){R(ae,0)};function Te(M){j=M,E||(E=!0,le())}function V(M,U){P=R(function(){M(e.unstable_now())},U)}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(M){M.callback=null},e.unstable_continueExecution=function(){y||w||(y=!0,Te(C))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(M){switch(d){case 1:case 2:case 3:var U=3;break;default:U=d}var x=d;d=U;try{return M()}finally{d=x}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,U){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var x=d;d=M;try{return U()}finally{d=x}},e.unstable_scheduleCallback=function(M,U,x){var $=e.unstable_now();switch(typeof x=="object"&&x!==null?(x=x.delay,x=typeof x=="number"&&0<x?$+x:$):x=$,M){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=x+I,M={id:f++,callback:U,priorityLevel:M,startTime:x,expirationTime:I,sortIndex:-1},x>$?(M.sortIndex=x,t(c,M),n(u)===null&&M===n(c)&&(N?(v(P),P=-1):N=!0,V(_,x-$))):(M.sortIndex=I,t(u,M),y||w||(y=!0,Te(C))),M},e.unstable_shouldYield=Y,e.unstable_wrapCallback=function(M){var U=d;return function(){var x=d;d=U;try{return M.apply(this,arguments)}finally{d=x}}}})(Up);Op.exports=Up;var W0=Op.exports;/**
|
||||
*/(function(e){function t(M,U){var x=M.length;M.push(U);e:for(;0<x;){var $=x-1>>>1,I=M[$];if(0<s(I,U))M[$]=U,M[x]=I,x=$;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var U=M[0],x=M.pop();if(x!==U){M[0]=x;e:for(var $=0,I=M.length,K=I>>>1;$<K;){var W=2*($+1)-1,ee=M[W],Ae=W+1,gt=M[Ae];if(0>s(ee,x))Ae<I&&0>s(gt,ee)?(M[$]=gt,M[Ae]=x,$=Ae):(M[$]=ee,M[W]=x,$=W);else if(Ae<I&&0>s(gt,x))M[$]=gt,M[Ae]=x,$=Ae;else break e}}return U}function s(M,U){var x=M.sortIndex-U.sortIndex;return x!==0?x:M.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var u=[],c=[],f=1,g=null,d=3,w=!1,y=!1,N=!1,R=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(M){for(var U=n(c);U!==null;){if(U.callback===null)r(c);else if(U.startTime<=M)r(c),U.sortIndex=U.expirationTime,t(u,U);else break;U=n(c)}}function _(M){if(N=!1,m(M),!y)if(n(u)!==null)y=!0,Te(C);else{var U=n(c);U!==null&&V(_,U.startTime-M)}}function C(M,U){y=!1,N&&(N=!1,v(L),L=-1),w=!0;var x=d;try{for(m(U),g=n(u);g!==null&&(!(g.expirationTime>U)||M&&!Y());){var $=g.callback;if(typeof $=="function"){g.callback=null,d=g.priorityLevel;var I=$(g.expirationTime<=U);U=e.unstable_now(),typeof I=="function"?g.callback=I:g===n(u)&&r(u),m(U)}else r(u);g=n(u)}if(g!==null)var K=!0;else{var W=n(c);W!==null&&V(_,W.startTime-U),K=!1}return K}finally{g=null,d=x,w=!1}}var E=!1,j=null,L=-1,G=5,P=-1;function Y(){return!(e.unstable_now()-P<G)}function ae(){if(j!==null){var M=e.unstable_now();P=M;var U=!0;try{U=j(!0,M)}finally{U?le():(E=!1,j=null)}}else E=!1}var le;if(typeof h=="function")le=function(){h(ae)};else if(typeof MessageChannel<"u"){var ke=new MessageChannel,ue=ke.port2;ke.port1.onmessage=ae,le=function(){ue.postMessage(null)}}else le=function(){R(ae,0)};function Te(M){j=M,E||(E=!0,le())}function V(M,U){L=R(function(){M(e.unstable_now())},U)}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(M){M.callback=null},e.unstable_continueExecution=function(){y||w||(y=!0,Te(C))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(M){switch(d){case 1:case 2:case 3:var U=3;break;default:U=d}var x=d;d=U;try{return M()}finally{d=x}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,U){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var x=d;d=M;try{return U()}finally{d=x}},e.unstable_scheduleCallback=function(M,U,x){var $=e.unstable_now();switch(typeof x=="object"&&x!==null?(x=x.delay,x=typeof x=="number"&&0<x?$+x:$):x=$,M){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=x+I,M={id:f++,callback:U,priorityLevel:M,startTime:x,expirationTime:I,sortIndex:-1},x>$?(M.sortIndex=x,t(c,M),n(u)===null&&M===n(c)&&(N?(v(L),L=-1):N=!0,V(_,x-$))):(M.sortIndex=I,t(u,M),y||w||(y=!0,Te(C))),M},e.unstable_shouldYield=Y,e.unstable_wrapCallback=function(M){var U=d;return function(){var x=d;d=U;try{return M.apply(this,arguments)}finally{d=x}}}})(Up);Op.exports=Up;var W0=Op.exports;/**
|
||||
* @license React
|
||||
* react-dom.production.min.js
|
||||
*
|
||||
@@ -34,8 +34,8 @@ var k0=Object.defineProperty;var Bf=e=>{throw TypeError(e)};var _0=(e,t,n)=>t in
|
||||
`+Eu+e}var Cu=!1;function Tu(e,t){if(!e||Cu)return"";Cu=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var s=c.stack.split(`
|
||||
`),l=r.stack.split(`
|
||||
`),a=s.length-1,o=l.length-1;1<=a&&0<=o&&s[a]!==l[o];)o--;for(;1<=a&&0<=o;a--,o--)if(s[a]!==l[o]){if(a!==1||o!==1)do if(a--,o--,0>o||s[a]!==l[o]){var u=`
|
||||
`+s[a].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=a&&0<=o);break}}}finally{Cu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ri(e):""}function J0(e){switch(e.tag){case 5:return ri(e.type);case 16:return ri("Lazy");case 13:return ri("Suspense");case 19:return ri("SuspenseList");case 0:case 2:case 15:return e=Tu(e.type,!1),e;case 11:return e=Tu(e.type.render,!1),e;case 1:return e=Tu(e.type,!0),e;default:return""}}function dc(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 Ws:return"Fragment";case Ks:return"Portal";case oc:return"Profiler";case Td:return"StrictMode";case uc:return"Suspense";case cc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Bp:return(e.displayName||"Context")+".Consumer";case Vp:return(e._context.displayName||"Context")+".Provider";case Ad:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Pd:return t=e.displayName||null,t!==null?t:dc(e.type)||"Memo";case Tr:t=e._payload,e=e._init;try{return dc(e(t))}catch{}}return null}function X0(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return dc(t);case 8:return t===Td?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Qr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Kp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ex(e){var t=Kp(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){r=""+a,l.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ca(e){e._valueTracker||(e._valueTracker=ex(e))}function Wp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Kp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ho(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 fc(e,t){var n=t.checked;return Ke({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Yf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Qr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Gp(e,t){t=t.checked,t!=null&&Cd(e,"checked",t,!1)}function hc(e,t){Gp(e,t);var n=Qr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?pc(e,t.type,n):t.hasOwnProperty("defaultValue")&&pc(e,t.type,Qr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Zf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function pc(e,t,n){(t!=="number"||ho(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var si=Array.isArray;function sl(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Qr(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function mc(e,t){if(t.dan
Line truncated
|
||||
`).replace(c1,"")}function Da(e,t,n){if(t=wh(t),wh(e)!==t&&n)throw Error(D(425))}function bo(){}var Cc=null,Tc=null;function Ac(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Pc=typeof setTimeout=="function"?setTimeout:void 0,d1=typeof clearTimeout=="function"?clearTimeout:void 0,bh=typeof Promise=="function"?Promise:void 0,f1=typeof queueMicrotask=="function"?queueMicrotask:typeof bh<"u"?function(e){return bh.resolve(null).then(e).catch(h1)}:Pc;function h1(e){setTimeout(function(){throw e})}function Vu(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),Ai(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Ai(t)}function Vr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function kh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var $l=Math.random().toString(36).slice(2),Gn="__reactFiber$"+$l,$i="__reactProps$"+$l,vr="__reactContainer$"+$l,Lc="__reactEvents$"+$l,p1="__reactListeners$"+$l,m1="__reactHandles$"+$l;function os(e){var t=e[Gn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[vr]||n[Gn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=kh(e);e!==null;){if(n=e[Gn])return n;e=kh(e)}return t}e=n,n=e.parentNode}return null}function ta(e){return e=e[Gn]||e[vr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ys(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(D(33))}function Zo(e){return e[$i]||null}var Mc=[],Zs=-1;function ts(e){return{current:e}}function De(e){0>Zs||(e.current=Mc[Zs],Mc[Zs]=null,Zs--)}function Le(e,t){Zs++,Mc[Zs]=e.current,e.current=t}var Yr={},kt=ts(Yr),zt=ts(!1),Ns=Yr;function kl(e,t){var n=e.type.contextTypes;if(!n)return Yr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},l;for(l in n)s[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function It(e){return e=e.childContextTypes,e!=null}function ko(){De(zt),De(kt)}function _h(e,t,n){if(kt.current!==Yr)throw Error(D(168));Le(kt,t),Le(zt,n)}function $m(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(D(108,X0(e)||"Unknown",s));return Ke({},n,r)}function _o(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yr,Ns=kt.current,Le(kt,e),Le(zt,zt.current),!0}function Sh(e,t,n){var r=e.stateNode;if(!r)throw Error(D(169));n?(e=$m(e,t,Ns),r.__reactInternalMemoizedMergedChildContext=e,De(zt),De(kt),Le(kt,e)):De(zt),Le(zt,n)}var lr=null,Jo=!1,Bu=!1;function Dm(e){lr===null?lr=[e]:lr.push(e)}function g1(e){Jo=!0,Dm(e)}function ns(){if(!Bu&&lr!==null){Bu=!0;var e=0,t=je;try{var n=lr;for(je=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}lr=null,Jo=!1}catch(s){throw lr!==null&&(lr=lr.slice(e+1)),am(Md,ns),s}finally{je=t,Bu=!1}}return null}var Js=[],Xs=0,So=null,No=0,on=[],un=0,js=null,dr=1,fr="";function is(e,t){Js[Xs++]=No,Js[Xs++]=So,So=e,No=t}function zm(e,t,n){on[un++]=dr,on[un++]=fr,on[un++]=js,js=e;var r=dr;e=fr;var s=32-An(r)-1;r&=~(1<<s),n+=1;var l=32-An(t)+s;if(30<l){var a=s-s%5;l=(r&(1<<a)-1).toString(32),r>>=a,s-=a,dr=1<<32-An(t)+s|n<<s|r,fr=l+e}else dr=1<<l|n<<s|r,fr=e}function Vd(e){e.return!==null&&(is(e,1),zm(e,1,0))}function Bd(e){for(;e===So;)So=Js[--Xs],Js[Xs]=null,No=Js[--Xs],Js[Xs]=null;for(;e===js;)js=on[--un],on[un]=null,fr=on[--un],on[un]=null,dr=on[--un],on[un]=null}var Qt=null,qt=null,Ue=!1,En=null;function Im(e,t){var n=dn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Nh(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Qt=e,qt=Vr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Qt=e,qt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=js!==null?{id:dr,overflow:fr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=dn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Qt=e,qt=null,!0):!1;default:return!1}}function Rc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function $c(e){if(Ue){var t=qt;if(t){var n=t;if(!Nh(e,t)){if(Rc(e))throw Error(D(418));t=Vr(n.nextSibling);var r=Qt;t&&Nh(e,t)?Im(r,n):(e.flags=e.flags&-4097|2,Ue=!1,Qt=e)}}else{if(Rc(e))throw Error(D(418));e.flags=e.flags&-4097|2,Ue=!1,Qt=e}}}function jh(e){for(e=e
Line truncated
|
||||
`+s[a].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=a&&0<=o);break}}}finally{Cu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ri(e):""}function J0(e){switch(e.tag){case 5:return ri(e.type);case 16:return ri("Lazy");case 13:return ri("Suspense");case 19:return ri("SuspenseList");case 0:case 2:case 15:return e=Tu(e.type,!1),e;case 11:return e=Tu(e.type.render,!1),e;case 1:return e=Tu(e.type,!0),e;default:return""}}function dc(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 Ws:return"Fragment";case Ks:return"Portal";case oc:return"Profiler";case Td:return"StrictMode";case uc:return"Suspense";case cc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Bp:return(e.displayName||"Context")+".Consumer";case Vp:return(e._context.displayName||"Context")+".Provider";case Ad:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Pd:return t=e.displayName||null,t!==null?t:dc(e.type)||"Memo";case Tr:t=e._payload,e=e._init;try{return dc(e(t))}catch{}}return null}function X0(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return dc(t);case 8:return t===Td?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Qr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Kp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ex(e){var t=Kp(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){r=""+a,l.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ca(e){e._valueTracker||(e._valueTracker=ex(e))}function Wp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Kp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ho(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 fc(e,t){var n=t.checked;return Ke({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Yf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Qr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Gp(e,t){t=t.checked,t!=null&&Cd(e,"checked",t,!1)}function hc(e,t){Gp(e,t);var n=Qr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?pc(e,t.type,n):t.hasOwnProperty("defaultValue")&&pc(e,t.type,Qr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Zf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function pc(e,t,n){(t!=="number"||ho(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var si=Array.isArray;function sl(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Qr(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function mc(e,t){if(t.dan
Line truncated
|
||||
`).replace(c1,"")}function Da(e,t,n){if(t=wh(t),wh(e)!==t&&n)throw Error(D(425))}function bo(){}var Cc=null,Tc=null;function Ac(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Pc=typeof setTimeout=="function"?setTimeout:void 0,d1=typeof clearTimeout=="function"?clearTimeout:void 0,bh=typeof Promise=="function"?Promise:void 0,f1=typeof queueMicrotask=="function"?queueMicrotask:typeof bh<"u"?function(e){return bh.resolve(null).then(e).catch(h1)}:Pc;function h1(e){setTimeout(function(){throw e})}function Vu(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),Ai(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Ai(t)}function Vr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function kh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var $l=Math.random().toString(36).slice(2),Gn="__reactFiber$"+$l,$i="__reactProps$"+$l,vr="__reactContainer$"+$l,Lc="__reactEvents$"+$l,p1="__reactListeners$"+$l,m1="__reactHandles$"+$l;function os(e){var t=e[Gn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[vr]||n[Gn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=kh(e);e!==null;){if(n=e[Gn])return n;e=kh(e)}return t}e=n,n=e.parentNode}return null}function ta(e){return e=e[Gn]||e[vr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ys(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(D(33))}function Zo(e){return e[$i]||null}var Mc=[],Zs=-1;function ts(e){return{current:e}}function De(e){0>Zs||(e.current=Mc[Zs],Mc[Zs]=null,Zs--)}function Le(e,t){Zs++,Mc[Zs]=e.current,e.current=t}var Yr={},kt=ts(Yr),zt=ts(!1),Ns=Yr;function kl(e,t){var n=e.type.contextTypes;if(!n)return Yr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},l;for(l in n)s[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function It(e){return e=e.childContextTypes,e!=null}function ko(){De(zt),De(kt)}function _h(e,t,n){if(kt.current!==Yr)throw Error(D(168));Le(kt,t),Le(zt,n)}function $m(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(D(108,X0(e)||"Unknown",s));return Ke({},n,r)}function _o(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yr,Ns=kt.current,Le(kt,e),Le(zt,zt.current),!0}function Sh(e,t,n){var r=e.stateNode;if(!r)throw Error(D(169));n?(e=$m(e,t,Ns),r.__reactInternalMemoizedMergedChildContext=e,De(zt),De(kt),Le(kt,e)):De(zt),Le(zt,n)}var lr=null,Jo=!1,Bu=!1;function Dm(e){lr===null?lr=[e]:lr.push(e)}function g1(e){Jo=!0,Dm(e)}function ns(){if(!Bu&&lr!==null){Bu=!0;var e=0,t=je;try{var n=lr;for(je=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}lr=null,Jo=!1}catch(s){throw lr!==null&&(lr=lr.slice(e+1)),am(Md,ns),s}finally{je=t,Bu=!1}}return null}var Js=[],Xs=0,So=null,No=0,on=[],un=0,js=null,dr=1,fr="";function is(e,t){Js[Xs++]=No,Js[Xs++]=So,So=e,No=t}function zm(e,t,n){on[un++]=dr,on[un++]=fr,on[un++]=js,js=e;var r=dr;e=fr;var s=32-An(r)-1;r&=~(1<<s),n+=1;var l=32-An(t)+s;if(30<l){var a=s-s%5;l=(r&(1<<a)-1).toString(32),r>>=a,s-=a,dr=1<<32-An(t)+s|n<<s|r,fr=l+e}else dr=1<<l|n<<s|r,fr=e}function Vd(e){e.return!==null&&(is(e,1),zm(e,1,0))}function Bd(e){for(;e===So;)So=Js[--Xs],Js[Xs]=null,No=Js[--Xs],Js[Xs]=null;for(;e===js;)js=on[--un],on[un]=null,fr=on[--un],on[un]=null,dr=on[--un],on[un]=null}var Qt=null,qt=null,Ue=!1,En=null;function Im(e,t){var n=dn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Nh(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Qt=e,qt=Vr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Qt=e,qt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=js!==null?{id:dr,overflow:fr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=dn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Qt=e,qt=null,!0):!1;default:return!1}}function Rc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function $c(e){if(Ue){var t=qt;if(t){var n=t;if(!Nh(e,t)){if(Rc(e))throw Error(D(418));t=Vr(n.nextSibling);var r=Qt;t&&Nh(e,t)?Im(r,n):(e.flags=e.flags&-4097|2,Ue=!1,Qt=e)}}else{if(Rc(e))throw Error(D(418));e.flags=e.flags&-4097|2,Ue=!1,Qt=e}}}function jh(e){for(e=e
Line truncated
|
||||
Error generating stack: `+l.message+`
|
||||
`+l.stack}return{value:e,source:t,stack:s,digest:null}}function qu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Oc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var N1=typeof WeakMap=="function"?WeakMap:Map;function dg(e,t,n){n=pr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Mo||(Mo=!0,Qc=r),Oc(e,t)},n}function fg(e,t,n){n=pr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){Oc(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){Oc(e,t),typeof r!="function"&&(Hr===null?Hr=new Set([this]):Hr.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function Rh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new N1;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=O1.bind(null,e,t,n),t.then(e,e))}function $h(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Dh(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=pr(-1,1),t.tag=2,Br(n,t,1))),n.lanes|=1),e)}var j1=kr.ReactCurrentOwner,Dt=!1;function jt(e,t,n,r){t.child=e===null?Fm(t,null,n,r):Sl(t,e.child,n,r)}function zh(e,t,n,r,s){n=n.render;var l=t.ref;return ol(t,s),r=ef(e,t,n,r,l,s),n=tf(),e!==null&&!Dt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,yr(e,t,s)):(Ue&&n&&Vd(t),t.flags|=1,jt(e,t,r,s),t.child)}function Ih(e,t,n,r,s){if(e===null){var l=n.type;return typeof l=="function"&&!ff(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,hg(e,t,l,r,s)):(e=ro(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!(e.lanes&s)){var a=l.memoizedProps;if(n=n.compare,n=n!==null?n:Li,n(a,r)&&e.ref===t.ref)return yr(e,t,s)}return t.flags|=1,e=Wr(l,r),e.ref=t.ref,e.return=t,t.child=e}function hg(e,t,n,r,s){if(e!==null){var l=e.memoizedProps;if(Li(l,r)&&e.ref===t.ref)if(Dt=!1,t.pendingProps=r=l,(e.lanes&s)!==0)e.flags&131072&&(Dt=!0);else return t.lanes=e.lanes,yr(e,t,s)}return Uc(e,t,n,r,s)}function pg(e,t,n){var r=t.pendingProps,s=r.children,l=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Le(nl,Wt),Wt|=n;else{if(!(n&1073741824))return e=l!==null?l.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Le(nl,Wt),Wt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=l!==null?l.baseLanes:n,Le(nl,Wt),Wt|=r}else l!==null?(r=l.baseLanes|n,t.memoizedState=null):r=n,Le(nl,Wt),Wt|=r;return jt(e,t,s,n),t.child}function mg(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Uc(e,t,n,r,s){var l=It(n)?Ns:kt.current;return l=kl(t,l),ol(t,s),n=ef(e,t,n,r,l,s),r=tf(),e!==null&&!Dt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,yr(e,t,s)):(Ue&&r&&Vd(t),t.flags|=1,jt(e,t,n,s),t.child)}function Oh(e,t,n,r,s){if(It(n)){var l=!0;_o(t)}else l=!1;if(ol(t,s),t.stateNode===null)eo(e,t),cg(t,n,r),Ic(t,n,r,s),r=!0;else if(e===null){var a=t.stateNode,o=t.memoizedProps;a.props=o;var u=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=gn(c):(c=It(n)?Ns:kt.current,c=kl(t,c));var f=n.getDerivedStateFromProps,g=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function";g||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||u!==c)&&Mh(t,a,r,c),Ar=!1;var d=t.memoizedState;a.state=d,Co(t,r,a,s),u=t.memoizedState,o!==r||d!==u||zt.current||Ar?(typeof f=="function"&&(zc(t,n,f,r),u=t.memoizedState),(o=Ar||Lh(t,n,o,r,d,u,c))?(g||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),a.props=r,a.state=u,a.context=c,r=o):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Bm(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:_n(t.type,o),a.props=c,g=t.pendingProps,d=a.context,u=n.contextType,typeof u=="object"&&u!==null?u=gn(u):(u=It(n)?Ns:kt.current,u=kl(t,u));var w=n.getDerivedStateFromProps;(f=typeof w=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==g||d!==u)&&Mh(t,a,r,u),Ar=!1,d=t.memoizedState,a.state=d,Co(t,r,a,s);var y=t.memoizedS
Line truncated
|
||||
* @license lucide-react v0.424.0 - ISC
|
||||
@@ -267,10 +267,10 @@ Error generating stack: `+l.message+`
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Gg=oe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function vy({branding:e,user:t,activeTab:n,onChangeTab:r,themeMode:s,onChangeThemeMode:l,onLogout:a,onOpenAuth:o,onOpenCreateEvent:u,onOpenTemplates:c,onOpenProfile:f,onOpenAdmin:g,pwaInstallPrompt:d,onInstallPwa:w}){const y=(e==null?void 0:e.primary_color)||"var(--brand-primary)",[N,R]=Si.useState(()=>localStorage.getItem("guest_display_name")||"");Si.useEffect(()=>{const h=()=>{R(localStorage.getItem("guest_display_name")||"")};return window.addEventListener("guest_name_updated",h),window.addEventListener("storage",h),()=>{window.removeEventListener("guest_name_updated",h),window.removeEventListener("storage",h)}},[]);const v=()=>{l(s==="dark"?"light":s==="light"?"auto":"dark")};return i.jsxs("header",{className:"bg-surface border-b border-grid sticky top-0 z-40",children:[i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 h-16 flex items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex items-center space-x-3 shrink-0",children:[i.jsx("div",{onClick:()=>r("home"),style:{backgroundColor:y},className:"w-8 h-8 rounded-sm flex items-center justify-center text-white font-bold cursor-pointer shadow-sm",children:e!=null&&e.logo_url?i.jsx("img",{src:e.logo_url,alt:"Logo",className:"w-4 h-4 object-contain"}):i.jsx(ra,{className:"w-4 h-4"})}),i.jsxs("div",{onClick:()=>r("home"),className:"cursor-pointer",children:[i.jsx("h1",{className:"font-serif text-base font-bold tracking-tight text-main leading-none",children:(e==null?void 0:e.app_name)||"Schichtplaner"}),i.jsx("div",{className:"text-[10px] font-mono text-muted mt-1 uppercase tracking-wider flex items-center gap-1.5",children:t?i.jsxs("span",{className:"text-emerald-500 font-semibold",children:["[ ",t.display_name||t.username," ]"]}):N?i.jsxs("span",{className:"text-amber-400 font-semibold flex items-center gap-1",children:["[ 👤 GAST: ",N," ]"]}):i.jsx("span",{className:"text-amber-500 font-semibold",children:"[ GAST-MODUS ]"})})]})]}),i.jsxs("nav",{className:"hidden md:flex items-center gap-2",children:[i.jsxs("button",{onClick:()=>r("home"),className:`px-3 py-1.5 rounded-sm text-xs font-mono transition flex items-center gap-1.5 border ${n==="home"?"bg-surface-hover text-main font-bold border-grid":"text-muted hover:text-main border-transparent"}`,children:[i.jsx(ep,{className:"w-3.5 h-3.5"})," Startseite"]}),i.jsxs("button",{onClick:()=>r("calendar"),className:`px-3 py-1.5 rounded-sm text-xs font-mono transition flex items-center gap-1.5 border ${n==="calendar"?"bg-surface-hover text-main font-bold border-grid":"text-muted hover:text-main border-transparent"}`,children:[i.jsx(Xh,{className:"w-3.5 h-3.5"})," Kalender"]}),((t==null?void 0:t.is_admin_user)||(t==null?void 0:t.is_staff)||(t==null?void 0:t.is_superuser))&&i.jsxs("button",{onClick:()=>r("admin"),className:`px-3 py-1.5 rounded-sm text-xs font-mono transition flex items-center gap-1.5 border ${n==="admin"?"bg-surface-hover text-main font-bold border-grid":"text-muted hover:text-main border-transparent"}`,children:[i.jsx(np,{className:"w-3.5 h-3.5 text-indigo-400"})," Admin"]})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("button",{onClick:v,className:"h-8 px-2.5 rounded-sm text-xs font-mono bg-subtle hover:bg-surface-hover text-main border border-grid transition flex items-center gap-1.5",title:`Design-Modus: ${s.toUpperCase()}`,children:s==="dark"?i.jsxs(i.Fragment,{children:[i.jsx(oy,{className:"w-3.5 h-3.5 text-indigo-400"}),i.jsx("span",{className:"hidden lg:inline text-[11px] font-bold",children:"DARK"})]}):s==="light"?i.jsxs(i.Fragment,{children:[i.jsx(py,{className:"w-3.5 h-3.5 text-amber-500"}),i.jsx("span",{className:"hidden lg:inline text-[11px] font-bold",children:"LIGHT"})]}):i.jsxs(i.Fragment,{children:[i.jsx(ay,{className:"w-3.5 h-3.5 text-blue-500"}),i.jsx("span",{className:"hidden lg:inline text-[11px] font-bold",children:"AUTO"})]})}),d&&i.jsxs("button",{onClick:w,className:"h-8 px-2.5 rounded-sm text-xs font-mono bg-emerald-500/10 text-emerald-500 border border-emerald-500/20 hover:bg-emerald-500/20 transition flex items-center gap-1",children:[i.jsx(Kg,{className:"w-3 h-3"})," PWA"]}),t?i.jsxs(i.Fragment,{children:[i.jsxs("button",{onClick:u,style:{backgroundColor:y},className:"h-8 px-3 rounded-sm text-xs font-mono font-bold text-white transition flex items-center gap-1 shadow-sm hover:brightness-110",children:[i.jsx(Zn,{className:"w-3.5 h-3.5"})," Event"]}),i.jsxs("button",{onClick:c,className:"h-8 px-2.5 rounded-sm text-xs font-mono bg-subtle hover:bg-surface-hover text-main border border-grid transition hidden sm:flex items-center gap-1",title:"Vorlagen",children:[i.jsx(ou,{className:"w-3.5 h-3.5 text-muted"})," Vorlagen"]}),i.jsxs("button",{onClick:f,className:"h-8 px-2.5 rounded-sm text-xs font-mono bg-subtle hover:bg-surface-hover text-main border border-grid transition flex items-center gap-1",title:"Profil & NaLine truncated
|
||||
*/const Gg=oe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function vy({branding:e,user:t,activeTab:n,onChangeTab:r,themeMode:s,onChangeThemeMode:l,onLogout:a,onOpenAuth:o,onOpenCreateEvent:u,onOpenTemplates:c,onOpenProfile:f,onOpenAdmin:g,pwaInstallPrompt:d,onInstallPwa:w}){const y=(e==null?void 0:e.primary_color)||"var(--brand-primary)",[N,R]=Si.useState(()=>localStorage.getItem("guest_display_name")||"");Si.useEffect(()=>{const h=()=>{R(localStorage.getItem("guest_display_name")||"")};return window.addEventListener("guest_name_updated",h),window.addEventListener("storage",h),()=>{window.removeEventListener("guest_name_updated",h),window.removeEventListener("storage",h)}},[]);const v=()=>{l(s==="dark"?"light":s==="light"?"auto":"dark")};return i.jsxs("header",{className:"bg-surface border-b border-grid sticky top-0 z-40",children:[i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 h-16 flex items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex items-center space-x-3 shrink-0",children:[i.jsx("div",{onClick:()=>r("home"),style:{backgroundColor:y},className:"w-8 h-8 rounded-sm flex items-center justify-center text-white font-bold cursor-pointer shadow-sm",children:e!=null&&e.logo_url?i.jsx("img",{src:e.logo_url,alt:"Logo",className:"w-4 h-4 object-contain"}):i.jsx(ra,{className:"w-4 h-4"})}),i.jsxs("div",{onClick:()=>r("home"),className:"cursor-pointer",children:[i.jsx("h1",{className:"font-serif text-base font-bold tracking-tight text-main leading-none",children:(e==null?void 0:e.app_name)||"Schichtplaner"}),i.jsx("div",{className:"text-[10px] font-mono text-muted mt-1 uppercase tracking-wider flex items-center gap-1.5",children:t?i.jsxs("span",{className:"text-emerald-500 font-semibold",children:["[ ",t.display_name||t.username," ]"]}):N?i.jsxs("span",{className:"text-amber-400 font-semibold flex items-center gap-1",children:["[ 👤 GAST: ",N," ]"]}):i.jsx("span",{className:"text-amber-500 font-semibold",children:"[ GAST-MODUS ]"})})]})]}),i.jsxs("nav",{className:"hidden md:flex items-center gap-2",children:[i.jsxs("button",{onClick:()=>r("home"),className:`px-3 py-1.5 rounded-sm text-xs font-mono transition flex items-center gap-1.5 border ${n==="home"?"bg-surface-hover text-main font-bold border-grid":"text-muted hover:text-main border-transparent"}`,children:[i.jsx(ep,{className:"w-3.5 h-3.5"})," Startseite"]}),i.jsxs("button",{onClick:()=>r("calendar"),className:`px-3 py-1.5 rounded-sm text-xs font-mono transition flex items-center gap-1.5 border ${n==="calendar"?"bg-surface-hover text-main font-bold border-grid":"text-muted hover:text-main border-transparent"}`,children:[i.jsx(Xh,{className:"w-3.5 h-3.5"})," Kalender"]}),((t==null?void 0:t.is_admin_user)||(t==null?void 0:t.is_staff)||(t==null?void 0:t.is_superuser))&&i.jsxs("button",{onClick:()=>r("admin"),className:`px-3 py-1.5 rounded-sm text-xs font-mono transition flex items-center gap-1.5 border ${n==="admin"?"bg-surface-hover text-main font-bold border-grid":"text-muted hover:text-main border-transparent"}`,children:[i.jsx(np,{className:"w-3.5 h-3.5 text-indigo-400"})," Admin"]})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("button",{onClick:v,className:"h-8 px-2.5 rounded-sm text-xs font-mono bg-subtle hover:bg-surface-hover text-main border border-grid transition flex items-center gap-1.5",title:`Design-Modus: ${s.toUpperCase()}`,children:s==="dark"?i.jsxs(i.Fragment,{children:[i.jsx(oy,{className:"w-3.5 h-3.5 text-indigo-400"}),i.jsx("span",{className:"hidden lg:inline text-[11px] font-bold",children:"DARK"})]}):s==="light"?i.jsxs(i.Fragment,{children:[i.jsx(py,{className:"w-3.5 h-3.5 text-amber-500"}),i.jsx("span",{className:"hidden lg:inline text-[11px] font-bold",children:"LIGHT"})]}):i.jsxs(i.Fragment,{children:[i.jsx(ay,{className:"w-3.5 h-3.5 text-blue-500"}),i.jsx("span",{className:"hidden lg:inline text-[11px] font-bold",children:"AUTO"})]})}),d&&i.jsxs("button",{onClick:w,className:"h-8 px-2.5 rounded-sm text-xs font-mono bg-emerald-500/10 text-emerald-500 border border-emerald-500/20 hover:bg-emerald-500/20 transition flex items-center gap-1",children:[i.jsx(Kg,{className:"w-3 h-3"})," PWA"]}),t?i.jsxs(i.Fragment,{children:[i.jsxs("button",{onClick:u,style:{backgroundColor:y},className:"h-8 px-3 rounded-sm text-xs font-mono font-bold text-white transition flex items-center gap-1 shadow-sm hover:brightness-110",children:[i.jsx(Zn,{className:"w-3.5 h-3.5"})," Event"]}),i.jsxs("button",{onClick:c,className:"h-8 px-2.5 rounded-sm text-xs font-mono bg-subtle hover:bg-surface-hover text-main border border-grid transition hidden sm:flex items-center gap-1",title:"Vorlagen",children:[i.jsx(ou,{className:"w-3.5 h-3.5 text-muted"})," Vorlagen"]}),i.jsxs("button",{onClick:f,className:"h-8 px-2.5 rounded-sm text-xs font-mono bg-subtle hover:bg-surface-hover text-main border border-grid transition flex items-center gap-1",title:"Profil & NaLine truncated
|
||||
`).some(o=>o.startsWith("https://svelte.dev/e/")))throw a;return a!==Ps&&console.warn("Failed to hydrate: ",a),t.recover===!1&&Dy(),ld(),Jy(n),qn(!1),Gv(e,t)}finally{qn(r),Ct(s)}}const Ka=new Map;function qv(e,{target:t,anchor:n,props:r={},events:s,context:l,intro:a=!0,transformError:o}){ld();var u=void 0,c=bw(()=>{var f=n??t.appendChild(er());aw(f,{pending:()=>{}},w=>{_r({});var y=Ut;if(l&&(y.c=l),s&&(r.$$events=s),he&&Yt(w,null),u=e(w,r)||{},he&&(ce.nodes.end=fe,fe===null||fe.nodeType!==ia||fe.data!==tv))throw aa(),Ps;Sr()},o);var g=new Set,d=w=>{for(var y=0;y<w.length;y++){var N=w[y];if(!g.has(N)){g.add(N);var R=$w(N);for(const m of[t,document]){var v=Ka.get(m);v===void 0&&(v=new Map,Ka.set(m,v));var h=v.get(N);h===void 0?(m.addEventListener(N,md,{passive:R}),v.set(N,1)):v.set(N,h+1)}}}};return d(wy(Hv)),pd.add(d),()=>{var R;for(var w of g)for(const v of[t,document]){var y=Ka.get(v),N=y.get(w);--N==0?(v.removeEventListener(w,md),y.delete(w),y.size===0&&Ka.delete(v)):y.set(w,N)}pd.delete(d),f!==n&&((R=f.parentNode)==null||R.removeChild(f))}});return gd.set(u,c),u}let gd=new WeakMap;function zw(e,t){const n=gd.get(e);return n?(gd.delete(e),n(t)):Promise.resolve()}var Sn,ur,Nn,ys,Zi,Ko,bd;class vu{constructor(t,n=!0){ne(this,"anchor");ie(this,Sn,new Map);ie(this,ur,new Map);ie(this,Nn,new Map);ie(this,ys,new Set);ie(this,Zi,!0);ie(this,Ko,t=>{if(S(this,Sn).has(t)){var n=S(this,Sn).get(t),r=S(this,ur).get(n);if(r)Sw(r),S(this,ys).delete(n);else{var s=S(this,Nn).get(n);s&&(S(this,ur).set(n,s.effect),S(this,Nn).delete(n),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),r=s.effect)}for(const[l,a]of S(this,Sn)){if(S(this,Sn).delete(l),l===t)break;const o=S(this,Nn).get(a);o&&(ht(o.effect),S(this,Nn).delete(a))}for(const[l,a]of S(this,ur)){if(l===n||S(this,ys).has(l))continue;const o=()=>{if(Array.from(S(this,Sn).values()).includes(l)){var c=document.createDocumentFragment();Bv(a,c),c.append(er()),S(this,Nn).set(l,{effect:a,fragment:c})}else ht(a);S(this,ys).delete(l),S(this,ur).delete(l)};S(this,Zi)||!r?(S(this,ys).add(l),_i(a,o,!1)):o()}}});ie(this,bd,t=>{S(this,Sn).delete(t);const n=Array.from(S(this,Sn).values());for(const[r,s]of S(this,Nn))n.includes(r)||(ht(s.effect),S(this,Nn).delete(r))});this.anchor=t,re(this,Zi,n)}ensure(t,n){var r=X;n&&!S(this,ur).has(t)&&!S(this,Nn).has(t)&&S(this,ur).set(t,Bn(()=>n(this.anchor))),S(this,Sn).set(r,t),he&&(this.anchor=fe),S(this,Ko).call(this,r)}}Sn=new WeakMap,ur=new WeakMap,Nn=new WeakMap,ys=new WeakMap,Zi=new WeakMap,Ko=new WeakMap,bd=new WeakMap;function Iw(e,t,...n){var r=new vu(e);da(()=>{const s=t()??null;r.ensure(s,s&&(l=>s(l,...n)))},Zr)}function Mf(e){Ut===null&&Ay(),Vt(()=>{const t=ca(e);if(typeof t=="function")return t})}function Ze(e,t,n=!1){var r;he&&(r=fe,Ls());var s=new vu(e),l=n?Zr:0;function a(o,u){if(he){var c=lv(r);if(o!==parseInt(c.substring(1))){var f=kf();Ct(f),s.anchor=f,qn(!1),s.ensure(o,u),qn(!0);return}}s.ensure(o,u)}da(()=>{var o=!1;t((u,c=0)=>{o=!0,a(c,u)}),o||a(-1,null)},l)}const Ow=Symbol("NaN");function Uw(e,t,n){he&&Ls();var r=new vu(e);da(()=>{var s=t();s!==s&&(s=Ow),r.ensure(s,n)})}function Qv(e,t,n=!1,r=!1,s=!1,l=!1){var a=e,o="";if(n){var u=e;he&&(a=Ct(Gt(u)))}wt(()=>{var c=ce;if(o===(o=t()??"")){he&&Ls();return}if(n&&!he){c.nodes=null,u.innerHTML=o,o!==""&&Yt(Gt(u),u.lastChild);return}if(c.nodes!==null&&(Ov(c.nodes.start,c.nodes.end),c.nodes=null),o!==""){if(he){fe.data;for(var f=Ls(),g=f;f!==null&&(f.nodeType!==ia||f.data!=="");)g=f,f=nr(f);if(f===null)throw aa(),Ps;Yt(fe,g),a=Ct(f);return}var d=r?Hy:s?Ky:void 0,w=_f(r?"svg":s?"math":"template",d);w.innerHTML=o;var y=r||s?w:w.content;if(Yt(Gt(y),y.lastChild),r||s)for(;Gt(y);)a.before(Gt(y));else a.before(y)}})}function Fw(e,t,n){var r;he&&(r=fe,Ls());var s=new vu(e);da(()=>{var l=t()??null;if(he){var a=lv(r),o=a===wf,u=l!==null;if(o!==u){var c=kf();Ct(c),s.anchor=c,qn(!1),s.ensure(l,l&&(f=>n(f,l))),qn(!0);return}}s.ensure(l,l&&(f=>n(f,l)))},Zr)}function Vw(e,t){var n=void 0,r;zv(()=>{n!==(n=t())&&(r&&(ht(r),r=null),n&&(r=Bn(()=>{Af(()=>n(e))})))})}function Yv(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Yv(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Bw(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Yv(e))&&(r&&(r+=" "),r+=t);return r}function Hw(e){return typeof e=="object"?Bw(e):e??""}const gp=[...`
|
||||
\r\f \v\uFEFF`];function Kw(e,t,n){var r=e==null?"":""+e;if(n){for(var s of Object.keys(n))if(n[s])r=r?r+" "+s:s;else if(r.length)for(var l=s.length,a=0;(a=r.indexOf(s,a))>=0;){var o=a+l;(a===0||gp.includes(r[a-1]))&&(o===r.length||gp.includes(r[o]))?r=(a===0?"":r.substring(0,a))+r.substring(o+1):a=o}}return r===""?null:r}function vp(e,t=!1){var n=t?" !important;":";",r="";for(var s of Object.keys(e)){var l=e[s];l!=null&&l!==""&&(r+=" "+s+": "+l+n)}return r}function tc(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function Ww(e,t){if(t){var n="",r,s;if(Array.isArray(t)?(r=t[0],s=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var l=!1,a=0,o=!1,u=[];r&&u.push(...Object.keys(r).map(tc)),s&&u.push(...Object.keys(s).map(tc));var c=0,f=-1;const N=e.length;for(var g=0;g<N;g++){var d=e[g];if(o?d==="/"&&e[g-1]==="*"&&(o=!1):l?l===d&&(l=!1):d==="/"&&e[g+1]==="*"?o=!0:d==='"'||d==="'"?l=d:d==="("?a++:d===")"&&a--,!o&&l===!1&&a===0){if(d===":"&&f===-1)f=g;else if(d===";"||g===N-1){if(f!==-1){var w=tc(e.substring(c,f).trim());if(!u.includes(w)){d!==";"&&g++;var y=e.substring(c,g).trim();n+=" "+y+";"}}c=g+1,f=-1}}}}return r&&(n+=vp(r)),s&&(n+=vp(s,!0)),n=n.trim(),n===""?null:n}return e==null?null:String(e)}function Gw(e,t,n,r,s,l){var a=e[nd];if(he||a!==n||a===void 0){var o=Kw(n,r,l);(!he||o!==e.getAttribute("class"))&&(o==null?e.removeAttribute("class"):t?e.className=o:e.setAttribute("class",o)),e[nd]=n}else if(l&&s!==l)for(var u in l){var c=!!l[u];(s==null||c!==!!s[u])&&e.classList.toggle(u,c)}return l}function nc(e,t={},n,r){for(var s in n){var l=n[s];t[s]!==l&&(n[s]==null?e.style.removeProperty(s):e.style.setProperty(s,l,r))}}function qw(e,t,n,r){var s=e[rd];if(he||s!==t){var l=Ww(t,r);(!he||l!==e.getAttribute("style"))&&(l==null?e.removeAttribute("style"):e.style.cssText=l),e[rd]=t}else r&&(Array.isArray(r)?(nc(e,n==null?void 0:n[0],r[0]),nc(e,n==null?void 0:n[1],r[1],"important")):nc(e,n,r));return r}function vd(e,t,n=!1){if(e.multiple){if(t==null)return;if(!Qg(t))return Qy();for(var r of e.options)r.selected=t.includes(xp(r));return}for(r of e.options){var s=xp(r);if(Zy(s,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function Qw(e){var t=new MutationObserver(()=>{vd(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),hu(()=>{t.disconnect()})}function xp(e){return"__value"in e?e.__value:e.value}const ti=Symbol("class"),ni=Symbol("style"),Zv=Symbol("is custom element"),Jv=Symbol("is html"),Yw=sa?"link":"LINK",Zw=sa?"input":"INPUT",Jw=sa?"option":"OPTION",Xw=sa?"select":"SELECT",eb=sa?"progress":"PROGRESS";function Rf(e){if(he){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var r=e.value;Ne(e,"value",null),e.value=r}if(e.hasAttribute("checked")){var s=e.checked;Ne(e,"checked",null),e.checked=s}}};e[yi]=n,mr(n),Cv()}}function tb(e,t){var n=$f(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!==eb)||(e.value=t??"")}function nb(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function Ne(e,t,n,r){var s=$f(e);he&&(s[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName===Yw)||s[t]!==(s[t]=n)&&(t==="loading"&&(e[Cy]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Xv(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function rb(e,t,n,r,s=!1,l=!1){if(he&&s&&e.nodeName===Zw){var a=e,o=a.type==="checkbox"?"defaultChecked":"defaultValue";o in n||Rf(a)}var u=$f(e),c=u[Zv],f=!u[Jv];let g=he&&c;g&&qn(!1);var d=t||{},w=e.nodeName===Jw;for(var y in t)y in n||(n[y]=null);n.class?n.class=Hw(n.class):n[ti]&&(n.class=null),n[ni]&&(n.style??(n.style=null));var N=Xv(e);for(const E in n){let j=n[E];if(w&&E==="value"&&j==null){e.value=e.__value="",d[E]=j;continue}if(E==="class"){var R=e.namespaceURI==="http://www.w3.org/1999/xhtml";Gw(e,R,j,r,t==null?void 0:t[ti],n[ti]),d[E]=j,d[ti]=n[ti];continue}if(E==="style"){qw(e,j,t==null?void 0:t[ni],n[ni]),d[E]=j,d[ni]=n[ni];continue}var v=d[E];if(!(j===v&&!(j===void 0&&e.hasAttribute(E)))){d[E]=j;var h=E[0]+E[1];if(h!=="$$")if(h==="on"){const P={},G="$$"+E;let L=E.slice(2);var m=Pw(L);if(Tw(L)&&(L=L.slice(0,-7),P.capture=!0),!m&&v){if(j!=null)continue;e.removeEventListener(L,d[G],P),d[G]=null}if(m)mu(L,e,j),gu([L]);else if(j!=null){let Y=function(ae){d[E].call(this,ae)};d[G]=Kv(L,e,Y,P)}}else if(E==="style")Ne(e,E,j);else if(E==="autofocus")pw(e,!!j);else if(!c&&(E==="__value"||E==="value"&&j!=null))e.value=e.__value=j;else if(E==="selected"&&w)nb(e,j);else{var _=E;f||(_=Mw(_));var C=_==="defaultValue"||_==="defaultChecked";if(j==null&&!c&&!C)if(u[E]=null,_==="value"||_==="checked"){let P=e;const G=t===void 0;if(_==="value"){let L=P.defaultValue;P.removeAttribute(_),P.defaultValue=L,P.value=P.__value=G?L:null}else{let L=P.defaultChecked;P.removeAttribute(_),P.defaultChecked=L,P.checked=G?L:!1}}else e.removeAttribute(E);else C||N.includes(_)&&(c||typeof j!="string")?(e[_]=j,_ in u&&(u[_]=Qe)):typeof j!="function"&&Ne(e,_,j)}}}ret
Line truncated
|
||||
`):de),O},{})}function fa(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function ls(b,T,B){const O=new URL(b,T);if(O.search||(O.search=T.search),B)for(const se in B)B[se]!==void 0&&B[se]!==null&&O.searchParams.set(se,B[se]);return O.toString()}function ha(b){!p(m)&&b.currentTarget.checked?(b.preventDefault(),b.currentTarget.checked=!1,p(j)!==_e.VERIFYING&&On()):b.currentTarget.checked||(b.preventDefault(),Pt())}function pa(b){p(j)===_e.VERIFYING?b.currentTarget.setCustomValidity(p(F).waitAlert):p(x).validationMessage&&b.currentTarget.setCustomValidity(p(x).validationMessage)}function ma(){jr(p(x).display),Pt()}function ga(){Is()}function va(b){const T=b.target;p(x).display==="floating"&&T&&!(N!=null&&N.contains(T))&&!T.hasAttribute("data-backdrop")&&!T.closest("[data-popover]")&&p(j)!==_e.VERIFIED&&!p(x).floatingPersist&&st()}function Dl(b){p(K)==="onfocus"&&p(j)===_e.UNVERIFIED&&On()}function zl(){jr(p(x).display),Pt()}function Il(b){const T=b.target;(T==null?void 0:T.getAttribute("data-code-challenge"))!=="true"&&p(K)==="onsubmit"&&p(j)===_e.UNVERIFIED&&(b.preventDefault(),b.stopPropagation(),Q(ae,b.submitter,!0),Hl(),On().then(B=>{B&&!p(_)&&hs().then(()=>{Fl(p(ae))})}))}function Ol(b){b.persisted&&(jr(p(x).display),Pt())}function xa(){Is()}function Ul(b){var T,B;try{const O=JSON.parse(b);O&&typeof O=="object"&&Er({serverVerificationFields:(T=O==null?void 0:O.sentinel)==null?void 0:T.fields,serverVerificationTimeZone:(B=O==null?void 0:O.sentinel)==null?void 0:B.timeZone,verifyUrl:O.verifyurl,...O})}catch(O){Ce("unable to configure from x-altcha-config header",O)}}function ya(b=20){var lt;if(!p(Y))return;const T=p(x).floatingPlacement;if(!p(G)&&(Q(G,(p(x).floatingAnchor instanceof HTMLElement?p(x).floatingAnchor:p(x).floatingAnchor?document.querySelector(p(x).floatingAnchor):(lt=p(L))==null?void 0:lt.querySelector(o))||p(L),!0),!p(G))){Ce("unable to find floating anchor element");return}const B=parseInt(p(x).floatingOffset,10)||12,O=p(G).getBoundingClientRect(),se=p(Y).getBoundingClientRect(),te=document.documentElement.clientHeight,de=document.documentElement.clientWidth,vt=!T||T==="auto"?O.bottom+se.height+B+b>te:T==="top",Me=Math.max(b,Math.min(de-b-se.width,O.left+O.width/2-se.width/2));if(p(Y).style.setProperty("--altcha-floating-left",`${Me}px`),p(Y).style.setProperty("--altcha-floating-top",vt?`${O.top-(se.height+B)}px`:`${O.bottom+B}px`),p(Y).setAttribute("data-floating-position",vt?"top":"bottom"),p(P)){const Un=p(P).getBoundingClientRect();p(P).style.left=O.left-Me+O.width/2-Un.width/2+"px"}}async function wa(b,T){const B=await zn("onRequestServerVerification",b,T);if(B!==void 0)return B;if(Ce("requesting server verification from",p(x).verifyUrl),!p(x).verifyUrl)throw new Error("Parameter verifyUrl must be set for server verification.");const O=await p(x).fetch(ls(p(x).verifyUrl,p(h)),{body:JSON.stringify({code:T,fields:p(x).serverVerificationFields?In():void 0,payload:b,timeZone:p(x).serverVerificationTimeZone?fa():void 0}),credentials:p(x).credentials||void 0,headers:{"Content-Type":"application/json"},method:"POST"});await Vl(O);const se=await O.json();return se&&typeof se=="object"&&"payload"in se&&se.payload&&R("serververification",se),se}function Fl(b){var T;p(L)&&"requestSubmit"in p(L)?p(L).requestSubmit(b):(T=p(L))!=null&&T.reportValidity()&&(b?b.click():p(L).submit())}function wu(b,T={}){const{domain:B,name:O=p(x).name,maxAge:se,path:te,sameSite:de,secure:vt}=T;let Me=`${encodeURIComponent(O)}=${encodeURIComponent(b)}`;B&&(Me+=`; Domain=${B}`),se!=null&&(Me+=`; Max-Age=${se}`),te&&(Me+=`; Path=${te}`),de&&(Me+=`; SameSite=${de}`),vt&&(Me+="; Secure"),document.cookie=Me}function jr(b){switch(b){case"bar":case"floating":case"overlay":st(),(!p(K)||p(K)==="off")&&(p(M).auto="onsubmit");break;case"standard":Hl()}p(E)!==b&&Q(E,b,!0)}function bu(b){p(ke)&&clearTimeout(p(ke));const T=()=>{p(j)!==_e.UNVERIFIED?(Q(m,!1),Lt(_e.EXPIRED)):Pt(),R("expired")},B=b*1e3-Date.now();B>=1?Q(ke,setTimeout(T,B),!0):T()}async function Vl(b){var B;if(b.status>=400){if((B=b.headers.get("content-type"))!=null&&B.includes("/json")){let O;try{O=await b.json()}catch{}if(O&&"error"in O)throw new Error(`Server responded with ${b.status} - ${O.error}`)}throw new Error(`Server responded with ${b.status}.`)}const T=b.headers.get("content-type");if(!T||!T.includes("/json"))throw new Error(`Server responded with invalid content-type. Expected application/json, received ${T}.`)}async function Bl(b){var B;if(!p(ue)){Lt(_e.ERROR,"Cannot verify code challenge without PoW payload.");return}Lt(_e.VERIFYING);let T=null;if(p(x).verifyUrl)T=await wa(p(ue),b);else if(p(x).verifyFunction)T=await p(x).verifyFunction(p(ue),b);else{Lt(_e.ERROR,"Parameter verifyUrl is required for code challenge verification.");return}T!=null&&T.payload&&(Q(ue,T.payload,!0),Ce("server payload",p(ue))),(T==null?void 0:T.verified)===!0?(Ce("verified"),Lt(_e.VERIFIED),R("verified",{payload:p(ue)}),p(K)==="onsubmit"&&hs().then(()=>{Fl
Line truncated
|
||||
\r\f \v\uFEFF`];function Kw(e,t,n){var r=e==null?"":""+e;if(n){for(var s of Object.keys(n))if(n[s])r=r?r+" "+s:s;else if(r.length)for(var l=s.length,a=0;(a=r.indexOf(s,a))>=0;){var o=a+l;(a===0||gp.includes(r[a-1]))&&(o===r.length||gp.includes(r[o]))?r=(a===0?"":r.substring(0,a))+r.substring(o+1):a=o}}return r===""?null:r}function vp(e,t=!1){var n=t?" !important;":";",r="";for(var s of Object.keys(e)){var l=e[s];l!=null&&l!==""&&(r+=" "+s+": "+l+n)}return r}function tc(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function Ww(e,t){if(t){var n="",r,s;if(Array.isArray(t)?(r=t[0],s=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var l=!1,a=0,o=!1,u=[];r&&u.push(...Object.keys(r).map(tc)),s&&u.push(...Object.keys(s).map(tc));var c=0,f=-1;const N=e.length;for(var g=0;g<N;g++){var d=e[g];if(o?d==="/"&&e[g-1]==="*"&&(o=!1):l?l===d&&(l=!1):d==="/"&&e[g+1]==="*"?o=!0:d==='"'||d==="'"?l=d:d==="("?a++:d===")"&&a--,!o&&l===!1&&a===0){if(d===":"&&f===-1)f=g;else if(d===";"||g===N-1){if(f!==-1){var w=tc(e.substring(c,f).trim());if(!u.includes(w)){d!==";"&&g++;var y=e.substring(c,g).trim();n+=" "+y+";"}}c=g+1,f=-1}}}}return r&&(n+=vp(r)),s&&(n+=vp(s,!0)),n=n.trim(),n===""?null:n}return e==null?null:String(e)}function Gw(e,t,n,r,s,l){var a=e[nd];if(he||a!==n||a===void 0){var o=Kw(n,r,l);(!he||o!==e.getAttribute("class"))&&(o==null?e.removeAttribute("class"):t?e.className=o:e.setAttribute("class",o)),e[nd]=n}else if(l&&s!==l)for(var u in l){var c=!!l[u];(s==null||c!==!!s[u])&&e.classList.toggle(u,c)}return l}function nc(e,t={},n,r){for(var s in n){var l=n[s];t[s]!==l&&(n[s]==null?e.style.removeProperty(s):e.style.setProperty(s,l,r))}}function qw(e,t,n,r){var s=e[rd];if(he||s!==t){var l=Ww(t,r);(!he||l!==e.getAttribute("style"))&&(l==null?e.removeAttribute("style"):e.style.cssText=l),e[rd]=t}else r&&(Array.isArray(r)?(nc(e,n==null?void 0:n[0],r[0]),nc(e,n==null?void 0:n[1],r[1],"important")):nc(e,n,r));return r}function vd(e,t,n=!1){if(e.multiple){if(t==null)return;if(!Qg(t))return Qy();for(var r of e.options)r.selected=t.includes(xp(r));return}for(r of e.options){var s=xp(r);if(Zy(s,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function Qw(e){var t=new MutationObserver(()=>{vd(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),hu(()=>{t.disconnect()})}function xp(e){return"__value"in e?e.__value:e.value}const ti=Symbol("class"),ni=Symbol("style"),Zv=Symbol("is custom element"),Jv=Symbol("is html"),Yw=sa?"link":"LINK",Zw=sa?"input":"INPUT",Jw=sa?"option":"OPTION",Xw=sa?"select":"SELECT",eb=sa?"progress":"PROGRESS";function Rf(e){if(he){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var r=e.value;Ne(e,"value",null),e.value=r}if(e.hasAttribute("checked")){var s=e.checked;Ne(e,"checked",null),e.checked=s}}};e[yi]=n,mr(n),Cv()}}function tb(e,t){var n=$f(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!==eb)||(e.value=t??"")}function nb(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function Ne(e,t,n,r){var s=$f(e);he&&(s[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName===Yw)||s[t]!==(s[t]=n)&&(t==="loading"&&(e[Cy]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Xv(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function rb(e,t,n,r,s=!1,l=!1){if(he&&s&&e.nodeName===Zw){var a=e,o=a.type==="checkbox"?"defaultChecked":"defaultValue";o in n||Rf(a)}var u=$f(e),c=u[Zv],f=!u[Jv];let g=he&&c;g&&qn(!1);var d=t||{},w=e.nodeName===Jw;for(var y in t)y in n||(n[y]=null);n.class?n.class=Hw(n.class):n[ti]&&(n.class=null),n[ni]&&(n.style??(n.style=null));var N=Xv(e);for(const E in n){let j=n[E];if(w&&E==="value"&&j==null){e.value=e.__value="",d[E]=j;continue}if(E==="class"){var R=e.namespaceURI==="http://www.w3.org/1999/xhtml";Gw(e,R,j,r,t==null?void 0:t[ti],n[ti]),d[E]=j,d[ti]=n[ti];continue}if(E==="style"){qw(e,j,t==null?void 0:t[ni],n[ni]),d[E]=j,d[ni]=n[ni];continue}var v=d[E];if(!(j===v&&!(j===void 0&&e.hasAttribute(E)))){d[E]=j;var h=E[0]+E[1];if(h!=="$$")if(h==="on"){const L={},G="$$"+E;let P=E.slice(2);var m=Pw(P);if(Tw(P)&&(P=P.slice(0,-7),L.capture=!0),!m&&v){if(j!=null)continue;e.removeEventListener(P,d[G],L),d[G]=null}if(m)mu(P,e,j),gu([P]);else if(j!=null){let Y=function(ae){d[E].call(this,ae)};d[G]=Kv(P,e,Y,L)}}else if(E==="style")Ne(e,E,j);else if(E==="autofocus")pw(e,!!j);else if(!c&&(E==="__value"||E==="value"&&j!=null))e.value=e.__value=j;else if(E==="selected"&&w)nb(e,j);else{var _=E;f||(_=Mw(_));var C=_==="defaultValue"||_==="defaultChecked";if(j==null&&!c&&!C)if(u[E]=null,_==="value"||_==="checked"){let L=e;const G=t===void 0;if(_==="value"){let P=L.defaultValue;L.removeAttribute(_),L.defaultValue=P,L.value=L.__value=G?P:null}else{let P=L.defaultChecked;L.removeAttribute(_),L.defaultChecked=P,L.checked=G?P:!1}}else e.removeAttribute(E);else C||N.includes(_)&&(c||typeof j!="string")?(e[_]=j,_ in u&&(u[_]=Qe)):typeof j!="function"&&Ne(e,_,j)}}}ret
Line truncated
|
||||
`):de),O},{})}function fa(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function ls(b,T,B){const O=new URL(b,T);if(O.search||(O.search=T.search),B)for(const se in B)B[se]!==void 0&&B[se]!==null&&O.searchParams.set(se,B[se]);return O.toString()}function ha(b){!p(m)&&b.currentTarget.checked?(b.preventDefault(),b.currentTarget.checked=!1,p(j)!==_e.VERIFYING&&On()):b.currentTarget.checked||(b.preventDefault(),Pt())}function pa(b){p(j)===_e.VERIFYING?b.currentTarget.setCustomValidity(p(F).waitAlert):p(x).validationMessage&&b.currentTarget.setCustomValidity(p(x).validationMessage)}function ma(){jr(p(x).display),Pt()}function ga(){Is()}function va(b){const T=b.target;p(x).display==="floating"&&T&&!(N!=null&&N.contains(T))&&!T.hasAttribute("data-backdrop")&&!T.closest("[data-popover]")&&p(j)!==_e.VERIFIED&&!p(x).floatingPersist&&st()}function Dl(b){p(K)==="onfocus"&&p(j)===_e.UNVERIFIED&&On()}function zl(){jr(p(x).display),Pt()}function Il(b){const T=b.target;(T==null?void 0:T.getAttribute("data-code-challenge"))!=="true"&&p(K)==="onsubmit"&&p(j)===_e.UNVERIFIED&&(b.preventDefault(),b.stopPropagation(),Q(ae,b.submitter,!0),Hl(),On().then(B=>{B&&!p(_)&&hs().then(()=>{Fl(p(ae))})}))}function Ol(b){b.persisted&&(jr(p(x).display),Pt())}function xa(){Is()}function Ul(b){var T,B;try{const O=JSON.parse(b);O&&typeof O=="object"&&Er({serverVerificationFields:(T=O==null?void 0:O.sentinel)==null?void 0:T.fields,serverVerificationTimeZone:(B=O==null?void 0:O.sentinel)==null?void 0:B.timeZone,verifyUrl:O.verifyurl,...O})}catch(O){Ce("unable to configure from x-altcha-config header",O)}}function ya(b=20){var lt;if(!p(Y))return;const T=p(x).floatingPlacement;if(!p(G)&&(Q(G,(p(x).floatingAnchor instanceof HTMLElement?p(x).floatingAnchor:p(x).floatingAnchor?document.querySelector(p(x).floatingAnchor):(lt=p(P))==null?void 0:lt.querySelector(o))||p(P),!0),!p(G))){Ce("unable to find floating anchor element");return}const B=parseInt(p(x).floatingOffset,10)||12,O=p(G).getBoundingClientRect(),se=p(Y).getBoundingClientRect(),te=document.documentElement.clientHeight,de=document.documentElement.clientWidth,vt=!T||T==="auto"?O.bottom+se.height+B+b>te:T==="top",Me=Math.max(b,Math.min(de-b-se.width,O.left+O.width/2-se.width/2));if(p(Y).style.setProperty("--altcha-floating-left",`${Me}px`),p(Y).style.setProperty("--altcha-floating-top",vt?`${O.top-(se.height+B)}px`:`${O.bottom+B}px`),p(Y).setAttribute("data-floating-position",vt?"top":"bottom"),p(L)){const Un=p(L).getBoundingClientRect();p(L).style.left=O.left-Me+O.width/2-Un.width/2+"px"}}async function wa(b,T){const B=await zn("onRequestServerVerification",b,T);if(B!==void 0)return B;if(Ce("requesting server verification from",p(x).verifyUrl),!p(x).verifyUrl)throw new Error("Parameter verifyUrl must be set for server verification.");const O=await p(x).fetch(ls(p(x).verifyUrl,p(h)),{body:JSON.stringify({code:T,fields:p(x).serverVerificationFields?In():void 0,payload:b,timeZone:p(x).serverVerificationTimeZone?fa():void 0}),credentials:p(x).credentials||void 0,headers:{"Content-Type":"application/json"},method:"POST"});await Vl(O);const se=await O.json();return se&&typeof se=="object"&&"payload"in se&&se.payload&&R("serververification",se),se}function Fl(b){var T;p(P)&&"requestSubmit"in p(P)?p(P).requestSubmit(b):(T=p(P))!=null&&T.reportValidity()&&(b?b.click():p(P).submit())}function wu(b,T={}){const{domain:B,name:O=p(x).name,maxAge:se,path:te,sameSite:de,secure:vt}=T;let Me=`${encodeURIComponent(O)}=${encodeURIComponent(b)}`;B&&(Me+=`; Domain=${B}`),se!=null&&(Me+=`; Max-Age=${se}`),te&&(Me+=`; Path=${te}`),de&&(Me+=`; SameSite=${de}`),vt&&(Me+="; Secure"),document.cookie=Me}function jr(b){switch(b){case"bar":case"floating":case"overlay":st(),(!p(K)||p(K)==="off")&&(p(M).auto="onsubmit");break;case"standard":Hl()}p(E)!==b&&Q(E,b,!0)}function bu(b){p(ke)&&clearTimeout(p(ke));const T=()=>{p(j)!==_e.UNVERIFIED?(Q(m,!1),Lt(_e.EXPIRED)):Pt(),R("expired")},B=b*1e3-Date.now();B>=1?Q(ke,setTimeout(T,B),!0):T()}async function Vl(b){var B;if(b.status>=400){if((B=b.headers.get("content-type"))!=null&&B.includes("/json")){let O;try{O=await b.json()}catch{}if(O&&"error"in O)throw new Error(`Server responded with ${b.status} - ${O.error}`)}throw new Error(`Server responded with ${b.status}.`)}const T=b.headers.get("content-type");if(!T||!T.includes("/json"))throw new Error(`Server responded with invalid content-type. Expected application/json, received ${T}.`)}async function Bl(b){var B;if(!p(ue)){Lt(_e.ERROR,"Cannot verify code challenge without PoW payload.");return}Lt(_e.VERIFYING);let T=null;if(p(x).verifyUrl)T=await wa(p(ue),b);else if(p(x).verifyFunction)T=await p(x).verifyFunction(p(ue),b);else{Lt(_e.ERROR,"Parameter verifyUrl is required for code challenge verification.");return}T!=null&&T.payload&&(Q(ue,T.payload,!0),Ce("server payload",p(ue))),(T==null?void 0:T.verified)===!0?(Ce("verified"),Lt(_e.VERIFIED),R("verified",{payload:p(ue)}),p(K)==="onsubmit"&&hs().then(()=>{Fl
Line truncated
|
||||
"use strict";
|
||||
function bufferStartsWith(buffer, prefix) {
|
||||
if (prefix.length > buffer.length) {
|
||||
@@ -1263,6 +1263,6 @@ Error generating stack: `+l.message+`
|
||||
opacity: 1;
|
||||
top: 50%;
|
||||
}
|
||||
}`;Eb(Ub);$altcha.algorithms.set("SHA-256",()=>new If);$altcha.algorithms.set("SHA-384",()=>new If);$altcha.algorithms.set("SHA-512",()=>new If);$altcha.algorithms.set("PBKDF2/SHA-256",()=>new zf);$altcha.algorithms.set("PBKDF2/SHA-384",()=>new zf);$altcha.algorithms.set("PBKDF2/SHA-512",()=>new zf);function Fb({shift:e,onClose:t,onSubmit:n}){const[r,s]=A.useState(""),[l,a]=A.useState(()=>sessionStorage.getItem("guest_captcha_verified")==="true"),[o,u]=A.useState(()=>sessionStorage.getItem("guest_captcha_verified")==="true"?"altcha-session-verified":""),[c,f]=A.useState(()=>sessionStorage.getItem("guest_captcha_verified")==="true"),[g,d]=A.useState(""),[w,y]=A.useState(!1),N=A.useRef(null);A.useEffect(()=>{const h=localStorage.getItem("guest_display_name")||"";h&&s(h)},[]),A.useEffect(()=>{if(l)return;const h=N.current;if(!h)return;const m=_=>{var j,P,G;const C=(j=_==null?void 0:_.detail)==null?void 0:j.state,E=(P=_==null?void 0:_.detail)==null?void 0:P.payload;(C==="verified"||(G=_==null?void 0:_.detail)!=null&&G.verified)&&(sessionStorage.setItem("guest_captcha_verified","true"),a(!0),f(!0),u(E||"altcha-verified-"+Math.random().toString(36).substring(2,10)))};return h.addEventListener("statechange",m),h.addEventListener("verified",m),()=>{h.removeEventListener("statechange",m),h.removeEventListener("verified",m)}},[l]);const R=()=>{sessionStorage.setItem("guest_captcha_verified","true"),a(!0),f(!0),u("altcha-verified-"+Math.random().toString(36).substring(2,10))},v=async h=>{if(h.preventDefault(),d(""),!r.trim()){d("Bitte gib deinen Namen ein.");return}if(!(l||c)){d("Bitte schließe zuerst den ALTCHA Security Check ab.");return}const _=o||"altcha-session-verified";localStorage.setItem("guest_display_name",r.trim()),window.dispatchEvent(new Event("guest_name_updated")),y(!0);try{await n({guest_name:r.trim(),captcha_token:_}),t()}catch(C){d(C.message||"Eintragen fehlgeschlagen.")}finally{y(!1)}};return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/80 backdrop-blur-sm",children:i.jsxs("div",{className:"glass-panel w-full max-w-md rounded-2xl border border-slate-800 p-6 shadow-2xl relative animate-in fade-in zoom-in-95 duration-200",children:[i.jsx("button",{onClick:t,className:"absolute top-4 right-4 p-2 text-slate-400 hover:text-white rounded-lg transition",children:i.jsx(Gg,{className:"w-5 h-5"})}),i.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-blue-500/10 text-blue-400 border border-blue-500/20 flex items-center justify-center",children:i.jsx(xf,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-bold text-lg text-white",children:"Als Gast eintragen"}),i.jsxs("p",{className:"text-xs text-slate-400",children:["Schicht: ",e==null?void 0:e.title," (",e==null?void 0:e.start_time," - ",e==null?void 0:e.end_time,")"]})]})]}),g&&i.jsxs("div",{className:"mb-4 p-3 rounded-xl bg-red-500/10 border border-red-500/20 text-red-400 text-xs flex items-center gap-2",children:[i.jsx(Cl,{className:"w-4 h-4 shrink-0"}),i.jsx("span",{children:g})]}),i.jsxs("form",{onSubmit:v,className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Dein Name / Anzeigename"}),i.jsx("input",{type:"text",required:!0,value:r,onChange:h=>s(h.target.value),placeholder:"z. B. Alex Muster",className:"w-full px-3.5 py-2.5 rounded-xl bg-slate-900 border border-slate-800 text-white text-sm focus:outline-none focus:border-blue-500 transition"}),i.jsx("p",{className:"text-[11px] text-slate-500 mt-1",children:"Dein Name bleibt in deiner aktuellen Sitzung gespeichert. Falls du später ein Konto mit diesem Namen erstellst, werden deine Gast-Schichten automatisch übernommen!"})]}),l?i.jsxs("div",{className:"p-3.5 rounded-xl bg-emerald-500/10 border border-emerald-500/20 text-emerald-400 text-xs flex items-center justify-between font-mono",children:[i.jsxs("span",{className:"flex items-center gap-2 font-semibold",children:[i.jsx(Ln,{className:"w-4 h-4 text-emerald-400 shrink-0"})," ALTCHA Spamschutz verifiziert"]}),i.jsx("span",{className:"text-[10px] text-emerald-400/80",children:"[ In dieser Sitzung aktiv ]"})]}):i.jsxs("div",{className:"p-4 rounded-xl bg-slate-900/90 border border-slate-800 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"text-xs font-semibold text-slate-300 flex items-center gap-1.5 font-mono",children:[i.jsx(hy,{className:"w-4 h-4 text-emerald-400"})," Security Check (ALTCHA)"]}),i.jsx("a",{href:"https://altcha.org/",target:"_blank",rel:"noreferrer",className:"text-[10px] text-blue-400 hover:underline font-mono",children:"ALTCHA.org"})]}),i.jsxs("div",{className:"border border-slate-700 rounded-lg p-3 bg-slate-950/80 flex flex-col items-center justify-center min-h-[90px] gap-2",children:[i.jsx("altcha-widget",{ref:N,challengeurl:"/api/events/altcha-chal
Line truncated
|
||||
Offene Angebote, DIY-Kultur & engagierte Schichten.`})]}),R&&i.jsxs("div",{className:"hallmark-panel rounded-sm p-4 border border-grid space-y-3",children:[i.jsx("h4",{className:"font-serif text-sm font-bold uppercase tracking-wide text-main border-b border-grid pb-2",children:(o==null?void 0:o.support_box_title)||"❤️ Unterstützen"}),i.jsx("p",{className:"text-[11px] text-muted whitespace-pre-line",children:(o==null?void 0:o.support_box_text)||"Hilf mit als Helfer*in an der Bar, beim Essen kochen oder beim Auf- & Abbau."})]})]})]})]})}function Kb({events:e,onSelectEvent:t,branding:n}){const[r,s]=A.useState(new Date),[l,a]=A.useState(null),o=r.getFullYear(),u=r.getMonth(),c=["JANUAR","FEBRUAR","MÄRZ","APRIL","MAI","JUNI","JULI","AUGUST","SEPTEMBER","OKTOBER","NOVEMBER","DEZEMBER"],f=()=>s(new Date(o,u-1,1)),g=()=>s(new Date(o,u+1,1)),d=()=>s(new Date),w=new Date(o,u,1).getDay(),y=w===0?6:w-1,N=new Date(o,u+1,0).getDate(),R=m=>{const _=String(u+1).padStart(2,"0"),C=String(m).padStart(2,"0");return`${o}-${_}-${C}`},v=m=>{const _=R(m);return e.filter(C=>_>=C.start_date&&_<=C.end_date)},h=(n==null?void 0:n.primary_color)||"var(--brand-primary)";return i.jsxs("div",{className:"space-y-6 max-w-5xl mx-auto animate-in fade-in duration-200",children:[i.jsxs("div",{className:"hallmark-panel rounded-sm p-6 sm:p-8 border border-grid flex flex-col sm:flex-row sm:items-center justify-between gap-4 font-mono",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-sm bg-subtle text-main border border-grid flex items-center justify-center font-bold",children:i.jsx(ra,{className:"w-4 h-4 text-amber-500"})}),i.jsxs("div",{children:[i.jsxs("h2",{className:"font-serif text-3xl sm:text-4xl font-bold uppercase tracking-tight text-main leading-none",children:[c[u]," ",o]}),i.jsx("p",{className:"text-[10px] text-muted uppercase tracking-widest mt-1",children:"— INITIATIVE E.V. TERMIN- & SCHICHTÜBERSICHT —"})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{onClick:d,className:"px-3.5 py-1.5 rounded-sm text-xs font-mono font-bold bg-surface hover:bg-surface-hover text-main border border-grid transition",children:"[ HEUTE ]"}),i.jsx("button",{onClick:f,className:"p-1.5 rounded-sm text-muted hover:text-main bg-surface border border-grid transition",title:"Vorheriger Monat",children:i.jsx(ty,{className:"w-4 h-4"})}),i.jsx("button",{onClick:g,className:"p-1.5 rounded-sm text-muted hover:text-main bg-surface border border-grid transition",title:"Nächster Monat",children:i.jsx(ny,{className:"w-4 h-4"})})]})]}),i.jsxs("div",{className:"hallmark-panel rounded-sm border border-grid overflow-hidden",children:[i.jsxs("div",{className:"grid grid-cols-7 bg-subtle border-b border-grid text-center text-xs font-mono text-muted font-bold py-3 uppercase",children:[i.jsx("div",{children:"MO"}),i.jsx("div",{children:"DI"}),i.jsx("div",{children:"MI"}),i.jsx("div",{children:"DO"}),i.jsx("div",{children:"FR"}),i.jsx("div",{children:"SA"}),i.jsx("div",{children:"SO"})]}),i.jsxs("div",{className:"grid grid-cols-7 auto-rows-fr divide-x divide-y divide-grid bg-surface text-xs font-mono",children:[Array.from({length:y}).map((m,_)=>i.jsx("div",{className:"min-h-[100px] sm:min-h-[110px] p-2 bg-subtle/50 text-muted opacity-30"},`offset-${_}`)),Array.from({length:N}).map((m,_)=>{const C=_+1,E=v(C),j=new Date().getFullYear()===o&&new Date().getMonth()===u&&new Date().getDate()===C;return i.jsxs("div",{className:`min-h-[100px] sm:min-h-[110px] p-2 flex flex-col justify-between transition ${j?"bg-surface-hover/80 font-bold":"hover:bg-surface-hover/50"}`,children:[i.jsxs("div",{className:"flex items-center justify-between mb-1",children:[i.jsx("span",{className:`w-5 h-5 rounded-sm flex items-center justify-center font-mono text-xs ${j?"bg-main text-paper font-bold shadow-sm":"text-muted"}`,children:C}),E.length>0&&i.jsxs("span",{className:"text-[9px] font-mono text-muted",children:[E.length," ",E.length===1?"Event":"Events"]})]}),i.jsx("div",{className:"space-y-1.5 overflow-y-auto max-h-[70px] no-scrollbar",children:E.map(P=>{const G=(l==null?void 0:l.id)===P.id;return i.jsx("button",{onClick:()=>a(P),style:{backgroundColor:G?h:`${h}15`,borderColor:`${h}40`,color:G?"#ffffff":h},className:`w-full text-left px-2 py-1 rounded-sm text-[10px] font-mono font-bold border truncate block hover:brightness-110 transition shadow-sm ${P.is_active===!1?"opacity-50 line-through":""}`,children:P.title},`evt-${P.id}`)})})]},`day-${C}`)})]})]}),l&&i.jsxs("div",{className:"hallmark-panel rounded-sm p-6 border border-grid flex flex-col sm:flex-row sm:items-center justify-between gap-4 font-mono animate-in fade-in duration-200",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted",children:[i.jsxs("span",{className:"flex items-center gap-1 bg-subtle px-2 py-0.5 rounded-sm border border-grid font-bold text-ma
Line truncated
|
||||
Offene Angebote, DIY-Kultur & engagierte Schichten.`),[rt,Ds]=A.useState((e==null?void 0:e.show_support_box)??!0),[zs,z]=A.useState((e==null?void 0:e.support_box_title)||"❤️ Unterstützen"),[q,Ee]=A.useState((e==null?void 0:e.support_box_text)||"Hilf mit als Helfer*in an der Bar, beim Essen kochen oder beim Auf- & Abbau."),[en,xe]=A.useState(!1),[In,fa]=A.useState(!1),[ls,ha]=A.useState("smtp.beispiel.de"),[pa,ma]=A.useState(587),[ga,va]=A.useState(""),[Dl,zl]=A.useState(""),[Il,Ol]=A.useState(!0),[xa,Ul]=A.useState(!1),[ya,wa]=A.useState("noreply@schichtplaner.de"),[Fl,wu]=A.useState(""),[jr,bu]=A.useState(!1),[Vl,Bl]=A.useState(!1),[Er,ba]=A.useState(!1);A.useEffect(()=>{ka()},[]);const ka=async()=>{u(!0);try{try{const k=await J("/users/manage-users/");y(k.results||k)}catch{}try{const k=await J("/users/pending/");h(k.results||k)}catch{}try{const k=await J("/users/restriction-setting/");_(k.is_restriction_enabled),E(k.require_admin_approval),P(k.require_email_verification??!0)}catch{}try{const k=await J("/users/domain-rules/");L(k.results||k)}catch{}try{const k=await J("/events/");ke(k.results||k)}catch{}try{const k=await J("/templates/");Te(k.results||k)}catch{}try{const k=await J("/users/smtp-setting/");k&&(fa(k.is_active??!1),ha(k.host||""),ma(k.port||587),va(k.username||""),zl(k.password||""),Ol(k.use_tls??!0),Ul(k.use_ssl??!1),wa(k.from_email||""))}catch{}}catch(k){f(k.message||"Laden der Admin-Daten fehlgeschlagen.")}finally{u(!1)}},st=k=>{d(k),setTimeout(()=>d(""),4e3)},Ce=async k=>{try{const Z=await J(`/users/manage-users/${k.id}/`,{method:"PATCH",body:JSON.stringify({is_admin_user:!k.is_admin_user})});y(w.map(nn=>nn.id===k.id?Z:nn)),st(`Admin-Rechte für ${k.username} aktualisiert.`)}catch(Z){f(Z.message||"Fehler beim Aktualisieren.")}},Pt=async k=>{try{const Z=await J(`/users/manage-users/${k.id}/`,{method:"PATCH",body:JSON.stringify({is_approved:!k.is_approved})});y(w.map(nn=>nn.id===k.id?Z:nn)),st(`Freischalt-Status für ${k.username} aktualisiert.`)}catch(Z){f(Z.message||"Fehler beim Aktualisieren.")}},Lt=async k=>{if(window.confirm(`Möchtest du das Benutzerkonto "${k.display_name||k.username}" (@${k.username}) wirklich dauerhaft löschen?`))try{await J(`/users/manage-users/${k.id}/`,{method:"DELETE"}),y(w.filter(Z=>Z.id!==k.id)),st(`Benutzerkonto ${k.username} wurde gelöscht.`)}catch(Z){f(Z.message||"Fehler beim Löschen des Benutzers.")}},Hl=async k=>{try{await J(`/users/${k}/approve/`,{method:"POST"}),h(v.filter(Z=>Z.id!==k)),ka(),st("Benutzer erfolgreich freigeschaltet.")}catch(Z){f(Z.message||"Freischalten fehlgeschlagen.")}},Is=async k=>{try{await J(`/users/${k}/approve/`,{method:"DELETE"}),h(v.filter(Z=>Z.id!==k)),st("Benutzer abgelehnt und gelöscht.")}catch(Z){f(Z.message||"Ablehnen fehlgeschlagen.")}},On=async(k,Z)=>{try{const Wl=await J("/users/restriction-setting/",{method:"POST",body:JSON.stringify({is_restriction_enabled:k==="restriction"?Z:m,require_admin_approval:k==="approval"?Z:C,require_email_verification:k==="email_verify"?Z:j})});_(Wl.is_restriction_enabled),E(Wl.require_admin_approval),P(Wl.require_email_verification),st("Sicherheitseinstellungen aktualisiert.")}catch(nn){f(nn.message||"Aktualisierung fehlgeschlagen.")}},ku=async k=>{if(k.preventDefault(),!!Y.trim())try{const Z=await J("/users/domain-rules/",{method:"POST",body:JSON.stringify({domain:Y})});L([...G,Z]),ae(""),st(`Domain-Regel "${Z.domain}" hinzugefügt.`)}catch(Z){f(Z.message||"Fehler beim Hinzufügen.")}},_a=async k=>{try{await J(`/users/domain-rules/${k}/`,{method:"DELETE"}),L(G.filter(Z=>Z.id!==k)),st("Domain-Regel entfernt.")}catch(Z){f(Z.message||"Fehler beim Löschen.")}},Sa=async k=>{if(k.preventDefault(),!!V.trim())try{await J("/skills/",{method:"POST",body:JSON.stringify({name:V,description:U,color:$})}),M(""),x(""),I(_p()),s(),st("Qualifikation angelegt.")}catch(Z){f(Z.message||"Fehler beim Anlegen.")}},_u=async k=>{try{await J(`/skills/${k}/`,{method:"DELETE"}),s(),st("Qualifikation gelöscht.")}catch(Z){f(Z.message||"Fehler beim Löschen.")}},tn=async k=>{try{await J(`/templates/${k}/`,{method:"DELETE"}),Te(ue.filter(Z=>Z.id!==k)),st("Vorlage gelöscht.")}catch(Z){f(Z.message||"Fehler beim Löschen.")}},Na=async k=>{k.preventDefault(),xe(!0);try{await J("/branding/",{method:"POST",body:JSON.stringify({app_name:K,logo_url:ee,primary_color:gt,custom_banner_text:F,show_community_info_box:_t,community_info_title:zn,community_info_text:Nr,show_support_box:rt,support_box_title:zs,support_box_text:q})}),t(),st("Branding-Einstellungen erfolgreich gespeichert!")}catch(Z){f(Z.message||"Speichern des Brandings fehlgeschlagen.")}finally{xe(!1)}},Su=async k=>{k.preventDefault(),Bl(!0);try{await J("/users/smtp-setting/",{method:"POST",body:JSON.stringify({is_active:In,host:ls,port:parseInt(pa)||587,username:ga,password:Dl,use_tls:Il,use_ssl:xa,from_email:ya})}),st("✅ SMTP-Einstellungen erfolgreich gespeichert!")}catch(Z){f(Z.message||"Speichern der SMTP-Einstellungen fehlgeschlagen.")}finally{Bl(!1)
Line truncated
|
||||
}`;Eb(Ub);$altcha.algorithms.set("SHA-256",()=>new If);$altcha.algorithms.set("SHA-384",()=>new If);$altcha.algorithms.set("SHA-512",()=>new If);$altcha.algorithms.set("PBKDF2/SHA-256",()=>new zf);$altcha.algorithms.set("PBKDF2/SHA-384",()=>new zf);$altcha.algorithms.set("PBKDF2/SHA-512",()=>new zf);function Fb({shift:e,onClose:t,onSubmit:n}){const[r,s]=A.useState(""),[l,a]=A.useState(()=>sessionStorage.getItem("guest_captcha_verified")==="true"),[o,u]=A.useState(()=>sessionStorage.getItem("guest_captcha_verified")==="true"?"altcha-session-verified":""),[c,f]=A.useState(()=>sessionStorage.getItem("guest_captcha_verified")==="true"),[g,d]=A.useState(""),[w,y]=A.useState(!1),N=A.useRef(null);A.useEffect(()=>{const h=localStorage.getItem("guest_display_name")||"";h&&s(h)},[]),A.useEffect(()=>{if(l)return;const h=N.current;if(!h)return;const m=_=>{var j,L,G;const C=(j=_==null?void 0:_.detail)==null?void 0:j.state,E=(L=_==null?void 0:_.detail)==null?void 0:L.payload;(C==="verified"||(G=_==null?void 0:_.detail)!=null&&G.verified)&&(sessionStorage.setItem("guest_captcha_verified","true"),a(!0),f(!0),u(E||"altcha-verified-"+Math.random().toString(36).substring(2,10)))};return h.addEventListener("statechange",m),h.addEventListener("verified",m),()=>{h.removeEventListener("statechange",m),h.removeEventListener("verified",m)}},[l]);const R=()=>{sessionStorage.setItem("guest_captcha_verified","true"),a(!0),f(!0),u("altcha-verified-"+Math.random().toString(36).substring(2,10))},v=async h=>{if(h.preventDefault(),d(""),!r.trim()){d("Bitte gib deinen Namen ein.");return}if(!(l||c)){d("Bitte schließe zuerst den ALTCHA Security Check ab.");return}const _=o||"altcha-session-verified";localStorage.setItem("guest_display_name",r.trim()),window.dispatchEvent(new Event("guest_name_updated")),y(!0);try{await n({guest_name:r.trim(),captcha_token:_}),t()}catch(C){d(C.message||"Eintragen fehlgeschlagen.")}finally{y(!1)}};return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/80 backdrop-blur-sm",children:i.jsxs("div",{className:"glass-panel w-full max-w-md rounded-2xl border border-slate-800 p-6 shadow-2xl relative animate-in fade-in zoom-in-95 duration-200",children:[i.jsx("button",{onClick:t,className:"absolute top-4 right-4 p-2 text-slate-400 hover:text-white rounded-lg transition",children:i.jsx(Gg,{className:"w-5 h-5"})}),i.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-blue-500/10 text-blue-400 border border-blue-500/20 flex items-center justify-center",children:i.jsx(xf,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-bold text-lg text-white",children:"Als Gast eintragen"}),i.jsxs("p",{className:"text-xs text-slate-400",children:["Schicht: ",e==null?void 0:e.title," (",e==null?void 0:e.start_time," - ",e==null?void 0:e.end_time,")"]})]})]}),g&&i.jsxs("div",{className:"mb-4 p-3 rounded-xl bg-red-500/10 border border-red-500/20 text-red-400 text-xs flex items-center gap-2",children:[i.jsx(Cl,{className:"w-4 h-4 shrink-0"}),i.jsx("span",{children:g})]}),i.jsxs("form",{onSubmit:v,className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Dein Name / Anzeigename"}),i.jsx("input",{type:"text",required:!0,value:r,onChange:h=>s(h.target.value),placeholder:"z. B. Alex Muster",className:"w-full px-3.5 py-2.5 rounded-xl bg-slate-900 border border-slate-800 text-white text-sm focus:outline-none focus:border-blue-500 transition"}),i.jsx("p",{className:"text-[11px] text-slate-500 mt-1",children:"Dein Name bleibt in deiner aktuellen Sitzung gespeichert. Falls du später ein Konto mit diesem Namen erstellst, werden deine Gast-Schichten automatisch übernommen!"})]}),l?i.jsxs("div",{className:"p-3.5 rounded-xl bg-emerald-500/10 border border-emerald-500/20 text-emerald-400 text-xs flex items-center justify-between font-mono",children:[i.jsxs("span",{className:"flex items-center gap-2 font-semibold",children:[i.jsx(Ln,{className:"w-4 h-4 text-emerald-400 shrink-0"})," ALTCHA Spamschutz verifiziert"]}),i.jsx("span",{className:"text-[10px] text-emerald-400/80",children:"[ In dieser Sitzung aktiv ]"})]}):i.jsxs("div",{className:"p-4 rounded-xl bg-slate-900/90 border border-slate-800 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"text-xs font-semibold text-slate-300 flex items-center gap-1.5 font-mono",children:[i.jsx(hy,{className:"w-4 h-4 text-emerald-400"})," Security Check (ALTCHA)"]}),i.jsx("a",{href:"https://altcha.org/",target:"_blank",rel:"noreferrer",className:"text-[10px] text-blue-400 hover:underline font-mono",children:"ALTCHA.org"})]}),i.jsxs("div",{className:"border border-slate-700 rounded-lg p-3 bg-slate-950/80 flex flex-col items-center justify-center min-h-[90px] gap-2",children:[i.jsx("altcha-widget",{ref:N,challengeurl:"/api/altcha-challenge/"
Line truncated
|
||||
Offene Angebote, DIY-Kultur & engagierte Schichten.`})]}),R&&i.jsxs("div",{className:"hallmark-panel rounded-sm p-4 border border-grid space-y-3",children:[i.jsx("h4",{className:"font-serif text-sm font-bold uppercase tracking-wide text-main border-b border-grid pb-2",children:(o==null?void 0:o.support_box_title)||"❤️ Unterstützen"}),i.jsx("p",{className:"text-[11px] text-muted whitespace-pre-line",children:(o==null?void 0:o.support_box_text)||"Hilf mit als Helfer*in an der Bar, beim Essen kochen oder beim Auf- & Abbau."})]})]})]})]})}function Kb({events:e,onSelectEvent:t,branding:n}){const[r,s]=A.useState(new Date),[l,a]=A.useState(null),o=r.getFullYear(),u=r.getMonth(),c=["JANUAR","FEBRUAR","MÄRZ","APRIL","MAI","JUNI","JULI","AUGUST","SEPTEMBER","OKTOBER","NOVEMBER","DEZEMBER"],f=()=>s(new Date(o,u-1,1)),g=()=>s(new Date(o,u+1,1)),d=()=>s(new Date),w=new Date(o,u,1).getDay(),y=w===0?6:w-1,N=new Date(o,u+1,0).getDate(),R=m=>{const _=String(u+1).padStart(2,"0"),C=String(m).padStart(2,"0");return`${o}-${_}-${C}`},v=m=>{const _=R(m);return e.filter(C=>_>=C.start_date&&_<=C.end_date)},h=(n==null?void 0:n.primary_color)||"var(--brand-primary)";return i.jsxs("div",{className:"space-y-6 max-w-5xl mx-auto animate-in fade-in duration-200",children:[i.jsxs("div",{className:"hallmark-panel rounded-sm p-6 sm:p-8 border border-grid flex flex-col sm:flex-row sm:items-center justify-between gap-4 font-mono",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-sm bg-subtle text-main border border-grid flex items-center justify-center font-bold",children:i.jsx(ra,{className:"w-4 h-4 text-amber-500"})}),i.jsxs("div",{children:[i.jsxs("h2",{className:"font-serif text-3xl sm:text-4xl font-bold uppercase tracking-tight text-main leading-none",children:[c[u]," ",o]}),i.jsx("p",{className:"text-[10px] text-muted uppercase tracking-widest mt-1",children:"— INITIATIVE E.V. TERMIN- & SCHICHTÜBERSICHT —"})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{onClick:d,className:"px-3.5 py-1.5 rounded-sm text-xs font-mono font-bold bg-surface hover:bg-surface-hover text-main border border-grid transition",children:"[ HEUTE ]"}),i.jsx("button",{onClick:f,className:"p-1.5 rounded-sm text-muted hover:text-main bg-surface border border-grid transition",title:"Vorheriger Monat",children:i.jsx(ty,{className:"w-4 h-4"})}),i.jsx("button",{onClick:g,className:"p-1.5 rounded-sm text-muted hover:text-main bg-surface border border-grid transition",title:"Nächster Monat",children:i.jsx(ny,{className:"w-4 h-4"})})]})]}),i.jsxs("div",{className:"hallmark-panel rounded-sm border border-grid overflow-hidden",children:[i.jsxs("div",{className:"grid grid-cols-7 bg-subtle border-b border-grid text-center text-xs font-mono text-muted font-bold py-3 uppercase",children:[i.jsx("div",{children:"MO"}),i.jsx("div",{children:"DI"}),i.jsx("div",{children:"MI"}),i.jsx("div",{children:"DO"}),i.jsx("div",{children:"FR"}),i.jsx("div",{children:"SA"}),i.jsx("div",{children:"SO"})]}),i.jsxs("div",{className:"grid grid-cols-7 auto-rows-fr divide-x divide-y divide-grid bg-surface text-xs font-mono",children:[Array.from({length:y}).map((m,_)=>i.jsx("div",{className:"min-h-[100px] sm:min-h-[110px] p-2 bg-subtle/50 text-muted opacity-30"},`offset-${_}`)),Array.from({length:N}).map((m,_)=>{const C=_+1,E=v(C),j=new Date().getFullYear()===o&&new Date().getMonth()===u&&new Date().getDate()===C;return i.jsxs("div",{className:`min-h-[100px] sm:min-h-[110px] p-2 flex flex-col justify-between transition ${j?"bg-surface-hover/80 font-bold":"hover:bg-surface-hover/50"}`,children:[i.jsxs("div",{className:"flex items-center justify-between mb-1",children:[i.jsx("span",{className:`w-5 h-5 rounded-sm flex items-center justify-center font-mono text-xs ${j?"bg-main text-paper font-bold shadow-sm":"text-muted"}`,children:C}),E.length>0&&i.jsxs("span",{className:"text-[9px] font-mono text-muted",children:[E.length," ",E.length===1?"Event":"Events"]})]}),i.jsx("div",{className:"space-y-1.5 overflow-y-auto max-h-[70px] no-scrollbar",children:E.map(L=>{const G=(l==null?void 0:l.id)===L.id;return i.jsx("button",{onClick:()=>a(L),style:{backgroundColor:G?h:`${h}15`,borderColor:`${h}40`,color:G?"#ffffff":h},className:`w-full text-left px-2 py-1 rounded-sm text-[10px] font-mono font-bold border truncate block hover:brightness-110 transition shadow-sm ${L.is_active===!1?"opacity-50 line-through":""}`,children:L.title},`evt-${L.id}`)})})]},`day-${C}`)})]})]}),l&&i.jsxs("div",{className:"hallmark-panel rounded-sm p-6 border border-grid flex flex-col sm:flex-row sm:items-center justify-between gap-4 font-mono animate-in fade-in duration-200",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted",children:[i.jsxs("span",{className:"flex items-center gap-1 bg-subtle px-2 py-0.5 rounded-sm border border-grid font-bold text-ma
Line truncated
|
||||
Offene Angebote, DIY-Kultur & engagierte Schichten.`),[rt,Ds]=A.useState((e==null?void 0:e.show_support_box)??!0),[zs,z]=A.useState((e==null?void 0:e.support_box_title)||"❤️ Unterstützen"),[q,Ee]=A.useState((e==null?void 0:e.support_box_text)||"Hilf mit als Helfer*in an der Bar, beim Essen kochen oder beim Auf- & Abbau."),[en,xe]=A.useState(!1),[In,fa]=A.useState(!1),[ls,ha]=A.useState("smtp.beispiel.de"),[pa,ma]=A.useState(587),[ga,va]=A.useState(""),[Dl,zl]=A.useState(""),[Il,Ol]=A.useState(!0),[xa,Ul]=A.useState(!1),[ya,wa]=A.useState("noreply@schichtplaner.de"),[Fl,wu]=A.useState(""),[jr,bu]=A.useState(!1),[Vl,Bl]=A.useState(!1),[Er,ba]=A.useState(!1);A.useEffect(()=>{ka()},[]);const ka=async()=>{u(!0);try{try{const k=await J("/users/manage-users/");y(k.results||k)}catch{}try{const k=await J("/users/pending/");h(k.results||k)}catch{}try{const k=await J("/users/restriction-setting/");_(k.is_restriction_enabled),E(k.require_admin_approval),L(k.require_email_verification??!0)}catch{}try{const k=await J("/users/domain-rules/");P(k.results||k)}catch{}try{const k=await J("/events/");ke(k.results||k)}catch{}try{const k=await J("/templates/");Te(k.results||k)}catch{}try{const k=await J("/users/smtp-setting/");k&&(fa(k.is_active??!1),ha(k.host||""),ma(k.port||587),va(k.username||""),zl(k.password||""),Ol(k.use_tls??!0),Ul(k.use_ssl??!1),wa(k.from_email||""))}catch{}}catch(k){f(k.message||"Laden der Admin-Daten fehlgeschlagen.")}finally{u(!1)}},st=k=>{d(k),setTimeout(()=>d(""),4e3)},Ce=async k=>{try{const Z=await J(`/users/manage-users/${k.id}/`,{method:"PATCH",body:JSON.stringify({is_admin_user:!k.is_admin_user})});y(w.map(nn=>nn.id===k.id?Z:nn)),st(`Admin-Rechte für ${k.username} aktualisiert.`)}catch(Z){f(Z.message||"Fehler beim Aktualisieren.")}},Pt=async k=>{try{const Z=await J(`/users/manage-users/${k.id}/`,{method:"PATCH",body:JSON.stringify({is_approved:!k.is_approved})});y(w.map(nn=>nn.id===k.id?Z:nn)),st(`Freischalt-Status für ${k.username} aktualisiert.`)}catch(Z){f(Z.message||"Fehler beim Aktualisieren.")}},Lt=async k=>{if(window.confirm(`Möchtest du das Benutzerkonto "${k.display_name||k.username}" (@${k.username}) wirklich dauerhaft löschen?`))try{await J(`/users/manage-users/${k.id}/`,{method:"DELETE"}),y(w.filter(Z=>Z.id!==k.id)),st(`Benutzerkonto ${k.username} wurde gelöscht.`)}catch(Z){f(Z.message||"Fehler beim Löschen des Benutzers.")}},Hl=async k=>{try{await J(`/users/${k}/approve/`,{method:"POST"}),h(v.filter(Z=>Z.id!==k)),ka(),st("Benutzer erfolgreich freigeschaltet.")}catch(Z){f(Z.message||"Freischalten fehlgeschlagen.")}},Is=async k=>{try{await J(`/users/${k}/approve/`,{method:"DELETE"}),h(v.filter(Z=>Z.id!==k)),st("Benutzer abgelehnt und gelöscht.")}catch(Z){f(Z.message||"Ablehnen fehlgeschlagen.")}},On=async(k,Z)=>{try{const Wl=await J("/users/restriction-setting/",{method:"POST",body:JSON.stringify({is_restriction_enabled:k==="restriction"?Z:m,require_admin_approval:k==="approval"?Z:C,require_email_verification:k==="email_verify"?Z:j})});_(Wl.is_restriction_enabled),E(Wl.require_admin_approval),L(Wl.require_email_verification),st("Sicherheitseinstellungen aktualisiert.")}catch(nn){f(nn.message||"Aktualisierung fehlgeschlagen.")}},ku=async k=>{if(k.preventDefault(),!!Y.trim())try{const Z=await J("/users/domain-rules/",{method:"POST",body:JSON.stringify({domain:Y})});P([...G,Z]),ae(""),st(`Domain-Regel "${Z.domain}" hinzugefügt.`)}catch(Z){f(Z.message||"Fehler beim Hinzufügen.")}},_a=async k=>{try{await J(`/users/domain-rules/${k}/`,{method:"DELETE"}),P(G.filter(Z=>Z.id!==k)),st("Domain-Regel entfernt.")}catch(Z){f(Z.message||"Fehler beim Löschen.")}},Sa=async k=>{if(k.preventDefault(),!!V.trim())try{await J("/skills/",{method:"POST",body:JSON.stringify({name:V,description:U,color:$})}),M(""),x(""),I(_p()),s(),st("Qualifikation angelegt.")}catch(Z){f(Z.message||"Fehler beim Anlegen.")}},_u=async k=>{try{await J(`/skills/${k}/`,{method:"DELETE"}),s(),st("Qualifikation gelöscht.")}catch(Z){f(Z.message||"Fehler beim Löschen.")}},tn=async k=>{try{await J(`/templates/${k}/`,{method:"DELETE"}),Te(ue.filter(Z=>Z.id!==k)),st("Vorlage gelöscht.")}catch(Z){f(Z.message||"Fehler beim Löschen.")}},Na=async k=>{k.preventDefault(),xe(!0);try{await J("/branding/",{method:"POST",body:JSON.stringify({app_name:K,logo_url:ee,primary_color:gt,custom_banner_text:F,show_community_info_box:_t,community_info_title:zn,community_info_text:Nr,show_support_box:rt,support_box_title:zs,support_box_text:q})}),t(),st("Branding-Einstellungen erfolgreich gespeichert!")}catch(Z){f(Z.message||"Speichern des Brandings fehlgeschlagen.")}finally{xe(!1)}},Su=async k=>{k.preventDefault(),Bl(!0);try{await J("/users/smtp-setting/",{method:"POST",body:JSON.stringify({is_active:In,host:ls,port:parseInt(pa)||587,username:ga,password:Dl,use_tls:Il,use_ssl:xa,from_email:ya})}),st("✅ SMTP-Einstellungen erfolgreich gespeichert!")}catch(Z){f(Z.message||"Speichern der SMTP-Einstellungen fehlgeschlagen.")}finally{Bl(!1)
Line truncated
|
||||
Vendored
+1
-1
@@ -11,7 +11,7 @@
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
||||
<title>Schichtplaner — Veranstaltungsschichtpläne</title>
|
||||
<script type="module" crossorigin src="/assets/index-BzMPGQ3H.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-5XQR3AzF.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-fTGRNVay.css">
|
||||
</head>
|
||||
<body class="bg-paper text-main font-sans antialiased min-h-screen">
|
||||
|
||||
@@ -164,7 +164,7 @@ export default function GuestSignupModal({ shift, onClose, onSubmit }) {
|
||||
<div className="border border-slate-700 rounded-lg p-3 bg-slate-950/80 flex flex-col items-center justify-center min-h-[90px] gap-2">
|
||||
<altcha-widget
|
||||
ref={captchaRef}
|
||||
challengeurl="/api/events/altcha-challenge/"
|
||||
challengeurl="/api/altcha-challenge/"
|
||||
auto="onload"
|
||||
hidefooter="true"
|
||||
style={{ width: '100%' }}
|
||||
|
||||
@@ -211,7 +211,7 @@ export default function ShiftMatrixTable({
|
||||
{/* Attendees List */}
|
||||
<div className="mt-2 space-y-1 font-sans">
|
||||
{shift.signups.map((su) => {
|
||||
const isOwnGuest = isGuest && su.is_guest && guestDisplayName && su.display_name?.trim().toLowerCase() === guestDisplayName.trim().toLowerCase();
|
||||
const isOwnGuest = isGuest && su.is_guest && (su.is_self || (guestDisplayName && su.display_name?.trim().toLowerCase() === guestDisplayName.trim().toLowerCase()));
|
||||
return (
|
||||
<div key={su.id} className={`text-[11px] text-muted flex items-center justify-between gap-2 p-1.5 rounded-sm border ${isOwnGuest ? 'bg-amber-500/10 border-amber-500/30' : 'bg-subtle border-grid'}`}>
|
||||
<div className="flex items-center gap-1.5 truncate">
|
||||
|
||||
Reference in new issue
Block a user