Move react over

This commit is contained in:
Kilian committed 2024-07-22 02:50:28 +02:00
1 parent 2168e37413
commit 3e22aaf30c
54 files changed
+9080 -615

No files matched your search

View File
File renamed without changes.
View File
File renamed without changes.
+9052
View File
File diff suppressed because it is too large. Load diff
File renamed without changes.
File renamed without changes.
+26 -5
View File
@@ -1,5 +1,26 @@
<h1>Redirect to React</h1>
<form action="/phpCourse/exam/api/user/1" enctype="multipart/form-data" method="POST">
<input type="file" name="image" />
<input type="submit">Send</input>
</form>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link
rel="icon"
type="image/svg+xml"
href="/phpCourse/exam/dist/vite.svg"
/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<script
type="module"
crossorigin
src="/phpCourse/exam/dist/assets/index-D81sf-ye.js"
></script>
<link
rel="stylesheet"
crossorigin
href="/phpCourse/exam/dist/assets/index-DiwrgTda.css"
/>
</head>
<body>
<div id="root"></div>
</body>
</html>
View File
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -5,7 +5,7 @@ import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
build: {
outDir: '../pages',
outDir: '../dist',
},
base: 'phpCourse/exam/pages',
base: 'phpCourse/exam/dist',
});
-37
View File
@@ -1,37 +0,0 @@
RewriteEngine On
##
## You may need to uncomment the following line for some hosting environments,
## if you have installed to a subdirectory, enter the name here also.
##
RewriteBase /phpCourse/exam
##
## Black listed folders
##
RewriteRule ^phpCourse/exam/app/.* index.php [L,NC]
RewriteRule ^phpCourse/exam/config/.* index.php [L,NC]
RewriteRule ^phpCourse/exam/vendor/.* index.php [L,NC]
RewriteRule ^phpCourse/exam/routes/.* index.php [L,NC]
##
## White listed folders
##
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} !/api/docs/.*
RewriteCond %{REQUEST_FILENAME} !/pages/.*
RewriteCond %{REQUEST_FILENAME} !/pages/assets/.*
RewriteRule !^index.php index.php [L,NC]
##
## Block all PHP files, except index
##
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} \.php$
RewriteRule !^index.php index.php [L,NC]
##
## Standard routes
##
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
-2
View File
@@ -1,2 +0,0 @@
Order deny,allow
Allow from All
-114
View File
@@ -1,114 +0,0 @@
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:
/users:
get:
summary: Get Users
description: Returns all users
parameters: []
operationId: ""
responses:
"200":
description: Default response
content:
application/json:
schema:
$ref: "#/components/schemas/UsersListResponse"
"401":
description: Not allowed
tags:
- Users
security:
- BasicAuth: []
put:
summary: Add User
description: Add a new user
parameters: []
operationId: ""
responses:
"200":
description: Default response
content:
application/json:
schema:
$ref: "#/components/schemas/TrueResponse"
"401":
description: Not allowed
"500":
description: Error
tags:
- Users
security:
- BasicAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/UserAddBody"
externalDocs:
url: "https://khofmann.userpage.fu-berlin.de/phpCourse/exam/api/docs/"
security: []
servers:
- url: "https://khofmann.userpage.fu-berlin.de/phpCourse/exam/api/"
description: ""
variables: {}
components:
links: {}
callbacks: {}
schemas:
UsersListResponse:
type: array
items:
$ref: "#/components/schemas/UserType"
UserType:
type: object
properties:
ID:
type: number
description: User ID
example: 1
FirstName:
type: string
description: Given name of user
example: Max
LastName:
type: string
description: Family name of User
example: Mustermann
token:
type: string
description: Access Token
format: uuid
example: 3be6453c-03eb-4357-ae5a-984a0e574a54
UserAddBody:
type: object
required:
- FirstName
- LastName
properties:
FirstName:
type: string
description: Given name of user
example: Max
LastName:
type: string
description: Family name of User
example: Mustermann
TrueResponse:
type: boolean
example: true
securitySchemes:
BasicAuth:
type: apiKey
name: token
in: header
tags:
- name: Users
- name: Posts
View File
Whitespace-only changes.
-10
View File
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link href="./index.css" rel="stylesheet" />
<title>API Docs</title>
</head>
<body></body>
</html>
-3
View File
@@ -1,3 +0,0 @@
<?php
Headers::redirect("docs/index.html");
-26
View File
@@ -1,26 +0,0 @@
<?php
$method = $_SERVER['REQUEST_METHOD'];
switch ($method) {
case "GET":
return get();
default:
return Response::api("$method not supported", 500);
}
function get()
{
$db = Database::getInstance();
$query =
"SELECT
*
FROM
egb_gaestebuch";
$stmt = $db->prepare($query);
$stmt->execute();
Response::api($stmt->fetchAll());
}
-90
View File
@@ -1,90 +0,0 @@
<?php
$method = $_SERVER['REQUEST_METHOD'];
$params = PathParams::get();
if (empty($params[2])) {
return Response::api("Missing param", 500);
}
switch ($method) {
case "GET":
if (Auth::hasPermission("read")) return get($params[2]);
break;
case "POST":
if (Auth::hasPermission("write")) return post($params[2]);
break;
case "DELETE":
if (Auth::hasPermission("write")) return delete($params[2]);
break;
default:
return Response::api("$method not supported", 500);
}
return Response::api("Not allowed", 401);
function get($id)
{
$db = Database::getInstance();
$query =
"SELECT
*
FROM
Users
WHERE
ID = :ID";
$stmt = $db->prepare($query);
$stmt->bindValue(":ID", $id);
$stmt->execute();
Response::api($stmt->fetchAll());
}
function post($id)
{
$db = Database::getInstance();
$query =
"UPDATE
Users
SET
FirstName = :FIRST, LastName = :LAST
WHERE
ID = :ID";
$_POST = json_decode(file_get_contents('php://input'), true);
try {
$stmt = $db->prepare($query);
$stmt->bindValue(":FIRST", $_POST["firstName"]);
$stmt->bindValue(":LAST", $_POST["lastName"]);
$stmt->bindValue(":ID", $id);
Response::api($stmt->execute());
} catch (Exception $e) {
Response::api($e->getMessage(), 500);
}
}
function delete($id)
{
$db = Database::getInstance();
$query =
"DELETE FROM
Users
WHERE
ID = :ID";
try {
$stmt = $db->prepare($query);
$stmt->bindValue(":ID", $id);
Response::api($stmt->execute());
} catch (Exception $e) {
Response::api($e->getMessage(), 500);
}
}
-54
View File
@@ -1,54 +0,0 @@
<?php
$method = $_SERVER['REQUEST_METHOD'];
switch ($method) {
case "GET":
if (Auth::hasPermission("read")) return get();
break;
case "PUT":
if (Auth::hasPermission("write")) return put();
break;
default:
return Response::api("$method not supported", 500);
}
return Response::api("Not allowed", 401);
function get()
{
$db = Database::getInstance();
$query =
"SELECT
*
FROM
Users";
$stmt = $db->prepare($query);
$stmt->execute();
Response::api($stmt->fetchAll());
}
function put()
{
$db = Database::getInstance();
$_PUT = json_decode(file_get_contents('php://input'), true);
$query =
"INSERT INTO
Users(FirstName, LastName, Token)
VALUES(:FIRST, :LAST, UUID())";
try {
$stmt = $db->prepare($query);
$stmt->bindValue(":FIRST", $_PUT["firstName"]);
$stmt->bindValue(":LAST", $_PUT["lastName"]);
Response::api($stmt->execute());
} catch (Exception $e) {
Response::api($e->getMessage(), 500);
}
}
-3
View File
@@ -1,3 +0,0 @@
Order deny,allow
Deny from all
Allow from 127.0.0.1
-15
View File
@@ -1,15 +0,0 @@
<?php
if (strpos($_SERVER["REQUEST_URI"], "api") === false) {
ini_set("display_errors", 1);
}
ini_set("default_charset", "utf-8");
ini_set('session.cookie_httponly', 1);
ini_set('session.cookie_secure', 1);
ini_set('session.use_only_cookies', 1);
error_reporting(E_ALL);
require_once __DIR__ . "/../vendor/autoloader.php";
Headers::html();
require_once __DIR__ . "/../routes/routes.php";
-3
View File
@@ -1,3 +0,0 @@
Order deny,allow
Deny from all
Allow from 127.0.0.1
-5
View File
@@ -1,5 +0,0 @@
<?php
return [
"basePath" => "phpCourse/exam/",
];
-9
View File
@@ -1,9 +0,0 @@
<?php
return [
"host" => "usersql.zedat.fu-berlin.de",
"user" => "khofmann-sql",
"passwd" => "xz8c7m7p",
"database" => "khofmann-db1",
"charset" => "utf8",
];
-3
View File
@@ -1,3 +0,0 @@
<?php
require_once "./app/app.php";
-40
View File
@@ -1,40 +0,0 @@
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function t(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(l){if(l.ep)return;l.ep=!0;const o=t(l);fetch(l.href,o)}})();function tc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hi={exports:{}},br={},Wi={exports:{}},L={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Yt=Symbol.for("react.element"),rc=Symbol.for("react.portal"),lc=Symbol.for("react.fragment"),oc=Symbol.for("react.strict_mode"),uc=Symbol.for("react.profiler"),ic=Symbol.for("react.provider"),sc=Symbol.for("react.context"),ac=Symbol.for("react.forward_ref"),cc=Symbol.for("react.suspense"),fc=Symbol.for("react.memo"),dc=Symbol.for("react.lazy"),Du=Symbol.iterator;function pc(e){return e===null||typeof e!="object"?null:(e=Du&&e[Du]||e["@@iterator"],typeof e=="function"?e:null)}var Qi={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ki=Object.assign,Yi={};function lt(e,n,t){this.props=e,this.context=n,this.refs=Yi,this.updater=t||Qi}lt.prototype.isReactComponent={};lt.prototype.setState=function(e,n){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,n,"setState")};lt.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Xi(){}Xi.prototype=lt.prototype;function $o(e,n,t){this.props=e,this.context=n,this.refs=Yi,this.updater=t||Qi}var Vo=$o.prototype=new Xi;Vo.constructor=$o;Ki(Vo,lt.prototype);Vo.isPureReactComponent=!0;var ju=Array.isArray,Gi=Object.prototype.hasOwnProperty,Ao={current:null},Zi={key:!0,ref:!0,__self:!0,__source:!0};function Ji(e,n,t){var r,l={},o=null,u=null;if(n!=null)for(r in n.ref!==void 0&&(u=n.ref),n.key!==void 0&&(o=""+n.key),n)Gi.call(n,r)&&!Zi.hasOwnProperty(r)&&(l[r]=n[r]);var i=arguments.length-2;if(i===1)l.children=t;else if(1<i){for(var s=Array(i),c=0;c<i;c++)s[c]=arguments[c+2];l.children=s}if(e&&e.defaultProps)for(r in i=e.defaultProps,i)l[r]===void 0&&(l[r]=i[r]);return{$$typeof:Yt,type:e,key:o,ref:u,props:l,_owner:Ao.current}}function mc(e,n){return{$$typeof:Yt,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function Bo(e){return typeof e=="object"&&e!==null&&e.$$typeof===Yt}function vc(e){var n={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(t){return n[t]})}var Iu=/\/+/g;function wl(e,n){return typeof e=="object"&&e!==null&&e.key!=null?vc(""+e.key):n.toString(36)}function yr(e,n,t,r,l){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var u=!1;if(e===null)u=!0;else switch(o){case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case Yt:case rc:u=!0}}if(u)return u=e,l=l(u),e=r===""?"."+wl(u,0):r,ju(l)?(t="",e!=null&&(t=e.replace(Iu,"$&/")+"/"),yr(l,n,t,"",function(c){return c})):l!=null&&(Bo(l)&&(l=mc(l,t+(!l.key||u&&u.key===l.key?"":(""+l.key).replace(Iu,"$&/")+"/")+e)),n.push(l)),1;if(u=0,r=r===""?".":r+":",ju(e))for(var i=0;i<e.length;i++){o=e[i];var s=r+wl(o,i);u+=yr(o,n,t,s,l)}else if(s=pc(e),typeof s=="function")for(e=s.call(e),i=0;!(o=e.next()).done;)o=o.value,s=r+wl(o,i++),u+=yr(o,n,t,s,l);else if(o==="object")throw n=String(e),Error("Objects are not valid as a React child (found: "+(n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n)+"). If you meant to render a collection of children, use an array instead.");return u}function er(e,n,t){if(e==null)return e;var r=[],l=0;return yr(e,r,"","",function(o){return n.call(t,o,l++)}),r}function hc(e){if(e._status===-1){var n=e._result;n=n(),n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ie={current:null},gr={transition:null},yc={ReactCurrentDispatcher:ie,ReactCurrentBatchConfig:gr,ReactCurrentOwner:Ao};function qi(){throw Error("act(...) is not supported in production builds of React.")}L.Children={map:er,forEach:function(e,n,t){er(e,function(){n.apply(this,arguments)},t)},count:function(e){var n=0;return er(e,function(){n++}),n},toArray:function(e){return er(e,function(n){return n})||[]},only:function(e){if(!Bo(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};L.Component=lt;L.Fragment=lc;L.Profiler=uc;L.PureComponent=$o;L.StrictMode=oc;L.Suspense=cc;L.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=yc;L.act=qi;L.cloneElement=function(e,n,t){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Ki({},e.props),l=e.key,o=e.ref,u=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,u=Ao.current),n.key!==void 0&&(l=""+n.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(s in n)Gi.call(n,s)&&!Zi.hasOwnProperty(s)&&(r[s]=n[s]===void 0&&i!==void 0?i[s]:n[s])}var s=arguments.length-2;if(s===1)r.children=t;else if(1<s){i=Array(s);for(var c=0;c<s;c++)i[c]=arguments[c+2];r.children=i}return{$$typeof:Yt,type:e.type,key:l,ref:o,props:r,_owner:u}};L.createContext=function(e){return e={$$typeof:sc,_currentValue:e,_currentValue2:e,_threadCount:0,ProviderLine truncated
* @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 wc=el,Sc=Symbol.for("react.element"),kc=Symbol.for("react.fragment"),Ec=Object.prototype.hasOwnProperty,Cc=wc.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_c={key:!0,ref:!0,__self:!0,__source:!0};function bi(e,n,t){var r,l={},o=null,u=null;t!==void 0&&(o=""+t),n.key!==void 0&&(o=""+n.key),n.ref!==void 0&&(u=n.ref);for(r in n)Ec.call(n,r)&&!_c.hasOwnProperty(r)&&(l[r]=n[r]);if(e&&e.defaultProps)for(r in n=e.defaultProps,n)l[r]===void 0&&(l[r]=n[r]);return{$$typeof:Sc,type:e,key:o,ref:u,props:l,_owner:Cc.current}}br.Fragment=kc;br.jsx=bi;br.jsxs=bi;Hi.exports=br;var le=Hi.exports,Ql={},es={exports:{}},ge={},ns={exports:{}},ts={};/**
* @license React
* scheduler.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.
*/(function(e){function n(C,N){var z=C.length;C.push(N);e:for(;0<z;){var H=z-1>>>1,X=C[H];if(0<l(X,N))C[H]=N,C[z]=X,z=H;else break e}}function t(C){return C.length===0?null:C[0]}function r(C){if(C.length===0)return null;var N=C[0],z=C.pop();if(z!==N){C[0]=z;e:for(var H=0,X=C.length,qt=X>>>1;H<qt;){var hn=2*(H+1)-1,gl=C[hn],yn=hn+1,bt=C[yn];if(0>l(gl,z))yn<X&&0>l(bt,gl)?(C[H]=bt,C[yn]=z,H=yn):(C[H]=gl,C[hn]=z,H=hn);else if(yn<X&&0>l(bt,z))C[H]=bt,C[yn]=z,H=yn;else break e}}return N}function l(C,N){var z=C.sortIndex-N.sortIndex;return z!==0?z:C.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,i=u.now();e.unstable_now=function(){return u.now()-i}}var s=[],c=[],v=1,m=null,p=3,g=!1,w=!1,S=!1,I=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,a=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(C){for(var N=t(c);N!==null;){if(N.callback===null)r(c);else if(N.startTime<=C)r(c),N.sortIndex=N.expirationTime,n(s,N);else break;N=t(c)}}function h(C){if(S=!1,d(C),!w)if(t(s)!==null)w=!0,hl(E);else{var N=t(c);N!==null&&yl(h,N.startTime-C)}}function E(C,N){w=!1,S&&(S=!1,f(P),P=-1),g=!0;var z=p;try{for(d(N),m=t(s);m!==null&&(!(m.expirationTime>N)||C&&!Pe());){var H=m.callback;if(typeof H=="function"){m.callback=null,p=m.priorityLevel;var X=H(m.expirationTime<=N);N=e.unstable_now(),typeof X=="function"?m.callback=X:m===t(s)&&r(s),d(N)}else r(s);m=t(s)}if(m!==null)var qt=!0;else{var hn=t(c);hn!==null&&yl(h,hn.startTime-N),qt=!1}return qt}finally{m=null,p=z,g=!1}}var _=!1,x=null,P=-1,B=5,T=-1;function Pe(){return!(e.unstable_now()-T<B)}function it(){if(x!==null){var C=e.unstable_now();T=C;var N=!0;try{N=x(!0,C)}finally{N?st():(_=!1,x=null)}}else _=!1}var st;if(typeof a=="function")st=function(){a(it)};else if(typeof MessageChannel<"u"){var Mu=new MessageChannel,nc=Mu.port2;Mu.port1.onmessage=it,st=function(){nc.postMessage(null)}}else st=function(){I(it,0)};function hl(C){x=C,_||(_=!0,st())}function yl(C,N){P=I(function(){C(e.unstable_now())},N)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(C){C.callback=null},e.unstable_continueExecution=function(){w||g||(w=!0,hl(E))},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return t(s)},e.unstable_next=function(C){switch(p){case 1:case 2:case 3:var N=3;break;default:N=p}var z=p;p=N;try{return C()}finally{p=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(C,N){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var z=p;p=C;try{return N()}finally{p=z}},e.unstable_scheduleCallback=function(C,N,z){var H=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?H+z:H):z=H,C){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=z+X,C={id:v++,callback:N,priorityLevel:C,startTime:z,expirationTime:X,sortIndex:-1},z>H?(C.sortIndex=z,n(c,C),t(s)===null&&C===t(c)&&(S?(f(P),P=-1):S=!0,yl(h,z-H))):(C.sortIndex=X,n(s,C),w||g||(w=!0,hl(E))),C},e.unstable_shouldYield=Pe,e.unstable_wrapCallback=function(C){var N=p;return function(){var z=p;p=N;try{return C.apply(this,arguments)}finally{p=z}}}})(ts);ns.exports=ts;var xc=ns.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Pc=el,ye=xc;function y(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,t=1;t<arguments.length;t++)n+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var rs=new Set,Tt={};function Tn(e,n){Jn(e,n),Jn(e+"Capture",n)}function Jn(e,n){for(Tt[e]=n,e=0;e<n.length;e++)rs.add(n[e])}var We=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Kl=Object.prototype.hasOwnProperty,Nc=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Fu={},Uu={};function zc(e){return Kl.call(Uu,e)?!0:Kl.call(Fu,e)?!1:Nc.test(e)?Uu[e]=!0:(Fu[e]=!0,!1)}function Lc(e,n,t,r){if(t!==null&&t.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return r?!1:t!==null?!t.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Tc(e,n,t,r){if(n===null||typeof n>"u"||Lc(e,n,t,r))return!0;if(r)return!1;if(t!==null)switch(t.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function se(e,n,t,r,l,o,u){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=t,this.propertyName=e,this.type=n,this.sanitizeURL=o,this.removeEmptyString=u}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new se(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];b[n]=new se(n,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new se(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new se(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){b[e]=new se(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){b[e]=new se(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){b[e]=new se(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){b[e]=new se(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){b[e]=new se(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ho=/[\-:]([a-z])/g;function Wo(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(Ho,Wo);b[n]=new se(n,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(Ho,Wo);b[n]=new se(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(Ho,Wo);b[n]=new se(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){b[e]=new se(e,1,!1,e.toLowerCase(),null,!1,!1)});b.xlinkHref=new se("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){b[e]=new se(e,1,!1,e.toLowerCase(),null,!0,!0)});function Qo(e,n,t,r){var l=b.hasOwnProperty(n)?b[n]:null;(l!==null?l.type!==0:r||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n Line truncated
`+Sl+e}var kl=!1;function El(e,n){if(!e||kl)return"";kl=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(c){var r=c}Reflect.construct(e,[],n)}else{try{n.call()}catch(c){r=c}e.call(n.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var l=c.stack.split(`
`),o=r.stack.split(`
`),u=l.length-1,i=o.length-1;1<=u&&0<=i&&l[u]!==o[i];)i--;for(;1<=u&&0<=i;u--,i--)if(l[u]!==o[i]){if(u!==1||i!==1)do if(u--,i--,0>i||l[u]!==o[i]){var s=`
`+l[u].replace(" at new "," at ");return e.displayName&&s.includes("<anonymous>")&&(s=s.replace("<anonymous>",e.displayName)),s}while(1<=u&&0<=i);break}}}finally{kl=!1,Error.prepareStackTrace=t}return(e=e?e.displayName||e.name:"")?yt(e):""}function Rc(e){switch(e.tag){case 5:return yt(e.type);case 16:return yt("Lazy");case 13:return yt("Suspense");case 19:return yt("SuspenseList");case 0:case 2:case 15:return e=El(e.type,!1),e;case 11:return e=El(e.type.render,!1),e;case 1:return e=El(e.type,!0),e;default:return""}}function Zl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Dn:return"Fragment";case Mn:return"Portal";case Yl:return"Profiler";case Ko:return"StrictMode";case Xl:return"Suspense";case Gl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case os:return(e.displayName||"Context")+".Consumer";case ls:return(e._context.displayName||"Context")+".Provider";case Yo:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Xo:return n=e.displayName||null,n!==null?n:Zl(e.type)||"Memo";case Ze:n=e._payload,e=e._init;try{return Zl(e(n))}catch{}}return null}function Oc(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Zl(n);case 8:return n===Ko?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function fn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function is(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Mc(e){var n=is(e)?"checked":"value",t=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),r=""+e[n];if(!e.hasOwnProperty(n)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var l=t.get,o=t.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return l.call(this)},set:function(u){r=""+u,o.call(this,u)}}),Object.defineProperty(e,n,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(u){r=""+u},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function tr(e){e._valueTracker||(e._valueTracker=Mc(e))}function ss(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var t=n.getValue(),r="";return e&&(r=is(e)?e.checked?"true":"false":e.value),e=r,e!==t?(n.setValue(e),!0):!1}function Lr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Jl(e,n){var t=n.checked;return V({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??e._wrapperState.initialChecked})}function Vu(e,n){var t=n.defaultValue==null?"":n.defaultValue,r=n.checked!=null?n.checked:n.defaultChecked;t=fn(n.value!=null?n.value:t),e._wrapperState={initialChecked:r,initialValue:t,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function as(e,n){n=n.checked,n!=null&&Qo(e,"checked",n,!1)}function ql(e,n){as(e,n);var t=fn(n.value),r=n.type;if(t!=null)r==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+t):e.value!==""+t&&(e.value=""+t);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?bl(e,n.type,t):n.hasOwnProperty("defaultValue")&&bl(e,n.type,fn(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function Au(e,n,t){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var r=n.type;if(!(r!=="submit"&&r!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,t||n===e.value||(e.value=n),e.defaultValue=n}t=e.name,t!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,t!==""&&(e.name=t)}function bl(e,n,t){(n!=="number"||Lr(e.ownerDocument)!==e)&&(t==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+t&&(e.defaultValue=""+t))}var gt=Array.isArray;function Qn(e,n,t,r){if(e=e.options,n){n={};for(var l=0;l<t.length;l++)n["$"+t[l]]=!0;for(t=0;t<e.length;t++)l=n.hasOwnProperty("$"+e[t].value),e[t].selected!==l&&(e[t].selected=l),l&&r&&(e[t].defaultSelected=!0)}else{for(t=""+fn(t),n=null,l=0;l<e.length;l++){if(e[l].value===t){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}n!==null||e[l].disabled||(n=e[l])}n!==null&&(n.selected=!0)}}function eo(e,n){if(n.dang Line truncated
`).replace(Wf,"")}function cr(e,n,t){if(n=ci(n),ci(e)!==n&&t)throw Error(y(425))}function Fr(){}var mo=null,vo=null;function ho(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var yo=typeof setTimeout=="function"?setTimeout:void 0,Qf=typeof clearTimeout=="function"?clearTimeout:void 0,fi=typeof Promise=="function"?Promise:void 0,Kf=typeof queueMicrotask=="function"?queueMicrotask:typeof fi<"u"?function(e){return fi.resolve(null).then(e).catch(Yf)}:yo;function Yf(e){setTimeout(function(){throw e})}function jl(e,n){var t=n,r=0;do{var l=t.nextSibling;if(e.removeChild(t),l&&l.nodeType===8)if(t=l.data,t==="/$"){if(r===0){e.removeChild(l),jt(n);return}r--}else t!=="$"&&t!=="$?"&&t!=="$!"||r++;t=l}while(t);jt(n)}function on(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return e}function di(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var t=e.data;if(t==="$"||t==="$!"||t==="$?"){if(n===0)return e;n--}else t==="/$"&&n++}e=e.previousSibling}return null}var ut=Math.random().toString(36).slice(2),Ie="__reactFiber$"+ut,Vt="__reactProps$"+ut,Qe="__reactContainer$"+ut,go="__reactEvents$"+ut,Xf="__reactListeners$"+ut,Gf="__reactHandles$"+ut;function Sn(e){var n=e[Ie];if(n)return n;for(var t=e.parentNode;t;){if(n=t[Qe]||t[Ie]){if(t=n.alternate,n.child!==null||t!==null&&t.child!==null)for(e=di(e);e!==null;){if(t=e[Ie])return t;e=di(e)}return n}e=t,t=e.parentNode}return null}function Zt(e){return e=e[Ie]||e[Qe],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Un(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(y(33))}function ol(e){return e[Vt]||null}var wo=[],$n=-1;function mn(e){return{current:e}}function j(e){0>$n||(e.current=wo[$n],wo[$n]=null,$n--)}function M(e,n){$n++,wo[$n]=e.current,e.current=n}var dn={},re=mn(dn),fe=mn(!1),xn=dn;function qn(e,n){var t=e.type.contextTypes;if(!t)return dn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===n)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in t)l[o]=n[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=l),l}function de(e){return e=e.childContextTypes,e!=null}function Ur(){j(fe),j(re)}function pi(e,n,t){if(re.current!==dn)throw Error(y(168));M(re,n),M(fe,t)}function Js(e,n,t){var r=e.stateNode;if(n=n.childContextTypes,typeof r.getChildContext!="function")return t;r=r.getChildContext();for(var l in r)if(!(l in n))throw Error(y(108,Oc(e)||"Unknown",l));return V({},t,r)}function $r(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||dn,xn=re.current,M(re,e),M(fe,fe.current),!0}function mi(e,n,t){var r=e.stateNode;if(!r)throw Error(y(169));t?(e=Js(e,n,xn),r.__reactInternalMemoizedMergedChildContext=e,j(fe),j(re),M(re,e)):j(fe),M(fe,t)}var Ve=null,ul=!1,Il=!1;function qs(e){Ve===null?Ve=[e]:Ve.push(e)}function Zf(e){ul=!0,qs(e)}function vn(){if(!Il&&Ve!==null){Il=!0;var e=0,n=O;try{var t=Ve;for(O=1;e<t.length;e++){var r=t[e];do r=r(!0);while(r!==null)}Ve=null,ul=!1}catch(l){throw Ve!==null&&(Ve=Ve.slice(e+1)),Cs(Zo,vn),l}finally{O=n,Il=!1}}return null}var Vn=[],An=0,Vr=null,Ar=0,Se=[],ke=0,Pn=null,Ae=1,Be="";function gn(e,n){Vn[An++]=Ar,Vn[An++]=Vr,Vr=e,Ar=n}function bs(e,n,t){Se[ke++]=Ae,Se[ke++]=Be,Se[ke++]=Pn,Pn=e;var r=Ae;e=Be;var l=32-Re(r)-1;r&=~(1<<l),t+=1;var o=32-Re(n)+l;if(30<o){var u=l-l%5;o=(r&(1<<u)-1).toString(32),r>>=u,l-=u,Ae=1<<32-Re(n)+l|t<<l|r,Be=o+e}else Ae=1<<o|t<<l|r,Be=e}function ou(e){e.return!==null&&(gn(e,1),bs(e,1,0))}function uu(e){for(;e===Vr;)Vr=Vn[--An],Vn[An]=null,Ar=Vn[--An],Vn[An]=null;for(;e===Pn;)Pn=Se[--ke],Se[ke]=null,Be=Se[--ke],Se[ke]=null,Ae=Se[--ke],Se[ke]=null}var he=null,ve=null,F=!1,Te=null;function ea(e,n){var t=Ee(5,null,null,0);t.elementType="DELETED",t.stateNode=n,t.return=e,n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)}function vi(e,n){switch(e.tag){case 5:var t=e.type;return n=n.nodeType!==1||t.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,he=e,ve=on(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,he=e,ve=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(t=Pn!==null?{id:Ae,overflow:Be}:null,e.memoizedState={dehydrated:n,treeContext:t,retryLane:1073741824},t=Ee(18,null,null,0),t.stateNode=n,t.return=e,e.child=t,he=e,ve=null,!0):!1;default:return!1}}function So(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ko(e){if(F){var n=ve;if(n){var t=n;if(!vi(e,n)){if(So(e))throw Error(y(418));n=on(t.nextSibling);var r=he;n&&vi(e,n)?ea(r,t):(e.flags=e.flags&-4097|2,F=!1,he=e)}}else{if(So(e))throw Error(y(418));e.flags=e.flags&-4097|2,F=!1,he=e}}}function hi(e){for(e=e.return;e!==null&&e.t Line truncated
Error generating stack: `+o.message+`
`+o.stack}return{value:e,source:n,stack:l,digest:null}}function Al(e,n,t){return{value:e,source:null,stack:t??null,digest:n??null}}function xo(e,n){try{console.error(n.value)}catch(t){setTimeout(function(){throw t})}}var od=typeof WeakMap=="function"?WeakMap:Map;function Na(e,n,t){t=He(-1,t),t.tag=3,t.payload={element:null};var r=n.value;return t.callback=function(){Gr||(Gr=!0,jo=r),xo(e,n)},t}function za(e,n,t){t=He(-1,t),t.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=n.value;t.payload=function(){return r(l)},t.callback=function(){xo(e,n)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(t.callback=function(){xo(e,n),typeof r!="function"&&(sn===null?sn=new Set([this]):sn.add(this));var u=n.stack;this.componentDidCatch(n.value,{componentStack:u!==null?u:""})}),t}function _i(e,n,t){var r=e.pingCache;if(r===null){r=e.pingCache=new od;var l=new Set;r.set(n,l)}else l=r.get(n),l===void 0&&(l=new Set,r.set(n,l));l.has(t)||(l.add(t),e=wd.bind(null,e,n,t),n.then(e,e))}function xi(e){do{var n;if((n=e.tag===13)&&(n=e.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return e;e=e.return}while(e!==null);return null}function Pi(e,n,t,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===n?e.flags|=65536:(e.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(n=He(-1,1),n.tag=2,un(t,n,1))),t.lanes|=1),e)}var ud=Xe.ReactCurrentOwner,ce=!1;function oe(e,n,t,r){n.child=e===null?ra(n,null,t,r):et(n,e.child,t,r)}function Ni(e,n,t,r,l){t=t.render;var o=n.ref;return Gn(n,l),r=yu(e,n,t,r,o,l),t=gu(),e!==null&&!ce?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~l,Ye(e,n,l)):(F&&t&&ou(n),n.flags|=1,oe(e,n,r,l),n.child)}function zi(e,n,t,r,l){if(e===null){var o=t.type;return typeof o=="function"&&!zu(o)&&o.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(n.tag=15,n.type=o,La(e,n,o,r,l)):(e=zr(t.type,null,r,n,n.mode,l),e.ref=n.ref,e.return=n,n.child=e)}if(o=e.child,!(e.lanes&l)){var u=o.memoizedProps;if(t=t.compare,t=t!==null?t:Ft,t(u,r)&&e.ref===n.ref)return Ye(e,n,l)}return n.flags|=1,e=cn(o,r),e.ref=n.ref,e.return=n,n.child=e}function La(e,n,t,r,l){if(e!==null){var o=e.memoizedProps;if(Ft(o,r)&&e.ref===n.ref)if(ce=!1,n.pendingProps=r=o,(e.lanes&l)!==0)e.flags&131072&&(ce=!0);else return n.lanes=e.lanes,Ye(e,n,l)}return Po(e,n,t,r,l)}function Ta(e,n,t){var r=n.pendingProps,l=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(n.mode&1))n.memoizedState={baseLanes:0,cachePool:null,transitions:null},M(Wn,me),me|=t;else{if(!(t&1073741824))return e=o!==null?o.baseLanes|t:t,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,M(Wn,me),me|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:t,M(Wn,me),me|=r}else o!==null?(r=o.baseLanes|t,n.memoizedState=null):r=t,M(Wn,me),me|=r;return oe(e,n,l,t),n.child}function Ra(e,n){var t=n.ref;(e===null&&t!==null||e!==null&&e.ref!==t)&&(n.flags|=512,n.flags|=2097152)}function Po(e,n,t,r,l){var o=de(t)?xn:re.current;return o=qn(n,o),Gn(n,l),t=yu(e,n,t,r,o,l),r=gu(),e!==null&&!ce?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~l,Ye(e,n,l)):(F&&r&&ou(n),n.flags|=1,oe(e,n,t,l),n.child)}function Li(e,n,t,r,l){if(de(t)){var o=!0;$r(n)}else o=!1;if(Gn(n,l),n.stateNode===null)xr(e,n),Pa(n,t,r),_o(n,t,r,l),r=!0;else if(e===null){var u=n.stateNode,i=n.memoizedProps;u.props=i;var s=u.context,c=t.contextType;typeof c=="object"&&c!==null?c=_e(c):(c=de(t)?xn:re.current,c=qn(n,c));var v=t.getDerivedStateFromProps,m=typeof v=="function"||typeof u.getSnapshotBeforeUpdate=="function";m||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(i!==r||s!==c)&&Ci(n,u,r,c),Je=!1;var p=n.memoizedState;u.state=p,Wr(n,r,u,l),s=n.memoizedState,i!==r||p!==s||fe.current||Je?(typeof v=="function"&&(Co(n,t,v,r),s=n.memoizedState),(i=Je||Ei(n,t,i,r,p,s,c))?(m||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(n.flags|=4194308)):(typeof u.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=r,n.memoizedState=s),u.props=r,u.state=s,u.context=c,r=i):(typeof u.componentDidMount=="function"&&(n.flags|=4194308),r=!1)}else{u=n.stateNode,oa(e,n),i=n.memoizedProps,c=n.type===n.elementType?i:ze(n.type,i),u.props=c,m=n.pendingProps,p=u.context,s=t.contextType,typeof s=="object"&&s!==null?s=_e(s):(s=de(t)?xn:re.current,s=qn(n,s));var g=t.getDerivedStateFromProps;(v=typeof g=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(i!==m||p!==s)&&Ci(n,u,r,s),Je=!1,p=n.memoizedState,u.state=p,Wr(n,r,u,l);var w=n.memoizedState;i Line truncated
-14
View File
@@ -1,14 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/phpCourse/exam/pages/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<script type="module" crossorigin src="/phpCourse/exam/pages/assets/index-D81sf-ye.js"></script>
<link rel="stylesheet" crossorigin href="/phpCourse/exam/pages/assets/index-DiwrgTda.css">
</head>
<body>
<div id="root"></div>
</body>
</html>
-3
View File
@@ -1,3 +0,0 @@
Order deny,allow
Deny from all
Allow from 127.0.0.1
-19
View File
@@ -1,19 +0,0 @@
<?php
$path = ltrim(str_replace(Config::getBasePath(), "", $_SERVER['REQUEST_URI']), "/");
try {
$segments = PathParams::get();
if ($segments[0] === "api") {
if ($segments[1] !== "docs") {
require_once __DIR__ . "/../api/{$segments[1]}/index.php";
} else {
Headers::redirect("index.html");
}
} else {
require_once __DIR__ . "/../pages/index.html";
}
} catch (Exception $e) {
require_once __DIR__ . "/../pages/500.php";
}
-3
View File
@@ -1,3 +0,0 @@
Order deny,allow
Deny from all
Allow from 127.0.0.1
-28
View File
@@ -1,28 +0,0 @@
<?php
class Auth
{
public static function hasPermission(string $required)
{
$db = Database::getInstance();
if (!isset($_SERVER["HTTP_TOKEN"])) return false;
$token = $_SERVER["HTTP_TOKEN"];
$query =
"SELECT
UserPermissions.Permission
FROM
UserPermissions, Users
WHERE
Users.ID = UserPermissions.fkUserID AND
Users.Token = :TOKEN";
$stmt = $db->prepare($query);
$stmt->bindValue(":TOKEN", $token);
$stmt->execute();
$perms = $stmt->fetchAll(PDO::FETCH_COLUMN, 0);
return in_array($required, $perms);
}
}
-7
View File
@@ -1,7 +0,0 @@
<?php
spl_autoload_register(function ($name) {
$_name = lcfirst($name);
require_once __DIR__ . "/$_name/$_name.php";
});
-44
View File
@@ -1,44 +0,0 @@
<?php
class Config
{
private static array $instances = [];
private array $app;
private array $database;
protected function __construct()
{
$this->app = require_once __DIR__ . "/../../config/app.php";
$this->database = require_once __DIR__ . "/../../config/database.php";
}
protected function __clone()
{
}
public function __wakeup()
{
throw new \Exception("Cannot unserialize a singleton.");
}
private static function getInstance(): Config
{
$cls = static::class;
if (!isset(self::$instances[$cls])) {
self::$instances[$cls] = new static();
}
return self::$instances[$cls];
}
public static function getBasePath()
{
return Config::getInstance()->app["basePath"];
}
public static function getDatabase()
{
return Config::getInstance()->database;
}
}
-32
View File
@@ -1,32 +0,0 @@
<?php
class Database extends PDO
{
private static array $instances = [];
protected function __construct($dsn, $username = null, $password = null, array $options = null)
{
parent::__construct($dsn, $username, $password, $options);
}
public static function getInstance(): Database
{
$cls = static::class;
if (!isset(self::$instances[$cls])) {
$dataAccess = Config::getDatabase();
self::$instances[$cls] = new static(
"mysql:host={$dataAccess["host"]};dbname={$dataAccess["database"]};charset={$dataAccess["charset"]}",
$dataAccess["user"],
$dataAccess["passwd"],
[
PDO::ATTR_PERSISTENT => false,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => false,
]
);
}
return self::$instances[$cls];
}
}
-22
View File
@@ -1,22 +0,0 @@
<?php
class Headers
{
public static function json()
{
header('Content-Type: text/html; charset=utf-8');
header("Content-Type: text/json");
}
public static function html()
{
header('Content-Type: text/html; charset=utf-8');
}
public static function redirect(string $newUrl, bool $permanent = FALSE)
{
header('Location: ' . $newUrl, true, $permanent ? 301 : 303);
exit();
}
}
-11
View File
@@ -1,11 +0,0 @@
<?php
class PathParams
{
public static function get()
{
$path = ltrim(str_replace(Config::getBasePath(), "", $_SERVER['REQUEST_URI']), "/");
$segs = explode("/", $path);
return $segs ? $segs : [];
}
}
-11
View File
@@ -1,11 +0,0 @@
<?php
class Response
{
public static function api($content, int $code = 200)
{
Headers::json();
http_response_code($code);
echo json_encode($content);
}
}