comp-hub 0.28.3 → 0.28.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +17 -17
- package/dist/website/container/assets/index-DW_KDaXl.js +14 -0
- package/dist/website/container/index.html +1 -1
- package/dist/website/item/assets/{index-s-KzvBKE.js → index-Cqs5iLeY.js} +19 -19
- package/dist/website/item/index.html +1 -1
- package/dist/website/main/assets/AuthCodeSendBtn.vue_vue_type_script_setup_true_lang-CP9hjm3T.js +1 -0
- package/dist/website/main/assets/{BaseDialog.vue_vue_type_script_setup_true_lang-CgV6_zzd.js → BaseDialog.vue_vue_type_script_setup_true_lang-BROcUfEh.js} +1 -1
- package/dist/website/main/assets/{BaseSegmented.vue_vue_type_script_setup_true_lang-CW16Y3Jx.js → BaseSegmented.vue_vue_type_script_setup_true_lang-DU79Plk1.js} +1 -1
- package/dist/website/main/assets/{CanvasAnimation.vue_vue_type_script_setup_true_lang-BZ55pr6b.js → CanvasAnimation.vue_vue_type_script_setup_true_lang-Xr4R8ONt.js} +1 -1
- package/dist/website/main/assets/{EmptyStatusContainer.vue_vue_type_script_setup_true_lang-CofI0Rvq.js → EmptyStatusContainer.vue_vue_type_script_setup_true_lang-pswB5SUz.js} +1 -1
- package/dist/website/main/assets/{LoadingWrapper.vue_vue_type_script_setup_true_lang-bBtkKtmz.js → LoadingWrapper.vue_vue_type_script_setup_true_lang-kJcgjuK5.js} +1 -1
- package/dist/website/main/assets/{PanelBackground.vue_vue_type_script_setup_true_lang-DBIlZFl0.js → PanelBackground.vue_vue_type_script_setup_true_lang-BELCrrRh.js} +1 -1
- package/dist/website/main/assets/{cloud-upload-BRjLuSi4.js → cloud-upload-Cdco6849.js} +1 -1
- package/dist/website/main/assets/{core-B1GcTOER.js → core-CcVTMiBP.js} +1 -1
- package/dist/website/main/assets/{el-table-column-8qfe8CVK.js → el-table-column-CGzXlVpD.js} +1 -1
- package/dist/website/main/assets/{home-rounded-8qNxvN2I.js → home-rounded-BhKYWFxg.js} +1 -1
- package/dist/website/main/assets/{index-Crr7YnOX.js → index-9E0N8vk2.js} +1 -1
- package/dist/website/main/assets/index-B8QVBEgQ.js +1 -0
- package/dist/website/main/assets/index-BEVcnNvI.js +1 -0
- package/dist/website/main/assets/index-BGYcKO_k.js +2 -0
- package/dist/website/main/assets/index-BHUDEWGt.js +1 -0
- package/dist/website/main/assets/{index-C057ePT_.js → index-BMSnGhSG.js} +2 -2
- package/dist/website/main/assets/index-BVcp4iEn.js +1 -0
- package/dist/website/main/assets/{index-CVcB9iso.js → index-BYC9CuLh.js} +1 -1
- package/dist/website/main/assets/index-BblV7ZcF.js +1 -0
- package/dist/website/main/assets/{index-0Y9kW7YJ.js → index-BoIy-5_p.js} +1 -1
- package/dist/website/main/assets/index-BqUY_Pbs.js +1 -0
- package/dist/website/main/assets/index-BwgqBNRu.js +1 -0
- package/dist/website/main/assets/index-CG7uKVdX.js +1 -0
- package/dist/website/main/assets/{index-DoTR7Juh.css → index-CNqahi2L.css} +1 -1
- package/dist/website/main/assets/index-Cc3zDN4S.js +1 -0
- package/dist/website/main/assets/{index-C7fXvVHu.js → index-CdLdwW7r.js} +14 -14
- package/dist/website/main/assets/index-CsUtZbBp.js +1 -0
- package/dist/website/main/assets/index-D6MA33Hi.js +1 -0
- package/dist/website/main/assets/index-DGaY7dL7.js +4 -0
- package/dist/website/main/assets/{index-Bszb87gP.js → index-DbmFA7Z2.js} +1 -1
- package/dist/website/main/assets/index-Dd8ha0TC.js +1 -0
- package/dist/website/main/assets/{index-DBfCLdC1.js → index-Dfkpa19a.js} +1 -1
- package/dist/website/main/assets/index-Diq3BceD.js +1 -0
- package/dist/website/main/assets/index-DkakQhTy.js +1 -0
- package/dist/website/main/assets/index-Dz2nPzxk.js +1 -0
- package/dist/website/main/assets/{index-Bii_v9I4.js → index-RcR0UXkh.js} +1 -1
- package/dist/website/main/assets/index-VFwGpUE-.css +1 -0
- package/dist/website/main/assets/index-X1ZIWbVW.js +2 -0
- package/dist/website/main/assets/index-bdWvkmhc.js +1 -0
- package/dist/website/main/assets/{index-C63BGiej.js → index-qSRqezAW.js} +1 -1
- package/dist/website/main/assets/index-qsIY_6aA.js +1 -0
- package/dist/website/main/assets/index-rWF_BNTH.js +1 -0
- package/dist/website/main/assets/index-tKPA5N_x.js +1 -0
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-BaI6O6oA.js → index.vue_vue_type_script_setup_true_lang-BYKlY94g.js} +1 -1
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-CCaH-GEy.js +1 -0
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-DX9EV5b8.js → index.vue_vue_type_script_setup_true_lang-CgaIiyg6.js} +1 -1
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-DPbqR98S.js +1 -0
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-DTrkhAMQ.js +2 -0
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-DtCu4Izc.js +1 -0
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-mgCeAY0j.js → index.vue_vue_type_script_setup_true_lang-DzvWwe2g.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_style_index_0_lang-BWgZeYuy.js → index.vue_vue_type_style_index_0_lang-1ZphBFBL.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_style_index_0_lang-BwvfJhL1.js → index.vue_vue_type_style_index_0_lang-BNPcBMvg.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_style_index_0_lang-Bdg4OOHe.js → index.vue_vue_type_style_index_0_lang-CwaGkvXy.js} +1 -1
- package/dist/website/main/assets/{kid-star-Cr1NlTdT.js → kid-star-DD-9HSxX.js} +1 -1
- package/dist/website/main/assets/{md5-DzJRYP5-.js → md5-ohq5q_Pj.js} +1 -1
- package/dist/website/main/assets/{settings-BFJXTJ9K.js → settings-f8ZwrSyv.js} +1 -1
- package/dist/website/main/assets/{supervised-user-circle-Bnx5icEm.js → supervised-user-circle-C6l0wkza.js} +1 -1
- package/dist/website/main/assets/{sync-saved-locally-rounded-DtyOT0dw.js → sync-saved-locally-rounded-Cgz-NvDy.js} +1 -1
- package/dist/website/main/assets/{terminal-D72IJB2N.js → terminal-DIdElzFh.js} +1 -1
- package/dist/website/main/assets/{useCacheOssStore-DApHt9lQ.js → useCacheOssStore-OAoLDVbw.js} +1 -1
- package/dist/website/main/assets/{useCompEditStore-CYWCa5kU.js → useCompEditStore-DI3vFtGm.js} +166 -166
- package/dist/website/main/assets/{useCompEditStore-CY1OeGL8.css → useCompEditStore-EVZp94pg.css} +1 -1
- package/dist/website/main/assets/{useCompMetaLocalStore-eE-CBcE9.js → useCompMetaLocalStore-BKTMp_k8.js} +1 -1
- package/dist/website/main/assets/{useKeyword-B6suFutt.js → useKeyword-bWHMALoZ.js} +1 -1
- package/dist/website/main/assets/{useMessage-B_QbO-NO.js → useMessage-BVw3M4ej.js} +1 -1
- package/dist/website/main/assets/{useTeamHeaders-Cc060CP0.js → useTeamHeaders-DxHN7-t0.js} +1 -1
- package/dist/website/main/assets/useVscodeOpen-SZpyzVHG.js +1 -0
- package/dist/website/main/assets/vendor-core-BKehvho7.js +3 -0
- package/dist/website/main/assets/{vendor-ui-DXwyveTF.js → vendor-ui-CGT0cG1n.js} +2 -2
- package/dist/website/main/index.html +5 -4
- package/package.json +1 -1
- package/dist/website/container/assets/index-DJHapE1V.js +0 -14
- package/dist/website/main/assets/AuthCodeSendBtn.vue_vue_type_script_setup_true_lang-C2LcEFL4.js +0 -1
- package/dist/website/main/assets/index-2gSE6zIr.js +0 -1
- package/dist/website/main/assets/index-B5E28bYj.js +0 -1
- package/dist/website/main/assets/index-BUnPcap8.js +0 -4
- package/dist/website/main/assets/index-BYggsmzn.js +0 -1
- package/dist/website/main/assets/index-B_dBAWT4.js +0 -2
- package/dist/website/main/assets/index-BeN2bdeg.js +0 -1
- package/dist/website/main/assets/index-BhW9quqy.js +0 -1
- package/dist/website/main/assets/index-BhvFP_tJ.js +0 -1
- package/dist/website/main/assets/index-C7ChQ1lq.js +0 -2
- package/dist/website/main/assets/index-CDnNjG3p.css +0 -1
- package/dist/website/main/assets/index-CEi5bhOk.js +0 -1
- package/dist/website/main/assets/index-COVvlML8.js +0 -1
- package/dist/website/main/assets/index-CU7M0IJJ.js +0 -1
- package/dist/website/main/assets/index-CbJoAuov.js +0 -1
- package/dist/website/main/assets/index-DEPscuQs.js +0 -1
- package/dist/website/main/assets/index-DF1giQNh.js +0 -1
- package/dist/website/main/assets/index-DKPlBqE0.js +0 -1
- package/dist/website/main/assets/index-DRSvKvKa.js +0 -1
- package/dist/website/main/assets/index-DUgSkj2j.js +0 -1
- package/dist/website/main/assets/index-G0P-dulE.js +0 -1
- package/dist/website/main/assets/index-I02ydx0r.js +0 -1
- package/dist/website/main/assets/index-IyiuGctN.js +0 -1
- package/dist/website/main/assets/index-JxbnKk2u.js +0 -1
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-C5v5wKQi.js +0 -2
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-CrwTpowX.js +0 -1
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-DmGfa_ki.js +0 -1
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-LVKGPS7z.js +0 -1
- package/dist/website/main/assets/useVscodeOpen-Ckh-vPor.js +0 -1
- package/dist/website/main/assets/vendor-core-CzvSW5ae.js +0 -3
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
2
|
-
import{aA as Yo,g as te,v as Ce,aj as Ue,ab as y,j as ne,aO as we,r as j,ax as v,w as vi,au as Ja,ad as Mt,av as ku,B as Oo,ao as Go,aF as In,aM as $e,l as T,ai as Ve,i as g,F as Ie,ah as He,q as Ke,ap as L,af as H,a7 as et,a9 as Ct,Y as Ge,b as Up,k as ue,aB as ec,ay as tc,aN as zt,al as $t,X as We,ar as bn,aQ as ho,aR as Ye,W as Vp,aE as h_,aP as it,$ as At,p as p_,_ as wn,A as Jn,K as f_,aD as _s,m as m_,n as v_,aC as nc,c as g_,Z as Ae,Q as ys,S as __,u as qn,o as y_,s as b_,h as ic,at as kt,U as Ui,V as Gn,y as Za,a1 as w_,a4 as bs,aa as Bp,H as Ao,ak as S_,ac as Hp,z as C_,a8 as E_,aK as Sn,T as ws,aJ as Qo,aG as Ss,aI as el,aH as ea,t as x_}from"./vendor-core-CzvSW5ae.js";import{ai as T_,aD as $_,m as k_,aH as Ji,aE as oc,ag as O_,ah as Ou,ao as A_,ar as P_,aA as R_,aw as I_,au as M_,aq as F_,ap as D_,as as L_,ax as j_,at as z_,ay as N_,av as U_,y as Au,e as Gi,x as tl,aJ as qp,a2 as V_,a1 as B_,M as H_,aK as q_,an as W_,am as Di,I as K_,z as Po,K as Y_,$ as G_,H as Q_,N as nl,B as il,a3 as X_,_ as J_,Z as Z_,r as ey,T as Pu,k as Ru,A as Iu,g as Mu,a5 as Fu,b as Du,j as Lu,i as ju,R as zu,Q as Nu,P as Uu,q as Vu,h as Bu,W as Hu,a7 as qu,a9 as Wu,Y as Ku,S as Yu,l as Gu,a0 as Qu,n as Xu,a4 as Ju,O as Zu,C as ed,a6 as td,a8 as nd,G as id,ae as vr,af as Zi,ab as rc,az as Ro,aj as Io,aB as Mo,J as gr,ac as ty}from"./vendor-ui-DXwyveTF.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();const ny="local://",iy="main",oy="container",ry="item",sy="/__global_config__",ay="/node_modules/.prebuild_module",ly="_metadata.json",cy="/_module_load_prefix_",uy="/_node_modules_load_prefix_",dy="/_comp_preview_prefix_local_",hy="/__proxy__",py="/__master__",fy="__remote__",my="__local__",vy="https://api.comphub.cn:5696",gy="http://localhost:7002",_y="http://localhost:5000",yy="http://localhost:5001",by="Comp Hub",wy="csrfToken",Sy="authorization",Cy="x-refresh-token",Ey="x-csrf-token",xy="accept-language",Ty="isGuestLogin",$y="comp-hub-db",ky="file-compiled",Oy="https://oss.comphub.cn",Ay="oss:sts:token",Py="oss:sts:expire",Ry="comp.json",Iy="README.md",My="/.comp_hub_temp",Fy="main.js",Dy="index.vue",Wp="list_local",Kp="list_remote",Ly={COMP_LIST_TYPE_LOCAL:Wp,COMP_LIST_TYPE_REMOTE:Kp},Yp="config",Gp="error",Qp="dir",Xp="preview",Jp="extra",Zp="deps",ef="upgradeLog",tf="readme",jy={TAB_TYPE_CONFIG:Yp,TAB_TYPE_ERROR:Gp,TAB_TYPE_DIR:Qp,TAB_TYPE_PREVIEW:Xp,TAB_TYPE_EXTRA:Jp,TAB_TYPE_DEPS:Zp,TAB_TYPE_UPGRADE_LOG:ef,TAB_TYPE_README:tf},nf="mini",of="full",zy={COMP_EDIT_TAB_TYPE_MINI:nf,COMP_EDIT_TAB_TYPE_FULL:of},rf="EDIT",sf="ADD",Ny={DIALOG_TYPE_EDIT:rf,DIALOG_TYPE_ADD:sf},af="ONLY_INSTALL",lf="MAJOR_VERSION",cf="MINOR_VERSION",uf="EXACT_VERSION",Uy={COMP_MATCH_TYPE_ONLY_INSTALL:af,COMP_MATCH_TYPE_MAJOR_VERSION:lf,COMP_MATCH_TYPE_MINOR_VERSION:cf,COMP_MATCH_TYPE_EXACT_VERSION:uf},df="online",hf="offline",Vy={COMP_UPDATE_TYPE_ONLINE:df,COMP_UPDATE_TYPE_OFFLINE:hf},By=0,Hy=1,qy=-1,pf="checkPreviewListForm",ff="checkExtraInfoForm",mf="checkCompConfig",vf="afterCompDel",gf="openCompTerminal",_f="afterCompCancelCollect",yf="afterCompRenderRetry",bf="getCompError",wf="checkUpgradeLogForm",Wy={COMP_METHOD_KEY_CHECK_PREVIEW_LIST_FORM:pf,COMP_METHOD_KEY_CHECK_EXTRA_INFO_FORM:ff,COMP_METHOD_KEY_CHECK_COMP_CONFIG:mf,COMP_METHOD_KEY_AFTER_COMP_DEL:vf,COMP_METHOD_KEY_OPEN_COMP_TERMINAL:gf,COMP_METHOD_KEY_AFTER_COMP_CANCEL_COLLECT:_f,COMP_METHOD_KEY_AFTER_COMP_RENDER_RETRY:yf,COMP_METHOD_KEY_GET_COMP_ERROR:bf,COMP_METHOD_KEY_CHECK_UPGRADE_LOG_FORM:wf},Ky={CONTAINER:{SHARE:"share",COLLECT:"collect",LOCAL:"local",MINE:"mine",SIMILAR:"similar",TEAM_ALL:"teamAll",TEAM_MINE:"teamMine",TEAM_GROUP:"teamGroup",TEAM_ADD:"teamAdd"},ITEM:{PREVIEW_REMOTE:"previewRemote",PREVIEW_LOCAL:"previewLocal",CAROUSEL_REMOTE:"carouselRemote",CAROUSEL_LOCAL:"carouselLocal",EDIT_PANEL:"editPanel"}},Yy="http://127.0.0.1",Gy="http://localhost:8095",Qy="http://localhost:8096",Xy="http://localhost:5198",Jy="/item",Zy="/container",eb="CREATE",tb="JOIN",nb="EXIT",ib="teamAddMyComp",ob="teamCompList",rb="teamCompGroupList",sb="teamMyCompList",ab="teamMyCompUpdate",lb="vue/dist/vue.esm-bundler.js",cb="__v__",ub="compListStore",db="compEditStore",hb="callbacks",pb="comphubConfig",fb="local",mb="prod",vb="local",gb="prod",_b="http://localhost:5173/en/",yb="https://docs.comphub.cn",bb=20,wb=20,vt=Object.freeze(Object.defineProperty({__proto__:null,ACCEPT_LANGUAGE_HEADER_NAME:xy,AUTHORIZATION_HEADER_NAME:Sy,CACHE_KEY_STS_EXPIRE_TIME:Py,CACHE_KEY_STS_TOKEN:Ay,COMPHUB_CONFIG_KEY:pb,COMP_ACTION_ICON_HEIGHT:wb,COMP_ACTION_ICON_WIDTH:bb,COMP_CONFIG_FILENAME:Ry,COMP_EDIT_TAB_TYPES:zy,COMP_EDIT_TAB_TYPE_FULL:of,COMP_EDIT_TAB_TYPE_MINI:nf,COMP_ENTRY_FILE:Fy,COMP_HUB_DEV_DOCS_URL:_b,COMP_HUB_PROD_DOCS_URL:yb,COMP_LIST_TYPES:Ly,COMP_LIST_TYPE_LOCAL:Wp,COMP_LIST_TYPE_REMOTE:Kp,COMP_MATCH_TYPES:Uy,COMP_MATCH_TYPE_EXACT_VERSION:uf,COMP_MATCH_TYPE_MAJOR_VERSION:lf,COMP_MATCH_TYPE_MINOR_VERSION:cf,COMP_MATCH_TYPE_ONLY_INSTALL:af,COMP_METHOD_KEY_AFTER_COMP_CANCEL_COLLECT:_f,COMP_METHOD_KEY_AFTER_COMP_DEL:vf,COMP_METHOD_KEY_AFTER_COMP_RENDER_RETRY:yf,COMP_METHOD_KEY_CHECK_COMP_CONFIG:mf,COMP_METHOD_KEY_CHECK_EXTRA_INFO_FORM:ff,COMP_METHOD_KEY_CHECK_PREVIEW_LIST_FORM:pf,COMP_METHOD_KEY_CHECK_UPGRADE_LOG_FORM:wf,COMP_METHOD_KEY_GET_COMP_ERROR:bf,COMP_METHOD_KEY_OPEN_COMP_TERMINAL:gf,COMP_PREVIEW_PREFIX_LOCAL:dy,COMP_README_FILENAME:Iy,COMP_SUBMIT_MAX_FILE_COUNT:30,COMP_SUBMIT_MAX_TOTAL_SIZE:10485760,COMP_TEMP_DIR:My,COMP_UPDATE_TYPES:Vy,COMP_UPDATE_TYPE_OFFLINE:hf,COMP_UPDATE_TYPE_ONLINE:df,COMP_USE_ENTRY_FILE:Dy,CSRF_KEY:wy,CSRF_TOKEN_HEADER_NAME:Ey,DIALOG_TYPES:Ny,DIALOG_TYPE_ADD:sf,DIALOG_TYPE_EDIT:rf,FILE_MANAGER_DIRNAME:ny,GLOBAL_CONFIG_PATH:sy,IFRAME_CONTAINER_WEBSITE_PATH:Zy,IFRAME_HOST:Yy,IFRAME_ITEM_WEBSITE_PATH:Jy,IFRAME_ROUTES:Ky,INDEX_DB_NAME:$y,INDEX_DB_TABLE_NAME:ky,IS_GUEST_LOGIN:Ty,LOCAL_CHILD_IFRAME_URL:Gy,LOCAL_LEAF_IFRAME_URL:Qy,LOCAL_MIDWAY_ENV_LOCAL:fb,LOCAL_MIDWAY_ENV_PROD:mb,LOCAL_SERVICE_PREFIX:my,LOCAL_SERVICE_URL_DEV:_y,LOCAL_SERVICE_URL_DEV_SUB:yy,LOCAL_TOP_IFRAME_URL:Xy,MASTER_API_PREFIX:py,META_FILE_NAME:ly,MODULE_LOAD_PREFIX:cy,NODE_MODULES_LOAD_PREFIX:uy,OSS_CUSTOM_DOMAIN:Oy,PREBUILD_MODULE_DIR:ay,PROVIDE_KEYS:Wy,PROVIDE_KEY_CALLBACKS:hb,PROVIDE_KEY_COMP_EDIT_STORE:db,PROVIDE_KEY_COMP_LIST_STORE:ub,PROXY_PATH_PREFIX:hy,REFRESH_TOKEN_HEADER_NAME:Cy,REMOTE_MIDWAY_ENV_LOCAL:vb,REMOTE_MIDWAY_ENV_PROD:gb,REMOTE_SERVICE_PREFIX:fy,REMOTE_SERVICE_URL_DEV:gy,REMOTE_SERVICE_URL_PROD:vy,ROUTE_STATE_KEY_VERSION:cb,SCOPE_ID_TEAM_ADD_MY_COMP:ib,SCOPE_ID_TEAM_COMP_GROUP_LIST:rb,SCOPE_ID_TEAM_COMP_LIST:ob,SCOPE_ID_TEAM_MY_COMP_LIST:sb,SCOPE_ID_TEAM_MY_COMP_UPDATE:ab,SITE_TITLE:by,TAB_TYPES:jy,TAB_TYPE_CONFIG:Yp,TAB_TYPE_DEPS:Zp,TAB_TYPE_DIR:Qp,TAB_TYPE_ERROR:Gp,TAB_TYPE_EXTRA:Jp,TAB_TYPE_PREVIEW:Xp,TAB_TYPE_README:tf,TAB_TYPE_UPGRADE_LOG:ef,TEAM_OPERATE_TYPE_CREATE:eb,TEAM_OPERATE_TYPE_EXIT:nb,TEAM_OPERATE_TYPE_JOIN:tb,VERSION_COMPARE_GREATER:Hy,VERSION_COMPARE_LESS:qy,VERSION_COMPARE_SAME:By,VUE_ESM_BUNDLER:lb,WEBSITE_PATH_CONTAINER:oy,WEBSITE_PATH_ITEM:ry,WEBSITE_PATH_MAIN:iy},Symbol.toStringTag,{value:"Module"})),Sb=[{label:"tag.systemRecommended",value:"XTTJ"},{label:"tag.all",value:"QB"},{label:"tag.latest",value:"ZX"},{label:"tag.hottest",value:"ZR"}],Cb=[".css"],Eb=[{name:"__id__",label:"comp.fieldId",required:!0,default:""},{name:"name",label:"comp.fieldName",required:!0,default:""},{name:"version",label:"comp.fieldVersion",required:!0,default:"1.0.0"}],Dz=Object.freeze(Object.defineProperty({__proto__:null,COMP_DEFAULT_FIELD:Eb,DEFAULT_TAG_GROUP:Sb,PREBUILD_MODULE_SKIP_EXT:Cb},Symbol.toStringTag,{value:"Module"})),xb="comp-hub-locale",Tb=Object.freeze(Object.defineProperty({__proto__:null,LOCALE_KEY:xb},Symbol.toStringTag,{value:"Module"})),Lz=t=>vt.COMP_HUB_PROD_DOCS_URL,$b=t=>"";var kb={name:"zh-cn",el:{breadcrumb:{label:"面包屑"},colorpicker:{confirm:"确定",clear:"清空",defaultLabel:"颜色选择器",description:"当前颜色 {color},按 Enter 键选择新颜色",alphaLabel:"选择透明度的值",alphaDescription:"透明度 {alpha}, 当前颜色 {color}",hueLabel:"选择色相值",hueDescription:"色相 {hue}, 当前颜色 {color}",svLabel:"选择饱和度与明度的值",svDescription:"饱和度 {saturation}, 明度 {brightness}, 当前颜色 {color}",predefineDescription:"选择 {value} 作为颜色"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",dateTablePrompt:"使用方向键与 Enter 键可选择日期",monthTablePrompt:"使用方向键与 Enter 键可选择月份",yearTablePrompt:"使用方向键与 Enter 键可选择年份",selectedDate:"已选日期",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},weeksFull:{sun:"星期日",mon:"星期一",tue:"星期二",wed:"星期三",thu:"星期四",fri:"星期五",sat:"星期六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},inputNumber:{decrease:"减少数值",increase:"增加数值"},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},mention:{loading:"加载中"},dropdown:{toggleDropdown:"切换下拉选项"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},dialog:{close:"关闭此对话框"},drawer:{close:"关闭此对话框"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!",close:"关闭此对话框"},upload:{deleteTip:"按 Delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},slider:{defaultLabel:"滑块介于 {min} 至 {max}",defaultRangeStartLabel:"选择起始值",defaultRangeEndLabel:"选择结束值"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计",selectAllLabel:"选择所有行",selectRowLabel:"选择当前行",expandRowLabel:"展开当前行",collapseRowLabel:"收起当前行",sortLabel:"按 {column} 排序",filterLabel:"按 {column} 过滤"},tag:{close:"关闭此标签"},tour:{next:"下一步",previous:"上一步",finish:"结束导览",close:"关闭此对话框"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},carousel:{leftArrow:"上一张幻灯片",rightArrow:"下一张幻灯片",indicator:"幻灯片切换至索引 {index}"},inputOTP:{groupLabel:"一次性密码输入框",defaultLabel:"请输入第 {index} 位 OTP 字符"}}};const Ob=()=>{const{locale:t}=Yo(),e={zh:kb,en:T_};return{locale:te(()=>e[t.value])}},Ab=Ce({__name:"App",setup(t){const{locale:e}=Ob();return $_(),(n,i)=>{const o=Ue("router-view");return y(),ne(v(k_),{locale:v(e)},{default:we(()=>[j(o)]),_:1},8,["locale"])}}}),Pb="modulepreload",Rb=function(t,e){return new URL(t,e).href},od={},nt=function(e,n,i){let o=Promise.resolve();if(n&&n.length>0){let c=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};const s=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");o=c(n.map(u=>{if(u=Rb(u,i),u in od)return;od[u]=!0;const d=u.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(i)for(let f=s.length-1;f>=0;f--){const p=s[f];if(p.href===u&&(!d||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${h}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":Pb,d||(m.as="script"),m.crossOrigin="",m.href=u,l&&m.setAttribute("nonce",l),document.head.appendChild(m),d)return new Promise((f,p)=>{m.addEventListener("load",f),m.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${u}`)))})}))}function r(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return o.then(s=>{for(const a of s||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})},si="authorization",is=()=>localStorage.getItem(si),Ib=t=>localStorage.setItem(si,t),Mb=()=>localStorage.removeItem(si),Ti="x-refresh-token",Fb=()=>localStorage.getItem(Ti),Db=t=>localStorage.setItem(Ti,t),Lb=()=>localStorage.removeItem(Ti),sc="isGuest",ta=()=>localStorage.getItem(sc),jz=t=>localStorage.setItem(sc,t),jb=()=>localStorage.removeItem(sc),zb="aside_is_collapse",zz="loginType",Nz="compUploadFullscreen",Uz="terminalCommandHistory",Vz="compUploadSidePanelSize",Bz="tagSelected",Nb="asideSize",Ub="headerSize",Sf="tagsViewMaxCache",Hz="readUploadAgreement",Vb="dependencyMatchRule",qz="teamTabActiveName",Wz="settingTabActiveName",Kz="compPreviewTabActiveName",Cf="paginationPageSize",Bb=()=>localStorage.getItem(Cf),Hb=t=>localStorage.setItem(Cf,t),Yz="selectedFolderPath",Xo=vi("tagsView",{state:()=>({visitedViews:[],maxCache:Ji(Sf,10),payloadMap:new Map}),actions:{setMaxCache(t){this.$patch(e=>{e.maxCache=t})},addView(t){this.$patch(e=>{const n={...t},i=e.visitedViews.findIndex(r=>r.path===t.path);if(i!==-1){e.visitedViews[i]=n;return}e.visitedViews.unshift(n);const o=e.visitedViews.length-e.maxCache;o>0&&this.spliceVisitedViews(-o,o)})},spliceVisitedViews(t,e){this.$patch(n=>{n.visitedViews.splice(t,e)})},delViewByPath(t){this.$patch(e=>{for(const[n,i]of e.visitedViews.entries())if(i.path===t){e.visitedViews.splice(n,1);break}})},delViewAndJumpToPrev(t,e=!1,n){if(e){const i=this.visitedViews.filter(o=>o.path!==t)?.[0];i?n.push(i.path).then(o=>{o||setTimeout(()=>{this.delViewByPath(t)},250)}):n.push("/").then(o=>{o||this.delViewByPath(t)})}else this.delViewByPath(t)},addPayLoad(t,e){this.$patch(n=>{n.payloadMap.set(t,e)})},getPayLoad(t){return this.payloadMap.get(t)}}}),qb=Ce((t,{slots:e})=>{var n,i;const o=Go(),{width:r,height:s}=Ja(t),a=Mt(oc(o,{width:(n=ku(r))!==null&&n!==void 0?n:0,height:(i=ku(s))!==null&&i!==void 0?i:0},{box:t.box,window:t.window}));return()=>{if(e.default)return Oo(t.as||"div",{ref:o},e.default(a))}},{name:"UseElementSize",props:["as","box","height","width","window"]}),Wb={ref:"el",class:"relative"},Kb={class:"absolute opacity-0 pointer-events-none flex"},Yb=["itemKey"],Gb=Ce({__name:"AutoWrapRow",props:{list:{},moreWidth:{default:70},gap:{default:5},getKey:{}},setup(t){const e=t,n=H(new Map),i=In("el"),o=In("items"),{width:r}=oc(i),s=H([]),a=H(!1),l=te(()=>r.value-e.moreWidth),c=te(()=>{const p=s.value.map(_=>_.key);return e.list.filter(_=>p.includes(e.getKey(_)))}),u=te(()=>a.value?e.list.length-s.value.length:0),d=te(()=>{let p=0;for(const _ of n.value.values())p+=_;return p});function h(p,_){n.value.set(p,_)}function m(){const p=new Map;for(const _ of e.list){const C=e.getKey(_);p.set(C,n.value.get(C)??0)}n.value=p}const f=O_(()=>{let p=0;const _=[];if(!(!o.value||e.list.length===0)){for(const C of e.list){const w=e.getKey(C),S=o.value.find(b=>b.getAttribute("itemKey")===w);if(S){if(p+=S.offsetWidth+e.gap,p>l.value)break;_.push({key:w,value:S.offsetWidth})}}s.value=_,a.value=!0}},100);return $e([()=>r.value,()=>e.list,()=>d.value],([,,p],[,,_])=>{p!==_&&(a.value=!1),f()},{flush:"post",deep:!0}),$e(()=>e.list.length,()=>{m()}),(p,_)=>(y(),T("div",Wb,[Ve(p.$slots,"display",{visibleList:c.value,overflow:u.value}),g("div",Kb,[(y(!0),T(Ie,null,He(t.list,(C,w)=>(y(),ne(v(qb),{key:t.getKey(C)},{default:we(({width:S})=>[Ke(L(h(t.getKey(C),Number(S)))+" ",1),g("div",{ref_for:!0,ref:"items",itemKey:t.getKey(C),class:"invisible whitespace-nowrap"},[Ve(p.$slots,"measure",{item:C,index:w})],8,Yb)]),_:2},1024))),128))])],512))}}),ac=(t,e)=>{const n=t.__vccOpts||t;for(const[i,o]of e)n[i]=o;return n},Ef=/^[a-z0-9]+(-[a-z0-9]+)*$/,Cs=(t,e,n,i="")=>{const o=t.split(":");if(t.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;i=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const a=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:i,prefix:l,name:a};return e&&!Nr(c)?null:c}const r=o[0],s=r.split("-");if(s.length>1){const a={provider:i,prefix:s.shift(),name:s.join("-")};return e&&!Nr(a)?null:a}if(n&&i===""){const a={provider:i,prefix:"",name:r};return e&&!Nr(a,n)?null:a}return null},Nr=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function Qb(t,e){const n=t.icons,i=t.aliases||Object.create(null),o=Object.create(null);function r(s){if(n[s])return o[s]=[];if(!(s in o)){o[s]=null;const a=i[s]&&i[s].parent,l=a&&r(a);l&&(o[s]=[a].concat(l))}return o[s]}return Object.keys(n).concat(Object.keys(i)).forEach(r),o}const xf=Object.freeze({left:0,top:0,width:16,height:16}),os=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Es=Object.freeze({...xf,...os}),ol=Object.freeze({...Es,body:"",hidden:!1});function Xb(t,e){const n={};!t.hFlip!=!e.hFlip&&(n.hFlip=!0),!t.vFlip!=!e.vFlip&&(n.vFlip=!0);const i=((t.rotate||0)+(e.rotate||0))%4;return i&&(n.rotate=i),n}function rd(t,e){const n=Xb(t,e);for(const i in ol)i in os?i in t&&!(i in n)&&(n[i]=os[i]):i in e?n[i]=e[i]:i in t&&(n[i]=t[i]);return n}function Jb(t,e,n){const i=t.icons,o=t.aliases||Object.create(null);let r={};function s(a){r=rd(i[a]||o[a],r)}return s(e),n.forEach(s),rd(t,r)}function Tf(t,e){const n=[];if(typeof t!="object"||typeof t.icons!="object")return n;t.not_found instanceof Array&&t.not_found.forEach(o=>{e(o,null),n.push(o)});const i=Qb(t);for(const o in i){const r=i[o];r&&(e(o,Jb(t,o,r)),n.push(o))}return n}const Zb={provider:"",aliases:{},not_found:{},...xf};function na(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function $f(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!na(t,Zb))return null;const n=e.icons;for(const o in n){const r=n[o];if(!o||typeof r.body!="string"||!na(r,ol))return null}const i=e.aliases||Object.create(null);for(const o in i){const r=i[o],s=r.parent;if(!o||typeof s!="string"||!n[s]&&!i[s]||!na(r,ol))return null}return e}const sd=Object.create(null);function e0(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}function eo(t,e){const n=sd[t]||(sd[t]=Object.create(null));return n[e]||(n[e]=e0(t,e))}function kf(t,e){return $f(e)?Tf(e,(n,i)=>{i?t.icons[n]=i:t.missing.add(n)}):[]}function t0(t,e,n){try{if(typeof n.body=="string")return t.icons[e]={...n},!0}catch{}return!1}let Fo=!1;function Of(t){return typeof t=="boolean"&&(Fo=t),Fo}function n0(t){const e=typeof t=="string"?Cs(t,!0,Fo):t;if(e){const n=eo(e.provider,e.prefix),i=e.name;return n.icons[i]||(n.missing.has(i)?null:void 0)}}function i0(t,e){const n=Cs(t,!0,Fo);if(!n)return!1;const i=eo(n.provider,n.prefix);return e?t0(i,n.name,e):(i.missing.add(n.name),!0)}function o0(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),Fo&&!e&&!t.prefix){let i=!1;return $f(t)&&(t.prefix="",Tf(t,(o,r)=>{i0(o,r)&&(i=!0)})),i}const n=t.prefix;return Nr({prefix:n,name:"a"})?!!kf(eo(e,n),t):!1}const Af=Object.freeze({width:null,height:null}),Pf=Object.freeze({...Af,...os}),r0=/(-?[0-9.]*[0-9]+[0-9.]*)/g,s0=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ad(t,e,n){if(e===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*e*n)/n;if(typeof t!="string")return t;const i=t.split(r0);if(i===null||!i.length)return t;const o=[];let r=i.shift(),s=s0.test(r);for(;;){if(s){const a=parseFloat(r);isNaN(a)?o.push(r):o.push(Math.ceil(a*e*n)/n)}else o.push(r);if(r=i.shift(),r===void 0)return o.join("");s=!s}}function a0(t,e="defs"){let n="";const i=t.indexOf("<"+e);for(;i>=0;){const o=t.indexOf(">",i),r=t.indexOf("</"+e);if(o===-1||r===-1)break;const s=t.indexOf(">",r);if(s===-1)break;n+=t.slice(o+1,r).trim(),t=t.slice(0,i).trim()+t.slice(s+1)}return{defs:n,content:t}}function l0(t,e){return t?"<defs>"+t+"</defs>"+e:e}function c0(t,e,n){const i=a0(t);return l0(i.defs,e+i.content+n)}const u0=t=>t==="unset"||t==="undefined"||t==="none";function d0(t,e){const n={...Es,...t},i={...Pf,...e},o={left:n.left,top:n.top,width:n.width,height:n.height};let r=n.body;[n,i].forEach(p=>{const _=[],C=p.hFlip,w=p.vFlip;let S=p.rotate;C?w?S+=2:(_.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),_.push("scale(-1 1)"),o.top=o.left=0):w&&(_.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),_.push("scale(1 -1)"),o.top=o.left=0);let b;switch(S<0&&(S-=Math.floor(S/4)*4),S=S%4,S){case 1:b=o.height/2+o.top,_.unshift("rotate(90 "+b.toString()+" "+b.toString()+")");break;case 2:_.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:b=o.width/2+o.left,_.unshift("rotate(-90 "+b.toString()+" "+b.toString()+")");break}S%2===1&&(o.left!==o.top&&(b=o.left,o.left=o.top,o.top=b),o.width!==o.height&&(b=o.width,o.width=o.height,o.height=b)),_.length&&(r=c0(r,'<g transform="'+_.join(" ")+'">',"</g>"))});const s=i.width,a=i.height,l=o.width,c=o.height;let u,d;s===null?(d=a===null?"1em":a==="auto"?c:a,u=ad(d,l/c)):(u=s==="auto"?l:s,d=a===null?ad(u,c/l):a==="auto"?c:a);const h={},m=(p,_)=>{u0(_)||(h[p]=_.toString())};m("width",u),m("height",d);const f=[o.left,o.top,l,c];return h.viewBox=f.join(" "),{attributes:h,viewBox:f,body:r}}const h0=/\sid="(\S+)"/g,ld=new Map;function p0(t){t=t.replace(/[0-9]+$/,"")||"a";const e=ld.get(t)||0;return ld.set(t,e+1),e?`${t}${e}`:t}function f0(t){const e=[];let n;for(;n=h0.exec(t);)e.push(n[1]);if(!e.length)return t;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(o=>{const r=p0(o),s=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+r+i+"$3")}),t=t.replace(new RegExp(i,"g"),""),t}const rl=Object.create(null);function m0(t,e){rl[t]=e}function sl(t){return rl[t]||rl[""]}function lc(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}const cc=Object.create(null),_o=["https://api.simplesvg.com","https://api.unisvg.com"],Ur=[];for(;_o.length>0;)_o.length===1||Math.random()>.5?Ur.push(_o.shift()):Ur.push(_o.pop());cc[""]=lc({resources:["https://api.iconify.design"].concat(Ur)});function v0(t,e){const n=lc(e);return n===null?!1:(cc[t]=n,!0)}function uc(t){return cc[t]}const g0=()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}};let cd=g0();function _0(t,e){const n=uc(t);if(!n)return 0;let i;if(!n.maxURL)i=0;else{let o=0;n.resources.forEach(s=>{o=Math.max(o,s.length)});const r=e+".json?icons=";i=n.maxURL-o-n.path.length-r.length}return i}function y0(t){return t===404}const b0=(t,e,n)=>{const i=[],o=_0(t,e),r="icons";let s={type:r,provider:t,prefix:e,icons:[]},a=0;return n.forEach((l,c)=>{a+=l.length+1,a>=o&&c>0&&(i.push(s),s={type:r,provider:t,prefix:e,icons:[]},a=l.length),s.icons.push(l)}),i.push(s),i};function w0(t){if(typeof t=="string"){const e=uc(t);if(e)return e.path}return"/"}const S0=(t,e,n)=>{if(!cd){n("abort",424);return}let i=w0(e.provider);switch(e.type){case"icons":{const r=e.prefix,s=e.icons.join(","),a=new URLSearchParams({icons:s});i+=r+".json?"+a.toString();break}case"custom":{const r=e.uri;i+=r.slice(0,1)==="/"?r.slice(1):r;break}default:n("abort",400);return}let o=503;cd(t+i).then(r=>{const s=r.status;if(s!==200){setTimeout(()=>{n(y0(s)?"abort":"next",s)});return}return o=501,r.json()}).then(r=>{if(typeof r!="object"||r===null){setTimeout(()=>{r===404?n("abort",r):n("next",o)});return}setTimeout(()=>{n("success",r)})}).catch(()=>{n("next",o)})},C0={prepare:b0,send:S0};function Rf(t,e){t.forEach(n=>{const i=n.loaderCallbacks;i&&(n.loaderCallbacks=i.filter(o=>o.id!==e))})}function E0(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const e=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!e.length)return;let n=!1;const i=t.provider,o=t.prefix;e.forEach(r=>{const s=r.icons,a=s.pending.length;s.pending=s.pending.filter(l=>{if(l.prefix!==o)return!0;const c=l.name;if(t.icons[c])s.loaded.push({provider:i,prefix:o,name:c});else if(t.missing.has(c))s.missing.push({provider:i,prefix:o,name:c});else return n=!0,!0;return!1}),s.pending.length!==a&&(n||Rf([t],r.id),r.callback(s.loaded.slice(0),s.missing.slice(0),s.pending.slice(0),r.abort))})}))}let x0=0;function T0(t,e,n){const i=x0++,o=Rf.bind(null,n,i);if(!e.pending.length)return o;const r={id:i,icons:e,callback:t,abort:o};return n.forEach(s=>{(s.loaderCallbacks||(s.loaderCallbacks=[])).push(r)}),o}function $0(t){const e={loaded:[],missing:[],pending:[]},n=Object.create(null);t.sort((o,r)=>o.provider!==r.provider?o.provider.localeCompare(r.provider):o.prefix!==r.prefix?o.prefix.localeCompare(r.prefix):o.name.localeCompare(r.name));let i={provider:"",prefix:"",name:""};return t.forEach(o=>{if(i.name===o.name&&i.prefix===o.prefix&&i.provider===o.provider)return;i=o;const r=o.provider,s=o.prefix,a=o.name,l=n[r]||(n[r]=Object.create(null)),c=l[s]||(l[s]=eo(r,s));let u;a in c.icons?u=e.loaded:s===""||c.missing.has(a)?u=e.missing:u=e.pending;const d={provider:r,prefix:s,name:a};u.push(d)}),e}function k0(t,e=!0,n=!1){const i=[];return t.forEach(o=>{const r=typeof o=="string"?Cs(o,e,n):o;r&&i.push(r)}),i}const O0={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function A0(t,e,n,i){const o=t.resources.length,r=t.random?Math.floor(Math.random()*o):t.index;let s;if(t.random){let x=t.resources.slice(0);for(s=[];x.length>1;){const O=Math.floor(Math.random()*x.length);s.push(x[O]),x=x.slice(0,O).concat(x.slice(O+1))}s=s.concat(x)}else s=t.resources.slice(r).concat(t.resources.slice(0,r));const a=Date.now();let l="pending",c=0,u,d=null,h=[],m=[];typeof i=="function"&&m.push(i);function f(){d&&(clearTimeout(d),d=null)}function p(){l==="pending"&&(l="aborted"),f(),h.forEach(x=>{x.status==="pending"&&(x.status="aborted")}),h=[]}function _(x,O){O&&(m=[]),typeof x=="function"&&m.push(x)}function C(){return{startTime:a,payload:e,status:l,queriesSent:c,queriesPending:h.length,subscribe:_,abort:p}}function w(){l="failed",m.forEach(x=>{x(void 0,u)})}function S(){h.forEach(x=>{x.status==="pending"&&(x.status="aborted")}),h=[]}function b(x,O,$){const K=O!=="success";switch(h=h.filter(F=>F!==x),l){case"pending":break;case"failed":if(K||!t.dataAfterTimeout)return;break;default:return}if(O==="abort"){u=$,w();return}if(K){u=$,h.length||(s.length?E():w());return}if(f(),S(),!t.random){const F=t.resources.indexOf(x.resource);F!==-1&&F!==t.index&&(t.index=F)}l="completed",m.forEach(F=>{F($)})}function E(){if(l!=="pending")return;f();const x=s.shift();if(x===void 0){if(h.length){d=setTimeout(()=>{f(),l==="pending"&&(S(),w())},t.timeout);return}w();return}const O={status:"pending",resource:x,callback:($,K)=>{b(O,$,K)}};h.push(O),c++,d=setTimeout(E,t.rotate),n(x,e,O.callback)}return setTimeout(E),C}function If(t){const e={...O0,...t};let n=[];function i(){n=n.filter(s=>s().status==="pending")}function o(s,a,l){const c=A0(e,s,a,(u,d)=>{i(),l&&l(u,d)});return n.push(c),c}function r(s){return n.find(a=>s(a))||null}return{query:o,find:r,setIndex:s=>{e.index=s},getIndex:()=>e.index,cleanup:i}}function ud(){}const ia=Object.create(null);function P0(t){if(!ia[t]){const e=uc(t);if(!e)return;ia[t]={config:e,redundancy:If(e)}}return ia[t]}function R0(t,e,n){let i,o;if(typeof t=="string"){const r=sl(t);if(!r)return n(void 0,424),ud;o=r.send;const s=P0(t);s&&(i=s.redundancy)}else{const r=lc(t);if(r){i=If(r);const s=sl(t.resources?t.resources[0]:"");s&&(o=s.send)}}return!i||!o?(n(void 0,424),ud):i.query(e,o,n)().abort}function dd(){}function I0(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,E0(t)}))}function M0(t){const e=[],n=[];return t.forEach(i=>{(i.match(Ef)?e:n).push(i)}),{valid:e,invalid:n}}function yo(t,e,n){function i(){const o=t.pendingIcons;e.forEach(r=>{o&&o.delete(r),t.icons[r]||t.missing.add(r)})}if(n&&typeof n=="object")try{if(!kf(t,n).length){i();return}}catch(o){console.error(o)}i(),I0(t)}function hd(t,e){t instanceof Promise?t.then(n=>{e(n)}).catch(()=>{e(null)}):e(t)}function F0(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout(()=>{t.iconsQueueFlag=!1;const{provider:n,prefix:i}=t,o=t.iconsToLoad;if(delete t.iconsToLoad,!o||!o.length)return;const r=t.loadIcon;if(t.loadIcons&&(o.length>1||!r)){hd(t.loadIcons(o,i,n),c=>{yo(t,o,c)});return}if(r){o.forEach(c=>{hd(r(c,i,n),u=>{yo(t,[c],u?{prefix:i,icons:{[c]:u}}:null)})});return}const{valid:s,invalid:a}=M0(o);if(a.length&&yo(t,a,null),!s.length)return;const l=i.match(Ef)?sl(n):null;if(!l){yo(t,s,null);return}l.prepare(n,i,s).forEach(c=>{R0(n,c,u=>{yo(t,c.icons,u)})})}))}const D0=(t,e)=>{const n=$0(k0(t,!0,Of()));if(!n.pending.length){let a=!0;return e&&setTimeout(()=>{a&&e(n.loaded,n.missing,n.pending,dd)}),()=>{a=!1}}const i=Object.create(null),o=[];let r,s;return n.pending.forEach(a=>{const{provider:l,prefix:c}=a;if(c===s&&l===r)return;r=l,s=c,o.push(eo(l,c));const u=i[l]||(i[l]=Object.create(null));u[c]||(u[c]=[])}),n.pending.forEach(a=>{const{provider:l,prefix:c,name:u}=a,d=eo(l,c),h=d.pendingIcons||(d.pendingIcons=new Set);h.has(u)||(h.add(u),i[l][c].push(u))}),o.forEach(a=>{const l=i[a.provider][a.prefix];l.length&&F0(a,l)}),e?T0(e,n,o):dd};function L0(t,e){const n={...t};for(const i in e){const o=e[i],r=typeof o;i in Af?(o===null||o&&(r==="string"||r==="number"))&&(n[i]=o):r===typeof n[i]&&(n[i]=i==="rotate"?o%4:o)}return n}const j0=/[\s,]+/;function z0(t,e){e.split(j0).forEach(n=>{switch(n.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0;break}})}function N0(t,e=0){const n=t.replace(/^-?[0-9.]*/,"");function i(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(t);return isNaN(o)?0:i(o)}else if(n!==t){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let r=parseFloat(t.slice(0,t.length-n.length));return isNaN(r)?0:(r=r/o,r%1===0?i(r):0)}}return e}function U0(t,e){let n=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in e)n+=" "+i+'="'+e[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+t+"</svg>"}function V0(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function B0(t){return"data:image/svg+xml,"+V0(t)}function H0(t){return'url("'+B0(t)+'")'}const pd={...Pf,inline:!1},q0={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},W0={display:"inline-block"},al={backgroundColor:"currentColor"},Mf={backgroundColor:"transparent"},fd={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},md={webkitMask:al,mask:al,background:Mf};for(const t in md){const e=md[t];for(const n in fd)e[t+n]=fd[n]}const Vr={};["horizontal","vertical"].forEach(t=>{const e=t.slice(0,1)+"Flip";Vr[t+"-flip"]=e,Vr[t.slice(0,1)+"-flip"]=e,Vr[t+"Flip"]=e});function vd(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}const gd=(t,e)=>{const n=L0(pd,e),i={...q0},o=e.mode||"svg",r={},s=e.style,a=typeof s=="object"&&!(s instanceof Array)?s:{};for(let p in e){const _=e[p];if(_!==void 0)switch(p){case"icon":case"style":case"onLoad":case"mode":case"ssr":case"customise":break;case"inline":case"hFlip":case"vFlip":n[p]=_===!0||_==="true"||_===1;break;case"flip":typeof _=="string"&&z0(n,_);break;case"color":r.color=_;break;case"rotate":typeof _=="string"?n[p]=N0(_):typeof _=="number"&&(n[p]=_);break;case"ariaHidden":case"aria-hidden":_!==!0&&_!=="true"&&delete i["aria-hidden"];break;default:{const C=Vr[p];C?(_===!0||_==="true"||_===1)&&(n[C]=!0):pd[p]===void 0&&(i[p]=_)}}}const l=d0(t,n),c=l.attributes;if(n.inline&&(r.verticalAlign="-0.125em"),o==="svg")return i.style={...r,...a},Object.assign(i,c),i.innerHTML=f0(l.body),Oo("svg",i);const{body:u,width:d,height:h}=t,m=o==="mask"||(o==="bg"?!1:u.indexOf("currentColor")!==-1),f=U0(u,{...c,width:d+"",height:h+""});return i.style={...r,"--svg":H0(f),width:vd(c.width),height:vd(c.height),...W0,...m?al:Mf,...a},Oo("span",i)};Of(!0);m0("",C0);if(typeof document<"u"&&typeof window<"u"){const t=window;if(t.IconifyPreload!==void 0){const e=t.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!o0(i))&&console.error(n)}catch{console.error(n)}})}if(t.IconifyProviders!==void 0){const e=t.IconifyProviders;if(typeof e=="object"&&e!==null)for(let n in e){const i="IconifyProviders["+n+"] is invalid.";try{const o=e[n];if(typeof o!="object"||!o||o.resources===void 0)continue;v0(n,o)||console.error(i)}catch{console.error(i)}}}}const K0={...Es,body:""},Y0=Ce((t,{emit:e})=>{const n=H(null);function i(){n.value&&(n.value.abort?.(),n.value=null)}const o=H(!!t.ssr),r=H(""),s=Go(null);function a(){const c=t.icon;if(typeof c=="object"&&c!==null&&typeof c.body=="string")return r.value="",{data:c};let u;if(typeof c!="string"||(u=Cs(c,!1,!0))===null)return null;let d=n0(u);if(!d){const f=n.value;return(!f||f.name!==c)&&(d===null?n.value={name:c}:n.value={name:c,abort:D0([u],l)}),null}i(),r.value!==c&&(r.value=c,Ge(()=>{e("load",c)}));const h=t.customise;if(h){d=Object.assign({},d);const f=h(d.body,u.name,u.prefix,u.provider);typeof f=="string"&&(d.body=f)}const m=["iconify"];return u.prefix!==""&&m.push("iconify--"+u.prefix),u.provider!==""&&m.push("iconify--"+u.provider),{data:d,classes:m}}function l(){const c=a();c?c.data!==s.value?.data&&(s.value=c):s.value=null}return o.value?l():et(()=>{o.value=!0,l()}),$e(()=>t.icon,l),Ct(i),()=>{const c=s.value;if(!c)return gd(K0,t);let u=t;return c.classes&&(u={...t,class:c.classes.join(" ")}),gd({...Es,...c.data},u)}},{props:["icon","mode","ssr","width","height","style","color","inline","rotate","hFlip","horizontalFlip","vFlip","verticalFlip","flip","id","ariaHidden","customise","title"],emits:["load"]});function G0(t,e,n="_id"){const i=Ou(t,e,n).filter(Boolean),o=Ou(e,t,n).filter(Boolean),r=A_(t,e,(s,a)=>s[n]===a[n]&&!P_(s,a));return{addedItems:i,deletedItems:o,modifiedItems:r}}const Gz=Object.freeze(Object.defineProperty({__proto__:null,findChangedArrayItems:G0},Symbol.toStringTag,{value:"Module"}));function dc(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Q0(t,e){if(!e?.trim())return[{text:t,isMatch:!1}];const n=new RegExp(`(${dc(e)})`,"gi");return t.split(n).map(i=>({text:i,isMatch:n.test(i)&&i.toLowerCase()===e.toLowerCase()}))}function X0(t,e,n="hl"){if(!e?.trim())return t;const i=dc(e.trim());return t.replace(new RegExp(`(${i})`,"gi"),`<mark class="${n}">$1</mark>`)}function J0(t,e){const n=e?.trim().toLowerCase();return n?t.findIndex(i=>i.toLowerCase().includes(n)):-1}const Ff=t=>t.replace(/[/\\]/g,"/"),Z0=(t,e="/")=>t.replace(/[\\/]+/g,e);function ew(){return"#"+R_(0,16777215).toString(16).padStart(6,"0")}const tw=t=>/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(t),Df=t=>t.replace(/[-_]([a-z])/g,(e,n)=>n.toUpperCase()).replace(/^[A-Z]/,e=>e.toLowerCase()),ll=t=>{if(Array.isArray(t))return t.map(n=>ll(n));if(t===null||typeof t!="object")return t;const e={};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const i=Df(n);e[i]=ll(t[n])}return e};function nw(t){return/(^[A-Z][a-z][a-zA-Z0-9]*$)|(^[a-z]+(-[a-z0-9]+)+$)/.test(t.trim())}function iw(t){if(t<=0)throw new Error("长度必须大于0");let e="";for(;e.length<t;){const n=Math.floor(Math.random()*10);e.length===0&&n===0||(e+=n)}return e}function Lf(t){if(t==null)return{valid:!1,reason:"validateHash.empty"};if(typeof t!="string")return{valid:!1,reason:"validateHash.notString",reasonParams:{type:typeof t}};const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return{valid:!1,reason:"validateHash.contentEmpty"};if(/^\d/.test(e))return{valid:!1,reason:"validateHash.startsWithNumber",reasonParams:{char:e[0]}};const n=e.match(/[^\p{L}\p{N}_\-() ]/u);if(n){const i=n[0],o=i.charCodeAt(0);return i==="`"?{valid:!1,reason:"validateHash.invalidCharBacktick"}:i===`
|
|
3
|
-
`?{valid:!1,reason:"validateHash.invalidCharNewline"}:i==="\r"?{valid:!1,reason:"validateHash.invalidCharCarriageReturn"}:i===" "?{valid:!1,reason:"validateHash.invalidCharTab"}:i==="\f"?{valid:!1,reason:"validateHash.invalidCharFormFeed"}:i==="\v"?{valid:!1,reason:"validateHash.invalidCharVerticalTab"}:i==="#"?{valid:!1,reason:"validateHash.invalidCharHash"}:/[<>\\"'&]/.test(i)?{valid:!1,reason:"validateHash.invalidCharHtmlSpecial",reasonParams:{char:i}}:{valid:!1,reason:"validateHash.invalidCharUnknown",reasonParams:{char:i,code:o.toString(16).toUpperCase().padStart(4,"0")}}}return{valid:!0,normalized:e}}function ow(t){return Lf(t).valid}const Qz=Object.freeze(Object.defineProperty({__proto__:null,convertKeysToCamelCase:ll,escapeRegExp:dc,findKeywordLineIndex:J0,generateNumberString:iw,highlightText:X0,isEmail:tw,isValidHash:ow,randomColor:ew,replaceBackslashWithSlash:Ff,replaceSlashWithSpecifiedSeparator:Z0,splitTextByKeyword:Q0,toCamelCase:Df,validateCompName:nw,validateHash:Lf},Symbol.toStringTag,{value:"Module"}));function rw(t,e){if(!t||!e.length)throw new Error("组件路径或入口路径为空");const[n]=e.slice(-1);if(!n)throw new Error("入口路径最后一项无效");const i=Ff(n);return`${t.replace(vt.FILE_MANAGER_DIRNAME,"")}${i}`}function sw(t){const e={};return t.forEach(n=>{n?.parent?e[n?.parent?.name]=n?.parent?.version:e[n.name]=n.version}),Object.entries(e).map(([n,i])=>({name:n,version:i}))}const Xz=Object.freeze(Object.defineProperty({__proto__:null,getPreviewUrl:rw,handleDepData:sw},Symbol.toStringTag,{value:"Module"}));function aw(t){const e={children:[]},n=[e];return t.forEach(({depth:i,tokens:o})=>{if(o[0]){const r=o[0].text,s=o.map(u=>u.text),a=s.join(""),l={title:r,titles:s,href:`#${a}`,children:[]};for(;n.length>i;)n.pop();const c=n[n.length-1];c&&c.children.push(l),n.push(l)}}),e.children}const Jz=Object.freeze(Object.defineProperty({__proto__:null,flatHeadingsToTree:aw},Symbol.toStringTag,{value:"Module"})),lw=t=>`Bearer ${t}`,cw=t=>t.replace("Bearer ",""),wi=Object.freeze(Object.defineProperty({__proto__:null,extractBearerToken:cw,generateBearerToken:lw},Symbol.toStringTag,{value:"Module"}));function uw(t,e,n={}){const{idKey:i="id",childrenKey:o="children"}=n,r=Array.isArray(t)?t:[t],s=[];let a=!1;const l=u=>{const d=u[o];Array.isArray(d)&&(s.push(...d),d.forEach(h=>l(h)))},c=u=>{if(a)return!0;for(const d of u){if(d?.[i]===e)return a=!0,l(d),!0;const h=d?.[o];if(Array.isArray(h)&&h.length>0&&c(h))return!0}return!1};return c(r),s}function jf(t,e){const n=JSON.parse(JSON.stringify(t));return n.children?.length&&(n.children=n.children.map(i=>jf(i,e))),e(n)}function dw(t,e,n={}){const{idKey:i="id",childrenKey:o="children"}=n,r=Array.isArray(t)?t:[t],s=l=>{const{[o]:c,...u}=l;return u},a=(l,c)=>{for(const u of l){if(u[i]===e)return[s(u),...c];const d=u[o];if(Array.isArray(d)&&d.length>0){const h=a(d,[s(u),...c]);if(h)return h}}return null};return a(r,[])??[]}function hw(t,e){const{createNode:n,pathSeparator:i="/",skipInvalid:o=!0}=e,r=new Map,s=i,a=n("directory","",s);a.children=[],r.set(s,a);const l=u=>{let d=u.replace(/\\/g,"/");return d=d.replace(/^\.\//,""),d=d.replace(/^\/+|\/+$/g,""),d.replace(/\//g,i)};for(const u of t){const d=l(u.path);if(!d)continue;const h=d.split(i).filter(Boolean);if(h.length===0)continue;let m=s,f="";for(let w=0;w<h.length-1;w++){const S=h[w];if(f=f?`${f}${i}${S}`:S,!r.has(f)){const b=n("directory",S,f);b.children=[],r.set(f,b),r.get(m)?.children?.push(b)}m=f}const p=h[h.length-1];if(!p){if(!o)throw new Error(`无效路径: ${u.path}`);continue}const _=f?`${f}${i}${p}`:p,C=n("file",p,_);r.get(m)?.children?.push(C)}const c=u=>{u.sort((d,h)=>d.type!==h.type?d.type==="directory"?-1:1:d.name.localeCompare(h.name)),u.forEach(d=>d.children?.length&&c(d.children))};return a.children?.length&&c(a.children),a}const Zz=Object.freeze(Object.defineProperty({__proto__:null,convertFlatToTree:hw,findTreeNodePathToRoot:dw,getTreeAllChildren:uw,mapTree:jf},Symbol.toStringTag,{value:"Module"}));var zf=(t=>(t.Added="added",t.Deleted="deleted",t.Unchanged="unchanged",t.Changed="modified",t))(zf||{}),Nf=(t=>(t.Directory="directory",t.File="file",t))(Nf||{});function Uf(t){return typeof structuredClone=="function"?structuredClone(t):JSON.parse(JSON.stringify(t))}function rs(t,e){for(const n of t)e.set(n.path,n),n.type==="directory"&&n.children?.length&&rs(n.children,e)}function _d(t){const e=new Map;return rs(t,e),e}function hc(t,e){const n=[];for(const i of t)if(!e.has(i.path)){const o=Uf(i);o.status="deleted",i.type==="directory"&&i.children?.length&&(o.children=hc(i.children,e)),n.push(o)}return n}function pw(t,e,n){return n?n(t,e):t.hash&&e.hash?t.hash===e.hash:!0}function Br(t,e,n,i){return t.map(o=>{const r=Uf(o),s=e.get(o.path);if(s){if(o.type==="file"){const a=pw(s,o,i?.contentCompare);r.status=a?"unchanged":"modified"}else r.status="unchanged";if(o.type==="directory"&&o.children&&s.children){const a=_d(s.children),l=Br(o.children,a,n,i),c=_d(l),u=hc(s.children,c);r.children=[...l,...u]}else o.type==="directory"&&o.children&&(r.children=Br(o.children,new Map,"added",i))}else r.status=n,o.type==="directory"&&o.children?.length&&(r.children=Br(o.children,new Map,n,i));return r.type==="directory"&&pc(r),r})}function pc(t){if(t.type!=="directory"||!t.children?.length)return;for(const n of t.children)n.type==="directory"&&pc(n);if(t.status==="added"||t.status==="deleted")return;const e=t.children.some(n=>n.status==="added"||n.status==="deleted"||n.status==="modified");t.status=e?"modified":"unchanged"}function Vf(t){const e=[...t].sort((n,i)=>n.type!==i.type?n.type==="directory"?-1:1:n.name.localeCompare(i.name));for(const n of e)n.type==="directory"&&n.children?.length&&(n.children=Vf(n.children));return e}function fw(t,e,n){const i=new Map,o=new Map;rs(e,i),rs(t,o);const r=Br(t,i,"added",n),s=hc(e,o),a=[...r,...s],l=n?.skipSort?a:Vf(a);for(const c of l)c.type==="directory"&&pc(c);return l}const eN=Object.freeze(Object.defineProperty({__proto__:null,NodeStatus:zf,NodeType:Nf,mergeAndMarkTree:fw},Symbol.toStringTag,{value:"Module"})),mw=(t,e)=>{const n=Array.isArray(e)?e:[e];let i;return I_(t)?i="string":M_(t)?i="number":F_(t)?i="boolean":D_(t)?i="array":L_(t)?i="function":j_(t)?i="symbol":z_(t)?i="null":N_(t)?i="undefined":U_(t)?i="object":i="undefined",n.includes(i)},tN=Object.freeze(Object.defineProperty({__proto__:null,isType:mw},Symbol.toStringTag,{value:"Module"})),yd=/^[\^~>=<]+/,Bf=/^(\d+)\.(\d+)\.(\d+)(?:-([a-zA-Z0-9.]+))?(?:\+([a-zA-Z0-9.]+))?$/;function vw(t){return Bf.test(t)}function Fn(t){if(!t||typeof t!="string")throw new Error(`Invalid version string: ${t}`);const e=t.match(yd),n=e?e[0]:"",i=t.replace(yd,"").match(Bf);if(!i)throw new Error(`Invalid semver format: ${t}`);const[,o="0",r="0",s="0",a]=i,l=parseInt(o,10),c=parseInt(r,10),u=parseInt(s,10);return{raw:t,prefix:n,major:l,minor:c,patch:u,prerelease:a||null,majorVersion:o,version:`${l}.${c}.${u}`}}function gw(t,e){const n=Fn(t),i=Fn(e);return n.major===i.major&&n.minor===i.minor&&n.patch===i.patch}function _w(t){return Fn(t).majorVersion}function yw(t){const e={};for(const[n,i]of Object.entries(t))try{e[n]=Fn(i)}catch(o){console.warn(`Failed to parse version for ${n}: ${i}`,o)}return e}function Vi(t,e){const n=Fn(t),i=Fn(e),{VERSION_COMPARE_SAME:o,VERSION_COMPARE_LESS:r,VERSION_COMPARE_GREATER:s}=vt;return n.major!==i.major?n.major>i.major?s:r:n.minor!==i.minor?n.minor>i.minor?s:r:n.patch!==i.patch?n.patch>i.patch?s:r:o}function bw(t,e){const n=Fn(t),i=Fn(e);switch(i.prefix){case"^":return n.major===i.major;case"~":return n.major===i.major&&n.minor===i.minor;case">=":return Vi(t,e.replace(">=",""))>=0;case">":return Vi(t,e.replace(">",""))>0;case"<=":return Vi(t,e.replace("<=",""))<=0;case"<":return Vi(t,e.replace("<",""))<0;case"=":case"":return Vi(t,e.replace("=",""))===0;default:return!1}}function ww(t){if(!t||typeof t!="string")throw new Error("版本号必须是非空字符串");const e=Fn(t),n=(a,l)=>{if(a<0||a>999)throw new Error(`版本号${l}位必须在 0-999 之间,当前值:${a}(原始输入:${t})`);return a},i=n(e.major,"主版本"),o=n(e.minor,"次版本"),r=n(e.patch,"补丁版本"),s=i*1e6+o*1e3+r;if(!Number.isSafeInteger(s))throw new Error(`版本号转换后超出 JavaScript 安全整数范围,结果:${s}(原始输入:${t})`);return s}const nN=Object.freeze(Object.defineProperty({__proto__:null,compareVersions:Vi,getMajorVersion:_w,isVersionEqual:gw,parseDependencies:yw,parseVersion:Fn,satisfiesRange:bw,validateVersion:vw,versionToNumber:ww},Symbol.toStringTag,{value:"Module"})),Sw={};function Cw(t,e){return y(),ne(Up,{name:"transition-fade",mode:"out-in",appear:""},{default:we(()=>[Ve(t.$slots,"default")]),_:3})}const Ew=ac(Sw,[["render",Cw]]),xw={key:0,class:"fixed top-0 left-0 w-screen bg-[rgb(94,9,11)] text-white font-sans z-[99999] break-all overflow-auto max-h-[50vh] p-[10px] box-border"},Tw={class:"clear-both"},$w={class:"whitespace-pre-wrap m-0"},kw={key:0},Ow={class:"whitespace-pre-wrap m-0"},Aw=Ce({__name:"ErrorOverlay",props:{errors:{}},setup(t){const e=H(!1),n=t,i=()=>{e.value=!1};return $e(()=>n.errors,o=>{e.value=o.length>0},{immediate:!0,deep:!0}),(o,r)=>e.value?(y(),T("div",xw,[g("button",{class:"sticky top-[10px] right-[10px] float-right bg-white/20 border-none text-white text-lg cursor-pointer w-[30px] h-[30px] rounded-full flex items-center justify-center p-0 ml-[10px] transition-colors duration-200 hover:bg-white/30",onClick:i}," × "),g("div",Tw,[(y(!0),T(Ie,null,He(t.errors,(s,a)=>(y(),T("div",{key:a,class:"mb-5"},[g("pre",$w,L(s?.message||s),1),s?.stack?(y(),T("div",kw,[g("pre",Ow,L(s.stack),1)])):ue("",!0)]))),128))])])):ue("",!0)}}),Pw=Ce({__name:"index",props:Vp({config:{}},{modelValue:{type:Object,default:()=>({})},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const{t:e}=Yo(),n=t,i=te(()=>{const u={};return n.config?.column?.forEach(d=>{u[d.prop]=d.value}),u}),o=ec(t,"modelValue"),r=tc();async function s(){r?.onRefresh?.()}async function a(){n.config?.column?.forEach(u=>{u.value=""}),await Ge(),r?.onReset?.()}function l(u){return u??!0}function c(){r?.onSearch?.()}return zt(()=>{o.value=i.value}),(u,d)=>{const h=Ue("Icon");return y(),ne(v(tl),{inline:!0,onSubmit:d[3]||(d[3]=Ye(()=>{},["prevent"])),onKeyup:d[4]||(d[4]=ho(m=>c(),["enter"]))},{default:we(()=>[(y(!0),T(Ie,null,He(t.config?.column||[],(m,f)=>(y(),ne(v(Au),{key:f,label:v(m.label)??""},{default:we(()=>[l(m.useVModel)?(y(),ne($t(m.component),We({key:1,modelValue:m.value,"onUpdate:modelValue":p=>m.value=p},{ref_for:!0},m?.attributes||{},bn(m?.events||{})),null,16,["modelValue","onUpdate:modelValue"])):(y(),ne($t(m.component),We({key:0,"model-value":m.value},{ref_for:!0},m?.attributes||{},bn(m?.events||{})),null,16,["model-value"]))]),_:2},1032,["label"]))),128)),t.config?.column?.length?(y(),ne(v(Au),{key:0},{default:we(()=>[j(v(Gi),{type:"success",onClick:d[0]||(d[0]=m=>c())},{default:we(()=>[Ke(L(v(e)("common.search")),1)]),_:1}),j(v(Gi),{type:"primary",onClick:d[1]||(d[1]=m=>a())},{default:we(()=>[Ke(L(v(e)("common.reset")),1)]),_:1}),j(v(Gi),{onClick:d[2]||(d[2]=m=>s())},{default:we(()=>[j(h,{icon:"material-symbols:refresh-rounded"})]),_:1})]),_:1})):ue("",!0)]),_:1})}}}),Rw={key:0},Iw={ref:"tableContainer",class:"flex-1 overflow-hidden"},Mw={key:1,class:"mt-2"},Fw=Ce({__name:"index",props:{tableConfig:{}},setup(t,{expose:e}){const n=tc(),i=t,o=In("tableContainer"),r=In("table"),{height:s}=oc(o),a=h_(),l=te(()=>{if(i.tableConfig?.pagination?.getPageSize||i.tableConfig?.pagination?.setPageSize)return{get:i.tableConfig.pagination.getPageSize,set:i.tableConfig.pagination.setPageSize};const I=Dw().paginationStorage;return I?{get:()=>{const A=I.get();return A?Number(A):10},set:A=>I.set(String(A))}:null}),c=H(l.value?.get?.()??10),u=H(!1),d=H(1),h=H(F()),m=H("UNKNOWN"),f=te(()=>Object.keys(a)),p=te(()=>i.tableConfig.size??"default"),_=te(()=>i.tableConfig?.fixedHeight??!0),C=te(()=>_.value?Math.max(s.value,100):"auto"),w=te(()=>i.tableConfig?.autoLoading??!0),S=te(()=>({"--pagination-location":i.tableConfig?.pagination?.location||"center"})),b=te(()=>i.tableConfig?.isPagination??!0),E=te(()=>i.tableConfig?.paginationMap?i.tableConfig.paginationMap:{page:"page",pageSize:"pageSize"}),x=te(()=>({[E.value.page]:d.value,[E.value.pageSize]:c.value})),O=te(()=>({background:!0,pageSizes:[10,20,30,50],layout:"total, sizes, prev, pager, next, jumper",...i.tableConfig?.pagination?.attributes,total:i.tableConfig?.pagination?.total||0,pageSize:c.value,currentPage:d.value})),$=te(()=>({...x.value,...h.value})),K=te(()=>i.tableConfig?.search?.column.filter(I=>I.autoQuery??!0).map(I=>I.prop));function F(){const I={};return i.tableConfig?.search?.column?.forEach(A=>{I[A.prop]=A.value}),I}async function P(){m.value!=="NOT_CHANGE"&&(w.value&&(u.value=!0),i.tableConfig?.fetchData?.($.value)?.finally(()=>{m.value="NOT_CHANGE",u.value=!1}))}async function N(){await P()}async function M(){m.value="UNKNOWN",await P()}async function q(){d.value=1,m.value!=="AUTO_QUERY"&&await P()}async function le(I){d.value=1,c.value=I}async function de(I){d.value=I}function Y(){m.value="UNKNOWN",P()}return $e(()=>JSON.stringify(h.value),(I,A)=>{m.value="UNKNOWN";const Q=JSON.parse(I??"{}"),U=JSON.parse(A??"{}"),ie=Object.keys(Q),ve=Object.keys(U);let re=[];ie.length===ve.length?re=Object.keys(Q).filter(ge=>Q[ge]!==U[ge]):re=q_(ie,ve),K.value?.length&&W_(re,[...K.value]).length&&(m.value="AUTO_QUERY",P())}),$e(()=>JSON.stringify(x.value),()=>{m.value="UNKNOWN",P()}),zt(()=>{l.value?.set?.(c.value)}),et(()=>{P()}),e({getTableRef:()=>r.value,forceRefreshData:Y}),(I,A)=>{const Q=qp;return it((y(),T("div",{class:"w-full h-full flex flex-col overflow-hidden",style:At(S.value)},[t.tableConfig.search?(y(),T("div",Rw,[Ve(I.$slots,"search",{},()=>[j(Pw,{modelValue:h.value,"onUpdate:modelValue":A[0]||(A[0]=U=>h.value=U),config:t.tableConfig.search,size:p.value,onSearch:N,onRefresh:M,onReset:q},null,8,["modelValue","config","size"])],!0)])):ue("",!0),Ve(I.$slots,"tableBefore",{},void 0,!0),g("div",Iw,[Ve(I.$slots,"table",{},()=>[j(v(B_),We({ref:"table",size:p.value,data:t.tableConfig.data,height:C.value},v(n)),p_({default:we(()=>[(y(!0),T(Ie,null,He(t.tableConfig.column,(U,ie)=>(y(),T(Ie,null,[U.slot?Ve(I.$slots,U.slot,{key:0,col:U,index:ie},void 0,!0):(y(),ne(v(V_),We({key:`default-${ie}`},{ref_for:!0},U),null,16))],64))),256))]),_:2},[He(f.value,U=>({name:U,fn:we(ie=>[Ve(I.$slots,U,wn(Jn(ie)),void 0,!0)])}))]),1040,["size","data","height"])],!0)],512),b.value?(y(),T("div",Mw,[Ve(I.$slots,"pagination",{},()=>[j(v(H_),We({size:p.value},O.value,{onSizeChange:le,onCurrentChange:de},bn(t.tableConfig?.pagination?.events||{})),null,16,["size"])],!0)])):ue("",!0)],4)),[[Q,u.value]])}}}),bd=ac(Fw,[["__scopeId","data-v-ce25225b"]]);let cl={};const Dw=()=>cl,Lw={...bd,install(t,e){e&&(cl={...cl,...e}),t.component("BaseTable",bd)}},jw={class:"overflow-hidden size-full"},zw=Ce({__name:"Main",setup(t){const e=Xo(),n=new Map,i=te(()=>e.visitedViews.map(s=>o(s)));function o(s){const{path:a}=s,{[vt.ROUTE_STATE_KEY_VERSION]:l}=s.query;return l?`${a}?${vt.ROUTE_STATE_KEY_VERSION}=${l}`:a}function r(s,a){const l=o(a);if(!n.has(l)){const c=Ce({name:l,setup(){return()=>Oo(s)}});n.set(l,c)}return n.get(l)}return $e(()=>i.value,(s,a)=>{const l=a.filter(c=>!s.includes(c));l.length&&n.delete(l[0])},{deep:!0}),(s,a)=>{const l=Ue("router-view");return y(),T("div",jw,[j(l,null,{default:we(({Component:c,route:u})=>[j(v(Ew),null,{default:we(()=>[(y(),ne(f_,{include:i.value},[(y(),ne($t(r(c,u))))],1032,["include"]))]),_:2},1024)]),_:1})])}}});var oa,wd;function Nw(){if(wd)return oa;wd=1;function t(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function e(o,r){for(var s="",a=0,l=-1,c=0,u,d=0;d<=o.length;++d){if(d<o.length)u=o.charCodeAt(d);else{if(u===47)break;u=47}if(u===47){if(!(l===d-1||c===1))if(l!==d-1&&c===2){if(s.length<2||a!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var h=s.lastIndexOf("/");if(h!==s.length-1){h===-1?(s="",a=0):(s=s.slice(0,h),a=s.length-1-s.lastIndexOf("/")),l=d,c=0;continue}}else if(s.length===2||s.length===1){s="",a=0,l=d,c=0;continue}}r&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+o.slice(l+1,d):s=o.slice(l+1,d),a=d-l-1;l=d,c=0}else u===46&&c!==-1?++c:c=-1}return s}function n(o,r){var s=r.dir||r.root,a=r.base||(r.name||"")+(r.ext||"");return s?s===r.root?s+a:s+o+a:a}var i={resolve:function(){for(var r="",s=!1,a,l=arguments.length-1;l>=-1&&!s;l--){var c;l>=0?c=arguments[l]:(a===void 0&&(a=process.cwd()),c=a),t(c),c.length!==0&&(r=c+"/"+r,s=c.charCodeAt(0)===47)}return r=e(r,!s),s?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(r){if(t(r),r.length===0)return".";var s=r.charCodeAt(0)===47,a=r.charCodeAt(r.length-1)===47;return r=e(r,!s),r.length===0&&!s&&(r="."),r.length>0&&a&&(r+="/"),s?"/"+r:r},isAbsolute:function(r){return t(r),r.length>0&&r.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var r,s=0;s<arguments.length;++s){var a=arguments[s];t(a),a.length>0&&(r===void 0?r=a:r+="/"+a)}return r===void 0?".":i.normalize(r)},relative:function(r,s){if(t(r),t(s),r===s||(r=i.resolve(r),s=i.resolve(s),r===s))return"";for(var a=1;a<r.length&&r.charCodeAt(a)===47;++a);for(var l=r.length,c=l-a,u=1;u<s.length&&s.charCodeAt(u)===47;++u);for(var d=s.length,h=d-u,m=c<h?c:h,f=-1,p=0;p<=m;++p){if(p===m){if(h>m){if(s.charCodeAt(u+p)===47)return s.slice(u+p+1);if(p===0)return s.slice(u+p)}else c>m&&(r.charCodeAt(a+p)===47?f=p:p===0&&(f=0));break}var _=r.charCodeAt(a+p),C=s.charCodeAt(u+p);if(_!==C)break;_===47&&(f=p)}var w="";for(p=a+f+1;p<=l;++p)(p===l||r.charCodeAt(p)===47)&&(w.length===0?w+="..":w+="/..");return w.length>0?w+s.slice(u+f):(u+=f,s.charCodeAt(u)===47&&++u,s.slice(u))},_makeLong:function(r){return r},dirname:function(r){if(t(r),r.length===0)return".";for(var s=r.charCodeAt(0),a=s===47,l=-1,c=!0,u=r.length-1;u>=1;--u)if(s=r.charCodeAt(u),s===47){if(!c){l=u;break}}else c=!1;return l===-1?a?"/":".":a&&l===1?"//":r.slice(0,l)},basename:function(r,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');t(r);var a=0,l=-1,c=!0,u;if(s!==void 0&&s.length>0&&s.length<=r.length){if(s.length===r.length&&s===r)return"";var d=s.length-1,h=-1;for(u=r.length-1;u>=0;--u){var m=r.charCodeAt(u);if(m===47){if(!c){a=u+1;break}}else h===-1&&(c=!1,h=u+1),d>=0&&(m===s.charCodeAt(d)?--d===-1&&(l=u):(d=-1,l=h))}return a===l?l=h:l===-1&&(l=r.length),r.slice(a,l)}else{for(u=r.length-1;u>=0;--u)if(r.charCodeAt(u)===47){if(!c){a=u+1;break}}else l===-1&&(c=!1,l=u+1);return l===-1?"":r.slice(a,l)}},extname:function(r){t(r);for(var s=-1,a=0,l=-1,c=!0,u=0,d=r.length-1;d>=0;--d){var h=r.charCodeAt(d);if(h===47){if(!c){a=d+1;break}continue}l===-1&&(c=!1,l=d+1),h===46?s===-1?s=d:u!==1&&(u=1):s!==-1&&(u=-1)}return s===-1||l===-1||u===0||u===1&&s===l-1&&s===a+1?"":r.slice(s,l)},format:function(r){if(r===null||typeof r!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof r);return n("/",r)},parse:function(r){t(r);var s={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return s;var a=r.charCodeAt(0),l=a===47,c;l?(s.root="/",c=1):c=0;for(var u=-1,d=0,h=-1,m=!0,f=r.length-1,p=0;f>=c;--f){if(a=r.charCodeAt(f),a===47){if(!m){d=f+1;break}continue}h===-1&&(m=!1,h=f+1),a===46?u===-1?u=f:p!==1&&(p=1):u!==-1&&(p=-1)}return u===-1||h===-1||p===0||p===1&&u===h-1&&u===d+1?h!==-1&&(d===0&&l?s.base=s.name=r.slice(1,h):s.base=s.name=r.slice(d,h)):(d===0&&l?(s.name=r.slice(1,u),s.base=r.slice(1,h)):(s.name=r.slice(d,u),s.base=r.slice(d,h)),s.ext=r.slice(u,h)),d>0?s.dir=r.slice(0,d-1):l&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,oa=i,oa}var Uw=Nw();const Vw=Di(Uw);function fc(){const{t}=Yo();return{getTitle:n=>n?n.includes(".")&&!n.startsWith("http")?t(n):n:""}}const Bw={class:"truncate"},Hw=Ce({__name:"MenuItem",props:{route:{},fullPath:{}},setup(t){const{getTitle:e}=fc(),n=_s(),i=t;function o(){n.push({path:i.fullPath})}return(r,s)=>{const a=Po,l=K_;return y(),T("span",{onClick:o},[j(l,{index:t.fullPath},{title:we(()=>[g("span",Bw,L(v(e)(t.route.meta?.title)),1)]),default:we(()=>[j(a,null,{default:we(()=>[(y(),ne($t(t.route.meta?.icon)))]),_:1})]),_:1},8,["index"])])}}});function Hf(t,e){return function(){return t.apply(e,arguments)}}const{toString:qw}=Object.prototype,{getPrototypeOf:xs}=Object,{iterator:Ts,toStringTag:qf}=Symbol,$s=(t=>e=>{const n=qw.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Cn=t=>(t=t.toLowerCase(),e=>$s(e)===t),ks=t=>e=>typeof e===t,{isArray:po}=Array,to=ks("undefined");function Jo(t){return t!==null&&!to(t)&&t.constructor!==null&&!to(t.constructor)&&Ht(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Wf=Cn("ArrayBuffer");function Ww(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Wf(t.buffer),e}const Kw=ks("string"),Ht=ks("function"),Kf=ks("number"),Zo=t=>t!==null&&typeof t=="object",Yw=t=>t===!0||t===!1,Hr=t=>{if($s(t)!=="object")return!1;const e=xs(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(qf in t)&&!(Ts in t)},Gw=t=>{if(!Zo(t)||Jo(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Qw=Cn("Date"),Xw=Cn("File"),Jw=t=>!!(t&&typeof t.uri<"u"),Zw=t=>t&&typeof t.getParts<"u",e1=Cn("Blob"),t1=Cn("FileList"),n1=t=>Zo(t)&&Ht(t.pipe);function i1(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Sd=i1(),Cd=typeof Sd.FormData<"u"?Sd.FormData:void 0,o1=t=>{if(!t)return!1;if(Cd&&t instanceof Cd)return!0;const e=xs(t);if(!e||e===Object.prototype||!Ht(t.append))return!1;const n=$s(t);return n==="formdata"||n==="object"&&Ht(t.toString)&&t.toString()==="[object FormData]"},r1=Cn("URLSearchParams"),[s1,a1,l1,c1]=["ReadableStream","Request","Response","Headers"].map(Cn),u1=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function er(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let i,o;if(typeof t!="object"&&(t=[t]),po(t))for(i=0,o=t.length;i<o;i++)e.call(null,t[i],i,t);else{if(Jo(t))return;const r=n?Object.getOwnPropertyNames(t):Object.keys(t),s=r.length;let a;for(i=0;i<s;i++)a=r[i],e.call(null,t[a],a,t)}}function Yf(t,e){if(Jo(t))return null;e=e.toLowerCase();const n=Object.keys(t);let i=n.length,o;for(;i-- >0;)if(o=n[i],e===o.toLowerCase())return o;return null}const $i=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Gf=t=>!to(t)&&t!==$i;function ul(){const{caseless:t,skipUndefined:e}=Gf(this)&&this||{},n={},i=(o,r)=>{if(r==="__proto__"||r==="constructor"||r==="prototype")return;const s=t&&Yf(n,r)||r;Hr(n[s])&&Hr(o)?n[s]=ul(n[s],o):Hr(o)?n[s]=ul({},o):po(o)?n[s]=o.slice():(!e||!to(o))&&(n[s]=o)};for(let o=0,r=arguments.length;o<r;o++)arguments[o]&&er(arguments[o],i);return n}const d1=(t,e,n,{allOwnKeys:i}={})=>(er(e,(o,r)=>{n&&Ht(o)?Object.defineProperty(t,r,{value:Hf(o,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),t),h1=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),p1=(t,e,n,i)=>{t.prototype=Object.create(e.prototype,i),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},f1=(t,e,n,i)=>{let o,r,s;const a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),r=o.length;r-- >0;)s=o[r],(!i||i(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&xs(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},m1=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const i=t.indexOf(e,n);return i!==-1&&i===n},v1=t=>{if(!t)return null;if(po(t))return t;let e=t.length;if(!Kf(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},g1=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&xs(Uint8Array)),_1=(t,e)=>{const i=(t&&t[Ts]).call(t);let o;for(;(o=i.next())&&!o.done;){const r=o.value;e.call(t,r[0],r[1])}},y1=(t,e)=>{let n;const i=[];for(;(n=t.exec(e))!==null;)i.push(n);return i},b1=Cn("HTMLFormElement"),w1=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,o){return i.toUpperCase()+o}),Ed=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),S1=Cn("RegExp"),Qf=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),i={};er(n,(o,r)=>{let s;(s=e(o,r,t))!==!1&&(i[r]=s||o)}),Object.defineProperties(t,i)},C1=t=>{Qf(t,(e,n)=>{if(Ht(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=t[n];if(Ht(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},E1=(t,e)=>{const n={},i=o=>{o.forEach(r=>{n[r]=!0})};return po(t)?i(t):i(String(t).split(e)),n},x1=()=>{},T1=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function $1(t){return!!(t&&Ht(t.append)&&t[qf]==="FormData"&&t[Ts])}const k1=t=>{const e=new Array(10),n=(i,o)=>{if(Zo(i)){if(e.indexOf(i)>=0)return;if(Jo(i))return i;if(!("toJSON"in i)){e[o]=i;const r=po(i)?[]:{};return er(i,(s,a)=>{const l=n(s,o+1);!to(l)&&(r[a]=l)}),e[o]=void 0,r}}return i};return n(t,0)},O1=Cn("AsyncFunction"),A1=t=>t&&(Zo(t)||Ht(t))&&Ht(t.then)&&Ht(t.catch),Xf=((t,e)=>t?setImmediate:e?((n,i)=>($i.addEventListener("message",({source:o,data:r})=>{o===$i&&r===n&&i.length&&i.shift()()},!1),o=>{i.push(o),$i.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ht($i.postMessage)),P1=typeof queueMicrotask<"u"?queueMicrotask.bind($i):typeof process<"u"&&process.nextTick||Xf,R1=t=>t!=null&&Ht(t[Ts]),W={isArray:po,isArrayBuffer:Wf,isBuffer:Jo,isFormData:o1,isArrayBufferView:Ww,isString:Kw,isNumber:Kf,isBoolean:Yw,isObject:Zo,isPlainObject:Hr,isEmptyObject:Gw,isReadableStream:s1,isRequest:a1,isResponse:l1,isHeaders:c1,isUndefined:to,isDate:Qw,isFile:Xw,isReactNativeBlob:Jw,isReactNative:Zw,isBlob:e1,isRegExp:S1,isFunction:Ht,isStream:n1,isURLSearchParams:r1,isTypedArray:g1,isFileList:t1,forEach:er,merge:ul,extend:d1,trim:u1,stripBOM:h1,inherits:p1,toFlatObject:f1,kindOf:$s,kindOfTest:Cn,endsWith:m1,toArray:v1,forEachEntry:_1,matchAll:y1,isHTMLForm:b1,hasOwnProperty:Ed,hasOwnProp:Ed,reduceDescriptors:Qf,freezeMethods:C1,toObjectSet:E1,toCamelCase:w1,noop:x1,toFiniteNumber:T1,findKey:Yf,global:$i,isContextDefined:Gf,isSpecCompliantForm:$1,toJSONObject:k1,isAsyncFn:O1,isThenable:A1,setImmediate:Xf,asap:P1,isIterable:R1};let De=class Jf extends Error{static from(e,n,i,o,r,s){const a=new Jf(e.message,n||e.code,i,o,r);return a.cause=e,a.name=e.name,e.status!=null&&a.status==null&&(a.status=e.status),s&&Object.assign(a,s),a}constructor(e,n,i,o,r){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),i&&(this.config=i),o&&(this.request=o),r&&(this.response=r,this.status=r.status)}toJSON(){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:W.toJSONObject(this.config),code:this.code,status:this.status}}};De.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";De.ERR_BAD_OPTION="ERR_BAD_OPTION";De.ECONNABORTED="ECONNABORTED";De.ETIMEDOUT="ETIMEDOUT";De.ERR_NETWORK="ERR_NETWORK";De.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";De.ERR_DEPRECATED="ERR_DEPRECATED";De.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";De.ERR_BAD_REQUEST="ERR_BAD_REQUEST";De.ERR_CANCELED="ERR_CANCELED";De.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";De.ERR_INVALID_URL="ERR_INVALID_URL";De.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const I1=null;function dl(t){return W.isPlainObject(t)||W.isArray(t)}function Zf(t){return W.endsWith(t,"[]")?t.slice(0,-2):t}function ra(t,e,n){return t?t.concat(e).map(function(o,r){return o=Zf(o),!n&&r?"["+o+"]":o}).join(n?".":""):e}function M1(t){return W.isArray(t)&&!t.some(dl)}const F1=W.toFlatObject(W,{},null,function(e){return/^is[A-Z]/.test(e)});function Os(t,e,n){if(!W.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=W.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(_,C){return!W.isUndefined(C[_])});const i=n.metaTokens,o=n.visitor||d,r=n.dots,s=n.indexes,a=n.Blob||typeof Blob<"u"&&Blob,l=n.maxDepth===void 0?100:n.maxDepth,c=a&&W.isSpecCompliantForm(e);if(!W.isFunction(o))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(W.isDate(p))return p.toISOString();if(W.isBoolean(p))return p.toString();if(!c&&W.isBlob(p))throw new De("Blob is not supported. Use a Buffer instead.");return W.isArrayBuffer(p)||W.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function d(p,_,C){let w=p;if(W.isReactNative(e)&&W.isReactNativeBlob(p))return e.append(ra(C,_,r),u(p)),!1;if(p&&!C&&typeof p=="object"){if(W.endsWith(_,"{}"))_=i?_:_.slice(0,-2),p=JSON.stringify(p);else if(W.isArray(p)&&M1(p)||(W.isFileList(p)||W.endsWith(_,"[]"))&&(w=W.toArray(p)))return _=Zf(_),w.forEach(function(b,E){!(W.isUndefined(b)||b===null)&&e.append(s===!0?ra([_],E,r):s===null?_:_+"[]",u(b))}),!1}return dl(p)?!0:(e.append(ra(C,_,r),u(p)),!1)}const h=[],m=Object.assign(F1,{defaultVisitor:d,convertValue:u,isVisitable:dl});function f(p,_,C=0){if(!W.isUndefined(p)){if(C>l)throw new De("Object is too deeply nested ("+C+" levels). Max depth: "+l,De.ERR_FORM_DATA_DEPTH_EXCEEDED);if(h.indexOf(p)!==-1)throw Error("Circular reference detected in "+_.join("."));h.push(p),W.forEach(p,function(S,b){(!(W.isUndefined(S)||S===null)&&o.call(e,S,W.isString(b)?b.trim():b,_,m))===!0&&f(S,_?_.concat(b):[b],C+1)}),h.pop()}}if(!W.isObject(t))throw new TypeError("data must be an object");return f(t),e}function xd(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(t).replace(/[!'()~]|%20/g,function(i){return e[i]})}function mc(t,e){this._pairs=[],t&&Os(t,this,e)}const em=mc.prototype;em.append=function(e,n){this._pairs.push([e,n])};em.toString=function(e){const n=e?function(i){return e.call(this,i,xd)}:xd;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function D1(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function tm(t,e,n){if(!e)return t;const i=n&&n.encode||D1,o=W.isFunction(n)?{serialize:n}:n,r=o&&o.serialize;let s;if(r?s=r(e,o):s=W.isURLSearchParams(e)?e.toString():new mc(e,o).toString(i),s){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class Td{constructor(){this.handlers=[]}use(e,n,i){return this.handlers.push({fulfilled:e,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){W.forEach(this.handlers,function(i){i!==null&&e(i)})}}const vc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},L1=typeof URLSearchParams<"u"?URLSearchParams:mc,j1=typeof FormData<"u"?FormData:null,z1=typeof Blob<"u"?Blob:null,N1={isBrowser:!0,classes:{URLSearchParams:L1,FormData:j1,Blob:z1},protocols:["http","https","file","blob","url","data"]},gc=typeof window<"u"&&typeof document<"u",hl=typeof navigator=="object"&&navigator||void 0,U1=gc&&(!hl||["ReactNative","NativeScript","NS"].indexOf(hl.product)<0),V1=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",B1=gc&&window.location.href||"http://localhost",H1=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:gc,hasStandardBrowserEnv:U1,hasStandardBrowserWebWorkerEnv:V1,navigator:hl,origin:B1},Symbol.toStringTag,{value:"Module"})),Ot={...H1,...N1};function q1(t,e){return Os(t,new Ot.classes.URLSearchParams,{visitor:function(n,i,o,r){return Ot.isNode&&W.isBuffer(n)?(this.append(i,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...e})}function W1(t){return W.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function K1(t){const e={},n=Object.keys(t);let i;const o=n.length;let r;for(i=0;i<o;i++)r=n[i],e[r]=t[r];return e}function nm(t){function e(n,i,o,r){let s=n[r++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),l=r>=n.length;return s=!s&&W.isArray(o)?o.length:s,l?(W.hasOwnProp(o,s)?o[s]=W.isArray(o[s])?o[s].concat(i):[o[s],i]:o[s]=i,!a):((!o[s]||!W.isObject(o[s]))&&(o[s]=[]),e(n,i,o[s],r)&&W.isArray(o[s])&&(o[s]=K1(o[s])),!a)}if(W.isFormData(t)&&W.isFunction(t.entries)){const n={};return W.forEachEntry(t,(i,o)=>{e(W1(i),o,n,0)}),n}return null}const ji=(t,e)=>t!=null&&W.hasOwnProp(t,e)?t[e]:void 0;function Y1(t,e,n){if(W.isString(t))try{return(e||JSON.parse)(t),W.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(t)}const tr={transitional:vc,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const i=n.getContentType()||"",o=i.indexOf("application/json")>-1,r=W.isObject(e);if(r&&W.isHTMLForm(e)&&(e=new FormData(e)),W.isFormData(e))return o?JSON.stringify(nm(e)):e;if(W.isArrayBuffer(e)||W.isBuffer(e)||W.isStream(e)||W.isFile(e)||W.isBlob(e)||W.isReadableStream(e))return e;if(W.isArrayBufferView(e))return e.buffer;if(W.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(r){const l=ji(this,"formSerializer");if(i.indexOf("application/x-www-form-urlencoded")>-1)return q1(e,l).toString();if((a=W.isFileList(e))||i.indexOf("multipart/form-data")>-1){const c=ji(this,"env"),u=c&&c.FormData;return Os(a?{"files[]":e}:e,u&&new u,l)}}return r||o?(n.setContentType("application/json",!1),Y1(e)):e}],transformResponse:[function(e){const n=ji(this,"transitional")||tr.transitional,i=n&&n.forcedJSONParsing,o=ji(this,"responseType"),r=o==="json";if(W.isResponse(e)||W.isReadableStream(e))return e;if(e&&W.isString(e)&&(i&&!o||r)){const a=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(e,ji(this,"parseReviver"))}catch(l){if(a)throw l.name==="SyntaxError"?De.from(l,De.ERR_BAD_RESPONSE,this,null,ji(this,"response")):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ot.classes.FormData,Blob:Ot.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};W.forEach(["delete","get","head","post","put","patch"],t=>{tr.headers[t]={}});const G1=W.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"]),Q1=t=>{const e={};let n,i,o;return t&&t.split(`
|
|
4
|
-
`).forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),i=s.substring(o+1).trim(),!(!n||e[n]&&
|
|
5
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const i=new this(e);return n.forEach(o=>i.set(o)),i}static accessor(e){const i=(this[$d]=this[$d]={accessors:{}}).accessors,o=this.prototype;function r(s){const a=bo(s);i[a]||(iS(o,s),i[a]=!0)}return W.isArray(e)?e.forEach(r):r(e),this}};qt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);W.reduceDescriptors(qt.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(i){this[n]=i}}});W.freezeMethods(qt);function aa(t,e){const n=this||tr,i=e||n,o=qt.from(i.headers);let r=i.data;return W.forEach(t,function(a){r=a.call(n,r,o.normalize(),e?e.status:void 0)}),o.normalize(),r}function im(t){return!!(t&&t.__CANCEL__)}let nr=class extends De{constructor(e,n,i){super(e??"canceled",De.ERR_CANCELED,n,i),this.name="CanceledError",this.__CANCEL__=!0}};function om(t,e,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?t(n):e(new De("Request failed with status code "+n.status,[De.ERR_BAD_REQUEST,De.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function oS(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function rS(t,e){t=t||10;const n=new Array(t),i=new Array(t);let o=0,r=0,s;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=i[r];s||(s=c),n[o]=l,i[o]=c;let d=r,h=0;for(;d!==o;)h+=n[d++],d=d%t;if(o=(o+1)%t,o===r&&(r=(r+1)%t),c-s<e)return;const m=u&&c-u;return m?Math.round(h*1e3/m):void 0}}function sS(t,e){let n=0,i=1e3/e,o,r;const s=(c,u=Date.now())=>{n=u,o=null,r&&(clearTimeout(r),r=null),t(...c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=i?s(c,u):(o=c,r||(r=setTimeout(()=>{r=null,s(o)},i-d)))},()=>o&&s(o)]}const ss=(t,e,n=3)=>{let i=0;const o=rS(50,250);return sS(r=>{const s=r.loaded,a=r.lengthComputable?r.total:void 0,l=a!=null?Math.min(s,a):s,c=Math.max(0,l-i),u=o(c);i=Math.max(i,l);const d={loaded:l,total:a,progress:a?l/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a?(a-l)/u:void 0,event:r,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(d)},n)},kd=(t,e)=>{const n=t!=null;return[i=>e[0]({lengthComputable:n,total:t,loaded:i}),e[1]]},Od=t=>(...e)=>W.asap(()=>t(...e)),aS=Ot.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Ot.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Ot.origin),Ot.navigator&&/(msie|trident)/i.test(Ot.navigator.userAgent)):()=>!0,lS=Ot.hasStandardBrowserEnv?{write(t,e,n,i,o,r,s){if(typeof document>"u")return;const a=[`${t}=${encodeURIComponent(e)}`];W.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),W.isString(i)&&a.push(`path=${i}`),W.isString(o)&&a.push(`domain=${o}`),r===!0&&a.push("secure"),W.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function cS(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function uS(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function rm(t,e,n){let i=!cS(e);return t&&(i||n===!1)?uS(t,e):e}const Ad=t=>t instanceof qt?{...t}:t;function Ii(t,e){e=e||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function i(c,u,d,h){return W.isPlainObject(c)&&W.isPlainObject(u)?W.merge.call({caseless:h},c,u):W.isPlainObject(u)?W.merge({},u):W.isArray(u)?u.slice():u}function o(c,u,d,h){if(W.isUndefined(u)){if(!W.isUndefined(c))return i(void 0,c,d,h)}else return i(c,u,d,h)}function r(c,u){if(!W.isUndefined(u))return i(void 0,u)}function s(c,u){if(W.isUndefined(u)){if(!W.isUndefined(c))return i(void 0,c)}else return i(void 0,u)}function a(c,u,d){if(W.hasOwnProp(e,d))return i(c,u);if(W.hasOwnProp(t,d))return i(void 0,c)}const l={url:r,method:r,data:r,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,allowedSocketPaths:s,responseEncoding:s,validateStatus:a,headers:(c,u,d)=>o(Ad(c),Ad(u),d,!0)};return W.forEach(Object.keys({...t,...e}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const d=W.hasOwnProp(l,u)?l[u]:o,h=W.hasOwnProp(t,u)?t[u]:void 0,m=W.hasOwnProp(e,u)?e[u]:void 0,f=d(h,m,u);W.isUndefined(f)&&d!==a||(n[u]=f)}),n}const sm=t=>{const e=Ii({},t),n=h=>W.hasOwnProp(e,h)?e[h]:void 0,i=n("data");let o=n("withXSRFToken");const r=n("xsrfHeaderName"),s=n("xsrfCookieName");let a=n("headers");const l=n("auth"),c=n("baseURL"),u=n("allowAbsoluteUrls"),d=n("url");if(e.headers=a=qt.from(a),e.url=tm(rm(c,d,u),t.params,t.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),W.isFormData(i)){if(Ot.hasStandardBrowserEnv||Ot.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(W.isFunction(i.getHeaders)){const h=i.getHeaders(),m=["content-type","content-length"];Object.entries(h).forEach(([f,p])=>{m.includes(f.toLowerCase())&&a.set(f,p)})}}if(Ot.hasStandardBrowserEnv&&(W.isFunction(o)&&(o=o(e)),o===!0||o==null&&aS(e.url))){const m=r&&s&&lS.read(s);m&&a.set(r,m)}return e},dS=typeof XMLHttpRequest<"u",hS=dS&&function(t){return new Promise(function(n,i){const o=sm(t);let r=o.data;const s=qt.from(o.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=o,u,d,h,m,f;function p(){m&&m(),f&&f(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let _=new XMLHttpRequest;_.open(o.method.toUpperCase(),o.url,!0),_.timeout=o.timeout;function C(){if(!_)return;const S=qt.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),E={data:!a||a==="text"||a==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:S,config:t,request:_};om(function(O){n(O),p()},function(O){i(O),p()},E),_=null}"onloadend"in _?_.onloadend=C:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(C)},_.onabort=function(){_&&(i(new De("Request aborted",De.ECONNABORTED,t,_)),_=null)},_.onerror=function(b){const E=b&&b.message?b.message:"Network Error",x=new De(E,De.ERR_NETWORK,t,_);x.event=b||null,i(x),_=null},_.ontimeout=function(){let b=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const E=o.transitional||vc;o.timeoutErrorMessage&&(b=o.timeoutErrorMessage),i(new De(b,E.clarifyTimeoutError?De.ETIMEDOUT:De.ECONNABORTED,t,_)),_=null},r===void 0&&s.setContentType(null),"setRequestHeader"in _&&W.forEach(s.toJSON(),function(b,E){_.setRequestHeader(E,b)}),W.isUndefined(o.withCredentials)||(_.withCredentials=!!o.withCredentials),a&&a!=="json"&&(_.responseType=o.responseType),c&&([h,f]=ss(c,!0),_.addEventListener("progress",h)),l&&_.upload&&([d,m]=ss(l),_.upload.addEventListener("progress",d),_.upload.addEventListener("loadend",m)),(o.cancelToken||o.signal)&&(u=S=>{_&&(i(!S||S.type?new nr(null,t,_):S),_.abort(),_=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const w=oS(o.url);if(w&&Ot.protocols.indexOf(w)===-1){i(new De("Unsupported protocol "+w+":",De.ERR_BAD_REQUEST,t));return}_.send(r||null)})},pS=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let i=new AbortController,o;const r=function(c){if(!o){o=!0,a();const u=c instanceof Error?c:this.reason;i.abort(u instanceof De?u:new nr(u instanceof Error?u.message:u))}};let s=e&&setTimeout(()=>{s=null,r(new De(`timeout of ${e}ms exceeded`,De.ETIMEDOUT))},e);const a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),t=null)};t.forEach(c=>c.addEventListener("abort",r));const{signal:l}=i;return l.unsubscribe=()=>W.asap(a),l}},fS=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let i=0,o;for(;i<n;)o=i+e,yield t.slice(i,o),i=o},mS=async function*(t,e){for await(const n of vS(t))yield*fS(n,e)},vS=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:i}=await e.read();if(n)break;yield i}}finally{await e.cancel()}},Pd=(t,e,n,i)=>{const o=mS(t,e);let r=0,s,a=l=>{s||(s=!0,i&&i(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await o.next();if(c){a(),l.close();return}let d=u.byteLength;if(n){let h=r+=d;n(h)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),o.return()}},{highWaterMark:2})},Rd=64*1024,{isFunction:_r}=W,gS=(({Request:t,Response:e})=>({Request:t,Response:e}))(W.global),{ReadableStream:Id,TextEncoder:Md}=W.global,Fd=(t,...e)=>{try{return!!t(...e)}catch{return!1}},_S=t=>{t=W.merge.call({skipUndefined:!0},gS,t);const{fetch:e,Request:n,Response:i}=t,o=e?_r(e):typeof fetch=="function",r=_r(n),s=_r(i);if(!o)return!1;const a=o&&_r(Id),l=o&&(typeof Md=="function"?(f=>p=>f.encode(p))(new Md):async f=>new Uint8Array(await new n(f).arrayBuffer())),c=r&&a&&Fd(()=>{let f=!1;const p=new n(Ot.origin,{body:new Id,method:"POST",get duplex(){return f=!0,"half"}}),_=p.headers.has("Content-Type");return p.body!=null&&p.body.cancel(),f&&!_}),u=s&&a&&Fd(()=>W.isReadableStream(new i("").body)),d={stream:u&&(f=>f.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!d[f]&&(d[f]=(p,_)=>{let C=p&&p[f];if(C)return C.call(p);throw new De(`Response type '${f}' is not supported`,De.ERR_NOT_SUPPORT,_)})});const h=async f=>{if(f==null)return 0;if(W.isBlob(f))return f.size;if(W.isSpecCompliantForm(f))return(await new n(Ot.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(W.isArrayBufferView(f)||W.isArrayBuffer(f))return f.byteLength;if(W.isURLSearchParams(f)&&(f=f+""),W.isString(f))return(await l(f)).byteLength},m=async(f,p)=>{const _=W.toFiniteNumber(f.getContentLength());return _??h(p)};return async f=>{let{url:p,method:_,data:C,signal:w,cancelToken:S,timeout:b,onDownloadProgress:E,onUploadProgress:x,responseType:O,headers:$,withCredentials:K="same-origin",fetchOptions:F}=sm(f),P=e||fetch;O=O?(O+"").toLowerCase():"text";let N=pS([w,S&&S.toAbortSignal()],b),M=null;const q=N&&N.unsubscribe&&(()=>{N.unsubscribe()});let le;try{if(x&&c&&_!=="get"&&_!=="head"&&(le=await m($,C))!==0){let U=new n(p,{method:"POST",body:C,duplex:"half"}),ie;if(W.isFormData(C)&&(ie=U.headers.get("content-type"))&&$.setContentType(ie),U.body){const[ve,re]=kd(le,ss(Od(x)));C=Pd(U.body,Rd,ve,re)}}W.isString(K)||(K=K?"include":"omit");const de=r&&"credentials"in n.prototype;if(W.isFormData(C)){const U=$.getContentType();U&&/^multipart\/form-data/i.test(U)&&!/boundary=/i.test(U)&&$.delete("content-type")}const Y={...F,signal:N,method:_.toUpperCase(),headers:$.normalize().toJSON(),body:C,duplex:"half",credentials:de?K:void 0};M=r&&new n(p,Y);let I=await(r?P(M,F):P(p,Y));const A=u&&(O==="stream"||O==="response");if(u&&(E||A&&q)){const U={};["status","statusText","headers"].forEach(ge=>{U[ge]=I[ge]});const ie=W.toFiniteNumber(I.headers.get("content-length")),[ve,re]=E&&kd(ie,ss(Od(E),!0))||[];I=new i(Pd(I.body,Rd,ve,()=>{re&&re(),q&&q()}),U)}O=O||"text";let Q=await d[W.findKey(d,O)||"text"](I,f);return!A&&q&&q(),await new Promise((U,ie)=>{om(U,ie,{data:Q,headers:qt.from(I.headers),status:I.status,statusText:I.statusText,config:f,request:M})})}catch(de){throw q&&q(),de&&de.name==="TypeError"&&/Load failed|fetch/i.test(de.message)?Object.assign(new De("Network Error",De.ERR_NETWORK,f,M,de&&de.response),{cause:de.cause||de}):De.from(de,de&&de.code,f,M,de&&de.response)}}},yS=new Map,am=t=>{let e=t&&t.env||{};const{fetch:n,Request:i,Response:o}=e,r=[i,o,n];let s=r.length,a=s,l,c,u=yS;for(;a--;)l=r[a],c=u.get(l),c===void 0&&u.set(l,c=a?new Map:_S(e)),u=c;return c};am();const _c={http:I1,xhr:hS,fetch:{get:am}};W.forEach(_c,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Dd=t=>`- ${t}`,bS=t=>W.isFunction(t)||t===null||t===!1;function wS(t,e){t=W.isArray(t)?t:[t];const{length:n}=t;let i,o;const r={};for(let s=0;s<n;s++){i=t[s];let a;if(o=i,!bS(i)&&(o=_c[(a=String(i)).toLowerCase()],o===void 0))throw new De(`Unknown adapter '${a}'`);if(o&&(W.isFunction(o)||(o=o.get(e))))break;r[a||"#"+s]=o}if(!o){const s=Object.entries(r).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=n?s.length>1?`since :
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-RcR0UXkh.js","./vendor-ui-CGT0cG1n.js","./vendor-core-BKehvho7.js","./LoadingWrapper.vue_vue_type_script_setup_true_lang-kJcgjuK5.js","./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-pswB5SUz.js","./BaseDialog.vue_vue_type_script_setup_true_lang-BROcUfEh.js","./el-dropdown-item-BeIfAqTO.css","./el-card-BAyktVMS.css","./index-DbmFA7Z2.js","./index.vue_vue_type_script_setup_true_lang-BYKlY94g.js","./useCacheOssStore-OAoLDVbw.js","./index-DOlF0Z_P.css","./index.vue_vue_type_script_setup_true_lang-CgaIiyg6.js","./index-DkakQhTy.js","./index-B78Rw6nE.css","./useVscodeOpen-SZpyzVHG.js","./index-BoIy-5_p.js","./index-8dCw6Y2Z.css","./el-link-CPQZ-olG.css","./index-rWF_BNTH.js","./md5-ohq5q_Pj.js","./AuthCodeSendBtn.vue_vue_type_script_setup_true_lang-CP9hjm3T.js","./CanvasAnimation.vue_vue_type_script_setup_true_lang-Xr4R8ONt.js","./index-CNqahi2L.css","./index-BMSnGhSG.js","./core-CcVTMiBP.js","./index-Dt73qBZB.css","./el-empty-S7fQQ3B8.css","./index-tKPA5N_x.js","./index.vue_vue_type_style_index_0_lang-BNPcBMvg.js","./index-Dj51p5I8.css","./index-Dz2nPzxk.js","./index-BYC9CuLh.js","./index.vue_vue_type_script_setup_true_lang-DtCu4Izc.js","./useMessage-BVw3M4ej.js","./index-BEVcnNvI.js","./useCompMetaLocalStore-BKTMp_k8.js","./index.vue_vue_type_script_setup_true_lang-DPbqR98S.js","./index-D6MA33Hi.js","./el-table-column-CGzXlVpD.js","./el-table-column-B3ZEEuPD.css","./index.vue_vue_type_style_index_0_lang-CwaGkvXy.js","./vendor-xterm-DbWxaMay.js","./index-Bn5vi5XZ.css","./index.vue_vue_type_script_setup_true_lang-DzvWwe2g.js","./index.vue_vue_type_script_setup_true_lang-DTrkhAMQ.js","./useTeamHeaders-DxHN7-t0.js","./index.vue_vue_type_script_setup_true_lang-CCaH-GEy.js","./index-FFTkVbVX.css","./PanelBackground.vue_vue_type_script_setup_true_lang-BELCrrRh.js","./BaseSegmented.vue_vue_type_script_setup_true_lang-DU79Plk1.js","./index-D-uwf4yo.css","./home-rounded-BhKYWFxg.js","./home-rounded-B4KVwSYb.css","./index-CsUtZbBp.js","./useKeyword-bWHMALoZ.js","./supervised-user-circle-C6l0wkza.js","./supervised-user-circle-CZYpyCV4.css","./index-B8QVBEgQ.js","./index.vue_vue_type_style_index_0_lang-1ZphBFBL.js","./useCompEditStore-DI3vFtGm.js","./v4-EwEgHOG0.js","./useCompEditStore-EVZp94pg.css","./index-CdWXO9ks.css","./kid-star-DD-9HSxX.js","./kid-star-D1M-aC1C.css","./index-Diq3BceD.js","./sync-saved-locally-rounded-Cgz-NvDy.js","./sync-saved-locally-rounded-wbwASI26.css","./index-BVcp4iEn.js","./cloud-upload-Cdco6849.js","./cloud-upload-j3Y0taC9.css","./index-BGYcKO_k.js","./index-DGaY7dL7.js","./moment-B-YVwB4U.js","./index-VFwGpUE-.css","./index-BwgqBNRu.js","./terminal-DIdElzFh.js","./terminal-DFt3N_TH.css","./index-CG7uKVdX.js","./settings-f8ZwrSyv.js","./settings-BhagQj3w.css","./index-Dd8ha0TC.js","./index-CzTcYkCn.css","./index-X1ZIWbVW.js","./index-DxyEzkir.css","./index-Cc3zDN4S.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{aA as Ko,g as te,v as Se,aj as ze,ab as y,j as ne,aO as we,r as j,ax as m,w as vi,au as Xa,ad as Mt,av as Tu,B as $o,ao as Yo,aF as In,aM as Oe,l as T,ai as Ve,i as g,F as Ie,ah as He,q as Ke,ap as L,af as H,a7 as et,a9 as St,Y as Ge,b as Up,k as ue,aB as Zl,ay as ec,aN as Nt,al as Ot,X as We,ar as bn,aQ as ho,aR as Ye,W as zp,aE as d_,aP as it,$ as At,p as h_,_ as wn,A as Jn,K as p_,aD as _s,m as f_,n as m_,aC as tc,c as v_,Z as Ae,Q as ys,S as g_,u as qn,o as __,s as y_,h as nc,at as $t,U as zi,V as Gn,y as Ja,a1 as b_,a4 as bs,aa as Vp,H as ko,ak as w_,ac as Bp,z as E_,a8 as S_,aK as En,T as ws,aJ as Go,aG as Es,aI as Za,aH as ea,t as C_}from"./vendor-core-BKehvho7.js";import{ai as x_,aD as T_,m as O_,aH as Ji,aE as ic,ag as $_,ah as Ou,ao as k_,ar as A_,aA as P_,aw as R_,au as I_,aq as M_,ap as D_,as as F_,ax as L_,at as j_,ay as N_,av as U_,y as $u,e as Gi,x as el,aJ as Hp,a2 as z_,a1 as V_,M as B_,aK as H_,an as q_,am as Fi,I as W_,z as Ao,K as K_,$ as Y_,H as G_,N as tl,B as nl,a3 as Q_,_ as X_,Z as J_,r as Z_,T as ku,k as Au,A as Pu,g as Ru,a5 as Iu,b as Mu,j as Du,i as Fu,R as Lu,Q as ju,P as Nu,q as Uu,h as zu,W as Vu,a7 as Bu,a9 as Hu,Y as qu,S as Wu,l as Ku,a0 as Yu,n as Gu,a4 as Qu,O as Xu,C as Ju,a6 as Zu,a8 as ed,G as td,ae as mr,af as Zi,ab as oc,az as Po,aj as Ro,aB as Io,J as vr,ac as ey}from"./vendor-ui-CGT0cG1n.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();const ty="local://",ny="main",iy="container",oy="item",ry="/__global_config__",sy="/node_modules/.prebuild_module",ay="_metadata.json",ly="/_module_load_prefix_",cy="/_node_modules_load_prefix_",uy="/_comp_preview_prefix_local_",dy="/__proxy__",hy="/__master__",py="__remote__",fy="__local__",my="https://api.comphub.cn:5696",vy="http://localhost:7002",gy="http://localhost:5000",_y="http://localhost:5001",yy="Comp Hub",by="csrfToken",wy="authorization",Ey="x-refresh-token",Sy="x-csrf-token",Cy="accept-language",xy="comp-hub-db",Ty="file-compiled",Oy="https://oss.comphub.cn",$y="oss:sts:token",ky="oss:sts:expire",Ay="comp.json",Py="README.md",Ry="/.comp_hub_temp",Iy="main.js",My="index.vue",qp="list_local",Wp="list_remote",Dy={COMP_LIST_TYPE_LOCAL:qp,COMP_LIST_TYPE_REMOTE:Wp},Kp="config",Yp="error",Gp="dir",Qp="preview",Xp="extra",Jp="deps",Zp="upgradeLog",ef="readme",Fy={TAB_TYPE_CONFIG:Kp,TAB_TYPE_ERROR:Yp,TAB_TYPE_DIR:Gp,TAB_TYPE_PREVIEW:Qp,TAB_TYPE_EXTRA:Xp,TAB_TYPE_DEPS:Jp,TAB_TYPE_UPGRADE_LOG:Zp,TAB_TYPE_README:ef},tf="mini",nf="full",Ly={COMP_EDIT_TAB_TYPE_MINI:tf,COMP_EDIT_TAB_TYPE_FULL:nf},of="EDIT",rf="ADD",jy={DIALOG_TYPE_EDIT:of,DIALOG_TYPE_ADD:rf},sf="ONLY_INSTALL",af="MAJOR_VERSION",lf="MINOR_VERSION",cf="EXACT_VERSION",Ny={COMP_MATCH_TYPE_ONLY_INSTALL:sf,COMP_MATCH_TYPE_MAJOR_VERSION:af,COMP_MATCH_TYPE_MINOR_VERSION:lf,COMP_MATCH_TYPE_EXACT_VERSION:cf},uf="online",df="offline",Uy={COMP_UPDATE_TYPE_ONLINE:uf,COMP_UPDATE_TYPE_OFFLINE:df},zy=0,Vy=1,By=-1,hf="checkPreviewListForm",pf="checkExtraInfoForm",ff="checkCompConfig",mf="afterCompDel",vf="openCompTerminal",gf="afterCompCancelCollect",_f="afterCompRenderRetry",yf="getCompError",bf="checkUpgradeLogForm",Hy={COMP_METHOD_KEY_CHECK_PREVIEW_LIST_FORM:hf,COMP_METHOD_KEY_CHECK_EXTRA_INFO_FORM:pf,COMP_METHOD_KEY_CHECK_COMP_CONFIG:ff,COMP_METHOD_KEY_AFTER_COMP_DEL:mf,COMP_METHOD_KEY_OPEN_COMP_TERMINAL:vf,COMP_METHOD_KEY_AFTER_COMP_CANCEL_COLLECT:gf,COMP_METHOD_KEY_AFTER_COMP_RENDER_RETRY:_f,COMP_METHOD_KEY_GET_COMP_ERROR:yf,COMP_METHOD_KEY_CHECK_UPGRADE_LOG_FORM:bf},qy={CONTAINER:{SHARE:"share",COLLECT:"collect",LOCAL:"local",MINE:"mine",SIMILAR:"similar",TEAM_ALL:"teamAll",TEAM_MINE:"teamMine",TEAM_GROUP:"teamGroup",TEAM_ADD:"teamAdd"},ITEM:{PREVIEW_REMOTE:"previewRemote",PREVIEW_LOCAL:"previewLocal",CAROUSEL_REMOTE:"carouselRemote",CAROUSEL_LOCAL:"carouselLocal",EDIT_PANEL:"editPanel"}},Wy="http://127.0.0.1",Ky="http://localhost:8095",Yy="http://localhost:8096",Gy="http://localhost:5198",Qy="/item",Xy="/container",Jy="CREATE",Zy="JOIN",eb="EXIT",tb="teamAddMyComp",nb="teamCompList",ib="teamCompGroupList",ob="teamMyCompList",rb="teamMyCompUpdate",sb="vue/dist/vue.esm-bundler.js",ab="__v__",lb="compListStore",cb="compEditStore",ub="callbacks",db="comphubConfig",hb="local",pb="prod",fb="local",mb="prod",vb="http://localhost:5173/en/",gb="https://docs.comphub.cn",_b=20,yb=20,bt=Object.freeze(Object.defineProperty({__proto__:null,ACCEPT_LANGUAGE_HEADER_NAME:Cy,AUTHORIZATION_HEADER_NAME:wy,CACHE_KEY_STS_EXPIRE_TIME:ky,CACHE_KEY_STS_TOKEN:$y,COMPHUB_CONFIG_KEY:db,COMP_ACTION_ICON_HEIGHT:yb,COMP_ACTION_ICON_WIDTH:_b,COMP_CONFIG_FILENAME:Ay,COMP_EDIT_TAB_TYPES:Ly,COMP_EDIT_TAB_TYPE_FULL:nf,COMP_EDIT_TAB_TYPE_MINI:tf,COMP_ENTRY_FILE:Iy,COMP_HUB_DEV_DOCS_URL:vb,COMP_HUB_PROD_DOCS_URL:gb,COMP_LIST_TYPES:Dy,COMP_LIST_TYPE_LOCAL:qp,COMP_LIST_TYPE_REMOTE:Wp,COMP_MATCH_TYPES:Ny,COMP_MATCH_TYPE_EXACT_VERSION:cf,COMP_MATCH_TYPE_MAJOR_VERSION:af,COMP_MATCH_TYPE_MINOR_VERSION:lf,COMP_MATCH_TYPE_ONLY_INSTALL:sf,COMP_METHOD_KEY_AFTER_COMP_CANCEL_COLLECT:gf,COMP_METHOD_KEY_AFTER_COMP_DEL:mf,COMP_METHOD_KEY_AFTER_COMP_RENDER_RETRY:_f,COMP_METHOD_KEY_CHECK_COMP_CONFIG:ff,COMP_METHOD_KEY_CHECK_EXTRA_INFO_FORM:pf,COMP_METHOD_KEY_CHECK_PREVIEW_LIST_FORM:hf,COMP_METHOD_KEY_CHECK_UPGRADE_LOG_FORM:bf,COMP_METHOD_KEY_GET_COMP_ERROR:yf,COMP_METHOD_KEY_OPEN_COMP_TERMINAL:vf,COMP_PREVIEW_PREFIX_LOCAL:uy,COMP_README_FILENAME:Py,COMP_SUBMIT_MAX_FILE_COUNT:30,COMP_SUBMIT_MAX_TOTAL_SIZE:10485760,COMP_TEMP_DIR:Ry,COMP_UPDATE_TYPES:Uy,COMP_UPDATE_TYPE_OFFLINE:df,COMP_UPDATE_TYPE_ONLINE:uf,COMP_USE_ENTRY_FILE:My,CSRF_KEY:by,CSRF_TOKEN_HEADER_NAME:Sy,DIALOG_TYPES:jy,DIALOG_TYPE_ADD:rf,DIALOG_TYPE_EDIT:of,FILE_MANAGER_DIRNAME:ty,GLOBAL_CONFIG_PATH:ry,IFRAME_CONTAINER_WEBSITE_PATH:Xy,IFRAME_HOST:Wy,IFRAME_ITEM_WEBSITE_PATH:Qy,IFRAME_ROUTES:qy,INDEX_DB_NAME:xy,INDEX_DB_TABLE_NAME:Ty,LOCAL_CHILD_IFRAME_URL:Ky,LOCAL_LEAF_IFRAME_URL:Yy,LOCAL_MIDWAY_ENV_LOCAL:hb,LOCAL_MIDWAY_ENV_PROD:pb,LOCAL_SERVICE_PREFIX:fy,LOCAL_SERVICE_URL_DEV:gy,LOCAL_SERVICE_URL_DEV_SUB:_y,LOCAL_TOP_IFRAME_URL:Gy,MASTER_API_PREFIX:hy,META_FILE_NAME:ay,MODULE_LOAD_PREFIX:ly,NODE_MODULES_LOAD_PREFIX:cy,OSS_CUSTOM_DOMAIN:Oy,PREBUILD_MODULE_DIR:sy,PROVIDE_KEYS:Hy,PROVIDE_KEY_CALLBACKS:ub,PROVIDE_KEY_COMP_EDIT_STORE:cb,PROVIDE_KEY_COMP_LIST_STORE:lb,PROXY_PATH_PREFIX:dy,REFRESH_TOKEN_HEADER_NAME:Ey,REMOTE_MIDWAY_ENV_LOCAL:fb,REMOTE_MIDWAY_ENV_PROD:mb,REMOTE_SERVICE_PREFIX:py,REMOTE_SERVICE_URL_DEV:vy,REMOTE_SERVICE_URL_PROD:my,ROUTE_STATE_KEY_VERSION:ab,SCOPE_ID_TEAM_ADD_MY_COMP:tb,SCOPE_ID_TEAM_COMP_GROUP_LIST:ib,SCOPE_ID_TEAM_COMP_LIST:nb,SCOPE_ID_TEAM_MY_COMP_LIST:ob,SCOPE_ID_TEAM_MY_COMP_UPDATE:rb,SITE_TITLE:yy,TAB_TYPES:Fy,TAB_TYPE_CONFIG:Kp,TAB_TYPE_DEPS:Jp,TAB_TYPE_DIR:Gp,TAB_TYPE_ERROR:Yp,TAB_TYPE_EXTRA:Xp,TAB_TYPE_PREVIEW:Qp,TAB_TYPE_README:ef,TAB_TYPE_UPGRADE_LOG:Zp,TEAM_OPERATE_TYPE_CREATE:Jy,TEAM_OPERATE_TYPE_EXIT:eb,TEAM_OPERATE_TYPE_JOIN:Zy,VERSION_COMPARE_GREATER:Vy,VERSION_COMPARE_LESS:By,VERSION_COMPARE_SAME:zy,VUE_ESM_BUNDLER:sb,WEBSITE_PATH_CONTAINER:iy,WEBSITE_PATH_ITEM:oy,WEBSITE_PATH_MAIN:ny},Symbol.toStringTag,{value:"Module"})),bb=[{label:"tag.systemRecommended",value:"XTTJ"},{label:"tag.all",value:"QB"},{label:"tag.latest",value:"ZX"},{label:"tag.hottest",value:"ZR"}],wb=[".css"],Eb=[{name:"__id__",label:"comp.fieldId",required:!0,default:""},{name:"name",label:"comp.fieldName",required:!0,default:""},{name:"version",label:"comp.fieldVersion",required:!0,default:"1.0.0"}],FU=Object.freeze(Object.defineProperty({__proto__:null,COMP_DEFAULT_FIELD:Eb,DEFAULT_TAG_GROUP:bb,PREBUILD_MODULE_SKIP_EXT:wb},Symbol.toStringTag,{value:"Module"})),Sb="comp-hub-locale",Cb=Object.freeze(Object.defineProperty({__proto__:null,LOCALE_KEY:Sb},Symbol.toStringTag,{value:"Module"})),xb="send-auth-code",Tb="send-auth-code-success",Ob="send-auth-code-failed",$b="login-button",kb="login-button-success",Ab="login-button-failed",Pb="skip-login",Rb="upload-select-folder",Ib="upload-confirm",Mb="upload-success",Db="upload-failed",Fb="upload-repeat-confirm",Lb="edit-panel-submit",jb="edit-panel-submit-success",Nb="edit-panel-submit-failed",Ub="edit-generate-comp-json",zb="edit-view-diff",Vb="edit-bg-color-change",Bb="edit-dep-version-change",Hb="search-component",qb="filter-tag",Wb="page-size-change",Kb="comp-preview",Yb="comp-download",Gb="comp-download-success",Qb="comp-download-failed",Xb="comp-collect-toggle",Jb="comp-delete",Zb="comp-update",e0="comp-update-success",t0="comp-update-failed",n0="comp-version-change",i0="preview-open-newtab",o0="preview-tab-change",r0="user-update-avatar",s0="user-update-avatar-success",a0="user-update-avatar-failed",l0="user-update-nickname",c0="user-update-nickname-success",u0="user-update-nickname-failed",d0="user-update-email",h0="user-update-email-success",p0="user-update-email-failed",f0="user-update-password",m0="user-update-password-success",v0="user-update-password-failed",g0="user-email-login-toggle",_0="team-tab-change",y0="team-filter-group",b0="team-kick-member",w0="team-apply-accept",E0="team-apply-reject",S0="team-comp-remove",C0="team-comp-permission-change",x0="sidebar-toggle",T0="setting-apply-rule",O0="clear-cache",nd=Object.freeze(Object.defineProperty({__proto__:null,CLEAR_CACHE:O0,COMP_COLLECT_TOGGLE:Xb,COMP_DELETE:Jb,COMP_DOWNLOAD:Yb,COMP_DOWNLOAD_FAILED:Qb,COMP_DOWNLOAD_SUCCESS:Gb,COMP_PREVIEW:Kb,COMP_UPDATE:Zb,COMP_UPDATE_FAILED:t0,COMP_UPDATE_SUCCESS:e0,COMP_VERSION_CHANGE:n0,EDIT_BG_COLOR_CHANGE:Vb,EDIT_DEP_VERSION_CHANGE:Bb,EDIT_GENERATE_COMP_JSON:Ub,EDIT_PANEL_SUBMIT:Lb,EDIT_PANEL_SUBMIT_FAILED:Nb,EDIT_PANEL_SUBMIT_SUCCESS:jb,EDIT_VIEW_DIFF:zb,FILTER_TAG:qb,LOGIN_BUTTON:$b,LOGIN_BUTTON_FAILED:Ab,LOGIN_BUTTON_SUCCESS:kb,PAGE_SIZE_CHANGE:Wb,PREVIEW_OPEN_NEWTAB:i0,PREVIEW_TAB_CHANGE:o0,SEARCH_COMPONENT:Hb,SEND_AUTH_CODE:xb,SEND_AUTH_CODE_FAILED:Ob,SEND_AUTH_CODE_SUCCESS:Tb,SETTING_APPLY_RULE:T0,SIDEBAR_TOGGLE:x0,SKIP_LOGIN:Pb,TEAM_APPLY_ACCEPT:w0,TEAM_APPLY_REJECT:E0,TEAM_COMP_PERMISSION_CHANGE:C0,TEAM_COMP_REMOVE:S0,TEAM_FILTER_GROUP:y0,TEAM_KICK_MEMBER:b0,TEAM_TAB_CHANGE:_0,UPLOAD_CONFIRM:Ib,UPLOAD_FAILED:Db,UPLOAD_REPEAT_CONFIRM:Fb,UPLOAD_SELECT_FOLDER:Rb,UPLOAD_SUCCESS:Mb,USER_EMAIL_LOGIN_TOGGLE:g0,USER_UPDATE_AVATAR:r0,USER_UPDATE_AVATAR_FAILED:a0,USER_UPDATE_AVATAR_SUCCESS:s0,USER_UPDATE_EMAIL:d0,USER_UPDATE_EMAIL_FAILED:p0,USER_UPDATE_EMAIL_SUCCESS:h0,USER_UPDATE_NICKNAME:l0,USER_UPDATE_NICKNAME_FAILED:u0,USER_UPDATE_NICKNAME_SUCCESS:c0,USER_UPDATE_PASSWORD:f0,USER_UPDATE_PASSWORD_FAILED:v0,USER_UPDATE_PASSWORD_SUCCESS:m0},Symbol.toStringTag,{value:"Module"})),LU=t=>bt.COMP_HUB_PROD_DOCS_URL,$0=t=>"";var k0={name:"zh-cn",el:{breadcrumb:{label:"面包屑"},colorpicker:{confirm:"确定",clear:"清空",defaultLabel:"颜色选择器",description:"当前颜色 {color},按 Enter 键选择新颜色",alphaLabel:"选择透明度的值",alphaDescription:"透明度 {alpha}, 当前颜色 {color}",hueLabel:"选择色相值",hueDescription:"色相 {hue}, 当前颜色 {color}",svLabel:"选择饱和度与明度的值",svDescription:"饱和度 {saturation}, 明度 {brightness}, 当前颜色 {color}",predefineDescription:"选择 {value} 作为颜色"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",dateTablePrompt:"使用方向键与 Enter 键可选择日期",monthTablePrompt:"使用方向键与 Enter 键可选择月份",yearTablePrompt:"使用方向键与 Enter 键可选择年份",selectedDate:"已选日期",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},weeksFull:{sun:"星期日",mon:"星期一",tue:"星期二",wed:"星期三",thu:"星期四",fri:"星期五",sat:"星期六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},inputNumber:{decrease:"减少数值",increase:"增加数值"},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},mention:{loading:"加载中"},dropdown:{toggleDropdown:"切换下拉选项"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},dialog:{close:"关闭此对话框"},drawer:{close:"关闭此对话框"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!",close:"关闭此对话框"},upload:{deleteTip:"按 Delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},slider:{defaultLabel:"滑块介于 {min} 至 {max}",defaultRangeStartLabel:"选择起始值",defaultRangeEndLabel:"选择结束值"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计",selectAllLabel:"选择所有行",selectRowLabel:"选择当前行",expandRowLabel:"展开当前行",collapseRowLabel:"收起当前行",sortLabel:"按 {column} 排序",filterLabel:"按 {column} 过滤"},tag:{close:"关闭此标签"},tour:{next:"下一步",previous:"上一步",finish:"结束导览",close:"关闭此对话框"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},carousel:{leftArrow:"上一张幻灯片",rightArrow:"下一张幻灯片",indicator:"幻灯片切换至索引 {index}"},inputOTP:{groupLabel:"一次性密码输入框",defaultLabel:"请输入第 {index} 位 OTP 字符"}}};const A0=()=>{const{locale:t}=Ko(),e={zh:k0,en:x_};return{locale:te(()=>e[t.value])}},P0=Se({__name:"App",setup(t){const{locale:e}=A0();return T_(),(n,i)=>{const o=ze("router-view");return y(),ne(m(O_),{locale:m(e)},{default:we(()=>[j(o)]),_:1},8,["locale"])}}}),R0="modulepreload",I0=function(t,e){return new URL(t,e).href},id={},nt=function(e,n,i){let o=Promise.resolve();if(n&&n.length>0){let c=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};const s=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");o=c(n.map(u=>{if(u=I0(u,i),u in id)return;id[u]=!0;const d=u.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(i)for(let f=s.length-1;f>=0;f--){const p=s[f];if(p.href===u&&(!d||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${h}`))return;const v=document.createElement("link");if(v.rel=d?"stylesheet":R0,d||(v.as="script"),v.crossOrigin="",v.href=u,l&&v.setAttribute("nonce",l),document.head.appendChild(v),d)return new Promise((f,p)=>{v.addEventListener("load",f),v.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${u}`)))})}))}function r(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return o.then(s=>{for(const a of s||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})},si="authorization",is=()=>localStorage.getItem(si),M0=t=>localStorage.setItem(si,t),D0=()=>localStorage.removeItem(si),Ti="x-refresh-token",F0=()=>localStorage.getItem(Ti),L0=t=>localStorage.setItem(Ti,t),j0=()=>localStorage.removeItem(Ti),N0="aside_is_collapse",jU="loginType",NU="compUploadFullscreen",UU="terminalCommandHistory",zU="compUploadSidePanelSize",VU="tagSelected",U0="asideSize",z0="headerSize",wf="tagsViewMaxCache",BU="readUploadAgreement",V0="dependencyMatchRule",HU="teamTabActiveName",qU="settingTabActiveName",WU="compPreviewTabActiveName",Ef="paginationPageSize",B0=()=>localStorage.getItem(Ef),H0=t=>localStorage.setItem(Ef,t),KU="selectedFolderPath",Qo=vi("tagsView",{state:()=>({visitedViews:[],maxCache:Ji(wf,10),payloadMap:new Map}),actions:{setMaxCache(t){this.$patch(e=>{e.maxCache=t})},addView(t){this.$patch(e=>{const n={...t},i=e.visitedViews.findIndex(r=>r.path===t.path);if(i!==-1){e.visitedViews[i]=n;return}e.visitedViews.unshift(n);const o=e.visitedViews.length-e.maxCache;o>0&&this.spliceVisitedViews(-o,o)})},spliceVisitedViews(t,e){this.$patch(n=>{n.visitedViews.splice(t,e)})},delViewByPath(t){this.$patch(e=>{for(const[n,i]of e.visitedViews.entries())if(i.path===t){e.visitedViews.splice(n,1);break}})},delViewAndJumpToPrev(t,e=!1,n){if(e){const i=this.visitedViews.filter(o=>o.path!==t)?.[0];i?n.push(i.path).then(o=>{o||setTimeout(()=>{this.delViewByPath(t)},250)}):n.push("/").then(o=>{o||this.delViewByPath(t)})}else this.delViewByPath(t)},addPayLoad(t,e){this.$patch(n=>{n.payloadMap.set(t,e)})},getPayLoad(t){return this.payloadMap.get(t)}}}),q0=Se((t,{slots:e})=>{var n,i;const o=Yo(),{width:r,height:s}=Xa(t),a=Mt(ic(o,{width:(n=Tu(r))!==null&&n!==void 0?n:0,height:(i=Tu(s))!==null&&i!==void 0?i:0},{box:t.box,window:t.window}));return()=>{if(e.default)return $o(t.as||"div",{ref:o},e.default(a))}},{name:"UseElementSize",props:["as","box","height","width","window"]}),W0={ref:"el",class:"relative"},K0={class:"absolute opacity-0 pointer-events-none flex"},Y0=["itemKey"],G0=Se({__name:"AutoWrapRow",props:{list:{},moreWidth:{default:70},gap:{default:5},getKey:{}},setup(t){const e=t,n=H(new Map),i=In("el"),o=In("items"),{width:r}=ic(i),s=H([]),a=H(!1),l=te(()=>r.value-e.moreWidth),c=te(()=>{const p=s.value.map(_=>_.key);return e.list.filter(_=>p.includes(e.getKey(_)))}),u=te(()=>a.value?e.list.length-s.value.length:0),d=te(()=>{let p=0;for(const _ of n.value.values())p+=_;return p});function h(p,_){n.value.set(p,_)}function v(){const p=new Map;for(const _ of e.list){const S=e.getKey(_);p.set(S,n.value.get(S)??0)}n.value=p}const f=$_(()=>{let p=0;const _=[];if(!(!o.value||e.list.length===0)){for(const S of e.list){const w=e.getKey(S),E=o.value.find(b=>b.getAttribute("itemKey")===w);if(E){if(p+=E.offsetWidth+e.gap,p>l.value)break;_.push({key:w,value:E.offsetWidth})}}s.value=_,a.value=!0}},100);return Oe([()=>r.value,()=>e.list,()=>d.value],([,,p],[,,_])=>{p!==_&&(a.value=!1),f()},{flush:"post",deep:!0}),Oe(()=>e.list.length,()=>{v()}),(p,_)=>(y(),T("div",W0,[Ve(p.$slots,"display",{visibleList:c.value,overflow:u.value}),g("div",K0,[(y(!0),T(Ie,null,He(t.list,(S,w)=>(y(),ne(m(q0),{key:t.getKey(S)},{default:we(({width:E})=>[Ke(L(h(t.getKey(S),Number(E)))+" ",1),g("div",{ref_for:!0,ref:"items",itemKey:t.getKey(S),class:"invisible whitespace-nowrap"},[Ve(p.$slots,"measure",{item:S,index:w})],8,Y0)]),_:2},1024))),128))])],512))}}),rc=(t,e)=>{const n=t.__vccOpts||t;for(const[i,o]of e)n[i]=o;return n},Sf=/^[a-z0-9]+(-[a-z0-9]+)*$/,Ss=(t,e,n,i="")=>{const o=t.split(":");if(t.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;i=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const a=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:i,prefix:l,name:a};return e&&!Ur(c)?null:c}const r=o[0],s=r.split("-");if(s.length>1){const a={provider:i,prefix:s.shift(),name:s.join("-")};return e&&!Ur(a)?null:a}if(n&&i===""){const a={provider:i,prefix:"",name:r};return e&&!Ur(a,n)?null:a}return null},Ur=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function Q0(t,e){const n=t.icons,i=t.aliases||Object.create(null),o=Object.create(null);function r(s){if(n[s])return o[s]=[];if(!(s in o)){o[s]=null;const a=i[s]&&i[s].parent,l=a&&r(a);l&&(o[s]=[a].concat(l))}return o[s]}return Object.keys(n).concat(Object.keys(i)).forEach(r),o}const Cf=Object.freeze({left:0,top:0,width:16,height:16}),os=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Cs=Object.freeze({...Cf,...os}),il=Object.freeze({...Cs,body:"",hidden:!1});function X0(t,e){const n={};!t.hFlip!=!e.hFlip&&(n.hFlip=!0),!t.vFlip!=!e.vFlip&&(n.vFlip=!0);const i=((t.rotate||0)+(e.rotate||0))%4;return i&&(n.rotate=i),n}function od(t,e){const n=X0(t,e);for(const i in il)i in os?i in t&&!(i in n)&&(n[i]=os[i]):i in e?n[i]=e[i]:i in t&&(n[i]=t[i]);return n}function J0(t,e,n){const i=t.icons,o=t.aliases||Object.create(null);let r={};function s(a){r=od(i[a]||o[a],r)}return s(e),n.forEach(s),od(t,r)}function xf(t,e){const n=[];if(typeof t!="object"||typeof t.icons!="object")return n;t.not_found instanceof Array&&t.not_found.forEach(o=>{e(o,null),n.push(o)});const i=Q0(t);for(const o in i){const r=i[o];r&&(e(o,J0(t,o,r)),n.push(o))}return n}const Z0={provider:"",aliases:{},not_found:{},...Cf};function ta(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function Tf(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!ta(t,Z0))return null;const n=e.icons;for(const o in n){const r=n[o];if(!o||typeof r.body!="string"||!ta(r,il))return null}const i=e.aliases||Object.create(null);for(const o in i){const r=i[o],s=r.parent;if(!o||typeof s!="string"||!n[s]&&!i[s]||!ta(r,il))return null}return e}const rd=Object.create(null);function ew(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}function eo(t,e){const n=rd[t]||(rd[t]=Object.create(null));return n[e]||(n[e]=ew(t,e))}function Of(t,e){return Tf(e)?xf(e,(n,i)=>{i?t.icons[n]=i:t.missing.add(n)}):[]}function tw(t,e,n){try{if(typeof n.body=="string")return t.icons[e]={...n},!0}catch{}return!1}let Mo=!1;function $f(t){return typeof t=="boolean"&&(Mo=t),Mo}function nw(t){const e=typeof t=="string"?Ss(t,!0,Mo):t;if(e){const n=eo(e.provider,e.prefix),i=e.name;return n.icons[i]||(n.missing.has(i)?null:void 0)}}function iw(t,e){const n=Ss(t,!0,Mo);if(!n)return!1;const i=eo(n.provider,n.prefix);return e?tw(i,n.name,e):(i.missing.add(n.name),!0)}function ow(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),Mo&&!e&&!t.prefix){let i=!1;return Tf(t)&&(t.prefix="",xf(t,(o,r)=>{iw(o,r)&&(i=!0)})),i}const n=t.prefix;return Ur({prefix:n,name:"a"})?!!Of(eo(e,n),t):!1}const kf=Object.freeze({width:null,height:null}),Af=Object.freeze({...kf,...os}),rw=/(-?[0-9.]*[0-9]+[0-9.]*)/g,sw=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function sd(t,e,n){if(e===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*e*n)/n;if(typeof t!="string")return t;const i=t.split(rw);if(i===null||!i.length)return t;const o=[];let r=i.shift(),s=sw.test(r);for(;;){if(s){const a=parseFloat(r);isNaN(a)?o.push(r):o.push(Math.ceil(a*e*n)/n)}else o.push(r);if(r=i.shift(),r===void 0)return o.join("");s=!s}}function aw(t,e="defs"){let n="";const i=t.indexOf("<"+e);for(;i>=0;){const o=t.indexOf(">",i),r=t.indexOf("</"+e);if(o===-1||r===-1)break;const s=t.indexOf(">",r);if(s===-1)break;n+=t.slice(o+1,r).trim(),t=t.slice(0,i).trim()+t.slice(s+1)}return{defs:n,content:t}}function lw(t,e){return t?"<defs>"+t+"</defs>"+e:e}function cw(t,e,n){const i=aw(t);return lw(i.defs,e+i.content+n)}const uw=t=>t==="unset"||t==="undefined"||t==="none";function dw(t,e){const n={...Cs,...t},i={...Af,...e},o={left:n.left,top:n.top,width:n.width,height:n.height};let r=n.body;[n,i].forEach(p=>{const _=[],S=p.hFlip,w=p.vFlip;let E=p.rotate;S?w?E+=2:(_.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),_.push("scale(-1 1)"),o.top=o.left=0):w&&(_.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),_.push("scale(1 -1)"),o.top=o.left=0);let b;switch(E<0&&(E-=Math.floor(E/4)*4),E=E%4,E){case 1:b=o.height/2+o.top,_.unshift("rotate(90 "+b.toString()+" "+b.toString()+")");break;case 2:_.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:b=o.width/2+o.left,_.unshift("rotate(-90 "+b.toString()+" "+b.toString()+")");break}E%2===1&&(o.left!==o.top&&(b=o.left,o.left=o.top,o.top=b),o.width!==o.height&&(b=o.width,o.width=o.height,o.height=b)),_.length&&(r=cw(r,'<g transform="'+_.join(" ")+'">',"</g>"))});const s=i.width,a=i.height,l=o.width,c=o.height;let u,d;s===null?(d=a===null?"1em":a==="auto"?c:a,u=sd(d,l/c)):(u=s==="auto"?l:s,d=a===null?sd(u,c/l):a==="auto"?c:a);const h={},v=(p,_)=>{uw(_)||(h[p]=_.toString())};v("width",u),v("height",d);const f=[o.left,o.top,l,c];return h.viewBox=f.join(" "),{attributes:h,viewBox:f,body:r}}const hw=/\sid="(\S+)"/g,ad=new Map;function pw(t){t=t.replace(/[0-9]+$/,"")||"a";const e=ad.get(t)||0;return ad.set(t,e+1),e?`${t}${e}`:t}function fw(t){const e=[];let n;for(;n=hw.exec(t);)e.push(n[1]);if(!e.length)return t;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(o=>{const r=pw(o),s=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+r+i+"$3")}),t=t.replace(new RegExp(i,"g"),""),t}const ol=Object.create(null);function mw(t,e){ol[t]=e}function rl(t){return ol[t]||ol[""]}function sc(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}const ac=Object.create(null),_o=["https://api.simplesvg.com","https://api.unisvg.com"],zr=[];for(;_o.length>0;)_o.length===1||Math.random()>.5?zr.push(_o.shift()):zr.push(_o.pop());ac[""]=sc({resources:["https://api.iconify.design"].concat(zr)});function vw(t,e){const n=sc(e);return n===null?!1:(ac[t]=n,!0)}function lc(t){return ac[t]}const gw=()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}};let ld=gw();function _w(t,e){const n=lc(t);if(!n)return 0;let i;if(!n.maxURL)i=0;else{let o=0;n.resources.forEach(s=>{o=Math.max(o,s.length)});const r=e+".json?icons=";i=n.maxURL-o-n.path.length-r.length}return i}function yw(t){return t===404}const bw=(t,e,n)=>{const i=[],o=_w(t,e),r="icons";let s={type:r,provider:t,prefix:e,icons:[]},a=0;return n.forEach((l,c)=>{a+=l.length+1,a>=o&&c>0&&(i.push(s),s={type:r,provider:t,prefix:e,icons:[]},a=l.length),s.icons.push(l)}),i.push(s),i};function ww(t){if(typeof t=="string"){const e=lc(t);if(e)return e.path}return"/"}const Ew=(t,e,n)=>{if(!ld){n("abort",424);return}let i=ww(e.provider);switch(e.type){case"icons":{const r=e.prefix,s=e.icons.join(","),a=new URLSearchParams({icons:s});i+=r+".json?"+a.toString();break}case"custom":{const r=e.uri;i+=r.slice(0,1)==="/"?r.slice(1):r;break}default:n("abort",400);return}let o=503;ld(t+i).then(r=>{const s=r.status;if(s!==200){setTimeout(()=>{n(yw(s)?"abort":"next",s)});return}return o=501,r.json()}).then(r=>{if(typeof r!="object"||r===null){setTimeout(()=>{r===404?n("abort",r):n("next",o)});return}setTimeout(()=>{n("success",r)})}).catch(()=>{n("next",o)})},Sw={prepare:bw,send:Ew};function Pf(t,e){t.forEach(n=>{const i=n.loaderCallbacks;i&&(n.loaderCallbacks=i.filter(o=>o.id!==e))})}function Cw(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const e=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!e.length)return;let n=!1;const i=t.provider,o=t.prefix;e.forEach(r=>{const s=r.icons,a=s.pending.length;s.pending=s.pending.filter(l=>{if(l.prefix!==o)return!0;const c=l.name;if(t.icons[c])s.loaded.push({provider:i,prefix:o,name:c});else if(t.missing.has(c))s.missing.push({provider:i,prefix:o,name:c});else return n=!0,!0;return!1}),s.pending.length!==a&&(n||Pf([t],r.id),r.callback(s.loaded.slice(0),s.missing.slice(0),s.pending.slice(0),r.abort))})}))}let xw=0;function Tw(t,e,n){const i=xw++,o=Pf.bind(null,n,i);if(!e.pending.length)return o;const r={id:i,icons:e,callback:t,abort:o};return n.forEach(s=>{(s.loaderCallbacks||(s.loaderCallbacks=[])).push(r)}),o}function Ow(t){const e={loaded:[],missing:[],pending:[]},n=Object.create(null);t.sort((o,r)=>o.provider!==r.provider?o.provider.localeCompare(r.provider):o.prefix!==r.prefix?o.prefix.localeCompare(r.prefix):o.name.localeCompare(r.name));let i={provider:"",prefix:"",name:""};return t.forEach(o=>{if(i.name===o.name&&i.prefix===o.prefix&&i.provider===o.provider)return;i=o;const r=o.provider,s=o.prefix,a=o.name,l=n[r]||(n[r]=Object.create(null)),c=l[s]||(l[s]=eo(r,s));let u;a in c.icons?u=e.loaded:s===""||c.missing.has(a)?u=e.missing:u=e.pending;const d={provider:r,prefix:s,name:a};u.push(d)}),e}function $w(t,e=!0,n=!1){const i=[];return t.forEach(o=>{const r=typeof o=="string"?Ss(o,e,n):o;r&&i.push(r)}),i}const kw={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Aw(t,e,n,i){const o=t.resources.length,r=t.random?Math.floor(Math.random()*o):t.index;let s;if(t.random){let x=t.resources.slice(0);for(s=[];x.length>1;){const k=Math.floor(Math.random()*x.length);s.push(x[k]),x=x.slice(0,k).concat(x.slice(k+1))}s=s.concat(x)}else s=t.resources.slice(r).concat(t.resources.slice(0,r));const a=Date.now();let l="pending",c=0,u,d=null,h=[],v=[];typeof i=="function"&&v.push(i);function f(){d&&(clearTimeout(d),d=null)}function p(){l==="pending"&&(l="aborted"),f(),h.forEach(x=>{x.status==="pending"&&(x.status="aborted")}),h=[]}function _(x,k){k&&(v=[]),typeof x=="function"&&v.push(x)}function S(){return{startTime:a,payload:e,status:l,queriesSent:c,queriesPending:h.length,subscribe:_,abort:p}}function w(){l="failed",v.forEach(x=>{x(void 0,u)})}function E(){h.forEach(x=>{x.status==="pending"&&(x.status="aborted")}),h=[]}function b(x,k,O){const K=k!=="success";switch(h=h.filter(D=>D!==x),l){case"pending":break;case"failed":if(K||!t.dataAfterTimeout)return;break;default:return}if(k==="abort"){u=O,w();return}if(K){u=O,h.length||(s.length?C():w());return}if(f(),E(),!t.random){const D=t.resources.indexOf(x.resource);D!==-1&&D!==t.index&&(t.index=D)}l="completed",v.forEach(D=>{D(O)})}function C(){if(l!=="pending")return;f();const x=s.shift();if(x===void 0){if(h.length){d=setTimeout(()=>{f(),l==="pending"&&(E(),w())},t.timeout);return}w();return}const k={status:"pending",resource:x,callback:(O,K)=>{b(k,O,K)}};h.push(k),c++,d=setTimeout(C,t.rotate),n(x,e,k.callback)}return setTimeout(C),S}function Rf(t){const e={...kw,...t};let n=[];function i(){n=n.filter(s=>s().status==="pending")}function o(s,a,l){const c=Aw(e,s,a,(u,d)=>{i(),l&&l(u,d)});return n.push(c),c}function r(s){return n.find(a=>s(a))||null}return{query:o,find:r,setIndex:s=>{e.index=s},getIndex:()=>e.index,cleanup:i}}function cd(){}const na=Object.create(null);function Pw(t){if(!na[t]){const e=lc(t);if(!e)return;na[t]={config:e,redundancy:Rf(e)}}return na[t]}function Rw(t,e,n){let i,o;if(typeof t=="string"){const r=rl(t);if(!r)return n(void 0,424),cd;o=r.send;const s=Pw(t);s&&(i=s.redundancy)}else{const r=sc(t);if(r){i=Rf(r);const s=rl(t.resources?t.resources[0]:"");s&&(o=s.send)}}return!i||!o?(n(void 0,424),cd):i.query(e,o,n)().abort}function ud(){}function Iw(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,Cw(t)}))}function Mw(t){const e=[],n=[];return t.forEach(i=>{(i.match(Sf)?e:n).push(i)}),{valid:e,invalid:n}}function yo(t,e,n){function i(){const o=t.pendingIcons;e.forEach(r=>{o&&o.delete(r),t.icons[r]||t.missing.add(r)})}if(n&&typeof n=="object")try{if(!Of(t,n).length){i();return}}catch(o){console.error(o)}i(),Iw(t)}function dd(t,e){t instanceof Promise?t.then(n=>{e(n)}).catch(()=>{e(null)}):e(t)}function Dw(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout(()=>{t.iconsQueueFlag=!1;const{provider:n,prefix:i}=t,o=t.iconsToLoad;if(delete t.iconsToLoad,!o||!o.length)return;const r=t.loadIcon;if(t.loadIcons&&(o.length>1||!r)){dd(t.loadIcons(o,i,n),c=>{yo(t,o,c)});return}if(r){o.forEach(c=>{dd(r(c,i,n),u=>{yo(t,[c],u?{prefix:i,icons:{[c]:u}}:null)})});return}const{valid:s,invalid:a}=Mw(o);if(a.length&&yo(t,a,null),!s.length)return;const l=i.match(Sf)?rl(n):null;if(!l){yo(t,s,null);return}l.prepare(n,i,s).forEach(c=>{Rw(n,c,u=>{yo(t,c.icons,u)})})}))}const Fw=(t,e)=>{const n=Ow($w(t,!0,$f()));if(!n.pending.length){let a=!0;return e&&setTimeout(()=>{a&&e(n.loaded,n.missing,n.pending,ud)}),()=>{a=!1}}const i=Object.create(null),o=[];let r,s;return n.pending.forEach(a=>{const{provider:l,prefix:c}=a;if(c===s&&l===r)return;r=l,s=c,o.push(eo(l,c));const u=i[l]||(i[l]=Object.create(null));u[c]||(u[c]=[])}),n.pending.forEach(a=>{const{provider:l,prefix:c,name:u}=a,d=eo(l,c),h=d.pendingIcons||(d.pendingIcons=new Set);h.has(u)||(h.add(u),i[l][c].push(u))}),o.forEach(a=>{const l=i[a.provider][a.prefix];l.length&&Dw(a,l)}),e?Tw(e,n,o):ud};function Lw(t,e){const n={...t};for(const i in e){const o=e[i],r=typeof o;i in kf?(o===null||o&&(r==="string"||r==="number"))&&(n[i]=o):r===typeof n[i]&&(n[i]=i==="rotate"?o%4:o)}return n}const jw=/[\s,]+/;function Nw(t,e){e.split(jw).forEach(n=>{switch(n.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0;break}})}function Uw(t,e=0){const n=t.replace(/^-?[0-9.]*/,"");function i(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(t);return isNaN(o)?0:i(o)}else if(n!==t){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let r=parseFloat(t.slice(0,t.length-n.length));return isNaN(r)?0:(r=r/o,r%1===0?i(r):0)}}return e}function zw(t,e){let n=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in e)n+=" "+i+'="'+e[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+t+"</svg>"}function Vw(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Bw(t){return"data:image/svg+xml,"+Vw(t)}function Hw(t){return'url("'+Bw(t)+'")'}const hd={...Af,inline:!1},qw={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Ww={display:"inline-block"},sl={backgroundColor:"currentColor"},If={backgroundColor:"transparent"},pd={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},fd={webkitMask:sl,mask:sl,background:If};for(const t in fd){const e=fd[t];for(const n in pd)e[t+n]=pd[n]}const Vr={};["horizontal","vertical"].forEach(t=>{const e=t.slice(0,1)+"Flip";Vr[t+"-flip"]=e,Vr[t.slice(0,1)+"-flip"]=e,Vr[t+"Flip"]=e});function md(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}const vd=(t,e)=>{const n=Lw(hd,e),i={...qw},o=e.mode||"svg",r={},s=e.style,a=typeof s=="object"&&!(s instanceof Array)?s:{};for(let p in e){const _=e[p];if(_!==void 0)switch(p){case"icon":case"style":case"onLoad":case"mode":case"ssr":case"customise":break;case"inline":case"hFlip":case"vFlip":n[p]=_===!0||_==="true"||_===1;break;case"flip":typeof _=="string"&&Nw(n,_);break;case"color":r.color=_;break;case"rotate":typeof _=="string"?n[p]=Uw(_):typeof _=="number"&&(n[p]=_);break;case"ariaHidden":case"aria-hidden":_!==!0&&_!=="true"&&delete i["aria-hidden"];break;default:{const S=Vr[p];S?(_===!0||_==="true"||_===1)&&(n[S]=!0):hd[p]===void 0&&(i[p]=_)}}}const l=dw(t,n),c=l.attributes;if(n.inline&&(r.verticalAlign="-0.125em"),o==="svg")return i.style={...r,...a},Object.assign(i,c),i.innerHTML=fw(l.body),$o("svg",i);const{body:u,width:d,height:h}=t,v=o==="mask"||(o==="bg"?!1:u.indexOf("currentColor")!==-1),f=zw(u,{...c,width:d+"",height:h+""});return i.style={...r,"--svg":Hw(f),width:md(c.width),height:md(c.height),...Ww,...v?sl:If,...a},$o("span",i)};$f(!0);mw("",Sw);if(typeof document<"u"&&typeof window<"u"){const t=window;if(t.IconifyPreload!==void 0){const e=t.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!ow(i))&&console.error(n)}catch{console.error(n)}})}if(t.IconifyProviders!==void 0){const e=t.IconifyProviders;if(typeof e=="object"&&e!==null)for(let n in e){const i="IconifyProviders["+n+"] is invalid.";try{const o=e[n];if(typeof o!="object"||!o||o.resources===void 0)continue;vw(n,o)||console.error(i)}catch{console.error(i)}}}}const Kw={...Cs,body:""},Yw=Se((t,{emit:e})=>{const n=H(null);function i(){n.value&&(n.value.abort?.(),n.value=null)}const o=H(!!t.ssr),r=H(""),s=Yo(null);function a(){const c=t.icon;if(typeof c=="object"&&c!==null&&typeof c.body=="string")return r.value="",{data:c};let u;if(typeof c!="string"||(u=Ss(c,!1,!0))===null)return null;let d=nw(u);if(!d){const f=n.value;return(!f||f.name!==c)&&(d===null?n.value={name:c}:n.value={name:c,abort:Fw([u],l)}),null}i(),r.value!==c&&(r.value=c,Ge(()=>{e("load",c)}));const h=t.customise;if(h){d=Object.assign({},d);const f=h(d.body,u.name,u.prefix,u.provider);typeof f=="string"&&(d.body=f)}const v=["iconify"];return u.prefix!==""&&v.push("iconify--"+u.prefix),u.provider!==""&&v.push("iconify--"+u.provider),{data:d,classes:v}}function l(){const c=a();c?c.data!==s.value?.data&&(s.value=c):s.value=null}return o.value?l():et(()=>{o.value=!0,l()}),Oe(()=>t.icon,l),St(i),()=>{const c=s.value;if(!c)return vd(Kw,t);let u=t;return c.classes&&(u={...t,class:c.classes.join(" ")}),vd({...Cs,...c.data},u)}},{props:["icon","mode","ssr","width","height","style","color","inline","rotate","hFlip","horizontalFlip","vFlip","verticalFlip","flip","id","ariaHidden","customise","title"],emits:["load"]});function Gw(t,e,n="_id"){const i=Ou(t,e,n).filter(Boolean),o=Ou(e,t,n).filter(Boolean),r=k_(t,e,(s,a)=>s[n]===a[n]&&!A_(s,a));return{addedItems:i,deletedItems:o,modifiedItems:r}}const YU=Object.freeze(Object.defineProperty({__proto__:null,findChangedArrayItems:Gw},Symbol.toStringTag,{value:"Module"}));function cc(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qw(t,e){if(!e?.trim())return[{text:t,isMatch:!1}];const n=new RegExp(`(${cc(e)})`,"gi");return t.split(n).map(i=>({text:i,isMatch:n.test(i)&&i.toLowerCase()===e.toLowerCase()}))}function Xw(t,e,n="hl"){if(!e?.trim())return t;const i=cc(e.trim());return t.replace(new RegExp(`(${i})`,"gi"),`<mark class="${n}">$1</mark>`)}function Jw(t,e){const n=e?.trim().toLowerCase();return n?t.findIndex(i=>i.toLowerCase().includes(n)):-1}const Mf=t=>t.replace(/[/\\]/g,"/"),Zw=(t,e="/")=>t.replace(/[\\/]+/g,e);function e1(){return"#"+P_(0,16777215).toString(16).padStart(6,"0")}const t1=t=>/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(t),Df=t=>t.replace(/[-_]([a-z])/g,(e,n)=>n.toUpperCase()).replace(/^[A-Z]/,e=>e.toLowerCase()),al=t=>{if(Array.isArray(t))return t.map(n=>al(n));if(t===null||typeof t!="object")return t;const e={};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const i=Df(n);e[i]=al(t[n])}return e};function n1(t){return/(^[A-Z][a-z][a-zA-Z0-9]*$)|(^[a-z]+(-[a-z0-9]+)+$)/.test(t.trim())}function i1(t){if(t<=0)throw new Error("长度必须大于0");let e="";for(;e.length<t;){const n=Math.floor(Math.random()*10);e.length===0&&n===0||(e+=n)}return e}function Ff(t){if(t==null)return{valid:!1,reason:"validateHash.empty"};if(typeof t!="string")return{valid:!1,reason:"validateHash.notString",reasonParams:{type:typeof t}};const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return{valid:!1,reason:"validateHash.contentEmpty"};if(/^\d/.test(e))return{valid:!1,reason:"validateHash.startsWithNumber",reasonParams:{char:e[0]}};const n=e.match(/[^\p{L}\p{N}_\-() ]/u);if(n){const i=n[0],o=i.charCodeAt(0);return i==="`"?{valid:!1,reason:"validateHash.invalidCharBacktick"}:i===`
|
|
3
|
+
`?{valid:!1,reason:"validateHash.invalidCharNewline"}:i==="\r"?{valid:!1,reason:"validateHash.invalidCharCarriageReturn"}:i===" "?{valid:!1,reason:"validateHash.invalidCharTab"}:i==="\f"?{valid:!1,reason:"validateHash.invalidCharFormFeed"}:i==="\v"?{valid:!1,reason:"validateHash.invalidCharVerticalTab"}:i==="#"?{valid:!1,reason:"validateHash.invalidCharHash"}:/[<>\\"'&]/.test(i)?{valid:!1,reason:"validateHash.invalidCharHtmlSpecial",reasonParams:{char:i}}:{valid:!1,reason:"validateHash.invalidCharUnknown",reasonParams:{char:i,code:o.toString(16).toUpperCase().padStart(4,"0")}}}return{valid:!0,normalized:e}}function o1(t){return Ff(t).valid}const GU=Object.freeze(Object.defineProperty({__proto__:null,convertKeysToCamelCase:al,escapeRegExp:cc,findKeywordLineIndex:Jw,generateNumberString:i1,highlightText:Xw,isEmail:t1,isValidHash:o1,randomColor:e1,replaceBackslashWithSlash:Mf,replaceSlashWithSpecifiedSeparator:Zw,splitTextByKeyword:Qw,toCamelCase:Df,validateCompName:n1,validateHash:Ff},Symbol.toStringTag,{value:"Module"}));function r1(t,e){if(!t||!e.length)throw new Error("组件路径或入口路径为空");const[n]=e.slice(-1);if(!n)throw new Error("入口路径最后一项无效");const i=Mf(n);return`${t.replace(bt.FILE_MANAGER_DIRNAME,"")}${i}`}function s1(t){const e={};return t.forEach(n=>{n?.parent?e[n?.parent?.name]=n?.parent?.version:e[n.name]=n.version}),Object.entries(e).map(([n,i])=>({name:n,version:i}))}const QU=Object.freeze(Object.defineProperty({__proto__:null,getPreviewUrl:r1,handleDepData:s1},Symbol.toStringTag,{value:"Module"}));function a1(t){const e={children:[]},n=[e];return t.forEach(({depth:i,tokens:o})=>{if(o[0]){const r=o[0].text,s=o.map(u=>u.text),a=s.join(""),l={title:r,titles:s,href:`#${a}`,children:[]};for(;n.length>i;)n.pop();const c=n[n.length-1];c&&c.children.push(l),n.push(l)}}),e.children}const XU=Object.freeze(Object.defineProperty({__proto__:null,flatHeadingsToTree:a1},Symbol.toStringTag,{value:"Module"})),l1=t=>`Bearer ${t}`,c1=t=>t.replace("Bearer ",""),wi=Object.freeze(Object.defineProperty({__proto__:null,extractBearerToken:c1,generateBearerToken:l1},Symbol.toStringTag,{value:"Module"}));function u1(t,e,n={}){const{idKey:i="id",childrenKey:o="children"}=n,r=Array.isArray(t)?t:[t],s=[];let a=!1;const l=u=>{const d=u[o];Array.isArray(d)&&(s.push(...d),d.forEach(h=>l(h)))},c=u=>{if(a)return!0;for(const d of u){if(d?.[i]===e)return a=!0,l(d),!0;const h=d?.[o];if(Array.isArray(h)&&h.length>0&&c(h))return!0}return!1};return c(r),s}function Lf(t,e){const n=JSON.parse(JSON.stringify(t));return n.children?.length&&(n.children=n.children.map(i=>Lf(i,e))),e(n)}function d1(t,e,n={}){const{idKey:i="id",childrenKey:o="children"}=n,r=Array.isArray(t)?t:[t],s=l=>{const{[o]:c,...u}=l;return u},a=(l,c)=>{for(const u of l){if(u[i]===e)return[s(u),...c];const d=u[o];if(Array.isArray(d)&&d.length>0){const h=a(d,[s(u),...c]);if(h)return h}}return null};return a(r,[])??[]}function h1(t,e){const{createNode:n,pathSeparator:i="/",skipInvalid:o=!0}=e,r=new Map,s=i,a=n("directory","",s);a.children=[],r.set(s,a);const l=u=>{let d=u.replace(/\\/g,"/");return d=d.replace(/^\.\//,""),d=d.replace(/^\/+|\/+$/g,""),d.replace(/\//g,i)};for(const u of t){const d=l(u.path);if(!d)continue;const h=d.split(i).filter(Boolean);if(h.length===0)continue;let v=s,f="";for(let w=0;w<h.length-1;w++){const E=h[w];if(f=f?`${f}${i}${E}`:E,!r.has(f)){const b=n("directory",E,f);b.children=[],r.set(f,b),r.get(v)?.children?.push(b)}v=f}const p=h[h.length-1];if(!p){if(!o)throw new Error(`无效路径: ${u.path}`);continue}const _=f?`${f}${i}${p}`:p,S=n("file",p,_);r.get(v)?.children?.push(S)}const c=u=>{u.sort((d,h)=>d.type!==h.type?d.type==="directory"?-1:1:d.name.localeCompare(h.name)),u.forEach(d=>d.children?.length&&c(d.children))};return a.children?.length&&c(a.children),a}const JU=Object.freeze(Object.defineProperty({__proto__:null,convertFlatToTree:h1,findTreeNodePathToRoot:d1,getTreeAllChildren:u1,mapTree:Lf},Symbol.toStringTag,{value:"Module"}));var jf=(t=>(t.Added="added",t.Deleted="deleted",t.Unchanged="unchanged",t.Changed="modified",t))(jf||{}),Nf=(t=>(t.Directory="directory",t.File="file",t))(Nf||{});function Uf(t){return typeof structuredClone=="function"?structuredClone(t):JSON.parse(JSON.stringify(t))}function rs(t,e){for(const n of t)e.set(n.path,n),n.type==="directory"&&n.children?.length&&rs(n.children,e)}function gd(t){const e=new Map;return rs(t,e),e}function uc(t,e){const n=[];for(const i of t)if(!e.has(i.path)){const o=Uf(i);o.status="deleted",i.type==="directory"&&i.children?.length&&(o.children=uc(i.children,e)),n.push(o)}return n}function p1(t,e,n){return n?n(t,e):t.hash&&e.hash?t.hash===e.hash:!0}function Br(t,e,n,i){return t.map(o=>{const r=Uf(o),s=e.get(o.path);if(s){if(o.type==="file"){const a=p1(s,o,i?.contentCompare);r.status=a?"unchanged":"modified"}else r.status="unchanged";if(o.type==="directory"&&o.children&&s.children){const a=gd(s.children),l=Br(o.children,a,n,i),c=gd(l),u=uc(s.children,c);r.children=[...l,...u]}else o.type==="directory"&&o.children&&(r.children=Br(o.children,new Map,"added",i))}else r.status=n,o.type==="directory"&&o.children?.length&&(r.children=Br(o.children,new Map,n,i));return r.type==="directory"&&dc(r),r})}function dc(t){if(t.type!=="directory"||!t.children?.length)return;for(const n of t.children)n.type==="directory"&&dc(n);if(t.status==="added"||t.status==="deleted")return;const e=t.children.some(n=>n.status==="added"||n.status==="deleted"||n.status==="modified");t.status=e?"modified":"unchanged"}function zf(t){const e=[...t].sort((n,i)=>n.type!==i.type?n.type==="directory"?-1:1:n.name.localeCompare(i.name));for(const n of e)n.type==="directory"&&n.children?.length&&(n.children=zf(n.children));return e}function f1(t,e,n){const i=new Map,o=new Map;rs(e,i),rs(t,o);const r=Br(t,i,"added",n),s=uc(e,o),a=[...r,...s],l=n?.skipSort?a:zf(a);for(const c of l)c.type==="directory"&&dc(c);return l}const ZU=Object.freeze(Object.defineProperty({__proto__:null,NodeStatus:jf,NodeType:Nf,mergeAndMarkTree:f1},Symbol.toStringTag,{value:"Module"})),m1=(t,e)=>{const n=Array.isArray(e)?e:[e];let i;return R_(t)?i="string":I_(t)?i="number":M_(t)?i="boolean":D_(t)?i="array":F_(t)?i="function":L_(t)?i="symbol":j_(t)?i="null":N_(t)?i="undefined":U_(t)?i="object":i="undefined",n.includes(i)},ez=Object.freeze(Object.defineProperty({__proto__:null,isType:m1},Symbol.toStringTag,{value:"Module"})),_d=/^[\^~>=<]+/,Vf=/^(\d+)\.(\d+)\.(\d+)(?:-([a-zA-Z0-9.]+))?(?:\+([a-zA-Z0-9.]+))?$/;function v1(t){return Vf.test(t)}function Dn(t){if(!t||typeof t!="string")throw new Error(`Invalid version string: ${t}`);const e=t.match(_d),n=e?e[0]:"",i=t.replace(_d,"").match(Vf);if(!i)throw new Error(`Invalid semver format: ${t}`);const[,o="0",r="0",s="0",a]=i,l=parseInt(o,10),c=parseInt(r,10),u=parseInt(s,10);return{raw:t,prefix:n,major:l,minor:c,patch:u,prerelease:a||null,majorVersion:o,version:`${l}.${c}.${u}`}}function g1(t,e){const n=Dn(t),i=Dn(e);return n.major===i.major&&n.minor===i.minor&&n.patch===i.patch}function _1(t){return Dn(t).majorVersion}function y1(t){const e={};for(const[n,i]of Object.entries(t))try{e[n]=Dn(i)}catch(o){console.warn(`Failed to parse version for ${n}: ${i}`,o)}return e}function Vi(t,e){const n=Dn(t),i=Dn(e),{VERSION_COMPARE_SAME:o,VERSION_COMPARE_LESS:r,VERSION_COMPARE_GREATER:s}=bt;return n.major!==i.major?n.major>i.major?s:r:n.minor!==i.minor?n.minor>i.minor?s:r:n.patch!==i.patch?n.patch>i.patch?s:r:o}function b1(t,e){const n=Dn(t),i=Dn(e);switch(i.prefix){case"^":return n.major===i.major;case"~":return n.major===i.major&&n.minor===i.minor;case">=":return Vi(t,e.replace(">=",""))>=0;case">":return Vi(t,e.replace(">",""))>0;case"<=":return Vi(t,e.replace("<=",""))<=0;case"<":return Vi(t,e.replace("<",""))<0;case"=":case"":return Vi(t,e.replace("=",""))===0;default:return!1}}function w1(t){if(!t||typeof t!="string")throw new Error("版本号必须是非空字符串");const e=Dn(t),n=(a,l)=>{if(a<0||a>999)throw new Error(`版本号${l}位必须在 0-999 之间,当前值:${a}(原始输入:${t})`);return a},i=n(e.major,"主版本"),o=n(e.minor,"次版本"),r=n(e.patch,"补丁版本"),s=i*1e6+o*1e3+r;if(!Number.isSafeInteger(s))throw new Error(`版本号转换后超出 JavaScript 安全整数范围,结果:${s}(原始输入:${t})`);return s}const tz=Object.freeze(Object.defineProperty({__proto__:null,compareVersions:Vi,getMajorVersion:_1,isVersionEqual:g1,parseDependencies:y1,parseVersion:Dn,satisfiesRange:b1,validateVersion:v1,versionToNumber:w1},Symbol.toStringTag,{value:"Module"})),E1={};function S1(t,e){return y(),ne(Up,{name:"transition-fade",mode:"out-in",appear:""},{default:we(()=>[Ve(t.$slots,"default")]),_:3})}const C1=rc(E1,[["render",S1]]),x1={key:0,class:"fixed top-0 left-0 w-screen bg-[rgb(94,9,11)] text-white font-sans z-[99999] break-all overflow-auto max-h-[50vh] p-[10px] box-border"},T1={class:"clear-both"},O1={class:"whitespace-pre-wrap m-0"},$1={key:0},k1={class:"whitespace-pre-wrap m-0"},A1=Se({__name:"ErrorOverlay",props:{errors:{}},setup(t){const e=H(!1),n=t,i=()=>{e.value=!1};return Oe(()=>n.errors,o=>{e.value=o.length>0},{immediate:!0,deep:!0}),(o,r)=>e.value?(y(),T("div",x1,[g("button",{class:"sticky top-[10px] right-[10px] float-right bg-white/20 border-none text-white text-lg cursor-pointer w-[30px] h-[30px] rounded-full flex items-center justify-center p-0 ml-[10px] transition-colors duration-200 hover:bg-white/30",onClick:i}," × "),g("div",T1,[(y(!0),T(Ie,null,He(t.errors,(s,a)=>(y(),T("div",{key:a,class:"mb-5"},[g("pre",O1,L(s?.message||s),1),s?.stack?(y(),T("div",$1,[g("pre",k1,L(s.stack),1)])):ue("",!0)]))),128))])])):ue("",!0)}}),P1=Se({__name:"index",props:zp({config:{}},{modelValue:{type:Object,default:()=>({})},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const{t:e}=Ko(),n=t,i=te(()=>{const u={};return n.config?.column?.forEach(d=>{u[d.prop]=d.value}),u}),o=Zl(t,"modelValue"),r=ec();async function s(){r?.onRefresh?.()}async function a(){n.config?.column?.forEach(u=>{u.value=""}),await Ge(),r?.onReset?.()}function l(u){return u??!0}function c(){r?.onSearch?.()}return Nt(()=>{o.value=i.value}),(u,d)=>{const h=ze("Icon");return y(),ne(m(el),{inline:!0,onSubmit:d[3]||(d[3]=Ye(()=>{},["prevent"])),onKeyup:d[4]||(d[4]=ho(v=>c(),["enter"]))},{default:we(()=>[(y(!0),T(Ie,null,He(t.config?.column||[],(v,f)=>(y(),ne(m($u),{key:f,label:m(v.label)??""},{default:we(()=>[l(v.useVModel)?(y(),ne(Ot(v.component),We({key:1,modelValue:v.value,"onUpdate:modelValue":p=>v.value=p},{ref_for:!0},v?.attributes||{},bn(v?.events||{})),null,16,["modelValue","onUpdate:modelValue"])):(y(),ne(Ot(v.component),We({key:0,"model-value":v.value},{ref_for:!0},v?.attributes||{},bn(v?.events||{})),null,16,["model-value"]))]),_:2},1032,["label"]))),128)),t.config?.column?.length?(y(),ne(m($u),{key:0},{default:we(()=>[j(m(Gi),{type:"success",onClick:d[0]||(d[0]=v=>c())},{default:we(()=>[Ke(L(m(e)("common.search")),1)]),_:1}),j(m(Gi),{type:"primary",onClick:d[1]||(d[1]=v=>a())},{default:we(()=>[Ke(L(m(e)("common.reset")),1)]),_:1}),j(m(Gi),{onClick:d[2]||(d[2]=v=>s())},{default:we(()=>[j(h,{icon:"material-symbols:refresh-rounded"})]),_:1})]),_:1})):ue("",!0)]),_:1})}}}),R1={key:0},I1={ref:"tableContainer",class:"flex-1 overflow-hidden"},M1={key:1,class:"mt-2"},D1=Se({__name:"index",props:{tableConfig:{}},setup(t,{expose:e}){const n=ec(),i=t,o=In("tableContainer"),r=In("table"),{height:s}=ic(o),a=d_(),l=te(()=>{if(i.tableConfig?.pagination?.getPageSize||i.tableConfig?.pagination?.setPageSize)return{get:i.tableConfig.pagination.getPageSize,set:i.tableConfig.pagination.setPageSize};const I=F1().paginationStorage;return I?{get:()=>{const A=I.get();return A?Number(A):10},set:A=>I.set(String(A))}:null}),c=H(l.value?.get?.()??10),u=H(!1),d=H(1),h=H(D()),v=H("UNKNOWN"),f=te(()=>Object.keys(a)),p=te(()=>i.tableConfig.size??"default"),_=te(()=>i.tableConfig?.fixedHeight??!0),S=te(()=>_.value?Math.max(s.value,100):"auto"),w=te(()=>i.tableConfig?.autoLoading??!0),E=te(()=>({"--pagination-location":i.tableConfig?.pagination?.location||"center"})),b=te(()=>i.tableConfig?.isPagination??!0),C=te(()=>i.tableConfig?.paginationMap?i.tableConfig.paginationMap:{page:"page",pageSize:"pageSize"}),x=te(()=>({[C.value.page]:d.value,[C.value.pageSize]:c.value})),k=te(()=>({background:!0,pageSizes:[10,20,30,50],layout:"total, sizes, prev, pager, next, jumper",...i.tableConfig?.pagination?.attributes,total:i.tableConfig?.pagination?.total||0,pageSize:c.value,currentPage:d.value})),O=te(()=>({...x.value,...h.value})),K=te(()=>i.tableConfig?.search?.column.filter(I=>I.autoQuery??!0).map(I=>I.prop));function D(){const I={};return i.tableConfig?.search?.column?.forEach(A=>{I[A.prop]=A.value}),I}async function P(){v.value!=="NOT_CHANGE"&&(w.value&&(u.value=!0),i.tableConfig?.fetchData?.(O.value)?.finally(()=>{v.value="NOT_CHANGE",u.value=!1}))}async function U(){await P()}async function M(){v.value="UNKNOWN",await P()}async function q(){d.value=1,v.value!=="AUTO_QUERY"&&await P()}async function le(I){d.value=1,c.value=I}async function de(I){d.value=I}function Y(){v.value="UNKNOWN",P()}return Oe(()=>JSON.stringify(h.value),(I,A)=>{v.value="UNKNOWN";const Q=JSON.parse(I??"{}"),z=JSON.parse(A??"{}"),ie=Object.keys(Q),ve=Object.keys(z);let re=[];ie.length===ve.length?re=Object.keys(Q).filter(ge=>Q[ge]!==z[ge]):re=H_(ie,ve),K.value?.length&&q_(re,[...K.value]).length&&(v.value="AUTO_QUERY",P())}),Oe(()=>JSON.stringify(x.value),()=>{v.value="UNKNOWN",P()}),Nt(()=>{l.value?.set?.(c.value)}),et(()=>{P()}),e({getTableRef:()=>r.value,forceRefreshData:Y}),(I,A)=>{const Q=Hp;return it((y(),T("div",{class:"w-full h-full flex flex-col overflow-hidden",style:At(E.value)},[t.tableConfig.search?(y(),T("div",R1,[Ve(I.$slots,"search",{},()=>[j(P1,{modelValue:h.value,"onUpdate:modelValue":A[0]||(A[0]=z=>h.value=z),config:t.tableConfig.search,size:p.value,onSearch:U,onRefresh:M,onReset:q},null,8,["modelValue","config","size"])],!0)])):ue("",!0),Ve(I.$slots,"tableBefore",{},void 0,!0),g("div",I1,[Ve(I.$slots,"table",{},()=>[j(m(V_),We({ref:"table",size:p.value,data:t.tableConfig.data,height:S.value},m(n)),h_({default:we(()=>[(y(!0),T(Ie,null,He(t.tableConfig.column,(z,ie)=>(y(),T(Ie,null,[z.slot?Ve(I.$slots,z.slot,{key:0,col:z,index:ie},void 0,!0):(y(),ne(m(z_),We({key:`default-${ie}`},{ref_for:!0},z),null,16))],64))),256))]),_:2},[He(f.value,z=>({name:z,fn:we(ie=>[Ve(I.$slots,z,wn(Jn(ie)),void 0,!0)])}))]),1040,["size","data","height"])],!0)],512),b.value?(y(),T("div",M1,[Ve(I.$slots,"pagination",{},()=>[j(m(B_),We({size:p.value},k.value,{onSizeChange:le,onCurrentChange:de},bn(t.tableConfig?.pagination?.events||{})),null,16,["size"])],!0)])):ue("",!0)],4)),[[Q,u.value]])}}}),yd=rc(D1,[["__scopeId","data-v-ce25225b"]]);let ll={};const F1=()=>ll,L1={...yd,install(t,e){e&&(ll={...ll,...e}),t.component("BaseTable",yd)}},j1={class:"overflow-hidden size-full"},N1=Se({__name:"Main",setup(t){const e=Qo(),n=new Map,i=te(()=>e.visitedViews.map(s=>o(s)));function o(s){const{path:a}=s,{[bt.ROUTE_STATE_KEY_VERSION]:l}=s.query;return l?`${a}?${bt.ROUTE_STATE_KEY_VERSION}=${l}`:a}function r(s,a){const l=o(a);if(!n.has(l)){const c=Se({name:l,setup(){return()=>$o(s)}});n.set(l,c)}return n.get(l)}return Oe(()=>i.value,(s,a)=>{const l=a.filter(c=>!s.includes(c));l.length&&n.delete(l[0])},{deep:!0}),(s,a)=>{const l=ze("router-view");return y(),T("div",j1,[j(l,null,{default:we(({Component:c,route:u})=>[j(m(C1),null,{default:we(()=>[(y(),ne(p_,{include:i.value},[(y(),ne(Ot(r(c,u))))],1032,["include"]))]),_:2},1024)]),_:1})])}}});var ia,bd;function U1(){if(bd)return ia;bd=1;function t(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function e(o,r){for(var s="",a=0,l=-1,c=0,u,d=0;d<=o.length;++d){if(d<o.length)u=o.charCodeAt(d);else{if(u===47)break;u=47}if(u===47){if(!(l===d-1||c===1))if(l!==d-1&&c===2){if(s.length<2||a!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var h=s.lastIndexOf("/");if(h!==s.length-1){h===-1?(s="",a=0):(s=s.slice(0,h),a=s.length-1-s.lastIndexOf("/")),l=d,c=0;continue}}else if(s.length===2||s.length===1){s="",a=0,l=d,c=0;continue}}r&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+o.slice(l+1,d):s=o.slice(l+1,d),a=d-l-1;l=d,c=0}else u===46&&c!==-1?++c:c=-1}return s}function n(o,r){var s=r.dir||r.root,a=r.base||(r.name||"")+(r.ext||"");return s?s===r.root?s+a:s+o+a:a}var i={resolve:function(){for(var r="",s=!1,a,l=arguments.length-1;l>=-1&&!s;l--){var c;l>=0?c=arguments[l]:(a===void 0&&(a=process.cwd()),c=a),t(c),c.length!==0&&(r=c+"/"+r,s=c.charCodeAt(0)===47)}return r=e(r,!s),s?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(r){if(t(r),r.length===0)return".";var s=r.charCodeAt(0)===47,a=r.charCodeAt(r.length-1)===47;return r=e(r,!s),r.length===0&&!s&&(r="."),r.length>0&&a&&(r+="/"),s?"/"+r:r},isAbsolute:function(r){return t(r),r.length>0&&r.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var r,s=0;s<arguments.length;++s){var a=arguments[s];t(a),a.length>0&&(r===void 0?r=a:r+="/"+a)}return r===void 0?".":i.normalize(r)},relative:function(r,s){if(t(r),t(s),r===s||(r=i.resolve(r),s=i.resolve(s),r===s))return"";for(var a=1;a<r.length&&r.charCodeAt(a)===47;++a);for(var l=r.length,c=l-a,u=1;u<s.length&&s.charCodeAt(u)===47;++u);for(var d=s.length,h=d-u,v=c<h?c:h,f=-1,p=0;p<=v;++p){if(p===v){if(h>v){if(s.charCodeAt(u+p)===47)return s.slice(u+p+1);if(p===0)return s.slice(u+p)}else c>v&&(r.charCodeAt(a+p)===47?f=p:p===0&&(f=0));break}var _=r.charCodeAt(a+p),S=s.charCodeAt(u+p);if(_!==S)break;_===47&&(f=p)}var w="";for(p=a+f+1;p<=l;++p)(p===l||r.charCodeAt(p)===47)&&(w.length===0?w+="..":w+="/..");return w.length>0?w+s.slice(u+f):(u+=f,s.charCodeAt(u)===47&&++u,s.slice(u))},_makeLong:function(r){return r},dirname:function(r){if(t(r),r.length===0)return".";for(var s=r.charCodeAt(0),a=s===47,l=-1,c=!0,u=r.length-1;u>=1;--u)if(s=r.charCodeAt(u),s===47){if(!c){l=u;break}}else c=!1;return l===-1?a?"/":".":a&&l===1?"//":r.slice(0,l)},basename:function(r,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');t(r);var a=0,l=-1,c=!0,u;if(s!==void 0&&s.length>0&&s.length<=r.length){if(s.length===r.length&&s===r)return"";var d=s.length-1,h=-1;for(u=r.length-1;u>=0;--u){var v=r.charCodeAt(u);if(v===47){if(!c){a=u+1;break}}else h===-1&&(c=!1,h=u+1),d>=0&&(v===s.charCodeAt(d)?--d===-1&&(l=u):(d=-1,l=h))}return a===l?l=h:l===-1&&(l=r.length),r.slice(a,l)}else{for(u=r.length-1;u>=0;--u)if(r.charCodeAt(u)===47){if(!c){a=u+1;break}}else l===-1&&(c=!1,l=u+1);return l===-1?"":r.slice(a,l)}},extname:function(r){t(r);for(var s=-1,a=0,l=-1,c=!0,u=0,d=r.length-1;d>=0;--d){var h=r.charCodeAt(d);if(h===47){if(!c){a=d+1;break}continue}l===-1&&(c=!1,l=d+1),h===46?s===-1?s=d:u!==1&&(u=1):s!==-1&&(u=-1)}return s===-1||l===-1||u===0||u===1&&s===l-1&&s===a+1?"":r.slice(s,l)},format:function(r){if(r===null||typeof r!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof r);return n("/",r)},parse:function(r){t(r);var s={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return s;var a=r.charCodeAt(0),l=a===47,c;l?(s.root="/",c=1):c=0;for(var u=-1,d=0,h=-1,v=!0,f=r.length-1,p=0;f>=c;--f){if(a=r.charCodeAt(f),a===47){if(!v){d=f+1;break}continue}h===-1&&(v=!1,h=f+1),a===46?u===-1?u=f:p!==1&&(p=1):u!==-1&&(p=-1)}return u===-1||h===-1||p===0||p===1&&u===h-1&&u===d+1?h!==-1&&(d===0&&l?s.base=s.name=r.slice(1,h):s.base=s.name=r.slice(d,h)):(d===0&&l?(s.name=r.slice(1,u),s.base=r.slice(1,h)):(s.name=r.slice(d,u),s.base=r.slice(d,h)),s.ext=r.slice(u,h)),d>0?s.dir=r.slice(0,d-1):l&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,ia=i,ia}var z1=U1();const V1=Fi(z1);function hc(){const{t}=Ko();return{getTitle:n=>n?n.includes(".")&&!n.startsWith("http")?t(n):n:""}}const B1={class:"truncate"},H1=Se({__name:"MenuItem",props:{route:{},fullPath:{}},setup(t){const{getTitle:e}=hc(),n=_s(),i=t;function o(){n.push({path:i.fullPath})}return(r,s)=>{const a=Ao,l=W_;return y(),T("span",{onClick:o},[j(l,{index:t.fullPath},{title:we(()=>[g("span",B1,L(m(e)(t.route.meta?.title)),1)]),default:we(()=>[j(a,null,{default:we(()=>[(y(),ne(Ot(t.route.meta?.icon)))]),_:1})]),_:1},8,["index"])])}}});function Bf(t,e){return function(){return t.apply(e,arguments)}}const{toString:q1}=Object.prototype,{getPrototypeOf:xs}=Object,{iterator:Ts,toStringTag:Hf}=Symbol,Os=(t=>e=>{const n=q1.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Sn=t=>(t=t.toLowerCase(),e=>Os(e)===t),$s=t=>e=>typeof e===t,{isArray:po}=Array,to=$s("undefined");function Xo(t){return t!==null&&!to(t)&&t.constructor!==null&&!to(t.constructor)&&Ht(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const qf=Sn("ArrayBuffer");function W1(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&qf(t.buffer),e}const K1=$s("string"),Ht=$s("function"),Wf=$s("number"),Jo=t=>t!==null&&typeof t=="object",Y1=t=>t===!0||t===!1,Hr=t=>{if(Os(t)!=="object")return!1;const e=xs(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Hf in t)&&!(Ts in t)},G1=t=>{if(!Jo(t)||Xo(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Q1=Sn("Date"),X1=Sn("File"),J1=t=>!!(t&&typeof t.uri<"u"),Z1=t=>t&&typeof t.getParts<"u",eE=Sn("Blob"),tE=Sn("FileList"),nE=t=>Jo(t)&&Ht(t.pipe);function iE(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const wd=iE(),Ed=typeof wd.FormData<"u"?wd.FormData:void 0,oE=t=>{if(!t)return!1;if(Ed&&t instanceof Ed)return!0;const e=xs(t);if(!e||e===Object.prototype||!Ht(t.append))return!1;const n=Os(t);return n==="formdata"||n==="object"&&Ht(t.toString)&&t.toString()==="[object FormData]"},rE=Sn("URLSearchParams"),[sE,aE,lE,cE]=["ReadableStream","Request","Response","Headers"].map(Sn),uE=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Zo(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let i,o;if(typeof t!="object"&&(t=[t]),po(t))for(i=0,o=t.length;i<o;i++)e.call(null,t[i],i,t);else{if(Xo(t))return;const r=n?Object.getOwnPropertyNames(t):Object.keys(t),s=r.length;let a;for(i=0;i<s;i++)a=r[i],e.call(null,t[a],a,t)}}function Kf(t,e){if(Xo(t))return null;e=e.toLowerCase();const n=Object.keys(t);let i=n.length,o;for(;i-- >0;)if(o=n[i],e===o.toLowerCase())return o;return null}const Oi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Yf=t=>!to(t)&&t!==Oi;function cl(){const{caseless:t,skipUndefined:e}=Yf(this)&&this||{},n={},i=(o,r)=>{if(r==="__proto__"||r==="constructor"||r==="prototype")return;const s=t&&Kf(n,r)||r;Hr(n[s])&&Hr(o)?n[s]=cl(n[s],o):Hr(o)?n[s]=cl({},o):po(o)?n[s]=o.slice():(!e||!to(o))&&(n[s]=o)};for(let o=0,r=arguments.length;o<r;o++)arguments[o]&&Zo(arguments[o],i);return n}const dE=(t,e,n,{allOwnKeys:i}={})=>(Zo(e,(o,r)=>{n&&Ht(o)?Object.defineProperty(t,r,{value:Bf(o,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),t),hE=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),pE=(t,e,n,i)=>{t.prototype=Object.create(e.prototype,i),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},fE=(t,e,n,i)=>{let o,r,s;const a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),r=o.length;r-- >0;)s=o[r],(!i||i(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&xs(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},mE=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const i=t.indexOf(e,n);return i!==-1&&i===n},vE=t=>{if(!t)return null;if(po(t))return t;let e=t.length;if(!Wf(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},gE=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&xs(Uint8Array)),_E=(t,e)=>{const i=(t&&t[Ts]).call(t);let o;for(;(o=i.next())&&!o.done;){const r=o.value;e.call(t,r[0],r[1])}},yE=(t,e)=>{let n;const i=[];for(;(n=t.exec(e))!==null;)i.push(n);return i},bE=Sn("HTMLFormElement"),wE=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,o){return i.toUpperCase()+o}),Sd=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),EE=Sn("RegExp"),Gf=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),i={};Zo(n,(o,r)=>{let s;(s=e(o,r,t))!==!1&&(i[r]=s||o)}),Object.defineProperties(t,i)},SE=t=>{Gf(t,(e,n)=>{if(Ht(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=t[n];if(Ht(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},CE=(t,e)=>{const n={},i=o=>{o.forEach(r=>{n[r]=!0})};return po(t)?i(t):i(String(t).split(e)),n},xE=()=>{},TE=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function OE(t){return!!(t&&Ht(t.append)&&t[Hf]==="FormData"&&t[Ts])}const $E=t=>{const e=new Array(10),n=(i,o)=>{if(Jo(i)){if(e.indexOf(i)>=0)return;if(Xo(i))return i;if(!("toJSON"in i)){e[o]=i;const r=po(i)?[]:{};return Zo(i,(s,a)=>{const l=n(s,o+1);!to(l)&&(r[a]=l)}),e[o]=void 0,r}}return i};return n(t,0)},kE=Sn("AsyncFunction"),AE=t=>t&&(Jo(t)||Ht(t))&&Ht(t.then)&&Ht(t.catch),Qf=((t,e)=>t?setImmediate:e?((n,i)=>(Oi.addEventListener("message",({source:o,data:r})=>{o===Oi&&r===n&&i.length&&i.shift()()},!1),o=>{i.push(o),Oi.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ht(Oi.postMessage)),PE=typeof queueMicrotask<"u"?queueMicrotask.bind(Oi):typeof process<"u"&&process.nextTick||Qf,RE=t=>t!=null&&Ht(t[Ts]),W={isArray:po,isArrayBuffer:qf,isBuffer:Xo,isFormData:oE,isArrayBufferView:W1,isString:K1,isNumber:Wf,isBoolean:Y1,isObject:Jo,isPlainObject:Hr,isEmptyObject:G1,isReadableStream:sE,isRequest:aE,isResponse:lE,isHeaders:cE,isUndefined:to,isDate:Q1,isFile:X1,isReactNativeBlob:J1,isReactNative:Z1,isBlob:eE,isRegExp:EE,isFunction:Ht,isStream:nE,isURLSearchParams:rE,isTypedArray:gE,isFileList:tE,forEach:Zo,merge:cl,extend:dE,trim:uE,stripBOM:hE,inherits:pE,toFlatObject:fE,kindOf:Os,kindOfTest:Sn,endsWith:mE,toArray:vE,forEachEntry:_E,matchAll:yE,isHTMLForm:bE,hasOwnProperty:Sd,hasOwnProp:Sd,reduceDescriptors:Gf,freezeMethods:SE,toObjectSet:CE,toCamelCase:wE,noop:xE,toFiniteNumber:TE,findKey:Kf,global:Oi,isContextDefined:Yf,isSpecCompliantForm:OE,toJSONObject:$E,isAsyncFn:kE,isThenable:AE,setImmediate:Qf,asap:PE,isIterable:RE};let Fe=class Xf extends Error{static from(e,n,i,o,r,s){const a=new Xf(e.message,n||e.code,i,o,r);return a.cause=e,a.name=e.name,e.status!=null&&a.status==null&&(a.status=e.status),s&&Object.assign(a,s),a}constructor(e,n,i,o,r){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),i&&(this.config=i),o&&(this.request=o),r&&(this.response=r,this.status=r.status)}toJSON(){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:W.toJSONObject(this.config),code:this.code,status:this.status}}};Fe.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";Fe.ERR_BAD_OPTION="ERR_BAD_OPTION";Fe.ECONNABORTED="ECONNABORTED";Fe.ETIMEDOUT="ETIMEDOUT";Fe.ERR_NETWORK="ERR_NETWORK";Fe.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";Fe.ERR_DEPRECATED="ERR_DEPRECATED";Fe.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";Fe.ERR_BAD_REQUEST="ERR_BAD_REQUEST";Fe.ERR_CANCELED="ERR_CANCELED";Fe.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";Fe.ERR_INVALID_URL="ERR_INVALID_URL";Fe.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const IE=null;function ul(t){return W.isPlainObject(t)||W.isArray(t)}function Jf(t){return W.endsWith(t,"[]")?t.slice(0,-2):t}function oa(t,e,n){return t?t.concat(e).map(function(o,r){return o=Jf(o),!n&&r?"["+o+"]":o}).join(n?".":""):e}function ME(t){return W.isArray(t)&&!t.some(ul)}const DE=W.toFlatObject(W,{},null,function(e){return/^is[A-Z]/.test(e)});function ks(t,e,n){if(!W.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=W.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(_,S){return!W.isUndefined(S[_])});const i=n.metaTokens,o=n.visitor||d,r=n.dots,s=n.indexes,a=n.Blob||typeof Blob<"u"&&Blob,l=n.maxDepth===void 0?100:n.maxDepth,c=a&&W.isSpecCompliantForm(e);if(!W.isFunction(o))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(W.isDate(p))return p.toISOString();if(W.isBoolean(p))return p.toString();if(!c&&W.isBlob(p))throw new Fe("Blob is not supported. Use a Buffer instead.");return W.isArrayBuffer(p)||W.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function d(p,_,S){let w=p;if(W.isReactNative(e)&&W.isReactNativeBlob(p))return e.append(oa(S,_,r),u(p)),!1;if(p&&!S&&typeof p=="object"){if(W.endsWith(_,"{}"))_=i?_:_.slice(0,-2),p=JSON.stringify(p);else if(W.isArray(p)&&ME(p)||(W.isFileList(p)||W.endsWith(_,"[]"))&&(w=W.toArray(p)))return _=Jf(_),w.forEach(function(b,C){!(W.isUndefined(b)||b===null)&&e.append(s===!0?oa([_],C,r):s===null?_:_+"[]",u(b))}),!1}return ul(p)?!0:(e.append(oa(S,_,r),u(p)),!1)}const h=[],v=Object.assign(DE,{defaultVisitor:d,convertValue:u,isVisitable:ul});function f(p,_,S=0){if(!W.isUndefined(p)){if(S>l)throw new Fe("Object is too deeply nested ("+S+" levels). Max depth: "+l,Fe.ERR_FORM_DATA_DEPTH_EXCEEDED);if(h.indexOf(p)!==-1)throw Error("Circular reference detected in "+_.join("."));h.push(p),W.forEach(p,function(E,b){(!(W.isUndefined(E)||E===null)&&o.call(e,E,W.isString(b)?b.trim():b,_,v))===!0&&f(E,_?_.concat(b):[b],S+1)}),h.pop()}}if(!W.isObject(t))throw new TypeError("data must be an object");return f(t),e}function Cd(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(t).replace(/[!'()~]|%20/g,function(i){return e[i]})}function pc(t,e){this._pairs=[],t&&ks(t,this,e)}const Zf=pc.prototype;Zf.append=function(e,n){this._pairs.push([e,n])};Zf.toString=function(e){const n=e?function(i){return e.call(this,i,Cd)}:Cd;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function FE(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function em(t,e,n){if(!e)return t;const i=n&&n.encode||FE,o=W.isFunction(n)?{serialize:n}:n,r=o&&o.serialize;let s;if(r?s=r(e,o):s=W.isURLSearchParams(e)?e.toString():new pc(e,o).toString(i),s){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class xd{constructor(){this.handlers=[]}use(e,n,i){return this.handlers.push({fulfilled:e,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){W.forEach(this.handlers,function(i){i!==null&&e(i)})}}const fc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},LE=typeof URLSearchParams<"u"?URLSearchParams:pc,jE=typeof FormData<"u"?FormData:null,NE=typeof Blob<"u"?Blob:null,UE={isBrowser:!0,classes:{URLSearchParams:LE,FormData:jE,Blob:NE},protocols:["http","https","file","blob","url","data"]},mc=typeof window<"u"&&typeof document<"u",dl=typeof navigator=="object"&&navigator||void 0,zE=mc&&(!dl||["ReactNative","NativeScript","NS"].indexOf(dl.product)<0),VE=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",BE=mc&&window.location.href||"http://localhost",HE=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:mc,hasStandardBrowserEnv:zE,hasStandardBrowserWebWorkerEnv:VE,navigator:dl,origin:BE},Symbol.toStringTag,{value:"Module"})),kt={...HE,...UE};function qE(t,e){return ks(t,new kt.classes.URLSearchParams,{visitor:function(n,i,o,r){return kt.isNode&&W.isBuffer(n)?(this.append(i,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...e})}function WE(t){return W.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function KE(t){const e={},n=Object.keys(t);let i;const o=n.length;let r;for(i=0;i<o;i++)r=n[i],e[r]=t[r];return e}function tm(t){function e(n,i,o,r){let s=n[r++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),l=r>=n.length;return s=!s&&W.isArray(o)?o.length:s,l?(W.hasOwnProp(o,s)?o[s]=W.isArray(o[s])?o[s].concat(i):[o[s],i]:o[s]=i,!a):((!o[s]||!W.isObject(o[s]))&&(o[s]=[]),e(n,i,o[s],r)&&W.isArray(o[s])&&(o[s]=KE(o[s])),!a)}if(W.isFormData(t)&&W.isFunction(t.entries)){const n={};return W.forEachEntry(t,(i,o)=>{e(WE(i),o,n,0)}),n}return null}const ji=(t,e)=>t!=null&&W.hasOwnProp(t,e)?t[e]:void 0;function YE(t,e,n){if(W.isString(t))try{return(e||JSON.parse)(t),W.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(t)}const er={transitional:fc,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const i=n.getContentType()||"",o=i.indexOf("application/json")>-1,r=W.isObject(e);if(r&&W.isHTMLForm(e)&&(e=new FormData(e)),W.isFormData(e))return o?JSON.stringify(tm(e)):e;if(W.isArrayBuffer(e)||W.isBuffer(e)||W.isStream(e)||W.isFile(e)||W.isBlob(e)||W.isReadableStream(e))return e;if(W.isArrayBufferView(e))return e.buffer;if(W.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(r){const l=ji(this,"formSerializer");if(i.indexOf("application/x-www-form-urlencoded")>-1)return qE(e,l).toString();if((a=W.isFileList(e))||i.indexOf("multipart/form-data")>-1){const c=ji(this,"env"),u=c&&c.FormData;return ks(a?{"files[]":e}:e,u&&new u,l)}}return r||o?(n.setContentType("application/json",!1),YE(e)):e}],transformResponse:[function(e){const n=ji(this,"transitional")||er.transitional,i=n&&n.forcedJSONParsing,o=ji(this,"responseType"),r=o==="json";if(W.isResponse(e)||W.isReadableStream(e))return e;if(e&&W.isString(e)&&(i&&!o||r)){const a=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(e,ji(this,"parseReviver"))}catch(l){if(a)throw l.name==="SyntaxError"?Fe.from(l,Fe.ERR_BAD_RESPONSE,this,null,ji(this,"response")):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:kt.classes.FormData,Blob:kt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};W.forEach(["delete","get","head","post","put","patch"],t=>{er.headers[t]={}});const GE=W.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"]),QE=t=>{const e={};let n,i,o;return t&&t.split(`
|
|
4
|
+
`).forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),i=s.substring(o+1).trim(),!(!n||e[n]&&GE[n])&&(n==="set-cookie"?e[n]?e[n].push(i):e[n]=[i]:e[n]=e[n]?e[n]+", "+i:i)}),e},Td=Symbol("internals"),XE=/[^\x09\x20-\x7E\x80-\xFF]/g;function JE(t){let e=0,n=t.length;for(;e<n;){const i=t.charCodeAt(e);if(i!==9&&i!==32)break;e+=1}for(;n>e;){const i=t.charCodeAt(n-1);if(i!==9&&i!==32)break;n-=1}return e===0&&n===t.length?t:t.slice(e,n)}function bo(t){return t&&String(t).trim().toLowerCase()}function ZE(t){return JE(t.replace(XE,""))}function qr(t){return t===!1||t==null?t:W.isArray(t)?t.map(qr):ZE(String(t))}function eS(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(t);)e[i[1]]=i[2];return e}const tS=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ra(t,e,n,i,o){if(W.isFunction(i))return i.call(this,e,n);if(o&&(e=n),!!W.isString(e)){if(W.isString(i))return e.indexOf(i)!==-1;if(W.isRegExp(i))return i.test(e)}}function nS(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,i)=>n.toUpperCase()+i)}function iS(t,e){const n=W.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(t,i+n,{value:function(o,r,s){return this[i].call(this,e,o,r,s)},configurable:!0})})}let qt=class{constructor(e){e&&this.set(e)}set(e,n,i){const o=this;function r(a,l,c){const u=bo(l);if(!u)throw new Error("header name must be a non-empty string");const d=W.findKey(o,u);(!d||o[d]===void 0||c===!0||c===void 0&&o[d]!==!1)&&(o[d||l]=qr(a))}const s=(a,l)=>W.forEach(a,(c,u)=>r(c,u,l));if(W.isPlainObject(e)||e instanceof this.constructor)s(e,n);else if(W.isString(e)&&(e=e.trim())&&!tS(e))s(QE(e),n);else if(W.isObject(e)&&W.isIterable(e)){let a={},l,c;for(const u of e){if(!W.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[c=u[0]]=(l=a[c])?W.isArray(l)?[...l,u[1]]:[l,u[1]]:u[1]}s(a,n)}else e!=null&&r(n,e,i);return this}get(e,n){if(e=bo(e),e){const i=W.findKey(this,e);if(i){const o=this[i];if(!n)return o;if(n===!0)return eS(o);if(W.isFunction(n))return n.call(this,o,i);if(W.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=bo(e),e){const i=W.findKey(this,e);return!!(i&&this[i]!==void 0&&(!n||ra(this,this[i],i,n)))}return!1}delete(e,n){const i=this;let o=!1;function r(s){if(s=bo(s),s){const a=W.findKey(i,s);a&&(!n||ra(i,i[a],a,n))&&(delete i[a],o=!0)}}return W.isArray(e)?e.forEach(r):r(e),o}clear(e){const n=Object.keys(this);let i=n.length,o=!1;for(;i--;){const r=n[i];(!e||ra(this,this[r],r,e,!0))&&(delete this[r],o=!0)}return o}normalize(e){const n=this,i={};return W.forEach(this,(o,r)=>{const s=W.findKey(i,r);if(s){n[s]=qr(o),delete n[r];return}const a=e?nS(r):String(r).trim();a!==r&&delete n[r],n[a]=qr(o),i[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return W.forEach(this,(i,o)=>{i!=null&&i!==!1&&(n[o]=e&&W.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
|
5
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const i=new this(e);return n.forEach(o=>i.set(o)),i}static accessor(e){const i=(this[Td]=this[Td]={accessors:{}}).accessors,o=this.prototype;function r(s){const a=bo(s);i[a]||(iS(o,s),i[a]=!0)}return W.isArray(e)?e.forEach(r):r(e),this}};qt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);W.reduceDescriptors(qt.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(i){this[n]=i}}});W.freezeMethods(qt);function sa(t,e){const n=this||er,i=e||n,o=qt.from(i.headers);let r=i.data;return W.forEach(t,function(a){r=a.call(n,r,o.normalize(),e?e.status:void 0)}),o.normalize(),r}function nm(t){return!!(t&&t.__CANCEL__)}let tr=class extends Fe{constructor(e,n,i){super(e??"canceled",Fe.ERR_CANCELED,n,i),this.name="CanceledError",this.__CANCEL__=!0}};function im(t,e,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?t(n):e(new Fe("Request failed with status code "+n.status,[Fe.ERR_BAD_REQUEST,Fe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function oS(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function rS(t,e){t=t||10;const n=new Array(t),i=new Array(t);let o=0,r=0,s;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=i[r];s||(s=c),n[o]=l,i[o]=c;let d=r,h=0;for(;d!==o;)h+=n[d++],d=d%t;if(o=(o+1)%t,o===r&&(r=(r+1)%t),c-s<e)return;const v=u&&c-u;return v?Math.round(h*1e3/v):void 0}}function sS(t,e){let n=0,i=1e3/e,o,r;const s=(c,u=Date.now())=>{n=u,o=null,r&&(clearTimeout(r),r=null),t(...c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=i?s(c,u):(o=c,r||(r=setTimeout(()=>{r=null,s(o)},i-d)))},()=>o&&s(o)]}const ss=(t,e,n=3)=>{let i=0;const o=rS(50,250);return sS(r=>{const s=r.loaded,a=r.lengthComputable?r.total:void 0,l=a!=null?Math.min(s,a):s,c=Math.max(0,l-i),u=o(c);i=Math.max(i,l);const d={loaded:l,total:a,progress:a?l/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a?(a-l)/u:void 0,event:r,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(d)},n)},Od=(t,e)=>{const n=t!=null;return[i=>e[0]({lengthComputable:n,total:t,loaded:i}),e[1]]},$d=t=>(...e)=>W.asap(()=>t(...e)),aS=kt.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,kt.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(kt.origin),kt.navigator&&/(msie|trident)/i.test(kt.navigator.userAgent)):()=>!0,lS=kt.hasStandardBrowserEnv?{write(t,e,n,i,o,r,s){if(typeof document>"u")return;const a=[`${t}=${encodeURIComponent(e)}`];W.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),W.isString(i)&&a.push(`path=${i}`),W.isString(o)&&a.push(`domain=${o}`),r===!0&&a.push("secure"),W.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function cS(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function uS(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function om(t,e,n){let i=!cS(e);return t&&(i||n===!1)?uS(t,e):e}const kd=t=>t instanceof qt?{...t}:t;function Ii(t,e){e=e||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function i(c,u,d,h){return W.isPlainObject(c)&&W.isPlainObject(u)?W.merge.call({caseless:h},c,u):W.isPlainObject(u)?W.merge({},u):W.isArray(u)?u.slice():u}function o(c,u,d,h){if(W.isUndefined(u)){if(!W.isUndefined(c))return i(void 0,c,d,h)}else return i(c,u,d,h)}function r(c,u){if(!W.isUndefined(u))return i(void 0,u)}function s(c,u){if(W.isUndefined(u)){if(!W.isUndefined(c))return i(void 0,c)}else return i(void 0,u)}function a(c,u,d){if(W.hasOwnProp(e,d))return i(c,u);if(W.hasOwnProp(t,d))return i(void 0,c)}const l={url:r,method:r,data:r,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,allowedSocketPaths:s,responseEncoding:s,validateStatus:a,headers:(c,u,d)=>o(kd(c),kd(u),d,!0)};return W.forEach(Object.keys({...t,...e}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const d=W.hasOwnProp(l,u)?l[u]:o,h=W.hasOwnProp(t,u)?t[u]:void 0,v=W.hasOwnProp(e,u)?e[u]:void 0,f=d(h,v,u);W.isUndefined(f)&&d!==a||(n[u]=f)}),n}const rm=t=>{const e=Ii({},t),n=h=>W.hasOwnProp(e,h)?e[h]:void 0,i=n("data");let o=n("withXSRFToken");const r=n("xsrfHeaderName"),s=n("xsrfCookieName");let a=n("headers");const l=n("auth"),c=n("baseURL"),u=n("allowAbsoluteUrls"),d=n("url");if(e.headers=a=qt.from(a),e.url=em(om(c,d,u),t.params,t.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),W.isFormData(i)){if(kt.hasStandardBrowserEnv||kt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(W.isFunction(i.getHeaders)){const h=i.getHeaders(),v=["content-type","content-length"];Object.entries(h).forEach(([f,p])=>{v.includes(f.toLowerCase())&&a.set(f,p)})}}if(kt.hasStandardBrowserEnv&&(W.isFunction(o)&&(o=o(e)),o===!0||o==null&&aS(e.url))){const v=r&&s&&lS.read(s);v&&a.set(r,v)}return e},dS=typeof XMLHttpRequest<"u",hS=dS&&function(t){return new Promise(function(n,i){const o=rm(t);let r=o.data;const s=qt.from(o.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=o,u,d,h,v,f;function p(){v&&v(),f&&f(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let _=new XMLHttpRequest;_.open(o.method.toUpperCase(),o.url,!0),_.timeout=o.timeout;function S(){if(!_)return;const E=qt.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),C={data:!a||a==="text"||a==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:E,config:t,request:_};im(function(k){n(k),p()},function(k){i(k),p()},C),_=null}"onloadend"in _?_.onloadend=S:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(S)},_.onabort=function(){_&&(i(new Fe("Request aborted",Fe.ECONNABORTED,t,_)),_=null)},_.onerror=function(b){const C=b&&b.message?b.message:"Network Error",x=new Fe(C,Fe.ERR_NETWORK,t,_);x.event=b||null,i(x),_=null},_.ontimeout=function(){let b=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||fc;o.timeoutErrorMessage&&(b=o.timeoutErrorMessage),i(new Fe(b,C.clarifyTimeoutError?Fe.ETIMEDOUT:Fe.ECONNABORTED,t,_)),_=null},r===void 0&&s.setContentType(null),"setRequestHeader"in _&&W.forEach(s.toJSON(),function(b,C){_.setRequestHeader(C,b)}),W.isUndefined(o.withCredentials)||(_.withCredentials=!!o.withCredentials),a&&a!=="json"&&(_.responseType=o.responseType),c&&([h,f]=ss(c,!0),_.addEventListener("progress",h)),l&&_.upload&&([d,v]=ss(l),_.upload.addEventListener("progress",d),_.upload.addEventListener("loadend",v)),(o.cancelToken||o.signal)&&(u=E=>{_&&(i(!E||E.type?new tr(null,t,_):E),_.abort(),_=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const w=oS(o.url);if(w&&kt.protocols.indexOf(w)===-1){i(new Fe("Unsupported protocol "+w+":",Fe.ERR_BAD_REQUEST,t));return}_.send(r||null)})},pS=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let i=new AbortController,o;const r=function(c){if(!o){o=!0,a();const u=c instanceof Error?c:this.reason;i.abort(u instanceof Fe?u:new tr(u instanceof Error?u.message:u))}};let s=e&&setTimeout(()=>{s=null,r(new Fe(`timeout of ${e}ms exceeded`,Fe.ETIMEDOUT))},e);const a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),t=null)};t.forEach(c=>c.addEventListener("abort",r));const{signal:l}=i;return l.unsubscribe=()=>W.asap(a),l}},fS=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let i=0,o;for(;i<n;)o=i+e,yield t.slice(i,o),i=o},mS=async function*(t,e){for await(const n of vS(t))yield*fS(n,e)},vS=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:i}=await e.read();if(n)break;yield i}}finally{await e.cancel()}},Ad=(t,e,n,i)=>{const o=mS(t,e);let r=0,s,a=l=>{s||(s=!0,i&&i(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await o.next();if(c){a(),l.close();return}let d=u.byteLength;if(n){let h=r+=d;n(h)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),o.return()}},{highWaterMark:2})},Pd=64*1024,{isFunction:gr}=W,gS=(({Request:t,Response:e})=>({Request:t,Response:e}))(W.global),{ReadableStream:Rd,TextEncoder:Id}=W.global,Md=(t,...e)=>{try{return!!t(...e)}catch{return!1}},_S=t=>{t=W.merge.call({skipUndefined:!0},gS,t);const{fetch:e,Request:n,Response:i}=t,o=e?gr(e):typeof fetch=="function",r=gr(n),s=gr(i);if(!o)return!1;const a=o&&gr(Rd),l=o&&(typeof Id=="function"?(f=>p=>f.encode(p))(new Id):async f=>new Uint8Array(await new n(f).arrayBuffer())),c=r&&a&&Md(()=>{let f=!1;const p=new n(kt.origin,{body:new Rd,method:"POST",get duplex(){return f=!0,"half"}}),_=p.headers.has("Content-Type");return p.body!=null&&p.body.cancel(),f&&!_}),u=s&&a&&Md(()=>W.isReadableStream(new i("").body)),d={stream:u&&(f=>f.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!d[f]&&(d[f]=(p,_)=>{let S=p&&p[f];if(S)return S.call(p);throw new Fe(`Response type '${f}' is not supported`,Fe.ERR_NOT_SUPPORT,_)})});const h=async f=>{if(f==null)return 0;if(W.isBlob(f))return f.size;if(W.isSpecCompliantForm(f))return(await new n(kt.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(W.isArrayBufferView(f)||W.isArrayBuffer(f))return f.byteLength;if(W.isURLSearchParams(f)&&(f=f+""),W.isString(f))return(await l(f)).byteLength},v=async(f,p)=>{const _=W.toFiniteNumber(f.getContentLength());return _??h(p)};return async f=>{let{url:p,method:_,data:S,signal:w,cancelToken:E,timeout:b,onDownloadProgress:C,onUploadProgress:x,responseType:k,headers:O,withCredentials:K="same-origin",fetchOptions:D}=rm(f),P=e||fetch;k=k?(k+"").toLowerCase():"text";let U=pS([w,E&&E.toAbortSignal()],b),M=null;const q=U&&U.unsubscribe&&(()=>{U.unsubscribe()});let le;try{if(x&&c&&_!=="get"&&_!=="head"&&(le=await v(O,S))!==0){let z=new n(p,{method:"POST",body:S,duplex:"half"}),ie;if(W.isFormData(S)&&(ie=z.headers.get("content-type"))&&O.setContentType(ie),z.body){const[ve,re]=Od(le,ss($d(x)));S=Ad(z.body,Pd,ve,re)}}W.isString(K)||(K=K?"include":"omit");const de=r&&"credentials"in n.prototype;if(W.isFormData(S)){const z=O.getContentType();z&&/^multipart\/form-data/i.test(z)&&!/boundary=/i.test(z)&&O.delete("content-type")}const Y={...D,signal:U,method:_.toUpperCase(),headers:O.normalize().toJSON(),body:S,duplex:"half",credentials:de?K:void 0};M=r&&new n(p,Y);let I=await(r?P(M,D):P(p,Y));const A=u&&(k==="stream"||k==="response");if(u&&(C||A&&q)){const z={};["status","statusText","headers"].forEach(ge=>{z[ge]=I[ge]});const ie=W.toFiniteNumber(I.headers.get("content-length")),[ve,re]=C&&Od(ie,ss($d(C),!0))||[];I=new i(Ad(I.body,Pd,ve,()=>{re&&re(),q&&q()}),z)}k=k||"text";let Q=await d[W.findKey(d,k)||"text"](I,f);return!A&&q&&q(),await new Promise((z,ie)=>{im(z,ie,{data:Q,headers:qt.from(I.headers),status:I.status,statusText:I.statusText,config:f,request:M})})}catch(de){throw q&&q(),de&&de.name==="TypeError"&&/Load failed|fetch/i.test(de.message)?Object.assign(new Fe("Network Error",Fe.ERR_NETWORK,f,M,de&&de.response),{cause:de.cause||de}):Fe.from(de,de&&de.code,f,M,de&&de.response)}}},yS=new Map,sm=t=>{let e=t&&t.env||{};const{fetch:n,Request:i,Response:o}=e,r=[i,o,n];let s=r.length,a=s,l,c,u=yS;for(;a--;)l=r[a],c=u.get(l),c===void 0&&u.set(l,c=a?new Map:_S(e)),u=c;return c};sm();const vc={http:IE,xhr:hS,fetch:{get:sm}};W.forEach(vc,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Dd=t=>`- ${t}`,bS=t=>W.isFunction(t)||t===null||t===!1;function wS(t,e){t=W.isArray(t)?t:[t];const{length:n}=t;let i,o;const r={};for(let s=0;s<n;s++){i=t[s];let a;if(o=i,!bS(i)&&(o=vc[(a=String(i)).toLowerCase()],o===void 0))throw new Fe(`Unknown adapter '${a}'`);if(o&&(W.isFunction(o)||(o=o.get(e))))break;r[a||"#"+s]=o}if(!o){const s=Object.entries(r).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=n?s.length>1?`since :
|
|
6
6
|
`+s.map(Dd).join(`
|
|
7
|
-
`):" "+Dd(s[0]):"as no adapter specified";throw new
|
|
7
|
+
`):" "+Dd(s[0]):"as no adapter specified";throw new Fe("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const am={getAdapter:wS,adapters:vc};function aa(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new tr(null,t)}function Fd(t){return aa(t),t.headers=qt.from(t.headers),t.data=sa.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),am.getAdapter(t.adapter||er.adapter,t)(t).then(function(i){return aa(t),i.data=sa.call(t,t.transformResponse,i),i.headers=qt.from(i.headers),i},function(i){return nm(i)||(aa(t),i&&i.response&&(i.response.data=sa.call(t,t.transformResponse,i.response),i.response.headers=qt.from(i.response.headers))),Promise.reject(i)})}const lm="1.15.2",As={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{As[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}});const Ld={};As.transitional=function(e,n,i){function o(r,s){return"[Axios v"+lm+"] Transitional option '"+r+"'"+s+(i?". "+i:"")}return(r,s,a)=>{if(e===!1)throw new Fe(o(s," has been removed"+(n?" in "+n:"")),Fe.ERR_DEPRECATED);return n&&!Ld[s]&&(Ld[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(r,s,a):!0}};As.spelling=function(e){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${e}`),!0)};function ES(t,e,n){if(typeof t!="object")throw new Fe("options must be an object",Fe.ERR_BAD_OPTION_VALUE);const i=Object.keys(t);let o=i.length;for(;o-- >0;){const r=i[o],s=Object.prototype.hasOwnProperty.call(e,r)?e[r]:void 0;if(s){const a=t[r],l=a===void 0||s(a,r,t);if(l!==!0)throw new Fe("option "+r+" must be "+l,Fe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Fe("Unknown option "+r,Fe.ERR_BAD_OPTION)}}const Wr={assertOptions:ES,validators:As},rn=Wr.validators;let $i=class{constructor(e){this.defaults=e||{},this.interceptors={request:new xd,response:new xd}}async request(e,n){try{return await this._request(e,n)}catch(i){if(i instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const r=(()=>{if(!o.stack)return"";const s=o.stack.indexOf(`
|
|
8
8
|
`);return s===-1?"":o.stack.slice(s+1)})();try{if(!i.stack)i.stack=r;else if(r){const s=r.indexOf(`
|
|
9
9
|
`),a=s===-1?-1:r.indexOf(`
|
|
10
10
|
`,s+1),l=a===-1?"":r.slice(a+1);String(i.stack).endsWith(l)||(i.stack+=`
|
|
11
|
-
`+r)}}catch{}}throw i}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Ii(this.defaults,n);const{transitional:i,paramsSerializer:o,headers:r}=n;i!==void 0&&Wr.assertOptions(i,{silentJSONParsing:rn.transitional(rn.boolean),forcedJSONParsing:rn.transitional(rn.boolean),clarifyTimeoutError:rn.transitional(rn.boolean),legacyInterceptorReqResOrdering:rn.transitional(rn.boolean)},!1),o!=null&&(W.isFunction(o)?n.paramsSerializer={serialize:o}:Wr.assertOptions(o,{encode:rn.function,serialize:rn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Wr.assertOptions(n,{baseUrl:rn.spelling("baseURL"),withXsrfToken:rn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=r&&W.merge(r.common,r[n.method]);r&&W.forEach(["delete","get","head","post","put","patch","common"],f=>{delete r[f]}),n.headers=qt.concat(s,r);const a=[];let l=!0;this.interceptors.request.forEach(function(p){if(typeof p.runWhen=="function"&&p.runWhen(n)===!1)return;l=l&&p.synchronous;const _=n.transitional||vc;_&&_.legacyInterceptorReqResOrdering?a.unshift(p.fulfilled,p.rejected):a.push(p.fulfilled,p.rejected)});const c=[];this.interceptors.response.forEach(function(p){c.push(p.fulfilled,p.rejected)});let u,d=0,h;if(!l){const f=[Ld.bind(this),void 0];for(f.unshift(...a),f.push(...c),h=f.length,u=Promise.resolve(n);d<h;)u=u.then(f[d++],f[d++]);return u}h=a.length;let m=n;for(;d<h;){const f=a[d++],p=a[d++];try{m=f(m)}catch(_){p.call(this,_);break}}try{u=Ld.call(this,m)}catch(f){return Promise.reject(f)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(e){e=Ii(this.defaults,e);const n=rm(e.baseURL,e.url,e.allowAbsoluteUrls);return tm(n,e.params,e.paramsSerializer)}};W.forEach(["delete","get","head","options"],function(e){ki.prototype[e]=function(n,i){return this.request(Ii(i||{},{method:e,url:n,data:(i||{}).data}))}});W.forEach(["post","put","patch"],function(e){function n(i){return function(r,s,a){return this.request(Ii(a||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:r,data:s}))}}ki.prototype[e]=n(),ki.prototype[e+"Form"]=n(!0)});let CS=class um{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(r){n=r});const i=this;this.promise.then(o=>{if(!i._listeners)return;let r=i._listeners.length;for(;r-- >0;)i._listeners[r](o);i._listeners=null}),this.promise.then=o=>{let r;const s=new Promise(a=>{i.subscribe(a),r=a}).then(o);return s.cancel=function(){i.unsubscribe(r)},s},e(function(r,s,a){i.reason||(i.reason=new nr(r,s,a),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=i=>{e.abort(i)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new um(function(o){e=o}),cancel:e}}};function ES(t){return function(n){return t.apply(null,n)}}function xS(t){return W.isObject(t)&&t.isAxiosError===!0}const pl={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(pl).forEach(([t,e])=>{pl[e]=t});function dm(t){const e=new ki(t),n=Hf(ki.prototype.request,e);return W.extend(n,ki.prototype,e,{allOwnKeys:!0}),W.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return dm(Ii(t,o))},n}const ht=dm(tr);ht.Axios=ki;ht.CanceledError=nr;ht.CancelToken=CS;ht.isCancel=im;ht.VERSION=cm;ht.toFormData=Os;ht.AxiosError=De;ht.Cancel=ht.CanceledError;ht.all=function(e){return Promise.all(e)};ht.spread=ES;ht.isAxiosError=xS;ht.mergeConfig=Ii;ht.AxiosHeaders=qt;ht.formToJSON=t=>nm(W.isHTMLForm(t)?new FormData(t):t);ht.getAdapter=lm.getAdapter;ht.HttpStatusCode=pl;ht.default=ht;const{Axios:sN,AxiosError:aN,CanceledError:lN,isCancel:cN,CancelToken:uN,VERSION:dN,all:hN,Cancel:pN,isAxiosError:fN,spread:mN,toFormData:vN,AxiosHeaders:gN,HttpStatusCode:zd,formToJSON:_N,getAdapter:yN,mergeConfig:bN}=ht,hm=new Map,TS={baseURL:"",timeout:1e4};function Nd(t,e){const n=ht.create({...TS,...e});return hm.set(t,n),n}function $S(t="default"){const e=hm.get(t);if(!e)throw new Error(`Instance "${t}" not initialized. Call initInstance() first.`);return e}async function Se(t,e){const n=t.split("/")[0],i=$S(n);return t=t.replace(n,""),i.request({url:t,...e})}async function kS(t,e){return Se("__local__/api/v1/comp/check",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function OS(t,e){return Se("__local__/api/v1/comp/checkCompRepeat",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function AS(t,e){return Se("__local__/api/v1/comp/compFileHash",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function PS(t,e){return Se("__local__/api/v1/comp/compFilesOssSignedUrl",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function RS(t,e){return Se("__local__/api/v1/comp/dep",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function IS(t,e){return Se("__local__/api/v1/comp/dir",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function MS(t,e){return Se("__local__/api/v1/comp/download",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function FS(t,e){return Se("__local__/api/v1/comp/file",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function DS(t,e){return Se("__local__/api/v1/comp/generateCompJson",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function LS(t,e){return Se("__local__/api/v1/comp/localCompDetailByPathHash",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function jS(t,e){return Se("__local__/api/v1/comp/localComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function zS(t,e){return Se("__local__/api/v1/comp/localCompsByIds",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function NS(t,e){return Se("__local__/api/v1/comp/openCompPathInVscode",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function US(t){return Se("__local__/api/v1/comp/packageJson",{method:"POST",...t||{}})}async function VS(t,e){return Se("__local__/api/v1/comp/submit",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function BS(t,e){return Se("__local__/api/v1/comp/update",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function HS(t,e){return Se("__local__/api/v1/comp/updateVersion",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const qS=Object.freeze(Object.defineProperty({__proto__:null,compcontrollerCheck:kS,compcontrollerCheckcomprepeat:OS,compcontrollerCompfilehash:AS,compcontrollerCompfilesosssignedurl:PS,compcontrollerDep:RS,compcontrollerDir:IS,compcontrollerDownload:MS,compcontrollerFile:FS,compcontrollerGeneratecompjson:DS,compcontrollerLocalcompdetailbypathhash:LS,compcontrollerLocalcomps:jS,compcontrollerLocalcompsbyids:zS,compcontrollerOpencomppathinvscode:NS,compcontrollerPackagejson:US,compcontrollerSubmit:VS,compcontrollerUpdate:BS,compcontrollerUpdateversion:HS},Symbol.toStringTag,{value:"Module"}));async function WS(t){return Se("__local__/api/v1/module/clearPreBuild",{method:"POST",...t||{}})}async function KS(t,e){return Se("__local__/api/v1/module/preBuild",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function YS(t){return Se("__local__/api/v1/module/preBuildSize",{method:"POST",...t||{}})}const GS=Object.freeze(Object.defineProperty({__proto__:null,modulecontrollerClearprebuild:WS,modulecontrollerPrebuild:KS,modulecontrollerPrebuildsize:YS},Symbol.toStringTag,{value:"Module"}));async function QS(t,e){return Se("__local__/api/v1/oss/fileSignUrl",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const XS=Object.freeze(Object.defineProperty({__proto__:null,osscontrollerFilesignurl:QS},Symbol.toStringTag,{value:"Module"}));async function JS(t,e){return Se("__local__/api/v1/preprocessing/preprocess",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const ZS=Object.freeze(Object.defineProperty({__proto__:null,preprocessingcontrollerPreprocess:JS},Symbol.toStringTag,{value:"Module"}));async function eC(t,e){return Se("__local__/api/v1/vuefinder/list",{method:"GET",params:{...t},...e||{}})}const tC=Object.freeze(Object.defineProperty({__proto__:null,vuefindercontrollerList:eC},Symbol.toStringTag,{value:"Module"})),nC={v1Comp:qS,v1Module:GS,v1Oss:XS,v1Preprocessing:ZS,v1Vuefinder:tC};async function iC(t,e){return Se("__remote__/api/v1/comp/checkCompExistByHash",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function oC(t,e){return Se("__remote__/api/v1/comp/checkCompExistById",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function rC(t,e){return Se("__remote__/api/v1/comp/checkVersion",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function sC(t,e){return Se("__remote__/api/v1/comp/collect",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function aC(t,e){return Se("__remote__/api/v1/comp/collectedComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function lC(t,e){return Se("__remote__/api/v1/comp/compDetail",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function cC(t,e){return Se("__remote__/api/v1/comp/compHash",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function uC(t,e){return Se("__remote__/api/v1/comp/comps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function dC(t,e){return Se("__remote__/api/v1/comp/compsByIds",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function hC(t,e){return Se("__remote__/api/v1/comp/deleteFailedComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function pC(t,e){return Se("__remote__/api/v1/comp/deleteMyComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function fC(t,e){return Se("__remote__/api/v1/comp/existCompsByIds",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function mC(t,e){return Se("__remote__/api/v1/comp/myComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function vC(t,e){return Se("__remote__/api/v1/comp/similarComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function gC(t,e){return Se("__remote__/api/v1/comp/softDelete",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function _C(t,e){return Se("__remote__/api/v1/comp/update",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function yC(t,e){return Se("__remote__/api/v1/comp/updateBasicInfo",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function bC(t,e){return Se("__remote__/api/v1/comp/updateCompDownloadCount",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function wC(t,e){return Se("__remote__/api/v1/comp/updateObjectId",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function SC(t,e){return Se("__remote__/api/v1/comp/upgradeRecords",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function CC(t,e){return Se("__remote__/api/v1/comp/upload",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function EC(t,e){return Se("__remote__/api/v1/comp/versions",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const xC=Object.freeze(Object.defineProperty({__proto__:null,compcontrollerCheckcompexistbyhash:iC,compcontrollerCheckcompexistbyid:oC,compcontrollerCheckversion:rC,compcontrollerCollect:sC,compcontrollerCollectedcomps:aC,compcontrollerCompdetail:lC,compcontrollerComphash:cC,compcontrollerComps:uC,compcontrollerCompsbyids:dC,compcontrollerDeletefailedcomp:hC,compcontrollerDeletemycomp:pC,compcontrollerExistcompsbyids:fC,compcontrollerMycomps:mC,compcontrollerSimilarcomps:vC,compcontrollerSoftdelete:gC,compcontrollerUpdate:_C,compcontrollerUpdatebasicinfo:yC,compcontrollerUpdatecompdownloadcount:bC,compcontrollerUpdateobjectid:wC,compcontrollerUpgraderecords:SC,compcontrollerUpload:CC,compcontrollerVersions:EC},Symbol.toStringTag,{value:"Module"}));async function TC(t){return Se("__remote__/api/v1/csrf/csrf",{method:"GET",...t||{}})}const $C=Object.freeze(Object.defineProperty({__proto__:null,csrfcontrollerGetcsrftoken:TC},Symbol.toStringTag,{value:"Module"}));async function kC(t,e){return Se("__remote__/api/v1/email/sendCode",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const OC=Object.freeze(Object.defineProperty({__proto__:null,emailcontrollerSendcode:kC},Symbol.toStringTag,{value:"Module"}));async function AC(t,e){return Se("__remote__/api/v1/keyword/queryKeywordsComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const PC=Object.freeze(Object.defineProperty({__proto__:null,keywordcontrollerQuerykeywordscomp:AC},Symbol.toStringTag,{value:"Module"}));async function RC(t){return Se("__remote__/api/v1/oss/compOssDir",{method:"POST",...t||{}})}async function IC(t){return Se("__remote__/api/v1/oss/getSts",{method:"POST",...t||{}})}async function MC(t,e){return Se("__remote__/api/v1/oss/putPolicy",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const FC=Object.freeze(Object.defineProperty({__proto__:null,osscontrollerCompossdir:RC,osscontrollerGetsts:IC,osscontrollerPutpolicy:MC},Symbol.toStringTag,{value:"Module"}));async function DC(t,e){return Se("__remote__/api/v1/team/addToTeamMyComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function LC(t){return Se("__remote__/api/v1/team/allMember",{method:"POST",...t||{}})}async function jC(t,e){return Se("__remote__/api/v1/team/applyList",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function zC(t,e){return Se("__remote__/api/v1/team/checkCompUpdatePermission",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function NC(t,e){return Se("__remote__/api/v1/team/copyComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function UC(t,e){return Se("__remote__/api/v1/team/create",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function VC(t){return Se("__remote__/api/v1/team/created",{method:"POST",...t||{}})}async function BC(t,e){return Se("__remote__/api/v1/team/delete",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function HC(t){return Se("__remote__/api/v1/team/detail",{method:"POST",...t||{}})}async function qC(t){return Se("__remote__/api/v1/team/exit",{method:"POST",...t||{}})}async function WC(t,e){return Se("__remote__/api/v1/team/findByCode",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function KC(t,e){return Se("__remote__/api/v1/team/handleApply",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function YC(t,e){return Se("__remote__/api/v1/team/join",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function GC(t){return Se("__remote__/api/v1/team/joined",{method:"POST",...t||{}})}async function QC(t,e){return Se("__remote__/api/v1/team/kickOut",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function XC(t,e){return Se("__remote__/api/v1/team/member",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function JC(t,e){return Se("__remote__/api/v1/team/myTeamComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function ZC(t,e){return Se("__remote__/api/v1/team/removeComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function eE(t,e){return Se("__remote__/api/v1/team/removeMyTeamComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function tE(t,e){return Se("__remote__/api/v1/team/teamComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function nE(t,e){return Se("__remote__/api/v1/team/update",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function iE(t,e){return Se("__remote__/api/v1/team/updateCompCanUpdateUsers",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function oE(t,e){return Se("__remote__/api/v1/team/updateMenu",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function rE(t,e){return Se("__remote__/api/v1/team/updateTeamUserNickname",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const sE=Object.freeze(Object.defineProperty({__proto__:null,teamcontrollerAddtoteammycomps:DC,teamcontrollerAllmember:LC,teamcontrollerApplylist:jC,teamcontrollerCheckcompupdatepermission:zC,teamcontrollerCopycomp:NC,teamcontrollerCreate:UC,teamcontrollerCreated:VC,teamcontrollerDelete:BC,teamcontrollerDetail:HC,teamcontrollerExit:qC,teamcontrollerFindbycode:WC,teamcontrollerHandleapply:KC,teamcontrollerJoin:YC,teamcontrollerJoined:GC,teamcontrollerKickout:QC,teamcontrollerMember:XC,teamcontrollerMyteamcomps:JC,teamcontrollerRemovecompfromteam:ZC,teamcontrollerRemovemyteamcomp:eE,teamcontrollerTeamcomps:tE,teamcontrollerUpdate:nE,teamcontrollerUpdatecompcanupdateusers:iE,teamcontrollerUpdatemenu:oE,teamcontrollerUpdateteamusernickname:rE},Symbol.toStringTag,{value:"Module"}));async function aE(t){return Se("__remote__/api/v1/token/approachExpire",{method:"POST",...t||{}})}async function lE(t){return Se("__remote__/api/v1/token/refresh",{method:"POST",...t||{}})}const cE=Object.freeze(Object.defineProperty({__proto__:null,tokencontrollerApproachexpire:aE,tokencontrollerRefresh:lE},Symbol.toStringTag,{value:"Module"}));async function uE(t,e){return Se("__remote__/api/v1/upgrade/check",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function dE(t){return Se("__remote__/api/v1/upgrade/logs",{method:"POST",...t||{}})}async function hE(t,e){return Se("__remote__/api/v1/upgrade/publish",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const pE=Object.freeze(Object.defineProperty({__proto__:null,upgradecontrollerCheck:uE,upgradecontrollerLogs:dE,upgradecontrollerPublish:hE},Symbol.toStringTag,{value:"Module"}));async function fE(t,e){return Se("__remote__/api/v1/user/changeAvatar",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function mE(t,e){return Se("__remote__/api/v1/user/changeNickname",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function vE(t,e){return Se("__remote__/api/v1/user/changePassword",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function gE(t){return Se("__remote__/api/v1/user/checkPassword",{method:"POST",...t||{}})}async function _E(t,e){return Se("__remote__/api/v1/user/login",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function yE(t,e){return Se("__remote__/api/v1/user/setAllowEmailLogin",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function bE(t,e){return Se("__remote__/api/v1/user/updateEmail",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function wE(t){return Se("__remote__/api/v1/user/userInfo",{method:"POST",...t||{}})}async function SE(t){return Se("__remote__/api/v1/user/whoAmI",{method:"POST",...t||{}})}const CE=Object.freeze(Object.defineProperty({__proto__:null,usercontrollerChangeavatar:fE,usercontrollerChangenickname:mE,usercontrollerChangepassword:vE,usercontrollerCheckpassword:gE,usercontrollerLogin:_E,usercontrollerSetallowemaillogin:yE,usercontrollerUpdateemail:bE,usercontrollerUserinfo:wE,usercontrollerWhoami:SE},Symbol.toStringTag,{value:"Module"}));async function EE(t,e){return Se("__remote__/api/v2/upgrade/check",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const xE=Object.freeze(Object.defineProperty({__proto__:null,upgradecontrollerv2Check:EE},Symbol.toStringTag,{value:"Module"})),Oi={v1Comp:xC,v1Csrf:$C,v1Email:OC,v1Keyword:PC,v1Oss:FC,v1Team:sE,v1Token:cE,v1Upgrade:pE,v1User:CE,v2Upgrade:xE},TE=vi("personalStore",{state:()=>({userInfo:{},isPasswordSet:!1}),getters:{isAllowEmailLogin(t){return t.userInfo?.isAllowEmailLogin??!1}},actions:{setUserInfo(t){this.$patch(e=>{e.userInfo=t})},setIsPasswordSet(t){this.$patch(e=>{e.isPasswordSet=t})},async initUserInfo(){const t=await Oi.v1User.usercontrollerUserinfo();t.code===0&&this.setUserInfo(t.data)},async setEmail(t){this.$patch(e=>{e.userInfo.email=t})},async setNickname(t){this.$patch(e=>{e.userInfo.nickname=t})},async setAllowEmailLogin(t){await Oi.v1User.usercontrollerSetallowemaillogin({allow:t}).then(()=>{this.$patch(e=>{e.userInfo.isAllowEmailLogin=t})})}}}),$E=vi("moduleStore",{state:()=>({modules:{}}),actions:{setModules(t,e){this.$patch(n=>{n.modules[t]=e})},async loadModule(t){if(this.modules[t])return this.modules[t];const e=await import(t);return this.setModules(t,e),e}}}),yr=Ji(zb,!0),yc=vi("appStore",{state:()=>({}),getters:{collapse(){return yr.value}},actions:{toggleSideBar(){yr.value=!yr.value},setSideBarCollapse(t){t!==this.collapse&&(yr.value=t)}}}),kE=vi("team",{state:()=>({joinedTeams:[],createdTeams:[]}),actions:{setJoinedTeams(t){this.$patch(e=>{e.joinedTeams=t})},setCreatedTeams(t){this.$patch(e=>{e.createdTeams=t})},removeCreatedTeam(t){this.$patch(e=>{e.createdTeams=e.createdTeams.filter(n=>n._id!==t)})},addCreatedTeam(t){this.$patch(e=>{e.createdTeams.some(i=>i._id===t._id)||e.createdTeams.push(t)})},addJoinedTeam(t){this.$patch(e=>{e.joinedTeams.some(i=>i._id===t._id)||e.joinedTeams.push(t)})},removeJoinedTeam(t){this.$patch(e=>{e.joinedTeams=e.joinedTeams.filter(n=>n._id!==t)})},updateCreatedTeamItemById(t,e){this.$patch(n=>{const i=n.createdTeams.findIndex(o=>o._id===t);i!==-1&&(n.createdTeams[i]=e)})},getTeamDetail(t){return this.joinedTeams.find(n=>n._id===t)||this.createdTeams.find(n=>n._id===t)}}});function br(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)i!=="__proto__"&&(t[i]=n[i])}return t}var OE={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function fl(t,e){function n(o,r,s){if(!(typeof document>"u")){s=br({},e,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in s)s[l]&&(a+="; "+l,s[l]!==!0&&(a+="="+s[l].split(";")[0]));return document.cookie=o+"="+t.write(r,o)+a}}function i(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var r=document.cookie?document.cookie.split("; "):[],s={},a=0;a<r.length;a++){var l=r[a].split("="),c=l.slice(1).join("=");try{var u=decodeURIComponent(l[0]);if(u in s||(s[u]=t.read(c,u)),o===u)break}catch{}}return o?s[o]:s}}return Object.create({set:n,get:i,remove:function(o,r){n(o,"",br({},r,{expires:-1}))},withAttributes:function(o){return fl(this.converter,br({},this.attributes,o))},withConverter:function(o){return fl(br({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var pm=fl(OE,{path:"/"});const AE={keyword:"关键词",confirm:"确定",cancel:"取消",close:"关闭",save:"保存",submit:"提交",delete:"删除",edit:"编辑",add:"添加",update:"更新",upload:"上传",download:"下载",refresh:"刷新",loadingText:"加载中",success:"成功",error:"错误",warning:"警告",info:"提示",copy:"复制",copied:"已复制",copySuccess:"复制成功",copyFailed:"复制失败",open:"打开",search:"搜索",reset:"重置",clear:"清空",back:"返回",next:"下一步",prev:"上一步",finish:"完成",operation:"操作",status:"状态",yes:"是",no:"否",name:"名称",description:"描述",version:"版本",time:"时间",date:"日期",author:"作者",type:"类型",category:"分类",tag:"标签",content:"内容",setting:"设置",cache:"缓存",cacheSize:"已使用",clearCache:"清空缓存",clearCacheConfirm:"将清空浏览器单文件编译结果以及模块预编译文件,确认清空缓存吗?",cacheCleared:"缓存已清空",newPage:"新页面打开",terminal:"终端",preview:"预览",doc:"文档",readme:"README.md",upgradeRecord:"更新记录",openInNewPage:"新页面打开",depInstall:"依赖安装",fullscreen:"全屏",exitFullscreen:"退出全屏",maximizeRestore:"最大化/还原",siteSlogan:"原子化组件社区,让组件流通更简单。",siteSubtitle:"Vue 组件共享平台",docsTutorial:"文档教程",empty:"暂无数据",noReadme:"组件没有配置README.md文件",dragSort:"拖拽排序",filter:"筛选",apply:"应用",person:"人",unit:"个",pleaseSelect:"请选择",pleaseInput:"请输入",me:"我",generate:"生成",regenerate:"重新生成",generateSuccess:"生成成功",moreOperations:"更多操作",more:"更多",maxTagCount:"最大标签数量"},PE={keywordPlaceholder:"请输入组件名称/描述",title:"组件",name:"组件名称",fieldId:"组件ID",fieldName:"组件名称",fieldVersion:"版本号",desc:"组件描述",remarksDesc:"备注说明",remarksDescRequired:"请输入备注说明",pleaseInputCompName:"请输入组件名称",pleaseInputRemarks:"请输入备注,有助于组件市场检索",compNameRequired:"组件名称不能为空",compNameNamingRule:"组件名只能是「大驼峰(PascalCase)」或「短横线(kebab-case)」命名法",lengthBetween:"长度在 {min} 到 {max} 个字符",version:"组件版本",detail:"组件详情",preview:"组件预览",previewConfig:"预览配置",previewList:"预览列表",uploadPreview:"组件上传预览",updatePreview:"组件更新预览",download:"下载组件",update:"更新组件",upload:"上传组件",submit:"提交组件",edit:"编辑组件",add:"添加组件",delete:"删除组件",local:"本地组件",remote:"远程组件",online:"在线组件",similar:"相似组件",similarTeam:"团队内相似组件",dir:"组件目录",file:"组件文件",entry:"入口文件",previewEntry:"预览入口地址",previewEntryFull:"预览入口地址(全屏窗口)",addPreviewEntry:"添加预览入口",maxPreviewEntry:"最多添加{n}个预览入口",pleaseAddPreviewEntry:"请添加预览入口",miniPreviewFile:"小窗预览文件",fullPreviewFile:"全屏预览文件",pleaseSelectPreviewFile:"请选择预览文件",remarkDesc:"备注说明",dep:"组件依赖",localDep:"组件依赖(本地)",onlineDep:"组件依赖(线上)",finalDep:"最终依赖",localVersion:"本地:",onlineVersion:"线上:",onlineDepEmpty:"线上依赖暂无数据!",versionConsistent:"版本一致",versionChange:"版本变化,请手动选择最终版本",versionChangeConfirmed:"已确认",newDep:"新增依赖",miniPanel:"小窗面板",fullPanel:"全屏面板",reload:"重新加载",uploadProtocol:"组件发布协议",bgPanel:"背景板",compLocation:"组件位置",pleaseSelectFolderFirst:"请先选择文件夹",compAlreadyUploaded:"组件已经上传,更新操作请前往我的组件或团队组件",affirmDep:"组件依赖(确认的版本)",checkConfig:"配置检查",checkError:"报错信息",extraInfo:"附加信息",baseInfo:"基础信息",upgradeLog:"更新说明",pleaseInputUpgradeLog:"请填写更新说明",config:"组件配置",configStatus:"组件配置检查状态",configError:"配置异常",configCheckError:"配置检查报错",needUpgrade:"需要升级",fileChanged:"组件文件有变化",versionChanged:"版本号变化",fileNoChange:"文件没有变化",markdownValid:"Markdown预览校验通过",noMarkdown:"没有md文件",hash:"文件哈希",localHash:"本地组件文件hash",remoteHash:"线上组件文件hash",remoteVersion:"线上组件版本号",remoteVersionPrefix:"线上:",localVersionPrefix:"本地:",versionCompare:"版本号比较结果",carouselIndex:"组件预览走马灯index",bgColor:"组件背景颜色",dialogType:"组件弹窗类型",repeat:"组件重复检查",existLocal:"组件在本地存在",scopeId:"作用域id",tempDir:"组件临时目录",submitLimit:"组件提交限制",maxSize:"总大小限制",maxCount:"文件数量限制",matchType:"匹配类型",updateType:"更新类型",updateOnline:"在线更新",updateOffline:"离线更新",compOfflineUpdate:"组件离线更新",compOnlineUpdate:"组件在线更新",folder:"文件夹",compNotInLocal:"组件不在本地,继续更新只能更新组件描述,预览配置等基础信息,是否继续?",selectUpdateFolder:"请选择要更新的文件夹",openInVscode:"在 VS Code 中打开",openingInEditor:"在编辑器中打开...",updateSuccess:"更新成功",downloadVersionConfirm:"当前选择的版本为:{version},确认下载吗?",downloading:"组件下载中...",downloadPathConfirm:"是否下载组件到【{path}】路径下",downloadCoverConfirm:"组件【{name}】已经下载或者有同名组件,是否覆盖?",uncollectConfirm:"是否取消收藏组件【{name}】,取消收藏后组件将不再显示在收藏列表中,是否继续?",deleteConfirm:"是否删除组件【{name}】,删除组件后会释放占用的组件名称,是否继续?",collect:"收藏",uncollect:"取消收藏",collected:"已收藏",uncollected:"未收藏",entryFile:"入口文件",configFile:"配置文件",fileChangedNeedVersion:"文件内容改变,请增加版本号",viewFileChanges:"查看文件变化",versionChangedButFileSame:"版本号改变,但文件内容未改变,请还原版本号",errorMsg:"错误信息",versionCannotBeLessThanLatest:"版本号不能小于最新版本{version}",uploadAnyway:"仍然上传",compileError:"组件编译失败",compileWarn:"组件编译警告",formatCode:"格式化代码:",formatCodeTooltip:"仅格式化对比时的文件,不会格式化原始文件",noChanges:"暂无变更",diff:{changed:"M 改变",unchanged:"U 未改变",added:"A 新增",deleted:"D 删除"}},RE={title:"团队",name:"团队名称",code:"团队码",desc:"团队描述",create:"创建团队",join:"加入团队",exit:"退出团队",exitConfirm:"退出确认",manage:"团队管理",setting:"团队设置",member:"团队成员",memberCount:"成员数",maxMember:"最大成员数",compCount:"组件数量",maxCompCount:"最大组件数量",creator:"创建者",downloadCount:"下载量",collectCount:"收藏量",createTime:"创建时间",myTeam:"我的团队",joinedTeam:"已加入团队",space:"团队空间",noJoined:"暂无加入的团队",noCreated:"暂无创建的团队",createCountLimit:"最大允许创建的团队数量",joinCountLimit:"允许最多加入的团队数量",compList:"团队组件列表",myCompList:"我的组件",compGroup:"团队组件分组",compGroupList:"团队组件分组列表",addMyComp:"团队添加我的组件",compUpdate:"团队我的组件更新",addFromMine:"去我的组件添加",applyList:"申请列表",nickname:"团队昵称",noTeamInfo:"暂无团队信息",compLib:"组件库",groupConfig:"分组配置",compManage:"组件管理",unsavedDataLeave:"分组配置数据未保存,确定要离开吗?",leave:"离开",disbandTeam:"解散团队",applyAudit:"申请审核",teamName:"团队名称",fillTeamCode:"填写团队码",pleaseInputTeamCode:"请输入团队码",teamIdNotExist:"团队ID不存在",joinSuccess:"加入团队成功",applyJoinTeam:"申请加入团队",showRepeatComp:"展示重复组件",allowAuthorDelete:"作者删除组件权限",teamIntro:"团队介绍",fillTeamName:"填写团队名称",pleaseInputTeamName:"请输入团队名称",pleaseInputTeamDesc:"请输入团队介绍",createSuccess:"创建团队成功",charLength:"长度在 {min} 到 {max} 个字符",disbandConfirm:"确定解散团队吗,解散后所有成员和组件将被移除,并且无法恢复?",deleteConfirm:"删除确认",inputAuthCode:"请输入验证码",disbandSuccess:"解散团队成功",reject:"拒绝",agree:"同意",approved:"已同意",rejected:"已拒绝",kickOut:"踢出",teamUserNickname:"团队内昵称",pleaseInputTeamNickname:"请输入你在团队的昵称",normalUser:"普通用户",kickOutConfirm:"确定踢出用户【{name}】吗?",kickOutSuccess:"踢出成功",selectCanUpdateUser:"选择可更新用户",authorAutoAuth:"作者自带授权",updateAuth:"更新授权",updateTime:"更新时间",expandAll:"展开全部",createGroup:"创建分组",unsaved:"未保存",pleaseInputGroupName:"请输入分组名称",addComp:"添加组件",added:"已添加",notAdded:"未添加",defaultGroup:"默认分组",deleteGroupConfirm:"确认删除该分组吗?删除后该分组下的所有组件将被移除分组",addSuccess:"添加成功",isGrouped:"是否分组",grouped:"已分组",ungrouped:"未分组",group:"分组",prevVersion:"升级前版本",newVersion:"升级后版本",upgradeDesc:"升级描述",similarCompInTeam:"团队内相似组件",similarComp:"相似组件",deleteCompConfirm:"是否删除团队组件【{name}】,删除组件后团队成员将无法使用该组件,是否继续?",descTitle:"为业务团队打造专属组件空间",descItem1:"创建私密团队,组件仅对成员可见,保护核心资产",descItem2:"每个账号最多可创建 {count} 个团队",descItem3:"每个账号最多可加入 {count} 个团队",descItem4:"基础版团队支持最多 {count} 名成员",descItem5:"基础版团队可管理最多 {count} 个组件",descItem6:"支持创建分组菜单,灵活组织团队组件"},IE={title:"用户",username:"用户名",account:"账号",password:"密码",newPassword:"新密码",confirmPassword:"确认密码",confirmNewPassword:"确认新密码",pleaseInputNewPassword:"请输入新密码",pleaseConfirmNewPassword:"请确认新密码",passwordModified:"密码修改成功",email:"邮箱",oldEmail:"旧邮箱",newEmail:"新邮箱",phone:"手机号",avatar:"头像",nickname:"昵称",login:"登录",logout:"退出登录",register:"注册",forgotPassword:"忘记密码",resetPassword:"重置密码",changePassword:"修改密码",changeNickname:"修改昵称",pleaseInputNickname:"请输入昵称",changeAvatar:"修改头像",avatarModified:"头像修改成功",changeEmail:"修改邮箱",basicInfo:"基本信息",securitySettings:"安全设置",loginPassword:"登录密码",passwordTip:"建议定期更换密码,确保账号安全",setPassword:"设置密码",emailLogin:"邮箱登录",emailLoginTip:"允许使用邮箱作为登录账号",pleaseSetPasswordFirst:"请先设置登录密码",emailLoginEnabled:"邮箱登录已开启",emailLoginDisabled:"邮箱登录已关闭",registerTime:"注册时间",notBound:"未绑定",change:"更换",bind:"绑定",authCode:"验证码",oldAuthCode:"旧验证码",newAuthCode:"新验证码",sendAuthCode:"发送验证码",resendAuthCode:"重新发送",getAuthCode:"获取验证码",pleaseInputAuthCode:"请输入验证码",pleaseInputNewAuthCode:"请输入新验证码",resendAfterSeconds:"{n}秒后重新获取",accountLogin:"账号登录",pleaseInputAccount:"请输入账号",pleaseInputUsername:"请输入用户名",pleaseInputPassword:"请输入密码",pleaseInputEmail:"请输入邮箱",pleaseInputOldEmail:"请输入旧邮箱",pleaseInputNewEmail:"请输入新邮箱",pleaseInputCorrectEmail:"请输入正确的邮箱",emailModified:"邮箱修改成功",newAuthCodeSent:"新验证码已发送",authCodeSent:"验证码已发送",guestLogin:"游客访问",loginSuccess:"登录成功",userInfo:"用户信息",personalCenter:"个人中心",myComp:"我的组件",guest:"游客",notLoggedIn:"未登录",goLogin:"去登录"},ME={title:"文件",name:"文件名",path:"文件路径",size:"文件大小",type:"文件类型",dir:"文件夹",selectDir:"选择文件夹",upload:"文件上传",download:"文件下载",select:"选择",multiSelect:"不支持多选",onlyDir:"只能选择文件夹",rootDir:"根目录",projectPath:"项目路径",currentDir:"当前目录",parentDir:"上级目录",refreshDir:"刷新文件夹列表"},FE={success:{download:"下载成功",update:"更新成功",delete:"删除成功",collect:"收藏成功",uncollect:"取消收藏成功",save:"保存成功",submit:"提交成功",upload:"上传成功",copy:"复制成功",operation:"操作成功",sendAuthCode:"验证码已发送",exitTeam:"退出成功"},error:{download:"下载失败",update:"更新失败",delete:"删除失败",collect:"收藏失败",uncollect:"取消收藏失败",save:"保存失败",submit:"提交失败",upload:"上传失败",copy:"复制失败",operation:"操作失败",load:"加载失败",network:"网络错误",timeout:"请求超时",unknown:"未知错误",pleaseFixCompileError:"请先处理编译错误",loginExpired:"登录已过期,请重新登录",refreshFailed:"刷新失败",requestFailed:"请求失败,请联系管理员",storageNotSupported:"浏览器不支持 storage.estimate API"},noUpdatePermission:"当前组件您没有更新权限,请联系管理员获取权限",confirm:{delete:"确定删除吗?",submit:"确定提交吗?",update:"确定更新吗?",exit:"确定退出吗?",cancel:"确定取消吗?"},loginRequired:"请先登录",fileExceed:"最多只能选择 {limit} 个文件,本次已选择 {selected} 个,共将上传 {total} 个文件",validate:{required:"必填项",format:"格式不正确",min:"不能小于最小值",max:"不能超过最大值",length:"长度不正确",email:"邮箱格式不正确",phone:"手机号格式不正确",imageFormat:"上传文件只能是图片格式",pleaseSelectFile:"请先选择文件",fileMaxSize:"上传文件大小不能超过 {size}MB!"}},DE={404:"页面不存在",share:"组件市场",collect:"收藏组件",collectSimple:"收藏",mine:"我的组件",mineSimple:"我的",local:"本地组件",localSimple:"本地",team:"团队",upload:"上传组件",uploadSimple:"上传",uploadTeam:"上传团队组件",setting:"设置",userInfo:"用户信息",upgrade:"更新",terminal:"终端",preview:"组件预览",previewLocal:"本地组件预览",previewTeam:"团队组件预览",previewBlank:"预览",similarPreview:"相似组件预览",login:"登录",mdPreview:"文档预览",unknownTag:"未知标签"},LE={parse:"解析 Markdown",loading:"加载 Markdown",error:"加载失败",toc:"目录",anchor:"锚点"},jE={title:"终端",open:"打开终端",close:"关闭终端",execute:"执行命令",shutdown:"关闭进程",timeout:"超时时间",disconnected:"终端已断开连接"},zE={title:"依赖",name:"依赖名称",version:"依赖版本",install:"安装依赖",installing:"安装中",installed:"已安装",prebuild:"预构建",prebuildSize:"预构建大小",clearPrebuild:"清空预构建",batchSetting:"批量设置",dependencies:"dependencies",devDependencies:"devDependencies",match:{onlyInstall:"仅安装",majorVersion:"主版本",minorVersion:"主次版本",exactVersion:"完全一致"}},NE={title:"设置",previewRule:"预览规则",other:"其他设置",theme:"主题",language:"语言",darkMode:"暗黑模式",lightMode:"明亮模式"},UE={title:"版本更新",current:"当前版本",latest:"最新版本",check:"检查更新",upgrading:"更新中",upgraded:"已更新",publish:"发布更新",record:"更新记录",log:"更新日志",hasUpdate:"有更新",betaVersion:"内测版",noUpdate:"暂无更新",updateMethod:"更新方式",openTerminalAndRun:"打开终端,执行以下命令:",cannotIgnoreUpdate:"不可忽略此次更新"},VE={systemRecommended:"系统推荐",all:"全部",latest:"最新",hottest:"最热"},BE={submit:"提交"},HE={empty:"不能为空",notString:"必须是字符串类型,当前类型为: {type}",contentEmpty:"内容不能为空",startsWithNumber:'内容不能以数字开头,当前以 "{char}" 开头',invalidCharBacktick:"内容包含反引号(Markdown 语法标记),特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharNewline:"内容包含换行符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharCarriageReturn:"内容包含回车符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharTab:"内容包含制表符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharFormFeed:"内容包含换页符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharVerticalTab:"内容包含垂直制表符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharHash:"内容包含 # 字符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharHtmlSpecial:'内容包含 HTML 特殊字符 "{char}",特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格',invalidCharUnknown:'内容包含非法字符 "{char}"(Unicode: U+{code}),特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格'},qE={openInEditor:"在编辑器中打开",current:"当前",noRegistered:"暂无已注册项目",deregisterTitle:"注销项目",deregisterConfirm:"确定要注销项目 {hash} ({cwd}) 吗?",deregisterSuccess:"已注销项目 {hash}",deregisterFailed:"注销失败"},WE={common:AE,comp:PE,team:RE,user:IE,file:ME,message:FE,route:DE,markdown:LE,terminal:jE,deps:zE,setting:NE,upgrade:UE,tag:VE,formCreate:BE,validateHash:HE,project:qE},KE={keyword:"Keyword",confirm:"Confirm",cancel:"Cancel",close:"Close",save:"Save",submit:"Submit",delete:"Delete",edit:"Edit",add:"Add",update:"Update",upload:"Upload",download:"Download",refresh:"Refresh",loadingText:"Loading",success:"Success",error:"Error",warning:"Warning",info:"Info",copy:"Copy",copied:"Copied",copySuccess:"Copy successful",copyFailed:"Copy failed",open:"Open",search:"Search",reset:"Reset",clear:"Clear",back:"Back",next:"Next",prev:"Previous",finish:"Finish",operation:"Operation",status:"Status",yes:"Yes",no:"No",name:"Name",description:"Description",version:"Version",time:"Time",date:"Date",author:"Author",type:"Type",category:"Category",tag:"Tag",content:"Content",setting:"Setting",cache:"Cache",cacheSize:"Used",clearCache:"Clear Cache",clearCacheConfirm:"This will clear browser single-file compilation results and module pre-compilation files. Confirm to clear cache?",cacheCleared:"Cache cleared",newPage:"Open in new page",terminal:"Terminal",preview:"Preview",doc:"Documentation",readme:"README.md",upgradeRecord:"Update Record",openInNewPage:"Open in new page",depInstall:"Dependency Installation",fullscreen:"Fullscreen",exitFullscreen:"Exit Fullscreen",maximizeRestore:"Maximize/Restore",siteSlogan:"Atomic Component Community, Making Component Sharing Easier.",siteSubtitle:"Vue Component Sharing Platform",docsTutorial:"Documentation",empty:"No data",noReadme:"Component has no README.md file configured",dragSort:"Drag to sort",filter:"Filter",apply:"Apply",person:"people",unit:"items",pleaseSelect:"Please select",pleaseInput:"Please input",me:"Me",generate:"Generate",regenerate:"Regenerate",generateSuccess:"Generated successfully",moreOperations:"More Operations",more:"More",maxTagCount:"Max Tag Count"},YE={keywordPlaceholder:"Please input component name or description",title:"Component",name:"Component Name",fieldId:"Component ID",fieldName:"Component Name",fieldVersion:"Version",desc:"Component Description",remarksDesc:"Remarks",remarksDescRequired:"Please enter remarks",pleaseInputCompName:"Please enter component name",pleaseInputRemarks:"Please enter remarks to help with component market search",compNameRequired:"Component name is required",compNameNamingRule:"Component name must be in PascalCase or kebab-case",lengthBetween:"Length must be between {min} and {max} characters",version:"Component Version",detail:"Component Detail",preview:"Component Preview",previewConfig:"Preview Config",previewList:"Preview List",uploadPreview:"Component Upload Preview",updatePreview:"Component Update Preview",download:"Download Component",update:"Update Component",upload:"Upload Component",submit:"Submit Component",edit:"Edit Component",add:"Add Component",delete:"Delete Component",local:"Local Component",remote:"Remote Component",online:"Online Component",similar:"Similar Components",similarTeam:"Similar Components in Team",dir:"Component Directory",file:"Component File",entry:"Entry File",previewEntry:"Preview Entry Address",previewEntryFull:"Preview Entry Address (Fullscreen)",addPreviewEntry:"Add Preview Entry",maxPreviewEntry:"Maximum {n} preview entries allowed",pleaseAddPreviewEntry:"Please add a preview entry",miniPreviewFile:"Mini Preview File",fullPreviewFile:"Full Preview File",pleaseSelectPreviewFile:"Please select preview file",remarkDesc:"Remarks",dep:"Component Dependencies",localDep:"Component Dependencies (Local)",onlineDep:"Component Dependencies (Online)",finalDep:"Final Dependencies",localVersion:"Local: ",onlineVersion:"Online: ",onlineDepEmpty:"No online dependency data!",versionConsistent:"Version Consistent",versionChange:"Version changed, please select final version",versionChangeConfirmed:"Confirmed",newDep:"New Dependency",miniPanel:"Mini Panel",fullPanel:"Full Panel",reload:"Reload",uploadProtocol:"Upload Protocol",bgPanel:"Background",compLocation:"Component Location",pleaseSelectFolderFirst:"Please select a folder first",compAlreadyUploaded:"Component already uploaded, please go to My Components or Team Components to update",affirmDep:"Component Dependencies (Confirmed Version)",checkConfig:"Config Check",checkError:"Error Info",extraInfo:"Extra Info",baseInfo:"Basic Info",upgradeLog:"Upgrade Log",pleaseInputUpgradeLog:"Please enter upgrade description",config:"Component Config",configStatus:"Component Config Check Status",configError:"Config Error",configCheckError:"Config Check Error",needUpgrade:"Needs Upgrade",fileChanged:"Component files changed",versionChanged:"Version changed",fileNoChange:"Files unchanged",markdownValid:"Markdown preview validation passed",noMarkdown:"No markdown file",hash:"File Hash",localHash:"Local Component File Hash",remoteHash:"Remote Component File Hash",remoteVersion:"Remote Component Version",remoteVersionPrefix:"Online: ",localVersionPrefix:"Local: ",versionCompare:"Version Comparison Result",carouselIndex:"Component Preview Carousel Index",bgColor:"Component Background Color",dialogType:"Component Dialog Type",repeat:"Component Repeat Check",existLocal:"Component exists locally",scopeId:"Scope ID",tempDir:"Component Temp Directory",submitLimit:"Component Submit Limit",maxSize:"Total Size Limit",maxCount:"File Count Limit",matchType:"Match Type",updateType:"Update Type",updateOnline:"Online Update",updateOffline:"Offline Update",compOfflineUpdate:"Component Offline Update",compOnlineUpdate:"Component Online Update",folder:"Folder",compNotInLocal:"Component is not local. Continuing will only update basic information like description and preview config. Continue?",selectUpdateFolder:"Please select folder to update",openInVscode:"Open in VS Code",openingInEditor:"Opening in editor...",updateSuccess:"Update successful",downloadVersionConfirm:"The currently selected version is: {version}, confirm download?",downloading:"Downloading component...",downloadPathConfirm:"Download component to path [{path}]?",downloadCoverConfirm:"Component [{name}] already exists or has a duplicate name, overwrite?",uncollectConfirm:"Are you sure you want to uncollect component [{name}]? It will no longer appear in your collection list.",deleteConfirm:"Are you sure you want to delete component [{name}]? This will free up the component name and cannot be undone.",collect:"Collect",uncollect:"Uncollect",collected:"Collected",uncollected:"Not Collected",entryFile:"Entry File",configFile:"Config File",fileChangedNeedVersion:"File content changed, please increment version",viewFileChanges:"View File Changes",versionChangedButFileSame:"Version changed but file content unchanged, please revert version",errorMsg:"Error Message",versionCannotBeLessThanLatest:"Version cannot be less than latest version {version}",uploadAnyway:"Upload Anyway",compileError:"Component compilation failed",compileWarn:"Component compilation warning",formatCode:"Format Code:",formatCodeTooltip:"Only formats files during comparison, original files remain unchanged",noChanges:"No changes",diff:{changed:"M Changed",unchanged:"U Unchanged",added:"A Added",deleted:"D Deleted"}},GE={title:"Team",name:"Team Name",code:"Team Code",desc:"Team Description",create:"Create Team",join:"Join Team",exit:"Exit Team",exitConfirm:"Exit Confirmation",manage:"Team Management",setting:"Team Settings",member:"Team Members",memberCount:"Member Count",maxMember:"Max Members",compCount:"Component Count",maxCompCount:"Max Components",creator:"Creator",downloadCount:"Downloads",collectCount:"Collections",createTime:"Create Time",myTeam:"My Teams",joinedTeam:"Joined Teams",space:"Team Space",noJoined:"No joined teams",noCreated:"No created teams",createCountLimit:"Max teams allowed to create",joinCountLimit:"Max teams allowed to join",compList:"Team Component List",myCompList:"My Component List",compGroup:"Team Component Group",compGroupList:"Team Component Group List",addMyComp:"Team Add My Component",compUpdate:"Team My Component Update",addFromMine:"Add from My Components",applyList:"Apply List",nickname:"Team Nickname",noTeamInfo:"No team information",compLib:"Component Library",groupConfig:"Group Config",compManage:"Component Management",unsavedDataLeave:"Group configuration data is not saved, are you sure you want to leave?",leave:"Leave",disbandTeam:"Disband Team",applyAudit:"Apply Audit",teamName:"Team Name",fillTeamCode:"Fill in Team Code",pleaseInputTeamCode:"Please enter team code",teamIdNotExist:"Team ID does not exist",joinSuccess:"Joined team successfully",applyJoinTeam:"Apply to Join Team",showRepeatComp:"Show Duplicate Components",allowAuthorDelete:"Allow Author Delete",teamIntro:"Team Introduction",fillTeamName:"Fill in Team Name",pleaseInputTeamName:"Please enter team name",pleaseInputTeamDesc:"Please enter team description",createSuccess:"Team created successfully",charLength:"Length must be between {min} and {max} characters",disbandConfirm:"Are you sure you want to disband the team? All members and components will be removed and cannot be recovered.",deleteConfirm:"Delete Confirmation",inputAuthCode:"Please enter verification code",disbandSuccess:"Team disbanded successfully",reject:"Reject",agree:"Agree",approved:"Approved",rejected:"Rejected",kickOut:"Kick Out",teamUserNickname:"Team Nickname",pleaseInputTeamNickname:"Please enter your team nickname",normalUser:"Normal User",kickOutConfirm:"Are you sure you want to kick out user [{name}]?",kickOutSuccess:"Kicked out successfully",selectCanUpdateUser:"Select users who can update",authorAutoAuth:"Author has default authorization",updateAuth:"Update Authorization",updateTime:"Update Time",expandAll:"Expand All",createGroup:"Create Group",unsaved:"Unsaved",pleaseInputGroupName:"Please enter group name",addComp:"Add Component",added:"Added",notAdded:"Not Added",defaultGroup:"Default Group",deleteGroupConfirm:"Are you sure you want to delete this group? All components in this group will be removed from the group.",addSuccess:"Added successfully",isGrouped:"Is Grouped",grouped:"Grouped",ungrouped:"Ungrouped",group:"Group",prevVersion:"Previous Version",newVersion:"New Version",upgradeDesc:"Upgrade Description",similarCompInTeam:"Similar Components in Team",similarComp:"Similar Components",deleteCompConfirm:"Are you sure you want to delete team component [{name}]? Team members will no longer be able to use this component.",descTitle:"Create an Exclusive Component Space for Your Team",descItem1:"Create a private team where components are only visible to members, protecting core assets",descItem2:"Each account can create up to {count} teams",descItem3:"Each account can join up to {count} teams",descItem4:"Basic team supports up to {count} members",descItem5:"Basic team can manage up to {count} components",descItem6:"Support creating group menus to organize team components flexibly"},QE={title:"User",username:"Username",account:"Account",password:"Password",newPassword:"New Password",confirmPassword:"Confirm Password",confirmNewPassword:"Confirm New Password",pleaseInputNewPassword:"Please enter new password",pleaseConfirmNewPassword:"Please confirm new password",passwordModified:"Password modified successfully",email:"Email",oldEmail:"Old Email",newEmail:"New Email",phone:"Phone",avatar:"Avatar",nickname:"Nickname",login:"Login",logout:"Logout",register:"Register",forgotPassword:"Forgot Password",resetPassword:"Reset Password",changePassword:"Change Password",changeNickname:"Change Nickname",pleaseInputNickname:"Please enter nickname",changeAvatar:"Change Avatar",avatarModified:"Avatar updated successfully",changeEmail:"Change Email",basicInfo:"Basic Information",securitySettings:"Security Settings",loginPassword:"Login Password",passwordTip:"Regularly change your password to ensure account security",setPassword:"Set Password",emailLogin:"Email Login",emailLoginTip:"Allow using email as login account",pleaseSetPasswordFirst:"Please set login password first",emailLoginEnabled:"Email login enabled",emailLoginDisabled:"Email login disabled",registerTime:"Registration Time",notBound:"Not Bound",change:"Change",bind:"Bind",authCode:"Verification Code",oldAuthCode:"Old Verification Code",newAuthCode:"New Verification Code",sendAuthCode:"Send Auth Code",resendAuthCode:"Resend",getAuthCode:"Get Code",pleaseInputAuthCode:"Please enter code",pleaseInputNewAuthCode:"Please enter new code",resendAfterSeconds:"Resend in {n}s",accountLogin:"Account Login",pleaseInputAccount:"Please enter account",pleaseInputUsername:"Please enter username",pleaseInputPassword:"Please enter password",pleaseInputEmail:"Please enter email",pleaseInputOldEmail:"Please enter old email",pleaseInputNewEmail:"Please enter new email",pleaseInputCorrectEmail:"Please enter correct email",emailModified:"Email modified successfully",newAuthCodeSent:"New verification code sent",authCodeSent:"Verification code sent",guestLogin:"Guest Access",loginSuccess:"Login successful",userInfo:"User Info",personalCenter:"Personal Center",myComp:"My Components",guest:"Guest",notLoggedIn:"Not logged in",goLogin:"Go to Login"},XE={title:"File",name:"Filename",path:"File Path",size:"File Size",type:"File Type",dir:"Directory",selectDir:"Select Directory",upload:"File Upload",download:"File Download",select:"Select",multiSelect:"Multiple selection not supported",onlyDir:"Only directories can be selected",rootDir:"Root Directory",projectPath:"Project Path",currentDir:"Current Directory",parentDir:"Parent Directory",refreshDir:"Refresh Directory List"},JE={success:{download:"Download successful",update:"Update successful",delete:"Delete successful",collect:"Collect successful",uncollect:"Uncollect successful",save:"Save successful",submit:"Submit successful",upload:"Upload successful",copy:"Copy successful",operation:"Operation successful",sendAuthCode:"Verification code sent",exitTeam:"Exit successful"},error:{download:"Download failed",update:"Update failed",delete:"Delete failed",collect:"Collect failed",uncollect:"Uncollect failed",save:"Save failed",submit:"Submit failed",upload:"Upload failed",copy:"Copy failed",operation:"Operation failed",load:"Load failed",network:"Network error",timeout:"Request timeout",unknown:"Unknown error",pleaseFixCompileError:"Please fix compilation errors first",loginExpired:"Login expired, please log in again",refreshFailed:"Refresh failed",requestFailed:"Request failed, please contact administrator",storageNotSupported:"Browser does not support storage.estimate API"},noUpdatePermission:"You do not have permission to update this component. Please contact the administrator for access.",confirm:{delete:"Are you sure to delete?",submit:"Are you sure to submit?",update:"Are you sure to update?",exit:"Are you sure to exit?",cancel:"Are you sure to cancel?"},loginRequired:"Please login first",fileExceed:"You can select at most {limit} files, {selected} selected this time, {total} total to be uploaded",validate:{required:"Required field",format:"Invalid format",min:"Cannot be less than minimum value",max:"Cannot exceed maximum value",length:"Invalid length",email:"Invalid email format",phone:"Invalid phone format",imageFormat:"Only image files are allowed",pleaseSelectFile:"Please select a file first",fileMaxSize:"File size cannot exceed {size}MB!"}},ZE={404:"Page Not Found",share:"Component Market",collect:"Collected Components",collectSimple:"Collection",mine:"My Components",mineSimple:"Mine",local:"Local Components",localSimple:"Local",team:"Team",upload:"Upload Component",uploadSimple:"Upload",uploadTeam:"Upload Team Component",setting:"Settings",userInfo:"User Info",upgrade:"Upgrade",terminal:"Terminal",preview:"Component Preview",previewLocal:"Local Component Preview",previewTeam:"Team Component Preview",previewBlank:"Preview",similarPreview:"Similar Component Preview",login:"Login",mdPreview:"Document Preview",unknownTag:"Unknown Tag"},e2={parse:"Parse Markdown",loading:"Loading Markdown",error:"Load failed",toc:"Table of Contents",anchor:"Anchor"},t2={title:"Terminal",open:"Open Terminal",close:"Close Terminal",execute:"Execute Command",shutdown:"Shutdown Process",timeout:"Timeout",disconnected:"Terminal disconnected"},n2={title:"Dependencies",name:"Dependency Name",version:"Dependency Version",install:"Install Dependencies",installing:"Installing",installed:"Installed",prebuild:"Prebuild",prebuildSize:"Prebuild Size",clearPrebuild:"Clear Prebuild",batchSetting:"Batch Setting",dependencies:"dependencies",devDependencies:"devDependencies",match:{onlyInstall:"Install Only",majorVersion:"Major Version",minorVersion:"Major + Minor",exactVersion:"Exact Match"}},i2={title:"Settings",previewRule:"Preview Rule",other:"Other Settings",theme:"Theme",language:"Language",darkMode:"Dark Mode",lightMode:"Light Mode"},o2={title:"Version Update",current:"Current Version",latest:"Latest Version",check:"Check for Updates",upgrading:"Updating",upgraded:"Updated",publish:"Publish Update",record:"Update Record",log:"Changelog",hasUpdate:"Update Available",betaVersion:"Beta",noUpdate:"No updates available",updateMethod:"Update Method",openTerminalAndRun:"Open terminal and run:",cannotIgnoreUpdate:"This update cannot be ignored"},r2={systemRecommended:"System Recommended",all:"All",latest:"Latest",hottest:"Hottest"},s2={submit:"Submit"},a2={empty:"Cannot be empty",notString:"Must be a string type, current type: {type}",contentEmpty:"Content cannot be empty",startsWithNumber:'Content cannot start with a number, currently starts with "{char}"',invalidCharBacktick:"Content contains backtick (Markdown syntax marker), only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharNewline:"Content contains newline character, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharCarriageReturn:"Content contains carriage return, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharTab:"Content contains tab character, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharFormFeed:"Content contains form feed character, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharVerticalTab:"Content contains vertical tab character, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharHash:"Content contains # character, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharHtmlSpecial:'Content contains HTML special character "{char}", only hyphen(-), underscore(_), parentheses(), and spaces are allowed',invalidCharUnknown:'Content contains invalid character "{char}" (Unicode: U+{code}), only hyphen(-), underscore(_), parentheses(), and spaces are allowed'},l2={openInEditor:"Open in Editor",current:"Current",noRegistered:"No registered projects",deregisterTitle:"Deregister Project",deregisterConfirm:"Are you sure you want to deregister project {hash} ({cwd})?",deregisterSuccess:"Deregistered project {hash}",deregisterFailed:"Deregister failed"},c2={common:KE,comp:YE,team:GE,user:QE,file:XE,message:JE,route:ZE,markdown:e2,terminal:t2,deps:n2,setting:i2,upgrade:o2,tag:r2,formCreate:s2,validateHash:a2,project:l2},u2={zh:WE,en:c2},d2=localStorage.getItem(Tb.LOCALE_KEY)||"zh",fm=m_({locale:d2,messages:u2,legacy:!1});function mm(t){t.use(fm)}const bc=Object.freeze(Object.defineProperty({__proto__:null,i18n:fm,setup:mm},Symbol.toStringTag,{value:"Module"}));function h2({store:t}){t.$subscribe((...e)=>{const[n]=e;if(n.type==="direct")throw new Error("不允许直接修改store,建议使用action修改")})}const ml=v_();function vm(t){ml.use(h2),t.use(ml)}const p2=Object.freeze(Object.defineProperty({__proto__:null,pinia:ml,setup:vm},Symbol.toStringTag,{value:"Module"}));function f2(t){t.component("Icon",Y0)}const{i18n:wo}=bc,{pinia:ca}=p2,Qi=vi("userStore",{state:()=>({userInfo:{},guestUserInfo:{avatar:"",nickname:wo.global.t("user.guest"),account:""},logoutDialogOpen:!1}),getters:{userId:t=>t.userInfo._id,displayName(t){return ta()===vt.IS_GUEST_LOGIN?t.guestUserInfo.nickname:t.userInfo.nickname||t.userInfo.account||wo.global.t("user.notLoggedIn")},avatar:t=>t.userInfo.avatar,avatarStr(t){return ta()===vt.IS_GUEST_LOGIN?t.guestUserInfo.nickname[0]:t.userInfo.nickname?.[0]||t.userInfo.account?.[0]||""}},actions:{async fetchCsrfToken(){pm.get(vt.CSRF_KEY)||await Oi.v1Csrf.csrfcontrollerGetcsrftoken()},updateAvatar(t){this.$patch(e=>{e.userInfo&&(e.userInfo.avatar=t)})},updateNickname(t){this.$patch(e=>{e.userInfo&&(e.userInfo.nickname=t)})},setLogoutDialogOpen(t){this.$patch(e=>{e.logoutDialogOpen=t})},setUserInfo(t){this.$patch(e=>{e.userInfo=t})},login(t){return Oi.v1User.usercontrollerLogin({...t})},async fetchWhoAmI(){const t=await Oi.v1User.usercontrollerWhoami();t.data&&this.setUserInfo(t.data)},logout(){no.push("/login?type=logout").then(t=>{t||(this.clearLocalStorage(),this.resetAll(),this.$reset())})},resetAll(){const t=Xo(),e=TE(),n=$E(),i=yc(),o=kE();t?.$reset(),e?.$reset(),n?.$reset(),i?.$reset(),o?.$reset(),this.clearTeamHomeStores(),this.clearCompListStores(),this.clearCompEditStore()},clearLocalStorage(){Mb(),Lb(),jb()},clearTeamHomeStores(){for(const[t,e]of ca._s.entries())t.startsWith("teamHome")&&e.$reset()},clearCompListStores(){for(const[t,e]of ca._s.entries())t.startsWith("compList")&&e.$reset()},clearCompEditStore(){for(const[t,e]of ca._s.entries())t.startsWith("compEdit")&&e.$reset()},isRealUserLogin(){const t=Object.keys(this.userInfo),e=is();return t.length>0&&e!==null},isAccessTokenExist(){return is()!==null},isGuestLogin(){return ta()===vt.IS_GUEST_LOGIN},isLogin(){const t=this.isRealUserLogin(),e=this.isGuestLogin();return t||e},logoutDialog(){if(this.logoutDialogOpen)return;this.setLogoutDialogOpen(!0);const t={confirmButtonText:wo.global.t("user.goLogin"),showClose:!0,callback:e=>{this.setLogoutDialogOpen(!1),e==="confirm"&&this.logout()}};Y_.alert(wo.global.t("message.loginRequired"),wo.global.t("common.info"),t)}}}),m2=Ce({__name:"SubMenu",props:{route:{},basePath:{}},setup(t){const{getTitle:e}=fc(),n=t,i=Qi(),o=(c,u="")=>Vw.resolve(c,u),r=te(()=>o(n.basePath||"",n.route.path)),s=te(()=>(n.route.children||[]).some(c=>!c.meta?.hidden)),a=te(()=>{const{children:c=[]}=n.route;return c.length===0||c.length===1&&!c[0]?.children?.length}),l=te(()=>{const{children:c=[],meta:u={}}=n.route;return u?.hidden?!1:i.isRealUserLogin()||c.length>0?!0:(i.isGuestLogin()||!i.isAccessTokenExist())&&n.route.meta?.noAuth});return(c,u)=>{const d=Ue("SubMenu",!0),h=Po,m=G_;return l.value?(y(),T(Ie,{key:0},[t.route.meta?.hideParent&&s.value?(y(!0),T(Ie,{key:0},He(t.route.children,f=>(y(),ne(d,{key:o(r.value,f.path),route:f,"base-path":o(r.value,f.path)},null,8,["route","base-path"]))),128)):(y(),T(Ie,{key:1},[a.value?(y(),ne(Hw,{key:0,route:t.route,"full-path":r.value},null,8,["route","full-path"])):(y(),ne(m,{key:1,index:r.value},{title:we(()=>[j(h,null,{default:we(()=>[(y(),ne($t(t.route?.meta?.icon)))]),_:1}),g("span",null,L(v(e)(t.route?.meta?.title)),1)]),default:we(()=>[(y(!0),T(Ie,null,He(t.route.children,f=>(y(),ne(d,{key:o(r.value,f.path),route:f,"base-path":o(r.value,f.path)},null,8,["route","base-path"]))),128))]),_:1},8,["index"]))],64))],64)):ue("",!0)}}}),v2=Ce({__name:"index",setup(t){const e=yc(),n=_s(),i=nc(),o=te(()=>n.options.routes),r=te(()=>i.path);return(s,a)=>{const l=Q_;return y(),ne(l,{class:"dark:!bg-gray-800 border-t border-gray-200 dark:border-gray-700",collapse:v(e).collapse,"default-active":r.value},{default:we(()=>[(y(!0),T(Ie,null,He(o.value,c=>(y(),T(Ie,null,[c?.meta?.hidden?ue("",!0):(y(),ne(m2,{key:c.path,basePath:c.path,route:c},null,8,["basePath","route"]))],64))),256))]),_:1},8,["collapse","default-active"])}}}),g2={class:"flex gap-[20px] items-center pl-[10px] pr-[10px]"},_2=["title"],y2=["title"],b2=["title"],w2={class:"flex items-center gap-[10px]"},S2=Ce({__name:"index",setup(t){const{t:e}=Yo(),n=Xo(),i=_s(),o=nc(),r=Ji(Sf,10),s=H(n.maxCache),a=()=>{i.back()},l=()=>{i.replace({path:o.path,query:{...o.query,[vt.ROUTE_STATE_KEY_VERSION]:Date.now()}})};function c(u){u&&n.setMaxCache(u)}return zt(()=>{r.value=n.maxCache}),(u,d)=>{const h=Ue("Icon"),m=il,f=nl;return y(),T("div",g2,[g("span",{title:v(e)("common.back")},[j(h,{icon:"material-symbols:arrow-back-rounded",class:"cursor-pointer",onClick:a})],8,_2),g("span",{title:v(e)("common.refresh")},[j(h,{icon:"material-symbols:refresh-rounded",class:"cursor-pointer",onClick:l})],8,y2),j(f,{placement:"bottom",trigger:"hover",width:"auto"},{reference:we(()=>[g("span",{title:v(e)("common.moreOperations")},[j(h,{icon:"material-symbols:article-outline",class:"cursor-pointer"})],8,b2)]),default:we(()=>[g("div",w2,[g("div",null,L(v(e)("common.maxTagCount"))+":",1),g("div",null,[j(m,{modelValue:s.value,"onUpdate:modelValue":d[0]||(d[0]=p=>s.value=p),min:1,style:{width:"90px"},"controls-position":"right",onChange:c},null,8,["modelValue"])])])]),_:1})])}}}),C2={class:"flex dark:bg-gray-800 py-[2px] h-[40px] border border-gray-200 dark:border-gray-700"},E2=Ce({__name:"index",setup(t){const{t:e}=Yo(),n=_s(),i=nc(),o=Xo(),{getTitle:r}=fc();$e(()=>i,()=>{o.addView(i)},{immediate:!0,deep:!0});const s=te(()=>o.visitedViews),a=te(()=>s.value.length===1);function l(h){const m=c(h);o.delViewAndJumpToPrev(h.path,m,n)}function c(h){return h.path===i.path}function u(h){n.push(h)}function d(h){const m=h?.meta?.title||e("route.unknownTag"),f=o.getPayLoad(h.path);return r(f?.name||m)}return(h,m)=>{const f=Ue("Icon"),p=Po,_=Gi,C=X_;return y(),T("div",C2,[j(S2),j(v(Gb),{class:"flex-1 overflow-hidden",list:s.value,getKey:w=>w.path},{display:we(({visibleList:w,overflow:S})=>[j(g_,{tag:"ul",name:"fade",class:"flex gap-[5px] p-[2px] items-center"},{default:we(()=>[(y(!0),T(Ie,null,He(w,b=>(y(),T("div",{key:b.path},[j(_,{type:c(b)?"primary":"default",onClick:E=>u(b)},{default:we(()=>[Ke(L(d(b))+" ",1),a.value?ue("",!0):(y(),ne(p,{key:0,style:{"font-size":"16px"},class:"ml-[5px]",onClick:Ye(E=>l(b),["stop"])},{default:we(()=>[j(f,{icon:"material-symbols:close"})]),_:1},8,["onClick"]))]),_:2},1032,["type","onClick"])]))),128)),S>0?(y(),ne(C,{key:0,type:"info"},{default:we(()=>[Ke("+"+L(S)+" "+L(v(e)("common.more")),1)]),_:2},1024)):ue("",!0)]),_:2},1024)]),measure:we(({item:w})=>[j(_,{type:"primary"},{default:we(()=>[Ke(L(d(w))+" ",1),a.value?ue("",!0):(y(),ne(p,{key:0,style:{"font-size":"16px"},class:"ml-[5px]"},{default:we(()=>[j(f,{icon:"material-symbols:close"})]),_:1}))]),_:2},1024)]),_:1},8,["list","getKey"])])}}}),x2=ac(E2,[["__scopeId","data-v-8b93a5e3"]]),T2={class:"size-full overflow-hidden"},$2={class:"h-[60px] dark:bg-gray-800"},k2={class:"size-full overflow-hidden flex flex-col dark:bg-gray-800"},O2={class:"dark:bg-gray-800"},A2={class:"size-full flex flex-col"},P2={class:""},R2={class:"flex-1 overflow-auto"},I2=Ce({__name:"index",setup(t){const e=qn(()=>nt(()=>import("./index-Bii_v9I4.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)),n=qn(()=>nt(()=>import("./index-Bszb87gP.js"),__vite__mapDeps([8,1,2,9,10,11,12,13,14,15,16,17,18,6]),import.meta.url)),i=H(68),o=H(200),r=H(60),s=H(""),a=H(""),l=te(()=>s.value?"transition-width duration-400":""),c=te(()=>a.value?"transition-height duration-300":""),u=te(()=>({class:c.value,size:m.value,collapsible:!0,resizable:!1})),d=te(()=>({class:l.value,min:i.value,max:300,collapsible:!0})),h=Ji(Nb,i.value),m=Ji(Ub,r.value),f=yc(),p=Qi(),_=async(S,b)=>{s.value=b,b==="end"&&h.value===0&&(h.value=o.value)},C=(S,b)=>{a.value=b,b==="start"?m.value=0:b==="end"&&(m.value=r.value)},w=S=>{S==="header"?a.value="":S==="side"&&(s.value="")};return zt(()=>{f.setSideBarCollapse(h.value===i.value)}),(S,b)=>{const E=J_,x=ey,O=Z_;return y(),T("div",T2,[j(O,{layout:"vertical",onCollapse:C},{default:we(()=>[j(E,We({class:"!overflow-hidden transform-gpu isolate will-change-height"},u.value,{onTransitionend:b[0]||(b[0]=$=>w("header")),onWebkitTransitionEnd:b[1]||(b[1]=$=>w("header"))}),{default:we(()=>[g("div",$2,[j(v(n))])]),_:1},16),j(E,{class:Ae(["transform-gpu isolate",c.value])},{default:we(()=>[j(O,{onCollapse:_},{default:we(()=>[j(E,We(d.value,{size:v(h),"onUpdate:size":b[2]||(b[2]=$=>ys(h)?h.value=$:null),class:"transform-gpu isolate will-change-width",onTransitionend:b[3]||(b[3]=$=>w("side")),onWebkitTransitionEnd:b[4]||(b[4]=$=>w("side"))}),{default:we(()=>[g("div",k2,[j(v2),v(p).isRealUserLogin()?(y(),T(Ie,{key:0},[g("div",O2,[j(x)]),j(v(e))],64)):ue("",!0)])]),_:1},16,["size"]),j(E,{class:Ae(["transform-gpu isolate !overflow-hidden",l.value])},{default:we(()=>[g("div",A2,[g("div",P2,[j(x2)]),g("div",R2,[(y(),ne(__,null,{default:we(()=>[j(zw)]),_:1}))])])]),_:1},8,["class"])]),_:1})]),_:1},8,["class"])]),_:1})])}}});let no;function M2(){const t=window.__GLOBAL_CONFIG__?.projectHash,e=t?`/${t}/main/`:`/${vt.WEBSITE_PATH_MAIN}/`;return no=y_({history:b_(e),routes:[{path:"/login",name:"login",component:()=>nt(()=>import("./index-CU7M0IJJ.js"),__vite__mapDeps([19,1,2,12,13,14,20,21,3,22,23,18]),import.meta.url),meta:{hidden:!0,noAuth:!0,title:"route.login"}},{path:"/upgrade",name:"upgrade",component:()=>nt(()=>import("./index-C057ePT_.js"),__vite__mapDeps([24,1,2,12,22,25,26,7,27]),import.meta.url),meta:{hidden:!0,noAuth:!0,title:"route.upgrade"}},{path:"/mdPreview",name:"mdPreview",component:()=>nt(()=>import("./index-DKPlBqE0.js"),__vite__mapDeps([28,1,2,29,25,30]),import.meta.url),meta:{hidden:!0,noAuth:!0,title:"route.mdPreview"}},{path:"/previewBlank/:compId/:version?",name:"previewBlank",component:()=>nt(()=>import("./index-DRSvKvKa.js"),__vite__mapDeps([31,2,32,33,1,34,4]),import.meta.url),meta:{hidden:!0,noAuth:!0,title:"route.preview"}},{path:"/previewLocalBlank/:compId",name:"previewLocalBlank",component:()=>nt(()=>import("./index-2gSE6zIr.js"),__vite__mapDeps([35,2,36,37,1,15,34,4]),import.meta.url),meta:{hidden:!0,noAuth:!0,title:"route.previewLocal"}},{path:"/similarPreview/:compId",name:"similarPreview",component:()=>nt(()=>import("./index-BhvFP_tJ.js"),__vite__mapDeps([38,1,2,39,40,41,42,43,44,45,32,36,15,5,10,46,4,34,18,47,29,25,30,48,7,33,49,50,51]),import.meta.url),meta:{hidden:!0,noAuth:!0,title:"route.similarPreview"}},{path:"/",component:I2,redirect:"/share",meta:{hideParent:!0},children:[{path:"/share",name:"share",meta:{title:"route.share",icon:qn(()=>nt(()=>import("./home-rounded-8qNxvN2I.js"),__vite__mapDeps([52,16,2,53]),import.meta.url)),noAuth:!0},component:()=>nt(()=>import("./index-I02ydx0r.js"),__vite__mapDeps([54,1,2,45,32,36,15,5,10,46,4,34,18,55]),import.meta.url)},{path:"/mine",name:"mine",meta:{title:"route.mine",icon:qn(()=>nt(()=>import("./supervised-user-circle-Bnx5icEm.js"),__vite__mapDeps([56,16,2,57]),import.meta.url))},component:()=>nt(()=>import("./index-IyiuGctN.js"),__vite__mapDeps([58,1,2,45,32,36,15,5,10,46,4,34,18,59,60,61,29,25,30,49,50,3,62,7,63,55]),import.meta.url)},{path:"/collect",name:"collect",meta:{title:"route.collect",icon:qn(()=>nt(()=>import("./kid-star-Cr1NlTdT.js"),__vite__mapDeps([64,16,2,65]),import.meta.url))},component:()=>nt(()=>import("./index-CbJoAuov.js"),__vite__mapDeps([66,1,2,45,32,36,15,5,10,46,4,34,18,55]),import.meta.url)},{path:"/local",name:"local",meta:{title:"route.local",icon:qn(()=>nt(()=>import("./sync-saved-locally-rounded-DtyOT0dw.js"),__vite__mapDeps([67,16,2,68]),import.meta.url)),noAuth:!0},component:()=>nt(()=>import("./index-B5E28bYj.js"),__vite__mapDeps([69,1,2,45,32,36,15,5,10,46,4,34,18]),import.meta.url)},{path:"/upload",name:"upload",meta:{title:"route.upload",icon:qn(()=>nt(()=>import("./cloud-upload-BRjLuSi4.js"),__vite__mapDeps([70,16,2,71]),import.meta.url)),noAuth:!0,hidden:!0},component:()=>nt(()=>import("./index-C7ChQ1lq.js"),__vite__mapDeps([72,1,2,60,32,4,61,34,29,25,30,5,49,50,3,62,7,18,44,46,27]),import.meta.url)},{path:"/uploadTeam/:teamId",name:"uploadTeam",meta:{title:"route.uploadTeam",hidden:!0},component:()=>nt(()=>import("./index-C7ChQ1lq.js"),__vite__mapDeps([72,1,2,60,32,4,61,34,29,25,30,5,49,50,3,62,7,18,44,46,27]),import.meta.url)},{path:"/userInfo",name:"userInfo",meta:{title:"route.userInfo",hidden:!0},component:()=>nt(()=>import("./index-BUnPcap8.js"),__vite__mapDeps([73,1,2,21,3,5,20,74,9,10,11,75,7]),import.meta.url)},{path:"/preview/:compId",meta:{title:"route.preview",noAuth:!0,hidden:!0},component:()=>nt(()=>import("./index-BhvFP_tJ.js"),__vite__mapDeps([38,1,2,39,40,41,42,43,44,45,32,36,15,5,10,46,4,34,18,47,29,25,30,48,7,33,49,50,51]),import.meta.url)},{path:"/previewLocal/:compId",meta:{title:"route.previewLocal",hidden:!0,noAuth:!0},component:()=>nt(()=>import("./index-COVvlML8.js"),__vite__mapDeps([76,1,2,36,47,29,25,30,46,45,32,15,5,10,4,34,18,48,7,37,49]),import.meta.url)},{path:"/previewTeam/:teamId/:compId",meta:{title:"route.previewTeam",noAuth:!0,hidden:!0},props:{isTeamPreview:!0},component:()=>nt(()=>import("./index-BhvFP_tJ.js"),__vite__mapDeps([38,1,2,39,40,41,42,43,44,45,32,36,15,5,10,46,4,34,18,47,29,25,30,48,7,33,49,50,51]),import.meta.url)},{path:"/terminal",name:"terminal",meta:{title:"route.terminal",icon:qn(()=>nt(()=>import("./terminal-D72IJB2N.js"),__vite__mapDeps([77,16,2,78]),import.meta.url)),noAuth:!0},component:()=>nt(()=>import("./index-JxbnKk2u.js"),__vite__mapDeps([79,41,2,42,1,43]),import.meta.url)},{path:"/setting",name:"setting",meta:{title:"route.setting",icon:qn(()=>nt(()=>import("./settings-BFJXTJ9K.js"),__vite__mapDeps([80,16,2,81]),import.meta.url)),noAuth:!0},component:()=>nt(()=>import("./index-DEPscuQs.js"),__vite__mapDeps([82,1,2,50,83,7]),import.meta.url)},{path:"/team/:teamId",name:"team",meta:{title:"route.team",hidden:!0},component:()=>nt(()=>import("./index-B_dBAWT4.js"),__vite__mapDeps([84,1,2,39,40,9,10,11,45,32,36,15,5,46,4,34,18,3,55,16,50,85,7]),import.meta.url)}]},{path:"/:pathMatch(.*)*",name:"404",meta:{hidden:!0,noAuth:!0,title:"route.404"},component:()=>nt(()=>import("./index-BhW9quqy.js"),__vite__mapDeps([86,2,1]),import.meta.url)}]}),no}function F2(t){M2(),t.use(no)}const D2=H([]);function L2(t){const e=ic(Aw,{errors:D2.value}),n=document.createElement("div");n.id="error-container",e.mount(n),document.body.appendChild(n)}var Kr={exports:{}},j2=Kr.exports,Ud;function z2(){return Ud||(Ud=1,(function(t,e){(function(n,i){t.exports=i()})(j2,function(){function n(X){return(n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V})(X)}function i(X,V){if(!(X instanceof V))throw new TypeError("Cannot call a class as a function")}function o(X,V){for(var J=0;J<V.length;J++){var ye=V[J];ye.enumerable=ye.enumerable||!1,ye.configurable=!0,"value"in ye&&(ye.writable=!0),Object.defineProperty(X,ye.key,ye)}}function r(X,V,J){V&&o(X.prototype,V),J&&o(X,J),Object.defineProperty(X,"prototype",{writable:!1})}function s(X,V,J){V in X?Object.defineProperty(X,V,{value:J,enumerable:!0,configurable:!0,writable:!0}):X[V]=J}function a(X,V){if(typeof V!="function"&&V!==null)throw new TypeError("Super expression must either be null or a function");X.prototype=Object.create(V&&V.prototype,{constructor:{value:X,writable:!0,configurable:!0}}),Object.defineProperty(X,"prototype",{writable:!1}),V&&c(X,V)}function l(X){return(l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(V){return V.__proto__||Object.getPrototypeOf(V)})(X)}function c(X,V){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(J,ye){return J.__proto__=ye,J})(X,V)}function u(X,V){if(V&&(typeof V=="object"||typeof V=="function"))return V;if(V!==void 0)throw new TypeError("Derived constructors may only return object or undefined");if(V=X,V===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return V}function d(X){var V=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}})();return function(){var J,ye=l(X);return u(this,V?(J=l(this).constructor,Reflect.construct(ye,arguments,J)):ye.apply(this,arguments))}}function h(X,V){(V==null||V>X.length)&&(V=X.length);for(var J=0,ye=new Array(V);J<V;J++)ye[J]=X[J];return ye}function m(X,V){var J,ye=typeof Symbol<"u"&&X[Symbol.iterator]||X["@@iterator"];if(!ye){if(Array.isArray(X)||(ye=(function(Z,ae){if(Z){if(typeof Z=="string")return h(Z,ae);var fe=Object.prototype.toString.call(Z).slice(8,-1);return(fe=fe==="Object"&&Z.constructor?Z.constructor.name:fe)==="Map"||fe==="Set"?Array.from(Z):fe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(fe)?h(Z,ae):void 0}})(X))||V&&X&&typeof X.length=="number")return ye&&(X=ye),J=0,{s:V=function(){},n:function(){return J>=X.length?{done:!0}:{done:!1,value:X[J++]}},e:function(Z){throw Z},f:V};throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
12
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var xe,se=!0,Me=!1;return{s:function(){ye=ye.call(X)},n:function(){var Z=ye.next();return se=Z.done,Z},e:function(Z){Me=!0,xe=Z},f:function(){try{se||ye.return==null||ye.return()}finally{if(Me)throw xe}}}}function f(){if(p.url)window.location.href=p.url;else if(p.rewriteHTML)try{document.documentElement.innerHTML=p.rewriteHTML}catch{document.documentElement.innerText=p.rewriteHTML}else{try{window.opener=null,window.open("","_self"),window.close(),window.history.back()}catch(X){console.log(X)}setTimeout(function(){window.location.href=p.timeOutUrl||"https://theajack.github.io/disable-devtool/404.html?h=".concat(encodeURIComponent(location.host))},500)}}var p={md5:"",ondevtoolopen:f,ondevtoolclose:null,url:"",timeOutUrl:"",tkName:"ddtk",interval:500,disableMenu:!0,stopIntervalTime:5e3,clearIntervalWhenDevOpenTrigger:!1,detectors:[1,3,4,5,6,7],clearLog:!0,disableSelect:!1,disableInputSelect:!1,disableCopy:!1,disableCut:!1,disablePaste:!1,ignore:null,disableIframeParents:!0,seo:!0,rewriteHTML:""},_=["detectors","ondevtoolclose","ignore"];function C(X){var V,J=0<arguments.length&&X!==void 0?X:{};for(V in J.onDevtoolOpen&&(J.ondevtoolopen=J.onDevtoolOpen),J.onDevtoolClose&&(J.ondevtoolclose=J.onDevtoolClose),p){var ye=V;J[ye]===void 0||n(p[ye])!==n(J[ye])&&_.indexOf(ye)===-1||(p[ye]=J[ye])}typeof p.ondevtoolclose=="function"&&p.clearIntervalWhenDevOpenTrigger===!0&&(p.clearIntervalWhenDevOpenTrigger=!1,console.warn("【DISABLE-DEVTOOL】clearIntervalWhenDevOpenTrigger 在使用 ondevtoolclose 时无效"))}function w(){return new Date().getTime()}function S(X){var V=w();return X(),w()-V}function b(X,V){function J(Me){return function(){X&&X();var Z=Me.apply(void 0,arguments);return V&&V(),Z}}var ye=window.alert,xe=window.confirm,se=window.prompt;try{window.alert=J(ye),window.confirm=J(xe),window.prompt=J(se)}catch{}}var E,x,O,$={iframe:!1,pc:!1,qqBrowser:!1,firefox:!1,macos:!1,edge:!1,oldEdge:!1,ie:!1,iosChrome:!1,iosEdge:!1,chrome:!1,seoBot:!1,mobile:!1};function K(){function X(Dt){return V.indexOf(Dt)!==-1}var V=navigator.userAgent.toLowerCase(),J=(function(){var bt=navigator,Dt=bt.platform,bt=bt.maxTouchPoints;if(typeof bt=="number")return 1<bt;if(typeof Dt=="string"){if(bt=Dt.toLowerCase(),/(mac|win)/i.test(bt))return!1;if(/(android|iphone|ipad|ipod|arch)/i.test(bt))return!0}return/(iphone|ipad|ipod|ios|android)/i.test(navigator.userAgent.toLowerCase())})(),ye=!!window.top&&window!==window.top,xe=!J,se=X("qqbrowser"),Me=X("firefox"),Z=X("macintosh"),ae=X("edge"),fe=ae&&!X("chrome"),ce=fe||X("trident")||X("msie"),be=X("crios"),$n=X("edgios"),Qt=X("chrome")||be,on=!J&&/(googlebot|baiduspider|bingbot|applebot|petalbot|yandexbot|bytespider|chrome\-lighthouse|moto g power)/i.test(V);Object.assign($,{iframe:ye,pc:xe,qqBrowser:se,firefox:Me,macos:Z,edge:ae,oldEdge:fe,ie:ce,iosChrome:be,iosEdge:$n,chrome:Qt,seoBot:on,mobile:J})}function F(){for(var X=(function(){for(var ye={},xe=0;xe<500;xe++)ye["".concat(xe)]="".concat(xe);return ye})(),V=[],J=0;J<50;J++)V.push(X);return V}function P(){p.clearLog&&O()}var N="",M=!1;function q(){var X=p.ignore;if(X){if(typeof X=="function")return X();if(X.length!==0){var V=location.href;if(N===V)return M;N=V;var J,ye=!1,xe=m(X);try{for(xe.s();!(J=xe.n()).done;){var se=J.value;if(typeof se=="string"){if(V.indexOf(se)!==-1){ye=!0;break}}else if(se.test(V)){ye=!0;break}}}catch(Me){xe.e(Me)}finally{xe.f()}return M=ye}}}var le=function(){return!1};function de(X){var V,J,ye=74,xe=73,se=85,Me=83,Z=123,ae=$.macos?function(ce,be){return ce.metaKey&&ce.altKey&&(be===xe||be===ye)}:function(ce,be){return ce.ctrlKey&&ce.shiftKey&&(be===xe||be===ye)},fe=$.macos?function(ce,be){return ce.metaKey&&ce.altKey&&be===se||ce.metaKey&&be===Me}:function(ce,be){return ce.ctrlKey&&(be===Me||be===se)};X.addEventListener("keydown",function(ce){var be=(ce=ce||X.event).keyCode||ce.which;if(be===Z||ae(ce,be)||fe(ce,be))return I(X,ce)},!0),V=X,p.disableMenu&&V.addEventListener("contextmenu",function(ce){if(ce.pointerType!=="touch")return I(V,ce)}),J=X,(p.disableSelect||p.disableInputSelect)&&Y(J,"selectstart"),J=X,p.disableCopy&&Y(J,"copy"),J=X,p.disableCut&&Y(J,"cut"),J=X,p.disablePaste&&Y(J,"paste")}function Y(X,V){X.addEventListener(V,function(J){if(!(ye=J.target)||ye.tagName!=="INPUT"&&ye.tagName!=="TEXTAREA"&&((xe=ye.getAttribute)==null?void 0:xe.call(ye,"contenteditable"))!=="true"){if(p.disableSelect)return I(X,J)}else if(p.disableInputSelect)return I(X,J);var ye,xe})}function I(X,V){if(!q()&&!le())return(V=V||X.event).returnValue=!1,V.preventDefault(),!1}var A,Q=!1,U={};function ie(X){U[X]=!1}function ve(){for(var X in U)if(U[X])return Q=!0;return Q=!1}(Pe=A=A||{})[Pe.Unknown=-1]="Unknown",Pe[Pe.RegToString=0]="RegToString",Pe[Pe.DefineId=1]="DefineId",Pe[Pe.Size=2]="Size",Pe[Pe.DateToString=3]="DateToString",Pe[Pe.FuncToString=4]="FuncToString",Pe[Pe.Debugger=5]="Debugger",Pe[Pe.Performance=6]="Performance",Pe[Pe.DebugLib=7]="DebugLib";var re=(function(){function X(ye){var J=ye.type,ye=ye.enabled,ye=ye===void 0||ye;i(this,X),this.type=A.Unknown,this.enabled=!0,this.type=J,this.enabled=ye,this.enabled&&(J=this,k.push(J),this.init())}return r(X,[{key:"onDevToolOpen",value:function(){var V;console.warn("You don't have permission to use DEVTOOL!【type = ".concat(this.type,"】")),p.clearIntervalWhenDevOpenTrigger&&B(),window.clearTimeout(R),p.ondevtoolopen(this.type,f),V=this.type,U[V]=!0}},{key:"init",value:function(){}}]),X})(),ge=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.DebugLib})}return r(V,[{key:"init",value:function(){}},{key:"detect",value:function(){var J;(((J=(J=window.eruda)==null?void 0:J._devTools)==null?void 0:J._isShow)===!0||window._vcOrigConsole&&window.document.querySelector("#__vconsole.vc-toggle"))&&this.onDevToolOpen()}}],[{key:"isUsing",value:function(){return!!window.eruda||!!window._vcOrigConsole}}]),V})(),_e=0,R=0,k=[],z=0;function D(X){function V(){fe=!0}function J(){fe=!1}var ye,xe,se,Me,Z,ae,fe=!1;function ce(){(ae[Me]===se?xe:ye)()}b(V,J),ye=J,xe=V,(ae=document).hidden!==void 0?(se="hidden",Z="visibilitychange",Me="visibilityState"):ae.mozHidden!==void 0?(se="mozHidden",Z="mozvisibilitychange",Me="mozVisibilityState"):ae.msHidden!==void 0?(se="msHidden",Z="msvisibilitychange",Me="msVisibilityState"):ae.webkitHidden!==void 0&&(se="webkitHidden",Z="webkitvisibilitychange",Me="webkitVisibilityState"),ae.removeEventListener(Z,ce,!1),ae.addEventListener(Z,ce,!1),_e=window.setInterval(function(){if(!(X.isSuspend||fe||q())){var be,$n,Qt=m(k);try{for(Qt.s();!(be=Qt.n()).done;){var on=be.value;ie(on.type),on.detect(z++)}}catch(Dt){Qt.e(Dt)}finally{Qt.f()}P(),typeof p.ondevtoolclose=="function"&&($n=Q,!ve()&&$n&&p.ondevtoolclose())}},p.interval),R=setTimeout(function(){$.pc||ge.isUsing()||B()},p.stopIntervalTime)}function B(){window.clearInterval(_e)}var oe=8;function ee(X){for(var V=(function(se,Me){se[Me>>5]|=128<<Me%32,se[14+(Me+64>>>9<<4)]=Me;for(var Z=1732584193,ae=-271733879,fe=-1732584194,ce=271733878,be=0;be<se.length;be+=16){var $n=Z,Qt=ae,on=fe,Dt=ce;Z=he(Z,ae,fe,ce,se[be+0],7,-680876936),ce=he(ce,Z,ae,fe,se[be+1],12,-389564586),fe=he(fe,ce,Z,ae,se[be+2],17,606105819),ae=he(ae,fe,ce,Z,se[be+3],22,-1044525330),Z=he(Z,ae,fe,ce,se[be+4],7,-176418897),ce=he(ce,Z,ae,fe,se[be+5],12,1200080426),fe=he(fe,ce,Z,ae,se[be+6],17,-1473231341),ae=he(ae,fe,ce,Z,se[be+7],22,-45705983),Z=he(Z,ae,fe,ce,se[be+8],7,1770035416),ce=he(ce,Z,ae,fe,se[be+9],12,-1958414417),fe=he(fe,ce,Z,ae,se[be+10],17,-42063),ae=he(ae,fe,ce,Z,se[be+11],22,-1990404162),Z=he(Z,ae,fe,ce,se[be+12],7,1804603682),ce=he(ce,Z,ae,fe,se[be+13],12,-40341101),fe=he(fe,ce,Z,ae,se[be+14],17,-1502002290),ae=he(ae,fe,ce,Z,se[be+15],22,1236535329),Z=me(Z,ae,fe,ce,se[be+1],5,-165796510),ce=me(ce,Z,ae,fe,se[be+6],9,-1069501632),fe=me(fe,ce,Z,ae,se[be+11],14,643717713),ae=me(ae,fe,ce,Z,se[be+0],20,-373897302),Z=me(Z,ae,fe,ce,se[be+5],5,-701558691),ce=me(ce,Z,ae,fe,se[be+10],9,38016083),fe=me(fe,ce,Z,ae,se[be+15],14,-660478335),ae=me(ae,fe,ce,Z,se[be+4],20,-405537848),Z=me(Z,ae,fe,ce,se[be+9],5,568446438),ce=me(ce,Z,ae,fe,se[be+14],9,-1019803690),fe=me(fe,ce,Z,ae,se[be+3],14,-187363961),ae=me(ae,fe,ce,Z,se[be+8],20,1163531501),Z=me(Z,ae,fe,ce,se[be+13],5,-1444681467),ce=me(ce,Z,ae,fe,se[be+2],9,-51403784),fe=me(fe,ce,Z,ae,se[be+7],14,1735328473),ae=me(ae,fe,ce,Z,se[be+12],20,-1926607734),Z=ke(Z,ae,fe,ce,se[be+5],4,-378558),ce=ke(ce,Z,ae,fe,se[be+8],11,-2022574463),fe=ke(fe,ce,Z,ae,se[be+11],16,1839030562),ae=ke(ae,fe,ce,Z,se[be+14],23,-35309556),Z=ke(Z,ae,fe,ce,se[be+1],4,-1530992060),ce=ke(ce,Z,ae,fe,se[be+4],11,1272893353),fe=ke(fe,ce,Z,ae,se[be+7],16,-155497632),ae=ke(ae,fe,ce,Z,se[be+10],23,-1094730640),Z=ke(Z,ae,fe,ce,se[be+13],4,681279174),ce=ke(ce,Z,ae,fe,se[be+0],11,-358537222),fe=ke(fe,ce,Z,ae,se[be+3],16,-722521979),ae=ke(ae,fe,ce,Z,se[be+6],23,76029189),Z=ke(Z,ae,fe,ce,se[be+9],4,-640364487),ce=ke(ce,Z,ae,fe,se[be+12],11,-421815835),fe=ke(fe,ce,Z,ae,se[be+15],16,530742520),ae=ke(ae,fe,ce,Z,se[be+2],23,-995338651),Z=Ee(Z,ae,fe,ce,se[be+0],6,-198630844),ce=Ee(ce,Z,ae,fe,se[be+7],10,1126891415),fe=Ee(fe,ce,Z,ae,se[be+14],15,-1416354905),ae=Ee(ae,fe,ce,Z,se[be+5],21,-57434055),Z=Ee(Z,ae,fe,ce,se[be+12],6,1700485571),ce=Ee(ce,Z,ae,fe,se[be+3],10,-1894986606),fe=Ee(fe,ce,Z,ae,se[be+10],15,-1051523),ae=Ee(ae,fe,ce,Z,se[be+1],21,-2054922799),Z=Ee(Z,ae,fe,ce,se[be+8],6,1873313359),ce=Ee(ce,Z,ae,fe,se[be+15],10,-30611744),fe=Ee(fe,ce,Z,ae,se[be+6],15,-1560198380),ae=Ee(ae,fe,ce,Z,se[be+13],21,1309151649),Z=Ee(Z,ae,fe,ce,se[be+4],6,-145523070),ce=Ee(ce,Z,ae,fe,se[be+11],10,-1120210379),fe=Ee(fe,ce,Z,ae,se[be+2],15,718787259),ae=Ee(ae,fe,ce,Z,se[be+9],21,-343485551),Z=ze(Z,$n),ae=ze(ae,Qt),fe=ze(fe,on),ce=ze(ce,Dt)}return Array(Z,ae,fe,ce)})((function(se){for(var Me=Array(),Z=(1<<oe)-1,ae=0;ae<se.length*oe;ae+=oe)Me[ae>>5]|=(se.charCodeAt(ae/oe)&Z)<<ae%32;return Me})(X),X.length*oe),J="0123456789abcdef",ye="",xe=0;xe<4*V.length;xe++)ye+=J.charAt(V[xe>>2]>>xe%4*8+4&15)+J.charAt(V[xe>>2]>>xe%4*8&15);return ye}function G(X,V,J,ye,xe,se){return ze((V=ze(ze(V,X),ze(ye,se)))<<xe|V>>>32-xe,J)}function he(X,V,J,ye,xe,se,Me){return G(V&J|~V&ye,X,V,xe,se,Me)}function me(X,V,J,ye,xe,se,Me){return G(V&ye|J&~ye,X,V,xe,se,Me)}function ke(X,V,J,ye,xe,se,Me){return G(V^J^ye,X,V,xe,se,Me)}function Ee(X,V,J,ye,xe,se,Me){return G(J^(V|~ye),X,V,xe,se,Me)}function ze(X,V){var J=(65535&X)+(65535&V);return(X>>16)+(V>>16)+(J>>16)<<16|65535&J}var Pe=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.RegToString,enabled:$.qqBrowser||$.firefox})}return r(V,[{key:"init",value:function(){var J=this;this.lastTime=0,this.reg=/./,E(this.reg),this.reg.toString=function(){var ye;return $.qqBrowser?(ye=new Date().getTime(),J.lastTime&&ye-J.lastTime<100?J.onDevToolOpen():J.lastTime=ye):$.firefox&&J.onDevToolOpen(),""}}},{key:"detect",value:function(){E(this.reg)}}]),V})(),Ne=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.DefineId})}return r(V,[{key:"init",value:function(){var J=this;this.div=document.createElement("div"),this.div.__defineGetter__("id",function(){J.onDevToolOpen()}),Object.defineProperty(this.div,"id",{get:function(){J.onDevToolOpen()}})}},{key:"detect",value:function(){E(this.div)}}]),V})(),ut=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.Size,enabled:!$.iframe&&!$.edge})}return r(V,[{key:"init",value:function(){var J=this;this.checkWindowSizeUneven(),window.addEventListener("resize",function(){setTimeout(function(){J.checkWindowSizeUneven()},100)},!0)}},{key:"detect",value:function(){}},{key:"checkWindowSizeUneven",value:function(){var J=(function(){if(Qe(window.devicePixelRatio))return window.devicePixelRatio;var xe=window.screen;return!!(Qe(xe)&&xe.deviceXDPI&&xe.logicalXDPI)&&xe.deviceXDPI/xe.logicalXDPI})();if(J!==!1){var ye=200<window.outerWidth-window.innerWidth*J,J=300<window.outerHeight-window.innerHeight*J;if(ye||J)return this.onDevToolOpen(),!1;ie(this.type)}return!0}}]),V})();function Qe(X){return X!=null}var at,tt=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.DateToString,enabled:!$.iosChrome&&!$.iosEdge})}return r(V,[{key:"init",value:function(){var J=this;this.count=0,this.date=new Date,this.date.toString=function(){return J.count++,""}}},{key:"detect",value:function(){this.count=0,E(this.date),P(),2<=this.count&&this.onDevToolOpen()}}]),V})(),pt=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.FuncToString,enabled:!$.iosChrome&&!$.iosEdge})}return r(V,[{key:"init",value:function(){var J=this;this.count=0,this.func=function(){},this.func.toString=function(){return J.count++,""}}},{key:"detect",value:function(){this.count=0,E(this.func),P(),2<=this.count&&this.onDevToolOpen()}}]),V})(),dt=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.Debugger,enabled:$.iosChrome||$.iosEdge})}return r(V,[{key:"detect",value:function(){var J=w();100<w()-J&&this.onDevToolOpen()}}]),V})(),ft=(function(){a(V,re);var X=d(V);function V(){var J;return i(this,V),(J=X.call(this,{type:A.Performance,enabled:$.chrome||!$.mobile})).count=0,J}return r(V,[{key:"init",value:function(){this.maxPrintTime=0,this.largeObjectArray=F()}},{key:"detect",value:function(){var J=this,ye=S(function(){x(J.largeObjectArray)}),xe=S(function(){E(J.largeObjectArray)});if(this.maxPrintTime=Math.max(this.maxPrintTime,xe),P(),ye===0||this.maxPrintTime===0)return!1;ye>10*this.maxPrintTime&&(2<=this.count?this.onDevToolOpen():(this.count++,this.detect()))}}]),V})(),Ft=(s(at={},A.RegToString,Pe),s(at,A.DefineId,Ne),s(at,A.Size,ut),s(at,A.DateToString,tt),s(at,A.FuncToString,pt),s(at,A.Debugger,dt),s(at,A.Performance,ft),s(at,A.DebugLib,ge),at),fn=Object.assign(function(X){function V(){var Me=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";return{success:!Me,reason:Me}}var J;if(fn.isRunning)return V("already running");if(K(),J=window.console||{log:function(){},table:function(){},clear:function(){}},O=$.ie?(E=function(){return J.log.apply(J,arguments)},x=function(){return J.table.apply(J,arguments)},function(){return J.clear()}):(E=J.log,x=J.table,J.clear),C(X),p.md5&&ee((function(Me){var Z=window.location.search,ae=window.location.hash;return(Z=Z===""&&ae!==""?"?".concat(ae.split("?")[1]):Z)!==""&&Z!==void 0&&(ae=new RegExp("(^|&)"+Me+"=([^&]*)(&|$)","i"),Me=Z.substr(1).match(ae),Me!=null)?unescape(Me[2]):""})(p.tkName))===p.md5)return V("token passed");if(p.seo&&$.seoBot)return V("seobot");fn.isRunning=!0,D(fn);var ye=fn,xe=(le=function(){return ye.isSuspend},window.top),se=window.parent;if(de(window),p.disableIframeParents&&xe&&se&&xe!==window){for(;se!==xe;)de(se),se=se.parent;de(xe)}return(p.detectors==="all"?Object.keys(Ft):p.detectors).forEach(function(Me){new Ft[Me]}),V()},{isRunning:!1,isSuspend:!1,md5:ee,version:"0.3.9",DetectorType:A,isDevToolOpened:ve});return Pe=(function(){if(typeof window>"u"||!window.document)return null;var X=document.querySelector("[disable-devtool-auto]");if(!X)return null;var V=["disable-menu","disable-select","disable-copy","disable-cut","disable-paste","clear-log"],J=["interval"],ye={};return["md5","url","tk-name","detectors"].concat(V,J).forEach(function(xe){var se=X.getAttribute(xe);se!==null&&(J.indexOf(xe)!==-1?se=parseInt(se):V.indexOf(xe)!==-1?se=se!=="false":xe==="detector"&&se!=="all"&&(se=se.split(" ")),ye[(function(Me){if(Me.indexOf("-")===-1)return Me;var Z=!1;return Me.split("").map(function(ae){return ae==="-"?(Z=!0,""):Z?(Z=!1,ae.toUpperCase()):ae}).join("")})(xe)]=se)}),ye})(),Pe&&fn(Pe),fn})})(Kr)),Kr.exports}var N2=z2();const U2=Di(N2);function V2(){window.__GLOBAL_CONFIG__.allowDebug||U2({disableMenu:!1})}(function(){try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('._fc-frame ._fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-frame ._fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame._fc-disabled ._fc-upload-btn,._fc-frame._fc-disabled .el-button{cursor:not-allowed!important;color:#999}._fc-frame ._fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;-webkit-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}._fc-frame ._fc-upload-cover i{color:#fff;font-size:20px;cursor:pointer;margin:0 2px}._fc-frame ._fc-files:hover ._fc-upload-cover{opacity:1}._fc-frame .el-upload{display:block}._fc-frame ._fc-upload-icon{cursor:pointer}._fc-frame ._fc-upload-btn,._fc-files{display:inline-block;width:58px;height:58px;text-align:center;line-height:58px;border:1px solid #c0ccda;border-radius:4px;overflow:hidden;background:#fff;position:relative;-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.1);box-shadow:2px 2px 5px #0000001a;margin-right:4px;-webkit-box-sizing:border-box;box-sizing:border-box}._fc-upload{width:100%}._fc-exceed .el-upload{display:none}.el-upload-list.is-disabled .el-upload{cursor:not-allowed!important}._fc-group{display:flex;min-height:38px;justify-content:center;flex-direction:column;width:100%}._fc-group-disabled ._fc-group-btn,._fc-group-disabled ._fc-group-add{cursor:not-allowed}._fc-group-handle{display:flex;flex-direction:row;position:absolute;bottom:-15px;right:30px;border-radius:15px;border:1px dashed #d9d9d9;padding:3px 8px;background-color:#fff}._fc-group-btn{cursor:pointer}._fc-group-idx{position:absolute;bottom:-15px;left:10px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;background:#eee;border-radius:15px;font-weight:700}._fc-group-handle ._fc-group-btn+._fc-group-btn{margin-left:7px}._fc-group-container{position:relative;display:flex;flex-direction:column;border:1px dashed #d9d9d9;border-radius:5px;margin:5px 5px 25px;padding:20px 20px 25px}._fc-group-arrow{position:relative;width:20px;height:20px}._fc-group-arrow:before{content:"";position:absolute;top:8px;left:5px;width:9px;height:9px;border-left:2px solid #999;border-top:2px solid #999}._fc-group-arrow:before{transform:rotate(45deg)}._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group-plus-minus{width:20px;height:20px;position:relative;cursor:pointer}._fc-group-plus-minus:before,._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:60%;height:2px;background-color:#409eff;transform:translate(-50%,-50%)}._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group-plus-minus._fc-group-minus:after{background-color:#f56c6c}._fc-group-add{cursor:pointer;width:25px;height:25px;border:1px solid rgb(64 158 255 / 50%);border-radius:15px}._fc-group-add._fc-group-plus-minus:before,._fc-group-add._fc-group-plus-minus:after{width:50%}._fc-group._fc-group-card{display:flex;flex-direction:column;width:100%;gap:16px}._fc-group._fc-group-card._fc-group-disabled ._fc-group-btn,._fc-group._fc-group-card._fc-group-disabled ._fc-group-add{cursor:not-allowed;opacity:.5}._fc-group._fc-group-card ._fc-group-container{position:relative;background:#fff;border:1px solid #f0f0f0;border-radius:6px;overflow:hidden;display:flex;flex-direction:column;padding:0;margin:0}._fc-group._fc-group-card ._fc-group-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px 12px;border-bottom:1px solid #f0f0f0;background:#fafafa}._fc-group._fc-group-card ._fc-group-idx{display:flex;align-items:center;justify-content:center;width:24px;height:24px;background:#f0f0f0;color:#666;border-radius:6px;font-size:12px;font-weight:500;margin-right:12px;flex-shrink:0;position:static;border:1px solid #e0e0e0}._fc-group._fc-group-card ._fc-group-title{flex:1;font-size:14px;font-weight:500;color:#000000d9;line-height:1.5715}._fc-group._fc-group-card ._fc-group-handle{display:flex;align-items:center;gap:4px;margin-left:12px;flex-shrink:0;position:static;bottom:auto;right:auto;border-radius:0;border:none;padding:0;background-color:transparent;flex-direction:row}._fc-group._fc-group-card ._fc-group-btn{cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:4px;border:1px solid #d9d9d9;background:#fff;color:#00000073;position:relative}._fc-group._fc-group-card ._fc-group-btn:hover{color:#1890ff;border-color:#1890ff;background:#f0f8ff}._fc-group._fc-group-card ._fc-group-btn:active{color:#096dd9;border-color:#096dd9}._fc-group._fc-group-card ._fc-group-arrow{position:relative}._fc-group._fc-group-card ._fc-group-arrow:before{content:"";position:absolute;top:50%;left:50%;width:5px;height:5px;border-left:1px solid currentColor;border-top:1px solid currentColor;transform:translate(-50%,-50%) rotate(45deg)}._fc-group._fc-group-card ._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group._fc-group-card ._fc-group-sort{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;height:24px}._fc-group._fc-group-card ._fc-group-sort:before,._fc-group._fc-group-card ._fc-group-sort:after{content:"";position:absolute;left:50%;width:4px;height:4px;border-left:1px solid currentColor;border-top:1px solid currentColor;transform:translate(-50%)}._fc-group._fc-group-card ._fc-group-sort:before{top:6px;transform:translate(-50%) rotate(45deg)}._fc-group._fc-group-card ._fc-group-sort:after{bottom:6px;transform:translate(-50%) rotate(225deg)}._fc-group._fc-group-card ._fc-group-sort-up,._fc-group._fc-group-card ._fc-group-sort-down{position:absolute;left:0;right:0;height:12px;cursor:pointer;z-index:1}._fc-group._fc-group-card ._fc-group-sort-up{top:0}._fc-group._fc-group-card ._fc-group-sort-down{bottom:0}._fc-group._fc-group-card ._fc-group-sort-up:hover,._fc-group._fc-group-card ._fc-group-sort-down:hover{background:#1890ff1a}._fc-group._fc-group-card ._fc-group-plus-minus{position:relative;background:#409eff;border-color:#409eff;color:#fff;width:24px;height:24px}._fc-group._fc-group-card ._fc-group-plus-minus:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}._fc-group._fc-group-card ._fc-group-plus-minus:before,._fc-group._fc-group-card ._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:8px;height:1px;background-color:currentColor;transform:translate(-50%,-50%)}._fc-group._fc-group-card ._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus{background:#f56c6c;border-color:#f56c6c}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus:hover{background:#f78989;border-color:#f78989}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group._fc-group-card ._fc-group-content{padding:20px}._fc-group._fc-group-card ._fc-group-add{cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:4px;border:1px solid #d9d9d9;background:#fff;color:#00000073;position:relative}._fc-group._fc-group-card ._fc-group-add:hover{color:#409eff;border-color:#409eff;background:#f0f8ff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus{width:24px;height:24px;background:#409eff;border-color:#409eff;color:#fff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:before,._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:8px;height:1px;background-color:currentColor;transform:translate(-50%,-50%)}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group._fc-group-card ._fc-group-empty{text-align:center;padding:40px 20px;color:#00000073;font-size:14px}@media (max-width: 768px){._fc-group._fc-group-card ._fc-group-container{margin:0 -8px;border-radius:0;border-left:none;border-right:none}._fc-group._fc-group-card ._fc-group-header{padding:12px 16px 8px}._fc-group._fc-group-card ._fc-group-content{padding:16px}._fc-group._fc-group-card ._fc-group-handle{gap:2px}._fc-group._fc-group-card ._fc-group-btn{width:22px;height:22px}}.form-create .form-create .el-form-item{margin-bottom:22px}.form-create{width:100%}.form-create.is-preview .fc-clock,.form-create .fc-none,.form-create.is-preview .el-form-item.is-required>.el-form-item__label-wrap>.el-form-item__label:before,.form-create.is-preview .el-form-item.is-required>.el-form-item__label:before{display:none!important}.fc-wrap-right>.el-form-item__label{display:flex;justify-content:flex-end}.fc-wrap-left>.el-form-item__label{display:flex;justify-content:flex-start}.fc-wrap-top.el-form-item{display:block}.fc-wrap-top.el-form-item>.el-form-item__label{display:block;height:auto;line-height:22px;margin-bottom:8px;text-align:left;float:unset}.el-form--large .fc-wrap-top.el-form-item>.el-form-item__label{line-height:22px;margin-bottom:12px}.el-form--default .fc-wrap-top.el-form-item>.el-form-item__label{line-height:22px;margin-bottom:8px}.el-form--small .fc-wrap-top.el-form-item>.el-form-item__label{line-height:20px;margin-bottom:4px}.fc-form-footer{margin-top:12px}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();var B2=Object.defineProperty,H2=Object.defineProperties,q2=Object.getOwnPropertyDescriptors,Vd=Object.getOwnPropertySymbols,W2=Object.prototype.hasOwnProperty,K2=Object.prototype.propertyIsEnumerable,Bd=(t,e,n)=>e in t?B2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Te=(t,e)=>{for(var n in e||(e={}))W2.call(e,n)&&Bd(t,n,e[n]);if(Vd)for(var n of Vd(e))K2.call(e,n)&&Bd(t,n,e[n]);return t},en=(t,e)=>H2(t,q2(e));function wc(t,e){return Object.keys(t).reduce((n,i)=>((!e||e.indexOf(i)===-1)&&(n[i]=t[i]),n),{})}function Ut(t){return Array.isArray(t)?t:[null,void 0,""].indexOf(t)>-1?[]:[t]}const Y2="fcCheckbox",G2=Ce({name:Y2,inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:Array,default:()=>[]},type:String,options:Array,input:Boolean,inputValue:String},emits:["update:modelValue","fc.el"],setup(t,e){const n=kt(t.formCreateInject,"options",[]),i=kt(t,"options"),o=kt(t,"modelValue"),r=kt(t,"inputValue",""),s=H(r.value),a=kt(t,"input",!1),l=d=>{const h=[...Ut(o.value)],m=h.indexOf(s.value);s.value=d,m>-1&&(h.splice(m,1),h.push(d),u(h))};$e(r,d=>{if(!a.value){s.value=d;return}l(d)});const c=te(()=>{let d=n.value||[];return i.value&&(d=i.value||[]),Array.isArray(d)?d:[]});$e(o,d=>{let h=null;if(!r.value&&d!=null&&Array.isArray(d)&&d.length>0&&a.value){const m=c.value.map(f=>f.value);d.forEach(f=>{m.indexOf(f)===-1&&(h=f)})}h!=null&&(s.value=h)},{immediate:!0});const u=d=>{e.emit("update:modelValue",d)};return{options:c,value:o,onInput:u,updateCustomValue:l,makeInput(d){if(a.value)return j(d,{value:s.value||void 0,label:s.value||void 0},{default:()=>[j(Ue("ElInput"),{size:"small",modelValue:s.value,"onUpdate:modelValue":l},null)]})}}},render(){const t=this.type==="button"?"ElCheckboxButton":"ElCheckbox",e=Ue(t);return j(Ue("ElCheckboxGroup"),We(this.$attrs,{modelValue:this.value===null?void 0:this.value,"onUpdate:modelValue":this.onInput,ref:"el"}),Te({default:()=>{var n,i;return[this.options.map((o,r)=>{const s=Te({},o),a=s.value,l=s.label;return delete s.value,delete s.label,j(e,We(s,{label:a,value:a,key:t+r+"-"+a}),{default:()=>[l||a||""]})}),(i=(n=this.$slots).default)==null?void 0:i.call(n),this.makeInput(e)]}},wc(this.$slots,["default"])))},mounted(){this.$emit("fc.el",this.$refs.el)}});function gm(t){t=t||new Map;const e={$on(n,i){const o=t.get(n);o&&o.push(i)||t.set(n,[i])},$once(n,i){i._once=!0,e.$on(n,i)},$off(n,i){const o=t.get(n);o&&o.splice(o.indexOf(i)>>>0,1)},$emit(n,...i){(t.get(n)||[]).slice().map(o=>{o._once&&(e.$off(n,o),delete o._once),o(...i)}),(t.get("*")||[]).slice().map(o=>{o(n,i)})}};return e}const gi=(t,e)=>{const n=t.__vccOpts||t;for(const[i,o]of e)n[i]=o;return n},Q2={name:"IconCircleClose"},X2={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function J2(t,e,n,i,o,r){return y(),T("svg",X2,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M466.752 512l-90.496-90.496a32 32 0 0145.248-45.248L512 466.752l90.496-90.496a32 32 0 1145.248 45.248L557.248 512l90.496 90.496a32 32 0 11-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 01-45.248-45.248L466.752 512z"},null,-1),g("path",{fill:"currentColor",d:"M512 896a384 384 0 100-768 384 384 0 000 768zm0 64a448 448 0 110-896 448 448 0 010 896z"},null,-1)])])}const Z2=gi(Q2,[["render",J2]]),ex={name:"IconDocument"},tx={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function nx(t,e,n,i,o,r){return y(),T("svg",tx,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640V384zm-26.496-64L640 154.496V320h165.504zM160 64h480l256 256v608a32 32 0 01-32 32H160a32 32 0 01-32-32V96a32 32 0 0132-32zm160 448h384v64H320v-64zm0-192h160v64H320v-64zm0 384h384v64H320v-64z"},null,-1)])])}const ix=gi(ex,[["render",nx]]),ox={name:"IconDelete"},rx={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function sx(t,e,n,i,o,r){return y(),T("svg",rx,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M160 256H96a32 32 0 010-64h256V95.936a32 32 0 0132-32h256a32 32 0 0132 32V192h256a32 32 0 110 64h-64v672a32 32 0 01-32 32H192a32 32 0 01-32-32V256zm448-64v-64H416v64h192zM224 896h576V256H224v640zm192-128a32 32 0 01-32-32V416a32 32 0 0164 0v320a32 32 0 01-32 32zm192 0a32 32 0 01-32-32V416a32 32 0 0164 0v320a32 32 0 01-32 32z"},null,-1)])])}const ax=gi(ox,[["render",sx]]),lx={name:"IconView"},cx={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function ux(t,e,n,i,o,r){return y(),T("svg",cx,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352zm0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 110 448 224 224 0 010-448zm0 64a160.192 160.192 0 00-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160z"},null,-1)])])}const dx=gi(lx,[["render",ux]]),hx={name:"IconFolderOpened"},px={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function fx(t,e,n,i,o,r){return y(),T("svg",px,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M878.08 448H241.92l-96 384h636.16l96-384zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 01216.96 384H832zm-24.96 512H96a32 32 0 01-32-32V160a32 32 0 0132-32h287.872l128.384 128H864a32 32 0 0132 32v96h23.04a32 32 0 0131.04 39.744l-112 448A32 32 0 01807.04 896z"},null,-1)])])}const mx=gi(hx,[["render",fx]]),vx="fcFrame",gx=Ce({name:vx,props:{type:{type:String,default:"input"},field:String,helper:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},src:{type:String,required:!0},icon:{type:String,default:"IconFolderOpened"},width:{type:String,default:"500px"},height:{type:String,default:"370px"},maxLength:{type:Number,default:0},okBtnText:{type:String,default:""},closeBtnText:{type:String,default:""},modalTitle:String,handleIcon:{type:[String,Boolean],default:void 0},title:String,allowRemove:{type:Boolean,default:!0},onOpen:{type:Function,default:()=>{}},onOk:{type:Function,default:()=>{}},onCancel:{type:Function,default:()=>{}},onLoad:{type:Function,default:()=>{}},onBeforeRemove:{type:Function,default:()=>{}},onRemove:{type:Function,default:()=>{}},onHandle:Function,modal:{type:Object,default:()=>({})},srcKey:[String,Number],modelValue:[Array,String,Number,Object],previewMask:void 0,footer:{type:Boolean,default:!0},reload:{type:Boolean,default:!0},closeBtn:{type:Boolean,default:!0},okBtn:{type:Boolean,default:!0},formCreateInject:Object},emits:["update:modelValue","change"],components:{IconFolderOpened:mx,IconView:dx},data(){return{fileList:Ut(this.modelValue),previewVisible:!1,frameVisible:!1,previewImage:"",bus:new gm}},watch:{modelValue(t){this.fileList=Ut(t)}},methods:{close(){this.closeModel(!0)},closeModel(t){this.bus.$emit(t?"$close":"$ok"),this.reload&&(this.bus.$off("$ok"),this.bus.$off("$close")),this.frameVisible=!1},handleCancel(){this.previewVisible=!1},showModel(){this.disabled||this.onOpen()===!1||(this.frameVisible=!0)},input(){const t=this.fileList,e=this.maxLength===1?t[0]||"":t;this.$emit("update:modelValue",e),this.$emit("change",e)},makeInput(){return j(Ue("ElInput"),We({type:"text",modelValue:this.fileList.map(t=>this.getSrc(t)).toString(),readonly:!0},{key:1}),{append:()=>j(Ue("ElButton"),{icon:Ue(this.icon),onClick:()=>this.showModel()},null),suffix:()=>this.fileList.length&&!this.disabled?j(Ue("ElIcon"),{class:"el-input__icon _fc-upload-icon",onClick:()=>{this.fileList=[],this.input()}},{default:()=>[j(Z2,null,null)]}):null})},makeGroup(t){return(!this.maxLength||this.fileList.length<this.maxLength)&&t.push(this.makeBtn()),j("div",{key:2},[t])},makeItem(t,e){return j("div",{class:"_fc-files",key:"3"+t},[e])},valid(t){const e=this.formCreateInject.field||this.field;if(e&&t!==e)throw new Error("[frame]无效的字段值")},makeIcons(t,e){if(this.handleIcon!==!1||this.allowRemove===!0){const n=[];return(this.type!=="file"&&this.handleIcon!==!1||this.type==="file"&&this.handleIcon)&&n.push(this.makeHandleIcon(t,e)),this.allowRemove&&n.push(this.makeRemoveIcon(t,e)),j("div",{class:"_fc-upload-cover",key:4},[n])}},makeHandleIcon(t,e){const n=Ue(this.handleIcon===!0||this.handleIcon===void 0?"icon-view":this.handleIcon);return j(Ue("ElIcon"),{onClick:()=>this.handleClick(t),key:"5"+e},{default:()=>[j(n,null,null)]})},makeRemoveIcon(t,e){return j(Ue("ElIcon"),{onClick:()=>this.handleRemove(t),key:"6"+e},{default:()=>[j(ax,null,null)]})},makeFiles(){return this.makeGroup(this.fileList.map((t,e)=>this.makeItem(e,[j(Ue("ElIcon"),{onClick:()=>this.handleClick(t)},{default:()=>[j(ix,null,null)]}),this.makeIcons(t,e)])))},makeImages(){return this.makeGroup(this.fileList.map((t,e)=>this.makeItem(e,[j("img",{src:this.getSrc(t)},null),this.makeIcons(t,e)])))},makeBtn(){const t=Ue(this.icon);return j("div",{class:"_fc-upload-btn",onClick:()=>this.showModel(),key:7},[j(Ue("ElIcon"),null,{default:()=>[j(t,null,null)]})])},handleClick(t){if(this.onHandle)return this.onHandle(t);this.previewImage=this.getSrc(t),this.previewVisible=!0},handleRemove(t){this.disabled||this.onBeforeRemove(t)!==!1&&(this.fileList.splice(this.fileList.indexOf(t),1),this.input(),this.onRemove(t))},getSrc(t){return this.srcKey?t[this.srcKey]:t},frameLoad(t){this.onLoad(t);try{this.helper===!0&&(t.form_create_helper={api:this.formCreateInject.api,close:e=>{this.valid(e),this.closeModel()},set:(e,n)=>{this.valid(e),!this.disabled&&this.$emit("update:modelValue",n)},get:e=>(this.valid(e),this.modelValue),onOk:e=>this.bus.$on("$ok",e),onClose:e=>this.bus.$on("$close",e)})}catch(e){console.error(e)}},makeFooter(){const{okBtnText:t,closeBtnText:e,closeBtn:n,okBtn:i,footer:o}=this.$props;if(o)return j("div",null,[n?j(Ue("ElButton"),{onClick:()=>this.onCancel()!==!1&&(this.frameVisible=!1)},{default:()=>[e||this.formCreateInject.t("close")||"关闭"]}):null,i?j(Ue("ElButton"),{type:"primary",onClick:()=>this.onOk()!==!1&&this.closeModel()},{default:()=>[t||this.formCreateInject.t("ok")||"确定"]}):null])}},render(){const t=this.type;let e;t==="input"?e=this.makeInput():t==="image"?e=this.makeImages():e=this.makeFiles();const{width:n="30%",height:i,src:o,title:r,modalTitle:s}=this.$props;return Ge(()=>{this.$refs.frame&&this.frameLoad(this.$refs.frame.contentWindow||{})}),j("div",{class:{"_fc-frame":!0,"_fc-disabled":this.disabled}},[e,j(Ue("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:s,modelValue:this.previewVisible,onClose:this.handleCancel},{default:()=>[j("img",{style:"width: 100%",src:this.previewImage},null)]}),j(Ue("ElDialog"),We({appendToBody:!0},Te({width:n,title:r},this.modal),{modelValue:this.frameVisible,onClose:()=>this.closeModel(!0)}),{default:()=>[this.frameVisible||!this.reload?j("iframe",{ref:"frame",src:o,frameBorder:"0",style:{height:i,border:"0 none",width:"100%"}},null):null],footer:()=>this.makeFooter()})])},beforeMount(){const{name:t,field:e,api:n}=this.formCreateInject;t&&n.on("fc:closeModal:"+t,this.close),e&&n.on("fc:closeModal:"+e,this.close)},beforeUnmount(){const{name:t,field:e,api:n}=this.formCreateInject;t&&n.off("fc:closeModal:"+t,this.close),e&&n.off("fc:closeModal:"+e,this.close)}}),_x="fcRadio",yx=Ce({name:_x,inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:[String,Number,Boolean],default:""},options:Array,type:String,input:Boolean,inputValue:String},emits:["update:modelValue","fc.el"],setup(t,e){const n=kt(t.formCreateInject,"options",[]),i=kt(t,"options"),o=kt(t,"modelValue"),r=kt(t,"inputValue",""),s=H(r.value),a=kt(t,"input",!1);$e(r,d=>{if(!a.value){s.value=d;return}u(d)});const l=te(()=>{let d=n.value||[];return i.value&&(d=i.value||[]),Array.isArray(d)?d:[]});$e(o,d=>{let h=!1;!r.value&&d!=null&&a.value&&(h=l.value.map(m=>m.value).indexOf(d)===-1),h&&(s.value=d)},{immediate:!0});const c=d=>{e.emit("update:modelValue",d)},u=d=>{const h=s.value;s.value=d,o.value===h&&c(d)};return{options:l,value:o,onInput:c,updateCustomValue:u,customValue:s,makeInput(d){if(a.value)return j(d,{checked:!1,value:s.value||void 0,label:s.value||void 0},{default:()=>[j(Ue("ElInput"),{size:"small",modelValue:s.value,"onUpdate:modelValue":u},null)]})}}},render(){const t=this.type==="button"?"ElRadioButton":"ElRadio",e=Ue(t);return j(Ue("ElRadioGroup"),We(this.$attrs,{modelValue:this.value,"onUpdate:modelValue":this.onInput,ref:"el"}),Te({default:()=>{var n,i;return[this.options.map((o,r)=>{const s=Te({},o),a=s.value,l=s.label;return delete s.value,delete s.label,j(e,We(s,{label:a,value:a,key:t+r+"-"+a}),{default:()=>[l||a||""]})}),(i=(n=this.$slots).default)==null?void 0:i.call(n),this.makeInput(e)]}},wc(this.$slots,["default"])))},mounted(){this.$emit("fc.el",this.$refs.el)}}),pe={type(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"},Undef(t){return t==null},Element(t){return typeof t=="object"&&t!==null&&t.nodeType===1&&!pe.Object(t)},trueArray(t){return Array.isArray(t)&&t.length>0},Function(t){const e=this.getType(t);return e==="Function"||e==="AsyncFunction"},getType(t){const e=Object.prototype.toString.call(t);return/^\[object (.*)\]$/.exec(e)[1]},empty(t){return t==null||Array.isArray(t)&&Array.isArray(t)&&!t.length?!0:typeof t=="string"&&!t}};["Date","Object","String","Boolean","Array","Number"].forEach(t=>{pe[t]=function(e){return pe.type(e,t)}});function lt(t,e){return{}.hasOwnProperty.call(t,e)}const bx="fcSelect",wx=Ce({name:bx,inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},type:String},emits:["update:modelValue","fc.el"],setup(t,{emit:e}){const n=kt(t.formCreateInject,"options",[]),i=kt(t,"modelValue");return{options:te(()=>Array.isArray(n.value)?n.value:[]),value:i,handleUpdate:o=>{e("update:modelValue",o)},hasProperty:lt,is:pe}},mounted(){this.$emit("fc.el",this.$refs.el)}});function Sx(t,e,n,i,o,r){const s=Ue("el-option"),a=Ue("el-option-group"),l=Ue("el-select");return y(),ne(l,We(t.$attrs,{"model-value":t.value,"onUpdate:modelValue":t.handleUpdate,ref:"el"}),{default:we(()=>[(y(!0),T(Ie,null,He(t.options,(c,u)=>(y(),T(Ie,null,[t.hasProperty(c,"options")?(y(),ne(a,{label:c.label,key:`${u}-${c.label}`},{default:we(()=>[(y(!0),T(Ie,null,He(t.is.trueArray(c.options)?c.options:[],(d,h)=>(y(),ne(s,We({key:`${h}-${d.value}`},{ref_for:!0},d),null,16))),128))]),_:2},1032,["label"])):(y(),ne(s,We({key:`${u}-${c.value}`},{ref_for:!0},c),null,16))],64))),256)),Ve(t.$slots,"default")]),_:3},16,["model-value","onUpdate:modelValue"])}const Cx=gi(wx,[["render",Sx]]),Ex="fcTree",xx=Ce({name:Ex,inheritAttrs:!1,formCreateParser:{mergeProp(t){const e=t.prop.props;e.nodeKey||(e.nodeKey="id"),e.props||(e.props={label:"title"})}},props:{type:String,modelValue:{type:[Array,String,Number],default:()=>[]}},emits:["update:modelValue","fc.el"],watch:{modelValue(){this.setValue()}},methods:{updateValue(){if(!this.$refs.tree)return;let t;this.type==="selected"?t=this.$refs.tree.getCurrentKey():t=this.$refs.tree.getCheckedKeys(),this.$emit("update:modelValue",t)},setValue(){this.$refs.tree&&(this.type==="selected"?this.$refs.tree.setCurrentKey(this.modelValue):this.$refs.tree.setCheckedKeys(Ut(this.modelValue)))}},render(){return j(Ue("ElTree"),We(this.$attrs,{ref:"tree",onCheck:this.updateValue,onNodeClick:this.updateValue}),this.$slots)},mounted(){this.setValue(),this.$emit("fc.el",this.$refs.tree)}}),Tx={name:"IconUpload"},$x={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function kx(t,e,n,i,o,r){return y(),T("svg",$x,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M160 832h704a32 32 0 110 64H160a32 32 0 110-64zm384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248L544 253.696z"},null,-1)])])}const Ox=gi(Tx,[["render",kx]]);function Hd(t,e){return typeof t=="object"?t:{url:t,is_string:!0,name:Ax(t),uid:e}}function qd(t){return en(Te({},t),{file:t,value:t})}function Ax(t){return(""+t).split("/").pop()}const Px="fcUpload",Rx=Ce({name:Px,inheritAttrs:!1,formCreateParser:{toFormValue(t){return Ut(t)},toValue(t,e){return e.prop.props.limit===1?t[0]||"":t}},props:{previewMask:void 0,onPreview:Function,httpRequest:Function,modalTitle:String,listType:String,uploadText:String,formCreateInject:Object,modelValue:[Array,String,Object]},emits:["update:modelValue","change","remove","fc.el"],data(){return{previewVisible:!1,previewImage:"",fileList:[]}},created(){this.fileList=Ut(this.modelValue).map(Hd).map(qd)},watch:{modelValue(t){this.fileList=Ut(t).map(Hd).map(qd)}},methods:{handlePreview(t){this.onPreview?this.onPreview(...arguments):this.listType==="text"?window.open(t.url):(this.previewImage=t.url,this.previewVisible=!0)},update(t){let e=t.map(n=>n.is_string?n.url:n.value||n.url).filter(n=>n!==void 0);this.$emit("update:modelValue",e)},handleCancel(){this.previewVisible=!1},handleChange(t,e){this.$emit("change",...arguments),t.status==="success"&&this.update(e)},handleRemove(t,e){this.$emit("remove",...arguments),this.update(e)},doHttpRequest(t){if(this.httpRequest)return this.httpRequest(t);t.source="upload",this.formCreateInject.api.fetch(t)}},render(){const t=Ut(this.modelValue).length;return j("div",{class:"_fc-upload"},[j(Ue("ElUpload"),We({key:t},this.$attrs,{listType:this.listType||"picture-card",class:{"_fc-exceed":this.$attrs.limit?this.$attrs.limit<=t:!1},onPreview:this.handlePreview,onChange:this.handleChange,onRemove:this.handleRemove,httpRequest:this.doHttpRequest,fileList:this.fileList,ref:"upload"}),Te({default:()=>{var e,n;return[((n=(e=this.$slots).default)==null?void 0:n.call(e))||(["text","picture"].indexOf(this.listType)===-1?j(Ue("ElIcon"),null,{default:()=>[j(Ox,null,null)]}):j(Ue("ElButton"),{type:"primary"},{default:()=>[this.formCreateInject.t("clickToUpload")||this.uploadText||"点击上传"]}))]}},wc(this.$slots,["default"]))),j(Ue("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:this.modalTitle,modelValue:this.previewVisible,onClose:this.handleCancel},{default:()=>[j("img",{style:"width: 100%",src:this.previewImage},null)]})])},mounted(){this.$emit("fc.el",this.$refs.upload)}});function an(t,e,n){t[e]=n}function Si(t,e){delete t[e]}function ir(t,e={},n){let i=!1;for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o)){let r=e[o];if((i=Array.isArray(r))||pe.Object(r)){let s=t[o]===void 0;if(i)i=!1,s&&an(t,o,[]);else if(r._clone&&n!==void 0)if(n)r=r.getRule(),s&&an(t,o,{});else{an(t,o,r._clone());continue}else s&&an(t,o,{});t[o]=ir(t[o],r,n)}else an(t,o,r),pe.Undef(r)||(pe.Undef(r.__json)||(t[o].__json=r.__json),pe.Undef(r.__origin)||(t[o].__origin=r.__origin))}return n!==void 0&&Array.isArray(t)?t.filter(o=>!o||!o.__ctrl):t}function Mn(t){return ir({},{value:t}).value}const Ix=Object.assign||function(t){for(let e,n=1;n<arguments.length;n++)for(let i in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,i)&&an(t,i,e[i]);return t};function Fe(){return Ix.apply(this,arguments)}function vl(t){return typeof t!="object"||t===null?t:t instanceof Array?[...t]:Te({},t)}function ci(t,e){var n=null;return function(...i){n!==null&&clearTimeout(n),n=setTimeout(()=>t.call(this,...i),e)}}function _m(t){return t==null?"":typeof t=="object"?JSON.stringify(t,null,2):String(t)}function Mx(t){return t&&typeof t=="object"&&typeof t.then=="function"}function as(t){return Mx(t)?t:Promise.resolve(t)}function Do(t){let e=t.replace(/([A-Z])/g,"-$1").toLocaleLowerCase();return e.indexOf("-")===0&&(e=e.substr(1)),e}function ym(t){return t.replace(t[0],t[0].toLocaleUpperCase())}function bm(t,e,n){return`[form-create ${t}]: ${e}`}function Sc(t,e){console.error(bm("err",t))}function Fx(t){Sc(t.toString()),console.error(t)}const gl="[[FORM-CREATE-PREFIX-",_l="-FORM-CREATE-SUFFIX]]";function Lo(t,e){return JSON.stringify(ir(Array.isArray(t)?[]:{},t,!0),function(n,i){if(!(i&&i._isVue===!0)){if(typeof i!="function")return i;if(i.__json)return i.__json;if(i.__origin&&(i=i.__origin),!i.__emit)return gl+i+_l}},e)}function ua(t){return new Function("return "+t)()}function Dn(t,e){if(t&&pe.String(t)&&t.length>4){let n=t.trim(),i=!1;try{if(n.indexOf(_l)>0&&n.indexOf(gl)===0)n=n.replace(_l,"").replace(gl,""),i=!0;else if(n.indexOf("$FN:")===0)n=n.substring(4),i=!0;else if(n.indexOf("$EXEC:")===0)n=n.substring(6),i=!0;else if(n.indexOf("$GLOBAL:")===0){const r=n.substring(8);return n=function(...s){const a=s[0].api.getGlobalEvent(r);if(a)return a.call(this,...s)},n.__json=t,n.__inject=!0,n}else{if(n.indexOf("$FNX:")===0)return n=ua(`function($inject){
|
|
11
|
+
`+r)}}catch{}}throw i}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Ii(this.defaults,n);const{transitional:i,paramsSerializer:o,headers:r}=n;i!==void 0&&Wr.assertOptions(i,{silentJSONParsing:rn.transitional(rn.boolean),forcedJSONParsing:rn.transitional(rn.boolean),clarifyTimeoutError:rn.transitional(rn.boolean),legacyInterceptorReqResOrdering:rn.transitional(rn.boolean)},!1),o!=null&&(W.isFunction(o)?n.paramsSerializer={serialize:o}:Wr.assertOptions(o,{encode:rn.function,serialize:rn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Wr.assertOptions(n,{baseUrl:rn.spelling("baseURL"),withXsrfToken:rn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=r&&W.merge(r.common,r[n.method]);r&&W.forEach(["delete","get","head","post","put","patch","common"],f=>{delete r[f]}),n.headers=qt.concat(s,r);const a=[];let l=!0;this.interceptors.request.forEach(function(p){if(typeof p.runWhen=="function"&&p.runWhen(n)===!1)return;l=l&&p.synchronous;const _=n.transitional||fc;_&&_.legacyInterceptorReqResOrdering?a.unshift(p.fulfilled,p.rejected):a.push(p.fulfilled,p.rejected)});const c=[];this.interceptors.response.forEach(function(p){c.push(p.fulfilled,p.rejected)});let u,d=0,h;if(!l){const f=[Fd.bind(this),void 0];for(f.unshift(...a),f.push(...c),h=f.length,u=Promise.resolve(n);d<h;)u=u.then(f[d++],f[d++]);return u}h=a.length;let v=n;for(;d<h;){const f=a[d++],p=a[d++];try{v=f(v)}catch(_){p.call(this,_);break}}try{u=Fd.call(this,v)}catch(f){return Promise.reject(f)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(e){e=Ii(this.defaults,e);const n=om(e.baseURL,e.url,e.allowAbsoluteUrls);return em(n,e.params,e.paramsSerializer)}};W.forEach(["delete","get","head","options"],function(e){$i.prototype[e]=function(n,i){return this.request(Ii(i||{},{method:e,url:n,data:(i||{}).data}))}});W.forEach(["post","put","patch"],function(e){function n(i){return function(r,s,a){return this.request(Ii(a||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:r,data:s}))}}$i.prototype[e]=n(),$i.prototype[e+"Form"]=n(!0)});let SS=class cm{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(r){n=r});const i=this;this.promise.then(o=>{if(!i._listeners)return;let r=i._listeners.length;for(;r-- >0;)i._listeners[r](o);i._listeners=null}),this.promise.then=o=>{let r;const s=new Promise(a=>{i.subscribe(a),r=a}).then(o);return s.cancel=function(){i.unsubscribe(r)},s},e(function(r,s,a){i.reason||(i.reason=new tr(r,s,a),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=i=>{e.abort(i)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new cm(function(o){e=o}),cancel:e}}};function CS(t){return function(n){return t.apply(null,n)}}function xS(t){return W.isObject(t)&&t.isAxiosError===!0}const hl={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(hl).forEach(([t,e])=>{hl[e]=t});function um(t){const e=new $i(t),n=Bf($i.prototype.request,e);return W.extend(n,$i.prototype,e,{allOwnKeys:!0}),W.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return um(Ii(t,o))},n}const ht=um(er);ht.Axios=$i;ht.CanceledError=tr;ht.CancelToken=SS;ht.isCancel=nm;ht.VERSION=lm;ht.toFormData=ks;ht.AxiosError=Fe;ht.Cancel=ht.CanceledError;ht.all=function(e){return Promise.all(e)};ht.spread=CS;ht.isAxiosError=xS;ht.mergeConfig=Ii;ht.AxiosHeaders=qt;ht.formToJSON=t=>tm(W.isHTMLForm(t)?new FormData(t):t);ht.getAdapter=am.getAdapter;ht.HttpStatusCode=hl;ht.default=ht;const{Axios:rz,AxiosError:sz,CanceledError:az,isCancel:lz,CancelToken:cz,VERSION:uz,all:dz,Cancel:hz,isAxiosError:pz,spread:fz,toFormData:mz,AxiosHeaders:vz,HttpStatusCode:jd,formToJSON:gz,getAdapter:_z,mergeConfig:yz}=ht,dm=new Map,TS={baseURL:"",timeout:1e4};function Nd(t,e){const n=ht.create({...TS,...e});return dm.set(t,n),n}function OS(t="default"){const e=dm.get(t);if(!e)throw new Error(`Instance "${t}" not initialized. Call initInstance() first.`);return e}async function Ee(t,e){const n=t.split("/")[0],i=OS(n);return t=t.replace(n,""),i.request({url:t,...e})}async function $S(t,e){return Ee("__local__/api/v1/comp/check",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function kS(t,e){return Ee("__local__/api/v1/comp/checkCompRepeat",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function AS(t,e){return Ee("__local__/api/v1/comp/compFileHash",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function PS(t,e){return Ee("__local__/api/v1/comp/compFilesOssSignedUrl",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function RS(t,e){return Ee("__local__/api/v1/comp/dep",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function IS(t,e){return Ee("__local__/api/v1/comp/dir",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function MS(t,e){return Ee("__local__/api/v1/comp/download",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function DS(t,e){return Ee("__local__/api/v1/comp/file",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function FS(t,e){return Ee("__local__/api/v1/comp/generateCompJson",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function LS(t,e){return Ee("__local__/api/v1/comp/localCompDetailByPathHash",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function jS(t,e){return Ee("__local__/api/v1/comp/localComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function NS(t,e){return Ee("__local__/api/v1/comp/localCompsByIds",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function US(t,e){return Ee("__local__/api/v1/comp/openCompPathInVscode",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function zS(t){return Ee("__local__/api/v1/comp/packageJson",{method:"POST",...t||{}})}async function VS(t,e){return Ee("__local__/api/v1/comp/submit",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function BS(t,e){return Ee("__local__/api/v1/comp/update",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function HS(t,e){return Ee("__local__/api/v1/comp/updateVersion",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const qS=Object.freeze(Object.defineProperty({__proto__:null,compcontrollerCheck:$S,compcontrollerCheckcomprepeat:kS,compcontrollerCompfilehash:AS,compcontrollerCompfilesosssignedurl:PS,compcontrollerDep:RS,compcontrollerDir:IS,compcontrollerDownload:MS,compcontrollerFile:DS,compcontrollerGeneratecompjson:FS,compcontrollerLocalcompdetailbypathhash:LS,compcontrollerLocalcomps:jS,compcontrollerLocalcompsbyids:NS,compcontrollerOpencomppathinvscode:US,compcontrollerPackagejson:zS,compcontrollerSubmit:VS,compcontrollerUpdate:BS,compcontrollerUpdateversion:HS},Symbol.toStringTag,{value:"Module"}));async function WS(t){return Ee("__local__/api/v1/module/clearPreBuild",{method:"POST",...t||{}})}async function KS(t,e){return Ee("__local__/api/v1/module/preBuild",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function YS(t){return Ee("__local__/api/v1/module/preBuildSize",{method:"POST",...t||{}})}const GS=Object.freeze(Object.defineProperty({__proto__:null,modulecontrollerClearprebuild:WS,modulecontrollerPrebuild:KS,modulecontrollerPrebuildsize:YS},Symbol.toStringTag,{value:"Module"}));async function QS(t,e){return Ee("__local__/api/v1/oss/fileSignUrl",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const XS=Object.freeze(Object.defineProperty({__proto__:null,osscontrollerFilesignurl:QS},Symbol.toStringTag,{value:"Module"}));async function JS(t,e){return Ee("__local__/api/v1/preprocessing/preprocess",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const ZS=Object.freeze(Object.defineProperty({__proto__:null,preprocessingcontrollerPreprocess:JS},Symbol.toStringTag,{value:"Module"}));async function eC(t,e){return Ee("__local__/api/v1/vuefinder/list",{method:"GET",params:{...t},...e||{}})}const tC=Object.freeze(Object.defineProperty({__proto__:null,vuefindercontrollerList:eC},Symbol.toStringTag,{value:"Module"})),nC={v1Comp:qS,v1Module:GS,v1Oss:XS,v1Preprocessing:ZS,v1Vuefinder:tC};async function iC(t,e){return Ee("__remote__/api/v1/comp/checkCompExistByHash",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function oC(t,e){return Ee("__remote__/api/v1/comp/checkCompExistById",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function rC(t,e){return Ee("__remote__/api/v1/comp/checkVersion",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function sC(t,e){return Ee("__remote__/api/v1/comp/collect",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function aC(t,e){return Ee("__remote__/api/v1/comp/collectedComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function lC(t,e){return Ee("__remote__/api/v1/comp/compDetail",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function cC(t,e){return Ee("__remote__/api/v1/comp/compHash",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function uC(t,e){return Ee("__remote__/api/v1/comp/comps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function dC(t,e){return Ee("__remote__/api/v1/comp/compsByIds",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function hC(t,e){return Ee("__remote__/api/v1/comp/deleteFailedComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function pC(t,e){return Ee("__remote__/api/v1/comp/deleteMyComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function fC(t,e){return Ee("__remote__/api/v1/comp/existCompsByIds",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function mC(t,e){return Ee("__remote__/api/v1/comp/myComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function vC(t,e){return Ee("__remote__/api/v1/comp/similarComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function gC(t,e){return Ee("__remote__/api/v1/comp/softDelete",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function _C(t,e){return Ee("__remote__/api/v1/comp/update",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function yC(t,e){return Ee("__remote__/api/v1/comp/updateBasicInfo",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function bC(t,e){return Ee("__remote__/api/v1/comp/updateCompDownloadCount",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function wC(t,e){return Ee("__remote__/api/v1/comp/updateObjectId",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function EC(t,e){return Ee("__remote__/api/v1/comp/upgradeRecords",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function SC(t,e){return Ee("__remote__/api/v1/comp/upload",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function CC(t,e){return Ee("__remote__/api/v1/comp/versions",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const xC=Object.freeze(Object.defineProperty({__proto__:null,compcontrollerCheckcompexistbyhash:iC,compcontrollerCheckcompexistbyid:oC,compcontrollerCheckversion:rC,compcontrollerCollect:sC,compcontrollerCollectedcomps:aC,compcontrollerCompdetail:lC,compcontrollerComphash:cC,compcontrollerComps:uC,compcontrollerCompsbyids:dC,compcontrollerDeletefailedcomp:hC,compcontrollerDeletemycomp:pC,compcontrollerExistcompsbyids:fC,compcontrollerMycomps:mC,compcontrollerSimilarcomps:vC,compcontrollerSoftdelete:gC,compcontrollerUpdate:_C,compcontrollerUpdatebasicinfo:yC,compcontrollerUpdatecompdownloadcount:bC,compcontrollerUpdateobjectid:wC,compcontrollerUpgraderecords:EC,compcontrollerUpload:SC,compcontrollerVersions:CC},Symbol.toStringTag,{value:"Module"}));async function TC(t){return Ee("__remote__/api/v1/csrf/csrf",{method:"GET",...t||{}})}const OC=Object.freeze(Object.defineProperty({__proto__:null,csrfcontrollerGetcsrftoken:TC},Symbol.toStringTag,{value:"Module"}));async function $C(t,e){return Ee("__remote__/api/v1/email/sendCode",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const kC=Object.freeze(Object.defineProperty({__proto__:null,emailcontrollerSendcode:$C},Symbol.toStringTag,{value:"Module"}));async function AC(t,e){return Ee("__remote__/api/v1/keyword/queryKeywordsComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const PC=Object.freeze(Object.defineProperty({__proto__:null,keywordcontrollerQuerykeywordscomp:AC},Symbol.toStringTag,{value:"Module"}));async function RC(t){return Ee("__remote__/api/v1/oss/compOssDir",{method:"POST",...t||{}})}async function IC(t){return Ee("__remote__/api/v1/oss/getSts",{method:"POST",...t||{}})}async function MC(t,e){return Ee("__remote__/api/v1/oss/putPolicy",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const DC=Object.freeze(Object.defineProperty({__proto__:null,osscontrollerCompossdir:RC,osscontrollerGetsts:IC,osscontrollerPutpolicy:MC},Symbol.toStringTag,{value:"Module"}));async function FC(t,e){return Ee("__remote__/api/v1/team/addToTeamMyComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function LC(t){return Ee("__remote__/api/v1/team/allMember",{method:"POST",...t||{}})}async function jC(t,e){return Ee("__remote__/api/v1/team/applyList",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function NC(t,e){return Ee("__remote__/api/v1/team/checkCompUpdatePermission",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function UC(t,e){return Ee("__remote__/api/v1/team/copyComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function zC(t,e){return Ee("__remote__/api/v1/team/create",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function VC(t){return Ee("__remote__/api/v1/team/created",{method:"POST",...t||{}})}async function BC(t,e){return Ee("__remote__/api/v1/team/delete",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function HC(t){return Ee("__remote__/api/v1/team/detail",{method:"POST",...t||{}})}async function qC(t){return Ee("__remote__/api/v1/team/exit",{method:"POST",...t||{}})}async function WC(t,e){return Ee("__remote__/api/v1/team/findByCode",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function KC(t,e){return Ee("__remote__/api/v1/team/handleApply",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function YC(t,e){return Ee("__remote__/api/v1/team/join",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function GC(t){return Ee("__remote__/api/v1/team/joined",{method:"POST",...t||{}})}async function QC(t,e){return Ee("__remote__/api/v1/team/kickOut",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function XC(t,e){return Ee("__remote__/api/v1/team/member",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function JC(t,e){return Ee("__remote__/api/v1/team/myTeamComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function ZC(t,e){return Ee("__remote__/api/v1/team/removeComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function e2(t,e){return Ee("__remote__/api/v1/team/removeMyTeamComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function t2(t,e){return Ee("__remote__/api/v1/team/teamComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function n2(t,e){return Ee("__remote__/api/v1/team/update",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function i2(t,e){return Ee("__remote__/api/v1/team/updateCompCanUpdateUsers",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function o2(t,e){return Ee("__remote__/api/v1/team/updateMenu",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function r2(t,e){return Ee("__remote__/api/v1/team/updateTeamUserNickname",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const s2=Object.freeze(Object.defineProperty({__proto__:null,teamcontrollerAddtoteammycomps:FC,teamcontrollerAllmember:LC,teamcontrollerApplylist:jC,teamcontrollerCheckcompupdatepermission:NC,teamcontrollerCopycomp:UC,teamcontrollerCreate:zC,teamcontrollerCreated:VC,teamcontrollerDelete:BC,teamcontrollerDetail:HC,teamcontrollerExit:qC,teamcontrollerFindbycode:WC,teamcontrollerHandleapply:KC,teamcontrollerJoin:YC,teamcontrollerJoined:GC,teamcontrollerKickout:QC,teamcontrollerMember:XC,teamcontrollerMyteamcomps:JC,teamcontrollerRemovecompfromteam:ZC,teamcontrollerRemovemyteamcomp:e2,teamcontrollerTeamcomps:t2,teamcontrollerUpdate:n2,teamcontrollerUpdatecompcanupdateusers:i2,teamcontrollerUpdatemenu:o2,teamcontrollerUpdateteamusernickname:r2},Symbol.toStringTag,{value:"Module"}));async function a2(t){return Ee("__remote__/api/v1/token/approachExpire",{method:"POST",...t||{}})}async function l2(t){return Ee("__remote__/api/v1/token/refresh",{method:"POST",...t||{}})}const c2=Object.freeze(Object.defineProperty({__proto__:null,tokencontrollerApproachexpire:a2,tokencontrollerRefresh:l2},Symbol.toStringTag,{value:"Module"}));async function u2(t,e){return Ee("__remote__/api/v1/upgrade/check",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function d2(t){return Ee("__remote__/api/v1/upgrade/logs",{method:"POST",...t||{}})}async function h2(t,e){return Ee("__remote__/api/v1/upgrade/publish",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const p2=Object.freeze(Object.defineProperty({__proto__:null,upgradecontrollerCheck:u2,upgradecontrollerLogs:d2,upgradecontrollerPublish:h2},Symbol.toStringTag,{value:"Module"}));async function f2(t,e){return Ee("__remote__/api/v1/user/changeAvatar",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function m2(t,e){return Ee("__remote__/api/v1/user/changeNickname",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function v2(t,e){return Ee("__remote__/api/v1/user/changePassword",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function g2(t){return Ee("__remote__/api/v1/user/checkPassword",{method:"POST",...t||{}})}async function _2(t,e){return Ee("__remote__/api/v1/user/login",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function y2(t,e){return Ee("__remote__/api/v1/user/setAllowEmailLogin",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function b2(t,e){return Ee("__remote__/api/v1/user/updateEmail",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function w2(t){return Ee("__remote__/api/v1/user/userInfo",{method:"POST",...t||{}})}async function E2(t){return Ee("__remote__/api/v1/user/whoAmI",{method:"POST",...t||{}})}const S2=Object.freeze(Object.defineProperty({__proto__:null,usercontrollerChangeavatar:f2,usercontrollerChangenickname:m2,usercontrollerChangepassword:v2,usercontrollerCheckpassword:g2,usercontrollerLogin:_2,usercontrollerSetallowemaillogin:y2,usercontrollerUpdateemail:b2,usercontrollerUserinfo:w2,usercontrollerWhoami:E2},Symbol.toStringTag,{value:"Module"}));async function C2(t,e){return Ee("__remote__/api/v2/upgrade/check",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const x2=Object.freeze(Object.defineProperty({__proto__:null,upgradecontrollerv2Check:C2},Symbol.toStringTag,{value:"Module"})),ki={v1Comp:xC,v1Csrf:OC,v1Email:kC,v1Keyword:PC,v1Oss:DC,v1Team:s2,v1Token:c2,v1Upgrade:p2,v1User:S2,v2Upgrade:x2},T2=vi("personalStore",{state:()=>({userInfo:{},isPasswordSet:!1}),getters:{isAllowEmailLogin(t){return t.userInfo?.isAllowEmailLogin??!1}},actions:{setUserInfo(t){this.$patch(e=>{e.userInfo=t})},setIsPasswordSet(t){this.$patch(e=>{e.isPasswordSet=t})},async initUserInfo(){const t=await ki.v1User.usercontrollerUserinfo();t.code===0&&this.setUserInfo(t.data)},async setEmail(t){this.$patch(e=>{e.userInfo.email=t})},async setNickname(t){this.$patch(e=>{e.userInfo.nickname=t})},async setAllowEmailLogin(t){await ki.v1User.usercontrollerSetallowemaillogin({allow:t}).then(()=>{this.$patch(e=>{e.userInfo.isAllowEmailLogin=t})})}}}),O2=vi("moduleStore",{state:()=>({modules:{}}),actions:{setModules(t,e){this.$patch(n=>{n.modules[t]=e})},async loadModule(t){if(this.modules[t])return this.modules[t];const e=await import(t);return this.setModules(t,e),e}}}),_r=Ji(N0,!0),gc=vi("appStore",{state:()=>({}),getters:{collapse(){return _r.value}},actions:{toggleSideBar(){_r.value=!_r.value},setSideBarCollapse(t){t!==this.collapse&&(_r.value=t)}}}),$2=vi("team",{state:()=>({joinedTeams:[],createdTeams:[]}),actions:{setJoinedTeams(t){this.$patch(e=>{e.joinedTeams=t})},setCreatedTeams(t){this.$patch(e=>{e.createdTeams=t})},removeCreatedTeam(t){this.$patch(e=>{e.createdTeams=e.createdTeams.filter(n=>n._id!==t)})},addCreatedTeam(t){this.$patch(e=>{e.createdTeams.some(i=>i._id===t._id)||e.createdTeams.push(t)})},addJoinedTeam(t){this.$patch(e=>{e.joinedTeams.some(i=>i._id===t._id)||e.joinedTeams.push(t)})},removeJoinedTeam(t){this.$patch(e=>{e.joinedTeams=e.joinedTeams.filter(n=>n._id!==t)})},updateCreatedTeamItemById(t,e){this.$patch(n=>{const i=n.createdTeams.findIndex(o=>o._id===t);i!==-1&&(n.createdTeams[i]=e)})},getTeamDetail(t){return this.joinedTeams.find(n=>n._id===t)||this.createdTeams.find(n=>n._id===t)}}});function yr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)i!=="__proto__"&&(t[i]=n[i])}return t}var k2={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function pl(t,e){function n(o,r,s){if(!(typeof document>"u")){s=yr({},e,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in s)s[l]&&(a+="; "+l,s[l]!==!0&&(a+="="+s[l].split(";")[0]));return document.cookie=o+"="+t.write(r,o)+a}}function i(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var r=document.cookie?document.cookie.split("; "):[],s={},a=0;a<r.length;a++){var l=r[a].split("="),c=l.slice(1).join("=");try{var u=decodeURIComponent(l[0]);if(u in s||(s[u]=t.read(c,u)),o===u)break}catch{}}return o?s[o]:s}}return Object.create({set:n,get:i,remove:function(o,r){n(o,"",yr({},r,{expires:-1}))},withAttributes:function(o){return pl(this.converter,yr({},this.attributes,o))},withConverter:function(o){return pl(yr({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var hm=pl(k2,{path:"/"});const A2={keyword:"关键词",confirm:"确定",cancel:"取消",close:"关闭",save:"保存",submit:"提交",delete:"删除",edit:"编辑",add:"添加",update:"更新",upload:"上传",download:"下载",refresh:"刷新",loadingText:"加载中",success:"成功",error:"错误",warning:"警告",info:"提示",copy:"复制",copied:"已复制",copySuccess:"复制成功",copyFailed:"复制失败",open:"打开",search:"搜索",reset:"重置",clear:"清空",back:"返回",next:"下一步",prev:"上一步",finish:"完成",operation:"操作",status:"状态",yes:"是",no:"否",name:"名称",description:"描述",version:"版本",time:"时间",date:"日期",author:"作者",type:"类型",category:"分类",tag:"标签",content:"内容",setting:"设置",cache:"缓存",cacheSize:"已使用",clearCache:"清空缓存",clearCacheConfirm:"将清空浏览器单文件编译结果以及模块预编译文件,确认清空缓存吗?",cacheCleared:"缓存已清空",newPage:"新页面打开",terminal:"终端",preview:"预览",doc:"文档",readme:"README.md",upgradeRecord:"更新记录",openInNewPage:"新页面打开",depInstall:"依赖安装",fullscreen:"全屏",exitFullscreen:"退出全屏",maximizeRestore:"最大化/还原",siteSlogan:"原子化组件社区,让组件流通更简单。",siteSubtitle:"Vue 组件共享平台",docsTutorial:"文档教程",empty:"暂无数据",noReadme:"组件没有配置README.md文件",dragSort:"拖拽排序",filter:"筛选",apply:"应用",person:"人",unit:"个",pleaseSelect:"请选择",pleaseInput:"请输入",me:"我",generate:"生成",regenerate:"重新生成",generateSuccess:"生成成功",moreOperations:"更多操作",more:"更多",maxTagCount:"最大标签数量"},P2={keywordPlaceholder:"请输入组件名称/描述",title:"组件",name:"组件名称",fieldId:"组件ID",fieldName:"组件名称",fieldVersion:"版本号",desc:"组件描述",remarksDesc:"备注说明",remarksDescRequired:"请输入备注说明",pleaseInputCompName:"请输入组件名称",pleaseInputRemarks:"请输入备注,有助于组件市场检索",compNameRequired:"组件名称不能为空",compNameNamingRule:"组件名只能是「大驼峰(PascalCase)」或「短横线(kebab-case)」命名法",lengthBetween:"长度在 {min} 到 {max} 个字符",version:"组件版本",detail:"组件详情",preview:"组件预览",previewConfig:"预览配置",previewList:"预览列表",uploadPreview:"组件上传预览",updatePreview:"组件更新预览",download:"下载组件",update:"更新组件",upload:"上传组件",submit:"提交组件",edit:"编辑组件",add:"添加组件",delete:"删除组件",local:"本地组件",remote:"远程组件",online:"在线组件",similar:"相似组件",similarTeam:"团队内相似组件",dir:"组件目录",file:"组件文件",entry:"入口文件",previewEntry:"预览入口地址",previewEntryFull:"预览入口地址(全屏窗口)",addPreviewEntry:"添加预览入口",maxPreviewEntry:"最多添加{n}个预览入口",pleaseAddPreviewEntry:"请添加预览入口",miniPreviewFile:"小窗预览文件",fullPreviewFile:"全屏预览文件",pleaseSelectPreviewFile:"请选择预览文件",remarkDesc:"备注说明",dep:"组件依赖",localDep:"组件依赖(本地)",onlineDep:"组件依赖(线上)",finalDep:"最终依赖",localVersion:"本地:",onlineVersion:"线上:",onlineDepEmpty:"线上依赖暂无数据!",versionConsistent:"版本一致",versionChange:"版本变化,请手动选择最终版本",versionChangeConfirmed:"已确认",newDep:"新增依赖",miniPanel:"小窗面板",fullPanel:"全屏面板",reload:"重新加载",uploadProtocol:"组件发布协议",bgPanel:"背景板",compLocation:"组件位置",pleaseSelectFolderFirst:"请先选择文件夹",compAlreadyUploaded:"组件已经上传,更新操作请前往我的组件或团队组件",affirmDep:"组件依赖(确认的版本)",checkConfig:"配置检查",checkError:"报错信息",extraInfo:"附加信息",baseInfo:"基础信息",upgradeLog:"更新说明",pleaseInputUpgradeLog:"请填写更新说明",config:"组件配置",configStatus:"组件配置检查状态",configError:"配置异常",configCheckError:"配置检查报错",needUpgrade:"需要升级",fileChanged:"组件文件有变化",versionChanged:"版本号变化",fileNoChange:"文件没有变化",markdownValid:"Markdown预览校验通过",noMarkdown:"没有md文件",hash:"文件哈希",localHash:"本地组件文件hash",remoteHash:"线上组件文件hash",remoteVersion:"线上组件版本号",remoteVersionPrefix:"线上:",localVersionPrefix:"本地:",versionCompare:"版本号比较结果",carouselIndex:"组件预览走马灯index",bgColor:"组件背景颜色",dialogType:"组件弹窗类型",repeat:"组件重复检查",existLocal:"组件在本地存在",scopeId:"作用域id",tempDir:"组件临时目录",submitLimit:"组件提交限制",maxSize:"总大小限制",maxCount:"文件数量限制",matchType:"匹配类型",updateType:"更新类型",updateOnline:"在线更新",updateOffline:"离线更新",compOfflineUpdate:"组件离线更新",compOnlineUpdate:"组件在线更新",folder:"文件夹",compNotInLocal:"组件不在本地,继续更新只能更新组件描述,预览配置等基础信息,是否继续?",selectUpdateFolder:"请选择要更新的文件夹",openInVscode:"在 VS Code 中打开",openingInEditor:"在编辑器中打开...",updateSuccess:"更新成功",downloadVersionConfirm:"当前选择的版本为:{version},确认下载吗?",downloading:"组件下载中...",downloadPathConfirm:"是否下载组件到【{path}】路径下",downloadCoverConfirm:"组件【{name}】已经下载或者有同名组件,是否覆盖?",uncollectConfirm:"是否取消收藏组件【{name}】,取消收藏后组件将不再显示在收藏列表中,是否继续?",deleteConfirm:"是否删除组件【{name}】,删除组件后会释放占用的组件名称,是否继续?",collect:"收藏",uncollect:"取消收藏",collected:"已收藏",uncollected:"未收藏",entryFile:"入口文件",configFile:"配置文件",fileChangedNeedVersion:"文件内容改变,请增加版本号",viewFileChanges:"查看文件变化",versionChangedButFileSame:"版本号改变,但文件内容未改变,请还原版本号",errorMsg:"错误信息",versionCannotBeLessThanLatest:"版本号不能小于最新版本{version}",uploadAnyway:"仍然上传",compileError:"组件编译失败",compileWarn:"组件编译警告",formatCode:"格式化代码:",formatCodeTooltip:"仅格式化对比时的文件,不会格式化原始文件",noChanges:"暂无变更",diff:{changed:"M 改变",unchanged:"U 未改变",added:"A 新增",deleted:"D 删除"}},R2={title:"团队",name:"团队名称",code:"团队码",desc:"团队描述",create:"创建团队",join:"加入团队",exit:"退出团队",exitConfirm:"退出确认",manage:"团队管理",setting:"团队设置",member:"团队成员",memberCount:"成员数",maxMember:"最大成员数",compCount:"组件数量",maxCompCount:"最大组件数量",creator:"创建者",downloadCount:"下载量",collectCount:"收藏量",createTime:"创建时间",myTeam:"我的团队",joinedTeam:"已加入团队",space:"团队空间",noJoined:"暂无加入的团队",noCreated:"暂无创建的团队",createCountLimit:"最大允许创建的团队数量",joinCountLimit:"允许最多加入的团队数量",compList:"团队组件列表",myCompList:"我的组件",compGroup:"团队组件分组",compGroupList:"团队组件分组列表",addMyComp:"团队添加我的组件",compUpdate:"团队我的组件更新",addFromMine:"去我的组件添加",applyList:"申请列表",nickname:"团队昵称",noTeamInfo:"暂无团队信息",compLib:"组件库",groupConfig:"分组配置",compManage:"组件管理",unsavedDataLeave:"分组配置数据未保存,确定要离开吗?",leave:"离开",disbandTeam:"解散团队",applyAudit:"申请审核",teamName:"团队名称",fillTeamCode:"填写团队码",pleaseInputTeamCode:"请输入团队码",teamIdNotExist:"团队ID不存在",joinSuccess:"加入团队成功",applyJoinTeam:"申请加入团队",showRepeatComp:"展示重复组件",allowAuthorDelete:"作者删除组件权限",teamIntro:"团队介绍",fillTeamName:"填写团队名称",pleaseInputTeamName:"请输入团队名称",pleaseInputTeamDesc:"请输入团队介绍",createSuccess:"创建团队成功",charLength:"长度在 {min} 到 {max} 个字符",disbandConfirm:"确定解散团队吗,解散后所有成员和组件将被移除,并且无法恢复?",deleteConfirm:"删除确认",inputAuthCode:"请输入验证码",disbandSuccess:"解散团队成功",reject:"拒绝",agree:"同意",approved:"已同意",rejected:"已拒绝",kickOut:"踢出",teamUserNickname:"团队内昵称",pleaseInputTeamNickname:"请输入你在团队的昵称",normalUser:"普通用户",kickOutConfirm:"确定踢出用户【{name}】吗?",kickOutSuccess:"踢出成功",selectCanUpdateUser:"选择可更新用户",authorAutoAuth:"作者自带授权",updateAuth:"更新授权",updateTime:"更新时间",expandAll:"展开全部",createGroup:"创建分组",unsaved:"未保存",pleaseInputGroupName:"请输入分组名称",addComp:"添加组件",added:"已添加",notAdded:"未添加",defaultGroup:"默认分组",deleteGroupConfirm:"确认删除该分组吗?删除后该分组下的所有组件将被移除分组",addSuccess:"添加成功",isGrouped:"是否分组",grouped:"已分组",ungrouped:"未分组",group:"分组",prevVersion:"升级前版本",newVersion:"升级后版本",upgradeDesc:"升级描述",similarCompInTeam:"团队内相似组件",similarComp:"相似组件",deleteCompConfirm:"是否删除团队组件【{name}】,删除组件后团队成员将无法使用该组件,是否继续?",descTitle:"为业务团队打造专属组件空间",descItem1:"创建私密团队,组件仅对成员可见,保护核心资产",descItem2:"每个账号最多可创建 {count} 个团队",descItem3:"每个账号最多可加入 {count} 个团队",descItem4:"基础版团队支持最多 {count} 名成员",descItem5:"基础版团队可管理最多 {count} 个组件",descItem6:"支持创建分组菜单,灵活组织团队组件"},I2={title:"用户",username:"用户名",account:"账号",password:"密码",newPassword:"新密码",confirmPassword:"确认密码",confirmNewPassword:"确认新密码",pleaseInputNewPassword:"请输入新密码",pleaseConfirmNewPassword:"请确认新密码",passwordModified:"密码修改成功",email:"邮箱",oldEmail:"旧邮箱",newEmail:"新邮箱",phone:"手机号",avatar:"头像",nickname:"昵称",login:"登录",logout:"退出登录",register:"注册",forgotPassword:"忘记密码",resetPassword:"重置密码",changePassword:"修改密码",changeNickname:"修改昵称",pleaseInputNickname:"请输入昵称",changeAvatar:"修改头像",avatarModified:"头像修改成功",changeEmail:"修改邮箱",basicInfo:"基本信息",securitySettings:"安全设置",loginPassword:"登录密码",passwordTip:"建议定期更换密码,确保账号安全",setPassword:"设置密码",emailLogin:"邮箱登录",emailLoginTip:"允许使用邮箱作为登录账号",pleaseSetPasswordFirst:"请先设置登录密码",emailLoginEnabled:"邮箱登录已开启",emailLoginDisabled:"邮箱登录已关闭",registerTime:"注册时间",notBound:"未绑定",change:"更换",bind:"绑定",authCode:"验证码",oldAuthCode:"旧验证码",newAuthCode:"新验证码",sendAuthCode:"发送验证码",resendAuthCode:"重新发送",getAuthCode:"获取验证码",pleaseInputAuthCode:"请输入验证码",pleaseInputNewAuthCode:"请输入新验证码",resendAfterSeconds:"{n}秒后重新获取",accountLogin:"账号登录",pleaseInputAccount:"请输入账号",pleaseInputUsername:"请输入用户名",pleaseInputPassword:"请输入密码",pleaseInputEmail:"请输入邮箱",pleaseInputOldEmail:"请输入旧邮箱",pleaseInputNewEmail:"请输入新邮箱",pleaseInputCorrectEmail:"请输入正确的邮箱",emailModified:"邮箱修改成功",newAuthCodeSent:"新验证码已发送",authCodeSent:"验证码已发送",skip:"跳过",loginSuccess:"登录成功",userInfo:"用户信息",personalCenter:"个人中心",myComp:"我的组件",notLoggedIn:"未登录",goLogin:"去登录"},M2={title:"文件",name:"文件名",path:"文件路径",size:"文件大小",type:"文件类型",dir:"文件夹",selectDir:"选择文件夹",upload:"文件上传",download:"文件下载",select:"选择",multiSelect:"不支持多选",onlyDir:"只能选择文件夹",rootDir:"根目录",projectPath:"项目路径",currentDir:"当前目录",parentDir:"上级目录",refreshDir:"刷新文件夹列表"},D2={success:{download:"下载成功",update:"更新成功",delete:"删除成功",collect:"收藏成功",uncollect:"取消收藏成功",save:"保存成功",submit:"提交成功",upload:"上传成功",copy:"复制成功",operation:"操作成功",sendAuthCode:"验证码已发送",exitTeam:"退出成功"},error:{download:"下载失败",update:"更新失败",delete:"删除失败",collect:"收藏失败",uncollect:"取消收藏失败",save:"保存失败",submit:"提交失败",upload:"上传失败",copy:"复制失败",operation:"操作失败",load:"加载失败",network:"网络错误",timeout:"请求超时",unknown:"未知错误",pleaseFixCompileError:"请先处理编译错误",loginExpired:"登录已过期,请重新登录",refreshFailed:"刷新失败",requestFailed:"请求失败,请联系管理员",storageNotSupported:"浏览器不支持 storage.estimate API"},noUpdatePermission:"当前组件您没有更新权限,请联系管理员获取权限",confirm:{delete:"确定删除吗?",submit:"确定提交吗?",update:"确定更新吗?",exit:"确定退出吗?",cancel:"确定取消吗?"},loginRequired:"请先登录",fileExceed:"最多只能选择 {limit} 个文件,本次已选择 {selected} 个,共将上传 {total} 个文件",validate:{required:"必填项",format:"格式不正确",min:"不能小于最小值",max:"不能超过最大值",length:"长度不正确",email:"邮箱格式不正确",phone:"手机号格式不正确",imageFormat:"上传文件只能是图片格式",pleaseSelectFile:"请先选择文件",fileMaxSize:"上传文件大小不能超过 {size}MB!"}},F2={404:"页面不存在",share:"组件市场",collect:"收藏组件",collectSimple:"收藏",mine:"我的组件",mineSimple:"我的",local:"本地组件",localSimple:"本地",team:"团队",upload:"上传组件",uploadSimple:"上传",uploadTeam:"上传团队组件",setting:"设置",userInfo:"用户信息",upgrade:"更新",terminal:"终端",preview:"组件预览",previewLocal:"本地组件预览",previewTeam:"团队组件预览",previewBlank:"预览",similarPreview:"相似组件预览",login:"登录",mdPreview:"文档预览",unknownTag:"未知标签"},L2={parse:"解析 Markdown",loading:"加载 Markdown",error:"加载失败",toc:"目录",anchor:"锚点"},j2={title:"终端",open:"打开终端",close:"关闭终端",execute:"执行命令",shutdown:"关闭进程",timeout:"超时时间",disconnected:"终端已断开连接"},N2={title:"依赖",name:"依赖名称",version:"依赖版本",install:"安装依赖",installing:"安装中",installed:"已安装",prebuild:"预构建",prebuildSize:"预构建大小",clearPrebuild:"清空预构建",batchSetting:"批量设置",dependencies:"dependencies",devDependencies:"devDependencies",match:{onlyInstall:"仅安装",majorVersion:"主版本",minorVersion:"主次版本",exactVersion:"完全一致"}},U2={title:"设置",previewRule:"预览规则",other:"其他设置",theme:"主题",language:"语言",darkMode:"暗黑模式",lightMode:"明亮模式"},z2={title:"版本更新",current:"当前版本",latest:"最新版本",check:"检查更新",upgrading:"更新中",upgraded:"已更新",publish:"发布更新",record:"更新记录",log:"更新日志",hasUpdate:"有更新",betaVersion:"内测版",noUpdate:"暂无更新",updateMethod:"更新方式",openTerminalAndRun:"打开终端,执行以下命令:",cannotIgnoreUpdate:"不可忽略此次更新"},V2={systemRecommended:"系统推荐",all:"全部",latest:"最新",hottest:"最热"},B2={submit:"提交"},H2={empty:"不能为空",notString:"必须是字符串类型,当前类型为: {type}",contentEmpty:"内容不能为空",startsWithNumber:'内容不能以数字开头,当前以 "{char}" 开头',invalidCharBacktick:"内容包含反引号(Markdown 语法标记),特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharNewline:"内容包含换行符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharCarriageReturn:"内容包含回车符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharTab:"内容包含制表符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharFormFeed:"内容包含换页符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharVerticalTab:"内容包含垂直制表符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharHash:"内容包含 # 字符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharHtmlSpecial:'内容包含 HTML 特殊字符 "{char}",特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格',invalidCharUnknown:'内容包含非法字符 "{char}"(Unicode: U+{code}),特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格'},q2={openInEditor:"在编辑器中打开",current:"当前",noRegistered:"暂无已注册项目",deregisterTitle:"注销项目",deregisterConfirm:"确定要注销项目 {hash} ({cwd}) 吗?",deregisterSuccess:"已注销项目 {hash}",deregisterFailed:"注销失败"},W2={common:A2,comp:P2,team:R2,user:I2,file:M2,message:D2,route:F2,markdown:L2,terminal:j2,deps:N2,setting:U2,upgrade:z2,tag:V2,formCreate:B2,validateHash:H2,project:q2},K2={keyword:"Keyword",confirm:"Confirm",cancel:"Cancel",close:"Close",save:"Save",submit:"Submit",delete:"Delete",edit:"Edit",add:"Add",update:"Update",upload:"Upload",download:"Download",refresh:"Refresh",loadingText:"Loading",success:"Success",error:"Error",warning:"Warning",info:"Info",copy:"Copy",copied:"Copied",copySuccess:"Copy successful",copyFailed:"Copy failed",open:"Open",search:"Search",reset:"Reset",clear:"Clear",back:"Back",next:"Next",prev:"Previous",finish:"Finish",operation:"Operation",status:"Status",yes:"Yes",no:"No",name:"Name",description:"Description",version:"Version",time:"Time",date:"Date",author:"Author",type:"Type",category:"Category",tag:"Tag",content:"Content",setting:"Setting",cache:"Cache",cacheSize:"Used",clearCache:"Clear Cache",clearCacheConfirm:"This will clear browser single-file compilation results and module pre-compilation files. Confirm to clear cache?",cacheCleared:"Cache cleared",newPage:"Open in new page",terminal:"Terminal",preview:"Preview",doc:"Documentation",readme:"README.md",upgradeRecord:"Update Record",openInNewPage:"Open in new page",depInstall:"Dependency Installation",fullscreen:"Fullscreen",exitFullscreen:"Exit Fullscreen",maximizeRestore:"Maximize/Restore",siteSlogan:"Atomic Component Community, Making Component Sharing Easier.",siteSubtitle:"Vue Component Sharing Platform",docsTutorial:"Documentation",empty:"No data",noReadme:"Component has no README.md file configured",dragSort:"Drag to sort",filter:"Filter",apply:"Apply",person:"people",unit:"items",pleaseSelect:"Please select",pleaseInput:"Please input",me:"Me",generate:"Generate",regenerate:"Regenerate",generateSuccess:"Generated successfully",moreOperations:"More Operations",more:"More",maxTagCount:"Max Tag Count"},Y2={keywordPlaceholder:"Please input component name or description",title:"Component",name:"Component Name",fieldId:"Component ID",fieldName:"Component Name",fieldVersion:"Version",desc:"Component Description",remarksDesc:"Remarks",remarksDescRequired:"Please enter remarks",pleaseInputCompName:"Please enter component name",pleaseInputRemarks:"Please enter remarks to help with component market search",compNameRequired:"Component name is required",compNameNamingRule:"Component name must be in PascalCase or kebab-case",lengthBetween:"Length must be between {min} and {max} characters",version:"Component Version",detail:"Component Detail",preview:"Component Preview",previewConfig:"Preview Config",previewList:"Preview List",uploadPreview:"Component Upload Preview",updatePreview:"Component Update Preview",download:"Download Component",update:"Update Component",upload:"Upload Component",submit:"Submit Component",edit:"Edit Component",add:"Add Component",delete:"Delete Component",local:"Local Component",remote:"Remote Component",online:"Online Component",similar:"Similar Components",similarTeam:"Similar Components in Team",dir:"Component Directory",file:"Component File",entry:"Entry File",previewEntry:"Preview Entry Address",previewEntryFull:"Preview Entry Address (Fullscreen)",addPreviewEntry:"Add Preview Entry",maxPreviewEntry:"Maximum {n} preview entries allowed",pleaseAddPreviewEntry:"Please add a preview entry",miniPreviewFile:"Mini Preview File",fullPreviewFile:"Full Preview File",pleaseSelectPreviewFile:"Please select preview file",remarkDesc:"Remarks",dep:"Component Dependencies",localDep:"Component Dependencies (Local)",onlineDep:"Component Dependencies (Online)",finalDep:"Final Dependencies",localVersion:"Local: ",onlineVersion:"Online: ",onlineDepEmpty:"No online dependency data!",versionConsistent:"Version Consistent",versionChange:"Version changed, please select final version",versionChangeConfirmed:"Confirmed",newDep:"New Dependency",miniPanel:"Mini Panel",fullPanel:"Full Panel",reload:"Reload",uploadProtocol:"Upload Protocol",bgPanel:"Background",compLocation:"Component Location",pleaseSelectFolderFirst:"Please select a folder first",compAlreadyUploaded:"Component already uploaded, please go to My Components or Team Components to update",affirmDep:"Component Dependencies (Confirmed Version)",checkConfig:"Config Check",checkError:"Error Info",extraInfo:"Extra Info",baseInfo:"Basic Info",upgradeLog:"Upgrade Log",pleaseInputUpgradeLog:"Please enter upgrade description",config:"Component Config",configStatus:"Component Config Check Status",configError:"Config Error",configCheckError:"Config Check Error",needUpgrade:"Needs Upgrade",fileChanged:"Component files changed",versionChanged:"Version changed",fileNoChange:"Files unchanged",markdownValid:"Markdown preview validation passed",noMarkdown:"No markdown file",hash:"File Hash",localHash:"Local Component File Hash",remoteHash:"Remote Component File Hash",remoteVersion:"Remote Component Version",remoteVersionPrefix:"Online: ",localVersionPrefix:"Local: ",versionCompare:"Version Comparison Result",carouselIndex:"Component Preview Carousel Index",bgColor:"Component Background Color",dialogType:"Component Dialog Type",repeat:"Component Repeat Check",existLocal:"Component exists locally",scopeId:"Scope ID",tempDir:"Component Temp Directory",submitLimit:"Component Submit Limit",maxSize:"Total Size Limit",maxCount:"File Count Limit",matchType:"Match Type",updateType:"Update Type",updateOnline:"Online Update",updateOffline:"Offline Update",compOfflineUpdate:"Component Offline Update",compOnlineUpdate:"Component Online Update",folder:"Folder",compNotInLocal:"Component is not local. Continuing will only update basic information like description and preview config. Continue?",selectUpdateFolder:"Please select folder to update",openInVscode:"Open in VS Code",openingInEditor:"Opening in editor...",updateSuccess:"Update successful",downloadVersionConfirm:"The currently selected version is: {version}, confirm download?",downloading:"Downloading component...",downloadPathConfirm:"Download component to path [{path}]?",downloadCoverConfirm:"Component [{name}] already exists or has a duplicate name, overwrite?",uncollectConfirm:"Are you sure you want to uncollect component [{name}]? It will no longer appear in your collection list.",deleteConfirm:"Are you sure you want to delete component [{name}]? This will free up the component name and cannot be undone.",collect:"Collect",uncollect:"Uncollect",collected:"Collected",uncollected:"Not Collected",entryFile:"Entry File",configFile:"Config File",fileChangedNeedVersion:"File content changed, please increment version",viewFileChanges:"View File Changes",versionChangedButFileSame:"Version changed but file content unchanged, please revert version",errorMsg:"Error Message",versionCannotBeLessThanLatest:"Version cannot be less than latest version {version}",uploadAnyway:"Upload Anyway",compileError:"Component compilation failed",compileWarn:"Component compilation warning",formatCode:"Format Code:",formatCodeTooltip:"Only formats files during comparison, original files remain unchanged",noChanges:"No changes",diff:{changed:"M Changed",unchanged:"U Unchanged",added:"A Added",deleted:"D Deleted"}},G2={title:"Team",name:"Team Name",code:"Team Code",desc:"Team Description",create:"Create Team",join:"Join Team",exit:"Exit Team",exitConfirm:"Exit Confirmation",manage:"Team Management",setting:"Team Settings",member:"Team Members",memberCount:"Member Count",maxMember:"Max Members",compCount:"Component Count",maxCompCount:"Max Components",creator:"Creator",downloadCount:"Downloads",collectCount:"Collections",createTime:"Create Time",myTeam:"My Teams",joinedTeam:"Joined Teams",space:"Team Space",noJoined:"No joined teams",noCreated:"No created teams",createCountLimit:"Max teams allowed to create",joinCountLimit:"Max teams allowed to join",compList:"Team Component List",myCompList:"My Component List",compGroup:"Team Component Group",compGroupList:"Team Component Group List",addMyComp:"Team Add My Component",compUpdate:"Team My Component Update",addFromMine:"Add from My Components",applyList:"Apply List",nickname:"Team Nickname",noTeamInfo:"No team information",compLib:"Component Library",groupConfig:"Group Config",compManage:"Component Management",unsavedDataLeave:"Group configuration data is not saved, are you sure you want to leave?",leave:"Leave",disbandTeam:"Disband Team",applyAudit:"Apply Audit",teamName:"Team Name",fillTeamCode:"Fill in Team Code",pleaseInputTeamCode:"Please enter team code",teamIdNotExist:"Team ID does not exist",joinSuccess:"Joined team successfully",applyJoinTeam:"Apply to Join Team",showRepeatComp:"Show Duplicate Components",allowAuthorDelete:"Allow Author Delete",teamIntro:"Team Introduction",fillTeamName:"Fill in Team Name",pleaseInputTeamName:"Please enter team name",pleaseInputTeamDesc:"Please enter team description",createSuccess:"Team created successfully",charLength:"Length must be between {min} and {max} characters",disbandConfirm:"Are you sure you want to disband the team? All members and components will be removed and cannot be recovered.",deleteConfirm:"Delete Confirmation",inputAuthCode:"Please enter verification code",disbandSuccess:"Team disbanded successfully",reject:"Reject",agree:"Agree",approved:"Approved",rejected:"Rejected",kickOut:"Kick Out",teamUserNickname:"Team Nickname",pleaseInputTeamNickname:"Please enter your team nickname",normalUser:"Normal User",kickOutConfirm:"Are you sure you want to kick out user [{name}]?",kickOutSuccess:"Kicked out successfully",selectCanUpdateUser:"Select users who can update",authorAutoAuth:"Author has default authorization",updateAuth:"Update Authorization",updateTime:"Update Time",expandAll:"Expand All",createGroup:"Create Group",unsaved:"Unsaved",pleaseInputGroupName:"Please enter group name",addComp:"Add Component",added:"Added",notAdded:"Not Added",defaultGroup:"Default Group",deleteGroupConfirm:"Are you sure you want to delete this group? All components in this group will be removed from the group.",addSuccess:"Added successfully",isGrouped:"Is Grouped",grouped:"Grouped",ungrouped:"Ungrouped",group:"Group",prevVersion:"Previous Version",newVersion:"New Version",upgradeDesc:"Upgrade Description",similarCompInTeam:"Similar Components in Team",similarComp:"Similar Components",deleteCompConfirm:"Are you sure you want to delete team component [{name}]? Team members will no longer be able to use this component.",descTitle:"Create an Exclusive Component Space for Your Team",descItem1:"Create a private team where components are only visible to members, protecting core assets",descItem2:"Each account can create up to {count} teams",descItem3:"Each account can join up to {count} teams",descItem4:"Basic team supports up to {count} members",descItem5:"Basic team can manage up to {count} components",descItem6:"Support creating group menus to organize team components flexibly"},Q2={title:"User",username:"Username",account:"Account",password:"Password",newPassword:"New Password",confirmPassword:"Confirm Password",confirmNewPassword:"Confirm New Password",pleaseInputNewPassword:"Please enter new password",pleaseConfirmNewPassword:"Please confirm new password",passwordModified:"Password modified successfully",email:"Email",oldEmail:"Old Email",newEmail:"New Email",phone:"Phone",avatar:"Avatar",nickname:"Nickname",login:"Login",logout:"Logout",register:"Register",forgotPassword:"Forgot Password",resetPassword:"Reset Password",changePassword:"Change Password",changeNickname:"Change Nickname",pleaseInputNickname:"Please enter nickname",changeAvatar:"Change Avatar",avatarModified:"Avatar updated successfully",changeEmail:"Change Email",basicInfo:"Basic Information",securitySettings:"Security Settings",loginPassword:"Login Password",passwordTip:"Regularly change your password to ensure account security",setPassword:"Set Password",emailLogin:"Email Login",emailLoginTip:"Allow using email as login account",pleaseSetPasswordFirst:"Please set login password first",emailLoginEnabled:"Email login enabled",emailLoginDisabled:"Email login disabled",registerTime:"Registration Time",notBound:"Not Bound",change:"Change",bind:"Bind",authCode:"Verification Code",oldAuthCode:"Old Verification Code",newAuthCode:"New Verification Code",sendAuthCode:"Send Auth Code",resendAuthCode:"Resend",getAuthCode:"Get Code",pleaseInputAuthCode:"Please enter code",pleaseInputNewAuthCode:"Please enter new code",resendAfterSeconds:"Resend in {n}s",accountLogin:"Account Login",pleaseInputAccount:"Please enter account",pleaseInputUsername:"Please enter username",pleaseInputPassword:"Please enter password",pleaseInputEmail:"Please enter email",pleaseInputOldEmail:"Please enter old email",pleaseInputNewEmail:"Please enter new email",pleaseInputCorrectEmail:"Please enter correct email",emailModified:"Email modified successfully",newAuthCodeSent:"New verification code sent",authCodeSent:"Verification code sent",skip:"Skip",loginSuccess:"Login successful",userInfo:"User Info",personalCenter:"Personal Center",myComp:"My Components",notLoggedIn:"Not logged in",goLogin:"Go to Login"},X2={title:"File",name:"Filename",path:"File Path",size:"File Size",type:"File Type",dir:"Directory",selectDir:"Select Directory",upload:"File Upload",download:"File Download",select:"Select",multiSelect:"Multiple selection not supported",onlyDir:"Only directories can be selected",rootDir:"Root Directory",projectPath:"Project Path",currentDir:"Current Directory",parentDir:"Parent Directory",refreshDir:"Refresh Directory List"},J2={success:{download:"Download successful",update:"Update successful",delete:"Delete successful",collect:"Collect successful",uncollect:"Uncollect successful",save:"Save successful",submit:"Submit successful",upload:"Upload successful",copy:"Copy successful",operation:"Operation successful",sendAuthCode:"Verification code sent",exitTeam:"Exit successful"},error:{download:"Download failed",update:"Update failed",delete:"Delete failed",collect:"Collect failed",uncollect:"Uncollect failed",save:"Save failed",submit:"Submit failed",upload:"Upload failed",copy:"Copy failed",operation:"Operation failed",load:"Load failed",network:"Network error",timeout:"Request timeout",unknown:"Unknown error",pleaseFixCompileError:"Please fix compilation errors first",loginExpired:"Login expired, please log in again",refreshFailed:"Refresh failed",requestFailed:"Request failed, please contact administrator",storageNotSupported:"Browser does not support storage.estimate API"},noUpdatePermission:"You do not have permission to update this component. Please contact the administrator for access.",confirm:{delete:"Are you sure to delete?",submit:"Are you sure to submit?",update:"Are you sure to update?",exit:"Are you sure to exit?",cancel:"Are you sure to cancel?"},loginRequired:"Please login first",fileExceed:"You can select at most {limit} files, {selected} selected this time, {total} total to be uploaded",validate:{required:"Required field",format:"Invalid format",min:"Cannot be less than minimum value",max:"Cannot exceed maximum value",length:"Invalid length",email:"Invalid email format",phone:"Invalid phone format",imageFormat:"Only image files are allowed",pleaseSelectFile:"Please select a file first",fileMaxSize:"File size cannot exceed {size}MB!"}},Z2={404:"Page Not Found",share:"Component Market",collect:"Collected Components",collectSimple:"Collection",mine:"My Components",mineSimple:"Mine",local:"Local Components",localSimple:"Local",team:"Team",upload:"Upload Component",uploadSimple:"Upload",uploadTeam:"Upload Team Component",setting:"Settings",userInfo:"User Info",upgrade:"Upgrade",terminal:"Terminal",preview:"Component Preview",previewLocal:"Local Component Preview",previewTeam:"Team Component Preview",previewBlank:"Preview",similarPreview:"Similar Component Preview",login:"Login",mdPreview:"Document Preview",unknownTag:"Unknown Tag"},ex={parse:"Parse Markdown",loading:"Loading Markdown",error:"Load failed",toc:"Table of Contents",anchor:"Anchor"},tx={title:"Terminal",open:"Open Terminal",close:"Close Terminal",execute:"Execute Command",shutdown:"Shutdown Process",timeout:"Timeout",disconnected:"Terminal disconnected"},nx={title:"Dependencies",name:"Dependency Name",version:"Dependency Version",install:"Install Dependencies",installing:"Installing",installed:"Installed",prebuild:"Prebuild",prebuildSize:"Prebuild Size",clearPrebuild:"Clear Prebuild",batchSetting:"Batch Setting",dependencies:"dependencies",devDependencies:"devDependencies",match:{onlyInstall:"Install Only",majorVersion:"Major Version",minorVersion:"Major + Minor",exactVersion:"Exact Match"}},ix={title:"Settings",previewRule:"Preview Rule",other:"Other Settings",theme:"Theme",language:"Language",darkMode:"Dark Mode",lightMode:"Light Mode"},ox={title:"Version Update",current:"Current Version",latest:"Latest Version",check:"Check for Updates",upgrading:"Updating",upgraded:"Updated",publish:"Publish Update",record:"Update Record",log:"Changelog",hasUpdate:"Update Available",betaVersion:"Beta",noUpdate:"No updates available",updateMethod:"Update Method",openTerminalAndRun:"Open terminal and run:",cannotIgnoreUpdate:"This update cannot be ignored"},rx={systemRecommended:"System Recommended",all:"All",latest:"Latest",hottest:"Hottest"},sx={submit:"Submit"},ax={empty:"Cannot be empty",notString:"Must be a string type, current type: {type}",contentEmpty:"Content cannot be empty",startsWithNumber:'Content cannot start with a number, currently starts with "{char}"',invalidCharBacktick:"Content contains backtick (Markdown syntax marker), only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharNewline:"Content contains newline character, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharCarriageReturn:"Content contains carriage return, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharTab:"Content contains tab character, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharFormFeed:"Content contains form feed character, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharVerticalTab:"Content contains vertical tab character, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharHash:"Content contains # character, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharHtmlSpecial:'Content contains HTML special character "{char}", only hyphen(-), underscore(_), parentheses(), and spaces are allowed',invalidCharUnknown:'Content contains invalid character "{char}" (Unicode: U+{code}), only hyphen(-), underscore(_), parentheses(), and spaces are allowed'},lx={openInEditor:"Open in Editor",current:"Current",noRegistered:"No registered projects",deregisterTitle:"Deregister Project",deregisterConfirm:"Are you sure you want to deregister project {hash} ({cwd})?",deregisterSuccess:"Deregistered project {hash}",deregisterFailed:"Deregister failed"},cx={common:K2,comp:Y2,team:G2,user:Q2,file:X2,message:J2,route:Z2,markdown:ex,terminal:tx,deps:nx,setting:ix,upgrade:ox,tag:rx,formCreate:sx,validateHash:ax,project:lx},ux={zh:W2,en:cx},dx=localStorage.getItem(Cb.LOCALE_KEY)||"zh",pm=f_({locale:dx,messages:ux,legacy:!1});function fm(t){t.use(pm)}const _c=Object.freeze(Object.defineProperty({__proto__:null,i18n:pm,setup:fm},Symbol.toStringTag,{value:"Module"}));function hx({store:t}){t.$subscribe((...e)=>{const[n]=e;if(n.type==="direct")throw new Error("不允许直接修改store,建议使用action修改")})}const fl=m_();function mm(t){fl.use(hx),t.use(fl)}const px=Object.freeze(Object.defineProperty({__proto__:null,pinia:fl,setup:mm},Symbol.toStringTag,{value:"Module"}));function fx(t){t.component("Icon",Yw)}const{i18n:br}=_c,{pinia:la}=px,Qi=vi("userStore",{state:()=>({userInfo:{},logoutDialogOpen:!1}),getters:{userId:t=>t.userInfo._id,displayName(t){return t.userInfo.nickname||t.userInfo.account||br.global.t("user.notLoggedIn")},avatar:t=>t.userInfo.avatar,avatarStr(t){return t.userInfo.nickname?.[0]||t.userInfo.account?.[0]||""}},actions:{async fetchCsrfToken(){hm.get(bt.CSRF_KEY)||await ki.v1Csrf.csrfcontrollerGetcsrftoken()},updateAvatar(t){this.$patch(e=>{e.userInfo&&(e.userInfo.avatar=t)})},updateNickname(t){this.$patch(e=>{e.userInfo&&(e.userInfo.nickname=t)})},setLogoutDialogOpen(t){this.$patch(e=>{e.logoutDialogOpen=t})},setUserInfo(t){this.$patch(e=>{e.userInfo=t})},login(t){return ki.v1User.usercontrollerLogin({...t})},async fetchWhoAmI(){const t=await ki.v1User.usercontrollerWhoami();t.data&&this.setUserInfo(t.data)},logout(){no.push("/login?type=logout").then(t=>{t||(this.clearLocalStorage(),this.resetAll(),this.$reset())})},resetAll(){const t=Qo(),e=T2(),n=O2(),i=gc(),o=$2();t?.$reset(),e?.$reset(),n?.$reset(),i?.$reset(),o?.$reset(),this.clearTeamHomeStores(),this.clearCompListStores(),this.clearCompEditStore()},clearLocalStorage(){D0(),j0()},clearTeamHomeStores(){for(const[t,e]of la._s.entries())t.startsWith("teamHome")&&e.$reset()},clearCompListStores(){for(const[t,e]of la._s.entries())t.startsWith("compList")&&e.$reset()},clearCompEditStore(){for(const[t,e]of la._s.entries())t.startsWith("compEdit")&&e.$reset()},isRealUserLogin(){const t=Object.keys(this.userInfo),e=is();return t.length>0&&e!==null},isAccessTokenExist(){return is()!==null},logoutDialog(){if(this.logoutDialogOpen)return;this.setLogoutDialogOpen(!0);const t={confirmButtonText:br.global.t("user.goLogin"),showClose:!0,callback:e=>{this.setLogoutDialogOpen(!1),e==="confirm"&&this.logout()}};K_.alert(br.global.t("message.loginRequired"),br.global.t("common.info"),t)}}}),mx=Se({__name:"SubMenu",props:{route:{},basePath:{}},setup(t){const{getTitle:e}=hc(),n=t,i=Qi(),o=(c,u="")=>V1.resolve(c,u),r=te(()=>o(n.basePath||"",n.route.path)),s=te(()=>(n.route.children||[]).some(c=>!c.meta?.hidden)),a=te(()=>{const{children:c=[]}=n.route;return c.length===0||c.length===1&&!c[0]?.children?.length}),l=te(()=>{const{children:c=[],meta:u={}}=n.route;return u?.hidden?!1:i.isRealUserLogin()||c.length>0?!0:!i.isAccessTokenExist()&&n.route.meta?.noAuth});return(c,u)=>{const d=ze("SubMenu",!0),h=Ao,v=Y_;return l.value?(y(),T(Ie,{key:0},[t.route.meta?.hideParent&&s.value?(y(!0),T(Ie,{key:0},He(t.route.children,f=>(y(),ne(d,{key:o(r.value,f.path),route:f,"base-path":o(r.value,f.path)},null,8,["route","base-path"]))),128)):(y(),T(Ie,{key:1},[a.value?(y(),ne(H1,{key:0,route:t.route,"full-path":r.value},null,8,["route","full-path"])):(y(),ne(v,{key:1,index:r.value},{title:we(()=>[j(h,null,{default:we(()=>[(y(),ne(Ot(t.route?.meta?.icon)))]),_:1}),g("span",null,L(m(e)(t.route?.meta?.title)),1)]),default:we(()=>[(y(!0),T(Ie,null,He(t.route.children,f=>(y(),ne(d,{key:o(r.value,f.path),route:f,"base-path":o(r.value,f.path)},null,8,["route","base-path"]))),128))]),_:1},8,["index"]))],64))],64)):ue("",!0)}}}),vx=Se({__name:"index",setup(t){const e=gc(),n=_s(),i=tc(),o=te(()=>n.options.routes),r=te(()=>i.path);return(s,a)=>{const l=G_;return y(),ne(l,{class:"dark:!bg-gray-800 border-t border-gray-200 dark:border-gray-700",collapse:m(e).collapse,"default-active":r.value},{default:we(()=>[(y(!0),T(Ie,null,He(o.value,c=>(y(),T(Ie,null,[c?.meta?.hidden?ue("",!0):(y(),ne(mx,{key:c.path,basePath:c.path,route:c},null,8,["basePath","route"]))],64))),256))]),_:1},8,["collapse","default-active"])}}}),gx={class:"flex gap-[20px] items-center pl-[10px] pr-[10px]"},_x=["title"],yx=["title"],bx=["title"],wx={class:"flex items-center gap-[10px]"},Ex=Se({__name:"index",setup(t){const{t:e}=Ko(),n=Qo(),i=_s(),o=tc(),r=Ji(wf,10),s=H(n.maxCache),a=()=>{i.back()},l=()=>{i.replace({path:o.path,query:{...o.query,[bt.ROUTE_STATE_KEY_VERSION]:Date.now()}})};function c(u){u&&n.setMaxCache(u)}return Nt(()=>{r.value=n.maxCache}),(u,d)=>{const h=ze("Icon"),v=nl,f=tl;return y(),T("div",gx,[g("span",{title:m(e)("common.back")},[j(h,{icon:"material-symbols:arrow-back-rounded",class:"cursor-pointer",onClick:a})],8,_x),g("span",{title:m(e)("common.refresh")},[j(h,{icon:"material-symbols:refresh-rounded",class:"cursor-pointer",onClick:l})],8,yx),j(f,{placement:"bottom",trigger:"hover",width:"auto"},{reference:we(()=>[g("span",{title:m(e)("common.moreOperations")},[j(h,{icon:"material-symbols:article-outline",class:"cursor-pointer"})],8,bx)]),default:we(()=>[g("div",wx,[g("div",null,L(m(e)("common.maxTagCount"))+":",1),g("div",null,[j(v,{modelValue:s.value,"onUpdate:modelValue":d[0]||(d[0]=p=>s.value=p),min:1,style:{width:"90px"},"controls-position":"right",onChange:c},null,8,["modelValue"])])])]),_:1})])}}}),Sx={class:"flex dark:bg-gray-800 py-[2px] h-[40px] border border-gray-200 dark:border-gray-700"},Cx=Se({__name:"index",setup(t){const{t:e}=Ko(),n=_s(),i=tc(),o=Qo(),{getTitle:r}=hc();Oe(()=>i,()=>{o.addView(i)},{immediate:!0,deep:!0});const s=te(()=>o.visitedViews),a=te(()=>s.value.length===1);function l(h){const v=c(h);o.delViewAndJumpToPrev(h.path,v,n)}function c(h){return h.path===i.path}function u(h){n.push(h)}function d(h){const v=h?.meta?.title||e("route.unknownTag"),f=o.getPayLoad(h.path);return r(f?.name||v)}return(h,v)=>{const f=ze("Icon"),p=Ao,_=Gi,S=Q_;return y(),T("div",Sx,[j(Ex),j(m(G0),{class:"flex-1 overflow-hidden",list:s.value,getKey:w=>w.path},{display:we(({visibleList:w,overflow:E})=>[j(v_,{tag:"ul",name:"fade",class:"flex gap-[5px] p-[2px] items-center"},{default:we(()=>[(y(!0),T(Ie,null,He(w,b=>(y(),T("div",{key:b.path},[j(_,{type:c(b)?"primary":"default",onClick:C=>u(b)},{default:we(()=>[Ke(L(d(b))+" ",1),a.value?ue("",!0):(y(),ne(p,{key:0,style:{"font-size":"16px"},class:"ml-[5px]",onClick:Ye(C=>l(b),["stop"])},{default:we(()=>[j(f,{icon:"material-symbols:close"})]),_:1},8,["onClick"]))]),_:2},1032,["type","onClick"])]))),128)),E>0?(y(),ne(S,{key:0,type:"info"},{default:we(()=>[Ke("+"+L(E)+" "+L(m(e)("common.more")),1)]),_:2},1024)):ue("",!0)]),_:2},1024)]),measure:we(({item:w})=>[j(_,{type:"primary"},{default:we(()=>[Ke(L(d(w))+" ",1),a.value?ue("",!0):(y(),ne(p,{key:0,style:{"font-size":"16px"},class:"ml-[5px]"},{default:we(()=>[j(f,{icon:"material-symbols:close"})]),_:1}))]),_:2},1024)]),_:1},8,["list","getKey"])])}}}),xx=rc(Cx,[["__scopeId","data-v-8b93a5e3"]]),Tx={class:"size-full overflow-hidden"},Ox={class:"h-[60px] dark:bg-gray-800"},$x={class:"size-full overflow-hidden flex flex-col dark:bg-gray-800"},kx={class:"dark:bg-gray-800"},Ax={class:"size-full flex flex-col"},Px={class:""},Rx={class:"flex-1 overflow-auto"},Ix=Se({__name:"index",setup(t){const e=qn(()=>nt(()=>import("./index-RcR0UXkh.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)),n=qn(()=>nt(()=>import("./index-DbmFA7Z2.js"),__vite__mapDeps([8,1,2,9,10,11,12,13,14,15,16,17,18,6]),import.meta.url)),i=H(68),o=H(200),r=H(60),s=H(""),a=H(""),l=te(()=>s.value?"transition-width duration-400":""),c=te(()=>a.value?"transition-height duration-300":""),u=te(()=>({class:c.value,size:v.value,collapsible:!0,resizable:!1})),d=te(()=>({class:l.value,min:i.value,max:300,collapsible:!0})),h=Ji(U0,i.value),v=Ji(z0,r.value),f=gc(),p=Qi(),_=async(E,b)=>{s.value=b,b==="end"&&h.value===0?(h.value=o.value,window?.umami?.track(nd.SIDEBAR_TOGGLE,{state:"expanded"})):b==="start"&&window?.umami?.track(nd.SIDEBAR_TOGGLE,{state:"collapsed"})},S=(E,b)=>{a.value=b,b==="start"?v.value=0:b==="end"&&(v.value=r.value)},w=E=>{E==="header"?a.value="":E==="side"&&(s.value="")};return Nt(()=>{f.setSideBarCollapse(h.value===i.value)}),(E,b)=>{const C=X_,x=Z_,k=J_;return y(),T("div",Tx,[j(k,{layout:"vertical",onCollapse:S},{default:we(()=>[j(C,We({class:"!overflow-hidden transform-gpu isolate will-change-height"},u.value,{onTransitionend:b[0]||(b[0]=O=>w("header")),onWebkitTransitionEnd:b[1]||(b[1]=O=>w("header"))}),{default:we(()=>[g("div",Ox,[j(m(n))])]),_:1},16),j(C,{class:Ae(["transform-gpu isolate",c.value])},{default:we(()=>[j(k,{onCollapse:_},{default:we(()=>[j(C,We(d.value,{size:m(h),"onUpdate:size":b[2]||(b[2]=O=>ys(h)?h.value=O:null),class:"transform-gpu isolate will-change-width",onTransitionend:b[3]||(b[3]=O=>w("side")),onWebkitTransitionEnd:b[4]||(b[4]=O=>w("side"))}),{default:we(()=>[g("div",$x,[j(vx),m(p).isRealUserLogin()?(y(),T(Ie,{key:0},[g("div",kx,[j(x)]),j(m(e))],64)):ue("",!0)])]),_:1},16,["size"]),j(C,{class:Ae(["transform-gpu isolate !overflow-hidden",l.value])},{default:we(()=>[g("div",Ax,[g("div",Px,[j(xx)]),g("div",Rx,[(y(),ne(g_,null,{default:we(()=>[j(N1)]),_:1}))])])]),_:1},8,["class"])]),_:1})]),_:1},8,["class"])]),_:1})])}}});let no;function Mx(){const t=window.__GLOBAL_CONFIG__?.projectHash,e=t?`/${t}/main/`:`/${bt.WEBSITE_PATH_MAIN}/`;return no=__({history:y_(e),routes:[{path:"/login",name:"login",component:()=>nt(()=>import("./index-rWF_BNTH.js"),__vite__mapDeps([19,1,2,12,13,14,20,21,3,22,23,18]),import.meta.url),meta:{hidden:!0,noAuth:!0,title:"route.login"}},{path:"/upgrade",name:"upgrade",component:()=>nt(()=>import("./index-BMSnGhSG.js"),__vite__mapDeps([24,1,2,12,22,25,26,7,27]),import.meta.url),meta:{hidden:!0,noAuth:!0,title:"route.upgrade"}},{path:"/mdPreview",name:"mdPreview",component:()=>nt(()=>import("./index-tKPA5N_x.js"),__vite__mapDeps([28,1,2,29,25,30]),import.meta.url),meta:{hidden:!0,noAuth:!0,title:"route.mdPreview"}},{path:"/previewBlank/:compId/:version?",name:"previewBlank",component:()=>nt(()=>import("./index-Dz2nPzxk.js"),__vite__mapDeps([31,2,32,33,1,34,4]),import.meta.url),meta:{hidden:!0,noAuth:!0,title:"route.preview"}},{path:"/previewLocalBlank/:compId",name:"previewLocalBlank",component:()=>nt(()=>import("./index-BEVcnNvI.js"),__vite__mapDeps([35,2,36,37,1,15,34,4]),import.meta.url),meta:{hidden:!0,noAuth:!0,title:"route.previewLocal"}},{path:"/similarPreview/:compId",name:"similarPreview",component:()=>nt(()=>import("./index-D6MA33Hi.js"),__vite__mapDeps([38,1,2,39,40,41,42,43,44,45,32,36,15,5,10,46,4,34,18,47,29,25,30,48,7,33,49,50,51]),import.meta.url),meta:{hidden:!0,noAuth:!0,title:"route.similarPreview"}},{path:"/",component:Ix,redirect:"/share",meta:{hideParent:!0},children:[{path:"/share",name:"share",meta:{title:"route.share",icon:qn(()=>nt(()=>import("./home-rounded-BhKYWFxg.js"),__vite__mapDeps([52,16,2,53]),import.meta.url)),noAuth:!0},component:()=>nt(()=>import("./index-CsUtZbBp.js"),__vite__mapDeps([54,1,2,45,32,36,15,5,10,46,4,34,18,55]),import.meta.url)},{path:"/mine",name:"mine",meta:{title:"route.mine",icon:qn(()=>nt(()=>import("./supervised-user-circle-C6l0wkza.js"),__vite__mapDeps([56,16,2,57]),import.meta.url))},component:()=>nt(()=>import("./index-B8QVBEgQ.js"),__vite__mapDeps([58,1,2,45,32,36,15,5,10,46,4,34,18,59,60,61,29,25,30,49,50,3,62,7,63,55]),import.meta.url)},{path:"/collect",name:"collect",meta:{title:"route.collect",icon:qn(()=>nt(()=>import("./kid-star-DD-9HSxX.js"),__vite__mapDeps([64,16,2,65]),import.meta.url))},component:()=>nt(()=>import("./index-Diq3BceD.js"),__vite__mapDeps([66,1,2,45,32,36,15,5,10,46,4,34,18,55]),import.meta.url)},{path:"/local",name:"local",meta:{title:"route.local",icon:qn(()=>nt(()=>import("./sync-saved-locally-rounded-Cgz-NvDy.js"),__vite__mapDeps([67,16,2,68]),import.meta.url)),noAuth:!0},component:()=>nt(()=>import("./index-BVcp4iEn.js"),__vite__mapDeps([69,1,2,45,32,36,15,5,10,46,4,34,18]),import.meta.url)},{path:"/upload",name:"upload",meta:{title:"route.upload",icon:qn(()=>nt(()=>import("./cloud-upload-Cdco6849.js"),__vite__mapDeps([70,16,2,71]),import.meta.url)),noAuth:!0,hidden:!0},component:()=>nt(()=>import("./index-BGYcKO_k.js"),__vite__mapDeps([72,1,2,60,32,4,61,34,29,25,30,5,49,50,3,62,7,18,44,46,27]),import.meta.url)},{path:"/uploadTeam/:teamId",name:"uploadTeam",meta:{title:"route.uploadTeam",hidden:!0},component:()=>nt(()=>import("./index-BGYcKO_k.js"),__vite__mapDeps([72,1,2,60,32,4,61,34,29,25,30,5,49,50,3,62,7,18,44,46,27]),import.meta.url)},{path:"/userInfo",name:"userInfo",meta:{title:"route.userInfo",hidden:!0},component:()=>nt(()=>import("./index-DGaY7dL7.js"),__vite__mapDeps([73,1,2,21,3,5,20,74,9,10,11,75,7]),import.meta.url)},{path:"/preview/:compId",meta:{title:"route.preview",noAuth:!0,hidden:!0},component:()=>nt(()=>import("./index-D6MA33Hi.js"),__vite__mapDeps([38,1,2,39,40,41,42,43,44,45,32,36,15,5,10,46,4,34,18,47,29,25,30,48,7,33,49,50,51]),import.meta.url)},{path:"/previewLocal/:compId",meta:{title:"route.previewLocal",hidden:!0,noAuth:!0},component:()=>nt(()=>import("./index-BwgqBNRu.js"),__vite__mapDeps([76,1,2,36,47,29,25,30,46,45,32,15,5,10,4,34,18,48,7,37,49]),import.meta.url)},{path:"/previewTeam/:teamId/:compId",meta:{title:"route.previewTeam",noAuth:!0,hidden:!0},props:{isTeamPreview:!0},component:()=>nt(()=>import("./index-D6MA33Hi.js"),__vite__mapDeps([38,1,2,39,40,41,42,43,44,45,32,36,15,5,10,46,4,34,18,47,29,25,30,48,7,33,49,50,51]),import.meta.url)},{path:"/terminal",name:"terminal",meta:{title:"route.terminal",icon:qn(()=>nt(()=>import("./terminal-DIdElzFh.js"),__vite__mapDeps([77,16,2,78]),import.meta.url)),noAuth:!0},component:()=>nt(()=>import("./index-CG7uKVdX.js"),__vite__mapDeps([79,41,2,42,1,43]),import.meta.url)},{path:"/setting",name:"setting",meta:{title:"route.setting",icon:qn(()=>nt(()=>import("./settings-f8ZwrSyv.js"),__vite__mapDeps([80,16,2,81]),import.meta.url)),noAuth:!0},component:()=>nt(()=>import("./index-Dd8ha0TC.js"),__vite__mapDeps([82,1,2,50,83,7]),import.meta.url)},{path:"/team/:teamId",name:"team",meta:{title:"route.team",hidden:!0},component:()=>nt(()=>import("./index-X1ZIWbVW.js"),__vite__mapDeps([84,1,2,39,40,9,10,11,45,32,36,15,5,46,4,34,18,3,55,16,50,85,7]),import.meta.url)}]},{path:"/:pathMatch(.*)*",name:"404",meta:{hidden:!0,noAuth:!0,title:"route.404"},component:()=>nt(()=>import("./index-Cc3zDN4S.js"),__vite__mapDeps([86,2,1]),import.meta.url)}]}),no}function Dx(t){Mx(),t.use(no)}const Fx=H([]);function Lx(t){const e=nc(A1,{errors:Fx.value}),n=document.createElement("div");n.id="error-container",e.mount(n),document.body.appendChild(n)}var Kr={exports:{}},jx=Kr.exports,Ud;function Nx(){return Ud||(Ud=1,(function(t,e){(function(n,i){t.exports=i()})(jx,function(){function n(X){return(n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V})(X)}function i(X,V){if(!(X instanceof V))throw new TypeError("Cannot call a class as a function")}function o(X,V){for(var J=0;J<V.length;J++){var ye=V[J];ye.enumerable=ye.enumerable||!1,ye.configurable=!0,"value"in ye&&(ye.writable=!0),Object.defineProperty(X,ye.key,ye)}}function r(X,V,J){V&&o(X.prototype,V),J&&o(X,J),Object.defineProperty(X,"prototype",{writable:!1})}function s(X,V,J){V in X?Object.defineProperty(X,V,{value:J,enumerable:!0,configurable:!0,writable:!0}):X[V]=J}function a(X,V){if(typeof V!="function"&&V!==null)throw new TypeError("Super expression must either be null or a function");X.prototype=Object.create(V&&V.prototype,{constructor:{value:X,writable:!0,configurable:!0}}),Object.defineProperty(X,"prototype",{writable:!1}),V&&c(X,V)}function l(X){return(l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(V){return V.__proto__||Object.getPrototypeOf(V)})(X)}function c(X,V){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(J,ye){return J.__proto__=ye,J})(X,V)}function u(X,V){if(V&&(typeof V=="object"||typeof V=="function"))return V;if(V!==void 0)throw new TypeError("Derived constructors may only return object or undefined");if(V=X,V===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return V}function d(X){var V=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}})();return function(){var J,ye=l(X);return u(this,V?(J=l(this).constructor,Reflect.construct(ye,arguments,J)):ye.apply(this,arguments))}}function h(X,V){(V==null||V>X.length)&&(V=X.length);for(var J=0,ye=new Array(V);J<V;J++)ye[J]=X[J];return ye}function v(X,V){var J,ye=typeof Symbol<"u"&&X[Symbol.iterator]||X["@@iterator"];if(!ye){if(Array.isArray(X)||(ye=(function(Z,ae){if(Z){if(typeof Z=="string")return h(Z,ae);var fe=Object.prototype.toString.call(Z).slice(8,-1);return(fe=fe==="Object"&&Z.constructor?Z.constructor.name:fe)==="Map"||fe==="Set"?Array.from(Z):fe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(fe)?h(Z,ae):void 0}})(X))||V&&X&&typeof X.length=="number")return ye&&(X=ye),J=0,{s:V=function(){},n:function(){return J>=X.length?{done:!0}:{done:!1,value:X[J++]}},e:function(Z){throw Z},f:V};throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
12
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var xe,se=!0,Me=!1;return{s:function(){ye=ye.call(X)},n:function(){var Z=ye.next();return se=Z.done,Z},e:function(Z){Me=!0,xe=Z},f:function(){try{se||ye.return==null||ye.return()}finally{if(Me)throw xe}}}}function f(){if(p.url)window.location.href=p.url;else if(p.rewriteHTML)try{document.documentElement.innerHTML=p.rewriteHTML}catch{document.documentElement.innerText=p.rewriteHTML}else{try{window.opener=null,window.open("","_self"),window.close(),window.history.back()}catch(X){console.log(X)}setTimeout(function(){window.location.href=p.timeOutUrl||"https://theajack.github.io/disable-devtool/404.html?h=".concat(encodeURIComponent(location.host))},500)}}var p={md5:"",ondevtoolopen:f,ondevtoolclose:null,url:"",timeOutUrl:"",tkName:"ddtk",interval:500,disableMenu:!0,stopIntervalTime:5e3,clearIntervalWhenDevOpenTrigger:!1,detectors:[1,3,4,5,6,7],clearLog:!0,disableSelect:!1,disableInputSelect:!1,disableCopy:!1,disableCut:!1,disablePaste:!1,ignore:null,disableIframeParents:!0,seo:!0,rewriteHTML:""},_=["detectors","ondevtoolclose","ignore"];function S(X){var V,J=0<arguments.length&&X!==void 0?X:{};for(V in J.onDevtoolOpen&&(J.ondevtoolopen=J.onDevtoolOpen),J.onDevtoolClose&&(J.ondevtoolclose=J.onDevtoolClose),p){var ye=V;J[ye]===void 0||n(p[ye])!==n(J[ye])&&_.indexOf(ye)===-1||(p[ye]=J[ye])}typeof p.ondevtoolclose=="function"&&p.clearIntervalWhenDevOpenTrigger===!0&&(p.clearIntervalWhenDevOpenTrigger=!1,console.warn("【DISABLE-DEVTOOL】clearIntervalWhenDevOpenTrigger 在使用 ondevtoolclose 时无效"))}function w(){return new Date().getTime()}function E(X){var V=w();return X(),w()-V}function b(X,V){function J(Me){return function(){X&&X();var Z=Me.apply(void 0,arguments);return V&&V(),Z}}var ye=window.alert,xe=window.confirm,se=window.prompt;try{window.alert=J(ye),window.confirm=J(xe),window.prompt=J(se)}catch{}}var C,x,k,O={iframe:!1,pc:!1,qqBrowser:!1,firefox:!1,macos:!1,edge:!1,oldEdge:!1,ie:!1,iosChrome:!1,iosEdge:!1,chrome:!1,seoBot:!1,mobile:!1};function K(){function X(Ft){return V.indexOf(Ft)!==-1}var V=navigator.userAgent.toLowerCase(),J=(function(){var yt=navigator,Ft=yt.platform,yt=yt.maxTouchPoints;if(typeof yt=="number")return 1<yt;if(typeof Ft=="string"){if(yt=Ft.toLowerCase(),/(mac|win)/i.test(yt))return!1;if(/(android|iphone|ipad|ipod|arch)/i.test(yt))return!0}return/(iphone|ipad|ipod|ios|android)/i.test(navigator.userAgent.toLowerCase())})(),ye=!!window.top&&window!==window.top,xe=!J,se=X("qqbrowser"),Me=X("firefox"),Z=X("macintosh"),ae=X("edge"),fe=ae&&!X("chrome"),ce=fe||X("trident")||X("msie"),be=X("crios"),On=X("edgios"),Qt=X("chrome")||be,on=!J&&/(googlebot|baiduspider|bingbot|applebot|petalbot|yandexbot|bytespider|chrome\-lighthouse|moto g power)/i.test(V);Object.assign(O,{iframe:ye,pc:xe,qqBrowser:se,firefox:Me,macos:Z,edge:ae,oldEdge:fe,ie:ce,iosChrome:be,iosEdge:On,chrome:Qt,seoBot:on,mobile:J})}function D(){for(var X=(function(){for(var ye={},xe=0;xe<500;xe++)ye["".concat(xe)]="".concat(xe);return ye})(),V=[],J=0;J<50;J++)V.push(X);return V}function P(){p.clearLog&&k()}var U="",M=!1;function q(){var X=p.ignore;if(X){if(typeof X=="function")return X();if(X.length!==0){var V=location.href;if(U===V)return M;U=V;var J,ye=!1,xe=v(X);try{for(xe.s();!(J=xe.n()).done;){var se=J.value;if(typeof se=="string"){if(V.indexOf(se)!==-1){ye=!0;break}}else if(se.test(V)){ye=!0;break}}}catch(Me){xe.e(Me)}finally{xe.f()}return M=ye}}}var le=function(){return!1};function de(X){var V,J,ye=74,xe=73,se=85,Me=83,Z=123,ae=O.macos?function(ce,be){return ce.metaKey&&ce.altKey&&(be===xe||be===ye)}:function(ce,be){return ce.ctrlKey&&ce.shiftKey&&(be===xe||be===ye)},fe=O.macos?function(ce,be){return ce.metaKey&&ce.altKey&&be===se||ce.metaKey&&be===Me}:function(ce,be){return ce.ctrlKey&&(be===Me||be===se)};X.addEventListener("keydown",function(ce){var be=(ce=ce||X.event).keyCode||ce.which;if(be===Z||ae(ce,be)||fe(ce,be))return I(X,ce)},!0),V=X,p.disableMenu&&V.addEventListener("contextmenu",function(ce){if(ce.pointerType!=="touch")return I(V,ce)}),J=X,(p.disableSelect||p.disableInputSelect)&&Y(J,"selectstart"),J=X,p.disableCopy&&Y(J,"copy"),J=X,p.disableCut&&Y(J,"cut"),J=X,p.disablePaste&&Y(J,"paste")}function Y(X,V){X.addEventListener(V,function(J){if(!(ye=J.target)||ye.tagName!=="INPUT"&&ye.tagName!=="TEXTAREA"&&((xe=ye.getAttribute)==null?void 0:xe.call(ye,"contenteditable"))!=="true"){if(p.disableSelect)return I(X,J)}else if(p.disableInputSelect)return I(X,J);var ye,xe})}function I(X,V){if(!q()&&!le())return(V=V||X.event).returnValue=!1,V.preventDefault(),!1}var A,Q=!1,z={};function ie(X){z[X]=!1}function ve(){for(var X in z)if(z[X])return Q=!0;return Q=!1}(Pe=A=A||{})[Pe.Unknown=-1]="Unknown",Pe[Pe.RegToString=0]="RegToString",Pe[Pe.DefineId=1]="DefineId",Pe[Pe.Size=2]="Size",Pe[Pe.DateToString=3]="DateToString",Pe[Pe.FuncToString=4]="FuncToString",Pe[Pe.Debugger=5]="Debugger",Pe[Pe.Performance=6]="Performance",Pe[Pe.DebugLib=7]="DebugLib";var re=(function(){function X(ye){var J=ye.type,ye=ye.enabled,ye=ye===void 0||ye;i(this,X),this.type=A.Unknown,this.enabled=!0,this.type=J,this.enabled=ye,this.enabled&&(J=this,$.push(J),this.init())}return r(X,[{key:"onDevToolOpen",value:function(){var V;console.warn("You don't have permission to use DEVTOOL!【type = ".concat(this.type,"】")),p.clearIntervalWhenDevOpenTrigger&&B(),window.clearTimeout(R),p.ondevtoolopen(this.type,f),V=this.type,z[V]=!0}},{key:"init",value:function(){}}]),X})(),ge=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.DebugLib})}return r(V,[{key:"init",value:function(){}},{key:"detect",value:function(){var J;(((J=(J=window.eruda)==null?void 0:J._devTools)==null?void 0:J._isShow)===!0||window._vcOrigConsole&&window.document.querySelector("#__vconsole.vc-toggle"))&&this.onDevToolOpen()}}],[{key:"isUsing",value:function(){return!!window.eruda||!!window._vcOrigConsole}}]),V})(),_e=0,R=0,$=[],N=0;function F(X){function V(){fe=!0}function J(){fe=!1}var ye,xe,se,Me,Z,ae,fe=!1;function ce(){(ae[Me]===se?xe:ye)()}b(V,J),ye=J,xe=V,(ae=document).hidden!==void 0?(se="hidden",Z="visibilitychange",Me="visibilityState"):ae.mozHidden!==void 0?(se="mozHidden",Z="mozvisibilitychange",Me="mozVisibilityState"):ae.msHidden!==void 0?(se="msHidden",Z="msvisibilitychange",Me="msVisibilityState"):ae.webkitHidden!==void 0&&(se="webkitHidden",Z="webkitvisibilitychange",Me="webkitVisibilityState"),ae.removeEventListener(Z,ce,!1),ae.addEventListener(Z,ce,!1),_e=window.setInterval(function(){if(!(X.isSuspend||fe||q())){var be,On,Qt=v($);try{for(Qt.s();!(be=Qt.n()).done;){var on=be.value;ie(on.type),on.detect(N++)}}catch(Ft){Qt.e(Ft)}finally{Qt.f()}P(),typeof p.ondevtoolclose=="function"&&(On=Q,!ve()&&On&&p.ondevtoolclose())}},p.interval),R=setTimeout(function(){O.pc||ge.isUsing()||B()},p.stopIntervalTime)}function B(){window.clearInterval(_e)}var oe=8;function ee(X){for(var V=(function(se,Me){se[Me>>5]|=128<<Me%32,se[14+(Me+64>>>9<<4)]=Me;for(var Z=1732584193,ae=-271733879,fe=-1732584194,ce=271733878,be=0;be<se.length;be+=16){var On=Z,Qt=ae,on=fe,Ft=ce;Z=he(Z,ae,fe,ce,se[be+0],7,-680876936),ce=he(ce,Z,ae,fe,se[be+1],12,-389564586),fe=he(fe,ce,Z,ae,se[be+2],17,606105819),ae=he(ae,fe,ce,Z,se[be+3],22,-1044525330),Z=he(Z,ae,fe,ce,se[be+4],7,-176418897),ce=he(ce,Z,ae,fe,se[be+5],12,1200080426),fe=he(fe,ce,Z,ae,se[be+6],17,-1473231341),ae=he(ae,fe,ce,Z,se[be+7],22,-45705983),Z=he(Z,ae,fe,ce,se[be+8],7,1770035416),ce=he(ce,Z,ae,fe,se[be+9],12,-1958414417),fe=he(fe,ce,Z,ae,se[be+10],17,-42063),ae=he(ae,fe,ce,Z,se[be+11],22,-1990404162),Z=he(Z,ae,fe,ce,se[be+12],7,1804603682),ce=he(ce,Z,ae,fe,se[be+13],12,-40341101),fe=he(fe,ce,Z,ae,se[be+14],17,-1502002290),ae=he(ae,fe,ce,Z,se[be+15],22,1236535329),Z=me(Z,ae,fe,ce,se[be+1],5,-165796510),ce=me(ce,Z,ae,fe,se[be+6],9,-1069501632),fe=me(fe,ce,Z,ae,se[be+11],14,643717713),ae=me(ae,fe,ce,Z,se[be+0],20,-373897302),Z=me(Z,ae,fe,ce,se[be+5],5,-701558691),ce=me(ce,Z,ae,fe,se[be+10],9,38016083),fe=me(fe,ce,Z,ae,se[be+15],14,-660478335),ae=me(ae,fe,ce,Z,se[be+4],20,-405537848),Z=me(Z,ae,fe,ce,se[be+9],5,568446438),ce=me(ce,Z,ae,fe,se[be+14],9,-1019803690),fe=me(fe,ce,Z,ae,se[be+3],14,-187363961),ae=me(ae,fe,ce,Z,se[be+8],20,1163531501),Z=me(Z,ae,fe,ce,se[be+13],5,-1444681467),ce=me(ce,Z,ae,fe,se[be+2],9,-51403784),fe=me(fe,ce,Z,ae,se[be+7],14,1735328473),ae=me(ae,fe,ce,Z,se[be+12],20,-1926607734),Z=$e(Z,ae,fe,ce,se[be+5],4,-378558),ce=$e(ce,Z,ae,fe,se[be+8],11,-2022574463),fe=$e(fe,ce,Z,ae,se[be+11],16,1839030562),ae=$e(ae,fe,ce,Z,se[be+14],23,-35309556),Z=$e(Z,ae,fe,ce,se[be+1],4,-1530992060),ce=$e(ce,Z,ae,fe,se[be+4],11,1272893353),fe=$e(fe,ce,Z,ae,se[be+7],16,-155497632),ae=$e(ae,fe,ce,Z,se[be+10],23,-1094730640),Z=$e(Z,ae,fe,ce,se[be+13],4,681279174),ce=$e(ce,Z,ae,fe,se[be+0],11,-358537222),fe=$e(fe,ce,Z,ae,se[be+3],16,-722521979),ae=$e(ae,fe,ce,Z,se[be+6],23,76029189),Z=$e(Z,ae,fe,ce,se[be+9],4,-640364487),ce=$e(ce,Z,ae,fe,se[be+12],11,-421815835),fe=$e(fe,ce,Z,ae,se[be+15],16,530742520),ae=$e(ae,fe,ce,Z,se[be+2],23,-995338651),Z=Ce(Z,ae,fe,ce,se[be+0],6,-198630844),ce=Ce(ce,Z,ae,fe,se[be+7],10,1126891415),fe=Ce(fe,ce,Z,ae,se[be+14],15,-1416354905),ae=Ce(ae,fe,ce,Z,se[be+5],21,-57434055),Z=Ce(Z,ae,fe,ce,se[be+12],6,1700485571),ce=Ce(ce,Z,ae,fe,se[be+3],10,-1894986606),fe=Ce(fe,ce,Z,ae,se[be+10],15,-1051523),ae=Ce(ae,fe,ce,Z,se[be+1],21,-2054922799),Z=Ce(Z,ae,fe,ce,se[be+8],6,1873313359),ce=Ce(ce,Z,ae,fe,se[be+15],10,-30611744),fe=Ce(fe,ce,Z,ae,se[be+6],15,-1560198380),ae=Ce(ae,fe,ce,Z,se[be+13],21,1309151649),Z=Ce(Z,ae,fe,ce,se[be+4],6,-145523070),ce=Ce(ce,Z,ae,fe,se[be+11],10,-1120210379),fe=Ce(fe,ce,Z,ae,se[be+2],15,718787259),ae=Ce(ae,fe,ce,Z,se[be+9],21,-343485551),Z=Ne(Z,On),ae=Ne(ae,Qt),fe=Ne(fe,on),ce=Ne(ce,Ft)}return Array(Z,ae,fe,ce)})((function(se){for(var Me=Array(),Z=(1<<oe)-1,ae=0;ae<se.length*oe;ae+=oe)Me[ae>>5]|=(se.charCodeAt(ae/oe)&Z)<<ae%32;return Me})(X),X.length*oe),J="0123456789abcdef",ye="",xe=0;xe<4*V.length;xe++)ye+=J.charAt(V[xe>>2]>>xe%4*8+4&15)+J.charAt(V[xe>>2]>>xe%4*8&15);return ye}function G(X,V,J,ye,xe,se){return Ne((V=Ne(Ne(V,X),Ne(ye,se)))<<xe|V>>>32-xe,J)}function he(X,V,J,ye,xe,se,Me){return G(V&J|~V&ye,X,V,xe,se,Me)}function me(X,V,J,ye,xe,se,Me){return G(V&ye|J&~ye,X,V,xe,se,Me)}function $e(X,V,J,ye,xe,se,Me){return G(V^J^ye,X,V,xe,se,Me)}function Ce(X,V,J,ye,xe,se,Me){return G(J^(V|~ye),X,V,xe,se,Me)}function Ne(X,V){var J=(65535&X)+(65535&V);return(X>>16)+(V>>16)+(J>>16)<<16|65535&J}var Pe=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.RegToString,enabled:O.qqBrowser||O.firefox})}return r(V,[{key:"init",value:function(){var J=this;this.lastTime=0,this.reg=/./,C(this.reg),this.reg.toString=function(){var ye;return O.qqBrowser?(ye=new Date().getTime(),J.lastTime&&ye-J.lastTime<100?J.onDevToolOpen():J.lastTime=ye):O.firefox&&J.onDevToolOpen(),""}}},{key:"detect",value:function(){C(this.reg)}}]),V})(),Ue=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.DefineId})}return r(V,[{key:"init",value:function(){var J=this;this.div=document.createElement("div"),this.div.__defineGetter__("id",function(){J.onDevToolOpen()}),Object.defineProperty(this.div,"id",{get:function(){J.onDevToolOpen()}})}},{key:"detect",value:function(){C(this.div)}}]),V})(),ut=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.Size,enabled:!O.iframe&&!O.edge})}return r(V,[{key:"init",value:function(){var J=this;this.checkWindowSizeUneven(),window.addEventListener("resize",function(){setTimeout(function(){J.checkWindowSizeUneven()},100)},!0)}},{key:"detect",value:function(){}},{key:"checkWindowSizeUneven",value:function(){var J=(function(){if(Qe(window.devicePixelRatio))return window.devicePixelRatio;var xe=window.screen;return!!(Qe(xe)&&xe.deviceXDPI&&xe.logicalXDPI)&&xe.deviceXDPI/xe.logicalXDPI})();if(J!==!1){var ye=200<window.outerWidth-window.innerWidth*J,J=300<window.outerHeight-window.innerHeight*J;if(ye||J)return this.onDevToolOpen(),!1;ie(this.type)}return!0}}]),V})();function Qe(X){return X!=null}var at,tt=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.DateToString,enabled:!O.iosChrome&&!O.iosEdge})}return r(V,[{key:"init",value:function(){var J=this;this.count=0,this.date=new Date,this.date.toString=function(){return J.count++,""}}},{key:"detect",value:function(){this.count=0,C(this.date),P(),2<=this.count&&this.onDevToolOpen()}}]),V})(),pt=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.FuncToString,enabled:!O.iosChrome&&!O.iosEdge})}return r(V,[{key:"init",value:function(){var J=this;this.count=0,this.func=function(){},this.func.toString=function(){return J.count++,""}}},{key:"detect",value:function(){this.count=0,C(this.func),P(),2<=this.count&&this.onDevToolOpen()}}]),V})(),dt=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.Debugger,enabled:O.iosChrome||O.iosEdge})}return r(V,[{key:"detect",value:function(){var J=w();100<w()-J&&this.onDevToolOpen()}}]),V})(),ft=(function(){a(V,re);var X=d(V);function V(){var J;return i(this,V),(J=X.call(this,{type:A.Performance,enabled:O.chrome||!O.mobile})).count=0,J}return r(V,[{key:"init",value:function(){this.maxPrintTime=0,this.largeObjectArray=D()}},{key:"detect",value:function(){var J=this,ye=E(function(){x(J.largeObjectArray)}),xe=E(function(){C(J.largeObjectArray)});if(this.maxPrintTime=Math.max(this.maxPrintTime,xe),P(),ye===0||this.maxPrintTime===0)return!1;ye>10*this.maxPrintTime&&(2<=this.count?this.onDevToolOpen():(this.count++,this.detect()))}}]),V})(),Dt=(s(at={},A.RegToString,Pe),s(at,A.DefineId,Ue),s(at,A.Size,ut),s(at,A.DateToString,tt),s(at,A.FuncToString,pt),s(at,A.Debugger,dt),s(at,A.Performance,ft),s(at,A.DebugLib,ge),at),fn=Object.assign(function(X){function V(){var Me=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";return{success:!Me,reason:Me}}var J;if(fn.isRunning)return V("already running");if(K(),J=window.console||{log:function(){},table:function(){},clear:function(){}},k=O.ie?(C=function(){return J.log.apply(J,arguments)},x=function(){return J.table.apply(J,arguments)},function(){return J.clear()}):(C=J.log,x=J.table,J.clear),S(X),p.md5&&ee((function(Me){var Z=window.location.search,ae=window.location.hash;return(Z=Z===""&&ae!==""?"?".concat(ae.split("?")[1]):Z)!==""&&Z!==void 0&&(ae=new RegExp("(^|&)"+Me+"=([^&]*)(&|$)","i"),Me=Z.substr(1).match(ae),Me!=null)?unescape(Me[2]):""})(p.tkName))===p.md5)return V("token passed");if(p.seo&&O.seoBot)return V("seobot");fn.isRunning=!0,F(fn);var ye=fn,xe=(le=function(){return ye.isSuspend},window.top),se=window.parent;if(de(window),p.disableIframeParents&&xe&&se&&xe!==window){for(;se!==xe;)de(se),se=se.parent;de(xe)}return(p.detectors==="all"?Object.keys(Dt):p.detectors).forEach(function(Me){new Dt[Me]}),V()},{isRunning:!1,isSuspend:!1,md5:ee,version:"0.3.9",DetectorType:A,isDevToolOpened:ve});return Pe=(function(){if(typeof window>"u"||!window.document)return null;var X=document.querySelector("[disable-devtool-auto]");if(!X)return null;var V=["disable-menu","disable-select","disable-copy","disable-cut","disable-paste","clear-log"],J=["interval"],ye={};return["md5","url","tk-name","detectors"].concat(V,J).forEach(function(xe){var se=X.getAttribute(xe);se!==null&&(J.indexOf(xe)!==-1?se=parseInt(se):V.indexOf(xe)!==-1?se=se!=="false":xe==="detector"&&se!=="all"&&(se=se.split(" ")),ye[(function(Me){if(Me.indexOf("-")===-1)return Me;var Z=!1;return Me.split("").map(function(ae){return ae==="-"?(Z=!0,""):Z?(Z=!1,ae.toUpperCase()):ae}).join("")})(xe)]=se)}),ye})(),Pe&&fn(Pe),fn})})(Kr)),Kr.exports}var Ux=Nx();const zx=Fi(Ux);function Vx(){window.__GLOBAL_CONFIG__.allowDebug||zx({disableMenu:!1})}(function(){try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('._fc-frame ._fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-frame ._fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame._fc-disabled ._fc-upload-btn,._fc-frame._fc-disabled .el-button{cursor:not-allowed!important;color:#999}._fc-frame ._fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;-webkit-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}._fc-frame ._fc-upload-cover i{color:#fff;font-size:20px;cursor:pointer;margin:0 2px}._fc-frame ._fc-files:hover ._fc-upload-cover{opacity:1}._fc-frame .el-upload{display:block}._fc-frame ._fc-upload-icon{cursor:pointer}._fc-frame ._fc-upload-btn,._fc-files{display:inline-block;width:58px;height:58px;text-align:center;line-height:58px;border:1px solid #c0ccda;border-radius:4px;overflow:hidden;background:#fff;position:relative;-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.1);box-shadow:2px 2px 5px #0000001a;margin-right:4px;-webkit-box-sizing:border-box;box-sizing:border-box}._fc-upload{width:100%}._fc-exceed .el-upload{display:none}.el-upload-list.is-disabled .el-upload{cursor:not-allowed!important}._fc-group{display:flex;min-height:38px;justify-content:center;flex-direction:column;width:100%}._fc-group-disabled ._fc-group-btn,._fc-group-disabled ._fc-group-add{cursor:not-allowed}._fc-group-handle{display:flex;flex-direction:row;position:absolute;bottom:-15px;right:30px;border-radius:15px;border:1px dashed #d9d9d9;padding:3px 8px;background-color:#fff}._fc-group-btn{cursor:pointer}._fc-group-idx{position:absolute;bottom:-15px;left:10px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;background:#eee;border-radius:15px;font-weight:700}._fc-group-handle ._fc-group-btn+._fc-group-btn{margin-left:7px}._fc-group-container{position:relative;display:flex;flex-direction:column;border:1px dashed #d9d9d9;border-radius:5px;margin:5px 5px 25px;padding:20px 20px 25px}._fc-group-arrow{position:relative;width:20px;height:20px}._fc-group-arrow:before{content:"";position:absolute;top:8px;left:5px;width:9px;height:9px;border-left:2px solid #999;border-top:2px solid #999}._fc-group-arrow:before{transform:rotate(45deg)}._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group-plus-minus{width:20px;height:20px;position:relative;cursor:pointer}._fc-group-plus-minus:before,._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:60%;height:2px;background-color:#409eff;transform:translate(-50%,-50%)}._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group-plus-minus._fc-group-minus:after{background-color:#f56c6c}._fc-group-add{cursor:pointer;width:25px;height:25px;border:1px solid rgb(64 158 255 / 50%);border-radius:15px}._fc-group-add._fc-group-plus-minus:before,._fc-group-add._fc-group-plus-minus:after{width:50%}._fc-group._fc-group-card{display:flex;flex-direction:column;width:100%;gap:16px}._fc-group._fc-group-card._fc-group-disabled ._fc-group-btn,._fc-group._fc-group-card._fc-group-disabled ._fc-group-add{cursor:not-allowed;opacity:.5}._fc-group._fc-group-card ._fc-group-container{position:relative;background:#fff;border:1px solid #f0f0f0;border-radius:6px;overflow:hidden;display:flex;flex-direction:column;padding:0;margin:0}._fc-group._fc-group-card ._fc-group-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px 12px;border-bottom:1px solid #f0f0f0;background:#fafafa}._fc-group._fc-group-card ._fc-group-idx{display:flex;align-items:center;justify-content:center;width:24px;height:24px;background:#f0f0f0;color:#666;border-radius:6px;font-size:12px;font-weight:500;margin-right:12px;flex-shrink:0;position:static;border:1px solid #e0e0e0}._fc-group._fc-group-card ._fc-group-title{flex:1;font-size:14px;font-weight:500;color:#000000d9;line-height:1.5715}._fc-group._fc-group-card ._fc-group-handle{display:flex;align-items:center;gap:4px;margin-left:12px;flex-shrink:0;position:static;bottom:auto;right:auto;border-radius:0;border:none;padding:0;background-color:transparent;flex-direction:row}._fc-group._fc-group-card ._fc-group-btn{cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:4px;border:1px solid #d9d9d9;background:#fff;color:#00000073;position:relative}._fc-group._fc-group-card ._fc-group-btn:hover{color:#1890ff;border-color:#1890ff;background:#f0f8ff}._fc-group._fc-group-card ._fc-group-btn:active{color:#096dd9;border-color:#096dd9}._fc-group._fc-group-card ._fc-group-arrow{position:relative}._fc-group._fc-group-card ._fc-group-arrow:before{content:"";position:absolute;top:50%;left:50%;width:5px;height:5px;border-left:1px solid currentColor;border-top:1px solid currentColor;transform:translate(-50%,-50%) rotate(45deg)}._fc-group._fc-group-card ._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group._fc-group-card ._fc-group-sort{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;height:24px}._fc-group._fc-group-card ._fc-group-sort:before,._fc-group._fc-group-card ._fc-group-sort:after{content:"";position:absolute;left:50%;width:4px;height:4px;border-left:1px solid currentColor;border-top:1px solid currentColor;transform:translate(-50%)}._fc-group._fc-group-card ._fc-group-sort:before{top:6px;transform:translate(-50%) rotate(45deg)}._fc-group._fc-group-card ._fc-group-sort:after{bottom:6px;transform:translate(-50%) rotate(225deg)}._fc-group._fc-group-card ._fc-group-sort-up,._fc-group._fc-group-card ._fc-group-sort-down{position:absolute;left:0;right:0;height:12px;cursor:pointer;z-index:1}._fc-group._fc-group-card ._fc-group-sort-up{top:0}._fc-group._fc-group-card ._fc-group-sort-down{bottom:0}._fc-group._fc-group-card ._fc-group-sort-up:hover,._fc-group._fc-group-card ._fc-group-sort-down:hover{background:#1890ff1a}._fc-group._fc-group-card ._fc-group-plus-minus{position:relative;background:#409eff;border-color:#409eff;color:#fff;width:24px;height:24px}._fc-group._fc-group-card ._fc-group-plus-minus:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}._fc-group._fc-group-card ._fc-group-plus-minus:before,._fc-group._fc-group-card ._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:8px;height:1px;background-color:currentColor;transform:translate(-50%,-50%)}._fc-group._fc-group-card ._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus{background:#f56c6c;border-color:#f56c6c}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus:hover{background:#f78989;border-color:#f78989}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group._fc-group-card ._fc-group-content{padding:20px}._fc-group._fc-group-card ._fc-group-add{cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:4px;border:1px solid #d9d9d9;background:#fff;color:#00000073;position:relative}._fc-group._fc-group-card ._fc-group-add:hover{color:#409eff;border-color:#409eff;background:#f0f8ff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus{width:24px;height:24px;background:#409eff;border-color:#409eff;color:#fff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:before,._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:8px;height:1px;background-color:currentColor;transform:translate(-50%,-50%)}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group._fc-group-card ._fc-group-empty{text-align:center;padding:40px 20px;color:#00000073;font-size:14px}@media (max-width: 768px){._fc-group._fc-group-card ._fc-group-container{margin:0 -8px;border-radius:0;border-left:none;border-right:none}._fc-group._fc-group-card ._fc-group-header{padding:12px 16px 8px}._fc-group._fc-group-card ._fc-group-content{padding:16px}._fc-group._fc-group-card ._fc-group-handle{gap:2px}._fc-group._fc-group-card ._fc-group-btn{width:22px;height:22px}}.form-create .form-create .el-form-item{margin-bottom:22px}.form-create{width:100%}.form-create.is-preview .fc-clock,.form-create .fc-none,.form-create.is-preview .el-form-item.is-required>.el-form-item__label-wrap>.el-form-item__label:before,.form-create.is-preview .el-form-item.is-required>.el-form-item__label:before{display:none!important}.fc-wrap-right>.el-form-item__label{display:flex;justify-content:flex-end}.fc-wrap-left>.el-form-item__label{display:flex;justify-content:flex-start}.fc-wrap-top.el-form-item{display:block}.fc-wrap-top.el-form-item>.el-form-item__label{display:block;height:auto;line-height:22px;margin-bottom:8px;text-align:left;float:unset}.el-form--large .fc-wrap-top.el-form-item>.el-form-item__label{line-height:22px;margin-bottom:12px}.el-form--default .fc-wrap-top.el-form-item>.el-form-item__label{line-height:22px;margin-bottom:8px}.el-form--small .fc-wrap-top.el-form-item>.el-form-item__label{line-height:20px;margin-bottom:4px}.fc-form-footer{margin-top:12px}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();var Bx=Object.defineProperty,Hx=Object.defineProperties,qx=Object.getOwnPropertyDescriptors,zd=Object.getOwnPropertySymbols,Wx=Object.prototype.hasOwnProperty,Kx=Object.prototype.propertyIsEnumerable,Vd=(t,e,n)=>e in t?Bx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Te=(t,e)=>{for(var n in e||(e={}))Wx.call(e,n)&&Vd(t,n,e[n]);if(zd)for(var n of zd(e))Kx.call(e,n)&&Vd(t,n,e[n]);return t},en=(t,e)=>Hx(t,qx(e));function yc(t,e){return Object.keys(t).reduce((n,i)=>((!e||e.indexOf(i)===-1)&&(n[i]=t[i]),n),{})}function zt(t){return Array.isArray(t)?t:[null,void 0,""].indexOf(t)>-1?[]:[t]}const Yx="fcCheckbox",Gx=Se({name:Yx,inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:Array,default:()=>[]},type:String,options:Array,input:Boolean,inputValue:String},emits:["update:modelValue","fc.el"],setup(t,e){const n=$t(t.formCreateInject,"options",[]),i=$t(t,"options"),o=$t(t,"modelValue"),r=$t(t,"inputValue",""),s=H(r.value),a=$t(t,"input",!1),l=d=>{const h=[...zt(o.value)],v=h.indexOf(s.value);s.value=d,v>-1&&(h.splice(v,1),h.push(d),u(h))};Oe(r,d=>{if(!a.value){s.value=d;return}l(d)});const c=te(()=>{let d=n.value||[];return i.value&&(d=i.value||[]),Array.isArray(d)?d:[]});Oe(o,d=>{let h=null;if(!r.value&&d!=null&&Array.isArray(d)&&d.length>0&&a.value){const v=c.value.map(f=>f.value);d.forEach(f=>{v.indexOf(f)===-1&&(h=f)})}h!=null&&(s.value=h)},{immediate:!0});const u=d=>{e.emit("update:modelValue",d)};return{options:c,value:o,onInput:u,updateCustomValue:l,makeInput(d){if(a.value)return j(d,{value:s.value||void 0,label:s.value||void 0},{default:()=>[j(ze("ElInput"),{size:"small",modelValue:s.value,"onUpdate:modelValue":l},null)]})}}},render(){const t=this.type==="button"?"ElCheckboxButton":"ElCheckbox",e=ze(t);return j(ze("ElCheckboxGroup"),We(this.$attrs,{modelValue:this.value===null?void 0:this.value,"onUpdate:modelValue":this.onInput,ref:"el"}),Te({default:()=>{var n,i;return[this.options.map((o,r)=>{const s=Te({},o),a=s.value,l=s.label;return delete s.value,delete s.label,j(e,We(s,{label:a,value:a,key:t+r+"-"+a}),{default:()=>[l||a||""]})}),(i=(n=this.$slots).default)==null?void 0:i.call(n),this.makeInput(e)]}},yc(this.$slots,["default"])))},mounted(){this.$emit("fc.el",this.$refs.el)}});function vm(t){t=t||new Map;const e={$on(n,i){const o=t.get(n);o&&o.push(i)||t.set(n,[i])},$once(n,i){i._once=!0,e.$on(n,i)},$off(n,i){const o=t.get(n);o&&o.splice(o.indexOf(i)>>>0,1)},$emit(n,...i){(t.get(n)||[]).slice().map(o=>{o._once&&(e.$off(n,o),delete o._once),o(...i)}),(t.get("*")||[]).slice().map(o=>{o(n,i)})}};return e}const gi=(t,e)=>{const n=t.__vccOpts||t;for(const[i,o]of e)n[i]=o;return n},Qx={name:"IconCircleClose"},Xx={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function Jx(t,e,n,i,o,r){return y(),T("svg",Xx,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M466.752 512l-90.496-90.496a32 32 0 0145.248-45.248L512 466.752l90.496-90.496a32 32 0 1145.248 45.248L557.248 512l90.496 90.496a32 32 0 11-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 01-45.248-45.248L466.752 512z"},null,-1),g("path",{fill:"currentColor",d:"M512 896a384 384 0 100-768 384 384 0 000 768zm0 64a448 448 0 110-896 448 448 0 010 896z"},null,-1)])])}const Zx=gi(Qx,[["render",Jx]]),eT={name:"IconDocument"},tT={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function nT(t,e,n,i,o,r){return y(),T("svg",tT,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640V384zm-26.496-64L640 154.496V320h165.504zM160 64h480l256 256v608a32 32 0 01-32 32H160a32 32 0 01-32-32V96a32 32 0 0132-32zm160 448h384v64H320v-64zm0-192h160v64H320v-64zm0 384h384v64H320v-64z"},null,-1)])])}const iT=gi(eT,[["render",nT]]),oT={name:"IconDelete"},rT={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function sT(t,e,n,i,o,r){return y(),T("svg",rT,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M160 256H96a32 32 0 010-64h256V95.936a32 32 0 0132-32h256a32 32 0 0132 32V192h256a32 32 0 110 64h-64v672a32 32 0 01-32 32H192a32 32 0 01-32-32V256zm448-64v-64H416v64h192zM224 896h576V256H224v640zm192-128a32 32 0 01-32-32V416a32 32 0 0164 0v320a32 32 0 01-32 32zm192 0a32 32 0 01-32-32V416a32 32 0 0164 0v320a32 32 0 01-32 32z"},null,-1)])])}const aT=gi(oT,[["render",sT]]),lT={name:"IconView"},cT={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function uT(t,e,n,i,o,r){return y(),T("svg",cT,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352zm0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 110 448 224 224 0 010-448zm0 64a160.192 160.192 0 00-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160z"},null,-1)])])}const dT=gi(lT,[["render",uT]]),hT={name:"IconFolderOpened"},pT={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function fT(t,e,n,i,o,r){return y(),T("svg",pT,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M878.08 448H241.92l-96 384h636.16l96-384zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 01216.96 384H832zm-24.96 512H96a32 32 0 01-32-32V160a32 32 0 0132-32h287.872l128.384 128H864a32 32 0 0132 32v96h23.04a32 32 0 0131.04 39.744l-112 448A32 32 0 01807.04 896z"},null,-1)])])}const mT=gi(hT,[["render",fT]]),vT="fcFrame",gT=Se({name:vT,props:{type:{type:String,default:"input"},field:String,helper:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},src:{type:String,required:!0},icon:{type:String,default:"IconFolderOpened"},width:{type:String,default:"500px"},height:{type:String,default:"370px"},maxLength:{type:Number,default:0},okBtnText:{type:String,default:""},closeBtnText:{type:String,default:""},modalTitle:String,handleIcon:{type:[String,Boolean],default:void 0},title:String,allowRemove:{type:Boolean,default:!0},onOpen:{type:Function,default:()=>{}},onOk:{type:Function,default:()=>{}},onCancel:{type:Function,default:()=>{}},onLoad:{type:Function,default:()=>{}},onBeforeRemove:{type:Function,default:()=>{}},onRemove:{type:Function,default:()=>{}},onHandle:Function,modal:{type:Object,default:()=>({})},srcKey:[String,Number],modelValue:[Array,String,Number,Object],previewMask:void 0,footer:{type:Boolean,default:!0},reload:{type:Boolean,default:!0},closeBtn:{type:Boolean,default:!0},okBtn:{type:Boolean,default:!0},formCreateInject:Object},emits:["update:modelValue","change"],components:{IconFolderOpened:mT,IconView:dT},data(){return{fileList:zt(this.modelValue),previewVisible:!1,frameVisible:!1,previewImage:"",bus:new vm}},watch:{modelValue(t){this.fileList=zt(t)}},methods:{close(){this.closeModel(!0)},closeModel(t){this.bus.$emit(t?"$close":"$ok"),this.reload&&(this.bus.$off("$ok"),this.bus.$off("$close")),this.frameVisible=!1},handleCancel(){this.previewVisible=!1},showModel(){this.disabled||this.onOpen()===!1||(this.frameVisible=!0)},input(){const t=this.fileList,e=this.maxLength===1?t[0]||"":t;this.$emit("update:modelValue",e),this.$emit("change",e)},makeInput(){return j(ze("ElInput"),We({type:"text",modelValue:this.fileList.map(t=>this.getSrc(t)).toString(),readonly:!0},{key:1}),{append:()=>j(ze("ElButton"),{icon:ze(this.icon),onClick:()=>this.showModel()},null),suffix:()=>this.fileList.length&&!this.disabled?j(ze("ElIcon"),{class:"el-input__icon _fc-upload-icon",onClick:()=>{this.fileList=[],this.input()}},{default:()=>[j(Zx,null,null)]}):null})},makeGroup(t){return(!this.maxLength||this.fileList.length<this.maxLength)&&t.push(this.makeBtn()),j("div",{key:2},[t])},makeItem(t,e){return j("div",{class:"_fc-files",key:"3"+t},[e])},valid(t){const e=this.formCreateInject.field||this.field;if(e&&t!==e)throw new Error("[frame]无效的字段值")},makeIcons(t,e){if(this.handleIcon!==!1||this.allowRemove===!0){const n=[];return(this.type!=="file"&&this.handleIcon!==!1||this.type==="file"&&this.handleIcon)&&n.push(this.makeHandleIcon(t,e)),this.allowRemove&&n.push(this.makeRemoveIcon(t,e)),j("div",{class:"_fc-upload-cover",key:4},[n])}},makeHandleIcon(t,e){const n=ze(this.handleIcon===!0||this.handleIcon===void 0?"icon-view":this.handleIcon);return j(ze("ElIcon"),{onClick:()=>this.handleClick(t),key:"5"+e},{default:()=>[j(n,null,null)]})},makeRemoveIcon(t,e){return j(ze("ElIcon"),{onClick:()=>this.handleRemove(t),key:"6"+e},{default:()=>[j(aT,null,null)]})},makeFiles(){return this.makeGroup(this.fileList.map((t,e)=>this.makeItem(e,[j(ze("ElIcon"),{onClick:()=>this.handleClick(t)},{default:()=>[j(iT,null,null)]}),this.makeIcons(t,e)])))},makeImages(){return this.makeGroup(this.fileList.map((t,e)=>this.makeItem(e,[j("img",{src:this.getSrc(t)},null),this.makeIcons(t,e)])))},makeBtn(){const t=ze(this.icon);return j("div",{class:"_fc-upload-btn",onClick:()=>this.showModel(),key:7},[j(ze("ElIcon"),null,{default:()=>[j(t,null,null)]})])},handleClick(t){if(this.onHandle)return this.onHandle(t);this.previewImage=this.getSrc(t),this.previewVisible=!0},handleRemove(t){this.disabled||this.onBeforeRemove(t)!==!1&&(this.fileList.splice(this.fileList.indexOf(t),1),this.input(),this.onRemove(t))},getSrc(t){return this.srcKey?t[this.srcKey]:t},frameLoad(t){this.onLoad(t);try{this.helper===!0&&(t.form_create_helper={api:this.formCreateInject.api,close:e=>{this.valid(e),this.closeModel()},set:(e,n)=>{this.valid(e),!this.disabled&&this.$emit("update:modelValue",n)},get:e=>(this.valid(e),this.modelValue),onOk:e=>this.bus.$on("$ok",e),onClose:e=>this.bus.$on("$close",e)})}catch(e){console.error(e)}},makeFooter(){const{okBtnText:t,closeBtnText:e,closeBtn:n,okBtn:i,footer:o}=this.$props;if(o)return j("div",null,[n?j(ze("ElButton"),{onClick:()=>this.onCancel()!==!1&&(this.frameVisible=!1)},{default:()=>[e||this.formCreateInject.t("close")||"关闭"]}):null,i?j(ze("ElButton"),{type:"primary",onClick:()=>this.onOk()!==!1&&this.closeModel()},{default:()=>[t||this.formCreateInject.t("ok")||"确定"]}):null])}},render(){const t=this.type;let e;t==="input"?e=this.makeInput():t==="image"?e=this.makeImages():e=this.makeFiles();const{width:n="30%",height:i,src:o,title:r,modalTitle:s}=this.$props;return Ge(()=>{this.$refs.frame&&this.frameLoad(this.$refs.frame.contentWindow||{})}),j("div",{class:{"_fc-frame":!0,"_fc-disabled":this.disabled}},[e,j(ze("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:s,modelValue:this.previewVisible,onClose:this.handleCancel},{default:()=>[j("img",{style:"width: 100%",src:this.previewImage},null)]}),j(ze("ElDialog"),We({appendToBody:!0},Te({width:n,title:r},this.modal),{modelValue:this.frameVisible,onClose:()=>this.closeModel(!0)}),{default:()=>[this.frameVisible||!this.reload?j("iframe",{ref:"frame",src:o,frameBorder:"0",style:{height:i,border:"0 none",width:"100%"}},null):null],footer:()=>this.makeFooter()})])},beforeMount(){const{name:t,field:e,api:n}=this.formCreateInject;t&&n.on("fc:closeModal:"+t,this.close),e&&n.on("fc:closeModal:"+e,this.close)},beforeUnmount(){const{name:t,field:e,api:n}=this.formCreateInject;t&&n.off("fc:closeModal:"+t,this.close),e&&n.off("fc:closeModal:"+e,this.close)}}),_T="fcRadio",yT=Se({name:_T,inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:[String,Number,Boolean],default:""},options:Array,type:String,input:Boolean,inputValue:String},emits:["update:modelValue","fc.el"],setup(t,e){const n=$t(t.formCreateInject,"options",[]),i=$t(t,"options"),o=$t(t,"modelValue"),r=$t(t,"inputValue",""),s=H(r.value),a=$t(t,"input",!1);Oe(r,d=>{if(!a.value){s.value=d;return}u(d)});const l=te(()=>{let d=n.value||[];return i.value&&(d=i.value||[]),Array.isArray(d)?d:[]});Oe(o,d=>{let h=!1;!r.value&&d!=null&&a.value&&(h=l.value.map(v=>v.value).indexOf(d)===-1),h&&(s.value=d)},{immediate:!0});const c=d=>{e.emit("update:modelValue",d)},u=d=>{const h=s.value;s.value=d,o.value===h&&c(d)};return{options:l,value:o,onInput:c,updateCustomValue:u,customValue:s,makeInput(d){if(a.value)return j(d,{checked:!1,value:s.value||void 0,label:s.value||void 0},{default:()=>[j(ze("ElInput"),{size:"small",modelValue:s.value,"onUpdate:modelValue":u},null)]})}}},render(){const t=this.type==="button"?"ElRadioButton":"ElRadio",e=ze(t);return j(ze("ElRadioGroup"),We(this.$attrs,{modelValue:this.value,"onUpdate:modelValue":this.onInput,ref:"el"}),Te({default:()=>{var n,i;return[this.options.map((o,r)=>{const s=Te({},o),a=s.value,l=s.label;return delete s.value,delete s.label,j(e,We(s,{label:a,value:a,key:t+r+"-"+a}),{default:()=>[l||a||""]})}),(i=(n=this.$slots).default)==null?void 0:i.call(n),this.makeInput(e)]}},yc(this.$slots,["default"])))},mounted(){this.$emit("fc.el",this.$refs.el)}}),pe={type(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"},Undef(t){return t==null},Element(t){return typeof t=="object"&&t!==null&&t.nodeType===1&&!pe.Object(t)},trueArray(t){return Array.isArray(t)&&t.length>0},Function(t){const e=this.getType(t);return e==="Function"||e==="AsyncFunction"},getType(t){const e=Object.prototype.toString.call(t);return/^\[object (.*)\]$/.exec(e)[1]},empty(t){return t==null||Array.isArray(t)&&Array.isArray(t)&&!t.length?!0:typeof t=="string"&&!t}};["Date","Object","String","Boolean","Array","Number"].forEach(t=>{pe[t]=function(e){return pe.type(e,t)}});function lt(t,e){return{}.hasOwnProperty.call(t,e)}const bT="fcSelect",wT=Se({name:bT,inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},type:String},emits:["update:modelValue","fc.el"],setup(t,{emit:e}){const n=$t(t.formCreateInject,"options",[]),i=$t(t,"modelValue");return{options:te(()=>Array.isArray(n.value)?n.value:[]),value:i,handleUpdate:o=>{e("update:modelValue",o)},hasProperty:lt,is:pe}},mounted(){this.$emit("fc.el",this.$refs.el)}});function ET(t,e,n,i,o,r){const s=ze("el-option"),a=ze("el-option-group"),l=ze("el-select");return y(),ne(l,We(t.$attrs,{"model-value":t.value,"onUpdate:modelValue":t.handleUpdate,ref:"el"}),{default:we(()=>[(y(!0),T(Ie,null,He(t.options,(c,u)=>(y(),T(Ie,null,[t.hasProperty(c,"options")?(y(),ne(a,{label:c.label,key:`${u}-${c.label}`},{default:we(()=>[(y(!0),T(Ie,null,He(t.is.trueArray(c.options)?c.options:[],(d,h)=>(y(),ne(s,We({key:`${h}-${d.value}`},{ref_for:!0},d),null,16))),128))]),_:2},1032,["label"])):(y(),ne(s,We({key:`${u}-${c.value}`},{ref_for:!0},c),null,16))],64))),256)),Ve(t.$slots,"default")]),_:3},16,["model-value","onUpdate:modelValue"])}const ST=gi(wT,[["render",ET]]),CT="fcTree",xT=Se({name:CT,inheritAttrs:!1,formCreateParser:{mergeProp(t){const e=t.prop.props;e.nodeKey||(e.nodeKey="id"),e.props||(e.props={label:"title"})}},props:{type:String,modelValue:{type:[Array,String,Number],default:()=>[]}},emits:["update:modelValue","fc.el"],watch:{modelValue(){this.setValue()}},methods:{updateValue(){if(!this.$refs.tree)return;let t;this.type==="selected"?t=this.$refs.tree.getCurrentKey():t=this.$refs.tree.getCheckedKeys(),this.$emit("update:modelValue",t)},setValue(){this.$refs.tree&&(this.type==="selected"?this.$refs.tree.setCurrentKey(this.modelValue):this.$refs.tree.setCheckedKeys(zt(this.modelValue)))}},render(){return j(ze("ElTree"),We(this.$attrs,{ref:"tree",onCheck:this.updateValue,onNodeClick:this.updateValue}),this.$slots)},mounted(){this.setValue(),this.$emit("fc.el",this.$refs.tree)}}),TT={name:"IconUpload"},OT={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function $T(t,e,n,i,o,r){return y(),T("svg",OT,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M160 832h704a32 32 0 110 64H160a32 32 0 110-64zm384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248L544 253.696z"},null,-1)])])}const kT=gi(TT,[["render",$T]]);function Bd(t,e){return typeof t=="object"?t:{url:t,is_string:!0,name:AT(t),uid:e}}function Hd(t){return en(Te({},t),{file:t,value:t})}function AT(t){return(""+t).split("/").pop()}const PT="fcUpload",RT=Se({name:PT,inheritAttrs:!1,formCreateParser:{toFormValue(t){return zt(t)},toValue(t,e){return e.prop.props.limit===1?t[0]||"":t}},props:{previewMask:void 0,onPreview:Function,httpRequest:Function,modalTitle:String,listType:String,uploadText:String,formCreateInject:Object,modelValue:[Array,String,Object]},emits:["update:modelValue","change","remove","fc.el"],data(){return{previewVisible:!1,previewImage:"",fileList:[]}},created(){this.fileList=zt(this.modelValue).map(Bd).map(Hd)},watch:{modelValue(t){this.fileList=zt(t).map(Bd).map(Hd)}},methods:{handlePreview(t){this.onPreview?this.onPreview(...arguments):this.listType==="text"?window.open(t.url):(this.previewImage=t.url,this.previewVisible=!0)},update(t){let e=t.map(n=>n.is_string?n.url:n.value||n.url).filter(n=>n!==void 0);this.$emit("update:modelValue",e)},handleCancel(){this.previewVisible=!1},handleChange(t,e){this.$emit("change",...arguments),t.status==="success"&&this.update(e)},handleRemove(t,e){this.$emit("remove",...arguments),this.update(e)},doHttpRequest(t){if(this.httpRequest)return this.httpRequest(t);t.source="upload",this.formCreateInject.api.fetch(t)}},render(){const t=zt(this.modelValue).length;return j("div",{class:"_fc-upload"},[j(ze("ElUpload"),We({key:t},this.$attrs,{listType:this.listType||"picture-card",class:{"_fc-exceed":this.$attrs.limit?this.$attrs.limit<=t:!1},onPreview:this.handlePreview,onChange:this.handleChange,onRemove:this.handleRemove,httpRequest:this.doHttpRequest,fileList:this.fileList,ref:"upload"}),Te({default:()=>{var e,n;return[((n=(e=this.$slots).default)==null?void 0:n.call(e))||(["text","picture"].indexOf(this.listType)===-1?j(ze("ElIcon"),null,{default:()=>[j(kT,null,null)]}):j(ze("ElButton"),{type:"primary"},{default:()=>[this.formCreateInject.t("clickToUpload")||this.uploadText||"点击上传"]}))]}},yc(this.$slots,["default"]))),j(ze("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:this.modalTitle,modelValue:this.previewVisible,onClose:this.handleCancel},{default:()=>[j("img",{style:"width: 100%",src:this.previewImage},null)]})])},mounted(){this.$emit("fc.el",this.$refs.upload)}});function an(t,e,n){t[e]=n}function Ei(t,e){delete t[e]}function nr(t,e={},n){let i=!1;for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o)){let r=e[o];if((i=Array.isArray(r))||pe.Object(r)){let s=t[o]===void 0;if(i)i=!1,s&&an(t,o,[]);else if(r._clone&&n!==void 0)if(n)r=r.getRule(),s&&an(t,o,{});else{an(t,o,r._clone());continue}else s&&an(t,o,{});t[o]=nr(t[o],r,n)}else an(t,o,r),pe.Undef(r)||(pe.Undef(r.__json)||(t[o].__json=r.__json),pe.Undef(r.__origin)||(t[o].__origin=r.__origin))}return n!==void 0&&Array.isArray(t)?t.filter(o=>!o||!o.__ctrl):t}function Mn(t){return nr({},{value:t}).value}const IT=Object.assign||function(t){for(let e,n=1;n<arguments.length;n++)for(let i in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,i)&&an(t,i,e[i]);return t};function De(){return IT.apply(this,arguments)}function ml(t){return typeof t!="object"||t===null?t:t instanceof Array?[...t]:Te({},t)}function ci(t,e){var n=null;return function(...i){n!==null&&clearTimeout(n),n=setTimeout(()=>t.call(this,...i),e)}}function gm(t){return t==null?"":typeof t=="object"?JSON.stringify(t,null,2):String(t)}function MT(t){return t&&typeof t=="object"&&typeof t.then=="function"}function as(t){return MT(t)?t:Promise.resolve(t)}function Do(t){let e=t.replace(/([A-Z])/g,"-$1").toLocaleLowerCase();return e.indexOf("-")===0&&(e=e.substr(1)),e}function _m(t){return t.replace(t[0],t[0].toLocaleUpperCase())}function ym(t,e,n){return`[form-create ${t}]: ${e}`}function bc(t,e){console.error(ym("err",t))}function DT(t){bc(t.toString()),console.error(t)}const vl="[[FORM-CREATE-PREFIX-",gl="-FORM-CREATE-SUFFIX]]";function Fo(t,e){return JSON.stringify(nr(Array.isArray(t)?[]:{},t,!0),function(n,i){if(!(i&&i._isVue===!0)){if(typeof i!="function")return i;if(i.__json)return i.__json;if(i.__origin&&(i=i.__origin),!i.__emit)return vl+i+gl}},e)}function ca(t){return new Function("return "+t)()}function Fn(t,e){if(t&&pe.String(t)&&t.length>4){let n=t.trim(),i=!1;try{if(n.indexOf(gl)>0&&n.indexOf(vl)===0)n=n.replace(gl,"").replace(vl,""),i=!0;else if(n.indexOf("$FN:")===0)n=n.substring(4),i=!0;else if(n.indexOf("$EXEC:")===0)n=n.substring(6),i=!0;else if(n.indexOf("$GLOBAL:")===0){const r=n.substring(8);return n=function(...s){const a=s[0].api.getGlobalEvent(r);if(a)return a.call(this,...s)},n.__json=t,n.__inject=!0,n}else{if(n.indexOf("$FNX:")===0)return n=ca(`function($inject){
|
|
13
13
|
`+n.substring(5)+`
|
|
14
|
-
}`),n.__json=t,n.__inject=!0,n;(!e&&n.indexOf("function ")===0&&n!=="function "||!e&&n.indexOf("function(")===0&&n!=="function(")&&(i=!0)}if(!i)return t;let o;try{o=
|
|
14
|
+
}`),n.__json=t,n.__inject=!0,n;(!e&&n.indexOf("function ")===0&&n!=="function "||!e&&n.indexOf("function(")===0&&n!=="function(")&&(i=!0)}if(!i)return t;let o;try{o=ca(n)}catch{o=ca("function "+n)}return o.__json=t,o}catch(o){bc(`解析失败:${n}
|
|
15
15
|
|
|
16
|
-
err: ${o}`);return}}return t}function wm(t,e){return JSON.parse(t,function(n,i){return pe.Undef(i)||!i.indexOf?i:Dn(i,e)})}let Dx=0;function Ps(){const t=370+ ++Dx;return"F"+Math.random().toString(36).substr(3,3)+(+`${Date.now()}`).toString(36)+t.toString(36)+"c"}function fi(t,e,n){let i=t,o;return(e||"").split(".").forEach(r=>{o&&((!i[o]||typeof i[o]!="object")&&(i[o]={}),i=i[o]),o=r}),i[o]=n,i}const Lx="fcGroup",jx=Ce({name:Lx,props:{field:String,rule:Array,expand:Number,options:Object,button:{type:Boolean,default:!0},max:{type:Number,default:0},min:{type:Number,default:0},modelValue:{type:Array,default:()=>[]},defaultValue:Object,sortBtn:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},title:{type:[String,Function],default:null},type:{type:String,default:"default"},onBeforeRemove:{type:Function,default:()=>{}},onBeforeAdd:{type:Function,default:()=>{}},formCreateInject:Object,parse:Function},data(){return{len:0,cacheRule:{},cacheValue:{},sort:[],form:Gn(this.formCreateInject.form.$form())}},emits:["update:modelValue","change","itemMounted","remove","add"],watch:{rule:{handler(t,e){Object.keys(this.cacheRule).forEach(n=>{const i=this.cacheRule[n];if(i.$f){const o=i.$f.formData();if(t===e)i.$f.deferSyncValue(()=>{ir(i.rule,t),i.$f.setValue(o)},!0);else{const r=i.$f.formData();i.$f.once("reloading",()=>{i.$f.setValue(r)}),i.rule=Mn(t)}}})},deep:!0},expand(t){let e=t-this.modelValue.length;e>0&&this.expandRule(e)},modelValue:{handler(t){t=t||[];let e=this.sort,n=e.length,i=n-t.length;if(i<0){for(let o=i;o<0;o++)this.addRule(t.length+o,!0);for(let o=0;o<n;o++)this.setValue(e[o],t[o])}else{if(i>0)for(let o=0;o<i;o++)this.removeRule(e[n-o-1]);t.forEach((o,r)=>{this.setValue(e[r],t[r])})}},deep:!0}},methods:{_value(t){return t&<(t,this.field)?t[this.field]:t},cache(t,e){this.cacheValue[t]=JSON.stringify(e)},input(t){this.$emit("update:modelValue",t),this.$emit("change",t)},formData(t,e){const n=this.cacheRule,i=this.sort;if(i.filter(r=>n[r]&&n[r].$f).length!==i.length)return;const o=i.map(r=>{const s=t===r?e:Te({},this.cacheRule[r].$f.form),a=this.field?pe.Undef(s[this.field])?null:s[this.field]:s;return this.cache(r,a),a});this.input(o)},setValue(t,e){const n=this.field;n&&(e={[n]:this._value(e)}),this.cacheValue[t]!==JSON.stringify(n?e[n]:e)&&(this.cacheRule[t].$f&&this.cacheRule[t].$f.coverValue(e),this.cache(t,e))},addRule(t,e){const n=this.formCreateInject.form.copyRules(this.rule||[]),i=this.options?Te({},this.options):{submitBtn:!1,resetBtn:!1};if(this.defaultValue){i.formData||(i.formData={});const o=Mn(this.defaultValue);Fe(i.formData,this.field?{[this.field]:o}:o)}this.parse&&this.parse({rule:n,options:i,index:this.sort.length}),this.cacheRule[++this.len]={rule:n,options:i},this.sort=Object.keys(this.cacheRule),e&&Ge(()=>this.$emit("add",n,Object.keys(this.cacheRule).length-1))},add$f(t,e,n){this.cacheRule[e].$f=n,Ge(()=>{this.$emit("itemMounted",n,Object.keys(this.cacheRule).indexOf(e))})},removeRule(t,e){const n=Object.keys(this.cacheRule).indexOf(t);delete this.cacheRule[t],delete this.cacheValue[t],this.sort=Object.keys(this.cacheRule),e&&Ge(()=>this.$emit("remove",n))},add(t){if(this.disabled||this.onBeforeAdd(this.modelValue)===!1)return;const e=[...this.modelValue];e.push(this.defaultValue?Mn(this.defaultValue):this.field?null:{}),this.input(e)},del(t,e){if(this.disabled)return;const n=()=>{this.removeRule(e,!0);const i=[...this.modelValue];i.splice(t,1),this.input(i)};as(this.onBeforeRemove(this.modelValue,t)).then(i=>{i!==!1&&n()})},addIcon(t){return j("div",{class:"_fc-group-btn _fc-group-plus-minus",onClick:this.add},null)},delIcon(t,e){return j("div",{class:"_fc-group-btn _fc-group-plus-minus _fc-group-minus",onClick:()=>this.del(t,e)},null)},sortUpIcon(t){return j("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-up",onClick:()=>this.changeSort(t,-1)},null)},sortDownIcon(t){return j("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-down",onClick:()=>this.changeSort(t,1)},null)},changeSort(t,e){const n=this.sort[t];this.sort[t]=this.sort[t+e],this.sort[t+e]=n,this.formCreateInject.subForm(this.sort.map(i=>this.cacheRule[i].$f)),this.formData(0)},sortIcon(t,e){const n=t>0,i=t<e-1,o=[];return!n&&!i?o:this.type==="card"&&n&&i?(o.push(j("div",{class:"_fc-group-btn _fc-group-sort"},[j("div",{class:" _fc-group-sort-up",onClick:()=>this.changeSort(t,-1)},null),j("div",{class:" _fc-group-sort-down",onClick:()=>this.changeSort(t,1)},null)])),o):(n&&o.push(this.sortUpIcon(t)),i&&o.push(this.sortDownIcon(t)),o)},makeIcon(t,e,n){if(this.$slots.button)return this.$slots.button({total:t,index:e,vm:this,key:n,del:()=>this.del(e,n),add:this.add});const i=[];if((!this.max||t<this.max)&&t===e+1&&i.push(this.addIcon(n)),t>this.min&&i.push(this.delIcon(e,n)),this.sortBtn){const o=this.sortIcon(e,t);o&&i.push(...o)}return i},expandRule(t){for(let e=0;e<t;e++)this.modelValue.push(this.field?null:{});this.input([...this.modelValue])},getTitle(t,e){return typeof this.title=="function"?this.title(t,this.modelValue[t],e):typeof this.title=="string"?this.title.replace("{index}",t+1):!1}},created(){const t=(this.expand||0)-this.modelValue.length;for(let e=0;e<this.modelValue.length;e++)this.addRule(e);t>0&&this.expandRule(t)},render(){const t=this.sort,e=this.button,n=this.form,i=this.disabled,o=this.type==="card",r=t.length===0?this.$slots.default?this.$slots.default({vm:this,add:this.add}):j("div",{key:"a_def",class:"_fc-group-plus-minus _fc-group-add fc-clock",onClick:this.add},null):t.map((s,a)=>{const{rule:l,options:c}=this.cacheRule[s],u=e&&!i?this.makeIcon(t.length,a,s):[],d=this.getTitle(a,s);return o?j("div",{class:"_fc-group-container",key:s},[j("div",{class:"_fc-group-header"},[d===!1?j("div",{class:"_fc-group-idx"},[a+1]):null,d!==!1?j("div",{class:"_fc-group-title"},[d]):null,j("div",{class:"_fc-group-handle fc-clock"},[u.length?u:null])]),j("div",{class:"_fc-group-content"},[j(n,We({key:s},en(Te({},this.$attrs),{disabled:i,"onUpdate:modelValue":h=>this.formData(s,h),"onUpdate:api":h=>this.add$f(a,s,h),inFor:!0,modelValue:this.field?{[this.field]:this._value(this.modelValue[a])}:this.modelValue[a],rule:l,option:c,extendOption:!0})),null)])]):j("div",{class:"_fc-group-container",key:s},[j(n,We({key:s},en(Te({},this.$attrs),{disabled:i,"onUpdate:modelValue":h=>this.formData(s,h),"onUpdate:api":h=>this.add$f(a,s,h),inFor:!0,modelValue:this.field?{[this.field]:this._value(this.modelValue[a])}:this.modelValue[a],rule:l,option:c,extendOption:!0})),null),j("div",{class:"_fc-group-idx"},[a+1]),u.length?j("div",{class:"_fc-group-handle fc-clock"},[u]):null])});return j("div",{key:"con",class:"_fc-group "+(i?"_fc-group-disabled":"")+(o?" _fc-group-card":"")},[r])}}),zx="fcSubForm",Nx=Ce({name:zx,props:{rule:Array,options:{type:Object,default:()=>Mt({submitBtn:!1,resetBtn:!1})},modelValue:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},formCreateInject:Object},data(){return{cacheValue:{},subApi:{},form:Gn(this.formCreateInject.form.$form())}},emits:["fc:subform","update:modelValue","change","itemMounted"],watch:{modelValue(t){this.setValue(t)}},methods:{formData(t){this.cacheValue=JSON.stringify(t),this.$emit("update:modelValue",t),this.$emit("change",t)},setValue(t){const e=JSON.stringify(t);this.cacheValue!==e&&(this.cacheValue=e,this.subApi.coverValue(t||{}))},add$f(t){this.subApi=t,Ge(()=>{this.$emit("itemMounted",t)})}},render(){const t=this.form;return j(t,{disabled:this.disabled,"onUpdate:modelValue":this.formData,modelValue:this.modelValue,"onUpdate:api":this.add$f,rule:this.rule,option:this.options,extendOption:!0},null)}}),Ux={name:"IconWarning"},Vx={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function Bx(t,e,n,i,o,r){return y(),T("svg",Vx,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M512 64a448 448 0 110 896 448 448 0 010-896zm0 832a384 384 0 000-768 384 384 0 000 768zm48-176a48 48 0 11-96 0 48 48 0 0196 0zm-48-464a32 32 0 0132 32v288a32 32 0 01-64 0V288a32 32 0 0132-32z"},null,-1)])])}const Hx=gi(Ux,[["render",Bx]]),qx=[G2,gx,yx,Cx,xx,Rx,jx,Nx,Hx],Sm=["props"],Cm=["class","style","directives"],Em=["on","hook"],Qn=(t,e={},n={})=>{const i=[...Sm,...n.normal||[]],o=[...Cm,...n.array||[]],r=[...Em,...n.functional||[]],s=n.props||[];return t.reduce((a,l)=>{for(const c in l)if(a[c])if(s.indexOf(c)>-1)a[c]=Qn([l[c]],a[c]);else if(i.indexOf(c)>-1)a[c]=Te(Te({},a[c]),l[c]);else if(o.indexOf(c)>-1){const u=a[c]instanceof Array?a[c]:[a[c]],d=l[c]instanceof Array?l[c]:[l[c]];a[c]=[...u,...d]}else if(r.indexOf(c)>-1)for(const u in l[c])if(a[c][u]){const d=a[c][u]instanceof Array?a[c][u]:[a[c][u]],h=l[c][u]instanceof Array?l[c][u]:[l[c][u]];a[c][u]=[...d,...h]}else a[c][u]=l[c][u];else if(c==="hook")for(let u in l[c])a[c][u]?a[c][u]=Wx(a[c][u],l[c][u]):a[c][u]=l[c][u];else a[c]=l[c];else i.indexOf(c)>-1||r.indexOf(c)>-1||s.indexOf(c)>-1?a[c]=Te({},l[c]):o.indexOf(c)>-1?a[c]=l[c]instanceof Array?[...l[c]]:typeof l[c]=="object"?Te({},l[c]):l[c]:a[c]=l[c];return a},e)},Wx=(t,e)=>function(){t&&t.apply(this,arguments),e&&e.apply(this,arguments)},xm=["type","slot","ignore","emitPrefix","value","name","native","hidden","display","inject","options","emit","link","prefix","suffix","update","sync","optionsTo","key","slotUpdate","computed","preview","component","cache","modelEmit"],Cc=["validate","children","control"],Ec=["effect","deep","renderSlots"];function Tm(){return[...xm,...Sm,...Cm,...Em,...Cc,...Ec]}function Vt(t){const e=t.replace(/(-[a-z])/g,function(n){return n.replace("-","").toLocaleUpperCase()});return $m(e)}function $m(t){return t.replace(t[0],t[0].toLowerCase())}function yl(t,e){return{value:t,enumerable:!1,configurable:!1,writable:!0}}function km(t,e){return Om([t],e||!1)[0]}function Om(t,e){return ir([],[...t],e||!1)}function Zn(t,e){return Qn(Array.isArray(e)?e:[e],t,{array:Cc,normal:Ec}),t}function Wd(t){const e=pe.Function(t.getRule)?t.getRule():t;return e.type||(e.type="input"),e}function Kx(t,e){return t?(Object.keys(e||{}).forEach(n=>{e[n]&&(t[n]=Zn(t[n]||{},e[n]))}),t):e}function Am(t,e){Object.defineProperties(t,Object.keys(e).reduce((n,i)=>(n[i]={get(){return e[i]()}},n),{}))}function On(t){return t.__fc__||(t.__origin__?t.__origin__.__fc__:null)}function Be(t,e){try{e=t()}catch(n){Fx(n)}return e}function wr(){const t={},e=n=>n||"default";return{setSlot(n,i){n=e(n),!(!i||Array.isArray(i)&&i.length)&&(t[n]||(t[n]=[]),t[n].push(i))},getSlot(n,i){n=e(n);const o=[];return(t[n]||[]).forEach(r=>{if(Array.isArray(r))o.push(...r);else if(pe.Function(r)){const s=r(...i||[]);Array.isArray(s)?o.push(...s):o.push(s)}else pe.Undef(r)||o.push(r)}),o},getSlots(){const n={};return Object.keys(t).forEach(i=>{n[i]=(...o)=>this.getSlot(i,o)}),n},slotLen(n){return n=e(n),t[n]?t[n].length:0},mergeBag(n){if(!n)return this;const i=pe.Function(n.getSlots)?n.getSlots():n;return Array.isArray(n)||Ui(n)?this.setSlot(void 0,()=>n):Object.keys(i).forEach(o=>{this.setSlot(o,i[o])}),this}}}function Kd(t){const e=Te({},t.props||{});return Object.keys(t.on||{}).forEach(n=>{n.indexOf("-")>0&&(n=Vt(n));const i=`on${ym(n)}`;Array.isArray(e[i])?e[i]=[...e[i],t.on[n]]:e[i]?e[i]=[e[i],t.on[n]]:e[i]=t.on[n]}),e.key=t.key,e.ref=t.ref,e.class=t.class,e.id=t.id,e.style=t.style,e.slot&&delete e.slot,e}function Sr(t,e){return Object.setPrototypeOf(t,e),t}const Yd=(t,e)=>typeof t=="string"?String(e):typeof t=="number"?Number(e):e,Ai={"==":(t,e)=>JSON.stringify(t)===JSON.stringify(Yd(t,e)),"!=":(t,e)=>!Ai["=="](t,e),">":(t,e)=>t>e,">=":(t,e)=>t>=e,"<":(t,e)=>t<e,"<=":(t,e)=>t<=e,on(t,e){return t&&t.indexOf&&t.indexOf(Yd(t[0],e))>-1},notOn(t,e){return!Ai.on(t,e)},in(t,e){return e&&e.indexOf&&e.indexOf(t)>-1},notIn(t,e){return!Ai.in(t,e)},between(t,e){return t>e[0]&&t<e[1]},notBetween(t,e){return t<e[0]||t>e[1]},empty(t){return pe.empty(t)},notEmpty(t){return!pe.empty(t)},pattern(t,e){return new RegExp(e,"g").test(t)}};function Pt(t,e){return(Array.isArray(e)?e:(e||"").split(".")).forEach(n=>{t!=null&&(t=t[n])}),t}function Yx(t){const e=/{{\s*(.*?)\s*}}/g;let n;const i={};for(;(n=e.exec(t))!==null;)n[1]&&(i[n[1]]=!0);return Object.keys(i)}function Gd(t){let e=t.split("."),n=[],i="";return e.forEach((o,r)=>{r===0?i=o:i+="."+o,n.push(i)}),n.join(" && ")}function Pm(t){const e=[];let n="",i=0;for(let o=0;o<t.length;o++){const r=t[o];r==="["?(i===0&&n&&(e.push({type:"key",value:n}),n=""),i++,n+=r):r==="]"?(i--,n+=r,i===0&&(e.push({type:"bracket",value:Pm(n.slice(1,-1))}),n="")):r==="."&&i===0?n&&(e.push({type:"key",value:n}),n=""):n+=r}return n&&e.push({type:"key",value:n}),e.map(o=>o.type==="key"?{key:o.value}:{children:o.value})}const Yr=(t,e)=>{if(!(!t||t===e)){if(t.props.formCreateInject)return t.props.formCreateInject;if(t.parent)return Yr(t.parent,e)}};function Gx(t,e,n){return Ce({name:"FormCreate"+(t.isMobile?"Mobile":""),components:e,directives:n,props:{rule:{type:Array,required:!0,default:()=>[]},option:{type:Object,default:()=>({})},extendOption:Boolean,driver:[String,Object],modelValue:Object,disabled:{type:Boolean,default:void 0},preview:{type:Boolean,default:void 0},index:[String,Number],api:Object,locale:[String,Object],t:Function,name:String,subForm:{type:Boolean,default:!0},inFor:Boolean},emits:["update:api","update:modelValue","mounted","beforeUnmount","submit","reset","change","emit-event","control","remove-rule","remove-field","sync","reload","repeat-field","update","validate-field-fail","validate-fail","created"],render(){return this.fc.render()},setup(i){const o=Za();Hp("parentFC",o);const r=Ao("parentFC",null);let s=r;if(r)for(;s.setupState.parent;)s=s.setupState.parent;else s=o;const{rule:a,modelValue:l,subForm:c,inFor:u}=Ja(i),d=Mt({ctxInject:{},destroyed:!1,isShow:!0,unique:1,renderRule:[...a.value||[]],updateValue:JSON.stringify(l.value||{})}),h=new t(o),m=h.api(),f=u.value,p=()=>{if(r){const x=Yr(o,r);if(x){let O;f?(O=Ut(x.getSubForm()),O.push(m)):O=m,x.subForm(O)}}},_=()=>{const x=Yr(o,r);if(x)if(f){const O=Ut(x.getSubForm()),$=O.indexOf(m);$>-1&&O.splice($,1)}else x.subForm()};let C=null;w_(()=>{zt(()=>{let x="";const O=i.option&&i.option.globalClass||{};Object.keys(O).forEach($=>{let K="";O[$].style&&Object.keys(O[$].style).forEach(F=>{K+=Do(F)+":"+O[$].style[F]+";"}),O[$].content&&(K+=O[$].content+";"),K&&(x+=`.${$}{${K}}`)}),i.option&&i.option.style&&(x+=i.option.style),C||(C=document.createElement("style"),C.type="text/css",document.head.appendChild(C)),C.innerHTML=x||""})});const w=ci(()=>{h.bus.$emit("$loadData.$topForm")},100),S=ci(function(){h.bus.$emit("$loadData.$scopeForm")},100),b=ci(()=>{h.bus.$emit("$loadData.$form")},100),E=x=>{h.bus.$emit("change-$form."+x)};return et(()=>{r&&(m.top.bus.$on("$loadData.$form",w),m.top.bus.$on("change",E)),m!==m.scope&&m.scope.bus.$on("$loadData.$scopeForm",S),h.mounted()}),bs(()=>{r&&(m.top.bus.$off("$loadData.$form",w),m.top.bus.$off("change",E)),m!==m.scope&&m.scope.bus.$off("$loadData.$scopeForm",S),_(),d.destroyed=!0,h.unmount(),C&&(C.parentNode||C.parentElement)&&document.head.removeChild(C)}),Bp(()=>{h.updated()}),p(),$e(()=>i.option,()=>{h.initOptions(),m.refresh()},{deep:!0,flush:"sync"}),$e(()=>[...a.value],x=>{h.$handle.isBreakWatch()||x.length===d.renderRule.length&&x.every(O=>d.renderRule.indexOf(O)>-1)||(h.$handle.updateAppendData(),h.$handle.reloadRule(a.value),o.setupState.renderRule())}),$e(()=>[i.disabled,i.preview],()=>{m.refresh()}),$e(l,x=>{Lo(x||{})!==d.updateValue&&(m.config.forceCoverValue?m.coverValue(x||{}):m.setValue(x||{}))},{deep:!0,flush:"post"}),$e(()=>i.index,()=>{m.coverValue({}),h.$handle.updateAppendData(),Ge(()=>{Ge(()=>{m.clearValidateState()})})},{flush:"sync"}),en(Te({fc:Gn(h),parent:r&&Gn(r),top:Gn(s),fapi:Gn(m)},Ja(d)),{getGroupInject:()=>Yr(o,r),refresh(){++d.unique},renderRule(){d.renderRule=[...a.value||[]]},updateValue(x){if(d.destroyed)return;const O=Lo(x);d.updateValue!==O&&(d.updateValue=O,o.emit("update:modelValue",x),Ge(()=>{b(),r?c.value||S():(w(),S())}))}})},created(){const i=Za();i.emit("update:api",i.setupState.fapi),i.setupState.fc.init()}})}function Rm(){return{props:{},on:{},options:[],children:[],hidden:!1,display:!0,value:void 0}}function Et(t,e){return(n,i,o,r={})=>{const s=new xc(t,n,i,o,r);return e&&(pe.Function(e)?e(s):s.props(e)),s}}function xc(t,e,n,i,o){this._data=Fe(Rm(),{type:t,title:e,field:n,value:i,props:o||{}}),this.event=this.on}Fe(xc.prototype,{getRule(){return this._data},setProp(t,e){return an(this._data,t,e),this},modelField(t){return this._data.modelField=t,this},_clone(){const t=new this.constructor;return t._data=km(this._data),t}});function Im(t){t.forEach(e=>{xc.prototype[e]=function(n){return Zn(this._data,{[e]:arguments.length<2?n:{[n]:arguments[1]}}),this}})}Im(Tm());const Qx=Et("");function Xx(t,e,n){let i=Qx("",e);return i._data.type=t,i._data.title=n,i}function Jx(){return{create:Xx,factory:Et}}function Zx(t,e,n){const i=`fail to ${t} ${n.status}'`,o=new Error(i);return o.status=n.status,o.url=t,o}function Qd(t){const e=t.responseText||t.response;if(!e)return e;try{return JSON.parse(e)}catch{return e}}function Mm(t){if(typeof XMLHttpRequest>"u")return;const e=new XMLHttpRequest;let n=t.action||"";if(e.upload&&t.onProgress&&e.upload.addEventListener("progress",r=>{r.percent=r.total>0?r.loaded/r.total*100:0,t.onProgress(r)}),t.query){const r=pe.String(t.query)?t.query:Object.keys(t.query).reduce((a,l)=>(a[l]=t.query[l]===null||t.query[l]===void 0?"":t.query[l],a),{}),s=new URLSearchParams(r).toString();s&&(n.includes("?")?n+=`&${s}`:n+=`?${s}`)}e.onerror=function(r){t.onError(r)},e.onload=function(){if(e.status<200||e.status>=300)return t.onError(Zx(n,t,e),Qd(e));t.onSuccess(Qd(e))},e.open(t.method||"get",n,!0);let i;(t.data||t.file)&&(t.file||(t.dataType||"").toLowerCase()!=="json"?(i=new FormData,Object.keys(t.data||{}).map(r=>{i.append(r,t.data[r])})):(i=JSON.stringify(t.data||{}),e.setRequestHeader("content-type","application/json"))),t.file&&i.append(t.filename,t.file,t.file.name),t.withCredentials&&"withCredentials"in e&&(e.withCredentials=!0);const o=t.headers||{};Object.keys(o).forEach(r=>{o[r]!=null&&e.setRequestHeader(r,o[r])}),e.send(i)}function Xd(t,e,n){return new Promise((i,o)=>{(e||Mm)(en(Te({},t),{onSuccess(r){let s=l=>l;const a=Dn(t.parse);pe.Function(a)?s=a:a&&pe.String(a)&&(s=l=>Pt(l,a)),as(s(r,t.targetRule,n)).then(l=>{i(l)})},onError(r){o(r)}}))})}function So(t){return Mn(t)}function eT(t){function e(r){return pe.Undef(r)?r=t.fields():Array.isArray(r)||(r=[r]),r}function n(r,s,a){pe.Undef(r)?r=Object.keys(Te(Te({},t.fieldCtx),t.nameCtx)):Array.isArray(r)||(r=[r]),r.forEach(l=>{const c=t.fieldCtx[l]||t.nameCtx[l];c&&c.forEach(u=>{an(u.rule,s,a),t.$render.clearCache(u)})})}function i(){const r=t.subForm;return Object.keys(r).reduce((s,a)=>{const l=r[a];return l&&(Array.isArray(l)?s.push(...l):s.push(l)),s},[])}const o={get isScope(){return t.vm.props.subForm===!1},get isPreview(){return t.preview},get config(){return t.options},set config(r){t.fc.options.value=r},get options(){return t.options},set options(r){t.fc.options.value=r},get form(){return t.form},get rule(){return t.rules},get parent(){return t.vm.setupState.parent&&t.vm.setupState.parent.setupState.fapi},get top(){return o.parent?o.parent.top:o},get scope(){let r=t.vm;for(;r&&r.setupState.fapi;)if(r.props.subForm)r=r.setupState.parent;else return r.setupState.fapi;return o.top},get children(){return i()},get siblings(){const r=t.vm.setupState.getGroupInject();if(r){const s=r.getSubForm();if(Array.isArray(s))return[...s]}},get index(){const r=o.siblings;if(r){const s=r.indexOf(o);return s>-1?s:void 0}},get formulas(){return Te({},t.fc.formulas)},formData(r){if(r==null||typeof r=="boolean"){const s={};return Object.keys(t.form).forEach(a=>{(r===!0||t.ignoreFields.indexOf(a)===-1)&&(s[a]=So(t.form[a]))}),s}else return e(r).reduce((s,a)=>(s[a]=o.getValue(a),s),{})},getValue(r){const s=t.getFieldCtx(r);return s?So(s.rule.value):t.options.appendValue!==!1&<(t.appendData,r)?So(t.appendData[r]):void 0},coverValue(r){const s=Te({},r||{});t.deferSyncValue(()=>{t.appendData={},o.fields().forEach(a=>{const l=t.fieldCtx[a];if(l){const c=lt(r,a);l.forEach(u=>{u.rule.value=c?r[a]:void 0}),delete s[a]}}),Fe(t.appendData,s)},!0)},setValue(r){let s=r;arguments.length>=2&&(s={[r]:arguments[1]}),t.deferSyncValue(()=>{Object.keys(s).forEach(a=>{const l=t.fieldCtx[a];if(!l)return t.appendData[a]=s[a];l.forEach(c=>{c.rule.value=s[a]})})},!0)},removeField(r){const s=t.getCtx(r);return t.deferSyncValue(()=>{t.getCtxs(r).forEach(a=>{a.rm()})},!0),s?s.origin:void 0},removeRule(r){const s=r&&On(r);if(s)return s.rm(),s.origin},fields:()=>t.fields(),append:(r,s,a)=>{let l=t.sort.length-1,c;const u=t.getCtx(s);if(u)if(a){if(c=u.getPending("children",u.rule.children),!Array.isArray(c))return;l=u.rule.children.length-1}else l=u.root.indexOf(u.origin),c=u.root;else c=t.rules;c.splice(l+1,0,r)},prepend:(r,s,a)=>{let l=0,c;const u=t.getCtx(s);if(u)if(a){if(c=u.getPending("children",u.rule.children),!Array.isArray(c))return}else l=u.root.indexOf(u.origin),c=u.root;else c=t.rules;c.splice(l,0,r)},hidden(r,s){n(s,"hidden",!!r),t.refresh()},hiddenStatus(r){const s=t.getCtx(r);if(s)return!!s.rule.hidden},display(r,s){n(s,"display",!!r),t.refresh()},displayStatus(r){const s=t.getCtx(r);if(s)return!!s.rule.display},disabled(r,s){e(s).forEach(a=>{t.getCtxs(a).forEach(l=>{an(l.rule.props,"disabled",!!r)})}),t.refresh()},all(r){return Object.keys(t.ctxs).map(s=>{const a=t.ctxs[s];return r?a.origin:a.rule})},model(r){return t.fields().reduce((s,a)=>{const l=t.fieldCtx[a][0];return s[a]=r?l.origin:l.rule,s},{})},component(r){return Object.keys(t.nameCtx).reduce((s,a)=>{const l=t.nameCtx[a].map(c=>r?c.origin:c.rule);return s[a]=l.length===1?l[0]:l,s},{})},bind(){return o.form},reload:r=>{t.reloadRule(r)},updateOptions(r){t.fc.updateOptions(r),o.refresh()},onSubmit(r){o.updateOptions({onSubmit:r})},sync:r=>{if(Array.isArray(r)){r.forEach(a=>o.sync(a));return}let s=pe.Object(r)?On(r):t.getCtxs(r);s&&(s=Array.isArray(s)?s:[s],s.forEach(a=>{if(!a.deleted){const l=t.subForm[a.id];l&&(Array.isArray(l)?l.forEach(c=>{c.refresh()}):l&&l.refresh()),t.$render.clearCache(a)}}),t.refresh())},refresh:()=>{i().forEach(r=>{r.refresh()}),t.$render.clearCacheAll(),t.refresh()},refreshOptions(){t.$manager.updateOptions(t.options),o.refresh()},hideForm:r=>{t.vm.setupState.isShow=!r},changeStatus:()=>t.changeStatus,clearChangeStatus:()=>{t.changeStatus=!1},updateRule(r,s){t.getCtxs(r).forEach(a=>{Fe(a.rule,s)})},updateRules(r){Object.keys(r).forEach(s=>{o.updateRule(s,r[s])})},mergeRule:(r,s)=>{t.getCtxs(r).forEach(a=>{Zn(a.rule,s)})},mergeRules(r){Object.keys(r).forEach(s=>{o.mergeRule(s,r[s])})},getRule:(r,s)=>{const a=t.getCtx(r);if(a)return s?a.origin:a.rule},findType(r,s){let a;return Object.keys(t.ctxs).forEach(l=>{const c=t.ctxs[l];c.rule.type===r&&(a=s?c.origin:c.rule)}),a},findTypes(r,s){let a=[];return Object.keys(t.ctxs).forEach(l=>{const c=t.ctxs[l];c.rule.type===r&&a.push(s?c.origin:c.rule)}),a},getRenderRule:r=>{const s=t.getCtx(r);if(s)return s.prop},getRefRule:r=>{const s=t.getCtxs(r);if(s){const a=s.map(l=>l.rule);return a.length===1?a[0]:a}},setEffect(r,s,a){const l=t.getCtx(r);l&&s&&(s[0]==="$"&&(s=s.substr(1)),lt(l.rule,"$"+s)&&an(l.rule,"$"+s,a),lt(l.rule,"effect")||(l.rule.effect={}),an(l.rule.effect,s,a))},clearEffectData(r,s){const a=t.getCtx(r);a&&(s&&s[0]==="$"&&(s=s.substr(1)),a.clearEffectData(s),o.sync(r))},updateValidate(r,s,a){a?o.mergeRule(r,{validate:s}):n(r,"validate",s)},updateValidates(r,s){Object.keys(r).forEach(a=>{o.updateValidate(a,r[a],s)})},refreshValidate(){o.refresh()},resetFields(r){e(r).forEach(s=>{t.getCtxs(s).forEach(a=>{t.$render.clearCache(a),a.rule.value=So(a.defaultValue)})}),Ge(()=>{Ge(()=>{Ge(()=>{o.clearValidateState(r)})})}),r==null&&(pe.Function(t.options.onReset)&&Be(()=>t.options.onReset(o)),t.vm.emit("reset",o))},method(r,s){const a=o.el(r);if(!a||!a[s])throw new Error(bm("err",`${s} 方法不存在`));return(...l)=>a[s](...l)},exec(r,s,...a){return Be(()=>o.method(r,s)(...a))},toJson(r){return Lo(o.rule,r)},trigger(r,s,...a){const l=o.el(r);l&&l.$emit(s,...a)},el(r){const s=t.getCtx(r);if(s)return s.el||t.vm.refs[s.ref]},scrollTo(r,s={block:"center",inline:"nearest",behavior:"smooth"}){const a=o.el(r);if(!a)return;const l=a.$el!==void 0?a.$el:a;if(!l)return;const c=l.nodeType===1?l:l.firstElementChild;c&&typeof c.scrollIntoView=="function"&&c.scrollIntoView(s)},focus(r){const s=o.el(r);if(!s)return;const a=d=>!d||typeof d.focus!="function"?!1:(Be(()=>d.focus()),!0);if(a(s))return;const l=s.$el!==void 0?s.$el:s;if(a(l))return;const c=l&&(l.nodeType===1?l:l.firstElementChild);if(a(c)||!c||!c.querySelector)return;const u=c.querySelector('input:not([type=hidden]):not([disabled]),textarea:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])');a(u)},closeModal:r=>{t.bus.$emit("fc:closeModal:"+r)},getSubForm(r){const s=t.getCtx(r);return s?t.subForm[s.id]:void 0},getChildrenRuleList(r){const s=typeof r=="object",a=s?On(r):t.getCtx(r),l=a?a.rule:s?r:o.getRule(r);if(!l)return[];const c=[];return(u=>{u&&u.forEach(d=>{typeof d=="object"&&(d.field&&c.push(d),c.push(...o.getChildrenRuleList(d)))})})(a?a.loadChildrenPending():l.children),c},getParentRule(r){return(typeof r=="object"?On(r):t.getCtx(r)).parent.rule},getParentSubRule(r){const s=typeof r=="object"?On(r):t.getCtx(r);if(s){const a=s.getParentGroup();if(a)return a.rule}},getChildrenFormData(r,s){return o.getChildrenRuleList(r).reduce((a,l)=>((l.ignore!==!0||s===!0)&&(a[l.field]=So(l.value)),a),{})},setChildrenFormData(r,s,a){const l=o.getChildrenRuleList(r);t.deferSyncValue(()=>{l.forEach(c=>{lt(s,c.field)?c.value=s[c.field]:a&&(c.value=void 0)})})},getGlobalEvent(r){let s=o.options.globalEvent[r];if(s)return typeof s=="object"&&(s=s.handle),Dn(s)},getGlobalData(r){return new Promise((s,a)=>{let l=o.options.globalData[r];l?l.type==="fetch"?o.fetch(l).then(c=>{s(c)}).catch(a):s(l.data):s(t.fc.loadData[r])})},emitGlobalEvent(r,...s){const a=o.getGlobalEvent(r);if(a){const l=t.getInjectData({},void 0);return l.args=[...s],s.unshift(l),a.apply(null,s)}},setGlobalData(r,s){o.setData("$globalData."+r,s)},setGlobalVar(r,s){o.setData("$var."+r,s)},renderRule(r,s,a){const l=typeof r=="object"?On(r):t.getCtx(r);return l?t.$render.createRuleVnode(l,s,a):void 0},renderChildren(r,s,a){const l=typeof r=="object"?On(r):t.getCtx(r);return l?t.$render.createChildrenVnodes(l,s,a):void 0},nextTick(r){t.bus.$once("next-tick",r),t.refresh()},nextRefresh(r){t.nextRefresh(),r&&Be(r)},deferSyncValue(r,s){t.deferSyncValue(r,s)},emit(r,...s){t.vm.emitsOptions&&!t.vm.emitsOptions[r]&&(t.vm.emitsOptions[r]=null),t.vm.emit(r,...s)},bus:t.bus,getCurrentFormRule(){var r;return(r=t.vm.setupState.getGroupInject())==null?void 0:r.rule},fetch(r){return new Promise((s,a)=>{let l=Te({},r);l=t.loadFetchVar(l);const c=u=>{Be(()=>l.onError&&l.onError(u)),a(u)};t.beforeFetch(l).then(()=>Xd(l,t.fc.create.fetch,o).then(u=>{Be(()=>l.onSuccess&&l.onSuccess(u)),s(u)}).catch(u=>{c(u)})).catch(u=>{c(u)})})},watchFetch(r,s,a,l){return t.fc.watchLoadData((c,u)=>{let d=Te({},r);if(d=t.loadFetchVar(d,c),l&&l(d,u)===!1)return;const h=m=>{Be(()=>d.onError&&d.onError(m)),a&&a(m)};t.beforeFetch(d).then(()=>Xd(d,t.fc.create.fetch,o).then(m=>{Be(()=>d.onSuccess&&d.onSuccess(m)),s&&s(m,u)}).catch(m=>{h(m)})).catch(m=>{h(m)})},r.wait==null?1e3:r.wait)},getData(r,s){return t.fc.get?t.fc.get(r,s):t.fc.getLoadData(r,s)},watchData(r){return t.fc.watchLoadData((s,a)=>{Be(()=>r(s,a))})},setData(r,s,a){return t.fc.setData(r,s,a)},refreshData(r){return t.fc.refreshData(r)},t(r,s){return t.fc.t(r,s)},getLocale(){return t.fc.getLocale()},helper:{tidyFields:e,props:n}};return["on","once","off"].forEach(r=>{o[r]=function(...s){t.bus[`$${r}`](...s)}}),o.changeValue=o.changeField=o.setValue,o}function tT(t){Fe(t.prototype,{initCache(){this.clearCacheAll()},clearCache(e){if(!e.rule.cache){if(!this.cache[e.id]){e.parent&&this.clearCache(e.parent);return}(this.cache[e.id].use===!0||this.cache[e.id].parent)&&this.$handle.refresh(),this.cache[e.id].parent&&this.clearCache(this.cache[e.id].parent),this.cache[e.id]=null}},clearCacheAll(){this.cache={}},setCache(e,n,i){this.cache[e.id]={vnode:n,use:!1,parent:i,slot:e.rule.slot}},getCache(e){const n=this.cache[e.id];if(n)return n.use=!0,n.vnode}})}function nT(t){Fe(t.prototype,{initRender(){this.cacheConfig={}},getTypeSlot(e){const n=i=>{if(i){let o;return e.rule.field&&(o=i.slots["field-"+Do(e.rule.field)]||i.slots["field-"+e.rule.field]),o||(o=i.slots["type-"+Do(e.type)]||i.slots["type-"+e.type]),o||n(i.setupState.parent)}};return n(this.vm)},render(){if(!this.vm.setupState.isShow)return;this.$manager.beforeRender();const e=wr();return this.sort.forEach(n=>{this.renderSlot(e,this.$handle.ctxs[n])}),this.$manager.render(e)},renderSlot(e,n,i){if(this.isFragment(n)){n.initProp(),this.mergeGlobal(n),n.initNone();const o=this.renderChildren(n.loadChildrenPending(),n),r=o.default;r&&e.setSlot(n.rule.slot,()=>r()),delete o.default,e.mergeBag(o)}else e.setSlot(n.rule.slot,this.renderCtx(n,i))},mergeGlobal(e){this.$handle.options.global&&(this.cacheConfig[e.trueType]||(this.cacheConfig[e.trueType]=te(()=>{const n=this.$handle.options.global;return Zn({},[n["*"]||n.default||{},n[e.originType]||n[e.type]||n[e.type]||{}])})),e.prop=Zn({},[this.cacheConfig[e.trueType].value,e.prop]))},setOptions(e){const n=e.loadPending({key:"options",origin:e.prop.options,def:[]});e.prop.options=n,e.prop.optionsTo&&n&&fi(e.prop,e.prop.optionsTo,n)},deepSet(e){const n=e.prop.deep;n&&Object.keys(n).sort((i,o)=>i.length<o.length?-1:1).forEach(i=>{fi(e.prop,i,n[i])})},parseSide(e,n){return pe.Object(e)?Zn({props:{formCreateInject:n.prop.props.formCreateInject}},e):e},renderSides(e,n,i){const o=n[i?"rule":"prop"];return[this.renderRule(this.parseSide(o.prefix,n)),e,this.renderRule(this.parseSide(o.suffix,n))]},renderId(e,n){const i=this.$handle[n==="field"?"fieldCtx":"nameCtx"][e];return i?i.map(o=>this.renderCtx(o,o.parent)):void 0},renderCtx(e,n){try{if(e.type==="hidden")return;const i=e.rule;if(this.force||!this.cache[e.id]||this.cache[e.id].slot!==i.slot){let o;e.initProp(),this.mergeGlobal(e),e.initNone(),this.$manager.tidyRule(e),this.deepSet(e),this.setOptions(e),this.ctxProp(e);let r=e.prop;r.preview=!!(r.preview!=null?r.preview:this.$handle.preview),r.props.formCreateInject=this.injectProp(e);let s=r.cache!==!1;const a=r.preview;if(r.hidden){this.setCache(e,void 0,n);return}o=(...l)=>{var c,u;const d={rule:i,prop:r,preview:a,api:this.$handle.api,model:r.model||{},slotValue:l};l.length&&i.slotUpdate&&Be(()=>i.slotUpdate(d));let h={};const m=e.loadChildrenPending();e.parser.renderChildren?h=e.parser.renderChildren(m,e):e.parser.loadChildren!==!1&&(h=this.renderChildren(m,e)),Object.keys(r.renderSlots||{}).forEach(_=>{h[_]=(...C)=>{if(pe.Function(r.renderSlots[_]))return Be(()=>r.renderSlots[_](...C));const w=this.parseSide(r.renderSlots[_],e);return this.renderRule(w)}});const f=this.getTypeSlot(e);let p;return f?(d.children=h,p=f(d)):p=a?e.parser.preview(vl(h),e):e.parser.render(vl(h),e),p=this.renderSides(p,e),(c=r.title)!=null&&c.show&&(r.wrap=en(Te({},r.wrap||{}),{show:!0}),r.native||(r.native=!1)),(!(!e.input&&pe.Undef(r.native))||((u=r.col)==null?void 0:u.show)===!0)&&r.native!==!0&&(this.fc.targetFormDriver("updateWrap",e),p=this.$manager.makeWrap(e,p)),e.none&&(Array.isArray(p)?p=p.map(_=>!_||!_.__v_isVNode?_:this.none(_)):p=this.none(p)),s&&this.setCache(e,()=>this.stable(p),n),p},this.setCache(e,o,n)}return(...o)=>{const r=this.getCache(e);if(r)return r(...o);if(this.cache[e.id])return;const s=this.renderCtx(e,e.parent);if(s)return s()}}catch(i){console.error(i);return}},none(e){if(e)return e.props.class=this.mergeClass(e.props.class,"fc-none"),e},mergeClass(e,n){if(Array.isArray(e))e.push(n);else return e?[e,n]:n;return e},stable(e){return(Array.isArray(e)?e:[e]).forEach(n=>{n&&n.__v_isVNode&&n.children&&typeof n.children=="object"&&(n.children.$stable=!0,this.stable(n.children))}),e},getModelField(e){return e.prop.modelField||e.parser.modelField||this.fc.modelFields[this.vNode.aliasMap[e.type]]||this.fc.modelFields[e.type]||this.fc.modelFields[e.originType]||"modelValue"},isFragment(e){return e.type==="fragment"||e.type==="template"},injectProp(e){const n=this.vm.setupState;n.ctxInject[e.id]||(n.ctxInject[e.id]={api:this.$handle.api,form:this.fc.create,subForm:o=>{this.$handle.addSubForm(e,o)},getSubForm:()=>this.$handle.subForm[e.id],slots:()=>this.vm.setupState.top.slots,getWrap:()=>this.vm.refs[e.wrapRef],options:[],children:[],preview:!1,id:e.id,field:e.field,rule:e.rule,input:e.input,t:(...o)=>this.$handle.api.t(...o),updateValue:o=>{this.$handle.onUpdateValue(e,o)}});const i=n.ctxInject[e.id];return Fe(i,{preview:e.prop.preview,options:e.prop.options,children:e.loadChildrenPending()}),i},ctxProp(e){const{ref:n,key:i,rule:o}=e;this.$manager.mergeProp(e),e.parser.mergeProp(e);const r=[{ref:n,key:o.key||`${i}fc`,slot:void 0,on:{vnodeMounted:s=>{s.el.__rule__=e.rule,this.onMounted(e,s.el)},vnodeBeforeUnmount:()=>{this.$handle.effect(e,"beforeUnmount"),this.$handle.targetHook(e,"beforeUnmount")},"fc.updateValue":s=>{this.$handle.onUpdateValue(e,s)},"fc.el":s=>{e.exportEl=s,s&&((s.$el||s).__rule__=e.rule)}}}];if(e.input){const s=this.tmpInput;this.vm.props.disabled===!0&&(e.prop.props.disabled=!0);const a=this.getModelField(e),l={callback:c=>{s&&s(e.field,c,e.rule),this.onInput(e,c)},modelField:a,value:this.$handle.getFormData(e)};r.push({on:Te({[`update:${a}`]:l.callback},e.prop.modelEmit?{[e.prop.modelEmit]:()=>this.onEmitInput(e)}:{}),props:{[a]:l.value}}),e.prop.model=l}return Qn(r,e.prop),e.prop},onMounted(e,n){e.el=this.vm.refs[e.ref]||n,e.parser.mounted(e),this.$handle.effect(e,"mounted"),this.$handle.targetHook(e,"mounted")},onInput(e,n){if(e.prop.modelEmit){this.$handle.onBaseInput(e,n);return}this.$handle.onInput(e,n)},onEmitInput(e){this.$handle.setValue(e,e.parser.toValue(e.modelValue,e),e.modelValue)},renderChildren(e,n){if(!pe.trueArray(e))return{};const i=wr();return e.map(o=>{if(o){if(pe.String(o)||pe.Number(o))return i.setSlot(null,`${o}`);if(o.__fc__)return this.renderSlot(i,o.__fc__,n);o.type&&Ge(()=>{this.$handle.loadChildren(e,n),this.$handle.refresh()})}}),i.getSlots()},defaultRender(e,n){const i=e.prop;return i.component?typeof i.component=="string"?this.vNode.make(i.component,i,n):this.vNode.makeComponent(i.component,i,n):this.vNode[e.type]?this.vNode[e.type](i,n):this.vNode[e.originType]?this.vNode[e.originType](i,n):this.vNode.make($m(i.type),i,n)},createChildrenVnodes(e,n,i){this.force=i!==!1,this.tmpInput=n;const o=this.renderChildren(e.rule.children,e);return this.force=!1,this.tmpInput=null,o},createRuleVnode(e,n,i){this.force=i!==!1,this.tmpInput=n;const o=wr();return this.renderSlot(o,e,e.parent),this.force=!1,this.tmpInput=null,o.getSlots()},renderRule(e,n,i){if(!e)return;if(pe.String(e)||pe.Number(e))return`${e}`;let o;if(i)o=e.type;else if(o=e.is,e.type){o=Vt(e.type);const a=this.vNode.aliasMap[o];a&&(o=Vt(a))}if(!o)return;const r=wr();pe.trueArray(e.children)&&e.children.forEach(a=>{a&&r.setSlot(a?.slot,()=>this.renderRule(a))});const s=Te({},e);return delete s.type,delete s.is,this.vNode.make(o,s,r.mergeBag(n).getSlots())}})}let iT=1;function Tc(t){Fe(this,{$handle:t,fc:t.fc,vm:t.vm,$manager:t.$manager,vNode:new t.fc.CreateNode(t),force:!1,tmpInput:null,id:iT++}),Am(this,{options(){return t.options},sort(){return t.sort}}),this.initCache(),this.initRender()}tT(Tc);nT(Tc);function oT(t){Fe(t.prototype,{parseInjectEvent(e,n){const i=e.inject||this.options.injectEvent;return this.parseEventLst(e,n,i)},parseEventLst(e,n,i,o){return Object.keys(n).forEach(r=>{const s=this.parseEvent(e,n[r],i,o);s&&(n[r]=s)}),n},parseEvent(e,n,i,o){if(pe.Function(n)&&(i!==!1&&!pe.Undef(i)||n.__inject))return this.inject(e,n,i);if(!o&&Array.isArray(n)&&n[0]&&(pe.String(n[0])||pe.Function(n[0])))return this.parseEventLst(e,n,i,!0);if(pe.String(n)){const r=Dn(n);if(r&&n!==r)return r.__inject?this.parseEvent(e,r,i,!0):r}},parseEmit(e){let n={},i=e.rule,{emitPrefix:o,field:r,name:s,inject:a}=i,l=i.emit||[];return pe.trueArray(l)&&l.forEach(c=>{if(!c)return;let u,d=o||r||s;if(pe.Object(c)&&(u=c.inject,c=c.name,d=c.prefix||d),d){const h=Do(`${d}-${c}`),m=(...f)=>{this.vm.emitsOptions&&!this.vm.emitsOptions[h]&&(this.vm.emitsOptions[h]=null),this.vm.emit(h,...f),this.vm.emit("emit-event",h,...f),this.bus.$emit(h,...f)};if(m.__emit=!0,!u&&a===!1)n[Vt(c)]=m;else{let f=u||a||this.options.injectEvent;n[Vt(c)]=pe.Undef(f)?m:this.inject(i,m,f)}}}),e.computed.on=n,n},getInjectData(e,n){const i=e.__fc__&&e.__fc__.$api,o=e.__fc__&&e.__fc__.$handle.vm||this.vm,{option:r,rule:s}=o.props;return{$f:i||this.api,api:i||this.api,rule:s,self:e.__origin__,option:r,inject:n}},inject(e,n,i){if(n.__origin){if(this.watching&&!this.loading)return n;n=n.__origin}const o=this,r=function(...s){const a=o.getInjectData(e,i);return a.args=[...s],s.unshift(a),n.apply(this,s)};return r.__origin=n,r.__json=n.__json,r},loadStrVar(e,n,i){if(e&&typeof e=="string"&&e.indexOf("{{")>-1&&e.indexOf("}}")>-1){const o=e,r=Yx(e),s=c=>{let u=!1,d;if(i&&c.indexOf("$form.")===0){const h=c.split(".");h.shift(),lt(i.value,h[0])&&(u=!0,d=n?n({id:"$form."+h[0]+"_"+i.rule.__fc__.id,getValue:()=>Pt(i.value,h)}):Pt(i.value,h))}return u||(d=n?n(c):this.fc.getLoadData(c)),d},a=c=>{const u=[];c.forEach(h=>{h.key?u.push(h.key):h.children&&u.push(a(h.children))});let d=!1;return u.forEach((h,m)=>{h!=null&&(h.indexOf("'")===0||h.indexOf('"')===0)&&(u[m]=h.slice(1,-1),d=!0)}),u.length===1&&(d||!isNaN(Number(u[0])))?u[0]:s(u.join("."))};let l;if(r.forEach(c=>{const u=c.split("||"),d=u[0].trim();if(d){const h=(u[1]||"").trim(),m=Pm(d);let f=Be(()=>a(m));(f==null||f==="")&&u.length>1&&(f=h),l=f,e=e.replaceAll(`{{${c}}}`,f??"")}}),r.length===1&&o===`{{${r[0]}}}`)return l}return e},loadFetchVar(e,n,i){let o;i&&i.__fc__&&(o=i.__fc__.getParentGroup()),!o&&e.targetRule&&e.targetRule.__fc__&&(o=e.targetRule.__fc__.getParentGroup());const r=s=>this.loadStrVar(s,n,o?{rule:i,value:this.subRuleData[o.id]||{}}:null);return e.action=r(e.action||""),["headers","data","query"].forEach(s=>{if(e[s]){const a=Array.isArray(e[s])?[]:{};Object.keys(e[s]).forEach(l=>{a[r(l)]=r(e[s][l])}),e[s]=a}}),e}})}const Jd=["hook:updated","hook:mounted"];function rT(t){Fe(t.prototype,{usePage(){const e=this.options.page;if(!e)return;let n=25,i=sT(this.rules);pe.Object(e)&&(e.first&&(n=parseInt(e.first,10)||n),e.limit&&(i=parseInt(e.limit,10)||i)),Fe(this,{first:n,limit:i,pageEnd:this.rules.length<=n}),this.bus.$on("page-end",()=>this.vm.emit("page-end",this.api)),this.pageLoad()},pageLoad(){const e=()=>{this.pageEnd?(this.bus.$off(Jd,e),this.bus.$emit("page-end")):(this.first+=this.limit,this.pageEnd=this.rules.length<=this.first,this.loadRule(),this.refresh())};this.bus.$on(Jd,e)}})}function sT(t){return t.length<31?31:Math.ceil(t.length/3)}function aT(t){Fe(t.prototype,{clearNextTick(){this.nextTick&&clearTimeout(this.nextTick),this.nextTick=null},bindNextTick(e){this.clearNextTick(),this.nextTick=setTimeout(()=>{e(),this.nextTick=null},10)},render(){return++this.loadedId,this.vm.setupState.unique>0?this.$render.render():(this.vm.setupState.unique=1,[])}})}function lT(t){Object.defineProperties(t.origin,{__fc__:yl(Gn(t))}),t.rule!==t.origin&&Object.defineProperties(t.rule,{__fc__:yl(Gn(t))})}function Fm(t,e,n){const i=Ps(),o=!!e.field;Fe(this,{id:i,ref:i,wrapRef:i+"fi",rule:e,origin:e.__origin__||e,name:e.name,pending:{},none:!1,watch:[],linkOn:[],root:[],ctrlRule:[],children:[],parent:null,group:e.subRule?this:null,cacheConfig:null,prop:Te({},e),computed:{},payload:{},refRule:{},input:o,el:void 0,exportEl:void 0,defaultValue:o?Mn(n):void 0,field:e.field||void 0}),this.updateKey(),lT(this),this.update(t,!0)}Fe(Fm.prototype,{getParentGroup(){let t=this.parent;for(;t;){if(t.group)return t;t=t.parent}},loadChildrenPending(){const t=this.rule.children||[];return Array.isArray(t)?t:this.loadPending({key:"children",origin:t,def:[],onLoad:e=>{this.$handle&&this.$handle.loadChildren(e,this)},onUpdate:(e,n)=>{this.$handle&&(e===n?this.$handle.loadChildren(e,this):this.$handle.updateChildren(this,e,n))},onReload:e=>{this.$handle?this.$handle.updateChildren(this,[],e):delete this.pending.children}})},loadPending(t){const{key:e,origin:n,def:i,onLoad:o,onReload:r,onUpdate:s}=t;if(this.pending[e]&&this.pending[e].origin===n)return this.getPending(e,i);delete this.pending[e];let a=n;if(pe.Function(n)){let l=Be(()=>n({rule:this.rule,api:this.$api,update:c=>{const u=c||i,d=this.getPending(e,i);this.setPending(e,n,u),s&&s(u,d)},reload:()=>{const c=this.getPending(e,i);delete this.pending[e],r&&r(c),this.$api&&this.$api.sync(this.rule)}}));l&&pe.Function(l.then)?(l.then(c=>{const u=c||i;this.setPending(e,n,u),o&&o(u),this.$api&&this.$api.sync(this.rule)}).catch(c=>{console.error(c)}),a=i,this.setPending(e,n,a)):(a=l||i,this.setPending(e,n,a),o&&o(a))}return a},getPending(t,e){return this.pending[t]&&this.pending[t].value||e},setPending(t,e,n){this.pending[t]={origin:e,value:Mt(n)}},effectData(t){return this.payload[t]||(this.payload[t]={}),this.payload[t]},clearEffectData(t){t===void 0?this.payload={}:delete this.payload[t]},updateKey(t){this.key=Ps(),t&&this.parent&&this.parent.updateKey(t)},updateType(){this.originType=this.rule.type,this.type=Vt(this.rule.type),this.trueType=this.$handle.getType(this.originType)},setParser(t){this.parser=t,t.init(this)},initProp(){var t,e,n;const i=Te({},this.rule);delete i.children,delete i.validate,this.prop=Zn({},[i,...Object.keys(this.payload).map(o=>this.payload[o]),this.computed]),i.col&&((t=i.col)==null?void 0:t.show)!==!1&&(this.prop.col.show=!0),this.prop.validate=[...((n=(e=this.refRule)==null?void 0:e.__$validate)==null?void 0:n.value)||[],...this.prop.validate||[]]},initNone(){this.none=!(pe.Undef(this.prop.display)||this.prop.display)},hasHidden(){return!!this.rule.hidden||(this.parent?this.parent.hasHidden():!1)},injectValidate(){return this.prop.validate},check(t){return this.vm===t.vm},unwatch(){this.watch.forEach(t=>t()),this.watch=[],Object.keys(this.refRule).forEach(t=>{t.indexOf("__$")!==0&&delete this.refRule[t]})},unlink(){this.linkOn.forEach(t=>t()),this.linkOn=[]},link(){this.unlink(),this.$handle.appendLink(this)},watchTo(){this.$handle.watchCtx(this)},delete(){this.unwatch(),this.unlink(),this.rmCtrl(),this.parent&&this.parent.children.splice(this.parent.children.indexOf(this)>>>0,1),Fe(this,{deleted:!0,computed:{},parent:null,children:[],cacheConfig:null,none:!1})},rmCtrl(){this.ctrlRule.forEach(t=>t.__fc__&&t.__fc__.rm()),this.ctrlRule=[]},rm(){const t=()=>{let e=this.root.indexOf(this.origin);e>-1&&(this.root.splice(e,1),this.$handle&&this.$handle.refresh())};if(this.deleted){t();return}this.$handle.noWatch(()=>{this.$handle.deferSyncValue(()=>{this.rmCtrl(),t(),this.$handle.rmCtx(this),Fe(this,{root:[]})},this.input)})},update(t,e){Fe(this,{deleted:!1,$handle:t,$render:t.$render,$api:t.api,vm:t.vm,vNode:t.$render.vNode,updated:!1,cacheValue:this.rule.value}),!e&&this.unwatch(),this.watchTo(),this.link(),this.updateType()}});function cT(t){Fe(t.prototype,{nextRefresh(e){const n=this.loadedId;Ge(()=>{n===this.loadedId&&(e?e():this.refresh())})},parseRule(e){const n=Wd(e);return Object.defineProperties(n,{__origin__:yl(e)}),uT(n),this.appendValue(n),[n,n.prefix,n.suffix].forEach(i=>{i&&this.loadFn(i,n)}),this.loadCtrl(n),n.update&&(n.update=Dn(n.update)),n},loadFn(e,n){["on","props","deep"].forEach(i=>{e[i]&&this.parseInjectEvent(n,e[i])})},loadCtrl(e){e.control&&e.control.forEach(n=>{n.handle&&(n.handle=Dn(n.handle))})},syncProp(e){const n=e.rule;pe.trueArray(n.sync)&&Qn([{on:n.sync.reduce((i,o)=>(i[typeof o=="object"&&o.event||`update:${o}`]=r=>{n.props[typeof o=="object"&&o.prop||o]=r,this.vm.emit("sync",o,r,n,this.fapi)},i),{})}],e.computed)},loadRule(){this.cycleLoad=!1,this.loading=!0,this.pageEnd&&this.bus.$emit("load-start"),this.deferSyncValue(()=>{if(this._loadRule(this.rules),this.loading=!1,this.cycleLoad&&this.pageEnd)return this.loadRule();this.syncForm(),this.pageEnd&&this.bus.$emit("load-end"),this.vm.setupState.renderRule()})},loadChildren(e,n){if(this.cycleLoad=!1,this.loading=!0,this.bus.$emit("load-start"),this._loadRule(e,n),this.loading=!1,this.cycleLoad)return this.loadRule();this.syncForm(),this.bus.$emit("load-end"),this.$render.clearCache(n)},_loadRule(e,n){const i=s=>{let a=e[s-1];if(!a||!a.__fc__)return s>0?i(s-1):-1;let l=this.sort.indexOf(a.__fc__.id);return l>-1?l:i(s-1)},o=(s,a)=>{pe.trueArray(s)&&this._loadRule(s,a)},r=e.map((s,a)=>{if(n&&!pe.Object(s)||!this.pageEnd&&!n&&a>=this.first)return;if(s.__fc__&&s.__fc__.root===e&&this.ctxs[s.__fc__.id])return o(s.__fc__.loadChildrenPending(),s.__fc__),s.__fc__;let l=Wd(s);const c=()=>!!(l.field&&this.fieldCtx[l.field]&&this.fieldCtx[l.field][0]!==s.__fc__);this.fc.targetFormDriver("loadRule",{rule:l,api:this.api},this.fc),this.ruleEffect(l,"init",{repeat:c()}),c()&&this.vm.emit("repeat-field",s,this.api);let u,d=!1,h=!!s.__fc__,m=l.value;if(h){if(u=s.__fc__,m=u.defaultValue,u.deleted){if(Zd(u))return;u.update(this)}else if(!u.check(this)){if(Zd(u))return;e[a]=s=s._clone?s._clone():wm(Lo(s)),u=null,d=!0}}if(u)u.originType!==u.rule.type&&u.updateType(),this.bindParser(u),this.appendValue(u.rule),u.parent&&u.parent!==n&&this.rmSubRuleData(u);else{const _=this.parseRule(s);u=new Fm(this,_,m),this.bindParser(u)}this.parseEmit(u),this.syncProp(u),u.parent=n||null,u.root=e,this.setCtx(u),!d&&!h&&(this.effect(u,"load"),this.targetHook(u,"load")),this.effect(u,"created");const f=u.loadChildrenPending();if(u.parser.loadChildren===!1||o(f,u),!n){const _=i(a);_>-1||!a?this.sort.splice(_+1,0,u.id):this.sort.push(u.id)}const p=u.rule;return u.updated||(u.updated=!0,pe.Function(p.update)&&this.bus.$once("load-end",()=>{this.refreshUpdate(u,p.value,"init")}),this.effect(u,"loaded")),this.refreshControl(u)&&(this.cycleLoad=!0),u}).filter(s=>!!s);n&&(n.children=r)},refreshControl(e){return e.input&&e.rule.control&&this.useCtrl(e)},useCtrl(e){const n=dT(e),i=[],o=this.api;if(!n.length)return!1;for(let a=0;a<n.length;a++){const l=n[a],c=l.handle||function(d){return(Ai[l.condition||"=="]||Ai["=="])(d,l.value)};if(!pe.trueArray(l.rule))continue;const u=en(Te({},l),{valid:Be(()=>c(e.rule.value,o)),ctrl:hT(e,l.rule),isHidden:pe.String(l.rule[0])});u.valid&&u.ctrl||!u.valid&&!u.ctrl&&!u.isHidden||i.push(u)}if(!i.length)return!1;const r=[];let s=!1;return this.deferSyncValue(()=>{i.reverse().forEach(({isHidden:a,valid:l,rule:c,prepend:u,append:d,child:h,ctrl:m,method:f})=>{if(a){l?e.ctrlRule.push({__ctrl:!0,children:c,valid:l}):m&&e.ctrlRule.splice(e.ctrlRule.indexOf(m)>>>0,1),r[l?"push":"unshift"](()=>{f==="disabled"||f==="enabled"?this.api.disabled(!l,c):f==="display"||f==="show"?this.api.display(l,c):f==="required"?(c.forEach(p=>{this.api.setEffect(p,"required",l)}),l||this.api.clearValidateState(c)):f==="if"?this.api.hidden(!l,c):this.api.hidden(!l,c)});return}if(l){s=!0;const p={type:"fragment",native:!0,__ctrl:!0,children:c};e.ctrlRule.push(p),this.bus.$once("load-start",()=>{u?o.prepend(p,u,h):d||h?o.append(p,d||e.id,h):e.root.splice(e.root.indexOf(e.origin)+1,0,p)})}else{e.ctrlRule.splice(e.ctrlRule.indexOf(m),1);const p=On(m);p&&p.rm()}})}),r.length&&(this.loading?r.length&&this.bus.$once("load-end",()=>{r.forEach(a=>a())}):r.length&&Ge(()=>{r.forEach(a=>a())})),this.vm.emit("control",e.origin,this.api),this.effect(e,"control"),s},reloadRule(e){return this._reloadRule(e)},_reloadRule(e){e||(e=this.rules);const n=Te({},this.ctxs);this.clearNextTick(),this.initData(e),this.fc.rules=e,this.deferSyncValue(()=>{this.bus.$once("load-end",()=>{Object.keys(n).filter(i=>this.ctxs[i]===void 0).forEach(i=>this.rmCtx(n[i])),this.$render.clearCacheAll()}),this.reloading=!0,this.loadRule(),this.reloading=!1,this.refresh(),this.bus.$emit("reloading",this.api)}),this.bus.$off("next-tick",this.nextReload),this.bus.$once("next-tick",this.nextReload),this.bus.$emit("update",this.api)},refresh(){this.vm.setupState.refresh()}})}function uT(t){const e=Rm();return Object.keys(e).forEach(n=>{lt(t,n)||(t[n]=e[n])}),t}function dT(t){const e=t.rule.control||[];return pe.Object(e)?[e]:e}function hT(t,e){for(let n=0;n<t.ctrlRule.length;n++){const i=t.ctrlRule[n];if(i.children===e)return i}}function Zd(t){return!!t.rule.__ctrl}function pT(t){Fe(t.prototype,{setValue(e,n,i,o){e.deleted||(e.rule.value=n,this.changeStatus=!0,this.nextRefresh(),this.$render.clearCache(e),this.setFormData(e,i),this.syncValue(),this.valueChange(e,n),this.vm.emit("change",e.field,n,e.origin,this.api,o||!1),this.effect(e,"value"),this.targetHook(e,"value",{value:n}),this.emitEvent("change",e.field,n,{rule:e.origin,api:this.api,setFlag:o||!1}),o&&Ge(()=>{Ge(()=>{Ge(()=>{this.api.clearValidateState(e.id)})})}),this.$manager.fieldChange(e,n,i,o))},onInput(e,n){let i;e.input&&(this.isQuote(e,i=e.parser.toValue(n,e))||this.isChange(e,n))&&this.setValue(e,i,n)},onUpdateValue(e,n){this.deferSyncValue(()=>{const i=e.getParentGroup(),o=i?this.subRuleData[i.id]:null,r={};Object.keys(n||{}).forEach(s=>{o&<(o,s)?r[s]=n[s]:lt(this.api.form,s)?this.api.form[s]=n[s]:this.api.top!==this.api&<(this.api.top.form,s)&&(this.api.top.form[s]=n[s])}),Object.keys(r).length&&this.api.setChildrenFormData(i.rule,r)})},onBaseInput(e,n){this.setFormData(e,n),e.modelValue=n,this.nextRefresh(),this.$render.clearCache(e)},setFormData(e,n){e.modelValue=n;const i=e.getParentGroup();i&&(this.subRuleData[i.id]||(this.subRuleData[i.id]={}),this.subRuleData[i.id][e.field]=e.rule.value),an(this.formData,e.id,n)},rmSubRuleData(e){const n=e.getParentGroup();n&&this.subRuleData[n.id]&&delete this.subRuleData[n.id][e.field]},getFormData(e){return this.formData[e.id]},syncForm(){const e=Mt({}),n=this.fields(),i=[];this.options.appendValue!==!1&&Object.keys(this.appendData).reduce((o,r)=>(n.indexOf(r)===-1&&(o[r]=kt(this.appendData,r)),o),e),n.reduce((o,r)=>{let s=(this.fieldCtx[r]||[]).filter(a=>!this.isIgnore(a))[0];return s||(s=this.fieldCtx[r][0],i.push(r)),o[r]=kt(s.rule,"value"),o},e),this.form=e,this.ignoreFields=i,this.syncValue()},isIgnore(e){return e.rule.ignore===!0||(e.rule.ignore==="hidden"||this.options.ignoreHiddenFields)&&e.hasHidden()},appendValue(e){(!e.field||!lt(this.appendData,e.field))&&(!pe.Undef(e.value)||!this.options.forceCoverValue)||(e.value=this.appendData[e.field],delete this.appendData[e.field])},addSubForm(e,n){this.subForm[e.id]=n},deferSyncValue(e,n){this.deferSyncFn||(this.deferSyncFn=e),this.deferSyncFn.sync||(this.deferSyncFn.sync=n),Be(e),this.deferSyncFn===e&&(this.deferSyncFn=null,e.sync&&this.syncForm())},syncValue(){if(this.deferSyncFn)return this.deferSyncFn.sync=!0;const e={};Object.keys(this.form).forEach(n=>{this.ignoreFields.indexOf(n)===-1&&(e[n]=this.form[n])}),this.vm.setupState.updateValue(e)},isChange(e,n){return JSON.stringify(this.getFormData(e),eh)!==JSON.stringify(n,eh)},isQuote(e,n){return(n instanceof Function||pe.Object(n)||Array.isArray(n))&&n===e.rule.value},refreshUpdate(e,n,i,o){if(pe.Function(e.rule.update)){const r=Be(()=>e.rule.update(n,e.origin,this.api,{origin:i||"change",linkField:o}));if(r===void 0)return;e.rule.hidden=r===!0}},valueChange(e,n){this.refreshRule(e,n),this.bus.$emit("change-"+e.field,n)},refreshRule(e,n,i,o){this.refreshControl(e)&&(this.$render.clearCacheAll(),this.loadRule(),this.bus.$emit("update",this.api),this.refresh()),this.refreshUpdate(e,n,i,o)},appendLink(e){const n=e.rule.link;pe.trueArray(n)&&n.forEach(i=>{const o=()=>this.refreshRule(e,e.rule.value,"link",i);this.bus.$on("change-"+i,o),e.linkOn.push(()=>this.bus.$off("change-"+i,o))})},fields(){return Object.keys(this.fieldCtx)}})}function eh(t,e){return typeof e=="function"?""+e:e}const To={init(t){},toFormValue(t,e){return t},toValue(t,e){return t},mounted(t){},render(t,e){return e.$handle.fc.renderDriver&&e.$handle.fc.renderDriver.defaultRender?e.$handle.fc.renderDriver.defaultRender(e,t):e.$render.defaultRender(e,t)},preview(t,e){return e.$handle.fc.renderDriver&&e.$handle.fc.renderDriver.defaultPreview?e.$handle.fc.renderDriver.defaultPreview(e,t):this.render(t,e)},mergeProp(t){}},fT=["field","value","vm","template","name","config","control","inject","sync","payload","optionsTo","update","slotUpdate","computed","component","cache"],Co=Symbol("oldValue");function mT(t){Fe(t.prototype,{getCtx(e){return this.getFieldCtx(e)||this.getNameCtx(e)[0]||this.ctxs[e]},getCtxs(e){return this.fieldCtx[e]||this.nameCtx[e]||(this.ctxs[e]?[this.ctxs[e]]:[])},setIdCtx(e,n,i){const o=`${i}Ctx`;this[o][n]?this[o][n].push(e):this[o][n]=[e]},rmIdCtx(e,n,i){const o=`${i}Ctx`,r=this[o][n];if(!r)return!1;const s=r.splice(r.indexOf(e)>>>0,1).length>0;return r.length||delete this[o][n],s},getFieldCtx(e){return(this.fieldCtx[e]||[])[0]},getNameCtx(e){return this.nameCtx[e]||[]},setCtx(e){let{id:n,field:i,name:o,rule:r}=e;this.ctxs[n]=e,o&&this.setIdCtx(e,o,"name"),e.input&&(this.setIdCtx(e,i,"field"),this.setFormData(e,e.parser.toFormValue(r.value,e)),this.isMounted&&!this.reloading&&this.vm.emit("change",e.field,r.value,e.origin,this.api,!1,!0))},getParser(e){const n=this.fc.parsers,i=this.fc.renderDriver;if(i){const o=i.parsers||{},r=o[e.originType]||o[Vt(e.type)]||o[e.trueType];if(r)return r}return n[e.originType]||n[Vt(e.type)]||n[e.trueType]||To},bindParser(e){e.setParser(this.getParser(e))},getType(e){const n=this.fc.CreateNode.aliasMap,i=n[e]||n[Vt(e)]||e;return Vt(i)},noWatch(e){this.noWatchFn||(this.noWatchFn=e),Be(e),this.noWatchFn===e&&(this.noWatchFn=null)},watchCtx(e){if(Tm().filter(n=>n[0]!=="_"&&n[0]!=="$"&&fT.indexOf(n)===-1).forEach(n=>{const i=kt(e.rule,n),o=n==="children";e.refRule[n]=i,e.watch.push($e(o?()=>pe.Function(i.value)?i.value:[...i.value||[]]:()=>i.value,(r,s)=>{let a=i.value;if(!this.isBreakWatch()){if(o&&e.parser.loadChildren===!1){this.$render.clearCache(e),this.nextRefresh();return}if(this.watching=!0,Ge(()=>{this.targetHook(e,"watch",{key:n,oldValue:s,newValue:a})}),n==="hidden"&&!!a!=!!s&&(this.$render.clearCacheAll(),Ge(()=>{this.targetHook(e,"hidden",{value:a})})),n==="ignore"&&e.input||n==="hidden"&&(e.rule.ignore==="hidden"||this.options.ignoreHiddenFields))this.syncForm();else if(n==="link"){e.link();return}else["props","on","deep"].indexOf(n)>-1?(this.parseInjectEvent(e.rule,a||{}),n==="props"&&e.input&&this.setFormData(e,e.parser.toFormValue(e.rule.value,e))):n==="emit"?this.parseEmit(e):["prefix","suffix"].indexOf(n)>-1?a&&this.loadFn(a,e.rule):n==="type"?(e.updateType(),this.bindParser(e)):o&&(pe.Function(s)&&(s=e.getPending("children",[])),pe.Function(a)&&(a=e.loadChildrenPending()),this.updateChildren(e,a,s));this.$render.clearCache(e),this.refresh(),this.watching=!1}},{deep:!o,sync:o}))}),e.refRule.__$title=te(()=>{let n=(typeof e.rule.title=="object"?e.rule.title.title:e.rule.title)||"";if(n){const i=n.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);i&&(n=this.api.t(i[1]))}return n}),e.refRule.__$info=te(()=>{let n=(typeof e.rule.info=="object"?e.rule.info.info:e.rule.info)||"";if(n){const i=n.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);i&&(n=this.api.t(i[1]))}return n}),e.refRule.__$validate=te(()=>{const n=i=>{var o,r;const s=i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);return s?this.api.t(s[1],{title:(r=(o=e.refRule)==null?void 0:o.__$title)==null?void 0:r.value}):i};return Ut(e.rule.validate).map(i=>{const o=Te({},i);if(o.message&&(o.message=n(o.message)),pe.Function(o.validator)){const r=e;o.validator=function(...s){return i.validator.call({that:this,id:r.id,field:r.field,rule:r.rule,api:r.$handle.api},...s)}}if(o.adapter){if(typeof o.error=="object"){const r=Te({},o.error);Object.keys(r).forEach(s=>{r[s]=n(r[s])}),o.error=r}return this.adapterValidate(o,e)}return o})}),e.input){const n=kt(e.rule,"value");e.watch.push($e(()=>n.value,()=>{let i=e.parser.toFormValue(n.value,e);this.isChange(e,i)&&this.setValue(e,n.value,i,!0)}))}this.bus.$once("load-end",()=>{let n=e.rule.computed;n&&(typeof n!="object"&&(n={value:n}),Object.keys(n).forEach(i=>{const o=te(()=>{const s=n[i];if(!s)return;const a=this.compute(e,s);return(s.linkage||s.linkageVariable)&&a===Co?Co:a}),r=s=>{i==="value"?this.onInput(e,s):i[0]==="$"?this.api.setEffect(e.id,i,s):fi(e.rule,i,s)};(i==="value"?[void 0,null,""].indexOf(e.rule.value)>-1:o.value!==Pt(e.rule,i))&&r(o.value),e.watch.push($e(o,s=>{s!==Co&&setTimeout(()=>{r(s)})},{deep:!0}))}))}),this.watchEffect(e)},adapterValidate(e,n){const i=(o,r)=>{if((e.beforeValidate&&Be(()=>e.beforeValidate({value:o,api:this.api,validate:e,rule:n.rule})))===!1)r();else{const s=this.validator(n,o,e);if(s){let a="";typeof e.error=="object"&&(a=e.error[s]||e.error.default),!a&&typeof e.message=="string"&&(a=e.message),a||(a=this.getValidateMessage(n,{key:s,rule:e[s]})),r(a)}else if(e.validator){const a=e.validator&&Be(()=>e.validator(o,r));a&&pe.Function(a.then)&&a.then(()=>r()).catch(l=>r(l))}else r()}};return this.$manager.adapterValidate({required:e.required,message:e.message,trigger:e.trigger},i)},getValidateMessage(e,n){var i,o;const r=Array.isArray(n.rule)?n.rule.join(","):""+n.rule;return this.api.t(n.key==="required"?n.key:"validate."+n.key,{[n.key]:r,title:(o=(i=e.refRule)==null?void 0:i.__$title)==null?void 0:o.value})},validator(e,n,i){if(pe.empty(n))return i.required?"required":void 0;for(const[o,r]of Object.entries(i))switch(o){case"len":case"maxLen":case"minLen":const s=l=>o==="len"?l===r:o==="maxLen"?l<=r:l>=r;if(Array.isArray(n)){if(!s(n.length))return o}else if(typeof n=="object"||!s((""+n).length))return o;break;case"pattern":if(!(typeof r=="string"?new RegExp(r):r).test(""+n))return o;break;case"uppercase":if(r&&(typeof n!="string"||!/^[A-Z]*$/.test(n)))return o;break;case"lowercase":if(r&&(typeof n!="string"||!/^[a-z]*$/.test(n)))return o;break;case"min":case"max":case"positive":case"negative":case"integer":case"number":const a=Number(n);if(Number.isNaN(a)||o==="min"&&a<r||o==="max"&&a>r||o==="positive"&&a<=0||o==="negative"&&a>=0||o==="integer"&&!Number.isInteger(a))return o;break;case"equal":if(n!==r)return o;break;case"enum":if(Array.isArray(r)&&!r.includes(n))return o;break;case"hasKeys":if(typeof n!="object"||Array.isArray(r)&&r.some(l=>!(l in n)))return o;break;case"email":if(!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(""+n))return o;break;case"url":if(!new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i").test(""+n))return o;break;case"ip":if(!/^(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})(\.(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})){3}$/.test(""+n))return o;break;case"phone":if(!/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(""+n))return o;break;case"computed":if(!this.compute(e,r))return o;break}},compute(e,n){let i;if(typeof n=="object"){const o=e.getParentGroup(),r=a=>{if(a=Array.isArray(a)?{mode:"AND",group:a}:a,!pe.trueArray(a.group))return!0;const l=a.mode==="OR";let c=!0;for(let u=0;u<a.group.length;u++){const d=a.group[u];let h,m=null,f=null;if(d.variable)f=this.fc.getLoadData(d.variable);else if(d.field)m=Gd(d.field||"");else if(!d.mode)return!0;let p=d.compare;if(p&&(p=Gd(p||"")),d.mode?h=r(d):Ai[d.condition]?pe.Function(d.handler)?h=Be(()=>d.handler(this.api,e.rule)):h=Be(()=>new Function("$condition","$variableVal","$val","$form","$scope","$group","$rule",`with($form){with($scope){with(this){with($group){ return $condition['${d.condition}'](${d.variable?"$variableVal":m}, ${p||"$val"}); }}}}`).call(this.api.form,Ai,f,d.value,this.api.top.form,this.api.top===this.api.scope?{}:this.api.scope.form,o?this.subRuleData[o.id]||{}:{},e.rule)):h=!1,l&&h)return!0;l||(c=c&&h)}return l?!1:c};let s=r(n);return s=n.invert===!0?!s:s,n.linkage?s?Be(()=>this.computeValue(n.linkage,e,o),void 0):Co:n.linkageVariable?s?Be(()=>this.fc.getLoadData(n.linkageVariable),void 0):Co:s}else if(pe.Function(n))i=()=>n(this.api.form,this.api,e.rule);else{const o=e.getParentGroup();i=()=>this.computeValue(n,e,o)}return Be(i,void 0)},computeValue(e,n,i){const o=this,r=Object.keys(this.fc.formulas).reduce((s,a)=>(s[a]=function(...l){return o.fc.formulas[a].call({that:this,rule:n.rule,api:o.api,fc:o.fc},...l)},s),{});return Be(()=>new Function("$formulas","$form","$scope","$group","$rule","$api",`with($form){with($scope){with(this){with($group){with($formulas){ return ${e} }}}}}`).call(this.api.form,r,this.api.top.form,this.api.top===this.api.scope?{}:this.api.scope.form,i?this.subRuleData[i.id]||{}:{},n.rule,this.api),void 0)},updateChildren(e,n,i){this.deferSyncValue(()=>{i&&i.forEach(o=>{(n||[]).indexOf(o)===-1&&o&&!pe.String(o)&&o.__fc__&&o.__fc__.parent===e&&this.rmCtx(o.__fc__)}),pe.trueArray(n)&&(this.loadChildren(n,e),this.bus.$emit("update",this.api))})},rmSub(e){pe.trueArray(e)&&e.forEach(n=>{n&&n.__fc__&&this.rmCtx(n.__fc__)})},rmCtx(e){if(e.deleted)return;const{id:n,field:i,input:o,name:r}=e;Si(this.ctxs,n),Si(this.formData,n),Si(this.subForm,n),Si(this.vm.setupState.ctxInject,n);const s=e.getParentGroup();s&&this.subRuleData[s.id]&&Si(this.subRuleData[s.id],i),e.group&&Si(this.subRuleData,n),o&&this.rmIdCtx(e,i,"field"),r&&this.rmIdCtx(e,r,"name"),o&&!lt(this.fieldCtx,i)&&Si(this.form,i),this.deferSyncValue(()=>{if(!this.reloading){if(e.parser.loadChildren!==!1){const l=e.getPending("children",e.rule.children);pe.trueArray(l)&&l.forEach(c=>c&&c.__fc__&&this.rmCtx(c.__fc__))}e.root===this.rules&&this.vm.setupState.renderRule()}},o);const a=this.sort.indexOf(n);return a>-1&&this.sort.splice(a,1),this.$render.clearCache(e),e.delete(),this.effect(e,"deleted"),this.targetHook(e,"deleted"),o&&!this.fieldCtx[i]&&this.vm.emit("remove-field",i,e.rule,this.api),e.rule.__ctrl||this.vm.emit("remove-rule",e.rule,this.api),e}})}function vT(t){Fe(t.prototype,{mounted(){const e=()=>{this.isMounted=!0,this.lifecycle("mounted")};this.pageEnd?e():this.bus.$once("page-end",e)},lifecycle(e){this.fc.targetFormDriver(e,this.api,this.fc),this.vm.emit(e,this.api),this.emitEvent(e,this.api)},emitEvent(e,...n){const i=this.options[e]||this.options[Vt("on-"+e)];if(i){const o=Dn(i);pe.Function(o)&&Be(()=>o(...n))}this.bus.$emit(e,...n)},targetHook(e,n,i){var o,r,s,a;let l=(r=(o=e.prop)==null?void 0:o.hook)==null?void 0:r[n],c=(h,m)=>{h&&(h=Array.isArray(h)?h:[h],h.forEach(f=>{Be(()=>f(en(Te({args:Object.values(i||{})},i||{}),{self:e.rule,rule:e.rule,parent:m?.rule,$f:this.api,api:this.api,option:this.vm.props.option})))}))};c(l);let u="deep"+ym(n),d=e.parent;for(;d;){let h=(a=(s=d.prop)==null?void 0:s.hook)==null?void 0:a[u];c(h,d),d=d.parent}}})}function gT(t){Fe(t.prototype,{useProvider(){const e=this.fc.providers;Object.keys(e).forEach(n=>{let i=e[n];pe.Function(i)&&(i=i(this.fc)),i._c=yT(i),this.onEffect(i,n),this.providers[n]=i})},onEffect(e,n){const i=[];(e._c||["*"]).forEach(o=>{const r=o==="*"?"*":this.getType(o);i.indexOf(r)>-1||(i.push(r),this.bus.$on(`p:${n||e.name}:${r}:${e.input?1:0}`,(s,a)=>{e[s]&&e[s](...a)}))}),e._used=i},watchEffect(e){let n={required:()=>{var i,o;return(lt(e.rule,"$required")?e.rule.$required:(o=(i=e.rule)==null?void 0:i.effect)==null?void 0:o.required)||!1}};Object.keys(e.rule.effect||{}).forEach(i=>{n[i]=()=>e.rule.effect[i]}),Object.keys(e.rule).forEach(i=>{i[0]==="$"&&(n[i.substr(1)]=()=>e.rule[i])}),Object.keys(n).forEach(i=>{e.watch.push($e(n[i],o=>{this.effect(e,"watch",{[i]:o})},{deep:!0}))})},ruleEffect(e,n,i){this.emitEffect({rule:e,input:!!e.field,type:this.getType(e.type)},n,i)},effect(e,n,i){this.emitEffect({rule:e.rule,input:e.input,type:e.trueType,ctx:e,custom:i},n)},getEffect(e,n){if(lt(e,"$"+n))return e["$"+n];if(lt(e,"effect")&<(e.effect,n))return e.effect[n]},emitEffect({ctx:e,rule:n,input:i,type:o,custom:r},s,a){if(!o||["fcFragment","fragment"].indexOf(o)>-1)return;const l=r||Object.keys(n).reduce((c,u)=>(u[0]==="$"&&(c[u.substr(1)]=n[u]),c),Te({},n.effect||{}));Object.keys(l).forEach(c=>{const u=this.providers[c];if(!u||u.input&&!i)return;let d;if(!u._c)d="*";else if(u._used.indexOf(o)>-1)d=o;else return;const h=Te({value:l[c],getValue:()=>this.getEffect(n,c)},a||{});e&&(h.getProp=()=>e.effectData(c),h.clearProp=()=>e.clearEffectData(c),h.mergeProp=m=>Zn(h.getProp(),[m]),h.id=e.id),this.bus.$emit(`p:${c}:${d}:${u.input?1:0}`,s,[h,n,this.api])})}})}function _T(t){return t.filter(function(e,n,i){return i.indexOf(e,0)===n})}function yT(t){const e=t.components;if(Array.isArray(e)){const n=_T(e.filter(i=>i!=="*"));return n.length?n:!1}else return pe.String(e)?[e]:!1}function Nn(t){Am(this,{options(){return t.options.value||{}},bus(){return t.bus},preview(){return t.vm.props.preview!=null?t.vm.props.preview:t.vm.setupState.parent&&t.vm.setupState.parent.props.preview!=null?t.vm.setupState.parent.props.preview:t.options.value.preview||!1}}),Fe(this,{fc:t,vm:t.vm,watching:!1,loading:!1,reloading:!1,noWatchFn:null,deferSyncFn:null,isMounted:!1,formData:Mt({}),subRuleData:Mt({}),subForm:{},form:Mt({}),appendData:{},ignoreFields:[],providers:{},cycleLoad:null,loadedId:1,nextTick:null,changeStatus:!1,pageEnd:!0,nextReload:()=>{this.lifecycle("reload")}}),this.initData(t.rules),this.$manager=new t.manager(this),this.$render=new Tc(this),this.api=t.extendApiFn.reduce((e,n)=>{const i=Be(()=>n(e,this));return i&&i!==e&&Fe(e,i),e},eT(this))}Fe(Nn.prototype,{initData(t){Fe(this,{ctxs:{},fieldCtx:{},nameCtx:{},sort:[],rules:t})},init(){this.updateAppendData(),this.useProvider(),this.usePage(),this.loadRule(),this.$manager.__init(),this.lifecycle("created")},updateAppendData(){this.appendData=Te(Te(Te({},Mn(this.options.formData||{})),this.fc.vm.props.modelValue||{}),this.appendData)},isBreakWatch(){return this.loading||this.noWatchFn||this.reloading},globalBeforeFetch(t){return new Promise((e,n)=>{const i=this.options.beforeFetch&&Be(()=>this.options.beforeFetch(t,{api:this.api}));i&&pe.Function(i.then)?i.then(e).catch(n):e()})},beforeFetch(t){return new Promise((e,n)=>{const i=t&&t.beforeFetch&&Be(()=>t.beforeFetch(t,{api:this.api}));i&&pe.Function(i.then)?i.then(e).catch(n):i===!1?n():e()}).then(()=>this.globalBeforeFetch(t))},beforeSubmit(t){return new Promise((e,n)=>{const i=this.options.beforeSubmit&&Be(()=>this.options.beforeSubmit(t,{api:this.api}));i&&pe.Function(i.then)?i.then(e).catch(n):i===!1?n():e()})}});oT(Nn);rT(Nn);aT(Nn);cT(Nn);pT(Nn);mT(Nn);vT(Nn);gT(Nn);const bT="fcFragment",da=Ce({name:bT,inheritAttrs:!1,props:["vnode"],render(){return this.vnode}});function wT(t){return Object.keys(t).map(e=>{const n=t[e],i=S_(e);if(i)return[i,n.value,n.arg,n.modifiers]}).filter(e=>!!e)}function th(t,e){let n=t.directives;return n?(Array.isArray(n)||(n=[n]),it(e,n.reduce((i,o)=>i.concat(wT(o)),[]))):e}function ST(){const t={};function e(n){this.vm=n.vm,this.handle=n}return Fe(e.prototype,{make(n,i,o){return th(i,this.h(n,Kd(i),o))},makeComponent(n,i,o){try{return th(i,j(n,Kd(i),o))}catch(r){return console.error(r),j("")}},h(n,i,o){const r=(this.vm||Za()).appContext.config.isNativeTag(n),s=this.handle.fc.prop.components[n];!s&&r&&delete i.formCreateInject;try{return j(s||(r?n:Ue(n)),i,o)}catch(a){return console.error(a),j("")}},aliasMap:t}),Fe(e,{aliasMap:t,alias(n,i){t[n]=i},use(n){Object.keys(n).forEach(i=>{const o=Do(i),r=_m(i).toLocaleLowerCase(),s=n[i];e.alias(i,s),[i,o,r].forEach(a=>{e.prototype[a]=function(l,c){return this.make(t[i]||a,l,c)}})})}}),e}function CT(t){class e extends Dm{}return Object.assign(e.prototype,t),e}function Dm(t){Fe(this,{$handle:t,vm:t.vm,options:{},ref:"fcForm",mergeOptionsRule:{normal:["form","row","info","submitBtn","resetBtn"]}}),this.updateKey(),this.init()}Fe(Dm.prototype,{__init(){this.$render=this.$handle.$render,this.$r=(...t)=>this.$render.renderRule(...t)},updateKey(){this.key=Ps()},init(){},update(){},beforeRender(){},form(){return this.vm.refs[this.ref]},adapterValidate(t,e){return t.validator=(n,i,o)=>e(i,o),t},getSlot(t){const e=n=>{if(n)return n.slots[t]||e(n.setupState.parent)};return e(this.vm)},mergeOptions(t,e){return Qn(t.map(n=>this.tidyOptions(n)),e,this.mergeOptionsRule)},updateOptions(t){this.$handle.fc.targetFormDriver("updateOptions",t,{handle:this.$handle,api:this.$handle.api}),this.options=this.mergeOptions([t],this.getDefaultOptions()),this.update()},tidyOptions(t){return t},tidyRule(t){},mergeProp(t){},getDefaultOptions(){return{}},fieldChange(t,e,n,i){},render(t){}});const ET=function(t){const e={name:"loadData",_fn:[],loaded(n,i,o){this.deleted(n),Ge(()=>{let r=Ut(n.getValue());const s=[];r.forEach(a=>{if(a&&(a.attr||a.template)){let l=d=>{let h;i&&i.__fc__&&(h=i.__fc__.getParentGroup());let m;a.template?m=t.$handle.loadStrVar(a.template,d,h?{rule:i,value:t.$handle.subRuleData[h.id]||{}}:null):a.handler&&pe.Function(a.handler)?m=a.handler(d,i,o):m=t.$handle.loadStrVar(`{{${a.attr}}}`,d,h?{rule:i,value:t.$handle.subRuleData[h.id]||{}}:null),(m==null||m==="")&&a.default!=null&&(m=a.default),a.copy!==!1&&(m=Mn(m));const f=a.modify?i:n.getProp();a.to==="child"?f.children?f.children[0]=m:f.children=[m]:fi(f,a.to||"options",m),o.sync(i)},c=d=>l(d);const u=t.watchLoadData(c);l=ci(l,a.wait||300),a.watch!==!1?s.push(u):u()}}),this._fn[n.id]=s})},deleted(n){this._fn[n.id]&&(this._fn[n.id].forEach(i=>{i()}),delete this._fn[n.id]),n.clearProp()}};return e.watch=e.loaded,e},xT=function(t){const e={name:"t",_fn:[],loaded(n,i,o){this.deleted(n);let r=n.getValue()||{};const s=[];Object.keys(r).forEach(a=>{const l=r[a];if(l){const c=typeof l=="object";let u=m=>{let f=t.t(c?l.attr:l,c?l.params:null,m);const p=c&&l.modify?i:n.getProp();a==="child"?p.children?p.children[0]=f:p.children=[f]:fi(p,a,f),o.sync(i)},d=m=>u(m);const h=t.watchLoadData(d);u=ci(u,l.wait||300),l.watch!==!1?s.push(h):h()}}),this._fn[n.id]=s},deleted(n){this._fn[n.id]&&(this._fn[n.id].forEach(i=>{i()}),delete this._fn[n.id]),n.clearProp()}};return e.watch=e.loaded,e},Lm={name:"componentValidate",load(t,e,n){let i=t.getValue();if(!i||i.method===!1)t.clearProp(),n.clearValidateState([e.field]);else{pe.Object(i)||(i={method:i});const o=i.method,r=en(Te({},i),{validator(...s){const a=On(e);if(a)return n.exec(a.id,pe.String(o)?o:"formCreateValidate",...s,{attr:t,rule:e,api:n})}});delete r.method,t.getProp().validate=[r]}},watch(...t){Lm.load(...t)}},TT=function(t){function e(o){return pe.String(o)&&(o={action:o,to:"options"}),o}function n(o,r,s){let a=o.value;i.deleted(o),pe.Function(a)&&(a=a(r,s)),a=e(a);const l=d=>{d===void 0?o.clearProp():fi(o.getProp(),a.to||"options",d),d!=null&&a&&a.key&&t.$handle.options.globalData[a.key]&&t.fetchCache.set(t.$handle.options.globalData[a.key],{status:!0,data:d}),s.sync(r)};if(!a||!a.action&&!a.key){l(void 0);return}a=Mn(a),a.to||(a.to="options");const c=a.onError,u=()=>{if(!o.getValue())return o.clearProp(),s.sync(r),!0};i._fn[o.id]=t.watchLoadData(ci((d,h)=>{if(h&&a.watch===!1)return i._fn[o.id]();if(a.key){t.targetRule=r;const p=d("$globalData."+a.key);if(delete t.targetRule,p){if(u())return;l(p)}return}const m=t.$handle.loadFetchVar(Mn(a),d,r),f=en(Te({headers:{}},m),{onSuccess(p,_){if(u())return;let C=S=>_?S:lt(S,"data")?S.data:S;const w=Dn(m.parse);pe.Function(w)?C=w:w&&pe.String(w)&&(C=S=>Pt(S,w)),as(C(p,r,s)).then(S=>{l(S)})},onError(p){l(void 0),!u()&&(c||(_=>Sc(_.message||"fetch fail "+m.action)))(p,r,s)}});t.$handle.beforeFetch(f,{rule:r,api:s}).then(()=>{if(pe.Function(m.action)){as(m.action(r,s)).then(p=>{f.onSuccess(p,!0)}).catch(p=>{f.onError(p)});return}Be(()=>t.create.fetch(f,{inject:o,rule:r,api:s}))}).catch(p=>{})},a.wait||600))}const i={name:"fetch",_fn:[],loaded(...o){n(...o)},watch(...o){n(...o)},deleted(o){this._fn[o.id]&&(this._fn[o.id](),delete this._fn[o.id]),o.clearProp()}};return i},$T={fetch:TT,loadData:ET,t:xT,componentValidate:Lm},kT="html",OT={name:kT,loadChildren:!1,render(t,e){return e.prop.props.innerHTML=t.default(),e.vNode.make(e.prop.props.tag||"div",e.prop)},renderChildren(t){return{default:()=>t.filter(e=>pe.String(e)).join("")}}};function AT(t){t=t+"=";const e=decodeURIComponent(document.cookie).split(";");for(let n=0;n<e.length;n++){let i=e[n];for(;i.charAt(0)===" ";)i=i.substring(1);if(i.indexOf(t)===0){i=i.substring(t.length,i.length);try{return JSON.parse(i)}catch{return i}}}return null}function PT(t){const e=localStorage.getItem(t);if(e)try{return JSON.parse(e)}catch{return e}return null}function RT(t){const e=sessionStorage.getItem(t);if(e)try{return JSON.parse(e)}catch{return e}return null}function $c(t,e){if(!e)return null;const n=e.split(".");let i=t(n.shift());return n.length?i==null?null:Pt(i,n):i}function IT(t){return $c(AT,t)}function MT(t){return $c(PT,t)}function FT(t){return $c(RT,t)}const DT={en:{required:"{title} is required",validate:{url:"{title} is not a valid url",email:"{title} is not a valid email",ip:"{title} {title} is not a valid ip",phone:"{title} {title} is not a valid phone",pattern:"{title} does not match pattern {pattern}",uppercase:"{title} must be all uppercase",lowercase:"{title} must be all lowercased",positive:"{title} is not a positive number",negative:"{title} is not a negative number",equal:"{title} is not equal to {equal}",min:"{title} cannot be less than {min}",max:"{title} cannot be greater than {max}",enum:"{title} must be one of {enum}",hasKeys:"{title} does not contain required fields {hasKeys}",minLen:"{title} must be at least {minLen}",maxLen:"{title} cannot be longer than {maxLen}",len:"{title} must be exactly {len}",integer:"{title} is not an integer",number:"{title} is not an number"}},"zh-cn":{required:"{title}不能为空",validate:{url:"{title}不是有效的 url 地址",email:"{title}不是有效的邮箱地址",ip:"{title}不是有效的 IP 地址",phone:"{title}不是正确的手机号",pattern:"{title}必须匹配 {pattern}",uppercase:"{title}必须全大写",lowercase:"{title}必须全小写",positive:"{title}不是正数",negative:"{title}不是负数",equal:"{title}必须等于 {equal}",min:"{title}必须大于等于 {min}",max:"{title}必须小于等于 {max}",enum:"{title}必须是 {enum} 之一",hasKeys:"{title}必须包含 {hasKeys} 字段",minLen:"{title}长度必须大于 {minLen}",maxLen:"{title}长度必须小于 {maxLen}",len:"{title}长度必须为 {len}",integer:"{title}必须为整数",number:"{title}必须为数字"}}};function LT(t,e){let n;return arguments.length===2?(n=arguments[1],e=n[t]):n=arguments[2],{id:e,prop:n}}function ha(){return LT("name",...arguments)}function jT(t){const e=t.key||[],n=t.array||[],i=t.normal||[];xm.push(...e),Cc.push(...n),Ec.push(...i),Im([...e,...n,...i])}let zT=1;const sn={},nh=Symbol("defValue");function jm(t){const e={[da.name]:da},n={},i={},o={},r={},s=[],a=[],l=[t.extendApi],c=Te({},$T),u=Jx();let d={global:{}};const h=t.isMobile===!0,m=Mt({$mobile:h}),f=ST(),p={},_={};jT(t.attrs||{});function C(k){const z=sn[k];if(Array.isArray(z))return z.map(D=>D.api());if(z)return z.api()}function w(k){s.push(k)}function S(){const k=ha(...arguments);k.id&&k.prop&&(i[k.id]=k.prop)}function b(){const k=ha(...arguments);k.id&&k.prop&&(c[k.id]=pe.Function(k.prop)?k.prop:en(Te({},k.prop),{name:k.id}))}function E(k){f.use(k)}function x(k){if(arguments.length===0)return To;if(typeof k=="string"&&arguments.length===1)return n[Vt(k)];const z=ha(...arguments);if(!z.id||!z.prop)return To;const D=Vt(z.id),B=z.prop,oe=B.merge===!0?n[D]:void 0;n[D]=Sr(B,oe||To),u[D]=Et(D),B.maker&&Fe(u,B.maker)}function O(k,z){let D;if(pe.String(k)){if(D=k,z===void 0)return e[D]}else D=k.displayName||k.name,z=k;if(!D||!z)return;const B=Vt(D);e[D]=z,e[B]=z,delete f.aliasMap[D],delete f.aliasMap[B],delete n[D],delete n[B],z.formCreateParser&&x(D,z.formCreateParser)}function $(){return Gx(re,e,i)}function K(k,z){const D=$();return ic({data(){return Mt({rule:k,option:z})},render(){return Oo(D,Te({ref:"fc"},this.$data))}})}function F(){return da}function P(k,z){return pe.Function(k.install)?k.install(N,z):pe.Function(k)&&k(N,z),this}function N(k,z){let D=K(k,z||{});s.forEach(oe=>{Be(()=>oe(N,D))});const B=document.createElement("div");return(z?.el||document.body).appendChild(B),D.mount(B).$refs.fc.fapi}Sr(N,_);function M(k){let z=Te({},t);return k?z.inherit={components:e,parsers:n,directives:i,modelFields:o,providers:c,useApps:s,maker:u,formulas:p,loadData:m}:delete z.inherit,jm(z)}function q(k,z){o[k]=z}function le(k,z){p[k]=z}function de(k,z){const D=r[k]||{},B=D.parsers||{};z.parsers&&Object.keys(z.parsers).forEach(oe=>{B[oe]=Sr(z.parsers[oe],To)}),z.name=k,r[k]=en(Te(Te({},D),z),{parsers:B})}function Y(k){k&&Object.keys(sn).forEach(z=>{(Array.isArray(sn[z])?sn[z]:[sn[z]]).forEach(D=>{D.bus.$emit("$loadData."+k)})})}function I(k,z){fi(m,k,z),Y(k)}function A(k,z){const D=(...B)=>Be(()=>z(...B));D._driver=!0,I(k,D)}function Q(k,z){const D=(k||"").split(".");k=D.shift();const B=D.join(".");if(lt(m,k)||(m[k]=nh),m[k]!==nh){let oe=m[k];return oe&&oe._driver?oe=oe(B):D.length&&(oe=Pt(oe,D)),oe==null||oe===""?z:oe}else return z}function U(k){l.push(k)}function ie(k){delete m[k],Y(k)}function ve(k,z){a.push({name:k,callback:z})}function re(k){Fe(this,{id:zT++,create:N,vm:k,manager:CT(t.manager),parsers:n,providers:c,modelFields:o,formulas:p,isMobile:h,rules:k.props.rule,name:k.props.name||Ps(),inFor:k.props.inFor,prop:{components:e,directives:i},get:null,drivers:r,renderDriver:null,refreshData:Y,loadData:m,CreateNode:f,bus:new gm,unwatch:[],options:H({}),extendApiFn:l,fetchCache:new WeakMap,tmpData:Mt({})}),a.forEach(z=>{this.bus.$on(z.name,z.callback)}),Ge(()=>{$e(this.options,()=>{this.$handle.$manager.updateOptions(this.options.value),this.api().refresh()},{deep:!0})}),Fe(k.appContext.components,e),Fe(k.appContext.directives,i),this.$handle=new Nn(this),this.name&&(this.inFor?(sn[this.name]||(sn[this.name]=[]),sn[this.name].push(this)):sn[this.name]=this)}re.isMobile=h,Fe(re.prototype,{init(){this.isSub()&&this.unwatch.push($e(()=>this.vm.setupState.parent.setupState.fc.options.value,()=>{this.initOptions(),this.$handle.api.refresh()},{deep:!0,flush:"sync"})),this.vm.props.driver&&(this.renderDriver=typeof this.vm.props.driver=="object"?this.vm.props.driver:this.drivers[this.vm.props.driver]),!this.renderDriver&&this.vm.setupState.parent&&(this.renderDriver=this.vm.setupState.parent.setupState.fc.renderDriver),this.renderDriver||(this.renderDriver=this.drivers.default),this.initOptions(),this.$handle.init()},targetFormDriver(k,...z){if(this.bus.$emit(k,...z),this.renderDriver&&this.renderDriver[k])return Be(()=>this.renderDriver[k](...z))},t(k,z,D){let B=D?D("$t."+k):this.globalLanguageDriver(k);return B==null&&(B=""),B&&z&&Object.keys(z).forEach(oe=>{const ee=new RegExp(`{${oe}}`,"g");B=B.replace(ee,z[oe])}),B},globalDataDriver(k){let z=k.split(".");const D=z.shift(),B=this.options.value.globalData&&this.options.value.globalData[D];if(B){if(B.type==="static")return Pt(B.data,z);{let oe;const ee=this.fetchCache.get(B);if(ee){if(ee.status&&(oe=Pt(ee.data,z)),!ee.loading)return oe;ee.loading=!1,this.fetchCache.set(B,ee)}else this.fetchCache.set(B,{status:!1});const G=ci(()=>{ke();const Ee=this.fetchCache.get(B);this.options.value.globalData&&Object.values(this.options.value.globalData).indexOf(B)!==-1?(Ee&&(Ee.loading=!0,this.fetchCache.set(B,Ee)),this.bus.$emit("$loadData.$globalData."+D)):this.fetchCache.delete(B)},B.wait||600),he=Ee=>{this.fetchCache.set(B,{status:!0,data:Ee}),this.bus.$emit("$loadData.$globalData."+D)},me=(Ee,ze)=>{if(ze&&B.watch===!1)return ke();if(ze){G();return}const Pe=this.$handle.loadFetchVar(vl(B),Ee);Pe.targetRule=this.targetRule,this.$handle.api.fetch(Pe).then(Ne=>{he(Ne)}).catch(Ne=>{he(null)})},ke=this.watchLoadData(me);return B.watch===!1&&ke(),this.unwatch.push(ke),oe}}},getLocale(){let k=this.vm.setupState.top.props.locale;return k&&typeof k=="object"?k.name:typeof k=="string"?k:"zh-cn"},globalLanguageDriver(k){let z=this.vm.setupState.top.props.t,D=this.vm.setupState.top.props.locale,B;if(z&&(B=Be(()=>z(k))),B==null&&D&&typeof D=="object"&&(B=Pt(D,k)),B==null){const oe=this.options.value.language||{},ee=this.getLocale();B=Pt(oe[ee]||{},k),B==null&&(B=Pt(DT[ee]||{},k))}return B},globalVarDriver(k){let z=k.split(".");const D=z.shift(),B=this.options.value.globalVariable&&this.options.value.globalVariable[D];if(B){const oe=pe.Function(B)?B:Dn(B.handle);if(oe){let ee=oe((...G)=>this.$handle.api.getData(...G),this.$handle.api);return Pt(ee,z)}}},setData(k,z,D){D?I(k,z):(fi(this.vm.setupState.top.setupState.fc.tmpData,k,z),this.bus.$emit("$loadData."+k))},getLoadData(k,z){let D=null;if(k!=null){let B=k.split(".");const oe=B.shift();if(D=Pt(this.vm.setupState.top.setupState.fc.tmpData,k),D!=null)return D;if(oe==="$topForm")D=this.$handle.api.top.formData(!0);else if(oe==="$scopeForm")D=this.$handle.api.scope.formData(!0);else if(oe==="$form")D=this.$handle.api.formData(!0);else if(oe==="$options")D=this.options.value;else if(oe==="$globalData")D=this.globalDataDriver(B.join(".")),B=[];else if(oe==="$var")D=this.globalVarDriver(B.join(".")),B=[];else if(oe==="$locale")D=this.getLocale(),B=[];else if(oe==="$t")D=this.globalLanguageDriver(B.join(".")),B=[];else{if(oe==="$preview")return this.$handle.preview;D=Q(k),B=[]}D&&B.length&&(D=Pt(D,B))}return D==null||D===""?z:D},watchLoadData(k,z){let D={};const B=G=>{this.get||(this.get=oe),Be(()=>{k(oe,G)}),this.get===oe&&(this.get=void 0)},oe=(G,he)=>{let me;if(typeof G=="object"&&(me=G.getValue,G=G.id),D[G])return D[G].val;const ke=te(()=>me?me():this.getLoadData(G,he)),Ee=G.split("."),ze=Ee.shift(),Pe=Ee.shift()||"",Ne=ci(()=>{const Qe=me?me():this.getLoadData(G,he);if(D[G])((Qe instanceof Function||pe.Object(Qe)||Array.isArray(Qe))&&Qe===D[G].val||JSON.stringify(Qe)!==JSON.stringify(D[G].val))&&(D[G].val=Qe,B(!0));else return},z||0),ut=$e(ke,Qe=>{Ne()});return this.bus.$on("$loadData."+ze,Ne),Pe&&this.bus.$on("$loadData."+ze+"."+Pe,Ne),D[G]={fn:()=>{this.bus.$off("$loadData."+ze,Ne),Pe&&this.bus.$off("$loadData."+ze+"."+Pe,Ne),ut()},val:ke.value},ke.value};B(!1);const ee=()=>{Object.keys(D).forEach(G=>D[G].fn()),D={}};return this.unwatch.push(ee),ee},isSub(){return this.vm.setupState.parent&&this.vm.props.extendOption},initOptions(){this.options.value={};let k=Te({formData:{},submitBtn:{},resetBtn:{},globalEvent:{},globalData:{}},Mn(d));const z=this.isSub();z&&(k=this.mergeOptions(k,this.vm.setupState.parent.setupState.fc.options.value||{},!0)),k=this.mergeOptions(k,this.vm.props.option);const D=this.api();this.targetFormDriver("initOptions",k,{api:D,isSubForm:z}),this.updateOptions(k)},mergeOptions(k,z,D){return z=Te({},z||{}),D&&["page","onSubmit","onReset","onCreated","onChange","onMounted","mounted","beforeUnmount","beforeSubmit","onBeforeUnmount","onReload","reload","formData","el","globalClass","style"].forEach(B=>{delete z[B]}),z.global&&(k.global=Kx(k.global,z.global),delete z.global),this.$handle.$manager.mergeOptions([z],k),k},updateOptions(k){this.options.value=this.mergeOptions(this.options.value,k),this.$handle.$manager.updateOptions(this.options.value),this.bus.$emit("$loadData.$options")},api(){return this.$handle.api},render(){return this.$handle.render()},mounted(){this.$handle.mounted()},unmount(){if(Be(()=>this.$handle.lifecycle("beforeUnmount")),this.name)if(this.inFor){const k=sn[this.name].indexOf(this);sn[this.name].splice(k,1)}else delete sn[this.name];a.forEach(k=>{this.bus.$off(k.name,k.callback)}),this.tmpData={},this.unwatch.forEach(k=>k()),this.unwatch=[],this.$handle.reloadRule([])},updated(){this.$handle.bindNextTick(()=>this.bus.$emit("next-tick",this.$handle.api))}});function ge(k){Fe(k,{version:t.version,ui:t.ui,isMobile:h,extendApi:U,getData:Q,setDataDriver:A,setData:I,removeData:ie,refreshData:Y,maker:u,component:O,directive:S,setModelField:q,setFormula:le,setDriver:de,register:b,$vnode:F,parser:x,use:P,factory:M,componentAlias:E,copyRule:km,copyRules:Om,mergeRule:Zn,fetch:Mm,$form:$,parseFn:Dn,parseJson:wm,toJson:Lo,useApp:w,getApi:C,on:ve})}function _e(k){Fe(k,{create:N,install(z,D){d=Te(Te({},d),D||{});const B=`_installedFormCreate${h?"Mobile":""}_${t.ui}`;if(z[B]===!0)return;z[B]=!0;const oe=function(G,he={}){return N(G,he)};ge(oe),z.config.globalProperties.$formCreate=oe;const ee=$();z.component(ee.name,ee),s.forEach(G=>{Be(()=>G(k,z))})}})}if(ge(_),_e(_),A("$cookie",IT),A("$localStorage",MT),A("$sessionStorage",FT),f.use({fragment:"fcFragment"}),t.install&&N.use(t),w((k,z)=>{z.mixin({props:["formCreateInject"]})}),x(OT),t.inherit){const k=t.inherit;k.components&&Fe(e,k.components),k.parsers&&Fe(n,k.parsers),k.directives&&Fe(i,k.directives),k.modelFields&&Fe(o,k.modelFields),k.providers&&Fe(c,k.providers),k.useApps&&Fe(s,k.useApps),k.maker&&Fe(u,k.maker),k.loadData&&Fe(m,k.loadData),k.formulas&&Fe(p,k.formulas)}const R=$();return Sr(R,_),Object.defineProperties(R,{fetch:{get(){return _.fetch},set(k){_.fetch=k}}}),R.util=_,R}const ih={date:"YYYY-MM-DD",month:"YYYY-MM",week:"YYYY-wo",datetime:"YYYY-MM-DD HH:mm:ss",timerange:"HH:mm:ss",daterange:"YYYY-MM-DD",monthrange:"YYYY-MM",datetimerange:"YYYY-MM-DD HH:mm:ss",year:"YYYY"},oh="datePicker",NT={name:oh,maker:(function(){return["year","month","date","dates","week","datetime","datetimeRange","dateRange","monthRange"].reduce((t,e)=>(t[e]=Et(oh,{type:e.toLowerCase()}),t),{})})(),mergeProp(t){const e=t.prop.props;e.valueFormat||(e.valueFormat=ih[e.type]||ih.date)}},pa="hidden",UT={name:pa,maker:{[pa]:(t,e)=>Et(pa)("",t,e)},render(){return[]}},fa="input",VT={name:fa,maker:(function(){const t=["password","url","email","text","textarea"].reduce((e,n)=>(e[n]=Et(fa,{type:n}),e),{});return t.idate=Et(fa,{type:"date"}),t})(),mergeProp(t){let{props:e}=t.prop;e&&e.autosize&&e.autosize.minRows&&(e.rows=e.autosize.minRows||2)}},BT="textarea",HT={name:BT,mergeProp(t){let{props:e}=t.prop;e.type="textarea",e&&e.autosize&&e.autosize.minRows&&(e.rows=e.autosize.minRows||2)}},rh="slider",qT={name:rh,maker:{sliderRange:Et(rh,{range:!0})},toFormValue(t,e){let n=Array.isArray(t),i=e.prop.props,o=i.min||0,r;return i.range===!0?r=n?t:[o,parseFloat(t)||o]:r=n?parseFloat(t[0])||o:parseFloat(t),r}},ma="timePicker",WT={name:ma,maker:{time:Et(ma,t=>t.props.isRange=!1),timeRange:Et(ma,t=>t.props.isRange=!0)},mergeProp(t){const e=t.prop.props;e.valueFormat||(e.valueFormat="HH:mm:ss")}},KT={name:"FcRow",render(t,e){return e.vNode.col({props:{span:24}},{default:()=>[e.vNode.row(e.prop,t)]})}},YT="select",GT={name:YT,toFormValue(t,e){return e.prop.props.multiple&&!Array.isArray(t)?Ut(t):t}},QT=[NT,UT,VT,HT,qT,WT,KT,GT],rt="el",XT={button:rt+"-button",icon:rt+"-icon",slider:rt+"-slider",rate:rt+"-rate",upload:"fc-upload",cascader:rt+"-cascader",popover:rt+"-popover",tooltip:rt+"-tooltip",colorPicker:rt+"-colorPicker",timePicker:rt+"-time-picker",timeSelect:rt+"-time-select",datePicker:rt+"-date-picker",switch:rt+"-switch",select:"fc-select",checkbox:"fc-checkbox",radio:"fc-radio",inputNumber:rt+"-input-number",number:rt+"-input-number",input:rt+"-input",textarea:rt+"-input",formItem:rt+"-form-item",form:rt+"-form",frame:"fc-frame",col:rt+"-col",row:rt+"-row",tree:"fc-tree",inputTag:rt+"-input-tag",inputOtp:rt+"-input-otp",mention:rt+"-mention",transfer:rt+"-transfer",treeSelect:rt+"-tree-select",autoComplete:rt+"-autocomplete",auto:rt+"-autocomplete",group:"fc-group",array:"fc-group",object:"fc-sub-form",subForm:"fc-sub-form"};function JT(){return{form:{inline:!1,labelPosition:"right",labelWidth:"125px",disabled:!1,size:void 0},row:{show:!0,gutter:0},submitBtn:{type:"primary",loading:!1,disabled:!1,innerText:"",show:!0,col:void 0,click:void 0},resetBtn:{type:"default",loading:!1,disabled:!1,innerText:"",show:!1,col:void 0,click:void 0}}}function ZT(t){return t.type==="tooltip"}function sh(t,e){lt(t,e)&&pe.String(t[e])&&(t[e]={[e]:t[e],show:!0})}function Vn(t){return t===!1}function e$(t,e){lt(t,e)&&!pe.Object(t[e])&&(t[e]={show:!!t[e]})}function va(t){const e=Te({},t);return delete e.children,e}const t$={validate(){const t=this.form();return t?t.validate():new Promise(e=>e())},validateField(t){return new Promise((e,n)=>{const i=this.form();i?i.validateField(t,(o,r)=>{r?n(r):e(o)}):e()})},clearValidateState(t){const e=this.vm.refs[t.wrapRef];e&&e.clearValidate()},fieldChange(t,e,n,i){var o,r;i||(r=(o=this.vm.refs[t.wrapRef])==null?void 0:o.validate("change"))==null||r.catch(()=>{})},tidyOptions(t){return["submitBtn","resetBtn","row","info","wrap","col","title"].forEach(e=>{e$(t,e)}),t},tidyRule({prop:t}){return sh(t,"title"),sh(t,"info"),t},mergeProp(t){const e={info:{trigger:"hover",placement:"top-start",icon:!0},title:{},col:{span:24},wrap:{}};["info","wrap","col","title"].forEach(n=>{t.prop[n]=Qn([this.options[n]||{},t.prop[n]||{}],e[n])})},getDefaultOptions(){return JT()},update(){const t=this.options.form;this.rule={props:Te({},t),on:{submit:e=>{e.preventDefault()}},style:t.style,type:"form"}},beforeRender(){const{key:t,ref:e,$handle:n}=this,i=this.options.form;Fe(this.rule,{key:t,ref:e,class:[i.className,i.class,"form-create",this.$handle.preview?"is-preview":""]}),Fe(this.rule.props,{model:n.formData})},render(t){return t.slotLen()&&!this.$handle.preview&&t.setSlot(void 0,()=>this.makeFormBtn()),this.$r(this.rule,Vn(this.options.row.show)?t.getSlots():[this.makeRow(t)])},makeWrap(t,e){const n=t.prop,i=`${this.key}${t.key}`,o=n.col,r=this.isTitle(n)&&n.wrap.title!==!1,s=!o.labelWidth&&!r?0:o.labelWidth,{inline:a,col:l}=this.rule.props,c=n.wrap.class;delete n.wrap.class,delete n.wrap.title;const u=(pe.Undef(n.wrap.show)?!t.input:Vn(n.wrap.show))?e:this.$r(Qn([n.wrap,{props:en(Te({labelWidth:s===void 0?s:_m(s),label:r?n.title.title:void 0},va(n.wrap||{})),{prop:t.id,rules:t.injectValidate()}),class:this.$render.mergeClass(c||n.className,"fc-form-item"),key:`${i}fi`,ref:t.wrapRef,type:"formItem"}]),Te({default:()=>e},r?{label:()=>this.makeInfo(n,i,t)}:{}));return a===!0||Vn(l)||Vn(o.show)?u:this.makeCol(n,i,[u])},isTitle(t){if(this.options.form.title===!1)return!1;const e=t.title;return!(!e.title&&!e.native||Vn(e.show))},makeInfo(t,e,n){var i,o,r,s,a,l;const c=Te({},t.title),u=Te({},t.info),d=ZT(u),h=this.options.form,m=this.getSlot("title"),f=[m?m({title:(o=(i=n.refRule)==null?void 0:i.__$title)==null?void 0:o.value,rule:n.rule,options:this.options}):((s=(r=n.refRule)==null?void 0:r.__$title)==null?void 0:s.value)+(h.labelSuffix||h["label-suffix"]||"")];if(!Vn(u.show)&&(u.info||u.native)&&!Vn(u.icon)){const _={type:u.type||"popover",props:va(u),key:`${e}pop`};delete _.props.icon,delete _.props.show,delete _.props.info,delete _.props.align,delete _.props.native;const C="content";u.info&&!lt(_.props,C)&&(_.props[C]=(l=(a=n.refRule)==null?void 0:a.__$info)==null?void 0:l.value),f[u.align!=="left"?"unshift":"push"](this.$r(Qn([u,_]),{[c.slot||(d?"default":"reference")]:()=>this.$r({type:"ElIcon",style:"top:2px",key:`${e}i`},{default:()=>this.$r({type:u.icon===!0?"icon-warning":u.icon})},!0)}))}const p=Qn([c,{props:va(c),key:`${e}tit`,class:"fc-form-title",type:c.type||"span",on:{click:(..._)=>{this.$handle.targetHook(n,"titleClick",{args:_})}}}]);return delete p.props.show,delete p.props.title,delete p.props.native,this.$r(p,f)},makeCol(t,e,n){const i=Te({},t.col);return delete i.show,this.$r({class:this.$render.mergeClass(i.class,"fc-form-col"),type:"col",props:i||{span:24},key:`${e}col`},n)},makeRow(t){const e=this.options.row||{};return this.$r({type:"row",props:e,class:this.$render.mergeClass(e.class,"fc-form-row"),key:`${this.key}row`},t)},makeFormBtn(){let t=[];if(Vn(this.options.submitBtn.show)||t.push(this.makeSubmitBtn()),Vn(this.options.resetBtn.show)||t.push(this.makeResetBtn()),!t.length)return;const e=this.$r({type:"formItem",class:"fc-form-item",key:`${this.key}fb`},t);return this.rule.props.inline===!0?e:this.$r({type:"col",class:"fc-form-col fc-form-footer",props:{span:24},key:`${this.key}fc`},[e])},makeResetBtn(){const t=Te({},this.options.resetBtn),e=t.innerText||this.$handle.api.t("reset")||"重置";return delete t.innerText,delete t.click,delete t.col,delete t.show,this.$r({type:"button",props:t,class:"fc-reset-btn",style:{width:t.width},on:{click:()=>{const n=this.$handle.api;this.options.resetBtn.click?this.options.resetBtn.click(n):n.resetFields()}},key:`${this.key}b2`},[e])},makeSubmitBtn(){const t=Te({},this.options.submitBtn),e=t.innerText||this.$handle.api.t("submit")||"提交";return delete t.innerText,delete t.click,delete t.col,delete t.show,this.$r({type:"button",props:t,class:"fc-submit-btn",style:{width:t.width},on:{click:()=>{const n=this.$handle.api;this.options.submitBtn.click?this.options.submitBtn.click(n):n.submit().catch(()=>{})}},key:`${this.key}b1`},[e])}},mi={};n$(mi);i$(mi);o$(mi);r$(mi);s$(mi);a$(mi);function n$(t){["group","tree","switch","upload","autoComplete","checkbox","cascader","colorPicker","datePicker","frame","inputNumber","inputTag","inputOtp","mention","transfer","treeSelect","radio","rate"].forEach(e=>{t[e]=Et(e)}),t.auto=t.autoComplete,t.number=t.inputNumber,t.color=t.colorPicker,t.tag=t.inputTag}function i$(t){t.treeSelectMultiple=Et("treeSelect",{multiple:!0})}function o$(t){const e="select",n="multiple";t.selectMultiple=Et(e,{[n]:!0}),t.selectOne=Et(e,{[n]:!1})}function r$(t){const e="tree",n={treeSelected:"selected",treeChecked:"checked"};Object.keys(n).reduce((i,o)=>(i[o]=Et(e,{type:n[o]}),i),t)}function s$(t){const e="upload",n={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]};Object.keys(n).reduce((i,o)=>(i[o]=Et(e,r=>r.props({uploadType:n[o][0],maxLength:n[o][1]})),i),t),t.uploadImage=t.image,t.uploadFile=t.file}function a$(t){const e={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]};return Object.keys(e).reduce((n,i)=>(n[i]=Et("frame",o=>o.props({type:e[i][0],maxLength:e[i][1]})),n),t),t.frameInput=t.frameInputs,t.frameFile=t.frameFiles,t.frameImage=t.frameImages,t}function ah(t,e){return pe.Boolean(t)?t={show:t}:!pe.Undef(t)&&!pe.Object(t)&&(t={show:e}),t}function l$(t,e){return{formEl(){return e.$manager.form()},wrapEl(n){const i=e.getFieldCtx(n);if(i)return e.vm.refs[i.wrapRef]},validate(n){return new Promise((i,o)=>{const r=t.children,s=[e.$manager.validate()];r.filter(a=>!a.isScope).forEach(a=>{s.push(a.validate())}),Promise.all(s).then(()=>{i(!0),n&&n(!0)}).catch(a=>{o(a),n&&n(a),e.vm.emit("validate-fail",a,{api:t}),e.emitEvent("validate-fail",a,{api:t})})})},validateField(n,i){return new Promise((o,r)=>{const s=typeof n=="object"?On(n):e.getCtx(n);if(!s){o(null),i&&i(null);return}const a=e.subForm[s.id],l=[e.$manager.validateField(s.id)];Ut(a).filter(c=>!c.isScope).forEach(c=>{l.push(c.validate())}),Promise.all(l).then(()=>{o(null),i&&i(null)}).catch(c=>{r(c),i&&i(c),e.vm.emit("validate-field-fail",c,{field:n,api:t})})})},validateFields(n,i){return new Promise((o,r)=>{Array.isArray(n)||(n=[n]);const s=n.map(a=>t.validateField(a));Promise.all(s).then(()=>{o(null),i&&i(null)}).catch(a=>{r(a),i&&i(a)})})},clearValidateState(n,i=!0){t.helper.tidyFields(n).forEach(o=>{i&&this.clearSubValidateState(o),e.getCtxs(o).forEach(r=>{e.$manager.clearValidateState(r)})})},clearSubValidateState(n){t.helper.tidyFields(n).forEach(i=>{e.getCtxs(i).forEach(o=>{const r=e.subForm[o.id];r&&(Array.isArray(r)?r.forEach(s=>{s.clearValidateState()}):r&&r.clearValidateState())})})},btn:{loading:(n=!0)=>{t.submitBtnProps({loading:!!n})},disabled:(n=!0)=>{t.submitBtnProps({disabled:!!n})},show:(n=!0)=>{t.submitBtnProps({show:!!n})}},resetBtn:{loading:(n=!0)=>{t.resetBtnProps({loading:!!n})},disabled:(n=!0)=>{t.resetBtnProps({disabled:!!n})},show:(n=!0)=>{t.resetBtnProps({show:!!n})}},submitBtnProps:(n={})=>{let i=ah(e.options.submitBtn,!0);Fe(i,n),e.options.submitBtn=i,t.refreshOptions()},resetBtnProps:(n={})=>{let i=ah(e.options.resetBtn,!1);Fe(i,n),e.options.resetBtn=i,t.refreshOptions()},submit(n,i){return new Promise((o,r)=>{(e.options.validateOnSubmit===!1?Promise.resolve():t.validate()).then(()=>{let s=t.formData();e.beforeSubmit(s).then(()=>{pe.Function(n)&&Be(()=>n(s,t)),pe.Function(e.options.onSubmit)&&Be(()=>e.options.onSubmit(s,t)),e.vm.emit("submit",s,t),o(s)}).catch(a=>{})}).catch((...s)=>{pe.Function(i)&&Be(()=>i(t,...s)),r(...s)})})}}}const zm={name:"required",load(t,e,n){const i=c$(t.getValue());let o;if(i.required===!1)t.clearProp(),n.clearValidateState([e.field]);else{const r=Te({required:!0,validator(a,l,c){s(),pe.empty(l)?c(r.message):c()}},i),s=()=>{var a;const l=(a=e.__fc__.refRule.__$title)==null?void 0:a.value;if(o!==l)if(o=l,!i.message)r.message=n.t("required",{title:l})||l+(n.getLocale()==="en"?" is required":"不能为空");else{const c=i.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);c&&(r.message=n.t(c[1],{title:l}))}};s(),t.getProp().validate=[r]}n.sync(e)},watch(...t){zm.load(...t)}};function c$(t){return pe.Boolean(t)?{required:t}:pe.String(t)?{message:t}:pe.Undef(t)?{required:!1}:pe.Function(t)?{validator:t}:pe.Object(t)?t:{}}function u$(t){t.componentAlias(XT),qx.forEach(e=>{t.component(e.name,e)}),t.register(zm),QT.forEach(e=>{t.parser(e)}),Object.keys(mi).forEach(e=>{t.maker[e]=mi[e]}),typeof window<"u"&&window.ElementPlus&&t.useApp((e,n)=>{n.use(window.ElementPlus)})}function d$(){return jm({ui:"element-ui",version:"3.3.0",manager:t$,extendApi:l$,install:u$,attrs:{normal:["col","wrap"],array:["className"],key:["title","info"]}})}const Rs=d$();typeof window<"u"&&(window.formCreate=Rs);Rs.maker;function h$(t){t.useApp((e,n)=>{n.component(tl.name)||n.use(tl),n.component(Gi.name)||n.use(Gi),n.component(Pu.name)||n.use(Pu),n.component(Ru.name)||n.use(Ru),n.component(Iu.name)||n.use(Iu),n.component(il.name)||n.use(il),n.component(Mu.name)||n.use(Mu),n.component(nl.name)||n.use(nl),n.component(Fu.name)||n.use(Fu),n.component(Du.name)||n.use(Du),n.component(Lu.name)||n.use(Lu),n.component(ju.name)||n.use(ju),n.component(zu.name)||n.use(zu),n.component(Nu.name)||n.use(Nu),n.component(Uu.name)||n.use(Uu),n.component(Vu.name)||n.use(Vu),n.component(Bu.name)||n.use(Bu),n.component(Hu.name)||n.use(Hu),n.component(qu.name)||n.use(qu),n.component(Wu.name)||n.use(Wu),n.component(Ku.name)||n.use(Ku),n.component(Yu.name)||n.use(Yu),n.component(Gu.name)||n.use(Gu),n.component(Qu.name)||n.use(Qu),n.component(Xu.name)||n.use(Xu),n.component(Po.name)||n.use(Po),n.component(Ju.name)||n.use(Ju),n.component(Zu.name)||n.use(Zu),n.component(ed.name)||n.use(ed),n.component(td.name)||n.use(td),n.component(nd.name)||n.use(nd),n.component(id.name)||n.use(id)})}Rs.use(h$);function p$(t){t.use(Rs)}async function f$(){}function m$(t){t.use(Lw,{paginationStorage:{get:()=>Bb(),set:e=>Hb(e)}})}function v$(t){t.directive("loading",qp)}function g$(t){return{all:t=t||new Map,on:function(e,n){var i=t.get(e);i?i.push(n):t.set(e,[n])},off:function(e,n){var i=t.get(e);i&&(n?i.splice(i.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var i=t.get(e);i&&i.slice().map(function(o){o(n)}),(i=t.get("*"))&&i.slice().map(function(o){o(e,n)})}}}function Oe(t){let e=Go();if(typeof window<"u"){let n=t.subscribe(i=>{e.value=i});C_()&&E_(n)}else e.value=t.get();return e}let mn=[],ti=0;const Cr=4,Gr=globalThis.nanostoresGlobal||={epoch:0},Tt=t=>{let e=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:t,lc:0,listen(i){return n.lc=e.push(i),()=>{for(let r=ti+Cr;r<mn.length;)mn[r]===i?mn.splice(r,Cr):r+=Cr;let o=e.indexOf(i);~o&&(e.splice(o,1),--n.lc||n.off())}},notify(i,o){Gr.epoch++;let r=!mn.length;for(let s of e)mn.push(s,n.value,i,o);if(r){for(ti=0;ti<mn.length;ti+=Cr)mn[ti](mn[ti+1],mn[ti+2],mn[ti+3]);mn.length=0}},off(){},set(i){let o=n.value;o!==i&&(n.value=i,n.notify(o))},subscribe(i){let o=n.listen(i);return i(n.value),o},value:t};return n},_$=5,Er=6,xr=10;let y$=(t,e,n,i)=>(t.events=t.events||{},t.events[n+xr]||(t.events[n+xr]=i(o=>{t.events[n].reduceRight((r,s)=>(s(r),r),{shared:{},...o})})),t.events[n]=t.events[n]||[],t.events[n].push(e),()=>{let o=t.events[n],r=o.indexOf(e);o.splice(r,1),o.length||(delete t.events[n],t.events[n+xr](),delete t.events[n+xr])});const b$=1e3;let Nm=(t,e)=>y$(t,i=>{let o=e(i);o&&t.events[Er].push(o)},_$,i=>{let o=t.listen;t.listen=(...s)=>(!t.lc&&!t.active&&(t.active=!0,i()),o(...s));let r=t.off;return t.events[Er]=[],t.off=()=>{r(),setTimeout(()=>{if(t.active&&!t.lc){t.active=!1;for(let s of t.events[Er])s();t.events[Er]=[]}},b$)},()=>{t.listen=o,t.off=r}}),w$=(t,e,n)=>{Array.isArray(t)||(t=[t]);let i,o,r=()=>{if(o===Gr.epoch)return;o=Gr.epoch;let c=t.map(u=>u.get());if(!i||c.some((u,d)=>u!==i[d])){i=c;let u=e(...c);u&&u.then&&u.t?u.then(d=>{i===c&&s.set(d)}):(s.set(u),o=Gr.epoch)}},s=Tt(void 0),a=s.get;s.get=()=>(r(),a());let l=r;return Nm(s,()=>{let c=t.map(u=>u.listen(l));return r(),()=>{for(let u of c)u()}}),s};const ri=(t,e)=>w$(t,e);let lh=t=>t,Hn={},bl={addEventListener(){},removeEventListener(){}};function S$(){try{return typeof localStorage<"u"}catch{return!1}}S$()&&(Hn=localStorage);let C$={addEventListener(t,e,n){window.addEventListener("storage",e),window.addEventListener("pageshow",n)},removeEventListener(t,e,n){window.removeEventListener("storage",e),window.removeEventListener("pageshow",n)}};typeof window<"u"&&(bl=C$);function Um(t,e,n={}){let i=n.encode||lh,o=n.decode||lh,r=Hn[t],s=Tt(t in Hn?o(r):e),a=s.set;s.set=u=>{r=i(u),typeof r>"u"?delete Hn[t]:Hn[t]=r,a(u)};function l(u){u.key===t?u.newValue===null?a(e):a(o(u.newValue)):t in Hn||a(e)}function c(){r!==Hn[t]&&s.set(t in Hn?o(Hn[t]):e)}return Nm(s,()=>{if(c(),n.listen!==!1)return bl.addEventListener(t,l,c),()=>{bl.removeEventListener(t,l,c)}}),s}let wl=1;var E$=class{subscribers;toasts;dismissedToasts;constructor(){this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}subscribe=t=>(this.subscribers.push(t),()=>{const e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)});publish=t=>{this.subscribers.forEach(e=>e(t))};addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]};create=t=>{const{message:e,...n}=t,i=typeof t.id=="number"||t.id&&t.id?.length>0?t.id:wl++,o=this.toasts.find(s=>s.id===i),r=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(s=>s.id===i?(this.publish({...s,...t,id:i,title:e}),{...s,...t,id:i,dismissible:r,title:e}):s):this.addToast({title:e,...n,dismissible:r,id:i}),i};dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(e=>e({id:t,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),t);message=(t,e)=>this.create({...e,message:t,type:"default"});error=(t,e)=>this.create({...e,type:"error",message:t});success=(t,e)=>this.create({...e,type:"success",message:t});info=(t,e)=>this.create({...e,type:"info",message:t});warning=(t,e)=>this.create({...e,type:"warning",message:t});loading=(t,e)=>this.create({...e,type:"loading",message:t});promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let o=n!==void 0,r;const s=i.then(async l=>{if(r=["resolve",l],Ui(l))o=!1,this.create({id:n,type:"default",message:l});else if(T$(l)&&!l.ok){o=!1;const u=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,d=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description,m=typeof u=="object"&&!Ui(u)?u:{message:u||"",id:n||""};this.create({id:n,type:"error",description:d,...m})}else if(l instanceof Error){o=!1;const u=typeof e.error=="function"?await e.error(l):e.error,d=typeof e.description=="function"?await e.description(l):e.description,m=typeof u=="object"&&!Ui(u)?u:{message:u||"",id:n||""};this.create({id:n,type:"error",description:d,...m})}else if(e.success!==void 0){o=!1;const u=typeof e.success=="function"?await e.success(l):e.success,d=typeof e.description=="function"?await e.description(l):e.description,m=typeof u=="object"&&!Ui(u)?u:{message:u||"",id:n||""};this.create({id:n,type:"success",description:d,...m})}}).catch(async l=>{if(r=["reject",l],e.error!==void 0){o=!1;const c=typeof e.error=="function"?await e.error(l):e.error,u=typeof e.description=="function"?await e.description(l):e.description,h=typeof c=="object"&&!Ui(c)?c:{message:c||"",id:n||""};this.create({id:n,type:"error",description:u,...h})}}).finally(()=>{o&&(this.dismiss(n),n=void 0),e.finally?.()}),a=()=>new Promise((l,c)=>s.then(()=>r[0]==="reject"?c(r[1]):l(r[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})};custom=(t,e)=>{const n=e?.id||wl++,i=this.toasts.find(r=>r.id===n),o=e?.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(n)&&this.dismissedToasts.delete(n),i?this.toasts=this.toasts.map(r=>r.id===n?(this.publish({...r,component:t,dismissible:o,id:n,...e}),{...r,component:t,dismissible:o,id:n,...e}):r):this.addToast({component:t,dismissible:o,id:n,...e}),n};getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id))};const jt=new E$;function x$(t,e){const n=e?.id||wl++;return jt.create({message:t,id:n,type:"default",...e}),n}const T$=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",$$=x$,k$=()=>jt.toasts,O$=()=>jt.getActiveToasts(),Tr=Object.assign($$,{success:jt.success,info:jt.info,warning:jt.warning,error:jt.error,custom:jt.custom,message:jt.message,promise:jt.promise,dismiss:jt.dismiss,loading:jt.loading},{getHistory:k$,getToasts:O$});function $r(t){return t.label!==void 0}const A$=3,Vm="24px",Bm="16px",ch=4e3,P$=356,R$=14,I$=45,Hm=200;function M$(){const t=H(!1);return zt(()=>{const e=()=>{t.value=document.hidden};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)}),{isDocumentHidden:t}}function ni(...t){return t.filter(Boolean).join(" ")}function F$(t){const[e,n]=t.split("-"),i=[];return e&&i.push(e),n&&i.push(n),i}function D$(t,e){const n={};return[t,e].forEach((i,o)=>{const r=o===1,s=r?"--mobile-offset":"--offset",a=r?Bm:Vm;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${s}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof i=="number"||typeof i=="string"?l(i):typeof i=="object"?["top","right","bottom","left"].forEach(c=>{i[c]===void 0?n[`${s}-${c}`]=a:n[`${s}-${c}`]=typeof i[c]=="number"?`${i[c]}px`:i[c]}):l(a)}),n}const L$=["data-rich-colors","data-styled","data-mounted","data-promise","data-swiped","data-removed","data-visible","data-y-position","data-x-position","data-index","data-front","data-swiping","data-dismissible","data-type","data-invert","data-swipe-out","data-swipe-direction","data-expanded","data-testid"],j$=["aria-label","data-disabled","data-close-button-position"];var z$=Ce({__name:"Toast",props:{toast:{},toasts:{},index:{},swipeDirections:{},expanded:{type:Boolean},invert:{type:Boolean},heights:{},gap:{},position:{},closeButtonPosition:{},visibleToasts:{},expandByDefault:{type:Boolean},closeButton:{type:Boolean},interacting:{type:Boolean},style:{},cancelButtonStyle:{},actionButtonStyle:{},duration:{},class:{},unstyled:{type:Boolean},descriptionClass:{},loadingIcon:{},classes:{},icons:{},closeButtonAriaLabel:{},defaultRichColors:{type:Boolean}},emits:["update:heights","update:height","removeToast"],setup(t,{emit:e}){const n=t,i=e,o=H(null),r=H(null),s=H(!1),a=H(!1),l=H(!1),c=H(!1),u=H(!1),d=H(0),h=H(0),m=H(n.toast.duration||n.duration||ch),f=H(null),p=H(null),_=te(()=>n.index===0),C=te(()=>n.index+1<=n.visibleToasts),w=te(()=>n.toast.type),S=te(()=>n.toast.dismissible!==!1),b=te(()=>n.toast.class||""),E=te(()=>n.descriptionClass||""),x=te(()=>{const R=n.toast.position||n.position,z=n.heights.filter(D=>D.position===R).findIndex(D=>D.toastId===n.toast.id);return z>=0?z:0}),O=te(()=>{const R=n.toast.position||n.position;return n.heights.filter(z=>z.position===R).reduce((z,D,B)=>B>=x.value?z:z+D.height,0)}),$=te(()=>x.value*n.gap+O.value||0),K=te(()=>n.toast.closeButton??n.closeButton),F=te(()=>n.toast.duration||n.duration||ch),P=H(0),N=H(0),M=H(null),q=te(()=>n.position.split("-")),le=te(()=>q.value[0]),de=te(()=>q.value[1]),Y=te(()=>typeof n.toast.title!="string"),I=te(()=>typeof n.toast.description!="string"),{isDocumentHidden:A}=M$(),Q=te(()=>w.value&&w.value==="loading");et(()=>{s.value=!0,m.value=F.value}),zt(async()=>{if(!s.value||!p.value)return;await Ge();const R=p.value,k=R.style.height;R.style.height="auto";const z=R.getBoundingClientRect().height;R.style.height=k,h.value=z,i("update:height",{toastId:n.toast.id,height:z,position:n.toast.position||n.position})});function U(){a.value=!0,d.value=$.value,setTimeout(()=>{i("removeToast",n.toast)},Hm)}function ie(){if(Q.value||!S.value)return{};U(),n.toast.onDismiss?.(n.toast)}function ve(R){R.button!==2&&(Q.value||!S.value||(f.value=new Date,d.value=$.value,R.target.setPointerCapture(R.pointerId),R.target.tagName!=="BUTTON"&&(l.value=!0,M.value={x:R.clientX,y:R.clientY})))}function re(){if(c.value||!S.value)return;M.value=null;const R=Number(p.value?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),k=Number(p.value?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),z=new Date().getTime()-(f.value?.getTime()||0),D=o.value==="x"?R:k,B=Math.abs(D)/z;if(Math.abs(D)>=I$||B>.11){d.value=$.value,n.toast.onDismiss?.(n.toast),o.value==="x"?r.value=R>0?"right":"left":r.value=k>0?"down":"up",U(),c.value=!0;return}else p.value?.style.setProperty("--swipe-amount-x","0px"),p.value?.style.setProperty("--swipe-amount-y","0px");u.value=!1,l.value=!1,o.value=null}function ge(R){if(!M.value||!S.value||(window?.getSelection()?.toString()?.length??!1))return;const z=R.clientY-M.value.y,D=R.clientX-M.value.x,B=n.swipeDirections??F$(n.position);!o.value&&(Math.abs(D)>1||Math.abs(z)>1)&&(o.value=Math.abs(D)>Math.abs(z)?"x":"y");let oe={x:0,y:0};const ee=G=>1/(1.5+Math.abs(G)/20);if(o.value==="y"){if(B.includes("top")||B.includes("bottom"))if(B.includes("top")&&z<0||B.includes("bottom")&&z>0)oe.y=z;else{const G=z*ee(z);oe.y=Math.abs(G)<Math.abs(z)?G:z}}else if(o.value==="x"&&(B.includes("left")||B.includes("right")))if(B.includes("left")&&D<0||B.includes("right")&&D>0)oe.x=D;else{const G=D*ee(D);oe.x=Math.abs(G)<Math.abs(D)?G:D}(Math.abs(oe.x)>0||Math.abs(oe.y)>0)&&(u.value=!0),p.value?.style.setProperty("--swipe-amount-x",`${oe.x}px`),p.value?.style.setProperty("--swipe-amount-y",`${oe.y}px`)}et(()=>{if(s.value=!0,!p.value)return;const R=p.value.getBoundingClientRect().height;h.value=R;const k=[{toastId:n.toast.id,height:R,position:n.toast.position},...n.heights];i("update:heights",k)}),bs(()=>{p.value&&i("removeToast",n.toast)}),zt(R=>{if(n.toast.promise&&w.value==="loading"||n.toast.duration===1/0||n.toast.type==="loading")return;let k;const z=()=>{if(N.value<P.value){const B=new Date().getTime()-P.value;m.value=m.value-B}N.value=new Date().getTime()},D=()=>{m.value!==1/0&&(P.value=new Date().getTime(),k=setTimeout(()=>{n.toast.onAutoClose?.(n.toast),U()},m.value))};n.expanded||n.interacting||A.value?z():D(),R(()=>{clearTimeout(k)})}),$e(()=>n.toast.delete,R=>{R!==void 0&&R&&(U(),n.toast.onDismiss?.(n.toast))},{deep:!0});function _e(){l.value=!1,o.value=null,M.value=null}return(R,k)=>(y(),T("li",{tabindex:"0",ref_key:"toastRef",ref:p,class:Ae(v(ni)(n.class,b.value,R.classes?.toast,R.toast.classes?.toast,R.classes?.[w.value],R.toast?.classes?.[w.value])),"data-sonner-toast":"","data-rich-colors":R.toast.richColors??R.defaultRichColors,"data-styled":!(R.toast.component||R.toast?.unstyled||R.unstyled),"data-mounted":s.value,"data-promise":!!R.toast.promise,"data-swiped":u.value,"data-removed":a.value,"data-visible":C.value,"data-y-position":le.value,"data-x-position":de.value,"data-index":R.index,"data-front":_.value,"data-swiping":l.value,"data-dismissible":S.value,"data-type":w.value,"data-invert":R.toast.invert||R.invert,"data-swipe-out":c.value,"data-swipe-direction":r.value,"data-expanded":!!(R.expanded||R.expandByDefault&&s.value),"data-testid":R.toast.testId,style:At({"--index":R.index,"--toasts-before":R.index,"--z-index":R.toasts.length-R.index,"--offset":`${a.value?d.value:$.value}px`,"--initial-height":R.expandByDefault?"auto":`${h.value}px`,...R.style,...n.toast.style}),onDragend:_e,onPointerdown:ve,onPointerup:re,onPointermove:ge},[K.value&&!R.toast.component&&w.value!=="loading"?(y(),T("button",{key:0,"aria-label":R.closeButtonAriaLabel||"Close toast","data-disabled":Q.value,"data-close-button":"true","data-close-button-position":R.closeButtonPosition,class:Ae(v(ni)(R.classes?.closeButton,R.toast?.classes?.closeButton)),onClick:ie},[R.icons?.close?(y(),ne($t(R.icons?.close),{key:0})):Ve(R.$slots,"close-icon",{key:1})],10,j$)):ue("v-if",!0),R.toast.component?(y(),ne($t(R.toast.component),We({key:1},R.toast.componentProps,{onCloseToast:ie,isPaused:R.$props.expanded||R.$props.interacting||v(A)}),null,16,["isPaused"])):(y(),T(Ie,{key:2},[w.value!=="default"||R.toast.icon||R.toast.promise?(y(),T("div",{key:0,"data-icon":"",class:Ae(v(ni)(R.classes?.icon,R.toast?.classes?.icon))},[R.toast.icon?(y(),ne($t(R.toast.icon),{key:0})):(y(),T(Ie,{key:1},[w.value==="loading"?Ve(R.$slots,"loading-icon",{key:0}):w.value==="success"?Ve(R.$slots,"success-icon",{key:1}):w.value==="error"?Ve(R.$slots,"error-icon",{key:2}):w.value==="warning"?Ve(R.$slots,"warning-icon",{key:3}):w.value==="info"?Ve(R.$slots,"info-icon",{key:4}):ue("v-if",!0)],64))],2)):ue("v-if",!0),g("div",{"data-content":"",class:Ae(v(ni)(R.classes?.content,R.toast?.classes?.content))},[g("div",{"data-title":"",class:Ae(v(ni)(R.classes?.title,R.toast.classes?.title))},[Y.value?(y(),ne($t(R.toast.title),wn(We({key:0},R.toast.componentProps)),null,16)):(y(),T(Ie,{key:1},[Ke(L(R.toast.title),1)],64))],2),R.toast.description?(y(),T("div",{key:0,"data-description":"",class:Ae(v(ni)(R.descriptionClass,E.value,R.classes?.description,R.toast.classes?.description))},[I.value?(y(),ne($t(R.toast.description),wn(We({key:0},R.toast.componentProps)),null,16)):(y(),T(Ie,{key:1},[Ke(L(R.toast.description),1)],64))],2)):ue("v-if",!0)],2),R.toast.cancel?(y(),T("button",{key:1,style:At(R.toast.cancelButtonStyle||R.cancelButtonStyle),class:Ae(v(ni)(R.classes?.cancelButton,R.toast.classes?.cancelButton)),"data-button":"","data-cancel":"",onClick:k[0]||(k[0]=z=>{v($r)(R.toast.cancel)&&S.value&&(R.toast.cancel.onClick?.(z),U())})},L(v($r)(R.toast.cancel)?R.toast.cancel?.label:R.toast.cancel),7)):ue("v-if",!0),R.toast.action?(y(),T("button",{key:2,style:At(R.toast.actionButtonStyle||R.actionButtonStyle),class:Ae(v(ni)(R.classes?.actionButton,R.toast.classes?.actionButton)),"data-button":"","data-action":"",onClick:k[1]||(k[1]=z=>{v($r)(R.toast.action)&&(R.toast.action.onClick?.(z),!z.defaultPrevented&&U())})},L(v($r)(R.toast.action)?R.toast.action?.label:R.toast.action),7)):ue("v-if",!0)],64))],46,L$))}}),N$=z$,or=(t,e)=>{const n=t.__vccOpts||t;for(const[i,o]of e)n[i]=o;return n};const U$={},V$={xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stoke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"};function B$(t,e){return y(),T("svg",V$,e[0]||(e[0]=[g("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1),g("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)]))}var H$=or(U$,[["render",B$]]);const q$=["data-visible"],W$={class:"sonner-spinner"};var K$=Ce({__name:"Loader",props:{visible:{type:Boolean}},setup(t){const e=Array(12).fill(0);return(n,i)=>(y(),T("div",{class:"sonner-loading-wrapper","data-visible":n.visible},[g("div",W$,[(y(!0),T(Ie,null,He(v(e),o=>(y(),T("div",{key:`spinner-bar-${o}`,class:"sonner-loading-bar"}))),128))])],8,q$))}}),Y$=K$;const G$={},Q$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function X$(t,e){return y(),T("svg",Q$,e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"},null,-1)]))}var J$=or(G$,[["render",X$]]);const Z$={},ek={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function tk(t,e){return y(),T("svg",ek,e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z","clip-rule":"evenodd"},null,-1)]))}var nk=or(Z$,[["render",tk]]);const ik={},ok={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"};function rk(t,e){return y(),T("svg",ok,e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z","clip-rule":"evenodd"},null,-1)]))}var sk=or(ik,[["render",rk]]);const ak={},lk={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function ck(t,e){return y(),T("svg",lk,e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"},null,-1)]))}var uk=or(ak,[["render",ck]]);const dk=["aria-label"],hk=["data-sonner-theme","dir","data-theme","data-rich-colors","data-y-position","data-x-position"],pk=typeof window<"u"&&typeof document<"u";function fk(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}var mk=Ce({name:"Toaster",inheritAttrs:!1,__name:"Toaster",props:{id:{},invert:{type:Boolean,default:!1},theme:{default:"light"},position:{default:"bottom-right"},closeButtonPosition:{default:"top-left"},hotkey:{default:()=>["altKey","KeyT"]},richColors:{type:Boolean,default:!1},expand:{type:Boolean,default:!1},duration:{},gap:{default:R$},visibleToasts:{default:A$},closeButton:{type:Boolean,default:!1},toastOptions:{default:()=>({})},class:{default:""},style:{},offset:{default:Vm},mobileOffset:{default:Bm},dir:{default:"auto"},swipeDirections:{},icons:{},containerAriaLabel:{default:"Notifications"}},setup(t){const e=t,n=tc(),i=H([]),o=te(()=>e.id?i.value.filter(F=>F.toasterId===e.id):i.value.filter(F=>!F.toasterId));function r(F,P){return o.value.filter(N=>!N.position&&P===0||N.position===F)}const s=te(()=>{const F=o.value.filter(P=>P.position).map(P=>P.position);return F.length>0?Array.from(new Set([e.position].concat(F))):[e.position]}),a=te(()=>{const F={};return s.value.forEach(P=>{F[P]=i.value.filter(N=>N.position===P)}),F}),l=H([]),c=H({}),u=H(!1);zt(()=>{s.value.forEach(F=>{F in c.value||(c.value[F]=!1)})});const d=H(e.theme!=="system"?e.theme:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),h=H(null),m=H(null),f=H(!1),p=e.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,"");function _(F){i.value.find(P=>P.id===F.id)?.delete||jt.dismiss(F.id),i.value=i.value.filter(({id:P})=>P!==F.id),setTimeout(()=>{i.value.find(P=>P.id===F.id)||(l.value=l.value.filter(P=>P.toastId!==F.id))},Hm+50)}function C(F){f.value&&!F.currentTarget?.contains?.(F.relatedTarget)&&(f.value=!1,m.value&&(m.value.focus({preventScroll:!0}),m.value=null))}function w(F){F.target instanceof HTMLElement&&F.target.dataset.dismissible==="false"||f.value||(f.value=!0,m.value=F.relatedTarget)}function S(F){F.target&&F.target instanceof HTMLElement&&F.target.dataset.dismissible==="false"||(u.value=!0)}zt(F=>{const P=jt.subscribe(N=>{if(N.dismiss){requestAnimationFrame(()=>{i.value=i.value.map(M=>M.id===N.id?{...M,delete:!0}:M)});return}Ge(()=>{const M=i.value.findIndex(q=>q.id===N.id);M!==-1?i.value=[...i.value.slice(0,M),{...i.value[M],...N},...i.value.slice(M+1)]:i.value=[N,...i.value]})});F(P)}),zt(F=>{if(typeof window>"u")return;if(e.theme!=="system"){d.value=e.theme;return}const P=window.matchMedia("(prefers-color-scheme: dark)"),N=q=>{d.value=q?"dark":"light"};N(P.matches);const M=q=>{N(q.matches)};try{P.addEventListener("change",M)}catch{P.addListener(M)}F(()=>{try{P.removeEventListener("change",M)}catch{P.removeListener(M)}})}),zt(()=>{h.value&&m.value&&(m.value.focus({preventScroll:!0}),m.value=null,f.value=!1)}),zt(()=>{i.value.length<=1&&Object.keys(c.value).forEach(F=>{c.value[F]=!1})}),zt(F=>{function P(N){const M=e.hotkey.every(de=>N[de]||N.code===de),q=Array.isArray(h.value)?h.value[0]:h.value;M&&(s.value.forEach(de=>{c.value[de]=!0}),q?.focus());const le=document.activeElement===h.value||q?.contains(document.activeElement);N.code==="Escape"&&le&&s.value.forEach(de=>{c.value[de]=!1})}pk&&(document.addEventListener("keydown",P),F(()=>{document.removeEventListener("keydown",P)}))});function b(F){const P=F.currentTarget,N=P.getAttribute("data-y-position")+"-"+P.getAttribute("data-x-position");c.value[N]=!0}function E(F){if(!u.value){const P=F.currentTarget,N=P.getAttribute("data-y-position")+"-"+P.getAttribute("data-x-position");c.value[N]=!1}}function x(){Object.keys(c.value).forEach(F=>{c.value[F]=!1})}function O(){u.value=!1}function $(F){l.value=F}function K(F){const P=l.value.findIndex(N=>N.toastId===F.toastId);if(P!==-1)l.value[P]=F;else{const N=l.value.findIndex(M=>M.position===F.position);N!==-1?l.value.splice(N,0,F):l.value.unshift(F)}}return(F,P)=>(y(),T(Ie,null,[ue(" Remove item from normal navigation flow, only available via hotkey "),g("section",{"aria-label":`${F.containerAriaLabel} ${v(p)}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false"},[(y(!0),T(Ie,null,He(s.value,(N,M)=>(y(),T("ol",We({key:N,ref_for:!0,ref_key:"listRef",ref:h,"data-sonner-toaster":"","data-sonner-theme":d.value,class:e.class,dir:F.dir==="auto"?fk():F.dir,tabIndex:-1,"data-theme":F.theme,"data-rich-colors":F.richColors,"data-y-position":N.split("-")[0],"data-x-position":N.split("-")[1],style:{"--front-toast-height":`${l.value[0]?.height||0}px`,"--width":`${v(P$)}px`,"--gap":`${F.gap}px`,...F.style,...v(n).style,...v(D$)(F.offset,F.mobileOffset)}},{ref_for:!0},F.$attrs,{onBlur:C,onFocus:w,onMouseenter:b,onMousemove:b,onMouseleave:E,onDragend:x,onPointerdown:S,onPointerup:O}),[(y(!0),T(Ie,null,He(r(N,M),(q,le)=>(y(),ne(N$,{key:q.id,heights:l.value,icons:F.icons,index:le,toast:q,defaultRichColors:F.richColors,duration:F.toastOptions?.duration??F.duration,class:Ae(F.toastOptions?.class??""),descriptionClass:F.toastOptions?.descriptionClass,invert:F.invert,visibleToasts:F.visibleToasts,closeButton:F.toastOptions?.closeButton??F.closeButton,interacting:u.value,position:N,closeButtonPosition:F.toastOptions?.closeButtonPosition??F.closeButtonPosition,style:At(F.toastOptions?.style),unstyled:F.toastOptions?.unstyled,classes:F.toastOptions?.classes,cancelButtonStyle:F.toastOptions?.cancelButtonStyle,actionButtonStyle:F.toastOptions?.actionButtonStyle,"close-button-aria-label":F.toastOptions?.closeButtonAriaLabel,toasts:a.value[N],expandByDefault:F.expand,gap:F.gap,expanded:c.value[N]||!1,swipeDirections:e.swipeDirections,"onUpdate:heights":$,"onUpdate:height":K,onRemoveToast:_},{"close-icon":we(()=>[Ve(F.$slots,"close-icon",{},()=>[j(H$)])]),"loading-icon":we(()=>[Ve(F.$slots,"loading-icon",{},()=>[j(Y$,{visible:q.type==="loading"},null,8,["visible"])])]),"success-icon":we(()=>[Ve(F.$slots,"success-icon",{},()=>[j(J$)])]),"error-icon":we(()=>[Ve(F.$slots,"error-icon",{},()=>[j(uk)])]),"warning-icon":we(()=>[Ve(F.$slots,"warning-icon",{},()=>[j(sk)])]),"info-icon":we(()=>[Ve(F.$slots,"info-icon",{},()=>[j(nk)])]),_:2},1032,["heights","icons","index","toast","defaultRichColors","duration","class","descriptionClass","invert","visibleToasts","closeButton","interacting","position","closeButtonPosition","style","unstyled","classes","cancelButtonStyle","actionButtonStyle","close-button-aria-label","toasts","expandByDefault","gap","expanded","swipeDirections"]))),128))],16,hk))),128))],8,dk)],2112))}}),vk=mk,Is=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},gk=class extends Is{#e;#t;#n;constructor(){super(),this.#n=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},qm=new gk,_k={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},yk=class{#e=_k;#t=!1;setTimeoutProvider(t){this.#e=t}setTimeout(t,e){return this.#e.setTimeout(t,e)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,e){return this.#e.setInterval(t,e)}clearInterval(t){this.#e.clearInterval(t)}},Sl=new yk;function bk(t){setTimeout(t,0)}var wk=typeof window>"u"||"Deno"in globalThis;function gn(){}function Sk(t,e){return typeof t=="function"?t(e):t}function Ck(t){return typeof t=="number"&&t>=0&&t!==1/0}function Ek(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Cl(t,e){return typeof t=="function"?t(e):t}function xk(t,e){return typeof t=="function"?t(e):t}function uh(t,e){const{type:n="all",exact:i,fetchStatus:o,predicate:r,queryKey:s,stale:a}=t;if(s){if(i){if(e.queryHash!==kc(s,e.options))return!1}else if(!zo(e.queryKey,s))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||o&&o!==e.state.fetchStatus||r&&!r(e))}function dh(t,e){const{exact:n,status:i,predicate:o,mutationKey:r}=t;if(r){if(!e.options.mutationKey)return!1;if(n){if(jo(e.options.mutationKey)!==jo(r))return!1}else if(!zo(e.options.mutationKey,r))return!1}return!(i&&e.state.status!==i||o&&!o(e))}function kc(t,e){return(e?.queryKeyHashFn||jo)(t)}function jo(t){return JSON.stringify(t,(e,n)=>El(n)?Object.keys(n).sort().reduce((i,o)=>(i[o]=n[o],i),{}):n)}function zo(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>zo(t[n],e[n])):!1}var Tk=Object.prototype.hasOwnProperty;function Wm(t,e,n=0){if(t===e)return t;if(n>500)return e;const i=hh(t)&&hh(e);if(!i&&!(El(t)&&El(e)))return e;const r=(i?t:Object.keys(t)).length,s=i?e:Object.keys(e),a=s.length,l=i?new Array(a):{};let c=0;for(let u=0;u<a;u++){const d=i?u:s[u],h=t[d],m=e[d];if(h===m){l[d]=h,(i?u<r:Tk.call(t,d))&&c++;continue}if(h===null||m===null||typeof h!="object"||typeof m!="object"){l[d]=m;continue}const f=Wm(h,m,n+1);l[d]=f,f===h&&c++}return r===a&&c===r?t:l}function hh(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function El(t){if(!ph(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!ph(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function ph(t){return Object.prototype.toString.call(t)==="[object Object]"}function $k(t){return new Promise(e=>{Sl.setTimeout(e,t)})}function kk(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?Wm(t,e):e}function Ok(t,e,n=0){const i=[...t,e];return n&&i.length>n?i.slice(1):i}function Ak(t,e,n=0){const i=[e,...t];return n&&i.length>n?i.slice(0,-1):i}var Oc=Symbol();function Km(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===Oc?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Pk(t,e,n){let i=!1,o;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(o??=e(),i||(i=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),t}var Ym=(()=>{let t=()=>wk;return{isServer(){return t()},setIsServer(e){t=e}}})();function Rk(){let t,e;const n=new Promise((o,r)=>{t=o,e=r});n.status="pending",n.catch(()=>{});function i(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{i({status:"fulfilled",value:o}),t(o)},n.reject=o=>{i({status:"rejected",reason:o}),e(o)},n}var Ik=bk;function Mk(){let t=[],e=0,n=a=>{a()},i=a=>{a()},o=Ik;const r=a=>{e?t.push(a):o(()=>{n(a)})},s=()=>{const a=t;t=[],a.length&&o(()=>{i(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||s()}return l},batchCalls:a=>(...l)=>{r(()=>{a(...l)})},schedule:r,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{i=a},setScheduler:a=>{o=a}}}var Rt=Mk(),Fk=class extends Is{#e=!0;#t;#n;constructor(){super(),this.#n=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(n=>{n(t)}))}isOnline(){return this.#e}},ls=new Fk;function Dk(t){return Math.min(1e3*2**t,3e4)}function Gm(t){return(t??"online")==="online"?ls.isOnline():!0}var xl=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function Qm(t){let e=!1,n=0,i;const o=Rk(),r=()=>o.status!=="pending",s=p=>{if(!r()){const _=new xl(p);h(_),t.onCancel?.(_)}},a=()=>{e=!0},l=()=>{e=!1},c=()=>qm.isFocused()&&(t.networkMode==="always"||ls.isOnline())&&t.canRun(),u=()=>Gm(t.networkMode)&&t.canRun(),d=p=>{r()||(i?.(),o.resolve(p))},h=p=>{r()||(i?.(),o.reject(p))},m=()=>new Promise(p=>{i=_=>{(r()||c())&&p(_)},t.onPause?.()}).then(()=>{i=void 0,r()||t.onContinue?.()}),f=()=>{if(r())return;let p;const _=n===0?t.initialPromise:void 0;try{p=_??t.fn()}catch(C){p=Promise.reject(C)}Promise.resolve(p).then(d).catch(C=>{if(r())return;const w=t.retry??(Ym.isServer()?0:3),S=t.retryDelay??Dk,b=typeof S=="function"?S(n,C):S,E=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,C);if(e||!E){h(C);return}n++,t.onFail?.(n,C),$k(b).then(()=>c()?void 0:m()).then(()=>{e?h(C):f()})})};return{promise:o,status:()=>o.status,cancel:s,continue:()=>(i?.(),o),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?f():m().then(f),o)}}var Xm=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ck(this.gcTime)&&(this.#e=Sl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Ym.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Sl.clearTimeout(this.#e),this.#e=void 0)}};function Lk(t){return{onFetch:(e,n)=>{const i=e.options,o=e.fetchOptions?.meta?.fetchMore?.direction,r=e.state.data?.pages||[],s=e.state.data?.pageParams||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let u=!1;const d=f=>{Pk(f,()=>e.signal,()=>u=!0)},h=Km(e.options,e.fetchOptions),m=async(f,p,_)=>{if(u)return Promise.reject(e.signal.reason);if(p==null&&f.pages.length)return Promise.resolve(f);const w=(()=>{const x={client:e.client,queryKey:e.queryKey,pageParam:p,direction:_?"backward":"forward",meta:e.options.meta};return d(x),x})(),S=await h(w),{maxPages:b}=e.options,E=_?Ak:Ok;return{pages:E(f.pages,S,b),pageParams:E(f.pageParams,p,b)}};if(o&&r.length){const f=o==="backward",p=f?jk:fh,_={pages:r,pageParams:s},C=p(i,_);a=await m(_,C,f)}else{const f=t??r.length;do{const p=l===0?s[0]??i.initialPageParam:fh(i,a);if(l>0&&p==null)break;a=await m(a,p),l++}while(l<f)}return a};e.options.persister?e.fetchFn=()=>e.options.persister?.(c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n):e.fetchFn=c}}}function fh(t,{pages:e,pageParams:n}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,n[i],n):void 0}function jk(t,{pages:e,pageParams:n}){return e.length>0?t.getPreviousPageParam?.(e[0],e,n[0],n):void 0}var zk=class extends Xm{#e;#t;#n;#i;#r;#o;#a;#s;constructor(t){super(),this.#s=!1,this.#a=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#r=t.client,this.#i=this.#r.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#t=vh(this.options),this.state=t.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#o?.promise}setOptions(t){if(this.options={...this.#a,...t},t?._type&&(this.#e=t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=vh(this.options);e.data!==void 0&&(this.setState(mh(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#i.remove(this)}setData(t,e){const n=kk(this.state.data,t,this.options);return this.#l({data:n,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),n}setState(t){this.#l({type:"setState",state:t})}cancel(t){const e=this.#o?.promise;return this.#o?.cancel(t),e?e.then(gn).catch(gn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>xk(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Oc||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Cl(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ek(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#o?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#o?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#o&&(this.#s||this.#u()?this.#o.cancel({revert:!0}):this.#o.cancelRetry()),this.scheduleGc()),this.#i.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#o?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#o)return this.#o.continueRetry(),this.#o.promise}if(t&&this.setOptions(t),!this.options.queryFn){const l=this.observers.find(c=>c.options.queryFn);l&&this.setOptions(l.options)}const n=new AbortController,i=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},o=()=>{const l=Km(this.options,e),u=(()=>{const d={client:this.#r,queryKey:this.queryKey,meta:this.meta};return i(d),d})();return this.#s=!1,this.options.persister?this.options.persister(l,u,this):l(u)},s=(()=>{const l={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:o};return i(l),l})();(this.#e==="infinite"?Lk(this.options.pages):this.options.behavior)?.onFetch(s,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==s.fetchOptions?.meta)&&this.#l({type:"fetch",meta:s.fetchOptions?.meta}),this.#o=Qm({initialPromise:e?.initialPromise,fn:s.fetchFn,onCancel:l=>{l instanceof xl&&l.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(l,c)=>{this.#l({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0});try{const l=await this.#o.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#i.config.onSuccess?.(l,this),this.#i.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof xl){if(l.silent)return this.#o.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#l({type:"error",error:l}),this.#i.config.onError?.(l,this),this.#i.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#l(t){const e=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Nk(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,...mh(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=t.manual?i:void 0,i;case"error":const o=t.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=e(this.state),Rt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#i.notify({query:this,type:"updated",action:t})})}};function Nk(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Gm(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function mh(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function vh(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,i=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Uk=class extends Xm{#e;#t;#n;#i;constructor(t){super(),this.#e=t.client,this.mutationId=t.mutationId,this.#n=t.mutationCache,this.#t=[],this.state=t.state||Vk(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(e=>e!==t),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=Qm({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(r,s)=>{this.#r({type:"failed",failureCount:r,error:s})},onPause:()=>{this.#r({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const i=this.state.status==="pending",o=!this.#i.canStart();try{if(i)e();else{this.#r({type:"pending",variables:t,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(t,this,n);const s=await this.options.onMutate?.(t,n);s!==this.state.context&&this.#r({type:"pending",context:s,variables:t,isPaused:o})}const r=await this.#i.start();return await this.#n.config.onSuccess?.(r,t,this.state.context,this,n),await this.options.onSuccess?.(r,t,this.state.context,n),await this.#n.config.onSettled?.(r,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(r,null,t,this.state.context,n),this.#r({type:"success",data:r}),r}catch(r){try{await this.#n.config.onError?.(r,t,this.state.context,this,n)}catch(s){Promise.reject(s)}try{await this.options.onError?.(r,t,this.state.context,n)}catch(s){Promise.reject(s)}try{await this.#n.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,n)}catch(s){Promise.reject(s)}try{await this.options.onSettled?.(void 0,r,t,this.state.context,n)}catch(s){Promise.reject(s)}throw this.#r({type:"error",error:r}),r}finally{this.#n.runNext(this)}}#r(t){const e=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),Rt.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:"updated",action:t})})}};function Vk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Jm=class extends Is{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,n,i){const o=new Uk({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(n),state:i});return this.add(o),o}add(e){this.#e.add(e);const n=kr(e);if(typeof n=="string"){const i=this.#t.get(n);i?i.push(e):this.#t.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const n=kr(e);if(typeof n=="string"){const i=this.#t.get(n);if(i)if(i.length>1){const o=i.indexOf(e);o!==-1&&i.splice(o,1)}else i[0]===e&&this.#t.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=kr(e);if(typeof n=="string"){const o=this.#t.get(n)?.find(r=>r.state.status==="pending");return!o||o===e}else return!0}runNext(e){const n=kr(e);return typeof n=="string"?this.#t.get(n)?.find(o=>o!==e&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Rt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const n={exact:!0,...e};return this.getAll().find(i=>dh(n,i))}findAll(e={}){return this.getAll().filter(n=>dh(e,n))}notify(e){Rt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Rt.batch(()=>Promise.all(e.map(n=>n.continue().catch(gn))))}};function kr(t){return t.options.scope?.id}var Zm=class extends Is{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,i){const o=n.queryKey,r=n.queryHash??kc(o,n);let s=this.get(r);return s||(s=new zk({client:e,queryKey:o,queryHash:r,options:e.defaultQueryOptions(n),state:i,defaultOptions:e.getQueryDefaults(o)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#e.get(e.queryHash);n&&(e.destroy(),n===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Rt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(i=>uh(n,i))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(i=>uh(e,i)):n}notify(e){Rt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Rt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Rt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Bk=class{#e;#t;#n;#i;#r;#o;#a;#s;constructor(e={}){this.#e=e.queryCache||new Zm,this.#t=e.mutationCache||new Jm,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=qm.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ls.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#a?.(),this.#a=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),i=this.#e.build(this,n),o=i.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(Cl(n.staleTime,i))&&this.prefetchQuery(n),Promise.resolve(o))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:n,state:i})=>{const o=i.data;return[n,o]})}setQueryData(e,n,i){const o=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(o.queryHash)?.state.data,a=Sk(n,s);if(a!==void 0)return this.#e.build(this,o).setData(a,{...i,manual:!0})}setQueriesData(e,n,i){return Rt.batch(()=>this.#e.findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,n,i)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state}removeQueries(e){const n=this.#e;Rt.batch(()=>{n.findAll(e).forEach(i=>{n.remove(i)})})}resetQueries(e,n){const i=this.#e;return Rt.batch(()=>(i.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const i={revert:!0,...n},o=Rt.batch(()=>this.#e.findAll(e).map(r=>r.cancel(i)));return Promise.all(o).then(gn).catch(gn)}invalidateQueries(e,n={}){return Rt.batch(()=>(this.#e.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const i={...n,cancelRefetch:n.cancelRefetch??!0},o=Rt.batch(()=>this.#e.findAll(e).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let s=r.fetch(void 0,i);return i.throwOnError||(s=s.catch(gn)),r.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(o).then(gn)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const i=this.#e.build(this,n);return i.isStaleByTime(Cl(n.staleTime,i))?i.fetch(n):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(gn).catch(gn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(gn).catch(gn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return ls.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,n){this.#i.set(jo(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#i.values()],i={};return n.forEach(o=>{zo(e,o.queryKey)&&Object.assign(i,o.defaultOptions)}),i}setMutationDefaults(e,n){this.#r.set(jo(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#r.values()],i={};return n.forEach(o=>{zo(e,o.mutationKey)&&Object.assign(i,o.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=kc(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===Oc&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function Tl(t,e,n="",i=0){if(e){const o=e(t,n,i);if(o===void 0&&ys(t)||o!==void 0)return o}if(Array.isArray(t))return t.map((o,r)=>Tl(o,e,String(r),i+1));if(typeof t=="object"&&qk(t)){const o=Object.entries(t).map(([r,s])=>[r,Tl(s,e,r,i+1)]);return Object.fromEntries(o)}return t}function Hk(t,e){return Tl(t,e)}function qe(t,e=!1){return Hk(t,(n,i,o)=>{if(o===1&&i==="queryKey")return qe(n,!0);if(e&&Wk(n))return qe(n(),e);if(ys(n))return qe(v(n),e)})}function qk(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function Wk(t){return typeof t=="function"}var Kk=class extends Zm{find(t){return super.find(qe(t))}findAll(t={}){return super.findAll(qe(t))}},Yk=class extends Jm{find(t){return super.find(qe(t))}findAll(t={}){return super.findAll(qe(t))}},Gk=class extends Bk{constructor(t={}){const e={defaultOptions:t.defaultOptions,queryCache:t.queryCache||new Kk,mutationCache:t.mutationCache||new Yk};super(e),this.isRestoring=H(!1)}isFetching(t={}){return super.isFetching(qe(t))}isMutating(t={}){return super.isMutating(qe(t))}getQueryData(t){return super.getQueryData(qe(t))}ensureQueryData(t){return super.ensureQueryData(qe(t))}getQueriesData(t){return super.getQueriesData(qe(t))}setQueryData(t,e,n={}){return super.setQueryData(qe(t),e,qe(n))}setQueriesData(t,e,n={}){return super.setQueriesData(qe(t),e,qe(n))}getQueryState(t){return super.getQueryState(qe(t))}removeQueries(t={}){return super.removeQueries(qe(t))}resetQueries(t={},e={}){return super.resetQueries(qe(t),qe(e))}cancelQueries(t={},e={}){return super.cancelQueries(qe(t),qe(e))}invalidateQueries(t={},e={}){const n=qe(t),i=qe(e);if(super.invalidateQueries({...n,refetchType:"none"},i),n.refetchType==="none")return Promise.resolve();const o={...n,type:n.refetchType??n.type??"active"};return Ge().then(()=>super.refetchQueries(o,i))}refetchQueries(t={},e={}){return super.refetchQueries(qe(t),qe(e))}fetchQuery(t){return super.fetchQuery(qe(t))}prefetchQuery(t){return super.prefetchQuery(qe(t))}fetchInfiniteQuery(t){return super.fetchInfiniteQuery(qe(t))}prefetchInfiniteQuery(t){return super.prefetchInfiniteQuery(qe(t))}setDefaultOptions(t){super.setDefaultOptions(qe(t))}setQueryDefaults(t,e){super.setQueryDefaults(qe(t),qe(e))}getQueryDefaults(t){return super.getQueryDefaults(qe(t))}setMutationDefaults(t,e){super.setMutationDefaults(qe(t),qe(e))}getMutationDefaults(t){return super.getMutationDefaults(qe(t))}};class $l extends Error{cause;isNetworkError;request;constructor(e,n=null){super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=n}}class Qk{#e;#t=!1;#n;#i;constructor(e,n){this.#i=e,this.#n=()=>n(e)}progress(){this.#t||this.#i>0&&(clearTimeout(this.#e),this.#e=setTimeout(this.#n,this.#i))}done(){this.#t||(clearTimeout(this.#e),this.#e=void 0,this.#t=!0)}}const Or=()=>{};function Xk(t,e={}){const{body:n=null,headers:i={},method:o="GET",onBeforeRequest:r=Or,onUploadProgress:s=Or,shouldRetry:a=()=>!0,onAfterResponse:l=Or,onTimeout:c=Or,responseType:u,retries:d=3,signal:h=null,timeout:m=3e4,withCredentials:f=!1}=e,p=w=>.3*2**(w-1)*1e3,_=new Qk(m,c);function C(w=0){return new Promise(async(S,b)=>{const E=new XMLHttpRequest,x=$=>{a(E)&&w<d?setTimeout(()=>{C(w+1).then(S,b)},p(w)):(_.done(),b($))};E.open(o,t,!0),E.withCredentials=f,u&&(E.responseType=u),E.onload=async()=>{try{await l(E,w)}catch($){$.request=E,x($);return}E.status>=200&&E.status<300?(_.done(),S(E)):a(E)&&w<d?setTimeout(()=>{C(w+1).then(S,b)},p(w)):(_.done(),b(new $l(E.statusText,E)))},E.onerror=()=>x(new $l(E.statusText,E)),E.upload.onprogress=$=>{_.progress(),s($)},i&&Object.keys(i).forEach($=>{E.setRequestHeader($,i[$])});function O(){E.abort(),b(new DOMException("Aborted","AbortError"))}if(h?.addEventListener("abort",O),h?.aborted){O();return}await r(E,w),E.send(n)})}return C()}const Jk=t=>"error"in t&&!!t.error,Zk=t=>t.progress.uploadComplete;function eO(t){return t.filter(e=>!Jk(e)&&!Zk(e))}function tO(t){return t.filter(e=>!e.progress?.uploadStarted||!e.isRestored)}function ev(t){const e=t.lastIndexOf(".");return e===-1||e===t.length-1?{name:t,extension:void 0}:{name:t.slice(0,e),extension:t.slice(e+1)}}const gh={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",msg:"application/vnd.ms-outlook",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function tv(t){if(t.type)return t.type;const e=t.name?ev(t.name).extension?.toLowerCase():null;return e&&e in gh?gh[e]:"application/octet-stream"}function nO(t){return t.charCodeAt(0).toString(32)}function _h(t){let e="";return t.replace(/[^A-Z0-9]/gi,n=>(e+=`-${nO(n)}`,"/"))+e}function iO(t,e){let n=e||"uppy";return typeof t.name=="string"&&(n+=`-${_h(t.name.toLowerCase())}`),t.type!==void 0&&(n+=`-${t.type}`),t.meta&&typeof t.meta.relativePath=="string"&&(n+=`-${_h(t.meta.relativePath.toLowerCase())}`),t.data?.size!==void 0&&(n+=`-${t.data.size}`),t.data.lastModified!==void 0&&(n+=`-${t.data.lastModified}`),n}function oO(t){return!t.isRemote||!t.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(t.remote.provider)}function rO(t,e){if(oO(t))return t.id;const n=tv(t);return iO({...t,type:n},e)}function yh(t,e){return t===!0?Object.keys(e):Array.isArray(t)?t:[]}function ga(t){return t<10?`0${t}`:t.toString()}function Qr(){const t=new Date,e=ga(t.getHours()),n=ga(t.getMinutes()),i=ga(t.getSeconds());return`${e}:${n}:${i}`}function sO(t){return t?t.readyState===4&&t.status===0:!1}class aO{#e=[];#t=0;#n;#i=!1;constructor(e){const n=e?.concurrency;this.#n=typeof n!="number"||n===0?1/0:n}add(e){const n=new AbortController;let i,o;const r=new Promise((a,l)=>{i=a,o=l}),s={run:()=>e(n.signal),resolve:i,reject:o,controller:n};return n.signal.addEventListener("abort",()=>{const a=this.#e.indexOf(s);a!==-1&&(this.#e.splice(a,1),o(n.signal.reason??new DOMException("Aborted","AbortError")))},{once:!0}),r.abort=a=>{n.abort(a??new DOMException("Aborted","AbortError"))},r.abortOn=a=>{if(a){const l=()=>r.abort(a.reason);a.addEventListener("abort",l,{once:!0}),r.then(()=>a.removeEventListener("abort",l),()=>a.removeEventListener("abort",l))}return r},!this.#i&&this.#t<this.#n?this.#r(s):this.#e.push(s),r}#r(e){if(this.#t++,e.controller.signal.aborted){this.#t--,e.reject(e.controller.signal.reason??new DOMException("Aborted","AbortError")),this.#o();return}let n;try{n=e.run()}catch(i){n=Promise.reject(i)}n.then(i=>{e.controller.signal.aborted?e.reject(e.controller.signal.reason??new DOMException("Aborted","AbortError")):e.resolve(i)},i=>{e.reject(i)}).finally(()=>{this.#t--,this.#o()})}#o(){queueMicrotask(()=>{if(!(this.#i||this.#t>=this.#n))for(;this.#e.length>0;){const e=this.#e.shift();if(!e.controller.signal.aborted){this.#r(e);return}}})}pause(){this.#i=!0}resume(){this.#i=!1;const e=this.#n-this.#t;for(let n=0;n<e;n++)this.#o()}clear(e){const n=this.#e.splice(0),i=e??new DOMException("Cleared","AbortError");for(const o of n)o.controller.abort(i),o.reject(i)}get concurrency(){return this.#n}set concurrency(e){if(this.#n=typeof e!="number"||e===0?1/0:e,!this.#i){const n=this.#n-this.#t;for(let i=0;i<n;i++)this.#o()}}get pending(){return this.#e.length}get running(){return this.#t}get isPaused(){return this.#i}wrapPromiseFunction(e){return(...n)=>this.add(i=>e(...n))}}function lO(t,e,n){const i=[];return t.forEach(o=>typeof o!="string"?i.push(o):e[Symbol.split](o).forEach((r,s,a)=>{r!==""&&i.push(r),s<a.length-1&&i.push(n)})),i}function bh(t,e){const n=/\$/g,i="$$$$";let o=[t];if(e==null)return o;for(const r of Object.keys(e))if(r!=="_"){let s=e[r];typeof s=="string"&&(s=n[Symbol.replace](s,i)),o=lO(o,new RegExp(`%\\{${r}\\}`,"g"),s)}return o}const cO=t=>{throw new Error(`missing string: ${t}`)};class nv{locale;constructor(e,{onMissingKey:n=cO}={}){this.locale={strings:{},pluralize(i){return i===1?0:1}},Array.isArray(e)?e.forEach(this.#t,this):this.#t(e),this.#e=n}#e;#t(e){if(!e?.strings)return;const n=this.locale;Object.assign(this.locale,{strings:{...n.strings,...e.strings},pluralize:e.pluralize||n.pluralize})}translate(e,n){return this.translateArray(e,n).join("")}translateArray(e,n){let i=this.locale.strings[e];if(i==null&&(this.#e(e),i=e),typeof i=="object"){if(n&&typeof n.smart_count<"u"){const r=this.locale.pluralize(n.smart_count);return bh(i[r],n)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof i!="string")throw new Error("string was not a string");return bh(i,n)}}class uO{uppy;opts;id;defaultLocale;i18n;i18nArray;type;VERSION;constructor(e,n){this.uppy=e,this.opts=n??{}}getPluginState(){const{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){const{plugins:n}=this.uppy.getState();this.uppy.setState({plugins:{...n,[this.id]:{...n[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){const e=new nv([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}}class dO{#e;#t=[];constructor(e){this.#e=e}on(e,n){return this.#t.push([e,n]),this.#e.on(e,n)}remove(){for(const[e,n]of this.#t.splice(0))this.#e.off(e,n)}onFilePause(e,n){this.on("upload-pause",(i,o)=>{e===i?.id&&n(o)})}onFileRemove(e,n){this.on("file-removed",i=>{e===i.id&&n(i.id)})}onPause(e,n){this.on("upload-pause",(i,o)=>{e===i?.id&&n(o)})}onRetry(e,n){this.on("upload-retry",i=>{e===i?.id&&n()})}onRetryAll(e,n){this.on("retry-all",()=>{this.#e.getFile(e)&&n()})}onPauseAll(e,n){this.on("pause-all",()=>{this.#e.getFile(e)&&n()})}onCancelAll(e,n){this.on("cancel-all",(...i)=>{this.#e.getFile(e)&&n(...i)})}onResumeAll(e,n){this.on("resume-all",()=>{this.#e.getFile(e)&&n()})}}const hO={debug:()=>{},warn:()=>{},error:(...t)=>console.error(`[Uppy] [${Qr()}]`,...t)},pO={debug:(...t)=>console.debug(`[Uppy] [${Qr()}]`,...t),warn:(...t)=>console.warn(`[Uppy] [${Qr()}]`,...t),error:(...t)=>console.error(`[Uppy] [${Qr()}]`,...t)};var _a,wh;function fO(){return wh||(wh=1,_a=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);const n=e<0;let i=Math.abs(e);if(n&&(i=-i),i===0)return"0 B";const o=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.min(Math.floor(Math.log(i)/Math.log(1024)),o.length-1),s=Number(i/1024**r),a=o[r];return`${s>=10||s%1===0?Math.round(s):s.toFixed(1)} ${a}`}),_a}var mO=fO();const Ar=Di(mO);var ya,Sh;function vO(){if(Sh)return ya;Sh=1;function t(e,n){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=n,this.parts=e.split(n)}return t.prototype.match=function(e){var n=!0,i=this.parts,o,r=i.length,s;if(typeof e=="string"||e instanceof String)if(!this.hasWild&&this.text!=e)n=!1;else{for(s=(e||"").split(this.separator),o=0;n&&o<r;o++)i[o]!=="*"&&(o<s.length?n=i[o]===s[o]:n=!1);n=n&&s}else if(typeof e.splice=="function")for(n=[],o=e.length;o--;)this.match(e[o])&&(n[n.length]=e[o]);else if(typeof e=="object"){n={};for(var a in e)this.match(a)&&(n[a]=e[a])}return n},ya=function(e,n,i){var o=new t(e,i||/[\/\.]/);return typeof n<"u"?o.match(n):o},ya}var ba,Ch;function gO(){if(Ch)return ba;Ch=1;var t=vO(),e=/[\/\+\.]/;return ba=function(n,i){function o(r){var s=t(r,n,e);return s&&s.length>=2}return i?o(i.split(";")[0]):o},ba}var _O=gO();const yO=Di(_O),bO={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class _n extends Error{isUserFacing;file;constructor(e,n){super(e),this.isUserFacing=n?.isUserFacing??!0,n?.file&&(this.file=n.file)}isRestriction=!0}class wO{getI18n;getOpts;constructor(e,n){this.getI18n=n,this.getOpts=()=>{const i=e();if(i.restrictions?.allowedFileTypes!=null&&!Array.isArray(i.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return i}}validateAggregateRestrictions(e,n){const{maxTotalFileSize:i,maxNumberOfFiles:o}=this.getOpts().restrictions;if(o&&e.filter(s=>!s.isGhost).length+n.length>o)throw new _n(`${this.getI18n()("youCanOnlyUploadX",{smart_count:o})}`);if(i){const r=[...e,...n].reduce((s,a)=>s+(a.size??0),0);if(r>i)throw new _n(this.getI18n()("aggregateExceedsSize",{sizeAllowed:Ar(i),size:Ar(r)}))}}validateSingleFile(e){const{maxFileSize:n,minFileSize:i,allowedFileTypes:o}=this.getOpts().restrictions;if(o&&!o.some(s=>s.includes("/")?e.type?yO(e.type.replace(/;.*?$/,""),s):!1:s[0]==="."&&e.extension?e.extension.toLowerCase()===s.slice(1).toLowerCase():!1)){const s=o.join(", ");throw new _n(this.getI18n()("youCanOnlyUploadFileTypes",{types:s}),{file:e})}if(n&&e.size!=null&&e.size>n)throw new _n(this.getI18n()("exceedsSize",{size:Ar(n),file:e.name??this.getI18n()("unnamed")}),{file:e});if(i&&e.size!=null&&e.size<i)throw new _n(this.getI18n()("inferiorSize",{size:Ar(i)}),{file:e})}validate(e,n){n.forEach(i=>{this.validateSingleFile(i)}),this.validateAggregateRestrictions(e,n)}validateMinNumberOfFiles(e){const{minNumberOfFiles:n}=this.getOpts().restrictions;if(n&&Object.keys(e).length<n)throw new _n(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:n}))}getMissingRequiredMetaFields(e){const n=new _n(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name??this.getI18n()("unnamed")})),{requiredMetaFields:i}=this.getOpts().restrictions,o=[];for(const r of i)(!Object.hasOwn(e.meta,r)||e.meta[r]==="")&&o.push(r);return{missingFields:o,error:n}}}const SO="5.0.0",CO={version:SO};class EO{static VERSION=CO.version;state={};#e=new Set;getState(){return this.state}setState(e){const n={...this.state},i={...this.state,...e};this.state=i,this.#t(n,i,e)}subscribe(e){return this.#e.add(e),()=>{this.#e.delete(e)}}#t(...e){this.#e.forEach(n=>{n(...e)})}}var wa,Eh;function Ac(){if(Eh)return wa;Eh=1;function t(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}return wa=t,wa}var Sa,xh;function xO(){if(xh)return Sa;xh=1;var t=typeof vr=="object"&&vr&&vr.Object===Object&&vr;return Sa=t,Sa}var Ca,Th;function iv(){if(Th)return Ca;Th=1;var t=xO(),e=typeof self=="object"&&self&&self.Object===Object&&self,n=t||e||Function("return this")();return Ca=n,Ca}var Ea,$h;function TO(){if($h)return Ea;$h=1;var t=iv(),e=function(){return t.Date.now()};return Ea=e,Ea}var xa,kh;function $O(){if(kh)return xa;kh=1;var t=/\s/;function e(n){for(var i=n.length;i--&&t.test(n.charAt(i)););return i}return xa=e,xa}var Ta,Oh;function kO(){if(Oh)return Ta;Oh=1;var t=$O(),e=/^\s+/;function n(i){return i&&i.slice(0,t(i)+1).replace(e,"")}return Ta=n,Ta}var $a,Ah;function ov(){if(Ah)return $a;Ah=1;var t=iv(),e=t.Symbol;return $a=e,$a}var ka,Ph;function OO(){if(Ph)return ka;Ph=1;var t=ov(),e=Object.prototype,n=e.hasOwnProperty,i=e.toString,o=t?t.toStringTag:void 0;function r(s){var a=n.call(s,o),l=s[o];try{s[o]=void 0;var c=!0}catch{}var u=i.call(s);return c&&(a?s[o]=l:delete s[o]),u}return ka=r,ka}var Oa,Rh;function AO(){if(Rh)return Oa;Rh=1;var t=Object.prototype,e=t.toString;function n(i){return e.call(i)}return Oa=n,Oa}var Aa,Ih;function PO(){if(Ih)return Aa;Ih=1;var t=ov(),e=OO(),n=AO(),i="[object Null]",o="[object Undefined]",r=t?t.toStringTag:void 0;function s(a){return a==null?a===void 0?o:i:r&&r in Object(a)?e(a):n(a)}return Aa=s,Aa}var Pa,Mh;function RO(){if(Mh)return Pa;Mh=1;function t(e){return e!=null&&typeof e=="object"}return Pa=t,Pa}var Ra,Fh;function IO(){if(Fh)return Ra;Fh=1;var t=PO(),e=RO(),n="[object Symbol]";function i(o){return typeof o=="symbol"||e(o)&&t(o)==n}return Ra=i,Ra}var Ia,Dh;function MO(){if(Dh)return Ia;Dh=1;var t=kO(),e=Ac(),n=IO(),i=NaN,o=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return i;if(e(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=e(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=t(c);var d=r.test(c);return d||s.test(c)?a(c.slice(2),d?2:8):o.test(c)?i:+c}return Ia=l,Ia}var Ma,Lh;function FO(){if(Lh)return Ma;Lh=1;var t=Ac(),e=TO(),n=MO(),i="Expected a function",o=Math.max,r=Math.min;function s(a,l,c){var u,d,h,m,f,p,_=0,C=!1,w=!1,S=!0;if(typeof a!="function")throw new TypeError(i);l=n(l)||0,t(c)&&(C=!!c.leading,w="maxWait"in c,h=w?o(n(c.maxWait)||0,l):h,S="trailing"in c?!!c.trailing:S);function b(M){var q=u,le=d;return u=d=void 0,_=M,m=a.apply(le,q),m}function E(M){return _=M,f=setTimeout($,l),C?b(M):m}function x(M){var q=M-p,le=M-_,de=l-q;return w?r(de,h-le):de}function O(M){var q=M-p,le=M-_;return p===void 0||q>=l||q<0||w&&le>=h}function $(){var M=e();if(O(M))return K(M);f=setTimeout($,x(M))}function K(M){return f=void 0,S&&u?b(M):(u=d=void 0,m)}function F(){f!==void 0&&clearTimeout(f),_=0,u=p=d=f=void 0}function P(){return f===void 0?m:K(e())}function N(){var M=e(),q=O(M);if(u=arguments,d=this,p=M,q){if(f===void 0)return E(p);if(w)return clearTimeout(f),f=setTimeout($,l),b(p)}return f===void 0&&(f=setTimeout($,l)),m}return N.cancel=F,N.flush=P,N}return Ma=s,Ma}var Fa,jh;function DO(){if(jh)return Fa;jh=1;var t=FO(),e=Ac(),n="Expected a function";function i(o,r,s){var a=!0,l=!0;if(typeof o!="function")throw new TypeError(n);return e(s)&&(a="leading"in s?!!s.leading:a,l="trailing"in s?!!s.trailing:l),t(o,r,{leading:a,maxWait:r,trailing:l})}return Fa=i,Fa}var LO=DO();const jO=Di(LO);var Da,zh;function zO(){return zh||(zh=1,Da=function(){var e={},n=e._fns={};e.emit=function(s,a,l,c,u,d,h){var m=i(s);m.length&&o(s,m,[a,l,c,u,d,h])},e.on=function(s,a){n[s]||(n[s]=[]),n[s].push(a)},e.once=function(s,a){function l(){a.apply(this,arguments),e.off(s,l)}this.on(s,l)},e.off=function(s,a){var l=[];if(s&&a){var c=this._fns[s],u=0,d=c?c.length:0;for(u;u<d;u++)c[u]!==a&&l.push(c[u])}l.length?this._fns[s]=l:delete this._fns[s]};function i(r){var s=n[r]?n[r]:[],a=r.indexOf(":"),l=a===-1?[r]:[r.substring(0,a),r.substring(a+1)],c=Object.keys(n),u=0,d=c.length;for(u;u<d;u++){var h=c[u];if(h==="*"&&(s=s.concat(n[h])),l.length===2&&l[0]===h){s=s.concat(n[h]);break}}return s}function o(r,s,a){var l=0,c=s.length;for(l;l<c&&s[l];l++)s[l].event=r,s[l].apply(s[l],a)}return e}),Da}var NO=zO();const UO=Di(NO);let VO="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",BO=(t=21)=>{let e="",n=t|0;for(;n--;)e+=VO[Math.random()*64|0];return e};const HO="5.2.0",qO={version:HO};function WO(t,e){return e.name?e.name:t.split("/")[0]==="image"?`${t.split("/")[0]}.${t.split("/")[1]}`:"noname"}const KO={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};function YO(t){if(t==null&&typeof navigator<"u"&&(t=navigator.userAgent),!t)return!0;const e=/Edge\/(\d+\.\d+)/.exec(t);if(!e)return!0;const i=e[1].split(".",2),o=parseInt(i[0],10),r=parseInt(i[1],10);return o<15||o===15&&r<15063||o>18||o===18&&r>=18218}const Pr={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};class Pc{static VERSION=qO.version;#e=Object.create(null);#t;#n;#i=UO();#r=new Set;#o=new Set;#a=new Set;defaultLocale;locale;opts;store;i18n;i18nArray;scheduledAutoProceed=null;wasOffline=!1;constructor(e){this.defaultLocale=KO;const n={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:bO,meta:{},onBeforeFileAdded:(o,r)=>!Object.hasOwn(r,o.id),onBeforeUpload:o=>o,store:new EO,logger:hO,infoTimeout:5e3},i={...n,...e};this.opts={...i,restrictions:{...n.restrictions,...e?.restrictions}},e?.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e?.debug&&(this.opts.logger=pO),this.log(`Using Core v${Pc.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...Pr,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:YO(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),this.#t=new wO(()=>this.opts,()=>this.i18n),this.#n=this.store.subscribe((o,r,s)=>{this.emit("state-update",o,r,s),this.updateAll(r)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),this.#x()}emit(e,...n){this.#i.emit(e,...n)}on(e,n){return this.#i.on(e,n),this}once(e,n){return this.#i.once(e,n),this}off(e,n){return this.#i.off(e,n),this}updateAll(e){this.iteratePlugins(n=>{n.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){const n=this.getState().files;this.setState({files:{...n,...Object.fromEntries(Object.entries(e).map(([i,o])=>[i,{...n[i],...o}]))}})}setFileState(e,n){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:n})}i18nInit(){const e=i=>this.log(`Missing i18n string: ${i}`,"error"),n=new nv([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=n.translate.bind(n),this.i18nArray=n.translateArray.bind(n),this.locale=n.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e?.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(n=>{n.setOptions(e)}),this.setState(void 0)}resetProgress(){const e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},n={...this.getState().files},i=Object.create(null);Object.keys(n).forEach(o=>{i[o]={...n[o],progress:{...n[o].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:i,...Pr})}clear(){const{capabilities:e,currentUploads:n}=this.getState();if(Object.keys(n).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...Pr,files:{}})}addPreProcessor(e){this.#r.add(e)}removePreProcessor(e){return this.#r.delete(e)}addPostProcessor(e){this.#a.add(e)}removePostProcessor(e){return this.#a.delete(e)}addUploader(e){this.#o.add(e)}removeUploader(e){return this.#o.delete(e)}setMeta(e){const n={...this.getState().meta,...e},i={...this.getState().files};Object.keys(i).forEach(o=>{i[o]={...i[o],meta:{...i[o].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:n,files:i})}setFileMeta(e,n){const i={...this.getState().files};if(!i[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}const o={...i[e].meta,...n};i[e]={...i[e],meta:o},this.setState({files:i})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(n=>this.getFile(n))}getObjectOfFilesPerState(){const{files:e,totalProgress:n,error:i}=this.getState(),o=Object.values(e),r=[],s=[],a=[],l=[],c=[],u=[],d=[],h=[],m=[];for(const f of o){const{progress:p}=f;!p.uploadComplete&&p.uploadStarted&&(r.push(f),f.isPaused||h.push(f)),p.uploadStarted||s.push(f),(p.uploadStarted||p.preprocess||p.postprocess)&&a.push(f),p.uploadStarted&&l.push(f),f.isPaused&&c.push(f),p.uploadComplete&&u.push(f),f.error&&d.push(f),(p.preprocess||p.postprocess)&&m.push(f)}return{newFiles:s,startedFiles:a,uploadStartedFiles:l,pausedFiles:c,completeFiles:u,erroredFiles:d,inProgressFiles:r,inProgressNotPausedFiles:h,processingFiles:m,isUploadStarted:l.length>0,isAllComplete:n===100&&u.length===o.length&&m.length===0,isAllErrored:!!i&&d.length===o.length,isAllPaused:r.length!==0&&c.length===r.length,isUploadInProgress:r.length>0,isSomeGhost:o.some(f=>f.isGhost)}}#s(e){for(const s of e)s.isRestriction?this.emit("restriction-failed",s.file,s):this.emit("error",s,s.file),this.log(s,"warning");const n=e.filter(s=>s.isUserFacing),i=4,o=n.slice(0,i),r=n.slice(i);o.forEach(({message:s,details:a=""})=>{this.info({message:s,details:a},"error",this.opts.infoTimeout)}),r.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:r.length})})}validateRestrictions(e,n=this.getFiles()){try{this.#t.validate(n,[e])}catch(i){return i}return null}validateSingleFile(e){try{this.#t.validateSingleFile(e)}catch(n){return n.message}return null}validateAggregateRestrictions(e){const n=this.getFiles();try{this.#t.validateAggregateRestrictions(n,e)}catch(i){return i.message}return null}#u(e){const{missingFields:n,error:i}=this.#t.getMissingRequiredMetaFields(e);return n.length>0?(this.setFileState(e.id,{missingRequiredMetaFields:n,error:i.message}),this.log(i.message),this.emit("restriction-failed",e,i),!1):(n.length===0&&e.missingRequiredMetaFields&&this.setFileState(e.id,{missingRequiredMetaFields:[]}),!0)}#l(e){let n=!0;for(const i of Object.values(e))this.#u(i)||(n=!1);return n}#w(e){const{allowNewUpload:n}=this.getState();if(n===!1){const i=new _n(this.i18n("noMoreFilesAllowed"),{file:e});throw this.#s([i]),i}}checkIfFileAlreadyExists(e){const{files:n}=this.getState();return!!(n[e]&&!n[e].isGhost)}#S(e){const n=e instanceof File?{name:e.name,type:e.type,size:e.size,data:e,meta:{},isRemote:!1,source:void 0,preview:void 0}:e,i=tv(n),o=WO(i,n),r=ev(o).extension,s=rO(n,this.getID()),a={...n.meta,name:o,type:i},l=Number.isFinite(n.data.size)?n.data.size:null;return{source:n.source||"",id:s,name:o,extension:r||"",meta:{...this.getState().meta,...a},type:i,progress:{percentage:0,bytesUploaded:!1,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,isGhost:!1,...n.isRemote?{isRemote:!0,remote:n.remote,data:n.data}:{isRemote:!1,data:n.data},preview:n.preview}}#f(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))}#m(e){let{files:n}=this.getState(),i={...n};const o=[],r=[];for(const s of e)try{let a=this.#S(s);this.#w(a);const l=n[a.id],c=l?.isGhost;if(c&&!a.isRemote){if(a.data==null)throw new Error("File data is missing");a={...l,isGhost:!1,data:a.data},this.log(`Replaced the blob in the restored ghost file: ${a.name}, ${a.id}`)}const u=this.opts.onBeforeFileAdded(a,i);if(n=this.getState().files,i={...n,...i},!u&&this.checkIfFileAlreadyExists(a.id))throw new _n(this.i18n("noDuplicates",{fileName:a.name??this.i18n("unnamed")}),{file:a});if(u===!1&&!c)throw new _n("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:a});typeof u=="object"&&u!==null&&(a=u),this.#t.validateSingleFile(a),i[a.id]=a,o.push(a)}catch(a){r.push(a)}try{this.#t.validateAggregateRestrictions(Object.values(n),o)}catch(s){return r.push(s),{nextFilesState:n,validFilesToAdd:[],errors:r}}return{nextFilesState:i,validFilesToAdd:o,errors:r}}addFile(e){const{nextFilesState:n,validFilesToAdd:i,errors:o}=this.#m([e]),r=o.filter(a=>a.isRestriction);if(this.#s(r),o.length>0)throw o[0];this.setState({files:n});const[s]=i;return this.emit("file-added",s),this.emit("files-added",i),this.log(`Added file: ${s.name}, ${s.id}, mime type: ${s.type}`),this.#f(),s.id}addFiles(e){const{nextFilesState:n,validFilesToAdd:i,errors:o}=this.#m(e),r=o.filter(a=>a.isRestriction);this.#s(r);const s=o.filter(a=>!a.isRestriction);if(s.length>0){let a=`Multiple errors occurred while adding files:
|
|
16
|
+
err: ${o}`);return}}return t}function bm(t,e){return JSON.parse(t,function(n,i){return pe.Undef(i)||!i.indexOf?i:Fn(i,e)})}let FT=0;function Ps(){const t=370+ ++FT;return"F"+Math.random().toString(36).substr(3,3)+(+`${Date.now()}`).toString(36)+t.toString(36)+"c"}function fi(t,e,n){let i=t,o;return(e||"").split(".").forEach(r=>{o&&((!i[o]||typeof i[o]!="object")&&(i[o]={}),i=i[o]),o=r}),i[o]=n,i}const LT="fcGroup",jT=Se({name:LT,props:{field:String,rule:Array,expand:Number,options:Object,button:{type:Boolean,default:!0},max:{type:Number,default:0},min:{type:Number,default:0},modelValue:{type:Array,default:()=>[]},defaultValue:Object,sortBtn:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},title:{type:[String,Function],default:null},type:{type:String,default:"default"},onBeforeRemove:{type:Function,default:()=>{}},onBeforeAdd:{type:Function,default:()=>{}},formCreateInject:Object,parse:Function},data(){return{len:0,cacheRule:{},cacheValue:{},sort:[],form:Gn(this.formCreateInject.form.$form())}},emits:["update:modelValue","change","itemMounted","remove","add"],watch:{rule:{handler(t,e){Object.keys(this.cacheRule).forEach(n=>{const i=this.cacheRule[n];if(i.$f){const o=i.$f.formData();if(t===e)i.$f.deferSyncValue(()=>{nr(i.rule,t),i.$f.setValue(o)},!0);else{const r=i.$f.formData();i.$f.once("reloading",()=>{i.$f.setValue(r)}),i.rule=Mn(t)}}})},deep:!0},expand(t){let e=t-this.modelValue.length;e>0&&this.expandRule(e)},modelValue:{handler(t){t=t||[];let e=this.sort,n=e.length,i=n-t.length;if(i<0){for(let o=i;o<0;o++)this.addRule(t.length+o,!0);for(let o=0;o<n;o++)this.setValue(e[o],t[o])}else{if(i>0)for(let o=0;o<i;o++)this.removeRule(e[n-o-1]);t.forEach((o,r)=>{this.setValue(e[r],t[r])})}},deep:!0}},methods:{_value(t){return t&<(t,this.field)?t[this.field]:t},cache(t,e){this.cacheValue[t]=JSON.stringify(e)},input(t){this.$emit("update:modelValue",t),this.$emit("change",t)},formData(t,e){const n=this.cacheRule,i=this.sort;if(i.filter(r=>n[r]&&n[r].$f).length!==i.length)return;const o=i.map(r=>{const s=t===r?e:Te({},this.cacheRule[r].$f.form),a=this.field?pe.Undef(s[this.field])?null:s[this.field]:s;return this.cache(r,a),a});this.input(o)},setValue(t,e){const n=this.field;n&&(e={[n]:this._value(e)}),this.cacheValue[t]!==JSON.stringify(n?e[n]:e)&&(this.cacheRule[t].$f&&this.cacheRule[t].$f.coverValue(e),this.cache(t,e))},addRule(t,e){const n=this.formCreateInject.form.copyRules(this.rule||[]),i=this.options?Te({},this.options):{submitBtn:!1,resetBtn:!1};if(this.defaultValue){i.formData||(i.formData={});const o=Mn(this.defaultValue);De(i.formData,this.field?{[this.field]:o}:o)}this.parse&&this.parse({rule:n,options:i,index:this.sort.length}),this.cacheRule[++this.len]={rule:n,options:i},this.sort=Object.keys(this.cacheRule),e&&Ge(()=>this.$emit("add",n,Object.keys(this.cacheRule).length-1))},add$f(t,e,n){this.cacheRule[e].$f=n,Ge(()=>{this.$emit("itemMounted",n,Object.keys(this.cacheRule).indexOf(e))})},removeRule(t,e){const n=Object.keys(this.cacheRule).indexOf(t);delete this.cacheRule[t],delete this.cacheValue[t],this.sort=Object.keys(this.cacheRule),e&&Ge(()=>this.$emit("remove",n))},add(t){if(this.disabled||this.onBeforeAdd(this.modelValue)===!1)return;const e=[...this.modelValue];e.push(this.defaultValue?Mn(this.defaultValue):this.field?null:{}),this.input(e)},del(t,e){if(this.disabled)return;const n=()=>{this.removeRule(e,!0);const i=[...this.modelValue];i.splice(t,1),this.input(i)};as(this.onBeforeRemove(this.modelValue,t)).then(i=>{i!==!1&&n()})},addIcon(t){return j("div",{class:"_fc-group-btn _fc-group-plus-minus",onClick:this.add},null)},delIcon(t,e){return j("div",{class:"_fc-group-btn _fc-group-plus-minus _fc-group-minus",onClick:()=>this.del(t,e)},null)},sortUpIcon(t){return j("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-up",onClick:()=>this.changeSort(t,-1)},null)},sortDownIcon(t){return j("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-down",onClick:()=>this.changeSort(t,1)},null)},changeSort(t,e){const n=this.sort[t];this.sort[t]=this.sort[t+e],this.sort[t+e]=n,this.formCreateInject.subForm(this.sort.map(i=>this.cacheRule[i].$f)),this.formData(0)},sortIcon(t,e){const n=t>0,i=t<e-1,o=[];return!n&&!i?o:this.type==="card"&&n&&i?(o.push(j("div",{class:"_fc-group-btn _fc-group-sort"},[j("div",{class:" _fc-group-sort-up",onClick:()=>this.changeSort(t,-1)},null),j("div",{class:" _fc-group-sort-down",onClick:()=>this.changeSort(t,1)},null)])),o):(n&&o.push(this.sortUpIcon(t)),i&&o.push(this.sortDownIcon(t)),o)},makeIcon(t,e,n){if(this.$slots.button)return this.$slots.button({total:t,index:e,vm:this,key:n,del:()=>this.del(e,n),add:this.add});const i=[];if((!this.max||t<this.max)&&t===e+1&&i.push(this.addIcon(n)),t>this.min&&i.push(this.delIcon(e,n)),this.sortBtn){const o=this.sortIcon(e,t);o&&i.push(...o)}return i},expandRule(t){for(let e=0;e<t;e++)this.modelValue.push(this.field?null:{});this.input([...this.modelValue])},getTitle(t,e){return typeof this.title=="function"?this.title(t,this.modelValue[t],e):typeof this.title=="string"?this.title.replace("{index}",t+1):!1}},created(){const t=(this.expand||0)-this.modelValue.length;for(let e=0;e<this.modelValue.length;e++)this.addRule(e);t>0&&this.expandRule(t)},render(){const t=this.sort,e=this.button,n=this.form,i=this.disabled,o=this.type==="card",r=t.length===0?this.$slots.default?this.$slots.default({vm:this,add:this.add}):j("div",{key:"a_def",class:"_fc-group-plus-minus _fc-group-add fc-clock",onClick:this.add},null):t.map((s,a)=>{const{rule:l,options:c}=this.cacheRule[s],u=e&&!i?this.makeIcon(t.length,a,s):[],d=this.getTitle(a,s);return o?j("div",{class:"_fc-group-container",key:s},[j("div",{class:"_fc-group-header"},[d===!1?j("div",{class:"_fc-group-idx"},[a+1]):null,d!==!1?j("div",{class:"_fc-group-title"},[d]):null,j("div",{class:"_fc-group-handle fc-clock"},[u.length?u:null])]),j("div",{class:"_fc-group-content"},[j(n,We({key:s},en(Te({},this.$attrs),{disabled:i,"onUpdate:modelValue":h=>this.formData(s,h),"onUpdate:api":h=>this.add$f(a,s,h),inFor:!0,modelValue:this.field?{[this.field]:this._value(this.modelValue[a])}:this.modelValue[a],rule:l,option:c,extendOption:!0})),null)])]):j("div",{class:"_fc-group-container",key:s},[j(n,We({key:s},en(Te({},this.$attrs),{disabled:i,"onUpdate:modelValue":h=>this.formData(s,h),"onUpdate:api":h=>this.add$f(a,s,h),inFor:!0,modelValue:this.field?{[this.field]:this._value(this.modelValue[a])}:this.modelValue[a],rule:l,option:c,extendOption:!0})),null),j("div",{class:"_fc-group-idx"},[a+1]),u.length?j("div",{class:"_fc-group-handle fc-clock"},[u]):null])});return j("div",{key:"con",class:"_fc-group "+(i?"_fc-group-disabled":"")+(o?" _fc-group-card":"")},[r])}}),NT="fcSubForm",UT=Se({name:NT,props:{rule:Array,options:{type:Object,default:()=>Mt({submitBtn:!1,resetBtn:!1})},modelValue:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},formCreateInject:Object},data(){return{cacheValue:{},subApi:{},form:Gn(this.formCreateInject.form.$form())}},emits:["fc:subform","update:modelValue","change","itemMounted"],watch:{modelValue(t){this.setValue(t)}},methods:{formData(t){this.cacheValue=JSON.stringify(t),this.$emit("update:modelValue",t),this.$emit("change",t)},setValue(t){const e=JSON.stringify(t);this.cacheValue!==e&&(this.cacheValue=e,this.subApi.coverValue(t||{}))},add$f(t){this.subApi=t,Ge(()=>{this.$emit("itemMounted",t)})}},render(){const t=this.form;return j(t,{disabled:this.disabled,"onUpdate:modelValue":this.formData,modelValue:this.modelValue,"onUpdate:api":this.add$f,rule:this.rule,option:this.options,extendOption:!0},null)}}),zT={name:"IconWarning"},VT={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function BT(t,e,n,i,o,r){return y(),T("svg",VT,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M512 64a448 448 0 110 896 448 448 0 010-896zm0 832a384 384 0 000-768 384 384 0 000 768zm48-176a48 48 0 11-96 0 48 48 0 0196 0zm-48-464a32 32 0 0132 32v288a32 32 0 01-64 0V288a32 32 0 0132-32z"},null,-1)])])}const HT=gi(zT,[["render",BT]]),qT=[Gx,gT,yT,ST,xT,RT,jT,UT,HT],wm=["props"],Em=["class","style","directives"],Sm=["on","hook"],Qn=(t,e={},n={})=>{const i=[...wm,...n.normal||[]],o=[...Em,...n.array||[]],r=[...Sm,...n.functional||[]],s=n.props||[];return t.reduce((a,l)=>{for(const c in l)if(a[c])if(s.indexOf(c)>-1)a[c]=Qn([l[c]],a[c]);else if(i.indexOf(c)>-1)a[c]=Te(Te({},a[c]),l[c]);else if(o.indexOf(c)>-1){const u=a[c]instanceof Array?a[c]:[a[c]],d=l[c]instanceof Array?l[c]:[l[c]];a[c]=[...u,...d]}else if(r.indexOf(c)>-1)for(const u in l[c])if(a[c][u]){const d=a[c][u]instanceof Array?a[c][u]:[a[c][u]],h=l[c][u]instanceof Array?l[c][u]:[l[c][u]];a[c][u]=[...d,...h]}else a[c][u]=l[c][u];else if(c==="hook")for(let u in l[c])a[c][u]?a[c][u]=WT(a[c][u],l[c][u]):a[c][u]=l[c][u];else a[c]=l[c];else i.indexOf(c)>-1||r.indexOf(c)>-1||s.indexOf(c)>-1?a[c]=Te({},l[c]):o.indexOf(c)>-1?a[c]=l[c]instanceof Array?[...l[c]]:typeof l[c]=="object"?Te({},l[c]):l[c]:a[c]=l[c];return a},e)},WT=(t,e)=>function(){t&&t.apply(this,arguments),e&&e.apply(this,arguments)},Cm=["type","slot","ignore","emitPrefix","value","name","native","hidden","display","inject","options","emit","link","prefix","suffix","update","sync","optionsTo","key","slotUpdate","computed","preview","component","cache","modelEmit"],wc=["validate","children","control"],Ec=["effect","deep","renderSlots"];function xm(){return[...Cm,...wm,...Em,...Sm,...wc,...Ec]}function Vt(t){const e=t.replace(/(-[a-z])/g,function(n){return n.replace("-","").toLocaleUpperCase()});return Tm(e)}function Tm(t){return t.replace(t[0],t[0].toLowerCase())}function _l(t,e){return{value:t,enumerable:!1,configurable:!1,writable:!0}}function Om(t,e){return $m([t],e||!1)[0]}function $m(t,e){return nr([],[...t],e||!1)}function Zn(t,e){return Qn(Array.isArray(e)?e:[e],t,{array:wc,normal:Ec}),t}function qd(t){const e=pe.Function(t.getRule)?t.getRule():t;return e.type||(e.type="input"),e}function KT(t,e){return t?(Object.keys(e||{}).forEach(n=>{e[n]&&(t[n]=Zn(t[n]||{},e[n]))}),t):e}function km(t,e){Object.defineProperties(t,Object.keys(e).reduce((n,i)=>(n[i]={get(){return e[i]()}},n),{}))}function kn(t){return t.__fc__||(t.__origin__?t.__origin__.__fc__:null)}function Be(t,e){try{e=t()}catch(n){DT(n)}return e}function wr(){const t={},e=n=>n||"default";return{setSlot(n,i){n=e(n),!(!i||Array.isArray(i)&&i.length)&&(t[n]||(t[n]=[]),t[n].push(i))},getSlot(n,i){n=e(n);const o=[];return(t[n]||[]).forEach(r=>{if(Array.isArray(r))o.push(...r);else if(pe.Function(r)){const s=r(...i||[]);Array.isArray(s)?o.push(...s):o.push(s)}else pe.Undef(r)||o.push(r)}),o},getSlots(){const n={};return Object.keys(t).forEach(i=>{n[i]=(...o)=>this.getSlot(i,o)}),n},slotLen(n){return n=e(n),t[n]?t[n].length:0},mergeBag(n){if(!n)return this;const i=pe.Function(n.getSlots)?n.getSlots():n;return Array.isArray(n)||zi(n)?this.setSlot(void 0,()=>n):Object.keys(i).forEach(o=>{this.setSlot(o,i[o])}),this}}}function Wd(t){const e=Te({},t.props||{});return Object.keys(t.on||{}).forEach(n=>{n.indexOf("-")>0&&(n=Vt(n));const i=`on${_m(n)}`;Array.isArray(e[i])?e[i]=[...e[i],t.on[n]]:e[i]?e[i]=[e[i],t.on[n]]:e[i]=t.on[n]}),e.key=t.key,e.ref=t.ref,e.class=t.class,e.id=t.id,e.style=t.style,e.slot&&delete e.slot,e}function Er(t,e){return Object.setPrototypeOf(t,e),t}const Kd=(t,e)=>typeof t=="string"?String(e):typeof t=="number"?Number(e):e,Ai={"==":(t,e)=>JSON.stringify(t)===JSON.stringify(Kd(t,e)),"!=":(t,e)=>!Ai["=="](t,e),">":(t,e)=>t>e,">=":(t,e)=>t>=e,"<":(t,e)=>t<e,"<=":(t,e)=>t<=e,on(t,e){return t&&t.indexOf&&t.indexOf(Kd(t[0],e))>-1},notOn(t,e){return!Ai.on(t,e)},in(t,e){return e&&e.indexOf&&e.indexOf(t)>-1},notIn(t,e){return!Ai.in(t,e)},between(t,e){return t>e[0]&&t<e[1]},notBetween(t,e){return t<e[0]||t>e[1]},empty(t){return pe.empty(t)},notEmpty(t){return!pe.empty(t)},pattern(t,e){return new RegExp(e,"g").test(t)}};function Pt(t,e){return(Array.isArray(e)?e:(e||"").split(".")).forEach(n=>{t!=null&&(t=t[n])}),t}function YT(t){const e=/{{\s*(.*?)\s*}}/g;let n;const i={};for(;(n=e.exec(t))!==null;)n[1]&&(i[n[1]]=!0);return Object.keys(i)}function Yd(t){let e=t.split("."),n=[],i="";return e.forEach((o,r)=>{r===0?i=o:i+="."+o,n.push(i)}),n.join(" && ")}function Am(t){const e=[];let n="",i=0;for(let o=0;o<t.length;o++){const r=t[o];r==="["?(i===0&&n&&(e.push({type:"key",value:n}),n=""),i++,n+=r):r==="]"?(i--,n+=r,i===0&&(e.push({type:"bracket",value:Am(n.slice(1,-1))}),n="")):r==="."&&i===0?n&&(e.push({type:"key",value:n}),n=""):n+=r}return n&&e.push({type:"key",value:n}),e.map(o=>o.type==="key"?{key:o.value}:{children:o.value})}const Yr=(t,e)=>{if(!(!t||t===e)){if(t.props.formCreateInject)return t.props.formCreateInject;if(t.parent)return Yr(t.parent,e)}};function GT(t,e,n){return Se({name:"FormCreate"+(t.isMobile?"Mobile":""),components:e,directives:n,props:{rule:{type:Array,required:!0,default:()=>[]},option:{type:Object,default:()=>({})},extendOption:Boolean,driver:[String,Object],modelValue:Object,disabled:{type:Boolean,default:void 0},preview:{type:Boolean,default:void 0},index:[String,Number],api:Object,locale:[String,Object],t:Function,name:String,subForm:{type:Boolean,default:!0},inFor:Boolean},emits:["update:api","update:modelValue","mounted","beforeUnmount","submit","reset","change","emit-event","control","remove-rule","remove-field","sync","reload","repeat-field","update","validate-field-fail","validate-fail","created"],render(){return this.fc.render()},setup(i){const o=Ja();Bp("parentFC",o);const r=ko("parentFC",null);let s=r;if(r)for(;s.setupState.parent;)s=s.setupState.parent;else s=o;const{rule:a,modelValue:l,subForm:c,inFor:u}=Xa(i),d=Mt({ctxInject:{},destroyed:!1,isShow:!0,unique:1,renderRule:[...a.value||[]],updateValue:JSON.stringify(l.value||{})}),h=new t(o),v=h.api(),f=u.value,p=()=>{if(r){const x=Yr(o,r);if(x){let k;f?(k=zt(x.getSubForm()),k.push(v)):k=v,x.subForm(k)}}},_=()=>{const x=Yr(o,r);if(x)if(f){const k=zt(x.getSubForm()),O=k.indexOf(v);O>-1&&k.splice(O,1)}else x.subForm()};let S=null;b_(()=>{Nt(()=>{let x="";const k=i.option&&i.option.globalClass||{};Object.keys(k).forEach(O=>{let K="";k[O].style&&Object.keys(k[O].style).forEach(D=>{K+=Do(D)+":"+k[O].style[D]+";"}),k[O].content&&(K+=k[O].content+";"),K&&(x+=`.${O}{${K}}`)}),i.option&&i.option.style&&(x+=i.option.style),S||(S=document.createElement("style"),S.type="text/css",document.head.appendChild(S)),S.innerHTML=x||""})});const w=ci(()=>{h.bus.$emit("$loadData.$topForm")},100),E=ci(function(){h.bus.$emit("$loadData.$scopeForm")},100),b=ci(()=>{h.bus.$emit("$loadData.$form")},100),C=x=>{h.bus.$emit("change-$form."+x)};return et(()=>{r&&(v.top.bus.$on("$loadData.$form",w),v.top.bus.$on("change",C)),v!==v.scope&&v.scope.bus.$on("$loadData.$scopeForm",E),h.mounted()}),bs(()=>{r&&(v.top.bus.$off("$loadData.$form",w),v.top.bus.$off("change",C)),v!==v.scope&&v.scope.bus.$off("$loadData.$scopeForm",E),_(),d.destroyed=!0,h.unmount(),S&&(S.parentNode||S.parentElement)&&document.head.removeChild(S)}),Vp(()=>{h.updated()}),p(),Oe(()=>i.option,()=>{h.initOptions(),v.refresh()},{deep:!0,flush:"sync"}),Oe(()=>[...a.value],x=>{h.$handle.isBreakWatch()||x.length===d.renderRule.length&&x.every(k=>d.renderRule.indexOf(k)>-1)||(h.$handle.updateAppendData(),h.$handle.reloadRule(a.value),o.setupState.renderRule())}),Oe(()=>[i.disabled,i.preview],()=>{v.refresh()}),Oe(l,x=>{Fo(x||{})!==d.updateValue&&(v.config.forceCoverValue?v.coverValue(x||{}):v.setValue(x||{}))},{deep:!0,flush:"post"}),Oe(()=>i.index,()=>{v.coverValue({}),h.$handle.updateAppendData(),Ge(()=>{Ge(()=>{v.clearValidateState()})})},{flush:"sync"}),en(Te({fc:Gn(h),parent:r&&Gn(r),top:Gn(s),fapi:Gn(v)},Xa(d)),{getGroupInject:()=>Yr(o,r),refresh(){++d.unique},renderRule(){d.renderRule=[...a.value||[]]},updateValue(x){if(d.destroyed)return;const k=Fo(x);d.updateValue!==k&&(d.updateValue=k,o.emit("update:modelValue",x),Ge(()=>{b(),r?c.value||E():(w(),E())}))}})},created(){const i=Ja();i.emit("update:api",i.setupState.fapi),i.setupState.fc.init()}})}function Pm(){return{props:{},on:{},options:[],children:[],hidden:!1,display:!0,value:void 0}}function Ct(t,e){return(n,i,o,r={})=>{const s=new Sc(t,n,i,o,r);return e&&(pe.Function(e)?e(s):s.props(e)),s}}function Sc(t,e,n,i,o){this._data=De(Pm(),{type:t,title:e,field:n,value:i,props:o||{}}),this.event=this.on}De(Sc.prototype,{getRule(){return this._data},setProp(t,e){return an(this._data,t,e),this},modelField(t){return this._data.modelField=t,this},_clone(){const t=new this.constructor;return t._data=Om(this._data),t}});function Rm(t){t.forEach(e=>{Sc.prototype[e]=function(n){return Zn(this._data,{[e]:arguments.length<2?n:{[n]:arguments[1]}}),this}})}Rm(xm());const QT=Ct("");function XT(t,e,n){let i=QT("",e);return i._data.type=t,i._data.title=n,i}function JT(){return{create:XT,factory:Ct}}function ZT(t,e,n){const i=`fail to ${t} ${n.status}'`,o=new Error(i);return o.status=n.status,o.url=t,o}function Gd(t){const e=t.responseText||t.response;if(!e)return e;try{return JSON.parse(e)}catch{return e}}function Im(t){if(typeof XMLHttpRequest>"u")return;const e=new XMLHttpRequest;let n=t.action||"";if(e.upload&&t.onProgress&&e.upload.addEventListener("progress",r=>{r.percent=r.total>0?r.loaded/r.total*100:0,t.onProgress(r)}),t.query){const r=pe.String(t.query)?t.query:Object.keys(t.query).reduce((a,l)=>(a[l]=t.query[l]===null||t.query[l]===void 0?"":t.query[l],a),{}),s=new URLSearchParams(r).toString();s&&(n.includes("?")?n+=`&${s}`:n+=`?${s}`)}e.onerror=function(r){t.onError(r)},e.onload=function(){if(e.status<200||e.status>=300)return t.onError(ZT(n,t,e),Gd(e));t.onSuccess(Gd(e))},e.open(t.method||"get",n,!0);let i;(t.data||t.file)&&(t.file||(t.dataType||"").toLowerCase()!=="json"?(i=new FormData,Object.keys(t.data||{}).map(r=>{i.append(r,t.data[r])})):(i=JSON.stringify(t.data||{}),e.setRequestHeader("content-type","application/json"))),t.file&&i.append(t.filename,t.file,t.file.name),t.withCredentials&&"withCredentials"in e&&(e.withCredentials=!0);const o=t.headers||{};Object.keys(o).forEach(r=>{o[r]!=null&&e.setRequestHeader(r,o[r])}),e.send(i)}function Qd(t,e,n){return new Promise((i,o)=>{(e||Im)(en(Te({},t),{onSuccess(r){let s=l=>l;const a=Fn(t.parse);pe.Function(a)?s=a:a&&pe.String(a)&&(s=l=>Pt(l,a)),as(s(r,t.targetRule,n)).then(l=>{i(l)})},onError(r){o(r)}}))})}function wo(t){return Mn(t)}function eO(t){function e(r){return pe.Undef(r)?r=t.fields():Array.isArray(r)||(r=[r]),r}function n(r,s,a){pe.Undef(r)?r=Object.keys(Te(Te({},t.fieldCtx),t.nameCtx)):Array.isArray(r)||(r=[r]),r.forEach(l=>{const c=t.fieldCtx[l]||t.nameCtx[l];c&&c.forEach(u=>{an(u.rule,s,a),t.$render.clearCache(u)})})}function i(){const r=t.subForm;return Object.keys(r).reduce((s,a)=>{const l=r[a];return l&&(Array.isArray(l)?s.push(...l):s.push(l)),s},[])}const o={get isScope(){return t.vm.props.subForm===!1},get isPreview(){return t.preview},get config(){return t.options},set config(r){t.fc.options.value=r},get options(){return t.options},set options(r){t.fc.options.value=r},get form(){return t.form},get rule(){return t.rules},get parent(){return t.vm.setupState.parent&&t.vm.setupState.parent.setupState.fapi},get top(){return o.parent?o.parent.top:o},get scope(){let r=t.vm;for(;r&&r.setupState.fapi;)if(r.props.subForm)r=r.setupState.parent;else return r.setupState.fapi;return o.top},get children(){return i()},get siblings(){const r=t.vm.setupState.getGroupInject();if(r){const s=r.getSubForm();if(Array.isArray(s))return[...s]}},get index(){const r=o.siblings;if(r){const s=r.indexOf(o);return s>-1?s:void 0}},get formulas(){return Te({},t.fc.formulas)},formData(r){if(r==null||typeof r=="boolean"){const s={};return Object.keys(t.form).forEach(a=>{(r===!0||t.ignoreFields.indexOf(a)===-1)&&(s[a]=wo(t.form[a]))}),s}else return e(r).reduce((s,a)=>(s[a]=o.getValue(a),s),{})},getValue(r){const s=t.getFieldCtx(r);return s?wo(s.rule.value):t.options.appendValue!==!1&<(t.appendData,r)?wo(t.appendData[r]):void 0},coverValue(r){const s=Te({},r||{});t.deferSyncValue(()=>{t.appendData={},o.fields().forEach(a=>{const l=t.fieldCtx[a];if(l){const c=lt(r,a);l.forEach(u=>{u.rule.value=c?r[a]:void 0}),delete s[a]}}),De(t.appendData,s)},!0)},setValue(r){let s=r;arguments.length>=2&&(s={[r]:arguments[1]}),t.deferSyncValue(()=>{Object.keys(s).forEach(a=>{const l=t.fieldCtx[a];if(!l)return t.appendData[a]=s[a];l.forEach(c=>{c.rule.value=s[a]})})},!0)},removeField(r){const s=t.getCtx(r);return t.deferSyncValue(()=>{t.getCtxs(r).forEach(a=>{a.rm()})},!0),s?s.origin:void 0},removeRule(r){const s=r&&kn(r);if(s)return s.rm(),s.origin},fields:()=>t.fields(),append:(r,s,a)=>{let l=t.sort.length-1,c;const u=t.getCtx(s);if(u)if(a){if(c=u.getPending("children",u.rule.children),!Array.isArray(c))return;l=u.rule.children.length-1}else l=u.root.indexOf(u.origin),c=u.root;else c=t.rules;c.splice(l+1,0,r)},prepend:(r,s,a)=>{let l=0,c;const u=t.getCtx(s);if(u)if(a){if(c=u.getPending("children",u.rule.children),!Array.isArray(c))return}else l=u.root.indexOf(u.origin),c=u.root;else c=t.rules;c.splice(l,0,r)},hidden(r,s){n(s,"hidden",!!r),t.refresh()},hiddenStatus(r){const s=t.getCtx(r);if(s)return!!s.rule.hidden},display(r,s){n(s,"display",!!r),t.refresh()},displayStatus(r){const s=t.getCtx(r);if(s)return!!s.rule.display},disabled(r,s){e(s).forEach(a=>{t.getCtxs(a).forEach(l=>{an(l.rule.props,"disabled",!!r)})}),t.refresh()},all(r){return Object.keys(t.ctxs).map(s=>{const a=t.ctxs[s];return r?a.origin:a.rule})},model(r){return t.fields().reduce((s,a)=>{const l=t.fieldCtx[a][0];return s[a]=r?l.origin:l.rule,s},{})},component(r){return Object.keys(t.nameCtx).reduce((s,a)=>{const l=t.nameCtx[a].map(c=>r?c.origin:c.rule);return s[a]=l.length===1?l[0]:l,s},{})},bind(){return o.form},reload:r=>{t.reloadRule(r)},updateOptions(r){t.fc.updateOptions(r),o.refresh()},onSubmit(r){o.updateOptions({onSubmit:r})},sync:r=>{if(Array.isArray(r)){r.forEach(a=>o.sync(a));return}let s=pe.Object(r)?kn(r):t.getCtxs(r);s&&(s=Array.isArray(s)?s:[s],s.forEach(a=>{if(!a.deleted){const l=t.subForm[a.id];l&&(Array.isArray(l)?l.forEach(c=>{c.refresh()}):l&&l.refresh()),t.$render.clearCache(a)}}),t.refresh())},refresh:()=>{i().forEach(r=>{r.refresh()}),t.$render.clearCacheAll(),t.refresh()},refreshOptions(){t.$manager.updateOptions(t.options),o.refresh()},hideForm:r=>{t.vm.setupState.isShow=!r},changeStatus:()=>t.changeStatus,clearChangeStatus:()=>{t.changeStatus=!1},updateRule(r,s){t.getCtxs(r).forEach(a=>{De(a.rule,s)})},updateRules(r){Object.keys(r).forEach(s=>{o.updateRule(s,r[s])})},mergeRule:(r,s)=>{t.getCtxs(r).forEach(a=>{Zn(a.rule,s)})},mergeRules(r){Object.keys(r).forEach(s=>{o.mergeRule(s,r[s])})},getRule:(r,s)=>{const a=t.getCtx(r);if(a)return s?a.origin:a.rule},findType(r,s){let a;return Object.keys(t.ctxs).forEach(l=>{const c=t.ctxs[l];c.rule.type===r&&(a=s?c.origin:c.rule)}),a},findTypes(r,s){let a=[];return Object.keys(t.ctxs).forEach(l=>{const c=t.ctxs[l];c.rule.type===r&&a.push(s?c.origin:c.rule)}),a},getRenderRule:r=>{const s=t.getCtx(r);if(s)return s.prop},getRefRule:r=>{const s=t.getCtxs(r);if(s){const a=s.map(l=>l.rule);return a.length===1?a[0]:a}},setEffect(r,s,a){const l=t.getCtx(r);l&&s&&(s[0]==="$"&&(s=s.substr(1)),lt(l.rule,"$"+s)&&an(l.rule,"$"+s,a),lt(l.rule,"effect")||(l.rule.effect={}),an(l.rule.effect,s,a))},clearEffectData(r,s){const a=t.getCtx(r);a&&(s&&s[0]==="$"&&(s=s.substr(1)),a.clearEffectData(s),o.sync(r))},updateValidate(r,s,a){a?o.mergeRule(r,{validate:s}):n(r,"validate",s)},updateValidates(r,s){Object.keys(r).forEach(a=>{o.updateValidate(a,r[a],s)})},refreshValidate(){o.refresh()},resetFields(r){e(r).forEach(s=>{t.getCtxs(s).forEach(a=>{t.$render.clearCache(a),a.rule.value=wo(a.defaultValue)})}),Ge(()=>{Ge(()=>{Ge(()=>{o.clearValidateState(r)})})}),r==null&&(pe.Function(t.options.onReset)&&Be(()=>t.options.onReset(o)),t.vm.emit("reset",o))},method(r,s){const a=o.el(r);if(!a||!a[s])throw new Error(ym("err",`${s} 方法不存在`));return(...l)=>a[s](...l)},exec(r,s,...a){return Be(()=>o.method(r,s)(...a))},toJson(r){return Fo(o.rule,r)},trigger(r,s,...a){const l=o.el(r);l&&l.$emit(s,...a)},el(r){const s=t.getCtx(r);if(s)return s.el||t.vm.refs[s.ref]},scrollTo(r,s={block:"center",inline:"nearest",behavior:"smooth"}){const a=o.el(r);if(!a)return;const l=a.$el!==void 0?a.$el:a;if(!l)return;const c=l.nodeType===1?l:l.firstElementChild;c&&typeof c.scrollIntoView=="function"&&c.scrollIntoView(s)},focus(r){const s=o.el(r);if(!s)return;const a=d=>!d||typeof d.focus!="function"?!1:(Be(()=>d.focus()),!0);if(a(s))return;const l=s.$el!==void 0?s.$el:s;if(a(l))return;const c=l&&(l.nodeType===1?l:l.firstElementChild);if(a(c)||!c||!c.querySelector)return;const u=c.querySelector('input:not([type=hidden]):not([disabled]),textarea:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])');a(u)},closeModal:r=>{t.bus.$emit("fc:closeModal:"+r)},getSubForm(r){const s=t.getCtx(r);return s?t.subForm[s.id]:void 0},getChildrenRuleList(r){const s=typeof r=="object",a=s?kn(r):t.getCtx(r),l=a?a.rule:s?r:o.getRule(r);if(!l)return[];const c=[];return(u=>{u&&u.forEach(d=>{typeof d=="object"&&(d.field&&c.push(d),c.push(...o.getChildrenRuleList(d)))})})(a?a.loadChildrenPending():l.children),c},getParentRule(r){return(typeof r=="object"?kn(r):t.getCtx(r)).parent.rule},getParentSubRule(r){const s=typeof r=="object"?kn(r):t.getCtx(r);if(s){const a=s.getParentGroup();if(a)return a.rule}},getChildrenFormData(r,s){return o.getChildrenRuleList(r).reduce((a,l)=>((l.ignore!==!0||s===!0)&&(a[l.field]=wo(l.value)),a),{})},setChildrenFormData(r,s,a){const l=o.getChildrenRuleList(r);t.deferSyncValue(()=>{l.forEach(c=>{lt(s,c.field)?c.value=s[c.field]:a&&(c.value=void 0)})})},getGlobalEvent(r){let s=o.options.globalEvent[r];if(s)return typeof s=="object"&&(s=s.handle),Fn(s)},getGlobalData(r){return new Promise((s,a)=>{let l=o.options.globalData[r];l?l.type==="fetch"?o.fetch(l).then(c=>{s(c)}).catch(a):s(l.data):s(t.fc.loadData[r])})},emitGlobalEvent(r,...s){const a=o.getGlobalEvent(r);if(a){const l=t.getInjectData({},void 0);return l.args=[...s],s.unshift(l),a.apply(null,s)}},setGlobalData(r,s){o.setData("$globalData."+r,s)},setGlobalVar(r,s){o.setData("$var."+r,s)},renderRule(r,s,a){const l=typeof r=="object"?kn(r):t.getCtx(r);return l?t.$render.createRuleVnode(l,s,a):void 0},renderChildren(r,s,a){const l=typeof r=="object"?kn(r):t.getCtx(r);return l?t.$render.createChildrenVnodes(l,s,a):void 0},nextTick(r){t.bus.$once("next-tick",r),t.refresh()},nextRefresh(r){t.nextRefresh(),r&&Be(r)},deferSyncValue(r,s){t.deferSyncValue(r,s)},emit(r,...s){t.vm.emitsOptions&&!t.vm.emitsOptions[r]&&(t.vm.emitsOptions[r]=null),t.vm.emit(r,...s)},bus:t.bus,getCurrentFormRule(){var r;return(r=t.vm.setupState.getGroupInject())==null?void 0:r.rule},fetch(r){return new Promise((s,a)=>{let l=Te({},r);l=t.loadFetchVar(l);const c=u=>{Be(()=>l.onError&&l.onError(u)),a(u)};t.beforeFetch(l).then(()=>Qd(l,t.fc.create.fetch,o).then(u=>{Be(()=>l.onSuccess&&l.onSuccess(u)),s(u)}).catch(u=>{c(u)})).catch(u=>{c(u)})})},watchFetch(r,s,a,l){return t.fc.watchLoadData((c,u)=>{let d=Te({},r);if(d=t.loadFetchVar(d,c),l&&l(d,u)===!1)return;const h=v=>{Be(()=>d.onError&&d.onError(v)),a&&a(v)};t.beforeFetch(d).then(()=>Qd(d,t.fc.create.fetch,o).then(v=>{Be(()=>d.onSuccess&&d.onSuccess(v)),s&&s(v,u)}).catch(v=>{h(v)})).catch(v=>{h(v)})},r.wait==null?1e3:r.wait)},getData(r,s){return t.fc.get?t.fc.get(r,s):t.fc.getLoadData(r,s)},watchData(r){return t.fc.watchLoadData((s,a)=>{Be(()=>r(s,a))})},setData(r,s,a){return t.fc.setData(r,s,a)},refreshData(r){return t.fc.refreshData(r)},t(r,s){return t.fc.t(r,s)},getLocale(){return t.fc.getLocale()},helper:{tidyFields:e,props:n}};return["on","once","off"].forEach(r=>{o[r]=function(...s){t.bus[`$${r}`](...s)}}),o.changeValue=o.changeField=o.setValue,o}function tO(t){De(t.prototype,{initCache(){this.clearCacheAll()},clearCache(e){if(!e.rule.cache){if(!this.cache[e.id]){e.parent&&this.clearCache(e.parent);return}(this.cache[e.id].use===!0||this.cache[e.id].parent)&&this.$handle.refresh(),this.cache[e.id].parent&&this.clearCache(this.cache[e.id].parent),this.cache[e.id]=null}},clearCacheAll(){this.cache={}},setCache(e,n,i){this.cache[e.id]={vnode:n,use:!1,parent:i,slot:e.rule.slot}},getCache(e){const n=this.cache[e.id];if(n)return n.use=!0,n.vnode}})}function nO(t){De(t.prototype,{initRender(){this.cacheConfig={}},getTypeSlot(e){const n=i=>{if(i){let o;return e.rule.field&&(o=i.slots["field-"+Do(e.rule.field)]||i.slots["field-"+e.rule.field]),o||(o=i.slots["type-"+Do(e.type)]||i.slots["type-"+e.type]),o||n(i.setupState.parent)}};return n(this.vm)},render(){if(!this.vm.setupState.isShow)return;this.$manager.beforeRender();const e=wr();return this.sort.forEach(n=>{this.renderSlot(e,this.$handle.ctxs[n])}),this.$manager.render(e)},renderSlot(e,n,i){if(this.isFragment(n)){n.initProp(),this.mergeGlobal(n),n.initNone();const o=this.renderChildren(n.loadChildrenPending(),n),r=o.default;r&&e.setSlot(n.rule.slot,()=>r()),delete o.default,e.mergeBag(o)}else e.setSlot(n.rule.slot,this.renderCtx(n,i))},mergeGlobal(e){this.$handle.options.global&&(this.cacheConfig[e.trueType]||(this.cacheConfig[e.trueType]=te(()=>{const n=this.$handle.options.global;return Zn({},[n["*"]||n.default||{},n[e.originType]||n[e.type]||n[e.type]||{}])})),e.prop=Zn({},[this.cacheConfig[e.trueType].value,e.prop]))},setOptions(e){const n=e.loadPending({key:"options",origin:e.prop.options,def:[]});e.prop.options=n,e.prop.optionsTo&&n&&fi(e.prop,e.prop.optionsTo,n)},deepSet(e){const n=e.prop.deep;n&&Object.keys(n).sort((i,o)=>i.length<o.length?-1:1).forEach(i=>{fi(e.prop,i,n[i])})},parseSide(e,n){return pe.Object(e)?Zn({props:{formCreateInject:n.prop.props.formCreateInject}},e):e},renderSides(e,n,i){const o=n[i?"rule":"prop"];return[this.renderRule(this.parseSide(o.prefix,n)),e,this.renderRule(this.parseSide(o.suffix,n))]},renderId(e,n){const i=this.$handle[n==="field"?"fieldCtx":"nameCtx"][e];return i?i.map(o=>this.renderCtx(o,o.parent)):void 0},renderCtx(e,n){try{if(e.type==="hidden")return;const i=e.rule;if(this.force||!this.cache[e.id]||this.cache[e.id].slot!==i.slot){let o;e.initProp(),this.mergeGlobal(e),e.initNone(),this.$manager.tidyRule(e),this.deepSet(e),this.setOptions(e),this.ctxProp(e);let r=e.prop;r.preview=!!(r.preview!=null?r.preview:this.$handle.preview),r.props.formCreateInject=this.injectProp(e);let s=r.cache!==!1;const a=r.preview;if(r.hidden){this.setCache(e,void 0,n);return}o=(...l)=>{var c,u;const d={rule:i,prop:r,preview:a,api:this.$handle.api,model:r.model||{},slotValue:l};l.length&&i.slotUpdate&&Be(()=>i.slotUpdate(d));let h={};const v=e.loadChildrenPending();e.parser.renderChildren?h=e.parser.renderChildren(v,e):e.parser.loadChildren!==!1&&(h=this.renderChildren(v,e)),Object.keys(r.renderSlots||{}).forEach(_=>{h[_]=(...S)=>{if(pe.Function(r.renderSlots[_]))return Be(()=>r.renderSlots[_](...S));const w=this.parseSide(r.renderSlots[_],e);return this.renderRule(w)}});const f=this.getTypeSlot(e);let p;return f?(d.children=h,p=f(d)):p=a?e.parser.preview(ml(h),e):e.parser.render(ml(h),e),p=this.renderSides(p,e),(c=r.title)!=null&&c.show&&(r.wrap=en(Te({},r.wrap||{}),{show:!0}),r.native||(r.native=!1)),(!(!e.input&&pe.Undef(r.native))||((u=r.col)==null?void 0:u.show)===!0)&&r.native!==!0&&(this.fc.targetFormDriver("updateWrap",e),p=this.$manager.makeWrap(e,p)),e.none&&(Array.isArray(p)?p=p.map(_=>!_||!_.__v_isVNode?_:this.none(_)):p=this.none(p)),s&&this.setCache(e,()=>this.stable(p),n),p},this.setCache(e,o,n)}return(...o)=>{const r=this.getCache(e);if(r)return r(...o);if(this.cache[e.id])return;const s=this.renderCtx(e,e.parent);if(s)return s()}}catch(i){console.error(i);return}},none(e){if(e)return e.props.class=this.mergeClass(e.props.class,"fc-none"),e},mergeClass(e,n){if(Array.isArray(e))e.push(n);else return e?[e,n]:n;return e},stable(e){return(Array.isArray(e)?e:[e]).forEach(n=>{n&&n.__v_isVNode&&n.children&&typeof n.children=="object"&&(n.children.$stable=!0,this.stable(n.children))}),e},getModelField(e){return e.prop.modelField||e.parser.modelField||this.fc.modelFields[this.vNode.aliasMap[e.type]]||this.fc.modelFields[e.type]||this.fc.modelFields[e.originType]||"modelValue"},isFragment(e){return e.type==="fragment"||e.type==="template"},injectProp(e){const n=this.vm.setupState;n.ctxInject[e.id]||(n.ctxInject[e.id]={api:this.$handle.api,form:this.fc.create,subForm:o=>{this.$handle.addSubForm(e,o)},getSubForm:()=>this.$handle.subForm[e.id],slots:()=>this.vm.setupState.top.slots,getWrap:()=>this.vm.refs[e.wrapRef],options:[],children:[],preview:!1,id:e.id,field:e.field,rule:e.rule,input:e.input,t:(...o)=>this.$handle.api.t(...o),updateValue:o=>{this.$handle.onUpdateValue(e,o)}});const i=n.ctxInject[e.id];return De(i,{preview:e.prop.preview,options:e.prop.options,children:e.loadChildrenPending()}),i},ctxProp(e){const{ref:n,key:i,rule:o}=e;this.$manager.mergeProp(e),e.parser.mergeProp(e);const r=[{ref:n,key:o.key||`${i}fc`,slot:void 0,on:{vnodeMounted:s=>{s.el.__rule__=e.rule,this.onMounted(e,s.el)},vnodeBeforeUnmount:()=>{this.$handle.effect(e,"beforeUnmount"),this.$handle.targetHook(e,"beforeUnmount")},"fc.updateValue":s=>{this.$handle.onUpdateValue(e,s)},"fc.el":s=>{e.exportEl=s,s&&((s.$el||s).__rule__=e.rule)}}}];if(e.input){const s=this.tmpInput;this.vm.props.disabled===!0&&(e.prop.props.disabled=!0);const a=this.getModelField(e),l={callback:c=>{s&&s(e.field,c,e.rule),this.onInput(e,c)},modelField:a,value:this.$handle.getFormData(e)};r.push({on:Te({[`update:${a}`]:l.callback},e.prop.modelEmit?{[e.prop.modelEmit]:()=>this.onEmitInput(e)}:{}),props:{[a]:l.value}}),e.prop.model=l}return Qn(r,e.prop),e.prop},onMounted(e,n){e.el=this.vm.refs[e.ref]||n,e.parser.mounted(e),this.$handle.effect(e,"mounted"),this.$handle.targetHook(e,"mounted")},onInput(e,n){if(e.prop.modelEmit){this.$handle.onBaseInput(e,n);return}this.$handle.onInput(e,n)},onEmitInput(e){this.$handle.setValue(e,e.parser.toValue(e.modelValue,e),e.modelValue)},renderChildren(e,n){if(!pe.trueArray(e))return{};const i=wr();return e.map(o=>{if(o){if(pe.String(o)||pe.Number(o))return i.setSlot(null,`${o}`);if(o.__fc__)return this.renderSlot(i,o.__fc__,n);o.type&&Ge(()=>{this.$handle.loadChildren(e,n),this.$handle.refresh()})}}),i.getSlots()},defaultRender(e,n){const i=e.prop;return i.component?typeof i.component=="string"?this.vNode.make(i.component,i,n):this.vNode.makeComponent(i.component,i,n):this.vNode[e.type]?this.vNode[e.type](i,n):this.vNode[e.originType]?this.vNode[e.originType](i,n):this.vNode.make(Tm(i.type),i,n)},createChildrenVnodes(e,n,i){this.force=i!==!1,this.tmpInput=n;const o=this.renderChildren(e.rule.children,e);return this.force=!1,this.tmpInput=null,o},createRuleVnode(e,n,i){this.force=i!==!1,this.tmpInput=n;const o=wr();return this.renderSlot(o,e,e.parent),this.force=!1,this.tmpInput=null,o.getSlots()},renderRule(e,n,i){if(!e)return;if(pe.String(e)||pe.Number(e))return`${e}`;let o;if(i)o=e.type;else if(o=e.is,e.type){o=Vt(e.type);const a=this.vNode.aliasMap[o];a&&(o=Vt(a))}if(!o)return;const r=wr();pe.trueArray(e.children)&&e.children.forEach(a=>{a&&r.setSlot(a?.slot,()=>this.renderRule(a))});const s=Te({},e);return delete s.type,delete s.is,this.vNode.make(o,s,r.mergeBag(n).getSlots())}})}let iO=1;function Cc(t){De(this,{$handle:t,fc:t.fc,vm:t.vm,$manager:t.$manager,vNode:new t.fc.CreateNode(t),force:!1,tmpInput:null,id:iO++}),km(this,{options(){return t.options},sort(){return t.sort}}),this.initCache(),this.initRender()}tO(Cc);nO(Cc);function oO(t){De(t.prototype,{parseInjectEvent(e,n){const i=e.inject||this.options.injectEvent;return this.parseEventLst(e,n,i)},parseEventLst(e,n,i,o){return Object.keys(n).forEach(r=>{const s=this.parseEvent(e,n[r],i,o);s&&(n[r]=s)}),n},parseEvent(e,n,i,o){if(pe.Function(n)&&(i!==!1&&!pe.Undef(i)||n.__inject))return this.inject(e,n,i);if(!o&&Array.isArray(n)&&n[0]&&(pe.String(n[0])||pe.Function(n[0])))return this.parseEventLst(e,n,i,!0);if(pe.String(n)){const r=Fn(n);if(r&&n!==r)return r.__inject?this.parseEvent(e,r,i,!0):r}},parseEmit(e){let n={},i=e.rule,{emitPrefix:o,field:r,name:s,inject:a}=i,l=i.emit||[];return pe.trueArray(l)&&l.forEach(c=>{if(!c)return;let u,d=o||r||s;if(pe.Object(c)&&(u=c.inject,c=c.name,d=c.prefix||d),d){const h=Do(`${d}-${c}`),v=(...f)=>{this.vm.emitsOptions&&!this.vm.emitsOptions[h]&&(this.vm.emitsOptions[h]=null),this.vm.emit(h,...f),this.vm.emit("emit-event",h,...f),this.bus.$emit(h,...f)};if(v.__emit=!0,!u&&a===!1)n[Vt(c)]=v;else{let f=u||a||this.options.injectEvent;n[Vt(c)]=pe.Undef(f)?v:this.inject(i,v,f)}}}),e.computed.on=n,n},getInjectData(e,n){const i=e.__fc__&&e.__fc__.$api,o=e.__fc__&&e.__fc__.$handle.vm||this.vm,{option:r,rule:s}=o.props;return{$f:i||this.api,api:i||this.api,rule:s,self:e.__origin__,option:r,inject:n}},inject(e,n,i){if(n.__origin){if(this.watching&&!this.loading)return n;n=n.__origin}const o=this,r=function(...s){const a=o.getInjectData(e,i);return a.args=[...s],s.unshift(a),n.apply(this,s)};return r.__origin=n,r.__json=n.__json,r},loadStrVar(e,n,i){if(e&&typeof e=="string"&&e.indexOf("{{")>-1&&e.indexOf("}}")>-1){const o=e,r=YT(e),s=c=>{let u=!1,d;if(i&&c.indexOf("$form.")===0){const h=c.split(".");h.shift(),lt(i.value,h[0])&&(u=!0,d=n?n({id:"$form."+h[0]+"_"+i.rule.__fc__.id,getValue:()=>Pt(i.value,h)}):Pt(i.value,h))}return u||(d=n?n(c):this.fc.getLoadData(c)),d},a=c=>{const u=[];c.forEach(h=>{h.key?u.push(h.key):h.children&&u.push(a(h.children))});let d=!1;return u.forEach((h,v)=>{h!=null&&(h.indexOf("'")===0||h.indexOf('"')===0)&&(u[v]=h.slice(1,-1),d=!0)}),u.length===1&&(d||!isNaN(Number(u[0])))?u[0]:s(u.join("."))};let l;if(r.forEach(c=>{const u=c.split("||"),d=u[0].trim();if(d){const h=(u[1]||"").trim(),v=Am(d);let f=Be(()=>a(v));(f==null||f==="")&&u.length>1&&(f=h),l=f,e=e.replaceAll(`{{${c}}}`,f??"")}}),r.length===1&&o===`{{${r[0]}}}`)return l}return e},loadFetchVar(e,n,i){let o;i&&i.__fc__&&(o=i.__fc__.getParentGroup()),!o&&e.targetRule&&e.targetRule.__fc__&&(o=e.targetRule.__fc__.getParentGroup());const r=s=>this.loadStrVar(s,n,o?{rule:i,value:this.subRuleData[o.id]||{}}:null);return e.action=r(e.action||""),["headers","data","query"].forEach(s=>{if(e[s]){const a=Array.isArray(e[s])?[]:{};Object.keys(e[s]).forEach(l=>{a[r(l)]=r(e[s][l])}),e[s]=a}}),e}})}const Xd=["hook:updated","hook:mounted"];function rO(t){De(t.prototype,{usePage(){const e=this.options.page;if(!e)return;let n=25,i=sO(this.rules);pe.Object(e)&&(e.first&&(n=parseInt(e.first,10)||n),e.limit&&(i=parseInt(e.limit,10)||i)),De(this,{first:n,limit:i,pageEnd:this.rules.length<=n}),this.bus.$on("page-end",()=>this.vm.emit("page-end",this.api)),this.pageLoad()},pageLoad(){const e=()=>{this.pageEnd?(this.bus.$off(Xd,e),this.bus.$emit("page-end")):(this.first+=this.limit,this.pageEnd=this.rules.length<=this.first,this.loadRule(),this.refresh())};this.bus.$on(Xd,e)}})}function sO(t){return t.length<31?31:Math.ceil(t.length/3)}function aO(t){De(t.prototype,{clearNextTick(){this.nextTick&&clearTimeout(this.nextTick),this.nextTick=null},bindNextTick(e){this.clearNextTick(),this.nextTick=setTimeout(()=>{e(),this.nextTick=null},10)},render(){return++this.loadedId,this.vm.setupState.unique>0?this.$render.render():(this.vm.setupState.unique=1,[])}})}function lO(t){Object.defineProperties(t.origin,{__fc__:_l(Gn(t))}),t.rule!==t.origin&&Object.defineProperties(t.rule,{__fc__:_l(Gn(t))})}function Mm(t,e,n){const i=Ps(),o=!!e.field;De(this,{id:i,ref:i,wrapRef:i+"fi",rule:e,origin:e.__origin__||e,name:e.name,pending:{},none:!1,watch:[],linkOn:[],root:[],ctrlRule:[],children:[],parent:null,group:e.subRule?this:null,cacheConfig:null,prop:Te({},e),computed:{},payload:{},refRule:{},input:o,el:void 0,exportEl:void 0,defaultValue:o?Mn(n):void 0,field:e.field||void 0}),this.updateKey(),lO(this),this.update(t,!0)}De(Mm.prototype,{getParentGroup(){let t=this.parent;for(;t;){if(t.group)return t;t=t.parent}},loadChildrenPending(){const t=this.rule.children||[];return Array.isArray(t)?t:this.loadPending({key:"children",origin:t,def:[],onLoad:e=>{this.$handle&&this.$handle.loadChildren(e,this)},onUpdate:(e,n)=>{this.$handle&&(e===n?this.$handle.loadChildren(e,this):this.$handle.updateChildren(this,e,n))},onReload:e=>{this.$handle?this.$handle.updateChildren(this,[],e):delete this.pending.children}})},loadPending(t){const{key:e,origin:n,def:i,onLoad:o,onReload:r,onUpdate:s}=t;if(this.pending[e]&&this.pending[e].origin===n)return this.getPending(e,i);delete this.pending[e];let a=n;if(pe.Function(n)){let l=Be(()=>n({rule:this.rule,api:this.$api,update:c=>{const u=c||i,d=this.getPending(e,i);this.setPending(e,n,u),s&&s(u,d)},reload:()=>{const c=this.getPending(e,i);delete this.pending[e],r&&r(c),this.$api&&this.$api.sync(this.rule)}}));l&&pe.Function(l.then)?(l.then(c=>{const u=c||i;this.setPending(e,n,u),o&&o(u),this.$api&&this.$api.sync(this.rule)}).catch(c=>{console.error(c)}),a=i,this.setPending(e,n,a)):(a=l||i,this.setPending(e,n,a),o&&o(a))}return a},getPending(t,e){return this.pending[t]&&this.pending[t].value||e},setPending(t,e,n){this.pending[t]={origin:e,value:Mt(n)}},effectData(t){return this.payload[t]||(this.payload[t]={}),this.payload[t]},clearEffectData(t){t===void 0?this.payload={}:delete this.payload[t]},updateKey(t){this.key=Ps(),t&&this.parent&&this.parent.updateKey(t)},updateType(){this.originType=this.rule.type,this.type=Vt(this.rule.type),this.trueType=this.$handle.getType(this.originType)},setParser(t){this.parser=t,t.init(this)},initProp(){var t,e,n;const i=Te({},this.rule);delete i.children,delete i.validate,this.prop=Zn({},[i,...Object.keys(this.payload).map(o=>this.payload[o]),this.computed]),i.col&&((t=i.col)==null?void 0:t.show)!==!1&&(this.prop.col.show=!0),this.prop.validate=[...((n=(e=this.refRule)==null?void 0:e.__$validate)==null?void 0:n.value)||[],...this.prop.validate||[]]},initNone(){this.none=!(pe.Undef(this.prop.display)||this.prop.display)},hasHidden(){return!!this.rule.hidden||(this.parent?this.parent.hasHidden():!1)},injectValidate(){return this.prop.validate},check(t){return this.vm===t.vm},unwatch(){this.watch.forEach(t=>t()),this.watch=[],Object.keys(this.refRule).forEach(t=>{t.indexOf("__$")!==0&&delete this.refRule[t]})},unlink(){this.linkOn.forEach(t=>t()),this.linkOn=[]},link(){this.unlink(),this.$handle.appendLink(this)},watchTo(){this.$handle.watchCtx(this)},delete(){this.unwatch(),this.unlink(),this.rmCtrl(),this.parent&&this.parent.children.splice(this.parent.children.indexOf(this)>>>0,1),De(this,{deleted:!0,computed:{},parent:null,children:[],cacheConfig:null,none:!1})},rmCtrl(){this.ctrlRule.forEach(t=>t.__fc__&&t.__fc__.rm()),this.ctrlRule=[]},rm(){const t=()=>{let e=this.root.indexOf(this.origin);e>-1&&(this.root.splice(e,1),this.$handle&&this.$handle.refresh())};if(this.deleted){t();return}this.$handle.noWatch(()=>{this.$handle.deferSyncValue(()=>{this.rmCtrl(),t(),this.$handle.rmCtx(this),De(this,{root:[]})},this.input)})},update(t,e){De(this,{deleted:!1,$handle:t,$render:t.$render,$api:t.api,vm:t.vm,vNode:t.$render.vNode,updated:!1,cacheValue:this.rule.value}),!e&&this.unwatch(),this.watchTo(),this.link(),this.updateType()}});function cO(t){De(t.prototype,{nextRefresh(e){const n=this.loadedId;Ge(()=>{n===this.loadedId&&(e?e():this.refresh())})},parseRule(e){const n=qd(e);return Object.defineProperties(n,{__origin__:_l(e)}),uO(n),this.appendValue(n),[n,n.prefix,n.suffix].forEach(i=>{i&&this.loadFn(i,n)}),this.loadCtrl(n),n.update&&(n.update=Fn(n.update)),n},loadFn(e,n){["on","props","deep"].forEach(i=>{e[i]&&this.parseInjectEvent(n,e[i])})},loadCtrl(e){e.control&&e.control.forEach(n=>{n.handle&&(n.handle=Fn(n.handle))})},syncProp(e){const n=e.rule;pe.trueArray(n.sync)&&Qn([{on:n.sync.reduce((i,o)=>(i[typeof o=="object"&&o.event||`update:${o}`]=r=>{n.props[typeof o=="object"&&o.prop||o]=r,this.vm.emit("sync",o,r,n,this.fapi)},i),{})}],e.computed)},loadRule(){this.cycleLoad=!1,this.loading=!0,this.pageEnd&&this.bus.$emit("load-start"),this.deferSyncValue(()=>{if(this._loadRule(this.rules),this.loading=!1,this.cycleLoad&&this.pageEnd)return this.loadRule();this.syncForm(),this.pageEnd&&this.bus.$emit("load-end"),this.vm.setupState.renderRule()})},loadChildren(e,n){if(this.cycleLoad=!1,this.loading=!0,this.bus.$emit("load-start"),this._loadRule(e,n),this.loading=!1,this.cycleLoad)return this.loadRule();this.syncForm(),this.bus.$emit("load-end"),this.$render.clearCache(n)},_loadRule(e,n){const i=s=>{let a=e[s-1];if(!a||!a.__fc__)return s>0?i(s-1):-1;let l=this.sort.indexOf(a.__fc__.id);return l>-1?l:i(s-1)},o=(s,a)=>{pe.trueArray(s)&&this._loadRule(s,a)},r=e.map((s,a)=>{if(n&&!pe.Object(s)||!this.pageEnd&&!n&&a>=this.first)return;if(s.__fc__&&s.__fc__.root===e&&this.ctxs[s.__fc__.id])return o(s.__fc__.loadChildrenPending(),s.__fc__),s.__fc__;let l=qd(s);const c=()=>!!(l.field&&this.fieldCtx[l.field]&&this.fieldCtx[l.field][0]!==s.__fc__);this.fc.targetFormDriver("loadRule",{rule:l,api:this.api},this.fc),this.ruleEffect(l,"init",{repeat:c()}),c()&&this.vm.emit("repeat-field",s,this.api);let u,d=!1,h=!!s.__fc__,v=l.value;if(h){if(u=s.__fc__,v=u.defaultValue,u.deleted){if(Jd(u))return;u.update(this)}else if(!u.check(this)){if(Jd(u))return;e[a]=s=s._clone?s._clone():bm(Fo(s)),u=null,d=!0}}if(u)u.originType!==u.rule.type&&u.updateType(),this.bindParser(u),this.appendValue(u.rule),u.parent&&u.parent!==n&&this.rmSubRuleData(u);else{const _=this.parseRule(s);u=new Mm(this,_,v),this.bindParser(u)}this.parseEmit(u),this.syncProp(u),u.parent=n||null,u.root=e,this.setCtx(u),!d&&!h&&(this.effect(u,"load"),this.targetHook(u,"load")),this.effect(u,"created");const f=u.loadChildrenPending();if(u.parser.loadChildren===!1||o(f,u),!n){const _=i(a);_>-1||!a?this.sort.splice(_+1,0,u.id):this.sort.push(u.id)}const p=u.rule;return u.updated||(u.updated=!0,pe.Function(p.update)&&this.bus.$once("load-end",()=>{this.refreshUpdate(u,p.value,"init")}),this.effect(u,"loaded")),this.refreshControl(u)&&(this.cycleLoad=!0),u}).filter(s=>!!s);n&&(n.children=r)},refreshControl(e){return e.input&&e.rule.control&&this.useCtrl(e)},useCtrl(e){const n=dO(e),i=[],o=this.api;if(!n.length)return!1;for(let a=0;a<n.length;a++){const l=n[a],c=l.handle||function(d){return(Ai[l.condition||"=="]||Ai["=="])(d,l.value)};if(!pe.trueArray(l.rule))continue;const u=en(Te({},l),{valid:Be(()=>c(e.rule.value,o)),ctrl:hO(e,l.rule),isHidden:pe.String(l.rule[0])});u.valid&&u.ctrl||!u.valid&&!u.ctrl&&!u.isHidden||i.push(u)}if(!i.length)return!1;const r=[];let s=!1;return this.deferSyncValue(()=>{i.reverse().forEach(({isHidden:a,valid:l,rule:c,prepend:u,append:d,child:h,ctrl:v,method:f})=>{if(a){l?e.ctrlRule.push({__ctrl:!0,children:c,valid:l}):v&&e.ctrlRule.splice(e.ctrlRule.indexOf(v)>>>0,1),r[l?"push":"unshift"](()=>{f==="disabled"||f==="enabled"?this.api.disabled(!l,c):f==="display"||f==="show"?this.api.display(l,c):f==="required"?(c.forEach(p=>{this.api.setEffect(p,"required",l)}),l||this.api.clearValidateState(c)):f==="if"?this.api.hidden(!l,c):this.api.hidden(!l,c)});return}if(l){s=!0;const p={type:"fragment",native:!0,__ctrl:!0,children:c};e.ctrlRule.push(p),this.bus.$once("load-start",()=>{u?o.prepend(p,u,h):d||h?o.append(p,d||e.id,h):e.root.splice(e.root.indexOf(e.origin)+1,0,p)})}else{e.ctrlRule.splice(e.ctrlRule.indexOf(v),1);const p=kn(v);p&&p.rm()}})}),r.length&&(this.loading?r.length&&this.bus.$once("load-end",()=>{r.forEach(a=>a())}):r.length&&Ge(()=>{r.forEach(a=>a())})),this.vm.emit("control",e.origin,this.api),this.effect(e,"control"),s},reloadRule(e){return this._reloadRule(e)},_reloadRule(e){e||(e=this.rules);const n=Te({},this.ctxs);this.clearNextTick(),this.initData(e),this.fc.rules=e,this.deferSyncValue(()=>{this.bus.$once("load-end",()=>{Object.keys(n).filter(i=>this.ctxs[i]===void 0).forEach(i=>this.rmCtx(n[i])),this.$render.clearCacheAll()}),this.reloading=!0,this.loadRule(),this.reloading=!1,this.refresh(),this.bus.$emit("reloading",this.api)}),this.bus.$off("next-tick",this.nextReload),this.bus.$once("next-tick",this.nextReload),this.bus.$emit("update",this.api)},refresh(){this.vm.setupState.refresh()}})}function uO(t){const e=Pm();return Object.keys(e).forEach(n=>{lt(t,n)||(t[n]=e[n])}),t}function dO(t){const e=t.rule.control||[];return pe.Object(e)?[e]:e}function hO(t,e){for(let n=0;n<t.ctrlRule.length;n++){const i=t.ctrlRule[n];if(i.children===e)return i}}function Jd(t){return!!t.rule.__ctrl}function pO(t){De(t.prototype,{setValue(e,n,i,o){e.deleted||(e.rule.value=n,this.changeStatus=!0,this.nextRefresh(),this.$render.clearCache(e),this.setFormData(e,i),this.syncValue(),this.valueChange(e,n),this.vm.emit("change",e.field,n,e.origin,this.api,o||!1),this.effect(e,"value"),this.targetHook(e,"value",{value:n}),this.emitEvent("change",e.field,n,{rule:e.origin,api:this.api,setFlag:o||!1}),o&&Ge(()=>{Ge(()=>{Ge(()=>{this.api.clearValidateState(e.id)})})}),this.$manager.fieldChange(e,n,i,o))},onInput(e,n){let i;e.input&&(this.isQuote(e,i=e.parser.toValue(n,e))||this.isChange(e,n))&&this.setValue(e,i,n)},onUpdateValue(e,n){this.deferSyncValue(()=>{const i=e.getParentGroup(),o=i?this.subRuleData[i.id]:null,r={};Object.keys(n||{}).forEach(s=>{o&<(o,s)?r[s]=n[s]:lt(this.api.form,s)?this.api.form[s]=n[s]:this.api.top!==this.api&<(this.api.top.form,s)&&(this.api.top.form[s]=n[s])}),Object.keys(r).length&&this.api.setChildrenFormData(i.rule,r)})},onBaseInput(e,n){this.setFormData(e,n),e.modelValue=n,this.nextRefresh(),this.$render.clearCache(e)},setFormData(e,n){e.modelValue=n;const i=e.getParentGroup();i&&(this.subRuleData[i.id]||(this.subRuleData[i.id]={}),this.subRuleData[i.id][e.field]=e.rule.value),an(this.formData,e.id,n)},rmSubRuleData(e){const n=e.getParentGroup();n&&this.subRuleData[n.id]&&delete this.subRuleData[n.id][e.field]},getFormData(e){return this.formData[e.id]},syncForm(){const e=Mt({}),n=this.fields(),i=[];this.options.appendValue!==!1&&Object.keys(this.appendData).reduce((o,r)=>(n.indexOf(r)===-1&&(o[r]=$t(this.appendData,r)),o),e),n.reduce((o,r)=>{let s=(this.fieldCtx[r]||[]).filter(a=>!this.isIgnore(a))[0];return s||(s=this.fieldCtx[r][0],i.push(r)),o[r]=$t(s.rule,"value"),o},e),this.form=e,this.ignoreFields=i,this.syncValue()},isIgnore(e){return e.rule.ignore===!0||(e.rule.ignore==="hidden"||this.options.ignoreHiddenFields)&&e.hasHidden()},appendValue(e){(!e.field||!lt(this.appendData,e.field))&&(!pe.Undef(e.value)||!this.options.forceCoverValue)||(e.value=this.appendData[e.field],delete this.appendData[e.field])},addSubForm(e,n){this.subForm[e.id]=n},deferSyncValue(e,n){this.deferSyncFn||(this.deferSyncFn=e),this.deferSyncFn.sync||(this.deferSyncFn.sync=n),Be(e),this.deferSyncFn===e&&(this.deferSyncFn=null,e.sync&&this.syncForm())},syncValue(){if(this.deferSyncFn)return this.deferSyncFn.sync=!0;const e={};Object.keys(this.form).forEach(n=>{this.ignoreFields.indexOf(n)===-1&&(e[n]=this.form[n])}),this.vm.setupState.updateValue(e)},isChange(e,n){return JSON.stringify(this.getFormData(e),Zd)!==JSON.stringify(n,Zd)},isQuote(e,n){return(n instanceof Function||pe.Object(n)||Array.isArray(n))&&n===e.rule.value},refreshUpdate(e,n,i,o){if(pe.Function(e.rule.update)){const r=Be(()=>e.rule.update(n,e.origin,this.api,{origin:i||"change",linkField:o}));if(r===void 0)return;e.rule.hidden=r===!0}},valueChange(e,n){this.refreshRule(e,n),this.bus.$emit("change-"+e.field,n)},refreshRule(e,n,i,o){this.refreshControl(e)&&(this.$render.clearCacheAll(),this.loadRule(),this.bus.$emit("update",this.api),this.refresh()),this.refreshUpdate(e,n,i,o)},appendLink(e){const n=e.rule.link;pe.trueArray(n)&&n.forEach(i=>{const o=()=>this.refreshRule(e,e.rule.value,"link",i);this.bus.$on("change-"+i,o),e.linkOn.push(()=>this.bus.$off("change-"+i,o))})},fields(){return Object.keys(this.fieldCtx)}})}function Zd(t,e){return typeof e=="function"?""+e:e}const xo={init(t){},toFormValue(t,e){return t},toValue(t,e){return t},mounted(t){},render(t,e){return e.$handle.fc.renderDriver&&e.$handle.fc.renderDriver.defaultRender?e.$handle.fc.renderDriver.defaultRender(e,t):e.$render.defaultRender(e,t)},preview(t,e){return e.$handle.fc.renderDriver&&e.$handle.fc.renderDriver.defaultPreview?e.$handle.fc.renderDriver.defaultPreview(e,t):this.render(t,e)},mergeProp(t){}},fO=["field","value","vm","template","name","config","control","inject","sync","payload","optionsTo","update","slotUpdate","computed","component","cache"],Eo=Symbol("oldValue");function mO(t){De(t.prototype,{getCtx(e){return this.getFieldCtx(e)||this.getNameCtx(e)[0]||this.ctxs[e]},getCtxs(e){return this.fieldCtx[e]||this.nameCtx[e]||(this.ctxs[e]?[this.ctxs[e]]:[])},setIdCtx(e,n,i){const o=`${i}Ctx`;this[o][n]?this[o][n].push(e):this[o][n]=[e]},rmIdCtx(e,n,i){const o=`${i}Ctx`,r=this[o][n];if(!r)return!1;const s=r.splice(r.indexOf(e)>>>0,1).length>0;return r.length||delete this[o][n],s},getFieldCtx(e){return(this.fieldCtx[e]||[])[0]},getNameCtx(e){return this.nameCtx[e]||[]},setCtx(e){let{id:n,field:i,name:o,rule:r}=e;this.ctxs[n]=e,o&&this.setIdCtx(e,o,"name"),e.input&&(this.setIdCtx(e,i,"field"),this.setFormData(e,e.parser.toFormValue(r.value,e)),this.isMounted&&!this.reloading&&this.vm.emit("change",e.field,r.value,e.origin,this.api,!1,!0))},getParser(e){const n=this.fc.parsers,i=this.fc.renderDriver;if(i){const o=i.parsers||{},r=o[e.originType]||o[Vt(e.type)]||o[e.trueType];if(r)return r}return n[e.originType]||n[Vt(e.type)]||n[e.trueType]||xo},bindParser(e){e.setParser(this.getParser(e))},getType(e){const n=this.fc.CreateNode.aliasMap,i=n[e]||n[Vt(e)]||e;return Vt(i)},noWatch(e){this.noWatchFn||(this.noWatchFn=e),Be(e),this.noWatchFn===e&&(this.noWatchFn=null)},watchCtx(e){if(xm().filter(n=>n[0]!=="_"&&n[0]!=="$"&&fO.indexOf(n)===-1).forEach(n=>{const i=$t(e.rule,n),o=n==="children";e.refRule[n]=i,e.watch.push(Oe(o?()=>pe.Function(i.value)?i.value:[...i.value||[]]:()=>i.value,(r,s)=>{let a=i.value;if(!this.isBreakWatch()){if(o&&e.parser.loadChildren===!1){this.$render.clearCache(e),this.nextRefresh();return}if(this.watching=!0,Ge(()=>{this.targetHook(e,"watch",{key:n,oldValue:s,newValue:a})}),n==="hidden"&&!!a!=!!s&&(this.$render.clearCacheAll(),Ge(()=>{this.targetHook(e,"hidden",{value:a})})),n==="ignore"&&e.input||n==="hidden"&&(e.rule.ignore==="hidden"||this.options.ignoreHiddenFields))this.syncForm();else if(n==="link"){e.link();return}else["props","on","deep"].indexOf(n)>-1?(this.parseInjectEvent(e.rule,a||{}),n==="props"&&e.input&&this.setFormData(e,e.parser.toFormValue(e.rule.value,e))):n==="emit"?this.parseEmit(e):["prefix","suffix"].indexOf(n)>-1?a&&this.loadFn(a,e.rule):n==="type"?(e.updateType(),this.bindParser(e)):o&&(pe.Function(s)&&(s=e.getPending("children",[])),pe.Function(a)&&(a=e.loadChildrenPending()),this.updateChildren(e,a,s));this.$render.clearCache(e),this.refresh(),this.watching=!1}},{deep:!o,sync:o}))}),e.refRule.__$title=te(()=>{let n=(typeof e.rule.title=="object"?e.rule.title.title:e.rule.title)||"";if(n){const i=n.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);i&&(n=this.api.t(i[1]))}return n}),e.refRule.__$info=te(()=>{let n=(typeof e.rule.info=="object"?e.rule.info.info:e.rule.info)||"";if(n){const i=n.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);i&&(n=this.api.t(i[1]))}return n}),e.refRule.__$validate=te(()=>{const n=i=>{var o,r;const s=i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);return s?this.api.t(s[1],{title:(r=(o=e.refRule)==null?void 0:o.__$title)==null?void 0:r.value}):i};return zt(e.rule.validate).map(i=>{const o=Te({},i);if(o.message&&(o.message=n(o.message)),pe.Function(o.validator)){const r=e;o.validator=function(...s){return i.validator.call({that:this,id:r.id,field:r.field,rule:r.rule,api:r.$handle.api},...s)}}if(o.adapter){if(typeof o.error=="object"){const r=Te({},o.error);Object.keys(r).forEach(s=>{r[s]=n(r[s])}),o.error=r}return this.adapterValidate(o,e)}return o})}),e.input){const n=$t(e.rule,"value");e.watch.push(Oe(()=>n.value,()=>{let i=e.parser.toFormValue(n.value,e);this.isChange(e,i)&&this.setValue(e,n.value,i,!0)}))}this.bus.$once("load-end",()=>{let n=e.rule.computed;n&&(typeof n!="object"&&(n={value:n}),Object.keys(n).forEach(i=>{const o=te(()=>{const s=n[i];if(!s)return;const a=this.compute(e,s);return(s.linkage||s.linkageVariable)&&a===Eo?Eo:a}),r=s=>{i==="value"?this.onInput(e,s):i[0]==="$"?this.api.setEffect(e.id,i,s):fi(e.rule,i,s)};(i==="value"?[void 0,null,""].indexOf(e.rule.value)>-1:o.value!==Pt(e.rule,i))&&r(o.value),e.watch.push(Oe(o,s=>{s!==Eo&&setTimeout(()=>{r(s)})},{deep:!0}))}))}),this.watchEffect(e)},adapterValidate(e,n){const i=(o,r)=>{if((e.beforeValidate&&Be(()=>e.beforeValidate({value:o,api:this.api,validate:e,rule:n.rule})))===!1)r();else{const s=this.validator(n,o,e);if(s){let a="";typeof e.error=="object"&&(a=e.error[s]||e.error.default),!a&&typeof e.message=="string"&&(a=e.message),a||(a=this.getValidateMessage(n,{key:s,rule:e[s]})),r(a)}else if(e.validator){const a=e.validator&&Be(()=>e.validator(o,r));a&&pe.Function(a.then)&&a.then(()=>r()).catch(l=>r(l))}else r()}};return this.$manager.adapterValidate({required:e.required,message:e.message,trigger:e.trigger},i)},getValidateMessage(e,n){var i,o;const r=Array.isArray(n.rule)?n.rule.join(","):""+n.rule;return this.api.t(n.key==="required"?n.key:"validate."+n.key,{[n.key]:r,title:(o=(i=e.refRule)==null?void 0:i.__$title)==null?void 0:o.value})},validator(e,n,i){if(pe.empty(n))return i.required?"required":void 0;for(const[o,r]of Object.entries(i))switch(o){case"len":case"maxLen":case"minLen":const s=l=>o==="len"?l===r:o==="maxLen"?l<=r:l>=r;if(Array.isArray(n)){if(!s(n.length))return o}else if(typeof n=="object"||!s((""+n).length))return o;break;case"pattern":if(!(typeof r=="string"?new RegExp(r):r).test(""+n))return o;break;case"uppercase":if(r&&(typeof n!="string"||!/^[A-Z]*$/.test(n)))return o;break;case"lowercase":if(r&&(typeof n!="string"||!/^[a-z]*$/.test(n)))return o;break;case"min":case"max":case"positive":case"negative":case"integer":case"number":const a=Number(n);if(Number.isNaN(a)||o==="min"&&a<r||o==="max"&&a>r||o==="positive"&&a<=0||o==="negative"&&a>=0||o==="integer"&&!Number.isInteger(a))return o;break;case"equal":if(n!==r)return o;break;case"enum":if(Array.isArray(r)&&!r.includes(n))return o;break;case"hasKeys":if(typeof n!="object"||Array.isArray(r)&&r.some(l=>!(l in n)))return o;break;case"email":if(!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(""+n))return o;break;case"url":if(!new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i").test(""+n))return o;break;case"ip":if(!/^(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})(\.(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})){3}$/.test(""+n))return o;break;case"phone":if(!/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(""+n))return o;break;case"computed":if(!this.compute(e,r))return o;break}},compute(e,n){let i;if(typeof n=="object"){const o=e.getParentGroup(),r=a=>{if(a=Array.isArray(a)?{mode:"AND",group:a}:a,!pe.trueArray(a.group))return!0;const l=a.mode==="OR";let c=!0;for(let u=0;u<a.group.length;u++){const d=a.group[u];let h,v=null,f=null;if(d.variable)f=this.fc.getLoadData(d.variable);else if(d.field)v=Yd(d.field||"");else if(!d.mode)return!0;let p=d.compare;if(p&&(p=Yd(p||"")),d.mode?h=r(d):Ai[d.condition]?pe.Function(d.handler)?h=Be(()=>d.handler(this.api,e.rule)):h=Be(()=>new Function("$condition","$variableVal","$val","$form","$scope","$group","$rule",`with($form){with($scope){with(this){with($group){ return $condition['${d.condition}'](${d.variable?"$variableVal":v}, ${p||"$val"}); }}}}`).call(this.api.form,Ai,f,d.value,this.api.top.form,this.api.top===this.api.scope?{}:this.api.scope.form,o?this.subRuleData[o.id]||{}:{},e.rule)):h=!1,l&&h)return!0;l||(c=c&&h)}return l?!1:c};let s=r(n);return s=n.invert===!0?!s:s,n.linkage?s?Be(()=>this.computeValue(n.linkage,e,o),void 0):Eo:n.linkageVariable?s?Be(()=>this.fc.getLoadData(n.linkageVariable),void 0):Eo:s}else if(pe.Function(n))i=()=>n(this.api.form,this.api,e.rule);else{const o=e.getParentGroup();i=()=>this.computeValue(n,e,o)}return Be(i,void 0)},computeValue(e,n,i){const o=this,r=Object.keys(this.fc.formulas).reduce((s,a)=>(s[a]=function(...l){return o.fc.formulas[a].call({that:this,rule:n.rule,api:o.api,fc:o.fc},...l)},s),{});return Be(()=>new Function("$formulas","$form","$scope","$group","$rule","$api",`with($form){with($scope){with(this){with($group){with($formulas){ return ${e} }}}}}`).call(this.api.form,r,this.api.top.form,this.api.top===this.api.scope?{}:this.api.scope.form,i?this.subRuleData[i.id]||{}:{},n.rule,this.api),void 0)},updateChildren(e,n,i){this.deferSyncValue(()=>{i&&i.forEach(o=>{(n||[]).indexOf(o)===-1&&o&&!pe.String(o)&&o.__fc__&&o.__fc__.parent===e&&this.rmCtx(o.__fc__)}),pe.trueArray(n)&&(this.loadChildren(n,e),this.bus.$emit("update",this.api))})},rmSub(e){pe.trueArray(e)&&e.forEach(n=>{n&&n.__fc__&&this.rmCtx(n.__fc__)})},rmCtx(e){if(e.deleted)return;const{id:n,field:i,input:o,name:r}=e;Ei(this.ctxs,n),Ei(this.formData,n),Ei(this.subForm,n),Ei(this.vm.setupState.ctxInject,n);const s=e.getParentGroup();s&&this.subRuleData[s.id]&&Ei(this.subRuleData[s.id],i),e.group&&Ei(this.subRuleData,n),o&&this.rmIdCtx(e,i,"field"),r&&this.rmIdCtx(e,r,"name"),o&&!lt(this.fieldCtx,i)&&Ei(this.form,i),this.deferSyncValue(()=>{if(!this.reloading){if(e.parser.loadChildren!==!1){const l=e.getPending("children",e.rule.children);pe.trueArray(l)&&l.forEach(c=>c&&c.__fc__&&this.rmCtx(c.__fc__))}e.root===this.rules&&this.vm.setupState.renderRule()}},o);const a=this.sort.indexOf(n);return a>-1&&this.sort.splice(a,1),this.$render.clearCache(e),e.delete(),this.effect(e,"deleted"),this.targetHook(e,"deleted"),o&&!this.fieldCtx[i]&&this.vm.emit("remove-field",i,e.rule,this.api),e.rule.__ctrl||this.vm.emit("remove-rule",e.rule,this.api),e}})}function vO(t){De(t.prototype,{mounted(){const e=()=>{this.isMounted=!0,this.lifecycle("mounted")};this.pageEnd?e():this.bus.$once("page-end",e)},lifecycle(e){this.fc.targetFormDriver(e,this.api,this.fc),this.vm.emit(e,this.api),this.emitEvent(e,this.api)},emitEvent(e,...n){const i=this.options[e]||this.options[Vt("on-"+e)];if(i){const o=Fn(i);pe.Function(o)&&Be(()=>o(...n))}this.bus.$emit(e,...n)},targetHook(e,n,i){var o,r,s,a;let l=(r=(o=e.prop)==null?void 0:o.hook)==null?void 0:r[n],c=(h,v)=>{h&&(h=Array.isArray(h)?h:[h],h.forEach(f=>{Be(()=>f(en(Te({args:Object.values(i||{})},i||{}),{self:e.rule,rule:e.rule,parent:v?.rule,$f:this.api,api:this.api,option:this.vm.props.option})))}))};c(l);let u="deep"+_m(n),d=e.parent;for(;d;){let h=(a=(s=d.prop)==null?void 0:s.hook)==null?void 0:a[u];c(h,d),d=d.parent}}})}function gO(t){De(t.prototype,{useProvider(){const e=this.fc.providers;Object.keys(e).forEach(n=>{let i=e[n];pe.Function(i)&&(i=i(this.fc)),i._c=yO(i),this.onEffect(i,n),this.providers[n]=i})},onEffect(e,n){const i=[];(e._c||["*"]).forEach(o=>{const r=o==="*"?"*":this.getType(o);i.indexOf(r)>-1||(i.push(r),this.bus.$on(`p:${n||e.name}:${r}:${e.input?1:0}`,(s,a)=>{e[s]&&e[s](...a)}))}),e._used=i},watchEffect(e){let n={required:()=>{var i,o;return(lt(e.rule,"$required")?e.rule.$required:(o=(i=e.rule)==null?void 0:i.effect)==null?void 0:o.required)||!1}};Object.keys(e.rule.effect||{}).forEach(i=>{n[i]=()=>e.rule.effect[i]}),Object.keys(e.rule).forEach(i=>{i[0]==="$"&&(n[i.substr(1)]=()=>e.rule[i])}),Object.keys(n).forEach(i=>{e.watch.push(Oe(n[i],o=>{this.effect(e,"watch",{[i]:o})},{deep:!0}))})},ruleEffect(e,n,i){this.emitEffect({rule:e,input:!!e.field,type:this.getType(e.type)},n,i)},effect(e,n,i){this.emitEffect({rule:e.rule,input:e.input,type:e.trueType,ctx:e,custom:i},n)},getEffect(e,n){if(lt(e,"$"+n))return e["$"+n];if(lt(e,"effect")&<(e.effect,n))return e.effect[n]},emitEffect({ctx:e,rule:n,input:i,type:o,custom:r},s,a){if(!o||["fcFragment","fragment"].indexOf(o)>-1)return;const l=r||Object.keys(n).reduce((c,u)=>(u[0]==="$"&&(c[u.substr(1)]=n[u]),c),Te({},n.effect||{}));Object.keys(l).forEach(c=>{const u=this.providers[c];if(!u||u.input&&!i)return;let d;if(!u._c)d="*";else if(u._used.indexOf(o)>-1)d=o;else return;const h=Te({value:l[c],getValue:()=>this.getEffect(n,c)},a||{});e&&(h.getProp=()=>e.effectData(c),h.clearProp=()=>e.clearEffectData(c),h.mergeProp=v=>Zn(h.getProp(),[v]),h.id=e.id),this.bus.$emit(`p:${c}:${d}:${u.input?1:0}`,s,[h,n,this.api])})}})}function _O(t){return t.filter(function(e,n,i){return i.indexOf(e,0)===n})}function yO(t){const e=t.components;if(Array.isArray(e)){const n=_O(e.filter(i=>i!=="*"));return n.length?n:!1}else return pe.String(e)?[e]:!1}function Un(t){km(this,{options(){return t.options.value||{}},bus(){return t.bus},preview(){return t.vm.props.preview!=null?t.vm.props.preview:t.vm.setupState.parent&&t.vm.setupState.parent.props.preview!=null?t.vm.setupState.parent.props.preview:t.options.value.preview||!1}}),De(this,{fc:t,vm:t.vm,watching:!1,loading:!1,reloading:!1,noWatchFn:null,deferSyncFn:null,isMounted:!1,formData:Mt({}),subRuleData:Mt({}),subForm:{},form:Mt({}),appendData:{},ignoreFields:[],providers:{},cycleLoad:null,loadedId:1,nextTick:null,changeStatus:!1,pageEnd:!0,nextReload:()=>{this.lifecycle("reload")}}),this.initData(t.rules),this.$manager=new t.manager(this),this.$render=new Cc(this),this.api=t.extendApiFn.reduce((e,n)=>{const i=Be(()=>n(e,this));return i&&i!==e&&De(e,i),e},eO(this))}De(Un.prototype,{initData(t){De(this,{ctxs:{},fieldCtx:{},nameCtx:{},sort:[],rules:t})},init(){this.updateAppendData(),this.useProvider(),this.usePage(),this.loadRule(),this.$manager.__init(),this.lifecycle("created")},updateAppendData(){this.appendData=Te(Te(Te({},Mn(this.options.formData||{})),this.fc.vm.props.modelValue||{}),this.appendData)},isBreakWatch(){return this.loading||this.noWatchFn||this.reloading},globalBeforeFetch(t){return new Promise((e,n)=>{const i=this.options.beforeFetch&&Be(()=>this.options.beforeFetch(t,{api:this.api}));i&&pe.Function(i.then)?i.then(e).catch(n):e()})},beforeFetch(t){return new Promise((e,n)=>{const i=t&&t.beforeFetch&&Be(()=>t.beforeFetch(t,{api:this.api}));i&&pe.Function(i.then)?i.then(e).catch(n):i===!1?n():e()}).then(()=>this.globalBeforeFetch(t))},beforeSubmit(t){return new Promise((e,n)=>{const i=this.options.beforeSubmit&&Be(()=>this.options.beforeSubmit(t,{api:this.api}));i&&pe.Function(i.then)?i.then(e).catch(n):i===!1?n():e()})}});oO(Un);rO(Un);aO(Un);cO(Un);pO(Un);mO(Un);vO(Un);gO(Un);const bO="fcFragment",ua=Se({name:bO,inheritAttrs:!1,props:["vnode"],render(){return this.vnode}});function wO(t){return Object.keys(t).map(e=>{const n=t[e],i=w_(e);if(i)return[i,n.value,n.arg,n.modifiers]}).filter(e=>!!e)}function eh(t,e){let n=t.directives;return n?(Array.isArray(n)||(n=[n]),it(e,n.reduce((i,o)=>i.concat(wO(o)),[]))):e}function EO(){const t={};function e(n){this.vm=n.vm,this.handle=n}return De(e.prototype,{make(n,i,o){return eh(i,this.h(n,Wd(i),o))},makeComponent(n,i,o){try{return eh(i,j(n,Wd(i),o))}catch(r){return console.error(r),j("")}},h(n,i,o){const r=(this.vm||Ja()).appContext.config.isNativeTag(n),s=this.handle.fc.prop.components[n];!s&&r&&delete i.formCreateInject;try{return j(s||(r?n:ze(n)),i,o)}catch(a){return console.error(a),j("")}},aliasMap:t}),De(e,{aliasMap:t,alias(n,i){t[n]=i},use(n){Object.keys(n).forEach(i=>{const o=Do(i),r=gm(i).toLocaleLowerCase(),s=n[i];e.alias(i,s),[i,o,r].forEach(a=>{e.prototype[a]=function(l,c){return this.make(t[i]||a,l,c)}})})}}),e}function SO(t){class e extends Dm{}return Object.assign(e.prototype,t),e}function Dm(t){De(this,{$handle:t,vm:t.vm,options:{},ref:"fcForm",mergeOptionsRule:{normal:["form","row","info","submitBtn","resetBtn"]}}),this.updateKey(),this.init()}De(Dm.prototype,{__init(){this.$render=this.$handle.$render,this.$r=(...t)=>this.$render.renderRule(...t)},updateKey(){this.key=Ps()},init(){},update(){},beforeRender(){},form(){return this.vm.refs[this.ref]},adapterValidate(t,e){return t.validator=(n,i,o)=>e(i,o),t},getSlot(t){const e=n=>{if(n)return n.slots[t]||e(n.setupState.parent)};return e(this.vm)},mergeOptions(t,e){return Qn(t.map(n=>this.tidyOptions(n)),e,this.mergeOptionsRule)},updateOptions(t){this.$handle.fc.targetFormDriver("updateOptions",t,{handle:this.$handle,api:this.$handle.api}),this.options=this.mergeOptions([t],this.getDefaultOptions()),this.update()},tidyOptions(t){return t},tidyRule(t){},mergeProp(t){},getDefaultOptions(){return{}},fieldChange(t,e,n,i){},render(t){}});const CO=function(t){const e={name:"loadData",_fn:[],loaded(n,i,o){this.deleted(n),Ge(()=>{let r=zt(n.getValue());const s=[];r.forEach(a=>{if(a&&(a.attr||a.template)){let l=d=>{let h;i&&i.__fc__&&(h=i.__fc__.getParentGroup());let v;a.template?v=t.$handle.loadStrVar(a.template,d,h?{rule:i,value:t.$handle.subRuleData[h.id]||{}}:null):a.handler&&pe.Function(a.handler)?v=a.handler(d,i,o):v=t.$handle.loadStrVar(`{{${a.attr}}}`,d,h?{rule:i,value:t.$handle.subRuleData[h.id]||{}}:null),(v==null||v==="")&&a.default!=null&&(v=a.default),a.copy!==!1&&(v=Mn(v));const f=a.modify?i:n.getProp();a.to==="child"?f.children?f.children[0]=v:f.children=[v]:fi(f,a.to||"options",v),o.sync(i)},c=d=>l(d);const u=t.watchLoadData(c);l=ci(l,a.wait||300),a.watch!==!1?s.push(u):u()}}),this._fn[n.id]=s})},deleted(n){this._fn[n.id]&&(this._fn[n.id].forEach(i=>{i()}),delete this._fn[n.id]),n.clearProp()}};return e.watch=e.loaded,e},xO=function(t){const e={name:"t",_fn:[],loaded(n,i,o){this.deleted(n);let r=n.getValue()||{};const s=[];Object.keys(r).forEach(a=>{const l=r[a];if(l){const c=typeof l=="object";let u=v=>{let f=t.t(c?l.attr:l,c?l.params:null,v);const p=c&&l.modify?i:n.getProp();a==="child"?p.children?p.children[0]=f:p.children=[f]:fi(p,a,f),o.sync(i)},d=v=>u(v);const h=t.watchLoadData(d);u=ci(u,l.wait||300),l.watch!==!1?s.push(h):h()}}),this._fn[n.id]=s},deleted(n){this._fn[n.id]&&(this._fn[n.id].forEach(i=>{i()}),delete this._fn[n.id]),n.clearProp()}};return e.watch=e.loaded,e},Fm={name:"componentValidate",load(t,e,n){let i=t.getValue();if(!i||i.method===!1)t.clearProp(),n.clearValidateState([e.field]);else{pe.Object(i)||(i={method:i});const o=i.method,r=en(Te({},i),{validator(...s){const a=kn(e);if(a)return n.exec(a.id,pe.String(o)?o:"formCreateValidate",...s,{attr:t,rule:e,api:n})}});delete r.method,t.getProp().validate=[r]}},watch(...t){Fm.load(...t)}},TO=function(t){function e(o){return pe.String(o)&&(o={action:o,to:"options"}),o}function n(o,r,s){let a=o.value;i.deleted(o),pe.Function(a)&&(a=a(r,s)),a=e(a);const l=d=>{d===void 0?o.clearProp():fi(o.getProp(),a.to||"options",d),d!=null&&a&&a.key&&t.$handle.options.globalData[a.key]&&t.fetchCache.set(t.$handle.options.globalData[a.key],{status:!0,data:d}),s.sync(r)};if(!a||!a.action&&!a.key){l(void 0);return}a=Mn(a),a.to||(a.to="options");const c=a.onError,u=()=>{if(!o.getValue())return o.clearProp(),s.sync(r),!0};i._fn[o.id]=t.watchLoadData(ci((d,h)=>{if(h&&a.watch===!1)return i._fn[o.id]();if(a.key){t.targetRule=r;const p=d("$globalData."+a.key);if(delete t.targetRule,p){if(u())return;l(p)}return}const v=t.$handle.loadFetchVar(Mn(a),d,r),f=en(Te({headers:{}},v),{onSuccess(p,_){if(u())return;let S=E=>_?E:lt(E,"data")?E.data:E;const w=Fn(v.parse);pe.Function(w)?S=w:w&&pe.String(w)&&(S=E=>Pt(E,w)),as(S(p,r,s)).then(E=>{l(E)})},onError(p){l(void 0),!u()&&(c||(_=>bc(_.message||"fetch fail "+v.action)))(p,r,s)}});t.$handle.beforeFetch(f,{rule:r,api:s}).then(()=>{if(pe.Function(v.action)){as(v.action(r,s)).then(p=>{f.onSuccess(p,!0)}).catch(p=>{f.onError(p)});return}Be(()=>t.create.fetch(f,{inject:o,rule:r,api:s}))}).catch(p=>{})},a.wait||600))}const i={name:"fetch",_fn:[],loaded(...o){n(...o)},watch(...o){n(...o)},deleted(o){this._fn[o.id]&&(this._fn[o.id](),delete this._fn[o.id]),o.clearProp()}};return i},OO={fetch:TO,loadData:CO,t:xO,componentValidate:Fm},$O="html",kO={name:$O,loadChildren:!1,render(t,e){return e.prop.props.innerHTML=t.default(),e.vNode.make(e.prop.props.tag||"div",e.prop)},renderChildren(t){return{default:()=>t.filter(e=>pe.String(e)).join("")}}};function AO(t){t=t+"=";const e=decodeURIComponent(document.cookie).split(";");for(let n=0;n<e.length;n++){let i=e[n];for(;i.charAt(0)===" ";)i=i.substring(1);if(i.indexOf(t)===0){i=i.substring(t.length,i.length);try{return JSON.parse(i)}catch{return i}}}return null}function PO(t){const e=localStorage.getItem(t);if(e)try{return JSON.parse(e)}catch{return e}return null}function RO(t){const e=sessionStorage.getItem(t);if(e)try{return JSON.parse(e)}catch{return e}return null}function xc(t,e){if(!e)return null;const n=e.split(".");let i=t(n.shift());return n.length?i==null?null:Pt(i,n):i}function IO(t){return xc(AO,t)}function MO(t){return xc(PO,t)}function DO(t){return xc(RO,t)}const FO={en:{required:"{title} is required",validate:{url:"{title} is not a valid url",email:"{title} is not a valid email",ip:"{title} {title} is not a valid ip",phone:"{title} {title} is not a valid phone",pattern:"{title} does not match pattern {pattern}",uppercase:"{title} must be all uppercase",lowercase:"{title} must be all lowercased",positive:"{title} is not a positive number",negative:"{title} is not a negative number",equal:"{title} is not equal to {equal}",min:"{title} cannot be less than {min}",max:"{title} cannot be greater than {max}",enum:"{title} must be one of {enum}",hasKeys:"{title} does not contain required fields {hasKeys}",minLen:"{title} must be at least {minLen}",maxLen:"{title} cannot be longer than {maxLen}",len:"{title} must be exactly {len}",integer:"{title} is not an integer",number:"{title} is not an number"}},"zh-cn":{required:"{title}不能为空",validate:{url:"{title}不是有效的 url 地址",email:"{title}不是有效的邮箱地址",ip:"{title}不是有效的 IP 地址",phone:"{title}不是正确的手机号",pattern:"{title}必须匹配 {pattern}",uppercase:"{title}必须全大写",lowercase:"{title}必须全小写",positive:"{title}不是正数",negative:"{title}不是负数",equal:"{title}必须等于 {equal}",min:"{title}必须大于等于 {min}",max:"{title}必须小于等于 {max}",enum:"{title}必须是 {enum} 之一",hasKeys:"{title}必须包含 {hasKeys} 字段",minLen:"{title}长度必须大于 {minLen}",maxLen:"{title}长度必须小于 {maxLen}",len:"{title}长度必须为 {len}",integer:"{title}必须为整数",number:"{title}必须为数字"}}};function LO(t,e){let n;return arguments.length===2?(n=arguments[1],e=n[t]):n=arguments[2],{id:e,prop:n}}function da(){return LO("name",...arguments)}function jO(t){const e=t.key||[],n=t.array||[],i=t.normal||[];Cm.push(...e),wc.push(...n),Ec.push(...i),Rm([...e,...n,...i])}let NO=1;const sn={},th=Symbol("defValue");function Lm(t){const e={[ua.name]:ua},n={},i={},o={},r={},s=[],a=[],l=[t.extendApi],c=Te({},OO),u=JT();let d={global:{}};const h=t.isMobile===!0,v=Mt({$mobile:h}),f=EO(),p={},_={};jO(t.attrs||{});function S($){const N=sn[$];if(Array.isArray(N))return N.map(F=>F.api());if(N)return N.api()}function w($){s.push($)}function E(){const $=da(...arguments);$.id&&$.prop&&(i[$.id]=$.prop)}function b(){const $=da(...arguments);$.id&&$.prop&&(c[$.id]=pe.Function($.prop)?$.prop:en(Te({},$.prop),{name:$.id}))}function C($){f.use($)}function x($){if(arguments.length===0)return xo;if(typeof $=="string"&&arguments.length===1)return n[Vt($)];const N=da(...arguments);if(!N.id||!N.prop)return xo;const F=Vt(N.id),B=N.prop,oe=B.merge===!0?n[F]:void 0;n[F]=Er(B,oe||xo),u[F]=Ct(F),B.maker&&De(u,B.maker)}function k($,N){let F;if(pe.String($)){if(F=$,N===void 0)return e[F]}else F=$.displayName||$.name,N=$;if(!F||!N)return;const B=Vt(F);e[F]=N,e[B]=N,delete f.aliasMap[F],delete f.aliasMap[B],delete n[F],delete n[B],N.formCreateParser&&x(F,N.formCreateParser)}function O(){return GT(re,e,i)}function K($,N){const F=O();return nc({data(){return Mt({rule:$,option:N})},render(){return $o(F,Te({ref:"fc"},this.$data))}})}function D(){return ua}function P($,N){return pe.Function($.install)?$.install(U,N):pe.Function($)&&$(U,N),this}function U($,N){let F=K($,N||{});s.forEach(oe=>{Be(()=>oe(U,F))});const B=document.createElement("div");return(N?.el||document.body).appendChild(B),F.mount(B).$refs.fc.fapi}Er(U,_);function M($){let N=Te({},t);return $?N.inherit={components:e,parsers:n,directives:i,modelFields:o,providers:c,useApps:s,maker:u,formulas:p,loadData:v}:delete N.inherit,Lm(N)}function q($,N){o[$]=N}function le($,N){p[$]=N}function de($,N){const F=r[$]||{},B=F.parsers||{};N.parsers&&Object.keys(N.parsers).forEach(oe=>{B[oe]=Er(N.parsers[oe],xo)}),N.name=$,r[$]=en(Te(Te({},F),N),{parsers:B})}function Y($){$&&Object.keys(sn).forEach(N=>{(Array.isArray(sn[N])?sn[N]:[sn[N]]).forEach(F=>{F.bus.$emit("$loadData."+$)})})}function I($,N){fi(v,$,N),Y($)}function A($,N){const F=(...B)=>Be(()=>N(...B));F._driver=!0,I($,F)}function Q($,N){const F=($||"").split(".");$=F.shift();const B=F.join(".");if(lt(v,$)||(v[$]=th),v[$]!==th){let oe=v[$];return oe&&oe._driver?oe=oe(B):F.length&&(oe=Pt(oe,F)),oe==null||oe===""?N:oe}else return N}function z($){l.push($)}function ie($){delete v[$],Y($)}function ve($,N){a.push({name:$,callback:N})}function re($){De(this,{id:NO++,create:U,vm:$,manager:SO(t.manager),parsers:n,providers:c,modelFields:o,formulas:p,isMobile:h,rules:$.props.rule,name:$.props.name||Ps(),inFor:$.props.inFor,prop:{components:e,directives:i},get:null,drivers:r,renderDriver:null,refreshData:Y,loadData:v,CreateNode:f,bus:new vm,unwatch:[],options:H({}),extendApiFn:l,fetchCache:new WeakMap,tmpData:Mt({})}),a.forEach(N=>{this.bus.$on(N.name,N.callback)}),Ge(()=>{Oe(this.options,()=>{this.$handle.$manager.updateOptions(this.options.value),this.api().refresh()},{deep:!0})}),De($.appContext.components,e),De($.appContext.directives,i),this.$handle=new Un(this),this.name&&(this.inFor?(sn[this.name]||(sn[this.name]=[]),sn[this.name].push(this)):sn[this.name]=this)}re.isMobile=h,De(re.prototype,{init(){this.isSub()&&this.unwatch.push(Oe(()=>this.vm.setupState.parent.setupState.fc.options.value,()=>{this.initOptions(),this.$handle.api.refresh()},{deep:!0,flush:"sync"})),this.vm.props.driver&&(this.renderDriver=typeof this.vm.props.driver=="object"?this.vm.props.driver:this.drivers[this.vm.props.driver]),!this.renderDriver&&this.vm.setupState.parent&&(this.renderDriver=this.vm.setupState.parent.setupState.fc.renderDriver),this.renderDriver||(this.renderDriver=this.drivers.default),this.initOptions(),this.$handle.init()},targetFormDriver($,...N){if(this.bus.$emit($,...N),this.renderDriver&&this.renderDriver[$])return Be(()=>this.renderDriver[$](...N))},t($,N,F){let B=F?F("$t."+$):this.globalLanguageDriver($);return B==null&&(B=""),B&&N&&Object.keys(N).forEach(oe=>{const ee=new RegExp(`{${oe}}`,"g");B=B.replace(ee,N[oe])}),B},globalDataDriver($){let N=$.split(".");const F=N.shift(),B=this.options.value.globalData&&this.options.value.globalData[F];if(B){if(B.type==="static")return Pt(B.data,N);{let oe;const ee=this.fetchCache.get(B);if(ee){if(ee.status&&(oe=Pt(ee.data,N)),!ee.loading)return oe;ee.loading=!1,this.fetchCache.set(B,ee)}else this.fetchCache.set(B,{status:!1});const G=ci(()=>{$e();const Ce=this.fetchCache.get(B);this.options.value.globalData&&Object.values(this.options.value.globalData).indexOf(B)!==-1?(Ce&&(Ce.loading=!0,this.fetchCache.set(B,Ce)),this.bus.$emit("$loadData.$globalData."+F)):this.fetchCache.delete(B)},B.wait||600),he=Ce=>{this.fetchCache.set(B,{status:!0,data:Ce}),this.bus.$emit("$loadData.$globalData."+F)},me=(Ce,Ne)=>{if(Ne&&B.watch===!1)return $e();if(Ne){G();return}const Pe=this.$handle.loadFetchVar(ml(B),Ce);Pe.targetRule=this.targetRule,this.$handle.api.fetch(Pe).then(Ue=>{he(Ue)}).catch(Ue=>{he(null)})},$e=this.watchLoadData(me);return B.watch===!1&&$e(),this.unwatch.push($e),oe}}},getLocale(){let $=this.vm.setupState.top.props.locale;return $&&typeof $=="object"?$.name:typeof $=="string"?$:"zh-cn"},globalLanguageDriver($){let N=this.vm.setupState.top.props.t,F=this.vm.setupState.top.props.locale,B;if(N&&(B=Be(()=>N($))),B==null&&F&&typeof F=="object"&&(B=Pt(F,$)),B==null){const oe=this.options.value.language||{},ee=this.getLocale();B=Pt(oe[ee]||{},$),B==null&&(B=Pt(FO[ee]||{},$))}return B},globalVarDriver($){let N=$.split(".");const F=N.shift(),B=this.options.value.globalVariable&&this.options.value.globalVariable[F];if(B){const oe=pe.Function(B)?B:Fn(B.handle);if(oe){let ee=oe((...G)=>this.$handle.api.getData(...G),this.$handle.api);return Pt(ee,N)}}},setData($,N,F){F?I($,N):(fi(this.vm.setupState.top.setupState.fc.tmpData,$,N),this.bus.$emit("$loadData."+$))},getLoadData($,N){let F=null;if($!=null){let B=$.split(".");const oe=B.shift();if(F=Pt(this.vm.setupState.top.setupState.fc.tmpData,$),F!=null)return F;if(oe==="$topForm")F=this.$handle.api.top.formData(!0);else if(oe==="$scopeForm")F=this.$handle.api.scope.formData(!0);else if(oe==="$form")F=this.$handle.api.formData(!0);else if(oe==="$options")F=this.options.value;else if(oe==="$globalData")F=this.globalDataDriver(B.join(".")),B=[];else if(oe==="$var")F=this.globalVarDriver(B.join(".")),B=[];else if(oe==="$locale")F=this.getLocale(),B=[];else if(oe==="$t")F=this.globalLanguageDriver(B.join(".")),B=[];else{if(oe==="$preview")return this.$handle.preview;F=Q($),B=[]}F&&B.length&&(F=Pt(F,B))}return F==null||F===""?N:F},watchLoadData($,N){let F={};const B=G=>{this.get||(this.get=oe),Be(()=>{$(oe,G)}),this.get===oe&&(this.get=void 0)},oe=(G,he)=>{let me;if(typeof G=="object"&&(me=G.getValue,G=G.id),F[G])return F[G].val;const $e=te(()=>me?me():this.getLoadData(G,he)),Ce=G.split("."),Ne=Ce.shift(),Pe=Ce.shift()||"",Ue=ci(()=>{const Qe=me?me():this.getLoadData(G,he);if(F[G])((Qe instanceof Function||pe.Object(Qe)||Array.isArray(Qe))&&Qe===F[G].val||JSON.stringify(Qe)!==JSON.stringify(F[G].val))&&(F[G].val=Qe,B(!0));else return},N||0),ut=Oe($e,Qe=>{Ue()});return this.bus.$on("$loadData."+Ne,Ue),Pe&&this.bus.$on("$loadData."+Ne+"."+Pe,Ue),F[G]={fn:()=>{this.bus.$off("$loadData."+Ne,Ue),Pe&&this.bus.$off("$loadData."+Ne+"."+Pe,Ue),ut()},val:$e.value},$e.value};B(!1);const ee=()=>{Object.keys(F).forEach(G=>F[G].fn()),F={}};return this.unwatch.push(ee),ee},isSub(){return this.vm.setupState.parent&&this.vm.props.extendOption},initOptions(){this.options.value={};let $=Te({formData:{},submitBtn:{},resetBtn:{},globalEvent:{},globalData:{}},Mn(d));const N=this.isSub();N&&($=this.mergeOptions($,this.vm.setupState.parent.setupState.fc.options.value||{},!0)),$=this.mergeOptions($,this.vm.props.option);const F=this.api();this.targetFormDriver("initOptions",$,{api:F,isSubForm:N}),this.updateOptions($)},mergeOptions($,N,F){return N=Te({},N||{}),F&&["page","onSubmit","onReset","onCreated","onChange","onMounted","mounted","beforeUnmount","beforeSubmit","onBeforeUnmount","onReload","reload","formData","el","globalClass","style"].forEach(B=>{delete N[B]}),N.global&&($.global=KT($.global,N.global),delete N.global),this.$handle.$manager.mergeOptions([N],$),$},updateOptions($){this.options.value=this.mergeOptions(this.options.value,$),this.$handle.$manager.updateOptions(this.options.value),this.bus.$emit("$loadData.$options")},api(){return this.$handle.api},render(){return this.$handle.render()},mounted(){this.$handle.mounted()},unmount(){if(Be(()=>this.$handle.lifecycle("beforeUnmount")),this.name)if(this.inFor){const $=sn[this.name].indexOf(this);sn[this.name].splice($,1)}else delete sn[this.name];a.forEach($=>{this.bus.$off($.name,$.callback)}),this.tmpData={},this.unwatch.forEach($=>$()),this.unwatch=[],this.$handle.reloadRule([])},updated(){this.$handle.bindNextTick(()=>this.bus.$emit("next-tick",this.$handle.api))}});function ge($){De($,{version:t.version,ui:t.ui,isMobile:h,extendApi:z,getData:Q,setDataDriver:A,setData:I,removeData:ie,refreshData:Y,maker:u,component:k,directive:E,setModelField:q,setFormula:le,setDriver:de,register:b,$vnode:D,parser:x,use:P,factory:M,componentAlias:C,copyRule:Om,copyRules:$m,mergeRule:Zn,fetch:Im,$form:O,parseFn:Fn,parseJson:bm,toJson:Fo,useApp:w,getApi:S,on:ve})}function _e($){De($,{create:U,install(N,F){d=Te(Te({},d),F||{});const B=`_installedFormCreate${h?"Mobile":""}_${t.ui}`;if(N[B]===!0)return;N[B]=!0;const oe=function(G,he={}){return U(G,he)};ge(oe),N.config.globalProperties.$formCreate=oe;const ee=O();N.component(ee.name,ee),s.forEach(G=>{Be(()=>G($,N))})}})}if(ge(_),_e(_),A("$cookie",IO),A("$localStorage",MO),A("$sessionStorage",DO),f.use({fragment:"fcFragment"}),t.install&&U.use(t),w(($,N)=>{N.mixin({props:["formCreateInject"]})}),x(kO),t.inherit){const $=t.inherit;$.components&&De(e,$.components),$.parsers&&De(n,$.parsers),$.directives&&De(i,$.directives),$.modelFields&&De(o,$.modelFields),$.providers&&De(c,$.providers),$.useApps&&De(s,$.useApps),$.maker&&De(u,$.maker),$.loadData&&De(v,$.loadData),$.formulas&&De(p,$.formulas)}const R=O();return Er(R,_),Object.defineProperties(R,{fetch:{get(){return _.fetch},set($){_.fetch=$}}}),R.util=_,R}const nh={date:"YYYY-MM-DD",month:"YYYY-MM",week:"YYYY-wo",datetime:"YYYY-MM-DD HH:mm:ss",timerange:"HH:mm:ss",daterange:"YYYY-MM-DD",monthrange:"YYYY-MM",datetimerange:"YYYY-MM-DD HH:mm:ss",year:"YYYY"},ih="datePicker",UO={name:ih,maker:(function(){return["year","month","date","dates","week","datetime","datetimeRange","dateRange","monthRange"].reduce((t,e)=>(t[e]=Ct(ih,{type:e.toLowerCase()}),t),{})})(),mergeProp(t){const e=t.prop.props;e.valueFormat||(e.valueFormat=nh[e.type]||nh.date)}},ha="hidden",zO={name:ha,maker:{[ha]:(t,e)=>Ct(ha)("",t,e)},render(){return[]}},pa="input",VO={name:pa,maker:(function(){const t=["password","url","email","text","textarea"].reduce((e,n)=>(e[n]=Ct(pa,{type:n}),e),{});return t.idate=Ct(pa,{type:"date"}),t})(),mergeProp(t){let{props:e}=t.prop;e&&e.autosize&&e.autosize.minRows&&(e.rows=e.autosize.minRows||2)}},BO="textarea",HO={name:BO,mergeProp(t){let{props:e}=t.prop;e.type="textarea",e&&e.autosize&&e.autosize.minRows&&(e.rows=e.autosize.minRows||2)}},oh="slider",qO={name:oh,maker:{sliderRange:Ct(oh,{range:!0})},toFormValue(t,e){let n=Array.isArray(t),i=e.prop.props,o=i.min||0,r;return i.range===!0?r=n?t:[o,parseFloat(t)||o]:r=n?parseFloat(t[0])||o:parseFloat(t),r}},fa="timePicker",WO={name:fa,maker:{time:Ct(fa,t=>t.props.isRange=!1),timeRange:Ct(fa,t=>t.props.isRange=!0)},mergeProp(t){const e=t.prop.props;e.valueFormat||(e.valueFormat="HH:mm:ss")}},KO={name:"FcRow",render(t,e){return e.vNode.col({props:{span:24}},{default:()=>[e.vNode.row(e.prop,t)]})}},YO="select",GO={name:YO,toFormValue(t,e){return e.prop.props.multiple&&!Array.isArray(t)?zt(t):t}},QO=[UO,zO,VO,HO,qO,WO,KO,GO],rt="el",XO={button:rt+"-button",icon:rt+"-icon",slider:rt+"-slider",rate:rt+"-rate",upload:"fc-upload",cascader:rt+"-cascader",popover:rt+"-popover",tooltip:rt+"-tooltip",colorPicker:rt+"-colorPicker",timePicker:rt+"-time-picker",timeSelect:rt+"-time-select",datePicker:rt+"-date-picker",switch:rt+"-switch",select:"fc-select",checkbox:"fc-checkbox",radio:"fc-radio",inputNumber:rt+"-input-number",number:rt+"-input-number",input:rt+"-input",textarea:rt+"-input",formItem:rt+"-form-item",form:rt+"-form",frame:"fc-frame",col:rt+"-col",row:rt+"-row",tree:"fc-tree",inputTag:rt+"-input-tag",inputOtp:rt+"-input-otp",mention:rt+"-mention",transfer:rt+"-transfer",treeSelect:rt+"-tree-select",autoComplete:rt+"-autocomplete",auto:rt+"-autocomplete",group:"fc-group",array:"fc-group",object:"fc-sub-form",subForm:"fc-sub-form"};function JO(){return{form:{inline:!1,labelPosition:"right",labelWidth:"125px",disabled:!1,size:void 0},row:{show:!0,gutter:0},submitBtn:{type:"primary",loading:!1,disabled:!1,innerText:"",show:!0,col:void 0,click:void 0},resetBtn:{type:"default",loading:!1,disabled:!1,innerText:"",show:!1,col:void 0,click:void 0}}}function ZO(t){return t.type==="tooltip"}function rh(t,e){lt(t,e)&&pe.String(t[e])&&(t[e]={[e]:t[e],show:!0})}function Vn(t){return t===!1}function e$(t,e){lt(t,e)&&!pe.Object(t[e])&&(t[e]={show:!!t[e]})}function ma(t){const e=Te({},t);return delete e.children,e}const t$={validate(){const t=this.form();return t?t.validate():new Promise(e=>e())},validateField(t){return new Promise((e,n)=>{const i=this.form();i?i.validateField(t,(o,r)=>{r?n(r):e(o)}):e()})},clearValidateState(t){const e=this.vm.refs[t.wrapRef];e&&e.clearValidate()},fieldChange(t,e,n,i){var o,r;i||(r=(o=this.vm.refs[t.wrapRef])==null?void 0:o.validate("change"))==null||r.catch(()=>{})},tidyOptions(t){return["submitBtn","resetBtn","row","info","wrap","col","title"].forEach(e=>{e$(t,e)}),t},tidyRule({prop:t}){return rh(t,"title"),rh(t,"info"),t},mergeProp(t){const e={info:{trigger:"hover",placement:"top-start",icon:!0},title:{},col:{span:24},wrap:{}};["info","wrap","col","title"].forEach(n=>{t.prop[n]=Qn([this.options[n]||{},t.prop[n]||{}],e[n])})},getDefaultOptions(){return JO()},update(){const t=this.options.form;this.rule={props:Te({},t),on:{submit:e=>{e.preventDefault()}},style:t.style,type:"form"}},beforeRender(){const{key:t,ref:e,$handle:n}=this,i=this.options.form;De(this.rule,{key:t,ref:e,class:[i.className,i.class,"form-create",this.$handle.preview?"is-preview":""]}),De(this.rule.props,{model:n.formData})},render(t){return t.slotLen()&&!this.$handle.preview&&t.setSlot(void 0,()=>this.makeFormBtn()),this.$r(this.rule,Vn(this.options.row.show)?t.getSlots():[this.makeRow(t)])},makeWrap(t,e){const n=t.prop,i=`${this.key}${t.key}`,o=n.col,r=this.isTitle(n)&&n.wrap.title!==!1,s=!o.labelWidth&&!r?0:o.labelWidth,{inline:a,col:l}=this.rule.props,c=n.wrap.class;delete n.wrap.class,delete n.wrap.title;const u=(pe.Undef(n.wrap.show)?!t.input:Vn(n.wrap.show))?e:this.$r(Qn([n.wrap,{props:en(Te({labelWidth:s===void 0?s:gm(s),label:r?n.title.title:void 0},ma(n.wrap||{})),{prop:t.id,rules:t.injectValidate()}),class:this.$render.mergeClass(c||n.className,"fc-form-item"),key:`${i}fi`,ref:t.wrapRef,type:"formItem"}]),Te({default:()=>e},r?{label:()=>this.makeInfo(n,i,t)}:{}));return a===!0||Vn(l)||Vn(o.show)?u:this.makeCol(n,i,[u])},isTitle(t){if(this.options.form.title===!1)return!1;const e=t.title;return!(!e.title&&!e.native||Vn(e.show))},makeInfo(t,e,n){var i,o,r,s,a,l;const c=Te({},t.title),u=Te({},t.info),d=ZO(u),h=this.options.form,v=this.getSlot("title"),f=[v?v({title:(o=(i=n.refRule)==null?void 0:i.__$title)==null?void 0:o.value,rule:n.rule,options:this.options}):((s=(r=n.refRule)==null?void 0:r.__$title)==null?void 0:s.value)+(h.labelSuffix||h["label-suffix"]||"")];if(!Vn(u.show)&&(u.info||u.native)&&!Vn(u.icon)){const _={type:u.type||"popover",props:ma(u),key:`${e}pop`};delete _.props.icon,delete _.props.show,delete _.props.info,delete _.props.align,delete _.props.native;const S="content";u.info&&!lt(_.props,S)&&(_.props[S]=(l=(a=n.refRule)==null?void 0:a.__$info)==null?void 0:l.value),f[u.align!=="left"?"unshift":"push"](this.$r(Qn([u,_]),{[c.slot||(d?"default":"reference")]:()=>this.$r({type:"ElIcon",style:"top:2px",key:`${e}i`},{default:()=>this.$r({type:u.icon===!0?"icon-warning":u.icon})},!0)}))}const p=Qn([c,{props:ma(c),key:`${e}tit`,class:"fc-form-title",type:c.type||"span",on:{click:(..._)=>{this.$handle.targetHook(n,"titleClick",{args:_})}}}]);return delete p.props.show,delete p.props.title,delete p.props.native,this.$r(p,f)},makeCol(t,e,n){const i=Te({},t.col);return delete i.show,this.$r({class:this.$render.mergeClass(i.class,"fc-form-col"),type:"col",props:i||{span:24},key:`${e}col`},n)},makeRow(t){const e=this.options.row||{};return this.$r({type:"row",props:e,class:this.$render.mergeClass(e.class,"fc-form-row"),key:`${this.key}row`},t)},makeFormBtn(){let t=[];if(Vn(this.options.submitBtn.show)||t.push(this.makeSubmitBtn()),Vn(this.options.resetBtn.show)||t.push(this.makeResetBtn()),!t.length)return;const e=this.$r({type:"formItem",class:"fc-form-item",key:`${this.key}fb`},t);return this.rule.props.inline===!0?e:this.$r({type:"col",class:"fc-form-col fc-form-footer",props:{span:24},key:`${this.key}fc`},[e])},makeResetBtn(){const t=Te({},this.options.resetBtn),e=t.innerText||this.$handle.api.t("reset")||"重置";return delete t.innerText,delete t.click,delete t.col,delete t.show,this.$r({type:"button",props:t,class:"fc-reset-btn",style:{width:t.width},on:{click:()=>{const n=this.$handle.api;this.options.resetBtn.click?this.options.resetBtn.click(n):n.resetFields()}},key:`${this.key}b2`},[e])},makeSubmitBtn(){const t=Te({},this.options.submitBtn),e=t.innerText||this.$handle.api.t("submit")||"提交";return delete t.innerText,delete t.click,delete t.col,delete t.show,this.$r({type:"button",props:t,class:"fc-submit-btn",style:{width:t.width},on:{click:()=>{const n=this.$handle.api;this.options.submitBtn.click?this.options.submitBtn.click(n):n.submit().catch(()=>{})}},key:`${this.key}b1`},[e])}},mi={};n$(mi);i$(mi);o$(mi);r$(mi);s$(mi);a$(mi);function n$(t){["group","tree","switch","upload","autoComplete","checkbox","cascader","colorPicker","datePicker","frame","inputNumber","inputTag","inputOtp","mention","transfer","treeSelect","radio","rate"].forEach(e=>{t[e]=Ct(e)}),t.auto=t.autoComplete,t.number=t.inputNumber,t.color=t.colorPicker,t.tag=t.inputTag}function i$(t){t.treeSelectMultiple=Ct("treeSelect",{multiple:!0})}function o$(t){const e="select",n="multiple";t.selectMultiple=Ct(e,{[n]:!0}),t.selectOne=Ct(e,{[n]:!1})}function r$(t){const e="tree",n={treeSelected:"selected",treeChecked:"checked"};Object.keys(n).reduce((i,o)=>(i[o]=Ct(e,{type:n[o]}),i),t)}function s$(t){const e="upload",n={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]};Object.keys(n).reduce((i,o)=>(i[o]=Ct(e,r=>r.props({uploadType:n[o][0],maxLength:n[o][1]})),i),t),t.uploadImage=t.image,t.uploadFile=t.file}function a$(t){const e={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]};return Object.keys(e).reduce((n,i)=>(n[i]=Ct("frame",o=>o.props({type:e[i][0],maxLength:e[i][1]})),n),t),t.frameInput=t.frameInputs,t.frameFile=t.frameFiles,t.frameImage=t.frameImages,t}function sh(t,e){return pe.Boolean(t)?t={show:t}:!pe.Undef(t)&&!pe.Object(t)&&(t={show:e}),t}function l$(t,e){return{formEl(){return e.$manager.form()},wrapEl(n){const i=e.getFieldCtx(n);if(i)return e.vm.refs[i.wrapRef]},validate(n){return new Promise((i,o)=>{const r=t.children,s=[e.$manager.validate()];r.filter(a=>!a.isScope).forEach(a=>{s.push(a.validate())}),Promise.all(s).then(()=>{i(!0),n&&n(!0)}).catch(a=>{o(a),n&&n(a),e.vm.emit("validate-fail",a,{api:t}),e.emitEvent("validate-fail",a,{api:t})})})},validateField(n,i){return new Promise((o,r)=>{const s=typeof n=="object"?kn(n):e.getCtx(n);if(!s){o(null),i&&i(null);return}const a=e.subForm[s.id],l=[e.$manager.validateField(s.id)];zt(a).filter(c=>!c.isScope).forEach(c=>{l.push(c.validate())}),Promise.all(l).then(()=>{o(null),i&&i(null)}).catch(c=>{r(c),i&&i(c),e.vm.emit("validate-field-fail",c,{field:n,api:t})})})},validateFields(n,i){return new Promise((o,r)=>{Array.isArray(n)||(n=[n]);const s=n.map(a=>t.validateField(a));Promise.all(s).then(()=>{o(null),i&&i(null)}).catch(a=>{r(a),i&&i(a)})})},clearValidateState(n,i=!0){t.helper.tidyFields(n).forEach(o=>{i&&this.clearSubValidateState(o),e.getCtxs(o).forEach(r=>{e.$manager.clearValidateState(r)})})},clearSubValidateState(n){t.helper.tidyFields(n).forEach(i=>{e.getCtxs(i).forEach(o=>{const r=e.subForm[o.id];r&&(Array.isArray(r)?r.forEach(s=>{s.clearValidateState()}):r&&r.clearValidateState())})})},btn:{loading:(n=!0)=>{t.submitBtnProps({loading:!!n})},disabled:(n=!0)=>{t.submitBtnProps({disabled:!!n})},show:(n=!0)=>{t.submitBtnProps({show:!!n})}},resetBtn:{loading:(n=!0)=>{t.resetBtnProps({loading:!!n})},disabled:(n=!0)=>{t.resetBtnProps({disabled:!!n})},show:(n=!0)=>{t.resetBtnProps({show:!!n})}},submitBtnProps:(n={})=>{let i=sh(e.options.submitBtn,!0);De(i,n),e.options.submitBtn=i,t.refreshOptions()},resetBtnProps:(n={})=>{let i=sh(e.options.resetBtn,!1);De(i,n),e.options.resetBtn=i,t.refreshOptions()},submit(n,i){return new Promise((o,r)=>{(e.options.validateOnSubmit===!1?Promise.resolve():t.validate()).then(()=>{let s=t.formData();e.beforeSubmit(s).then(()=>{pe.Function(n)&&Be(()=>n(s,t)),pe.Function(e.options.onSubmit)&&Be(()=>e.options.onSubmit(s,t)),e.vm.emit("submit",s,t),o(s)}).catch(a=>{})}).catch((...s)=>{pe.Function(i)&&Be(()=>i(t,...s)),r(...s)})})}}}const jm={name:"required",load(t,e,n){const i=c$(t.getValue());let o;if(i.required===!1)t.clearProp(),n.clearValidateState([e.field]);else{const r=Te({required:!0,validator(a,l,c){s(),pe.empty(l)?c(r.message):c()}},i),s=()=>{var a;const l=(a=e.__fc__.refRule.__$title)==null?void 0:a.value;if(o!==l)if(o=l,!i.message)r.message=n.t("required",{title:l})||l+(n.getLocale()==="en"?" is required":"不能为空");else{const c=i.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);c&&(r.message=n.t(c[1],{title:l}))}};s(),t.getProp().validate=[r]}n.sync(e)},watch(...t){jm.load(...t)}};function c$(t){return pe.Boolean(t)?{required:t}:pe.String(t)?{message:t}:pe.Undef(t)?{required:!1}:pe.Function(t)?{validator:t}:pe.Object(t)?t:{}}function u$(t){t.componentAlias(XO),qT.forEach(e=>{t.component(e.name,e)}),t.register(jm),QO.forEach(e=>{t.parser(e)}),Object.keys(mi).forEach(e=>{t.maker[e]=mi[e]}),typeof window<"u"&&window.ElementPlus&&t.useApp((e,n)=>{n.use(window.ElementPlus)})}function d$(){return Lm({ui:"element-ui",version:"3.3.0",manager:t$,extendApi:l$,install:u$,attrs:{normal:["col","wrap"],array:["className"],key:["title","info"]}})}const Rs=d$();typeof window<"u"&&(window.formCreate=Rs);Rs.maker;function h$(t){t.useApp((e,n)=>{n.component(el.name)||n.use(el),n.component(Gi.name)||n.use(Gi),n.component(ku.name)||n.use(ku),n.component(Au.name)||n.use(Au),n.component(Pu.name)||n.use(Pu),n.component(nl.name)||n.use(nl),n.component(Ru.name)||n.use(Ru),n.component(tl.name)||n.use(tl),n.component(Iu.name)||n.use(Iu),n.component(Mu.name)||n.use(Mu),n.component(Du.name)||n.use(Du),n.component(Fu.name)||n.use(Fu),n.component(Lu.name)||n.use(Lu),n.component(ju.name)||n.use(ju),n.component(Nu.name)||n.use(Nu),n.component(Uu.name)||n.use(Uu),n.component(zu.name)||n.use(zu),n.component(Vu.name)||n.use(Vu),n.component(Bu.name)||n.use(Bu),n.component(Hu.name)||n.use(Hu),n.component(qu.name)||n.use(qu),n.component(Wu.name)||n.use(Wu),n.component(Ku.name)||n.use(Ku),n.component(Yu.name)||n.use(Yu),n.component(Gu.name)||n.use(Gu),n.component(Ao.name)||n.use(Ao),n.component(Qu.name)||n.use(Qu),n.component(Xu.name)||n.use(Xu),n.component(Ju.name)||n.use(Ju),n.component(Zu.name)||n.use(Zu),n.component(ed.name)||n.use(ed),n.component(td.name)||n.use(td)})}Rs.use(h$);function p$(t){t.use(Rs)}async function f$(){}function m$(t){t.use(L1,{paginationStorage:{get:()=>B0(),set:e=>H0(e)}})}function v$(t){t.directive("loading",Hp)}function g$(t){return{all:t=t||new Map,on:function(e,n){var i=t.get(e);i?i.push(n):t.set(e,[n])},off:function(e,n){var i=t.get(e);i&&(n?i.splice(i.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var i=t.get(e);i&&i.slice().map(function(o){o(n)}),(i=t.get("*"))&&i.slice().map(function(o){o(e,n)})}}}function ke(t){let e=Yo();if(typeof window<"u"){let n=t.subscribe(i=>{e.value=i});E_()&&S_(n)}else e.value=t.get();return e}let mn=[],ti=0;const Sr=4,Gr=globalThis.nanostoresGlobal||={epoch:0},Tt=t=>{let e=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:t,lc:0,listen(i){return n.lc=e.push(i),()=>{for(let r=ti+Sr;r<mn.length;)mn[r]===i?mn.splice(r,Sr):r+=Sr;let o=e.indexOf(i);~o&&(e.splice(o,1),--n.lc||n.off())}},notify(i,o){Gr.epoch++;let r=!mn.length;for(let s of e)mn.push(s,n.value,i,o);if(r){for(ti=0;ti<mn.length;ti+=Sr)mn[ti](mn[ti+1],mn[ti+2],mn[ti+3]);mn.length=0}},off(){},set(i){let o=n.value;o!==i&&(n.value=i,n.notify(o))},subscribe(i){let o=n.listen(i);return i(n.value),o},value:t};return n},_$=5,Cr=6,xr=10;let y$=(t,e,n,i)=>(t.events=t.events||{},t.events[n+xr]||(t.events[n+xr]=i(o=>{t.events[n].reduceRight((r,s)=>(s(r),r),{shared:{},...o})})),t.events[n]=t.events[n]||[],t.events[n].push(e),()=>{let o=t.events[n],r=o.indexOf(e);o.splice(r,1),o.length||(delete t.events[n],t.events[n+xr](),delete t.events[n+xr])});const b$=1e3;let Nm=(t,e)=>y$(t,i=>{let o=e(i);o&&t.events[Cr].push(o)},_$,i=>{let o=t.listen;t.listen=(...s)=>(!t.lc&&!t.active&&(t.active=!0,i()),o(...s));let r=t.off;return t.events[Cr]=[],t.off=()=>{r(),setTimeout(()=>{if(t.active&&!t.lc){t.active=!1;for(let s of t.events[Cr])s();t.events[Cr]=[]}},b$)},()=>{t.listen=o,t.off=r}}),w$=(t,e,n)=>{Array.isArray(t)||(t=[t]);let i,o,r=()=>{if(o===Gr.epoch)return;o=Gr.epoch;let c=t.map(u=>u.get());if(!i||c.some((u,d)=>u!==i[d])){i=c;let u=e(...c);u&&u.then&&u.t?u.then(d=>{i===c&&s.set(d)}):(s.set(u),o=Gr.epoch)}},s=Tt(void 0),a=s.get;s.get=()=>(r(),a());let l=r;return Nm(s,()=>{let c=t.map(u=>u.listen(l));return r(),()=>{for(let u of c)u()}}),s};const ri=(t,e)=>w$(t,e);let ah=t=>t,Hn={},yl={addEventListener(){},removeEventListener(){}};function E$(){try{return typeof localStorage<"u"}catch{return!1}}E$()&&(Hn=localStorage);let S$={addEventListener(t,e,n){window.addEventListener("storage",e),window.addEventListener("pageshow",n)},removeEventListener(t,e,n){window.removeEventListener("storage",e),window.removeEventListener("pageshow",n)}};typeof window<"u"&&(yl=S$);function Um(t,e,n={}){let i=n.encode||ah,o=n.decode||ah,r=Hn[t],s=Tt(t in Hn?o(r):e),a=s.set;s.set=u=>{r=i(u),typeof r>"u"?delete Hn[t]:Hn[t]=r,a(u)};function l(u){u.key===t?u.newValue===null?a(e):a(o(u.newValue)):t in Hn||a(e)}function c(){r!==Hn[t]&&s.set(t in Hn?o(Hn[t]):e)}return Nm(s,()=>{if(c(),n.listen!==!1)return yl.addEventListener(t,l,c),()=>{yl.removeEventListener(t,l,c)}}),s}let bl=1;var C$=class{subscribers;toasts;dismissedToasts;constructor(){this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}subscribe=t=>(this.subscribers.push(t),()=>{const e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)});publish=t=>{this.subscribers.forEach(e=>e(t))};addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]};create=t=>{const{message:e,...n}=t,i=typeof t.id=="number"||t.id&&t.id?.length>0?t.id:bl++,o=this.toasts.find(s=>s.id===i),r=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(s=>s.id===i?(this.publish({...s,...t,id:i,title:e}),{...s,...t,id:i,dismissible:r,title:e}):s):this.addToast({title:e,...n,dismissible:r,id:i}),i};dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(e=>e({id:t,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),t);message=(t,e)=>this.create({...e,message:t,type:"default"});error=(t,e)=>this.create({...e,type:"error",message:t});success=(t,e)=>this.create({...e,type:"success",message:t});info=(t,e)=>this.create({...e,type:"info",message:t});warning=(t,e)=>this.create({...e,type:"warning",message:t});loading=(t,e)=>this.create({...e,type:"loading",message:t});promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let o=n!==void 0,r;const s=i.then(async l=>{if(r=["resolve",l],zi(l))o=!1,this.create({id:n,type:"default",message:l});else if(T$(l)&&!l.ok){o=!1;const u=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,d=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description,v=typeof u=="object"&&!zi(u)?u:{message:u||"",id:n||""};this.create({id:n,type:"error",description:d,...v})}else if(l instanceof Error){o=!1;const u=typeof e.error=="function"?await e.error(l):e.error,d=typeof e.description=="function"?await e.description(l):e.description,v=typeof u=="object"&&!zi(u)?u:{message:u||"",id:n||""};this.create({id:n,type:"error",description:d,...v})}else if(e.success!==void 0){o=!1;const u=typeof e.success=="function"?await e.success(l):e.success,d=typeof e.description=="function"?await e.description(l):e.description,v=typeof u=="object"&&!zi(u)?u:{message:u||"",id:n||""};this.create({id:n,type:"success",description:d,...v})}}).catch(async l=>{if(r=["reject",l],e.error!==void 0){o=!1;const c=typeof e.error=="function"?await e.error(l):e.error,u=typeof e.description=="function"?await e.description(l):e.description,h=typeof c=="object"&&!zi(c)?c:{message:c||"",id:n||""};this.create({id:n,type:"error",description:u,...h})}}).finally(()=>{o&&(this.dismiss(n),n=void 0),e.finally?.()}),a=()=>new Promise((l,c)=>s.then(()=>r[0]==="reject"?c(r[1]):l(r[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})};custom=(t,e)=>{const n=e?.id||bl++,i=this.toasts.find(r=>r.id===n),o=e?.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(n)&&this.dismissedToasts.delete(n),i?this.toasts=this.toasts.map(r=>r.id===n?(this.publish({...r,component:t,dismissible:o,id:n,...e}),{...r,component:t,dismissible:o,id:n,...e}):r):this.addToast({component:t,dismissible:o,id:n,...e}),n};getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id))};const jt=new C$;function x$(t,e){const n=e?.id||bl++;return jt.create({message:t,id:n,type:"default",...e}),n}const T$=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",O$=x$,$$=()=>jt.toasts,k$=()=>jt.getActiveToasts(),Tr=Object.assign(O$,{success:jt.success,info:jt.info,warning:jt.warning,error:jt.error,custom:jt.custom,message:jt.message,promise:jt.promise,dismiss:jt.dismiss,loading:jt.loading},{getHistory:$$,getToasts:k$});function Or(t){return t.label!==void 0}const A$=3,zm="24px",Vm="16px",lh=4e3,P$=356,R$=14,I$=45,Bm=200;function M$(){const t=H(!1);return Nt(()=>{const e=()=>{t.value=document.hidden};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)}),{isDocumentHidden:t}}function ni(...t){return t.filter(Boolean).join(" ")}function D$(t){const[e,n]=t.split("-"),i=[];return e&&i.push(e),n&&i.push(n),i}function F$(t,e){const n={};return[t,e].forEach((i,o)=>{const r=o===1,s=r?"--mobile-offset":"--offset",a=r?Vm:zm;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${s}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof i=="number"||typeof i=="string"?l(i):typeof i=="object"?["top","right","bottom","left"].forEach(c=>{i[c]===void 0?n[`${s}-${c}`]=a:n[`${s}-${c}`]=typeof i[c]=="number"?`${i[c]}px`:i[c]}):l(a)}),n}const L$=["data-rich-colors","data-styled","data-mounted","data-promise","data-swiped","data-removed","data-visible","data-y-position","data-x-position","data-index","data-front","data-swiping","data-dismissible","data-type","data-invert","data-swipe-out","data-swipe-direction","data-expanded","data-testid"],j$=["aria-label","data-disabled","data-close-button-position"];var N$=Se({__name:"Toast",props:{toast:{},toasts:{},index:{},swipeDirections:{},expanded:{type:Boolean},invert:{type:Boolean},heights:{},gap:{},position:{},closeButtonPosition:{},visibleToasts:{},expandByDefault:{type:Boolean},closeButton:{type:Boolean},interacting:{type:Boolean},style:{},cancelButtonStyle:{},actionButtonStyle:{},duration:{},class:{},unstyled:{type:Boolean},descriptionClass:{},loadingIcon:{},classes:{},icons:{},closeButtonAriaLabel:{},defaultRichColors:{type:Boolean}},emits:["update:heights","update:height","removeToast"],setup(t,{emit:e}){const n=t,i=e,o=H(null),r=H(null),s=H(!1),a=H(!1),l=H(!1),c=H(!1),u=H(!1),d=H(0),h=H(0),v=H(n.toast.duration||n.duration||lh),f=H(null),p=H(null),_=te(()=>n.index===0),S=te(()=>n.index+1<=n.visibleToasts),w=te(()=>n.toast.type),E=te(()=>n.toast.dismissible!==!1),b=te(()=>n.toast.class||""),C=te(()=>n.descriptionClass||""),x=te(()=>{const R=n.toast.position||n.position,N=n.heights.filter(F=>F.position===R).findIndex(F=>F.toastId===n.toast.id);return N>=0?N:0}),k=te(()=>{const R=n.toast.position||n.position;return n.heights.filter(N=>N.position===R).reduce((N,F,B)=>B>=x.value?N:N+F.height,0)}),O=te(()=>x.value*n.gap+k.value||0),K=te(()=>n.toast.closeButton??n.closeButton),D=te(()=>n.toast.duration||n.duration||lh),P=H(0),U=H(0),M=H(null),q=te(()=>n.position.split("-")),le=te(()=>q.value[0]),de=te(()=>q.value[1]),Y=te(()=>typeof n.toast.title!="string"),I=te(()=>typeof n.toast.description!="string"),{isDocumentHidden:A}=M$(),Q=te(()=>w.value&&w.value==="loading");et(()=>{s.value=!0,v.value=D.value}),Nt(async()=>{if(!s.value||!p.value)return;await Ge();const R=p.value,$=R.style.height;R.style.height="auto";const N=R.getBoundingClientRect().height;R.style.height=$,h.value=N,i("update:height",{toastId:n.toast.id,height:N,position:n.toast.position||n.position})});function z(){a.value=!0,d.value=O.value,setTimeout(()=>{i("removeToast",n.toast)},Bm)}function ie(){if(Q.value||!E.value)return{};z(),n.toast.onDismiss?.(n.toast)}function ve(R){R.button!==2&&(Q.value||!E.value||(f.value=new Date,d.value=O.value,R.target.setPointerCapture(R.pointerId),R.target.tagName!=="BUTTON"&&(l.value=!0,M.value={x:R.clientX,y:R.clientY})))}function re(){if(c.value||!E.value)return;M.value=null;const R=Number(p.value?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),$=Number(p.value?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),N=new Date().getTime()-(f.value?.getTime()||0),F=o.value==="x"?R:$,B=Math.abs(F)/N;if(Math.abs(F)>=I$||B>.11){d.value=O.value,n.toast.onDismiss?.(n.toast),o.value==="x"?r.value=R>0?"right":"left":r.value=$>0?"down":"up",z(),c.value=!0;return}else p.value?.style.setProperty("--swipe-amount-x","0px"),p.value?.style.setProperty("--swipe-amount-y","0px");u.value=!1,l.value=!1,o.value=null}function ge(R){if(!M.value||!E.value||(window?.getSelection()?.toString()?.length??!1))return;const N=R.clientY-M.value.y,F=R.clientX-M.value.x,B=n.swipeDirections??D$(n.position);!o.value&&(Math.abs(F)>1||Math.abs(N)>1)&&(o.value=Math.abs(F)>Math.abs(N)?"x":"y");let oe={x:0,y:0};const ee=G=>1/(1.5+Math.abs(G)/20);if(o.value==="y"){if(B.includes("top")||B.includes("bottom"))if(B.includes("top")&&N<0||B.includes("bottom")&&N>0)oe.y=N;else{const G=N*ee(N);oe.y=Math.abs(G)<Math.abs(N)?G:N}}else if(o.value==="x"&&(B.includes("left")||B.includes("right")))if(B.includes("left")&&F<0||B.includes("right")&&F>0)oe.x=F;else{const G=F*ee(F);oe.x=Math.abs(G)<Math.abs(F)?G:F}(Math.abs(oe.x)>0||Math.abs(oe.y)>0)&&(u.value=!0),p.value?.style.setProperty("--swipe-amount-x",`${oe.x}px`),p.value?.style.setProperty("--swipe-amount-y",`${oe.y}px`)}et(()=>{if(s.value=!0,!p.value)return;const R=p.value.getBoundingClientRect().height;h.value=R;const $=[{toastId:n.toast.id,height:R,position:n.toast.position},...n.heights];i("update:heights",$)}),bs(()=>{p.value&&i("removeToast",n.toast)}),Nt(R=>{if(n.toast.promise&&w.value==="loading"||n.toast.duration===1/0||n.toast.type==="loading")return;let $;const N=()=>{if(U.value<P.value){const B=new Date().getTime()-P.value;v.value=v.value-B}U.value=new Date().getTime()},F=()=>{v.value!==1/0&&(P.value=new Date().getTime(),$=setTimeout(()=>{n.toast.onAutoClose?.(n.toast),z()},v.value))};n.expanded||n.interacting||A.value?N():F(),R(()=>{clearTimeout($)})}),Oe(()=>n.toast.delete,R=>{R!==void 0&&R&&(z(),n.toast.onDismiss?.(n.toast))},{deep:!0});function _e(){l.value=!1,o.value=null,M.value=null}return(R,$)=>(y(),T("li",{tabindex:"0",ref_key:"toastRef",ref:p,class:Ae(m(ni)(n.class,b.value,R.classes?.toast,R.toast.classes?.toast,R.classes?.[w.value],R.toast?.classes?.[w.value])),"data-sonner-toast":"","data-rich-colors":R.toast.richColors??R.defaultRichColors,"data-styled":!(R.toast.component||R.toast?.unstyled||R.unstyled),"data-mounted":s.value,"data-promise":!!R.toast.promise,"data-swiped":u.value,"data-removed":a.value,"data-visible":S.value,"data-y-position":le.value,"data-x-position":de.value,"data-index":R.index,"data-front":_.value,"data-swiping":l.value,"data-dismissible":E.value,"data-type":w.value,"data-invert":R.toast.invert||R.invert,"data-swipe-out":c.value,"data-swipe-direction":r.value,"data-expanded":!!(R.expanded||R.expandByDefault&&s.value),"data-testid":R.toast.testId,style:At({"--index":R.index,"--toasts-before":R.index,"--z-index":R.toasts.length-R.index,"--offset":`${a.value?d.value:O.value}px`,"--initial-height":R.expandByDefault?"auto":`${h.value}px`,...R.style,...n.toast.style}),onDragend:_e,onPointerdown:ve,onPointerup:re,onPointermove:ge},[K.value&&!R.toast.component&&w.value!=="loading"?(y(),T("button",{key:0,"aria-label":R.closeButtonAriaLabel||"Close toast","data-disabled":Q.value,"data-close-button":"true","data-close-button-position":R.closeButtonPosition,class:Ae(m(ni)(R.classes?.closeButton,R.toast?.classes?.closeButton)),onClick:ie},[R.icons?.close?(y(),ne(Ot(R.icons?.close),{key:0})):Ve(R.$slots,"close-icon",{key:1})],10,j$)):ue("v-if",!0),R.toast.component?(y(),ne(Ot(R.toast.component),We({key:1},R.toast.componentProps,{onCloseToast:ie,isPaused:R.$props.expanded||R.$props.interacting||m(A)}),null,16,["isPaused"])):(y(),T(Ie,{key:2},[w.value!=="default"||R.toast.icon||R.toast.promise?(y(),T("div",{key:0,"data-icon":"",class:Ae(m(ni)(R.classes?.icon,R.toast?.classes?.icon))},[R.toast.icon?(y(),ne(Ot(R.toast.icon),{key:0})):(y(),T(Ie,{key:1},[w.value==="loading"?Ve(R.$slots,"loading-icon",{key:0}):w.value==="success"?Ve(R.$slots,"success-icon",{key:1}):w.value==="error"?Ve(R.$slots,"error-icon",{key:2}):w.value==="warning"?Ve(R.$slots,"warning-icon",{key:3}):w.value==="info"?Ve(R.$slots,"info-icon",{key:4}):ue("v-if",!0)],64))],2)):ue("v-if",!0),g("div",{"data-content":"",class:Ae(m(ni)(R.classes?.content,R.toast?.classes?.content))},[g("div",{"data-title":"",class:Ae(m(ni)(R.classes?.title,R.toast.classes?.title))},[Y.value?(y(),ne(Ot(R.toast.title),wn(We({key:0},R.toast.componentProps)),null,16)):(y(),T(Ie,{key:1},[Ke(L(R.toast.title),1)],64))],2),R.toast.description?(y(),T("div",{key:0,"data-description":"",class:Ae(m(ni)(R.descriptionClass,C.value,R.classes?.description,R.toast.classes?.description))},[I.value?(y(),ne(Ot(R.toast.description),wn(We({key:0},R.toast.componentProps)),null,16)):(y(),T(Ie,{key:1},[Ke(L(R.toast.description),1)],64))],2)):ue("v-if",!0)],2),R.toast.cancel?(y(),T("button",{key:1,style:At(R.toast.cancelButtonStyle||R.cancelButtonStyle),class:Ae(m(ni)(R.classes?.cancelButton,R.toast.classes?.cancelButton)),"data-button":"","data-cancel":"",onClick:$[0]||($[0]=N=>{m(Or)(R.toast.cancel)&&E.value&&(R.toast.cancel.onClick?.(N),z())})},L(m(Or)(R.toast.cancel)?R.toast.cancel?.label:R.toast.cancel),7)):ue("v-if",!0),R.toast.action?(y(),T("button",{key:2,style:At(R.toast.actionButtonStyle||R.actionButtonStyle),class:Ae(m(ni)(R.classes?.actionButton,R.toast.classes?.actionButton)),"data-button":"","data-action":"",onClick:$[1]||($[1]=N=>{m(Or)(R.toast.action)&&(R.toast.action.onClick?.(N),!N.defaultPrevented&&z())})},L(m(Or)(R.toast.action)?R.toast.action?.label:R.toast.action),7)):ue("v-if",!0)],64))],46,L$))}}),U$=N$,ir=(t,e)=>{const n=t.__vccOpts||t;for(const[i,o]of e)n[i]=o;return n};const z$={},V$={xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stoke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"};function B$(t,e){return y(),T("svg",V$,e[0]||(e[0]=[g("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1),g("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)]))}var H$=ir(z$,[["render",B$]]);const q$=["data-visible"],W$={class:"sonner-spinner"};var K$=Se({__name:"Loader",props:{visible:{type:Boolean}},setup(t){const e=Array(12).fill(0);return(n,i)=>(y(),T("div",{class:"sonner-loading-wrapper","data-visible":n.visible},[g("div",W$,[(y(!0),T(Ie,null,He(m(e),o=>(y(),T("div",{key:`spinner-bar-${o}`,class:"sonner-loading-bar"}))),128))])],8,q$))}}),Y$=K$;const G$={},Q$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function X$(t,e){return y(),T("svg",Q$,e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"},null,-1)]))}var J$=ir(G$,[["render",X$]]);const Z$={},ek={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function tk(t,e){return y(),T("svg",ek,e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z","clip-rule":"evenodd"},null,-1)]))}var nk=ir(Z$,[["render",tk]]);const ik={},ok={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"};function rk(t,e){return y(),T("svg",ok,e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z","clip-rule":"evenodd"},null,-1)]))}var sk=ir(ik,[["render",rk]]);const ak={},lk={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function ck(t,e){return y(),T("svg",lk,e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"},null,-1)]))}var uk=ir(ak,[["render",ck]]);const dk=["aria-label"],hk=["data-sonner-theme","dir","data-theme","data-rich-colors","data-y-position","data-x-position"],pk=typeof window<"u"&&typeof document<"u";function fk(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}var mk=Se({name:"Toaster",inheritAttrs:!1,__name:"Toaster",props:{id:{},invert:{type:Boolean,default:!1},theme:{default:"light"},position:{default:"bottom-right"},closeButtonPosition:{default:"top-left"},hotkey:{default:()=>["altKey","KeyT"]},richColors:{type:Boolean,default:!1},expand:{type:Boolean,default:!1},duration:{},gap:{default:R$},visibleToasts:{default:A$},closeButton:{type:Boolean,default:!1},toastOptions:{default:()=>({})},class:{default:""},style:{},offset:{default:zm},mobileOffset:{default:Vm},dir:{default:"auto"},swipeDirections:{},icons:{},containerAriaLabel:{default:"Notifications"}},setup(t){const e=t,n=ec(),i=H([]),o=te(()=>e.id?i.value.filter(D=>D.toasterId===e.id):i.value.filter(D=>!D.toasterId));function r(D,P){return o.value.filter(U=>!U.position&&P===0||U.position===D)}const s=te(()=>{const D=o.value.filter(P=>P.position).map(P=>P.position);return D.length>0?Array.from(new Set([e.position].concat(D))):[e.position]}),a=te(()=>{const D={};return s.value.forEach(P=>{D[P]=i.value.filter(U=>U.position===P)}),D}),l=H([]),c=H({}),u=H(!1);Nt(()=>{s.value.forEach(D=>{D in c.value||(c.value[D]=!1)})});const d=H(e.theme!=="system"?e.theme:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),h=H(null),v=H(null),f=H(!1),p=e.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,"");function _(D){i.value.find(P=>P.id===D.id)?.delete||jt.dismiss(D.id),i.value=i.value.filter(({id:P})=>P!==D.id),setTimeout(()=>{i.value.find(P=>P.id===D.id)||(l.value=l.value.filter(P=>P.toastId!==D.id))},Bm+50)}function S(D){f.value&&!D.currentTarget?.contains?.(D.relatedTarget)&&(f.value=!1,v.value&&(v.value.focus({preventScroll:!0}),v.value=null))}function w(D){D.target instanceof HTMLElement&&D.target.dataset.dismissible==="false"||f.value||(f.value=!0,v.value=D.relatedTarget)}function E(D){D.target&&D.target instanceof HTMLElement&&D.target.dataset.dismissible==="false"||(u.value=!0)}Nt(D=>{const P=jt.subscribe(U=>{if(U.dismiss){requestAnimationFrame(()=>{i.value=i.value.map(M=>M.id===U.id?{...M,delete:!0}:M)});return}Ge(()=>{const M=i.value.findIndex(q=>q.id===U.id);M!==-1?i.value=[...i.value.slice(0,M),{...i.value[M],...U},...i.value.slice(M+1)]:i.value=[U,...i.value]})});D(P)}),Nt(D=>{if(typeof window>"u")return;if(e.theme!=="system"){d.value=e.theme;return}const P=window.matchMedia("(prefers-color-scheme: dark)"),U=q=>{d.value=q?"dark":"light"};U(P.matches);const M=q=>{U(q.matches)};try{P.addEventListener("change",M)}catch{P.addListener(M)}D(()=>{try{P.removeEventListener("change",M)}catch{P.removeListener(M)}})}),Nt(()=>{h.value&&v.value&&(v.value.focus({preventScroll:!0}),v.value=null,f.value=!1)}),Nt(()=>{i.value.length<=1&&Object.keys(c.value).forEach(D=>{c.value[D]=!1})}),Nt(D=>{function P(U){const M=e.hotkey.every(de=>U[de]||U.code===de),q=Array.isArray(h.value)?h.value[0]:h.value;M&&(s.value.forEach(de=>{c.value[de]=!0}),q?.focus());const le=document.activeElement===h.value||q?.contains(document.activeElement);U.code==="Escape"&&le&&s.value.forEach(de=>{c.value[de]=!1})}pk&&(document.addEventListener("keydown",P),D(()=>{document.removeEventListener("keydown",P)}))});function b(D){const P=D.currentTarget,U=P.getAttribute("data-y-position")+"-"+P.getAttribute("data-x-position");c.value[U]=!0}function C(D){if(!u.value){const P=D.currentTarget,U=P.getAttribute("data-y-position")+"-"+P.getAttribute("data-x-position");c.value[U]=!1}}function x(){Object.keys(c.value).forEach(D=>{c.value[D]=!1})}function k(){u.value=!1}function O(D){l.value=D}function K(D){const P=l.value.findIndex(U=>U.toastId===D.toastId);if(P!==-1)l.value[P]=D;else{const U=l.value.findIndex(M=>M.position===D.position);U!==-1?l.value.splice(U,0,D):l.value.unshift(D)}}return(D,P)=>(y(),T(Ie,null,[ue(" Remove item from normal navigation flow, only available via hotkey "),g("section",{"aria-label":`${D.containerAriaLabel} ${m(p)}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false"},[(y(!0),T(Ie,null,He(s.value,(U,M)=>(y(),T("ol",We({key:U,ref_for:!0,ref_key:"listRef",ref:h,"data-sonner-toaster":"","data-sonner-theme":d.value,class:e.class,dir:D.dir==="auto"?fk():D.dir,tabIndex:-1,"data-theme":D.theme,"data-rich-colors":D.richColors,"data-y-position":U.split("-")[0],"data-x-position":U.split("-")[1],style:{"--front-toast-height":`${l.value[0]?.height||0}px`,"--width":`${m(P$)}px`,"--gap":`${D.gap}px`,...D.style,...m(n).style,...m(F$)(D.offset,D.mobileOffset)}},{ref_for:!0},D.$attrs,{onBlur:S,onFocus:w,onMouseenter:b,onMousemove:b,onMouseleave:C,onDragend:x,onPointerdown:E,onPointerup:k}),[(y(!0),T(Ie,null,He(r(U,M),(q,le)=>(y(),ne(U$,{key:q.id,heights:l.value,icons:D.icons,index:le,toast:q,defaultRichColors:D.richColors,duration:D.toastOptions?.duration??D.duration,class:Ae(D.toastOptions?.class??""),descriptionClass:D.toastOptions?.descriptionClass,invert:D.invert,visibleToasts:D.visibleToasts,closeButton:D.toastOptions?.closeButton??D.closeButton,interacting:u.value,position:U,closeButtonPosition:D.toastOptions?.closeButtonPosition??D.closeButtonPosition,style:At(D.toastOptions?.style),unstyled:D.toastOptions?.unstyled,classes:D.toastOptions?.classes,cancelButtonStyle:D.toastOptions?.cancelButtonStyle,actionButtonStyle:D.toastOptions?.actionButtonStyle,"close-button-aria-label":D.toastOptions?.closeButtonAriaLabel,toasts:a.value[U],expandByDefault:D.expand,gap:D.gap,expanded:c.value[U]||!1,swipeDirections:e.swipeDirections,"onUpdate:heights":O,"onUpdate:height":K,onRemoveToast:_},{"close-icon":we(()=>[Ve(D.$slots,"close-icon",{},()=>[j(H$)])]),"loading-icon":we(()=>[Ve(D.$slots,"loading-icon",{},()=>[j(Y$,{visible:q.type==="loading"},null,8,["visible"])])]),"success-icon":we(()=>[Ve(D.$slots,"success-icon",{},()=>[j(J$)])]),"error-icon":we(()=>[Ve(D.$slots,"error-icon",{},()=>[j(uk)])]),"warning-icon":we(()=>[Ve(D.$slots,"warning-icon",{},()=>[j(sk)])]),"info-icon":we(()=>[Ve(D.$slots,"info-icon",{},()=>[j(nk)])]),_:2},1032,["heights","icons","index","toast","defaultRichColors","duration","class","descriptionClass","invert","visibleToasts","closeButton","interacting","position","closeButtonPosition","style","unstyled","classes","cancelButtonStyle","actionButtonStyle","close-button-aria-label","toasts","expandByDefault","gap","expanded","swipeDirections"]))),128))],16,hk))),128))],8,dk)],2112))}}),vk=mk,Is=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},gk=class extends Is{#e;#t;#n;constructor(){super(),this.#n=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Hm=new gk,_k={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},yk=class{#e=_k;#t=!1;setTimeoutProvider(t){this.#e=t}setTimeout(t,e){return this.#e.setTimeout(t,e)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,e){return this.#e.setInterval(t,e)}clearInterval(t){this.#e.clearInterval(t)}},wl=new yk;function bk(t){setTimeout(t,0)}var wk=typeof window>"u"||"Deno"in globalThis;function gn(){}function Ek(t,e){return typeof t=="function"?t(e):t}function Sk(t){return typeof t=="number"&&t>=0&&t!==1/0}function Ck(t,e){return Math.max(t+(e||0)-Date.now(),0)}function El(t,e){return typeof t=="function"?t(e):t}function xk(t,e){return typeof t=="function"?t(e):t}function ch(t,e){const{type:n="all",exact:i,fetchStatus:o,predicate:r,queryKey:s,stale:a}=t;if(s){if(i){if(e.queryHash!==Tc(s,e.options))return!1}else if(!jo(e.queryKey,s))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||o&&o!==e.state.fetchStatus||r&&!r(e))}function uh(t,e){const{exact:n,status:i,predicate:o,mutationKey:r}=t;if(r){if(!e.options.mutationKey)return!1;if(n){if(Lo(e.options.mutationKey)!==Lo(r))return!1}else if(!jo(e.options.mutationKey,r))return!1}return!(i&&e.state.status!==i||o&&!o(e))}function Tc(t,e){return(e?.queryKeyHashFn||Lo)(t)}function Lo(t){return JSON.stringify(t,(e,n)=>Sl(n)?Object.keys(n).sort().reduce((i,o)=>(i[o]=n[o],i),{}):n)}function jo(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>jo(t[n],e[n])):!1}var Tk=Object.prototype.hasOwnProperty;function qm(t,e,n=0){if(t===e)return t;if(n>500)return e;const i=dh(t)&&dh(e);if(!i&&!(Sl(t)&&Sl(e)))return e;const r=(i?t:Object.keys(t)).length,s=i?e:Object.keys(e),a=s.length,l=i?new Array(a):{};let c=0;for(let u=0;u<a;u++){const d=i?u:s[u],h=t[d],v=e[d];if(h===v){l[d]=h,(i?u<r:Tk.call(t,d))&&c++;continue}if(h===null||v===null||typeof h!="object"||typeof v!="object"){l[d]=v;continue}const f=qm(h,v,n+1);l[d]=f,f===h&&c++}return r===a&&c===r?t:l}function dh(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Sl(t){if(!hh(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!hh(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function hh(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ok(t){return new Promise(e=>{wl.setTimeout(e,t)})}function $k(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?qm(t,e):e}function kk(t,e,n=0){const i=[...t,e];return n&&i.length>n?i.slice(1):i}function Ak(t,e,n=0){const i=[e,...t];return n&&i.length>n?i.slice(0,-1):i}var Oc=Symbol();function Wm(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===Oc?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Pk(t,e,n){let i=!1,o;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(o??=e(),i||(i=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),t}var Km=(()=>{let t=()=>wk;return{isServer(){return t()},setIsServer(e){t=e}}})();function Rk(){let t,e;const n=new Promise((o,r)=>{t=o,e=r});n.status="pending",n.catch(()=>{});function i(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{i({status:"fulfilled",value:o}),t(o)},n.reject=o=>{i({status:"rejected",reason:o}),e(o)},n}var Ik=bk;function Mk(){let t=[],e=0,n=a=>{a()},i=a=>{a()},o=Ik;const r=a=>{e?t.push(a):o(()=>{n(a)})},s=()=>{const a=t;t=[],a.length&&o(()=>{i(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||s()}return l},batchCalls:a=>(...l)=>{r(()=>{a(...l)})},schedule:r,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{i=a},setScheduler:a=>{o=a}}}var Rt=Mk(),Dk=class extends Is{#e=!0;#t;#n;constructor(){super(),this.#n=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(n=>{n(t)}))}isOnline(){return this.#e}},ls=new Dk;function Fk(t){return Math.min(1e3*2**t,3e4)}function Ym(t){return(t??"online")==="online"?ls.isOnline():!0}var Cl=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function Gm(t){let e=!1,n=0,i;const o=Rk(),r=()=>o.status!=="pending",s=p=>{if(!r()){const _=new Cl(p);h(_),t.onCancel?.(_)}},a=()=>{e=!0},l=()=>{e=!1},c=()=>Hm.isFocused()&&(t.networkMode==="always"||ls.isOnline())&&t.canRun(),u=()=>Ym(t.networkMode)&&t.canRun(),d=p=>{r()||(i?.(),o.resolve(p))},h=p=>{r()||(i?.(),o.reject(p))},v=()=>new Promise(p=>{i=_=>{(r()||c())&&p(_)},t.onPause?.()}).then(()=>{i=void 0,r()||t.onContinue?.()}),f=()=>{if(r())return;let p;const _=n===0?t.initialPromise:void 0;try{p=_??t.fn()}catch(S){p=Promise.reject(S)}Promise.resolve(p).then(d).catch(S=>{if(r())return;const w=t.retry??(Km.isServer()?0:3),E=t.retryDelay??Fk,b=typeof E=="function"?E(n,S):E,C=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,S);if(e||!C){h(S);return}n++,t.onFail?.(n,S),Ok(b).then(()=>c()?void 0:v()).then(()=>{e?h(S):f()})})};return{promise:o,status:()=>o.status,cancel:s,continue:()=>(i?.(),o),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?f():v().then(f),o)}}var Qm=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Sk(this.gcTime)&&(this.#e=wl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Km.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(wl.clearTimeout(this.#e),this.#e=void 0)}};function Lk(t){return{onFetch:(e,n)=>{const i=e.options,o=e.fetchOptions?.meta?.fetchMore?.direction,r=e.state.data?.pages||[],s=e.state.data?.pageParams||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let u=!1;const d=f=>{Pk(f,()=>e.signal,()=>u=!0)},h=Wm(e.options,e.fetchOptions),v=async(f,p,_)=>{if(u)return Promise.reject(e.signal.reason);if(p==null&&f.pages.length)return Promise.resolve(f);const w=(()=>{const x={client:e.client,queryKey:e.queryKey,pageParam:p,direction:_?"backward":"forward",meta:e.options.meta};return d(x),x})(),E=await h(w),{maxPages:b}=e.options,C=_?Ak:kk;return{pages:C(f.pages,E,b),pageParams:C(f.pageParams,p,b)}};if(o&&r.length){const f=o==="backward",p=f?jk:ph,_={pages:r,pageParams:s},S=p(i,_);a=await v(_,S,f)}else{const f=t??r.length;do{const p=l===0?s[0]??i.initialPageParam:ph(i,a);if(l>0&&p==null)break;a=await v(a,p),l++}while(l<f)}return a};e.options.persister?e.fetchFn=()=>e.options.persister?.(c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n):e.fetchFn=c}}}function ph(t,{pages:e,pageParams:n}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,n[i],n):void 0}function jk(t,{pages:e,pageParams:n}){return e.length>0?t.getPreviousPageParam?.(e[0],e,n[0],n):void 0}var Nk=class extends Qm{#e;#t;#n;#i;#r;#o;#a;#s;constructor(t){super(),this.#s=!1,this.#a=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#r=t.client,this.#i=this.#r.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#t=mh(this.options),this.state=t.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#o?.promise}setOptions(t){if(this.options={...this.#a,...t},t?._type&&(this.#e=t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=mh(this.options);e.data!==void 0&&(this.setState(fh(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#i.remove(this)}setData(t,e){const n=$k(this.state.data,t,this.options);return this.#l({data:n,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),n}setState(t){this.#l({type:"setState",state:t})}cancel(t){const e=this.#o?.promise;return this.#o?.cancel(t),e?e.then(gn).catch(gn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>xk(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Oc||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>El(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ck(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#o?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#o?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#o&&(this.#s||this.#u()?this.#o.cancel({revert:!0}):this.#o.cancelRetry()),this.scheduleGc()),this.#i.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#o?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#o)return this.#o.continueRetry(),this.#o.promise}if(t&&this.setOptions(t),!this.options.queryFn){const l=this.observers.find(c=>c.options.queryFn);l&&this.setOptions(l.options)}const n=new AbortController,i=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},o=()=>{const l=Wm(this.options,e),u=(()=>{const d={client:this.#r,queryKey:this.queryKey,meta:this.meta};return i(d),d})();return this.#s=!1,this.options.persister?this.options.persister(l,u,this):l(u)},s=(()=>{const l={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:o};return i(l),l})();(this.#e==="infinite"?Lk(this.options.pages):this.options.behavior)?.onFetch(s,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==s.fetchOptions?.meta)&&this.#l({type:"fetch",meta:s.fetchOptions?.meta}),this.#o=Gm({initialPromise:e?.initialPromise,fn:s.fetchFn,onCancel:l=>{l instanceof Cl&&l.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(l,c)=>{this.#l({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0});try{const l=await this.#o.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#i.config.onSuccess?.(l,this),this.#i.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof Cl){if(l.silent)return this.#o.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#l({type:"error",error:l}),this.#i.config.onError?.(l,this),this.#i.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#l(t){const e=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Uk(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,...fh(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=t.manual?i:void 0,i;case"error":const o=t.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=e(this.state),Rt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#i.notify({query:this,type:"updated",action:t})})}};function Uk(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ym(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function fh(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function mh(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,i=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var zk=class extends Qm{#e;#t;#n;#i;constructor(t){super(),this.#e=t.client,this.mutationId=t.mutationId,this.#n=t.mutationCache,this.#t=[],this.state=t.state||Vk(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(e=>e!==t),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=Gm({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(r,s)=>{this.#r({type:"failed",failureCount:r,error:s})},onPause:()=>{this.#r({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const i=this.state.status==="pending",o=!this.#i.canStart();try{if(i)e();else{this.#r({type:"pending",variables:t,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(t,this,n);const s=await this.options.onMutate?.(t,n);s!==this.state.context&&this.#r({type:"pending",context:s,variables:t,isPaused:o})}const r=await this.#i.start();return await this.#n.config.onSuccess?.(r,t,this.state.context,this,n),await this.options.onSuccess?.(r,t,this.state.context,n),await this.#n.config.onSettled?.(r,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(r,null,t,this.state.context,n),this.#r({type:"success",data:r}),r}catch(r){try{await this.#n.config.onError?.(r,t,this.state.context,this,n)}catch(s){Promise.reject(s)}try{await this.options.onError?.(r,t,this.state.context,n)}catch(s){Promise.reject(s)}try{await this.#n.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,n)}catch(s){Promise.reject(s)}try{await this.options.onSettled?.(void 0,r,t,this.state.context,n)}catch(s){Promise.reject(s)}throw this.#r({type:"error",error:r}),r}finally{this.#n.runNext(this)}}#r(t){const e=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),Rt.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:"updated",action:t})})}};function Vk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Xm=class extends Is{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,n,i){const o=new zk({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(n),state:i});return this.add(o),o}add(e){this.#e.add(e);const n=$r(e);if(typeof n=="string"){const i=this.#t.get(n);i?i.push(e):this.#t.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const n=$r(e);if(typeof n=="string"){const i=this.#t.get(n);if(i)if(i.length>1){const o=i.indexOf(e);o!==-1&&i.splice(o,1)}else i[0]===e&&this.#t.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=$r(e);if(typeof n=="string"){const o=this.#t.get(n)?.find(r=>r.state.status==="pending");return!o||o===e}else return!0}runNext(e){const n=$r(e);return typeof n=="string"?this.#t.get(n)?.find(o=>o!==e&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Rt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const n={exact:!0,...e};return this.getAll().find(i=>uh(n,i))}findAll(e={}){return this.getAll().filter(n=>uh(e,n))}notify(e){Rt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Rt.batch(()=>Promise.all(e.map(n=>n.continue().catch(gn))))}};function $r(t){return t.options.scope?.id}var Jm=class extends Is{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,i){const o=n.queryKey,r=n.queryHash??Tc(o,n);let s=this.get(r);return s||(s=new Nk({client:e,queryKey:o,queryHash:r,options:e.defaultQueryOptions(n),state:i,defaultOptions:e.getQueryDefaults(o)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#e.get(e.queryHash);n&&(e.destroy(),n===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Rt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(i=>ch(n,i))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(i=>ch(e,i)):n}notify(e){Rt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Rt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Rt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Bk=class{#e;#t;#n;#i;#r;#o;#a;#s;constructor(e={}){this.#e=e.queryCache||new Jm,this.#t=e.mutationCache||new Xm,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=Hm.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ls.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#a?.(),this.#a=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),i=this.#e.build(this,n),o=i.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(El(n.staleTime,i))&&this.prefetchQuery(n),Promise.resolve(o))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:n,state:i})=>{const o=i.data;return[n,o]})}setQueryData(e,n,i){const o=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(o.queryHash)?.state.data,a=Ek(n,s);if(a!==void 0)return this.#e.build(this,o).setData(a,{...i,manual:!0})}setQueriesData(e,n,i){return Rt.batch(()=>this.#e.findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,n,i)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state}removeQueries(e){const n=this.#e;Rt.batch(()=>{n.findAll(e).forEach(i=>{n.remove(i)})})}resetQueries(e,n){const i=this.#e;return Rt.batch(()=>(i.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const i={revert:!0,...n},o=Rt.batch(()=>this.#e.findAll(e).map(r=>r.cancel(i)));return Promise.all(o).then(gn).catch(gn)}invalidateQueries(e,n={}){return Rt.batch(()=>(this.#e.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const i={...n,cancelRefetch:n.cancelRefetch??!0},o=Rt.batch(()=>this.#e.findAll(e).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let s=r.fetch(void 0,i);return i.throwOnError||(s=s.catch(gn)),r.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(o).then(gn)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const i=this.#e.build(this,n);return i.isStaleByTime(El(n.staleTime,i))?i.fetch(n):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(gn).catch(gn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(gn).catch(gn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return ls.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,n){this.#i.set(Lo(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#i.values()],i={};return n.forEach(o=>{jo(e,o.queryKey)&&Object.assign(i,o.defaultOptions)}),i}setMutationDefaults(e,n){this.#r.set(Lo(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#r.values()],i={};return n.forEach(o=>{jo(e,o.mutationKey)&&Object.assign(i,o.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=Tc(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===Oc&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function xl(t,e,n="",i=0){if(e){const o=e(t,n,i);if(o===void 0&&ys(t)||o!==void 0)return o}if(Array.isArray(t))return t.map((o,r)=>xl(o,e,String(r),i+1));if(typeof t=="object"&&qk(t)){const o=Object.entries(t).map(([r,s])=>[r,xl(s,e,r,i+1)]);return Object.fromEntries(o)}return t}function Hk(t,e){return xl(t,e)}function qe(t,e=!1){return Hk(t,(n,i,o)=>{if(o===1&&i==="queryKey")return qe(n,!0);if(e&&Wk(n))return qe(n(),e);if(ys(n))return qe(m(n),e)})}function qk(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function Wk(t){return typeof t=="function"}var Kk=class extends Jm{find(t){return super.find(qe(t))}findAll(t={}){return super.findAll(qe(t))}},Yk=class extends Xm{find(t){return super.find(qe(t))}findAll(t={}){return super.findAll(qe(t))}},Gk=class extends Bk{constructor(t={}){const e={defaultOptions:t.defaultOptions,queryCache:t.queryCache||new Kk,mutationCache:t.mutationCache||new Yk};super(e),this.isRestoring=H(!1)}isFetching(t={}){return super.isFetching(qe(t))}isMutating(t={}){return super.isMutating(qe(t))}getQueryData(t){return super.getQueryData(qe(t))}ensureQueryData(t){return super.ensureQueryData(qe(t))}getQueriesData(t){return super.getQueriesData(qe(t))}setQueryData(t,e,n={}){return super.setQueryData(qe(t),e,qe(n))}setQueriesData(t,e,n={}){return super.setQueriesData(qe(t),e,qe(n))}getQueryState(t){return super.getQueryState(qe(t))}removeQueries(t={}){return super.removeQueries(qe(t))}resetQueries(t={},e={}){return super.resetQueries(qe(t),qe(e))}cancelQueries(t={},e={}){return super.cancelQueries(qe(t),qe(e))}invalidateQueries(t={},e={}){const n=qe(t),i=qe(e);if(super.invalidateQueries({...n,refetchType:"none"},i),n.refetchType==="none")return Promise.resolve();const o={...n,type:n.refetchType??n.type??"active"};return Ge().then(()=>super.refetchQueries(o,i))}refetchQueries(t={},e={}){return super.refetchQueries(qe(t),qe(e))}fetchQuery(t){return super.fetchQuery(qe(t))}prefetchQuery(t){return super.prefetchQuery(qe(t))}fetchInfiniteQuery(t){return super.fetchInfiniteQuery(qe(t))}prefetchInfiniteQuery(t){return super.prefetchInfiniteQuery(qe(t))}setDefaultOptions(t){super.setDefaultOptions(qe(t))}setQueryDefaults(t,e){super.setQueryDefaults(qe(t),qe(e))}getQueryDefaults(t){return super.getQueryDefaults(qe(t))}setMutationDefaults(t,e){super.setMutationDefaults(qe(t),qe(e))}getMutationDefaults(t){return super.getMutationDefaults(qe(t))}};class Tl extends Error{cause;isNetworkError;request;constructor(e,n=null){super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=n}}class Qk{#e;#t=!1;#n;#i;constructor(e,n){this.#i=e,this.#n=()=>n(e)}progress(){this.#t||this.#i>0&&(clearTimeout(this.#e),this.#e=setTimeout(this.#n,this.#i))}done(){this.#t||(clearTimeout(this.#e),this.#e=void 0,this.#t=!0)}}const kr=()=>{};function Xk(t,e={}){const{body:n=null,headers:i={},method:o="GET",onBeforeRequest:r=kr,onUploadProgress:s=kr,shouldRetry:a=()=>!0,onAfterResponse:l=kr,onTimeout:c=kr,responseType:u,retries:d=3,signal:h=null,timeout:v=3e4,withCredentials:f=!1}=e,p=w=>.3*2**(w-1)*1e3,_=new Qk(v,c);function S(w=0){return new Promise(async(E,b)=>{const C=new XMLHttpRequest,x=O=>{a(C)&&w<d?setTimeout(()=>{S(w+1).then(E,b)},p(w)):(_.done(),b(O))};C.open(o,t,!0),C.withCredentials=f,u&&(C.responseType=u),C.onload=async()=>{try{await l(C,w)}catch(O){O.request=C,x(O);return}C.status>=200&&C.status<300?(_.done(),E(C)):a(C)&&w<d?setTimeout(()=>{S(w+1).then(E,b)},p(w)):(_.done(),b(new Tl(C.statusText,C)))},C.onerror=()=>x(new Tl(C.statusText,C)),C.upload.onprogress=O=>{_.progress(),s(O)},i&&Object.keys(i).forEach(O=>{C.setRequestHeader(O,i[O])});function k(){C.abort(),b(new DOMException("Aborted","AbortError"))}if(h?.addEventListener("abort",k),h?.aborted){k();return}await r(C,w),C.send(n)})}return S()}const Jk=t=>"error"in t&&!!t.error,Zk=t=>t.progress.uploadComplete;function eA(t){return t.filter(e=>!Jk(e)&&!Zk(e))}function tA(t){return t.filter(e=>!e.progress?.uploadStarted||!e.isRestored)}function Zm(t){const e=t.lastIndexOf(".");return e===-1||e===t.length-1?{name:t,extension:void 0}:{name:t.slice(0,e),extension:t.slice(e+1)}}const vh={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",msg:"application/vnd.ms-outlook",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function ev(t){if(t.type)return t.type;const e=t.name?Zm(t.name).extension?.toLowerCase():null;return e&&e in vh?vh[e]:"application/octet-stream"}function nA(t){return t.charCodeAt(0).toString(32)}function gh(t){let e="";return t.replace(/[^A-Z0-9]/gi,n=>(e+=`-${nA(n)}`,"/"))+e}function iA(t,e){let n=e||"uppy";return typeof t.name=="string"&&(n+=`-${gh(t.name.toLowerCase())}`),t.type!==void 0&&(n+=`-${t.type}`),t.meta&&typeof t.meta.relativePath=="string"&&(n+=`-${gh(t.meta.relativePath.toLowerCase())}`),t.data?.size!==void 0&&(n+=`-${t.data.size}`),t.data.lastModified!==void 0&&(n+=`-${t.data.lastModified}`),n}function oA(t){return!t.isRemote||!t.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(t.remote.provider)}function rA(t,e){if(oA(t))return t.id;const n=ev(t);return iA({...t,type:n},e)}function _h(t,e){return t===!0?Object.keys(e):Array.isArray(t)?t:[]}function va(t){return t<10?`0${t}`:t.toString()}function Qr(){const t=new Date,e=va(t.getHours()),n=va(t.getMinutes()),i=va(t.getSeconds());return`${e}:${n}:${i}`}function sA(t){return t?t.readyState===4&&t.status===0:!1}class aA{#e=[];#t=0;#n;#i=!1;constructor(e){const n=e?.concurrency;this.#n=typeof n!="number"||n===0?1/0:n}add(e){const n=new AbortController;let i,o;const r=new Promise((a,l)=>{i=a,o=l}),s={run:()=>e(n.signal),resolve:i,reject:o,controller:n};return n.signal.addEventListener("abort",()=>{const a=this.#e.indexOf(s);a!==-1&&(this.#e.splice(a,1),o(n.signal.reason??new DOMException("Aborted","AbortError")))},{once:!0}),r.abort=a=>{n.abort(a??new DOMException("Aborted","AbortError"))},r.abortOn=a=>{if(a){const l=()=>r.abort(a.reason);a.addEventListener("abort",l,{once:!0}),r.then(()=>a.removeEventListener("abort",l),()=>a.removeEventListener("abort",l))}return r},!this.#i&&this.#t<this.#n?this.#r(s):this.#e.push(s),r}#r(e){if(this.#t++,e.controller.signal.aborted){this.#t--,e.reject(e.controller.signal.reason??new DOMException("Aborted","AbortError")),this.#o();return}let n;try{n=e.run()}catch(i){n=Promise.reject(i)}n.then(i=>{e.controller.signal.aborted?e.reject(e.controller.signal.reason??new DOMException("Aborted","AbortError")):e.resolve(i)},i=>{e.reject(i)}).finally(()=>{this.#t--,this.#o()})}#o(){queueMicrotask(()=>{if(!(this.#i||this.#t>=this.#n))for(;this.#e.length>0;){const e=this.#e.shift();if(!e.controller.signal.aborted){this.#r(e);return}}})}pause(){this.#i=!0}resume(){this.#i=!1;const e=this.#n-this.#t;for(let n=0;n<e;n++)this.#o()}clear(e){const n=this.#e.splice(0),i=e??new DOMException("Cleared","AbortError");for(const o of n)o.controller.abort(i),o.reject(i)}get concurrency(){return this.#n}set concurrency(e){if(this.#n=typeof e!="number"||e===0?1/0:e,!this.#i){const n=this.#n-this.#t;for(let i=0;i<n;i++)this.#o()}}get pending(){return this.#e.length}get running(){return this.#t}get isPaused(){return this.#i}wrapPromiseFunction(e){return(...n)=>this.add(i=>e(...n))}}function lA(t,e,n){const i=[];return t.forEach(o=>typeof o!="string"?i.push(o):e[Symbol.split](o).forEach((r,s,a)=>{r!==""&&i.push(r),s<a.length-1&&i.push(n)})),i}function yh(t,e){const n=/\$/g,i="$$$$";let o=[t];if(e==null)return o;for(const r of Object.keys(e))if(r!=="_"){let s=e[r];typeof s=="string"&&(s=n[Symbol.replace](s,i)),o=lA(o,new RegExp(`%\\{${r}\\}`,"g"),s)}return o}const cA=t=>{throw new Error(`missing string: ${t}`)};class tv{locale;constructor(e,{onMissingKey:n=cA}={}){this.locale={strings:{},pluralize(i){return i===1?0:1}},Array.isArray(e)?e.forEach(this.#t,this):this.#t(e),this.#e=n}#e;#t(e){if(!e?.strings)return;const n=this.locale;Object.assign(this.locale,{strings:{...n.strings,...e.strings},pluralize:e.pluralize||n.pluralize})}translate(e,n){return this.translateArray(e,n).join("")}translateArray(e,n){let i=this.locale.strings[e];if(i==null&&(this.#e(e),i=e),typeof i=="object"){if(n&&typeof n.smart_count<"u"){const r=this.locale.pluralize(n.smart_count);return yh(i[r],n)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof i!="string")throw new Error("string was not a string");return yh(i,n)}}class uA{uppy;opts;id;defaultLocale;i18n;i18nArray;type;VERSION;constructor(e,n){this.uppy=e,this.opts=n??{}}getPluginState(){const{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){const{plugins:n}=this.uppy.getState();this.uppy.setState({plugins:{...n,[this.id]:{...n[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){const e=new tv([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}}class dA{#e;#t=[];constructor(e){this.#e=e}on(e,n){return this.#t.push([e,n]),this.#e.on(e,n)}remove(){for(const[e,n]of this.#t.splice(0))this.#e.off(e,n)}onFilePause(e,n){this.on("upload-pause",(i,o)=>{e===i?.id&&n(o)})}onFileRemove(e,n){this.on("file-removed",i=>{e===i.id&&n(i.id)})}onPause(e,n){this.on("upload-pause",(i,o)=>{e===i?.id&&n(o)})}onRetry(e,n){this.on("upload-retry",i=>{e===i?.id&&n()})}onRetryAll(e,n){this.on("retry-all",()=>{this.#e.getFile(e)&&n()})}onPauseAll(e,n){this.on("pause-all",()=>{this.#e.getFile(e)&&n()})}onCancelAll(e,n){this.on("cancel-all",(...i)=>{this.#e.getFile(e)&&n(...i)})}onResumeAll(e,n){this.on("resume-all",()=>{this.#e.getFile(e)&&n()})}}const hA={debug:()=>{},warn:()=>{},error:(...t)=>console.error(`[Uppy] [${Qr()}]`,...t)},pA={debug:(...t)=>console.debug(`[Uppy] [${Qr()}]`,...t),warn:(...t)=>console.warn(`[Uppy] [${Qr()}]`,...t),error:(...t)=>console.error(`[Uppy] [${Qr()}]`,...t)};var ga,bh;function fA(){return bh||(bh=1,ga=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);const n=e<0;let i=Math.abs(e);if(n&&(i=-i),i===0)return"0 B";const o=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.min(Math.floor(Math.log(i)/Math.log(1024)),o.length-1),s=Number(i/1024**r),a=o[r];return`${s>=10||s%1===0?Math.round(s):s.toFixed(1)} ${a}`}),ga}var mA=fA();const Ar=Fi(mA);var _a,wh;function vA(){if(wh)return _a;wh=1;function t(e,n){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=n,this.parts=e.split(n)}return t.prototype.match=function(e){var n=!0,i=this.parts,o,r=i.length,s;if(typeof e=="string"||e instanceof String)if(!this.hasWild&&this.text!=e)n=!1;else{for(s=(e||"").split(this.separator),o=0;n&&o<r;o++)i[o]!=="*"&&(o<s.length?n=i[o]===s[o]:n=!1);n=n&&s}else if(typeof e.splice=="function")for(n=[],o=e.length;o--;)this.match(e[o])&&(n[n.length]=e[o]);else if(typeof e=="object"){n={};for(var a in e)this.match(a)&&(n[a]=e[a])}return n},_a=function(e,n,i){var o=new t(e,i||/[\/\.]/);return typeof n<"u"?o.match(n):o},_a}var ya,Eh;function gA(){if(Eh)return ya;Eh=1;var t=vA(),e=/[\/\+\.]/;return ya=function(n,i){function o(r){var s=t(r,n,e);return s&&s.length>=2}return i?o(i.split(";")[0]):o},ya}var _A=gA();const yA=Fi(_A),bA={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class _n extends Error{isUserFacing;file;constructor(e,n){super(e),this.isUserFacing=n?.isUserFacing??!0,n?.file&&(this.file=n.file)}isRestriction=!0}class wA{getI18n;getOpts;constructor(e,n){this.getI18n=n,this.getOpts=()=>{const i=e();if(i.restrictions?.allowedFileTypes!=null&&!Array.isArray(i.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return i}}validateAggregateRestrictions(e,n){const{maxTotalFileSize:i,maxNumberOfFiles:o}=this.getOpts().restrictions;if(o&&e.filter(s=>!s.isGhost).length+n.length>o)throw new _n(`${this.getI18n()("youCanOnlyUploadX",{smart_count:o})}`);if(i){const r=[...e,...n].reduce((s,a)=>s+(a.size??0),0);if(r>i)throw new _n(this.getI18n()("aggregateExceedsSize",{sizeAllowed:Ar(i),size:Ar(r)}))}}validateSingleFile(e){const{maxFileSize:n,minFileSize:i,allowedFileTypes:o}=this.getOpts().restrictions;if(o&&!o.some(s=>s.includes("/")?e.type?yA(e.type.replace(/;.*?$/,""),s):!1:s[0]==="."&&e.extension?e.extension.toLowerCase()===s.slice(1).toLowerCase():!1)){const s=o.join(", ");throw new _n(this.getI18n()("youCanOnlyUploadFileTypes",{types:s}),{file:e})}if(n&&e.size!=null&&e.size>n)throw new _n(this.getI18n()("exceedsSize",{size:Ar(n),file:e.name??this.getI18n()("unnamed")}),{file:e});if(i&&e.size!=null&&e.size<i)throw new _n(this.getI18n()("inferiorSize",{size:Ar(i)}),{file:e})}validate(e,n){n.forEach(i=>{this.validateSingleFile(i)}),this.validateAggregateRestrictions(e,n)}validateMinNumberOfFiles(e){const{minNumberOfFiles:n}=this.getOpts().restrictions;if(n&&Object.keys(e).length<n)throw new _n(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:n}))}getMissingRequiredMetaFields(e){const n=new _n(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name??this.getI18n()("unnamed")})),{requiredMetaFields:i}=this.getOpts().restrictions,o=[];for(const r of i)(!Object.hasOwn(e.meta,r)||e.meta[r]==="")&&o.push(r);return{missingFields:o,error:n}}}const EA="5.0.0",SA={version:EA};class CA{static VERSION=SA.version;state={};#e=new Set;getState(){return this.state}setState(e){const n={...this.state},i={...this.state,...e};this.state=i,this.#t(n,i,e)}subscribe(e){return this.#e.add(e),()=>{this.#e.delete(e)}}#t(...e){this.#e.forEach(n=>{n(...e)})}}var ba,Sh;function $c(){if(Sh)return ba;Sh=1;function t(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}return ba=t,ba}var wa,Ch;function xA(){if(Ch)return wa;Ch=1;var t=typeof mr=="object"&&mr&&mr.Object===Object&&mr;return wa=t,wa}var Ea,xh;function nv(){if(xh)return Ea;xh=1;var t=xA(),e=typeof self=="object"&&self&&self.Object===Object&&self,n=t||e||Function("return this")();return Ea=n,Ea}var Sa,Th;function TA(){if(Th)return Sa;Th=1;var t=nv(),e=function(){return t.Date.now()};return Sa=e,Sa}var Ca,Oh;function OA(){if(Oh)return Ca;Oh=1;var t=/\s/;function e(n){for(var i=n.length;i--&&t.test(n.charAt(i)););return i}return Ca=e,Ca}var xa,$h;function $A(){if($h)return xa;$h=1;var t=OA(),e=/^\s+/;function n(i){return i&&i.slice(0,t(i)+1).replace(e,"")}return xa=n,xa}var Ta,kh;function iv(){if(kh)return Ta;kh=1;var t=nv(),e=t.Symbol;return Ta=e,Ta}var Oa,Ah;function kA(){if(Ah)return Oa;Ah=1;var t=iv(),e=Object.prototype,n=e.hasOwnProperty,i=e.toString,o=t?t.toStringTag:void 0;function r(s){var a=n.call(s,o),l=s[o];try{s[o]=void 0;var c=!0}catch{}var u=i.call(s);return c&&(a?s[o]=l:delete s[o]),u}return Oa=r,Oa}var $a,Ph;function AA(){if(Ph)return $a;Ph=1;var t=Object.prototype,e=t.toString;function n(i){return e.call(i)}return $a=n,$a}var ka,Rh;function PA(){if(Rh)return ka;Rh=1;var t=iv(),e=kA(),n=AA(),i="[object Null]",o="[object Undefined]",r=t?t.toStringTag:void 0;function s(a){return a==null?a===void 0?o:i:r&&r in Object(a)?e(a):n(a)}return ka=s,ka}var Aa,Ih;function RA(){if(Ih)return Aa;Ih=1;function t(e){return e!=null&&typeof e=="object"}return Aa=t,Aa}var Pa,Mh;function IA(){if(Mh)return Pa;Mh=1;var t=PA(),e=RA(),n="[object Symbol]";function i(o){return typeof o=="symbol"||e(o)&&t(o)==n}return Pa=i,Pa}var Ra,Dh;function MA(){if(Dh)return Ra;Dh=1;var t=$A(),e=$c(),n=IA(),i=NaN,o=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return i;if(e(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=e(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=t(c);var d=r.test(c);return d||s.test(c)?a(c.slice(2),d?2:8):o.test(c)?i:+c}return Ra=l,Ra}var Ia,Fh;function DA(){if(Fh)return Ia;Fh=1;var t=$c(),e=TA(),n=MA(),i="Expected a function",o=Math.max,r=Math.min;function s(a,l,c){var u,d,h,v,f,p,_=0,S=!1,w=!1,E=!0;if(typeof a!="function")throw new TypeError(i);l=n(l)||0,t(c)&&(S=!!c.leading,w="maxWait"in c,h=w?o(n(c.maxWait)||0,l):h,E="trailing"in c?!!c.trailing:E);function b(M){var q=u,le=d;return u=d=void 0,_=M,v=a.apply(le,q),v}function C(M){return _=M,f=setTimeout(O,l),S?b(M):v}function x(M){var q=M-p,le=M-_,de=l-q;return w?r(de,h-le):de}function k(M){var q=M-p,le=M-_;return p===void 0||q>=l||q<0||w&&le>=h}function O(){var M=e();if(k(M))return K(M);f=setTimeout(O,x(M))}function K(M){return f=void 0,E&&u?b(M):(u=d=void 0,v)}function D(){f!==void 0&&clearTimeout(f),_=0,u=p=d=f=void 0}function P(){return f===void 0?v:K(e())}function U(){var M=e(),q=k(M);if(u=arguments,d=this,p=M,q){if(f===void 0)return C(p);if(w)return clearTimeout(f),f=setTimeout(O,l),b(p)}return f===void 0&&(f=setTimeout(O,l)),v}return U.cancel=D,U.flush=P,U}return Ia=s,Ia}var Ma,Lh;function FA(){if(Lh)return Ma;Lh=1;var t=DA(),e=$c(),n="Expected a function";function i(o,r,s){var a=!0,l=!0;if(typeof o!="function")throw new TypeError(n);return e(s)&&(a="leading"in s?!!s.leading:a,l="trailing"in s?!!s.trailing:l),t(o,r,{leading:a,maxWait:r,trailing:l})}return Ma=i,Ma}var LA=FA();const jA=Fi(LA);var Da,jh;function NA(){return jh||(jh=1,Da=function(){var e={},n=e._fns={};e.emit=function(s,a,l,c,u,d,h){var v=i(s);v.length&&o(s,v,[a,l,c,u,d,h])},e.on=function(s,a){n[s]||(n[s]=[]),n[s].push(a)},e.once=function(s,a){function l(){a.apply(this,arguments),e.off(s,l)}this.on(s,l)},e.off=function(s,a){var l=[];if(s&&a){var c=this._fns[s],u=0,d=c?c.length:0;for(u;u<d;u++)c[u]!==a&&l.push(c[u])}l.length?this._fns[s]=l:delete this._fns[s]};function i(r){var s=n[r]?n[r]:[],a=r.indexOf(":"),l=a===-1?[r]:[r.substring(0,a),r.substring(a+1)],c=Object.keys(n),u=0,d=c.length;for(u;u<d;u++){var h=c[u];if(h==="*"&&(s=s.concat(n[h])),l.length===2&&l[0]===h){s=s.concat(n[h]);break}}return s}function o(r,s,a){var l=0,c=s.length;for(l;l<c&&s[l];l++)s[l].event=r,s[l].apply(s[l],a)}return e}),Da}var UA=NA();const zA=Fi(UA);let VA="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",BA=(t=21)=>{let e="",n=t|0;for(;n--;)e+=VA[Math.random()*64|0];return e};const HA="5.2.0",qA={version:HA};function WA(t,e){return e.name?e.name:t.split("/")[0]==="image"?`${t.split("/")[0]}.${t.split("/")[1]}`:"noname"}const KA={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};function YA(t){if(t==null&&typeof navigator<"u"&&(t=navigator.userAgent),!t)return!0;const e=/Edge\/(\d+\.\d+)/.exec(t);if(!e)return!0;const i=e[1].split(".",2),o=parseInt(i[0],10),r=parseInt(i[1],10);return o<15||o===15&&r<15063||o>18||o===18&&r>=18218}const Pr={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};class kc{static VERSION=qA.version;#e=Object.create(null);#t;#n;#i=zA();#r=new Set;#o=new Set;#a=new Set;defaultLocale;locale;opts;store;i18n;i18nArray;scheduledAutoProceed=null;wasOffline=!1;constructor(e){this.defaultLocale=KA;const n={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:bA,meta:{},onBeforeFileAdded:(o,r)=>!Object.hasOwn(r,o.id),onBeforeUpload:o=>o,store:new CA,logger:hA,infoTimeout:5e3},i={...n,...e};this.opts={...i,restrictions:{...n.restrictions,...e?.restrictions}},e?.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e?.debug&&(this.opts.logger=pA),this.log(`Using Core v${kc.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...Pr,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:YA(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),this.#t=new wA(()=>this.opts,()=>this.i18n),this.#n=this.store.subscribe((o,r,s)=>{this.emit("state-update",o,r,s),this.updateAll(r)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),this.#x()}emit(e,...n){this.#i.emit(e,...n)}on(e,n){return this.#i.on(e,n),this}once(e,n){return this.#i.once(e,n),this}off(e,n){return this.#i.off(e,n),this}updateAll(e){this.iteratePlugins(n=>{n.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){const n=this.getState().files;this.setState({files:{...n,...Object.fromEntries(Object.entries(e).map(([i,o])=>[i,{...n[i],...o}]))}})}setFileState(e,n){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:n})}i18nInit(){const e=i=>this.log(`Missing i18n string: ${i}`,"error"),n=new tv([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=n.translate.bind(n),this.i18nArray=n.translateArray.bind(n),this.locale=n.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e?.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(n=>{n.setOptions(e)}),this.setState(void 0)}resetProgress(){const e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},n={...this.getState().files},i=Object.create(null);Object.keys(n).forEach(o=>{i[o]={...n[o],progress:{...n[o].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:i,...Pr})}clear(){const{capabilities:e,currentUploads:n}=this.getState();if(Object.keys(n).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...Pr,files:{}})}addPreProcessor(e){this.#r.add(e)}removePreProcessor(e){return this.#r.delete(e)}addPostProcessor(e){this.#a.add(e)}removePostProcessor(e){return this.#a.delete(e)}addUploader(e){this.#o.add(e)}removeUploader(e){return this.#o.delete(e)}setMeta(e){const n={...this.getState().meta,...e},i={...this.getState().files};Object.keys(i).forEach(o=>{i[o]={...i[o],meta:{...i[o].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:n,files:i})}setFileMeta(e,n){const i={...this.getState().files};if(!i[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}const o={...i[e].meta,...n};i[e]={...i[e],meta:o},this.setState({files:i})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(n=>this.getFile(n))}getObjectOfFilesPerState(){const{files:e,totalProgress:n,error:i}=this.getState(),o=Object.values(e),r=[],s=[],a=[],l=[],c=[],u=[],d=[],h=[],v=[];for(const f of o){const{progress:p}=f;!p.uploadComplete&&p.uploadStarted&&(r.push(f),f.isPaused||h.push(f)),p.uploadStarted||s.push(f),(p.uploadStarted||p.preprocess||p.postprocess)&&a.push(f),p.uploadStarted&&l.push(f),f.isPaused&&c.push(f),p.uploadComplete&&u.push(f),f.error&&d.push(f),(p.preprocess||p.postprocess)&&v.push(f)}return{newFiles:s,startedFiles:a,uploadStartedFiles:l,pausedFiles:c,completeFiles:u,erroredFiles:d,inProgressFiles:r,inProgressNotPausedFiles:h,processingFiles:v,isUploadStarted:l.length>0,isAllComplete:n===100&&u.length===o.length&&v.length===0,isAllErrored:!!i&&d.length===o.length,isAllPaused:r.length!==0&&c.length===r.length,isUploadInProgress:r.length>0,isSomeGhost:o.some(f=>f.isGhost)}}#s(e){for(const s of e)s.isRestriction?this.emit("restriction-failed",s.file,s):this.emit("error",s,s.file),this.log(s,"warning");const n=e.filter(s=>s.isUserFacing),i=4,o=n.slice(0,i),r=n.slice(i);o.forEach(({message:s,details:a=""})=>{this.info({message:s,details:a},"error",this.opts.infoTimeout)}),r.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:r.length})})}validateRestrictions(e,n=this.getFiles()){try{this.#t.validate(n,[e])}catch(i){return i}return null}validateSingleFile(e){try{this.#t.validateSingleFile(e)}catch(n){return n.message}return null}validateAggregateRestrictions(e){const n=this.getFiles();try{this.#t.validateAggregateRestrictions(n,e)}catch(i){return i.message}return null}#u(e){const{missingFields:n,error:i}=this.#t.getMissingRequiredMetaFields(e);return n.length>0?(this.setFileState(e.id,{missingRequiredMetaFields:n,error:i.message}),this.log(i.message),this.emit("restriction-failed",e,i),!1):(n.length===0&&e.missingRequiredMetaFields&&this.setFileState(e.id,{missingRequiredMetaFields:[]}),!0)}#l(e){let n=!0;for(const i of Object.values(e))this.#u(i)||(n=!1);return n}#w(e){const{allowNewUpload:n}=this.getState();if(n===!1){const i=new _n(this.i18n("noMoreFilesAllowed"),{file:e});throw this.#s([i]),i}}checkIfFileAlreadyExists(e){const{files:n}=this.getState();return!!(n[e]&&!n[e].isGhost)}#E(e){const n=e instanceof File?{name:e.name,type:e.type,size:e.size,data:e,meta:{},isRemote:!1,source:void 0,preview:void 0}:e,i=ev(n),o=WA(i,n),r=Zm(o).extension,s=rA(n,this.getID()),a={...n.meta,name:o,type:i},l=Number.isFinite(n.data.size)?n.data.size:null;return{source:n.source||"",id:s,name:o,extension:r||"",meta:{...this.getState().meta,...a},type:i,progress:{percentage:0,bytesUploaded:!1,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,isGhost:!1,...n.isRemote?{isRemote:!0,remote:n.remote,data:n.data}:{isRemote:!1,data:n.data},preview:n.preview}}#f(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))}#m(e){let{files:n}=this.getState(),i={...n};const o=[],r=[];for(const s of e)try{let a=this.#E(s);this.#w(a);const l=n[a.id],c=l?.isGhost;if(c&&!a.isRemote){if(a.data==null)throw new Error("File data is missing");a={...l,isGhost:!1,data:a.data},this.log(`Replaced the blob in the restored ghost file: ${a.name}, ${a.id}`)}const u=this.opts.onBeforeFileAdded(a,i);if(n=this.getState().files,i={...n,...i},!u&&this.checkIfFileAlreadyExists(a.id))throw new _n(this.i18n("noDuplicates",{fileName:a.name??this.i18n("unnamed")}),{file:a});if(u===!1&&!c)throw new _n("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:a});typeof u=="object"&&u!==null&&(a=u),this.#t.validateSingleFile(a),i[a.id]=a,o.push(a)}catch(a){r.push(a)}try{this.#t.validateAggregateRestrictions(Object.values(n),o)}catch(s){return r.push(s),{nextFilesState:n,validFilesToAdd:[],errors:r}}return{nextFilesState:i,validFilesToAdd:o,errors:r}}addFile(e){const{nextFilesState:n,validFilesToAdd:i,errors:o}=this.#m([e]),r=o.filter(a=>a.isRestriction);if(this.#s(r),o.length>0)throw o[0];this.setState({files:n});const[s]=i;return this.emit("file-added",s),this.emit("files-added",i),this.log(`Added file: ${s.name}, ${s.id}, mime type: ${s.type}`),this.#f(),s.id}addFiles(e){const{nextFilesState:n,validFilesToAdd:i,errors:o}=this.#m(e),r=o.filter(a=>a.isRestriction);this.#s(r);const s=o.filter(a=>!a.isRestriction);if(s.length>0){let a=`Multiple errors occurred while adding files:
|
|
17
17
|
`;if(s.forEach(l=>{a+=`
|
|
18
18
|
* ${l.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:s.length}),details:a},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(s,a);{const l=new Error(a);throw l.errors=s,l}}this.setState({files:n}),i.forEach(a=>{this.emit("file-added",a)}),this.emit("files-added",i),i.length>5?this.log(`Added batch of ${i.length} files`):Object.values(i).forEach(a=>{this.log(`Added file: ${a.name}
|
|
19
19
|
id: ${a.id}
|
|
20
|
-
type: ${a.type}`)}),i.length>0&&this.#f()}removeFiles(e){const{files:n,currentUploads:i}=this.getState(),o={...n},r={...i},s=Object.create(null);e.forEach(u=>{n[u]&&(s[u]=n[u],delete o[u])});function a(u){return s[u]===void 0}Object.keys(r).forEach(u=>{const d=i[u].fileIDs.filter(a);if(d.length===0){delete r[u];return}const{capabilities:h}=this.getState();if(d.length!==i[u].fileIDs.length&&!h.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");r[u]={...i[u],fileIDs:d}});const l={currentUploads:r,files:o};Object.keys(o).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),this.#d();const c=Object.keys(s);c.forEach(u=>{this.emit("file-removed",s[u])}),c.length>5?this.log(`Removed ${c.length} files`):this.log(`Removed files: ${c.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;const n=this.getFile(e),o=!(n.isPaused||!1);return this.setFileState(e,{isPaused:o}),this.emit("upload-pause",n,o),o}pauseAll(){const e={...this.getState().files};Object.keys(e).filter(i=>!e[i].progress.uploadComplete&&e[i].progress.uploadStarted).forEach(i=>{const o={...e[i],isPaused:!0};e[i]=o}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(i=>!e[i].progress.uploadComplete&&e[i].progress.uploadStarted).forEach(i=>{const o={...e[i],isPaused:!1,error:null};e[i]=o}),this.setState({files:e}),this.emit("resume-all")}#v(){const{files:e}=this.getState();return Object.keys(e).filter(n=>{const i=e[n];return i.error&&(!i.missingRequiredMetaFields||i.missingRequiredMetaFields.length===0)})}async#g(){const e=this.#v(),n={...this.getState().files};if(e.forEach(o=>{n[o]={...n[o],isPaused:!1,error:null}}),this.setState({files:n,error:null}),this.emit("retry-all",this.getFilesByIds(e)),e.length===0)return{successful:[],failed:[]};const i=this.#h(e,{forceAllowNewUpload:!0});return this.#p(i)}async retryAll(){const e=await this.#g();return this.emit("complete",e),e}cancelAll(){this.emit("cancel-all");const{files:e}=this.getState(),n=Object.keys(e);n.length&&this.removeFiles(n),this.setState(Pr)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));const n=this.#h([e],{forceAllowNewUpload:!0});return this.#p(n)}logout(){this.iteratePlugins(e=>{e.provider?.logout?.()})}#
|
|
21
|
-
Uppy plugins must have unique \`id\` options.`;throw new Error(s)}return e.VERSION&&this.log(`Using ${o} v${e.VERSION}`),i.type in this.#e?this.#e[i.type].push(i):this.#e[i.type]=[i],i.install(),this.emit("plugin-added",i),this}getPlugin(e){for(const n of Object.values(this.#e)){const i=n.find(o=>o.id===e);if(i!=null)return i}}[Symbol.for("uppy test: getPlugins")](e){return this.#e[e]}iteratePlugins(e){Object.values(this.#e).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const n=this.#e[e.type],i=n.findIndex(s=>s.id===e.id);i!==-1&&n.splice(i,1);const r={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(r)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),this.#n(),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",this.#c),window.removeEventListener("offline",this.#c))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,n="info",i=3e3){const o=typeof e=="object";this.setState({info:[...this.getState().info,{type:n,message:o?e.message:e,details:o?e.details:null}]}),setTimeout(()=>this.hideInfo(),i),this.emit("info-visible")}log(e,n){const{logger:i}=this.opts;switch(n){case"error":i.error(e);break;case"warning":i.warn(e);break;default:i.debug(e);break}}#y=new Map;registerRequestClient(e,n){this.#y.set(e,n)}getRequestClientForFile(e){if(!("remote"in e&&e.remote))throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const n=this.#y.get(e.remote.requestClientId);if(n==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return n}async restore(e){this.log(`Core: Running restored upload "${e}"`);const n=await this.#p(e);return this.emit("complete",n),n}#h(e,n={}){const{forceAllowNewUpload:i=!1}=n,{allowNewUpload:o,currentUploads:r}=this.getState();if(!o&&!i)throw new Error("Cannot create a new upload: already uploading.");const s=
|
|
22
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function La(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var Uh,QO,Rr,_t=(Uh=function(t){(function(){var e={}.hasOwnProperty;function n(){for(var i=[],o=0;o<arguments.length;o++){var r=arguments[o];if(r){var s=typeof r;if(s==="string"||s==="number")i.push(r);else if(Array.isArray(r)){if(r.length){var a=n.apply(null,r);a&&i.push(a)}}else if(s==="object")if(r.toString===Object.prototype.toString)for(var l in r)e.call(r,l)&&r[l]&&i.push(l);else i.push(r.toString())}}return i.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n})()},Uh(Rr={path:QO,exports:{},require:function(t,e){return(function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")})(e==null&&Rr.path)}},Rr.exports),Rr.exports),En=function(t){return function(e,n){if(!e)return t;var i;typeof e=="string"?i=e:n=e;var o=t;return i&&(o+="__"+i),o+(n?Object.keys(n).reduce((function(r,s){var a=n[s];return a&&(r+=" "+(typeof a=="boolean"?o+"--"+s:o+"--"+s+"_"+a)),r}),""):"")}};function kl(t,e,n){var i,o,r,s,a;function l(){var u=Date.now()-s;u<e&&u>=0?i=setTimeout(l,e-u):(i=null,n||(a=t.apply(r,o),r=o=null))}e==null&&(e=100);var c=function(){r=this,o=arguments,s=Date.now();var u=n&&!i;return i||(i=setTimeout(l,e)),u&&(a=t.apply(r,o),r=o=null),a};return c.clear=function(){i&&(clearTimeout(i),i=null)},c.flush=function(){i&&(a=t.apply(r,o),r=o=null,clearTimeout(i),i=null)},c}kl.debounce=kl;var Ol=kl,Re=function(){return Re=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Re.apply(this,arguments)};function rv(t,e){var n,i;return t&&e?(n=""+t+e[0].toUpperCase()+e.slice(1),i=t+"-"+e):(n=t||e,i=t||e),{name:n,classname:i}}function sv(t){return/^blob:/.test(t)}function Vh(t){return sv(t)||(function(e){return/^data:/.test(e)})(t)}function zi(t){return!!(t&&t.constructor&&t.call&&t.apply)}function yt(t){return t===void 0}function Xr(t){return typeof t=="object"&&t!==null}function Al(t,e,n){var i={};return Xr(t)?(Object.keys(e).forEach((function(o){yt(t[o])?i[o]=e[o]:Xr(e[o])?Xr(t[o])?i[o]=Al(t[o],e[o],n[o]):i[o]=t[o]?e[o]:n[o]:e[o]===!0||e[o]===!1?i[o]=!!t[o]:i[o]=t[o]})),i):t?e:n}function Ir(t){var e=Number(t);return Number.isNaN(e)?t:e}function Bh(t){return typeof(t=="number"||(function(e){return typeof e=="object"&&e!==null})(t)&&toString.call(t)=="[object Number]")&&!av(t)}function av(t){return t!=t}function lv(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}var ko=function(t,e){t===void 0&&(t={}),e===void 0&&(e={}),this.type="manipulateImage",this.move=t,this.scale=e},XO=function(t,e){e===void 0&&(e={}),this.type="resize",this.directions=t,this.params=e},Rc=function(t){this.type="move",this.directions=t},JO=(function(){function t(e,n,i,o,r){this.type="drag",this.nativeEvent=e,this.position=i,this.previousPosition=o,this.element=n,this.anchor=r}return t.prototype.shift=function(){var e=this,n=e.element,i=e.anchor,o=e.position;if(n){var r=n.getBoundingClientRect(),s=r.left,a=r.top;return{left:o.left-s-i.left,top:o.top-a-i.top}}return{left:0,top:0}},t})(),Ic={name:"DraggableElement",props:{classname:{type:String}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){if(!this.$refs.draggable)throw new Error('You should add ref "draggable" to your root element to use draggable mixin');this.touches=[],this.hovered=!1},methods:{onMouseOver:function(){this.hovered||(this.hovered=!0,this.$emit("enter"))},onMouseLeave:function(){this.hovered&&!this.touches.length&&(this.hovered=!1,this.$emit("leave"))},onTouchStart:function(t){t.cancelable&&!this.disabled&&t.touches.length===1&&(this.touches=Mi(t.touches),this.hovered||(this.$emit("enter"),this.hovered=!0),t.touches.length&&this.initAnchor(this.touches.reduce((function(e,n){return{clientX:e.clientX+n.clientX/t.touches.length,clientY:e.clientY+n.clientY/t.touches.length}}),{clientX:0,clientY:0})),t.preventDefault&&t.preventDefault(),t.stopPropagation())},onTouchEnd:function(){this.processEnd()},onTouchMove:function(t){this.touches.length&&(this.processMove(t,t.touches),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation())},onMouseDown:function(t){if(!this.disabled){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.preventDefault())},onMouseUp:function(){this.processEnd()},initAnchor:function(t){var e=this.$refs.draggable.getBoundingClientRect(),n=e.left,i=e.right,o=e.bottom,r=e.top;this.anchor={left:t.clientX-n,top:t.clientY-r,bottom:o-t.clientY,right:i-t.clientX}},processMove:function(t,e){var n=Mi(e);if(this.touches.length){if(this.touches.length===1&&n.length===1){var i=this.$refs.draggable;this.$emit("drag",new JO(t,i,{left:n[0].clientX,top:n[0].clientY},{left:this.touches[0].clientX,top:this.touches[0].clientY},this.anchor))}this.touches=n}},processEnd:function(){this.touches.length&&this.$emit("drag-end"),this.hovered&&(this.$emit("leave"),this.hovered=!1),this.touches=[]}},emits:["drag","drag-end","leave","enter"]};Ic.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"draggable",class:n.classname,onTouchstart:e[1]||(e[1]=function(){return r.onTouchStart&&r.onTouchStart.apply(r,arguments)}),onMousedown:e[2]||(e[2]=function(){return r.onMouseDown&&r.onMouseDown.apply(r,arguments)}),onMouseover:e[3]||(e[3]=function(){return r.onMouseOver&&r.onMouseOver.apply(r,arguments)}),onMouseleave:e[4]||(e[4]=function(){return r.onMouseLeave&&r.onMouseLeave.apply(r,arguments)})},[Ve(t.$slots,"default")],34)};var ja=En("vue-handler-wrapper"),cv={name:"HandlerWrapper",components:{DraggableElement:Ic},props:{horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},computed:{classes:function(){var t;if(this.horizontalPosition||this.verticalPosition){var e,n=rv(this.horizontalPosition,this.verticalPosition);t=ja((ln(e={},n.classname,!0),ln(e,"disabled",this.disabled),e))}else t=ja({disabled:this.disabled});return{root:t,draggable:ja("draggable")}}},emits:["leave","enter","drag","drag-end"]};cv.render=function(t,e,n,i,o,r){var s=Ue("DraggableElement");return y(),ne("div",{class:r.classes.root},[j(s,{class:r.classes.draggable,onDrag:e[1]||(e[1]=function(a){return t.$emit("drag",a)}),onDragEnd:e[2]||(e[2]=function(a){return t.$emit("drag-end")}),onLeave:e[3]||(e[3]=function(a){return t.$emit("leave")}),onEnter:e[4]||(e[4]=function(a){return t.$emit("enter")})},{default:we((function(){return[Ve(t.$slots,"default")]})),_:3},8,["class"])],2)};var ZO=En("vue-line-wrapper"),uv={name:"LineWrapper",components:{DraggableElement:Ic},props:{position:{type:String,required:!0},disabled:{type:Boolean,default:!1}},computed:{classname:function(){var t;return ZO((ln(t={},this.position,!0),ln(t,"disabled",this.disabled),t))}},emits:["leave","enter","drag","drag-end"]};uv.render=function(t,e,n,i,o,r){var s=Ue("DraggableElement");return y(),ne(s,{class:r.classname,onDrag:e[1]||(e[1]=function(a){return t.$emit("drag",a)}),onDragEnd:e[2]||(e[2]=function(a){return t.$emit("drag-end")}),onLeave:e[3]||(e[3]=function(a){return t.$emit("leave")}),onEnter:e[4]||(e[4]=function(a){return t.$emit("enter")})},{default:we((function(){return[Ve(t.$slots,"default")]})),_:3},8,["class"])};var Rn=["left","right","top","bottom"],eA=["left","right"],tA=["top","bottom"],nA=["left","top"],iA=["fill-area","fit-area","stencil","none"],Hh={left:0,top:0,width:0,height:0};function qh(t,e,n){return!(n=n||["width","height","left","top"]).some((function(i){return t[i]!==e[i]}))}function Ln(t){return{left:t.left,top:t.top,right:t.left+t.width,bottom:t.top+t.height}}function io(t,e){return{left:t.left-e.left,top:t.top-e.top}}function wt(t){return{left:t.left+t.width/2,top:t.top+t.height/2}}function No(t,e){var n={left:0,top:0,right:0,bottom:0};return Rn.forEach((function(i){var o=e[i],r=Ln(t)[i];n[i]=o!==void 0&&r!==void 0?i==="left"||i==="top"?Math.max(0,o-r):Math.max(0,r-o):0})),n}function An(t,e){return{left:t.left-e.left,top:t.top-e.top,width:t.width+e.left+e.right,height:t.height+e.top+e.bottom}}function Ms(t){return{left:-t.left,top:-t.top}}function Wt(t,e){return Re(Re({},t),{left:t.left+e.left,top:t.top+e.top})}function un(t,e,n,i){if(e!==1){if(n){var o=wt(t);return{width:t.width*e,height:t.height*e,left:t.left+t.width*(1-e)/2+(n.left-o.left)*(1-e),top:t.top+t.height*(1-e)/2+(n.top-o.top)*(1-e)}}return{width:t.width*e,height:t.height*e,left:t.left+t.width*(1-e)/2,top:t.top+t.height*(1-e)/2}}return t}function Je(t){return t.width/t.height}function oo(t,e){return Math.min(e.right!==void 0&&e.left!==void 0?(e.right-e.left)/t.width:1/0,e.bottom!==void 0&&e.top!==void 0?(e.bottom-e.top)/t.height:1/0)}function ro(t,e){var n={left:0,top:0},i=No(t,e);return i.left&&i.left>0?n.left=i.left:i.right&&i.right>0&&(n.left=-i.right),i.top&&i.top>0?n.top=i.top:i.bottom&&i.bottom>0&&(n.top=-i.bottom),n}function za(t,e){var n;return e.minimum&&t<e.minimum?n=e.minimum:e.maximum&&t>e.maximum&&(n=e.maximum),n}function dv(t,e){var n=Je(t),i=Je(e);return e.width<1/0&&e.height<1/0?n>i?{width:e.width,height:e.width/n}:{width:e.height*n,height:e.height}:e.width<1/0?{width:e.width,height:e.width/n}:e.height<1/0?{width:e.height*n,height:e.height}:t}function hv(t,e){var n=e*Math.PI/180;return{width:Math.abs(t.width*Math.cos(n))+Math.abs(t.height*Math.sin(n)),height:Math.abs(t.width*Math.sin(n))+Math.abs(t.height*Math.cos(n))}}function ai(t,e){var n=e*Math.PI/180;return{left:t.left*Math.cos(n)-t.top*Math.sin(n),top:t.left*Math.sin(n)+t.top*Math.cos(n)}}function Fs(t,e){var n=No(St(t,e),e);return n.left+n.right+n.top+n.bottom?n.left+n.right>n.top+n.bottom?Math.min((t.width+n.left+n.right)/t.width,oo(t,e)):Math.min((t.height+n.top+n.bottom)/t.height,oo(t,e)):1}function St(t,e,n){n===void 0&&(n=!1);var i=ro(t,e);return Wt(t,n?Ms(i):i)}function Pl(t){return{width:t.right!==void 0&&t.left!==void 0?t.right-t.left:1/0,height:t.bottom!==void 0&&t.top!==void 0?t.bottom-t.top:1/0}}function oA(t,e){return Re(Re({},t),{minWidth:Math.min(e.width,t.minWidth),minHeight:Math.min(e.height,t.minHeight),maxWidth:Math.min(e.width,t.maxWidth),maxHeight:Math.min(e.height,t.maxHeight)})}function pv(t,e,n){n===void 0&&(n=!0);var i={};return Rn.forEach((function(o){var r=t[o],s=e[o];r!==void 0&&s!==void 0?i[o]=o==="left"||o==="top"?n?Math.max(r,s):Math.min(r,s):n?Math.min(r,s):Math.max(r,s):s!==void 0?i[o]=s:r!==void 0&&(i[o]=r)})),i}function Ds(t,e){return pv(t,e,!0)}function Wh(t){var e=t.size,n=t.aspectRatio,i=t.ignoreMinimum,o=t.sizeRestrictions;return!!((e.correctRatio||Je(e)>=n.minimum&&Je(e)<=n.maximum)&&e.height<=o.maxHeight&&e.width<=o.maxWidth&&e.width&&e.height&&(i||e.height>=o.minHeight&&e.width>=o.minWidth))}function Kh(t,e){return Math.pow(t.width-e.width,2)+Math.pow(t.height-e.height,2)}function Xn(t){var e=t.width,n=t.height,i=t.sizeRestrictions,o={minimum:t.aspectRatio&&t.aspectRatio.minimum||0,maximum:t.aspectRatio&&t.aspectRatio.maximum||1/0},r={width:Math.max(i.minWidth,Math.min(i.maxWidth,e)),height:Math.max(i.minHeight,Math.min(i.maxHeight,n))};function s(c,u){return u===void 0&&(u=!1),c.reduce((function(d,h){return Wh({size:h,aspectRatio:o,sizeRestrictions:i,ignoreMinimum:u})&&(!d||Kh(h,{width:e,height:n})<Kh(d,{width:e,height:n}))?h:d}),null)}var a=[];o&&[o.minimum,o.maximum].forEach((function(c){c&&a.push({width:r.width,height:r.width/c,correctRatio:!0},{width:r.height*c,height:r.height,correctRatio:!0})})),Wh({size:r,aspectRatio:o,sizeRestrictions:i})&&a.push(r);var l=s(a)||s(a,!0);return l&&{width:l.width,height:l.height}}function Rl(t){var e=t.event,n=t.coordinates,i=t.positionRestrictions,o=i===void 0?{}:i,r=Wt(n,e.directions);return Wt(r,ro(r,o))}function rA(t){var e=t.coordinates,n=t.transform,i=t.imageSize,o=t.sizeRestrictions,r=t.positionRestrictions,s=t.aspectRatio,a=t.visibleArea,l=function(u,d){return Rl({coordinates:u,positionRestrictions:r,event:new Rc({left:d.left-u.left,top:d.top-u.top})})},c=Re({},e);return(Array.isArray(n)?n:[n]).forEach((function(u){var d={};yt((d=typeof u=="function"?u({coordinates:c,imageSize:i,visibleArea:a}):u).width)&&yt(d.height)||(c=(function(h,m){var f=Re(Re(Re({},h),Xn({width:m.width,height:m.height,sizeRestrictions:o,aspectRatio:s})),{left:0,top:0});return l(f,{left:h.left,top:h.top})})(c,Re(Re({},c),d))),yt(d.left)&&yt(d.top)||(c=l(c,Re(Re({},c),d)))})),c}function sA(t){t.event;var e=t.getAreaRestrictions,n=t.boundaries,i=t.coordinates,o=t.visibleArea;t.aspectRatio;var r=t.stencilSize,s=t.sizeRestrictions,a=t.positionRestrictions;t.stencilReference;var l,c,u,d=Re({},i),h=Re({},o),m=Re({},r);l=Je(m),c=Je(d),u===void 0&&(u=.001),(l===0||c===0?Math.abs(c-l)<u:Math.abs(c/l)<1+u&&Math.abs(c/l)>1-u)||(d=Re(Re({},d),Xn({sizeRestrictions:s,width:d.width,height:d.height,aspectRatio:{minimum:Je(m),maximum:Je(m)}})));var f=Fs(h=un(h,d.width*n.width/(h.width*m.width)),e({visibleArea:h,type:"resize"}));return f!==1&&(h=un(h,f),d=un(d,f)),h=St(h=Wt(h,io(wt(d),wt(h))),e({visibleArea:h,type:"move"})),{coordinates:d=St(d,Ds(Ln(h),a)),visibleArea:h}}function aA(t){var e=t.event,n=t.getAreaRestrictions,i=t.boundaries,o=t.coordinates,r=t.visibleArea;t.aspectRatio,t.stencilSize,t.sizeRestrictions;var s=t.positionRestrictions;t.stencilReference;var a=Re({},o),l=Re({},r);if(o&&r&&e.type!=="manipulateImage"){var c={width:0,height:0};l.width,i.width,Je(i)>Je(a)?(c.height=.8*i.height,c.width=c.height*Je(a)):(c.width=.8*i.width,c.height=c.width*Je(a));var u=Fs(l=un(l,a.width*i.width/(l.width*c.width)),n({visibleArea:l,type:"resize"}));l=un(l,u),u!==1&&(c.height/=u,c.width/=u),l=St(l=Wt(l,io(wt(a),wt(l))),n({visibleArea:l,type:"move"})),a=St(a,Ds(Ln(l),s))}return{coordinates:a,visibleArea:l}}function lA(t){var e=t.event,n=t.coordinates,i=t.visibleArea,o=t.getAreaRestrictions,r=Re({},i),s=Re({},n);if(e.type==="setCoordinates"){var a=Math.max(0,s.width-r.width),l=Math.max(0,s.height-r.height);a>l?r=un(r,Math.min(s.width/r.width,oo(r,o({visibleArea:r,type:"resize"})))):l>a&&(r=un(r,Math.min(s.height/r.height,oo(r,o({visibleArea:r,type:"resize"}))))),r=St(r=Wt(r,Ms(ro(s,Ln(r)))),o({visibleArea:r,type:"move"}))}return{visibleArea:r,coordinates:s}}function cA(t){var e=t.imageSize,n=t.visibleArea,i=t.coordinates,o=n||e;return{left:(n?n.left:0)+o.width/2-i.width/2,top:(n?n.top:0)+o.height/2-i.height/2}}function uA(t){var e=t.imageSize,n=t.visibleArea,i=t.aspectRatio,o=t.sizeRestrictions,r=n||e,s=Math.min(i.maximum||1/0,Math.max(i.minimum||0,Je(r))),a=r.width<r.height?{width:.8*r.width,height:.8*r.width/s}:{height:.8*r.height,width:.8*r.height*s};return Xn(Re(Re({},a),{aspectRatio:i,sizeRestrictions:o}))}function dA(t){var e,n,i=t.imageSize,o=t.visibleArea,r=t.boundaries,s=t.aspectRatio,a=t.sizeRestrictions,l=t.stencilSize,c=o||i;return Je(c)>Je(r)?n=(e=l.height*c.height/r.height)*Je(l):e=(n=l.width*c.width/r.width)/Je(l),Xn({width:n,height:e,aspectRatio:s,sizeRestrictions:a})}function hA(t){var e=t.getAreaRestrictions,n=t.coordinates,i=t.imageSize,o=Je(t.boundaries);if(n){var r={height:Math.max(n.height,i.height),width:Math.max(n.width,i.width)},s=dv({width:Je(r)>o?r.width:r.height*o,height:Je(r)>o?r.width/o:r.height},Pl(e())),a={left:n.left+n.width/2-s.width/2,top:n.top+n.height/2-s.height/2,width:s.width,height:s.height},l=No(n,Ln(Re({left:0,top:0},i))),c={};return!l.left&&!l.right&&a.width<=i.width&&(c.left=0,c.right=i.width),!l.top&&!l.bottom&&a.height<=i.height&&(c.top=0,c.bottom=i.height),St(a,c)}var u=Je(i);return s={height:u>o?i.height:i.width/o,width:u>o?i.height*o:i.width},{left:i.width/2-s.width/2,top:i.height/2-s.height/2,width:s.width,height:s.height}}function Mr(t,e){return pv(t,Ln(e))}function pA(t){var e=t.event,n=t.coordinates,i=t.visibleArea,o=t.sizeRestrictions,r=t.getAreaRestrictions,s=t.positionRestrictions,a=t.adjustStencil,l=e.scale,c=e.move,u=Re({},i),d=Re({},n),h=1,m=1,f=l.factor&&Math.abs(l.factor-1)>.001;u=Wt(u,{left:c.left||0,top:c.top||0});var p={stencil:{minimum:Math.max(o.minWidth?o.minWidth/d.width:0,o.minHeight?o.minHeight/d.height:0),maximum:Math.min(o.maxWidth?o.maxWidth/d.width:1/0,o.maxHeight?o.maxHeight/d.height:1/0,oo(d,s))},area:{maximum:oo(u,r({visibleArea:u,type:"resize"}))}};l.factor&&f&&(l.factor<1?(m=Math.max(l.factor,p.stencil.minimum))>1&&(m=1):l.factor>1&&(m=Math.min(l.factor,Math.min(p.area.maximum,p.stencil.maximum)))<1&&(m=1)),m&&(u=un(u,m,l.center));var _=n.left-i.left,C=i.width+i.left-(n.width+n.left),w=n.top-i.top,S=i.height+i.top-(n.height+n.top);return u=St(u=Wt(u,ro(u,{left:s.left!==void 0?s.left-_*m:void 0,top:s.top!==void 0?s.top-w*m:void 0,bottom:s.bottom!==void 0?s.bottom+S*m:void 0,right:s.right!==void 0?s.right+C*m:void 0})),r({visibleArea:u,type:"move"})),d.width=d.width*m,d.height=d.height*m,d.left=u.left+_*m,d.top=u.top+w*m,d=St(d,Ds(Ln(u),s)),l.factor&&f&&a&&(l.factor>1?h=Math.min(p.area.maximum,l.factor)/m:l.factor<1&&(h=Math.max(d.height/u.height,d.width/u.width,l.factor/m)),h!==1&&(u=Wt(u=St(u=un(u,h,l.factor>1?l.center:wt(d)),r({visibleArea:u,type:"move"})),Ms(ro(d,Ln(u)))))),{coordinates:d,visibleArea:u}}function fA(t){var e=t.aspectRatio,n=t.getAreaRestrictions,i=t.coordinates,o=t.visibleArea,r=t.sizeRestrictions,s=t.positionRestrictions,a=t.imageSize,l=t.previousImageSize,c=t.angle,u=Re({},i),d=Re({},o),h=ai(wt(Re({left:0,top:0},l)),c);return(u=Re(Re({},Xn({sizeRestrictions:r,aspectRatio:e,width:u.width,height:u.height})),ai(wt(u),c))).left-=h.left-a.width/2+u.width/2,u.top-=h.top-a.height/2+u.height/2,d=un(d,Fs(d,n({visibleArea:d,type:"resize"}))),{coordinates:u=St(u,s),visibleArea:d=St(d=Wt(d,io(wt(u),wt(i))),n({visibleArea:d,type:"move"}))}}function mA(t){var e=t.flip,n=t.previousFlip,i=t.rotate,o=t.getAreaRestrictions,r=t.coordinates,s=t.visibleArea,a=t.imageSize,l=Re({},r),c=Re({},s),u=n.horizontal!==e.horizontal,d=n.vertical!==e.vertical;if(u||d){var h=ai({left:a.width/2,top:a.height/2},-i),m=ai(wt(l),-i),f=ai({left:u?h.left-(m.left-h.left):m.left,top:d?h.top-(m.top-h.top):m.top},i);l=Wt(l,io(f,wt(l))),m=ai(wt(c),-i),c=St(c=Wt(c,io(f=ai({left:u?h.left-(m.left-h.left):m.left,top:d?h.top-(m.top-h.top):m.top},i),wt(c))),o({visibleArea:c,type:"move"}))}return{coordinates:l,visibleArea:c}}function Yh(t){var e=t.directions,n=t.coordinates,i=t.positionRestrictions,o=i===void 0?{}:i,r=t.sizeRestrictions,s=t.preserveRatio,a=t.compensate,l=Re({},e),c=An(n,l).width,u=An(n,l).height;c<0&&(l.left<0&&l.right<0?(l.left=-(n.width-r.minWidth)/(l.left/l.right),l.right=-(n.width-r.minWidth)/(l.right/l.left)):l.left<0?l.left=-(n.width-r.minWidth):l.right<0&&(l.right=-(n.width-r.minWidth))),u<0&&(l.top<0&&l.bottom<0?(l.top=-(n.height-r.minHeight)/(l.top/l.bottom),l.bottom=-(n.height-r.minHeight)/(l.bottom/l.top)):l.top<0?l.top=-(n.height-r.minHeight):l.bottom<0&&(l.bottom=-(n.height-r.minHeight)));var d=No(An(n,l),o);a&&(d.left&&d.left>0&&d.right===0?(l.right+=d.left,l.left-=d.left):d.right&&d.right>0&&d.left===0&&(l.left+=d.right,l.right-=d.right),d.top&&d.top>0&&d.bottom===0?(l.bottom+=d.top,l.top-=d.top):d.bottom&&d.bottom>0&&d.top===0&&(l.top+=d.bottom,l.bottom-=d.bottom),d=No(An(n,l),o));var h={width:1/0,height:1/0,left:1/0,right:1/0,top:1/0,bottom:1/0};if(Rn.forEach((function(p){var _=d[p];_&&l[p]&&(h[p]=Math.max(0,1-_/l[p]))})),s){var m=Math.min.apply(null,Rn.map((function(p){return h[p]})));m!==1/0&&Rn.forEach((function(p){l[p]*=m}))}else Rn.forEach((function(p){h[p]!==1/0&&(l[p]*=h[p])}));if(c=An(n,l).width,u=An(n,l).height,l.right+l.left&&(c>r.maxWidth?h.width=(r.maxWidth-n.width)/(l.right+l.left):c<r.minWidth&&(h.width=(r.minWidth-n.width)/(l.right+l.left))),l.bottom+l.top&&(u>r.maxHeight?h.height=(r.maxHeight-n.height)/(l.bottom+l.top):u<r.minHeight&&(h.height=(r.minHeight-n.height)/(l.bottom+l.top))),s){var f=Math.min(h.width,h.height);f!==1/0&&Rn.forEach((function(p){l[p]*=f}))}else h.width!==1/0&&eA.forEach((function(p){l[p]*=h.width})),h.height!==1/0&&tA.forEach((function(p){l[p]*=h.height}));return l}function Fr(t,e,n){return e==0&&n==0?t/2:e==0?0:n==0?t:t*Math.abs(e/(e+n))}var vA=En("vue-simple-handler"),gA=En("vue-simple-handler-wrapper"),Mc={name:"SimpleHandler",components:{HandlerWrapper:cv},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){var t,e=(ln(t={},this.horizontalPosition,!!this.horizontalPosition),ln(t,this.verticalPosition,!!this.verticalPosition),ln(t,"".concat(this.horizontalPosition,"-").concat(this.verticalPosition),!!(this.verticalPosition&&this.horizontalPosition)),ln(t,"hover",this.hover),t);return{default:_t(vA(e),this.defaultClass,this.hover&&this.hoverClass),wrapper:_t(gA(e),this.wrapperClass)}}},methods:{onDrag:function(t){this.$emit("drag",t)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}},emits:["drag","drag-end"]};Mc.render=function(t,e,n,i,o,r){var s=Ue("HandlerWrapper");return y(),ne(s,{class:r.classes.wrapper,"vertical-position":n.verticalPosition,"horizontal-position":n.horizontalPosition,disabled:n.disabled,onDrag:r.onDrag,onDragEnd:r.onDragEnd,onEnter:r.onEnter,onLeave:r.onLeave},{default:we((function(){return[j("div",{class:r.classes.default},null,2)]})),_:1},8,["class","vertical-position","horizontal-position","disabled","onDrag","onDragEnd","onEnter","onLeave"])};var _A=En("vue-simple-line"),yA=En("vue-simple-line-wrapper"),Fc={name:"SimpleLine",components:{LineWrapper:uv},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},position:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){return{root:_t(_A(ln({},this.position,!0)),this.defaultClass,this.hover&&this.hoverClass),wrapper:_t(yA(ln({},this.position,!0)),this.wrapperClass)}}},methods:{onDrag:function(t){this.$emit("drag",t)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}},emits:["drag","drag-end"]};Fc.render=function(t,e,n,i,o,r){var s=Ue("LineWrapper");return y(),ne(s,{class:r.classes.wrapper,position:n.position,disabled:n.disabled,onDrag:r.onDrag,onDragEnd:r.onDragEnd,onEnter:r.onEnter,onLeave:r.onLeave},{default:we((function(){return[j("div",{class:r.classes.root},null,2)]})),_:1},8,["class","position","disabled","onDrag","onDragEnd","onEnter","onLeave"])};var Na=En("vue-bounding-box"),bA=["east","west",null],wA=["south","north",null],fv={name:"BoundingBox",props:{width:{type:Number},height:{type:Number},transitions:{type:Object},handlers:{type:Object,default:function(){return{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}}},handlersComponent:{type:[Object,String],default:function(){return Mc}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}},lines:{type:Object,default:function(){return{west:!0,north:!0,east:!0,south:!0}}},linesComponent:{type:[Object,String],default:function(){return Fc}},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},resizable:{type:Boolean,default:!0}},data:function(){var t=[];return bA.forEach((function(e){wA.forEach((function(n){if(e!==n){var i=rv(e,n),o=i.name,r=i.classname;t.push({name:o,classname:r,verticalDirection:n,horizontalDirection:e})}}))})),{points:t}},computed:{style:function(){var t={};return this.width&&this.height&&(t.width="".concat(this.width,"px"),t.height="".concat(this.height,"px"),this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction))),t},classes:function(){var t=this.handlersClasses,e=this.handlersWrappersClasses,n=this.linesClasses,i=this.linesWrappersClasses;return{root:Na(),handlers:t,handlersWrappers:e,lines:n,linesWrappers:i}},lineNodes:function(){var t=this,e=[];return this.points.forEach((function(n){n.horizontalDirection&&n.verticalDirection||!t.lines[n.name]||e.push({name:n.name,component:t.linesComponent,class:_t(t.classes.lines.default,t.classes.lines[n.name],!t.resizable&&t.classes.lines.disabled),wrapperClass:_t(t.classes.linesWrappers.default,t.classes.linesWrappers[n.name],!t.resizable&&t.classes.linesWrappers.disabled),hoverClass:t.classes.lines.hover,verticalDirection:n.verticalDirection,horizontalDirection:n.horizontalDirection,disabled:!t.resizable})})),e},handlerNodes:function(){var t=this,e=[],n=this.width,i=this.height;return this.points.forEach((function(o){if(t.handlers[o.name]){var r={name:o.name,component:t.handlersComponent,class:_t(t.classes.handlers.default,t.classes.handlers[o.name]),wrapperClass:_t(t.classes.handlersWrappers.default,t.classes.handlersWrappers[o.name]),hoverClass:t.classes.handlers.hover,verticalDirection:o.verticalDirection,horizontalDirection:o.horizontalDirection,disabled:!t.resizable};if(n&&i){var s=o.horizontalDirection,a=o.verticalDirection,l=s==="east"?n:s==="west"?0:n/2,c=a==="south"?i:a==="north"?0:i/2;r.wrapperClass=Na("handler"),r.wrapperStyle={transform:"translate(".concat(l,"px, ").concat(c,"px)")},t.transitions&&t.transitions.enabled&&(r.wrapperStyle.transition="".concat(t.transitions.time,"ms ").concat(t.transitions.timingFunction))}else r.wrapperClass=Na("handler",ln({},o.classname,!0));e.push(r)}})),e}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[]},methods:{onEnd:function(){this.$emit("resize-end")},onHandlerDrag:function(t,e,n){var i,o=t.shift(),r=o.left,s=o.top,a={left:0,right:0,top:0,bottom:0};e==="west"?a.left-=r:e==="east"&&(a.right+=r),n==="north"?a.top-=s:n==="south"&&(a.bottom+=s),!n&&e?i="width":n&&!e&&(i="height"),this.resizable&&this.$emit("resize",new XO(a,{allowedDirections:{left:e==="west"||!e,right:e==="east"||!e,bottom:n==="south"||!n,top:n==="north"||!n},preserveAspectRatio:t.nativeEvent&&t.nativeEvent.shiftKey,respectDirection:i}))}},emits:["resize","resize-end"]};fv.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"box",class:r.classes.root,style:r.style},[Ve(t.$slots,"default"),j("div",null,[(y(!0),ne(Ie,null,He(r.lineNodes,(function(s){return y(),ne($t(s.component),{key:s.name,"default-class":s.class,"hover-class":s.hoverClass,"wrapper-class":s.wrapperClass,position:s.name,disabled:s.disabled,onDrag:function(a){return r.onHandlerDrag(a,s.horizontalDirection,s.verticalDirection)},onDragEnd:e[1]||(e[1]=function(a){return r.onEnd()})},null,8,["default-class","hover-class","wrapper-class","position","disabled","onDrag"])})),128))]),(y(!0),ne(Ie,null,He(r.handlerNodes,(function(s){return y(),ne("div",{key:s.name,style:s.wrapperStyle,class:s.wrapperClass},[(y(),ne($t(s.component),{"default-class":s.class,"hover-class":s.hoverClass,"wrapper-class":s.wrapperClass,"horizontal-position":s.horizontalDirection,"vertical-position":s.verticalDirection,disabled:s.disabled,onDrag:function(a){return r.onHandlerDrag(a,s.horizontalDirection,s.verticalDirection)},onDragEnd:e[2]||(e[2]=function(a){return r.onEnd()})},null,8,["default-class","hover-class","wrapper-class","horizontal-position","vertical-position","disabled","onDrag"]))],6)})),128))],6)};var SA=En("vue-draggable-area"),mv={name:"DraggableArea",props:{movable:{type:Boolean,default:!0},activationDistance:{type:Number,default:20}},computed:{classnames:function(){return{default:SA()}}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[],this.touchStarted=!1},methods:{onTouchStart:function(t){if(t.cancelable){var e=this.movable&&t.touches.length===1;e&&(this.touches=Mi(t.touches)),(this.touchStarted||e)&&(t.preventDefault(),t.stopPropagation())}},onTouchEnd:function(){this.touchStarted=!1,this.processEnd()},onTouchMove:function(t){this.touches.length>=1&&(this.touchStarted?(this.processMove(t,t.touches),t.preventDefault(),t.stopPropagation()):lv({x:this.touches[0].clientX,y:this.touches[0].clientY},{x:t.touches[0].clientX,y:t.touches[0].clientY})>this.activationDistance&&(this.initAnchor({clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}),this.touchStarted=!0))},onMouseDown:function(t){if(this.movable&&t.button===0){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.cancelable&&t.preventDefault(),t.stopPropagation())},onMouseUp:function(){this.processEnd()},initAnchor:function(t){var e=this.$refs.container.getBoundingClientRect(),n=e.left,i=e.top;this.anchor={x:t.clientX-n,y:t.clientY-i}},processMove:function(t,e){var n=Mi(e);if(this.touches.length){var i=this.$refs.container.getBoundingClientRect(),o=i.left,r=i.top;this.touches.length===1&&n.length===1&&this.$emit("move",new Rc({left:n[0].clientX-(o+this.anchor.x),top:n[0].clientY-(r+this.anchor.y)}))}},processEnd:function(){this.touches.length&&this.$emit("move-end"),this.touches=[]}},emits:["move","move-end"]};mv.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"container",onTouchstart:e[1]||(e[1]=function(){return r.onTouchStart&&r.onTouchStart.apply(r,arguments)}),onMousedown:e[2]||(e[2]=function(){return r.onMouseDown&&r.onMouseDown.apply(r,arguments)})},[Ve(t.$slots,"default")],544)};function Ua(t){var e,n;return{rotate:t.rotate||0,flip:{horizontal:((e=t?.flip)===null||e===void 0?void 0:e.horizontal)||!1,vertical:((n=t?.flip)===null||n===void 0?void 0:n.vertical)||!1}}}function CA(t){return new Promise((function(e,n){try{if(t)if(/^data:/i.test(t))e((function(l){l=l.replace(/^data:([^;]+);base64,/gim,"");for(var c=atob(l),u=c.length,d=new ArrayBuffer(u),h=new Uint8Array(d),m=0;m<u;m++)h[m]=c.charCodeAt(m);return d})(t));else if(/^blob:/i.test(t)){var i=new FileReader;i.onload=function(l){e(l.target.result)},r=t,s=function(l){i.readAsArrayBuffer(l)},(a=new XMLHttpRequest).open("GET",r,!0),a.responseType="blob",a.onload=function(){this.status!=200&&this.status!==0||s(this.response)},a.send()}else{var o=new XMLHttpRequest;o.onreadystatechange=function(){o.readyState===4&&(o.status===200||o.status===0?e(o.response):n("Warning: could not load an image to parse its orientation"),o=null)},o.onprogress=function(){o.getResponseHeader("content-type")!=="image/jpeg"&&o.abort()},o.withCredentials=!1,o.open("GET",t,!0),o.responseType="arraybuffer",o.send(null)}else n("Error: the image is empty")}catch(l){n(l)}var r,s,a}))}function vv(t){var e=t.rotate,n=t.flip,i=t.scaleX,o=t.scaleY,r="";return r+=" rotate("+e+"deg) ",r+=" scaleX("+i*(n.horizontal?-1:1)+") ",r+=" scaleY("+o*(n.vertical?-1:1)+") "}function EA(t){try{var e,n=new DataView(t),i=void 0,o=void 0,r=void 0,s=void 0;if(n.getUint8(0)===255&&n.getUint8(1)===216)for(var a=n.byteLength,l=2;l+1<a;){if(n.getUint8(l)===255&&n.getUint8(l+1)===225){r=l;break}l++}if(r&&(i=r+10,(function(m,f,p){var _,C="";for(_=f,p+=f;_<p;_++)C+=String.fromCharCode(m.getUint8(_));return C})(n,r+4,4)==="Exif")){var c=n.getUint16(i);if(((o=c===18761)||c===19789)&&n.getUint16(i+2,o)===42){var u=n.getUint32(i+4,o);u>=8&&(s=i+u)}}if(s){for(var d=n.getUint16(s,o),h=0;h<d;h++)if(l=s+12*h+2,n.getUint16(l,o)===274){l+=8,e=n.getUint16(l,o),n.setUint16(l,1,o);break}}return e}catch{return null}}function Gh(t,e){var n=e.getBoundingClientRect(),i=n.left,o=n.top,r={left:0,top:0},s=0;return t.forEach((function(a){r.left+=(a.clientX-i)/t.length,r.top+=(a.clientY-o)/t.length})),t.forEach((function(a){s+=lv({x:r.left,y:r.top},{x:a.clientX-i,y:a.clientY-o})})),{centerMass:r,spread:s,count:t.length}}var gv={props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0},eventsFilter:{type:Function,required:!1}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},created:function(){this.transforming=!1,this.debouncedProcessEnd=Ol(this.processEnd),this.touches=[]},methods:{processMove:function(t,e){if(this.touches.length){if(this.touches.length===1&&e.length===1)this.$emit("move",new ko({left:this.touches[0].clientX-e[0].clientX,top:this.touches[0].clientY-e[0].clientY}));else if(this.touches.length>1&&this.touchResize){var n=Gh(e,this.$refs.container),i=this.oldGeometricProperties;i.count===n.count&&i.count>1&&this.$emit("resize",new ko({left:i.centerMass.left-n.centerMass.left,top:i.centerMass.top-n.centerMass.top},{factor:i.spread/n.spread,center:n.centerMass})),this.oldGeometricProperties=n}this.touches=e}},processEnd:function(){this.transforming&&(this.transforming=!1,this.$emit("transform-end"))},processStart:function(){this.transforming=!0,this.debouncedProcessEnd.clear()},processEvent:function(t){return this.eventsFilter?this.eventsFilter(t,this.transforming)!==!1:(t.preventDefault(),t.stopPropagation(),!0)},onTouchStart:function(t){if(t.cancelable&&(this.touchMove||this.touchResize&&t.touches.length>1)&&this.processEvent(t)){var e=this.$refs.container,n=e.getBoundingClientRect(),i=n.left,o=n.top,r=n.bottom,s=n.right;this.touches=Mi(t.touches).filter((function(a){return a.clientX>i&&a.clientX<s&&a.clientY>o&&a.clientY<r})),this.oldGeometricProperties=Gh(this.touches,e)}},onTouchEnd:function(t){t.touches.length===0&&(this.touches=[],this.processEnd())},onTouchMove:function(t){var e=this;if(this.touches.length){var n=Mi(t.touches).filter((function(i){return!i.identifier||e.touches.find((function(o){return o.identifier===i.identifier}))}));this.processEvent(t)&&(this.processMove(t,n),this.processStart())}},onMouseDown:function(t){if(this.mouseMove&&"buttons"in t&&t.buttons===1&&this.processEvent(t)){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.processStart()}},onMouseMove:function(t){this.touches.length&&this.processEvent(t)&&this.processMove(t,[{clientX:t.clientX,clientY:t.clientY}])},onMouseUp:function(){this.touches=[],this.processEnd()},onWheel:function(t){if(this.wheelResize&&this.processEvent(t)){var e=this.$refs.container.getBoundingClientRect(),n=e.left,i=e.top,o=1+this.wheelResize.ratio*(s=t.deltaY||t.detail||t.wheelDelta,(a=+s)==0||av(a)?a:a>0?1:-1),r={left:t.clientX-n,top:t.clientY-i};this.$emit("resize",new ko({},{factor:o,center:r})),this.touches.length||this.debouncedProcessEnd()}var s,a}},emits:["resize","move","transform-end"]};gv.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"container",onTouchstart:e[1]||(e[1]=function(){return r.onTouchStart&&r.onTouchStart.apply(r,arguments)}),onMousedown:e[2]||(e[2]=function(){return r.onMouseDown&&r.onMouseDown.apply(r,arguments)}),onWheel:e[3]||(e[3]=function(){return r.onWheel&&r.onWheel.apply(r,arguments)})},[Ve(t.$slots,"default")],544)};var Il={components:{TransformableImage:gv},props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0}},emits:["resize","move"]};Il.render=function(t,e,n,i,o,r){var s=Ue("transformable-image");return y(),ne(s,{"touch-move":n.touchMove,"touch-resize":n.touchResize,"mouse-move":n.mouseMove,"wheel-resize":n.wheelResize,onMove:e[1]||(e[1]=function(a){return t.$emit("move",a)}),onResize:e[2]||(e[2]=function(a){return t.$emit("resize",a)})},{default:we((function(){return[Ve(t.$slots,"default")]})),_:3},8,["touch-move","touch-resize","mouse-move","wheel-resize"])};var Dr=En("vue-preview"),_v={props:{coordinates:{type:Object},transitions:{type:Object},image:{type:Object,default:function(){return{}}},imageClass:{type:String},width:{type:Number},height:{type:Number},fill:{type:Boolean}},data:function(){return{calculatedImageSize:{width:0,height:0},calculatedSize:{width:0,height:0}}},computed:{classes:function(){return{root:Dr({fill:this.fill}),wrapper:Dr("wrapper"),imageWrapper:Dr("image-wrapper"),image:_t(Dr("image"),this.imageClass)}},style:function(){if(this.fill)return{};var t={};return this.width&&(t.width="".concat(this.size.width,"px")),this.height&&(t.height="".concat(this.size.height,"px")),this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},wrapperStyle:function(){var t={width:"".concat(this.size.width,"px"),height:"".concat(this.size.height,"px"),left:"calc(50% - ".concat(this.size.width/2,"px)"),top:"calc(50% - ".concat(this.size.height/2,"px)")};return this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},imageStyle:function(){if(this.coordinates&&this.image){var t=this.coordinates.width/this.size.width,e=Xe(Xe({rotate:0,flip:{horizontal:!1,vertical:!1}},this.image.transforms),{},{scaleX:1/t,scaleY:1/t}),n=this.imageSize.width,i=this.imageSize.height,o=hv({width:n,height:i},e.rotate),r={width:"".concat(n,"px"),height:"".concat(i,"px"),left:"0px",top:"0px"},s={rotate:{left:(n-o.width)*e.scaleX/2,top:(i-o.height)*e.scaleY/2},scale:{left:(1-e.scaleX)*n/2,top:(1-e.scaleY)*i/2}};return r.transform=`translate(
|
|
23
|
-
`.concat(-this.coordinates.left/t-s.rotate.left-s.scale.left,"px,").concat(-this.coordinates.top/t-s.rotate.top-s.scale.top,"px) ")+vv(e),this.transitions&&this.transitions.enabled&&(r.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),r}return{}},size:function(){return{width:this.width||this.calculatedSize.width,height:this.height||this.calculatedSize.height}},imageSize:function(){return{width:this.image.width||this.calculatedImageSize.width,height:this.image.height||this.calculatedImageSize.height}}},watch:{image:function(t){(t.width||t.height)&&this.onChangeImage()}},mounted:function(){var t=this;this.onChangeImage(),this.$refs.image.addEventListener("load",(function(){t.refreshImage()})),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh)},methods:{refreshImage:function(){var t=this.$refs.image;this.calculatedImageSize.height=t.naturalHeight,this.calculatedImageSize.width=t.naturalWidth},refresh:function(){var t=this.$refs.root;this.width||(this.calculatedSize.width=t.clientWidth),this.height||(this.calculatedSize.height=t.clientHeight)},onChangeImage:function(){var t=this.$refs.image;t&&t.complete&&this.refreshImage(),this.refresh()}}};_v.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"root",class:r.classes.root,style:r.style},[j("div",{ref:"wrapper",class:r.classes.wrapper,style:r.wrapperStyle},[it(j("img",{ref:"image",src:n.image&&n.image.src,class:r.classes.image,style:r.imageStyle},null,14,["src"]),[[Sn,n.image&&n.image.src]])],6)],6)};var yv={components:{Preview:_v},inheritAttrs:!1};yv.render=function(t,e,n,i,o,r){var s=Ue("preview");return y(),ne(s,We(t.$attrs,{fill:!0}),null,16)};var Va=En("vue-rectangle-stencil"),bv={name:"RectangleStencil",components:{StencilPreview:yv,BoundingBox:fv,DraggableArea:mv},props:{image:{type:Object},coordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlersComponent:{type:[Object,String],default:function(){return Mc}},lines:{type:Object},linesComponent:{type:[Object,String],default:function(){return Fc}},aspectRatio:{type:[Number,String]},minAspectRatio:{type:[Number,String]},maxAspectRatio:{type:[Number,String]},movable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},transitions:{type:Object},movingClass:{type:String},resizingClass:{type:String},previewClass:{type:String},boundingBoxClass:{type:String},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}}},data:function(){return{moving:!1,resizing:!1}},computed:{classes:function(){return{stencil:_t(Va({movable:this.movable,moving:this.moving,resizing:this.resizing}),this.moving&&this.movingClass,this.resizing&&this.resizingClass),preview:_t(Va("preview"),this.previewClass),boundingBox:_t(Va("bounding-box"),this.boundingBoxClass)}},style:function(){var t=this.stencilCoordinates,e=t.height,n=t.width,i=t.left,o=t.top,r={width:"".concat(n,"px"),height:"".concat(e,"px"),transform:"translate(".concat(i,"px, ").concat(o,"px)")};return this.transitions&&this.transitions.enabled&&(r.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),r}},methods:{onMove:function(t){this.$emit("move",t),this.moving=!0},onMoveEnd:function(){this.$emit("move-end"),this.moving=!1},onResize:function(t){this.$emit("resize",t),this.resizing=!0},onResizeEnd:function(){this.$emit("resize-end"),this.resizing=!1},aspectRatios:function(){return{minimum:this.aspectRatio||this.minAspectRatio,maximum:this.aspectRatio||this.maxAspectRatio}}},emits:["resize","resize-end","move","move-end"]};bv.render=function(t,e,n,i,o,r){var s=Ue("stencil-preview"),a=Ue("draggable-area"),l=Ue("bounding-box");return y(),ne("div",{class:r.classes.stencil,style:r.style},[j(l,{width:n.stencilCoordinates.width,height:n.stencilCoordinates.height,transitions:n.transitions,class:r.classes.boundingBox,handlers:n.handlers,"handlers-component":n.handlersComponent,"handlers-classes":n.handlersClasses,"handlers-wrappers-classes":n.handlersWrappersClasses,lines:n.lines,"lines-component":n.linesComponent,"lines-classes":n.linesClasses,"lines-wrappers-classes":n.linesWrappersClasses,resizable:n.resizable,onResize:r.onResize,onResizeEnd:r.onResizeEnd},{default:we((function(){return[j(a,{movable:n.movable,onMove:r.onMove,onMoveEnd:r.onMoveEnd},{default:we((function(){return[j(s,{image:n.image,coordinates:n.coordinates,width:n.stencilCoordinates.width,height:n.stencilCoordinates.height,class:r.classes.preview,transitions:n.transitions},null,8,["image","coordinates","width","height","class","transitions"])]})),_:1},8,["movable","onMove","onMoveEnd"])]})),_:1},8,["width","height","transitions","class","handlers","handlers-component","handlers-classes","handlers-wrappers-classes","lines","lines-component","lines-classes","lines-wrappers-classes","resizable","onResize","onResizeEnd"])],6)};var xA=["transitions"],Bn=En("vue-advanced-cropper"),wv={name:"Cropper",components:{BackgroundWrapper:Il},props:{src:{type:String,default:null},stencilComponent:{type:[Object,String],default:function(){return bv}},backgroundWrapperComponent:{type:[Object,String],default:function(){return Il}},stencilProps:{type:Object,default:function(){return{}}},autoZoom:{type:Boolean,default:!1},imageClass:{type:String},boundariesClass:{type:String},backgroundClass:{type:String},foregroundClass:{type:String},minWidth:{type:[Number,String]},minHeight:{type:[Number,String]},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},debounce:{type:[Boolean,Number],default:500},transitions:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},canvas:{type:[Object,Boolean],default:!0},crossOrigin:{type:[Boolean,String],default:void 0},transitionTime:{type:Number,default:300},imageRestriction:{type:String,default:"fit-area",validator:function(t){return iA.indexOf(t)!==-1}},roundResult:{type:Boolean,default:!0},defaultSize:{type:[Function,Object]},defaultPosition:{type:[Function,Object]},defaultVisibleArea:{type:[Function,Object]},defaultTransforms:{type:[Function,Object]},defaultBoundaries:{type:[Function,String],validator:function(t){return!(typeof t=="string"&&t!=="fill"&&t!=="fit")}},priority:{type:String,default:"coordinates"},stencilSize:{type:[Object,Function]},resizeImage:{type:[Boolean,Object],default:!0},moveImage:{type:[Boolean,Object],default:!0},autoZoomAlgorithm:{type:Function},resizeAlgorithm:{type:Function,default:function(t){var e=t.event,n=t.coordinates,i=t.aspectRatio,o=t.positionRestrictions,r=t.sizeRestrictions,s=Re(Re({},n),{right:n.left+n.width,bottom:n.top+n.height}),a=e.params||{},l=Re({},e.directions),c=a.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};r.widthFrozen&&(l.left=0,l.right=0),r.heightFrozen&&(l.top=0,l.bottom=0),Rn.forEach((function(b){c[b]||(l[b]=0)}));var u=An(s,l=Yh({coordinates:s,directions:l,sizeRestrictions:r,positionRestrictions:o})).width,d=An(s,l).height,h=a.preserveRatio?Je(s):za(u/d,i);if(h){var m=a.respectDirection;if(m||(m=s.width>=s.height||h===1?"width":"height"),m==="width"){var f=u/h-s.height;if(c.top&&c.bottom){var p=l.top,_=l.bottom;l.bottom=Fr(f,_,p),l.top=Fr(f,p,_)}else c.bottom?l.bottom=f:c.top?l.top=f:c.right?l.right=0:c.left&&(l.left=0)}else if(m==="height"){var C=s.width-d*h;if(c.left&&c.right){var w=l.left,S=l.right;l.left=-Fr(C,w,S),l.right=-Fr(C,S,w)}else c.left?l.left=-C:c.right?l.right=-C:c.top?l.top=0:c.bottom&&(l.bottom=0)}l=Yh({directions:l,coordinates:s,sizeRestrictions:r,positionRestrictions:o,preserveRatio:!0,compensate:a.compensate})}return u=An(s,l).width,d=An(s,l).height,(h=a.preserveRatio?Je(s):za(u/d,i))&&Math.abs(h-u/d)>.001&&Rn.forEach((function(b){c[b]||(l[b]=0)})),Rl({event:new Rc({left:-l.left,top:-l.top}),coordinates:{width:n.width+l.right+l.left,height:n.height+l.top+l.bottom,left:n.left,top:n.top},positionRestrictions:o})}},moveAlgorithm:{type:Function,default:Rl},initStretcher:{type:Function,default:function(t){var e=t.stretcher,n=t.imageSize,i=Je(n);e.style.width=n.width+"px",e.style.height=e.clientWidth/i+"px",e.style.width=e.clientWidth+"px"}},fitCoordinates:{type:Function,default:function(t){var e=t.visibleArea,n=t.coordinates,i=t.aspectRatio,o=t.sizeRestrictions,r=t.positionRestrictions,s=Re(Re({},n),Xn({width:n.width,height:n.height,aspectRatio:i,sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minHeight:Math.min(e.height,o.minHeight),minWidth:Math.min(e.width,o.minWidth)}}));return s=St(s=Wt(s,io(wt(n),wt(s))),Ds(Ln(e),r))}},fitVisibleArea:{type:Function,default:function(t){var e=t.visibleArea,n=t.boundaries,i=t.getAreaRestrictions,o=t.coordinates,r=Re({},e);r.height=r.width/Je(n),r.top+=(e.height-r.height)/2,(o.height-r.height>0||o.width-r.width>0)&&(r=un(r,Math.max(o.height/r.height,o.width/r.width)));var s=Ms(ro(o,Ln(r=un(r,Fs(r,i({visibleArea:r,type:"resize"}))))));return r.width<o.width&&(s.left=0),r.height<o.height&&(s.top=0),r=St(r=Wt(r,s),i({visibleArea:r,type:"move"}))}},areaRestrictionsAlgorithm:{type:Function,default:function(t){var e=t.visibleArea,n=t.boundaries,i=t.imageSize,o=t.imageRestriction,r=t.type,s={};return o==="fill-area"?s={left:0,top:0,right:i.width,bottom:i.height}:o==="fit-area"&&(Je(n)>Je(i)?(s={top:0,bottom:i.height},e&&r==="move"&&(e.width>i.width?(s.left=-(e.width-i.width)/2,s.right=i.width-s.left):(s.left=0,s.right=i.width))):(s={left:0,right:i.width},e&&r==="move"&&(e.height>i.height?(s.top=-(e.height-i.height)/2,s.bottom=i.height-s.top):(s.top=0,s.bottom=i.height)))),s}},sizeRestrictionsAlgorithm:{type:Function,default:function(t){return{minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight}}},positionRestrictionsAlgorithm:{type:Function,default:function(t){var e=t.imageSize,n={};return t.imageRestriction!=="none"&&(n={left:0,top:0,right:e.width,bottom:e.height}),n}}},data:function(){return{transitionsActive:!1,imageLoaded:!1,imageAttributes:{width:null,height:null,crossOrigin:null,src:null},defaultImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},appliedImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},boundaries:{width:0,height:0},visibleArea:null,coordinates:Xe({},Hh)}},computed:{image:function(){return{src:this.imageAttributes.src,width:this.imageAttributes.width,height:this.imageAttributes.height,transforms:this.imageTransforms}},imageTransforms:function(){return{rotate:this.appliedImageTransforms.rotate,flip:{horizontal:this.appliedImageTransforms.flip.horizontal,vertical:this.appliedImageTransforms.flip.vertical},translateX:this.visibleArea?this.visibleArea.left/this.coefficient:0,translateY:this.visibleArea?this.visibleArea.top/this.coefficient:0,scaleX:1/this.coefficient,scaleY:1/this.coefficient}},imageSize:function(){var t=(function(e){return e*Math.PI/180})(this.imageTransforms.rotate);return{width:Math.abs(this.imageAttributes.width*Math.cos(t))+Math.abs(this.imageAttributes.height*Math.sin(t)),height:Math.abs(this.imageAttributes.width*Math.sin(t))+Math.abs(this.imageAttributes.height*Math.cos(t))}},initialized:function(){return!!(this.visibleArea&&this.imageLoaded)},settings:function(){var t=Al(this.resizeImage,{touch:!0,wheel:{ratio:.1},adjustStencil:!0},{touch:!1,wheel:!1,adjustStencil:!1});return{moveImage:Al(this.moveImage,{touch:!0,mouse:!0},{touch:!1,mouse:!1}),resizeImage:t}},coefficient:function(){return this.visibleArea?this.visibleArea.width/this.boundaries.width:0},areaRestrictions:function(){return this.imageLoaded?this.areaRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction,boundaries:this.boundaries}):{}},transitionsOptions:function(){return{enabled:this.transitionsActive,timingFunction:"ease-in-out",time:350}},sizeRestrictions:function(){if(this.boundaries.width&&this.boundaries.height&&this.imageSize.width&&this.imageSize.height){var t=this.sizeRestrictionsAlgorithm({imageSize:this.imageSize,minWidth:yt(this.minWidth)?0:Ir(this.minWidth),minHeight:yt(this.minHeight)?0:Ir(this.minHeight),maxWidth:yt(this.maxWidth)?1/0:Ir(this.maxWidth),maxHeight:yt(this.maxHeight)?1/0:Ir(this.maxHeight)});if(t=(function(i){var o=i.areaRestrictions,r=i.sizeRestrictions,s=i.boundaries,a=i.positionRestrictions,l=Re(Re({},r),{minWidth:r.minWidth!==void 0?r.minWidth:0,minHeight:r.minHeight!==void 0?r.minHeight:0,maxWidth:r.maxWidth!==void 0?r.maxWidth:1/0,maxHeight:r.maxHeight!==void 0?r.maxHeight:1/0});a.left!==void 0&&a.right!==void 0&&(l.maxWidth=Math.min(l.maxWidth,a.right-a.left)),a.bottom!==void 0&&a.top!==void 0&&(l.maxHeight=Math.min(l.maxHeight,a.bottom-a.top));var c=Pl(o),u=dv(s,c);return c.width<1/0&&(!l.maxWidth||l.maxWidth>u.width)&&(l.maxWidth=Math.min(l.maxWidth,u.width)),c.height<1/0&&(!l.maxHeight||l.maxHeight>u.height)&&(l.maxHeight=Math.min(l.maxHeight,u.height)),l.minWidth>l.maxWidth&&(l.minWidth=l.maxWidth,l.widthFrozen=!0),l.minHeight>l.maxHeight&&(l.minHeight=l.maxHeight,l.heightFrozen=!0),l})({sizeRestrictions:t,areaRestrictions:this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}),imageSize:this.imageSize,boundaries:this.boundaries,positionRestrictions:this.positionRestrictions,imageRestriction:this.imageRestriction,visibleArea:this.visibleArea,stencilSize:this.getStencilSize()}),this.visibleArea&&this.stencilSize){var e=this.getStencilSize(),n=Pl(this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}));t.maxWidth=Math.min(t.maxWidth,n.width*e.width/this.boundaries.width),t.maxHeight=Math.min(t.maxHeight,n.height*e.height/this.boundaries.height),t.maxWidth<t.minWidth&&(t.minWidth=t.maxWidth),t.maxHeight<t.minHeight&&(t.minHeight=t.maxHeight)}return t}return{minWidth:0,minHeight:0,maxWidth:0,maxHeight:0}},positionRestrictions:function(){return this.positionRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction})},classes:function(){return{cropper:Bn(),image:_t(Bn("image"),this.imageClass),stencil:Bn("stencil"),boundaries:_t(Bn("boundaries"),this.boundariesClass),stretcher:_t(Bn("stretcher")),background:_t(Bn("background"),this.backgroundClass),foreground:_t(Bn("foreground"),this.foregroundClass),imageWrapper:_t(Bn("image-wrapper")),cropperWrapper:_t(Bn("cropper-wrapper"))}},stencilCoordinates:function(){if(this.initialized){var t=this.coordinates,e=t.width,n=t.height,i=t.left,o=t.top;return{width:e/this.coefficient,height:n/this.coefficient,left:(i-this.visibleArea.left)/this.coefficient,top:(o-this.visibleArea.top)/this.coefficient}}return this.defaultCoordinates()},boundariesStyle:function(){var t={width:this.boundaries.width?"".concat(Math.round(this.boundaries.width),"px"):"auto",height:this.boundaries.height?"".concat(Math.round(this.boundaries.height),"px"):"auto",transition:"opacity ".concat(this.transitionTime,"ms"),pointerEvents:this.imageLoaded?"all":"none"};return this.imageLoaded||(t.opacity="0"),t},imageStyle:function(){var t=this.imageAttributes.width>this.imageAttributes.height?{width:Math.min(1024,this.imageAttributes.width),height:Math.min(1024,this.imageAttributes.width)/(this.imageAttributes.width/this.imageAttributes.height)}:{height:Math.min(1024,this.imageAttributes.height),width:Math.min(1024,this.imageAttributes.height)*(this.imageAttributes.width/this.imageAttributes.height)},e={left:(t.width-this.imageSize.width)/(2*this.coefficient),top:(t.height-this.imageSize.height)/(2*this.coefficient)},n={left:(1-1/this.coefficient)*t.width/2,top:(1-1/this.coefficient)*t.height/2},i=Xe(Xe({},this.imageTransforms),{},{scaleX:this.imageTransforms.scaleX*(this.imageAttributes.width/t.width),scaleY:this.imageTransforms.scaleY*(this.imageAttributes.height/t.height)}),o={width:"".concat(t.width,"px"),height:"".concat(t.height,"px"),left:"0px",top:"0px",transform:"translate(".concat(-e.left-n.left-this.imageTransforms.translateX,"px, ").concat(-e.top-n.top-this.imageTransforms.translateY,"px)")+vv(i)};return this.transitionsOptions.enabled&&(o.transition="".concat(this.transitionsOptions.time,"ms ").concat(this.transitionsOptions.timingFunction)),o}},watch:{src:function(){this.onChangeImage()},stencilComponent:function(){var t=this;this.$nextTick((function(){t.resetCoordinates(),t.runAutoZoom("setCoordinates"),t.onChange()}))},minWidth:function(){this.onPropsChange()},maxWidth:function(){this.onPropsChange()},minHeight:function(){this.onPropsChange()},maxHeight:function(){this.onPropsChange()},imageRestriction:function(){this.reset()},stencilProps:function(t,e){["aspectRatio","minAspectRatio","maxAspectRatio"].find((function(n){return t[n]!==e[n]}))&&this.$nextTick(this.onPropsChange)}},created:function(){this.debouncedUpdate=Ol(this.update,this.debounce),this.debouncedDisableTransitions=Ol(this.disableTransitions,this.transitionsOptions.time),this.awaiting=!1},mounted:function(){this.$refs.image.addEventListener("load",this.onSuccessLoadImage),this.$refs.image.addEventListener("error",this.onFailLoadImage),this.onChangeImage(),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh),this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.debouncedUpdate.clear(),this.debouncedDisableTransitions.clear()},methods:{getResult:function(){var t=this.initialized?this.prepareResult(Xe({},this.coordinates)):this.defaultCoordinates(),e={rotate:this.imageTransforms.rotate%360,flip:Xe({},this.imageTransforms.flip)};if(this.src&&this.imageLoaded){var n=this;return{image:this.image,coordinates:t,visibleArea:this.visibleArea?Xe({},this.visibleArea):null,imageTransforms:e,get canvas(){return n.canvas?n.getCanvas():void 0}}}return{image:this.image,coordinates:t,visibleArea:this.visibleArea?Xe({},this.visibleArea):null,canvas:void 0,imageTransforms:e}},zoom:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.transitions,o=i===void 0||i;this.onManipulateImage(new ko({},{factor:1/t,center:e}),{normalize:!1,transitions:o})},move:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.transitions,o=i===void 0||i;this.onManipulateImage(new ko({left:t||0,top:e||0}),{normalize:!1,transitions:o})},setCoordinates:function(t){var e=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.autoZoom,o=i===void 0||i,r=n.transitions,s=r===void 0||r;this.$nextTick((function(){e.imageLoaded?(e.transitionsActive||(s&&e.enableTransitions(),e.coordinates=e.applyTransform(t),o&&e.runAutoZoom("setCoordinates"),s&&e.debouncedDisableTransitions()),e.onChange()):e.delayedTransforms=t}))},refresh:function(){var t=this,e=this.$refs.image;if(this.src&&e)return this.initialized?this.updateVisibleArea().then((function(){t.onChange()})):this.resetVisibleArea().then((function(){t.onChange()}))},reset:function(){var t=this;return this.resetVisibleArea().then((function(){t.onChange(!1)}))},awaitRender:function(t){var e=this;this.awaiting||(this.awaiting=!0,this.$nextTick((function(){t(),e.awaiting=!1})))},prepareResult:function(t){return this.roundResult?(function(e){var n=e.coordinates,i=e.sizeRestrictions,o=e.positionRestrictions,r={width:Math.round(n.width),height:Math.round(n.height),left:Math.round(n.left),top:Math.round(n.top)};return r.width>i.maxWidth?r.width=Math.floor(n.width):r.width<i.minWidth&&(r.width=Math.ceil(n.width)),r.height>i.maxHeight?r.height=Math.floor(n.height):r.height<i.minHeight&&(r.height=Math.ceil(n.height)),St(r,o)})(Xe(Xe({},this.getPublicProperties()),{},{positionRestrictions:Mr(this.positionRestrictions,this.visibleArea),coordinates:t})):t},processAutoZoom:function(t,e,n,i){var o=this.autoZoomAlgorithm;o||(o=this.stencilSize?sA:this.autoZoom?aA:lA);var r=o({event:{type:t,params:i},visibleArea:e,coordinates:n,boundaries:this.boundaries,aspectRatio:this.getAspectRatio(),positionRestrictions:this.positionRestrictions,getAreaRestrictions:this.getAreaRestrictions,sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize()});return Xe(Xe({},r),{},{changed:!qh(r.visibleArea,e)||!qh(r.coordinates,n)})},runAutoZoom:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.transitions,i=n!==void 0&&n,o=GO(e,xA),r=this.processAutoZoom(t,this.visibleArea,this.coordinates,o),s=r.visibleArea,a=r.coordinates,l=r.changed;i&&l&&this.enableTransitions(),this.visibleArea=s,this.coordinates=a,i&&l&&this.debouncedDisableTransitions()},normalizeEvent:function(t){return(function(e){var n=e.event,i=e.visibleArea,o=e.coefficient;if(n.type==="manipulateImage")return Re(Re({},n),{move:{left:n.move&&n.move.left?o*n.move.left:0,top:n.move&&n.move.top?o*n.move.top:0},scale:{factor:n.scale&&n.scale.factor?n.scale.factor:1,center:n.scale&&n.scale.center?{left:n.scale.center.left*o+i.left,top:n.scale.center.top*o+i.top}:null}});if(n.type==="resize"){var r=Re(Re({},n),{directions:Re({},n.directions)});return Rn.forEach((function(a){r.directions[a]*=o})),r}if(n.type==="move"){var s=Re(Re({},n),{directions:Re({},n.directions)});return nA.forEach((function(a){s.directions[a]*=o})),s}return n})(Xe(Xe({},this.getPublicProperties()),{},{event:t}))},getCanvas:function(){if(this.$refs.canvas){var t=this.$refs.canvas,e=this.$refs.image,n=this.imageTransforms.rotate!==0||this.imageTransforms.flip.horizontal||this.imageTransforms.flip.vertical?(function(a,l,c){var u=c.rotate,d=c.flip,h={width:l.naturalWidth,height:l.naturalHeight},m=hv(h,u),f=a.getContext("2d");a.height=m.height,a.width=m.width,f.save();var p=ai(wt(Re({left:0,top:0},h)),u);return f.translate(-(p.left-m.width/2),-(p.top-m.height/2)),f.rotate(u*Math.PI/180),f.translate(d.horizontal?h.width:0,d.vertical?h.height:0),f.scale(d.horizontal?-1:1,d.vertical?-1:1),f.drawImage(l,0,0,h.width,h.height),f.restore(),a})(this.$refs.sourceCanvas,e,this.imageTransforms):e,i=Xe({minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,maxArea:this.maxCanvasSize,imageSmoothingEnabled:!0,imageSmoothingQuality:"high",fillColor:"transparent"},this.canvas),o=function(a){return a.find((function(l){return c=l,!Number.isNaN(parseFloat(c))&&isFinite(c);var c}))},r=Xn({sizeRestrictions:{minWidth:o([i.width,i.minWidth])||0,minHeight:o([i.height,i.minHeight])||0,maxWidth:o([i.width,i.maxWidth])||1/0,maxHeight:o([i.height,i.maxHeight])||1/0},width:this.coordinates.width,height:this.coordinates.height,aspectRatio:{minimum:this.coordinates.width/this.coordinates.height,maximum:this.coordinates.width/this.coordinates.height}});if(i.maxArea&&r.width*r.height>i.maxArea){var s=Math.sqrt(i.maxArea/(r.width*r.height));r={width:Math.round(s*r.width),height:Math.round(s*r.height)}}return(function(a,l,c,u,d){a.width=u?u.width:c.width,a.height=u?u.height:c.height;var h=a.getContext("2d");h.clearRect(0,0,a.width,a.height),d&&(d.imageSmoothingEnabled&&(h.imageSmoothingEnabled=d.imageSmoothingEnabled),d.imageSmoothingQuality&&(h.imageSmoothingQuality=d.imageSmoothingQuality),d.fillColor&&(h.fillStyle=d.fillColor,h.fillRect(0,0,a.width,a.height),h.save()));var m=c.left<0?-c.left:0,f=c.top<0?-c.top:0;h.drawImage(l,c.left+m,c.top+f,c.width,c.height,m*(a.width/c.width),f*(a.height/c.height),a.width,a.height)})(t,n,this.coordinates,r,i),t}},update:function(){this.$emit("change",this.getResult())},applyTransform:function(t){var e=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.visibleArea&&e?oA(this.sizeRestrictions,this.visibleArea):this.sizeRestrictions,i=this.visibleArea&&e?Mr(this.positionRestrictions,this.visibleArea):this.positionRestrictions;return rA({transform:t,coordinates:this.coordinates,imageSize:this.imageSize,sizeRestrictions:n,positionRestrictions:i,aspectRatio:this.getAspectRatio(),visibleArea:this.visibleArea})},resetCoordinates:function(){var t=this;if(this.$refs.image){this.$refs.cropper,this.$refs.image;var e=this.defaultSize;e||(e=this.stencilSize?dA:uA);var n=this.sizeRestrictions;n.minWidth,n.minHeight,n.maxWidth,n.maxHeight;var i=zi(e)?e({boundaries:this.boundaries,imageSize:this.imageSize,aspectRatio:this.getAspectRatio(),sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize(),visibleArea:this.visibleArea}):e,o=this.defaultPosition||cA,r=[i,function(s){var a=s.coordinates;return Xe({},zi(o)?o({coordinates:a,imageSize:t.imageSize,visibleArea:t.visibleArea}):t.defaultPosition)}];this.delayedTransforms&&r.push.apply(r,Mi(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.coordinates=this.applyTransform(r,!0),this.delayedTransforms=null}},clearImage:function(){var t=this;this.imageLoaded=!1,setTimeout((function(){var e=t.$refs.stretcher;e&&(e.style.height="auto",e.style.width="auto"),t.coordinates=t.defaultCoordinates(),t.boundaries={width:0,height:0}}),this.transitionTime)},enableTransitions:function(){this.transitions&&(this.transitionsActive=!0)},disableTransitions:function(){this.transitionsActive=!1},updateBoundaries:function(){var t=this,e=this.$refs.stretcher,n=this.$refs.cropper;return this.initStretcher({cropper:n,stretcher:e,imageSize:this.imageSize}),this.$nextTick().then((function(){var i={cropper:n,imageSize:t.imageSize};if(zi(t.defaultBoundaries)?t.boundaries=t.defaultBoundaries(i):t.defaultBoundaries==="fit"?t.boundaries=(function(o){var r=o.cropper,s=o.imageSize,a=r.clientHeight,l=r.clientWidth,c=a,u=s.width*a/s.height;return u>l&&(u=l,c=s.height*l/s.width),{width:u,height:c}})(i):t.boundaries=(function(o){var r=o.cropper;return{width:r.clientWidth,height:r.clientHeight}})(i),!t.boundaries.width||!t.boundaries.height)throw new Error("It's impossible to fit the cropper in the current container")}))},resetVisibleArea:function(){var t=this;return this.appliedImageTransforms=Xe(Xe({},this.defaultImageTransforms),{},{flip:Xe({},this.defaultImageTransforms.flip)}),this.updateBoundaries().then((function(){t.priority!=="visible-area"&&(t.visibleArea=null,t.resetCoordinates());var e,n,i,o,r,s,a=t.defaultVisibleArea||hA;t.visibleArea=zi(a)?a({imageSize:t.imageSize,boundaries:t.boundaries,coordinates:t.priority!=="visible-area"?t.coordinates:null,getAreaRestrictions:t.getAreaRestrictions,stencilSize:t.getStencilSize()}):t.defaultVisibleArea,t.visibleArea=(e={visibleArea:t.visibleArea,boundaries:t.boundaries,getAreaRestrictions:t.getAreaRestrictions},n=e.visibleArea,i=e.boundaries,o=e.getAreaRestrictions,r=Re({},n),s=Je(i),r.width/r.height!==s&&(r.height=r.width/s),St(r,o({visibleArea:r,type:"move"}))),t.priority==="visible-area"?t.resetCoordinates():t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("resetVisibleArea")})).catch((function(){t.visibleArea=null}))},updateVisibleArea:function(){var t=this;return this.updateBoundaries().then((function(){t.visibleArea=t.fitVisibleArea({imageSize:t.imageSize,boundaries:t.boundaries,visibleArea:t.visibleArea,coordinates:t.coordinates,getAreaRestrictions:t.getAreaRestrictions}),t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("updateVisibleArea")})).catch((function(){t.visibleArea=null}))},onChange:function(){var t=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];t&&this.debounce?this.debouncedUpdate():this.update()},onChangeImage:function(){var t,e=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.src){if((function(o){if(Vh(o))return!1;var r=window.location,s=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(o)||[],a={protocol:s[1]||"",host:s[2]||"",port:s[3]||""},l=function(c){return c.port||((c.protocol||r.protocol)==="http"?80:433)};return!(!a.protocol&&!a.host&&!a.port||a.protocol&&a.protocol==r.protocol&&a.host&&a.host==r.host&&a.host&&l(a)==l(r))})(this.src)){var n=yt(this.crossOrigin)?this.canvas:this.crossOrigin;n===!0&&(n="anonymous"),this.imageAttributes.crossOrigin=n||null}if(this.checkOrientation){var i=(t=this.src,new Promise((function(o){CA(t).then((function(r){var s=EA(r);o(r?{source:t,arrayBuffer:r,orientation:s}:{source:t,arrayBuffer:null,orientation:null})})).catch((function(r){console.warn(r),o({source:t,arrayBuffer:null,orientation:null})}))})));setTimeout((function(){i.then(e.onParseImage)}),this.transitionTime)}else setTimeout((function(){e.onParseImage({source:e.src})}),this.transitionTime)}else this.clearImage()},onFailLoadImage:function(){this.imageAttributes.src&&(this.clearImage(),this.$emit("error"))},onSuccessLoadImage:function(){var t=this,e=this.$refs.image;e&&!this.imageLoaded&&(this.imageAttributes.height=e.naturalHeight,this.imageAttributes.width=e.naturalWidth,this.imageLoaded=!0,this.resetVisibleArea().then((function(){t.$emit("ready"),t.onChange(!1)})))},onParseImage:function(t){var e=this,n=t.source,i=t.arrayBuffer,o=t.orientation;this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.imageAttributes.revoke=!1,i&&o&&o>1?sv(n)||!Vh(n)?(this.imageAttributes.src=URL.createObjectURL(new Blob([i])),this.imageAttributes.revoke=!0):this.imageAttributes.src=(function(r){for(var s=[],a=new Uint8Array(r);a.length>0;){var l=a.subarray(0,8192);s.push(String.fromCharCode.apply(null,Array.from?Array.from(l):l.slice())),a=a.subarray(8192)}return"data:image/jpeg;base64,"+btoa(s.join(""))})(i):this.imageAttributes.src=n,zi(this.defaultTransforms)?this.appliedImageTransforms=Ua(this.defaultTransforms()):Xr(this.defaultTransforms)?this.appliedImageTransforms=Ua(this.defaultTransforms):this.appliedImageTransforms=(function(r){var s=Ua({});if(r)switch(r){case 2:s.flip.horizontal=!0;break;case 3:s.rotate=-180;break;case 4:s.flip.vertical=!0;break;case 5:s.rotate=90,s.flip.vertical=!0;break;case 6:s.rotate=90;break;case 7:s.rotate=90,s.flip.horizontal=!0;break;case 8:s.rotate=-90}return s})(o),this.defaultImageTransforms=Xe(Xe({},this.appliedImageTransforms),{},{flip:Xe({},this.appliedImageTransforms.flip)}),this.$nextTick((function(){var r=e.$refs.image;r&&r.complete&&((function(s){return!!s.naturalWidth})(r)?e.onSuccessLoadImage():e.onFailLoadImage())}))},onResizeEnd:function(){this.runAutoZoom("resize",{transitions:!0})},onMoveEnd:function(){this.runAutoZoom("move",{transitions:!0})},onMove:function(t){var e=this;this.transitionsOptions.enabled||this.awaitRender((function(){e.coordinates=e.moveAlgorithm(Xe(Xe({},e.getPublicProperties()),{},{positionRestrictions:Mr(e.positionRestrictions,e.visibleArea),coordinates:e.coordinates,event:e.normalizeEvent(t)})),e.onChange()}))},onResize:function(t){var e=this;this.transitionsOptions.enabled||this.stencilSize&&!this.autoZoom||this.awaitRender((function(){var n=e.sizeRestrictions,i=Math.min(e.coordinates.width,e.coordinates.height,20*e.coefficient);e.coordinates=e.resizeAlgorithm(Xe(Xe({},e.getPublicProperties()),{},{positionRestrictions:Mr(e.positionRestrictions,e.visibleArea),sizeRestrictions:{maxWidth:Math.min(n.maxWidth,e.visibleArea.width),maxHeight:Math.min(n.maxHeight,e.visibleArea.height),minWidth:Math.max(n.minWidth,i),minHeight:Math.max(n.minHeight,i)},event:e.normalizeEvent(t)})),e.onChange(),e.ticking=!1}))},onManipulateImage:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.transitionsOptions.enabled){var n=e.transitions,i=n!==void 0&&n,o=e.normalize,r=o===void 0||o;i&&this.enableTransitions();var s=pA(Xe(Xe({},this.getPublicProperties()),{},{event:r?this.normalizeEvent(t):t,getAreaRestrictions:this.getAreaRestrictions,imageRestriction:this.imageRestriction,adjustStencil:!this.stencilSize&&this.settings.resizeImage.adjustStencil})),a=s.visibleArea,l=s.coordinates;this.visibleArea=a,this.coordinates=l,this.runAutoZoom("manipulateImage"),this.onChange(),i&&this.debouncedDisableTransitions()}},onPropsChange:function(){this.coordinates=this.applyTransform(this.coordinates,!0),this.onChange(!1)},getAreaRestrictions:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.visibleArea,n=t.type,i=n===void 0?"move":n;return this.areaRestrictionsAlgorithm({boundaries:this.boundaries,imageSize:this.imageSize,imageRestriction:this.imageRestriction,visibleArea:e,type:i})},getAspectRatio:function(t){var e,n,i=this.stencilProps,o=i.aspectRatio,r=i.minAspectRatio,s=i.maxAspectRatio;if(this.$refs.stencil&&this.$refs.stencil.aspectRatios){var a=this.$refs.stencil.aspectRatios();e=a.minimum,n=a.maximum}if(yt(e)&&(e=yt(o)?r:o),yt(n)&&(n=yt(o)?s:o),!t&&(yt(e)||yt(n))){var l=this.getStencilSize(),c=l?Je(l):null;yt(e)&&(e=Bh(c)?c:void 0),yt(n)&&(n=Bh(c)?c:void 0)}return{minimum:e,maximum:n}},getStencilSize:function(){if(this.stencilSize)return t={currentStencilSize:{width:this.stencilCoordinates.width,height:this.stencilCoordinates.height},stencilSize:this.stencilSize,boundaries:this.boundaries,coefficient:this.coefficient,coordinates:this.coordinates,aspectRatio:this.getAspectRatio(!0)},e=t.boundaries,n=t.stencilSize,i=t.aspectRatio,za(Je(o=zi(n)?n({boundaries:e,aspectRatio:i}):n),i)&&(o=Xn({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:o.width,height:o.height,aspectRatio:{minimum:i.minimum,maximum:i.maximum}})),(o.width>e.width||o.height>e.height)&&(o=Xn({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:o.width,height:o.height,aspectRatio:{minimum:Je(o),maximum:Je(o)}})),o;var t,e,n,i,o},getPublicProperties:function(){return{coefficient:this.coefficient,visibleArea:this.visibleArea,coordinates:this.coordinates,boundaries:this.boundaries,sizeRestrictions:this.sizeRestrictions,positionRestrictions:this.positionRestrictions,aspectRatio:this.getAspectRatio(),imageRestriction:this.imageRestriction}},defaultCoordinates:function(){return Xe({},Hh)},flip:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.transitions,o=i===void 0||i;if(!this.transitionsActive){o&&this.enableTransitions();var r=Xe({},this.imageTransforms.flip),s=mA({flip:{horizontal:t?!r.horizontal:r.horizontal,vertical:e?!r.vertical:r.vertical},previousFlip:r,rotate:this.imageTransforms.rotate,visibleArea:this.visibleArea,coordinates:this.coordinates,imageSize:this.imageSize,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),a=s.visibleArea,l=s.coordinates;t&&(this.appliedImageTransforms.flip.horizontal=!this.appliedImageTransforms.flip.horizontal),e&&(this.appliedImageTransforms.flip.vertical=!this.appliedImageTransforms.flip.vertical),this.visibleArea=a,this.coordinates=l,this.onChange(),o&&this.debouncedDisableTransitions()}},rotate:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.transitions,i=n===void 0||n;if(!this.transitionsActive){i&&this.enableTransitions();var o=Xe({},this.imageSize);this.appliedImageTransforms.rotate+=t;var r=fA({visibleArea:this.visibleArea,coordinates:this.coordinates,previousImageSize:o,imageSize:this.imageSize,angle:t,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),s=r.visibleArea,a=r.coordinates,l=this.processAutoZoom("rotateImage",s,a);s=l.visibleArea,a=l.coordinates,this.visibleArea=s,this.coordinates=a,this.onChange(),i&&this.debouncedDisableTransitions()}}},emits:["change","error","ready"]},TA={key:0,ref:"canvas",style:{display:"none"}},$A={key:1,ref:"sourceCanvas",style:{display:"none"}};wv.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"cropper",class:r.classes.cropper},[j("div",{ref:"stretcher",class:r.classes.stretcher},null,2),j("div",{class:r.classes.boundaries,style:r.boundariesStyle},[(y(),ne($t(n.backgroundWrapperComponent),{class:r.classes.cropperWrapper,"wheel-resize":r.settings.resizeImage.wheel,"touch-resize":r.settings.resizeImage.touch,"touch-move":r.settings.moveImage.touch,"mouse-move":r.settings.moveImage.mouse,onMove:r.onManipulateImage,onResize:r.onManipulateImage},{default:we((function(){return[j("div",{class:r.classes.background,style:r.boundariesStyle},null,6),j("div",{class:r.classes.imageWrapper},[j("img",{ref:"image",crossorigin:o.imageAttributes.crossOrigin,src:o.imageAttributes.src,class:r.classes.image,style:r.imageStyle,onMousedown:e[1]||(e[1]=Ye((function(){}),["prevent"]))},null,46,["crossorigin","src"])],2),j("div",{class:r.classes.foreground,style:r.boundariesStyle},null,6),it((y(),ne($t(n.stencilComponent),We({ref:"stencil",image:r.image,coordinates:o.coordinates,"stencil-coordinates":r.stencilCoordinates,transitions:r.transitionsOptions},n.stencilProps,{onResize:r.onResize,onResizeEnd:r.onResizeEnd,onMove:r.onMove,onMoveEnd:r.onMoveEnd}),null,16,["image","coordinates","stencil-coordinates","transitions","onResize","onResizeEnd","onMove","onMoveEnd"])),[[Sn,o.imageLoaded]]),n.canvas?(y(),ne("canvas",TA,null,512)):ue("",!0),n.canvas?(y(),ne("canvas",$A,null,512)):ue("",!0)]})),_:1},8,["class","wheel-resize","touch-resize","touch-move","mouse-move","onMove","onResize"]))],6)],2)};const _i=typeof window<"u",Sv=_i&&!("onscroll"in window)||typeof navigator<"u"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),Cv=_i&&window.devicePixelRatio>1,kA={elements_selector:".lazy",container:Sv||_i?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},Ev=t=>Object.assign({},kA,t),Qh=function(t,e){let n;const i="LazyLoad::Initialized",o=new t(e);try{n=new CustomEvent(i,{detail:{instance:o}})}catch{n=document.createEvent("CustomEvent"),n.initCustomEvent(i,!1,!1,{instance:o})}window.dispatchEvent(n)},OA=(t,e)=>{if(e)if(e.length)for(let n,i=0;n=e[i];i+=1)Qh(t,n);else Qh(t,e)},ei="src",Dc="srcset",Lc="sizes",xv="poster",rr="llOriginalAttrs",Tv="data",jc="loading",$v="loaded",kv="applied",AA="entered",zc="error",Ov="native",Av="data-",Pv="ll-status",Kt=(t,e)=>t.getAttribute(Av+e),PA=(t,e,n)=>{const i=Av+e;n!==null?t.setAttribute(i,n):t.removeAttribute(i)},sr=t=>Kt(t,Pv),Li=(t,e)=>PA(t,Pv,e),Ls=t=>Li(t,null),Nc=t=>sr(t)===null,RA=t=>sr(t)===jc,IA=t=>sr(t)===zc,Uc=t=>sr(t)===Ov,MA=[jc,$v,kv,zc],FA=t=>MA.indexOf(sr(t))>=0,yi=(t,e,n,i)=>{t&&typeof t=="function"&&(i===void 0?n===void 0?t(e):t(e,n):t(e,n,i))},fo=(t,e)=>{_i&&e!==""&&t.classList.add(e)},Pn=(t,e)=>{_i&&e!==""&&t.classList.remove(e)},DA=t=>{t.llTempImage=document.createElement("IMG")},LA=t=>{delete t.llTempImage},Rv=t=>t.llTempImage,js=(t,e)=>{if(!e)return;const n=e._observer;n&&n.unobserve(t)},jA=t=>{t.disconnect()},zA=(t,e,n)=>{e.unobserve_entered&&js(t,n)},Vc=(t,e)=>{t&&(t.loadingCount+=e)},NA=t=>{t&&(t.toLoadCount-=1)},Iv=(t,e)=>{t&&(t.toLoadCount=e)},UA=t=>t.loadingCount>0,VA=t=>t.toLoadCount>0,Mv=t=>{let e=[];for(let n,i=0;n=t.children[i];i+=1)n.tagName==="SOURCE"&&e.push(n);return e},Bc=(t,e)=>{const n=t.parentNode;n&&n.tagName==="PICTURE"&&Mv(n).forEach(e)},Fv=(t,e)=>{Mv(t).forEach(e)},zs=[ei],Dv=[ei,xv],Uo=[ei,Dc,Lc],Lv=[Tv],Ns=t=>!!t[rr],jv=t=>t[rr],zv=t=>delete t[rr],so=(t,e)=>{if(Ns(t))return;const n={};e.forEach((i=>{n[i]=t.getAttribute(i)})),t[rr]=n},BA=t=>{Ns(t)||(t[rr]={backgroundImage:t.style.backgroundImage})},Fi=(t,e)=>{if(!Ns(t))return;const n=jv(t);e.forEach((i=>{((o,r,s)=>{s?o.setAttribute(r,s):o.removeAttribute(r)})(t,i,n[i])}))},HA=t=>{if(!Ns(t))return;const e=jv(t);t.style.backgroundImage=e.backgroundImage},Nv=(t,e,n)=>{fo(t,e.class_applied),Li(t,kv),n&&(e.unobserve_completed&&js(t,e),yi(e.callback_applied,t,n))},Uv=(t,e,n)=>{fo(t,e.class_loading),Li(t,jc),n&&(Vc(n,1),yi(e.callback_loading,t,n))},ui=(t,e,n)=>{n&&t.setAttribute(e,n)},Xh=(t,e)=>{ui(t,Lc,Kt(t,e.data_sizes)),ui(t,Dc,Kt(t,e.data_srcset)),ui(t,ei,Kt(t,e.data_src))},qA=(t,e)=>{Bc(t,(n=>{so(n,Uo),Xh(n,e)})),so(t,Uo),Xh(t,e)},WA=(t,e)=>{so(t,zs),ui(t,ei,Kt(t,e.data_src))},KA=(t,e)=>{Fv(t,(n=>{so(n,zs),ui(n,ei,Kt(n,e.data_src))})),so(t,Dv),ui(t,xv,Kt(t,e.data_poster)),ui(t,ei,Kt(t,e.data_src)),t.load()},YA=(t,e)=>{so(t,Lv),ui(t,Tv,Kt(t,e.data_src))},GA=(t,e,n)=>{const i=Kt(t,e.data_bg),o=Kt(t,e.data_bg_hidpi),r=Cv&&o?o:i;r&&(t.style.backgroundImage=`url("${r}")`,Rv(t).setAttribute(ei,r),Uv(t,e,n))},QA=(t,e,n)=>{const i=Kt(t,e.data_bg_multi),o=Kt(t,e.data_bg_multi_hidpi),r=Cv&&o?o:i;r&&(t.style.backgroundImage=r,Nv(t,e,n))},XA=(t,e,n)=>{const i=Kt(t,e.data_bg_set);if(!i)return;let o=i.split("|").map((r=>`image-set(${r})`));t.style.backgroundImage=o.join(),Nv(t,e,n)},Vv={IMG:qA,IFRAME:WA,VIDEO:KA,OBJECT:YA},JA=(t,e)=>{const n=Vv[t.tagName];n&&n(t,e)},ZA=(t,e,n)=>{const i=Vv[t.tagName];i&&(i(t,e),Uv(t,e,n))},eP=["IMG","IFRAME","VIDEO","OBJECT"],tP=t=>eP.indexOf(t.tagName)>-1,Bv=(t,e)=>{!e||UA(e)||VA(e)||yi(t.callback_finish,e)},Jh=(t,e,n)=>{t.addEventListener(e,n),t.llEvLisnrs[e]=n},nP=(t,e,n)=>{t.removeEventListener(e,n)},Hc=t=>!!t.llEvLisnrs,iP=(t,e,n)=>{Hc(t)||(t.llEvLisnrs={});const i=t.tagName==="VIDEO"?"loadeddata":"load";Jh(t,i,e),Jh(t,"error",n)},Ml=t=>{if(!Hc(t))return;const e=t.llEvLisnrs;for(let n in e){const i=e[n];nP(t,n,i)}delete t.llEvLisnrs},Hv=(t,e,n)=>{LA(t),Vc(n,-1),NA(n),Pn(t,e.class_loading),e.unobserve_completed&&js(t,n)},oP=(t,e,n,i)=>{const o=Uc(e);Hv(e,n,i),fo(e,n.class_loaded),Li(e,$v),yi(n.callback_loaded,e,i),o||Bv(n,i)},rP=(t,e,n,i)=>{const o=Uc(e);Hv(e,n,i),fo(e,n.class_error),Li(e,zc),yi(n.callback_error,e,i),n.restore_on_error&&Fi(e,Uo),o||Bv(n,i)},Fl=(t,e,n)=>{const i=Rv(t)||t;Hc(i)||iP(i,(o=>{oP(0,t,e,n),Ml(i)}),(o=>{rP(0,t,e,n),Ml(i)}))},Dl=(t,e,n)=>{tP(t)?((i,o,r)=>{Fl(i,o,r),ZA(i,o,r)})(t,e,n):((i,o,r)=>{DA(i),Fl(i,o,r),BA(i),GA(i,o,r),QA(i,o,r),XA(i,o,r)})(t,e,n)},sP=(t,e,n)=>{t.setAttribute("loading","lazy"),Fl(t,e,n),JA(t,e),Li(t,Ov)},Zh=t=>{t.removeAttribute(ei),t.removeAttribute(Dc),t.removeAttribute(Lc)},aP=t=>{Bc(t,(e=>{Zh(e)})),Zh(t)},qv=t=>{Bc(t,(e=>{Fi(e,Uo)})),Fi(t,Uo)},lP=t=>{Fv(t,(e=>{Fi(e,zs)})),Fi(t,Dv),t.load()},cP=t=>{Fi(t,zs)},uP=t=>{Fi(t,Lv)},dP={IMG:qv,IFRAME:cP,VIDEO:lP,OBJECT:uP},hP=(t,e)=>{(n=>{const i=dP[n.tagName];i?i(n):HA(n)})(t),((n,i)=>{Nc(n)||Uc(n)||(Pn(n,i.class_entered),Pn(n,i.class_exited),Pn(n,i.class_applied),Pn(n,i.class_loading),Pn(n,i.class_loaded),Pn(n,i.class_error))})(t,e),Ls(t),zv(t)},pP=(t,e,n,i)=>{n.cancel_on_exit&&RA(t)&&t.tagName==="IMG"&&(Ml(t),aP(t),qv(t),Pn(t,n.class_loading),Vc(i,-1),Ls(t),yi(n.callback_cancel,t,e,i))},fP=(t,e,n,i)=>{const o=FA(t);Li(t,AA),fo(t,n.class_entered),Pn(t,n.class_exited),zA(t,n,i),yi(n.callback_enter,t,e,i),o||Dl(t,n,i)},mP=(t,e,n,i)=>{Nc(t)||(fo(t,n.class_exited),pP(t,e,n,i),yi(n.callback_exit,t,e,i))},vP=["IMG","IFRAME","VIDEO"],Wv=t=>t.use_native&&"loading"in HTMLImageElement.prototype,gP=(t,e,n)=>{t.forEach((i=>{vP.indexOf(i.tagName)!==-1&&sP(i,e,n)})),Iv(n,0)},_P=t=>t.isIntersecting||t.intersectionRatio>0,yP=(t,e)=>{e.forEach((n=>{t.observe(n)}))},bP=(t,e)=>{jA(t),yP(t,e)},wP=(t,e)=>{Wv(t)||(e._observer=new IntersectionObserver((n=>{((i,o,r)=>{i.forEach((s=>_P(s)?fP(s.target,s,o,r):mP(s.target,s,o,r)))})(n,t,e)}),(n=>({root:n.container===document?null:n.container,rootMargin:n.thresholds||n.threshold+"px"}))(t)))},Kv=t=>Array.prototype.slice.call(t),cs=t=>t.container.querySelectorAll(t.elements_selector),SP=t=>Kv(t).filter(Nc),CP=t=>IA(t),EP=t=>Kv(t).filter(CP),ep=(t,e)=>SP(t||cs(e)),xP=(t,e)=>{EP(cs(t)).forEach((n=>{Pn(n,t.class_error),Ls(n)})),e.update()},TP=(t,e)=>{_i&&(e._onlineHandler=()=>{xP(t,e)},window.addEventListener("online",e._onlineHandler))},$P=t=>{_i&&window.removeEventListener("online",t._onlineHandler)},Hi=function(t,e){const n=Ev(t);this._settings=n,this.loadingCount=0,wP(n,this),TP(n,this),this.update(e)};Hi.prototype={update:function(t){const e=this._settings,n=ep(t,e);Iv(this,n.length),Sv?this.loadAll(n):Wv(e)?gP(n,e,this):bP(this._observer,n)},destroy:function(){this._observer&&this._observer.disconnect(),$P(this),cs(this._settings).forEach((t=>{zv(t)})),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(t){const e=this._settings;ep(t,e).forEach((n=>{js(n,this),Dl(n,e,this)}))},restoreAll:function(){const t=this._settings;cs(t).forEach((e=>{hP(e,t)}))}},Hi.load=(t,e)=>{const n=Ev(e);Dl(t,n)},Hi.resetStatus=t=>{Ls(t)},_i&&OA(Hi,window.lazyLoadOptions);const Xt=(t,e)=>{const{o:n,i,u:o}=t;let r=n,s;const a=(u,d)=>{const h=r,m=u,f=d||(i?!i(h,m):h!==m);return(f||o)&&(r=m,s=h),[r,f,s]};return[e?u=>a(e(r,s),u):a,u=>[r,!!u,s]]},kP=typeof window<"u"&&typeof HTMLElement<"u"&&!!window.document,Bt=kP?window:{},Yv=Math.max,OP=Math.min,Ll=Math.round,li=Math.abs,tp=Math.sign,qc=Bt.cancelAnimationFrame,Vo=Bt.requestAnimationFrame,Wc=Bt.setTimeout,Gv=Bt.clearTimeout,Us=t=>typeof Bt[t]<"u"?Bt[t]:void 0,AP=Us("MutationObserver"),np=Us("IntersectionObserver"),qi=Us("ResizeObserver"),$o=Us("ScrollTimeline"),Kc=t=>t===void 0,Vs=t=>t===null,di=t=>typeof t=="number",mo=t=>typeof t=="string",Bs=t=>typeof t=="boolean",xn=t=>typeof t=="function",dn=t=>Array.isArray(t),us=t=>typeof t=="object"&&!dn(t)&&!Vs(t),Yc=t=>{const e=!!t&&t.length,n=di(e)&&e>-1&&e%1==0;return dn(t)||!xn(t)&&n?e>0&&us(t)?e-1 in t:!0:!1},Bo=t=>!!t&&t.constructor===Object,ds=t=>t instanceof HTMLElement,Hs=t=>t instanceof Element;function ot(t,e){if(Yc(t))for(let n=0;n<t.length&&e(t[n],n,t)!==!1;n++);else t&&ot(Object.keys(t),(n=>e(t[n],n,t)));return t}const Qv=(t,e)=>t.indexOf(e)>=0,ao=(t,e)=>t.concat(e),ct=(t,e,n)=>(!mo(e)&&Yc(e)?Array.prototype.push.apply(t,e):t.push(e),t),bi=t=>Array.from(t||[]),Gc=t=>dn(t)?t:!mo(t)&&Yc(t)?bi(t):[t],hs=t=>!!t&&!t.length,ps=t=>bi(new Set(t)),Zt=(t,e,n)=>{ot(t,o=>o?o.apply(void 0,e||[]):!0),n||(t.length=0)},Xv="paddingTop",Jv="paddingRight",Zv="paddingLeft",eg="paddingBottom",tg="marginLeft",ng="marginRight",ig="marginBottom",Qc="overflowX",Xc="overflowY",ar="width",lr="height",Yn="visible",yn="hidden",Pi="scroll",PP=t=>{const e=String(t||"");return e?e[0].toUpperCase()+e.slice(1):""},qs=(t,e,n,i)=>{if(t&&e){let o=!0;return ot(n,(r=>{const s=t[r],a=e[r];s!==a&&(o=!1)})),o}return!1},Jc=(t,e)=>qs(t,e,["w","h"]),Jr=(t,e)=>qs(t,e,["x","y"]),RP=(t,e)=>qs(t,e,["t","r","b","l"]),Le=(t,...e)=>t.bind(0,...e),Wi=t=>{let e;const n=t?Wc:Vo,i=t?Gv:qc;return[o=>{i(e),e=n((()=>o()),xn(t)?t():t)},()=>i(e)]},ip=t=>{const e=xn(t)?t():t;if(di(e)){const n=e?Wc:Vo,i=e?Gv:qc;return o=>{const r=n((()=>o()),e);return()=>{i(r)}}}return e&&e._},og=(t,e)=>{const{p:n,v:i,S:o,m:r}=e||{};let s,a,l,c;const u=function(p){a&&a(),s&&s(),c=a=s=l=void 0,t.apply(this,p)},d=f=>r&&l?r(l,f):f,h=()=>{a&&l&&u(d(l)||l)},m=function(){const p=bi(arguments),_=ip(n);if(_){const C=typeof o=="function"?o():o,w=ip(i),b=d(p)||p,E=u.bind(0,b);a&&a(),C&&!c?(E(),c=!0,a=_((()=>c=void 0))):(a=_(E),w&&!s&&(s=w(h))),l=b}else u(p)};return m.O=h,m},rg=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Nt=t=>t?Object.keys(t):[],Ze=(t,e,n,i,o,r,s)=>{const a=[e,n,i,o,r,s];return(typeof t!="object"||Vs(t))&&!xn(t)&&(t={}),ot(a,(l=>{ot(l,((c,u)=>{const d=l[u];if(t===d)return!0;const h=dn(d);if(d&&Bo(d)){const m=t[u];let f=m;h&&!dn(m)?f=[]:!h&&!Bo(m)&&(f={}),t[u]=Ze(f,d)}else t[u]=h?d.slice():d}))})),t},sg=(t,e)=>ot(Ze({},t),((n,i,o)=>{n===void 0?delete o[i]:n&&Bo(n)&&(o[i]=sg(n))})),Zc=t=>!Nt(t).length,Ho=()=>{},ag=(t,e,n)=>Yv(t,OP(e,n)),Ri=t=>ps((dn(t)?t:(t||"").split(" ")).filter((e=>e))),eu=(t,e)=>t&&t.getAttribute(e),op=(t,e)=>t&&t.hasAttribute(e),Wn=(t,e,n)=>{ot(Ri(e),(i=>{t&&t.setAttribute(i,String(n||""))}))},kn=(t,e)=>{ot(Ri(e),(n=>t&&t.removeAttribute(n)))},Ws=(t,e)=>{const n=Ri(eu(t,e)),i=Le(Wn,t,e),o=(r,s)=>{const a=new Set(n);return ot(Ri(r),(l=>{a[s](l)})),bi(a).join(" ")};return{C:r=>i(o(r,"delete")),$:r=>i(o(r,"add")),H:r=>{const s=Ri(r);return s.reduce(((a,l)=>a&&n.includes(l)),s.length>0)}}},lg=(t,e,n)=>(Ws(t,e).C(n),Le(tu,t,e,n)),tu=(t,e,n)=>(Ws(t,e).$(n),Le(lg,t,e,n)),fs=(t,e,n,i)=>(i?tu:lg)(t,e,n),nu=(t,e,n)=>Ws(t,e).H(n),cg=t=>Ws(t,"class"),ug=(t,e)=>{cg(t).C(e)},Ks=(t,e)=>(cg(t).$(e),Le(ug,t,e)),dg=(t,e)=>{const n=e?Hs(e)&&e:document;return n?bi(n.querySelectorAll(t)):[]},IP=(t,e)=>{const n=e?Hs(e)&&e:document;return n&&n.querySelector(t)},jl=(t,e)=>Hs(t)&&t.matches(e),hg=t=>jl(t,"body"),zl=t=>t?bi(t.childNodes):[],qo=t=>t&&t.parentElement,Ki=(t,e)=>Hs(t)&&t.closest(e),Nl=t=>document.activeElement,MP=(t,e,n)=>{const i=Ki(t,e),o=t&&IP(n,i),r=Ki(o,e)===i;return i&&o?i===t||o===t||r&&Ki(Ki(t,n),e)!==i:!1},lo=t=>{ot(Gc(t),(e=>{const n=qo(e);e&&n&&n.removeChild(e)}))},It=(t,e)=>Le(lo,t&&e&&ot(Gc(e),(n=>{n&&t.appendChild(n)})));let pg;const FP=()=>pg,DP=t=>{pg=t},Xi=t=>{const e=document.createElement("div");return Wn(e,"class",t),e},iu=t=>{const e=Xi(),n=FP(),i=t.trim();return e.innerHTML=n?n.createHTML(i):i,ot(zl(e),(o=>lo(o)))},rp=(t,e)=>t.getPropertyValue(e)||t[e]||"",fg=t=>{const e=t||0;return isFinite(e)?e:0},Lr=t=>fg(parseFloat(t||"")),Ul=t=>Math.round(t*1e4)/1e4,mg=t=>`${Ul(fg(t))}px`;function co(t,e){t&&e&&ot(e,((n,i)=>{try{const o=t.style,r=Vs(n)||Bs(n)?"":di(n)?mg(n):n;i.indexOf("--")===0?o.setProperty(i,r):o[i]=r}catch{}}))}function jn(t,e,n){const i=mo(e);let o=i?"":{};if(t){const r=Bt.getComputedStyle(t,n)||t.style;o=i?rp(r,e):bi(e).reduce(((s,a)=>(s[a]=rp(r,a),s)),o)}return o}const sp=(t,e,n)=>{const i=e?`${e}-`:"",o=n?`-${n}`:"",r=`${i}top${o}`,s=`${i}right${o}`,a=`${i}bottom${o}`,l=`${i}left${o}`,c=jn(t,[r,s,a,l]);return{t:Lr(c[r]),r:Lr(c[s]),b:Lr(c[a]),l:Lr(c[l])}},Ba=(t,e)=>`translate${us(t)?`(${t.x},${t.y})`:`${e?"X":"Y"}(${t})`}`,LP=t=>!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length),jP={w:0,h:0},Ys=(t,e)=>e?{w:e[`${t}Width`],h:e[`${t}Height`]}:jP,zP=t=>Ys("inner",t||Bt),hi=Le(Ys,"offset"),vg=Le(Ys,"client"),ms=Le(Ys,"scroll"),ou=t=>{const e=parseFloat(jn(t,ar))||0,n=parseFloat(jn(t,lr))||0;return{w:e-Ll(e),h:n-Ll(n)}},Ha=t=>t.getBoundingClientRect(),NP=t=>!!t&&LP(t),Vl=t=>!!(t&&(t[lr]||t[ar])),gg=(t,e)=>{const n=Vl(t);return!Vl(e)&&n},ap=(t,e,n,i)=>{ot(Ri(e),(o=>{t&&t.removeEventListener(o,n,i)}))},st=(t,e,n,i)=>{var o;const r=(o=i&&i.D)!=null?o:!0,s=i&&i.I||!1,a=i&&i.A||!1,l={passive:r,capture:s};return Le(Zt,Ri(e).map((c=>{const u=a?d=>{ap(t,c,u,s),n&&n(d)}:n;return t&&t.addEventListener(c,u,l),Le(ap,t,c,u,s)})))},ru=t=>t.stopPropagation(),Bl=t=>t.preventDefault(),_g=t=>ru(t)||Bl(t),cn=(t,e)=>{const{x:n,y:i}=di(e)?{x:e,y:e}:e||{};di(n)&&(t.scrollLeft=n),di(i)&&(t.scrollTop=i)},Jt=t=>({x:t.scrollLeft,y:t.scrollTop}),yg=()=>({T:{x:0,y:0},k:{x:0,y:0}}),UP=(t,e)=>{const{T:n,k:i}=t,{w:o,h:r}=e,s=(d,h,m)=>{let f=tp(d)*m,p=tp(h)*m;if(f===p){const _=li(d),C=li(h);p=_>C?0:p,f=_<C?0:f}return f=f===p?0:f,[f+0,p+0]},[a,l]=s(n.x,i.x,o),[c,u]=s(n.y,i.y,r);return{T:{x:a,y:c},k:{x:l,y:u}}},qa=({T:t,k:e})=>{const n=(i,o)=>i===0&&i<=o;return{x:n(t.x,e.x),y:n(t.y,e.y)}},lp=({T:t,k:e},n)=>{const i=(o,r,s)=>ag(0,1,(o-s)/(o-r)||0);return{x:i(t.x,e.x,n.x),y:i(t.y,e.y,n.y)}},Hl=t=>{t&&t.focus&&t.focus({preventScroll:!0,focusVisible:!1})},cp=(t,e)=>{ot(Gc(e),t)},ql=t=>{const e=new Map,n=(r,s)=>{if(r){const a=e.get(r);cp((l=>{a&&a[l?"delete":"clear"](l)}),s)}else e.forEach((a=>{a.clear()})),e.clear()},i=(r,s)=>{if(mo(r)){const c=e.get(r)||new Set;return e.set(r,c),cp((u=>{xn(u)&&c.add(u)}),s),Le(n,r,s)}Bs(s)&&s&&n();const a=Nt(r),l=[];return ot(a,(c=>{const u=r[c];u&&ct(l,i(c,u))})),Le(Zt,l)},o=(r,s)=>{ot(bi(e.get(r)),(a=>{s&&!hs(s)?a.apply(0,s):a()}))};return i(t||{}),[i,n,o]},bg={},wg={},VP=t=>{ot(t,(e=>ot(e,((n,i)=>{bg[i]=e[i]}))))},Sg=(t,e,n)=>Nt(t).map((i=>{const{static:o,instance:r}=t[i],[s,a,l]=n||[],c=n?r:o;if(c){const u=n?c(s,a,e):c(e);return(l||wg)[i]=u}})),BP=(t,e)=>t[e],vo=t=>BP(wg,t),HP="__osOptionsValidationPlugin",go="data-overlayscrollbars",Zr="os-environment",jr=`${Zr}-scrollbar-hidden`,Wa=`${go}-initialize`,es="noClipping",up=`${go}-body`,pi=go,qP="host",Kn=`${go}-viewport`,WP=Qc,KP=Xc,YP="arrange",Cg="measuring",GP="scrolling",Eg="scrollbarHidden",QP="noContent",Wl=`${go}-padding`,dp=`${go}-content`,su="os-size-observer",XP=`${su}-appear`,au=`${su}-listener`,JP=`${au}-scroll`,ts=`${au}-item`,hp=`${ts}-final`,ZP="os-trinsic-observer",eR="os-theme-none",tn="os-scrollbar",tR=`${tn}-rtl`,nR=`${tn}-horizontal`,iR=`${tn}-vertical`,xg=`${tn}-track`,lu=`${tn}-handle`,oR=`${tn}-visible`,rR=`${tn}-cornerless`,pp=`${tn}-interaction`,fp=`${tn}-unusable`,Kl=`${tn}-auto-hide`,sR=`${Kl}-hidden`,mp=`${tn}-wheel`,aR=`${xg}-interactive`,lR=`${lu}-interactive`,Tg="__osSizeObserverPlugin",cR={[Tg]:{static:()=>(t,e,n)=>{const o="scroll",r=iu(`<div class="${ts}" dir="ltr"><div class="${ts}"><div class="${hp}"></div></div><div class="${ts}"><div class="${hp}" style="width: 200%; height: 200%"></div></div></div>`),s=r[0],a=s.lastChild,l=s.firstChild,c=l?.firstChild;let u=hi(s),d=u,h=!1,m;const f=()=>{cn(l,3333333),cn(a,3333333)},p=w=>{m=0,h&&(u=d,e(w===!0))},_=w=>{d=hi(s),h=!w||!Jc(d,u),w?(ru(w),h&&!m&&(qc(m),m=Vo(p))):p(w===!1),f()},C=[It(t,r),st(l,o,_),st(a,o,_)];return Ks(t,JP),co(c,{[ar]:3333333,[lr]:3333333}),Vo(f),[n?Le(_,!1):f,C]}}},uR=(t,e)=>{const{M:n}=e,[i,o]=t("showNativeOverlaidScrollbars");return[i&&n.x&&n.y,o]},Yi=t=>t.indexOf(Yn)===0,dR=t=>t.replace(`${Yn}-`,""),Yl=(t,e)=>{if(t==="auto")return e?Pi:yn;const n=t||yn;return[yn,Pi,Yn].includes(n)?n:yn},hR=(t,e)=>{const{overflowX:n,overflowY:i}=jn(t,[Qc,Xc]);return{x:Yl(n,e.x),y:Yl(i,e.y)}},cu="__osScrollbarsHidingPlugin",pR="__osClickScrollPlugin",vp=t=>JSON.stringify(t,((e,n)=>{if(xn(n))throw 0;return n})),gp=(t,e)=>t?`${e}`.split(".").reduce(((n,i)=>n&&rg(n,i)?n[i]:void 0),t):void 0,fR=[0,33],$g=[33,99],kg=[222,666,!0],mR={paddingAbsolute:!1,showNativeOverlaidScrollbars:!1,update:{elementEvents:[["img","load"]],debounce:{mutation:fR,resize:null,event:$g,env:kg},attributes:null,ignoreMutation:null,flowDirectionStyles:null},overflow:{x:"scroll",y:"scroll"},scrollbars:{theme:"os-theme-dark",visibility:"auto",autoHide:"never",autoHideDelay:1300,autoHideSuspend:!1,dragScroll:!0,clickScroll:!1,pointers:["mouse","touch","pen"]}},Og=(t,e)=>{const n={},i=ao(Nt(e),Nt(t));return ot(i,(o=>{const r=t[o],s=e[o];if(us(r)&&us(s))Ze(n[o]={},Og(r,s)),Zc(n[o])&&delete n[o];else if(rg(e,o)&&s!==r){let a=!0;if(dn(r)||dn(s))try{vp(r)===vp(s)&&(a=!1)}catch{}a&&(n[o]=s)}})),n},Ka=(t,e,n)=>i=>[gp(t,i),n||gp(e,i)!==void 0];let Ag;const vR=()=>Ag,gR=t=>{Ag=t};let Ya;const _R=()=>{const t=(b,E,x)=>{It(document.body,b),It(document.body,b);const O=vg(b),$=hi(b),K=ou(E);return x&&lo(b),{x:$.h-O.h+K.h,y:$.w-O.w+K.w}},e=b=>{let E=!1;const x=Ks(b,jr);try{E=jn(b,"scrollbar-width")==="none"||jn(b,"display","::-webkit-scrollbar")==="none"}catch{}return x(),E},n=`.${Zr}{scroll-behavior:auto!important;position:fixed;opacity:0;visibility:hidden;overflow:scroll;height:200px;width:200px;z-index:-1}.${Zr} div{width:200%;height:200%;margin:10px 0}.${jr}{scrollbar-width:none!important}.${jr}::-webkit-scrollbar,.${jr}::-webkit-scrollbar-corner{appearance:none!important;display:none!important;width:0!important;height:0!important}`,o=iu(`<div class="${Zr}"><div></div><style>${n}</style></div>`)[0],r=o.firstChild,s=o.lastChild,a=vR();a&&(s.nonce=a);const[l,,c]=ql(),[u,d]=Xt({o:t(o,r),i:Jr},Le(t,o,r,!0)),[h]=d(),m=e(o),f={x:h.x===0,y:h.y===0},p={elements:{host:null,padding:!m,viewport:b=>m&&hg(b)&&b,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},_=Ze({},mR),C=Le(Ze,{},_),w=Le(Ze,{},p),S={U:h,M:f,P:m,J:!!$o,G:Le(l,"r"),K:w,Z:b=>Ze(p,b)&&w(),tt:C,nt:b=>Ze(_,b)&&C(),ot:Ze({},p),st:Ze({},_)};if(kn(o,"style"),lo(o),st(Bt,"resize",(()=>{c("r",[])})),xn(Bt.matchMedia)&&!m&&(!f.x||!f.y)){const b=E=>{const x=Bt.matchMedia(`(resolution: ${Bt.devicePixelRatio}dppx)`);st(x,"change",(()=>{E(),b(E)}),{A:!0})};b((()=>{const[E,x]=u();Ze(S.U,E),c("r",[x])}))}return S},Un=()=>(Ya||(Ya=_R()),Ya),yR=(t,e,n)=>{let i=!1;const o=n?new WeakMap:!1,r=()=>{i=!0},s=a=>{if(o&&n){const l=n.map((c=>{const[u,d]=c||[];return[d&&u?(a||dg)(u,t):[],d]}));ot(l,(c=>ot(c[0],(u=>{const d=c[1],h=o.get(u)||[];if(t.contains(u)&&d){const f=st(u,d,(p=>{i?(f(),o.delete(u)):e(p)}));o.set(u,ct(h,f))}else Zt(h),o.delete(u)}))))}};return s(),[r,s]},_p=(t,e,n,i)=>{let o=!1;const{et:r,ct:s,rt:a,it:l,lt:c,ut:u}=i||{},[d,h]=yR(t,(()=>o&&n(!0)),a),m=r||[],f=s||[],p=ao(m,f),_=(w,S)=>{if(!hs(S)){const b=c||Ho,E=u||Ho,x=[],O=[];let $=!1,K=!1;if(ot(S,(F=>{const{attributeName:P,target:N,type:M,oldValue:q,addedNodes:le,removedNodes:de}=F,Y=M==="attributes",I=M==="childList",A=t===N,Q=Y&&P,U=Q&&eu(N,P||""),ie=mo(U)?U:null,ve=Q&&q!==ie,re=Qv(f,P)&&ve;if(e&&(I||!A)){const ge=Y&&ve,_e=ge&&l&&jl(N,l),k=(_e?!b(N,P,q,ie):!Y||ge)&&!E(F,!!_e,t,i);ot(le,(z=>ct(x,z))),ot(de,(z=>ct(x,z))),K=K||k}!e&&A&&ve&&!b(N,P,q,ie)&&(ct(O,P),$=$||re)})),h((F=>ps(x).reduce(((P,N)=>(ct(P,dg(F,N)),jl(N,F)?ct(P,N):P)),[]))),e)return!w&&K&&n(!1),[!1];if(!hs(O)||$){const F=[ps(O),$];return w||n.apply(0,F),F}}},C=new AP(Le(_,!1));return[()=>(C.observe(t,{attributes:!0,attributeOldValue:!0,attributeFilter:p,subtree:e,childList:e,characterData:e}),o=!0,()=>{o&&(d(),C.disconnect(),o=!1)}),()=>{if(o)return _(!0,C.takeRecords())}]};let Ci=null;const Pg=(t,e,n)=>{const{ft:i}=n||{},o=vo(Tg),[r]=Xt({o:!1,u:!0});return()=>{const s=[],l=iu(`<div class="${su}"><div class="${au}"></div></div>`)[0],c=l.firstChild,u=d=>{const h=dn(d)&&!hs(d);let m=!1,f=!1;if(h){const p=d[0],[_,,C]=r(p.contentRect),w=Vl(_);f=gg(_,C),m=!f&&!w}else f=d===!0;m||e({_t:!0,ft:f})};if(qi){if(!Bs(Ci)){const f=new qi(Ho);f.observe(t,{get box(){Ci=!0}}),Ci=Ci||!1,f.disconnect()}const d=og(u,{p:0,v:0}),h=f=>d(f),m=new qi(h);if(m.observe(Ci?t:c),ct(s,[()=>{m.disconnect()},!Ci&&It(t,l)]),Ci){const f=new qi(h);f.observe(t,{box:"border-box"}),ct(s,(()=>f.disconnect()))}}else if(o){const[d,h]=o(c,u,i);ct(s,ao([Ks(l,XP),st(l,"animationstart",d),It(t,l)],h))}else return Ho;return Le(Zt,s)}},bR=(t,e)=>{let n;const i=l=>l.h===0||l.isIntersecting||l.intersectionRatio>0,o=Xi(ZP),[r]=Xt({o:!1}),s=(l,c)=>{if(l){const u=r(i(l)),[,d]=u;return d&&!c&&e(u)&&[u]}},a=(l,c)=>s(c.pop(),l);return[()=>{const l=[];if(np)n=new np(Le(a,!1),{root:t}),n.observe(o),ct(l,(()=>{n.disconnect()}));else{const c=()=>{const u=hi(o);s(u)};ct(l,Pg(o,c)()),c()}return Le(Zt,ct(l,It(t,o)))},()=>n&&a(!0,n.takeRecords())]},wR=(t,e,n,i)=>{let o,r,s,a,l,c,u,d;const h=`[${pi}]`,m=`[${Kn}]`,f=["id","class","style","open","wrap","cols","rows"],{dt:p,vt:_,L:C,gt:w,ht:S,V:b,bt:E,yt:x,wt:O,St:$}=t,K=R=>jn(R,"direction")==="rtl",F=()=>{let R,k,z;const D=og(i,{p:()=>R,v:()=>k,S:()=>z,m(oe,ee){const[G]=oe,[he]=ee;return[ao(Nt(G),Nt(he)).reduce(((me,ke)=>(me[ke]=G[ke]||he[ke],me)),{})]}}),B=(oe,ee)=>{if(dn(ee)){const[G,he,me]=ee;R=G,k=he,z=me}else di(ee)?(R=ee,k=!1,z=!1):(R=!1,k=!1,z=!1);D(oe)};return B.O=D.O,B},P={Ot:!1,B:K(p)},N=Un(),M=vo(cu),[q]=Xt({i:Jc,o:{w:0,h:0}},(()=>{const R=M&&M.R(t,e,P,N,n).Y,z=!(E&&b)&&nu(_,pi,es),D=!b&&x(YP),B=D&&Jt(w),oe=B&&$(),ee=O(Cg,z),G=D&&R&&R(),he=ms(C),me=ou(C);return G&&G(),cn(w,B),oe&&oe(),z&&ee(),{w:he.w+me.w,h:he.h+me.h}})),le=F(),de=R=>{const k=K(p);Ze(R,{Ct:d!==k}),Ze(P,{B:k}),d=k},Y=(R,k)=>{const[z,D]=R,B={$t:D};return Ze(P,{Ot:z}),k||i(B),B},I=({_t:R,ft:k})=>{const z=k?i:le,D={_t:R||k,ft:k};de(D),z(D,r)},A=(R,k)=>{const[,z]=q(),D={xt:z};return de(D),z&&!k&&le(D,R?s:o),D},Q=(R,k,z)=>{const D={Ht:k};return de(D),k&&!z&&le(D,o),D},[U,ie]=S?bR(_,Y):[],ve=!b&&Pg(_,I,{ft:!0}),[re,ge]=_p(_,!1,Q,{ct:f,et:f}),_e=b&&qi&&new qi((R=>{const k=R[R.length-1].contentRect;I({_t:!0,ft:gg(k,u)}),u=k}));return[()=>{_e&&_e.observe(_);const R=ve&&ve(),k=U&&U(),z=re(),D=N.G((B=>{const[,oe]=q();le({Et:B,xt:oe,_t:E},a)}));return()=>{_e&&_e.disconnect(),R&&R(),k&&k(),c&&c(),z(),D()}},({Dt:R,zt:k,It:z})=>{const D={},[B]=R("update.ignoreMutation"),[oe,ee]=R("update.attributes"),[G,he]=R("update.elementEvents"),[me,ke]=R("update.debounce"),Ee=he||ee,ze=k||z,Pe=Ne=>xn(B)&&!!B(Ne);if(Ee){l&&l(),c&&c();const[Ne,ut]=_p(S||C,!0,A,{et:ao(f,oe||[]),rt:G,it:h,ut:(Qe,at)=>{const{target:tt,attributeName:pt}=Qe;return(!at&&pt&&!b?MP(tt,h,m):!1)||!!Ki(tt,`.${tn}`)||Pe(Qe)}});c=Ne(),l=ut}if(ke&&(le.O(),dn(me)||di(me)?(o=me,r=!1,s=$g,a=kg):Bo(me)?(o=me.mutation,r=me.resize,s=me.event,a=me.env):(o=!1,r=!1,s=!1,a=!1)),ze){const Ne=ge(),ut=ie&&ie(),Qe=l&&l();Ne&&Ze(D,Q(Ne[0],Ne[1],ze)),ut&&Ze(D,Y(ut[0],ze)),Qe&&Ze(D,A(Qe[0],ze))}return de(D),D},P]},Rg=(t,e)=>xn(e)?e.apply(0,t):e,SR=(t,e,n,i)=>{const o=Kc(i)?n:i;return Rg(t,o)||e.apply(0,t)},Ig=(t,e,n,i)=>{const o=Kc(i)?n:i,r=Rg(t,o);return!!r&&(ds(r)?r:e.apply(0,t))},CR=(t,e)=>{const{nativeScrollbarsOverlaid:n,body:i}=e||{},{M:o,P:r,K:s}=Un(),{nativeScrollbarsOverlaid:a,body:l}=s().cancel,c=n??a,u=Kc(i)?l:i,d=(o.x||o.y)&&c,h=t&&(Vs(u)?!r:u);return!!d||!!h},ER=(t,e,n,i)=>{const o="--os-viewport-percent",r="--os-scroll-percent",s="--os-scroll-direction",{K:a}=Un(),{scrollbars:l}=a(),{slot:c}=l,{dt:u,vt:d,L:h,At:m,gt:f,bt:p,V:_}=e,{scrollbars:C}=m?{}:t,{slot:w}=C||{},S=[],b=[],E=[],x=Ig([u,d,h],(()=>_&&p?u:d),c,w),O=U=>{if($o){let ie=null,ve=[];const re=new $o({source:f,axis:U}),ge=()=>{ie&&ie.cancel(),ie=null};return{Mt:R=>{const{Tt:k}=n,z=qa(k)[U],D=U==="x",B=[Ba(0,D),Ba(`calc(-100% + 100cq${D?"w":"h"})`,D)],oe=z?B:B.reverse();return ve[0]===oe[0]&&ve[1]===oe[1]||(ve=oe,ge(),ie=R.kt.animate({clear:["left"],transform:oe},{timeline:re})),ge}}}},$={x:O("x"),y:O("y")},K=()=>{const{Rt:U,Vt:ie}=n,ve=(re,ge)=>ag(0,1,re/(re+ge)||0);return{x:ve(ie.x,U.x),y:ve(ie.y,U.y)}},F=(U,ie,ve)=>{const re=ve?Ks:ug;ot(U,(ge=>{re(ge.Lt,ie)}))},P=(U,ie)=>{ot(U,(ve=>{const[re,ge]=ie(ve);co(re,ge)}))},N=(U,ie,ve)=>{const re=Bs(ve),ge=re?ve:!0,_e=re?!ve:!0;ge&&F(b,U,ie),_e&&F(E,U,ie)},M=()=>{const U=K(),ie=ve=>re=>[re.Lt,{[o]:Ul(ve)+""}];P(b,ie(U.x)),P(E,ie(U.y))},q=()=>{if(!$o){const{Tt:U}=n,ie=lp(U,Jt(f)),ve=re=>ge=>[ge.Lt,{[r]:Ul(re)+""}];P(b,ve(ie.x)),P(E,ve(ie.y))}},le=()=>{const{Tt:U}=n,ie=qa(U),ve=re=>ge=>[ge.Lt,{[s]:re?"0":"1"}];P(b,ve(ie.x)),P(E,ve(ie.y)),$o&&(b.forEach($.x.Mt),E.forEach($.y.Mt))},de=()=>{if(_&&!p){const{Rt:U,Tt:ie}=n,ve=qa(ie),re=lp(ie,Jt(f)),ge=_e=>{const{Lt:R}=_e,k=qo(R)===h&&R,z=(D,B,oe)=>{const ee=B*D;return mg(oe?ee:-ee)};return[k,k&&{transform:Ba({x:z(re.x,U.x,ve.x),y:z(re.y,U.y,ve.y)})}]};P(b,ge),P(E,ge)}},Y=U=>{const ie=U?"x":"y",re=Xi(`${tn} ${U?nR:iR}`),ge=Xi(xg),_e=Xi(lu),R={Lt:re,Pt:ge,kt:_e},k=$[ie];return ct(U?b:E,R),ct(S,[It(re,ge),It(ge,_e),Le(lo,re),k&&k.Mt(R),i(R,N,U)]),R},I=Le(Y,!0),A=Le(Y,!1),Q=()=>(It(x,b[0].Lt),It(x,E[0].Lt),Le(Zt,S));return I(),A(),[{Ut:M,Nt:q,qt:le,Bt:de,Ft:N,jt:{Xt:b,Yt:I,Wt:Le(P,b)},Jt:{Xt:E,Yt:A,Wt:Le(P,E)}},Q]},xR=(t,e,n,i,o)=>(r,s,a)=>{const{vt:l,L:c,V:u,gt:d,Gt:h,St:m}=e,{Lt:f,Pt:p,kt:_}=r,[C,w]=Wi(333),[S,b]=Wi(444),E=$=>{xn(d.scrollBy)&&d.scrollBy({behavior:"smooth",left:$.x,top:$.y})},x=()=>{const $="pointerup pointercancel lostpointercapture",K=`client${a?"X":"Y"}`,F=a?ar:lr,P=a?"left":"top",N=a?"w":"h",M=a?"x":"y",q=[];return st(p,"pointerdown",i((le=>{const de=Ki(le.target,`.${lu}`)===_,Y=de?_:p,I=t.scrollbars,A=I[de?"dragScroll":"clickScroll"],{button:Q,isPrimary:U,pointerType:ie}=le,{pointers:ve}=I;if(Q===0&&U&&A&&(ve||[]).includes(ie)){Zt(q),b();const ge=!de&&(le.shiftKey||A==="instant"),_e=Le(Ha,_),R=Le(Ha,p),k=(tt,pt)=>(tt||_e())[P]-(pt||R())[P],z=Ll(Ha(d)[F])/hi(d)[N]||1,D=Jt(d)[M],B=tt=>{cn(d,{[M]:D+tt})},oe=tt=>{const{Rt:pt}=n,dt=hi(p)[N]-hi(_)[N],ft=1/z*tt/dt;B(ft*pt[M])},ee=le[K],G=_e(),he=R(),me=G[F],ke=k(G,he)+me/2,ze=ee-he[P]-ke,Pe=de?0:ze,Ne=tt=>{Zt(at),Y.releasePointerCapture(tt.pointerId)},ut=de||ge,Qe=m(),at=[st(h,$,Ne),st(h,"selectstart",(tt=>Bl(tt)),{D:!1}),st(p,$,Ne),ut&&st(p,"pointermove",(tt=>oe(Pe+tt[K]-ee))),ut&&(()=>{const tt=Jt(d);Qe();const pt=Jt(d),dt={x:pt.x-tt.x,y:pt.y-tt.y};(li(dt.x)>3||li(dt.y)>3)&&(m(),cn(d,tt),E(dt),S(Qe))})];if(Y.setPointerCapture(le.pointerId),ge)oe(ze);else if(!de){const tt=vo(pR);if(tt){const{Vt:pt}=n,dt=tt(B,oe,Le(k),ze,pt[M],A,!!a,(ft=>{ft?Qe():ct(at,Qe)}));ct(at,dt),ct(q,Le(dt,!0))}}}})))};let O=!0;return Le(Zt,[st(_,"pointermove pointerleave",i(o)),st(f,"pointerenter",i((()=>{s(pp,!0)}))),st(f,"pointerleave pointercancel",i((()=>{s(pp,!1)}))),st(f,"wheel",i(($=>{const{deltaX:K,deltaY:F,deltaMode:P}=$;O&&P===0&&qo(f)===l&&E({x:K,y:F}),O=!1,s(mp,!0),C((()=>{O=!0,s(mp)})),Bl($)})),{D:!1,I:!0}),!u&&st(f,"mousedown",i((()=>{const $=Nl();(op($,Kn)||op($,pi)||$===document.body)&&Wc(Le(Hl,c),25)}))),st(f,"pointerdown",(()=>{const $=st(h,"click",(F=>{K(),_g(F)}),{A:!0,I:!0,D:!1}),K=st(h,"pointerup pointercancel",(()=>{K(),setTimeout($,150)}),{I:!0,D:!0})}),{I:!0,D:!0}),x(),w,b])},TR=(t,e,n,i,o,r,s)=>{let a,l,c,u,d,h=Ho,m=0;const f=["mouse","pen"],p=_e=>R=>{n.Kt||_e(R)},_=_e=>f.includes(_e.pointerType),[C,w]=Wi(),[S,b]=Wi(100),[E,x]=Wi(50),[O,$]=Wi((()=>m)),[K,F]=ER(t,r,o,xR(e,r,o,p,(_e=>_(_e)&&Q()))),{vt:P,Qt:N,bt:M}=r,{Ft:q,Ut:le,Nt:de,qt:Y,Bt:I}=K,A=(_e,R)=>{$();const k=z=>{n.Kt||q(sR,z)};if(_e)k();else{const z=c?!a:!0;m>0&&!R?O(Le(k,z)):k(z)}},Q=()=>{(c?!a:!u)&&(A(!0),S((()=>{A(!1)})))},U=_e=>{_(_e)&&(a=!0,!n.Kt&&c&&A(!0))},ie=_e=>{_(_e)&&(a=!1,!n.Kt&&c&&A(!1))},ve=_e=>{q(Kl,_e,!0),q(Kl,_e,!1)},re=[$,b,x,w,()=>h(),st(P,"pointerover",U,{A:!0}),st(P,"pointerenter",U),st(P,"pointerleave",ie),st(P,"pointermove",p((_e=>{_(_e)&&l&&Q()}))),st(N,"scroll",p((_e=>{C((()=>{de(),Q()})),s(_e),I()})))],ge=vo(cu);return[()=>Le(Zt,ct(re,F())),({Dt:_e,It:R,Zt:k,tn:z})=>{const{nn:D,sn:B,en:oe,cn:ee}=z||{},{Ct:G,ft:he}=k||{},{B:me}=i,{M:ke,P:Ee}=Un(),{rn:ze,j:Pe}=o,[Ne,ut]=_e("showNativeOverlaidScrollbars"),[Qe,at]=_e("scrollbars.theme"),[tt,pt]=_e("scrollbars.visibility"),[dt,ft]=_e("scrollbars.autoHide"),[Ft,fn]=_e("scrollbars.autoHideSuspend"),[X]=_e("scrollbars.autoHideDelay"),[V,J]=_e("scrollbars.dragScroll"),[ye,xe]=_e("scrollbars.clickScroll"),[se,Me]=_e("overflow"),Z=he&&!R,ae=D||B||ee||G||R,fe=oe||pt||Me,ce=Ne&&ke.x&&ke.y,be=!Ee&&!ge,$n=ce||be,Qt=(on,Dt,bt)=>{const dr=on.includes(Pi)&&(tt===Yn||tt==="auto"&&Dt===Pi);return q(oR,dr,bt),dr};if(m=X,(ut||be)&&q(eR,$n),at&&(q(d),q(Qe,!0),d=Qe),(fn||Z)&&(ve(!Ft),Z&&Ft&&(Pe.x||Pe.y?(h(),E((()=>{h=st(N,Pi,p(Le(ve,!0)),{A:!0})}))):ve(!0))),ft&&(l=dt==="move",c=dt==="leave",u=dt==="never",A(u,!0)),J&&q(lR,V),xe&&q(aR,!!ye),fe){const on=Qt(se.x,ze.x,!0),Dt=Qt(se.y,ze.y,!1);q(rR,!(on&&Dt))}ae&&(de(),le(),I(),ee&&Y(),q(fp,!Pe.x,!0),q(fp,!Pe.y,!1),q(tR,me&&!M))},{},K]},$R=t=>{const e=Un(),{K:n,P:i}=e,{elements:o}=n(),{padding:r,viewport:s,content:a}=o,l=ds(t),c=l?{}:t,{elements:u}=c,{padding:d,viewport:h,content:m}=u||{},f=l?t:c.target,p=hg(f),_=f.ownerDocument,C=_.documentElement,w=()=>_.defaultView||Bt,S=Le(SR,[f]),b=Le(Ig,[f]),E=Le(Xi,""),x=Le(S,E,s),O=Le(b,E,a),$=G=>{const he=hi(G),me=ms(G),ke=jn(G,Qc),Ee=jn(G,Xc);return me.w-he.w>0&&!Yi(ke)||me.h-he.h>0&&!Yi(Ee)},K=x(h),F=K===f,P=F&&p,N=!F&&O(m),M=!F&&K===N,q=P?C:K,le=P?q:f,de=!F&&b(E,r,d),Y=!M&&N,I=[Y,q,de,le].map((G=>ds(G)&&!qo(G)&&G)),A=G=>G&&Qv(I,G),Q=!A(q)&&$(q)?q:f,U=P?C:q,ve={dt:f,vt:le,L:q,ln:de,ht:Y,gt:U,Qt:P?_:q,an:p?C:Q,Gt:_,bt:p,At:l,V:F,un:w,yt:G=>nu(q,Kn,G),wt:(G,he)=>fs(q,Kn,G,he),St:()=>fs(U,Kn,GP,!0)},{dt:re,vt:ge,ln:_e,L:R,ht:k}=ve,z=[()=>{kn(ge,[pi,Wa]),kn(re,Wa),p&&kn(C,[Wa,pi])}];let D=zl([k,R,_e,ge,re].find((G=>G&&!A(G))));const B=P?re:k||R,oe=Le(Zt,z);return[ve,()=>{const G=w(),he=Nl(),me=Ne=>{It(qo(Ne),zl(Ne)),lo(Ne)},ke=Ne=>st(Ne,"focusin focusout focus blur",_g,{I:!0,D:!1}),Ee="tabindex",ze=eu(R,Ee),Pe=ke(he);return Wn(ge,pi,F?"":qP),Wn(_e,Wl,""),Wn(R,Kn,""),Wn(k,dp,""),F||(Wn(R,Ee,ze||"-1"),p&&Wn(C,up,"")),It(B,D),It(ge,_e),It(_e||ge,!F&&R),It(R,k),ct(z,[Pe,()=>{const Ne=Nl(),ut=A(R),Qe=ut&&Ne===R?re:Ne,at=ke(Qe);kn(_e,Wl),kn(k,dp),kn(R,Kn),p&&kn(C,up),ze?Wn(R,Ee,ze):kn(R,Ee),A(k)&&me(k),ut&&me(R),A(_e)&&me(_e),Hl(Qe),at()}]),i&&!F&&(tu(R,Kn,Eg),ct(z,Le(kn,R,Kn))),Hl(!F&&p&&he===re&&G.top===G?R:he),Pe(),D=0,oe},oe]},kR=({ht:t})=>({Zt:e,fn:n,It:i})=>{const{$t:o}=e||{},{Ot:r}=n;t&&(o||i)&&co(t,{[lr]:r&&"100%"})},OR=({vt:t,ln:e,L:n,V:i},o)=>{const[r,s]=Xt({i:RP,o:sp()},Le(sp,t,"padding",""));return({Dt:a,Zt:l,fn:c,It:u})=>{let[d,h]=s(u);const{P:m}=Un(),{_t:f,xt:p,Ct:_}=l||{},{B:C}=c,[w,S]=a("paddingAbsolute");(f||h||(u||p))&&([d,h]=r(u));const E=!i&&(S||_||h);if(E){const x=!w||!e&&!m,O=d.r+d.l,$=d.t+d.b,K={[ng]:x&&!C?-O:0,[ig]:x?-$:0,[tg]:x&&C?-O:0,top:x?-d.t:0,right:x?C?-d.r:"auto":0,left:x?C?"auto":-d.l:0,[ar]:x&&`calc(100% + ${O}px)`},F={[Xv]:x?d.t:0,[Jv]:x?d.r:0,[eg]:x?d.b:0,[Zv]:x?d.l:0};co(e||n,K),co(n,F),Ze(o,{ln:d,_n:!x,F:e?F:Ze({},K,F)})}return{dn:E}}},AR=(t,e)=>{const n=Un(),{vt:i,ln:o,L:r,V:s,Qt:a,gt:l,bt:c,wt:u,un:d}=t,{P:h}=n,m=c&&s,f=Le(Yv,0),p={display:()=>!1,direction:re=>re!=="ltr",flexDirection:re=>re.endsWith("-reverse"),writingMode:re=>re!=="horizontal-tb"},_=Nt(p),C={i:Jc,o:{w:0,h:0}},w={i:Jr,o:{}},S=re=>{u(Cg,!m&&re)},b=()=>jn(r,_),E=(re,ge)=>{const _e=!Nt(re).length,R=ge?!0:_.some((Ee=>{const ze=re[Ee];return mo(ze)&&p[Ee](ze)}));if(_e||!R||!NP(r))return{T:{x:0,y:0},k:{x:1,y:1}};S(!0);const k=Jt(l),z=st(a,Pi,(Ee=>{const ze=Jt(l);Ee.isTrusted&&ze.x===k.x&&ze.y===k.y&&ru(Ee)}),{I:!0,A:!0}),D=u(QP,!0);cn(l,{x:0,y:0}),D();const B=Jt(l),oe=ms(l);cn(l,{x:oe.w,y:oe.h});const ee=Jt(l),G={x:ee.x-B.x,y:ee.y-B.y};cn(l,{x:-oe.w,y:-oe.h});const he=Jt(l),me={x:he.x-B.x,y:he.y-B.y},ke={x:li(G.x)>=li(me.x)?ee.x:he.x,y:li(G.y)>=li(me.y)?ee.y:he.y};return cn(l,k),Vo((()=>z())),{T:B,k:ke}},x=(re,ge)=>{const _e=Bt.devicePixelRatio%1!==0?1:0,R={w:f(re.w-ge.w),h:f(re.h-ge.h)};return{w:R.w>_e?R.w:0,h:R.h>_e?R.h:0}},O=(re,ge)=>{const _e=(R,k,z,D)=>{const B=R===Yn?yn:dR(R),oe=Yi(R),ee=Yi(z);return!k&&!D?yn:oe&&ee?Yn:oe?k&&D?B:k?Yn:yn:k?B:ee&&D?Yn:yn};return{x:_e(ge.x,re.x,ge.y,re.y),y:_e(ge.y,re.y,ge.x,re.x)}},$=re=>{const ge=R=>[Yn,yn,Pi].map((k=>ve(Yl(k),R))),_e=ge(!0).concat(ge()).join(" ");u(_e),u(Nt(re).map((R=>ve(re[R],R==="x"))).join(" "),!0)},[K,F]=Xt(C,Le(ou,r)),[P,N]=Xt(C,Le(ms,r)),[M,q]=Xt(C),[le]=Xt(w),[de,Y]=Xt(C),[I]=Xt(w),[A]=Xt({i:(re,ge)=>qs(re,ge,ps(ao(Nt(re),Nt(ge)))),o:{}}),[Q,U]=Xt({i:(re,ge)=>Jr(re.T,ge.T)&&Jr(re.k,ge.k),o:yg()}),ie=vo(cu),ve=(re,ge)=>`${ge?WP:KP}${PP(re)}`;return({Dt:re,Zt:ge,fn:_e,It:R},{dn:k})=>{const{_t:z,Ht:D,xt:B,Ct:oe,ft:ee,Et:G}=ge||{},he=ie&&ie.R(t,e,_e,n,re),{X:me,Y:ke,W:Ee}=he||{},[ze,Pe]=uR(re,n),[Ne,ut]=re("overflow"),Qe=Yi(Ne.x),at=Yi(Ne.y),tt=z||k||B||oe||G||Pe;let pt=F(R),dt=N(R),ft=q(R),Ft=Y(R);if(Pe&&h&&u(Eg,!ze),tt){nu(i,pi,es)&&S(!0);const Tu=ke&&ke(),[hr]=pt=K(R),[pr]=dt=P(R),fr=vg(r),mr=m&&zP(d()),d_={w:f(pr.w+hr.w),h:f(pr.h+hr.h)},$u={w:f((mr?mr.w:fr.w+f(fr.w-pr.w))+hr.w),h:f((mr?mr.h:fr.h+f(fr.h-pr.h))+hr.h)};Tu&&Tu(),Ft=de($u),ft=M(x(d_,$u),R)}const[fn,X]=Ft,[V,J]=ft,[ye,xe]=dt,[se,Me]=pt,[Z]=le({x:V.w>0,y:V.h>0}),ae=Qe&&at&&(Z.x||Z.y)||Qe&&Z.x&&!Z.y||at&&Z.y&&!Z.x,fe=k||oe||G||Me||xe||X||J||ut||Pe||tt||D&&m,[ce]=re("update.flowDirectionStyles"),[be,$n]=A(ce?ce(r)||{}:b(),R),Qt=oe||ee||$n||R,[on,Dt]=Qt?Q(E(be,!!ce),R):U();let bt=O(Z,Ne);S(!1),fe&&($(bt),bt=hR(r,Z),Ee&&me&&(me(bt,ye,se),co(r,Ee(bt))));const[dr,u_]=I(bt);return fs(i,pi,es,ae),fs(o,Wl,es,ae),Ze(e,{rn:dr,Vt:{x:fn.w,y:fn.h},Rt:{x:V.w,y:V.h},j:Z,Tt:UP(on,V)}),{en:u_,nn:X,sn:J,cn:Dt||J}}},PR=t=>{const[e,n,i]=$R(t),o={ln:{t:0,r:0,b:0,l:0},_n:!1,F:{[ng]:0,[ig]:0,[tg]:0,[Xv]:0,[Jv]:0,[eg]:0,[Zv]:0},Vt:{x:0,y:0},Rt:{x:0,y:0},rn:{x:yn,y:yn},j:{x:!1,y:!1},Tt:yg()},{dt:r,gt:s,V:a,St:l}=e,{P:c,M:u}=Un(),d=!c&&(u.x||u.y),h=[kR(e),OR(e,o),AR(e,o)];return[n,m=>{const f={},_=d&&Jt(s),C=_&&l();return ot(h,(w=>{Ze(f,w(m,f)||{})})),cn(s,_),C&&C(),a||cn(r,0),f},o,e,i]},RR=(t,e,n,i)=>{let o=!1;const r={Kt:!1,pn:!1},s=Ka(e,{}),[a,l,c,u,d]=PR(t),[h,m,f]=wR(u,c,s,(b=>{S({},b)})),[p,_,,C]=TR(t,e,r,f,c,u,i),w=b=>Nt(b).some((E=>!!b[E])),S=(b,E)=>{const{Kt:x,pn:O}=r;if(O||x&&o)return!1;const{vn:$,It:K,zt:F}=b,P=$||{},N=!!K||!o,M={Dt:Ka(e,P,N),vn:P,It:N},q=E||m(Ze({},M,{zt:F})),le=l(Ze({},M,{fn:f,Zt:q}));_(Ze({},M,{Zt:q,tn:le}));const de=w(q),Y=w(le),I=de||Y||!Zc(P)||N;return o=!0,I&&n(b,{Zt:q,tn:le}),I};return[()=>{const{an:b,gt:E,St:x}=u,O=Jt(b),$=[h(),a(),p(),()=>{r.pn=!0}],K=x();return cn(E,O),K(),Le(Zt,$)},S,b=>{const E=r.Kt;r.Kt=b,!b&&E!==b&&S({It:!0,zt:!0})},()=>{_({Dt:Ka(e,{},!1),vn:{},It:!1})},()=>({gn:r,hn:f,bn:c}),{yn:u,wn:C},d]},uu=new WeakMap,IR=(t,e)=>{uu.set(t,e)},MR=t=>{uu.delete(t)},Mg=t=>uu.get(t),hn=(t,e,n)=>{const{tt:i}=Un(),o=ds(t),r=o?t:t.target,s=Mg(r);if(e&&!s){const a=[],l={},c=N=>{const M=sg(N),q=vo(HP);return q?q(M,!0):M},u=Ze({},i(),c(e)),[d,h,m]=ql(),[f,p,_]=ql(n),C=(N,M)=>{_(N,M),m(N,M)},[w,S,b,E,x,O,$]=RR(t,u,(({vn:N,It:M},{Zt:q,tn:le})=>{const{_t:de,Ct:Y,$t:I,xt:A,Ht:Q,ft:U}=q,{nn:ie,sn:ve,en:re,cn:ge}=le;C("updated",[P,{updateHints:{sizeChanged:!!de,directionChanged:!!Y,heightIntrinsicChanged:!!I,overflowEdgeChanged:!!ie,overflowAmountChanged:!!ve,overflowStyleChanged:!!re,scrollCoordinatesChanged:!!ge,contentMutation:!!A,hostMutation:!!Q,appear:!!U},changedOptions:N||{},force:!!M}])}),(N=>C("scroll",[P,N]))),K=N=>{const{gn:M}=x(),{pn:q}=M;q||(MR(r),Zt(a),C("destroyed",[P,N]),h(),p())},P={options(N,M){if(N){const q=M?i():{},le=Og(u,Ze(q,c(N)));Zc(le)||(Ze(u,le),S({vn:le}))}return Ze({},u)},on:f,off:(N,M)=>{N&&M&&p(N,M)},state(){const{gn:N,hn:M,bn:q}=x(),{pn:le,Kt:de}=N,{B:Y}=M,{Vt:I,Rt:A,rn:Q,j:U,ln:ie,_n:ve,Tt:re}=q;return Ze({},{overflowEdge:I,overflowAmount:A,overflowStyle:Q,hasOverflow:U,scrollCoordinates:{start:re.T,end:re.k},padding:ie,paddingAbsolute:ve,directionRTL:Y,sleeping:de,destroyed:le})},elements(){const{dt:N,vt:M,ln:q,L:le,ht:de,gt:Y,Qt:I}=O.yn,{jt:A,Jt:Q}=O.wn,U=ve=>{const{kt:re,Pt:ge,Lt:_e}=ve;return{scrollbar:_e,track:ge,handle:re}},ie=ve=>{const{Xt:re,Yt:ge}=ve,_e=U(re[0]);return Ze({},_e,{clone:()=>{const R=U(ge());return E(),R}})};return Ze({},{target:N,host:M,padding:q||le,viewport:le,content:de||le,scrollOffsetElement:Y,scrollEventElement:I,scrollbarHorizontal:ie(A),scrollbarVertical:ie(Q)})},update:N=>S({It:N,zt:!0}),destroy:Le(K,!1),sleep:b,plugin:N=>l[Nt(N)[0]]};return ct(a,[$]),IR(r,P),Sg(bg,hn,[P,d,l]),CR(O.yn.bt,!o&&t.cancel)?(K(!0),P):(ct(a,w()),C("initialized",[P]),P.update(),P)}return s};hn.plugin=t=>{const e=dn(t),n=e?t:[t],i=n.map((o=>Sg(o,hn)[0]));return VP(n),e?i:i[0]};hn.valid=t=>{const e=t&&t.elements,n=xn(e)&&e();return Bo(n)&&!!Mg(n.target)};hn.env=()=>{const{U:t,M:e,P:n,J:i,ot:o,st:r,K:s,Z:a,tt:l,nt:c}=Un();return Ze({},{scrollbarsSize:t,scrollbarsOverlaid:e,scrollbarsHiding:n,scrollTimeline:i,staticDefaultInitialization:o,staticDefaultOptions:r,getDefaultInitialization:s,setDefaultInitialization:a,getDefaultOptions:l,setDefaultOptions:c})};hn.nonce=gR;hn.trustedTypePolicy=DP;class FR{constructor(){this._listeners=new Map,this.on=this.addEventListener,this.off=this.removeEventListener,this.emit=this.dispatchEvent}addEventListener(e,n){const i=this._listeners.get(e)??new Set;return this._listeners.set(e,i),i.add(n),this}removeEventListener(e,n){var i;return(i=this._listeners.get(e))==null||i.delete(n),this}dispatchEvent(e,...n){let i=!0;for(const o of this._listeners.get(e)??[])i=o(...n)!==!1&&i;return i}unbindAllListeners(){this._listeners.clear()}}const yp=(t,e="px")=>typeof t=="number"?t+e:t,ii=({style:t},e,n)=>{if(typeof e=="object")for(const[i,o]of Object.entries(e))o!==void 0&&(t[i]=yp(o));else n!==void 0&&(t[e]=yp(n))},bp=(t=0,e=0,n=0,i=0)=>{const o={x:t,y:e,width:n,height:i,top:e,left:t,right:t+n,bottom:e+i};return{...o,toJSON:()=>JSON.stringify(o)}},DR=t=>{let e,n=-1,i=!1;return{next:(...o)=>{e=o,i||(i=!0,n=requestAnimationFrame(()=>{t(...e),i=!1}))},cancel:()=>{cancelAnimationFrame(n),i=!1}}},wp=(t,e,n="touch")=>{switch(n){case"center":{const i=e.left+e.width/2,o=e.top+e.height/2;return i>=t.left&&i<=t.right&&o>=t.top&&o<=t.bottom}case"cover":return e.left>=t.left&&e.top>=t.top&&e.right<=t.right&&e.bottom<=t.bottom;case"touch":return t.right>=e.left&&t.left<=e.right&&t.bottom>=e.top&&t.top<=e.bottom}},LR=()=>matchMedia("(hover: none), (pointer: coarse)").matches,jR=()=>"safari"in window,Gl=t=>Array.isArray(t)?t:[t],Fg=t=>(e,n,i,o={})=>{(e instanceof HTMLCollection||e instanceof NodeList)&&(e=Array.from(e)),n=Gl(n),e=Gl(e);for(const r of e)if(r)for(const s of n)r[t](s,i,{capture:!1,...o})},oi=Fg("addEventListener"),vn=Fg("removeEventListener"),zr=t=>{var e;const{clientX:n,clientY:i,target:o}=((e=t.touches)==null?void 0:e[0])??t;return{x:n,y:i,target:o}},Ni=(t,e=document)=>Gl(t).map(n=>typeof n=="string"?Array.from(e.querySelectorAll(n)):n instanceof Element?n:null).flat().filter(Boolean),zR=(t,e)=>e.some(n=>typeof n=="number"?t.button===n:typeof n=="object"?n.button!==t.button?!1:n.modifiers.every(i=>{switch(i){case"alt":return t.altKey;case"ctrl":return t.ctrlKey||t.metaKey;case"shift":return t.shiftKey}}):!1),{abs:Ei,max:Sp,min:Cp,ceil:Ep}=Math,xp=(t=[])=>({stored:t,selected:[],touched:[],changed:{added:[],removed:[]}}),Dg=class extends FR{constructor(e){var n,i,o,r,s;super(),this._selection=xp(),this._targetBoundaryScrolled=!0,this._selectables=[],this._areaLocation={y1:0,x2:0,y2:0,x1:0},this._areaRect=bp(),this._singleClick=!0,this._scrollAvailable=!0,this._scrollingActive=!1,this._scrollSpeed={x:0,y:0},this._scrollDelta={x:0,y:0},this._lastMousePosition={x:0,y:0},this.enable=this._toggleStartEvents,this.disable=this._toggleStartEvents.bind(this,!1),this._options={selectionAreaClass:"selection-area",selectionContainerClass:void 0,selectables:[],document:window.document,startAreas:["html"],boundaries:["html"],container:"body",...e,behaviour:{overlap:"invert",intersect:"touch",triggers:[0],...e.behaviour,startThreshold:(n=e.behaviour)!=null&&n.startThreshold?typeof e.behaviour.startThreshold=="number"?e.behaviour.startThreshold:{x:10,y:10,...e.behaviour.startThreshold}:{x:10,y:10},scrolling:{speedDivider:10,manualSpeed:750,...(i=e.behaviour)==null?void 0:i.scrolling,startScrollMargins:{x:0,y:0,...(r=(o=e.behaviour)==null?void 0:o.scrolling)==null?void 0:r.startScrollMargins}}},features:{range:!0,touch:!0,deselectOnBlur:!1,...e.features,singleTap:{allow:!0,intersect:"native",...(s=e.features)==null?void 0:s.singleTap}}};for(const u of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))typeof this[u]=="function"&&(this[u]=this[u].bind(this));const{document:a,selectionAreaClass:l,selectionContainerClass:c}=this._options;this._area=a.createElement("div"),this._clippingElement=a.createElement("div"),this._clippingElement.appendChild(this._area),this._area.classList.add(l),c&&this._clippingElement.classList.add(c),ii(this._area,{willChange:"top, left, bottom, right, width, height",top:0,left:0,position:"fixed"}),ii(this._clippingElement,{overflow:"hidden",position:"fixed",transform:"translate3d(0, 0, 0)",pointerEvents:"none",zIndex:"1"}),this._frame=DR(u=>{this._recalculateSelectionAreaRect(),this._updateElementSelection(),this._emitEvent("move",u),this._redrawSelectionArea()}),this.enable()}_toggleStartEvents(e=!0){const{document:n,features:i}=this._options,o=e?oi:vn;o(n,"mousedown",this._onTapStart),i.touch&&o(n,"touchstart",this._onTapStart,{passive:!1})}_onTapStart(e,n=!1){const{x:i,y:o,target:r}=zr(e),{document:s,startAreas:a,boundaries:l,features:c,behaviour:u}=this._options,d=r.getBoundingClientRect();if(e instanceof MouseEvent&&!zR(e,u.triggers))return;const h=Ni(a,s),m=Ni(l,s);this._targetElement=m.find(C=>wp(C.getBoundingClientRect(),d));const f=e.composedPath(),p=h.find(C=>f.includes(C));if(this._targetBoundary=m.find(C=>f.includes(C)),!this._targetElement||!p||!this._targetBoundary||!n&&this._emitEvent("beforestart",e)===!1)return;this._areaLocation={x1:i,y1:o,x2:0,y2:0};const _=s.scrollingElement??s.body;this._scrollDelta={x:_.scrollLeft,y:_.scrollTop},this._singleClick=!0,this.clearSelection(!1,!0),oi(s,["touchmove","mousemove"],this._delayedTapMove,{passive:!1}),oi(s,["mouseup","touchcancel","touchend"],this._onTapStop),oi(s,"scroll",this._onScroll),c.deselectOnBlur&&(this._targetBoundaryScrolled=!1,oi(this._targetBoundary,"scroll",this._onStartAreaScroll))}_onSingleTap(e){const{singleTap:{intersect:n},range:i}=this._options.features,o=zr(e);let r;if(n==="native")r=o.target;else if(n==="touch"){this.resolveSelectables();const{x:a,y:l}=o;r=this._selectables.find(c=>{const{right:u,left:d,top:h,bottom:m}=c.getBoundingClientRect();return a<u&&a>d&&l<m&&l>h})}if(!r)return;for(this.resolveSelectables();!this._selectables.includes(r);)if(r.parentElement)r=r.parentElement;else{this._targetBoundaryScrolled||this.clearSelection();return}const{stored:s}=this._selection;if(this._emitEvent("start",e),e.shiftKey&&i&&this._latestElement){const a=this._latestElement,[l,c]=a.compareDocumentPosition(r)&4?[r,a]:[a,r],u=[...this._selectables.filter(d=>d.compareDocumentPosition(l)&4&&d.compareDocumentPosition(c)&2),l,c];this.select(u),this._latestElement=a}else s.includes(r)&&(s.length===1||e.ctrlKey||s.every(a=>this._selection.stored.includes(a)))?this.deselect(r):(this.select(r),this._latestElement=r)}_delayedTapMove(e){const{container:n,document:i,behaviour:{startThreshold:o}}=this._options,{x1:r,y1:s}=this._areaLocation,{x:a,y:l}=zr(e);if(typeof o=="number"&&Ei(a+l-(r+s))>=o||typeof o=="object"&&Ei(a-r)>=o.x||Ei(l-s)>=o.y){if(vn(i,["mousemove","touchmove"],this._delayedTapMove,{passive:!1}),this._emitEvent("beforedrag",e)===!1){vn(i,["mouseup","touchcancel","touchend"],this._onTapStop);return}oi(i,["mousemove","touchmove"],this._onTapMove,{passive:!1}),ii(this._area,"display","block"),Ni(n,i)[0].appendChild(this._clippingElement),this.resolveSelectables(),this._singleClick=!1,this._targetRect=this._targetElement.getBoundingClientRect(),this._scrollAvailable=this._targetElement.scrollHeight!==this._targetElement.clientHeight||this._targetElement.scrollWidth!==this._targetElement.clientWidth,this._scrollAvailable&&(oi(this._targetElement,"wheel",this._wheelScroll,{passive:!1}),oi(this._options.document,"keydown",this._keyboardScroll,{passive:!1}),this._selectables=this._selectables.filter(c=>this._targetElement.contains(c))),this._setupSelectionArea(),this._emitEvent("start",e),this._onTapMove(e)}this._handleMoveEvent(e)}_setupSelectionArea(){const{_clippingElement:e,_targetElement:n,_area:i}=this,o=this._targetRect=n.getBoundingClientRect();this._scrollAvailable?(ii(e,{top:o.top,left:o.left,width:o.width,height:o.height}),ii(i,{marginTop:-o.top,marginLeft:-o.left})):(ii(e,{top:0,left:0,width:"100%",height:"100%"}),ii(i,{marginTop:0,marginLeft:0}))}_onTapMove(e){const{_scrollSpeed:n,_areaLocation:i,_options:o,_frame:r}=this,{speedDivider:s}=o.behaviour.scrolling,a=this._targetElement,{x:l,y:c}=zr(e);if(i.x2=l,i.y2=c,this._lastMousePosition.x=l,this._lastMousePosition.y=c,this._scrollAvailable&&!this._scrollingActive&&(n.y||n.x)){this._scrollingActive=!0;const u=()=>{if(!n.x&&!n.y){this._scrollingActive=!1;return}const{scrollTop:d,scrollLeft:h}=a;n.y&&(a.scrollTop+=Ep(n.y/s),i.y1-=a.scrollTop-d),n.x&&(a.scrollLeft+=Ep(n.x/s),i.x1-=a.scrollLeft-h),r.next(e),requestAnimationFrame(u)};requestAnimationFrame(u)}else r.next(e);this._handleMoveEvent(e)}_handleMoveEvent(e){const{features:n}=this._options;(n.touch&&LR()||this._scrollAvailable&&jR())&&e.preventDefault()}_onScroll(){const{_scrollDelta:e,_options:{document:n}}=this,{scrollTop:i,scrollLeft:o}=n.scrollingElement??n.body;this._areaLocation.x1+=e.x-o,this._areaLocation.y1+=e.y-i,e.x=o,e.y=i,this._setupSelectionArea(),this._frame.next(null)}_onStartAreaScroll(){this._targetBoundaryScrolled=!0,vn(this._targetElement,"scroll",this._onStartAreaScroll)}_wheelScroll(e){const{manualSpeed:n}=this._options.behaviour.scrolling,i=e.deltaY?e.deltaY>0?1:-1:0,o=e.deltaX?e.deltaX>0?1:-1:0;this._scrollSpeed.y+=i*n,this._scrollSpeed.x+=o*n,this._onTapMove(e),e.preventDefault()}_keyboardScroll(e){const{manualSpeed:n}=this._options.behaviour.scrolling,i=e.key==="ArrowLeft"?-1:e.key==="ArrowRight"?1:0,o=e.key==="ArrowUp"?-1:e.key==="ArrowDown"?1:0;this._scrollSpeed.x+=Math.sign(i)*n,this._scrollSpeed.y+=Math.sign(o)*n,e.preventDefault(),this._onTapMove({clientX:this._lastMousePosition.x,clientY:this._lastMousePosition.y,preventDefault:()=>{}})}_recalculateSelectionAreaRect(){const{_scrollSpeed:e,_areaLocation:n,_targetElement:i,_options:o}=this,{scrollTop:r,scrollHeight:s,clientHeight:a,scrollLeft:l,scrollWidth:c,clientWidth:u}=i,d=this._targetRect,{x1:h,y1:m}=n;let{x2:f,y2:p}=n;const{behaviour:{scrolling:{startScrollMargins:_}}}=o;f<d.left+_.x?(e.x=l?-Ei(d.left-f+_.x):0,f=f<d.left?d.left:f):f>d.right-_.x?(e.x=c-l-u?Ei(d.left+d.width-f-_.x):0,f=f>d.right?d.right:f):e.x=0,p<d.top+_.y?(e.y=r?-Ei(d.top-p+_.y):0,p=p<d.top?d.top:p):p>d.bottom-_.y?(e.y=s-r-a?Ei(d.top+d.height-p-_.y):0,p=p>d.bottom?d.bottom:p):e.y=0;const C=Cp(h,f),w=Cp(m,p),S=Sp(h,f),b=Sp(m,p);this._areaRect=bp(C,w,S-C,b-w)}_redrawSelectionArea(){const{x:e,y:n,width:i,height:o}=this._areaRect,{style:r}=this._area;r.left=`${e}px`,r.top=`${n}px`,r.width=`${i}px`,r.height=`${o}px`}_onTapStop(e,n){var i;const{document:o,features:r}=this._options,{_singleClick:s}=this;vn(this._targetElement,"scroll",this._onStartAreaScroll),vn(o,["mousemove","touchmove"],this._delayedTapMove),vn(o,["touchmove","mousemove"],this._onTapMove),vn(o,["mouseup","touchcancel","touchend"],this._onTapStop),vn(o,"scroll",this._onScroll),this._keepSelection(),e&&s&&r.singleTap.allow?this._onSingleTap(e):!s&&!n&&(this._updateElementSelection(),this._emitEvent("stop",e)),this._scrollSpeed.x=0,this._scrollSpeed.y=0,vn(this._targetElement,"wheel",this._wheelScroll,{passive:!0}),vn(this._options.document,"keydown",this._keyboardScroll,{passive:!0}),this._clippingElement.remove(),(i=this._frame)==null||i.cancel(),ii(this._area,"display","none")}_updateElementSelection(){const{_selectables:e,_options:n,_selection:i,_areaRect:o}=this,{stored:r,selected:s,touched:a}=i,{intersect:l,overlap:c}=n.behaviour,u=c==="invert",d=[],h=[],m=[];for(let p=0;p<e.length;p++){const _=e[p];if(wp(o,_.getBoundingClientRect(),l)){if(s.includes(_))r.includes(_)&&!a.includes(_)&&a.push(_);else if(u&&r.includes(_)){m.push(_);continue}else h.push(_);d.push(_)}}u&&h.push(...r.filter(p=>!s.includes(p)));const f=c==="keep";for(let p=0;p<s.length;p++){const _=s[p];!d.includes(_)&&!(f&&r.includes(_))&&m.push(_)}i.selected=d,i.changed={added:h,removed:m},this._latestElement=void 0}_emitEvent(e,n){return this.emit(e,{event:n,store:this._selection,selection:this})}_keepSelection(){const{_options:e,_selection:n}=this,{selected:i,changed:o,touched:r,stored:s}=n,a=i.filter(l=>!s.includes(l));switch(e.behaviour.overlap){case"drop":{n.stored=[...a,...s.filter(l=>!r.includes(l))];break}case"invert":{n.stored=[...a,...s.filter(l=>!o.removed.includes(l))];break}case"keep":{n.stored=[...s,...i.filter(l=>!s.includes(l))];break}}}trigger(e,n=!0){this._onTapStart(e,n)}resolveSelectables(){this._selectables=Ni(this._options.selectables,this._options.document)}clearSelection(e=!0,n=!1){const{selected:i,stored:o,changed:r}=this._selection;r.added=[],r.removed.push(...i,...e?o:[]),n||(this._emitEvent("move",null),this._emitEvent("stop",null)),this._selection=xp(e?[]:o)}getSelection(){return this._selection.stored}getSelectionArea(){return this._area}getSelectables(){return this._selectables}setAreaLocation(e){Object.assign(this._areaLocation,e),this._redrawSelectionArea()}getAreaLocation(){return this._areaLocation}cancel(e=!1){this._onTapStop(null,!e)}destroy(){this.cancel(),this.disable(),this._clippingElement.remove(),super.unbindAllListeners()}select(e,n=!1){const{changed:i,selected:o,stored:r}=this._selection,s=Ni(e,this._options.document).filter(a=>!o.includes(a)&&!r.includes(a));return r.push(...s),o.push(...s),i.added.push(...s),i.removed=[],this._latestElement=void 0,n||(this._emitEvent("move",null),this._emitEvent("stop",null)),s}deselect(e,n=!1){const{selected:i,stored:o,changed:r}=this._selection,s=Ni(e,this._options.document).filter(a=>i.includes(a)||o.includes(a));this._selection.stored=o.filter(a=>!s.includes(a)),this._selection.selected=i.filter(a=>!s.includes(a)),this._selection.changed.added=[],this._selection.changed.removed.push(...s.filter(a=>!r.removed.includes(a))),this._latestElement=void 0,n||(this._emitEvent("move",null),this._emitEvent("stop",null))}};Dg.version="3.9.0";let NR=Dg;const UR="5.2.0",VR={version:UR},BR={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function HR(t,e){let n=e;return n||(n=new Error("Upload error")),typeof n=="string"&&(n=new Error(n)),n instanceof Error||(n=Object.assign(new Error("Upload error"),{data:n})),sO(t)?(n=new $l(n,t),n):(n.request=t,n)}function Tp(t){return t.data.slice(0,t.data.size,t.meta.type)}const qR={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:""};class WR extends uO{static VERSION=VR.version;#e;#t;uploaderEvents;constructor(e,n){if(super(e,{...qR,fieldName:n.bundle?"files[]":"file",...n}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=BR,this.i18nInit(),this.#t=new aO({concurrency:this.opts.limit}),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");if(this.opts.bundle&&typeof this.opts.headers=="function")throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if(n?.allowedMetaFields===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null),this.#e=i=>async(o,r)=>{try{const s=await Xk(o,{...r,onBeforeRequest:(c,u)=>this.opts.onBeforeRequest?.(c,u,i),shouldRetry:this.opts.shouldRetry,onAfterResponse:this.opts.onAfterResponse,onTimeout:c=>{const u=Math.ceil(c/1e3),d=new Error(this.i18n("uploadStalled",{seconds:u}));this.uppy.emit("upload-stalled",d,i)},onUploadProgress:c=>{if(c.lengthComputable)for(const{id:u}of i){const d=this.uppy.getFile(u);d!=null&&this.uppy.emit("upload-progress",d,{uploadStarted:d.progress.uploadStarted??0,bytesUploaded:c.loaded/c.total*d.size,bytesTotal:d.size})}}});let a=await this.opts.getResponseData?.(s);if(s.responseType==="json")a??=s.response;else try{a??=JSON.parse(s.responseText)}catch(c){throw new Error("@uppy/xhr-upload expects a JSON response (with a `url` property). To parse non-JSON responses, use `getResponseData` to turn your response into JSON.",{cause:c})}const l=typeof a?.url=="string"?a.url:void 0;for(const{id:c}of i)this.uppy.emit("upload-success",this.uppy.getFile(c),{status:s.status,body:a,uploadURL:l});return s}catch(s){if(s.name==="AbortError")return;const a=s.request;for(const l of i)this.uppy.emit("upload-error",this.uppy.getFile(l.id),HR(a,s),a);throw s}}}getOptions(e){const n=this.uppy.getState().xhrUpload,{headers:i}=this.opts,o={...this.opts,...n||{},...e.xhrUpload||{},headers:{}};return typeof i=="function"?o.headers=i(e):Object.assign(o.headers,this.opts.headers),n&&Object.assign(o.headers,n.headers),e.xhrUpload&&Object.assign(o.headers,e.xhrUpload.headers),o}addMetadata(e,n,i){yh(i.allowedMetaFields,n).forEach(r=>{const s=n[r];Array.isArray(s)?s.forEach(a=>e.append(r,a)):e.append(r,s)})}createFormDataUpload(e,n){const i=new FormData;this.addMetadata(i,e.meta,n);const o=Tp(e);return e.name?i.append(n.fieldName,o,e.meta.name):i.append(n.fieldName,o),i}createBundledUpload(e,n){const i=new FormData,{meta:o}=this.uppy.getState();return this.addMetadata(i,o,n),e.forEach(r=>{const s=this.getOptions(r),a=Tp(r);r.name?i.append(s.fieldName,a,r.name):i.append(s.fieldName,a)}),i}async#n(e){const n=new dO(this.uppy),i=new AbortController;n.onFileRemove(e.id,()=>i.abort()),n.onCancelAll(e.id,()=>i.abort());try{await this.#t.add(async o=>{const r=this.getOptions(e),s=this.#e([e]),a=r.formData?this.createFormDataUpload(e,r):e.data,l=typeof r.endpoint=="string"?r.endpoint:await r.endpoint(e);return s(l,{...r,body:a,signal:AbortSignal.any([o,i.signal])})})}catch(o){if(o.name==="AbortError")return;throw o}finally{n.remove()}}async#i(e){const n=new AbortController;function i(){n.abort()}this.uppy.once("cancel-all",i);try{await this.#t.add(async o=>{const r=this.uppy.getState().xhrUpload??{},s=this.#e(e),a=this.createBundledUpload(e,{...this.opts,...r}),l=typeof this.opts.endpoint=="string"?this.opts.endpoint:await this.opts.endpoint(e);return s(l,{...this.opts,body:a,signal:AbortSignal.any([o,n.signal])})})}catch(o){if(o.name==="AbortError")return;throw o}finally{this.uppy.off("cancel-all",i)}}#r(e){const n=this.getOptions(e),i=yh(n.allowedMetaFields,e.meta);return{...e.remote?.body,protocol:"multipart",endpoint:n.endpoint,size:e.data.size,fieldname:n.fieldName,metadata:Object.fromEntries(i.map(o=>[o,e.meta[o]])),httpMethod:n.method,useFormData:n.formData,headers:n.headers}}async#o(e){await Promise.allSettled(e.map(n=>{if(n.isRemote){const i=()=>this.#t,o=new AbortController,r=s=>{s.id===n.id&&o.abort()};return this.uppy.on("file-removed",r),this.uppy.getRequestClientForFile(n).uploadRemoteFile(n,this.#r(n),{signal:o.signal,getQueue:i}).finally(()=>{this.uppy.off("file-removed",r)})}return this.#n(n)}))}#a=async e=>{if(e.length===0){this.uppy.log("[XHRUpload] No files to upload!");return}this.opts.limit===0&&this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const n=this.uppy.getFilesByIds(e),i=eO(n),o=tO(i);if(this.uppy.emit("upload-start",o),this.opts.bundle){if(i.some(s=>s.isRemote))throw new Error("Can’t upload remote files when the `bundle: true` option is set");if(typeof this.opts.headers=="function")throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await this.#i(i)}else await this.#o(i)};install(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(this.#a)}uninstall(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(this.#a)}}const du=new Map,Ql=Symbol("ServiceContainerId");function KR(t,e){du.set(t,e)}function YR(t){du.delete(t)}function je(t){const e=t??Ao(Ql);if(!e)throw new Error("No VueFinder app instance found. Make sure VueFinder component is mounted and provide the id explicitly or use within a VueFinder component tree.");const n=du.get(e);if(!n)throw new Error(`VueFinder app instance with id "${e}" was not found. Make sure the VueFinder component with id="${e}" is mounted.`);return n}function GR(t){const e=localStorage.getItem(t+"_storage"),n=Mt(JSON.parse(e??"{}"));$e(n,i);function i(){Object.keys(n).length?localStorage.setItem(t+"_storage",JSON.stringify(n)):localStorage.removeItem(t+"_storage")}function o(a,l){n[a]=l}function r(a){delete n[a]}function s(){Object.keys(n).forEach(a=>r(a))}return{getStore:(a,l=null)=>a in n?n[a]:l,setStore:o,removeStore:r,clearStore:s}}function Yt(t,e="An error occurred"){if(!t)return e;if(typeof t=="string")return t||e;if(t instanceof Error)return t.message||e;if(typeof t=="object"&&t!==null){const n=t;if(typeof n.message=="string"&&n.message)return n.message;if(typeof n.error=="string"&&n.error)return n.error}return e}function QR(t,e){return Um(t,e,{encode:JSON.stringify,decode:JSON.parse})}function XR(t){if(!t?.config?.get)return!0;try{return!!t.config.get("notificationsEnabled")}catch{return!0}}function Bi(t,e,n){const i={type:e,message:n};if(t?.emitter?.emit?.("vf-notify",i),!!XR(t))switch(e){case"success":Tr.success(n);break;case"error":Tr.error(n);break;case"warning":Tr.warning(n);break;default:Tr.info(n);break}}function Gt(t){return{success(e){Bi(t,"success",e)},error(e){Bi(t,"error",e)},info(e){Bi(t,"info",e)},warning(e){Bi(t,"warning",e)},emit(e,n){Bi(t,e,n)}}}const Ga=new Map;async function Qa(t,e){const n=e[t];return typeof n=="function"?(await n()).default:n}function JR(t,e,n,i,o){const r=Gt({emitter:n,config:o}),s="vuefinder_locale",a="global";let l;if(Ga.has(a))l=Ga.get(a),e&&e!==l.get()&&l.set(e);else{const b=localStorage.getItem(s)?JSON.parse(localStorage.getItem(s)):null;l=QR(s,e||b||"en"),Ga.set(a,l)}const c="vuefinder_translations",u=b=>{try{const E=localStorage.getItem(c);if(E)return JSON.parse(E)[b]||null}catch{}return null},d=(b,E)=>{try{const x=localStorage.getItem(c),O=x?JSON.parse(x):{};O[b]=E,localStorage.setItem(c,JSON.stringify(O))}catch{}},h=Oe(l),m=String(h.value),f=u(m),p=H(f||{});let _=!1;!f&&Object.keys(i).length>0&&Qa(m,i).then(b=>{p.value=b,d(m,b)}).catch(()=>{}),$e(h,async(b,E)=>{if(E&&b===E)return;if(!_){_=!0;const O=u(String(b));if(O)p.value=O;else if(Object.keys(i).length>0)try{const $=await Qa(String(b),i);p.value=$,d(String(b),$)}catch{}return}const x=u(String(b));if(x)p.value=x;else try{const O=await Qa(String(b),i);p.value=O,d(String(b),O)}catch(O){const $=Yt(O,"Locale cannot be loaded!");r.error($);return}Object.values(i).length>1&&(r.success("The language is set to "+b),n.emit("vf-language-saved"))},{immediate:!1});const C=(b,...E)=>E.length?C(b=b.replace("%s",String(E.shift())),...E):b;function w(b,...E){return p.value&&Object.prototype.hasOwnProperty.call(p.value,b)?C(p.value[b]||b,...E):C(b,...E)}const S=te({get:()=>h.value,set:b=>{l.set(b)}});return Mt({t:w,locale:S,localeAtom:l})}const ZR=["edit","newfile","newfolder","preview","archive","unarchive","search","rename","upload","delete","fullscreen","download","language","move","copy","history","theme","pinned"],Lg={simple:{search:!0,preview:!0,rename:!0,upload:!0,delete:!0,newfile:!0,newfolder:!0,download:!0},advanced:ZR.reduce((t,e)=>(t[e]=!0,t),{})};function $p(){return Lg.advanced}function jg(t){return t?t==="simple"||t==="advanced"?{...Lg[t]}:{...$p(),...t}:$p()}const eI="4.1.2";function hu(t,e,n,i,o){return e=Math,n=e.log,i=1024,o=n(t)/n(i)|0,(t/e.pow(i,o)).toFixed(0)+" "+(o?"KMGTPEZY"[--o]+"iB":"B")}function zg(t,e,n,i,o){return e=Math,n=e.log,i=1e3,o=n(t)/n(i)|0,(t/e.pow(i,o)).toFixed(0)+" "+(o?"KMGTPEZY"[--o]+"B":"B")}function tI(t){if(typeof t=="number")return t;const e={k:1,m:2,g:3,t:4},n=/(\d+(?:\.\d+)?)\s?(k|m|g|t)?b?/i.exec(t);if(!n)return 0;const i=parseFloat(n[1]||"0"),o=(n[2]||"").toLowerCase(),r=e[o]??0;return Math.round(i*Math.pow(1024,r))}function nI(t){const e=Go(null),n=H(!1),i=H(),o=H(!1);return{visible:n,type:e,data:i,open:(r,s=null)=>{t.get("fullScreen")||(document.querySelector("body").style.overflow="hidden"),n.value=!0,e.value=r,i.value=s},close:()=>{t.get("fullScreen")||(document.querySelector("body").style.overflow=""),n.value=!1,e.value=null},setEditMode:r=>{o.value=r},editMode:o}}const vs={view:"grid",theme:"silver",fullScreen:!1,showTreeView:!1,showHiddenFiles:!0,metricUnits:!1,showThumbnails:!0,persist:!1,path:"",pinnedFolders:[],notificationsEnabled:!0,expandTreeByDefault:!1,expandedTreePaths:[]},gs={initialPath:null,maxFileSize:null,loadingIndicator:"circular",showMenuBar:!0,showToolbar:!0,gridItemWidth:96,gridItemHeight:80,gridItemGap:8,gridIconSize:48,listItemHeight:32,listItemGap:2,listIconSize:16,notificationPosition:"bottom-center",notificationDuration:3e3,notificationVisibleToasts:4,notificationRichColors:!0},iI=new Set(Object.keys(gs));function oI(t){return t||"silver"}function Ng(t){return iI.has(t)}function kp(t){const e={},n={},i=t;for(const o in i)if(Ng(o))n[o]=i[o];else if(o in vs){const r=o;e[r]=i[o]}return{persistenceConfig:e,nonPersistenceConfig:n}}function Op(t,e){const n={...vs,...e,...t};return n.theme=oI(n.theme),n}function Ap(t,e){return{...gs,...e,...t}}const rI=(t,e={})=>{const n=`vuefinder_config_${t}`,{persistenceConfig:i,nonPersistenceConfig:o}=kp(e),r=Op(i,vs),s=Ap(o,gs),a=Um(n,r,{encode:JSON.stringify,decode:JSON.parse}),l=Tt(s),c=ri([a,l],(f,p)=>({...f,...p})),u=(f={})=>{const p=a.get(),_=l.get(),{persistenceConfig:C,nonPersistenceConfig:w}=kp(f),S=Op(C,p),b=Ap(w,_);a.set(S),l.set(b)},d=f=>Ng(f)?l.get()[f]:a.get()[f],h=()=>({...a.get(),...l.get()}),m=(f,p)=>{const _=a.get();typeof f=="object"&&f!==null?a.set({..._,...f}):a.set({..._,[f]:p})};return{state:c,init:u,get:d,set:m,toggle:f=>{const p=a.get();m(f,!p[f])},all:h,reset:()=>{a.set({...vs}),l.set({...gs})}}};function sI(t,e){if(typeof t=="string"&&typeof e=="string")return t.toLowerCase().localeCompare(e.toLowerCase());const n=Number(t)||0,i=Number(e)||0;return n===i?0:n<i?-1:1}const aI=()=>{const t=Tt(""),e=Tt([]),n=Tt(!1),i=Tt([]),o=Tt({active:!1,column:"",order:""}),r=Tt({kind:"all",showHidden:!1}),s=Tt(new Set),a=Tt({type:"copy",path:"",items:new Set}),l=Tt(null),c=Tt(0),u=Tt(!1),d=Tt([]),h=Tt(-1),m=ri([t],ee=>{const G=(ee??"").trim(),he=G.indexOf("://"),me=he>=0?G.slice(0,he):"",ke=(he>=0?G.slice(he+3):G).split("/").filter(Boolean);let Ee="";const ze=ke.map(Pe=>(Ee=Ee?`${Ee}/${Pe}`:Pe,{basename:Pe,name:Pe,path:me?`${me}://${Ee}`:Ee,type:"dir"}));return{storage:me,breadcrumb:ze,path:G}}),f=ri([i,o,r],(ee,G,he)=>{let me=ee;he.kind==="files"?me=me.filter(Ne=>Ne.type==="file"):he.kind==="folders"&&(me=me.filter(Ne=>Ne.type==="dir")),he.showHidden||(me=me.filter(Ne=>!Ne.basename.startsWith(".")));const{active:ke,column:Ee,order:ze}=G;if(!ke||!Ee)return me;const Pe=ze==="asc"?1:-1;return me.slice().sort((Ne,ut)=>sI(Ne[Ee],ut[Ee])*Pe)}),p=ri([i,s],(ee,G)=>G.size===0?[]:ee.filter(he=>G.has(he.path))),_=(ee,G)=>{const he=t.get();if((G??!0)&&he!==ee){const me=d.get(),ke=h.get();ke<me.length-1&&me.splice(ke+1),me.length===0&&he&&me.push(he),me.push(ee),d.set([...me]),h.set(me.length-1)}t.set(ee)},C=ee=>{i.set(ee??[])},w=ee=>{e.set(ee??[])},S=(ee,G)=>{o.set({active:!0,column:ee,order:G})},b=ee=>{const G=o.get();G.active&&G.column===ee?o.set({active:G.order==="asc",column:ee,order:"desc"}):o.set({active:!0,column:ee,order:"asc"})},E=()=>{o.set({active:!1,column:"",order:""})},x=(ee,G)=>{r.set({kind:ee,showHidden:G})},O=()=>{r.set({kind:"all",showHidden:!1})},$=(ee,G="multiple")=>{const he=new Set(s.get());G==="single"&&he.clear(),he.add(ee),s.set(he)},K=(ee,G="multiple")=>{const he=new Set(s.get());G==="single"&&he.clear(),ee.forEach(me=>he.add(me)),s.set(he)},F=ee=>{const G=new Set(s.get());G.delete(ee),s.set(G)},P=ee=>s.get().has(ee),N=(ee,G="multiple")=>{const he=new Set(s.get());he.has(ee)?he.delete(ee):(G==="single"&&he.clear(),he.add(ee)),s.set(he)},M=(ee="multiple",G)=>{if(ee==="single"){const he=i.get()[0];if(he){const me=he.path;s.set(new Set([me])),c.set(1)}}else{if(G?.selectionFilterType||G?.selectionFilterMimeIncludes&&G.selectionFilterMimeIncludes.length>0){const he=i.get().filter(me=>{const ke=G.selectionFilterType,Ee=G.selectionFilterMimeIncludes;return ke==="files"&&me.type==="dir"||ke==="dirs"&&me.type==="file"?!1:Ee&&Array.isArray(Ee)&&Ee.length>0&&me.type!=="dir"?me.mime_type?Ee.some(ze=>me.mime_type?.startsWith(ze)):!1:!0}).map(me=>me.path);s.set(new Set(he))}else{const he=new Set(i.get().map(me=>me.path));s.set(he)}de(s.get().size)}},q=()=>{s.set(new Set),c.set(0)},le=ee=>{const G=new Set(ee??[]);s.set(G),c.set(G.size)},de=ee=>{c.set(ee)},Y=ee=>{u.set(!!ee)},I=()=>u.get(),A=(ee,G)=>{const he=i.get().filter(me=>G.has(me.path));a.set({type:ee,path:m.get().path,items:new Set(he)})},Q=ee=>ri([a],G=>G.type==="cut"&&Array.from(G.items).some(he=>he.path===ee)),U=ee=>ri([a],G=>G.type==="copy"&&Array.from(G.items).some(he=>he.path===ee));return{files:i,storages:e,currentPath:t,sort:o,filter:r,selectedKeys:s,selectedCount:c,loading:u,draggedItem:l,clipboardItems:a,path:m,sortedFiles:f,selectedItems:p,setPath:_,setFiles:C,setStorages:w,setSort:S,toggleSort:b,clearSort:E,setFilter:x,clearFilter:O,select:$,selectMultiple:K,deselect:F,toggleSelect:N,selectAll:M,isSelected:P,clearSelection:q,setSelection:le,setSelectedCount:de,setLoading:Y,isLoading:I,setClipboard:A,createIsCut:Q,createIsCopied:U,isCut:ee=>{const G=Q(ee);return Oe(G).value??!1},isCopied:ee=>{const G=U(ee);return Oe(G).value??!1},clearClipboard:()=>{a.set({type:"copy",path:"",items:new Set})},getClipboard:()=>a.get(),setDraggedItem:ee=>{l.set(ee)},getDraggedItem:()=>l.get(),clearDraggedItem:()=>{l.set(null)},setReadOnly:ee=>{n.set(ee)},getReadOnly:()=>n.get(),isReadOnly:ee=>n.get()?!0:ee.read_only??!1,goBack:()=>{const ee=d.get(),G=h.get();if(G>0){const he=G-1,me=ee[he];me&&(h.set(he),_(me,!1))}},goForward:()=>{const ee=d.get(),G=h.get();if(G<ee.length-1){const he=G+1,me=ee[he];me&&(h.set(he),_(me,!1))}},canGoBack:ri([h],ee=>ee>0),canGoForward:ri([d,h],(ee,G)=>G<ee.length-1),navigationHistory:d,historyIndex:h}};class lI{validateParam(e,n){if(e==null)throw new Error(`${n} is required`)}validatePath(e){if(!e)throw new Error("Path must be a non-empty string")}parsePath(e){if(!e)return{};if(e.includes("://")){const[n,...i]=e.split("://");return{storage:n,path:i.join("://")}}return{path:e}}combinePath(e,n){return e&&n?`${e}://${n}`:n||""}}function Pp(t,e,n){const i=`HTTP ${e}: ${n}`;if(!t)return i;try{const o=JSON.parse(t);if(o.message)return o.message;if(o.error){if(typeof o.error=="string")return o.error;if(o.error.message)return o.error.message}if(o.errors&&Array.isArray(o.errors)&&o.errors.length>0){const r=o.errors.map(s=>s.message).filter(s=>!!s);if(r.length>0)return r.join(", ")}return o.detail?o.detail:o.title?o.title:t}catch{return t||i}}class Ug extends lI{config;static DEFAULT_URLS={list:"",upload:"/upload",delete:"/delete",rename:"/rename",copy:"/copy",move:"/move",archive:"/archive",unarchive:"/unarchive",createFile:"/create-file",createFolder:"/create-folder",preview:"/preview",download:"/download",search:"/search",save:"/save"};constructor(e){super();const n={...Ug.DEFAULT_URLS,...e.url||{}};this.config={...e,baseURL:e.baseURL||"",url:n}}setBaseURL(e){this.config.baseURL=e||""}setToken(e){this.config.token=e}configureUploader(e,n){const i=this.getHeaders();delete i["Content-Type"],e.use(WR,{endpoint:`${this.config.baseURL}${this.config.url.upload}`,fieldName:"file",bundle:!1,headers:i,formData:!0}),e.on("upload",()=>{const o=n.getTargetPath();e.getFiles().forEach(r=>{e.setFileMeta(r.id,{path:o})})})}getHeaders(){const e={"Content-Type":"application/json",...this.config.headers};return this.config.token&&(e.Authorization=`Bearer ${this.config.token}`),e}async request(e,n={}){const i=`${this.config.baseURL}${e}`,o=await fetch(i,{...n,headers:{...this.getHeaders(),...n.headers}});if(!o.ok){const r=await o.text(),s=Pp(r,o.status,o.statusText);throw new Error(s)}return(o.headers.get("content-type")||"").includes("application/json")?await o.json():await o.text()}async list(e){const n=new URLSearchParams;e?.path&&n.append("path",e.path);const i=n.toString()?`${this.config.url.list}?${n.toString()}`:this.config.url.list;return await this.request(i,{method:"GET"})}async delete(e){return this.validateParam(e.items,"items"),this.validateParam(e.path,"path"),await this.request(this.config.url.delete,{method:"POST",body:JSON.stringify({path:e.path,items:e.items})})}async rename(e){return this.validateParam(e.path,"path"),this.validateParam(e.item,"item"),this.validateParam(e.name,"name"),this.validatePath(e.path),await this.request(this.config.url.rename,{method:"POST",body:JSON.stringify({path:e.path,item:e.item,name:e.name})})}async copy(e){return this.validateParam(e.sources,"sources"),this.validateParam(e.destination,"destination"),e.path&&this.validatePath(e.path),await this.request(this.config.url.copy,{method:"POST",body:JSON.stringify({sources:e.sources,destination:e.destination,path:e.path})})}async move(e){return this.validateParam(e.sources,"sources"),this.validateParam(e.destination,"destination"),e.path&&this.validatePath(e.path),await this.request(this.config.url.move,{method:"POST",body:JSON.stringify({sources:e.sources,destination:e.destination,path:e.path})})}async archive(e){return this.validateParam(e.items,"items"),this.validateParam(e.name,"name"),this.validateParam(e.path,"path"),await this.request(this.config.url.archive,{method:"POST",body:JSON.stringify({items:e.items,path:e.path,name:e.name})})}async unarchive(e){return this.validateParam(e.item,"item"),this.validateParam(e.path,"path"),await this.request(this.config.url.unarchive,{method:"POST",body:JSON.stringify({item:e.item,path:e.path})})}async createFile(e){return this.validateParam(e.name,"name"),this.validateParam(e.path,"path"),await this.request(this.config.url.createFile,{method:"POST",body:JSON.stringify({path:e.path,name:e.name})})}async createFolder(e){return this.validateParam(e.name,"name"),this.validateParam(e.path,"path"),await this.request(this.config.url.createFolder,{method:"POST",body:JSON.stringify({path:e.path,name:e.name})})}getPreviewUrl(e){this.validatePath(e.path);const n=new URLSearchParams({path:e.path});return`${this.config.baseURL}${this.config.url.preview}?${n.toString()}`}async getContent(e){this.validatePath(e.path);const n=new URLSearchParams({path:e.path}),i=`${this.config.baseURL}${this.config.url.preview}?${n.toString()}`,o=await fetch(i,{headers:this.getHeaders()});if(!o.ok){const r=await o.text(),s=Pp(r,o.status,o.statusText);throw new Error(s)}return{content:await o.text(),mimeType:o.headers.get("Content-Type")||void 0}}getDownloadUrl(e){this.validatePath(e.path);const n=new URLSearchParams({path:e.path});return`${this.config.baseURL}${this.config.url.download}?${n.toString()}`}async search(e){const n=this.config.url.search,i=new URLSearchParams;e.path&&i.set("path",e.path),e.filter&&i.set("filter",e.filter),e.deep&&i.set("deep","1"),e.size&&e.size!=="all"&&i.set("size",e.size);const o=i.toString()?`${n}?${i.toString()}`:n;return(await this.request(o,{method:"GET"})).files||[]}async save(e){return this.validateParam(e.path,"path"),await this.request(this.config.url.save,{method:"POST",body:JSON.stringify({path:e.path,content:e.content}),headers:this.getHeaders()})}}const Rp={list:t=>["adapter","list",t],search:(t,e,n,i)=>["adapter","search",t,e,n,i],delete:t=>["adapter","delete",t],rename:()=>["adapter","rename"],copy:()=>["adapter","copy"],move:()=>["adapter","move"],archive:()=>["adapter","archive"],unarchive:()=>["adapter","unarchive"],createFile:()=>["adapter","createFile"],createFolder:()=>["adapter","createFolder"]};class cI{driver;queryClient;config;onBeforeOpen;onAfterOpen;constructor(e,n={}){this.driver=e,this.onBeforeOpen=n.onBeforeOpen,this.onAfterOpen=n.onAfterOpen,this.queryClient=n.queryClient||new Gk({defaultOptions:{queries:{refetchOnWindowFocus:n.refetchOnWindowFocus??!1,staleTime:n.staleTime??300*1e3,retry:n.retry??2},mutations:{retry:n.retry??1}}}),this.config={queryClient:this.queryClient,refetchOnWindowFocus:n.refetchOnWindowFocus??!1,staleTime:n.staleTime??300*1e3,cacheTime:n.cacheTime??600*1e3,retry:n.retry??2,onBeforeOpen:this.onBeforeOpen??(()=>{}),onAfterOpen:this.onAfterOpen??(()=>{})}}getDriver(){return this.driver}getQueryClient(){return this.queryClient}async list(e){const n=Rp.list(e);return await this.queryClient.fetchQuery({queryKey:n,queryFn:()=>this.driver.list({path:e}),staleTime:this.config.staleTime})}async open(e){this.onBeforeOpen&&this.onBeforeOpen();const n=await this.list(e);return this.onAfterOpen&&this.onAfterOpen(n),n}async delete(e){const n=await this.driver.delete(e);return this.invalidateListQueries(),n}async rename(e){const n=await this.driver.rename(e);return this.invalidateListQueries(),n}async copy(e){const n=await this.driver.copy(e);return this.invalidateListQueries(),n}async move(e){const n=await this.driver.move(e);return this.invalidateListQueries(),n}async archive(e){const n=await this.driver.archive(e);return this.invalidateListQueries(),n}async unarchive(e){const n=await this.driver.unarchive(e);return this.invalidateListQueries(),n}async createFile(e){const n=await this.driver.createFile(e);return this.invalidateListQueries(),n}async createFolder(e){const n=await this.driver.createFolder(e);return this.invalidateListQueries(),n}async getContent(e){const n=["adapter","content",e.path];return await this.queryClient.fetchQuery({queryKey:n,queryFn:()=>this.driver.getContent(e),staleTime:this.config.staleTime})}getPreviewUrl(e){return this.driver.getPreviewUrl(e)}getDownloadUrl(e){return this.driver.getDownloadUrl(e)}async search(e){const n=Rp.search(e.path,e.filter,e.deep,e.size);return await this.queryClient.fetchQuery({queryKey:n,queryFn:()=>this.driver.search(e),staleTime:this.config.staleTime})}async save(e){const n=await this.driver.save(e);return this.invalidateListQueries(),n}invalidateListQueries(){this.queryClient.invalidateQueries({queryKey:["adapter"],exact:!1})}invalidateListQuery(e){this.queryClient.invalidateQueries({queryKey:["adapter","list",e],exact:!0})}clearCache(){this.queryClient.clear()}}function uI(t){const e=Oe(t.state);return{current:te(()=>e.value.theme||"silver"),set:n=>{t.set("theme",n)}}}const dI=(t,e)=>{const n=GR(t.id??"vf"),i=g$(),o=e.i18n,r=t.locale??e.locale,s=rI(t.id??"vf",t.config??{}),a=aI();if(!t.driver)throw new Error("Driver is required for VueFinder");const l=new cI(t.driver);return Mt({version:eI,config:s,theme:(()=>{const c=uI(s);return{current:c.current,set:c.set}})(),fs:a,root:null,debug:t.debug??!1,emitter:i,storage:n,i18n:JR(n,r,i,o,s),modal:nI(s),adapter:Gn(l),features:jg(t.features),selectionMode:t.selectionMode||"multiple",selectionFilterType:te(()=>t.selectionFilterType||"both"),selectionFilterMimeIncludes:te(()=>t.selectionFilterMimeIncludes||[]),treeViewData:[],filesize:s.get("metricUnits")?zg:hu,contextMenuItems:t.contextMenuItems,customUploader:t.customUploader})},hI=["data-theme"],pI={class:"vuefinder__modal-layout__container"},fI={class:"vuefinder__modal-layout__content"},mI={key:0,class:"vuefinder__modal-layout__footer"},vI={key:0,class:"vuefinder__modal-drag-overlay"},gI={class:"vuefinder__modal-drag-message"},nn=Ce({__name:"ModalLayout",props:{showDragOverlay:{type:Boolean},dragOverlayText:{}},setup(t){const e=H(null),n=je();n.config;const i=t;et(()=>{const r=document.querySelector(".v-f-modal input");r&&r.focus(),Ge(()=>{if(document.querySelector(".v-f-modal input")&&window.innerWidth<768&&e.value){const s=e.value.getBoundingClientRect().bottom+16;window.scrollTo({top:s,left:0,behavior:"smooth"})}})});const o=r=>{r.target.classList.contains("vuefinder__modal-layout__wrapper")&&(r.preventDefault(),r.stopPropagation())};return(r,s)=>(y(),T("div",{"data-theme":v(n).theme.current,class:"vuefinder__themer vuefinder__modal-layout","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",tabindex:"0",onKeyup:s[1]||(s[1]=ho(a=>v(n).modal.close(),["esc"]))},[s[2]||(s[2]=g("div",{class:"vuefinder__modal-layout__overlay"},null,-1)),g("div",pI,[g("div",{class:"vuefinder__modal-layout__wrapper",onContextmenu:o,onMousedown:s[0]||(s[0]=Ye(a=>v(n).modal.close(),["self"]))},[g("div",{ref_key:"modalBody",ref:e,class:"vuefinder__modal-layout__body"},[g("div",fI,[Ve(r.$slots,"default")]),r.$slots.buttons?(y(),T("div",mI,[Ve(r.$slots,"buttons")])):ue("",!0)],512)],32)]),i.showDragOverlay?(y(),T("div",vI,[g("div",gI,L(i.dragOverlayText||"Drag and drop the files/folders to here."),1)])):ue("",!0)],40,hI))}}),_I={class:"vuefinder__modal-header"},yI={class:"vuefinder__modal-header__icon-container"},bI={id:"modal-title",class:"vuefinder__modal-header__title"},pn=Ce({__name:"ModalHeader",props:{title:{},icon:{}},setup(t){return(e,n)=>(y(),T("div",_I,[g("div",yI,[(y(),ne($t(t.icon),{class:"vuefinder__modal-header__icon"}))]),g("div",bI,L(t.title),1)]))}}),wI={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.8",viewBox:"0 0 24 24"};function SI(t,e){return y(),T("svg",wI,[...e[0]||(e[0]=[g("circle",{cx:"12",cy:"12",r:"9"},null,-1),g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 8.2h.01M10.75 11.25H12v4.5m0 0h1.25m-1.25 0h-2"},null,-1)])])}const Vg={render:SI},CI={class:"vuefinder__about-modal__content"},EI={class:"vuefinder__about-modal__main"},xI={class:"vuefinder__about-modal__tab-content"},TI={class:"vuefinder__about-modal__lead"},$I={class:"vuefinder__about-modal__description"},kI={class:"vuefinder__about-modal__links"},OI={href:"https://vuefinder.ozdemir.be",class:"vuefinder__about-modal__link-btn",target:"_blank",rel:"noopener noreferrer"},AI={class:"vuefinder__about-modal__meta"},PI={class:"vuefinder__about-modal__meta-item"},RI={class:"vuefinder__about-modal__meta-label"},II={class:"vuefinder__about-modal__meta-value"},MI={class:"vuefinder__about-modal__meta-item"},FI={class:"vuefinder__about-modal__meta-label"},Bg=Ce({__name:"ModalAbout",setup(t){const e=je(),{t:n}=e.i18n;return(i,o)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:o[0]||(o[0]=r=>v(e).modal.close())},L(v(n)("Close")),1)]),default:we(()=>[g("div",CI,[j(pn,{icon:v(Vg),title:"Vuefinder "+v(e).version},null,8,["icon","title"]),g("div",EI,[g("div",xI,[g("div",TI,L(v(n)("A modern, customizable file manager component built for Vue.")),1),g("div",$I,L(v(n)("If you like it, please follow and ⭐ star on GitHub.")),1),g("div",kI,[g("a",OI,L(v(n)("Project Home")),1),o[1]||(o[1]=g("a",{href:"https://github.com/n1crack/vuefinder",class:"vuefinder__about-modal__link-btn",target:"_blank",rel:"noopener noreferrer"}," GitHub ",-1))]),g("div",AI,[g("div",PI,[g("span",RI,L(v(n)("Version")),1),g("span",II,L(v(e).version),1)]),g("div",MI,[g("span",FI,L(v(n)("License")),1),o[2]||(o[2]=g("span",{class:"vuefinder__about-modal__meta-value"},"MIT",-1))])])])])])]),_:1}))}}),DI={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",viewBox:"0 0 24 24"};function LI(t,e){return y(),T("svg",DI,[...e[0]||(e[0]=[g("path",{d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21q.512.078 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48 48 0 0 0-3.478-.397m-12 .562q.51-.089 1.022-.165m0 0a48 48 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a52 52 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a49 49 0 0 0-7.5 0"},null,-1)])])}const Hg={render:LI},jI={class:"vuefinder__delete-modal__content"},zI={class:"vuefinder__delete-modal__form"},NI={class:"vuefinder__delete-modal__description"},UI={class:"vuefinder__delete-modal__files vf-scrollbar"},VI={key:0,class:"vuefinder__delete-modal__icon vuefinder__delete-modal__icon--dir",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},BI={key:1,class:"vuefinder__delete-modal__icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},HI={class:"vuefinder__delete-modal__file-name"},qI={class:"vuefinder__delete-modal__confirmation"},WI={class:"vuefinder__delete-modal__confirmation-label"},KI={class:"vuefinder__delete-modal__confirmation-text"},YI=["disabled"],Gs=Ce({__name:"ModalDelete",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=Oe(o.path),s=H(e.modal.data.items),a=H(!1),l=()=>{s.value.length&&a.value&&e.adapter.delete({path:r.value.path,items:s.value.map(({path:c,type:u})=>({path:c,type:u}))}).then(c=>{n.success(i("Files deleted.")),e.fs.setFiles(c.files),e.modal.close()}).catch(c=>{n.error(Yt(c,i("Failed to delete files")))})};return(c,u)=>(y(),ne(nn,null,{buttons:we(()=>[g("div",qI,[g("label",WI,[it(g("input",{"onUpdate:modelValue":u[0]||(u[0]=d=>a.value=d),type:"checkbox",class:"vuefinder__delete-modal__checkbox"},null,512),[[Ss,a.value]]),g("span",KI,L(v(i)("I'm sure delete it, This action cannot be undone.")),1)])]),g("button",{type:"button",class:"vf-btn vf-btn-danger",disabled:!a.value,onClick:l},L(v(i)("Yes, Delete!")),9,YI),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:u[1]||(u[1]=d=>v(e).modal.close())},L(v(i)("Cancel")),1)]),default:we(()=>[g("div",null,[j(pn,{icon:v(Hg),title:v(i)("Delete files")},null,8,["icon","title"]),g("div",jI,[g("div",zI,[g("p",NI,L(v(i)("Are you sure you want to delete these files?")),1),g("div",UI,[(y(!0),T(Ie,null,He(s.value,d=>(y(),T("p",{key:d.path,class:"vuefinder__delete-modal__file"},[d.type==="dir"?(y(),T("svg",VI,[...u[2]||(u[2]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])])):(y(),T("svg",BI,[...u[3]||(u[3]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)])])),g("span",HI,L(d.basename),1)]))),128))])])])])]),_:1}))}}),GI={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",viewBox:"0 0 24 24"};function QI(t,e){return y(),T("svg",GI,[...e[0]||(e[0]=[g("path",{d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"},null,-1)])])}const qg={render:QI},XI={class:"vuefinder__rename-modal__content"},JI={class:"vuefinder__rename-modal__item"},ZI={class:"vuefinder__rename-modal__item-info"},eM={key:0,class:"vuefinder__rename-modal__icon vuefinder__rename-modal__icon--dir",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},tM={key:1,class:"vuefinder__rename-modal__icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},nM={class:"vuefinder__rename-modal__item-name"},Qs=Ce({__name:"ModalRename",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=Oe(o.path),s=H(e.modal.data.items[0]),a=H(s.value.basename),l=()=>{a.value!=s.value.basename&&e.adapter.rename({path:r.value.path,item:s.value.path,name:a.value}).then(c=>{n.success(i("%s is renamed.",a.value)),e.fs.setFiles(c.files),e.modal.close()}).catch(c=>{n.error(Yt(c,i("Failed to rename")))})};return(c,u)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:l},L(v(i)("Rename")),1),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:u[1]||(u[1]=d=>v(e).modal.close())},L(v(i)("Cancel")),1)]),default:we(()=>[g("div",null,[j(pn,{icon:v(qg),title:v(i)("Rename")},null,8,["icon","title"]),g("div",XI,[g("div",JI,[g("p",ZI,[s.value.type==="dir"?(y(),T("svg",eM,[...u[2]||(u[2]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])])):(y(),T("svg",tM,[...u[3]||(u[3]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)])])),g("span",nM,L(s.value.basename),1)]),it(g("input",{"onUpdate:modelValue":u[0]||(u[0]=d=>a.value=d),class:"vuefinder__rename-modal__input",placeholder:"Name",type:"text",onKeyup:ho(l,["enter"])},null,544),[[Qo,a.value]])])])])]),_:1}))}});function Tn(){const t=je(),e=te(()=>t.features);return{enabled:n=>e.value[n]??!1}}const iM={class:"vuefinder__text-preview"},oM={class:"vuefinder__text-preview__header"},rM=["title"],sM={class:"vuefinder__text-preview__actions"},aM={key:0,class:"vuefinder__text-preview__content"},lM={key:1},cM=Ce({__name:"Text",emits:["success"],setup(t,{emit:e}){const n=e,i=H(""),o=H(""),r=H(null),s=H(!1),a=je(),l=Gt(a),{enabled:c}=Tn(),{t:u}=a.i18n;et(async()=>{try{const m=await a.adapter.getContent({path:a.modal.data.item.path});i.value=m.content,n("success")}catch(m){Yt(m,"Failed to load text content"),n("success")}});const d=()=>{s.value=!s.value,o.value=i.value,a.modal.setEditMode(s.value)},h=async()=>{try{const m=a.modal.data.item.path;await a.adapter.save({path:m,content:o.value}),i.value=o.value,l.success(u("Updated.")),n("success"),s.value=!s.value}catch(m){l.error(Yt(m,u("Failed to save file")))}};return(m,f)=>(y(),T("div",iM,[g("div",oM,[g("div",{id:"modal-title",class:"vuefinder__text-preview__title",title:v(a).modal.data.item.path},L(v(a).modal.data.item.basename),9,rM),g("div",sM,[s.value?(y(),T("button",{key:0,class:"vuefinder__text-preview__save-button",onClick:h},L(v(u)("Save")),1)):ue("",!0),v(c)("edit")?(y(),T("button",{key:1,class:"vuefinder__text-preview__edit-button",onClick:f[0]||(f[0]=p=>d())},L(s.value?v(u)("Cancel"):v(u)("Edit")),1)):ue("",!0)])]),g("div",null,[s.value?(y(),T("div",lM,[it(g("textarea",{ref_key:"editInput",ref:r,"onUpdate:modelValue":f[1]||(f[1]=p=>o.value=p),class:"vuefinder__text-preview__textarea",name:"text",cols:"30",rows:"10"},null,512),[[Qo,o.value]])])):(y(),T("pre",aM,L(i.value),1))])]))}}),pu=async(t,e)=>{if(e){if(e.isFile){const n=await new Promise(i=>{e.file(i)});t(e,n)}if(e.isDirectory){const n=e.createReader(),i=await new Promise(o=>{n.readEntries(o)});for(const o of i)await pu(t,o)}}},gt={PENDING:0,CANCELED:1,UPLOADING:2,ERROR:3,DONE:10};function Wg(t){const e=je(),{t:n}=e.i18n,i=e.fs,o=Oe(i.path),r=e.config,s=H({QUEUE_ENTRY_STATUS:gt}),a=H(null),l=H(null),c=H(null),u=H(null),d=H(null),h=H([]),m=H(""),f=H(!1),p=H(!1),_=H(null);let C;const w=Y=>{Y.preventDefault(),Y.stopPropagation(),p.value=!0},S=Y=>{Y.preventDefault(),Y.stopPropagation(),p.value=!0},b=Y=>{Y.preventDefault(),Y.stopPropagation(),(!Y.relatedTarget||Y.relatedTarget===document.body)&&(p.value=!1)},E=Y=>{Y.preventDefault(),Y.stopPropagation(),p.value=!1;const I=/^[/\\](.+)/,A=Y.dataTransfer;A&&(A.items&&A.items.length?Array.from(A.items).forEach(Q=>{if(Q.kind==="file"){const U=Q.webkitGetAsEntry?.();if(U)pu((ie,ve)=>{const re=I.exec(ie?.fullPath||"");O(ve,re?re[1]:ve.name)},U);else{const ie=Q.getAsFile?.();ie&&O(ie)}}}):A.files&&A.files.length&&Array.from(A.files).forEach(Q=>O(Q)))},x=Y=>h.value.findIndex(I=>I.id===Y),O=(Y,I)=>C.addFile({name:I||Y.name,type:Y.type,data:Y,source:"Local"}),$=Y=>Y.status===gt.DONE?"text-green-600":Y.status===gt.ERROR||Y.status===gt.CANCELED?"text-red-600":"",K=Y=>Y.status===gt.DONE?"✓":Y.status===gt.ERROR||Y.status===gt.CANCELED?"!":"...",F=()=>u.value?.click(),P=()=>e.modal.close(),N=Y=>{if(f.value||!h.value.filter(I=>I.status!==gt.DONE).length){f.value||(m.value=n("Please select file to upload first."));return}m.value="",_.value=Y||o.value,C.upload()},M=()=>{C.cancelAll(),h.value.forEach(Y=>{Y.status!==gt.DONE&&(Y.status=gt.CANCELED,Y.statusName=n("Canceled"))}),f.value=!1},q=Y=>{f.value||(C.removeFile(Y.id),h.value.splice(x(Y.id),1))},le=Y=>{if(!f.value)if(C.cancelAll(),Y){const I=h.value.filter(A=>A.status!==gt.DONE);h.value=[],I.forEach(A=>O(A.originalFile,A.name))}else h.value=[]},de=Y=>{Y.forEach(I=>{O(I)})};return et(()=>{C=new Pc({debug:e.debug,restrictions:{maxFileSize:tI(r.get("maxFileSize")??"10mb")},locale:e.i18n.t("uppy"),onBeforeFileAdded:(Q,U)=>{if(U[Q.id]!=null){const ie=x(Q.id);h.value[ie]?.status===gt.PENDING&&(m.value=C.i18n("noDuplicates",{fileName:Q.name})),h.value=h.value.filter(ve=>ve.id!==Q.id)}return h.value.push({id:Q.id,name:Q.name,size:e.filesize(Q.size),status:gt.PENDING,statusName:n("Pending upload"),percent:null,originalFile:Q.data}),!0}});const Y={getTargetPath:()=>(_.value||o.value).path};if(t)t(C,Y);else if(e.adapter.getDriver().configureUploader)e.adapter.getDriver().configureUploader(C,Y);else throw new Error("No uploader configured");C.on("restriction-failed",(Q,U)=>{const ie=h.value[x(Q.id)];ie&&q(ie),m.value=U.message}),C.on("upload-start",Q=>{Q.forEach(U=>{const ie=h.value[x(U.id)];ie&&(ie.status=gt.UPLOADING,ie.statusName=n("Uploading"),ie.percent="0%")})}),C.on("upload-progress",(Q,U)=>{const ie=U.bytesTotal??1,ve=Math.floor(U.bytesUploaded/ie*100),re=x(Q.id);re!==-1&&h.value[re]&&(h.value[re].percent=`${ve}%`)}),C.on("upload-success",Q=>{const U=h.value[x(Q.id)];U&&(U.status=gt.DONE,U.statusName=n("Done"))}),C.on("upload-error",(Q,U)=>{const ie=h.value[x(Q.id)];ie&&(ie.percent=null,ie.status=gt.ERROR,ie.statusName=U?.isNetworkError?n("Network Error, Unable establish connection to the server or interrupted."):U?.message||n("Unknown Error"))}),C.on("error",Q=>{m.value=Q.message,f.value=!1}),C.on("complete",Q=>{f.value=!1;const U=_.value||o.value;e.adapter.invalidateListQuery(U.path),e.adapter.open(U.path);const ie=h.value.filter(ve=>ve.status===gt.DONE&&Q.successful.includes(ve.id)).map(ve=>ve.name);e.emitter.emit("vf-upload-complete",ie)}),u.value?.addEventListener("click",()=>l.value?.click()),d.value?.addEventListener("click",()=>c.value?.click());const I={capture:!0};document.addEventListener("dragover",w,I),document.addEventListener("dragenter",S,I),document.addEventListener("dragleave",b,I),document.addEventListener("drop",E,I);const A=Q=>{const U=Q.target,ie=U.files;if(ie){for(const ve of ie)O(ve);U.value=""}};l.value?.addEventListener("change",A),c.value?.addEventListener("change",A)}),Ct(()=>{const Y={capture:!0};document.removeEventListener("dragover",w,Y),document.removeEventListener("dragenter",S,Y),document.removeEventListener("dragleave",b,Y),document.removeEventListener("drop",E,Y)}),{container:a,internalFileInput:l,internalFolderInput:c,pickFiles:u,pickFolders:d,queue:h,message:m,uploading:f,hasFilesInDropArea:p,definitions:s,openFileSelector:F,upload:N,cancel:M,remove:q,clear:le,close:P,getClassNameForEntry:$,getIconForEntry:K,addExternalFiles:de}}const uM={class:"vuefinder__image-preview"},dM={class:"vuefinder__image-preview__header"},hM=["title"],pM={class:"vuefinder__image-preview__actions"},fM={class:"vuefinder__image-preview__image-container"},mM=["src"],vM=Ce({name:"ImagePreview",__name:"Image",emits:["success"],setup(t,{emit:e}){const n=e,i=je(),o=Gt(i),{enabled:r}=Tn(),{t:s}=i.i18n,a=H(!1),l=H(i.modal.data.item.previewUrl??i.adapter.getPreviewUrl({path:i.modal.data.item.path})),c=H(l.value),{addExternalFiles:u,upload:d,queue:h}=Wg(i.customUploader),m=i.fs,f=Oe(m.path),p=In("cropperRef"),_=async()=>{a.value=!a.value,i.modal.setEditMode(a.value)},C=async()=>{const w=p.value?.getResult({size:{width:795,height:341},fillColor:"#ffffff"})?.canvas;if(!w)return;let S=w;if(w.width>1200||w.height>1200){const $=Math.min(1200/w.width,1200/w.height),K=document.createElement("canvas");K.width=Math.floor(w.width*$),K.height=Math.floor(w.height*$);const F=K.getContext("2d");F&&(F.drawImage(w,0,0,K.width,K.height),S=K)}const b=i.modal.data.item.basename,E=b.split(".").pop()?.toLowerCase()||"jpg",x=E==="png"?"image/png":E==="gif"?"image/gif":"image/jpeg",O=await new Promise($=>{S.toBlob(K=>$(K),x)});if(!O){o.error(s("Failed to save image"));return}try{const $=new File([O],b,{type:x}),K=i.modal.data.item.path.split("/");K.pop();const F={path:K.join("/")||(f.value?.path??"")};u([$]),await new Promise(q=>setTimeout(q,100));const P=h.value.find(q=>q.name===$.name);if(!P)throw new Error("File was not added to upload queue");d(F);let N=0;for(;N<150;){await new Promise(le=>setTimeout(le,200));const q=h.value.find(le=>le.id===P.id);if(q?.status===gt.DONE)break;if(q?.status===gt.ERROR)throw new Error(q.statusName||"Upload failed");N++}o.success(s("Updated.")),await fetch(l.value,{cache:"reload",mode:"no-cors"});const M=i.root?.querySelector?.('[data-src="'+l.value+'"]');M&&M instanceof HTMLElement&&Hi.resetStatus(M),i.emitter.emit("vf-refresh-thumbnails"),await _(),n("success")}catch($){o.error(Yt($,s("Failed to save image")))}};return et(()=>{n("success")}),(w,S)=>(y(),T("div",uM,[g("div",dM,[g("h3",{id:"modal-title",class:"vuefinder__image-preview__title",title:v(i).modal.data.item.path},L(v(i).modal.data.item.basename),9,hM),g("div",pM,[a.value?(y(),T("button",{key:0,class:"vuefinder__image-preview__crop-button",onClick:C},L(v(s)("Crop")),1)):ue("",!0),v(r)("edit")?(y(),T("button",{key:1,class:"vuefinder__image-preview__edit-button",onClick:S[0]||(S[0]=b=>_())},L(a.value?v(s)("Cancel"):v(s)("Edit")),1)):ue("",!0)])]),g("div",fM,[a.value?(y(),ne(v(wv),{key:1,ref_key:"cropperRef",ref:p,class:"h-full w-full",crossorigin:"anonymous",src:c.value,"auto-zoom":!0,priority:"image",transitions:!0},null,8,["src"])):(y(),T("img",{key:0,style:{},src:v(i).modal.data.item.previewUrl??v(i).adapter.getPreviewUrl({path:v(i).modal.data.item.path}),class:"vuefinder__image-preview__image h-full w-full"},null,8,mM))])]))}}),gM={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function _M(t,e){return y(),T("svg",gM,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 0 0 2-2V9.414a1 1 0 0 0-.293-.707l-5.414-5.414A1 1 0 0 0 12.586 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2"},null,-1)])])}const Wo={render:_M},yM={class:"vuefinder__default-preview"},bM={class:"vuefinder__default-preview__content"},wM={class:"vuefinder__default-preview__header"},SM=["title"],CM={class:"vuefinder__default-preview__icon-container"},EM=["title"],xM=Ce({__name:"Default",emits:["success"],setup(t,{emit:e}){const n=je(),i=e;return et(()=>{i("success")}),(o,r)=>(y(),T("div",yM,[g("div",bM,[g("div",wM,[g("h3",{id:"modal-title",class:"vuefinder__default-preview__title",title:v(n).modal.data.item.path},L(v(n).modal.data.item.basename),9,SM)]),g("div",CM,[j(v(Wo),{class:"vuefinder__default-preview__file-icon"}),g("div",{id:"modal-title",class:"vuefinder__default-preview__file-name",title:v(n).modal.data.item.path},L(v(n).modal.data.item.basename),9,EM)])])]))}}),TM={class:"vuefinder__video-preview"},$M=["title"],kM={class:"vuefinder__video-preview__video",preload:"metadata",controls:""},OM=["src"],AM=Ce({__name:"Video",emits:["success"],setup(t,{emit:e}){const n=je(),i=e,o=()=>n.adapter.getPreviewUrl({path:n.modal.data.item.path});return et(()=>{i("success")}),(r,s)=>(y(),T("div",TM,[g("h3",{id:"modal-title",class:"vuefinder__video-preview__title",title:v(n).modal.data.item.path},L(v(n).modal.data.item.basename),9,$M),g("div",null,[g("video",kM,[g("source",{src:o(),type:"video/mp4"},null,8,OM),s[0]||(s[0]=Ke(" Your browser does not support the video tag. ",-1))])])]))}}),PM={class:"vuefinder__audio-preview"},RM=["title"],IM={class:"vuefinder__audio-preview__audio",controls:""},MM=["src"],FM=Ce({__name:"Audio",emits:["success"],setup(t,{emit:e}){const n=e,i=je(),o=()=>{const r=je();return r.adapter.getPreviewUrl({path:r.modal.data.item.path})};return et(()=>{n("success")}),(r,s)=>(y(),T("div",PM,[g("h3",{id:"modal-title",class:"vuefinder__audio-preview__title",title:v(i).modal.data.item.path},L(v(i).modal.data.item.basename),9,RM),g("div",null,[g("audio",IM,[g("source",{src:o(),type:"audio/mpeg"},null,8,MM),s[0]||(s[0]=Ke(" Your browser does not support the audio element. ",-1))])])]))}}),DM={class:"vuefinder__pdf-preview"},LM=["title"],jM=["data"],zM=["src"],NM=Ce({__name:"Pdf",emits:["success"],setup(t,{emit:e}){const n=je(),i=e,o=()=>{const r=je();return r.adapter.getPreviewUrl({path:r.modal.data.item.path})};return et(()=>{i("success")}),(r,s)=>(y(),T("div",DM,[g("h3",{id:"modal-title",class:"vuefinder__pdf-preview__title",title:v(n).modal.data.item.path},L(v(n).modal.data.item.basename),9,LM),g("div",null,[g("object",{class:"vuefinder__pdf-preview__object",data:o(),type:"application/pdf",width:"100%",height:"100%"},[g("iframe",{class:"vuefinder__pdf-preview__iframe",src:o(),width:"100%",height:"100%"}," Your browser does not support PDFs ",8,zM)],8,jM)])]))}});function UM(t,e=null){return new Date(t*1e3).toLocaleString(e??navigator.language??"en-US")}const VM={key:0,class:"vuefinder__preview-modal__nav-overlay"},BM=["disabled","title"],HM=["disabled","title"],qM={class:"vuefinder__preview-modal__content"},WM={key:0},KM={class:"vuefinder__preview-modal__loading"},YM={key:0,class:"vuefinder__preview-modal__loading-indicator"},GM={class:"vuefinder__preview-modal__details"},QM={class:"font-bold"},XM={class:"pl-2 font-bold"},JM={key:0,class:"vuefinder__preview-modal__note"},ZM=["download","href"],cr=Ce({__name:"ModalPreview",setup(t){const e=je(),{enabled:n}=Tn(),{t:i}=e.i18n,o=H(!1),r=w=>{const S=(w||"").split("/").pop()||"",b=S.lastIndexOf(".");return b>=0?S.slice(b+1).toLowerCase():""},s=(w,S)=>S?w==="image"?new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif"]).has(S):w==="video"?new Set(["mp4","webm","ogg","ogv","mov","m4v"]).has(S):w==="audio"?new Set(["mp3","wav","ogg","oga","m4a","flac","aac"]).has(S):w==="text"?new Set(["txt","md","json","js","ts","css","scss","html","xml","csv","log","yml","yaml"]).has(S):w==="application/pdf"?S==="pdf":!1:!1,a=w=>{const S=e.modal.data.item.mime_type;if(S&&typeof S=="string")return S.startsWith(w);const b=r(e.modal.data.item.path);return s(w,b)},l=n("preview");l||(o.value=!0);const c=te(()=>e.modal.data.item),u=Oe(e.fs.sortedFiles),d=te(()=>u.value.filter(w=>w.type==="file")),h=te(()=>d.value.findIndex(w=>w.path===c.value.path)),m=te(()=>h.value>0),f=te(()=>h.value<d.value.length-1),p=()=>{if(e.modal.editMode||!m.value)return;const w=d.value[h.value-1];w&&(e.fs.clearSelection(),e.fs.select(w.path),e.modal.data.item=w)},_=()=>{if(e.modal.editMode||!f.value)return;const w=d.value[h.value+1];w&&(e.fs.clearSelection(),e.fs.select(w.path),e.modal.data.item=w)},C=w=>{if(w.key==="Escape"){w.preventDefault(),w.stopPropagation(),e.modal.close();return}(w.key==="ArrowLeft"||w.key==="ArrowRight")&&(w.preventDefault(),w.stopPropagation(),w.key==="ArrowLeft"?p():_())};return et(()=>{const w=document.querySelector(".vuefinder__preview-modal");w&&w.focus()}),(w,S)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:S[6]||(S[6]=b=>v(e).modal.close())},L(v(i)("Close")),1),v(n)("download")?(y(),T("a",{key:0,target:"_blank",class:"vf-btn vf-btn-primary",download:v(e).adapter.getDownloadUrl(v(e).modal.data.item),href:v(e).adapter.getDownloadUrl(v(e).modal.data.item)},L(v(i)("Download")),9,ZM)):ue("",!0)]),default:we(()=>[g("div",{class:"vuefinder__preview-modal",tabindex:"0",onKeydown:C},[v(e).modal.editMode?ue("",!0):(y(),T("div",VM,[g("button",{disabled:!m.value,class:"vuefinder__preview-modal__nav-side vuefinder__preview-modal__nav-side--left",title:v(i)("Previous file"),onClick:p},[...S[7]||(S[7]=[g("svg",{class:"vuefinder__preview-modal__nav-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[g("polyline",{points:"15,18 9,12 15,6"})],-1)])],8,BM),g("button",{disabled:!f.value,class:"vuefinder__preview-modal__nav-side vuefinder__preview-modal__nav-side--right",title:v(i)("Next file"),onClick:_},[...S[8]||(S[8]=[g("svg",{class:"vuefinder__preview-modal__nav-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[g("polyline",{points:"9,18 15,12 9,6"})],-1)])],8,HM)])),g("div",qM,[v(l)?(y(),T("div",WM,[a("text")?(y(),ne(cM,{key:`text-${c.value.path}`,onSuccess:S[0]||(S[0]=b=>o.value=!0)})):a("image")?(y(),ne(vM,{key:`image-${c.value.path}`,onSuccess:S[1]||(S[1]=b=>o.value=!0)})):a("video")?(y(),ne(AM,{key:`video-${c.value.path}`,onSuccess:S[2]||(S[2]=b=>o.value=!0)})):a("audio")?(y(),ne(FM,{key:`audio-${c.value.path}`,onSuccess:S[3]||(S[3]=b=>o.value=!0)})):a("application/pdf")?(y(),ne(NM,{key:`pdf-${c.value.path}`,onSuccess:S[4]||(S[4]=b=>o.value=!0)})):(y(),ne(xM,{key:`default-${c.value.path}`,onSuccess:S[5]||(S[5]=b=>o.value=!0)}))])):ue("",!0),g("div",KM,[o.value===!1?(y(),T("div",YM,[S[9]||(S[9]=g("svg",{class:"vuefinder__preview-modal__spinner",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[g("circle",{class:"vuefinder__preview-modal__spinner-circle",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),g("path",{class:"vuefinder__preview-modal__spinner-path",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)),g("span",null,L(v(i)("Loading")),1)])):ue("",!0)])])],32),g("div",GM,[g("div",null,[g("span",QM,L(v(i)("File Size"))+": ",1),Ke(L(v(e).filesize(v(e).modal.data.item.file_size)),1)]),g("div",null,[g("span",XM,L(v(i)("Last Modified"))+": ",1),Ke(" "+L(v(UM)(v(e).modal.data.item.last_modified)),1)])]),v(n)("download")?(y(),T("div",JM,[g("span",null,L(v(i)(`Download doesn't work? You can try right-click "Download" button, select "Save link as...".`)),1)])):ue("",!0)]),_:1}))}}),eF={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"};function tF(t,e){return y(),T("svg",eF,[...e[0]||(e[0]=[g("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M13 19H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v4M16 22l5-5M21 21.5V17h-4.5"},null,-1)])])}const nF={render:tF},iF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function oF(t,e){return y(),T("svg",iF,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M8 16H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v2m-6 12h8a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2"},null,-1)])])}const fu={render:oF},rF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function sF(t,e){return y(),T("svg",rF,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-6l-2-2H5a2 2 0 0 0-2 2"},null,-1)])])}const zn={render:sF},aF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"};function lF(t,e){return y(),T("svg",aF,[...e[0]||(e[0]=[g("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M12 5v14M5 12h14"},null,-1)])])}const Xs={render:lF},cF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"};function uF(t,e){return y(),T("svg",cF,[...e[0]||(e[0]=[g("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M5 12h14"},null,-1)])])}const Js={render:uF},dF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",class:"h-5 w-5",viewBox:"0 0 24 24"};function hF(t,e){return y(),T("svg",dF,[...e[0]||(e[0]=[g("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"m15 4.5-4 4L7 10l-1.5 1.5 7 7L14 17l1.5-4 4-4M9 15l-4.5 4.5M14.5 4 20 9.5"},null,-1)])])}const mu={render:hF},pF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function fF(t,e){return y(),T("svg",pF,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"},null,-1)])])}const vu={render:fF},mF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24"};function vF(t,e){return y(),T("svg",mF,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 9.776q.168-.026.344-.026h15.812q.176 0 .344.026m-16.5 0a2.25 2.25 0 0 0-1.883 2.542l.857 6a2.25 2.25 0 0 0 2.227 1.932H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-1.883-2.542m-16.5 0V6A2.25 2.25 0 0 1 6 3.75h3.879a1.5 1.5 0 0 1 1.06.44l2.122 2.12a1.5 1.5 0 0 0 1.06.44H18A2.25 2.25 0 0 1 20.25 9v.776"},null,-1)])])}const gu={render:vF},gF={class:"vuefinder__modal-tree__folder-item"},_F={class:"vuefinder__modal-tree__folder-content"},yF={key:1,class:"vuefinder__modal-tree__folder-spacer"},bF={class:"vuefinder__modal-tree__folder-text"},wF={key:0,class:"vuefinder__modal-tree__subfolders"},SF={key:0,class:"vuefinder__modal-tree__more-note"},CF=300,EF=Ce({__name:"ModalTreeFolderItem",props:{folder:{},storage:{},modelValue:{},expandedFolders:{},modalTreeData:{},currentPath:{}},emits:["update:modelValue","selectAndClose","toggleFolder"],setup(t,{emit:e}){const n=je(),{t:i}=n.i18n,o=n.fs,r=H({}),s=t,a=e;Oe(o.path);const l=te(()=>{const O=`${s.storage}:${s.folder.path}`;return s.expandedFolders[O]||!1}),c=te(()=>s.modelValue?.path===s.folder.path),u=te(()=>s.currentPath?.path===s.folder.path),d=te(()=>s.modalTreeData[s.folder.path]||[]),h=te(()=>{const O=d.value,$=r.value[s.folder.path]||50;return O.length>$?O.slice(0,$):O}),m=te(()=>d.value.length),f=te(()=>r.value[s.folder.path]||50),p=te(()=>m.value>f.value),_=()=>{r.value[s.folder.path]=(f.value||50)+50},C=te(()=>d.value.length>0||s.folder.type==="dir"),w=()=>{a("toggleFolder",s.storage,s.folder.path)},S=()=>{a("update:modelValue",s.folder)},b=()=>{a("update:modelValue",s.folder),a("selectAndClose",s.folder)};let E=0;const x=()=>{const O=Date.now();O-E<CF?b():S(),E=O};return(O,$)=>{const K=Ue("ModalTreeFolderItem",!0);return y(),T("div",gF,[g("div",_F,[C.value?(y(),T("div",{key:0,class:"vuefinder__modal-tree__folder-toggle",onClick:w},[l.value?(y(),ne(v(Js),{key:1,class:"vuefinder__modal-tree__folder-toggle-icon"})):(y(),ne(v(Xs),{key:0,class:"vuefinder__modal-tree__folder-toggle-icon"}))])):(y(),T("div",yF)),g("div",{class:Ae(["vuefinder__modal-tree__folder-link",{"vuefinder__modal-tree__folder-link--selected":c.value,"vuefinder__modal-tree__folder-link--current":u.value}]),onClick:S,onDblclick:b,onTouchend:x},[l.value?(y(),ne(v(gu),{key:1,class:"vuefinder__item-icon__folder--open vuefinder__modal-tree__folder-icon"})):(y(),ne(v(zn),{key:0,class:"vuefinder__modal-tree__folder-icon vuefinder__item-icon__folder"})),g("span",bF,L(t.folder.basename),1)],34)]),l.value&&C.value?(y(),T("div",wF,[(y(!0),T(Ie,null,He(h.value,F=>(y(),ne(K,{key:F.path,folder:F,storage:t.storage,"model-value":t.modelValue,"expanded-folders":t.expandedFolders,"modal-tree-data":t.modalTreeData,"current-path":t.currentPath,"onUpdate:modelValue":$[0]||($[0]=P=>O.$emit("update:modelValue",P)),onSelectAndClose:$[1]||($[1]=P=>O.$emit("selectAndClose",P)),onToggleFolder:$[2]||($[2]=(P,N)=>O.$emit("toggleFolder",P,N))},null,8,["folder","storage","model-value","expanded-folders","modal-tree-data","current-path"]))),128)),p.value?(y(),T("div",SF,[g("div",{class:"vuefinder__modal-tree__load-more",onClick:_},L(v(i)("load more")),1)])):ue("",!0)])):ue("",!0)])}}}),xF={class:"vuefinder__modal-tree"},TF={class:"vuefinder__modal-tree__header"},$F={class:"vuefinder__modal-tree__title"},kF={key:0,class:"vuefinder__modal-tree__section"},OF={class:"vuefinder__modal-tree__section-title"},AF={class:"vuefinder__modal-tree__list"},PF=["onClick","onDblclick","onTouchend"],RF={class:"vuefinder__modal-tree__text"},IF={class:"vuefinder__modal-tree__text-storage"},MF={class:"vuefinder__modal-tree__section-title"},FF={class:"vuefinder__modal-tree__list"},DF={class:"vuefinder__modal-tree__storage-item"},LF={class:"vuefinder__modal-tree__storage-content"},jF=["onClick"],zF=["onClick","onDblclick","onTouchend"],NF={class:"vuefinder__modal-tree__storage-text"},UF={key:0,class:"vuefinder__modal-tree__subfolders"},VF={key:0,class:"vuefinder__modal-tree__more-note"},BF=["onClick"],Ip=300,_u=Ce({__name:"ModalTreeSelector",props:{modelValue:{},showPinnedFolders:{type:Boolean},currentPath:{}},emits:["update:modelValue","selectAndClose"],setup(t,{emit:e}){const n=je(),{t:i}=n.i18n,o=n.fs,r=n.config,s=e,a=Oe(o.sortedFiles),l=Oe(o.storages),c=te(()=>l.value||[]),u=Oe(o.path),d=H(null),h=H({}),m=H({}),f=H({});$e(a,M=>{const q=M.filter(de=>de.type==="dir"),le=u.value?.path||"";le&&(m.value[le]=q.map(de=>({...de,type:"dir"})))});const p=(M,q)=>{const le=`${M}:${q}`;h.value={...h.value,[le]:!h.value[le]},h.value[le]&&!m.value[q]&&n.adapter.list(q).then(de=>{const Y=(de.files||[]).filter(I=>I.type==="dir");m.value[q]=Y.map(I=>({...I,type:"dir"}))})},_=M=>m.value[M]||[],C=M=>f.value[M]||50,w=M=>{const q=_(M),le=C(M);return q.length>le?q.slice(0,le):q},S=M=>_(M).length,b=M=>S(M)>C(M),E=M=>{f.value[M]=C(M)+50},x=M=>{M&&s("update:modelValue",M)},O=M=>{M&&(s("update:modelValue",M),s("selectAndClose",M))},$=M=>{const q={storage:M,path:M+"://",basename:M,type:"dir",extension:"",file_size:null,last_modified:null,mime_type:null,visibility:"public",dir:M+"://"};s("update:modelValue",q)},K=M=>{const q={storage:M,path:M+"://",basename:M,type:"dir",extension:"",file_size:null,last_modified:null,mime_type:null,visibility:"public",dir:M+"://"};s("update:modelValue",q),s("selectAndClose",q)};let F=0;const P=M=>{if(!M)return;const q=Date.now();q-F<Ip?O(M):x(M),F=q},N=M=>{const q=Date.now();q-F<Ip?K(M):$(M),F=q};return et(()=>{d.value&&hn(d.value,{overflow:{x:"hidden"},scrollbars:{theme:"vf-scrollbars-theme"}})}),(M,q)=>(y(),T("div",xF,[g("div",TF,[g("div",$F,L(v(i)("Select Target Folder")),1)]),g("div",{ref_key:"modalContentElement",ref:d,class:"vuefinder__modal-tree__content"},[t.showPinnedFolders&&v(n).features.pinned&&v(r).get("pinnedFolders").length?(y(),T("div",kF,[g("div",OF,L(v(i)("Pinned Folders")),1),g("div",AF,[(y(!0),T(Ie,null,He(v(r).get("pinnedFolders"),le=>(y(),T("div",{key:le.path,class:Ae(["vuefinder__modal-tree__item",{"vuefinder__modal-tree__item--selected":t.modelValue?.path===le.path}]),onClick:de=>x(le),onDblclick:de=>O(le),onTouchend:de=>P(le)},[j(v(zn),{class:"vuefinder__modal-tree__icon vuefinder__item-icon__folder"}),g("div",RF,L(le.basename),1),g("div",IF,L(le.storage),1),j(v(mu),{class:"vuefinder__modal-tree__icon vuefinder__modal-tree__icon--pin"})],42,PF))),128))])])):ue("",!0),g("div",MF,L(v(i)("Storages")),1),(y(!0),T(Ie,null,He(c.value,le=>(y(),T("div",{key:le,class:"vuefinder__modal-tree__section"},[g("div",FF,[g("div",DF,[g("div",LF,[g("div",{class:"vuefinder__modal-tree__storage-toggle",onClick:Ye(de=>p(le,le+"://"),["stop"])},[h.value[`${le}:${le}://`]?(y(),ne(v(Js),{key:1,class:"vuefinder__modal-tree__toggle-icon"})):(y(),ne(v(Xs),{key:0,class:"vuefinder__modal-tree__toggle-icon"}))],8,jF),g("div",{class:Ae(["vuefinder__modal-tree__storage-link",{"vuefinder__modal-tree__storage-link--selected":t.modelValue?.path===le+"://"}]),onClick:de=>$(le),onDblclick:de=>K(le),onTouchend:de=>N(le)},[j(v(vu),{class:"vuefinder__modal-tree__storage-icon"}),g("span",NF,L(le),1)],42,zF)]),h.value[`${le}:${le}://`]?(y(),T("div",UF,[(y(!0),T(Ie,null,He(w(le+"://"),de=>(y(),ne(EF,{key:de.path,folder:de,storage:le,"model-value":t.modelValue,"expanded-folders":h.value,"modal-tree-data":m.value,"current-path":t.currentPath,"onUpdate:modelValue":x,onSelectAndClose:O,onToggleFolder:p},null,8,["folder","storage","model-value","expanded-folders","modal-tree-data","current-path"]))),128)),b(le+"://")?(y(),T("div",VF,[g("div",{class:"vuefinder__modal-tree__load-more",onClick:de=>E(le+"://")},L(v(i)("load more")),9,BF)])):ue("",!0)])):ue("",!0)])])]))),128))],512)]))}}),HF=["title"],Xl=Ce({__name:"Message",props:{error:{type:Boolean}},emits:["hidden"],setup(t,{emit:e}){const n=e,i=je(),{t:o}=i.i18n,r=H(!1),s=H(null),a=H(s.value?.innerHTML);$e(a,()=>r.value=!1);const l=()=>{n("hidden"),r.value=!0};return(c,u)=>(y(),T("div",null,[r.value?ue("",!0):(y(),T("div",{key:0,ref_key:"strMessage",ref:s,class:Ae(["vuefinder__message",t.error?"vuefinder__message--error":"vuefinder__message--success"])},[Ve(c.$slots,"default"),g("div",{class:"vuefinder__message__close",title:v(o)("Close"),onClick:l},[...u[0]||(u[0]=[g("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"vuefinder__message__icon"},[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])],8,HF)],2))]))}}),qF={class:"vuefinder__move-modal__content"},WF={class:"vuefinder__move-modal__description"},KF={class:"vuefinder__move-modal__files vf-scrollbar"},YF={class:"vuefinder__move-modal__file-name"},GF={class:"vuefinder__move-modal__target-title"},QF={class:"vuefinder__move-modal__target-container"},XF={class:"vuefinder__move-modal__target-path"},JF={class:"vuefinder__move-modal__target-storage"},ZF={key:0,class:"vuefinder__move-modal__destination-folder"},eD={class:"vuefinder__move-modal__target-badge"},tD={key:0,class:"vuefinder__move-modal__options"},nD={class:"vuefinder__move-modal__checkbox-label"},iD={class:"vuefinder__move-modal__checkbox-text"},oD=["disabled"],rD={class:"vuefinder__move-modal__selected-items"},Kg=Ce({__name:"ModalTransfer",props:{copy:{type:Boolean}},setup(t){const e=je(),n=Gt(e),{enabled:i}=Tn(),{t:o}=e.i18n,r=t,s=H(e.modal.data.items.from),a=H(e.modal.data.items.to),l=H(""),c=H(r.copy||!i("move")),u=te(()=>c.value?"copy":"move"),d=H(!1),h=Oe(e.fs.path),m=te(()=>c.value?o("Copy files"):o("Move files")),f=te(()=>c.value?o("Are you sure you want to copy these files?"):o("Are you sure you want to move these files?")),p=te(()=>c.value?o("Yes, Copy!"):o("Yes, Move!")),_=x=>{x&&(a.value=x)},C=x=>{x&&(a.value=x,d.value=!1)},w=te(()=>{const x=a.value;return x?s.value.some(O=>!!(x.path===O.path||O.path.startsWith(x.path+"/")||O.type==="dir"&&x.path.startsWith(O.path+"/"))):!0}),S=te(()=>{if(!w.value)return"";const x=a.value;return x?s.value.find(O=>x.path===O.path||O.path.startsWith(x.path+"/")||O.type==="dir"&&x.path.startsWith(O.path+"/"))?o("Cannot move/copy item to itself or its parent/child directory"):o("Invalid destination directory"):o("Please select a destination directory")}),b=()=>{const x=a.value.path;if(!x)return{storage:"local",path:""};if(x.endsWith("://"))return{storage:x.replace("://",""),path:""};const O=x.split("://");return{storage:O[0]||"local",path:O[1]||""}},E=async()=>{if(s.value.length)try{const{files:x}=await e.adapter[u.value]({path:h.value.path,sources:s.value.map(({path:O})=>O),destination:a.value.path});e.fs.setFiles(x),e.modal.close()}catch(x){n.error(Yt(x,o("Failed to transfer files")))}};return(x,O)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",disabled:w.value,onClick:E},L(p.value),9,oD),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:O[4]||(O[4]=$=>v(e).modal.close())},L(v(o)("Cancel")),1),g("div",rD,L(v(o)("%s item(s) selected.",s.value.length)),1)]),default:we(()=>[g("div",null,[j(pn,{icon:c.value?v(fu):v(nF),title:m.value},null,8,["icon","title"]),g("div",qF,[g("p",WF,L(f.value),1),g("div",KF,[(y(!0),T(Ie,null,He(s.value,$=>(y(),T("div",{key:$.path,class:"vuefinder__move-modal__file"},[g("div",null,[$.type==="dir"?(y(),ne(v(zn),{key:0,class:"vuefinder__move-modal__icon vuefinder__move-modal__icon--dir"})):(y(),ne(v(Wo),{key:1,class:"vuefinder__move-modal__icon"}))]),g("div",YF,L($.path),1)]))),128))]),g("h4",GF,L(v(o)("Target Directory")),1),g("div",QF,[g("div",{class:"vuefinder__move-modal__target-display",onClick:O[0]||(O[0]=$=>d.value=!d.value)},[g("div",XF,[g("span",JF,L(b().storage)+"://",1),b().path?(y(),T("span",ZF,L(b().path),1)):ue("",!0)]),g("span",eD,L(v(o)("Browse")),1)])]),g("div",{class:Ae(["vuefinder__move-modal__tree-selector",d.value?"vuefinder__move-modal__tree-selector--expanded":"vuefinder__move-modal__tree-selector--collapsed"])},[j(_u,{modelValue:a.value,"onUpdate:modelValue":[O[1]||(O[1]=$=>a.value=$),_],"show-pinned-folders":!0,onSelectAndClose:C},null,8,["modelValue"])],2),v(i)("copy")&&v(i)("move")?(y(),T("div",tD,[g("label",nD,[it(g("input",{"onUpdate:modelValue":O[2]||(O[2]=$=>c.value=$),type:"checkbox",class:"vuefinder__move-modal__checkbox"},null,512),[[Ss,c.value]]),g("span",iD,L(v(o)("Create a copy instead of moving")),1)])])):ue("",!0),S.value?(y(),ne(Xl,{key:1,error:""},{default:we(()=>[Ke(L(S.value),1)]),_:1})):ue("",!0),l.value.length&&!S.value?(y(),ne(Xl,{key:2,error:"",onHidden:O[3]||(O[3]=$=>l.value="")},{default:we(()=>[Ke(L(l.value),1)]),_:1})):ue("",!0)])])]),_:1}))}}),uo=Ce({__name:"ModalMove",setup(t){return(e,n)=>(y(),ne(Kg,{copy:!1}))}}),yu=Ce({__name:"ModalCopy",setup(t){return(e,n)=>(y(),ne(Kg,{copy:!0}))}}),sD=(t,e=0,n=!1)=>{let i;return(...o)=>{n&&!i&&t(...o),clearTimeout(i),i=setTimeout(()=>{t(...o)},e)}},Yg=(t,e,n)=>{const i=H(t);return x_((o,r)=>({get(){return o(),i.value},set:sD(s=>{i.value=s,r()},e,!1)}))},aD={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"};function lD(t,e){return y(),T("svg",aD,[...e[0]||(e[0]=[g("path",{d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607"},null,-1)])])}const bu={render:lD},cD={xmlns:"http://www.w3.org/2000/svg",fill:"none",class:"animate-spin p-0.5 h-5 w-5 text-white ml-auto",viewBox:"0 0 24 24"};function uD(t,e){return y(),T("svg",cD,[...e[0]||(e[0]=[g("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4",class:"opacity-25 stroke-blue-900"},null,-1),g("path",{fill:"currentColor",d:"M4 12a8 8 0 0 1 8-8V0C5.373 0 0 5.373 0 12zm2 5.291A7.96 7.96 0 0 1 4 12H0c0 3.042 1.135 5.824 3 7.938z",class:"opacity-75"},null,-1)])])}const Zs={render:uD},dD={class:"vuefinder__search-modal__search-input"},hD=["value","placeholder","disabled"],pD={key:0,class:"vuefinder__search-modal__loading"},fD=Ce({name:"SearchInput",__name:"SearchInput",props:{modelValue:{},isSearching:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue","keydown"],setup(t,{expose:e,emit:n}){const i=n,o=je(),{t:r}=o.i18n,s=H(null),a=c=>{const u=c.target;i("update:modelValue",u.value)},l=c=>{i("keydown",c)};return e({focus:()=>{s.value&&s.value.focus()}}),(c,u)=>(y(),T("div",dD,[j(v(bu),{class:"vuefinder__search-modal__search-icon"}),g("input",{ref_key:"searchInput",ref:s,value:t.modelValue,type:"text",placeholder:v(r)("Search files"),disabled:t.disabled,class:"vuefinder__search-modal__input",onKeydown:l,onKeyup:u[0]||(u[0]=Ye(()=>{},["stop"])),onInput:a},null,40,hD),t.isSearching?(y(),T("div",pD,[j(v(Zs),{class:"vuefinder__search-modal__loading-icon"})])):ue("",!0)]))}}),mD={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24"};function vD(t,e){return y(),T("svg",mD,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87q.11.06.22.127c.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a8 8 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a7 7 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a7 7 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a7 7 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124q.108-.066.22-.128c.332-.183.582-.495.644-.869z"},null,-1),g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0"},null,-1)])])}const Gg={render:vD},gD=["disabled","title"],_D=["data-theme"],yD={class:"vuefinder__search-modal__dropdown-content"},bD={class:"vuefinder__search-modal__dropdown-section"},wD={class:"vuefinder__search-modal__dropdown-title"},SD={class:"vuefinder__search-modal__dropdown-options"},CD={key:0,class:"vuefinder__search-modal__dropdown-option-check"},ED={key:0,class:"vuefinder__search-modal__dropdown-option-check"},xD={key:0,class:"vuefinder__search-modal__dropdown-option-check"},TD={key:0,class:"vuefinder__search-modal__dropdown-option-check"},$D=Ce({name:"SearchOptionsDropdown",__name:"SearchOptionsDropdown",props:{visible:{type:Boolean},disabled:{type:Boolean,default:!1},sizeFilter:{},selectedOption:{}},emits:["update:visible","update:sizeFilter","update:selectedOption","keydown"],setup(t,{expose:e,emit:n}){const i=t,o=n,r=je(),{t:s}=r.i18n,a=H(null),l=H(null);let c=null;const u=p=>{if(o("update:selectedOption",p),p.startsWith("size-")){const _=p.split("-")[1];o("update:sizeFilter",_)}},d=async()=>{i.disabled||(i.visible?(o("update:visible",!1),c&&(c(),c=null)):(o("update:visible",!0),await Ge(),await h()))},h=async()=>{if(!(!a.value||!l.value)&&(await Ge(),!(!a.value||!l.value))){Object.assign(l.value.style,{position:"fixed",zIndex:"10001",opacity:"0",transform:"translateY(-8px)",transition:"opacity 150ms ease-out, transform 150ms ease-out"});try{const{x:p,y:_}=await Zi(a.value,l.value,{placement:"bottom-start",strategy:"fixed",middleware:[Ro(8),Io({padding:16}),Mo({padding:16})]});Object.assign(l.value.style,{left:`${p}px`,top:`${_}px`}),requestAnimationFrame(()=>{l.value&&Object.assign(l.value.style,{opacity:"1",transform:"translateY(0)"})})}catch(p){console.warn("Floating UI initial positioning error:",p);return}try{c=rc(a.value,l.value,async()=>{if(!(!a.value||!l.value))try{const{x:p,y:_}=await Zi(a.value,l.value,{placement:"bottom-start",strategy:"fixed",middleware:[Ro(8),Io({padding:16}),Mo({padding:16})]});Object.assign(l.value.style,{left:`${p}px`,top:`${_}px`})}catch(p){console.warn("Floating UI positioning error:",p)}})}catch(p){console.warn("Floating UI autoUpdate setup error:",p),c=null}}},m=p=>{if(!i.visible)return;const _=["size-all","size-small","size-medium","size-large"],C=_.findIndex(w=>w===i.selectedOption);if(p.key==="ArrowDown"){p.preventDefault();const w=(C+1)%_.length;o("update:selectedOption",_[w]||null)}else if(p.key==="ArrowUp"){p.preventDefault();const w=C<=0?_.length-1:C-1;o("update:selectedOption",_[w]||null)}else p.key==="Enter"?(p.preventDefault(),i.selectedOption?.startsWith("size-")&&o("update:sizeFilter",i.selectedOption.split("-")[1])):p.key==="Escape"&&(p.preventDefault(),o("update:visible",!1),c&&(c(),c=null))},f=()=>{c&&(c(),c=null)};return $e(()=>i.visible,p=>{!p&&c&&(c(),c=null)}),Ct(()=>{f()}),e({cleanup:f}),(p,_)=>(y(),T(Ie,null,[g("button",{ref_key:"dropdownBtn",ref:a,class:Ae(["vuefinder__search-modal__dropdown-btn",{"vuefinder__search-modal__dropdown-btn--active":t.visible}]),disabled:t.disabled,title:v(s)("Search Options"),onClick:Ye(d,["stop"])},[j(v(Gg),{class:"vuefinder__search-modal__dropdown-icon"})],10,gD),(y(),ne(ws,{to:"body"},[t.visible?(y(),T("div",{key:0,ref_key:"dropdownContent",ref:l,class:"vuefinder__themer vuefinder__search-modal__dropdown vuefinder__search-modal__dropdown--visible","data-theme":v(r).theme.current,tabindex:"-1",onClick:_[4]||(_[4]=Ye(()=>{},["stop"])),onKeydown:m},[g("div",yD,[g("div",bD,[g("div",wD,L(v(s)("File Size")),1),g("div",SD,[g("div",{class:Ae(["vuefinder__search-modal__dropdown-option",{"vuefinder__search-modal__dropdown-option--selected":t.sizeFilter==="all"}]),onClick:_[0]||(_[0]=Ye(C=>u("size-all"),["stop"]))},[g("span",null,L(v(s)("All Files")),1),t.sizeFilter==="all"?(y(),T("div",CD,[..._[5]||(_[5]=[g("svg",{viewBox:"0 0 16 16",fill:"currentColor"},[g("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"})],-1)])])):ue("",!0)],2),g("div",{class:Ae(["vuefinder__search-modal__dropdown-option",{"vuefinder__search-modal__dropdown-option--selected":t.sizeFilter==="small"}]),onClick:_[1]||(_[1]=Ye(C=>u("size-small"),["stop"]))},[g("span",null,L(v(s)("Small (< 1MB)")),1),t.sizeFilter==="small"?(y(),T("div",ED,[..._[6]||(_[6]=[g("svg",{viewBox:"0 0 16 16",fill:"currentColor"},[g("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"})],-1)])])):ue("",!0)],2),g("div",{class:Ae(["vuefinder__search-modal__dropdown-option",{"vuefinder__search-modal__dropdown-option--selected":t.sizeFilter==="medium"}]),onClick:_[2]||(_[2]=Ye(C=>u("size-medium"),["stop"]))},[g("span",null,L(v(s)("Medium (1-10MB)")),1),t.sizeFilter==="medium"?(y(),T("div",xD,[..._[7]||(_[7]=[g("svg",{viewBox:"0 0 16 16",fill:"currentColor"},[g("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"})],-1)])])):ue("",!0)],2),g("div",{class:Ae(["vuefinder__search-modal__dropdown-option",{"vuefinder__search-modal__dropdown-option--selected":t.sizeFilter==="large"}]),onClick:_[3]||(_[3]=Ye(C=>u("size-large"),["stop"]))},[g("span",null,L(v(s)("Large (> 10MB)")),1),t.sizeFilter==="large"?(y(),T("div",TD,[..._[8]||(_[8]=[g("svg",{viewBox:"0 0 16 16",fill:"currentColor"},[g("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"})],-1)])])):ue("",!0)],2)])])])],40,_D)):ue("",!0)]))],64))}});function Qg(t,e=40){const n=t.match(/^([^:]+:\/\/)(.*)$/);if(!n)return t;const i=n[1],o=n[2]??"",r=o.split("/").filter(Boolean),s=r.pop();if(!s)return i+o;let a=`${i}${r.join("/")}${r.length?"/":""}${s}`;if(a.length<=e)return a;const l=s.split(/\.(?=[^\.]+$)/),c=l[0]??"",u=l[1]??"",d=c.length>10?`${c.slice(0,6)}...${c.slice(-5)}`:c,h=u?`${d}.${u}`:d;return a=`${i}${r.join("/")}${r.length?"/":""}${h}`,a.length>e&&(a=`${i}.../${h}`),a}async function Xg(t){try{await navigator.clipboard.writeText(t)}catch{const e=document.createElement("textarea");e.value=t,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}}async function Ko(t){await Xg(t)}async function kD(t){await Xg(t)}const OD={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 448 512"};function AD(t,e){return y(),T("svg",OD,[...e[0]||(e[0]=[g("path",{d:"M8 256a56 56 0 1 1 112 0 56 56 0 1 1-112 0m160 0a56 56 0 1 1 112 0 56 56 0 1 1-112 0m216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112"},null,-1)])])}const Jg={render:AD},PD=["title"],RD={class:"vuefinder__search-modal__result-icon"},ID={class:"vuefinder__search-modal__result-content"},MD={class:"vuefinder__search-modal__result-name"},FD={key:0,class:"vuefinder__search-modal__result-size"},DD=["title"],LD=["title"],jD=["data-item-dropdown","data-theme"],zD={class:"vuefinder__search-modal__item-dropdown-content"},ND=Ce({name:"SearchResultItem",__name:"SearchResultItem",props:{item:{},index:{},selectedIndex:{},expandedPaths:{},activeDropdown:{},selectedItemDropdownOption:{}},emits:["select","selectWithDropdown","togglePathExpansion","toggleItemDropdown","update:selectedItemDropdownOption","copyPath","openContainingFolder","preview"],setup(t,{emit:e}){const n=t,i=e,o=je(),{t:r}=o.i18n,s=H(null);let a=null,l=null,c=[],u=null;$e(()=>n.activeDropdown,O=>{a&&(a(),a=null),l&&(c.forEach($=>{$===window?window.removeEventListener("scroll",l,!0):$.removeEventListener("scroll",l,!0)}),l=null,c=[]),u&&(document.removeEventListener("mousedown",u,!0),document.removeEventListener("touchstart",u,!0),u=null),O===n.item.path&&s.value&&Ge(()=>{C(n.item.path,s.value),h(),m()})});const d=O=>{const $=[];let K=O;for(;K&&K!==document.body&&K!==document.documentElement;){const F=window.getComputedStyle(K),P=F.overflow+F.overflowX+F.overflowY;(P.includes("scroll")||P.includes("auto"))&&$.push(K),K=K.parentElement}return $},h=()=>{if(n.activeDropdown!==n.item.path)return;const O=d(s.value);c=[window,...O],l=()=>{n.activeDropdown===n.item.path&&i("toggleItemDropdown",n.item.path,new MouseEvent("click"))};const $=l;$&&c.forEach(K=>{K===window?window.addEventListener("scroll",$,!0):K.addEventListener("scroll",$,!0)})},m=()=>{n.activeDropdown===n.item.path&&(u=O=>{if(n.activeDropdown!==n.item.path)return;const $=O.target;if(!$)return;const K=document.querySelector(`[data-item-dropdown="${n.item.path}"]`);if(K&&K.contains($)||s.value&&s.value.contains($))return;const F=o.root;if(F&&F.contains($)){i("toggleItemDropdown",n.item.path,new MouseEvent("click"));return}const P=document.querySelector(".vuefinder__modal-layout");if(P&&P.contains($)){i("toggleItemDropdown",n.item.path,new MouseEvent("click"));return}i("toggleItemDropdown",n.item.path,new MouseEvent("click"))},setTimeout(()=>{u&&(document.addEventListener("mousedown",u,!0),document.addEventListener("touchstart",u,!0))},100))};Ct(()=>{a&&(a(),a=null),l&&(c.forEach(O=>{O===window?window.removeEventListener("scroll",l,!0):O.removeEventListener("scroll",l,!0)}),l=null,c=[]),u&&(document.removeEventListener("mousedown",u,!0),document.removeEventListener("touchstart",u,!0),u=null)});const f=O=>n.expandedPaths.has(O),p=O=>O.type==="dir"||!O.file_size?"":hu(O.file_size),_=(O,$)=>{$.stopPropagation(),i("toggleItemDropdown",O,$)},C=async(O,$)=>{const K=document.querySelector(`[data-item-dropdown="${O}"]`);if(!(!K||!$)&&(await Ge(),!(!K||!$))){Object.assign(K.style,{position:"fixed",zIndex:"10001",opacity:"0",transform:"translateY(-8px)",transition:"opacity 150ms ease-out, transform 150ms ease-out"});try{const{x:F,y:P}=await Zi($,K,{placement:"left-start",strategy:"fixed",middleware:[Ro(8),Io({padding:16}),Mo({padding:16})]});Object.assign(K.style,{left:`${F}px`,top:`${P}px`}),requestAnimationFrame(()=>{K&&Object.assign(K.style,{opacity:"1",transform:"translateY(0)"})})}catch(F){console.warn("Floating UI initial positioning error:",F);return}try{a=rc($,K,async()=>{if(!(!$||!K))try{const{x:F,y:P}=await Zi($,K,{placement:"left-start",strategy:"fixed",middleware:[Ro(8),Io({padding:16}),Mo({padding:16})]});Object.assign(K.style,{left:`${F}px`,top:`${P}px`})}catch(F){console.warn("Floating UI positioning error:",F)}})}catch(F){console.warn("Floating UI autoUpdate setup error:",F),a=null}}},w=O=>{i("update:selectedItemDropdownOption",O)},S=async O=>{await Ko(O.path),i("copyPath",O)},b=O=>{i("openContainingFolder",O)},E=O=>{i("preview",O)},x=O=>{if(!n.activeDropdown)return;const $=["copy-path","open-folder","preview"],K=n.selectedItemDropdownOption,F=$.findIndex(P=>K?.includes(P));if(O.key==="ArrowDown"){O.preventDefault();const P=(F+1)%$.length;i("update:selectedItemDropdownOption",`${$[P]||""}-${n.activeDropdown}`)}else if(O.key==="ArrowUp"){O.preventDefault();const P=F<=0?$.length-1:F-1;i("update:selectedItemDropdownOption",`${$[P]||""}-${n.activeDropdown}`)}else O.key==="Enter"?(O.preventDefault(),K&&(K.includes("copy-path")?S(n.item):K.includes("open-folder")?b(n.item):K.includes("preview")&&E(n.item))):O.key==="Escape"&&(O.preventDefault(),i("update:selectedItemDropdownOption",null))};return(O,$)=>(y(),T("div",{class:Ae(["vuefinder__search-modal__result-item",{"vuefinder__search-modal__result-item--selected":t.index===t.selectedIndex}]),title:t.item.basename,onClick:$[9]||($[9]=K=>i("select",t.index))},[g("div",RD,[t.item.type==="dir"?(y(),ne(v(zn),{key:0})):(y(),ne(v(Wo),{key:1}))]),g("div",ID,[g("div",MD,[Ke(L(t.item.basename)+" ",1),p(t.item)?(y(),T("span",FD,L(p(t.item)),1)):ue("",!0)]),g("div",{class:"vuefinder__search-modal__result-path",title:t.item.path,onClick:$[0]||($[0]=Ye(K=>{i("select",t.index),i("togglePathExpansion",t.item.path)},["stop"]))},L(f(t.item.path)?t.item.path:v(Qg)(t.item.path)),9,DD)]),g("button",{ref_key:"buttonElementRef",ref:s,class:"vuefinder__search-modal__result-actions",title:v(r)("More actions"),onClick:$[1]||($[1]=K=>{i("selectWithDropdown",t.index),_(t.item.path,K)})},[j(v(Jg),{class:"vuefinder__search-modal__result-actions-icon"})],8,LD),(y(),ne(ws,{to:"body"},[t.activeDropdown===t.item.path?(y(),T("div",{key:0,"data-item-dropdown":t.item.path,class:"vuefinder__themer vuefinder__search-modal__item-dropdown vuefinder__search-modal__item-dropdown--visible","data-theme":v(o).theme.current,tabindex:"-1",onClick:$[8]||($[8]=Ye(()=>{},["stop"])),onKeydown:x},[g("div",zD,[g("div",{class:Ae(["vuefinder__search-modal__item-dropdown-option",{"vuefinder__search-modal__item-dropdown-option--selected":t.selectedItemDropdownOption===`copy-path-${t.item.path}`}]),onClick:$[2]||($[2]=K=>{w(`copy-path-${t.item.path}`),S(t.item)}),onFocus:$[3]||($[3]=K=>w(`copy-path-${t.item.path}`))},[j(v(fu),{class:"vuefinder__search-modal__item-dropdown-icon"}),g("span",null,L(v(r)("Copy Path")),1)],34),g("div",{class:Ae(["vuefinder__search-modal__item-dropdown-option",{"vuefinder__search-modal__item-dropdown-option--selected":t.selectedItemDropdownOption===`open-folder-${t.item.path}`}]),onClick:$[4]||($[4]=K=>{w(`open-folder-${t.item.path}`),b(t.item)}),onFocus:$[5]||($[5]=K=>w(`open-folder-${t.item.path}`))},[j(v(zn),{class:"vuefinder__search-modal__item-dropdown-icon"}),g("span",null,L(v(r)("Open Containing Folder")),1)],34),g("div",{class:Ae(["vuefinder__search-modal__item-dropdown-option",{"vuefinder__search-modal__item-dropdown-option--selected":t.selectedItemDropdownOption===`preview-${t.item.path}`}]),onClick:$[6]||($[6]=K=>{w(`preview-${t.item.path}`),E(t.item)}),onFocus:$[7]||($[7]=K=>w(`preview-${t.item.path}`))},[j(v(Wo),{class:"vuefinder__search-modal__item-dropdown-icon"}),g("span",null,L(v(r)("Preview")),1)],34)])],40,jD)):ue("",!0)]))],10,PD))}}),UD={key:0,class:"vuefinder__search-modal__searching"},VD={class:"vuefinder__search-modal__loading-icon"},BD={key:1,class:"vuefinder__search-modal__no-results"},HD={key:2,class:"vuefinder__search-modal__results-list"},qD={class:"vuefinder__search-modal__results-header"},xi=60,Mp=5,WD=Ce({name:"SearchResultsList",__name:"SearchResultsList",props:{searchResults:{},isSearching:{type:Boolean},selectedIndex:{},expandedPaths:{},activeDropdown:{},selectedItemDropdownOption:{},resultsEnter:{type:Boolean}},emits:["selectResultItem","selectResultItemWithDropdown","togglePathExpansion","toggleItemDropdown","update:selectedItemDropdownOption","copyPath","openContainingFolder","preview"],setup(t,{expose:e,emit:n}){const i=t,o=n,r=je(),{t:s}=r.i18n,a=In("scrollableContainer"),l=te(()=>i.searchResults.length>0),c=te(()=>i.searchResults.length),u=H(0),d=H(600),h=te(()=>i.searchResults.length*xi),m=te(()=>{const S=Math.max(0,Math.floor(u.value/xi)-Mp),b=Math.min(i.searchResults.length,Math.ceil((u.value+d.value)/xi)+Mp);return{start:S,end:b}}),f=te(()=>{const{start:S,end:b}=m.value;return i.searchResults.slice(S,b).map((E,x)=>({item:E,index:S+x,top:(S+x)*xi}))}),p=S=>{const b=S.target;u.value=b.scrollTop},_=()=>{a.value&&(d.value=a.value.clientHeight)},C=()=>{if(i.selectedIndex>=0&&a.value){const S=i.selectedIndex*xi,b=S+xi,E=a.value.scrollTop,x=a.value.clientHeight,O=E+x;let $=E;S<E?$=S:b>O&&($=b-x),$!==E&&a.value.scrollTo({top:$,behavior:"smooth"})}},w=()=>{a.value&&(a.value.scrollTop=0,u.value=0)};return et(()=>{_(),window.addEventListener("resize",_)}),Ct(()=>{window.removeEventListener("resize",_)}),$e(()=>a.value,()=>{_()}),e({scrollSelectedIntoView:C,resetScroll:w,getContainerHeight:()=>d.value,scrollTop:()=>u.value}),(S,b)=>(y(),T("div",{class:Ae(["vuefinder__search-modal__results",{"vuefinder__search-modal__results--enter":t.resultsEnter}])},[t.isSearching?(y(),T("div",UD,[g("div",VD,[j(v(Zs),{class:"vuefinder__search-modal__loading-icon"})]),g("span",null,L(v(s)("Searching...")),1)])):l.value?(y(),T("div",HD,[g("div",qD,[g("span",null,L(v(s)("Found %s results",c.value)),1)]),g("div",{ref_key:"scrollableContainer",ref:a,class:"vuefinder__search-modal__results-scrollable",onScroll:p},[g("div",{class:"vuefinder__search-modal__results-items",style:At({height:`${h.value}px`,position:"relative"})},[(y(!0),T(Ie,null,He(f.value,E=>(y(),T("div",{key:E.item.path,style:At({position:"absolute",top:`${E.top}px`,left:"0",width:"100%",height:`${xi}px`})},[j(ND,{item:E.item,index:E.index,"selected-index":t.selectedIndex,"expanded-paths":t.expandedPaths,"active-dropdown":t.activeDropdown,"selected-item-dropdown-option":t.selectedItemDropdownOption,onSelect:b[0]||(b[0]=x=>o("selectResultItem",x)),onSelectWithDropdown:b[1]||(b[1]=x=>o("selectResultItemWithDropdown",x)),onTogglePathExpansion:b[2]||(b[2]=x=>o("togglePathExpansion",x)),onToggleItemDropdown:b[3]||(b[3]=(x,O)=>o("toggleItemDropdown",x,O)),"onUpdate:selectedItemDropdownOption":b[4]||(b[4]=x=>o("update:selectedItemDropdownOption",x)),onCopyPath:b[5]||(b[5]=x=>o("copyPath",x)),onOpenContainingFolder:b[6]||(b[6]=x=>o("openContainingFolder",x)),onPreview:b[7]||(b[7]=x=>o("preview",x))},null,8,["item","index","selected-index","expanded-paths","active-dropdown","selected-item-dropdown-option"])],4))),128))],4)],544)])):(y(),T("div",BD,[g("span",null,L(v(s)("No results found")),1)]))],2))}}),KD={class:"vuefinder__search-modal"},YD={class:"vuefinder__search-modal__content"},GD={class:"vuefinder__search-modal__search-bar"},QD={class:"vuefinder__search-modal__search-location"},XD=["title"],JD=["disabled"],ZD={key:0,class:"vuefinder__search-modal__folder-selector"},e5={class:"vuefinder__search-modal__folder-selector-content"},t5={key:1,class:"vuefinder__search-modal__instructions"},n5={class:"vuefinder__search-modal__instructions-text"},wu=Ce({name:"ModalSearch",__name:"ModalSearch",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=H(null),s=H(null),a=H(null),l=Yg("",300),c=H([]),u=H(!1),d=H(-1),h=H(!1),m=H(!1),f=H(null),p=H("all"),_=H(!1),C=H(`size-${p.value}`),w=H(null),S=H(new Set),b=H(null),E=Oe(o.path),x=A=>{S.value.has(A)?S.value.delete(A):S.value.add(A)},O=(A,Q)=>{Q&&typeof Q.stopPropagation=="function"&&Q.stopPropagation(),b.value===A?b.value=null:b.value=A},$=()=>{b.value=null},K=A=>{try{const Q=A.dir||`${A.storage}://`;e.adapter.open(Q),e.modal.close(),$()}catch{n.error(i("Failed to open containing folder"))}},F=A=>{e.modal.open(cr,{storage:E?.value?.storage??"local",item:A}),$()},P=A=>{d.value=A,$()},N=A=>{d.value=A},M=async A=>{await Ko(A.path),$()};$e(l,async A=>{A.trim()?(await q(A.trim()),d.value=0):(c.value=[],u.value=!1,d.value=-1)}),$e(p,async A=>{C.value=`size-${A}`,l.value.trim()&&!m.value&&(await q(l.value.trim()),d.value=0)}),$e(_,async()=>{l.value.trim()&&!m.value&&(await q(l.value.trim()),d.value=0)});const q=async A=>{if(A){u.value=!0;try{const Q=f.value?.path||E?.value?.path,U=await e.adapter.search({path:Q,filter:A,deep:_.value,size:p.value});c.value=U||[],u.value=!1}catch(Q){n.error(Yt(Q,i("Search failed"))),c.value=[],u.value=!1}}};et(()=>{document.addEventListener("click",I),C.value=`size-${p.value}`});const le=()=>{m.value?(m.value=!1,l.value.trim()&&(q(l.value.trim()),d.value=0)):(h.value=!1,m.value=!0)},de=A=>{A&&(f.value=A)},Y=A=>{A&&(de(A),m.value=!1,l.value.trim()&&(q(l.value.trim()),d.value=0))};Ct(()=>{document.removeEventListener("click",I),s.value&&s.value.cleanup()});const I=A=>{const Q=A.target;if(h.value&&(Q.closest(".vuefinder__search-modal__dropdown")||(h.value=!1,Ge(()=>{r.value&&r.value.focus()}))),b.value){const U=Q.closest(".vuefinder__search-modal__item-dropdown"),ie=Q.closest(".vuefinder__search-modal__result-item");!U&&!ie&&$()}};return(A,Q)=>(y(),ne(nn,{class:"vuefinder__search-modal-layout"},{default:we(()=>[g("div",KD,[j(pn,{icon:v(bu),title:v(i)("Search files")},null,8,["icon","title"]),g("div",YD,[g("div",GD,[j(fD,{ref_key:"searchInputRef",ref:r,modelValue:v(l),"onUpdate:modelValue":Q[0]||(Q[0]=U=>ys(l)?l.value=U:null),"is-searching":u.value,disabled:m.value},null,8,["modelValue","is-searching","disabled"]),j($D,{ref_key:"searchOptionsDropdownRef",ref:s,visible:h.value,"onUpdate:visible":Q[1]||(Q[1]=U=>h.value=U),"size-filter":p.value,"onUpdate:sizeFilter":Q[2]||(Q[2]=U=>p.value=U),"selected-option":C.value,"onUpdate:selectedOption":Q[3]||(Q[3]=U=>C.value=U),disabled:m.value},null,8,["visible","size-filter","selected-option","disabled"])]),g("div",{class:"vuefinder__search-modal__options",onClick:Q[7]||(Q[7]=Ye(()=>{},["stop"]))},[g("div",QD,[g("button",{class:Ae(["vuefinder__search-modal__location-btn",{"vuefinder__search-modal__location-btn--open":m.value}]),onClick:Ye(le,["stop"])},[j(v(zn),{class:"vuefinder__search-modal__location-icon"}),g("span",{class:"vuefinder__search-modal__location-text",title:f.value?.path||v(E).path},L(v(Qg)(f.value?.path||v(E).path)),9,XD),Q[10]||(Q[10]=g("svg",{class:"vuefinder__search-modal__location-arrow",viewBox:"0 0 16 16",fill:"currentColor"},[g("path",{d:"M4.427 7.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 7H4.604a.25.25 0 00-.177.427z"})],-1))],2)]),g("label",{class:"vuefinder__search-modal__deep-search",onClick:Q[6]||(Q[6]=Ye(()=>{},["stop"]))},[it(g("input",{"onUpdate:modelValue":Q[4]||(Q[4]=U=>_.value=U),type:"checkbox",disabled:m.value,class:"vuefinder__search-modal__checkbox",onClick:Q[5]||(Q[5]=Ye(()=>{},["stop"]))},null,8,JD),[[Ss,_.value]]),g("span",null,L(v(i)("Include subfolders")),1)])]),m.value?(y(),T("div",ZD,[g("div",e5,[j(_u,{modelValue:f.value,"onUpdate:modelValue":[Q[8]||(Q[8]=U=>f.value=U),de],"show-pinned-folders":!0,"current-path":v(E),onSelectAndClose:Y},null,8,["modelValue","current-path"])])])):ue("",!0),!v(l).trim()&&!m.value?(y(),T("div",t5,[g("p",n5,L(v(i)("Start typing to search files. Use options to filter or include subfolders.")),1)])):ue("",!0),v(l).trim()&&!m.value?(y(),ne(WD,{key:2,ref_key:"searchResultsListRef",ref:a,"search-results":c.value,"is-searching":u.value,"selected-index":d.value,"expanded-paths":S.value,"active-dropdown":b.value,"selected-item-dropdown-option":w.value,"results-enter":!0,onSelectResultItem:P,onSelectResultItemWithDropdown:N,onTogglePathExpansion:x,onToggleItemDropdown:O,"onUpdate:selectedItemDropdownOption":Q[9]||(Q[9]=U=>w.value=U),onCopyPath:M,onOpenContainingFolder:K,onPreview:F},null,8,["search-results","is-searching","selected-index","expanded-paths","active-dropdown","selected-item-dropdown-option"])):ue("",!0)])])]),_:1}))}}),i5={props:{on:{type:String,required:!0}},setup(t,{emit:e,slots:n}){const i=je(),o=H(!1),{t:r}=i.i18n;let s=null;const a=()=>{s&&clearTimeout(s),o.value=!0,s=setTimeout(()=>{o.value=!1},2e3)};return et(()=>{i.emitter.on(t.on,a)}),Ct(()=>{s&&clearTimeout(s)}),{shown:o,t:r}}},o5=(t,e)=>{const n=t.__vccOpts||t;for(const[i,o]of e)n[i]=o;return n},r5={key:1};function s5(t,e,n,i,o,r){return y(),T("div",{class:Ae(["vuefinder__action-message",{"vuefinder__action-message--hidden":!i.shown}])},[t.$slots.default?Ve(t.$slots,"default",{key:0}):(y(),T("span",r5,L(i.t("Saved.")),1))],2)}const Fp=o5(i5,[["render",s5]]),a5=[{name:"silver",displayName:"Silver"},{name:"valorite",displayName:"Valorite"},{name:"midnight",displayName:"Midnight"},{name:"latte",displayName:"Latte"},{name:"rose",displayName:"Rose"},{name:"mythril",displayName:"Mythril"},{name:"lime",displayName:"lime"},{name:"sky",displayName:"Sky"},{name:"ocean",displayName:"Oceanic"},{name:"palenight",displayName:"Palenight"},{name:"arctic",displayName:"Arctic"},{name:"code",displayName:"Code"}],l5={class:"vuefinder__settings-modal__content"},c5={class:"vuefinder__settings-modal__main"},u5={class:"vuefinder__settings-modal__sections"},d5={key:0,class:"vuefinder__settings-modal__section"},h5={for:"theme",class:"vuefinder__settings-modal__label"},p5={class:"vuefinder__settings-modal__input-group"},f5=["value"],m5=["value"],v5={key:1,class:"vuefinder__settings-modal__section"},g5={for:"language",class:"vuefinder__settings-modal__label"},_5={class:"vuefinder__settings-modal__input-group"},y5=["value"],b5={class:"vuefinder__settings-modal__reset-section"},w5={class:"vuefinder__settings-modal__reset-content"},S5={class:"vuefinder__settings-modal__reset-title"},C5={class:"vuefinder__settings-modal__reset-description"},Zg=Ce({__name:"ModalSettings",setup(t){const e=je(),{enabled:n}=Tn(),i=e.config,{clearStore:o}=e.storage,{t:r,localeAtom:s}=e.i18n,a=Oe(s),l=te({get:()=>String(a.value||"en"),set:p=>s.set(p||"en")}),c=Oe(i.state),u=te(()=>c.value.theme||"silver"),d=async()=>{i.reset(),o(),localStorage.removeItem("vuefinder_locale"),localStorage.removeItem("vuefinder_translations"),location.reload()},h=p=>{i.set("theme",p),e.emitter.emit("vf-theme-saved")},{i18n:m}=Ao("VueFinderOptions"),f=Object.fromEntries(Object.entries({ar:"Arabic (العربيّة)",zhCN:"Chinese-Simplified (简体中文)",zhTW:"Chinese-Traditional (繁體中文)",nl:"Dutch (Nederlands)",en:"English",fr:"French (Français)",de:"German (Deutsch)",he:"Hebrew (עִברִית)",hi:"Hindi (हिंदी)",it:"Italian (Italiano)",ja:"Japanese (日本語)",fa:"Persian (فارسی)",pl:"Polish (Polski)",pt:"Portuguese (Português)",ru:"Russian (Pусский)",es:"Spanish (Español)",sv:"Swedish (Svenska)",tr:"Turkish (Türkçe)"}).filter(([p])=>Object.keys(m).includes(p)));return(p,_)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:_[2]||(_[2]=C=>v(e).modal.close())},L(v(r)("Close")),1)]),default:we(()=>[g("div",l5,[j(pn,{icon:v(Gg),title:v(r)("Settings")},null,8,["icon","title"]),g("div",c5,[g("div",u5,[v(n)("theme")?(y(),T("div",d5,[g("label",h5,[Ke(L(v(r)("Theme"))+" ",1),j(Fp,{class:"vuefinder__settings-modal__message",on:"vf-theme-saved"},{default:we(()=>[Ke(L(v(r)("Saved.")),1)]),_:1})]),g("div",p5,[g("select",{id:"theme",value:u.value,class:"vuefinder__settings-modal__select",onChange:_[0]||(_[0]=C=>h(C.target?.value))},[(y(!0),T(Ie,null,He(v(a5),C=>(y(),T("option",{key:C.name,value:C.name},L(C.displayName),9,m5))),128))],40,f5)])])):ue("",!0),Object.keys(v(f)).length>1?(y(),T("div",v5,[g("label",g5,[Ke(L(v(r)("Language"))+" ",1),j(Fp,{class:"vuefinder__settings-modal__message",on:"vf-language-saved"},{default:we(()=>[Ke(L(v(r)("Saved.")),1)]),_:1})]),g("div",_5,[it(g("select",{id:"language","onUpdate:modelValue":_[1]||(_[1]=C=>l.value=C),class:"vuefinder__settings-modal__select"},[(y(!0),T(Ie,null,He(v(f),(C,w)=>(y(),T("option",{key:w,value:w},L(C),9,y5))),128))],512),[[el,l.value]])])])):ue("",!0)]),g("div",b5,[g("div",w5,[g("div",S5,L(v(r)("Reset")),1),g("div",C5,L(v(r)("Reset all settings to default")),1)]),g("button",{type:"button",class:"vuefinder__settings-modal__reset-button",onClick:d},L(v(r)("Reset Settings")),1)])])])]),_:1}))}}),Lt={ESCAPE:"Escape",DELETE:"Delete",ENTER:"Enter",BACKSLASH:"Backslash",KEY_A:"KeyA",KEY_E:"KeyE",KEY_F:"KeyF",SPACE:"Space",KEY_C:"KeyC",KEY_X:"KeyX",KEY_V:"KeyV",KEY_S:"KeyS",KEY_R:"KeyR"};function E5(){const t=je(),e=Gt(t),n=t.fs,i=t.config,{enabled:o}=Tn(),r=Oe(n.path),s=Oe(n.selectedItems),a=l=>{if(l.code===Lt.ESCAPE&&(t.modal.close(),t.root.focus()),!t.modal.visible){if(l.metaKey&&l.code===Lt.KEY_R&&!l.shiftKey&&(t.adapter.invalidateListQuery(r.value.path),t.adapter.open(r.value.path),l.preventDefault()),l.metaKey&&l.shiftKey&&l.code===Lt.KEY_R&&o("rename")&&s.value.length===1&&(t.modal.open(Qs,{items:s.value}),l.preventDefault()),l.code===Lt.DELETE&&s.value.length!==0&&t.modal.open(Gs,{items:s.value}),l.metaKey&&l.code===Lt.BACKSLASH&&t.modal.open(Bg),l.metaKey&&l.code===Lt.KEY_F&&o("search")&&(t.modal.open(wu),l.preventDefault()),l.metaKey&&l.code===Lt.KEY_E&&(i.toggle("showTreeView"),l.preventDefault()),l.metaKey&&l.code===Lt.KEY_S&&(t.modal.open(Zg),l.preventDefault()),l.metaKey&&l.code===Lt.ENTER&&(i.toggle("fullScreen"),t.root.focus()),l.metaKey&&l.code===Lt.KEY_A&&(n.selectAll(t.selectionMode||"multiple",t),l.preventDefault()),l.code===Lt.SPACE&&s.value.length===1&&s.value[0]?.type!=="dir"&&t.modal.open(cr,{storage:n.path.get().storage,item:s.value[0]}),l.metaKey&&l.code===Lt.KEY_C&&o("copy")){if(s.value.length===0){e.error(t.i18n.t("No items selected"));return}n.setClipboard("copy",new Set(s.value.map(c=>c.path))),e.success(s.value.length===1?t.i18n.t("Item copied to clipboard"):t.i18n.t("%s items copied to clipboard",s.value.length)),l.preventDefault()}if(l.metaKey&&l.code===Lt.KEY_X&&o("copy")){if(s.value.length===0){e.error(t.i18n.t("No items selected"));return}n.setClipboard("cut",new Set(s.value.map(c=>c.path))),e.success(s.value.length===1?t.i18n.t("Item cut to clipboard"):t.i18n.t("%s items cut to clipboard",s.value.length)),l.preventDefault()}if(l.metaKey&&l.code===Lt.KEY_V&&o("copy")){if(n.getClipboard().items.size===0){e.error(t.i18n.t("No items in clipboard"));return}if(n.getClipboard().path===n.path.get().path){e.error(t.i18n.t("Cannot paste items to the same directory"));return}if(n.getClipboard().type==="cut"){t.modal.open(uo,{items:{from:Array.from(n.getClipboard().items),to:n.path.get()}}),n.clearClipboard();return}if(n.getClipboard().type==="copy"){t.modal.open(yu,{items:{from:Array.from(n.getClipboard().items),to:n.path.get()}});return}l.preventDefault()}}};et(async()=>{if(await Ge(),!t.root){console.warn("app.root is not available. Event listeners will not be attached.");return}t.root.addEventListener("keydown",a)}),bs(()=>{t.root&&t.root.removeEventListener("keydown",a)})}function x5(){const t=H(!1),e=H([]);return{isDraggingExternal:t,externalFiles:e,handleDragEnter:n=>{n.preventDefault(),n.stopPropagation();const i=n.dataTransfer?.items;i&&Array.from(i).some(o=>o.kind==="file")&&(t.value=!0,n.isExternalDrag=!0)},handleDragOver:n=>{t.value&&n.dataTransfer&&(n.dataTransfer.dropEffect="copy",n.preventDefault(),n.stopPropagation())},handleDragLeave:n=>{n.preventDefault();const i=n.currentTarget.getBoundingClientRect(),o=n.clientX,r=n.clientY;(o<i.left||o>i.right||r<i.top||r>i.bottom)&&(t.value=!1)},handleDrop:async n=>{n.preventDefault(),n.stopPropagation(),t.value=!1;const i=n.dataTransfer?.items;if(i){const o=Array.from(i).filter(r=>r.kind==="file");if(o.length>0){e.value=[];for(const r of o){const s=r.webkitGetAsEntry?.();if(s)await pu((a,l)=>{e.value.push({name:l.name,size:l.size,type:l.type,lastModified:new Date(l.lastModified),file:l})},s);else{const a=r.getAsFile();a&&e.value.push({name:a.name,size:a.size,type:a.type,lastModified:new Date(a.lastModified),file:a})}}return e.value}}return[]},clearExternalFiles:()=>{e.value=[]}}}const T5={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"};function $5(t,e){return y(),T("svg",T5,[...e[0]||(e[0]=[g("path",{d:"M12 10.5v6m3-3H9m4.06-7.19-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44z"},null,-1)])])}const e_={render:$5},k5={class:"vuefinder__new-folder-modal__content"},O5={class:"vuefinder__new-folder-modal__form"},A5={class:"vuefinder__new-folder-modal__description"},P5=["placeholder"],Su=Ce({__name:"ModalNewFolder",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=Oe(o.path),s=H(""),a=()=>{s.value!==""&&e.adapter.createFolder({path:r.value.path,name:s.value}).then(l=>{n.success(i("%s is created.",s.value)),e.fs.setFiles(l.files),e.modal.close()}).catch(l=>{n.error(Yt(l,i("Failed to create folder")))})};return(l,c)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:a},L(v(i)("Create")),1),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:c[1]||(c[1]=u=>v(e).modal.close())},L(v(i)("Cancel")),1)]),default:we(()=>[g("div",null,[j(pn,{icon:v(e_),title:v(i)("New Folder")},null,8,["icon","title"]),g("div",k5,[g("div",O5,[g("p",A5,L(v(i)("Create a new folder")),1),it(g("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>s.value=u),class:"vuefinder__new-folder-modal__input",placeholder:v(i)("Folder Name"),type:"text",autofocus:"",onKeyup:ho(a,["enter"])},null,40,P5),[[Qo,s.value]])])])])]),_:1}))}}),R5={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"};function I5(t,e){return y(),T("svg",R5,[...e[0]||(e[0]=[g("path",{d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9"},null,-1)])])}const t_={render:I5},M5={class:"vuefinder__new-file-modal__content"},F5={class:"vuefinder__new-file-modal__form"},D5={class:"vuefinder__new-file-modal__description"},L5=["placeholder"],n_=Ce({__name:"ModalNewFile",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=Oe(o.path),s=H(""),a=()=>{s.value!==""&&e.adapter.createFile({path:r.value.path,name:s.value}).then(l=>{n.success(i("%s is created.",s.value)),e.fs.setFiles(l.files),e.modal.close()}).catch(l=>{n.error(Yt(l,i("Failed to create file")))})};return(l,c)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:a},L(v(i)("Create")),1),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:c[1]||(c[1]=u=>v(e).modal.close())},L(v(i)("Cancel")),1)]),default:we(()=>[g("div",null,[j(pn,{icon:v(t_),title:v(i)("New File")},null,8,["icon","title"]),g("div",M5,[g("div",F5,[g("p",D5,L(v(i)("Create a new file")),1),it(g("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>s.value=u),class:"vuefinder__new-file-modal__input",placeholder:v(i)("File Name"),type:"text",onKeyup:ho(a,["enter"])},null,40,L5),[[Qo,s.value]])])])])]),_:1}))}}),j5={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"};function z5(t,e){return y(),T("svg",j5,[...e[0]||(e[0]=[g("path",{d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"},null,-1)])])}const i_={render:z5};function Jl(t,e=14){const n=`((?=([\\w\\W]{0,${e}}))([\\w\\W]{${e+1},})([\\w\\W]{8,}))`;return t.replace(new RegExp(n),"$2..$4")}const N5={class:"vuefinder__upload-modal__content relative"},U5={class:"vuefinder__upload-modal__target-section"},V5={class:"vuefinder__upload-modal__target-label"},B5={class:"vuefinder__upload-modal__target-container"},H5={class:"vuefinder__upload-modal__target-path"},q5={class:"vuefinder__upload-modal__target-storage"},W5={key:0,class:"vuefinder__upload-modal__target-folder"},K5={class:"vuefinder__upload-modal__target-badge"},Y5={class:"vuefinder__upload-modal__drag-hint"},G5={class:"vuefinder__upload-modal__file-list vf-scrollbar"},Q5=["textContent"],X5={class:"vuefinder__upload-modal__file-info"},J5={class:"vuefinder__upload-modal__file-name hidden md:block"},Z5={class:"vuefinder__upload-modal__file-name md:hidden"},e4={key:0,class:"ml-auto"},t4=["title","disabled","onClick"],n4={key:0,class:"py-2"},i4=["aria-expanded"],o4={key:0,class:"vuefinder__upload-actions__menu absolute right-0 bottom-full left-0 mb-2"},r4=["disabled"],s4=["aria-expanded"],a4={key:0,class:"vuefinder__upload-actions__menu"},Cu=Ce({__name:"ModalUpload",setup(t){const e=je(),{t:n}=e.i18n,i=e.fs,o=Oe(i.path),r=H(o.value),s=H(!1),a=()=>{const Y=r.value.path;if(!Y)return{storage:"local",path:""};if(Y.endsWith("://"))return{storage:Y.replace("://",""),path:""};const I=Y.split("://");return{storage:I[0]||"local",path:I[1]||""}},l=Y=>{Y&&(r.value=Y)},c=Y=>{Y&&(r.value=Y,s.value=!1)},{container:u,internalFileInput:d,internalFolderInput:h,pickFiles:m,queue:f,message:p,uploading:_,hasFilesInDropArea:C,definitions:w,openFileSelector:S,upload:b,cancel:E,remove:x,clear:O,close:$,getClassNameForEntry:K,getIconForEntry:F,addExternalFiles:P}=Wg(e.customUploader),N=()=>{b(r.value)};et(()=>{e.emitter.on("vf-external-files-dropped",Y=>{P(Y)})}),Ct(()=>{e.emitter.off("vf-external-files-dropped")});const M=H(!1),q=H(null),le=H(null),de=Y=>{if(!M.value)return;const I=Y.target,A=q.value?.contains(I)??!1,Q=le.value?.contains(I)??!1;!A&&!Q&&(M.value=!1)};return et(()=>document.addEventListener("click",de)),Ct(()=>document.removeEventListener("click",de)),(Y,I)=>(y(),ne(nn,{"show-drag-overlay":v(C),"drag-overlay-text":v(n)("Drag and drop the files/folders to here.")},{buttons:we(()=>[g("div",{ref_key:"actionsMenuMobileRef",ref:q,class:"relative mb-2 w-full sm:hidden"},[g("div",{class:Ae(["vuefinder__upload-actions","vuefinder__upload-actions--block",M.value?"vuefinder__upload-actions--ring":""])},[g("button",{type:"button",class:"vuefinder__upload-actions__main",onClick:I[3]||(I[3]=A=>v(S)())},L(v(n)("Select Files")),1),g("button",{type:"button",class:"vuefinder__upload-actions__trigger","aria-haspopup":"menu","aria-expanded":M.value?"true":"false",onClick:I[4]||(I[4]=Ye(A=>M.value=!M.value,["stop"]))},[...I[17]||(I[17]=[g("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor"},[g("path",{"fill-rule":"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z","clip-rule":"evenodd"})],-1)])],8,i4)],2),M.value?(y(),T("div",o4,[g("div",{class:"vuefinder__upload-actions__item",onClick:I[5]||(I[5]=A=>{v(S)(),M.value=!1})},L(v(n)("Select Files")),1),g("div",{class:"vuefinder__upload-actions__item",onClick:I[6]||(I[6]=A=>{v(h)?.click(),M.value=!1})},L(v(n)("Select Folders")),1),I[18]||(I[18]=g("div",{class:"vuefinder__upload-actions__separator"},null,-1)),g("div",{class:Ae(["vuefinder__upload-actions__item",v(_)?"disabled":""]),onClick:I[7]||(I[7]=A=>v(_)?null:(v(O)(!1),M.value=!1))},L(v(n)("Clear all")),3),g("div",{class:Ae(["vuefinder__upload-actions__item",v(_)?"disabled":""]),onClick:I[8]||(I[8]=A=>v(_)?null:(v(O)(!0),M.value=!1))},L(v(n)("Clear only successful")),3)])):ue("",!0)],512),g("button",{type:"button",class:"vf-btn vf-btn-primary",disabled:v(_)||!v(f).length,onClick:Ye(N,["prevent"])},L(v(n)("Upload")),9,r4),v(_)?(y(),T("button",{key:0,type:"button",class:"vf-btn vf-btn-secondary",onClick:I[9]||(I[9]=Ye((...A)=>v(E)&&v(E)(...A),["prevent"]))},L(v(n)("Cancel")),1)):(y(),T("button",{key:1,type:"button",class:"vf-btn vf-btn-secondary",onClick:I[10]||(I[10]=Ye((...A)=>v($)&&v($)(...A),["prevent"]))},L(v(n)("Close")),1)),g("div",{ref_key:"actionsMenuDesktopRef",ref:le,class:"relative mr-auto hidden sm:block"},[g("div",{class:Ae(["vuefinder__upload-actions",M.value?"vuefinder__upload-actions--ring":""])},[g("button",{ref_key:"pickFiles",ref:m,type:"button",class:"vuefinder__upload-actions__main"},L(v(n)("Select Files")),513),g("button",{type:"button",class:"vuefinder__upload-actions__trigger","aria-haspopup":"menu","aria-expanded":M.value?"true":"false",onClick:I[11]||(I[11]=Ye(A=>M.value=!M.value,["stop"]))},[...I[19]||(I[19]=[g("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor"},[g("path",{"fill-rule":"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z","clip-rule":"evenodd"})],-1)])],8,s4)],2),M.value?(y(),T("div",a4,[g("div",{class:"vuefinder__upload-actions__item",onClick:I[12]||(I[12]=A=>{v(S)(),M.value=!1})},L(v(n)("Select Files")),1),g("div",{class:"vuefinder__upload-actions__item",onClick:I[13]||(I[13]=A=>{v(h)?.click(),M.value=!1})},L(v(n)("Select Folders")),1),I[20]||(I[20]=g("div",{class:"vuefinder__upload-actions__separator"},null,-1)),g("div",{class:Ae(["vuefinder__upload-actions__item",v(_)?"disabled":""]),onClick:I[14]||(I[14]=A=>v(_)?null:(v(O)(!1),M.value=!1))},L(v(n)("Clear all")),3),g("div",{class:Ae(["vuefinder__upload-actions__item",v(_)?"disabled":""]),onClick:I[15]||(I[15]=A=>v(_)?null:(v(O)(!0),M.value=!1))},L(v(n)("Clear only successful")),3)])):ue("",!0)],512)]),default:we(()=>[g("div",null,[j(pn,{icon:v(i_),title:v(n)("Upload Files")},null,8,["icon","title"]),g("div",N5,[g("div",U5,[g("div",V5,L(v(n)("Target Directory")),1),g("div",B5,[g("div",{class:"vuefinder__upload-modal__target-display",onClick:I[0]||(I[0]=A=>s.value=!s.value)},[g("div",H5,[g("span",q5,L(a().storage)+"://",1),a().path?(y(),T("span",W5,L(a().path),1)):ue("",!0)]),g("span",K5,L(v(n)("Browse")),1)])]),g("div",{class:Ae(["vuefinder__upload-modal__tree-selector",s.value?"vuefinder__upload-modal__tree-selector--expanded":"vuefinder__upload-modal__tree-selector--collapsed"])},[j(_u,{modelValue:r.value,"onUpdate:modelValue":[I[1]||(I[1]=A=>r.value=A),l],"show-pinned-folders":!0,onSelectAndClose:c},null,8,["modelValue"])],2)]),g("div",Y5,L(v(n)("You can drag & drop files anywhere while this modal is open.")),1),g("div",{ref_key:"container",ref:u,class:"hidden"},null,512),g("div",G5,[(y(!0),T(Ie,null,He(v(f),A=>(y(),T("div",{key:A.id,class:"vuefinder__upload-modal__file-entry"},[g("span",{class:Ae(["vuefinder__upload-modal__file-icon",v(K)(A)])},[g("span",{class:"vuefinder__upload-modal__file-icon-text",textContent:L(v(F)(A))},null,8,Q5)],2),g("div",X5,[g("div",J5,L(v(Jl)(A.name,40))+" ("+L(A.size)+") ",1),g("div",Z5,L(v(Jl)(A.name,16))+" ("+L(A.size)+") ",1),g("div",{class:Ae(["vuefinder__upload-modal__file-status",v(K)(A)])},[Ke(L(A.statusName)+" ",1),A.status===v(w).QUEUE_ENTRY_STATUS.UPLOADING?(y(),T("b",e4,L(A.percent),1)):ue("",!0)],2)]),g("button",{type:"button",class:Ae(["vuefinder__upload-modal__file-remove",v(_)?"disabled":""]),title:v(n)("Delete"),disabled:v(_),onClick:Q=>v(x)(A)},[...I[16]||(I[16]=[g("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"vuefinder__upload-modal__file-remove-icon"},[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])],10,t4)]))),128)),v(f).length?ue("",!0):(y(),T("div",n4,L(v(n)("No files selected!")),1))]),v(p).length?(y(),ne(Xl,{key:0,error:"",onHidden:I[2]||(I[2]=A=>p.value="")},{default:we(()=>[Ke(L(v(p)),1)]),_:1})):ue("",!0)])]),g("input",{ref_key:"internalFileInput",ref:d,type:"file",multiple:"",class:"hidden"},null,512),g("input",{ref_key:"internalFolderInput",ref:h,type:"file",multiple:"",webkitdirectory:"",class:"hidden"},null,512)]),_:1},8,["show-drag-overlay","drag-overlay-text"]))}}),l4={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"};function c4(t,e){return y(),T("svg",l4,[...e[0]||(e[0]=[g("path",{d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m6 4.125 2.25 2.25m0 0 2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125"},null,-1)])])}const o_={render:c4},u4={class:"vuefinder__unarchive-modal__content"},d4={class:"vuefinder__unarchive-modal__items"},h4={key:0,class:"vuefinder__unarchive-modal__icon vuefinder__unarchive-modal__icon--dir",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},p4={key:1,class:"vuefinder__unarchive-modal__icon vuefinder__unarchive-modal__icon--file",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},f4={class:"vuefinder__unarchive-modal__item-name"},m4={class:"vuefinder__unarchive-modal__info"},Eu=Ce({__name:"ModalUnarchive",setup(t){const e=je(),n=Gt(e),i=e.fs,o=Oe(i.path),{t:r}=e.i18n,s=H(e.modal.data.items[0]),a=H([]),l=()=>{e.adapter.unarchive({item:s.value.path,path:o.value.path}).then(c=>{n.success(r("The file unarchived.")),e.fs.setFiles(c.files),e.modal.close()}).catch(c=>{n.error(Yt(c,r("Failed to unarchive")))})};return(c,u)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:l},L(v(r)("Unarchive")),1),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:u[0]||(u[0]=d=>v(e).modal.close())},L(v(r)("Cancel")),1)]),default:we(()=>[g("div",null,[j(pn,{icon:v(o_),title:v(r)("Unarchive")},null,8,["icon","title"]),g("div",u4,[g("div",d4,[(y(!0),T(Ie,null,He(a.value,d=>(y(),T("p",{key:d.path,class:"vuefinder__unarchive-modal__item"},[d.type==="dir"?(y(),T("svg",h4,[...u[1]||(u[1]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])])):(y(),T("svg",p4,[...u[2]||(u[2]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)])])),g("span",f4,L(d.basename),1)]))),128)),g("p",m4,L(v(r)("The archive will be unarchived at"))+" ("+L(v(o).path)+") ",1)])])])]),_:1}))}}),v4={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",viewBox:"0 0 24 24"};function g4(t,e){return y(),T("svg",v4,[...e[0]||(e[0]=[g("path",{d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125"},null,-1)])])}const r_={render:g4},_4={class:"vuefinder__archive-modal__content"},y4={class:"vuefinder__archive-modal__form"},b4={class:"vuefinder__archive-modal__files vf-scrollbar"},w4={key:0,class:"vuefinder__archive-modal__icon vuefinder__archive-modal__icon--dir",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},S4={key:1,class:"vuefinder__archive-modal__icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},C4={class:"vuefinder__archive-modal__file-name"},E4=["placeholder"],xu=Ce({__name:"ModalArchive",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=Oe(o.path),s=H(""),a=H(e.modal.data.items),l=()=>{a.value.length&&e.adapter.archive({path:r.value.path,items:a.value.map(({path:c,type:u})=>({path:c,type:u})),name:s.value}).then(c=>{n.success(i("The file(s) archived.")),e.fs.setFiles(c.files),e.modal.close()}).catch(c=>{n.error(Yt(c,i("Failed to archive files")))})};return(c,u)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:l},L(v(i)("Archive")),1),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:u[1]||(u[1]=d=>v(e).modal.close())},L(v(i)("Cancel")),1)]),default:we(()=>[g("div",null,[j(pn,{icon:v(r_),title:v(i)("Archive the files")},null,8,["icon","title"]),g("div",_4,[g("div",y4,[g("div",b4,[(y(!0),T(Ie,null,He(a.value,d=>(y(),T("p",{key:d.path,class:"vuefinder__archive-modal__file"},[d.type==="dir"?(y(),T("svg",w4,[...u[2]||(u[2]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])])):(y(),T("svg",S4,[...u[3]||(u[3]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)])])),g("span",C4,L(d.basename),1)]))),128))]),it(g("input",{"onUpdate:modelValue":u[0]||(u[0]=d=>s.value=d),class:"vuefinder__archive-modal__input",placeholder:v(i)("Archive name. (.zip file will be created)"),type:"text",onKeyup:ho(l,["enter"])},null,40,E4),[[Qo,s.value]])])])])]),_:1}))}}),x4={class:"vuefinder__about-modal__content"},T4={class:"vuefinder__about-modal__main"},$4={class:"vuefinder__about-modal__shortcuts"},k4={class:"vuefinder__about-modal__shortcut"},O4={key:0,class:"vuefinder__about-modal__shortcut"},A4={key:1,class:"vuefinder__about-modal__shortcut"},P4={class:"vuefinder__about-modal__shortcut"},R4={class:"vuefinder__about-modal__shortcut"},I4={key:2,class:"vuefinder__about-modal__shortcut"},M4={key:3,class:"vuefinder__about-modal__shortcut"},F4={key:4,class:"vuefinder__about-modal__shortcut"},D4={key:5,class:"vuefinder__about-modal__shortcut"},L4={class:"vuefinder__about-modal__shortcut"},j4={class:"vuefinder__about-modal__shortcut"},z4={key:6,class:"vuefinder__about-modal__shortcut"},N4={key:7,class:"vuefinder__about-modal__shortcut"},U4=Ce({__name:"ModalShortcuts",setup(t){const e=je(),{enabled:n}=Tn(),{t:i}=e.i18n;return(o,r)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:r[0]||(r[0]=s=>v(e).modal.close())},L(v(i)("Close")),1)]),default:we(()=>[g("div",x4,[j(pn,{icon:v(Vg),title:v(i)("Shortcuts")},null,8,["icon","title"]),g("div",T4,[g("div",$4,[g("div",k4,[g("div",null,L(v(i)("Refresh")),1),r[1]||(r[1]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"R")],-1))]),v(n)("rename")?(y(),T("div",O4,[g("div",null,L(v(i)("Rename")),1),r[2]||(r[2]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"Shift"),Ke(" + "),g("kbd",null,"R")],-1))])):ue("",!0),v(n)("delete")?(y(),T("div",A4,[g("div",null,L(v(i)("Delete")),1),r[3]||(r[3]=g("kbd",null,"Del",-1))])):ue("",!0),g("div",P4,[g("div",null,L(v(i)("Escape")),1),r[4]||(r[4]=g("kbd",null,"Esc",-1))]),g("div",R4,[g("div",null,L(v(i)("Select All")),1),r[5]||(r[5]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"A")],-1))]),v(n)("copy")?(y(),T("div",I4,[g("div",null,L(v(i)("Cut")),1),r[6]||(r[6]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"X")],-1))])):ue("",!0),v(n)("copy")?(y(),T("div",M4,[g("div",null,L(v(i)("Copy")),1),r[7]||(r[7]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"C")],-1))])):ue("",!0),v(n)("copy")?(y(),T("div",F4,[g("div",null,L(v(i)("Paste")),1),r[8]||(r[8]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"V")],-1))])):ue("",!0),v(n)("search")?(y(),T("div",D4,[g("div",null,L(v(i)("Search")),1),r[9]||(r[9]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"F")],-1))])):ue("",!0),g("div",L4,[g("div",null,L(v(i)("Toggle Sidebar")),1),r[10]||(r[10]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"E")],-1))]),g("div",j4,[g("div",null,L(v(i)("Open Settings")),1),r[11]||(r[11]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"S")],-1))]),v(n)("fullscreen")?(y(),T("div",z4,[g("div",null,L(v(i)("Toggle Full Screen")),1),r[12]||(r[12]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"Enter")],-1))])):ue("",!0),v(n)("preview")?(y(),T("div",N4,[g("div",null,L(v(i)("Preview")),1),r[13]||(r[13]=g("kbd",null,"Space",-1))])):ue("",!0)])])])]),_:1}))}}),V4={class:"vuefinder__menubar__container"},B4=["onClick","onMouseenter"],H4={class:"vuefinder__menubar__label"},q4=["onMouseenter"],W4=["onClick"],K4={key:0,class:"vuefinder__menubar__dropdown__label"},Y4={key:1,class:"vuefinder__menubar__dropdown__checkmark"},G4=Ce({__name:"MenuBar",setup(t){const e=je(),n=Gt(e),{enabled:i}=Tn(),{t:o}=e?.i18n||{t:S=>S},r=e?.fs,s=e?.config,a=Oe(s.state),l=Oe(r.selectedItems),c=Oe(r?.storages||[]),u=H(null),d=H(!1),h=te(()=>window.opener!==null||window.name!==""||window.history.length<=1),m=te(()=>[{id:"file",label:o("File"),items:[{id:"new-folder",label:o("New Folder"),action:()=>e?.modal?.open(Su,{items:l.value}),hidden:()=>!i("newfolder")},{id:"new-file",label:o("New File"),action:()=>e?.modal?.open(n_,{items:l.value}),hidden:()=>!i("newfile")},{type:"separator",hidden:()=>!i("newfolder")&&!i("newfile")||!i("upload")},{id:"upload",label:o("Upload"),action:()=>e?.modal?.open(Cu,{items:l.value}),hidden:()=>!i("upload")},{type:"separator",hidden:()=>!i("search")},{id:"search",label:o("Search"),action:()=>e.modal.open(wu),hidden:()=>!i("search")},{type:"separator",hidden:()=>!i("archive")&&!i("unarchive")},{id:"archive",label:o("Archive"),action:()=>{l.value.length>0&&e?.modal?.open(xu,{items:l.value})},enabled:()=>l.value.length>0,hidden:()=>!i("archive")},{id:"unarchive",label:o("Unarchive"),action:()=>{l.value.length===1&&l.value[0]?.mime_type==="application/zip"&&e?.modal?.open(Eu,{items:l.value})},enabled:()=>l.value.length===1&&l.value[0]?.mime_type==="application/zip",hidden:()=>!i("unarchive")},{type:"separator",hidden:()=>!i("preview")},{id:"preview",label:o("Preview"),action:()=>{l.value.length===1&&l.value[0]?.type!=="dir"&&e?.modal?.open(cr,{storage:r?.path?.get()?.storage,item:l.value[0]})},enabled:()=>l.value.length===1&&l.value[0]?.type!=="dir",hidden:()=>!i("preview")},...h.value?[{type:"separator"},{id:"exit",label:o("Exit"),action:()=>{try{window.close()}catch{}},enabled:()=>!0}]:[]]},{id:"edit",label:o("Edit"),items:[...e?.selectionMode==="multiple"?[{id:"select-all",label:o("Select All"),action:()=>r?.selectAll(e?.selectionMode||"multiple",e),enabled:()=>!0},{id:"deselect",label:o("Deselect All"),action:()=>r?.clearSelection(),enabled:()=>l.value.length>0},{type:"separator"}]:[],...i("copy")?[{id:"cut",label:o("Cut"),action:()=>{l.value.length>0&&r?.setClipboard("cut",new Set(l.value.map(S=>S.path)))},enabled:()=>l.value.length>0},{id:"copy",label:o("Copy"),action:()=>{l.value.length>0&&r?.setClipboard("copy",new Set(l.value.map(S=>S.path)))},enabled:()=>l.value.length>0},{id:"paste",label:o("Paste"),action:()=>{const S=r?.getClipboard();S?.items?.size>0&&e?.modal?.open(S.type==="cut"?uo:yu,{items:{from:Array.from(S.items),to:r?.path?.get()}})},enabled:()=>r?.getClipboard()?.items?.size>0}]:[],...i("move")?[{id:"move",label:o("Move files"),action:()=>{if(l.value.length>0){const S=e?.fs,b={storage:S?.path?.get()?.storage||"",path:S?.path?.get()?.path||"",type:"dir"};e?.modal?.open(uo,{items:{from:l.value,to:b}})}},enabled:()=>l.value.length>0},{type:"separator"}]:[],{id:"copy-path",label:o("Copy Path"),action:async()=>{if(l.value.length===1){const S=l.value[0];await Ko(S.path)}else{const S=r?.path?.get();S?.path&&await Ko(S.path)}},enabled:()=>!0},{id:"copy-download-url",label:o("Copy Download URL"),action:async()=>{if(l.value.length===1){const S=l.value[0];r?.path?.get()?.storage;const b=e?.adapter?.getDownloadUrl({path:S.path});b&&await kD(b)}},enabled:()=>l.value.length===1&&l.value[0]?.type!=="dir"},{type:"separator",hidden:()=>!i("rename")&&!i("delete")},{id:"rename",label:o("Rename"),action:()=>{l.value.length===1&&e?.modal?.open(Qs,{items:l.value})},enabled:()=>l.value.length===1,hidden:()=>!i("rename")},{id:"delete",label:o("Delete"),action:()=>{l.value.length>0&&e?.modal?.open(Gs,{items:l.value})},enabled:()=>l.value.length>0,hidden:()=>!i("delete")}]},{id:"view",label:o("View"),items:[{id:"refresh",label:o("Refresh"),action:()=>{e.adapter.invalidateListQuery(r.path.get().path),e.adapter.open(r.path.get().path)},enabled:()=>!0},{type:"separator"},{id:"grid-view",label:o("Grid View"),action:()=>s?.set("view","grid"),enabled:()=>!0,checked:()=>a.value?.view==="grid"},{id:"list-view",label:o("List View"),action:()=>s?.set("view","list"),enabled:()=>!0,checked:()=>a.value?.view==="list"},{type:"separator"},{id:"tree-view",label:o("Tree View"),action:()=>s?.toggle("showTreeView"),enabled:()=>!0,checked:()=>a.value?.showTreeView},{id:"thumbnails",label:o("Show Thumbnails"),action:()=>s?.toggle("showThumbnails"),enabled:()=>!0,checked:()=>a.value?.showThumbnails},{id:"show-hidden-files",label:o("Show Hidden Files"),action:()=>s?.toggle("showHiddenFiles"),enabled:()=>!0,checked:()=>a.value?.showHiddenFiles},{type:"separator",hidden:()=>!i("fullscreen")},{id:"fullscreen",label:o("Full Screen"),action:()=>s?.toggle("fullScreen"),enabled:()=>i("fullscreen"),checked:()=>a.value?.fullScreen,hidden:()=>!i("fullscreen")},{type:"separator"},{id:"persist-path",label:o("Persist Path"),action:()=>{s?.toggle("persist"),e.emitter.emit("vf-persist-path-saved")},enabled:()=>!0,checked:()=>a.value?.persist},{id:"metric-units",label:o("Metric Units"),action:()=>{s?.toggle("metricUnits"),e.filesize=s?.get("metricUnits")?zg:hu,e.emitter.emit("vf-metric-units-saved")},enabled:()=>!0,checked:()=>a.value?.metricUnits}]},{id:"go",label:o("Go"),items:[...i("history")?[{id:"forward",label:o("Forward"),action:()=>{r?.goForward();const S=r?.path?.get();S?.path&&e?.adapter.open(S.path)},enabled:()=>r?.canGoForward?.get()??!1},{id:"back",label:o("Back"),action:()=>{r?.goBack();const S=r?.path?.get();S?.path&&e?.adapter.open(S.path)},enabled:()=>r?.canGoBack?.get()??!1}]:[],{id:"open-containing-folder",label:o("Open containing folder"),action:()=>{const S=r?.path?.get();if(S?.breadcrumb&&S.breadcrumb.length>1){const b=S.breadcrumb[S.breadcrumb.length-2]?.path??`${S.storage}://`;e?.adapter.open(b)}},enabled:()=>{const S=r?.path?.get();return S?.breadcrumb&&S.breadcrumb.length>1}},{type:"separator"},...(c.value||[]).map(S=>({id:`storage-${S}`,label:S,action:()=>{const b=`${S}://`;e?.adapter.open(b)},enabled:()=>!0})),{type:"separator"},{id:"go-to-folder",label:o("Go to Folder"),action:async()=>{const S=prompt(o("Enter folder path:"));if(S){if(!S.includes("://")){alert(o("Invalid path format. Path must be in format: storage://path/to/folder"));return}const b=S.indexOf("://"),E=S.slice(0,b);if(!c.value||!c.value.includes(E)){alert(o('Invalid storage. Storage "%s" is not available.',E));return}try{await e?.adapter.open(S)}catch(x){const O=Yt(x,o("Failed to navigate to folder"));n.error(O),e.fs.setLoading(!1)}}},enabled:()=>!0}]},{id:"help",label:o("Help"),items:[{id:"settings",label:o("Settings"),action:()=>e?.modal?.open(Zg),enabled:()=>!0},{id:"shortcuts",label:o("Shortcuts"),action:()=>e?.modal?.open(U4),enabled:()=>!0},{id:"about",label:o("About"),action:()=>e?.modal?.open(Bg),enabled:()=>!0}]}]),f=S=>{u.value===S?_():(u.value=S,d.value=!0)},p=S=>{d.value&&(u.value=S)},_=()=>{u.value=null,d.value=!1},C=S=>{_(),S()},w=S=>{S.target.closest(".vuefinder__menubar")||_()};return et(()=>{document.addEventListener("click",w)}),Ct(()=>{document.removeEventListener("click",w)}),(S,b)=>(y(),T("div",{class:"vuefinder__menubar",onClick:b[0]||(b[0]=Ye(()=>{},["stop"]))},[g("div",V4,[(y(!0),T(Ie,null,He(m.value,E=>(y(),T("div",{key:E.id,class:Ae(["vuefinder__menubar__item",{"vuefinder__menubar__item--active":u.value===E.id}]),onClick:x=>f(E.id),onMouseenter:x=>p(E.id)},[g("span",H4,L(E.label),1),u.value===E.id?(y(),T("div",{key:0,class:"vuefinder__menubar__dropdown",onMouseenter:x=>p(E.id)},[(y(!0),T(Ie,null,He(E.items,x=>(y(),T("div",{key:x.id||x.type,class:Ae(["vuefinder__menubar__dropdown__item",{"vuefinder__menubar__dropdown__item--separator":x.type==="separator","vuefinder__menubar__dropdown__item--disabled":x.enabled&&!x.enabled(),"vuefinder__menubar__dropdown__item--checked":x.checked&&x.checked(),"vuefinder__menubar__dropdown__item--hidden":x.hidden&&x.hidden()}]),onClick:Ye(O=>x.type!=="separator"&&x.enabled&&x.enabled()?C(x.action):null,["stop"])},[x.type!=="separator"?(y(),T("span",K4,L(x.label),1)):ue("",!0),x.checked&&x.checked()?(y(),T("span",Y4," ✓ ")):ue("",!0)],10,W4))),128))],40,q4)):ue("",!0)],42,B4))),128))])]))}}),Q4={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",viewBox:"0 0 24 24"};function X4(t,e){return y(),T("svg",Q4,[...e[0]||(e[0]=[g("path",{d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"},null,-1)])])}const J4={render:X4},Z4={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"};function eL(t,e){return y(),T("svg",Z4,[...e[0]||(e[0]=[g("path",{d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"},null,-1)])])}const tL={render:eL},nL={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"};function iL(t,e){return y(),T("svg",nL,[...e[0]||(e[0]=[g("path",{d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25zm0 9.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18zM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25zm0 9.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18z"},null,-1)])])}const oL={render:iL},rL={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"};function sL(t,e){return y(),T("svg",rL,[...e[0]||(e[0]=[g("path",{d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 0 1 0 3.75H5.625a1.875 1.875 0 0 1 0-3.75"},null,-1)])])}const aL={render:sL},lL={fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function cL(t,e){return y(),T("svg",lL,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3 4a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v2.586a1 1 0 0 1-.293.707l-6.414 6.414a1 1 0 0 0-.293.707V17l-4 4v-6.586a1 1 0 0 0-.293-.707L3.293 7.293A1 1 0 0 1 3 6.586z"},null,-1)])])}const uL={render:cL},dL={class:"vuefinder__toolbar"},hL={class:"vuefinder__toolbar__actions"},pL=["title"],fL=["title"],mL=["title"],vL=["title"],gL=["title"],_L=["title"],yL=["title"],bL={class:"vuefinder__toolbar__controls"},wL=["title"],SL={class:"vuefinder__toolbar__control vuefinder__toolbar__dropdown-container"},CL=["title"],EL={class:"relative"},xL={key:0,class:"vuefinder__toolbar__filter-indicator"},TL={key:0,class:"vuefinder__toolbar__dropdown"},$L={class:"vuefinder__toolbar__dropdown-content"},kL={class:"vuefinder__toolbar__dropdown-section"},OL={class:"vuefinder__toolbar__dropdown-label"},AL={class:"vuefinder__toolbar__dropdown-row"},PL={value:"name"},RL={value:"size"},IL={value:"modified"},ML={value:""},FL={value:"asc"},DL={value:"desc"},LL={class:"vuefinder__toolbar__dropdown-section"},jL={class:"vuefinder__toolbar__dropdown-label"},zL={class:"vuefinder__toolbar__dropdown-options"},NL={class:"vuefinder__toolbar__dropdown-option"},UL={class:"vuefinder__toolbar__option-text"},VL={class:"vuefinder__toolbar__dropdown-option"},BL={class:"vuefinder__toolbar__option-text"},HL={class:"vuefinder__toolbar__dropdown-option"},qL={class:"vuefinder__toolbar__option-text"},WL={class:"vuefinder__toolbar__dropdown-toggle"},KL={for:"showHidden",class:"vuefinder__toolbar__toggle-label"},YL={class:"vuefinder__toolbar__dropdown-reset"},GL=["title"],QL=["title"],XL=Ce({name:"VfToolbar",__name:"Toolbar",setup(t){const e=je(),{enabled:n}=Tn(),{t:i}=e.i18n,o=e.fs,r=e.config,s=Oe(r.state),a=Oe(o.selectedItems),l=Oe(o.sort),c=Oe(o.filter);$e(()=>s.value.fullScreen,()=>{const _=document.querySelector("body");_&&(_.style.overflow=s.value.fullScreen?"hidden":"")},{immediate:!0});const u=H(!1),d=_=>{_.target.closest(".vuefinder__toolbar__dropdown-container")||(u.value=!1)};et(()=>{const _=document.querySelector("body");_&&s.value.fullScreen&&setTimeout(()=>_.style.overflow="hidden"),document.addEventListener("click",d)}),Ct(()=>{document.removeEventListener("click",d)});const h=H({sortBy:"name",sortOrder:"",filterKind:"all",showHidden:s.value.showHiddenFiles});$e(()=>h.value.sortBy,_=>{if(!h.value.sortOrder){o.clearSort();return}_==="name"?o.setSort("basename",h.value.sortOrder):_==="size"?o.setSort("file_size",h.value.sortOrder):_==="modified"&&o.setSort("last_modified",h.value.sortOrder)}),$e(()=>h.value.sortOrder,_=>{if(!_){o.clearSort();return}h.value.sortBy==="name"?o.setSort("basename",_):h.value.sortBy==="size"?o.setSort("file_size",_):h.value.sortBy==="modified"&&o.setSort("last_modified",_)}),$e(l,_=>{_.active?(_.column==="basename"?h.value.sortBy="name":_.column==="file_size"?h.value.sortBy="size":_.column==="last_modified"&&(h.value.sortBy="modified"),h.value.sortOrder=_.order):h.value.sortOrder=""},{immediate:!0}),$e(()=>h.value.filterKind,_=>{o.setFilter(_,s.value.showHiddenFiles)}),$e(()=>h.value.showHidden,_=>{r.set("showHiddenFiles",_),o.setFilter(h.value.filterKind,_)}),$e(c,_=>{h.value.filterKind=_.kind},{immediate:!0}),$e(()=>s.value.showHiddenFiles,_=>{h.value.showHidden=_,o.setFilter(h.value.filterKind,_)},{immediate:!0});const m=()=>r.set("view",s.value.view==="grid"?"list":"grid"),f=te(()=>c.value.kind!=="all"||!s.value.showHiddenFiles||l.value.active),p=()=>{h.value={sortBy:"name",sortOrder:"",filterKind:"all",showHidden:!0},r.set("showHiddenFiles",!0),o.clearSort(),o.clearFilter()};return(_,C)=>(y(),T("div",dL,[g("div",hL,[v(n)("newfolder")?(y(),T("div",{key:0,class:"mx-1.5",title:v(i)("New Folder"),onClick:C[0]||(C[0]=w=>v(e).modal.open(Su,{items:v(a)}))},[j(v(e_))],8,pL)):ue("",!0),v(n)("newfile")?(y(),T("div",{key:1,class:"mx-1.5",title:v(i)("New File"),onClick:C[1]||(C[1]=w=>v(e).modal.open(n_,{items:v(a)}))},[j(v(t_))],8,fL)):ue("",!0),v(n)("rename")?(y(),T("div",{key:2,class:"mx-1.5",title:v(i)("Rename"),onClick:C[2]||(C[2]=w=>v(a).length!==1||v(e).modal.open(Qs,{items:v(a)}))},[j(v(qg),{class:Ae(v(a).length===1?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,mL)):ue("",!0),v(n)("delete")?(y(),T("div",{key:3,class:"mx-1.5",title:v(i)("Delete"),onClick:C[3]||(C[3]=w=>!v(a).length||v(e).modal.open(Gs,{items:v(a)}))},[j(v(Hg),{class:Ae(v(a).length?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,vL)):ue("",!0),v(n)("upload")?(y(),T("div",{key:4,class:"mx-1.5",title:v(i)("Upload"),onClick:C[4]||(C[4]=w=>v(e).modal.open(Cu,{items:v(a)}))},[j(v(i_))],8,gL)):ue("",!0),v(n)("unarchive")&&v(a).length===1&&v(a)[0].mime_type==="application/zip"?(y(),T("div",{key:5,class:"mx-1.5",title:v(i)("Unarchive"),onClick:C[5]||(C[5]=w=>!v(a).length||v(e).modal.open(Eu,{items:v(a)}))},[j(v(o_),{class:Ae(v(a).length?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,_L)):ue("",!0),v(n)("archive")?(y(),T("div",{key:6,class:"mx-1.5",title:v(i)("Archive"),onClick:C[6]||(C[6]=w=>!v(a).length||v(e).modal.open(xu,{items:v(a)}))},[j(v(r_),{class:Ae(v(a).length?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,yL)):ue("",!0)]),g("div",bL,[v(n)("search")?(y(),T("div",{key:0,class:"mx-1.5",title:v(i)("Search Files"),onClick:C[7]||(C[7]=w=>v(e).modal.open(wu))},[j(v(bu),{class:"vf-toolbar-icon text-(--vf-bg-primary)"})],8,wL)):ue("",!0),g("div",SL,[g("div",{title:v(i)("Filter"),class:"vuefinder__toolbar__dropdown-trigger",onClick:C[8]||(C[8]=w=>u.value=!u.value)},[g("div",EL,[j(v(uL),{class:"vf-toolbar-icon vuefinder__toolbar__icon h-6 w-6"}),f.value?(y(),T("div",xL)):ue("",!0)])],8,CL),u.value?(y(),T("div",TL,[g("div",$L,[g("div",kL,[g("div",OL,L(v(i)("Sorting")),1),g("div",AL,[it(g("select",{"onUpdate:modelValue":C[9]||(C[9]=w=>h.value.sortBy=w),class:"vuefinder__toolbar__dropdown-select"},[g("option",PL,L(v(i)("Name")),1),g("option",RL,L(v(i)("Size")),1),g("option",IL,L(v(i)("Date")),1)],512),[[el,h.value.sortBy]]),it(g("select",{"onUpdate:modelValue":C[10]||(C[10]=w=>h.value.sortOrder=w),class:"vuefinder__toolbar__dropdown-select"},[g("option",ML,L(v(i)("None")),1),g("option",FL,L(v(i)("Asc")),1),g("option",DL,L(v(i)("Desc")),1)],512),[[el,h.value.sortOrder]])])]),g("div",LL,[g("div",jL,L(v(i)("Show")),1),g("div",zL,[g("label",NL,[it(g("input",{"onUpdate:modelValue":C[11]||(C[11]=w=>h.value.filterKind=w),type:"radio",name:"filterKind",value:"all",class:"vuefinder__toolbar__radio"},null,512),[[ea,h.value.filterKind]]),g("span",UL,L(v(i)("All items")),1)]),g("label",VL,[it(g("input",{"onUpdate:modelValue":C[12]||(C[12]=w=>h.value.filterKind=w),type:"radio",name:"filterKind",value:"files",class:"vuefinder__toolbar__radio"},null,512),[[ea,h.value.filterKind]]),g("span",BL,L(v(i)("Files only")),1)]),g("label",HL,[it(g("input",{"onUpdate:modelValue":C[13]||(C[13]=w=>h.value.filterKind=w),type:"radio",name:"filterKind",value:"folders",class:"vuefinder__toolbar__radio"},null,512),[[ea,h.value.filterKind]]),g("span",qL,L(v(i)("Folders only")),1)])])]),g("div",WL,[g("label",KL,L(v(i)("Show hidden files")),1),it(g("input",{id:"showHidden","onUpdate:modelValue":C[14]||(C[14]=w=>h.value.showHidden=w),type:"checkbox",class:"vuefinder__toolbar__checkbox"},null,512),[[Ss,h.value.showHidden]])]),g("div",YL,[g("button",{class:"vuefinder__toolbar__reset-button",onClick:p},L(v(i)("Reset")),1)])])])):ue("",!0)]),v(n)("fullscreen")?(y(),T("div",{key:1,class:"mx-1.5",title:v(i)("Toggle Full Screen"),onClick:C[15]||(C[15]=w=>v(r).toggle("fullScreen"))},[v(s).fullScreen?(y(),ne(v(tL),{key:0,class:"vf-toolbar-icon"})):(y(),ne(v(J4),{key:1,class:"vf-toolbar-icon"}))],8,GL)):ue("",!0),g("div",{class:"mx-1.5",title:v(i)("Change View"),onClick:C[16]||(C[16]=w=>m())},[v(s).view==="grid"?(y(),ne(v(oL),{key:0,class:"vf-toolbar-icon"})):ue("",!0),v(s).view==="list"?(y(),ne(v(aL),{key:1,class:"vf-toolbar-icon"})):ue("",!0)],8,QL)])]))}}),JL={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"vuefinder__breadcrumb__refresh-icon",viewBox:"-40 -40 580 580"};function ZL(t,e){return y(),T("svg",JL,[...e[0]||(e[0]=[g("path",{d:"M463.5 224h8.5c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2S461.9 48.1 455 55l-41.6 41.6c-87.6-86.5-228.7-86.2-315.8 1-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2S334.3 224 344 224z"},null,-1)])])}const ej={render:ZL},tj={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-6 w-6 p-0.5 rounded",viewBox:"0 0 20 20"};function nj(t,e){return y(),T("svg",tj,[...e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M5.293 9.707a1 1 0 0 1 0-1.414l4-4a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1-1.414 1.414L11 7.414V15a1 1 0 1 1-2 0V7.414L6.707 9.707a1 1 0 0 1-1.414 0",class:"pointer-events-none","clip-rule":"evenodd"},null,-1)])])}const ij={render:nj},oj={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"vuefinder__breadcrumb__close-icon",viewBox:"0 0 24 24"};function rj(t,e){return y(),T("svg",oj,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"},null,-1)])])}const sj={render:rj},aj={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"};function lj(t,e){return y(),T("svg",aj,[...e[0]||(e[0]=[g("path",{d:"M10.707 2.293a1 1 0 0 0-1.414 0l-7 7a1 1 0 0 0 1.414 1.414L4 10.414V17a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-6.586l.293.293a1 1 0 0 0 1.414-1.414z",class:"pointer-events-none"},null,-1)])])}const cj={render:lj},uj={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"w-6 h-6 cursor-pointer",viewBox:"0 0 24 24"};function dj(t,e){return y(),T("svg",uj,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"},null,-1)])])}const hj={render:dj},pj={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"};function fj(t,e){return y(),T("svg",pj,[...e[0]||(e[0]=[g("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M9 6h11M12 12h8M15 18h5M5 6v.01M8 12v.01M11 18v.01"},null,-1)])])}const mj={render:fj},vj={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function gj(t,e){return y(),T("svg",vj,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7h12m0 0-4-4m4 4-4 4m0 6H4m0 0 4 4m-4-4 4-4"},null,-1)])])}const _j={render:gj};function ur(t,e=[]){const n="vfDragEnterCounter",i=t.fs,o=Oe(i.selectedItems);function r(d,h){return!!(!d||d.type!=="dir"||d.path.startsWith(h)||o.value.some(m=>m.path===h?!1:!!d.path.startsWith(m.path)))}function s(d,h){if(d.isExternalDrag)return;if(!(t.features?.move??!1)){d.dataTransfer&&(d.dataTransfer.dropEffect="none",d.dataTransfer.effectAllowed="none");return}d.preventDefault();const m=i.getDraggedItem();r(h,m)?d.dataTransfer&&(d.dataTransfer.dropEffect="none",d.dataTransfer.effectAllowed="none"):(d.dataTransfer&&(d.dataTransfer.dropEffect="copy",d.dataTransfer.effectAllowed="all"),d.currentTarget.classList.add(...e))}function a(d){if(d.isExternalDrag||!(t.features?.move??!1))return;d.preventDefault();const h=d.currentTarget,m=Number(h.dataset[n]||0);h.dataset[n]=String(m+1)}function l(d){if(d.isExternalDrag||!(t.features?.move??!1))return;d.preventDefault();const h=d.currentTarget,m=Number(h.dataset[n]||0)-1;m<=0?(delete h.dataset[n],h.classList.remove(...e)):h.dataset[n]=String(m)}function c(d,h){if(d.isExternalDrag||!(t.features?.move??!1)||!h)return;d.preventDefault();const m=d.currentTarget;delete m.dataset[n],m.classList.remove(...e);const f=d.dataTransfer?.getData("items")||"[]",p=JSON.parse(f).map(_=>i.sortedFiles.get().find(C=>C.path===_));i.clearDraggedItem(),t.modal.open(uo,{items:{from:p,to:h}})}function u(d){return{dragover:h=>s(h,d),dragenter:a,dragleave:l,drop:h=>c(h,d)}}return{events:u}}const yj={class:"vuefinder__breadcrumb__container"},bj=["title"],wj=["title"],Sj=["title"],Cj=["title"],Ej={class:"vuefinder__breadcrumb__path-container"},xj={class:"vuefinder__breadcrumb__list"},Tj={key:0,class:"vuefinder__breadcrumb__hidden-list"},$j={class:"relative"},kj=["title","onClick"],Oj=["title"],Aj={class:"vuefinder__breadcrumb__path-mode"},Pj={class:"vuefinder__breadcrumb__path-mode-content"},Rj=["title"],Ij={class:"vuefinder__breadcrumb__path-text"},Mj=["title"],Fj=["data-theme"],Dj=["onClick"],Lj={class:"vuefinder__breadcrumb__hidden-item-content"},jj={class:"vuefinder__breadcrumb__hidden-item-text"},zj=Ce({__name:"Breadcrumb",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=e.config,s=Oe(r.state),a=Oe(o.path),l=Oe(o.loading),c=H(null),u=Yg(0,100),d=H(5),h=H(!1),m=H(!1),f=te(()=>a.value?.breadcrumb??[]);function p(Y,I){return Y.length>I?[Y.slice(-I),Y.slice(0,-I)]:[Y,[]]}const _=te(()=>p(f.value,d.value)[0]),C=te(()=>p(f.value,d.value)[1]);$e(u,()=>{if(!c.value)return;const Y=c.value.children;let I=0,A=0;const Q=5,U=1;d.value=Q,Ge(()=>{for(let ie=Y.length-1;ie>=0;ie--){const ve=Y[ie];if(I+ve.offsetWidth>u.value-40)break;I+=parseInt(ve.offsetWidth.toString(),10),A++}A<U&&(A=U),A>Q&&(A=Q),d.value=A})});const w=()=>{c.value&&(u.value=c.value.offsetWidth)},S=H(null);et(()=>{S.value=new ResizeObserver(w),c.value&&S.value.observe(c.value)}),Ct(()=>{S.value&&S.value.disconnect()});const b=ur(e,["vuefinder__drag-over"]);function E(Y=null){Y??=f.value.length-2;const I={basename:a.value?.storage??"local",extension:"",path:(a.value?.storage??"local")+"://",storage:a.value?.storage??"local",type:"dir",file_size:null,last_modified:null,mime_type:null,visibility:""};return f.value[Y]??I}const x=()=>{e.adapter.invalidateListQuery(a.value.path),e.adapter.open(a.value.path)},O=()=>{_.value.length>0&&e.adapter.open(f.value[f.value.length-2]?.path??(a.value?.storage??"local")+"://")},$=Y=>{e.adapter.open(Y.path),h.value=!1},K=()=>{h.value&&(h.value=!1)},F={mounted(Y,I){Y.clickOutsideEvent=function(A){Y===A.target||Y.contains(A.target)||I.value()},document.body.addEventListener("click",Y.clickOutsideEvent)},beforeUnmount(Y){document.body.removeEventListener("click",Y.clickOutsideEvent)}},P=()=>{r.toggle("showTreeView")},N=H({x:0,y:0}),M=(Y,I=null)=>{if(Y.currentTarget instanceof HTMLElement){const{x:A,y:Q,height:U}=Y.currentTarget.getBoundingClientRect();N.value={x:A,y:Q+U}}h.value=I??!h.value},q=()=>{m.value=!m.value},le=async()=>{await Ko(a.value?.path||""),n.success(i("Path copied to clipboard"))},de=()=>{m.value=!1};return(Y,I)=>(y(),T("div",yj,[g("span",{title:v(i)("Toggle Tree View")},[j(v(mj),{class:Ae(["vuefinder__breadcrumb__toggle-tree",v(s).showTreeView?"vuefinder__breadcrumb__toggle-tree--active":""]),onClick:P},null,8,["class"])],8,bj),g("span",{title:v(i)("Go up a directory")},[j(v(ij),We({class:f.value.length?"vuefinder__breadcrumb__go-up--active":"vuefinder__breadcrumb__go-up--inactive"},bn(f.value.length?v(b).events(E()):{}),{onClick:O}),null,16,["class"])],8,wj),v(o).isLoading()?(y(),T("span",{key:1,title:v(i)("Cancel")},[j(v(sj),{onClick:I[0]||(I[0]=A=>v(e).emitter.emit("vf-fetch-abort"))})],8,Cj)):(y(),T("span",{key:0,title:v(i)("Refresh")},[j(v(ej),{onClick:x})],8,Sj)),it(g("div",Ej,[g("div",null,[j(v(cj),We({class:"vuefinder__breadcrumb__home-icon"},bn(v(b).events(E(-1))),{onClick:I[1]||(I[1]=Ye(A=>v(e).adapter.open(v(a).storage+"://"),["stop"]))}),null,16)]),g("div",xj,[C.value.length?it((y(),T("div",Tj,[I[3]||(I[3]=g("div",{class:"vuefinder__breadcrumb__separator"},"/",-1)),g("div",$j,[g("span",{class:"vuefinder__breadcrumb__hidden-toggle",onDragenter:I[2]||(I[2]=A=>M(A,!0)),onClick:Ye(M,["stop"])},[j(v(Jg),{class:"vuefinder__breadcrumb__hidden-toggle-icon"})],32)])])),[[F,K]]):ue("",!0)]),g("div",{ref_key:"breadcrumbContainer",ref:c,class:"vuefinder__breadcrumb__visible-list pointer-events-none"},[(y(!0),T(Ie,null,He(_.value,(A,Q)=>(y(),T("div",{key:Q},[I[4]||(I[4]=g("span",{class:"vuefinder__breadcrumb__separator"},"/",-1)),g("span",We({class:"vuefinder__breadcrumb__item pointer-events-auto",title:A.basename},bn(v(b).events(A),!0),{onClick:Ye(U=>v(e).adapter.open(A.path),["stop"])}),L(A.name),17,kj)]))),128))],512),v(r).get("loadingIndicator")==="circular"&&v(l)?(y(),ne(v(Zs),{key:0})):ue("",!0),g("span",{title:v(i)("Toggle Path Copy Mode"),onClick:q},[j(v(_j),{class:"vuefinder__breadcrumb__toggle-icon"})],8,Oj)],512),[[Sn,!m.value]]),it(g("div",Aj,[g("div",Pj,[g("div",{title:v(i)("Copy Path")},[j(v(fu),{class:"vuefinder__breadcrumb__copy-icon",onClick:le})],8,Rj),g("div",Ij,L(v(a).path),1),g("div",{title:v(i)("Exit")},[j(v(hj),{class:"vuefinder__breadcrumb__exit-icon",onClick:de})],8,Mj)])],512),[[Sn,m.value]]),(y(),ne(ws,{to:"body"},[g("div",null,[it(g("div",{style:At({position:"absolute",top:N.value.y+"px",left:N.value.x+"px"}),class:"vuefinder__themer vuefinder__breadcrumb__hidden-dropdown","data-theme":v(e).theme.current},[(y(!0),T(Ie,null,He(C.value,(A,Q)=>(y(),T("div",We({key:Q,class:"vuefinder__breadcrumb__hidden-item"},bn(v(b).events(A),!0),{onClick:U=>$(A)}),[g("div",Lj,[g("span",null,[j(v(zn),{class:"vuefinder__breadcrumb__hidden-item-icon"})]),g("span",jj,L(A.name),1)])],16,Dj))),128))],12,Fj),[[Sn,h.value]])])]))]))}}),Nj={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function Uj(t,e){return y(),T("svg",Nj,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 0 0 2-2V9.414a1 1 0 0 0-.293-.707l-5.414-5.414A1 1 0 0 0 12.586 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2"},null,-1)])])}const Dp={render:Uj},Vj={class:"vuefinder__drag-item__container"},Bj={class:"vuefinder__drag-item__count"},Hj=Ce({__name:"DragItem",props:{count:{}},setup(t){const e=t;return(n,i)=>(y(),T("div",Vj,[e.count>1?(y(),ne(v(Dp),{key:0,class:"vuefinder__drag-item__icon translate-x-1 translate-y-1"})):ue("",!0),j(v(Dp),{class:"vuefinder__drag-item__icon"}),g("div",Bj,L(e.count),1)]))}}),qj={key:2,class:"vuefinder__item-icon__extension"},Lp=Ce({__name:"ItemIcon",props:{item:{},ext:{type:Boolean},small:{type:Boolean},view:{}},setup(t){const e=t,n=je(),i=Oe(n.config.state),o=te(()=>e.small!==void 0?e.small?"small":"large":e.view==="list"?"small":"large"),r=te(()=>{const a=o.value,l=i.value?.listIconSize,c=i.value?.gridIconSize;return i.value?.gridItemWidth,i.value?.gridItemHeight,e.view==="list"||a==="small"?{"--vf-icon-size":`${l??16}px`}:{"--vf-icon-size":`${c??48}px`}}),s={app:n,config:i.value,item:e.item,view:e.view};return(a,l)=>(y(),T("div",{class:Ae(["vuefinder__item-icon",{"vuefinder__item-icon--small":o.value==="small","vuefinder__item-icon--large":o.value==="large","vuefinder__item-icon--grid":t.view==="grid","vuefinder__item-icon--list":t.view==="list"}]),style:At(r.value)},[Ve(a.$slots,"icon",wn(Jn(s)),()=>[t.item.type==="dir"?(y(),ne(v(zn),{key:0,class:"vuefinder__item-icon__folder"})):(y(),ne(v(Wo),{key:1,class:"vuefinder__item-icon__file"})),t.ext&&t.item.type!=="dir"&&t.item.extension?(y(),T("div",qj,L(t.item.extension.substring(0,3)),1)):ue("",!0)])],6))}}),Wj={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"};function Kj(t,e){return y(),T("svg",Wj,[...e[0]||(e[0]=[g("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M12 2a5 5 0 0 1 5 5v3a3 3 0 0 1 3 3v6a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3v-6a3 3 0 0 1 3-3V7a5 5 0 0 1 5-5m0 12a2 2 0 0 0-1.995 1.85L10 16a2 2 0 1 0 2-2m0-10a3 3 0 0 0-3 3v3h6V7a3 3 0 0 0-3-3"},null,-1)])])}const jp={render:Kj},Yj=["data-key","data-row","data-col","draggable"],Gj={key:0},Qj={class:"vuefinder__explorer__item-grid-content"},Xj=["data-src","alt"],Jj={class:"vuefinder__explorer__item-title"},Zj={key:1,class:"vuefinder__explorer__item-list-content"},e3={class:"vuefinder__explorer__item-list-name"},t3={class:"vuefinder__explorer__item-list-icon"},n3={class:"vuefinder__explorer__item-name"},i3={key:0,class:"vuefinder__explorer__item-path"},o3={key:1,class:"vuefinder__explorer__item-size"},r3={key:0},s3={key:2,class:"vuefinder__explorer__item-date"},a3=Ce({__name:"FileItem",props:{item:{},view:{},showThumbnails:{type:Boolean},isSelected:{type:Boolean},isDragging:{type:Boolean},rowIndex:{},colIndex:{},showPath:{type:Boolean},explorerId:{}},emits:["click","dblclick","contextmenu","dragstart","dragend"],setup(t,{emit:e}){const n=t,i=e,o=je(),r=o.fs,s=o.config,a=te(()=>{const P=o.selectionFilterType;return!P||P==="both"?!0:P==="files"&&n.item.type==="file"||P==="dirs"&&n.item.type==="dir"}),l=te(()=>{const P=o.selectionFilterMimeIncludes;return!P||!P.length||n.item.type==="dir"?!0:n.item.mime_type?P.some(N=>n.item.mime_type?.startsWith(N)):!1}),c=te(()=>a.value&&l.value),u=te(()=>["file-item-"+n.explorerId,n.view==="grid"?"vf-explorer-item-grid":"vf-explorer-item-list",n.isSelected?"vf-explorer-selected":"",c.value?"":"vf-explorer-item--unselectable"]),d=te(()=>({opacity:n.isDragging||r.isCut(n.item.path)||!c.value?.5:""})),h=H(null);let m=!1,f=null,p=null,_=!1;const{enabled:C}=Tn(),w=typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0),S=te(()=>w?!1:C("move")),b=()=>{f&&(clearTimeout(f),f=null),p=null},E=P=>{b(),p=P,_=!1,P.stopPropagation(),f=setTimeout(()=>{!p||f===null||(_=!0,p.cancelable&&p.preventDefault(),p.stopPropagation(),i("contextmenu",p),b())},500)},x=P=>{if(_){P.preventDefault(),P.stopPropagation(),b();return}setTimeout(()=>{_||(b(),F(P))},100)},O=P=>{if(!p)return;const N=p.touches[0]||p.changedTouches[0],M=P.touches[0]||P.changedTouches[0];if(N&&M){const q=Math.abs(M.clientX-N.clientX),le=Math.abs(M.clientY-N.clientY);(q>15||le>15)&&b()}},$=P=>{w&&P.type!=="click"||i("click",P)},K=P=>{if(_)return P.preventDefault(),P.stopPropagation(),!1;i("dragstart",P)},F=P=>{if(!m)m=!0,i("click",P),h.value=setTimeout(()=>{m=!1},300);else return m=!1,i("dblclick",P),!1};return(P,N)=>(y(),T("div",{class:Ae(u.value),style:At(d.value),"data-key":t.item.path,"data-row":t.rowIndex,"data-col":t.colIndex,draggable:S.value,onTouchstartCapture:N[1]||(N[1]=M=>E(M)),onTouchendCapture:N[2]||(N[2]=M=>x(M)),onTouchmoveCapture:O,onTouchcancelCapture:N[3]||(N[3]=()=>b()),onClick:$,onDblclick:N[4]||(N[4]=M=>i("dblclick",M)),onContextmenu:N[5]||(N[5]=Ye(M=>i("contextmenu",M),["prevent","stop"])),onDragstart:K,onDragend:N[6]||(N[6]=M=>i("dragend",M))},[t.view==="grid"?(y(),T("div",Gj,[v(r).isReadOnly(t.item)?(y(),ne(v(jp),{key:0,class:"vuefinder__item--readonly vuefinder__item--readonly--left",title:"Read Only"})):ue("",!0),g("div",Qj,[(t.item.mime_type??"").startsWith("image")&&t.showThumbnails?(y(),T("img",{key:0,src:"data:image/png;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",class:"vuefinder__explorer__item-thumbnail lazy","data-src":t.item.previewUrl??v(o).adapter.getPreviewUrl({path:t.item.path}),alt:t.item.basename,onTouchstart:N[0]||(N[0]=M=>M.preventDefault())},null,40,Xj)):(y(),ne(Lp,{key:1,item:t.item,ext:!0,view:t.view},{icon:we(M=>[Ve(P.$slots,"icon",wn(Jn(M)))]),_:3},8,["item","view"]))]),g("span",Jj,L(v(Jl)(t.item.basename)),1)])):(y(),T("div",Zj,[g("div",e3,[g("div",t3,[j(Lp,{item:t.item,view:t.view},{icon:we(M=>[Ve(P.$slots,"icon",wn(Jn(M)))]),_:3},8,["item","view"])]),g("span",n3,L(t.item.basename),1),g("div",null,[v(r).isReadOnly(t.item)?(y(),ne(v(jp),{key:0,class:"vuefinder__item--readonly vuefinder__item--readonly--list",title:"Read Only"})):ue("",!0)])]),t.showPath?(y(),T("div",i3,L(t.item.path),1)):ue("",!0),t.showPath?ue("",!0):(y(),T("div",o3,[t.item.file_size?(y(),T("div",r3,L(v(o).filesize(t.item.file_size)),1)):ue("",!0)])),!t.showPath&&t.item.last_modified?(y(),T("div",s3,L(new Date(t.item.last_modified*1e3).toLocaleString()),1)):ue("",!0)])),v(C)("pinned")&&v(s).get("pinnedFolders").find(M=>M.path===t.item.path)?(y(),ne(v(mu),{key:2,class:"vuefinder__item--pinned"})):ue("",!0)],46,Yj))}}),l3=["data-row"],zp=Ce({__name:"FileRow",props:{rowIndex:{},rowHeight:{},view:{},itemsPerRow:{},items:{},showThumbnails:{type:Boolean},showPath:{type:Boolean},isDraggingItem:{type:Function},isSelected:{type:Function},dragNDropEvents:{type:Function},explorerId:{}},emits:["click","dblclick","contextmenu","dragstart","dragend"],setup(t,{emit:e}){const n=t,i=e,o=te(()=>[n.view==="grid"?"vf-explorer-item-grid-row":"vf-explorer-item-list-row","pointer-events-none"]),r=te(()=>({position:"absolute",top:0,left:0,width:"100%",height:`${n.rowHeight}px`,transform:`translateY(${n.rowIndex*n.rowHeight}px)`})),s=te(()=>n.view==="grid"?{gridTemplateColumns:`repeat(${n.itemsPerRow||1}, 1fr)`}:{gridTemplateColumns:"1fr"});return(a,l)=>(y(),T("div",{class:Ae(o.value),"data-row":t.rowIndex,style:At(r.value)},[g("div",{class:Ae(["grid justify-self-start",{"w-full":t.view==="list"}]),style:At(s.value)},[(y(!0),T(Ie,null,He(t.items,(c,u)=>(y(),ne(a3,We({key:c.path,item:c,view:t.view,"show-thumbnails":t.showThumbnails,"show-path":t.showPath,"is-selected":t.isSelected(c.path),"is-dragging":t.isDraggingItem(c.path),"row-index":t.rowIndex,"col-index":u,"explorer-id":t.explorerId},bn(t.dragNDropEvents(c)),{onClick:l[0]||(l[0]=d=>i("click",d)),onDblclick:l[1]||(l[1]=d=>i("dblclick",d)),onContextmenu:l[2]||(l[2]=d=>i("contextmenu",d)),onDragstart:l[3]||(l[3]=d=>i("dragstart",d)),onDragend:l[4]||(l[4]=d=>i("dragend",d))}),{icon:we(d=>[Ve(a.$slots,"icon",We({ref_for:!0},d))]),_:3},16,["item","view","show-thumbnails","show-path","is-selected","is-dragging","row-index","col-index","explorer-id"]))),128))],6)],14,l3))}}),c3={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"};function u3(t,e){return y(),T("svg",c3,[...e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 0 1 1.414 0L10 10.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 0-1.414","clip-rule":"evenodd"},null,-1)])])}const d3={render:u3},h3={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"};function p3(t,e){return y(),T("svg",h3,[...e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 0 1-1.414 0L10 9.414l-3.293 3.293a1 1 0 0 1-1.414-1.414l4-4a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1 0 1.414","clip-rule":"evenodd"},null,-1)])])}const f3={render:p3},Xa=Ce({__name:"SortIcon",props:{direction:{}},setup(t){return(e,n)=>(y(),T("div",null,[t.direction==="asc"?(y(),ne(v(d3),{key:0,class:"vuefinder__explorer__sort-icon"})):ue("",!0),t.direction==="desc"?(y(),ne(v(f3),{key:1,class:"vuefinder__explorer__sort-icon"})):ue("",!0)]))}}),m3={class:"vuefinder__explorer__header"},v3=Ce({__name:"ExplorerHeader",setup(t){const e=je(),n=e.fs,{t:i}=e.i18n,o=Oe(n.sort);return(r,s)=>(y(),T("div",m3,[g("div",{class:"vuefinder__explorer__sort-button vuefinder__explorer__sort-button--name vf-sort-button",onClick:s[0]||(s[0]=a=>v(n).toggleSort("basename"))},[Ke(L(v(i)("Name"))+" ",1),it(j(Xa,{direction:v(o).order},null,8,["direction"]),[[Sn,v(o).active&&v(o).column==="basename"]])]),g("div",{class:"vuefinder__explorer__sort-button vuefinder__explorer__sort-button--size vf-sort-button",onClick:s[1]||(s[1]=a=>v(n).toggleSort("file_size"))},[Ke(L(v(i)("Size"))+" ",1),it(j(Xa,{direction:v(o).order},null,8,["direction"]),[[Sn,v(o).active&&v(o).column==="file_size"]])]),g("div",{class:"vuefinder__explorer__sort-button vuefinder__explorer__sort-button--date vf-sort-button",onClick:s[2]||(s[2]=a=>v(n).toggleSort("last_modified"))},[Ke(L(v(i)("Date"))+" ",1),it(j(Xa,{direction:v(o).order},null,8,["direction"]),[[Sn,v(o).active&&v(o).column==="last_modified"]])])]))}});function g3(t,e){const{scrollContainer:n,itemWidth:i=100,rowHeight:o,overscan:r=2,containerPadding:s=48,lockItemsPerRow:a}=e,l=t,c=()=>typeof o=="number"?o:o.value,u=()=>i?typeof i=="number"?i:i.value:100,d=()=>s?typeof s=="number"?s:s.value:0,h=H(0),m=H(6),f=H(600);let p=null;const _=te(()=>Math.ceil(l.value.length/m.value)),C=te(()=>_.value*c()),w=te(()=>{const P=c(),N=Math.max(0,Math.floor(h.value/P)-r),M=Math.min(_.value,Math.ceil((h.value+f.value)/P)+r);return{start:N,end:M}}),S=te(()=>{const{start:P,end:N}=w.value;return Array.from({length:N-P},(M,q)=>P+q)}),b=()=>f.value,E=()=>typeof a=="object"?a.value:!1,x=()=>{if(E()){m.value=1;return}if(n.value){const P=d(),N=n.value.clientWidth-P,M=u();M>0&&(m.value=Math.max(Math.floor(N/M),2))}},O=P=>{const N=P.target;h.value=N.scrollTop};$e(()=>l.value.length,()=>{x()}),i&&typeof i!="number"&&$e(i,()=>{x()}),s&&typeof s!="number"&&$e(s,()=>{x()}),o&&typeof o!="number"&&$e(o,()=>{});const $=(P,N)=>{if(!P||!Array.isArray(P))return[];const M=N*m.value;return P.slice(M,M+m.value)},K=(P,N,M,q,le)=>{if(!P||!Array.isArray(P))return[];const de=[];for(let Y=N;Y<=M;Y++)for(let I=q;I<=le;I++){const A=Y*m.value+I;A<P.length&&P[A]&&de.push(P[A])}return de},F=P=>({row:Math.floor(P/m.value),col:P%m.value});return et(async()=>{await Ge(),n.value&&(f.value=n.value.clientHeight||600),x(),window.addEventListener("resize",()=>{n.value&&(f.value=n.value.clientHeight||600),x()}),n.value&&"ResizeObserver"in window&&(p=new ResizeObserver(P=>{const N=P[0];N&&(f.value=Math.round(N.contentRect.height)),x()}),p.observe(n.value))}),Ct(()=>{window.removeEventListener("resize",x),p&&(p.disconnect(),p=null)}),{scrollTop:h,itemsPerRow:m,totalRows:_,totalHeight:C,visibleRange:w,visibleRows:S,updateItemsPerRow:x,handleScroll:O,getRowItems:$,getItemsInRange:K,getItemPosition:F,getContainerHeight:b}}function _3(t){const{itemsPerRow:e,totalHeight:n,getItemsInRange:i,getKey:o,selectionObject:r,rowHeight:s,itemWidth:a,osInstance:l}=t,c=()=>typeof a=="number"?a:a.value,u=Math.floor(Math.random()*2**32).toString(),d=je(),h=d.fs,m=Oe(h.selectedKeys),f=Oe(h.sortedFiles),p=te(()=>{const I=new Map;return f.value&&f.value.forEach(A=>{I.set(o(A),A)}),I}),_=H(new Set),C=H(!1),w=H(!1),S=I=>I.map(A=>A.getAttribute("data-key")).filter(A=>!!A),b=I=>{I.selection.clearSelection(!0,!0)},E=I=>{if(m.value&&m.value.size>0){const A=document.querySelectorAll(`.file-item-${u}[data-key]`),Q=new Map;A.forEach(ie=>{const ve=ie.getAttribute("data-key");ve&&Q.set(ve,ie)});const U=[];m.value.forEach(ie=>{const ve=Q.get(ie);ve&&x(ie)&&U.push(ve)}),U.forEach(ie=>{I.selection.select(ie,!0)})}},x=I=>{const A=p.value.get(I);if(!A)return!1;const Q=d.selectionFilterType,U=d.selectionFilterMimeIncludes;return Q==="files"&&A.type==="dir"||Q==="dirs"&&A.type==="file"?!1:U&&Array.isArray(U)&&U.length>0?A.type==="dir"?!0:A.mime_type?U.some(ie=>A.mime_type?.startsWith(ie)):!1:!0},O=I=>{if(d.selectionMode==="single")return!1;C.value=!1,!I.event?.metaKey&&!I.event?.ctrlKey&&(w.value=!0),I.selection.resolveSelectables(),b(I),E(I)},$=H(0),K=({event:I,selection:A})=>{$.value=(r.value?.getAreaLocation().y1??0)-(d.root.getBoundingClientRect().top??0);const Q=document.querySelector(".selection-area-container");if(Q&&(Q.dataset.theme=d.theme.current),d.selectionMode==="single")return;const U=I;U&&"type"in U&&U.type==="touchend"&&U.preventDefault();const ie=I;!ie?.ctrlKey&&!ie?.metaKey&&(h.clearSelection(),A.clearSelection(!0,!0)),_.value.clear()},F=I=>{if(d.selectionMode==="single")return;const A=S(I.store.changed.added),Q=S(I.store.changed.removed);w.value=!1,C.value=!0,A.forEach(U=>{m.value&&!m.value.has(U)&&x(U)&&(_.value.add(U),h.select(U,d.selectionMode||"multiple"))}),Q.forEach(U=>{document.querySelector(`[data-key="${U}"]`)&&p.value.has(U)&&_.value.delete(U),h.deselect(U)}),I.selection.resolveSelectables(),E(I)},P=()=>{_.value.clear()},N=I=>{if(!I.event)return;const A=document.querySelector(".scroller-"+u);if(!A)return;const Q=A.getBoundingClientRect(),U=Q.left,ie=Q.top;let ve=A.scrollTop;if(l?.value){const{viewport:ft}=l.value.elements();ft&&(ve=ft.scrollTop)}const re=r.value?.getAreaLocation();if(!re)return;const ge=Math.min(re.x1,re.x2),_e=ve+Math.min(re.y1,re.y2),R=Math.max(re.x1,re.x2),k=ve+Math.max(re.y1,re.y2),z=4,D=c();let B=Math.floor((ge-U-z)/D),oe=Math.floor((R-U-z)/D);const ee=ge-U-z-B*D,G=R-U-z-oe*D;ee>D-z&&(B=B+1),G<z&&(oe=oe-1);const he=Math.max(0,B),me=Math.min(e.value-1,oe);let ke=Math.floor((_e-ie-z)/s.value),Ee=Math.floor((k-ie-z)/s.value);const ze=_e-ie-z-ke*s.value,Pe=k-ie-z-Ee*s.value,Ne=Math.floor((n.value-z)/s.value);ze>s.value-z&&(ke=ke+1),Pe<z&&(Ee=Ee-1);const ut=Math.max(0,ke),Qe=Math.min(Ee,Ne),at=i(f.value,ut,Qe,he,me),tt=document.querySelectorAll(`.file-item-${u}[data-key]`),pt=new Map;tt.forEach(ft=>{const Ft=ft.getAttribute("data-key");Ft&&pt.set(Ft,ft)});const dt=[];if(at.forEach(ft=>{const Ft=o(ft);pt.get(Ft)||dt.push(Ft)}),dt.length>0){const ft=d.selectionMode||"multiple";h.selectMultiple(dt,ft)}},M=I=>{N(I),b(I),E(I),h.setSelectedCount(m.value?.size||0),C.value=!1},q=()=>{let I=[".scroller-"+u];if(l?.value){const{viewport:A}=l.value.elements();A&&(I=A)}r.value=new NR({selectables:[".file-item-"+u+":not(.vf-explorer-item--unselectable)"],boundaries:I,selectionContainerClass:"selection-area-container",behaviour:{overlap:"invert",intersect:"touch",startThreshold:0,triggers:[0],scrolling:{speedDivider:10,manualSpeed:750,startScrollMargins:{x:0,y:10}}},features:{touch:!0,range:!0,deselectOnBlur:!0,singleTap:{allow:!1,intersect:"native"}}}),r.value.on("beforestart",O),r.value.on("start",K),r.value.on("move",F),r.value.on("stop",M)},le=()=>{r.value&&(r.value.destroy(),r.value=null)},de=()=>{r.value&&(Array.from(m.value??new Set).forEach(I=>{x(I)||h.deselect(I)}),le(),q())},Y=I=>{w.value&&(r.value?.clearSelection(),P(),w.value=!1);const A=I;!_.value.size&&!w.value&&!A?.ctrlKey&&!A?.metaKey&&(h.clearSelection(),r.value?.clearSelection())};return et(()=>{const I=A=>{!A.buttons&&C.value&&(C.value=!1)};document.addEventListener("dragleave",I),Ct(()=>{document.removeEventListener("dragleave",I)})}),{explorerId:u,isDragging:C,initializeSelectionArea:q,updateSelectionArea:de,handleContentClick:Y}}function y3(t){const e=n=>{if(!n)return{typeAllowed:!1,mimeAllowed:!1};const i=t.selectionFilterType,o=t.selectionFilterMimeIncludes,r=!i||i==="both"||i==="files"&&n.type==="file"||i==="dirs"&&n.type==="dir";let s=!0;return o&&Array.isArray(o)&&o.length>0&&(n.type==="dir"?s=!0:n.mime_type?s=o.some(a=>n.mime_type.startsWith(a)):s=!1),{typeAllowed:r,mimeAllowed:s}};return{isItemSelectable:e,canSelectItem:n=>{const{typeAllowed:i,mimeAllowed:o}=e(n);return i&&o}}}function b3(t){const e=n=>({item:n,defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}});return{createCancelableEvent:e,openItem:(n,i,o)=>{const r=e(n);if(n.type==="file"&&i){if(t.emitter.emit("vf-file-dclick",r),r.defaultPrevented)return}else if(n.type==="dir"&&o&&(t.emitter.emit("vf-folder-dclick",r),r.defaultPrevented))return;const s=t.contextMenuItems?.find(a=>a.show(t,{items:[n],target:n,searchQuery:""}));s&&s.action(t,[n])}}}function w3(t,e,n,i,o,r,s){const a=t.fs,{canSelectItem:l}=y3(t),{openItem:c}=b3(t),u=h=>{const m=h.target?.closest(".file-item-"+e);if(!m)return null;const f=String(m.getAttribute("data-key")),p=n.value?.find(_=>_.path===f);return{key:f,item:p}},d=()=>{const h=i.value;return n.value?.filter(m=>h?.has(m.path))||[]};return{handleItemClick:h=>{const m=u(h);if(!m)return;const{key:f,item:p}=m,_=h;if(!l(p))return;const C=t.selectionMode||"multiple";!_?.ctrlKey&&!_?.metaKey&&(h.type!=="touchstart"||!a.isSelected(f))&&(a.clearSelection(),o.value?.clearSelection(!0,!0)),o.value?.resolveSelectables(),h.type==="touchstart"&&a.isSelected(f)?a.select(f,C):a.toggleSelect(f,C),a.setSelectedCount(i.value?.size||0)},handleItemDblClick:h=>{const m=u(h);if(!m)return;const{item:f}=m;l(f)&&f&&c(f,r,s)},handleItemContextMenu:h=>{h.preventDefault(),h.stopPropagation();const m=u(h);if(!m)return;const{key:f,item:p}=m;l(p)&&(i.value?.has(f)||(a.clearSelection(),a.select(f)),t.emitter.emit("vf-contextmenu-show",{event:h,items:d(),target:p}))},handleContentContextMenu:h=>{h.preventDefault(),t.emitter.emit("vf-contextmenu-show",{event:h,items:d()})},getSelectedItems:d}}function S3(t,e){const n=H(null);return et(()=>{if(hn.plugin([cR]),t.value){const i=hn(t.value,{scrollbars:{theme:"vf-scrollbars-theme"}},{initialized:o=>{n.value=o;const{viewport:r}=o.elements();r&&r.addEventListener("scroll",e)},updated:o=>{const{viewport:r}=o.elements()}});n.value=i}}),Ct(()=>{if(n.value){const{viewport:i}=n.value.elements();i&&i.removeEventListener("scroll",e),n.value.destroy(),n.value=null}}),{osInstance:n}}function C3(t,e){const n=H(null);return et(()=>{t.value&&(n.value=new Hi({elements_selector:".lazy",container:t.value})),e?.emitter&&e.emitter.on("vf-refresh-thumbnails",()=>{n.value&&n.value.update()})}),Bp(()=>{n.value&&n.value.update()}),Ct(()=>{n.value&&(n.value.destroy(),n.value=null)}),{vfLazyLoad:n}}const E3={class:"vuefinder__explorer__container"},x3={key:0,class:"vuefinder__linear-loader"},T3=Ce({__name:"Explorer",props:{onFileDclick:{type:Function},onFolderDclick:{type:Function}},setup(t){const e=t,n=je(),i=ur(n,["vuefinder__drag-over"]),o=In("dragImage"),r=Go(null),s=In("scrollContainer"),a=In("scrollContent"),l=n.fs,c=n.config,u=Oe(c.state),d=Oe(l.sortedFiles),h=Oe(l.selectedKeys),m=Oe(l.loading),f=D=>h.value?.has(D)??!1,p=te(()=>{if(u.value?.view==="grid"){const oe=u.value?.gridItemHeight??80,ee=u.value?.gridItemGap??8;return oe+ee*2}const D=u.value?.listItemHeight??32,B=u.value?.listItemGap??2;return D+B*2}),_=te(()=>{if(u.value?.view==="grid"){const D=u.value?.gridItemWidth??96,B=u.value?.gridItemGap??8;return D+B*2}return 104}),C=te(()=>u.value?.view==="grid"?(u.value?.gridItemGap??8)*2:0),{t:w}=n.i18n,{itemsPerRow:S,totalHeight:b,visibleRows:E,handleScroll:x,getRowItems:O,getItemsInRange:$,updateItemsPerRow:K}=g3(te(()=>d.value??[]),{scrollContainer:s,itemWidth:_,rowHeight:p,overscan:2,containerPadding:C,lockItemsPerRow:te(()=>u.value.view==="list")}),{osInstance:F}=S3(s,x),{explorerId:P,isDragging:N,initializeSelectionArea:M,updateSelectionArea:q,handleContentClick:le}=_3({itemsPerRow:S,totalHeight:b,getItemsInRange:$,getKey:D=>D.path,selectionObject:r,rowHeight:p,itemWidth:_,osInstance:F}),de=H(null),Y=D=>{if(!D||!de.value)return!1;const B=h.value?.has(de.value)??!1;return N.value&&(B?h.value?.has(D)??!1:D===de.value)};$e(()=>c.get("view"),D=>{D==="list"?S.value=1:K()},{immediate:!0}),$e(S,D=>{c.get("view")==="list"&&D!==1&&(S.value=1)});const I=D=>d.value?.[D];C3(s,n);const{handleItemClick:A,handleItemDblClick:Q,handleItemContextMenu:U,handleContentContextMenu:ie}=w3(n,P,d,h,r,e.onFileDclick,e.onFolderDclick);et(()=>{const D=()=>{r.value||M(),r.value&&r.value.on("beforestart",({event:B})=>{const oe=B?.target===a.value;if(!B?.metaKey&&!B?.ctrlKey&&!B?.altKey&&!oe)return!1})};if(F.value)D();else{const B=setInterval(()=>{F.value&&(clearInterval(B),D())},50);setTimeout(()=>{clearInterval(B),r.value||D()},500)}$e(()=>[n.selectionFilterType,n.selectionFilterMimeIncludes],q,{deep:!0})});const ve=D=>{if(!(n.features?.move??!1)||D.altKey||D.ctrlKey||D.metaKey)return D.preventDefault(),!1;N.value=!0;const B=D.target?.closest(".file-item-"+P);if(de.value=B?String(B.dataset.key):null,D.dataTransfer&&de.value){D.dataTransfer.setDragImage(o.value,0,15),D.dataTransfer.effectAllowed="all",D.dataTransfer.dropEffect="copy";const oe=h.value?.has(de.value)?Array.from(h.value):[de.value];D.dataTransfer.setData("items",JSON.stringify(oe)),l.setDraggedItem(de.value)}},re=()=>{de.value=null};let ge=null,_e=null;const R=D=>{D.target?.closest(".file-item-"+P)||(_e=D,ge&&clearTimeout(ge),ge=setTimeout(()=>{_e&&(_e.cancelable&&_e.preventDefault(),_e.stopPropagation(),ie(_e)),_e=null,ge=null},500))},k=D=>{ge&&(clearTimeout(ge),ge=null),_e=null},z=D=>{if(!_e)return;const B=_e.touches[0]||_e.changedTouches[0],oe=D.touches[0]||D.changedTouches[0];if(B&&oe){const ee=Math.abs(oe.clientX-B.clientX),G=Math.abs(oe.clientY-B.clientY);(ee>15||G>15)&&(ge&&(clearTimeout(ge),ge=null),_e=null)}};return(D,B)=>(y(),T("div",E3,[v(u).view==="list"?(y(),ne(v3,{key:0})):ue("",!0),g("div",{ref_key:"scrollContainer",ref:s,class:Ae(["vuefinder__explorer__selector-area","scroller-"+v(P)])},[v(c).get("loadingIndicator")==="linear"&&v(m)?(y(),T("div",x3)):ue("",!0),g("div",{ref_key:"scrollContent",ref:a,class:"scrollContent vuefinder__explorer__scroll-content",style:At({height:`${v(b)}px`,position:"relative",width:"100%"}),onContextmenu:B[0]||(B[0]=Ye((...oe)=>v(ie)&&v(ie)(...oe),["self","prevent"])),onClick:B[1]||(B[1]=Ye((...oe)=>v(le)&&v(le)(...oe),["self"])),onTouchstartCapture:Ye(R,["self"]),onTouchendCapture:Ye(k,["self"]),onTouchmoveCapture:Ye(z,["self"]),onTouchcancelCapture:Ye(k,["self"])},[g("div",{ref_key:"dragImage",ref:o,class:"vuefinder__explorer__drag-item"},[j(Hj,{count:de.value&&v(h).has(de.value)?v(h).size:1},null,8,["count"])],512),v(u).view==="grid"?(y(!0),T(Ie,{key:0},He(v(E),oe=>(y(),ne(zp,{key:oe,"row-index":oe,"row-height":p.value,view:"grid","items-per-row":v(S),items:v(O)(v(d),oe),"show-thumbnails":v(u).showThumbnails,"is-dragging-item":Y,"is-selected":f,"drag-n-drop-events":ee=>v(i).events(ee),"explorer-id":v(P),onClick:v(A),onDblclick:v(Q),onContextmenu:v(U),onDragstart:ve,onDragend:re},{icon:we(ee=>[Ve(D.$slots,"icon",We({ref_for:!0},ee))]),_:3},8,["row-index","row-height","items-per-row","items","show-thumbnails","drag-n-drop-events","explorer-id","onClick","onDblclick","onContextmenu"]))),128)):(y(!0),T(Ie,{key:1},He(v(E),oe=>(y(),ne(zp,{key:oe,"row-index":oe,"row-height":p.value,view:"list",items:I(oe)?[I(oe)]:[],"is-dragging-item":Y,"is-selected":f,"drag-n-drop-events":ee=>v(i).events(ee),"explorer-id":v(P),onClick:v(A),onDblclick:v(Q),onContextmenu:v(U),onDragstart:ve,onDragend:re},{icon:we(ee=>[Ve(D.$slots,"icon",We({ref_for:!0},ee))]),_:3},8,["row-index","row-height","items","drag-n-drop-events","explorer-id","onClick","onDblclick","onContextmenu"]))),128))],36)],2)]))}}),$3=["href","download"],k3=["onClick"],O3=Ce({__name:"ContextMenu",setup(t){const e=je(),n=H(null),i=H([]);let o=null,r=null,s=null,a=[],l=null;const c=Mt({active:!1,items:[],positions:{}});e.emitter.on("vf-context-selected",m=>{i.value=m});const u=m=>m.link(e,i.value),d=m=>{e.emitter.emit("vf-contextmenu-hide"),m.action(e,i.value)};e.emitter.on("vf-contextmenu-show",m=>{const{event:f,items:p,target:_=null}=m||{};c.items=(e.contextMenuItems||[]).filter(C=>C.show(e,{items:p,target:_})).sort((C,w)=>{const S=C.order??1/0,b=w.order??1/0;return S-b}),_?p.length>1&&p.some(C=>C.path===_.path)?e.emitter.emit("vf-context-selected",p):e.emitter.emit("vf-context-selected",[_]):e.emitter.emit("vf-context-selected",[]),h(f)}),e.emitter.on("vf-contextmenu-hide",()=>{c.active=!1,o&&(o(),o=null),s&&(a.forEach(m=>{m===window?window.removeEventListener("scroll",s,!0):m.removeEventListener("scroll",s,!0)}),s=null,a=[]),l&&(document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),l=null),r=null,c.positions={}});const h=async m=>{o&&(o(),o=null);const f=(b=>{if("clientX"in b&&"clientY"in b)return{x:b.clientX,y:b.clientY};const E="touches"in b&&b.touches[0]||"changedTouches"in b&&b.changedTouches[0];return E?{x:E.clientX,y:E.clientY}:{x:0,y:0}})(m);if(r={getBoundingClientRect:()=>({width:0,height:0,x:f.x,y:f.y,top:f.y,left:f.x,right:f.x,bottom:f.y})},c.positions={position:"fixed",zIndex:"10001",opacity:"0",visibility:"hidden",left:"-9999px",top:"-9999px"},c.active=!0,await Ge(),!n.value||!r)return;await new Promise(b=>{requestAnimationFrame(()=>{requestAnimationFrame(b)})});const p=[Ro(8),Io({padding:16,fallbackPlacements:["left-start","right-end","left-end","top-start","bottom-start"]}),Mo({padding:16})];let _=0,C=0;try{const b=await Zi(r,n.value,{placement:"right-start",strategy:"fixed",middleware:p});_=b.x,C=b.y}catch(b){console.warn("[ContextMenu] Floating UI initial positioning error:",b);return}c.positions={position:"fixed",zIndex:"10001",left:`${_}px`,top:`${C}px`,opacity:"0",visibility:"visible",transform:"translateY(-8px)",transition:"opacity 150ms ease-out, transform 150ms ease-out"},requestAnimationFrame(()=>{n.value&&(c.positions={...c.positions,opacity:"1",transform:"translateY(0)"})});const w=(b=>{const E=[];let x=b;for(;x&&x!==document.body&&x!==document.documentElement;){const O=window.getComputedStyle(x),$=O.overflow+O.overflowX+O.overflowY;($.includes("scroll")||$.includes("auto"))&&E.push(x),x=x.parentElement}return E})(n.value);a=[window,...w],s=()=>{c.active&&e.emitter.emit("vf-contextmenu-hide")};const S=s;S&&a.forEach(b=>{b===window?window.addEventListener("scroll",S,!0):b.addEventListener("scroll",S,!0)}),l=b=>{if(!c.active)return;const E=b.target;if(!E||n.value&&n.value.contains(E))return;const x=e.root;x&&x.contains(E)||e.emitter.emit("vf-contextmenu-hide")},setTimeout(()=>{l&&(document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0))},100),setTimeout(()=>{if(!(!n.value||!r))try{o=rc(r,n.value,async()=>{if(!(!r||!n.value))try{const{x:b,y:E}=await Zi(r,n.value,{placement:"right-start",strategy:"fixed",middleware:p});c.positions={...c.positions,left:`${b}px`,top:`${E}px`}}catch(b){console.warn("Floating UI positioning error:",b)}})}catch(b){console.warn("Floating UI autoUpdate setup error:",b),o=null}},200)};return Ct(()=>{o&&(o(),o=null),s&&(a.forEach(m=>{m===window?window.removeEventListener("scroll",s,!0):m.removeEventListener("scroll",s,!0)}),s=null,a=[]),l&&(document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),l=null),r=null}),(m,f)=>it((y(),T("ul",{ref_key:"contextmenu",ref:n,class:Ae([{"vuefinder__context-menu--active":c.active,"vuefinder__context-menu--inactive":!c.active},"vuefinder__context-menu"]),style:At(c.positions)},[(y(!0),T(Ie,null,He(c.items,p=>(y(),T("li",{key:p.title,class:"vuefinder__context-menu__item"},[p.link?(y(),T("a",{key:0,class:"vuefinder__context-menu__link",target:"_blank",href:u(p),download:u(p),onClick:f[0]||(f[0]=_=>v(e).emitter.emit("vf-contextmenu-hide"))},[g("span",null,L(p.title(v(e).i18n)),1)],8,$3)):(y(),T("div",{key:1,class:"vuefinder__context-menu__action",onClick:_=>d(p)},[g("span",null,L(p.title(v(e).i18n)),1)],8,k3))]))),128))],6)),[[Sn,c.active]])}}),A3={class:"vuefinder__status-bar__wrapper"},P3={class:"vuefinder__status-bar__storage"},R3=["title"],I3={class:"vuefinder__status-bar__storage-icon"},M3=["value"],F3=["value"],D3={class:"vuefinder__status-bar__info space-x-2"},L3={key:0},j3={key:1},z3={key:0,class:"vuefinder__status-bar__size"},N3={class:"vuefinder__status-bar__actions"},U3=Ce({__name:"Statusbar",setup(t){const e=je(),{t:n}=e.i18n,i=e.fs,o=Oe(i.sortedFiles),r=Oe(i.path),s=Oe(i.selectedCount),a=Oe(i.storages),l=Oe(i.selectedItems),c=Oe(i.path),u=_=>{const C=_.target.value;e.adapter.open(C+"://")},d=te(()=>!l.value||l.value.length===0?0:l.value.reduce((_,C)=>_+(C.file_size||0),0)),h=te(()=>a.value),m=te(()=>o.value),f=te(()=>s.value||0),p=te(()=>l.value||[]);return(_,C)=>(y(),T("div",A3,[g("div",P3,[g("div",{class:"vuefinder__status-bar__storage-container",title:v(n)("Storage")},[g("div",I3,[j(v(vu))]),g("select",{name:"vuefinder-media-selector",value:v(r).storage,class:"vuefinder__status-bar__storage-select",tabindex:"-1",onChange:u},[(y(!0),T(Ie,null,He(h.value,w=>(y(),T("option",{key:w,value:w},L(w),9,F3))),128))],40,M3),C[0]||(C[0]=g("span",{class:"vuefinder__status-bar__storage-caret","aria-hidden":"true"},null,-1))],8,R3),g("div",D3,[f.value===0?(y(),T("span",L3,L(m.value.length)+" "+L(v(n)("items")),1)):(y(),T("span",j3,[Ke(L(f.value)+" "+L(v(n)("selected"))+" ",1),d.value?(y(),T("span",z3,L(v(e).filesize(d.value)),1)):ue("",!0)]))])]),g("div",N3,[Ve(_.$slots,"actions",{path:v(c).path,count:f.value||0,selected:p.value})])]))}}),V3={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-5 w-5",viewBox:"0 0 24 24"};function B3(t,e){return y(),T("svg",V3,[...e[0]||(e[0]=[g("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m3.6 5.2a1 1 0 0 0-1.4.2L12 10.333 9.8 7.4a1 1 0 1 0-1.6 1.2l2.55 3.4-2.55 3.4a1 1 0 1 0 1.6 1.2l2.2-2.933 2.2 2.933a1 1 0 0 0 1.6-1.2L13.25 12l2.55-3.4a1 1 0 0 0-.2-1.4"},null,-1)])])}const H3={render:B3};function s_(t,e){const n=t.findIndex(i=>i.path===e.path);n>-1?t[n]=e:t.push(e)}const q3={class:"vuefinder__folder-loader-indicator"},W3={key:1,class:"vuefinder__folder-loader-indicator--icon"},a_=Ce({__name:"FolderLoaderIndicator",props:Vp({storage:{},path:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=je(),i=ec(t,"modelValue"),o=H(!1);$e(()=>i.value,()=>r());const r=async()=>{o.value=!0;try{const s=(await n.adapter.list(e.path)).files.filter(a=>a.type==="dir");s_(n.treeViewData,{path:e.path,type:"dir",folders:s})}catch(s){Yt(s,"Failed to fetch subfolders")}finally{o.value=!1}};return(s,a)=>(y(),T("div",q3,[o.value?(y(),ne(v(Zs),{key:0,class:"vuefinder__folder-loader-indicator--loading"})):(y(),T("div",W3,[i.value?(y(),ne(v(Js),{key:0,class:"vuefinder__folder-loader-indicator--minus"})):ue("",!0),i.value?ue("",!0):(y(),ne(v(Xs),{key:1,class:"vuefinder__folder-loader-indicator--plus"}))]))]))}}),K3={key:0},Y3={class:"vuefinder__treesubfolderlist__no-folders"},G3={class:"vuefinder__treesubfolderlist__item-content"},Q3=["onClick"],X3=["title","onDblclick","onClick"],J3={class:"vuefinder__treesubfolderlist__item-icon"},Z3={class:"vuefinder__treesubfolderlist__subfolder"},ez={key:1,class:"vuefinder__treesubfolderlist__more-note"},tz=Ce({__name:"TreeSubfolderList",props:{storage:{},path:{}},setup(t){const e=je(),n=e.fs,i=ur(e,["vuefinder__drag-over"]),o=H({}),r=e.config,s=Oe(r.state),{t:a}=e.i18n,l=Oe(n.path),c=t,u=H(null),d=H(50);et(()=>{c.path===c.storage+"://"&&u.value&&hn(u.value,{scrollbars:{theme:"vf-scrollbars-theme"}})});const h=te(()=>{const w=e.treeViewData.find(S=>S.path===c.path)?.folders||[];return w.length>d.value?w.slice(0,d.value):w}),m=te(()=>e.treeViewData.find(w=>w.path===c.path)?.folders?.length||0),f=te(()=>m.value>d.value),p=te(()=>`${c.storage}://`),_=(w,S)=>w===S||w.startsWith(`${S}/`);$e(h,w=>{const S=s.value.expandTreeByDefault&&c.path===p.value,b=s.value.expandedTreePaths||[];w.forEach(E=>{const x=b.some(O=>_(O,E.path));(S||x)&&o.value[E.path]===void 0&&(o.value[E.path]=!0)})},{immediate:!0});const C=()=>{d.value+=50};return(w,S)=>{const b=Ue("TreeSubfolderList",!0);return y(),T("ul",{ref_key:"parentSubfolderList",ref:u,class:"vuefinder__treesubfolderlist__container"},[h.value.length?ue("",!0):(y(),T("li",K3,[g("div",Y3,L(v(a)("No folders")),1)])),(y(!0),T(Ie,null,He(h.value,E=>(y(),T("li",{key:E.path,class:"vuefinder__treesubfolderlist__item"},[g("div",G3,[g("div",{class:"vuefinder__treesubfolderlist__item-toggle",onClick:x=>o.value[E.path]=!o.value[E.path]},[j(a_,{modelValue:o.value[E.path],"onUpdate:modelValue":x=>o.value[E.path]=x,storage:t.storage,path:E.path},null,8,["modelValue","onUpdate:modelValue","storage","path"])],8,Q3),g("div",We({class:"vuefinder__treesubfolderlist__item-link",title:E.path},bn(v(i).events({...E,dir:E.path,extension:"",file_size:null,last_modified:null,mime_type:null,visibility:"public"}),!0),{onDblclick:x=>o.value[E.path]=!o.value[E.path],onClick:x=>v(e).adapter.open(E.path)}),[g("div",J3,[v(l)?.path===E.path?(y(),ne(v(gu),{key:0,class:"vuefinder__item-icon__folder--open"})):(y(),ne(v(zn),{key:1,class:"vuefinder__item-icon__folder"}))]),g("div",{class:Ae(["vuefinder__treesubfolderlist__item-text",{"vuefinder__treesubfolderlist__item-text--active":v(l).path===E.path}])},L(E.basename),3)],16,X3)]),g("div",Z3,[it(j(b,{storage:c.storage,path:E.path},null,8,["storage","path"]),[[Sn,o.value[E.path]]])])]))),128)),f.value?(y(),T("li",ez,[g("div",{class:"vuefinder__treesubfolderlist__load-more",onClick:C},L(v(a)("load more")),1)])):ue("",!0)],512)}}}),nz=Ce({__name:"TreeStorageItem",props:{storage:{}},setup(t){const e=je(),n=e.fs,i=e.config,o=t,r=Oe(i.state),s=te(()=>{const m=r.value.expandedTreePaths||[],f=`${o.storage}://`;return m.some(p=>p===f||p.startsWith(`${f}`))}),a=H(r.value.expandTreeByDefault||s.value),l=ur(e,["vuefinder__drag-over"]),c=Oe(n.path),u=te(()=>o.storage===c.value?.storage);$e(()=>({expandTreeByDefault:r.value.expandTreeByDefault,hasExpandedPathInStorage:s.value}),m=>{(m.expandTreeByDefault||m.hasExpandedPathInStorage)&&(a.value=!0)});const d={storage:o.storage,path:o.storage+"://",dir:o.storage+"://",type:"dir",basename:o.storage,extension:"",file_size:null,last_modified:null,mime_type:null,visibility:"public"};function h(m){m===c.value?.storage?a.value=!a.value:e.adapter.open(m+"://")}return(m,f)=>(y(),T(Ie,null,[g("div",{class:"vuefinder__treestorageitem__header",onClick:f[2]||(f[2]=p=>h(t.storage))},[g("div",We({class:["vuefinder__treestorageitem__info",u.value?"vuefinder__treestorageitem__info--active":""]},bn(v(l).events(d),!0)),[g("div",{class:Ae(["vuefinder__treestorageitem__icon",u.value?"vuefinder__treestorageitem__icon--active":""])},[j(v(vu))],2),g("div",null,L(t.storage),1)],16),g("div",{class:"vuefinder__treestorageitem__loader",onClick:f[1]||(f[1]=Ye(p=>a.value=!a.value,["stop"]))},[j(a_,{modelValue:a.value,"onUpdate:modelValue":f[0]||(f[0]=p=>a.value=p),storage:t.storage,path:t.storage+"://"},null,8,["modelValue","storage","path"])])]),it(j(tz,{storage:t.storage,path:t.storage+"://",class:"vuefinder__treestorageitem__subfolder"},null,8,["storage","path"]),[[Sn,a.value]])],64))}}),iz={class:"vuefinder__folder-indicator"},oz={class:"vuefinder__folder-indicator--icon"},rz=Ce({__name:"FolderIndicator",props:{modelValue:{type:Boolean},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=ec(t,"modelValue");return(n,i)=>(y(),T("div",iz,[g("div",oz,[e.value?(y(),ne(v(Js),{key:0,class:"vuefinder__folder-indicator--minus"})):ue("",!0),e.value?ue("",!0):(y(),ne(v(Xs),{key:1,class:"vuefinder__folder-indicator--plus"}))])]))}}),sz={key:0,class:"vuefinder__treeview__header"},az={class:"vuefinder__treeview__pinned-label"},lz={class:"vuefinder__treeview__pin-text text-nowrap"},cz={key:0,class:"vuefinder__treeview__pinned-list"},uz=["onClick"],dz=["title"],hz=["onClick"],pz={key:0},fz={class:"vuefinder__treeview__no-pinned"},mz=Ce({__name:"TreeView",setup(t){const e=je(),{enabled:n}=Tn(),{t:i}=e.i18n,{getStore:o,setStore:r}=e.storage,s=e.fs,a=e.config,l=Oe(a.state),c=Oe(s.sortedFiles),u=Oe(s.storages),d=te(()=>u.value||[]),h=Oe(s.path),m=ur(e,["vuefinder__drag-over"]),f=H(190),p=H(o("pinned-folders-opened",!0));$e(p,S=>r("pinned-folders-opened",S));const _=S=>{const b=a.get("pinnedFolders");a.set("pinnedFolders",b.filter(E=>E.path!==S.path))},C=S=>{const b=S.clientX,E=S.target.parentElement;if(!E)return;const x=E.getBoundingClientRect().width;E.classList.remove("transition-[width]"),E.classList.add("transition-none");const O=K=>{f.value=x+K.clientX-b,f.value<50&&(f.value=0,a.set("showTreeView",!1)),f.value>50&&a.set("showTreeView",!0)},$=()=>{const K=E.getBoundingClientRect();f.value=K.width,E.classList.add("transition-[width]"),E.classList.remove("transition-none"),window.removeEventListener("mousemove",O),window.removeEventListener("mouseup",$)};window.addEventListener("mousemove",O),window.addEventListener("mouseup",$)},w=H(null);return et(()=>{w.value&&hn(w.value,{overflow:{x:"hidden"},scrollbars:{theme:"vf-scrollbars-theme"}})}),$e(c,S=>{const b=S.filter(E=>E.type==="dir");s_(e.treeViewData,{path:h.value.path||"",folders:b.map(E=>({storage:E.storage,path:E.path,basename:E.basename,type:"dir"}))})}),(S,b)=>(y(),T(Ie,null,[g("div",{class:Ae(["vuefinder__treeview__overlay",v(l).showTreeView?"vuefinder__treeview__backdrop":"hidden"]),onClick:b[0]||(b[0]=E=>v(a).toggle("showTreeView"))},null,2),g("div",{style:At(v(l).showTreeView?"min-width:100px;max-width:75%; width: "+f.value+"px":"width: 0"),class:"vuefinder__treeview__container"},[g("div",{ref_key:"treeViewScrollElement",ref:w,class:"vuefinder__treeview__scroll"},[v(n)("pinned")?(y(),T("div",sz,[g("div",{class:"vuefinder__treeview__pinned-toggle",onClick:b[2]||(b[2]=E=>p.value=!p.value)},[g("div",az,[j(v(mu),{class:"vuefinder__treeview__pin-icon"}),g("div",lz,L(v(i)("Pinned Folders")),1)]),j(rz,{modelValue:p.value,"onUpdate:modelValue":b[1]||(b[1]=E=>p.value=E)},null,8,["modelValue"])]),p.value?(y(),T("ul",cz,[(y(!0),T(Ie,null,He(v(l).pinnedFolders,E=>(y(),T("li",{key:E.path,class:"vuefinder__treeview__pinned-item"},[g("div",We({class:"vuefinder__treeview__pinned-folder"},bn(v(m).events(E),!0),{onClick:x=>v(e).adapter.open(E.path)}),[v(h).path!==E.path?(y(),ne(v(zn),{key:0,class:"vuefinder__treeview__folder-icon vuefinder__item-icon__folder"})):ue("",!0),v(h).path===E.path?(y(),ne(v(gu),{key:1,class:"vuefinder__item-icon__folder--open vuefinder__treeview__open-folder-icon"})):ue("",!0),g("div",{title:E.path,class:Ae(["vuefinder__treeview__folder-name",{"vuefinder__treeview__folder-name--active":v(h).path===E.path}])},L(E.basename),11,dz)],16,uz),g("div",{class:"vuefinder__treeview__remove-folder",onClick:x=>_(E)},[j(v(H3),{class:"vuefinder__treeview__remove-icon"})],8,hz)]))),128)),v(l).pinnedFolders.length?ue("",!0):(y(),T("li",pz,[g("div",fz,L(v(i)("No folders pinned")),1)]))])):ue("",!0)])):ue("",!0),(y(!0),T(Ie,null,He(d.value,E=>(y(),T("div",{key:E,class:"vuefinder__treeview__storage"},[j(nz,{storage:E},null,8,["storage"])]))),128))],512),g("div",{class:"vuefinder__treeview__resize-handle",onMousedown:C},null,32)],4)],64))}}),xt={new_folder:"new_folder",selectAll:"selectAll",pinFolder:"pinFolder",unpinFolder:"unpinFolder",delete:"delete",refresh:"refresh",preview:"preview",open:"open",openDir:"openDir",download:"download",archive:"archive",unarchive:"unarchive",rename:"rename",move:"move",copy:"copy",paste:"paste"};function vz(t){return t.items.length>1&&t.items.some(e=>e.path===t.target?.path)?"many":t.target?"one":"none"}function mt(t){const e=Object.assign({needsSearchQuery:!1},t);return(n,i)=>!(e.needsSearchQuery!==!!i.searchQuery||e.target!==void 0&&e.target!==vz(i)||e.targetType!==void 0&&e.targetType!==i.target?.type||e.mimeType!==void 0&&e.mimeType!==i.target?.mime_type||e.feature!==void 0&&!(n.features[e.feature]??!1))}function Eo(...t){return(e,n)=>t.some(i=>i(e,n))}function xo(...t){return(e,n)=>t.every(i=>i(e,n))}const l_=[{id:xt.openDir,title:({t})=>t("Open containing folder"),action:(t,e)=>{const n=e[0];n&&t.adapter.open(n.dir)},show:mt({target:"one",needsSearchQuery:!0}),order:10},{id:xt.refresh,title:({t})=>t("Refresh"),action:t=>{const e=t.fs;t.adapter.invalidateListQuery(e.path.get().path),t.adapter.open(e.path.get().path)},show:Eo(mt({target:"none"}),mt({target:"many"})),order:20},{id:xt.selectAll,title:({t})=>t("Select All"),action:t=>{t.fs.selectAll(t.selectionMode||"multiple")},show:(t,e)=>t.selectionMode==="multiple"&&mt({target:"none"})(t,e),order:30},{id:xt.new_folder,title:({t})=>t("New Folder"),action:t=>t.modal.open(Su),show:mt({target:"none",feature:"newfolder"}),order:40},{id:xt.open,title:({t})=>t("Open"),action:(t,e)=>{e[0]&&t.adapter.open(e[0].path)},show:mt({target:"one",targetType:"dir"}),order:50},{id:xt.pinFolder,title:({t})=>t("Pin Folder"),action:(t,e)=>{const n=t.config,i=n.get("pinnedFolders"),o=i.concat(e.filter(r=>i.findIndex(s=>s.path===r.path)===-1));n.set("pinnedFolders",o)},show:xo(mt({target:"one",targetType:"dir",feature:"pinned"}),(t,e)=>t.config.get("pinnedFolders").findIndex(n=>n.path===e.target?.path)===-1),order:60},{id:xt.unpinFolder,title:({t})=>t("Unpin Folder"),action:(t,e)=>{const n=t.config,i=n.get("pinnedFolders");n.set("pinnedFolders",i.filter(o=>!e.find(r=>r.path===o.path)))},show:xo(mt({target:"one",targetType:"dir",feature:"pinned"}),(t,e)=>t.config.get("pinnedFolders").findIndex(n=>n.path===e.target?.path)!==-1),order:70},{id:xt.preview,title:({t})=>t("Preview"),action:(t,e)=>t.modal.open(cr,{storage:e[0]?.storage,item:e[0]}),show:xo(mt({target:"one",feature:"preview"}),(t,e)=>e.target?.type!=="dir"),order:80},{id:xt.download,link:(t,e)=>{if(e[0])return t.adapter.getDownloadUrl(e[0])},title:({t})=>t("Download"),action:()=>{},show:xo(mt({target:"one",feature:"download"}),(t,e)=>e.target?.type!=="dir"),order:90},{id:xt.rename,title:({t})=>t("Rename"),action:(t,e)=>t.modal.open(Qs,{items:e}),show:mt({target:"one",feature:"rename"}),order:100},{id:xt.move,title:({t})=>t("Move files"),action:(t,e)=>{const n=t.fs,i={storage:n.path.get().storage||"",path:n.path.get().path||"",type:"dir"};t.modal.open(uo,{items:{from:e,to:i}})},show:Eo(mt({target:"one",feature:"move"}),mt({target:"many",feature:"move"})),order:110},{id:xt.copy,title:({t})=>t("Copy"),action:(t,e)=>{e.length>0&&t.fs.setClipboard("copy",new Set(e.map(n=>n.path)))},show:Eo(mt({target:"one",feature:"copy"}),mt({target:"many",feature:"copy"})),order:120},{id:xt.paste,title:({t})=>t("Paste"),action:(t,e)=>{const n=t.fs.getClipboard();if(n?.items?.size>0){const i=t.fs.path.get();let o=i.path,r=i.storage;e.length===1&&e[0]?.type==="dir"&&(o=e[0].path,r=e[0].storage);const s={storage:r||"",path:o||"",type:"dir"};t.modal.open(n.type==="cut"?uo:yu,{items:{from:Array.from(n.items),to:s}})}},show:(t,e)=>t.features?.copy??!1?t.fs.getClipboard()?.items?.size>0:!1,order:130},{id:xt.archive,title:({t})=>t("Archive"),action:(t,e)=>t.modal.open(xu,{items:e}),show:Eo(mt({target:"many",feature:"archive"}),xo(mt({target:"one",feature:"archive"}),(t,e)=>e.target?.mime_type!=="application/zip")),order:140},{id:xt.unarchive,title:({t})=>t("Unarchive"),action:(t,e)=>t.modal.open(Eu,{items:e}),show:mt({target:"one",feature:"unarchive",mimeType:"application/zip"}),order:150},{id:xt.delete,title:({t})=>t("Delete"),action:(t,e)=>{t.modal.open(Gs,{items:e})},show:Eo(mt({feature:"delete",target:"one"}),mt({feature:"delete",target:"many"})),order:160}],gz=["data-theme"],_z={key:0,class:"vuefinder__external-drop-overlay vuefinder__external-drop-overlay--relative"},yz={class:"vuefinder__external-drop-message"},bz={class:"vuefinder__main__content"},wz=Ce({__name:"VueFinderView",props:{id:{},driver:{},config:{},features:{},debug:{type:Boolean},locale:{},contextMenuItems:{},selectionMode:{},selectionFilterType:{},selectionFilterMimeIncludes:{},onError:{type:Function},onSelect:{type:Function},onPathChange:{type:Function},onUploadComplete:{type:Function},onDeleteComplete:{type:Function},onNotify:{type:Function},onReady:{type:Function},onFileDclick:{type:Function},onFolderDclick:{type:Function},customUploader:{type:Function}},emits:["select","path-change","upload-complete","delete-complete","notify","error","ready","file-dclick","folder-dclick","update:locale"],setup(t,{emit:e}){const n=e,i=t,o=je(),r=In("root"),s=o.config;$e(()=>i.features,w=>{const S=jg(w);Object.keys(o.features).forEach(b=>{delete o.features[b]}),Object.assign(o.features,S)},{deep:!0});const a=o.fs,l=Oe(o.i18n.localeAtom),c=Oe(s.state),u=te(()=>{const w=c.value;return{"--vf-grid-item-width":`${w.gridItemWidth}px`,"--vf-grid-item-height":`${w.gridItemHeight}px`,"--vf-grid-item-gap":`${w.gridItemGap}px`,"--vf-grid-icon-size":`${w.gridIconSize}px`,"--vf-list-item-height":`${w.listItemHeight}px`,"--vf-list-item-gap":`${w.listItemGap}px`,"--vf-list-icon-size":`${w.listIconSize}px`}});E5();const{isDraggingExternal:d,handleDragEnter:h,handleDragOver:m,handleDragLeave:f,handleDrop:p}=x5();function _(w){a.setPath(w.dirname),s.get("persist")&&s.set("path",w.dirname),a.setReadOnly(w.read_only??!1),o.modal.close(),a.setFiles(w.files),a.clearSelection(),a.setSelectedCount(0),a.setStorages(w.storages)}o.adapter.onBeforeOpen=()=>{a.setLoading(!0)},o.adapter.onAfterOpen=w=>{_(w),a.setLoading(!1)},o.emitter.on("vf-upload-complete",w=>{n("upload-complete",w)}),o.emitter.on("vf-delete-complete",w=>{n("delete-complete",w)}),o.emitter.on("vf-notify",w=>{n("notify",w)}),o.emitter.on("vf-file-dclick",w=>{n("file-dclick",w)}),o.emitter.on("vf-folder-dclick",w=>{n("folder-dclick",w)}),$e(()=>i.config?.theme,w=>{w&&s.set("theme",v(w))},{immediate:!0}),$e(l,(w,S)=>{w!==S&&n("update:locale",String(w))},{immediate:!1}),et(()=>{o.root=r.value,$e(()=>s.get("path"),S=>{o.adapter.open(S)});const w=s.get("persist")?s.get("path"):s.get("initialPath")??"";a.setPath(w),o.adapter.open(w),a.path.listen(S=>{n("path-change",S.path)}),a.selectedItems.listen(S=>{n("select",S)}),n("ready")});const C=async w=>{const S=await p(w);S.length>0&&(o.modal.open(Cu),setTimeout(()=>{o.emitter.emit("vf-external-files-dropped",S.map(b=>b.file))},100))};return(w,S)=>(y(),T("div",{ref_key:"root",ref:r,tabindex:"0",class:Ae(["vuefinder vuefinder__main vuefinder__themer",{"vuefinder--dragging-external":v(d)}]),"data-theme":v(o).theme.current,style:At(u.value),onDragenter:S[2]||(S[2]=(...b)=>v(h)&&v(h)(...b)),onDragover:S[3]||(S[3]=(...b)=>v(m)&&v(m)(...b)),onDragleave:S[4]||(S[4]=(...b)=>v(f)&&v(f)(...b)),onDrop:C},[g("div",{class:Ae(v(o).theme.current),style:{height:"100%",width:"100%"}},[g("div",{class:Ae([v(c)?.fullScreen?"vuefinder__main__fixed":"vuefinder__main__relative","vuefinder__main__container"]),onMousedown:S[0]||(S[0]=b=>v(o).emitter.emit("vf-contextmenu-hide")),onTouchstart:S[1]||(S[1]=b=>v(o).emitter.emit("vf-contextmenu-hide"))},[v(d)?(y(),T("div",_z,[g("div",yz,L(v(o).i18n.t("Drag and drop the files/folders to here.")),1)])):ue("",!0),v(c).showMenuBar?(y(),ne(G4,{key:1})):ue("",!0),v(c).showToolbar?(y(),ne(XL,{key:2})):ue("",!0),j(zj),g("div",bz,[j(mz),j(T3,{"on-file-dclick":i.onFileDclick,"on-folder-dclick":i.onFolderDclick},{icon:we(b=>[Ve(w.$slots,"icon",wn(Jn(b)))]),_:3},8,["on-file-dclick","on-folder-dclick"])]),j(U3,null,{actions:we(b=>[Ve(w.$slots,"status-bar",wn(Jn(b)))]),_:3})],34),(y(),ne(ws,{to:"body"},[j(Up,{name:"fade"},{default:we(()=>[v(o).modal.visible?(y(),ne($t(v(o).modal.type),{key:0})):ue("",!0)]),_:1})])),j(O3,{items:v(l_)},null,8,["items"]),v(c).notificationsEnabled?(y(),ne(v(vk),{key:0,position:v(c).notificationPosition,duration:v(c).notificationDuration,"visible-toasts":v(c).notificationVisibleToasts,"rich-colors":v(c).notificationRichColors},null,8,["position","duration","visible-toasts","rich-colors"])):ue("",!0)],2)],46,gz))}}),Sz=Ce({__name:"VueFinderProvider",props:{id:{},driver:{},config:{},features:{},debug:{type:Boolean,default:!1},locale:{},contextMenuItems:{default:()=>l_},selectionMode:{default:"multiple"},selectionFilterType:{default:"both"},selectionFilterMimeIncludes:{default:()=>[]},onError:{},onSelect:{},onPathChange:{},onUploadComplete:{},onDeleteComplete:{},onNotify:{},onReady:{},onFileDclick:{},onFolderDclick:{},customUploader:{}},setup(t){const e=t,n=e.id??Ao(Ql);if(!n)throw new Error('VueFinderProvider requires an "id" prop.');const i=dI(e,Ao("VueFinderOptions")||{});return $e(()=>e.config,o=>{if(o){const r={};for(const s in o){const a=v(o[s]);a!==void 0&&(r[s]=a)}i.config.init(r)}},{deep:!0,immediate:!0}),$e(()=>e.locale,o=>{o&&i.i18n.localeAtom&&i.i18n.localeAtom.get()!==o&&i.i18n.localeAtom.set(o)},{immediate:!0}),KR(n,i),Hp(Ql,n),bs(()=>{YR(n)}),(o,r)=>(y(),ne(wz,wn(Jn(e)),{icon:we(s=>[Ve(o.$slots,"icon",wn(Jn(s)))]),"status-bar":we(s=>[Ve(o.$slots,"status-bar",wn(Jn(s)))]),_:3},16))}});function xN(t){const e=je(t),n=o=>o||e.fs.path.get().path||"",i=o=>{Array.isArray(o.files)&&e.fs.setFiles(o.files)};return{async refresh(){const o=e.fs.path.get().path||"";e.adapter.invalidateListQuery(o),await e.adapter.open(o)},async open(o){await e.adapter.open(o)},preview(o){const r=(e.fs.files.get()||[]).find(s=>s.path===o);!r||r.type!=="file"||e.modal.open(cr,{storage:r.storage,item:r})},notify(o,r){Bi(e,o,r)},getPath(){return e.fs.path.get().path||""},select(o){const r=new Set((e.fs.files.get()||[]).map(a=>a.path)),s=(o||[]).filter(a=>r.has(a));e.fs.setSelection(s)},selectOne(o){new Set((e.fs.files.get()||[]).map(r=>r.path)).has(o)&&e.fs.setSelection([o])},clearSelection(){e.fs.clearSelection()},getSelectedPaths(){return(e.fs.selectedItems.get()||[]).map(o=>o.path)},async createFolder(o,r){const s=await e.adapter.createFolder({path:n(r),name:o});i(s)},async createFile(o,r){const s=await e.adapter.createFile({path:n(r),name:o});i(s)},async delete(o,r){const s=n(r),a=new Map((e.fs.files.get()||[]).map(u=>[u.path,u])),l=(o||[]).map(u=>a.get(u)).filter(u=>!!u).map(u=>({path:u.path,type:u.type})),c=await e.adapter.delete({path:s,items:l});i(c)},async rename(o,r,s){const a=await e.adapter.rename({path:n(s),item:o,name:r});i(a)},async copy(o,r,s){const a=await e.adapter.copy({path:n(s),sources:o,destination:r});i(a)},async move(o,r,s){const a=await e.adapter.move({path:n(s),sources:o,destination:r});i(a)},getFiles(){return e.fs.files.get()||[]},getStorages(){return e.fs.storages.get()||[]},isLoading(){return e.fs.isLoading()},isReadOnly(){return e.fs.getReadOnly()}}}const Cz={install(t,e={}){e.i18n=e.i18n??{};const[n]=Object.keys(e.i18n);e.locale=e.locale??n??"en",t.provide("VueFinderOptions",e),t.component("VueFinder",Sz)}};function Ez(t){t.use(Cz,{i18n:{zhCN:()=>nt(()=>import("./zhCN-0_iHo67e.js"),[],import.meta.url),en:()=>nt(()=>import("./en-C_Tot-hO.js"),[],import.meta.url)}})}const xz=()=>{const{i18n:t}=bc;let e=!1,n=null,i=[];async function o(){return e&&n||(e=!0,n=(async()=>{try{return(await Oi.v1Token.tokencontrollerRefresh({headers:{[Ti]:wi.generateBearerToken(Fb())}})).code===0}catch(p){return console.error(p),!1}finally{e=!1,n=null}})()),n}async function r(p){return l(p)?(gr.error(t.global.t("message.error.loginExpired")),Qi().logoutDialog(),Promise.reject(t.global.t("message.error.loginExpired"))):new Promise((_,C)=>{i.push({resolve:_,reject:C,config:p}),e||o().then(w=>{w?i.forEach(({resolve:S,reject:b,config:E})=>{E.headers[si]=wi.generateBearerToken(is()),a(E),d.request(E).then(S).catch(b)}):(i.forEach(({reject:S})=>S(t.global.t("message.error.refreshFailed"))),gr.error(t.global.t("message.error.loginExpired")),Qi().logoutDialog()),i=[]})})}function s(p){return p.headers[vt.CSRF_TOKEN_HEADER_NAME]=pm.get(vt.CSRF_KEY),p.headers[si]=wi.generateBearerToken(is()),p.headers[vt.ACCEPT_LANGUAGE_HEADER_NAME]=t.global.locale.value,p}function a(p){p.headers["X-Token-Refreshed"]="true"}function l(p){return p.headers["X-Token-Refreshed"]==="true"}async function c(p){if(p.headers[si]){const _=wi.extractBearerToken(p.headers[si]);Ib(_),p.config.headers[si]=wi.generateBearerToken(_)}if(p.headers[Ti]){const _=wi.extractBearerToken(p.headers[Ti]);Db(_),p.config.headers[Ti]=wi.generateBearerToken(_)}if(p.data.code===zd.Unauthorized&&!p.config.url?.includes("/api/v1/token/refresh"))return r(p.config);if(p.data.code===zd.Forbidden)return Qi().logoutDialog(),Promise.reject(t.global.t("user.notLoggedIn"));if(p.data.code!==0){const _=p.data.message||t.global.t("message.error.requestFailed");return gr.error(_),Promise.reject(_)}return p.data}function u(p){return console.error(p),gr.error(p.message),Promise.reject(p)}const d=Nd(vt.REMOTE_SERVICE_PREFIX,{baseURL:`/${vt.REMOTE_SERVICE_PREFIX}`});d.interceptors.request.use(s,u),d.interceptors.response.use(c,u);const h=$b(),m=window.__GLOBAL_CONFIG__?.projectHash,f=Nd(vt.LOCAL_SERVICE_PREFIX,{baseURL:`${h}/${m}`});f.interceptors.request.use(s,u),f.interceptors.response.use(c,u)},c_=vi("setting",{state:()=>({dependencies:[],devDependencies:[],packageJson:{}}),getters:{vueVersion:t=>t.dependencies.find(e=>e.name==="vue")?.version||"",deps:t=>[...t.dependencies,...t.devDependencies],compHubVersion:()=>window.__GLOBAL_CONFIG__.version||""},actions:{setDependencies(t){this.$patch(e=>{e.dependencies=t})},setDevDependencies(t){this.$patch(e=>{e.devDependencies=t})},setPackageJson(t){this.$patch(e=>{e.packageJson=t})},async initSetting(){await this.fetchPackageJson(),await this.initPreviewSetting()},async fetchPackageJson(){await nC.v1Comp.compcontrollerPackagejson().then(t=>{const e=t.data?.packageJson??{};this.setPackageJson(e)})},async initPreviewSetting(){const t=Ji(Vb,{dependencies:[],devDependencies:[]}),{dependencies:e=[],devDependencies:n=[]}=t.value,i=Object.entries(this.packageJson?.dependencies??{}).map(([r,s])=>{const a=e.find(l=>l.name===r);return{name:r,version:s,match:a?.match??vt.COMP_MATCH_TYPE_MAJOR_VERSION}}),o=Object.entries(this.packageJson?.devDependencies??{}).map(([r,s])=>{const a=n.find(l=>l.name===r);return{name:r,version:s,match:a?.match??vt.COMP_MATCH_TYPE_MAJOR_VERSION}});t.value={dependencies:i,devDependencies:o},this.setDependencies(i),this.setDevDependencies(o)}}}),Tz=vi("upgrade",{state:()=>({upgradeInfo:{}}),getters:{isForceUpgrade:t=>t.upgradeInfo.hasUpgrade&&t.upgradeInfo.isForce,isUpgrade:t=>t.upgradeInfo.hasUpgrade,upgradeDesc:t=>t.upgradeInfo.desc,latestVersion:t=>t.upgradeInfo.latestVersion,hasUpgrade:t=>t.upgradeInfo.hasUpgrade},actions:{setUpgradeInfo(t){this.$patch(e=>{e.upgradeInfo=t})},async getUpgradeInfo(){if(Object.keys(this.upgradeInfo).length>0)return;const t=c_(),e=await Oi.v2Upgrade.upgradecontrollerv2Check({compHubVersion:t.compHubVersion});this.setUpgradeInfo(e.data)}}});var ns={exports:{}};var $z=ns.exports,Np;function kz(){return Np||(Np=1,(function(t,e){(function(n,i){t.exports=i()})($z,function(){var n={};n.version="0.2.0";var i=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};n.configure=function(f){var p,_;for(p in f)_=f[p],_!==void 0&&f.hasOwnProperty(p)&&(i[p]=_);return this},n.status=null,n.set=function(f){var p=n.isStarted();f=o(f,i.minimum,1),n.status=f===1?null:f;var _=n.render(!p),C=_.querySelector(i.barSelector),w=i.speed,S=i.easing;return _.offsetWidth,a(function(b){i.positionUsing===""&&(i.positionUsing=n.getPositioningCSS()),l(C,s(f,w,S)),f===1?(l(_,{transition:"none",opacity:1}),_.offsetWidth,setTimeout(function(){l(_,{transition:"all "+w+"ms linear",opacity:0}),setTimeout(function(){n.remove(),b()},w)},w)):setTimeout(b,w)}),this},n.isStarted=function(){return typeof n.status=="number"},n.start=function(){n.status||n.set(0);var f=function(){setTimeout(function(){n.status&&(n.trickle(),f())},i.trickleSpeed)};return i.trickle&&f(),this},n.done=function(f){return!f&&!n.status?this:n.inc(.3+.5*Math.random()).set(1)},n.inc=function(f){var p=n.status;return p?(typeof f!="number"&&(f=(1-p)*o(Math.random()*p,.1,.95)),p=o(p+f,0,.994),n.set(p)):n.start()},n.trickle=function(){return n.inc(Math.random()*i.trickleRate)},(function(){var f=0,p=0;n.promise=function(_){return!_||_.state()==="resolved"?this:(p===0&&n.start(),f++,p++,_.always(function(){p--,p===0?(f=0,n.done()):n.set((f-p)/f)}),this)}})(),n.render=function(f){if(n.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var p=document.createElement("div");p.id="nprogress",p.innerHTML=i.template;var _=p.querySelector(i.barSelector),C=f?"-100":r(n.status||0),w=document.querySelector(i.parent),S;return l(_,{transition:"all 0 linear",transform:"translate3d("+C+"%,0,0)"}),i.showSpinner||(S=p.querySelector(i.spinnerSelector),S&&m(S)),w!=document.body&&u(w,"nprogress-custom-parent"),w.appendChild(p),p},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(i.parent),"nprogress-custom-parent");var f=document.getElementById("nprogress");f&&m(f)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var f=document.body.style,p="WebkitTransform"in f?"Webkit":"MozTransform"in f?"Moz":"msTransform"in f?"ms":"OTransform"in f?"O":"";return p+"Perspective"in f?"translate3d":p+"Transform"in f?"translate":"margin"};function o(f,p,_){return f<p?p:f>_?_:f}function r(f){return(-1+f)*100}function s(f,p,_){var C;return i.positionUsing==="translate3d"?C={transform:"translate3d("+r(f)+"%,0,0)"}:i.positionUsing==="translate"?C={transform:"translate("+r(f)+"%,0)"}:C={"margin-left":r(f)+"%"},C.transition="all "+p+"ms "+_,C}var a=(function(){var f=[];function p(){var _=f.shift();_&&_(p)}return function(_){f.push(_),f.length==1&&p()}})(),l=(function(){var f=["Webkit","O","Moz","ms"],p={};function _(b){return b.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(E,x){return x.toUpperCase()})}function C(b){var E=document.body.style;if(b in E)return b;for(var x=f.length,O=b.charAt(0).toUpperCase()+b.slice(1),$;x--;)if($=f[x]+O,$ in E)return $;return b}function w(b){return b=_(b),p[b]||(p[b]=C(b))}function S(b,E,x){E=w(E),b.style[E]=x}return function(b,E){var x=arguments,O,$;if(x.length==2)for(O in E)$=E[O],$!==void 0&&E.hasOwnProperty(O)&&S(b,O,$);else S(b,x[1],x[2])}})();function c(f,p){var _=typeof f=="string"?f:h(f);return _.indexOf(" "+p+" ")>=0}function u(f,p){var _=h(f),C=_+p;c(_,p)||(f.className=C.substring(1))}function d(f,p){var _=h(f),C;c(f,p)&&(C=_.replace(" "+p+" "," "),f.className=C.substring(1,C.length-1))}function h(f){return(" "+(f.className||"")+" ").replace(/\s+/gi," ")}function m(f){f&&f.parentNode&&f.parentNode.removeChild(f)}return n})})(ns)),ns.exports}var Oz=kz();const Zl=Di(Oz),{i18n:Az}=bc;function Pz(){no.beforeEach(async(t,e)=>{Zl.start();const n=Xo(),i=Qi(),o=c_(),r=Tz();if(t.path!==e.path&&(await o.initSetting(),await i.fetchCsrfToken(),await r.getUpgradeInfo()),r.isForceUpgrade&&!t.path.startsWith("/upgrade"))return{path:"/upgrade"};if(t.path===e.path&&t.fullPath!==e.fullPath)return;const s=n.visitedViews.find(l=>l.path===t.path);if(s){if(t.fullPath===s.fullPath)return;const{hash:l="",query:c={}}=t,{query:u={},hash:d=""}=s,h=ty(u);if(!t.redirectedFrom){const m={query:{...h,...c},hash:l||d};return{path:t.path,...m}}}if(i.isGuestLogin()||!i.isAccessTokenExist()){if(!t.meta.noAuth)return i.logoutDialog(),!1}else{if(t.meta.noAuth){if(t.path.startsWith("/login")){const l=t.query.type==="logout";if(i.isAccessTokenExist()&&!l)return"/"}else i.isRealUserLogin()||await i.fetchWhoAmI();return}if(i.isRealUserLogin()||await i.fetchWhoAmI(),!i.isRealUserLogin())return i.logoutDialog(),!1}}),no.afterEach(t=>{const e=t.meta.title;document.title=Az.global.t(e)||vt.SITE_TITLE,Zl.done()})}Zl.configure({easing:"ease",speed:500,showSpinner:!1,trickleSpeed:200,parent:"body"});async function Rz(t){await f$(),xz(),mm(t),vm(t),f2(t),F2(t),Pz(),L2(),V2(),p$(t),m$(t),v$(t),Ez(t)}async function Iz(){const t=ic(Ab);await Rz(t),t.mount("#app")}Iz();export{kE as A,Lw as B,Kz as C,Vb as D,vt as E,Tz as F,l_ as G,Jz as H,jb as I,Qi as J,tN as K,zz as L,Qz as M,Gz as N,Tb as O,Hz as R,Yz as S,Bz as T,Zz as V,nt as _,eN as a,Nz as b,Vz as c,Ug as d,jz as e,Y0 as f,Xz as g,Wz as h,qz as i,Uz as j,Ew as k,ac as l,Gb as m,bc as n,nN as o,xN as p,nC as q,Vw as r,Oi as s,Dz as t,yc as u,Lz as v,$b as w,TE as x,c_ as y,Xo as z};
|
|
20
|
+
type: ${a.type}`)}),i.length>0&&this.#f()}removeFiles(e){const{files:n,currentUploads:i}=this.getState(),o={...n},r={...i},s=Object.create(null);e.forEach(u=>{n[u]&&(s[u]=n[u],delete o[u])});function a(u){return s[u]===void 0}Object.keys(r).forEach(u=>{const d=i[u].fileIDs.filter(a);if(d.length===0){delete r[u];return}const{capabilities:h}=this.getState();if(d.length!==i[u].fileIDs.length&&!h.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");r[u]={...i[u],fileIDs:d}});const l={currentUploads:r,files:o};Object.keys(o).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),this.#d();const c=Object.keys(s);c.forEach(u=>{this.emit("file-removed",s[u])}),c.length>5?this.log(`Removed ${c.length} files`):this.log(`Removed files: ${c.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;const n=this.getFile(e),o=!(n.isPaused||!1);return this.setFileState(e,{isPaused:o}),this.emit("upload-pause",n,o),o}pauseAll(){const e={...this.getState().files};Object.keys(e).filter(i=>!e[i].progress.uploadComplete&&e[i].progress.uploadStarted).forEach(i=>{const o={...e[i],isPaused:!0};e[i]=o}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(i=>!e[i].progress.uploadComplete&&e[i].progress.uploadStarted).forEach(i=>{const o={...e[i],isPaused:!1,error:null};e[i]=o}),this.setState({files:e}),this.emit("resume-all")}#v(){const{files:e}=this.getState();return Object.keys(e).filter(n=>{const i=e[n];return i.error&&(!i.missingRequiredMetaFields||i.missingRequiredMetaFields.length===0)})}async#g(){const e=this.#v(),n={...this.getState().files};if(e.forEach(o=>{n[o]={...n[o],isPaused:!1,error:null}}),this.setState({files:n,error:null}),this.emit("retry-all",this.getFilesByIds(e)),e.length===0)return{successful:[],failed:[]};const i=this.#h(e,{forceAllowNewUpload:!0});return this.#p(i)}async retryAll(){const e=await this.#g();return this.emit("complete",e),e}cancelAll(){this.emit("cancel-all");const{files:e}=this.getState(),n=Object.keys(e);n.length&&this.removeFiles(n),this.setState(Pr)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));const n=this.#h([e],{forceAllowNewUpload:!0});return this.#p(n)}logout(){this.iteratePlugins(e=>{e.provider?.logout?.()})}#S=(e,n)=>{const i=e?this.getFile(e.id):void 0;if(e==null||!i){this.log(`Not setting progress for a file that has been removed: ${e?.id}`);return}if(i.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${e.id}`);return}const o={bytesTotal:n.bytesTotal,percentage:n.bytesTotal!=null&&Number.isFinite(n.bytesTotal)&&n.bytesTotal>0?Math.round(n.bytesUploaded/n.bytesTotal*100):void 0};i.progress.uploadStarted!=null?this.setFileState(e.id,{progress:{...i.progress,...o,bytesUploaded:n.bytesUploaded}}):this.setFileState(e.id,{progress:{...i.progress,...o}}),this.#d()};#_(){const e=this.#C();let n=null;e!=null&&(n=Math.round(e*100),n>100?n=100:n<0&&(n=0)),this.emit("progress",n??0),this.setState({totalProgress:n??0})}#d=jA(()=>this.#_(),500,{leading:!0,trailing:!0});[Symbol.for("uppy test: updateTotalProgress")](){return this.#_()}#C(){const n=this.getFiles().filter(l=>l.progress.uploadStarted||l.progress.preprocess||l.progress.postprocess);if(n.length===0)return 0;if(n.every(l=>l.progress.uploadComplete))return 1;const i=l=>l.progress.bytesTotal!=null&&l.progress.bytesTotal!==0,o=n.filter(i),r=n.filter(l=>!i(l));if(o.every(l=>l.progress.uploadComplete)&&r.length>0&&!r.every(l=>l.progress.uploadComplete))return null;const s=o.reduce((l,c)=>l+(c.progress.bytesTotal??0),0),a=o.reduce((l,c)=>l+(c.progress.bytesUploaded||0),0);return s===0?0:a/s}#x(){const e=(o,r,s)=>{let a=o.message||"Unknown error";o.details&&(a+=` ${o.details}`),this.setState({error:a}),r!=null&&r.id in this.getState().files&&this.setFileState(r.id,{error:a,response:s})};this.on("error",e),this.on("upload-error",(o,r,s)=>{if(e(r,o,s),typeof r=="object"&&r.message){this.log(r.message,"error");const a=new Error(this.i18n("failedToUpload",{file:o?.name??""}));a.isUserFacing=!0,a.details=r.message,r.details&&(a.details+=` ${r.details}`),this.#s([a])}else this.#s([r])});let n=null;this.on("upload-stalled",(o,r)=>{const{message:s}=o,a=r.map(l=>l.meta.name).join(", ");n||(this.info({message:s,details:a},"warning",this.opts.infoTimeout),n=setTimeout(()=>{n=null},this.opts.infoTimeout)),this.log(`${s} ${a}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});const i=o=>{const r=o.filter(a=>{const l=a!=null&&this.getFile(a.id);return l||this.log(`Not setting progress for a file that has been removed: ${a?.id}`),l}),s=Object.fromEntries(r.map(a=>[a.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:a.size}}]));this.patchFilesState(s)};this.on("upload-start",i),this.on("upload-progress",this.#S),this.on("upload-success",(o,r)=>{if(o==null||!this.getFile(o.id)){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}const s=this.getFile(o.id).progress,a=this.#a.size>0;this.setFileState(o.id,{progress:{...s,postprocess:a?{mode:"indeterminate"}:void 0,uploadComplete:!0,...!a&&{complete:!0},percentage:100,bytesUploaded:s.bytesTotal},response:r,uploadURL:r.uploadURL,isPaused:!1}),o.size==null&&this.setFileState(o.id,{size:r.bytesUploaded||s.bytesTotal}),this.#d()}),this.on("preprocess-progress",(o,r)=>{if(o==null||!this.getFile(o.id)){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}this.setFileState(o.id,{progress:{...this.getFile(o.id).progress,preprocess:r}})}),this.on("preprocess-complete",o=>{if(o==null||!this.getFile(o.id)){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}const r={...this.getState().files};r[o.id]={...r[o.id],progress:{...r[o.id].progress}},delete r[o.id].progress.preprocess,this.setState({files:r})}),this.on("postprocess-progress",(o,r)=>{if(o==null||!this.getFile(o.id)){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}this.setFileState(o.id,{progress:{...this.getState().files[o.id].progress,postprocess:r}})}),this.on("postprocess-complete",o=>{const r=o&&this.getFile(o.id);if(r==null){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}const{postprocess:s,...a}=r.progress;this.patchFilesState({[r.id]:{progress:{...a,complete:!0}}})}),this.on("restored",()=>{this.#d()}),this.on("dashboard:file-edit-complete",o=>{o&&this.#u(o)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",this.#c),window.addEventListener("offline",this.#c),setTimeout(this.#c,3e3))}updateOnlineStatus(){window.navigator.onLine??!0?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}#c=this.updateOnlineStatus.bind(this);getID(){return this.opts.id}use(e,...n){if(typeof e!="function"){const s=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(s)}const i=new e(this,...n),o=i.id;if(!o)throw new Error("Your plugin must have an id");if(!i.type)throw new Error("Your plugin must have a type");const r=this.getPlugin(o);if(r){const s=`Already found a plugin named '${r.id}'. Tried to use: '${o}'.
|
|
21
|
+
Uppy plugins must have unique \`id\` options.`;throw new Error(s)}return e.VERSION&&this.log(`Using ${o} v${e.VERSION}`),i.type in this.#e?this.#e[i.type].push(i):this.#e[i.type]=[i],i.install(),this.emit("plugin-added",i),this}getPlugin(e){for(const n of Object.values(this.#e)){const i=n.find(o=>o.id===e);if(i!=null)return i}}[Symbol.for("uppy test: getPlugins")](e){return this.#e[e]}iteratePlugins(e){Object.values(this.#e).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const n=this.#e[e.type],i=n.findIndex(s=>s.id===e.id);i!==-1&&n.splice(i,1);const r={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(r)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),this.#n(),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",this.#c),window.removeEventListener("offline",this.#c))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,n="info",i=3e3){const o=typeof e=="object";this.setState({info:[...this.getState().info,{type:n,message:o?e.message:e,details:o?e.details:null}]}),setTimeout(()=>this.hideInfo(),i),this.emit("info-visible")}log(e,n){const{logger:i}=this.opts;switch(n){case"error":i.error(e);break;case"warning":i.warn(e);break;default:i.debug(e);break}}#y=new Map;registerRequestClient(e,n){this.#y.set(e,n)}getRequestClientForFile(e){if(!("remote"in e&&e.remote))throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const n=this.#y.get(e.remote.requestClientId);if(n==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return n}async restore(e){this.log(`Core: Running restored upload "${e}"`);const n=await this.#p(e);return this.emit("complete",n),n}#h(e,n={}){const{forceAllowNewUpload:i=!1}=n,{allowNewUpload:o,currentUploads:r}=this.getState();if(!o&&!i)throw new Error("Cannot create a new upload: already uploading.");const s=BA();return this.emit("upload",s,this.getFilesByIds(e)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...r,[s]:{fileIDs:e,step:0,result:{}}}}),s}[Symbol.for("uppy test: createUpload")](...e){return this.#h(...e)}#T(e){const{currentUploads:n}=this.getState();return n[e]}addResultData(e,n){if(!this.#T(e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}const{currentUploads:i}=this.getState(),o={...i[e],result:{...i[e].result,...n}};this.setState({currentUploads:{...i,[e]:o}})}#b(e){const{[e]:n,...i}=this.getState().currentUploads;this.setState({currentUploads:i})}async#p(e){const n=()=>{const{currentUploads:s}=this.getState();return s[e]};let i=n();if(!i)throw new Error("Nonexistent upload");const o=[...this.#r,...this.#o,...this.#a];try{for(let s=i.step||0;s<o.length;s++){const a=o[s];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...i,step:s}}});const{fileIDs:l}=i;if(await a(l,e),i=n(),!i)break}}catch(s){throw this.#b(e),s}if(i){i.fileIDs.forEach(c=>{const u=this.getFile(c);u?.progress.postprocess&&this.emit("postprocess-complete",u)});const s=i.fileIDs.map(c=>this.getFile(c)),a=s.filter(c=>!c.error),l=s.filter(c=>c.error);this.addResultData(e,{successful:a,failed:l,uploadID:e}),i=n()}let r;return i&&(r=i.result,this.#b(e)),r==null&&(this.log(`Not setting result for an upload that has been removed: ${e}`),r={successful:[],failed:[],uploadID:e}),r}async upload(){this.#e.uploader?.length||this.log("No uploader type plugins are used","warning");let{files:e}=this.getState();if(this.#v().length>0){const o=await this.#g();if(!(this.getFiles().filter(s=>s.progress.uploadStarted==null).length>0))return this.emit("complete",o),o;({files:e}=this.getState())}const i=this.opts.onBeforeUpload(e);if(i===!1)throw new Error("Not starting the upload because onBeforeUpload returned false");i&&typeof i=="object"&&(e=i,this.setState({files:e}));try{if(this.#t.validateMinNumberOfFiles(e),!this.#l(e))throw new _n(this.i18n("missingRequiredMetaField"));const{currentUploads:o}=this.getState(),r=Object.values(o).flatMap(c=>c.fileIDs),s=Object.keys(e).filter(c=>{const u=this.getFile(c);return u&&!u.progress.uploadStarted&&!r.includes(c)}),a=this.#h(s),l=await this.#p(a);return this.emit("complete",l),l}catch(o){throw this.#s([o]),o}}}function Nh(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable}))),n.push.apply(n,i)}return n}function Xe(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Nh(Object(n),!0).forEach((function(i){ln(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Nh(Object(n)).forEach((function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))}))}return t}function ln(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GA(t,e){if(t==null)return{};var n,i,o=(function(s,a){if(s==null)return{};var l,c,u={},d=Object.keys(s);for(c=0;c<d.length;c++)l=d[c],a.indexOf(l)>=0||(u[l]=s[l]);return u})(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(i=0;i<r.length;i++)n=r[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function Mi(t){return(function(e){if(Array.isArray(e))return Fa(e)})(t)||(function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)})(t)||(function(e,n){if(e){if(typeof e=="string")return Fa(e,n);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Fa(e,n)}})(t)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
22
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Fa(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var Uh,QA,Rr,gt=(Uh=function(t){(function(){var e={}.hasOwnProperty;function n(){for(var i=[],o=0;o<arguments.length;o++){var r=arguments[o];if(r){var s=typeof r;if(s==="string"||s==="number")i.push(r);else if(Array.isArray(r)){if(r.length){var a=n.apply(null,r);a&&i.push(a)}}else if(s==="object")if(r.toString===Object.prototype.toString)for(var l in r)e.call(r,l)&&r[l]&&i.push(l);else i.push(r.toString())}}return i.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n})()},Uh(Rr={path:QA,exports:{},require:function(t,e){return(function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")})(e==null&&Rr.path)}},Rr.exports),Rr.exports),Cn=function(t){return function(e,n){if(!e)return t;var i;typeof e=="string"?i=e:n=e;var o=t;return i&&(o+="__"+i),o+(n?Object.keys(n).reduce((function(r,s){var a=n[s];return a&&(r+=" "+(typeof a=="boolean"?o+"--"+s:o+"--"+s+"_"+a)),r}),""):"")}};function Ol(t,e,n){var i,o,r,s,a;function l(){var u=Date.now()-s;u<e&&u>=0?i=setTimeout(l,e-u):(i=null,n||(a=t.apply(r,o),r=o=null))}e==null&&(e=100);var c=function(){r=this,o=arguments,s=Date.now();var u=n&&!i;return i||(i=setTimeout(l,e)),u&&(a=t.apply(r,o),r=o=null),a};return c.clear=function(){i&&(clearTimeout(i),i=null)},c.flush=function(){i&&(a=t.apply(r,o),r=o=null,clearTimeout(i),i=null)},c}Ol.debounce=Ol;var $l=Ol,Re=function(){return Re=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Re.apply(this,arguments)};function ov(t,e){var n,i;return t&&e?(n=""+t+e[0].toUpperCase()+e.slice(1),i=t+"-"+e):(n=t||e,i=t||e),{name:n,classname:i}}function rv(t){return/^blob:/.test(t)}function zh(t){return rv(t)||(function(e){return/^data:/.test(e)})(t)}function Ni(t){return!!(t&&t.constructor&&t.call&&t.apply)}function _t(t){return t===void 0}function Xr(t){return typeof t=="object"&&t!==null}function kl(t,e,n){var i={};return Xr(t)?(Object.keys(e).forEach((function(o){_t(t[o])?i[o]=e[o]:Xr(e[o])?Xr(t[o])?i[o]=kl(t[o],e[o],n[o]):i[o]=t[o]?e[o]:n[o]:e[o]===!0||e[o]===!1?i[o]=!!t[o]:i[o]=t[o]})),i):t?e:n}function Ir(t){var e=Number(t);return Number.isNaN(e)?t:e}function Vh(t){return typeof(t=="number"||(function(e){return typeof e=="object"&&e!==null})(t)&&toString.call(t)=="[object Number]")&&!sv(t)}function sv(t){return t!=t}function av(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}var Oo=function(t,e){t===void 0&&(t={}),e===void 0&&(e={}),this.type="manipulateImage",this.move=t,this.scale=e},XA=function(t,e){e===void 0&&(e={}),this.type="resize",this.directions=t,this.params=e},Ac=function(t){this.type="move",this.directions=t},JA=(function(){function t(e,n,i,o,r){this.type="drag",this.nativeEvent=e,this.position=i,this.previousPosition=o,this.element=n,this.anchor=r}return t.prototype.shift=function(){var e=this,n=e.element,i=e.anchor,o=e.position;if(n){var r=n.getBoundingClientRect(),s=r.left,a=r.top;return{left:o.left-s-i.left,top:o.top-a-i.top}}return{left:0,top:0}},t})(),Pc={name:"DraggableElement",props:{classname:{type:String}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){if(!this.$refs.draggable)throw new Error('You should add ref "draggable" to your root element to use draggable mixin');this.touches=[],this.hovered=!1},methods:{onMouseOver:function(){this.hovered||(this.hovered=!0,this.$emit("enter"))},onMouseLeave:function(){this.hovered&&!this.touches.length&&(this.hovered=!1,this.$emit("leave"))},onTouchStart:function(t){t.cancelable&&!this.disabled&&t.touches.length===1&&(this.touches=Mi(t.touches),this.hovered||(this.$emit("enter"),this.hovered=!0),t.touches.length&&this.initAnchor(this.touches.reduce((function(e,n){return{clientX:e.clientX+n.clientX/t.touches.length,clientY:e.clientY+n.clientY/t.touches.length}}),{clientX:0,clientY:0})),t.preventDefault&&t.preventDefault(),t.stopPropagation())},onTouchEnd:function(){this.processEnd()},onTouchMove:function(t){this.touches.length&&(this.processMove(t,t.touches),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation())},onMouseDown:function(t){if(!this.disabled){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.preventDefault())},onMouseUp:function(){this.processEnd()},initAnchor:function(t){var e=this.$refs.draggable.getBoundingClientRect(),n=e.left,i=e.right,o=e.bottom,r=e.top;this.anchor={left:t.clientX-n,top:t.clientY-r,bottom:o-t.clientY,right:i-t.clientX}},processMove:function(t,e){var n=Mi(e);if(this.touches.length){if(this.touches.length===1&&n.length===1){var i=this.$refs.draggable;this.$emit("drag",new JA(t,i,{left:n[0].clientX,top:n[0].clientY},{left:this.touches[0].clientX,top:this.touches[0].clientY},this.anchor))}this.touches=n}},processEnd:function(){this.touches.length&&this.$emit("drag-end"),this.hovered&&(this.$emit("leave"),this.hovered=!1),this.touches=[]}},emits:["drag","drag-end","leave","enter"]};Pc.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"draggable",class:n.classname,onTouchstart:e[1]||(e[1]=function(){return r.onTouchStart&&r.onTouchStart.apply(r,arguments)}),onMousedown:e[2]||(e[2]=function(){return r.onMouseDown&&r.onMouseDown.apply(r,arguments)}),onMouseover:e[3]||(e[3]=function(){return r.onMouseOver&&r.onMouseOver.apply(r,arguments)}),onMouseleave:e[4]||(e[4]=function(){return r.onMouseLeave&&r.onMouseLeave.apply(r,arguments)})},[Ve(t.$slots,"default")],34)};var La=Cn("vue-handler-wrapper"),lv={name:"HandlerWrapper",components:{DraggableElement:Pc},props:{horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},computed:{classes:function(){var t;if(this.horizontalPosition||this.verticalPosition){var e,n=ov(this.horizontalPosition,this.verticalPosition);t=La((ln(e={},n.classname,!0),ln(e,"disabled",this.disabled),e))}else t=La({disabled:this.disabled});return{root:t,draggable:La("draggable")}}},emits:["leave","enter","drag","drag-end"]};lv.render=function(t,e,n,i,o,r){var s=ze("DraggableElement");return y(),ne("div",{class:r.classes.root},[j(s,{class:r.classes.draggable,onDrag:e[1]||(e[1]=function(a){return t.$emit("drag",a)}),onDragEnd:e[2]||(e[2]=function(a){return t.$emit("drag-end")}),onLeave:e[3]||(e[3]=function(a){return t.$emit("leave")}),onEnter:e[4]||(e[4]=function(a){return t.$emit("enter")})},{default:we((function(){return[Ve(t.$slots,"default")]})),_:3},8,["class"])],2)};var ZA=Cn("vue-line-wrapper"),cv={name:"LineWrapper",components:{DraggableElement:Pc},props:{position:{type:String,required:!0},disabled:{type:Boolean,default:!1}},computed:{classname:function(){var t;return ZA((ln(t={},this.position,!0),ln(t,"disabled",this.disabled),t))}},emits:["leave","enter","drag","drag-end"]};cv.render=function(t,e,n,i,o,r){var s=ze("DraggableElement");return y(),ne(s,{class:r.classname,onDrag:e[1]||(e[1]=function(a){return t.$emit("drag",a)}),onDragEnd:e[2]||(e[2]=function(a){return t.$emit("drag-end")}),onLeave:e[3]||(e[3]=function(a){return t.$emit("leave")}),onEnter:e[4]||(e[4]=function(a){return t.$emit("enter")})},{default:we((function(){return[Ve(t.$slots,"default")]})),_:3},8,["class"])};var Rn=["left","right","top","bottom"],eP=["left","right"],tP=["top","bottom"],nP=["left","top"],iP=["fill-area","fit-area","stencil","none"],Bh={left:0,top:0,width:0,height:0};function Hh(t,e,n){return!(n=n||["width","height","left","top"]).some((function(i){return t[i]!==e[i]}))}function Ln(t){return{left:t.left,top:t.top,right:t.left+t.width,bottom:t.top+t.height}}function io(t,e){return{left:t.left-e.left,top:t.top-e.top}}function wt(t){return{left:t.left+t.width/2,top:t.top+t.height/2}}function No(t,e){var n={left:0,top:0,right:0,bottom:0};return Rn.forEach((function(i){var o=e[i],r=Ln(t)[i];n[i]=o!==void 0&&r!==void 0?i==="left"||i==="top"?Math.max(0,o-r):Math.max(0,r-o):0})),n}function An(t,e){return{left:t.left-e.left,top:t.top-e.top,width:t.width+e.left+e.right,height:t.height+e.top+e.bottom}}function Ms(t){return{left:-t.left,top:-t.top}}function Wt(t,e){return Re(Re({},t),{left:t.left+e.left,top:t.top+e.top})}function un(t,e,n,i){if(e!==1){if(n){var o=wt(t);return{width:t.width*e,height:t.height*e,left:t.left+t.width*(1-e)/2+(n.left-o.left)*(1-e),top:t.top+t.height*(1-e)/2+(n.top-o.top)*(1-e)}}return{width:t.width*e,height:t.height*e,left:t.left+t.width*(1-e)/2,top:t.top+t.height*(1-e)/2}}return t}function Je(t){return t.width/t.height}function oo(t,e){return Math.min(e.right!==void 0&&e.left!==void 0?(e.right-e.left)/t.width:1/0,e.bottom!==void 0&&e.top!==void 0?(e.bottom-e.top)/t.height:1/0)}function ro(t,e){var n={left:0,top:0},i=No(t,e);return i.left&&i.left>0?n.left=i.left:i.right&&i.right>0&&(n.left=-i.right),i.top&&i.top>0?n.top=i.top:i.bottom&&i.bottom>0&&(n.top=-i.bottom),n}function ja(t,e){var n;return e.minimum&&t<e.minimum?n=e.minimum:e.maximum&&t>e.maximum&&(n=e.maximum),n}function uv(t,e){var n=Je(t),i=Je(e);return e.width<1/0&&e.height<1/0?n>i?{width:e.width,height:e.width/n}:{width:e.height*n,height:e.height}:e.width<1/0?{width:e.width,height:e.width/n}:e.height<1/0?{width:e.height*n,height:e.height}:t}function dv(t,e){var n=e*Math.PI/180;return{width:Math.abs(t.width*Math.cos(n))+Math.abs(t.height*Math.sin(n)),height:Math.abs(t.width*Math.sin(n))+Math.abs(t.height*Math.cos(n))}}function ai(t,e){var n=e*Math.PI/180;return{left:t.left*Math.cos(n)-t.top*Math.sin(n),top:t.left*Math.sin(n)+t.top*Math.cos(n)}}function Ds(t,e){var n=No(Et(t,e),e);return n.left+n.right+n.top+n.bottom?n.left+n.right>n.top+n.bottom?Math.min((t.width+n.left+n.right)/t.width,oo(t,e)):Math.min((t.height+n.top+n.bottom)/t.height,oo(t,e)):1}function Et(t,e,n){n===void 0&&(n=!1);var i=ro(t,e);return Wt(t,n?Ms(i):i)}function Al(t){return{width:t.right!==void 0&&t.left!==void 0?t.right-t.left:1/0,height:t.bottom!==void 0&&t.top!==void 0?t.bottom-t.top:1/0}}function oP(t,e){return Re(Re({},t),{minWidth:Math.min(e.width,t.minWidth),minHeight:Math.min(e.height,t.minHeight),maxWidth:Math.min(e.width,t.maxWidth),maxHeight:Math.min(e.height,t.maxHeight)})}function hv(t,e,n){n===void 0&&(n=!0);var i={};return Rn.forEach((function(o){var r=t[o],s=e[o];r!==void 0&&s!==void 0?i[o]=o==="left"||o==="top"?n?Math.max(r,s):Math.min(r,s):n?Math.min(r,s):Math.max(r,s):s!==void 0?i[o]=s:r!==void 0&&(i[o]=r)})),i}function Fs(t,e){return hv(t,e,!0)}function qh(t){var e=t.size,n=t.aspectRatio,i=t.ignoreMinimum,o=t.sizeRestrictions;return!!((e.correctRatio||Je(e)>=n.minimum&&Je(e)<=n.maximum)&&e.height<=o.maxHeight&&e.width<=o.maxWidth&&e.width&&e.height&&(i||e.height>=o.minHeight&&e.width>=o.minWidth))}function Wh(t,e){return Math.pow(t.width-e.width,2)+Math.pow(t.height-e.height,2)}function Xn(t){var e=t.width,n=t.height,i=t.sizeRestrictions,o={minimum:t.aspectRatio&&t.aspectRatio.minimum||0,maximum:t.aspectRatio&&t.aspectRatio.maximum||1/0},r={width:Math.max(i.minWidth,Math.min(i.maxWidth,e)),height:Math.max(i.minHeight,Math.min(i.maxHeight,n))};function s(c,u){return u===void 0&&(u=!1),c.reduce((function(d,h){return qh({size:h,aspectRatio:o,sizeRestrictions:i,ignoreMinimum:u})&&(!d||Wh(h,{width:e,height:n})<Wh(d,{width:e,height:n}))?h:d}),null)}var a=[];o&&[o.minimum,o.maximum].forEach((function(c){c&&a.push({width:r.width,height:r.width/c,correctRatio:!0},{width:r.height*c,height:r.height,correctRatio:!0})})),qh({size:r,aspectRatio:o,sizeRestrictions:i})&&a.push(r);var l=s(a)||s(a,!0);return l&&{width:l.width,height:l.height}}function Pl(t){var e=t.event,n=t.coordinates,i=t.positionRestrictions,o=i===void 0?{}:i,r=Wt(n,e.directions);return Wt(r,ro(r,o))}function rP(t){var e=t.coordinates,n=t.transform,i=t.imageSize,o=t.sizeRestrictions,r=t.positionRestrictions,s=t.aspectRatio,a=t.visibleArea,l=function(u,d){return Pl({coordinates:u,positionRestrictions:r,event:new Ac({left:d.left-u.left,top:d.top-u.top})})},c=Re({},e);return(Array.isArray(n)?n:[n]).forEach((function(u){var d={};_t((d=typeof u=="function"?u({coordinates:c,imageSize:i,visibleArea:a}):u).width)&&_t(d.height)||(c=(function(h,v){var f=Re(Re(Re({},h),Xn({width:v.width,height:v.height,sizeRestrictions:o,aspectRatio:s})),{left:0,top:0});return l(f,{left:h.left,top:h.top})})(c,Re(Re({},c),d))),_t(d.left)&&_t(d.top)||(c=l(c,Re(Re({},c),d)))})),c}function sP(t){t.event;var e=t.getAreaRestrictions,n=t.boundaries,i=t.coordinates,o=t.visibleArea;t.aspectRatio;var r=t.stencilSize,s=t.sizeRestrictions,a=t.positionRestrictions;t.stencilReference;var l,c,u,d=Re({},i),h=Re({},o),v=Re({},r);l=Je(v),c=Je(d),u===void 0&&(u=.001),(l===0||c===0?Math.abs(c-l)<u:Math.abs(c/l)<1+u&&Math.abs(c/l)>1-u)||(d=Re(Re({},d),Xn({sizeRestrictions:s,width:d.width,height:d.height,aspectRatio:{minimum:Je(v),maximum:Je(v)}})));var f=Ds(h=un(h,d.width*n.width/(h.width*v.width)),e({visibleArea:h,type:"resize"}));return f!==1&&(h=un(h,f),d=un(d,f)),h=Et(h=Wt(h,io(wt(d),wt(h))),e({visibleArea:h,type:"move"})),{coordinates:d=Et(d,Fs(Ln(h),a)),visibleArea:h}}function aP(t){var e=t.event,n=t.getAreaRestrictions,i=t.boundaries,o=t.coordinates,r=t.visibleArea;t.aspectRatio,t.stencilSize,t.sizeRestrictions;var s=t.positionRestrictions;t.stencilReference;var a=Re({},o),l=Re({},r);if(o&&r&&e.type!=="manipulateImage"){var c={width:0,height:0};l.width,i.width,Je(i)>Je(a)?(c.height=.8*i.height,c.width=c.height*Je(a)):(c.width=.8*i.width,c.height=c.width*Je(a));var u=Ds(l=un(l,a.width*i.width/(l.width*c.width)),n({visibleArea:l,type:"resize"}));l=un(l,u),u!==1&&(c.height/=u,c.width/=u),l=Et(l=Wt(l,io(wt(a),wt(l))),n({visibleArea:l,type:"move"})),a=Et(a,Fs(Ln(l),s))}return{coordinates:a,visibleArea:l}}function lP(t){var e=t.event,n=t.coordinates,i=t.visibleArea,o=t.getAreaRestrictions,r=Re({},i),s=Re({},n);if(e.type==="setCoordinates"){var a=Math.max(0,s.width-r.width),l=Math.max(0,s.height-r.height);a>l?r=un(r,Math.min(s.width/r.width,oo(r,o({visibleArea:r,type:"resize"})))):l>a&&(r=un(r,Math.min(s.height/r.height,oo(r,o({visibleArea:r,type:"resize"}))))),r=Et(r=Wt(r,Ms(ro(s,Ln(r)))),o({visibleArea:r,type:"move"}))}return{visibleArea:r,coordinates:s}}function cP(t){var e=t.imageSize,n=t.visibleArea,i=t.coordinates,o=n||e;return{left:(n?n.left:0)+o.width/2-i.width/2,top:(n?n.top:0)+o.height/2-i.height/2}}function uP(t){var e=t.imageSize,n=t.visibleArea,i=t.aspectRatio,o=t.sizeRestrictions,r=n||e,s=Math.min(i.maximum||1/0,Math.max(i.minimum||0,Je(r))),a=r.width<r.height?{width:.8*r.width,height:.8*r.width/s}:{height:.8*r.height,width:.8*r.height*s};return Xn(Re(Re({},a),{aspectRatio:i,sizeRestrictions:o}))}function dP(t){var e,n,i=t.imageSize,o=t.visibleArea,r=t.boundaries,s=t.aspectRatio,a=t.sizeRestrictions,l=t.stencilSize,c=o||i;return Je(c)>Je(r)?n=(e=l.height*c.height/r.height)*Je(l):e=(n=l.width*c.width/r.width)/Je(l),Xn({width:n,height:e,aspectRatio:s,sizeRestrictions:a})}function hP(t){var e=t.getAreaRestrictions,n=t.coordinates,i=t.imageSize,o=Je(t.boundaries);if(n){var r={height:Math.max(n.height,i.height),width:Math.max(n.width,i.width)},s=uv({width:Je(r)>o?r.width:r.height*o,height:Je(r)>o?r.width/o:r.height},Al(e())),a={left:n.left+n.width/2-s.width/2,top:n.top+n.height/2-s.height/2,width:s.width,height:s.height},l=No(n,Ln(Re({left:0,top:0},i))),c={};return!l.left&&!l.right&&a.width<=i.width&&(c.left=0,c.right=i.width),!l.top&&!l.bottom&&a.height<=i.height&&(c.top=0,c.bottom=i.height),Et(a,c)}var u=Je(i);return s={height:u>o?i.height:i.width/o,width:u>o?i.height*o:i.width},{left:i.width/2-s.width/2,top:i.height/2-s.height/2,width:s.width,height:s.height}}function Mr(t,e){return hv(t,Ln(e))}function pP(t){var e=t.event,n=t.coordinates,i=t.visibleArea,o=t.sizeRestrictions,r=t.getAreaRestrictions,s=t.positionRestrictions,a=t.adjustStencil,l=e.scale,c=e.move,u=Re({},i),d=Re({},n),h=1,v=1,f=l.factor&&Math.abs(l.factor-1)>.001;u=Wt(u,{left:c.left||0,top:c.top||0});var p={stencil:{minimum:Math.max(o.minWidth?o.minWidth/d.width:0,o.minHeight?o.minHeight/d.height:0),maximum:Math.min(o.maxWidth?o.maxWidth/d.width:1/0,o.maxHeight?o.maxHeight/d.height:1/0,oo(d,s))},area:{maximum:oo(u,r({visibleArea:u,type:"resize"}))}};l.factor&&f&&(l.factor<1?(v=Math.max(l.factor,p.stencil.minimum))>1&&(v=1):l.factor>1&&(v=Math.min(l.factor,Math.min(p.area.maximum,p.stencil.maximum)))<1&&(v=1)),v&&(u=un(u,v,l.center));var _=n.left-i.left,S=i.width+i.left-(n.width+n.left),w=n.top-i.top,E=i.height+i.top-(n.height+n.top);return u=Et(u=Wt(u,ro(u,{left:s.left!==void 0?s.left-_*v:void 0,top:s.top!==void 0?s.top-w*v:void 0,bottom:s.bottom!==void 0?s.bottom+E*v:void 0,right:s.right!==void 0?s.right+S*v:void 0})),r({visibleArea:u,type:"move"})),d.width=d.width*v,d.height=d.height*v,d.left=u.left+_*v,d.top=u.top+w*v,d=Et(d,Fs(Ln(u),s)),l.factor&&f&&a&&(l.factor>1?h=Math.min(p.area.maximum,l.factor)/v:l.factor<1&&(h=Math.max(d.height/u.height,d.width/u.width,l.factor/v)),h!==1&&(u=Wt(u=Et(u=un(u,h,l.factor>1?l.center:wt(d)),r({visibleArea:u,type:"move"})),Ms(ro(d,Ln(u)))))),{coordinates:d,visibleArea:u}}function fP(t){var e=t.aspectRatio,n=t.getAreaRestrictions,i=t.coordinates,o=t.visibleArea,r=t.sizeRestrictions,s=t.positionRestrictions,a=t.imageSize,l=t.previousImageSize,c=t.angle,u=Re({},i),d=Re({},o),h=ai(wt(Re({left:0,top:0},l)),c);return(u=Re(Re({},Xn({sizeRestrictions:r,aspectRatio:e,width:u.width,height:u.height})),ai(wt(u),c))).left-=h.left-a.width/2+u.width/2,u.top-=h.top-a.height/2+u.height/2,d=un(d,Ds(d,n({visibleArea:d,type:"resize"}))),{coordinates:u=Et(u,s),visibleArea:d=Et(d=Wt(d,io(wt(u),wt(i))),n({visibleArea:d,type:"move"}))}}function mP(t){var e=t.flip,n=t.previousFlip,i=t.rotate,o=t.getAreaRestrictions,r=t.coordinates,s=t.visibleArea,a=t.imageSize,l=Re({},r),c=Re({},s),u=n.horizontal!==e.horizontal,d=n.vertical!==e.vertical;if(u||d){var h=ai({left:a.width/2,top:a.height/2},-i),v=ai(wt(l),-i),f=ai({left:u?h.left-(v.left-h.left):v.left,top:d?h.top-(v.top-h.top):v.top},i);l=Wt(l,io(f,wt(l))),v=ai(wt(c),-i),c=Et(c=Wt(c,io(f=ai({left:u?h.left-(v.left-h.left):v.left,top:d?h.top-(v.top-h.top):v.top},i),wt(c))),o({visibleArea:c,type:"move"}))}return{coordinates:l,visibleArea:c}}function Kh(t){var e=t.directions,n=t.coordinates,i=t.positionRestrictions,o=i===void 0?{}:i,r=t.sizeRestrictions,s=t.preserveRatio,a=t.compensate,l=Re({},e),c=An(n,l).width,u=An(n,l).height;c<0&&(l.left<0&&l.right<0?(l.left=-(n.width-r.minWidth)/(l.left/l.right),l.right=-(n.width-r.minWidth)/(l.right/l.left)):l.left<0?l.left=-(n.width-r.minWidth):l.right<0&&(l.right=-(n.width-r.minWidth))),u<0&&(l.top<0&&l.bottom<0?(l.top=-(n.height-r.minHeight)/(l.top/l.bottom),l.bottom=-(n.height-r.minHeight)/(l.bottom/l.top)):l.top<0?l.top=-(n.height-r.minHeight):l.bottom<0&&(l.bottom=-(n.height-r.minHeight)));var d=No(An(n,l),o);a&&(d.left&&d.left>0&&d.right===0?(l.right+=d.left,l.left-=d.left):d.right&&d.right>0&&d.left===0&&(l.left+=d.right,l.right-=d.right),d.top&&d.top>0&&d.bottom===0?(l.bottom+=d.top,l.top-=d.top):d.bottom&&d.bottom>0&&d.top===0&&(l.top+=d.bottom,l.bottom-=d.bottom),d=No(An(n,l),o));var h={width:1/0,height:1/0,left:1/0,right:1/0,top:1/0,bottom:1/0};if(Rn.forEach((function(p){var _=d[p];_&&l[p]&&(h[p]=Math.max(0,1-_/l[p]))})),s){var v=Math.min.apply(null,Rn.map((function(p){return h[p]})));v!==1/0&&Rn.forEach((function(p){l[p]*=v}))}else Rn.forEach((function(p){h[p]!==1/0&&(l[p]*=h[p])}));if(c=An(n,l).width,u=An(n,l).height,l.right+l.left&&(c>r.maxWidth?h.width=(r.maxWidth-n.width)/(l.right+l.left):c<r.minWidth&&(h.width=(r.minWidth-n.width)/(l.right+l.left))),l.bottom+l.top&&(u>r.maxHeight?h.height=(r.maxHeight-n.height)/(l.bottom+l.top):u<r.minHeight&&(h.height=(r.minHeight-n.height)/(l.bottom+l.top))),s){var f=Math.min(h.width,h.height);f!==1/0&&Rn.forEach((function(p){l[p]*=f}))}else h.width!==1/0&&eP.forEach((function(p){l[p]*=h.width})),h.height!==1/0&&tP.forEach((function(p){l[p]*=h.height}));return l}function Dr(t,e,n){return e==0&&n==0?t/2:e==0?0:n==0?t:t*Math.abs(e/(e+n))}var vP=Cn("vue-simple-handler"),gP=Cn("vue-simple-handler-wrapper"),Rc={name:"SimpleHandler",components:{HandlerWrapper:lv},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){var t,e=(ln(t={},this.horizontalPosition,!!this.horizontalPosition),ln(t,this.verticalPosition,!!this.verticalPosition),ln(t,"".concat(this.horizontalPosition,"-").concat(this.verticalPosition),!!(this.verticalPosition&&this.horizontalPosition)),ln(t,"hover",this.hover),t);return{default:gt(vP(e),this.defaultClass,this.hover&&this.hoverClass),wrapper:gt(gP(e),this.wrapperClass)}}},methods:{onDrag:function(t){this.$emit("drag",t)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}},emits:["drag","drag-end"]};Rc.render=function(t,e,n,i,o,r){var s=ze("HandlerWrapper");return y(),ne(s,{class:r.classes.wrapper,"vertical-position":n.verticalPosition,"horizontal-position":n.horizontalPosition,disabled:n.disabled,onDrag:r.onDrag,onDragEnd:r.onDragEnd,onEnter:r.onEnter,onLeave:r.onLeave},{default:we((function(){return[j("div",{class:r.classes.default},null,2)]})),_:1},8,["class","vertical-position","horizontal-position","disabled","onDrag","onDragEnd","onEnter","onLeave"])};var _P=Cn("vue-simple-line"),yP=Cn("vue-simple-line-wrapper"),Ic={name:"SimpleLine",components:{LineWrapper:cv},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},position:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){return{root:gt(_P(ln({},this.position,!0)),this.defaultClass,this.hover&&this.hoverClass),wrapper:gt(yP(ln({},this.position,!0)),this.wrapperClass)}}},methods:{onDrag:function(t){this.$emit("drag",t)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}},emits:["drag","drag-end"]};Ic.render=function(t,e,n,i,o,r){var s=ze("LineWrapper");return y(),ne(s,{class:r.classes.wrapper,position:n.position,disabled:n.disabled,onDrag:r.onDrag,onDragEnd:r.onDragEnd,onEnter:r.onEnter,onLeave:r.onLeave},{default:we((function(){return[j("div",{class:r.classes.root},null,2)]})),_:1},8,["class","position","disabled","onDrag","onDragEnd","onEnter","onLeave"])};var Na=Cn("vue-bounding-box"),bP=["east","west",null],wP=["south","north",null],pv={name:"BoundingBox",props:{width:{type:Number},height:{type:Number},transitions:{type:Object},handlers:{type:Object,default:function(){return{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}}},handlersComponent:{type:[Object,String],default:function(){return Rc}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}},lines:{type:Object,default:function(){return{west:!0,north:!0,east:!0,south:!0}}},linesComponent:{type:[Object,String],default:function(){return Ic}},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},resizable:{type:Boolean,default:!0}},data:function(){var t=[];return bP.forEach((function(e){wP.forEach((function(n){if(e!==n){var i=ov(e,n),o=i.name,r=i.classname;t.push({name:o,classname:r,verticalDirection:n,horizontalDirection:e})}}))})),{points:t}},computed:{style:function(){var t={};return this.width&&this.height&&(t.width="".concat(this.width,"px"),t.height="".concat(this.height,"px"),this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction))),t},classes:function(){var t=this.handlersClasses,e=this.handlersWrappersClasses,n=this.linesClasses,i=this.linesWrappersClasses;return{root:Na(),handlers:t,handlersWrappers:e,lines:n,linesWrappers:i}},lineNodes:function(){var t=this,e=[];return this.points.forEach((function(n){n.horizontalDirection&&n.verticalDirection||!t.lines[n.name]||e.push({name:n.name,component:t.linesComponent,class:gt(t.classes.lines.default,t.classes.lines[n.name],!t.resizable&&t.classes.lines.disabled),wrapperClass:gt(t.classes.linesWrappers.default,t.classes.linesWrappers[n.name],!t.resizable&&t.classes.linesWrappers.disabled),hoverClass:t.classes.lines.hover,verticalDirection:n.verticalDirection,horizontalDirection:n.horizontalDirection,disabled:!t.resizable})})),e},handlerNodes:function(){var t=this,e=[],n=this.width,i=this.height;return this.points.forEach((function(o){if(t.handlers[o.name]){var r={name:o.name,component:t.handlersComponent,class:gt(t.classes.handlers.default,t.classes.handlers[o.name]),wrapperClass:gt(t.classes.handlersWrappers.default,t.classes.handlersWrappers[o.name]),hoverClass:t.classes.handlers.hover,verticalDirection:o.verticalDirection,horizontalDirection:o.horizontalDirection,disabled:!t.resizable};if(n&&i){var s=o.horizontalDirection,a=o.verticalDirection,l=s==="east"?n:s==="west"?0:n/2,c=a==="south"?i:a==="north"?0:i/2;r.wrapperClass=Na("handler"),r.wrapperStyle={transform:"translate(".concat(l,"px, ").concat(c,"px)")},t.transitions&&t.transitions.enabled&&(r.wrapperStyle.transition="".concat(t.transitions.time,"ms ").concat(t.transitions.timingFunction))}else r.wrapperClass=Na("handler",ln({},o.classname,!0));e.push(r)}})),e}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[]},methods:{onEnd:function(){this.$emit("resize-end")},onHandlerDrag:function(t,e,n){var i,o=t.shift(),r=o.left,s=o.top,a={left:0,right:0,top:0,bottom:0};e==="west"?a.left-=r:e==="east"&&(a.right+=r),n==="north"?a.top-=s:n==="south"&&(a.bottom+=s),!n&&e?i="width":n&&!e&&(i="height"),this.resizable&&this.$emit("resize",new XA(a,{allowedDirections:{left:e==="west"||!e,right:e==="east"||!e,bottom:n==="south"||!n,top:n==="north"||!n},preserveAspectRatio:t.nativeEvent&&t.nativeEvent.shiftKey,respectDirection:i}))}},emits:["resize","resize-end"]};pv.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"box",class:r.classes.root,style:r.style},[Ve(t.$slots,"default"),j("div",null,[(y(!0),ne(Ie,null,He(r.lineNodes,(function(s){return y(),ne(Ot(s.component),{key:s.name,"default-class":s.class,"hover-class":s.hoverClass,"wrapper-class":s.wrapperClass,position:s.name,disabled:s.disabled,onDrag:function(a){return r.onHandlerDrag(a,s.horizontalDirection,s.verticalDirection)},onDragEnd:e[1]||(e[1]=function(a){return r.onEnd()})},null,8,["default-class","hover-class","wrapper-class","position","disabled","onDrag"])})),128))]),(y(!0),ne(Ie,null,He(r.handlerNodes,(function(s){return y(),ne("div",{key:s.name,style:s.wrapperStyle,class:s.wrapperClass},[(y(),ne(Ot(s.component),{"default-class":s.class,"hover-class":s.hoverClass,"wrapper-class":s.wrapperClass,"horizontal-position":s.horizontalDirection,"vertical-position":s.verticalDirection,disabled:s.disabled,onDrag:function(a){return r.onHandlerDrag(a,s.horizontalDirection,s.verticalDirection)},onDragEnd:e[2]||(e[2]=function(a){return r.onEnd()})},null,8,["default-class","hover-class","wrapper-class","horizontal-position","vertical-position","disabled","onDrag"]))],6)})),128))],6)};var EP=Cn("vue-draggable-area"),fv={name:"DraggableArea",props:{movable:{type:Boolean,default:!0},activationDistance:{type:Number,default:20}},computed:{classnames:function(){return{default:EP()}}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[],this.touchStarted=!1},methods:{onTouchStart:function(t){if(t.cancelable){var e=this.movable&&t.touches.length===1;e&&(this.touches=Mi(t.touches)),(this.touchStarted||e)&&(t.preventDefault(),t.stopPropagation())}},onTouchEnd:function(){this.touchStarted=!1,this.processEnd()},onTouchMove:function(t){this.touches.length>=1&&(this.touchStarted?(this.processMove(t,t.touches),t.preventDefault(),t.stopPropagation()):av({x:this.touches[0].clientX,y:this.touches[0].clientY},{x:t.touches[0].clientX,y:t.touches[0].clientY})>this.activationDistance&&(this.initAnchor({clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}),this.touchStarted=!0))},onMouseDown:function(t){if(this.movable&&t.button===0){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.cancelable&&t.preventDefault(),t.stopPropagation())},onMouseUp:function(){this.processEnd()},initAnchor:function(t){var e=this.$refs.container.getBoundingClientRect(),n=e.left,i=e.top;this.anchor={x:t.clientX-n,y:t.clientY-i}},processMove:function(t,e){var n=Mi(e);if(this.touches.length){var i=this.$refs.container.getBoundingClientRect(),o=i.left,r=i.top;this.touches.length===1&&n.length===1&&this.$emit("move",new Ac({left:n[0].clientX-(o+this.anchor.x),top:n[0].clientY-(r+this.anchor.y)}))}},processEnd:function(){this.touches.length&&this.$emit("move-end"),this.touches=[]}},emits:["move","move-end"]};fv.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"container",onTouchstart:e[1]||(e[1]=function(){return r.onTouchStart&&r.onTouchStart.apply(r,arguments)}),onMousedown:e[2]||(e[2]=function(){return r.onMouseDown&&r.onMouseDown.apply(r,arguments)})},[Ve(t.$slots,"default")],544)};function Ua(t){var e,n;return{rotate:t.rotate||0,flip:{horizontal:((e=t?.flip)===null||e===void 0?void 0:e.horizontal)||!1,vertical:((n=t?.flip)===null||n===void 0?void 0:n.vertical)||!1}}}function SP(t){return new Promise((function(e,n){try{if(t)if(/^data:/i.test(t))e((function(l){l=l.replace(/^data:([^;]+);base64,/gim,"");for(var c=atob(l),u=c.length,d=new ArrayBuffer(u),h=new Uint8Array(d),v=0;v<u;v++)h[v]=c.charCodeAt(v);return d})(t));else if(/^blob:/i.test(t)){var i=new FileReader;i.onload=function(l){e(l.target.result)},r=t,s=function(l){i.readAsArrayBuffer(l)},(a=new XMLHttpRequest).open("GET",r,!0),a.responseType="blob",a.onload=function(){this.status!=200&&this.status!==0||s(this.response)},a.send()}else{var o=new XMLHttpRequest;o.onreadystatechange=function(){o.readyState===4&&(o.status===200||o.status===0?e(o.response):n("Warning: could not load an image to parse its orientation"),o=null)},o.onprogress=function(){o.getResponseHeader("content-type")!=="image/jpeg"&&o.abort()},o.withCredentials=!1,o.open("GET",t,!0),o.responseType="arraybuffer",o.send(null)}else n("Error: the image is empty")}catch(l){n(l)}var r,s,a}))}function mv(t){var e=t.rotate,n=t.flip,i=t.scaleX,o=t.scaleY,r="";return r+=" rotate("+e+"deg) ",r+=" scaleX("+i*(n.horizontal?-1:1)+") ",r+=" scaleY("+o*(n.vertical?-1:1)+") "}function CP(t){try{var e,n=new DataView(t),i=void 0,o=void 0,r=void 0,s=void 0;if(n.getUint8(0)===255&&n.getUint8(1)===216)for(var a=n.byteLength,l=2;l+1<a;){if(n.getUint8(l)===255&&n.getUint8(l+1)===225){r=l;break}l++}if(r&&(i=r+10,(function(v,f,p){var _,S="";for(_=f,p+=f;_<p;_++)S+=String.fromCharCode(v.getUint8(_));return S})(n,r+4,4)==="Exif")){var c=n.getUint16(i);if(((o=c===18761)||c===19789)&&n.getUint16(i+2,o)===42){var u=n.getUint32(i+4,o);u>=8&&(s=i+u)}}if(s){for(var d=n.getUint16(s,o),h=0;h<d;h++)if(l=s+12*h+2,n.getUint16(l,o)===274){l+=8,e=n.getUint16(l,o),n.setUint16(l,1,o);break}}return e}catch{return null}}function Yh(t,e){var n=e.getBoundingClientRect(),i=n.left,o=n.top,r={left:0,top:0},s=0;return t.forEach((function(a){r.left+=(a.clientX-i)/t.length,r.top+=(a.clientY-o)/t.length})),t.forEach((function(a){s+=av({x:r.left,y:r.top},{x:a.clientX-i,y:a.clientY-o})})),{centerMass:r,spread:s,count:t.length}}var vv={props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0},eventsFilter:{type:Function,required:!1}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},created:function(){this.transforming=!1,this.debouncedProcessEnd=$l(this.processEnd),this.touches=[]},methods:{processMove:function(t,e){if(this.touches.length){if(this.touches.length===1&&e.length===1)this.$emit("move",new Oo({left:this.touches[0].clientX-e[0].clientX,top:this.touches[0].clientY-e[0].clientY}));else if(this.touches.length>1&&this.touchResize){var n=Yh(e,this.$refs.container),i=this.oldGeometricProperties;i.count===n.count&&i.count>1&&this.$emit("resize",new Oo({left:i.centerMass.left-n.centerMass.left,top:i.centerMass.top-n.centerMass.top},{factor:i.spread/n.spread,center:n.centerMass})),this.oldGeometricProperties=n}this.touches=e}},processEnd:function(){this.transforming&&(this.transforming=!1,this.$emit("transform-end"))},processStart:function(){this.transforming=!0,this.debouncedProcessEnd.clear()},processEvent:function(t){return this.eventsFilter?this.eventsFilter(t,this.transforming)!==!1:(t.preventDefault(),t.stopPropagation(),!0)},onTouchStart:function(t){if(t.cancelable&&(this.touchMove||this.touchResize&&t.touches.length>1)&&this.processEvent(t)){var e=this.$refs.container,n=e.getBoundingClientRect(),i=n.left,o=n.top,r=n.bottom,s=n.right;this.touches=Mi(t.touches).filter((function(a){return a.clientX>i&&a.clientX<s&&a.clientY>o&&a.clientY<r})),this.oldGeometricProperties=Yh(this.touches,e)}},onTouchEnd:function(t){t.touches.length===0&&(this.touches=[],this.processEnd())},onTouchMove:function(t){var e=this;if(this.touches.length){var n=Mi(t.touches).filter((function(i){return!i.identifier||e.touches.find((function(o){return o.identifier===i.identifier}))}));this.processEvent(t)&&(this.processMove(t,n),this.processStart())}},onMouseDown:function(t){if(this.mouseMove&&"buttons"in t&&t.buttons===1&&this.processEvent(t)){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.processStart()}},onMouseMove:function(t){this.touches.length&&this.processEvent(t)&&this.processMove(t,[{clientX:t.clientX,clientY:t.clientY}])},onMouseUp:function(){this.touches=[],this.processEnd()},onWheel:function(t){if(this.wheelResize&&this.processEvent(t)){var e=this.$refs.container.getBoundingClientRect(),n=e.left,i=e.top,o=1+this.wheelResize.ratio*(s=t.deltaY||t.detail||t.wheelDelta,(a=+s)==0||sv(a)?a:a>0?1:-1),r={left:t.clientX-n,top:t.clientY-i};this.$emit("resize",new Oo({},{factor:o,center:r})),this.touches.length||this.debouncedProcessEnd()}var s,a}},emits:["resize","move","transform-end"]};vv.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"container",onTouchstart:e[1]||(e[1]=function(){return r.onTouchStart&&r.onTouchStart.apply(r,arguments)}),onMousedown:e[2]||(e[2]=function(){return r.onMouseDown&&r.onMouseDown.apply(r,arguments)}),onWheel:e[3]||(e[3]=function(){return r.onWheel&&r.onWheel.apply(r,arguments)})},[Ve(t.$slots,"default")],544)};var Rl={components:{TransformableImage:vv},props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0}},emits:["resize","move"]};Rl.render=function(t,e,n,i,o,r){var s=ze("transformable-image");return y(),ne(s,{"touch-move":n.touchMove,"touch-resize":n.touchResize,"mouse-move":n.mouseMove,"wheel-resize":n.wheelResize,onMove:e[1]||(e[1]=function(a){return t.$emit("move",a)}),onResize:e[2]||(e[2]=function(a){return t.$emit("resize",a)})},{default:we((function(){return[Ve(t.$slots,"default")]})),_:3},8,["touch-move","touch-resize","mouse-move","wheel-resize"])};var Fr=Cn("vue-preview"),gv={props:{coordinates:{type:Object},transitions:{type:Object},image:{type:Object,default:function(){return{}}},imageClass:{type:String},width:{type:Number},height:{type:Number},fill:{type:Boolean}},data:function(){return{calculatedImageSize:{width:0,height:0},calculatedSize:{width:0,height:0}}},computed:{classes:function(){return{root:Fr({fill:this.fill}),wrapper:Fr("wrapper"),imageWrapper:Fr("image-wrapper"),image:gt(Fr("image"),this.imageClass)}},style:function(){if(this.fill)return{};var t={};return this.width&&(t.width="".concat(this.size.width,"px")),this.height&&(t.height="".concat(this.size.height,"px")),this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},wrapperStyle:function(){var t={width:"".concat(this.size.width,"px"),height:"".concat(this.size.height,"px"),left:"calc(50% - ".concat(this.size.width/2,"px)"),top:"calc(50% - ".concat(this.size.height/2,"px)")};return this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},imageStyle:function(){if(this.coordinates&&this.image){var t=this.coordinates.width/this.size.width,e=Xe(Xe({rotate:0,flip:{horizontal:!1,vertical:!1}},this.image.transforms),{},{scaleX:1/t,scaleY:1/t}),n=this.imageSize.width,i=this.imageSize.height,o=dv({width:n,height:i},e.rotate),r={width:"".concat(n,"px"),height:"".concat(i,"px"),left:"0px",top:"0px"},s={rotate:{left:(n-o.width)*e.scaleX/2,top:(i-o.height)*e.scaleY/2},scale:{left:(1-e.scaleX)*n/2,top:(1-e.scaleY)*i/2}};return r.transform=`translate(
|
|
23
|
+
`.concat(-this.coordinates.left/t-s.rotate.left-s.scale.left,"px,").concat(-this.coordinates.top/t-s.rotate.top-s.scale.top,"px) ")+mv(e),this.transitions&&this.transitions.enabled&&(r.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),r}return{}},size:function(){return{width:this.width||this.calculatedSize.width,height:this.height||this.calculatedSize.height}},imageSize:function(){return{width:this.image.width||this.calculatedImageSize.width,height:this.image.height||this.calculatedImageSize.height}}},watch:{image:function(t){(t.width||t.height)&&this.onChangeImage()}},mounted:function(){var t=this;this.onChangeImage(),this.$refs.image.addEventListener("load",(function(){t.refreshImage()})),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh)},methods:{refreshImage:function(){var t=this.$refs.image;this.calculatedImageSize.height=t.naturalHeight,this.calculatedImageSize.width=t.naturalWidth},refresh:function(){var t=this.$refs.root;this.width||(this.calculatedSize.width=t.clientWidth),this.height||(this.calculatedSize.height=t.clientHeight)},onChangeImage:function(){var t=this.$refs.image;t&&t.complete&&this.refreshImage(),this.refresh()}}};gv.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"root",class:r.classes.root,style:r.style},[j("div",{ref:"wrapper",class:r.classes.wrapper,style:r.wrapperStyle},[it(j("img",{ref:"image",src:n.image&&n.image.src,class:r.classes.image,style:r.imageStyle},null,14,["src"]),[[En,n.image&&n.image.src]])],6)],6)};var _v={components:{Preview:gv},inheritAttrs:!1};_v.render=function(t,e,n,i,o,r){var s=ze("preview");return y(),ne(s,We(t.$attrs,{fill:!0}),null,16)};var za=Cn("vue-rectangle-stencil"),yv={name:"RectangleStencil",components:{StencilPreview:_v,BoundingBox:pv,DraggableArea:fv},props:{image:{type:Object},coordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlersComponent:{type:[Object,String],default:function(){return Rc}},lines:{type:Object},linesComponent:{type:[Object,String],default:function(){return Ic}},aspectRatio:{type:[Number,String]},minAspectRatio:{type:[Number,String]},maxAspectRatio:{type:[Number,String]},movable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},transitions:{type:Object},movingClass:{type:String},resizingClass:{type:String},previewClass:{type:String},boundingBoxClass:{type:String},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}}},data:function(){return{moving:!1,resizing:!1}},computed:{classes:function(){return{stencil:gt(za({movable:this.movable,moving:this.moving,resizing:this.resizing}),this.moving&&this.movingClass,this.resizing&&this.resizingClass),preview:gt(za("preview"),this.previewClass),boundingBox:gt(za("bounding-box"),this.boundingBoxClass)}},style:function(){var t=this.stencilCoordinates,e=t.height,n=t.width,i=t.left,o=t.top,r={width:"".concat(n,"px"),height:"".concat(e,"px"),transform:"translate(".concat(i,"px, ").concat(o,"px)")};return this.transitions&&this.transitions.enabled&&(r.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),r}},methods:{onMove:function(t){this.$emit("move",t),this.moving=!0},onMoveEnd:function(){this.$emit("move-end"),this.moving=!1},onResize:function(t){this.$emit("resize",t),this.resizing=!0},onResizeEnd:function(){this.$emit("resize-end"),this.resizing=!1},aspectRatios:function(){return{minimum:this.aspectRatio||this.minAspectRatio,maximum:this.aspectRatio||this.maxAspectRatio}}},emits:["resize","resize-end","move","move-end"]};yv.render=function(t,e,n,i,o,r){var s=ze("stencil-preview"),a=ze("draggable-area"),l=ze("bounding-box");return y(),ne("div",{class:r.classes.stencil,style:r.style},[j(l,{width:n.stencilCoordinates.width,height:n.stencilCoordinates.height,transitions:n.transitions,class:r.classes.boundingBox,handlers:n.handlers,"handlers-component":n.handlersComponent,"handlers-classes":n.handlersClasses,"handlers-wrappers-classes":n.handlersWrappersClasses,lines:n.lines,"lines-component":n.linesComponent,"lines-classes":n.linesClasses,"lines-wrappers-classes":n.linesWrappersClasses,resizable:n.resizable,onResize:r.onResize,onResizeEnd:r.onResizeEnd},{default:we((function(){return[j(a,{movable:n.movable,onMove:r.onMove,onMoveEnd:r.onMoveEnd},{default:we((function(){return[j(s,{image:n.image,coordinates:n.coordinates,width:n.stencilCoordinates.width,height:n.stencilCoordinates.height,class:r.classes.preview,transitions:n.transitions},null,8,["image","coordinates","width","height","class","transitions"])]})),_:1},8,["movable","onMove","onMoveEnd"])]})),_:1},8,["width","height","transitions","class","handlers","handlers-component","handlers-classes","handlers-wrappers-classes","lines","lines-component","lines-classes","lines-wrappers-classes","resizable","onResize","onResizeEnd"])],6)};var xP=["transitions"],Bn=Cn("vue-advanced-cropper"),bv={name:"Cropper",components:{BackgroundWrapper:Rl},props:{src:{type:String,default:null},stencilComponent:{type:[Object,String],default:function(){return yv}},backgroundWrapperComponent:{type:[Object,String],default:function(){return Rl}},stencilProps:{type:Object,default:function(){return{}}},autoZoom:{type:Boolean,default:!1},imageClass:{type:String},boundariesClass:{type:String},backgroundClass:{type:String},foregroundClass:{type:String},minWidth:{type:[Number,String]},minHeight:{type:[Number,String]},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},debounce:{type:[Boolean,Number],default:500},transitions:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},canvas:{type:[Object,Boolean],default:!0},crossOrigin:{type:[Boolean,String],default:void 0},transitionTime:{type:Number,default:300},imageRestriction:{type:String,default:"fit-area",validator:function(t){return iP.indexOf(t)!==-1}},roundResult:{type:Boolean,default:!0},defaultSize:{type:[Function,Object]},defaultPosition:{type:[Function,Object]},defaultVisibleArea:{type:[Function,Object]},defaultTransforms:{type:[Function,Object]},defaultBoundaries:{type:[Function,String],validator:function(t){return!(typeof t=="string"&&t!=="fill"&&t!=="fit")}},priority:{type:String,default:"coordinates"},stencilSize:{type:[Object,Function]},resizeImage:{type:[Boolean,Object],default:!0},moveImage:{type:[Boolean,Object],default:!0},autoZoomAlgorithm:{type:Function},resizeAlgorithm:{type:Function,default:function(t){var e=t.event,n=t.coordinates,i=t.aspectRatio,o=t.positionRestrictions,r=t.sizeRestrictions,s=Re(Re({},n),{right:n.left+n.width,bottom:n.top+n.height}),a=e.params||{},l=Re({},e.directions),c=a.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};r.widthFrozen&&(l.left=0,l.right=0),r.heightFrozen&&(l.top=0,l.bottom=0),Rn.forEach((function(b){c[b]||(l[b]=0)}));var u=An(s,l=Kh({coordinates:s,directions:l,sizeRestrictions:r,positionRestrictions:o})).width,d=An(s,l).height,h=a.preserveRatio?Je(s):ja(u/d,i);if(h){var v=a.respectDirection;if(v||(v=s.width>=s.height||h===1?"width":"height"),v==="width"){var f=u/h-s.height;if(c.top&&c.bottom){var p=l.top,_=l.bottom;l.bottom=Dr(f,_,p),l.top=Dr(f,p,_)}else c.bottom?l.bottom=f:c.top?l.top=f:c.right?l.right=0:c.left&&(l.left=0)}else if(v==="height"){var S=s.width-d*h;if(c.left&&c.right){var w=l.left,E=l.right;l.left=-Dr(S,w,E),l.right=-Dr(S,E,w)}else c.left?l.left=-S:c.right?l.right=-S:c.top?l.top=0:c.bottom&&(l.bottom=0)}l=Kh({directions:l,coordinates:s,sizeRestrictions:r,positionRestrictions:o,preserveRatio:!0,compensate:a.compensate})}return u=An(s,l).width,d=An(s,l).height,(h=a.preserveRatio?Je(s):ja(u/d,i))&&Math.abs(h-u/d)>.001&&Rn.forEach((function(b){c[b]||(l[b]=0)})),Pl({event:new Ac({left:-l.left,top:-l.top}),coordinates:{width:n.width+l.right+l.left,height:n.height+l.top+l.bottom,left:n.left,top:n.top},positionRestrictions:o})}},moveAlgorithm:{type:Function,default:Pl},initStretcher:{type:Function,default:function(t){var e=t.stretcher,n=t.imageSize,i=Je(n);e.style.width=n.width+"px",e.style.height=e.clientWidth/i+"px",e.style.width=e.clientWidth+"px"}},fitCoordinates:{type:Function,default:function(t){var e=t.visibleArea,n=t.coordinates,i=t.aspectRatio,o=t.sizeRestrictions,r=t.positionRestrictions,s=Re(Re({},n),Xn({width:n.width,height:n.height,aspectRatio:i,sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minHeight:Math.min(e.height,o.minHeight),minWidth:Math.min(e.width,o.minWidth)}}));return s=Et(s=Wt(s,io(wt(n),wt(s))),Fs(Ln(e),r))}},fitVisibleArea:{type:Function,default:function(t){var e=t.visibleArea,n=t.boundaries,i=t.getAreaRestrictions,o=t.coordinates,r=Re({},e);r.height=r.width/Je(n),r.top+=(e.height-r.height)/2,(o.height-r.height>0||o.width-r.width>0)&&(r=un(r,Math.max(o.height/r.height,o.width/r.width)));var s=Ms(ro(o,Ln(r=un(r,Ds(r,i({visibleArea:r,type:"resize"}))))));return r.width<o.width&&(s.left=0),r.height<o.height&&(s.top=0),r=Et(r=Wt(r,s),i({visibleArea:r,type:"move"}))}},areaRestrictionsAlgorithm:{type:Function,default:function(t){var e=t.visibleArea,n=t.boundaries,i=t.imageSize,o=t.imageRestriction,r=t.type,s={};return o==="fill-area"?s={left:0,top:0,right:i.width,bottom:i.height}:o==="fit-area"&&(Je(n)>Je(i)?(s={top:0,bottom:i.height},e&&r==="move"&&(e.width>i.width?(s.left=-(e.width-i.width)/2,s.right=i.width-s.left):(s.left=0,s.right=i.width))):(s={left:0,right:i.width},e&&r==="move"&&(e.height>i.height?(s.top=-(e.height-i.height)/2,s.bottom=i.height-s.top):(s.top=0,s.bottom=i.height)))),s}},sizeRestrictionsAlgorithm:{type:Function,default:function(t){return{minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight}}},positionRestrictionsAlgorithm:{type:Function,default:function(t){var e=t.imageSize,n={};return t.imageRestriction!=="none"&&(n={left:0,top:0,right:e.width,bottom:e.height}),n}}},data:function(){return{transitionsActive:!1,imageLoaded:!1,imageAttributes:{width:null,height:null,crossOrigin:null,src:null},defaultImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},appliedImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},boundaries:{width:0,height:0},visibleArea:null,coordinates:Xe({},Bh)}},computed:{image:function(){return{src:this.imageAttributes.src,width:this.imageAttributes.width,height:this.imageAttributes.height,transforms:this.imageTransforms}},imageTransforms:function(){return{rotate:this.appliedImageTransforms.rotate,flip:{horizontal:this.appliedImageTransforms.flip.horizontal,vertical:this.appliedImageTransforms.flip.vertical},translateX:this.visibleArea?this.visibleArea.left/this.coefficient:0,translateY:this.visibleArea?this.visibleArea.top/this.coefficient:0,scaleX:1/this.coefficient,scaleY:1/this.coefficient}},imageSize:function(){var t=(function(e){return e*Math.PI/180})(this.imageTransforms.rotate);return{width:Math.abs(this.imageAttributes.width*Math.cos(t))+Math.abs(this.imageAttributes.height*Math.sin(t)),height:Math.abs(this.imageAttributes.width*Math.sin(t))+Math.abs(this.imageAttributes.height*Math.cos(t))}},initialized:function(){return!!(this.visibleArea&&this.imageLoaded)},settings:function(){var t=kl(this.resizeImage,{touch:!0,wheel:{ratio:.1},adjustStencil:!0},{touch:!1,wheel:!1,adjustStencil:!1});return{moveImage:kl(this.moveImage,{touch:!0,mouse:!0},{touch:!1,mouse:!1}),resizeImage:t}},coefficient:function(){return this.visibleArea?this.visibleArea.width/this.boundaries.width:0},areaRestrictions:function(){return this.imageLoaded?this.areaRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction,boundaries:this.boundaries}):{}},transitionsOptions:function(){return{enabled:this.transitionsActive,timingFunction:"ease-in-out",time:350}},sizeRestrictions:function(){if(this.boundaries.width&&this.boundaries.height&&this.imageSize.width&&this.imageSize.height){var t=this.sizeRestrictionsAlgorithm({imageSize:this.imageSize,minWidth:_t(this.minWidth)?0:Ir(this.minWidth),minHeight:_t(this.minHeight)?0:Ir(this.minHeight),maxWidth:_t(this.maxWidth)?1/0:Ir(this.maxWidth),maxHeight:_t(this.maxHeight)?1/0:Ir(this.maxHeight)});if(t=(function(i){var o=i.areaRestrictions,r=i.sizeRestrictions,s=i.boundaries,a=i.positionRestrictions,l=Re(Re({},r),{minWidth:r.minWidth!==void 0?r.minWidth:0,minHeight:r.minHeight!==void 0?r.minHeight:0,maxWidth:r.maxWidth!==void 0?r.maxWidth:1/0,maxHeight:r.maxHeight!==void 0?r.maxHeight:1/0});a.left!==void 0&&a.right!==void 0&&(l.maxWidth=Math.min(l.maxWidth,a.right-a.left)),a.bottom!==void 0&&a.top!==void 0&&(l.maxHeight=Math.min(l.maxHeight,a.bottom-a.top));var c=Al(o),u=uv(s,c);return c.width<1/0&&(!l.maxWidth||l.maxWidth>u.width)&&(l.maxWidth=Math.min(l.maxWidth,u.width)),c.height<1/0&&(!l.maxHeight||l.maxHeight>u.height)&&(l.maxHeight=Math.min(l.maxHeight,u.height)),l.minWidth>l.maxWidth&&(l.minWidth=l.maxWidth,l.widthFrozen=!0),l.minHeight>l.maxHeight&&(l.minHeight=l.maxHeight,l.heightFrozen=!0),l})({sizeRestrictions:t,areaRestrictions:this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}),imageSize:this.imageSize,boundaries:this.boundaries,positionRestrictions:this.positionRestrictions,imageRestriction:this.imageRestriction,visibleArea:this.visibleArea,stencilSize:this.getStencilSize()}),this.visibleArea&&this.stencilSize){var e=this.getStencilSize(),n=Al(this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}));t.maxWidth=Math.min(t.maxWidth,n.width*e.width/this.boundaries.width),t.maxHeight=Math.min(t.maxHeight,n.height*e.height/this.boundaries.height),t.maxWidth<t.minWidth&&(t.minWidth=t.maxWidth),t.maxHeight<t.minHeight&&(t.minHeight=t.maxHeight)}return t}return{minWidth:0,minHeight:0,maxWidth:0,maxHeight:0}},positionRestrictions:function(){return this.positionRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction})},classes:function(){return{cropper:Bn(),image:gt(Bn("image"),this.imageClass),stencil:Bn("stencil"),boundaries:gt(Bn("boundaries"),this.boundariesClass),stretcher:gt(Bn("stretcher")),background:gt(Bn("background"),this.backgroundClass),foreground:gt(Bn("foreground"),this.foregroundClass),imageWrapper:gt(Bn("image-wrapper")),cropperWrapper:gt(Bn("cropper-wrapper"))}},stencilCoordinates:function(){if(this.initialized){var t=this.coordinates,e=t.width,n=t.height,i=t.left,o=t.top;return{width:e/this.coefficient,height:n/this.coefficient,left:(i-this.visibleArea.left)/this.coefficient,top:(o-this.visibleArea.top)/this.coefficient}}return this.defaultCoordinates()},boundariesStyle:function(){var t={width:this.boundaries.width?"".concat(Math.round(this.boundaries.width),"px"):"auto",height:this.boundaries.height?"".concat(Math.round(this.boundaries.height),"px"):"auto",transition:"opacity ".concat(this.transitionTime,"ms"),pointerEvents:this.imageLoaded?"all":"none"};return this.imageLoaded||(t.opacity="0"),t},imageStyle:function(){var t=this.imageAttributes.width>this.imageAttributes.height?{width:Math.min(1024,this.imageAttributes.width),height:Math.min(1024,this.imageAttributes.width)/(this.imageAttributes.width/this.imageAttributes.height)}:{height:Math.min(1024,this.imageAttributes.height),width:Math.min(1024,this.imageAttributes.height)*(this.imageAttributes.width/this.imageAttributes.height)},e={left:(t.width-this.imageSize.width)/(2*this.coefficient),top:(t.height-this.imageSize.height)/(2*this.coefficient)},n={left:(1-1/this.coefficient)*t.width/2,top:(1-1/this.coefficient)*t.height/2},i=Xe(Xe({},this.imageTransforms),{},{scaleX:this.imageTransforms.scaleX*(this.imageAttributes.width/t.width),scaleY:this.imageTransforms.scaleY*(this.imageAttributes.height/t.height)}),o={width:"".concat(t.width,"px"),height:"".concat(t.height,"px"),left:"0px",top:"0px",transform:"translate(".concat(-e.left-n.left-this.imageTransforms.translateX,"px, ").concat(-e.top-n.top-this.imageTransforms.translateY,"px)")+mv(i)};return this.transitionsOptions.enabled&&(o.transition="".concat(this.transitionsOptions.time,"ms ").concat(this.transitionsOptions.timingFunction)),o}},watch:{src:function(){this.onChangeImage()},stencilComponent:function(){var t=this;this.$nextTick((function(){t.resetCoordinates(),t.runAutoZoom("setCoordinates"),t.onChange()}))},minWidth:function(){this.onPropsChange()},maxWidth:function(){this.onPropsChange()},minHeight:function(){this.onPropsChange()},maxHeight:function(){this.onPropsChange()},imageRestriction:function(){this.reset()},stencilProps:function(t,e){["aspectRatio","minAspectRatio","maxAspectRatio"].find((function(n){return t[n]!==e[n]}))&&this.$nextTick(this.onPropsChange)}},created:function(){this.debouncedUpdate=$l(this.update,this.debounce),this.debouncedDisableTransitions=$l(this.disableTransitions,this.transitionsOptions.time),this.awaiting=!1},mounted:function(){this.$refs.image.addEventListener("load",this.onSuccessLoadImage),this.$refs.image.addEventListener("error",this.onFailLoadImage),this.onChangeImage(),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh),this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.debouncedUpdate.clear(),this.debouncedDisableTransitions.clear()},methods:{getResult:function(){var t=this.initialized?this.prepareResult(Xe({},this.coordinates)):this.defaultCoordinates(),e={rotate:this.imageTransforms.rotate%360,flip:Xe({},this.imageTransforms.flip)};if(this.src&&this.imageLoaded){var n=this;return{image:this.image,coordinates:t,visibleArea:this.visibleArea?Xe({},this.visibleArea):null,imageTransforms:e,get canvas(){return n.canvas?n.getCanvas():void 0}}}return{image:this.image,coordinates:t,visibleArea:this.visibleArea?Xe({},this.visibleArea):null,canvas:void 0,imageTransforms:e}},zoom:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.transitions,o=i===void 0||i;this.onManipulateImage(new Oo({},{factor:1/t,center:e}),{normalize:!1,transitions:o})},move:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.transitions,o=i===void 0||i;this.onManipulateImage(new Oo({left:t||0,top:e||0}),{normalize:!1,transitions:o})},setCoordinates:function(t){var e=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.autoZoom,o=i===void 0||i,r=n.transitions,s=r===void 0||r;this.$nextTick((function(){e.imageLoaded?(e.transitionsActive||(s&&e.enableTransitions(),e.coordinates=e.applyTransform(t),o&&e.runAutoZoom("setCoordinates"),s&&e.debouncedDisableTransitions()),e.onChange()):e.delayedTransforms=t}))},refresh:function(){var t=this,e=this.$refs.image;if(this.src&&e)return this.initialized?this.updateVisibleArea().then((function(){t.onChange()})):this.resetVisibleArea().then((function(){t.onChange()}))},reset:function(){var t=this;return this.resetVisibleArea().then((function(){t.onChange(!1)}))},awaitRender:function(t){var e=this;this.awaiting||(this.awaiting=!0,this.$nextTick((function(){t(),e.awaiting=!1})))},prepareResult:function(t){return this.roundResult?(function(e){var n=e.coordinates,i=e.sizeRestrictions,o=e.positionRestrictions,r={width:Math.round(n.width),height:Math.round(n.height),left:Math.round(n.left),top:Math.round(n.top)};return r.width>i.maxWidth?r.width=Math.floor(n.width):r.width<i.minWidth&&(r.width=Math.ceil(n.width)),r.height>i.maxHeight?r.height=Math.floor(n.height):r.height<i.minHeight&&(r.height=Math.ceil(n.height)),Et(r,o)})(Xe(Xe({},this.getPublicProperties()),{},{positionRestrictions:Mr(this.positionRestrictions,this.visibleArea),coordinates:t})):t},processAutoZoom:function(t,e,n,i){var o=this.autoZoomAlgorithm;o||(o=this.stencilSize?sP:this.autoZoom?aP:lP);var r=o({event:{type:t,params:i},visibleArea:e,coordinates:n,boundaries:this.boundaries,aspectRatio:this.getAspectRatio(),positionRestrictions:this.positionRestrictions,getAreaRestrictions:this.getAreaRestrictions,sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize()});return Xe(Xe({},r),{},{changed:!Hh(r.visibleArea,e)||!Hh(r.coordinates,n)})},runAutoZoom:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.transitions,i=n!==void 0&&n,o=GA(e,xP),r=this.processAutoZoom(t,this.visibleArea,this.coordinates,o),s=r.visibleArea,a=r.coordinates,l=r.changed;i&&l&&this.enableTransitions(),this.visibleArea=s,this.coordinates=a,i&&l&&this.debouncedDisableTransitions()},normalizeEvent:function(t){return(function(e){var n=e.event,i=e.visibleArea,o=e.coefficient;if(n.type==="manipulateImage")return Re(Re({},n),{move:{left:n.move&&n.move.left?o*n.move.left:0,top:n.move&&n.move.top?o*n.move.top:0},scale:{factor:n.scale&&n.scale.factor?n.scale.factor:1,center:n.scale&&n.scale.center?{left:n.scale.center.left*o+i.left,top:n.scale.center.top*o+i.top}:null}});if(n.type==="resize"){var r=Re(Re({},n),{directions:Re({},n.directions)});return Rn.forEach((function(a){r.directions[a]*=o})),r}if(n.type==="move"){var s=Re(Re({},n),{directions:Re({},n.directions)});return nP.forEach((function(a){s.directions[a]*=o})),s}return n})(Xe(Xe({},this.getPublicProperties()),{},{event:t}))},getCanvas:function(){if(this.$refs.canvas){var t=this.$refs.canvas,e=this.$refs.image,n=this.imageTransforms.rotate!==0||this.imageTransforms.flip.horizontal||this.imageTransforms.flip.vertical?(function(a,l,c){var u=c.rotate,d=c.flip,h={width:l.naturalWidth,height:l.naturalHeight},v=dv(h,u),f=a.getContext("2d");a.height=v.height,a.width=v.width,f.save();var p=ai(wt(Re({left:0,top:0},h)),u);return f.translate(-(p.left-v.width/2),-(p.top-v.height/2)),f.rotate(u*Math.PI/180),f.translate(d.horizontal?h.width:0,d.vertical?h.height:0),f.scale(d.horizontal?-1:1,d.vertical?-1:1),f.drawImage(l,0,0,h.width,h.height),f.restore(),a})(this.$refs.sourceCanvas,e,this.imageTransforms):e,i=Xe({minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,maxArea:this.maxCanvasSize,imageSmoothingEnabled:!0,imageSmoothingQuality:"high",fillColor:"transparent"},this.canvas),o=function(a){return a.find((function(l){return c=l,!Number.isNaN(parseFloat(c))&&isFinite(c);var c}))},r=Xn({sizeRestrictions:{minWidth:o([i.width,i.minWidth])||0,minHeight:o([i.height,i.minHeight])||0,maxWidth:o([i.width,i.maxWidth])||1/0,maxHeight:o([i.height,i.maxHeight])||1/0},width:this.coordinates.width,height:this.coordinates.height,aspectRatio:{minimum:this.coordinates.width/this.coordinates.height,maximum:this.coordinates.width/this.coordinates.height}});if(i.maxArea&&r.width*r.height>i.maxArea){var s=Math.sqrt(i.maxArea/(r.width*r.height));r={width:Math.round(s*r.width),height:Math.round(s*r.height)}}return(function(a,l,c,u,d){a.width=u?u.width:c.width,a.height=u?u.height:c.height;var h=a.getContext("2d");h.clearRect(0,0,a.width,a.height),d&&(d.imageSmoothingEnabled&&(h.imageSmoothingEnabled=d.imageSmoothingEnabled),d.imageSmoothingQuality&&(h.imageSmoothingQuality=d.imageSmoothingQuality),d.fillColor&&(h.fillStyle=d.fillColor,h.fillRect(0,0,a.width,a.height),h.save()));var v=c.left<0?-c.left:0,f=c.top<0?-c.top:0;h.drawImage(l,c.left+v,c.top+f,c.width,c.height,v*(a.width/c.width),f*(a.height/c.height),a.width,a.height)})(t,n,this.coordinates,r,i),t}},update:function(){this.$emit("change",this.getResult())},applyTransform:function(t){var e=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.visibleArea&&e?oP(this.sizeRestrictions,this.visibleArea):this.sizeRestrictions,i=this.visibleArea&&e?Mr(this.positionRestrictions,this.visibleArea):this.positionRestrictions;return rP({transform:t,coordinates:this.coordinates,imageSize:this.imageSize,sizeRestrictions:n,positionRestrictions:i,aspectRatio:this.getAspectRatio(),visibleArea:this.visibleArea})},resetCoordinates:function(){var t=this;if(this.$refs.image){this.$refs.cropper,this.$refs.image;var e=this.defaultSize;e||(e=this.stencilSize?dP:uP);var n=this.sizeRestrictions;n.minWidth,n.minHeight,n.maxWidth,n.maxHeight;var i=Ni(e)?e({boundaries:this.boundaries,imageSize:this.imageSize,aspectRatio:this.getAspectRatio(),sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize(),visibleArea:this.visibleArea}):e,o=this.defaultPosition||cP,r=[i,function(s){var a=s.coordinates;return Xe({},Ni(o)?o({coordinates:a,imageSize:t.imageSize,visibleArea:t.visibleArea}):t.defaultPosition)}];this.delayedTransforms&&r.push.apply(r,Mi(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.coordinates=this.applyTransform(r,!0),this.delayedTransforms=null}},clearImage:function(){var t=this;this.imageLoaded=!1,setTimeout((function(){var e=t.$refs.stretcher;e&&(e.style.height="auto",e.style.width="auto"),t.coordinates=t.defaultCoordinates(),t.boundaries={width:0,height:0}}),this.transitionTime)},enableTransitions:function(){this.transitions&&(this.transitionsActive=!0)},disableTransitions:function(){this.transitionsActive=!1},updateBoundaries:function(){var t=this,e=this.$refs.stretcher,n=this.$refs.cropper;return this.initStretcher({cropper:n,stretcher:e,imageSize:this.imageSize}),this.$nextTick().then((function(){var i={cropper:n,imageSize:t.imageSize};if(Ni(t.defaultBoundaries)?t.boundaries=t.defaultBoundaries(i):t.defaultBoundaries==="fit"?t.boundaries=(function(o){var r=o.cropper,s=o.imageSize,a=r.clientHeight,l=r.clientWidth,c=a,u=s.width*a/s.height;return u>l&&(u=l,c=s.height*l/s.width),{width:u,height:c}})(i):t.boundaries=(function(o){var r=o.cropper;return{width:r.clientWidth,height:r.clientHeight}})(i),!t.boundaries.width||!t.boundaries.height)throw new Error("It's impossible to fit the cropper in the current container")}))},resetVisibleArea:function(){var t=this;return this.appliedImageTransforms=Xe(Xe({},this.defaultImageTransforms),{},{flip:Xe({},this.defaultImageTransforms.flip)}),this.updateBoundaries().then((function(){t.priority!=="visible-area"&&(t.visibleArea=null,t.resetCoordinates());var e,n,i,o,r,s,a=t.defaultVisibleArea||hP;t.visibleArea=Ni(a)?a({imageSize:t.imageSize,boundaries:t.boundaries,coordinates:t.priority!=="visible-area"?t.coordinates:null,getAreaRestrictions:t.getAreaRestrictions,stencilSize:t.getStencilSize()}):t.defaultVisibleArea,t.visibleArea=(e={visibleArea:t.visibleArea,boundaries:t.boundaries,getAreaRestrictions:t.getAreaRestrictions},n=e.visibleArea,i=e.boundaries,o=e.getAreaRestrictions,r=Re({},n),s=Je(i),r.width/r.height!==s&&(r.height=r.width/s),Et(r,o({visibleArea:r,type:"move"}))),t.priority==="visible-area"?t.resetCoordinates():t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("resetVisibleArea")})).catch((function(){t.visibleArea=null}))},updateVisibleArea:function(){var t=this;return this.updateBoundaries().then((function(){t.visibleArea=t.fitVisibleArea({imageSize:t.imageSize,boundaries:t.boundaries,visibleArea:t.visibleArea,coordinates:t.coordinates,getAreaRestrictions:t.getAreaRestrictions}),t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("updateVisibleArea")})).catch((function(){t.visibleArea=null}))},onChange:function(){var t=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];t&&this.debounce?this.debouncedUpdate():this.update()},onChangeImage:function(){var t,e=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.src){if((function(o){if(zh(o))return!1;var r=window.location,s=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(o)||[],a={protocol:s[1]||"",host:s[2]||"",port:s[3]||""},l=function(c){return c.port||((c.protocol||r.protocol)==="http"?80:433)};return!(!a.protocol&&!a.host&&!a.port||a.protocol&&a.protocol==r.protocol&&a.host&&a.host==r.host&&a.host&&l(a)==l(r))})(this.src)){var n=_t(this.crossOrigin)?this.canvas:this.crossOrigin;n===!0&&(n="anonymous"),this.imageAttributes.crossOrigin=n||null}if(this.checkOrientation){var i=(t=this.src,new Promise((function(o){SP(t).then((function(r){var s=CP(r);o(r?{source:t,arrayBuffer:r,orientation:s}:{source:t,arrayBuffer:null,orientation:null})})).catch((function(r){console.warn(r),o({source:t,arrayBuffer:null,orientation:null})}))})));setTimeout((function(){i.then(e.onParseImage)}),this.transitionTime)}else setTimeout((function(){e.onParseImage({source:e.src})}),this.transitionTime)}else this.clearImage()},onFailLoadImage:function(){this.imageAttributes.src&&(this.clearImage(),this.$emit("error"))},onSuccessLoadImage:function(){var t=this,e=this.$refs.image;e&&!this.imageLoaded&&(this.imageAttributes.height=e.naturalHeight,this.imageAttributes.width=e.naturalWidth,this.imageLoaded=!0,this.resetVisibleArea().then((function(){t.$emit("ready"),t.onChange(!1)})))},onParseImage:function(t){var e=this,n=t.source,i=t.arrayBuffer,o=t.orientation;this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.imageAttributes.revoke=!1,i&&o&&o>1?rv(n)||!zh(n)?(this.imageAttributes.src=URL.createObjectURL(new Blob([i])),this.imageAttributes.revoke=!0):this.imageAttributes.src=(function(r){for(var s=[],a=new Uint8Array(r);a.length>0;){var l=a.subarray(0,8192);s.push(String.fromCharCode.apply(null,Array.from?Array.from(l):l.slice())),a=a.subarray(8192)}return"data:image/jpeg;base64,"+btoa(s.join(""))})(i):this.imageAttributes.src=n,Ni(this.defaultTransforms)?this.appliedImageTransforms=Ua(this.defaultTransforms()):Xr(this.defaultTransforms)?this.appliedImageTransforms=Ua(this.defaultTransforms):this.appliedImageTransforms=(function(r){var s=Ua({});if(r)switch(r){case 2:s.flip.horizontal=!0;break;case 3:s.rotate=-180;break;case 4:s.flip.vertical=!0;break;case 5:s.rotate=90,s.flip.vertical=!0;break;case 6:s.rotate=90;break;case 7:s.rotate=90,s.flip.horizontal=!0;break;case 8:s.rotate=-90}return s})(o),this.defaultImageTransforms=Xe(Xe({},this.appliedImageTransforms),{},{flip:Xe({},this.appliedImageTransforms.flip)}),this.$nextTick((function(){var r=e.$refs.image;r&&r.complete&&((function(s){return!!s.naturalWidth})(r)?e.onSuccessLoadImage():e.onFailLoadImage())}))},onResizeEnd:function(){this.runAutoZoom("resize",{transitions:!0})},onMoveEnd:function(){this.runAutoZoom("move",{transitions:!0})},onMove:function(t){var e=this;this.transitionsOptions.enabled||this.awaitRender((function(){e.coordinates=e.moveAlgorithm(Xe(Xe({},e.getPublicProperties()),{},{positionRestrictions:Mr(e.positionRestrictions,e.visibleArea),coordinates:e.coordinates,event:e.normalizeEvent(t)})),e.onChange()}))},onResize:function(t){var e=this;this.transitionsOptions.enabled||this.stencilSize&&!this.autoZoom||this.awaitRender((function(){var n=e.sizeRestrictions,i=Math.min(e.coordinates.width,e.coordinates.height,20*e.coefficient);e.coordinates=e.resizeAlgorithm(Xe(Xe({},e.getPublicProperties()),{},{positionRestrictions:Mr(e.positionRestrictions,e.visibleArea),sizeRestrictions:{maxWidth:Math.min(n.maxWidth,e.visibleArea.width),maxHeight:Math.min(n.maxHeight,e.visibleArea.height),minWidth:Math.max(n.minWidth,i),minHeight:Math.max(n.minHeight,i)},event:e.normalizeEvent(t)})),e.onChange(),e.ticking=!1}))},onManipulateImage:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.transitionsOptions.enabled){var n=e.transitions,i=n!==void 0&&n,o=e.normalize,r=o===void 0||o;i&&this.enableTransitions();var s=pP(Xe(Xe({},this.getPublicProperties()),{},{event:r?this.normalizeEvent(t):t,getAreaRestrictions:this.getAreaRestrictions,imageRestriction:this.imageRestriction,adjustStencil:!this.stencilSize&&this.settings.resizeImage.adjustStencil})),a=s.visibleArea,l=s.coordinates;this.visibleArea=a,this.coordinates=l,this.runAutoZoom("manipulateImage"),this.onChange(),i&&this.debouncedDisableTransitions()}},onPropsChange:function(){this.coordinates=this.applyTransform(this.coordinates,!0),this.onChange(!1)},getAreaRestrictions:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.visibleArea,n=t.type,i=n===void 0?"move":n;return this.areaRestrictionsAlgorithm({boundaries:this.boundaries,imageSize:this.imageSize,imageRestriction:this.imageRestriction,visibleArea:e,type:i})},getAspectRatio:function(t){var e,n,i=this.stencilProps,o=i.aspectRatio,r=i.minAspectRatio,s=i.maxAspectRatio;if(this.$refs.stencil&&this.$refs.stencil.aspectRatios){var a=this.$refs.stencil.aspectRatios();e=a.minimum,n=a.maximum}if(_t(e)&&(e=_t(o)?r:o),_t(n)&&(n=_t(o)?s:o),!t&&(_t(e)||_t(n))){var l=this.getStencilSize(),c=l?Je(l):null;_t(e)&&(e=Vh(c)?c:void 0),_t(n)&&(n=Vh(c)?c:void 0)}return{minimum:e,maximum:n}},getStencilSize:function(){if(this.stencilSize)return t={currentStencilSize:{width:this.stencilCoordinates.width,height:this.stencilCoordinates.height},stencilSize:this.stencilSize,boundaries:this.boundaries,coefficient:this.coefficient,coordinates:this.coordinates,aspectRatio:this.getAspectRatio(!0)},e=t.boundaries,n=t.stencilSize,i=t.aspectRatio,ja(Je(o=Ni(n)?n({boundaries:e,aspectRatio:i}):n),i)&&(o=Xn({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:o.width,height:o.height,aspectRatio:{minimum:i.minimum,maximum:i.maximum}})),(o.width>e.width||o.height>e.height)&&(o=Xn({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:o.width,height:o.height,aspectRatio:{minimum:Je(o),maximum:Je(o)}})),o;var t,e,n,i,o},getPublicProperties:function(){return{coefficient:this.coefficient,visibleArea:this.visibleArea,coordinates:this.coordinates,boundaries:this.boundaries,sizeRestrictions:this.sizeRestrictions,positionRestrictions:this.positionRestrictions,aspectRatio:this.getAspectRatio(),imageRestriction:this.imageRestriction}},defaultCoordinates:function(){return Xe({},Bh)},flip:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.transitions,o=i===void 0||i;if(!this.transitionsActive){o&&this.enableTransitions();var r=Xe({},this.imageTransforms.flip),s=mP({flip:{horizontal:t?!r.horizontal:r.horizontal,vertical:e?!r.vertical:r.vertical},previousFlip:r,rotate:this.imageTransforms.rotate,visibleArea:this.visibleArea,coordinates:this.coordinates,imageSize:this.imageSize,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),a=s.visibleArea,l=s.coordinates;t&&(this.appliedImageTransforms.flip.horizontal=!this.appliedImageTransforms.flip.horizontal),e&&(this.appliedImageTransforms.flip.vertical=!this.appliedImageTransforms.flip.vertical),this.visibleArea=a,this.coordinates=l,this.onChange(),o&&this.debouncedDisableTransitions()}},rotate:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.transitions,i=n===void 0||n;if(!this.transitionsActive){i&&this.enableTransitions();var o=Xe({},this.imageSize);this.appliedImageTransforms.rotate+=t;var r=fP({visibleArea:this.visibleArea,coordinates:this.coordinates,previousImageSize:o,imageSize:this.imageSize,angle:t,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),s=r.visibleArea,a=r.coordinates,l=this.processAutoZoom("rotateImage",s,a);s=l.visibleArea,a=l.coordinates,this.visibleArea=s,this.coordinates=a,this.onChange(),i&&this.debouncedDisableTransitions()}}},emits:["change","error","ready"]},TP={key:0,ref:"canvas",style:{display:"none"}},OP={key:1,ref:"sourceCanvas",style:{display:"none"}};bv.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"cropper",class:r.classes.cropper},[j("div",{ref:"stretcher",class:r.classes.stretcher},null,2),j("div",{class:r.classes.boundaries,style:r.boundariesStyle},[(y(),ne(Ot(n.backgroundWrapperComponent),{class:r.classes.cropperWrapper,"wheel-resize":r.settings.resizeImage.wheel,"touch-resize":r.settings.resizeImage.touch,"touch-move":r.settings.moveImage.touch,"mouse-move":r.settings.moveImage.mouse,onMove:r.onManipulateImage,onResize:r.onManipulateImage},{default:we((function(){return[j("div",{class:r.classes.background,style:r.boundariesStyle},null,6),j("div",{class:r.classes.imageWrapper},[j("img",{ref:"image",crossorigin:o.imageAttributes.crossOrigin,src:o.imageAttributes.src,class:r.classes.image,style:r.imageStyle,onMousedown:e[1]||(e[1]=Ye((function(){}),["prevent"]))},null,46,["crossorigin","src"])],2),j("div",{class:r.classes.foreground,style:r.boundariesStyle},null,6),it((y(),ne(Ot(n.stencilComponent),We({ref:"stencil",image:r.image,coordinates:o.coordinates,"stencil-coordinates":r.stencilCoordinates,transitions:r.transitionsOptions},n.stencilProps,{onResize:r.onResize,onResizeEnd:r.onResizeEnd,onMove:r.onMove,onMoveEnd:r.onMoveEnd}),null,16,["image","coordinates","stencil-coordinates","transitions","onResize","onResizeEnd","onMove","onMoveEnd"])),[[En,o.imageLoaded]]),n.canvas?(y(),ne("canvas",TP,null,512)):ue("",!0),n.canvas?(y(),ne("canvas",OP,null,512)):ue("",!0)]})),_:1},8,["class","wheel-resize","touch-resize","touch-move","mouse-move","onMove","onResize"]))],6)],2)};const _i=typeof window<"u",wv=_i&&!("onscroll"in window)||typeof navigator<"u"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),Ev=_i&&window.devicePixelRatio>1,$P={elements_selector:".lazy",container:wv||_i?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},Sv=t=>Object.assign({},$P,t),Gh=function(t,e){let n;const i="LazyLoad::Initialized",o=new t(e);try{n=new CustomEvent(i,{detail:{instance:o}})}catch{n=document.createEvent("CustomEvent"),n.initCustomEvent(i,!1,!1,{instance:o})}window.dispatchEvent(n)},kP=(t,e)=>{if(e)if(e.length)for(let n,i=0;n=e[i];i+=1)Gh(t,n);else Gh(t,e)},ei="src",Mc="srcset",Dc="sizes",Cv="poster",or="llOriginalAttrs",xv="data",Fc="loading",Tv="loaded",Ov="applied",AP="entered",Lc="error",$v="native",kv="data-",Av="ll-status",Kt=(t,e)=>t.getAttribute(kv+e),PP=(t,e,n)=>{const i=kv+e;n!==null?t.setAttribute(i,n):t.removeAttribute(i)},rr=t=>Kt(t,Av),Li=(t,e)=>PP(t,Av,e),Ls=t=>Li(t,null),jc=t=>rr(t)===null,RP=t=>rr(t)===Fc,IP=t=>rr(t)===Lc,Nc=t=>rr(t)===$v,MP=[Fc,Tv,Ov,Lc],DP=t=>MP.indexOf(rr(t))>=0,yi=(t,e,n,i)=>{t&&typeof t=="function"&&(i===void 0?n===void 0?t(e):t(e,n):t(e,n,i))},fo=(t,e)=>{_i&&e!==""&&t.classList.add(e)},Pn=(t,e)=>{_i&&e!==""&&t.classList.remove(e)},FP=t=>{t.llTempImage=document.createElement("IMG")},LP=t=>{delete t.llTempImage},Pv=t=>t.llTempImage,js=(t,e)=>{if(!e)return;const n=e._observer;n&&n.unobserve(t)},jP=t=>{t.disconnect()},NP=(t,e,n)=>{e.unobserve_entered&&js(t,n)},Uc=(t,e)=>{t&&(t.loadingCount+=e)},UP=t=>{t&&(t.toLoadCount-=1)},Rv=(t,e)=>{t&&(t.toLoadCount=e)},zP=t=>t.loadingCount>0,VP=t=>t.toLoadCount>0,Iv=t=>{let e=[];for(let n,i=0;n=t.children[i];i+=1)n.tagName==="SOURCE"&&e.push(n);return e},zc=(t,e)=>{const n=t.parentNode;n&&n.tagName==="PICTURE"&&Iv(n).forEach(e)},Mv=(t,e)=>{Iv(t).forEach(e)},Ns=[ei],Dv=[ei,Cv],Uo=[ei,Mc,Dc],Fv=[xv],Us=t=>!!t[or],Lv=t=>t[or],jv=t=>delete t[or],so=(t,e)=>{if(Us(t))return;const n={};e.forEach((i=>{n[i]=t.getAttribute(i)})),t[or]=n},BP=t=>{Us(t)||(t[or]={backgroundImage:t.style.backgroundImage})},Di=(t,e)=>{if(!Us(t))return;const n=Lv(t);e.forEach((i=>{((o,r,s)=>{s?o.setAttribute(r,s):o.removeAttribute(r)})(t,i,n[i])}))},HP=t=>{if(!Us(t))return;const e=Lv(t);t.style.backgroundImage=e.backgroundImage},Nv=(t,e,n)=>{fo(t,e.class_applied),Li(t,Ov),n&&(e.unobserve_completed&&js(t,e),yi(e.callback_applied,t,n))},Uv=(t,e,n)=>{fo(t,e.class_loading),Li(t,Fc),n&&(Uc(n,1),yi(e.callback_loading,t,n))},ui=(t,e,n)=>{n&&t.setAttribute(e,n)},Qh=(t,e)=>{ui(t,Dc,Kt(t,e.data_sizes)),ui(t,Mc,Kt(t,e.data_srcset)),ui(t,ei,Kt(t,e.data_src))},qP=(t,e)=>{zc(t,(n=>{so(n,Uo),Qh(n,e)})),so(t,Uo),Qh(t,e)},WP=(t,e)=>{so(t,Ns),ui(t,ei,Kt(t,e.data_src))},KP=(t,e)=>{Mv(t,(n=>{so(n,Ns),ui(n,ei,Kt(n,e.data_src))})),so(t,Dv),ui(t,Cv,Kt(t,e.data_poster)),ui(t,ei,Kt(t,e.data_src)),t.load()},YP=(t,e)=>{so(t,Fv),ui(t,xv,Kt(t,e.data_src))},GP=(t,e,n)=>{const i=Kt(t,e.data_bg),o=Kt(t,e.data_bg_hidpi),r=Ev&&o?o:i;r&&(t.style.backgroundImage=`url("${r}")`,Pv(t).setAttribute(ei,r),Uv(t,e,n))},QP=(t,e,n)=>{const i=Kt(t,e.data_bg_multi),o=Kt(t,e.data_bg_multi_hidpi),r=Ev&&o?o:i;r&&(t.style.backgroundImage=r,Nv(t,e,n))},XP=(t,e,n)=>{const i=Kt(t,e.data_bg_set);if(!i)return;let o=i.split("|").map((r=>`image-set(${r})`));t.style.backgroundImage=o.join(),Nv(t,e,n)},zv={IMG:qP,IFRAME:WP,VIDEO:KP,OBJECT:YP},JP=(t,e)=>{const n=zv[t.tagName];n&&n(t,e)},ZP=(t,e,n)=>{const i=zv[t.tagName];i&&(i(t,e),Uv(t,e,n))},eR=["IMG","IFRAME","VIDEO","OBJECT"],tR=t=>eR.indexOf(t.tagName)>-1,Vv=(t,e)=>{!e||zP(e)||VP(e)||yi(t.callback_finish,e)},Xh=(t,e,n)=>{t.addEventListener(e,n),t.llEvLisnrs[e]=n},nR=(t,e,n)=>{t.removeEventListener(e,n)},Vc=t=>!!t.llEvLisnrs,iR=(t,e,n)=>{Vc(t)||(t.llEvLisnrs={});const i=t.tagName==="VIDEO"?"loadeddata":"load";Xh(t,i,e),Xh(t,"error",n)},Il=t=>{if(!Vc(t))return;const e=t.llEvLisnrs;for(let n in e){const i=e[n];nR(t,n,i)}delete t.llEvLisnrs},Bv=(t,e,n)=>{LP(t),Uc(n,-1),UP(n),Pn(t,e.class_loading),e.unobserve_completed&&js(t,n)},oR=(t,e,n,i)=>{const o=Nc(e);Bv(e,n,i),fo(e,n.class_loaded),Li(e,Tv),yi(n.callback_loaded,e,i),o||Vv(n,i)},rR=(t,e,n,i)=>{const o=Nc(e);Bv(e,n,i),fo(e,n.class_error),Li(e,Lc),yi(n.callback_error,e,i),n.restore_on_error&&Di(e,Uo),o||Vv(n,i)},Ml=(t,e,n)=>{const i=Pv(t)||t;Vc(i)||iR(i,(o=>{oR(0,t,e,n),Il(i)}),(o=>{rR(0,t,e,n),Il(i)}))},Dl=(t,e,n)=>{tR(t)?((i,o,r)=>{Ml(i,o,r),ZP(i,o,r)})(t,e,n):((i,o,r)=>{FP(i),Ml(i,o,r),BP(i),GP(i,o,r),QP(i,o,r),XP(i,o,r)})(t,e,n)},sR=(t,e,n)=>{t.setAttribute("loading","lazy"),Ml(t,e,n),JP(t,e),Li(t,$v)},Jh=t=>{t.removeAttribute(ei),t.removeAttribute(Mc),t.removeAttribute(Dc)},aR=t=>{zc(t,(e=>{Jh(e)})),Jh(t)},Hv=t=>{zc(t,(e=>{Di(e,Uo)})),Di(t,Uo)},lR=t=>{Mv(t,(e=>{Di(e,Ns)})),Di(t,Dv),t.load()},cR=t=>{Di(t,Ns)},uR=t=>{Di(t,Fv)},dR={IMG:Hv,IFRAME:cR,VIDEO:lR,OBJECT:uR},hR=(t,e)=>{(n=>{const i=dR[n.tagName];i?i(n):HP(n)})(t),((n,i)=>{jc(n)||Nc(n)||(Pn(n,i.class_entered),Pn(n,i.class_exited),Pn(n,i.class_applied),Pn(n,i.class_loading),Pn(n,i.class_loaded),Pn(n,i.class_error))})(t,e),Ls(t),jv(t)},pR=(t,e,n,i)=>{n.cancel_on_exit&&RP(t)&&t.tagName==="IMG"&&(Il(t),aR(t),Hv(t),Pn(t,n.class_loading),Uc(i,-1),Ls(t),yi(n.callback_cancel,t,e,i))},fR=(t,e,n,i)=>{const o=DP(t);Li(t,AP),fo(t,n.class_entered),Pn(t,n.class_exited),NP(t,n,i),yi(n.callback_enter,t,e,i),o||Dl(t,n,i)},mR=(t,e,n,i)=>{jc(t)||(fo(t,n.class_exited),pR(t,e,n,i),yi(n.callback_exit,t,e,i))},vR=["IMG","IFRAME","VIDEO"],qv=t=>t.use_native&&"loading"in HTMLImageElement.prototype,gR=(t,e,n)=>{t.forEach((i=>{vR.indexOf(i.tagName)!==-1&&sR(i,e,n)})),Rv(n,0)},_R=t=>t.isIntersecting||t.intersectionRatio>0,yR=(t,e)=>{e.forEach((n=>{t.observe(n)}))},bR=(t,e)=>{jP(t),yR(t,e)},wR=(t,e)=>{qv(t)||(e._observer=new IntersectionObserver((n=>{((i,o,r)=>{i.forEach((s=>_R(s)?fR(s.target,s,o,r):mR(s.target,s,o,r)))})(n,t,e)}),(n=>({root:n.container===document?null:n.container,rootMargin:n.thresholds||n.threshold+"px"}))(t)))},Wv=t=>Array.prototype.slice.call(t),cs=t=>t.container.querySelectorAll(t.elements_selector),ER=t=>Wv(t).filter(jc),SR=t=>IP(t),CR=t=>Wv(t).filter(SR),Zh=(t,e)=>ER(t||cs(e)),xR=(t,e)=>{CR(cs(t)).forEach((n=>{Pn(n,t.class_error),Ls(n)})),e.update()},TR=(t,e)=>{_i&&(e._onlineHandler=()=>{xR(t,e)},window.addEventListener("online",e._onlineHandler))},OR=t=>{_i&&window.removeEventListener("online",t._onlineHandler)},Hi=function(t,e){const n=Sv(t);this._settings=n,this.loadingCount=0,wR(n,this),TR(n,this),this.update(e)};Hi.prototype={update:function(t){const e=this._settings,n=Zh(t,e);Rv(this,n.length),wv?this.loadAll(n):qv(e)?gR(n,e,this):bR(this._observer,n)},destroy:function(){this._observer&&this._observer.disconnect(),OR(this),cs(this._settings).forEach((t=>{jv(t)})),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(t){const e=this._settings;Zh(t,e).forEach((n=>{js(n,this),Dl(n,e,this)}))},restoreAll:function(){const t=this._settings;cs(t).forEach((e=>{hR(e,t)}))}},Hi.load=(t,e)=>{const n=Sv(e);Dl(t,n)},Hi.resetStatus=t=>{Ls(t)},_i&&kP(Hi,window.lazyLoadOptions);const Xt=(t,e)=>{const{o:n,i,u:o}=t;let r=n,s;const a=(u,d)=>{const h=r,v=u,f=d||(i?!i(h,v):h!==v);return(f||o)&&(r=v,s=h),[r,f,s]};return[e?u=>a(e(r,s),u):a,u=>[r,!!u,s]]},$R=typeof window<"u"&&typeof HTMLElement<"u"&&!!window.document,Bt=$R?window:{},Kv=Math.max,kR=Math.min,Fl=Math.round,li=Math.abs,ep=Math.sign,Bc=Bt.cancelAnimationFrame,zo=Bt.requestAnimationFrame,Hc=Bt.setTimeout,Yv=Bt.clearTimeout,zs=t=>typeof Bt[t]<"u"?Bt[t]:void 0,AR=zs("MutationObserver"),tp=zs("IntersectionObserver"),qi=zs("ResizeObserver"),To=zs("ScrollTimeline"),qc=t=>t===void 0,Vs=t=>t===null,di=t=>typeof t=="number",mo=t=>typeof t=="string",Bs=t=>typeof t=="boolean",xn=t=>typeof t=="function",dn=t=>Array.isArray(t),us=t=>typeof t=="object"&&!dn(t)&&!Vs(t),Wc=t=>{const e=!!t&&t.length,n=di(e)&&e>-1&&e%1==0;return dn(t)||!xn(t)&&n?e>0&&us(t)?e-1 in t:!0:!1},Vo=t=>!!t&&t.constructor===Object,ds=t=>t instanceof HTMLElement,Hs=t=>t instanceof Element;function ot(t,e){if(Wc(t))for(let n=0;n<t.length&&e(t[n],n,t)!==!1;n++);else t&&ot(Object.keys(t),(n=>e(t[n],n,t)));return t}const Gv=(t,e)=>t.indexOf(e)>=0,ao=(t,e)=>t.concat(e),ct=(t,e,n)=>(!mo(e)&&Wc(e)?Array.prototype.push.apply(t,e):t.push(e),t),bi=t=>Array.from(t||[]),Kc=t=>dn(t)?t:!mo(t)&&Wc(t)?bi(t):[t],hs=t=>!!t&&!t.length,ps=t=>bi(new Set(t)),Zt=(t,e,n)=>{ot(t,o=>o?o.apply(void 0,e||[]):!0),n||(t.length=0)},Qv="paddingTop",Xv="paddingRight",Jv="paddingLeft",Zv="paddingBottom",eg="marginLeft",tg="marginRight",ng="marginBottom",Yc="overflowX",Gc="overflowY",sr="width",ar="height",Yn="visible",yn="hidden",Pi="scroll",PR=t=>{const e=String(t||"");return e?e[0].toUpperCase()+e.slice(1):""},qs=(t,e,n,i)=>{if(t&&e){let o=!0;return ot(n,(r=>{const s=t[r],a=e[r];s!==a&&(o=!1)})),o}return!1},Qc=(t,e)=>qs(t,e,["w","h"]),Jr=(t,e)=>qs(t,e,["x","y"]),RR=(t,e)=>qs(t,e,["t","r","b","l"]),Le=(t,...e)=>t.bind(0,...e),Wi=t=>{let e;const n=t?Hc:zo,i=t?Yv:Bc;return[o=>{i(e),e=n((()=>o()),xn(t)?t():t)},()=>i(e)]},np=t=>{const e=xn(t)?t():t;if(di(e)){const n=e?Hc:zo,i=e?Yv:Bc;return o=>{const r=n((()=>o()),e);return()=>{i(r)}}}return e&&e._},ig=(t,e)=>{const{p:n,v:i,S:o,m:r}=e||{};let s,a,l,c;const u=function(p){a&&a(),s&&s(),c=a=s=l=void 0,t.apply(this,p)},d=f=>r&&l?r(l,f):f,h=()=>{a&&l&&u(d(l)||l)},v=function(){const p=bi(arguments),_=np(n);if(_){const S=typeof o=="function"?o():o,w=np(i),b=d(p)||p,C=u.bind(0,b);a&&a(),S&&!c?(C(),c=!0,a=_((()=>c=void 0))):(a=_(C),w&&!s&&(s=w(h))),l=b}else u(p)};return v.O=h,v},og=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Ut=t=>t?Object.keys(t):[],Ze=(t,e,n,i,o,r,s)=>{const a=[e,n,i,o,r,s];return(typeof t!="object"||Vs(t))&&!xn(t)&&(t={}),ot(a,(l=>{ot(l,((c,u)=>{const d=l[u];if(t===d)return!0;const h=dn(d);if(d&&Vo(d)){const v=t[u];let f=v;h&&!dn(v)?f=[]:!h&&!Vo(v)&&(f={}),t[u]=Ze(f,d)}else t[u]=h?d.slice():d}))})),t},rg=(t,e)=>ot(Ze({},t),((n,i,o)=>{n===void 0?delete o[i]:n&&Vo(n)&&(o[i]=rg(n))})),Xc=t=>!Ut(t).length,Bo=()=>{},sg=(t,e,n)=>Kv(t,kR(e,n)),Ri=t=>ps((dn(t)?t:(t||"").split(" ")).filter((e=>e))),Jc=(t,e)=>t&&t.getAttribute(e),ip=(t,e)=>t&&t.hasAttribute(e),Wn=(t,e,n)=>{ot(Ri(e),(i=>{t&&t.setAttribute(i,String(n||""))}))},$n=(t,e)=>{ot(Ri(e),(n=>t&&t.removeAttribute(n)))},Ws=(t,e)=>{const n=Ri(Jc(t,e)),i=Le(Wn,t,e),o=(r,s)=>{const a=new Set(n);return ot(Ri(r),(l=>{a[s](l)})),bi(a).join(" ")};return{C:r=>i(o(r,"delete")),$:r=>i(o(r,"add")),H:r=>{const s=Ri(r);return s.reduce(((a,l)=>a&&n.includes(l)),s.length>0)}}},ag=(t,e,n)=>(Ws(t,e).C(n),Le(Zc,t,e,n)),Zc=(t,e,n)=>(Ws(t,e).$(n),Le(ag,t,e,n)),fs=(t,e,n,i)=>(i?Zc:ag)(t,e,n),eu=(t,e,n)=>Ws(t,e).H(n),lg=t=>Ws(t,"class"),cg=(t,e)=>{lg(t).C(e)},Ks=(t,e)=>(lg(t).$(e),Le(cg,t,e)),ug=(t,e)=>{const n=e?Hs(e)&&e:document;return n?bi(n.querySelectorAll(t)):[]},IR=(t,e)=>{const n=e?Hs(e)&&e:document;return n&&n.querySelector(t)},Ll=(t,e)=>Hs(t)&&t.matches(e),dg=t=>Ll(t,"body"),jl=t=>t?bi(t.childNodes):[],Ho=t=>t&&t.parentElement,Ki=(t,e)=>Hs(t)&&t.closest(e),Nl=t=>document.activeElement,MR=(t,e,n)=>{const i=Ki(t,e),o=t&&IR(n,i),r=Ki(o,e)===i;return i&&o?i===t||o===t||r&&Ki(Ki(t,n),e)!==i:!1},lo=t=>{ot(Kc(t),(e=>{const n=Ho(e);e&&n&&n.removeChild(e)}))},It=(t,e)=>Le(lo,t&&e&&ot(Kc(e),(n=>{n&&t.appendChild(n)})));let hg;const DR=()=>hg,FR=t=>{hg=t},Xi=t=>{const e=document.createElement("div");return Wn(e,"class",t),e},tu=t=>{const e=Xi(),n=DR(),i=t.trim();return e.innerHTML=n?n.createHTML(i):i,ot(jl(e),(o=>lo(o)))},op=(t,e)=>t.getPropertyValue(e)||t[e]||"",pg=t=>{const e=t||0;return isFinite(e)?e:0},Lr=t=>pg(parseFloat(t||"")),Ul=t=>Math.round(t*1e4)/1e4,fg=t=>`${Ul(pg(t))}px`;function co(t,e){t&&e&&ot(e,((n,i)=>{try{const o=t.style,r=Vs(n)||Bs(n)?"":di(n)?fg(n):n;i.indexOf("--")===0?o.setProperty(i,r):o[i]=r}catch{}}))}function jn(t,e,n){const i=mo(e);let o=i?"":{};if(t){const r=Bt.getComputedStyle(t,n)||t.style;o=i?op(r,e):bi(e).reduce(((s,a)=>(s[a]=op(r,a),s)),o)}return o}const rp=(t,e,n)=>{const i=e?`${e}-`:"",o=n?`-${n}`:"",r=`${i}top${o}`,s=`${i}right${o}`,a=`${i}bottom${o}`,l=`${i}left${o}`,c=jn(t,[r,s,a,l]);return{t:Lr(c[r]),r:Lr(c[s]),b:Lr(c[a]),l:Lr(c[l])}},Va=(t,e)=>`translate${us(t)?`(${t.x},${t.y})`:`${e?"X":"Y"}(${t})`}`,LR=t=>!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length),jR={w:0,h:0},Ys=(t,e)=>e?{w:e[`${t}Width`],h:e[`${t}Height`]}:jR,NR=t=>Ys("inner",t||Bt),hi=Le(Ys,"offset"),mg=Le(Ys,"client"),ms=Le(Ys,"scroll"),nu=t=>{const e=parseFloat(jn(t,sr))||0,n=parseFloat(jn(t,ar))||0;return{w:e-Fl(e),h:n-Fl(n)}},Ba=t=>t.getBoundingClientRect(),UR=t=>!!t&&LR(t),zl=t=>!!(t&&(t[ar]||t[sr])),vg=(t,e)=>{const n=zl(t);return!zl(e)&&n},sp=(t,e,n,i)=>{ot(Ri(e),(o=>{t&&t.removeEventListener(o,n,i)}))},st=(t,e,n,i)=>{var o;const r=(o=i&&i.D)!=null?o:!0,s=i&&i.I||!1,a=i&&i.A||!1,l={passive:r,capture:s};return Le(Zt,Ri(e).map((c=>{const u=a?d=>{sp(t,c,u,s),n&&n(d)}:n;return t&&t.addEventListener(c,u,l),Le(sp,t,c,u,s)})))},iu=t=>t.stopPropagation(),Vl=t=>t.preventDefault(),gg=t=>iu(t)||Vl(t),cn=(t,e)=>{const{x:n,y:i}=di(e)?{x:e,y:e}:e||{};di(n)&&(t.scrollLeft=n),di(i)&&(t.scrollTop=i)},Jt=t=>({x:t.scrollLeft,y:t.scrollTop}),_g=()=>({T:{x:0,y:0},k:{x:0,y:0}}),zR=(t,e)=>{const{T:n,k:i}=t,{w:o,h:r}=e,s=(d,h,v)=>{let f=ep(d)*v,p=ep(h)*v;if(f===p){const _=li(d),S=li(h);p=_>S?0:p,f=_<S?0:f}return f=f===p?0:f,[f+0,p+0]},[a,l]=s(n.x,i.x,o),[c,u]=s(n.y,i.y,r);return{T:{x:a,y:c},k:{x:l,y:u}}},Ha=({T:t,k:e})=>{const n=(i,o)=>i===0&&i<=o;return{x:n(t.x,e.x),y:n(t.y,e.y)}},ap=({T:t,k:e},n)=>{const i=(o,r,s)=>sg(0,1,(o-s)/(o-r)||0);return{x:i(t.x,e.x,n.x),y:i(t.y,e.y,n.y)}},Bl=t=>{t&&t.focus&&t.focus({preventScroll:!0,focusVisible:!1})},lp=(t,e)=>{ot(Kc(e),t)},Hl=t=>{const e=new Map,n=(r,s)=>{if(r){const a=e.get(r);lp((l=>{a&&a[l?"delete":"clear"](l)}),s)}else e.forEach((a=>{a.clear()})),e.clear()},i=(r,s)=>{if(mo(r)){const c=e.get(r)||new Set;return e.set(r,c),lp((u=>{xn(u)&&c.add(u)}),s),Le(n,r,s)}Bs(s)&&s&&n();const a=Ut(r),l=[];return ot(a,(c=>{const u=r[c];u&&ct(l,i(c,u))})),Le(Zt,l)},o=(r,s)=>{ot(bi(e.get(r)),(a=>{s&&!hs(s)?a.apply(0,s):a()}))};return i(t||{}),[i,n,o]},yg={},bg={},VR=t=>{ot(t,(e=>ot(e,((n,i)=>{yg[i]=e[i]}))))},wg=(t,e,n)=>Ut(t).map((i=>{const{static:o,instance:r}=t[i],[s,a,l]=n||[],c=n?r:o;if(c){const u=n?c(s,a,e):c(e);return(l||bg)[i]=u}})),BR=(t,e)=>t[e],vo=t=>BR(bg,t),HR="__osOptionsValidationPlugin",go="data-overlayscrollbars",Zr="os-environment",jr=`${Zr}-scrollbar-hidden`,qa=`${go}-initialize`,es="noClipping",cp=`${go}-body`,pi=go,qR="host",Kn=`${go}-viewport`,WR=Yc,KR=Gc,YR="arrange",Eg="measuring",GR="scrolling",Sg="scrollbarHidden",QR="noContent",ql=`${go}-padding`,up=`${go}-content`,ou="os-size-observer",XR=`${ou}-appear`,ru=`${ou}-listener`,JR=`${ru}-scroll`,ts=`${ru}-item`,dp=`${ts}-final`,ZR="os-trinsic-observer",eI="os-theme-none",tn="os-scrollbar",tI=`${tn}-rtl`,nI=`${tn}-horizontal`,iI=`${tn}-vertical`,Cg=`${tn}-track`,su=`${tn}-handle`,oI=`${tn}-visible`,rI=`${tn}-cornerless`,hp=`${tn}-interaction`,pp=`${tn}-unusable`,Wl=`${tn}-auto-hide`,sI=`${Wl}-hidden`,fp=`${tn}-wheel`,aI=`${Cg}-interactive`,lI=`${su}-interactive`,xg="__osSizeObserverPlugin",cI={[xg]:{static:()=>(t,e,n)=>{const o="scroll",r=tu(`<div class="${ts}" dir="ltr"><div class="${ts}"><div class="${dp}"></div></div><div class="${ts}"><div class="${dp}" style="width: 200%; height: 200%"></div></div></div>`),s=r[0],a=s.lastChild,l=s.firstChild,c=l?.firstChild;let u=hi(s),d=u,h=!1,v;const f=()=>{cn(l,3333333),cn(a,3333333)},p=w=>{v=0,h&&(u=d,e(w===!0))},_=w=>{d=hi(s),h=!w||!Qc(d,u),w?(iu(w),h&&!v&&(Bc(v),v=zo(p))):p(w===!1),f()},S=[It(t,r),st(l,o,_),st(a,o,_)];return Ks(t,JR),co(c,{[sr]:3333333,[ar]:3333333}),zo(f),[n?Le(_,!1):f,S]}}},uI=(t,e)=>{const{M:n}=e,[i,o]=t("showNativeOverlaidScrollbars");return[i&&n.x&&n.y,o]},Yi=t=>t.indexOf(Yn)===0,dI=t=>t.replace(`${Yn}-`,""),Kl=(t,e)=>{if(t==="auto")return e?Pi:yn;const n=t||yn;return[yn,Pi,Yn].includes(n)?n:yn},hI=(t,e)=>{const{overflowX:n,overflowY:i}=jn(t,[Yc,Gc]);return{x:Kl(n,e.x),y:Kl(i,e.y)}},au="__osScrollbarsHidingPlugin",pI="__osClickScrollPlugin",mp=t=>JSON.stringify(t,((e,n)=>{if(xn(n))throw 0;return n})),vp=(t,e)=>t?`${e}`.split(".").reduce(((n,i)=>n&&og(n,i)?n[i]:void 0),t):void 0,fI=[0,33],Tg=[33,99],Og=[222,666,!0],mI={paddingAbsolute:!1,showNativeOverlaidScrollbars:!1,update:{elementEvents:[["img","load"]],debounce:{mutation:fI,resize:null,event:Tg,env:Og},attributes:null,ignoreMutation:null,flowDirectionStyles:null},overflow:{x:"scroll",y:"scroll"},scrollbars:{theme:"os-theme-dark",visibility:"auto",autoHide:"never",autoHideDelay:1300,autoHideSuspend:!1,dragScroll:!0,clickScroll:!1,pointers:["mouse","touch","pen"]}},$g=(t,e)=>{const n={},i=ao(Ut(e),Ut(t));return ot(i,(o=>{const r=t[o],s=e[o];if(us(r)&&us(s))Ze(n[o]={},$g(r,s)),Xc(n[o])&&delete n[o];else if(og(e,o)&&s!==r){let a=!0;if(dn(r)||dn(s))try{mp(r)===mp(s)&&(a=!1)}catch{}a&&(n[o]=s)}})),n},Wa=(t,e,n)=>i=>[vp(t,i),n||vp(e,i)!==void 0];let kg;const vI=()=>kg,gI=t=>{kg=t};let Ka;const _I=()=>{const t=(b,C,x)=>{It(document.body,b),It(document.body,b);const k=mg(b),O=hi(b),K=nu(C);return x&&lo(b),{x:O.h-k.h+K.h,y:O.w-k.w+K.w}},e=b=>{let C=!1;const x=Ks(b,jr);try{C=jn(b,"scrollbar-width")==="none"||jn(b,"display","::-webkit-scrollbar")==="none"}catch{}return x(),C},n=`.${Zr}{scroll-behavior:auto!important;position:fixed;opacity:0;visibility:hidden;overflow:scroll;height:200px;width:200px;z-index:-1}.${Zr} div{width:200%;height:200%;margin:10px 0}.${jr}{scrollbar-width:none!important}.${jr}::-webkit-scrollbar,.${jr}::-webkit-scrollbar-corner{appearance:none!important;display:none!important;width:0!important;height:0!important}`,o=tu(`<div class="${Zr}"><div></div><style>${n}</style></div>`)[0],r=o.firstChild,s=o.lastChild,a=vI();a&&(s.nonce=a);const[l,,c]=Hl(),[u,d]=Xt({o:t(o,r),i:Jr},Le(t,o,r,!0)),[h]=d(),v=e(o),f={x:h.x===0,y:h.y===0},p={elements:{host:null,padding:!v,viewport:b=>v&&dg(b)&&b,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},_=Ze({},mI),S=Le(Ze,{},_),w=Le(Ze,{},p),E={U:h,M:f,P:v,J:!!To,G:Le(l,"r"),K:w,Z:b=>Ze(p,b)&&w(),tt:S,nt:b=>Ze(_,b)&&S(),ot:Ze({},p),st:Ze({},_)};if($n(o,"style"),lo(o),st(Bt,"resize",(()=>{c("r",[])})),xn(Bt.matchMedia)&&!v&&(!f.x||!f.y)){const b=C=>{const x=Bt.matchMedia(`(resolution: ${Bt.devicePixelRatio}dppx)`);st(x,"change",(()=>{C(),b(C)}),{A:!0})};b((()=>{const[C,x]=u();Ze(E.U,C),c("r",[x])}))}return E},zn=()=>(Ka||(Ka=_I()),Ka),yI=(t,e,n)=>{let i=!1;const o=n?new WeakMap:!1,r=()=>{i=!0},s=a=>{if(o&&n){const l=n.map((c=>{const[u,d]=c||[];return[d&&u?(a||ug)(u,t):[],d]}));ot(l,(c=>ot(c[0],(u=>{const d=c[1],h=o.get(u)||[];if(t.contains(u)&&d){const f=st(u,d,(p=>{i?(f(),o.delete(u)):e(p)}));o.set(u,ct(h,f))}else Zt(h),o.delete(u)}))))}};return s(),[r,s]},gp=(t,e,n,i)=>{let o=!1;const{et:r,ct:s,rt:a,it:l,lt:c,ut:u}=i||{},[d,h]=yI(t,(()=>o&&n(!0)),a),v=r||[],f=s||[],p=ao(v,f),_=(w,E)=>{if(!hs(E)){const b=c||Bo,C=u||Bo,x=[],k=[];let O=!1,K=!1;if(ot(E,(D=>{const{attributeName:P,target:U,type:M,oldValue:q,addedNodes:le,removedNodes:de}=D,Y=M==="attributes",I=M==="childList",A=t===U,Q=Y&&P,z=Q&&Jc(U,P||""),ie=mo(z)?z:null,ve=Q&&q!==ie,re=Gv(f,P)&&ve;if(e&&(I||!A)){const ge=Y&&ve,_e=ge&&l&&Ll(U,l),$=(_e?!b(U,P,q,ie):!Y||ge)&&!C(D,!!_e,t,i);ot(le,(N=>ct(x,N))),ot(de,(N=>ct(x,N))),K=K||$}!e&&A&&ve&&!b(U,P,q,ie)&&(ct(k,P),O=O||re)})),h((D=>ps(x).reduce(((P,U)=>(ct(P,ug(D,U)),Ll(U,D)?ct(P,U):P)),[]))),e)return!w&&K&&n(!1),[!1];if(!hs(k)||O){const D=[ps(k),O];return w||n.apply(0,D),D}}},S=new AR(Le(_,!1));return[()=>(S.observe(t,{attributes:!0,attributeOldValue:!0,attributeFilter:p,subtree:e,childList:e,characterData:e}),o=!0,()=>{o&&(d(),S.disconnect(),o=!1)}),()=>{if(o)return _(!0,S.takeRecords())}]};let Si=null;const Ag=(t,e,n)=>{const{ft:i}=n||{},o=vo(xg),[r]=Xt({o:!1,u:!0});return()=>{const s=[],l=tu(`<div class="${ou}"><div class="${ru}"></div></div>`)[0],c=l.firstChild,u=d=>{const h=dn(d)&&!hs(d);let v=!1,f=!1;if(h){const p=d[0],[_,,S]=r(p.contentRect),w=zl(_);f=vg(_,S),v=!f&&!w}else f=d===!0;v||e({_t:!0,ft:f})};if(qi){if(!Bs(Si)){const f=new qi(Bo);f.observe(t,{get box(){Si=!0}}),Si=Si||!1,f.disconnect()}const d=ig(u,{p:0,v:0}),h=f=>d(f),v=new qi(h);if(v.observe(Si?t:c),ct(s,[()=>{v.disconnect()},!Si&&It(t,l)]),Si){const f=new qi(h);f.observe(t,{box:"border-box"}),ct(s,(()=>f.disconnect()))}}else if(o){const[d,h]=o(c,u,i);ct(s,ao([Ks(l,XR),st(l,"animationstart",d),It(t,l)],h))}else return Bo;return Le(Zt,s)}},bI=(t,e)=>{let n;const i=l=>l.h===0||l.isIntersecting||l.intersectionRatio>0,o=Xi(ZR),[r]=Xt({o:!1}),s=(l,c)=>{if(l){const u=r(i(l)),[,d]=u;return d&&!c&&e(u)&&[u]}},a=(l,c)=>s(c.pop(),l);return[()=>{const l=[];if(tp)n=new tp(Le(a,!1),{root:t}),n.observe(o),ct(l,(()=>{n.disconnect()}));else{const c=()=>{const u=hi(o);s(u)};ct(l,Ag(o,c)()),c()}return Le(Zt,ct(l,It(t,o)))},()=>n&&a(!0,n.takeRecords())]},wI=(t,e,n,i)=>{let o,r,s,a,l,c,u,d;const h=`[${pi}]`,v=`[${Kn}]`,f=["id","class","style","open","wrap","cols","rows"],{dt:p,vt:_,L:S,gt:w,ht:E,V:b,bt:C,yt:x,wt:k,St:O}=t,K=R=>jn(R,"direction")==="rtl",D=()=>{let R,$,N;const F=ig(i,{p:()=>R,v:()=>$,S:()=>N,m(oe,ee){const[G]=oe,[he]=ee;return[ao(Ut(G),Ut(he)).reduce(((me,$e)=>(me[$e]=G[$e]||he[$e],me)),{})]}}),B=(oe,ee)=>{if(dn(ee)){const[G,he,me]=ee;R=G,$=he,N=me}else di(ee)?(R=ee,$=!1,N=!1):(R=!1,$=!1,N=!1);F(oe)};return B.O=F.O,B},P={Ot:!1,B:K(p)},U=zn(),M=vo(au),[q]=Xt({i:Qc,o:{w:0,h:0}},(()=>{const R=M&&M.R(t,e,P,U,n).Y,N=!(C&&b)&&eu(_,pi,es),F=!b&&x(YR),B=F&&Jt(w),oe=B&&O(),ee=k(Eg,N),G=F&&R&&R(),he=ms(S),me=nu(S);return G&&G(),cn(w,B),oe&&oe(),N&&ee(),{w:he.w+me.w,h:he.h+me.h}})),le=D(),de=R=>{const $=K(p);Ze(R,{Ct:d!==$}),Ze(P,{B:$}),d=$},Y=(R,$)=>{const[N,F]=R,B={$t:F};return Ze(P,{Ot:N}),$||i(B),B},I=({_t:R,ft:$})=>{const N=$?i:le,F={_t:R||$,ft:$};de(F),N(F,r)},A=(R,$)=>{const[,N]=q(),F={xt:N};return de(F),N&&!$&&le(F,R?s:o),F},Q=(R,$,N)=>{const F={Ht:$};return de(F),$&&!N&&le(F,o),F},[z,ie]=E?bI(_,Y):[],ve=!b&&Ag(_,I,{ft:!0}),[re,ge]=gp(_,!1,Q,{ct:f,et:f}),_e=b&&qi&&new qi((R=>{const $=R[R.length-1].contentRect;I({_t:!0,ft:vg($,u)}),u=$}));return[()=>{_e&&_e.observe(_);const R=ve&&ve(),$=z&&z(),N=re(),F=U.G((B=>{const[,oe]=q();le({Et:B,xt:oe,_t:C},a)}));return()=>{_e&&_e.disconnect(),R&&R(),$&&$(),c&&c(),N(),F()}},({Dt:R,zt:$,It:N})=>{const F={},[B]=R("update.ignoreMutation"),[oe,ee]=R("update.attributes"),[G,he]=R("update.elementEvents"),[me,$e]=R("update.debounce"),Ce=he||ee,Ne=$||N,Pe=Ue=>xn(B)&&!!B(Ue);if(Ce){l&&l(),c&&c();const[Ue,ut]=gp(E||S,!0,A,{et:ao(f,oe||[]),rt:G,it:h,ut:(Qe,at)=>{const{target:tt,attributeName:pt}=Qe;return(!at&&pt&&!b?MR(tt,h,v):!1)||!!Ki(tt,`.${tn}`)||Pe(Qe)}});c=Ue(),l=ut}if($e&&(le.O(),dn(me)||di(me)?(o=me,r=!1,s=Tg,a=Og):Vo(me)?(o=me.mutation,r=me.resize,s=me.event,a=me.env):(o=!1,r=!1,s=!1,a=!1)),Ne){const Ue=ge(),ut=ie&&ie(),Qe=l&&l();Ue&&Ze(F,Q(Ue[0],Ue[1],Ne)),ut&&Ze(F,Y(ut[0],Ne)),Qe&&Ze(F,A(Qe[0],Ne))}return de(F),F},P]},Pg=(t,e)=>xn(e)?e.apply(0,t):e,EI=(t,e,n,i)=>{const o=qc(i)?n:i;return Pg(t,o)||e.apply(0,t)},Rg=(t,e,n,i)=>{const o=qc(i)?n:i,r=Pg(t,o);return!!r&&(ds(r)?r:e.apply(0,t))},SI=(t,e)=>{const{nativeScrollbarsOverlaid:n,body:i}=e||{},{M:o,P:r,K:s}=zn(),{nativeScrollbarsOverlaid:a,body:l}=s().cancel,c=n??a,u=qc(i)?l:i,d=(o.x||o.y)&&c,h=t&&(Vs(u)?!r:u);return!!d||!!h},CI=(t,e,n,i)=>{const o="--os-viewport-percent",r="--os-scroll-percent",s="--os-scroll-direction",{K:a}=zn(),{scrollbars:l}=a(),{slot:c}=l,{dt:u,vt:d,L:h,At:v,gt:f,bt:p,V:_}=e,{scrollbars:S}=v?{}:t,{slot:w}=S||{},E=[],b=[],C=[],x=Rg([u,d,h],(()=>_&&p?u:d),c,w),k=z=>{if(To){let ie=null,ve=[];const re=new To({source:f,axis:z}),ge=()=>{ie&&ie.cancel(),ie=null};return{Mt:R=>{const{Tt:$}=n,N=Ha($)[z],F=z==="x",B=[Va(0,F),Va(`calc(-100% + 100cq${F?"w":"h"})`,F)],oe=N?B:B.reverse();return ve[0]===oe[0]&&ve[1]===oe[1]||(ve=oe,ge(),ie=R.kt.animate({clear:["left"],transform:oe},{timeline:re})),ge}}}},O={x:k("x"),y:k("y")},K=()=>{const{Rt:z,Vt:ie}=n,ve=(re,ge)=>sg(0,1,re/(re+ge)||0);return{x:ve(ie.x,z.x),y:ve(ie.y,z.y)}},D=(z,ie,ve)=>{const re=ve?Ks:cg;ot(z,(ge=>{re(ge.Lt,ie)}))},P=(z,ie)=>{ot(z,(ve=>{const[re,ge]=ie(ve);co(re,ge)}))},U=(z,ie,ve)=>{const re=Bs(ve),ge=re?ve:!0,_e=re?!ve:!0;ge&&D(b,z,ie),_e&&D(C,z,ie)},M=()=>{const z=K(),ie=ve=>re=>[re.Lt,{[o]:Ul(ve)+""}];P(b,ie(z.x)),P(C,ie(z.y))},q=()=>{if(!To){const{Tt:z}=n,ie=ap(z,Jt(f)),ve=re=>ge=>[ge.Lt,{[r]:Ul(re)+""}];P(b,ve(ie.x)),P(C,ve(ie.y))}},le=()=>{const{Tt:z}=n,ie=Ha(z),ve=re=>ge=>[ge.Lt,{[s]:re?"0":"1"}];P(b,ve(ie.x)),P(C,ve(ie.y)),To&&(b.forEach(O.x.Mt),C.forEach(O.y.Mt))},de=()=>{if(_&&!p){const{Rt:z,Tt:ie}=n,ve=Ha(ie),re=ap(ie,Jt(f)),ge=_e=>{const{Lt:R}=_e,$=Ho(R)===h&&R,N=(F,B,oe)=>{const ee=B*F;return fg(oe?ee:-ee)};return[$,$&&{transform:Va({x:N(re.x,z.x,ve.x),y:N(re.y,z.y,ve.y)})}]};P(b,ge),P(C,ge)}},Y=z=>{const ie=z?"x":"y",re=Xi(`${tn} ${z?nI:iI}`),ge=Xi(Cg),_e=Xi(su),R={Lt:re,Pt:ge,kt:_e},$=O[ie];return ct(z?b:C,R),ct(E,[It(re,ge),It(ge,_e),Le(lo,re),$&&$.Mt(R),i(R,U,z)]),R},I=Le(Y,!0),A=Le(Y,!1),Q=()=>(It(x,b[0].Lt),It(x,C[0].Lt),Le(Zt,E));return I(),A(),[{Ut:M,Nt:q,qt:le,Bt:de,Ft:U,jt:{Xt:b,Yt:I,Wt:Le(P,b)},Jt:{Xt:C,Yt:A,Wt:Le(P,C)}},Q]},xI=(t,e,n,i,o)=>(r,s,a)=>{const{vt:l,L:c,V:u,gt:d,Gt:h,St:v}=e,{Lt:f,Pt:p,kt:_}=r,[S,w]=Wi(333),[E,b]=Wi(444),C=O=>{xn(d.scrollBy)&&d.scrollBy({behavior:"smooth",left:O.x,top:O.y})},x=()=>{const O="pointerup pointercancel lostpointercapture",K=`client${a?"X":"Y"}`,D=a?sr:ar,P=a?"left":"top",U=a?"w":"h",M=a?"x":"y",q=[];return st(p,"pointerdown",i((le=>{const de=Ki(le.target,`.${su}`)===_,Y=de?_:p,I=t.scrollbars,A=I[de?"dragScroll":"clickScroll"],{button:Q,isPrimary:z,pointerType:ie}=le,{pointers:ve}=I;if(Q===0&&z&&A&&(ve||[]).includes(ie)){Zt(q),b();const ge=!de&&(le.shiftKey||A==="instant"),_e=Le(Ba,_),R=Le(Ba,p),$=(tt,pt)=>(tt||_e())[P]-(pt||R())[P],N=Fl(Ba(d)[D])/hi(d)[U]||1,F=Jt(d)[M],B=tt=>{cn(d,{[M]:F+tt})},oe=tt=>{const{Rt:pt}=n,dt=hi(p)[U]-hi(_)[U],ft=1/N*tt/dt;B(ft*pt[M])},ee=le[K],G=_e(),he=R(),me=G[D],$e=$(G,he)+me/2,Ne=ee-he[P]-$e,Pe=de?0:Ne,Ue=tt=>{Zt(at),Y.releasePointerCapture(tt.pointerId)},ut=de||ge,Qe=v(),at=[st(h,O,Ue),st(h,"selectstart",(tt=>Vl(tt)),{D:!1}),st(p,O,Ue),ut&&st(p,"pointermove",(tt=>oe(Pe+tt[K]-ee))),ut&&(()=>{const tt=Jt(d);Qe();const pt=Jt(d),dt={x:pt.x-tt.x,y:pt.y-tt.y};(li(dt.x)>3||li(dt.y)>3)&&(v(),cn(d,tt),C(dt),E(Qe))})];if(Y.setPointerCapture(le.pointerId),ge)oe(Ne);else if(!de){const tt=vo(pI);if(tt){const{Vt:pt}=n,dt=tt(B,oe,Le($),Ne,pt[M],A,!!a,(ft=>{ft?Qe():ct(at,Qe)}));ct(at,dt),ct(q,Le(dt,!0))}}}})))};let k=!0;return Le(Zt,[st(_,"pointermove pointerleave",i(o)),st(f,"pointerenter",i((()=>{s(hp,!0)}))),st(f,"pointerleave pointercancel",i((()=>{s(hp,!1)}))),st(f,"wheel",i((O=>{const{deltaX:K,deltaY:D,deltaMode:P}=O;k&&P===0&&Ho(f)===l&&C({x:K,y:D}),k=!1,s(fp,!0),S((()=>{k=!0,s(fp)})),Vl(O)})),{D:!1,I:!0}),!u&&st(f,"mousedown",i((()=>{const O=Nl();(ip(O,Kn)||ip(O,pi)||O===document.body)&&Hc(Le(Bl,c),25)}))),st(f,"pointerdown",(()=>{const O=st(h,"click",(D=>{K(),gg(D)}),{A:!0,I:!0,D:!1}),K=st(h,"pointerup pointercancel",(()=>{K(),setTimeout(O,150)}),{I:!0,D:!0})}),{I:!0,D:!0}),x(),w,b])},TI=(t,e,n,i,o,r,s)=>{let a,l,c,u,d,h=Bo,v=0;const f=["mouse","pen"],p=_e=>R=>{n.Kt||_e(R)},_=_e=>f.includes(_e.pointerType),[S,w]=Wi(),[E,b]=Wi(100),[C,x]=Wi(50),[k,O]=Wi((()=>v)),[K,D]=CI(t,r,o,xI(e,r,o,p,(_e=>_(_e)&&Q()))),{vt:P,Qt:U,bt:M}=r,{Ft:q,Ut:le,Nt:de,qt:Y,Bt:I}=K,A=(_e,R)=>{O();const $=N=>{n.Kt||q(sI,N)};if(_e)$();else{const N=c?!a:!0;v>0&&!R?k(Le($,N)):$(N)}},Q=()=>{(c?!a:!u)&&(A(!0),E((()=>{A(!1)})))},z=_e=>{_(_e)&&(a=!0,!n.Kt&&c&&A(!0))},ie=_e=>{_(_e)&&(a=!1,!n.Kt&&c&&A(!1))},ve=_e=>{q(Wl,_e,!0),q(Wl,_e,!1)},re=[O,b,x,w,()=>h(),st(P,"pointerover",z,{A:!0}),st(P,"pointerenter",z),st(P,"pointerleave",ie),st(P,"pointermove",p((_e=>{_(_e)&&l&&Q()}))),st(U,"scroll",p((_e=>{S((()=>{de(),Q()})),s(_e),I()})))],ge=vo(au);return[()=>Le(Zt,ct(re,D())),({Dt:_e,It:R,Zt:$,tn:N})=>{const{nn:F,sn:B,en:oe,cn:ee}=N||{},{Ct:G,ft:he}=$||{},{B:me}=i,{M:$e,P:Ce}=zn(),{rn:Ne,j:Pe}=o,[Ue,ut]=_e("showNativeOverlaidScrollbars"),[Qe,at]=_e("scrollbars.theme"),[tt,pt]=_e("scrollbars.visibility"),[dt,ft]=_e("scrollbars.autoHide"),[Dt,fn]=_e("scrollbars.autoHideSuspend"),[X]=_e("scrollbars.autoHideDelay"),[V,J]=_e("scrollbars.dragScroll"),[ye,xe]=_e("scrollbars.clickScroll"),[se,Me]=_e("overflow"),Z=he&&!R,ae=F||B||ee||G||R,fe=oe||pt||Me,ce=Ue&&$e.x&&$e.y,be=!Ce&&!ge,On=ce||be,Qt=(on,Ft,yt)=>{const ur=on.includes(Pi)&&(tt===Yn||tt==="auto"&&Ft===Pi);return q(oI,ur,yt),ur};if(v=X,(ut||be)&&q(eI,On),at&&(q(d),q(Qe,!0),d=Qe),(fn||Z)&&(ve(!Dt),Z&&Dt&&(Pe.x||Pe.y?(h(),C((()=>{h=st(U,Pi,p(Le(ve,!0)),{A:!0})}))):ve(!0))),ft&&(l=dt==="move",c=dt==="leave",u=dt==="never",A(u,!0)),J&&q(lI,V),xe&&q(aI,!!ye),fe){const on=Qt(se.x,Ne.x,!0),Ft=Qt(se.y,Ne.y,!1);q(rI,!(on&&Ft))}ae&&(de(),le(),I(),ee&&Y(),q(pp,!Pe.x,!0),q(pp,!Pe.y,!1),q(tI,me&&!M))},{},K]},OI=t=>{const e=zn(),{K:n,P:i}=e,{elements:o}=n(),{padding:r,viewport:s,content:a}=o,l=ds(t),c=l?{}:t,{elements:u}=c,{padding:d,viewport:h,content:v}=u||{},f=l?t:c.target,p=dg(f),_=f.ownerDocument,S=_.documentElement,w=()=>_.defaultView||Bt,E=Le(EI,[f]),b=Le(Rg,[f]),C=Le(Xi,""),x=Le(E,C,s),k=Le(b,C,a),O=G=>{const he=hi(G),me=ms(G),$e=jn(G,Yc),Ce=jn(G,Gc);return me.w-he.w>0&&!Yi($e)||me.h-he.h>0&&!Yi(Ce)},K=x(h),D=K===f,P=D&&p,U=!D&&k(v),M=!D&&K===U,q=P?S:K,le=P?q:f,de=!D&&b(C,r,d),Y=!M&&U,I=[Y,q,de,le].map((G=>ds(G)&&!Ho(G)&&G)),A=G=>G&&Gv(I,G),Q=!A(q)&&O(q)?q:f,z=P?S:q,ve={dt:f,vt:le,L:q,ln:de,ht:Y,gt:z,Qt:P?_:q,an:p?S:Q,Gt:_,bt:p,At:l,V:D,un:w,yt:G=>eu(q,Kn,G),wt:(G,he)=>fs(q,Kn,G,he),St:()=>fs(z,Kn,GR,!0)},{dt:re,vt:ge,ln:_e,L:R,ht:$}=ve,N=[()=>{$n(ge,[pi,qa]),$n(re,qa),p&&$n(S,[qa,pi])}];let F=jl([$,R,_e,ge,re].find((G=>G&&!A(G))));const B=P?re:$||R,oe=Le(Zt,N);return[ve,()=>{const G=w(),he=Nl(),me=Ue=>{It(Ho(Ue),jl(Ue)),lo(Ue)},$e=Ue=>st(Ue,"focusin focusout focus blur",gg,{I:!0,D:!1}),Ce="tabindex",Ne=Jc(R,Ce),Pe=$e(he);return Wn(ge,pi,D?"":qR),Wn(_e,ql,""),Wn(R,Kn,""),Wn($,up,""),D||(Wn(R,Ce,Ne||"-1"),p&&Wn(S,cp,"")),It(B,F),It(ge,_e),It(_e||ge,!D&&R),It(R,$),ct(N,[Pe,()=>{const Ue=Nl(),ut=A(R),Qe=ut&&Ue===R?re:Ue,at=$e(Qe);$n(_e,ql),$n($,up),$n(R,Kn),p&&$n(S,cp),Ne?Wn(R,Ce,Ne):$n(R,Ce),A($)&&me($),ut&&me(R),A(_e)&&me(_e),Bl(Qe),at()}]),i&&!D&&(Zc(R,Kn,Sg),ct(N,Le($n,R,Kn))),Bl(!D&&p&&he===re&&G.top===G?R:he),Pe(),F=0,oe},oe]},$I=({ht:t})=>({Zt:e,fn:n,It:i})=>{const{$t:o}=e||{},{Ot:r}=n;t&&(o||i)&&co(t,{[ar]:r&&"100%"})},kI=({vt:t,ln:e,L:n,V:i},o)=>{const[r,s]=Xt({i:RR,o:rp()},Le(rp,t,"padding",""));return({Dt:a,Zt:l,fn:c,It:u})=>{let[d,h]=s(u);const{P:v}=zn(),{_t:f,xt:p,Ct:_}=l||{},{B:S}=c,[w,E]=a("paddingAbsolute");(f||h||(u||p))&&([d,h]=r(u));const C=!i&&(E||_||h);if(C){const x=!w||!e&&!v,k=d.r+d.l,O=d.t+d.b,K={[tg]:x&&!S?-k:0,[ng]:x?-O:0,[eg]:x&&S?-k:0,top:x?-d.t:0,right:x?S?-d.r:"auto":0,left:x?S?"auto":-d.l:0,[sr]:x&&`calc(100% + ${k}px)`},D={[Qv]:x?d.t:0,[Xv]:x?d.r:0,[Zv]:x?d.b:0,[Jv]:x?d.l:0};co(e||n,K),co(n,D),Ze(o,{ln:d,_n:!x,F:e?D:Ze({},K,D)})}return{dn:C}}},AI=(t,e)=>{const n=zn(),{vt:i,ln:o,L:r,V:s,Qt:a,gt:l,bt:c,wt:u,un:d}=t,{P:h}=n,v=c&&s,f=Le(Kv,0),p={display:()=>!1,direction:re=>re!=="ltr",flexDirection:re=>re.endsWith("-reverse"),writingMode:re=>re!=="horizontal-tb"},_=Ut(p),S={i:Qc,o:{w:0,h:0}},w={i:Jr,o:{}},E=re=>{u(Eg,!v&&re)},b=()=>jn(r,_),C=(re,ge)=>{const _e=!Ut(re).length,R=ge?!0:_.some((Ce=>{const Ne=re[Ce];return mo(Ne)&&p[Ce](Ne)}));if(_e||!R||!UR(r))return{T:{x:0,y:0},k:{x:1,y:1}};E(!0);const $=Jt(l),N=st(a,Pi,(Ce=>{const Ne=Jt(l);Ce.isTrusted&&Ne.x===$.x&&Ne.y===$.y&&iu(Ce)}),{I:!0,A:!0}),F=u(QR,!0);cn(l,{x:0,y:0}),F();const B=Jt(l),oe=ms(l);cn(l,{x:oe.w,y:oe.h});const ee=Jt(l),G={x:ee.x-B.x,y:ee.y-B.y};cn(l,{x:-oe.w,y:-oe.h});const he=Jt(l),me={x:he.x-B.x,y:he.y-B.y},$e={x:li(G.x)>=li(me.x)?ee.x:he.x,y:li(G.y)>=li(me.y)?ee.y:he.y};return cn(l,$),zo((()=>N())),{T:B,k:$e}},x=(re,ge)=>{const _e=Bt.devicePixelRatio%1!==0?1:0,R={w:f(re.w-ge.w),h:f(re.h-ge.h)};return{w:R.w>_e?R.w:0,h:R.h>_e?R.h:0}},k=(re,ge)=>{const _e=(R,$,N,F)=>{const B=R===Yn?yn:dI(R),oe=Yi(R),ee=Yi(N);return!$&&!F?yn:oe&&ee?Yn:oe?$&&F?B:$?Yn:yn:$?B:ee&&F?Yn:yn};return{x:_e(ge.x,re.x,ge.y,re.y),y:_e(ge.y,re.y,ge.x,re.x)}},O=re=>{const ge=R=>[Yn,yn,Pi].map(($=>ve(Kl($),R))),_e=ge(!0).concat(ge()).join(" ");u(_e),u(Ut(re).map((R=>ve(re[R],R==="x"))).join(" "),!0)},[K,D]=Xt(S,Le(nu,r)),[P,U]=Xt(S,Le(ms,r)),[M,q]=Xt(S),[le]=Xt(w),[de,Y]=Xt(S),[I]=Xt(w),[A]=Xt({i:(re,ge)=>qs(re,ge,ps(ao(Ut(re),Ut(ge)))),o:{}}),[Q,z]=Xt({i:(re,ge)=>Jr(re.T,ge.T)&&Jr(re.k,ge.k),o:_g()}),ie=vo(au),ve=(re,ge)=>`${ge?WR:KR}${PR(re)}`;return({Dt:re,Zt:ge,fn:_e,It:R},{dn:$})=>{const{_t:N,Ht:F,xt:B,Ct:oe,ft:ee,Et:G}=ge||{},he=ie&&ie.R(t,e,_e,n,re),{X:me,Y:$e,W:Ce}=he||{},[Ne,Pe]=uI(re,n),[Ue,ut]=re("overflow"),Qe=Yi(Ue.x),at=Yi(Ue.y),tt=N||$||B||oe||G||Pe;let pt=D(R),dt=U(R),ft=q(R),Dt=Y(R);if(Pe&&h&&u(Sg,!Ne),tt){eu(i,pi,es)&&E(!0);const Cu=$e&&$e(),[dr]=pt=K(R),[hr]=dt=P(R),pr=mg(r),fr=v&&NR(d()),u_={w:f(hr.w+dr.w),h:f(hr.h+dr.h)},xu={w:f((fr?fr.w:pr.w+f(pr.w-hr.w))+dr.w),h:f((fr?fr.h:pr.h+f(pr.h-hr.h))+dr.h)};Cu&&Cu(),Dt=de(xu),ft=M(x(u_,xu),R)}const[fn,X]=Dt,[V,J]=ft,[ye,xe]=dt,[se,Me]=pt,[Z]=le({x:V.w>0,y:V.h>0}),ae=Qe&&at&&(Z.x||Z.y)||Qe&&Z.x&&!Z.y||at&&Z.y&&!Z.x,fe=$||oe||G||Me||xe||X||J||ut||Pe||tt||F&&v,[ce]=re("update.flowDirectionStyles"),[be,On]=A(ce?ce(r)||{}:b(),R),Qt=oe||ee||On||R,[on,Ft]=Qt?Q(C(be,!!ce),R):z();let yt=k(Z,Ue);E(!1),fe&&(O(yt),yt=hI(r,Z),Ce&&me&&(me(yt,ye,se),co(r,Ce(yt))));const[ur,c_]=I(yt);return fs(i,pi,es,ae),fs(o,ql,es,ae),Ze(e,{rn:ur,Vt:{x:fn.w,y:fn.h},Rt:{x:V.w,y:V.h},j:Z,Tt:zR(on,V)}),{en:c_,nn:X,sn:J,cn:Ft||J}}},PI=t=>{const[e,n,i]=OI(t),o={ln:{t:0,r:0,b:0,l:0},_n:!1,F:{[tg]:0,[ng]:0,[eg]:0,[Qv]:0,[Xv]:0,[Zv]:0,[Jv]:0},Vt:{x:0,y:0},Rt:{x:0,y:0},rn:{x:yn,y:yn},j:{x:!1,y:!1},Tt:_g()},{dt:r,gt:s,V:a,St:l}=e,{P:c,M:u}=zn(),d=!c&&(u.x||u.y),h=[$I(e),kI(e,o),AI(e,o)];return[n,v=>{const f={},_=d&&Jt(s),S=_&&l();return ot(h,(w=>{Ze(f,w(v,f)||{})})),cn(s,_),S&&S(),a||cn(r,0),f},o,e,i]},RI=(t,e,n,i)=>{let o=!1;const r={Kt:!1,pn:!1},s=Wa(e,{}),[a,l,c,u,d]=PI(t),[h,v,f]=wI(u,c,s,(b=>{E({},b)})),[p,_,,S]=TI(t,e,r,f,c,u,i),w=b=>Ut(b).some((C=>!!b[C])),E=(b,C)=>{const{Kt:x,pn:k}=r;if(k||x&&o)return!1;const{vn:O,It:K,zt:D}=b,P=O||{},U=!!K||!o,M={Dt:Wa(e,P,U),vn:P,It:U},q=C||v(Ze({},M,{zt:D})),le=l(Ze({},M,{fn:f,Zt:q}));_(Ze({},M,{Zt:q,tn:le}));const de=w(q),Y=w(le),I=de||Y||!Xc(P)||U;return o=!0,I&&n(b,{Zt:q,tn:le}),I};return[()=>{const{an:b,gt:C,St:x}=u,k=Jt(b),O=[h(),a(),p(),()=>{r.pn=!0}],K=x();return cn(C,k),K(),Le(Zt,O)},E,b=>{const C=r.Kt;r.Kt=b,!b&&C!==b&&E({It:!0,zt:!0})},()=>{_({Dt:Wa(e,{},!1),vn:{},It:!1})},()=>({gn:r,hn:f,bn:c}),{yn:u,wn:S},d]},lu=new WeakMap,II=(t,e)=>{lu.set(t,e)},MI=t=>{lu.delete(t)},Ig=t=>lu.get(t),hn=(t,e,n)=>{const{tt:i}=zn(),o=ds(t),r=o?t:t.target,s=Ig(r);if(e&&!s){const a=[],l={},c=U=>{const M=rg(U),q=vo(HR);return q?q(M,!0):M},u=Ze({},i(),c(e)),[d,h,v]=Hl(),[f,p,_]=Hl(n),S=(U,M)=>{_(U,M),v(U,M)},[w,E,b,C,x,k,O]=RI(t,u,(({vn:U,It:M},{Zt:q,tn:le})=>{const{_t:de,Ct:Y,$t:I,xt:A,Ht:Q,ft:z}=q,{nn:ie,sn:ve,en:re,cn:ge}=le;S("updated",[P,{updateHints:{sizeChanged:!!de,directionChanged:!!Y,heightIntrinsicChanged:!!I,overflowEdgeChanged:!!ie,overflowAmountChanged:!!ve,overflowStyleChanged:!!re,scrollCoordinatesChanged:!!ge,contentMutation:!!A,hostMutation:!!Q,appear:!!z},changedOptions:U||{},force:!!M}])}),(U=>S("scroll",[P,U]))),K=U=>{const{gn:M}=x(),{pn:q}=M;q||(MI(r),Zt(a),S("destroyed",[P,U]),h(),p())},P={options(U,M){if(U){const q=M?i():{},le=$g(u,Ze(q,c(U)));Xc(le)||(Ze(u,le),E({vn:le}))}return Ze({},u)},on:f,off:(U,M)=>{U&&M&&p(U,M)},state(){const{gn:U,hn:M,bn:q}=x(),{pn:le,Kt:de}=U,{B:Y}=M,{Vt:I,Rt:A,rn:Q,j:z,ln:ie,_n:ve,Tt:re}=q;return Ze({},{overflowEdge:I,overflowAmount:A,overflowStyle:Q,hasOverflow:z,scrollCoordinates:{start:re.T,end:re.k},padding:ie,paddingAbsolute:ve,directionRTL:Y,sleeping:de,destroyed:le})},elements(){const{dt:U,vt:M,ln:q,L:le,ht:de,gt:Y,Qt:I}=k.yn,{jt:A,Jt:Q}=k.wn,z=ve=>{const{kt:re,Pt:ge,Lt:_e}=ve;return{scrollbar:_e,track:ge,handle:re}},ie=ve=>{const{Xt:re,Yt:ge}=ve,_e=z(re[0]);return Ze({},_e,{clone:()=>{const R=z(ge());return C(),R}})};return Ze({},{target:U,host:M,padding:q||le,viewport:le,content:de||le,scrollOffsetElement:Y,scrollEventElement:I,scrollbarHorizontal:ie(A),scrollbarVertical:ie(Q)})},update:U=>E({It:U,zt:!0}),destroy:Le(K,!1),sleep:b,plugin:U=>l[Ut(U)[0]]};return ct(a,[O]),II(r,P),wg(yg,hn,[P,d,l]),SI(k.yn.bt,!o&&t.cancel)?(K(!0),P):(ct(a,w()),S("initialized",[P]),P.update(),P)}return s};hn.plugin=t=>{const e=dn(t),n=e?t:[t],i=n.map((o=>wg(o,hn)[0]));return VR(n),e?i:i[0]};hn.valid=t=>{const e=t&&t.elements,n=xn(e)&&e();return Vo(n)&&!!Ig(n.target)};hn.env=()=>{const{U:t,M:e,P:n,J:i,ot:o,st:r,K:s,Z:a,tt:l,nt:c}=zn();return Ze({},{scrollbarsSize:t,scrollbarsOverlaid:e,scrollbarsHiding:n,scrollTimeline:i,staticDefaultInitialization:o,staticDefaultOptions:r,getDefaultInitialization:s,setDefaultInitialization:a,getDefaultOptions:l,setDefaultOptions:c})};hn.nonce=gI;hn.trustedTypePolicy=FR;class DI{constructor(){this._listeners=new Map,this.on=this.addEventListener,this.off=this.removeEventListener,this.emit=this.dispatchEvent}addEventListener(e,n){const i=this._listeners.get(e)??new Set;return this._listeners.set(e,i),i.add(n),this}removeEventListener(e,n){var i;return(i=this._listeners.get(e))==null||i.delete(n),this}dispatchEvent(e,...n){let i=!0;for(const o of this._listeners.get(e)??[])i=o(...n)!==!1&&i;return i}unbindAllListeners(){this._listeners.clear()}}const _p=(t,e="px")=>typeof t=="number"?t+e:t,ii=({style:t},e,n)=>{if(typeof e=="object")for(const[i,o]of Object.entries(e))o!==void 0&&(t[i]=_p(o));else n!==void 0&&(t[e]=_p(n))},yp=(t=0,e=0,n=0,i=0)=>{const o={x:t,y:e,width:n,height:i,top:e,left:t,right:t+n,bottom:e+i};return{...o,toJSON:()=>JSON.stringify(o)}},FI=t=>{let e,n=-1,i=!1;return{next:(...o)=>{e=o,i||(i=!0,n=requestAnimationFrame(()=>{t(...e),i=!1}))},cancel:()=>{cancelAnimationFrame(n),i=!1}}},bp=(t,e,n="touch")=>{switch(n){case"center":{const i=e.left+e.width/2,o=e.top+e.height/2;return i>=t.left&&i<=t.right&&o>=t.top&&o<=t.bottom}case"cover":return e.left>=t.left&&e.top>=t.top&&e.right<=t.right&&e.bottom<=t.bottom;case"touch":return t.right>=e.left&&t.left<=e.right&&t.bottom>=e.top&&t.top<=e.bottom}},LI=()=>matchMedia("(hover: none), (pointer: coarse)").matches,jI=()=>"safari"in window,Yl=t=>Array.isArray(t)?t:[t],Mg=t=>(e,n,i,o={})=>{(e instanceof HTMLCollection||e instanceof NodeList)&&(e=Array.from(e)),n=Yl(n),e=Yl(e);for(const r of e)if(r)for(const s of n)r[t](s,i,{capture:!1,...o})},oi=Mg("addEventListener"),vn=Mg("removeEventListener"),Nr=t=>{var e;const{clientX:n,clientY:i,target:o}=((e=t.touches)==null?void 0:e[0])??t;return{x:n,y:i,target:o}},Ui=(t,e=document)=>Yl(t).map(n=>typeof n=="string"?Array.from(e.querySelectorAll(n)):n instanceof Element?n:null).flat().filter(Boolean),NI=(t,e)=>e.some(n=>typeof n=="number"?t.button===n:typeof n=="object"?n.button!==t.button?!1:n.modifiers.every(i=>{switch(i){case"alt":return t.altKey;case"ctrl":return t.ctrlKey||t.metaKey;case"shift":return t.shiftKey}}):!1),{abs:Ci,max:wp,min:Ep,ceil:Sp}=Math,Cp=(t=[])=>({stored:t,selected:[],touched:[],changed:{added:[],removed:[]}}),Dg=class extends DI{constructor(e){var n,i,o,r,s;super(),this._selection=Cp(),this._targetBoundaryScrolled=!0,this._selectables=[],this._areaLocation={y1:0,x2:0,y2:0,x1:0},this._areaRect=yp(),this._singleClick=!0,this._scrollAvailable=!0,this._scrollingActive=!1,this._scrollSpeed={x:0,y:0},this._scrollDelta={x:0,y:0},this._lastMousePosition={x:0,y:0},this.enable=this._toggleStartEvents,this.disable=this._toggleStartEvents.bind(this,!1),this._options={selectionAreaClass:"selection-area",selectionContainerClass:void 0,selectables:[],document:window.document,startAreas:["html"],boundaries:["html"],container:"body",...e,behaviour:{overlap:"invert",intersect:"touch",triggers:[0],...e.behaviour,startThreshold:(n=e.behaviour)!=null&&n.startThreshold?typeof e.behaviour.startThreshold=="number"?e.behaviour.startThreshold:{x:10,y:10,...e.behaviour.startThreshold}:{x:10,y:10},scrolling:{speedDivider:10,manualSpeed:750,...(i=e.behaviour)==null?void 0:i.scrolling,startScrollMargins:{x:0,y:0,...(r=(o=e.behaviour)==null?void 0:o.scrolling)==null?void 0:r.startScrollMargins}}},features:{range:!0,touch:!0,deselectOnBlur:!1,...e.features,singleTap:{allow:!0,intersect:"native",...(s=e.features)==null?void 0:s.singleTap}}};for(const u of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))typeof this[u]=="function"&&(this[u]=this[u].bind(this));const{document:a,selectionAreaClass:l,selectionContainerClass:c}=this._options;this._area=a.createElement("div"),this._clippingElement=a.createElement("div"),this._clippingElement.appendChild(this._area),this._area.classList.add(l),c&&this._clippingElement.classList.add(c),ii(this._area,{willChange:"top, left, bottom, right, width, height",top:0,left:0,position:"fixed"}),ii(this._clippingElement,{overflow:"hidden",position:"fixed",transform:"translate3d(0, 0, 0)",pointerEvents:"none",zIndex:"1"}),this._frame=FI(u=>{this._recalculateSelectionAreaRect(),this._updateElementSelection(),this._emitEvent("move",u),this._redrawSelectionArea()}),this.enable()}_toggleStartEvents(e=!0){const{document:n,features:i}=this._options,o=e?oi:vn;o(n,"mousedown",this._onTapStart),i.touch&&o(n,"touchstart",this._onTapStart,{passive:!1})}_onTapStart(e,n=!1){const{x:i,y:o,target:r}=Nr(e),{document:s,startAreas:a,boundaries:l,features:c,behaviour:u}=this._options,d=r.getBoundingClientRect();if(e instanceof MouseEvent&&!NI(e,u.triggers))return;const h=Ui(a,s),v=Ui(l,s);this._targetElement=v.find(S=>bp(S.getBoundingClientRect(),d));const f=e.composedPath(),p=h.find(S=>f.includes(S));if(this._targetBoundary=v.find(S=>f.includes(S)),!this._targetElement||!p||!this._targetBoundary||!n&&this._emitEvent("beforestart",e)===!1)return;this._areaLocation={x1:i,y1:o,x2:0,y2:0};const _=s.scrollingElement??s.body;this._scrollDelta={x:_.scrollLeft,y:_.scrollTop},this._singleClick=!0,this.clearSelection(!1,!0),oi(s,["touchmove","mousemove"],this._delayedTapMove,{passive:!1}),oi(s,["mouseup","touchcancel","touchend"],this._onTapStop),oi(s,"scroll",this._onScroll),c.deselectOnBlur&&(this._targetBoundaryScrolled=!1,oi(this._targetBoundary,"scroll",this._onStartAreaScroll))}_onSingleTap(e){const{singleTap:{intersect:n},range:i}=this._options.features,o=Nr(e);let r;if(n==="native")r=o.target;else if(n==="touch"){this.resolveSelectables();const{x:a,y:l}=o;r=this._selectables.find(c=>{const{right:u,left:d,top:h,bottom:v}=c.getBoundingClientRect();return a<u&&a>d&&l<v&&l>h})}if(!r)return;for(this.resolveSelectables();!this._selectables.includes(r);)if(r.parentElement)r=r.parentElement;else{this._targetBoundaryScrolled||this.clearSelection();return}const{stored:s}=this._selection;if(this._emitEvent("start",e),e.shiftKey&&i&&this._latestElement){const a=this._latestElement,[l,c]=a.compareDocumentPosition(r)&4?[r,a]:[a,r],u=[...this._selectables.filter(d=>d.compareDocumentPosition(l)&4&&d.compareDocumentPosition(c)&2),l,c];this.select(u),this._latestElement=a}else s.includes(r)&&(s.length===1||e.ctrlKey||s.every(a=>this._selection.stored.includes(a)))?this.deselect(r):(this.select(r),this._latestElement=r)}_delayedTapMove(e){const{container:n,document:i,behaviour:{startThreshold:o}}=this._options,{x1:r,y1:s}=this._areaLocation,{x:a,y:l}=Nr(e);if(typeof o=="number"&&Ci(a+l-(r+s))>=o||typeof o=="object"&&Ci(a-r)>=o.x||Ci(l-s)>=o.y){if(vn(i,["mousemove","touchmove"],this._delayedTapMove,{passive:!1}),this._emitEvent("beforedrag",e)===!1){vn(i,["mouseup","touchcancel","touchend"],this._onTapStop);return}oi(i,["mousemove","touchmove"],this._onTapMove,{passive:!1}),ii(this._area,"display","block"),Ui(n,i)[0].appendChild(this._clippingElement),this.resolveSelectables(),this._singleClick=!1,this._targetRect=this._targetElement.getBoundingClientRect(),this._scrollAvailable=this._targetElement.scrollHeight!==this._targetElement.clientHeight||this._targetElement.scrollWidth!==this._targetElement.clientWidth,this._scrollAvailable&&(oi(this._targetElement,"wheel",this._wheelScroll,{passive:!1}),oi(this._options.document,"keydown",this._keyboardScroll,{passive:!1}),this._selectables=this._selectables.filter(c=>this._targetElement.contains(c))),this._setupSelectionArea(),this._emitEvent("start",e),this._onTapMove(e)}this._handleMoveEvent(e)}_setupSelectionArea(){const{_clippingElement:e,_targetElement:n,_area:i}=this,o=this._targetRect=n.getBoundingClientRect();this._scrollAvailable?(ii(e,{top:o.top,left:o.left,width:o.width,height:o.height}),ii(i,{marginTop:-o.top,marginLeft:-o.left})):(ii(e,{top:0,left:0,width:"100%",height:"100%"}),ii(i,{marginTop:0,marginLeft:0}))}_onTapMove(e){const{_scrollSpeed:n,_areaLocation:i,_options:o,_frame:r}=this,{speedDivider:s}=o.behaviour.scrolling,a=this._targetElement,{x:l,y:c}=Nr(e);if(i.x2=l,i.y2=c,this._lastMousePosition.x=l,this._lastMousePosition.y=c,this._scrollAvailable&&!this._scrollingActive&&(n.y||n.x)){this._scrollingActive=!0;const u=()=>{if(!n.x&&!n.y){this._scrollingActive=!1;return}const{scrollTop:d,scrollLeft:h}=a;n.y&&(a.scrollTop+=Sp(n.y/s),i.y1-=a.scrollTop-d),n.x&&(a.scrollLeft+=Sp(n.x/s),i.x1-=a.scrollLeft-h),r.next(e),requestAnimationFrame(u)};requestAnimationFrame(u)}else r.next(e);this._handleMoveEvent(e)}_handleMoveEvent(e){const{features:n}=this._options;(n.touch&&LI()||this._scrollAvailable&&jI())&&e.preventDefault()}_onScroll(){const{_scrollDelta:e,_options:{document:n}}=this,{scrollTop:i,scrollLeft:o}=n.scrollingElement??n.body;this._areaLocation.x1+=e.x-o,this._areaLocation.y1+=e.y-i,e.x=o,e.y=i,this._setupSelectionArea(),this._frame.next(null)}_onStartAreaScroll(){this._targetBoundaryScrolled=!0,vn(this._targetElement,"scroll",this._onStartAreaScroll)}_wheelScroll(e){const{manualSpeed:n}=this._options.behaviour.scrolling,i=e.deltaY?e.deltaY>0?1:-1:0,o=e.deltaX?e.deltaX>0?1:-1:0;this._scrollSpeed.y+=i*n,this._scrollSpeed.x+=o*n,this._onTapMove(e),e.preventDefault()}_keyboardScroll(e){const{manualSpeed:n}=this._options.behaviour.scrolling,i=e.key==="ArrowLeft"?-1:e.key==="ArrowRight"?1:0,o=e.key==="ArrowUp"?-1:e.key==="ArrowDown"?1:0;this._scrollSpeed.x+=Math.sign(i)*n,this._scrollSpeed.y+=Math.sign(o)*n,e.preventDefault(),this._onTapMove({clientX:this._lastMousePosition.x,clientY:this._lastMousePosition.y,preventDefault:()=>{}})}_recalculateSelectionAreaRect(){const{_scrollSpeed:e,_areaLocation:n,_targetElement:i,_options:o}=this,{scrollTop:r,scrollHeight:s,clientHeight:a,scrollLeft:l,scrollWidth:c,clientWidth:u}=i,d=this._targetRect,{x1:h,y1:v}=n;let{x2:f,y2:p}=n;const{behaviour:{scrolling:{startScrollMargins:_}}}=o;f<d.left+_.x?(e.x=l?-Ci(d.left-f+_.x):0,f=f<d.left?d.left:f):f>d.right-_.x?(e.x=c-l-u?Ci(d.left+d.width-f-_.x):0,f=f>d.right?d.right:f):e.x=0,p<d.top+_.y?(e.y=r?-Ci(d.top-p+_.y):0,p=p<d.top?d.top:p):p>d.bottom-_.y?(e.y=s-r-a?Ci(d.top+d.height-p-_.y):0,p=p>d.bottom?d.bottom:p):e.y=0;const S=Ep(h,f),w=Ep(v,p),E=wp(h,f),b=wp(v,p);this._areaRect=yp(S,w,E-S,b-w)}_redrawSelectionArea(){const{x:e,y:n,width:i,height:o}=this._areaRect,{style:r}=this._area;r.left=`${e}px`,r.top=`${n}px`,r.width=`${i}px`,r.height=`${o}px`}_onTapStop(e,n){var i;const{document:o,features:r}=this._options,{_singleClick:s}=this;vn(this._targetElement,"scroll",this._onStartAreaScroll),vn(o,["mousemove","touchmove"],this._delayedTapMove),vn(o,["touchmove","mousemove"],this._onTapMove),vn(o,["mouseup","touchcancel","touchend"],this._onTapStop),vn(o,"scroll",this._onScroll),this._keepSelection(),e&&s&&r.singleTap.allow?this._onSingleTap(e):!s&&!n&&(this._updateElementSelection(),this._emitEvent("stop",e)),this._scrollSpeed.x=0,this._scrollSpeed.y=0,vn(this._targetElement,"wheel",this._wheelScroll,{passive:!0}),vn(this._options.document,"keydown",this._keyboardScroll,{passive:!0}),this._clippingElement.remove(),(i=this._frame)==null||i.cancel(),ii(this._area,"display","none")}_updateElementSelection(){const{_selectables:e,_options:n,_selection:i,_areaRect:o}=this,{stored:r,selected:s,touched:a}=i,{intersect:l,overlap:c}=n.behaviour,u=c==="invert",d=[],h=[],v=[];for(let p=0;p<e.length;p++){const _=e[p];if(bp(o,_.getBoundingClientRect(),l)){if(s.includes(_))r.includes(_)&&!a.includes(_)&&a.push(_);else if(u&&r.includes(_)){v.push(_);continue}else h.push(_);d.push(_)}}u&&h.push(...r.filter(p=>!s.includes(p)));const f=c==="keep";for(let p=0;p<s.length;p++){const _=s[p];!d.includes(_)&&!(f&&r.includes(_))&&v.push(_)}i.selected=d,i.changed={added:h,removed:v},this._latestElement=void 0}_emitEvent(e,n){return this.emit(e,{event:n,store:this._selection,selection:this})}_keepSelection(){const{_options:e,_selection:n}=this,{selected:i,changed:o,touched:r,stored:s}=n,a=i.filter(l=>!s.includes(l));switch(e.behaviour.overlap){case"drop":{n.stored=[...a,...s.filter(l=>!r.includes(l))];break}case"invert":{n.stored=[...a,...s.filter(l=>!o.removed.includes(l))];break}case"keep":{n.stored=[...s,...i.filter(l=>!s.includes(l))];break}}}trigger(e,n=!0){this._onTapStart(e,n)}resolveSelectables(){this._selectables=Ui(this._options.selectables,this._options.document)}clearSelection(e=!0,n=!1){const{selected:i,stored:o,changed:r}=this._selection;r.added=[],r.removed.push(...i,...e?o:[]),n||(this._emitEvent("move",null),this._emitEvent("stop",null)),this._selection=Cp(e?[]:o)}getSelection(){return this._selection.stored}getSelectionArea(){return this._area}getSelectables(){return this._selectables}setAreaLocation(e){Object.assign(this._areaLocation,e),this._redrawSelectionArea()}getAreaLocation(){return this._areaLocation}cancel(e=!1){this._onTapStop(null,!e)}destroy(){this.cancel(),this.disable(),this._clippingElement.remove(),super.unbindAllListeners()}select(e,n=!1){const{changed:i,selected:o,stored:r}=this._selection,s=Ui(e,this._options.document).filter(a=>!o.includes(a)&&!r.includes(a));return r.push(...s),o.push(...s),i.added.push(...s),i.removed=[],this._latestElement=void 0,n||(this._emitEvent("move",null),this._emitEvent("stop",null)),s}deselect(e,n=!1){const{selected:i,stored:o,changed:r}=this._selection,s=Ui(e,this._options.document).filter(a=>i.includes(a)||o.includes(a));this._selection.stored=o.filter(a=>!s.includes(a)),this._selection.selected=i.filter(a=>!s.includes(a)),this._selection.changed.added=[],this._selection.changed.removed.push(...s.filter(a=>!r.removed.includes(a))),this._latestElement=void 0,n||(this._emitEvent("move",null),this._emitEvent("stop",null))}};Dg.version="3.9.0";let UI=Dg;const zI="5.2.0",VI={version:zI},BI={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function HI(t,e){let n=e;return n||(n=new Error("Upload error")),typeof n=="string"&&(n=new Error(n)),n instanceof Error||(n=Object.assign(new Error("Upload error"),{data:n})),sA(t)?(n=new Tl(n,t),n):(n.request=t,n)}function xp(t){return t.data.slice(0,t.data.size,t.meta.type)}const qI={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:""};class WI extends uA{static VERSION=VI.version;#e;#t;uploaderEvents;constructor(e,n){if(super(e,{...qI,fieldName:n.bundle?"files[]":"file",...n}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=BI,this.i18nInit(),this.#t=new aA({concurrency:this.opts.limit}),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");if(this.opts.bundle&&typeof this.opts.headers=="function")throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if(n?.allowedMetaFields===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null),this.#e=i=>async(o,r)=>{try{const s=await Xk(o,{...r,onBeforeRequest:(c,u)=>this.opts.onBeforeRequest?.(c,u,i),shouldRetry:this.opts.shouldRetry,onAfterResponse:this.opts.onAfterResponse,onTimeout:c=>{const u=Math.ceil(c/1e3),d=new Error(this.i18n("uploadStalled",{seconds:u}));this.uppy.emit("upload-stalled",d,i)},onUploadProgress:c=>{if(c.lengthComputable)for(const{id:u}of i){const d=this.uppy.getFile(u);d!=null&&this.uppy.emit("upload-progress",d,{uploadStarted:d.progress.uploadStarted??0,bytesUploaded:c.loaded/c.total*d.size,bytesTotal:d.size})}}});let a=await this.opts.getResponseData?.(s);if(s.responseType==="json")a??=s.response;else try{a??=JSON.parse(s.responseText)}catch(c){throw new Error("@uppy/xhr-upload expects a JSON response (with a `url` property). To parse non-JSON responses, use `getResponseData` to turn your response into JSON.",{cause:c})}const l=typeof a?.url=="string"?a.url:void 0;for(const{id:c}of i)this.uppy.emit("upload-success",this.uppy.getFile(c),{status:s.status,body:a,uploadURL:l});return s}catch(s){if(s.name==="AbortError")return;const a=s.request;for(const l of i)this.uppy.emit("upload-error",this.uppy.getFile(l.id),HI(a,s),a);throw s}}}getOptions(e){const n=this.uppy.getState().xhrUpload,{headers:i}=this.opts,o={...this.opts,...n||{},...e.xhrUpload||{},headers:{}};return typeof i=="function"?o.headers=i(e):Object.assign(o.headers,this.opts.headers),n&&Object.assign(o.headers,n.headers),e.xhrUpload&&Object.assign(o.headers,e.xhrUpload.headers),o}addMetadata(e,n,i){_h(i.allowedMetaFields,n).forEach(r=>{const s=n[r];Array.isArray(s)?s.forEach(a=>e.append(r,a)):e.append(r,s)})}createFormDataUpload(e,n){const i=new FormData;this.addMetadata(i,e.meta,n);const o=xp(e);return e.name?i.append(n.fieldName,o,e.meta.name):i.append(n.fieldName,o),i}createBundledUpload(e,n){const i=new FormData,{meta:o}=this.uppy.getState();return this.addMetadata(i,o,n),e.forEach(r=>{const s=this.getOptions(r),a=xp(r);r.name?i.append(s.fieldName,a,r.name):i.append(s.fieldName,a)}),i}async#n(e){const n=new dA(this.uppy),i=new AbortController;n.onFileRemove(e.id,()=>i.abort()),n.onCancelAll(e.id,()=>i.abort());try{await this.#t.add(async o=>{const r=this.getOptions(e),s=this.#e([e]),a=r.formData?this.createFormDataUpload(e,r):e.data,l=typeof r.endpoint=="string"?r.endpoint:await r.endpoint(e);return s(l,{...r,body:a,signal:AbortSignal.any([o,i.signal])})})}catch(o){if(o.name==="AbortError")return;throw o}finally{n.remove()}}async#i(e){const n=new AbortController;function i(){n.abort()}this.uppy.once("cancel-all",i);try{await this.#t.add(async o=>{const r=this.uppy.getState().xhrUpload??{},s=this.#e(e),a=this.createBundledUpload(e,{...this.opts,...r}),l=typeof this.opts.endpoint=="string"?this.opts.endpoint:await this.opts.endpoint(e);return s(l,{...this.opts,body:a,signal:AbortSignal.any([o,n.signal])})})}catch(o){if(o.name==="AbortError")return;throw o}finally{this.uppy.off("cancel-all",i)}}#r(e){const n=this.getOptions(e),i=_h(n.allowedMetaFields,e.meta);return{...e.remote?.body,protocol:"multipart",endpoint:n.endpoint,size:e.data.size,fieldname:n.fieldName,metadata:Object.fromEntries(i.map(o=>[o,e.meta[o]])),httpMethod:n.method,useFormData:n.formData,headers:n.headers}}async#o(e){await Promise.allSettled(e.map(n=>{if(n.isRemote){const i=()=>this.#t,o=new AbortController,r=s=>{s.id===n.id&&o.abort()};return this.uppy.on("file-removed",r),this.uppy.getRequestClientForFile(n).uploadRemoteFile(n,this.#r(n),{signal:o.signal,getQueue:i}).finally(()=>{this.uppy.off("file-removed",r)})}return this.#n(n)}))}#a=async e=>{if(e.length===0){this.uppy.log("[XHRUpload] No files to upload!");return}this.opts.limit===0&&this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const n=this.uppy.getFilesByIds(e),i=eA(n),o=tA(i);if(this.uppy.emit("upload-start",o),this.opts.bundle){if(i.some(s=>s.isRemote))throw new Error("Can’t upload remote files when the `bundle: true` option is set");if(typeof this.opts.headers=="function")throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await this.#i(i)}else await this.#o(i)};install(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(this.#a)}uninstall(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(this.#a)}}const cu=new Map,Gl=Symbol("ServiceContainerId");function KI(t,e){cu.set(t,e)}function YI(t){cu.delete(t)}function je(t){const e=t??ko(Gl);if(!e)throw new Error("No VueFinder app instance found. Make sure VueFinder component is mounted and provide the id explicitly or use within a VueFinder component tree.");const n=cu.get(e);if(!n)throw new Error(`VueFinder app instance with id "${e}" was not found. Make sure the VueFinder component with id="${e}" is mounted.`);return n}function GI(t){const e=localStorage.getItem(t+"_storage"),n=Mt(JSON.parse(e??"{}"));Oe(n,i);function i(){Object.keys(n).length?localStorage.setItem(t+"_storage",JSON.stringify(n)):localStorage.removeItem(t+"_storage")}function o(a,l){n[a]=l}function r(a){delete n[a]}function s(){Object.keys(n).forEach(a=>r(a))}return{getStore:(a,l=null)=>a in n?n[a]:l,setStore:o,removeStore:r,clearStore:s}}function Yt(t,e="An error occurred"){if(!t)return e;if(typeof t=="string")return t||e;if(t instanceof Error)return t.message||e;if(typeof t=="object"&&t!==null){const n=t;if(typeof n.message=="string"&&n.message)return n.message;if(typeof n.error=="string"&&n.error)return n.error}return e}function QI(t,e){return Um(t,e,{encode:JSON.stringify,decode:JSON.parse})}function XI(t){if(!t?.config?.get)return!0;try{return!!t.config.get("notificationsEnabled")}catch{return!0}}function Bi(t,e,n){const i={type:e,message:n};if(t?.emitter?.emit?.("vf-notify",i),!!XI(t))switch(e){case"success":Tr.success(n);break;case"error":Tr.error(n);break;case"warning":Tr.warning(n);break;default:Tr.info(n);break}}function Gt(t){return{success(e){Bi(t,"success",e)},error(e){Bi(t,"error",e)},info(e){Bi(t,"info",e)},warning(e){Bi(t,"warning",e)},emit(e,n){Bi(t,e,n)}}}const Ya=new Map;async function Ga(t,e){const n=e[t];return typeof n=="function"?(await n()).default:n}function JI(t,e,n,i,o){const r=Gt({emitter:n,config:o}),s="vuefinder_locale",a="global";let l;if(Ya.has(a))l=Ya.get(a),e&&e!==l.get()&&l.set(e);else{const b=localStorage.getItem(s)?JSON.parse(localStorage.getItem(s)):null;l=QI(s,e||b||"en"),Ya.set(a,l)}const c="vuefinder_translations",u=b=>{try{const C=localStorage.getItem(c);if(C)return JSON.parse(C)[b]||null}catch{}return null},d=(b,C)=>{try{const x=localStorage.getItem(c),k=x?JSON.parse(x):{};k[b]=C,localStorage.setItem(c,JSON.stringify(k))}catch{}},h=ke(l),v=String(h.value),f=u(v),p=H(f||{});let _=!1;!f&&Object.keys(i).length>0&&Ga(v,i).then(b=>{p.value=b,d(v,b)}).catch(()=>{}),Oe(h,async(b,C)=>{if(C&&b===C)return;if(!_){_=!0;const k=u(String(b));if(k)p.value=k;else if(Object.keys(i).length>0)try{const O=await Ga(String(b),i);p.value=O,d(String(b),O)}catch{}return}const x=u(String(b));if(x)p.value=x;else try{const k=await Ga(String(b),i);p.value=k,d(String(b),k)}catch(k){const O=Yt(k,"Locale cannot be loaded!");r.error(O);return}Object.values(i).length>1&&(r.success("The language is set to "+b),n.emit("vf-language-saved"))},{immediate:!1});const S=(b,...C)=>C.length?S(b=b.replace("%s",String(C.shift())),...C):b;function w(b,...C){return p.value&&Object.prototype.hasOwnProperty.call(p.value,b)?S(p.value[b]||b,...C):S(b,...C)}const E=te({get:()=>h.value,set:b=>{l.set(b)}});return Mt({t:w,locale:E,localeAtom:l})}const ZI=["edit","newfile","newfolder","preview","archive","unarchive","search","rename","upload","delete","fullscreen","download","language","move","copy","history","theme","pinned"],Fg={simple:{search:!0,preview:!0,rename:!0,upload:!0,delete:!0,newfile:!0,newfolder:!0,download:!0},advanced:ZI.reduce((t,e)=>(t[e]=!0,t),{})};function Tp(){return Fg.advanced}function Lg(t){return t?t==="simple"||t==="advanced"?{...Fg[t]}:{...Tp(),...t}:Tp()}const eM="4.1.2";function uu(t,e,n,i,o){return e=Math,n=e.log,i=1024,o=n(t)/n(i)|0,(t/e.pow(i,o)).toFixed(0)+" "+(o?"KMGTPEZY"[--o]+"iB":"B")}function jg(t,e,n,i,o){return e=Math,n=e.log,i=1e3,o=n(t)/n(i)|0,(t/e.pow(i,o)).toFixed(0)+" "+(o?"KMGTPEZY"[--o]+"B":"B")}function tM(t){if(typeof t=="number")return t;const e={k:1,m:2,g:3,t:4},n=/(\d+(?:\.\d+)?)\s?(k|m|g|t)?b?/i.exec(t);if(!n)return 0;const i=parseFloat(n[1]||"0"),o=(n[2]||"").toLowerCase(),r=e[o]??0;return Math.round(i*Math.pow(1024,r))}function nM(t){const e=Yo(null),n=H(!1),i=H(),o=H(!1);return{visible:n,type:e,data:i,open:(r,s=null)=>{t.get("fullScreen")||(document.querySelector("body").style.overflow="hidden"),n.value=!0,e.value=r,i.value=s},close:()=>{t.get("fullScreen")||(document.querySelector("body").style.overflow=""),n.value=!1,e.value=null},setEditMode:r=>{o.value=r},editMode:o}}const vs={view:"grid",theme:"silver",fullScreen:!1,showTreeView:!1,showHiddenFiles:!0,metricUnits:!1,showThumbnails:!0,persist:!1,path:"",pinnedFolders:[],notificationsEnabled:!0,expandTreeByDefault:!1,expandedTreePaths:[]},gs={initialPath:null,maxFileSize:null,loadingIndicator:"circular",showMenuBar:!0,showToolbar:!0,gridItemWidth:96,gridItemHeight:80,gridItemGap:8,gridIconSize:48,listItemHeight:32,listItemGap:2,listIconSize:16,notificationPosition:"bottom-center",notificationDuration:3e3,notificationVisibleToasts:4,notificationRichColors:!0},iM=new Set(Object.keys(gs));function oM(t){return t||"silver"}function Ng(t){return iM.has(t)}function Op(t){const e={},n={},i=t;for(const o in i)if(Ng(o))n[o]=i[o];else if(o in vs){const r=o;e[r]=i[o]}return{persistenceConfig:e,nonPersistenceConfig:n}}function $p(t,e){const n={...vs,...e,...t};return n.theme=oM(n.theme),n}function kp(t,e){return{...gs,...e,...t}}const rM=(t,e={})=>{const n=`vuefinder_config_${t}`,{persistenceConfig:i,nonPersistenceConfig:o}=Op(e),r=$p(i,vs),s=kp(o,gs),a=Um(n,r,{encode:JSON.stringify,decode:JSON.parse}),l=Tt(s),c=ri([a,l],(f,p)=>({...f,...p})),u=(f={})=>{const p=a.get(),_=l.get(),{persistenceConfig:S,nonPersistenceConfig:w}=Op(f),E=$p(S,p),b=kp(w,_);a.set(E),l.set(b)},d=f=>Ng(f)?l.get()[f]:a.get()[f],h=()=>({...a.get(),...l.get()}),v=(f,p)=>{const _=a.get();typeof f=="object"&&f!==null?a.set({..._,...f}):a.set({..._,[f]:p})};return{state:c,init:u,get:d,set:v,toggle:f=>{const p=a.get();v(f,!p[f])},all:h,reset:()=>{a.set({...vs}),l.set({...gs})}}};function sM(t,e){if(typeof t=="string"&&typeof e=="string")return t.toLowerCase().localeCompare(e.toLowerCase());const n=Number(t)||0,i=Number(e)||0;return n===i?0:n<i?-1:1}const aM=()=>{const t=Tt(""),e=Tt([]),n=Tt(!1),i=Tt([]),o=Tt({active:!1,column:"",order:""}),r=Tt({kind:"all",showHidden:!1}),s=Tt(new Set),a=Tt({type:"copy",path:"",items:new Set}),l=Tt(null),c=Tt(0),u=Tt(!1),d=Tt([]),h=Tt(-1),v=ri([t],ee=>{const G=(ee??"").trim(),he=G.indexOf("://"),me=he>=0?G.slice(0,he):"",$e=(he>=0?G.slice(he+3):G).split("/").filter(Boolean);let Ce="";const Ne=$e.map(Pe=>(Ce=Ce?`${Ce}/${Pe}`:Pe,{basename:Pe,name:Pe,path:me?`${me}://${Ce}`:Ce,type:"dir"}));return{storage:me,breadcrumb:Ne,path:G}}),f=ri([i,o,r],(ee,G,he)=>{let me=ee;he.kind==="files"?me=me.filter(Ue=>Ue.type==="file"):he.kind==="folders"&&(me=me.filter(Ue=>Ue.type==="dir")),he.showHidden||(me=me.filter(Ue=>!Ue.basename.startsWith(".")));const{active:$e,column:Ce,order:Ne}=G;if(!$e||!Ce)return me;const Pe=Ne==="asc"?1:-1;return me.slice().sort((Ue,ut)=>sM(Ue[Ce],ut[Ce])*Pe)}),p=ri([i,s],(ee,G)=>G.size===0?[]:ee.filter(he=>G.has(he.path))),_=(ee,G)=>{const he=t.get();if((G??!0)&&he!==ee){const me=d.get(),$e=h.get();$e<me.length-1&&me.splice($e+1),me.length===0&&he&&me.push(he),me.push(ee),d.set([...me]),h.set(me.length-1)}t.set(ee)},S=ee=>{i.set(ee??[])},w=ee=>{e.set(ee??[])},E=(ee,G)=>{o.set({active:!0,column:ee,order:G})},b=ee=>{const G=o.get();G.active&&G.column===ee?o.set({active:G.order==="asc",column:ee,order:"desc"}):o.set({active:!0,column:ee,order:"asc"})},C=()=>{o.set({active:!1,column:"",order:""})},x=(ee,G)=>{r.set({kind:ee,showHidden:G})},k=()=>{r.set({kind:"all",showHidden:!1})},O=(ee,G="multiple")=>{const he=new Set(s.get());G==="single"&&he.clear(),he.add(ee),s.set(he)},K=(ee,G="multiple")=>{const he=new Set(s.get());G==="single"&&he.clear(),ee.forEach(me=>he.add(me)),s.set(he)},D=ee=>{const G=new Set(s.get());G.delete(ee),s.set(G)},P=ee=>s.get().has(ee),U=(ee,G="multiple")=>{const he=new Set(s.get());he.has(ee)?he.delete(ee):(G==="single"&&he.clear(),he.add(ee)),s.set(he)},M=(ee="multiple",G)=>{if(ee==="single"){const he=i.get()[0];if(he){const me=he.path;s.set(new Set([me])),c.set(1)}}else{if(G?.selectionFilterType||G?.selectionFilterMimeIncludes&&G.selectionFilterMimeIncludes.length>0){const he=i.get().filter(me=>{const $e=G.selectionFilterType,Ce=G.selectionFilterMimeIncludes;return $e==="files"&&me.type==="dir"||$e==="dirs"&&me.type==="file"?!1:Ce&&Array.isArray(Ce)&&Ce.length>0&&me.type!=="dir"?me.mime_type?Ce.some(Ne=>me.mime_type?.startsWith(Ne)):!1:!0}).map(me=>me.path);s.set(new Set(he))}else{const he=new Set(i.get().map(me=>me.path));s.set(he)}de(s.get().size)}},q=()=>{s.set(new Set),c.set(0)},le=ee=>{const G=new Set(ee??[]);s.set(G),c.set(G.size)},de=ee=>{c.set(ee)},Y=ee=>{u.set(!!ee)},I=()=>u.get(),A=(ee,G)=>{const he=i.get().filter(me=>G.has(me.path));a.set({type:ee,path:v.get().path,items:new Set(he)})},Q=ee=>ri([a],G=>G.type==="cut"&&Array.from(G.items).some(he=>he.path===ee)),z=ee=>ri([a],G=>G.type==="copy"&&Array.from(G.items).some(he=>he.path===ee));return{files:i,storages:e,currentPath:t,sort:o,filter:r,selectedKeys:s,selectedCount:c,loading:u,draggedItem:l,clipboardItems:a,path:v,sortedFiles:f,selectedItems:p,setPath:_,setFiles:S,setStorages:w,setSort:E,toggleSort:b,clearSort:C,setFilter:x,clearFilter:k,select:O,selectMultiple:K,deselect:D,toggleSelect:U,selectAll:M,isSelected:P,clearSelection:q,setSelection:le,setSelectedCount:de,setLoading:Y,isLoading:I,setClipboard:A,createIsCut:Q,createIsCopied:z,isCut:ee=>{const G=Q(ee);return ke(G).value??!1},isCopied:ee=>{const G=z(ee);return ke(G).value??!1},clearClipboard:()=>{a.set({type:"copy",path:"",items:new Set})},getClipboard:()=>a.get(),setDraggedItem:ee=>{l.set(ee)},getDraggedItem:()=>l.get(),clearDraggedItem:()=>{l.set(null)},setReadOnly:ee=>{n.set(ee)},getReadOnly:()=>n.get(),isReadOnly:ee=>n.get()?!0:ee.read_only??!1,goBack:()=>{const ee=d.get(),G=h.get();if(G>0){const he=G-1,me=ee[he];me&&(h.set(he),_(me,!1))}},goForward:()=>{const ee=d.get(),G=h.get();if(G<ee.length-1){const he=G+1,me=ee[he];me&&(h.set(he),_(me,!1))}},canGoBack:ri([h],ee=>ee>0),canGoForward:ri([d,h],(ee,G)=>G<ee.length-1),navigationHistory:d,historyIndex:h}};class lM{validateParam(e,n){if(e==null)throw new Error(`${n} is required`)}validatePath(e){if(!e)throw new Error("Path must be a non-empty string")}parsePath(e){if(!e)return{};if(e.includes("://")){const[n,...i]=e.split("://");return{storage:n,path:i.join("://")}}return{path:e}}combinePath(e,n){return e&&n?`${e}://${n}`:n||""}}function Ap(t,e,n){const i=`HTTP ${e}: ${n}`;if(!t)return i;try{const o=JSON.parse(t);if(o.message)return o.message;if(o.error){if(typeof o.error=="string")return o.error;if(o.error.message)return o.error.message}if(o.errors&&Array.isArray(o.errors)&&o.errors.length>0){const r=o.errors.map(s=>s.message).filter(s=>!!s);if(r.length>0)return r.join(", ")}return o.detail?o.detail:o.title?o.title:t}catch{return t||i}}class Ug extends lM{config;static DEFAULT_URLS={list:"",upload:"/upload",delete:"/delete",rename:"/rename",copy:"/copy",move:"/move",archive:"/archive",unarchive:"/unarchive",createFile:"/create-file",createFolder:"/create-folder",preview:"/preview",download:"/download",search:"/search",save:"/save"};constructor(e){super();const n={...Ug.DEFAULT_URLS,...e.url||{}};this.config={...e,baseURL:e.baseURL||"",url:n}}setBaseURL(e){this.config.baseURL=e||""}setToken(e){this.config.token=e}configureUploader(e,n){const i=this.getHeaders();delete i["Content-Type"],e.use(WI,{endpoint:`${this.config.baseURL}${this.config.url.upload}`,fieldName:"file",bundle:!1,headers:i,formData:!0}),e.on("upload",()=>{const o=n.getTargetPath();e.getFiles().forEach(r=>{e.setFileMeta(r.id,{path:o})})})}getHeaders(){const e={"Content-Type":"application/json",...this.config.headers};return this.config.token&&(e.Authorization=`Bearer ${this.config.token}`),e}async request(e,n={}){const i=`${this.config.baseURL}${e}`,o=await fetch(i,{...n,headers:{...this.getHeaders(),...n.headers}});if(!o.ok){const r=await o.text(),s=Ap(r,o.status,o.statusText);throw new Error(s)}return(o.headers.get("content-type")||"").includes("application/json")?await o.json():await o.text()}async list(e){const n=new URLSearchParams;e?.path&&n.append("path",e.path);const i=n.toString()?`${this.config.url.list}?${n.toString()}`:this.config.url.list;return await this.request(i,{method:"GET"})}async delete(e){return this.validateParam(e.items,"items"),this.validateParam(e.path,"path"),await this.request(this.config.url.delete,{method:"POST",body:JSON.stringify({path:e.path,items:e.items})})}async rename(e){return this.validateParam(e.path,"path"),this.validateParam(e.item,"item"),this.validateParam(e.name,"name"),this.validatePath(e.path),await this.request(this.config.url.rename,{method:"POST",body:JSON.stringify({path:e.path,item:e.item,name:e.name})})}async copy(e){return this.validateParam(e.sources,"sources"),this.validateParam(e.destination,"destination"),e.path&&this.validatePath(e.path),await this.request(this.config.url.copy,{method:"POST",body:JSON.stringify({sources:e.sources,destination:e.destination,path:e.path})})}async move(e){return this.validateParam(e.sources,"sources"),this.validateParam(e.destination,"destination"),e.path&&this.validatePath(e.path),await this.request(this.config.url.move,{method:"POST",body:JSON.stringify({sources:e.sources,destination:e.destination,path:e.path})})}async archive(e){return this.validateParam(e.items,"items"),this.validateParam(e.name,"name"),this.validateParam(e.path,"path"),await this.request(this.config.url.archive,{method:"POST",body:JSON.stringify({items:e.items,path:e.path,name:e.name})})}async unarchive(e){return this.validateParam(e.item,"item"),this.validateParam(e.path,"path"),await this.request(this.config.url.unarchive,{method:"POST",body:JSON.stringify({item:e.item,path:e.path})})}async createFile(e){return this.validateParam(e.name,"name"),this.validateParam(e.path,"path"),await this.request(this.config.url.createFile,{method:"POST",body:JSON.stringify({path:e.path,name:e.name})})}async createFolder(e){return this.validateParam(e.name,"name"),this.validateParam(e.path,"path"),await this.request(this.config.url.createFolder,{method:"POST",body:JSON.stringify({path:e.path,name:e.name})})}getPreviewUrl(e){this.validatePath(e.path);const n=new URLSearchParams({path:e.path});return`${this.config.baseURL}${this.config.url.preview}?${n.toString()}`}async getContent(e){this.validatePath(e.path);const n=new URLSearchParams({path:e.path}),i=`${this.config.baseURL}${this.config.url.preview}?${n.toString()}`,o=await fetch(i,{headers:this.getHeaders()});if(!o.ok){const r=await o.text(),s=Ap(r,o.status,o.statusText);throw new Error(s)}return{content:await o.text(),mimeType:o.headers.get("Content-Type")||void 0}}getDownloadUrl(e){this.validatePath(e.path);const n=new URLSearchParams({path:e.path});return`${this.config.baseURL}${this.config.url.download}?${n.toString()}`}async search(e){const n=this.config.url.search,i=new URLSearchParams;e.path&&i.set("path",e.path),e.filter&&i.set("filter",e.filter),e.deep&&i.set("deep","1"),e.size&&e.size!=="all"&&i.set("size",e.size);const o=i.toString()?`${n}?${i.toString()}`:n;return(await this.request(o,{method:"GET"})).files||[]}async save(e){return this.validateParam(e.path,"path"),await this.request(this.config.url.save,{method:"POST",body:JSON.stringify({path:e.path,content:e.content}),headers:this.getHeaders()})}}const Pp={list:t=>["adapter","list",t],search:(t,e,n,i)=>["adapter","search",t,e,n,i],delete:t=>["adapter","delete",t],rename:()=>["adapter","rename"],copy:()=>["adapter","copy"],move:()=>["adapter","move"],archive:()=>["adapter","archive"],unarchive:()=>["adapter","unarchive"],createFile:()=>["adapter","createFile"],createFolder:()=>["adapter","createFolder"]};class cM{driver;queryClient;config;onBeforeOpen;onAfterOpen;constructor(e,n={}){this.driver=e,this.onBeforeOpen=n.onBeforeOpen,this.onAfterOpen=n.onAfterOpen,this.queryClient=n.queryClient||new Gk({defaultOptions:{queries:{refetchOnWindowFocus:n.refetchOnWindowFocus??!1,staleTime:n.staleTime??300*1e3,retry:n.retry??2},mutations:{retry:n.retry??1}}}),this.config={queryClient:this.queryClient,refetchOnWindowFocus:n.refetchOnWindowFocus??!1,staleTime:n.staleTime??300*1e3,cacheTime:n.cacheTime??600*1e3,retry:n.retry??2,onBeforeOpen:this.onBeforeOpen??(()=>{}),onAfterOpen:this.onAfterOpen??(()=>{})}}getDriver(){return this.driver}getQueryClient(){return this.queryClient}async list(e){const n=Pp.list(e);return await this.queryClient.fetchQuery({queryKey:n,queryFn:()=>this.driver.list({path:e}),staleTime:this.config.staleTime})}async open(e){this.onBeforeOpen&&this.onBeforeOpen();const n=await this.list(e);return this.onAfterOpen&&this.onAfterOpen(n),n}async delete(e){const n=await this.driver.delete(e);return this.invalidateListQueries(),n}async rename(e){const n=await this.driver.rename(e);return this.invalidateListQueries(),n}async copy(e){const n=await this.driver.copy(e);return this.invalidateListQueries(),n}async move(e){const n=await this.driver.move(e);return this.invalidateListQueries(),n}async archive(e){const n=await this.driver.archive(e);return this.invalidateListQueries(),n}async unarchive(e){const n=await this.driver.unarchive(e);return this.invalidateListQueries(),n}async createFile(e){const n=await this.driver.createFile(e);return this.invalidateListQueries(),n}async createFolder(e){const n=await this.driver.createFolder(e);return this.invalidateListQueries(),n}async getContent(e){const n=["adapter","content",e.path];return await this.queryClient.fetchQuery({queryKey:n,queryFn:()=>this.driver.getContent(e),staleTime:this.config.staleTime})}getPreviewUrl(e){return this.driver.getPreviewUrl(e)}getDownloadUrl(e){return this.driver.getDownloadUrl(e)}async search(e){const n=Pp.search(e.path,e.filter,e.deep,e.size);return await this.queryClient.fetchQuery({queryKey:n,queryFn:()=>this.driver.search(e),staleTime:this.config.staleTime})}async save(e){const n=await this.driver.save(e);return this.invalidateListQueries(),n}invalidateListQueries(){this.queryClient.invalidateQueries({queryKey:["adapter"],exact:!1})}invalidateListQuery(e){this.queryClient.invalidateQueries({queryKey:["adapter","list",e],exact:!0})}clearCache(){this.queryClient.clear()}}function uM(t){const e=ke(t.state);return{current:te(()=>e.value.theme||"silver"),set:n=>{t.set("theme",n)}}}const dM=(t,e)=>{const n=GI(t.id??"vf"),i=g$(),o=e.i18n,r=t.locale??e.locale,s=rM(t.id??"vf",t.config??{}),a=aM();if(!t.driver)throw new Error("Driver is required for VueFinder");const l=new cM(t.driver);return Mt({version:eM,config:s,theme:(()=>{const c=uM(s);return{current:c.current,set:c.set}})(),fs:a,root:null,debug:t.debug??!1,emitter:i,storage:n,i18n:JI(n,r,i,o,s),modal:nM(s),adapter:Gn(l),features:Lg(t.features),selectionMode:t.selectionMode||"multiple",selectionFilterType:te(()=>t.selectionFilterType||"both"),selectionFilterMimeIncludes:te(()=>t.selectionFilterMimeIncludes||[]),treeViewData:[],filesize:s.get("metricUnits")?jg:uu,contextMenuItems:t.contextMenuItems,customUploader:t.customUploader})},hM=["data-theme"],pM={class:"vuefinder__modal-layout__container"},fM={class:"vuefinder__modal-layout__content"},mM={key:0,class:"vuefinder__modal-layout__footer"},vM={key:0,class:"vuefinder__modal-drag-overlay"},gM={class:"vuefinder__modal-drag-message"},nn=Se({__name:"ModalLayout",props:{showDragOverlay:{type:Boolean},dragOverlayText:{}},setup(t){const e=H(null),n=je();n.config;const i=t;et(()=>{const r=document.querySelector(".v-f-modal input");r&&r.focus(),Ge(()=>{if(document.querySelector(".v-f-modal input")&&window.innerWidth<768&&e.value){const s=e.value.getBoundingClientRect().bottom+16;window.scrollTo({top:s,left:0,behavior:"smooth"})}})});const o=r=>{r.target.classList.contains("vuefinder__modal-layout__wrapper")&&(r.preventDefault(),r.stopPropagation())};return(r,s)=>(y(),T("div",{"data-theme":m(n).theme.current,class:"vuefinder__themer vuefinder__modal-layout","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",tabindex:"0",onKeyup:s[1]||(s[1]=ho(a=>m(n).modal.close(),["esc"]))},[s[2]||(s[2]=g("div",{class:"vuefinder__modal-layout__overlay"},null,-1)),g("div",pM,[g("div",{class:"vuefinder__modal-layout__wrapper",onContextmenu:o,onMousedown:s[0]||(s[0]=Ye(a=>m(n).modal.close(),["self"]))},[g("div",{ref_key:"modalBody",ref:e,class:"vuefinder__modal-layout__body"},[g("div",fM,[Ve(r.$slots,"default")]),r.$slots.buttons?(y(),T("div",mM,[Ve(r.$slots,"buttons")])):ue("",!0)],512)],32)]),i.showDragOverlay?(y(),T("div",vM,[g("div",gM,L(i.dragOverlayText||"Drag and drop the files/folders to here."),1)])):ue("",!0)],40,hM))}}),_M={class:"vuefinder__modal-header"},yM={class:"vuefinder__modal-header__icon-container"},bM={id:"modal-title",class:"vuefinder__modal-header__title"},pn=Se({__name:"ModalHeader",props:{title:{},icon:{}},setup(t){return(e,n)=>(y(),T("div",_M,[g("div",yM,[(y(),ne(Ot(t.icon),{class:"vuefinder__modal-header__icon"}))]),g("div",bM,L(t.title),1)]))}}),wM={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.8",viewBox:"0 0 24 24"};function EM(t,e){return y(),T("svg",wM,[...e[0]||(e[0]=[g("circle",{cx:"12",cy:"12",r:"9"},null,-1),g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 8.2h.01M10.75 11.25H12v4.5m0 0h1.25m-1.25 0h-2"},null,-1)])])}const zg={render:EM},SM={class:"vuefinder__about-modal__content"},CM={class:"vuefinder__about-modal__main"},xM={class:"vuefinder__about-modal__tab-content"},TM={class:"vuefinder__about-modal__lead"},OM={class:"vuefinder__about-modal__description"},$M={class:"vuefinder__about-modal__links"},kM={href:"https://vuefinder.ozdemir.be",class:"vuefinder__about-modal__link-btn",target:"_blank",rel:"noopener noreferrer"},AM={class:"vuefinder__about-modal__meta"},PM={class:"vuefinder__about-modal__meta-item"},RM={class:"vuefinder__about-modal__meta-label"},IM={class:"vuefinder__about-modal__meta-value"},MM={class:"vuefinder__about-modal__meta-item"},DM={class:"vuefinder__about-modal__meta-label"},Vg=Se({__name:"ModalAbout",setup(t){const e=je(),{t:n}=e.i18n;return(i,o)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:o[0]||(o[0]=r=>m(e).modal.close())},L(m(n)("Close")),1)]),default:we(()=>[g("div",SM,[j(pn,{icon:m(zg),title:"Vuefinder "+m(e).version},null,8,["icon","title"]),g("div",CM,[g("div",xM,[g("div",TM,L(m(n)("A modern, customizable file manager component built for Vue.")),1),g("div",OM,L(m(n)("If you like it, please follow and ⭐ star on GitHub.")),1),g("div",$M,[g("a",kM,L(m(n)("Project Home")),1),o[1]||(o[1]=g("a",{href:"https://github.com/n1crack/vuefinder",class:"vuefinder__about-modal__link-btn",target:"_blank",rel:"noopener noreferrer"}," GitHub ",-1))]),g("div",AM,[g("div",PM,[g("span",RM,L(m(n)("Version")),1),g("span",IM,L(m(e).version),1)]),g("div",MM,[g("span",DM,L(m(n)("License")),1),o[2]||(o[2]=g("span",{class:"vuefinder__about-modal__meta-value"},"MIT",-1))])])])])])]),_:1}))}}),FM={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",viewBox:"0 0 24 24"};function LM(t,e){return y(),T("svg",FM,[...e[0]||(e[0]=[g("path",{d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21q.512.078 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48 48 0 0 0-3.478-.397m-12 .562q.51-.089 1.022-.165m0 0a48 48 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a52 52 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a49 49 0 0 0-7.5 0"},null,-1)])])}const Bg={render:LM},jM={class:"vuefinder__delete-modal__content"},NM={class:"vuefinder__delete-modal__form"},UM={class:"vuefinder__delete-modal__description"},zM={class:"vuefinder__delete-modal__files vf-scrollbar"},VM={key:0,class:"vuefinder__delete-modal__icon vuefinder__delete-modal__icon--dir",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},BM={key:1,class:"vuefinder__delete-modal__icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},HM={class:"vuefinder__delete-modal__file-name"},qM={class:"vuefinder__delete-modal__confirmation"},WM={class:"vuefinder__delete-modal__confirmation-label"},KM={class:"vuefinder__delete-modal__confirmation-text"},YM=["disabled"],Gs=Se({__name:"ModalDelete",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=ke(o.path),s=H(e.modal.data.items),a=H(!1),l=()=>{s.value.length&&a.value&&e.adapter.delete({path:r.value.path,items:s.value.map(({path:c,type:u})=>({path:c,type:u}))}).then(c=>{n.success(i("Files deleted.")),e.fs.setFiles(c.files),e.modal.close()}).catch(c=>{n.error(Yt(c,i("Failed to delete files")))})};return(c,u)=>(y(),ne(nn,null,{buttons:we(()=>[g("div",qM,[g("label",WM,[it(g("input",{"onUpdate:modelValue":u[0]||(u[0]=d=>a.value=d),type:"checkbox",class:"vuefinder__delete-modal__checkbox"},null,512),[[Es,a.value]]),g("span",KM,L(m(i)("I'm sure delete it, This action cannot be undone.")),1)])]),g("button",{type:"button",class:"vf-btn vf-btn-danger",disabled:!a.value,onClick:l},L(m(i)("Yes, Delete!")),9,YM),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:u[1]||(u[1]=d=>m(e).modal.close())},L(m(i)("Cancel")),1)]),default:we(()=>[g("div",null,[j(pn,{icon:m(Bg),title:m(i)("Delete files")},null,8,["icon","title"]),g("div",jM,[g("div",NM,[g("p",UM,L(m(i)("Are you sure you want to delete these files?")),1),g("div",zM,[(y(!0),T(Ie,null,He(s.value,d=>(y(),T("p",{key:d.path,class:"vuefinder__delete-modal__file"},[d.type==="dir"?(y(),T("svg",VM,[...u[2]||(u[2]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])])):(y(),T("svg",BM,[...u[3]||(u[3]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)])])),g("span",HM,L(d.basename),1)]))),128))])])])])]),_:1}))}}),GM={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",viewBox:"0 0 24 24"};function QM(t,e){return y(),T("svg",GM,[...e[0]||(e[0]=[g("path",{d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"},null,-1)])])}const Hg={render:QM},XM={class:"vuefinder__rename-modal__content"},JM={class:"vuefinder__rename-modal__item"},ZM={class:"vuefinder__rename-modal__item-info"},eD={key:0,class:"vuefinder__rename-modal__icon vuefinder__rename-modal__icon--dir",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},tD={key:1,class:"vuefinder__rename-modal__icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},nD={class:"vuefinder__rename-modal__item-name"},Qs=Se({__name:"ModalRename",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=ke(o.path),s=H(e.modal.data.items[0]),a=H(s.value.basename),l=()=>{a.value!=s.value.basename&&e.adapter.rename({path:r.value.path,item:s.value.path,name:a.value}).then(c=>{n.success(i("%s is renamed.",a.value)),e.fs.setFiles(c.files),e.modal.close()}).catch(c=>{n.error(Yt(c,i("Failed to rename")))})};return(c,u)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:l},L(m(i)("Rename")),1),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:u[1]||(u[1]=d=>m(e).modal.close())},L(m(i)("Cancel")),1)]),default:we(()=>[g("div",null,[j(pn,{icon:m(Hg),title:m(i)("Rename")},null,8,["icon","title"]),g("div",XM,[g("div",JM,[g("p",ZM,[s.value.type==="dir"?(y(),T("svg",eD,[...u[2]||(u[2]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])])):(y(),T("svg",tD,[...u[3]||(u[3]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)])])),g("span",nD,L(s.value.basename),1)]),it(g("input",{"onUpdate:modelValue":u[0]||(u[0]=d=>a.value=d),class:"vuefinder__rename-modal__input",placeholder:"Name",type:"text",onKeyup:ho(l,["enter"])},null,544),[[Go,a.value]])])])])]),_:1}))}});function Tn(){const t=je(),e=te(()=>t.features);return{enabled:n=>e.value[n]??!1}}const iD={class:"vuefinder__text-preview"},oD={class:"vuefinder__text-preview__header"},rD=["title"],sD={class:"vuefinder__text-preview__actions"},aD={key:0,class:"vuefinder__text-preview__content"},lD={key:1},cD=Se({__name:"Text",emits:["success"],setup(t,{emit:e}){const n=e,i=H(""),o=H(""),r=H(null),s=H(!1),a=je(),l=Gt(a),{enabled:c}=Tn(),{t:u}=a.i18n;et(async()=>{try{const v=await a.adapter.getContent({path:a.modal.data.item.path});i.value=v.content,n("success")}catch(v){Yt(v,"Failed to load text content"),n("success")}});const d=()=>{s.value=!s.value,o.value=i.value,a.modal.setEditMode(s.value)},h=async()=>{try{const v=a.modal.data.item.path;await a.adapter.save({path:v,content:o.value}),i.value=o.value,l.success(u("Updated.")),n("success"),s.value=!s.value}catch(v){l.error(Yt(v,u("Failed to save file")))}};return(v,f)=>(y(),T("div",iD,[g("div",oD,[g("div",{id:"modal-title",class:"vuefinder__text-preview__title",title:m(a).modal.data.item.path},L(m(a).modal.data.item.basename),9,rD),g("div",sD,[s.value?(y(),T("button",{key:0,class:"vuefinder__text-preview__save-button",onClick:h},L(m(u)("Save")),1)):ue("",!0),m(c)("edit")?(y(),T("button",{key:1,class:"vuefinder__text-preview__edit-button",onClick:f[0]||(f[0]=p=>d())},L(s.value?m(u)("Cancel"):m(u)("Edit")),1)):ue("",!0)])]),g("div",null,[s.value?(y(),T("div",lD,[it(g("textarea",{ref_key:"editInput",ref:r,"onUpdate:modelValue":f[1]||(f[1]=p=>o.value=p),class:"vuefinder__text-preview__textarea",name:"text",cols:"30",rows:"10"},null,512),[[Go,o.value]])])):(y(),T("pre",aD,L(i.value),1))])]))}}),du=async(t,e)=>{if(e){if(e.isFile){const n=await new Promise(i=>{e.file(i)});t(e,n)}if(e.isDirectory){const n=e.createReader(),i=await new Promise(o=>{n.readEntries(o)});for(const o of i)await du(t,o)}}},vt={PENDING:0,CANCELED:1,UPLOADING:2,ERROR:3,DONE:10};function qg(t){const e=je(),{t:n}=e.i18n,i=e.fs,o=ke(i.path),r=e.config,s=H({QUEUE_ENTRY_STATUS:vt}),a=H(null),l=H(null),c=H(null),u=H(null),d=H(null),h=H([]),v=H(""),f=H(!1),p=H(!1),_=H(null);let S;const w=Y=>{Y.preventDefault(),Y.stopPropagation(),p.value=!0},E=Y=>{Y.preventDefault(),Y.stopPropagation(),p.value=!0},b=Y=>{Y.preventDefault(),Y.stopPropagation(),(!Y.relatedTarget||Y.relatedTarget===document.body)&&(p.value=!1)},C=Y=>{Y.preventDefault(),Y.stopPropagation(),p.value=!1;const I=/^[/\\](.+)/,A=Y.dataTransfer;A&&(A.items&&A.items.length?Array.from(A.items).forEach(Q=>{if(Q.kind==="file"){const z=Q.webkitGetAsEntry?.();if(z)du((ie,ve)=>{const re=I.exec(ie?.fullPath||"");k(ve,re?re[1]:ve.name)},z);else{const ie=Q.getAsFile?.();ie&&k(ie)}}}):A.files&&A.files.length&&Array.from(A.files).forEach(Q=>k(Q)))},x=Y=>h.value.findIndex(I=>I.id===Y),k=(Y,I)=>S.addFile({name:I||Y.name,type:Y.type,data:Y,source:"Local"}),O=Y=>Y.status===vt.DONE?"text-green-600":Y.status===vt.ERROR||Y.status===vt.CANCELED?"text-red-600":"",K=Y=>Y.status===vt.DONE?"✓":Y.status===vt.ERROR||Y.status===vt.CANCELED?"!":"...",D=()=>u.value?.click(),P=()=>e.modal.close(),U=Y=>{if(f.value||!h.value.filter(I=>I.status!==vt.DONE).length){f.value||(v.value=n("Please select file to upload first."));return}v.value="",_.value=Y||o.value,S.upload()},M=()=>{S.cancelAll(),h.value.forEach(Y=>{Y.status!==vt.DONE&&(Y.status=vt.CANCELED,Y.statusName=n("Canceled"))}),f.value=!1},q=Y=>{f.value||(S.removeFile(Y.id),h.value.splice(x(Y.id),1))},le=Y=>{if(!f.value)if(S.cancelAll(),Y){const I=h.value.filter(A=>A.status!==vt.DONE);h.value=[],I.forEach(A=>k(A.originalFile,A.name))}else h.value=[]},de=Y=>{Y.forEach(I=>{k(I)})};return et(()=>{S=new kc({debug:e.debug,restrictions:{maxFileSize:tM(r.get("maxFileSize")??"10mb")},locale:e.i18n.t("uppy"),onBeforeFileAdded:(Q,z)=>{if(z[Q.id]!=null){const ie=x(Q.id);h.value[ie]?.status===vt.PENDING&&(v.value=S.i18n("noDuplicates",{fileName:Q.name})),h.value=h.value.filter(ve=>ve.id!==Q.id)}return h.value.push({id:Q.id,name:Q.name,size:e.filesize(Q.size),status:vt.PENDING,statusName:n("Pending upload"),percent:null,originalFile:Q.data}),!0}});const Y={getTargetPath:()=>(_.value||o.value).path};if(t)t(S,Y);else if(e.adapter.getDriver().configureUploader)e.adapter.getDriver().configureUploader(S,Y);else throw new Error("No uploader configured");S.on("restriction-failed",(Q,z)=>{const ie=h.value[x(Q.id)];ie&&q(ie),v.value=z.message}),S.on("upload-start",Q=>{Q.forEach(z=>{const ie=h.value[x(z.id)];ie&&(ie.status=vt.UPLOADING,ie.statusName=n("Uploading"),ie.percent="0%")})}),S.on("upload-progress",(Q,z)=>{const ie=z.bytesTotal??1,ve=Math.floor(z.bytesUploaded/ie*100),re=x(Q.id);re!==-1&&h.value[re]&&(h.value[re].percent=`${ve}%`)}),S.on("upload-success",Q=>{const z=h.value[x(Q.id)];z&&(z.status=vt.DONE,z.statusName=n("Done"))}),S.on("upload-error",(Q,z)=>{const ie=h.value[x(Q.id)];ie&&(ie.percent=null,ie.status=vt.ERROR,ie.statusName=z?.isNetworkError?n("Network Error, Unable establish connection to the server or interrupted."):z?.message||n("Unknown Error"))}),S.on("error",Q=>{v.value=Q.message,f.value=!1}),S.on("complete",Q=>{f.value=!1;const z=_.value||o.value;e.adapter.invalidateListQuery(z.path),e.adapter.open(z.path);const ie=h.value.filter(ve=>ve.status===vt.DONE&&Q.successful.includes(ve.id)).map(ve=>ve.name);e.emitter.emit("vf-upload-complete",ie)}),u.value?.addEventListener("click",()=>l.value?.click()),d.value?.addEventListener("click",()=>c.value?.click());const I={capture:!0};document.addEventListener("dragover",w,I),document.addEventListener("dragenter",E,I),document.addEventListener("dragleave",b,I),document.addEventListener("drop",C,I);const A=Q=>{const z=Q.target,ie=z.files;if(ie){for(const ve of ie)k(ve);z.value=""}};l.value?.addEventListener("change",A),c.value?.addEventListener("change",A)}),St(()=>{const Y={capture:!0};document.removeEventListener("dragover",w,Y),document.removeEventListener("dragenter",E,Y),document.removeEventListener("dragleave",b,Y),document.removeEventListener("drop",C,Y)}),{container:a,internalFileInput:l,internalFolderInput:c,pickFiles:u,pickFolders:d,queue:h,message:v,uploading:f,hasFilesInDropArea:p,definitions:s,openFileSelector:D,upload:U,cancel:M,remove:q,clear:le,close:P,getClassNameForEntry:O,getIconForEntry:K,addExternalFiles:de}}const uD={class:"vuefinder__image-preview"},dD={class:"vuefinder__image-preview__header"},hD=["title"],pD={class:"vuefinder__image-preview__actions"},fD={class:"vuefinder__image-preview__image-container"},mD=["src"],vD=Se({name:"ImagePreview",__name:"Image",emits:["success"],setup(t,{emit:e}){const n=e,i=je(),o=Gt(i),{enabled:r}=Tn(),{t:s}=i.i18n,a=H(!1),l=H(i.modal.data.item.previewUrl??i.adapter.getPreviewUrl({path:i.modal.data.item.path})),c=H(l.value),{addExternalFiles:u,upload:d,queue:h}=qg(i.customUploader),v=i.fs,f=ke(v.path),p=In("cropperRef"),_=async()=>{a.value=!a.value,i.modal.setEditMode(a.value)},S=async()=>{const w=p.value?.getResult({size:{width:795,height:341},fillColor:"#ffffff"})?.canvas;if(!w)return;let E=w;if(w.width>1200||w.height>1200){const O=Math.min(1200/w.width,1200/w.height),K=document.createElement("canvas");K.width=Math.floor(w.width*O),K.height=Math.floor(w.height*O);const D=K.getContext("2d");D&&(D.drawImage(w,0,0,K.width,K.height),E=K)}const b=i.modal.data.item.basename,C=b.split(".").pop()?.toLowerCase()||"jpg",x=C==="png"?"image/png":C==="gif"?"image/gif":"image/jpeg",k=await new Promise(O=>{E.toBlob(K=>O(K),x)});if(!k){o.error(s("Failed to save image"));return}try{const O=new File([k],b,{type:x}),K=i.modal.data.item.path.split("/");K.pop();const D={path:K.join("/")||(f.value?.path??"")};u([O]),await new Promise(q=>setTimeout(q,100));const P=h.value.find(q=>q.name===O.name);if(!P)throw new Error("File was not added to upload queue");d(D);let U=0;for(;U<150;){await new Promise(le=>setTimeout(le,200));const q=h.value.find(le=>le.id===P.id);if(q?.status===vt.DONE)break;if(q?.status===vt.ERROR)throw new Error(q.statusName||"Upload failed");U++}o.success(s("Updated.")),await fetch(l.value,{cache:"reload",mode:"no-cors"});const M=i.root?.querySelector?.('[data-src="'+l.value+'"]');M&&M instanceof HTMLElement&&Hi.resetStatus(M),i.emitter.emit("vf-refresh-thumbnails"),await _(),n("success")}catch(O){o.error(Yt(O,s("Failed to save image")))}};return et(()=>{n("success")}),(w,E)=>(y(),T("div",uD,[g("div",dD,[g("h3",{id:"modal-title",class:"vuefinder__image-preview__title",title:m(i).modal.data.item.path},L(m(i).modal.data.item.basename),9,hD),g("div",pD,[a.value?(y(),T("button",{key:0,class:"vuefinder__image-preview__crop-button",onClick:S},L(m(s)("Crop")),1)):ue("",!0),m(r)("edit")?(y(),T("button",{key:1,class:"vuefinder__image-preview__edit-button",onClick:E[0]||(E[0]=b=>_())},L(a.value?m(s)("Cancel"):m(s)("Edit")),1)):ue("",!0)])]),g("div",fD,[a.value?(y(),ne(m(bv),{key:1,ref_key:"cropperRef",ref:p,class:"h-full w-full",crossorigin:"anonymous",src:c.value,"auto-zoom":!0,priority:"image",transitions:!0},null,8,["src"])):(y(),T("img",{key:0,style:{},src:m(i).modal.data.item.previewUrl??m(i).adapter.getPreviewUrl({path:m(i).modal.data.item.path}),class:"vuefinder__image-preview__image h-full w-full"},null,8,mD))])]))}}),gD={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function _D(t,e){return y(),T("svg",gD,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 0 0 2-2V9.414a1 1 0 0 0-.293-.707l-5.414-5.414A1 1 0 0 0 12.586 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2"},null,-1)])])}const qo={render:_D},yD={class:"vuefinder__default-preview"},bD={class:"vuefinder__default-preview__content"},wD={class:"vuefinder__default-preview__header"},ED=["title"],SD={class:"vuefinder__default-preview__icon-container"},CD=["title"],xD=Se({__name:"Default",emits:["success"],setup(t,{emit:e}){const n=je(),i=e;return et(()=>{i("success")}),(o,r)=>(y(),T("div",yD,[g("div",bD,[g("div",wD,[g("h3",{id:"modal-title",class:"vuefinder__default-preview__title",title:m(n).modal.data.item.path},L(m(n).modal.data.item.basename),9,ED)]),g("div",SD,[j(m(qo),{class:"vuefinder__default-preview__file-icon"}),g("div",{id:"modal-title",class:"vuefinder__default-preview__file-name",title:m(n).modal.data.item.path},L(m(n).modal.data.item.basename),9,CD)])])]))}}),TD={class:"vuefinder__video-preview"},OD=["title"],$D={class:"vuefinder__video-preview__video",preload:"metadata",controls:""},kD=["src"],AD=Se({__name:"Video",emits:["success"],setup(t,{emit:e}){const n=je(),i=e,o=()=>n.adapter.getPreviewUrl({path:n.modal.data.item.path});return et(()=>{i("success")}),(r,s)=>(y(),T("div",TD,[g("h3",{id:"modal-title",class:"vuefinder__video-preview__title",title:m(n).modal.data.item.path},L(m(n).modal.data.item.basename),9,OD),g("div",null,[g("video",$D,[g("source",{src:o(),type:"video/mp4"},null,8,kD),s[0]||(s[0]=Ke(" Your browser does not support the video tag. ",-1))])])]))}}),PD={class:"vuefinder__audio-preview"},RD=["title"],ID={class:"vuefinder__audio-preview__audio",controls:""},MD=["src"],DD=Se({__name:"Audio",emits:["success"],setup(t,{emit:e}){const n=e,i=je(),o=()=>{const r=je();return r.adapter.getPreviewUrl({path:r.modal.data.item.path})};return et(()=>{n("success")}),(r,s)=>(y(),T("div",PD,[g("h3",{id:"modal-title",class:"vuefinder__audio-preview__title",title:m(i).modal.data.item.path},L(m(i).modal.data.item.basename),9,RD),g("div",null,[g("audio",ID,[g("source",{src:o(),type:"audio/mpeg"},null,8,MD),s[0]||(s[0]=Ke(" Your browser does not support the audio element. ",-1))])])]))}}),FD={class:"vuefinder__pdf-preview"},LD=["title"],jD=["data"],ND=["src"],UD=Se({__name:"Pdf",emits:["success"],setup(t,{emit:e}){const n=je(),i=e,o=()=>{const r=je();return r.adapter.getPreviewUrl({path:r.modal.data.item.path})};return et(()=>{i("success")}),(r,s)=>(y(),T("div",FD,[g("h3",{id:"modal-title",class:"vuefinder__pdf-preview__title",title:m(n).modal.data.item.path},L(m(n).modal.data.item.basename),9,LD),g("div",null,[g("object",{class:"vuefinder__pdf-preview__object",data:o(),type:"application/pdf",width:"100%",height:"100%"},[g("iframe",{class:"vuefinder__pdf-preview__iframe",src:o(),width:"100%",height:"100%"}," Your browser does not support PDFs ",8,ND)],8,jD)])]))}});function zD(t,e=null){return new Date(t*1e3).toLocaleString(e??navigator.language??"en-US")}const VD={key:0,class:"vuefinder__preview-modal__nav-overlay"},BD=["disabled","title"],HD=["disabled","title"],qD={class:"vuefinder__preview-modal__content"},WD={key:0},KD={class:"vuefinder__preview-modal__loading"},YD={key:0,class:"vuefinder__preview-modal__loading-indicator"},GD={class:"vuefinder__preview-modal__details"},QD={class:"font-bold"},XD={class:"pl-2 font-bold"},JD={key:0,class:"vuefinder__preview-modal__note"},ZD=["download","href"],lr=Se({__name:"ModalPreview",setup(t){const e=je(),{enabled:n}=Tn(),{t:i}=e.i18n,o=H(!1),r=w=>{const E=(w||"").split("/").pop()||"",b=E.lastIndexOf(".");return b>=0?E.slice(b+1).toLowerCase():""},s=(w,E)=>E?w==="image"?new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif"]).has(E):w==="video"?new Set(["mp4","webm","ogg","ogv","mov","m4v"]).has(E):w==="audio"?new Set(["mp3","wav","ogg","oga","m4a","flac","aac"]).has(E):w==="text"?new Set(["txt","md","json","js","ts","css","scss","html","xml","csv","log","yml","yaml"]).has(E):w==="application/pdf"?E==="pdf":!1:!1,a=w=>{const E=e.modal.data.item.mime_type;if(E&&typeof E=="string")return E.startsWith(w);const b=r(e.modal.data.item.path);return s(w,b)},l=n("preview");l||(o.value=!0);const c=te(()=>e.modal.data.item),u=ke(e.fs.sortedFiles),d=te(()=>u.value.filter(w=>w.type==="file")),h=te(()=>d.value.findIndex(w=>w.path===c.value.path)),v=te(()=>h.value>0),f=te(()=>h.value<d.value.length-1),p=()=>{if(e.modal.editMode||!v.value)return;const w=d.value[h.value-1];w&&(e.fs.clearSelection(),e.fs.select(w.path),e.modal.data.item=w)},_=()=>{if(e.modal.editMode||!f.value)return;const w=d.value[h.value+1];w&&(e.fs.clearSelection(),e.fs.select(w.path),e.modal.data.item=w)},S=w=>{if(w.key==="Escape"){w.preventDefault(),w.stopPropagation(),e.modal.close();return}(w.key==="ArrowLeft"||w.key==="ArrowRight")&&(w.preventDefault(),w.stopPropagation(),w.key==="ArrowLeft"?p():_())};return et(()=>{const w=document.querySelector(".vuefinder__preview-modal");w&&w.focus()}),(w,E)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:E[6]||(E[6]=b=>m(e).modal.close())},L(m(i)("Close")),1),m(n)("download")?(y(),T("a",{key:0,target:"_blank",class:"vf-btn vf-btn-primary",download:m(e).adapter.getDownloadUrl(m(e).modal.data.item),href:m(e).adapter.getDownloadUrl(m(e).modal.data.item)},L(m(i)("Download")),9,ZD)):ue("",!0)]),default:we(()=>[g("div",{class:"vuefinder__preview-modal",tabindex:"0",onKeydown:S},[m(e).modal.editMode?ue("",!0):(y(),T("div",VD,[g("button",{disabled:!v.value,class:"vuefinder__preview-modal__nav-side vuefinder__preview-modal__nav-side--left",title:m(i)("Previous file"),onClick:p},[...E[7]||(E[7]=[g("svg",{class:"vuefinder__preview-modal__nav-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[g("polyline",{points:"15,18 9,12 15,6"})],-1)])],8,BD),g("button",{disabled:!f.value,class:"vuefinder__preview-modal__nav-side vuefinder__preview-modal__nav-side--right",title:m(i)("Next file"),onClick:_},[...E[8]||(E[8]=[g("svg",{class:"vuefinder__preview-modal__nav-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[g("polyline",{points:"9,18 15,12 9,6"})],-1)])],8,HD)])),g("div",qD,[m(l)?(y(),T("div",WD,[a("text")?(y(),ne(cD,{key:`text-${c.value.path}`,onSuccess:E[0]||(E[0]=b=>o.value=!0)})):a("image")?(y(),ne(vD,{key:`image-${c.value.path}`,onSuccess:E[1]||(E[1]=b=>o.value=!0)})):a("video")?(y(),ne(AD,{key:`video-${c.value.path}`,onSuccess:E[2]||(E[2]=b=>o.value=!0)})):a("audio")?(y(),ne(DD,{key:`audio-${c.value.path}`,onSuccess:E[3]||(E[3]=b=>o.value=!0)})):a("application/pdf")?(y(),ne(UD,{key:`pdf-${c.value.path}`,onSuccess:E[4]||(E[4]=b=>o.value=!0)})):(y(),ne(xD,{key:`default-${c.value.path}`,onSuccess:E[5]||(E[5]=b=>o.value=!0)}))])):ue("",!0),g("div",KD,[o.value===!1?(y(),T("div",YD,[E[9]||(E[9]=g("svg",{class:"vuefinder__preview-modal__spinner",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[g("circle",{class:"vuefinder__preview-modal__spinner-circle",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),g("path",{class:"vuefinder__preview-modal__spinner-path",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)),g("span",null,L(m(i)("Loading")),1)])):ue("",!0)])])],32),g("div",GD,[g("div",null,[g("span",QD,L(m(i)("File Size"))+": ",1),Ke(L(m(e).filesize(m(e).modal.data.item.file_size)),1)]),g("div",null,[g("span",XD,L(m(i)("Last Modified"))+": ",1),Ke(" "+L(m(zD)(m(e).modal.data.item.last_modified)),1)])]),m(n)("download")?(y(),T("div",JD,[g("span",null,L(m(i)(`Download doesn't work? You can try right-click "Download" button, select "Save link as...".`)),1)])):ue("",!0)]),_:1}))}}),eF={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"};function tF(t,e){return y(),T("svg",eF,[...e[0]||(e[0]=[g("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M13 19H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v4M16 22l5-5M21 21.5V17h-4.5"},null,-1)])])}const nF={render:tF},iF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function oF(t,e){return y(),T("svg",iF,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M8 16H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v2m-6 12h8a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2"},null,-1)])])}const hu={render:oF},rF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function sF(t,e){return y(),T("svg",rF,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-6l-2-2H5a2 2 0 0 0-2 2"},null,-1)])])}const Nn={render:sF},aF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"};function lF(t,e){return y(),T("svg",aF,[...e[0]||(e[0]=[g("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M12 5v14M5 12h14"},null,-1)])])}const Xs={render:lF},cF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"};function uF(t,e){return y(),T("svg",cF,[...e[0]||(e[0]=[g("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M5 12h14"},null,-1)])])}const Js={render:uF},dF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",class:"h-5 w-5",viewBox:"0 0 24 24"};function hF(t,e){return y(),T("svg",dF,[...e[0]||(e[0]=[g("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"m15 4.5-4 4L7 10l-1.5 1.5 7 7L14 17l1.5-4 4-4M9 15l-4.5 4.5M14.5 4 20 9.5"},null,-1)])])}const pu={render:hF},pF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function fF(t,e){return y(),T("svg",pF,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"},null,-1)])])}const fu={render:fF},mF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24"};function vF(t,e){return y(),T("svg",mF,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 9.776q.168-.026.344-.026h15.812q.176 0 .344.026m-16.5 0a2.25 2.25 0 0 0-1.883 2.542l.857 6a2.25 2.25 0 0 0 2.227 1.932H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-1.883-2.542m-16.5 0V6A2.25 2.25 0 0 1 6 3.75h3.879a1.5 1.5 0 0 1 1.06.44l2.122 2.12a1.5 1.5 0 0 0 1.06.44H18A2.25 2.25 0 0 1 20.25 9v.776"},null,-1)])])}const mu={render:vF},gF={class:"vuefinder__modal-tree__folder-item"},_F={class:"vuefinder__modal-tree__folder-content"},yF={key:1,class:"vuefinder__modal-tree__folder-spacer"},bF={class:"vuefinder__modal-tree__folder-text"},wF={key:0,class:"vuefinder__modal-tree__subfolders"},EF={key:0,class:"vuefinder__modal-tree__more-note"},SF=300,CF=Se({__name:"ModalTreeFolderItem",props:{folder:{},storage:{},modelValue:{},expandedFolders:{},modalTreeData:{},currentPath:{}},emits:["update:modelValue","selectAndClose","toggleFolder"],setup(t,{emit:e}){const n=je(),{t:i}=n.i18n,o=n.fs,r=H({}),s=t,a=e;ke(o.path);const l=te(()=>{const k=`${s.storage}:${s.folder.path}`;return s.expandedFolders[k]||!1}),c=te(()=>s.modelValue?.path===s.folder.path),u=te(()=>s.currentPath?.path===s.folder.path),d=te(()=>s.modalTreeData[s.folder.path]||[]),h=te(()=>{const k=d.value,O=r.value[s.folder.path]||50;return k.length>O?k.slice(0,O):k}),v=te(()=>d.value.length),f=te(()=>r.value[s.folder.path]||50),p=te(()=>v.value>f.value),_=()=>{r.value[s.folder.path]=(f.value||50)+50},S=te(()=>d.value.length>0||s.folder.type==="dir"),w=()=>{a("toggleFolder",s.storage,s.folder.path)},E=()=>{a("update:modelValue",s.folder)},b=()=>{a("update:modelValue",s.folder),a("selectAndClose",s.folder)};let C=0;const x=()=>{const k=Date.now();k-C<SF?b():E(),C=k};return(k,O)=>{const K=ze("ModalTreeFolderItem",!0);return y(),T("div",gF,[g("div",_F,[S.value?(y(),T("div",{key:0,class:"vuefinder__modal-tree__folder-toggle",onClick:w},[l.value?(y(),ne(m(Js),{key:1,class:"vuefinder__modal-tree__folder-toggle-icon"})):(y(),ne(m(Xs),{key:0,class:"vuefinder__modal-tree__folder-toggle-icon"}))])):(y(),T("div",yF)),g("div",{class:Ae(["vuefinder__modal-tree__folder-link",{"vuefinder__modal-tree__folder-link--selected":c.value,"vuefinder__modal-tree__folder-link--current":u.value}]),onClick:E,onDblclick:b,onTouchend:x},[l.value?(y(),ne(m(mu),{key:1,class:"vuefinder__item-icon__folder--open vuefinder__modal-tree__folder-icon"})):(y(),ne(m(Nn),{key:0,class:"vuefinder__modal-tree__folder-icon vuefinder__item-icon__folder"})),g("span",bF,L(t.folder.basename),1)],34)]),l.value&&S.value?(y(),T("div",wF,[(y(!0),T(Ie,null,He(h.value,D=>(y(),ne(K,{key:D.path,folder:D,storage:t.storage,"model-value":t.modelValue,"expanded-folders":t.expandedFolders,"modal-tree-data":t.modalTreeData,"current-path":t.currentPath,"onUpdate:modelValue":O[0]||(O[0]=P=>k.$emit("update:modelValue",P)),onSelectAndClose:O[1]||(O[1]=P=>k.$emit("selectAndClose",P)),onToggleFolder:O[2]||(O[2]=(P,U)=>k.$emit("toggleFolder",P,U))},null,8,["folder","storage","model-value","expanded-folders","modal-tree-data","current-path"]))),128)),p.value?(y(),T("div",EF,[g("div",{class:"vuefinder__modal-tree__load-more",onClick:_},L(m(i)("load more")),1)])):ue("",!0)])):ue("",!0)])}}}),xF={class:"vuefinder__modal-tree"},TF={class:"vuefinder__modal-tree__header"},OF={class:"vuefinder__modal-tree__title"},$F={key:0,class:"vuefinder__modal-tree__section"},kF={class:"vuefinder__modal-tree__section-title"},AF={class:"vuefinder__modal-tree__list"},PF=["onClick","onDblclick","onTouchend"],RF={class:"vuefinder__modal-tree__text"},IF={class:"vuefinder__modal-tree__text-storage"},MF={class:"vuefinder__modal-tree__section-title"},DF={class:"vuefinder__modal-tree__list"},FF={class:"vuefinder__modal-tree__storage-item"},LF={class:"vuefinder__modal-tree__storage-content"},jF=["onClick"],NF=["onClick","onDblclick","onTouchend"],UF={class:"vuefinder__modal-tree__storage-text"},zF={key:0,class:"vuefinder__modal-tree__subfolders"},VF={key:0,class:"vuefinder__modal-tree__more-note"},BF=["onClick"],Rp=300,vu=Se({__name:"ModalTreeSelector",props:{modelValue:{},showPinnedFolders:{type:Boolean},currentPath:{}},emits:["update:modelValue","selectAndClose"],setup(t,{emit:e}){const n=je(),{t:i}=n.i18n,o=n.fs,r=n.config,s=e,a=ke(o.sortedFiles),l=ke(o.storages),c=te(()=>l.value||[]),u=ke(o.path),d=H(null),h=H({}),v=H({}),f=H({});Oe(a,M=>{const q=M.filter(de=>de.type==="dir"),le=u.value?.path||"";le&&(v.value[le]=q.map(de=>({...de,type:"dir"})))});const p=(M,q)=>{const le=`${M}:${q}`;h.value={...h.value,[le]:!h.value[le]},h.value[le]&&!v.value[q]&&n.adapter.list(q).then(de=>{const Y=(de.files||[]).filter(I=>I.type==="dir");v.value[q]=Y.map(I=>({...I,type:"dir"}))})},_=M=>v.value[M]||[],S=M=>f.value[M]||50,w=M=>{const q=_(M),le=S(M);return q.length>le?q.slice(0,le):q},E=M=>_(M).length,b=M=>E(M)>S(M),C=M=>{f.value[M]=S(M)+50},x=M=>{M&&s("update:modelValue",M)},k=M=>{M&&(s("update:modelValue",M),s("selectAndClose",M))},O=M=>{const q={storage:M,path:M+"://",basename:M,type:"dir",extension:"",file_size:null,last_modified:null,mime_type:null,visibility:"public",dir:M+"://"};s("update:modelValue",q)},K=M=>{const q={storage:M,path:M+"://",basename:M,type:"dir",extension:"",file_size:null,last_modified:null,mime_type:null,visibility:"public",dir:M+"://"};s("update:modelValue",q),s("selectAndClose",q)};let D=0;const P=M=>{if(!M)return;const q=Date.now();q-D<Rp?k(M):x(M),D=q},U=M=>{const q=Date.now();q-D<Rp?K(M):O(M),D=q};return et(()=>{d.value&&hn(d.value,{overflow:{x:"hidden"},scrollbars:{theme:"vf-scrollbars-theme"}})}),(M,q)=>(y(),T("div",xF,[g("div",TF,[g("div",OF,L(m(i)("Select Target Folder")),1)]),g("div",{ref_key:"modalContentElement",ref:d,class:"vuefinder__modal-tree__content"},[t.showPinnedFolders&&m(n).features.pinned&&m(r).get("pinnedFolders").length?(y(),T("div",$F,[g("div",kF,L(m(i)("Pinned Folders")),1),g("div",AF,[(y(!0),T(Ie,null,He(m(r).get("pinnedFolders"),le=>(y(),T("div",{key:le.path,class:Ae(["vuefinder__modal-tree__item",{"vuefinder__modal-tree__item--selected":t.modelValue?.path===le.path}]),onClick:de=>x(le),onDblclick:de=>k(le),onTouchend:de=>P(le)},[j(m(Nn),{class:"vuefinder__modal-tree__icon vuefinder__item-icon__folder"}),g("div",RF,L(le.basename),1),g("div",IF,L(le.storage),1),j(m(pu),{class:"vuefinder__modal-tree__icon vuefinder__modal-tree__icon--pin"})],42,PF))),128))])])):ue("",!0),g("div",MF,L(m(i)("Storages")),1),(y(!0),T(Ie,null,He(c.value,le=>(y(),T("div",{key:le,class:"vuefinder__modal-tree__section"},[g("div",DF,[g("div",FF,[g("div",LF,[g("div",{class:"vuefinder__modal-tree__storage-toggle",onClick:Ye(de=>p(le,le+"://"),["stop"])},[h.value[`${le}:${le}://`]?(y(),ne(m(Js),{key:1,class:"vuefinder__modal-tree__toggle-icon"})):(y(),ne(m(Xs),{key:0,class:"vuefinder__modal-tree__toggle-icon"}))],8,jF),g("div",{class:Ae(["vuefinder__modal-tree__storage-link",{"vuefinder__modal-tree__storage-link--selected":t.modelValue?.path===le+"://"}]),onClick:de=>O(le),onDblclick:de=>K(le),onTouchend:de=>U(le)},[j(m(fu),{class:"vuefinder__modal-tree__storage-icon"}),g("span",UF,L(le),1)],42,NF)]),h.value[`${le}:${le}://`]?(y(),T("div",zF,[(y(!0),T(Ie,null,He(w(le+"://"),de=>(y(),ne(CF,{key:de.path,folder:de,storage:le,"model-value":t.modelValue,"expanded-folders":h.value,"modal-tree-data":v.value,"current-path":t.currentPath,"onUpdate:modelValue":x,onSelectAndClose:k,onToggleFolder:p},null,8,["folder","storage","model-value","expanded-folders","modal-tree-data","current-path"]))),128)),b(le+"://")?(y(),T("div",VF,[g("div",{class:"vuefinder__modal-tree__load-more",onClick:de=>C(le+"://")},L(m(i)("load more")),9,BF)])):ue("",!0)])):ue("",!0)])])]))),128))],512)]))}}),HF=["title"],Ql=Se({__name:"Message",props:{error:{type:Boolean}},emits:["hidden"],setup(t,{emit:e}){const n=e,i=je(),{t:o}=i.i18n,r=H(!1),s=H(null),a=H(s.value?.innerHTML);Oe(a,()=>r.value=!1);const l=()=>{n("hidden"),r.value=!0};return(c,u)=>(y(),T("div",null,[r.value?ue("",!0):(y(),T("div",{key:0,ref_key:"strMessage",ref:s,class:Ae(["vuefinder__message",t.error?"vuefinder__message--error":"vuefinder__message--success"])},[Ve(c.$slots,"default"),g("div",{class:"vuefinder__message__close",title:m(o)("Close"),onClick:l},[...u[0]||(u[0]=[g("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"vuefinder__message__icon"},[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])],8,HF)],2))]))}}),qF={class:"vuefinder__move-modal__content"},WF={class:"vuefinder__move-modal__description"},KF={class:"vuefinder__move-modal__files vf-scrollbar"},YF={class:"vuefinder__move-modal__file-name"},GF={class:"vuefinder__move-modal__target-title"},QF={class:"vuefinder__move-modal__target-container"},XF={class:"vuefinder__move-modal__target-path"},JF={class:"vuefinder__move-modal__target-storage"},ZF={key:0,class:"vuefinder__move-modal__destination-folder"},e5={class:"vuefinder__move-modal__target-badge"},t5={key:0,class:"vuefinder__move-modal__options"},n5={class:"vuefinder__move-modal__checkbox-label"},i5={class:"vuefinder__move-modal__checkbox-text"},o5=["disabled"],r5={class:"vuefinder__move-modal__selected-items"},Wg=Se({__name:"ModalTransfer",props:{copy:{type:Boolean}},setup(t){const e=je(),n=Gt(e),{enabled:i}=Tn(),{t:o}=e.i18n,r=t,s=H(e.modal.data.items.from),a=H(e.modal.data.items.to),l=H(""),c=H(r.copy||!i("move")),u=te(()=>c.value?"copy":"move"),d=H(!1),h=ke(e.fs.path),v=te(()=>c.value?o("Copy files"):o("Move files")),f=te(()=>c.value?o("Are you sure you want to copy these files?"):o("Are you sure you want to move these files?")),p=te(()=>c.value?o("Yes, Copy!"):o("Yes, Move!")),_=x=>{x&&(a.value=x)},S=x=>{x&&(a.value=x,d.value=!1)},w=te(()=>{const x=a.value;return x?s.value.some(k=>!!(x.path===k.path||k.path.startsWith(x.path+"/")||k.type==="dir"&&x.path.startsWith(k.path+"/"))):!0}),E=te(()=>{if(!w.value)return"";const x=a.value;return x?s.value.find(k=>x.path===k.path||k.path.startsWith(x.path+"/")||k.type==="dir"&&x.path.startsWith(k.path+"/"))?o("Cannot move/copy item to itself or its parent/child directory"):o("Invalid destination directory"):o("Please select a destination directory")}),b=()=>{const x=a.value.path;if(!x)return{storage:"local",path:""};if(x.endsWith("://"))return{storage:x.replace("://",""),path:""};const k=x.split("://");return{storage:k[0]||"local",path:k[1]||""}},C=async()=>{if(s.value.length)try{const{files:x}=await e.adapter[u.value]({path:h.value.path,sources:s.value.map(({path:k})=>k),destination:a.value.path});e.fs.setFiles(x),e.modal.close()}catch(x){n.error(Yt(x,o("Failed to transfer files")))}};return(x,k)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",disabled:w.value,onClick:C},L(p.value),9,o5),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:k[4]||(k[4]=O=>m(e).modal.close())},L(m(o)("Cancel")),1),g("div",r5,L(m(o)("%s item(s) selected.",s.value.length)),1)]),default:we(()=>[g("div",null,[j(pn,{icon:c.value?m(hu):m(nF),title:v.value},null,8,["icon","title"]),g("div",qF,[g("p",WF,L(f.value),1),g("div",KF,[(y(!0),T(Ie,null,He(s.value,O=>(y(),T("div",{key:O.path,class:"vuefinder__move-modal__file"},[g("div",null,[O.type==="dir"?(y(),ne(m(Nn),{key:0,class:"vuefinder__move-modal__icon vuefinder__move-modal__icon--dir"})):(y(),ne(m(qo),{key:1,class:"vuefinder__move-modal__icon"}))]),g("div",YF,L(O.path),1)]))),128))]),g("h4",GF,L(m(o)("Target Directory")),1),g("div",QF,[g("div",{class:"vuefinder__move-modal__target-display",onClick:k[0]||(k[0]=O=>d.value=!d.value)},[g("div",XF,[g("span",JF,L(b().storage)+"://",1),b().path?(y(),T("span",ZF,L(b().path),1)):ue("",!0)]),g("span",e5,L(m(o)("Browse")),1)])]),g("div",{class:Ae(["vuefinder__move-modal__tree-selector",d.value?"vuefinder__move-modal__tree-selector--expanded":"vuefinder__move-modal__tree-selector--collapsed"])},[j(vu,{modelValue:a.value,"onUpdate:modelValue":[k[1]||(k[1]=O=>a.value=O),_],"show-pinned-folders":!0,onSelectAndClose:S},null,8,["modelValue"])],2),m(i)("copy")&&m(i)("move")?(y(),T("div",t5,[g("label",n5,[it(g("input",{"onUpdate:modelValue":k[2]||(k[2]=O=>c.value=O),type:"checkbox",class:"vuefinder__move-modal__checkbox"},null,512),[[Es,c.value]]),g("span",i5,L(m(o)("Create a copy instead of moving")),1)])])):ue("",!0),E.value?(y(),ne(Ql,{key:1,error:""},{default:we(()=>[Ke(L(E.value),1)]),_:1})):ue("",!0),l.value.length&&!E.value?(y(),ne(Ql,{key:2,error:"",onHidden:k[3]||(k[3]=O=>l.value="")},{default:we(()=>[Ke(L(l.value),1)]),_:1})):ue("",!0)])])]),_:1}))}}),uo=Se({__name:"ModalMove",setup(t){return(e,n)=>(y(),ne(Wg,{copy:!1}))}}),gu=Se({__name:"ModalCopy",setup(t){return(e,n)=>(y(),ne(Wg,{copy:!0}))}}),s5=(t,e=0,n=!1)=>{let i;return(...o)=>{n&&!i&&t(...o),clearTimeout(i),i=setTimeout(()=>{t(...o)},e)}},Kg=(t,e,n)=>{const i=H(t);return C_((o,r)=>({get(){return o(),i.value},set:s5(s=>{i.value=s,r()},e,!1)}))},a5={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"};function l5(t,e){return y(),T("svg",a5,[...e[0]||(e[0]=[g("path",{d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607"},null,-1)])])}const _u={render:l5},c5={xmlns:"http://www.w3.org/2000/svg",fill:"none",class:"animate-spin p-0.5 h-5 w-5 text-white ml-auto",viewBox:"0 0 24 24"};function u5(t,e){return y(),T("svg",c5,[...e[0]||(e[0]=[g("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4",class:"opacity-25 stroke-blue-900"},null,-1),g("path",{fill:"currentColor",d:"M4 12a8 8 0 0 1 8-8V0C5.373 0 0 5.373 0 12zm2 5.291A7.96 7.96 0 0 1 4 12H0c0 3.042 1.135 5.824 3 7.938z",class:"opacity-75"},null,-1)])])}const Zs={render:u5},d5={class:"vuefinder__search-modal__search-input"},h5=["value","placeholder","disabled"],p5={key:0,class:"vuefinder__search-modal__loading"},f5=Se({name:"SearchInput",__name:"SearchInput",props:{modelValue:{},isSearching:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue","keydown"],setup(t,{expose:e,emit:n}){const i=n,o=je(),{t:r}=o.i18n,s=H(null),a=c=>{const u=c.target;i("update:modelValue",u.value)},l=c=>{i("keydown",c)};return e({focus:()=>{s.value&&s.value.focus()}}),(c,u)=>(y(),T("div",d5,[j(m(_u),{class:"vuefinder__search-modal__search-icon"}),g("input",{ref_key:"searchInput",ref:s,value:t.modelValue,type:"text",placeholder:m(r)("Search files"),disabled:t.disabled,class:"vuefinder__search-modal__input",onKeydown:l,onKeyup:u[0]||(u[0]=Ye(()=>{},["stop"])),onInput:a},null,40,h5),t.isSearching?(y(),T("div",p5,[j(m(Zs),{class:"vuefinder__search-modal__loading-icon"})])):ue("",!0)]))}}),m5={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24"};function v5(t,e){return y(),T("svg",m5,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87q.11.06.22.127c.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a8 8 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a7 7 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a7 7 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a7 7 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124q.108-.066.22-.128c.332-.183.582-.495.644-.869z"},null,-1),g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0"},null,-1)])])}const Yg={render:v5},g5=["disabled","title"],_5=["data-theme"],y5={class:"vuefinder__search-modal__dropdown-content"},b5={class:"vuefinder__search-modal__dropdown-section"},w5={class:"vuefinder__search-modal__dropdown-title"},E5={class:"vuefinder__search-modal__dropdown-options"},S5={key:0,class:"vuefinder__search-modal__dropdown-option-check"},C5={key:0,class:"vuefinder__search-modal__dropdown-option-check"},x5={key:0,class:"vuefinder__search-modal__dropdown-option-check"},T5={key:0,class:"vuefinder__search-modal__dropdown-option-check"},O5=Se({name:"SearchOptionsDropdown",__name:"SearchOptionsDropdown",props:{visible:{type:Boolean},disabled:{type:Boolean,default:!1},sizeFilter:{},selectedOption:{}},emits:["update:visible","update:sizeFilter","update:selectedOption","keydown"],setup(t,{expose:e,emit:n}){const i=t,o=n,r=je(),{t:s}=r.i18n,a=H(null),l=H(null);let c=null;const u=p=>{if(o("update:selectedOption",p),p.startsWith("size-")){const _=p.split("-")[1];o("update:sizeFilter",_)}},d=async()=>{i.disabled||(i.visible?(o("update:visible",!1),c&&(c(),c=null)):(o("update:visible",!0),await Ge(),await h()))},h=async()=>{if(!(!a.value||!l.value)&&(await Ge(),!(!a.value||!l.value))){Object.assign(l.value.style,{position:"fixed",zIndex:"10001",opacity:"0",transform:"translateY(-8px)",transition:"opacity 150ms ease-out, transform 150ms ease-out"});try{const{x:p,y:_}=await Zi(a.value,l.value,{placement:"bottom-start",strategy:"fixed",middleware:[Po(8),Ro({padding:16}),Io({padding:16})]});Object.assign(l.value.style,{left:`${p}px`,top:`${_}px`}),requestAnimationFrame(()=>{l.value&&Object.assign(l.value.style,{opacity:"1",transform:"translateY(0)"})})}catch(p){console.warn("Floating UI initial positioning error:",p);return}try{c=oc(a.value,l.value,async()=>{if(!(!a.value||!l.value))try{const{x:p,y:_}=await Zi(a.value,l.value,{placement:"bottom-start",strategy:"fixed",middleware:[Po(8),Ro({padding:16}),Io({padding:16})]});Object.assign(l.value.style,{left:`${p}px`,top:`${_}px`})}catch(p){console.warn("Floating UI positioning error:",p)}})}catch(p){console.warn("Floating UI autoUpdate setup error:",p),c=null}}},v=p=>{if(!i.visible)return;const _=["size-all","size-small","size-medium","size-large"],S=_.findIndex(w=>w===i.selectedOption);if(p.key==="ArrowDown"){p.preventDefault();const w=(S+1)%_.length;o("update:selectedOption",_[w]||null)}else if(p.key==="ArrowUp"){p.preventDefault();const w=S<=0?_.length-1:S-1;o("update:selectedOption",_[w]||null)}else p.key==="Enter"?(p.preventDefault(),i.selectedOption?.startsWith("size-")&&o("update:sizeFilter",i.selectedOption.split("-")[1])):p.key==="Escape"&&(p.preventDefault(),o("update:visible",!1),c&&(c(),c=null))},f=()=>{c&&(c(),c=null)};return Oe(()=>i.visible,p=>{!p&&c&&(c(),c=null)}),St(()=>{f()}),e({cleanup:f}),(p,_)=>(y(),T(Ie,null,[g("button",{ref_key:"dropdownBtn",ref:a,class:Ae(["vuefinder__search-modal__dropdown-btn",{"vuefinder__search-modal__dropdown-btn--active":t.visible}]),disabled:t.disabled,title:m(s)("Search Options"),onClick:Ye(d,["stop"])},[j(m(Yg),{class:"vuefinder__search-modal__dropdown-icon"})],10,g5),(y(),ne(ws,{to:"body"},[t.visible?(y(),T("div",{key:0,ref_key:"dropdownContent",ref:l,class:"vuefinder__themer vuefinder__search-modal__dropdown vuefinder__search-modal__dropdown--visible","data-theme":m(r).theme.current,tabindex:"-1",onClick:_[4]||(_[4]=Ye(()=>{},["stop"])),onKeydown:v},[g("div",y5,[g("div",b5,[g("div",w5,L(m(s)("File Size")),1),g("div",E5,[g("div",{class:Ae(["vuefinder__search-modal__dropdown-option",{"vuefinder__search-modal__dropdown-option--selected":t.sizeFilter==="all"}]),onClick:_[0]||(_[0]=Ye(S=>u("size-all"),["stop"]))},[g("span",null,L(m(s)("All Files")),1),t.sizeFilter==="all"?(y(),T("div",S5,[..._[5]||(_[5]=[g("svg",{viewBox:"0 0 16 16",fill:"currentColor"},[g("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"})],-1)])])):ue("",!0)],2),g("div",{class:Ae(["vuefinder__search-modal__dropdown-option",{"vuefinder__search-modal__dropdown-option--selected":t.sizeFilter==="small"}]),onClick:_[1]||(_[1]=Ye(S=>u("size-small"),["stop"]))},[g("span",null,L(m(s)("Small (< 1MB)")),1),t.sizeFilter==="small"?(y(),T("div",C5,[..._[6]||(_[6]=[g("svg",{viewBox:"0 0 16 16",fill:"currentColor"},[g("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"})],-1)])])):ue("",!0)],2),g("div",{class:Ae(["vuefinder__search-modal__dropdown-option",{"vuefinder__search-modal__dropdown-option--selected":t.sizeFilter==="medium"}]),onClick:_[2]||(_[2]=Ye(S=>u("size-medium"),["stop"]))},[g("span",null,L(m(s)("Medium (1-10MB)")),1),t.sizeFilter==="medium"?(y(),T("div",x5,[..._[7]||(_[7]=[g("svg",{viewBox:"0 0 16 16",fill:"currentColor"},[g("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"})],-1)])])):ue("",!0)],2),g("div",{class:Ae(["vuefinder__search-modal__dropdown-option",{"vuefinder__search-modal__dropdown-option--selected":t.sizeFilter==="large"}]),onClick:_[3]||(_[3]=Ye(S=>u("size-large"),["stop"]))},[g("span",null,L(m(s)("Large (> 10MB)")),1),t.sizeFilter==="large"?(y(),T("div",T5,[..._[8]||(_[8]=[g("svg",{viewBox:"0 0 16 16",fill:"currentColor"},[g("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"})],-1)])])):ue("",!0)],2)])])])],40,_5)):ue("",!0)]))],64))}});function Gg(t,e=40){const n=t.match(/^([^:]+:\/\/)(.*)$/);if(!n)return t;const i=n[1],o=n[2]??"",r=o.split("/").filter(Boolean),s=r.pop();if(!s)return i+o;let a=`${i}${r.join("/")}${r.length?"/":""}${s}`;if(a.length<=e)return a;const l=s.split(/\.(?=[^\.]+$)/),c=l[0]??"",u=l[1]??"",d=c.length>10?`${c.slice(0,6)}...${c.slice(-5)}`:c,h=u?`${d}.${u}`:d;return a=`${i}${r.join("/")}${r.length?"/":""}${h}`,a.length>e&&(a=`${i}.../${h}`),a}async function Qg(t){try{await navigator.clipboard.writeText(t)}catch{const e=document.createElement("textarea");e.value=t,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}}async function Wo(t){await Qg(t)}async function $5(t){await Qg(t)}const k5={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 448 512"};function A5(t,e){return y(),T("svg",k5,[...e[0]||(e[0]=[g("path",{d:"M8 256a56 56 0 1 1 112 0 56 56 0 1 1-112 0m160 0a56 56 0 1 1 112 0 56 56 0 1 1-112 0m216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112"},null,-1)])])}const Xg={render:A5},P5=["title"],R5={class:"vuefinder__search-modal__result-icon"},I5={class:"vuefinder__search-modal__result-content"},M5={class:"vuefinder__search-modal__result-name"},D5={key:0,class:"vuefinder__search-modal__result-size"},F5=["title"],L5=["title"],j5=["data-item-dropdown","data-theme"],N5={class:"vuefinder__search-modal__item-dropdown-content"},U5=Se({name:"SearchResultItem",__name:"SearchResultItem",props:{item:{},index:{},selectedIndex:{},expandedPaths:{},activeDropdown:{},selectedItemDropdownOption:{}},emits:["select","selectWithDropdown","togglePathExpansion","toggleItemDropdown","update:selectedItemDropdownOption","copyPath","openContainingFolder","preview"],setup(t,{emit:e}){const n=t,i=e,o=je(),{t:r}=o.i18n,s=H(null);let a=null,l=null,c=[],u=null;Oe(()=>n.activeDropdown,k=>{a&&(a(),a=null),l&&(c.forEach(O=>{O===window?window.removeEventListener("scroll",l,!0):O.removeEventListener("scroll",l,!0)}),l=null,c=[]),u&&(document.removeEventListener("mousedown",u,!0),document.removeEventListener("touchstart",u,!0),u=null),k===n.item.path&&s.value&&Ge(()=>{S(n.item.path,s.value),h(),v()})});const d=k=>{const O=[];let K=k;for(;K&&K!==document.body&&K!==document.documentElement;){const D=window.getComputedStyle(K),P=D.overflow+D.overflowX+D.overflowY;(P.includes("scroll")||P.includes("auto"))&&O.push(K),K=K.parentElement}return O},h=()=>{if(n.activeDropdown!==n.item.path)return;const k=d(s.value);c=[window,...k],l=()=>{n.activeDropdown===n.item.path&&i("toggleItemDropdown",n.item.path,new MouseEvent("click"))};const O=l;O&&c.forEach(K=>{K===window?window.addEventListener("scroll",O,!0):K.addEventListener("scroll",O,!0)})},v=()=>{n.activeDropdown===n.item.path&&(u=k=>{if(n.activeDropdown!==n.item.path)return;const O=k.target;if(!O)return;const K=document.querySelector(`[data-item-dropdown="${n.item.path}"]`);if(K&&K.contains(O)||s.value&&s.value.contains(O))return;const D=o.root;if(D&&D.contains(O)){i("toggleItemDropdown",n.item.path,new MouseEvent("click"));return}const P=document.querySelector(".vuefinder__modal-layout");if(P&&P.contains(O)){i("toggleItemDropdown",n.item.path,new MouseEvent("click"));return}i("toggleItemDropdown",n.item.path,new MouseEvent("click"))},setTimeout(()=>{u&&(document.addEventListener("mousedown",u,!0),document.addEventListener("touchstart",u,!0))},100))};St(()=>{a&&(a(),a=null),l&&(c.forEach(k=>{k===window?window.removeEventListener("scroll",l,!0):k.removeEventListener("scroll",l,!0)}),l=null,c=[]),u&&(document.removeEventListener("mousedown",u,!0),document.removeEventListener("touchstart",u,!0),u=null)});const f=k=>n.expandedPaths.has(k),p=k=>k.type==="dir"||!k.file_size?"":uu(k.file_size),_=(k,O)=>{O.stopPropagation(),i("toggleItemDropdown",k,O)},S=async(k,O)=>{const K=document.querySelector(`[data-item-dropdown="${k}"]`);if(!(!K||!O)&&(await Ge(),!(!K||!O))){Object.assign(K.style,{position:"fixed",zIndex:"10001",opacity:"0",transform:"translateY(-8px)",transition:"opacity 150ms ease-out, transform 150ms ease-out"});try{const{x:D,y:P}=await Zi(O,K,{placement:"left-start",strategy:"fixed",middleware:[Po(8),Ro({padding:16}),Io({padding:16})]});Object.assign(K.style,{left:`${D}px`,top:`${P}px`}),requestAnimationFrame(()=>{K&&Object.assign(K.style,{opacity:"1",transform:"translateY(0)"})})}catch(D){console.warn("Floating UI initial positioning error:",D);return}try{a=oc(O,K,async()=>{if(!(!O||!K))try{const{x:D,y:P}=await Zi(O,K,{placement:"left-start",strategy:"fixed",middleware:[Po(8),Ro({padding:16}),Io({padding:16})]});Object.assign(K.style,{left:`${D}px`,top:`${P}px`})}catch(D){console.warn("Floating UI positioning error:",D)}})}catch(D){console.warn("Floating UI autoUpdate setup error:",D),a=null}}},w=k=>{i("update:selectedItemDropdownOption",k)},E=async k=>{await Wo(k.path),i("copyPath",k)},b=k=>{i("openContainingFolder",k)},C=k=>{i("preview",k)},x=k=>{if(!n.activeDropdown)return;const O=["copy-path","open-folder","preview"],K=n.selectedItemDropdownOption,D=O.findIndex(P=>K?.includes(P));if(k.key==="ArrowDown"){k.preventDefault();const P=(D+1)%O.length;i("update:selectedItemDropdownOption",`${O[P]||""}-${n.activeDropdown}`)}else if(k.key==="ArrowUp"){k.preventDefault();const P=D<=0?O.length-1:D-1;i("update:selectedItemDropdownOption",`${O[P]||""}-${n.activeDropdown}`)}else k.key==="Enter"?(k.preventDefault(),K&&(K.includes("copy-path")?E(n.item):K.includes("open-folder")?b(n.item):K.includes("preview")&&C(n.item))):k.key==="Escape"&&(k.preventDefault(),i("update:selectedItemDropdownOption",null))};return(k,O)=>(y(),T("div",{class:Ae(["vuefinder__search-modal__result-item",{"vuefinder__search-modal__result-item--selected":t.index===t.selectedIndex}]),title:t.item.basename,onClick:O[9]||(O[9]=K=>i("select",t.index))},[g("div",R5,[t.item.type==="dir"?(y(),ne(m(Nn),{key:0})):(y(),ne(m(qo),{key:1}))]),g("div",I5,[g("div",M5,[Ke(L(t.item.basename)+" ",1),p(t.item)?(y(),T("span",D5,L(p(t.item)),1)):ue("",!0)]),g("div",{class:"vuefinder__search-modal__result-path",title:t.item.path,onClick:O[0]||(O[0]=Ye(K=>{i("select",t.index),i("togglePathExpansion",t.item.path)},["stop"]))},L(f(t.item.path)?t.item.path:m(Gg)(t.item.path)),9,F5)]),g("button",{ref_key:"buttonElementRef",ref:s,class:"vuefinder__search-modal__result-actions",title:m(r)("More actions"),onClick:O[1]||(O[1]=K=>{i("selectWithDropdown",t.index),_(t.item.path,K)})},[j(m(Xg),{class:"vuefinder__search-modal__result-actions-icon"})],8,L5),(y(),ne(ws,{to:"body"},[t.activeDropdown===t.item.path?(y(),T("div",{key:0,"data-item-dropdown":t.item.path,class:"vuefinder__themer vuefinder__search-modal__item-dropdown vuefinder__search-modal__item-dropdown--visible","data-theme":m(o).theme.current,tabindex:"-1",onClick:O[8]||(O[8]=Ye(()=>{},["stop"])),onKeydown:x},[g("div",N5,[g("div",{class:Ae(["vuefinder__search-modal__item-dropdown-option",{"vuefinder__search-modal__item-dropdown-option--selected":t.selectedItemDropdownOption===`copy-path-${t.item.path}`}]),onClick:O[2]||(O[2]=K=>{w(`copy-path-${t.item.path}`),E(t.item)}),onFocus:O[3]||(O[3]=K=>w(`copy-path-${t.item.path}`))},[j(m(hu),{class:"vuefinder__search-modal__item-dropdown-icon"}),g("span",null,L(m(r)("Copy Path")),1)],34),g("div",{class:Ae(["vuefinder__search-modal__item-dropdown-option",{"vuefinder__search-modal__item-dropdown-option--selected":t.selectedItemDropdownOption===`open-folder-${t.item.path}`}]),onClick:O[4]||(O[4]=K=>{w(`open-folder-${t.item.path}`),b(t.item)}),onFocus:O[5]||(O[5]=K=>w(`open-folder-${t.item.path}`))},[j(m(Nn),{class:"vuefinder__search-modal__item-dropdown-icon"}),g("span",null,L(m(r)("Open Containing Folder")),1)],34),g("div",{class:Ae(["vuefinder__search-modal__item-dropdown-option",{"vuefinder__search-modal__item-dropdown-option--selected":t.selectedItemDropdownOption===`preview-${t.item.path}`}]),onClick:O[6]||(O[6]=K=>{w(`preview-${t.item.path}`),C(t.item)}),onFocus:O[7]||(O[7]=K=>w(`preview-${t.item.path}`))},[j(m(qo),{class:"vuefinder__search-modal__item-dropdown-icon"}),g("span",null,L(m(r)("Preview")),1)],34)])],40,j5)):ue("",!0)]))],10,P5))}}),z5={key:0,class:"vuefinder__search-modal__searching"},V5={class:"vuefinder__search-modal__loading-icon"},B5={key:1,class:"vuefinder__search-modal__no-results"},H5={key:2,class:"vuefinder__search-modal__results-list"},q5={class:"vuefinder__search-modal__results-header"},xi=60,Ip=5,W5=Se({name:"SearchResultsList",__name:"SearchResultsList",props:{searchResults:{},isSearching:{type:Boolean},selectedIndex:{},expandedPaths:{},activeDropdown:{},selectedItemDropdownOption:{},resultsEnter:{type:Boolean}},emits:["selectResultItem","selectResultItemWithDropdown","togglePathExpansion","toggleItemDropdown","update:selectedItemDropdownOption","copyPath","openContainingFolder","preview"],setup(t,{expose:e,emit:n}){const i=t,o=n,r=je(),{t:s}=r.i18n,a=In("scrollableContainer"),l=te(()=>i.searchResults.length>0),c=te(()=>i.searchResults.length),u=H(0),d=H(600),h=te(()=>i.searchResults.length*xi),v=te(()=>{const E=Math.max(0,Math.floor(u.value/xi)-Ip),b=Math.min(i.searchResults.length,Math.ceil((u.value+d.value)/xi)+Ip);return{start:E,end:b}}),f=te(()=>{const{start:E,end:b}=v.value;return i.searchResults.slice(E,b).map((C,x)=>({item:C,index:E+x,top:(E+x)*xi}))}),p=E=>{const b=E.target;u.value=b.scrollTop},_=()=>{a.value&&(d.value=a.value.clientHeight)},S=()=>{if(i.selectedIndex>=0&&a.value){const E=i.selectedIndex*xi,b=E+xi,C=a.value.scrollTop,x=a.value.clientHeight,k=C+x;let O=C;E<C?O=E:b>k&&(O=b-x),O!==C&&a.value.scrollTo({top:O,behavior:"smooth"})}},w=()=>{a.value&&(a.value.scrollTop=0,u.value=0)};return et(()=>{_(),window.addEventListener("resize",_)}),St(()=>{window.removeEventListener("resize",_)}),Oe(()=>a.value,()=>{_()}),e({scrollSelectedIntoView:S,resetScroll:w,getContainerHeight:()=>d.value,scrollTop:()=>u.value}),(E,b)=>(y(),T("div",{class:Ae(["vuefinder__search-modal__results",{"vuefinder__search-modal__results--enter":t.resultsEnter}])},[t.isSearching?(y(),T("div",z5,[g("div",V5,[j(m(Zs),{class:"vuefinder__search-modal__loading-icon"})]),g("span",null,L(m(s)("Searching...")),1)])):l.value?(y(),T("div",H5,[g("div",q5,[g("span",null,L(m(s)("Found %s results",c.value)),1)]),g("div",{ref_key:"scrollableContainer",ref:a,class:"vuefinder__search-modal__results-scrollable",onScroll:p},[g("div",{class:"vuefinder__search-modal__results-items",style:At({height:`${h.value}px`,position:"relative"})},[(y(!0),T(Ie,null,He(f.value,C=>(y(),T("div",{key:C.item.path,style:At({position:"absolute",top:`${C.top}px`,left:"0",width:"100%",height:`${xi}px`})},[j(U5,{item:C.item,index:C.index,"selected-index":t.selectedIndex,"expanded-paths":t.expandedPaths,"active-dropdown":t.activeDropdown,"selected-item-dropdown-option":t.selectedItemDropdownOption,onSelect:b[0]||(b[0]=x=>o("selectResultItem",x)),onSelectWithDropdown:b[1]||(b[1]=x=>o("selectResultItemWithDropdown",x)),onTogglePathExpansion:b[2]||(b[2]=x=>o("togglePathExpansion",x)),onToggleItemDropdown:b[3]||(b[3]=(x,k)=>o("toggleItemDropdown",x,k)),"onUpdate:selectedItemDropdownOption":b[4]||(b[4]=x=>o("update:selectedItemDropdownOption",x)),onCopyPath:b[5]||(b[5]=x=>o("copyPath",x)),onOpenContainingFolder:b[6]||(b[6]=x=>o("openContainingFolder",x)),onPreview:b[7]||(b[7]=x=>o("preview",x))},null,8,["item","index","selected-index","expanded-paths","active-dropdown","selected-item-dropdown-option"])],4))),128))],4)],544)])):(y(),T("div",B5,[g("span",null,L(m(s)("No results found")),1)]))],2))}}),K5={class:"vuefinder__search-modal"},Y5={class:"vuefinder__search-modal__content"},G5={class:"vuefinder__search-modal__search-bar"},Q5={class:"vuefinder__search-modal__search-location"},X5=["title"],J5=["disabled"],Z5={key:0,class:"vuefinder__search-modal__folder-selector"},eL={class:"vuefinder__search-modal__folder-selector-content"},tL={key:1,class:"vuefinder__search-modal__instructions"},nL={class:"vuefinder__search-modal__instructions-text"},yu=Se({name:"ModalSearch",__name:"ModalSearch",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=H(null),s=H(null),a=H(null),l=Kg("",300),c=H([]),u=H(!1),d=H(-1),h=H(!1),v=H(!1),f=H(null),p=H("all"),_=H(!1),S=H(`size-${p.value}`),w=H(null),E=H(new Set),b=H(null),C=ke(o.path),x=A=>{E.value.has(A)?E.value.delete(A):E.value.add(A)},k=(A,Q)=>{Q&&typeof Q.stopPropagation=="function"&&Q.stopPropagation(),b.value===A?b.value=null:b.value=A},O=()=>{b.value=null},K=A=>{try{const Q=A.dir||`${A.storage}://`;e.adapter.open(Q),e.modal.close(),O()}catch{n.error(i("Failed to open containing folder"))}},D=A=>{e.modal.open(lr,{storage:C?.value?.storage??"local",item:A}),O()},P=A=>{d.value=A,O()},U=A=>{d.value=A},M=async A=>{await Wo(A.path),O()};Oe(l,async A=>{A.trim()?(await q(A.trim()),d.value=0):(c.value=[],u.value=!1,d.value=-1)}),Oe(p,async A=>{S.value=`size-${A}`,l.value.trim()&&!v.value&&(await q(l.value.trim()),d.value=0)}),Oe(_,async()=>{l.value.trim()&&!v.value&&(await q(l.value.trim()),d.value=0)});const q=async A=>{if(A){u.value=!0;try{const Q=f.value?.path||C?.value?.path,z=await e.adapter.search({path:Q,filter:A,deep:_.value,size:p.value});c.value=z||[],u.value=!1}catch(Q){n.error(Yt(Q,i("Search failed"))),c.value=[],u.value=!1}}};et(()=>{document.addEventListener("click",I),S.value=`size-${p.value}`});const le=()=>{v.value?(v.value=!1,l.value.trim()&&(q(l.value.trim()),d.value=0)):(h.value=!1,v.value=!0)},de=A=>{A&&(f.value=A)},Y=A=>{A&&(de(A),v.value=!1,l.value.trim()&&(q(l.value.trim()),d.value=0))};St(()=>{document.removeEventListener("click",I),s.value&&s.value.cleanup()});const I=A=>{const Q=A.target;if(h.value&&(Q.closest(".vuefinder__search-modal__dropdown")||(h.value=!1,Ge(()=>{r.value&&r.value.focus()}))),b.value){const z=Q.closest(".vuefinder__search-modal__item-dropdown"),ie=Q.closest(".vuefinder__search-modal__result-item");!z&&!ie&&O()}};return(A,Q)=>(y(),ne(nn,{class:"vuefinder__search-modal-layout"},{default:we(()=>[g("div",K5,[j(pn,{icon:m(_u),title:m(i)("Search files")},null,8,["icon","title"]),g("div",Y5,[g("div",G5,[j(f5,{ref_key:"searchInputRef",ref:r,modelValue:m(l),"onUpdate:modelValue":Q[0]||(Q[0]=z=>ys(l)?l.value=z:null),"is-searching":u.value,disabled:v.value},null,8,["modelValue","is-searching","disabled"]),j(O5,{ref_key:"searchOptionsDropdownRef",ref:s,visible:h.value,"onUpdate:visible":Q[1]||(Q[1]=z=>h.value=z),"size-filter":p.value,"onUpdate:sizeFilter":Q[2]||(Q[2]=z=>p.value=z),"selected-option":S.value,"onUpdate:selectedOption":Q[3]||(Q[3]=z=>S.value=z),disabled:v.value},null,8,["visible","size-filter","selected-option","disabled"])]),g("div",{class:"vuefinder__search-modal__options",onClick:Q[7]||(Q[7]=Ye(()=>{},["stop"]))},[g("div",Q5,[g("button",{class:Ae(["vuefinder__search-modal__location-btn",{"vuefinder__search-modal__location-btn--open":v.value}]),onClick:Ye(le,["stop"])},[j(m(Nn),{class:"vuefinder__search-modal__location-icon"}),g("span",{class:"vuefinder__search-modal__location-text",title:f.value?.path||m(C).path},L(m(Gg)(f.value?.path||m(C).path)),9,X5),Q[10]||(Q[10]=g("svg",{class:"vuefinder__search-modal__location-arrow",viewBox:"0 0 16 16",fill:"currentColor"},[g("path",{d:"M4.427 7.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 7H4.604a.25.25 0 00-.177.427z"})],-1))],2)]),g("label",{class:"vuefinder__search-modal__deep-search",onClick:Q[6]||(Q[6]=Ye(()=>{},["stop"]))},[it(g("input",{"onUpdate:modelValue":Q[4]||(Q[4]=z=>_.value=z),type:"checkbox",disabled:v.value,class:"vuefinder__search-modal__checkbox",onClick:Q[5]||(Q[5]=Ye(()=>{},["stop"]))},null,8,J5),[[Es,_.value]]),g("span",null,L(m(i)("Include subfolders")),1)])]),v.value?(y(),T("div",Z5,[g("div",eL,[j(vu,{modelValue:f.value,"onUpdate:modelValue":[Q[8]||(Q[8]=z=>f.value=z),de],"show-pinned-folders":!0,"current-path":m(C),onSelectAndClose:Y},null,8,["modelValue","current-path"])])])):ue("",!0),!m(l).trim()&&!v.value?(y(),T("div",tL,[g("p",nL,L(m(i)("Start typing to search files. Use options to filter or include subfolders.")),1)])):ue("",!0),m(l).trim()&&!v.value?(y(),ne(W5,{key:2,ref_key:"searchResultsListRef",ref:a,"search-results":c.value,"is-searching":u.value,"selected-index":d.value,"expanded-paths":E.value,"active-dropdown":b.value,"selected-item-dropdown-option":w.value,"results-enter":!0,onSelectResultItem:P,onSelectResultItemWithDropdown:U,onTogglePathExpansion:x,onToggleItemDropdown:k,"onUpdate:selectedItemDropdownOption":Q[9]||(Q[9]=z=>w.value=z),onCopyPath:M,onOpenContainingFolder:K,onPreview:D},null,8,["search-results","is-searching","selected-index","expanded-paths","active-dropdown","selected-item-dropdown-option"])):ue("",!0)])])]),_:1}))}}),iL={props:{on:{type:String,required:!0}},setup(t,{emit:e,slots:n}){const i=je(),o=H(!1),{t:r}=i.i18n;let s=null;const a=()=>{s&&clearTimeout(s),o.value=!0,s=setTimeout(()=>{o.value=!1},2e3)};return et(()=>{i.emitter.on(t.on,a)}),St(()=>{s&&clearTimeout(s)}),{shown:o,t:r}}},oL=(t,e)=>{const n=t.__vccOpts||t;for(const[i,o]of e)n[i]=o;return n},rL={key:1};function sL(t,e,n,i,o,r){return y(),T("div",{class:Ae(["vuefinder__action-message",{"vuefinder__action-message--hidden":!i.shown}])},[t.$slots.default?Ve(t.$slots,"default",{key:0}):(y(),T("span",rL,L(i.t("Saved.")),1))],2)}const Mp=oL(iL,[["render",sL]]),aL=[{name:"silver",displayName:"Silver"},{name:"valorite",displayName:"Valorite"},{name:"midnight",displayName:"Midnight"},{name:"latte",displayName:"Latte"},{name:"rose",displayName:"Rose"},{name:"mythril",displayName:"Mythril"},{name:"lime",displayName:"lime"},{name:"sky",displayName:"Sky"},{name:"ocean",displayName:"Oceanic"},{name:"palenight",displayName:"Palenight"},{name:"arctic",displayName:"Arctic"},{name:"code",displayName:"Code"}],lL={class:"vuefinder__settings-modal__content"},cL={class:"vuefinder__settings-modal__main"},uL={class:"vuefinder__settings-modal__sections"},dL={key:0,class:"vuefinder__settings-modal__section"},hL={for:"theme",class:"vuefinder__settings-modal__label"},pL={class:"vuefinder__settings-modal__input-group"},fL=["value"],mL=["value"],vL={key:1,class:"vuefinder__settings-modal__section"},gL={for:"language",class:"vuefinder__settings-modal__label"},_L={class:"vuefinder__settings-modal__input-group"},yL=["value"],bL={class:"vuefinder__settings-modal__reset-section"},wL={class:"vuefinder__settings-modal__reset-content"},EL={class:"vuefinder__settings-modal__reset-title"},SL={class:"vuefinder__settings-modal__reset-description"},Jg=Se({__name:"ModalSettings",setup(t){const e=je(),{enabled:n}=Tn(),i=e.config,{clearStore:o}=e.storage,{t:r,localeAtom:s}=e.i18n,a=ke(s),l=te({get:()=>String(a.value||"en"),set:p=>s.set(p||"en")}),c=ke(i.state),u=te(()=>c.value.theme||"silver"),d=async()=>{i.reset(),o(),localStorage.removeItem("vuefinder_locale"),localStorage.removeItem("vuefinder_translations"),location.reload()},h=p=>{i.set("theme",p),e.emitter.emit("vf-theme-saved")},{i18n:v}=ko("VueFinderOptions"),f=Object.fromEntries(Object.entries({ar:"Arabic (العربيّة)",zhCN:"Chinese-Simplified (简体中文)",zhTW:"Chinese-Traditional (繁體中文)",nl:"Dutch (Nederlands)",en:"English",fr:"French (Français)",de:"German (Deutsch)",he:"Hebrew (עִברִית)",hi:"Hindi (हिंदी)",it:"Italian (Italiano)",ja:"Japanese (日本語)",fa:"Persian (فارسی)",pl:"Polish (Polski)",pt:"Portuguese (Português)",ru:"Russian (Pусский)",es:"Spanish (Español)",sv:"Swedish (Svenska)",tr:"Turkish (Türkçe)"}).filter(([p])=>Object.keys(v).includes(p)));return(p,_)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:_[2]||(_[2]=S=>m(e).modal.close())},L(m(r)("Close")),1)]),default:we(()=>[g("div",lL,[j(pn,{icon:m(Yg),title:m(r)("Settings")},null,8,["icon","title"]),g("div",cL,[g("div",uL,[m(n)("theme")?(y(),T("div",dL,[g("label",hL,[Ke(L(m(r)("Theme"))+" ",1),j(Mp,{class:"vuefinder__settings-modal__message",on:"vf-theme-saved"},{default:we(()=>[Ke(L(m(r)("Saved.")),1)]),_:1})]),g("div",pL,[g("select",{id:"theme",value:u.value,class:"vuefinder__settings-modal__select",onChange:_[0]||(_[0]=S=>h(S.target?.value))},[(y(!0),T(Ie,null,He(m(aL),S=>(y(),T("option",{key:S.name,value:S.name},L(S.displayName),9,mL))),128))],40,fL)])])):ue("",!0),Object.keys(m(f)).length>1?(y(),T("div",vL,[g("label",gL,[Ke(L(m(r)("Language"))+" ",1),j(Mp,{class:"vuefinder__settings-modal__message",on:"vf-language-saved"},{default:we(()=>[Ke(L(m(r)("Saved.")),1)]),_:1})]),g("div",_L,[it(g("select",{id:"language","onUpdate:modelValue":_[1]||(_[1]=S=>l.value=S),class:"vuefinder__settings-modal__select"},[(y(!0),T(Ie,null,He(m(f),(S,w)=>(y(),T("option",{key:w,value:w},L(S),9,yL))),128))],512),[[Za,l.value]])])])):ue("",!0)]),g("div",bL,[g("div",wL,[g("div",EL,L(m(r)("Reset")),1),g("div",SL,L(m(r)("Reset all settings to default")),1)]),g("button",{type:"button",class:"vuefinder__settings-modal__reset-button",onClick:d},L(m(r)("Reset Settings")),1)])])])]),_:1}))}}),Lt={ESCAPE:"Escape",DELETE:"Delete",ENTER:"Enter",BACKSLASH:"Backslash",KEY_A:"KeyA",KEY_E:"KeyE",KEY_F:"KeyF",SPACE:"Space",KEY_C:"KeyC",KEY_X:"KeyX",KEY_V:"KeyV",KEY_S:"KeyS",KEY_R:"KeyR"};function CL(){const t=je(),e=Gt(t),n=t.fs,i=t.config,{enabled:o}=Tn(),r=ke(n.path),s=ke(n.selectedItems),a=l=>{if(l.code===Lt.ESCAPE&&(t.modal.close(),t.root.focus()),!t.modal.visible){if(l.metaKey&&l.code===Lt.KEY_R&&!l.shiftKey&&(t.adapter.invalidateListQuery(r.value.path),t.adapter.open(r.value.path),l.preventDefault()),l.metaKey&&l.shiftKey&&l.code===Lt.KEY_R&&o("rename")&&s.value.length===1&&(t.modal.open(Qs,{items:s.value}),l.preventDefault()),l.code===Lt.DELETE&&s.value.length!==0&&t.modal.open(Gs,{items:s.value}),l.metaKey&&l.code===Lt.BACKSLASH&&t.modal.open(Vg),l.metaKey&&l.code===Lt.KEY_F&&o("search")&&(t.modal.open(yu),l.preventDefault()),l.metaKey&&l.code===Lt.KEY_E&&(i.toggle("showTreeView"),l.preventDefault()),l.metaKey&&l.code===Lt.KEY_S&&(t.modal.open(Jg),l.preventDefault()),l.metaKey&&l.code===Lt.ENTER&&(i.toggle("fullScreen"),t.root.focus()),l.metaKey&&l.code===Lt.KEY_A&&(n.selectAll(t.selectionMode||"multiple",t),l.preventDefault()),l.code===Lt.SPACE&&s.value.length===1&&s.value[0]?.type!=="dir"&&t.modal.open(lr,{storage:n.path.get().storage,item:s.value[0]}),l.metaKey&&l.code===Lt.KEY_C&&o("copy")){if(s.value.length===0){e.error(t.i18n.t("No items selected"));return}n.setClipboard("copy",new Set(s.value.map(c=>c.path))),e.success(s.value.length===1?t.i18n.t("Item copied to clipboard"):t.i18n.t("%s items copied to clipboard",s.value.length)),l.preventDefault()}if(l.metaKey&&l.code===Lt.KEY_X&&o("copy")){if(s.value.length===0){e.error(t.i18n.t("No items selected"));return}n.setClipboard("cut",new Set(s.value.map(c=>c.path))),e.success(s.value.length===1?t.i18n.t("Item cut to clipboard"):t.i18n.t("%s items cut to clipboard",s.value.length)),l.preventDefault()}if(l.metaKey&&l.code===Lt.KEY_V&&o("copy")){if(n.getClipboard().items.size===0){e.error(t.i18n.t("No items in clipboard"));return}if(n.getClipboard().path===n.path.get().path){e.error(t.i18n.t("Cannot paste items to the same directory"));return}if(n.getClipboard().type==="cut"){t.modal.open(uo,{items:{from:Array.from(n.getClipboard().items),to:n.path.get()}}),n.clearClipboard();return}if(n.getClipboard().type==="copy"){t.modal.open(gu,{items:{from:Array.from(n.getClipboard().items),to:n.path.get()}});return}l.preventDefault()}}};et(async()=>{if(await Ge(),!t.root){console.warn("app.root is not available. Event listeners will not be attached.");return}t.root.addEventListener("keydown",a)}),bs(()=>{t.root&&t.root.removeEventListener("keydown",a)})}function xL(){const t=H(!1),e=H([]);return{isDraggingExternal:t,externalFiles:e,handleDragEnter:n=>{n.preventDefault(),n.stopPropagation();const i=n.dataTransfer?.items;i&&Array.from(i).some(o=>o.kind==="file")&&(t.value=!0,n.isExternalDrag=!0)},handleDragOver:n=>{t.value&&n.dataTransfer&&(n.dataTransfer.dropEffect="copy",n.preventDefault(),n.stopPropagation())},handleDragLeave:n=>{n.preventDefault();const i=n.currentTarget.getBoundingClientRect(),o=n.clientX,r=n.clientY;(o<i.left||o>i.right||r<i.top||r>i.bottom)&&(t.value=!1)},handleDrop:async n=>{n.preventDefault(),n.stopPropagation(),t.value=!1;const i=n.dataTransfer?.items;if(i){const o=Array.from(i).filter(r=>r.kind==="file");if(o.length>0){e.value=[];for(const r of o){const s=r.webkitGetAsEntry?.();if(s)await du((a,l)=>{e.value.push({name:l.name,size:l.size,type:l.type,lastModified:new Date(l.lastModified),file:l})},s);else{const a=r.getAsFile();a&&e.value.push({name:a.name,size:a.size,type:a.type,lastModified:new Date(a.lastModified),file:a})}}return e.value}}return[]},clearExternalFiles:()=>{e.value=[]}}}const TL={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"};function OL(t,e){return y(),T("svg",TL,[...e[0]||(e[0]=[g("path",{d:"M12 10.5v6m3-3H9m4.06-7.19-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44z"},null,-1)])])}const Zg={render:OL},$L={class:"vuefinder__new-folder-modal__content"},kL={class:"vuefinder__new-folder-modal__form"},AL={class:"vuefinder__new-folder-modal__description"},PL=["placeholder"],bu=Se({__name:"ModalNewFolder",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=ke(o.path),s=H(""),a=()=>{s.value!==""&&e.adapter.createFolder({path:r.value.path,name:s.value}).then(l=>{n.success(i("%s is created.",s.value)),e.fs.setFiles(l.files),e.modal.close()}).catch(l=>{n.error(Yt(l,i("Failed to create folder")))})};return(l,c)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:a},L(m(i)("Create")),1),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:c[1]||(c[1]=u=>m(e).modal.close())},L(m(i)("Cancel")),1)]),default:we(()=>[g("div",null,[j(pn,{icon:m(Zg),title:m(i)("New Folder")},null,8,["icon","title"]),g("div",$L,[g("div",kL,[g("p",AL,L(m(i)("Create a new folder")),1),it(g("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>s.value=u),class:"vuefinder__new-folder-modal__input",placeholder:m(i)("Folder Name"),type:"text",autofocus:"",onKeyup:ho(a,["enter"])},null,40,PL),[[Go,s.value]])])])])]),_:1}))}}),RL={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"};function IL(t,e){return y(),T("svg",RL,[...e[0]||(e[0]=[g("path",{d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9"},null,-1)])])}const e_={render:IL},ML={class:"vuefinder__new-file-modal__content"},DL={class:"vuefinder__new-file-modal__form"},FL={class:"vuefinder__new-file-modal__description"},LL=["placeholder"],t_=Se({__name:"ModalNewFile",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=ke(o.path),s=H(""),a=()=>{s.value!==""&&e.adapter.createFile({path:r.value.path,name:s.value}).then(l=>{n.success(i("%s is created.",s.value)),e.fs.setFiles(l.files),e.modal.close()}).catch(l=>{n.error(Yt(l,i("Failed to create file")))})};return(l,c)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:a},L(m(i)("Create")),1),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:c[1]||(c[1]=u=>m(e).modal.close())},L(m(i)("Cancel")),1)]),default:we(()=>[g("div",null,[j(pn,{icon:m(e_),title:m(i)("New File")},null,8,["icon","title"]),g("div",ML,[g("div",DL,[g("p",FL,L(m(i)("Create a new file")),1),it(g("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>s.value=u),class:"vuefinder__new-file-modal__input",placeholder:m(i)("File Name"),type:"text",onKeyup:ho(a,["enter"])},null,40,LL),[[Go,s.value]])])])])]),_:1}))}}),jL={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"};function NL(t,e){return y(),T("svg",jL,[...e[0]||(e[0]=[g("path",{d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"},null,-1)])])}const n_={render:NL};function Xl(t,e=14){const n=`((?=([\\w\\W]{0,${e}}))([\\w\\W]{${e+1},})([\\w\\W]{8,}))`;return t.replace(new RegExp(n),"$2..$4")}const UL={class:"vuefinder__upload-modal__content relative"},zL={class:"vuefinder__upload-modal__target-section"},VL={class:"vuefinder__upload-modal__target-label"},BL={class:"vuefinder__upload-modal__target-container"},HL={class:"vuefinder__upload-modal__target-path"},qL={class:"vuefinder__upload-modal__target-storage"},WL={key:0,class:"vuefinder__upload-modal__target-folder"},KL={class:"vuefinder__upload-modal__target-badge"},YL={class:"vuefinder__upload-modal__drag-hint"},GL={class:"vuefinder__upload-modal__file-list vf-scrollbar"},QL=["textContent"],XL={class:"vuefinder__upload-modal__file-info"},JL={class:"vuefinder__upload-modal__file-name hidden md:block"},ZL={class:"vuefinder__upload-modal__file-name md:hidden"},e4={key:0,class:"ml-auto"},t4=["title","disabled","onClick"],n4={key:0,class:"py-2"},i4=["aria-expanded"],o4={key:0,class:"vuefinder__upload-actions__menu absolute right-0 bottom-full left-0 mb-2"},r4=["disabled"],s4=["aria-expanded"],a4={key:0,class:"vuefinder__upload-actions__menu"},wu=Se({__name:"ModalUpload",setup(t){const e=je(),{t:n}=e.i18n,i=e.fs,o=ke(i.path),r=H(o.value),s=H(!1),a=()=>{const Y=r.value.path;if(!Y)return{storage:"local",path:""};if(Y.endsWith("://"))return{storage:Y.replace("://",""),path:""};const I=Y.split("://");return{storage:I[0]||"local",path:I[1]||""}},l=Y=>{Y&&(r.value=Y)},c=Y=>{Y&&(r.value=Y,s.value=!1)},{container:u,internalFileInput:d,internalFolderInput:h,pickFiles:v,queue:f,message:p,uploading:_,hasFilesInDropArea:S,definitions:w,openFileSelector:E,upload:b,cancel:C,remove:x,clear:k,close:O,getClassNameForEntry:K,getIconForEntry:D,addExternalFiles:P}=qg(e.customUploader),U=()=>{b(r.value)};et(()=>{e.emitter.on("vf-external-files-dropped",Y=>{P(Y)})}),St(()=>{e.emitter.off("vf-external-files-dropped")});const M=H(!1),q=H(null),le=H(null),de=Y=>{if(!M.value)return;const I=Y.target,A=q.value?.contains(I)??!1,Q=le.value?.contains(I)??!1;!A&&!Q&&(M.value=!1)};return et(()=>document.addEventListener("click",de)),St(()=>document.removeEventListener("click",de)),(Y,I)=>(y(),ne(nn,{"show-drag-overlay":m(S),"drag-overlay-text":m(n)("Drag and drop the files/folders to here.")},{buttons:we(()=>[g("div",{ref_key:"actionsMenuMobileRef",ref:q,class:"relative mb-2 w-full sm:hidden"},[g("div",{class:Ae(["vuefinder__upload-actions","vuefinder__upload-actions--block",M.value?"vuefinder__upload-actions--ring":""])},[g("button",{type:"button",class:"vuefinder__upload-actions__main",onClick:I[3]||(I[3]=A=>m(E)())},L(m(n)("Select Files")),1),g("button",{type:"button",class:"vuefinder__upload-actions__trigger","aria-haspopup":"menu","aria-expanded":M.value?"true":"false",onClick:I[4]||(I[4]=Ye(A=>M.value=!M.value,["stop"]))},[...I[17]||(I[17]=[g("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor"},[g("path",{"fill-rule":"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z","clip-rule":"evenodd"})],-1)])],8,i4)],2),M.value?(y(),T("div",o4,[g("div",{class:"vuefinder__upload-actions__item",onClick:I[5]||(I[5]=A=>{m(E)(),M.value=!1})},L(m(n)("Select Files")),1),g("div",{class:"vuefinder__upload-actions__item",onClick:I[6]||(I[6]=A=>{m(h)?.click(),M.value=!1})},L(m(n)("Select Folders")),1),I[18]||(I[18]=g("div",{class:"vuefinder__upload-actions__separator"},null,-1)),g("div",{class:Ae(["vuefinder__upload-actions__item",m(_)?"disabled":""]),onClick:I[7]||(I[7]=A=>m(_)?null:(m(k)(!1),M.value=!1))},L(m(n)("Clear all")),3),g("div",{class:Ae(["vuefinder__upload-actions__item",m(_)?"disabled":""]),onClick:I[8]||(I[8]=A=>m(_)?null:(m(k)(!0),M.value=!1))},L(m(n)("Clear only successful")),3)])):ue("",!0)],512),g("button",{type:"button",class:"vf-btn vf-btn-primary",disabled:m(_)||!m(f).length,onClick:Ye(U,["prevent"])},L(m(n)("Upload")),9,r4),m(_)?(y(),T("button",{key:0,type:"button",class:"vf-btn vf-btn-secondary",onClick:I[9]||(I[9]=Ye((...A)=>m(C)&&m(C)(...A),["prevent"]))},L(m(n)("Cancel")),1)):(y(),T("button",{key:1,type:"button",class:"vf-btn vf-btn-secondary",onClick:I[10]||(I[10]=Ye((...A)=>m(O)&&m(O)(...A),["prevent"]))},L(m(n)("Close")),1)),g("div",{ref_key:"actionsMenuDesktopRef",ref:le,class:"relative mr-auto hidden sm:block"},[g("div",{class:Ae(["vuefinder__upload-actions",M.value?"vuefinder__upload-actions--ring":""])},[g("button",{ref_key:"pickFiles",ref:v,type:"button",class:"vuefinder__upload-actions__main"},L(m(n)("Select Files")),513),g("button",{type:"button",class:"vuefinder__upload-actions__trigger","aria-haspopup":"menu","aria-expanded":M.value?"true":"false",onClick:I[11]||(I[11]=Ye(A=>M.value=!M.value,["stop"]))},[...I[19]||(I[19]=[g("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor"},[g("path",{"fill-rule":"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z","clip-rule":"evenodd"})],-1)])],8,s4)],2),M.value?(y(),T("div",a4,[g("div",{class:"vuefinder__upload-actions__item",onClick:I[12]||(I[12]=A=>{m(E)(),M.value=!1})},L(m(n)("Select Files")),1),g("div",{class:"vuefinder__upload-actions__item",onClick:I[13]||(I[13]=A=>{m(h)?.click(),M.value=!1})},L(m(n)("Select Folders")),1),I[20]||(I[20]=g("div",{class:"vuefinder__upload-actions__separator"},null,-1)),g("div",{class:Ae(["vuefinder__upload-actions__item",m(_)?"disabled":""]),onClick:I[14]||(I[14]=A=>m(_)?null:(m(k)(!1),M.value=!1))},L(m(n)("Clear all")),3),g("div",{class:Ae(["vuefinder__upload-actions__item",m(_)?"disabled":""]),onClick:I[15]||(I[15]=A=>m(_)?null:(m(k)(!0),M.value=!1))},L(m(n)("Clear only successful")),3)])):ue("",!0)],512)]),default:we(()=>[g("div",null,[j(pn,{icon:m(n_),title:m(n)("Upload Files")},null,8,["icon","title"]),g("div",UL,[g("div",zL,[g("div",VL,L(m(n)("Target Directory")),1),g("div",BL,[g("div",{class:"vuefinder__upload-modal__target-display",onClick:I[0]||(I[0]=A=>s.value=!s.value)},[g("div",HL,[g("span",qL,L(a().storage)+"://",1),a().path?(y(),T("span",WL,L(a().path),1)):ue("",!0)]),g("span",KL,L(m(n)("Browse")),1)])]),g("div",{class:Ae(["vuefinder__upload-modal__tree-selector",s.value?"vuefinder__upload-modal__tree-selector--expanded":"vuefinder__upload-modal__tree-selector--collapsed"])},[j(vu,{modelValue:r.value,"onUpdate:modelValue":[I[1]||(I[1]=A=>r.value=A),l],"show-pinned-folders":!0,onSelectAndClose:c},null,8,["modelValue"])],2)]),g("div",YL,L(m(n)("You can drag & drop files anywhere while this modal is open.")),1),g("div",{ref_key:"container",ref:u,class:"hidden"},null,512),g("div",GL,[(y(!0),T(Ie,null,He(m(f),A=>(y(),T("div",{key:A.id,class:"vuefinder__upload-modal__file-entry"},[g("span",{class:Ae(["vuefinder__upload-modal__file-icon",m(K)(A)])},[g("span",{class:"vuefinder__upload-modal__file-icon-text",textContent:L(m(D)(A))},null,8,QL)],2),g("div",XL,[g("div",JL,L(m(Xl)(A.name,40))+" ("+L(A.size)+") ",1),g("div",ZL,L(m(Xl)(A.name,16))+" ("+L(A.size)+") ",1),g("div",{class:Ae(["vuefinder__upload-modal__file-status",m(K)(A)])},[Ke(L(A.statusName)+" ",1),A.status===m(w).QUEUE_ENTRY_STATUS.UPLOADING?(y(),T("b",e4,L(A.percent),1)):ue("",!0)],2)]),g("button",{type:"button",class:Ae(["vuefinder__upload-modal__file-remove",m(_)?"disabled":""]),title:m(n)("Delete"),disabled:m(_),onClick:Q=>m(x)(A)},[...I[16]||(I[16]=[g("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"vuefinder__upload-modal__file-remove-icon"},[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])],10,t4)]))),128)),m(f).length?ue("",!0):(y(),T("div",n4,L(m(n)("No files selected!")),1))]),m(p).length?(y(),ne(Ql,{key:0,error:"",onHidden:I[2]||(I[2]=A=>p.value="")},{default:we(()=>[Ke(L(m(p)),1)]),_:1})):ue("",!0)])]),g("input",{ref_key:"internalFileInput",ref:d,type:"file",multiple:"",class:"hidden"},null,512),g("input",{ref_key:"internalFolderInput",ref:h,type:"file",multiple:"",webkitdirectory:"",class:"hidden"},null,512)]),_:1},8,["show-drag-overlay","drag-overlay-text"]))}}),l4={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"};function c4(t,e){return y(),T("svg",l4,[...e[0]||(e[0]=[g("path",{d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m6 4.125 2.25 2.25m0 0 2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125"},null,-1)])])}const i_={render:c4},u4={class:"vuefinder__unarchive-modal__content"},d4={class:"vuefinder__unarchive-modal__items"},h4={key:0,class:"vuefinder__unarchive-modal__icon vuefinder__unarchive-modal__icon--dir",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},p4={key:1,class:"vuefinder__unarchive-modal__icon vuefinder__unarchive-modal__icon--file",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},f4={class:"vuefinder__unarchive-modal__item-name"},m4={class:"vuefinder__unarchive-modal__info"},Eu=Se({__name:"ModalUnarchive",setup(t){const e=je(),n=Gt(e),i=e.fs,o=ke(i.path),{t:r}=e.i18n,s=H(e.modal.data.items[0]),a=H([]),l=()=>{e.adapter.unarchive({item:s.value.path,path:o.value.path}).then(c=>{n.success(r("The file unarchived.")),e.fs.setFiles(c.files),e.modal.close()}).catch(c=>{n.error(Yt(c,r("Failed to unarchive")))})};return(c,u)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:l},L(m(r)("Unarchive")),1),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:u[0]||(u[0]=d=>m(e).modal.close())},L(m(r)("Cancel")),1)]),default:we(()=>[g("div",null,[j(pn,{icon:m(i_),title:m(r)("Unarchive")},null,8,["icon","title"]),g("div",u4,[g("div",d4,[(y(!0),T(Ie,null,He(a.value,d=>(y(),T("p",{key:d.path,class:"vuefinder__unarchive-modal__item"},[d.type==="dir"?(y(),T("svg",h4,[...u[1]||(u[1]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])])):(y(),T("svg",p4,[...u[2]||(u[2]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)])])),g("span",f4,L(d.basename),1)]))),128)),g("p",m4,L(m(r)("The archive will be unarchived at"))+" ("+L(m(o).path)+") ",1)])])])]),_:1}))}}),v4={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",viewBox:"0 0 24 24"};function g4(t,e){return y(),T("svg",v4,[...e[0]||(e[0]=[g("path",{d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125"},null,-1)])])}const o_={render:g4},_4={class:"vuefinder__archive-modal__content"},y4={class:"vuefinder__archive-modal__form"},b4={class:"vuefinder__archive-modal__files vf-scrollbar"},w4={key:0,class:"vuefinder__archive-modal__icon vuefinder__archive-modal__icon--dir",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},E4={key:1,class:"vuefinder__archive-modal__icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},S4={class:"vuefinder__archive-modal__file-name"},C4=["placeholder"],Su=Se({__name:"ModalArchive",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=ke(o.path),s=H(""),a=H(e.modal.data.items),l=()=>{a.value.length&&e.adapter.archive({path:r.value.path,items:a.value.map(({path:c,type:u})=>({path:c,type:u})),name:s.value}).then(c=>{n.success(i("The file(s) archived.")),e.fs.setFiles(c.files),e.modal.close()}).catch(c=>{n.error(Yt(c,i("Failed to archive files")))})};return(c,u)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:l},L(m(i)("Archive")),1),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:u[1]||(u[1]=d=>m(e).modal.close())},L(m(i)("Cancel")),1)]),default:we(()=>[g("div",null,[j(pn,{icon:m(o_),title:m(i)("Archive the files")},null,8,["icon","title"]),g("div",_4,[g("div",y4,[g("div",b4,[(y(!0),T(Ie,null,He(a.value,d=>(y(),T("p",{key:d.path,class:"vuefinder__archive-modal__file"},[d.type==="dir"?(y(),T("svg",w4,[...u[2]||(u[2]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])])):(y(),T("svg",E4,[...u[3]||(u[3]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)])])),g("span",S4,L(d.basename),1)]))),128))]),it(g("input",{"onUpdate:modelValue":u[0]||(u[0]=d=>s.value=d),class:"vuefinder__archive-modal__input",placeholder:m(i)("Archive name. (.zip file will be created)"),type:"text",onKeyup:ho(l,["enter"])},null,40,C4),[[Go,s.value]])])])])]),_:1}))}}),x4={class:"vuefinder__about-modal__content"},T4={class:"vuefinder__about-modal__main"},O4={class:"vuefinder__about-modal__shortcuts"},$4={class:"vuefinder__about-modal__shortcut"},k4={key:0,class:"vuefinder__about-modal__shortcut"},A4={key:1,class:"vuefinder__about-modal__shortcut"},P4={class:"vuefinder__about-modal__shortcut"},R4={class:"vuefinder__about-modal__shortcut"},I4={key:2,class:"vuefinder__about-modal__shortcut"},M4={key:3,class:"vuefinder__about-modal__shortcut"},D4={key:4,class:"vuefinder__about-modal__shortcut"},F4={key:5,class:"vuefinder__about-modal__shortcut"},L4={class:"vuefinder__about-modal__shortcut"},j4={class:"vuefinder__about-modal__shortcut"},N4={key:6,class:"vuefinder__about-modal__shortcut"},U4={key:7,class:"vuefinder__about-modal__shortcut"},z4=Se({__name:"ModalShortcuts",setup(t){const e=je(),{enabled:n}=Tn(),{t:i}=e.i18n;return(o,r)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:r[0]||(r[0]=s=>m(e).modal.close())},L(m(i)("Close")),1)]),default:we(()=>[g("div",x4,[j(pn,{icon:m(zg),title:m(i)("Shortcuts")},null,8,["icon","title"]),g("div",T4,[g("div",O4,[g("div",$4,[g("div",null,L(m(i)("Refresh")),1),r[1]||(r[1]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"R")],-1))]),m(n)("rename")?(y(),T("div",k4,[g("div",null,L(m(i)("Rename")),1),r[2]||(r[2]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"Shift"),Ke(" + "),g("kbd",null,"R")],-1))])):ue("",!0),m(n)("delete")?(y(),T("div",A4,[g("div",null,L(m(i)("Delete")),1),r[3]||(r[3]=g("kbd",null,"Del",-1))])):ue("",!0),g("div",P4,[g("div",null,L(m(i)("Escape")),1),r[4]||(r[4]=g("kbd",null,"Esc",-1))]),g("div",R4,[g("div",null,L(m(i)("Select All")),1),r[5]||(r[5]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"A")],-1))]),m(n)("copy")?(y(),T("div",I4,[g("div",null,L(m(i)("Cut")),1),r[6]||(r[6]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"X")],-1))])):ue("",!0),m(n)("copy")?(y(),T("div",M4,[g("div",null,L(m(i)("Copy")),1),r[7]||(r[7]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"C")],-1))])):ue("",!0),m(n)("copy")?(y(),T("div",D4,[g("div",null,L(m(i)("Paste")),1),r[8]||(r[8]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"V")],-1))])):ue("",!0),m(n)("search")?(y(),T("div",F4,[g("div",null,L(m(i)("Search")),1),r[9]||(r[9]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"F")],-1))])):ue("",!0),g("div",L4,[g("div",null,L(m(i)("Toggle Sidebar")),1),r[10]||(r[10]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"E")],-1))]),g("div",j4,[g("div",null,L(m(i)("Open Settings")),1),r[11]||(r[11]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"S")],-1))]),m(n)("fullscreen")?(y(),T("div",N4,[g("div",null,L(m(i)("Toggle Full Screen")),1),r[12]||(r[12]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"Enter")],-1))])):ue("",!0),m(n)("preview")?(y(),T("div",U4,[g("div",null,L(m(i)("Preview")),1),r[13]||(r[13]=g("kbd",null,"Space",-1))])):ue("",!0)])])])]),_:1}))}}),V4={class:"vuefinder__menubar__container"},B4=["onClick","onMouseenter"],H4={class:"vuefinder__menubar__label"},q4=["onMouseenter"],W4=["onClick"],K4={key:0,class:"vuefinder__menubar__dropdown__label"},Y4={key:1,class:"vuefinder__menubar__dropdown__checkmark"},G4=Se({__name:"MenuBar",setup(t){const e=je(),n=Gt(e),{enabled:i}=Tn(),{t:o}=e?.i18n||{t:E=>E},r=e?.fs,s=e?.config,a=ke(s.state),l=ke(r.selectedItems),c=ke(r?.storages||[]),u=H(null),d=H(!1),h=te(()=>window.opener!==null||window.name!==""||window.history.length<=1),v=te(()=>[{id:"file",label:o("File"),items:[{id:"new-folder",label:o("New Folder"),action:()=>e?.modal?.open(bu,{items:l.value}),hidden:()=>!i("newfolder")},{id:"new-file",label:o("New File"),action:()=>e?.modal?.open(t_,{items:l.value}),hidden:()=>!i("newfile")},{type:"separator",hidden:()=>!i("newfolder")&&!i("newfile")||!i("upload")},{id:"upload",label:o("Upload"),action:()=>e?.modal?.open(wu,{items:l.value}),hidden:()=>!i("upload")},{type:"separator",hidden:()=>!i("search")},{id:"search",label:o("Search"),action:()=>e.modal.open(yu),hidden:()=>!i("search")},{type:"separator",hidden:()=>!i("archive")&&!i("unarchive")},{id:"archive",label:o("Archive"),action:()=>{l.value.length>0&&e?.modal?.open(Su,{items:l.value})},enabled:()=>l.value.length>0,hidden:()=>!i("archive")},{id:"unarchive",label:o("Unarchive"),action:()=>{l.value.length===1&&l.value[0]?.mime_type==="application/zip"&&e?.modal?.open(Eu,{items:l.value})},enabled:()=>l.value.length===1&&l.value[0]?.mime_type==="application/zip",hidden:()=>!i("unarchive")},{type:"separator",hidden:()=>!i("preview")},{id:"preview",label:o("Preview"),action:()=>{l.value.length===1&&l.value[0]?.type!=="dir"&&e?.modal?.open(lr,{storage:r?.path?.get()?.storage,item:l.value[0]})},enabled:()=>l.value.length===1&&l.value[0]?.type!=="dir",hidden:()=>!i("preview")},...h.value?[{type:"separator"},{id:"exit",label:o("Exit"),action:()=>{try{window.close()}catch{}},enabled:()=>!0}]:[]]},{id:"edit",label:o("Edit"),items:[...e?.selectionMode==="multiple"?[{id:"select-all",label:o("Select All"),action:()=>r?.selectAll(e?.selectionMode||"multiple",e),enabled:()=>!0},{id:"deselect",label:o("Deselect All"),action:()=>r?.clearSelection(),enabled:()=>l.value.length>0},{type:"separator"}]:[],...i("copy")?[{id:"cut",label:o("Cut"),action:()=>{l.value.length>0&&r?.setClipboard("cut",new Set(l.value.map(E=>E.path)))},enabled:()=>l.value.length>0},{id:"copy",label:o("Copy"),action:()=>{l.value.length>0&&r?.setClipboard("copy",new Set(l.value.map(E=>E.path)))},enabled:()=>l.value.length>0},{id:"paste",label:o("Paste"),action:()=>{const E=r?.getClipboard();E?.items?.size>0&&e?.modal?.open(E.type==="cut"?uo:gu,{items:{from:Array.from(E.items),to:r?.path?.get()}})},enabled:()=>r?.getClipboard()?.items?.size>0}]:[],...i("move")?[{id:"move",label:o("Move files"),action:()=>{if(l.value.length>0){const E=e?.fs,b={storage:E?.path?.get()?.storage||"",path:E?.path?.get()?.path||"",type:"dir"};e?.modal?.open(uo,{items:{from:l.value,to:b}})}},enabled:()=>l.value.length>0},{type:"separator"}]:[],{id:"copy-path",label:o("Copy Path"),action:async()=>{if(l.value.length===1){const E=l.value[0];await Wo(E.path)}else{const E=r?.path?.get();E?.path&&await Wo(E.path)}},enabled:()=>!0},{id:"copy-download-url",label:o("Copy Download URL"),action:async()=>{if(l.value.length===1){const E=l.value[0];r?.path?.get()?.storage;const b=e?.adapter?.getDownloadUrl({path:E.path});b&&await $5(b)}},enabled:()=>l.value.length===1&&l.value[0]?.type!=="dir"},{type:"separator",hidden:()=>!i("rename")&&!i("delete")},{id:"rename",label:o("Rename"),action:()=>{l.value.length===1&&e?.modal?.open(Qs,{items:l.value})},enabled:()=>l.value.length===1,hidden:()=>!i("rename")},{id:"delete",label:o("Delete"),action:()=>{l.value.length>0&&e?.modal?.open(Gs,{items:l.value})},enabled:()=>l.value.length>0,hidden:()=>!i("delete")}]},{id:"view",label:o("View"),items:[{id:"refresh",label:o("Refresh"),action:()=>{e.adapter.invalidateListQuery(r.path.get().path),e.adapter.open(r.path.get().path)},enabled:()=>!0},{type:"separator"},{id:"grid-view",label:o("Grid View"),action:()=>s?.set("view","grid"),enabled:()=>!0,checked:()=>a.value?.view==="grid"},{id:"list-view",label:o("List View"),action:()=>s?.set("view","list"),enabled:()=>!0,checked:()=>a.value?.view==="list"},{type:"separator"},{id:"tree-view",label:o("Tree View"),action:()=>s?.toggle("showTreeView"),enabled:()=>!0,checked:()=>a.value?.showTreeView},{id:"thumbnails",label:o("Show Thumbnails"),action:()=>s?.toggle("showThumbnails"),enabled:()=>!0,checked:()=>a.value?.showThumbnails},{id:"show-hidden-files",label:o("Show Hidden Files"),action:()=>s?.toggle("showHiddenFiles"),enabled:()=>!0,checked:()=>a.value?.showHiddenFiles},{type:"separator",hidden:()=>!i("fullscreen")},{id:"fullscreen",label:o("Full Screen"),action:()=>s?.toggle("fullScreen"),enabled:()=>i("fullscreen"),checked:()=>a.value?.fullScreen,hidden:()=>!i("fullscreen")},{type:"separator"},{id:"persist-path",label:o("Persist Path"),action:()=>{s?.toggle("persist"),e.emitter.emit("vf-persist-path-saved")},enabled:()=>!0,checked:()=>a.value?.persist},{id:"metric-units",label:o("Metric Units"),action:()=>{s?.toggle("metricUnits"),e.filesize=s?.get("metricUnits")?jg:uu,e.emitter.emit("vf-metric-units-saved")},enabled:()=>!0,checked:()=>a.value?.metricUnits}]},{id:"go",label:o("Go"),items:[...i("history")?[{id:"forward",label:o("Forward"),action:()=>{r?.goForward();const E=r?.path?.get();E?.path&&e?.adapter.open(E.path)},enabled:()=>r?.canGoForward?.get()??!1},{id:"back",label:o("Back"),action:()=>{r?.goBack();const E=r?.path?.get();E?.path&&e?.adapter.open(E.path)},enabled:()=>r?.canGoBack?.get()??!1}]:[],{id:"open-containing-folder",label:o("Open containing folder"),action:()=>{const E=r?.path?.get();if(E?.breadcrumb&&E.breadcrumb.length>1){const b=E.breadcrumb[E.breadcrumb.length-2]?.path??`${E.storage}://`;e?.adapter.open(b)}},enabled:()=>{const E=r?.path?.get();return E?.breadcrumb&&E.breadcrumb.length>1}},{type:"separator"},...(c.value||[]).map(E=>({id:`storage-${E}`,label:E,action:()=>{const b=`${E}://`;e?.adapter.open(b)},enabled:()=>!0})),{type:"separator"},{id:"go-to-folder",label:o("Go to Folder"),action:async()=>{const E=prompt(o("Enter folder path:"));if(E){if(!E.includes("://")){alert(o("Invalid path format. Path must be in format: storage://path/to/folder"));return}const b=E.indexOf("://"),C=E.slice(0,b);if(!c.value||!c.value.includes(C)){alert(o('Invalid storage. Storage "%s" is not available.',C));return}try{await e?.adapter.open(E)}catch(x){const k=Yt(x,o("Failed to navigate to folder"));n.error(k),e.fs.setLoading(!1)}}},enabled:()=>!0}]},{id:"help",label:o("Help"),items:[{id:"settings",label:o("Settings"),action:()=>e?.modal?.open(Jg),enabled:()=>!0},{id:"shortcuts",label:o("Shortcuts"),action:()=>e?.modal?.open(z4),enabled:()=>!0},{id:"about",label:o("About"),action:()=>e?.modal?.open(Vg),enabled:()=>!0}]}]),f=E=>{u.value===E?_():(u.value=E,d.value=!0)},p=E=>{d.value&&(u.value=E)},_=()=>{u.value=null,d.value=!1},S=E=>{_(),E()},w=E=>{E.target.closest(".vuefinder__menubar")||_()};return et(()=>{document.addEventListener("click",w)}),St(()=>{document.removeEventListener("click",w)}),(E,b)=>(y(),T("div",{class:"vuefinder__menubar",onClick:b[0]||(b[0]=Ye(()=>{},["stop"]))},[g("div",V4,[(y(!0),T(Ie,null,He(v.value,C=>(y(),T("div",{key:C.id,class:Ae(["vuefinder__menubar__item",{"vuefinder__menubar__item--active":u.value===C.id}]),onClick:x=>f(C.id),onMouseenter:x=>p(C.id)},[g("span",H4,L(C.label),1),u.value===C.id?(y(),T("div",{key:0,class:"vuefinder__menubar__dropdown",onMouseenter:x=>p(C.id)},[(y(!0),T(Ie,null,He(C.items,x=>(y(),T("div",{key:x.id||x.type,class:Ae(["vuefinder__menubar__dropdown__item",{"vuefinder__menubar__dropdown__item--separator":x.type==="separator","vuefinder__menubar__dropdown__item--disabled":x.enabled&&!x.enabled(),"vuefinder__menubar__dropdown__item--checked":x.checked&&x.checked(),"vuefinder__menubar__dropdown__item--hidden":x.hidden&&x.hidden()}]),onClick:Ye(k=>x.type!=="separator"&&x.enabled&&x.enabled()?S(x.action):null,["stop"])},[x.type!=="separator"?(y(),T("span",K4,L(x.label),1)):ue("",!0),x.checked&&x.checked()?(y(),T("span",Y4," ✓ ")):ue("",!0)],10,W4))),128))],40,q4)):ue("",!0)],42,B4))),128))])]))}}),Q4={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",viewBox:"0 0 24 24"};function X4(t,e){return y(),T("svg",Q4,[...e[0]||(e[0]=[g("path",{d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"},null,-1)])])}const J4={render:X4},Z4={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"};function ej(t,e){return y(),T("svg",Z4,[...e[0]||(e[0]=[g("path",{d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"},null,-1)])])}const tj={render:ej},nj={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"};function ij(t,e){return y(),T("svg",nj,[...e[0]||(e[0]=[g("path",{d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25zm0 9.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18zM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25zm0 9.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18z"},null,-1)])])}const oj={render:ij},rj={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"};function sj(t,e){return y(),T("svg",rj,[...e[0]||(e[0]=[g("path",{d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 0 1 0 3.75H5.625a1.875 1.875 0 0 1 0-3.75"},null,-1)])])}const aj={render:sj},lj={fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function cj(t,e){return y(),T("svg",lj,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3 4a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v2.586a1 1 0 0 1-.293.707l-6.414 6.414a1 1 0 0 0-.293.707V17l-4 4v-6.586a1 1 0 0 0-.293-.707L3.293 7.293A1 1 0 0 1 3 6.586z"},null,-1)])])}const uj={render:cj},dj={class:"vuefinder__toolbar"},hj={class:"vuefinder__toolbar__actions"},pj=["title"],fj=["title"],mj=["title"],vj=["title"],gj=["title"],_j=["title"],yj=["title"],bj={class:"vuefinder__toolbar__controls"},wj=["title"],Ej={class:"vuefinder__toolbar__control vuefinder__toolbar__dropdown-container"},Sj=["title"],Cj={class:"relative"},xj={key:0,class:"vuefinder__toolbar__filter-indicator"},Tj={key:0,class:"vuefinder__toolbar__dropdown"},Oj={class:"vuefinder__toolbar__dropdown-content"},$j={class:"vuefinder__toolbar__dropdown-section"},kj={class:"vuefinder__toolbar__dropdown-label"},Aj={class:"vuefinder__toolbar__dropdown-row"},Pj={value:"name"},Rj={value:"size"},Ij={value:"modified"},Mj={value:""},Dj={value:"asc"},Fj={value:"desc"},Lj={class:"vuefinder__toolbar__dropdown-section"},jj={class:"vuefinder__toolbar__dropdown-label"},Nj={class:"vuefinder__toolbar__dropdown-options"},Uj={class:"vuefinder__toolbar__dropdown-option"},zj={class:"vuefinder__toolbar__option-text"},Vj={class:"vuefinder__toolbar__dropdown-option"},Bj={class:"vuefinder__toolbar__option-text"},Hj={class:"vuefinder__toolbar__dropdown-option"},qj={class:"vuefinder__toolbar__option-text"},Wj={class:"vuefinder__toolbar__dropdown-toggle"},Kj={for:"showHidden",class:"vuefinder__toolbar__toggle-label"},Yj={class:"vuefinder__toolbar__dropdown-reset"},Gj=["title"],Qj=["title"],Xj=Se({name:"VfToolbar",__name:"Toolbar",setup(t){const e=je(),{enabled:n}=Tn(),{t:i}=e.i18n,o=e.fs,r=e.config,s=ke(r.state),a=ke(o.selectedItems),l=ke(o.sort),c=ke(o.filter);Oe(()=>s.value.fullScreen,()=>{const _=document.querySelector("body");_&&(_.style.overflow=s.value.fullScreen?"hidden":"")},{immediate:!0});const u=H(!1),d=_=>{_.target.closest(".vuefinder__toolbar__dropdown-container")||(u.value=!1)};et(()=>{const _=document.querySelector("body");_&&s.value.fullScreen&&setTimeout(()=>_.style.overflow="hidden"),document.addEventListener("click",d)}),St(()=>{document.removeEventListener("click",d)});const h=H({sortBy:"name",sortOrder:"",filterKind:"all",showHidden:s.value.showHiddenFiles});Oe(()=>h.value.sortBy,_=>{if(!h.value.sortOrder){o.clearSort();return}_==="name"?o.setSort("basename",h.value.sortOrder):_==="size"?o.setSort("file_size",h.value.sortOrder):_==="modified"&&o.setSort("last_modified",h.value.sortOrder)}),Oe(()=>h.value.sortOrder,_=>{if(!_){o.clearSort();return}h.value.sortBy==="name"?o.setSort("basename",_):h.value.sortBy==="size"?o.setSort("file_size",_):h.value.sortBy==="modified"&&o.setSort("last_modified",_)}),Oe(l,_=>{_.active?(_.column==="basename"?h.value.sortBy="name":_.column==="file_size"?h.value.sortBy="size":_.column==="last_modified"&&(h.value.sortBy="modified"),h.value.sortOrder=_.order):h.value.sortOrder=""},{immediate:!0}),Oe(()=>h.value.filterKind,_=>{o.setFilter(_,s.value.showHiddenFiles)}),Oe(()=>h.value.showHidden,_=>{r.set("showHiddenFiles",_),o.setFilter(h.value.filterKind,_)}),Oe(c,_=>{h.value.filterKind=_.kind},{immediate:!0}),Oe(()=>s.value.showHiddenFiles,_=>{h.value.showHidden=_,o.setFilter(h.value.filterKind,_)},{immediate:!0});const v=()=>r.set("view",s.value.view==="grid"?"list":"grid"),f=te(()=>c.value.kind!=="all"||!s.value.showHiddenFiles||l.value.active),p=()=>{h.value={sortBy:"name",sortOrder:"",filterKind:"all",showHidden:!0},r.set("showHiddenFiles",!0),o.clearSort(),o.clearFilter()};return(_,S)=>(y(),T("div",dj,[g("div",hj,[m(n)("newfolder")?(y(),T("div",{key:0,class:"mx-1.5",title:m(i)("New Folder"),onClick:S[0]||(S[0]=w=>m(e).modal.open(bu,{items:m(a)}))},[j(m(Zg))],8,pj)):ue("",!0),m(n)("newfile")?(y(),T("div",{key:1,class:"mx-1.5",title:m(i)("New File"),onClick:S[1]||(S[1]=w=>m(e).modal.open(t_,{items:m(a)}))},[j(m(e_))],8,fj)):ue("",!0),m(n)("rename")?(y(),T("div",{key:2,class:"mx-1.5",title:m(i)("Rename"),onClick:S[2]||(S[2]=w=>m(a).length!==1||m(e).modal.open(Qs,{items:m(a)}))},[j(m(Hg),{class:Ae(m(a).length===1?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,mj)):ue("",!0),m(n)("delete")?(y(),T("div",{key:3,class:"mx-1.5",title:m(i)("Delete"),onClick:S[3]||(S[3]=w=>!m(a).length||m(e).modal.open(Gs,{items:m(a)}))},[j(m(Bg),{class:Ae(m(a).length?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,vj)):ue("",!0),m(n)("upload")?(y(),T("div",{key:4,class:"mx-1.5",title:m(i)("Upload"),onClick:S[4]||(S[4]=w=>m(e).modal.open(wu,{items:m(a)}))},[j(m(n_))],8,gj)):ue("",!0),m(n)("unarchive")&&m(a).length===1&&m(a)[0].mime_type==="application/zip"?(y(),T("div",{key:5,class:"mx-1.5",title:m(i)("Unarchive"),onClick:S[5]||(S[5]=w=>!m(a).length||m(e).modal.open(Eu,{items:m(a)}))},[j(m(i_),{class:Ae(m(a).length?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,_j)):ue("",!0),m(n)("archive")?(y(),T("div",{key:6,class:"mx-1.5",title:m(i)("Archive"),onClick:S[6]||(S[6]=w=>!m(a).length||m(e).modal.open(Su,{items:m(a)}))},[j(m(o_),{class:Ae(m(a).length?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,yj)):ue("",!0)]),g("div",bj,[m(n)("search")?(y(),T("div",{key:0,class:"mx-1.5",title:m(i)("Search Files"),onClick:S[7]||(S[7]=w=>m(e).modal.open(yu))},[j(m(_u),{class:"vf-toolbar-icon text-(--vf-bg-primary)"})],8,wj)):ue("",!0),g("div",Ej,[g("div",{title:m(i)("Filter"),class:"vuefinder__toolbar__dropdown-trigger",onClick:S[8]||(S[8]=w=>u.value=!u.value)},[g("div",Cj,[j(m(uj),{class:"vf-toolbar-icon vuefinder__toolbar__icon h-6 w-6"}),f.value?(y(),T("div",xj)):ue("",!0)])],8,Sj),u.value?(y(),T("div",Tj,[g("div",Oj,[g("div",$j,[g("div",kj,L(m(i)("Sorting")),1),g("div",Aj,[it(g("select",{"onUpdate:modelValue":S[9]||(S[9]=w=>h.value.sortBy=w),class:"vuefinder__toolbar__dropdown-select"},[g("option",Pj,L(m(i)("Name")),1),g("option",Rj,L(m(i)("Size")),1),g("option",Ij,L(m(i)("Date")),1)],512),[[Za,h.value.sortBy]]),it(g("select",{"onUpdate:modelValue":S[10]||(S[10]=w=>h.value.sortOrder=w),class:"vuefinder__toolbar__dropdown-select"},[g("option",Mj,L(m(i)("None")),1),g("option",Dj,L(m(i)("Asc")),1),g("option",Fj,L(m(i)("Desc")),1)],512),[[Za,h.value.sortOrder]])])]),g("div",Lj,[g("div",jj,L(m(i)("Show")),1),g("div",Nj,[g("label",Uj,[it(g("input",{"onUpdate:modelValue":S[11]||(S[11]=w=>h.value.filterKind=w),type:"radio",name:"filterKind",value:"all",class:"vuefinder__toolbar__radio"},null,512),[[ea,h.value.filterKind]]),g("span",zj,L(m(i)("All items")),1)]),g("label",Vj,[it(g("input",{"onUpdate:modelValue":S[12]||(S[12]=w=>h.value.filterKind=w),type:"radio",name:"filterKind",value:"files",class:"vuefinder__toolbar__radio"},null,512),[[ea,h.value.filterKind]]),g("span",Bj,L(m(i)("Files only")),1)]),g("label",Hj,[it(g("input",{"onUpdate:modelValue":S[13]||(S[13]=w=>h.value.filterKind=w),type:"radio",name:"filterKind",value:"folders",class:"vuefinder__toolbar__radio"},null,512),[[ea,h.value.filterKind]]),g("span",qj,L(m(i)("Folders only")),1)])])]),g("div",Wj,[g("label",Kj,L(m(i)("Show hidden files")),1),it(g("input",{id:"showHidden","onUpdate:modelValue":S[14]||(S[14]=w=>h.value.showHidden=w),type:"checkbox",class:"vuefinder__toolbar__checkbox"},null,512),[[Es,h.value.showHidden]])]),g("div",Yj,[g("button",{class:"vuefinder__toolbar__reset-button",onClick:p},L(m(i)("Reset")),1)])])])):ue("",!0)]),m(n)("fullscreen")?(y(),T("div",{key:1,class:"mx-1.5",title:m(i)("Toggle Full Screen"),onClick:S[15]||(S[15]=w=>m(r).toggle("fullScreen"))},[m(s).fullScreen?(y(),ne(m(tj),{key:0,class:"vf-toolbar-icon"})):(y(),ne(m(J4),{key:1,class:"vf-toolbar-icon"}))],8,Gj)):ue("",!0),g("div",{class:"mx-1.5",title:m(i)("Change View"),onClick:S[16]||(S[16]=w=>v())},[m(s).view==="grid"?(y(),ne(m(oj),{key:0,class:"vf-toolbar-icon"})):ue("",!0),m(s).view==="list"?(y(),ne(m(aj),{key:1,class:"vf-toolbar-icon"})):ue("",!0)],8,Qj)])]))}}),Jj={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"vuefinder__breadcrumb__refresh-icon",viewBox:"-40 -40 580 580"};function Zj(t,e){return y(),T("svg",Jj,[...e[0]||(e[0]=[g("path",{d:"M463.5 224h8.5c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2S461.9 48.1 455 55l-41.6 41.6c-87.6-86.5-228.7-86.2-315.8 1-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2S334.3 224 344 224z"},null,-1)])])}const e3={render:Zj},t3={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-6 w-6 p-0.5 rounded",viewBox:"0 0 20 20"};function n3(t,e){return y(),T("svg",t3,[...e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M5.293 9.707a1 1 0 0 1 0-1.414l4-4a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1-1.414 1.414L11 7.414V15a1 1 0 1 1-2 0V7.414L6.707 9.707a1 1 0 0 1-1.414 0",class:"pointer-events-none","clip-rule":"evenodd"},null,-1)])])}const i3={render:n3},o3={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"vuefinder__breadcrumb__close-icon",viewBox:"0 0 24 24"};function r3(t,e){return y(),T("svg",o3,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"},null,-1)])])}const s3={render:r3},a3={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"};function l3(t,e){return y(),T("svg",a3,[...e[0]||(e[0]=[g("path",{d:"M10.707 2.293a1 1 0 0 0-1.414 0l-7 7a1 1 0 0 0 1.414 1.414L4 10.414V17a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-6.586l.293.293a1 1 0 0 0 1.414-1.414z",class:"pointer-events-none"},null,-1)])])}const c3={render:l3},u3={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"w-6 h-6 cursor-pointer",viewBox:"0 0 24 24"};function d3(t,e){return y(),T("svg",u3,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"},null,-1)])])}const h3={render:d3},p3={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"};function f3(t,e){return y(),T("svg",p3,[...e[0]||(e[0]=[g("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M9 6h11M12 12h8M15 18h5M5 6v.01M8 12v.01M11 18v.01"},null,-1)])])}const m3={render:f3},v3={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function g3(t,e){return y(),T("svg",v3,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7h12m0 0-4-4m4 4-4 4m0 6H4m0 0 4 4m-4-4 4-4"},null,-1)])])}const _3={render:g3};function cr(t,e=[]){const n="vfDragEnterCounter",i=t.fs,o=ke(i.selectedItems);function r(d,h){return!!(!d||d.type!=="dir"||d.path.startsWith(h)||o.value.some(v=>v.path===h?!1:!!d.path.startsWith(v.path)))}function s(d,h){if(d.isExternalDrag)return;if(!(t.features?.move??!1)){d.dataTransfer&&(d.dataTransfer.dropEffect="none",d.dataTransfer.effectAllowed="none");return}d.preventDefault();const v=i.getDraggedItem();r(h,v)?d.dataTransfer&&(d.dataTransfer.dropEffect="none",d.dataTransfer.effectAllowed="none"):(d.dataTransfer&&(d.dataTransfer.dropEffect="copy",d.dataTransfer.effectAllowed="all"),d.currentTarget.classList.add(...e))}function a(d){if(d.isExternalDrag||!(t.features?.move??!1))return;d.preventDefault();const h=d.currentTarget,v=Number(h.dataset[n]||0);h.dataset[n]=String(v+1)}function l(d){if(d.isExternalDrag||!(t.features?.move??!1))return;d.preventDefault();const h=d.currentTarget,v=Number(h.dataset[n]||0)-1;v<=0?(delete h.dataset[n],h.classList.remove(...e)):h.dataset[n]=String(v)}function c(d,h){if(d.isExternalDrag||!(t.features?.move??!1)||!h)return;d.preventDefault();const v=d.currentTarget;delete v.dataset[n],v.classList.remove(...e);const f=d.dataTransfer?.getData("items")||"[]",p=JSON.parse(f).map(_=>i.sortedFiles.get().find(S=>S.path===_));i.clearDraggedItem(),t.modal.open(uo,{items:{from:p,to:h}})}function u(d){return{dragover:h=>s(h,d),dragenter:a,dragleave:l,drop:h=>c(h,d)}}return{events:u}}const y3={class:"vuefinder__breadcrumb__container"},b3=["title"],w3=["title"],E3=["title"],S3=["title"],C3={class:"vuefinder__breadcrumb__path-container"},x3={class:"vuefinder__breadcrumb__list"},T3={key:0,class:"vuefinder__breadcrumb__hidden-list"},O3={class:"relative"},$3=["title","onClick"],k3=["title"],A3={class:"vuefinder__breadcrumb__path-mode"},P3={class:"vuefinder__breadcrumb__path-mode-content"},R3=["title"],I3={class:"vuefinder__breadcrumb__path-text"},M3=["title"],D3=["data-theme"],F3=["onClick"],L3={class:"vuefinder__breadcrumb__hidden-item-content"},j3={class:"vuefinder__breadcrumb__hidden-item-text"},N3=Se({__name:"Breadcrumb",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=e.config,s=ke(r.state),a=ke(o.path),l=ke(o.loading),c=H(null),u=Kg(0,100),d=H(5),h=H(!1),v=H(!1),f=te(()=>a.value?.breadcrumb??[]);function p(Y,I){return Y.length>I?[Y.slice(-I),Y.slice(0,-I)]:[Y,[]]}const _=te(()=>p(f.value,d.value)[0]),S=te(()=>p(f.value,d.value)[1]);Oe(u,()=>{if(!c.value)return;const Y=c.value.children;let I=0,A=0;const Q=5,z=1;d.value=Q,Ge(()=>{for(let ie=Y.length-1;ie>=0;ie--){const ve=Y[ie];if(I+ve.offsetWidth>u.value-40)break;I+=parseInt(ve.offsetWidth.toString(),10),A++}A<z&&(A=z),A>Q&&(A=Q),d.value=A})});const w=()=>{c.value&&(u.value=c.value.offsetWidth)},E=H(null);et(()=>{E.value=new ResizeObserver(w),c.value&&E.value.observe(c.value)}),St(()=>{E.value&&E.value.disconnect()});const b=cr(e,["vuefinder__drag-over"]);function C(Y=null){Y??=f.value.length-2;const I={basename:a.value?.storage??"local",extension:"",path:(a.value?.storage??"local")+"://",storage:a.value?.storage??"local",type:"dir",file_size:null,last_modified:null,mime_type:null,visibility:""};return f.value[Y]??I}const x=()=>{e.adapter.invalidateListQuery(a.value.path),e.adapter.open(a.value.path)},k=()=>{_.value.length>0&&e.adapter.open(f.value[f.value.length-2]?.path??(a.value?.storage??"local")+"://")},O=Y=>{e.adapter.open(Y.path),h.value=!1},K=()=>{h.value&&(h.value=!1)},D={mounted(Y,I){Y.clickOutsideEvent=function(A){Y===A.target||Y.contains(A.target)||I.value()},document.body.addEventListener("click",Y.clickOutsideEvent)},beforeUnmount(Y){document.body.removeEventListener("click",Y.clickOutsideEvent)}},P=()=>{r.toggle("showTreeView")},U=H({x:0,y:0}),M=(Y,I=null)=>{if(Y.currentTarget instanceof HTMLElement){const{x:A,y:Q,height:z}=Y.currentTarget.getBoundingClientRect();U.value={x:A,y:Q+z}}h.value=I??!h.value},q=()=>{v.value=!v.value},le=async()=>{await Wo(a.value?.path||""),n.success(i("Path copied to clipboard"))},de=()=>{v.value=!1};return(Y,I)=>(y(),T("div",y3,[g("span",{title:m(i)("Toggle Tree View")},[j(m(m3),{class:Ae(["vuefinder__breadcrumb__toggle-tree",m(s).showTreeView?"vuefinder__breadcrumb__toggle-tree--active":""]),onClick:P},null,8,["class"])],8,b3),g("span",{title:m(i)("Go up a directory")},[j(m(i3),We({class:f.value.length?"vuefinder__breadcrumb__go-up--active":"vuefinder__breadcrumb__go-up--inactive"},bn(f.value.length?m(b).events(C()):{}),{onClick:k}),null,16,["class"])],8,w3),m(o).isLoading()?(y(),T("span",{key:1,title:m(i)("Cancel")},[j(m(s3),{onClick:I[0]||(I[0]=A=>m(e).emitter.emit("vf-fetch-abort"))})],8,S3)):(y(),T("span",{key:0,title:m(i)("Refresh")},[j(m(e3),{onClick:x})],8,E3)),it(g("div",C3,[g("div",null,[j(m(c3),We({class:"vuefinder__breadcrumb__home-icon"},bn(m(b).events(C(-1))),{onClick:I[1]||(I[1]=Ye(A=>m(e).adapter.open(m(a).storage+"://"),["stop"]))}),null,16)]),g("div",x3,[S.value.length?it((y(),T("div",T3,[I[3]||(I[3]=g("div",{class:"vuefinder__breadcrumb__separator"},"/",-1)),g("div",O3,[g("span",{class:"vuefinder__breadcrumb__hidden-toggle",onDragenter:I[2]||(I[2]=A=>M(A,!0)),onClick:Ye(M,["stop"])},[j(m(Xg),{class:"vuefinder__breadcrumb__hidden-toggle-icon"})],32)])])),[[D,K]]):ue("",!0)]),g("div",{ref_key:"breadcrumbContainer",ref:c,class:"vuefinder__breadcrumb__visible-list pointer-events-none"},[(y(!0),T(Ie,null,He(_.value,(A,Q)=>(y(),T("div",{key:Q},[I[4]||(I[4]=g("span",{class:"vuefinder__breadcrumb__separator"},"/",-1)),g("span",We({class:"vuefinder__breadcrumb__item pointer-events-auto",title:A.basename},bn(m(b).events(A),!0),{onClick:Ye(z=>m(e).adapter.open(A.path),["stop"])}),L(A.name),17,$3)]))),128))],512),m(r).get("loadingIndicator")==="circular"&&m(l)?(y(),ne(m(Zs),{key:0})):ue("",!0),g("span",{title:m(i)("Toggle Path Copy Mode"),onClick:q},[j(m(_3),{class:"vuefinder__breadcrumb__toggle-icon"})],8,k3)],512),[[En,!v.value]]),it(g("div",A3,[g("div",P3,[g("div",{title:m(i)("Copy Path")},[j(m(hu),{class:"vuefinder__breadcrumb__copy-icon",onClick:le})],8,R3),g("div",I3,L(m(a).path),1),g("div",{title:m(i)("Exit")},[j(m(h3),{class:"vuefinder__breadcrumb__exit-icon",onClick:de})],8,M3)])],512),[[En,v.value]]),(y(),ne(ws,{to:"body"},[g("div",null,[it(g("div",{style:At({position:"absolute",top:U.value.y+"px",left:U.value.x+"px"}),class:"vuefinder__themer vuefinder__breadcrumb__hidden-dropdown","data-theme":m(e).theme.current},[(y(!0),T(Ie,null,He(S.value,(A,Q)=>(y(),T("div",We({key:Q,class:"vuefinder__breadcrumb__hidden-item"},bn(m(b).events(A),!0),{onClick:z=>O(A)}),[g("div",L3,[g("span",null,[j(m(Nn),{class:"vuefinder__breadcrumb__hidden-item-icon"})]),g("span",j3,L(A.name),1)])],16,F3))),128))],12,D3),[[En,h.value]])])]))]))}}),U3={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function z3(t,e){return y(),T("svg",U3,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 0 0 2-2V9.414a1 1 0 0 0-.293-.707l-5.414-5.414A1 1 0 0 0 12.586 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2"},null,-1)])])}const Dp={render:z3},V3={class:"vuefinder__drag-item__container"},B3={class:"vuefinder__drag-item__count"},H3=Se({__name:"DragItem",props:{count:{}},setup(t){const e=t;return(n,i)=>(y(),T("div",V3,[e.count>1?(y(),ne(m(Dp),{key:0,class:"vuefinder__drag-item__icon translate-x-1 translate-y-1"})):ue("",!0),j(m(Dp),{class:"vuefinder__drag-item__icon"}),g("div",B3,L(e.count),1)]))}}),q3={key:2,class:"vuefinder__item-icon__extension"},Fp=Se({__name:"ItemIcon",props:{item:{},ext:{type:Boolean},small:{type:Boolean},view:{}},setup(t){const e=t,n=je(),i=ke(n.config.state),o=te(()=>e.small!==void 0?e.small?"small":"large":e.view==="list"?"small":"large"),r=te(()=>{const a=o.value,l=i.value?.listIconSize,c=i.value?.gridIconSize;return i.value?.gridItemWidth,i.value?.gridItemHeight,e.view==="list"||a==="small"?{"--vf-icon-size":`${l??16}px`}:{"--vf-icon-size":`${c??48}px`}}),s={app:n,config:i.value,item:e.item,view:e.view};return(a,l)=>(y(),T("div",{class:Ae(["vuefinder__item-icon",{"vuefinder__item-icon--small":o.value==="small","vuefinder__item-icon--large":o.value==="large","vuefinder__item-icon--grid":t.view==="grid","vuefinder__item-icon--list":t.view==="list"}]),style:At(r.value)},[Ve(a.$slots,"icon",wn(Jn(s)),()=>[t.item.type==="dir"?(y(),ne(m(Nn),{key:0,class:"vuefinder__item-icon__folder"})):(y(),ne(m(qo),{key:1,class:"vuefinder__item-icon__file"})),t.ext&&t.item.type!=="dir"&&t.item.extension?(y(),T("div",q3,L(t.item.extension.substring(0,3)),1)):ue("",!0)])],6))}}),W3={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"};function K3(t,e){return y(),T("svg",W3,[...e[0]||(e[0]=[g("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M12 2a5 5 0 0 1 5 5v3a3 3 0 0 1 3 3v6a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3v-6a3 3 0 0 1 3-3V7a5 5 0 0 1 5-5m0 12a2 2 0 0 0-1.995 1.85L10 16a2 2 0 1 0 2-2m0-10a3 3 0 0 0-3 3v3h6V7a3 3 0 0 0-3-3"},null,-1)])])}const Lp={render:K3},Y3=["data-key","data-row","data-col","draggable"],G3={key:0},Q3={class:"vuefinder__explorer__item-grid-content"},X3=["data-src","alt"],J3={class:"vuefinder__explorer__item-title"},Z3={key:1,class:"vuefinder__explorer__item-list-content"},eN={class:"vuefinder__explorer__item-list-name"},tN={class:"vuefinder__explorer__item-list-icon"},nN={class:"vuefinder__explorer__item-name"},iN={key:0,class:"vuefinder__explorer__item-path"},oN={key:1,class:"vuefinder__explorer__item-size"},rN={key:0},sN={key:2,class:"vuefinder__explorer__item-date"},aN=Se({__name:"FileItem",props:{item:{},view:{},showThumbnails:{type:Boolean},isSelected:{type:Boolean},isDragging:{type:Boolean},rowIndex:{},colIndex:{},showPath:{type:Boolean},explorerId:{}},emits:["click","dblclick","contextmenu","dragstart","dragend"],setup(t,{emit:e}){const n=t,i=e,o=je(),r=o.fs,s=o.config,a=te(()=>{const P=o.selectionFilterType;return!P||P==="both"?!0:P==="files"&&n.item.type==="file"||P==="dirs"&&n.item.type==="dir"}),l=te(()=>{const P=o.selectionFilterMimeIncludes;return!P||!P.length||n.item.type==="dir"?!0:n.item.mime_type?P.some(U=>n.item.mime_type?.startsWith(U)):!1}),c=te(()=>a.value&&l.value),u=te(()=>["file-item-"+n.explorerId,n.view==="grid"?"vf-explorer-item-grid":"vf-explorer-item-list",n.isSelected?"vf-explorer-selected":"",c.value?"":"vf-explorer-item--unselectable"]),d=te(()=>({opacity:n.isDragging||r.isCut(n.item.path)||!c.value?.5:""})),h=H(null);let v=!1,f=null,p=null,_=!1;const{enabled:S}=Tn(),w=typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0),E=te(()=>w?!1:S("move")),b=()=>{f&&(clearTimeout(f),f=null),p=null},C=P=>{b(),p=P,_=!1,P.stopPropagation(),f=setTimeout(()=>{!p||f===null||(_=!0,p.cancelable&&p.preventDefault(),p.stopPropagation(),i("contextmenu",p),b())},500)},x=P=>{if(_){P.preventDefault(),P.stopPropagation(),b();return}setTimeout(()=>{_||(b(),D(P))},100)},k=P=>{if(!p)return;const U=p.touches[0]||p.changedTouches[0],M=P.touches[0]||P.changedTouches[0];if(U&&M){const q=Math.abs(M.clientX-U.clientX),le=Math.abs(M.clientY-U.clientY);(q>15||le>15)&&b()}},O=P=>{w&&P.type!=="click"||i("click",P)},K=P=>{if(_)return P.preventDefault(),P.stopPropagation(),!1;i("dragstart",P)},D=P=>{if(!v)v=!0,i("click",P),h.value=setTimeout(()=>{v=!1},300);else return v=!1,i("dblclick",P),!1};return(P,U)=>(y(),T("div",{class:Ae(u.value),style:At(d.value),"data-key":t.item.path,"data-row":t.rowIndex,"data-col":t.colIndex,draggable:E.value,onTouchstartCapture:U[1]||(U[1]=M=>C(M)),onTouchendCapture:U[2]||(U[2]=M=>x(M)),onTouchmoveCapture:k,onTouchcancelCapture:U[3]||(U[3]=()=>b()),onClick:O,onDblclick:U[4]||(U[4]=M=>i("dblclick",M)),onContextmenu:U[5]||(U[5]=Ye(M=>i("contextmenu",M),["prevent","stop"])),onDragstart:K,onDragend:U[6]||(U[6]=M=>i("dragend",M))},[t.view==="grid"?(y(),T("div",G3,[m(r).isReadOnly(t.item)?(y(),ne(m(Lp),{key:0,class:"vuefinder__item--readonly vuefinder__item--readonly--left",title:"Read Only"})):ue("",!0),g("div",Q3,[(t.item.mime_type??"").startsWith("image")&&t.showThumbnails?(y(),T("img",{key:0,src:"data:image/png;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",class:"vuefinder__explorer__item-thumbnail lazy","data-src":t.item.previewUrl??m(o).adapter.getPreviewUrl({path:t.item.path}),alt:t.item.basename,onTouchstart:U[0]||(U[0]=M=>M.preventDefault())},null,40,X3)):(y(),ne(Fp,{key:1,item:t.item,ext:!0,view:t.view},{icon:we(M=>[Ve(P.$slots,"icon",wn(Jn(M)))]),_:3},8,["item","view"]))]),g("span",J3,L(m(Xl)(t.item.basename)),1)])):(y(),T("div",Z3,[g("div",eN,[g("div",tN,[j(Fp,{item:t.item,view:t.view},{icon:we(M=>[Ve(P.$slots,"icon",wn(Jn(M)))]),_:3},8,["item","view"])]),g("span",nN,L(t.item.basename),1),g("div",null,[m(r).isReadOnly(t.item)?(y(),ne(m(Lp),{key:0,class:"vuefinder__item--readonly vuefinder__item--readonly--list",title:"Read Only"})):ue("",!0)])]),t.showPath?(y(),T("div",iN,L(t.item.path),1)):ue("",!0),t.showPath?ue("",!0):(y(),T("div",oN,[t.item.file_size?(y(),T("div",rN,L(m(o).filesize(t.item.file_size)),1)):ue("",!0)])),!t.showPath&&t.item.last_modified?(y(),T("div",sN,L(new Date(t.item.last_modified*1e3).toLocaleString()),1)):ue("",!0)])),m(S)("pinned")&&m(s).get("pinnedFolders").find(M=>M.path===t.item.path)?(y(),ne(m(pu),{key:2,class:"vuefinder__item--pinned"})):ue("",!0)],46,Y3))}}),lN=["data-row"],jp=Se({__name:"FileRow",props:{rowIndex:{},rowHeight:{},view:{},itemsPerRow:{},items:{},showThumbnails:{type:Boolean},showPath:{type:Boolean},isDraggingItem:{type:Function},isSelected:{type:Function},dragNDropEvents:{type:Function},explorerId:{}},emits:["click","dblclick","contextmenu","dragstart","dragend"],setup(t,{emit:e}){const n=t,i=e,o=te(()=>[n.view==="grid"?"vf-explorer-item-grid-row":"vf-explorer-item-list-row","pointer-events-none"]),r=te(()=>({position:"absolute",top:0,left:0,width:"100%",height:`${n.rowHeight}px`,transform:`translateY(${n.rowIndex*n.rowHeight}px)`})),s=te(()=>n.view==="grid"?{gridTemplateColumns:`repeat(${n.itemsPerRow||1}, 1fr)`}:{gridTemplateColumns:"1fr"});return(a,l)=>(y(),T("div",{class:Ae(o.value),"data-row":t.rowIndex,style:At(r.value)},[g("div",{class:Ae(["grid justify-self-start",{"w-full":t.view==="list"}]),style:At(s.value)},[(y(!0),T(Ie,null,He(t.items,(c,u)=>(y(),ne(aN,We({key:c.path,item:c,view:t.view,"show-thumbnails":t.showThumbnails,"show-path":t.showPath,"is-selected":t.isSelected(c.path),"is-dragging":t.isDraggingItem(c.path),"row-index":t.rowIndex,"col-index":u,"explorer-id":t.explorerId},bn(t.dragNDropEvents(c)),{onClick:l[0]||(l[0]=d=>i("click",d)),onDblclick:l[1]||(l[1]=d=>i("dblclick",d)),onContextmenu:l[2]||(l[2]=d=>i("contextmenu",d)),onDragstart:l[3]||(l[3]=d=>i("dragstart",d)),onDragend:l[4]||(l[4]=d=>i("dragend",d))}),{icon:we(d=>[Ve(a.$slots,"icon",We({ref_for:!0},d))]),_:3},16,["item","view","show-thumbnails","show-path","is-selected","is-dragging","row-index","col-index","explorer-id"]))),128))],6)],14,lN))}}),cN={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"};function uN(t,e){return y(),T("svg",cN,[...e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 0 1 1.414 0L10 10.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 0-1.414","clip-rule":"evenodd"},null,-1)])])}const dN={render:uN},hN={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"};function pN(t,e){return y(),T("svg",hN,[...e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 0 1-1.414 0L10 9.414l-3.293 3.293a1 1 0 0 1-1.414-1.414l4-4a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1 0 1.414","clip-rule":"evenodd"},null,-1)])])}const fN={render:pN},Qa=Se({__name:"SortIcon",props:{direction:{}},setup(t){return(e,n)=>(y(),T("div",null,[t.direction==="asc"?(y(),ne(m(dN),{key:0,class:"vuefinder__explorer__sort-icon"})):ue("",!0),t.direction==="desc"?(y(),ne(m(fN),{key:1,class:"vuefinder__explorer__sort-icon"})):ue("",!0)]))}}),mN={class:"vuefinder__explorer__header"},vN=Se({__name:"ExplorerHeader",setup(t){const e=je(),n=e.fs,{t:i}=e.i18n,o=ke(n.sort);return(r,s)=>(y(),T("div",mN,[g("div",{class:"vuefinder__explorer__sort-button vuefinder__explorer__sort-button--name vf-sort-button",onClick:s[0]||(s[0]=a=>m(n).toggleSort("basename"))},[Ke(L(m(i)("Name"))+" ",1),it(j(Qa,{direction:m(o).order},null,8,["direction"]),[[En,m(o).active&&m(o).column==="basename"]])]),g("div",{class:"vuefinder__explorer__sort-button vuefinder__explorer__sort-button--size vf-sort-button",onClick:s[1]||(s[1]=a=>m(n).toggleSort("file_size"))},[Ke(L(m(i)("Size"))+" ",1),it(j(Qa,{direction:m(o).order},null,8,["direction"]),[[En,m(o).active&&m(o).column==="file_size"]])]),g("div",{class:"vuefinder__explorer__sort-button vuefinder__explorer__sort-button--date vf-sort-button",onClick:s[2]||(s[2]=a=>m(n).toggleSort("last_modified"))},[Ke(L(m(i)("Date"))+" ",1),it(j(Qa,{direction:m(o).order},null,8,["direction"]),[[En,m(o).active&&m(o).column==="last_modified"]])])]))}});function gN(t,e){const{scrollContainer:n,itemWidth:i=100,rowHeight:o,overscan:r=2,containerPadding:s=48,lockItemsPerRow:a}=e,l=t,c=()=>typeof o=="number"?o:o.value,u=()=>i?typeof i=="number"?i:i.value:100,d=()=>s?typeof s=="number"?s:s.value:0,h=H(0),v=H(6),f=H(600);let p=null;const _=te(()=>Math.ceil(l.value.length/v.value)),S=te(()=>_.value*c()),w=te(()=>{const P=c(),U=Math.max(0,Math.floor(h.value/P)-r),M=Math.min(_.value,Math.ceil((h.value+f.value)/P)+r);return{start:U,end:M}}),E=te(()=>{const{start:P,end:U}=w.value;return Array.from({length:U-P},(M,q)=>P+q)}),b=()=>f.value,C=()=>typeof a=="object"?a.value:!1,x=()=>{if(C()){v.value=1;return}if(n.value){const P=d(),U=n.value.clientWidth-P,M=u();M>0&&(v.value=Math.max(Math.floor(U/M),2))}},k=P=>{const U=P.target;h.value=U.scrollTop};Oe(()=>l.value.length,()=>{x()}),i&&typeof i!="number"&&Oe(i,()=>{x()}),s&&typeof s!="number"&&Oe(s,()=>{x()}),o&&typeof o!="number"&&Oe(o,()=>{});const O=(P,U)=>{if(!P||!Array.isArray(P))return[];const M=U*v.value;return P.slice(M,M+v.value)},K=(P,U,M,q,le)=>{if(!P||!Array.isArray(P))return[];const de=[];for(let Y=U;Y<=M;Y++)for(let I=q;I<=le;I++){const A=Y*v.value+I;A<P.length&&P[A]&&de.push(P[A])}return de},D=P=>({row:Math.floor(P/v.value),col:P%v.value});return et(async()=>{await Ge(),n.value&&(f.value=n.value.clientHeight||600),x(),window.addEventListener("resize",()=>{n.value&&(f.value=n.value.clientHeight||600),x()}),n.value&&"ResizeObserver"in window&&(p=new ResizeObserver(P=>{const U=P[0];U&&(f.value=Math.round(U.contentRect.height)),x()}),p.observe(n.value))}),St(()=>{window.removeEventListener("resize",x),p&&(p.disconnect(),p=null)}),{scrollTop:h,itemsPerRow:v,totalRows:_,totalHeight:S,visibleRange:w,visibleRows:E,updateItemsPerRow:x,handleScroll:k,getRowItems:O,getItemsInRange:K,getItemPosition:D,getContainerHeight:b}}function _N(t){const{itemsPerRow:e,totalHeight:n,getItemsInRange:i,getKey:o,selectionObject:r,rowHeight:s,itemWidth:a,osInstance:l}=t,c=()=>typeof a=="number"?a:a.value,u=Math.floor(Math.random()*2**32).toString(),d=je(),h=d.fs,v=ke(h.selectedKeys),f=ke(h.sortedFiles),p=te(()=>{const I=new Map;return f.value&&f.value.forEach(A=>{I.set(o(A),A)}),I}),_=H(new Set),S=H(!1),w=H(!1),E=I=>I.map(A=>A.getAttribute("data-key")).filter(A=>!!A),b=I=>{I.selection.clearSelection(!0,!0)},C=I=>{if(v.value&&v.value.size>0){const A=document.querySelectorAll(`.file-item-${u}[data-key]`),Q=new Map;A.forEach(ie=>{const ve=ie.getAttribute("data-key");ve&&Q.set(ve,ie)});const z=[];v.value.forEach(ie=>{const ve=Q.get(ie);ve&&x(ie)&&z.push(ve)}),z.forEach(ie=>{I.selection.select(ie,!0)})}},x=I=>{const A=p.value.get(I);if(!A)return!1;const Q=d.selectionFilterType,z=d.selectionFilterMimeIncludes;return Q==="files"&&A.type==="dir"||Q==="dirs"&&A.type==="file"?!1:z&&Array.isArray(z)&&z.length>0?A.type==="dir"?!0:A.mime_type?z.some(ie=>A.mime_type?.startsWith(ie)):!1:!0},k=I=>{if(d.selectionMode==="single")return!1;S.value=!1,!I.event?.metaKey&&!I.event?.ctrlKey&&(w.value=!0),I.selection.resolveSelectables(),b(I),C(I)},O=H(0),K=({event:I,selection:A})=>{O.value=(r.value?.getAreaLocation().y1??0)-(d.root.getBoundingClientRect().top??0);const Q=document.querySelector(".selection-area-container");if(Q&&(Q.dataset.theme=d.theme.current),d.selectionMode==="single")return;const z=I;z&&"type"in z&&z.type==="touchend"&&z.preventDefault();const ie=I;!ie?.ctrlKey&&!ie?.metaKey&&(h.clearSelection(),A.clearSelection(!0,!0)),_.value.clear()},D=I=>{if(d.selectionMode==="single")return;const A=E(I.store.changed.added),Q=E(I.store.changed.removed);w.value=!1,S.value=!0,A.forEach(z=>{v.value&&!v.value.has(z)&&x(z)&&(_.value.add(z),h.select(z,d.selectionMode||"multiple"))}),Q.forEach(z=>{document.querySelector(`[data-key="${z}"]`)&&p.value.has(z)&&_.value.delete(z),h.deselect(z)}),I.selection.resolveSelectables(),C(I)},P=()=>{_.value.clear()},U=I=>{if(!I.event)return;const A=document.querySelector(".scroller-"+u);if(!A)return;const Q=A.getBoundingClientRect(),z=Q.left,ie=Q.top;let ve=A.scrollTop;if(l?.value){const{viewport:ft}=l.value.elements();ft&&(ve=ft.scrollTop)}const re=r.value?.getAreaLocation();if(!re)return;const ge=Math.min(re.x1,re.x2),_e=ve+Math.min(re.y1,re.y2),R=Math.max(re.x1,re.x2),$=ve+Math.max(re.y1,re.y2),N=4,F=c();let B=Math.floor((ge-z-N)/F),oe=Math.floor((R-z-N)/F);const ee=ge-z-N-B*F,G=R-z-N-oe*F;ee>F-N&&(B=B+1),G<N&&(oe=oe-1);const he=Math.max(0,B),me=Math.min(e.value-1,oe);let $e=Math.floor((_e-ie-N)/s.value),Ce=Math.floor(($-ie-N)/s.value);const Ne=_e-ie-N-$e*s.value,Pe=$-ie-N-Ce*s.value,Ue=Math.floor((n.value-N)/s.value);Ne>s.value-N&&($e=$e+1),Pe<N&&(Ce=Ce-1);const ut=Math.max(0,$e),Qe=Math.min(Ce,Ue),at=i(f.value,ut,Qe,he,me),tt=document.querySelectorAll(`.file-item-${u}[data-key]`),pt=new Map;tt.forEach(ft=>{const Dt=ft.getAttribute("data-key");Dt&&pt.set(Dt,ft)});const dt=[];if(at.forEach(ft=>{const Dt=o(ft);pt.get(Dt)||dt.push(Dt)}),dt.length>0){const ft=d.selectionMode||"multiple";h.selectMultiple(dt,ft)}},M=I=>{U(I),b(I),C(I),h.setSelectedCount(v.value?.size||0),S.value=!1},q=()=>{let I=[".scroller-"+u];if(l?.value){const{viewport:A}=l.value.elements();A&&(I=A)}r.value=new UI({selectables:[".file-item-"+u+":not(.vf-explorer-item--unselectable)"],boundaries:I,selectionContainerClass:"selection-area-container",behaviour:{overlap:"invert",intersect:"touch",startThreshold:0,triggers:[0],scrolling:{speedDivider:10,manualSpeed:750,startScrollMargins:{x:0,y:10}}},features:{touch:!0,range:!0,deselectOnBlur:!0,singleTap:{allow:!1,intersect:"native"}}}),r.value.on("beforestart",k),r.value.on("start",K),r.value.on("move",D),r.value.on("stop",M)},le=()=>{r.value&&(r.value.destroy(),r.value=null)},de=()=>{r.value&&(Array.from(v.value??new Set).forEach(I=>{x(I)||h.deselect(I)}),le(),q())},Y=I=>{w.value&&(r.value?.clearSelection(),P(),w.value=!1);const A=I;!_.value.size&&!w.value&&!A?.ctrlKey&&!A?.metaKey&&(h.clearSelection(),r.value?.clearSelection())};return et(()=>{const I=A=>{!A.buttons&&S.value&&(S.value=!1)};document.addEventListener("dragleave",I),St(()=>{document.removeEventListener("dragleave",I)})}),{explorerId:u,isDragging:S,initializeSelectionArea:q,updateSelectionArea:de,handleContentClick:Y}}function yN(t){const e=n=>{if(!n)return{typeAllowed:!1,mimeAllowed:!1};const i=t.selectionFilterType,o=t.selectionFilterMimeIncludes,r=!i||i==="both"||i==="files"&&n.type==="file"||i==="dirs"&&n.type==="dir";let s=!0;return o&&Array.isArray(o)&&o.length>0&&(n.type==="dir"?s=!0:n.mime_type?s=o.some(a=>n.mime_type.startsWith(a)):s=!1),{typeAllowed:r,mimeAllowed:s}};return{isItemSelectable:e,canSelectItem:n=>{const{typeAllowed:i,mimeAllowed:o}=e(n);return i&&o}}}function bN(t){const e=n=>({item:n,defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}});return{createCancelableEvent:e,openItem:(n,i,o)=>{const r=e(n);if(n.type==="file"&&i){if(t.emitter.emit("vf-file-dclick",r),r.defaultPrevented)return}else if(n.type==="dir"&&o&&(t.emitter.emit("vf-folder-dclick",r),r.defaultPrevented))return;const s=t.contextMenuItems?.find(a=>a.show(t,{items:[n],target:n,searchQuery:""}));s&&s.action(t,[n])}}}function wN(t,e,n,i,o,r,s){const a=t.fs,{canSelectItem:l}=yN(t),{openItem:c}=bN(t),u=h=>{const v=h.target?.closest(".file-item-"+e);if(!v)return null;const f=String(v.getAttribute("data-key")),p=n.value?.find(_=>_.path===f);return{key:f,item:p}},d=()=>{const h=i.value;return n.value?.filter(v=>h?.has(v.path))||[]};return{handleItemClick:h=>{const v=u(h);if(!v)return;const{key:f,item:p}=v,_=h;if(!l(p))return;const S=t.selectionMode||"multiple";!_?.ctrlKey&&!_?.metaKey&&(h.type!=="touchstart"||!a.isSelected(f))&&(a.clearSelection(),o.value?.clearSelection(!0,!0)),o.value?.resolveSelectables(),h.type==="touchstart"&&a.isSelected(f)?a.select(f,S):a.toggleSelect(f,S),a.setSelectedCount(i.value?.size||0)},handleItemDblClick:h=>{const v=u(h);if(!v)return;const{item:f}=v;l(f)&&f&&c(f,r,s)},handleItemContextMenu:h=>{h.preventDefault(),h.stopPropagation();const v=u(h);if(!v)return;const{key:f,item:p}=v;l(p)&&(i.value?.has(f)||(a.clearSelection(),a.select(f)),t.emitter.emit("vf-contextmenu-show",{event:h,items:d(),target:p}))},handleContentContextMenu:h=>{h.preventDefault(),t.emitter.emit("vf-contextmenu-show",{event:h,items:d()})},getSelectedItems:d}}function EN(t,e){const n=H(null);return et(()=>{if(hn.plugin([cI]),t.value){const i=hn(t.value,{scrollbars:{theme:"vf-scrollbars-theme"}},{initialized:o=>{n.value=o;const{viewport:r}=o.elements();r&&r.addEventListener("scroll",e)},updated:o=>{const{viewport:r}=o.elements()}});n.value=i}}),St(()=>{if(n.value){const{viewport:i}=n.value.elements();i&&i.removeEventListener("scroll",e),n.value.destroy(),n.value=null}}),{osInstance:n}}function SN(t,e){const n=H(null);return et(()=>{t.value&&(n.value=new Hi({elements_selector:".lazy",container:t.value})),e?.emitter&&e.emitter.on("vf-refresh-thumbnails",()=>{n.value&&n.value.update()})}),Vp(()=>{n.value&&n.value.update()}),St(()=>{n.value&&(n.value.destroy(),n.value=null)}),{vfLazyLoad:n}}const CN={class:"vuefinder__explorer__container"},xN={key:0,class:"vuefinder__linear-loader"},TN=Se({__name:"Explorer",props:{onFileDclick:{type:Function},onFolderDclick:{type:Function}},setup(t){const e=t,n=je(),i=cr(n,["vuefinder__drag-over"]),o=In("dragImage"),r=Yo(null),s=In("scrollContainer"),a=In("scrollContent"),l=n.fs,c=n.config,u=ke(c.state),d=ke(l.sortedFiles),h=ke(l.selectedKeys),v=ke(l.loading),f=F=>h.value?.has(F)??!1,p=te(()=>{if(u.value?.view==="grid"){const oe=u.value?.gridItemHeight??80,ee=u.value?.gridItemGap??8;return oe+ee*2}const F=u.value?.listItemHeight??32,B=u.value?.listItemGap??2;return F+B*2}),_=te(()=>{if(u.value?.view==="grid"){const F=u.value?.gridItemWidth??96,B=u.value?.gridItemGap??8;return F+B*2}return 104}),S=te(()=>u.value?.view==="grid"?(u.value?.gridItemGap??8)*2:0),{t:w}=n.i18n,{itemsPerRow:E,totalHeight:b,visibleRows:C,handleScroll:x,getRowItems:k,getItemsInRange:O,updateItemsPerRow:K}=gN(te(()=>d.value??[]),{scrollContainer:s,itemWidth:_,rowHeight:p,overscan:2,containerPadding:S,lockItemsPerRow:te(()=>u.value.view==="list")}),{osInstance:D}=EN(s,x),{explorerId:P,isDragging:U,initializeSelectionArea:M,updateSelectionArea:q,handleContentClick:le}=_N({itemsPerRow:E,totalHeight:b,getItemsInRange:O,getKey:F=>F.path,selectionObject:r,rowHeight:p,itemWidth:_,osInstance:D}),de=H(null),Y=F=>{if(!F||!de.value)return!1;const B=h.value?.has(de.value)??!1;return U.value&&(B?h.value?.has(F)??!1:F===de.value)};Oe(()=>c.get("view"),F=>{F==="list"?E.value=1:K()},{immediate:!0}),Oe(E,F=>{c.get("view")==="list"&&F!==1&&(E.value=1)});const I=F=>d.value?.[F];SN(s,n);const{handleItemClick:A,handleItemDblClick:Q,handleItemContextMenu:z,handleContentContextMenu:ie}=wN(n,P,d,h,r,e.onFileDclick,e.onFolderDclick);et(()=>{const F=()=>{r.value||M(),r.value&&r.value.on("beforestart",({event:B})=>{const oe=B?.target===a.value;if(!B?.metaKey&&!B?.ctrlKey&&!B?.altKey&&!oe)return!1})};if(D.value)F();else{const B=setInterval(()=>{D.value&&(clearInterval(B),F())},50);setTimeout(()=>{clearInterval(B),r.value||F()},500)}Oe(()=>[n.selectionFilterType,n.selectionFilterMimeIncludes],q,{deep:!0})});const ve=F=>{if(!(n.features?.move??!1)||F.altKey||F.ctrlKey||F.metaKey)return F.preventDefault(),!1;U.value=!0;const B=F.target?.closest(".file-item-"+P);if(de.value=B?String(B.dataset.key):null,F.dataTransfer&&de.value){F.dataTransfer.setDragImage(o.value,0,15),F.dataTransfer.effectAllowed="all",F.dataTransfer.dropEffect="copy";const oe=h.value?.has(de.value)?Array.from(h.value):[de.value];F.dataTransfer.setData("items",JSON.stringify(oe)),l.setDraggedItem(de.value)}},re=()=>{de.value=null};let ge=null,_e=null;const R=F=>{F.target?.closest(".file-item-"+P)||(_e=F,ge&&clearTimeout(ge),ge=setTimeout(()=>{_e&&(_e.cancelable&&_e.preventDefault(),_e.stopPropagation(),ie(_e)),_e=null,ge=null},500))},$=F=>{ge&&(clearTimeout(ge),ge=null),_e=null},N=F=>{if(!_e)return;const B=_e.touches[0]||_e.changedTouches[0],oe=F.touches[0]||F.changedTouches[0];if(B&&oe){const ee=Math.abs(oe.clientX-B.clientX),G=Math.abs(oe.clientY-B.clientY);(ee>15||G>15)&&(ge&&(clearTimeout(ge),ge=null),_e=null)}};return(F,B)=>(y(),T("div",CN,[m(u).view==="list"?(y(),ne(vN,{key:0})):ue("",!0),g("div",{ref_key:"scrollContainer",ref:s,class:Ae(["vuefinder__explorer__selector-area","scroller-"+m(P)])},[m(c).get("loadingIndicator")==="linear"&&m(v)?(y(),T("div",xN)):ue("",!0),g("div",{ref_key:"scrollContent",ref:a,class:"scrollContent vuefinder__explorer__scroll-content",style:At({height:`${m(b)}px`,position:"relative",width:"100%"}),onContextmenu:B[0]||(B[0]=Ye((...oe)=>m(ie)&&m(ie)(...oe),["self","prevent"])),onClick:B[1]||(B[1]=Ye((...oe)=>m(le)&&m(le)(...oe),["self"])),onTouchstartCapture:Ye(R,["self"]),onTouchendCapture:Ye($,["self"]),onTouchmoveCapture:Ye(N,["self"]),onTouchcancelCapture:Ye($,["self"])},[g("div",{ref_key:"dragImage",ref:o,class:"vuefinder__explorer__drag-item"},[j(H3,{count:de.value&&m(h).has(de.value)?m(h).size:1},null,8,["count"])],512),m(u).view==="grid"?(y(!0),T(Ie,{key:0},He(m(C),oe=>(y(),ne(jp,{key:oe,"row-index":oe,"row-height":p.value,view:"grid","items-per-row":m(E),items:m(k)(m(d),oe),"show-thumbnails":m(u).showThumbnails,"is-dragging-item":Y,"is-selected":f,"drag-n-drop-events":ee=>m(i).events(ee),"explorer-id":m(P),onClick:m(A),onDblclick:m(Q),onContextmenu:m(z),onDragstart:ve,onDragend:re},{icon:we(ee=>[Ve(F.$slots,"icon",We({ref_for:!0},ee))]),_:3},8,["row-index","row-height","items-per-row","items","show-thumbnails","drag-n-drop-events","explorer-id","onClick","onDblclick","onContextmenu"]))),128)):(y(!0),T(Ie,{key:1},He(m(C),oe=>(y(),ne(jp,{key:oe,"row-index":oe,"row-height":p.value,view:"list",items:I(oe)?[I(oe)]:[],"is-dragging-item":Y,"is-selected":f,"drag-n-drop-events":ee=>m(i).events(ee),"explorer-id":m(P),onClick:m(A),onDblclick:m(Q),onContextmenu:m(z),onDragstart:ve,onDragend:re},{icon:we(ee=>[Ve(F.$slots,"icon",We({ref_for:!0},ee))]),_:3},8,["row-index","row-height","items","drag-n-drop-events","explorer-id","onClick","onDblclick","onContextmenu"]))),128))],36)],2)]))}}),ON=["href","download"],$N=["onClick"],kN=Se({__name:"ContextMenu",setup(t){const e=je(),n=H(null),i=H([]);let o=null,r=null,s=null,a=[],l=null;const c=Mt({active:!1,items:[],positions:{}});e.emitter.on("vf-context-selected",v=>{i.value=v});const u=v=>v.link(e,i.value),d=v=>{e.emitter.emit("vf-contextmenu-hide"),v.action(e,i.value)};e.emitter.on("vf-contextmenu-show",v=>{const{event:f,items:p,target:_=null}=v||{};c.items=(e.contextMenuItems||[]).filter(S=>S.show(e,{items:p,target:_})).sort((S,w)=>{const E=S.order??1/0,b=w.order??1/0;return E-b}),_?p.length>1&&p.some(S=>S.path===_.path)?e.emitter.emit("vf-context-selected",p):e.emitter.emit("vf-context-selected",[_]):e.emitter.emit("vf-context-selected",[]),h(f)}),e.emitter.on("vf-contextmenu-hide",()=>{c.active=!1,o&&(o(),o=null),s&&(a.forEach(v=>{v===window?window.removeEventListener("scroll",s,!0):v.removeEventListener("scroll",s,!0)}),s=null,a=[]),l&&(document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),l=null),r=null,c.positions={}});const h=async v=>{o&&(o(),o=null);const f=(b=>{if("clientX"in b&&"clientY"in b)return{x:b.clientX,y:b.clientY};const C="touches"in b&&b.touches[0]||"changedTouches"in b&&b.changedTouches[0];return C?{x:C.clientX,y:C.clientY}:{x:0,y:0}})(v);if(r={getBoundingClientRect:()=>({width:0,height:0,x:f.x,y:f.y,top:f.y,left:f.x,right:f.x,bottom:f.y})},c.positions={position:"fixed",zIndex:"10001",opacity:"0",visibility:"hidden",left:"-9999px",top:"-9999px"},c.active=!0,await Ge(),!n.value||!r)return;await new Promise(b=>{requestAnimationFrame(()=>{requestAnimationFrame(b)})});const p=[Po(8),Ro({padding:16,fallbackPlacements:["left-start","right-end","left-end","top-start","bottom-start"]}),Io({padding:16})];let _=0,S=0;try{const b=await Zi(r,n.value,{placement:"right-start",strategy:"fixed",middleware:p});_=b.x,S=b.y}catch(b){console.warn("[ContextMenu] Floating UI initial positioning error:",b);return}c.positions={position:"fixed",zIndex:"10001",left:`${_}px`,top:`${S}px`,opacity:"0",visibility:"visible",transform:"translateY(-8px)",transition:"opacity 150ms ease-out, transform 150ms ease-out"},requestAnimationFrame(()=>{n.value&&(c.positions={...c.positions,opacity:"1",transform:"translateY(0)"})});const w=(b=>{const C=[];let x=b;for(;x&&x!==document.body&&x!==document.documentElement;){const k=window.getComputedStyle(x),O=k.overflow+k.overflowX+k.overflowY;(O.includes("scroll")||O.includes("auto"))&&C.push(x),x=x.parentElement}return C})(n.value);a=[window,...w],s=()=>{c.active&&e.emitter.emit("vf-contextmenu-hide")};const E=s;E&&a.forEach(b=>{b===window?window.addEventListener("scroll",E,!0):b.addEventListener("scroll",E,!0)}),l=b=>{if(!c.active)return;const C=b.target;if(!C||n.value&&n.value.contains(C))return;const x=e.root;x&&x.contains(C)||e.emitter.emit("vf-contextmenu-hide")},setTimeout(()=>{l&&(document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0))},100),setTimeout(()=>{if(!(!n.value||!r))try{o=oc(r,n.value,async()=>{if(!(!r||!n.value))try{const{x:b,y:C}=await Zi(r,n.value,{placement:"right-start",strategy:"fixed",middleware:p});c.positions={...c.positions,left:`${b}px`,top:`${C}px`}}catch(b){console.warn("Floating UI positioning error:",b)}})}catch(b){console.warn("Floating UI autoUpdate setup error:",b),o=null}},200)};return St(()=>{o&&(o(),o=null),s&&(a.forEach(v=>{v===window?window.removeEventListener("scroll",s,!0):v.removeEventListener("scroll",s,!0)}),s=null,a=[]),l&&(document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),l=null),r=null}),(v,f)=>it((y(),T("ul",{ref_key:"contextmenu",ref:n,class:Ae([{"vuefinder__context-menu--active":c.active,"vuefinder__context-menu--inactive":!c.active},"vuefinder__context-menu"]),style:At(c.positions)},[(y(!0),T(Ie,null,He(c.items,p=>(y(),T("li",{key:p.title,class:"vuefinder__context-menu__item"},[p.link?(y(),T("a",{key:0,class:"vuefinder__context-menu__link",target:"_blank",href:u(p),download:u(p),onClick:f[0]||(f[0]=_=>m(e).emitter.emit("vf-contextmenu-hide"))},[g("span",null,L(p.title(m(e).i18n)),1)],8,ON)):(y(),T("div",{key:1,class:"vuefinder__context-menu__action",onClick:_=>d(p)},[g("span",null,L(p.title(m(e).i18n)),1)],8,$N))]))),128))],6)),[[En,c.active]])}}),AN={class:"vuefinder__status-bar__wrapper"},PN={class:"vuefinder__status-bar__storage"},RN=["title"],IN={class:"vuefinder__status-bar__storage-icon"},MN=["value"],DN=["value"],FN={class:"vuefinder__status-bar__info space-x-2"},LN={key:0},jN={key:1},NN={key:0,class:"vuefinder__status-bar__size"},UN={class:"vuefinder__status-bar__actions"},zN=Se({__name:"Statusbar",setup(t){const e=je(),{t:n}=e.i18n,i=e.fs,o=ke(i.sortedFiles),r=ke(i.path),s=ke(i.selectedCount),a=ke(i.storages),l=ke(i.selectedItems),c=ke(i.path),u=_=>{const S=_.target.value;e.adapter.open(S+"://")},d=te(()=>!l.value||l.value.length===0?0:l.value.reduce((_,S)=>_+(S.file_size||0),0)),h=te(()=>a.value),v=te(()=>o.value),f=te(()=>s.value||0),p=te(()=>l.value||[]);return(_,S)=>(y(),T("div",AN,[g("div",PN,[g("div",{class:"vuefinder__status-bar__storage-container",title:m(n)("Storage")},[g("div",IN,[j(m(fu))]),g("select",{name:"vuefinder-media-selector",value:m(r).storage,class:"vuefinder__status-bar__storage-select",tabindex:"-1",onChange:u},[(y(!0),T(Ie,null,He(h.value,w=>(y(),T("option",{key:w,value:w},L(w),9,DN))),128))],40,MN),S[0]||(S[0]=g("span",{class:"vuefinder__status-bar__storage-caret","aria-hidden":"true"},null,-1))],8,RN),g("div",FN,[f.value===0?(y(),T("span",LN,L(v.value.length)+" "+L(m(n)("items")),1)):(y(),T("span",jN,[Ke(L(f.value)+" "+L(m(n)("selected"))+" ",1),d.value?(y(),T("span",NN,L(m(e).filesize(d.value)),1)):ue("",!0)]))])]),g("div",UN,[Ve(_.$slots,"actions",{path:m(c).path,count:f.value||0,selected:p.value})])]))}}),VN={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-5 w-5",viewBox:"0 0 24 24"};function BN(t,e){return y(),T("svg",VN,[...e[0]||(e[0]=[g("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m3.6 5.2a1 1 0 0 0-1.4.2L12 10.333 9.8 7.4a1 1 0 1 0-1.6 1.2l2.55 3.4-2.55 3.4a1 1 0 1 0 1.6 1.2l2.2-2.933 2.2 2.933a1 1 0 0 0 1.6-1.2L13.25 12l2.55-3.4a1 1 0 0 0-.2-1.4"},null,-1)])])}const HN={render:BN};function r_(t,e){const n=t.findIndex(i=>i.path===e.path);n>-1?t[n]=e:t.push(e)}const qN={class:"vuefinder__folder-loader-indicator"},WN={key:1,class:"vuefinder__folder-loader-indicator--icon"},s_=Se({__name:"FolderLoaderIndicator",props:zp({storage:{},path:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=je(),i=Zl(t,"modelValue"),o=H(!1);Oe(()=>i.value,()=>r());const r=async()=>{o.value=!0;try{const s=(await n.adapter.list(e.path)).files.filter(a=>a.type==="dir");r_(n.treeViewData,{path:e.path,type:"dir",folders:s})}catch(s){Yt(s,"Failed to fetch subfolders")}finally{o.value=!1}};return(s,a)=>(y(),T("div",qN,[o.value?(y(),ne(m(Zs),{key:0,class:"vuefinder__folder-loader-indicator--loading"})):(y(),T("div",WN,[i.value?(y(),ne(m(Js),{key:0,class:"vuefinder__folder-loader-indicator--minus"})):ue("",!0),i.value?ue("",!0):(y(),ne(m(Xs),{key:1,class:"vuefinder__folder-loader-indicator--plus"}))]))]))}}),KN={key:0},YN={class:"vuefinder__treesubfolderlist__no-folders"},GN={class:"vuefinder__treesubfolderlist__item-content"},QN=["onClick"],XN=["title","onDblclick","onClick"],JN={class:"vuefinder__treesubfolderlist__item-icon"},ZN={class:"vuefinder__treesubfolderlist__subfolder"},eU={key:1,class:"vuefinder__treesubfolderlist__more-note"},tU=Se({__name:"TreeSubfolderList",props:{storage:{},path:{}},setup(t){const e=je(),n=e.fs,i=cr(e,["vuefinder__drag-over"]),o=H({}),r=e.config,s=ke(r.state),{t:a}=e.i18n,l=ke(n.path),c=t,u=H(null),d=H(50);et(()=>{c.path===c.storage+"://"&&u.value&&hn(u.value,{scrollbars:{theme:"vf-scrollbars-theme"}})});const h=te(()=>{const w=e.treeViewData.find(E=>E.path===c.path)?.folders||[];return w.length>d.value?w.slice(0,d.value):w}),v=te(()=>e.treeViewData.find(w=>w.path===c.path)?.folders?.length||0),f=te(()=>v.value>d.value),p=te(()=>`${c.storage}://`),_=(w,E)=>w===E||w.startsWith(`${E}/`);Oe(h,w=>{const E=s.value.expandTreeByDefault&&c.path===p.value,b=s.value.expandedTreePaths||[];w.forEach(C=>{const x=b.some(k=>_(k,C.path));(E||x)&&o.value[C.path]===void 0&&(o.value[C.path]=!0)})},{immediate:!0});const S=()=>{d.value+=50};return(w,E)=>{const b=ze("TreeSubfolderList",!0);return y(),T("ul",{ref_key:"parentSubfolderList",ref:u,class:"vuefinder__treesubfolderlist__container"},[h.value.length?ue("",!0):(y(),T("li",KN,[g("div",YN,L(m(a)("No folders")),1)])),(y(!0),T(Ie,null,He(h.value,C=>(y(),T("li",{key:C.path,class:"vuefinder__treesubfolderlist__item"},[g("div",GN,[g("div",{class:"vuefinder__treesubfolderlist__item-toggle",onClick:x=>o.value[C.path]=!o.value[C.path]},[j(s_,{modelValue:o.value[C.path],"onUpdate:modelValue":x=>o.value[C.path]=x,storage:t.storage,path:C.path},null,8,["modelValue","onUpdate:modelValue","storage","path"])],8,QN),g("div",We({class:"vuefinder__treesubfolderlist__item-link",title:C.path},bn(m(i).events({...C,dir:C.path,extension:"",file_size:null,last_modified:null,mime_type:null,visibility:"public"}),!0),{onDblclick:x=>o.value[C.path]=!o.value[C.path],onClick:x=>m(e).adapter.open(C.path)}),[g("div",JN,[m(l)?.path===C.path?(y(),ne(m(mu),{key:0,class:"vuefinder__item-icon__folder--open"})):(y(),ne(m(Nn),{key:1,class:"vuefinder__item-icon__folder"}))]),g("div",{class:Ae(["vuefinder__treesubfolderlist__item-text",{"vuefinder__treesubfolderlist__item-text--active":m(l).path===C.path}])},L(C.basename),3)],16,XN)]),g("div",ZN,[it(j(b,{storage:c.storage,path:C.path},null,8,["storage","path"]),[[En,o.value[C.path]]])])]))),128)),f.value?(y(),T("li",eU,[g("div",{class:"vuefinder__treesubfolderlist__load-more",onClick:S},L(m(a)("load more")),1)])):ue("",!0)],512)}}}),nU=Se({__name:"TreeStorageItem",props:{storage:{}},setup(t){const e=je(),n=e.fs,i=e.config,o=t,r=ke(i.state),s=te(()=>{const v=r.value.expandedTreePaths||[],f=`${o.storage}://`;return v.some(p=>p===f||p.startsWith(`${f}`))}),a=H(r.value.expandTreeByDefault||s.value),l=cr(e,["vuefinder__drag-over"]),c=ke(n.path),u=te(()=>o.storage===c.value?.storage);Oe(()=>({expandTreeByDefault:r.value.expandTreeByDefault,hasExpandedPathInStorage:s.value}),v=>{(v.expandTreeByDefault||v.hasExpandedPathInStorage)&&(a.value=!0)});const d={storage:o.storage,path:o.storage+"://",dir:o.storage+"://",type:"dir",basename:o.storage,extension:"",file_size:null,last_modified:null,mime_type:null,visibility:"public"};function h(v){v===c.value?.storage?a.value=!a.value:e.adapter.open(v+"://")}return(v,f)=>(y(),T(Ie,null,[g("div",{class:"vuefinder__treestorageitem__header",onClick:f[2]||(f[2]=p=>h(t.storage))},[g("div",We({class:["vuefinder__treestorageitem__info",u.value?"vuefinder__treestorageitem__info--active":""]},bn(m(l).events(d),!0)),[g("div",{class:Ae(["vuefinder__treestorageitem__icon",u.value?"vuefinder__treestorageitem__icon--active":""])},[j(m(fu))],2),g("div",null,L(t.storage),1)],16),g("div",{class:"vuefinder__treestorageitem__loader",onClick:f[1]||(f[1]=Ye(p=>a.value=!a.value,["stop"]))},[j(s_,{modelValue:a.value,"onUpdate:modelValue":f[0]||(f[0]=p=>a.value=p),storage:t.storage,path:t.storage+"://"},null,8,["modelValue","storage","path"])])]),it(j(tU,{storage:t.storage,path:t.storage+"://",class:"vuefinder__treestorageitem__subfolder"},null,8,["storage","path"]),[[En,a.value]])],64))}}),iU={class:"vuefinder__folder-indicator"},oU={class:"vuefinder__folder-indicator--icon"},rU=Se({__name:"FolderIndicator",props:{modelValue:{type:Boolean},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=Zl(t,"modelValue");return(n,i)=>(y(),T("div",iU,[g("div",oU,[e.value?(y(),ne(m(Js),{key:0,class:"vuefinder__folder-indicator--minus"})):ue("",!0),e.value?ue("",!0):(y(),ne(m(Xs),{key:1,class:"vuefinder__folder-indicator--plus"}))])]))}}),sU={key:0,class:"vuefinder__treeview__header"},aU={class:"vuefinder__treeview__pinned-label"},lU={class:"vuefinder__treeview__pin-text text-nowrap"},cU={key:0,class:"vuefinder__treeview__pinned-list"},uU=["onClick"],dU=["title"],hU=["onClick"],pU={key:0},fU={class:"vuefinder__treeview__no-pinned"},mU=Se({__name:"TreeView",setup(t){const e=je(),{enabled:n}=Tn(),{t:i}=e.i18n,{getStore:o,setStore:r}=e.storage,s=e.fs,a=e.config,l=ke(a.state),c=ke(s.sortedFiles),u=ke(s.storages),d=te(()=>u.value||[]),h=ke(s.path),v=cr(e,["vuefinder__drag-over"]),f=H(190),p=H(o("pinned-folders-opened",!0));Oe(p,E=>r("pinned-folders-opened",E));const _=E=>{const b=a.get("pinnedFolders");a.set("pinnedFolders",b.filter(C=>C.path!==E.path))},S=E=>{const b=E.clientX,C=E.target.parentElement;if(!C)return;const x=C.getBoundingClientRect().width;C.classList.remove("transition-[width]"),C.classList.add("transition-none");const k=K=>{f.value=x+K.clientX-b,f.value<50&&(f.value=0,a.set("showTreeView",!1)),f.value>50&&a.set("showTreeView",!0)},O=()=>{const K=C.getBoundingClientRect();f.value=K.width,C.classList.add("transition-[width]"),C.classList.remove("transition-none"),window.removeEventListener("mousemove",k),window.removeEventListener("mouseup",O)};window.addEventListener("mousemove",k),window.addEventListener("mouseup",O)},w=H(null);return et(()=>{w.value&&hn(w.value,{overflow:{x:"hidden"},scrollbars:{theme:"vf-scrollbars-theme"}})}),Oe(c,E=>{const b=E.filter(C=>C.type==="dir");r_(e.treeViewData,{path:h.value.path||"",folders:b.map(C=>({storage:C.storage,path:C.path,basename:C.basename,type:"dir"}))})}),(E,b)=>(y(),T(Ie,null,[g("div",{class:Ae(["vuefinder__treeview__overlay",m(l).showTreeView?"vuefinder__treeview__backdrop":"hidden"]),onClick:b[0]||(b[0]=C=>m(a).toggle("showTreeView"))},null,2),g("div",{style:At(m(l).showTreeView?"min-width:100px;max-width:75%; width: "+f.value+"px":"width: 0"),class:"vuefinder__treeview__container"},[g("div",{ref_key:"treeViewScrollElement",ref:w,class:"vuefinder__treeview__scroll"},[m(n)("pinned")?(y(),T("div",sU,[g("div",{class:"vuefinder__treeview__pinned-toggle",onClick:b[2]||(b[2]=C=>p.value=!p.value)},[g("div",aU,[j(m(pu),{class:"vuefinder__treeview__pin-icon"}),g("div",lU,L(m(i)("Pinned Folders")),1)]),j(rU,{modelValue:p.value,"onUpdate:modelValue":b[1]||(b[1]=C=>p.value=C)},null,8,["modelValue"])]),p.value?(y(),T("ul",cU,[(y(!0),T(Ie,null,He(m(l).pinnedFolders,C=>(y(),T("li",{key:C.path,class:"vuefinder__treeview__pinned-item"},[g("div",We({class:"vuefinder__treeview__pinned-folder"},bn(m(v).events(C),!0),{onClick:x=>m(e).adapter.open(C.path)}),[m(h).path!==C.path?(y(),ne(m(Nn),{key:0,class:"vuefinder__treeview__folder-icon vuefinder__item-icon__folder"})):ue("",!0),m(h).path===C.path?(y(),ne(m(mu),{key:1,class:"vuefinder__item-icon__folder--open vuefinder__treeview__open-folder-icon"})):ue("",!0),g("div",{title:C.path,class:Ae(["vuefinder__treeview__folder-name",{"vuefinder__treeview__folder-name--active":m(h).path===C.path}])},L(C.basename),11,dU)],16,uU),g("div",{class:"vuefinder__treeview__remove-folder",onClick:x=>_(C)},[j(m(HN),{class:"vuefinder__treeview__remove-icon"})],8,hU)]))),128)),m(l).pinnedFolders.length?ue("",!0):(y(),T("li",pU,[g("div",fU,L(m(i)("No folders pinned")),1)]))])):ue("",!0)])):ue("",!0),(y(!0),T(Ie,null,He(d.value,C=>(y(),T("div",{key:C,class:"vuefinder__treeview__storage"},[j(nU,{storage:C},null,8,["storage"])]))),128))],512),g("div",{class:"vuefinder__treeview__resize-handle",onMousedown:S},null,32)],4)],64))}}),xt={new_folder:"new_folder",selectAll:"selectAll",pinFolder:"pinFolder",unpinFolder:"unpinFolder",delete:"delete",refresh:"refresh",preview:"preview",open:"open",openDir:"openDir",download:"download",archive:"archive",unarchive:"unarchive",rename:"rename",move:"move",copy:"copy",paste:"paste"};function vU(t){return t.items.length>1&&t.items.some(e=>e.path===t.target?.path)?"many":t.target?"one":"none"}function mt(t){const e=Object.assign({needsSearchQuery:!1},t);return(n,i)=>!(e.needsSearchQuery!==!!i.searchQuery||e.target!==void 0&&e.target!==vU(i)||e.targetType!==void 0&&e.targetType!==i.target?.type||e.mimeType!==void 0&&e.mimeType!==i.target?.mime_type||e.feature!==void 0&&!(n.features[e.feature]??!1))}function So(...t){return(e,n)=>t.some(i=>i(e,n))}function Co(...t){return(e,n)=>t.every(i=>i(e,n))}const a_=[{id:xt.openDir,title:({t})=>t("Open containing folder"),action:(t,e)=>{const n=e[0];n&&t.adapter.open(n.dir)},show:mt({target:"one",needsSearchQuery:!0}),order:10},{id:xt.refresh,title:({t})=>t("Refresh"),action:t=>{const e=t.fs;t.adapter.invalidateListQuery(e.path.get().path),t.adapter.open(e.path.get().path)},show:So(mt({target:"none"}),mt({target:"many"})),order:20},{id:xt.selectAll,title:({t})=>t("Select All"),action:t=>{t.fs.selectAll(t.selectionMode||"multiple")},show:(t,e)=>t.selectionMode==="multiple"&&mt({target:"none"})(t,e),order:30},{id:xt.new_folder,title:({t})=>t("New Folder"),action:t=>t.modal.open(bu),show:mt({target:"none",feature:"newfolder"}),order:40},{id:xt.open,title:({t})=>t("Open"),action:(t,e)=>{e[0]&&t.adapter.open(e[0].path)},show:mt({target:"one",targetType:"dir"}),order:50},{id:xt.pinFolder,title:({t})=>t("Pin Folder"),action:(t,e)=>{const n=t.config,i=n.get("pinnedFolders"),o=i.concat(e.filter(r=>i.findIndex(s=>s.path===r.path)===-1));n.set("pinnedFolders",o)},show:Co(mt({target:"one",targetType:"dir",feature:"pinned"}),(t,e)=>t.config.get("pinnedFolders").findIndex(n=>n.path===e.target?.path)===-1),order:60},{id:xt.unpinFolder,title:({t})=>t("Unpin Folder"),action:(t,e)=>{const n=t.config,i=n.get("pinnedFolders");n.set("pinnedFolders",i.filter(o=>!e.find(r=>r.path===o.path)))},show:Co(mt({target:"one",targetType:"dir",feature:"pinned"}),(t,e)=>t.config.get("pinnedFolders").findIndex(n=>n.path===e.target?.path)!==-1),order:70},{id:xt.preview,title:({t})=>t("Preview"),action:(t,e)=>t.modal.open(lr,{storage:e[0]?.storage,item:e[0]}),show:Co(mt({target:"one",feature:"preview"}),(t,e)=>e.target?.type!=="dir"),order:80},{id:xt.download,link:(t,e)=>{if(e[0])return t.adapter.getDownloadUrl(e[0])},title:({t})=>t("Download"),action:()=>{},show:Co(mt({target:"one",feature:"download"}),(t,e)=>e.target?.type!=="dir"),order:90},{id:xt.rename,title:({t})=>t("Rename"),action:(t,e)=>t.modal.open(Qs,{items:e}),show:mt({target:"one",feature:"rename"}),order:100},{id:xt.move,title:({t})=>t("Move files"),action:(t,e)=>{const n=t.fs,i={storage:n.path.get().storage||"",path:n.path.get().path||"",type:"dir"};t.modal.open(uo,{items:{from:e,to:i}})},show:So(mt({target:"one",feature:"move"}),mt({target:"many",feature:"move"})),order:110},{id:xt.copy,title:({t})=>t("Copy"),action:(t,e)=>{e.length>0&&t.fs.setClipboard("copy",new Set(e.map(n=>n.path)))},show:So(mt({target:"one",feature:"copy"}),mt({target:"many",feature:"copy"})),order:120},{id:xt.paste,title:({t})=>t("Paste"),action:(t,e)=>{const n=t.fs.getClipboard();if(n?.items?.size>0){const i=t.fs.path.get();let o=i.path,r=i.storage;e.length===1&&e[0]?.type==="dir"&&(o=e[0].path,r=e[0].storage);const s={storage:r||"",path:o||"",type:"dir"};t.modal.open(n.type==="cut"?uo:gu,{items:{from:Array.from(n.items),to:s}})}},show:(t,e)=>t.features?.copy??!1?t.fs.getClipboard()?.items?.size>0:!1,order:130},{id:xt.archive,title:({t})=>t("Archive"),action:(t,e)=>t.modal.open(Su,{items:e}),show:So(mt({target:"many",feature:"archive"}),Co(mt({target:"one",feature:"archive"}),(t,e)=>e.target?.mime_type!=="application/zip")),order:140},{id:xt.unarchive,title:({t})=>t("Unarchive"),action:(t,e)=>t.modal.open(Eu,{items:e}),show:mt({target:"one",feature:"unarchive",mimeType:"application/zip"}),order:150},{id:xt.delete,title:({t})=>t("Delete"),action:(t,e)=>{t.modal.open(Gs,{items:e})},show:So(mt({feature:"delete",target:"one"}),mt({feature:"delete",target:"many"})),order:160}],gU=["data-theme"],_U={key:0,class:"vuefinder__external-drop-overlay vuefinder__external-drop-overlay--relative"},yU={class:"vuefinder__external-drop-message"},bU={class:"vuefinder__main__content"},wU=Se({__name:"VueFinderView",props:{id:{},driver:{},config:{},features:{},debug:{type:Boolean},locale:{},contextMenuItems:{},selectionMode:{},selectionFilterType:{},selectionFilterMimeIncludes:{},onError:{type:Function},onSelect:{type:Function},onPathChange:{type:Function},onUploadComplete:{type:Function},onDeleteComplete:{type:Function},onNotify:{type:Function},onReady:{type:Function},onFileDclick:{type:Function},onFolderDclick:{type:Function},customUploader:{type:Function}},emits:["select","path-change","upload-complete","delete-complete","notify","error","ready","file-dclick","folder-dclick","update:locale"],setup(t,{emit:e}){const n=e,i=t,o=je(),r=In("root"),s=o.config;Oe(()=>i.features,w=>{const E=Lg(w);Object.keys(o.features).forEach(b=>{delete o.features[b]}),Object.assign(o.features,E)},{deep:!0});const a=o.fs,l=ke(o.i18n.localeAtom),c=ke(s.state),u=te(()=>{const w=c.value;return{"--vf-grid-item-width":`${w.gridItemWidth}px`,"--vf-grid-item-height":`${w.gridItemHeight}px`,"--vf-grid-item-gap":`${w.gridItemGap}px`,"--vf-grid-icon-size":`${w.gridIconSize}px`,"--vf-list-item-height":`${w.listItemHeight}px`,"--vf-list-item-gap":`${w.listItemGap}px`,"--vf-list-icon-size":`${w.listIconSize}px`}});CL();const{isDraggingExternal:d,handleDragEnter:h,handleDragOver:v,handleDragLeave:f,handleDrop:p}=xL();function _(w){a.setPath(w.dirname),s.get("persist")&&s.set("path",w.dirname),a.setReadOnly(w.read_only??!1),o.modal.close(),a.setFiles(w.files),a.clearSelection(),a.setSelectedCount(0),a.setStorages(w.storages)}o.adapter.onBeforeOpen=()=>{a.setLoading(!0)},o.adapter.onAfterOpen=w=>{_(w),a.setLoading(!1)},o.emitter.on("vf-upload-complete",w=>{n("upload-complete",w)}),o.emitter.on("vf-delete-complete",w=>{n("delete-complete",w)}),o.emitter.on("vf-notify",w=>{n("notify",w)}),o.emitter.on("vf-file-dclick",w=>{n("file-dclick",w)}),o.emitter.on("vf-folder-dclick",w=>{n("folder-dclick",w)}),Oe(()=>i.config?.theme,w=>{w&&s.set("theme",m(w))},{immediate:!0}),Oe(l,(w,E)=>{w!==E&&n("update:locale",String(w))},{immediate:!1}),et(()=>{o.root=r.value,Oe(()=>s.get("path"),E=>{o.adapter.open(E)});const w=s.get("persist")?s.get("path"):s.get("initialPath")??"";a.setPath(w),o.adapter.open(w),a.path.listen(E=>{n("path-change",E.path)}),a.selectedItems.listen(E=>{n("select",E)}),n("ready")});const S=async w=>{const E=await p(w);E.length>0&&(o.modal.open(wu),setTimeout(()=>{o.emitter.emit("vf-external-files-dropped",E.map(b=>b.file))},100))};return(w,E)=>(y(),T("div",{ref_key:"root",ref:r,tabindex:"0",class:Ae(["vuefinder vuefinder__main vuefinder__themer",{"vuefinder--dragging-external":m(d)}]),"data-theme":m(o).theme.current,style:At(u.value),onDragenter:E[2]||(E[2]=(...b)=>m(h)&&m(h)(...b)),onDragover:E[3]||(E[3]=(...b)=>m(v)&&m(v)(...b)),onDragleave:E[4]||(E[4]=(...b)=>m(f)&&m(f)(...b)),onDrop:S},[g("div",{class:Ae(m(o).theme.current),style:{height:"100%",width:"100%"}},[g("div",{class:Ae([m(c)?.fullScreen?"vuefinder__main__fixed":"vuefinder__main__relative","vuefinder__main__container"]),onMousedown:E[0]||(E[0]=b=>m(o).emitter.emit("vf-contextmenu-hide")),onTouchstart:E[1]||(E[1]=b=>m(o).emitter.emit("vf-contextmenu-hide"))},[m(d)?(y(),T("div",_U,[g("div",yU,L(m(o).i18n.t("Drag and drop the files/folders to here.")),1)])):ue("",!0),m(c).showMenuBar?(y(),ne(G4,{key:1})):ue("",!0),m(c).showToolbar?(y(),ne(Xj,{key:2})):ue("",!0),j(N3),g("div",bU,[j(mU),j(TN,{"on-file-dclick":i.onFileDclick,"on-folder-dclick":i.onFolderDclick},{icon:we(b=>[Ve(w.$slots,"icon",wn(Jn(b)))]),_:3},8,["on-file-dclick","on-folder-dclick"])]),j(zN,null,{actions:we(b=>[Ve(w.$slots,"status-bar",wn(Jn(b)))]),_:3})],34),(y(),ne(ws,{to:"body"},[j(Up,{name:"fade"},{default:we(()=>[m(o).modal.visible?(y(),ne(Ot(m(o).modal.type),{key:0})):ue("",!0)]),_:1})])),j(kN,{items:m(a_)},null,8,["items"]),m(c).notificationsEnabled?(y(),ne(m(vk),{key:0,position:m(c).notificationPosition,duration:m(c).notificationDuration,"visible-toasts":m(c).notificationVisibleToasts,"rich-colors":m(c).notificationRichColors},null,8,["position","duration","visible-toasts","rich-colors"])):ue("",!0)],2)],46,gU))}}),EU=Se({__name:"VueFinderProvider",props:{id:{},driver:{},config:{},features:{},debug:{type:Boolean,default:!1},locale:{},contextMenuItems:{default:()=>a_},selectionMode:{default:"multiple"},selectionFilterType:{default:"both"},selectionFilterMimeIncludes:{default:()=>[]},onError:{},onSelect:{},onPathChange:{},onUploadComplete:{},onDeleteComplete:{},onNotify:{},onReady:{},onFileDclick:{},onFolderDclick:{},customUploader:{}},setup(t){const e=t,n=e.id??ko(Gl);if(!n)throw new Error('VueFinderProvider requires an "id" prop.');const i=dM(e,ko("VueFinderOptions")||{});return Oe(()=>e.config,o=>{if(o){const r={};for(const s in o){const a=m(o[s]);a!==void 0&&(r[s]=a)}i.config.init(r)}},{deep:!0,immediate:!0}),Oe(()=>e.locale,o=>{o&&i.i18n.localeAtom&&i.i18n.localeAtom.get()!==o&&i.i18n.localeAtom.set(o)},{immediate:!0}),KI(n,i),Bp(Gl,n),bs(()=>{YI(n)}),(o,r)=>(y(),ne(wU,wn(Jn(e)),{icon:we(s=>[Ve(o.$slots,"icon",wn(Jn(s)))]),"status-bar":we(s=>[Ve(o.$slots,"status-bar",wn(Jn(s)))]),_:3},16))}});function Cz(t){const e=je(t),n=o=>o||e.fs.path.get().path||"",i=o=>{Array.isArray(o.files)&&e.fs.setFiles(o.files)};return{async refresh(){const o=e.fs.path.get().path||"";e.adapter.invalidateListQuery(o),await e.adapter.open(o)},async open(o){await e.adapter.open(o)},preview(o){const r=(e.fs.files.get()||[]).find(s=>s.path===o);!r||r.type!=="file"||e.modal.open(lr,{storage:r.storage,item:r})},notify(o,r){Bi(e,o,r)},getPath(){return e.fs.path.get().path||""},select(o){const r=new Set((e.fs.files.get()||[]).map(a=>a.path)),s=(o||[]).filter(a=>r.has(a));e.fs.setSelection(s)},selectOne(o){new Set((e.fs.files.get()||[]).map(r=>r.path)).has(o)&&e.fs.setSelection([o])},clearSelection(){e.fs.clearSelection()},getSelectedPaths(){return(e.fs.selectedItems.get()||[]).map(o=>o.path)},async createFolder(o,r){const s=await e.adapter.createFolder({path:n(r),name:o});i(s)},async createFile(o,r){const s=await e.adapter.createFile({path:n(r),name:o});i(s)},async delete(o,r){const s=n(r),a=new Map((e.fs.files.get()||[]).map(u=>[u.path,u])),l=(o||[]).map(u=>a.get(u)).filter(u=>!!u).map(u=>({path:u.path,type:u.type})),c=await e.adapter.delete({path:s,items:l});i(c)},async rename(o,r,s){const a=await e.adapter.rename({path:n(s),item:o,name:r});i(a)},async copy(o,r,s){const a=await e.adapter.copy({path:n(s),sources:o,destination:r});i(a)},async move(o,r,s){const a=await e.adapter.move({path:n(s),sources:o,destination:r});i(a)},getFiles(){return e.fs.files.get()||[]},getStorages(){return e.fs.storages.get()||[]},isLoading(){return e.fs.isLoading()},isReadOnly(){return e.fs.getReadOnly()}}}const SU={install(t,e={}){e.i18n=e.i18n??{};const[n]=Object.keys(e.i18n);e.locale=e.locale??n??"en",t.provide("VueFinderOptions",e),t.component("VueFinder",EU)}};function CU(t){t.use(SU,{i18n:{zhCN:()=>nt(()=>import("./zhCN-0_iHo67e.js"),[],import.meta.url),en:()=>nt(()=>import("./en-C_Tot-hO.js"),[],import.meta.url)}})}const xU=()=>{const{i18n:t}=_c;let e=!1,n=null,i=[];async function o(){return e&&n||(e=!0,n=(async()=>{try{return(await ki.v1Token.tokencontrollerRefresh({headers:{[Ti]:wi.generateBearerToken(F0())}})).code===0}catch(p){return console.error(p),!1}finally{e=!1,n=null}})()),n}async function r(p){return l(p)?(vr.error(t.global.t("message.error.loginExpired")),Qi().logoutDialog(),Promise.reject(t.global.t("message.error.loginExpired"))):new Promise((_,S)=>{i.push({resolve:_,reject:S,config:p}),e||o().then(w=>{w?i.forEach(({resolve:E,reject:b,config:C})=>{C.headers[si]=wi.generateBearerToken(is()),a(C),d.request(C).then(E).catch(b)}):(i.forEach(({reject:E})=>E(t.global.t("message.error.refreshFailed"))),vr.error(t.global.t("message.error.loginExpired")),Qi().logoutDialog()),i=[]})})}function s(p){return p.headers[bt.CSRF_TOKEN_HEADER_NAME]=hm.get(bt.CSRF_KEY),p.headers[si]=wi.generateBearerToken(is()),p.headers[bt.ACCEPT_LANGUAGE_HEADER_NAME]=t.global.locale.value,p}function a(p){p.headers["X-Token-Refreshed"]="true"}function l(p){return p.headers["X-Token-Refreshed"]==="true"}async function c(p){if(p.headers[si]){const _=wi.extractBearerToken(p.headers[si]);M0(_),p.config.headers[si]=wi.generateBearerToken(_)}if(p.headers[Ti]){const _=wi.extractBearerToken(p.headers[Ti]);L0(_),p.config.headers[Ti]=wi.generateBearerToken(_)}if(p.data.code===jd.Unauthorized&&!p.config.url?.includes("/api/v1/token/refresh"))return r(p.config);if(p.data.code===jd.Forbidden)return Qi().logoutDialog(),Promise.reject(t.global.t("user.notLoggedIn"));if(p.data.code!==0){const _=p.data.message||t.global.t("message.error.requestFailed");return vr.error(_),Promise.reject(_)}return p.data}function u(p){return console.error(p),vr.error(p.message),Promise.reject(p)}const d=Nd(bt.REMOTE_SERVICE_PREFIX,{baseURL:`/${bt.REMOTE_SERVICE_PREFIX}`});d.interceptors.request.use(s,u),d.interceptors.response.use(c,u);const h=$0(),v=window.__GLOBAL_CONFIG__?.projectHash,f=Nd(bt.LOCAL_SERVICE_PREFIX,{baseURL:`${h}/${v}`});f.interceptors.request.use(s,u),f.interceptors.response.use(c,u)},l_=vi("setting",{state:()=>({dependencies:[],devDependencies:[],packageJson:{}}),getters:{vueVersion:t=>t.dependencies.find(e=>e.name==="vue")?.version||"",deps:t=>[...t.dependencies,...t.devDependencies],compHubVersion:()=>window.__GLOBAL_CONFIG__.version||""},actions:{setDependencies(t){this.$patch(e=>{e.dependencies=t})},setDevDependencies(t){this.$patch(e=>{e.devDependencies=t})},setPackageJson(t){this.$patch(e=>{e.packageJson=t})},async initSetting(){await this.fetchPackageJson(),await this.initPreviewSetting()},async fetchPackageJson(){await nC.v1Comp.compcontrollerPackagejson().then(t=>{const e=t.data?.packageJson??{};this.setPackageJson(e)})},async initPreviewSetting(){const t=Ji(V0,{dependencies:[],devDependencies:[]}),{dependencies:e=[],devDependencies:n=[]}=t.value,i=Object.entries(this.packageJson?.dependencies??{}).map(([r,s])=>{const a=e.find(l=>l.name===r);return{name:r,version:s,match:a?.match??bt.COMP_MATCH_TYPE_MAJOR_VERSION}}),o=Object.entries(this.packageJson?.devDependencies??{}).map(([r,s])=>{const a=n.find(l=>l.name===r);return{name:r,version:s,match:a?.match??bt.COMP_MATCH_TYPE_MAJOR_VERSION}});t.value={dependencies:i,devDependencies:o},this.setDependencies(i),this.setDevDependencies(o)}}}),TU=vi("upgrade",{state:()=>({upgradeInfo:{}}),getters:{isForceUpgrade:t=>t.upgradeInfo.hasUpgrade&&t.upgradeInfo.isForce,isUpgrade:t=>t.upgradeInfo.hasUpgrade,upgradeDesc:t=>t.upgradeInfo.desc,latestVersion:t=>t.upgradeInfo.latestVersion,hasUpgrade:t=>t.upgradeInfo.hasUpgrade},actions:{setUpgradeInfo(t){this.$patch(e=>{e.upgradeInfo=t})},async getUpgradeInfo(){if(Object.keys(this.upgradeInfo).length>0)return;const t=l_(),e=await ki.v2Upgrade.upgradecontrollerv2Check({compHubVersion:t.compHubVersion});this.setUpgradeInfo(e.data)}}});var ns={exports:{}};var OU=ns.exports,Np;function $U(){return Np||(Np=1,(function(t,e){(function(n,i){t.exports=i()})(OU,function(){var n={};n.version="0.2.0";var i=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};n.configure=function(f){var p,_;for(p in f)_=f[p],_!==void 0&&f.hasOwnProperty(p)&&(i[p]=_);return this},n.status=null,n.set=function(f){var p=n.isStarted();f=o(f,i.minimum,1),n.status=f===1?null:f;var _=n.render(!p),S=_.querySelector(i.barSelector),w=i.speed,E=i.easing;return _.offsetWidth,a(function(b){i.positionUsing===""&&(i.positionUsing=n.getPositioningCSS()),l(S,s(f,w,E)),f===1?(l(_,{transition:"none",opacity:1}),_.offsetWidth,setTimeout(function(){l(_,{transition:"all "+w+"ms linear",opacity:0}),setTimeout(function(){n.remove(),b()},w)},w)):setTimeout(b,w)}),this},n.isStarted=function(){return typeof n.status=="number"},n.start=function(){n.status||n.set(0);var f=function(){setTimeout(function(){n.status&&(n.trickle(),f())},i.trickleSpeed)};return i.trickle&&f(),this},n.done=function(f){return!f&&!n.status?this:n.inc(.3+.5*Math.random()).set(1)},n.inc=function(f){var p=n.status;return p?(typeof f!="number"&&(f=(1-p)*o(Math.random()*p,.1,.95)),p=o(p+f,0,.994),n.set(p)):n.start()},n.trickle=function(){return n.inc(Math.random()*i.trickleRate)},(function(){var f=0,p=0;n.promise=function(_){return!_||_.state()==="resolved"?this:(p===0&&n.start(),f++,p++,_.always(function(){p--,p===0?(f=0,n.done()):n.set((f-p)/f)}),this)}})(),n.render=function(f){if(n.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var p=document.createElement("div");p.id="nprogress",p.innerHTML=i.template;var _=p.querySelector(i.barSelector),S=f?"-100":r(n.status||0),w=document.querySelector(i.parent),E;return l(_,{transition:"all 0 linear",transform:"translate3d("+S+"%,0,0)"}),i.showSpinner||(E=p.querySelector(i.spinnerSelector),E&&v(E)),w!=document.body&&u(w,"nprogress-custom-parent"),w.appendChild(p),p},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(i.parent),"nprogress-custom-parent");var f=document.getElementById("nprogress");f&&v(f)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var f=document.body.style,p="WebkitTransform"in f?"Webkit":"MozTransform"in f?"Moz":"msTransform"in f?"ms":"OTransform"in f?"O":"";return p+"Perspective"in f?"translate3d":p+"Transform"in f?"translate":"margin"};function o(f,p,_){return f<p?p:f>_?_:f}function r(f){return(-1+f)*100}function s(f,p,_){var S;return i.positionUsing==="translate3d"?S={transform:"translate3d("+r(f)+"%,0,0)"}:i.positionUsing==="translate"?S={transform:"translate("+r(f)+"%,0)"}:S={"margin-left":r(f)+"%"},S.transition="all "+p+"ms "+_,S}var a=(function(){var f=[];function p(){var _=f.shift();_&&_(p)}return function(_){f.push(_),f.length==1&&p()}})(),l=(function(){var f=["Webkit","O","Moz","ms"],p={};function _(b){return b.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(C,x){return x.toUpperCase()})}function S(b){var C=document.body.style;if(b in C)return b;for(var x=f.length,k=b.charAt(0).toUpperCase()+b.slice(1),O;x--;)if(O=f[x]+k,O in C)return O;return b}function w(b){return b=_(b),p[b]||(p[b]=S(b))}function E(b,C,x){C=w(C),b.style[C]=x}return function(b,C){var x=arguments,k,O;if(x.length==2)for(k in C)O=C[k],O!==void 0&&C.hasOwnProperty(k)&&E(b,k,O);else E(b,x[1],x[2])}})();function c(f,p){var _=typeof f=="string"?f:h(f);return _.indexOf(" "+p+" ")>=0}function u(f,p){var _=h(f),S=_+p;c(_,p)||(f.className=S.substring(1))}function d(f,p){var _=h(f),S;c(f,p)&&(S=_.replace(" "+p+" "," "),f.className=S.substring(1,S.length-1))}function h(f){return(" "+(f.className||"")+" ").replace(/\s+/gi," ")}function v(f){f&&f.parentNode&&f.parentNode.removeChild(f)}return n})})(ns)),ns.exports}var kU=$U();const Jl=Fi(kU),{i18n:AU}=_c;function PU(){no.beforeEach(async(t,e)=>{Jl.start();const n=Qo(),i=Qi(),o=l_(),r=TU();if(t.path!==e.path&&(await o.initSetting(),await i.fetchCsrfToken(),await r.getUpgradeInfo()),r.isForceUpgrade&&!t.path.startsWith("/upgrade"))return{path:"/upgrade"};if(t.path===e.path&&t.fullPath!==e.fullPath)return;const s=n.visitedViews.find(a=>a.path===t.path);if(s){if(t.fullPath===s.fullPath)return;const{hash:a="",query:l={}}=t,{query:c={},hash:u=""}=s,d=ey(c);if(!t.redirectedFrom){const h={query:{...d,...l},hash:a||u};return{path:t.path,...h}}}if(i.isAccessTokenExist()){if(t.meta.noAuth){if(t.path.startsWith("/login")){const a=t.query.type==="logout";if(i.isAccessTokenExist()&&!a)return"/"}else i.isRealUserLogin()||await i.fetchWhoAmI();return}if(i.isRealUserLogin()||await i.fetchWhoAmI(),!i.isRealUserLogin())return i.logoutDialog(),!1}else if(!t.meta.noAuth)return i.logoutDialog(),!1}),no.afterEach(t=>{const e=t.meta.title;document.title=AU.global.t(e)||bt.SITE_TITLE,Jl.done()})}Jl.configure({easing:"ease",speed:500,showSpinner:!1,trickleSpeed:200,parent:"body"});async function RU(t){await f$(),xU(),fm(t),mm(t),fx(t),Dx(t),PU(),Lx(),Vx(),p$(t),m$(t),v$(t),CU(t)}async function IU(){const t=nc(P0);await RU(t),t.mount("#app")}IU();export{Qo as A,L1 as B,WU as C,V0 as D,$2 as E,TU as F,a_ as G,XU as H,Yw as I,Qi as J,ez as K,jU as L,GU as M,YU as N,BU as R,KU as S,VU as T,JU as V,nt as _,ZU as a,NU as b,zU as c,Ug as d,QU as e,qU as f,HU as g,UU as h,C1 as i,rc as j,G0 as k,FU as l,_c as m,tz as n,Cz as o,nd as p,nC as q,V1 as r,Cb as s,ki as t,bt as u,gc as v,LU as w,$0 as x,T2 as y,l_ as z};
|