diff --git a/.env.example b/.env.example index aeb914b..d2f3123 100644 --- a/.env.example +++ b/.env.example @@ -8,3 +8,10 @@ DB_NAME=siti_plugin_repo # Authentication JWT_SECRET=please-change-me JWT_EXPIRES_IN=7d + +# Gitea tokens +# GITEA_TOKEN wordt gebruikt als default token voor alle Gitea servers. +GITEA_TOKEN= +# Optioneel: override per host via GITEA_TOKENS (JSON of comma-separated baseUrl=token) +# Voorbeeld: GITEA_TOKENS=git.robert.ooo=my-token,https://git.example.com=another-token +GITEA_TOKENS= diff --git a/.gitignore b/.gitignore index 30bc162..7af7f04 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -/node_modules \ No newline at end of file +/node_modules +.env \ No newline at end of file diff --git a/dist/assets/index-BOPMLc5y.css b/dist/assets/index-BOPMLc5y.css new file mode 100644 index 0000000..a769527 --- /dev/null +++ b/dist/assets/index-BOPMLc5y.css @@ -0,0 +1 @@ +:root{color-scheme:light dark}.app{min-height:100vh;background:radial-gradient(circle at top,#f5f7ff,#fff 45%);color:#0f172a;font-family:Inter,system-ui,sans-serif;padding:48px 8vw 64px}.site-nav{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:32px;flex-wrap:wrap}.nav-logo{font-weight:700;color:inherit;text-decoration:none;font-size:1.1rem}.nav-links{display:flex;gap:12px}.nav-user{display:flex;align-items:center;gap:8px;font-size:.9rem;color:#475569}.nav-user-name{font-weight:600}.nav-user-guest{color:#94a3b8;font-size:.85rem}.nav-link{padding:8px 16px;border-radius:999px;border:1px solid transparent;text-decoration:none;color:#475569;font-weight:600}.nav-link.active{background:#eef2ff;color:#4338ca;border-color:#c7d2fe}.page{display:flex;flex-direction:column;gap:32px}.hero{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:48px;flex-wrap:wrap}.eyebrow{text-transform:uppercase;letter-spacing:.2em;font-size:12px;color:#6366f1;font-weight:600;margin:0 0 8px}.hero h1{font-size:clamp(2.4rem,4vw,3.4rem);margin:0 0 8px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}.subtitle{margin:0;font-size:1.1rem;color:#475569;max-width:520px}.hint{margin:8px 0 0;font-size:.9rem;color:#64748b}.cta{background:#4f46e5;color:#fff;padding:12px 20px;border-radius:999px;text-decoration:none;font-weight:600;box-shadow:0 8px 24px #4f46e533;transition:transform .2s ease,box-shadow .2s ease;display:inline-flex;align-items:center;justify-content:center;border:none;cursor:pointer}.cta:hover{transform:translateY(-2px);box-shadow:0 12px 30px #4f46e54d}.ghost{border:1px solid #c7d2fe;color:#4338ca;padding:8px 14px;border-radius:999px;text-decoration:none;font-weight:600;display:inline-flex;align-items:center;justify-content:center;gap:8px;background:transparent;cursor:pointer}.ghost-small{padding:6px 12px;font-size:.85rem}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:20px}.actions{display:flex;align-items:center;gap:12px;margin-top:auto}.card{background:#fff;border-radius:20px;padding:24px;box-shadow:0 12px 30px #0f172a14;display:flex;flex-direction:column;gap:12px}.card-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.card h2{margin:0;font-size:1.3rem;display:flex;align-items:center;gap:8px;flex-wrap:wrap}.card p{margin:0;color:#475569}.pill{background:#eef2ff;color:#4338ca;font-size:.75rem;font-weight:600;padding:4px 10px;border-radius:999px}.meta{display:flex;gap:12px;font-size:.9rem;color:#64748b}.topics{display:flex;flex-wrap:wrap;gap:8px}.topic{background:#f1f5f9;color:#475569;font-size:.75rem;padding:4px 8px;border-radius:999px}.link{color:#4f46e5;font-weight:600;text-decoration:none}.state{background:#fff;border-radius:16px;padding:20px;box-shadow:0 10px 20px #0f172a14;color:#475569}.state.error{background:#fee2e2;color:#b91c1c}.state.success{background:#dcfce7;color:#166534}.state.warning{background:#fef9c3;color:#92400e}.state.inline{margin-top:16px;padding:16px}.footer{margin-top:48px;color:#94a3b8;font-size:.9rem}.detail-hero{display:flex;align-items:center;justify-content:space-between;gap:24px;flex-wrap:wrap}.detail-actions{display:flex;align-items:center;gap:12px}.detail-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:20px}.detail-list{display:grid;gap:12px;margin:16px 0}.detail-list div{display:flex;flex-direction:column;gap:4px;color:#64748b}.detail-list strong{color:inherit}.list{list-style:none;padding:0;margin:12px 0 0;display:grid;gap:12px}.list li{display:flex;justify-content:space-between;gap:12px;color:#64748b}.list a{color:#4f46e5;text-decoration:none;font-weight:600}.license-meta-bar{display:flex;gap:24px;flex-wrap:wrap;color:#64748b;font-size:.95rem}.license-forms{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:20px}.form-grid{display:flex;flex-direction:column;gap:16px}.field{display:flex;flex-direction:column;gap:8px;font-size:.9rem;color:#475569}.field input,.field select,.field textarea{border-radius:12px;border:1px solid #e2e8f0;padding:10px 14px;font-size:1rem;font-family:inherit;background:#fff;color:inherit}.license-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:20px}.license-card-header{display:flex;justify-content:space-between;align-items:center;gap:12px}.license-card h3{margin:0}.license-subtitle{margin:4px 0 0;color:#94a3b8;font-size:.9rem}.license-note{margin-top:4px;font-size:.95rem;color:#475569}.license-detail-list{margin-top:0}.host-list ul{list-style:none;padding:0;margin:8px 0 0;display:flex;flex-direction:column;gap:8px}.host-list li{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:.9rem;color:#64748b}.host-list li strong{color:inherit}.license-links{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-top:auto}.ghost-pill{border:1px solid #cbd5f5;border-radius:999px;padding:4px 10px;font-size:.85rem;color:#475569}.auth-card{gap:16px}.auth-tabs{display:flex;gap:8px}.auth-tab{flex:1;border-radius:999px;border:1px solid #e2e8f0;background:#f8fafc;padding:8px 12px;font-weight:600;cursor:pointer;color:#475569}.auth-tab.active{background:#eef2ff;border-color:#c7d2fe;color:#4338ca}.inline-field{display:flex;align-items:center;gap:8px;font-size:.9rem}.inline-field select{border-radius:12px;border:1px solid #e2e8f0;padding:6px 10px;font-size:.9rem}.checkbox-field{display:flex;align-items:center;gap:8px;font-size:.9rem;color:#475569}@media (max-width: 600px){.app{padding:40px 6vw 56px}.hero{align-items:flex-start}}@media (prefers-color-scheme: dark){.app{background:radial-gradient(circle at top,#1e1b4b,#0b1120 50%);color:#e2e8f0}.site-nav{border-color:#6366f166}.nav-link{color:#cbd5f5}.nav-link.active{background:#4f46e533;border-color:#4f46e566;color:#faf5ff}.nav-user{color:#cbd5f5}.nav-user-guest{color:#94a3b8}.subtitle{color:#cbd5f5}.card{background:#0f172a;box-shadow:0 12px 30px #0f172a59}.card p{color:#cbd5f5}.pill{background:#312e81;color:#e0e7ff}.meta{color:#94a3b8}.topic{background:#1e293b;color:#cbd5f5}.link{color:#a5b4fc}.ghost{border-color:#4f46e5;color:#e0e7ff}.auth-tab{border-color:#312e81;background:#1e1b4b;color:#cbd5f5}.auth-tab.active{background:#4f46e533;border-color:#4f46e599;color:#faf5ff}.hint,.license-meta-bar,.license-note{color:#cbd5f5}.inline-field select{background:#1e1b4b;border-color:#312e81;color:#e2e8f0}.checkbox-field{color:#cbd5f5}.field input,.field select,.field textarea{background:#1e1b4b;border-color:#312e81;color:#e2e8f0}.host-list li,.detail-list div,.list li{color:#cbd5f5}.list a{color:#a5b4fc}.state{background:#0f172a;color:#cbd5f5;box-shadow:0 10px 20px #0f172a66}.state.error{background:#7f1d1d;color:#fee2e2}.state.success{background:#14532d;color:#bbf7d0}.ghost-pill{border-color:#4f46e5;color:#cbd5f5}.footer{color:#94a3b8}}.privacy-indicator{display:inline-flex;align-items:center;gap:6px;font-size:.85rem;font-weight:600;padding:4px 10px;border-radius:999px;background:#fef3c7;color:#92400e}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}*{box-sizing:border-box}body{margin:0;background:#fff}@media (prefers-color-scheme: dark){body{background:#0b1120}}img{max-width:100%;display:block} diff --git a/dist/assets/index-CFgb3VsA.css b/dist/assets/index-CFgb3VsA.css deleted file mode 100644 index b422204..0000000 --- a/dist/assets/index-CFgb3VsA.css +++ /dev/null @@ -1 +0,0 @@ -:root{color-scheme:light dark}.app{min-height:100vh;background:radial-gradient(circle at top,#f5f7ff,#fff 45%);color:#0f172a;font-family:Inter,system-ui,sans-serif;padding:48px 8vw 64px}.site-nav{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:32px;flex-wrap:wrap}.nav-logo{font-weight:700;color:inherit;text-decoration:none;font-size:1.1rem}.nav-links{display:flex;gap:12px}.nav-user{display:flex;align-items:center;gap:8px;font-size:.9rem;color:#475569}.nav-user-name{font-weight:600}.nav-user-guest{color:#94a3b8;font-size:.85rem}.nav-link{padding:8px 16px;border-radius:999px;border:1px solid transparent;text-decoration:none;color:#475569;font-weight:600}.nav-link.active{background:#eef2ff;color:#4338ca;border-color:#c7d2fe}.page{display:flex;flex-direction:column;gap:32px}.hero{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:48px;flex-wrap:wrap}.eyebrow{text-transform:uppercase;letter-spacing:.2em;font-size:12px;color:#6366f1;font-weight:600;margin:0 0 8px}.hero h1{font-size:clamp(2.4rem,4vw,3.4rem);margin:0 0 8px}.subtitle{margin:0;font-size:1.1rem;color:#475569;max-width:520px}.hint{margin:8px 0 0;font-size:.9rem;color:#64748b}.cta{background:#4f46e5;color:#fff;padding:12px 20px;border-radius:999px;text-decoration:none;font-weight:600;box-shadow:0 8px 24px #4f46e533;transition:transform .2s ease,box-shadow .2s ease;display:inline-flex;align-items:center;justify-content:center;border:none;cursor:pointer}.cta:hover{transform:translateY(-2px);box-shadow:0 12px 30px #4f46e54d}.ghost{border:1px solid #c7d2fe;color:#4338ca;padding:8px 14px;border-radius:999px;text-decoration:none;font-weight:600;display:inline-flex;align-items:center;justify-content:center;gap:8px;background:transparent;cursor:pointer}.ghost-small{padding:6px 12px;font-size:.85rem}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:20px}.actions{display:flex;align-items:center;gap:12px;margin-top:auto}.card{background:#fff;border-radius:20px;padding:24px;box-shadow:0 12px 30px #0f172a14;display:flex;flex-direction:column;gap:12px}.card-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.card h2{margin:0;font-size:1.3rem}.card p{margin:0;color:#475569}.pill{background:#eef2ff;color:#4338ca;font-size:.75rem;font-weight:600;padding:4px 10px;border-radius:999px}.meta{display:flex;gap:12px;font-size:.9rem;color:#64748b}.topics{display:flex;flex-wrap:wrap;gap:8px}.topic{background:#f1f5f9;color:#475569;font-size:.75rem;padding:4px 8px;border-radius:999px}.link{color:#4f46e5;font-weight:600;text-decoration:none}.state{background:#fff;border-radius:16px;padding:20px;box-shadow:0 10px 20px #0f172a14;color:#475569}.state.error{background:#fee2e2;color:#b91c1c}.state.success{background:#dcfce7;color:#166534}.state.inline{margin-top:16px;padding:16px}.footer{margin-top:48px;color:#94a3b8;font-size:.9rem}.detail-hero{display:flex;align-items:center;justify-content:space-between;gap:24px;flex-wrap:wrap}.detail-actions{display:flex;align-items:center;gap:12px}.detail-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:20px}.detail-list{display:grid;gap:12px;margin:16px 0}.detail-list div{display:flex;flex-direction:column;gap:4px;color:#64748b}.detail-list strong{color:inherit}.list{list-style:none;padding:0;margin:12px 0 0;display:grid;gap:12px}.list li{display:flex;justify-content:space-between;gap:12px;color:#64748b}.list a{color:#4f46e5;text-decoration:none;font-weight:600}.license-meta-bar{display:flex;gap:24px;flex-wrap:wrap;color:#64748b;font-size:.95rem}.license-forms{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:20px}.form-grid{display:flex;flex-direction:column;gap:16px}.field{display:flex;flex-direction:column;gap:8px;font-size:.9rem;color:#475569}.field input,.field select,.field textarea{border-radius:12px;border:1px solid #e2e8f0;padding:10px 14px;font-size:1rem;font-family:inherit;background:#fff;color:inherit}.license-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:20px}.license-card-header{display:flex;justify-content:space-between;align-items:center;gap:12px}.license-card h3{margin:0}.license-subtitle{margin:4px 0 0;color:#94a3b8;font-size:.9rem}.license-note{margin-top:4px;font-size:.95rem;color:#475569}.license-detail-list{margin-top:0}.host-list ul{list-style:none;padding:0;margin:8px 0 0;display:flex;flex-direction:column;gap:8px}.host-list li{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:.9rem;color:#64748b}.host-list li strong{color:inherit}.license-links{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-top:auto}.ghost-pill{border:1px solid #cbd5f5;border-radius:999px;padding:4px 10px;font-size:.85rem;color:#475569}.auth-card{gap:16px}.auth-tabs{display:flex;gap:8px}.auth-tab{flex:1;border-radius:999px;border:1px solid #e2e8f0;background:#f8fafc;padding:8px 12px;font-weight:600;cursor:pointer;color:#475569}.auth-tab.active{background:#eef2ff;border-color:#c7d2fe;color:#4338ca}.inline-field{display:flex;align-items:center;gap:8px;font-size:.9rem}.inline-field select{border-radius:12px;border:1px solid #e2e8f0;padding:6px 10px;font-size:.9rem}.checkbox-field{display:flex;align-items:center;gap:8px;font-size:.9rem;color:#475569}@media (max-width: 600px){.app{padding:40px 6vw 56px}.hero{align-items:flex-start}}@media (prefers-color-scheme: dark){.app{background:radial-gradient(circle at top,#1e1b4b,#0b1120 50%);color:#e2e8f0}.site-nav{border-color:#6366f166}.nav-link{color:#cbd5f5}.nav-link.active{background:#4f46e533;border-color:#4f46e566;color:#faf5ff}.nav-user{color:#cbd5f5}.nav-user-guest{color:#94a3b8}.subtitle{color:#cbd5f5}.card{background:#0f172a;box-shadow:0 12px 30px #0f172a59}.card p{color:#cbd5f5}.pill{background:#312e81;color:#e0e7ff}.meta{color:#94a3b8}.topic{background:#1e293b;color:#cbd5f5}.link{color:#a5b4fc}.ghost{border-color:#4f46e5;color:#e0e7ff}.auth-tab{border-color:#312e81;background:#1e1b4b;color:#cbd5f5}.auth-tab.active{background:#4f46e533;border-color:#4f46e599;color:#faf5ff}.hint,.license-meta-bar,.license-note{color:#cbd5f5}.inline-field select{background:#1e1b4b;border-color:#312e81;color:#e2e8f0}.checkbox-field{color:#cbd5f5}.field input,.field select,.field textarea{background:#1e1b4b;border-color:#312e81;color:#e2e8f0}.host-list li,.detail-list div,.list li{color:#cbd5f5}.list a{color:#a5b4fc}.state{background:#0f172a;color:#cbd5f5;box-shadow:0 10px 20px #0f172a66}.state.error{background:#7f1d1d;color:#fee2e2}.state.success{background:#14532d;color:#bbf7d0}.ghost-pill{border-color:#4f46e5;color:#cbd5f5}.footer{color:#94a3b8}}*{box-sizing:border-box}body{margin:0;background:#fff}@media (prefers-color-scheme: dark){body{background:#0b1120}}img{max-width:100%;display:block} diff --git a/dist/assets/index-DDjGuoSe.js b/dist/assets/index-CfHTe5gv.js similarity index 84% rename from dist/assets/index-DDjGuoSe.js rename to dist/assets/index-CfHTe5gv.js index 496a568..0043812 100644 --- a/dist/assets/index-DDjGuoSe.js +++ b/dist/assets/index-CfHTe5gv.js @@ -22,7 +22,7 @@ function Pf(e,t){for(var n=0;n>>1,b=_[W];if(0>>1;Wl(Un,z))$el(bt,Un)?(_[W]=bt,_[$e]=z,W=$e):(_[W]=Un,_[Ve]=z,W=Ve);else if($el(bt,z))_[W]=bt,_[$e]=z,W=$e;else break e}}return O}function l(_,O){var z=_.sortIndex-O.sortIndex;return z!==0?z:_.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var s=[],c=[],v=1,h=null,m=3,x=!1,g=!1,w=!1,k=typeof setTimeout=="function"?setTimeout:null,d=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function p(_){for(var O=n(c);O!==null;){if(O.callback===null)r(c);else if(O.startTime<=_)r(c),O.sortIndex=O.expirationTime,t(s,O);else break;O=n(c)}}function S(_){if(w=!1,p(_),!g)if(n(s)!==null)g=!0,Je(j);else{var O=n(c);O!==null&&Ne(S,O.startTime-_)}}function j(_,O){g=!1,w&&(w=!1,d(R),R=-1),x=!0;var z=m;try{for(p(O),h=n(s);h!==null&&(!(h.expirationTime>O)||_&&!ie());){var W=h.callback;if(typeof W=="function"){h.callback=null,m=h.priorityLevel;var b=W(h.expirationTime<=O);O=e.unstable_now(),typeof b=="function"?h.callback=b:h===n(s)&&r(s),p(O)}else r(s);h=n(s)}if(h!==null)var Ft=!0;else{var Ve=n(c);Ve!==null&&Ne(S,Ve.startTime-O),Ft=!1}return Ft}finally{h=null,m=z,x=!1}}var C=!1,P=null,R=-1,B=5,I=-1;function ie(){return!(e.unstable_now()-I_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function(_){switch(m){case 1:case 2:case 3:var O=3;break;default:O=m}var z=m;m=O;try{return _()}finally{m=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,O){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var z=m;m=_;try{return O()}finally{m=z}},e.unstable_scheduleCallback=function(_,O,z){var W=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0W?(_.sortIndex=z,t(c,_),n(s)===null&&_===n(c)&&(w?(d(R),R=-1):w=!0,Ne(S,z-W))):(_.sortIndex=b,t(s,_),g||x||(g=!0,Je(j))),_},e.unstable_shouldYield=ie,e.unstable_wrapCallback=function(_){var O=m;return function(){var z=m;m=O;try{return _.apply(this,arguments)}finally{m=z}}}})(lu);ru.exports=lu;var Zf=ru.exports;/** + */(function(e){function t(_,I){var z=_.length;_.push(I);e:for(;0>>1,b=_[W];if(0>>1;Wl(Un,z))$el(bt,Un)?(_[W]=bt,_[$e]=z,W=$e):(_[W]=Un,_[Ve]=z,W=Ve);else if($el(bt,z))_[W]=bt,_[$e]=z,W=$e;else break e}}return I}function l(_,I){var z=_.sortIndex-I.sortIndex;return z!==0?z:_.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var s=[],c=[],v=1,m=null,h=3,x=!1,g=!1,w=!1,k=typeof setTimeout=="function"?setTimeout:null,d=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function p(_){for(var I=n(c);I!==null;){if(I.callback===null)r(c);else if(I.startTime<=_)r(c),I.sortIndex=I.expirationTime,t(s,I);else break;I=n(c)}}function S(_){if(w=!1,p(_),!g)if(n(s)!==null)g=!0,Je(N);else{var I=n(c);I!==null&&Ne(S,I.startTime-_)}}function N(_,I){g=!1,w&&(w=!1,d(R),R=-1),x=!0;var z=h;try{for(p(I),m=n(s);m!==null&&(!(m.expirationTime>I)||_&&!ie());){var W=m.callback;if(typeof W=="function"){m.callback=null,h=m.priorityLevel;var b=W(m.expirationTime<=I);I=e.unstable_now(),typeof b=="function"?m.callback=b:m===n(s)&&r(s),p(I)}else r(s);m=n(s)}if(m!==null)var Ft=!0;else{var Ve=n(c);Ve!==null&&Ne(S,Ve.startTime-I),Ft=!1}return Ft}finally{m=null,h=z,x=!1}}var E=!1,P=null,R=-1,B=5,O=-1;function ie(){return!(e.unstable_now()-O_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function(_){switch(h){case 1:case 2:case 3:var I=3;break;default:I=h}var z=h;h=I;try{return _()}finally{h=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,I){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var z=h;h=_;try{return I()}finally{h=z}},e.unstable_scheduleCallback=function(_,I,z){var W=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0W?(_.sortIndex=z,t(c,_),n(s)===null&&_===n(c)&&(w?(d(R),R=-1):w=!0,Ne(S,z-W))):(_.sortIndex=b,t(s,_),g||x||(g=!0,Je(N))),_},e.unstable_shouldYield=ie,e.unstable_wrapCallback=function(_){var I=h;return function(){var z=h;h=I;try{return _.apply(this,arguments)}finally{h=z}}}})(lu);ru.exports=lu;var Zf=ru.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ function Pf(e,t){for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ci=Object.prototype.hasOwnProperty,bf=/^[: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]*$/,_s={},Ls={};function ed(e){return Ci.call(Ls,e)?!0:Ci.call(_s,e)?!1:bf.test(e)?Ls[e]=!0:(_s[e]=!0,!1)}function td(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function nd(e,t,n,r){if(t===null||typeof t>"u"||td(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function we(e,t,n,r,l,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var fe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){fe[e]=new we(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];fe[t]=new we(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){fe[e]=new we(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){fe[e]=new we(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){fe[e]=new we(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){fe[e]=new we(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){fe[e]=new we(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){fe[e]=new we(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){fe[e]=new we(e,5,!1,e.toLowerCase(),null,!1,!1)});var Lo=/[\-:]([a-z])/g;function Ro(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Lo,Ro);fe[t]=new we(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Lo,Ro);fe[t]=new we(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Lo,Ro);fe[t]=new we(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){fe[e]=new we(e,1,!1,e.toLowerCase(),null,!1,!1)});fe.xlinkHref=new we("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){fe[e]=new we(e,1,!1,e.toLowerCase(),null,!0,!0)});function To(e,t,n,r){var l=fe.hasOwnProperty(t)?fe[t]:null;(l!==null?l.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ci=Object.prototype.hasOwnProperty,bf=/^[: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]*$/,_s={},Ls={};function ed(e){return Ci.call(Ls,e)?!0:Ci.call(_s,e)?!1:bf.test(e)?Ls[e]=!0:(_s[e]=!0,!1)}function td(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function nd(e,t,n,r){if(t===null||typeof t>"u"||td(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function we(e,t,n,r,l,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var fe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){fe[e]=new we(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];fe[t]=new we(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){fe[e]=new we(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){fe[e]=new we(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){fe[e]=new we(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){fe[e]=new we(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){fe[e]=new we(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){fe[e]=new we(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){fe[e]=new we(e,5,!1,e.toLowerCase(),null,!1,!1)});var Lo=/[\-:]([a-z])/g;function Ro(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Lo,Ro);fe[t]=new we(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Lo,Ro);fe[t]=new we(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Lo,Ro);fe[t]=new we(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){fe[e]=new we(e,1,!1,e.toLowerCase(),null,!1,!1)});fe.xlinkHref=new we("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){fe[e]=new we(e,1,!1,e.toLowerCase(),null,!0,!0)});function To(e,t,n,r){var l=fe.hasOwnProperty(t)?fe[t]:null;(l!==null?l.type!==0:r||!(2a||l[o]!==i[a]){var s=` -`+l[o].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=o&&0<=a);break}}}finally{ei=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Hn(e):""}function rd(e){switch(e.tag){case 5:return Hn(e.type);case 16:return Hn("Lazy");case 13:return Hn("Suspense");case 19:return Hn("SuspenseList");case 0:case 2:case 15:return e=ti(e.type,!1),e;case 11:return e=ti(e.type.render,!1),e;case 1:return e=ti(e.type,!0),e;default:return""}}function Ri(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 ln:return"Fragment";case rn:return"Portal";case Pi:return"Profiler";case zo:return"StrictMode";case _i:return"Suspense";case Li:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case su:return(e.displayName||"Context")+".Consumer";case ou:return(e._context.displayName||"Context")+".Provider";case Oo:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Io:return t=e.displayName||null,t!==null?t:Ri(e.type)||"Memo";case mt:t=e._payload,e=e._init;try{return Ri(e(t))}catch{}}return null}function ld(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ri(t);case 8:return t===zo?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Tt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function uu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function id(e){var t=uu(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Tr(e){e._valueTracker||(e._valueTracker=id(e))}function cu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=uu(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function il(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 Ti(e,t){var n=t.checked;return J({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ts(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Tt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function fu(e,t){t=t.checked,t!=null&&To(e,"checked",t,!1)}function zi(e,t){fu(e,t);var n=Tt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Oi(e,t.type,n):t.hasOwnProperty("defaultValue")&&Oi(e,t.type,Tt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function zs(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Oi(e,t,n){(t!=="number"||il(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Qn=Array.isArray;function vn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=zr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ir(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Yn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},od=["Webkit","ms","Moz","O"];Object.keys(Yn).forEach(function(e){od.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Yn[t]=Yn[e]})});function mu(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Yn.hasOwnProperty(e)&&Yn[e]?(""+t).trim():t+"px"}function vu(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=mu(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var sd=J({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Mi(e,t){if(t){if(sd[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(E(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(E(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(E(61))}if(t.style!=null&&typeof t.style!="object")throw Error(E(62))}}function Di(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Fi=null;function Uo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ai=null,gn=null,yn=null;function Us(e){if(e=Cr(e)){if(typeof Ai!="function")throw Error(E(280));var t=e.stateNode;t&&(t=Ml(t),Ai(e.stateNode,e.type,t))}}function gu(e){gn?yn?yn.push(e):yn=[e]:gn=e}function yu(){if(gn){var e=gn,t=yn;if(yn=gn=null,Us(e),t)for(e=0;e>>=0,e===0?32:31-(yd(e)/wd|0)|0}var Or=64,Ir=4194304;function Kn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ul(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~l;a!==0?r=Kn(a):(i&=o,i!==0&&(r=Kn(i)))}else o=n&~l,o!==0?r=Kn(o):i!==0&&(r=Kn(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Er(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ge(t),e[t]=n}function jd(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Zn),Hs=" ",Qs=!1;function Fu(e,t){switch(e){case"keyup":return Zd.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Au(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var on=!1;function bd(e,t){switch(e){case"compositionend":return Au(t);case"keypress":return t.which!==32?null:(Qs=!0,Hs);case"textInput":return e=t.data,e===Hs&&Qs?null:e;default:return null}}function ep(e,t){if(on)return e==="compositionend"||!Wo&&Fu(e,t)?(e=Mu(),Jr=Bo=wt=null,on=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ys(n)}}function Wu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Wu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hu(){for(var e=window,t=il();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=il(e.document)}return t}function Ho(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function up(e){var t=Hu(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Wu(n.ownerDocument.documentElement,n)){if(r!==null&&Ho(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,i=Math.min(r.start,l);r=r.end===void 0?i:Math.min(r.end,l),!e.extend&&i>r&&(l=r,r=i,i=l),l=Js(n,i);var o=Js(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,sn=null,Qi=null,bn=null,Ki=!1;function Zs(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ki||sn==null||sn!==il(r)||(r=sn,"selectionStart"in r&&Ho(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),bn&&fr(bn,r)||(bn=r,r=dl(Qi,"onSelect"),0cn||(e.current=qi[cn],qi[cn]=null,cn--)}function H(e,t){cn++,qi[cn]=e.current,e.current=t}var zt={},me=It(zt),ke=It(!1),Kt=zt;function jn(e,t){var n=e.type.contextTypes;if(!n)return zt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in n)l[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function je(e){return e=e.childContextTypes,e!=null}function hl(){K(ke),K(me)}function la(e,t,n){if(me.current!==zt)throw Error(E(168));H(me,t),H(ke,n)}function bu(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(E(108,ld(e)||"Unknown",l));return J({},n,r)}function ml(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zt,Kt=me.current,H(me,e),H(ke,ke.current),!0}function ia(e,t,n){var r=e.stateNode;if(!r)throw Error(E(169));n?(e=bu(e,t,Kt),r.__reactInternalMemoizedMergedChildContext=e,K(ke),K(me),H(me,e)):K(ke),H(ke,n)}var rt=null,Dl=!1,mi=!1;function ec(e){rt===null?rt=[e]:rt.push(e)}function Sp(e){Dl=!0,ec(e)}function Ut(){if(!mi&&rt!==null){mi=!0;var e=0,t=V;try{var n=rt;for(V=1;e>=o,l-=o,lt=1<<32-Ge(t)+l|n<R?(B=P,P=null):B=P.sibling;var I=m(d,P,p[R],S);if(I===null){P===null&&(P=B);break}e&&P&&I.alternate===null&&t(d,P),f=i(I,f,R),C===null?j=I:C.sibling=I,C=I,P=B}if(R===p.length)return n(d,P),G&&At(d,R),j;if(P===null){for(;RR?(B=P,P=null):B=P.sibling;var ie=m(d,P,I.value,S);if(ie===null){P===null&&(P=B);break}e&&P&&ie.alternate===null&&t(d,P),f=i(ie,f,R),C===null?j=ie:C.sibling=ie,C=ie,P=B}if(I.done)return n(d,P),G&&At(d,R),j;if(P===null){for(;!I.done;R++,I=p.next())I=h(d,I.value,S),I!==null&&(f=i(I,f,R),C===null?j=I:C.sibling=I,C=I);return G&&At(d,R),j}for(P=r(d,P);!I.done;R++,I=p.next())I=x(P,d,R,I.value,S),I!==null&&(e&&I.alternate!==null&&P.delete(I.key===null?R:I.key),f=i(I,f,R),C===null?j=I:C.sibling=I,C=I);return e&&P.forEach(function(T){return t(d,T)}),G&&At(d,R),j}function k(d,f,p,S){if(typeof p=="object"&&p!==null&&p.type===ln&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case Rr:e:{for(var j=p.key,C=f;C!==null;){if(C.key===j){if(j=p.type,j===ln){if(C.tag===7){n(d,C.sibling),f=l(C,p.props.children),f.return=d,d=f;break e}}else if(C.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===mt&&aa(j)===C.type){n(d,C.sibling),f=l(C,p.props),f.ref=Vn(d,C,p),f.return=d,d=f;break e}n(d,C);break}else t(d,C);C=C.sibling}p.type===ln?(f=Qt(p.props.children,d.mode,S,p.key),f.return=d,d=f):(S=ll(p.type,p.key,p.props,null,d.mode,S),S.ref=Vn(d,f,p),S.return=d,d=S)}return o(d);case rn:e:{for(C=p.key;f!==null;){if(f.key===C)if(f.tag===4&&f.stateNode.containerInfo===p.containerInfo&&f.stateNode.implementation===p.implementation){n(d,f.sibling),f=l(f,p.children||[]),f.return=d,d=f;break e}else{n(d,f);break}else t(d,f);f=f.sibling}f=ji(p,d.mode,S),f.return=d,d=f}return o(d);case mt:return C=p._init,k(d,f,C(p._payload),S)}if(Qn(p))return g(d,f,p,S);if(Mn(p))return w(d,f,p,S);Vr(d,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,f!==null&&f.tag===6?(n(d,f.sibling),f=l(f,p),f.return=d,d=f):(n(d,f),f=ki(p,d.mode,S),f.return=d,d=f),o(d)):n(d,f)}return k}var Nn=lc(!0),ic=lc(!1),yl=It(null),wl=null,pn=null,Xo=null;function Yo(){Xo=pn=wl=null}function Jo(e){var t=yl.current;K(yl),e._currentValue=t}function to(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function xn(e,t){wl=e,Xo=pn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Se=!0),e.firstContext=null)}function Ae(e){var t=e._currentValue;if(Xo!==e)if(e={context:e,memoizedValue:t,next:null},pn===null){if(wl===null)throw Error(E(308));pn=e,wl.dependencies={lanes:0,firstContext:e}}else pn=pn.next=e;return t}var $t=null;function Zo(e){$t===null?$t=[e]:$t.push(e)}function oc(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Zo(t)):(n.next=l.next,l.next=n),t.interleaved=n,ut(e,r)}function ut(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var vt=!1;function qo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function sc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ot(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ct(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,F&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,ut(e,n)}return l=r.interleaved,l===null?(t.next=t,Zo(r)):(t.next=l.next,l.next=t),r.interleaved=t,ut(e,n)}function qr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Do(e,n)}}function ua(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?l=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?l=i=t:i=i.next=t}else l=i=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function xl(e,t,n,r){var l=e.updateQueue;vt=!1;var i=l.firstBaseUpdate,o=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var s=a,c=s.next;s.next=null,o===null?i=c:o.next=c,o=s;var v=e.alternate;v!==null&&(v=v.updateQueue,a=v.lastBaseUpdate,a!==o&&(a===null?v.firstBaseUpdate=c:a.next=c,v.lastBaseUpdate=s))}if(i!==null){var h=l.baseState;o=0,v=c=s=null,a=i;do{var m=a.lane,x=a.eventTime;if((r&m)===m){v!==null&&(v=v.next={eventTime:x,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=e,w=a;switch(m=t,x=n,w.tag){case 1:if(g=w.payload,typeof g=="function"){h=g.call(x,h,m);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=w.payload,m=typeof g=="function"?g.call(x,h,m):g,m==null)break e;h=J({},h,m);break e;case 2:vt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,m=l.effects,m===null?l.effects=[a]:m.push(a))}else x={eventTime:x,lane:m,tag:a.tag,payload:a.payload,callback:a.callback,next:null},v===null?(c=v=x,s=h):v=v.next=x,o|=m;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;m=a,a=m.next,m.next=null,l.lastBaseUpdate=m,l.shared.pending=null}}while(!0);if(v===null&&(s=h),l.baseState=s,l.firstBaseUpdate=c,l.lastBaseUpdate=v,t=l.shared.interleaved,t!==null){l=t;do o|=l.lane,l=l.next;while(l!==t)}else i===null&&(l.shared.lanes=0);Yt|=o,e.lanes=o,e.memoizedState=h}}function ca(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=gi.transition;gi.transition={};try{e(!1),t()}finally{V=n,gi.transition=r}}function Ec(){return Be().memoizedState}function Np(e,t,n){var r=_t(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Nc(e))Cc(t,n);else if(n=oc(e,t,n,r),n!==null){var l=ge();Xe(n,e,r,l),Pc(n,t,r)}}function Cp(e,t,n){var r=_t(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Nc(e))Cc(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(l.hasEagerState=!0,l.eagerState=a,Ye(a,o)){var s=t.interleaved;s===null?(l.next=l,Zo(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=oc(e,t,l,r),n!==null&&(l=ge(),Xe(n,e,r,l),Pc(n,t,r))}}function Nc(e){var t=e.alternate;return e===Y||t!==null&&t===Y}function Cc(e,t){er=kl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Pc(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Do(e,n)}}var jl={readContext:Ae,useCallback:de,useContext:de,useEffect:de,useImperativeHandle:de,useInsertionEffect:de,useLayoutEffect:de,useMemo:de,useReducer:de,useRef:de,useState:de,useDebugValue:de,useDeferredValue:de,useTransition:de,useMutableSource:de,useSyncExternalStore:de,useId:de,unstable_isNewReconciler:!1},Pp={readContext:Ae,useCallback:function(e,t){return qe().memoizedState=[e,t===void 0?null:t],e},useContext:Ae,useEffect:da,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,el(4194308,4,wc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return el(4194308,4,e,t)},useInsertionEffect:function(e,t){return el(4,2,e,t)},useMemo:function(e,t){var n=qe();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=qe();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Np.bind(null,Y,e),[r.memoizedState,e]},useRef:function(e){var t=qe();return e={current:e},t.memoizedState=e},useState:fa,useDebugValue:os,useDeferredValue:function(e){return qe().memoizedState=e},useTransition:function(){var e=fa(!1),t=e[0];return e=Ep.bind(null,e[1]),qe().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Y,l=qe();if(G){if(n===void 0)throw Error(E(407));n=n()}else{if(n=t(),ae===null)throw Error(E(349));Xt&30||fc(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,da(pc.bind(null,r,i,e),[e]),r.flags|=2048,wr(9,dc.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=qe(),t=ae.identifierPrefix;if(G){var n=it,r=lt;n=(r&~(1<<32-Ge(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=gr++,0")&&(s=s.replace("",e.displayName)),s}while(1<=o&&0<=a);break}}}finally{ei=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Hn(e):""}function rd(e){switch(e.tag){case 5:return Hn(e.type);case 16:return Hn("Lazy");case 13:return Hn("Suspense");case 19:return Hn("SuspenseList");case 0:case 2:case 15:return e=ti(e.type,!1),e;case 11:return e=ti(e.type.render,!1),e;case 1:return e=ti(e.type,!0),e;default:return""}}function Ri(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 ln:return"Fragment";case rn:return"Portal";case Pi:return"Profiler";case zo:return"StrictMode";case _i:return"Suspense";case Li:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case su:return(e.displayName||"Context")+".Consumer";case ou:return(e._context.displayName||"Context")+".Provider";case Oo:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Io:return t=e.displayName||null,t!==null?t:Ri(e.type)||"Memo";case mt:t=e._payload,e=e._init;try{return Ri(e(t))}catch{}}return null}function ld(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ri(t);case 8:return t===zo?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Tt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function uu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function id(e){var t=uu(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Tr(e){e._valueTracker||(e._valueTracker=id(e))}function cu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=uu(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function il(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 Ti(e,t){var n=t.checked;return J({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ts(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Tt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function fu(e,t){t=t.checked,t!=null&&To(e,"checked",t,!1)}function zi(e,t){fu(e,t);var n=Tt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Oi(e,t.type,n):t.hasOwnProperty("defaultValue")&&Oi(e,t.type,Tt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function zs(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Oi(e,t,n){(t!=="number"||il(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Qn=Array.isArray;function vn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=zr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ir(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Yn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},od=["Webkit","ms","Moz","O"];Object.keys(Yn).forEach(function(e){od.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Yn[t]=Yn[e]})});function mu(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Yn.hasOwnProperty(e)&&Yn[e]?(""+t).trim():t+"px"}function vu(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=mu(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var sd=J({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Mi(e,t){if(t){if(sd[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(j(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(j(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(j(61))}if(t.style!=null&&typeof t.style!="object")throw Error(j(62))}}function Di(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Fi=null;function Uo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ai=null,gn=null,yn=null;function Us(e){if(e=Cr(e)){if(typeof Ai!="function")throw Error(j(280));var t=e.stateNode;t&&(t=Ml(t),Ai(e.stateNode,e.type,t))}}function gu(e){gn?yn?yn.push(e):yn=[e]:gn=e}function yu(){if(gn){var e=gn,t=yn;if(yn=gn=null,Us(e),t)for(e=0;e>>=0,e===0?32:31-(yd(e)/wd|0)|0}var Or=64,Ir=4194304;function Kn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ul(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~l;a!==0?r=Kn(a):(i&=o,i!==0&&(r=Kn(i)))}else o=n&~l,o!==0?r=Kn(o):i!==0&&(r=Kn(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Er(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ge(t),e[t]=n}function jd(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Zn),Hs=" ",Qs=!1;function Fu(e,t){switch(e){case"keyup":return Zd.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Au(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var on=!1;function bd(e,t){switch(e){case"compositionend":return Au(t);case"keypress":return t.which!==32?null:(Qs=!0,Hs);case"textInput":return e=t.data,e===Hs&&Qs?null:e;default:return null}}function ep(e,t){if(on)return e==="compositionend"||!Wo&&Fu(e,t)?(e=Mu(),Jr=Bo=wt=null,on=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ys(n)}}function Wu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Wu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hu(){for(var e=window,t=il();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=il(e.document)}return t}function Ho(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function up(e){var t=Hu(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Wu(n.ownerDocument.documentElement,n)){if(r!==null&&Ho(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,i=Math.min(r.start,l);r=r.end===void 0?i:Math.min(r.end,l),!e.extend&&i>r&&(l=r,r=i,i=l),l=Js(n,i);var o=Js(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,sn=null,Qi=null,bn=null,Ki=!1;function Zs(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ki||sn==null||sn!==il(r)||(r=sn,"selectionStart"in r&&Ho(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),bn&&fr(bn,r)||(bn=r,r=dl(Qi,"onSelect"),0cn||(e.current=qi[cn],qi[cn]=null,cn--)}function H(e,t){cn++,qi[cn]=e.current,e.current=t}var zt={},me=It(zt),ke=It(!1),Kt=zt;function jn(e,t){var n=e.type.contextTypes;if(!n)return zt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in n)l[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function je(e){return e=e.childContextTypes,e!=null}function hl(){K(ke),K(me)}function la(e,t,n){if(me.current!==zt)throw Error(j(168));H(me,t),H(ke,n)}function bu(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(j(108,ld(e)||"Unknown",l));return J({},n,r)}function ml(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zt,Kt=me.current,H(me,e),H(ke,ke.current),!0}function ia(e,t,n){var r=e.stateNode;if(!r)throw Error(j(169));n?(e=bu(e,t,Kt),r.__reactInternalMemoizedMergedChildContext=e,K(ke),K(me),H(me,e)):K(ke),H(ke,n)}var rt=null,Dl=!1,mi=!1;function ec(e){rt===null?rt=[e]:rt.push(e)}function Sp(e){Dl=!0,ec(e)}function Ut(){if(!mi&&rt!==null){mi=!0;var e=0,t=V;try{var n=rt;for(V=1;e>=o,l-=o,lt=1<<32-Ge(t)+l|n<R?(B=P,P=null):B=P.sibling;var O=h(d,P,p[R],S);if(O===null){P===null&&(P=B);break}e&&P&&O.alternate===null&&t(d,P),f=i(O,f,R),E===null?N=O:E.sibling=O,E=O,P=B}if(R===p.length)return n(d,P),G&&At(d,R),N;if(P===null){for(;RR?(B=P,P=null):B=P.sibling;var ie=h(d,P,O.value,S);if(ie===null){P===null&&(P=B);break}e&&P&&ie.alternate===null&&t(d,P),f=i(ie,f,R),E===null?N=ie:E.sibling=ie,E=ie,P=B}if(O.done)return n(d,P),G&&At(d,R),N;if(P===null){for(;!O.done;R++,O=p.next())O=m(d,O.value,S),O!==null&&(f=i(O,f,R),E===null?N=O:E.sibling=O,E=O);return G&&At(d,R),N}for(P=r(d,P);!O.done;R++,O=p.next())O=x(P,d,R,O.value,S),O!==null&&(e&&O.alternate!==null&&P.delete(O.key===null?R:O.key),f=i(O,f,R),E===null?N=O:E.sibling=O,E=O);return e&&P.forEach(function(T){return t(d,T)}),G&&At(d,R),N}function k(d,f,p,S){if(typeof p=="object"&&p!==null&&p.type===ln&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case Rr:e:{for(var N=p.key,E=f;E!==null;){if(E.key===N){if(N=p.type,N===ln){if(E.tag===7){n(d,E.sibling),f=l(E,p.props.children),f.return=d,d=f;break e}}else if(E.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===mt&&aa(N)===E.type){n(d,E.sibling),f=l(E,p.props),f.ref=Vn(d,E,p),f.return=d,d=f;break e}n(d,E);break}else t(d,E);E=E.sibling}p.type===ln?(f=Qt(p.props.children,d.mode,S,p.key),f.return=d,d=f):(S=ll(p.type,p.key,p.props,null,d.mode,S),S.ref=Vn(d,f,p),S.return=d,d=S)}return o(d);case rn:e:{for(E=p.key;f!==null;){if(f.key===E)if(f.tag===4&&f.stateNode.containerInfo===p.containerInfo&&f.stateNode.implementation===p.implementation){n(d,f.sibling),f=l(f,p.children||[]),f.return=d,d=f;break e}else{n(d,f);break}else t(d,f);f=f.sibling}f=ji(p,d.mode,S),f.return=d,d=f}return o(d);case mt:return E=p._init,k(d,f,E(p._payload),S)}if(Qn(p))return g(d,f,p,S);if(Mn(p))return w(d,f,p,S);Vr(d,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,f!==null&&f.tag===6?(n(d,f.sibling),f=l(f,p),f.return=d,d=f):(n(d,f),f=ki(p,d.mode,S),f.return=d,d=f),o(d)):n(d,f)}return k}var Nn=lc(!0),ic=lc(!1),yl=It(null),wl=null,pn=null,Xo=null;function Yo(){Xo=pn=wl=null}function Jo(e){var t=yl.current;K(yl),e._currentValue=t}function to(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function xn(e,t){wl=e,Xo=pn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Se=!0),e.firstContext=null)}function Ae(e){var t=e._currentValue;if(Xo!==e)if(e={context:e,memoizedValue:t,next:null},pn===null){if(wl===null)throw Error(j(308));pn=e,wl.dependencies={lanes:0,firstContext:e}}else pn=pn.next=e;return t}var $t=null;function Zo(e){$t===null?$t=[e]:$t.push(e)}function oc(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Zo(t)):(n.next=l.next,l.next=n),t.interleaved=n,ut(e,r)}function ut(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var vt=!1;function qo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function sc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ot(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ct(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,F&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,ut(e,n)}return l=r.interleaved,l===null?(t.next=t,Zo(r)):(t.next=l.next,l.next=t),r.interleaved=t,ut(e,n)}function qr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Do(e,n)}}function ua(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?l=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?l=i=t:i=i.next=t}else l=i=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function xl(e,t,n,r){var l=e.updateQueue;vt=!1;var i=l.firstBaseUpdate,o=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var s=a,c=s.next;s.next=null,o===null?i=c:o.next=c,o=s;var v=e.alternate;v!==null&&(v=v.updateQueue,a=v.lastBaseUpdate,a!==o&&(a===null?v.firstBaseUpdate=c:a.next=c,v.lastBaseUpdate=s))}if(i!==null){var m=l.baseState;o=0,v=c=s=null,a=i;do{var h=a.lane,x=a.eventTime;if((r&h)===h){v!==null&&(v=v.next={eventTime:x,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=e,w=a;switch(h=t,x=n,w.tag){case 1:if(g=w.payload,typeof g=="function"){m=g.call(x,m,h);break e}m=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=w.payload,h=typeof g=="function"?g.call(x,m,h):g,h==null)break e;m=J({},m,h);break e;case 2:vt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=l.effects,h===null?l.effects=[a]:h.push(a))}else x={eventTime:x,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},v===null?(c=v=x,s=m):v=v.next=x,o|=h;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;h=a,a=h.next,h.next=null,l.lastBaseUpdate=h,l.shared.pending=null}}while(!0);if(v===null&&(s=m),l.baseState=s,l.firstBaseUpdate=c,l.lastBaseUpdate=v,t=l.shared.interleaved,t!==null){l=t;do o|=l.lane,l=l.next;while(l!==t)}else i===null&&(l.shared.lanes=0);Yt|=o,e.lanes=o,e.memoizedState=m}}function ca(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=gi.transition;gi.transition={};try{e(!1),t()}finally{V=n,gi.transition=r}}function Ec(){return Be().memoizedState}function Np(e,t,n){var r=_t(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Nc(e))Cc(t,n);else if(n=oc(e,t,n,r),n!==null){var l=ge();Xe(n,e,r,l),Pc(n,t,r)}}function Cp(e,t,n){var r=_t(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Nc(e))Cc(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(l.hasEagerState=!0,l.eagerState=a,Ye(a,o)){var s=t.interleaved;s===null?(l.next=l,Zo(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=oc(e,t,l,r),n!==null&&(l=ge(),Xe(n,e,r,l),Pc(n,t,r))}}function Nc(e){var t=e.alternate;return e===Y||t!==null&&t===Y}function Cc(e,t){er=kl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Pc(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Do(e,n)}}var jl={readContext:Ae,useCallback:de,useContext:de,useEffect:de,useImperativeHandle:de,useInsertionEffect:de,useLayoutEffect:de,useMemo:de,useReducer:de,useRef:de,useState:de,useDebugValue:de,useDeferredValue:de,useTransition:de,useMutableSource:de,useSyncExternalStore:de,useId:de,unstable_isNewReconciler:!1},Pp={readContext:Ae,useCallback:function(e,t){return qe().memoizedState=[e,t===void 0?null:t],e},useContext:Ae,useEffect:da,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,el(4194308,4,wc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return el(4194308,4,e,t)},useInsertionEffect:function(e,t){return el(4,2,e,t)},useMemo:function(e,t){var n=qe();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=qe();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Np.bind(null,Y,e),[r.memoizedState,e]},useRef:function(e){var t=qe();return e={current:e},t.memoizedState=e},useState:fa,useDebugValue:os,useDeferredValue:function(e){return qe().memoizedState=e},useTransition:function(){var e=fa(!1),t=e[0];return e=Ep.bind(null,e[1]),qe().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Y,l=qe();if(G){if(n===void 0)throw Error(j(407));n=n()}else{if(n=t(),ae===null)throw Error(j(349));Xt&30||fc(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,da(pc.bind(null,r,i,e),[e]),r.flags|=2048,wr(9,dc.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=qe(),t=ae.identifierPrefix;if(G){var n=it,r=lt;n=(r&~(1<<32-Ge(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=gr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[be]=t,e[hr]=r,Dc(e,t,!1,!1),t.stateNode=e;e:{switch(o=Di(n,r),n){case"dialog":Q("cancel",e),Q("close",e),l=r;break;case"iframe":case"object":case"embed":Q("load",e),l=r;break;case"video":case"audio":for(l=0;l_n&&(t.flags|=128,r=!0,$n(i,!1),t.lanes=4194304)}else{if(!r)if(e=Sl(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),$n(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!G)return pe(t),null}else 2*te()-i.renderingStartTime>_n&&n!==1073741824&&(t.flags|=128,r=!0,$n(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=te(),t.sibling=null,n=X.current,H(X,r?n&1|2:n&1),t):(pe(t),null);case 22:case 23:return ds(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?_e&1073741824&&(pe(t),t.subtreeFlags&6&&(t.flags|=8192)):pe(t),null;case 24:return null;case 25:return null}throw Error(E(156,t.tag))}function Up(e,t){switch(Ko(t),t.tag){case 1:return je(t.type)&&hl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Cn(),K(ke),K(me),ts(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return es(t),null;case 13:if(K(X),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(E(340));En()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return K(X),null;case 4:return Cn(),null;case 10:return Jo(t.type._context),null;case 22:case 23:return ds(),null;case 24:return null;default:return null}}var Wr=!1,he=!1,Mp=typeof WeakSet=="function"?WeakSet:Set,L=null;function hn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Z(e,t,r)}else n.current=null}function co(e,t,n){try{n()}catch(r){Z(e,t,r)}}var ja=!1;function Dp(e,t){if(Gi=cl,e=Hu(),Ho(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,s=-1,c=0,v=0,h=e,m=null;t:for(;;){for(var x;h!==n||l!==0&&h.nodeType!==3||(a=o+l),h!==i||r!==0&&h.nodeType!==3||(s=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(x=h.firstChild)!==null;)m=h,h=x;for(;;){if(h===e)break t;if(m===n&&++c===l&&(a=o),m===i&&++v===r&&(s=o),(x=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=x}n=a===-1||s===-1?null:{start:a,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xi={focusedElem:e,selectionRange:n},cl=!1,L=t;L!==null;)if(t=L,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,L=e;else for(;L!==null;){t=L;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var w=g.memoizedProps,k=g.memoizedState,d=t.stateNode,f=d.getSnapshotBeforeUpdate(t.elementType===t.type?w:He(t.type,w),k);d.__reactInternalSnapshotBeforeUpdate=f}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(E(163))}}catch(S){Z(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,L=e;break}L=t.return}return g=ja,ja=!1,g}function tr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&co(t,n,i)}l=l.next}while(l!==r)}}function Bl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function fo(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Bc(e){var t=e.alternate;t!==null&&(e.alternate=null,Bc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[be],delete t[hr],delete t[Zi],delete t[wp],delete t[xp])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Vc(e){return e.tag===5||e.tag===3||e.tag===4}function Ea(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Vc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function po(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=pl));else if(r!==4&&(e=e.child,e!==null))for(po(e,t,n),e=e.sibling;e!==null;)po(e,t,n),e=e.sibling}function ho(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ho(e,t,n),e=e.sibling;e!==null;)ho(e,t,n),e=e.sibling}var ue=null,Qe=!1;function ht(e,t,n){for(n=n.child;n!==null;)$c(e,t,n),n=n.sibling}function $c(e,t,n){if(et&&typeof et.onCommitFiberUnmount=="function")try{et.onCommitFiberUnmount(zl,n)}catch{}switch(n.tag){case 5:he||hn(n,t);case 6:var r=ue,l=Qe;ue=null,ht(e,t,n),ue=r,Qe=l,ue!==null&&(Qe?(e=ue,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ue.removeChild(n.stateNode));break;case 18:ue!==null&&(Qe?(e=ue,n=n.stateNode,e.nodeType===8?hi(e.parentNode,n):e.nodeType===1&&hi(e,n),ur(e)):hi(ue,n.stateNode));break;case 4:r=ue,l=Qe,ue=n.stateNode.containerInfo,Qe=!0,ht(e,t,n),ue=r,Qe=l;break;case 0:case 11:case 14:case 15:if(!he&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&co(n,t,o),l=l.next}while(l!==r)}ht(e,t,n);break;case 1:if(!he&&(hn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Z(n,t,a)}ht(e,t,n);break;case 21:ht(e,t,n);break;case 22:n.mode&1?(he=(r=he)||n.memoizedState!==null,ht(e,t,n),he=r):ht(e,t,n);break;default:ht(e,t,n)}}function Na(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Mp),t.forEach(function(r){var l=Kp.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function We(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~i}if(r=l,r=te()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ap(r/1960))-r,10e?16:e,xt===null)var r=!1;else{if(e=xt,xt=null,Cl=0,F&6)throw Error(E(331));var l=F;for(F|=4,L=e.current;L!==null;){var i=L,o=i.child;if(L.flags&16){var a=i.deletions;if(a!==null){for(var s=0;ste()-cs?Ht(e,0):us|=n),Ee(e,t)}function Jc(e,t){t===0&&(e.mode&1?(t=Ir,Ir<<=1,!(Ir&130023424)&&(Ir=4194304)):t=1);var n=ge();e=ut(e,t),e!==null&&(Er(e,t,n),Ee(e,n))}function Qp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Jc(e,n)}function Kp(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(E(314))}r!==null&&r.delete(t),Jc(e,n)}var Zc;Zc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ke.current)Se=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Se=!1,Op(e,t,n);Se=!!(e.flags&131072)}else Se=!1,G&&t.flags&1048576&&tc(t,gl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;tl(e,t),e=t.pendingProps;var l=jn(t,me.current);xn(t,n),l=rs(null,t,r,e,l,n);var i=ls();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,je(r)?(i=!0,ml(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,qo(t),l.updater=Al,t.stateNode=l,l._reactInternals=t,ro(t,r,e,n),t=oo(null,t,r,!0,i,n)):(t.tag=0,G&&i&&Qo(t),ve(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(tl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Xp(r),e=He(r,e),l){case 0:t=io(null,t,r,e,n);break e;case 1:t=xa(null,t,r,e,n);break e;case 11:t=ya(null,t,r,e,n);break e;case 14:t=wa(null,t,r,He(r.type,e),n);break e}throw Error(E(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:He(r,l),io(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:He(r,l),xa(e,t,r,l,n);case 3:e:{if(Ic(t),e===null)throw Error(E(387));r=t.pendingProps,i=t.memoizedState,l=i.element,sc(e,t),xl(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=Pn(Error(E(423)),t),t=Sa(e,t,r,n,l);break e}else if(r!==l){l=Pn(Error(E(424)),t),t=Sa(e,t,r,n,l);break e}else for(Le=Nt(t.stateNode.containerInfo.firstChild),Re=t,G=!0,Ke=null,n=ic(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(En(),r===l){t=ct(e,t,n);break e}ve(e,t,r,n)}t=t.child}return t;case 5:return ac(t),e===null&&eo(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,o=l.children,Yi(r,l)?o=null:i!==null&&Yi(r,i)&&(t.flags|=32),Oc(e,t),ve(e,t,o,n),t.child;case 6:return e===null&&eo(t),null;case 13:return Uc(e,t,n);case 4:return bo(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Nn(t,null,r,n):ve(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:He(r,l),ya(e,t,r,l,n);case 7:return ve(e,t,t.pendingProps,n),t.child;case 8:return ve(e,t,t.pendingProps.children,n),t.child;case 12:return ve(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,i=t.memoizedProps,o=l.value,H(yl,r._currentValue),r._currentValue=o,i!==null)if(Ye(i.value,o)){if(i.children===l.children&&!ke.current){t=ct(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var s=a.firstContext;s!==null;){if(s.context===r){if(i.tag===1){s=ot(-1,n&-n),s.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var v=c.pending;v===null?s.next=s:(s.next=v.next,v.next=s),c.pending=s}}i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),to(i.return,n,t),a.lanes|=n;break}s=s.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(E(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),to(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}ve(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,xn(t,n),l=Ae(l),r=r(l),t.flags|=1,ve(e,t,r,n),t.child;case 14:return r=t.type,l=He(r,t.pendingProps),l=He(r.type,l),wa(e,t,r,l,n);case 15:return Tc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:He(r,l),tl(e,t),t.tag=1,je(r)?(e=!0,ml(t)):e=!1,xn(t,n),_c(t,r,l),ro(t,r,l,n),oo(null,t,r,!0,e,n);case 19:return Mc(e,t,n);case 22:return zc(e,t,n)}throw Error(E(156,t.tag))};function qc(e,t){return Nu(e,t)}function Gp(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function De(e,t,n,r){return new Gp(e,t,n,r)}function hs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Xp(e){if(typeof e=="function")return hs(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Oo)return 11;if(e===Io)return 14}return 2}function Lt(e,t){var n=e.alternate;return n===null?(n=De(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ll(e,t,n,r,l,i){var o=2;if(r=e,typeof e=="function")hs(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ln:return Qt(n.children,l,i,t);case zo:o=8,l|=8;break;case Pi:return e=De(12,n,t,l|2),e.elementType=Pi,e.lanes=i,e;case _i:return e=De(13,n,t,l),e.elementType=_i,e.lanes=i,e;case Li:return e=De(19,n,t,l),e.elementType=Li,e.lanes=i,e;case au:return $l(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ou:o=10;break e;case su:o=9;break e;case Oo:o=11;break e;case Io:o=14;break e;case mt:o=16,r=null;break e}throw Error(E(130,e==null?e:typeof e,""))}return t=De(o,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function Qt(e,t,n,r){return e=De(7,e,r,t),e.lanes=n,e}function $l(e,t,n,r){return e=De(22,e,r,t),e.elementType=au,e.lanes=n,e.stateNode={isHidden:!1},e}function ki(e,t,n){return e=De(6,e,null,t),e.lanes=n,e}function ji(e,t,n){return t=De(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Yp(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ri(0),this.expirationTimes=ri(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ri(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function ms(e,t,n,r,l,i,o,a,s){return e=new Yp(e,t,n,a,s),t===1?(t=1,i===!0&&(t|=8)):t=0,i=De(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},qo(i),e}function Jp(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(nf)}catch(e){console.error(e)}}nf(),nu.exports=ze;var th=nu.exports,rf,Oa=th;rf=Oa.createRoot,Oa.hydrateRoot;/** +`+i.stack}return{value:e,source:t,stack:l,digest:null}}function xi(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function lo(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Rp=typeof WeakMap=="function"?WeakMap:Map;function Lc(e,t,n){n=ot(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Nl||(Nl=!0,mo=r),lo(e,t)},n}function Rc(e,t,n){n=ot(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){lo(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){lo(e,t),typeof r!="function"&&(Pt===null?Pt=new Set([this]):Pt.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function ma(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rp;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=Hp.bind(null,e,t,n),t.then(e,e))}function va(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function ga(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=ot(-1,1),t.tag=2,Ct(n,t,1))),n.lanes|=1),e)}var Tp=ft.ReactCurrentOwner,Se=!1;function ve(e,t,n,r){t.child=e===null?ic(t,null,n,r):Nn(t,e.child,n,r)}function ya(e,t,n,r,l){n=n.render;var i=t.ref;return xn(t,l),r=rs(e,t,n,r,i,l),n=ls(),e!==null&&!Se?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,ct(e,t,l)):(G&&n&&Qo(t),t.flags|=1,ve(e,t,r,l),t.child)}function wa(e,t,n,r,l){if(e===null){var i=n.type;return typeof i=="function"&&!hs(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Tc(e,t,i,r,l)):(e=ll(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&l)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:fr,n(o,r)&&e.ref===t.ref)return ct(e,t,l)}return t.flags|=1,e=Lt(i,r),e.ref=t.ref,e.return=t,t.child=e}function Tc(e,t,n,r,l){if(e!==null){var i=e.memoizedProps;if(fr(i,r)&&e.ref===t.ref)if(Se=!1,t.pendingProps=r=i,(e.lanes&l)!==0)e.flags&131072&&(Se=!0);else return t.lanes=e.lanes,ct(e,t,l)}return io(e,t,n,r,l)}function zc(e,t,n){var r=t.pendingProps,l=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},H(mn,_e),_e|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,H(mn,_e),_e|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,H(mn,_e),_e|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,H(mn,_e),_e|=r;return ve(e,t,l,n),t.child}function Oc(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function io(e,t,n,r,l){var i=je(n)?Kt:me.current;return i=jn(t,i),xn(t,l),n=rs(e,t,n,r,i,l),r=ls(),e!==null&&!Se?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,ct(e,t,l)):(G&&r&&Qo(t),t.flags|=1,ve(e,t,n,l),t.child)}function xa(e,t,n,r,l){if(je(n)){var i=!0;ml(t)}else i=!1;if(xn(t,l),t.stateNode===null)tl(e,t),_c(t,n,r),ro(t,n,r,l),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var s=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=Ae(c):(c=je(n)?Kt:me.current,c=jn(t,c));var v=n.getDerivedStateFromProps,m=typeof v=="function"||typeof o.getSnapshotBeforeUpdate=="function";m||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||s!==c)&&ha(t,o,r,c),vt=!1;var h=t.memoizedState;o.state=h,xl(t,r,o,l),s=t.memoizedState,a!==r||h!==s||ke.current||vt?(typeof v=="function"&&(no(t,n,v,r),s=t.memoizedState),(a=vt||pa(t,n,a,r,h,s,c))?(m||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),o.props=r,o.state=s,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,sc(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:He(t.type,a),o.props=c,m=t.pendingProps,h=o.context,s=n.contextType,typeof s=="object"&&s!==null?s=Ae(s):(s=je(n)?Kt:me.current,s=jn(t,s));var x=n.getDerivedStateFromProps;(v=typeof x=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==m||h!==s)&&ha(t,o,r,s),vt=!1,h=t.memoizedState,o.state=h,xl(t,r,o,l);var g=t.memoizedState;a!==m||h!==g||ke.current||vt?(typeof x=="function"&&(no(t,n,x,r),g=t.memoizedState),(c=vt||pa(t,n,c,r,h,g,s)||!1)?(v||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,s),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,s)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),o.props=r,o.state=g,o.context=s,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return oo(e,t,n,r,i,l)}function oo(e,t,n,r,l,i){Oc(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return l&&ia(t,n,!1),ct(e,t,i);r=t.stateNode,Tp.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Nn(t,e.child,null,i),t.child=Nn(t,null,a,i)):ve(e,t,a,i),t.memoizedState=r.state,l&&ia(t,n,!0),t.child}function Ic(e){var t=e.stateNode;t.pendingContext?la(e,t.pendingContext,t.pendingContext!==t.context):t.context&&la(e,t.context,!1),bo(e,t.containerInfo)}function Sa(e,t,n,r,l){return En(),Go(l),t.flags|=256,ve(e,t,n,r),t.child}var so={dehydrated:null,treeContext:null,retryLane:0};function ao(e){return{baseLanes:e,cachePool:null,transitions:null}}function Uc(e,t,n){var r=t.pendingProps,l=X.current,i=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(l&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),H(X,l&1),e===null)return eo(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=$l(o,r,0,null),e=Qt(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=ao(n),t.memoizedState=so,e):ss(t,o));if(l=e.memoizedState,l!==null&&(a=l.dehydrated,a!==null))return zp(e,t,o,r,a,l,n);if(i){i=r.fallback,o=t.mode,l=e.child,a=l.sibling;var s={mode:"hidden",children:r.children};return!(o&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=s,t.deletions=null):(r=Lt(l,s),r.subtreeFlags=l.subtreeFlags&14680064),a!==null?i=Lt(a,i):(i=Qt(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?ao(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=so,r}return i=e.child,e=i.sibling,r=Lt(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function ss(e,t){return t=$l({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function $r(e,t,n,r){return r!==null&&Go(r),Nn(t,e.child,null,n),e=ss(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function zp(e,t,n,r,l,i,o){if(n)return t.flags&256?(t.flags&=-257,r=xi(Error(j(422))),$r(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,l=t.mode,r=$l({mode:"visible",children:r.children},l,0,null),i=Qt(i,l,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Nn(t,e.child,null,o),t.child.memoizedState=ao(o),t.memoizedState=so,i);if(!(t.mode&1))return $r(e,t,o,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(j(419)),r=xi(i,r,void 0),$r(e,t,o,r)}if(a=(o&e.childLanes)!==0,Se||a){if(r=ae,r!==null){switch(o&-o){case 4:l=2;break;case 16:l=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(r.suspendedLanes|o)?0:l,l!==0&&l!==i.retryLane&&(i.retryLane=l,ut(e,l),Xe(r,e,l,-1))}return ps(),r=xi(Error(j(421))),$r(e,t,o,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=Qp.bind(null,e),l._reactRetry=t,null):(e=i.treeContext,Le=Nt(l.nextSibling),Re=t,G=!0,Ke=null,e!==null&&(Ue[Me++]=lt,Ue[Me++]=it,Ue[Me++]=Gt,lt=e.id,it=e.overflow,Gt=t),t=ss(t,r.children),t.flags|=4096,t)}function ka(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),to(e.return,t,n)}function Si(e,t,n,r,l){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=l)}function Mc(e,t,n){var r=t.pendingProps,l=r.revealOrder,i=r.tail;if(ve(e,t,r.children,n),r=X.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ka(e,n,t);else if(e.tag===19)ka(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(H(X,r),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&Sl(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),Si(t,!1,l,n,i);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&Sl(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}Si(t,!0,n,null,i);break;case"together":Si(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function tl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ct(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Yt|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(j(153));if(t.child!==null){for(e=t.child,n=Lt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Lt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Op(e,t,n){switch(t.tag){case 3:Ic(t),En();break;case 5:ac(t);break;case 1:je(t.type)&&ml(t);break;case 4:bo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;H(yl,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(H(X,X.current&1),t.flags|=128,null):n&t.child.childLanes?Uc(e,t,n):(H(X,X.current&1),e=ct(e,t,n),e!==null?e.sibling:null);H(X,X.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Mc(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),H(X,X.current),r)break;return null;case 22:case 23:return t.lanes=0,zc(e,t,n)}return ct(e,t,n)}var Dc,uo,Fc,Ac;Dc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};uo=function(){};Fc=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,Wt(tt.current);var i=null;switch(n){case"input":l=Ti(e,l),r=Ti(e,r),i=[];break;case"select":l=J({},l,{value:void 0}),r=J({},r,{value:void 0}),i=[];break;case"textarea":l=Ii(e,l),r=Ii(e,r),i=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=pl)}Mi(n,r);var o;n=null;for(c in l)if(!r.hasOwnProperty(c)&&l.hasOwnProperty(c)&&l[c]!=null)if(c==="style"){var a=l[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(lr.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var s=r[c];if(a=l!=null?l[c]:void 0,r.hasOwnProperty(c)&&s!==a&&(s!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||s&&s.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in s)s.hasOwnProperty(o)&&a[o]!==s[o]&&(n||(n={}),n[o]=s[o])}else n||(i||(i=[]),i.push(c,n)),n=s;else c==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,a=a?a.__html:void 0,s!=null&&a!==s&&(i=i||[]).push(c,s)):c==="children"?typeof s!="string"&&typeof s!="number"||(i=i||[]).push(c,""+s):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(lr.hasOwnProperty(c)?(s!=null&&c==="onScroll"&&Q("scroll",e),i||a===s||(i=[])):(i=i||[]).push(c,s))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};Ac=function(e,t,n,r){n!==r&&(t.flags|=4)};function $n(e,t){if(!G)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function pe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ip(e,t,n){var r=t.pendingProps;switch(Ko(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pe(t),null;case 1:return je(t.type)&&hl(),pe(t),null;case 3:return r=t.stateNode,Cn(),K(ke),K(me),ts(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Br(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ke!==null&&(yo(Ke),Ke=null))),uo(e,t),pe(t),null;case 5:es(t);var l=Wt(vr.current);if(n=t.type,e!==null&&t.stateNode!=null)Fc(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(j(166));return pe(t),null}if(e=Wt(tt.current),Br(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[be]=t,r[hr]=i,e=(t.mode&1)!==0,n){case"dialog":Q("cancel",r),Q("close",r);break;case"iframe":case"object":case"embed":Q("load",r);break;case"video":case"audio":for(l=0;l<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[be]=t,e[hr]=r,Dc(e,t,!1,!1),t.stateNode=e;e:{switch(o=Di(n,r),n){case"dialog":Q("cancel",e),Q("close",e),l=r;break;case"iframe":case"object":case"embed":Q("load",e),l=r;break;case"video":case"audio":for(l=0;l_n&&(t.flags|=128,r=!0,$n(i,!1),t.lanes=4194304)}else{if(!r)if(e=Sl(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),$n(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!G)return pe(t),null}else 2*te()-i.renderingStartTime>_n&&n!==1073741824&&(t.flags|=128,r=!0,$n(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=te(),t.sibling=null,n=X.current,H(X,r?n&1|2:n&1),t):(pe(t),null);case 22:case 23:return ds(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?_e&1073741824&&(pe(t),t.subtreeFlags&6&&(t.flags|=8192)):pe(t),null;case 24:return null;case 25:return null}throw Error(j(156,t.tag))}function Up(e,t){switch(Ko(t),t.tag){case 1:return je(t.type)&&hl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Cn(),K(ke),K(me),ts(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return es(t),null;case 13:if(K(X),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(j(340));En()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return K(X),null;case 4:return Cn(),null;case 10:return Jo(t.type._context),null;case 22:case 23:return ds(),null;case 24:return null;default:return null}}var Wr=!1,he=!1,Mp=typeof WeakSet=="function"?WeakSet:Set,L=null;function hn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Z(e,t,r)}else n.current=null}function co(e,t,n){try{n()}catch(r){Z(e,t,r)}}var ja=!1;function Dp(e,t){if(Gi=cl,e=Hu(),Ho(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,s=-1,c=0,v=0,m=e,h=null;t:for(;;){for(var x;m!==n||l!==0&&m.nodeType!==3||(a=o+l),m!==i||r!==0&&m.nodeType!==3||(s=o+r),m.nodeType===3&&(o+=m.nodeValue.length),(x=m.firstChild)!==null;)h=m,m=x;for(;;){if(m===e)break t;if(h===n&&++c===l&&(a=o),h===i&&++v===r&&(s=o),(x=m.nextSibling)!==null)break;m=h,h=m.parentNode}m=x}n=a===-1||s===-1?null:{start:a,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xi={focusedElem:e,selectionRange:n},cl=!1,L=t;L!==null;)if(t=L,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,L=e;else for(;L!==null;){t=L;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var w=g.memoizedProps,k=g.memoizedState,d=t.stateNode,f=d.getSnapshotBeforeUpdate(t.elementType===t.type?w:He(t.type,w),k);d.__reactInternalSnapshotBeforeUpdate=f}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(j(163))}}catch(S){Z(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,L=e;break}L=t.return}return g=ja,ja=!1,g}function tr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&co(t,n,i)}l=l.next}while(l!==r)}}function Bl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function fo(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Bc(e){var t=e.alternate;t!==null&&(e.alternate=null,Bc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[be],delete t[hr],delete t[Zi],delete t[wp],delete t[xp])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Vc(e){return e.tag===5||e.tag===3||e.tag===4}function Ea(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Vc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function po(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=pl));else if(r!==4&&(e=e.child,e!==null))for(po(e,t,n),e=e.sibling;e!==null;)po(e,t,n),e=e.sibling}function ho(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ho(e,t,n),e=e.sibling;e!==null;)ho(e,t,n),e=e.sibling}var ue=null,Qe=!1;function ht(e,t,n){for(n=n.child;n!==null;)$c(e,t,n),n=n.sibling}function $c(e,t,n){if(et&&typeof et.onCommitFiberUnmount=="function")try{et.onCommitFiberUnmount(zl,n)}catch{}switch(n.tag){case 5:he||hn(n,t);case 6:var r=ue,l=Qe;ue=null,ht(e,t,n),ue=r,Qe=l,ue!==null&&(Qe?(e=ue,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ue.removeChild(n.stateNode));break;case 18:ue!==null&&(Qe?(e=ue,n=n.stateNode,e.nodeType===8?hi(e.parentNode,n):e.nodeType===1&&hi(e,n),ur(e)):hi(ue,n.stateNode));break;case 4:r=ue,l=Qe,ue=n.stateNode.containerInfo,Qe=!0,ht(e,t,n),ue=r,Qe=l;break;case 0:case 11:case 14:case 15:if(!he&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&co(n,t,o),l=l.next}while(l!==r)}ht(e,t,n);break;case 1:if(!he&&(hn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Z(n,t,a)}ht(e,t,n);break;case 21:ht(e,t,n);break;case 22:n.mode&1?(he=(r=he)||n.memoizedState!==null,ht(e,t,n),he=r):ht(e,t,n);break;default:ht(e,t,n)}}function Na(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Mp),t.forEach(function(r){var l=Kp.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function We(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~i}if(r=l,r=te()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ap(r/1960))-r,10e?16:e,xt===null)var r=!1;else{if(e=xt,xt=null,Cl=0,F&6)throw Error(j(331));var l=F;for(F|=4,L=e.current;L!==null;){var i=L,o=i.child;if(L.flags&16){var a=i.deletions;if(a!==null){for(var s=0;ste()-cs?Ht(e,0):us|=n),Ee(e,t)}function Jc(e,t){t===0&&(e.mode&1?(t=Ir,Ir<<=1,!(Ir&130023424)&&(Ir=4194304)):t=1);var n=ge();e=ut(e,t),e!==null&&(Er(e,t,n),Ee(e,n))}function Qp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Jc(e,n)}function Kp(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(j(314))}r!==null&&r.delete(t),Jc(e,n)}var Zc;Zc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ke.current)Se=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Se=!1,Op(e,t,n);Se=!!(e.flags&131072)}else Se=!1,G&&t.flags&1048576&&tc(t,gl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;tl(e,t),e=t.pendingProps;var l=jn(t,me.current);xn(t,n),l=rs(null,t,r,e,l,n);var i=ls();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,je(r)?(i=!0,ml(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,qo(t),l.updater=Al,t.stateNode=l,l._reactInternals=t,ro(t,r,e,n),t=oo(null,t,r,!0,i,n)):(t.tag=0,G&&i&&Qo(t),ve(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(tl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Xp(r),e=He(r,e),l){case 0:t=io(null,t,r,e,n);break e;case 1:t=xa(null,t,r,e,n);break e;case 11:t=ya(null,t,r,e,n);break e;case 14:t=wa(null,t,r,He(r.type,e),n);break e}throw Error(j(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:He(r,l),io(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:He(r,l),xa(e,t,r,l,n);case 3:e:{if(Ic(t),e===null)throw Error(j(387));r=t.pendingProps,i=t.memoizedState,l=i.element,sc(e,t),xl(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=Pn(Error(j(423)),t),t=Sa(e,t,r,n,l);break e}else if(r!==l){l=Pn(Error(j(424)),t),t=Sa(e,t,r,n,l);break e}else for(Le=Nt(t.stateNode.containerInfo.firstChild),Re=t,G=!0,Ke=null,n=ic(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(En(),r===l){t=ct(e,t,n);break e}ve(e,t,r,n)}t=t.child}return t;case 5:return ac(t),e===null&&eo(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,o=l.children,Yi(r,l)?o=null:i!==null&&Yi(r,i)&&(t.flags|=32),Oc(e,t),ve(e,t,o,n),t.child;case 6:return e===null&&eo(t),null;case 13:return Uc(e,t,n);case 4:return bo(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Nn(t,null,r,n):ve(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:He(r,l),ya(e,t,r,l,n);case 7:return ve(e,t,t.pendingProps,n),t.child;case 8:return ve(e,t,t.pendingProps.children,n),t.child;case 12:return ve(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,i=t.memoizedProps,o=l.value,H(yl,r._currentValue),r._currentValue=o,i!==null)if(Ye(i.value,o)){if(i.children===l.children&&!ke.current){t=ct(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var s=a.firstContext;s!==null;){if(s.context===r){if(i.tag===1){s=ot(-1,n&-n),s.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var v=c.pending;v===null?s.next=s:(s.next=v.next,v.next=s),c.pending=s}}i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),to(i.return,n,t),a.lanes|=n;break}s=s.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(j(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),to(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}ve(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,xn(t,n),l=Ae(l),r=r(l),t.flags|=1,ve(e,t,r,n),t.child;case 14:return r=t.type,l=He(r,t.pendingProps),l=He(r.type,l),wa(e,t,r,l,n);case 15:return Tc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:He(r,l),tl(e,t),t.tag=1,je(r)?(e=!0,ml(t)):e=!1,xn(t,n),_c(t,r,l),ro(t,r,l,n),oo(null,t,r,!0,e,n);case 19:return Mc(e,t,n);case 22:return zc(e,t,n)}throw Error(j(156,t.tag))};function qc(e,t){return Nu(e,t)}function Gp(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function De(e,t,n,r){return new Gp(e,t,n,r)}function hs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Xp(e){if(typeof e=="function")return hs(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Oo)return 11;if(e===Io)return 14}return 2}function Lt(e,t){var n=e.alternate;return n===null?(n=De(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ll(e,t,n,r,l,i){var o=2;if(r=e,typeof e=="function")hs(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ln:return Qt(n.children,l,i,t);case zo:o=8,l|=8;break;case Pi:return e=De(12,n,t,l|2),e.elementType=Pi,e.lanes=i,e;case _i:return e=De(13,n,t,l),e.elementType=_i,e.lanes=i,e;case Li:return e=De(19,n,t,l),e.elementType=Li,e.lanes=i,e;case au:return $l(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ou:o=10;break e;case su:o=9;break e;case Oo:o=11;break e;case Io:o=14;break e;case mt:o=16,r=null;break e}throw Error(j(130,e==null?e:typeof e,""))}return t=De(o,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function Qt(e,t,n,r){return e=De(7,e,r,t),e.lanes=n,e}function $l(e,t,n,r){return e=De(22,e,r,t),e.elementType=au,e.lanes=n,e.stateNode={isHidden:!1},e}function ki(e,t,n){return e=De(6,e,null,t),e.lanes=n,e}function ji(e,t,n){return t=De(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Yp(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ri(0),this.expirationTimes=ri(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ri(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function ms(e,t,n,r,l,i,o,a,s){return e=new Yp(e,t,n,a,s),t===1?(t=1,i===!0&&(t|=8)):t=0,i=De(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},qo(i),e}function Jp(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(nf)}catch(e){console.error(e)}}nf(),nu.exports=ze;var th=nu.exports,rf,Oa=th;rf=Oa.createRoot,Oa.hydrateRoot;/** * @remix-run/router v1.23.2 * * Copyright (c) Remix Software Inc. @@ -46,7 +46,7 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Sr(){return Sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function ws(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function rh(){return Math.random().toString(36).substr(2,8)}function Ua(e,t){return{usr:e.state,key:e.key,idx:t}}function wo(e,t,n,r){return n===void 0&&(n=null),Sr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?On(t):t,{state:n,key:t&&t.key||r||rh()})}function Ll(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function On(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function lh(e,t,n,r){r===void 0&&(r={});let{window:l=document.defaultView,v5Compat:i=!1}=r,o=l.history,a=St.Pop,s=null,c=v();c==null&&(c=0,o.replaceState(Sr({},o.state,{idx:c}),""));function v(){return(o.state||{idx:null}).idx}function h(){a=St.Pop;let k=v(),d=k==null?null:k-c;c=k,s&&s({action:a,location:w.location,delta:d})}function m(k,d){a=St.Push;let f=wo(w.location,k,d);c=v()+1;let p=Ua(f,c),S=w.createHref(f);try{o.pushState(p,"",S)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;l.location.assign(S)}i&&s&&s({action:a,location:w.location,delta:1})}function x(k,d){a=St.Replace;let f=wo(w.location,k,d);c=v();let p=Ua(f,c),S=w.createHref(f);o.replaceState(p,"",S),i&&s&&s({action:a,location:w.location,delta:0})}function g(k){let d=l.location.origin!=="null"?l.location.origin:l.location.href,f=typeof k=="string"?k:Ll(k);return f=f.replace(/ $/,"%20"),q(d,"No window.location.(origin|href) available to create URL for href: "+f),new URL(f,d)}let w={get action(){return a},get location(){return e(l,o)},listen(k){if(s)throw new Error("A history only accepts one active listener");return l.addEventListener(Ia,h),s=k,()=>{l.removeEventListener(Ia,h),s=null}},createHref(k){return t(l,k)},createURL:g,encodeLocation(k){let d=g(k);return{pathname:d.pathname,search:d.search,hash:d.hash}},push:m,replace:x,go(k){return o.go(k)}};return w}var Ma;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ma||(Ma={}));function ih(e,t,n){return n===void 0&&(n="/"),oh(e,t,n)}function oh(e,t,n,r){let l=typeof t=="string"?On(t):t,i=Ln(l.pathname||"/",n);if(i==null)return null;let o=lf(e);sh(o);let a=null;for(let s=0;a==null&&s{let s={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};s.relativePath.startsWith("/")&&(q(s.relativePath.startsWith(r),'Absolute route path "'+s.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),s.relativePath=s.relativePath.slice(r.length));let c=Rt([r,s.relativePath]),v=n.concat(s);i.children&&i.children.length>0&&(q(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),lf(i.children,t,v,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:hh(c,i.index),routesMeta:v})};return e.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))l(i,o);else for(let s of of(i.path))l(i,o,s)}),t}function of(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return l?[i,""]:[i];let o=of(r.join("/")),a=[];return a.push(...o.map(s=>s===""?i:[i,s].join("/"))),l&&a.push(...o),a.map(s=>e.startsWith("/")&&s===""?"/":s)}function sh(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:mh(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const ah=/^:[\w-]+$/,uh=3,ch=2,fh=1,dh=10,ph=-2,Da=e=>e==="*";function hh(e,t){let n=e.split("/"),r=n.length;return n.some(Da)&&(r+=ph),t&&(r+=ch),n.filter(l=>!Da(l)).reduce((l,i)=>l+(ah.test(i)?uh:i===""?fh:dh),r)}function mh(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function vh(e,t,n){let{routesMeta:r}=e,l={},i="/",o=[];for(let a=0;a{let{paramName:m,isOptional:x}=v;if(m==="*"){let w=a[h]||"";o=i.slice(0,i.length-w.length).replace(/(.)\/+$/,"$1")}const g=a[h];return x&&!g?c[m]=void 0:c[m]=(g||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:o,pattern:e}}function gh(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ws(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,s)=>(r.push({paramName:a,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function yh(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ws(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Ln(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const wh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,xh=e=>wh.test(e);function Sh(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?On(e):e,i;if(n)if(xh(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),ws(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=Fa(n.substring(1),"/"):i=Fa(n,t)}else i=t;return{pathname:i,search:Eh(r),hash:Nh(l)}}function Fa(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function Ei(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function kh(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function sf(e,t){let n=kh(e);return t?n.map((r,l)=>l===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function af(e,t,n,r){r===void 0&&(r=!1);let l;typeof e=="string"?l=On(e):(l=Sr({},e),q(!l.pathname||!l.pathname.includes("?"),Ei("?","pathname","search",l)),q(!l.pathname||!l.pathname.includes("#"),Ei("#","pathname","hash",l)),q(!l.search||!l.search.includes("#"),Ei("#","search","hash",l)));let i=e===""||l.pathname==="",o=i?"/":l.pathname,a;if(o==null)a=n;else{let h=t.length-1;if(!r&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),h-=1;l.pathname=m.join("/")}a=h>=0?t[h]:"/"}let s=Sh(l,a),c=o&&o!=="/"&&o.endsWith("/"),v=(i||o===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(c||v)&&(s.pathname+="/"),s}const Rt=e=>e.join("/").replace(/\/\/+/g,"/"),jh=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Eh=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Nh=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Ch(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const uf=["post","put","patch","delete"];new Set(uf);const Ph=["get",...uf];new Set(Ph);/** + */function Sr(){return Sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function ws(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function rh(){return Math.random().toString(36).substr(2,8)}function Ua(e,t){return{usr:e.state,key:e.key,idx:t}}function wo(e,t,n,r){return n===void 0&&(n=null),Sr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?On(t):t,{state:n,key:t&&t.key||r||rh()})}function Ll(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function On(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function lh(e,t,n,r){r===void 0&&(r={});let{window:l=document.defaultView,v5Compat:i=!1}=r,o=l.history,a=St.Pop,s=null,c=v();c==null&&(c=0,o.replaceState(Sr({},o.state,{idx:c}),""));function v(){return(o.state||{idx:null}).idx}function m(){a=St.Pop;let k=v(),d=k==null?null:k-c;c=k,s&&s({action:a,location:w.location,delta:d})}function h(k,d){a=St.Push;let f=wo(w.location,k,d);c=v()+1;let p=Ua(f,c),S=w.createHref(f);try{o.pushState(p,"",S)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;l.location.assign(S)}i&&s&&s({action:a,location:w.location,delta:1})}function x(k,d){a=St.Replace;let f=wo(w.location,k,d);c=v();let p=Ua(f,c),S=w.createHref(f);o.replaceState(p,"",S),i&&s&&s({action:a,location:w.location,delta:0})}function g(k){let d=l.location.origin!=="null"?l.location.origin:l.location.href,f=typeof k=="string"?k:Ll(k);return f=f.replace(/ $/,"%20"),q(d,"No window.location.(origin|href) available to create URL for href: "+f),new URL(f,d)}let w={get action(){return a},get location(){return e(l,o)},listen(k){if(s)throw new Error("A history only accepts one active listener");return l.addEventListener(Ia,m),s=k,()=>{l.removeEventListener(Ia,m),s=null}},createHref(k){return t(l,k)},createURL:g,encodeLocation(k){let d=g(k);return{pathname:d.pathname,search:d.search,hash:d.hash}},push:h,replace:x,go(k){return o.go(k)}};return w}var Ma;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ma||(Ma={}));function ih(e,t,n){return n===void 0&&(n="/"),oh(e,t,n)}function oh(e,t,n,r){let l=typeof t=="string"?On(t):t,i=Ln(l.pathname||"/",n);if(i==null)return null;let o=lf(e);sh(o);let a=null;for(let s=0;a==null&&s{let s={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};s.relativePath.startsWith("/")&&(q(s.relativePath.startsWith(r),'Absolute route path "'+s.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),s.relativePath=s.relativePath.slice(r.length));let c=Rt([r,s.relativePath]),v=n.concat(s);i.children&&i.children.length>0&&(q(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),lf(i.children,t,v,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:hh(c,i.index),routesMeta:v})};return e.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))l(i,o);else for(let s of of(i.path))l(i,o,s)}),t}function of(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return l?[i,""]:[i];let o=of(r.join("/")),a=[];return a.push(...o.map(s=>s===""?i:[i,s].join("/"))),l&&a.push(...o),a.map(s=>e.startsWith("/")&&s===""?"/":s)}function sh(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:mh(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const ah=/^:[\w-]+$/,uh=3,ch=2,fh=1,dh=10,ph=-2,Da=e=>e==="*";function hh(e,t){let n=e.split("/"),r=n.length;return n.some(Da)&&(r+=ph),t&&(r+=ch),n.filter(l=>!Da(l)).reduce((l,i)=>l+(ah.test(i)?uh:i===""?fh:dh),r)}function mh(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function vh(e,t,n){let{routesMeta:r}=e,l={},i="/",o=[];for(let a=0;a{let{paramName:h,isOptional:x}=v;if(h==="*"){let w=a[m]||"";o=i.slice(0,i.length-w.length).replace(/(.)\/+$/,"$1")}const g=a[m];return x&&!g?c[h]=void 0:c[h]=(g||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:o,pattern:e}}function gh(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ws(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,s)=>(r.push({paramName:a,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function yh(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ws(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Ln(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const wh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,xh=e=>wh.test(e);function Sh(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?On(e):e,i;if(n)if(xh(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),ws(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=Fa(n.substring(1),"/"):i=Fa(n,t)}else i=t;return{pathname:i,search:Eh(r),hash:Nh(l)}}function Fa(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function Ei(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function kh(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function sf(e,t){let n=kh(e);return t?n.map((r,l)=>l===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function af(e,t,n,r){r===void 0&&(r=!1);let l;typeof e=="string"?l=On(e):(l=Sr({},e),q(!l.pathname||!l.pathname.includes("?"),Ei("?","pathname","search",l)),q(!l.pathname||!l.pathname.includes("#"),Ei("#","pathname","hash",l)),q(!l.search||!l.search.includes("#"),Ei("#","search","hash",l)));let i=e===""||l.pathname==="",o=i?"/":l.pathname,a;if(o==null)a=n;else{let m=t.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),m-=1;l.pathname=h.join("/")}a=m>=0?t[m]:"/"}let s=Sh(l,a),c=o&&o!=="/"&&o.endsWith("/"),v=(i||o===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(c||v)&&(s.pathname+="/"),s}const Rt=e=>e.join("/").replace(/\/\/+/g,"/"),jh=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Eh=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Nh=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Ch(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const uf=["post","put","patch","delete"];new Set(uf);const Ph=["get",...uf];new Set(Ph);/** * React Router v6.30.3 * * Copyright (c) Remix Software Inc. @@ -55,7 +55,7 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function kr(){return kr=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),y.useCallback(function(c,v){if(v===void 0&&(v={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let h=af(c,JSON.parse(o),i,v.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Rt([t,h.pathname])),(v.replace?r.replace:r.push)(h,v.state,v)},[t,r,o,i,e])}function Rh(){let{matches:e}=y.useContext(Dt),t=e[e.length-1];return t?t.params:{}}function Yl(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=y.useContext(Mt),{matches:l}=y.useContext(Dt),{pathname:i}=In(),o=JSON.stringify(sf(l,r.v7_relativeSplatPath));return y.useMemo(()=>af(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function Th(e,t){return zh(e,t)}function zh(e,t,n,r){_r()||q(!1);let{navigator:l}=y.useContext(Mt),{matches:i}=y.useContext(Dt),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let s=o?o.pathnameBase:"/";o&&o.route;let c=In(),v;if(t){var h;let k=typeof t=="string"?On(t):t;s==="/"||(h=k.pathname)!=null&&h.startsWith(s)||q(!1),v=k}else v=c;let m=v.pathname||"/",x=m;if(s!=="/"){let k=s.replace(/^\//,"").split("/");x="/"+m.replace(/^\//,"").split("/").slice(k.length).join("/")}let g=ih(e,{pathname:x}),w=Dh(g&&g.map(k=>Object.assign({},k,{params:Object.assign({},a,k.params),pathname:Rt([s,l.encodeLocation?l.encodeLocation(k.pathname).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?s:Rt([s,l.encodeLocation?l.encodeLocation(k.pathnameBase).pathname:k.pathnameBase])})),i,n,r);return t&&w?y.createElement(Xl.Provider,{value:{location:kr({pathname:"/",search:"",hash:"",state:null,key:"default"},v),navigationType:St.Pop}},w):w}function Oh(){let e=Vh(),t=Ch(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:l},n):null,null)}const Ih=y.createElement(Oh,null);class Uh extends y.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?y.createElement(Dt.Provider,{value:this.props.routeContext},y.createElement(ff.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Mh(e){let{routeContext:t,match:n,children:r}=e,l=y.useContext(Gl);return l&&l.static&&l.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(Dt.Provider,{value:t},r)}function Dh(e,t,n,r){var l;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(l=n)==null?void 0:l.errors;if(a!=null){let v=o.findIndex(h=>h.route.id&&(a==null?void 0:a[h.route.id])!==void 0);v>=0||q(!1),o=o.slice(0,Math.min(o.length,v+1))}let s=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let v=0;v=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((v,h,m)=>{let x,g=!1,w=null,k=null;n&&(x=a&&h.route.id?a[h.route.id]:void 0,w=h.route.errorElement||Ih,s&&(c<0&&m===0?(Wh("route-fallback"),g=!0,k=null):c===m&&(g=!0,k=h.route.hydrateFallbackElement||null)));let d=t.concat(o.slice(0,m+1)),f=()=>{let p;return x?p=w:g?p=k:h.route.Component?p=y.createElement(h.route.Component,null):h.route.element?p=h.route.element:p=v,y.createElement(Mh,{match:h,routeContext:{outlet:v,matches:d,isDataRoute:n!=null},children:p})};return n&&(h.route.ErrorBoundary||h.route.errorElement||m===0)?y.createElement(Uh,{location:n.location,revalidation:n.revalidation,component:w,error:x,children:f(),routeContext:{outlet:null,matches:d,isDataRoute:!0}}):f()},null)}var hf=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(hf||{}),mf=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(mf||{});function Fh(e){let t=y.useContext(Gl);return t||q(!1),t}function Ah(e){let t=y.useContext(cf);return t||q(!1),t}function Bh(e){let t=y.useContext(Dt);return t||q(!1),t}function vf(e){let t=Bh(),n=t.matches[t.matches.length-1];return n.route.id||q(!1),n.route.id}function Vh(){var e;let t=y.useContext(ff),n=Ah(),r=vf();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function $h(){let{router:e}=Fh(hf.UseNavigateStable),t=vf(mf.UseNavigateStable),n=y.useRef(!1);return df(()=>{n.current=!0}),y.useCallback(function(l,i){i===void 0&&(i={}),n.current&&(typeof l=="number"?e.navigate(l):e.navigate(l,kr({fromRouteId:t},i)))},[e,t])}const Aa={};function Wh(e,t,n){Aa[e]||(Aa[e]=!0)}function Hh(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Xn(e){q(!1)}function Qh(e){let{basename:t="/",children:n=null,location:r,navigationType:l=St.Pop,navigator:i,static:o=!1,future:a}=e;_r()&&q(!1);let s=t.replace(/^\/*/,"/"),c=y.useMemo(()=>({basename:s,navigator:i,static:o,future:kr({v7_relativeSplatPath:!1},a)}),[s,a,i,o]);typeof r=="string"&&(r=On(r));let{pathname:v="/",search:h="",hash:m="",state:x=null,key:g="default"}=r,w=y.useMemo(()=>{let k=Ln(v,s);return k==null?null:{location:{pathname:k,search:h,hash:m,state:x,key:g},navigationType:l}},[s,v,h,m,x,g,l]);return w==null?null:y.createElement(Mt.Provider,{value:c},y.createElement(Xl.Provider,{children:n,value:w}))}function Kh(e){let{children:t,location:n}=e;return Th(So(t),n)}new Promise(()=>{});function So(e,t){t===void 0&&(t=[]);let n=[];return y.Children.forEach(e,(r,l)=>{if(!y.isValidElement(r))return;let i=[...t,l];if(r.type===y.Fragment){n.push.apply(n,So(r.props.children,i));return}r.type!==Xn&&q(!1),!r.props.index||!r.props.children||q(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=So(r.props.children,i)),n.push(o)}),n}/** + */function kr(){return kr=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),y.useCallback(function(c,v){if(v===void 0&&(v={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let m=af(c,JSON.parse(o),i,v.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Rt([t,m.pathname])),(v.replace?r.replace:r.push)(m,v.state,v)},[t,r,o,i,e])}function Rh(){let{matches:e}=y.useContext(Dt),t=e[e.length-1];return t?t.params:{}}function Yl(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=y.useContext(Mt),{matches:l}=y.useContext(Dt),{pathname:i}=In(),o=JSON.stringify(sf(l,r.v7_relativeSplatPath));return y.useMemo(()=>af(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function Th(e,t){return zh(e,t)}function zh(e,t,n,r){_r()||q(!1);let{navigator:l}=y.useContext(Mt),{matches:i}=y.useContext(Dt),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let s=o?o.pathnameBase:"/";o&&o.route;let c=In(),v;if(t){var m;let k=typeof t=="string"?On(t):t;s==="/"||(m=k.pathname)!=null&&m.startsWith(s)||q(!1),v=k}else v=c;let h=v.pathname||"/",x=h;if(s!=="/"){let k=s.replace(/^\//,"").split("/");x="/"+h.replace(/^\//,"").split("/").slice(k.length).join("/")}let g=ih(e,{pathname:x}),w=Dh(g&&g.map(k=>Object.assign({},k,{params:Object.assign({},a,k.params),pathname:Rt([s,l.encodeLocation?l.encodeLocation(k.pathname).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?s:Rt([s,l.encodeLocation?l.encodeLocation(k.pathnameBase).pathname:k.pathnameBase])})),i,n,r);return t&&w?y.createElement(Xl.Provider,{value:{location:kr({pathname:"/",search:"",hash:"",state:null,key:"default"},v),navigationType:St.Pop}},w):w}function Oh(){let e=Vh(),t=Ch(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:l},n):null,null)}const Ih=y.createElement(Oh,null);class Uh extends y.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?y.createElement(Dt.Provider,{value:this.props.routeContext},y.createElement(ff.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Mh(e){let{routeContext:t,match:n,children:r}=e,l=y.useContext(Gl);return l&&l.static&&l.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(Dt.Provider,{value:t},r)}function Dh(e,t,n,r){var l;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(l=n)==null?void 0:l.errors;if(a!=null){let v=o.findIndex(m=>m.route.id&&(a==null?void 0:a[m.route.id])!==void 0);v>=0||q(!1),o=o.slice(0,Math.min(o.length,v+1))}let s=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let v=0;v=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((v,m,h)=>{let x,g=!1,w=null,k=null;n&&(x=a&&m.route.id?a[m.route.id]:void 0,w=m.route.errorElement||Ih,s&&(c<0&&h===0?(Wh("route-fallback"),g=!0,k=null):c===h&&(g=!0,k=m.route.hydrateFallbackElement||null)));let d=t.concat(o.slice(0,h+1)),f=()=>{let p;return x?p=w:g?p=k:m.route.Component?p=y.createElement(m.route.Component,null):m.route.element?p=m.route.element:p=v,y.createElement(Mh,{match:m,routeContext:{outlet:v,matches:d,isDataRoute:n!=null},children:p})};return n&&(m.route.ErrorBoundary||m.route.errorElement||h===0)?y.createElement(Uh,{location:n.location,revalidation:n.revalidation,component:w,error:x,children:f(),routeContext:{outlet:null,matches:d,isDataRoute:!0}}):f()},null)}var hf=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(hf||{}),mf=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(mf||{});function Fh(e){let t=y.useContext(Gl);return t||q(!1),t}function Ah(e){let t=y.useContext(cf);return t||q(!1),t}function Bh(e){let t=y.useContext(Dt);return t||q(!1),t}function vf(e){let t=Bh(),n=t.matches[t.matches.length-1];return n.route.id||q(!1),n.route.id}function Vh(){var e;let t=y.useContext(ff),n=Ah(),r=vf();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function $h(){let{router:e}=Fh(hf.UseNavigateStable),t=vf(mf.UseNavigateStable),n=y.useRef(!1);return df(()=>{n.current=!0}),y.useCallback(function(l,i){i===void 0&&(i={}),n.current&&(typeof l=="number"?e.navigate(l):e.navigate(l,kr({fromRouteId:t},i)))},[e,t])}const Aa={};function Wh(e,t,n){Aa[e]||(Aa[e]=!0)}function Hh(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Xn(e){q(!1)}function Qh(e){let{basename:t="/",children:n=null,location:r,navigationType:l=St.Pop,navigator:i,static:o=!1,future:a}=e;_r()&&q(!1);let s=t.replace(/^\/*/,"/"),c=y.useMemo(()=>({basename:s,navigator:i,static:o,future:kr({v7_relativeSplatPath:!1},a)}),[s,a,i,o]);typeof r=="string"&&(r=On(r));let{pathname:v="/",search:m="",hash:h="",state:x=null,key:g="default"}=r,w=y.useMemo(()=>{let k=Ln(v,s);return k==null?null:{location:{pathname:k,search:m,hash:h,state:x,key:g},navigationType:l}},[s,v,m,h,x,g,l]);return w==null?null:y.createElement(Mt.Provider,{value:c},y.createElement(Xl.Provider,{children:n,value:w}))}function Kh(e){let{children:t,location:n}=e;return Th(So(t),n)}new Promise(()=>{});function So(e,t){t===void 0&&(t=[]);let n=[];return y.Children.forEach(e,(r,l)=>{if(!y.isValidElement(r))return;let i=[...t,l];if(r.type===y.Fragment){n.push.apply(n,So(r.props.children,i));return}r.type!==Xn&&q(!1),!r.props.index||!r.props.children||q(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=So(r.props.children,i)),n.push(o)}),n}/** * React Router DOM v6.30.3 * * Copyright (c) Remix Software Inc. @@ -64,5 +64,5 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Rl(){return Rl=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[l]=e[l]);return n}function Gh(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Xh(e,t){return e.button===0&&(!t||t==="_self")&&!Gh(e)}function ko(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(l=>[n,l]):[[n,r]])},[]))}function Yh(e,t){let n=ko(e);return t&&t.forEach((r,l)=>{n.has(l)||t.getAll(l).forEach(i=>{n.append(l,i)})}),n}const Jh=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Zh=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],qh="6";try{window.__reactRouterVersion=qh}catch{}const bh=y.createContext({isTransitioning:!1}),em="startTransition",Ba=Hf[em];function tm(e){let{basename:t,children:n,future:r,window:l}=e,i=y.useRef();i.current==null&&(i.current=nh({window:l,v5Compat:!0}));let o=i.current,[a,s]=y.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},v=y.useCallback(h=>{c&&Ba?Ba(()=>s(h)):s(h)},[s,c]);return y.useLayoutEffect(()=>o.listen(v),[o,v]),y.useEffect(()=>Hh(r),[r]),y.createElement(Qh,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const nm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",rm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jl=y.forwardRef(function(t,n){let{onClick:r,relative:l,reloadDocument:i,replace:o,state:a,target:s,to:c,preventScrollReset:v,viewTransition:h}=t,m=gf(t,Jh),{basename:x}=y.useContext(Mt),g,w=!1;if(typeof c=="string"&&rm.test(c)&&(g=c,nm))try{let p=new URL(window.location.href),S=c.startsWith("//")?new URL(p.protocol+c):new URL(c),j=Ln(S.pathname,x);S.origin===p.origin&&j!=null?c=j+S.search+S.hash:w=!0}catch{}let k=_h(c,{relative:l}),d=im(c,{replace:o,state:a,target:s,preventScrollReset:v,relative:l,viewTransition:h});function f(p){r&&r(p),p.defaultPrevented||d(p)}return y.createElement("a",Rl({},m,{href:g||k,onClick:w||i?r:f,ref:n,target:s}))}),Ni=y.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:l=!1,className:i="",end:o=!1,style:a,to:s,viewTransition:c,children:v}=t,h=gf(t,Zh),m=Yl(s,{relative:h.relative}),x=In(),g=y.useContext(cf),{navigator:w,basename:k}=y.useContext(Mt),d=g!=null&&sm(m)&&c===!0,f=w.encodeLocation?w.encodeLocation(m).pathname:m.pathname,p=x.pathname,S=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;l||(p=p.toLowerCase(),S=S?S.toLowerCase():null,f=f.toLowerCase()),S&&k&&(S=Ln(S,k)||S);const j=f!=="/"&&f.endsWith("/")?f.length-1:f.length;let C=p===f||!o&&p.startsWith(f)&&p.charAt(j)==="/",P=S!=null&&(S===f||!o&&S.startsWith(f)&&S.charAt(f.length)==="/"),R={isActive:C,isPending:P,isTransitioning:d},B=C?r:void 0,I;typeof i=="function"?I=i(R):I=[i,C?"active":null,P?"pending":null,d?"transitioning":null].filter(Boolean).join(" ");let ie=typeof a=="function"?a(R):a;return y.createElement(Jl,Rl({},h,{"aria-current":B,className:I,ref:n,style:ie,to:s,viewTransition:c}),typeof v=="function"?v(R):v)});var jo;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(jo||(jo={}));var Va;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Va||(Va={}));function lm(e){let t=y.useContext(Gl);return t||q(!1),t}function im(e,t){let{target:n,replace:r,state:l,preventScrollReset:i,relative:o,viewTransition:a}=t===void 0?{}:t,s=pf(),c=In(),v=Yl(e,{relative:o});return y.useCallback(h=>{if(Xh(h,n)){h.preventDefault();let m=r!==void 0?r:Ll(c)===Ll(v);s(e,{replace:m,state:l,preventScrollReset:i,relative:o,viewTransition:a})}},[c,s,v,r,l,n,e,i,o,a])}function om(e){let t=y.useRef(ko(e)),n=y.useRef(!1),r=In(),l=y.useMemo(()=>Yh(r.search,n.current?null:t.current),[r.search]),i=pf(),o=y.useCallback((a,s)=>{const c=ko(typeof a=="function"?a(l):a);n.current=!0,i("?"+c,s)},[i,l]);return[l,o]}function sm(e,t){t===void 0&&(t={});let n=y.useContext(bh);n==null&&q(!1);let{basename:r}=lm(jo.useViewTransitionState),l=Yl(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Ln(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ln(n.nextLocation.pathname,r)||n.nextLocation.pathname;return xo(l.pathname,o)!=null||xo(l.pathname,i)!=null}const yf=y.createContext(null);function $a(){try{return localStorage.getItem("authToken")||""}catch{return""}}function Kr(e){try{e?localStorage.setItem("authToken",e):localStorage.removeItem("authToken")}catch{}}function am({children:e}){const[t,n]=y.useState($a),[r,l]=y.useState(null),[i,o]=y.useState(!!$a()),[a,s]=y.useState(null);y.useEffect(()=>{if(!t){l(null),o(!1),s(null);return}let g=!1;return o(!0),fetch("/api/auth/me",{headers:{Authorization:`Bearer ${t}`}}).then(async w=>{const k=await w.json().catch(()=>({}));if(!w.ok)throw new Error(k.error||"Kon sessie niet verifiëren.");g||(l(k.user||null),s(null))}).catch(()=>{g||(l(null),n(""),Kr(""))}).finally(()=>{g||o(!1)}),()=>{g=!0}},[t]);async function c(g){s(null);const w=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g)}),k=await w.json().catch(()=>({}));if(!w.ok)throw new Error(k.error||"Login mislukt.");return n(k.token),Kr(k.token),l(k.user),k.user}async function v(g){s(null);const w=await fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g)}),k=await w.json().catch(()=>({}));if(!w.ok)throw new Error(k.error||"Registratie mislukt.");return n(k.token),Kr(k.token),l(k.user),k.user}function h(){n(""),Kr(""),l(null)}const m=y.useMemo(()=>(g,w={})=>{const k={...w.headers||{},...t?{Authorization:`Bearer ${t}`}:{}};return fetch(g,{...w,headers:k})},[t]),x={user:r,token:t,loading:i,error:a,login:c,register:v,logout:h,authFetch:m};return u.jsx(yf.Provider,{value:x,children:e})}function xs(){const e=y.useContext(yf);if(!e)throw new Error("useAuth moet binnen een AuthProvider gebruikt worden");return e}function um(){const e=({isActive:r})=>r?"nav-link active":"nav-link",{user:t,logout:n}=xs();return u.jsxs("nav",{className:"site-nav",children:[u.jsx(Jl,{className:"nav-logo",to:"/",children:"Siti Plugin Repo"}),u.jsxs("div",{className:"nav-links",children:[u.jsx(Ni,{to:"/",end:!0,className:e,children:"Plugins"}),u.jsx(Ni,{to:"/licenses",className:e,children:"Licenties"}),(t==null?void 0:t.isAdmin)&&u.jsx(Ni,{to:"/repos",className:e,children:"Repos"})]}),u.jsx("div",{className:"nav-user",children:t?u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"nav-user-name",children:["Hallo, ",t.name]}),u.jsx("button",{className:"ghost ghost-small",type:"button",onClick:n,children:"Uitloggen"})]}):u.jsx("span",{className:"nav-user-guest",children:"Niet ingelogd"})})]})}function cm(){const[e,t]=y.useState([]),[n,r]=y.useState(!0),[l,i]=y.useState(null),[o,a]=y.useState(null);return y.useEffect(()=>{async function s(){try{const c=await fetch("/api/plugins");if(!c.ok)throw new Error("Kon plugins niet laden");const v=await c.json();t(v.items||[]),a(v.updatedAt)}catch{i("Laden van repository data is mislukt.")}finally{r(!1)}}s()},[]),u.jsxs("div",{className:"page",children:[u.jsxs("header",{className:"hero",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow",children:"WordPress plugin overzicht"}),u.jsx("h1",{children:"Siti Plugin Repo"}),u.jsx("p",{className:"subtitle",children:"Al je publieke WordPress plugins op één plek."})]}),u.jsx("a",{className:"cta",href:"https://github.com/SitiWeb",target:"_blank",rel:"noreferrer",children:"GitHub SitiWeb"})]}),u.jsxs("section",{className:"grid",children:[n&&u.jsx("div",{className:"state",children:"Bezig met laden…"}),l&&u.jsx("div",{className:"state error",children:l}),!n&&!l&&e.length===0&&u.jsx("div",{className:"state",children:"Geen repositories gevonden."}),e.map(s=>{var g,w;const c=s.label||((g=s.manifest)==null?void 0:g.plugin_name)||s.name,v=((w=s.manifest)==null?void 0:w.description)||s.description,h=new URLSearchParams;s.provider&&h.set("provider",s.provider),s.baseUrl&&h.set("baseUrl",s.baseUrl),s.repoId&&h.set("repoId",String(s.repoId));const m=s.provider==="gitea"?"Gitea":"GitHub",x=`/plugin/${s.fullName}`+(h.toString()?`?${h.toString()}`:"");return u.jsxs("article",{className:"card",children:[u.jsxs("div",{className:"card-header",children:[u.jsx("h2",{children:c}),u.jsx("span",{className:"pill",children:s.fullName})]}),u.jsx("p",{children:v}),u.jsxs("div",{className:"meta",children:[u.jsxs("span",{children:["★ ",s.stars]}),u.jsxs("span",{children:["Forks ",s.forks]}),u.jsxs("span",{children:["Issues ",s.issues]})]}),s.topics.length>0&&u.jsx("div",{className:"topics",children:s.topics.slice(0,4).map(k=>u.jsx("span",{className:"topic",children:k},k))}),u.jsxs("div",{className:"actions",children:[u.jsx(Jl,{className:"link",to:x,children:"Bekijk details →"}),u.jsx("a",{className:"ghost",href:s.repoUrl,target:"_blank",rel:"noreferrer",children:m})]})]},s.fullName)})]}),u.jsx("footer",{className:"footer",children:u.jsxs("span",{children:["Laatste sync: ",o?new Date(o).toLocaleString("nl-NL"):"-"]})})]})}function fm(){const{owner:e,repo:t}=Rh(),[n]=om(),r=(n.get("provider")||"github").toLowerCase(),l=n.get("baseUrl")||"",i=n.get("repoId")||"",[o,a]=y.useState(null),[s,c]=y.useState(!0),[v,h]=y.useState(null);y.useEffect(()=>{async function j(){try{const C=new URLSearchParams;r&&C.set("provider",r),l&&C.set("baseUrl",l),i&&C.set("repoId",i);const P=C.toString(),R=await fetch(`/api/plugins/${e}/${t}${P.length>0?`?${P}`:""}`);if(!R.ok)throw new Error("Kon details niet laden");const B=await R.json();a(B)}catch{h("Laden van plugin details is mislukt.")}finally{c(!1)}}j()},[e,t,r,l]);const m=o==null?void 0:o.manifest,x=(o==null?void 0:o.label)||(m==null?void 0:m.plugin_name)||(o==null?void 0:o.name)||t,g=(m==null?void 0:m.description)||(o==null?void 0:o.description),w=(m==null?void 0:m.author)||"-",k=(m==null?void 0:m.version)||"-",d=(o==null?void 0:o.provider)==="gitea"?"Gitea":"GitHub",f=o==null?void 0:o.download,p=y.useMemo(()=>(o==null?void 0:o.releases)||[],[o]),S=y.useMemo(()=>(o==null?void 0:o.commits)||[],[o]);return u.jsxs("div",{className:"page",children:[u.jsxs("header",{className:"detail-hero",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow",children:"Plugin details"}),u.jsx("h1",{children:x}),u.jsx("p",{className:"subtitle",children:g})]}),u.jsxs("div",{className:"detail-actions",children:[u.jsx(Jl,{className:"ghost",to:"/",children:"← Terug"}),(o==null?void 0:o.repoUrl)&&u.jsx("a",{className:"ghost",href:o.repoUrl,target:"_blank",rel:"noreferrer",children:d}),(f==null?void 0:f.url)&&u.jsxs("a",{className:"cta",href:f.url,target:"_blank",rel:"noreferrer",children:["Download ",f.version]})]})]}),s&&u.jsx("div",{className:"state",children:"Bezig met laden…"}),v&&u.jsx("div",{className:"state error",children:v}),!s&&!v&&o&&u.jsxs("section",{className:"detail-grid",children:[u.jsxs("div",{className:"card",children:[u.jsx("h2",{children:"Manifest"}),u.jsxs("div",{className:"detail-list",children:[u.jsxs("div",{children:[u.jsx("span",{children:"Naam"}),u.jsx("strong",{children:x})]}),u.jsxs("div",{children:[u.jsx("span",{children:"Versie"}),u.jsx("strong",{children:k})]}),u.jsxs("div",{children:[u.jsx("span",{children:"Auteur"}),u.jsx("strong",{children:w})]}),u.jsxs("div",{children:[u.jsx("span",{children:"Repository"}),u.jsx("strong",{children:o.fullName})]})]}),(m==null?void 0:m.author_url)&&u.jsx("a",{className:"link",href:m.author_url,target:"_blank",rel:"noreferrer",children:"Auteur website →"})]}),u.jsxs("div",{className:"card",children:[u.jsx("h2",{children:"Releases"}),p.length===0&&u.jsx("p",{children:"Geen releases gevonden."}),u.jsx("ul",{className:"list",children:p.map(j=>{const C=j.tag||j.name||j.url;return u.jsxs("li",{children:[u.jsxs("div",{children:[u.jsx("a",{href:j.url,target:"_blank",rel:"noreferrer",children:j.name}),u.jsx("span",{children:j.publishedAt?new Date(j.publishedAt).toLocaleDateString("nl-NL"):"-"})]}),j.downloadUrl&&u.jsx("a",{className:"ghost",href:j.downloadUrl,target:"_blank",rel:"noreferrer",children:"Download"})]},C)})})]}),u.jsxs("div",{className:"card",children:[u.jsx("h2",{children:"Recente commits"}),S.length===0&&u.jsx("p",{children:"Geen commits gevonden."}),u.jsx("ul",{className:"list",children:S.map(j=>{var C;return u.jsxs("li",{children:[u.jsx("a",{href:j.url,target:"_blank",rel:"noreferrer",children:((C=j.message)==null?void 0:C.split(` -`)[0])||j.sha.slice(0,7)}),u.jsx("span",{children:j.author||"-"})]},j.sha)})})]})]})]})}const wf="nl-NL";function Eo(e,t=wf){return e?new Date(e).toLocaleString(t):"-"}function dm(e,t=wf){return e?new Date(e).toLocaleDateString(t):"-"}function pm({license:e}){const t=e.hostnames||[],n=e.primaryHostname||"Nog niet gekoppeld";return u.jsxs("article",{className:"card license-card",children:[u.jsxs("div",{className:"license-card-header",children:[u.jsxs("div",{children:[u.jsx("h3",{children:e.pluginName||e.label||"Licentie"}),u.jsx("p",{className:"license-subtitle",children:e.repoFullName||"-"})]}),u.jsx("span",{className:"pill",children:e.key})]}),u.jsxs("div",{className:"detail-list license-detail-list",children:[u.jsxs("div",{children:[u.jsx("span",{children:"Hostname"}),u.jsx("strong",{children:n})]}),u.jsxs("div",{children:[u.jsx("span",{children:"Huidige versie"}),u.jsx("strong",{children:e.lastUsedVersion||"-"})]}),u.jsxs("div",{children:[u.jsx("span",{children:"Laatste release"}),u.jsx("strong",{children:e.pluginVersion||"-"})]}),u.jsxs("div",{children:[u.jsx("span",{children:"Aangemaakt"}),u.jsx("strong",{children:dm(e.createdAt)})]}),u.jsxs("div",{children:[u.jsx("span",{children:"Laatste check"}),u.jsx("strong",{children:Eo(e.lastVersionCheckAt)})]})]}),e.note&&u.jsxs("p",{className:"license-note",children:["Notitie: ",e.note]}),t.length>0&&u.jsxs("div",{className:"host-list",children:[u.jsx("p",{className:"hint",children:"Hostnames"}),u.jsx("ul",{children:t.map(r=>u.jsxs("li",{children:[u.jsxs("div",{children:[u.jsx("strong",{children:r.hostname}),u.jsxs("span",{children:[r.hits||0," checks"]})]}),u.jsx("span",{children:Eo(r.lastSeenAt)})]},`${r.hostname}-${r.firstSeenAt||r.lastSeenAt}`))})]}),u.jsxs("div",{className:"license-links",children:[e.repoUrl&&u.jsx("a",{className:"link",href:e.repoUrl,target:"_blank",rel:"noreferrer",children:"Repository →"}),e.pluginName&&u.jsx("span",{className:"ghost-pill",children:e.pluginName})]})]})}function hm(){var Es;const{user:e,token:t,authFetch:n,login:r,register:l,loading:i}=xs(),[o,a]=y.useState([]),[s,c]=y.useState([]),[v,h]=y.useState([]),[m,x]=y.useState(""),[g,w]=y.useState(""),[k,d]=y.useState(""),[f,p]=y.useState(""),[S,j]=y.useState(!0),[C,P]=y.useState(null),[R,B]=y.useState(!1),[I,ie]=y.useState(!1),[T,U]=y.useState(!1),[$,oe]=y.useState(null),[Je,Ne]=y.useState(null),[_,O]=y.useState(null),[z,W]=y.useState(null),[b,Ft]=y.useState(!1),[Ve,Un]=y.useState(""),[$e,bt]=y.useState(""),[Ss,xf]=y.useState(""),[en,tn]=y.useState({username:"",name:"",email:"",password:"",isAdmin:!1}),dt=!!(e&&t);y.useEffect(()=>{let N=!1;async function M(){var A;j(!0),P(null);try{const ee=await fetch("/api/plugins"),Ce=await ee.json().catch(()=>({}));if(!ee.ok)throw new Error(Ce.error||"Kon plugins niet laden.");if(N)return;c(Ce.items||[]);const Pe=(A=Ce.items)==null?void 0:A[0];if(Pe){const Zl=Pe.ownerRepo||Pe.fullName;x(Cf=>Cf||Zl)}}catch(ee){N||P(ee.message||"Kon plugins niet laden.")}finally{N||j(!1)}}return M(),()=>{N=!0}},[]),y.useEffect(()=>{if(!dt){h([]),w("");return}e&&!g&&w(String(e.id))},[dt,g,e]),y.useEffect(()=>{if(!dt||!e)return;if(!e.isAdmin){h([e]);return}let N=!1;async function M(){try{const A=await n("/api/admin/users"),ee=await A.json().catch(()=>({}));if(!A.ok)throw new Error(ee.error||"Kon gebruikers niet laden.");if(N)return;h(ee.items||[]),!g&&(ee.items||[]).length>0&&w(String(ee.items[0].id))}catch(A){N||Ne({variant:"error",message:A.message})}}return M(),()=>{N=!0}},[n,dt,g,e]);const pt=y.useCallback(async(N=!0,M)=>{if(!t){a([]),oe(null),N&&Ne({variant:"error",message:"Log in om licenties te beheren."});return}N&&Ne(null),U(!0);try{const A=M||e!=null&&e.isAdmin&&g||(e?String(e.id):"");let ee="/api/licenses";e!=null&&e.isAdmin&&A&&(ee+=`?userId=${A}`);const Ce=await n(ee),Pe=await Ce.json().catch(()=>({}));if(Ce.status===401)throw new Error("Sessie verlopen, log opnieuw in.");if(!Ce.ok)throw new Error(Pe.error||"Kon licenties niet laden.");a(Pe.items||[]),oe(Pe.updatedAt)}catch(A){N&&Ne({variant:"error",message:A.message})}finally{U(!1)}},[n,g,t,e]);y.useEffect(()=>{pt(!1)},[pt]),y.useEffect(()=>{if(!m&&s.length>0){const N=s[0].ownerRepo||s[0].fullName;x(N)}},[s,m]);const Ie=y.useMemo(()=>s.find(N=>(N.ownerRepo||N.fullName)===m)||null,[s,m]),ks=y.useMemo(()=>{const N=M=>M?new Date(M).getTime():0;return[...o].sort((M,A)=>N(A.createdAt)-N(M.createdAt))},[o]);async function Sf(N){var M;if(N.preventDefault(),Ne(null),!dt){Ne({variant:"error",message:"Log in om een licentie aan te maken."});return}if(!Ie){Ne({variant:"error",message:"Selecteer een plugin."});return}B(!0);try{const A={label:k.trim()||Ie.label||((M=Ie.manifest)==null?void 0:M.plugin_name)||Ie.name||Ie.fullName,note:f.trim()||void 0};Ie.repoId?A.repoId=Ie.repoId:A.repo={repo:Ie.ownerRepo||Ie.fullName,provider:Ie.provider||"github",baseUrl:Ie.baseUrl};const ee={...A,userId:e!=null&&e.isAdmin?Number(g||e.id):void 0},Ce=await n("/api/licenses",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)}),Pe=await Ce.json().catch(()=>({}));if(Ce.status===401)throw new Error("Sessie verlopen, log opnieuw in.");if(!Ce.ok)throw new Error(Pe.error||"Licentie aanmaken mislukt.");a(Zl=>[Pe,...Zl]),Ne({variant:"success",message:"Licentie aangemaakt."}),d(""),p("")}catch(A){Ne({variant:"error",message:A.message})}finally{B(!1)}}async function kf(N){N.preventDefault(),O(null),ie(!0);try{const M=await n("/api/admin/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(en)}),A=await M.json().catch(()=>({}));if(!M.ok)throw new Error(A.error||"Gebruiker aanmaken mislukt.");O({variant:"success",message:"Gebruiker aangemaakt."}),tn({username:"",name:"",email:"",password:"",isAdmin:!1}),h(ee=>[...ee,A.user]),g||w(String(A.user.id))}catch(M){O({variant:"error",message:M.message})}finally{ie(!1)}}async function jf(N){if(N.preventDefault(),W(null),!Ve.trim()||!$e.trim()){W({ok:!1,message:"Vul zowel licentiecode als hostname in."});return}Ft(!0);try{const M=await fetch("/api/licenses/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:Ve.trim(),hostname:$e.trim(),currentVersion:Ss.trim()||void 0})}),A=await M.json().catch(()=>({})),ee={ok:M.ok,data:A,message:M.ok?null:A.error||"Controle mislukt."};W(ee),M.ok&&A.license&&a(Ce=>Ce.map(Pe=>Pe.key===A.license.key?A.license:Pe))}catch(M){W({ok:!1,message:M.message})}finally{Ft(!1)}}const Ef=y.useCallback(async N=>{await r(N),await pt(!1)},[r,pt]),Nf=y.useCallback(async N=>{await l(N),await pt(!1)},[l,pt]),js=S||i&&!!t;return u.jsxs("div",{className:"page",children:[u.jsxs("header",{className:"hero",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow",children:"Licentiebeheer"}),u.jsx("h1",{children:"Licenties"}),u.jsx("p",{className:"subtitle",children:"Maak licenties voor iedere plugin en beheer welke hostname de licentie daadwerkelijk gebruikt."}),u.jsx("p",{className:"hint",children:"Een licentie is geldig voor één hostname. De eerste hostname die controleert wordt automatisch gekoppeld als licentiehouder."})]}),u.jsx("button",{className:"ghost",type:"button",onClick:()=>pt(),disabled:T||!dt,children:T?"Vernieuwen…":"Vernieuw lijst"})]}),u.jsxs("div",{className:"license-meta-bar",children:[u.jsxs("span",{children:["Actieve licenties: ",o.length]}),u.jsxs("span",{children:["Laatste update: ",Eo($)]}),e&&u.jsxs("span",{children:["Ingelogd als: ",e.email]}),(e==null?void 0:e.isAdmin)&&v.length>0&&u.jsxs("label",{className:"inline-field",children:[u.jsx("span",{children:"Licenties gebruiker"}),u.jsx("select",{value:g,onChange:N=>{w(N.target.value),pt(!0,N.target.value)},children:v.map(N=>u.jsxs("option",{value:N.id,children:[N.name," (",N.email,")"]},N.id))})]})]}),js&&u.jsx("div",{className:"state",children:"Bezig met laden…"}),C&&u.jsx("div",{className:"state error",children:C}),!js&&!C&&u.jsxs(u.Fragment,{children:[u.jsxs("section",{className:"license-forms",children:[dt?u.jsxs("article",{className:"card",children:[u.jsx("h2",{children:"Nieuwe licentie"}),u.jsx("p",{className:"hint",children:"Kies een plugin en genereer direct een licentiesleutel."}),u.jsxs("form",{className:"form-grid",onSubmit:Sf,children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Plugin"}),u.jsx("select",{value:m,onChange:N=>x(N.target.value),disabled:s.length===0,children:s.map(N=>{var ee;const M=N.ownerRepo||N.fullName,A=N.label||((ee=N.manifest)==null?void 0:ee.plugin_name)||N.name||N.fullName;return u.jsxs("option",{value:M,children:[A," (",N.ownerRepo||N.fullName,")"]},M)})})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Label (optioneel)"}),u.jsx("input",{value:k,onChange:N=>d(N.target.value),placeholder:"Naam of klant"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Notitie"}),u.jsx("textarea",{value:f,onChange:N=>p(N.target.value),placeholder:"Bijv. contactpersoon of extra info",rows:3})]}),(e==null?void 0:e.isAdmin)&&u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Licentie voor gebruiker"}),u.jsx("select",{value:g,onChange:N=>w(N.target.value),children:v.map(N=>u.jsxs("option",{value:N.id,children:[N.name," (",N.email,")"]},N.id))})]}),u.jsx("button",{className:"cta",type:"submit",disabled:R||!Ie,children:R?"Aanmaken…":"Licentie aanmaken"})]}),Je&&u.jsx("div",{className:`state inline ${Je.variant==="error"?"error":"success"}`,children:Je.message})]}):u.jsx(mm,{onLogin:Ef,onRegister:Nf}),u.jsxs("article",{className:"card",children:[u.jsx("h2",{children:"Test of valideer"}),u.jsx("p",{className:"hint",children:"Gebruik dit formulier zoals de plugin dat zou doen om de huidige versie en hostname te controleren."}),u.jsxs("form",{className:"form-grid",onSubmit:jf,children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Licentiecode"}),u.jsx("input",{value:Ve,onChange:N=>Un(N.target.value),placeholder:"SITI-XXXX-XXXX"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Hostname"}),u.jsx("input",{value:$e,onChange:N=>bt(N.target.value),placeholder:"voorbeeld.nl"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Deze site draait versie"}),u.jsx("input",{value:Ss,onChange:N=>xf(N.target.value),placeholder:"bijv. 1.9.3"})]}),u.jsx("button",{className:"ghost",type:"submit",disabled:b,children:b?"Controleren…":"Controleer licentie"})]}),((Es=z==null?void 0:z.data)==null?void 0:Es.license)&&u.jsxs("div",{className:`state inline ${z.ok?"success":""}`.trim(),children:[u.jsx("strong",{children:z.ok?"Licentie geldig":"Plugin informatie"}),u.jsx("p",{children:z.data.license.pluginName||"Plugin"}),u.jsxs("p",{children:["Huidige versie:"," ",u.jsx("strong",{children:z.data.license.lastUsedVersion||z.data.license.pluginVersion||"-"})]}),u.jsxs("p",{children:["Laatste release:"," ",u.jsx("strong",{children:z.data.license.pluginVersion||"-"})]}),u.jsxs("p",{children:["Gekoppeld aan:"," ",u.jsx("strong",{children:z.data.license.primaryHostname||"Nog niet gekoppeld"})]}),!z.ok&&u.jsx("p",{className:"hint",children:"Licentie is ongeldig; downloaden blijft geblokkeerd."})]}),z&&!z.ok&&z.message&&u.jsx("div",{className:"state error inline",children:z.message})]})]}),(e==null?void 0:e.isAdmin)&&u.jsx("section",{className:"license-forms",children:u.jsxs("article",{className:"card",children:[u.jsx("h2",{children:"Gebruiker toevoegen"}),u.jsx("p",{className:"hint",children:"Admins kunnen extra gebruikers aanmaken en direct licenties toewijzen."}),u.jsxs("form",{className:"form-grid",onSubmit:kf,children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Gebruikersnaam"}),u.jsx("input",{value:en.username,onChange:N=>tn(M=>({...M,username:N.target.value})),placeholder:"gebruikersnaam"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Naam"}),u.jsx("input",{value:en.name,onChange:N=>tn(M=>({...M,name:N.target.value})),placeholder:"Volledige naam"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"E-mail"}),u.jsx("input",{type:"email",value:en.email,onChange:N=>tn(M=>({...M,email:N.target.value})),placeholder:"naam@bedrijf.nl"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Wachtwoord"}),u.jsx("input",{type:"password",value:en.password,onChange:N=>tn(M=>({...M,password:N.target.value})),placeholder:"Minimaal 8 karakters"})]}),u.jsxs("label",{className:"checkbox-field",children:[u.jsx("input",{type:"checkbox",checked:en.isAdmin,onChange:N=>tn(M=>({...M,isAdmin:N.target.checked}))}),u.jsx("span",{children:"Maak deze gebruiker admin"})]}),u.jsx("button",{className:"cta",type:"submit",disabled:I,children:I?"Bezig…":"Gebruiker aanmaken"})]}),_&&u.jsx("div",{className:`state inline ${_.variant==="error"?"error":"success"}`,children:_.message})]})}),dt?u.jsx("section",{className:"license-grid",children:ks.length===0?u.jsx("div",{className:"state",children:"Nog geen licenties aangemaakt."}):ks.map(N=>u.jsx(pm,{license:N},N.id||N.key))}):u.jsx("div",{className:"state",children:"Log in of registreer om licenties te bekijken en te beheren."})]})]})}function mm({onLogin:e,onRegister:t}){const[n,r]=y.useState("login"),[l,i]=y.useState({identifier:"",password:""}),[o,a]=y.useState({username:"",name:"",email:"",password:""}),[s,c]=y.useState(null),[v,h]=y.useState(!1);async function m(x){x.preventDefault(),c(null),h(!0);try{n==="login"?(await e(l),c({variant:"success",message:"Succesvol ingelogd."})):(await t(o),c({variant:"success",message:"Account aangemaakt en ingelogd."}))}catch(g){c({variant:"error",message:g.message||"Actie mislukt."})}finally{h(!1)}}return u.jsxs("article",{className:"card auth-card",children:[u.jsxs("div",{className:"auth-tabs",children:[u.jsx("button",{type:"button",className:n==="login"?"auth-tab active":"auth-tab",onClick:()=>r("login"),disabled:v,children:"Inloggen"}),u.jsx("button",{type:"button",className:n==="register"?"auth-tab active":"auth-tab",onClick:()=>r("register"),disabled:v,children:"Registreren"})]}),u.jsxs("form",{className:"form-grid",onSubmit:m,children:[n==="login"?u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Gebruikersnaam of e-mail"}),u.jsx("input",{value:l.identifier,onChange:x=>i(g=>({...g,identifier:x.target.value})),placeholder:"jouwnaam of mail"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Wachtwoord"}),u.jsx("input",{type:"password",value:l.password,onChange:x=>i(g=>({...g,password:x.target.value})),placeholder:"••••••••"})]})]}):u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Gebruikersnaam"}),u.jsx("input",{value:o.username,onChange:x=>a(g=>({...g,username:x.target.value})),placeholder:"gebruikersnaam"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Naam"}),u.jsx("input",{value:o.name,onChange:x=>a(g=>({...g,name:x.target.value})),placeholder:"Volledige naam"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"E-mailadres"}),u.jsx("input",{type:"email",value:o.email,onChange:x=>a(g=>({...g,email:x.target.value})),placeholder:"naam@bedrijf.nl"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Wachtwoord"}),u.jsx("input",{type:"password",value:o.password,onChange:x=>a(g=>({...g,password:x.target.value})),placeholder:"Minimaal 8 karakters"})]})]}),u.jsx("button",{className:"cta",type:"submit",disabled:v,children:v?"Verwerken…":n==="login"?"Inloggen":"Registreren"})]}),s&&u.jsx("div",{className:`state inline ${s.variant==="error"?"error":"success"}`,children:s.message})]})}const Wa=[{value:"github",label:"GitHub"},{value:"gitea",label:"Gitea"}];function vm(){const{user:e,authFetch:t}=xs(),n=!!(e!=null&&e.isAdmin),[r,l]=y.useState([]),[i,o]=y.useState(!0),[a,s]=y.useState(null),[c,v]=y.useState({ownerRepo:"",provider:"github",baseUrl:"",label:""}),[h,m]=y.useState(!1),[x,g]=y.useState(null),[w,k]=y.useState(null),[d,f]=y.useState({ownerRepo:"",provider:"github",baseUrl:"",label:""}),[p,S]=y.useState(null),j=!!(e&&n),C=y.useCallback(async()=>{if(!j){l([]),o(!1);return}o(!0),s(null);try{const T=await t("/api/repos"),U=await T.json().catch(()=>({}));if(!T.ok)throw new Error(U.error||"Kon repos niet laden.");l(U.items||[])}catch(T){s(T.message)}finally{o(!1)}},[t,j]);y.useEffect(()=>{C()},[C]);const P=y.useMemo(()=>[...r].sort((T,U)=>T.ownerRepo.localeCompare(U.ownerRepo)),[r]);if(!e)return u.jsx("div",{className:"page",children:u.jsx("div",{className:"state",children:"Log in om repositories te beheren."})});if(!n)return u.jsx("div",{className:"page",children:u.jsx("div",{className:"state error",children:"Alleen admins kunnen repositories beheren."})});async function R(T){if(T.preventDefault(),!c.ownerRepo.trim()){g({variant:"error",message:"Vul het owner/repo veld in."});return}m(!0),g(null);try{const U=await t("/api/repos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)}),$=await U.json().catch(()=>({}));if(!U.ok)throw new Error($.error||"Repo aanmaken mislukt.");l(oe=>[...oe,$.repo]),v({ownerRepo:"",provider:"github",baseUrl:"",label:""}),g({variant:"success",message:"Repo toegevoegd."})}catch(U){g({variant:"error",message:U.message})}finally{m(!1)}}function B(T){k(T.id),f({ownerRepo:T.ownerRepo||"",provider:T.provider||"github",baseUrl:T.baseUrl||"",label:T.label||""}),g(null)}async function I(T){if(T.preventDefault(),!!w)try{const U=await t(`/api/repos/${w}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}),$=await U.json().catch(()=>({}));if(!U.ok)throw new Error($.error||"Repo bijwerken mislukt.");l(oe=>oe.map(Je=>Je.id===w?$.repo:Je)),k(null),g({variant:"success",message:"Repo bijgewerkt."})}catch(U){g({variant:"error",message:U.message})}}async function ie(T){if(window.confirm("Weet je zeker dat je deze repo wilt verwijderen?")){S(T),g(null);try{const U=await t(`/api/repos/${T}`,{method:"DELETE"});if(!U.ok){const $=await U.json().catch(()=>({}));throw new Error($.error||"Verwijderen mislukt.")}l($=>$.filter(oe=>oe.id!==T)),w===T&&k(null),g({variant:"success",message:"Repo verwijderd."})}catch(U){g({variant:"error",message:U.message})}finally{S(null)}}}return u.jsxs("div",{className:"page",children:[u.jsx("header",{className:"hero",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow",children:"Repository beheer"}),u.jsx("h1",{children:"Repos"}),u.jsx("p",{className:"subtitle",children:"Voeg nieuwe plugin repositories toe of werk bestaande entries bij."})]})}),u.jsx("section",{className:"license-forms",children:u.jsxs("article",{className:"card",children:[u.jsx("h2",{children:"Nieuwe repo"}),u.jsxs("form",{className:"form-grid",onSubmit:R,children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Owner/Repo"}),u.jsx("input",{value:c.ownerRepo,onChange:T=>v(U=>({...U,ownerRepo:T.target.value})),placeholder:"bijv. roberto/siti-ai-product-content-generator"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Provider"}),u.jsx("select",{value:c.provider,onChange:T=>v(U=>({...U,provider:T.target.value})),children:Wa.map(T=>u.jsx("option",{value:T.value,children:T.label},T.value))})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Base URL (optioneel)"}),u.jsx("input",{value:c.baseUrl,onChange:T=>v(U=>({...U,baseUrl:T.target.value})),placeholder:"Alleen nodig voor Gitea"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Label (optioneel)"}),u.jsx("input",{value:c.label,onChange:T=>v(U=>({...U,label:T.target.value})),placeholder:"Weergavenaam"})]}),u.jsx("button",{className:"cta",type:"submit",disabled:h,children:h?"Opslaan…":"Repo toevoegen"})]}),x&&u.jsx("div",{className:`state inline ${x.variant==="error"?"error":"success"}`,children:x.message})]})}),i&&u.jsx("div",{className:"state",children:"Bezig met laden…"}),a&&u.jsx("div",{className:"state error",children:a}),!i&&!a&&u.jsxs("section",{className:"grid",children:[P.length===0&&u.jsx("div",{className:"state",children:"Nog geen repositories toegevoegd."}),P.map(T=>{const U=w===T.id;return u.jsxs("article",{className:"card",children:[u.jsxs("div",{className:"card-header",children:[u.jsx("h3",{children:T.label||T.ownerRepo}),u.jsxs("span",{className:"pill",children:["#",T.id]})]}),!U&&u.jsxs(u.Fragment,{children:[u.jsx("p",{children:T.ownerRepo}),u.jsxs("div",{className:"meta",children:[u.jsx("span",{children:T.provider}),u.jsx("span",{children:T.baseUrl||(T.provider==="github"?"github.com":"n.v.t.")})]}),u.jsxs("div",{className:"actions",children:[u.jsx("button",{className:"ghost",type:"button",onClick:()=>B(T),children:"Bewerk"}),u.jsx("button",{className:"ghost",type:"button",onClick:()=>ie(T.id),disabled:p===T.id,children:p===T.id?"Verwijderen…":"Verwijder"})]})]}),U&&u.jsxs("form",{className:"form-grid",onSubmit:I,children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Owner/Repo"}),u.jsx("input",{value:d.ownerRepo,onChange:$=>f(oe=>({...oe,ownerRepo:$.target.value}))})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Provider"}),u.jsx("select",{value:d.provider,onChange:$=>f(oe=>({...oe,provider:$.target.value})),children:Wa.map($=>u.jsx("option",{value:$.value,children:$.label},$.value))})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Base URL"}),u.jsx("input",{value:d.baseUrl,onChange:$=>f(oe=>({...oe,baseUrl:$.target.value}))})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Label"}),u.jsx("input",{value:d.label,onChange:$=>f(oe=>({...oe,label:$.target.value}))})]}),u.jsxs("div",{className:"actions",children:[u.jsx("button",{className:"cta",type:"submit",children:"Opslaan"}),u.jsx("button",{className:"ghost",type:"button",onClick:()=>{k(null),f({ownerRepo:"",provider:"github",baseUrl:"",label:""})},children:"Annuleer"})]})]})]},T.id)})]})]})}function gm(){return u.jsxs("div",{className:"app",children:[u.jsx(um,{}),u.jsxs(Kh,{children:[u.jsx(Xn,{path:"/",element:u.jsx(cm,{})}),u.jsx(Xn,{path:"/plugin/:owner/:repo",element:u.jsx(fm,{})}),u.jsx(Xn,{path:"/licenses",element:u.jsx(hm,{})}),u.jsx(Xn,{path:"/repos",element:u.jsx(vm,{})})]})]})}rf(document.getElementById("root")).render(u.jsx(eu.StrictMode,{children:u.jsx(tm,{children:u.jsx(am,{children:u.jsx(gm,{})})})})); + */function Rl(){return Rl=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[l]=e[l]);return n}function Gh(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Xh(e,t){return e.button===0&&(!t||t==="_self")&&!Gh(e)}function ko(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(l=>[n,l]):[[n,r]])},[]))}function Yh(e,t){let n=ko(e);return t&&t.forEach((r,l)=>{n.has(l)||t.getAll(l).forEach(i=>{n.append(l,i)})}),n}const Jh=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Zh=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],qh="6";try{window.__reactRouterVersion=qh}catch{}const bh=y.createContext({isTransitioning:!1}),em="startTransition",Ba=Hf[em];function tm(e){let{basename:t,children:n,future:r,window:l}=e,i=y.useRef();i.current==null&&(i.current=nh({window:l,v5Compat:!0}));let o=i.current,[a,s]=y.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},v=y.useCallback(m=>{c&&Ba?Ba(()=>s(m)):s(m)},[s,c]);return y.useLayoutEffect(()=>o.listen(v),[o,v]),y.useEffect(()=>Hh(r),[r]),y.createElement(Qh,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const nm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",rm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jl=y.forwardRef(function(t,n){let{onClick:r,relative:l,reloadDocument:i,replace:o,state:a,target:s,to:c,preventScrollReset:v,viewTransition:m}=t,h=gf(t,Jh),{basename:x}=y.useContext(Mt),g,w=!1;if(typeof c=="string"&&rm.test(c)&&(g=c,nm))try{let p=new URL(window.location.href),S=c.startsWith("//")?new URL(p.protocol+c):new URL(c),N=Ln(S.pathname,x);S.origin===p.origin&&N!=null?c=N+S.search+S.hash:w=!0}catch{}let k=_h(c,{relative:l}),d=im(c,{replace:o,state:a,target:s,preventScrollReset:v,relative:l,viewTransition:m});function f(p){r&&r(p),p.defaultPrevented||d(p)}return y.createElement("a",Rl({},h,{href:g||k,onClick:w||i?r:f,ref:n,target:s}))}),Ni=y.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:l=!1,className:i="",end:o=!1,style:a,to:s,viewTransition:c,children:v}=t,m=gf(t,Zh),h=Yl(s,{relative:m.relative}),x=In(),g=y.useContext(cf),{navigator:w,basename:k}=y.useContext(Mt),d=g!=null&&sm(h)&&c===!0,f=w.encodeLocation?w.encodeLocation(h).pathname:h.pathname,p=x.pathname,S=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;l||(p=p.toLowerCase(),S=S?S.toLowerCase():null,f=f.toLowerCase()),S&&k&&(S=Ln(S,k)||S);const N=f!=="/"&&f.endsWith("/")?f.length-1:f.length;let E=p===f||!o&&p.startsWith(f)&&p.charAt(N)==="/",P=S!=null&&(S===f||!o&&S.startsWith(f)&&S.charAt(f.length)==="/"),R={isActive:E,isPending:P,isTransitioning:d},B=E?r:void 0,O;typeof i=="function"?O=i(R):O=[i,E?"active":null,P?"pending":null,d?"transitioning":null].filter(Boolean).join(" ");let ie=typeof a=="function"?a(R):a;return y.createElement(Jl,Rl({},m,{"aria-current":B,className:O,ref:n,style:ie,to:s,viewTransition:c}),typeof v=="function"?v(R):v)});var jo;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(jo||(jo={}));var Va;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Va||(Va={}));function lm(e){let t=y.useContext(Gl);return t||q(!1),t}function im(e,t){let{target:n,replace:r,state:l,preventScrollReset:i,relative:o,viewTransition:a}=t===void 0?{}:t,s=pf(),c=In(),v=Yl(e,{relative:o});return y.useCallback(m=>{if(Xh(m,n)){m.preventDefault();let h=r!==void 0?r:Ll(c)===Ll(v);s(e,{replace:h,state:l,preventScrollReset:i,relative:o,viewTransition:a})}},[c,s,v,r,l,n,e,i,o,a])}function om(e){let t=y.useRef(ko(e)),n=y.useRef(!1),r=In(),l=y.useMemo(()=>Yh(r.search,n.current?null:t.current),[r.search]),i=pf(),o=y.useCallback((a,s)=>{const c=ko(typeof a=="function"?a(l):a);n.current=!0,i("?"+c,s)},[i,l]);return[l,o]}function sm(e,t){t===void 0&&(t={});let n=y.useContext(bh);n==null&&q(!1);let{basename:r}=lm(jo.useViewTransitionState),l=Yl(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Ln(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ln(n.nextLocation.pathname,r)||n.nextLocation.pathname;return xo(l.pathname,o)!=null||xo(l.pathname,i)!=null}const yf=y.createContext(null);function $a(){try{return localStorage.getItem("authToken")||""}catch{return""}}function Kr(e){try{e?localStorage.setItem("authToken",e):localStorage.removeItem("authToken")}catch{}}function am({children:e}){const[t,n]=y.useState($a),[r,l]=y.useState(null),[i,o]=y.useState(!!$a()),[a,s]=y.useState(null);y.useEffect(()=>{if(!t){l(null),o(!1),s(null);return}let g=!1;return o(!0),fetch("/api/auth/me",{headers:{Authorization:`Bearer ${t}`}}).then(async w=>{const k=await w.json().catch(()=>({}));if(!w.ok)throw new Error(k.error||"Kon sessie niet verifiëren.");g||(l(k.user||null),s(null))}).catch(()=>{g||(l(null),n(""),Kr(""))}).finally(()=>{g||o(!1)}),()=>{g=!0}},[t]);async function c(g){s(null);const w=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g)}),k=await w.json().catch(()=>({}));if(!w.ok)throw new Error(k.error||"Login mislukt.");return n(k.token),Kr(k.token),l(k.user),k.user}async function v(g){s(null);const w=await fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g)}),k=await w.json().catch(()=>({}));if(!w.ok)throw new Error(k.error||"Registratie mislukt.");return n(k.token),Kr(k.token),l(k.user),k.user}function m(){n(""),Kr(""),l(null)}const h=y.useMemo(()=>(g,w={})=>{const k={...w.headers||{},...t?{Authorization:`Bearer ${t}`}:{}};return fetch(g,{...w,headers:k})},[t]),x={user:r,token:t,loading:i,error:a,login:c,register:v,logout:m,authFetch:h};return u.jsx(yf.Provider,{value:x,children:e})}function xs(){const e=y.useContext(yf);if(!e)throw new Error("useAuth moet binnen een AuthProvider gebruikt worden");return e}function um(){const e=({isActive:r})=>r?"nav-link active":"nav-link",{user:t,logout:n}=xs();return u.jsxs("nav",{className:"site-nav",children:[u.jsx(Jl,{className:"nav-logo",to:"/",children:"Siti Plugin Repo"}),u.jsxs("div",{className:"nav-links",children:[u.jsx(Ni,{to:"/",end:!0,className:e,children:"Plugins"}),u.jsx(Ni,{to:"/licenses",className:e,children:"Licenties"}),(t==null?void 0:t.isAdmin)&&u.jsx(Ni,{to:"/repos",className:e,children:"Repos"})]}),u.jsx("div",{className:"nav-user",children:t?u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"nav-user-name",children:["Hallo, ",t.name]}),u.jsx("button",{className:"ghost ghost-small",type:"button",onClick:n,children:"Uitloggen"})]}):u.jsx("span",{className:"nav-user-guest",children:"Niet ingelogd"})})]})}function cm(){const[e,t]=y.useState([]),[n,r]=y.useState(!0),[l,i]=y.useState(null),[o,a]=y.useState(null);return y.useEffect(()=>{async function s(){try{const c=await fetch("/api/plugins");if(!c.ok)throw new Error("Kon plugins niet laden");const v=await c.json();t(v.items||[]),a(v.updatedAt)}catch{i("Laden van repository data is mislukt.")}finally{r(!1)}}s()},[]),u.jsxs("div",{className:"page",children:[u.jsxs("header",{className:"hero",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow",children:"WordPress plugin overzicht"}),u.jsx("h1",{children:"Siti Plugin Repo"}),u.jsx("p",{className:"subtitle",children:"Al je publieke WordPress plugins op één plek."})]}),u.jsx("a",{className:"cta",href:"https://github.com/SitiWeb",target:"_blank",rel:"noreferrer",children:"GitHub SitiWeb"})]}),u.jsxs("section",{className:"grid",children:[n&&u.jsx("div",{className:"state",children:"Bezig met laden…"}),l&&u.jsx("div",{className:"state error",children:l}),!n&&!l&&e.length===0&&u.jsx("div",{className:"state",children:"Geen repositories gevonden."}),e.map(s=>{var w,k;const c=s.label||((w=s.manifest)==null?void 0:w.plugin_name)||s.name,v=((k=s.manifest)==null?void 0:k.description)||s.description,m=!!s.isPrivate,h=new URLSearchParams;s.provider&&h.set("provider",s.provider),s.baseUrl&&h.set("baseUrl",s.baseUrl),s.repoId&&h.set("repoId",String(s.repoId));const x=s.provider==="gitea"?"Gitea":"GitHub",g=`/plugin/${s.fullName}`+(h.toString()?`?${h.toString()}`:"");return u.jsxs("article",{className:"card",children:[u.jsxs("div",{className:"card-header",children:[u.jsxs("h2",{children:[c,m&&u.jsxs("span",{className:"privacy-indicator",title:"Privé plugin",children:[u.jsx("span",{"aria-hidden":"true",children:"🔒"}),u.jsx("span",{className:"sr-only",children:"Privé plugin"})]})]}),u.jsx("span",{className:"pill",children:s.fullName})]}),u.jsx("p",{children:v}),u.jsxs("div",{className:"meta",children:[u.jsxs("span",{children:["★ ",s.stars]}),u.jsxs("span",{children:["Forks ",s.forks]}),u.jsxs("span",{children:["Issues ",s.issues]})]}),s.topics.length>0&&u.jsx("div",{className:"topics",children:s.topics.slice(0,4).map(d=>u.jsx("span",{className:"topic",children:d},d))}),u.jsxs("div",{className:"actions",children:[u.jsx(Jl,{className:"link",to:g,children:"Bekijk details →"}),u.jsx("a",{className:"ghost",href:s.repoUrl,target:"_blank",rel:"noreferrer",children:x})]})]},s.fullName)})]}),u.jsx("footer",{className:"footer",children:u.jsxs("span",{children:["Laatste sync: ",o?new Date(o).toLocaleString("nl-NL"):"-"]})})]})}function fm(){const{owner:e,repo:t}=Rh(),[n]=om(),r=(n.get("provider")||"github").toLowerCase(),l=n.get("baseUrl")||"",i=n.get("repoId")||"",[o,a]=y.useState(null),[s,c]=y.useState(!0),[v,m]=y.useState(null);y.useEffect(()=>{async function E(){try{const P=new URLSearchParams;r&&P.set("provider",r),l&&P.set("baseUrl",l),i&&P.set("repoId",i);const R=P.toString(),B=await fetch(`/api/plugins/${e}/${t}${R.length>0?`?${R}`:""}`);if(!B.ok)throw new Error("Kon details niet laden");const O=await B.json();a(O)}catch{m("Laden van plugin details is mislukt.")}finally{c(!1)}}E()},[e,t,r,l]);const h=o==null?void 0:o.manifest,x=(o==null?void 0:o.label)||(h==null?void 0:h.plugin_name)||(o==null?void 0:o.name)||t,g=(h==null?void 0:h.description)||(o==null?void 0:o.description),w=(h==null?void 0:h.author)||"-",k=(h==null?void 0:h.version)||"-",d=(o==null?void 0:o.provider)==="gitea"?"Gitea":"GitHub",f=!!(o!=null&&o.isPrivate),p=f?null:o==null?void 0:o.download,S=y.useMemo(()=>(o==null?void 0:o.releases)||[],[o]),N=y.useMemo(()=>(o==null?void 0:o.commits)||[],[o]);return u.jsxs("div",{className:"page",children:[u.jsxs("header",{className:"detail-hero",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow",children:"Plugin details"}),u.jsxs("h1",{children:[x,f&&u.jsxs("span",{className:"privacy-indicator",title:"Privé plugin",children:[u.jsx("span",{"aria-hidden":"true",children:"🔒"}),u.jsx("span",{className:"sr-only",children:"Privé plugin"})]})]}),u.jsx("p",{className:"subtitle",children:g})]}),u.jsxs("div",{className:"detail-actions",children:[u.jsx(Jl,{className:"ghost",to:"/",children:"← Terug"}),(o==null?void 0:o.repoUrl)&&u.jsx("a",{className:"ghost",href:o.repoUrl,target:"_blank",rel:"noreferrer",children:d}),(p==null?void 0:p.url)&&u.jsxs("a",{className:"cta",href:p.url,target:"_blank",rel:"noreferrer",children:["Download ",p.version]})]})]}),f&&u.jsxs("div",{className:"state warning",children:[u.jsx("strong",{children:"Privé plugin."})," Downloads via deze repo zijn niet beschikbaar."]}),s&&u.jsx("div",{className:"state",children:"Bezig met laden…"}),v&&u.jsx("div",{className:"state error",children:v}),!s&&!v&&o&&u.jsxs("section",{className:"detail-grid",children:[u.jsxs("div",{className:"card",children:[u.jsx("h2",{children:"Manifest"}),u.jsxs("div",{className:"detail-list",children:[u.jsxs("div",{children:[u.jsx("span",{children:"Naam"}),u.jsx("strong",{children:x})]}),u.jsxs("div",{children:[u.jsx("span",{children:"Versie"}),u.jsx("strong",{children:k})]}),u.jsxs("div",{children:[u.jsx("span",{children:"Auteur"}),u.jsx("strong",{children:w})]}),u.jsxs("div",{children:[u.jsx("span",{children:"Repository"}),u.jsx("strong",{children:o.fullName})]})]}),(h==null?void 0:h.author_url)&&u.jsx("a",{className:"link",href:h.author_url,target:"_blank",rel:"noreferrer",children:"Auteur website →"})]}),u.jsxs("div",{className:"card",children:[u.jsx("h2",{children:"Releases"}),S.length===0&&u.jsx("p",{children:"Geen releases gevonden."}),u.jsx("ul",{className:"list",children:S.map(E=>{const P=E.tag||E.name||E.url;return u.jsxs("li",{children:[u.jsxs("div",{children:[u.jsx("a",{href:E.url,target:"_blank",rel:"noreferrer",children:E.name}),u.jsx("span",{children:E.publishedAt?new Date(E.publishedAt).toLocaleDateString("nl-NL"):"-"})]}),E.downloadUrl&&u.jsx("a",{className:"ghost",href:E.downloadUrl,target:"_blank",rel:"noreferrer",children:"Download"})]},P)})})]}),u.jsxs("div",{className:"card",children:[u.jsx("h2",{children:"Recente commits"}),N.length===0&&u.jsx("p",{children:"Geen commits gevonden."}),u.jsx("ul",{className:"list",children:N.map(E=>{var P;return u.jsxs("li",{children:[u.jsx("a",{href:E.url,target:"_blank",rel:"noreferrer",children:((P=E.message)==null?void 0:P.split(` +`)[0])||E.sha.slice(0,7)}),u.jsx("span",{children:E.author||"-"})]},E.sha)})})]})]})]})}const wf="nl-NL";function Eo(e,t=wf){return e?new Date(e).toLocaleString(t):"-"}function dm(e,t=wf){return e?new Date(e).toLocaleDateString(t):"-"}function pm({license:e}){const t=e.hostnames||[],n=e.primaryHostname||"Nog niet gekoppeld";return u.jsxs("article",{className:"card license-card",children:[u.jsxs("div",{className:"license-card-header",children:[u.jsxs("div",{children:[u.jsx("h3",{children:e.pluginName||e.label||"Licentie"}),u.jsx("p",{className:"license-subtitle",children:e.repoFullName||"-"})]}),u.jsx("span",{className:"pill",children:e.key})]}),u.jsxs("div",{className:"detail-list license-detail-list",children:[u.jsxs("div",{children:[u.jsx("span",{children:"Hostname"}),u.jsx("strong",{children:n})]}),u.jsxs("div",{children:[u.jsx("span",{children:"Huidige versie"}),u.jsx("strong",{children:e.lastUsedVersion||"-"})]}),u.jsxs("div",{children:[u.jsx("span",{children:"Laatste release"}),u.jsx("strong",{children:e.pluginVersion||"-"})]}),u.jsxs("div",{children:[u.jsx("span",{children:"Aangemaakt"}),u.jsx("strong",{children:dm(e.createdAt)})]}),u.jsxs("div",{children:[u.jsx("span",{children:"Laatste check"}),u.jsx("strong",{children:Eo(e.lastVersionCheckAt)})]})]}),e.note&&u.jsxs("p",{className:"license-note",children:["Notitie: ",e.note]}),t.length>0&&u.jsxs("div",{className:"host-list",children:[u.jsx("p",{className:"hint",children:"Hostnames"}),u.jsx("ul",{children:t.map(r=>u.jsxs("li",{children:[u.jsxs("div",{children:[u.jsx("strong",{children:r.hostname}),u.jsxs("span",{children:[r.hits||0," checks"]})]}),u.jsx("span",{children:Eo(r.lastSeenAt)})]},`${r.hostname}-${r.firstSeenAt||r.lastSeenAt}`))})]}),u.jsxs("div",{className:"license-links",children:[e.repoUrl&&u.jsx("a",{className:"link",href:e.repoUrl,target:"_blank",rel:"noreferrer",children:"Repository →"}),e.pluginName&&u.jsx("span",{className:"ghost-pill",children:e.pluginName})]})]})}function hm(){var Es;const{user:e,token:t,authFetch:n,login:r,register:l,loading:i}=xs(),[o,a]=y.useState([]),[s,c]=y.useState([]),[v,m]=y.useState([]),[h,x]=y.useState(""),[g,w]=y.useState(""),[k,d]=y.useState(""),[f,p]=y.useState(""),[S,N]=y.useState(!0),[E,P]=y.useState(null),[R,B]=y.useState(!1),[O,ie]=y.useState(!1),[T,U]=y.useState(!1),[$,oe]=y.useState(null),[Je,Ne]=y.useState(null),[_,I]=y.useState(null),[z,W]=y.useState(null),[b,Ft]=y.useState(!1),[Ve,Un]=y.useState(""),[$e,bt]=y.useState(""),[Ss,xf]=y.useState(""),[en,tn]=y.useState({username:"",name:"",email:"",password:"",isAdmin:!1}),dt=!!(e&&t);y.useEffect(()=>{let C=!1;async function M(){var A;N(!0),P(null);try{const ee=await fetch("/api/plugins"),Ce=await ee.json().catch(()=>({}));if(!ee.ok)throw new Error(Ce.error||"Kon plugins niet laden.");if(C)return;c(Ce.items||[]);const Pe=(A=Ce.items)==null?void 0:A[0];if(Pe){const Zl=Pe.ownerRepo||Pe.fullName;x(Cf=>Cf||Zl)}}catch(ee){C||P(ee.message||"Kon plugins niet laden.")}finally{C||N(!1)}}return M(),()=>{C=!0}},[]),y.useEffect(()=>{if(!dt){m([]),w("");return}e&&!g&&w(String(e.id))},[dt,g,e]),y.useEffect(()=>{if(!dt||!e)return;if(!e.isAdmin){m([e]);return}let C=!1;async function M(){try{const A=await n("/api/admin/users"),ee=await A.json().catch(()=>({}));if(!A.ok)throw new Error(ee.error||"Kon gebruikers niet laden.");if(C)return;m(ee.items||[]),!g&&(ee.items||[]).length>0&&w(String(ee.items[0].id))}catch(A){C||Ne({variant:"error",message:A.message})}}return M(),()=>{C=!0}},[n,dt,g,e]);const pt=y.useCallback(async(C=!0,M)=>{if(!t){a([]),oe(null),C&&Ne({variant:"error",message:"Log in om licenties te beheren."});return}C&&Ne(null),U(!0);try{const A=M||e!=null&&e.isAdmin&&g||(e?String(e.id):"");let ee="/api/licenses";e!=null&&e.isAdmin&&A&&(ee+=`?userId=${A}`);const Ce=await n(ee),Pe=await Ce.json().catch(()=>({}));if(Ce.status===401)throw new Error("Sessie verlopen, log opnieuw in.");if(!Ce.ok)throw new Error(Pe.error||"Kon licenties niet laden.");a(Pe.items||[]),oe(Pe.updatedAt)}catch(A){C&&Ne({variant:"error",message:A.message})}finally{U(!1)}},[n,g,t,e]);y.useEffect(()=>{pt(!1)},[pt]),y.useEffect(()=>{if(!h&&s.length>0){const C=s[0].ownerRepo||s[0].fullName;x(C)}},[s,h]);const Ie=y.useMemo(()=>s.find(C=>(C.ownerRepo||C.fullName)===h)||null,[s,h]),ks=y.useMemo(()=>{const C=M=>M?new Date(M).getTime():0;return[...o].sort((M,A)=>C(A.createdAt)-C(M.createdAt))},[o]);async function Sf(C){var M;if(C.preventDefault(),Ne(null),!dt){Ne({variant:"error",message:"Log in om een licentie aan te maken."});return}if(!Ie){Ne({variant:"error",message:"Selecteer een plugin."});return}B(!0);try{const A={label:k.trim()||Ie.label||((M=Ie.manifest)==null?void 0:M.plugin_name)||Ie.name||Ie.fullName,note:f.trim()||void 0};Ie.repoId?A.repoId=Ie.repoId:A.repo={repo:Ie.ownerRepo||Ie.fullName,provider:Ie.provider||"github",baseUrl:Ie.baseUrl};const ee={...A,userId:e!=null&&e.isAdmin?Number(g||e.id):void 0},Ce=await n("/api/licenses",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)}),Pe=await Ce.json().catch(()=>({}));if(Ce.status===401)throw new Error("Sessie verlopen, log opnieuw in.");if(!Ce.ok)throw new Error(Pe.error||"Licentie aanmaken mislukt.");a(Zl=>[Pe,...Zl]),Ne({variant:"success",message:"Licentie aangemaakt."}),d(""),p("")}catch(A){Ne({variant:"error",message:A.message})}finally{B(!1)}}async function kf(C){C.preventDefault(),I(null),ie(!0);try{const M=await n("/api/admin/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(en)}),A=await M.json().catch(()=>({}));if(!M.ok)throw new Error(A.error||"Gebruiker aanmaken mislukt.");I({variant:"success",message:"Gebruiker aangemaakt."}),tn({username:"",name:"",email:"",password:"",isAdmin:!1}),m(ee=>[...ee,A.user]),g||w(String(A.user.id))}catch(M){I({variant:"error",message:M.message})}finally{ie(!1)}}async function jf(C){if(C.preventDefault(),W(null),!Ve.trim()||!$e.trim()){W({ok:!1,message:"Vul zowel licentiecode als hostname in."});return}Ft(!0);try{const M=await fetch("/api/licenses/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:Ve.trim(),hostname:$e.trim(),currentVersion:Ss.trim()||void 0})}),A=await M.json().catch(()=>({})),ee={ok:M.ok,data:A,message:M.ok?null:A.error||"Controle mislukt."};W(ee),M.ok&&A.license&&a(Ce=>Ce.map(Pe=>Pe.key===A.license.key?A.license:Pe))}catch(M){W({ok:!1,message:M.message})}finally{Ft(!1)}}const Ef=y.useCallback(async C=>{await r(C),await pt(!1)},[r,pt]),Nf=y.useCallback(async C=>{await l(C),await pt(!1)},[l,pt]),js=S||i&&!!t;return u.jsxs("div",{className:"page",children:[u.jsxs("header",{className:"hero",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow",children:"Licentiebeheer"}),u.jsx("h1",{children:"Licenties"}),u.jsx("p",{className:"subtitle",children:"Maak licenties voor iedere plugin en beheer welke hostname de licentie daadwerkelijk gebruikt."}),u.jsx("p",{className:"hint",children:"Een licentie is geldig voor één hostname. De eerste hostname die controleert wordt automatisch gekoppeld als licentiehouder."})]}),u.jsx("button",{className:"ghost",type:"button",onClick:()=>pt(),disabled:T||!dt,children:T?"Vernieuwen…":"Vernieuw lijst"})]}),u.jsxs("div",{className:"license-meta-bar",children:[u.jsxs("span",{children:["Actieve licenties: ",o.length]}),u.jsxs("span",{children:["Laatste update: ",Eo($)]}),e&&u.jsxs("span",{children:["Ingelogd als: ",e.email]}),(e==null?void 0:e.isAdmin)&&v.length>0&&u.jsxs("label",{className:"inline-field",children:[u.jsx("span",{children:"Licenties gebruiker"}),u.jsx("select",{value:g,onChange:C=>{w(C.target.value),pt(!0,C.target.value)},children:v.map(C=>u.jsxs("option",{value:C.id,children:[C.name," (",C.email,")"]},C.id))})]})]}),js&&u.jsx("div",{className:"state",children:"Bezig met laden…"}),E&&u.jsx("div",{className:"state error",children:E}),!js&&!E&&u.jsxs(u.Fragment,{children:[u.jsxs("section",{className:"license-forms",children:[dt?u.jsxs("article",{className:"card",children:[u.jsx("h2",{children:"Nieuwe licentie"}),u.jsx("p",{className:"hint",children:"Kies een plugin en genereer direct een licentiesleutel."}),u.jsxs("form",{className:"form-grid",onSubmit:Sf,children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Plugin"}),u.jsx("select",{value:h,onChange:C=>x(C.target.value),disabled:s.length===0,children:s.map(C=>{var ee;const M=C.ownerRepo||C.fullName,A=C.label||((ee=C.manifest)==null?void 0:ee.plugin_name)||C.name||C.fullName;return u.jsxs("option",{value:M,children:[A," (",C.ownerRepo||C.fullName,")"]},M)})})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Label (optioneel)"}),u.jsx("input",{value:k,onChange:C=>d(C.target.value),placeholder:"Naam of klant"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Notitie"}),u.jsx("textarea",{value:f,onChange:C=>p(C.target.value),placeholder:"Bijv. contactpersoon of extra info",rows:3})]}),(e==null?void 0:e.isAdmin)&&u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Licentie voor gebruiker"}),u.jsx("select",{value:g,onChange:C=>w(C.target.value),children:v.map(C=>u.jsxs("option",{value:C.id,children:[C.name," (",C.email,")"]},C.id))})]}),u.jsx("button",{className:"cta",type:"submit",disabled:R||!Ie,children:R?"Aanmaken…":"Licentie aanmaken"})]}),Je&&u.jsx("div",{className:`state inline ${Je.variant==="error"?"error":"success"}`,children:Je.message})]}):u.jsx(mm,{onLogin:Ef,onRegister:Nf}),u.jsxs("article",{className:"card",children:[u.jsx("h2",{children:"Test of valideer"}),u.jsx("p",{className:"hint",children:"Gebruik dit formulier zoals de plugin dat zou doen om de huidige versie en hostname te controleren."}),u.jsxs("form",{className:"form-grid",onSubmit:jf,children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Licentiecode"}),u.jsx("input",{value:Ve,onChange:C=>Un(C.target.value),placeholder:"SITI-XXXX-XXXX"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Hostname"}),u.jsx("input",{value:$e,onChange:C=>bt(C.target.value),placeholder:"voorbeeld.nl"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Deze site draait versie"}),u.jsx("input",{value:Ss,onChange:C=>xf(C.target.value),placeholder:"bijv. 1.9.3"})]}),u.jsx("button",{className:"ghost",type:"submit",disabled:b,children:b?"Controleren…":"Controleer licentie"})]}),((Es=z==null?void 0:z.data)==null?void 0:Es.license)&&u.jsxs("div",{className:`state inline ${z.ok?"success":""}`.trim(),children:[u.jsx("strong",{children:z.ok?"Licentie geldig":"Plugin informatie"}),u.jsx("p",{children:z.data.license.pluginName||"Plugin"}),u.jsxs("p",{children:["Huidige versie:"," ",u.jsx("strong",{children:z.data.license.lastUsedVersion||z.data.license.pluginVersion||"-"})]}),u.jsxs("p",{children:["Laatste release:"," ",u.jsx("strong",{children:z.data.license.pluginVersion||"-"})]}),u.jsxs("p",{children:["Gekoppeld aan:"," ",u.jsx("strong",{children:z.data.license.primaryHostname||"Nog niet gekoppeld"})]}),!z.ok&&u.jsx("p",{className:"hint",children:"Licentie is ongeldig; downloaden blijft geblokkeerd."})]}),z&&!z.ok&&z.message&&u.jsx("div",{className:"state error inline",children:z.message})]})]}),(e==null?void 0:e.isAdmin)&&u.jsx("section",{className:"license-forms",children:u.jsxs("article",{className:"card",children:[u.jsx("h2",{children:"Gebruiker toevoegen"}),u.jsx("p",{className:"hint",children:"Admins kunnen extra gebruikers aanmaken en direct licenties toewijzen."}),u.jsxs("form",{className:"form-grid",onSubmit:kf,children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Gebruikersnaam"}),u.jsx("input",{value:en.username,onChange:C=>tn(M=>({...M,username:C.target.value})),placeholder:"gebruikersnaam"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Naam"}),u.jsx("input",{value:en.name,onChange:C=>tn(M=>({...M,name:C.target.value})),placeholder:"Volledige naam"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"E-mail"}),u.jsx("input",{type:"email",value:en.email,onChange:C=>tn(M=>({...M,email:C.target.value})),placeholder:"naam@bedrijf.nl"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Wachtwoord"}),u.jsx("input",{type:"password",value:en.password,onChange:C=>tn(M=>({...M,password:C.target.value})),placeholder:"Minimaal 8 karakters"})]}),u.jsxs("label",{className:"checkbox-field",children:[u.jsx("input",{type:"checkbox",checked:en.isAdmin,onChange:C=>tn(M=>({...M,isAdmin:C.target.checked}))}),u.jsx("span",{children:"Maak deze gebruiker admin"})]}),u.jsx("button",{className:"cta",type:"submit",disabled:O,children:O?"Bezig…":"Gebruiker aanmaken"})]}),_&&u.jsx("div",{className:`state inline ${_.variant==="error"?"error":"success"}`,children:_.message})]})}),dt?u.jsx("section",{className:"license-grid",children:ks.length===0?u.jsx("div",{className:"state",children:"Nog geen licenties aangemaakt."}):ks.map(C=>u.jsx(pm,{license:C},C.id||C.key))}):u.jsx("div",{className:"state",children:"Log in of registreer om licenties te bekijken en te beheren."})]})]})}function mm({onLogin:e,onRegister:t}){const[n,r]=y.useState("login"),[l,i]=y.useState({identifier:"",password:""}),[o,a]=y.useState({username:"",name:"",email:"",password:""}),[s,c]=y.useState(null),[v,m]=y.useState(!1);async function h(x){x.preventDefault(),c(null),m(!0);try{n==="login"?(await e(l),c({variant:"success",message:"Succesvol ingelogd."})):(await t(o),c({variant:"success",message:"Account aangemaakt en ingelogd."}))}catch(g){c({variant:"error",message:g.message||"Actie mislukt."})}finally{m(!1)}}return u.jsxs("article",{className:"card auth-card",children:[u.jsxs("div",{className:"auth-tabs",children:[u.jsx("button",{type:"button",className:n==="login"?"auth-tab active":"auth-tab",onClick:()=>r("login"),disabled:v,children:"Inloggen"}),u.jsx("button",{type:"button",className:n==="register"?"auth-tab active":"auth-tab",onClick:()=>r("register"),disabled:v,children:"Registreren"})]}),u.jsxs("form",{className:"form-grid",onSubmit:h,children:[n==="login"?u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Gebruikersnaam of e-mail"}),u.jsx("input",{value:l.identifier,onChange:x=>i(g=>({...g,identifier:x.target.value})),placeholder:"jouwnaam of mail"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Wachtwoord"}),u.jsx("input",{type:"password",value:l.password,onChange:x=>i(g=>({...g,password:x.target.value})),placeholder:"••••••••"})]})]}):u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Gebruikersnaam"}),u.jsx("input",{value:o.username,onChange:x=>a(g=>({...g,username:x.target.value})),placeholder:"gebruikersnaam"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Naam"}),u.jsx("input",{value:o.name,onChange:x=>a(g=>({...g,name:x.target.value})),placeholder:"Volledige naam"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"E-mailadres"}),u.jsx("input",{type:"email",value:o.email,onChange:x=>a(g=>({...g,email:x.target.value})),placeholder:"naam@bedrijf.nl"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Wachtwoord"}),u.jsx("input",{type:"password",value:o.password,onChange:x=>a(g=>({...g,password:x.target.value})),placeholder:"Minimaal 8 karakters"})]})]}),u.jsx("button",{className:"cta",type:"submit",disabled:v,children:v?"Verwerken…":n==="login"?"Inloggen":"Registreren"})]}),s&&u.jsx("div",{className:`state inline ${s.variant==="error"?"error":"success"}`,children:s.message})]})}const Wa=[{value:"github",label:"GitHub"},{value:"gitea",label:"Gitea"}];function vm(){const{user:e,authFetch:t}=xs(),n=!!(e!=null&&e.isAdmin),[r,l]=y.useState([]),[i,o]=y.useState(!0),[a,s]=y.useState(null),[c,v]=y.useState({ownerRepo:"",provider:"github",baseUrl:"",label:""}),[m,h]=y.useState(!1),[x,g]=y.useState(null),[w,k]=y.useState(null),[d,f]=y.useState({ownerRepo:"",provider:"github",baseUrl:"",label:""}),[p,S]=y.useState(null),N=!!(e&&n),E=y.useCallback(async()=>{if(!N){l([]),o(!1);return}o(!0),s(null);try{const T=await t("/api/repos"),U=await T.json().catch(()=>({}));if(!T.ok)throw new Error(U.error||"Kon repos niet laden.");l(U.items||[])}catch(T){s(T.message)}finally{o(!1)}},[t,N]);y.useEffect(()=>{E()},[E]);const P=y.useMemo(()=>[...r].sort((T,U)=>T.ownerRepo.localeCompare(U.ownerRepo)),[r]);if(!e)return u.jsx("div",{className:"page",children:u.jsx("div",{className:"state",children:"Log in om repositories te beheren."})});if(!n)return u.jsx("div",{className:"page",children:u.jsx("div",{className:"state error",children:"Alleen admins kunnen repositories beheren."})});async function R(T){if(T.preventDefault(),!c.ownerRepo.trim()){g({variant:"error",message:"Vul het owner/repo veld in."});return}h(!0),g(null);try{const U=await t("/api/repos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)}),$=await U.json().catch(()=>({}));if(!U.ok)throw new Error($.error||"Repo aanmaken mislukt.");l(oe=>[...oe,$.repo]),v({ownerRepo:"",provider:"github",baseUrl:"",label:""}),g({variant:"success",message:"Repo toegevoegd."})}catch(U){g({variant:"error",message:U.message})}finally{h(!1)}}function B(T){k(T.id),f({ownerRepo:T.ownerRepo||"",provider:T.provider||"github",baseUrl:T.baseUrl||"",label:T.label||""}),g(null)}async function O(T){if(T.preventDefault(),!!w)try{const U=await t(`/api/repos/${w}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}),$=await U.json().catch(()=>({}));if(!U.ok)throw new Error($.error||"Repo bijwerken mislukt.");l(oe=>oe.map(Je=>Je.id===w?$.repo:Je)),k(null),g({variant:"success",message:"Repo bijgewerkt."})}catch(U){g({variant:"error",message:U.message})}}async function ie(T){if(window.confirm("Weet je zeker dat je deze repo wilt verwijderen?")){S(T),g(null);try{const U=await t(`/api/repos/${T}`,{method:"DELETE"});if(!U.ok){const $=await U.json().catch(()=>({}));throw new Error($.error||"Verwijderen mislukt.")}l($=>$.filter(oe=>oe.id!==T)),w===T&&k(null),g({variant:"success",message:"Repo verwijderd."})}catch(U){g({variant:"error",message:U.message})}finally{S(null)}}}return u.jsxs("div",{className:"page",children:[u.jsx("header",{className:"hero",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow",children:"Repository beheer"}),u.jsx("h1",{children:"Repos"}),u.jsx("p",{className:"subtitle",children:"Voeg nieuwe plugin repositories toe of werk bestaande entries bij."})]})}),u.jsx("section",{className:"license-forms",children:u.jsxs("article",{className:"card",children:[u.jsx("h2",{children:"Nieuwe repo"}),u.jsxs("form",{className:"form-grid",onSubmit:R,children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Owner/Repo"}),u.jsx("input",{value:c.ownerRepo,onChange:T=>v(U=>({...U,ownerRepo:T.target.value})),placeholder:"bijv. roberto/siti-ai-product-content-generator"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Provider"}),u.jsx("select",{value:c.provider,onChange:T=>v(U=>({...U,provider:T.target.value})),children:Wa.map(T=>u.jsx("option",{value:T.value,children:T.label},T.value))})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Base URL (optioneel)"}),u.jsx("input",{value:c.baseUrl,onChange:T=>v(U=>({...U,baseUrl:T.target.value})),placeholder:"Alleen nodig voor Gitea"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Label (optioneel)"}),u.jsx("input",{value:c.label,onChange:T=>v(U=>({...U,label:T.target.value})),placeholder:"Weergavenaam"})]}),u.jsx("button",{className:"cta",type:"submit",disabled:m,children:m?"Opslaan…":"Repo toevoegen"})]}),x&&u.jsx("div",{className:`state inline ${x.variant==="error"?"error":"success"}`,children:x.message})]})}),i&&u.jsx("div",{className:"state",children:"Bezig met laden…"}),a&&u.jsx("div",{className:"state error",children:a}),!i&&!a&&u.jsxs("section",{className:"grid",children:[P.length===0&&u.jsx("div",{className:"state",children:"Nog geen repositories toegevoegd."}),P.map(T=>{const U=w===T.id;return u.jsxs("article",{className:"card",children:[u.jsxs("div",{className:"card-header",children:[u.jsx("h3",{children:T.label||T.ownerRepo}),u.jsxs("span",{className:"pill",children:["#",T.id]})]}),!U&&u.jsxs(u.Fragment,{children:[u.jsx("p",{children:T.ownerRepo}),u.jsxs("div",{className:"meta",children:[u.jsx("span",{children:T.provider}),u.jsx("span",{children:T.baseUrl||(T.provider==="github"?"github.com":"n.v.t.")})]}),u.jsxs("div",{className:"actions",children:[u.jsx("button",{className:"ghost",type:"button",onClick:()=>B(T),children:"Bewerk"}),u.jsx("button",{className:"ghost",type:"button",onClick:()=>ie(T.id),disabled:p===T.id,children:p===T.id?"Verwijderen…":"Verwijder"})]})]}),U&&u.jsxs("form",{className:"form-grid",onSubmit:O,children:[u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Owner/Repo"}),u.jsx("input",{value:d.ownerRepo,onChange:$=>f(oe=>({...oe,ownerRepo:$.target.value}))})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Provider"}),u.jsx("select",{value:d.provider,onChange:$=>f(oe=>({...oe,provider:$.target.value})),children:Wa.map($=>u.jsx("option",{value:$.value,children:$.label},$.value))})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Base URL"}),u.jsx("input",{value:d.baseUrl,onChange:$=>f(oe=>({...oe,baseUrl:$.target.value}))})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{children:"Label"}),u.jsx("input",{value:d.label,onChange:$=>f(oe=>({...oe,label:$.target.value}))})]}),u.jsxs("div",{className:"actions",children:[u.jsx("button",{className:"cta",type:"submit",children:"Opslaan"}),u.jsx("button",{className:"ghost",type:"button",onClick:()=>{k(null),f({ownerRepo:"",provider:"github",baseUrl:"",label:""})},children:"Annuleer"})]})]})]},T.id)})]})]})}function gm(){return u.jsxs("div",{className:"app",children:[u.jsx(um,{}),u.jsxs(Kh,{children:[u.jsx(Xn,{path:"/",element:u.jsx(cm,{})}),u.jsx(Xn,{path:"/plugin/:owner/:repo",element:u.jsx(fm,{})}),u.jsx(Xn,{path:"/licenses",element:u.jsx(hm,{})}),u.jsx(Xn,{path:"/repos",element:u.jsx(vm,{})})]})]})}rf(document.getElementById("root")).render(u.jsx(eu.StrictMode,{children:u.jsx(tm,{children:u.jsx(am,{children:u.jsx(gm,{})})})})); diff --git a/dist/index.html b/dist/index.html index 29a5b38..d87f171 100644 --- a/dist/index.html +++ b/dist/index.html @@ -5,8 +5,8 @@ Siti Plugin Repo - - + + diff --git a/docker-compose.yml b/docker-compose.yml index 707a616..cbef577 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,4 +17,5 @@ services: DB_NAME: "${DB_NAME:-siti_plugin_repo}" JWT_SECRET: "${JWT_SECRET:-change-me}" JWT_EXPIRES_IN: "${JWT_EXPIRES_IN:-7d}" + GITEA_TOKEN: "${GITEA_TOKEN:-change-me}" restart: unless-stopped diff --git a/package-lock.json b/package-lock.json index 0fe3486..c757141 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.1.0", "dependencies": { "bcryptjs": "^3.0.3", + "dotenv": "^17.2.3", "express": "^4.19.2", "jsonwebtoken": "^9.0.3", "mysql2": "^3.16.2", @@ -1354,6 +1355,17 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/dotenv": { + "version": "17.2.3", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.2.3.tgz", + "integrity": "sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, "node_modules/dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", diff --git a/package.json b/package.json index a855c01..ff0478b 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ }, "dependencies": { "bcryptjs": "^3.0.3", + "dotenv": "^17.2.3", "express": "^4.19.2", "jsonwebtoken": "^9.0.3", "mysql2": "^3.16.2", diff --git a/server/index.js b/server/index.js index 2c72759..2a81879 100644 --- a/server/index.js +++ b/server/index.js @@ -1,3 +1,4 @@ +import "dotenv/config"; import express from "express"; import path from "path"; import { Readable } from "node:stream"; @@ -328,7 +329,8 @@ app.get("/api/plugins", async (_req, res) => { ownerRepo: repo.ownerRepo, baseUrl: repo.baseUrl, repoId: repo.id, - label: repo.label + label: repo.label, + isPrivate: false }; } }) @@ -375,23 +377,77 @@ app.get("/api/plugins/:owner/:repo", async (req, res) => { repoRecord = await findRepoByOwnerRepo(ownerRepo); } - const provider = (req.query.provider || repoRecord?.provider || "github").toLowerCase(); - const baseUrlQuery = - req.query.baseUrl || repoRecord?.baseUrl || (provider === "github" ? "https://github.com" : ""); + let provider = (req.query.provider || repoRecord?.provider || "github").toLowerCase(); + if (repoRecord?.provider) { + provider = repoRecord.provider; + } + const baseUrlFallback = provider === "github" ? "https://github.com" : ""; + let baseUrlQuery = req.query.baseUrl || repoRecord?.baseUrl || baseUrlFallback; + if (repoRecord?.baseUrl) { + baseUrlQuery = repoRecord.baseUrl; + } const entry = repoRecord && repoRecord.ownerRepo - ? { provider: repoRecord.provider, repo: repoRecord.ownerRepo, baseUrl: repoRecord.baseUrl } + ? { + provider: repoRecord.provider, + repo: repoRecord.ownerRepo, + baseUrl: repoRecord.baseUrl || baseUrlQuery || undefined + } : provider === "github" ? ownerRepo : { provider, repo: ownerRepo, baseUrl: baseUrlQuery }; - const normalizedEntry = normalizeRepoInput(entry, { repo: ownerRepo, provider, baseUrl: baseUrlQuery }); + const normalizedEntry = + normalizeRepoInput(entry, { repo: ownerRepo, provider, baseUrl: baseUrlQuery }) || + null; - const info = await fetchRepo(entry); - const [manifest, releases, commits] = await Promise.all([ - fetchManifest(entry, info.defaultBranch).catch(() => null), - fetchReleases(entry).catch(() => []), - fetchCommits(entry).catch(() => []) - ]); + if (!normalizedEntry) { + return res.status(400).json({ error: "Ongeldige repository." }); + } + + let info; + let manifest = null; + let releases = []; + let commits = []; + + try { + info = await fetchRepo(normalizedEntry); + [manifest, releases, commits] = await Promise.all([ + fetchManifest(normalizedEntry, info.defaultBranch).catch(() => null), + fetchReleases(normalizedEntry).catch(() => []), + fetchCommits(normalizedEntry).catch(() => []) + ]); + } catch (fetchError) { + console.warn("Kon plugin info niet ophalen:", fetchError.message); + const parsed = parseRepoEntry(normalizedEntry); + const fallbackRepo = { + provider: repoRecord?.provider || parsed.provider, + baseUrl: repoRecord?.baseUrl || parsed.baseUrl, + repo: repoRecord?.ownerRepo || parsed.ownerRepo + }; + const repoUrl = buildRepoUrl(fallbackRepo); + const name = repoRecord?.label || parsed.ownerRepo.split("/")[1] || parsed.ownerRepo; + return res.json({ + fullName: fallbackRepo.repo, + name, + description: repoRecord?.label ? `Plugin: ${repoRecord.label}` : "Kon gegevens niet ophalen.", + repoUrl, + provider: fallbackRepo.provider, + ownerRepo: fallbackRepo.repo, + baseUrl: fallbackRepo.baseUrl, + repoId: repoRecord?.id || null, + label: repoRecord?.label || null, + manifest: null, + releases: [], + commits: [], + download: null, + version: null, + versionSource: null, + isPrivate: false + }); + } + + const isPrivate = Boolean(info?.isPrivate); + const allowDownloads = normalizedEntry && !isPrivate; const effectiveBaseUrl = normalizedEntry?.baseUrl || @@ -400,7 +456,7 @@ app.get("/api/plugins/:owner/:repo", async (req, res) => { (provider === "github" ? "https://github.com" : ""); const releasesWithDownload = - normalizedEntry && releases.length > 0 + allowDownloads && releases.length > 0 ? releases.map((release) => { const tagOrName = release.tag || release.name; if (!tagOrName) { @@ -420,7 +476,7 @@ app.get("/api/plugins/:owner/:repo", async (req, res) => { : releases; let downloadMeta = null; - if (normalizedEntry) { + if (allowDownloads) { const latestRelease = releasesWithDownload[0]; const sourceType = latestRelease ? "release" : "branch"; const version = latestRelease?.tag || latestRelease?.name || info.defaultBranch || "main"; @@ -454,6 +510,7 @@ app.get("/api/plugins/:owner/:repo", async (req, res) => { manifest, releases: releasesWithDownload, download: downloadMeta, + isPrivate, commits }); } catch (error) { @@ -502,6 +559,9 @@ app.get("/api/plugins/:owner/:repo/download", async (req, res) => { }); stream.pipe(res); } catch (error) { + if (error?.meta === "PRIVATE_REPO") { + return res.status(403).json({ error: "Downloads voor private plugins zijn uitgeschakeld." }); + } console.error("Plugin download endpoint error:", error); if (!res.headersSent) { res.status(500).json({ error: "Download mislukt." }); @@ -543,20 +603,34 @@ app.post("/api/licenses", requireAuth, async (req, res) => { if (body.repoId && Number.isNaN(repoId)) { return res.status(400).json({ error: "Ongeldig repo id." }); } + let repoRecord = null; + if (repoId) { + repoRecord = await getRepoById(repoId); + if (!repoRecord) { + return res.status(404).json({ error: "Plugin niet gevonden." }); + } + } const repoInput = typeof body.repo === "object" ? body.repo : typeof body.plugin === "object" ? body.plugin : body.repo || body.ownerRepo || body.fullName || body.plugin; + const repoFromRecord = repoRecord + ? { + repo: repoRecord.ownerRepo, + provider: repoRecord.provider, + baseUrl: repoRecord.baseUrl + } + : null; const repoEntry = normalizeRepoInput(repoInput, { - repo: body.ownerRepo || body.fullName || body.repo, - provider: body.provider, - baseUrl: body.baseUrl - }) || null; + repo: body.ownerRepo || body.fullName || body.repo || repoFromRecord?.repo, + provider: body.provider || repoFromRecord?.provider, + baseUrl: body.baseUrl || repoFromRecord?.baseUrl + }) || repoFromRecord; - if (!repoId && !repoEntry) { + if (!repoEntry) { return res.status(400).json({ error: "Kies een plugin om de licentie aan te koppelen." }); } @@ -677,6 +751,12 @@ async function handleLicenseDownload(res, { key, hostname, version = "latest" }) }); stream.pipe(res); } catch (error) { + if (error?.meta === "PRIVATE_REPO") { + if (!res.headersSent) { + return res.status(403).json({ error: "Downloads voor private plugins zijn uitgeschakeld." }); + } + return res.end(); + } console.error("Download endpoint error:", error); if (!res.headersSent) { res.status(500).json({ error: "Download mislukt." }); diff --git a/server/lib/config.js b/server/lib/config.js index 132c6f8..651be6d 100644 --- a/server/lib/config.js +++ b/server/lib/config.js @@ -27,3 +27,63 @@ export const DB_CONFIG = { export const JWT_SECRET = process.env.JWT_SECRET || "change-me-in-production"; export const JWT_EXPIRES_IN = process.env.JWT_EXPIRES_IN || "7d"; + +function normalizeHostKey(value) { + if (!value) return null; + try { + const url = new URL(value); + return url.host.toLowerCase(); + } catch { + return value.replace(/^[a-z]+:\/\//i, "").replace(/\/.*$/, "").trim().toLowerCase() || null; + } +} + +function parseGiteaTokenMap(rawValue) { + if (!rawValue) return {}; + const map = {}; + try { + const parsed = typeof rawValue === "string" ? JSON.parse(rawValue) : rawValue; + if (parsed && typeof parsed === "object") { + for (const [key, token] of Object.entries(parsed)) { + const host = normalizeHostKey(key); + if (host && typeof token === "string" && token.trim()) { + map[host] = token.trim(); + } + } + return map; + } + } catch { + // Fall through to comma-separated parsing. + } + + const segments = String(rawValue) + .split(",") + .map((segment) => segment.trim()) + .filter(Boolean); + for (const segment of segments) { + const [key, token] = segment.split("=").map((part) => part.trim()); + const host = normalizeHostKey(key); + if (host && token) { + map[host] = token; + } + } + return map; +} + +const DEFAULT_GITEA_TOKEN = process.env.GITEA_TOKEN?.trim() || null; +const GITEA_TOKENS = parseGiteaTokenMap(process.env.GITEA_TOKENS); + +function getEnvTokenForHost(host) { + if (!host) return null; + const envKey = `GITEA_TOKEN_${host.replace(/[^A-Z0-9]/gi, "_").toUpperCase()}`; + return process.env[envKey]?.trim() || null; +} + +export function getGiteaToken(baseUrl) { + const host = normalizeHostKey(baseUrl); + return ( + (host && (GITEA_TOKENS[host] || getEnvTokenForHost(host))) || + DEFAULT_GITEA_TOKEN || + null + ); +} diff --git a/server/lib/downloadService.js b/server/lib/downloadService.js index 34f6f36..c9bc9e5 100644 --- a/server/lib/downloadService.js +++ b/server/lib/downloadService.js @@ -22,6 +22,11 @@ export async function resolveRepoDownload(repoEntry, requestedVersion = "latest" } const repoInfo = await fetchRepo(normalizedEntry); + if (repoInfo.isPrivate) { + const error = new Error("Downloads niet beschikbaar voor private repositories."); + error.meta = "PRIVATE_REPO"; + throw error; + } const releases = await fetchReleases(normalizedEntry).catch(() => []); let targetVersion = requestedVersion || "latest"; diff --git a/server/lib/pluginService.js b/server/lib/pluginService.js index 70f7ae1..fa8af13 100644 --- a/server/lib/pluginService.js +++ b/server/lib/pluginService.js @@ -1,5 +1,6 @@ import { readJsonFile } from "./storage.js"; import { getCached, setCached } from "./cache.js"; +import { getGiteaToken } from "./config.js"; export function parseRepoEntry(entry) { if (typeof entry === "string") { @@ -51,6 +52,12 @@ async function fetchJson(url, cacheKey, opts = {}) { if (!opts.provider || opts.provider === "github") { headers.Accept = "application/vnd.github+json"; } + if (opts.provider === "gitea") { + const token = opts.token || getGiteaToken(opts.baseUrl || url); + if (token) { + headers.Authorization = `token ${token}`; + } + } const response = await fetch(url, { headers }); if (!response.ok) { throw new Error(`${opts.provider || "git"} request failed for ${url}`); @@ -76,7 +83,7 @@ export async function fetchRepo(entry) { let data; if (provider === "gitea") { const url = `${baseUrl.replace(/\/$/, "")}/api/v1/repos/${ownerRepo}`; - data = await fetchJson(url, `repo-raw:${provider}:${ownerRepo}`, { provider }); + data = await fetchJson(url, `repo-raw:${provider}:${ownerRepo}`, { provider, baseUrl }); const mapped = { fullName: data.full_name || `${ownerRepo}`, name: data.name || ownerRepo.split("/")[1] || ownerRepo, @@ -90,13 +97,16 @@ export async function fetchRepo(entry) { topics: data.topics || [], provider, ownerRepo, - baseUrl + baseUrl, + isPrivate: Boolean(data.private) }; setCached(cacheKey, mapped); return mapped; } - data = await fetchJson(`https://api.github.com/repos/${ownerRepo}`, `repo-raw:github:${ownerRepo}`, { provider: "github" }); + data = await fetchJson(`https://api.github.com/repos/${ownerRepo}`, `repo-raw:github:${ownerRepo}`, { + provider: "github" + }); const mapped = { fullName: data.full_name, name: data.name, @@ -110,7 +120,8 @@ export async function fetchRepo(entry) { topics: data.topics || [], provider, ownerRepo, - baseUrl: "https://github.com" + baseUrl: "https://github.com", + isPrivate: Boolean(data.private) }; setCached(cacheKey, mapped); return mapped; @@ -131,7 +142,14 @@ export async function fetchManifest(entry, defaultBranch) { } else { url = `https://raw.githubusercontent.com/${ownerRepo}/${branch}/manifest.json`; } - const response = await fetch(url, { headers: { "User-Agent": "siti-plugin-repo" } }); + const headers = { "User-Agent": "siti-plugin-repo" }; + if (provider === "gitea") { + const token = getGiteaToken(baseUrl); + if (token) { + headers.Authorization = `token ${token}`; + } + } + const response = await fetch(url, { headers }); if (response.ok) { const manifest = await response.json().catch(() => null); setCached(cacheKey, manifest); @@ -145,7 +163,7 @@ export async function fetchReleases(entry) { const { provider, ownerRepo, baseUrl } = parseRepoEntry(entry); if (provider === "gitea") { const url = `${baseUrl.replace(/\/$/, "")}/api/v1/repos/${ownerRepo}/releases?limit=5`; - const data = await fetchJson(url, `releases:${provider}:${ownerRepo}`, { provider }); + const data = await fetchJson(url, `releases:${provider}:${ownerRepo}`, { provider, baseUrl }); return Array.isArray(data) ? data.map((release) => ({ tag: release.tag_name || release.name, @@ -175,7 +193,7 @@ export async function fetchCommits(entry) { const { provider, ownerRepo, baseUrl } = parseRepoEntry(entry); if (provider === "gitea") { const url = `${baseUrl.replace(/\/$/, "")}/api/v1/repos/${ownerRepo}/commits?limit=5`; - const data = await fetchJson(url, `commits:${provider}:${ownerRepo}`, { provider }); + const data = await fetchJson(url, `commits:${provider}:${ownerRepo}`, { provider, baseUrl }); return Array.isArray(data) ? data.map((commit) => ({ sha: commit.sha, diff --git a/src/App.css b/src/App.css index 08af327..6376491 100644 --- a/src/App.css +++ b/src/App.css @@ -90,6 +90,10 @@ .hero h1 { font-size: clamp(2.4rem, 4vw, 3.4rem); margin: 0 0 8px; + display: flex; + align-items: center; + gap: 12px; + flex-wrap: wrap; } .subtitle { @@ -180,6 +184,10 @@ .card h2 { margin: 0; font-size: 1.3rem; + display: flex; + align-items: center; + gap: 8px; + flex-wrap: wrap; } .card p { @@ -241,6 +249,11 @@ color: #166534; } +.state.warning { + background: #fef9c3; + color: #92400e; +} + .state.inline { margin-top: 16px; padding: 16px; @@ -621,3 +634,25 @@ color: #94a3b8; } } +.privacy-indicator { + display: inline-flex; + align-items: center; + gap: 6px; + font-size: 0.85rem; + font-weight: 600; + padding: 4px 10px; + border-radius: 999px; + background: #fef3c7; + color: #92400e; +} + +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; +} diff --git a/src/pages/Home.jsx b/src/pages/Home.jsx index 6a0cead..c4c0d8d 100644 --- a/src/pages/Home.jsx +++ b/src/pages/Home.jsx @@ -49,6 +49,7 @@ export default function Home() { {plugins.map((plugin) => { const displayName = plugin.label || plugin.manifest?.plugin_name || plugin.name; const description = plugin.manifest?.description || plugin.description; + const isPrivate = Boolean(plugin.isPrivate); const searchParams = new URLSearchParams(); if (plugin.provider) { searchParams.set("provider", plugin.provider); @@ -65,7 +66,15 @@ export default function Home() { return (
-

