feat: complete translator stack

This commit is contained in:
truetype committed 2026-01-26 18:15:46 +01:00
commit 6fe7c5121b
9946 files changed
+1747495

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
# Traduttore Multiformato
Questo progetto include un backend FastAPI per chunking, traduzione via ollama e scrittura finale, oltre a un frontend React/Vite per carico file e monitoraggio SSE.
## Passaggi principali
1. `pip install -r backend/requirements.txt`
2. `npm install` (nella cartella `frontend`), poi `npm run build`
3. Avviare `uvicorn backend.app.main:app --host 0.0.0.0 --port 8000`
4. Servire `frontend/dist` con `serve` o avviare il container `frontend` nel `docker-compose`
## Endpoint chiave del backend
- `POST /api/upload`: carica file (EPUB, PDF, DOCX, TXT) e restituisce `session_id` + lingua rilevata.
- `POST /api/start`: avvia la sequenza di chunk tradotti via Ollama.
- `POST /api/stop`: richiede lo stop immediato.
- `GET /api/status/{session_id}`: restituisce stato, ETA, chunk completati e testo tradotto aggregato.
- `GET /api/stream/{session_id}`: Server Sent Events con aggiornamenti chunk/ETA/testo.
## Frontend
Il frontend in `frontend/src` comunica con `/api`, mostra dropdown lingue, caricamento file, caption (titolo, orari, ETA) e il box tradotto che si popola via SSE. I pulsanti `Avvia traduzione` e `Stop traduzione` coordinano le chiamate.
## Testing
Eseguire `python3 -m pytest backend/tests` per verificare processor, chunking e health check.
## Deployment con Docker Compose
1. Costruisci i container: `docker compose build --parallel`.
2. Avvia tutto in un unico flusso: `./start-stack.sh` (il backend parte per primo, il frontend attende che `/health` risponda).
3. In alternativa usa la GUI helper `python3 tools/gui_helper.py` per vedere una finestra con un pulsante e i log in streaming dello startup.
4. Accesso: backend su `http://localhost:8000`, frontend su `http://localhost:5173`.
5. Il backend scrive il file finale in `_bmad-output/translated-<session_id>.txt`.
## Note
- La variabile `OLLAMA_URL` può essere sovrascritta per puntare a un host Ollama differente.
- La directory `_bmad-output` viene montata nel container per esporre i file tradotti persistenti.
@@ -0,0 +1,54 @@
(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))a(n);new MutationObserver(n=>{for(const u of n)if(u.type==="childList")for(const i of u.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&a(i)}).observe(document,{childList:!0,subtree:!0});function e(n){const u={};return n.integrity&&(u.integrity=n.integrity),n.referrerPolicy&&(u.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?u.credentials="include":n.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(n){if(n.ep)return;n.ep=!0;const u=e(n);fetch(n.href,u)}})();var Po={exports:{}},Vu={};/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Om=Symbol.for("react.transitional.element"),zm=Symbol.for("react.fragment");function tr(t,l,e){var a=null;if(e!==void 0&&(a=""+e),l.key!==void 0&&(a=""+l.key),"key"in l){e={};for(var n in l)n!=="key"&&(e[n]=l[n])}else e=l;return l=e.ref,{$$typeof:Om,type:t,key:a,ref:l!==void 0?l:null,props:e}}Vu.Fragment=zm;Vu.jsx=tr;Vu.jsxs=tr;Po.exports=Vu;var X=Po.exports,lr={exports:{}},wu={},er={exports:{}},ar={};/**
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(t){function l(O,B){var M=O.length;O.push(B);t:for(;0<M;){var P=M-1>>>1,it=O[P];if(0<n(it,B))O[P]=B,O[M]=it,M=P;else break t}}function e(O){return O.length===0?null:O[0]}function a(O){if(O.length===0)return null;var B=O[0],M=O.pop();if(M!==B){O[0]=M;t:for(var P=0,it=O.length,qt=it>>>1;P<qt;){var nl=2*(P+1)-1,re=O[nl],Jt=nl+1,de=O[Jt];if(0>n(re,M))Jt<it&&0>n(de,re)?(O[P]=de,O[Jt]=M,P=Jt):(O[P]=re,O[nl]=M,P=nl);else if(Jt<it&&0>n(de,M))O[P]=de,O[Jt]=M,P=Jt;else break t}}return B}function n(O,B){var M=O.sortIndex-B.sortIndex;return M!==0?M:O.id-B.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var i=Date,c=i.now();t.unstable_now=function(){return i.now()-c}}var f=[],s=[],r=1,m=null,h=3,v=!1,S=!1,p=!1,T=!1,d=typeof setTimeout=="function"?setTimeout:null,o=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function b(O){for(var B=e(s);B!==null;){if(B.callback===null)a(s);else if(B.startTime<=O)a(s),B.sortIndex=B.expirationTime,l(f,B);else break;B=e(s)}}function z(O){if(p=!1,b(O),!S)if(e(f)!==null)S=!0,U||(U=!0,xt());else{var B=e(s);B!==null&&qe(z,B.startTime-O)}}var U=!1,A=-1,_=5,N=-1;function x(){return T?!0:!(t.unstable_now()-N<_)}function Tt(){if(T=!1,U){var O=t.unstable_now();N=O;var B=!0;try{t:{S=!1,p&&(p=!1,o(A),A=-1),v=!0;var M=h;try{l:{for(b(O),m=e(f);m!==null&&!(m.expirationTime>O&&x());){var P=m.callback;if(typeof P=="function"){m.callback=null,h=m.priorityLevel;var it=P(m.expirationTime<=O);if(O=t.unstable_now(),typeof it=="function"){m.callback=it,b(O),B=!0;break l}m===e(f)&&a(f),b(O)}else a(f);m=e(f)}if(m!==null)B=!0;else{var qt=e(s);qt!==null&&qe(z,qt.startTime-O),B=!1}}break t}finally{m=null,h=M,v=!1}B=void 0}}finally{B?xt():U=!1}}}var xt;if(typeof y=="function")xt=function(){y(Tt)};else if(typeof MessageChannel<"u"){var jl=new MessageChannel,vl=jl.port2;jl.port1.onmessage=Tt,xt=function(){vl.postMessage(null)}}else xt=function(){d(Tt,0)};function qe(O,B){A=d(function(){O(t.unstable_now())},B)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(O){O.callback=null},t.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<O?Math.floor(1e3/O):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_next=function(O){switch(h){case 1:case 2:case 3:var B=3;break;default:B=h}var M=h;h=B;try{return O()}finally{h=M}},t.unstable_requestPaint=function(){T=!0},t.unstable_runWithPriority=function(O,B){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var M=h;h=O;try{return B()}finally{h=M}},t.unstable_scheduleCallback=function(O,B,M){var P=t.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?P+M:P):M=P,O){case 1:var it=-1;break;case 2:it=250;break;case 5:it=1073741823;break;case 4:it=1e4;break;default:it=5e3}return it=M+it,O={id:r++,callback:B,priorityLevel:O,startTime:M,expirationTime:it,sortIndex:-1},M>P?(O.sortIndex=M,l(s,O),e(f)===null&&O===e(s)&&(p?(o(A),A=-1):p=!0,qe(z,M-P))):(O.sortIndex=it,l(f,O),S||v||(S=!0,U||(U=!0,xt()))),O},t.unstable_shouldYield=x,t.unstable_wrapCallback=function(O){var B=h;return function(){var M=h;h=B;try{return O.apply(this,arguments)}finally{h=M}}}})(ar);er.exports=ar;var _m=er.exports,nr={exports:{}},C={};/**
* @license React
* react.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var tf=Symbol.for("react.transitional.element"),Rm=Symbol.for("react.portal"),Dm=Symbol.for("react.fragment"),Um=Symbol.for("react.strict_mode"),Mm=Symbol.for("react.profiler"),Nm=Symbol.for("react.consumer"),Cm=Symbol.for("react.context"),Hm=Symbol.for("react.forward_ref"),Bm=Symbol.for("react.suspense"),xm=Symbol.for("react.memo"),ur=Symbol.for("react.lazy"),qm=Symbol.for("react.activity"),cs=Symbol.iterator;function jm(t){return t===null||typeof t!="object"?null:(t=cs&&t[cs]||t["@@iterator"],typeof t=="function"?t:null)}var ir={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},cr=Object.assign,fr={};function ba(t,l,e){this.props=t,this.context=l,this.refs=fr,this.updater=e||ir}ba.prototype.isReactComponent={};ba.prototype.setState=function(t,l){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,l,"setState")};ba.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function sr(){}sr.prototype=ba.prototype;function lf(t,l,e){this.props=t,this.context=l,this.refs=fr,this.updater=e||ir}var ef=lf.prototype=new sr;ef.constructor=lf;cr(ef,ba.prototype);ef.isPureReactComponent=!0;var fs=Array.isArray;function tc(){}var k={H:null,A:null,T:null,S:null},or=Object.prototype.hasOwnProperty;function af(t,l,e){var a=e.ref;return{$$typeof:tf,type:t,key:l,ref:a!==void 0?a:null,props:e}}function Ym(t,l){return af(t.type,l,t.props)}function nf(t){return typeof t=="object"&&t!==null&&t.$$typeof===tf}function Lm(t){var l={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(e){return l[e]})}var ss=/\/+/g;function mi(t,l){return typeof t=="object"&&t!==null&&t.key!=null?Lm(""+t.key):l.toString(36)}function Xm(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(tc,tc):(t.status="pending",t.then(function(l){t.status==="pending"&&(t.status="fulfilled",t.value=l)},function(l){t.status==="pending"&&(t.status="rejected",t.reason=l)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function Le(t,l,e,a,n){var u=typeof t;(u==="undefined"||u==="boolean")&&(t=null);var i=!1;if(t===null)i=!0;else switch(u){case"bigint":case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case tf:case Rm:i=!0;break;case ur:return i=t._init,Le(i(t._payload),l,e,a,n)}}if(i)return n=n(t),i=a===""?"."+mi(t,0):a,fs(n)?(e="",i!=null&&(e=i.replace(ss,"$&/")+"/"),Le(n,l,e,"",function(s){return s})):n!=null&&(nf(n)&&(n=Ym(n,e+(n.key==null||t&&t.key===n.key?"":(""+n.key).replace(ss,"$&/")+"/")+i)),l.push(n)),1;i=0;var c=a===""?".":a+":";if(fs(t))for(var f=0;f<t.length;f++)a=t[f],u=c+mi(a,f),i+=Le(a,l,e,u,n);else if(f=jm(t),typeof f=="function")for(t=f.call(t),f=0;!(a=t.next()).done;)a=a.value,u=c+mi(a,f++),i+=Le(a,l,e,u,n);else if(u==="object"){if(typeof t.then=="function")return Le(Xm(t),l,e,a,n);throw l=String(t),Error("Objects are not valid as a React child (found: "+(l==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":l)+"). If you meant to render a collection of children, use an array instead.")}return i}function Hn(t,l,e){if(t==null)return t;var a=[],n=0;return Le(t,a,"","",function(u){return l.call(e,u,n++)}),a}function Gm(t){if(t._status===-1){var l=t._result;l=l(),l.then(function(e){(t._status===0||t._status===-1)&&(t._status=1,t._result=e)},function(e){(t._status===0||t._status===-1)&&(t._status=2,t._result=e)}),t._status===-1&&(t._status=0,t._result=l)}if(t._status===1)return t._result.default;throw t._result}var os=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Qm={map:Hn,forEach:function(t,l,e){Hn(t,function(){l.apply(this,arguments)},e)},count:function(t){var l=0;return Hn(t,function(){l++}),l},toArray:function(t){return Hn(t,function(l){return l})||[]},only:function(t){if(!nf(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};C.Activity=qm;C.Children=Qm;C.Component=ba;C.Fragment=Dm;C.Profiler=Mm;C.PureComponent=lf;C.StrictMode=Um;C.Suspense=Bm;C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k;C.__COMPILER_RUNTIME={__proto__:null,c:function(t){return k.H.useMemoCache(t)}};C.cache=function(t){return function(){return t.apply(null,arguments)}};C.cacheSignal=function(){return null};C.cloneElement=function(t,l,e){if(t==null)throw Error("The argument must be a React element, but you Line truncated
* @license React
* react-dom.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Zm=Tl;function dr(t){var l="https://react.dev/errors/"+t;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var e=2;e<arguments.length;e++)l+="&args[]="+encodeURIComponent(arguments[e])}return"Minified React error #"+t+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Yl(){}var Ot={d:{f:Yl,r:function(){throw Error(dr(522))},D:Yl,C:Yl,L:Yl,m:Yl,X:Yl,S:Yl,M:Yl},p:0,findDOMNode:null},Vm=Symbol.for("react.portal");function wm(t,l,e){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Vm,key:a==null?null:""+a,children:t,containerInfo:l,implementation:e}}var Ga=Zm.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Ku(t,l){if(t==="font")return"";if(typeof l=="string")return l==="use-credentials"?l:""}zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ot;zt.createPortal=function(t,l){var e=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)throw Error(dr(299));return wm(t,l,null,e)};zt.flushSync=function(t){var l=Ga.T,e=Ot.p;try{if(Ga.T=null,Ot.p=2,t)return t()}finally{Ga.T=l,Ot.p=e,Ot.d.f()}};zt.preconnect=function(t,l){typeof t=="string"&&(l?(l=l.crossOrigin,l=typeof l=="string"?l==="use-credentials"?l:"":void 0):l=null,Ot.d.C(t,l))};zt.prefetchDNS=function(t){typeof t=="string"&&Ot.d.D(t)};zt.preinit=function(t,l){if(typeof t=="string"&&l&&typeof l.as=="string"){var e=l.as,a=Ku(e,l.crossOrigin),n=typeof l.integrity=="string"?l.integrity:void 0,u=typeof l.fetchPriority=="string"?l.fetchPriority:void 0;e==="style"?Ot.d.S(t,typeof l.precedence=="string"?l.precedence:void 0,{crossOrigin:a,integrity:n,fetchPriority:u}):e==="script"&&Ot.d.X(t,{crossOrigin:a,integrity:n,fetchPriority:u,nonce:typeof l.nonce=="string"?l.nonce:void 0})}};zt.preinitModule=function(t,l){if(typeof t=="string")if(typeof l=="object"&&l!==null){if(l.as==null||l.as==="script"){var e=Ku(l.as,l.crossOrigin);Ot.d.M(t,{crossOrigin:e,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0})}}else l==null&&Ot.d.M(t)};zt.preload=function(t,l){if(typeof t=="string"&&typeof l=="object"&&l!==null&&typeof l.as=="string"){var e=l.as,a=Ku(e,l.crossOrigin);Ot.d.L(t,e,{crossOrigin:a,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0,type:typeof l.type=="string"?l.type:void 0,fetchPriority:typeof l.fetchPriority=="string"?l.fetchPriority:void 0,referrerPolicy:typeof l.referrerPolicy=="string"?l.referrerPolicy:void 0,imageSrcSet:typeof l.imageSrcSet=="string"?l.imageSrcSet:void 0,imageSizes:typeof l.imageSizes=="string"?l.imageSizes:void 0,media:typeof l.media=="string"?l.media:void 0})}};zt.preloadModule=function(t,l){if(typeof t=="string")if(l){var e=Ku(l.as,l.crossOrigin);Ot.d.m(t,{as:typeof l.as=="string"&&l.as!=="script"?l.as:void 0,crossOrigin:e,integrity:typeof l.integrity=="string"?l.integrity:void 0})}else Ot.d.m(t)};zt.requestFormReset=function(t){Ot.d.r(t)};zt.unstable_batchedUpdates=function(t,l){return t(l)};zt.useFormState=function(t,l,e){return Ga.H.useFormState(t,l,e)};zt.useFormStatus=function(){return Ga.H.useHostTransitionStatus()};zt.version="19.2.3";function hr(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hr)}catch(t){console.error(t)}}hr(),rr.exports=zt;var Km=rr.exports;/**
* @license React
* react-dom-client.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var dt=_m,mr=Tl,Jm=Km;function E(t){var l="https://react.dev/errors/"+t;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var e=2;e<arguments.length;e++)l+="&args[]="+encodeURIComponent(arguments[e])}return"Minified React error #"+t+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function yr(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function vn(t){var l=t,e=t;if(t.alternate)for(;l.return;)l=l.return;else{t=l;do l=t,l.flags&4098&&(e=l.return),t=l.return;while(t)}return l.tag===3?e:null}function vr(t){if(t.tag===13){var l=t.memoizedState;if(l===null&&(t=t.alternate,t!==null&&(l=t.memoizedState)),l!==null)return l.dehydrated}return null}function Sr(t){if(t.tag===31){var l=t.memoizedState;if(l===null&&(t=t.alternate,t!==null&&(l=t.memoizedState)),l!==null)return l.dehydrated}return null}function rs(t){if(vn(t)!==t)throw Error(E(188))}function Fm(t){var l=t.alternate;if(!l){if(l=vn(t),l===null)throw Error(E(188));return l!==t?null:t}for(var e=t,a=l;;){var n=e.return;if(n===null)break;var u=n.alternate;if(u===null){if(a=n.return,a!==null){e=a;continue}break}if(n.child===u.child){for(u=n.child;u;){if(u===e)return rs(n),t;if(u===a)return rs(n),l;u=u.sibling}throw Error(E(188))}if(e.return!==a.return)e=n,a=u;else{for(var i=!1,c=n.child;c;){if(c===e){i=!0,e=n,a=u;break}if(c===a){i=!0,a=n,e=u;break}c=c.sibling}if(!i){for(c=u.child;c;){if(c===e){i=!0,e=u,a=n;break}if(c===a){i=!0,a=u,e=n;break}c=c.sibling}if(!i)throw Error(E(189))}}if(e.alternate!==a)throw Error(E(190))}if(e.tag!==3)throw Error(E(188));return e.stateNode.current===e?t:l}function gr(t){var l=t.tag;if(l===5||l===26||l===27||l===6)return t;for(t=t.child;t!==null;){if(l=gr(t),l!==null)return l;t=t.sibling}return null}var I=Object.assign,$m=Symbol.for("react.element"),Bn=Symbol.for("react.transitional.element"),qa=Symbol.for("react.portal"),Qe=Symbol.for("react.fragment"),br=Symbol.for("react.strict_mode"),lc=Symbol.for("react.profiler"),pr=Symbol.for("react.consumer"),zl=Symbol.for("react.context"),uf=Symbol.for("react.forward_ref"),ec=Symbol.for("react.suspense"),ac=Symbol.for("react.suspense_list"),cf=Symbol.for("react.memo"),Ll=Symbol.for("react.lazy"),nc=Symbol.for("react.activity"),Wm=Symbol.for("react.memo_cache_sentinel"),ds=Symbol.iterator;function Da(t){return t===null||typeof t!="object"?null:(t=ds&&t[ds]||t["@@iterator"],typeof t=="function"?t:null)}var km=Symbol.for("react.client.reference");function uc(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===km?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Qe:return"Fragment";case lc:return"Profiler";case br:return"StrictMode";case ec:return"Suspense";case ac:return"SuspenseList";case nc:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case qa:return"Portal";case zl:return t.displayName||"Context";case pr:return(t._context.displayName||"Context")+".Consumer";case uf:var l=t.render;return t=t.displayName,t||(t=l.displayName||l.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case cf:return l=t.displayName||null,l!==null?l:uc(t.type)||"Memo";case Ll:l=t._payload,t=t._init;try{return uc(t(l))}catch{}}return null}var ja=Array.isArray,D=mr.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=Jm.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,be={pending:!1,data:null,method:null,action:null},ic=[],Ze=-1;function ml(t){return{current:t}}function yt(t){0>Ze||(t.current=ic[Ze],ic[Ze]=null,Ze--)}function F(t,l){Ze++,ic[Ze]=t.current,t.current=l}var hl=ml(null),ln=ml(null),Wl=ml(null),mu=ml(null);function yu(t,l){switch(F(Wl,l),F(ln,t),F(hl,null),l.nodeType){case 9:case 11:t=(t=l.documentElement)&&(t=t.namespaceURI)?bo(t):0;break;default:if(t=l.tagName,l=l.namespaceURI)l=bo(l),t=Xh(l,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}yt(hl),F(hl,t)}function ca(){yt(hl),yt(ln),yt(Wl)}function cc(t){t.memoizedState!==null&&F(mu,t);var l=hl.current,e=Xh(l,t.type);l!==e&&(F(ln,t),F(hl,e))}function vu(t){ln.current===t&&(yt(hl),yt(ln)),mu.current===t&&(yt(mu),hn._currentValue=be)}var yi,hs;function me(t){if(yi===void 0)try{throw Error()}catch(e){var l=e.stack.trim().match(/\n( *(at )?)/);yi=l&&l[1]||"",hs=-1<e.stack.indexOf(`
at`)?" (<anonymous>)":-1<e.stack.indexOf("@")?"@unknown:0:0":""}return`
`+yi+t+hs}var vi=!1;function Si(t,l){if(!t||vi)return"";vi=!0;var e=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(l){var m=function(){throw Error()};if(Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(v){var h=v}Reflect.construct(t,[],m)}else{try{m.call()}catch(v){h=v}t.call(m.prototype)}}else{try{throw Error()}catch(v){h=v}(m=t())&&typeof m.catch=="function"&&m.catch(function(){})}}catch(v){if(v&&h&&typeof v.stack=="string")return[v.stack,h.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=a.DetermineComponentFrameRoot(),i=u[0],c=u[1];if(i&&c){var f=i.split(`
`),s=c.split(`
`);for(n=a=0;a<f.length&&!f[a].includes("DetermineComponentFrameRoot");)a++;for(;n<s.length&&!s[n].includes("DetermineComponentFrameRoot");)n++;if(a===f.length||n===s.length)for(a=f.length-1,n=s.length-1;1<=a&&0<=n&&f[a]!==s[n];)n--;for(;1<=a&&0<=n;a--,n--)if(f[a]!==s[n]){if(a!==1||n!==1)do if(a--,n--,0>n||f[a]!==s[n]){var r=`
`+f[a].replace(" at new "," at ");return t.displayName&&r.includes("<anonymous>")&&(r=r.replace("<anonymous>",t.displayName)),r}while(1<=a&&0<=n);break}}}finally{vi=!1,Error.prepareStackTrace=e}return(e=t?t.displayName||t.name:"")?me(e):""}function Im(t,l){switch(t.tag){case 26:case 27:case 5:return me(t.type);case 16:return me("Lazy");case 13:return t.child!==l&&l!==null?me("Suspense Fallback"):me("Suspense");case 19:return me("SuspenseList");case 0:case 15:return Si(t.type,!1);case 11:return Si(t.type.render,!1);case 1:return Si(t.type,!0);case 31:return me("Activity");default:return""}}function ms(t){try{var l="",e=null;do l+=Im(t,e),e=t,t=t.return;while(t);return l}catch(a){return`
Error generating stack: `+a.message+`
`+a.stack}}var fc=Object.prototype.hasOwnProperty,ff=dt.unstable_scheduleCallback,gi=dt.unstable_cancelCallback,Pm=dt.unstable_shouldYield,ty=dt.unstable_requestPaint,Gt=dt.unstable_now,ly=dt.unstable_getCurrentPriorityLevel,Er=dt.unstable_ImmediatePriority,Tr=dt.unstable_UserBlockingPriority,Su=dt.unstable_NormalPriority,ey=dt.unstable_LowPriority,Ar=dt.unstable_IdlePriority,ay=dt.log,ny=dt.unstable_setDisableYieldValue,Sn=null,Qt=null;function wl(t){if(typeof ay=="function"&&ny(t),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(Sn,t)}catch{}}var Zt=Math.clz32?Math.clz32:cy,uy=Math.log,iy=Math.LN2;function cy(t){return t>>>=0,t===0?32:31-(uy(t)/iy|0)|0}var xn=256,qn=262144,jn=4194304;function ye(t){var l=t&42;if(l!==0)return l;switch(t&-t){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ju(t,l,e){var a=t.pendingLanes;if(a===0)return 0;var n=0,u=t.suspendedLanes,i=t.pingedLanes;t=t.warmLanes;var c=a&134217727;return c!==0?(a=c&~u,a!==0?n=ye(a):(i&=c,i!==0?n=ye(i):e||(e=c&~t,e!==0&&(n=ye(e))))):(c=a&~u,c!==0?n=ye(c):i!==0?n=ye(i):e||(e=a&~t,e!==0&&(n=ye(e)))),n===0?0:l!==0&&l!==n&&!(l&u)&&(u=n&-n,e=l&-l,u>=e||u===32&&(e&4194048)!==0)?l:n}function gn(t,l){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&l)===0}function fy(t,l){switch(t){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32: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 l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Or(){var t=jn;return jn<<=1,!(jn&62914560)&&(jn=4194304),t}function bi(t){for(var l=[],e=0;31>e;e++)l.push(t);return l}function bn(t,l){t.pendingLanes|=l,l!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function sy(t,l,e,a,n,u){var i=t.pendingLanes;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=e,t.entangledLanes&=e,t.errorRecoveryDisabledLanes&=e,t.shellSuspendCounter=0;var c=t.entanglements,f=t.expirationTimes,s=t.hiddenUpdates;for(e=i&~e;0<e;){var r=31-Zt(e),m=1<<r;c[r]=0,f[r]=-1;var h=s[r];if(h!==null)for(s[r]=null,r=0;r<h.length;r++){var v=h[r];v!==null&&(v.lane&=-536870913)}e&=~m}a!==0&&zr(t,a,0),u!==0&&n===0&&t.tag!==0&&(t.suspendedLanes|=u&~(i&~l))}function zr(t,l,e){t.pendingLanes|=l,t.suspendedLanes&=~l;var a=31-Zt(l);t.entangledLanes|=l,t.entanglements[a]=t.entanglements[a]|1073741824|e&261930}function _r(t,l){var e=t.entangledLanes|=l;for(t=t.entanglements;e;){var a=31-Zt(e),n=1<<a;n&l|t[a]&l&&(t[a]|=l),e&=~n}}function Rr(t,l){var e=l&-l;return e=e&42?1:sf(e),e&(t.suspendedLanes|l)?0:e}function sf(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function of(t){return t&=-t,2<t?8<t?t&134217727?32:268435456:8:2}function Dr(){var t=Q.p;return t!==0?t:(t=window.event,t===void 0?32:kh(t.type))}function ys(t,l){var e=Q.p;try{return Q.p=t,l()}finally{Q.p=e}}var se=Math.random().toString(36).slice(2),St="__reactFiber$"+se,Ht="__reactProps$"+se,pa="__reactContainer$"+se,sc="__reactEvents$"+se,oy="__reactListeners$"+se,ry="__reactHandles$"+se,vs="__reactResources$"+se,pn="__reactMarker$"+se;function rf(t){delete t[St],delete t[Ht],delete t[sc],delete t[oy],delete t[ry]}function Ve(t){var l=t[St];if(l)return l;for(var e=t.parentNode;e;){if(l=e[pa]||e[St]){if(e=l.alternate,l.child!==null||e!==null&&e.child!==null)for(t=Oo(t);t!==null;){if(e=t[St])return e;t=Oo(t)}return l}t=e,e=t.parentNode}return null}function Ea(t){if(t=t[St]||t[pa]){var l=t.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return t}return null}function Ya(t){var l=t.tag;if(l===5||l===26||l===27||l===6)return t.stateNode;throw Error(E(33))}function ta(t){var l=t[vs];return l||(l=t[vs]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function mt(t){t[pn]=!0}var Ur=new Set,Mr={};function Ne(t,l){fa(t,l),fa(t+"Capture",l)}function fa(t,l){for(Mr[t]=l,t=0;t<l.length;t++)Ur.add(l[t])}var dy=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\ Line truncated
`).replace(Z0,"")}function Lh(t,l){return l=So(l),So(t)===l}function w(t,l,e,a,n,u){switch(e){case"children":typeof a=="string"?l==="body"||l==="textarea"&&a===""||sa(t,a):(typeof a=="number"||typeof a=="bigint")&&l!=="body"&&sa(t,""+a);break;case"className":Yn(t,"class",a);break;case"tabIndex":Yn(t,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Yn(t,e,a);break;case"style":qr(t,a,u);break;case"data":if(l!=="object"){Yn(t,"data",a);break}case"src":case"href":if(a===""&&(l!=="a"||e!=="href")){t.removeAttribute(e);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(e);break}a=kn(""+a),t.setAttribute(e,a);break;case"action":case"formAction":if(typeof a=="function"){t.setAttribute(e,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(e==="formAction"?(l!=="input"&&w(t,l,"name",n.name,n,null),w(t,l,"formEncType",n.formEncType,n,null),w(t,l,"formMethod",n.formMethod,n,null),w(t,l,"formTarget",n.formTarget,n,null)):(w(t,l,"encType",n.encType,n,null),w(t,l,"method",n.method,n,null),w(t,l,"target",n.target,n,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(e);break}a=kn(""+a),t.setAttribute(e,a);break;case"onClick":a!=null&&(t.onclick=_l);break;case"onScroll":a!=null&&q("scroll",t);break;case"onScrollEnd":a!=null&&q("scrollend",t);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(E(61));if(e=a.__html,e!=null){if(n.children!=null)throw Error(E(60));t.innerHTML=e}}break;case"multiple":t.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":t.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){t.removeAttribute("xlink:href");break}e=kn(""+a),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(e,""+a):t.removeAttribute(e);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(e,""):t.removeAttribute(e);break;case"capture":case"download":a===!0?t.setAttribute(e,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(e,a):t.removeAttribute(e);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?t.setAttribute(e,a):t.removeAttribute(e);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?t.removeAttribute(e):t.setAttribute(e,a);break;case"popover":q("beforetoggle",t),q("toggle",t),Wn(t,"popover",a);break;case"xlinkActuate":Sl(t,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Sl(t,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Sl(t,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Sl(t,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Sl(t,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Sl(t,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Sl(t,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Sl(t,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Sl(t,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Wn(t,"is",a);break;case"innerText":case"textContent":break;default:(!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(e=Sy.get(e)||e,Wn(t,e,a))}}function Xc(t,l,e,a,n,u){switch(e){case"style":qr(t,a,u);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(E(61));if(e=a.__html,e!=null){if(n.children!=null)throw Error(E(60));t.innerHTML=e}}break;case"children":typeof a=="string"?sa(t,a):(typeof a=="number"||typeof a=="bigint")&&sa(t,""+a);break;case"onScroll":a!=null&&q("scroll",t);break;case"onScrollEnd":a!=null&&q("scrollend",t);break;case"onClick":a!=null&&(t.onclick=_l);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"re Line truncated
`).forEach(function(i){n=i.indexOf(":"),e=i.substring(0,n).trim().toLowerCase(),a=i.substring(n+1).trim(),!(!e||l[e]&&D1[e])&&(e==="set-cookie"?l[e]?l[e].push(a):l[e]=[a]:l[e]=l[e]?l[e]+", "+a:a)}),l},Xo=Symbol("internals");function xa(t){return t&&String(t).trim().toLowerCase()}function du(t){return t===!1||t==null?t:g.isArray(t)?t.map(du):String(t)}function M1(t){const l=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let a;for(;a=e.exec(t);)l[a[1]]=a[2];return l}const N1=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ki(t,l,e,a,n){if(g.isFunction(a))return a.call(this,l,e);if(n&&(l=e),!!g.isString(l)){if(g.isString(a))return l.indexOf(a)!==-1;if(g.isRegExp(a))return a.test(l)}}function C1(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(l,e,a)=>e.toUpperCase()+a)}function H1(t,l){const e=g.toCamelCase(" "+l);["get","set","has"].forEach(a=>{Object.defineProperty(t,a+e,{value:function(n,u,i){return this[a].call(this,l,n,u,i)},configurable:!0})})}let Ct=class{constructor(l){l&&this.set(l)}set(l,e,a){const n=this;function u(c,f,s){const r=xa(f);if(!r)throw new Error("header name must be a non-empty string");const m=g.findKey(n,r);(!m||n[m]===void 0||s===!0||s===void 0&&n[m]!==!1)&&(n[m||f]=du(c))}const i=(c,f)=>g.forEach(c,(s,r)=>u(s,r,f));if(g.isPlainObject(l)||l instanceof this.constructor)i(l,e);else if(g.isString(l)&&(l=l.trim())&&!N1(l))i(U1(l),e);else if(g.isObject(l)&&g.isIterable(l)){let c={},f,s;for(const r of l){if(!g.isArray(r))throw TypeError("Object iterator must return a key-value pair");c[s=r[0]]=(f=c[s])?g.isArray(f)?[...f,r[1]]:[f,r[1]]:r[1]}i(c,e)}else l!=null&&u(e,l,a);return this}get(l,e){if(l=xa(l),l){const a=g.findKey(this,l);if(a){const n=this[a];if(!e)return n;if(e===!0)return M1(n);if(g.isFunction(e))return e.call(this,n,a);if(g.isRegExp(e))return e.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(l,e){if(l=xa(l),l){const a=g.findKey(this,l);return!!(a&&this[a]!==void 0&&(!e||ki(this,this[a],a,e)))}return!1}delete(l,e){const a=this;let n=!1;function u(i){if(i=xa(i),i){const c=g.findKey(a,i);c&&(!e||ki(a,a[c],c,e))&&(delete a[c],n=!0)}}return g.isArray(l)?l.forEach(u):u(l),n}clear(l){const e=Object.keys(this);let a=e.length,n=!1;for(;a--;){const u=e[a];(!l||ki(this,this[u],u,l,!0))&&(delete this[u],n=!0)}return n}normalize(l){const e=this,a={};return g.forEach(this,(n,u)=>{const i=g.findKey(a,u);if(i){e[i]=du(n),delete e[u];return}const c=l?C1(u):String(u).trim();c!==u&&delete e[u],e[c]=du(n),a[c]=!0}),this}concat(...l){return this.constructor.concat(this,...l)}toJSON(l){const e=Object.create(null);return g.forEach(this,(a,n)=>{a!=null&&a!==!1&&(e[n]=l&&g.isArray(a)?a.join(", "):a)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([l,e])=>l+": "+e).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(l){return l instanceof this?l:new this(l)}static concat(l,...e){const a=new this(l);return e.forEach(n=>a.set(n)),a}static accessor(l){const a=(this[Xo]=this[Xo]={accessors:{}}).accessors,n=this.prototype;function u(i){const c=xa(i);a[c]||(H1(n,i),a[c]=!0)}return g.isArray(l)?l.forEach(u):u(l),this}};Ct.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);g.reduceDescriptors(Ct.prototype,({value:t},l)=>{let e=l[0].toUpperCase()+l.slice(1);return{get:()=>t,set(a){this[e]=a}}});g.freezeMethods(Ct);function Ii(t,l){const e=this||Nn,a=l||e,n=Ct.from(a.headers);let u=a.data;return g.forEach(t,function(c){u=c.call(e,u,n.normalize(),l?l.status:void 0)}),n.normalize(),u}function ym(t){return!!(t&&t.__CANCEL__)}let Cn=class extends R{constructor(l,e,a){super(l??"canceled",R.ERR_CANCELED,e,a),this.name="CanceledError",this.__CANCEL__=!0}};function vm(t,l,e){const a=e.config.validateStatus;!e.status||!a||a(e.status)?t(e):l(new R("Request failed with status code "+e.status,[R.ERR_BAD_REQUEST,R.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function B1(t){const l=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return l&&l[1]||""}function x1(t,l){t=t||10;const e=new Array(t),a=new Array(t);let n=0,u=0,i;return l=l!==void 0?l:1e3,function(f){const s=Date.now(),r=a[u];i||(i=s),e[n]=f,a[n]=s;let m=u,h=0;for(;m!==n;)h+=e[m++],m=m%t;if(n=(n+1)%t,n===u&&(u=(u+1)%t),s-i<l)return;const v=r&&s-r;return v?Math.round(h*1e3/v):void 0}}function q1(t,l){let e=0,a=1e3/l,n,u;const i=(s,r=Date.now())=>{e=r,n=null,u&&(clearTimeout(u),u=null),t(...s)};return[(...s)=>{const r=Date.now(),m=r-e;m>=a?i(s,r):(n=s,u||(u=setTimeout(()=>{u=null,i(n)},a-m)))},()=>n&&i(n)]}const Zu=(t,l,e=3)=>{let a=0;const n=x1(50,250);return q1(u=>{const i=u.loaded,c=u.lengthComputable?u.total:void 0,f=i-a,s=n(f),r=i<=c;a=i;const m={loaded:i,total:c,progress:c?i/c:void 0,bytes:f,rate:s||void 0,estimated:s&&c&&r?(c-i)/s:void 0,event:u,lengthComputable:c!=null,[l?"download":"upload"]:!0};t(m)},e)},Go=(t,l)=>{const e=t!=null;return[a=>l[0]({lengthComputable:e,total:t,loaded:a}),l[1]]},Qo=t=>(...l)=>g.asap(()=>t(...l)),j1=Et.hasStandardBrowserEnv?((t,l)=>e=>(e=new URL(e,Et.origin),t.protocol===e.protocol&&t.host===e.host&&(l||t.port===e.port)))(new URL(Et.origin),Et.navigator&&/(msie|trident)/i.test(Et.navigator.userAgent)):()=>!0,Y1=Et.hasStandardBrowserEnv?{write(t,l,e,a,n,u,i){if(typeof document>"u")return;const c=[`${t}=${encodeURIComponent(l)}`];g.isNumber(e)&&c.push(`expires=${new Date(e).toUTCString()}`),g.isString(a)&&c.push(`path=${a}`),g.isString(n)&&c.push(`domain=${n}`),u===!0&&c.push("secure"),g.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(t){if(typeof document>"u")return null;const l=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return l?decodeURIComponent(l[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function L1(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function X1(t,l){return l?t.replace(/\/?\/$/,"")+"/"+l.replace(/^\/+/,""):t}function Sm(t,l,e){let a=!L1(l);return t&&(a||e==!1)?X1(t,l):l}const Zo=t=>t instanceof Ct?{...t}:t;function Me(t,l){l=l||{};const e={};function a(s,r,m,h){return g.isPlainObject(s)&&g.isPlainObject(r)?g.merge.call({caseless:h},s,r):g.isPlainObject(r)?g.merge({},r):g.isArray(r)?r.slice():r}function n(s,r,m,h){if(g.isUndefined(r)){if(!g.isUndefined(s))return a(void 0,s,m,h)}else return a(s,r,m,h)}function u(s,r){if(!g.isUndefined(r))return a(void 0,r)}function i(s,r){if(g.isUndefined(r)){if(!g.isUndefined(s))return a(void 0,s)}else return a(void 0,r)}function c(s,r,m){if(m in l)return a(s,r);if(m in t)return a(void 0,s)}const f={url:u,method:u,data:u,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(s,r,m)=>n(Zo(s),Zo(r),m,!0)};return g.forEach(Object.keys({...t,...l}),function(r){const m=f[r]||n,h=m(t[r],l[r],r);g.isUndefined(h)&&m!==c||(e[r]=h)}),e}const gm=t=>{const l=Me({},t);let{data:e,withXSRFToken:a,xsrfHeaderName:n,xsrfCookieName:u,headers:i,auth:c}=l;if(l.headers=i=Ct.from(i),l.url=dm(Sm(l.baseURL,l.url,l.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),g.isFormData(e)){if(Et.hasStandardBrowserEnv||Et.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(g.isFunction(e.getHeaders)){const f=e.getHeaders(),s=["content-type","content-length"];Object.entries(f).forEach(([r,m])=>{s.includ Line truncated
`+i.map($o).join(`
`):" "+$o(i[0]):"as no adapter specified";throw new R("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return n}const pm={getAdapter:k1,adapters:us};function Pi(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Cn(null,t)}function Wo(t){return Pi(t),t.headers=Ct.from(t.headers),t.data=Ii.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),pm.getAdapter(t.adapter||Nn.adapter,t)(t).then(function(a){return Pi(t),a.data=Ii.call(t,t.transformResponse,a),a.headers=Ct.from(a.headers),a},function(a){return ym(a)||(Pi(t),a&&a.response&&(a.response.data=Ii.call(t,t.transformResponse,a.response),a.response.headers=Ct.from(a.response.headers))),Promise.reject(a)})}const Em="1.13.3",hi={};["object","boolean","number","function","string","symbol"].forEach((t,l)=>{hi[t]=function(a){return typeof a===t||"a"+(l<1?"n ":" ")+t}});const ko={};hi.transitional=function(l,e,a){function n(u,i){return"[Axios v"+Em+"] Transitional option '"+u+"'"+i+(a?". "+a:"")}return(u,i,c)=>{if(l===!1)throw new R(n(i," has been removed"+(e?" in "+e:"")),R.ERR_DEPRECATED);return e&&!ko[i]&&(ko[i]=!0,console.warn(n(i," has been deprecated since v"+e+" and will be removed in the near future"))),l?l(u,i,c):!0}};hi.spelling=function(l){return(e,a)=>(console.warn(`${a} is likely a misspelling of ${l}`),!0)};function I1(t,l,e){if(typeof t!="object")throw new R("options must be an object",R.ERR_BAD_OPTION_VALUE);const a=Object.keys(t);let n=a.length;for(;n-- >0;){const u=a[n],i=l[u];if(i){const c=t[u],f=c===void 0||i(c,u,t);if(f!==!0)throw new R("option "+u+" must be "+f,R.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new R("Unknown option "+u,R.ERR_BAD_OPTION)}}const hu={assertOptions:I1,validators:hi},sl=hu.validators;let Oe=class{constructor(l){this.defaults=l||{},this.interceptors={request:new Lo,response:new Lo}}async request(l,e){try{return await this._request(l,e)}catch(a){if(a instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const u=n.stack?n.stack.replace(/^.+\n/,""):"";try{a.stack?u&&!String(a.stack).endsWith(u.replace(/^.+\n.+\n/,""))&&(a.stack+=`
`+u):a.stack=u}catch{}}throw a}}_request(l,e){typeof l=="string"?(e=e||{},e.url=l):e=l||{},e=Me(this.defaults,e);const{transitional:a,paramsSerializer:n,headers:u}=e;a!==void 0&&hu.assertOptions(a,{silentJSONParsing:sl.transitional(sl.boolean),forcedJSONParsing:sl.transitional(sl.boolean),clarifyTimeoutError:sl.transitional(sl.boolean)},!1),n!=null&&(g.isFunction(n)?e.paramsSerializer={serialize:n}:hu.assertOptions(n,{encode:sl.function,serialize:sl.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),hu.assertOptions(e,{baseUrl:sl.spelling("baseURL"),withXsrfToken:sl.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=u&&g.merge(u.common,u[e.method]);u&&g.forEach(["delete","get","head","post","put","patch","common"],S=>{delete u[S]}),e.headers=Ct.concat(i,u);const c=[];let f=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(e)===!1||(f=f&&p.synchronous,c.unshift(p.fulfilled,p.rejected))});const s=[];this.interceptors.response.forEach(function(p){s.push(p.fulfilled,p.rejected)});let r,m=0,h;if(!f){const S=[Wo.bind(this),void 0];S.unshift(...c),S.push(...s),h=S.length,r=Promise.resolve(e);let p=e;for(;m<h;)r=r.then(S[m++]).then(T=>{p=T!==void 0?T:p}).catch(S[m++]).then(()=>p);return r}h=c.length;let v=e;for(;m<h;){const S=c[m++],p=c[m++];try{v=S(v)}catch(T){p.call(this,T);break}}try{r=Wo.call(this,v)}catch(S){return Promise.reject(S)}for(m=0,h=s.length;m<h;)r=r.then(s[m++]).catch(s[m++]);return r}getUri(l){l=Me(this.defaults,l);const e=Sm(l.baseURL,l.url,l.allowAbsoluteUrls);return dm(e,l.params,l.paramsSerializer)}};g.forEach(["delete","get","head","options"],function(l){Oe.prototype[l]=function(e,a){return this.request(Me(a||{},{method:l,url:e,data:(a||{}).data}))}});g.forEach(["post","put","patch"],function(l){function e(a){return function(u,i,c){return this.request(Me(c||{},{method:l,headers:a?{"Content-Type":"multipart/form-data"}:{},url:u,data:i}))}}Oe.prototype[l]=e(),Oe.prototype[l+"Form"]=e(!0)});let P1=class Tm{constructor(l){if(typeof l!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(u){e=u});const a=this;this.promise.then(n=>{if(!a._listeners)return;let u=a._listeners.length;for(;u-- >0;)a._listeners[u](n);a._listeners=null}),this.promise.then=n=>{let u;const i=new Promise(c=>{a.subscribe(c),u=c}).then(n);return i.cancel=function(){a.unsubscribe(u)},i},l(function(u,i,c){a.reason||(a.reason=new Cn(u,i,c),e(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(l){if(this.reason){l(this.reason);return}this._listeners?this._listeners.push(l):this._listeners=[l]}unsubscribe(l){if(!this._listeners)return;const e=this._listeners.indexOf(l);e!==-1&&this._listeners.splice(e,1)}toAbortSignal(){const l=new AbortController,e=a=>{l.abort(a)};return this.subscribe(e),l.signal.unsubscribe=()=>this.unsubscribe(e),l.signal}static source(){let l;return{token:new Tm(function(n){l=n}),cancel:l}}};function tS(t){return function(e){return t.apply(null,e)}}function lS(t){return g.isObject(t)&&t.isAxiosError===!0}const Pc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Pc).forEach(([t,l])=>{Pc[l]=t});function Am(t){const l=new Oe(t),e=lm(Oe.prototype.request,l);return g.extend(e,Oe.prototype,l,{allOwnKeys:!0}),g.extend(e,l,null,{allOwnKeys:!0}),e.create=function(n){return Am(Me(t,n))},e}const ut=Am(Nn);ut.Axios=Oe;ut.CanceledError=Cn;ut.CancelToken=P1;ut.isCancel=ym;ut.VERSION=Em;ut.toFormData=di;ut.AxiosError=R;ut.Cancel=ut.CanceledError;ut.all=function(l){return Promise.all(l Line truncated
+12
View File
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="it">
<head>
<meta charset="utf-8" />
<title>Traduttore Multiformato</title>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<script type="module" crossorigin src="/assets/index-BWRQMese.js"></script>
</head>
<body>
<div id="root"></div>
</body>
</html>
View File
Whitespace-only changes.
+10
View File
@@ -0,0 +1,10 @@
FROM python:3.13-slim
WORKDIR /app
COPY backend/requirements.txt ./requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
COPY backend ./backend
ENV PYTHONPATH=/app
CMD ["uvicorn", "backend.app.main:app", "--host", "0.0.0.0", "--port", "8000"]
Binary file not shown.
+15
View File
@@ -0,0 +1,15 @@
from fastapi import FastAPI
from backend.app.routers import health, translation
app = FastAPI()
app.include_router(health.router)
app.include_router(translation.router, prefix="/api")
@app.on_event("startup")
async def startup_event():
print("Avvio del servizio di traduzione")
@app.on_event("shutdown")
async def shutdown_event():
await translation.ollama_client.close()
+1
View File
@@ -0,0 +1 @@
from . import session
+25
View File
@@ -0,0 +1,25 @@
from datetime import datetime
from typing import List, Optional
from pydantic import BaseModel, Field
class SessionState(BaseModel):
session_id: str
file_title: str
text_title: Optional[str]
source_lang: str
target_lang: str
total_chunks: int
current_chunk_index: int
status: str
started_at: Optional[datetime] = None
ended_at: Optional[datetime] = None
last_chunk_at: Optional[datetime] = None
eta_seconds: Optional[int] = None
chunks_remaining: Optional[int] = None
stop_requested: bool = False
error_message: Optional[str] = None
translated_text: str = ""
translated_chunks: List[str] = Field(default_factory=list)
final_document_path: Optional[str] = None
+1
View File
@@ -0,0 +1 @@
"""Collects processor entrypoints for EPUB/PDF/DOCX/TXT."""
+14
View File
@@ -0,0 +1,14 @@
from pathlib import Path
from docx import Document
from backend.app.processors.models import DocumentExtraction
from backend.app.processors.utils import normalize_paragraphs
def process_docx(path: Path) -> DocumentExtraction:
doc = Document(path)
title = doc.core_properties.title or None
raw_text = "\n\n".join(p.text for p in doc.paragraphs if p.text.strip())
paragraphs = normalize_paragraphs(raw_text)
return DocumentExtraction(title=title, paragraphs=paragraphs)
+28
View File
@@ -0,0 +1,28 @@
from html import unescape
from pathlib import Path
import re
from ebooklib import ITEM_DOCUMENT, epub
from backend.app.processors.models import DocumentExtraction
from backend.app.processors.utils import normalize_paragraphs
HTML_TAG_RE = re.compile(r"<[^>]+>")
def _strip_tags(source: str) -> str:
return unescape(HTML_TAG_RE.sub("", source))
def process_epub(path: Path) -> DocumentExtraction:
book = epub.read_epub(path)
title_meta = book.get_metadata("DC", "title")
title = title_meta[0][0] if title_meta else None
paragraphs: list[str] = []
for item in book.get_items_of_type(ITEM_DOCUMENT):
html = item.get_content().decode("utf-8", errors="ignore")
text = _strip_tags(html)
paragraphs.extend(normalize_paragraphs(text))
return DocumentExtraction(title=title, paragraphs=paragraphs)
+15
View File
@@ -0,0 +1,15 @@
from dataclasses import dataclass
from typing import List, Optional
@dataclass
class DocumentExtraction:
title: Optional[str]
paragraphs: List[str]
source_language: Optional[str] = None
@dataclass
class DocumentChunk:
index: int
text: str
title_hint: Optional[str]
paragraph_count: int
+40
View File
@@ -0,0 +1,40 @@
from pathlib import Path
from typing import List
import fitz
from pdf2image import convert_from_path
import pytesseract
from backend.app.processors.models import DocumentExtraction
from backend.app.processors.utils import normalize_paragraphs
def process_pdf(path: Path) -> DocumentExtraction:
paragraphs = _extract_text_pages(path)
if not paragraphs:
paragraphs = _extract_via_ocr(path)
return DocumentExtraction(title=None, paragraphs=paragraphs)
def _extract_text_pages(path: Path) -> List[str]:
doc = fitz.open(path)
collected = []
for page in doc:
text = page.get_text("text")
if text.strip():
collected.extend(normalize_paragraphs(text))
return collected
def _extract_via_ocr(path: Path) -> List[str]:
try:
images = convert_from_path(str(path), dpi=200)
except Exception:
return []
paragraphs = []
for image in images:
text = pytesseract.image_to_string(image)
if text.strip():
paragraphs.extend(normalize_paragraphs(text))
return paragraphs
+22
View File
@@ -0,0 +1,22 @@
from pathlib import Path
from typing import Callable, Optional
from backend.app.processors.models import DocumentExtraction
from backend.app.processors.docx_processor import process_docx
from backend.app.processors.epub_processor import process_epub
from backend.app.processors.pdf_processor import process_pdf
from backend.app.processors.txt_processor import process_txt
ProcessorFn = Callable[[Path], DocumentExtraction]
PROCESSORS: dict[str, ProcessorFn] = {
".txt": process_txt,
".docx": process_docx,
".pdf": process_pdf,
".epub": process_epub,
}
def select_processor(path: Path) -> Optional[ProcessorFn]:
suffix = path.suffix.lower()
return PROCESSORS.get(suffix)
+10
View File
@@ -0,0 +1,10 @@
from pathlib import Path
from backend.app.processors.models import DocumentExtraction
from backend.app.processors.utils import normalize_paragraphs
def process_txt(path: Path) -> DocumentExtraction:
text = path.read_text(encoding="utf-8", errors="ignore")
paragraphs = normalize_paragraphs(text)
return DocumentExtraction(title=path.stem, paragraphs=paragraphs)
+18
View File
@@ -0,0 +1,18 @@
import re
from typing import List
PARAGRAPH_SPLIT_RE = re.compile(r"\n{2,}")
def normalize_paragraphs(source: str) -> List[str]:
text = source.replace("\r\n", "\n").strip()
if not text:
return []
paragraphs = [p.strip() for p in PARAGRAPH_SPLIT_RE.split(text)]
normalized = [p for p in paragraphs if p]
return normalized
def merge_paragraphs(paragraphs: List[str]) -> str:
return "\n\n".join(paragraphs)
+1
View File
@@ -0,0 +1 @@
from . import health, translation
+7
View File
@@ -0,0 +1,7 @@
from fastapi import APIRouter
router = APIRouter()
@router.get("/health")
async def health_check():
return {"status": "ok", "service": "traduttore"}
+223
View File
@@ -0,0 +1,223 @@
import asyncio
import json
import logging
import os
import tempfile
from datetime import datetime
from pathlib import Path
from typing import List
from uuid import uuid4
from fastapi import APIRouter, BackgroundTasks, File, Form, HTTPException, UploadFile
from langdetect import DetectorFactory, detect
from fastapi.responses import StreamingResponse
from backend.app.models.session import SessionState
from backend.app.processors.registry import select_processor
from backend.app.services.chunking import chunk_document, chunk_store
from backend.app.utils.logger import logger
from backend.app.utils.merge import write_final_document
from backend.app.utils.ollama_client import OllamaClient
from backend.app.utils.session_store import session_store
DetectorFactory.seed = 0
router = APIRouter()
OLLAMA_BASE_URL = os.getenv("OLLAMA_URL", "https://ollama.solarpi.net")
OLLAMA_MODEL = os.getenv("OLLAMA_MODEL", "translategemma:latest")
ollama_client = OllamaClient(OLLAMA_BASE_URL, OLLAMA_MODEL)
def _detect_language(paragraphs: List[str]) -> str:
snippet = " ".join(paragraphs[:5])
if not snippet.strip():
return "auto"
try:
return detect(snippet)
except Exception:
return "auto"
async def _save_upload(upload: UploadFile) -> Path:
suffix = Path(upload.filename or "").suffix or ".bin"
with tempfile.NamedTemporaryFile(delete=False, suffix=suffix) as tmp:
payload = await upload.read()
tmp.write(payload)
tmp.flush()
return Path(tmp.name)
def _build_session(session_id: str, file_title: str, extraction_title: str, source_lang: str, target_lang: str, chunk_count: int) -> SessionState:
return SessionState(
session_id=session_id,
file_title=file_title,
text_title=extraction_title or file_title,
source_lang=source_lang,
target_lang=target_lang,
total_chunks=chunk_count,
current_chunk_index=0,
status="pending",
chunks_remaining=chunk_count,
)
async def _run_translation(session_id: str) -> None:
session = session_store.get(session_id)
if not session:
return
session.status = "running"
session.started_at = datetime.utcnow()
session_store.update(session)
logger.info("Sessione %s: avvio traduzione", session_id)
chunks = chunk_store.get_chunks(session_id)
durations: List[float] = []
for chunk in chunks:
session = session_store.get(session_id)
if not session:
return
if session.stop_requested:
session.status = "stopped"
session_store.update(session)
logger.info("Sessione %s: interrotta dall'utente", session_id)
return
start = datetime.utcnow()
try:
translation = await ollama_client.translate(chunk.text, session.source_lang, session.target_lang)
except Exception as exc:
session.status = "error"
session.error_message = str(exc)
session_store.update(session)
logger.error("Sessione %s chunk %s fallito: %s", session_id, chunk.index, exc)
return
now = datetime.utcnow()
duration = (now - start).total_seconds()
durations.append(duration)
if len(durations) > 3:
durations.pop(0)
session.translated_chunks.append(translation)
session.translated_text = "\n\n".join(session.translated_chunks)
session.current_chunk_index = chunk.index
session.chunks_remaining = max(0, session.total_chunks - chunk.index)
session.last_chunk_at = now
avg = sum(durations) / len(durations) if durations else 0
session.eta_seconds = int(avg * session.chunks_remaining) if session.chunks_remaining else 0
session_store.update(session)
logger.info("Sessione %s: chunk %s tradotto", session_id, chunk.index)
session.status = "completed"
session.ended_at = datetime.utcnow()
session.chunks_remaining = 0
session.eta_seconds = 0
session.final_document_path = str(write_final_document(session.session_id, session.translated_text))
logger.info("Sessione %s completata. Documento finale: %s", session_id, session.final_document_path)
session_store.update(session)
@router.post("/upload")
async def upload_document(target_lang: str = Form(...), file: UploadFile = File(...)):
processor = select_processor(Path(file.filename or ""))
if not processor:
raise HTTPException(status_code=400, detail="Formato file non supportato")
temp_path = await _save_upload(file)
try:
extraction = processor(temp_path)
finally:
temp_path.unlink(missing_ok=True)
language = extraction.source_language or _detect_language(extraction.paragraphs)
session_id = uuid4().hex
chunks = chunk_document(session_id, extraction)
logger.info("Sessione %s: %s chunk generati", session_id, len(chunks))
session = _build_session(
session_id,
file.filename or "sconosciuto",
extraction.title,
language,
target_lang,
len(chunks),
)
session_store.create(session)
return {
"session_id": session.session_id,
"total_chunks": session.total_chunks,
"source_lang": session.source_lang,
}
@router.post("/start")
async def start_translation(session_id: str, background: BackgroundTasks):
session = session_store.get(session_id)
if not session:
raise HTTPException(status_code=404, detail="Sessione non trovata")
if session.status == "running":
return {"message": "Traduzione già in corso", "session_id": session_id}
session.status = "running"
session.stop_requested = False
session_store.update(session)
logger.info("Sessione %s: start richiesta", session_id)
background.add_task(_run_translation, session_id)
return {"message": "Traduzione avviata", "session_id": session_id}
@router.post("/stop")
async def stop_translation(session_id: str):
session = session_store.get(session_id)
if not session:
raise HTTPException(status_code=404, detail="Sessione non trovata")
session.stop_requested = True
session.status = "stopping"
session_store.update(session)
logger.info("Sessione %s: stop richiesto", session_id)
return {"message": "Stop richiesto", "session_id": session_id}
@router.get("/status/{session_id}")
async def translation_status(session_id: str):
session = session_store.get(session_id)
if not session:
raise HTTPException(status_code=404, detail="Sessione non trovata")
return session
async def _sse_generator(session_id: str):
while True:
session = session_store.get(session_id)
if not session:
break
payload = {
"status": session.status,
"current_chunk": session.current_chunk_index,
"total_chunks": session.total_chunks,
"chunks_remaining": session.chunks_remaining,
"eta_seconds": session.eta_seconds,
"translated_text": session.translated_text,
"error_message": session.error_message,
"file_title": session.file_title,
"text_title": session.text_title,
"started_at": session.started_at.isoformat() if session.started_at else None,
"ended_at": session.ended_at.isoformat() if session.ended_at else None,
}
yield f"data: {json.dumps(payload)}\n\n"
if session.status in {"completed", "error", "stopped"}:
break
await asyncio.sleep(1)
@router.get("/stream/{session_id}")
async def translation_stream(session_id: str):
if not session_store.get(session_id):
raise HTTPException(status_code=404, detail="Sessione non trovata")
headers = {"Cache-Control": "no-cache", "X-Accel-Buffering": "no"}
return StreamingResponse(_sse_generator(session_id), media_type="text/event-stream", headers=headers)
+1
View File
@@ -0,0 +1 @@
from .chunking import chunk_document, chunk_store
+87
View File
@@ -0,0 +1,87 @@
from dataclasses import dataclass
from datetime import datetime
from typing import Dict, List, Optional
from backend.app.processors.models import DocumentChunk, DocumentExtraction
@dataclass
class SessionChunks:
extraction: DocumentExtraction
chunks: List[DocumentChunk]
created_at: datetime
class ChunkStore:
def __init__(self):
self._sessions: Dict[str, SessionChunks] = {}
def register(self, session_id: str, extraction: DocumentExtraction, chunks: List[DocumentChunk]) -> None:
self._sessions[session_id] = SessionChunks(extraction, chunks, datetime.utcnow())
def get_chunks(self, session_id: str) -> List[DocumentChunk]:
session = self._sessions.get(session_id)
return session.chunks if session else []
def get_session(self, session_id: str) -> Optional[SessionChunks]:
return self._sessions.get(session_id)
def remove(self, session_id: str) -> None:
self._sessions.pop(session_id, None)
chunk_store = ChunkStore()
def _looks_like_title(paragraph: str) -> bool:
stripped = paragraph.strip()
if not stripped:
return False
if stripped.startswith("#"):
return True
if stripped.endswith(":") and len(stripped) < 60:
return True
if stripped.isupper() and len(stripped) < 120:
return True
return False
def chunk_document(session_id: str, extraction: DocumentExtraction, chunk_size: int = 2_500) -> List[DocumentChunk]:
paragraphs = [p.strip() for p in extraction.paragraphs if p.strip()]
if not paragraphs:
chunk_store.register(session_id, extraction, [])
return []
chunks: List[DocumentChunk] = []
buffer: List[str] = []
buffer_len = 0
current_title = extraction.title
def flush_chunk() -> None:
nonlocal buffer, buffer_len, current_title
if not buffer:
return
chunk_text = "\n\n".join(buffer)
chunks.append(
DocumentChunk(
index=len(chunks) + 1,
text=chunk_text,
title_hint=current_title,
paragraph_count=len(buffer),
)
)
buffer = []
buffer_len = 0
for paragraph in paragraphs:
if _looks_like_title(paragraph):
current_title = paragraph
addition_len = len(paragraph)
if buffer and buffer_len + addition_len + 2 > chunk_size:
flush_chunk()
buffer.append(paragraph)
buffer_len += addition_len + 2
flush_chunk()
chunk_store.register(session_id, extraction, chunks)
return chunks
+1
View File
@@ -0,0 +1 @@
"""Helpers for ETA, config, and state tracking will live here."""
Binary file not shown.
Binary file not shown.
+15
View File
@@ -0,0 +1,15 @@
import logging
from pathlib import Path
LOG_FILE = Path("backend.log")
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s %(levelname)s %(name)s %(message)s",
handlers=[
logging.StreamHandler(),
logging.FileHandler(LOG_FILE, encoding="utf-8"),
],
)
logger = logging.getLogger("traduttore")
+10
View File
@@ -0,0 +1,10 @@
from pathlib import Path
OUTPUT_BASE = Path("_bmad-output").resolve()
OUTPUT_BASE.mkdir(exist_ok=True)
def write_final_document(session_id: str, content: str) -> Path:
target = OUTPUT_BASE / f"translated-{session_id}.txt"
target.write_text(content, encoding="utf-8")
return target
+37
View File
@@ -0,0 +1,37 @@
from typing import Optional
import httpx
def _build_prompt(source_lang: str, target_lang: str, text: str) -> str:
return (
f"Traduci dal {source_lang} al {target_lang}:\\n" f"{text}"
)
class OllamaClient:
def __init__(self, base_url: str, model: str):
self._base_url = base_url.rstrip("/")
self._model = model
self._client = httpx.AsyncClient(base_url=self._base_url, timeout=60.0)
async def translate(self, text: str, source_lang: str, target_lang: str) -> str:
payload = {
"model": self._model,
"prompt": _build_prompt(source_lang or "auto", target_lang, text),
"stream": False,
}
try:
resp = await self._client.post("/api/chat", json=payload)
resp.raise_for_status()
body = resp.json()
except httpx.HTTPError as exc:
raise RuntimeError(f"Errore Ollama: {exc}") from exc
if isinstance(body, dict):
message = body.get("response") or ""
return message.strip()
return ""
async def close(self) -> None:
await self._client.aclose()
+23
View File
@@ -0,0 +1,23 @@
from typing import Dict, Optional
from backend.app.models.session import SessionState
class SessionStore:
def __init__(self):
self._sessions: Dict[str, SessionState] = {}
def create(self, state: SessionState) -> None:
self._sessions[state.session_id] = state
def get(self, session_id: str) -> Optional[SessionState]:
return self._sessions.get(session_id)
def update(self, state: SessionState) -> None:
self._sessions[state.session_id] = state
def remove(self, session_id: str) -> None:
self._sessions.pop(session_id, None)
session_store = SessionStore()
+11
View File
@@ -0,0 +1,11 @@
fastapi
uvicorn[standard]
pydantic
httpx
python-multipart
langdetect
python-docx
PyMuPDF
pdf2image
pytesseract
ebooklib
+9
View File
@@ -0,0 +1,9 @@
from fastapi.testclient import TestClient
from backend.app.main import app
client = TestClient(app)
def test_health_check():
resp = client.get("/health")
assert resp.status_code == 200
assert resp.json().get("status") == "ok"
+69
View File
@@ -0,0 +1,69 @@
import json
from pathlib import Path
from typing import Callable
import fitz
from ebooklib import epub
from docx import Document
from backend.app.processors.registry import select_processor
from backend.app.services.chunking import chunk_document
def _create_docx(path: Path) -> Path:
doc = Document()
doc.add_heading("Titolo principale", level=1)
doc.add_paragraph("Primo paragrafo del documento.")
doc.add_paragraph("Secondo paragrafo con alcune frasi.")
doc.save(path)
return path
def _create_pdf(path: Path) -> Path:
doc = fitz.open()
page = doc.new_page()
page.insert_text((72, 72), "Titolo PDF\n\nParagrafo PDF di prova.")
doc.save(path)
doc.close()
return path
def _create_epub(path: Path) -> Path:
book = epub.EpubBook()
book.set_identifier("test-123")
book.set_title("EPUB di prova")
book.set_language("it")
chapter = epub.EpubHtml(title="Capitolo", file_name="chap.xhtml")
chapter.content = "<h1>Capitolo</h1><p>Paragrafo EPUB.</p>"
book.add_item(chapter)
book.toc = (epub.Link("chap.xhtml", "Capitolo", "chap"),)
book.add_item(epub.EpubNcx())
book.add_item(epub.EpubNav())
epub.write_epub(str(path), book)
return path
def _create_txt(path: Path) -> Path:
path.write_text("Titolo TXT\n\nParagrafo 1\n\nParagrafo 2", encoding="utf-8")
return path
generator_map: dict[str, Callable[[Path], Path]] = {
".docx": _create_docx,
".pdf": _create_pdf,
".epub": _create_epub,
".txt": _create_txt,
}
def test_processor_chain(tmp_path: Path):
for suffix, generator in generator_map.items():
target = tmp_path / f"sample{suffix}"
path = generator(target)
processor = select_processor(path)
assert processor is not None, f"Processor missing for {suffix}"
extraction = processor(path)
chunks = chunk_document(f"session-{suffix}", extraction)
assert chunks, f"Nessun chunk per {suffix}"
assert all(chunk.text.strip() for chunk in chunks)
+27
View File
@@ -0,0 +1,27 @@
version: "3.9"
services:
backend:
build:
context: .
dockerfile: backend/Dockerfile
ports:
- "8000:8000"
environment:
OLLAMA_URL: https://ollama.solarpi.net
OLLAMA_MODEL: translategemma:latest
volumes:
- ./backend:/app/backend:ro
- ./_bmad-output:/app/_bmad-output
restart: on-failure
frontend:
build:
context: .
dockerfile: frontend/Dockerfile
ports:
- "5173:5173"
depends_on:
- backend
environment:
- VITE_API_BASE=http://localhost:8000/api
+62
View File
@@ -0,0 +1,62 @@
# Traduttore Multiformato - Architettura e Regole
## 1. Chunking e preservazione struttura
- Ogni chunk copre max 2.500 caratteri (testi vocali) o un paragrafo intero se più corto.
- Il chunking cerca di rispettare titoli e separazioni: i chunk iniziano al punto in cui viene individuato un titolo o una riga vuota pre-esistente. Titoli (H1/H2/H3 o linee con `#`) vengono mantenuti e replicati nel chunk iniziale che li contiene.
- Se il chunk contiene più paragrafi, viene inserito un marcatore interno (`¶`) per mantenere la separazione e garantire il merge coerente.
- Per PDF/EPUB, il parser mantiene i metadati originali (titolo, sottotitoli) e li allega al primo chunk.
- Chunk sequenziali vengono inviati a `translategemma:latest` via Ollama e la traduzione restituita viene appesa immediatamente all'interfaccia.
- Il sistema calcola ETA dinamico: media temporale (ms o s) degli ultimi 3 chunk * chunk rimanenti; aggiornato dopo ogni chunk completato.
## 2. Metadati e stato della sessione
- Ogni sessione mantiene:
- `session_id` (UUID breve)
- `file_title`: nome file caricato.
- `text_title`: se disponibile, titolo interno del documento.
- `source_lang`: lingua rilevata (via `langdetect`).
- `target_lang`: scelta dropdown (almeno `en`, `it` + altre 13 principali).
- `total_chunks` e `current_chunk_index`.
- `started_at`, `ended_at`, `last_chunk_at` (timestamp ISO).
- `status`: `pending`, `running`, `stopped`, `error`, `completed`.
- `eta_seconds` e `chunks_remaining` ma anche `error_message`.*
- Il backend espone `/status/{session_id}` per restituire stato, ETA, chunk totali/rimanenti, flag stop, e testo tradotto attualmente completo.
## 3. API FastAPI proposta
- `POST /upload`:
- Input: file multipart, `target_lang` (codice ISO), optional `session_id` (per riprendere).
- Output: metadati del file, session_id, chunk count, detected source lang.
- Effettua parsing in `processors/` e costruisce buffer chunking.
- `POST /start`:
- Input: `session_id`, `start_from_chunk` optional.
- Output: conferma avvio, stats iniziali.
- Inizia loop chunk → Ollama, aggiorna stato, notifica SSE/polling.
- `POST /stop`:
- Input: `session_id`.
- Output: flag stop e stato corrente; ferma la sequenza.
- `GET /status/{session_id}`:
- Output: sessione JSON con tuti i campi sopra incluse caption (titolo file/text, numeri chunk, ETA per UI).
- `GET /stream/{session_id}` (opzionale SSE o websocket): trasmette chunk completati insieme al testo parziale per box traduzione.
## 4. Interfaccia e flusso operativo
- Dropdown lingua: 15 lingue principali (es. `en`, `it`, `es`, `fr`, `de`, `pt`, `ru`, `zh`, `ja`, `ko`, `ar`, `hi`, `nl`, `sv`, `pl`). Inglese e italiano obbligatori.
- Titolo file e titolo testo in caption; seguenti caption per orari e chunk:
- `File caricato: {file_title}`
- `Titolo documento: {text_title or titolo fallback}`
- `Avvio traduzione: {started_at}`
- `Fine traduzione: {ended_at}` (aggiornato a fine)
- `ETA: {eta_seconds} sec` (aggiornamento ogni chunk)
- `Chunk totali: {total_chunks}`
- `Chunk rimanenti: {chunks_remaining}`
- Box traduzione aggiorna per append di chunk completato; log di errore appare nella caption dedicata.
- Pulsanti: `Avvia traduzione` (chiama /start), `Stop traduzione` (chiama /stop).
## 5. Comunicazione con Ollama
- Client HTTP (es. `httpx.AsyncClient`) verso `https://ollama.solarpi.net/api/models/translategemma:latest`.
- Payload chunk: {"prompt": "translate ...", ... } definire parametro prompt per target.
- Timeout controllato (es. 60s) e retry (max 2) per chunk.
- Se errore, sessione passa in `error` con `error_message` e UI mostra caption rosso.
## 6. Next step suggerito
1. Creare `backend/` e `frontend/` skeleton con router, componenti e placeholder per captions e stato.
2. Implementare parser file e chunker.
3. Costruire client Ollama e endpoint di stato.
+15
View File
@@ -0,0 +1,15 @@
FROM node:20-alpine AS build
WORKDIR /app
COPY frontend/package*.json frontend/tsconfig.json frontend/vite.config.ts ./
COPY frontend/src ./src
COPY frontend/public ./public
COPY frontend/index.html ./
RUN npm install
RUN npm run build
FROM node:20-alpine
WORKDIR /app
RUN npm install -g serve
COPY --from=build /app/dist ./dist
EXPOSE 5173
CMD ["serve", "-s", "dist", "-l", "5173"]
+54
View File
@@ -0,0 +1,54 @@
(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))a(n);new MutationObserver(n=>{for(const u of n)if(u.type==="childList")for(const i of u.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&a(i)}).observe(document,{childList:!0,subtree:!0});function e(n){const u={};return n.integrity&&(u.integrity=n.integrity),n.referrerPolicy&&(u.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?u.credentials="include":n.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(n){if(n.ep)return;n.ep=!0;const u=e(n);fetch(n.href,u)}})();var Po={exports:{}},Vu={};/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Om=Symbol.for("react.transitional.element"),zm=Symbol.for("react.fragment");function tr(t,l,e){var a=null;if(e!==void 0&&(a=""+e),l.key!==void 0&&(a=""+l.key),"key"in l){e={};for(var n in l)n!=="key"&&(e[n]=l[n])}else e=l;return l=e.ref,{$$typeof:Om,type:t,key:a,ref:l!==void 0?l:null,props:e}}Vu.Fragment=zm;Vu.jsx=tr;Vu.jsxs=tr;Po.exports=Vu;var X=Po.exports,lr={exports:{}},wu={},er={exports:{}},ar={};/**
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(t){function l(O,B){var M=O.length;O.push(B);t:for(;0<M;){var P=M-1>>>1,it=O[P];if(0<n(it,B))O[P]=B,O[M]=it,M=P;else break t}}function e(O){return O.length===0?null:O[0]}function a(O){if(O.length===0)return null;var B=O[0],M=O.pop();if(M!==B){O[0]=M;t:for(var P=0,it=O.length,qt=it>>>1;P<qt;){var nl=2*(P+1)-1,re=O[nl],Jt=nl+1,de=O[Jt];if(0>n(re,M))Jt<it&&0>n(de,re)?(O[P]=de,O[Jt]=M,P=Jt):(O[P]=re,O[nl]=M,P=nl);else if(Jt<it&&0>n(de,M))O[P]=de,O[Jt]=M,P=Jt;else break t}}return B}function n(O,B){var M=O.sortIndex-B.sortIndex;return M!==0?M:O.id-B.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var i=Date,c=i.now();t.unstable_now=function(){return i.now()-c}}var f=[],s=[],r=1,m=null,h=3,v=!1,S=!1,p=!1,T=!1,d=typeof setTimeout=="function"?setTimeout:null,o=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function b(O){for(var B=e(s);B!==null;){if(B.callback===null)a(s);else if(B.startTime<=O)a(s),B.sortIndex=B.expirationTime,l(f,B);else break;B=e(s)}}function z(O){if(p=!1,b(O),!S)if(e(f)!==null)S=!0,U||(U=!0,xt());else{var B=e(s);B!==null&&qe(z,B.startTime-O)}}var U=!1,A=-1,_=5,N=-1;function x(){return T?!0:!(t.unstable_now()-N<_)}function Tt(){if(T=!1,U){var O=t.unstable_now();N=O;var B=!0;try{t:{S=!1,p&&(p=!1,o(A),A=-1),v=!0;var M=h;try{l:{for(b(O),m=e(f);m!==null&&!(m.expirationTime>O&&x());){var P=m.callback;if(typeof P=="function"){m.callback=null,h=m.priorityLevel;var it=P(m.expirationTime<=O);if(O=t.unstable_now(),typeof it=="function"){m.callback=it,b(O),B=!0;break l}m===e(f)&&a(f),b(O)}else a(f);m=e(f)}if(m!==null)B=!0;else{var qt=e(s);qt!==null&&qe(z,qt.startTime-O),B=!1}}break t}finally{m=null,h=M,v=!1}B=void 0}}finally{B?xt():U=!1}}}var xt;if(typeof y=="function")xt=function(){y(Tt)};else if(typeof MessageChannel<"u"){var jl=new MessageChannel,vl=jl.port2;jl.port1.onmessage=Tt,xt=function(){vl.postMessage(null)}}else xt=function(){d(Tt,0)};function qe(O,B){A=d(function(){O(t.unstable_now())},B)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(O){O.callback=null},t.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<O?Math.floor(1e3/O):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_next=function(O){switch(h){case 1:case 2:case 3:var B=3;break;default:B=h}var M=h;h=B;try{return O()}finally{h=M}},t.unstable_requestPaint=function(){T=!0},t.unstable_runWithPriority=function(O,B){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var M=h;h=O;try{return B()}finally{h=M}},t.unstable_scheduleCallback=function(O,B,M){var P=t.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?P+M:P):M=P,O){case 1:var it=-1;break;case 2:it=250;break;case 5:it=1073741823;break;case 4:it=1e4;break;default:it=5e3}return it=M+it,O={id:r++,callback:B,priorityLevel:O,startTime:M,expirationTime:it,sortIndex:-1},M>P?(O.sortIndex=M,l(s,O),e(f)===null&&O===e(s)&&(p?(o(A),A=-1):p=!0,qe(z,M-P))):(O.sortIndex=it,l(f,O),S||v||(S=!0,U||(U=!0,xt()))),O},t.unstable_shouldYield=x,t.unstable_wrapCallback=function(O){var B=h;return function(){var M=h;h=B;try{return O.apply(this,arguments)}finally{h=M}}}})(ar);er.exports=ar;var _m=er.exports,nr={exports:{}},C={};/**
* @license React
* react.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var tf=Symbol.for("react.transitional.element"),Rm=Symbol.for("react.portal"),Dm=Symbol.for("react.fragment"),Um=Symbol.for("react.strict_mode"),Mm=Symbol.for("react.profiler"),Nm=Symbol.for("react.consumer"),Cm=Symbol.for("react.context"),Hm=Symbol.for("react.forward_ref"),Bm=Symbol.for("react.suspense"),xm=Symbol.for("react.memo"),ur=Symbol.for("react.lazy"),qm=Symbol.for("react.activity"),cs=Symbol.iterator;function jm(t){return t===null||typeof t!="object"?null:(t=cs&&t[cs]||t["@@iterator"],typeof t=="function"?t:null)}var ir={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},cr=Object.assign,fr={};function ba(t,l,e){this.props=t,this.context=l,this.refs=fr,this.updater=e||ir}ba.prototype.isReactComponent={};ba.prototype.setState=function(t,l){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,l,"setState")};ba.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function sr(){}sr.prototype=ba.prototype;function lf(t,l,e){this.props=t,this.context=l,this.refs=fr,this.updater=e||ir}var ef=lf.prototype=new sr;ef.constructor=lf;cr(ef,ba.prototype);ef.isPureReactComponent=!0;var fs=Array.isArray;function tc(){}var k={H:null,A:null,T:null,S:null},or=Object.prototype.hasOwnProperty;function af(t,l,e){var a=e.ref;return{$$typeof:tf,type:t,key:l,ref:a!==void 0?a:null,props:e}}function Ym(t,l){return af(t.type,l,t.props)}function nf(t){return typeof t=="object"&&t!==null&&t.$$typeof===tf}function Lm(t){var l={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(e){return l[e]})}var ss=/\/+/g;function mi(t,l){return typeof t=="object"&&t!==null&&t.key!=null?Lm(""+t.key):l.toString(36)}function Xm(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(tc,tc):(t.status="pending",t.then(function(l){t.status==="pending"&&(t.status="fulfilled",t.value=l)},function(l){t.status==="pending"&&(t.status="rejected",t.reason=l)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function Le(t,l,e,a,n){var u=typeof t;(u==="undefined"||u==="boolean")&&(t=null);var i=!1;if(t===null)i=!0;else switch(u){case"bigint":case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case tf:case Rm:i=!0;break;case ur:return i=t._init,Le(i(t._payload),l,e,a,n)}}if(i)return n=n(t),i=a===""?"."+mi(t,0):a,fs(n)?(e="",i!=null&&(e=i.replace(ss,"$&/")+"/"),Le(n,l,e,"",function(s){return s})):n!=null&&(nf(n)&&(n=Ym(n,e+(n.key==null||t&&t.key===n.key?"":(""+n.key).replace(ss,"$&/")+"/")+i)),l.push(n)),1;i=0;var c=a===""?".":a+":";if(fs(t))for(var f=0;f<t.length;f++)a=t[f],u=c+mi(a,f),i+=Le(a,l,e,u,n);else if(f=jm(t),typeof f=="function")for(t=f.call(t),f=0;!(a=t.next()).done;)a=a.value,u=c+mi(a,f++),i+=Le(a,l,e,u,n);else if(u==="object"){if(typeof t.then=="function")return Le(Xm(t),l,e,a,n);throw l=String(t),Error("Objects are not valid as a React child (found: "+(l==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":l)+"). If you meant to render a collection of children, use an array instead.")}return i}function Hn(t,l,e){if(t==null)return t;var a=[],n=0;return Le(t,a,"","",function(u){return l.call(e,u,n++)}),a}function Gm(t){if(t._status===-1){var l=t._result;l=l(),l.then(function(e){(t._status===0||t._status===-1)&&(t._status=1,t._result=e)},function(e){(t._status===0||t._status===-1)&&(t._status=2,t._result=e)}),t._status===-1&&(t._status=0,t._result=l)}if(t._status===1)return t._result.default;throw t._result}var os=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Qm={map:Hn,forEach:function(t,l,e){Hn(t,function(){l.apply(this,arguments)},e)},count:function(t){var l=0;return Hn(t,function(){l++}),l},toArray:function(t){return Hn(t,function(l){return l})||[]},only:function(t){if(!nf(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};C.Activity=qm;C.Children=Qm;C.Component=ba;C.Fragment=Dm;C.Profiler=Mm;C.PureComponent=lf;C.StrictMode=Um;C.Suspense=Bm;C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k;C.__COMPILER_RUNTIME={__proto__:null,c:function(t){return k.H.useMemoCache(t)}};C.cache=function(t){return function(){return t.apply(null,arguments)}};C.cacheSignal=function(){return null};C.cloneElement=function(t,l,e){if(t==null)throw Error("The argument must be a React element, but you Line truncated
* @license React
* react-dom.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Zm=Tl;function dr(t){var l="https://react.dev/errors/"+t;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var e=2;e<arguments.length;e++)l+="&args[]="+encodeURIComponent(arguments[e])}return"Minified React error #"+t+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Yl(){}var Ot={d:{f:Yl,r:function(){throw Error(dr(522))},D:Yl,C:Yl,L:Yl,m:Yl,X:Yl,S:Yl,M:Yl},p:0,findDOMNode:null},Vm=Symbol.for("react.portal");function wm(t,l,e){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Vm,key:a==null?null:""+a,children:t,containerInfo:l,implementation:e}}var Ga=Zm.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Ku(t,l){if(t==="font")return"";if(typeof l=="string")return l==="use-credentials"?l:""}zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ot;zt.createPortal=function(t,l){var e=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)throw Error(dr(299));return wm(t,l,null,e)};zt.flushSync=function(t){var l=Ga.T,e=Ot.p;try{if(Ga.T=null,Ot.p=2,t)return t()}finally{Ga.T=l,Ot.p=e,Ot.d.f()}};zt.preconnect=function(t,l){typeof t=="string"&&(l?(l=l.crossOrigin,l=typeof l=="string"?l==="use-credentials"?l:"":void 0):l=null,Ot.d.C(t,l))};zt.prefetchDNS=function(t){typeof t=="string"&&Ot.d.D(t)};zt.preinit=function(t,l){if(typeof t=="string"&&l&&typeof l.as=="string"){var e=l.as,a=Ku(e,l.crossOrigin),n=typeof l.integrity=="string"?l.integrity:void 0,u=typeof l.fetchPriority=="string"?l.fetchPriority:void 0;e==="style"?Ot.d.S(t,typeof l.precedence=="string"?l.precedence:void 0,{crossOrigin:a,integrity:n,fetchPriority:u}):e==="script"&&Ot.d.X(t,{crossOrigin:a,integrity:n,fetchPriority:u,nonce:typeof l.nonce=="string"?l.nonce:void 0})}};zt.preinitModule=function(t,l){if(typeof t=="string")if(typeof l=="object"&&l!==null){if(l.as==null||l.as==="script"){var e=Ku(l.as,l.crossOrigin);Ot.d.M(t,{crossOrigin:e,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0})}}else l==null&&Ot.d.M(t)};zt.preload=function(t,l){if(typeof t=="string"&&typeof l=="object"&&l!==null&&typeof l.as=="string"){var e=l.as,a=Ku(e,l.crossOrigin);Ot.d.L(t,e,{crossOrigin:a,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0,type:typeof l.type=="string"?l.type:void 0,fetchPriority:typeof l.fetchPriority=="string"?l.fetchPriority:void 0,referrerPolicy:typeof l.referrerPolicy=="string"?l.referrerPolicy:void 0,imageSrcSet:typeof l.imageSrcSet=="string"?l.imageSrcSet:void 0,imageSizes:typeof l.imageSizes=="string"?l.imageSizes:void 0,media:typeof l.media=="string"?l.media:void 0})}};zt.preloadModule=function(t,l){if(typeof t=="string")if(l){var e=Ku(l.as,l.crossOrigin);Ot.d.m(t,{as:typeof l.as=="string"&&l.as!=="script"?l.as:void 0,crossOrigin:e,integrity:typeof l.integrity=="string"?l.integrity:void 0})}else Ot.d.m(t)};zt.requestFormReset=function(t){Ot.d.r(t)};zt.unstable_batchedUpdates=function(t,l){return t(l)};zt.useFormState=function(t,l,e){return Ga.H.useFormState(t,l,e)};zt.useFormStatus=function(){return Ga.H.useHostTransitionStatus()};zt.version="19.2.3";function hr(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hr)}catch(t){console.error(t)}}hr(),rr.exports=zt;var Km=rr.exports;/**
* @license React
* react-dom-client.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var dt=_m,mr=Tl,Jm=Km;function E(t){var l="https://react.dev/errors/"+t;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var e=2;e<arguments.length;e++)l+="&args[]="+encodeURIComponent(arguments[e])}return"Minified React error #"+t+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function yr(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function vn(t){var l=t,e=t;if(t.alternate)for(;l.return;)l=l.return;else{t=l;do l=t,l.flags&4098&&(e=l.return),t=l.return;while(t)}return l.tag===3?e:null}function vr(t){if(t.tag===13){var l=t.memoizedState;if(l===null&&(t=t.alternate,t!==null&&(l=t.memoizedState)),l!==null)return l.dehydrated}return null}function Sr(t){if(t.tag===31){var l=t.memoizedState;if(l===null&&(t=t.alternate,t!==null&&(l=t.memoizedState)),l!==null)return l.dehydrated}return null}function rs(t){if(vn(t)!==t)throw Error(E(188))}function Fm(t){var l=t.alternate;if(!l){if(l=vn(t),l===null)throw Error(E(188));return l!==t?null:t}for(var e=t,a=l;;){var n=e.return;if(n===null)break;var u=n.alternate;if(u===null){if(a=n.return,a!==null){e=a;continue}break}if(n.child===u.child){for(u=n.child;u;){if(u===e)return rs(n),t;if(u===a)return rs(n),l;u=u.sibling}throw Error(E(188))}if(e.return!==a.return)e=n,a=u;else{for(var i=!1,c=n.child;c;){if(c===e){i=!0,e=n,a=u;break}if(c===a){i=!0,a=n,e=u;break}c=c.sibling}if(!i){for(c=u.child;c;){if(c===e){i=!0,e=u,a=n;break}if(c===a){i=!0,a=u,e=n;break}c=c.sibling}if(!i)throw Error(E(189))}}if(e.alternate!==a)throw Error(E(190))}if(e.tag!==3)throw Error(E(188));return e.stateNode.current===e?t:l}function gr(t){var l=t.tag;if(l===5||l===26||l===27||l===6)return t;for(t=t.child;t!==null;){if(l=gr(t),l!==null)return l;t=t.sibling}return null}var I=Object.assign,$m=Symbol.for("react.element"),Bn=Symbol.for("react.transitional.element"),qa=Symbol.for("react.portal"),Qe=Symbol.for("react.fragment"),br=Symbol.for("react.strict_mode"),lc=Symbol.for("react.profiler"),pr=Symbol.for("react.consumer"),zl=Symbol.for("react.context"),uf=Symbol.for("react.forward_ref"),ec=Symbol.for("react.suspense"),ac=Symbol.for("react.suspense_list"),cf=Symbol.for("react.memo"),Ll=Symbol.for("react.lazy"),nc=Symbol.for("react.activity"),Wm=Symbol.for("react.memo_cache_sentinel"),ds=Symbol.iterator;function Da(t){return t===null||typeof t!="object"?null:(t=ds&&t[ds]||t["@@iterator"],typeof t=="function"?t:null)}var km=Symbol.for("react.client.reference");function uc(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===km?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Qe:return"Fragment";case lc:return"Profiler";case br:return"StrictMode";case ec:return"Suspense";case ac:return"SuspenseList";case nc:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case qa:return"Portal";case zl:return t.displayName||"Context";case pr:return(t._context.displayName||"Context")+".Consumer";case uf:var l=t.render;return t=t.displayName,t||(t=l.displayName||l.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case cf:return l=t.displayName||null,l!==null?l:uc(t.type)||"Memo";case Ll:l=t._payload,t=t._init;try{return uc(t(l))}catch{}}return null}var ja=Array.isArray,D=mr.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=Jm.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,be={pending:!1,data:null,method:null,action:null},ic=[],Ze=-1;function ml(t){return{current:t}}function yt(t){0>Ze||(t.current=ic[Ze],ic[Ze]=null,Ze--)}function F(t,l){Ze++,ic[Ze]=t.current,t.current=l}var hl=ml(null),ln=ml(null),Wl=ml(null),mu=ml(null);function yu(t,l){switch(F(Wl,l),F(ln,t),F(hl,null),l.nodeType){case 9:case 11:t=(t=l.documentElement)&&(t=t.namespaceURI)?bo(t):0;break;default:if(t=l.tagName,l=l.namespaceURI)l=bo(l),t=Xh(l,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}yt(hl),F(hl,t)}function ca(){yt(hl),yt(ln),yt(Wl)}function cc(t){t.memoizedState!==null&&F(mu,t);var l=hl.current,e=Xh(l,t.type);l!==e&&(F(ln,t),F(hl,e))}function vu(t){ln.current===t&&(yt(hl),yt(ln)),mu.current===t&&(yt(mu),hn._currentValue=be)}var yi,hs;function me(t){if(yi===void 0)try{throw Error()}catch(e){var l=e.stack.trim().match(/\n( *(at )?)/);yi=l&&l[1]||"",hs=-1<e.stack.indexOf(`
at`)?" (<anonymous>)":-1<e.stack.indexOf("@")?"@unknown:0:0":""}return`
`+yi+t+hs}var vi=!1;function Si(t,l){if(!t||vi)return"";vi=!0;var e=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(l){var m=function(){throw Error()};if(Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(v){var h=v}Reflect.construct(t,[],m)}else{try{m.call()}catch(v){h=v}t.call(m.prototype)}}else{try{throw Error()}catch(v){h=v}(m=t())&&typeof m.catch=="function"&&m.catch(function(){})}}catch(v){if(v&&h&&typeof v.stack=="string")return[v.stack,h.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=a.DetermineComponentFrameRoot(),i=u[0],c=u[1];if(i&&c){var f=i.split(`
`),s=c.split(`
`);for(n=a=0;a<f.length&&!f[a].includes("DetermineComponentFrameRoot");)a++;for(;n<s.length&&!s[n].includes("DetermineComponentFrameRoot");)n++;if(a===f.length||n===s.length)for(a=f.length-1,n=s.length-1;1<=a&&0<=n&&f[a]!==s[n];)n--;for(;1<=a&&0<=n;a--,n--)if(f[a]!==s[n]){if(a!==1||n!==1)do if(a--,n--,0>n||f[a]!==s[n]){var r=`
`+f[a].replace(" at new "," at ");return t.displayName&&r.includes("<anonymous>")&&(r=r.replace("<anonymous>",t.displayName)),r}while(1<=a&&0<=n);break}}}finally{vi=!1,Error.prepareStackTrace=e}return(e=t?t.displayName||t.name:"")?me(e):""}function Im(t,l){switch(t.tag){case 26:case 27:case 5:return me(t.type);case 16:return me("Lazy");case 13:return t.child!==l&&l!==null?me("Suspense Fallback"):me("Suspense");case 19:return me("SuspenseList");case 0:case 15:return Si(t.type,!1);case 11:return Si(t.type.render,!1);case 1:return Si(t.type,!0);case 31:return me("Activity");default:return""}}function ms(t){try{var l="",e=null;do l+=Im(t,e),e=t,t=t.return;while(t);return l}catch(a){return`
Error generating stack: `+a.message+`
`+a.stack}}var fc=Object.prototype.hasOwnProperty,ff=dt.unstable_scheduleCallback,gi=dt.unstable_cancelCallback,Pm=dt.unstable_shouldYield,ty=dt.unstable_requestPaint,Gt=dt.unstable_now,ly=dt.unstable_getCurrentPriorityLevel,Er=dt.unstable_ImmediatePriority,Tr=dt.unstable_UserBlockingPriority,Su=dt.unstable_NormalPriority,ey=dt.unstable_LowPriority,Ar=dt.unstable_IdlePriority,ay=dt.log,ny=dt.unstable_setDisableYieldValue,Sn=null,Qt=null;function wl(t){if(typeof ay=="function"&&ny(t),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(Sn,t)}catch{}}var Zt=Math.clz32?Math.clz32:cy,uy=Math.log,iy=Math.LN2;function cy(t){return t>>>=0,t===0?32:31-(uy(t)/iy|0)|0}var xn=256,qn=262144,jn=4194304;function ye(t){var l=t&42;if(l!==0)return l;switch(t&-t){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ju(t,l,e){var a=t.pendingLanes;if(a===0)return 0;var n=0,u=t.suspendedLanes,i=t.pingedLanes;t=t.warmLanes;var c=a&134217727;return c!==0?(a=c&~u,a!==0?n=ye(a):(i&=c,i!==0?n=ye(i):e||(e=c&~t,e!==0&&(n=ye(e))))):(c=a&~u,c!==0?n=ye(c):i!==0?n=ye(i):e||(e=a&~t,e!==0&&(n=ye(e)))),n===0?0:l!==0&&l!==n&&!(l&u)&&(u=n&-n,e=l&-l,u>=e||u===32&&(e&4194048)!==0)?l:n}function gn(t,l){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&l)===0}function fy(t,l){switch(t){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32: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 l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Or(){var t=jn;return jn<<=1,!(jn&62914560)&&(jn=4194304),t}function bi(t){for(var l=[],e=0;31>e;e++)l.push(t);return l}function bn(t,l){t.pendingLanes|=l,l!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function sy(t,l,e,a,n,u){var i=t.pendingLanes;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=e,t.entangledLanes&=e,t.errorRecoveryDisabledLanes&=e,t.shellSuspendCounter=0;var c=t.entanglements,f=t.expirationTimes,s=t.hiddenUpdates;for(e=i&~e;0<e;){var r=31-Zt(e),m=1<<r;c[r]=0,f[r]=-1;var h=s[r];if(h!==null)for(s[r]=null,r=0;r<h.length;r++){var v=h[r];v!==null&&(v.lane&=-536870913)}e&=~m}a!==0&&zr(t,a,0),u!==0&&n===0&&t.tag!==0&&(t.suspendedLanes|=u&~(i&~l))}function zr(t,l,e){t.pendingLanes|=l,t.suspendedLanes&=~l;var a=31-Zt(l);t.entangledLanes|=l,t.entanglements[a]=t.entanglements[a]|1073741824|e&261930}function _r(t,l){var e=t.entangledLanes|=l;for(t=t.entanglements;e;){var a=31-Zt(e),n=1<<a;n&l|t[a]&l&&(t[a]|=l),e&=~n}}function Rr(t,l){var e=l&-l;return e=e&42?1:sf(e),e&(t.suspendedLanes|l)?0:e}function sf(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function of(t){return t&=-t,2<t?8<t?t&134217727?32:268435456:8:2}function Dr(){var t=Q.p;return t!==0?t:(t=window.event,t===void 0?32:kh(t.type))}function ys(t,l){var e=Q.p;try{return Q.p=t,l()}finally{Q.p=e}}var se=Math.random().toString(36).slice(2),St="__reactFiber$"+se,Ht="__reactProps$"+se,pa="__reactContainer$"+se,sc="__reactEvents$"+se,oy="__reactListeners$"+se,ry="__reactHandles$"+se,vs="__reactResources$"+se,pn="__reactMarker$"+se;function rf(t){delete t[St],delete t[Ht],delete t[sc],delete t[oy],delete t[ry]}function Ve(t){var l=t[St];if(l)return l;for(var e=t.parentNode;e;){if(l=e[pa]||e[St]){if(e=l.alternate,l.child!==null||e!==null&&e.child!==null)for(t=Oo(t);t!==null;){if(e=t[St])return e;t=Oo(t)}return l}t=e,e=t.parentNode}return null}function Ea(t){if(t=t[St]||t[pa]){var l=t.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return t}return null}function Ya(t){var l=t.tag;if(l===5||l===26||l===27||l===6)return t.stateNode;throw Error(E(33))}function ta(t){var l=t[vs];return l||(l=t[vs]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function mt(t){t[pn]=!0}var Ur=new Set,Mr={};function Ne(t,l){fa(t,l),fa(t+"Capture",l)}function fa(t,l){for(Mr[t]=l,t=0;t<l.length;t++)Ur.add(l[t])}var dy=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\ Line truncated
`).replace(Z0,"")}function Lh(t,l){return l=So(l),So(t)===l}function w(t,l,e,a,n,u){switch(e){case"children":typeof a=="string"?l==="body"||l==="textarea"&&a===""||sa(t,a):(typeof a=="number"||typeof a=="bigint")&&l!=="body"&&sa(t,""+a);break;case"className":Yn(t,"class",a);break;case"tabIndex":Yn(t,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Yn(t,e,a);break;case"style":qr(t,a,u);break;case"data":if(l!=="object"){Yn(t,"data",a);break}case"src":case"href":if(a===""&&(l!=="a"||e!=="href")){t.removeAttribute(e);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(e);break}a=kn(""+a),t.setAttribute(e,a);break;case"action":case"formAction":if(typeof a=="function"){t.setAttribute(e,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(e==="formAction"?(l!=="input"&&w(t,l,"name",n.name,n,null),w(t,l,"formEncType",n.formEncType,n,null),w(t,l,"formMethod",n.formMethod,n,null),w(t,l,"formTarget",n.formTarget,n,null)):(w(t,l,"encType",n.encType,n,null),w(t,l,"method",n.method,n,null),w(t,l,"target",n.target,n,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(e);break}a=kn(""+a),t.setAttribute(e,a);break;case"onClick":a!=null&&(t.onclick=_l);break;case"onScroll":a!=null&&q("scroll",t);break;case"onScrollEnd":a!=null&&q("scrollend",t);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(E(61));if(e=a.__html,e!=null){if(n.children!=null)throw Error(E(60));t.innerHTML=e}}break;case"multiple":t.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":t.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){t.removeAttribute("xlink:href");break}e=kn(""+a),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(e,""+a):t.removeAttribute(e);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(e,""):t.removeAttribute(e);break;case"capture":case"download":a===!0?t.setAttribute(e,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(e,a):t.removeAttribute(e);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?t.setAttribute(e,a):t.removeAttribute(e);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?t.removeAttribute(e):t.setAttribute(e,a);break;case"popover":q("beforetoggle",t),q("toggle",t),Wn(t,"popover",a);break;case"xlinkActuate":Sl(t,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Sl(t,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Sl(t,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Sl(t,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Sl(t,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Sl(t,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Sl(t,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Sl(t,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Sl(t,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Wn(t,"is",a);break;case"innerText":case"textContent":break;default:(!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(e=Sy.get(e)||e,Wn(t,e,a))}}function Xc(t,l,e,a,n,u){switch(e){case"style":qr(t,a,u);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(E(61));if(e=a.__html,e!=null){if(n.children!=null)throw Error(E(60));t.innerHTML=e}}break;case"children":typeof a=="string"?sa(t,a):(typeof a=="number"||typeof a=="bigint")&&sa(t,""+a);break;case"onScroll":a!=null&&q("scroll",t);break;case"onScrollEnd":a!=null&&q("scrollend",t);break;case"onClick":a!=null&&(t.onclick=_l);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"re Line truncated
`).forEach(function(i){n=i.indexOf(":"),e=i.substring(0,n).trim().toLowerCase(),a=i.substring(n+1).trim(),!(!e||l[e]&&D1[e])&&(e==="set-cookie"?l[e]?l[e].push(a):l[e]=[a]:l[e]=l[e]?l[e]+", "+a:a)}),l},Xo=Symbol("internals");function xa(t){return t&&String(t).trim().toLowerCase()}function du(t){return t===!1||t==null?t:g.isArray(t)?t.map(du):String(t)}function M1(t){const l=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let a;for(;a=e.exec(t);)l[a[1]]=a[2];return l}const N1=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ki(t,l,e,a,n){if(g.isFunction(a))return a.call(this,l,e);if(n&&(l=e),!!g.isString(l)){if(g.isString(a))return l.indexOf(a)!==-1;if(g.isRegExp(a))return a.test(l)}}function C1(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(l,e,a)=>e.toUpperCase()+a)}function H1(t,l){const e=g.toCamelCase(" "+l);["get","set","has"].forEach(a=>{Object.defineProperty(t,a+e,{value:function(n,u,i){return this[a].call(this,l,n,u,i)},configurable:!0})})}let Ct=class{constructor(l){l&&this.set(l)}set(l,e,a){const n=this;function u(c,f,s){const r=xa(f);if(!r)throw new Error("header name must be a non-empty string");const m=g.findKey(n,r);(!m||n[m]===void 0||s===!0||s===void 0&&n[m]!==!1)&&(n[m||f]=du(c))}const i=(c,f)=>g.forEach(c,(s,r)=>u(s,r,f));if(g.isPlainObject(l)||l instanceof this.constructor)i(l,e);else if(g.isString(l)&&(l=l.trim())&&!N1(l))i(U1(l),e);else if(g.isObject(l)&&g.isIterable(l)){let c={},f,s;for(const r of l){if(!g.isArray(r))throw TypeError("Object iterator must return a key-value pair");c[s=r[0]]=(f=c[s])?g.isArray(f)?[...f,r[1]]:[f,r[1]]:r[1]}i(c,e)}else l!=null&&u(e,l,a);return this}get(l,e){if(l=xa(l),l){const a=g.findKey(this,l);if(a){const n=this[a];if(!e)return n;if(e===!0)return M1(n);if(g.isFunction(e))return e.call(this,n,a);if(g.isRegExp(e))return e.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(l,e){if(l=xa(l),l){const a=g.findKey(this,l);return!!(a&&this[a]!==void 0&&(!e||ki(this,this[a],a,e)))}return!1}delete(l,e){const a=this;let n=!1;function u(i){if(i=xa(i),i){const c=g.findKey(a,i);c&&(!e||ki(a,a[c],c,e))&&(delete a[c],n=!0)}}return g.isArray(l)?l.forEach(u):u(l),n}clear(l){const e=Object.keys(this);let a=e.length,n=!1;for(;a--;){const u=e[a];(!l||ki(this,this[u],u,l,!0))&&(delete this[u],n=!0)}return n}normalize(l){const e=this,a={};return g.forEach(this,(n,u)=>{const i=g.findKey(a,u);if(i){e[i]=du(n),delete e[u];return}const c=l?C1(u):String(u).trim();c!==u&&delete e[u],e[c]=du(n),a[c]=!0}),this}concat(...l){return this.constructor.concat(this,...l)}toJSON(l){const e=Object.create(null);return g.forEach(this,(a,n)=>{a!=null&&a!==!1&&(e[n]=l&&g.isArray(a)?a.join(", "):a)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([l,e])=>l+": "+e).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(l){return l instanceof this?l:new this(l)}static concat(l,...e){const a=new this(l);return e.forEach(n=>a.set(n)),a}static accessor(l){const a=(this[Xo]=this[Xo]={accessors:{}}).accessors,n=this.prototype;function u(i){const c=xa(i);a[c]||(H1(n,i),a[c]=!0)}return g.isArray(l)?l.forEach(u):u(l),this}};Ct.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);g.reduceDescriptors(Ct.prototype,({value:t},l)=>{let e=l[0].toUpperCase()+l.slice(1);return{get:()=>t,set(a){this[e]=a}}});g.freezeMethods(Ct);function Ii(t,l){const e=this||Nn,a=l||e,n=Ct.from(a.headers);let u=a.data;return g.forEach(t,function(c){u=c.call(e,u,n.normalize(),l?l.status:void 0)}),n.normalize(),u}function ym(t){return!!(t&&t.__CANCEL__)}let Cn=class extends R{constructor(l,e,a){super(l??"canceled",R.ERR_CANCELED,e,a),this.name="CanceledError",this.__CANCEL__=!0}};function vm(t,l,e){const a=e.config.validateStatus;!e.status||!a||a(e.status)?t(e):l(new R("Request failed with status code "+e.status,[R.ERR_BAD_REQUEST,R.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function B1(t){const l=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return l&&l[1]||""}function x1(t,l){t=t||10;const e=new Array(t),a=new Array(t);let n=0,u=0,i;return l=l!==void 0?l:1e3,function(f){const s=Date.now(),r=a[u];i||(i=s),e[n]=f,a[n]=s;let m=u,h=0;for(;m!==n;)h+=e[m++],m=m%t;if(n=(n+1)%t,n===u&&(u=(u+1)%t),s-i<l)return;const v=r&&s-r;return v?Math.round(h*1e3/v):void 0}}function q1(t,l){let e=0,a=1e3/l,n,u;const i=(s,r=Date.now())=>{e=r,n=null,u&&(clearTimeout(u),u=null),t(...s)};return[(...s)=>{const r=Date.now(),m=r-e;m>=a?i(s,r):(n=s,u||(u=setTimeout(()=>{u=null,i(n)},a-m)))},()=>n&&i(n)]}const Zu=(t,l,e=3)=>{let a=0;const n=x1(50,250);return q1(u=>{const i=u.loaded,c=u.lengthComputable?u.total:void 0,f=i-a,s=n(f),r=i<=c;a=i;const m={loaded:i,total:c,progress:c?i/c:void 0,bytes:f,rate:s||void 0,estimated:s&&c&&r?(c-i)/s:void 0,event:u,lengthComputable:c!=null,[l?"download":"upload"]:!0};t(m)},e)},Go=(t,l)=>{const e=t!=null;return[a=>l[0]({lengthComputable:e,total:t,loaded:a}),l[1]]},Qo=t=>(...l)=>g.asap(()=>t(...l)),j1=Et.hasStandardBrowserEnv?((t,l)=>e=>(e=new URL(e,Et.origin),t.protocol===e.protocol&&t.host===e.host&&(l||t.port===e.port)))(new URL(Et.origin),Et.navigator&&/(msie|trident)/i.test(Et.navigator.userAgent)):()=>!0,Y1=Et.hasStandardBrowserEnv?{write(t,l,e,a,n,u,i){if(typeof document>"u")return;const c=[`${t}=${encodeURIComponent(l)}`];g.isNumber(e)&&c.push(`expires=${new Date(e).toUTCString()}`),g.isString(a)&&c.push(`path=${a}`),g.isString(n)&&c.push(`domain=${n}`),u===!0&&c.push("secure"),g.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(t){if(typeof document>"u")return null;const l=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return l?decodeURIComponent(l[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function L1(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function X1(t,l){return l?t.replace(/\/?\/$/,"")+"/"+l.replace(/^\/+/,""):t}function Sm(t,l,e){let a=!L1(l);return t&&(a||e==!1)?X1(t,l):l}const Zo=t=>t instanceof Ct?{...t}:t;function Me(t,l){l=l||{};const e={};function a(s,r,m,h){return g.isPlainObject(s)&&g.isPlainObject(r)?g.merge.call({caseless:h},s,r):g.isPlainObject(r)?g.merge({},r):g.isArray(r)?r.slice():r}function n(s,r,m,h){if(g.isUndefined(r)){if(!g.isUndefined(s))return a(void 0,s,m,h)}else return a(s,r,m,h)}function u(s,r){if(!g.isUndefined(r))return a(void 0,r)}function i(s,r){if(g.isUndefined(r)){if(!g.isUndefined(s))return a(void 0,s)}else return a(void 0,r)}function c(s,r,m){if(m in l)return a(s,r);if(m in t)return a(void 0,s)}const f={url:u,method:u,data:u,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(s,r,m)=>n(Zo(s),Zo(r),m,!0)};return g.forEach(Object.keys({...t,...l}),function(r){const m=f[r]||n,h=m(t[r],l[r],r);g.isUndefined(h)&&m!==c||(e[r]=h)}),e}const gm=t=>{const l=Me({},t);let{data:e,withXSRFToken:a,xsrfHeaderName:n,xsrfCookieName:u,headers:i,auth:c}=l;if(l.headers=i=Ct.from(i),l.url=dm(Sm(l.baseURL,l.url,l.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),g.isFormData(e)){if(Et.hasStandardBrowserEnv||Et.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(g.isFunction(e.getHeaders)){const f=e.getHeaders(),s=["content-type","content-length"];Object.entries(f).forEach(([r,m])=>{s.includ Line truncated
`+i.map($o).join(`
`):" "+$o(i[0]):"as no adapter specified";throw new R("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return n}const pm={getAdapter:k1,adapters:us};function Pi(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Cn(null,t)}function Wo(t){return Pi(t),t.headers=Ct.from(t.headers),t.data=Ii.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),pm.getAdapter(t.adapter||Nn.adapter,t)(t).then(function(a){return Pi(t),a.data=Ii.call(t,t.transformResponse,a),a.headers=Ct.from(a.headers),a},function(a){return ym(a)||(Pi(t),a&&a.response&&(a.response.data=Ii.call(t,t.transformResponse,a.response),a.response.headers=Ct.from(a.response.headers))),Promise.reject(a)})}const Em="1.13.3",hi={};["object","boolean","number","function","string","symbol"].forEach((t,l)=>{hi[t]=function(a){return typeof a===t||"a"+(l<1?"n ":" ")+t}});const ko={};hi.transitional=function(l,e,a){function n(u,i){return"[Axios v"+Em+"] Transitional option '"+u+"'"+i+(a?". "+a:"")}return(u,i,c)=>{if(l===!1)throw new R(n(i," has been removed"+(e?" in "+e:"")),R.ERR_DEPRECATED);return e&&!ko[i]&&(ko[i]=!0,console.warn(n(i," has been deprecated since v"+e+" and will be removed in the near future"))),l?l(u,i,c):!0}};hi.spelling=function(l){return(e,a)=>(console.warn(`${a} is likely a misspelling of ${l}`),!0)};function I1(t,l,e){if(typeof t!="object")throw new R("options must be an object",R.ERR_BAD_OPTION_VALUE);const a=Object.keys(t);let n=a.length;for(;n-- >0;){const u=a[n],i=l[u];if(i){const c=t[u],f=c===void 0||i(c,u,t);if(f!==!0)throw new R("option "+u+" must be "+f,R.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new R("Unknown option "+u,R.ERR_BAD_OPTION)}}const hu={assertOptions:I1,validators:hi},sl=hu.validators;let Oe=class{constructor(l){this.defaults=l||{},this.interceptors={request:new Lo,response:new Lo}}async request(l,e){try{return await this._request(l,e)}catch(a){if(a instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const u=n.stack?n.stack.replace(/^.+\n/,""):"";try{a.stack?u&&!String(a.stack).endsWith(u.replace(/^.+\n.+\n/,""))&&(a.stack+=`
`+u):a.stack=u}catch{}}throw a}}_request(l,e){typeof l=="string"?(e=e||{},e.url=l):e=l||{},e=Me(this.defaults,e);const{transitional:a,paramsSerializer:n,headers:u}=e;a!==void 0&&hu.assertOptions(a,{silentJSONParsing:sl.transitional(sl.boolean),forcedJSONParsing:sl.transitional(sl.boolean),clarifyTimeoutError:sl.transitional(sl.boolean)},!1),n!=null&&(g.isFunction(n)?e.paramsSerializer={serialize:n}:hu.assertOptions(n,{encode:sl.function,serialize:sl.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),hu.assertOptions(e,{baseUrl:sl.spelling("baseURL"),withXsrfToken:sl.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=u&&g.merge(u.common,u[e.method]);u&&g.forEach(["delete","get","head","post","put","patch","common"],S=>{delete u[S]}),e.headers=Ct.concat(i,u);const c=[];let f=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(e)===!1||(f=f&&p.synchronous,c.unshift(p.fulfilled,p.rejected))});const s=[];this.interceptors.response.forEach(function(p){s.push(p.fulfilled,p.rejected)});let r,m=0,h;if(!f){const S=[Wo.bind(this),void 0];S.unshift(...c),S.push(...s),h=S.length,r=Promise.resolve(e);let p=e;for(;m<h;)r=r.then(S[m++]).then(T=>{p=T!==void 0?T:p}).catch(S[m++]).then(()=>p);return r}h=c.length;let v=e;for(;m<h;){const S=c[m++],p=c[m++];try{v=S(v)}catch(T){p.call(this,T);break}}try{r=Wo.call(this,v)}catch(S){return Promise.reject(S)}for(m=0,h=s.length;m<h;)r=r.then(s[m++]).catch(s[m++]);return r}getUri(l){l=Me(this.defaults,l);const e=Sm(l.baseURL,l.url,l.allowAbsoluteUrls);return dm(e,l.params,l.paramsSerializer)}};g.forEach(["delete","get","head","options"],function(l){Oe.prototype[l]=function(e,a){return this.request(Me(a||{},{method:l,url:e,data:(a||{}).data}))}});g.forEach(["post","put","patch"],function(l){function e(a){return function(u,i,c){return this.request(Me(c||{},{method:l,headers:a?{"Content-Type":"multipart/form-data"}:{},url:u,data:i}))}}Oe.prototype[l]=e(),Oe.prototype[l+"Form"]=e(!0)});let P1=class Tm{constructor(l){if(typeof l!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(u){e=u});const a=this;this.promise.then(n=>{if(!a._listeners)return;let u=a._listeners.length;for(;u-- >0;)a._listeners[u](n);a._listeners=null}),this.promise.then=n=>{let u;const i=new Promise(c=>{a.subscribe(c),u=c}).then(n);return i.cancel=function(){a.unsubscribe(u)},i},l(function(u,i,c){a.reason||(a.reason=new Cn(u,i,c),e(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(l){if(this.reason){l(this.reason);return}this._listeners?this._listeners.push(l):this._listeners=[l]}unsubscribe(l){if(!this._listeners)return;const e=this._listeners.indexOf(l);e!==-1&&this._listeners.splice(e,1)}toAbortSignal(){const l=new AbortController,e=a=>{l.abort(a)};return this.subscribe(e),l.signal.unsubscribe=()=>this.unsubscribe(e),l.signal}static source(){let l;return{token:new Tm(function(n){l=n}),cancel:l}}};function tS(t){return function(e){return t.apply(null,e)}}function lS(t){return g.isObject(t)&&t.isAxiosError===!0}const Pc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Pc).forEach(([t,l])=>{Pc[l]=t});function Am(t){const l=new Oe(t),e=lm(Oe.prototype.request,l);return g.extend(e,Oe.prototype,l,{allOwnKeys:!0}),g.extend(e,l,null,{allOwnKeys:!0}),e.create=function(n){return Am(Me(t,n))},e}const ut=Am(Nn);ut.Axios=Oe;ut.CanceledError=Cn;ut.CancelToken=P1;ut.isCancel=ym;ut.VERSION=Em;ut.toFormData=di;ut.AxiosError=R;ut.Cancel=ut.CanceledError;ut.all=function(l){return Promise.all(l Line truncated
+12
View File
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="it">
<head>
<meta charset="utf-8" />
<title>Traduttore Multiformato</title>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<script type="module" crossorigin src="/assets/index-BWRQMese.js"></script>
</head>
<body>
<div id="root"></div>
</body>
</html>
+12
View File
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="it">
<head>
<meta charset="utf-8" />
<title>Traduttore Multiformato</title>
<meta name="viewport" content="width=device-width,initial-scale=1" />
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../acorn/bin/acorn
+1
View File
@@ -0,0 +1 @@
../baseline-browser-mapping/dist/cli.js
+1
View File
@@ -0,0 +1 @@
../browserslist/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../esbuild/bin/esbuild
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../eslint/bin/eslint.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../js-yaml/bin/js-yaml.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../jsesc/bin/jsesc
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../json5/lib/cli.js
+1
View File
@@ -0,0 +1 @@
../loose-envify/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../nanoid/bin/nanoid.cjs
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../which/bin/node-which
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../resolve/bin/resolve
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../rimraf/bin.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../rollup/dist/bin/rollup
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../semver/bin/semver.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../typescript/bin/tsc
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../typescript/bin/tsserver
+1
View File
@@ -0,0 +1 @@
../update-browserslist-db/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../vite/bin/vite.js
+3861
View File
File diff suppressed because it is too large. Load diff
+22
View File
@@ -0,0 +1,22 @@
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+19
View File
@@ -0,0 +1,19 @@
# @babel/compat-data
> The compat-data to determine required Babel plugins
See our website [@babel/compat-data](https://babeljs.io/docs/babel-compat-data) for more information.
## Install
Using npm:
```sh
npm install --save @babel/compat-data
```
or using yarn:
```sh
yarn add @babel/compat-data
```
+2
View File
@@ -0,0 +1,2 @@
// Todo (Babel 8): remove this file as Babel 8 drop support of core-js 2
module.exports = require("./data/corejs2-built-ins.json");
@@ -0,0 +1,2 @@
// Todo (Babel 8): remove this file now that it is included in babel-plugin-polyfill-corejs3
module.exports = require("./data/corejs3-shipped-proposals.json");
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,5 @@
[
"esnext.promise.all-settled",
"esnext.string.match-all",
"esnext.global-this"
]
+18
View File
@@ -0,0 +1,18 @@
{
"es6.module": {
"chrome": "61",
"and_chr": "61",
"edge": "16",
"firefox": "60",
"and_ff": "60",
"node": "13.2.0",
"opera": "48",
"op_mob": "45",
"safari": "10.1",
"ios": "10.3",
"samsung": "8.2",
"android": "61",
"electron": "2.0",
"ios_saf": "10.3"
}
}
+35
View File
@@ -0,0 +1,35 @@
{
"transform-async-to-generator": [
"bugfix/transform-async-arrows-in-class"
],
"transform-parameters": [
"bugfix/transform-edge-default-parameters",
"bugfix/transform-safari-id-destructuring-collision-in-function-expression"
],
"transform-function-name": [
"bugfix/transform-edge-function-name"
],
"transform-block-scoping": [
"bugfix/transform-safari-block-shadowing",
"bugfix/transform-safari-for-shadowing"
],
"transform-template-literals": [
"bugfix/transform-tagged-template-caching"
],
"transform-optional-chaining": [
"bugfix/transform-v8-spread-parameters-in-optional-chaining"
],
"proposal-optional-chaining": [
"bugfix/transform-v8-spread-parameters-in-optional-chaining"
],
"transform-class-properties": [
"bugfix/transform-v8-static-class-fields-redefine-readonly",
"bugfix/transform-firefox-class-in-computed-class-key",
"bugfix/transform-safari-class-field-initializer-scope"
],
"proposal-class-properties": [
"bugfix/transform-v8-static-class-fields-redefine-readonly",
"bugfix/transform-firefox-class-in-computed-class-key",
"bugfix/transform-safari-class-field-initializer-scope"
]
}
+203
View File
@@ -0,0 +1,203 @@
{
"bugfix/transform-async-arrows-in-class": {
"chrome": "55",
"opera": "42",
"edge": "15",
"firefox": "52",
"safari": "11",
"node": "7.6",
"deno": "1",
"ios": "11",
"samsung": "6",
"opera_mobile": "42",
"electron": "1.6"
},
"bugfix/transform-edge-default-parameters": {
"chrome": "49",
"opera": "36",
"edge": "18",
"firefox": "52",
"safari": "10",
"node": "6",
"deno": "1",
"ios": "10",
"samsung": "5",
"opera_mobile": "36",
"electron": "0.37"
},
"bugfix/transform-edge-function-name": {
"chrome": "51",
"opera": "38",
"edge": "79",
"firefox": "53",
"safari": "10",
"node": "6.5",
"deno": "1",
"ios": "10",
"samsung": "5",
"opera_mobile": "41",
"electron": "1.2"
},
"bugfix/transform-safari-block-shadowing": {
"chrome": "49",
"opera": "36",
"edge": "12",
"firefox": "44",
"safari": "11",
"node": "6",
"deno": "1",
"ie": "11",
"ios": "11",
"samsung": "5",
"opera_mobile": "36",
"electron": "0.37"
},
"bugfix/transform-safari-for-shadowing": {
"chrome": "49",
"opera": "36",
"edge": "12",
"firefox": "4",
"safari": "11",
"node": "6",
"deno": "1",
"ie": "11",
"ios": "11",
"samsung": "5",
"rhino": "1.7.13",
"opera_mobile": "36",
"electron": "0.37"
},
"bugfix/transform-safari-id-destructuring-collision-in-function-expression": {
"chrome": "49",
"opera": "36",
"edge": "14",
"firefox": "2",
"safari": "16.3",
"node": "6",
"deno": "1",
"ios": "16.3",
"samsung": "5",
"opera_mobile": "36",
"electron": "0.37"
},
"bugfix/transform-tagged-template-caching": {
"chrome": "41",
"opera": "28",
"edge": "12",
"firefox": "34",
"safari": "13",
"node": "4",
"deno": "1",
"ios": "13",
"samsung": "3.4",
"rhino": "1.7.14",
"opera_mobile": "28",
"electron": "0.21"
},
"bugfix/transform-v8-spread-parameters-in-optional-chaining": {
"chrome": "91",
"opera": "77",
"edge": "91",
"firefox": "74",
"safari": "13.1",
"node": "16.9",
"deno": "1.9",
"ios": "13.4",
"samsung": "16",
"opera_mobile": "64",
"electron": "13.0"
},
"transform-optional-chaining": {
"chrome": "80",
"opera": "67",
"edge": "80",
"firefox": "74",
"safari": "13.1",
"node": "14",
"deno": "1",
"ios": "13.4",
"samsung": "13",
"rhino": "1.8",
"opera_mobile": "57",
"electron": "8.0"
},
"proposal-optional-chaining": {
"chrome": "80",
"opera": "67",
"edge": "80",
"firefox": "74",
"safari": "13.1",
"node": "14",
"deno": "1",
"ios": "13.4",
"samsung": "13",
"rhino": "1.8",
"opera_mobile": "57",
"electron": "8.0"
},
"transform-parameters": {
"chrome": "49",
"opera": "36",
"edge": "15",
"firefox": "52",
"safari": "10",
"node": "6",
"deno": "1",
"ios": "10",
"samsung": "5",
"opera_mobile": "36",
"electron": "0.37"
},
"transform-async-to-generator": {
"chrome": "55",
"opera": "42",
"edge": "15",
"firefox": "52",
"safari": "10.1",
"node": "7.6",
"deno": "1",
"ios": "10.3",
"samsung": "6",
"opera_mobile": "42",
"electron": "1.6"
},
"transform-template-literals": {
"chrome": "41",
"opera": "28",
"edge": "13",
"firefox": "34",
"safari": "9",
"node": "4",
"deno": "1",
"ios": "9",
"samsung": "3.4",
"opera_mobile": "28",
"electron": "0.21"
},
"transform-function-name": {
"chrome": "51",
"opera": "38",
"edge": "14",
"firefox": "53",
"safari": "10",
"node": "6.5",
"deno": "1",
"ios": "10",
"samsung": "5",
"opera_mobile": "41",
"electron": "1.2"
},
"transform-block-scoping": {
"chrome": "50",
"opera": "37",
"edge": "14",
"firefox": "53",
"safari": "10",
"node": "6",
"deno": "1",
"ios": "10",
"samsung": "5",
"opera_mobile": "37",
"electron": "1.1"
}
}
+838
View File
@@ -0,0 +1,838 @@
{
"transform-explicit-resource-management": {
"chrome": "134",
"edge": "134",
"firefox": "141",
"node": "24",
"electron": "35.0"
},
"transform-duplicate-named-capturing-groups-regex": {
"chrome": "126",
"opera": "112",
"edge": "126",
"firefox": "129",
"safari": "17.4",
"node": "23",
"ios": "17.4",
"electron": "31.0"
},
"transform-regexp-modifiers": {
"chrome": "125",
"opera": "111",
"edge": "125",
"firefox": "132",
"node": "23",
"samsung": "27",
"electron": "31.0"
},
"transform-unicode-sets-regex": {
"chrome": "112",
"opera": "98",
"edge": "112",
"firefox": "116",
"safari": "17",
"node": "20",
"deno": "1.32",
"ios": "17",
"samsung": "23",
"opera_mobile": "75",
"electron": "24.0"
},
"bugfix/transform-v8-static-class-fields-redefine-readonly": {
"chrome": "98",
"opera": "84",
"edge": "98",
"firefox": "75",
"safari": "15",
"node": "12",
"deno": "1.18",
"ios": "15",
"samsung": "11",
"opera_mobile": "52",
"electron": "17.0"
},
"bugfix/transform-firefox-class-in-computed-class-key": {
"chrome": "74",
"opera": "62",
"edge": "79",
"firefox": "126",
"safari": "16",
"node": "12",
"deno": "1",
"ios": "16",
"samsung": "11",
"opera_mobile": "53",
"electron": "6.0"
},
"bugfix/transform-safari-class-field-initializer-scope": {
"chrome": "74",
"opera": "62",
"edge": "79",
"firefox": "69",
"safari": "16",
"node": "12",
"deno": "1",
"ios": "16",
"samsung": "11",
"opera_mobile": "53",
"electron": "6.0"
},
"transform-class-static-block": {
"chrome": "94",
"opera": "80",
"edge": "94",
"firefox": "93",
"safari": "16.4",
"node": "16.11",
"deno": "1.14",
"ios": "16.4",
"samsung": "17",
"opera_mobile": "66",
"electron": "15.0"
},
"proposal-class-static-block": {
"chrome": "94",
"opera": "80",
"edge": "94",
"firefox": "93",
"safari": "16.4",
"node": "16.11",
"deno": "1.14",
"ios": "16.4",
"samsung": "17",
"opera_mobile": "66",
"electron": "15.0"
},
"transform-private-property-in-object": {
"chrome": "91",
"opera": "77",
"edge": "91",
"firefox": "90",
"safari": "15",
"node": "16.9",
"deno": "1.9",
"ios": "15",
"samsung": "16",
"opera_mobile": "64",
"electron": "13.0"
},
"proposal-private-property-in-object": {
"chrome": "91",
"opera": "77",
"edge": "91",
"firefox": "90",
"safari": "15",
"node": "16.9",
"deno": "1.9",
"ios": "15",
"samsung": "16",
"opera_mobile": "64",
"electron": "13.0"
},
"transform-class-properties": {
"chrome": "74",
"opera": "62",
"edge": "79",
"firefox": "90",
"safari": "14.1",
"node": "12",
"deno": "1",
"ios": "14.5",
"samsung": "11",
"opera_mobile": "53",
"electron": "6.0"
},
"proposal-class-properties": {
"chrome": "74",
"opera": "62",
"edge": "79",
"firefox": "90",
"safari": "14.1",
"node": "12",
"deno": "1",
"ios": "14.5",
"samsung": "11",
"opera_mobile": "53",
"electron": "6.0"
},
"transform-private-methods": {
"chrome": "84",
"opera": "70",
"edge": "84",
"firefox": "90",
"safari": "15",
"node": "14.6",
"deno": "1",
"ios": "15",
"samsung": "14",
"opera_mobile": "60",
"electron": "10.0"
},
"proposal-private-methods": {
"chrome": "84",
"opera": "70",
"edge": "84",
"firefox": "90",
"safari": "15",
"node": "14.6",
"deno": "1",
"ios": "15",
"samsung": "14",
"opera_mobile": "60",
"electron": "10.0"
},
"transform-numeric-separator": {
"chrome": "75",
"opera": "62",
"edge": "79",
"firefox": "70",
"safari": "13",
"node": "12.5",
"deno": "1",
"ios": "13",
"samsung": "11",
"rhino": "1.7.14",
"opera_mobile": "54",
"electron": "6.0"
},
"proposal-numeric-separator": {
"chrome": "75",
"opera": "62",
"edge": "79",
"firefox": "70",
"safari": "13",
"node": "12.5",
"deno": "1",
"ios": "13",
"samsung": "11",
"rhino": "1.7.14",
"opera_mobile": "54",
"electron": "6.0"
},
"transform-logical-assignment-operators": {
"chrome": "85",
"opera": "71",
"edge": "85",
"firefox": "79",
"safari": "14",
"node": "15",
"deno": "1.2",
"ios": "14",
"samsung": "14",
"opera_mobile": "60",
"electron": "10.0"
},
"proposal-logical-assignment-operators": {
"chrome": "85",
"opera": "71",
"edge": "85",
"firefox": "79",
"safari": "14",
"node": "15",
"deno": "1.2",
"ios": "14",
"samsung": "14",
"opera_mobile": "60",
"electron": "10.0"
},
"transform-nullish-coalescing-operator": {
"chrome": "80",
"opera": "67",
"edge": "80",
"firefox": "72",
"safari": "13.1",
"node": "14",
"deno": "1",
"ios": "13.4",
"samsung": "13",
"rhino": "1.8",
"opera_mobile": "57",
"electron": "8.0"
},
"proposal-nullish-coalescing-operator": {
"chrome": "80",
"opera": "67",
"edge": "80",
"firefox": "72",
"safari": "13.1",
"node": "14",
"deno": "1",
"ios": "13.4",
"samsung": "13",
"rhino": "1.8",
"opera_mobile": "57",
"electron": "8.0"
},
"transform-optional-chaining": {
"chrome": "91",
"opera": "77",
"edge": "91",
"firefox": "74",
"safari": "13.1",
"node": "16.9",
"deno": "1.9",
"ios": "13.4",
"samsung": "16",
"opera_mobile": "64",
"electron": "13.0"
},
"proposal-optional-chaining": {
"chrome": "91",
"opera": "77",
"edge": "91",
"firefox": "74",
"safari": "13.1",
"node": "16.9",
"deno": "1.9",
"ios": "13.4",
"samsung": "16",
"opera_mobile": "64",
"electron": "13.0"
},
"transform-json-strings": {
"chrome": "66",
"opera": "53",
"edge": "79",
"firefox": "62",
"safari": "12",
"node": "10",
"deno": "1",
"ios": "12",
"samsung": "9",
"rhino": "1.7.14",
"opera_mobile": "47",
"electron": "3.0"
},
"proposal-json-strings": {
"chrome": "66",
"opera": "53",
"edge": "79",
"firefox": "62",
"safari": "12",
"node": "10",
"deno": "1",
"ios": "12",
"samsung": "9",
"rhino": "1.7.14",
"opera_mobile": "47",
"electron": "3.0"
},
"transform-optional-catch-binding": {
"chrome": "66",
"opera": "53",
"edge": "79",
"firefox": "58",
"safari": "11.1",
"node": "10",
"deno": "1",
"ios": "11.3",
"samsung": "9",
"opera_mobile": "47",
"electron": "3.0"
},
"proposal-optional-catch-binding": {
"chrome": "66",
"opera": "53",
"edge": "79",
"firefox": "58",
"safari": "11.1",
"node": "10",
"deno": "1",
"ios": "11.3",
"samsung": "9",
"opera_mobile": "47",
"electron": "3.0"
},
"transform-parameters": {
"chrome": "49",
"opera": "36",
"edge": "18",
"firefox": "52",
"safari": "16.3",
"node": "6",
"deno": "1",
"ios": "16.3",
"samsung": "5",
"opera_mobile": "36",
"electron": "0.37"
},
"transform-async-generator-functions": {
"chrome": "63",
"opera": "50",
"edge": "79",
"firefox": "57",
"safari": "12",
"node": "10",
"deno": "1",
"ios": "12",
"samsung": "8",
"opera_mobile": "46",
"electron": "3.0"
},
"proposal-async-generator-functions": {
"chrome": "63",
"opera": "50",
"edge": "79",
"firefox": "57",
"safari": "12",
"node": "10",
"deno": "1",
"ios": "12",
"samsung": "8",
"opera_mobile": "46",
"electron": "3.0"
},
"transform-object-rest-spread": {
"chrome": "60",
"opera": "47",
"edge": "79",
"firefox": "55",
"safari": "11.1",
"node": "8.3",
"deno": "1",
"ios": "11.3",
"samsung": "8",
"opera_mobile": "44",
"electron": "2.0"
},
"proposal-object-rest-spread": {
"chrome": "60",
"opera": "47",
"edge": "79",
"firefox": "55",
"safari": "11.1",
"node": "8.3",
"deno": "1",
"ios": "11.3",
"samsung": "8",
"opera_mobile": "44",
"electron": "2.0"
},
"transform-dotall-regex": {
"chrome": "62",
"opera": "49",
"edge": "79",
"firefox": "78",
"safari": "11.1",
"node": "8.10",
"deno": "1",
"ios": "11.3",
"samsung": "8",
"rhino": "1.7.15",
"opera_mobile": "46",
"electron": "3.0"
},
"transform-unicode-property-regex": {
"chrome": "64",
"opera": "51",
"edge": "79",
"firefox": "78",
"safari": "11.1",
"node": "10",
"deno": "1",
"ios": "11.3",
"samsung": "9",
"opera_mobile": "47",
"electron": "3.0"
},
"proposal-unicode-property-regex": {
"chrome": "64",
"opera": "51",
"edge": "79",
"firefox": "78",
"safari": "11.1",
"node": "10",
"deno": "1",
"ios": "11.3",
"samsung": "9",
"opera_mobile": "47",
"electron": "3.0"
},
"transform-named-capturing-groups-regex": {
"chrome": "64",
"opera": "51",
"edge": "79",
"firefox": "78",
"safari": "11.1",
"node": "10",
"deno": "1",
"ios": "11.3",
"samsung": "9",
"opera_mobile": "47",
"electron": "3.0"
},
"transform-async-to-generator": {
"chrome": "55",
"opera": "42",
"edge": "15",
"firefox": "52",
"safari": "11",
"node": "7.6",
"deno": "1",
"ios": "11",
"samsung": "6",
"opera_mobile": "42",
"electron": "1.6"
},
"transform-exponentiation-operator": {
"chrome": "52",
"opera": "39",
"edge": "14",
"firefox": "52",
"safari": "10.1",
"node": "7",
"deno": "1",
"ios": "10.3",
"samsung": "6",
"rhino": "1.7.14",
"opera_mobile": "41",
"electron": "1.3"
},
"transform-template-literals": {
"chrome": "41",
"opera": "28",
"edge": "13",
"firefox": "34",
"safari": "13",
"node": "4",
"deno": "1",
"ios": "13",
"samsung": "3.4",
"opera_mobile": "28",
"electron": "0.21"
},
"transform-literals": {
"chrome": "44",
"opera": "31",
"edge": "12",
"firefox": "53",
"safari": "9",
"node": "4",
"deno": "1",
"ios": "9",
"samsung": "4",
"rhino": "1.7.15",
"opera_mobile": "32",
"electron": "0.30"
},
"transform-function-name": {
"chrome": "51",
"opera": "38",
"edge": "79",
"firefox": "53",
"safari": "10",
"node": "6.5",
"deno": "1",
"ios": "10",
"samsung": "5",
"opera_mobile": "41",
"electron": "1.2"
},
"transform-arrow-functions": {
"chrome": "47",
"opera": "34",
"edge": "13",
"firefox": "43",
"safari": "10",
"node": "6",
"deno": "1",
"ios": "10",
"samsung": "5",
"rhino": "1.7.13",
"opera_mobile": "34",
"electron": "0.36"
},
"transform-block-scoped-functions": {
"chrome": "41",
"opera": "28",
"edge": "12",
"firefox": "46",
"safari": "10",
"node": "4",
"deno": "1",
"ie": "11",
"ios": "10",
"samsung": "3.4",
"opera_mobile": "28",
"electron": "0.21"
},
"transform-classes": {
"chrome": "46",
"opera": "33",
"edge": "13",
"firefox": "45",
"safari": "10",
"node": "5",
"deno": "1",
"ios": "10",
"samsung": "5",
"opera_mobile": "33",
"electron": "0.36"
},
"transform-object-super": {
"chrome": "46",
"opera": "33",
"edge": "13",
"firefox": "45",
"safari": "10",
"node": "5",
"deno": "1",
"ios": "10",
"samsung": "5",
"opera_mobile": "33",
"electron": "0.36"
},
"transform-shorthand-properties": {
"chrome": "43",
"opera": "30",
"edge": "12",
"firefox": "33",
"safari": "9",
"node": "4",
"deno": "1",
"ios": "9",
"samsung": "4",
"rhino": "1.7.14",
"opera_mobile": "30",
"electron": "0.27"
},
"transform-duplicate-keys": {
"chrome": "42",
"opera": "29",
"edge": "12",
"firefox": "34",
"safari": "9",
"node": "4",
"deno": "1",
"ios": "9",
"samsung": "3.4",
"opera_mobile": "29",
"electron": "0.25"
},
"transform-computed-properties": {
"chrome": "44",
"opera": "31",
"edge": "12",
"firefox": "34",
"safari": "7.1",
"node": "4",
"deno": "1",
"ios": "8",
"samsung": "4",
"rhino": "1.8",
"opera_mobile": "32",
"electron": "0.30"
},
"transform-for-of": {
"chrome": "51",
"opera": "38",
"edge": "15",
"firefox": "53",
"safari": "10",
"node": "6.5",
"deno": "1",
"ios": "10",
"samsung": "5",
"opera_mobile": "41",
"electron": "1.2"
},
"transform-sticky-regex": {
"chrome": "49",
"opera": "36",
"edge": "13",
"firefox": "3",
"safari": "10",
"node": "6",
"deno": "1",
"ios": "10",
"samsung": "5",
"rhino": "1.7.15",
"opera_mobile": "36",
"electron": "0.37"
},
"transform-unicode-escapes": {
"chrome": "44",
"opera": "31",
"edge": "12",
"firefox": "53",
"safari": "9",
"node": "4",
"deno": "1",
"ios": "9",
"samsung": "4",
"rhino": "1.7.15",
"opera_mobile": "32",
"electron": "0.30"
},
"transform-unicode-regex": {
"chrome": "50",
"opera": "37",
"edge": "13",
"firefox": "46",
"safari": "12",
"node": "6",
"deno": "1",
"ios": "12",
"samsung": "5",
"opera_mobile": "37",
"electron": "1.1"
},
"transform-spread": {
"chrome": "46",
"opera": "33",
"edge": "13",
"firefox": "45",
"safari": "10",
"node": "5",
"deno": "1",
"ios": "10",
"samsung": "5",
"opera_mobile": "33",
"electron": "0.36"
},
"transform-destructuring": {
"chrome": "51",
"opera": "38",
"edge": "15",
"firefox": "53",
"safari": "10",
"node": "6.5",
"deno": "1",
"ios": "10",
"samsung": "5",
"opera_mobile": "41",
"electron": "1.2"
},
"transform-block-scoping": {
"chrome": "50",
"opera": "37",
"edge": "14",
"firefox": "53",
"safari": "11",
"node": "6",
"deno": "1",
"ios": "11",
"samsung": "5",
"opera_mobile": "37",
"electron": "1.1"
},
"transform-typeof-symbol": {
"chrome": "48",
"opera": "35",
"edge": "12",
"firefox": "36",
"safari": "9",
"node": "6",
"deno": "1",
"ios": "9",
"samsung": "5",
"rhino": "1.8",
"opera_mobile": "35",
"electron": "0.37"
},
"transform-new-target": {
"chrome": "46",
"opera": "33",
"edge": "14",
"firefox": "41",
"safari": "10",
"node": "5",
"deno": "1",
"ios": "10",
"samsung": "5",
"opera_mobile": "33",
"electron": "0.36"
},
"transform-regenerator": {
"chrome": "50",
"opera": "37",
"edge": "13",
"firefox": "53",
"safari": "10",
"node": "6",
"deno": "1",
"ios": "10",
"samsung": "5",
"opera_mobile": "37",
"electron": "1.1"
},
"transform-member-expression-literals": {
"chrome": "7",
"opera": "12",
"edge": "12",
"firefox": "2",
"safari": "5.1",
"node": "0.4",
"deno": "1",
"ie": "9",
"android": "4",
"ios": "6",
"phantom": "1.9",
"samsung": "1",
"rhino": "1.7.13",
"opera_mobile": "12",
"electron": "0.20"
},
"transform-property-literals": {
"chrome": "7",
"opera": "12",
"edge": "12",
"firefox": "2",
"safari": "5.1",
"node": "0.4",
"deno": "1",
"ie": "9",
"android": "4",
"ios": "6",
"phantom": "1.9",
"samsung": "1",
"rhino": "1.7.13",
"opera_mobile": "12",
"electron": "0.20"
},
"transform-reserved-words": {
"chrome": "13",
"opera": "10.50",
"edge": "12",
"firefox": "2",
"safari": "3.1",
"node": "0.6",
"deno": "1",
"ie": "9",
"android": "4.4",
"ios": "6",
"phantom": "1.9",
"samsung": "1",
"rhino": "1.7.13",
"opera_mobile": "10.1",
"electron": "0.20"
},
"transform-export-namespace-from": {
"chrome": "72",
"deno": "1.0",
"edge": "79",
"firefox": "80",
"node": "13.2.0",
"opera": "60",
"opera_mobile": "51",
"safari": "14.1",
"ios": "14.5",
"samsung": "11.0",
"android": "72",
"electron": "5.0"
},
"proposal-export-namespace-from": {
"chrome": "72",
"deno": "1.0",
"edge": "79",
"firefox": "80",
"node": "13.2.0",
"opera": "60",
"opera_mobile": "51",
"safari": "14.1",
"ios": "14.5",
"samsung": "11.0",
"android": "72",
"electron": "5.0"
}
}
+2
View File
@@ -0,0 +1,2 @@
// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly
module.exports = require("./data/native-modules.json");
+2
View File
@@ -0,0 +1,2 @@
// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly
module.exports = require("./data/overlapping-plugins.json");
+40
View File
@@ -0,0 +1,40 @@
{
"name": "@babel/compat-data",
"version": "7.28.6",
"author": "The Babel Team (https://babel.dev/team)",
"license": "MIT",
"description": "The compat-data to determine required Babel plugins",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-compat-data"
},
"publishConfig": {
"access": "public"
},
"exports": {
"./plugins": "./plugins.js",
"./native-modules": "./native-modules.js",
"./corejs2-built-ins": "./corejs2-built-ins.js",
"./corejs3-shipped-proposals": "./corejs3-shipped-proposals.js",
"./overlapping-plugins": "./overlapping-plugins.js",
"./plugin-bugfixes": "./plugin-bugfixes.js"
},
"scripts": {
"build-data": "./scripts/download-compat-table.sh && node ./scripts/build-data.mjs && node ./scripts/build-modules-support.mjs && node ./scripts/build-bugfixes-targets.mjs"
},
"keywords": [
"babel",
"compat-table",
"compat-data"
],
"devDependencies": {
"@mdn/browser-compat-data": "^6.0.8",
"core-js-compat": "^3.43.0",
"electron-to-chromium": "^1.5.140"
},
"engines": {
"node": ">=6.9.0"
},
"type": "commonjs"
}
+2
View File
@@ -0,0 +1,2 @@
// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly
module.exports = require("./data/plugin-bugfixes.json");
+2
View File
@@ -0,0 +1,2 @@
// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly
module.exports = require("./data/plugins.json");
+22
View File
@@ -0,0 +1,22 @@
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+19
View File
@@ -0,0 +1,19 @@
# @babel/core
> Babel compiler core.
See our website [@babel/core](https://babeljs.io/docs/babel-core) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20core%22+is%3Aopen) associated with this package.
## Install
Using npm:
```sh
npm install --save-dev @babel/core
```
or using yarn:
```sh
yarn add @babel/core --dev
```
+5
View File
@@ -0,0 +1,5 @@
"use strict";
0 && 0;
//# sourceMappingURL=cache-contexts.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"names":[],"sources":["../../src/config/cache-contexts.ts"],"sourcesContent":["import type { ConfigContext } from \"./config-chain.ts\";\nimport type {\n CallerMetadata,\n TargetsListOrObject,\n} from \"./validation/options.ts\";\n\nexport type { ConfigContext as FullConfig };\n\nexport type FullPreset = {\n targets: TargetsListOrObject;\n} & ConfigContext;\nexport type FullPlugin = {\n assumptions: Record<string, boolean>;\n} & FullPreset;\n\n// Context not including filename since it is used in places that cannot\n// process 'ignore'/'only' and other filename-based logic.\nexport type SimpleConfig = {\n envName: string;\n caller: CallerMetadata | undefined;\n};\nexport type SimplePreset = {\n targets: TargetsListOrObject;\n} & SimpleConfig;\nexport type SimplePlugin = {\n assumptions: Record<string, boolean>;\n} & SimplePreset;\n"],"mappings":"","ignoreList":[]}
+261
View File
@@ -0,0 +1,261 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.assertSimpleType = assertSimpleType;
exports.makeStrongCache = makeStrongCache;
exports.makeStrongCacheSync = makeStrongCacheSync;
exports.makeWeakCache = makeWeakCache;
exports.makeWeakCacheSync = makeWeakCacheSync;
function _gensync() {
const data = require("gensync");
_gensync = function () {
return data;
};
return data;
}
var _async = require("../gensync-utils/async.js");
var _util = require("./util.js");
const synchronize = gen => {
return _gensync()(gen).sync;
};
function* genTrue() {
return true;
}
function makeWeakCache(handler) {
return makeCachedFunction(WeakMap, handler);
}
function makeWeakCacheSync(handler) {
return synchronize(makeWeakCache(handler));
}
function makeStrongCache(handler) {
return makeCachedFunction(Map, handler);
}
function makeStrongCacheSync(handler) {
return synchronize(makeStrongCache(handler));
}
function makeCachedFunction(CallCache, handler) {
const callCacheSync = new CallCache();
const callCacheAsync = new CallCache();
const futureCache = new CallCache();
return function* cachedFunction(arg, data) {
const asyncContext = yield* (0, _async.isAsync)();
const callCache = asyncContext ? callCacheAsync : callCacheSync;
const cached = yield* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data);
if (cached.valid) return cached.value;
const cache = new CacheConfigurator(data);
const handlerResult = handler(arg, cache);
let finishLock;
let value;
if ((0, _util.isIterableIterator)(handlerResult)) {
value = yield* (0, _async.onFirstPause)(handlerResult, () => {
finishLock = setupAsyncLocks(cache, futureCache, arg);
});
} else {
value = handlerResult;
}
updateFunctionCache(callCache, cache, arg, value);
if (finishLock) {
futureCache.delete(arg);
finishLock.release(value);
}
return value;
};
}
function* getCachedValue(cache, arg, data) {
const cachedValue = cache.get(arg);
if (cachedValue) {
for (const {
value,
valid
} of cachedValue) {
if (yield* valid(data)) return {
valid: true,
value
};
}
}
return {
valid: false,
value: null
};
}
function* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data) {
const cached = yield* getCachedValue(callCache, arg, data);
if (cached.valid) {
return cached;
}
if (asyncContext) {
const cached = yield* getCachedValue(futureCache, arg, data);
if (cached.valid) {
const value = yield* (0, _async.waitFor)(cached.value.promise);
return {
valid: true,
value
};
}
}
return {
valid: false,
value: null
};
}
function setupAsyncLocks(config, futureCache, arg) {
const finishLock = new Lock();
updateFunctionCache(futureCache, config, arg, finishLock);
return finishLock;
}
function updateFunctionCache(cache, config, arg, value) {
if (!config.configured()) config.forever();
let cachedValue = cache.get(arg);
config.deactivate();
switch (config.mode()) {
case "forever":
cachedValue = [{
value,
valid: genTrue
}];
cache.set(arg, cachedValue);
break;
case "invalidate":
cachedValue = [{
value,
valid: config.validator()
}];
cache.set(arg, cachedValue);
break;
case "valid":
if (cachedValue) {
cachedValue.push({
value,
valid: config.validator()
});
} else {
cachedValue = [{
value,
valid: config.validator()
}];
cache.set(arg, cachedValue);
}
}
}
class CacheConfigurator {
constructor(data) {
this._active = true;
this._never = false;
this._forever = false;
this._invalidate = false;
this._configured = false;
this._pairs = [];
this._data = void 0;
this._data = data;
}
simple() {
return makeSimpleConfigurator(this);
}
mode() {
if (this._never) return "never";
if (this._forever) return "forever";
if (this._invalidate) return "invalidate";
return "valid";
}
forever() {
if (!this._active) {
throw new Error("Cannot change caching after evaluation has completed.");
}
if (this._never) {
throw new Error("Caching has already been configured with .never()");
}
this._forever = true;
this._configured = true;
}
never() {
if (!this._active) {
throw new Error("Cannot change caching after evaluation has completed.");
}
if (this._forever) {
throw new Error("Caching has already been configured with .forever()");
}
this._never = true;
this._configured = true;
}
using(handler) {
if (!this._active) {
throw new Error("Cannot change caching after evaluation has completed.");
}
if (this._never || this._forever) {
throw new Error("Caching has already been configured with .never or .forever()");
}
this._configured = true;
const key = handler(this._data);
const fn = (0, _async.maybeAsync)(handler, `You appear to be using an async cache handler, but Babel has been called synchronously`);
if ((0, _async.isThenable)(key)) {
return key.then(key => {
this._pairs.push([key, fn]);
return key;
});
}
this._pairs.push([key, fn]);
return key;
}
invalidate(handler) {
this._invalidate = true;
return this.using(handler);
}
validator() {
const pairs = this._pairs;
return function* (data) {
for (const [key, fn] of pairs) {
if (key !== (yield* fn(data))) return false;
}
return true;
};
}
deactivate() {
this._active = false;
}
configured() {
return this._configured;
}
}
function makeSimpleConfigurator(cache) {
function cacheFn(val) {
if (typeof val === "boolean") {
if (val) cache.forever();else cache.never();
return;
}
return cache.using(() => assertSimpleType(val()));
}
cacheFn.forever = () => cache.forever();
cacheFn.never = () => cache.never();
cacheFn.using = cb => cache.using(() => assertSimpleType(cb()));
cacheFn.invalidate = cb => cache.invalidate(() => assertSimpleType(cb()));
return cacheFn;
}
function assertSimpleType(value) {
if ((0, _async.isThenable)(value)) {
throw new Error(`You appear to be using an async cache handler, ` + `which your current version of Babel does not support. ` + `We may add support for this in the future, ` + `but if you're on the most recent version of @babel/core and still ` + `seeing this error, then you'll need to synchronously handle your caching logic.`);
}
if (value != null && typeof value !== "string" && typeof value !== "boolean" && typeof value !== "number") {
throw new Error("Cache keys must be either string, boolean, number, null, or undefined.");
}
return value;
}
class Lock {
constructor() {
this.released = false;
this.promise = void 0;
this._resolve = void 0;
this.promise = new Promise(resolve => {
this._resolve = resolve;
});
}
release(value) {
this.released = true;
this._resolve(value);
}
}
0 && 0;
//# sourceMappingURL=caching.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"names":["_gensync","data","require","_async","_util","synchronize","gen","gensync","sync","genTrue","makeWeakCache","handler","makeCachedFunction","WeakMap","makeWeakCacheSync","makeStrongCache","Map","makeStrongCacheSync","CallCache","callCacheSync","callCacheAsync","futureCache","cachedFunction","arg","asyncContext","isAsync","callCache","cached","getCachedValueOrWait","valid","value","cache","CacheConfigurator","handlerResult","finishLock","isIterableIterator","onFirstPause","setupAsyncLocks","updateFunctionCache","delete","release","getCachedValue","cachedValue","get","waitFor","promise","config","Lock","configured","forever","deactivate","mode","set","validator","push","constructor","_active","_never","_forever","_invalidate","_configured","_pairs","_data","simple","makeSimpleConfigurator","Error","never","using","key","fn","maybeAsync","isThenable","then","invalidate","pairs","cacheFn","val","assertSimpleType","cb","released","_resolve","Promise","resolve"],"sources":["../../src/config/caching.ts"],"sourcesContent":["import gensync from \"gensync\";\nimport type { Handler } from \"gensync\";\nimport {\n maybeAsync,\n isAsync,\n onFirstPause,\n waitFor,\n isThenable,\n} from \"../gensync-utils/async.ts\";\nimport { isIterableIterator } from \"./util.ts\";\n\nexport type { CacheConfigurator };\n\nexport type SimpleCacheConfigurator = {\n (forever: boolean): void;\n <T extends SimpleType>(handler: () => T): T;\n\n forever: () => void;\n never: () => void;\n using: <T extends SimpleType>(handler: () => T) => T;\n invalidate: <T extends SimpleType>(handler: () => T) => T;\n};\n\nexport type CacheEntry<ResultT, SideChannel> = {\n value: ResultT;\n valid: (channel: SideChannel) => Handler<boolean>;\n}[];\n\nconst synchronize = <ArgsT extends unknown[], ResultT>(\n gen: (...args: ArgsT) => Handler<ResultT>,\n): ((...args: ArgsT) => ResultT) => {\n return gensync(gen).sync;\n};\n\n// eslint-disable-next-line require-yield\nfunction* genTrue() {\n return true;\n}\n\nexport function makeWeakCache<ArgT extends object, ResultT, SideChannel>(\n handler: (\n arg: ArgT,\n cache: CacheConfigurator<SideChannel>,\n ) => Handler<ResultT> | ResultT,\n): (arg: ArgT, data: SideChannel) => Handler<ResultT> {\n return makeCachedFunction<ArgT, ResultT, SideChannel>(WeakMap, handler);\n}\n\nexport function makeWeakCacheSync<ArgT extends object, ResultT, SideChannel>(\n handler: (arg: ArgT, cache?: CacheConfigurator<SideChannel>) => ResultT,\n): (arg: ArgT, data?: SideChannel) => ResultT {\n return synchronize<[ArgT, SideChannel], ResultT>(\n makeWeakCache<ArgT, ResultT, SideChannel>(handler),\n );\n}\n\nexport function makeStrongCache<ArgT, ResultT, SideChannel>(\n handler: (\n arg: ArgT,\n cache: CacheConfigurator<SideChannel>,\n ) => Handler<ResultT> | ResultT,\n): (arg: ArgT, data: SideChannel) => Handler<ResultT> {\n return makeCachedFunction<ArgT, ResultT, SideChannel>(Map, handler);\n}\n\nexport function makeStrongCacheSync<ArgT, ResultT, SideChannel>(\n handler: (arg: ArgT, cache?: CacheConfigurator<SideChannel>) => ResultT,\n): (arg: ArgT, data?: SideChannel) => ResultT {\n return synchronize<[ArgT, SideChannel], ResultT>(\n makeStrongCache<ArgT, ResultT, SideChannel>(handler),\n );\n}\n\n/* NOTE: Part of the logic explained in this comment is explained in the\n * getCachedValueOrWait and setupAsyncLocks functions.\n *\n * > There are only two hard things in Computer Science: cache invalidation and naming things.\n * > -- Phil Karlton\n *\n * I don't know if Phil was also thinking about handling a cache whose invalidation function is\n * defined asynchronously is considered, but it is REALLY hard to do correctly.\n *\n * The implemented logic (only when gensync is run asynchronously) is the following:\n * 1. If there is a valid cache associated to the current \"arg\" parameter,\n * a. RETURN the cached value\n * 3. If there is a FinishLock associated to the current \"arg\" parameter representing a valid cache,\n * a. Wait for that lock to be released\n * b. RETURN the value associated with that lock\n * 5. Start executing the function to be cached\n * a. If it pauses on a promise, then\n * i. Let FinishLock be a new lock\n * ii. Store FinishLock as associated to the current \"arg\" parameter\n * iii. Wait for the function to finish executing\n * iv. Release FinishLock\n * v. Send the function result to anyone waiting on FinishLock\n * 6. Store the result in the cache\n * 7. RETURN the result\n */\nfunction makeCachedFunction<ArgT, ResultT, SideChannel>(\n CallCache: new <Cached>() => CacheMap<ArgT, Cached, SideChannel>,\n handler: (\n arg: ArgT,\n cache: CacheConfigurator<SideChannel>,\n ) => Handler<ResultT> | ResultT,\n): (arg: ArgT, data: SideChannel) => Handler<ResultT> {\n const callCacheSync = new CallCache<ResultT>();\n const callCacheAsync = new CallCache<RLine truncated
+469
View File
@@ -0,0 +1,469 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.buildPresetChain = buildPresetChain;
exports.buildPresetChainWalker = void 0;
exports.buildRootChain = buildRootChain;
function _path() {
const data = require("path");
_path = function () {
return data;
};
return data;
}
function _debug() {
const data = require("debug");
_debug = function () {
return data;
};
return data;
}
var _options = require("./validation/options.js");
var _patternToRegex = require("./pattern-to-regex.js");
var _printer = require("./printer.js");
var _rewriteStackTrace = require("../errors/rewrite-stack-trace.js");
var _configError = require("../errors/config-error.js");
var _index = require("./files/index.js");
var _caching = require("./caching.js");
var _configDescriptors = require("./config-descriptors.js");
const debug = _debug()("babel:config:config-chain");
function* buildPresetChain(arg, context) {
const chain = yield* buildPresetChainWalker(arg, context);
if (!chain) return null;
return {
plugins: dedupDescriptors(chain.plugins),
presets: dedupDescriptors(chain.presets),
options: chain.options.map(o => createConfigChainOptions(o)),
files: new Set()
};
}
const buildPresetChainWalker = exports.buildPresetChainWalker = makeChainWalker({
root: preset => loadPresetDescriptors(preset),
env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName),
overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index),
overridesEnv: (preset, index, envName) => loadPresetOverridesEnvDescriptors(preset)(index)(envName),
createLogger: () => () => {}
});
const loadPresetDescriptors = (0, _caching.makeWeakCacheSync)(preset => buildRootDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors));
const loadPresetEnvDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(envName => buildEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, envName)));
const loadPresetOverridesDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(index => buildOverrideDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index)));
const loadPresetOverridesEnvDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(index => (0, _caching.makeStrongCacheSync)(envName => buildOverrideEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index, envName))));
function* buildRootChain(opts, context) {
let configReport, babelRcReport;
const programmaticLogger = new _printer.ConfigPrinter();
const programmaticChain = yield* loadProgrammaticChain({
options: opts,
dirname: context.cwd
}, context, undefined, programmaticLogger);
if (!programmaticChain) return null;
const programmaticReport = yield* programmaticLogger.output();
let configFile;
if (typeof opts.configFile === "string") {
configFile = yield* (0, _index.loadConfig)(opts.configFile, context.cwd, context.envName, context.caller);
} else if (opts.configFile !== false) {
configFile = yield* (0, _index.findRootConfig)(context.root, context.envName, context.caller);
}
let {
babelrc,
babelrcRoots
} = opts;
let babelrcRootsDirectory = context.cwd;
const configFileChain = emptyChain();
const configFileLogger = new _printer.ConfigPrinter();
if (configFile) {
const validatedFile = validateConfigFile(configFile);
const result = yield* loadFileChain(validatedFile, context, undefined, configFileLogger);
if (!result) return null;
configReport = yield* configFileLogger.output();
if (babelrc === undefined) {
babelrc = validatedFile.options.babelrc;
}
if (babelrcRoots === undefined) {
babelrcRootsDirectory = validatedFile.dirname;
babelrcRoots = validatedFile.options.babelrcRoots;
}
mergeChain(configFileChain, result);
}
let ignoreFile, babelrcFile;
let isIgnored = false;
const fileChain = emptyChain();
if ((babelrc === true || babelrc === undefined) && typeof context.filename === "string") {
const pkgData = yield* (0, _index.findPackageData)(context.filename);
if (pkgData && babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory)) {
({
ignore: ignoreFile,
config: babelrcFile
} = yield* (0, _index.findRelativeConfig)(pkgData, context.envName, context.caller));
if (ignoreFile) {
fileChain.files.add(ignoreFile.filepath);
}
if (ignoreFile && shouldIgnore(context, ignoreFile.ignore, null, ignoreFile.dirname)) {
isIgnored = true;
}
if (babelrcFile && !isIgnored) {
const validatedFile = validateBabelrcFile(babelrcFile);
const babelrcLogger = new _printer.ConfigPrinter();
const result = yield* loadFileChain(validatedFile, context, undefined, babelrcLogger);
if (!result) {
isIgnored = true;
} else {
babelRcReport = yield* babelrcLogger.output();
mergeChain(fileChain, result);
}
}
if (babelrcFile && isIgnored) {
fileChain.files.add(babelrcFile.filepath);
}
}
}
if (context.showConfig) {
console.log(`Babel configs on "${context.filename}" (ascending priority):\n` + [configReport, babelRcReport, programmaticReport].filter(x => !!x).join("\n\n") + "\n-----End Babel configs-----");
}
const chain = mergeChain(mergeChain(mergeChain(emptyChain(), configFileChain), fileChain), programmaticChain);
return {
plugins: isIgnored ? [] : dedupDescriptors(chain.plugins),
presets: isIgnored ? [] : dedupDescriptors(chain.presets),
options: isIgnored ? [] : chain.options.map(o => createConfigChainOptions(o)),
fileHandling: isIgnored ? "ignored" : "transpile",
ignore: ignoreFile || undefined,
babelrc: babelrcFile || undefined,
config: configFile || undefined,
files: chain.files
};
}
function babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory) {
if (typeof babelrcRoots === "boolean") return babelrcRoots;
const absoluteRoot = context.root;
if (babelrcRoots === undefined) {
return pkgData.directories.includes(absoluteRoot);
}
let babelrcPatterns = babelrcRoots;
if (!Array.isArray(babelrcPatterns)) {
babelrcPatterns = [babelrcPatterns];
}
babelrcPatterns = babelrcPatterns.map(pat => {
return typeof pat === "string" ? _path().resolve(babelrcRootsDirectory, pat) : pat;
});
if (babelrcPatterns.length === 1 && babelrcPatterns[0] === absoluteRoot) {
return pkgData.directories.includes(absoluteRoot);
}
return babelrcPatterns.some(pat => {
if (typeof pat === "string") {
pat = (0, _patternToRegex.default)(pat, babelrcRootsDirectory);
}
return pkgData.directories.some(directory => {
return matchPattern(pat, babelrcRootsDirectory, directory, context);
});
});
}
const validateConfigFile = (0, _caching.makeWeakCacheSync)(file => ({
filepath: file.filepath,
dirname: file.dirname,
options: (0, _options.validate)("configfile", file.options, file.filepath)
}));
const validateBabelrcFile = (0, _caching.makeWeakCacheSync)(file => ({
filepath: file.filepath,
dirname: file.dirname,
options: (0, _options.validate)("babelrcfile", file.options, file.filepath)
}));
const validateExtendFile = (0, _caching.makeWeakCacheSync)(file => ({
filepath: file.filepath,
dirname: file.dirname,
options: (0, _options.validate)("extendsfile", file.options, file.filepath)
}));
const loadProgrammaticChain = makeChainWalker({
root: input => buildRootDescriptors(input, "base", _configDescriptors.createCachedDescriptors),
env: (input, envName) => buildEnvDescriptors(input, "base", _configDescriptors.createCachedDescriptors, envName),
overrides: (input, index) => buildOverrideDescriptors(input, "base", _configDescriptors.createCachedDescriptors, index),
overridesEnv: (input, index, envName) => buildOverrideEnvDescriptors(input, "base", _configDescriptors.createCachedDescriptors, index, envName),
createLogger: (input, context, baseLogger) => buildProgrammaticLogger(input, context, baseLogger)
});
const loadFileChainWalker = makeChainWalker({
root: file => loadFileDescriptors(file),
env: (file, envName) => loadFileEnvDescriptors(file)(envName),
overrides: (file, index) => loadFileOverridesDescriptors(file)(index),
overridesEnv: (file, index, envName) => loadFileOverridesEnvDescriptors(file)(index)(envName),
createLogger: (file, context, baseLogger) => buildFileLogger(file.filepath, context, baseLogger)
});
function* loadFileChain(input, context, files, baseLogger) {
const chain = yield* loadFileChainWalker(input, context, files, baseLogger);
chain == null || chain.files.add(input.filepath);
return chain;
}
const loadFileDescriptors = (0, _caching.makeWeakCacheSync)(file => buildRootDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors));
const loadFileEnvDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(envName => buildEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, envName)));
const loadFileOverridesDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(index => buildOverrideDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index)));
const loadFileOverridesEnvDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(index => (0, _caching.makeStrongCacheSync)(envName => buildOverrideEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index, envName))));
function buildFileLogger(filepath, context, baseLogger) {
if (!baseLogger) {
return () => {};
}
return baseLogger.configure(context.showConfig, _printer.ChainFormatter.Config, {
filepath
});
}
function buildRootDescriptors({
dirname,
options
}, alias, descriptors) {
return descriptors(dirname, options, alias);
}
function buildProgrammaticLogger(_, context, baseLogger) {
var _context$caller;
if (!baseLogger) {
return () => {};
}
return baseLogger.configure(context.showConfig, _printer.ChainFormatter.Programmatic, {
callerName: (_context$caller = context.caller) == null ? void 0 : _context$caller.name
});
}
function buildEnvDescriptors({
dirname,
options
}, alias, descriptors, envName) {
var _options$env;
const opts = (_options$env = options.env) == null ? void 0 : _options$env[envName];
return opts ? descriptors(dirname, opts, `${alias}.env["${envName}"]`) : null;
}
function buildOverrideDescriptors({
dirname,
options
}, alias, descriptors, index) {
var _options$overrides;
const opts = (_options$overrides = options.overrides) == null ? void 0 : _options$overrides[index];
if (!opts) throw new Error("Assertion failure - missing override");
return descriptors(dirname, opts, `${alias}.overrides[${index}]`);
}
function buildOverrideEnvDescriptors({
dirname,
options
}, alias, descriptors, index, envName) {
var _options$overrides2, _override$env;
const override = (_options$overrides2 = options.overrides) == null ? void 0 : _options$overrides2[index];
if (!override) throw new Error("Assertion failure - missing override");
const opts = (_override$env = override.env) == null ? void 0 : _override$env[envName];
return opts ? descriptors(dirname, opts, `${alias}.overrides[${index}].env["${envName}"]`) : null;
}
function makeChainWalker({
root,
env,
overrides,
overridesEnv,
createLogger
}) {
return function* chainWalker(input, context, files = new Set(), baseLogger) {
const {
dirname
} = input;
const flattenedConfigs = [];
const rootOpts = root(input);
if (configIsApplicable(rootOpts, dirname, context, input.filepath)) {
flattenedConfigs.push({
config: rootOpts,
envName: undefined,
index: undefined
});
const envOpts = env(input, context.envName);
if (envOpts && configIsApplicable(envOpts, dirname, context, input.filepath)) {
flattenedConfigs.push({
config: envOpts,
envName: context.envName,
index: undefined
});
}
(rootOpts.options.overrides || []).forEach((_, index) => {
const overrideOps = overrides(input, index);
if (configIsApplicable(overrideOps, dirname, context, input.filepath)) {
flattenedConfigs.push({
config: overrideOps,
index,
envName: undefined
});
const overrideEnvOpts = overridesEnv(input, index, context.envName);
if (overrideEnvOpts && configIsApplicable(overrideEnvOpts, dirname, context, input.filepath)) {
flattenedConfigs.push({
config: overrideEnvOpts,
index,
envName: context.envName
});
}
}
});
}
if (flattenedConfigs.some(({
config: {
options: {
ignore,
only
}
}
}) => shouldIgnore(context, ignore, only, dirname))) {
return null;
}
const chain = emptyChain();
const logger = createLogger(input, context, baseLogger);
for (const {
config,
index,
envName
} of flattenedConfigs) {
if (!(yield* mergeExtendsChain(chain, config.options, dirname, context, files, baseLogger))) {
return null;
}
logger(config, index, envName);
yield* mergeChainOpts(chain, config);
}
return chain;
};
}
function* mergeExtendsChain(chain, opts, dirname, context, files, baseLogger) {
if (opts.extends === undefined) return true;
const file = yield* (0, _index.loadConfig)(opts.extends, dirname, context.envName, context.caller);
if (files.has(file)) {
throw new Error(`Configuration cycle detected loading ${file.filepath}.\n` + `File already loaded following the config chain:\n` + Array.from(files, file => ` - ${file.filepath}`).join("\n"));
}
files.add(file);
const fileChain = yield* loadFileChain(validateExtendFile(file), context, files, baseLogger);
files.delete(file);
if (!fileChain) return false;
mergeChain(chain, fileChain);
return true;
}
function mergeChain(target, source) {
target.options.push(...source.options);
target.plugins.push(...source.plugins);
target.presets.push(...source.presets);
for (const file of source.files) {
target.files.add(file);
}
return target;
}
function* mergeChainOpts(target, {
options,
plugins,
presets
}) {
target.options.push(options);
target.plugins.push(...(yield* plugins()));
target.presets.push(...(yield* presets()));
return target;
}
function emptyChain() {
return {
options: [],
presets: [],
plugins: [],
files: new Set()
};
}
function createConfigChainOptions(opts) {
const options = Object.assign({}, opts);
delete options.extends;
delete options.env;
delete options.overrides;
delete options.plugins;
delete options.presets;
delete options.passPerPreset;
delete options.ignore;
delete options.only;
delete options.test;
delete options.include;
delete options.exclude;
if (hasOwnProperty.call(options, "sourceMap")) {
options.sourceMaps = options.sourceMap;
delete options.sourceMap;
}
return options;
}
function dedupDescriptors(items) {
const map = new Map();
const descriptors = [];
for (const item of items) {
if (typeof item.value === "function") {
const fnKey = item.value;
let nameMap = map.get(fnKey);
if (!nameMap) {
nameMap = new Map();
map.set(fnKey, nameMap);
}
let desc = nameMap.get(item.name);
if (!desc) {
desc = {
value: item
};
descriptors.push(desc);
if (!item.ownPass) nameMap.set(item.name, desc);
} else {
desc.value = item;
}
} else {
descriptors.push({
value: item
});
}
}
return descriptors.reduce((acc, desc) => {
acc.push(desc.value);
return acc;
}, []);
}
function configIsApplicable({
options
}, dirname, context, configName) {
return (options.test === undefined || configFieldIsApplicable(context, options.test, dirname, configName)) && (options.include === undefined || configFieldIsApplicable(context, options.include, dirname, configName)) && (options.exclude === undefined || !configFieldIsApplicable(context, options.exclude, dirname, configName));
}
function configFieldIsApplicable(context, test, dirname, configName) {
const patterns = Array.isArray(test) ? test : [test];
return matchesPatterns(context, patterns, dirname, configName);
}
function ignoreListReplacer(_key, value) {
if (value instanceof RegExp) {
return String(value);
}
return value;
}
function shouldIgnore(context, ignore, only, dirname) {
if (ignore && matchesPatterns(context, ignore, dirname)) {
var _context$filename;
const message = `No config is applied to "${(_context$filename = context.filename) != null ? _context$filename : "(unknown)"}" because it matches one of \`ignore: ${JSON.stringify(ignore, ignoreListReplacer)}\` from "${dirname}"`;
debug(message);
if (context.showConfig) {
console.log(message);
}
return true;
}
if (only && !matchesPatterns(context, only, dirname)) {
var _context$filename2;
const message = `No config is applied to "${(_context$filename2 = context.filename) != null ? _context$filename2 : "(unknown)"}" because it fails to match one of \`only: ${JSON.stringify(only, ignoreListReplacer)}\` from "${dirname}"`;
debug(message);
if (context.showConfig) {
console.log(message);
}
return true;
}
return false;
}
function matchesPatterns(context, patterns, dirname, configName) {
return patterns.some(pattern => matchPattern(pattern, dirname, context.filename, context, configName));
}
function matchPattern(pattern, dirname, pathToTest, context, configName) {
if (typeof pattern === "function") {
return !!(0, _rewriteStackTrace.endHiddenCallStack)(pattern)(pathToTest, {
dirname,
envName: context.envName,
caller: context.caller
});
}
if (typeof pathToTest !== "string") {
throw new _configError.default(`Configuration contains string/RegExp pattern, but no filename was passed to Babel`, configName);
}
if (typeof pattern === "string") {
pattern = (0, _patternToRegex.default)(pattern, dirname);
}
return pattern.test(pathToTest);
}
0 && 0;
//# sourceMappingURL=config-chain.js.map
Loaded 100 of 9946 files, more files were not shown because too many files have changed in this diff. Show more