Post delete, Profile edit

This commit is contained in:
Kilian committed 2024-07-27 00:54:23 +02:00
1 parent a515c447e0
commit 581cacb636
33 files changed
+533 -238

No files matched your search

+1 -1
View File
@@ -481,7 +481,7 @@ paths:
value: value:
{ {
"code": "FailedUpdate", "code": "FailedUpdate",
"fields": ["username", "email", "password"], "fields": ["username", "password", "image"],
} }
tags: tags:
- User - User
+1 -1
View File
@@ -506,7 +506,7 @@ data-styled.g137[id="sc-kvXgyf"]{content:"fBvPoH,"}/*!sc*/
" class="sc-euGpHm sc-exayXG fwfkcU kqJXdD sc-dHrNzZ dRdjww"><p>User not found.</p> " class="sc-euGpHm sc-exayXG fwfkcU kqJXdD sc-dHrNzZ dRdjww"><p>User not found.</p>
</div></button></div></div></div><div class="sc-iKTcqh sc-gnpbhQ fTxZsC drGLlX"><div class="sc-dKsqdn dCbPd"><button class="sc-iAlELC gsBSOU"><span type="delete" class="sc-oeqTF ByFMv http-verb delete">delete</span><span class="sc-eowDPD jcAXWA">/users/{id}</span><svg class="sc-cBYhjr iMxoRf" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-ezTrPE bFiOkX"><div class="sc-drnuxz hdRKqQ"><div html="" class="sc-euGpHm sc-exayXG fwfkcU jYGAQp"></div><div tabindex="0" role="button"><div class="sc-hDcvty jpmGrk"><span>https://khofmann.userpage.fu-berlin.de/phpCourse/exam/api</span>/users/{id}</div></div></div></div></div><div><h3 class="sc-kkmypM jKNCPF"> <!-- -->Response samples<!-- --> </h3><div class="sc-bSlUec jxQggo" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="tab:R176aa:0" aria-selected="true" aria-disabled="false" aria-controls="panel:R176aa:0" tabindex="0" data-rttab="true">200</li><li class="tab-error" role="tab" id="tab:R176aa:1" aria-selected="false" aria-disabled="false" aria-controls="panel:R176aa:1" data-rttab="true">404</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="panel:R176aa:0" aria-labelledby="tab:R176aa:0"><div><div class="sc-WChnI iLXIA-d"><span class="sc-foMnoT dmNpjh">Content type</span><div class="sc-ZubPq KmnOC">application/json</div></div><div class="sc-AmOMz gDrQpr"><div class="sc-eTdEpr dgzSkD"><div class="sc-pFPEP bMXXJy"><button><div class="sc-eHujzY ecCAmX">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-euGpHm fwfkcU sc-fTgapq bDqsIm"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"id"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"username"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"status"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"email"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"image"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"isAdmin"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"memberSince"</span>: <button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"date"</span>: <span class="token string">&quot;2019-08-24T14:15:22Z&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"timezone_type"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"timezone"</span>: <span class="token string">&quot;string&quot;</span></div></li></ul><span class="token punctuation">}</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"postCount"</span>: <span class="token number">0</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div><div class="react-tabs__tab-panel" role="tabpanel" id="panel:R176aa:1" aria-labelledby="tab:R176aa:1"></div></div></div></div></div></div></div><div class="sc-epzHnm bWkBKa"></div></div></div> </div></button></div></div></div><div class="sc-iKTcqh sc-gnpbhQ fTxZsC drGLlX"><div class="sc-dKsqdn dCbPd"><button class="sc-iAlELC gsBSOU"><span type="delete" class="sc-oeqTF ByFMv http-verb delete">delete</span><span class="sc-eowDPD jcAXWA">/users/{id}</span><svg class="sc-cBYhjr iMxoRf" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-ezTrPE bFiOkX"><div class="sc-drnuxz hdRKqQ"><div html="" class="sc-euGpHm sc-exayXG fwfkcU jYGAQp"></div><div tabindex="0" role="button"><div class="sc-hDcvty jpmGrk"><span>https://khofmann.userpage.fu-berlin.de/phpCourse/exam/api</span>/users/{id}</div></div></div></div></div><div><h3 class="sc-kkmypM jKNCPF"> <!-- -->Response samples<!-- --> </h3><div class="sc-bSlUec jxQggo" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="tab:R176aa:0" aria-selected="true" aria-disabled="false" aria-controls="panel:R176aa:0" tabindex="0" data-rttab="true">200</li><li class="tab-error" role="tab" id="tab:R176aa:1" aria-selected="false" aria-disabled="false" aria-controls="panel:R176aa:1" data-rttab="true">404</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="panel:R176aa:0" aria-labelledby="tab:R176aa:0"><div><div class="sc-WChnI iLXIA-d"><span class="sc-foMnoT dmNpjh">Content type</span><div class="sc-ZubPq KmnOC">application/json</div></div><div class="sc-AmOMz gDrQpr"><div class="sc-eTdEpr dgzSkD"><div class="sc-pFPEP bMXXJy"><button><div class="sc-eHujzY ecCAmX">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-euGpHm fwfkcU sc-fTgapq bDqsIm"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"id"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"username"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"status"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"email"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"image"</span>: <span class="token string">&quot;string&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"isAdmin"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"memberSince"</span>: <button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"date"</span>: <span class="token string">&quot;2019-08-24T14:15:22Z&quot;</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"timezone_type"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"timezone"</span>: <span class="token string">&quot;string&quot;</span></div></li></ul><span class="token punctuation">}</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"postCount"</span>: <span class="token number">0</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div><div class="react-tabs__tab-panel" role="tabpanel" id="panel:R176aa:1" aria-labelledby="tab:R176aa:1"></div></div></div></div></div></div></div><div class="sc-epzHnm bWkBKa"></div></div></div>
<script> <script>
const __redoc_state = {"menu":{"activeItemIdx":-1},"spec":{"data":{"openapi":"3.0.0","info":{"title":"PHP Course Exam","version":"1.0.0","contact":{"name":"Kilian Kurt Hofmann","email":"khofmann@zedat.fu-berlin.de"},"description":"PHP Course (ABV FU Berlin) 2024 Exam"},"paths":{"/login":{"post":{"summary":"Login","description":"Log in user.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"400":{"description":"Missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissingFieldResponse"},"examples":{"Missing fields":{"value":{"code":"MissingField","fields":["email","password"]}}}}}},"401":{"description":"Invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"},"examples":{"Invalid username or password":{"value":{"code":"Unauthorized","message":"Invalid username or password"}}}}}},"404":{"description":"User not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"},"examples":{"User not found":{"value":{"code":"NotFound","entity":"user"}}}}}},"500":{"description":"Failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailedResponse"},"examples":{"Failed":{"value":{"code":"Failed","message":"Login failed"}}}}}}},"tags":["Login/Logout"]}},"/logout":{"post":{"summary":"Logout","description":"Log out user.","security":[{"BasicAuth":[]}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BooleanResponse"},"examples":{"Success":{"value":true}}}}}},"tags":["Login/Logout"]}},"/posts":{"get":{"summary":"List posts","description":"List all posts, return full user data if authenticated.","security":[{},{"BasicAuth":[]}],"parameters":[{"in":"query","name":"p","schema":{"type":"integer","minimum":0,"default":0},"description":"Current page."},{"in":"query","name":"l","schema":{"type":"integer","minimum":0,"maximum":30,"default":10},"description":"The number of items to return."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostListResponse"},"examples":{"Not authenticated":{"value":{"pages":0,"data":[{"id":0,"user":{"username":"string","image":"string"},"content":"string","postedAt":{"date":"2019-08-24T14:15:22Z","timezone_type":0,"timezone":"string"}}]}},"Authenticated":{"value":{"pages":1,"data":[{"id":1,"user":{"id":0,"username":"string","status":0,"email":"string","image":"string","isAdmin":true,"memberSince":{"date":"2019-08-24T14:15:22Z","timezone_type":0,"timezone":"string"},"postCount":0},"content":"string","postedAt":{"date":"2019-08-24T14:15:22Z","timezone_type":0,"timezone":"string"}}]}}}}}}},"tags":["Post"]},"post":{"summary":"New post","description":"Create a new post.","security":[{"BasicAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostCreateRequest"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostResponse"}}}},"400":{"description":"Missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissingFieldResponse"},"examples":{"Missing fields":{"value":{"code":"MissingField","fields":["content"]}}}}}}},"tags":["Post"]}},"/posts/{id}":{"patch":{"summary":"Update post","description":"Update post with ID. <br> Requires logged in user to have admin permissions for posts not made by them.","security":[{"BasicAuth":[]},{"BasicAuth":["isAdmin"]}],"parameters":[{"name":"id","in":"path","description":"Post ID","required":true,"schema":{"type":"integer","format":"int14"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostUpdateRequest"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostResponse"}}}},"401":{"description":"Not allowed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"},"examples":{"Not allowed":{"value":{"code":"Unauthorized","message":"Not allowed"}}}}}},"404":{"description":"Post not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"},"examples":{"Post not found":{"value":{"code":"NotFound","entity":"post"}}}}}},"500":{"description":"Update failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailedUpdateResponse"},"examples":{"Failed":{"value":{"code":"FailedUpdate","fields":["content"]}}}}}}},"tags":["Post"]},"delete":{"summary":"Delete post","description":"Delete post with ID.","security":[{"BasicAuth":["isAdmin"]}],"parameters":[{"name":"id","in":"path","description":"Post ID","required":true,"schema":{"type":"integerLine truncated const __redoc_state = {"menu":{"activeItemIdx":-1},"spec":{"data":{"openapi":"3.0.0","info":{"title":"PHP Course Exam","version":"1.0.0","contact":{"name":"Kilian Kurt Hofmann","email":"khofmann@zedat.fu-berlin.de"},"description":"PHP Course (ABV FU Berlin) 2024 Exam"},"paths":{"/login":{"post":{"summary":"Login","description":"Log in user.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"400":{"description":"Missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissingFieldResponse"},"examples":{"Missing fields":{"value":{"code":"MissingField","fields":["email","password"]}}}}}},"401":{"description":"Invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"},"examples":{"Invalid username or password":{"value":{"code":"Unauthorized","message":"Invalid username or password"}}}}}},"404":{"description":"User not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"},"examples":{"User not found":{"value":{"code":"NotFound","entity":"user"}}}}}},"500":{"description":"Failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailedResponse"},"examples":{"Failed":{"value":{"code":"Failed","message":"Login failed"}}}}}}},"tags":["Login/Logout"]}},"/logout":{"post":{"summary":"Logout","description":"Log out user.","security":[{"BasicAuth":[]}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BooleanResponse"},"examples":{"Success":{"value":true}}}}}},"tags":["Login/Logout"]}},"/posts":{"get":{"summary":"List posts","description":"List all posts, return full user data if authenticated.","security":[{},{"BasicAuth":[]}],"parameters":[{"in":"query","name":"p","schema":{"type":"integer","minimum":0,"default":0},"description":"Current page."},{"in":"query","name":"l","schema":{"type":"integer","minimum":0,"maximum":30,"default":10},"description":"The number of items to return."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostListResponse"},"examples":{"Not authenticated":{"value":{"pages":0,"data":[{"id":0,"user":{"username":"string","image":"string"},"content":"string","postedAt":{"date":"2019-08-24T14:15:22Z","timezone_type":0,"timezone":"string"}}]}},"Authenticated":{"value":{"pages":1,"data":[{"id":1,"user":{"id":0,"username":"string","status":0,"email":"string","image":"string","isAdmin":true,"memberSince":{"date":"2019-08-24T14:15:22Z","timezone_type":0,"timezone":"string"},"postCount":0},"content":"string","postedAt":{"date":"2019-08-24T14:15:22Z","timezone_type":0,"timezone":"string"}}]}}}}}}},"tags":["Post"]},"post":{"summary":"New post","description":"Create a new post.","security":[{"BasicAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostCreateRequest"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostResponse"}}}},"400":{"description":"Missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissingFieldResponse"},"examples":{"Missing fields":{"value":{"code":"MissingField","fields":["content"]}}}}}}},"tags":["Post"]}},"/posts/{id}":{"patch":{"summary":"Update post","description":"Update post with ID. <br> Requires logged in user to have admin permissions for posts not made by them.","security":[{"BasicAuth":[]},{"BasicAuth":["isAdmin"]}],"parameters":[{"name":"id","in":"path","description":"Post ID","required":true,"schema":{"type":"integer","format":"int14"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostUpdateRequest"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostResponse"}}}},"401":{"description":"Not allowed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"},"examples":{"Not allowed":{"value":{"code":"Unauthorized","message":"Not allowed"}}}}}},"404":{"description":"Post not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"},"examples":{"Post not found":{"value":{"code":"NotFound","entity":"post"}}}}}},"500":{"description":"Update failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailedUpdateResponse"},"examples":{"Failed":{"value":{"code":"FailedUpdate","fields":["content"]}}}}}}},"tags":["Post"]},"delete":{"summary":"Delete post","description":"Delete post with ID.","security":[{"BasicAuth":["isAdmin"]}],"parameters":[{"name":"id","in":"path","description":"Post ID","required":true,"schema":{"type":"integerLine truncated
var container = document.getElementById('redoc'); var container = document.getElementById('redoc');
Redoc.hydrate(__redoc_state, container); Redoc.hydrate(__redoc_state, container);
+1 -1
View File
@@ -107,7 +107,7 @@ class Post implements JsonSerializable
$data $data
); );
return ["pages" => intdiv($count, $limit) + 1, "data" => $list]; return ["pages" => intdiv($count, $limit + 1) + 1, "data" => $list];
} }
/* /*
+1 -1
View File
@@ -255,7 +255,7 @@ class User implements JsonSerializable
$data $data
); );
return ["pages" => intdiv($count, $limit) + 1, "data" => $list]; return ["pages" => intdiv($count, $limit + 1), "data" => $list];
} }
/* /*
+1
View File
@@ -0,0 +1 @@
import{j as e,M as V,a as D,T as d,B as E,b as U,c as x,A as ge,d as W,L as v,C as X,I,e as pe,f as A,P,g as xe,u as je,h as Z,i as fe,k as J,l as _,D as Y,m as ee,n as L,o as ye,p as te,S as F,q as Ce,G as C,r as we,s as ve,t as be,v as Ae}from"./mui-BZej3Yg3.js";import{u as M,a as se,b as Pe,c as ke,L as y,d as Ee,O as Fe,e as De,r as S,f as ne,g as re,q,h as N,i as B,Q as Se,j as $e,k as Oe,R as Te,l as Ie}from"./tanstack-DeUNQvBN.js";import{c as Ue,r as p}from"./react-DXd9vB-a.js";import{i as b,B as Le,a as Re,b as Me,u as w,t as m}from"./i18n-DJgSTqOl.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const n of i.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&o(n)}).observe(document,{childList:!0,subtree:!0});function a(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(r){if(r.ep)return;r.ep=!0;const i=a(r);fetch(r.href,i)}})();var R={},H=Ue;R.createRoot=H.createRoot,R.hydrateRoot=H.hydrateRoot;const f="https://khofmann.userpage.fu-berlin.de/phpCourse/exam/api/";let K;class qe{constructor(){if(this.hasAuth=()=>this.token!==void 0,this.isAdmin=()=>{var s;return this.hasAuth()&&((s=this.self)==null?void 0:s.isAdmin)},this.getAuthenticatedUser=()=>this.self,this.getCurrentSession=()=>[this.token,this.refreshToken],this.logIn=async(s,a)=>{const{user:o,token:r}=await(await this.post("login",{email:s,password:a})).json();this.self=o,this.token=r},this.logOut=async()=>{try{return await(await this.postAuth("logout")).json()}catch{return!1}finally{this.self=void 0,this.token=void 0}},this.posts=async s=>{const a=`posts?p=${s??0}&l=9`;return this.token?await(await this.getAuth(a)).json():await(await this.get(a)).json()},this.deletePost=async s=>await(await this.delete(`posts/${s}`)).json(),this.user=async s=>{var a;return await(await this.getAuth(`users/${s??((a=this.self)==null?void 0:a.id)}`)).json()},this.updateUser=async(s,a)=>await(await this.patch(`users/${a??"self"}`,s)).json(),this.post=async(s,a,o)=>{const r=await fetch(`${f}${s}`,{mode:"cors",method:"post",headers:o,body:JSON.stringify(a)});if(r.ok)return r;throw await r.json()},this.postAuth=async(s,a,o)=>{const r=await fetch(`${f}${s}`,{mode:"cors",method:"post",headers:{token:this.token??"",...o},body:JSON.stringify(a)});if(r.ok)return r;throw await r.json()},this.get=async(s,a)=>{const o=await fetch(`${f}${s}`,{mode:"cors",method:"get",headers:a});if(o.ok)return o;throw await o.json()},this.getAuth=async(s,a)=>{const o=await fetch(`${f}${s}`,{mode:"cors",method:"get",headers:{token:this.token??"",...a}});if(o.ok)return o;throw await o.json()},this.delete=async(s,a)=>{const o=await fetch(`${f}${s}`,{mode:"cors",method:"delete",headers:{token:this.token??"",...a}});if(o.ok)return o;throw await o.json()},this.patch=async(s,a,o)=>{const r=await fetch(`${f}${s}`,{mode:"cors",method:"patch",headers:{token:this.token??"",...o},body:JSON.stringify(a)});if(r.ok)return r;throw await r.json()},K)throw new Error("New instance cannot be created!!");K=this}}const l=new qe;var k=(t=>(t.NOT_FOUND="NotFound",t.UNAUTHORIZED="Unauthorized",t.FAILEDUPDATE="FailedUpdate",t))(k||{});b.use(Le).use(Re).use(Me).init({fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1},backend:{loadPath:"/phpCourse/exam/dist/locales/{{lng}}/{{ns}}.json"}});const Ne=({anchorEl:t,handleClose:s})=>e.jsxs(V,{anchorEl:t,anchorOrigin:{vertical:"bottom",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:!!t,onClose:s,sx:{"& .MuiMenu-paper":{minWidth:"240px"}},children:[e.jsx(D,{selected:b.language==="en",onClick:()=>{b.changeLanguage("en"),s()},children:"English"},"de"),e.jsx(D,{selected:b.language==="de",onClick:()=>{b.changeLanguage("de"),s()},children:"Deutsch"},"en")]});var g=(t=>(t.INDEX="/",t.PROFILE="/profile",t))(g||{});const Q=({error:t,context:s})=>{const{t:a}=w();if(!t)return null;if(t.code)switch(t.code){case k.NOT_FOUND:return e.jsx(d,{color:"error.main",children:a(t.code,{context:`${t.entity}:${s}`})});case k.UNAUTHORIZED:return e.jsx(d,{color:"error.main",children:a(t.code,{context:s})});case k.FAILEDUPDATE:return t.fields.map(o=>e.jsx(d,{color:"error.main",children:a(t.code,{context:s,name:a(o)})},`error_${o}`))}return e.jsx(d,{color:"error.main",children:a((t==null?void 0:t.message)??"Unknown",{context:s})})},Be=({handleClose:t})=>{const[s,a]=p.useState(),{t:o}=w(),r=M(),i=se({defaultValues:{email:"",password:""},onSubmit:async({value:n})=>{try{await l.logIn(n.email,n.password),r.invalidate(),t()}catch(u){a(u)}}});return e.jsx("form",{onSubmit:n=>{n.preventDefault(),n.stopPropagation(),i.handleSubmit()},onKeyDoLine truncated
-1
View File
@@ -1 +0,0 @@
import{j as t,M as N,a as y,B as w,T as L,b as X,c as l,A as V,d as T,L as j,C as Z,I as A,e as J,f as v,g as _,u as Y,h as ee,i as te,k as se,S as F,G as g,P as ne,l as re}from"./mui-DQviNP-p.js";import{u as R,a as oe,b as ae,c as ie,L as x,d as ce,O as ue,e as le,r as $,f as E,q as I,g as O,Q as de,h as he,i as ge,R as me,j as pe}from"./tanstack-CLt5K1Fy.js";import{c as xe,r as m}from"./react-DXd9vB-a.js";import{i as p,B as fe,a as je,b as ye,u as C,t as b}from"./i18n-DJgSTqOl.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const n of i.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&a(n)}).observe(document,{childList:!0,subtree:!0});function o(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function a(r){if(r.ep)return;r.ep=!0;const i=o(r);fetch(r.href,i)}})();var k={},S=xe;k.createRoot=S.createRoot,k.hydrateRoot=S.hydrateRoot;const f="https://khofmann.userpage.fu-berlin.de/phpCourse/exam/api/";let D;class we{constructor(){if(this.hasAuth=()=>this.token!==void 0,this.isAdmin=()=>{var s;return this.hasAuth()&&((s=this.self)==null?void 0:s.isAdmin)},this.getAuthenticatedUser=()=>this.self,this.getCurrentSession=()=>[this.token,this.refreshToken],this.logIn=async(s,o)=>{const{user:a,token:r}=await(await this.post("login",{email:s,password:o})).json();this.self=a,this.isAdmin=a.isAdmin,this.token=r},this.logOut=async()=>{try{return await(await this.postAuth("logout")).json()}catch{return!1}finally{this.self=void 0,this.token=void 0}},this.posts=async s=>{const o=`posts?p=${s??0}&l=9`;return this.token?await(await this.getAuth(o)).json():await(await this.get(o)).json()},this.user=async s=>{var o;return await(await this.getAuth(`users/${s??((o=this.self)==null?void 0:o.id)}`)).json()},this.post=async(s,o=void 0,a=void 0)=>{const r=await fetch(`${f}${s}`,{mode:"cors",method:"post",headers:a,body:JSON.stringify(o)});if(r.ok)return r;throw await r.json()},this.postAuth=async(s,o=void 0,a=void 0)=>{const r=await fetch(`${f}${s}`,{mode:"cors",method:"post",headers:{token:this.token??"",...a},body:JSON.stringify(o)});if(r.ok)return r;throw await r.json()},this.get=async(s,o=void 0)=>{const a=await fetch(`${f}${s}`,{mode:"cors",method:"get",headers:o});if(a.ok)return a;throw await a.json()},this.getAuth=async(s,o=void 0)=>{const a=await fetch(`${f}${s}`,{mode:"cors",method:"get",headers:{token:this.token??"",...o}});if(a.ok)return a;throw await a.json()},D)throw new Error("New instance cannot be created!!");D=this}}const u=new we;p.use(fe).use(je).use(ye).init({fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1},backend:{loadPath:"/phpCourse/exam/dist/locales/{{lng}}/{{ns}}.json"}});const ve=({anchorEl:e,handleClose:s})=>t.jsxs(N,{anchorEl:e,anchorOrigin:{vertical:"bottom",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:!!e,onClose:s,sx:{"& .MuiMenu-paper":{minWidth:"240px"}},children:[t.jsx(y,{selected:p.language==="en",onClick:()=>{p.changeLanguage("en"),s()},children:"English"},"de"),t.jsx(y,{selected:p.language==="de",onClick:()=>{p.changeLanguage("de"),s()},children:"Deutsch"},"en")]});var d=(e=>(e.INDEX="/",e.PROFILE="/profile",e))(d||{}),B=(e=>(e.NOT_FOUND="NotFound",e.UNAUTHORIZED="Unauthorized",e))(B||{});const be=(e,s,o=(...a)=>a)=>{if(!e)return o("",{});if(e.code)switch(e.code){case"NotFound":return o(e.code,{context:`${e.entity}:${s}`});case"Unauthorized":return o(e.code,{context:s});default:return o("Unknown",{context:s})}return o((e==null?void 0:e.message)??"Unknown",{context:s})},Ce=({handleClose:e})=>{const[s,o]=m.useState(),{t:a}=C(),r=R(),i=oe({defaultValues:{email:"",password:""},onSubmit:async({value:n})=>{try{await u.logIn(n.email,n.password),r.invalidate(),e()}catch(c){o(c)}}});return t.jsx("form",{onSubmit:n=>{n.preventDefault(),n.stopPropagation(),i.handleSubmit()},onKeyDown:n=>{n.key==="Tab"&&n.stopPropagation()},noValidate:!0,children:t.jsxs(w,{sx:{display:"grid",gap:2,padding:1},children:[t.jsx(i.Field,{name:"email",validators:{onChange:({value:n})=>n?void 0:a("Email required"),onChangeAsyncDebounceMs:500,onChangeAsync:async({value:n})=>(await new Promise(c=>setTimeout(c,1e3)),n.includes("error")&&'No "error" allowed in email')},children:n=>t.jsx(t.Fragment,{children:t.jsx(L,{variant:"outlined",name:n.name,value:n.state.value,onBlur:n.handleBlur,onChange:c=>n.handleChange(c.target.value),size:"small",label:a("Email"),required:!0,error:n.state.meta.isTouched&&n.state.meta.errors.length>0,helperText:n.state.meta.isTouched?n.state.meta.errors.join(","):"",type:"email",autoComplete:"username",inputMode:"email"})})}),t.jsx(i.FieldLine truncated
+125
View File
@@ -0,0 +1,125 @@
import{r as p,R as zo,g as mt,a as it,b as bn,c as ia}from"./react-DXd9vB-a.js";var Hs={exports:{}},Bn={};/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var aa=p,la=Symbol.for("react.element"),ca=Symbol.for("react.fragment"),ua=Object.prototype.hasOwnProperty,da=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,pa={key:!0,ref:!0,__self:!0,__source:!0};function Vs(e,t,n){var o,r={},s=null,i=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(i=t.ref);for(o in t)ua.call(t,o)&&!pa.hasOwnProperty(o)&&(r[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps,t)r[o]===void 0&&(r[o]=t[o]);return{$$typeof:la,type:e,key:s,ref:i,props:r,_owner:da.current}}Bn.Fragment=ca;Bn.jsx=Vs;Bn.jsxs=Vs;Hs.exports=Bn;var R=Hs.exports;const on={black:"#000",white:"#fff"},kt={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Pt={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},Et={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},wt={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},Mt={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},Kt={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},fa={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function xt(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;n<arguments.length;n+=1)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}const ma=Object.freeze(Object.defineProperty({__proto__:null,default:xt},Symbol.toStringTag,{value:"Module"})),zn="$$material";function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},u.apply(null,arguments)}function A(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.includes(o))continue;n[o]=e[o]}return n}function Ks(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var ga=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|fLine truncated
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Re=typeof Symbol=="function"&&Symbol.for,rr=Re?Symbol.for("react.element"):60103,sr=Re?Symbol.for("react.portal"):60106,Dn=Re?Symbol.for("react.fragment"):60107,Wn=Re?Symbol.for("react.strict_mode"):60108,Un=Re?Symbol.for("react.profiler"):60114,Hn=Re?Symbol.for("react.provider"):60109,Vn=Re?Symbol.for("react.context"):60110,ir=Re?Symbol.for("react.async_mode"):60111,Kn=Re?Symbol.for("react.concurrent_mode"):60111,Gn=Re?Symbol.for("react.forward_ref"):60112,qn=Re?Symbol.for("react.suspense"):60113,Ka=Re?Symbol.for("react.suspense_list"):60120,Xn=Re?Symbol.for("react.memo"):60115,Yn=Re?Symbol.for("react.lazy"):60116,Ga=Re?Symbol.for("react.block"):60121,qa=Re?Symbol.for("react.fundamental"):60117,Xa=Re?Symbol.for("react.responder"):60118,Ya=Re?Symbol.for("react.scope"):60119;function Le(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case rr:switch(e=e.type,e){case ir:case Kn:case Dn:case Un:case Wn:case qn:return e;default:switch(e=e&&e.$$typeof,e){case Vn:case Gn:case Yn:case Xn:case Hn:return e;default:return t}}case sr:return t}}}function ni(e){return Le(e)===Kn}ee.AsyncMode=ir;ee.ConcurrentMode=Kn;ee.ContextConsumer=Vn;ee.ContextProvider=Hn;ee.Element=rr;ee.ForwardRef=Gn;ee.Fragment=Dn;ee.Lazy=Yn;ee.Memo=Xn;ee.Portal=sr;ee.Profiler=Un;ee.StrictMode=Wn;ee.Suspense=qn;ee.isAsyncMode=function(e){return ni(e)||Le(e)===ir};ee.isConcurrentMode=ni;ee.isContextConsumer=function(e){return Le(e)===Vn};ee.isContextProvider=function(e){return Le(e)===Hn};ee.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===rr};ee.isForwardRef=function(e){return Le(e)===Gn};ee.isFragment=function(e){return Le(e)===Dn};ee.isLazy=function(e){return Le(e)===Yn};ee.isMemo=function(e){return Le(e)===Xn};ee.isPortal=function(e){return Le(e)===sr};ee.isProfiler=function(e){return Le(e)===Un};ee.isStrictMode=function(e){return Le(e)===Wn};ee.isSuspense=function(e){return Le(e)===qn};ee.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Dn||e===Kn||e===Un||e===Wn||e===qn||e===Ka||typeof e=="object"&&e!==null&&(e.$$typeof===Yn||e.$$typeof===Xn||e.$$typeof===Hn||e.$$typeof===Vn||e.$$typeof===Gn||e.$$typeof===qa||e.$$typeof===Xa||e.$$typeof===Ya||e.$$typeof===Ga)};ee.typeOf=Le;ti.exports=ee;var Za=ti.exports,oi=Za,Qa={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Ja={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},ri={};ri[oi.ForwardRef]=Qa;ri[oi.Memo]=Ja;var el=!0;function tl(e,t,n){var o="";return n.split(" ").forEach(function(r){e[r]!==void 0?t.push(e[r]+";"):o+=r+" "}),o}var si=function(t,n,o){var r=t.key+"-"+n.name;(o===!1||el===!1)&&t.registered[r]===void 0&&(t.registered[r]=n.styles)},ii=function(t,n,o){si(t,n,o);var r=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var s=n;do t.insert(n===s?"."+r:"",s,t.sheet,!0),s=s.next;while(s!==void 0)}};function nl(e){for(var t=0,n,o=0,r=e.length;r>=4;++o,r-=4)n=e.charCodeAt(o)&255|(e.charCodeAt(++o)&255)<<8|(e.charCodeAt(++o)&255)<<16|(e.charCodeAt(++o)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(r){case 3:t^=(e.charCodeAt(o+2)&255)<<16;case 2:t^=(e.charCodeAt(o+1)&255)<<8;case 1:t^=e.charCodeAt(o)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var ol={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},rl=!1,sl=/[A-Z]|^ms/g,il=/_EMO_([^_]+?)_([^]*?)_EMO_/g,ai=function(t){return t.charCodeAt(1)===45},Br=function(t){return t!=null&&typeof t!="boolean"},Po=Ks(function(e){return ai(e)?e:e.replace(sl,"-$&").toLowerCase()}),zr=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(il,function(o,r,s){return et={name:r,styles:s,next:et},r})}return ol[t]!==1&&!ai(t)&&typeof n=="number"&&n!==0?n+"px":n},al="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function an(e,t,n){if(n==null)return"";var o=n;if(o.__emotion_styles!==void 0)return o;switch(typeof n){case"boolean":return"";case"object":{var r=n;if(r.anim===1)return et={name:r.name,styles:r.styles,next:et},r.name;var s=n;if(s.styles!==void 0){var i=s.next;if(i!==void 0)for(;i!==void 0;)et={namLine truncated
* @license React
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var mr=Symbol.for("react.element"),gr=Symbol.for("react.portal"),io=Symbol.for("react.fragment"),ao=Symbol.for("react.strict_mode"),lo=Symbol.for("react.profiler"),co=Symbol.for("react.provider"),uo=Symbol.for("react.context"),wc=Symbol.for("react.server_context"),po=Symbol.for("react.forward_ref"),fo=Symbol.for("react.suspense"),mo=Symbol.for("react.suspense_list"),go=Symbol.for("react.memo"),ho=Symbol.for("react.lazy"),Mc=Symbol.for("react.offscreen"),Ri;Ri=Symbol.for("react.module.reference");function Ye(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case mr:switch(e=e.type,e){case io:case lo:case ao:case fo:case mo:return e;default:switch(e=e&&e.$$typeof,e){case wc:case uo:case po:case ho:case go:case co:return e;default:return t}}case gr:return t}}}te.ContextConsumer=uo;te.ContextProvider=co;te.Element=mr;te.ForwardRef=po;te.Fragment=io;te.Lazy=ho;te.Memo=go;te.Portal=gr;te.Profiler=lo;te.StrictMode=ao;te.Suspense=fo;te.SuspenseList=mo;te.isAsyncMode=function(){return!1};te.isConcurrentMode=function(){return!1};te.isContextConsumer=function(e){return Ye(e)===uo};te.isContextProvider=function(e){return Ye(e)===co};te.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===mr};te.isForwardRef=function(e){return Ye(e)===po};te.isFragment=function(e){return Ye(e)===io};te.isLazy=function(e){return Ye(e)===ho};te.isMemo=function(e){return Ye(e)===go};te.isPortal=function(e){return Ye(e)===gr};te.isProfiler=function(e){return Ye(e)===lo};te.isStrictMode=function(e){return Ye(e)===ao};te.isSuspense=function(e){return Ye(e)===fo};te.isSuspenseList=function(e){return Ye(e)===mo};te.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===io||e===lo||e===ao||e===fo||e===mo||e===Mc||typeof e=="object"&&e!==null&&(e.$$typeof===ho||e.$$typeof===go||e.$$typeof===co||e.$$typeof===uo||e.$$typeof===po||e.$$typeof===Ri||e.getModuleId!==void 0)};te.typeOf=Ye;Si.exports=te;var Vr=Si.exports;const Tc=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function $i(e){const t=`${e}`.match(Tc);return t&&t[1]||""}function ki(e,t=""){return e.displayName||e.name||$i(e)||t}function Kr(e,t,n){const o=ki(t);return e.displayName||(o!==""?`${n}(${o})`:n)}function Ic(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return ki(e,"Component");if(typeof e=="object")switch(e.$$typeof){case Vr.ForwardRef:return Kr(e,e.render,"ForwardRef");case Vr.Memo:return Kr(e,e.type,"memo");default:return}}}const Oc=Object.freeze(Object.defineProperty({__proto__:null,default:Ic,getFunctionName:$i},Symbol.toStringTag,{value:"Module"}));function ln(e,t){const n=u({},t);return Object.keys(e).forEach(o=>{if(o.toString().match(/^(components|slots)$/))n[o]=u({},e[o],n[o]);else if(o.toString().match(/^(componentsProps|slotProps)$/)){const r=e[o]||{},s=t[o];n[o]={},!s||!Object.keys(s)?n[o]=r:!r||!Object.keys(r)?n[o]=s:(n[o]=u({},s),Object.keys(r).forEach(i=>{n[o][i]=ln(r[i],s[i])}))}else n[o]===void 0&&(n[o]=e[o])}),n}function Ac(e){const{theme:t,name:n,props:o}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?o:ln(t.components[n].defaultProps,o)}const lt=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Nc(e,t,n,o,r){const[s,i]=p.useState(()=>r&&n?n(e).matches:o?o(e).matches:t);return lt(()=>{let a=!0;if(!n)return;const l=n(e),c=()=>{a&&i(l.matches)};return c(),l.addListener(c),()=>{a=!1,l.removeListener(c)}},[e,n]),s}const Pi=p.useSyncExternalStore;function _c(e,t,n,o,r){const s=p.useCallback(()=>t,[t]),i=p.useMemo(()=>{if(r&&n)return()=>n(e).matches;if(o!==null){const{matches:d}=o(e);return()=>d}return s},[s,e,o,r,n]),[a,l]=p.useMemo(()=>{if(n===null)return[s,()=>()=>{}];const d=n(e);return[()=>d.matches,f=>(d.addListener(f),()=>{d.removeListener(f)})]},[s,n,e]);return Pi(l,a,i)}function sb(e,t={}){const n=yi(),o=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:r=!1,matchMedia:s=o?window.matchMedia:null,ssrMatchMedia:i=null,noSsr:a=!1}=Ac({name:"MuiUseMediaQuery",props:t,theme:n});let l=typeof e=="function"?e(n):e;return l=l.replace(/^@media( ?)/m,""),(Pi!==void 0?_c:Nc)(l,r,s,i,a)}function Bc(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const zc=Object.freeze(Object.defineProperty({__proto__:null,default:Bc},Symbol.toStringTag,{value:"Module"}));function Gr(...e){return e.reduce((t,n)=>n==null?t:function(...r){t.apply(this,r),n.apply(this,r)},()=>{})}function Ei(e,t=166){let n;function o(...r){const s=()=>{e.apply(this,r)};clearTimeout(n),n=setTimeout(s,t)}return o.clear=()=>{clearTimeout(n)},o}function Eo(e,t){var n,o;return p.isValidElement(e)&&t.indexOf((n=e.type.muiName)!=null?n:(o=e.type)==null||(o=o._payload)==null||(o=o.value)==null?void 0:o.muiName)!==-1}function Ee(e){return e&&e.ownerDocument||document}function Ct(e){return Ee(e).defaultView||window}function Wo(e,t){typeof e=="function"?e(t):e&&(e.current=t)}let qr=0;function Lc(e){const[t,n]=p.useState(e),o=e||t;return p.usLine truncated
0% {
transform: scale(0);
opacity: 0.1;
}
100% {
transform: scale(1);
opacity: 0.3;
}
`)),Ed=Ft(us||(us=yo`
0% {
opacity: 1;
}
100% {
opacity: 0;
}
`)),wd=Ft(ds||(ds=yo`
0% {
transform: scale(1);
}
50% {
transform: scale(0.92);
}
100% {
transform: scale(1);
}
`)),Md=T("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),Td=T(Rd,{name:"MuiTouchRipple",slot:"Ripple"})(ps||(ps=yo`
opacity: 0;
position: absolute;
&.${0} {
opacity: 0.3;
transform: scale(1);
animation-name: ${0};
animation-duration: ${0}ms;
animation-timing-function: ${0};
}
&.${0} {
animation-duration: ${0}ms;
}
& .${0} {
opacity: 1;
display: block;
width: 100%;
height: 100%;
border-radius: 50%;
background-color: currentColor;
}
& .${0} {
opacity: 0;
animation-name: ${0};
animation-duration: ${0}ms;
animation-timing-function: ${0};
}
& .${0} {
position: absolute;
/* @noflip */
left: 0px;
top: 0;
animation-name: ${0};
animation-duration: 2500ms;
animation-timing-function: ${0};
animation-iteration-count: infinite;
animation-delay: 200ms;
}
`),Ve.rippleVisible,Pd,Qo,({theme:e})=>e.transitions.easing.easeInOut,Ve.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,Ve.child,Ve.childLeaving,Ed,Qo,({theme:e})=>e.transitions.easing.easeInOut,Ve.childPulsate,wd,({theme:e})=>e.transitions.easing.easeInOut),Id=p.forwardRef(function(t,n){const o=G({props:t,name:"MuiTouchRipple"}),{center:r=!1,classes:s={},className:i}=o,a=A(o,$d),[l,c]=p.useState([]),d=p.useRef(0),f=p.useRef(null);p.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const g=p.useRef(!1),v=br(),m=p.useRef(null),h=p.useRef(null),C=p.useCallback(x=>{const{pulsate:$,rippleX:P,rippleY:k,rippleSize:w,cb:E}=x;c(M=>[...M,R.jsx(Td,{classes:{ripple:F(s.ripple,Ve.ripple),rippleVisible:F(s.rippleVisible,Ve.rippleVisible),ripplePulsate:F(s.ripplePulsate,Ve.ripplePulsate),child:F(s.child,Ve.child),childLeaving:F(s.childLeaving,Ve.childLeaving),childPulsate:F(s.childPulsate,Ve.childPulsate)},timeout:Qo,pulsate:$,rippleX:P,rippleY:k,rippleSize:w},d.current)]),d.current+=1,f.current=E},[s]),b=p.useCallback((x={},$={},P=()=>{})=>{const{pulsate:k=!1,center:w=r||$.pulsate,fakeElement:E=!1}=$;if((x==null?void 0:x.type)==="mousedown"&&g.current){g.current=!1;return}(x==null?void 0:x.type)==="touchstart"&&(g.current=!0);const M=E?null:h.current,D=M?M.getBoundingClientRect():{width:0,height:0,left:0,top:0};let L,z,N;if(w||x===void 0||x.clientX===0&&x.clientY===0||!x.clientX&&!x.touches)L=Math.round(D.width/2),z=Math.round(D.height/2);else{const{clientX:_,clientY:O}=x.touches&&x.touches.length>0?x.touches[0]:x;L=Math.round(_-D.left),z=Math.round(O-D.top)}if(w)N=Math.sqrt((2*D.width**2+D.height**2)/3),N%2===0&&(N+=1);else{const _=Math.max(Math.abs((M?M.clientWidth:0)-L),L)*2+2,O=Math.max(Math.abs((M?M.clientHeight:0)-z),z)*2+2;N=Math.sqrt(_**2+O**2)}x!=null&&x.touches?m.current===null&&(m.current=()=>{C({pulsate:k,rippleX:L,rippleY:z,rippleSize:N,cb:P})},v.start(kd,()=>{m.current&&(m.current(),m.current=null)})):C({pulsate:k,rippleX:L,rippleY:z,rippleSize:N,cb:P})},[r,C,v]),S=p.useCallback(()=>{b({},{pulsate:!0})},[b]),y=p.useCallback((x,$)=>{if(v.clear(),(x==null?void 0:x.type)==="touchend"&&m.current){m.current(),m.current=null,v.start(0,()=>{y(x,$)});return}m.current=null,c(P=>P.length>0?P.slice(1):P),f.current=$},[v]);return p.useImperativeHandle(n,()=>({pulsate:S,start:b,stop:y}),[S,b,y]),R.jsx(Md,u({className:F(Ve.root,s.root,i),ref:h},a,{children:R.jsx(Rr,{component:null,exit:!0,children:l})}))});function Od(e){return V("MuiButtonBase",e)}const Ad=H("MuiButtonBase",["root","disabled","focusVisible"]),Nd=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],_d=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:o,classes:r}=e,i=K({root:["root",t&&"disabled",n&&"focusVisible"]},Od,r);return n&&o&&(i.root+=` ${o}`),i},Bd=T("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Ad.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),xo=p.forwardRef(function(t,n){const o=G({props:t,name:"MuiButtonBase"}),{action:r,centerRipple:s=!1,children:i,className:a,component:l="button",disabled:c=!1,disableRipple:d=!1,disableTouchRipple:f=!1,focusRipple:g=!1,LinkComponent:v="a",onBlur:m,onClick:h,onContextMenu:C,onDragLeave:b,onFocus:S,onFocusVisible:y,onKeyDown:x,onKeyUp:$,onMouseDown:P,onMouseLeave:k,onMouseUp:w,onTouchEnd:E,onTouchMove:M,onTouchStart:D,tabIndex:L=0,TouchRippleProps:z,touchRippleRef:N,type:_}=o,O=A(o,Nd),j=p.useRef(null),I=p.useRef(null),Y=Se(I,N),{isFocusVisibleRef:se,onFocus:Me,onBlur:he,ref:fe}=wi(),[X,ie]=p.useState(!1);c&&X&&ie(!1),p.useImperativeHandle(r,()=>({focusVisible:()=>{ie(!0),j.current.focus()}}),[]);const[ae,Te]=p.useState(!1);p.useEffect(()=>{Te(!0)},[]);const we=ae&&!d&&!c;p.useEffect(()=>{X&&g&&!d&&ae&&I.current.pulsate()},[d,g,X,ae]);function be(U,st,Ht=f){return at(Vt=>(st&&st(Vt),!Ht&&I.current&&I.current[U](Vt),!0))}const Ie=be("start",P),J=be("stop",C),de=be("stop",b),q=be("stop",w),ne=be("stop",U=>{X&&U.preventDefault(),k&&k(U)}),le=be("start",D),ct=be("stop",E),je=be("stop",M),De=be("stop",U=>{he(U),se.current===!1&&ie(!1),m&&m(U)},!1),Ze=at(U=>{j.current||(j.current=U.currentTarget),Me(U),se.current===!0&&(ie(!0),y&&y(U)),S&&S(U)}),We=()=>{con Line truncated
`&&(x.value+=" ");const $=y.boxSizing,P=Cn(y.paddingBottom)+Cn(y.paddingTop),k=Cn(y.borderBottomWidth)+Cn(y.borderTopWidth),w=x.scrollHeight;x.value="x";const E=x.scrollHeight;let M=w;s&&(M=Math.max(Number(s)*E,M)),r&&(M=Math.min(Number(r)*E,M)),M=Math.max(M,E);const D=M+($==="border-box"?P+k:0),L=Math.abs(M-w)<=1;return{outerHeightStyle:D,overflowing:L}},[r,s,t.placeholder]),h=p.useCallback(()=>{const b=m();if(mp(b))return;const S=b.outerHeightStyle,y=d.current;g.current!==S&&(g.current=S,y.style.height=`${S}px`),y.style.overflow=b.overflowing?"hidden":""},[m]);lt(()=>{const b=()=>{h()};let S;const y=Ei(b),x=d.current,$=Ct(x);$.addEventListener("resize",y);let P;return typeof ResizeObserver<"u"&&(P=new ResizeObserver(b),P.observe(x)),()=>{y.clear(),cancelAnimationFrame(S),$.removeEventListener("resize",y),P&&P.disconnect()}},[m,h]),lt(()=>{h()});const C=b=>{c||h(),o&&o(b)};return R.jsxs(p.Fragment,{children:[R.jsx("textarea",u({value:a,onChange:C,ref:f,rows:s,style:i},l)),R.jsx("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:v,tabIndex:-1,style:u({},fp.shadow,i,{paddingTop:0,paddingBottom:0})})]})});function Wt({props:e,states:t,muiFormControl:n}){return t.reduce((o,r)=>(o[r]=e[r],n&&typeof e[r]>"u"&&(o[r]=n[r]),o),{})}const $r=p.createContext(void 0);function Ut(){return p.useContext($r)}function hp(e){return R.jsx(xc,u({},e,{defaultTheme:Cr,themeId:zn}))}function bs(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function _n(e,t=!1){return e&&(bs(e.value)&&e.value!==""||t&&bs(e.defaultValue)&&e.defaultValue!=="")}function bp(e){return e.startAdornment}function vp(e){return V("MuiInputBase",e)}const zt=H("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),yp=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],Co=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${B(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},So=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},xp=e=>{const{classes:t,color:n,disabled:o,error:r,endAdornment:s,focused:i,formControl:a,fullWidth:l,hiddenLabel:c,multiline:d,readOnly:f,size:g,startAdornment:v,type:m}=e,h={root:["root",`color${B(n)}`,o&&"disabled",r&&"error",l&&"fullWidth",i&&"focused",a&&"formControl",g&&g!=="medium"&&`size${B(g)}`,d&&"multiline",v&&"adornedStart",s&&"adornedEnd",c&&"hiddenLabel",f&&"readOnly"],input:["input",o&&"disabled",m==="search"&&"inputTypeSearch",d&&"inputMultiline",g==="small"&&"inputSizeSmall",c&&"inputHiddenLabel",v&&"inputAdornedStart",s&&"inputAdornedEnd",f&&"readOnly"]};return K(h,vp,t)},Ro=T("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Co})(({theme:e,ownerState:t})=>u({},e.typography.body1,{color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${zt.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"}},t.multiline&&u({padding:"4px 0 5px"},t.size==="small"&&{paddingTop:1}),t.fullWidth&&{width:"100%"})),$o=T("input",{name:"MuiInputBase",slot:"Input",overridesResolver:So})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light",o=u({color:"currentColor"},e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5},{transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})}),r={opacity:"0 !important"},s=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5};return u({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":o,"&::-moz-placeholder":o,"&:-ms-input-placeholder":o,"&::-ms-input-placeholder":o,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${zt.formLine truncated
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
`)),xf=Ft(xs||(xs=ko`
0% {
stroke-dasharray: 1px, 200px;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 100px, 200px;
stroke-dashoffset: -15px;
}
100% {
stroke-dasharray: 100px, 200px;
stroke-dashoffset: -125px;
}
`)),Cf=e=>{const{classes:t,variant:n,color:o,disableShrink:r}=e,s={root:["root",n,`color${B(o)}`],svg:["svg"],circle:["circle",`circle${B(n)}`,r&&"circleDisableShrink"]};return K(s,bf,t)},Sf=T("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${B(n.color)}`]]}})(({ownerState:e,theme:t})=>u({display:"inline-block"},e.variant==="determinate"&&{transition:t.transitions.create("transform")},e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main}),({ownerState:e})=>e.variant==="indeterminate"&&Qn(Cs||(Cs=ko`
animation: ${0} 1.4s linear infinite;
`),yf)),Rf=T("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),$f=T("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${B(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(({ownerState:e,theme:t})=>u({stroke:"currentColor"},e.variant==="determinate"&&{transition:t.transitions.create("stroke-dashoffset")},e.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink&&Qn(Ss||(Ss=ko`
animation: ${0} 1.4s ease-in-out infinite;
`),xf)),gb=p.forwardRef(function(t,n){const o=G({props:t,name:"MuiCircularProgress"}),{className:r,color:s="primary",disableShrink:i=!1,size:a=40,style:l,thickness:c=3.6,value:d=0,variant:f="indeterminate"}=o,g=A(o,vf),v=u({},o,{color:s,disableShrink:i,size:a,thickness:c,value:d,variant:f}),m=Cf(v),h={},C={},b={};if(f==="determinate"){const S=2*Math.PI*((pt-c)/2);h.strokeDasharray=S.toFixed(3),b["aria-valuenow"]=Math.round(d),h.strokeDashoffset=`${((100-d)/100*S).toFixed(3)}px`,C.transform="rotate(-90deg)"}return R.jsx(Sf,u({className:F(m.root,r),style:u({width:a,height:a},C,l),ownerState:v,ref:n,role:"progressbar"},b,g,{children:R.jsx(Rf,{className:m.svg,ownerState:v,viewBox:`${pt/2} ${pt/2} ${pt} ${pt}`,children:R.jsx($f,{className:m.circle,style:h,ownerState:v,cx:pt,cy:pt,r:(pt-c)/2,fill:"none",strokeWidth:c})})}))});function Rs(e){return e.substring(2).toLowerCase()}function kf(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function Pf(e){const{children:t,disableReactTree:n=!1,mouseEvent:o="onClick",onClickAway:r,touchEvent:s="onTouchEnd"}=e,i=p.useRef(!1),a=p.useRef(null),l=p.useRef(!1),c=p.useRef(!1);p.useEffect(()=>(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const d=Se(t.ref,a),f=at(m=>{const h=c.current;c.current=!1;const C=Ee(a.current);if(!l.current||!a.current||"clientX"in m&&kf(m,C))return;if(i.current){i.current=!1;return}let b;m.composedPath?b=m.composedPath().indexOf(a.current)>-1:b=!C.documentElement.contains(m.target)||a.current.contains(m.target),!b&&(n||!h)&&r(m)}),g=m=>h=>{c.current=!0;const C=t.props[m];C&&C(h)},v={ref:d};return s!==!1&&(v[s]=g(s)),p.useEffect(()=>{if(s!==!1){const m=Rs(s),h=Ee(a.current),C=()=>{i.current=!0};return h.addEventListener(m,f),h.addEventListener("touchmove",C),()=>{h.removeEventListener(m,f),h.removeEventListener("touchmove",C)}}},[f,s]),o!==!1&&(v[o]=g(o)),p.useEffect(()=>{if(o!==!1){const m=Rs(o),h=Ee(a.current);return h.addEventListener(m,f),()=>{h.removeEventListener(m,f)}}},[f,o]),R.jsx(p.Fragment,{children:p.cloneElement(t,v)})}function Ef(e){const t=Ee(e);return t.body===e?Ct(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function tn(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function $s(e){return parseInt(Ct(e).getComputedStyle(e).paddingRight,10)||0}function wf(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName)!==-1,o=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||o}function ks(e,t,n,o,r){const s=[t,n,...o];[].forEach.call(e.children,i=>{const a=s.indexOf(i)===-1,l=!wf(i);a&&l&&tn(i,r)})}function Oo(e,t){let n=-1;return e.some((o,r)=>t(o)?(n=r,!0):!1),n}function Mf(e,t){const n=[],o=e.container;if(!t.disableScrollLock){if(Ef(o)){const i=Mi(Ee(o));n.push({value:o.style.paddingRight,property:"padding-right",el:o}),o.style.paddingRight=`${$s(o)+i}px`;const a=Ee(o).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${$s(l)+i}px`})}let s;if(o.parentNode instanceof DocumentFragment)s=Ee(o).body;else{const i=o.parentElement,a=Ct(o);s=(i==null?void 0:i.nodeName)==="HTML"&&a.getComputedStyle(i).overflowY==="scroll"?i:o}n.push({value:s.style.overflow,property:"overflow",el:s},{value:s.style.overflowX,property:"overflow-x",el:s},{value:s.style.overflowY,property:"overflow-y",el:s}),s.style.overflow="hidden"}return()=>{n.forEach(({value:s,el:i,property:a})=>{s?i.style.setProperty(a,s):i.style.removeProperty(a)})}}function Tf(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class If{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(t,n){let o=this.modals.indexOf(t);if(o!==-1)return o;o=this.modals.length,this.modals.push(t),t.modalRef&&tn(t.modalRef,!1);const r=Tf(n);ks(n,t.mount,t.modalRef,r,!0);const s=Oo(this.containers,i=>i.container===n);return s!==-1?(this.containers[s].modals.push(t),o):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:r}),o)}mount(t,n){const o=Oo(this.containers,s=>s.modals.indexOf(t)!==-1),r=this.containers[o];r.restore||(r.restore=Mf(r,n))}remove(t,n=!0){const o=this.modals.indexOf(t);if(o===-1)return o;const r=Oo(this.containers,i=>i.modals.indexOf(t)!==-1),s=this.containers[r];if(s.modals.splice(s.modals.indexOf(t),1),this.modals.splice(o,1),s.modals.length===0)s.restore&&s.restore(),t.modalRef&&tn(t.modalRef,n),ks(s.container,t.mount,t.modalRef,s.hiddenSiblings,!1),this.containers.splice(r,1);else{const i=s.modals[s.modals.length-1];i.modalRef&&tn(i.modalRef,!1)}return o}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}const Of=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([co Line truncated
-125
View File
@@ -1,125 +0,0 @@
import{r as p,R as Ar,g as ft,a as st,b as mn,c as Gi}from"./react-DXd9vB-a.js";var zs={exports:{}},Nn={};/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var qi=p,Xi=Symbol.for("react.element"),Yi=Symbol.for("react.fragment"),Zi=Object.prototype.hasOwnProperty,Ji=qi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Qi={key:!0,ref:!0,__self:!0,__source:!0};function Bs(e,t,n){var r,o={},s=null,i=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)Zi.call(t,r)&&!Qi.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:Xi,type:e,key:s,ref:i,props:o,_owner:Ji.current}}Nn.Fragment=Yi;Nn.jsx=Bs;Nn.jsxs=Bs;zs.exports=Nn;var k=zs.exports;function Fs(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Fs(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function D(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Fs(e))&&(r&&(r+=" "),r+=t);return r}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(null,arguments)}function dt(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Ls(e){if(!dt(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Ls(e[n])}),t}function Ae(e,t,n={clone:!0}){const r=n.clone?u({},e):e;return dt(e)&&dt(t)&&Object.keys(t).forEach(o=>{dt(t[o])&&Object.prototype.hasOwnProperty.call(e,o)&&dt(e[o])?r[o]=Ae(e[o],t[o],n):n.clone?r[o]=dt(t[o])?Ls(t[o]):t[o]:r[o]=t[o]}),r}const ea=Object.freeze(Object.defineProperty({__proto__:null,default:Ae,isPlainObject:dt},Symbol.toStringTag,{value:"Module"}));function yt(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;n<arguments.length;n+=1)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}const ta=Object.freeze(Object.defineProperty({__proto__:null,default:yt},Symbol.toStringTag,{value:"Module"}));var js={exports:{}},ee={};/**
* @license React
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Yr=Symbol.for("react.element"),Zr=Symbol.for("react.portal"),An=Symbol.for("react.fragment"),zn=Symbol.for("react.strict_mode"),Bn=Symbol.for("react.profiler"),Fn=Symbol.for("react.provider"),Ln=Symbol.for("react.context"),na=Symbol.for("react.server_context"),jn=Symbol.for("react.forward_ref"),Dn=Symbol.for("react.suspense"),Wn=Symbol.for("react.suspense_list"),Hn=Symbol.for("react.memo"),Un=Symbol.for("react.lazy"),ra=Symbol.for("react.offscreen"),Ds;Ds=Symbol.for("react.module.reference");function Ge(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Yr:switch(e=e.type,e){case An:case Bn:case zn:case Dn:case Wn:return e;default:switch(e=e&&e.$$typeof,e){case na:case Ln:case jn:case Un:case Hn:case Fn:return e;default:return t}}case Zr:return t}}}ee.ContextConsumer=Ln;ee.ContextProvider=Fn;ee.Element=Yr;ee.ForwardRef=jn;ee.Fragment=An;ee.Lazy=Un;ee.Memo=Hn;ee.Portal=Zr;ee.Profiler=Bn;ee.StrictMode=zn;ee.Suspense=Dn;ee.SuspenseList=Wn;ee.isAsyncMode=function(){return!1};ee.isConcurrentMode=function(){return!1};ee.isContextConsumer=function(e){return Ge(e)===Ln};ee.isContextProvider=function(e){return Ge(e)===Fn};ee.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Yr};ee.isForwardRef=function(e){return Ge(e)===jn};ee.isFragment=function(e){return Ge(e)===An};ee.isLazy=function(e){return Ge(e)===Un};ee.isMemo=function(e){return Ge(e)===Hn};ee.isPortal=function(e){return Ge(e)===Zr};ee.isProfiler=function(e){return Ge(e)===Bn};ee.isStrictMode=function(e){return Ge(e)===zn};ee.isSuspense=function(e){return Ge(e)===Dn};ee.isSuspenseList=function(e){return Ge(e)===Wn};ee.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===An||e===Bn||e===zn||e===Dn||e===Wn||e===ra||typeof e=="object"&&e!==null&&(e.$$typeof===Un||e.$$typeof===Hn||e.$$typeof===Fn||e.$$typeof===Ln||e.$$typeof===jn||e.$$typeof===Ds||e.getModuleId!==void 0)};ee.typeOf=Ge;js.exports=ee;var wo=js.exports;const oa=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function Ws(e){const t=`${e}`.match(oa);return t&&t[1]||""}function Hs(e,t=""){return e.displayName||e.name||Ws(e)||t}function To(e,t,n){const r=Hs(t);return e.displayName||(r!==""?`${n}(${r})`:n)}function sa(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return Hs(e,"Component");if(typeof e=="object")switch(e.$$typeof){case wo.ForwardRef:return To(e,e.render,"ForwardRef");case wo.Memo:return To(e,e.type,"memo");default:return}}}const ia=Object.freeze(Object.defineProperty({__proto__:null,default:sa,getFunctionName:Ws},Symbol.toStringTag,{value:"Module"}));function F(e){if(typeof e!="string")throw new Error(yt(7));return e.charAt(0).toUpperCase()+e.slice(1)}const aa=Object.freeze(Object.defineProperty({__proto__:null,default:F},Symbol.toStringTag,{value:"Module"}));function Mo(...e){return e.reduce((t,n)=>n==null?t:function(...o){t.apply(this,o),n.apply(this,o)},()=>{})}function Us(e,t=166){let n;function r(...o){const s=()=>{e.apply(this,o)};clearTimeout(n),n=setTimeout(s,t)}return r.clear=()=>{clearTimeout(n)},r}function kr(e,t){var n,r;return p.isValidElement(e)&&t.indexOf((n=e.type.muiName)!=null?n:(r=e.type)==null||(r=r._payload)==null||(r=r.value)==null?void 0:r.muiName)!==-1}function Ee(e){return e&&e.ownerDocument||document}function xt(e){return Ee(e).defaultView||window}function zr(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const pt=typeof window<"u"?p.useLayoutEffect:p.useEffect;let Io=0;function la(e){const[t,n]=p.useState(e),r=e||t;return p.useEffect(()=>{t==null&&(Io+=1,n(`mui-${Io}`))},[t]),r}const Oo=Ar.useId;function Vs(e){if(Oo!==void 0){const t=Oo();return e??t}return la(e)}function Br({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=p.useRef(e!==void 0),[s,i]=p.useState(t),a=o?e:s,l=p.useCallback(c=>{o||i(c)},[]);return[a,l]}function it(e){const t=p.useRef(e);return pt(()=>{t.current=e}),p.useRef((...n)=>(0,t.current)(...n)).current}function Re(...e){return p.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{zr(n,t)})},e)}const _o={};function ca(e,t){const n=p.useRef(_o);return n.current===_o&&(n.current=e(t)),n}const ua=[];function da(e){p.useEffect(e,ua)}class Vn{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new Vn}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}}function Jr(){const e=ca(Vn.create).current;return da(e.disposeEffect),e}let Kn=!0,Fr=!1;const pa=new Vn,fa={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function ma(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&fa[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function ga(e){e.metaKey||e.altKey||e.ctrlKey||(Kn=!0)}function Pr(){Kn=!1}function ha(){this.visibilityState==="hidden"&&Fr&&(Kn=!0)}function ba(e){e.aLine truncated
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var $e=typeof Symbol=="function"&&Symbol.for,no=$e?Symbol.for("react.element"):60103,ro=$e?Symbol.for("react.portal"):60106,Yn=$e?Symbol.for("react.fragment"):60107,Zn=$e?Symbol.for("react.strict_mode"):60108,Jn=$e?Symbol.for("react.profiler"):60114,Qn=$e?Symbol.for("react.provider"):60109,er=$e?Symbol.for("react.context"):60110,oo=$e?Symbol.for("react.async_mode"):60111,tr=$e?Symbol.for("react.concurrent_mode"):60111,nr=$e?Symbol.for("react.forward_ref"):60112,rr=$e?Symbol.for("react.suspense"):60113,il=$e?Symbol.for("react.suspense_list"):60120,or=$e?Symbol.for("react.memo"):60115,sr=$e?Symbol.for("react.lazy"):60116,al=$e?Symbol.for("react.block"):60121,ll=$e?Symbol.for("react.fundamental"):60117,cl=$e?Symbol.for("react.responder"):60118,ul=$e?Symbol.for("react.scope"):60119;function Be(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case no:switch(e=e.type,e){case oo:case tr:case Yn:case Jn:case Zn:case rr:return e;default:switch(e=e&&e.$$typeof,e){case er:case nr:case sr:case or:case Qn:return e;default:return t}}case ro:return t}}}function ui(e){return Be(e)===tr}te.AsyncMode=oo;te.ConcurrentMode=tr;te.ContextConsumer=er;te.ContextProvider=Qn;te.Element=no;te.ForwardRef=nr;te.Fragment=Yn;te.Lazy=sr;te.Memo=or;te.Portal=ro;te.Profiler=Jn;te.StrictMode=Zn;te.Suspense=rr;te.isAsyncMode=function(e){return ui(e)||Be(e)===oo};te.isConcurrentMode=ui;te.isContextConsumer=function(e){return Be(e)===er};te.isContextProvider=function(e){return Be(e)===Qn};te.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===no};te.isForwardRef=function(e){return Be(e)===nr};te.isFragment=function(e){return Be(e)===Yn};te.isLazy=function(e){return Be(e)===sr};te.isMemo=function(e){return Be(e)===or};te.isPortal=function(e){return Be(e)===ro};te.isProfiler=function(e){return Be(e)===Jn};te.isStrictMode=function(e){return Be(e)===Zn};te.isSuspense=function(e){return Be(e)===rr};te.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Yn||e===tr||e===Jn||e===Zn||e===rr||e===il||typeof e=="object"&&e!==null&&(e.$$typeof===sr||e.$$typeof===or||e.$$typeof===Qn||e.$$typeof===er||e.$$typeof===nr||e.$$typeof===ll||e.$$typeof===cl||e.$$typeof===ul||e.$$typeof===al)};te.typeOf=Be;ci.exports=te;var dl=ci.exports,di=dl,pl={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},fl={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},pi={};pi[di.ForwardRef]=pl;pi[di.Memo]=fl;var ml=!0;function gl(e,t,n){var r="";return n.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):r+=o+" "}),r}var fi=function(t,n,r){var o=t.key+"-"+n.name;(r===!1||ml===!1)&&t.registered[o]===void 0&&(t.registered[o]=n.styles)},mi=function(t,n,r){fi(t,n,r);var o=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var s=n;do t.insert(n===s?"."+o:"",s,t.sheet,!0),s=s.next;while(s!==void 0)}};function hl(e){for(var t=0,n,r=0,o=e.length;o>=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var bl={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},vl=!1,yl=/[A-Z]|^ms/g,xl=/_EMO_([^_]+?)_([^]*?)_EMO_/g,gi=function(t){return t.charCodeAt(1)===45},Do=function(t){return t!=null&&typeof t!="boolean"},Tr=ei(function(e){return gi(e)?e:e.replace(yl,"-$&").toLowerCase()}),Wo=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(xl,function(r,o,s){return Qe={name:o,styles:s,next:Qe},o})}return bl[t]!==1&&!gi(t)&&typeof n=="number"&&n!==0?n+"px":n},Cl="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function on(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var o=n;if(o.anim===1)return Qe={name:o.name,styles:o.styles,next:Qe},o.name;var s=n;if(s.styles!==void 0){var i=s.next;if(i!==void 0)for(;i!==void 0;)Qe={namLine truncated
0% {
transform: scale(0);
opacity: 0.1;
}
100% {
transform: scale(1);
opacity: 0.3;
}
`)),gd=Bt(ss||(ss=vr`
0% {
opacity: 1;
}
100% {
opacity: 0;
}
`)),hd=Bt(is||(is=vr`
0% {
transform: scale(1);
}
50% {
transform: scale(0.92);
}
100% {
transform: scale(1);
}
`)),bd=M("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),vd=M(dd,{name:"MuiTouchRipple",slot:"Ripple"})(as||(as=vr`
opacity: 0;
position: absolute;
&.${0} {
opacity: 0.3;
transform: scale(1);
animation-name: ${0};
animation-duration: ${0}ms;
animation-timing-function: ${0};
}
&.${0} {
animation-duration: ${0}ms;
}
& .${0} {
opacity: 1;
display: block;
width: 100%;
height: 100%;
border-radius: 50%;
background-color: currentColor;
}
& .${0} {
opacity: 0;
animation-name: ${0};
animation-duration: ${0}ms;
animation-timing-function: ${0};
}
& .${0} {
position: absolute;
/* @noflip */
left: 0px;
top: 0;
animation-name: ${0};
animation-duration: 2500ms;
animation-timing-function: ${0};
animation-iteration-count: infinite;
animation-delay: 200ms;
}
`),He.rippleVisible,md,Gr,({theme:e})=>e.transitions.easing.easeInOut,He.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,He.child,He.childLeaving,gd,Gr,({theme:e})=>e.transitions.easing.easeInOut,He.childPulsate,hd,({theme:e})=>e.transitions.easing.easeInOut),yd=p.forwardRef(function(t,n){const r=q({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:s={},className:i}=r,a=A(r,pd),[l,c]=p.useState([]),d=p.useRef(0),m=p.useRef(null);p.useEffect(()=>{m.current&&(m.current(),m.current=null)},[l]);const g=p.useRef(!1),v=Jr(),f=p.useRef(null),h=p.useRef(null),C=p.useCallback(x=>{const{pulsate:S,rippleX:P,rippleY:$,rippleSize:T,cb:E}=x;c(w=>[...w,k.jsx(vd,{classes:{ripple:D(s.ripple,He.ripple),rippleVisible:D(s.rippleVisible,He.rippleVisible),ripplePulsate:D(s.ripplePulsate,He.ripplePulsate),child:D(s.child,He.child),childLeaving:D(s.childLeaving,He.childLeaving),childPulsate:D(s.childPulsate,He.childPulsate)},timeout:Gr,pulsate:S,rippleX:P,rippleY:$,rippleSize:T},d.current)]),d.current+=1,m.current=E},[s]),b=p.useCallback((x={},S={},P=()=>{})=>{const{pulsate:$=!1,center:T=o||S.pulsate,fakeElement:E=!1}=S;if((x==null?void 0:x.type)==="mousedown"&&g.current){g.current=!1;return}(x==null?void 0:x.type)==="touchstart"&&(g.current=!0);const w=E?null:h.current,j=w?w.getBoundingClientRect():{width:0,height:0,left:0,top:0};let B,z,I;if(T||x===void 0||x.clientX===0&&x.clientY===0||!x.clientX&&!x.touches)B=Math.round(j.width/2),z=Math.round(j.height/2);else{const{clientX:O,clientY:_}=x.touches&&x.touches.length>0?x.touches[0]:x;B=Math.round(O-j.left),z=Math.round(_-j.top)}if(T)I=Math.sqrt((2*j.width**2+j.height**2)/3),I%2===0&&(I+=1);else{const O=Math.max(Math.abs((w?w.clientWidth:0)-B),B)*2+2,_=Math.max(Math.abs((w?w.clientHeight:0)-z),z)*2+2;I=Math.sqrt(O**2+_**2)}x!=null&&x.touches?f.current===null&&(f.current=()=>{C({pulsate:$,rippleX:B,rippleY:z,rippleSize:I,cb:P})},v.start(fd,()=>{f.current&&(f.current(),f.current=null)})):C({pulsate:$,rippleX:B,rippleY:z,rippleSize:I,cb:P})},[o,C,v]),R=p.useCallback(()=>{b({},{pulsate:!0})},[b]),y=p.useCallback((x,S)=>{if(v.clear(),(x==null?void 0:x.type)==="touchend"&&f.current){f.current(),f.current=null,v.start(0,()=>{y(x,S)});return}f.current=null,c(P=>P.length>0?P.slice(1):P),m.current=S},[v]);return p.useImperativeHandle(n,()=>({pulsate:R,start:b,stop:y}),[R,b,y]),k.jsx(bd,u({className:D(He.root,s.root,i),ref:h},a,{children:k.jsx(vo,{component:null,exit:!0,children:l})}))});function xd(e){return V("MuiButtonBase",e)}const Cd=U("MuiButtonBase",["root","disabled","focusVisible"]),Rd=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],$d=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:o}=e,i=G({root:["root",t&&"disabled",n&&"focusVisible"]},xd,o);return n&&r&&(i.root+=` ${r}`),i},Sd=M("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Cd.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),yr=p.forwardRef(function(t,n){const r=q({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:s=!1,children:i,className:a,component:l="button",disabled:c=!1,disableRipple:d=!1,disableTouchRipple:m=!1,focusRipple:g=!1,LinkComponent:v="a",onBlur:f,onClick:h,onContextMenu:C,onDragLeave:b,onFocus:R,onFocusVisible:y,onKeyDown:x,onKeyUp:S,onMouseDown:P,onMouseLeave:$,onMouseUp:T,onTouchEnd:E,onTouchMove:w,onTouchStart:j,tabIndex:B=0,TouchRippleProps:z,touchRippleRef:I,type:O}=r,_=A(r,Rd),L=p.useRef(null),N=p.useRef(null),Y=Re(N,I),{isFocusVisibleRef:se,onFocus:Te,onBlur:he,ref:fe}=Ks(),[X,ie]=p.useState(!1);c&&X&&ie(!1),p.useImperativeHandle(o,()=>({focusVisible:()=>{ie(!0),L.current.focus()}}),[]);const[ae,Me]=p.useState(!1);p.useEffect(()=>{Me(!0)},[]);const we=ae&&!d&&!c;p.useEffect(()=>{X&&g&&!d&&ae&&N.current.pulsate()},[d,g,X,ae]);function be(H,ot,Wt=m){return it(Ht=>(ot&&ot(Ht),!Wt&&N.current&&N.current[H](Ht),!0))}const Ie=be("start",P),Q=be("stop",C),de=be("stop",b),K=be("stop",T),ne=be("stop",H=>{X&&H.preventDefault(),$&&$(H)}),le=be("start",j),at=be("stop",E),Fe=be("stop",w),Le=be("stop",H=>{he(H),se.current===!1&&ie(!1),f&&f(H)},!1),Ye=it(H=>{L.current||(L.current=H.currentTarget),Te(H),se.current===!0&&(ie(!0),y&&y(H)),R&&R(H)}),je=()=>{con Line truncated
`&&(x.value+=" ");const S=y.boxSizing,P=vn(y.paddingBottom)+vn(y.paddingTop),$=vn(y.borderBottomWidth)+vn(y.borderTopWidth),T=x.scrollHeight;x.value="x";const E=x.scrollHeight;let w=T;s&&(w=Math.max(Number(s)*E,w)),o&&(w=Math.min(Number(o)*E,w)),w=Math.max(w,E);const j=w+(S==="border-box"?P+$:0),B=Math.abs(w-T)<=1;return{outerHeightStyle:j,overflowing:B}},[o,s,t.placeholder]),h=p.useCallback(()=>{const b=f();if(Ud(b))return;const R=b.outerHeightStyle,y=d.current;g.current!==R&&(g.current=R,y.style.height=`${R}px`),y.style.overflow=b.overflowing?"hidden":""},[f]);pt(()=>{const b=()=>{h()};let R;const y=Us(b),x=d.current,S=xt(x);S.addEventListener("resize",y);let P;return typeof ResizeObserver<"u"&&(P=new ResizeObserver(b),P.observe(x)),()=>{y.clear(),cancelAnimationFrame(R),S.removeEventListener("resize",y),P&&P.disconnect()}},[f,h]),pt(()=>{h()});const C=b=>{c||h(),r&&r(b)};return k.jsxs(p.Fragment,{children:[k.jsx("textarea",u({value:a,onChange:C,ref:m,rows:s,style:i},l)),k.jsx("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:v,tabIndex:-1,style:u({},Hd.shadow,i,{paddingTop:0,paddingBottom:0})})]})});function jt({props:e,states:t,muiFormControl:n}){return t.reduce((r,o)=>(r[o]=e[o],n&&typeof e[o]>"u"&&(r[o]=n[o]),r),{})}const yo=p.createContext(void 0);function Dt(){return p.useContext(yo)}function Kd(e){return k.jsx(Ku,u({},e,{defaultTheme:go,themeId:gr}))}function cs(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function _n(e,t=!1){return e&&(cs(e.value)&&e.value!==""||t&&cs(e.defaultValue)&&e.defaultValue!=="")}function Gd(e){return e.startAdornment}function qd(e){return V("MuiInputBase",e)}const At=U("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),Xd=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],xr=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${F(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},Cr=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},Yd=e=>{const{classes:t,color:n,disabled:r,error:o,endAdornment:s,focused:i,formControl:a,fullWidth:l,hiddenLabel:c,multiline:d,readOnly:m,size:g,startAdornment:v,type:f}=e,h={root:["root",`color${F(n)}`,r&&"disabled",o&&"error",l&&"fullWidth",i&&"focused",a&&"formControl",g&&g!=="medium"&&`size${F(g)}`,d&&"multiline",v&&"adornedStart",s&&"adornedEnd",c&&"hiddenLabel",m&&"readOnly"],input:["input",r&&"disabled",f==="search"&&"inputTypeSearch",d&&"inputMultiline",g==="small"&&"inputSizeSmall",c&&"inputHiddenLabel",v&&"inputAdornedStart",s&&"inputAdornedEnd",m&&"readOnly"]};return G(h,qd,t)},Rr=M("div",{name:"MuiInputBase",slot:"Root",overridesResolver:xr})(({theme:e,ownerState:t})=>u({},e.typography.body1,{color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${At.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"}},t.multiline&&u({padding:"4px 0 5px"},t.size==="small"&&{paddingTop:1}),t.fullWidth&&{width:"100%"})),$r=M("input",{name:"MuiInputBase",slot:"Input",overridesResolver:Cr})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light",r=u({color:"currentColor"},e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5},{transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})}),o={opacity:"0 !important"},s=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5};return u({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${At.formLine truncated
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
`)),Gp=Bt(ps||(ps=Sr`
0% {
stroke-dasharray: 1px, 200px;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 100px, 200px;
stroke-dashoffset: -15px;
}
100% {
stroke-dasharray: 100px, 200px;
stroke-dashoffset: -125px;
}
`)),qp=e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e,s={root:["root",n,`color${F(r)}`],svg:["svg"],circle:["circle",`circle${F(n)}`,o&&"circleDisableShrink"]};return G(s,Up,t)},Xp=M("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${F(n.color)}`]]}})(({ownerState:e,theme:t})=>u({display:"inline-block"},e.variant==="determinate"&&{transition:t.transitions.create("transform")},e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main}),({ownerState:e})=>e.variant==="indeterminate"&&ar(fs||(fs=Sr`
animation: ${0} 1.4s linear infinite;
`),Kp)),Yp=M("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),Zp=M("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${F(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(({ownerState:e,theme:t})=>u({stroke:"currentColor"},e.variant==="determinate"&&{transition:t.transitions.create("stroke-dashoffset")},e.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink&&ar(ms||(ms=Sr`
animation: ${0} 1.4s ease-in-out infinite;
`),Gp)),xh=p.forwardRef(function(t,n){const r=q({props:t,name:"MuiCircularProgress"}),{className:o,color:s="primary",disableShrink:i=!1,size:a=40,style:l,thickness:c=3.6,value:d=0,variant:m="indeterminate"}=r,g=A(r,Vp),v=u({},r,{color:s,disableShrink:i,size:a,thickness:c,value:d,variant:m}),f=qp(v),h={},C={},b={};if(m==="determinate"){const R=2*Math.PI*((ut-c)/2);h.strokeDasharray=R.toFixed(3),b["aria-valuenow"]=Math.round(d),h.strokeDashoffset=`${((100-d)/100*R).toFixed(3)}px`,C.transform="rotate(-90deg)"}return k.jsx(Xp,u({className:D(f.root,o),style:u({width:a,height:a},C,l),ownerState:v,ref:n,role:"progressbar"},b,g,{children:k.jsx(Yp,{className:f.svg,ownerState:v,viewBox:`${ut/2} ${ut/2} ${ut} ${ut}`,children:k.jsx(Zp,{className:f.circle,style:h,ownerState:v,cx:ut,cy:ut,r:(ut-c)/2,fill:"none",strokeWidth:c})})}))});function gs(e){return e.substring(2).toLowerCase()}function Jp(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function Qp(e){const{children:t,disableReactTree:n=!1,mouseEvent:r="onClick",onClickAway:o,touchEvent:s="onTouchEnd"}=e,i=p.useRef(!1),a=p.useRef(null),l=p.useRef(!1),c=p.useRef(!1);p.useEffect(()=>(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const d=Re(t.ref,a),m=it(f=>{const h=c.current;c.current=!1;const C=Ee(a.current);if(!l.current||!a.current||"clientX"in f&&Jp(f,C))return;if(i.current){i.current=!1;return}let b;f.composedPath?b=f.composedPath().indexOf(a.current)>-1:b=!C.documentElement.contains(f.target)||a.current.contains(f.target),!b&&(n||!h)&&o(f)}),g=f=>h=>{c.current=!0;const C=t.props[f];C&&C(h)},v={ref:d};return s!==!1&&(v[s]=g(s)),p.useEffect(()=>{if(s!==!1){const f=gs(s),h=Ee(a.current),C=()=>{i.current=!0};return h.addEventListener(f,m),h.addEventListener("touchmove",C),()=>{h.removeEventListener(f,m),h.removeEventListener("touchmove",C)}}},[m,s]),r!==!1&&(v[r]=g(r)),p.useEffect(()=>{if(r!==!1){const f=gs(r),h=Ee(a.current);return h.addEventListener(f,m),()=>{h.removeEventListener(f,m)}}},[m,r]),k.jsx(p.Fragment,{children:p.cloneElement(t,v)})}function ef(e){const t=Ee(e);return t.body===e?xt(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function en(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function hs(e){return parseInt(xt(e).getComputedStyle(e).paddingRight,10)||0}function tf(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName)!==-1,r=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||r}function bs(e,t,n,r,o){const s=[t,n,...r];[].forEach.call(e.children,i=>{const a=s.indexOf(i)===-1,l=!tf(i);a&&l&&en(i,o)})}function Ir(e,t){let n=-1;return e.some((r,o)=>t(r)?(n=o,!0):!1),n}function nf(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(ef(r)){const i=Gs(Ee(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${hs(r)+i}px`;const a=Ee(r).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${hs(l)+i}px`})}let s;if(r.parentNode instanceof DocumentFragment)s=Ee(r).body;else{const i=r.parentElement,a=xt(r);s=(i==null?void 0:i.nodeName)==="HTML"&&a.getComputedStyle(i).overflowY==="scroll"?i:r}n.push({value:s.style.overflow,property:"overflow",el:s},{value:s.style.overflowX,property:"overflow-x",el:s},{value:s.style.overflowY,property:"overflow-y",el:s}),s.style.overflow="hidden"}return()=>{n.forEach(({value:s,el:i,property:a})=>{s?i.style.setProperty(a,s):i.style.removeProperty(a)})}}function rf(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class of{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(t,n){let r=this.modals.indexOf(t);if(r!==-1)return r;r=this.modals.length,this.modals.push(t),t.modalRef&&en(t.modalRef,!1);const o=rf(n);bs(n,t.mount,t.modalRef,o,!0);const s=Ir(this.containers,i=>i.container===n);return s!==-1?(this.containers[s].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:o}),r)}mount(t,n){const r=Ir(this.containers,s=>s.modals.indexOf(t)!==-1),o=this.containers[r];o.restore||(o.restore=nf(o,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const o=Ir(this.containers,i=>i.modals.indexOf(t)!==-1),s=this.containers[o];if(s.modals.splice(s.modals.indexOf(t),1),this.modals.splice(r,1),s.modals.length===0)s.restore&&s.restore(),t.modalRef&&en(t.modalRef,n),bs(s.container,t.mount,t.modalRef,s.hiddenSiblings,!1),this.containers.splice(o,1);else{const i=s.modals[s.modals.length-1];i.modalRef&&en(i.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}const sf=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([co Line truncated
-17
View File
@@ -1,17 +0,0 @@
var vs=e=>{throw TypeError(e)};var Be=(e,t,s)=>t.has(e)||vs("Cannot "+s);var h=(e,t,s)=>(Be(e,t,"read from private field"),s?s.call(e):t.get(e)),_=(e,t,s)=>t.has(e)?vs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),P=(e,t,s,i)=>(Be(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),x=(e,t,s)=>(Be(e,t,"access private method"),s);var Me=(e,t,s,i)=>({set _(r){P(e,t,r,s)},get _(){return h(e,t,i)}});import{r as C,c as wi}from"./react-DXd9vB-a.js";import{j as F}from"./mui-DQviNP-p.js";var be=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},oe=typeof window>"u"||"Deno"in globalThis;function lt(){}function Fi(e,t){return typeof e=="function"?e(t):e}function He(e){return typeof e=="number"&&e>=0&&e!==1/0}function qs(e,t){return Math.max(e+(t||0)-Date.now(),0)}function qt(e,t){return typeof e=="function"?e(t):e}function ht(e,t){return typeof e=="function"?e(t):e}function ys(e,t){const{type:s="all",exact:i,fetchStatus:r,predicate:n,queryKey:o,stale:a}=e;if(o){if(i){if(t.queryHash!==ls(o,t.options))return!1}else if(!pe(t.queryKey,o))return!1}if(s!=="all"){const c=t.isActive();if(s==="active"&&!c||s==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||r&&r!==t.state.fetchStatus||n&&!n(t))}function gs(e,t){const{exact:s,status:i,predicate:r,mutationKey:n}=e;if(n){if(!t.options.mutationKey)return!1;if(s){if(fe(t.options.mutationKey)!==fe(n))return!1}else if(!pe(t.options.mutationKey,n))return!1}return!(i&&t.state.status!==i||r&&!r(t))}function ls(e,t){return((t==null?void 0:t.queryKeyHashFn)||fe)(e)}function fe(e){return JSON.stringify(e,(t,s)=>Ge(s)?Object.keys(s).sort().reduce((i,r)=>(i[r]=s[r],i),{}):s)}function pe(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(s=>!pe(e[s],t[s])):!1}function zs(e,t){if(e===t)return e;const s=bs(e)&&bs(t);if(s||Ge(e)&&Ge(t)){const i=s?e:Object.keys(e),r=i.length,n=s?t:Object.keys(t),o=n.length,a=s?[]:{};let c=0;for(let u=0;u<o;u++){const l=s?u:n[u];(!s&&i.includes(l)||s)&&e[l]===void 0&&t[l]===void 0?(a[l]=void 0,c++):(a[l]=zs(e[l],t[l]),a[l]===e[l]&&e[l]!==void 0&&c++)}return r===o&&c===r?e:a}return t}function We(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function bs(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ge(e){if(!Ss(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!Ss(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ss(e){return Object.prototype.toString.call(e)==="[object Object]"}function _i(e){return new Promise(t=>{setTimeout(t,e)})}function Je(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?zs(e,t):t}function Ri(e,t,s=0){const i=[...e,t];return s&&i.length>s?i.slice(1):i}function Ci(e,t,s=0){const i=[t,...e];return s&&i.length>s?i.slice(0,-1):i}var Hs=Symbol();function Ws(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Hs?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Vt,Ft,Ht,js,Ei=(js=class extends be{constructor(){super();_(this,Vt);_(this,Ft);_(this,Ht);P(this,Ht,t=>{if(!oe&&window.addEventListener){const s=()=>t();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){h(this,Ft)||this.setEventListener(h(this,Ht))}onUnsubscribe(){var t;this.hasListeners()||((t=h(this,Ft))==null||t.call(this),P(this,Ft,void 0))}setEventListener(t){var s;P(this,Ht,t),(s=h(this,Ft))==null||s.call(this),P(this,Ft,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){h(this,Vt)!==t&&(P(this,Vt,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(s=>{s(t)})}isFocused(){var t;return typeof h(this,Vt)=="boolean"?h(this,Vt):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Vt=new WeakMap,Ft=new WeakMap,Ht=new WeakMap,js),cs=new Ei,Wt,_t,Gt,Ds,xi=(Ds=class extends be{constructor(){super();_(this,Wt,!0);_(this,_t);_(this,Gt);P(this,Gt,t=>{if(!oe&&window.addEventListener){const s=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",i)}}})}onSubscribe(){h(this,_t)||this.setEventListener(h(this,Gt))}onUnsubscribe(){var t;this.hasListeners()||((t=h(this,_t))==null||t.call(this),P(this,_t,void 0))}setEventListener(t){var s;P(this,Gt,t),(s=h(this,_t))==null||s.call(this),P(this,_t,t(this.setOnline.bind(this)))}setOnline(t){h(this,Wt)!==t&&(P(this,Wt,t),this.listenersLine truncated
* @license React
* use-sync-external-store-shim.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var ae=C;function ar(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ur=typeof Object.is=="function"?Object.is:ar,lr=ae.useState,cr=ae.useEffect,hr=ae.useLayoutEffect,dr=ae.useDebugValue;function fr(e,t){var s=t(),i=lr({inst:{value:s,getSnapshot:t}}),r=i[0].inst,n=i[1];return hr(function(){r.value=s,r.getSnapshot=t,Ue(r)&&n({inst:r})},[e,s,t]),cr(function(){return Ue(r)&&n({inst:r}),e(function(){Ue(r)&&n({inst:r})})},[e]),dr(s),s}function Ue(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!ur(e,s)}catch{return!0}}function pr(e,t){return t()}var mr=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?pr:fr;hi.useSyncExternalStore=ae.useSyncExternalStore!==void 0?ae.useSyncExternalStore:mr;ci.exports=hi;var vr=ci.exports;/**
* @license React
* use-sync-external-store-shim/with-selector.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Te=C,yr=vr;function gr(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var br=typeof Object.is=="function"?Object.is:gr,Sr=yr.useSyncExternalStore,Mr=Te.useRef,Pr=Te.useEffect,wr=Te.useMemo,Fr=Te.useDebugValue;li.useSyncExternalStoreWithSelector=function(e,t,s,i,r){var n=Mr(null);if(n.current===null){var o={hasValue:!1,value:null};n.current=o}else o=n.current;n=wr(function(){function c(p){if(!u){if(u=!0,l=p,p=i(p),r!==void 0&&o.hasValue){var v=o.value;if(r(v,p))return d=v}return d=p}if(v=d,br(l,p))return v;var m=i(p);return r!==void 0&&r(v,m)?v:(l=p,d=m)}var u=!1,l,d,f=s===void 0?null:s;return[function(){return c(t())},f===null?void 0:function(){return c(f())}]},[t,s,i,r]);var a=Sr(e,n[0],n[1]);return Pr(function(){o.hasValue=!0,o.value=a},[a]),Fr(a),a};ui.exports=li;var _r=ui.exports;class ds{constructor(t,s){this.listeners=new Set,this._batching=!1,this._flushing=0,this.subscribe=i=>{var r,n;this.listeners.add(i);const o=(n=(r=this.options)==null?void 0:r.onSubscribe)==null?void 0:n.call(r,i,this);return()=>{this.listeners.delete(i),o==null||o()}},this.setState=i=>{var r,n,o;const a=this.state;this.state=(r=this.options)!=null&&r.updateFn?this.options.updateFn(a)(i):i(a),(o=(n=this.options)==null?void 0:n.onUpdate)==null||o.call(n),this._flush()},this._flush=()=>{if(this._batching)return;const i=++this._flushing;this.listeners.forEach(r=>{this._flushing===i&&r()})},this.batch=i=>{if(this._batching)return i();this._batching=!0,i(),this._batching=!1,this._flush()},this.state=t,this.options=s}}function Ee(e,t=s=>s){return _r.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,Rr)}function Rr(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const s=Object.keys(e);if(s.length!==Object.keys(t).length)return!1;for(let i=0;i<s.length;i++)if(!Object.prototype.hasOwnProperty.call(t,s[i])||!Object.is(e[s[i]],t[s[i]]))return!1;return!0}const it="__root__";function Cr(e,t){let s,i,r,n="";for(s in e)if((r=e[s])!==void 0)if(Array.isArray(r))for(i=0;i<r.length;i++)n&&(n+="&"),n+=encodeURIComponent(s)+"="+encodeURIComponent(r[i]);else n&&(n+="&"),n+=encodeURIComponent(s)+"="+encodeURIComponent(r);return""+n}function Rs(e){if(!e)return"";const t=decodeURIComponent(e);return t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t}function Er(e,t){let s,i;const r={},n=e.split("&");for(;s=n.shift();){const o=s.indexOf("=");if(o!==-1){i=s.slice(0,o);const a=s.slice(o+1);r[i]!==void 0?r[i]=[].concat(r[i],Rs(a)):r[i]=Rs(a)}else i=s,r[i]=""}return r}const xr=Or(JSON.parse),Lr=Ar(JSON.stringify,JSON.parse);function Or(e){return t=>{t.substring(0,1)==="?"&&(t=t.substring(1));const s=Er(t);for(const i in s){const r=s[i];if(typeof r=="string")try{s[i]=e(r)}catch{}}return s}}function Ar(e,t){function s(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(typeof i=="string"&&typeof t=="function")try{return t(i),e(i)}catch{}return i}return i=>{i={...i},Object.keys(i).forEach(n=>{const o=i[n];typeof o>"u"||o===void 0?delete i[n]:i[n]=s(o)});const r=Cr(i).toString();return r?`?${r}`:""}}function xe(e){return e[e.length-1]}function Tr(e){return typeof e=="function"}function Nt(e,t){return Tr(e)?e(t):e}function de(e,t){return t.reduce((s,i)=>(s[i]=e[i],s),{})}function ft(e,t){if(e===t)return e;const s=t,i=Es(e)&&Es(s);if(i||Le(e)&&Le(s)){const r=i?e:Object.keys(e),n=r.length,o=i?s:Object.keys(s),a=o.length,c=i?[]:{};let u=0;for(let l=0;l<a;l++){const d=i?l:o[l];(!i&&r.includes(d)||i)&&e[d]===void 0&&s[d]===void 0?(c[d]=void 0,u++):(c[d]=ft(e[d],s[d]),c[d]===e[d]&&e[d]!==void 0&&u++)}return n===a&&u===n?e:c}return s}function Le(e){if(!Cs(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const s=t.prototype;return!(!Cs(s)||!s.hasOwnProperty("isPrototypeOf"))}function Cs(e){return Object.prototype.toString.call(e)==="[object Object]"}function Es(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function zt(e,t,s=!1){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Le(e)&&Le(t)){const i=Object.keys(e).filter(n=>e[n]!==void 0),r=Object.keys(t).filter(n=>t[n]!==void 0);return!s&&i.length!==r.length?!1:!r.some(n=>!(n in e)||!zt(e[n],t[n],s))}return Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:!e.some((i,r)=>!zt(i,t[r],s)):!1}const Ke=typeof window<"u"?C.useLayoutEffect:C.useEffect;function Kt(e){let t,s;const i=new Promise((r,n)=>{t=r,s=n});return i.status="pending",i.resolve=r=>{i.status="resolved",i.value=r,t(r),e==null||e(r)},i.reject=r=>{i.status="rejected",s(r)},i}function xs(e){const t=C.useRef({value:e,prev:null}),s=t.current.value;return e!==s&&(t.current={value:e,prev:s}),t.current.prev}function Lt(e){return Ie(e.filter(Boolean).join("/"))}function Ie(e){return e.replace(/\/{2,}/g,"/")}function fs(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function It(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Ir(e){return It(fs(e))}function Oe(e,t){return e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}functLine truncated
+17
View File
@@ -0,0 +1,17 @@
var ws=e=>{throw TypeError(e)};var ze=(e,t,s)=>t.has(e)||ws("Cannot "+s);var l=(e,t,s)=>(ze(e,t,"read from private field"),s?s.call(e):t.get(e)),F=(e,t,s)=>t.has(e)?ws("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),P=(e,t,s,i)=>(ze(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),E=(e,t,s)=>(ze(e,t,"access private method"),s);var Ce=(e,t,s,i)=>({set _(r){P(e,t,r,s)},get _(){return l(e,t,i)}});import{r as C,c as Ii}from"./react-DXd9vB-a.js";import{j as _}from"./mui-BZej3Yg3.js";var ve=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},de=typeof window>"u"||"Deno"in globalThis;function ct(){}function Vi(e,t){return typeof e=="function"?e(t):e}function ts(e){return typeof e=="number"&&e>=0&&e!==1/0}function Zs(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xt(e,t){return typeof e=="function"?e(t):e}function dt(e,t){return typeof e=="function"?e(t):e}function Fs(e,t){const{type:s="all",exact:i,fetchStatus:r,predicate:n,queryKey:o,stale:a}=e;if(o){if(i){if(t.queryHash!==vs(o,t.options))return!1}else if(!Se(t.queryKey,o))return!1}if(s!=="all"){const h=t.isActive();if(s==="active"&&!h||s==="inactive"&&h)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||r&&r!==t.state.fetchStatus||n&&!n(t))}function _s(e,t){const{exact:s,status:i,predicate:r,mutationKey:n}=e;if(n){if(!t.options.mutationKey)return!1;if(s){if(Ht(t.options.mutationKey)!==Ht(n))return!1}else if(!Se(t.options.mutationKey,n))return!1}return!(i&&t.state.status!==i||r&&!r(t))}function vs(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ht)(e)}function Ht(e){return JSON.stringify(e,(t,s)=>es(s)?Object.keys(s).sort().reduce((i,r)=>(i[r]=s[r],i),{}):s)}function Se(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(s=>!Se(e[s],t[s])):!1}function ti(e,t){if(e===t)return e;const s=Cs(e)&&Cs(t);if(s||es(e)&&es(t)){const i=s?e:Object.keys(e),r=i.length,n=s?t:Object.keys(t),o=n.length,a=s?[]:{};let h=0;for(let u=0;u<o;u++){const c=s?u:n[u];(!s&&i.includes(c)||s)&&e[c]===void 0&&t[c]===void 0?(a[c]=void 0,h++):(a[c]=ti(e[c],t[c]),a[c]===e[c]&&e[c]!==void 0&&h++)}return r===o&&h===r?e:a}return t}function Te(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function Cs(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function es(e){if(!Rs(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!Rs(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Rs(e){return Object.prototype.toString.call(e)==="[object Object]"}function ji(e){return new Promise(t=>{setTimeout(t,e)})}function ss(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?ti(e,t):t}function Di(e,t,s=0){const i=[...e,t];return s&&i.length>s?i.slice(1):i}function ki(e,t,s=0){const i=[t,...e];return s&&i.length>s?i.slice(0,-1):i}var ei=Symbol();function si(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ei?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var $t,Rt,Zt,Ks,Bi=(Ks=class extends ve{constructor(){super();F(this,$t);F(this,Rt);F(this,Zt);P(this,Zt,t=>{if(!de&&window.addEventListener){const s=()=>t();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){l(this,Rt)||this.setEventListener(l(this,Zt))}onUnsubscribe(){var t;this.hasListeners()||((t=l(this,Rt))==null||t.call(this),P(this,Rt,void 0))}setEventListener(t){var s;P(this,Zt,t),(s=l(this,Rt))==null||s.call(this),P(this,Rt,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){l(this,$t)!==t&&(P(this,$t,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(s=>{s(t)})}isFocused(){var t;return typeof l(this,$t)=="boolean"?l(this,$t):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},$t=new WeakMap,Rt=new WeakMap,Zt=new WeakMap,Ks),ys=new Bi,te,Et,ee,Ns,$i=(Ns=class extends ve{constructor(){super();F(this,te,!0);F(this,Et);F(this,ee);P(this,ee,t=>{if(!de&&window.addEventListener){const s=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",i)}}})}onSubscribe(){l(this,Et)||this.setEventListener(l(this,ee))}onUnsubscribe(){var t;this.hasListeners()||((t=l(this,Et))==null||t.call(this),P(this,Et,void 0))}setEventListener(t){var s;P(this,ee,t),(s=l(this,Et))==null||s.call(this),P(this,Et,t(this.setOnline.bind(this)))}setOnline(t){l(this,te)!==t&&(P(this,te,t),this.listenersLine truncated
* @license React
* use-sync-external-store-shim.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var fe=C;function yr(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gr=typeof Object.is=="function"?Object.is:yr,br=fe.useState,Sr=fe.useEffect,Mr=fe.useLayoutEffect,Pr=fe.useDebugValue;function wr(e,t){var s=t(),i=br({inst:{value:s,getSnapshot:t}}),r=i[0].inst,n=i[1];return Mr(function(){r.value=s,r.getSnapshot=t,Ge(r)&&n({inst:r})},[e,s,t]),Sr(function(){return Ge(r)&&n({inst:r}),e(function(){Ge(r)&&n({inst:r})})},[e]),Pr(s),s}function Ge(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!gr(e,s)}catch{return!0}}function Fr(e,t){return t()}var _r=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Fr:wr;Pi.useSyncExternalStore=fe.useSyncExternalStore!==void 0?fe.useSyncExternalStore:_r;Mi.exports=Pi;var Cr=Mi.exports;/**
* @license React
* use-sync-external-store-shim/with-selector.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var $e=C,Rr=Cr;function Er(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xr=typeof Object.is=="function"?Object.is:Er,Or=Rr.useSyncExternalStore,Lr=$e.useRef,Ar=$e.useEffect,Tr=$e.useMemo,Ir=$e.useDebugValue;Si.useSyncExternalStoreWithSelector=function(e,t,s,i,r){var n=Lr(null);if(n.current===null){var o={hasValue:!1,value:null};n.current=o}else o=n.current;n=Tr(function(){function h(p){if(!u){if(u=!0,c=p,p=i(p),r!==void 0&&o.hasValue){var v=o.value;if(r(v,p))return d=v}return d=p}if(v=d,xr(c,p))return v;var m=i(p);return r!==void 0&&r(v,m)?v:(c=p,d=m)}var u=!1,c,d,f=s===void 0?null:s;return[function(){return h(t())},f===null?void 0:function(){return h(f())}]},[t,s,i,r]);var a=Or(e,n[0],n[1]);return Ar(function(){o.hasValue=!0,o.value=a},[a]),Ir(a),a};bi.exports=Si;var Vr=bi.exports;class bs{constructor(t,s){this.listeners=new Set,this._batching=!1,this._flushing=0,this.subscribe=i=>{var r,n;this.listeners.add(i);const o=(n=(r=this.options)==null?void 0:r.onSubscribe)==null?void 0:n.call(r,i,this);return()=>{this.listeners.delete(i),o==null||o()}},this.setState=i=>{var r,n,o;const a=this.state;this.state=(r=this.options)!=null&&r.updateFn?this.options.updateFn(a)(i):i(a),(o=(n=this.options)==null?void 0:n.onUpdate)==null||o.call(n),this._flush()},this._flush=()=>{if(this._batching)return;const i=++this._flushing;this.listeners.forEach(r=>{this._flushing===i&&r()})},this.batch=i=>{if(this._batching)return i();this._batching=!0,i(),this._batching=!1,this._flush()},this.state=t,this.options=s}}function Ve(e,t=s=>s){return Vr.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,jr)}function jr(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const s=Object.keys(e);if(s.length!==Object.keys(t).length)return!1;for(let i=0;i<s.length;i++)if(!Object.prototype.hasOwnProperty.call(t,s[i])||!Object.is(e[s[i]],t[s[i]]))return!1;return!0}const rt="__root__";function Dr(e,t){let s,i,r,n="";for(s in e)if((r=e[s])!==void 0)if(Array.isArray(r))for(i=0;i<r.length;i++)n&&(n+="&"),n+=encodeURIComponent(s)+"="+encodeURIComponent(r[i]);else n&&(n+="&"),n+=encodeURIComponent(s)+"="+encodeURIComponent(r);return""+n}function Ts(e){if(!e)return"";const t=decodeURIComponent(e);return t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t}function kr(e,t){let s,i;const r={},n=e.split("&");for(;s=n.shift();){const o=s.indexOf("=");if(o!==-1){i=s.slice(0,o);const a=s.slice(o+1);r[i]!==void 0?r[i]=[].concat(r[i],Ts(a)):r[i]=Ts(a)}else i=s,r[i]=""}return r}const Br=Ur(JSON.parse),$r=Qr(JSON.stringify,JSON.parse);function Ur(e){return t=>{t.substring(0,1)==="?"&&(t=t.substring(1));const s=kr(t);for(const i in s){const r=s[i];if(typeof r=="string")try{s[i]=e(r)}catch{}}return s}}function Qr(e,t){function s(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(typeof i=="string"&&typeof t=="function")try{return t(i),e(i)}catch{}return i}return i=>{i={...i},Object.keys(i).forEach(n=>{const o=i[n];typeof o>"u"||o===void 0?delete i[n]:i[n]=s(o)});const r=Dr(i).toString();return r?`?${r}`:""}}function je(e){return e[e.length-1]}function Kr(e){return typeof e=="function"}function Jt(e,t){return Kr(e)?e(t):e}function be(e,t){return t.reduce((s,i)=>(s[i]=e[i],s),{})}function pt(e,t){if(e===t)return e;const s=t,i=Vs(e)&&Vs(s);if(i||De(e)&&De(s)){const r=i?e:Object.keys(e),n=r.length,o=i?s:Object.keys(s),a=o.length,h=i?[]:{};let u=0;for(let c=0;c<a;c++){const d=i?c:o[c];(!i&&r.includes(d)||i)&&e[d]===void 0&&s[d]===void 0?(h[d]=void 0,u++):(h[d]=pt(e[d],s[d]),h[d]===e[d]&&e[d]!==void 0&&u++)}return n===a&&u===n?e:h}return s}function De(e){if(!Is(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const s=t.prototype;return!(!Is(s)||!s.hasOwnProperty("isPrototypeOf"))}function Is(e){return Object.prototype.toString.call(e)==="[object Object]"}function Vs(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Yt(e,t,s=!1){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(De(e)&&De(t)){const i=Object.keys(e).filter(n=>e[n]!==void 0),r=Object.keys(t).filter(n=>t[n]!==void 0);return!s&&i.length!==r.length?!1:!r.some(n=>!(n in e)||!Yt(e[n],t[n],s))}return Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:!e.some((i,r)=>!Yt(i,t[r],s)):!1}const Je=typeof window<"u"?C.useLayoutEffect:C.useEffect;function Gt(e){let t,s;const i=new Promise((r,n)=>{t=r,s=n});return i.status="pending",i.resolve=r=>{i.status="resolved",i.value=r,t(r),e==null||e(r)},i.reject=r=>{i.status="rejected",s(r)},i}function js(e){const t=C.useRef({value:e,prev:null}),s=t.current.value;return e!==s&&(t.current={value:e,prev:s}),t.current.prev}function Vt(e){return Ue(e.filter(Boolean).join("/"))}function Ue(e){return e.replace(/\/{2,}/g,"/")}function Ss(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Bt(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Nr(e){return Bt(Ss(e))}function ke(e,t){return e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}functLine truncated
+3 -3
View File
@@ -5,10 +5,10 @@
<link rel="icon" type="image/svg+xml" href="/phpCourse/exam/dist/vite.svg" /> <link rel="icon" type="image/svg+xml" href="/phpCourse/exam/dist/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title> <title>Vite + React + TS</title>
<script type="module" crossorigin src="/phpCourse/exam/dist/assets/index-DRZup-fm.js"></script> <script type="module" crossorigin src="/phpCourse/exam/dist/assets/index-CmwTmvyQ.js"></script>
<link rel="modulepreload" crossorigin href="/phpCourse/exam/dist/assets/react-DXd9vB-a.js"> <link rel="modulepreload" crossorigin href="/phpCourse/exam/dist/assets/react-DXd9vB-a.js">
<link rel="modulepreload" crossorigin href="/phpCourse/exam/dist/assets/mui-DQviNP-p.js"> <link rel="modulepreload" crossorigin href="/phpCourse/exam/dist/assets/mui-BZej3Yg3.js">
<link rel="modulepreload" crossorigin href="/phpCourse/exam/dist/assets/tanstack-CLt5K1Fy.js"> <link rel="modulepreload" crossorigin href="/phpCourse/exam/dist/assets/tanstack-DeUNQvBN.js">
<link rel="modulepreload" crossorigin href="/phpCourse/exam/dist/assets/i18n-DJgSTqOl.js"> <link rel="modulepreload" crossorigin href="/phpCourse/exam/dist/assets/i18n-DJgSTqOl.js">
<link rel="stylesheet" crossorigin href="/phpCourse/exam/dist/assets/mui-CKDNpdid.css"> <link rel="stylesheet" crossorigin href="/phpCourse/exam/dist/assets/mui-CKDNpdid.css">
<link rel="stylesheet" crossorigin href="/phpCourse/exam/dist/assets/index-D83Ey19k.css"> <link rel="stylesheet" crossorigin href="/phpCourse/exam/dist/assets/index-D83Ey19k.css">
+29 -2
View File
@@ -2,6 +2,19 @@
"NotFound_user:login": "Benutzer existiert nicht", "NotFound_user:login": "Benutzer existiert nicht",
"Unauthorized_login": "Ungültige E-Mail oder Passwort", "Unauthorized_login": "Ungültige E-Mail oder Passwort",
"Unauthorized_delete": "Keine Berechtigung",
"NotFound_post:delete": "Post nicht gefunden",
"Unauthorized_userUpdate": "Keine Berechtigung",
"NotFound_user:userUpdate": "Benutzer nicht gefunden",
"FailedUpdate_userUpdate": "{{name}} konnte nicht aktualisiert werden",
"username": "Benutzername",
"email": "E-Mail",
"password": "Passwort",
"image": "Bild",
"content": "Beitrag",
"GuestBook": "Gästebuch", "GuestBook": "Gästebuch",
"Email": "E-Mail", "Email": "E-Mail",
@@ -9,14 +22,28 @@
"Email required": "E-Mail darf nicht leer sein", "Email required": "E-Mail darf nicht leer sein",
"Password required": "Passwort darf nicht leer sein", "Password required": "Passwort darf nicht leer sein",
"Username required": "Benutzername darf nicht leer sein",
"Log in": "Anmelden", "Log in": "Anmelden",
"Log out": "Abmelden", "Log out": "Abmelden",
"Profile": "Profil", "Profile": "Profil",
"Updating": "Aktualisiert", "Updating": "Aktualisiert...",
"Username": "Benutzername", "Username": "Benutzername",
"Member since": "Mitglied seit", "Member since": "Mitglied seit",
"Post count": "Anzahl Posts" "Post count": "Anzahl Posts",
"Edit": "Bearbeiten",
"Delete": "Löschen",
"Save": "Speichern",
"Cancel": "Abbrechen",
"Yes": "Ja",
"No": "Nein",
"Confirm post delete title": "Diesen Post löschen?",
"Confirm post delete body": "Möchtest du diesen Post von {{name}} wirklich Löschen?",
"Deleting": "Löscht...",
"Edit data": "Daten ändern"
} }
+30 -2
View File
@@ -2,6 +2,19 @@
"NotFound_user:login": "User does not exist", "NotFound_user:login": "User does not exist",
"Unauthorized_login": "Invalid email or password", "Unauthorized_login": "Invalid email or password",
"Unauthorized_delete": "Unauthorized",
"NotFound_post:delete": "Post not found",
"Unauthorized_userUpdate": "Unauthorized",
"NotFound_user:userUpdate": "User not found",
"FailedUpdate_userUpdate": "Failed to update {{name}}",
"username": "username",
"email": "email",
"password": "password",
"image": "image",
"content": "content",
"GuestBook": "GuestBook", "GuestBook": "GuestBook",
"Email": "Email", "Email": "Email",
@@ -9,14 +22,29 @@
"Email required": "Email required", "Email required": "Email required",
"Password required": "Password required", "Password required": "Password required",
"Username required": "Username required",
"Log in": "Log in", "Log in": "Log in",
"Log out": "Log out", "Log out": "Log out",
"Profile": "Profile", "Profile": "Profile",
"Updating": "Updating", "Updating": "Updating...",
"Username": "Username", "Username": "Username",
"Member since": "Member since", "Member since": "Member since",
"Post count": "Post count" "Post count": "Post count",
"Edit": "Edit",
"Delete": "Delete",
"Save": "Save",
"Cancel": "Cancel",
"Yes": "Yes",
"No": "No",
"Confirm post delete title": "Delete this post?",
"Confirm post delete body": "Do you really want to delete this post by {{name}}?",
"Deleting": "Deleting...",
"Edit data": "Edit date"
} }
+1 -1
View File
@@ -4822,7 +4822,7 @@ var drawChart = (function (exports) {
</script> </script>
<script> <script>
/*<!--*/ /*<!--*/
const data = {"version":2,"tree":{"name":"root","children":[{"name":"assets/zustand-Cc7ZFYQr.js","children":[{"name":"\u0000/node_modules/.pnpm/use-sync-external-store@1.2.0_react@18.3.1/node_modules/use-sync-external-store","children":[{"name":"cjs","children":[{"uid":"4ace095d-1","name":"use-sync-external-store-shim.production.min.js?commonjs-exports"},{"uid":"4ace095d-5","name":"use-sync-external-store-shim.production.min.js?commonjs-proxy"},{"name":"use-sync-external-store-shim","children":[{"uid":"4ace095d-13","name":"with-selector.production.min.js?commonjs-exports"},{"uid":"4ace095d-17","name":"with-selector.production.min.js?commonjs-proxy"}]}]},{"name":"shim","children":[{"uid":"4ace095d-7","name":"index.js?commonjs-module"},{"uid":"4ace095d-11","name":"index.js?commonjs-proxy"},{"uid":"4ace095d-19","name":"with-selector.js?commonjs-module"}]}]},{"name":"node_modules/.pnpm","children":[{"name":"use-sync-external-store@1.2.0_react@18.3.1/node_modules/use-sync-external-store","children":[{"name":"cjs","children":[{"uid":"4ace095d-3","name":"use-sync-external-store-shim.production.min.js"},{"name":"use-sync-external-store-shim/with-selector.production.min.js","uid":"4ace095d-15"}]},{"name":"shim","children":[{"uid":"4ace095d-9","name":"index.js"},{"uid":"4ace095d-21","name":"with-selector.js"}]}]},{"name":"zustand@4.5.4_@types+react@18.3.3_react@18.3.1/node_modules/zustand/esm","children":[{"uid":"4ace095d-23","name":"vanilla.mjs"},{"uid":"4ace095d-25","name":"index.mjs"}]}]}]},{"name":"assets/index-DRZup-fm.js","children":[{"name":"\u0000vite/modulepreload-polyfill.js","uid":"4ace095d-27"},{"name":"\u0000/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/client.js?commonjs-exports","uid":"4ace095d-29"},{"name":"node_modules/.pnpm","children":[{"name":"react-dom@18.3.1_react@18.3.1/node_modules/react-dom/client.js","uid":"4ace095d-31"},{"name":"@fontsource+roboto@5.0.13/node_modules/@fontsource/roboto","children":[{"uid":"4ace095d-65","name":"300.css"},{"uid":"4ace095d-67","name":"400.css"},{"uid":"4ace095d-69","name":"500.css"},{"uid":"4ace095d-71","name":"700.css"}]}]},{"name":"src","children":[{"name":"api/Api.ts","uid":"4ace095d-33"},{"uid":"4ace095d-35","name":"i18n.ts"},{"name":"components","children":[{"name":"Menus","children":[{"name":"Language/LanguageMenu.tsx","uid":"4ace095d-37"},{"name":"User/UserMenu.tsx","uid":"4ace095d-45"}]},{"name":"Forms/Login/LoginForm.tsx","uid":"4ace095d-43"},{"name":"Header/Header.tsx","uid":"4ace095d-47"},{"name":"Post/Post.tsx","uid":"4ace095d-53"},{"name":"Profile/Profile.tsx","uid":"4ace095d-57"}]},{"name":"types/Routes.ts","uid":"4ace095d-39"},{"name":"utils","children":[{"uid":"4ace095d-41","name":"errors.ts"},{"uid":"4ace095d-51","name":"date.ts"}]},{"name":"routes","children":[{"uid":"4ace095d-49","name":"__root.tsx"},{"uid":"4ace095d-55","name":"index.tsx"},{"name":"profile","children":[{"uid":"4ace095d-59","name":"index.tsx"},{"uid":"4ace095d-61","name":"$id.tsx"}]}]},{"uid":"4ace095d-63","name":"routeTree.gen.ts"},{"uid":"4ace095d-73","name":"main.tsx"}]},{"uid":"4ace095d-75","name":"index.html"}]},{"name":"assets/i18n-DJgSTqOl.js","children":[{"name":"node_modules/.pnpm","children":[{"name":"void-elements@3.1.0/node_modules/void-elements/index.js","uid":"4ace095d-77"},{"name":"html-parse-stringify@3.0.1/node_modules/html-parse-stringify/dist/html-parse-stringify.module.js","uid":"4ace095d-79"},{"name":"react-i18next@15.0.0_i18next@23.12.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-i18next/dist/es","children":[{"uid":"4ace095d-81","name":"utils.js"},{"uid":"4ace095d-83","name":"unescape.js"},{"uid":"4ace095d-85","name":"defaults.js"},{"uid":"4ace095d-87","name":"i18nInstance.js"},{"uid":"4ace095d-89","name":"TransWithoutContext.js"},{"uid":"4ace095d-91","name":"initReactI18next.js"},{"uid":"4ace095d-93","name":"context.js"},{"uid":"4ace095d-95","name":"Trans.js"},{"uid":"4ace095d-97","name":"useTranslation.js"},{"uid":"4ace095d-99","name":"withTranslation.js"},{"uid":"4ace095d-101","name":"Translation.js"},{"uid":"4ace095d-103","name":"I18nextProvider.js"},{"uid":"4ace095d-105","name":"useSSR.js"},{"uid":"4ace095d-107","name":"withSSR.js"},{"uid":"4ace095d-109","name":"index.js"}]},{"name":"i18next@23.12.2/node_modules/i18next/dist/esm/i18next.js","uid":"4ace095d-111"},{"name":"i18next-browser-languagedetector@8.0.0/node_modules/i18next-browser-languagedetector/dist/esm/i18nextBrowserLanguageDetector.js","uid":"4ace095d-113"},{"name":"i18next-http-backend@2.5.2/node_modules/i18next-http-backend/esm","children":[{"uid":"4ace095d-115","name":"utils.js"},{"uid":"4ace095d-125","name":"getFetch.cjs"},{"uid":"4ace095d-127","name":"request.js"},{"uid":"4ace095d-129","name":"index.js"}]},{"name":"cross-fetch@4.0.0/node_modules/cross-fetch/dist/browser-ponyfill.js","uid":"4ace095d-123"}]},{"uid":"4ace095d-117","name":"\u0000commonjs-dynamic-modules"},{"name":"\u0000/node_modules/.pnpm","children":[{"name":"i18nextLine truncated const data = {"version":2,"tree":{"name":"root","children":[{"name":"assets/zustand-Cc7ZFYQr.js","children":[{"name":"\u0000/node_modules/.pnpm/use-sync-external-store@1.2.0_react@18.3.1/node_modules/use-sync-external-store","children":[{"name":"cjs","children":[{"uid":"58c2885d-1","name":"use-sync-external-store-shim.production.min.js?commonjs-exports"},{"uid":"58c2885d-5","name":"use-sync-external-store-shim.production.min.js?commonjs-proxy"},{"name":"use-sync-external-store-shim","children":[{"uid":"58c2885d-13","name":"with-selector.production.min.js?commonjs-exports"},{"uid":"58c2885d-17","name":"with-selector.production.min.js?commonjs-proxy"}]}]},{"name":"shim","children":[{"uid":"58c2885d-7","name":"index.js?commonjs-module"},{"uid":"58c2885d-11","name":"index.js?commonjs-proxy"},{"uid":"58c2885d-19","name":"with-selector.js?commonjs-module"}]}]},{"name":"node_modules/.pnpm","children":[{"name":"use-sync-external-store@1.2.0_react@18.3.1/node_modules/use-sync-external-store","children":[{"name":"cjs","children":[{"uid":"58c2885d-3","name":"use-sync-external-store-shim.production.min.js"},{"name":"use-sync-external-store-shim/with-selector.production.min.js","uid":"58c2885d-15"}]},{"name":"shim","children":[{"uid":"58c2885d-9","name":"index.js"},{"uid":"58c2885d-21","name":"with-selector.js"}]}]},{"name":"zustand@4.5.4_@types+react@18.3.3_react@18.3.1/node_modules/zustand/esm","children":[{"uid":"58c2885d-23","name":"vanilla.mjs"},{"uid":"58c2885d-25","name":"index.mjs"}]}]}]},{"name":"assets/index-CmwTmvyQ.js","children":[{"name":"\u0000vite/modulepreload-polyfill.js","uid":"58c2885d-27"},{"name":"\u0000/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/client.js?commonjs-exports","uid":"58c2885d-29"},{"name":"node_modules/.pnpm","children":[{"name":"react-dom@18.3.1_react@18.3.1/node_modules/react-dom/client.js","uid":"58c2885d-31"},{"name":"@fontsource+roboto@5.0.13/node_modules/@fontsource/roboto","children":[{"uid":"58c2885d-73","name":"300.css"},{"uid":"58c2885d-75","name":"400.css"},{"uid":"58c2885d-77","name":"500.css"},{"uid":"58c2885d-79","name":"700.css"}]}]},{"name":"src","children":[{"name":"api/Api.ts","uid":"58c2885d-33"},{"name":"components","children":[{"name":"Error","children":[{"uid":"58c2885d-35","name":"Errors.ts"},{"uid":"58c2885d-43","name":"ErrorComponent.tsx"}]},{"name":"Menus","children":[{"name":"Language/LanguageMenu.tsx","uid":"58c2885d-39"},{"name":"User/UserMenu.tsx","uid":"58c2885d-47"}]},{"name":"Forms","children":[{"name":"Login/LoginForm.tsx","uid":"58c2885d-45"},{"name":"UserEdit/UserEditDialog.tsx","uid":"58c2885d-61"}]},{"name":"Header/Header.tsx","uid":"58c2885d-49"},{"name":"Post/Post.tsx","uid":"58c2885d-55"},{"name":"Profile/Profile.tsx","uid":"58c2885d-63"}]},{"uid":"58c2885d-37","name":"i18n.ts"},{"name":"types/Routes.ts","uid":"58c2885d-41"},{"name":"routes","children":[{"uid":"58c2885d-51","name":"__root.tsx"},{"uid":"58c2885d-59","name":"index.tsx"},{"name":"profile","children":[{"uid":"58c2885d-67","name":"index.tsx"},{"uid":"58c2885d-69","name":"$id.tsx"}]}]},{"name":"utils/date.ts","uid":"58c2885d-53"},{"name":"queries","children":[{"uid":"58c2885d-57","name":"postsQuery.ts"},{"uid":"58c2885d-65","name":"profileQuery.ts"}]},{"uid":"58c2885d-71","name":"routeTree.gen.ts"},{"uid":"58c2885d-81","name":"main.tsx"}]},{"uid":"58c2885d-83","name":"index.html"}]},{"name":"assets/i18n-DJgSTqOl.js","children":[{"name":"node_modules/.pnpm","children":[{"name":"void-elements@3.1.0/node_modules/void-elements/index.js","uid":"58c2885d-85"},{"name":"html-parse-stringify@3.0.1/node_modules/html-parse-stringify/dist/html-parse-stringify.module.js","uid":"58c2885d-87"},{"name":"react-i18next@15.0.0_i18next@23.12.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-i18next/dist/es","children":[{"uid":"58c2885d-89","name":"utils.js"},{"uid":"58c2885d-91","name":"unescape.js"},{"uid":"58c2885d-93","name":"defaults.js"},{"uid":"58c2885d-95","name":"i18nInstance.js"},{"uid":"58c2885d-97","name":"TransWithoutContext.js"},{"uid":"58c2885d-99","name":"initReactI18next.js"},{"uid":"58c2885d-101","name":"context.js"},{"uid":"58c2885d-103","name":"Trans.js"},{"uid":"58c2885d-105","name":"useTranslation.js"},{"uid":"58c2885d-107","name":"withTranslation.js"},{"uid":"58c2885d-109","name":"Translation.js"},{"uid":"58c2885d-111","name":"I18nextProvider.js"},{"uid":"58c2885d-113","name":"useSSR.js"},{"uid":"58c2885d-115","name":"withSSR.js"},{"uid":"58c2885d-117","name":"index.js"}]},{"name":"i18next@23.12.2/node_modules/i18next/dist/esm/i18next.js","uid":"58c2885d-119"},{"name":"i18next-browser-languagedetector@8.0.0/node_modules/i18next-browser-languagedetector/dist/esm/i18nextBrowserLanguageDetector.js","uid":"58c2885d-121"},{"name":"i18next-http-backend@2.5.2/node_modules/i18next-http-backend/esm","children":[{"uid":"58c2885d-123","name":"utils.js"},{"uid":"58c2885d-133","name":"getFetch.cjs"},{"uid":"58c2885d-135","name":"request.js"},{"uidLine truncated
const run = () => { const run = () => {
const width = window.innerWidth; const width = window.innerWidth;
+3 -5
View File
@@ -5,14 +5,12 @@ module.exports = {
'eslint:recommended', 'eslint:recommended',
'plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended', 'plugin:react-hooks/recommended',
'plugin:@tanstack/eslint-plugin-query/recommended',
], ],
ignorePatterns: ['dist', '.eslintrc.cjs'], ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser', parser: '@typescript-eslint/parser',
plugins: ['react-refresh'], plugins: ['react-refresh'],
rules: { rules: {
'react-refresh/only-export-components': [ 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
'warn',
{ allowConstantExport: true },
],
}, },
} };
+19 -2
View File
@@ -1,9 +1,20 @@
{ {
"NotFound_user:login": "Benutzer existiert nicht", "NotFound_user:login": "Benutzer existiert nicht",
"Unauthorized_login": "Ungültige E-Mail oder Passwort", "Unauthorized_login": "Ungültige E-Mail oder Passwort",
"Unauthorized_delete": "Keine Berechtigung", "Unauthorized_delete": "Keine Berechtigung",
"NotFound_post:delete": "Post nicht gefunden", "NotFound_post:delete": "Post nicht gefunden",
"Unauthorized_userUpdate": "Keine Berechtigung",
"NotFound_user:userUpdate": "Benutzer nicht gefunden",
"FailedUpdate_userUpdate": "{{name}} konnte nicht aktualisiert werden",
"username": "Benutzername",
"email": "E-Mail",
"password": "Passwort",
"image": "Bild",
"content": "Beitrag",
"GuestBook": "Gästebuch", "GuestBook": "Gästebuch",
"Email": "E-Mail", "Email": "E-Mail",
@@ -11,12 +22,13 @@
"Email required": "E-Mail darf nicht leer sein", "Email required": "E-Mail darf nicht leer sein",
"Password required": "Passwort darf nicht leer sein", "Password required": "Passwort darf nicht leer sein",
"Username required": "Benutzername darf nicht leer sein",
"Log in": "Anmelden", "Log in": "Anmelden",
"Log out": "Abmelden", "Log out": "Abmelden",
"Profile": "Profil", "Profile": "Profil",
"Updating": "Aktualisiert", "Updating": "Aktualisiert...",
"Username": "Benutzername", "Username": "Benutzername",
"Member since": "Mitglied seit", "Member since": "Mitglied seit",
@@ -24,9 +36,14 @@
"Edit": "Bearbeiten", "Edit": "Bearbeiten",
"Delete": "Löschen", "Delete": "Löschen",
"Save": "Speichern",
"Cancel": "Abbrechen",
"Yes": "Ja", "Yes": "Ja",
"No": "Nein", "No": "Nein",
"Confirm post delete title": "Diesen Post löschen?", "Confirm post delete title": "Diesen Post löschen?",
"Confirm post delete body": "Möchtest du diesen Post von {{name}} wirklich Löschen?" "Confirm post delete body": "Möchtest du diesen Post von {{name}} wirklich Löschen?",
"Deleting": "Löscht...",
"Edit data": "Daten ändern"
} }
+19 -2
View File
@@ -5,6 +5,16 @@
"Unauthorized_delete": "Unauthorized", "Unauthorized_delete": "Unauthorized",
"NotFound_post:delete": "Post not found", "NotFound_post:delete": "Post not found",
"Unauthorized_userUpdate": "Unauthorized",
"NotFound_user:userUpdate": "User not found",
"FailedUpdate_userUpdate": "Failed to update {{name}}",
"username": "username",
"email": "email",
"password": "password",
"image": "image",
"content": "content",
"GuestBook": "GuestBook", "GuestBook": "GuestBook",
"Email": "Email", "Email": "Email",
@@ -12,12 +22,13 @@
"Email required": "Email required", "Email required": "Email required",
"Password required": "Password required", "Password required": "Password required",
"Username required": "Username required",
"Log in": "Log in", "Log in": "Log in",
"Log out": "Log out", "Log out": "Log out",
"Profile": "Profile", "Profile": "Profile",
"Updating": "Updating", "Updating": "Updating...",
"Username": "Username", "Username": "Username",
"Member since": "Member since", "Member since": "Member since",
@@ -25,9 +36,15 @@
"Edit": "Edit", "Edit": "Edit",
"Delete": "Delete", "Delete": "Delete",
"Save": "Save",
"Cancel": "Cancel",
"Yes": "Yes", "Yes": "Yes",
"No": "No", "No": "No",
"Confirm post delete title": "Delete this post?", "Confirm post delete title": "Delete this post?",
"Confirm post delete body": "Do you really want to delete this post by {{name}}?" "Confirm post delete body": "Do you really want to delete this post by {{name}}?",
"Deleting": "Deleting...",
"Edit data": "Edit date"
} }
+17 -1
View File
@@ -1,5 +1,5 @@
import { PostAuth, PostListAuth, PostListNonAuth } from '../types/Post'; import { PostAuth, PostListAuth, PostListNonAuth } from '../types/Post';
import { User } from '../types/User'; import { User, UserUpdate } from '../types/User';
const BASE = 'https://khofmann.userpage.fu-berlin.de/phpCourse/exam/api/'; const BASE = 'https://khofmann.userpage.fu-berlin.de/phpCourse/exam/api/';
@@ -20,6 +20,7 @@ class ApiImpl {
} }
public hasAuth = () => this.token !== undefined; public hasAuth = () => this.token !== undefined;
//FIXME: TESTING
public isAdmin = () => this.hasAuth() && this.self?.isAdmin; public isAdmin = () => this.hasAuth() && this.self?.isAdmin;
public getAuthenticatedUser = () => this.self; public getAuthenticatedUser = () => this.self;
public getCurrentSession = () => [this.token, this.refreshToken]; public getCurrentSession = () => [this.token, this.refreshToken];
@@ -57,6 +58,10 @@ class ApiImpl {
return await (await this.getAuth(`users/${id ?? this.self?.id}`)).json(); return await (await this.getAuth(`users/${id ?? this.self?.id}`)).json();
}; };
public updateUser = async (data: UserUpdate, id?: number): Promise<User> => {
return await (await this.patch(`users/${id ?? 'self'}`, data as Record<string, unknown>)).json();
};
/* Internal */ /* Internal */
private post = async (endpoint: string, body?: Record<string, unknown>, headers?: HeadersInit) => { private post = async (endpoint: string, body?: Record<string, unknown>, headers?: HeadersInit) => {
@@ -110,6 +115,17 @@ class ApiImpl {
if (response.ok) return response; if (response.ok) return response;
throw await response.json(); throw await response.json();
}; };
private patch = async (endpoint: string, body?: Record<string, unknown>, headers?: HeadersInit) => {
const response = await fetch(`${BASE}${endpoint}`, {
mode: 'cors',
method: 'patch',
headers: { token: this.token ?? '', ...headers },
body: JSON.stringify(body),
});
if (response.ok) return response;
throw await response.json();
};
} }
const Api = new ApiImpl(); const Api = new ApiImpl();
@@ -0,0 +1,35 @@
import { Typography } from '@mui/material';
import { FC } from 'react';
import { useTranslation } from 'react-i18next';
import { ERRORS } from './Errors';
interface Props {
//eslint-disable-next-line @typescript-eslint/no-explicit-any
error: any;
context?: string;
}
const ErrorComponent: FC<Props> = ({ error, context }) => {
const { t } = useTranslation();
if (!error) return null;
if (error.code) {
switch (error.code) {
case ERRORS.NOT_FOUND:
return <Typography color="error.main">{t(error.code, { context: `${error.entity}:${context}` })}</Typography>;
case ERRORS.UNAUTHORIZED:
return <Typography color="error.main">{t(error.code, { context })}</Typography>;
case ERRORS.FAILEDUPDATE:
return error.fields.map((field: string) => (
<Typography key={`error_${field}`} color="error.main">
{t(error.code, { context, name: t(field) })}
</Typography>
));
}
}
return <Typography color="error.main">{t(error?.message ?? 'Unknown', { context })}</Typography>;
};
export default ErrorComponent;
@@ -0,0 +1,5 @@
export enum ERRORS {
NOT_FOUND = 'NotFound',
UNAUTHORIZED = 'Unauthorized',
FAILEDUPDATE = 'FailedUpdate',
}
@@ -1,10 +1,10 @@
import { Box, Button, TextField, Typography } from '@mui/material'; import { Box, Button, TextField } from '@mui/material';
import { useForm } from '@tanstack/react-form'; import { useForm } from '@tanstack/react-form';
import { useRouter } from '@tanstack/react-router'; import { useRouter } from '@tanstack/react-router';
import { FC, useState } from 'react'; import { FC, useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import Api from '../../../api/Api'; import Api from '../../../api/Api';
import handleError from '../../../utils/errors'; import ErrorComponent from '../../Error/ErrorComponent';
interface Props { interface Props {
handleClose: () => void; handleClose: () => void;
@@ -119,7 +119,7 @@ const LoginForm: FC<Props> = ({ handleClose }) => {
</> </>
)} )}
/> />
{error && <Typography color="error.main">{handleError(error, t, 'login')}</Typography>} {error && <ErrorComponent error={error} context="login" />}
</Box> </Box>
</form> </form>
); );
@@ -0,0 +1,160 @@
import {
Button,
CircularProgress,
Dialog,
DialogActions,
DialogContent,
DialogTitle,
TextField,
useMediaQuery,
useTheme,
} from '@mui/material';
import { useForm } from '@tanstack/react-form';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { t } from 'i18next';
import { FC, FormEvent, useState } from 'react';
import Api from '../../../api/Api';
import { User, UserUpdate } from '../../../types/User';
import ErrorComponent from '../../Error/ErrorComponent';
interface Props {
user: User;
open: boolean;
onClose: () => void;
}
const UserEditDialog: FC<Props> = ({ user, open, onClose }) => {
//eslint-disable-next-line @typescript-eslint/no-explicit-any
const [error, setError] = useState<any>();
const updateMutation = useMutation({
mutationFn: ({ data, id }: { data: UserUpdate; id?: number }) => {
return Api.updateUser(data, id);
},
});
const form = useForm<UserUpdate>({
defaultValues: {
username: user.username,
},
onSubmit: async ({ value }) => {
try {
updateMutation.mutate(
{ data: value, id: Api.getAuthenticatedUser()?.id === user.id ? undefined : user.id },
{
onSuccess: () => {
handleClose();
const queryKey = Api.getAuthenticatedUser()?.id === user.id ? ['profile'] : ['profile', { id: user.id }];
queryClient.invalidateQueries({ queryKey });
},
onError: setError,
}
);
//eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: any) {
setError(error);
}
},
});
const theme = useTheme();
const fullScreen = useMediaQuery(theme.breakpoints.only('xs'), { noSsr: true });
const queryClient = useQueryClient();
const handleClose = () => {
form.reset();
onClose();
};
return (
<Dialog
open={open}
onClose={handleClose}
fullWidth
fullScreen={fullScreen}
PaperProps={{
component: 'form',
onSubmit: (e: FormEvent<HTMLFormElement>) => {
e.preventDefault();
e.stopPropagation();
form.handleSubmit();
},
onKeyDown: (event: React.KeyboardEvent<HTMLFormElement>) => {
if (event.key === 'Tab') {
event.stopPropagation();
}
},
noValidate: true,
}}
>
<DialogTitle>{t('Edit data')}</DialogTitle>
<DialogContent>
<form.Field
name="username"
validators={{
onChange: ({ value }) => (!value ? t('Username required') : undefined),
onChangeAsyncDebounceMs: 250,
onChangeAsync: async ({ value }) => {
return !value && t('Username required');
},
}}
children={(field) => {
return (
<>
<TextField
name={field.name}
value={field.state.value}
onBlur={field.handleBlur}
onChange={(e) => field.handleChange(e.target.value)}
size="small"
label={t('Username')}
required
margin="dense"
autoComplete="new-username"
fullWidth
error={field.state.meta.isTouched && field.state.meta.errors.length > 0}
helperText={field.state.meta.isTouched ? field.state.meta.errors.join(',') : ''}
/>
</>
);
}}
/>
</DialogContent>
<DialogActions>
<form.Subscribe
selector={(state) => [state.canSubmit, state.isSubmitting]}
children={([canSubmit]) => (
<>
<Button
variant="outlined"
onClick={() => {
handleClose();
}}
>
{t('Cancel')}
</Button>
<Button
type="submit"
disabled={!canSubmit || updateMutation.isPending}
autoFocus
variant="contained"
endIcon={updateMutation.isPending && <CircularProgress color="inherit" size="20px" />}
>
{t('Save')}
</Button>
</>
)}
/>
</DialogActions>
{error && (
<DialogContent>
<ErrorComponent error={error} context="userUpdate" />
</DialogContent>
)}
</Dialog>
);
};
export default UserEditDialog;
Whitespace-only changes.
+14 -5
View File
@@ -16,27 +16,29 @@ import {
Snackbar, Snackbar,
Typography, Typography,
} from '@mui/material'; } from '@mui/material';
import { useMutation } from '@tanstack/react-query'; import { useMutation, useQueryClient } from '@tanstack/react-query';
import { Link } from '@tanstack/react-router'; import { Link } from '@tanstack/react-router';
import { FC, useState } from 'react'; import { FC, useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import Api from '../../api/Api'; import Api from '../../api/Api';
import { PostAuth, PostNonAuth } from '../../types/Post'; import { PostAuth, PostNonAuth } from '../../types/Post';
import convertDate from '../../utils/date'; import convertDate from '../../utils/date';
import handleError from '../../utils/errors'; import ErrorComponent from '../Error/ErrorComponent';
interface Props { interface Props {
post: PostNonAuth | PostAuth; post: PostNonAuth | PostAuth;
} }
const Post: FC<Props> = ({ post }) => { const Post: FC<Props> = ({ post }) => {
const [open, setOpen] = useState(false);
const deleteMutation = useMutation({ const deleteMutation = useMutation({
mutationFn: (id: number) => { mutationFn: (id: number) => {
return Api.deletePost(id); return Api.deletePost(id);
}, },
}); });
const [open, setOpen] = useState(false); const queryClient = useQueryClient();
const { t } = useTranslation(); const { t } = useTranslation();
@@ -104,7 +106,13 @@ const Post: FC<Props> = ({ post }) => {
variant="outlined" variant="outlined"
color="error" color="error"
onClick={() => { onClick={() => {
deleteMutation.mutate(post.id); deleteMutation.mutate(post.id, {
onSuccess: () => {
queryClient.invalidateQueries({
queryKey: ['posts'],
});
},
});
setOpen(false); setOpen(false);
}} }}
> >
@@ -117,9 +125,10 @@ const Post: FC<Props> = ({ post }) => {
</CardActions> </CardActions>
<Snackbar open={deleteMutation.isError} autoHideDuration={2000} onClose={() => deleteMutation.reset()}> <Snackbar open={deleteMutation.isError} autoHideDuration={2000} onClose={() => deleteMutation.reset()}>
<Alert severity="error" variant="filled" sx={{ width: '100%' }}> <Alert severity="error" variant="filled" sx={{ width: '100%' }}>
{deleteMutation.isError && handleError(deleteMutation.error, t, 'delete')} {deleteMutation.isError && <ErrorComponent error={deleteMutation.error} context="delete" />}
</Alert> </Alert>
</Snackbar> </Snackbar>
<Snackbar open={deleteMutation.isPending} message={t('Deleting')} />
</Card> </Card>
); );
}; };
+12 -2
View File
@@ -1,9 +1,10 @@
import { Person } from '@mui/icons-material'; import { Person } from '@mui/icons-material';
import { Avatar, Box, Button, Card, CardActions, CardContent, Grid, Typography } from '@mui/material'; import { Avatar, Box, Button, Card, CardActions, CardContent, Grid, Typography } from '@mui/material';
import { FC } from 'react'; import { FC, useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { User } from '../../types/User'; import { User } from '../../types/User';
import convertDate from '../../utils/date'; import convertDate from '../../utils/date';
import UserEditDialog from '../Forms/UserEdit/UserEditDialog';
interface Props { interface Props {
user: User; user: User;
@@ -11,6 +12,8 @@ interface Props {
} }
const Profile: FC<Props> = ({ user, canEdit }) => { const Profile: FC<Props> = ({ user, canEdit }) => {
const [editOpen, setEditOpen] = useState(false);
const { t } = useTranslation(); const { t } = useTranslation();
return ( return (
@@ -36,7 +39,14 @@ const Profile: FC<Props> = ({ user, canEdit }) => {
</Grid> </Grid>
</Grid> </Grid>
</CardContent> </CardContent>
<CardActions>{canEdit && <Button size="small">{t('Edit')}</Button>}</CardActions> <CardActions>
{canEdit && (
<Button size="small" onClick={() => setEditOpen(true)}>
{t('Edit')}
</Button>
)}
</CardActions>
<UserEditDialog user={user} open={editOpen} onClose={() => setEditOpen(false)} />
</Card> </Card>
); );
}; };
+8
View File
@@ -0,0 +1,8 @@
import { queryOptions } from '@tanstack/react-query';
import Api from '../api/Api';
export const postsQueryOptions = (page?: number) =>
queryOptions({
queryKey: ['posts', { page: page ?? 0, hasAuth: Api.hasAuth() }],
queryFn: () => Api.posts(page),
});
+13
View File
@@ -0,0 +1,13 @@
import { queryOptions } from '@tanstack/react-query';
import Api from '../api/Api';
export const profileSelfQueryOptions = queryOptions({
queryKey: ['profile'],
queryFn: () => Api.user(),
});
export const profileQueryOptions = (id?: number) =>
queryOptions({
queryKey: ['profile', { id }],
queryFn: () => Api.user(id),
});
+1 -1
View File
@@ -4,9 +4,9 @@ import { createRootRouteWithContext, ErrorRouteComponent, Outlet, redirect, useR
import { TanStackRouterDevtools } from '@tanstack/router-devtools'; import { TanStackRouterDevtools } from '@tanstack/router-devtools';
import { useEffect } from 'react'; import { useEffect } from 'react';
import Api from '../api/Api'; import Api from '../api/Api';
import { ERRORS } from '../components/Error/Errors';
import Header from '../components/Header/Header'; import Header from '../components/Header/Header';
import { ROUTES } from '../types/Routes'; import { ROUTES } from '../types/Routes';
import { ERRORS } from '../utils/errors';
const Root = () => { const Root = () => {
//TODO: REAUTH HERE //TODO: REAUTH HERE
+2 -8
View File
@@ -1,17 +1,11 @@
import { Grid, Pagination, PaginationItem, Snackbar } from '@mui/material'; import { Grid, Pagination, PaginationItem, Snackbar } from '@mui/material';
import { queryOptions, useSuspenseQuery } from '@tanstack/react-query'; import { useSuspenseQuery } from '@tanstack/react-query';
import { createFileRoute, Link } from '@tanstack/react-router'; import { createFileRoute, Link } from '@tanstack/react-router';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import Api from '../api/Api';
import Post from '../components/Post/Post'; import Post from '../components/Post/Post';
import { postsQueryOptions } from '../queries/postsQuery';
import { ROUTES } from '../types/Routes'; import { ROUTES } from '../types/Routes';
const postsQueryOptions = (page?: number) =>
queryOptions({
queryKey: ['posts', { page: page ?? 0, hasAuth: Api.hasAuth() }],
queryFn: () => Api.posts(page),
});
const Home = () => { const Home = () => {
const { page } = Route.useSearch(); const { page } = Route.useSearch();
const { data: postsQuery, isFetching } = useSuspenseQuery(postsQueryOptions(page)); const { data: postsQuery, isFetching } = useSuspenseQuery(postsQueryOptions(page));
+2 -7
View File
@@ -1,17 +1,12 @@
import { Snackbar } from '@mui/material'; import { Snackbar } from '@mui/material';
import { queryOptions, useSuspenseQuery } from '@tanstack/react-query'; import { useSuspenseQuery } from '@tanstack/react-query';
import { createFileRoute, redirect } from '@tanstack/react-router'; import { createFileRoute, redirect } from '@tanstack/react-router';
import { t } from 'i18next'; import { t } from 'i18next';
import Api from '../../api/Api'; import Api from '../../api/Api';
import Profile from '../../components/Profile/Profile'; import Profile from '../../components/Profile/Profile';
import { profileQueryOptions } from '../../queries/profileQuery';
import { ROUTES } from '../../types/Routes'; import { ROUTES } from '../../types/Routes';
const profileQueryOptions = (id?: number) =>
queryOptions({
queryKey: ['profile', { id }],
queryFn: () => Api.user(id),
});
const ProfilePage = () => { const ProfilePage = () => {
const { id } = Route.useParams(); const { id } = Route.useParams();
const { data: profileQuery, isFetching } = useSuspenseQuery(profileQueryOptions(id)); const { data: profileQuery, isFetching } = useSuspenseQuery(profileQueryOptions(id));
+4 -8
View File
@@ -1,18 +1,14 @@
import { Snackbar } from '@mui/material'; import { Snackbar } from '@mui/material';
import { queryOptions, useSuspenseQuery } from '@tanstack/react-query'; import { useSuspenseQuery } from '@tanstack/react-query';
import { createFileRoute, redirect } from '@tanstack/react-router'; import { createFileRoute, redirect } from '@tanstack/react-router';
import { t } from 'i18next'; import { t } from 'i18next';
import Api from '../../api/Api'; import Api from '../../api/Api';
import Profile from '../../components/Profile/Profile'; import Profile from '../../components/Profile/Profile';
import { profileSelfQueryOptions } from '../../queries/profileQuery';
import { ROUTES } from '../../types/Routes'; import { ROUTES } from '../../types/Routes';
const profileQueryOptions = queryOptions({
queryKey: ['profile'],
queryFn: () => Api.user(),
});
const ProfilePage = () => { const ProfilePage = () => {
const { data: profileQuery, isFetching } = useSuspenseQuery(profileQueryOptions); const { data: profileQuery, isFetching } = useSuspenseQuery(profileSelfQueryOptions);
return ( return (
<> <>
@@ -23,7 +19,7 @@ const ProfilePage = () => {
}; };
export const Route = createFileRoute(`${ROUTES.PROFILE}/`)({ export const Route = createFileRoute(`${ROUTES.PROFILE}/`)({
loader: ({ context: { queryClient } }) => queryClient.ensureQueryData(profileQueryOptions), loader: ({ context: { queryClient } }) => queryClient.ensureQueryData(profileSelfQueryOptions),
beforeLoad: () => { beforeLoad: () => {
if (!Api.hasAuth()) throw redirect({ to: ROUTES.INDEX }); if (!Api.hasAuth()) throw redirect({ to: ROUTES.INDEX });
}, },
+6
View File
@@ -10,3 +10,9 @@ export interface User {
memberSince: Timestamp; memberSince: Timestamp;
postCount: number; postCount: number;
} }
export interface UserUpdate {
username?: string;
email?: string;
password?: string;
}
-39
View File
@@ -1,39 +0,0 @@
import { TFunction } from 'i18next';
export enum ERRORS {
NOT_FOUND = 'NotFound',
UNAUTHORIZED = 'Unauthorized',
}
/**
* Return translated error
* @param error Error object
* @param context Optional context
* @param t Optional translation function, defautls to pass through
* @returns Translated error or inputs if t as unspecified
*/
const handleError = (
//eslint-disable-next-line @typescript-eslint/no-explicit-any
error: any,
//eslint-disable-next-line @typescript-eslint/no-explicit-any
t: TFunction<'translation', undefined> | ((..._in: any) => any) = (..._in: any) => _in,
context?: string
): string => {
console.log(context);
if (!error) return t('', {});
if (error.code) {
switch (error.code) {
case ERRORS.NOT_FOUND:
return t(error.code, { context: `${error.entity}:${context}` });
case ERRORS.UNAUTHORIZED:
return t(error.code, { context });
default:
return t('Unknown', { context });
}
}
return t(error?.message ?? 'Unknown', { context });
};
export default handleError;