From 9fb86e625cf886f4e42395c586ea01b59c32593d Mon Sep 17 00:00:00 2001 From: Chen Date: Mon, 1 Dec 2025 19:32:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dnas=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E5=92=8C=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=BC=95=E5=AF=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 - README.md | 3 +- .../server/public/assets/index-BQRQ1pO1.js | 226 --------- .../server/public/assets/index-CGwCzICz.js | 224 +++++++++ flypic/app/server/public/index.html | 2 +- flypic/app/ui/config | 2 +- flypic/wizard/install | 21 + frontend/src/components/RightPanel.jsx | 452 ++++++++++++++---- 飞牛打包部署指南.md | 154 ++++++ 9 files changed, 765 insertions(+), 320 deletions(-) delete mode 100644 flypic/app/server/public/assets/index-BQRQ1pO1.js create mode 100644 flypic/app/server/public/assets/index-CGwCzICz.js create mode 100644 飞牛打包部署指南.md diff --git a/.gitignore b/.gitignore index 5248b84..31dd8f7 100644 --- a/.gitignore +++ b/.gitignore @@ -43,7 +43,6 @@ coverage/ # 知识库文件夹 - 不同步到 GitHub Knowledge base/ -飞牛打包部署指南.md # 构建输出 dist/ diff --git a/README.md b/README.md index aee92b1..fcb83cd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # FlyPic 飞图 -专为飞牛 fnOS 设计的轻量、快速、稳定的图像素材检索浏览应用。 +主要飞牛 fnOS 设计的轻量、快速、稳定的图像素材检索浏览应用。 ## ✨ 核心特性 @@ -12,6 +12,7 @@ - 🔍 **智能搜索** - 多关键词组合搜索,高级筛选(格式/大小/方向) - 📱 **移动适配** - 响应式设计,手机上也能流畅使用 - 🆓 **开源免费** - 100% 开源,MIT 协议 +- 其他平台 ## 🛠️ 技术栈 diff --git a/flypic/app/server/public/assets/index-BQRQ1pO1.js b/flypic/app/server/public/assets/index-BQRQ1pO1.js deleted file mode 100644 index e70311d..0000000 --- a/flypic/app/server/public/assets/index-BQRQ1pO1.js +++ /dev/null @@ -1,226 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var Es=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function su(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gd={exports:{}},$o={},yd={exports:{}},Se={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var ms=Symbol.for("react.element"),Sm=Symbol.for("react.portal"),bm=Symbol.for("react.fragment"),Em=Symbol.for("react.strict_mode"),Cm=Symbol.for("react.profiler"),Nm=Symbol.for("react.provider"),Rm=Symbol.for("react.context"),Tm=Symbol.for("react.forward_ref"),Om=Symbol.for("react.suspense"),Im=Symbol.for("react.memo"),Am=Symbol.for("react.lazy"),dc=Symbol.iterator;function jm(e){return e===null||typeof e!="object"?null:(e=dc&&e[dc]||e["@@iterator"],typeof e=="function"?e:null)}var vd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},wd=Object.assign,xd={};function vi(e,t,r){this.props=e,this.context=t,this.refs=xd,this.updater=r||vd}vi.prototype.isReactComponent={};vi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};vi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function _d(){}_d.prototype=vi.prototype;function ou(e,t,r){this.props=e,this.context=t,this.refs=xd,this.updater=r||vd}var au=ou.prototype=new _d;au.constructor=ou;wd(au,vi.prototype);au.isPureReactComponent=!0;var hc=Array.isArray,kd=Object.prototype.hasOwnProperty,lu={current:null},Sd={key:!0,ref:!0,__self:!0,__source:!0};function bd(e,t,r){var n,i={},s=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)kd.call(t,n)&&!Sd.hasOwnProperty(n)&&(i[n]=t[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1>>1,A=$[I];if(0>>1;Ii(W,H))oei(he,W)?($[I]=he,$[oe]=H,I=oe):($[I]=W,$[M]=H,I=M);else if(oei(he,H))$[I]=he,$[oe]=H,I=oe;else break e}}return D}function i($,D){var H=$.sortIndex-D.sortIndex;return H!==0?H:$.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],f=[],p=1,y=null,x=3,g=!1,m=!1,u=!1,v=typeof setTimeout=="function"?setTimeout:null,c=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w($){for(var D=r(f);D!==null;){if(D.callback===null)n(f);else if(D.startTime<=$)n(f),D.sortIndex=D.expirationTime,t(l,D);else break;D=r(f)}}function k($){if(u=!1,w($),!m)if(r(l)!==null)m=!0,se(b);else{var D=r(f);D!==null&&Q(k,D.startTime-$)}}function b($,D){m=!1,u&&(u=!1,c(L),L=-1),g=!0;var H=x;try{for(w(D),y=r(l);y!==null&&(!(y.expirationTime>D)||$&&!ee());){var I=y.callback;if(typeof I=="function"){y.callback=null,x=y.priorityLevel;var A=I(y.expirationTime<=D);D=e.unstable_now(),typeof A=="function"?y.callback=A:y===r(l)&&n(l),w(D)}else n(l);y=r(l)}if(y!==null)var V=!0;else{var M=r(f);M!==null&&Q(k,M.startTime-D),V=!1}return V}finally{y=null,x=H,g=!1}}var N=!1,T=null,L=-1,O=5,F=-1;function ee(){return!(e.unstable_now()-F$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return r(l)},e.unstable_next=function($){switch(x){case 1:case 2:case 3:var D=3;break;default:D=x}var H=x;x=D;try{return $()}finally{x=H}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,D){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var H=x;x=$;try{return D()}finally{x=H}},e.unstable_scheduleCallback=function($,D,H){var I=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0I?($.sortIndex=H,t(f,$),r(l)===null&&$===r(f)&&(u?(c(L),L=-1):u=!0,Q(k,H-I))):($.sortIndex=A,t(l,$),m||g||(m=!0,se(b))),$},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function($){var D=x;return function(){var H=x;x=D;try{return $.apply(this,arguments)}finally{x=H}}}})(Td);Rd.exports=Td;var Hm=Rd.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Vm=Z,Ct=Hm;function ie(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qa=Object.prototype.hasOwnProperty,qm=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,mc={},gc={};function Km(e){return Qa.call(gc,e)?!0:Qa.call(mc,e)?!1:qm.test(e)?gc[e]=!0:(mc[e]=!0,!1)}function Xm(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Ym(e,t,r,n){if(t===null||typeof t>"u"||Xm(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ht(e,t,r,n,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var et={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){et[e]=new ht(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];et[t]=new ht(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){et[e]=new ht(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){et[e]=new ht(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){et[e]=new ht(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){et[e]=new ht(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){et[e]=new ht(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){et[e]=new ht(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){et[e]=new ht(e,5,!1,e.toLowerCase(),null,!1,!1)});var cu=/[\-:]([a-z])/g;function fu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(cu,fu);et[t]=new ht(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(cu,fu);et[t]=new ht(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(cu,fu);et[t]=new ht(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){et[e]=new ht(e,1,!1,e.toLowerCase(),null,!1,!1)});et.xlinkHref=new ht("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){et[e]=new ht(e,1,!1,e.toLowerCase(),null,!0,!0)});function du(e,t,r,n){var i=et.hasOwnProperty(t)?et[t]:null;(i!==null?i.type!==0:n||!(2a||i[o]!==s[a]){var l=` -`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{ma=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Pi(e):""}function Zm(e){switch(e.tag){case 5:return Pi(e.type);case 16:return Pi("Lazy");case 13:return Pi("Suspense");case 19:return Pi("SuspenseList");case 0:case 2:case 15:return e=ga(e.type,!1),e;case 11:return e=ga(e.type.render,!1),e;case 1:return e=ga(e.type,!0),e;default:return""}}function tl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Hn:return"Fragment";case Wn:return"Portal";case Ga:return"Profiler";case hu:return"StrictMode";case Ja:return"Suspense";case el:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ad:return(e.displayName||"Context")+".Consumer";case Id:return(e._context.displayName||"Context")+".Provider";case pu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case mu:return t=e.displayName||null,t!==null?t:tl(e.type)||"Memo";case $r:t=e._payload,e=e._init;try{return tl(e(t))}catch{}}return null}function Qm(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return tl(t);case 8:return t===hu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function on(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Gm(e){var t=zd(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Rs(e){e._valueTracker||(e._valueTracker=Gm(e))}function Ld(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=zd(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function mo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function rl(e,t){var r=t.checked;return Be({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function vc(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=on(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Pd(e,t){t=t.checked,t!=null&&du(e,"checked",t,!1)}function nl(e,t){Pd(e,t);var r=on(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?il(e,t.type,r):t.hasOwnProperty("defaultValue")&&il(e,t.type,on(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function wc(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function il(e,t,r){(t!=="number"||mo(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Fi=Array.isArray;function ri(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Ts.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Gi(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ui={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Jm=["Webkit","ms","Moz","O"];Object.keys(Ui).forEach(function(e){Jm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ui[t]=Ui[e]})});function Bd(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ui.hasOwnProperty(e)&&Ui[e]?(""+t).trim():t+"px"}function Ud(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=Bd(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var e0=Be({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function al(e,t){if(t){if(e0[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ie(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ie(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ie(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ie(62))}}function ll(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ul=null;function gu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cl=null,ni=null,ii=null;function kc(e){if(e=vs(e)){if(typeof cl!="function")throw Error(ie(280));var t=e.stateNode;t&&(t=Ko(t),cl(e.stateNode,e.type,t))}}function $d(e){ni?ii?ii.push(e):ii=[e]:ni=e}function Wd(){if(ni){var e=ni,t=ii;if(ii=ni=null,kc(e),t)for(e=0;e>>=0,e===0?32:31-(f0(e)/d0|0)|0}var Os=64,Is=4194304;function Di(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function wo(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,s=e.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=Di(a):(s&=o,s!==0&&(n=Di(s)))}else o=r&~i,o!==0?n=Di(o):s!==0&&(n=Di(s));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function gs(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Yt(t),e[t]=r}function g0(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=Wi),Ic=" ",Ac=!1;function uh(e,t){switch(e){case"keyup":return H0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ch(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Vn=!1;function q0(e,t){switch(e){case"compositionend":return ch(t);case"keypress":return t.which!==32?null:(Ac=!0,Ic);case"textInput":return e=t.data,e===Ic&&Ac?null:e;default:return null}}function K0(e,t){if(Vn)return e==="compositionend"||!bu&&uh(e,t)?(e=ah(),Gs=_u=Kr=null,Vn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Pc(r)}}function ph(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ph(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mh(){for(var e=window,t=mo();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=mo(e.document)}return t}function Eu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function rg(e){var t=mh(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&ph(r.ownerDocument.documentElement,r)){if(n!==null&&Eu(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!e.extend&&s>n&&(i=n,n=s,s=i),i=Fc(r,s);var o=Fc(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,qn=null,gl=null,Vi=null,yl=!1;function Dc(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;yl||qn==null||qn!==mo(n)||(n=qn,"selectionStart"in n&&Eu(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Vi&&is(Vi,n)||(Vi=n,n=ko(gl,"onSelect"),0Yn||(e.current=Sl[Yn],Sl[Yn]=null,Yn--)}function Oe(e,t){Yn++,Sl[Yn]=e.current,e.current=t}var an={},ot=un(an),gt=un(!1),En=an;function ci(e,t){var r=e.type.contextTypes;if(!r)return an;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=t[s];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function yt(e){return e=e.childContextTypes,e!=null}function bo(){Le(gt),Le(ot)}function Vc(e,t,r){if(ot.current!==an)throw Error(ie(168));Oe(ot,t),Oe(gt,r)}function bh(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(ie(108,Qm(e)||"Unknown",i));return Be({},r,n)}function Eo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||an,En=ot.current,Oe(ot,e),Oe(gt,gt.current),!0}function qc(e,t,r){var n=e.stateNode;if(!n)throw Error(ie(169));r?(e=bh(e,t,En),n.__reactInternalMemoizedMergedChildContext=e,Le(gt),Le(ot),Oe(ot,e)):Le(gt),Oe(gt,r)}var Er=null,Xo=!1,Oa=!1;function Eh(e){Er===null?Er=[e]:Er.push(e)}function pg(e){Xo=!0,Eh(e)}function cn(){if(!Oa&&Er!==null){Oa=!0;var e=0,t=Re;try{var r=Er;for(Re=1;e>=o,i-=o,Nr=1<<32-Yt(t)+i|r<L?(O=T,T=null):O=T.sibling;var F=x(c,T,w[L],k);if(F===null){T===null&&(T=O);break}e&&T&&F.alternate===null&&t(c,T),d=s(F,d,L),N===null?b=F:N.sibling=F,N=F,T=O}if(L===w.length)return r(c,T),Fe&&mn(c,L),b;if(T===null){for(;LL?(O=T,T=null):O=T.sibling;var ee=x(c,T,F.value,k);if(ee===null){T===null&&(T=O);break}e&&T&&ee.alternate===null&&t(c,T),d=s(ee,d,L),N===null?b=ee:N.sibling=ee,N=ee,T=O}if(F.done)return r(c,T),Fe&&mn(c,L),b;if(T===null){for(;!F.done;L++,F=w.next())F=y(c,F.value,k),F!==null&&(d=s(F,d,L),N===null?b=F:N.sibling=F,N=F);return Fe&&mn(c,L),b}for(T=n(c,T);!F.done;L++,F=w.next())F=g(T,c,L,F.value,k),F!==null&&(e&&F.alternate!==null&&T.delete(F.key===null?L:F.key),d=s(F,d,L),N===null?b=F:N.sibling=F,N=F);return e&&T.forEach(function(R){return t(c,R)}),Fe&&mn(c,L),b}function v(c,d,w,k){if(typeof w=="object"&&w!==null&&w.type===Hn&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Ns:e:{for(var b=w.key,N=d;N!==null;){if(N.key===b){if(b=w.type,b===Hn){if(N.tag===7){r(c,N.sibling),d=i(N,w.props.children),d.return=c,c=d;break e}}else if(N.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===$r&&Yc(b)===N.type){r(c,N.sibling),d=i(N,w.props),d.ref=Ii(c,N,w),d.return=c,c=d;break e}r(c,N);break}else t(c,N);N=N.sibling}w.type===Hn?(d=Sn(w.props.children,c.mode,k,w.key),d.return=c,c=d):(k=oo(w.type,w.key,w.props,null,c.mode,k),k.ref=Ii(c,d,w),k.return=c,c=k)}return o(c);case Wn:e:{for(N=w.key;d!==null;){if(d.key===N)if(d.tag===4&&d.stateNode.containerInfo===w.containerInfo&&d.stateNode.implementation===w.implementation){r(c,d.sibling),d=i(d,w.children||[]),d.return=c,c=d;break e}else{r(c,d);break}else t(c,d);d=d.sibling}d=Da(w,c.mode,k),d.return=c,c=d}return o(c);case $r:return N=w._init,v(c,d,N(w._payload),k)}if(Fi(w))return m(c,d,w,k);if(Ci(w))return u(c,d,w,k);Ds(c,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,d!==null&&d.tag===6?(r(c,d.sibling),d=i(d,w),d.return=c,c=d):(r(c,d),d=Fa(w,c.mode,k),d.return=c,c=d),o(c)):r(c,d)}return v}var di=Th(!0),Oh=Th(!1),Ro=un(null),To=null,Gn=null,Tu=null;function Ou(){Tu=Gn=To=null}function Iu(e){var t=Ro.current;Le(Ro),e._currentValue=t}function Cl(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function oi(e,t){To=e,Tu=Gn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(mt=!0),e.firstContext=null)}function Bt(e){var t=e._currentValue;if(Tu!==e)if(e={context:e,memoizedValue:t,next:null},Gn===null){if(To===null)throw Error(ie(308));Gn=e,To.dependencies={lanes:0,firstContext:e}}else Gn=Gn.next=e;return t}var wn=null;function Au(e){wn===null?wn=[e]:wn.push(e)}function Ih(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,Au(t)):(r.next=i.next,i.next=r),t.interleaved=r,Ar(e,n)}function Ar(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Wr=!1;function ju(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ah(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Tr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Jr(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Ce&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,Ar(e,r)}return i=n.interleaved,i===null?(t.next=t,Au(n)):(t.next=i.next,i.next=t),n.interleaved=t,Ar(e,r)}function eo(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,vu(e,r)}}function Zc(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=o:s=s.next=o,r=r.next}while(r!==null);s===null?i=s=t:s=s.next=t}else i=s=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Oo(e,t,r,n){var i=e.updateQueue;Wr=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,f=l.next;l.next=null,o===null?s=f:o.next=f,o=l;var p=e.alternate;p!==null&&(p=p.updateQueue,a=p.lastBaseUpdate,a!==o&&(a===null?p.firstBaseUpdate=f:a.next=f,p.lastBaseUpdate=l))}if(s!==null){var y=i.baseState;o=0,p=f=l=null,a=s;do{var x=a.lane,g=a.eventTime;if((n&x)===x){p!==null&&(p=p.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,u=a;switch(x=t,g=r,u.tag){case 1:if(m=u.payload,typeof m=="function"){y=m.call(g,y,x);break e}y=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=u.payload,x=typeof m=="function"?m.call(g,y,x):m,x==null)break e;y=Be({},y,x);break e;case 2:Wr=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,x=i.effects,x===null?i.effects=[a]:x.push(a))}else g={eventTime:g,lane:x,tag:a.tag,payload:a.payload,callback:a.callback,next:null},p===null?(f=p=g,l=y):p=p.next=g,o|=x;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;x=a,a=x.next,x.next=null,i.lastBaseUpdate=x,i.shared.pending=null}}while(!0);if(p===null&&(l=y),i.baseState=l,i.firstBaseUpdate=f,i.lastBaseUpdate=p,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Rn|=o,e.lanes=o,e.memoizedState=y}}function Qc(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Aa.transition;Aa.transition={};try{e(!1),t()}finally{Re=r,Aa.transition=n}}function Yh(){return Ut().memoizedState}function vg(e,t,r){var n=tn(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Zh(e))Qh(t,r);else if(r=Ih(e,t,r,n),r!==null){var i=ft();Zt(r,e,n,i),Gh(r,t,n)}}function wg(e,t,r){var n=tn(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Zh(e))Qh(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,Qt(a,o)){var l=t.interleaved;l===null?(i.next=i,Au(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=Ih(e,t,i,n),r!==null&&(i=ft(),Zt(r,e,n,i),Gh(r,t,n))}}function Zh(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function Qh(e,t){qi=Ao=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Gh(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,vu(e,r)}}var jo={readContext:Bt,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useInsertionEffect:rt,useLayoutEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useMutableSource:rt,useSyncExternalStore:rt,useId:rt,unstable_isNewReconciler:!1},xg={readContext:Bt,useCallback:function(e,t){return ar().memoizedState=[e,t===void 0?null:t],e},useContext:Bt,useEffect:Jc,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ro(4194308,4,Hh.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ro(4194308,4,e,t)},useInsertionEffect:function(e,t){return ro(4,2,e,t)},useMemo:function(e,t){var r=ar();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ar();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=vg.bind(null,Me,e),[n.memoizedState,e]},useRef:function(e){var t=ar();return e={current:e},t.memoizedState=e},useState:Gc,useDebugValue:Uu,useDeferredValue:function(e){return ar().memoizedState=e},useTransition:function(){var e=Gc(!1),t=e[0];return e=yg.bind(null,e[1]),ar().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Me,i=ar();if(Fe){if(r===void 0)throw Error(ie(407));r=r()}else{if(r=t(),Qe===null)throw Error(ie(349));Nn&30||Ph(n,t,r)}i.memoizedState=r;var s={value:r,getSnapshot:t};return i.queue=s,Jc(Dh.bind(null,n,s,e),[e]),n.flags|=2048,ds(9,Fh.bind(null,n,s,r,t),void 0,null),r},useId:function(){var e=ar(),t=Qe.identifierPrefix;if(Fe){var r=Rr,n=Nr;r=(n&~(1<<32-Yt(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=cs++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[lr]=t,e[as]=n,lp(e,t,!1,!1),t.stateNode=e;e:{switch(o=ll(r,n),r){case"dialog":ze("cancel",e),ze("close",e),i=n;break;case"iframe":case"object":case"embed":ze("load",e),i=n;break;case"video":case"audio":for(i=0;imi&&(t.flags|=128,n=!0,Ai(s,!1),t.lanes=4194304)}else{if(!n)if(e=Io(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ai(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Fe)return nt(t),null}else 2*He()-s.renderingStartTime>mi&&r!==1073741824&&(t.flags|=128,n=!0,Ai(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(r=s.last,r!==null?r.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=He(),t.sibling=null,r=De.current,Oe(De,n?r&1|2:r&1),t):(nt(t),null);case 22:case 23:return Ku(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?St&1073741824&&(nt(t),t.subtreeFlags&6&&(t.flags|=8192)):nt(t),null;case 24:return null;case 25:return null}throw Error(ie(156,t.tag))}function Rg(e,t){switch(Nu(t),t.tag){case 1:return yt(t.type)&&bo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hi(),Le(gt),Le(ot),Pu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Lu(t),null;case 13:if(Le(De),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ie(340));fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Le(De),null;case 4:return hi(),null;case 10:return Iu(t.type._context),null;case 22:case 23:return Ku(),null;case 24:return null;default:return null}}var Bs=!1,it=!1,Tg=typeof WeakSet=="function"?WeakSet:Set,de=null;function Jn(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Ue(e,t,n)}else r.current=null}function Ll(e,t,r){try{r()}catch(n){Ue(e,t,n)}}var ff=!1;function Og(e,t){if(vl=xo,e=mh(),Eu(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,l=-1,f=0,p=0,y=e,x=null;t:for(;;){for(var g;y!==r||i!==0&&y.nodeType!==3||(a=o+i),y!==s||n!==0&&y.nodeType!==3||(l=o+n),y.nodeType===3&&(o+=y.nodeValue.length),(g=y.firstChild)!==null;)x=y,y=g;for(;;){if(y===e)break t;if(x===r&&++f===i&&(a=o),x===s&&++p===n&&(l=o),(g=y.nextSibling)!==null)break;y=x,x=y.parentNode}y=g}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(wl={focusedElem:e,selectionRange:r},xo=!1,de=t;de!==null;)if(t=de,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,de=e;else for(;de!==null;){t=de;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var u=m.memoizedProps,v=m.memoizedState,c=t.stateNode,d=c.getSnapshotBeforeUpdate(t.elementType===t.type?u:Vt(t.type,u),v);c.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ie(163))}}catch(k){Ue(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,de=e;break}de=t.return}return m=ff,ff=!1,m}function Ki(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Ll(t,r,s)}i=i.next}while(i!==n)}}function Qo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Pl(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function fp(e){var t=e.alternate;t!==null&&(e.alternate=null,fp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[lr],delete t[as],delete t[kl],delete t[dg],delete t[hg])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function dp(e){return e.tag===5||e.tag===3||e.tag===4}function df(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Fl(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=So));else if(n!==4&&(e=e.child,e!==null))for(Fl(e,t,r),e=e.sibling;e!==null;)Fl(e,t,r),e=e.sibling}function Dl(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Dl(e,t,r),e=e.sibling;e!==null;)Dl(e,t,r),e=e.sibling}var Ge=null,qt=!1;function Ur(e,t,r){for(r=r.child;r!==null;)hp(e,t,r),r=r.sibling}function hp(e,t,r){if(ur&&typeof ur.onCommitFiberUnmount=="function")try{ur.onCommitFiberUnmount(Wo,r)}catch{}switch(r.tag){case 5:it||Jn(r,t);case 6:var n=Ge,i=qt;Ge=null,Ur(e,t,r),Ge=n,qt=i,Ge!==null&&(qt?(e=Ge,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ge.removeChild(r.stateNode));break;case 18:Ge!==null&&(qt?(e=Ge,r=r.stateNode,e.nodeType===8?Ta(e.parentNode,r):e.nodeType===1&&Ta(e,r),rs(e)):Ta(Ge,r.stateNode));break;case 4:n=Ge,i=qt,Ge=r.stateNode.containerInfo,qt=!0,Ur(e,t,r),Ge=n,qt=i;break;case 0:case 11:case 14:case 15:if(!it&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Ll(r,t,o),i=i.next}while(i!==n)}Ur(e,t,r);break;case 1:if(!it&&(Jn(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Ue(r,t,a)}Ur(e,t,r);break;case 21:Ur(e,t,r);break;case 22:r.mode&1?(it=(n=it)||r.memoizedState!==null,Ur(e,t,r),it=n):Ur(e,t,r);break;default:Ur(e,t,r)}}function hf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Tg),t.forEach(function(n){var i=Mg.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Ht(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=He()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Ag(n/1960))-n,10e?16:e,Xr===null)var n=!1;else{if(e=Xr,Xr=null,Po=0,Ce&6)throw Error(ie(331));var i=Ce;for(Ce|=4,de=e.current;de!==null;){var s=de,o=s.child;if(de.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lHe()-Vu?kn(e,0):Hu|=r),vt(e,t)}function _p(e,t){t===0&&(e.mode&1?(t=Is,Is<<=1,!(Is&130023424)&&(Is=4194304)):t=1);var r=ft();e=Ar(e,t),e!==null&&(gs(e,t,r),vt(e,r))}function Dg(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),_p(e,r)}function Mg(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ie(314))}n!==null&&n.delete(t),_p(e,r)}var kp;kp=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||gt.current)mt=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return mt=!1,Cg(e,t,r);mt=!!(e.flags&131072)}else mt=!1,Fe&&t.flags&1048576&&Ch(t,No,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;no(e,t),e=t.pendingProps;var i=ci(t,ot.current);oi(t,r),i=Du(null,t,n,e,i,r);var s=Mu();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,yt(n)?(s=!0,Eo(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,ju(t),i.updater=Zo,t.stateNode=i,i._reactInternals=t,Rl(t,n,e,r),t=Il(null,t,n,!0,s,r)):(t.tag=0,Fe&&s&&Cu(t),ct(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(no(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=Ug(n),e=Vt(n,e),i){case 0:t=Ol(null,t,n,e,r);break e;case 1:t=lf(null,t,n,e,r);break e;case 11:t=of(null,t,n,e,r);break e;case 14:t=af(null,t,n,Vt(n.type,e),r);break e}throw Error(ie(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Vt(n,i),Ol(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Vt(n,i),lf(e,t,n,i,r);case 3:e:{if(sp(t),e===null)throw Error(ie(387));n=t.pendingProps,s=t.memoizedState,i=s.element,Ah(e,t),Oo(t,n,null,r);var o=t.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=pi(Error(ie(423)),t),t=uf(e,t,n,r,i);break e}else if(n!==i){i=pi(Error(ie(424)),t),t=uf(e,t,n,r,i);break e}else for(bt=Gr(t.stateNode.containerInfo.firstChild),Et=t,Fe=!0,Xt=null,r=Oh(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(fi(),n===i){t=jr(e,t,r);break e}ct(e,t,n,r)}t=t.child}return t;case 5:return jh(t),e===null&&El(t),n=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,xl(n,i)?o=null:s!==null&&xl(n,s)&&(t.flags|=32),ip(e,t),ct(e,t,o,r),t.child;case 6:return e===null&&El(t),null;case 13:return op(e,t,r);case 4:return zu(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=di(t,null,n,r):ct(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Vt(n,i),of(e,t,n,i,r);case 7:return ct(e,t,t.pendingProps,r),t.child;case 8:return ct(e,t,t.pendingProps.children,r),t.child;case 12:return ct(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,Oe(Ro,n._currentValue),n._currentValue=o,s!==null)if(Qt(s.value,o)){if(s.children===i.children&&!gt.current){t=jr(e,t,r);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(s.tag===1){l=Tr(-1,r&-r),l.tag=2;var f=s.updateQueue;if(f!==null){f=f.shared;var p=f.pending;p===null?l.next=l:(l.next=p.next,p.next=l),f.pending=l}}s.lanes|=r,l=s.alternate,l!==null&&(l.lanes|=r),Cl(s.return,r,t),a.lanes|=r;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(ie(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),Cl(o,r,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}ct(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,oi(t,r),i=Bt(i),n=n(i),t.flags|=1,ct(e,t,n,r),t.child;case 14:return n=t.type,i=Vt(n,t.pendingProps),i=Vt(n.type,i),af(e,t,n,i,r);case 15:return rp(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Vt(n,i),no(e,t),t.tag=1,yt(n)?(e=!0,Eo(t)):e=!1,oi(t,r),Jh(t,n,i),Rl(t,n,i,r),Il(null,t,n,!0,e,r);case 19:return ap(e,t,r);case 22:return np(e,t,r)}throw Error(ie(156,t.tag))};function Sp(e,t){return Zd(e,t)}function Bg(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Dt(e,t,r,n){return new Bg(e,t,r,n)}function Yu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ug(e){if(typeof e=="function")return Yu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===pu)return 11;if(e===mu)return 14}return 2}function rn(e,t){var r=e.alternate;return r===null?(r=Dt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function oo(e,t,r,n,i,s){var o=2;if(n=e,typeof e=="function")Yu(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Hn:return Sn(r.children,i,s,t);case hu:o=8,i|=8;break;case Ga:return e=Dt(12,r,t,i|2),e.elementType=Ga,e.lanes=s,e;case Ja:return e=Dt(13,r,t,i),e.elementType=Ja,e.lanes=s,e;case el:return e=Dt(19,r,t,i),e.elementType=el,e.lanes=s,e;case jd:return Jo(r,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Id:o=10;break e;case Ad:o=9;break e;case pu:o=11;break e;case mu:o=14;break e;case $r:o=16,n=null;break e}throw Error(ie(130,e==null?e:typeof e,""))}return t=Dt(o,r,t,i),t.elementType=e,t.type=n,t.lanes=s,t}function Sn(e,t,r,n){return e=Dt(7,e,n,t),e.lanes=r,e}function Jo(e,t,r,n){return e=Dt(22,e,n,t),e.elementType=jd,e.lanes=r,e.stateNode={isHidden:!1},e}function Fa(e,t,r){return e=Dt(6,e,null,t),e.lanes=r,e}function Da(e,t,r){return t=Dt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function $g(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=va(0),this.expirationTimes=va(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=va(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Zu(e,t,r,n,i,s,o,a,l){return e=new $g(e,t,r,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Dt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},ju(s),e}function Wg(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Np)}catch(e){console.error(e)}}Np(),Nd.exports=Nt;var Rp=Nd.exports,_f=Rp;Za.createRoot=_f.createRoot,Za.hydrateRoot=_f.hydrateRoot;const dr=Object.create(null);dr.open="0";dr.close="1";dr.ping="2";dr.pong="3";dr.message="4";dr.upgrade="5";dr.noop="6";const ao=Object.create(null);Object.keys(dr).forEach(e=>{ao[dr[e]]=e});const Wl={type:"error",data:"parser error"},Tp=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Op=typeof ArrayBuffer=="function",Ip=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,ec=({type:e,data:t},r,n)=>Tp&&t instanceof Blob?r?n(t):kf(t,n):Op&&(t instanceof ArrayBuffer||Ip(t))?r?n(t):kf(new Blob([t]),n):n(dr[e]+(t||"")),kf=(e,t)=>{const r=new FileReader;return r.onload=function(){const n=r.result.split(",")[1];t("b"+(n||""))},r.readAsDataURL(e)};function Sf(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Ma;function Xg(e,t){if(Tp&&e.data instanceof Blob)return e.data.arrayBuffer().then(Sf).then(t);if(Op&&(e.data instanceof ArrayBuffer||Ip(e.data)))return t(Sf(e.data));ec(e,!1,r=>{Ma||(Ma=new TextEncoder),t(Ma.encode(r))})}const bf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bi=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,r=e.length,n,i=0,s,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const f=new ArrayBuffer(t),p=new Uint8Array(f);for(n=0;n>4,p[i++]=(o&15)<<4|a>>2,p[i++]=(a&3)<<6|l&63;return f},Zg=typeof ArrayBuffer=="function",tc=(e,t)=>{if(typeof e!="string")return{type:"message",data:Ap(e,t)};const r=e.charAt(0);return r==="b"?{type:"message",data:Qg(e.substring(1),t)}:ao[r]?e.length>1?{type:ao[r],data:e.substring(1)}:{type:ao[r]}:Wl},Qg=(e,t)=>{if(Zg){const r=Yg(e);return Ap(r,t)}else return{base64:!0,data:e}},Ap=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},jp="",Gg=(e,t)=>{const r=e.length,n=new Array(r);let i=0;e.forEach((s,o)=>{ec(s,!1,a=>{n[o]=a,++i===r&&t(n.join(jp))})})},Jg=(e,t)=>{const r=e.split(jp),n=[];for(let i=0;i{const n=r.length;let i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,n)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(n))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(r)})}})}let Ba;function Ws(e){return e.reduce((t,r)=>t+r.length,0)}function Hs(e,t){if(e[0].length===t)return e.shift();const r=new Uint8Array(t);let n=0;for(let i=0;iMath.pow(2,21)-1){a.enqueue(Wl);break}i=p*Math.pow(2,32)+f.getUint32(4),n=3}else{if(Ws(r)e){a.enqueue(Wl);break}}}})}const zp=4;function qe(e){if(e)return ry(e)}function ry(e){for(var t in qe.prototype)e[t]=qe.prototype[t];return e}qe.prototype.on=qe.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};qe.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this};qe.prototype.off=qe.prototype.removeListener=qe.prototype.removeAllListeners=qe.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+e];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var n,i=0;iPromise.resolve().then(t):(t,r)=>r(t,0),Pt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),ny="arraybuffer";function Lp(e,...t){return t.reduce((r,n)=>(e.hasOwnProperty(n)&&(r[n]=e[n]),r),{})}const iy=Pt.setTimeout,sy=Pt.clearTimeout;function sa(e,t){t.useNativeTimers?(e.setTimeoutFn=iy.bind(Pt),e.clearTimeoutFn=sy.bind(Pt)):(e.setTimeoutFn=Pt.setTimeout.bind(Pt),e.clearTimeoutFn=Pt.clearTimeout.bind(Pt))}const oy=1.33;function ay(e){return typeof e=="string"?ly(e):Math.ceil((e.byteLength||e.size)*oy)}function ly(e){let t=0,r=0;for(let n=0,i=e.length;n=57344?r+=3:(n++,r+=4);return r}function Pp(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function uy(e){let t="";for(let r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t}function cy(e){let t={},r=e.split("&");for(let n=0,i=r.length;n{this.readyState="paused",t()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||r()})),this.writable||(n++,this.once("drain",function(){--n||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const r=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};Jg(t,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,Gg(t,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=Pp()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(t,r)}}let Fp=!1;try{Fp=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const hy=Fp;function py(){}class my extends dy{constructor(t){if(super(t),typeof location<"u"){const r=location.protocol==="https:";let n=location.port;n||(n=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||n!==t.port}}doWrite(t,r){const n=this.request({method:"POST",data:t});n.on("success",r),n.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(r,n)=>{this.onError("xhr poll error",r,n)}),this.pollXhr=t}}class fr extends qe{constructor(t,r,n){super(),this.createRequest=t,sa(this,n),this._opts=n,this._method=n.method||"GET",this._uri=r,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var t;const r=Lp(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(r);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&n.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var i;n.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=fr.requestsCount++,fr.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=py,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete fr.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}fr.requestsCount=0;fr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Ef);else if(typeof addEventListener=="function"){const e="onpagehide"in Pt?"pagehide":"unload";addEventListener(e,Ef,!1)}}function Ef(){for(let e in fr.requests)fr.requests.hasOwnProperty(e)&&fr.requests[e].abort()}const gy=function(){const e=Dp({xdomain:!1});return e&&e.responseType!==null}();class yy extends my{constructor(t){super(t);const r=t&&t.forceBase64;this.supportsBinary=gy&&!r}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new fr(Dp,this.uri(),t)}}function Dp(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||hy))return new XMLHttpRequest}catch{}if(!t)try{return new Pt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Mp=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class vy extends rc{get name(){return"websocket"}doOpen(){const t=this.uri(),r=this.opts.protocols,n=Mp?{}:Lp(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,r,n)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let r=0;r{try{this.doWrite(n,s)}catch{}i&&ia(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=Pp()),this.supportsBinary||(r.b64=1),this.createUri(t,r)}}const Ua=Pt.WebSocket||Pt.MozWebSocket;class wy extends vy{createSocket(t,r,n){return Mp?new Ua(t,r,n):r?new Ua(t,r):new Ua(t)}doWrite(t,r){this.ws.send(r)}}class xy extends rc{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const r=ty(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=t.readable.pipeThrough(r).getReader(),i=ey();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const s=()=>{n.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let r=0;r{i&&ia(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const _y={websocket:wy,webtransport:xy,polling:yy},ky=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Sy=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Hl(e){if(e.length>8e3)throw"URI too long";const t=e,r=e.indexOf("["),n=e.indexOf("]");r!=-1&&n!=-1&&(e=e.substring(0,r)+e.substring(r,n).replace(/:/g,";")+e.substring(n,e.length));let i=ky.exec(e||""),s={},o=14;for(;o--;)s[Sy[o]]=i[o]||"";return r!=-1&&n!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=by(s,s.path),s.queryKey=Ey(s,s.query),s}function by(e,t){const r=/\/{2,9}/g,n=t.replace(r,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&n.splice(0,1),t.slice(-1)=="/"&&n.splice(n.length-1,1),n}function Ey(e,t){const r={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,i,s){i&&(r[i]=s)}),r}const Vl=typeof addEventListener=="function"&&typeof removeEventListener=="function",lo=[];Vl&&addEventListener("offline",()=>{lo.forEach(e=>e())},!1);class nn extends qe{constructor(t,r){if(super(),this.binaryType=ny,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(r=t,t=null),t){const n=Hl(t);r.hostname=n.host,r.secure=n.protocol==="https"||n.protocol==="wss",r.port=n.port,n.query&&(r.query=n.query)}else r.host&&(r.hostname=Hl(r.host).host);sa(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(n=>{const i=n.prototype.name;this.transports.push(i),this._transportsByName[i]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=cy(this.opts.query)),Vl&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},lo.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const r=Object.assign({},this.opts.query);r.EIO=zp,r.transport=t,this.id&&(r.sid=this.id);const n=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&nn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(t);r.open(),this.setTransport(r)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",nn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=t.data,this._onError(r);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let n=0;n0&&r>this._maxPayload)return this.writeBuffer.slice(0,n);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,ia(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,r,n){return this._sendPacket("message",t,r,n),this}send(t,r,n){return this._sendPacket("message",t,r,n),this}_sendPacket(t,r,n,i){if(typeof r=="function"&&(i=r,r=void 0),typeof n=="function"&&(i=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const s={type:t,data:r,options:n};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),t()},n=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():t()}):this.upgrading?n():t()),this}_onError(t){if(nn.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Vl&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=lo.indexOf(this._offlineEventListener);n!==-1&&lo.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,r),this.writeBuffer=[],this._prevBufferLen=0}}}nn.protocol=zp;class Cy extends nn{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t{n||(r.send([{type:"ping",data:"probe"}]),r.once("packet",y=>{if(!n)if(y.type==="pong"&&y.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;nn.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(p(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const x=new Error("probe error");x.transport=r.name,this.emitReserved("upgradeError",x)}}))};function s(){n||(n=!0,p(),r.close(),r=null)}const o=y=>{const x=new Error("probe error: "+y);x.transport=r.name,s(),this.emitReserved("upgradeError",x)};function a(){o("transport closed")}function l(){o("socket closed")}function f(y){r&&y.name!==r.name&&s()}const p=()=>{r.removeListener("open",i),r.removeListener("error",o),r.removeListener("close",a),this.off("close",l),this.off("upgrading",f)};r.once("open",i),r.once("error",o),r.once("close",a),this.once("close",l),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{n||r.open()},200):r.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const r=[];for(let n=0;n_y[i]).filter(i=>!!i)),super(t,n)}};function Ry(e,t="",r){let n=e;r=r||typeof location<"u"&&location,e==null&&(e=r.protocol+"//"+r.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=r.protocol+e:e=r.host+e),/^(https?|wss?):\/\//.test(e)||(typeof r<"u"?e=r.protocol+"//"+e:e="https://"+e),n=Hl(e)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const s=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+s+":"+n.port+t,n.href=n.protocol+"://"+s+(r&&r.port===n.port?"":":"+n.port),n}const Ty=typeof ArrayBuffer=="function",Oy=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Bp=Object.prototype.toString,Iy=typeof Blob=="function"||typeof Blob<"u"&&Bp.call(Blob)==="[object BlobConstructor]",Ay=typeof File=="function"||typeof File<"u"&&Bp.call(File)==="[object FileConstructor]";function nc(e){return Ty&&(e instanceof ArrayBuffer||Oy(e))||Iy&&e instanceof Blob||Ay&&e instanceof File}function uo(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let r=0,n=e.length;r=0&&e.num{delete this.acks[t];for(let a=0;a{this.io.clearTimeoutFn(s),r.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...r){return new Promise((n,i)=>{const s=(o,a)=>o?i(o):n(a);s.withError=!0,r.push(s),this.emit(t,...r)})}_addToQueue(t){let r;typeof t[t.length-1]=="function"&&(r=t.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>n!==this._queue[0]?void 0:(i!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(i)):(this._queue.shift(),r&&r(null,...s)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!t||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Ee.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(n=>String(n.id)===t)){const n=this.acks[t];delete this.acks[t],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Ee.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ee.EVENT:case Ee.BINARY_EVENT:this.onevent(t);break;case Ee.ACK:case Ee.BINARY_ACK:this.onack(t);break;case Ee.DISCONNECT:this.ondisconnect();break;case Ee.CONNECT_ERROR:this.destroy();const n=new Error(t.data.message);n.data=t.data.data,this.emitReserved("connect_error",n);break}}onevent(t){const r=t.data||[];t.id!=null&&r.push(this.ack(t.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const n of r)n.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const r=this;let n=!1;return function(...i){n||(n=!0,r.packet({type:Ee.ACK,id:t,data:i}))}}onack(t){const r=this.acks[t.id];typeof r=="function"&&(delete this.acks[t.id],r.withError&&t.data.unshift(null),r.apply(this,t.data))}onconnect(t,r){this.id=t,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ee.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const r=this._anyListeners;for(let n=0;n0&&e.jitter<=1?e.jitter:0,this.attempts=0}_i.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+r:e-r}return Math.min(e,this.max)|0};_i.prototype.reset=function(){this.attempts=0};_i.prototype.setMin=function(e){this.ms=e};_i.prototype.setMax=function(e){this.max=e};_i.prototype.setJitter=function(e){this.jitter=e};class Xl extends qe{constructor(t,r){var n;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(r=t,t=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,sa(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((n=r.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new _i({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=t;const i=r.parser||My;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var r;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(r=this.backoff)===null||r===void 0||r.setMin(t),this)}randomizationFactor(t){var r;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(r=this.backoff)===null||r===void 0||r.setJitter(t),this)}reconnectionDelayMax(t){var r;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(r=this.backoff)===null||r===void 0||r.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Ny(this.uri,this.opts);const r=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const i=Kt(r,"open",function(){n.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=Kt(r,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),r.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Kt(t,"ping",this.onping.bind(this)),Kt(t,"data",this.ondata.bind(this)),Kt(t,"error",this.onerror.bind(this)),Kt(t,"close",this.onclose.bind(this)),Kt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(r){this.onclose("parse error",r)}}ondecoded(t){ia(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,r){let n=this.nsps[t];return n?this._autoConnect&&!n.active&&n.connect():(n=new Up(this,t,r),this.nsps[t]=n),n}_destroy(t){const r=Object.keys(this.nsps);for(const n of r)if(this.nsps[n].active)return;this._close()}_packet(t){const r=this.encoder.encode(t);for(let n=0;nt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,r){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},r);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const zi={};function co(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const r=Ry(e,t.path||"/socket.io"),n=r.source,i=r.id,s=r.path,o=zi[i]&&s in zi[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new Xl(n,t):(zi[i]||(zi[i]=new Xl(n,t)),l=zi[i]),r.query&&!t.query&&(t.query=r.queryKey),l.socket(r.path,t)}Object.assign(co,{Manager:Xl,Socket:Up,io:co,connect:co});const Uy={},Nf=e=>{let t;const r=new Set,n=(p,y)=>{const x=typeof p=="function"?p(t):p;if(!Object.is(x,t)){const g=t;t=y??(typeof x!="object"||x===null)?x:Object.assign({},t,x),r.forEach(m=>m(t,g))}},i=()=>t,l={setState:n,getState:i,getInitialState:()=>f,subscribe:p=>(r.add(p),()=>r.delete(p)),destroy:()=>{(Uy?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},f=t=e(n,i,l);return l},$y=e=>e?Nf(e):Nf;var $p={exports:{}},Wp={},Hp={exports:{}},Vp={};/** - * @license React - * use-sync-external-store-shim.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 gi=Z;function Wy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Hy=typeof Object.is=="function"?Object.is:Wy,Vy=gi.useState,qy=gi.useEffect,Ky=gi.useLayoutEffect,Xy=gi.useDebugValue;function Yy(e,t){var r=t(),n=Vy({inst:{value:r,getSnapshot:t}}),i=n[0].inst,s=n[1];return Ky(function(){i.value=r,i.getSnapshot=t,$a(i)&&s({inst:i})},[e,r,t]),qy(function(){return $a(i)&&s({inst:i}),e(function(){$a(i)&&s({inst:i})})},[e]),Xy(r),r}function $a(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Hy(e,r)}catch{return!0}}function Zy(e,t){return t()}var Qy=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Zy:Yy;Vp.useSyncExternalStore=gi.useSyncExternalStore!==void 0?gi.useSyncExternalStore:Qy;Hp.exports=Vp;var Gy=Hp.exports;/** - * @license React - * use-sync-external-store-shim/with-selector.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 oa=Z,Jy=Gy;function ev(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var tv=typeof Object.is=="function"?Object.is:ev,rv=Jy.useSyncExternalStore,nv=oa.useRef,iv=oa.useEffect,sv=oa.useMemo,ov=oa.useDebugValue;Wp.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var s=nv(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=sv(function(){function l(g){if(!f){if(f=!0,p=g,g=n(g),i!==void 0&&o.hasValue){var m=o.value;if(i(m,g))return y=m}return y=g}if(m=y,tv(p,g))return m;var u=n(g);return i!==void 0&&i(m,u)?(p=g,m):(p=g,y=u)}var f=!1,p,y,x=r===void 0?null:r;return[function(){return l(t())},x===null?void 0:function(){return l(x())}]},[t,r,n,i]);var a=rv(e,s[0],s[1]);return iv(function(){o.hasValue=!0,o.value=a},[a]),ov(a),a};$p.exports=Wp;var av=$p.exports;const lv=su(av),qp={},{useDebugValue:uv}=ke,{useSyncExternalStoreWithSelector:cv}=lv;let Rf=!1;const fv=e=>e;function dv(e,t=fv,r){(qp?"production":void 0)!=="production"&&r&&!Rf&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Rf=!0);const n=cv(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return uv(n),n}const Tf=e=>{(qp?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?$y(e):e,r=(n,i)=>dv(t,n,i);return Object.assign(r,t),r},hv=e=>e?Tf(e):Tf,me=hv((e,t)=>({theme:"light",setTheme:r=>e({theme:r}),toggleTheme:()=>e(r=>({theme:r.theme==="light"?"dark":"light"})),libraries:[],currentLibraryId:null,setLibraries:r=>e({libraries:r}),setCurrentLibrary:r=>e({currentLibraryId:r}),addLibrary:r=>e(n=>({libraries:[...n.libraries,r]})),removeLibrary:r=>e(n=>({libraries:n.libraries.filter(i=>i.id!==r),currentLibraryId:n.currentLibraryId===r?null:n.currentLibraryId})),images:[],filteredImages:[],totalImageCount:0,setImages:r=>e({images:r,filteredImages:r}),setFilteredImages:r=>e({filteredImages:r}),setTotalImageCount:r=>e({totalImageCount:r}),imageLoadingState:{isLoading:!1,loadedCount:0,totalCount:0,hasMore:!1},setImageLoadingState:r=>e(n=>({imageLoadingState:{...n.imageLoadingState,...r}})),appendImages:r=>e(n=>({images:[...n.images,...r],filteredImages:[...n.filteredImages,...r]})),folders:[],selectedFolder:null,setFolders:r=>e({folders:r}),setSelectedFolder:r=>e({selectedFolder:r}),searchKeywords:"",filters:{formats:[],minSize:null,maxSize:null,startDate:null,endDate:null},setSearchKeywords:r=>e({searchKeywords:r}),setFilters:r=>e(n=>({filters:{...n.filters,...r}})),resetFilters:()=>e({searchKeywords:"",filters:{formats:[],minSize:null,maxSize:null,startDate:null,endDate:null}}),selectedImage:null,setSelectedImage:r=>e({selectedImage:r}),selectedImages:[],setSelectedImages:r=>e({selectedImages:r}),toggleImageSelection:r=>e(n=>n.selectedImages.some(s=>s.path===r.path)?{selectedImages:n.selectedImages.filter(s=>s.path!==r.path)}:{selectedImages:[...n.selectedImages,r]}),clearSelection:()=>e({selectedImages:[],selectedImage:null}),scanProgress:null,scanStartTime:null,setScanProgress:r=>e(n=>r&&!n.scanStartTime&&r.current>0?{scanProgress:r,scanStartTime:Date.now()}:r?{scanProgress:r}:{scanProgress:null,scanStartTime:null}),isResizingPanels:!1,setIsResizingPanels:r=>e({isResizingPanels:r}),resizingSide:null,setResizingSide:r=>e({resizingSide:r}),thumbnailHeight:200,setThumbnailHeight:r=>e({thumbnailHeight:r}),mobileView:"main",setMobileView:r=>e({mobileView:r}),getCurrentLibrary:()=>{const r=t();return r.libraries.find(n=>n.id===r.currentLibraryId)}}));function Kp(e,t){return function(){return e.apply(t,arguments)}}const{toString:pv}=Object.prototype,{getPrototypeOf:sc}=Object,{iterator:aa,toStringTag:Xp}=Symbol,la=(e=>t=>{const r=pv.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Gt=e=>(e=e.toLowerCase(),t=>la(t)===e),ua=e=>t=>typeof t===e,{isArray:ki}=Array,yi=ua("undefined");function xs(e){return e!==null&&!yi(e)&&e.constructor!==null&&!yi(e.constructor)&&wt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Yp=Gt("ArrayBuffer");function mv(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Yp(e.buffer),t}const gv=ua("string"),wt=ua("function"),Zp=ua("number"),_s=e=>e!==null&&typeof e=="object",yv=e=>e===!0||e===!1,fo=e=>{if(la(e)!=="object")return!1;const t=sc(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Xp in e)&&!(aa in e)},vv=e=>{if(!_s(e)||xs(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},wv=Gt("Date"),xv=Gt("File"),_v=Gt("Blob"),kv=Gt("FileList"),Sv=e=>_s(e)&&wt(e.pipe),bv=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||wt(e.append)&&((t=la(e))==="formdata"||t==="object"&&wt(e.toString)&&e.toString()==="[object FormData]"))},Ev=Gt("URLSearchParams"),[Cv,Nv,Rv,Tv]=["ReadableStream","Request","Response","Headers"].map(Gt),Ov=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ks(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),ki(e))for(n=0,i=e.length;n0;)if(i=r[n],t===i.toLowerCase())return i;return null}const _n=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Gp=e=>!yi(e)&&e!==_n;function Yl(){const{caseless:e,skipUndefined:t}=Gp(this)&&this||{},r={},n=(i,s)=>{const o=e&&Qp(r,s)||s;fo(r[o])&&fo(i)?r[o]=Yl(r[o],i):fo(i)?r[o]=Yl({},i):ki(i)?r[o]=i.slice():(!t||!yi(i))&&(r[o]=i)};for(let i=0,s=arguments.length;i(ks(t,(i,s)=>{r&&wt(i)?e[s]=Kp(i,r):e[s]=i},{allOwnKeys:n}),e),Av=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),jv=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},zv=(e,t,r,n)=>{let i,s,o;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],(!n||n(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=r!==!1&&sc(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Lv=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Pv=e=>{if(!e)return null;if(ki(e))return e;let t=e.length;if(!Zp(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Fv=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&sc(Uint8Array)),Dv=(e,t)=>{const n=(e&&e[aa]).call(e);let i;for(;(i=n.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},Mv=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Bv=Gt("HTMLFormElement"),Uv=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),Of=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),$v=Gt("RegExp"),Jp=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ks(r,(i,s)=>{let o;(o=t(i,s,e))!==!1&&(n[s]=o||i)}),Object.defineProperties(e,n)},Wv=e=>{Jp(e,(t,r)=>{if(wt(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(wt(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Hv=(e,t)=>{const r={},n=i=>{i.forEach(s=>{r[s]=!0})};return ki(e)?n(e):n(String(e).split(t)),r},Vv=()=>{},qv=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Kv(e){return!!(e&&wt(e.append)&&e[Xp]==="FormData"&&e[aa])}const Xv=e=>{const t=new Array(10),r=(n,i)=>{if(_s(n)){if(t.indexOf(n)>=0)return;if(xs(n))return n;if(!("toJSON"in n)){t[i]=n;const s=ki(n)?[]:{};return ks(n,(o,a)=>{const l=r(o,i+1);!yi(l)&&(s[a]=l)}),t[i]=void 0,s}}return n};return r(e,0)},Yv=Gt("AsyncFunction"),Zv=e=>e&&(_s(e)||wt(e))&&wt(e.then)&&wt(e.catch),em=((e,t)=>e?setImmediate:t?((r,n)=>(_n.addEventListener("message",({source:i,data:s})=>{i===_n&&s===r&&n.length&&n.shift()()},!1),i=>{n.push(i),_n.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",wt(_n.postMessage)),Qv=typeof queueMicrotask<"u"?queueMicrotask.bind(_n):typeof process<"u"&&process.nextTick||em,Gv=e=>e!=null&&wt(e[aa]),K={isArray:ki,isArrayBuffer:Yp,isBuffer:xs,isFormData:bv,isArrayBufferView:mv,isString:gv,isNumber:Zp,isBoolean:yv,isObject:_s,isPlainObject:fo,isEmptyObject:vv,isReadableStream:Cv,isRequest:Nv,isResponse:Rv,isHeaders:Tv,isUndefined:yi,isDate:wv,isFile:xv,isBlob:_v,isRegExp:$v,isFunction:wt,isStream:Sv,isURLSearchParams:Ev,isTypedArray:Fv,isFileList:kv,forEach:ks,merge:Yl,extend:Iv,trim:Ov,stripBOM:Av,inherits:jv,toFlatObject:zv,kindOf:la,kindOfTest:Gt,endsWith:Lv,toArray:Pv,forEachEntry:Dv,matchAll:Mv,isHTMLForm:Bv,hasOwnProperty:Of,hasOwnProp:Of,reduceDescriptors:Jp,freezeMethods:Wv,toObjectSet:Hv,toCamelCase:Uv,noop:Vv,toFiniteNumber:qv,findKey:Qp,global:_n,isContextDefined:Gp,isSpecCompliantForm:Kv,toJSONObject:Xv,isAsyncFn:Yv,isThenable:Zv,setImmediate:em,asap:Qv,isIterable:Gv};function we(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}K.inherits(we,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:K.toJSONObject(this.config),code:this.code,status:this.status}}});const tm=we.prototype,rm={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{rm[e]={value:e}});Object.defineProperties(we,rm);Object.defineProperty(tm,"isAxiosError",{value:!0});we.from=(e,t,r,n,i,s)=>{const o=Object.create(tm);K.toFlatObject(e,o,function(p){return p!==Error.prototype},f=>f!=="isAxiosError");const a=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return we.call(o,a,l,r,n,i),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",s&&Object.assign(o,s),o};const Jv=null;function Zl(e){return K.isPlainObject(e)||K.isArray(e)}function nm(e){return K.endsWith(e,"[]")?e.slice(0,-2):e}function If(e,t,r){return e?e.concat(t).map(function(i,s){return i=nm(i),!r&&s?"["+i+"]":i}).join(r?".":""):t}function e1(e){return K.isArray(e)&&!e.some(Zl)}const t1=K.toFlatObject(K,{},null,function(t){return/^is[A-Z]/.test(t)});function ca(e,t,r){if(!K.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=K.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(u,v){return!K.isUndefined(v[u])});const n=r.metaTokens,i=r.visitor||p,s=r.dots,o=r.indexes,l=(r.Blob||typeof Blob<"u"&&Blob)&&K.isSpecCompliantForm(t);if(!K.isFunction(i))throw new TypeError("visitor must be a function");function f(m){if(m===null)return"";if(K.isDate(m))return m.toISOString();if(K.isBoolean(m))return m.toString();if(!l&&K.isBlob(m))throw new we("Blob is not supported. Use a Buffer instead.");return K.isArrayBuffer(m)||K.isTypedArray(m)?l&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function p(m,u,v){let c=m;if(m&&!v&&typeof m=="object"){if(K.endsWith(u,"{}"))u=n?u:u.slice(0,-2),m=JSON.stringify(m);else if(K.isArray(m)&&e1(m)||(K.isFileList(m)||K.endsWith(u,"[]"))&&(c=K.toArray(m)))return u=nm(u),c.forEach(function(w,k){!(K.isUndefined(w)||w===null)&&t.append(o===!0?If([u],k,s):o===null?u:u+"[]",f(w))}),!1}return Zl(m)?!0:(t.append(If(v,u,s),f(m)),!1)}const y=[],x=Object.assign(t1,{defaultVisitor:p,convertValue:f,isVisitable:Zl});function g(m,u){if(!K.isUndefined(m)){if(y.indexOf(m)!==-1)throw Error("Circular reference detected in "+u.join("."));y.push(m),K.forEach(m,function(c,d){(!(K.isUndefined(c)||c===null)&&i.call(t,c,K.isString(d)?d.trim():d,u,x))===!0&&g(c,u?u.concat(d):[d])}),y.pop()}}if(!K.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Af(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function oc(e,t){this._pairs=[],e&&ca(e,this,t)}const im=oc.prototype;im.append=function(t,r){this._pairs.push([t,r])};im.toString=function(t){const r=t?function(n){return t.call(this,n,Af)}:Af;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function r1(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function sm(e,t,r){if(!t)return e;const n=r&&r.encode||r1;K.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let s;if(i?s=i(t,r):s=K.isURLSearchParams(t)?t.toString():new oc(t,r).toString(n),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class jf{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){K.forEach(this.handlers,function(n){n!==null&&t(n)})}}const om={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},n1=typeof URLSearchParams<"u"?URLSearchParams:oc,i1=typeof FormData<"u"?FormData:null,s1=typeof Blob<"u"?Blob:null,o1={isBrowser:!0,classes:{URLSearchParams:n1,FormData:i1,Blob:s1},protocols:["http","https","file","blob","url","data"]},ac=typeof window<"u"&&typeof document<"u",Ql=typeof navigator=="object"&&navigator||void 0,a1=ac&&(!Ql||["ReactNative","NativeScript","NS"].indexOf(Ql.product)<0),l1=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",u1=ac&&window.location.href||"http://localhost",c1=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ac,hasStandardBrowserEnv:a1,hasStandardBrowserWebWorkerEnv:l1,navigator:Ql,origin:u1},Symbol.toStringTag,{value:"Module"})),st={...c1,...o1};function f1(e,t){return ca(e,new st.classes.URLSearchParams,{visitor:function(r,n,i,s){return st.isNode&&K.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function d1(e){return K.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function h1(e){const t={},r=Object.keys(e);let n;const i=r.length;let s;for(n=0;n=r.length;return o=!o&&K.isArray(i)?i.length:o,l?(K.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):((!i[o]||!K.isObject(i[o]))&&(i[o]=[]),t(r,n,i[o],s)&&K.isArray(i[o])&&(i[o]=h1(i[o])),!a)}if(K.isFormData(e)&&K.isFunction(e.entries)){const r={};return K.forEachEntry(e,(n,i)=>{t(d1(n),i,r,0)}),r}return null}function p1(e,t,r){if(K.isString(e))try{return(t||JSON.parse)(e),K.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Ss={transitional:om,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,s=K.isObject(t);if(s&&K.isHTMLForm(t)&&(t=new FormData(t)),K.isFormData(t))return i?JSON.stringify(am(t)):t;if(K.isArrayBuffer(t)||K.isBuffer(t)||K.isStream(t)||K.isFile(t)||K.isBlob(t)||K.isReadableStream(t))return t;if(K.isArrayBufferView(t))return t.buffer;if(K.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return f1(t,this.formSerializer).toString();if((a=K.isFileList(t))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ca(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||i?(r.setContentType("application/json",!1),p1(t)):t}],transformResponse:[function(t){const r=this.transitional||Ss.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(K.isResponse(t)||K.isReadableStream(t))return t;if(t&&K.isString(t)&&(n&&!this.responseType||i)){const o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(a){if(o)throw a.name==="SyntaxError"?we.from(a,we.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:st.classes.FormData,Blob:st.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};K.forEach(["delete","get","head","post","put","patch"],e=>{Ss.headers[e]={}});const m1=K.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),g1=e=>{const t={};let r,n,i;return e&&e.split(` -`).forEach(function(o){i=o.indexOf(":"),r=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!r||t[r]&&m1[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},zf=Symbol("internals");function Li(e){return e&&String(e).trim().toLowerCase()}function ho(e){return e===!1||e==null?e:K.isArray(e)?e.map(ho):String(e)}function y1(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const v1=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Wa(e,t,r,n,i){if(K.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!K.isString(t)){if(K.isString(n))return t.indexOf(n)!==-1;if(K.isRegExp(n))return n.test(t)}}function w1(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function x1(e,t){const r=K.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,s,o){return this[n].call(this,t,i,s,o)},configurable:!0})})}let xt=class{constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function s(a,l,f){const p=Li(l);if(!p)throw new Error("header name must be a non-empty string");const y=K.findKey(i,p);(!y||i[y]===void 0||f===!0||f===void 0&&i[y]!==!1)&&(i[y||l]=ho(a))}const o=(a,l)=>K.forEach(a,(f,p)=>s(f,p,l));if(K.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(K.isString(t)&&(t=t.trim())&&!v1(t))o(g1(t),r);else if(K.isObject(t)&&K.isIterable(t)){let a={},l,f;for(const p of t){if(!K.isArray(p))throw TypeError("Object iterator must return a key-value pair");a[f=p[0]]=(l=a[f])?K.isArray(l)?[...l,p[1]]:[l,p[1]]:p[1]}o(a,r)}else t!=null&&s(r,t,n);return this}get(t,r){if(t=Li(t),t){const n=K.findKey(this,t);if(n){const i=this[n];if(!r)return i;if(r===!0)return y1(i);if(K.isFunction(r))return r.call(this,i,n);if(K.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Li(t),t){const n=K.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Wa(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let i=!1;function s(o){if(o=Li(o),o){const a=K.findKey(n,o);a&&(!r||Wa(n,n[a],a,r))&&(delete n[a],i=!0)}}return K.isArray(t)?t.forEach(s):s(t),i}clear(t){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const s=r[n];(!t||Wa(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const r=this,n={};return K.forEach(this,(i,s)=>{const o=K.findKey(n,s);if(o){r[o]=ho(i),delete r[s];return}const a=t?w1(s):String(s).trim();a!==s&&delete r[s],r[a]=ho(i),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return K.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&K.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` -`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[zf]=this[zf]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=Li(o);n[a]||(x1(i,o),n[a]=!0)}return K.isArray(t)?t.forEach(s):s(t),this}};xt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);K.reduceDescriptors(xt.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});K.freezeMethods(xt);function Ha(e,t){const r=this||Ss,n=t||r,i=xt.from(n.headers);let s=n.data;return K.forEach(e,function(a){s=a.call(r,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function lm(e){return!!(e&&e.__CANCEL__)}function Si(e,t,r){we.call(this,e??"canceled",we.ERR_CANCELED,t,r),this.name="CanceledError"}K.inherits(Si,we,{__CANCEL__:!0});function um(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new we("Request failed with status code "+r.status,[we.ERR_BAD_REQUEST,we.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function _1(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function k1(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,s=0,o;return t=t!==void 0?t:1e3,function(l){const f=Date.now(),p=n[s];o||(o=f),r[i]=l,n[i]=f;let y=s,x=0;for(;y!==i;)x+=r[y++],y=y%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),f-o{r=p,i=null,s&&(clearTimeout(s),s=null),e(...f)};return[(...f)=>{const p=Date.now(),y=p-r;y>=n?o(f,p):(i=f,s||(s=setTimeout(()=>{s=null,o(i)},n-y)))},()=>i&&o(i)]}const Mo=(e,t,r=3)=>{let n=0;const i=k1(50,250);return S1(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,l=o-n,f=i(l),p=o<=a;n=o;const y={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:f||void 0,estimated:f&&a&&p?(a-o)/f:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(y)},r)},Lf=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Pf=e=>(...t)=>K.asap(()=>e(...t)),b1=st.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,st.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(st.origin),st.navigator&&/(msie|trident)/i.test(st.navigator.userAgent)):()=>!0,E1=st.hasStandardBrowserEnv?{write(e,t,r,n,i,s,o){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];K.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),K.isString(n)&&a.push(`path=${n}`),K.isString(i)&&a.push(`domain=${i}`),s===!0&&a.push("secure"),K.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function C1(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function N1(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function cm(e,t,r){let n=!C1(t);return e&&(n||r==!1)?N1(e,t):t}const Ff=e=>e instanceof xt?{...e}:e;function On(e,t){t=t||{};const r={};function n(f,p,y,x){return K.isPlainObject(f)&&K.isPlainObject(p)?K.merge.call({caseless:x},f,p):K.isPlainObject(p)?K.merge({},p):K.isArray(p)?p.slice():p}function i(f,p,y,x){if(K.isUndefined(p)){if(!K.isUndefined(f))return n(void 0,f,y,x)}else return n(f,p,y,x)}function s(f,p){if(!K.isUndefined(p))return n(void 0,p)}function o(f,p){if(K.isUndefined(p)){if(!K.isUndefined(f))return n(void 0,f)}else return n(void 0,p)}function a(f,p,y){if(y in t)return n(f,p);if(y in e)return n(void 0,f)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(f,p,y)=>i(Ff(f),Ff(p),y,!0)};return K.forEach(Object.keys({...e,...t}),function(p){const y=l[p]||i,x=y(e[p],t[p],p);K.isUndefined(x)&&y!==a||(r[p]=x)}),r}const fm=e=>{const t=On({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=t;if(t.headers=o=xt.from(o),t.url=sm(cm(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),K.isFormData(r)){if(st.hasStandardBrowserEnv||st.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(K.isFunction(r.getHeaders)){const l=r.getHeaders(),f=["content-type","content-length"];Object.entries(l).forEach(([p,y])=>{f.includes(p.toLowerCase())&&o.set(p,y)})}}if(st.hasStandardBrowserEnv&&(n&&K.isFunction(n)&&(n=n(t)),n||n!==!1&&b1(t.url))){const l=i&&s&&E1.read(s);l&&o.set(i,l)}return t},R1=typeof XMLHttpRequest<"u",T1=R1&&function(e){return new Promise(function(r,n){const i=fm(e);let s=i.data;const o=xt.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:f}=i,p,y,x,g,m;function u(){g&&g(),m&&m(),i.cancelToken&&i.cancelToken.unsubscribe(p),i.signal&&i.signal.removeEventListener("abort",p)}let v=new XMLHttpRequest;v.open(i.method.toUpperCase(),i.url,!0),v.timeout=i.timeout;function c(){if(!v)return;const w=xt.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),b={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:w,config:e,request:v};um(function(T){r(T),u()},function(T){n(T),u()},b),v=null}"onloadend"in v?v.onloadend=c:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(c)},v.onabort=function(){v&&(n(new we("Request aborted",we.ECONNABORTED,e,v)),v=null)},v.onerror=function(k){const b=k&&k.message?k.message:"Network Error",N=new we(b,we.ERR_NETWORK,e,v);N.event=k||null,n(N),v=null},v.ontimeout=function(){let k=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const b=i.transitional||om;i.timeoutErrorMessage&&(k=i.timeoutErrorMessage),n(new we(k,b.clarifyTimeoutError?we.ETIMEDOUT:we.ECONNABORTED,e,v)),v=null},s===void 0&&o.setContentType(null),"setRequestHeader"in v&&K.forEach(o.toJSON(),function(k,b){v.setRequestHeader(b,k)}),K.isUndefined(i.withCredentials)||(v.withCredentials=!!i.withCredentials),a&&a!=="json"&&(v.responseType=i.responseType),f&&([x,m]=Mo(f,!0),v.addEventListener("progress",x)),l&&v.upload&&([y,g]=Mo(l),v.upload.addEventListener("progress",y),v.upload.addEventListener("loadend",g)),(i.cancelToken||i.signal)&&(p=w=>{v&&(n(!w||w.type?new Si(null,e,v):w),v.abort(),v=null)},i.cancelToken&&i.cancelToken.subscribe(p),i.signal&&(i.signal.aborted?p():i.signal.addEventListener("abort",p)));const d=_1(i.url);if(d&&st.protocols.indexOf(d)===-1){n(new we("Unsupported protocol "+d+":",we.ERR_BAD_REQUEST,e));return}v.send(s||null)})},O1=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,i;const s=function(f){if(!i){i=!0,a();const p=f instanceof Error?f:this.reason;n.abort(p instanceof we?p:new Si(p instanceof Error?p.message:p))}};let o=t&&setTimeout(()=>{o=null,s(new we(`timeout ${t} of ms exceeded`,we.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(s):f.removeEventListener("abort",s)}),e=null)};e.forEach(f=>f.addEventListener("abort",s));const{signal:l}=n;return l.unsubscribe=()=>K.asap(a),l}},I1=function*(e,t){let r=e.byteLength;if(r{const i=A1(e,t);let s=0,o,a=l=>{o||(o=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:f,value:p}=await i.next();if(f){a(),l.close();return}let y=p.byteLength;if(r){let x=s+=y;r(x)}l.enqueue(new Uint8Array(p))}catch(f){throw a(f),f}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},Mf=64*1024,{isFunction:Vs}=K,z1=(({Request:e,Response:t})=>({Request:e,Response:t}))(K.global),{ReadableStream:Bf,TextEncoder:Uf}=K.global,$f=(e,...t)=>{try{return!!e(...t)}catch{return!1}},L1=e=>{e=K.merge.call({skipUndefined:!0},z1,e);const{fetch:t,Request:r,Response:n}=e,i=t?Vs(t):typeof fetch=="function",s=Vs(r),o=Vs(n);if(!i)return!1;const a=i&&Vs(Bf),l=i&&(typeof Uf=="function"?(m=>u=>m.encode(u))(new Uf):async m=>new Uint8Array(await new r(m).arrayBuffer())),f=s&&a&&$f(()=>{let m=!1;const u=new r(st.origin,{body:new Bf,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!u}),p=o&&a&&$f(()=>K.isReadableStream(new n("").body)),y={stream:p&&(m=>m.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!y[m]&&(y[m]=(u,v)=>{let c=u&&u[m];if(c)return c.call(u);throw new we(`Response type '${m}' is not supported`,we.ERR_NOT_SUPPORT,v)})});const x=async m=>{if(m==null)return 0;if(K.isBlob(m))return m.size;if(K.isSpecCompliantForm(m))return(await new r(st.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(K.isArrayBufferView(m)||K.isArrayBuffer(m))return m.byteLength;if(K.isURLSearchParams(m)&&(m=m+""),K.isString(m))return(await l(m)).byteLength},g=async(m,u)=>{const v=K.toFiniteNumber(m.getContentLength());return v??x(u)};return async m=>{let{url:u,method:v,data:c,signal:d,cancelToken:w,timeout:k,onDownloadProgress:b,onUploadProgress:N,responseType:T,headers:L,withCredentials:O="same-origin",fetchOptions:F}=fm(m),ee=t||fetch;T=T?(T+"").toLowerCase():"text";let R=O1([d,w&&w.toAbortSignal()],k),U=null;const _=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let q;try{if(N&&f&&v!=="get"&&v!=="head"&&(q=await g(L,c))!==0){let I=new r(u,{method:"POST",body:c,duplex:"half"}),A;if(K.isFormData(c)&&(A=I.headers.get("content-type"))&&L.setContentType(A),I.body){const[V,M]=Lf(q,Mo(Pf(N)));c=Df(I.body,Mf,V,M)}}K.isString(O)||(O=O?"include":"omit");const se=s&&"credentials"in r.prototype,Q={...F,signal:R,method:v.toUpperCase(),headers:L.normalize().toJSON(),body:c,duplex:"half",credentials:se?O:void 0};U=s&&new r(u,Q);let $=await(s?ee(U,F):ee(u,Q));const D=p&&(T==="stream"||T==="response");if(p&&(b||D&&_)){const I={};["status","statusText","headers"].forEach(W=>{I[W]=$[W]});const A=K.toFiniteNumber($.headers.get("content-length")),[V,M]=b&&Lf(A,Mo(Pf(b),!0))||[];$=new n(Df($.body,Mf,V,()=>{M&&M(),_&&_()}),I)}T=T||"text";let H=await y[K.findKey(y,T)||"text"]($,m);return!D&&_&&_(),await new Promise((I,A)=>{um(I,A,{data:H,headers:xt.from($.headers),status:$.status,statusText:$.statusText,config:m,request:U})})}catch(se){throw _&&_(),se&&se.name==="TypeError"&&/Load failed|fetch/i.test(se.message)?Object.assign(new we("Network Error",we.ERR_NETWORK,m,U),{cause:se.cause||se}):we.from(se,se&&se.code,m,U)}}},P1=new Map,dm=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:i}=t,s=[n,i,r];let o=s.length,a=o,l,f,p=P1;for(;a--;)l=s[a],f=p.get(l),f===void 0&&p.set(l,f=a?new Map:L1(t)),p=f;return f};dm();const lc={http:Jv,xhr:T1,fetch:{get:dm}};K.forEach(lc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Wf=e=>`- ${e}`,F1=e=>K.isFunction(e)||e===null||e===!1;function D1(e,t){e=K.isArray(e)?e:[e];const{length:r}=e;let n,i;const s={};for(let o=0;o`adapter ${l} `+(f===!1?"is not supported by the environment":"is not available in the build"));let a=r?o.length>1?`since : -`+o.map(Wf).join(` -`):" "+Wf(o[0]):"as no adapter specified";throw new we("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return i}const hm={getAdapter:D1,adapters:lc};function Va(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Si(null,e)}function Hf(e){return Va(e),e.headers=xt.from(e.headers),e.data=Ha.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),hm.getAdapter(e.adapter||Ss.adapter,e)(e).then(function(n){return Va(e),n.data=Ha.call(e,e.transformResponse,n),n.headers=xt.from(n.headers),n},function(n){return lm(n)||(Va(e),n&&n.response&&(n.response.data=Ha.call(e,e.transformResponse,n.response),n.response.headers=xt.from(n.response.headers))),Promise.reject(n)})}const pm="1.13.2",fa={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{fa[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Vf={};fa.transitional=function(t,r,n){function i(s,o){return"[Axios v"+pm+"] Transitional option '"+s+"'"+o+(n?". "+n:"")}return(s,o,a)=>{if(t===!1)throw new we(i(o," has been removed"+(r?" in "+r:"")),we.ERR_DEPRECATED);return r&&!Vf[o]&&(Vf[o]=!0,console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,o,a):!0}};fa.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function M1(e,t,r){if(typeof e!="object")throw new we("options must be an object",we.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const s=n[i],o=t[s];if(o){const a=e[s],l=a===void 0||o(a,s,e);if(l!==!0)throw new we("option "+s+" must be "+l,we.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new we("Unknown option "+s,we.ERR_BAD_OPTION)}}const po={assertOptions:M1,validators:fa},or=po.validators;let bn=class{constructor(t){this.defaults=t||{},this.interceptors={request:new jf,response:new jf}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=` -`+s):n.stack=s}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=On(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:s}=r;n!==void 0&&po.assertOptions(n,{silentJSONParsing:or.transitional(or.boolean),forcedJSONParsing:or.transitional(or.boolean),clarifyTimeoutError:or.transitional(or.boolean)},!1),i!=null&&(K.isFunction(i)?r.paramsSerializer={serialize:i}:po.assertOptions(i,{encode:or.function,serialize:or.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),po.assertOptions(r,{baseUrl:or.spelling("baseURL"),withXsrfToken:or.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=s&&K.merge(s.common,s[r.method]);s&&K.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),r.headers=xt.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(u){typeof u.runWhen=="function"&&u.runWhen(r)===!1||(l=l&&u.synchronous,a.unshift(u.fulfilled,u.rejected))});const f=[];this.interceptors.response.forEach(function(u){f.push(u.fulfilled,u.rejected)});let p,y=0,x;if(!l){const m=[Hf.bind(this),void 0];for(m.unshift(...a),m.push(...f),x=m.length,p=Promise.resolve(r);y{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{n.subscribe(a),s=a}).then(i);return o.cancel=function(){n.unsubscribe(s)},o},t(function(s,o,a){n.reason||(n.reason=new Si(s,o,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new mm(function(i){t=i}),cancel:t}}};function U1(e){return function(r){return e.apply(null,r)}}function $1(e){return K.isObject(e)&&e.isAxiosError===!0}const Gl={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(Gl).forEach(([e,t])=>{Gl[t]=e});function gm(e){const t=new bn(e),r=Kp(bn.prototype.request,t);return K.extend(r,bn.prototype,t,{allOwnKeys:!0}),K.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return gm(On(e,i))},r}const xe=gm(Ss);xe.Axios=bn;xe.CanceledError=Si;xe.CancelToken=B1;xe.isCancel=lm;xe.VERSION=pm;xe.toFormData=ca;xe.AxiosError=we;xe.Cancel=xe.CanceledError;xe.all=function(t){return Promise.all(t)};xe.spread=U1;xe.isAxiosError=$1;xe.mergeConfig=On;xe.AxiosHeaders=xt;xe.formToJSON=e=>am(K.isHTMLForm(e)?new FormData(e):e);xe.getAdapter=hm.getAdapter;xe.HttpStatusCode=Gl;xe.default=xe;const{Axios:Jw,AxiosError:ex,CanceledError:tx,isCancel:rx,CancelToken:nx,VERSION:ix,all:sx,Cancel:ox,isAxiosError:ax,spread:lx,toFormData:ux,AxiosHeaders:cx,HttpStatusCode:fx,formToJSON:dx,getAdapter:hx,mergeConfig:px}=xe,Pe="/api",Cr={getAll:()=>xe.get(`${Pe}/library`),add:(e,t)=>xe.post(`${Pe}/library`,{name:e,path:t}),update:(e,t)=>xe.put(`${Pe}/library/${e}`,t),delete:e=>xe.delete(`${Pe}/library/${e}`),setCurrent:e=>xe.post(`${Pe}/library/${e}/set-current`),updatePreferences:e=>xe.put(`${Pe}/library/preferences`,e),updateTheme:e=>xe.put(`${Pe}/library/theme`,{theme:e})},$e={search:(e,t={},r={})=>{const n=new URLSearchParams({libraryId:e,...t});return xe.get(`${Pe}/image?${n}`,r)},getCount:e=>xe.get(`${Pe}/image/count?libraryId=${e}`),getFolders:e=>xe.get(`${Pe}/image/folders?libraryId=${e}`),getCacheMeta:e=>xe.get(`${Pe}/image/cache-meta?libraryId=${e}`),getThumbnailUrl:(e,t,r)=>`${Pe}/image/thumbnail/${e}/${t}/${r}`,getOriginalUrl:(e,t)=>`${Pe}/image/original/${e}/${t}`,openInExplorer:(e,t)=>xe.post(`${Pe}/image/${e}/open-file`,{path:t})},sn={fullScan:(e,t=!1)=>xe.post(`${Pe}/scan/full`,{libraryId:e,wait:t}),sync:(e,t=!1)=>xe.post(`${Pe}/scan/sync`,{libraryId:e,wait:t}),stop:e=>xe.post(`${Pe}/scan/stop`,{libraryId:e}),resume:e=>xe.post(`${Pe}/scan/resume`,{libraryId:e}),getStatus:e=>xe.get(`${Pe}/scan/status/${e}`),fixFolders:e=>xe.post(`${Pe}/scan/fix-folders`,{libraryId:e})},qf={start:e=>xe.post(`${Pe}/watch/start/${e}`),stop:e=>xe.post(`${Pe}/watch/stop/${e}`),status:e=>xe.get(`${Pe}/watch/status/${e}`),list:()=>xe.get(`${Pe}/watch/list`)};/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var W1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const H1=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Ie=(e,t)=>{const r=Z.forwardRef(({color:n="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:a="",children:l,...f},p)=>Z.createElement("svg",{ref:p,...W1,width:i,height:i,stroke:n,strokeWidth:o?Number(s)*24/Number(i):s,className:["lucide",`lucide-${H1(e)}`,a].join(" "),...f},[...t.map(([y,x])=>Z.createElement(y,x)),...Array.isArray(l)?l:[l]]));return r.displayName=`${e}`,r};/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const V1=Ie("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const q1=Ie("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Kf=Ie("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const K1=Ie("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const X1=Ie("ChevronsDown",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Y1=Ie("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Z1=Ie("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Q1=Ie("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const G1=Ie("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const J1=Ie("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ew=Ie("File",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Xf=Ie("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const tw=Ie("FolderDown",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m15 13-3 3-3-3",key:"6j2sf0"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Zi=Ie("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rw=Ie("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Yf=Ie("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nw=Ie("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const iw=Ie("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",key:"1xcu5"}],["circle",{cx:"17.5",cy:"10.5",r:".5",key:"736e4u"}],["circle",{cx:"8.5",cy:"7.5",r:".5",key:"clrty"}],["circle",{cx:"6.5",cy:"12.5",r:".5",key:"1s4xz9"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const sw=Ie("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ym=Ie("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Zf=Ie("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Bo=Ie("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Qf=Ie("Sliders",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Gf=Ie("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ow=Ie("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vm=Ie("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ps={LIBRARY:"library",FOLDER:"folder",IMAGES:"images"};let Jf=0;const aw=()=>(Jf+=1,`req_${Date.now()}_${Jf}`);class lw{constructor(){this.activeRequests=new Map,this.requestContexts=new Map}createRequest(t){const r=aw(),n=new AbortController,i={id:r,type:t,createdAt:Date.now(),abortController:n,signal:n.signal,status:"pending",isActive:!0,cancel:()=>{if(i.isActive){i.isActive=!1,i.status="cancelled",n.abort(),this.requestContexts.delete(r);const s=this.activeRequests.get(t);s&&s.delete(r)}}};return this.requestContexts.set(r,i),this.activeRequests.has(t)||this.activeRequests.set(t,new Map),this.activeRequests.get(t).set(r,i),i}cancelAll(t){const r=this.activeRequests.get(t);if(r){for(const n of r.values())n.cancel();r.clear()}}cancelAllRequests(){for(const t of Object.values(ps))this.cancelAll(t)}isValid(t){const r=this.requestContexts.get(t);return r?r.isActive:!1}complete(t){const r=this.requestContexts.get(t);if(r&&r.isActive){r.status="completed",r.isActive=!1,this.requestContexts.delete(t);const n=this.activeRequests.get(r.type);n&&n.delete(t)}}error(t){const r=this.requestContexts.get(t);if(r&&r.isActive){r.status="error",r.isActive=!1,this.requestContexts.delete(t);const n=this.activeRequests.get(r.type);n&&n.delete(t)}}getActiveCount(t){const r=this.activeRequests.get(t);return r?r.size:0}hasActiveRequests(t){return this.getActiveCount(t)>0}}const Ft=new lw;function Jl(){Ft.cancelAll(ps.IMAGES)}function uw(e){e&&setTimeout(()=>{},300)}const cw=async e=>{try{return(await sn.getStatus(e)).data}catch{return null}};function ed(){const{libraries:e,currentLibraryId:t,folders:r,selectedFolder:n,totalImageCount:i,setCurrentLibrary:s,setSelectedFolder:o,addLibrary:a,removeLibrary:l}=me(),[f,p]=Z.useState(!1),[y,x]=Z.useState(""),[g,m]=Z.useState(""),[u,v]=Z.useState(""),[c,d]=Z.useState(""),[w,k]=Z.useState(new Set),[b,N]=Z.useState(!1),[T,L]=Z.useState(!1),O=Z.useRef(null),F=V=>{d(V),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{v(V)},300)};Z.useEffect(()=>()=>{O.current&&clearTimeout(O.current)},[]);const ee=async()=>{if(!y.trim()){alert("请输入素材库名称");return}if(!g.trim()){alert("请输入文件夹路径");return}N(!0);try{console.log("📝 添加素材库...");const V=await Cr.add(y.trim(),g.trim()),M=V.data.id,W=V.data.hasExistingIndex;if(a({id:M,name:y.trim(),path:g.trim()}),x(""),m(""),p(!1),N(!1),console.log("🔄 切换到新素材库..."),await Cr.setCurrent(M),s(M),o(null),me.getState().setImages([]),me.getState().setFolders([]),me.getState().setSelectedImage(null),me.getState().setTotalImageCount(0),me.getState().setScanProgress({libraryId:M,current:0,total:0,percent:0,status:"preparing"}),W){console.log("检测到已有索引,先加载现有数据...");try{const[oe,he]=await Promise.all([$e.getFolders(M),$e.getCount(M)]);me.getState().setFolders(oe.data.folders),me.getState().setTotalImageCount(he.data.count),console.log("✅ 已加载现有数据")}catch(oe){console.warn("⚠️ 加载现有数据失败:",oe)}}console.log("🔍 开始异步扫描..."),W?(console.log("执行增量同步,检测变化..."),sn.sync(M,!1)):(console.log("首次添加,执行全量扫描..."),sn.fullScan(M,!1)),console.log("✅ 扫描已启动,请等待进度显示...")}catch(V){console.error("❌ Error adding library:",V),alert("添加素材库失败: "+V.message),me.getState().setScanProgress(null),N(!1)}},R=async V=>{if(V!==t){L(!0);try{Jl(),Ft.cancelAllRequests(),me.getState().setScanProgress(null),me.getState().setSelectedImage(null),me.getState().setImages([]),me.getState().setFolders([]),me.getState().setImageLoadingState({isLoading:!1,loadedCount:0,totalCount:0,hasMore:!1}),o(null),await Cr.setCurrent(V);const[M,W]=await Promise.all([$e.getFolders(V),$e.getCount(V)]);me.getState().setFolders(M.data.folders),me.getState().setTotalImageCount(W.data.count),s(V),cw(V).then(oe=>{var he,ce;oe&&oe.status==="paused"&&(oe.needsRescan?(me.getState().setScanProgress({...oe.progress,libraryId:V,canStop:!0,isPaused:!0,pendingCount:((he=oe.progress)==null?void 0:he.total)-((ce=oe.progress)==null?void 0:ce.current)||0,needsRescan:!0}),console.log("⏸️ 发现中断的扫描,需要继续完成")):oe.pendingCount>0&&(me.getState().setScanProgress({...oe.progress,libraryId:V,canStop:!0,isPaused:!0,pendingCount:oe.pendingCount}),console.log(`⏸️ 发现暂停的扫描,待处理: ${oe.pendingCount} 张`)))}).catch(()=>{})}catch(M){console.error("Error setting current library:",M),alert("切换素材库失败: "+M.message),me.getState().setImageLoadingState({isLoading:!1})}finally{L(!1)}}},U=async()=>{if(!t)return;const V=e.find(W=>W.id===t);if(!(!V||!confirm(`确定要删除素材库"${V.name}"吗? - -路径: ${V.path} - -⚠️ 注意: -• 将删除索引数据并释放数据库连接 -• 不会删除原始图片文件 -• .flypic 文件夹将保留,您可以手动删除`)))try{await Cr.delete(t),l(t),me.getState().setImages([]),me.getState().setFolders([]),me.getState().setSelectedImage(null),me.getState().setSelectedFolder(null);const W=e.filter(oe=>oe.id!==t);if(W.length>0){const oe=W[0];await Cr.setCurrent(oe.id),s(oe.id)}console.log(`✅ 素材库已删除: ${V.name}`),console.log(`数据库连接已释放,可手动删除: ${V.path}\\.flypic`)}catch(W){console.error("Error deleting library:",W),alert("删除素材库失败: "+W.message)}},_=V=>{const M=new Set(w);M.has(V)?M.delete(V):M.add(V),k(M)},q=V=>{const M=[],W=oe=>{oe.forEach(he=>{he.children&&he.children.length>0&&(M.push(he.path),W(he.children))})};return W(V),M},se=()=>{const V=q(D.length>0?D:r);k(new Set(V))},Q=()=>{k(new Set)},$=()=>{const V=q(D.length>0?D:r);return V.length>0&&V.every(M=>w.has(M))},D=Z.useMemo(()=>{if(!u)return r;const V=u.trim().toLowerCase().split(/\s+/).filter(he=>he.length>0);if(V.length===0)return r;const M=[],W=he=>he.reduce((ce,fe)=>{const J=fe.name.toLowerCase(),ae=fe.path.toLowerCase(),Y=V.every(z=>J.includes(z)),le=V.every(z=>ae.includes(z));let h=[];return fe.children&&fe.children.length>0&&(h=W(fe.children)),(Y||le||h.length>0)&&(ce.push({...fe,children:h}),h.length>0&&M.push(fe.path)),ce},[]),oe=W(r);return M.length>0&&setTimeout(()=>{k(he=>{const ce=new Set(he);return M.forEach(fe=>ce.add(fe)),ce})},0),oe},[r,u]),H=(V,M)=>{V.stopPropagation(),_(M)},I=V=>{const M=V.children&&V.children.length>0;n!==V.path?(Jl(),o(V.path)):M&&_(V.path)},A=(V,M=0)=>V.map(W=>{const oe=w.has(W.path),he=W.children&&W.children.length>0,ce=n===W.path;return S.jsxs("div",{children:[S.jsxs("div",{className:`flex items-center px-3 py-2 cursor-pointer rounded-md transition-colors ${ce?"bg-blue-50 dark:bg-blue-900":"hover:bg-gray-100 dark:hover:bg-gray-700"}`,style:{paddingLeft:`${M*16+12}px`},onClick:()=>I(W),children:[he?S.jsx("div",{className:"flex items-center justify-center w-5 h-5 mr-1 cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-600 rounded",onClick:fe=>H(fe,W.path),children:oe?S.jsx(Kf,{className:"w-4 h-4 text-gray-500"}):S.jsx(K1,{className:"w-4 h-4 text-gray-500"})}):S.jsx("div",{className:"w-5 mr-1"}),S.jsx(Zi,{className:"w-4 h-4 mr-2 text-gray-500 flex-shrink-0"}),S.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 truncate flex-1",children:W.name}),S.jsx("span",{className:"text-xs text-gray-400 ml-2 flex-shrink-0",children:W.image_count})]}),he&&oe&&A(W.children,M+1)]},W.path)});return S.jsxs("div",{className:"w-full h-full border-r border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 flex flex-col",children:[S.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:[S.jsx("div",{className:"flex items-center justify-between mb-3",children:S.jsx("h2",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300",children:"素材库"})}),S.jsxs("div",{className:"flex gap-2",children:[S.jsxs("div",{className:"relative flex-1",children:[S.jsxs("select",{value:t||"",onChange:V=>{const M=V.target.value;M==="__add__"?p(!0):M&&R(M)},disabled:T,className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 appearance-none cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",style:{paddingRight:"2rem"},children:[e.length===0&&S.jsx("option",{value:"",children:"暂无素材库"}),e.map(V=>S.jsx("option",{value:V.id,children:V.name},V.id)),S.jsx("option",{value:"__add__",style:{borderTop:"1px solid #ccc"},children:"+ 添加新素材库"})]}),S.jsx(Kf,{className:"absolute right-2 top-2.5 w-4 h-4 text-gray-400 pointer-events-none"})]}),t&&e.length>0&&S.jsx("button",{onClick:U,className:"px-3 py-2 border border-red-300 dark:border-red-600 rounded-lg hover:bg-red-50 dark:hover:bg-red-900 text-red-600 dark:text-red-400 transition-colors",title:"删除当前素材库",children:S.jsx(ow,{className:"w-4 h-4"})})]}),f&&S.jsxs("div",{className:"mt-3 p-3 border border-gray-300 dark:border-gray-600 rounded-lg bg-gray-50 dark:bg-gray-700",children:[S.jsxs("div",{className:"flex items-center justify-between mb-2",children:[S.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"添加素材库"}),S.jsx("button",{onClick:()=>p(!1),className:"p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-600",children:S.jsx(vm,{className:"w-4 h-4 text-gray-500"})})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsx("input",{type:"text",placeholder:"素材库名称",value:y,onChange:V=>x(V.target.value),onKeyDown:V=>V.key==="Enter"&&ee(),autoFocus:!0,className:"w-full px-2 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100"}),S.jsx("input",{type:"text",placeholder:"文件夹路径(例如:C:\\Users\\Pictures)",value:g,onChange:V=>m(V.target.value),onKeyDown:V=>V.key==="Enter"&&ee(),className:"w-full px-2 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100"}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx("button",{onClick:()=>p(!1),className:"flex-1 px-3 py-1.5 border border-gray-300 dark:border-gray-600 rounded text-sm hover:bg-gray-100 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-300",children:"取消"}),S.jsx("button",{onClick:ee,disabled:b,className:"flex-1 px-3 py-1.5 bg-blue-500 text-white rounded text-sm hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed",children:b?"添加中...":"添加"})]})]})]})]}),S.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[S.jsx("div",{className:"mb-3 space-y-2",children:S.jsxs("div",{className:"flex gap-2",children:[S.jsxs("div",{className:"relative flex-1",children:[S.jsx(Bo,{className:"absolute left-2 top-2 w-4 h-4 text-gray-400"}),S.jsx("input",{type:"text",placeholder:"搜索文件夹(支持多关键词)...",value:c,onChange:V=>F(V.target.value),className:"w-full pl-8 pr-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100"})]}),S.jsx("button",{onClick:$()?Q:se,className:"px-2 py-1.5 border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-100 dark:hover:bg-gray-600 text-gray-600 dark:text-gray-400 transition-colors",title:$()?"折叠全部":"展开全部",children:$()?S.jsx(Y1,{className:"w-4 h-4"}):S.jsx(X1,{className:"w-4 h-4"})})]})}),S.jsxs("div",{className:"space-y-1",children:[S.jsxs("div",{className:`flex items-center px-3 py-2 cursor-pointer rounded-md transition-colors ${n===null?"bg-blue-50 dark:bg-blue-900":"hover:bg-gray-100 dark:hover:bg-gray-700"}`,onClick:()=>o(null),children:[S.jsx("div",{className:"w-5 mr-1"}),S.jsx(Zi,{className:"w-4 h-4 mr-2 text-blue-500 flex-shrink-0"}),S.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 font-medium flex-1",children:"全部图片"}),S.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 ml-2",children:i})]}),(D.length>0||r.length>0)&&S.jsx("div",{className:"h-px bg-gray-200 dark:bg-gray-700 my-2"}),D.length>0?A(D):u?S.jsx("div",{className:"text-center py-8 text-gray-400 dark:text-gray-500 text-sm",children:"未找到匹配的文件夹"}):r.length===0?S.jsx("div",{className:"text-center py-8 text-gray-400 dark:text-gray-500 text-sm",children:"暂无文件夹"}):null]})]})]})}function Ze(){return Ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?Z.useEffect:Z.useLayoutEffect;function $n(e,t,r){var n=Z.useRef(t);n.current=t,Z.useEffect(function(){function i(s){n.current(s)}return e&&window.addEventListener(e,i,r),function(){e&&window.removeEventListener(e,i)}},[e])}var dw=["container"];function hw(e){var t=e.container,r=t===void 0?document.body:t,n=da(e,dw);return Rp.createPortal(ke.createElement("div",Ze({},n)),r)}function pw(e){return ke.createElement("svg",Ze({width:"44",height:"44",viewBox:"0 0 768 768"},e),ke.createElement("path",{d:"M607.5 205.5l-178.5 178.5 178.5 178.5-45 45-178.5-178.5-178.5 178.5-45-45 178.5-178.5-178.5-178.5 45-45 178.5 178.5 178.5-178.5z"}))}function mw(e){return ke.createElement("svg",Ze({width:"44",height:"44",viewBox:"0 0 768 768"},e),ke.createElement("path",{d:"M640.5 352.5v63h-390l178.5 180-45 45-256.5-256.5 256.5-256.5 45 45-178.5 180h390z"}))}function gw(e){return ke.createElement("svg",Ze({width:"44",height:"44",viewBox:"0 0 768 768"},e),ke.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function yw(){return Z.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function rd(e){var t=e.touches[0],r=t.clientX,n=t.clientY;if(e.touches.length>=2){var i=e.touches[1],s=i.clientX,o=i.clientY;return[(r+s)/2,(n+o)/2,Math.sqrt(Math.pow(s-r,2)+Math.pow(o-n,2))]}return[r,n,0]}var Hr=function(e,t,r,n){var i,s=r*t,o=(s-n)/2,a=e;return s<=n?(i=1,a=0):e>0&&o-e<=0?(i=2,a=o):e<0&&o+e<=0&&(i=3,a=-o),[i,a]};function qa(e,t,r,n,i,s,o,a,l,f){o===void 0&&(o=innerWidth/2),a===void 0&&(a=innerHeight/2),l===void 0&&(l=0),f===void 0&&(f=0);var p=Hr(e,s,r,innerWidth)[0],y=Hr(t,s,n,innerHeight),x=innerWidth/2,g=innerHeight/2;return{x:o-s/i*(o-(x+e))-x+(n/r>=3&&r*s===innerWidth?0:p?l/2:l),y:a-s/i*(a-(g+t))-g+(y[0]?f/2:f),lastCX:o,lastCY:a}}function ru(e,t,r){var n=e%180!=0;return n?[r,t,n]:[t,r,n]}function Ka(e,t,r){var n=ru(r,innerWidth,innerHeight),i=n[0],s=n[1],o=0,a=i,l=s,f=e/t*s,p=t/e*i;return e=s?a=f:e>=i&&ti/s?l=p:t/e>=3&&!n[2]?o=((l=p)-s)/2:a=f,{width:a,height:l,x:0,y:o,pause:!0}}function Ks(e,t){var r=t.leading,n=r!==void 0&&r,i=t.maxWait,s=t.wait,o=s===void 0?i||0:s,a=Z.useRef(e);a.current=e;var l=Z.useRef(0),f=Z.useRef(),p=function(){return f.current&&clearTimeout(f.current)},y=Z.useCallback(function(){var x=[].slice.call(arguments),g=Date.now();function m(){l.current=g,p(),a.current.apply(null,x)}var u=l.current,v=g-u;if(u===0&&(n&&m(),l.current=g),i!==void 0){if(v>i)return void m()}else v=1&&s&&s())};p()}function p(){l=requestAnimationFrame(f)}}var ww={T:0,L:0,W:0,H:0,FIT:void 0},wm=function(){var e=Z.useRef(!1);return Z.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},xw=["className"];function _w(e){var t=e.className,r=t===void 0?"":t,n=da(e,xw);return ke.createElement("div",Ze({className:"PhotoView__Spinner "+r},n),ke.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},ke.createElement("path",{opacity:".25",d:"M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"}),ke.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var kw=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function Sw(e){var t=e.src,r=e.loaded,n=e.broken,i=e.className,s=e.onPhotoLoad,o=e.loadingElement,a=e.brokenElement,l=da(e,kw),f=wm();return t&&!n?ke.createElement(ke.Fragment,null,ke.createElement("img",Ze({className:"PhotoView__Photo"+(i?" "+i:""),src:t,onLoad:function(p){var y=p.target;f.current&&s({loaded:!0,naturalWidth:y.naturalWidth,naturalHeight:y.naturalHeight})},onError:function(){f.current&&s({broken:!0})},draggable:!1,alt:""},l)),!r&&(o?ke.createElement("span",{className:"PhotoView__icon"},o):ke.createElement(_w,{className:"PhotoView__icon"}))):a?ke.createElement("span",{className:"PhotoView__icon"},typeof a=="function"?a({src:t}):a):null}var bw={naturalWidth:void 0,naturalHeight:void 0,width:void 0,height:void 0,loaded:void 0,broken:!1,x:0,y:0,touched:!1,maskTouched:!1,rotate:0,scale:1,CX:0,CY:0,lastX:0,lastY:0,lastCX:0,lastCY:0,lastScale:1,touchTime:0,touchLength:0,pause:!0,stopRaf:!0,reach:void 0};function Ew(e){var t=e.item,r=t.src,n=t.render,i=t.width,s=i===void 0?0:i,o=t.height,a=o===void 0?0:o,l=t.originRef,f=e.visible,p=e.speed,y=e.easing,x=e.wrapClassName,g=e.className,m=e.style,u=e.loadingElement,v=e.brokenElement,c=e.onPhotoTap,d=e.onMaskTap,w=e.onReachMove,k=e.onReachUp,b=e.onPhotoResize,N=e.isActive,T=e.expose,L=Uo(bw),O=L[0],F=L[1],ee=Z.useRef(0),R=wm(),U=O.naturalWidth,_=U===void 0?s:U,q=O.naturalHeight,se=q===void 0?a:q,Q=O.width,$=Q===void 0?s:Q,D=O.height,H=D===void 0?a:D,I=O.loaded,A=I===void 0?!r:I,V=O.broken,M=O.x,W=O.y,oe=O.touched,he=O.stopRaf,ce=O.maskTouched,fe=O.rotate,J=O.scale,ae=O.CX,Y=O.CY,le=O.lastX,h=O.lastY,z=O.lastCX,P=O.lastCY,C=O.lastScale,E=O.touchTime,j=O.touchLength,X=O.pause,G=O.reach,B=li({onScale:function(te){return re(qs(te))},onRotate:function(te){fe!==te&&(T({rotate:te}),F(Ze({rotate:te},Ka(_,se,te))))}});function re(te,ge,Ne){J!==te&&(T({scale:te}),F(Ze({scale:te},qa(M,W,$,H,J,te,ge,Ne),te<=1&&{x:0,y:0})))}var ue=Ks(function(te,ge,Ne){if(Ne===void 0&&(Ne=0),(oe||ce)&&N){var pr=ru(fe,$,H),mr=pr[0],Ot=pr[1];if(Ne===0&&ee.current===0){var _t=Math.abs(te-ae)<=20,kt=Math.abs(ge-Y)<=20;if(_t&&kt)return void F({lastCX:te,lastCY:ge});ee.current=_t?ge>Y?3:2:1}var rr,fn=te-z,Pr=ge-P;if(Ne===0){var dn=Hr(fn+le,J,mr,innerWidth)[0],zn=Hr(Pr+h,J,Ot,innerHeight);rr=function(Fr,yr,vr,nr){return yr&&Fr===1||nr==="x"?"x":vr&&Fr>1||nr==="y"?"y":void 0}(ee.current,dn,zn[0],G),rr!==void 0&&w(rr,te,ge,J)}if(rr==="x"||ce)return void F({reach:"x"});var gr=qs(J+(Ne-j)/100/2*J,_/$,.2);T({scale:gr}),F(Ze({touchLength:Ne,reach:rr,scale:gr},qa(M,W,$,H,J,gr,te,ge,fn,Pr)))}},{maxWait:8});function ne(te){return!he&&!oe&&(R.current&&F(Ze({},te,{pause:f})),R.current)}var pe,ve,ye,We,Jt,at,er,be,hr=(Jt=function(te){return ne({x:te})},at=function(te){return ne({y:te})},er=function(te){return R.current&&(T({scale:te}),F({scale:te})),!oe&&R.current},be=li({X:function(te){return Jt(te)},Y:function(te){return at(te)},S:function(te){return er(te)}}),function(te,ge,Ne,pr,mr,Ot,_t,kt,rr,fn,Pr){var dn=ru(fn,mr,Ot),zn=dn[0],gr=dn[1],Fr=Hr(te,kt,zn,innerWidth),yr=Fr[0],vr=Fr[1],nr=Hr(ge,kt,gr,innerHeight),Ln=nr[0],bs=nr[1],Pn=Date.now()-Pr;if(Pn>=200||kt!==_t||Math.abs(rr-_t)>1){var Dr=qa(te,ge,mr,Ot,_t,kt),wr=Dr.x,hn=Dr.y,It=yr?vr:wr!==te?wr:null,Fn=Ln?bs:hn!==ge?hn:null;return It!==null&&yn(te,It,be.X),Fn!==null&&yn(ge,Fn,be.Y),void(kt!==_t&&yn(_t,kt,be.S))}var pn=(te-Ne)/Pn,Mr=(ge-pr)/Pn,Br=Math.sqrt(Math.pow(pn,2)+Math.pow(Mr,2)),xr=!1,_r=!1;(function($t,lt){var ut,Wt=$t,kr=0,At=0,Dn=function(bi){ut||(ut=bi);var Ei=bi-ut,uc=Math.sign($t),cc=-.001*uc,fc=Math.sign(-Wt)*Math.pow(Wt,2)*2e-4,km=Wt*Ei+(cc+fc)*Math.pow(Ei,2)/2;kr+=km,ut=bi,uc*(Wt+=(cc+fc)*Ei)<=0?jt():lt(kr)?ir():jt()};function ir(){At=requestAnimationFrame(Dn)}function jt(){cancelAnimationFrame(At)}ir()})(Br,function($t){var lt=te+$t*(pn/Br),ut=ge+$t*(Mr/Br),Wt=Hr(lt,_t,zn,innerWidth),kr=Wt[0],At=Wt[1],Dn=Hr(ut,_t,gr,innerHeight),ir=Dn[0],jt=Dn[1];if(kr&&!xr&&(xr=!0,yr?yn(lt,At,be.X):nd(At,lt+(lt-At),be.X)),ir&&!_r&&(_r=!0,Ln?yn(ut,jt,be.Y):nd(jt,ut+(ut-jt),be.Y)),xr&&_r)return!1;var bi=xr||be.X(At),Ei=_r||be.Y(jt);return bi&&Ei})}),tr=(pe=c,ve=function(te,ge){G||re(J!==1?1:Math.max(2,_/$),te,ge)},ye=Z.useRef(0),We=Ks(function(){ye.current=0,pe.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var te=[].slice.call(arguments);ye.current+=1,We.apply(void 0,te),ye.current>=2&&(We.cancel(),ye.current=0,ve.apply(void 0,te))});function tt(te,ge){if(ee.current=0,(oe||ce)&&N){F({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var Ne=qs(J,_/$);if(hr(M,W,le,h,$,H,J,Ne,C,fe,E),k(te,ge),ae===te&&Y===ge){if(oe)return void tr(te,ge);ce&&d(te,ge)}}}function Lr(te,ge,Ne){Ne===void 0&&(Ne=0),F({touched:!0,CX:te,CY:ge,lastCX:te,lastCY:ge,lastX:M,lastY:W,lastScale:J,touchLength:Ne,touchTime:Date.now()})}function jn(te){F({maskTouched:!0,CX:te.clientX,CY:te.clientY,lastX:M,lastY:W})}$n(Sr?void 0:"mousemove",function(te){te.preventDefault(),ue(te.clientX,te.clientY)}),$n(Sr?void 0:"mouseup",function(te){tt(te.clientX,te.clientY)}),$n(Sr?"touchmove":void 0,function(te){te.preventDefault();var ge=rd(te);ue.apply(void 0,ge)},{passive:!1}),$n(Sr?"touchend":void 0,function(te){var ge=te.changedTouches[0];tt(ge.clientX,ge.clientY)},{passive:!1}),$n("resize",Ks(function(){A&&!oe&&(F(Ka(_,se,fe)),b())},{maxWait:8})),tu(function(){N&&T(Ze({scale:J,rotate:fe},B))},[N]);var Tt=function(te,ge,Ne,pr,mr,Ot,_t,kt,rr,fn){var Pr=function(wr,hn,It,Fn,pn){var Mr=Z.useRef(!1),Br=Uo({lead:!0,scale:It}),xr=Br[0],_r=xr.lead,$t=xr.scale,lt=Br[1],ut=Ks(function(Wt){try{return pn(!0),lt({lead:!1,scale:Wt}),Promise.resolve()}catch(kr){return Promise.reject(kr)}},{wait:Fn});return tu(function(){Mr.current?(pn(!1),lt({lead:!0}),ut(It)):Mr.current=!0},[It]),_r?[wr*$t,hn*$t,It/$t]:[wr*It,hn*It,1]}(Ot,_t,kt,rr,fn),dn=Pr[0],zn=Pr[1],gr=Pr[2],Fr=function(wr,hn,It,Fn,pn){var Mr=Z.useState(ww),Br=Mr[0],xr=Mr[1],_r=Z.useState(0),$t=_r[0],lt=_r[1],ut=Z.useRef(),Wt=li({OK:function(){return wr&<(4)}});function kr(At){pn(!1),lt(At)}return Z.useEffect(function(){if(ut.current||(ut.current=Date.now()),It){if(function(At,Dn){var ir=At&&At.current;if(ir&&ir.nodeType===1){var jt=ir.getBoundingClientRect();Dn({T:jt.top,L:jt.left,W:jt.width,H:jt.height,FIT:ir.tagName==="IMG"?getComputedStyle(ir).objectFit:void 0})}}(hn,xr),wr)return Date.now()-ut.current<250?(lt(1),requestAnimationFrame(function(){lt(2),requestAnimationFrame(function(){return kr(3)})}),void setTimeout(Wt.OK,Fn)):void lt(4);kr(5)}},[wr,It]),[$t,Br]}(te,ge,Ne,rr,fn),yr=Fr[0],vr=Fr[1],nr=vr.W,Ln=vr.FIT,bs=innerWidth/2,Pn=innerHeight/2,Dr=yr<3||yr>4;return[Dr?nr?vr.L:bs:pr+(bs-Ot*kt/2),Dr?nr?vr.T:Pn:mr+(Pn-_t*kt/2),dn,Dr&&Ln?dn*(vr.H/nr):zn,yr===0?gr:Dr?nr/(Ot*kt)||.01:gr,Dr?Ln?1:0:1,yr,Ln]}(f,l,A,M,W,$,H,J,p,function(te){return F({pause:te})}),_e=Tt[4],Te=Tt[6],Ae="transform "+p+"ms "+y,je={className:g,onMouseDown:Sr?void 0:function(te){te.stopPropagation(),te.button===0&&Lr(te.clientX,te.clientY,0)},onTouchStart:Sr?function(te){te.stopPropagation(),Lr.apply(void 0,rd(te))}:void 0,onWheel:function(te){if(!G){var ge=qs(J-te.deltaY/100/2,_/$);F({stopRaf:!0}),re(ge,te.clientX,te.clientY)}},style:{width:Tt[2]+"px",height:Tt[3]+"px",opacity:Tt[5],objectFit:Te===4?void 0:Tt[7],transform:fe?"rotate("+fe+"deg)":void 0,transition:Te>2?Ae+", opacity "+p+"ms ease, height "+(Te<4?p/2:Te>4?p:0)+"ms "+y:void 0}};return ke.createElement("div",{className:"PhotoView__PhotoWrap"+(x?" "+x:""),style:m,onMouseDown:!Sr&&N?jn:void 0,onTouchStart:Sr&&N?function(te){return jn(te.touches[0])}:void 0},ke.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+_e+", 0, 0, "+_e+", "+Tt[0]+", "+Tt[1]+")",transition:oe||X?void 0:Ae,willChange:N?"transform":void 0}},r?ke.createElement(Sw,Ze({src:r,loaded:A,broken:V},je,{onPhotoLoad:function(te){F(Ze({},te,te.loaded&&Ka(te.naturalWidth||0,te.naturalHeight||0,fe)))},loadingElement:u,brokenElement:v})):n&&n({attrs:je,scale:_e,rotate:fe})))}var id={x:0,touched:!1,pause:!1,lastCX:void 0,lastCY:void 0,bg:void 0,lastBg:void 0,overlay:!0,minimal:!0,scale:1,rotate:0};function Cw(e){var t=e.loop,r=t===void 0?3:t,n=e.speed,i=e.easing,s=e.photoClosable,o=e.maskClosable,a=o===void 0||o,l=e.maskOpacity,f=l===void 0?1:l,p=e.pullClosable,y=p===void 0||p,x=e.bannerVisible,g=x===void 0||x,m=e.overlayRender,u=e.toolbarRender,v=e.className,c=e.maskClassName,d=e.photoClassName,w=e.photoWrapClassName,k=e.loadingElement,b=e.brokenElement,N=e.images,T=e.index,L=T===void 0?0:T,O=e.onIndexChange,F=e.visible,ee=e.onClose,R=e.afterClose,U=e.portalContainer,_=Uo(id),q=_[0],se=_[1],Q=Z.useState(0),$=Q[0],D=Q[1],H=q.x,I=q.touched,A=q.pause,V=q.lastCX,M=q.lastCY,W=q.bg,oe=W===void 0?f:W,he=q.lastBg,ce=q.overlay,fe=q.minimal,J=q.scale,ae=q.rotate,Y=q.onScale,le=q.onRotate,h=e.hasOwnProperty("index"),z=h?L:$,P=h?O:D,C=Z.useRef(z),E=N.length,j=N[z],X=typeof r=="boolean"?r:E>r,G=function(_e,Te){var Ae=Z.useReducer(function(Ne){return!Ne},!1)[1],je=Z.useRef(0),te=function(Ne){var pr=Z.useRef(Ne);function mr(Ot){pr.current=Ot}return Z.useMemo(function(){(function(Ot){_e?(Ot(_e),je.current=1):je.current=2})(mr)},[Ne]),[pr.current,mr]}(_e),ge=te[1];return[te[0],je.current,function(){Ae(),je.current===2&&(ge(!1),Te&&Te()),je.current=0}]}(F,R),B=G[0],re=G[1],ue=G[2];tu(function(){if(B)return se({pause:!0,x:z*-(innerWidth+Bn)}),void(C.current=z);se(id)},[B]);var ne=li({close:function(_e){le&&le(0),se({overlay:!0,lastBg:oe}),ee(_e)},changeIndex:function(_e,Te){Te===void 0&&(Te=!1);var Ae=X?C.current+(_e-z):_e,je=E-1,te=eu(Ae,0,je),ge=X?Ae:te,Ne=innerWidth+Bn;se({touched:!1,lastCX:void 0,lastCY:void 0,x:-Ne*ge,pause:Te}),C.current=ge,P&&P(X?_e<0?je:_e>je?0:_e:te)}}),pe=ne.close,ve=ne.changeIndex;function ye(_e){return _e?pe():se({overlay:!ce})}function We(){se({x:-(innerWidth+Bn)*z,lastCX:void 0,lastCY:void 0,pause:!0}),C.current=z}function Jt(_e,Te,Ae,je){_e==="x"?function(te){if(V!==void 0){var ge=te-V,Ne=ge;!X&&(z===0&&ge>0||z===E-1&&ge<0)&&(Ne=ge/2),se({touched:!0,lastCX:V,x:-(innerWidth+Bn)*C.current+Ne,pause:!1})}else se({touched:!0,lastCX:te,x:H,pause:!1})}(Te):_e==="y"&&function(te,ge){if(M!==void 0){var Ne=f===null?null:eu(f,.01,f-Math.abs(te-M)/100/4);se({touched:!0,lastCY:M,bg:ge===1?Ne:f,minimal:ge===1})}else se({touched:!0,lastCY:te,bg:oe,minimal:!0})}(Ae,je)}function at(_e,Te){var Ae=_e-(V??_e),je=Te-(M??Te),te=!1;if(Ae<-40)ve(z+1);else if(Ae>40)ve(z-1);else{var ge=-(innerWidth+Bn)*C.current;Math.abs(je)>100&&fe&&y&&(te=!0,pe()),se({touched:!1,x:ge,lastCX:void 0,lastCY:void 0,bg:f,overlay:!!te||ce})}}$n("keydown",function(_e){if(F)switch(_e.key){case"ArrowLeft":ve(z-1,!0);break;case"ArrowRight":ve(z+1,!0);break;case"Escape":pe()}});var er=function(_e,Te,Ae){return Z.useMemo(function(){var je=_e.length;return Ae?_e.concat(_e).concat(_e).slice(je+Te-1,je+Te+2):_e.slice(Math.max(Te-1,0),Math.min(Te+2,je+1))},[_e,Te,Ae])}(N,z,X);if(!B)return null;var be=ce&&!re,hr=F?oe:he,tr=Y&&le&&{images:N,index:z,visible:F,onClose:pe,onIndexChange:ve,overlayVisible:be,overlay:j&&j.overlay,scale:J,rotate:ae,onScale:Y,onRotate:le},tt=n?n(re):400,Lr=i?i(re):td,jn=n?n(3):600,Tt=i?i(3):td;return ke.createElement(hw,{className:"PhotoView-Portal"+(be?"":" PhotoView-Slider__clean")+(F?"":" PhotoView-Slider__willClose")+(v?" "+v:""),role:"dialog",onClick:function(_e){return _e.stopPropagation()},container:U},F&&ke.createElement(yw,null),ke.createElement("div",{className:"PhotoView-Slider__Backdrop"+(c?" "+c:"")+(re===1?" PhotoView-Slider__fadeIn":re===2?" PhotoView-Slider__fadeOut":""),style:{background:hr?"rgba(0, 0, 0, "+hr+")":void 0,transitionTimingFunction:Lr,transitionDuration:(I?0:tt)+"ms",animationDuration:tt+"ms"},onAnimationEnd:ue}),g&&ke.createElement("div",{className:"PhotoView-Slider__BannerWrap"},ke.createElement("div",{className:"PhotoView-Slider__Counter"},z+1," / ",E),ke.createElement("div",{className:"PhotoView-Slider__BannerRight"},u&&tr&&u(tr),ke.createElement(pw,{className:"PhotoView-Slider__toolbarIcon",onClick:pe}))),er.map(function(_e,Te){var Ae=X||z!==0?C.current-1+Te:z+Te;return ke.createElement(Ew,{key:X?_e.key+"/"+_e.src+"/"+Ae:_e.key,item:_e,speed:tt,easing:Lr,visible:F,onReachMove:Jt,onReachUp:at,onPhotoTap:function(){return ye(s)},onMaskTap:function(){return ye(a)},wrapClassName:w,className:d,style:{left:(innerWidth+Bn)*Ae+"px",transform:"translate3d("+H+"px, 0px, 0)",transition:I||A?void 0:"transform "+jn+"ms "+Tt},loadingElement:k,brokenElement:b,onPhotoResize:We,isActive:C.current===Ae,expose:se})}),!Sr&&g&&ke.createElement(ke.Fragment,null,(X||z!==0)&&ke.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return ve(z-1,!0)}},ke.createElement(mw,null)),(X||z+1-1){var c=f.slice();return c.splice(v,1,u),void a({images:c})}a(function(d){return{images:d.images.concat(u)}})},remove:function(u){a(function(v){var c=v.images.filter(function(d){return d.key!==u});return{images:c,index:Math.min(c.length-1,y)}})},show:function(u){var v=f.findIndex(function(c){return c.key===u});a({visible:!0,index:v}),n&&n(!0,v,o)}}),g=li({close:function(){a({visible:!1}),n&&n(!1,y,o)},changeIndex:function(u){a({index:u}),r&&r(u,o)}}),m=Z.useMemo(function(){return Ze({},o,x)},[o,x]);return ke.createElement(fw.Provider,{value:m},t,ke.createElement(Cw,Ze({images:f,visible:p,index:y,onIndexChange:g.changeIndex,onClose:g.close},i)))}function nu(){return nu=Object.assign?Object.assign.bind():function(e){for(var t=1;t=t?e.call(null):i.id=requestAnimationFrame(n)}var i={id:requestAnimationFrame(n)};return i}var Ya=-1;function ud(e){if(e===void 0&&(e=!1),Ya===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Ya=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Ya}var Un=null;function cd(e){if(e===void 0&&(e=!1),Un===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),i=n.style;return i.width="100px",i.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?Un="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?Un="negative":Un="positive-ascending"),document.body.removeChild(t),Un}return Un}var Lw=150,Pw=function(t,r){return t};function Fw(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,i=e.getItemSize,s=e.getOffsetForIndexAndAlignment,o=e.getStartIndexForOffset,a=e.getStopIndexForStartIndex,l=e.initInstanceProps,f=e.shouldResetStyleCacheOnItemSizeChange,p=e.validateProps;return t=function(y){Ow(x,y);function x(m){var u;return u=y.call(this,m)||this,u._instanceProps=l(u.props,sd(u)),u._outerRef=void 0,u._resetIsScrollingTimeoutId=null,u.state={instance:sd(u),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof u.props.initialScrollOffset=="number"?u.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},u._callOnItemsRendered=void 0,u._callOnItemsRendered=Xa(function(v,c,d,w){return u.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:c,visibleStartIndex:d,visibleStopIndex:w})}),u._callOnScroll=void 0,u._callOnScroll=Xa(function(v,c,d){return u.props.onScroll({scrollDirection:v,scrollOffset:c,scrollUpdateWasRequested:d})}),u._getItemStyle=void 0,u._getItemStyle=function(v){var c=u.props,d=c.direction,w=c.itemSize,k=c.layout,b=u._getItemStyleCache(f&&w,f&&k,f&&d),N;if(b.hasOwnProperty(v))N=b[v];else{var T=r(u.props,v,u._instanceProps),L=i(u.props,v,u._instanceProps),O=d==="horizontal"||k==="horizontal",F=d==="rtl",ee=O?T:0;b[v]=N={position:"absolute",left:F?void 0:ee,right:F?ee:void 0,top:O?0:T,height:O?"100%":L,width:O?L:"100%"}}return N},u._getItemStyleCache=void 0,u._getItemStyleCache=Xa(function(v,c,d){return{}}),u._onScrollHorizontal=function(v){var c=v.currentTarget,d=c.clientWidth,w=c.scrollLeft,k=c.scrollWidth;u.setState(function(b){if(b.scrollOffset===w)return null;var N=u.props.direction,T=w;if(N==="rtl")switch(cd()){case"negative":T=-w;break;case"positive-descending":T=k-d-w;break}return T=Math.max(0,Math.min(T,k-d)),{isScrolling:!0,scrollDirection:b.scrollOffsetN.clientWidth?ud():0:b=N.scrollHeight>N.clientHeight?ud():0}this.scrollTo(s(this.props,u,v,k,this._instanceProps,b))},g.componentDidMount=function(){var u=this.props,v=u.direction,c=u.initialScrollOffset,d=u.layout;if(typeof c=="number"&&this._outerRef!=null){var w=this._outerRef;v==="horizontal"||d==="horizontal"?w.scrollLeft=c:w.scrollTop=c}this._callPropsCallbacks()},g.componentDidUpdate=function(){var u=this.props,v=u.direction,c=u.layout,d=this.state,w=d.scrollOffset,k=d.scrollUpdateWasRequested;if(k&&this._outerRef!=null){var b=this._outerRef;if(v==="horizontal"||c==="horizontal")if(v==="rtl")switch(cd()){case"negative":b.scrollLeft=-w;break;case"positive-ascending":b.scrollLeft=w;break;default:var N=b.clientWidth,T=b.scrollWidth;b.scrollLeft=T-N-w;break}else b.scrollLeft=w;else b.scrollTop=w}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ld(this._resetIsScrollingTimeoutId)},g.render=function(){var u=this.props,v=u.children,c=u.className,d=u.direction,w=u.height,k=u.innerRef,b=u.innerElementType,N=u.innerTagName,T=u.itemCount,L=u.itemData,O=u.itemKey,F=O===void 0?Pw:O,ee=u.layout,R=u.outerElementType,U=u.outerTagName,_=u.style,q=u.useIsScrolling,se=u.width,Q=this.state.isScrolling,$=d==="horizontal"||ee==="horizontal",D=$?this._onScrollHorizontal:this._onScrollVertical,H=this._getRangeToRender(),I=H[0],A=H[1],V=[];if(T>0)for(var M=I;M<=A;M++)V.push(Z.createElement(v,{data:L,key:F(M,L),index:M,isScrolling:q?Q:void 0,style:this._getItemStyle(M)}));var W=n(this.props,this._instanceProps);return Z.createElement(R||U||"div",{className:c,onScroll:D,ref:this._outerRefSetter,style:nu({position:"relative",height:w,width:se,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:d},_)},Z.createElement(b||N||"div",{children:V,ref:k,style:{height:$?"100%":W,pointerEvents:Q?"none":void 0,width:$?W:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var u=this.props.itemCount;if(u>0){var v=this._getRangeToRender(),c=v[0],d=v[1],w=v[2],k=v[3];this._callOnItemsRendered(c,d,w,k)}}if(typeof this.props.onScroll=="function"){var b=this.state,N=b.scrollDirection,T=b.scrollOffset,L=b.scrollUpdateWasRequested;this._callOnScroll(N,T,L)}},g._getRangeToRender=function(){var u=this.props,v=u.itemCount,c=u.overscanCount,d=this.state,w=d.isScrolling,k=d.scrollDirection,b=d.scrollOffset;if(v===0)return[0,0,0,0];var N=o(this.props,b,this._instanceProps),T=a(this.props,N,b,this._instanceProps),L=!w||k==="backward"?Math.max(1,c):1,O=!w||k==="forward"?Math.max(1,c):1;return[Math.max(0,N-L),Math.max(0,Math.min(v-1,T+O)),N,T]},x}(Z.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Dw=function(t,r){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,r.instance},Mw=50,ti=function(t,r,n){var i=t,s=i.itemSize,o=n.itemMetadataMap,a=n.lastMeasuredIndex;if(r>a){var l=0;if(a>=0){var f=o[a];l=f.offset+f.size}for(var p=a+1;p<=r;p++){var y=s(p);o[p]={offset:l,size:y},l+=y}n.lastMeasuredIndex=r}return o[r]},Bw=function(t,r,n){var i=r.itemMetadataMap,s=r.lastMeasuredIndex,o=s>0?i[s].offset:0;return o>=n?xm(t,r,s,0,n):Uw(t,r,Math.max(0,s),n)},xm=function(t,r,n,i,s){for(;i<=n;){var o=i+Math.floor((n-i)/2),a=ti(t,o,r).offset;if(a===s)return o;as&&(n=o-1)}return i>0?i-1:0},Uw=function(t,r,n,i){for(var s=t.itemCount,o=1;n=n&&(o=n-1),o>=0){var l=i[o];a=l.offset+l.size}var f=n-o-1,p=f*s;return a+p},$w=Fw({getItemOffset:function(t,r,n){return ti(t,r,n).offset},getItemSize:function(t,r,n){return n.itemMetadataMap[r].size},getEstimatedTotalSize:fd,getOffsetForIndexAndAlignment:function(t,r,n,i,s,o){var a=t.direction,l=t.height,f=t.layout,p=t.width,y=a==="horizontal"||f==="horizontal",x=y?p:l,g=ti(t,r,s),m=fd(t,s),u=Math.max(0,Math.min(m-x,g.offset)),v=Math.max(0,g.offset-x+g.size+o);switch(n==="smart"&&(i>=v-x&&i<=u+x?n="auto":n="center"),n){case"start":return u;case"end":return v;case"center":return Math.round(v+(u-v)/2);case"auto":default:return i>=v&&i<=u?i:i{try{await $e.openInExplorer(t,e.path)}catch(o){console.error("Failed to open file:",o)}};return S.jsxs("div",{className:"fixed inset-0 z-50 bg-black bg-opacity-90 flex items-center justify-center",children:[S.jsxs("div",{className:"absolute top-0 left-0 right-0 h-16 bg-black bg-opacity-50 flex items-center justify-between px-4 z-10",children:[S.jsx("div",{className:"text-white text-sm truncate max-w-md",children:e.filename}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("button",{onClick:s,className:"p-2 text-white hover:bg-white hover:bg-opacity-20 rounded transition-colors",title:"在系统默认应用中打开",children:S.jsx(G1,{className:"w-5 h-5"})}),S.jsx("button",{onClick:r,className:"p-2 text-white hover:bg-white hover:bg-opacity-20 rounded transition-colors",children:S.jsx(vm,{className:"w-6 h-6"})})]})]}),S.jsxs("div",{className:"w-full h-full flex items-center justify-center p-20",children:[n==="video"&&S.jsx("video",{src:i,controls:!0,autoPlay:!0,className:"max-w-full max-h-full rounded shadow-2xl",onError:o=>{console.error("Video load error:",o),alert("视频加载失败,请尝试在系统默认应用中打开")},children:"您的浏览器不支持视频播放"}),n==="audio"&&S.jsxs("div",{className:"flex flex-col items-center justify-center",children:[S.jsx("div",{className:"text-white text-6xl mb-8",children:"🎵"}),S.jsx("audio",{src:i,controls:!0,autoPlay:!0,className:"w-96 rounded shadow-2xl",onError:o=>{console.error("Audio load error:",o),alert("音频加载失败,请尝试在系统默认应用中打开")},children:"您的浏览器不支持音频播放"}),S.jsx("p",{className:"text-white mt-4 text-sm opacity-70",children:e.filename})]}),n==="document"&&S.jsx("div",{className:"w-full h-full bg-white rounded shadow-2xl overflow-hidden",children:e.format==="pdf"?S.jsx("iframe",{src:i,className:"w-full h-full",title:e.filename}):S.jsx("iframe",{src:i,className:"w-full h-full",title:e.filename,sandbox:"allow-same-origin"})}),(n==="design"||n==="other"||!n)&&S.jsxs("div",{className:"text-center text-white",children:[S.jsx("p",{className:"mb-4",children:"此文件类型需要在专业软件中打开"}),S.jsx("button",{onClick:s,className:"px-6 py-3 bg-blue-500 hover:bg-blue-600 rounded-lg transition-colors",children:"在系统默认应用中打开"})]})]}),S.jsx("div",{className:"absolute inset-0 -z-10",onClick:r})]})}const Hw=100,Vw=500;function qw(){const{filteredImages:e,currentLibraryId:t,thumbnailHeight:r,selectedImage:n,setSelectedImage:i,selectedImages:s,setSelectedImages:o,toggleImageSelection:a,clearSelection:l,isResizingPanels:f,imageLoadingState:p,selectedFolder:y,searchKeywords:x,filters:g,appendImages:m,setImageLoadingState:u}=me(),v=Z.useRef(null),c=Z.useRef(null),d=Z.useRef(null),w=Z.useRef(0),[k,b]=Z.useState(0),[N,T]=Z.useState(0),[L,O]=Z.useState(-1),[F,ee]=Z.useState(null),[R,U]=Z.useState(null),[_,q]=Z.useState([]),se=Z.useCallback(async()=>{var le;if(!t||!p.hasMore||p.isLoading)return;const Y=Ft.createRequest(ps.IMAGES);u({isLoading:!0});try{const h={offset:p.loadedCount,limit:200};y&&(h.folder=y),x&&(h.keywords=x),((le=g.formats)==null?void 0:le.length)>0&&(h.formats=g.formats.join(","));const z=await $e.search(t,h,{signal:Y.signal});if(!Ft.isValid(Y.id))return;const{images:P,total:C,hasMore:E}=z.data;Ft.complete(Y.id),m(P),u({isLoading:!1,loadedCount:p.loadedCount+P.length,totalCount:C,hasMore:E||!1})}catch(h){if(h.name==="CanceledError"||h.name==="AbortError")return;console.error("Error loading more images:",h),Ft.error(Y.id),u({isLoading:!1})}},[t,p,y,x,g,m,u]);Z.useEffect(()=>{let Y=null,le=0;const h=10,z={current:0};let P=null;const C=(X,G)=>(Math.abs(X-z.current)<12||(z.current=X,P&&clearTimeout(P),P=setTimeout(()=>{b(X),T(G)},50)),!0),E=()=>{if(v.current){const X=v.current.offsetWidth-32,G=v.current.offsetHeight;if(X>0)return C(X,G)}return!1},j=()=>{E()?v.current&&(Y=new ResizeObserver(()=>{me.getState().isResizingPanels||E()}),Y.observe(v.current)):le{Y&&Y.disconnect(),P&&clearTimeout(P)}},[]),Z.useEffect(()=>{if(f||!v.current)return;const Y=v.current.offsetWidth-32,le=v.current.offsetHeight;Y>0&&(b(Y),T(le),c.current&&c.current.resetAfterIndex(0))},[f]);const Q=e.length>Vw,$=Z.useRef({length:0,firstId:null,libraryId:null}),D=Z.useRef(!1);Z.useEffect(()=>{var E;const Y=$.current.length,le=e.length,h=$.current.firstId,z=(E=e[0])==null?void 0:E.id,P=$.current.libraryId;Y>0&&le===0||z!==h||t!==P?(q([]),w.current=0,D.current=!1,d.current&&d.current.postMessage({reset:!0,requestId:0})):le>Y&&(D.current=!0),$.current={length:le,firstId:z,libraryId:t}},[e,t]),Z.useEffect(()=>(typeof Worker<"u"&&(d.current=new Worker(new URL("/assets/layoutWorker-D6X91dDa.js",import.meta.url),{type:"module"}),d.current.onmessage=Y=>{const{rows:le,requestId:h}=Y.data;h===w.current&&q(le)}),()=>{d.current&&(d.current.terminate(),d.current=null)}),[]),Z.useEffect(()=>{if(!Q||!d.current||!e.length||!k)return;const Y=++w.current,le=e.map(h=>({id:h.id,width:h.width,height:h.height,filename:h.filename,thumbnail_path:h.thumbnail_path,path:h.path,file_type:h.file_type,format:h.format}));d.current.postMessage({images:le,containerWidth:k,targetHeight:r,requestId:Y,incremental:D.current})},[e,k,r,Q]);const H=Z.useMemo(()=>{if(Q)return[];if(!e.length||!k)return[];const Y=16,le=r,h=[];let z=[],P=0;return e.forEach((C,E)=>{const j=C.width/C.height,X=le*j;z.push({...C,originalWidth:X,aspectRatio:j}),P+=X;const G=(z.length-1)*Y,B=P+G,re=E===e.length-1;let ue=!1;if(re)ue=!0;else if(B>=k*.95)ue=!0;else{const ne=e[E+1];if(ne){const pe=ne.width/ne.height,ve=le*pe;P+ve+z.length*Y>k*1.2&&(ue=!0)}}if(ue){const ne=(z.length-1)*Y;let ve=(k-ne)/P;re&&z.length<3&&(ve=Math.min(ve,1.2));const ye=le*ve;z=z.map(We=>({...We,calculatedWidth:We.originalWidth*ve,calculatedHeight:ye})),h.push(z),z=[],P=0}}),h},[e,r,k,Q]),I=Q?_:H,A=Y=>{if(!t||!Y.thumbnail_path)return"";const le=Y.thumbnail_path.replace(/\\/g,"/").split("/").pop();return $e.getThumbnailUrl(t,"480",le)},V=Y=>t?$e.getOriginalUrl(t,Y.path):"",M=Z.useMemo(()=>e.map(Y=>({src:V(Y),key:Y.id})),[e,t]),W=e.length>Hw,oe=Z.useCallback(Y=>!I[Y]||I[Y].length===0?r+40:I[Y][0].calculatedHeight+28+32,[I,r]),he=Z.useRef(0);Z.useEffect(()=>{if(c.current&&W){const Y=he.current,le=I.length;le>Y&&Y>0?c.current.resetAfterIndex(Math.max(0,Y-1)):c.current.resetAfterIndex(0),he.current=le}},[I,W]);const ce=Z.useMemo(()=>I.flat(),[I]),fe=Z.useCallback((Y,le,h)=>{if(le.ctrlKey||le.metaKey)le.preventDefault(),a(Y),ee(h);else if(le.shiftKey&&F!==null){le.preventDefault();const z=Math.min(F,h),P=Math.max(F,h),C=ce.slice(z,P+1);o(C)}else l(),i(Y),ee(h)},[ce,F,a,o,l,i]),J=(Y,le)=>{const h=(n==null?void 0:n.id)===Y.id,z=s.some(C=>C.id===Y.id),P=h||z;return S.jsxs("div",{className:"flex-shrink-0",style:{width:`${Y.calculatedWidth}px`},children:[S.jsxs("div",{className:"relative group cursor-pointer overflow-hidden rounded-lg transition-all hover:shadow-lg",style:{height:`${Y.calculatedHeight}px`,backgroundColor:"#2a2a2a",border:P?"3px solid #3b82f6":"3px solid transparent"},onClick:C=>fe(Y,C,le),onDoubleClick:()=>{(Y.file_type||"image")==="image"?O(le):U(Y)},children:[S.jsx("img",{src:A(Y),alt:Y.filename,className:"w-full h-full object-cover",loading:"lazy",onError:C=>{C.target.style.display="none"}}),Y.file_type&&Y.file_type!=="image"&&S.jsxs("div",{className:`absolute top-2 right-2 rounded-md px-2 py-1 flex items-center gap-1 shadow-lg ${Y.file_type==="video"?"bg-blue-500 bg-opacity-90":Y.file_type==="audio"?"bg-pink-500 bg-opacity-90":Y.file_type==="document"?"bg-green-500 bg-opacity-90":Y.file_type==="design"?"bg-purple-500 bg-opacity-90":"bg-gray-500 bg-opacity-90"}`,children:[Y.file_type==="video"&&S.jsx(ym,{className:"w-4 h-4 text-white fill-white"}),Y.file_type==="audio"&&S.jsx(nw,{className:"w-4 h-4 text-white"}),Y.file_type==="document"&&S.jsx(J1,{className:"w-4 h-4 text-white"}),Y.file_type==="design"&&S.jsx(iw,{className:"w-4 h-4 text-white"}),Y.file_type==="other"&&S.jsx(ew,{className:"w-4 h-4 text-white"}),S.jsx("span",{className:"text-white text-xs font-semibold uppercase",children:Y.format||Y.filename.split(".").pop()})]}),S.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-0 group-hover:bg-opacity-20 transition-all pointer-events-none"})]}),S.jsx("div",{className:"mt-1 px-1",children:S.jsx("p",{className:"text-xs truncate text-center transition-colors",style:{color:P?"#3b82f6":"#909090",fontWeight:P?"600":"400"},children:Y.filename})})]},Y.id)},ae=({index:Y,style:le})=>{var P;const h=I[Y];if(!h)return null;let z=0;for(let C=0;CJ(C,z+E))})};return e.length?Q&&I.length===0&&e.length>0&&k>0?S.jsx("div",{ref:v,className:"flex items-center justify-center h-full text-gray-500 dark:text-gray-400",children:S.jsxs("div",{className:"text-center",children:[S.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-blue-500 border-t-transparent rounded-full mx-auto mb-2"}),S.jsx("p",{className:"text-sm",children:"正在计算布局..."})]})}):!k&&e.length>0?S.jsx("div",{ref:v,className:"h-full overflow-hidden"}):S.jsxs("div",{ref:v,className:"h-full overflow-hidden",children:[S.jsx(Tw,{images:M,visible:L>=0,onClose:()=>O(-1),index:L,onIndexChange:O,children:W?S.jsx($w,{ref:c,height:N||600,width:k+32,itemCount:I.length,itemSize:oe,className:"p-4",overscanCount:3,onScroll:({scrollOffset:Y,scrollDirection:le})=>{if(le==="forward"&&p.hasMore&&!p.isLoading){const h=I.reduce((P,C,E)=>P+oe(E),0),z=Y+(N||600);h-z<500&&se()}},children:ae}):S.jsx("div",{className:"h-full overflow-y-auto p-4",onScroll:Y=>{if(p.hasMore&&!p.isLoading){const{scrollTop:le,scrollHeight:h,clientHeight:z}=Y.target;h-le-z<500&&se()}},children:S.jsx("div",{className:"space-y-8",children:I.map((Y,le)=>{var z;let h=0;for(let P=0;PJ(P,h+C))},le)})})})}),R&&S.jsx(Ww,{file:R,libraryId:t,onClose:()=>U(null)})]}):S.jsx("div",{ref:v,className:"flex items-center justify-center h-full text-gray-500 dark:text-gray-400",children:S.jsxs("div",{className:"text-center",children:[S.jsx("p",{className:"text-lg mb-2",children:"暂无图片"}),S.jsx("p",{className:"text-sm",children:"请添加素材库或调整搜索条件"})]})})}function Kw(){const{totalImageCount:e,folders:t,currentLibraryId:r,getCurrentLibrary:n}=me(),i=n(),s=t.length,o=t.filter(a=>!a.parent_path||a.parent_path==="."||a.parent_path==="");return S.jsx("div",{className:"flex-1 h-full overflow-y-auto bg-gray-50 dark:bg-gray-900 p-8",children:S.jsxs("div",{className:"max-w-4xl mx-auto",children:[S.jsxs("div",{className:"mb-8",children:[S.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-2",children:(i==null?void 0:i.name)||"素材库"}),S.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:i==null?void 0:i.path})]}),S.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-12",children:[S.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-xl p-6 shadow-sm border border-gray-100 dark:border-gray-700",children:S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("div",{className:"p-3 bg-blue-100 dark:bg-blue-900/30 rounded-lg text-blue-600 dark:text-blue-400",children:S.jsx(rw,{className:"w-6 h-6"})}),S.jsxs("div",{children:[S.jsx("div",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:e.toLocaleString()}),S.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"总图片数"})]})]})}),S.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-xl p-6 shadow-sm border border-gray-100 dark:border-gray-700",children:S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("div",{className:"p-3 bg-indigo-100 dark:bg-indigo-900/30 rounded-lg text-indigo-600 dark:text-indigo-400",children:S.jsx(Zi,{className:"w-6 h-6"})}),S.jsxs("div",{children:[S.jsx("div",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:s.toLocaleString()}),S.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"文件夹"})]})]})}),S.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-xl p-6 shadow-sm border border-gray-100 dark:border-gray-700",children:S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("div",{className:"p-3 bg-purple-100 dark:bg-purple-900/30 rounded-lg text-purple-600 dark:text-purple-400",children:S.jsx(Bo,{className:"w-6 h-6"})}),S.jsxs("div",{children:[S.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white mb-1",children:"快速开始"}),S.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:"使用左侧目录树浏览或顶部搜索栏查找图片"})]})]})})]}),o.length>0&&S.jsxs("div",{children:[S.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:"根目录文件夹"}),S.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:o.map(a=>S.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg p-4 shadow-sm border border-gray-100 dark:border-gray-700 hover:shadow-md transition-shadow cursor-pointer group",onClick:()=>me.getState().setSelectedFolder(a.path),children:[S.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[S.jsx(Zi,{className:"w-8 h-8 text-yellow-500 group-hover:text-yellow-400 transition-colors"}),S.jsx("div",{className:"flex-1 min-w-0",children:S.jsx("div",{className:"font-medium text-gray-900 dark:text-white truncate",title:a.name,children:a.name})})]}),S.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:[a.image_count||0," 张图片"]})]},a.path))})]}),o.length===0&&S.jsxs("div",{className:"text-center py-12 bg-white dark:bg-gray-800 rounded-xl border border-dashed border-gray-300 dark:border-gray-700",children:[S.jsx(Zi,{className:"w-12 h-12 text-gray-300 dark:text-gray-600 mx-auto mb-4"}),S.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:"暂无文件夹"}),S.jsx("p",{className:"text-gray-500 dark:text-gray-400 max-w-sm mx-auto",children:"您的素材库似乎是空的。请将图片添加到素材库目录中,系统会自动扫描。"})]})]})})}function dd(){const{currentLibraryId:e,searchKeywords:t,filters:r,selectedFolder:n,setImages:i,scanProgress:s,imageLoadingState:o}=me(),a=Z.useRef(null),l=Z.useRef(null),[f,p]=Z.useState(!1),[y,x]=Z.useState(!1),g=()=>{if(!s||s.current===0)return null;if(s.estimatedTimeLeft!==void 0){const d=s.estimatedTimeLeft;return d<1?"即将完成":d<60?`剩余约 ${d} 秒`:`剩余约 ${Math.floor(d/60)} 分钟`}return null},m=Z.useCallback(()=>{Ft.cancelAll(ps.IMAGES),a.current=null},[]),u=Z.useCallback(async()=>{var w;if(!e)return;if(!n&&!t&&r.formats.length===0){i([]),me.getState().setImageLoadingState({isLoading:!1,loadedCount:0,totalCount:0,hasMore:!1});return}Jl(),m();const d=Ft.createRequest(ps.IMAGES);a.current=d,me.getState().setImageLoadingState({isLoading:!0,loadedCount:0,totalCount:0,hasMore:!1});try{const k={offset:0,limit:200};n&&(k.folder=n),t&&(k.keywords=t),((w=r.formats)==null?void 0:w.length)>0&&(k.formats=r.formats.join(","));const b=await $e.search(e,k,{signal:d.signal});if(!Ft.isValid(d.id))return;const{images:N,total:T,hasMore:L}=b.data;Ft.complete(d.id),i(N),me.getState().setImageLoadingState({isLoading:!1,loadedCount:N.length,totalCount:T||N.length,hasMore:L||!1}),L&&uw(L)}catch(k){if(k.name==="CanceledError"||k.name==="AbortError")return;console.error("Error loading images:",k),Ft.error(d.id)}finally{(Ft.isValid(d.id)||d.status==="completed")&&(a.current=null)}},[e,t,r,n,i,m]);Z.useEffect(()=>{if(e)return l.current&&clearTimeout(l.current),m(),i([]),l.current=setTimeout(()=>{u()},50),()=>{l.current&&clearTimeout(l.current)}},[e,t,r,n,u,m,i]),Z.useEffect(()=>()=>{m(),l.current&&clearTimeout(l.current)},[m]);const v=async()=>{if(!(!e||y)){x(!0);try{await sn.stop(e),p(!0)}catch(d){console.error("Error stopping scan:",d)}finally{x(!1)}}},c=async()=>{if(!(!e||y)){x(!0);try{s!=null&&s.needsRescan?await sn.sync(e):await sn.resume(e),p(!1)}catch(d){console.error("Error resuming scan:",d)}finally{x(!1)}}};return Z.useEffect(()=>{s?s.isPaused?p(!0):s.percent===100&&p(!1):p(!1)},[s]),S.jsxs("div",{className:"flex flex-col h-full bg-gray-50 dark:bg-gray-900",children:[s&&S.jsxs("div",{className:`p-4 border-b ${f?"bg-yellow-50 dark:bg-yellow-900 border-yellow-200 dark:border-yellow-700":"bg-blue-50 dark:bg-blue-900 border-blue-200 dark:border-blue-700"}`,children:[S.jsxs("div",{className:"flex items-center justify-between mb-2",children:[S.jsx("div",{className:`text-sm font-medium ${f?"text-yellow-700 dark:text-yellow-300":"text-blue-700 dark:text-blue-300"}`,children:f?"扫描已暂停":(s==null?void 0:s.status)==="preparing"?"正在准备扫描...":"正在扫描素材库,期间建议勿操作,否则会影响扫描速度"}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsxs("span",{className:`text-sm ${f?"text-yellow-600":"text-blue-600"}`,children:[(s==null?void 0:s.percent)||0,"%"]}),((s==null?void 0:s.canStop)||f)&&S.jsx("button",{onClick:f?c:v,disabled:y,className:`p-1.5 rounded-md ${f?"bg-green-500 hover:bg-green-600":"bg-yellow-500 hover:bg-yellow-600"} text-white`,children:f?S.jsx(ym,{className:"w-4 h-4"}):S.jsx(sw,{className:"w-4 h-4"})})]})]}),S.jsx("div",{className:`w-full rounded-full h-2 mb-2 ${f?"bg-yellow-200":"bg-blue-200"}`,children:S.jsx("div",{className:`h-2 rounded-full transition-all ${f?"bg-yellow-500":"bg-blue-500"}`,style:{width:`${(s==null?void 0:s.percent)||0}%`}})}),S.jsxs("div",{className:`text-xs ${f?"text-yellow-600":"text-blue-600"}`,children:["已处理 ",(s==null?void 0:s.current)||0," / ",(s==null?void 0:s.total)||0," 张图片",g()&&` · ${g()}`]})]}),o.hasMore&&o.loadedCount>0&&S.jsx("div",{className:"px-4 py-2 bg-gray-100 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:S.jsxs("div",{className:"flex items-center justify-between text-sm",children:[S.jsxs("span",{className:"text-gray-600 dark:text-gray-400",children:["已加载 ",o.loadedCount," / ",o.totalCount," 张"]}),S.jsx("div",{className:"w-32 h-1.5 bg-gray-200 rounded-full overflow-hidden",children:S.jsx("div",{className:"h-full bg-blue-500",style:{width:`${o.loadedCount/o.totalCount*100}%`}})})]})}),S.jsx("div",{className:"flex-1 overflow-hidden",children:!n&&!t&&r.formats.length===0?S.jsx(Kw,{}):S.jsx(qw,{})})]})}function Xs(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var _m={exports:{}};/*! - -JSZip v3.10.1 - A JavaScript class for generating and reading zip files - - -(c) 2009-2016 Stuart Knightley -Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. - -JSZip uses the library pako released under the MIT license : -https://github.com/nodeca/pako/blob/main/LICENSE -*/(function(e,t){(function(r){e.exports=r()})(function(){return function r(n,i,s){function o(f,p){if(!i[f]){if(!n[f]){var y=typeof Xs=="function"&&Xs;if(!p&&y)return y(f,!0);if(a)return a(f,!0);var x=new Error("Cannot find module '"+f+"'");throw x.code="MODULE_NOT_FOUND",x}var g=i[f]={exports:{}};n[f][0].call(g.exports,function(m){var u=n[f][1][m];return o(u||m)},g,g.exports,r,n,i,s)}return i[f].exports}for(var a=typeof Xs=="function"&&Xs,l=0;l>2,g=(3&f)<<4|p>>4,m=1>6:64,u=2>4,p=(15&x)<<4|(g=a.indexOf(l.charAt(u++)))>>2,y=(3&g)<<6|(m=a.indexOf(l.charAt(u++))),d[v++]=f,g!==64&&(d[v++]=p),m!==64&&(d[v++]=y);return d}},{"./support":30,"./utils":32}],2:[function(r,n,i){var s=r("./external"),o=r("./stream/DataWorker"),a=r("./stream/Crc32Probe"),l=r("./stream/DataLengthProbe");function f(p,y,x,g,m){this.compressedSize=p,this.uncompressedSize=y,this.crc32=x,this.compression=g,this.compressedContent=m}f.prototype={getContentWorker:function(){var p=new o(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),y=this;return p.on("end",function(){if(this.streamInfo.data_length!==y.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),p},getCompressedWorker:function(){return new o(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},f.createWorkerFrom=function(p,y,x){return p.pipe(new a).pipe(new l("uncompressedSize")).pipe(y.compressWorker(x)).pipe(new l("compressedSize")).withStreamInfo("compression",y)},n.exports=f},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(r,n,i){var s=r("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},i.DEFLATE=r("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(r,n,i){var s=r("./utils"),o=function(){for(var a,l=[],f=0;f<256;f++){a=f;for(var p=0;p<8;p++)a=1&a?3988292384^a>>>1:a>>>1;l[f]=a}return l}();n.exports=function(a,l){return a!==void 0&&a.length?s.getTypeOf(a)!=="string"?function(f,p,y,x){var g=o,m=x+y;f^=-1;for(var u=x;u>>8^g[255&(f^p[u])];return-1^f}(0|l,a,a.length,0):function(f,p,y,x){var g=o,m=x+y;f^=-1;for(var u=x;u>>8^g[255&(f^p.charCodeAt(u))];return-1^f}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(r,n,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(r,n,i){var s=null;s=typeof Promise<"u"?Promise:r("lie"),n.exports={Promise:s}},{lie:37}],7:[function(r,n,i){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=r("pako"),a=r("./utils"),l=r("./stream/GenericWorker"),f=s?"uint8array":"array";function p(y,x){l.call(this,"FlateWorker/"+y),this._pako=null,this._pakoAction=y,this._pakoOptions=x,this.meta={}}i.magic="\b\0",a.inherits(p,l),p.prototype.processChunk=function(y){this.meta=y.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(f,y.data),!1)},p.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},p.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},p.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var y=this;this._pako.onData=function(x){y.push({data:x,meta:y.meta})}},i.compressWorker=function(y){return new p("Deflate",y)},i.uncompressWorker=function(){return new p("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(r,n,i){function s(g,m){var u,v="";for(u=0;u>>=8;return v}function o(g,m,u,v,c,d){var w,k,b=g.file,N=g.compression,T=d!==f.utf8encode,L=a.transformTo("string",d(b.name)),O=a.transformTo("string",f.utf8encode(b.name)),F=b.comment,ee=a.transformTo("string",d(F)),R=a.transformTo("string",f.utf8encode(F)),U=O.length!==b.name.length,_=R.length!==F.length,q="",se="",Q="",$=b.dir,D=b.date,H={crc32:0,compressedSize:0,uncompressedSize:0};m&&!u||(H.crc32=g.crc32,H.compressedSize=g.compressedSize,H.uncompressedSize=g.uncompressedSize);var I=0;m&&(I|=8),T||!U&&!_||(I|=2048);var A=0,V=0;$&&(A|=16),c==="UNIX"?(V=798,A|=function(W,oe){var he=W;return W||(he=oe?16893:33204),(65535&he)<<16}(b.unixPermissions,$)):(V=20,A|=function(W){return 63&(W||0)}(b.dosPermissions)),w=D.getUTCHours(),w<<=6,w|=D.getUTCMinutes(),w<<=5,w|=D.getUTCSeconds()/2,k=D.getUTCFullYear()-1980,k<<=4,k|=D.getUTCMonth()+1,k<<=5,k|=D.getUTCDate(),U&&(se=s(1,1)+s(p(L),4)+O,q+="up"+s(se.length,2)+se),_&&(Q=s(1,1)+s(p(ee),4)+R,q+="uc"+s(Q.length,2)+Q);var M="";return M+=` -\0`,M+=s(I,2),M+=N.magic,M+=s(w,2),M+=s(k,2),M+=s(H.crc32,4),M+=s(H.compressedSize,4),M+=s(H.uncompressedSize,4),M+=s(L.length,2),M+=s(q.length,2),{fileRecord:y.LOCAL_FILE_HEADER+M+L+q,dirRecord:y.CENTRAL_FILE_HEADER+s(V,2)+M+s(ee.length,2)+"\0\0\0\0"+s(A,4)+s(v,4)+L+q+ee}}var a=r("../utils"),l=r("../stream/GenericWorker"),f=r("../utf8"),p=r("../crc32"),y=r("../signature");function x(g,m,u,v){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=m,this.zipPlatform=u,this.encodeFileName=v,this.streamFiles=g,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(x,l),x.prototype.push=function(g){var m=g.meta.percent||0,u=this.entriesCount,v=this._sources.length;this.accumulate?this.contentBuffer.push(g):(this.bytesWritten+=g.data.length,l.prototype.push.call(this,{data:g.data,meta:{currentFile:this.currentFile,percent:u?(m+100*(u-v-1))/u:100}}))},x.prototype.openedSource=function(g){this.currentSourceOffset=this.bytesWritten,this.currentFile=g.file.name;var m=this.streamFiles&&!g.file.dir;if(m){var u=o(g,m,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:u.fileRecord,meta:{percent:0}})}else this.accumulate=!0},x.prototype.closedSource=function(g){this.accumulate=!1;var m=this.streamFiles&&!g.file.dir,u=o(g,m,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(u.dirRecord),m)this.push({data:function(v){return y.DATA_DESCRIPTOR+s(v.crc32,4)+s(v.compressedSize,4)+s(v.uncompressedSize,4)}(g),meta:{percent:100}});else for(this.push({data:u.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},x.prototype.flush=function(){for(var g=this.bytesWritten,m=0;m=this.index;l--)f=(f<<8)+this.byteAt(l);return this.index+=a,f},readString:function(a){return s.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},n.exports=o},{"../utils":32}],19:[function(r,n,i){var s=r("./Uint8ArrayReader");function o(a){s.call(this,a)}r("../utils").inherits(o,s),o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,n,i){var s=r("./DataReader");function o(a){s.call(this,a)}r("../utils").inherits(o,s),o.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},o.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},o.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=o},{"../utils":32,"./DataReader":18}],21:[function(r,n,i){var s=r("./ArrayReader");function o(a){s.call(this,a)}r("../utils").inherits(o,s),o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(r,n,i){var s=r("../utils"),o=r("../support"),a=r("./ArrayReader"),l=r("./StringReader"),f=r("./NodeBufferReader"),p=r("./Uint8ArrayReader");n.exports=function(y){var x=s.getTypeOf(y);return s.checkSupport(x),x!=="string"||o.uint8array?x==="nodebuffer"?new f(y):o.uint8array?new p(s.transformTo("uint8array",y)):new a(s.transformTo("array",y)):new l(y)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(r,n,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,n,i){var s=r("./GenericWorker"),o=r("../utils");function a(l){s.call(this,"ConvertWorker to "+l),this.destType=l}o.inherits(a,s),a.prototype.processChunk=function(l){this.push({data:o.transformTo(this.destType,l.data),meta:l.meta})},n.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(r,n,i){var s=r("./GenericWorker"),o=r("../crc32");function a(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(a,s),a.prototype.processChunk=function(l){this.streamInfo.crc32=o(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,n,i){var s=r("../utils"),o=r("./GenericWorker");function a(l){o.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}s.inherits(a,o),a.prototype.processChunk=function(l){if(l){var f=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=f+l.data.length}o.prototype.processChunk.call(this,l)},n.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(r,n,i){var s=r("../utils"),o=r("./GenericWorker");function a(l){o.call(this,"DataWorker");var f=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(p){f.dataIsReady=!0,f.data=p,f.max=p&&p.length||0,f.type=s.getTypeOf(p),f.isPaused||f._tickAndRepeat()},function(p){f.error(p)})}s.inherits(a,o),a.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,f=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,f);break;case"uint8array":l=this.data.subarray(this.index,f);break;case"array":case"nodebuffer":l=this.data.slice(this.index,f)}return this.index=f,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(r,n,i){function s(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,a){return this._listeners[o].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,a){if(this._listeners[o])for(var l=0;l "+o:o}},n.exports=s},{}],29:[function(r,n,i){var s=r("../utils"),o=r("./ConvertWorker"),a=r("./GenericWorker"),l=r("../base64"),f=r("../support"),p=r("../external"),y=null;if(f.nodestream)try{y=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function x(m,u){return new p.Promise(function(v,c){var d=[],w=m._internalType,k=m._outputType,b=m._mimeType;m.on("data",function(N,T){d.push(N),u&&u(T)}).on("error",function(N){d=[],c(N)}).on("end",function(){try{var N=function(T,L,O){switch(T){case"blob":return s.newBlob(s.transformTo("arraybuffer",L),O);case"base64":return l.encode(L);default:return s.transformTo(T,L)}}(k,function(T,L){var O,F=0,ee=null,R=0;for(O=0;O"u")i.blob=!1;else{var s=new ArrayBuffer(0);try{i.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(s),i.blob=o.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!r("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(r,n,i){for(var s=r("./utils"),o=r("./support"),a=r("./nodejsUtils"),l=r("./stream/GenericWorker"),f=new Array(256),p=0;p<256;p++)f[p]=252<=p?6:248<=p?5:240<=p?4:224<=p?3:192<=p?2:1;f[254]=f[254]=1;function y(){l.call(this,"utf-8 decode"),this.leftOver=null}function x(){l.call(this,"utf-8 encode")}i.utf8encode=function(g){return o.nodebuffer?a.newBufferFrom(g,"utf-8"):function(m){var u,v,c,d,w,k=m.length,b=0;for(d=0;d>>6:(v<65536?u[w++]=224|v>>>12:(u[w++]=240|v>>>18,u[w++]=128|v>>>12&63),u[w++]=128|v>>>6&63),u[w++]=128|63&v);return u}(g)},i.utf8decode=function(g){return o.nodebuffer?s.transformTo("nodebuffer",g).toString("utf-8"):function(m){var u,v,c,d,w=m.length,k=new Array(2*w);for(u=v=0;u>10&1023,k[v++]=56320|1023&c)}return k.length!==v&&(k.subarray?k=k.subarray(0,v):k.length=v),s.applyFromCharCode(k)}(g=s.transformTo(o.uint8array?"uint8array":"array",g))},s.inherits(y,l),y.prototype.processChunk=function(g){var m=s.transformTo(o.uint8array?"uint8array":"array",g.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var u=m;(m=new Uint8Array(u.length+this.leftOver.length)).set(this.leftOver,0),m.set(u,this.leftOver.length)}else m=this.leftOver.concat(m);this.leftOver=null}var v=function(d,w){var k;for((w=w||d.length)>d.length&&(w=d.length),k=w-1;0<=k&&(192&d[k])==128;)k--;return k<0||k===0?w:k+f[d[k]]>w?k:w}(m),c=m;v!==m.length&&(o.uint8array?(c=m.subarray(0,v),this.leftOver=m.subarray(v,m.length)):(c=m.slice(0,v),this.leftOver=m.slice(v,m.length))),this.push({data:i.utf8decode(c),meta:g.meta})},y.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=y,s.inherits(x,l),x.prototype.processChunk=function(g){this.push({data:i.utf8encode(g.data),meta:g.meta})},i.Utf8EncodeWorker=x},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,n,i){var s=r("./support"),o=r("./base64"),a=r("./nodejsUtils"),l=r("./external");function f(u){return u}function p(u,v){for(var c=0;c>8;this.dir=!!(16&this.externalFileAttributes),g==0&&(this.dosPermissions=63&this.externalFileAttributes),g==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var g=s(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=g.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=g.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=g.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=g.readInt(4))}},readExtraFields:function(g){var m,u,v,c=g.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});g.index+4>>6:(g<65536?x[v++]=224|g>>>12:(x[v++]=240|g>>>18,x[v++]=128|g>>>12&63),x[v++]=128|g>>>6&63),x[v++]=128|63&g);return x},i.buf2binstring=function(y){return p(y,y.length)},i.binstring2buf=function(y){for(var x=new s.Buf8(y.length),g=0,m=x.length;g>10&1023,d[m++]=56320|1023&u)}return p(d,m)},i.utf8border=function(y,x){var g;for((x=x||y.length)>y.length&&(x=y.length),g=x-1;0<=g&&(192&y[g])==128;)g--;return g<0||g===0?x:g+l[y[g]]>x?g:x}},{"./common":41}],43:[function(r,n,i){n.exports=function(s,o,a,l){for(var f=65535&s|0,p=s>>>16&65535|0,y=0;a!==0;){for(a-=y=2e3>>1:o>>>1;a[l]=o}return a}();n.exports=function(o,a,l,f){var p=s,y=f+l;o^=-1;for(var x=f;x>>8^p[255&(o^a[x])];return-1^o}},{}],46:[function(r,n,i){var s,o=r("../utils/common"),a=r("./trees"),l=r("./adler32"),f=r("./crc32"),p=r("./messages"),y=0,x=4,g=0,m=-2,u=-1,v=4,c=2,d=8,w=9,k=286,b=30,N=19,T=2*k+1,L=15,O=3,F=258,ee=F+O+1,R=42,U=113,_=1,q=2,se=3,Q=4;function $(h,z){return h.msg=p[z],z}function D(h){return(h<<1)-(4h.avail_out&&(P=h.avail_out),P!==0&&(o.arraySet(h.output,z.pending_buf,z.pending_out,P,h.next_out),h.next_out+=P,z.pending_out+=P,h.total_out+=P,h.avail_out-=P,z.pending-=P,z.pending===0&&(z.pending_out=0))}function A(h,z){a._tr_flush_block(h,0<=h.block_start?h.block_start:-1,h.strstart-h.block_start,z),h.block_start=h.strstart,I(h.strm)}function V(h,z){h.pending_buf[h.pending++]=z}function M(h,z){h.pending_buf[h.pending++]=z>>>8&255,h.pending_buf[h.pending++]=255&z}function W(h,z){var P,C,E=h.max_chain_length,j=h.strstart,X=h.prev_length,G=h.nice_match,B=h.strstart>h.w_size-ee?h.strstart-(h.w_size-ee):0,re=h.window,ue=h.w_mask,ne=h.prev,pe=h.strstart+F,ve=re[j+X-1],ye=re[j+X];h.prev_length>=h.good_match&&(E>>=2),G>h.lookahead&&(G=h.lookahead);do if(re[(P=z)+X]===ye&&re[P+X-1]===ve&&re[P]===re[j]&&re[++P]===re[j+1]){j+=2,P++;do;while(re[++j]===re[++P]&&re[++j]===re[++P]&&re[++j]===re[++P]&&re[++j]===re[++P]&&re[++j]===re[++P]&&re[++j]===re[++P]&&re[++j]===re[++P]&&re[++j]===re[++P]&&jB&&--E!=0);return X<=h.lookahead?X:h.lookahead}function oe(h){var z,P,C,E,j,X,G,B,re,ue,ne=h.w_size;do{if(E=h.window_size-h.lookahead-h.strstart,h.strstart>=ne+(ne-ee)){for(o.arraySet(h.window,h.window,ne,ne,0),h.match_start-=ne,h.strstart-=ne,h.block_start-=ne,z=P=h.hash_size;C=h.head[--z],h.head[z]=ne<=C?C-ne:0,--P;);for(z=P=ne;C=h.prev[--z],h.prev[z]=ne<=C?C-ne:0,--P;);E+=ne}if(h.strm.avail_in===0)break;if(X=h.strm,G=h.window,B=h.strstart+h.lookahead,re=E,ue=void 0,ue=X.avail_in,re=O)for(j=h.strstart-h.insert,h.ins_h=h.window[j],h.ins_h=(h.ins_h<=O&&(h.ins_h=(h.ins_h<=O)if(C=a._tr_tally(h,h.strstart-h.match_start,h.match_length-O),h.lookahead-=h.match_length,h.match_length<=h.max_lazy_match&&h.lookahead>=O){for(h.match_length--;h.strstart++,h.ins_h=(h.ins_h<=O&&(h.ins_h=(h.ins_h<=O&&h.match_length<=h.prev_length){for(E=h.strstart+h.lookahead-O,C=a._tr_tally(h,h.strstart-1-h.prev_match,h.prev_length-O),h.lookahead-=h.prev_length-1,h.prev_length-=2;++h.strstart<=E&&(h.ins_h=(h.ins_h<h.pending_buf_size-5&&(P=h.pending_buf_size-5);;){if(h.lookahead<=1){if(oe(h),h.lookahead===0&&z===y)return _;if(h.lookahead===0)break}h.strstart+=h.lookahead,h.lookahead=0;var C=h.block_start+P;if((h.strstart===0||h.strstart>=C)&&(h.lookahead=h.strstart-C,h.strstart=C,A(h,!1),h.strm.avail_out===0)||h.strstart-h.block_start>=h.w_size-ee&&(A(h,!1),h.strm.avail_out===0))return _}return h.insert=0,z===x?(A(h,!0),h.strm.avail_out===0?se:Q):(h.strstart>h.block_start&&(A(h,!1),h.strm.avail_out),_)}),new fe(4,4,8,4,he),new fe(4,5,16,8,he),new fe(4,6,32,32,he),new fe(4,4,16,16,ce),new fe(8,16,32,32,ce),new fe(8,16,128,128,ce),new fe(8,32,128,256,ce),new fe(32,128,258,1024,ce),new fe(32,258,258,4096,ce)],i.deflateInit=function(h,z){return le(h,z,d,15,8,0)},i.deflateInit2=le,i.deflateReset=Y,i.deflateResetKeep=ae,i.deflateSetHeader=function(h,z){return h&&h.state?h.state.wrap!==2?m:(h.state.gzhead=z,g):m},i.deflate=function(h,z){var P,C,E,j;if(!h||!h.state||5>8&255),V(C,C.gzhead.time>>16&255),V(C,C.gzhead.time>>24&255),V(C,C.level===9?2:2<=C.strategy||C.level<2?4:0),V(C,255&C.gzhead.os),C.gzhead.extra&&C.gzhead.extra.length&&(V(C,255&C.gzhead.extra.length),V(C,C.gzhead.extra.length>>8&255)),C.gzhead.hcrc&&(h.adler=f(h.adler,C.pending_buf,C.pending,0)),C.gzindex=0,C.status=69):(V(C,0),V(C,0),V(C,0),V(C,0),V(C,0),V(C,C.level===9?2:2<=C.strategy||C.level<2?4:0),V(C,3),C.status=U);else{var X=d+(C.w_bits-8<<4)<<8;X|=(2<=C.strategy||C.level<2?0:C.level<6?1:C.level===6?2:3)<<6,C.strstart!==0&&(X|=32),X+=31-X%31,C.status=U,M(C,X),C.strstart!==0&&(M(C,h.adler>>>16),M(C,65535&h.adler)),h.adler=1}if(C.status===69)if(C.gzhead.extra){for(E=C.pending;C.gzindex<(65535&C.gzhead.extra.length)&&(C.pending!==C.pending_buf_size||(C.gzhead.hcrc&&C.pending>E&&(h.adler=f(h.adler,C.pending_buf,C.pending-E,E)),I(h),E=C.pending,C.pending!==C.pending_buf_size));)V(C,255&C.gzhead.extra[C.gzindex]),C.gzindex++;C.gzhead.hcrc&&C.pending>E&&(h.adler=f(h.adler,C.pending_buf,C.pending-E,E)),C.gzindex===C.gzhead.extra.length&&(C.gzindex=0,C.status=73)}else C.status=73;if(C.status===73)if(C.gzhead.name){E=C.pending;do{if(C.pending===C.pending_buf_size&&(C.gzhead.hcrc&&C.pending>E&&(h.adler=f(h.adler,C.pending_buf,C.pending-E,E)),I(h),E=C.pending,C.pending===C.pending_buf_size)){j=1;break}j=C.gzindexE&&(h.adler=f(h.adler,C.pending_buf,C.pending-E,E)),j===0&&(C.gzindex=0,C.status=91)}else C.status=91;if(C.status===91)if(C.gzhead.comment){E=C.pending;do{if(C.pending===C.pending_buf_size&&(C.gzhead.hcrc&&C.pending>E&&(h.adler=f(h.adler,C.pending_buf,C.pending-E,E)),I(h),E=C.pending,C.pending===C.pending_buf_size)){j=1;break}j=C.gzindexE&&(h.adler=f(h.adler,C.pending_buf,C.pending-E,E)),j===0&&(C.status=103)}else C.status=103;if(C.status===103&&(C.gzhead.hcrc?(C.pending+2>C.pending_buf_size&&I(h),C.pending+2<=C.pending_buf_size&&(V(C,255&h.adler),V(C,h.adler>>8&255),h.adler=0,C.status=U)):C.status=U),C.pending!==0){if(I(h),h.avail_out===0)return C.last_flush=-1,g}else if(h.avail_in===0&&D(z)<=D(P)&&z!==x)return $(h,-5);if(C.status===666&&h.avail_in!==0)return $(h,-5);if(h.avail_in!==0||C.lookahead!==0||z!==y&&C.status!==666){var G=C.strategy===2?function(B,re){for(var ue;;){if(B.lookahead===0&&(oe(B),B.lookahead===0)){if(re===y)return _;break}if(B.match_length=0,ue=a._tr_tally(B,0,B.window[B.strstart]),B.lookahead--,B.strstart++,ue&&(A(B,!1),B.strm.avail_out===0))return _}return B.insert=0,re===x?(A(B,!0),B.strm.avail_out===0?se:Q):B.last_lit&&(A(B,!1),B.strm.avail_out===0)?_:q}(C,z):C.strategy===3?function(B,re){for(var ue,ne,pe,ve,ye=B.window;;){if(B.lookahead<=F){if(oe(B),B.lookahead<=F&&re===y)return _;if(B.lookahead===0)break}if(B.match_length=0,B.lookahead>=O&&0B.lookahead&&(B.match_length=B.lookahead)}if(B.match_length>=O?(ue=a._tr_tally(B,1,B.match_length-O),B.lookahead-=B.match_length,B.strstart+=B.match_length,B.match_length=0):(ue=a._tr_tally(B,0,B.window[B.strstart]),B.lookahead--,B.strstart++),ue&&(A(B,!1),B.strm.avail_out===0))return _}return B.insert=0,re===x?(A(B,!0),B.strm.avail_out===0?se:Q):B.last_lit&&(A(B,!1),B.strm.avail_out===0)?_:q}(C,z):s[C.level].func(C,z);if(G!==se&&G!==Q||(C.status=666),G===_||G===se)return h.avail_out===0&&(C.last_flush=-1),g;if(G===q&&(z===1?a._tr_align(C):z!==5&&(a._tr_stored_block(C,0,0,!1),z===3&&(H(C.head),C.lookahead===0&&(C.strstart=0,C.block_start=0,C.insert=0))),I(h),h.avail_out===0))return C.last_flush=-1,g}return z!==x?g:C.wrap<=0?1:(C.wrap===2?(V(C,255&h.adler),V(C,h.adler>>8&255),V(C,h.adler>>16&255),V(C,h.adler>>24&255),V(C,255&h.total_in),V(C,h.total_in>>8&255),V(C,h.total_in>>16&255),V(C,h.total_in>>24&255)):(M(C,h.adler>>>16),M(C,65535&h.adler)),I(h),0=P.w_size&&(j===0&&(H(P.head),P.strstart=0,P.block_start=0,P.insert=0),re=new o.Buf8(P.w_size),o.arraySet(re,z,ue-P.w_size,P.w_size,0),z=re,ue=P.w_size),X=h.avail_in,G=h.next_in,B=h.input,h.avail_in=ue,h.next_in=0,h.input=z,oe(P);P.lookahead>=O;){for(C=P.strstart,E=P.lookahead-(O-1);P.ins_h=(P.ins_h<>>=O=L>>>24,w-=O,(O=L>>>16&255)===0)q[p++]=65535&L;else{if(!(16&O)){if(!(64&O)){L=k[(65535&L)+(d&(1<>>=O,w-=O),w<15&&(d+=_[l++]<>>=O=L>>>24,w-=O,!(16&(O=L>>>16&255))){if(!(64&O)){L=b[(65535&L)+(d&(1<>>=O,w-=O,(O=p-y)>3,d&=(1<<(w-=F<<3))-1,s.next_in=l,s.next_out=p,s.avail_in=l>>24&255)+(R>>>8&65280)+((65280&R)<<8)+((255&R)<<24)}function d(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function w(R){var U;return R&&R.state?(U=R.state,R.total_in=R.total_out=U.total=0,R.msg="",U.wrap&&(R.adler=1&U.wrap),U.mode=m,U.last=0,U.havedict=0,U.dmax=32768,U.head=null,U.hold=0,U.bits=0,U.lencode=U.lendyn=new s.Buf32(u),U.distcode=U.distdyn=new s.Buf32(v),U.sane=1,U.back=-1,x):g}function k(R){var U;return R&&R.state?((U=R.state).wsize=0,U.whave=0,U.wnext=0,w(R)):g}function b(R,U){var _,q;return R&&R.state?(q=R.state,U<0?(_=0,U=-U):(_=1+(U>>4),U<48&&(U&=15)),U&&(U<8||15=Q.wsize?(s.arraySet(Q.window,U,_-Q.wsize,Q.wsize,0),Q.wnext=0,Q.whave=Q.wsize):(q<(se=Q.wsize-Q.wnext)&&(se=q),s.arraySet(Q.window,U,_-q,se,Q.wnext),(q-=se)?(s.arraySet(Q.window,U,_-q,q,0),Q.wnext=q,Q.whave=Q.wsize):(Q.wnext+=se,Q.wnext===Q.wsize&&(Q.wnext=0),Q.whave>>8&255,_.check=a(_.check,j,2,0),A=I=0,_.mode=2;break}if(_.flags=0,_.head&&(_.head.done=!1),!(1&_.wrap)||(((255&I)<<8)+(I>>8))%31){R.msg="incorrect header check",_.mode=30;break}if((15&I)!=8){R.msg="unknown compression method",_.mode=30;break}if(A-=4,h=8+(15&(I>>>=4)),_.wbits===0)_.wbits=h;else if(h>_.wbits){R.msg="invalid window size",_.mode=30;break}_.dmax=1<>8&1),512&_.flags&&(j[0]=255&I,j[1]=I>>>8&255,_.check=a(_.check,j,2,0)),A=I=0,_.mode=3;case 3:for(;A<32;){if(D===0)break e;D--,I+=q[Q++]<>>8&255,j[2]=I>>>16&255,j[3]=I>>>24&255,_.check=a(_.check,j,4,0)),A=I=0,_.mode=4;case 4:for(;A<16;){if(D===0)break e;D--,I+=q[Q++]<>8),512&_.flags&&(j[0]=255&I,j[1]=I>>>8&255,_.check=a(_.check,j,2,0)),A=I=0,_.mode=5;case 5:if(1024&_.flags){for(;A<16;){if(D===0)break e;D--,I+=q[Q++]<>>8&255,_.check=a(_.check,j,2,0)),A=I=0}else _.head&&(_.head.extra=null);_.mode=6;case 6:if(1024&_.flags&&(D<(W=_.length)&&(W=D),W&&(_.head&&(h=_.head.extra_len-_.length,_.head.extra||(_.head.extra=new Array(_.head.extra_len)),s.arraySet(_.head.extra,q,Q,W,h)),512&_.flags&&(_.check=a(_.check,q,W,Q)),D-=W,Q+=W,_.length-=W),_.length))break e;_.length=0,_.mode=7;case 7:if(2048&_.flags){if(D===0)break e;for(W=0;h=q[Q+W++],_.head&&h&&_.length<65536&&(_.head.name+=String.fromCharCode(h)),h&&W>9&1,_.head.done=!0),R.adler=_.check=0,_.mode=12;break;case 10:for(;A<32;){if(D===0)break e;D--,I+=q[Q++]<>>=7&A,A-=7&A,_.mode=27;break}for(;A<3;){if(D===0)break e;D--,I+=q[Q++]<>>=1)){case 0:_.mode=14;break;case 1:if(F(_),_.mode=20,U!==6)break;I>>>=2,A-=2;break e;case 2:_.mode=17;break;case 3:R.msg="invalid block type",_.mode=30}I>>>=2,A-=2;break;case 14:for(I>>>=7&A,A-=7&A;A<32;){if(D===0)break e;D--,I+=q[Q++]<>>16^65535)){R.msg="invalid stored block lengths",_.mode=30;break}if(_.length=65535&I,A=I=0,_.mode=15,U===6)break e;case 15:_.mode=16;case 16:if(W=_.length){if(D>>=5,A-=5,_.ndist=1+(31&I),I>>>=5,A-=5,_.ncode=4+(15&I),I>>>=4,A-=4,286<_.nlen||30<_.ndist){R.msg="too many length or distance symbols",_.mode=30;break}_.have=0,_.mode=18;case 18:for(;_.have<_.ncode;){for(;A<3;){if(D===0)break e;D--,I+=q[Q++]<>>=3,A-=3}for(;_.have<19;)_.lens[X[_.have++]]=0;if(_.lencode=_.lendyn,_.lenbits=7,P={bits:_.lenbits},z=f(0,_.lens,0,19,_.lencode,0,_.work,P),_.lenbits=P.bits,z){R.msg="invalid code lengths set",_.mode=30;break}_.have=0,_.mode=19;case 19:for(;_.have<_.nlen+_.ndist;){for(;fe=(E=_.lencode[I&(1<<_.lenbits)-1])>>>16&255,J=65535&E,!((ce=E>>>24)<=A);){if(D===0)break e;D--,I+=q[Q++]<>>=ce,A-=ce,_.lens[_.have++]=J;else{if(J===16){for(C=ce+2;A>>=ce,A-=ce,_.have===0){R.msg="invalid bit length repeat",_.mode=30;break}h=_.lens[_.have-1],W=3+(3&I),I>>>=2,A-=2}else if(J===17){for(C=ce+3;A>>=ce)),I>>>=3,A-=3}else{for(C=ce+7;A>>=ce)),I>>>=7,A-=7}if(_.have+W>_.nlen+_.ndist){R.msg="invalid bit length repeat",_.mode=30;break}for(;W--;)_.lens[_.have++]=h}}if(_.mode===30)break;if(_.lens[256]===0){R.msg="invalid code -- missing end-of-block",_.mode=30;break}if(_.lenbits=9,P={bits:_.lenbits},z=f(p,_.lens,0,_.nlen,_.lencode,0,_.work,P),_.lenbits=P.bits,z){R.msg="invalid literal/lengths set",_.mode=30;break}if(_.distbits=6,_.distcode=_.distdyn,P={bits:_.distbits},z=f(y,_.lens,_.nlen,_.ndist,_.distcode,0,_.work,P),_.distbits=P.bits,z){R.msg="invalid distances set",_.mode=30;break}if(_.mode=20,U===6)break e;case 20:_.mode=21;case 21:if(6<=D&&258<=H){R.next_out=$,R.avail_out=H,R.next_in=Q,R.avail_in=D,_.hold=I,_.bits=A,l(R,M),$=R.next_out,se=R.output,H=R.avail_out,Q=R.next_in,q=R.input,D=R.avail_in,I=_.hold,A=_.bits,_.mode===12&&(_.back=-1);break}for(_.back=0;fe=(E=_.lencode[I&(1<<_.lenbits)-1])>>>16&255,J=65535&E,!((ce=E>>>24)<=A);){if(D===0)break e;D--,I+=q[Q++]<>ae)])>>>16&255,J=65535&E,!(ae+(ce=E>>>24)<=A);){if(D===0)break e;D--,I+=q[Q++]<>>=ae,A-=ae,_.back+=ae}if(I>>>=ce,A-=ce,_.back+=ce,_.length=J,fe===0){_.mode=26;break}if(32&fe){_.back=-1,_.mode=12;break}if(64&fe){R.msg="invalid literal/length code",_.mode=30;break}_.extra=15&fe,_.mode=22;case 22:if(_.extra){for(C=_.extra;A>>=_.extra,A-=_.extra,_.back+=_.extra}_.was=_.length,_.mode=23;case 23:for(;fe=(E=_.distcode[I&(1<<_.distbits)-1])>>>16&255,J=65535&E,!((ce=E>>>24)<=A);){if(D===0)break e;D--,I+=q[Q++]<>ae)])>>>16&255,J=65535&E,!(ae+(ce=E>>>24)<=A);){if(D===0)break e;D--,I+=q[Q++]<>>=ae,A-=ae,_.back+=ae}if(I>>>=ce,A-=ce,_.back+=ce,64&fe){R.msg="invalid distance code",_.mode=30;break}_.offset=J,_.extra=15&fe,_.mode=24;case 24:if(_.extra){for(C=_.extra;A>>=_.extra,A-=_.extra,_.back+=_.extra}if(_.offset>_.dmax){R.msg="invalid distance too far back",_.mode=30;break}_.mode=25;case 25:if(H===0)break e;if(W=M-H,_.offset>W){if((W=_.offset-W)>_.whave&&_.sane){R.msg="invalid distance too far back",_.mode=30;break}oe=W>_.wnext?(W-=_.wnext,_.wsize-W):_.wnext-W,W>_.length&&(W=_.length),he=_.window}else he=se,oe=$-_.offset,W=_.length;for(HT?(O=oe[he+v[U]],A[V+v[U]]):(O=96,0),d=1<>$)+(w-=d)]=L<<24|O<<16|F|0,w!==0;);for(d=1<>=1;if(d!==0?(I&=d-1,I+=d):I=0,U++,--M[R]==0){if(R===q)break;R=y[x+v[U]]}if(se>>7)]}function V(E,j){E.pending_buf[E.pending++]=255&j,E.pending_buf[E.pending++]=j>>>8&255}function M(E,j,X){E.bi_valid>c-X?(E.bi_buf|=j<>c-E.bi_valid,E.bi_valid+=X-c):(E.bi_buf|=j<>>=1,X<<=1,0<--j;);return X>>>1}function he(E,j,X){var G,B,re=new Array(v+1),ue=0;for(G=1;G<=v;G++)re[G]=ue=ue+X[G-1]<<1;for(B=0;B<=j;B++){var ne=E[2*B+1];ne!==0&&(E[2*B]=oe(re[ne]++,ne))}}function ce(E){var j;for(j=0;j>1;1<=X;X--)ae(E,re,X);for(B=pe;X=E.heap[1],E.heap[1]=E.heap[E.heap_len--],ae(E,re,1),G=E.heap[1],E.heap[--E.heap_max]=X,E.heap[--E.heap_max]=G,re[2*B]=re[2*X]+re[2*G],E.depth[B]=(E.depth[X]>=E.depth[G]?E.depth[X]:E.depth[G])+1,re[2*X+1]=re[2*G+1]=B,E.heap[1]=B++,ae(E,re,1),2<=E.heap_len;);E.heap[--E.heap_max]=E.heap[1],function(ye,We){var Jt,at,er,be,hr,tr,tt=We.dyn_tree,Lr=We.max_code,jn=We.stat_desc.static_tree,Tt=We.stat_desc.has_stree,_e=We.stat_desc.extra_bits,Te=We.stat_desc.extra_base,Ae=We.stat_desc.max_length,je=0;for(be=0;be<=v;be++)ye.bl_count[be]=0;for(tt[2*ye.heap[ye.heap_max]+1]=0,Jt=ye.heap_max+1;Jt>=7;B>>=1)if(1&ve&&ne.dyn_ltree[2*pe]!==0)return o;if(ne.dyn_ltree[18]!==0||ne.dyn_ltree[20]!==0||ne.dyn_ltree[26]!==0)return a;for(pe=32;pe>>3,(re=E.static_len+3+7>>>3)<=B&&(B=re)):B=re=X+5,X+4<=B&&j!==-1?C(E,j,X,G):E.strategy===4||re===B?(M(E,2+(G?1:0),3),Y(E,ee,R)):(M(E,4+(G?1:0),3),function(ne,pe,ve,ye){var We;for(M(ne,pe-257,5),M(ne,ve-1,5),M(ne,ye-4,4),We=0;We>>8&255,E.pending_buf[E.d_buf+2*E.last_lit+1]=255&j,E.pending_buf[E.l_buf+E.last_lit]=255&X,E.last_lit++,j===0?E.dyn_ltree[2*X]++:(E.matches++,j--,E.dyn_ltree[2*(_[X]+y+1)]++,E.dyn_dtree[2*A(j)]++),E.last_lit===E.lit_bufsize-1},i._tr_align=function(E){M(E,2,3),W(E,w,ee),function(j){j.bi_valid===16?(V(j,j.bi_buf),j.bi_buf=0,j.bi_valid=0):8<=j.bi_valid&&(j.pending_buf[j.pending++]=255&j.bi_buf,j.bi_buf>>=8,j.bi_valid-=8)}(E)}},{"../utils/common":41}],53:[function(r,n,i){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(r,n,i){(function(s){(function(o,a){if(!o.setImmediate){var l,f,p,y,x=1,g={},m=!1,u=o.document,v=Object.getPrototypeOf&&Object.getPrototypeOf(o);v=v&&v.setTimeout?v:o,l={}.toString.call(o.process)==="[object process]"?function(k){process.nextTick(function(){d(k)})}:function(){if(o.postMessage&&!o.importScripts){var k=!0,b=o.onmessage;return o.onmessage=function(){k=!1},o.postMessage("","*"),o.onmessage=b,k}}()?(y="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",w,!1):o.attachEvent("onmessage",w),function(k){o.postMessage(y+k,"*")}):o.MessageChannel?((p=new MessageChannel).port1.onmessage=function(k){d(k.data)},function(k){p.port2.postMessage(k)}):u&&"onreadystatechange"in u.createElement("script")?(f=u.documentElement,function(k){var b=u.createElement("script");b.onreadystatechange=function(){d(k),b.onreadystatechange=null,f.removeChild(b),b=null},f.appendChild(b)}):function(k){setTimeout(d,0,k)},v.setImmediate=function(k){typeof k!="function"&&(k=new Function(""+k));for(var b=new Array(arguments.length-1),N=0;N"u"?s===void 0?this:s:self)}).call(this,typeof Es<"u"?Es:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(_m);var Xw=_m.exports;const hd=su(Xw);function pd(){const{selectedImage:e,selectedImages:t,currentLibraryId:r,selectedFolder:n,images:i,setMobileView:s,isResizingPanels:o,resizingSide:a}=me(),[l,f]=Z.useState(!1),[p,y]=Z.useState(""),[x,g]=Z.useState(!1),[m,u]=Z.useState(!1),[v,c]=Z.useState(!1),[d,w]=Z.useState(!1),[k,b]=Z.useState(0),[N,T]=Z.useState(!1),[L,O]=Z.useState(0),F=t.length>0,ee=F?t[0]:e;if(Z.useEffect(()=>{const H=()=>{f(window.innerWidth<768)};return H(),window.addEventListener("resize",H),()=>window.removeEventListener("resize",H)},[]),Z.useEffect(()=>{if(!e||!r){y("");return}const H=R();if(y(H),g(!0),o){g(!1);return}const I=U(),A=new Image;return A.onload=()=>{y(I),g(!1)},A.onerror=()=>{console.error("Failed to load original image"),g(!1)},A.src=I,()=>{A.onload=null,A.onerror=null}},[e,r,o,a]),!e&&t.length===0)return S.jsx("div",{className:"w-full border-l border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 flex items-center justify-center",children:S.jsx("p",{className:"text-gray-400 dark:text-gray-500 text-sm",children:"选择图片查看详情"})});const R=()=>{if(!r||!e.thumbnail_path)return"";const H=e.thumbnail_path.replace(/\\/g,"/").split("/").pop();return $e.getThumbnailUrl(r,"200",H)},U=()=>!r||!e.path?"":$e.getOriginalUrl(r,e.path),_=async()=>{try{const H=$e.getOriginalUrl(r,e.path),A=await(await fetch(H)).blob(),V=new Image,M=new Promise((he,ce)=>{V.onload=he,V.onerror=ce});V.src=URL.createObjectURL(A),await M;const W=document.createElement("canvas");W.width=V.width,W.height=V.height,W.getContext("2d").drawImage(V,0,0),W.toBlob(async he=>{try{const ce=new ClipboardItem({"image/png":he,"text/html":new Blob([`${e.filename}`],{type:"text/html"}),"text/plain":new Blob([H],{type:"text/plain"})});await navigator.clipboard.write([ce]),c(!0),setTimeout(()=>c(!1),2e3)}catch(ce){console.error("写入剪贴板失败:",ce);try{await navigator.clipboard.write([new ClipboardItem({"image/png":he})]),c(!0),setTimeout(()=>c(!1),2e3)}catch(fe){console.error("备用方案也失败:",fe),alert("复制失败,请重试")}}},"image/png"),URL.revokeObjectURL(V.src)}catch(H){console.error("复制图片失败:",H),alert("复制图片失败,请重试")}},q=async()=>{try{const H=F?t:[e];if(H.length===1){await _();return}const A=(await Promise.all(H.map(async M=>{const W=$e.getOriginalUrl(r,M.path),he=await(await fetch(W)).blob();return new Promise(ce=>{const fe=new FileReader;fe.onloadend=()=>{ce({dataUrl:fe.result,filename:M.filename})},fe.readAsDataURL(he)})}))).map(({dataUrl:M,filename:W})=>`${W}`).join(` -`),V=H.map(M=>M.filename).join(` -`);try{await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([A],{type:"text/html"}),"text/plain":new Blob([V],{type:"text/plain"})})]),c(!0),setTimeout(()=>c(!1),2e3)}catch(M){console.error("写入剪贴板失败:",M),alert(`复制失败。 - -提示:浏览器限制,多张图片会以 HTML 格式复制。 -可粘贴到 Word、富文本编辑器等。 - -如需单独使用,请使用"导出"功能。`)}}catch(H){console.error("复制图片失败:",H),alert("复制图片失败,请重试")}},se=async()=>{w(!0);try{const H=F?t:[e];if(H.length===1){const I=$e.getOriginalUrl(r,H[0].path),A=document.createElement("a");A.href=I,A.download=H[0].filename,A.target="_blank",document.body.appendChild(A),A.click(),document.body.removeChild(A)}else{const I=new hd,A=I.folder("images");b(0);for(let W=0;W{if(!n){alert("请先选择一个文件夹");return}T(!0),O(0);try{const H=i.filter(oe=>oe.folder&&oe.folder.startsWith(n));if(H.length===0){alert("当前文件夹没有图片");return}const I=new hd,A=n.split("/").pop()||"images",V=I.folder(A);for(let oe=0;oeH<1024?H+" B":H<1024*1024?(H/1024).toFixed(2)+" KB":(H/(1024*1024)).toFixed(2)+" MB",D=H=>new Date(H).toLocaleString("zh-CN");return S.jsxs("div",{className:"w-full border-l border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 flex flex-col h-full",children:[l&&S.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700 flex items-center",children:S.jsxs("button",{onClick:()=>s("main"),className:"flex items-center gap-2 text-gray-700 dark:text-gray-300 hover:text-blue-500",children:[S.jsx(V1,{className:"w-5 h-5"}),S.jsx("span",{className:"text-sm font-medium",children:"返回"})]})}),S.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700 flex-shrink-0",children:S.jsxs("div",{className:"w-full aspect-square bg-gray-100 dark:bg-gray-700 rounded-lg overflow-hidden relative",children:[S.jsx("img",{src:p,alt:ee.filename,decoding:"async",className:`w-full h-full object-contain transition-opacity duration-300 ${x?"opacity-75":"opacity-100"}`}),x&&S.jsx("div",{className:"absolute top-2 right-2 bg-blue-500 text-white text-xs px-2 py-1 rounded",children:"加载原图中..."})]})}),S.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 min-h-0",children:S.jsxs("div",{children:[S.jsx("h3",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300 mb-2",children:"基本信息"}),S.jsxs("div",{className:"space-y-2 text-sm",children:[S.jsxs("div",{children:[S.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"文件名:"}),S.jsx("p",{className:"text-gray-900 dark:text-gray-100 break-all",children:e.filename})]}),S.jsxs("div",{children:[S.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"尺寸:"}),S.jsxs("p",{className:"text-gray-900 dark:text-gray-100",children:[e.width," × ",e.height]})]}),S.jsxs("div",{children:[S.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"大小:"}),S.jsx("p",{className:"text-gray-900 dark:text-gray-100",children:$(e.size)})]}),S.jsxs("div",{children:[S.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"格式:"}),S.jsx("p",{className:"text-gray-900 dark:text-gray-100 uppercase",children:e.format})]}),S.jsxs("div",{children:[S.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"创建时间:"}),S.jsx("p",{className:"text-gray-900 dark:text-gray-100",children:D(e.created_at)})]}),S.jsxs("div",{children:[S.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"修改时间:"}),S.jsx("p",{className:"text-gray-900 dark:text-gray-100",children:D(e.modified_at)})]}),S.jsxs("div",{children:[S.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"路径:"}),S.jsx("p",{className:"text-gray-900 dark:text-gray-100 text-xs break-all",children:e.path})]})]})]})}),!l&&S.jsxs("div",{className:"p-4 border-t border-gray-200 dark:border-gray-700 space-y-2 flex-shrink-0",children:[S.jsx("button",{onClick:q,className:`w-full flex items-center justify-center gap-2 px-4 py-2 rounded-lg transition-all ${v?"bg-green-500 text-white":"bg-blue-500 text-white hover:bg-blue-600"}`,children:v?S.jsxs(S.Fragment,{children:[S.jsx(q1,{className:"w-4 h-4"}),S.jsxs("span",{children:["已复制",F?` ${t.length} 张`:""]})]}):S.jsxs(S.Fragment,{children:[S.jsx(Z1,{className:"w-4 h-4"}),S.jsxs("span",{children:["复制图片",F?` (${t.length})`:""]})]})}),S.jsxs("button",{onClick:se,disabled:d,className:"w-full flex flex-col items-center justify-center gap-2 px-4 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Q1,{className:"w-4 h-4"}),S.jsx("span",{children:d?`打包中... ${k}%`:`导出图片${F?` (${t.length})`:""}`})]}),d&&F&&S.jsx("div",{className:"w-full bg-gray-300 dark:bg-gray-600 rounded-full h-1.5 mt-1",children:S.jsx("div",{className:"bg-blue-500 h-1.5 rounded-full transition-all duration-300",style:{width:`${k}%`}})})]}),n&&S.jsxs("button",{onClick:Q,disabled:N,className:"w-full flex flex-col items-center justify-center gap-2 px-4 py-2 bg-purple-500 text-white rounded-lg hover:bg-purple-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(tw,{className:"w-4 h-4"}),S.jsx("span",{children:N?`打包文件夹... ${L}%`:"导出当前文件夹"})]}),N&&S.jsx("div",{className:"w-full bg-purple-300 rounded-full h-1.5 mt-1",children:S.jsx("div",{className:"bg-white h-1.5 rounded-full transition-all duration-300",style:{width:`${L}%`}})})]})]})]})}function md(){const{theme:e,toggleTheme:t,searchKeywords:r,thumbnailHeight:n,images:i,filteredImages:s,selectedFolder:o,currentLibraryId:a,setSearchKeywords:l,setThumbnailHeight:f,setFilteredImages:p,mobileView:y}=me(),[x,g]=Z.useState(!1),[m,u]=Z.useState([]),[v,c]=Z.useState([]),[d,w]=Z.useState(""),[k,b]=Z.useState(!1),[N,T]=Z.useState(!1),[L,O]=Z.useState(!1),[F,ee]=Z.useState(r),R=Z.useRef(null);Z.useEffect(()=>{const J=()=>{T(window.innerWidth<768)};return J(),window.addEventListener("resize",J),()=>window.removeEventListener("resize",J)},[]),Z.useEffect(()=>{u([]),c([]),w("")},[o]),Z.useEffect(()=>{if(a)return qf.start(a).catch(J=>{console.error("启动文件监控失败:",J)}),()=>{qf.stop(a).catch(J=>console.error("Stop watch error:",J))}},[a]);const U=J=>{ee(J),R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{l(J)},300)};Z.useEffect(()=>{ee(r)},[r]),Z.useEffect(()=>()=>{R.current&&clearTimeout(R.current)},[]);const _=J=>{if(J.length===0)return[];const ae=[...J].sort((j,X)=>j-X),Y=ae[0],le=ae[ae.length-1];if(le-Y<10)return[q(Y,le)];const h=5,z=[],P=Math.log10(Y||1),E=(Math.log10(le)-P)/h;for(let j=0;jre>=X&&rej)},q=(J,ae,Y=!1)=>{const le=h=>{const z=P=>P<10?Math.round(P):P<100?Math.round(P/5)*5:P<1e3?Math.round(P/10)*10:Math.round(P/50)*50;return h<1?`${z(h*1024)}B`:h<1024?`${z(h)}KB`:h<1048576?`${z(h/1024)}MB`:`${z(h/1048576)}GB`};return Y?`> ${le(J)}`:`${le(J)} - ${le(ae)}`},se=J=>{const ae=J.match(/^(\d+(?:\.\d+)?)(B|KB|MB|GB)$/);if(!ae)return 0;const Y=parseFloat(ae[1]);switch(ae[2]){case"B":return Y/1024;case"KB":return Y;case"MB":return Y*1024;case"GB":return Y*1024*1024;default:return 0}},Q=(J,ae)=>{if(ae.startsWith(">")){const Y=ae.substring(1).trim(),le=se(Y);return J>=le}else if(ae.includes(" - ")){const[Y,le]=ae.split(" - ").map(P=>P.trim()),h=se(Y),z=se(le);return J>=h&&J{if(i.length===0)return{formats:[],sizes:[],hasHorizontal:!1,hasVertical:!1};const J=new Set,ae=[];let Y=!1,le=!1;i.forEach(z=>{z.format&&J.add(z.format.toLowerCase()),ae.push(z.size/1024),z.width>z.height&&(Y=!0),z.height>z.width&&(le=!0)});const h=_(ae);return{formats:Array.from(J).sort(),sizes:h,hasHorizontal:Y,hasVertical:le}},[i]),D=Z.useMemo(()=>{if(m.length===0&&v.length===0&&!d)return i;const J=new Set(m),ae=new Set(v);return i.filter(Y=>{var le;if(J.size>0&&!J.has((le=Y.format)==null?void 0:le.toLowerCase()))return!1;if(ae.size>0){const h=Y.size/1024;let z=!1;for(const P of ae)if(Q(h,P)){z=!0;break}if(!z)return!1}if(d==="horizontal"){if(Y.width<=Y.height)return!1}else if(d==="vertical"&&Y.height<=Y.width)return!1;return!0})},[i,m,v,d]);Z.useEffect(()=>{p(D)},[D,p]);const H=J=>{u(ae=>ae.includes(J)?ae.filter(Y=>Y!==J):[...ae,J])},I=J=>{c(ae=>ae.includes(J)?ae.filter(Y=>Y!==J):[...ae,J])},A=J=>{w(ae=>ae===J?"":J)},V=()=>{u([]),c([]),w("")},M=async()=>{t();try{await Cr.updateTheme(e==="light"?"dark":"light")}catch(J){console.error("Error saving theme:",J)}},W=async J=>{f(J);try{await Cr.updatePreferences({thumbnailHeight:J})}catch(ae){console.error("Error saving preferences:",ae)}},oe=async()=>{if(!(!a||k)){b(!0);try{await sn.sync(a)}catch(J){console.error("Error refreshing:",J),alert("刷新失败: "+J.message)}finally{b(!1)}}},he=$.formats,ce=$.sizes.map(J=>({label:J})),fe=[{value:"horizontal",label:"横图"},{value:"vertical",label:"竖图"}].filter(J=>J.value==="horizontal"&&$.hasHorizontal||J.value==="vertical"&&$.hasVertical);if(N){const J=y!=="sidebar";return S.jsxs("header",{className:"border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800",children:[S.jsxs("div",{className:"h-14 flex items-center justify-between px-4",children:[S.jsx("h1",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"FlyPic"}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("button",{onClick:oe,disabled:!a||k,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors disabled:opacity-50",children:S.jsx(Zf,{className:`w-5 h-5 text-gray-700 dark:text-gray-300 ${k?"animate-spin":""}`})}),S.jsx("button",{onClick:()=>O(!L),className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",children:S.jsx(Qf,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"})}),S.jsx("button",{onClick:M,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",children:e==="light"?S.jsx(Yf,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"}):S.jsx(Gf,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"})})]})]}),J&&S.jsx("div",{className:"px-4 pb-3",children:S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsxs("div",{className:"flex-1 relative",children:[S.jsx(Bo,{className:"absolute left-3 top-2.5 w-5 h-5 text-gray-400"}),S.jsx("input",{type:"text",placeholder:"搜索图片...",value:r,onChange:ae=>U(ae.target.value),className:"w-full pl-10 pr-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 text-sm"})]}),S.jsx("button",{onClick:()=>g(!x),className:`p-2 border rounded-lg ${m.length>0||v.length>0||d?"border-blue-500 bg-blue-50 dark:bg-blue-500/20":"border-gray-300 dark:border-gray-600"}`,children:S.jsx(Xf,{className:`w-5 h-5 ${m.length>0||v.length>0||d?"text-blue-600 dark:text-blue-300":"text-gray-600 dark:text-gray-400"}`})})]})}),L&&S.jsx("div",{className:"px-4 pb-3 border-t border-gray-200 dark:border-gray-700 pt-3",children:S.jsxs("div",{className:"flex flex-col gap-3",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:"缩略图大小"}),S.jsxs("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:[n,"px"]})]}),S.jsx("input",{type:"range",min:"150",max:"300",value:n,onChange:ae=>W(parseInt(ae.target.value)),className:"w-full h-2 bg-gray-200 dark:bg-gray-700 rounded-lg appearance-none cursor-pointer",style:{background:`linear-gradient(to right, #3b82f6 0%, #3b82f6 ${(n-150)/150*100}%, #e5e7eb ${(n-150)/150*100}%, #e5e7eb 100%)`}})]})}),J&&x&&S.jsxs("div",{className:"px-4 pb-3 border-t border-gray-200 dark:border-gray-700 pt-3",children:[S.jsxs("div",{className:"flex items-center justify-between mb-3",children:[S.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"筛选条件"}),S.jsx("button",{onClick:V,className:"text-xs text-blue-500",children:"清除全部"})]}),S.jsxs("div",{className:"mb-3",children:[S.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:"格式"}),S.jsx("div",{className:"flex flex-wrap gap-2",children:he.map(ae=>S.jsx("button",{onClick:()=>H(ae),className:`px-3 py-1 text-xs rounded-full ${m.includes(ae)?"bg-blue-500 text-white":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300"}`,children:ae.toUpperCase()},ae))})]}),S.jsxs("div",{className:"mb-3",children:[S.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:"尺寸"}),S.jsx("div",{className:"flex flex-wrap gap-2",children:ce.map(ae=>S.jsx("button",{onClick:()=>I(ae.label),className:`px-3 py-1 text-xs rounded-full ${v.includes(ae.label)?"bg-blue-500 text-white":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300"}`,children:ae.label},ae.label))})]}),S.jsxs("div",{children:[S.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:"方向"}),S.jsx("div",{className:"flex flex-wrap gap-2",children:fe.map(ae=>S.jsx("button",{onClick:()=>A(ae.value),className:`px-3 py-1 text-xs rounded-full ${d===ae.value?"bg-blue-500 text-white":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300"}`,children:ae.label},ae.value))})]})]})]})}return S.jsxs("header",{className:"border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800",children:[S.jsxs("div",{className:"h-14 flex items-center justify-between px-6",children:[S.jsxs("div",{className:"flex-shrink-0",children:[S.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"FlyPic"}),S.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"轻量快速的图片素材库管理"})]}),S.jsxs("div",{className:"flex-1 max-w-2xl mx-6 flex items-center gap-3",children:[S.jsxs("div",{className:"flex-1 relative",children:[S.jsx(Bo,{className:"absolute left-3 top-2.5 w-5 h-5 text-gray-400"}),S.jsx("input",{type:"text",placeholder:"搜索图片... (多个关键词用空格分隔,即时搜索)",value:F,onChange:J=>U(J.target.value),className:"w-full pl-10 pr-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),S.jsxs("button",{onClick:()=>g(!x),className:`relative p-2 border rounded-lg transition-colors ${m.length>0||v.length>0||d?"border-blue-500 dark:border-blue-400 bg-blue-50 dark:bg-blue-500/20 hover:bg-blue-100 dark:hover:bg-blue-500/30":"border-gray-300 dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-700"}`,title:m.length>0||v.length>0||d?"筛选(已启用)":"筛选",children:[S.jsx(Xf,{className:`w-5 h-5 ${m.length>0||v.length>0||d?"text-blue-600 dark:text-blue-300":"text-gray-600 dark:text-gray-400"}`}),(m.length>0||v.length>0||d)&&S.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 w-3 h-3 rounded-full",style:{backgroundColor:"#3b82f6"}})]})]}),S.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[S.jsx(Qf,{className:"w-4 h-4 text-gray-500"}),S.jsx("input",{type:"range",min:"150",max:"300",value:n,onChange:J=>W(parseInt(J.target.value)),className:"w-32"}),S.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400 w-12",children:[n,"px"]}),S.jsx("button",{onClick:oe,disabled:!a||k,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed ml-2",title:"手动刷新素材库(文件监控已自动启用)",children:S.jsx(Zf,{className:`w-5 h-5 text-gray-700 dark:text-gray-300 ${k?"animate-spin":""}`})}),S.jsx("button",{onClick:M,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",title:e==="light"?"切换到暗色模式":"切换到亮色模式",children:e==="light"?S.jsx(Yf,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"}):S.jsx(Gf,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"})})]})]}),x&&S.jsx("div",{className:"px-6 pb-3",children:S.jsxs("div",{className:"p-4 bg-gray-50 dark:bg-gray-700 rounded-lg",children:[S.jsxs("div",{className:"flex items-center justify-between mb-3",children:[S.jsx("div",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"筛选条件(实时生效)"}),S.jsx("button",{onClick:V,className:"text-xs text-blue-500 hover:text-blue-600 dark:hover:text-blue-400",children:"清除全部"})]}),S.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[S.jsxs("div",{children:[S.jsx("label",{className:"block text-xs font-medium text-gray-600 dark:text-gray-400 mb-2",children:"格式"}),S.jsx("div",{className:"flex flex-col gap-1.5",children:$.formats.length>0?$.formats.map(J=>S.jsx("button",{onClick:()=>H(J),className:`px-3 py-1.5 text-xs rounded transition-colors text-left ${m.includes(J)?"bg-blue-500 text-white":"bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-500"}`,children:J.toUpperCase()},J)):S.jsx("span",{className:"text-xs text-gray-400 py-2",children:"暂无格式数据"})})]}),S.jsxs("div",{children:[S.jsx("label",{className:"block text-xs font-medium text-gray-600 dark:text-gray-400 mb-2",children:"文件大小"}),S.jsx("div",{className:"flex flex-col gap-1.5",children:$.sizes.length>0?$.sizes.map(J=>S.jsx("button",{onClick:()=>I(J),className:`px-3 py-1.5 text-xs rounded transition-colors text-left ${v.includes(J)?"bg-blue-500 text-white":"bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-500"}`,children:J},J)):S.jsx("span",{className:"text-xs text-gray-400 py-2",children:"暂无大小数据"})})]}),S.jsxs("div",{children:[S.jsx("label",{className:"block text-xs font-medium text-gray-600 dark:text-gray-400 mb-2",children:"图片方向"}),S.jsxs("div",{className:"flex flex-col gap-1.5",children:[$.hasHorizontal&&S.jsx("button",{onClick:()=>A("horizontal"),className:`px-3 py-1.5 text-xs rounded transition-colors text-left ${d==="horizontal"?"bg-blue-500 text-white":"bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-500"}`,children:"横图"}),$.hasVertical&&S.jsx("button",{onClick:()=>A("vertical"),className:`px-3 py-1.5 text-xs rounded transition-colors text-left ${d==="vertical"?"bg-blue-500 text-white":"bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-500"}`,children:"竖图"}),!$.hasHorizontal&&!$.hasVertical&&S.jsx("span",{className:"text-xs text-gray-400 py-2",children:"暂无方向数据"})]})]})]})]})})]})}function Yw(){const{theme:e,setLibraries:t,setCurrentLibrary:r,setScanProgress:n,mobileView:i,setMobileView:s,selectedImage:o}=me(),[a,l]=Z.useState(256),[f,p]=Z.useState(320),[y,x]=Z.useState(!1),[g,m]=Z.useState(!1),[u,v]=Z.useState(!1),c=Z.useRef(null);Z.useEffect(()=>{e==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},[e]),Z.useEffect(()=>{const k=()=>{const b=window.innerWidth<768;v(b)};return k(),window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[]),Z.useEffect(()=>{u&&o&&s("detail")},[o,u,s]),Z.useEffect(()=>{const k=window.location.origin;console.log("🔌 Connecting to Socket.IO:",k);const b=co(k,{transports:["websocket","polling"],reconnection:!0,reconnectionDelay:1e3,reconnectionAttempts:5});return b.on("connect",()=>{console.log("✅ Socket.IO connected:",b.id)}),b.on("disconnect",()=>{console.log("❌ Socket.IO disconnected")}),b.on("connect_error",N=>{console.error("❌ Socket.IO connection error:",N)}),b.on("scanProgress",N=>{const T=me.getState().currentLibraryId;N.libraryId===T&&n(N)}),b.on("scanComplete",({libraryId:N,results:T})=>{console.log("📊 Scan complete:",{libraryId:N,results:T});const L=me.getState().currentLibraryId;if(console.log("🔍 Current library:",L,"Scan library:",N,"Match:",N===L),N===L){console.log("🔄 Reloading folders and images...");const O=me.getState(),F={keywords:O.searchKeywords,...O.filters};O.selectedFolder&&(F.folder=O.selectedFolder),Promise.all([$e.getFolders(N),O.selectedFolder||O.searchKeywords||O.filters.formats.length>0?$e.search(N,F):Promise.resolve({data:{images:[]}}),$e.getCount(N)]).then(([ee,R,U])=>{me.getState().setFolders(ee.data.folders),me.getState().setImages(R.data.images),me.getState().setTotalImageCount(U.data.count),console.log(`✅ Data reloaded, total: ${U.data.count}`)}).catch(ee=>{console.error("❌ Error reloading data:",ee)}).finally(()=>{n(null),console.log("✅ Scan progress cleared")})}else console.log("⚠️ Library mismatch, skipping reload"),n(null)}),b.on("scanError",({libraryId:N,error:T})=>{n(null),console.error("Scan error:",T)}),b.on("scanPaused",({libraryId:N,results:T})=>{console.log("⏸️ Scan paused:",{libraryId:N,results:T})}),d(),()=>{b.disconnect()}},[]);const d=async()=>{try{const k=await Cr.getAll(),{libraries:b,currentLibraryId:N,theme:T,preferences:L}=k.data;if(t(b),r(N),T&&me.getState().setTheme(T),L){const{thumbnailHeight:O,leftPanelWidth:F,rightPanelWidth:ee}=L;O&&me.getState().setThumbnailHeight(O),F&&l(F),ee&&p(ee)}if(N){const[O]=await Promise.all([$e.getFolders(N)]);me.getState().setFolders(O.data.folders);try{const F=await $e.getCount(N);me.getState().setTotalImageCount(F.data.count)}catch(F){console.error("Failed to get image count:",F)}console.log("📂 数据加载完成,文件监控器将自动检测变化"),sn.getStatus(N).then(F=>{const{status:ee,progress:R,pendingCount:U}=F.data;(ee==="scanning"||ee==="paused")&&(console.log(`🔄 恢复扫描状态: ${ee}, 进度: ${(R==null?void 0:R.percent)||0}%`),n({...R,canStop:!0,isPaused:ee==="paused",pendingCount:U}))}).catch(()=>{})}}catch(k){console.error("Error loading libraries:",k)}},w=async(k,b)=>{try{await Cr.updatePreferences({leftPanelWidth:k,rightPanelWidth:b})}catch(N){console.error("Error saving panel widths:",N)}};return Z.useEffect(()=>{if(!y&&!g)return;const k=document.getElementById("left-panel"),b=document.getElementById("right-panel");let N=a,T=f;const L=c.current.getBoundingClientRect(),O=L.left,F=L.right;let ee=null,R=null,U=null;const _=()=>{k&&R!=null&&(k.style.width=`${R}px`,N=R),b&&U!=null&&(b.style.width=`${U}px`,T=U),ee=null,R=null,U=null},q=Q=>{let $=!1;if(y&&k){const D=Q.clientX-O;D>=200&&D<=400&&(R=D,$=!0)}if(g&&b){const D=F-Q.clientX;D>=280&&D<=500&&(U=D,$=!0)}$&&ee==null&&(ee=requestAnimationFrame(_))},se=()=>{ee&&(cancelAnimationFrame(ee),_()),l(N),p(T),w(N,T),x(!1),m(!1),me.getState().setIsResizingPanels(!1),me.getState().setResizingSide(null)};return document.addEventListener("mousemove",q,{passive:!0}),document.addEventListener("mouseup",se),document.body.style.userSelect="none",document.body.style.cursor="col-resize",k&&(k.style.transition="none"),b&&(b.style.transition="none"),()=>{ee&&(cancelAnimationFrame(ee),ee=null),document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",se),document.body.style.userSelect="",document.body.style.cursor="",k&&(k.style.transition=""),b&&(b.style.transition="")}},[y,g]),u?S.jsxs("div",{className:"flex flex-col h-screen bg-gray-50 dark:bg-gray-900",children:[S.jsx(md,{}),S.jsxs("div",{className:"flex-1 overflow-hidden relative",children:[S.jsx("div",{className:`absolute inset-0 transition-transform duration-300 ${i==="sidebar"?"translate-x-0":"-translate-x-full"}`,children:S.jsx(ed,{})}),S.jsx("div",{className:`absolute inset-0 transition-transform duration-300 ${i==="main"?"translate-x-0":i==="sidebar"?"translate-x-full":"-translate-x-full"}`,children:S.jsx(dd,{})}),S.jsx("div",{className:`absolute inset-0 transition-transform duration-300 ${i==="detail"?"translate-x-0":"translate-x-full"}`,children:S.jsx(pd,{})})]}),S.jsxs("div",{className:"flex border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800",children:[S.jsxs("button",{onClick:()=>s("sidebar"),className:`flex-1 flex flex-col items-center py-2 ${i==="sidebar"?"text-blue-500":"text-gray-500"}`,children:[S.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),S.jsx("span",{className:"text-xs mt-1",children:"文件夹"})]}),S.jsxs("button",{onClick:()=>s("main"),className:`flex-1 flex flex-col items-center py-2 ${i==="main"?"text-blue-500":"text-gray-500"}`,children:[S.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),S.jsx("span",{className:"text-xs mt-1",children:"图片"})]}),S.jsxs("button",{onClick:()=>s("detail"),disabled:!o,className:`flex-1 flex flex-col items-center py-2 ${i==="detail"?"text-blue-500":"text-gray-500"} disabled:opacity-30`,children:[S.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),S.jsx("span",{className:"text-xs mt-1",children:"详情"})]})]})]}):S.jsxs("div",{className:"flex flex-col h-screen bg-gray-50 dark:bg-gray-900",children:[S.jsx(md,{}),S.jsxs("div",{ref:c,className:"flex flex-1 overflow-hidden",children:[S.jsx("div",{id:"left-panel",style:{width:`${a}px`},className:"flex-shrink-0 h-full",children:S.jsx(ed,{})}),S.jsx("div",{className:`group relative w-1 h-full cursor-col-resize flex-shrink-0 transition-colors ${y?"bg-blue-500":"bg-gray-200 dark:bg-gray-700 hover:bg-blue-400"}`,onMouseDown:k=>{k.preventDefault(),me.getState().setIsResizingPanels(!0),me.getState().setResizingSide("left"),x(!0)},children:S.jsx("div",{className:"absolute inset-y-0 -left-2 -right-2 w-5"})}),S.jsx("div",{className:"flex-1 min-w-0 h-full",children:S.jsx(dd,{})}),S.jsx("div",{className:`group relative w-1 h-full cursor-col-resize flex-shrink-0 transition-colors ${g?"bg-blue-500":"bg-gray-200 dark:bg-gray-700 hover:bg-blue-400"}`,onMouseDown:k=>{k.preventDefault(),me.getState().setIsResizingPanels(!0),me.getState().setResizingSide("right"),m(!0)},children:S.jsx("div",{className:"absolute inset-y-0 -left-2 -right-2 w-5"})}),S.jsx("div",{id:"right-panel",style:{width:`${f}px`},className:"flex-shrink-0 h-full",children:S.jsx(pd,{})})]})]})}Za.createRoot(document.getElementById("root")).render(S.jsx(ke.StrictMode,{children:S.jsx(Yw,{})})); diff --git a/flypic/app/server/public/assets/index-CGwCzICz.js b/flypic/app/server/public/assets/index-CGwCzICz.js new file mode 100644 index 0000000..c148ef5 --- /dev/null +++ b/flypic/app/server/public/assets/index-CGwCzICz.js @@ -0,0 +1,224 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Es=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function su(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gf={exports:{}},$o={},yf={exports:{}},Se={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ms=Symbol.for("react.element"),Sm=Symbol.for("react.portal"),bm=Symbol.for("react.fragment"),Em=Symbol.for("react.strict_mode"),Cm=Symbol.for("react.profiler"),Nm=Symbol.for("react.provider"),Rm=Symbol.for("react.context"),Tm=Symbol.for("react.forward_ref"),Om=Symbol.for("react.suspense"),Im=Symbol.for("react.memo"),Am=Symbol.for("react.lazy"),fc=Symbol.iterator;function jm(e){return e===null||typeof e!="object"?null:(e=fc&&e[fc]||e["@@iterator"],typeof e=="function"?e:null)}var vf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},wf=Object.assign,xf={};function vi(e,t,n){this.props=e,this.context=t,this.refs=xf,this.updater=n||vf}vi.prototype.isReactComponent={};vi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};vi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function _f(){}_f.prototype=vi.prototype;function ou(e,t,n){this.props=e,this.context=t,this.refs=xf,this.updater=n||vf}var au=ou.prototype=new _f;au.constructor=ou;wf(au,vi.prototype);au.isPureReactComponent=!0;var hc=Array.isArray,kf=Object.prototype.hasOwnProperty,lu={current:null},Sf={key:!0,ref:!0,__self:!0,__source:!0};function bf(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)kf.call(t,r)&&!Sf.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,F=H[z];if(0>>1;zi(D,ee))lei(de,D)?(H[z]=de,H[le]=ee,z=le):(H[z]=D,H[B]=ee,z=B);else if(lei(de,ee))H[z]=de,H[le]=ee,z=le;else break e}}return U}function i(H,U){var ee=H.sortIndex-U.sortIndex;return ee!==0?ee:H.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],d=[],p=1,y=null,x=3,g=!1,m=!1,u=!1,v=typeof setTimeout=="function"?setTimeout:null,c=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(H){for(var U=n(d);U!==null;){if(U.callback===null)r(d);else if(U.startTime<=H)r(d),U.sortIndex=U.expirationTime,t(l,U);else break;U=n(d)}}function k(H){if(u=!1,w(H),!m)if(n(l)!==null)m=!0,ce(b);else{var U=n(d);U!==null&&Q(k,U.startTime-H)}}function b(H,U){m=!1,u&&(u=!1,c(P),P=-1),g=!0;var ee=x;try{for(w(U),y=n(l);y!==null&&(!(y.expirationTime>U)||H&&!J());){var z=y.callback;if(typeof z=="function"){y.callback=null,x=y.priorityLevel;var F=z(y.expirationTime<=U);U=e.unstable_now(),typeof F=="function"?y.callback=F:y===n(l)&&r(l),w(U)}else r(l);y=n(l)}if(y!==null)var A=!0;else{var B=n(d);B!==null&&Q(k,B.startTime-U),A=!1}return A}finally{y=null,x=ee,g=!1}}var N=!1,T=null,P=-1,O=5,M=-1;function J(){return!(e.unstable_now()-MH||125z?(H.sortIndex=ee,t(d,H),n(l)===null&&H===n(d)&&(u?(c(P),P=-1):u=!0,Q(k,ee-z))):(H.sortIndex=F,t(l,H),m||g||(m=!0,ce(b))),H},e.unstable_shouldYield=J,e.unstable_wrapCallback=function(H){var U=x;return function(){var ee=x;x=U;try{return H.apply(this,arguments)}finally{x=ee}}}})(Tf);Rf.exports=Tf;var Hm=Rf.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Vm=Z,Ct=Hm;function ae(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qa=Object.prototype.hasOwnProperty,qm=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,mc={},gc={};function Km(e){return Qa.call(gc,e)?!0:Qa.call(mc,e)?!1:qm.test(e)?gc[e]=!0:(mc[e]=!0,!1)}function Xm(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Ym(e,t,n,r){if(t===null||typeof t>"u"||Xm(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ht(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var et={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){et[e]=new ht(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];et[t]=new ht(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){et[e]=new ht(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){et[e]=new ht(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){et[e]=new ht(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){et[e]=new ht(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){et[e]=new ht(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){et[e]=new ht(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){et[e]=new ht(e,5,!1,e.toLowerCase(),null,!1,!1)});var cu=/[\-:]([a-z])/g;function du(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(cu,du);et[t]=new ht(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(cu,du);et[t]=new ht(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(cu,du);et[t]=new ht(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){et[e]=new ht(e,1,!1,e.toLowerCase(),null,!1,!1)});et.xlinkHref=new ht("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){et[e]=new ht(e,1,!1,e.toLowerCase(),null,!0,!0)});function fu(e,t,n,r){var i=et.hasOwnProperty(t)?et[t]:null;(i!==null?i.type!==0:r||!(2a||i[o]!==s[a]){var l=` +`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{ma=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Pi(e):""}function Zm(e){switch(e.tag){case 5:return Pi(e.type);case 16:return Pi("Lazy");case 13:return Pi("Suspense");case 19:return Pi("SuspenseList");case 0:case 2:case 15:return e=ga(e.type,!1),e;case 11:return e=ga(e.type.render,!1),e;case 1:return e=ga(e.type,!0),e;default:return""}}function tl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Hr:return"Fragment";case Wr:return"Portal";case Ga:return"Profiler";case hu:return"StrictMode";case Ja:return"Suspense";case el:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Af:return(e.displayName||"Context")+".Consumer";case If:return(e._context.displayName||"Context")+".Provider";case pu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case mu:return t=e.displayName||null,t!==null?t:tl(e.type)||"Memo";case Wn:t=e._payload,e=e._init;try{return tl(e(t))}catch{}}return null}function Qm(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return tl(t);case 8:return t===hu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function or(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Gm(e){var t=zf(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Rs(e){e._valueTracker||(e._valueTracker=Gm(e))}function Lf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=zf(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function mo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function nl(e,t){var n=t.checked;return Ue({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function vc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=or(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Pf(e,t){t=t.checked,t!=null&&fu(e,"checked",t,!1)}function rl(e,t){Pf(e,t);var n=or(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?il(e,t.type,n):t.hasOwnProperty("defaultValue")&&il(e,t.type,or(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function wc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function il(e,t,n){(t!=="number"||mo(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Fi=Array.isArray;function ni(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Ts.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Gi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ui={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Jm=["Webkit","ms","Moz","O"];Object.keys(Ui).forEach(function(e){Jm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ui[t]=Ui[e]})});function Bf(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ui.hasOwnProperty(e)&&Ui[e]?(""+t).trim():t+"px"}function Uf(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Bf(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var e0=Ue({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function al(e,t){if(t){if(e0[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ae(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ae(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ae(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ae(62))}}function ll(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ul=null;function gu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cl=null,ri=null,ii=null;function kc(e){if(e=vs(e)){if(typeof cl!="function")throw Error(ae(280));var t=e.stateNode;t&&(t=Ko(t),cl(e.stateNode,e.type,t))}}function $f(e){ri?ii?ii.push(e):ii=[e]:ri=e}function Wf(){if(ri){var e=ri,t=ii;if(ii=ri=null,kc(e),t)for(e=0;e>>=0,e===0?32:31-(d0(e)/f0|0)|0}var Os=64,Is=4194304;function Di(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function wo(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=Di(a):(s&=o,s!==0&&(r=Di(s)))}else o=n&~i,o!==0?r=Di(o):s!==0&&(r=Di(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function gs(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Yt(t),e[t]=n}function g0(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Wi),Ic=" ",Ac=!1;function uh(e,t){switch(e){case"keyup":return H0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ch(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Vr=!1;function q0(e,t){switch(e){case"compositionend":return ch(t);case"keypress":return t.which!==32?null:(Ac=!0,Ic);case"textInput":return e=t.data,e===Ic&&Ac?null:e;default:return null}}function K0(e,t){if(Vr)return e==="compositionend"||!bu&&uh(e,t)?(e=ah(),Gs=_u=Xn=null,Vr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Pc(n)}}function ph(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ph(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mh(){for(var e=window,t=mo();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=mo(e.document)}return t}function Eu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function ng(e){var t=mh(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ph(n.ownerDocument.documentElement,n)){if(r!==null&&Eu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Fc(n,s);var o=Fc(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,qr=null,gl=null,Vi=null,yl=!1;function Dc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;yl||qr==null||qr!==mo(r)||(r=qr,"selectionStart"in r&&Eu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Vi&&is(Vi,r)||(Vi=r,r=ko(gl,"onSelect"),0Yr||(e.current=Sl[Yr],Sl[Yr]=null,Yr--)}function Oe(e,t){Yr++,Sl[Yr]=e.current,e.current=t}var ar={},ot=ur(ar),gt=ur(!1),Er=ar;function ci(e,t){var n=e.type.contextTypes;if(!n)return ar;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function yt(e){return e=e.childContextTypes,e!=null}function bo(){Le(gt),Le(ot)}function Vc(e,t,n){if(ot.current!==ar)throw Error(ae(168));Oe(ot,t),Oe(gt,n)}function bh(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(ae(108,Qm(e)||"Unknown",i));return Ue({},n,r)}function Eo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ar,Er=ot.current,Oe(ot,e),Oe(gt,gt.current),!0}function qc(e,t,n){var r=e.stateNode;if(!r)throw Error(ae(169));n?(e=bh(e,t,Er),r.__reactInternalMemoizedMergedChildContext=e,Le(gt),Le(ot),Oe(ot,e)):Le(gt),Oe(gt,n)}var Cn=null,Xo=!1,Oa=!1;function Eh(e){Cn===null?Cn=[e]:Cn.push(e)}function pg(e){Xo=!0,Eh(e)}function cr(){if(!Oa&&Cn!==null){Oa=!0;var e=0,t=Re;try{var n=Cn;for(Re=1;e>=o,i-=o,Rn=1<<32-Yt(t)+i|n<P?(O=T,T=null):O=T.sibling;var M=x(c,T,w[P],k);if(M===null){T===null&&(T=O);break}e&&T&&M.alternate===null&&t(c,T),h=s(M,h,P),N===null?b=M:N.sibling=M,N=M,T=O}if(P===w.length)return n(c,T),Fe&&mr(c,P),b;if(T===null){for(;PP?(O=T,T=null):O=T.sibling;var J=x(c,T,M.value,k);if(J===null){T===null&&(T=O);break}e&&T&&J.alternate===null&&t(c,T),h=s(J,h,P),N===null?b=J:N.sibling=J,N=J,T=O}if(M.done)return n(c,T),Fe&&mr(c,P),b;if(T===null){for(;!M.done;P++,M=w.next())M=y(c,M.value,k),M!==null&&(h=s(M,h,P),N===null?b=M:N.sibling=M,N=M);return Fe&&mr(c,P),b}for(T=r(c,T);!M.done;P++,M=w.next())M=g(T,c,P,M.value,k),M!==null&&(e&&M.alternate!==null&&T.delete(M.key===null?P:M.key),h=s(M,h,P),N===null?b=M:N.sibling=M,N=M);return e&&T.forEach(function(R){return t(c,R)}),Fe&&mr(c,P),b}function v(c,h,w,k){if(typeof w=="object"&&w!==null&&w.type===Hr&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Ns:e:{for(var b=w.key,N=h;N!==null;){if(N.key===b){if(b=w.type,b===Hr){if(N.tag===7){n(c,N.sibling),h=i(N,w.props.children),h.return=c,c=h;break e}}else if(N.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===Wn&&Yc(b)===N.type){n(c,N.sibling),h=i(N,w.props),h.ref=Ii(c,N,w),h.return=c,c=h;break e}n(c,N);break}else t(c,N);N=N.sibling}w.type===Hr?(h=Sr(w.props.children,c.mode,k,w.key),h.return=c,c=h):(k=oo(w.type,w.key,w.props,null,c.mode,k),k.ref=Ii(c,h,w),k.return=c,c=k)}return o(c);case Wr:e:{for(N=w.key;h!==null;){if(h.key===N)if(h.tag===4&&h.stateNode.containerInfo===w.containerInfo&&h.stateNode.implementation===w.implementation){n(c,h.sibling),h=i(h,w.children||[]),h.return=c,c=h;break e}else{n(c,h);break}else t(c,h);h=h.sibling}h=Da(w,c.mode,k),h.return=c,c=h}return o(c);case Wn:return N=w._init,v(c,h,N(w._payload),k)}if(Fi(w))return m(c,h,w,k);if(Ci(w))return u(c,h,w,k);Ds(c,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,h!==null&&h.tag===6?(n(c,h.sibling),h=i(h,w),h.return=c,c=h):(n(c,h),h=Fa(w,c.mode,k),h.return=c,c=h),o(c)):n(c,h)}return v}var fi=Th(!0),Oh=Th(!1),Ro=ur(null),To=null,Gr=null,Tu=null;function Ou(){Tu=Gr=To=null}function Iu(e){var t=Ro.current;Le(Ro),e._currentValue=t}function Cl(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function oi(e,t){To=e,Tu=Gr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(mt=!0),e.firstContext=null)}function Bt(e){var t=e._currentValue;if(Tu!==e)if(e={context:e,memoizedValue:t,next:null},Gr===null){if(To===null)throw Error(ae(308));Gr=e,To.dependencies={lanes:0,firstContext:e}}else Gr=Gr.next=e;return t}var wr=null;function Au(e){wr===null?wr=[e]:wr.push(e)}function Ih(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Au(t)):(n.next=i.next,i.next=n),t.interleaved=n,jn(e,r)}function jn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Hn=!1;function ju(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ah(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function On(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function er(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ce&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,jn(e,n)}return i=r.interleaved,i===null?(t.next=t,Au(r)):(t.next=i.next,i.next=t),r.interleaved=t,jn(e,n)}function eo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vu(e,n)}}function Zc(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Oo(e,t,n,r){var i=e.updateQueue;Hn=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,d=l.next;l.next=null,o===null?s=d:o.next=d,o=l;var p=e.alternate;p!==null&&(p=p.updateQueue,a=p.lastBaseUpdate,a!==o&&(a===null?p.firstBaseUpdate=d:a.next=d,p.lastBaseUpdate=l))}if(s!==null){var y=i.baseState;o=0,p=d=l=null,a=s;do{var x=a.lane,g=a.eventTime;if((r&x)===x){p!==null&&(p=p.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,u=a;switch(x=t,g=n,u.tag){case 1:if(m=u.payload,typeof m=="function"){y=m.call(g,y,x);break e}y=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=u.payload,x=typeof m=="function"?m.call(g,y,x):m,x==null)break e;y=Ue({},y,x);break e;case 2:Hn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,x=i.effects,x===null?i.effects=[a]:x.push(a))}else g={eventTime:g,lane:x,tag:a.tag,payload:a.payload,callback:a.callback,next:null},p===null?(d=p=g,l=y):p=p.next=g,o|=x;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;x=a,a=x.next,x.next=null,i.lastBaseUpdate=x,i.shared.pending=null}}while(!0);if(p===null&&(l=y),i.baseState=l,i.firstBaseUpdate=d,i.lastBaseUpdate=p,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Rr|=o,e.lanes=o,e.memoizedState=y}}function Qc(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Aa.transition;Aa.transition={};try{e(!1),t()}finally{Re=n,Aa.transition=r}}function Yh(){return Ut().memoizedState}function vg(e,t,n){var r=nr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Zh(e))Qh(t,n);else if(n=Ih(e,t,n,r),n!==null){var i=dt();Zt(n,e,r,i),Gh(n,t,r)}}function wg(e,t,n){var r=nr(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Zh(e))Qh(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,Qt(a,o)){var l=t.interleaved;l===null?(i.next=i,Au(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Ih(e,t,i,r),n!==null&&(i=dt(),Zt(n,e,r,i),Gh(n,t,r))}}function Zh(e){var t=e.alternate;return e===Be||t!==null&&t===Be}function Qh(e,t){qi=Ao=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Gh(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vu(e,n)}}var jo={readContext:Bt,useCallback:nt,useContext:nt,useEffect:nt,useImperativeHandle:nt,useInsertionEffect:nt,useLayoutEffect:nt,useMemo:nt,useReducer:nt,useRef:nt,useState:nt,useDebugValue:nt,useDeferredValue:nt,useTransition:nt,useMutableSource:nt,useSyncExternalStore:nt,useId:nt,unstable_isNewReconciler:!1},xg={readContext:Bt,useCallback:function(e,t){return ln().memoizedState=[e,t===void 0?null:t],e},useContext:Bt,useEffect:Jc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,no(4194308,4,Hh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return no(4194308,4,e,t)},useInsertionEffect:function(e,t){return no(4,2,e,t)},useMemo:function(e,t){var n=ln();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ln();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=vg.bind(null,Be,e),[r.memoizedState,e]},useRef:function(e){var t=ln();return e={current:e},t.memoizedState=e},useState:Gc,useDebugValue:Uu,useDeferredValue:function(e){return ln().memoizedState=e},useTransition:function(){var e=Gc(!1),t=e[0];return e=yg.bind(null,e[1]),ln().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Be,i=ln();if(Fe){if(n===void 0)throw Error(ae(407));n=n()}else{if(n=t(),Qe===null)throw Error(ae(349));Nr&30||Ph(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Jc(Dh.bind(null,r,s,e),[e]),r.flags|=2048,fs(9,Fh.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=ln(),t=Qe.identifierPrefix;if(Fe){var n=Tn,r=Rn;n=(r&~(1<<32-Yt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=cs++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[un]=t,e[as]=r,lp(e,t,!1,!1),t.stateNode=e;e:{switch(o=ll(n,r),n){case"dialog":ze("cancel",e),ze("close",e),i=r;break;case"iframe":case"object":case"embed":ze("load",e),i=r;break;case"video":case"audio":for(i=0;imi&&(t.flags|=128,r=!0,Ai(s,!1),t.lanes=4194304)}else{if(!r)if(e=Io(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ai(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Fe)return rt(t),null}else 2*He()-s.renderingStartTime>mi&&n!==1073741824&&(t.flags|=128,r=!0,Ai(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=He(),t.sibling=null,n=De.current,Oe(De,r?n&1|2:n&1),t):(rt(t),null);case 22:case 23:return Ku(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?St&1073741824&&(rt(t),t.subtreeFlags&6&&(t.flags|=8192)):rt(t),null;case 24:return null;case 25:return null}throw Error(ae(156,t.tag))}function Rg(e,t){switch(Nu(t),t.tag){case 1:return yt(t.type)&&bo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hi(),Le(gt),Le(ot),Pu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Lu(t),null;case 13:if(Le(De),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ae(340));di()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Le(De),null;case 4:return hi(),null;case 10:return Iu(t.type._context),null;case 22:case 23:return Ku(),null;case 24:return null;default:return null}}var Bs=!1,it=!1,Tg=typeof WeakSet=="function"?WeakSet:Set,he=null;function Jr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){$e(e,t,r)}else n.current=null}function Ll(e,t,n){try{n()}catch(r){$e(e,t,r)}}var cd=!1;function Og(e,t){if(vl=xo,e=mh(),Eu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,d=0,p=0,y=e,x=null;t:for(;;){for(var g;y!==n||i!==0&&y.nodeType!==3||(a=o+i),y!==s||r!==0&&y.nodeType!==3||(l=o+r),y.nodeType===3&&(o+=y.nodeValue.length),(g=y.firstChild)!==null;)x=y,y=g;for(;;){if(y===e)break t;if(x===n&&++d===i&&(a=o),x===s&&++p===r&&(l=o),(g=y.nextSibling)!==null)break;y=x,x=y.parentNode}y=g}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(wl={focusedElem:e,selectionRange:n},xo=!1,he=t;he!==null;)if(t=he,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,he=e;else for(;he!==null;){t=he;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var u=m.memoizedProps,v=m.memoizedState,c=t.stateNode,h=c.getSnapshotBeforeUpdate(t.elementType===t.type?u:Vt(t.type,u),v);c.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ae(163))}}catch(k){$e(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,he=e;break}he=t.return}return m=cd,cd=!1,m}function Ki(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Ll(t,n,s)}i=i.next}while(i!==r)}}function Qo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Pl(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function dp(e){var t=e.alternate;t!==null&&(e.alternate=null,dp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[un],delete t[as],delete t[kl],delete t[fg],delete t[hg])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function fp(e){return e.tag===5||e.tag===3||e.tag===4}function dd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Fl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=So));else if(r!==4&&(e=e.child,e!==null))for(Fl(e,t,n),e=e.sibling;e!==null;)Fl(e,t,n),e=e.sibling}function Dl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Dl(e,t,n),e=e.sibling;e!==null;)Dl(e,t,n),e=e.sibling}var Ge=null,qt=!1;function $n(e,t,n){for(n=n.child;n!==null;)hp(e,t,n),n=n.sibling}function hp(e,t,n){if(cn&&typeof cn.onCommitFiberUnmount=="function")try{cn.onCommitFiberUnmount(Wo,n)}catch{}switch(n.tag){case 5:it||Jr(n,t);case 6:var r=Ge,i=qt;Ge=null,$n(e,t,n),Ge=r,qt=i,Ge!==null&&(qt?(e=Ge,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ge.removeChild(n.stateNode));break;case 18:Ge!==null&&(qt?(e=Ge,n=n.stateNode,e.nodeType===8?Ta(e.parentNode,n):e.nodeType===1&&Ta(e,n),ns(e)):Ta(Ge,n.stateNode));break;case 4:r=Ge,i=qt,Ge=n.stateNode.containerInfo,qt=!0,$n(e,t,n),Ge=r,qt=i;break;case 0:case 11:case 14:case 15:if(!it&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Ll(n,t,o),i=i.next}while(i!==r)}$n(e,t,n);break;case 1:if(!it&&(Jr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){$e(n,t,a)}$n(e,t,n);break;case 21:$n(e,t,n);break;case 22:n.mode&1?(it=(r=it)||n.memoizedState!==null,$n(e,t,n),it=r):$n(e,t,n);break;default:$n(e,t,n)}}function fd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Tg),t.forEach(function(r){var i=Mg.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ht(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=He()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ag(r/1960))-r,10e?16:e,Yn===null)var r=!1;else{if(e=Yn,Yn=null,Po=0,Ce&6)throw Error(ae(331));var i=Ce;for(Ce|=4,he=e.current;he!==null;){var s=he,o=s.child;if(he.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lHe()-Vu?kr(e,0):Hu|=n),vt(e,t)}function _p(e,t){t===0&&(e.mode&1?(t=Is,Is<<=1,!(Is&130023424)&&(Is=4194304)):t=1);var n=dt();e=jn(e,t),e!==null&&(gs(e,t,n),vt(e,n))}function Dg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),_p(e,n)}function Mg(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ae(314))}r!==null&&r.delete(t),_p(e,n)}var kp;kp=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||gt.current)mt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return mt=!1,Cg(e,t,n);mt=!!(e.flags&131072)}else mt=!1,Fe&&t.flags&1048576&&Ch(t,No,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ro(e,t),e=t.pendingProps;var i=ci(t,ot.current);oi(t,n),i=Du(null,t,r,e,i,n);var s=Mu();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,yt(r)?(s=!0,Eo(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,ju(t),i.updater=Zo,t.stateNode=i,i._reactInternals=t,Rl(t,r,e,n),t=Il(null,t,r,!0,s,n)):(t.tag=0,Fe&&s&&Cu(t),ct(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ro(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Ug(r),e=Vt(r,e),i){case 0:t=Ol(null,t,r,e,n);break e;case 1:t=ad(null,t,r,e,n);break e;case 11:t=sd(null,t,r,e,n);break e;case 14:t=od(null,t,r,Vt(r.type,e),n);break e}throw Error(ae(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vt(r,i),Ol(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vt(r,i),ad(e,t,r,i,n);case 3:e:{if(sp(t),e===null)throw Error(ae(387));r=t.pendingProps,s=t.memoizedState,i=s.element,Ah(e,t),Oo(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=pi(Error(ae(423)),t),t=ld(e,t,r,n,i);break e}else if(r!==i){i=pi(Error(ae(424)),t),t=ld(e,t,r,n,i);break e}else for(bt=Jn(t.stateNode.containerInfo.firstChild),Et=t,Fe=!0,Xt=null,n=Oh(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(di(),r===i){t=zn(e,t,n);break e}ct(e,t,r,n)}t=t.child}return t;case 5:return jh(t),e===null&&El(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,xl(r,i)?o=null:s!==null&&xl(r,s)&&(t.flags|=32),ip(e,t),ct(e,t,o,n),t.child;case 6:return e===null&&El(t),null;case 13:return op(e,t,n);case 4:return zu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=fi(t,null,r,n):ct(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vt(r,i),sd(e,t,r,i,n);case 7:return ct(e,t,t.pendingProps,n),t.child;case 8:return ct(e,t,t.pendingProps.children,n),t.child;case 12:return ct(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,Oe(Ro,r._currentValue),r._currentValue=o,s!==null)if(Qt(s.value,o)){if(s.children===i.children&&!gt.current){t=zn(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=On(-1,n&-n),l.tag=2;var d=s.updateQueue;if(d!==null){d=d.shared;var p=d.pending;p===null?l.next=l:(l.next=p.next,p.next=l),d.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Cl(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(ae(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Cl(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}ct(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,oi(t,n),i=Bt(i),r=r(i),t.flags|=1,ct(e,t,r,n),t.child;case 14:return r=t.type,i=Vt(r,t.pendingProps),i=Vt(r.type,i),od(e,t,r,i,n);case 15:return np(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vt(r,i),ro(e,t),t.tag=1,yt(r)?(e=!0,Eo(t)):e=!1,oi(t,n),Jh(t,r,i),Rl(t,r,i,n),Il(null,t,r,!0,e,n);case 19:return ap(e,t,n);case 22:return rp(e,t,n)}throw Error(ae(156,t.tag))};function Sp(e,t){return Zf(e,t)}function Bg(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Dt(e,t,n,r){return new Bg(e,t,n,r)}function Yu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ug(e){if(typeof e=="function")return Yu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===pu)return 11;if(e===mu)return 14}return 2}function rr(e,t){var n=e.alternate;return n===null?(n=Dt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function oo(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")Yu(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Hr:return Sr(n.children,i,s,t);case hu:o=8,i|=8;break;case Ga:return e=Dt(12,n,t,i|2),e.elementType=Ga,e.lanes=s,e;case Ja:return e=Dt(13,n,t,i),e.elementType=Ja,e.lanes=s,e;case el:return e=Dt(19,n,t,i),e.elementType=el,e.lanes=s,e;case jf:return Jo(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case If:o=10;break e;case Af:o=9;break e;case pu:o=11;break e;case mu:o=14;break e;case Wn:o=16,r=null;break e}throw Error(ae(130,e==null?e:typeof e,""))}return t=Dt(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Sr(e,t,n,r){return e=Dt(7,e,r,t),e.lanes=n,e}function Jo(e,t,n,r){return e=Dt(22,e,r,t),e.elementType=jf,e.lanes=n,e.stateNode={isHidden:!1},e}function Fa(e,t,n){return e=Dt(6,e,null,t),e.lanes=n,e}function Da(e,t,n){return t=Dt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function $g(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=va(0),this.expirationTimes=va(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=va(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Zu(e,t,n,r,i,s,o,a,l){return e=new $g(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Dt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ju(s),e}function Wg(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Np)}catch(e){console.error(e)}}Np(),Nf.exports=Nt;var Rp=Nf.exports,xd=Rp;Za.createRoot=xd.createRoot,Za.hydrateRoot=xd.hydrateRoot;const hn=Object.create(null);hn.open="0";hn.close="1";hn.ping="2";hn.pong="3";hn.message="4";hn.upgrade="5";hn.noop="6";const ao=Object.create(null);Object.keys(hn).forEach(e=>{ao[hn[e]]=e});const Wl={type:"error",data:"parser error"},Tp=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Op=typeof ArrayBuffer=="function",Ip=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,ec=({type:e,data:t},n,r)=>Tp&&t instanceof Blob?n?r(t):_d(t,r):Op&&(t instanceof ArrayBuffer||Ip(t))?n?r(t):_d(new Blob([t]),r):r(hn[e]+(t||"")),_d=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function kd(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Ma;function Xg(e,t){if(Tp&&e.data instanceof Blob)return e.data.arrayBuffer().then(kd).then(t);if(Op&&(e.data instanceof ArrayBuffer||Ip(e.data)))return t(kd(e.data));ec(e,!1,n=>{Ma||(Ma=new TextEncoder),t(Ma.encode(n))})}const Sd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bi=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,r,i=0,s,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const d=new ArrayBuffer(t),p=new Uint8Array(d);for(r=0;r>4,p[i++]=(o&15)<<4|a>>2,p[i++]=(a&3)<<6|l&63;return d},Zg=typeof ArrayBuffer=="function",tc=(e,t)=>{if(typeof e!="string")return{type:"message",data:Ap(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Qg(e.substring(1),t)}:ao[n]?e.length>1?{type:ao[n],data:e.substring(1)}:{type:ao[n]}:Wl},Qg=(e,t)=>{if(Zg){const n=Yg(e);return Ap(n,t)}else return{base64:!0,data:e}},Ap=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},jp="",Gg=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,o)=>{ec(s,!1,a=>{r[o]=a,++i===n&&t(r.join(jp))})})},Jg=(e,t)=>{const n=e.split(jp),r=[];for(let i=0;i{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let Ba;function Ws(e){return e.reduce((t,n)=>t+n.length,0)}function Hs(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;iMath.pow(2,21)-1){a.enqueue(Wl);break}i=p*Math.pow(2,32)+d.getUint32(4),r=3}else{if(Ws(n)e){a.enqueue(Wl);break}}}})}const zp=4;function qe(e){if(e)return ny(e)}function ny(e){for(var t in qe.prototype)e[t]=qe.prototype[t];return e}qe.prototype.on=qe.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};qe.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};qe.prototype.off=qe.prototype.removeListener=qe.prototype.removeAllListeners=qe.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;iPromise.resolve().then(t):(t,n)=>n(t,0),Pt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),ry="arraybuffer";function Lp(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const iy=Pt.setTimeout,sy=Pt.clearTimeout;function sa(e,t){t.useNativeTimers?(e.setTimeoutFn=iy.bind(Pt),e.clearTimeoutFn=sy.bind(Pt)):(e.setTimeoutFn=Pt.setTimeout.bind(Pt),e.clearTimeoutFn=Pt.clearTimeout.bind(Pt))}const oy=1.33;function ay(e){return typeof e=="string"?ly(e):Math.ceil((e.byteLength||e.size)*oy)}function ly(e){let t=0,n=0;for(let r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}function Pp(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function uy(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function cy(e){let t={},n=e.split("&");for(let r=0,i=n.length;r{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Jg(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,Gg(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Pp()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Fp=!1;try{Fp=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const hy=Fp;function py(){}class my extends fy{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class fn extends qe{constructor(t,n,r){super(),this.createRequest=t,sa(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=Lp(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=fn.requestsCount++,fn.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=py,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete fn.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}fn.requestsCount=0;fn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",bd);else if(typeof addEventListener=="function"){const e="onpagehide"in Pt?"pagehide":"unload";addEventListener(e,bd,!1)}}function bd(){for(let e in fn.requests)fn.requests.hasOwnProperty(e)&&fn.requests[e].abort()}const gy=function(){const e=Dp({xdomain:!1});return e&&e.responseType!==null}();class yy extends my{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=gy&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new fn(Dp,this.uri(),t)}}function Dp(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||hy))return new XMLHttpRequest}catch{}if(!t)try{return new Pt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Mp=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class vy extends nc{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Mp?{}:Lp(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n{try{this.doWrite(r,s)}catch{}i&&ia(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Pp()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Ua=Pt.WebSocket||Pt.MozWebSocket;class wy extends vy{createSocket(t,n,r){return Mp?new Ua(t,n,r):n?new Ua(t,n):new Ua(t)}doWrite(t,n){this.ws.send(n)}}class xy extends nc{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=ty(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=ey();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n{i&&ia(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const _y={websocket:wy,webtransport:xy,polling:yy},ky=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Sy=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Hl(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=ky.exec(e||""),s={},o=14;for(;o--;)s[Sy[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=by(s,s.path),s.queryKey=Ey(s,s.query),s}function by(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Ey(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Vl=typeof addEventListener=="function"&&typeof removeEventListener=="function",lo=[];Vl&&addEventListener("offline",()=>{lo.forEach(e=>e())},!1);class ir extends qe{constructor(t,n){if(super(),this.binaryType=ry,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Hl(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Hl(n.host).host);sa(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=cy(this.opts.query)),Vl&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},lo.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=zp,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&ir.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",ir.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,ia(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(ir.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Vl&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=lo.indexOf(this._offlineEventListener);r!==-1&&lo.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}ir.protocol=zp;class Cy extends ir{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",y=>{if(!r)if(y.type==="pong"&&y.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;ir.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(p(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const x=new Error("probe error");x.transport=n.name,this.emitReserved("upgradeError",x)}}))};function s(){r||(r=!0,p(),n.close(),n=null)}const o=y=>{const x=new Error("probe error: "+y);x.transport=n.name,s(),this.emitReserved("upgradeError",x)};function a(){o("transport closed")}function l(){o("socket closed")}function d(y){n&&y.name!==n.name&&s()}const p=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",d)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",d),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r_y[i]).filter(i=>!!i)),super(t,r)}};function Ry(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Hl(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const Ty=typeof ArrayBuffer=="function",Oy=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Bp=Object.prototype.toString,Iy=typeof Blob=="function"||typeof Blob<"u"&&Bp.call(Blob)==="[object BlobConstructor]",Ay=typeof File=="function"||typeof File<"u"&&Bp.call(File)==="[object FileConstructor]";function rc(e){return Ty&&(e instanceof ArrayBuffer||Oy(e))||Iy&&e instanceof Blob||Ay&&e instanceof File}function uo(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num{delete this.acks[t];for(let a=0;a{this.io.clearTimeoutFn(s),n.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,i)=>{const s=(o,a)=>o?i(o):r(a);s.withError=!0,n.push(s),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Ee.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Ee.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ee.EVENT:case Ee.BINARY_EVENT:this.onevent(t);break;case Ee.ACK:case Ee.BINARY_ACK:this.onack(t);break;case Ee.DISCONNECT:this.ondisconnect();break;case Ee.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Ee.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ee.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}_i.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};_i.prototype.reset=function(){this.attempts=0};_i.prototype.setMin=function(e){this.ms=e};_i.prototype.setMax=function(e){this.max=e};_i.prototype.setJitter=function(e){this.jitter=e};class Xl extends qe{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,sa(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new _i({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||My;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Ny(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Kt(n,"open",function(){r.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=Kt(n,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Kt(t,"ping",this.onping.bind(this)),Kt(t,"data",this.ondata.bind(this)),Kt(t,"error",this.onerror.bind(this)),Kt(t,"close",this.onclose.bind(this)),Kt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){ia(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Up(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;rt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const zi={};function co(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Ry(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=zi[i]&&s in zi[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new Xl(r,t):(zi[i]||(zi[i]=new Xl(r,t)),l=zi[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(co,{Manager:Xl,Socket:Up,io:co,connect:co});const Uy={},Cd=e=>{let t;const n=new Set,r=(p,y)=>{const x=typeof p=="function"?p(t):p;if(!Object.is(x,t)){const g=t;t=y??(typeof x!="object"||x===null)?x:Object.assign({},t,x),n.forEach(m=>m(t,g))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>d,subscribe:p=>(n.add(p),()=>n.delete(p)),destroy:()=>{(Uy?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(r,i,l);return l},$y=e=>e?Cd(e):Cd;var $p={exports:{}},Wp={},Hp={exports:{}},Vp={};/** + * @license React + * use-sync-external-store-shim.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 gi=Z;function Wy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Hy=typeof Object.is=="function"?Object.is:Wy,Vy=gi.useState,qy=gi.useEffect,Ky=gi.useLayoutEffect,Xy=gi.useDebugValue;function Yy(e,t){var n=t(),r=Vy({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return Ky(function(){i.value=n,i.getSnapshot=t,$a(i)&&s({inst:i})},[e,n,t]),qy(function(){return $a(i)&&s({inst:i}),e(function(){$a(i)&&s({inst:i})})},[e]),Xy(n),n}function $a(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Hy(e,n)}catch{return!0}}function Zy(e,t){return t()}var Qy=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Zy:Yy;Vp.useSyncExternalStore=gi.useSyncExternalStore!==void 0?gi.useSyncExternalStore:Qy;Hp.exports=Vp;var Gy=Hp.exports;/** + * @license React + * use-sync-external-store-shim/with-selector.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 oa=Z,Jy=Gy;function ev(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var tv=typeof Object.is=="function"?Object.is:ev,nv=Jy.useSyncExternalStore,rv=oa.useRef,iv=oa.useEffect,sv=oa.useMemo,ov=oa.useDebugValue;Wp.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=rv(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=sv(function(){function l(g){if(!d){if(d=!0,p=g,g=r(g),i!==void 0&&o.hasValue){var m=o.value;if(i(m,g))return y=m}return y=g}if(m=y,tv(p,g))return m;var u=r(g);return i!==void 0&&i(m,u)?(p=g,m):(p=g,y=u)}var d=!1,p,y,x=n===void 0?null:n;return[function(){return l(t())},x===null?void 0:function(){return l(x())}]},[t,n,r,i]);var a=nv(e,s[0],s[1]);return iv(function(){o.hasValue=!0,o.value=a},[a]),ov(a),a};$p.exports=Wp;var av=$p.exports;const lv=su(av),qp={},{useDebugValue:uv}=ke,{useSyncExternalStoreWithSelector:cv}=lv;let Nd=!1;const dv=e=>e;function fv(e,t=dv,n){(qp?"production":void 0)!=="production"&&n&&!Nd&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Nd=!0);const r=cv(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return uv(r),r}const Rd=e=>{(qp?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?$y(e):e,n=(r,i)=>fv(t,r,i);return Object.assign(n,t),n},hv=e=>e?Rd(e):Rd,me=hv((e,t)=>({theme:"light",setTheme:n=>e({theme:n}),toggleTheme:()=>e(n=>({theme:n.theme==="light"?"dark":"light"})),libraries:[],currentLibraryId:null,setLibraries:n=>e({libraries:n}),setCurrentLibrary:n=>e({currentLibraryId:n}),addLibrary:n=>e(r=>({libraries:[...r.libraries,n]})),removeLibrary:n=>e(r=>({libraries:r.libraries.filter(i=>i.id!==n),currentLibraryId:r.currentLibraryId===n?null:r.currentLibraryId})),images:[],filteredImages:[],totalImageCount:0,setImages:n=>e({images:n,filteredImages:n}),setFilteredImages:n=>e({filteredImages:n}),setTotalImageCount:n=>e({totalImageCount:n}),imageLoadingState:{isLoading:!1,loadedCount:0,totalCount:0,hasMore:!1},setImageLoadingState:n=>e(r=>({imageLoadingState:{...r.imageLoadingState,...n}})),appendImages:n=>e(r=>({images:[...r.images,...n],filteredImages:[...r.filteredImages,...n]})),folders:[],selectedFolder:null,setFolders:n=>e({folders:n}),setSelectedFolder:n=>e({selectedFolder:n}),searchKeywords:"",filters:{formats:[],minSize:null,maxSize:null,startDate:null,endDate:null},setSearchKeywords:n=>e({searchKeywords:n}),setFilters:n=>e(r=>({filters:{...r.filters,...n}})),resetFilters:()=>e({searchKeywords:"",filters:{formats:[],minSize:null,maxSize:null,startDate:null,endDate:null}}),selectedImage:null,setSelectedImage:n=>e({selectedImage:n}),selectedImages:[],setSelectedImages:n=>e({selectedImages:n}),toggleImageSelection:n=>e(r=>r.selectedImages.some(s=>s.path===n.path)?{selectedImages:r.selectedImages.filter(s=>s.path!==n.path)}:{selectedImages:[...r.selectedImages,n]}),clearSelection:()=>e({selectedImages:[],selectedImage:null}),scanProgress:null,scanStartTime:null,setScanProgress:n=>e(r=>n&&!r.scanStartTime&&n.current>0?{scanProgress:n,scanStartTime:Date.now()}:n?{scanProgress:n}:{scanProgress:null,scanStartTime:null}),isResizingPanels:!1,setIsResizingPanels:n=>e({isResizingPanels:n}),resizingSide:null,setResizingSide:n=>e({resizingSide:n}),thumbnailHeight:200,setThumbnailHeight:n=>e({thumbnailHeight:n}),mobileView:"main",setMobileView:n=>e({mobileView:n}),getCurrentLibrary:()=>{const n=t();return n.libraries.find(r=>r.id===n.currentLibraryId)}}));function Kp(e,t){return function(){return e.apply(t,arguments)}}const{toString:pv}=Object.prototype,{getPrototypeOf:sc}=Object,{iterator:aa,toStringTag:Xp}=Symbol,la=(e=>t=>{const n=pv.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Gt=e=>(e=e.toLowerCase(),t=>la(t)===e),ua=e=>t=>typeof t===e,{isArray:ki}=Array,yi=ua("undefined");function xs(e){return e!==null&&!yi(e)&&e.constructor!==null&&!yi(e.constructor)&&wt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Yp=Gt("ArrayBuffer");function mv(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Yp(e.buffer),t}const gv=ua("string"),wt=ua("function"),Zp=ua("number"),_s=e=>e!==null&&typeof e=="object",yv=e=>e===!0||e===!1,fo=e=>{if(la(e)!=="object")return!1;const t=sc(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Xp in e)&&!(aa in e)},vv=e=>{if(!_s(e)||xs(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},wv=Gt("Date"),xv=Gt("File"),_v=Gt("Blob"),kv=Gt("FileList"),Sv=e=>_s(e)&&wt(e.pipe),bv=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||wt(e.append)&&((t=la(e))==="formdata"||t==="object"&&wt(e.toString)&&e.toString()==="[object FormData]"))},Ev=Gt("URLSearchParams"),[Cv,Nv,Rv,Tv]=["ReadableStream","Request","Response","Headers"].map(Gt),Ov=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ks(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),ki(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}const _r=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Gp=e=>!yi(e)&&e!==_r;function Yl(){const{caseless:e,skipUndefined:t}=Gp(this)&&this||{},n={},r=(i,s)=>{const o=e&&Qp(n,s)||s;fo(n[o])&&fo(i)?n[o]=Yl(n[o],i):fo(i)?n[o]=Yl({},i):ki(i)?n[o]=i.slice():(!t||!yi(i))&&(n[o]=i)};for(let i=0,s=arguments.length;i(ks(t,(i,s)=>{n&&wt(i)?e[s]=Kp(i,n):e[s]=i},{allOwnKeys:r}),e),Av=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),jv=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},zv=(e,t,n,r)=>{let i,s,o;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],(!r||r(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&sc(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Lv=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Pv=e=>{if(!e)return null;if(ki(e))return e;let t=e.length;if(!Zp(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Fv=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&sc(Uint8Array)),Dv=(e,t)=>{const r=(e&&e[aa]).call(e);let i;for(;(i=r.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},Mv=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Bv=Gt("HTMLFormElement"),Uv=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Td=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),$v=Gt("RegExp"),Jp=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ks(n,(i,s)=>{let o;(o=t(i,s,e))!==!1&&(r[s]=o||i)}),Object.defineProperties(e,r)},Wv=e=>{Jp(e,(t,n)=>{if(wt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(wt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Hv=(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return ki(e)?r(e):r(String(e).split(t)),n},Vv=()=>{},qv=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Kv(e){return!!(e&&wt(e.append)&&e[Xp]==="FormData"&&e[aa])}const Xv=e=>{const t=new Array(10),n=(r,i)=>{if(_s(r)){if(t.indexOf(r)>=0)return;if(xs(r))return r;if(!("toJSON"in r)){t[i]=r;const s=ki(r)?[]:{};return ks(r,(o,a)=>{const l=n(o,i+1);!yi(l)&&(s[a]=l)}),t[i]=void 0,s}}return r};return n(e,0)},Yv=Gt("AsyncFunction"),Zv=e=>e&&(_s(e)||wt(e))&&wt(e.then)&&wt(e.catch),em=((e,t)=>e?setImmediate:t?((n,r)=>(_r.addEventListener("message",({source:i,data:s})=>{i===_r&&s===n&&r.length&&r.shift()()},!1),i=>{r.push(i),_r.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",wt(_r.postMessage)),Qv=typeof queueMicrotask<"u"?queueMicrotask.bind(_r):typeof process<"u"&&process.nextTick||em,Gv=e=>e!=null&&wt(e[aa]),K={isArray:ki,isArrayBuffer:Yp,isBuffer:xs,isFormData:bv,isArrayBufferView:mv,isString:gv,isNumber:Zp,isBoolean:yv,isObject:_s,isPlainObject:fo,isEmptyObject:vv,isReadableStream:Cv,isRequest:Nv,isResponse:Rv,isHeaders:Tv,isUndefined:yi,isDate:wv,isFile:xv,isBlob:_v,isRegExp:$v,isFunction:wt,isStream:Sv,isURLSearchParams:Ev,isTypedArray:Fv,isFileList:kv,forEach:ks,merge:Yl,extend:Iv,trim:Ov,stripBOM:Av,inherits:jv,toFlatObject:zv,kindOf:la,kindOfTest:Gt,endsWith:Lv,toArray:Pv,forEachEntry:Dv,matchAll:Mv,isHTMLForm:Bv,hasOwnProperty:Td,hasOwnProp:Td,reduceDescriptors:Jp,freezeMethods:Wv,toObjectSet:Hv,toCamelCase:Uv,noop:Vv,toFiniteNumber:qv,findKey:Qp,global:_r,isContextDefined:Gp,isSpecCompliantForm:Kv,toJSONObject:Xv,isAsyncFn:Yv,isThenable:Zv,setImmediate:em,asap:Qv,isIterable:Gv};function we(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}K.inherits(we,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:K.toJSONObject(this.config),code:this.code,status:this.status}}});const tm=we.prototype,nm={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{nm[e]={value:e}});Object.defineProperties(we,nm);Object.defineProperty(tm,"isAxiosError",{value:!0});we.from=(e,t,n,r,i,s)=>{const o=Object.create(tm);K.toFlatObject(e,o,function(p){return p!==Error.prototype},d=>d!=="isAxiosError");const a=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return we.call(o,a,l,n,r,i),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",s&&Object.assign(o,s),o};const Jv=null;function Zl(e){return K.isPlainObject(e)||K.isArray(e)}function rm(e){return K.endsWith(e,"[]")?e.slice(0,-2):e}function Od(e,t,n){return e?e.concat(t).map(function(i,s){return i=rm(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function e1(e){return K.isArray(e)&&!e.some(Zl)}const t1=K.toFlatObject(K,{},null,function(t){return/^is[A-Z]/.test(t)});function ca(e,t,n){if(!K.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=K.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(u,v){return!K.isUndefined(v[u])});const r=n.metaTokens,i=n.visitor||p,s=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&K.isSpecCompliantForm(t);if(!K.isFunction(i))throw new TypeError("visitor must be a function");function d(m){if(m===null)return"";if(K.isDate(m))return m.toISOString();if(K.isBoolean(m))return m.toString();if(!l&&K.isBlob(m))throw new we("Blob is not supported. Use a Buffer instead.");return K.isArrayBuffer(m)||K.isTypedArray(m)?l&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function p(m,u,v){let c=m;if(m&&!v&&typeof m=="object"){if(K.endsWith(u,"{}"))u=r?u:u.slice(0,-2),m=JSON.stringify(m);else if(K.isArray(m)&&e1(m)||(K.isFileList(m)||K.endsWith(u,"[]"))&&(c=K.toArray(m)))return u=rm(u),c.forEach(function(w,k){!(K.isUndefined(w)||w===null)&&t.append(o===!0?Od([u],k,s):o===null?u:u+"[]",d(w))}),!1}return Zl(m)?!0:(t.append(Od(v,u,s),d(m)),!1)}const y=[],x=Object.assign(t1,{defaultVisitor:p,convertValue:d,isVisitable:Zl});function g(m,u){if(!K.isUndefined(m)){if(y.indexOf(m)!==-1)throw Error("Circular reference detected in "+u.join("."));y.push(m),K.forEach(m,function(c,h){(!(K.isUndefined(c)||c===null)&&i.call(t,c,K.isString(h)?h.trim():h,u,x))===!0&&g(c,u?u.concat(h):[h])}),y.pop()}}if(!K.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Id(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function oc(e,t){this._pairs=[],e&&ca(e,this,t)}const im=oc.prototype;im.append=function(t,n){this._pairs.push([t,n])};im.toString=function(t){const n=t?function(r){return t.call(this,r,Id)}:Id;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function n1(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function sm(e,t,n){if(!t)return e;const r=n&&n.encode||n1;K.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let s;if(i?s=i(t,n):s=K.isURLSearchParams(t)?t.toString():new oc(t,n).toString(r),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Ad{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){K.forEach(this.handlers,function(r){r!==null&&t(r)})}}const om={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},r1=typeof URLSearchParams<"u"?URLSearchParams:oc,i1=typeof FormData<"u"?FormData:null,s1=typeof Blob<"u"?Blob:null,o1={isBrowser:!0,classes:{URLSearchParams:r1,FormData:i1,Blob:s1},protocols:["http","https","file","blob","url","data"]},ac=typeof window<"u"&&typeof document<"u",Ql=typeof navigator=="object"&&navigator||void 0,a1=ac&&(!Ql||["ReactNative","NativeScript","NS"].indexOf(Ql.product)<0),l1=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",u1=ac&&window.location.href||"http://localhost",c1=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ac,hasStandardBrowserEnv:a1,hasStandardBrowserWebWorkerEnv:l1,navigator:Ql,origin:u1},Symbol.toStringTag,{value:"Module"})),st={...c1,...o1};function d1(e,t){return ca(e,new st.classes.URLSearchParams,{visitor:function(n,r,i,s){return st.isNode&&K.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function f1(e){return K.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function h1(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r=n.length;return o=!o&&K.isArray(i)?i.length:o,l?(K.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!a):((!i[o]||!K.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],s)&&K.isArray(i[o])&&(i[o]=h1(i[o])),!a)}if(K.isFormData(e)&&K.isFunction(e.entries)){const n={};return K.forEachEntry(e,(r,i)=>{t(f1(r),i,n,0)}),n}return null}function p1(e,t,n){if(K.isString(e))try{return(t||JSON.parse)(e),K.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Ss={transitional:om,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=K.isObject(t);if(s&&K.isHTMLForm(t)&&(t=new FormData(t)),K.isFormData(t))return i?JSON.stringify(am(t)):t;if(K.isArrayBuffer(t)||K.isBuffer(t)||K.isStream(t)||K.isFile(t)||K.isBlob(t)||K.isReadableStream(t))return t;if(K.isArrayBufferView(t))return t.buffer;if(K.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return d1(t,this.formSerializer).toString();if((a=K.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ca(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),p1(t)):t}],transformResponse:[function(t){const n=this.transitional||Ss.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(K.isResponse(t)||K.isReadableStream(t))return t;if(t&&K.isString(t)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(a){if(o)throw a.name==="SyntaxError"?we.from(a,we.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:st.classes.FormData,Blob:st.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};K.forEach(["delete","get","head","post","put","patch"],e=>{Ss.headers[e]={}});const m1=K.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),g1=e=>{const t={};let n,r,i;return e&&e.split(` +`).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&m1[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},jd=Symbol("internals");function Li(e){return e&&String(e).trim().toLowerCase()}function ho(e){return e===!1||e==null?e:K.isArray(e)?e.map(ho):String(e)}function y1(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const v1=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Wa(e,t,n,r,i){if(K.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!K.isString(t)){if(K.isString(r))return t.indexOf(r)!==-1;if(K.isRegExp(r))return r.test(t)}}function w1(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function x1(e,t){const n=K.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,s,o){return this[r].call(this,t,i,s,o)},configurable:!0})})}let xt=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function s(a,l,d){const p=Li(l);if(!p)throw new Error("header name must be a non-empty string");const y=K.findKey(i,p);(!y||i[y]===void 0||d===!0||d===void 0&&i[y]!==!1)&&(i[y||l]=ho(a))}const o=(a,l)=>K.forEach(a,(d,p)=>s(d,p,l));if(K.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(K.isString(t)&&(t=t.trim())&&!v1(t))o(g1(t),n);else if(K.isObject(t)&&K.isIterable(t)){let a={},l,d;for(const p of t){if(!K.isArray(p))throw TypeError("Object iterator must return a key-value pair");a[d=p[0]]=(l=a[d])?K.isArray(l)?[...l,p[1]]:[l,p[1]]:p[1]}o(a,n)}else t!=null&&s(n,t,r);return this}get(t,n){if(t=Li(t),t){const r=K.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return y1(i);if(K.isFunction(n))return n.call(this,i,r);if(K.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Li(t),t){const r=K.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Wa(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function s(o){if(o=Li(o),o){const a=K.findKey(r,o);a&&(!n||Wa(r,r[a],a,n))&&(delete r[a],i=!0)}}return K.isArray(t)?t.forEach(s):s(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const s=n[r];(!t||Wa(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const n=this,r={};return K.forEach(this,(i,s)=>{const o=K.findKey(r,s);if(o){n[o]=ho(i),delete n[s];return}const a=t?w1(s):String(s).trim();a!==s&&delete n[s],n[a]=ho(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return K.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&K.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[jd]=this[jd]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=Li(o);r[a]||(x1(i,o),r[a]=!0)}return K.isArray(t)?t.forEach(s):s(t),this}};xt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);K.reduceDescriptors(xt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});K.freezeMethods(xt);function Ha(e,t){const n=this||Ss,r=t||n,i=xt.from(r.headers);let s=r.data;return K.forEach(e,function(a){s=a.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function lm(e){return!!(e&&e.__CANCEL__)}function Si(e,t,n){we.call(this,e??"canceled",we.ERR_CANCELED,t,n),this.name="CanceledError"}K.inherits(Si,we,{__CANCEL__:!0});function um(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new we("Request failed with status code "+n.status,[we.ERR_BAD_REQUEST,we.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function _1(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function k1(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,s=0,o;return t=t!==void 0?t:1e3,function(l){const d=Date.now(),p=r[s];o||(o=d),n[i]=l,r[i]=d;let y=s,x=0;for(;y!==i;)x+=n[y++],y=y%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),d-o{n=p,i=null,s&&(clearTimeout(s),s=null),e(...d)};return[(...d)=>{const p=Date.now(),y=p-n;y>=r?o(d,p):(i=d,s||(s=setTimeout(()=>{s=null,o(i)},r-y)))},()=>i&&o(i)]}const Mo=(e,t,n=3)=>{let r=0;const i=k1(50,250);return S1(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,l=o-r,d=i(l),p=o<=a;r=o;const y={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:d||void 0,estimated:d&&a&&p?(a-o)/d:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(y)},n)},zd=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ld=e=>(...t)=>K.asap(()=>e(...t)),b1=st.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,st.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(st.origin),st.navigator&&/(msie|trident)/i.test(st.navigator.userAgent)):()=>!0,E1=st.hasStandardBrowserEnv?{write(e,t,n,r,i,s,o){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];K.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),K.isString(r)&&a.push(`path=${r}`),K.isString(i)&&a.push(`domain=${i}`),s===!0&&a.push("secure"),K.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function C1(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function N1(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function cm(e,t,n){let r=!C1(t);return e&&(r||n==!1)?N1(e,t):t}const Pd=e=>e instanceof xt?{...e}:e;function Or(e,t){t=t||{};const n={};function r(d,p,y,x){return K.isPlainObject(d)&&K.isPlainObject(p)?K.merge.call({caseless:x},d,p):K.isPlainObject(p)?K.merge({},p):K.isArray(p)?p.slice():p}function i(d,p,y,x){if(K.isUndefined(p)){if(!K.isUndefined(d))return r(void 0,d,y,x)}else return r(d,p,y,x)}function s(d,p){if(!K.isUndefined(p))return r(void 0,p)}function o(d,p){if(K.isUndefined(p)){if(!K.isUndefined(d))return r(void 0,d)}else return r(void 0,p)}function a(d,p,y){if(y in t)return r(d,p);if(y in e)return r(void 0,d)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(d,p,y)=>i(Pd(d),Pd(p),y,!0)};return K.forEach(Object.keys({...e,...t}),function(p){const y=l[p]||i,x=y(e[p],t[p],p);K.isUndefined(x)&&y!==a||(n[p]=x)}),n}const dm=e=>{const t=Or({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=t;if(t.headers=o=xt.from(o),t.url=sm(cm(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),K.isFormData(n)){if(st.hasStandardBrowserEnv||st.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(K.isFunction(n.getHeaders)){const l=n.getHeaders(),d=["content-type","content-length"];Object.entries(l).forEach(([p,y])=>{d.includes(p.toLowerCase())&&o.set(p,y)})}}if(st.hasStandardBrowserEnv&&(r&&K.isFunction(r)&&(r=r(t)),r||r!==!1&&b1(t.url))){const l=i&&s&&E1.read(s);l&&o.set(i,l)}return t},R1=typeof XMLHttpRequest<"u",T1=R1&&function(e){return new Promise(function(n,r){const i=dm(e);let s=i.data;const o=xt.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:d}=i,p,y,x,g,m;function u(){g&&g(),m&&m(),i.cancelToken&&i.cancelToken.unsubscribe(p),i.signal&&i.signal.removeEventListener("abort",p)}let v=new XMLHttpRequest;v.open(i.method.toUpperCase(),i.url,!0),v.timeout=i.timeout;function c(){if(!v)return;const w=xt.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),b={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:w,config:e,request:v};um(function(T){n(T),u()},function(T){r(T),u()},b),v=null}"onloadend"in v?v.onloadend=c:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(c)},v.onabort=function(){v&&(r(new we("Request aborted",we.ECONNABORTED,e,v)),v=null)},v.onerror=function(k){const b=k&&k.message?k.message:"Network Error",N=new we(b,we.ERR_NETWORK,e,v);N.event=k||null,r(N),v=null},v.ontimeout=function(){let k=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const b=i.transitional||om;i.timeoutErrorMessage&&(k=i.timeoutErrorMessage),r(new we(k,b.clarifyTimeoutError?we.ETIMEDOUT:we.ECONNABORTED,e,v)),v=null},s===void 0&&o.setContentType(null),"setRequestHeader"in v&&K.forEach(o.toJSON(),function(k,b){v.setRequestHeader(b,k)}),K.isUndefined(i.withCredentials)||(v.withCredentials=!!i.withCredentials),a&&a!=="json"&&(v.responseType=i.responseType),d&&([x,m]=Mo(d,!0),v.addEventListener("progress",x)),l&&v.upload&&([y,g]=Mo(l),v.upload.addEventListener("progress",y),v.upload.addEventListener("loadend",g)),(i.cancelToken||i.signal)&&(p=w=>{v&&(r(!w||w.type?new Si(null,e,v):w),v.abort(),v=null)},i.cancelToken&&i.cancelToken.subscribe(p),i.signal&&(i.signal.aborted?p():i.signal.addEventListener("abort",p)));const h=_1(i.url);if(h&&st.protocols.indexOf(h)===-1){r(new we("Unsupported protocol "+h+":",we.ERR_BAD_REQUEST,e));return}v.send(s||null)})},O1=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const s=function(d){if(!i){i=!0,a();const p=d instanceof Error?d:this.reason;r.abort(p instanceof we?p:new Si(p instanceof Error?p.message:p))}};let o=t&&setTimeout(()=>{o=null,s(new we(`timeout ${t} of ms exceeded`,we.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(s):d.removeEventListener("abort",s)}),e=null)};e.forEach(d=>d.addEventListener("abort",s));const{signal:l}=r;return l.unsubscribe=()=>K.asap(a),l}},I1=function*(e,t){let n=e.byteLength;if(n{const i=A1(e,t);let s=0,o,a=l=>{o||(o=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:d,value:p}=await i.next();if(d){a(),l.close();return}let y=p.byteLength;if(n){let x=s+=y;n(x)}l.enqueue(new Uint8Array(p))}catch(d){throw a(d),d}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},Dd=64*1024,{isFunction:Vs}=K,z1=(({Request:e,Response:t})=>({Request:e,Response:t}))(K.global),{ReadableStream:Md,TextEncoder:Bd}=K.global,Ud=(e,...t)=>{try{return!!e(...t)}catch{return!1}},L1=e=>{e=K.merge.call({skipUndefined:!0},z1,e);const{fetch:t,Request:n,Response:r}=e,i=t?Vs(t):typeof fetch=="function",s=Vs(n),o=Vs(r);if(!i)return!1;const a=i&&Vs(Md),l=i&&(typeof Bd=="function"?(m=>u=>m.encode(u))(new Bd):async m=>new Uint8Array(await new n(m).arrayBuffer())),d=s&&a&&Ud(()=>{let m=!1;const u=new n(st.origin,{body:new Md,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!u}),p=o&&a&&Ud(()=>K.isReadableStream(new r("").body)),y={stream:p&&(m=>m.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!y[m]&&(y[m]=(u,v)=>{let c=u&&u[m];if(c)return c.call(u);throw new we(`Response type '${m}' is not supported`,we.ERR_NOT_SUPPORT,v)})});const x=async m=>{if(m==null)return 0;if(K.isBlob(m))return m.size;if(K.isSpecCompliantForm(m))return(await new n(st.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(K.isArrayBufferView(m)||K.isArrayBuffer(m))return m.byteLength;if(K.isURLSearchParams(m)&&(m=m+""),K.isString(m))return(await l(m)).byteLength},g=async(m,u)=>{const v=K.toFiniteNumber(m.getContentLength());return v??x(u)};return async m=>{let{url:u,method:v,data:c,signal:h,cancelToken:w,timeout:k,onDownloadProgress:b,onUploadProgress:N,responseType:T,headers:P,withCredentials:O="same-origin",fetchOptions:M}=dm(m),J=t||fetch;T=T?(T+"").toLowerCase():"text";let R=O1([h,w&&w.toAbortSignal()],k),W=null;const _=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let V;try{if(N&&d&&v!=="get"&&v!=="head"&&(V=await g(P,c))!==0){let z=new n(u,{method:"POST",body:c,duplex:"half"}),F;if(K.isFormData(c)&&(F=z.headers.get("content-type"))&&P.setContentType(F),z.body){const[A,B]=zd(V,Mo(Ld(N)));c=Fd(z.body,Dd,A,B)}}K.isString(O)||(O=O?"include":"omit");const ce=s&&"credentials"in n.prototype,Q={...M,signal:R,method:v.toUpperCase(),headers:P.normalize().toJSON(),body:c,duplex:"half",credentials:ce?O:void 0};W=s&&new n(u,Q);let H=await(s?J(W,M):J(u,Q));const U=p&&(T==="stream"||T==="response");if(p&&(b||U&&_)){const z={};["status","statusText","headers"].forEach(D=>{z[D]=H[D]});const F=K.toFiniteNumber(H.headers.get("content-length")),[A,B]=b&&zd(F,Mo(Ld(b),!0))||[];H=new r(Fd(H.body,Dd,A,()=>{B&&B(),_&&_()}),z)}T=T||"text";let ee=await y[K.findKey(y,T)||"text"](H,m);return!U&&_&&_(),await new Promise((z,F)=>{um(z,F,{data:ee,headers:xt.from(H.headers),status:H.status,statusText:H.statusText,config:m,request:W})})}catch(ce){throw _&&_(),ce&&ce.name==="TypeError"&&/Load failed|fetch/i.test(ce.message)?Object.assign(new we("Network Error",we.ERR_NETWORK,m,W),{cause:ce.cause||ce}):we.from(ce,ce&&ce.code,m,W)}}},P1=new Map,fm=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,s=[r,i,n];let o=s.length,a=o,l,d,p=P1;for(;a--;)l=s[a],d=p.get(l),d===void 0&&p.set(l,d=a?new Map:L1(t)),p=d;return d};fm();const lc={http:Jv,xhr:T1,fetch:{get:fm}};K.forEach(lc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const $d=e=>`- ${e}`,F1=e=>K.isFunction(e)||e===null||e===!1;function D1(e,t){e=K.isArray(e)?e:[e];const{length:n}=e;let r,i;const s={};for(let o=0;o`adapter ${l} `+(d===!1?"is not supported by the environment":"is not available in the build"));let a=n?o.length>1?`since : +`+o.map($d).join(` +`):" "+$d(o[0]):"as no adapter specified";throw new we("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return i}const hm={getAdapter:D1,adapters:lc};function Va(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Si(null,e)}function Wd(e){return Va(e),e.headers=xt.from(e.headers),e.data=Ha.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),hm.getAdapter(e.adapter||Ss.adapter,e)(e).then(function(r){return Va(e),r.data=Ha.call(e,e.transformResponse,r),r.headers=xt.from(r.headers),r},function(r){return lm(r)||(Va(e),r&&r.response&&(r.response.data=Ha.call(e,e.transformResponse,r.response),r.response.headers=xt.from(r.response.headers))),Promise.reject(r)})}const pm="1.13.2",da={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{da[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Hd={};da.transitional=function(t,n,r){function i(s,o){return"[Axios v"+pm+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(t===!1)throw new we(i(o," has been removed"+(n?" in "+n:"")),we.ERR_DEPRECATED);return n&&!Hd[o]&&(Hd[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,o,a):!0}};da.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function M1(e,t,n){if(typeof e!="object")throw new we("options must be an object",we.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],o=t[s];if(o){const a=e[s],l=a===void 0||o(a,s,e);if(l!==!0)throw new we("option "+s+" must be "+l,we.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new we("Unknown option "+s,we.ERR_BAD_OPTION)}}const po={assertOptions:M1,validators:da},an=po.validators;let br=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ad,response:new Ad}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=` +`+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Or(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&po.assertOptions(r,{silentJSONParsing:an.transitional(an.boolean),forcedJSONParsing:an.transitional(an.boolean),clarifyTimeoutError:an.transitional(an.boolean)},!1),i!=null&&(K.isFunction(i)?n.paramsSerializer={serialize:i}:po.assertOptions(i,{encode:an.function,serialize:an.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),po.assertOptions(n,{baseUrl:an.spelling("baseURL"),withXsrfToken:an.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&K.merge(s.common,s[n.method]);s&&K.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),n.headers=xt.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(u){typeof u.runWhen=="function"&&u.runWhen(n)===!1||(l=l&&u.synchronous,a.unshift(u.fulfilled,u.rejected))});const d=[];this.interceptors.response.forEach(function(u){d.push(u.fulfilled,u.rejected)});let p,y=0,x;if(!l){const m=[Wd.bind(this),void 0];for(m.unshift(...a),m.push(...d),x=m.length,p=Promise.resolve(n);y{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},t(function(s,o,a){r.reason||(r.reason=new Si(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new mm(function(i){t=i}),cancel:t}}};function U1(e){return function(n){return e.apply(null,n)}}function $1(e){return K.isObject(e)&&e.isAxiosError===!0}const Gl={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(Gl).forEach(([e,t])=>{Gl[t]=e});function gm(e){const t=new br(e),n=Kp(br.prototype.request,t);return K.extend(n,br.prototype,t,{allOwnKeys:!0}),K.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return gm(Or(e,i))},n}const xe=gm(Ss);xe.Axios=br;xe.CanceledError=Si;xe.CancelToken=B1;xe.isCancel=lm;xe.VERSION=pm;xe.toFormData=ca;xe.AxiosError=we;xe.Cancel=xe.CanceledError;xe.all=function(t){return Promise.all(t)};xe.spread=U1;xe.isAxiosError=$1;xe.mergeConfig=Or;xe.AxiosHeaders=xt;xe.formToJSON=e=>am(K.isHTMLForm(e)?new FormData(e):e);xe.getAdapter=hm.getAdapter;xe.HttpStatusCode=Gl;xe.default=xe;const{Axios:Jw,AxiosError:ex,CanceledError:tx,isCancel:nx,CancelToken:rx,VERSION:ix,all:sx,Cancel:ox,isAxiosError:ax,spread:lx,toFormData:ux,AxiosHeaders:cx,HttpStatusCode:dx,formToJSON:fx,getAdapter:hx,mergeConfig:px}=xe,Pe="/api",Nn={getAll:()=>xe.get(`${Pe}/library`),add:(e,t)=>xe.post(`${Pe}/library`,{name:e,path:t}),update:(e,t)=>xe.put(`${Pe}/library/${e}`,t),delete:e=>xe.delete(`${Pe}/library/${e}`),setCurrent:e=>xe.post(`${Pe}/library/${e}/set-current`),updatePreferences:e=>xe.put(`${Pe}/library/preferences`,e),updateTheme:e=>xe.put(`${Pe}/library/theme`,{theme:e})},Me={search:(e,t={},n={})=>{const r=new URLSearchParams({libraryId:e,...t});return xe.get(`${Pe}/image?${r}`,n)},getCount:e=>xe.get(`${Pe}/image/count?libraryId=${e}`),getFolders:e=>xe.get(`${Pe}/image/folders?libraryId=${e}`),getCacheMeta:e=>xe.get(`${Pe}/image/cache-meta?libraryId=${e}`),getThumbnailUrl:(e,t,n)=>`${Pe}/image/thumbnail/${e}/${t}/${n}`,getOriginalUrl:(e,t)=>`${Pe}/image/original/${e}/${t}`,openInExplorer:(e,t)=>xe.post(`${Pe}/image/${e}/open-file`,{path:t})},sr={fullScan:(e,t=!1)=>xe.post(`${Pe}/scan/full`,{libraryId:e,wait:t}),sync:(e,t=!1)=>xe.post(`${Pe}/scan/sync`,{libraryId:e,wait:t}),stop:e=>xe.post(`${Pe}/scan/stop`,{libraryId:e}),resume:e=>xe.post(`${Pe}/scan/resume`,{libraryId:e}),getStatus:e=>xe.get(`${Pe}/scan/status/${e}`),fixFolders:e=>xe.post(`${Pe}/scan/fix-folders`,{libraryId:e})},Vd={start:e=>xe.post(`${Pe}/watch/start/${e}`),stop:e=>xe.post(`${Pe}/watch/stop/${e}`),status:e=>xe.get(`${Pe}/watch/status/${e}`),list:()=>xe.get(`${Pe}/watch/list`)};/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var W1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const H1=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Ie=(e,t)=>{const n=Z.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:a="",children:l,...d},p)=>Z.createElement("svg",{ref:p,...W1,width:i,height:i,stroke:r,strokeWidth:o?Number(s)*24/Number(i):s,className:["lucide",`lucide-${H1(e)}`,a].join(" "),...d},[...t.map(([y,x])=>Z.createElement(y,x)),...Array.isArray(l)?l:[l]]));return n.displayName=`${e}`,n};/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const V1=Ie("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const q1=Ie("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qd=Ie("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const K1=Ie("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const X1=Ie("ChevronsDown",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Y1=Ie("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Z1=Ie("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Q1=Ie("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const G1=Ie("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const J1=Ie("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ew=Ie("File",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Kd=Ie("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tw=Ie("FolderDown",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m15 13-3 3-3-3",key:"6j2sf0"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zi=Ie("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nw=Ie("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xd=Ie("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rw=Ie("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const iw=Ie("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",key:"1xcu5"}],["circle",{cx:"17.5",cy:"10.5",r:".5",key:"736e4u"}],["circle",{cx:"8.5",cy:"7.5",r:".5",key:"clrty"}],["circle",{cx:"6.5",cy:"12.5",r:".5",key:"1s4xz9"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sw=Ie("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ym=Ie("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Yd=Ie("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bo=Ie("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zd=Ie("Sliders",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qd=Ie("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ow=Ie("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vm=Ie("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ps={LIBRARY:"library",FOLDER:"folder",IMAGES:"images"};let Gd=0;const aw=()=>(Gd+=1,`req_${Date.now()}_${Gd}`);class lw{constructor(){this.activeRequests=new Map,this.requestContexts=new Map}createRequest(t){const n=aw(),r=new AbortController,i={id:n,type:t,createdAt:Date.now(),abortController:r,signal:r.signal,status:"pending",isActive:!0,cancel:()=>{if(i.isActive){i.isActive=!1,i.status="cancelled",r.abort(),this.requestContexts.delete(n);const s=this.activeRequests.get(t);s&&s.delete(n)}}};return this.requestContexts.set(n,i),this.activeRequests.has(t)||this.activeRequests.set(t,new Map),this.activeRequests.get(t).set(n,i),i}cancelAll(t){const n=this.activeRequests.get(t);if(n){for(const r of n.values())r.cancel();n.clear()}}cancelAllRequests(){for(const t of Object.values(ps))this.cancelAll(t)}isValid(t){const n=this.requestContexts.get(t);return n?n.isActive:!1}complete(t){const n=this.requestContexts.get(t);if(n&&n.isActive){n.status="completed",n.isActive=!1,this.requestContexts.delete(t);const r=this.activeRequests.get(n.type);r&&r.delete(t)}}error(t){const n=this.requestContexts.get(t);if(n&&n.isActive){n.status="error",n.isActive=!1,this.requestContexts.delete(t);const r=this.activeRequests.get(n.type);r&&r.delete(t)}}getActiveCount(t){const n=this.activeRequests.get(t);return n?n.size:0}hasActiveRequests(t){return this.getActiveCount(t)>0}}const Ft=new lw;function Jl(){Ft.cancelAll(ps.IMAGES)}function uw(e){e&&setTimeout(()=>{},300)}const cw=async e=>{try{return(await sr.getStatus(e)).data}catch{return null}};function Jd(){const{libraries:e,currentLibraryId:t,folders:n,selectedFolder:r,totalImageCount:i,setCurrentLibrary:s,setSelectedFolder:o,addLibrary:a,removeLibrary:l}=me(),[d,p]=Z.useState(!1),[y,x]=Z.useState(""),[g,m]=Z.useState(""),[u,v]=Z.useState(""),[c,h]=Z.useState(""),[w,k]=Z.useState(new Set),[b,N]=Z.useState(!1),[T,P]=Z.useState(!1),O=Z.useRef(null),M=A=>{h(A),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{v(A)},300)};Z.useEffect(()=>()=>{O.current&&clearTimeout(O.current)},[]);const J=async()=>{if(!y.trim()){alert("请输入素材库名称");return}if(!g.trim()){alert("请输入文件夹路径");return}N(!0);try{console.log("📝 添加素材库...");const A=await Nn.add(y.trim(),g.trim()),B=A.data.id,D=A.data.hasExistingIndex;if(a({id:B,name:y.trim(),path:g.trim()}),x(""),m(""),p(!1),N(!1),console.log("🔄 切换到新素材库..."),await Nn.setCurrent(B),s(B),o(null),me.getState().setImages([]),me.getState().setFolders([]),me.getState().setSelectedImage(null),me.getState().setTotalImageCount(0),me.getState().setScanProgress({libraryId:B,current:0,total:0,percent:0,status:"preparing"}),D){console.log("检测到已有索引,先加载现有数据...");try{const[le,de]=await Promise.all([Me.getFolders(B),Me.getCount(B)]);me.getState().setFolders(le.data.folders),me.getState().setTotalImageCount(de.data.count),console.log("✅ 已加载现有数据")}catch(le){console.warn("⚠️ 加载现有数据失败:",le)}}console.log("🔍 开始异步扫描..."),D?(console.log("执行增量同步,检测变化..."),sr.sync(B,!1)):(console.log("首次添加,执行全量扫描..."),sr.fullScan(B,!1)),console.log("✅ 扫描已启动,请等待进度显示...")}catch(A){console.error("❌ Error adding library:",A),alert("添加素材库失败: "+A.message),me.getState().setScanProgress(null),N(!1)}},R=async A=>{if(A!==t){P(!0);try{Jl(),Ft.cancelAllRequests(),me.getState().setScanProgress(null),me.getState().setSelectedImage(null),me.getState().setImages([]),me.getState().setFolders([]),me.getState().setImageLoadingState({isLoading:!1,loadedCount:0,totalCount:0,hasMore:!1}),o(null),await Nn.setCurrent(A);const[B,D]=await Promise.all([Me.getFolders(A),Me.getCount(A)]);me.getState().setFolders(B.data.folders),me.getState().setTotalImageCount(D.data.count),s(A),cw(A).then(le=>{var de,ue;le&&le.status==="paused"&&(le.needsRescan?(me.getState().setScanProgress({...le.progress,libraryId:A,canStop:!0,isPaused:!0,pendingCount:((de=le.progress)==null?void 0:de.total)-((ue=le.progress)==null?void 0:ue.current)||0,needsRescan:!0}),console.log("⏸️ 发现中断的扫描,需要继续完成")):le.pendingCount>0&&(me.getState().setScanProgress({...le.progress,libraryId:A,canStop:!0,isPaused:!0,pendingCount:le.pendingCount}),console.log(`⏸️ 发现暂停的扫描,待处理: ${le.pendingCount} 张`)))}).catch(()=>{})}catch(B){console.error("Error setting current library:",B),alert("切换素材库失败: "+B.message),me.getState().setImageLoadingState({isLoading:!1})}finally{P(!1)}}},W=async()=>{if(!t)return;const A=e.find(D=>D.id===t);if(!(!A||!confirm(`确定要删除素材库"${A.name}"吗? + +路径: ${A.path} + +⚠️ 注意: +• 将删除索引数据并释放数据库连接 +• 不会删除原始图片文件 +• .flypic 文件夹将保留,您可以手动删除`)))try{await Nn.delete(t),l(t),me.getState().setImages([]),me.getState().setFolders([]),me.getState().setSelectedImage(null),me.getState().setSelectedFolder(null);const D=e.filter(le=>le.id!==t);if(D.length>0){const le=D[0];await Nn.setCurrent(le.id),s(le.id)}console.log(`✅ 素材库已删除: ${A.name}`),console.log(`数据库连接已释放,可手动删除: ${A.path}\\.flypic`)}catch(D){console.error("Error deleting library:",D),alert("删除素材库失败: "+D.message)}},_=A=>{const B=new Set(w);B.has(A)?B.delete(A):B.add(A),k(B)},V=A=>{const B=[],D=le=>{le.forEach(de=>{de.children&&de.children.length>0&&(B.push(de.path),D(de.children))})};return D(A),B},ce=()=>{const A=V(U.length>0?U:n);k(new Set(A))},Q=()=>{k(new Set)},H=()=>{const A=V(U.length>0?U:n);return A.length>0&&A.every(B=>w.has(B))},U=Z.useMemo(()=>{if(!u)return n;const A=u.trim().toLowerCase().split(/\s+/).filter(de=>de.length>0);if(A.length===0)return n;const B=[],D=de=>de.reduce((ue,se)=>{const X=se.name.toLowerCase(),re=se.path.toLowerCase(),q=A.every(I=>X.includes(I)),ne=A.every(I=>re.includes(I));let f=[];return se.children&&se.children.length>0&&(f=D(se.children)),(q||ne||f.length>0)&&(ue.push({...se,children:f}),f.length>0&&B.push(se.path)),ue},[]),le=D(n);return B.length>0&&setTimeout(()=>{k(de=>{const ue=new Set(de);return B.forEach(se=>ue.add(se)),ue})},0),le},[n,u]),ee=(A,B)=>{A.stopPropagation(),_(B)},z=A=>{const B=A.children&&A.children.length>0;r!==A.path?(Jl(),o(A.path)):B&&_(A.path)},F=(A,B=0)=>A.map(D=>{const le=w.has(D.path),de=D.children&&D.children.length>0,ue=r===D.path;return S.jsxs("div",{children:[S.jsxs("div",{className:`flex items-center px-3 py-2 cursor-pointer rounded-md transition-colors ${ue?"bg-blue-50 dark:bg-blue-900":"hover:bg-gray-100 dark:hover:bg-gray-700"}`,style:{paddingLeft:`${B*16+12}px`},onClick:()=>z(D),children:[de?S.jsx("div",{className:"flex items-center justify-center w-5 h-5 mr-1 cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-600 rounded",onClick:se=>ee(se,D.path),children:le?S.jsx(qd,{className:"w-4 h-4 text-gray-500"}):S.jsx(K1,{className:"w-4 h-4 text-gray-500"})}):S.jsx("div",{className:"w-5 mr-1"}),S.jsx(Zi,{className:"w-4 h-4 mr-2 text-gray-500 flex-shrink-0"}),S.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 truncate flex-1",children:D.name}),S.jsx("span",{className:"text-xs text-gray-400 ml-2 flex-shrink-0",children:D.image_count})]}),de&&le&&F(D.children,B+1)]},D.path)});return S.jsxs("div",{className:"w-full h-full border-r border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 flex flex-col",children:[S.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:[S.jsx("div",{className:"flex items-center justify-between mb-3",children:S.jsx("h2",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300",children:"素材库"})}),S.jsxs("div",{className:"flex gap-2",children:[S.jsxs("div",{className:"relative flex-1",children:[S.jsxs("select",{value:t||"",onChange:A=>{const B=A.target.value;B==="__add__"?p(!0):B&&R(B)},disabled:T,className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 appearance-none cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",style:{paddingRight:"2rem"},children:[e.length===0&&S.jsx("option",{value:"",children:"暂无素材库"}),e.map(A=>S.jsx("option",{value:A.id,children:A.name},A.id)),S.jsx("option",{value:"__add__",style:{borderTop:"1px solid #ccc"},children:"+ 添加新素材库"})]}),S.jsx(qd,{className:"absolute right-2 top-2.5 w-4 h-4 text-gray-400 pointer-events-none"})]}),t&&e.length>0&&S.jsx("button",{onClick:W,className:"px-3 py-2 border border-red-300 dark:border-red-600 rounded-lg hover:bg-red-50 dark:hover:bg-red-900 text-red-600 dark:text-red-400 transition-colors",title:"删除当前素材库",children:S.jsx(ow,{className:"w-4 h-4"})})]}),d&&S.jsxs("div",{className:"mt-3 p-3 border border-gray-300 dark:border-gray-600 rounded-lg bg-gray-50 dark:bg-gray-700",children:[S.jsxs("div",{className:"flex items-center justify-between mb-2",children:[S.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"添加素材库"}),S.jsx("button",{onClick:()=>p(!1),className:"p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-600",children:S.jsx(vm,{className:"w-4 h-4 text-gray-500"})})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsx("input",{type:"text",placeholder:"素材库名称",value:y,onChange:A=>x(A.target.value),onKeyDown:A=>A.key==="Enter"&&J(),autoFocus:!0,className:"w-full px-2 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100"}),S.jsx("input",{type:"text",placeholder:"文件夹路径(例如:C:\\Users\\Pictures)",value:g,onChange:A=>m(A.target.value),onKeyDown:A=>A.key==="Enter"&&J(),className:"w-full px-2 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100"}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx("button",{onClick:()=>p(!1),className:"flex-1 px-3 py-1.5 border border-gray-300 dark:border-gray-600 rounded text-sm hover:bg-gray-100 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-300",children:"取消"}),S.jsx("button",{onClick:J,disabled:b,className:"flex-1 px-3 py-1.5 bg-blue-500 text-white rounded text-sm hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed",children:b?"添加中...":"添加"})]})]})]})]}),S.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[S.jsx("div",{className:"mb-3 space-y-2",children:S.jsxs("div",{className:"flex gap-2",children:[S.jsxs("div",{className:"relative flex-1",children:[S.jsx(Bo,{className:"absolute left-2 top-2 w-4 h-4 text-gray-400"}),S.jsx("input",{type:"text",placeholder:"搜索文件夹(支持多关键词)...",value:c,onChange:A=>M(A.target.value),className:"w-full pl-8 pr-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100"})]}),S.jsx("button",{onClick:H()?Q:ce,className:"px-2 py-1.5 border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-100 dark:hover:bg-gray-600 text-gray-600 dark:text-gray-400 transition-colors",title:H()?"折叠全部":"展开全部",children:H()?S.jsx(Y1,{className:"w-4 h-4"}):S.jsx(X1,{className:"w-4 h-4"})})]})}),S.jsxs("div",{className:"space-y-1",children:[S.jsxs("div",{className:`flex items-center px-3 py-2 cursor-pointer rounded-md transition-colors ${r===null?"bg-blue-50 dark:bg-blue-900":"hover:bg-gray-100 dark:hover:bg-gray-700"}`,onClick:()=>o(null),children:[S.jsx("div",{className:"w-5 mr-1"}),S.jsx(Zi,{className:"w-4 h-4 mr-2 text-blue-500 flex-shrink-0"}),S.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 font-medium flex-1",children:"全部图片"}),S.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 ml-2",children:i})]}),(U.length>0||n.length>0)&&S.jsx("div",{className:"h-px bg-gray-200 dark:bg-gray-700 my-2"}),U.length>0?F(U):u?S.jsx("div",{className:"text-center py-8 text-gray-400 dark:text-gray-500 text-sm",children:"未找到匹配的文件夹"}):n.length===0?S.jsx("div",{className:"text-center py-8 text-gray-400 dark:text-gray-500 text-sm",children:"暂无文件夹"}):null]})]})]})}function Ze(){return Ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?Z.useEffect:Z.useLayoutEffect;function $r(e,t,n){var r=Z.useRef(t);r.current=t,Z.useEffect(function(){function i(s){r.current(s)}return e&&window.addEventListener(e,i,n),function(){e&&window.removeEventListener(e,i)}},[e])}var fw=["container"];function hw(e){var t=e.container,n=t===void 0?document.body:t,r=fa(e,fw);return Rp.createPortal(ke.createElement("div",Ze({},r)),n)}function pw(e){return ke.createElement("svg",Ze({width:"44",height:"44",viewBox:"0 0 768 768"},e),ke.createElement("path",{d:"M607.5 205.5l-178.5 178.5 178.5 178.5-45 45-178.5-178.5-178.5 178.5-45-45 178.5-178.5-178.5-178.5 45-45 178.5 178.5 178.5-178.5z"}))}function mw(e){return ke.createElement("svg",Ze({width:"44",height:"44",viewBox:"0 0 768 768"},e),ke.createElement("path",{d:"M640.5 352.5v63h-390l178.5 180-45 45-256.5-256.5 256.5-256.5 45 45-178.5 180h390z"}))}function gw(e){return ke.createElement("svg",Ze({width:"44",height:"44",viewBox:"0 0 768 768"},e),ke.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function yw(){return Z.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function tf(e){var t=e.touches[0],n=t.clientX,r=t.clientY;if(e.touches.length>=2){var i=e.touches[1],s=i.clientX,o=i.clientY;return[(n+s)/2,(r+o)/2,Math.sqrt(Math.pow(s-n,2)+Math.pow(o-r,2))]}return[n,r,0]}var Vn=function(e,t,n,r){var i,s=n*t,o=(s-r)/2,a=e;return s<=r?(i=1,a=0):e>0&&o-e<=0?(i=2,a=o):e<0&&o+e<=0&&(i=3,a=-o),[i,a]};function qa(e,t,n,r,i,s,o,a,l,d){o===void 0&&(o=innerWidth/2),a===void 0&&(a=innerHeight/2),l===void 0&&(l=0),d===void 0&&(d=0);var p=Vn(e,s,n,innerWidth)[0],y=Vn(t,s,r,innerHeight),x=innerWidth/2,g=innerHeight/2;return{x:o-s/i*(o-(x+e))-x+(r/n>=3&&n*s===innerWidth?0:p?l/2:l),y:a-s/i*(a-(g+t))-g+(y[0]?d/2:d),lastCX:o,lastCY:a}}function nu(e,t,n){var r=e%180!=0;return r?[n,t,r]:[t,n,r]}function Ka(e,t,n){var r=nu(n,innerWidth,innerHeight),i=r[0],s=r[1],o=0,a=i,l=s,d=e/t*s,p=t/e*i;return e=s?a=d:e>=i&&ti/s?l=p:t/e>=3&&!r[2]?o=((l=p)-s)/2:a=d,{width:a,height:l,x:0,y:o,pause:!0}}function Ks(e,t){var n=t.leading,r=n!==void 0&&n,i=t.maxWait,s=t.wait,o=s===void 0?i||0:s,a=Z.useRef(e);a.current=e;var l=Z.useRef(0),d=Z.useRef(),p=function(){return d.current&&clearTimeout(d.current)},y=Z.useCallback(function(){var x=[].slice.call(arguments),g=Date.now();function m(){l.current=g,p(),a.current.apply(null,x)}var u=l.current,v=g-u;if(u===0&&(r&&m(),l.current=g),i!==void 0){if(v>i)return void m()}else v=1&&s&&s())};p()}function p(){l=requestAnimationFrame(d)}}var ww={T:0,L:0,W:0,H:0,FIT:void 0},wm=function(){var e=Z.useRef(!1);return Z.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},xw=["className"];function _w(e){var t=e.className,n=t===void 0?"":t,r=fa(e,xw);return ke.createElement("div",Ze({className:"PhotoView__Spinner "+n},r),ke.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},ke.createElement("path",{opacity:".25",d:"M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"}),ke.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var kw=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function Sw(e){var t=e.src,n=e.loaded,r=e.broken,i=e.className,s=e.onPhotoLoad,o=e.loadingElement,a=e.brokenElement,l=fa(e,kw),d=wm();return t&&!r?ke.createElement(ke.Fragment,null,ke.createElement("img",Ze({className:"PhotoView__Photo"+(i?" "+i:""),src:t,onLoad:function(p){var y=p.target;d.current&&s({loaded:!0,naturalWidth:y.naturalWidth,naturalHeight:y.naturalHeight})},onError:function(){d.current&&s({broken:!0})},draggable:!1,alt:""},l)),!n&&(o?ke.createElement("span",{className:"PhotoView__icon"},o):ke.createElement(_w,{className:"PhotoView__icon"}))):a?ke.createElement("span",{className:"PhotoView__icon"},typeof a=="function"?a({src:t}):a):null}var bw={naturalWidth:void 0,naturalHeight:void 0,width:void 0,height:void 0,loaded:void 0,broken:!1,x:0,y:0,touched:!1,maskTouched:!1,rotate:0,scale:1,CX:0,CY:0,lastX:0,lastY:0,lastCX:0,lastCY:0,lastScale:1,touchTime:0,touchLength:0,pause:!0,stopRaf:!0,reach:void 0};function Ew(e){var t=e.item,n=t.src,r=t.render,i=t.width,s=i===void 0?0:i,o=t.height,a=o===void 0?0:o,l=t.originRef,d=e.visible,p=e.speed,y=e.easing,x=e.wrapClassName,g=e.className,m=e.style,u=e.loadingElement,v=e.brokenElement,c=e.onPhotoTap,h=e.onMaskTap,w=e.onReachMove,k=e.onReachUp,b=e.onPhotoResize,N=e.isActive,T=e.expose,P=Uo(bw),O=P[0],M=P[1],J=Z.useRef(0),R=wm(),W=O.naturalWidth,_=W===void 0?s:W,V=O.naturalHeight,ce=V===void 0?a:V,Q=O.width,H=Q===void 0?s:Q,U=O.height,ee=U===void 0?a:U,z=O.loaded,F=z===void 0?!n:z,A=O.broken,B=O.x,D=O.y,le=O.touched,de=O.stopRaf,ue=O.maskTouched,se=O.rotate,X=O.scale,re=O.CX,q=O.CY,ne=O.lastX,f=O.lastY,I=O.lastCX,L=O.lastCY,C=O.lastScale,E=O.touchTime,j=O.touchLength,Y=O.pause,G=O.reach,$=li({onScale:function(te){return ie(qs(te))},onRotate:function(te){se!==te&&(T({rotate:te}),M(Ze({rotate:te},Ka(_,ce,te))))}});function ie(te,ge,Ne){X!==te&&(T({scale:te}),M(Ze({scale:te},qa(B,D,H,ee,X,te,ge,Ne),te<=1&&{x:0,y:0})))}var fe=Ks(function(te,ge,Ne){if(Ne===void 0&&(Ne=0),(le||ue)&&N){var mn=nu(se,H,ee),gn=mn[0],Ot=mn[1];if(Ne===0&&J.current===0){var _t=Math.abs(te-re)<=20,kt=Math.abs(ge-q)<=20;if(_t&&kt)return void M({lastCX:te,lastCY:ge});J.current=_t?ge>q?3:2:1}var nn,dr=te-I,Fn=ge-L;if(Ne===0){var fr=Vn(dr+ne,X,gn,innerWidth)[0],zr=Vn(Fn+f,X,Ot,innerHeight);nn=function(Dn,vn,wn,rn){return vn&&Dn===1||rn==="x"?"x":wn&&Dn>1||rn==="y"?"y":void 0}(J.current,fr,zr[0],G),nn!==void 0&&w(nn,te,ge,X)}if(nn==="x"||ue)return void M({reach:"x"});var yn=qs(X+(Ne-j)/100/2*X,_/H,.2);T({scale:yn}),M(Ze({touchLength:Ne,reach:nn,scale:yn},qa(B,D,H,ee,X,yn,te,ge,dr,Fn)))}},{maxWait:8});function oe(te){return!de&&!le&&(R.current&&M(Ze({},te,{pause:d})),R.current)}var pe,ve,ye,We,Jt,at,en,be,pn=(Jt=function(te){return oe({x:te})},at=function(te){return oe({y:te})},en=function(te){return R.current&&(T({scale:te}),M({scale:te})),!le&&R.current},be=li({X:function(te){return Jt(te)},Y:function(te){return at(te)},S:function(te){return en(te)}}),function(te,ge,Ne,mn,gn,Ot,_t,kt,nn,dr,Fn){var fr=nu(dr,gn,Ot),zr=fr[0],yn=fr[1],Dn=Vn(te,kt,zr,innerWidth),vn=Dn[0],wn=Dn[1],rn=Vn(ge,kt,yn,innerHeight),Lr=rn[0],bs=rn[1],Pr=Date.now()-Fn;if(Pr>=200||kt!==_t||Math.abs(nn-_t)>1){var Mn=qa(te,ge,gn,Ot,_t,kt),xn=Mn.x,hr=Mn.y,It=vn?wn:xn!==te?xn:null,Fr=Lr?bs:hr!==ge?hr:null;return It!==null&&yr(te,It,be.X),Fr!==null&&yr(ge,Fr,be.Y),void(kt!==_t&&yr(_t,kt,be.S))}var pr=(te-Ne)/Pr,Bn=(ge-mn)/Pr,Un=Math.sqrt(Math.pow(pr,2)+Math.pow(Bn,2)),_n=!1,kn=!1;(function($t,lt){var ut,Wt=$t,Sn=0,At=0,Dr=function(bi){ut||(ut=bi);var Ei=bi-ut,uc=Math.sign($t),cc=-.001*uc,dc=Math.sign(-Wt)*Math.pow(Wt,2)*2e-4,km=Wt*Ei+(cc+dc)*Math.pow(Ei,2)/2;Sn+=km,ut=bi,uc*(Wt+=(cc+dc)*Ei)<=0?jt():lt(Sn)?sn():jt()};function sn(){At=requestAnimationFrame(Dr)}function jt(){cancelAnimationFrame(At)}sn()})(Un,function($t){var lt=te+$t*(pr/Un),ut=ge+$t*(Bn/Un),Wt=Vn(lt,_t,zr,innerWidth),Sn=Wt[0],At=Wt[1],Dr=Vn(ut,_t,yn,innerHeight),sn=Dr[0],jt=Dr[1];if(Sn&&!_n&&(_n=!0,vn?yr(lt,At,be.X):nf(At,lt+(lt-At),be.X)),sn&&!kn&&(kn=!0,Lr?yr(ut,jt,be.Y):nf(jt,ut+(ut-jt),be.Y)),_n&&kn)return!1;var bi=_n||be.X(At),Ei=kn||be.Y(jt);return bi&&Ei})}),tn=(pe=c,ve=function(te,ge){G||ie(X!==1?1:Math.max(2,_/H),te,ge)},ye=Z.useRef(0),We=Ks(function(){ye.current=0,pe.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var te=[].slice.call(arguments);ye.current+=1,We.apply(void 0,te),ye.current>=2&&(We.cancel(),ye.current=0,ve.apply(void 0,te))});function tt(te,ge){if(J.current=0,(le||ue)&&N){M({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var Ne=qs(X,_/H);if(pn(B,D,ne,f,H,ee,X,Ne,C,se,E),k(te,ge),re===te&&q===ge){if(le)return void tn(te,ge);ue&&h(te,ge)}}}function Pn(te,ge,Ne){Ne===void 0&&(Ne=0),M({touched:!0,CX:te,CY:ge,lastCX:te,lastCY:ge,lastX:B,lastY:D,lastScale:X,touchLength:Ne,touchTime:Date.now()})}function jr(te){M({maskTouched:!0,CX:te.clientX,CY:te.clientY,lastX:B,lastY:D})}$r(bn?void 0:"mousemove",function(te){te.preventDefault(),fe(te.clientX,te.clientY)}),$r(bn?void 0:"mouseup",function(te){tt(te.clientX,te.clientY)}),$r(bn?"touchmove":void 0,function(te){te.preventDefault();var ge=tf(te);fe.apply(void 0,ge)},{passive:!1}),$r(bn?"touchend":void 0,function(te){var ge=te.changedTouches[0];tt(ge.clientX,ge.clientY)},{passive:!1}),$r("resize",Ks(function(){F&&!le&&(M(Ka(_,ce,se)),b())},{maxWait:8})),tu(function(){N&&T(Ze({scale:X,rotate:se},$))},[N]);var Tt=function(te,ge,Ne,mn,gn,Ot,_t,kt,nn,dr){var Fn=function(xn,hr,It,Fr,pr){var Bn=Z.useRef(!1),Un=Uo({lead:!0,scale:It}),_n=Un[0],kn=_n.lead,$t=_n.scale,lt=Un[1],ut=Ks(function(Wt){try{return pr(!0),lt({lead:!1,scale:Wt}),Promise.resolve()}catch(Sn){return Promise.reject(Sn)}},{wait:Fr});return tu(function(){Bn.current?(pr(!1),lt({lead:!0}),ut(It)):Bn.current=!0},[It]),kn?[xn*$t,hr*$t,It/$t]:[xn*It,hr*It,1]}(Ot,_t,kt,nn,dr),fr=Fn[0],zr=Fn[1],yn=Fn[2],Dn=function(xn,hr,It,Fr,pr){var Bn=Z.useState(ww),Un=Bn[0],_n=Bn[1],kn=Z.useState(0),$t=kn[0],lt=kn[1],ut=Z.useRef(),Wt=li({OK:function(){return xn&<(4)}});function Sn(At){pr(!1),lt(At)}return Z.useEffect(function(){if(ut.current||(ut.current=Date.now()),It){if(function(At,Dr){var sn=At&&At.current;if(sn&&sn.nodeType===1){var jt=sn.getBoundingClientRect();Dr({T:jt.top,L:jt.left,W:jt.width,H:jt.height,FIT:sn.tagName==="IMG"?getComputedStyle(sn).objectFit:void 0})}}(hr,_n),xn)return Date.now()-ut.current<250?(lt(1),requestAnimationFrame(function(){lt(2),requestAnimationFrame(function(){return Sn(3)})}),void setTimeout(Wt.OK,Fr)):void lt(4);Sn(5)}},[xn,It]),[$t,Un]}(te,ge,Ne,nn,dr),vn=Dn[0],wn=Dn[1],rn=wn.W,Lr=wn.FIT,bs=innerWidth/2,Pr=innerHeight/2,Mn=vn<3||vn>4;return[Mn?rn?wn.L:bs:mn+(bs-Ot*kt/2),Mn?rn?wn.T:Pr:gn+(Pr-_t*kt/2),fr,Mn&&Lr?fr*(wn.H/rn):zr,vn===0?yn:Mn?rn/(Ot*kt)||.01:yn,Mn?Lr?1:0:1,vn,Lr]}(d,l,F,B,D,H,ee,X,p,function(te){return M({pause:te})}),_e=Tt[4],Te=Tt[6],Ae="transform "+p+"ms "+y,je={className:g,onMouseDown:bn?void 0:function(te){te.stopPropagation(),te.button===0&&Pn(te.clientX,te.clientY,0)},onTouchStart:bn?function(te){te.stopPropagation(),Pn.apply(void 0,tf(te))}:void 0,onWheel:function(te){if(!G){var ge=qs(X-te.deltaY/100/2,_/H);M({stopRaf:!0}),ie(ge,te.clientX,te.clientY)}},style:{width:Tt[2]+"px",height:Tt[3]+"px",opacity:Tt[5],objectFit:Te===4?void 0:Tt[7],transform:se?"rotate("+se+"deg)":void 0,transition:Te>2?Ae+", opacity "+p+"ms ease, height "+(Te<4?p/2:Te>4?p:0)+"ms "+y:void 0}};return ke.createElement("div",{className:"PhotoView__PhotoWrap"+(x?" "+x:""),style:m,onMouseDown:!bn&&N?jr:void 0,onTouchStart:bn&&N?function(te){return jr(te.touches[0])}:void 0},ke.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+_e+", 0, 0, "+_e+", "+Tt[0]+", "+Tt[1]+")",transition:le||Y?void 0:Ae,willChange:N?"transform":void 0}},n?ke.createElement(Sw,Ze({src:n,loaded:F,broken:A},je,{onPhotoLoad:function(te){M(Ze({},te,te.loaded&&Ka(te.naturalWidth||0,te.naturalHeight||0,se)))},loadingElement:u,brokenElement:v})):r&&r({attrs:je,scale:_e,rotate:se})))}var rf={x:0,touched:!1,pause:!1,lastCX:void 0,lastCY:void 0,bg:void 0,lastBg:void 0,overlay:!0,minimal:!0,scale:1,rotate:0};function Cw(e){var t=e.loop,n=t===void 0?3:t,r=e.speed,i=e.easing,s=e.photoClosable,o=e.maskClosable,a=o===void 0||o,l=e.maskOpacity,d=l===void 0?1:l,p=e.pullClosable,y=p===void 0||p,x=e.bannerVisible,g=x===void 0||x,m=e.overlayRender,u=e.toolbarRender,v=e.className,c=e.maskClassName,h=e.photoClassName,w=e.photoWrapClassName,k=e.loadingElement,b=e.brokenElement,N=e.images,T=e.index,P=T===void 0?0:T,O=e.onIndexChange,M=e.visible,J=e.onClose,R=e.afterClose,W=e.portalContainer,_=Uo(rf),V=_[0],ce=_[1],Q=Z.useState(0),H=Q[0],U=Q[1],ee=V.x,z=V.touched,F=V.pause,A=V.lastCX,B=V.lastCY,D=V.bg,le=D===void 0?d:D,de=V.lastBg,ue=V.overlay,se=V.minimal,X=V.scale,re=V.rotate,q=V.onScale,ne=V.onRotate,f=e.hasOwnProperty("index"),I=f?P:H,L=f?O:U,C=Z.useRef(I),E=N.length,j=N[I],Y=typeof n=="boolean"?n:E>n,G=function(_e,Te){var Ae=Z.useReducer(function(Ne){return!Ne},!1)[1],je=Z.useRef(0),te=function(Ne){var mn=Z.useRef(Ne);function gn(Ot){mn.current=Ot}return Z.useMemo(function(){(function(Ot){_e?(Ot(_e),je.current=1):je.current=2})(gn)},[Ne]),[mn.current,gn]}(_e),ge=te[1];return[te[0],je.current,function(){Ae(),je.current===2&&(ge(!1),Te&&Te()),je.current=0}]}(M,R),$=G[0],ie=G[1],fe=G[2];tu(function(){if($)return ce({pause:!0,x:I*-(innerWidth+Br)}),void(C.current=I);ce(rf)},[$]);var oe=li({close:function(_e){ne&&ne(0),ce({overlay:!0,lastBg:le}),J(_e)},changeIndex:function(_e,Te){Te===void 0&&(Te=!1);var Ae=Y?C.current+(_e-I):_e,je=E-1,te=eu(Ae,0,je),ge=Y?Ae:te,Ne=innerWidth+Br;ce({touched:!1,lastCX:void 0,lastCY:void 0,x:-Ne*ge,pause:Te}),C.current=ge,L&&L(Y?_e<0?je:_e>je?0:_e:te)}}),pe=oe.close,ve=oe.changeIndex;function ye(_e){return _e?pe():ce({overlay:!ue})}function We(){ce({x:-(innerWidth+Br)*I,lastCX:void 0,lastCY:void 0,pause:!0}),C.current=I}function Jt(_e,Te,Ae,je){_e==="x"?function(te){if(A!==void 0){var ge=te-A,Ne=ge;!Y&&(I===0&&ge>0||I===E-1&&ge<0)&&(Ne=ge/2),ce({touched:!0,lastCX:A,x:-(innerWidth+Br)*C.current+Ne,pause:!1})}else ce({touched:!0,lastCX:te,x:ee,pause:!1})}(Te):_e==="y"&&function(te,ge){if(B!==void 0){var Ne=d===null?null:eu(d,.01,d-Math.abs(te-B)/100/4);ce({touched:!0,lastCY:B,bg:ge===1?Ne:d,minimal:ge===1})}else ce({touched:!0,lastCY:te,bg:le,minimal:!0})}(Ae,je)}function at(_e,Te){var Ae=_e-(A??_e),je=Te-(B??Te),te=!1;if(Ae<-40)ve(I+1);else if(Ae>40)ve(I-1);else{var ge=-(innerWidth+Br)*C.current;Math.abs(je)>100&&se&&y&&(te=!0,pe()),ce({touched:!1,x:ge,lastCX:void 0,lastCY:void 0,bg:d,overlay:!!te||ue})}}$r("keydown",function(_e){if(M)switch(_e.key){case"ArrowLeft":ve(I-1,!0);break;case"ArrowRight":ve(I+1,!0);break;case"Escape":pe()}});var en=function(_e,Te,Ae){return Z.useMemo(function(){var je=_e.length;return Ae?_e.concat(_e).concat(_e).slice(je+Te-1,je+Te+2):_e.slice(Math.max(Te-1,0),Math.min(Te+2,je+1))},[_e,Te,Ae])}(N,I,Y);if(!$)return null;var be=ue&&!ie,pn=M?le:de,tn=q&&ne&&{images:N,index:I,visible:M,onClose:pe,onIndexChange:ve,overlayVisible:be,overlay:j&&j.overlay,scale:X,rotate:re,onScale:q,onRotate:ne},tt=r?r(ie):400,Pn=i?i(ie):ef,jr=r?r(3):600,Tt=i?i(3):ef;return ke.createElement(hw,{className:"PhotoView-Portal"+(be?"":" PhotoView-Slider__clean")+(M?"":" PhotoView-Slider__willClose")+(v?" "+v:""),role:"dialog",onClick:function(_e){return _e.stopPropagation()},container:W},M&&ke.createElement(yw,null),ke.createElement("div",{className:"PhotoView-Slider__Backdrop"+(c?" "+c:"")+(ie===1?" PhotoView-Slider__fadeIn":ie===2?" PhotoView-Slider__fadeOut":""),style:{background:pn?"rgba(0, 0, 0, "+pn+")":void 0,transitionTimingFunction:Pn,transitionDuration:(z?0:tt)+"ms",animationDuration:tt+"ms"},onAnimationEnd:fe}),g&&ke.createElement("div",{className:"PhotoView-Slider__BannerWrap"},ke.createElement("div",{className:"PhotoView-Slider__Counter"},I+1," / ",E),ke.createElement("div",{className:"PhotoView-Slider__BannerRight"},u&&tn&&u(tn),ke.createElement(pw,{className:"PhotoView-Slider__toolbarIcon",onClick:pe}))),en.map(function(_e,Te){var Ae=Y||I!==0?C.current-1+Te:I+Te;return ke.createElement(Ew,{key:Y?_e.key+"/"+_e.src+"/"+Ae:_e.key,item:_e,speed:tt,easing:Pn,visible:M,onReachMove:Jt,onReachUp:at,onPhotoTap:function(){return ye(s)},onMaskTap:function(){return ye(a)},wrapClassName:w,className:h,style:{left:(innerWidth+Br)*Ae+"px",transform:"translate3d("+ee+"px, 0px, 0)",transition:z||F?void 0:"transform "+jr+"ms "+Tt},loadingElement:k,brokenElement:b,onPhotoResize:We,isActive:C.current===Ae,expose:ce})}),!bn&&g&&ke.createElement(ke.Fragment,null,(Y||I!==0)&&ke.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return ve(I-1,!0)}},ke.createElement(mw,null)),(Y||I+1-1){var c=d.slice();return c.splice(v,1,u),void a({images:c})}a(function(h){return{images:h.images.concat(u)}})},remove:function(u){a(function(v){var c=v.images.filter(function(h){return h.key!==u});return{images:c,index:Math.min(c.length-1,y)}})},show:function(u){var v=d.findIndex(function(c){return c.key===u});a({visible:!0,index:v}),r&&r(!0,v,o)}}),g=li({close:function(){a({visible:!1}),r&&r(!1,y,o)},changeIndex:function(u){a({index:u}),n&&n(u,o)}}),m=Z.useMemo(function(){return Ze({},o,x)},[o,x]);return ke.createElement(dw.Provider,{value:m},t,ke.createElement(Cw,Ze({images:d,visible:p,index:y,onIndexChange:g.changeIndex,onClose:g.close},i)))}function ru(){return ru=Object.assign?Object.assign.bind():function(e){for(var t=1;t=t?e.call(null):i.id=requestAnimationFrame(r)}var i={id:requestAnimationFrame(r)};return i}var Ya=-1;function uf(e){if(e===void 0&&(e=!1),Ya===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),Ya=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Ya}var Ur=null;function cf(e){if(e===void 0&&(e=!1),Ur===null||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;return i.width="100px",i.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?Ur="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?Ur="negative":Ur="positive-ascending"),document.body.removeChild(t),Ur}return Ur}var Lw=150,Pw=function(t,n){return t};function Fw(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,i=e.getItemSize,s=e.getOffsetForIndexAndAlignment,o=e.getStartIndexForOffset,a=e.getStopIndexForStartIndex,l=e.initInstanceProps,d=e.shouldResetStyleCacheOnItemSizeChange,p=e.validateProps;return t=function(y){Ow(x,y);function x(m){var u;return u=y.call(this,m)||this,u._instanceProps=l(u.props,sf(u)),u._outerRef=void 0,u._resetIsScrollingTimeoutId=null,u.state={instance:sf(u),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof u.props.initialScrollOffset=="number"?u.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},u._callOnItemsRendered=void 0,u._callOnItemsRendered=Xa(function(v,c,h,w){return u.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:c,visibleStartIndex:h,visibleStopIndex:w})}),u._callOnScroll=void 0,u._callOnScroll=Xa(function(v,c,h){return u.props.onScroll({scrollDirection:v,scrollOffset:c,scrollUpdateWasRequested:h})}),u._getItemStyle=void 0,u._getItemStyle=function(v){var c=u.props,h=c.direction,w=c.itemSize,k=c.layout,b=u._getItemStyleCache(d&&w,d&&k,d&&h),N;if(b.hasOwnProperty(v))N=b[v];else{var T=n(u.props,v,u._instanceProps),P=i(u.props,v,u._instanceProps),O=h==="horizontal"||k==="horizontal",M=h==="rtl",J=O?T:0;b[v]=N={position:"absolute",left:M?void 0:J,right:M?J:void 0,top:O?0:T,height:O?"100%":P,width:O?P:"100%"}}return N},u._getItemStyleCache=void 0,u._getItemStyleCache=Xa(function(v,c,h){return{}}),u._onScrollHorizontal=function(v){var c=v.currentTarget,h=c.clientWidth,w=c.scrollLeft,k=c.scrollWidth;u.setState(function(b){if(b.scrollOffset===w)return null;var N=u.props.direction,T=w;if(N==="rtl")switch(cf()){case"negative":T=-w;break;case"positive-descending":T=k-h-w;break}return T=Math.max(0,Math.min(T,k-h)),{isScrolling:!0,scrollDirection:b.scrollOffsetN.clientWidth?uf():0:b=N.scrollHeight>N.clientHeight?uf():0}this.scrollTo(s(this.props,u,v,k,this._instanceProps,b))},g.componentDidMount=function(){var u=this.props,v=u.direction,c=u.initialScrollOffset,h=u.layout;if(typeof c=="number"&&this._outerRef!=null){var w=this._outerRef;v==="horizontal"||h==="horizontal"?w.scrollLeft=c:w.scrollTop=c}this._callPropsCallbacks()},g.componentDidUpdate=function(){var u=this.props,v=u.direction,c=u.layout,h=this.state,w=h.scrollOffset,k=h.scrollUpdateWasRequested;if(k&&this._outerRef!=null){var b=this._outerRef;if(v==="horizontal"||c==="horizontal")if(v==="rtl")switch(cf()){case"negative":b.scrollLeft=-w;break;case"positive-ascending":b.scrollLeft=w;break;default:var N=b.clientWidth,T=b.scrollWidth;b.scrollLeft=T-N-w;break}else b.scrollLeft=w;else b.scrollTop=w}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&lf(this._resetIsScrollingTimeoutId)},g.render=function(){var u=this.props,v=u.children,c=u.className,h=u.direction,w=u.height,k=u.innerRef,b=u.innerElementType,N=u.innerTagName,T=u.itemCount,P=u.itemData,O=u.itemKey,M=O===void 0?Pw:O,J=u.layout,R=u.outerElementType,W=u.outerTagName,_=u.style,V=u.useIsScrolling,ce=u.width,Q=this.state.isScrolling,H=h==="horizontal"||J==="horizontal",U=H?this._onScrollHorizontal:this._onScrollVertical,ee=this._getRangeToRender(),z=ee[0],F=ee[1],A=[];if(T>0)for(var B=z;B<=F;B++)A.push(Z.createElement(v,{data:P,key:M(B,P),index:B,isScrolling:V?Q:void 0,style:this._getItemStyle(B)}));var D=r(this.props,this._instanceProps);return Z.createElement(R||W||"div",{className:c,onScroll:U,ref:this._outerRefSetter,style:ru({position:"relative",height:w,width:ce,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:h},_)},Z.createElement(b||N||"div",{children:A,ref:k,style:{height:H?"100%":D,pointerEvents:Q?"none":void 0,width:H?D:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var u=this.props.itemCount;if(u>0){var v=this._getRangeToRender(),c=v[0],h=v[1],w=v[2],k=v[3];this._callOnItemsRendered(c,h,w,k)}}if(typeof this.props.onScroll=="function"){var b=this.state,N=b.scrollDirection,T=b.scrollOffset,P=b.scrollUpdateWasRequested;this._callOnScroll(N,T,P)}},g._getRangeToRender=function(){var u=this.props,v=u.itemCount,c=u.overscanCount,h=this.state,w=h.isScrolling,k=h.scrollDirection,b=h.scrollOffset;if(v===0)return[0,0,0,0];var N=o(this.props,b,this._instanceProps),T=a(this.props,N,b,this._instanceProps),P=!w||k==="backward"?Math.max(1,c):1,O=!w||k==="forward"?Math.max(1,c):1;return[Math.max(0,N-P),Math.max(0,Math.min(v-1,T+O)),N,T]},x}(Z.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Dw=function(t,n){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,n.instance},Mw=50,ti=function(t,n,r){var i=t,s=i.itemSize,o=r.itemMetadataMap,a=r.lastMeasuredIndex;if(n>a){var l=0;if(a>=0){var d=o[a];l=d.offset+d.size}for(var p=a+1;p<=n;p++){var y=s(p);o[p]={offset:l,size:y},l+=y}r.lastMeasuredIndex=n}return o[n]},Bw=function(t,n,r){var i=n.itemMetadataMap,s=n.lastMeasuredIndex,o=s>0?i[s].offset:0;return o>=r?xm(t,n,s,0,r):Uw(t,n,Math.max(0,s),r)},xm=function(t,n,r,i,s){for(;i<=r;){var o=i+Math.floor((r-i)/2),a=ti(t,o,n).offset;if(a===s)return o;as&&(r=o-1)}return i>0?i-1:0},Uw=function(t,n,r,i){for(var s=t.itemCount,o=1;r=r&&(o=r-1),o>=0){var l=i[o];a=l.offset+l.size}var d=r-o-1,p=d*s;return a+p},$w=Fw({getItemOffset:function(t,n,r){return ti(t,n,r).offset},getItemSize:function(t,n,r){return r.itemMetadataMap[n].size},getEstimatedTotalSize:df,getOffsetForIndexAndAlignment:function(t,n,r,i,s,o){var a=t.direction,l=t.height,d=t.layout,p=t.width,y=a==="horizontal"||d==="horizontal",x=y?p:l,g=ti(t,n,s),m=df(t,s),u=Math.max(0,Math.min(m-x,g.offset)),v=Math.max(0,g.offset-x+g.size+o);switch(r==="smart"&&(i>=v-x&&i<=u+x?r="auto":r="center"),r){case"start":return u;case"end":return v;case"center":return Math.round(v+(u-v)/2);case"auto":default:return i>=v&&i<=u?i:i{try{await Me.openInExplorer(t,e.path)}catch(o){console.error("Failed to open file:",o)}};return S.jsxs("div",{className:"fixed inset-0 z-50 bg-black bg-opacity-90 flex items-center justify-center",children:[S.jsxs("div",{className:"absolute top-0 left-0 right-0 h-16 bg-black bg-opacity-50 flex items-center justify-between px-4 z-10",children:[S.jsx("div",{className:"text-white text-sm truncate max-w-md",children:e.filename}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("button",{onClick:s,className:"p-2 text-white hover:bg-white hover:bg-opacity-20 rounded transition-colors",title:"在系统默认应用中打开",children:S.jsx(G1,{className:"w-5 h-5"})}),S.jsx("button",{onClick:n,className:"p-2 text-white hover:bg-white hover:bg-opacity-20 rounded transition-colors",children:S.jsx(vm,{className:"w-6 h-6"})})]})]}),S.jsxs("div",{className:"w-full h-full flex items-center justify-center p-20",children:[r==="video"&&S.jsx("video",{src:i,controls:!0,autoPlay:!0,className:"max-w-full max-h-full rounded shadow-2xl",onError:o=>{console.error("Video load error:",o),alert("视频加载失败,请尝试在系统默认应用中打开")},children:"您的浏览器不支持视频播放"}),r==="audio"&&S.jsxs("div",{className:"flex flex-col items-center justify-center",children:[S.jsx("div",{className:"text-white text-6xl mb-8",children:"🎵"}),S.jsx("audio",{src:i,controls:!0,autoPlay:!0,className:"w-96 rounded shadow-2xl",onError:o=>{console.error("Audio load error:",o),alert("音频加载失败,请尝试在系统默认应用中打开")},children:"您的浏览器不支持音频播放"}),S.jsx("p",{className:"text-white mt-4 text-sm opacity-70",children:e.filename})]}),r==="document"&&S.jsx("div",{className:"w-full h-full bg-white rounded shadow-2xl overflow-hidden",children:e.format==="pdf"?S.jsx("iframe",{src:i,className:"w-full h-full",title:e.filename}):S.jsx("iframe",{src:i,className:"w-full h-full",title:e.filename,sandbox:"allow-same-origin"})}),(r==="design"||r==="other"||!r)&&S.jsxs("div",{className:"text-center text-white",children:[S.jsx("p",{className:"mb-4",children:"此文件类型需要在专业软件中打开"}),S.jsx("button",{onClick:s,className:"px-6 py-3 bg-blue-500 hover:bg-blue-600 rounded-lg transition-colors",children:"在系统默认应用中打开"})]})]}),S.jsx("div",{className:"absolute inset-0 -z-10",onClick:n})]})}const Hw=100,Vw=500;function qw(){const{filteredImages:e,currentLibraryId:t,thumbnailHeight:n,selectedImage:r,setSelectedImage:i,selectedImages:s,setSelectedImages:o,toggleImageSelection:a,clearSelection:l,isResizingPanels:d,imageLoadingState:p,selectedFolder:y,searchKeywords:x,filters:g,appendImages:m,setImageLoadingState:u}=me(),v=Z.useRef(null),c=Z.useRef(null),h=Z.useRef(null),w=Z.useRef(0),[k,b]=Z.useState(0),[N,T]=Z.useState(0),[P,O]=Z.useState(-1),[M,J]=Z.useState(null),[R,W]=Z.useState(null),[_,V]=Z.useState([]),ce=Z.useCallback(async()=>{var ne;if(!t||!p.hasMore||p.isLoading)return;const q=Ft.createRequest(ps.IMAGES);u({isLoading:!0});try{const f={offset:p.loadedCount,limit:200};y&&(f.folder=y),x&&(f.keywords=x),((ne=g.formats)==null?void 0:ne.length)>0&&(f.formats=g.formats.join(","));const I=await Me.search(t,f,{signal:q.signal});if(!Ft.isValid(q.id))return;const{images:L,total:C,hasMore:E}=I.data;Ft.complete(q.id),m(L),u({isLoading:!1,loadedCount:p.loadedCount+L.length,totalCount:C,hasMore:E||!1})}catch(f){if(f.name==="CanceledError"||f.name==="AbortError")return;console.error("Error loading more images:",f),Ft.error(q.id),u({isLoading:!1})}},[t,p,y,x,g,m,u]);Z.useEffect(()=>{let q=null,ne=0;const f=10,I={current:0};let L=null;const C=(Y,G)=>(Math.abs(Y-I.current)<12||(I.current=Y,L&&clearTimeout(L),L=setTimeout(()=>{b(Y),T(G)},50)),!0),E=()=>{if(v.current){const Y=v.current.offsetWidth-32,G=v.current.offsetHeight;if(Y>0)return C(Y,G)}return!1},j=()=>{E()?v.current&&(q=new ResizeObserver(()=>{me.getState().isResizingPanels||E()}),q.observe(v.current)):ne{q&&q.disconnect(),L&&clearTimeout(L)}},[]),Z.useEffect(()=>{if(d||!v.current)return;const q=v.current.offsetWidth-32,ne=v.current.offsetHeight;q>0&&(b(q),T(ne),c.current&&c.current.resetAfterIndex(0))},[d]);const Q=e.length>Vw,H=Z.useRef({length:0,firstId:null,libraryId:null}),U=Z.useRef(!1);Z.useEffect(()=>{var E;const q=H.current.length,ne=e.length,f=H.current.firstId,I=(E=e[0])==null?void 0:E.id,L=H.current.libraryId;q>0&&ne===0||I!==f||t!==L?(V([]),w.current=0,U.current=!1,h.current&&h.current.postMessage({reset:!0,requestId:0})):ne>q&&(U.current=!0),H.current={length:ne,firstId:I,libraryId:t}},[e,t]),Z.useEffect(()=>(typeof Worker<"u"&&(h.current=new Worker(new URL("/assets/layoutWorker-D6X91dDa.js",import.meta.url),{type:"module"}),h.current.onmessage=q=>{const{rows:ne,requestId:f}=q.data;f===w.current&&V(ne)}),()=>{h.current&&(h.current.terminate(),h.current=null)}),[]),Z.useEffect(()=>{if(!Q||!h.current||!e.length||!k)return;const q=++w.current,ne=e.map(f=>({id:f.id,width:f.width,height:f.height,filename:f.filename,thumbnail_path:f.thumbnail_path,path:f.path,file_type:f.file_type,format:f.format}));h.current.postMessage({images:ne,containerWidth:k,targetHeight:n,requestId:q,incremental:U.current})},[e,k,n,Q]);const ee=Z.useMemo(()=>{if(Q)return[];if(!e.length||!k)return[];const q=16,ne=n,f=[];let I=[],L=0;return e.forEach((C,E)=>{const j=C.width/C.height,Y=ne*j;I.push({...C,originalWidth:Y,aspectRatio:j}),L+=Y;const G=(I.length-1)*q,$=L+G,ie=E===e.length-1;let fe=!1;if(ie)fe=!0;else if($>=k*.95)fe=!0;else{const oe=e[E+1];if(oe){const pe=oe.width/oe.height,ve=ne*pe;L+ve+I.length*q>k*1.2&&(fe=!0)}}if(fe){const oe=(I.length-1)*q;let ve=(k-oe)/L;ie&&I.length<3&&(ve=Math.min(ve,1.2));const ye=ne*ve;I=I.map(We=>({...We,calculatedWidth:We.originalWidth*ve,calculatedHeight:ye})),f.push(I),I=[],L=0}}),f},[e,n,k,Q]),z=Q?_:ee,F=q=>{if(!t||!q.thumbnail_path)return"";const ne=q.thumbnail_path.replace(/\\/g,"/").split("/").pop();return Me.getThumbnailUrl(t,"480",ne)},A=q=>t?Me.getOriginalUrl(t,q.path):"",B=Z.useMemo(()=>e.map(q=>({src:A(q),key:q.id})),[e,t]),D=e.length>Hw,le=Z.useCallback(q=>!z[q]||z[q].length===0?n+40:z[q][0].calculatedHeight+28+32,[z,n]),de=Z.useRef(0);Z.useEffect(()=>{if(c.current&&D){const q=de.current,ne=z.length;ne>q&&q>0?c.current.resetAfterIndex(Math.max(0,q-1)):c.current.resetAfterIndex(0),de.current=ne}},[z,D]);const ue=Z.useMemo(()=>z.flat(),[z]),se=Z.useCallback((q,ne,f)=>{if(ne.ctrlKey||ne.metaKey)ne.preventDefault(),a(q),J(f);else if(ne.shiftKey&&M!==null){ne.preventDefault();const I=Math.min(M,f),L=Math.max(M,f),C=ue.slice(I,L+1);o(C)}else l(),i(q),J(f)},[ue,M,a,o,l,i]),X=(q,ne)=>{const f=(r==null?void 0:r.id)===q.id,I=s.some(C=>C.id===q.id),L=f||I;return S.jsxs("div",{className:"flex-shrink-0",style:{width:`${q.calculatedWidth}px`},children:[S.jsxs("div",{className:"relative group cursor-pointer overflow-hidden rounded-lg transition-all hover:shadow-lg",style:{height:`${q.calculatedHeight}px`,backgroundColor:"#2a2a2a",border:L?"3px solid #3b82f6":"3px solid transparent"},onClick:C=>se(q,C,ne),onDoubleClick:()=>{(q.file_type||"image")==="image"?O(ne):W(q)},children:[S.jsx("img",{src:F(q),alt:q.filename,className:"w-full h-full object-cover",loading:"lazy",onError:C=>{C.target.style.display="none"}}),q.file_type&&q.file_type!=="image"&&S.jsxs("div",{className:`absolute top-2 right-2 rounded-md px-2 py-1 flex items-center gap-1 shadow-lg ${q.file_type==="video"?"bg-blue-500 bg-opacity-90":q.file_type==="audio"?"bg-pink-500 bg-opacity-90":q.file_type==="document"?"bg-green-500 bg-opacity-90":q.file_type==="design"?"bg-purple-500 bg-opacity-90":"bg-gray-500 bg-opacity-90"}`,children:[q.file_type==="video"&&S.jsx(ym,{className:"w-4 h-4 text-white fill-white"}),q.file_type==="audio"&&S.jsx(rw,{className:"w-4 h-4 text-white"}),q.file_type==="document"&&S.jsx(J1,{className:"w-4 h-4 text-white"}),q.file_type==="design"&&S.jsx(iw,{className:"w-4 h-4 text-white"}),q.file_type==="other"&&S.jsx(ew,{className:"w-4 h-4 text-white"}),S.jsx("span",{className:"text-white text-xs font-semibold uppercase",children:q.format||q.filename.split(".").pop()})]}),S.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-0 group-hover:bg-opacity-20 transition-all pointer-events-none"})]}),S.jsx("div",{className:"mt-1 px-1",children:S.jsx("p",{className:"text-xs truncate text-center transition-colors",style:{color:L?"#3b82f6":"#909090",fontWeight:L?"600":"400"},children:q.filename})})]},q.id)},re=({index:q,style:ne})=>{var L;const f=z[q];if(!f)return null;let I=0;for(let C=0;CX(C,I+E))})};return e.length?Q&&z.length===0&&e.length>0&&k>0?S.jsx("div",{ref:v,className:"flex items-center justify-center h-full text-gray-500 dark:text-gray-400",children:S.jsxs("div",{className:"text-center",children:[S.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-blue-500 border-t-transparent rounded-full mx-auto mb-2"}),S.jsx("p",{className:"text-sm",children:"正在计算布局..."})]})}):!k&&e.length>0?S.jsx("div",{ref:v,className:"h-full overflow-hidden"}):S.jsxs("div",{ref:v,className:"h-full overflow-hidden",children:[S.jsx(Tw,{images:B,visible:P>=0,onClose:()=>O(-1),index:P,onIndexChange:O,children:D?S.jsx($w,{ref:c,height:N||600,width:k+32,itemCount:z.length,itemSize:le,className:"p-4",overscanCount:3,onScroll:({scrollOffset:q,scrollDirection:ne})=>{if(ne==="forward"&&p.hasMore&&!p.isLoading){const f=z.reduce((L,C,E)=>L+le(E),0),I=q+(N||600);f-I<500&&ce()}},children:re}):S.jsx("div",{className:"h-full overflow-y-auto p-4",onScroll:q=>{if(p.hasMore&&!p.isLoading){const{scrollTop:ne,scrollHeight:f,clientHeight:I}=q.target;f-ne-I<500&&ce()}},children:S.jsx("div",{className:"space-y-8",children:z.map((q,ne)=>{var I;let f=0;for(let L=0;LX(L,f+C))},ne)})})})}),R&&S.jsx(Ww,{file:R,libraryId:t,onClose:()=>W(null)})]}):S.jsx("div",{ref:v,className:"flex items-center justify-center h-full text-gray-500 dark:text-gray-400",children:S.jsxs("div",{className:"text-center",children:[S.jsx("p",{className:"text-lg mb-2",children:"暂无图片"}),S.jsx("p",{className:"text-sm",children:"请添加素材库或调整搜索条件"})]})})}function Kw(){const{totalImageCount:e,folders:t,currentLibraryId:n,getCurrentLibrary:r}=me(),i=r(),s=t.length,o=t.filter(a=>!a.parent_path||a.parent_path==="."||a.parent_path==="");return S.jsx("div",{className:"flex-1 h-full overflow-y-auto bg-gray-50 dark:bg-gray-900 p-8",children:S.jsxs("div",{className:"max-w-4xl mx-auto",children:[S.jsxs("div",{className:"mb-8",children:[S.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-2",children:(i==null?void 0:i.name)||"素材库"}),S.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:i==null?void 0:i.path})]}),S.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-12",children:[S.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-xl p-6 shadow-sm border border-gray-100 dark:border-gray-700",children:S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("div",{className:"p-3 bg-blue-100 dark:bg-blue-900/30 rounded-lg text-blue-600 dark:text-blue-400",children:S.jsx(nw,{className:"w-6 h-6"})}),S.jsxs("div",{children:[S.jsx("div",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:e.toLocaleString()}),S.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"总图片数"})]})]})}),S.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-xl p-6 shadow-sm border border-gray-100 dark:border-gray-700",children:S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("div",{className:"p-3 bg-indigo-100 dark:bg-indigo-900/30 rounded-lg text-indigo-600 dark:text-indigo-400",children:S.jsx(Zi,{className:"w-6 h-6"})}),S.jsxs("div",{children:[S.jsx("div",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:s.toLocaleString()}),S.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"文件夹"})]})]})}),S.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-xl p-6 shadow-sm border border-gray-100 dark:border-gray-700",children:S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("div",{className:"p-3 bg-purple-100 dark:bg-purple-900/30 rounded-lg text-purple-600 dark:text-purple-400",children:S.jsx(Bo,{className:"w-6 h-6"})}),S.jsxs("div",{children:[S.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white mb-1",children:"快速开始"}),S.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:"使用左侧目录树浏览或顶部搜索栏查找图片"})]})]})})]}),o.length>0&&S.jsxs("div",{children:[S.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:"根目录文件夹"}),S.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:o.map(a=>S.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg p-4 shadow-sm border border-gray-100 dark:border-gray-700 hover:shadow-md transition-shadow cursor-pointer group",onClick:()=>me.getState().setSelectedFolder(a.path),children:[S.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[S.jsx(Zi,{className:"w-8 h-8 text-yellow-500 group-hover:text-yellow-400 transition-colors"}),S.jsx("div",{className:"flex-1 min-w-0",children:S.jsx("div",{className:"font-medium text-gray-900 dark:text-white truncate",title:a.name,children:a.name})})]}),S.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:[a.image_count||0," 张图片"]})]},a.path))})]}),o.length===0&&S.jsxs("div",{className:"text-center py-12 bg-white dark:bg-gray-800 rounded-xl border border-dashed border-gray-300 dark:border-gray-700",children:[S.jsx(Zi,{className:"w-12 h-12 text-gray-300 dark:text-gray-600 mx-auto mb-4"}),S.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:"暂无文件夹"}),S.jsx("p",{className:"text-gray-500 dark:text-gray-400 max-w-sm mx-auto",children:"您的素材库似乎是空的。请将图片添加到素材库目录中,系统会自动扫描。"})]})]})})}function ff(){const{currentLibraryId:e,searchKeywords:t,filters:n,selectedFolder:r,setImages:i,scanProgress:s,imageLoadingState:o}=me(),a=Z.useRef(null),l=Z.useRef(null),[d,p]=Z.useState(!1),[y,x]=Z.useState(!1),g=()=>{if(!s||s.current===0)return null;if(s.estimatedTimeLeft!==void 0){const h=s.estimatedTimeLeft;return h<1?"即将完成":h<60?`剩余约 ${h} 秒`:`剩余约 ${Math.floor(h/60)} 分钟`}return null},m=Z.useCallback(()=>{Ft.cancelAll(ps.IMAGES),a.current=null},[]),u=Z.useCallback(async()=>{var w;if(!e)return;if(!r&&!t&&n.formats.length===0){i([]),me.getState().setImageLoadingState({isLoading:!1,loadedCount:0,totalCount:0,hasMore:!1});return}Jl(),m();const h=Ft.createRequest(ps.IMAGES);a.current=h,me.getState().setImageLoadingState({isLoading:!0,loadedCount:0,totalCount:0,hasMore:!1});try{const k={offset:0,limit:200};r&&(k.folder=r),t&&(k.keywords=t),((w=n.formats)==null?void 0:w.length)>0&&(k.formats=n.formats.join(","));const b=await Me.search(e,k,{signal:h.signal});if(!Ft.isValid(h.id))return;const{images:N,total:T,hasMore:P}=b.data;Ft.complete(h.id),i(N),me.getState().setImageLoadingState({isLoading:!1,loadedCount:N.length,totalCount:T||N.length,hasMore:P||!1}),P&&uw(P)}catch(k){if(k.name==="CanceledError"||k.name==="AbortError")return;console.error("Error loading images:",k),Ft.error(h.id)}finally{(Ft.isValid(h.id)||h.status==="completed")&&(a.current=null)}},[e,t,n,r,i,m]);Z.useEffect(()=>{if(e)return l.current&&clearTimeout(l.current),m(),i([]),l.current=setTimeout(()=>{u()},50),()=>{l.current&&clearTimeout(l.current)}},[e,t,n,r,u,m,i]),Z.useEffect(()=>()=>{m(),l.current&&clearTimeout(l.current)},[m]);const v=async()=>{if(!(!e||y)){x(!0);try{await sr.stop(e),p(!0)}catch(h){console.error("Error stopping scan:",h)}finally{x(!1)}}},c=async()=>{if(!(!e||y)){x(!0);try{s!=null&&s.needsRescan?await sr.sync(e):await sr.resume(e),p(!1)}catch(h){console.error("Error resuming scan:",h)}finally{x(!1)}}};return Z.useEffect(()=>{s?s.isPaused?p(!0):s.percent===100&&p(!1):p(!1)},[s]),S.jsxs("div",{className:"flex flex-col h-full bg-gray-50 dark:bg-gray-900",children:[s&&S.jsxs("div",{className:`p-4 border-b ${d?"bg-yellow-50 dark:bg-yellow-900 border-yellow-200 dark:border-yellow-700":"bg-blue-50 dark:bg-blue-900 border-blue-200 dark:border-blue-700"}`,children:[S.jsxs("div",{className:"flex items-center justify-between mb-2",children:[S.jsx("div",{className:`text-sm font-medium ${d?"text-yellow-700 dark:text-yellow-300":"text-blue-700 dark:text-blue-300"}`,children:d?"扫描已暂停":(s==null?void 0:s.status)==="preparing"?"正在准备扫描...":"正在扫描素材库,期间建议勿操作,否则会影响扫描速度"}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsxs("span",{className:`text-sm ${d?"text-yellow-600":"text-blue-600"}`,children:[(s==null?void 0:s.percent)||0,"%"]}),((s==null?void 0:s.canStop)||d)&&S.jsx("button",{onClick:d?c:v,disabled:y,className:`p-1.5 rounded-md ${d?"bg-green-500 hover:bg-green-600":"bg-yellow-500 hover:bg-yellow-600"} text-white`,children:d?S.jsx(ym,{className:"w-4 h-4"}):S.jsx(sw,{className:"w-4 h-4"})})]})]}),S.jsx("div",{className:`w-full rounded-full h-2 mb-2 ${d?"bg-yellow-200":"bg-blue-200"}`,children:S.jsx("div",{className:`h-2 rounded-full transition-all ${d?"bg-yellow-500":"bg-blue-500"}`,style:{width:`${(s==null?void 0:s.percent)||0}%`}})}),S.jsxs("div",{className:`text-xs ${d?"text-yellow-600":"text-blue-600"}`,children:["已处理 ",(s==null?void 0:s.current)||0," / ",(s==null?void 0:s.total)||0," 张图片",g()&&` · ${g()}`]})]}),o.hasMore&&o.loadedCount>0&&S.jsx("div",{className:"px-4 py-2 bg-gray-100 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:S.jsxs("div",{className:"flex items-center justify-between text-sm",children:[S.jsxs("span",{className:"text-gray-600 dark:text-gray-400",children:["已加载 ",o.loadedCount," / ",o.totalCount," 张"]}),S.jsx("div",{className:"w-32 h-1.5 bg-gray-200 rounded-full overflow-hidden",children:S.jsx("div",{className:"h-full bg-blue-500",style:{width:`${o.loadedCount/o.totalCount*100}%`}})})]})}),S.jsx("div",{className:"flex-1 overflow-hidden",children:!r&&!t&&n.formats.length===0?S.jsx(Kw,{}):S.jsx(qw,{})})]})}function Xs(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var _m={exports:{}};/*! + +JSZip v3.10.1 - A JavaScript class for generating and reading zip files + + +(c) 2009-2016 Stuart Knightley +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. + +JSZip uses the library pako released under the MIT license : +https://github.com/nodeca/pako/blob/main/LICENSE +*/(function(e,t){(function(n){e.exports=n()})(function(){return function n(r,i,s){function o(d,p){if(!i[d]){if(!r[d]){var y=typeof Xs=="function"&&Xs;if(!p&&y)return y(d,!0);if(a)return a(d,!0);var x=new Error("Cannot find module '"+d+"'");throw x.code="MODULE_NOT_FOUND",x}var g=i[d]={exports:{}};r[d][0].call(g.exports,function(m){var u=r[d][1][m];return o(u||m)},g,g.exports,n,r,i,s)}return i[d].exports}for(var a=typeof Xs=="function"&&Xs,l=0;l>2,g=(3&d)<<4|p>>4,m=1>6:64,u=2>4,p=(15&x)<<4|(g=a.indexOf(l.charAt(u++)))>>2,y=(3&g)<<6|(m=a.indexOf(l.charAt(u++))),h[v++]=d,g!==64&&(h[v++]=p),m!==64&&(h[v++]=y);return h}},{"./support":30,"./utils":32}],2:[function(n,r,i){var s=n("./external"),o=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),l=n("./stream/DataLengthProbe");function d(p,y,x,g,m){this.compressedSize=p,this.uncompressedSize=y,this.crc32=x,this.compression=g,this.compressedContent=m}d.prototype={getContentWorker:function(){var p=new o(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),y=this;return p.on("end",function(){if(this.streamInfo.data_length!==y.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),p},getCompressedWorker:function(){return new o(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},d.createWorkerFrom=function(p,y,x){return p.pipe(new a).pipe(new l("uncompressedSize")).pipe(y.compressWorker(x)).pipe(new l("compressedSize")).withStreamInfo("compression",y)},r.exports=d},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,i){var s=n("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},i.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,i){var s=n("./utils"),o=function(){for(var a,l=[],d=0;d<256;d++){a=d;for(var p=0;p<8;p++)a=1&a?3988292384^a>>>1:a>>>1;l[d]=a}return l}();r.exports=function(a,l){return a!==void 0&&a.length?s.getTypeOf(a)!=="string"?function(d,p,y,x){var g=o,m=x+y;d^=-1;for(var u=x;u>>8^g[255&(d^p[u])];return-1^d}(0|l,a,a.length,0):function(d,p,y,x){var g=o,m=x+y;d^=-1;for(var u=x;u>>8^g[255&(d^p.charCodeAt(u))];return-1^d}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(n,r,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(n,r,i){var s=null;s=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:s}},{lie:37}],7:[function(n,r,i){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=n("pako"),a=n("./utils"),l=n("./stream/GenericWorker"),d=s?"uint8array":"array";function p(y,x){l.call(this,"FlateWorker/"+y),this._pako=null,this._pakoAction=y,this._pakoOptions=x,this.meta={}}i.magic="\b\0",a.inherits(p,l),p.prototype.processChunk=function(y){this.meta=y.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(d,y.data),!1)},p.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},p.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},p.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var y=this;this._pako.onData=function(x){y.push({data:x,meta:y.meta})}},i.compressWorker=function(y){return new p("Deflate",y)},i.uncompressWorker=function(){return new p("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,i){function s(g,m){var u,v="";for(u=0;u>>=8;return v}function o(g,m,u,v,c,h){var w,k,b=g.file,N=g.compression,T=h!==d.utf8encode,P=a.transformTo("string",h(b.name)),O=a.transformTo("string",d.utf8encode(b.name)),M=b.comment,J=a.transformTo("string",h(M)),R=a.transformTo("string",d.utf8encode(M)),W=O.length!==b.name.length,_=R.length!==M.length,V="",ce="",Q="",H=b.dir,U=b.date,ee={crc32:0,compressedSize:0,uncompressedSize:0};m&&!u||(ee.crc32=g.crc32,ee.compressedSize=g.compressedSize,ee.uncompressedSize=g.uncompressedSize);var z=0;m&&(z|=8),T||!W&&!_||(z|=2048);var F=0,A=0;H&&(F|=16),c==="UNIX"?(A=798,F|=function(D,le){var de=D;return D||(de=le?16893:33204),(65535&de)<<16}(b.unixPermissions,H)):(A=20,F|=function(D){return 63&(D||0)}(b.dosPermissions)),w=U.getUTCHours(),w<<=6,w|=U.getUTCMinutes(),w<<=5,w|=U.getUTCSeconds()/2,k=U.getUTCFullYear()-1980,k<<=4,k|=U.getUTCMonth()+1,k<<=5,k|=U.getUTCDate(),W&&(ce=s(1,1)+s(p(P),4)+O,V+="up"+s(ce.length,2)+ce),_&&(Q=s(1,1)+s(p(J),4)+R,V+="uc"+s(Q.length,2)+Q);var B="";return B+=` +\0`,B+=s(z,2),B+=N.magic,B+=s(w,2),B+=s(k,2),B+=s(ee.crc32,4),B+=s(ee.compressedSize,4),B+=s(ee.uncompressedSize,4),B+=s(P.length,2),B+=s(V.length,2),{fileRecord:y.LOCAL_FILE_HEADER+B+P+V,dirRecord:y.CENTRAL_FILE_HEADER+s(A,2)+B+s(J.length,2)+"\0\0\0\0"+s(F,4)+s(v,4)+P+V+J}}var a=n("../utils"),l=n("../stream/GenericWorker"),d=n("../utf8"),p=n("../crc32"),y=n("../signature");function x(g,m,u,v){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=m,this.zipPlatform=u,this.encodeFileName=v,this.streamFiles=g,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(x,l),x.prototype.push=function(g){var m=g.meta.percent||0,u=this.entriesCount,v=this._sources.length;this.accumulate?this.contentBuffer.push(g):(this.bytesWritten+=g.data.length,l.prototype.push.call(this,{data:g.data,meta:{currentFile:this.currentFile,percent:u?(m+100*(u-v-1))/u:100}}))},x.prototype.openedSource=function(g){this.currentSourceOffset=this.bytesWritten,this.currentFile=g.file.name;var m=this.streamFiles&&!g.file.dir;if(m){var u=o(g,m,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:u.fileRecord,meta:{percent:0}})}else this.accumulate=!0},x.prototype.closedSource=function(g){this.accumulate=!1;var m=this.streamFiles&&!g.file.dir,u=o(g,m,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(u.dirRecord),m)this.push({data:function(v){return y.DATA_DESCRIPTOR+s(v.crc32,4)+s(v.compressedSize,4)+s(v.uncompressedSize,4)}(g),meta:{percent:100}});else for(this.push({data:u.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},x.prototype.flush=function(){for(var g=this.bytesWritten,m=0;m=this.index;l--)d=(d<<8)+this.byteAt(l);return this.index+=a,d},readString:function(a){return s.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=o},{"../utils":32}],19:[function(n,r,i){var s=n("./Uint8ArrayReader");function o(a){s.call(this,a)}n("../utils").inherits(o,s),o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,i){var s=n("./DataReader");function o(a){s.call(this,a)}n("../utils").inherits(o,s),o.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},o.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},o.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=o},{"../utils":32,"./DataReader":18}],21:[function(n,r,i){var s=n("./ArrayReader");function o(a){s.call(this,a)}n("../utils").inherits(o,s),o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,i){var s=n("../utils"),o=n("../support"),a=n("./ArrayReader"),l=n("./StringReader"),d=n("./NodeBufferReader"),p=n("./Uint8ArrayReader");r.exports=function(y){var x=s.getTypeOf(y);return s.checkSupport(x),x!=="string"||o.uint8array?x==="nodebuffer"?new d(y):o.uint8array?new p(s.transformTo("uint8array",y)):new a(s.transformTo("array",y)):new l(y)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,i){var s=n("./GenericWorker"),o=n("../utils");function a(l){s.call(this,"ConvertWorker to "+l),this.destType=l}o.inherits(a,s),a.prototype.processChunk=function(l){this.push({data:o.transformTo(this.destType,l.data),meta:l.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,i){var s=n("./GenericWorker"),o=n("../crc32");function a(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,s),a.prototype.processChunk=function(l){this.streamInfo.crc32=o(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,i){var s=n("../utils"),o=n("./GenericWorker");function a(l){o.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}s.inherits(a,o),a.prototype.processChunk=function(l){if(l){var d=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=d+l.data.length}o.prototype.processChunk.call(this,l)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,i){var s=n("../utils"),o=n("./GenericWorker");function a(l){o.call(this,"DataWorker");var d=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(p){d.dataIsReady=!0,d.data=p,d.max=p&&p.length||0,d.type=s.getTypeOf(p),d.isPaused||d._tickAndRepeat()},function(p){d.error(p)})}s.inherits(a,o),a.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,d=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,d);break;case"uint8array":l=this.data.subarray(this.index,d);break;case"array":case"nodebuffer":l=this.data.slice(this.index,d)}return this.index=d,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,i){function s(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,a){return this._listeners[o].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,a){if(this._listeners[o])for(var l=0;l "+o:o}},r.exports=s},{}],29:[function(n,r,i){var s=n("../utils"),o=n("./ConvertWorker"),a=n("./GenericWorker"),l=n("../base64"),d=n("../support"),p=n("../external"),y=null;if(d.nodestream)try{y=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function x(m,u){return new p.Promise(function(v,c){var h=[],w=m._internalType,k=m._outputType,b=m._mimeType;m.on("data",function(N,T){h.push(N),u&&u(T)}).on("error",function(N){h=[],c(N)}).on("end",function(){try{var N=function(T,P,O){switch(T){case"blob":return s.newBlob(s.transformTo("arraybuffer",P),O);case"base64":return l.encode(P);default:return s.transformTo(T,P)}}(k,function(T,P){var O,M=0,J=null,R=0;for(O=0;O"u")i.blob=!1;else{var s=new ArrayBuffer(0);try{i.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(s),i.blob=o.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!n("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,i){for(var s=n("./utils"),o=n("./support"),a=n("./nodejsUtils"),l=n("./stream/GenericWorker"),d=new Array(256),p=0;p<256;p++)d[p]=252<=p?6:248<=p?5:240<=p?4:224<=p?3:192<=p?2:1;d[254]=d[254]=1;function y(){l.call(this,"utf-8 decode"),this.leftOver=null}function x(){l.call(this,"utf-8 encode")}i.utf8encode=function(g){return o.nodebuffer?a.newBufferFrom(g,"utf-8"):function(m){var u,v,c,h,w,k=m.length,b=0;for(h=0;h>>6:(v<65536?u[w++]=224|v>>>12:(u[w++]=240|v>>>18,u[w++]=128|v>>>12&63),u[w++]=128|v>>>6&63),u[w++]=128|63&v);return u}(g)},i.utf8decode=function(g){return o.nodebuffer?s.transformTo("nodebuffer",g).toString("utf-8"):function(m){var u,v,c,h,w=m.length,k=new Array(2*w);for(u=v=0;u>10&1023,k[v++]=56320|1023&c)}return k.length!==v&&(k.subarray?k=k.subarray(0,v):k.length=v),s.applyFromCharCode(k)}(g=s.transformTo(o.uint8array?"uint8array":"array",g))},s.inherits(y,l),y.prototype.processChunk=function(g){var m=s.transformTo(o.uint8array?"uint8array":"array",g.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var u=m;(m=new Uint8Array(u.length+this.leftOver.length)).set(this.leftOver,0),m.set(u,this.leftOver.length)}else m=this.leftOver.concat(m);this.leftOver=null}var v=function(h,w){var k;for((w=w||h.length)>h.length&&(w=h.length),k=w-1;0<=k&&(192&h[k])==128;)k--;return k<0||k===0?w:k+d[h[k]]>w?k:w}(m),c=m;v!==m.length&&(o.uint8array?(c=m.subarray(0,v),this.leftOver=m.subarray(v,m.length)):(c=m.slice(0,v),this.leftOver=m.slice(v,m.length))),this.push({data:i.utf8decode(c),meta:g.meta})},y.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=y,s.inherits(x,l),x.prototype.processChunk=function(g){this.push({data:i.utf8encode(g.data),meta:g.meta})},i.Utf8EncodeWorker=x},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,i){var s=n("./support"),o=n("./base64"),a=n("./nodejsUtils"),l=n("./external");function d(u){return u}function p(u,v){for(var c=0;c>8;this.dir=!!(16&this.externalFileAttributes),g==0&&(this.dosPermissions=63&this.externalFileAttributes),g==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var g=s(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=g.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=g.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=g.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=g.readInt(4))}},readExtraFields:function(g){var m,u,v,c=g.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});g.index+4>>6:(g<65536?x[v++]=224|g>>>12:(x[v++]=240|g>>>18,x[v++]=128|g>>>12&63),x[v++]=128|g>>>6&63),x[v++]=128|63&g);return x},i.buf2binstring=function(y){return p(y,y.length)},i.binstring2buf=function(y){for(var x=new s.Buf8(y.length),g=0,m=x.length;g>10&1023,h[m++]=56320|1023&u)}return p(h,m)},i.utf8border=function(y,x){var g;for((x=x||y.length)>y.length&&(x=y.length),g=x-1;0<=g&&(192&y[g])==128;)g--;return g<0||g===0?x:g+l[y[g]]>x?g:x}},{"./common":41}],43:[function(n,r,i){r.exports=function(s,o,a,l){for(var d=65535&s|0,p=s>>>16&65535|0,y=0;a!==0;){for(a-=y=2e3>>1:o>>>1;a[l]=o}return a}();r.exports=function(o,a,l,d){var p=s,y=d+l;o^=-1;for(var x=d;x>>8^p[255&(o^a[x])];return-1^o}},{}],46:[function(n,r,i){var s,o=n("../utils/common"),a=n("./trees"),l=n("./adler32"),d=n("./crc32"),p=n("./messages"),y=0,x=4,g=0,m=-2,u=-1,v=4,c=2,h=8,w=9,k=286,b=30,N=19,T=2*k+1,P=15,O=3,M=258,J=M+O+1,R=42,W=113,_=1,V=2,ce=3,Q=4;function H(f,I){return f.msg=p[I],I}function U(f){return(f<<1)-(4f.avail_out&&(L=f.avail_out),L!==0&&(o.arraySet(f.output,I.pending_buf,I.pending_out,L,f.next_out),f.next_out+=L,I.pending_out+=L,f.total_out+=L,f.avail_out-=L,I.pending-=L,I.pending===0&&(I.pending_out=0))}function F(f,I){a._tr_flush_block(f,0<=f.block_start?f.block_start:-1,f.strstart-f.block_start,I),f.block_start=f.strstart,z(f.strm)}function A(f,I){f.pending_buf[f.pending++]=I}function B(f,I){f.pending_buf[f.pending++]=I>>>8&255,f.pending_buf[f.pending++]=255&I}function D(f,I){var L,C,E=f.max_chain_length,j=f.strstart,Y=f.prev_length,G=f.nice_match,$=f.strstart>f.w_size-J?f.strstart-(f.w_size-J):0,ie=f.window,fe=f.w_mask,oe=f.prev,pe=f.strstart+M,ve=ie[j+Y-1],ye=ie[j+Y];f.prev_length>=f.good_match&&(E>>=2),G>f.lookahead&&(G=f.lookahead);do if(ie[(L=I)+Y]===ye&&ie[L+Y-1]===ve&&ie[L]===ie[j]&&ie[++L]===ie[j+1]){j+=2,L++;do;while(ie[++j]===ie[++L]&&ie[++j]===ie[++L]&&ie[++j]===ie[++L]&&ie[++j]===ie[++L]&&ie[++j]===ie[++L]&&ie[++j]===ie[++L]&&ie[++j]===ie[++L]&&ie[++j]===ie[++L]&&j$&&--E!=0);return Y<=f.lookahead?Y:f.lookahead}function le(f){var I,L,C,E,j,Y,G,$,ie,fe,oe=f.w_size;do{if(E=f.window_size-f.lookahead-f.strstart,f.strstart>=oe+(oe-J)){for(o.arraySet(f.window,f.window,oe,oe,0),f.match_start-=oe,f.strstart-=oe,f.block_start-=oe,I=L=f.hash_size;C=f.head[--I],f.head[I]=oe<=C?C-oe:0,--L;);for(I=L=oe;C=f.prev[--I],f.prev[I]=oe<=C?C-oe:0,--L;);E+=oe}if(f.strm.avail_in===0)break;if(Y=f.strm,G=f.window,$=f.strstart+f.lookahead,ie=E,fe=void 0,fe=Y.avail_in,ie=O)for(j=f.strstart-f.insert,f.ins_h=f.window[j],f.ins_h=(f.ins_h<=O&&(f.ins_h=(f.ins_h<=O)if(C=a._tr_tally(f,f.strstart-f.match_start,f.match_length-O),f.lookahead-=f.match_length,f.match_length<=f.max_lazy_match&&f.lookahead>=O){for(f.match_length--;f.strstart++,f.ins_h=(f.ins_h<=O&&(f.ins_h=(f.ins_h<=O&&f.match_length<=f.prev_length){for(E=f.strstart+f.lookahead-O,C=a._tr_tally(f,f.strstart-1-f.prev_match,f.prev_length-O),f.lookahead-=f.prev_length-1,f.prev_length-=2;++f.strstart<=E&&(f.ins_h=(f.ins_h<f.pending_buf_size-5&&(L=f.pending_buf_size-5);;){if(f.lookahead<=1){if(le(f),f.lookahead===0&&I===y)return _;if(f.lookahead===0)break}f.strstart+=f.lookahead,f.lookahead=0;var C=f.block_start+L;if((f.strstart===0||f.strstart>=C)&&(f.lookahead=f.strstart-C,f.strstart=C,F(f,!1),f.strm.avail_out===0)||f.strstart-f.block_start>=f.w_size-J&&(F(f,!1),f.strm.avail_out===0))return _}return f.insert=0,I===x?(F(f,!0),f.strm.avail_out===0?ce:Q):(f.strstart>f.block_start&&(F(f,!1),f.strm.avail_out),_)}),new se(4,4,8,4,de),new se(4,5,16,8,de),new se(4,6,32,32,de),new se(4,4,16,16,ue),new se(8,16,32,32,ue),new se(8,16,128,128,ue),new se(8,32,128,256,ue),new se(32,128,258,1024,ue),new se(32,258,258,4096,ue)],i.deflateInit=function(f,I){return ne(f,I,h,15,8,0)},i.deflateInit2=ne,i.deflateReset=q,i.deflateResetKeep=re,i.deflateSetHeader=function(f,I){return f&&f.state?f.state.wrap!==2?m:(f.state.gzhead=I,g):m},i.deflate=function(f,I){var L,C,E,j;if(!f||!f.state||5>8&255),A(C,C.gzhead.time>>16&255),A(C,C.gzhead.time>>24&255),A(C,C.level===9?2:2<=C.strategy||C.level<2?4:0),A(C,255&C.gzhead.os),C.gzhead.extra&&C.gzhead.extra.length&&(A(C,255&C.gzhead.extra.length),A(C,C.gzhead.extra.length>>8&255)),C.gzhead.hcrc&&(f.adler=d(f.adler,C.pending_buf,C.pending,0)),C.gzindex=0,C.status=69):(A(C,0),A(C,0),A(C,0),A(C,0),A(C,0),A(C,C.level===9?2:2<=C.strategy||C.level<2?4:0),A(C,3),C.status=W);else{var Y=h+(C.w_bits-8<<4)<<8;Y|=(2<=C.strategy||C.level<2?0:C.level<6?1:C.level===6?2:3)<<6,C.strstart!==0&&(Y|=32),Y+=31-Y%31,C.status=W,B(C,Y),C.strstart!==0&&(B(C,f.adler>>>16),B(C,65535&f.adler)),f.adler=1}if(C.status===69)if(C.gzhead.extra){for(E=C.pending;C.gzindex<(65535&C.gzhead.extra.length)&&(C.pending!==C.pending_buf_size||(C.gzhead.hcrc&&C.pending>E&&(f.adler=d(f.adler,C.pending_buf,C.pending-E,E)),z(f),E=C.pending,C.pending!==C.pending_buf_size));)A(C,255&C.gzhead.extra[C.gzindex]),C.gzindex++;C.gzhead.hcrc&&C.pending>E&&(f.adler=d(f.adler,C.pending_buf,C.pending-E,E)),C.gzindex===C.gzhead.extra.length&&(C.gzindex=0,C.status=73)}else C.status=73;if(C.status===73)if(C.gzhead.name){E=C.pending;do{if(C.pending===C.pending_buf_size&&(C.gzhead.hcrc&&C.pending>E&&(f.adler=d(f.adler,C.pending_buf,C.pending-E,E)),z(f),E=C.pending,C.pending===C.pending_buf_size)){j=1;break}j=C.gzindexE&&(f.adler=d(f.adler,C.pending_buf,C.pending-E,E)),j===0&&(C.gzindex=0,C.status=91)}else C.status=91;if(C.status===91)if(C.gzhead.comment){E=C.pending;do{if(C.pending===C.pending_buf_size&&(C.gzhead.hcrc&&C.pending>E&&(f.adler=d(f.adler,C.pending_buf,C.pending-E,E)),z(f),E=C.pending,C.pending===C.pending_buf_size)){j=1;break}j=C.gzindexE&&(f.adler=d(f.adler,C.pending_buf,C.pending-E,E)),j===0&&(C.status=103)}else C.status=103;if(C.status===103&&(C.gzhead.hcrc?(C.pending+2>C.pending_buf_size&&z(f),C.pending+2<=C.pending_buf_size&&(A(C,255&f.adler),A(C,f.adler>>8&255),f.adler=0,C.status=W)):C.status=W),C.pending!==0){if(z(f),f.avail_out===0)return C.last_flush=-1,g}else if(f.avail_in===0&&U(I)<=U(L)&&I!==x)return H(f,-5);if(C.status===666&&f.avail_in!==0)return H(f,-5);if(f.avail_in!==0||C.lookahead!==0||I!==y&&C.status!==666){var G=C.strategy===2?function($,ie){for(var fe;;){if($.lookahead===0&&(le($),$.lookahead===0)){if(ie===y)return _;break}if($.match_length=0,fe=a._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++,fe&&(F($,!1),$.strm.avail_out===0))return _}return $.insert=0,ie===x?(F($,!0),$.strm.avail_out===0?ce:Q):$.last_lit&&(F($,!1),$.strm.avail_out===0)?_:V}(C,I):C.strategy===3?function($,ie){for(var fe,oe,pe,ve,ye=$.window;;){if($.lookahead<=M){if(le($),$.lookahead<=M&&ie===y)return _;if($.lookahead===0)break}if($.match_length=0,$.lookahead>=O&&0<$.strstart&&(oe=ye[pe=$.strstart-1])===ye[++pe]&&oe===ye[++pe]&&oe===ye[++pe]){ve=$.strstart+M;do;while(oe===ye[++pe]&&oe===ye[++pe]&&oe===ye[++pe]&&oe===ye[++pe]&&oe===ye[++pe]&&oe===ye[++pe]&&oe===ye[++pe]&&oe===ye[++pe]&&pe$.lookahead&&($.match_length=$.lookahead)}if($.match_length>=O?(fe=a._tr_tally($,1,$.match_length-O),$.lookahead-=$.match_length,$.strstart+=$.match_length,$.match_length=0):(fe=a._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++),fe&&(F($,!1),$.strm.avail_out===0))return _}return $.insert=0,ie===x?(F($,!0),$.strm.avail_out===0?ce:Q):$.last_lit&&(F($,!1),$.strm.avail_out===0)?_:V}(C,I):s[C.level].func(C,I);if(G!==ce&&G!==Q||(C.status=666),G===_||G===ce)return f.avail_out===0&&(C.last_flush=-1),g;if(G===V&&(I===1?a._tr_align(C):I!==5&&(a._tr_stored_block(C,0,0,!1),I===3&&(ee(C.head),C.lookahead===0&&(C.strstart=0,C.block_start=0,C.insert=0))),z(f),f.avail_out===0))return C.last_flush=-1,g}return I!==x?g:C.wrap<=0?1:(C.wrap===2?(A(C,255&f.adler),A(C,f.adler>>8&255),A(C,f.adler>>16&255),A(C,f.adler>>24&255),A(C,255&f.total_in),A(C,f.total_in>>8&255),A(C,f.total_in>>16&255),A(C,f.total_in>>24&255)):(B(C,f.adler>>>16),B(C,65535&f.adler)),z(f),0=L.w_size&&(j===0&&(ee(L.head),L.strstart=0,L.block_start=0,L.insert=0),ie=new o.Buf8(L.w_size),o.arraySet(ie,I,fe-L.w_size,L.w_size,0),I=ie,fe=L.w_size),Y=f.avail_in,G=f.next_in,$=f.input,f.avail_in=fe,f.next_in=0,f.input=I,le(L);L.lookahead>=O;){for(C=L.strstart,E=L.lookahead-(O-1);L.ins_h=(L.ins_h<>>=O=P>>>24,w-=O,(O=P>>>16&255)===0)V[p++]=65535&P;else{if(!(16&O)){if(!(64&O)){P=k[(65535&P)+(h&(1<>>=O,w-=O),w<15&&(h+=_[l++]<>>=O=P>>>24,w-=O,!(16&(O=P>>>16&255))){if(!(64&O)){P=b[(65535&P)+(h&(1<>>=O,w-=O,(O=p-y)>3,h&=(1<<(w-=M<<3))-1,s.next_in=l,s.next_out=p,s.avail_in=l>>24&255)+(R>>>8&65280)+((65280&R)<<8)+((255&R)<<24)}function h(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function w(R){var W;return R&&R.state?(W=R.state,R.total_in=R.total_out=W.total=0,R.msg="",W.wrap&&(R.adler=1&W.wrap),W.mode=m,W.last=0,W.havedict=0,W.dmax=32768,W.head=null,W.hold=0,W.bits=0,W.lencode=W.lendyn=new s.Buf32(u),W.distcode=W.distdyn=new s.Buf32(v),W.sane=1,W.back=-1,x):g}function k(R){var W;return R&&R.state?((W=R.state).wsize=0,W.whave=0,W.wnext=0,w(R)):g}function b(R,W){var _,V;return R&&R.state?(V=R.state,W<0?(_=0,W=-W):(_=1+(W>>4),W<48&&(W&=15)),W&&(W<8||15=Q.wsize?(s.arraySet(Q.window,W,_-Q.wsize,Q.wsize,0),Q.wnext=0,Q.whave=Q.wsize):(V<(ce=Q.wsize-Q.wnext)&&(ce=V),s.arraySet(Q.window,W,_-V,ce,Q.wnext),(V-=ce)?(s.arraySet(Q.window,W,_-V,V,0),Q.wnext=V,Q.whave=Q.wsize):(Q.wnext+=ce,Q.wnext===Q.wsize&&(Q.wnext=0),Q.whave>>8&255,_.check=a(_.check,j,2,0),F=z=0,_.mode=2;break}if(_.flags=0,_.head&&(_.head.done=!1),!(1&_.wrap)||(((255&z)<<8)+(z>>8))%31){R.msg="incorrect header check",_.mode=30;break}if((15&z)!=8){R.msg="unknown compression method",_.mode=30;break}if(F-=4,f=8+(15&(z>>>=4)),_.wbits===0)_.wbits=f;else if(f>_.wbits){R.msg="invalid window size",_.mode=30;break}_.dmax=1<>8&1),512&_.flags&&(j[0]=255&z,j[1]=z>>>8&255,_.check=a(_.check,j,2,0)),F=z=0,_.mode=3;case 3:for(;F<32;){if(U===0)break e;U--,z+=V[Q++]<>>8&255,j[2]=z>>>16&255,j[3]=z>>>24&255,_.check=a(_.check,j,4,0)),F=z=0,_.mode=4;case 4:for(;F<16;){if(U===0)break e;U--,z+=V[Q++]<>8),512&_.flags&&(j[0]=255&z,j[1]=z>>>8&255,_.check=a(_.check,j,2,0)),F=z=0,_.mode=5;case 5:if(1024&_.flags){for(;F<16;){if(U===0)break e;U--,z+=V[Q++]<>>8&255,_.check=a(_.check,j,2,0)),F=z=0}else _.head&&(_.head.extra=null);_.mode=6;case 6:if(1024&_.flags&&(U<(D=_.length)&&(D=U),D&&(_.head&&(f=_.head.extra_len-_.length,_.head.extra||(_.head.extra=new Array(_.head.extra_len)),s.arraySet(_.head.extra,V,Q,D,f)),512&_.flags&&(_.check=a(_.check,V,D,Q)),U-=D,Q+=D,_.length-=D),_.length))break e;_.length=0,_.mode=7;case 7:if(2048&_.flags){if(U===0)break e;for(D=0;f=V[Q+D++],_.head&&f&&_.length<65536&&(_.head.name+=String.fromCharCode(f)),f&&D>9&1,_.head.done=!0),R.adler=_.check=0,_.mode=12;break;case 10:for(;F<32;){if(U===0)break e;U--,z+=V[Q++]<>>=7&F,F-=7&F,_.mode=27;break}for(;F<3;){if(U===0)break e;U--,z+=V[Q++]<>>=1)){case 0:_.mode=14;break;case 1:if(M(_),_.mode=20,W!==6)break;z>>>=2,F-=2;break e;case 2:_.mode=17;break;case 3:R.msg="invalid block type",_.mode=30}z>>>=2,F-=2;break;case 14:for(z>>>=7&F,F-=7&F;F<32;){if(U===0)break e;U--,z+=V[Q++]<>>16^65535)){R.msg="invalid stored block lengths",_.mode=30;break}if(_.length=65535&z,F=z=0,_.mode=15,W===6)break e;case 15:_.mode=16;case 16:if(D=_.length){if(U>>=5,F-=5,_.ndist=1+(31&z),z>>>=5,F-=5,_.ncode=4+(15&z),z>>>=4,F-=4,286<_.nlen||30<_.ndist){R.msg="too many length or distance symbols",_.mode=30;break}_.have=0,_.mode=18;case 18:for(;_.have<_.ncode;){for(;F<3;){if(U===0)break e;U--,z+=V[Q++]<>>=3,F-=3}for(;_.have<19;)_.lens[Y[_.have++]]=0;if(_.lencode=_.lendyn,_.lenbits=7,L={bits:_.lenbits},I=d(0,_.lens,0,19,_.lencode,0,_.work,L),_.lenbits=L.bits,I){R.msg="invalid code lengths set",_.mode=30;break}_.have=0,_.mode=19;case 19:for(;_.have<_.nlen+_.ndist;){for(;se=(E=_.lencode[z&(1<<_.lenbits)-1])>>>16&255,X=65535&E,!((ue=E>>>24)<=F);){if(U===0)break e;U--,z+=V[Q++]<>>=ue,F-=ue,_.lens[_.have++]=X;else{if(X===16){for(C=ue+2;F>>=ue,F-=ue,_.have===0){R.msg="invalid bit length repeat",_.mode=30;break}f=_.lens[_.have-1],D=3+(3&z),z>>>=2,F-=2}else if(X===17){for(C=ue+3;F>>=ue)),z>>>=3,F-=3}else{for(C=ue+7;F>>=ue)),z>>>=7,F-=7}if(_.have+D>_.nlen+_.ndist){R.msg="invalid bit length repeat",_.mode=30;break}for(;D--;)_.lens[_.have++]=f}}if(_.mode===30)break;if(_.lens[256]===0){R.msg="invalid code -- missing end-of-block",_.mode=30;break}if(_.lenbits=9,L={bits:_.lenbits},I=d(p,_.lens,0,_.nlen,_.lencode,0,_.work,L),_.lenbits=L.bits,I){R.msg="invalid literal/lengths set",_.mode=30;break}if(_.distbits=6,_.distcode=_.distdyn,L={bits:_.distbits},I=d(y,_.lens,_.nlen,_.ndist,_.distcode,0,_.work,L),_.distbits=L.bits,I){R.msg="invalid distances set",_.mode=30;break}if(_.mode=20,W===6)break e;case 20:_.mode=21;case 21:if(6<=U&&258<=ee){R.next_out=H,R.avail_out=ee,R.next_in=Q,R.avail_in=U,_.hold=z,_.bits=F,l(R,B),H=R.next_out,ce=R.output,ee=R.avail_out,Q=R.next_in,V=R.input,U=R.avail_in,z=_.hold,F=_.bits,_.mode===12&&(_.back=-1);break}for(_.back=0;se=(E=_.lencode[z&(1<<_.lenbits)-1])>>>16&255,X=65535&E,!((ue=E>>>24)<=F);){if(U===0)break e;U--,z+=V[Q++]<>re)])>>>16&255,X=65535&E,!(re+(ue=E>>>24)<=F);){if(U===0)break e;U--,z+=V[Q++]<>>=re,F-=re,_.back+=re}if(z>>>=ue,F-=ue,_.back+=ue,_.length=X,se===0){_.mode=26;break}if(32&se){_.back=-1,_.mode=12;break}if(64&se){R.msg="invalid literal/length code",_.mode=30;break}_.extra=15&se,_.mode=22;case 22:if(_.extra){for(C=_.extra;F>>=_.extra,F-=_.extra,_.back+=_.extra}_.was=_.length,_.mode=23;case 23:for(;se=(E=_.distcode[z&(1<<_.distbits)-1])>>>16&255,X=65535&E,!((ue=E>>>24)<=F);){if(U===0)break e;U--,z+=V[Q++]<>re)])>>>16&255,X=65535&E,!(re+(ue=E>>>24)<=F);){if(U===0)break e;U--,z+=V[Q++]<>>=re,F-=re,_.back+=re}if(z>>>=ue,F-=ue,_.back+=ue,64&se){R.msg="invalid distance code",_.mode=30;break}_.offset=X,_.extra=15&se,_.mode=24;case 24:if(_.extra){for(C=_.extra;F>>=_.extra,F-=_.extra,_.back+=_.extra}if(_.offset>_.dmax){R.msg="invalid distance too far back",_.mode=30;break}_.mode=25;case 25:if(ee===0)break e;if(D=B-ee,_.offset>D){if((D=_.offset-D)>_.whave&&_.sane){R.msg="invalid distance too far back",_.mode=30;break}le=D>_.wnext?(D-=_.wnext,_.wsize-D):_.wnext-D,D>_.length&&(D=_.length),de=_.window}else de=ce,le=H-_.offset,D=_.length;for(eeT?(O=le[de+v[W]],F[A+v[W]]):(O=96,0),h=1<>H)+(w-=h)]=P<<24|O<<16|M|0,w!==0;);for(h=1<>=1;if(h!==0?(z&=h-1,z+=h):z=0,W++,--B[R]==0){if(R===V)break;R=y[x+v[W]]}if(ce>>7)]}function A(E,j){E.pending_buf[E.pending++]=255&j,E.pending_buf[E.pending++]=j>>>8&255}function B(E,j,Y){E.bi_valid>c-Y?(E.bi_buf|=j<>c-E.bi_valid,E.bi_valid+=Y-c):(E.bi_buf|=j<>>=1,Y<<=1,0<--j;);return Y>>>1}function de(E,j,Y){var G,$,ie=new Array(v+1),fe=0;for(G=1;G<=v;G++)ie[G]=fe=fe+Y[G-1]<<1;for($=0;$<=j;$++){var oe=E[2*$+1];oe!==0&&(E[2*$]=le(ie[oe]++,oe))}}function ue(E){var j;for(j=0;j>1;1<=Y;Y--)re(E,ie,Y);for($=pe;Y=E.heap[1],E.heap[1]=E.heap[E.heap_len--],re(E,ie,1),G=E.heap[1],E.heap[--E.heap_max]=Y,E.heap[--E.heap_max]=G,ie[2*$]=ie[2*Y]+ie[2*G],E.depth[$]=(E.depth[Y]>=E.depth[G]?E.depth[Y]:E.depth[G])+1,ie[2*Y+1]=ie[2*G+1]=$,E.heap[1]=$++,re(E,ie,1),2<=E.heap_len;);E.heap[--E.heap_max]=E.heap[1],function(ye,We){var Jt,at,en,be,pn,tn,tt=We.dyn_tree,Pn=We.max_code,jr=We.stat_desc.static_tree,Tt=We.stat_desc.has_stree,_e=We.stat_desc.extra_bits,Te=We.stat_desc.extra_base,Ae=We.stat_desc.max_length,je=0;for(be=0;be<=v;be++)ye.bl_count[be]=0;for(tt[2*ye.heap[ye.heap_max]+1]=0,Jt=ye.heap_max+1;Jt>=7;$>>=1)if(1&ve&&oe.dyn_ltree[2*pe]!==0)return o;if(oe.dyn_ltree[18]!==0||oe.dyn_ltree[20]!==0||oe.dyn_ltree[26]!==0)return a;for(pe=32;pe>>3,(ie=E.static_len+3+7>>>3)<=$&&($=ie)):$=ie=Y+5,Y+4<=$&&j!==-1?C(E,j,Y,G):E.strategy===4||ie===$?(B(E,2+(G?1:0),3),q(E,J,R)):(B(E,4+(G?1:0),3),function(oe,pe,ve,ye){var We;for(B(oe,pe-257,5),B(oe,ve-1,5),B(oe,ye-4,4),We=0;We>>8&255,E.pending_buf[E.d_buf+2*E.last_lit+1]=255&j,E.pending_buf[E.l_buf+E.last_lit]=255&Y,E.last_lit++,j===0?E.dyn_ltree[2*Y]++:(E.matches++,j--,E.dyn_ltree[2*(_[Y]+y+1)]++,E.dyn_dtree[2*F(j)]++),E.last_lit===E.lit_bufsize-1},i._tr_align=function(E){B(E,2,3),D(E,w,J),function(j){j.bi_valid===16?(A(j,j.bi_buf),j.bi_buf=0,j.bi_valid=0):8<=j.bi_valid&&(j.pending_buf[j.pending++]=255&j.bi_buf,j.bi_buf>>=8,j.bi_valid-=8)}(E)}},{"../utils/common":41}],53:[function(n,r,i){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,i){(function(s){(function(o,a){if(!o.setImmediate){var l,d,p,y,x=1,g={},m=!1,u=o.document,v=Object.getPrototypeOf&&Object.getPrototypeOf(o);v=v&&v.setTimeout?v:o,l={}.toString.call(o.process)==="[object process]"?function(k){process.nextTick(function(){h(k)})}:function(){if(o.postMessage&&!o.importScripts){var k=!0,b=o.onmessage;return o.onmessage=function(){k=!1},o.postMessage("","*"),o.onmessage=b,k}}()?(y="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",w,!1):o.attachEvent("onmessage",w),function(k){o.postMessage(y+k,"*")}):o.MessageChannel?((p=new MessageChannel).port1.onmessage=function(k){h(k.data)},function(k){p.port2.postMessage(k)}):u&&"onreadystatechange"in u.createElement("script")?(d=u.documentElement,function(k){var b=u.createElement("script");b.onreadystatechange=function(){h(k),b.onreadystatechange=null,d.removeChild(b),b=null},d.appendChild(b)}):function(k){setTimeout(h,0,k)},v.setImmediate=function(k){typeof k!="function"&&(k=new Function(""+k));for(var b=new Array(arguments.length-1),N=0;N"u"?s===void 0?this:s:self)}).call(this,typeof Es<"u"?Es:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(_m);var Xw=_m.exports;const hf=su(Xw);function pf(){const{selectedImage:e,selectedImages:t,currentLibraryId:n,selectedFolder:r,images:i,setMobileView:s,isResizingPanels:o,resizingSide:a}=me(),[l,d]=Z.useState(!1),[p,y]=Z.useState(""),[x,g]=Z.useState(!1),[m,u]=Z.useState(!1),[v,c]=Z.useState(!1),[h,w]=Z.useState(0),[k,b]=Z.useState(!1),[N,T]=Z.useState(0),P=t.length>0,O=P?t[0]:e;if(Z.useEffect(()=>{const A=()=>{d(window.innerWidth<768)};return A(),window.addEventListener("resize",A),()=>window.removeEventListener("resize",A)},[]),Z.useEffect(()=>{if(!e||!n){y("");return}const A=M();if(y(A),g(!0),o){g(!1);return}const B=J(),D=new Image;return D.onload=()=>{y(B),g(!1)},D.onerror=()=>{console.error("Failed to load original image"),g(!1)},D.src=B,()=>{D.onload=null,D.onerror=null}},[e,n,o,a]),!e&&t.length===0)return S.jsx("div",{className:"w-full border-l border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 flex items-center justify-center",children:S.jsx("p",{className:"text-gray-400 dark:text-gray-500 text-sm",children:"选择图片查看详情"})});const M=()=>{if(!n||!e.thumbnail_path)return"";const A=e.thumbnail_path.replace(/\\/g,"/").split("/").pop();return Me.getThumbnailUrl(n,"200",A)},J=()=>!n||!e.path?"":Me.getOriginalUrl(n,e.path),R=()=>typeof ClipboardItem<"u"&&navigator.clipboard&&typeof navigator.clipboard.write=="function",W=async A=>new Promise(B=>{const D=document.createElement("div");D.setAttribute("contenteditable","true"),D.style.position="fixed",D.style.left="-9999px",D.style.top="-9999px",D.style.opacity="0",document.body.appendChild(D);const le=document.createElement("img");le.crossOrigin="anonymous",le.onload=()=>{D.appendChild(le);const de=document.createRange();de.selectNodeContents(D);const ue=window.getSelection();ue.removeAllRanges(),ue.addRange(de);let se=!1;try{se=document.execCommand("copy")}catch(X){console.error("execCommand copy 失败:",X)}ue.removeAllRanges(),document.body.removeChild(D),B(se)},le.onerror=()=>{document.body.removeChild(D),B(!1)},le.src=A}),_=async A=>new Promise(async B=>{try{const le=await(await fetch(A)).blob(),de=new Image;de.crossOrigin="anonymous";const ue=new Promise((C,E)=>{de.onload=C,de.onerror=E});de.src=URL.createObjectURL(le),await ue;const se=document.createElement("canvas");se.width=de.width,se.height=de.height,se.getContext("2d").drawImage(de,0,0),URL.revokeObjectURL(de.src);const re=se.toDataURL("image/png"),q=document.createElement("div");q.setAttribute("contenteditable","true"),q.style.position="fixed",q.style.left="-9999px",q.style.top="-9999px",q.style.opacity="0",document.body.appendChild(q);const ne=document.createElement("img");ne.src=re,q.appendChild(ne),await new Promise(C=>setTimeout(C,50));const f=document.createRange();f.selectNodeContents(q);const I=window.getSelection();I.removeAllRanges(),I.addRange(f);let L=!1;try{L=document.execCommand("copy")}catch(C){console.error("execCommand copy 失败:",C)}I.removeAllRanges(),document.body.removeChild(q),B(L)}catch(D){console.error("Canvas 复制失败:",D),B(!1)}}),V=A=>{const B=document.createElement("textarea");B.value=A,B.style.position="fixed",B.style.left="-9999px",B.style.top="-9999px",document.body.appendChild(B),B.focus(),B.select();try{return document.execCommand("copy"),!0}catch(D){return console.error("execCommand 复制失败:",D),!1}finally{document.body.removeChild(B)}},ce=async()=>{try{const A=Me.getOriginalUrl(n,e.path);if(R())try{const ue=await(await fetch(A)).blob(),se=new Image,X=new Promise((I,L)=>{se.onload=I,se.onerror=L});se.src=URL.createObjectURL(ue),await X;const re=document.createElement("canvas");re.width=se.width,re.height=se.height,re.getContext("2d").drawImage(se,0,0),URL.revokeObjectURL(se.src);const ne=await new Promise(I=>{re.toBlob(I,"image/png")}),f=new ClipboardItem({"image/png":ne});await navigator.clipboard.write([f]),u(!0),setTimeout(()=>u(!1),2e3);return}catch(de){console.warn("Clipboard API 失败,尝试备用方案:",de)}if(console.log("尝试 Canvas + execCommand 方案..."),await _(A)){u(!0),setTimeout(()=>u(!1),2e3);return}if(console.log("尝试直接图片 URL 方案..."),await W(A)){u(!0),setTimeout(()=>u(!1),2e3);return}console.warn("所有图片复制方案失败,降级为复制链接"),V(A)?(u(!0),setTimeout(()=>u(!1),2e3),alert(`已复制图片链接到剪贴板 +(当前浏览器环境限制,无法直接复制图片)`)):alert(`复制失败,请手动复制图片链接: +`+A)}catch(A){console.error("复制图片失败:",A),alert("复制图片失败,请重试")}},Q=async A=>new Promise(async B=>{try{const D=document.createElement("div");D.setAttribute("contenteditable","true"),D.style.position="fixed",D.style.left="-9999px",D.style.top="-9999px",D.style.opacity="0",document.body.appendChild(D);for(const{url:se,filename:X}of A)try{const q=await(await fetch(se)).blob(),ne=new Image;ne.crossOrigin="anonymous",await new Promise((E,j)=>{ne.onload=E,ne.onerror=j,ne.src=URL.createObjectURL(q)});const f=document.createElement("canvas");f.width=ne.width,f.height=ne.height,f.getContext("2d").drawImage(ne,0,0),URL.revokeObjectURL(ne.src);const L=f.toDataURL("image/png"),C=document.createElement("img");C.src=L,C.alt=X,C.style.display="block",C.style.marginBottom="10px",D.appendChild(C)}catch(re){console.error(`加载图片失败: ${X}`,re)}await new Promise(se=>setTimeout(se,100));const le=document.createRange();le.selectNodeContents(D);const de=window.getSelection();de.removeAllRanges(),de.addRange(le);let ue=!1;try{ue=document.execCommand("copy")}catch(se){console.error("execCommand copy 失败:",se)}de.removeAllRanges(),document.body.removeChild(D),B(ue)}catch(D){console.error("批量复制图片失败:",D),B(!1)}}),H=async()=>{try{const A=P?t:[e];if(A.length===1){await ce();return}const B=A.map(ue=>({url:Me.getOriginalUrl(n,ue.path),filename:ue.filename})),D=A.map(ue=>ue.filename).join(` +`);if(R())try{const se=(await Promise.all(A.map(async X=>{const re=Me.getOriginalUrl(n,X.path),ne=await(await fetch(re)).blob();return new Promise(f=>{const I=new FileReader;I.onloadend=()=>{f({dataUrl:I.result,filename:X.filename})},I.readAsDataURL(ne)})}))).map(({dataUrl:X,filename:re})=>`${re}`).join(` +`);await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([se],{type:"text/html"}),"text/plain":new Blob([D],{type:"text/plain"})})]),u(!0),setTimeout(()=>u(!1),2e3);return}catch(ue){console.warn("Clipboard API 失败,尝试备用方案:",ue)}if(console.log("尝试 contenteditable 批量复制方案..."),await Q(B)){u(!0),setTimeout(()=>u(!1),2e3);return}console.warn("批量图片复制失败,降级为复制文件名"),V(D)?(u(!0),setTimeout(()=>u(!1),2e3),alert(`已复制 ${A.length} 个文件名到剪贴板 +(当前环境限制,建议使用"导出"功能)`)):alert('复制失败,请使用"导出"功能下载图片')}catch(A){console.error("复制图片失败:",A),alert("复制图片失败,请重试")}},U=async()=>{c(!0);try{const A=P?t:[e];if(A.length===1){const B=Me.getOriginalUrl(n,A[0].path),D=document.createElement("a");D.href=B,D.download=A[0].filename,D.target="_blank",document.body.appendChild(D),D.click(),document.body.removeChild(D)}else{const B=new hf,D=B.folder("images");w(0);for(let ue=0;ue{if(!r){alert("请先选择一个文件夹");return}b(!0),T(0);try{const A=i.filter(se=>se.folder&&se.folder.startsWith(r));if(A.length===0){alert("当前文件夹没有图片");return}const B=new hf,D=r.split("/").pop()||"images",le=B.folder(D);for(let se=0;seA<1024?A+" B":A<1024*1024?(A/1024).toFixed(2)+" KB":(A/(1024*1024)).toFixed(2)+" MB",F=A=>new Date(A).toLocaleString("zh-CN");return S.jsxs("div",{className:"w-full border-l border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 flex flex-col h-full",children:[l&&S.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700 flex items-center",children:S.jsxs("button",{onClick:()=>s("main"),className:"flex items-center gap-2 text-gray-700 dark:text-gray-300 hover:text-blue-500",children:[S.jsx(V1,{className:"w-5 h-5"}),S.jsx("span",{className:"text-sm font-medium",children:"返回"})]})}),S.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700 flex-shrink-0",children:S.jsxs("div",{className:"w-full aspect-square bg-gray-100 dark:bg-gray-700 rounded-lg overflow-hidden relative",children:[S.jsx("img",{src:p,alt:O.filename,decoding:"async",className:`w-full h-full object-contain transition-opacity duration-300 ${x?"opacity-75":"opacity-100"}`}),x&&S.jsx("div",{className:"absolute top-2 right-2 bg-blue-500 text-white text-xs px-2 py-1 rounded",children:"加载原图中..."})]})}),S.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 min-h-0",children:S.jsxs("div",{children:[S.jsx("h3",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300 mb-2",children:"基本信息"}),S.jsxs("div",{className:"space-y-2 text-sm",children:[S.jsxs("div",{children:[S.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"文件名:"}),S.jsx("p",{className:"text-gray-900 dark:text-gray-100 break-all",children:e.filename})]}),S.jsxs("div",{children:[S.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"尺寸:"}),S.jsxs("p",{className:"text-gray-900 dark:text-gray-100",children:[e.width," × ",e.height]})]}),S.jsxs("div",{children:[S.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"大小:"}),S.jsx("p",{className:"text-gray-900 dark:text-gray-100",children:z(e.size)})]}),S.jsxs("div",{children:[S.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"格式:"}),S.jsx("p",{className:"text-gray-900 dark:text-gray-100 uppercase",children:e.format})]}),S.jsxs("div",{children:[S.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"创建时间:"}),S.jsx("p",{className:"text-gray-900 dark:text-gray-100",children:F(e.created_at)})]}),S.jsxs("div",{children:[S.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"修改时间:"}),S.jsx("p",{className:"text-gray-900 dark:text-gray-100",children:F(e.modified_at)})]}),S.jsxs("div",{children:[S.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"路径:"}),S.jsx("p",{className:"text-gray-900 dark:text-gray-100 text-xs break-all",children:e.path})]})]})]})}),!l&&S.jsxs("div",{className:"p-4 border-t border-gray-200 dark:border-gray-700 space-y-2 flex-shrink-0",children:[S.jsx("button",{onClick:H,className:`w-full flex items-center justify-center gap-2 px-4 py-2 rounded-lg transition-all ${m?"bg-green-500 text-white":"bg-blue-500 text-white hover:bg-blue-600"}`,children:m?S.jsxs(S.Fragment,{children:[S.jsx(q1,{className:"w-4 h-4"}),S.jsxs("span",{children:["已复制",P?` ${t.length} 张`:""]})]}):S.jsxs(S.Fragment,{children:[S.jsx(Z1,{className:"w-4 h-4"}),S.jsxs("span",{children:["复制图片",P?` (${t.length})`:""]})]})}),S.jsxs("button",{onClick:U,disabled:v,className:"w-full flex flex-col items-center justify-center gap-2 px-4 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Q1,{className:"w-4 h-4"}),S.jsx("span",{children:v?`打包中... ${h}%`:`导出图片${P?` (${t.length})`:""}`})]}),v&&P&&S.jsx("div",{className:"w-full bg-gray-300 dark:bg-gray-600 rounded-full h-1.5 mt-1",children:S.jsx("div",{className:"bg-blue-500 h-1.5 rounded-full transition-all duration-300",style:{width:`${h}%`}})})]}),r&&S.jsxs("button",{onClick:ee,disabled:k,className:"w-full flex flex-col items-center justify-center gap-2 px-4 py-2 bg-purple-500 text-white rounded-lg hover:bg-purple-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(tw,{className:"w-4 h-4"}),S.jsx("span",{children:k?`打包文件夹... ${N}%`:"导出当前文件夹"})]}),k&&S.jsx("div",{className:"w-full bg-purple-300 rounded-full h-1.5 mt-1",children:S.jsx("div",{className:"bg-white h-1.5 rounded-full transition-all duration-300",style:{width:`${N}%`}})})]})]})]})}function mf(){const{theme:e,toggleTheme:t,searchKeywords:n,thumbnailHeight:r,images:i,filteredImages:s,selectedFolder:o,currentLibraryId:a,setSearchKeywords:l,setThumbnailHeight:d,setFilteredImages:p,mobileView:y}=me(),[x,g]=Z.useState(!1),[m,u]=Z.useState([]),[v,c]=Z.useState([]),[h,w]=Z.useState(""),[k,b]=Z.useState(!1),[N,T]=Z.useState(!1),[P,O]=Z.useState(!1),[M,J]=Z.useState(n),R=Z.useRef(null);Z.useEffect(()=>{const X=()=>{T(window.innerWidth<768)};return X(),window.addEventListener("resize",X),()=>window.removeEventListener("resize",X)},[]),Z.useEffect(()=>{u([]),c([]),w("")},[o]),Z.useEffect(()=>{if(a)return Vd.start(a).catch(X=>{console.error("启动文件监控失败:",X)}),()=>{Vd.stop(a).catch(X=>console.error("Stop watch error:",X))}},[a]);const W=X=>{J(X),R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{l(X)},300)};Z.useEffect(()=>{J(n)},[n]),Z.useEffect(()=>()=>{R.current&&clearTimeout(R.current)},[]);const _=X=>{if(X.length===0)return[];const re=[...X].sort((j,Y)=>j-Y),q=re[0],ne=re[re.length-1];if(ne-q<10)return[V(q,ne)];const f=5,I=[],L=Math.log10(q||1),E=(Math.log10(ne)-L)/f;for(let j=0;jie>=Y&&iej)},V=(X,re,q=!1)=>{const ne=f=>{const I=L=>L<10?Math.round(L):L<100?Math.round(L/5)*5:L<1e3?Math.round(L/10)*10:Math.round(L/50)*50;return f<1?`${I(f*1024)}B`:f<1024?`${I(f)}KB`:f<1048576?`${I(f/1024)}MB`:`${I(f/1048576)}GB`};return q?`> ${ne(X)}`:`${ne(X)} - ${ne(re)}`},ce=X=>{const re=X.match(/^(\d+(?:\.\d+)?)(B|KB|MB|GB)$/);if(!re)return 0;const q=parseFloat(re[1]);switch(re[2]){case"B":return q/1024;case"KB":return q;case"MB":return q*1024;case"GB":return q*1024*1024;default:return 0}},Q=(X,re)=>{if(re.startsWith(">")){const q=re.substring(1).trim(),ne=ce(q);return X>=ne}else if(re.includes(" - ")){const[q,ne]=re.split(" - ").map(L=>L.trim()),f=ce(q),I=ce(ne);return X>=f&&X{if(i.length===0)return{formats:[],sizes:[],hasHorizontal:!1,hasVertical:!1};const X=new Set,re=[];let q=!1,ne=!1;i.forEach(I=>{I.format&&X.add(I.format.toLowerCase()),re.push(I.size/1024),I.width>I.height&&(q=!0),I.height>I.width&&(ne=!0)});const f=_(re);return{formats:Array.from(X).sort(),sizes:f,hasHorizontal:q,hasVertical:ne}},[i]),U=Z.useMemo(()=>{if(m.length===0&&v.length===0&&!h)return i;const X=new Set(m),re=new Set(v);return i.filter(q=>{var ne;if(X.size>0&&!X.has((ne=q.format)==null?void 0:ne.toLowerCase()))return!1;if(re.size>0){const f=q.size/1024;let I=!1;for(const L of re)if(Q(f,L)){I=!0;break}if(!I)return!1}if(h==="horizontal"){if(q.width<=q.height)return!1}else if(h==="vertical"&&q.height<=q.width)return!1;return!0})},[i,m,v,h]);Z.useEffect(()=>{p(U)},[U,p]);const ee=X=>{u(re=>re.includes(X)?re.filter(q=>q!==X):[...re,X])},z=X=>{c(re=>re.includes(X)?re.filter(q=>q!==X):[...re,X])},F=X=>{w(re=>re===X?"":X)},A=()=>{u([]),c([]),w("")},B=async()=>{t();try{await Nn.updateTheme(e==="light"?"dark":"light")}catch(X){console.error("Error saving theme:",X)}},D=async X=>{d(X);try{await Nn.updatePreferences({thumbnailHeight:X})}catch(re){console.error("Error saving preferences:",re)}},le=async()=>{if(!(!a||k)){b(!0);try{await sr.sync(a)}catch(X){console.error("Error refreshing:",X),alert("刷新失败: "+X.message)}finally{b(!1)}}},de=H.formats,ue=H.sizes.map(X=>({label:X})),se=[{value:"horizontal",label:"横图"},{value:"vertical",label:"竖图"}].filter(X=>X.value==="horizontal"&&H.hasHorizontal||X.value==="vertical"&&H.hasVertical);if(N){const X=y!=="sidebar";return S.jsxs("header",{className:"border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800",children:[S.jsxs("div",{className:"h-14 flex items-center justify-between px-4",children:[S.jsx("h1",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"FlyPic"}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("button",{onClick:le,disabled:!a||k,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors disabled:opacity-50",children:S.jsx(Yd,{className:`w-5 h-5 text-gray-700 dark:text-gray-300 ${k?"animate-spin":""}`})}),S.jsx("button",{onClick:()=>O(!P),className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",children:S.jsx(Zd,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"})}),S.jsx("button",{onClick:B,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",children:e==="light"?S.jsx(Xd,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"}):S.jsx(Qd,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"})})]})]}),X&&S.jsx("div",{className:"px-4 pb-3",children:S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsxs("div",{className:"flex-1 relative",children:[S.jsx(Bo,{className:"absolute left-3 top-2.5 w-5 h-5 text-gray-400"}),S.jsx("input",{type:"text",placeholder:"搜索图片...",value:n,onChange:re=>W(re.target.value),className:"w-full pl-10 pr-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 text-sm"})]}),S.jsx("button",{onClick:()=>g(!x),className:`p-2 border rounded-lg ${m.length>0||v.length>0||h?"border-blue-500 bg-blue-50 dark:bg-blue-500/20":"border-gray-300 dark:border-gray-600"}`,children:S.jsx(Kd,{className:`w-5 h-5 ${m.length>0||v.length>0||h?"text-blue-600 dark:text-blue-300":"text-gray-600 dark:text-gray-400"}`})})]})}),P&&S.jsx("div",{className:"px-4 pb-3 border-t border-gray-200 dark:border-gray-700 pt-3",children:S.jsxs("div",{className:"flex flex-col gap-3",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:"缩略图大小"}),S.jsxs("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:[r,"px"]})]}),S.jsx("input",{type:"range",min:"150",max:"300",value:r,onChange:re=>D(parseInt(re.target.value)),className:"w-full h-2 bg-gray-200 dark:bg-gray-700 rounded-lg appearance-none cursor-pointer",style:{background:`linear-gradient(to right, #3b82f6 0%, #3b82f6 ${(r-150)/150*100}%, #e5e7eb ${(r-150)/150*100}%, #e5e7eb 100%)`}})]})}),X&&x&&S.jsxs("div",{className:"px-4 pb-3 border-t border-gray-200 dark:border-gray-700 pt-3",children:[S.jsxs("div",{className:"flex items-center justify-between mb-3",children:[S.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"筛选条件"}),S.jsx("button",{onClick:A,className:"text-xs text-blue-500",children:"清除全部"})]}),S.jsxs("div",{className:"mb-3",children:[S.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:"格式"}),S.jsx("div",{className:"flex flex-wrap gap-2",children:de.map(re=>S.jsx("button",{onClick:()=>ee(re),className:`px-3 py-1 text-xs rounded-full ${m.includes(re)?"bg-blue-500 text-white":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300"}`,children:re.toUpperCase()},re))})]}),S.jsxs("div",{className:"mb-3",children:[S.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:"尺寸"}),S.jsx("div",{className:"flex flex-wrap gap-2",children:ue.map(re=>S.jsx("button",{onClick:()=>z(re.label),className:`px-3 py-1 text-xs rounded-full ${v.includes(re.label)?"bg-blue-500 text-white":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300"}`,children:re.label},re.label))})]}),S.jsxs("div",{children:[S.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:"方向"}),S.jsx("div",{className:"flex flex-wrap gap-2",children:se.map(re=>S.jsx("button",{onClick:()=>F(re.value),className:`px-3 py-1 text-xs rounded-full ${h===re.value?"bg-blue-500 text-white":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300"}`,children:re.label},re.value))})]})]})]})}return S.jsxs("header",{className:"border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800",children:[S.jsxs("div",{className:"h-14 flex items-center justify-between px-6",children:[S.jsxs("div",{className:"flex-shrink-0",children:[S.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"FlyPic"}),S.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"轻量快速的图片素材库管理"})]}),S.jsxs("div",{className:"flex-1 max-w-2xl mx-6 flex items-center gap-3",children:[S.jsxs("div",{className:"flex-1 relative",children:[S.jsx(Bo,{className:"absolute left-3 top-2.5 w-5 h-5 text-gray-400"}),S.jsx("input",{type:"text",placeholder:"搜索图片... (多个关键词用空格分隔,即时搜索)",value:M,onChange:X=>W(X.target.value),className:"w-full pl-10 pr-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),S.jsxs("button",{onClick:()=>g(!x),className:`relative p-2 border rounded-lg transition-colors ${m.length>0||v.length>0||h?"border-blue-500 dark:border-blue-400 bg-blue-50 dark:bg-blue-500/20 hover:bg-blue-100 dark:hover:bg-blue-500/30":"border-gray-300 dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-700"}`,title:m.length>0||v.length>0||h?"筛选(已启用)":"筛选",children:[S.jsx(Kd,{className:`w-5 h-5 ${m.length>0||v.length>0||h?"text-blue-600 dark:text-blue-300":"text-gray-600 dark:text-gray-400"}`}),(m.length>0||v.length>0||h)&&S.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 w-3 h-3 rounded-full",style:{backgroundColor:"#3b82f6"}})]})]}),S.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[S.jsx(Zd,{className:"w-4 h-4 text-gray-500"}),S.jsx("input",{type:"range",min:"150",max:"300",value:r,onChange:X=>D(parseInt(X.target.value)),className:"w-32"}),S.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400 w-12",children:[r,"px"]}),S.jsx("button",{onClick:le,disabled:!a||k,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed ml-2",title:"手动刷新素材库(文件监控已自动启用)",children:S.jsx(Yd,{className:`w-5 h-5 text-gray-700 dark:text-gray-300 ${k?"animate-spin":""}`})}),S.jsx("button",{onClick:B,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",title:e==="light"?"切换到暗色模式":"切换到亮色模式",children:e==="light"?S.jsx(Xd,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"}):S.jsx(Qd,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"})})]})]}),x&&S.jsx("div",{className:"px-6 pb-3",children:S.jsxs("div",{className:"p-4 bg-gray-50 dark:bg-gray-700 rounded-lg",children:[S.jsxs("div",{className:"flex items-center justify-between mb-3",children:[S.jsx("div",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"筛选条件(实时生效)"}),S.jsx("button",{onClick:A,className:"text-xs text-blue-500 hover:text-blue-600 dark:hover:text-blue-400",children:"清除全部"})]}),S.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[S.jsxs("div",{children:[S.jsx("label",{className:"block text-xs font-medium text-gray-600 dark:text-gray-400 mb-2",children:"格式"}),S.jsx("div",{className:"flex flex-col gap-1.5",children:H.formats.length>0?H.formats.map(X=>S.jsx("button",{onClick:()=>ee(X),className:`px-3 py-1.5 text-xs rounded transition-colors text-left ${m.includes(X)?"bg-blue-500 text-white":"bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-500"}`,children:X.toUpperCase()},X)):S.jsx("span",{className:"text-xs text-gray-400 py-2",children:"暂无格式数据"})})]}),S.jsxs("div",{children:[S.jsx("label",{className:"block text-xs font-medium text-gray-600 dark:text-gray-400 mb-2",children:"文件大小"}),S.jsx("div",{className:"flex flex-col gap-1.5",children:H.sizes.length>0?H.sizes.map(X=>S.jsx("button",{onClick:()=>z(X),className:`px-3 py-1.5 text-xs rounded transition-colors text-left ${v.includes(X)?"bg-blue-500 text-white":"bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-500"}`,children:X},X)):S.jsx("span",{className:"text-xs text-gray-400 py-2",children:"暂无大小数据"})})]}),S.jsxs("div",{children:[S.jsx("label",{className:"block text-xs font-medium text-gray-600 dark:text-gray-400 mb-2",children:"图片方向"}),S.jsxs("div",{className:"flex flex-col gap-1.5",children:[H.hasHorizontal&&S.jsx("button",{onClick:()=>F("horizontal"),className:`px-3 py-1.5 text-xs rounded transition-colors text-left ${h==="horizontal"?"bg-blue-500 text-white":"bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-500"}`,children:"横图"}),H.hasVertical&&S.jsx("button",{onClick:()=>F("vertical"),className:`px-3 py-1.5 text-xs rounded transition-colors text-left ${h==="vertical"?"bg-blue-500 text-white":"bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-500"}`,children:"竖图"}),!H.hasHorizontal&&!H.hasVertical&&S.jsx("span",{className:"text-xs text-gray-400 py-2",children:"暂无方向数据"})]})]})]})]})})]})}function Yw(){const{theme:e,setLibraries:t,setCurrentLibrary:n,setScanProgress:r,mobileView:i,setMobileView:s,selectedImage:o}=me(),[a,l]=Z.useState(256),[d,p]=Z.useState(320),[y,x]=Z.useState(!1),[g,m]=Z.useState(!1),[u,v]=Z.useState(!1),c=Z.useRef(null);Z.useEffect(()=>{e==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},[e]),Z.useEffect(()=>{const k=()=>{const b=window.innerWidth<768;v(b)};return k(),window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[]),Z.useEffect(()=>{u&&o&&s("detail")},[o,u,s]),Z.useEffect(()=>{const k=window.location.origin;console.log("🔌 Connecting to Socket.IO:",k);const b=co(k,{transports:["websocket","polling"],reconnection:!0,reconnectionDelay:1e3,reconnectionAttempts:5});return b.on("connect",()=>{console.log("✅ Socket.IO connected:",b.id)}),b.on("disconnect",()=>{console.log("❌ Socket.IO disconnected")}),b.on("connect_error",N=>{console.error("❌ Socket.IO connection error:",N)}),b.on("scanProgress",N=>{const T=me.getState().currentLibraryId;N.libraryId===T&&r(N)}),b.on("scanComplete",({libraryId:N,results:T})=>{console.log("📊 Scan complete:",{libraryId:N,results:T});const P=me.getState().currentLibraryId;if(console.log("🔍 Current library:",P,"Scan library:",N,"Match:",N===P),N===P){console.log("🔄 Reloading folders and images...");const O=me.getState(),M={keywords:O.searchKeywords,...O.filters};O.selectedFolder&&(M.folder=O.selectedFolder),Promise.all([Me.getFolders(N),O.selectedFolder||O.searchKeywords||O.filters.formats.length>0?Me.search(N,M):Promise.resolve({data:{images:[]}}),Me.getCount(N)]).then(([J,R,W])=>{me.getState().setFolders(J.data.folders),me.getState().setImages(R.data.images),me.getState().setTotalImageCount(W.data.count),console.log(`✅ Data reloaded, total: ${W.data.count}`)}).catch(J=>{console.error("❌ Error reloading data:",J)}).finally(()=>{r(null),console.log("✅ Scan progress cleared")})}else console.log("⚠️ Library mismatch, skipping reload"),r(null)}),b.on("scanError",({libraryId:N,error:T})=>{r(null),console.error("Scan error:",T)}),b.on("scanPaused",({libraryId:N,results:T})=>{console.log("⏸️ Scan paused:",{libraryId:N,results:T})}),h(),()=>{b.disconnect()}},[]);const h=async()=>{try{const k=await Nn.getAll(),{libraries:b,currentLibraryId:N,theme:T,preferences:P}=k.data;if(t(b),n(N),T&&me.getState().setTheme(T),P){const{thumbnailHeight:O,leftPanelWidth:M,rightPanelWidth:J}=P;O&&me.getState().setThumbnailHeight(O),M&&l(M),J&&p(J)}if(N){const[O]=await Promise.all([Me.getFolders(N)]);me.getState().setFolders(O.data.folders);try{const M=await Me.getCount(N);me.getState().setTotalImageCount(M.data.count)}catch(M){console.error("Failed to get image count:",M)}console.log("📂 数据加载完成,文件监控器将自动检测变化"),sr.getStatus(N).then(M=>{const{status:J,progress:R,pendingCount:W}=M.data;(J==="scanning"||J==="paused")&&(console.log(`🔄 恢复扫描状态: ${J}, 进度: ${(R==null?void 0:R.percent)||0}%`),r({...R,canStop:!0,isPaused:J==="paused",pendingCount:W}))}).catch(()=>{})}}catch(k){console.error("Error loading libraries:",k)}},w=async(k,b)=>{try{await Nn.updatePreferences({leftPanelWidth:k,rightPanelWidth:b})}catch(N){console.error("Error saving panel widths:",N)}};return Z.useEffect(()=>{if(!y&&!g)return;const k=document.getElementById("left-panel"),b=document.getElementById("right-panel");let N=a,T=d;const P=c.current.getBoundingClientRect(),O=P.left,M=P.right;let J=null,R=null,W=null;const _=()=>{k&&R!=null&&(k.style.width=`${R}px`,N=R),b&&W!=null&&(b.style.width=`${W}px`,T=W),J=null,R=null,W=null},V=Q=>{let H=!1;if(y&&k){const U=Q.clientX-O;U>=200&&U<=400&&(R=U,H=!0)}if(g&&b){const U=M-Q.clientX;U>=280&&U<=500&&(W=U,H=!0)}H&&J==null&&(J=requestAnimationFrame(_))},ce=()=>{J&&(cancelAnimationFrame(J),_()),l(N),p(T),w(N,T),x(!1),m(!1),me.getState().setIsResizingPanels(!1),me.getState().setResizingSide(null)};return document.addEventListener("mousemove",V,{passive:!0}),document.addEventListener("mouseup",ce),document.body.style.userSelect="none",document.body.style.cursor="col-resize",k&&(k.style.transition="none"),b&&(b.style.transition="none"),()=>{J&&(cancelAnimationFrame(J),J=null),document.removeEventListener("mousemove",V),document.removeEventListener("mouseup",ce),document.body.style.userSelect="",document.body.style.cursor="",k&&(k.style.transition=""),b&&(b.style.transition="")}},[y,g]),u?S.jsxs("div",{className:"flex flex-col h-screen bg-gray-50 dark:bg-gray-900",children:[S.jsx(mf,{}),S.jsxs("div",{className:"flex-1 overflow-hidden relative",children:[S.jsx("div",{className:`absolute inset-0 transition-transform duration-300 ${i==="sidebar"?"translate-x-0":"-translate-x-full"}`,children:S.jsx(Jd,{})}),S.jsx("div",{className:`absolute inset-0 transition-transform duration-300 ${i==="main"?"translate-x-0":i==="sidebar"?"translate-x-full":"-translate-x-full"}`,children:S.jsx(ff,{})}),S.jsx("div",{className:`absolute inset-0 transition-transform duration-300 ${i==="detail"?"translate-x-0":"translate-x-full"}`,children:S.jsx(pf,{})})]}),S.jsxs("div",{className:"flex border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800",children:[S.jsxs("button",{onClick:()=>s("sidebar"),className:`flex-1 flex flex-col items-center py-2 ${i==="sidebar"?"text-blue-500":"text-gray-500"}`,children:[S.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),S.jsx("span",{className:"text-xs mt-1",children:"文件夹"})]}),S.jsxs("button",{onClick:()=>s("main"),className:`flex-1 flex flex-col items-center py-2 ${i==="main"?"text-blue-500":"text-gray-500"}`,children:[S.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),S.jsx("span",{className:"text-xs mt-1",children:"图片"})]}),S.jsxs("button",{onClick:()=>s("detail"),disabled:!o,className:`flex-1 flex flex-col items-center py-2 ${i==="detail"?"text-blue-500":"text-gray-500"} disabled:opacity-30`,children:[S.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),S.jsx("span",{className:"text-xs mt-1",children:"详情"})]})]})]}):S.jsxs("div",{className:"flex flex-col h-screen bg-gray-50 dark:bg-gray-900",children:[S.jsx(mf,{}),S.jsxs("div",{ref:c,className:"flex flex-1 overflow-hidden",children:[S.jsx("div",{id:"left-panel",style:{width:`${a}px`},className:"flex-shrink-0 h-full",children:S.jsx(Jd,{})}),S.jsx("div",{className:`group relative w-1 h-full cursor-col-resize flex-shrink-0 transition-colors ${y?"bg-blue-500":"bg-gray-200 dark:bg-gray-700 hover:bg-blue-400"}`,onMouseDown:k=>{k.preventDefault(),me.getState().setIsResizingPanels(!0),me.getState().setResizingSide("left"),x(!0)},children:S.jsx("div",{className:"absolute inset-y-0 -left-2 -right-2 w-5"})}),S.jsx("div",{className:"flex-1 min-w-0 h-full",children:S.jsx(ff,{})}),S.jsx("div",{className:`group relative w-1 h-full cursor-col-resize flex-shrink-0 transition-colors ${g?"bg-blue-500":"bg-gray-200 dark:bg-gray-700 hover:bg-blue-400"}`,onMouseDown:k=>{k.preventDefault(),me.getState().setIsResizingPanels(!0),me.getState().setResizingSide("right"),m(!0)},children:S.jsx("div",{className:"absolute inset-y-0 -left-2 -right-2 w-5"})}),S.jsx("div",{id:"right-panel",style:{width:`${d}px`},className:"flex-shrink-0 h-full",children:S.jsx(pf,{})})]})]})}Za.createRoot(document.getElementById("root")).render(S.jsx(ke.StrictMode,{children:S.jsx(Yw,{})})); diff --git a/flypic/app/server/public/index.html b/flypic/app/server/public/index.html index ee8c5fa..5231c42 100644 --- a/flypic/app/server/public/index.html +++ b/flypic/app/server/public/index.html @@ -5,7 +5,7 @@ FlyPic 飞图 - 图片素材库管理 - + diff --git a/flypic/app/ui/config b/flypic/app/ui/config index ebda836..8576c6d 100644 --- a/flypic/app/ui/config +++ b/flypic/app/ui/config @@ -12,4 +12,4 @@ } } } -} +} \ No newline at end of file diff --git a/flypic/wizard/install b/flypic/wizard/install index 5e31e6b..98d8593 100644 --- a/flypic/wizard/install +++ b/flypic/wizard/install @@ -27,5 +27,26 @@ "helpText": "默认端口为 15002,如果该端口被占用,请修改为其他可用端口。" } ] + }, + { + "stepTitle": "使用说明", + "items": [ + { + "type": "tips", + "helpText": "
⚠️ 重要提示
使用前请仔细阅读以下说明
" + }, + { + "type": "tips", + "helpText": "
📁 素材库路径
添加素材库时需输入飞牛文件系统的完整路径
/vol1/1000/图片库
" + }, + { + "type": "tips", + "helpText": "
🔐 文件夹权限(必须配置)
请确保应用对素材库文件夹有读取权限
👉 在飞牛「应用设置」→「授权目录」中添加素材库路径
" + }, + { + "type": "tips", + "helpText": "
📖 更多帮助
详细使用教程和常见问题解答,请访问官网
" + } + ] } ] diff --git a/frontend/src/components/RightPanel.jsx b/frontend/src/components/RightPanel.jsx index 40f032d..1c9d281 100644 --- a/frontend/src/components/RightPanel.jsx +++ b/frontend/src/components/RightPanel.jsx @@ -9,7 +9,6 @@ function RightPanel() { const [isMobile, setIsMobile] = useState(false); const [imageUrl, setImageUrl] = useState(''); // 当前显示的图片URL const [isLoadingOriginal, setIsLoadingOriginal] = useState(false); - const [copied, setCopied] = useState(false); const [imageCopied, setImageCopied] = useState(false); const [isExporting, setIsExporting] = useState(false); const [exportProgress, setExportProgress] = useState(0); @@ -93,72 +92,242 @@ function RightPanel() { return imageAPI.getOriginalUrl(currentLibraryId, selectedImage.path); }; + // 检查剪贴板 API 是否可用 + const isClipboardApiSupported = () => { + return typeof ClipboardItem !== 'undefined' && + navigator.clipboard && + typeof navigator.clipboard.write === 'function'; + }; + + // 备用方案:使用 contenteditable + execCommand 复制图片(适用于非 HTTPS 环境) + const fallbackCopyImage = async (imageUrl) => { + return new Promise((resolve) => { + // 创建一个隐藏的 contenteditable 容器 + const container = document.createElement('div'); + container.setAttribute('contenteditable', 'true'); + container.style.position = 'fixed'; + container.style.left = '-9999px'; + container.style.top = '-9999px'; + container.style.opacity = '0'; + document.body.appendChild(container); + + // 创建图片元素 + const img = document.createElement('img'); + img.crossOrigin = 'anonymous'; + + img.onload = () => { + // 将图片添加到容器 + container.appendChild(img); + + // 选中容器内容 + const range = document.createRange(); + range.selectNodeContents(container); + const selection = window.getSelection(); + selection.removeAllRanges(); + selection.addRange(range); + + // 执行复制命令 + let success = false; + try { + success = document.execCommand('copy'); + } catch (err) { + console.error('execCommand copy 失败:', err); + } + + // 清理 + selection.removeAllRanges(); + document.body.removeChild(container); + + resolve(success); + }; + + img.onerror = () => { + document.body.removeChild(container); + resolve(false); + }; + + img.src = imageUrl; + }); + }; + + // 备用方案:使用 canvas + blob URL 复制图片 + const fallbackCopyImageViaCanvas = async (imageUrl) => { + return new Promise(async (resolve) => { + try { + // 获取图片数据 + const response = await fetch(imageUrl); + const blob = await response.blob(); + + // 创建图片元素 + const img = new Image(); + img.crossOrigin = 'anonymous'; + + const loadPromise = new Promise((res, rej) => { + img.onload = res; + img.onerror = rej; + }); + + img.src = URL.createObjectURL(blob); + await loadPromise; + + // 使用 canvas 转换 + const canvas = document.createElement('canvas'); + canvas.width = img.width; + canvas.height = img.height; + const ctx = canvas.getContext('2d'); + ctx.drawImage(img, 0, 0); + + // 清理 blob URL + URL.revokeObjectURL(img.src); + + // 获取 data URL + const dataUrl = canvas.toDataURL('image/png'); + + // 创建 contenteditable 容器 + const container = document.createElement('div'); + container.setAttribute('contenteditable', 'true'); + container.style.position = 'fixed'; + container.style.left = '-9999px'; + container.style.top = '-9999px'; + container.style.opacity = '0'; + document.body.appendChild(container); + + // 创建使用 data URL 的图片 + const copyImg = document.createElement('img'); + copyImg.src = dataUrl; + container.appendChild(copyImg); + + // 等待图片渲染 + await new Promise(r => setTimeout(r, 50)); + + // 选中并复制 + const range = document.createRange(); + range.selectNodeContents(container); + const selection = window.getSelection(); + selection.removeAllRanges(); + selection.addRange(range); + + let success = false; + try { + success = document.execCommand('copy'); + } catch (err) { + console.error('execCommand copy 失败:', err); + } + + // 清理 + selection.removeAllRanges(); + document.body.removeChild(container); + + resolve(success); + } catch (err) { + console.error('Canvas 复制失败:', err); + resolve(false); + } + }); + }; + + // 备用方案:使用 execCommand 复制文本 + const fallbackCopyText = (text) => { + const textArea = document.createElement('textarea'); + textArea.value = text; + textArea.style.position = 'fixed'; + textArea.style.left = '-9999px'; + textArea.style.top = '-9999px'; + document.body.appendChild(textArea); + textArea.focus(); + textArea.select(); + + try { + document.execCommand('copy'); + return true; + } catch (err) { + console.error('execCommand 复制失败:', err); + return false; + } finally { + document.body.removeChild(textArea); + } + }; + // 复制图片到剪贴板(支持粘贴到聊天软件和文件管理器) const copyImageToClipboard = async () => { try { // 获取原图URL const imageUrl = imageAPI.getOriginalUrl(currentLibraryId, selectedImage.path); - // 获取图片数据 - const response = await fetch(imageUrl); - const blob = await response.blob(); - - // 创建临时图片元素 - const img = new Image(); - const loadPromise = new Promise((resolve, reject) => { - img.onload = resolve; - img.onerror = reject; - }); - img.src = URL.createObjectURL(blob); - await loadPromise; - - // 使用 canvas 转换为 PNG - const canvas = document.createElement('canvas'); - canvas.width = img.width; - canvas.height = img.height; - const ctx = canvas.getContext('2d'); - ctx.drawImage(img, 0, 0); - - // 转换为 PNG blob - canvas.toBlob(async (pngBlob) => { + // 方案1:尝试现代 Clipboard API(需要 HTTPS) + if (isClipboardApiSupported()) { try { - // 创建包含多种格式的剪贴板项 + // 获取图片数据 + const response = await fetch(imageUrl); + const blob = await response.blob(); + + // 创建临时图片元素 + const img = new Image(); + const loadPromise = new Promise((resolve, reject) => { + img.onload = resolve; + img.onerror = reject; + }); + img.src = URL.createObjectURL(blob); + await loadPromise; + + // 使用 canvas 转换为 PNG + const canvas = document.createElement('canvas'); + canvas.width = img.width; + canvas.height = img.height; + const ctx = canvas.getContext('2d'); + ctx.drawImage(img, 0, 0); + + // 清理 blob URL + URL.revokeObjectURL(img.src); + + // 转换为 PNG blob + const pngBlob = await new Promise((resolve) => { + canvas.toBlob(resolve, 'image/png'); + }); + + // 尝试写入剪贴板 const clipboardItem = new ClipboardItem({ - 'image/png': pngBlob, - // 添加 HTML 格式(支持更多粘贴场景) - 'text/html': new Blob( - [`${selectedImage.filename}`], - { type: 'text/html' } - ), - // 添加纯文本格式(文件路径) - 'text/plain': new Blob( - [imageUrl], - { type: 'text/plain' } - ) + 'image/png': pngBlob }); await navigator.clipboard.write([clipboardItem]); setImageCopied(true); setTimeout(() => setImageCopied(false), 2000); + return; } catch (err) { - console.error('写入剪贴板失败:', err); - // 如果多格式失败,尝试只复制图像 - try { - await navigator.clipboard.write([ - new ClipboardItem({ 'image/png': pngBlob }) - ]); - setImageCopied(true); - setTimeout(() => setImageCopied(false), 2000); - } catch (fallbackErr) { - console.error('备用方案也失败:', fallbackErr); - alert('复制失败,请重试'); - } + console.warn('Clipboard API 失败,尝试备用方案:', err); } - }, 'image/png'); + } - // 清理 - URL.revokeObjectURL(img.src); + // 方案2:使用 canvas + contenteditable + execCommand(非 HTTPS 环境) + console.log('尝试 Canvas + execCommand 方案...'); + const canvasSuccess = await fallbackCopyImageViaCanvas(imageUrl); + if (canvasSuccess) { + setImageCopied(true); + setTimeout(() => setImageCopied(false), 2000); + return; + } + + // 方案3:直接使用图片 URL + contenteditable + console.log('尝试直接图片 URL 方案...'); + const directSuccess = await fallbackCopyImage(imageUrl); + if (directSuccess) { + setImageCopied(true); + setTimeout(() => setImageCopied(false), 2000); + return; + } + + // 方案4:最后降级为复制链接 + console.warn('所有图片复制方案失败,降级为复制链接'); + const textSuccess = fallbackCopyText(imageUrl); + if (textSuccess) { + setImageCopied(true); + setTimeout(() => setImageCopied(false), 2000); + alert('已复制图片链接到剪贴板\n(当前浏览器环境限制,无法直接复制图片)'); + } else { + alert('复制失败,请手动复制图片链接:\n' + imageUrl); + } } catch (error) { console.error('复制图片失败:', error); @@ -166,6 +335,85 @@ function RightPanel() { } }; + // 使用 contenteditable 复制多张图片(非 HTTPS 环境) + const fallbackCopyMultipleImages = async (imageUrls) => { + return new Promise(async (resolve) => { + try { + // 创建 contenteditable 容器 + const container = document.createElement('div'); + container.setAttribute('contenteditable', 'true'); + container.style.position = 'fixed'; + container.style.left = '-9999px'; + container.style.top = '-9999px'; + container.style.opacity = '0'; + document.body.appendChild(container); + + // 加载所有图片并转换为 data URL + for (const { url, filename } of imageUrls) { + try { + const response = await fetch(url); + const blob = await response.blob(); + + const img = new Image(); + img.crossOrigin = 'anonymous'; + + await new Promise((res, rej) => { + img.onload = res; + img.onerror = rej; + img.src = URL.createObjectURL(blob); + }); + + // 使用 canvas 转换为 data URL + const canvas = document.createElement('canvas'); + canvas.width = img.width; + canvas.height = img.height; + const ctx = canvas.getContext('2d'); + ctx.drawImage(img, 0, 0); + URL.revokeObjectURL(img.src); + + const dataUrl = canvas.toDataURL('image/png'); + + // 创建图片元素 + const copyImg = document.createElement('img'); + copyImg.src = dataUrl; + copyImg.alt = filename; + copyImg.style.display = 'block'; + copyImg.style.marginBottom = '10px'; + container.appendChild(copyImg); + } catch (err) { + console.error(`加载图片失败: ${filename}`, err); + } + } + + // 等待图片渲染 + await new Promise(r => setTimeout(r, 100)); + + // 选中并复制 + const range = document.createRange(); + range.selectNodeContents(container); + const selection = window.getSelection(); + selection.removeAllRanges(); + selection.addRange(range); + + let success = false; + try { + success = document.execCommand('copy'); + } catch (err) { + console.error('execCommand copy 失败:', err); + } + + // 清理 + selection.removeAllRanges(); + document.body.removeChild(container); + + resolve(success); + } catch (err) { + console.error('批量复制图片失败:', err); + resolve(false); + } + }); + }; + // 批量复制图片 const copyMultipleImages = async () => { try { @@ -177,52 +425,76 @@ function RightPanel() { return; } - // 多张图片:浏览器限制,只能复制为 HTML 格式(包含多个 img 标签) - // 这样粘贴到支持 HTML 的应用时,会显示为多张图片 - - // 加载所有图片并转换为 base64 - const imageDataList = await Promise.all( - imagesToCopy.map(async (img) => { - const imageUrl = imageAPI.getOriginalUrl(currentLibraryId, img.path); - const response = await fetch(imageUrl); - const blob = await response.blob(); - - // 转换为 base64 - return new Promise((resolve) => { - const reader = new FileReader(); - reader.onloadend = () => { - resolve({ - dataUrl: reader.result, - filename: img.filename - }); - }; - reader.readAsDataURL(blob); - }); - }) - ); - - // 创建 HTML 格式(多个图片) - const htmlContent = imageDataList.map(({ dataUrl, filename }) => - `${filename}` - ).join('\n'); + // 多张图片 + const imageUrls = imagesToCopy.map(img => ({ + url: imageAPI.getOriginalUrl(currentLibraryId, img.path), + filename: img.filename + })); // 创建纯文本格式(文件名列表) const textContent = imagesToCopy.map(img => img.filename).join('\n'); - try { - // 尝试写入多种格式 - await navigator.clipboard.write([ - new ClipboardItem({ - 'text/html': new Blob([htmlContent], { type: 'text/html' }), - 'text/plain': new Blob([textContent], { type: 'text/plain' }) - }) - ]); - + // 方案1:尝试现代 Clipboard API + if (isClipboardApiSupported()) { + try { + // 加载所有图片并转换为 base64 + const imageDataList = await Promise.all( + imagesToCopy.map(async (img) => { + const imageUrl = imageAPI.getOriginalUrl(currentLibraryId, img.path); + const response = await fetch(imageUrl); + const blob = await response.blob(); + + return new Promise((resolve) => { + const reader = new FileReader(); + reader.onloadend = () => { + resolve({ + dataUrl: reader.result, + filename: img.filename + }); + }; + reader.readAsDataURL(blob); + }); + }) + ); + + // 创建 HTML 格式 + const htmlContent = imageDataList.map(({ dataUrl, filename }) => + `${filename}` + ).join('\n'); + + await navigator.clipboard.write([ + new ClipboardItem({ + 'text/html': new Blob([htmlContent], { type: 'text/html' }), + 'text/plain': new Blob([textContent], { type: 'text/plain' }) + }) + ]); + + setImageCopied(true); + setTimeout(() => setImageCopied(false), 2000); + return; + } catch (err) { + console.warn('Clipboard API 失败,尝试备用方案:', err); + } + } + + // 方案2:使用 contenteditable + execCommand + console.log('尝试 contenteditable 批量复制方案...'); + const success = await fallbackCopyMultipleImages(imageUrls); + if (success) { setImageCopied(true); setTimeout(() => setImageCopied(false), 2000); - } catch (err) { - console.error('写入剪贴板失败:', err); - alert(`复制失败。\n\n提示:浏览器限制,多张图片会以 HTML 格式复制。\n可粘贴到 Word、富文本编辑器等。\n\n如需单独使用,请使用"导出"功能。`); + return; + } + + // 方案3:降级为复制文件名列表 + console.warn('批量图片复制失败,降级为复制文件名'); + const textSuccess = fallbackCopyText(textContent); + if (textSuccess) { + setImageCopied(true); + setTimeout(() => setImageCopied(false), 2000); + alert(`已复制 ${imagesToCopy.length} 个文件名到剪贴板\n(当前环境限制,建议使用"导出"功能)`); + } else { + alert('复制失败,请使用"导出"功能下载图片'); } } catch (error) { diff --git a/飞牛打包部署指南.md b/飞牛打包部署指南.md new file mode 100644 index 0000000..caa5e41 --- /dev/null +++ b/飞牛打包部署指南.md @@ -0,0 +1,154 @@ +# FlyPic 飞牛 NAS 打包部署指南 + +本指南介绍如何将 FlyPic 打包成飞牛 fnOS 应用包(.fpk)并部署到飞牛 NAS。 + +## 前置要求 + +### 开发环境(Windows/Mac/Linux) +- Node.js 18+ +- Docker Desktop(用于编译 Linux 版本依赖) + +### 飞牛 NAS +- fnOS 系统 +- fnpack 命令行工具(通过 `npm install -g fnpack` 安装) + +## 一、构建应用 + +### 方法一:使用 Docker 构建(推荐) + +此方法会自动编译 Linux 版本的原生模块(Sharp、better-sqlite3),上传到飞牛后可直接使用。 + +```bash +# 确保 Docker Desktop 正在运行 +node scripts/build-fpk-docker.js +``` + +构建完成后,`flypic` 目录将包含: +- `app/server/` - 后端代码和前端构建产物 +- `app/server/node_modules/` - Linux 版本的依赖(约 50MB) +- `app/ui/` - 应用 UI 配置 +- `cmd/` - 生命周期脚本 +- `wizard/` - 安装向导配置 +- `manifest` - 应用清单 + +### 方法二:仅构建代码(需在飞牛上安装依赖) + +```bash +node scripts/build-fpk.js +``` + +此方法不包含 node_modules,需要在飞牛 NAS 上手动安装依赖。 + +## 二、上传到飞牛 NAS + +将整个 `flypic` 文件夹上传到飞牛 NAS,可以使用: +- 飞牛文件管理器 +- SFTP/SCP +- SMB 共享 + +建议上传到用户目录,如:`/vol1/1000/flypic` + +## 三、打包 .fpk 文件 + +SSH 登录到飞牛 NAS,执行: + +```bash +# 进入应用目录 +cd /vol1/1000/flypic + +# 打包应用 +fnpack build +``` + +成功后会生成 `flypic_x.x.x_all.fpk` 文件。 + +## 四、安装应用 + +### 方法一:通过飞牛应用中心安装 +1. 打开飞牛 fnOS 桌面 +2. 进入「应用中心」→「手动安装」 +3. 选择生成的 `.fpk` 文件 +4. 按照安装向导完成安装 + +### 方法二:命令行安装 +```bash +fnpack install flypic_x.x.x_all.fpk +``` + +## 五、配置应用 + +安装完成后,首次使用需要: + +1. **配置授权目录**:在飞牛应用设置中,为 FlyPic 添加素材库文件夹的访问权限 + +2. **添加素材库**:打开 FlyPic,添加素材库时输入完整路径,如: + - `/vol1/1000/图片库` + - `/vol2/photos` + +## 目录结构说明 + +``` +flypic/ +├── app/ +│ ├── server/ # 应用服务器 +│ │ ├── server.js # 主入口 +│ │ ├── package.json +│ │ ├── node_modules/ # 依赖(Docker 构建时包含) +│ │ ├── public/ # 前端静态文件 +│ │ ├── routes/ # API 路由 +│ │ ├── database/ # 数据库模块 +│ │ └── utils/ # 工具函数 +│ └── ui/ +│ ├── config # UI 配置 +│ └── images/ # 应用图标 +├── cmd/ +│ ├── main # 启动脚本 +│ ├── install_init # 安装前脚本 +│ ├── install_callback # 安装后脚本 +│ └── ... # 其他生命周期脚本 +├── wizard/ +│ └── install # 安装向导配置 +├── config/ +│ └── resource # 资源配置 +├── manifest # 应用清单 +├── ICON.PNG # 应用图标 256x256 +└── ICON_256.PNG # 应用图标 256x256 +``` + +## 常见问题 + +### Q: 应用启动失败,显示"异常退出" +A: 检查以下几点: +1. 确保使用 Docker 构建方法,包含 Linux 版本的 node_modules +2. 检查应用日志,查看具体错误信息 +3. 确保端口 15002 未被占用 + +### Q: 无法访问素材库文件夹 +A: 在飞牛应用设置中配置授权目录,添加素材库路径的访问权限。 + +### Q: 如何更新应用? +A: +1. 重新构建:`node scripts/build-fpk-docker.js` +2. 上传到飞牛并打包:`fnpack build` +3. 在应用中心选择「更新」或重新安装 + +### Q: 如何查看应用日志? +A: 在飞牛系统日志中查看,或 SSH 登录后查看应用日志文件。 + +## 开发调试 + +本地开发时,可以分别启动前后端: + +```bash +# 终端 1:启动后端 +cd backend +npm install +npm run dev + +# 终端 2:启动前端 +cd frontend +npm install +npm run dev +``` + +访问 http://localhost:5173 进行开发调试。