{displayName}

+

+ {displayName} + {isPrivate && ( + + + Privé plugin + + )} +

{plugin.fullName}

{description}

diff --git a/src/pages/PluginDetail.jsx b/src/pages/PluginDetail.jsx index bca527d..86f1f89 100644 --- a/src/pages/PluginDetail.jsx +++ b/src/pages/PluginDetail.jsx @@ -49,7 +49,8 @@ export default function PluginDetail() { const author = manifest?.author || "-"; const version = manifest?.version || "-"; const repositoryLabel = data?.provider === "gitea" ? "Gitea" : "GitHub"; - const latestDownload = data?.download; + const isPrivate = Boolean(data?.isPrivate); + const latestDownload = isPrivate ? null : data?.download; const releases = useMemo(() => data?.releases || [], [data]); const commits = useMemo(() => data?.commits || [], [data]); @@ -59,7 +60,15 @@ export default function PluginDetail() {

Plugin details

-

{displayName}

+

+ {displayName} + {isPrivate && ( + + + Privé plugin + + )} +

{description}

@@ -77,6 +86,12 @@ export default function PluginDetail() {
+ {isPrivate && ( +
+ Privé plugin. Downloads via deze repo zijn niet beschikbaar. +
+ )} + {loading &&
Bezig met laden…
} {error &&
{error}
}