@gkd-kit/inspect 0.0.1716437342334 → 0.0.1716634348255
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/assets/ActionCard.vue_vue_type_script_setup_true_lang-BRhx9gZf.js +10 -0
- package/dist/assets/{ActionCard.vue_vue_type_script_setup_true_lang-DMUJiYIC.js.map → ActionCard.vue_vue_type_script_setup_true_lang-BRhx9gZf.js.map} +1 -1
- package/dist/assets/{DevicePage-DlHfRazd.js → DevicePage-BEZ_5T4M.js} +2 -2
- package/dist/assets/{DevicePage-DlHfRazd.js.map → DevicePage-BEZ_5T4M.js.map} +1 -1
- package/dist/assets/{HomePage-B5-XtqZK.js → HomePage-j6cnp_98.js} +2 -2
- package/dist/assets/{HomePage-B5-XtqZK.js.map → HomePage-j6cnp_98.js.map} +1 -1
- package/dist/assets/{ImportPage-NmZk2NIQ.js → ImportPage-3P_oEqNh.js} +2 -2
- package/dist/assets/{ImportPage-NmZk2NIQ.js.map → ImportPage-3P_oEqNh.js.map} +1 -1
- package/dist/assets/{PreviewSharePage-DBZ9J5cD.js → PreviewSharePage-DbgbnYOS.js} +2 -2
- package/dist/assets/{PreviewSharePage-DBZ9J5cD.js.map → PreviewSharePage-DbgbnYOS.js.map} +1 -1
- package/dist/assets/SnapshotPage-ClQ_eajX.js +272 -0
- package/dist/assets/SnapshotPage-ClQ_eajX.js.map +1 -0
- package/dist/assets/{TrackGraph-DVXBC2r-.js → TrackGraph-BfJ2hocE.js} +2 -2
- package/dist/assets/{TrackGraph-DVXBC2r-.js.map → TrackGraph-BfJ2hocE.js.map} +1 -1
- package/dist/assets/{_404Page-D90ldd9n.js → _404Page-V0rKtjbg.js} +2 -2
- package/dist/assets/{_404Page-D90ldd9n.js.map → _404Page-V0rKtjbg.js.map} +1 -1
- package/dist/assets/{fetch-BdKCpAQd.js → fetch-BP9rZdNm.js} +8 -8
- package/dist/assets/{fetch-BdKCpAQd.js.map → fetch-BP9rZdNm.js.map} +1 -1
- package/dist/assets/{import-C7-SJUae.js → import-DgPPm-Lo.js} +2 -2
- package/dist/assets/{import-C7-SJUae.js.map → import-DgPPm-Lo.js.map} +1 -1
- package/dist/assets/{index-BkglV3DN.js → index-4kY0Phxu.js} +24 -24
- package/dist/assets/index-4kY0Phxu.js.map +1 -0
- package/dist/assets/{index-DJFtWgCS.js → index-BCDsmgQl.js} +2 -2
- package/dist/assets/{index-DJFtWgCS.js.map → index-BCDsmgQl.js.map} +1 -1
- package/dist/assets/{index-4HDSNL4g.js → index-CVXVX2he.js} +16 -16
- package/dist/assets/{index-4HDSNL4g.js.map → index-CVXVX2he.js.map} +1 -1
- package/dist/assets/{jszip.min-Bnne_6Cm.js → jszip.min-GzXfKjB0.js} +2 -2
- package/dist/assets/{jszip.min-Bnne_6Cm.js.map → jszip.min-GzXfKjB0.js.map} +1 -1
- package/dist/assets/{node-C3SLkqqO.js → node-DRhIaRze.js} +2 -2
- package/dist/assets/{node-C3SLkqqO.js.map → node-DRhIaRze.js.map} +1 -1
- package/dist/assets/{selector-C-QrHNYQ.js → selector-Dy7EPILq.js} +3 -3
- package/dist/assets/{selector-C-QrHNYQ.js.map → selector-Dy7EPILq.js.map} +1 -1
- package/dist/assets/{table-Bm258-xU.js → table-DxndonME.js} +2 -2
- package/dist/assets/{table-Bm258-xU.js.map → table-DxndonME.js.map} +1 -1
- package/dist/index.html +3 -3
- package/package.json +1 -1
- package/dist/assets/ActionCard.vue_vue_type_script_setup_true_lang-DMUJiYIC.js +0 -10
- package/dist/assets/SnapshotPage-C26jJ-Sr.js +0 -272
- package/dist/assets/SnapshotPage-C26jJ-Sr.js.map +0 -1
- package/dist/assets/index-BkglV3DN.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{h as p,C as e,F as r,O as c,K as l,aB as d,aA as _,I as t}from"./index-
|
|
2
|
-
//# sourceMappingURL=_404Page-
|
|
1
|
+
import{h as p,C as e,F as r,O as c,K as l,aB as d,aA as _,I as t}from"./index-4kY0Phxu.js";const f={flex:"","flex-col":"","flex-items-center":"","w-100vw":"","pt-50px":"","gap-20px":""},u={key:0},m={key:1},k=p({__name:"_404Page",setup(h){var s;const n=_(),{fullPath:o}=(s=n.redirectedFrom)!=null?s:{};return(i,a)=>(t(),e("div",f,[r(o)?(t(),e("div",u,c("访问的地址 "+r(o)+" 不存在"),1)):(t(),e("div",m,"欢迎来到404页面")),l("a",{href:"/",onClick:a[0]||(a[0]=d(v=>i.$router.replace({path:"/"}),["prevent"]))}," 回到首页 ")]))}});export{k as default};
|
|
2
|
+
//# sourceMappingURL=_404Page-V0rKtjbg.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_404Page-
|
|
1
|
+
{"version":3,"file":"_404Page-V0rKtjbg.js","sources":["../../src/views/_404Page.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useRoute } from 'vue-router';\n\nconst route = useRoute();\n\nconst { fullPath } = route.redirectedFrom ?? {};\n</script>\n<template>\n <div flex flex-col flex-items-center w-100vw pt-50px gap-20px>\n <div v-if=\"fullPath\">{{ `访问的地址 ` + fullPath + ` 不存在` }}</div>\n <div v-else>欢迎来到404页面</div>\n <a href=\"/\" @click.prevent=\"$router.replace({ path: `/` })\"> 回到首页 </a>\n </div>\n</template>\n"],"names":["route","useRoute","fullPath","_a"],"mappings":"oPAGA,MAAMA,EAAQC,IAER,CAAE,SAAAC,CAAa,GAAAC,EAAAH,EAAM,iBAAN,KAAAG,EAAwB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as x,
|
|
1
|
+
import{e as x,ca as qe,cb as De,h as O,r as k,v as h,cc as Ue,b3 as xe,cd as Ve,J as Ce,a1 as I,ce as we,cf as ce,cg as de,ch as Ge,ci as Xe,G as W,a9 as G,S as X,ab as z,ac as q,ah as Qe,c as fe,aj as Je,a4 as E,b as m,cj as Ye,f as b,u as F,m as _,j as T,q as ue,a6 as Ze,a7 as eo,aY as ke,as as N,b4 as oo,ax as he,d as P,i as no,a3 as Se,n as R,N as to,am as B,b0 as Oe,x as io,ae as $e,ck as Ie,cl as je,cm as Le,cn as Pe,Q as ve,a8 as ro,co as so,B as ao,a_ as lo,b2 as co,ap as fo,cp as uo,an as ho,F as pe,cq as vo,bd as go,cr as me,at as po,aI as mo}from"./index-4kY0Phxu.js";function Q(o,e=[],t){const n={};return Object.getOwnPropertyNames(o).forEach(l=>{e.includes(l)||(n[l]=o[l])}),Object.assign(n,t)}const{cubicBezierEaseInOut:A,cubicBezierEaseOut:bo,cubicBezierEaseIn:yo}=qe;function xo({overflow:o="hidden",duration:e=".3s",originalTransition:t="",leavingDelay:n="0s",foldPadding:i=!1,enterToProps:l=void 0,leaveToProps:c=void 0,reverse:d=!1}={}){const r=d?"leave":"enter",a=d?"enter":"leave";return[x(`&.fade-in-height-expand-transition-${a}-from,
|
|
2
2
|
&.fade-in-height-expand-transition-${r}-to`,Object.assign(Object.assign({},l),{opacity:1})),x(`&.fade-in-height-expand-transition-${a}-to,
|
|
3
3
|
&.fade-in-height-expand-transition-${r}-from`,Object.assign(Object.assign({},c),{opacity:0,marginTop:"0 !important",marginBottom:"0 !important",paddingTop:i?"0 !important":void 0,paddingBottom:i?"0 !important":void 0})),x(`&.fade-in-height-expand-transition-${a}-active`,`
|
|
4
4
|
overflow: ${o};
|
|
@@ -20,14 +20,14 @@ import{e as x,c9 as qe,ca as De,h as O,r as k,v as h,cb as Ue,b2 as xe,cc as Ve,
|
|
|
20
20
|
padding-top ${e} ${A},
|
|
21
21
|
padding-bottom ${e} ${A}
|
|
22
22
|
${t?","+t:""}
|
|
23
|
-
`)]}const Co=Object.assign(Object.assign({},De),{onAfterEnter:Function,onAfterLeave:Function,transformOrigin:String,blockScroll:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},onEsc:Function,autoFocus:{type:Boolean,default:!0},internalStyle:[String,Object],maskClosable:{type:Boolean,default:!0},onPositiveClick:Function,onNegativeClick:Function,onClose:Function,onMaskClick:Function}),wo=O({name:"DialogEnvironment",props:Object.assign(Object.assign({},Co),{internalKey:{type:String,required:!0},to:[String,Object],onInternalAfterLeave:{type:Function,required:!0}}),setup(o){const e=k(!0);function t(){const{onInternalAfterLeave:s,internalKey:u,onAfterLeave:v}=o;s&&s(u),v&&v()}function n(s){const{onPositiveClick:u}=o;u?Promise.resolve(u(s)).then(v=>{v!==!1&&r()}):r()}function i(s){const{onNegativeClick:u}=o;u?Promise.resolve(u(s)).then(v=>{v!==!1&&r()}):r()}function l(){const{onClose:s}=o;s?Promise.resolve(s()).then(u=>{u!==!1&&r()}):r()}function c(s){const{onMaskClick:u,maskClosable:v}=o;u&&(u(s),v&&r())}function d(){const{onEsc:s}=o;s&&s()}function r(){e.value=!1}function a(s){e.value=s}return{show:e,hide:r,handleUpdateShow:a,handleAfterLeave:t,handleCloseClick:l,handleNegativeClick:i,handlePositiveClick:n,handleMaskClick:c,handleEsc:d}},render(){const{handlePositiveClick:o,handleUpdateShow:e,handleNegativeClick:t,handleCloseClick:n,handleAfterLeave:i,handleMaskClick:l,handleEsc:c,to:d,maskClosable:r,show:a}=this;return h(Ce,{show:a,onUpdateShow:e,onMaskClick:l,onEsc:c,to:d,maskClosable:r,onAfterEnter:this.onAfterEnter,onAfterLeave:i,closeOnEsc:this.closeOnEsc,blockScroll:this.blockScroll,autoFocus:this.autoFocus,transformOrigin:this.transformOrigin,internalAppear:!0,internalDialog:!0},{default:()=>h(Ue,Object.assign({},xe(this.$props,Ve),{style:this.internalStyle,onClose:n,onNegativeClick:t,onPositiveClick:o}))})}}),ko={injectionKey:String,to:[String,Object]},So=O({name:"DialogProvider",props:ko,setup(){const o=k([]),e={};function t(d={}){const r=
|
|
23
|
+
`)]}const Co=Object.assign(Object.assign({},De),{onAfterEnter:Function,onAfterLeave:Function,transformOrigin:String,blockScroll:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},onEsc:Function,autoFocus:{type:Boolean,default:!0},internalStyle:[String,Object],maskClosable:{type:Boolean,default:!0},onPositiveClick:Function,onNegativeClick:Function,onClose:Function,onMaskClick:Function}),wo=O({name:"DialogEnvironment",props:Object.assign(Object.assign({},Co),{internalKey:{type:String,required:!0},to:[String,Object],onInternalAfterLeave:{type:Function,required:!0}}),setup(o){const e=k(!0);function t(){const{onInternalAfterLeave:s,internalKey:u,onAfterLeave:v}=o;s&&s(u),v&&v()}function n(s){const{onPositiveClick:u}=o;u?Promise.resolve(u(s)).then(v=>{v!==!1&&r()}):r()}function i(s){const{onNegativeClick:u}=o;u?Promise.resolve(u(s)).then(v=>{v!==!1&&r()}):r()}function l(){const{onClose:s}=o;s?Promise.resolve(s()).then(u=>{u!==!1&&r()}):r()}function c(s){const{onMaskClick:u,maskClosable:v}=o;u&&(u(s),v&&r())}function d(){const{onEsc:s}=o;s&&s()}function r(){e.value=!1}function a(s){e.value=s}return{show:e,hide:r,handleUpdateShow:a,handleAfterLeave:t,handleCloseClick:l,handleNegativeClick:i,handlePositiveClick:n,handleMaskClick:c,handleEsc:d}},render(){const{handlePositiveClick:o,handleUpdateShow:e,handleNegativeClick:t,handleCloseClick:n,handleAfterLeave:i,handleMaskClick:l,handleEsc:c,to:d,maskClosable:r,show:a}=this;return h(Ce,{show:a,onUpdateShow:e,onMaskClick:l,onEsc:c,to:d,maskClosable:r,onAfterEnter:this.onAfterEnter,onAfterLeave:i,closeOnEsc:this.closeOnEsc,blockScroll:this.blockScroll,autoFocus:this.autoFocus,transformOrigin:this.transformOrigin,internalAppear:!0,internalDialog:!0},{default:()=>h(Ue,Object.assign({},xe(this.$props,Ve),{style:this.internalStyle,onClose:n,onNegativeClick:t,onPositiveClick:o}))})}}),ko={injectionKey:String,to:[String,Object]},So=O({name:"DialogProvider",props:ko,setup(){const o=k([]),e={};function t(d={}){const r=G(),a=X(Object.assign(Object.assign({},d),{key:r,destroy:()=>{e[`n-dialog-${r}`].hide()}}));return o.value.push(a),a}const n=["info","success","warning","error"].map(d=>r=>t(Object.assign(Object.assign({},r),{type:d})));function i(d){const{value:r}=o;r.splice(r.findIndex(a=>a.key===d),1)}function l(){Object.values(e).forEach(d=>{d.hide()})}const c={create:t,destroyAll:l,info:n[0],success:n[1],warning:n[2],error:n[3]};return I(we,c),I(Ge,{clickedRef:ce(64),clickedPositionRef:de()}),I(Xe,o),Object.assign(Object.assign({},c),{dialogList:o,dialogInstRefs:e,handleAfterLeave:i})},render(){var o,e;return h(W,null,[this.dialogList.map(t=>h(wo,Q(t,["destroy","style"],{internalStyle:t.style,to:this.to,ref:n=>{n===null?delete this.dialogInstRefs[`n-dialog-${t.key}`]:this.dialogInstRefs[`n-dialog-${t.key}`]=n},internalKey:t.key,onInternalAfterLeave:this.handleAfterLeave}))),(e=(o=this.$slots).default)===null||e===void 0?void 0:e.call(o)])}});function Oo(){const o=z(we,null);return o===null&&q("use-dialog","No outer <n-dialog-provider /> founded."),o}const $o={closeMargin:"16px 12px",closeSize:"20px",closeIconSize:"16px",width:"365px",padding:"16px",titleFontSize:"16px",metaFontSize:"12px",descriptionFontSize:"12px"},Io=o=>{const{textColor2:e,successColor:t,infoColor:n,warningColor:i,errorColor:l,popoverColor:c,closeIconColor:d,closeIconColorHover:r,closeIconColorPressed:a,closeColorHover:s,closeColorPressed:u,textColor1:v,textColor3:g,borderRadius:f,fontWeightStrong:p,boxShadow2:y,lineHeight:w,fontSize:$}=o;return Object.assign(Object.assign({},$o),{borderRadius:f,lineHeight:w,fontSize:$,headerFontWeight:p,iconColor:e,iconColorSuccess:t,iconColorInfo:n,iconColorWarning:i,iconColorError:l,color:c,textColor:e,closeIconColor:d,closeIconColorHover:r,closeIconColorPressed:a,closeBorderRadius:f,closeColorHover:s,closeColorPressed:u,headerTextColor:v,descriptionTextColor:g,actionTextColor:e,boxShadow:y})},jo=Qe({name:"Notification",common:fe,peers:{Scrollbar:Je},self:Io}),Lo=jo,Po={margin:"0 0 8px 0",padding:"10px 20px",maxWidth:"720px",minWidth:"420px",iconMargin:"0 10px 0 0",closeMargin:"0 0 0 10px",closeSize:"20px",closeIconSize:"16px",iconSize:"20px",fontSize:"14px"},Ao=o=>{const{textColor2:e,closeIconColor:t,closeIconColorHover:n,closeIconColorPressed:i,infoColor:l,successColor:c,errorColor:d,warningColor:r,popoverColor:a,boxShadow2:s,primaryColor:u,lineHeight:v,borderRadius:g,closeColorHover:f,closeColorPressed:p}=o;return Object.assign(Object.assign({},Po),{closeBorderRadius:g,textColor:e,textColorInfo:e,textColorSuccess:e,textColorError:e,textColorWarning:e,textColorLoading:e,color:a,colorInfo:a,colorSuccess:a,colorError:a,colorWarning:a,colorLoading:a,boxShadow:s,boxShadowInfo:s,boxShadowSuccess:s,boxShadowError:s,boxShadowWarning:s,boxShadowLoading:s,iconColor:e,iconColorInfo:l,iconColorSuccess:c,iconColorWarning:r,iconColorError:d,iconColorLoading:u,closeColorHover:f,closeColorPressed:p,closeIconColor:t,closeIconColorHover:n,closeIconColorPressed:i,closeColorHoverInfo:f,closeColorPressedInfo:p,closeIconColorInfo:t,closeIconColorHoverInfo:n,closeIconColorPressedInfo:i,closeColorHoverSuccess:f,closeColorPressedSuccess:p,closeIconColorSuccess:t,closeIconColorHoverSuccess:n,closeIconColorPressedSuccess:i,closeColorHoverError:f,closeColorPressedError:p,closeIconColorError:t,closeIconColorHoverError:n,closeIconColorPressedError:i,closeColorHoverWarning:f,closeColorPressedWarning:p,closeIconColorWarning:t,closeIconColorHoverWarning:n,closeIconColorPressedWarning:i,closeColorHoverLoading:f,closeColorPressedLoading:p,closeIconColorLoading:t,closeIconColorHoverLoading:n,closeIconColorPressedLoading:i,loadingColor:u,lineHeight:v,borderRadius:g})},zo={name:"Message",common:fe,self:Ao},Ro=zo,Eo=o=>{const{primaryColor:e,errorColor:t}=o;return{colorError:t,colorLoading:e,height:"2px"}},Mo={name:"LoadingBar",common:fe,self:Eo},Ho=Mo,Ae=E("n-loading-bar"),ze=E("n-loading-bar-api"),Bo=m("loading-bar-container",`
|
|
24
24
|
z-index: 5999;
|
|
25
25
|
position: fixed;
|
|
26
26
|
top: 0;
|
|
27
27
|
left: 0;
|
|
28
28
|
right: 0;
|
|
29
29
|
height: 2px;
|
|
30
|
-
`,[
|
|
30
|
+
`,[Ye({enterDuration:"0.3s",leaveDuration:"0.8s"}),m("loading-bar",`
|
|
31
31
|
width: 100%;
|
|
32
32
|
transition:
|
|
33
33
|
max-width 4s linear,
|
|
@@ -45,7 +45,7 @@ import{e as x,c9 as qe,ca as De,h as O,r as k,v as h,cb as Ue,b2 as xe,cc as Ve,
|
|
|
45
45
|
transition:
|
|
46
46
|
max-width .2s linear,
|
|
47
47
|
background .2s linear;
|
|
48
|
-
`)])]);var D=function(o,e,t,n){function i(l){return l instanceof t?l:new t(function(c){c(l)})}return new(t||(t=Promise))(function(l,c){function d(s){try{a(n.next(s))}catch(u){c(u)}}function r(s){try{a(n.throw(s))}catch(u){c(u)}}function a(s){s.done?l(s.value):i(s.value).then(d,r)}a((n=n.apply(o,e||[])).next())})};function U(o,e){return`${e}-loading-bar ${e}-loading-bar--${o}`}const _o=O({name:"LoadingBar",props:{containerClass:String,containerStyle:[String,Object]},setup(){const{inlineThemeDisabled:o}=F(),{props:e,mergedClsPrefixRef:t}=z(Ae),n=k(null),i=k(!1),l=k(!1),c=k(!1),d=k(!1);let r=!1;const a=k(!1),s=_(()=>{const{loadingBarStyle:C}=e;return C?C[a.value?"error":"loading"]:""});function u(){return D(this,void 0,void 0,function*(){i.value=!1,c.value=!1,r=!1,a.value=!1,d.value=!0,yield N(),d.value=!1})}function v(C=0,M=80,H="starting"){return D(this,void 0,void 0,function*(){if(l.value=!0,yield u(),r)return;c.value=!0,yield N();const L=n.value;L&&(L.style.maxWidth=`${C}%`,L.style.transition="none",L.offsetWidth,L.className=U(H,t.value),L.style.transition="",L.style.maxWidth=`${M}%`)})}function g(){return D(this,void 0,void 0,function*(){if(r||a.value)return;l.value&&(yield N()),r=!0;const C=n.value;C&&(C.className=U("finishing",t.value),C.style.maxWidth="100%",C.offsetWidth,c.value=!1)})}function f(){if(!(r||a.value))if(!c.value)v(100,100,"error").then(()=>{a.value=!0;const C=n.value;C&&(C.className=U("error",t.value),C.offsetWidth,c.value=!1)});else{a.value=!0;const C=n.value;if(!C)return;C.className=U("error",t.value),C.style.maxWidth="100%",C.offsetWidth,c.value=!1}}function p(){i.value=!0}function y(){i.value=!1}function w(){return D(this,void 0,void 0,function*(){yield u()})}const $=T("LoadingBar","-loading-bar",Bo,Ho,e,t),j=_(()=>{const{self:{height:C,colorError:M,colorLoading:H}}=$.value;return{"--n-height":C,"--n-color-loading":H,"--n-color-error":M}}),S=o?ue("loading-bar",void 0,j,e):void 0;return{mergedClsPrefix:t,loadingBarRef:n,started:l,loading:c,entering:i,transitionDisabled:d,start:v,error:f,finish:g,handleEnter:p,handleAfterEnter:y,handleAfterLeave:w,mergedLoadingBarStyle:s,cssVars:o?void 0:j,themeClass:S==null?void 0:S.themeClass,onRender:S==null?void 0:S.onRender}},render(){if(!this.started)return null;const{mergedClsPrefix:o}=this;return h(ke,{name:"fade-in-transition",appear:!0,onEnter:this.handleEnter,onAfterEnter:this.handleAfterEnter,onAfterLeave:this.handleAfterLeave,css:!this.transitionDisabled},{default:()=>{var e;return(e=this.onRender)===null||e===void 0||e.call(this),
|
|
48
|
+
`)])]);var D=function(o,e,t,n){function i(l){return l instanceof t?l:new t(function(c){c(l)})}return new(t||(t=Promise))(function(l,c){function d(s){try{a(n.next(s))}catch(u){c(u)}}function r(s){try{a(n.throw(s))}catch(u){c(u)}}function a(s){s.done?l(s.value):i(s.value).then(d,r)}a((n=n.apply(o,e||[])).next())})};function U(o,e){return`${e}-loading-bar ${e}-loading-bar--${o}`}const _o=O({name:"LoadingBar",props:{containerClass:String,containerStyle:[String,Object]},setup(){const{inlineThemeDisabled:o}=F(),{props:e,mergedClsPrefixRef:t}=z(Ae),n=k(null),i=k(!1),l=k(!1),c=k(!1),d=k(!1);let r=!1;const a=k(!1),s=_(()=>{const{loadingBarStyle:C}=e;return C?C[a.value?"error":"loading"]:""});function u(){return D(this,void 0,void 0,function*(){i.value=!1,c.value=!1,r=!1,a.value=!1,d.value=!0,yield N(),d.value=!1})}function v(C=0,M=80,H="starting"){return D(this,void 0,void 0,function*(){if(l.value=!0,yield u(),r)return;c.value=!0,yield N();const L=n.value;L&&(L.style.maxWidth=`${C}%`,L.style.transition="none",L.offsetWidth,L.className=U(H,t.value),L.style.transition="",L.style.maxWidth=`${M}%`)})}function g(){return D(this,void 0,void 0,function*(){if(r||a.value)return;l.value&&(yield N()),r=!0;const C=n.value;C&&(C.className=U("finishing",t.value),C.style.maxWidth="100%",C.offsetWidth,c.value=!1)})}function f(){if(!(r||a.value))if(!c.value)v(100,100,"error").then(()=>{a.value=!0;const C=n.value;C&&(C.className=U("error",t.value),C.offsetWidth,c.value=!1)});else{a.value=!0;const C=n.value;if(!C)return;C.className=U("error",t.value),C.style.maxWidth="100%",C.offsetWidth,c.value=!1}}function p(){i.value=!0}function y(){i.value=!1}function w(){return D(this,void 0,void 0,function*(){yield u()})}const $=T("LoadingBar","-loading-bar",Bo,Ho,e,t),j=_(()=>{const{self:{height:C,colorError:M,colorLoading:H}}=$.value;return{"--n-height":C,"--n-color-loading":H,"--n-color-error":M}}),S=o?ue("loading-bar",void 0,j,e):void 0;return{mergedClsPrefix:t,loadingBarRef:n,started:l,loading:c,entering:i,transitionDisabled:d,start:v,error:f,finish:g,handleEnter:p,handleAfterEnter:y,handleAfterLeave:w,mergedLoadingBarStyle:s,cssVars:o?void 0:j,themeClass:S==null?void 0:S.themeClass,onRender:S==null?void 0:S.onRender}},render(){if(!this.started)return null;const{mergedClsPrefix:o}=this;return h(ke,{name:"fade-in-transition",appear:!0,onEnter:this.handleEnter,onAfterEnter:this.handleAfterEnter,onAfterLeave:this.handleAfterLeave,css:!this.transitionDisabled},{default:()=>{var e;return(e=this.onRender)===null||e===void 0||e.call(this),Ze(h("div",{class:[`${o}-loading-bar-container`,this.themeClass,this.containerClass],style:this.containerStyle},h("div",{ref:"loadingBarRef",class:[`${o}-loading-bar`],style:[this.cssVars,this.mergedLoadingBarStyle]})),[[eo,this.loading||!this.loading&&this.entering]])}})}}),No=Object.assign(Object.assign({},T.props),{to:{type:[String,Object,Boolean],default:void 0},containerClass:String,containerStyle:[String,Object],loadingBarStyle:{type:Object}}),Fo=O({name:"LoadingBarProvider",props:No,setup(o){const e=oo(),t=k(null),n={start(){var l;e.value?(l=t.value)===null||l===void 0||l.start():N(()=>{var c;(c=t.value)===null||c===void 0||c.start()})},error(){var l;e.value?(l=t.value)===null||l===void 0||l.error():N(()=>{var c;(c=t.value)===null||c===void 0||c.error()})},finish(){var l;e.value?(l=t.value)===null||l===void 0||l.finish():N(()=>{var c;(c=t.value)===null||c===void 0||c.finish()})}},{mergedClsPrefixRef:i}=F(o);return I(ze,n),I(Ae,{props:o,mergedClsPrefixRef:i}),Object.assign(n,{loadingBarRef:t})},render(){var o,e;return h(W,null,h(he,{disabled:this.to===!1,to:this.to||"body"},h(_o,{ref:"loadingBarRef",containerStyle:this.containerStyle,containerClass:this.containerClass})),(e=(o=this.$slots).default)===null||e===void 0?void 0:e.call(o))}});function To(){const o=z(ze,null);return o===null&&q("use-loading-bar","No outer <n-loading-bar-provider /> founded."),o}const Re={icon:Function,type:{type:String,default:"info"},content:[String,Number,Function],showIcon:{type:Boolean,default:!0},closable:Boolean,keepAliveOnHover:Boolean,onClose:Function,onMouseenter:Function,onMouseleave:Function},Ee=E("n-message-api"),Me=E("n-message-provider"),Ko=x([m("message-wrapper",`
|
|
49
49
|
margin: var(--n-margin);
|
|
50
50
|
z-index: 0;
|
|
51
51
|
transform-origin: top center;
|
|
@@ -138,7 +138,7 @@ import{e as x,c9 as qe,ca as De,h as O,r as k,v as h,cb as Ue,b2 as xe,cc as Ve,
|
|
|
138
138
|
right: 12px;
|
|
139
139
|
justify-content: flex-end;
|
|
140
140
|
align-items: flex-end;
|
|
141
|
-
`)])]),Wo={info:()=>h(Ie,null),success:()=>h(je,null),warning:()=>h(Le,null),error:()=>h(Pe,null),default:()=>null},qo=O({name:"Message",props:Object.assign(Object.assign({},Re),{render:Function}),setup(o){const{inlineThemeDisabled:e,mergedRtlRef:t}=F(o),{props:n,mergedClsPrefixRef:i}=z(Me),l=Se("Message",t,i),c=T("Message","-message",Ko,Ro,n,i),d=_(()=>{const{type:a}=o,{common:{cubicBezierEaseInOut:s},self:{padding:u,margin:v,maxWidth:g,iconMargin:f,closeMargin:p,closeSize:y,iconSize:w,fontSize:$,lineHeight:j,borderRadius:S,iconColorInfo:C,iconColorSuccess:M,iconColorWarning:H,iconColorError:L,iconColorLoading:J,closeIconSize:Y,closeBorderRadius:ee,[R("textColor",a)]:oe,[R("boxShadow",a)]:ne,[R("color",a)]:te,[R("closeColorHover",a)]:ie,[R("closeColorPressed",a)]:re,[R("closeIconColor",a)]:se,[R("closeIconColorPressed",a)]:ae,[R("closeIconColorHover",a)]:le}}=c.value;return{"--n-bezier":s,"--n-margin":v,"--n-padding":u,"--n-max-width":g,"--n-font-size":$,"--n-icon-margin":f,"--n-icon-size":w,"--n-close-icon-size":Y,"--n-close-border-radius":ee,"--n-close-size":y,"--n-close-margin":p,"--n-text-color":oe,"--n-color":te,"--n-box-shadow":ne,"--n-icon-color-info":C,"--n-icon-color-success":M,"--n-icon-color-warning":H,"--n-icon-color-error":L,"--n-icon-color-loading":J,"--n-close-color-hover":ie,"--n-close-color-pressed":re,"--n-close-icon-color":se,"--n-close-icon-color-pressed":ae,"--n-close-icon-color-hover":le,"--n-line-height":j,"--n-border-radius":S}}),r=e?ue("message",_(()=>o.type[0]),d,{}):void 0;return{mergedClsPrefix:i,rtlEnabled:l,messageProviderProps:n,handleClose(){var a;(a=o.onClose)===null||a===void 0||a.call(o)},cssVars:e?void 0:d,themeClass:r==null?void 0:r.themeClass,onRender:r==null?void 0:r.onRender,placement:n.placement}},render(){const{render:o,type:e,closable:t,content:n,mergedClsPrefix:i,cssVars:l,themeClass:c,onRender:d,icon:r,handleClose:a,showIcon:s}=this;d==null||d();let u;return h("div",{class:[`${i}-message-wrapper`,c],onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave,style:[{alignItems:this.placement.startsWith("top")?"flex-start":"flex-end"},l]},o?o(this.$props):h("div",{class:[`${i}-message ${i}-message--${e}-type`,this.rtlEnabled&&`${i}-message--rtl`]},(u=Do(r,e,i))&&s?h("div",{class:`${i}-message__icon ${i}-message__icon--${e}-type`},h(to,null,{default:()=>u})):null,h("div",{class:`${i}-message__content`},B(n)),t?h(Oe,{clsPrefix:i,class:`${i}-message__close`,onClick:a,absolute:!0}):null))}});function Do(o,e,t){if(typeof o=="function")return o();{const n=e==="loading"?h(io,{clsPrefix:t,strokeWidth:24,scale:.85}):Wo[e]();return n?h($e,{clsPrefix:t,key:e},{default:()=>n}):null}}const Uo=O({name:"MessageEnvironment",props:Object.assign(Object.assign({},Re),{duration:{type:Number,default:3e3},onAfterLeave:Function,onLeave:Function,internalKey:{type:String,required:!0},onInternalAfterLeave:Function,onHide:Function,onAfterHide:Function}),setup(o){let e=null;const t=k(!0);ve(()=>{n()});function n(){const{duration:s}=o;s&&(e=window.setTimeout(c,s))}function i(s){s.currentTarget===s.target&&e!==null&&(window.clearTimeout(e),e=null)}function l(s){s.currentTarget===s.target&&n()}function c(){const{onHide:s}=o;t.value=!1,e&&(window.clearTimeout(e),e=null),s&&s()}function d(){const{onClose:s}=o;s&&s(),c()}function r(){const{onAfterLeave:s,onInternalAfterLeave:u,onAfterHide:v,internalKey:g}=o;s&&s(),u&&u(g),v&&v()}function a(){c()}return{show:t,hide:c,handleClose:d,handleAfterLeave:r,handleMouseleave:l,handleMouseenter:i,deactivate:a}},render(){return h(ro,{appear:!0,onAfterLeave:this.handleAfterLeave,onLeave:this.onLeave},{default:()=>[this.show?h(qo,{content:this.content,type:this.type,icon:this.icon,showIcon:this.showIcon,closable:this.closable,onClose:this.handleClose,onMouseenter:this.keepAliveOnHover?this.handleMouseenter:void 0,onMouseleave:this.keepAliveOnHover?this.handleMouseleave:void 0}):null]})}}),Vo=Object.assign(Object.assign({},T.props),{to:[String,Object],duration:{type:Number,default:3e3},keepAliveOnHover:Boolean,max:Number,placement:{type:String,default:"top"},closable:Boolean,containerClass:String,containerStyle:[String,Object]}),Xo=O({name:"MessageProvider",props:Vo,setup(o){const{mergedClsPrefixRef:e}=F(o),t=k([]),n=k({}),i={create(r,a){return l(r,Object.assign({type:"default"},a))},info(r,a){return l(r,Object.assign(Object.assign({},a),{type:"info"}))},success(r,a){return l(r,Object.assign(Object.assign({},a),{type:"success"}))},warning(r,a){return l(r,Object.assign(Object.assign({},a),{type:"warning"}))},error(r,a){return l(r,Object.assign(Object.assign({},a),{type:"error"}))},loading(r,a){return l(r,Object.assign(Object.assign({},a),{type:"loading"}))},destroyAll:d};I(Me,{props:o,mergedClsPrefixRef:e}),I(Ee,i);function l(r,a){const s=X(),u=G(Object.assign(Object.assign({},a),{content:r,key:s,destroy:()=>{var g;(g=n.value[s])===null||g===void 0||g.hide()}})),{max:v}=o;return v&&t.value.length>=v&&t.value.shift(),t.value.push(u),u}function c(r){t.value.splice(t.value.findIndex(a=>a.key===r),1),delete n.value[r]}function d(){Object.values(n.value).forEach(r=>{r.hide()})}return Object.assign({mergedClsPrefix:e,messageRefs:n,messageList:t,handleAfterLeave:c},i)},render(){var o,e,t;return h(W,null,(e=(o=this.$slots).default)===null||e===void 0?void 0:e.call(o),this.messageList.length?h(he,{to:(t=this.to)!==null&&t!==void 0?t:"body"},h("div",{class:[`${this.mergedClsPrefix}-message-container`,`${this.mergedClsPrefix}-message-container--${this.placement}`,this.containerClass],key:"message-container",style:this.containerStyle},this.messageList.map(n=>h(Uo,Object.assign({ref:i=>{i&&(this.messageRefs[n.key]=i)},internalKey:n.key,onInternalAfterLeave:this.handleAfterLeave},Q(n,["destroy"],void 0),{duration:n.duration===void 0?this.duration:n.duration,keepAliveOnHover:n.keepAliveOnHover===void 0?this.keepAliveOnHover:n.keepAliveOnHover,closable:n.closable===void 0?this.closable:n.closable}))))):null)}});function Go(){const o=z(Ee,null);return o===null&&q("use-message","No outer <n-message-provider /> founded. See prerequisite in https://www.naiveui.com/en-US/os-theme/components/message for more details. If you want to use `useMessage` outside setup, please check https://www.naiveui.com/zh-CN/os-theme/components/message#Q-&-A."),o}const Qo=O({name:"ModalEnvironment",props:Object.assign(Object.assign({},so),{internalKey:{type:String,required:!0},onInternalAfterLeave:{type:Function,required:!0}}),setup(o){const e=k(!0);function t(){const{onInternalAfterLeave:s,internalKey:u,onAfterLeave:v}=o;s&&s(u),v&&v()}function n(){const{onPositiveClick:s}=o;s?Promise.resolve(s()).then(u=>{u!==!1&&r()}):r()}function i(){const{onNegativeClick:s}=o;s?Promise.resolve(s()).then(u=>{u!==!1&&r()}):r()}function l(){const{onClose:s}=o;s?Promise.resolve(s()).then(u=>{u!==!1&&r()}):r()}function c(s){const{onMaskClick:u,maskClosable:v}=o;u&&(u(s),v&&r())}function d(){const{onEsc:s}=o;s&&s()}function r(){e.value=!1}function a(s){e.value=s}return{show:e,hide:r,handleUpdateShow:a,handleAfterLeave:t,handleCloseClick:l,handleNegativeClick:i,handlePositiveClick:n,handleMaskClick:c,handleEsc:d}},render(){const{handleUpdateShow:o,handleAfterLeave:e,handleMaskClick:t,handleEsc:n,show:i}=this;return h(Ce,Object.assign({},this.$props,{show:i,onUpdateShow:o,onMaskClick:t,onEsc:n,onAfterLeave:e,internalAppear:!0,internalModal:!0}))}}),be=E("n-modal-provider"),He=E("n-modal-api"),Zo=E("n-modal-reactive-list"),Jo={to:[String,Object]},Yo=O({name:"ModalProvider",props:Jo,setup(){const o=ce(64),e=de(),t=k([]),n={};function i(r={}){const a=X(),s=G(Object.assign(Object.assign({},r),{key:a,destroy:()=>{n[`n-modal-${a}`].hide()}}));return t.value.push(s),s}function l(r){const{value:a}=t;a.splice(a.findIndex(s=>s.key===r),1)}function c(){Object.values(n).forEach(r=>{r.hide()})}const d={create:i,destroyAll:c};return I(He,d),I(be,{clickedRef:ce(64),clickedPositionRef:de()}),I(Zo,t),I(be,{clickedRef:o,clickedPositionRef:e}),Object.assign(Object.assign({},d),{modalList:t,modalInstRefs:n,handleAfterLeave:l})},render(){var o,e;return h(W,null,[this.modalList.map(t=>{var n;return h(Qo,Q(t,["destroy","style"],{internalStyle:t.style,to:(n=t.to)!==null&&n!==void 0?n:this.to,ref:i=>{i===null?delete this.modalInstRefs[`n-modal-${t.key}`]:this.modalInstRefs[`n-modal-${t.key}`]=i},internalKey:t.key,onInternalAfterLeave:this.handleAfterLeave}))}),(e=(o=this.$slots).default)===null||e===void 0?void 0:e.call(o)])}});function en(){const o=z(He,null);return o===null&&q("use-modal","No outer <n-modal-provider /> founded."),o}const Z=E("n-notification-provider"),on=O({name:"NotificationContainer",props:{scrollable:{type:Boolean,required:!0},placement:{type:String,required:!0}},setup(){const{mergedThemeRef:o,mergedClsPrefixRef:e,wipTransitionCountRef:t}=z(Z),n=k(null);return ao(()=>{var i,l;t.value>0?(i=n==null?void 0:n.value)===null||i===void 0||i.classList.add("transitioning"):(l=n==null?void 0:n.value)===null||l===void 0||l.classList.remove("transitioning")}),{selfRef:n,mergedTheme:o,mergedClsPrefix:e,transitioning:t}},render(){const{$slots:o,scrollable:e,mergedClsPrefix:t,mergedTheme:n,placement:i}=this;return h("div",{ref:"selfRef",class:[`${t}-notification-container`,e&&`${t}-notification-container--scrollable`,`${t}-notification-container--${i}`]},e?h(lo,{theme:n.peers.Scrollbar,themeOverrides:n.peerOverrides.Scrollbar,contentStyle:{overflow:"hidden"}},o):o)}}),nn={info:()=>h(Ie,null),success:()=>h(je,null),warning:()=>h(Le,null),error:()=>h(Pe,null),default:()=>null},ge={closable:{type:Boolean,default:!0},type:{type:String,default:"default"},avatar:Function,title:[String,Function],description:[String,Function],content:[String,Function],meta:[String,Function],action:[String,Function],onClose:{type:Function,required:!0},keepAliveOnHover:Boolean,onMouseenter:Function,onMouseleave:Function},tn=co(ge),rn=O({name:"Notification",props:ge,setup(o){const{mergedClsPrefixRef:e,mergedThemeRef:t,props:n}=z(Z),{inlineThemeDisabled:i,mergedRtlRef:l}=F(),c=Se("Notification",l,e),d=_(()=>{const{type:a}=o,{self:{color:s,textColor:u,closeIconColor:v,closeIconColorHover:g,closeIconColorPressed:f,headerTextColor:p,descriptionTextColor:y,actionTextColor:w,borderRadius:$,headerFontWeight:j,boxShadow:S,lineHeight:C,fontSize:M,closeMargin:H,closeSize:L,width:J,padding:Y,closeIconSize:ee,closeBorderRadius:oe,closeColorHover:ne,closeColorPressed:te,titleFontSize:ie,metaFontSize:re,descriptionFontSize:se,[R("iconColor",a)]:ae},common:{cubicBezierEaseOut:le,cubicBezierEaseIn:_e,cubicBezierEaseInOut:Ne}}=t.value,{left:Fe,right:Te,top:Ke,bottom:We}=fo(Y);return{"--n-color":s,"--n-font-size":M,"--n-text-color":u,"--n-description-text-color":y,"--n-action-text-color":w,"--n-title-text-color":p,"--n-title-font-weight":j,"--n-bezier":Ne,"--n-bezier-ease-out":le,"--n-bezier-ease-in":_e,"--n-border-radius":$,"--n-box-shadow":S,"--n-close-border-radius":oe,"--n-close-color-hover":ne,"--n-close-color-pressed":te,"--n-close-icon-color":v,"--n-close-icon-color-hover":g,"--n-close-icon-color-pressed":f,"--n-line-height":C,"--n-icon-color":ae,"--n-close-margin":H,"--n-close-size":L,"--n-close-icon-size":ee,"--n-width":J,"--n-padding-left":Fe,"--n-padding-right":Te,"--n-padding-top":Ke,"--n-padding-bottom":We,"--n-title-font-size":ie,"--n-meta-font-size":re,"--n-description-font-size":se}}),r=i?ue("notification",_(()=>o.type[0]),d,n):void 0;return{mergedClsPrefix:e,showAvatar:_(()=>o.avatar||o.type!=="default"),handleCloseClick(){o.onClose()},rtlEnabled:c,cssVars:i?void 0:d,themeClass:r==null?void 0:r.themeClass,onRender:r==null?void 0:r.onRender}},render(){var o;const{mergedClsPrefix:e}=this;return(o=this.onRender)===null||o===void 0||o.call(this),h("div",{class:[`${e}-notification-wrapper`,this.themeClass],onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave,style:this.cssVars},h("div",{class:[`${e}-notification`,this.rtlEnabled&&`${e}-notification--rtl`,this.themeClass,{[`${e}-notification--closable`]:this.closable,[`${e}-notification--show-avatar`]:this.showAvatar}],style:this.cssVars},this.showAvatar?h("div",{class:`${e}-notification__avatar`},this.avatar?B(this.avatar):this.type!=="default"?h($e,{clsPrefix:e},{default:()=>nn[this.type]()}):null):null,this.closable?h(Oe,{clsPrefix:e,class:`${e}-notification__close`,onClick:this.handleCloseClick}):null,h("div",{ref:"bodyRef",class:`${e}-notification-main`},this.title?h("div",{class:`${e}-notification-main__header`},B(this.title)):null,this.description?h("div",{class:`${e}-notification-main__description`},B(this.description)):null,this.content?h("pre",{class:`${e}-notification-main__content`},B(this.content)):null,this.meta||this.action?h("div",{class:`${e}-notification-main-footer`},this.meta?h("div",{class:`${e}-notification-main-footer__meta`},B(this.meta)):null,this.action?h("div",{class:`${e}-notification-main-footer__action`},B(this.action)):null):null)))}}),sn=Object.assign(Object.assign({},ge),{duration:Number,onClose:Function,onLeave:Function,onAfterEnter:Function,onAfterLeave:Function,onHide:Function,onAfterShow:Function,onAfterHide:Function}),an=O({name:"NotificationEnvironment",props:Object.assign(Object.assign({},sn),{internalKey:{type:String,required:!0},onInternalAfterLeave:{type:Function,required:!0}}),setup(o){const{wipTransitionCountRef:e}=z(Z),t=k(!0);let n=null;function i(){t.value=!1,n&&window.clearTimeout(n)}function l(f){e.value++,N(()=>{f.style.height=`${f.offsetHeight}px`,f.style.maxHeight="0",f.style.transition="none",f.offsetHeight,f.style.transition="",f.style.maxHeight=f.style.height})}function c(f){e.value--,f.style.height="",f.style.maxHeight="";const{onAfterEnter:p,onAfterShow:y}=o;p&&p(),y&&y()}function d(f){e.value++,f.style.maxHeight=`${f.offsetHeight}px`,f.style.height=`${f.offsetHeight}px`,f.offsetHeight}function r(f){const{onHide:p}=o;p&&p(),f.style.maxHeight="0",f.offsetHeight}function a(){e.value--;const{onAfterLeave:f,onInternalAfterLeave:p,onAfterHide:y,internalKey:w}=o;f&&f(),p(w),y&&y()}function s(){const{duration:f}=o;f&&(n=window.setTimeout(i,f))}function u(f){f.currentTarget===f.target&&n!==null&&(window.clearTimeout(n),n=null)}function v(f){f.currentTarget===f.target&&s()}function g(){const{onClose:f}=o;f?Promise.resolve(f()).then(p=>{p!==!1&&i()}):i()}return ve(()=>{o.duration&&(n=window.setTimeout(i,o.duration))}),{show:t,hide:i,handleClose:g,handleAfterLeave:a,handleLeave:r,handleBeforeLeave:d,handleAfterEnter:c,handleBeforeEnter:l,handleMouseenter:u,handleMouseleave:v}},render(){return h(ke,{name:"notification-transition",appear:!0,onBeforeEnter:this.handleBeforeEnter,onAfterEnter:this.handleAfterEnter,onBeforeLeave:this.handleBeforeLeave,onLeave:this.handleLeave,onAfterLeave:this.handleAfterLeave},{default:()=>this.show?h(rn,Object.assign({},xe(this.$props,tn),{onClose:this.handleClose,onMouseenter:this.duration&&this.keepAliveOnHover?this.handleMouseenter:void 0,onMouseleave:this.duration&&this.keepAliveOnHover?this.handleMouseleave:void 0})):null})}}),ln=x([m("notification-container",`
|
|
141
|
+
`)])]),Wo={info:()=>h(Ie,null),success:()=>h(je,null),warning:()=>h(Le,null),error:()=>h(Pe,null),default:()=>null},qo=O({name:"Message",props:Object.assign(Object.assign({},Re),{render:Function}),setup(o){const{inlineThemeDisabled:e,mergedRtlRef:t}=F(o),{props:n,mergedClsPrefixRef:i}=z(Me),l=Se("Message",t,i),c=T("Message","-message",Ko,Ro,n,i),d=_(()=>{const{type:a}=o,{common:{cubicBezierEaseInOut:s},self:{padding:u,margin:v,maxWidth:g,iconMargin:f,closeMargin:p,closeSize:y,iconSize:w,fontSize:$,lineHeight:j,borderRadius:S,iconColorInfo:C,iconColorSuccess:M,iconColorWarning:H,iconColorError:L,iconColorLoading:Y,closeIconSize:Z,closeBorderRadius:ee,[R("textColor",a)]:oe,[R("boxShadow",a)]:ne,[R("color",a)]:te,[R("closeColorHover",a)]:ie,[R("closeColorPressed",a)]:re,[R("closeIconColor",a)]:se,[R("closeIconColorPressed",a)]:ae,[R("closeIconColorHover",a)]:le}}=c.value;return{"--n-bezier":s,"--n-margin":v,"--n-padding":u,"--n-max-width":g,"--n-font-size":$,"--n-icon-margin":f,"--n-icon-size":w,"--n-close-icon-size":Z,"--n-close-border-radius":ee,"--n-close-size":y,"--n-close-margin":p,"--n-text-color":oe,"--n-color":te,"--n-box-shadow":ne,"--n-icon-color-info":C,"--n-icon-color-success":M,"--n-icon-color-warning":H,"--n-icon-color-error":L,"--n-icon-color-loading":Y,"--n-close-color-hover":ie,"--n-close-color-pressed":re,"--n-close-icon-color":se,"--n-close-icon-color-pressed":ae,"--n-close-icon-color-hover":le,"--n-line-height":j,"--n-border-radius":S}}),r=e?ue("message",_(()=>o.type[0]),d,{}):void 0;return{mergedClsPrefix:i,rtlEnabled:l,messageProviderProps:n,handleClose(){var a;(a=o.onClose)===null||a===void 0||a.call(o)},cssVars:e?void 0:d,themeClass:r==null?void 0:r.themeClass,onRender:r==null?void 0:r.onRender,placement:n.placement}},render(){const{render:o,type:e,closable:t,content:n,mergedClsPrefix:i,cssVars:l,themeClass:c,onRender:d,icon:r,handleClose:a,showIcon:s}=this;d==null||d();let u;return h("div",{class:[`${i}-message-wrapper`,c],onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave,style:[{alignItems:this.placement.startsWith("top")?"flex-start":"flex-end"},l]},o?o(this.$props):h("div",{class:[`${i}-message ${i}-message--${e}-type`,this.rtlEnabled&&`${i}-message--rtl`]},(u=Do(r,e,i))&&s?h("div",{class:`${i}-message__icon ${i}-message__icon--${e}-type`},h(to,null,{default:()=>u})):null,h("div",{class:`${i}-message__content`},B(n)),t?h(Oe,{clsPrefix:i,class:`${i}-message__close`,onClick:a,absolute:!0}):null))}});function Do(o,e,t){if(typeof o=="function")return o();{const n=e==="loading"?h(io,{clsPrefix:t,strokeWidth:24,scale:.85}):Wo[e]();return n?h($e,{clsPrefix:t,key:e},{default:()=>n}):null}}const Uo=O({name:"MessageEnvironment",props:Object.assign(Object.assign({},Re),{duration:{type:Number,default:3e3},onAfterLeave:Function,onLeave:Function,internalKey:{type:String,required:!0},onInternalAfterLeave:Function,onHide:Function,onAfterHide:Function}),setup(o){let e=null;const t=k(!0);ve(()=>{n()});function n(){const{duration:s}=o;s&&(e=window.setTimeout(c,s))}function i(s){s.currentTarget===s.target&&e!==null&&(window.clearTimeout(e),e=null)}function l(s){s.currentTarget===s.target&&n()}function c(){const{onHide:s}=o;t.value=!1,e&&(window.clearTimeout(e),e=null),s&&s()}function d(){const{onClose:s}=o;s&&s(),c()}function r(){const{onAfterLeave:s,onInternalAfterLeave:u,onAfterHide:v,internalKey:g}=o;s&&s(),u&&u(g),v&&v()}function a(){c()}return{show:t,hide:c,handleClose:d,handleAfterLeave:r,handleMouseleave:l,handleMouseenter:i,deactivate:a}},render(){return h(ro,{appear:!0,onAfterLeave:this.handleAfterLeave,onLeave:this.onLeave},{default:()=>[this.show?h(qo,{content:this.content,type:this.type,icon:this.icon,showIcon:this.showIcon,closable:this.closable,onClose:this.handleClose,onMouseenter:this.keepAliveOnHover?this.handleMouseenter:void 0,onMouseleave:this.keepAliveOnHover?this.handleMouseleave:void 0}):null]})}}),Vo=Object.assign(Object.assign({},T.props),{to:[String,Object],duration:{type:Number,default:3e3},keepAliveOnHover:Boolean,max:Number,placement:{type:String,default:"top"},closable:Boolean,containerClass:String,containerStyle:[String,Object]}),Go=O({name:"MessageProvider",props:Vo,setup(o){const{mergedClsPrefixRef:e}=F(o),t=k([]),n=k({}),i={create(r,a){return l(r,Object.assign({type:"default"},a))},info(r,a){return l(r,Object.assign(Object.assign({},a),{type:"info"}))},success(r,a){return l(r,Object.assign(Object.assign({},a),{type:"success"}))},warning(r,a){return l(r,Object.assign(Object.assign({},a),{type:"warning"}))},error(r,a){return l(r,Object.assign(Object.assign({},a),{type:"error"}))},loading(r,a){return l(r,Object.assign(Object.assign({},a),{type:"loading"}))},destroyAll:d};I(Me,{props:o,mergedClsPrefixRef:e}),I(Ee,i);function l(r,a){const s=G(),u=X(Object.assign(Object.assign({},a),{content:r,key:s,destroy:()=>{var g;(g=n.value[s])===null||g===void 0||g.hide()}})),{max:v}=o;return v&&t.value.length>=v&&t.value.shift(),t.value.push(u),u}function c(r){t.value.splice(t.value.findIndex(a=>a.key===r),1),delete n.value[r]}function d(){Object.values(n.value).forEach(r=>{r.hide()})}return Object.assign({mergedClsPrefix:e,messageRefs:n,messageList:t,handleAfterLeave:c},i)},render(){var o,e,t;return h(W,null,(e=(o=this.$slots).default)===null||e===void 0?void 0:e.call(o),this.messageList.length?h(he,{to:(t=this.to)!==null&&t!==void 0?t:"body"},h("div",{class:[`${this.mergedClsPrefix}-message-container`,`${this.mergedClsPrefix}-message-container--${this.placement}`,this.containerClass],key:"message-container",style:this.containerStyle},this.messageList.map(n=>h(Uo,Object.assign({ref:i=>{i&&(this.messageRefs[n.key]=i)},internalKey:n.key,onInternalAfterLeave:this.handleAfterLeave},Q(n,["destroy"],void 0),{duration:n.duration===void 0?this.duration:n.duration,keepAliveOnHover:n.keepAliveOnHover===void 0?this.keepAliveOnHover:n.keepAliveOnHover,closable:n.closable===void 0?this.closable:n.closable}))))):null)}});function Xo(){const o=z(Ee,null);return o===null&&q("use-message","No outer <n-message-provider /> founded. See prerequisite in https://www.naiveui.com/en-US/os-theme/components/message for more details. If you want to use `useMessage` outside setup, please check https://www.naiveui.com/zh-CN/os-theme/components/message#Q-&-A."),o}const Qo=O({name:"ModalEnvironment",props:Object.assign(Object.assign({},so),{internalKey:{type:String,required:!0},onInternalAfterLeave:{type:Function,required:!0}}),setup(o){const e=k(!0);function t(){const{onInternalAfterLeave:s,internalKey:u,onAfterLeave:v}=o;s&&s(u),v&&v()}function n(){const{onPositiveClick:s}=o;s?Promise.resolve(s()).then(u=>{u!==!1&&r()}):r()}function i(){const{onNegativeClick:s}=o;s?Promise.resolve(s()).then(u=>{u!==!1&&r()}):r()}function l(){const{onClose:s}=o;s?Promise.resolve(s()).then(u=>{u!==!1&&r()}):r()}function c(s){const{onMaskClick:u,maskClosable:v}=o;u&&(u(s),v&&r())}function d(){const{onEsc:s}=o;s&&s()}function r(){e.value=!1}function a(s){e.value=s}return{show:e,hide:r,handleUpdateShow:a,handleAfterLeave:t,handleCloseClick:l,handleNegativeClick:i,handlePositiveClick:n,handleMaskClick:c,handleEsc:d}},render(){const{handleUpdateShow:o,handleAfterLeave:e,handleMaskClick:t,handleEsc:n,show:i}=this;return h(Ce,Object.assign({},this.$props,{show:i,onUpdateShow:o,onMaskClick:t,onEsc:n,onAfterLeave:e,internalAppear:!0,internalModal:!0}))}}),be=E("n-modal-provider"),He=E("n-modal-api"),Jo=E("n-modal-reactive-list"),Yo={to:[String,Object]},Zo=O({name:"ModalProvider",props:Yo,setup(){const o=ce(64),e=de(),t=k([]),n={};function i(r={}){const a=G(),s=X(Object.assign(Object.assign({},r),{key:a,destroy:()=>{n[`n-modal-${a}`].hide()}}));return t.value.push(s),s}function l(r){const{value:a}=t;a.splice(a.findIndex(s=>s.key===r),1)}function c(){Object.values(n).forEach(r=>{r.hide()})}const d={create:i,destroyAll:c};return I(He,d),I(be,{clickedRef:ce(64),clickedPositionRef:de()}),I(Jo,t),I(be,{clickedRef:o,clickedPositionRef:e}),Object.assign(Object.assign({},d),{modalList:t,modalInstRefs:n,handleAfterLeave:l})},render(){var o,e;return h(W,null,[this.modalList.map(t=>{var n;return h(Qo,Q(t,["destroy","style"],{internalStyle:t.style,to:(n=t.to)!==null&&n!==void 0?n:this.to,ref:i=>{i===null?delete this.modalInstRefs[`n-modal-${t.key}`]:this.modalInstRefs[`n-modal-${t.key}`]=i},internalKey:t.key,onInternalAfterLeave:this.handleAfterLeave}))}),(e=(o=this.$slots).default)===null||e===void 0?void 0:e.call(o)])}});function en(){const o=z(He,null);return o===null&&q("use-modal","No outer <n-modal-provider /> founded."),o}const J=E("n-notification-provider"),on=O({name:"NotificationContainer",props:{scrollable:{type:Boolean,required:!0},placement:{type:String,required:!0}},setup(){const{mergedThemeRef:o,mergedClsPrefixRef:e,wipTransitionCountRef:t}=z(J),n=k(null);return ao(()=>{var i,l;t.value>0?(i=n==null?void 0:n.value)===null||i===void 0||i.classList.add("transitioning"):(l=n==null?void 0:n.value)===null||l===void 0||l.classList.remove("transitioning")}),{selfRef:n,mergedTheme:o,mergedClsPrefix:e,transitioning:t}},render(){const{$slots:o,scrollable:e,mergedClsPrefix:t,mergedTheme:n,placement:i}=this;return h("div",{ref:"selfRef",class:[`${t}-notification-container`,e&&`${t}-notification-container--scrollable`,`${t}-notification-container--${i}`]},e?h(lo,{theme:n.peers.Scrollbar,themeOverrides:n.peerOverrides.Scrollbar,contentStyle:{overflow:"hidden"}},o):o)}}),nn={info:()=>h(Ie,null),success:()=>h(je,null),warning:()=>h(Le,null),error:()=>h(Pe,null),default:()=>null},ge={closable:{type:Boolean,default:!0},type:{type:String,default:"default"},avatar:Function,title:[String,Function],description:[String,Function],content:[String,Function],meta:[String,Function],action:[String,Function],onClose:{type:Function,required:!0},keepAliveOnHover:Boolean,onMouseenter:Function,onMouseleave:Function},tn=co(ge),rn=O({name:"Notification",props:ge,setup(o){const{mergedClsPrefixRef:e,mergedThemeRef:t,props:n}=z(J),{inlineThemeDisabled:i,mergedRtlRef:l}=F(),c=Se("Notification",l,e),d=_(()=>{const{type:a}=o,{self:{color:s,textColor:u,closeIconColor:v,closeIconColorHover:g,closeIconColorPressed:f,headerTextColor:p,descriptionTextColor:y,actionTextColor:w,borderRadius:$,headerFontWeight:j,boxShadow:S,lineHeight:C,fontSize:M,closeMargin:H,closeSize:L,width:Y,padding:Z,closeIconSize:ee,closeBorderRadius:oe,closeColorHover:ne,closeColorPressed:te,titleFontSize:ie,metaFontSize:re,descriptionFontSize:se,[R("iconColor",a)]:ae},common:{cubicBezierEaseOut:le,cubicBezierEaseIn:_e,cubicBezierEaseInOut:Ne}}=t.value,{left:Fe,right:Te,top:Ke,bottom:We}=fo(Z);return{"--n-color":s,"--n-font-size":M,"--n-text-color":u,"--n-description-text-color":y,"--n-action-text-color":w,"--n-title-text-color":p,"--n-title-font-weight":j,"--n-bezier":Ne,"--n-bezier-ease-out":le,"--n-bezier-ease-in":_e,"--n-border-radius":$,"--n-box-shadow":S,"--n-close-border-radius":oe,"--n-close-color-hover":ne,"--n-close-color-pressed":te,"--n-close-icon-color":v,"--n-close-icon-color-hover":g,"--n-close-icon-color-pressed":f,"--n-line-height":C,"--n-icon-color":ae,"--n-close-margin":H,"--n-close-size":L,"--n-close-icon-size":ee,"--n-width":Y,"--n-padding-left":Fe,"--n-padding-right":Te,"--n-padding-top":Ke,"--n-padding-bottom":We,"--n-title-font-size":ie,"--n-meta-font-size":re,"--n-description-font-size":se}}),r=i?ue("notification",_(()=>o.type[0]),d,n):void 0;return{mergedClsPrefix:e,showAvatar:_(()=>o.avatar||o.type!=="default"),handleCloseClick(){o.onClose()},rtlEnabled:c,cssVars:i?void 0:d,themeClass:r==null?void 0:r.themeClass,onRender:r==null?void 0:r.onRender}},render(){var o;const{mergedClsPrefix:e}=this;return(o=this.onRender)===null||o===void 0||o.call(this),h("div",{class:[`${e}-notification-wrapper`,this.themeClass],onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave,style:this.cssVars},h("div",{class:[`${e}-notification`,this.rtlEnabled&&`${e}-notification--rtl`,this.themeClass,{[`${e}-notification--closable`]:this.closable,[`${e}-notification--show-avatar`]:this.showAvatar}],style:this.cssVars},this.showAvatar?h("div",{class:`${e}-notification__avatar`},this.avatar?B(this.avatar):this.type!=="default"?h($e,{clsPrefix:e},{default:()=>nn[this.type]()}):null):null,this.closable?h(Oe,{clsPrefix:e,class:`${e}-notification__close`,onClick:this.handleCloseClick}):null,h("div",{ref:"bodyRef",class:`${e}-notification-main`},this.title?h("div",{class:`${e}-notification-main__header`},B(this.title)):null,this.description?h("div",{class:`${e}-notification-main__description`},B(this.description)):null,this.content?h("pre",{class:`${e}-notification-main__content`},B(this.content)):null,this.meta||this.action?h("div",{class:`${e}-notification-main-footer`},this.meta?h("div",{class:`${e}-notification-main-footer__meta`},B(this.meta)):null,this.action?h("div",{class:`${e}-notification-main-footer__action`},B(this.action)):null):null)))}}),sn=Object.assign(Object.assign({},ge),{duration:Number,onClose:Function,onLeave:Function,onAfterEnter:Function,onAfterLeave:Function,onHide:Function,onAfterShow:Function,onAfterHide:Function}),an=O({name:"NotificationEnvironment",props:Object.assign(Object.assign({},sn),{internalKey:{type:String,required:!0},onInternalAfterLeave:{type:Function,required:!0}}),setup(o){const{wipTransitionCountRef:e}=z(J),t=k(!0);let n=null;function i(){t.value=!1,n&&window.clearTimeout(n)}function l(f){e.value++,N(()=>{f.style.height=`${f.offsetHeight}px`,f.style.maxHeight="0",f.style.transition="none",f.offsetHeight,f.style.transition="",f.style.maxHeight=f.style.height})}function c(f){e.value--,f.style.height="",f.style.maxHeight="";const{onAfterEnter:p,onAfterShow:y}=o;p&&p(),y&&y()}function d(f){e.value++,f.style.maxHeight=`${f.offsetHeight}px`,f.style.height=`${f.offsetHeight}px`,f.offsetHeight}function r(f){const{onHide:p}=o;p&&p(),f.style.maxHeight="0",f.offsetHeight}function a(){e.value--;const{onAfterLeave:f,onInternalAfterLeave:p,onAfterHide:y,internalKey:w}=o;f&&f(),p(w),y&&y()}function s(){const{duration:f}=o;f&&(n=window.setTimeout(i,f))}function u(f){f.currentTarget===f.target&&n!==null&&(window.clearTimeout(n),n=null)}function v(f){f.currentTarget===f.target&&s()}function g(){const{onClose:f}=o;f?Promise.resolve(f()).then(p=>{p!==!1&&i()}):i()}return ve(()=>{o.duration&&(n=window.setTimeout(i,o.duration))}),{show:t,hide:i,handleClose:g,handleAfterLeave:a,handleLeave:r,handleBeforeLeave:d,handleAfterEnter:c,handleBeforeEnter:l,handleMouseenter:u,handleMouseleave:v}},render(){return h(ke,{name:"notification-transition",appear:!0,onBeforeEnter:this.handleBeforeEnter,onAfterEnter:this.handleAfterEnter,onBeforeLeave:this.handleBeforeLeave,onLeave:this.handleLeave,onAfterLeave:this.handleAfterLeave},{default:()=>this.show?h(rn,Object.assign({},xe(this.$props,tn),{onClose:this.handleClose,onMouseenter:this.duration&&this.keepAliveOnHover?this.handleMouseenter:void 0,onMouseleave:this.duration&&this.keepAliveOnHover?this.handleMouseleave:void 0})):null})}}),ln=x([m("notification-container",`
|
|
142
142
|
z-index: 4000;
|
|
143
143
|
position: fixed;
|
|
144
144
|
overflow: visible;
|
|
@@ -327,6 +327,6 @@ import{e as x,c9 as qe,ca as De,h as O,r as k,v as h,cb as Ue,b2 as xe,cc as Ve,
|
|
|
327
327
|
transform: translate(${t}, 0);
|
|
328
328
|
`),x("&.notification-transition-leave-from, &.notification-transition-enter-to",`
|
|
329
329
|
transform: translate(0, 0);
|
|
330
|
-
`)])}const Be=E("n-notification-api"),cn=Object.assign(Object.assign({},T.props),{containerClass:String,containerStyle:[String,Object],to:[String,Object],scrollable:{type:Boolean,default:!0},max:Number,placement:{type:String,default:"top-right"},keepAliveOnHover:Boolean}),dn=O({name:"NotificationProvider",props:cn,setup(o){const{mergedClsPrefixRef:e}=F(o),t=k([]),n={},i=new Set;function l(g){const f=
|
|
331
|
-
`)?n.substring(1):n}).forEach(function(n){var c;let i=n.split(":"),l=(c=i.shift())==null?void 0:c.trim();if(l){let d=i.join(":").trim();try{e.append(l,d)}catch{}}}),e},wn=(o="")=>{try{return o===""&&location.href?location.href:o}catch{return o}},kn=async(o,e={},t={})=>{var a;const n=new Request(o,e).clone();if((a=n.signal)!=null&&a.aborted)throw new DOMException("Aborted","AbortError");const i=n.method.toUpperCase(),l=wn(n.url),c=new Headers(n.headers);new Headers(e.headers).forEach((s,u)=>{c.set(u,s)});let d=!1,r;return i!="GET"&&e.body&&(typeof e.body=="string"||e.body instanceof URLSearchParams?r=e.body:e.body instanceof FormData?(r=e.body,c.delete("content-type")):(d=!0,r=await n.blob())),new Promise((s,u)=>{var p;let v={method:i,url:l,headers:pn(c),data:r,binary:d,responseType:"blob",async onload(y){var j;let w;y.response instanceof Blob&&y.response.size==0||(w=(j=y.response)!=null?j:y.responseText),await K();const $=new Response(w,{status:y.status,statusText:y.statusText,headers:Cn(y.responseHeaders)});Object.defineProperty($,"url",{value:y.finalUrl}),s($)},async onerror(){await K(),u(new TypeError("Network request onerror failed"))},async ontimeout(){await K(),u(new TypeError("Network request ontimeout failed"))},async onabort(){await K(),u(new DOMException("Aborted","AbortError"))},async onreadystatechange(y){var w;y.readyState===4&&((w=n.signal)==null||w.removeEventListener("abort",f))}};typeof t=="function"?v=t(v):v={...v,...t};const g=yn(v);function f(){g.abort()}(p=n.signal)==null||p.addEventListener("abort",f)})},Sn=new Set([location.origin,"https://cdn.jsdelivr.net","https://fastly.jsdelivr.net","https://raw.githubusercontent.com","https://gist.githubusercontent.com","https://raw.githubusercontents.com","https://raw.gitmirror.com","https://registry.npmmirror.com"]),On=o=>(o=new URL(o),o.hostname=="127.0.0.1"||o.hostname=="localhost"||location.protocol=="http:"&&o.protocol=="http:"&&o.hostname.split(".").every(e=>Number.isSafeInteger(parseInt(e)))?!0:Sn.has(o.origin)),$n=/^https:\/\/github\.com\/gkd-kit\/inspect\/files\/([0-9]+)\/file\.zip$/,In=/^https:\/\/github\.com\/gkd-kit\/inspect\/assets\/([0-9]+)\/([0-9a-z-]+)$/,Bn=(o,e)=>{e=e.toString();const{1:t}=e.match($n)||[],{1:n,2:i}=e.match(In)||[];if(t)return location.origin+o.resolve({path:`/i/${t}`}).href;if(n&&i)return`https://m.gkd.li/${n}/${i}`;throw new Error(`github url ${e} should come from gkd-kit/inspect files/assets`)},_n=async(o,e,t)=>{const n=new Request(o),i=new URL(n.url);if(On(i))return fetch(o,{...e,mode:"cors"});if(xn())return kn(o,e);if(t!=null&&t.proxy){const l=new URL("https://proxy
|
|
332
|
-
//# sourceMappingURL=fetch-
|
|
330
|
+
`)])}const Be=E("n-notification-api"),cn=Object.assign(Object.assign({},T.props),{containerClass:String,containerStyle:[String,Object],to:[String,Object],scrollable:{type:Boolean,default:!0},max:Number,placement:{type:String,default:"top-right"},keepAliveOnHover:Boolean}),dn=O({name:"NotificationProvider",props:cn,setup(o){const{mergedClsPrefixRef:e}=F(o),t=k([]),n={},i=new Set;function l(g){const f=G(),p=()=>{i.add(f),n[f]&&n[f].hide()},y=X(Object.assign(Object.assign({},g),{key:f,destroy:p,hide:p,deactivate:p})),{max:w}=o;if(w&&t.value.length-i.size>=w){let $=!1,j=0;for(const S of t.value){if(!i.has(S.key)){n[S.key]&&(S.destroy(),$=!0);break}j++}$||t.value.splice(j,1)}return t.value.push(y),y}const c=["info","success","warning","error"].map(g=>f=>l(Object.assign(Object.assign({},f),{type:g})));function d(g){i.delete(g),t.value.splice(t.value.findIndex(f=>f.key===g),1)}const r=T("Notification","-notification",ln,Lo,o,e),a={create:l,info:c[0],success:c[1],warning:c[2],error:c[3],open:u,destroyAll:v},s=k(0);I(Be,a),I(J,{props:o,mergedClsPrefixRef:e,mergedThemeRef:r,wipTransitionCountRef:s});function u(g){return l(g)}function v(){Object.values(t.value).forEach(g=>{g.hide()})}return Object.assign({mergedClsPrefix:e,notificationList:t,notificationRefs:n,handleAfterLeave:d},a)},render(){var o,e,t;const{placement:n}=this;return h(W,null,(e=(o=this.$slots).default)===null||e===void 0?void 0:e.call(o),this.notificationList.length?h(he,{to:(t=this.to)!==null&&t!==void 0?t:"body"},h(on,{class:this.containerClass,style:this.containerStyle,scrollable:this.scrollable&&n!=="top"&&n!=="bottom",placement:n},{default:()=>this.notificationList.map(i=>h(an,Object.assign({ref:l=>{const c=i.key;l===null?delete this.notificationRefs[c]:this.notificationRefs[c]=l}},Q(i,["destroy","hide","deactivate"]),{internalKey:i.key,onInternalAfterLeave:this.handleAfterLeave,keepAliveOnHover:i.keepAliveOnHover===void 0?this.keepAliveOnHover:i.keepAliveOnHover})))})):null)}});function fn(){const o=z(Be,null);return o===null&&q("use-notification","No outer `n-notification-provider` found."),o}const un=O({name:"InjectionExtractor",props:{onSetup:Function},setup(o,{slots:e}){var t;return(t=o.onSetup)===null||t===void 0||t.call(o),()=>{var n;return(n=e.default)===null||n===void 0?void 0:n.call(e)}}}),hn={message:Xo,notification:fn,loadingBar:To,dialog:Oo,modal:en};function vn({providersAndProps:o,configProviderProps:e}){let n=uo(()=>h(vo,pe(e),{default:()=>o.map(({type:d,Provider:r,props:a})=>h(r,pe(a),{default:()=>h(un,{onSetup:()=>i[d]=hn[d]()})}))}));const i={app:n};let l;return ho&&(l=document.createElement("div"),document.body.appendChild(l),n.mount(l)),Object.assign({unmount:()=>{var d;if(n===null||l===null){go("discrete","unmount call no need because discrete app has been unmounted");return}n.unmount(),(d=l.parentNode)===null||d===void 0||d.removeChild(l),l=null,n=null}},i)}function gn(o,{configProviderProps:e,messageProviderProps:t,dialogProviderProps:n,notificationProviderProps:i,loadingBarProviderProps:l,modalProviderProps:c}={}){const d=[];return o.forEach(a=>{switch(a){case"message":d.push({type:a,Provider:Go,props:t});break;case"notification":d.push({type:a,Provider:dn,props:i});break;case"dialog":d.push({type:a,Provider:So,props:n});break;case"loadingBar":d.push({type:a,Provider:Fo,props:l});break;case"modal":d.push({type:a,Provider:Zo,props:c})}}),vn({providersAndProps:d,configProviderProps:e})}const{message:ye,dialog:Ln,loadingBar:Pn}=gn(["message","dialog","loadingBar"]),An=(...o)=>{const e=new FormData;return o.forEach(t=>{for(const n in t){const i=t[n];i!==void 0&&(i instanceof File?e.append(n,i,i.name):i instanceof Blob?e.append(n,i):e.append(n,String(i)))}}),e},pn=o=>{const e={};return o.forEach((t,n)=>{e[n]=t}),e},K=async(o=0)=>new Promise(e=>{setTimeout(e,o)}),zn=(()=>{let o;return async e=>{if(o!==e){o=e,K(1e4).then(()=>{o=void 0});try{await navigator.clipboard.writeText(e),ye.success("复制成功")}catch{ye.error("复制失败")}}}})(),Rn=()=>{const o=window.innerHeight>window.innerWidth;ve(()=>{o&&me.classList.add("mobile")}),po(()=>{me.classList.remove("mobile")})},En=o=>{const e=Math.floor((Date.now()-o)/1e3),t=Math.floor(e/31536e3);if(t>=1)return`${t} 年前`;const n=Math.floor(e/2592e3);if(n>=1)return`${n} 月前`;const i=Math.floor(e/86400);if(i>=1)return`${i} 天前`;const l=Math.floor(e/3600);if(l>=1)return`${l} 小时前`;const c=Math.floor(e/60);return c>=1?`${c} 分钟前`:"刚刚"},mn=()=>{},Mn=()=>mn,Hn=(o,e)=>{const t={};return e.forEach(n=>{const i=o[n];i!==void 0&&(t[n]=i)}),t},bn=o=>(...e)=>o()(...e),yn=bn(()=>{var o;return(o=window.__NetworkExtension__)==null?void 0:o.GM_xmlhttpRequest}),xn=()=>{var o;return!!((o=window.__NetworkExtension__)!=null&&o.GM_xmlhttpRequest)},Cn=(o="")=>{const e=new Headers;return o.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(n){return n.startsWith(`
|
|
331
|
+
`)?n.substring(1):n}).forEach(function(n){var c;let i=n.split(":"),l=(c=i.shift())==null?void 0:c.trim();if(l){let d=i.join(":").trim();try{e.append(l,d)}catch{}}}),e},wn=(o="")=>{try{return o===""&&location.href?location.href:o}catch{return o}},kn=async(o,e={},t={})=>{var a;const n=new Request(o,e).clone();if((a=n.signal)!=null&&a.aborted)throw new DOMException("Aborted","AbortError");const i=n.method.toUpperCase(),l=wn(n.url),c=new Headers(n.headers);new Headers(e.headers).forEach((s,u)=>{c.set(u,s)});let d=!1,r;return i!="GET"&&e.body&&(typeof e.body=="string"||e.body instanceof URLSearchParams?r=e.body:e.body instanceof FormData?(r=e.body,c.delete("content-type")):(d=!0,r=await n.blob())),new Promise((s,u)=>{var p;let v={method:i,url:l,headers:pn(c),data:r,binary:d,responseType:"blob",async onload(y){var j;let w;y.response instanceof Blob&&y.response.size==0||(w=(j=y.response)!=null?j:y.responseText),await K();const $=new Response(w,{status:y.status,statusText:y.statusText,headers:Cn(y.responseHeaders)});Object.defineProperty($,"url",{value:y.finalUrl}),s($)},async onerror(){await K(),u(new TypeError("Network request onerror failed"))},async ontimeout(){await K(),u(new TypeError("Network request ontimeout failed"))},async onabort(){await K(),u(new DOMException("Aborted","AbortError"))},async onreadystatechange(y){var w;y.readyState===4&&((w=n.signal)==null||w.removeEventListener("abort",f))}};typeof t=="function"?v=t(v):v={...v,...t};const g=yn(v);function f(){g.abort()}(p=n.signal)==null||p.addEventListener("abort",f)})},Sn=new Set([location.origin,"https://cdn.jsdelivr.net","https://fastly.jsdelivr.net","https://raw.githubusercontent.com","https://gist.githubusercontent.com","https://raw.githubusercontents.com","https://raw.gitmirror.com","https://registry.npmmirror.com"]),On=o=>(o=new URL(o),o.hostname=="127.0.0.1"||o.hostname=="localhost"||location.protocol=="http:"&&o.protocol=="http:"&&o.hostname.split(".").every(e=>Number.isSafeInteger(parseInt(e)))?!0:Sn.has(o.origin)),$n=/^https:\/\/github\.com\/gkd-kit\/inspect\/files\/([0-9]+)\/file\.zip$/,In=/^https:\/\/github\.com\/gkd-kit\/inspect\/assets\/([0-9]+)\/([0-9a-z-]+)$/,Bn=(o,e)=>{e=e.toString();const{1:t}=e.match($n)||[],{1:n,2:i}=e.match(In)||[];if(t)return location.origin+o.resolve({path:`/i/${t}`}).href;if(n&&i)return`https://m.gkd.li/${n}/${i}`;throw new Error(`github url ${e} should come from gkd-kit/inspect files/assets`)},_n=async(o,e,t)=>{const n=new Request(o),i=new URL(n.url);if(On(i))return fetch(o,{...e,mode:"cors"});if(xn())return kn(o,e);if(t!=null&&t.proxy){const l=new URL("https://proxy.gkd.li");l.searchParams.set("proxyUrl",i.href);const c=new Request(o,e);return fetch(l,{method:c.method,headers:c.headers,body:c.body})}else throw mo.networkErrorDlgVisible=!0,new Error("gm is not supported")};export{K as a,Mn as b,zn as c,Ln as d,xn as e,xo as f,Bn as g,_n as h,$n as i,In as j,Hn as k,Pn as l,ye as m,Q as n,An as o,En as t,Rn as u};
|
|
332
|
+
//# sourceMappingURL=fetch-BP9rZdNm.js.map
|