zs_library 0.3.16 → 0.3.18

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.umd.js CHANGED
@@ -1,8 +1,8 @@
1
- (function(k,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("@emotion/css"),require("react"),require("react-slick"),require("react-sortablejs"),require("framer-motion"),require("ahooks"),require("uuid"),require("rc-tooltip"),require("@remixicon/react"),require("rc-dialog"),require("react-json-view"),require("@mdxeditor/editor"),require("react-markdown"),require("remark-gfm"),require("remark-emoji"),require("rehype-raw"),require("react-syntax-highlighter"),require("clsx"),require("tailwind-merge")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@emotion/css","react","react-slick","react-sortablejs","framer-motion","ahooks","uuid","rc-tooltip","@remixicon/react","rc-dialog","react-json-view","@mdxeditor/editor","react-markdown","remark-gfm","remark-emoji","rehype-raw","react-syntax-highlighter","clsx","tailwind-merge"],e):(k=typeof globalThis<"u"?globalThis:k||self,e(k.zs_library={},k.jsxRuntime,k.css,k.React,k.Slider,k.reactSortablejs,k.framerMotion,k.ahooks,k.uuid,k.RcTooltip,k.react$1,k.Dialog,k.ReactJson,k.MDXEditor,k.Markdown,k.remarkGfm,k.emoji,k.rehypeRaw,k.reactSyntaxHighlighter,k.clsx,k.tailwindMerge))})(this,function(k,e,t,f,Ie,oe,s,ie,se,Se,Q,ce,Te,h,Me,Ne,De,Be,Pe,$e,Le){"use strict";var to=Object.defineProperty;var ro=(k,e,t)=>e in k?to(k,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):k[e]=t;var ae=(k,e,t)=>ro(k,typeof e!="symbol"?e+"":e,t);require("./zs_library.css");const de={token:{itemNameColor:"#1a1a1a",itemIconBackgroundColor:"white",itemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemIconBackgroundColor:"rgba(255, 255, 255, 0.1)",groupItemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemModalBackgroundColor:"rgba(255, 255, 255, 0.8)",contextMenuTextColor:"black",contextMenuActiveColor:"#f3f4f6",contextMenuBackgroundColor:"white",contextMenuShadowColor:"rgba(0, 0, 0, 0.1)"}},ue={token:{itemNameColor:"white",itemIconBackgroundColor:"#1f2937",itemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemIconBackgroundColor:"rgba(0, 0, 0, 0.1)",groupItemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemModalBackgroundColor:"rgba(0, 0, 0, 0.1)",contextMenuTextColor:"white",contextMenuActiveColor:"#1a1a1a",contextMenuBackgroundColor:"#1a1a1a",contextMenuShadowColor:"rgba(255, 255, 255, 0.1)"}},ge=f.createContext({}),ze=d=>{const{children:o,theme:l,...r}=d,a=f.useMemo(()=>l==="light"?de:l==="dark"?ue:l,[l]);return e.jsx(ge.Provider,{value:{theme:a,...r},children:o})},U=()=>f.useContext(ge),he={maxRow:2,maxCol:2},qe={...he},pe={app:he,group:qe};class Y{}ae(Y,"uniqueArray",o=>o.reduce((l,r)=>l.find(n=>n.id===r.id)?l:l.concat([r]),[])),ae(Y,"getTheme",o=>{const l=de.token,r=ue.token,a={...l,...o==null?void 0:o.token},n={...r,...o==null?void 0:o.token};return{light:a,dark:n}});const me=f.createContext({list:[],setList:()=>{},contextMenu:null,setContextMenu:()=>{},listStatus:null,setListStatus:()=>{},contextMenuFuns:()=>{},hideContextMenu:()=>{},showInfoItemData:null,setShowInfoItemData:()=>{},openGroupItemData:null,setOpenGroupItemData:()=>{},longPressTriggered:!1,updateItem:()=>{},updateItemConfig:()=>{},removeItem:()=>{},addItem:()=>{},moveItemId:null,setMoveItemId:()=>{},moveTargetId:null,setMoveTargetId:()=>{}}),Ae=d=>{const{children:o,list:l=[],onChange:r,storageKey:a="ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",enableCaching:n=!0}=d,[u,b]=f.useState(),[i,C]=f.useState(),[S,q]=f.useState(null),B=f.useRef(S),[E,A]=f.useState(null),[g,c]=f.useState([]),[M,y]=f.useState(null),[L,p]=f.useState(null),[T,I]=f.useState(!1),[m,x]=f.useState(null),[X,W]=f.useState(null),[F,le]=f.useState(!1),[J,R]=ie.useLocalStorageState(a,{defaultValue:[],listenStorageChange:!0}),ee=()=>{A(null),clearTimeout(u),b(void 0),B.current=null},P=(v,G)=>{A({...v,pageX:v.pageX,pageY:v.pageY,data:G}),clearTimeout(u)},O=(v,G=!0)=>{const{config:H={}}=v;return H.allowContextMenu===!1?{}:{onMouseDown:N=>{b(setTimeout(()=>{G&&B.current===null&&P(N,v)},800)),I(!1),C(setTimeout(()=>{I(!0)},800))},onMouseUp:()=>{clearTimeout(i),C(void 0),clearTimeout(u),b(void 0)},onContextMenu:N=>{G&&(N.preventDefault(),P(N,v))}}},K=(v,G)=>{const H=[...G||[]];if(H.length>0)c(N=>{const z=[...N],$=w=>{var Ce,ye;const D=H.shift(),j=w.find(V=>V.id===D),_=w.findIndex(V=>V.id===D);if(H.length&&j){if(((Ce=j.children)==null?void 0:Ce.filter(V=>!v.some(oo=>oo.id===V.id)).length)===1&&v.length===1){const V={...v[0]};return w.splice(_,1,V),r==null||r(w),w}return j.children=$(j.children||[]),w.splice(_,1,j),r==null||r(w),w}if(j){if(!((ye=j.children)!=null&&ye.length)&&v.length){const V={...j};return j.data={name:"文件夹"},j.type="group",j.children=[V,...v],j.id=se.v4(),w.splice(_,1,j),r==null||r(w),w}return j.children=Y.uniqueArray(v),w.splice(_,1,j),r==null||r(w),w}return Y.uniqueArray(v)};return Y.uniqueArray($(z))});else{const N=Y.uniqueArray(v);r==null||r(N),c(N)}},Ze=(v,G)=>{c(H=>{const N=[...H],z=$=>{var w;for(let D=0;D<$.length;D++)if($[D].id===v){$[D].config=G;break}else((w=$[D].children)==null?void 0:w.length)!==void 0&&z($[D].children)};return z(N),r==null||r(N),N})},Qe=(v,G)=>{c(H=>{const N=[...H],z=$=>{var w;for(let D=0;D<$.length;D++)if($[D].id===v){$[D].data=G;break}else((w=$[D].children)==null?void 0:w.length)!==void 0&&z($[D].children)};return z(N),r==null||r(N),N})},Re=v=>{c(G=>{const H=[...G],N=z=>{var $;for(let w=0;w<z.length;w++)if(z[w].id===v){z.splice(w,1);break}else(($=z[w].children)==null?void 0:$.length)!==void 0&&N(z[w].children)};return N(H),r==null||r(H),H})},eo=(v,G)=>{const H=[...g],N=(z,$)=>{const w=$.shift(),D=z.find(_=>_.id===w),j=z.findIndex(_=>_.id===w);if(D){if($.length)D.children=N(D.children||[],$);else{const _=(v==null?void 0:v.type)??"app";D.children=[...D.children??[],{...v,id:se.v4(),config:(v==null?void 0:v.config)??pe[_]}]}return z.splice(j,1,D),z}else return z};c(N(H,G))};return f.useEffect(()=>{(l==null?void 0:l.length)>0&&g.length===0&&K(l)},[l]),f.useEffect(()=>{B.current=S,S!==null&&ee()},[S]),f.useEffect(()=>{n&&J!=null&&J.length&&!F&&(K(J),le(!0))},[J,F,n]),ie.useDebounceEffect(()=>{n&&R(g)},[g,n],{wait:1e3}),e.jsx(me.Provider,{value:{list:g,setList:K,contextMenu:E,setContextMenu:A,listStatus:S,setListStatus:q,contextMenuFuns:O,hideContextMenu:ee,showInfoItemData:M,setShowInfoItemData:y,openGroupItemData:L,setOpenGroupItemData:p,longPressTriggered:T,updateItemConfig:Ze,updateItem:Qe,removeItem:Re,addItem:eo,moveItemId:m,setMoveItemId:x,moveTargetId:X,setMoveTargetId:W},children:o})},Z=()=>f.useContext(me),je={menuShow:{opacity:1,y:0,transition:{type:"spring",stiffness:300,damping:24}},menuHide:{opacity:0,y:20,transition:{duration:.2}}},te=d=>{const{icon:o,title:l,onClick:r}=d,{theme:a}=U(),{light:n,dark:u}=Y.getTheme(a);return e.jsx(s.motion.div,{className:t.css`
1
+ (function(f,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("@emotion/css"),require("react"),require("react-slick"),require("react-sortablejs"),require("framer-motion"),require("ahooks"),require("uuid"),require("rc-tooltip"),require("@remixicon/react"),require("rc-dialog"),require("react-json-view"),require("@mdxeditor/editor"),require("react-markdown"),require("remark-gfm"),require("remark-emoji"),require("rehype-raw"),require("react-syntax-highlighter"),require("clsx"),require("tailwind-merge")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@emotion/css","react","react-slick","react-sortablejs","framer-motion","ahooks","uuid","rc-tooltip","@remixicon/react","rc-dialog","react-json-view","@mdxeditor/editor","react-markdown","remark-gfm","remark-emoji","rehype-raw","react-syntax-highlighter","clsx","tailwind-merge"],e):(f=typeof globalThis<"u"?globalThis:f||self,e(f.zs_library={},f.jsxRuntime,f.css,f.React,f.Slider,f.reactSortablejs,f.framerMotion,f.ahooks,f.uuid,f.RcTooltip,f.react$1,f.Dialog,f.ReactJson,f.MDXEditor,f.Markdown,f.remarkGfm,f.emoji,f.rehypeRaw,f.reactSyntaxHighlighter,f.clsx,f.tailwindMerge))})(this,function(f,e,t,b,Se,oe,s,ie,se,Ie,Q,ce,Te,p,Me,Be,Ne,De,Pe,$e,Le){"use strict";var ao=Object.defineProperty;var lo=(f,e,t)=>e in f?ao(f,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):f[e]=t;var le=(f,e,t)=>lo(f,typeof e!="symbol"?e+"":e,t);require("./zs_library.css");const de={token:{itemNameColor:"#1a1a1a",itemIconBackgroundColor:"white",itemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemIconBackgroundColor:"rgba(255, 255, 255, 0.1)",groupItemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemModalBackgroundColor:"rgba(255, 255, 255, 0.8)",contextMenuTextColor:"black",contextMenuActiveColor:"#f3f4f6",contextMenuBackgroundColor:"white",contextMenuShadowColor:"rgba(0, 0, 0, 0.1)"}},ge={token:{itemNameColor:"white",itemIconBackgroundColor:"#1f2937",itemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemIconBackgroundColor:"rgba(0, 0, 0, 0.1)",groupItemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemModalBackgroundColor:"rgba(0, 0, 0, 0.1)",contextMenuTextColor:"white",contextMenuActiveColor:"#1a1a1a",contextMenuBackgroundColor:"#1a1a1a",contextMenuShadowColor:"rgba(255, 255, 255, 0.1)"}},ue=b.createContext({}),ze=c=>{const{children:o,theme:a,...r}=c,l=b.useMemo(()=>a==="light"?de:a==="dark"?ge:a,[a]);return e.jsx(ue.Provider,{value:{theme:l,...r},children:o})},V=()=>b.useContext(ue),he={maxRow:2,maxCol:2},Ae={...he},pe={app:he,group:Ae};class Y{}le(Y,"uniqueArray",o=>o.reduce((a,r)=>a.find(n=>n.id===r.id)?a:a.concat([r]),[])),le(Y,"getTheme",o=>{const a=de.token,r=ge.token,l={...a,...o==null?void 0:o.token},n={...r,...o==null?void 0:o.token};return{light:l,dark:n}});const me=b.createContext({list:[],setList:()=>{},contextMenu:null,setContextMenu:()=>{},listStatus:null,setListStatus:()=>{},contextMenuFuns:()=>{},hideContextMenu:()=>{},showInfoItemData:null,setShowInfoItemData:()=>{},openGroupItemData:null,setOpenGroupItemData:()=>{},longPressTriggered:!1,updateItem:()=>{},updateItemConfig:()=>{},removeItem:()=>{},addItem:()=>{},moveItemId:null,setMoveItemId:()=>{},moveTargetId:null,setMoveTargetId:()=>{}}),qe=c=>{const{children:o,list:a=[],onChange:r,storageKey:l="ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",enableCaching:n=!0}=c,[g,k]=b.useState(),[i,C]=b.useState(),[M,A]=b.useState(null),P=b.useRef(M),[j,q]=b.useState(null),[h,d]=b.useState([]),[I,w]=b.useState(null),[S,u]=b.useState(null),[B,T]=b.useState(!1),[m,x]=b.useState(null),[H,W]=b.useState(null),[F,ae]=b.useState(!1),[J,R]=ie.useLocalStorageState(l,{defaultValue:[],listenStorageChange:!0}),ee=()=>{q(null),clearTimeout(g),k(void 0),P.current=null},$=(y,G)=>{q({...y,pageX:y.pageX,pageY:y.pageY,data:G}),clearTimeout(g)},_=(y,G=!0)=>{const{config:X={}}=y;return X.allowContextMenu===!1?{}:{onMouseDown:N=>{k(setTimeout(()=>{G&&P.current===null&&$(N,y)},800)),T(!1),C(setTimeout(()=>{T(!0)},800))},onMouseUp:()=>{clearTimeout(i),C(void 0),clearTimeout(g),k(void 0)},onContextMenu:N=>{G&&(N.preventDefault(),$(N,y))}}},K=(y,G)=>{const X=[...G||[]];if(X.length>0)d(N=>{const z=[...N],L=v=>{var we,Ce;const D=X.shift(),E=v.find(U=>U.id===D),O=v.findIndex(U=>U.id===D);if(X.length&&E){if(((we=E.children)==null?void 0:we.filter(U=>!y.some(no=>no.id===U.id)).length)===1&&y.length===1){const U={...y[0]};return v.splice(O,1,U),r==null||r(v),v}return E.children=L(E.children||[]),v.splice(O,1,E),r==null||r(v),v}if(E){if(!((Ce=E.children)!=null&&Ce.length)&&y.length){const U={...E};return E.data={name:"文件夹"},E.type="group",E.children=[U,...y],E.id=se.v4(),v.splice(O,1,E),r==null||r(v),v}return E.children=Y.uniqueArray(y),v.splice(O,1,E),r==null||r(v),v}return Y.uniqueArray(y)};return Y.uniqueArray(L(z))});else{const N=Y.uniqueArray(y);r==null||r(N),d(N)}},eo=(y,G)=>{d(X=>{const N=[...X],z=L=>{var v;for(let D=0;D<L.length;D++)if(L[D].id===y){L[D].config=G;break}else((v=L[D].children)==null?void 0:v.length)!==void 0&&z(L[D].children)};return z(N),r==null||r(N),N})},oo=(y,G)=>{d(X=>{const N=[...X],z=L=>{var v;for(let D=0;D<L.length;D++)if(L[D].id===y){L[D].data=G;break}else((v=L[D].children)==null?void 0:v.length)!==void 0&&z(L[D].children)};return z(N),r==null||r(N),N})},to=y=>{d(G=>{const X=[...G],N=z=>{var L;for(let v=0;v<z.length;v++)if(z[v].id===y){z.splice(v,1);break}else((L=z[v].children)==null?void 0:L.length)!==void 0&&N(z[v].children)};return N(X),r==null||r(X),X})},ro=(y,G)=>{const X=[...h],N=(z,L)=>{const v=L.shift(),D=z.find(O=>O.id===v),E=z.findIndex(O=>O.id===v);if(D){if(L.length)D.children=N(D.children||[],L);else{const O=(y==null?void 0:y.type)??"app";D.children=[...D.children??[],{...y,id:se.v4(),config:(y==null?void 0:y.config)??pe[O]}]}return z.splice(E,1,D),z}else return z};d(N(X,G))};return b.useEffect(()=>{(a==null?void 0:a.length)>0&&h.length===0&&K(a)},[a]),b.useEffect(()=>{P.current=M,M!==null&&ee()},[M]),b.useEffect(()=>{n&&J!=null&&J.length&&!F&&(K(J),ae(!0))},[J,F,n]),ie.useDebounceEffect(()=>{n&&R(h)},[h,n],{wait:1e3}),e.jsx(me.Provider,{value:{list:h,setList:K,contextMenu:j,setContextMenu:q,listStatus:M,setListStatus:A,contextMenuFuns:_,hideContextMenu:ee,showInfoItemData:I,setShowInfoItemData:w,openGroupItemData:S,setOpenGroupItemData:u,longPressTriggered:B,updateItemConfig:eo,updateItem:oo,removeItem:to,addItem:ro,moveItemId:m,setMoveItemId:x,moveTargetId:H,setMoveTargetId:W},children:o})},Z=()=>b.useContext(me),Ee={menuShow:{opacity:1,y:0,transition:{type:"spring",stiffness:300,damping:24}},menuHide:{opacity:0,y:20,transition:{duration:.2}}},te=c=>{const{icon:o,title:a,onClick:r}=c,{theme:l}=V(),{light:n,dark:g}=Y.getTheme(l);return e.jsx(s.motion.div,{className:t.css`
2
2
  &:hover {
3
3
  background-color: ${n.contextMenuActiveColor};
4
4
  @media (prefers-color-scheme: dark) {
5
- background-color: ${u.contextMenuActiveColor};
5
+ background-color: ${g.contextMenuActiveColor};
6
6
  }
7
7
  }
8
8
  @media (prefers-color-scheme: dark) {
@@ -14,7 +14,7 @@
14
14
  transition: all 0.3s;
15
15
  user-select: none;
16
16
  border-radius: 0.5rem;
17
- `,onClick:b=>{b.stopPropagation(),r==null||r()},variants:je,children:e.jsxs(s.motion.div,{className:t.cx("py-1.5 px-3 rounded-lg",t.css`
17
+ `,onClick:k=>{k.stopPropagation(),r==null||r()},variants:Ee,children:e.jsxs(s.motion.div,{className:t.cx("py-1.5 px-3 rounded-lg",t.css`
18
18
  padding-top: 0.375rem;
19
19
  padding-bottom: 0.375rem;
20
20
  padding-left: 0.75rem;
@@ -24,20 +24,20 @@
24
24
  margin-bottom: 0.375rem;
25
25
  display: flex;
26
26
  justify-content: center;
27
- `),children:o}),e.jsx(s.motion.div,{children:l})]})})},Ee=d=>{const{showInfoButton:o=!0,showRemoveButton:l=!0,showShareButton:r=!0,showSizeButton:a=!0,onInfoClick:n,onShareClick:u,onRemoveClick:b}=d,{contextMenu:i,setContextMenu:C,hideContextMenu:S,setShowInfoItemData:q,removeItem:B,updateItemConfig:E}=Z(),{theme:A}=U(),{light:g,dark:c}=Y.getTheme(A),{data:M}=i??{},{config:y={}}=M??{},L=()=>{var I;const p=pe[(I=i==null?void 0:i.data)==null?void 0:I.type],T=[];for(let m=1;m<=((p==null?void 0:p.maxRow)??2);m++)for(let x=1;x<=((p==null?void 0:p.maxCol)??2);x++)T.push(`${m}x${x}`);return T};return e.jsx(s.AnimatePresence,{children:i&&e.jsxs(s.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:p=>{p.stopPropagation(),p.preventDefault()},children:[e.jsx(s.motion.div,{className:t.cx(t.css`
27
+ `),children:o}),e.jsx(s.motion.div,{children:a})]})})},je=c=>{const{showInfoButton:o=!0,showRemoveButton:a=!0,showShareButton:r=!0,showSizeButton:l=!0,onInfoClick:n,onShareClick:g,onRemoveClick:k}=c,{contextMenu:i,setContextMenu:C,hideContextMenu:M,setShowInfoItemData:A,removeItem:P,updateItemConfig:j}=Z(),{theme:q}=V(),{light:h,dark:d}=Y.getTheme(q),{data:I}=i??{},{config:w={}}=I??{},S=()=>{var T;const u=pe[(T=i==null?void 0:i.data)==null?void 0:T.type],B=[];for(let m=1;m<=((u==null?void 0:u.maxRow)??2);m++)for(let x=1;x<=((u==null?void 0:u.maxCol)??2);x++)B.push(`${m}x${x}`);return B};return e.jsx(s.AnimatePresence,{children:i&&e.jsxs(s.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:u=>{u.stopPropagation(),u.preventDefault()},children:[e.jsx(s.motion.div,{className:t.cx(t.css`
28
28
  border-radius: 0.5rem;
29
29
  overflow: hidden;
30
- background-color: ${g.contextMenuBackgroundColor};
31
- box-shadow: 0 0 0.5rem ${g.contextMenuShadowColor};
30
+ background-color: ${h.contextMenuBackgroundColor};
31
+ box-shadow: 0 0 0.5rem ${h.contextMenuShadowColor};
32
32
  @media (prefers-color-scheme: dark) {
33
- background-color: ${c.contextMenuBackgroundColor};
34
- box-shadow: 0 0 0.5rem ${c.contextMenuShadowColor};
33
+ background-color: ${d.contextMenuBackgroundColor};
34
+ box-shadow: 0 0 0.5rem ${d.contextMenuShadowColor};
35
35
  }
36
- `),children:a&&y.allowResize!==!1&&e.jsx(s.motion.ul,{className:t.css`
36
+ `),children:l&&w.allowResize!==!1&&e.jsx(s.motion.ul,{className:t.css`
37
37
  background-color: white;
38
38
  padding: 0.25rem;
39
39
  margin: 0;
40
- `,children:[{label:"修改大小",key:"size",icon:e.jsx(Q.RiPencilRuler2Line,{size:14}),items:L().map(p=>({label:p,key:p,onClick:()=>{const[T,I]=p.split("x").map(Number);E(i.data.id,{row:T,col:I})}}))}].map(p=>e.jsxs(s.motion.li,{className:t.css`
40
+ `,children:[{label:"修改大小",key:"size",icon:e.jsx(Q.RiPencilRuler2Line,{size:14}),items:S().map(u=>({label:u,key:u,onClick:()=>{const[B,T]=u.split("x").map(Number);j(i.data.id,{row:B,col:T})}}))}].map(u=>e.jsxs(s.motion.li,{className:t.css`
41
41
  padding-top: 0.5rem;
42
42
  padding-bottom: 0.5rem;
43
43
  padding-left: 0.75rem;
@@ -50,11 +50,11 @@
50
50
  gap: 0.5rem;
51
51
  padding-bottom: 0.5rem;
52
52
  margin: 0;
53
- `,children:[p.icon," ",p.label]}),e.jsx(s.motion.div,{className:t.css`
53
+ `,children:[u.icon," ",u.label]}),e.jsx(s.motion.div,{className:t.css`
54
54
  display: grid;
55
55
  grid-template-columns: repeat(2, minmax(0, 1fr));
56
56
  gap: 0.25rem;
57
- `,children:p.items.map(T=>e.jsx(s.motion.div,{className:t.cx("py-1 px-2 hover:bg-gray-100 rounded transition-all cursor-pointer text-center text-sm",t.css`
57
+ `,children:u.items.map(B=>e.jsx(s.motion.div,{className:t.cx("py-1 px-2 hover:bg-gray-100 rounded transition-all cursor-pointer text-center text-sm",t.css`
58
58
  padding-top: 0.25rem;
59
59
  padding-bottom: 0.25rem;
60
60
  padding-left: 0.5rem;
@@ -65,27 +65,27 @@
65
65
  line-height: 1.25rem;
66
66
  cursor: pointer;
67
67
  text-align: center;
68
- color: ${g.contextMenuTextColor};
68
+ color: ${h.contextMenuTextColor};
69
69
  @media (prefers-color-scheme: dark) {
70
- color: ${c.contextMenuTextColor};
70
+ color: ${d.contextMenuTextColor};
71
71
  }
72
72
  &:hover {
73
- background-color: ${g.contextMenuActiveColor};
73
+ background-color: ${h.contextMenuActiveColor};
74
74
  @media (prefers-color-scheme: dark) {
75
- background-color: ${c.contextMenuActiveColor};
75
+ background-color: ${d.contextMenuActiveColor};
76
76
  }
77
77
  }
78
- `,`${y.row}x${y.col}`===T.key&&t.css`
79
- background-color: ${g.contextMenuActiveColor};
78
+ `,`${w.row}x${w.col}`===B.key&&t.css`
79
+ background-color: ${h.contextMenuActiveColor};
80
80
  @media (prefers-color-scheme: dark) {
81
- background-color: ${c.contextMenuActiveColor};
81
+ background-color: ${d.contextMenuActiveColor};
82
82
  }
83
- `),onClick:T.onClick,children:T.label},T.key))})]},p.key))})}),e.jsxs(s.motion.div,{className:t.cx(t.css`
84
- background-color: ${g.contextMenuBackgroundColor};
85
- box-shadow: 0 0 0.5rem ${g.contextMenuShadowColor};
83
+ `),onClick:B.onClick,children:B.label},B.key))})]},u.key))})}),e.jsxs(s.motion.div,{className:t.cx(t.css`
84
+ background-color: ${h.contextMenuBackgroundColor};
85
+ box-shadow: 0 0 0.5rem ${h.contextMenuShadowColor};
86
86
  @media (prefers-color-scheme: dark) {
87
- background-color: ${c.contextMenuBackgroundColor};
88
- box-shadow: 0 0 0.5rem ${c.contextMenuShadowColor};
87
+ background-color: ${d.contextMenuBackgroundColor};
88
+ box-shadow: 0 0 0.5rem ${d.contextMenuShadowColor};
89
89
  }
90
90
  display: flex;
91
91
  justify-content: space-around;
@@ -94,12 +94,12 @@
94
94
  border-radius: 0.5rem;
95
95
  overflow: hidden;
96
96
  padding: 0.25rem;
97
- `),children:[r&&e.jsx(te,{icon:e.jsx(Q.RiShareLine,{size:20}),title:"分享",onClick:()=>{if(u){u(i.data);return}}}),o&&e.jsx(te,{icon:e.jsx(Q.RiInformationLine,{size:20}),title:"信息",onClick:()=>{if(n){n(i.data);return}q({...i.data,pageX:i.pageX,pageY:i.pageY}),S()}}),l&&e.jsx(te,{icon:e.jsx(Q.RiCloseCircleLine,{size:20}),title:"移除",onClick:()=>{if(b){b(i.data,B);return}C(null),B(i.data.id)}})]})]})})},Xe=d=>{const{data:o,noLetters:l=!1}=d,{contextMenuFuns:r}=Z(),{itemIconBuilder:a,theme:n,contextMenu:u}=U(),{light:b,dark:i}=Y.getTheme(n),{data:C={}}=o,{name:S}=C;return e.jsxs(e.Fragment,{children:[e.jsx(s.motion.div,{className:t.css`
97
+ `),children:[r&&e.jsx(te,{icon:e.jsx(Q.RiShareLine,{size:20}),title:"分享",onClick:()=>{if(g){g(i.data);return}}}),o&&e.jsx(te,{icon:e.jsx(Q.RiInformationLine,{size:20}),title:"信息",onClick:()=>{if(n){n(i.data);return}A({...i.data,pageX:i.pageX,pageY:i.pageY}),M()}}),a&&e.jsx(te,{icon:e.jsx(Q.RiCloseCircleLine,{size:20}),title:"移除",onClick:()=>{if(k){k(i.data,P);return}C(null),P(i.data.id)}})]})]})})},He=c=>{const{data:o,noLetters:a=!1}=c,{contextMenuFuns:r}=Z(),{itemIconBuilder:l,theme:n,contextMenu:g}=V(),{light:k,dark:i}=Y.getTheme(n),{data:C={}}=o,{name:M}=C;return e.jsxs(e.Fragment,{children:[e.jsx(s.motion.div,{className:t.css`
98
98
  width: 4rem;
99
99
  height: 4rem;
100
- background-color: ${b.itemIconBackgroundColor};
100
+ background-color: ${k.itemIconBackgroundColor};
101
101
  border-radius: 0.75rem;
102
- box-shadow: 0 0 0.5rem ${b.itemIconShadowColor};
102
+ box-shadow: 0 0 0.5rem ${k.itemIconShadowColor};
103
103
  cursor: pointer;
104
104
  position: relative;
105
105
  overflow: hidden;
@@ -113,50 +113,50 @@
113
113
  top: 0;
114
114
  width: 100%;
115
115
  height: 100%;
116
- color: ${b.itemNameColor};
116
+ color: ${k.itemNameColor};
117
117
  @media (prefers-color-scheme: dark) {
118
118
  color: ${i.itemNameColor};
119
119
  }
120
- `,...r(o,u!==!1),children:a==null?void 0:a(o)})}),e.jsx(s.motion.p,{className:t.cx(t.css`
120
+ `,...r(o,g!==!1),children:l==null?void 0:l(o)})}),e.jsx(s.motion.p,{className:t.cx(t.css`
121
121
  text-align: center;
122
122
  margin-top: 0.25rem;
123
123
  margin-bottom: 0;
124
- color: ${b.itemNameColor};
124
+ color: ${k.itemNameColor};
125
125
  @media (prefers-color-scheme: dark) {
126
126
  color: ${i.itemNameColor};
127
127
  }
128
- `,l&&t.css`
128
+ `,a&&t.css`
129
129
  color: transparent;
130
- `),children:S})]})},re=d=>{const{data:o,className:l,itemIndex:r,onClick:a,disabledDrag:n=!1,children:u,parentIds:b,childrenLength:i}=d,{contextMenu:C,setContextMenu:S}=Z(),{contextMenu:q}=U();return e.jsx(Se,{placement:"bottom",overlayClassName:t.css`
130
+ `),children:M})]})},re=c=>{const{data:o,className:a,itemIndex:r,onClick:l,disabledDrag:n=!1,children:g,parentIds:k,childrenLength:i}=c,{contextMenu:C,setContextMenu:M}=Z(),{contextMenu:A}=V();return e.jsx(Ie,{placement:"bottom",overlayClassName:t.css`
131
131
  background-color: transparent;
132
132
  .rc-tooltip-inner {
133
133
  background-color: transparent;
134
134
  padding: 0;
135
135
  border: none;
136
136
  }
137
- `,overlay:e.jsx(Ee,{...q}),visible:(C==null?void 0:C.data.id)===o.id,onVisibleChange:B=>{B||S(null)},destroyTooltipOnHide:!0,children:e.jsx(s.motion.div,{"data-id":o.id,"data-index":r,"data-parent-ids":b==null?void 0:b.join(","),"data-children-length":i,onClick:()=>a==null?void 0:a(o),className:t.cx(n&&"drag-disabled",l),children:u??e.jsx(Xe,{...d})})})},Fe=d=>{const{data:o,className:l,parentIds:r,itemIndex:a,onClick:n,noLetters:u=!1}=d,{contextMenuFuns:b,setList:i,setOpenGroupItemData:C,longPressTriggered:S,moveItemId:q,moveTargetId:B,setMoveTargetId:E,listStatus:A}=Z(),{itemIconBuilder:g,theme:c,contextMenu:M}=U(),{light:y,dark:L}=Y.getTheme(c),{children:p,data:T,config:I}=o,{row:m=1,col:x=1}=I??{},X={visible:{opacity:1,scale:1},hidden:{opacity:0,scale:.95}},W=((p==null?void 0:p.length)??0)===0,F=W?[o]:[...p??[]].slice(0,9),le=f.useMemo(()=>q===o.id.toString(),[o.id,q]),J=f.useMemo(()=>B===o.id,[o.id,B]),R=t.css`
137
+ `,overlay:e.jsx(je,{...A}),visible:(C==null?void 0:C.data.id)===o.id,onVisibleChange:P=>{P||M(null)},destroyTooltipOnHide:!0,children:e.jsx(s.motion.div,{"data-id":o.id,"data-index":r,"data-parent-ids":k==null?void 0:k.join(","),"data-children-length":i,onClick:()=>l==null?void 0:l(o),className:t.cx(n&&"drag-disabled",a),children:g??e.jsx(He,{...c})})})},Fe=c=>{const{data:o,className:a,parentIds:r,itemIndex:l,onClick:n,noLetters:g=!1}=c,{contextMenuFuns:k,setList:i,setOpenGroupItemData:C,longPressTriggered:M,moveItemId:A,moveTargetId:P,setMoveTargetId:j,listStatus:q}=Z(),{itemIconBuilder:h,theme:d,contextMenu:I}=V(),{light:w,dark:S}=Y.getTheme(d),{children:u,data:B,config:T}=o,{row:m=1,col:x=1}=T??{},H={visible:{opacity:1,scale:1},hidden:{opacity:0,scale:.95}},W=((u==null?void 0:u.length)??0)===0,F=W?[o]:[...u??[]].slice(0,9),ae=b.useMemo(()=>A===o.id.toString(),[o.id,A]),J=b.useMemo(()=>P===o.id,[o.id,P]),R=t.css`
138
138
  overflow: hidden;
139
139
  cursor: pointer;
140
- background-color: ${y.itemIconBackgroundColor};
141
- box-shadow: 0 0 0.5rem ${y.itemIconShadowColor};
140
+ background-color: ${w.itemIconBackgroundColor};
141
+ box-shadow: 0 0 0.5rem ${w.itemIconShadowColor};
142
142
  @media (prefers-color-scheme: dark) {
143
- background-color: ${L.itemIconBackgroundColor};
144
- box-shadow: 0 0 0.5rem ${L.itemIconShadowColor};
143
+ background-color: ${S.itemIconBackgroundColor};
144
+ box-shadow: 0 0 0.5rem ${S.itemIconShadowColor};
145
145
  }
146
146
  `,ee=()=>{if(W)return e.jsx(s.motion.div,{className:t.cx("sortable-group-item",t.css`
147
147
  overflow: hidden;
148
148
  cursor: pointer;
149
149
  width: 100%;
150
150
  height: 100%;
151
- background-color: ${y.itemIconBackgroundColor};
151
+ background-color: ${w.itemIconBackgroundColor};
152
152
  position: absolute;
153
153
  left: 0;
154
154
  top: 0;
155
155
  border-radius: 0.75rem;
156
156
  @media (prefers-color-scheme: dark) {
157
- background-color: ${L.itemIconBackgroundColor};
157
+ background-color: ${S.itemIconBackgroundColor};
158
158
  }
159
- `),onClick:P=>{P.stopPropagation(),n==null||n(o)},children:g==null?void 0:g(o)});if(m===1&&x===1||m===2&&x===2)return e.jsx(s.motion.div,{className:t.css`
159
+ `),onClick:$=>{$.stopPropagation(),n==null||n(o)},children:h==null?void 0:h(o)});if(m===1&&x===1||m===2&&x===2)return e.jsx(s.motion.div,{className:t.css`
160
160
  display: grid;
161
161
  width: 100%;
162
162
  height: 100%;
@@ -165,11 +165,11 @@
165
165
  padding: ${x===1?"0.125rem":"0.25rem"};
166
166
  gap: ${x===1?"0.125rem":"0.5rem"};
167
167
  place-items: center;
168
- `,children:F==null?void 0:F.slice(0,9).map(P=>e.jsx(s.motion.div,{className:t.cx(R,t.css`
168
+ `,children:F==null?void 0:F.slice(0,9).map($=>e.jsx(s.motion.div,{className:t.cx(R,t.css`
169
169
  border-radius: ${x===1?"0.25rem":"0.5rem"};
170
170
  width: 100%;
171
171
  height: 100%;
172
- `),onClick:O=>{O.stopPropagation(),n==null||n(P)},children:g==null?void 0:g(P)},P.id))});if(m===1&&x===2)return e.jsx(s.motion.div,{className:t.css`
172
+ `),onClick:_=>{_.stopPropagation(),n==null||n($)},children:h==null?void 0:h($)},$.id))});if(m===1&&x===2)return e.jsx(s.motion.div,{className:t.css`
173
173
  display: grid;
174
174
  grid-template-columns: repeat(10, minmax(0, 1fr));
175
175
  grid-template-rows: repeat(4, minmax(0, 1fr));
@@ -178,7 +178,7 @@
178
178
  width: 144px;
179
179
  height: 52px;
180
180
  place-items: center;
181
- `,children:F==null?void 0:F.slice(0,4).map((P,O)=>e.jsx(s.motion.div,{className:t.cx(R,O<2?t.css`
181
+ `,children:F==null?void 0:F.slice(0,4).map(($,_)=>e.jsx(s.motion.div,{className:t.cx(R,_<2?t.css`
182
182
  width: 52px;
183
183
  height: 52px;
184
184
  border-radius: 0.5rem;
@@ -190,7 +190,7 @@
190
190
  border-radius: 0.375rem;
191
191
  grid-column: span 2 / span 2;
192
192
  grid-row: span 2 / span 2;
193
- `),onClick:K=>{O>2||(K.stopPropagation(),n==null||n(P))},children:g==null?void 0:g(P)},P.id))});if(m===2&&x===1)return e.jsx(s.motion.div,{className:t.css`
193
+ `),onClick:K=>{_>2||(K.stopPropagation(),n==null||n($))},children:h==null?void 0:h($)},$.id))});if(m===2&&x===1)return e.jsx(s.motion.div,{className:t.css`
194
194
  display: grid;
195
195
  grid-template-columns: repeat(4, minmax(0, 1fr));
196
196
  grid-template-rows: repeat(10, minmax(0, 1fr));
@@ -199,7 +199,7 @@
199
199
  width: 52px;
200
200
  height: 144px;
201
201
  place-items: center;
202
- `,children:F==null?void 0:F.slice(0,4).map((P,O)=>e.jsx(s.motion.div,{className:t.cx(R,O<2?t.css`
202
+ `,children:F==null?void 0:F.slice(0,4).map(($,_)=>e.jsx(s.motion.div,{className:t.cx(R,_<2?t.css`
203
203
  width: 52px;
204
204
  height: 52px;
205
205
  border-radius: 0.5rem;
@@ -210,25 +210,25 @@
210
210
  height: 1.5rem;
211
211
  grid-column: span 2 / span 2;
212
212
  grid-row: span 2 / span 2;
213
- `),onClick:K=>{O>2||(K.stopPropagation(),n==null||n(P))},children:g==null?void 0:g(P)},P.id))})};return e.jsxs(re,{data:o,itemIndex:a,parentIds:r,childrenLength:p==null?void 0:p.length,className:t.cx(t.css`
213
+ `),onClick:K=>{_>2||(K.stopPropagation(),n==null||n($))},children:h==null?void 0:h($)},$.id))})};return e.jsxs(re,{data:o,itemIndex:l,parentIds:r,childrenLength:u==null?void 0:u.length,className:t.cx(t.css`
214
214
  grid-row: span ${m};
215
215
  grid-column: span ${x};
216
- `,l),children:[e.jsx(s.motion.div,{whileTap:{scale:.9},className:t.cx(J?"!scale-110":"",t.css`
216
+ `,a),children:[e.jsx(s.motion.div,{whileTap:{scale:.9},className:t.cx(J?"!scale-110":"",t.css`
217
217
  cursor: pointer;
218
218
  position: relative;
219
219
  border-radius: 0.75rem;
220
- background-color: ${y.groupItemIconBackgroundColor};
221
- box-shadow: 0 0 0.5rem ${y.groupItemIconShadowColor};
220
+ background-color: ${w.groupItemIconBackgroundColor};
221
+ box-shadow: 0 0 0.5rem ${w.groupItemIconShadowColor};
222
222
  @media (prefers-color-scheme: dark) {
223
- background-color: ${L.groupItemIconBackgroundColor};
224
- box-shadow: 0 0 0.5rem ${L.groupItemIconShadowColor};
223
+ background-color: ${S.groupItemIconBackgroundColor};
224
+ box-shadow: 0 0 0.5rem ${S.groupItemIconShadowColor};
225
225
  }
226
226
  /* overflow: hidden; */
227
227
  transition: all 0.3s;
228
228
  margin: 0 auto;
229
229
  width: ${x*64+32*(x-1)}px;
230
230
  height: ${m*64+32*(m-1)}px;
231
- `),onClick:P=>{!W&&!S&&(o.parentIds=r,o.pageX=P.pageX,o.pageY=P.pageY,C(o))},...b(o,M!==!1),children:e.jsxs(s.motion.div,{className:t.css`
231
+ `),onClick:$=>{!W&&!M&&(o.parentIds=r,o.pageX=$.pageX,o.pageY=$.pageY,C(o))},...k(o,I!==!1),children:e.jsxs(s.motion.div,{className:t.css`
232
232
  position: relative;
233
233
  width: 100%;
234
234
  height: 100%;
@@ -243,21 +243,21 @@
243
243
  top: 0.375rem;
244
244
  width: calc(100% - 0.75rem);
245
245
  height: calc(100% - 0.75rem);
246
- pointer-events: ${A===null?"none":"auto"};
246
+ pointer-events: ${q===null?"none":"auto"};
247
247
  > * {
248
248
  opacity: 0;
249
249
  }
250
- `),group:{name:"nested",pull:!1,put:!0},animation:150,fallbackOnBody:!0,list:p??[],setList:P=>i(P,r),filter:()=>!0,"data-id":o.id,onChange:()=>{E(o.id)}})]})}),e.jsx(s.motion.p,{className:t.cx(t.css`
250
+ `),group:{name:"nested",pull:!1,put:!0},animation:150,fallbackOnBody:!0,list:u??[],setList:$=>i($,r),filter:()=>!0,"data-id":o.id,onChange:()=>{j(o.id)}})]})}),e.jsx(s.motion.p,{className:t.cx(t.css`
251
251
  text-align: center;
252
252
  margin-top: 0.25rem;
253
253
  margin-bottom: 0;
254
- color: ${y.itemNameColor};
254
+ color: ${w.itemNameColor};
255
255
  @media (prefers-color-scheme: dark) {
256
- color: ${L.itemNameColor};
256
+ color: ${S.itemNameColor};
257
257
  }
258
- `,u&&t.css`
258
+ `,g&&t.css`
259
259
  color: transparent;
260
- `),variants:X,animate:le?"hidden":"visible",children:(T==null?void 0:T.name)??"文件夹"})]})},ke=t.css`
260
+ `),variants:H,animate:ae?"hidden":"visible",children:(B==null?void 0:B.name)??"文件夹"})]})},fe=t.css`
261
261
  padding: 8px;
262
262
  transition: all 0.2s;
263
263
  > div {
@@ -269,7 +269,7 @@
269
269
  transition: all 0.2s;
270
270
  }
271
271
  }
272
- `,He=d=>{const{data:o,onClose:l,onItemClick:r}=d,{list:a,setList:n,setListStatus:u,setMoveItemId:b,setMoveTargetId:i,updateItem:C}=Z(),{theme:S}=U(),{light:q,dark:B}=Y.getTheme(S),[E,A]=f.useState("文件夹"),g=[...(o==null?void 0:o.children)??[]];return f.useEffect(()=>{var c;o&&A((c=o.data)==null?void 0:c.name)},[o]),e.jsx(ce,{visible:!!o,onClose:()=>{l()},animation:"zoom",maskAnimation:"fade",mousePosition:o!=null&&o.pageX&&(o!=null&&o.pageY)?{x:o==null?void 0:o.pageX,y:o==null?void 0:o.pageY}:null,title:e.jsx("input",{className:t.css`
272
+ `,Xe=c=>{const{data:o,onClose:a,onItemClick:r}=c,{list:l,setList:n,setListStatus:g,setMoveItemId:k,setMoveTargetId:i,updateItem:C}=Z(),{theme:M}=V(),{light:A,dark:P}=Y.getTheme(M),[j,q]=b.useState("文件夹"),h=[...(o==null?void 0:o.children)??[]];return b.useEffect(()=>{var d;o&&q((d=o.data)==null?void 0:d.name)},[o]),e.jsx(ce,{visible:!!o,onClose:()=>{a()},animation:"zoom",maskAnimation:"fade",mousePosition:o!=null&&o.pageX&&(o!=null&&o.pageY)?{x:o==null?void 0:o.pageX,y:o==null?void 0:o.pageY}:null,title:e.jsx("input",{className:t.css`
273
273
  background-color: transparent;
274
274
  border-style: none;
275
275
  text-align: center;
@@ -282,7 +282,7 @@
282
282
  &:focus {
283
283
  outline: none;
284
284
  }
285
- `,value:E,onChange:c=>{A(c.target.value)},onBlur:()=>{o&&C(o.id,{...o.data,name:E})}}),footer:null,closable:!1,className:t.cx("group-item-modal",t.css`
285
+ `,value:j,onChange:d=>{q(d.target.value)},onBlur:()=>{o&&C(o.id,{...o.data,name:j})}}),footer:null,closable:!1,className:t.cx("group-item-modal",t.css`
286
286
  .rc-dialog-content {
287
287
  background-color: transparent;
288
288
  box-shadow: none;
@@ -297,9 +297,9 @@
297
297
  }
298
298
  }
299
299
  .rc-dialog-body {
300
- background-color: ${q.groupItemModalBackgroundColor};
300
+ background-color: ${A.groupItemModalBackgroundColor};
301
301
  @media (prefers-color-scheme: dark) {
302
- background-color: ${B.groupItemModalBackgroundColor};
302
+ background-color: ${P.groupItemModalBackgroundColor};
303
303
  }
304
304
  border-radius: 0.5rem;
305
305
  overflow: hidden;
@@ -309,14 +309,14 @@
309
309
  overflow-y: auto;
310
310
  max-height: 60vh;
311
311
  padding: 1.25rem 0;
312
- `,onDragLeave:c=>{const M=c.relatedTarget;M&&(c.currentTarget.contains(M)||setTimeout(()=>{l()},500))},children:e.jsx(oe.ReactSortable,{className:t.css`
312
+ `,onDragLeave:d=>{const I=d.relatedTarget;I&&(d.currentTarget.contains(I)||setTimeout(()=>{a()},500))},children:e.jsx(oe.ReactSortable,{className:t.css`
313
313
  display: grid;
314
314
  gap: 1rem;
315
315
  place-items: center;
316
316
  grid-template-columns: repeat(auto-fill, 96px);
317
317
  grid-auto-flow: dense;
318
318
  grid-auto-rows: 96px;
319
- `,group:{name:"nested",pull:!0,put:!1},animation:150,fallbackOnBody:!0,list:(o==null?void 0:o.children)??[],setList:c=>{var L,p;const M=c.map(T=>T.id),y=(p=(L=a.find(T=>T.id===(o==null?void 0:o.id)))==null?void 0:L.children)==null?void 0:p.map(T=>T.id);M.length===(y==null?void 0:y.length)&&M.every((T,I)=>T===y[I])||M.length<((y==null?void 0:y.length)??0)||n(c,[...(o==null?void 0:o.parentIds)??[],o==null?void 0:o.id])},onMove:()=>(i(null),u("onMove"),!0),onStart:c=>{const M=c.item.dataset;M!=null&&M.id&&b(M.id),u("onMove")},onEnd:()=>{b(null),i(null),u(null)},ghostClass:ke,children:g.map((c,M)=>e.jsx(re,{data:c,itemIndex:M,onClick:r},c.id))})})})},Ge=d=>{var r;const{data:o,onClose:l}=d;return e.jsx(ce,{visible:!!o,onClose:()=>{l()},animation:"zoom",maskAnimation:"fade",mousePosition:o!=null&&o.pageX&&(o!=null&&o.pageY)?{x:o==null?void 0:o.pageX,y:o==null?void 0:o.pageY}:null,footer:null,title:((r=o==null?void 0:o.data)==null?void 0:r.name)??"信息",children:o&&e.jsxs("div",{children:[e.jsx("div",{className:"mb-2",children:"开发者信息"}),e.jsx("div",{className:"p-2 rounded-md bg-[#272822]",children:e.jsx(Te,{src:o,theme:"monokai"})})]})})},Ye=d=>{const{pagination:o={position:"bottom"},className:l,sliderProps:r,sliderRef:a,onItemClick:n}=d,u=f.useRef(null),b=f.useRef(null),{list:i,setList:C,setListStatus:S,showInfoItemData:q,setShowInfoItemData:B,openGroupItemData:E,setOpenGroupItemData:A,setMoveItemId:g,setMoveTargetId:c,addItem:M}=Z(),{pagingDotBuilder:y,pagingDotsBuilder:L,itemBuilder:p}=U(),T=f.useMemo(()=>o===!1?{}:{top:t.css`
319
+ `,group:{name:"nested",pull:!0,put:!1},animation:150,fallbackOnBody:!0,list:(o==null?void 0:o.children)??[],setList:d=>{var S,u;const I=d.map(B=>B.id),w=(u=(S=l.find(B=>B.id===(o==null?void 0:o.id)))==null?void 0:S.children)==null?void 0:u.map(B=>B.id);I.length===(w==null?void 0:w.length)&&I.every((B,T)=>B===w[T])||I.length<((w==null?void 0:w.length)??0)||n(d,[...(o==null?void 0:o.parentIds)??[],o==null?void 0:o.id])},onMove:()=>(i(null),g("onMove"),!0),onStart:d=>{const I=d.item.dataset;I!=null&&I.id&&k(I.id),g("onMove")},onEnd:()=>{k(null),i(null),g(null)},ghostClass:fe,children:h.map((d,I)=>e.jsx(re,{data:d,itemIndex:I,onClick:r},d.id))})})})},Ge=c=>{var r;const{data:o,onClose:a}=c;return e.jsx(ce,{visible:!!o,onClose:()=>{a()},animation:"zoom",maskAnimation:"fade",mousePosition:o!=null&&o.pageX&&(o!=null&&o.pageY)?{x:o==null?void 0:o.pageX,y:o==null?void 0:o.pageY}:null,footer:null,title:((r=o==null?void 0:o.data)==null?void 0:r.name)??"信息",children:o&&e.jsxs("div",{children:[e.jsx("div",{className:"mb-2",children:"开发者信息"}),e.jsx("div",{className:"p-2 rounded-md bg-[#272822]",children:e.jsx(Te,{src:o,theme:"monokai"})})]})})},Ye=c=>{const{pagination:o={position:"bottom"},className:a,sliderProps:r,sliderRef:l,onItemClick:n}=c,g=b.useRef(null),k=b.useRef(null),{list:i,setList:C,setListStatus:M,showInfoItemData:A,setShowInfoItemData:P,openGroupItemData:j,setOpenGroupItemData:q,setMoveItemId:h,setMoveTargetId:d,addItem:I}=Z(),{pagingDotBuilder:w,pagingDotsBuilder:S,itemBuilder:u}=V(),B=b.useMemo(()=>o===!1?{}:{top:t.css`
320
320
  display: flex;
321
321
  flex-direction: column;
322
322
  .slick-list {
@@ -359,7 +359,7 @@
359
359
  flex-direction: column;
360
360
  }
361
361
  }
362
- `}[o.position??"bottom"],[o]);return e.jsxs(e.Fragment,{children:[e.jsx(Ie,{useCSS:!0,useTransform:!0,arrows:!1,ref:a??u,infinite:!1,dots:!0,touchMove:!1,lazyLoad:"anticipated",className:t.cx(T,t.css`
362
+ `}[o.position??"bottom"],[o]);return e.jsxs(e.Fragment,{children:[e.jsx(Se,{useCSS:!0,useTransform:!0,arrows:!1,ref:l??g,infinite:!1,dots:!0,touchMove:!1,lazyLoad:"anticipated",className:t.cx(B,t.css`
363
363
  .slick-track {
364
364
  display: flex;
365
365
  align-items: stretch;
@@ -374,7 +374,7 @@
374
374
  width: 100%;
375
375
  }
376
376
  }
377
- `,l),customPaging:I=>{var m,x;return y?y(i[I],I):e.jsx("div",{onDragEnter:()=>{var X;(X=(a??u).current)==null||X.slickGoTo(I)},children:(x=(m=i[I])==null?void 0:m.data)==null?void 0:x.name})},appendDots:I=>L?L(I):o===!1?e.jsx("div",{}):e.jsx("div",{children:e.jsx("ul",{ref:b,className:t.cx("slick-dots-default",t.css`
377
+ `,a),customPaging:T=>{var m,x;return w?w(i[T],T):e.jsx("div",{onDragEnter:()=>{var H;(H=(l??g).current)==null||H.slickGoTo(T)},children:(x=(m=i[T])==null?void 0:m.data)==null?void 0:x.name})},appendDots:T=>S?S(T):o===!1?e.jsx("div",{}):e.jsx("div",{children:e.jsx("ul",{ref:k,className:t.cx("slick-dots-default",t.css`
378
378
  padding: 0.5rem;
379
379
  display: inline-flex;
380
380
  justify-content: center;
@@ -393,7 +393,7 @@
393
393
  width: auto;
394
394
  height: auto;
395
395
  }
396
- `),children:I})}),...r,children:i.map(I=>e.jsx("div",{onDrop:m=>{m.preventDefault();const x=m.dataTransfer.getData("text/plain");if(x!=="")try{M(JSON.parse(x),[I.id])}catch(X){console.log("drag error",X)}},onDragOver:m=>{m.preventDefault()},children:e.jsx(oe.ReactSortable,{className:t.cx(t.css`
396
+ `),children:T})}),...r,children:i.map(T=>e.jsx("div",{onDrop:m=>{m.preventDefault();const x=m.dataTransfer.getData("text/plain");if(x!=="")try{I(JSON.parse(x),[T.id])}catch(H){console.log("drag error",H)}},onDragOver:m=>{m.preventDefault()},children:e.jsx(oe.ReactSortable,{className:t.cx(t.css`
397
397
  display: grid;
398
398
  transition: all 0.3s;
399
399
  grid-template-columns: repeat(auto-fill, 96px);
@@ -402,9 +402,64 @@
402
402
  place-items: center;
403
403
  justify-content: center;
404
404
  align-items: center;
405
- `),animation:150,fallbackOnBody:!0,swapThreshold:.65,group:"nested",list:I.children??[],setList:m=>C(m,[I.id]),filter:".drag-disabled",onMove:m=>{S("onMove");const{dragged:x,related:X}=m,W=x.dataset,F=X.dataset;return c(null),!((Object.keys(F).length===0||F.parentIds)&&Number(W.childrenLength)>0&&X.classList.contains("sortable-group-item"))},onStart:m=>{const x=m.item.dataset;x!=null&&x.id&&g(x.id),S("onMove")},onEnd:()=>{g(null),c(null),S(null)},ghostClass:ke,children:(I.children??[]).map((m,x)=>{let X;if(p)return p(m);switch(m.type){case"group":case"app":X=e.jsx(Fe,{data:m,itemIndex:x,parentIds:[I.id,m.id],onClick:n},m.id);break;default:X=e.jsx(re,{data:m,itemIndex:x,onClick:n},m.id);break}return X})})},I.id))}),e.jsx(Ge,{data:q,onClose:()=>{B(null)}}),e.jsx(He,{data:E,onClose:()=>{A(null)},onItemClick:n})]})},_e=d=>{const{list:o,onChange:l,storageKey:r,enableCaching:a,theme:n,noLetters:u,contextMenu:b,contextMenuBuilder:i,itemBuilder:C,itemIconBuilder:S,pagingDotBuilder:q,pagingDotsBuilder:B,...E}=d,A={list:o,onChange:l,storageKey:r,enableCaching:a},g={theme:n,noLetters:u,contextMenu:b,pagingDotsBuilder:B,pagingDotBuilder:q,itemBuilder:C,itemIconBuilder:S,contextMenuBuilder:i};return e.jsx(Ae,{...A,children:e.jsx(ze,{...g,children:e.jsx(Ye,{...E})})})},Oe={frontmatterEditor:{title:"编辑前置元数据",key:"键",value:"值",addEntry:"添加项目"},dialogControls:{save:"保存",cancel:"取消"},uploadImage:{uploadInstructions:"从您的设备中上传图片:",addViaUrlInstructions:"或从网址新增图片:",autoCompletePlaceholder:"选择或粘贴图片",alt:"替代文本:",title:"标题:"},imageEditor:{editImage:"编辑图片"},createLink:{url:"网址",urlPlaceholder:"选择或粘贴网址",title:"标题",saveTooltip:"设置网址",cancelTooltip:"取消更改"},linkPreview:{open:"在新窗口中打开 {{url}}",edit:"编辑链接网址",copyToClipboard:"复制到剪贴板",copied:"已复制!",remove:"移除链接"},table:{deleteTable:"删除表格",columnMenu:"列菜单",textAlignment:"文字对齐",alignLeft:"左对齐",alignCenter:"居中对齐",alignRight:"右对齐",insertColumnLeft:"在当前列左侧插入一列",insertColumnRight:"在当前列右侧插入一列",deleteColumn:"删除此列",rowMenu:"行菜单",insertRowAbove:"在当前行上方插入一行",insertRowBelow:"在当前行下方插入一行",deleteRow:"删除此行"},toolbar:{blockTypes:{paragraph:"段落",quote:"引用",heading:"标题 {{level}}"},blockTypeSelect:{selectBlockTypeTooltip:"选择块类型",placeholder:"块类型"},toggleGroup:"切换组",removeBold:"移除粗体",bold:"粗体",removeItalic:"移除斜体",italic:"斜体",underline:"移除下划线",removeUnderline:"下划线",removeInlineCode:"移除内联代码样式",inlineCode:"内联代码样式",link:"创建链接",richText:"富文本",diffMode:"差异模式",source:"源码模式",admonition:"插入注释区块",codeBlock:"插入代码块",editFrontmatter:"编辑前置元数据",insertFrontmatter:"插入前置元数据",image:"插入图片",insertSandpack:"插入 Sandpack",table:"插入表格",thematicBreak:"插入主题换行",bulletedList:"无序列表",numberedList:"有序列表",checkList:"任务列表",deleteSandpack:"删除 Sandpack",undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",superscript:"上标",subscript:"下标",strikethrough:"删除线",removeSubscript:"移除下标",removeSuperscript:"移除上标",removeStrikethrough:"移除删除线"},admonitions:{note:"注意",tip:"提示",danger:"危险",info:"信息",caution:"警告",changeType:"选择注释区块类型",placeholder:"注释区块类型"},codeBlock:{language:"代码块语言",selectLanguage:"选择代码块语言",inlineLanguage:"代码块语言"},codeblock:{delete:"删除代码块"},contentArea:{editableMarkdown:"可编辑的 Markdown"},image:{delete:"删除图片"}},Ve=(d,o,l)=>{const a=d.split(".").reduce((n,u)=>typeof n=="string"?n:n[u],Oe);return typeof a!="string"?o:l?a.replace(/{{(.*?)}}/g,(n,u)=>l[u]):a},Ue=t.css`
405
+ `),animation:150,fallbackOnBody:!0,swapThreshold:.65,group:"nested",list:T.children??[],setList:m=>C(m,[T.id]),filter:".drag-disabled",onMove:m=>{M("onMove");const{dragged:x,related:H}=m,W=x.dataset,F=H.dataset;return d(null),!((Object.keys(F).length===0||F.parentIds)&&Number(W.childrenLength)>0&&H.classList.contains("sortable-group-item"))},onStart:m=>{const x=m.item.dataset;x!=null&&x.id&&h(x.id),M("onMove")},onEnd:()=>{h(null),d(null),M(null)},ghostClass:fe,children:(T.children??[]).map((m,x)=>{let H;if(u)return u(m);switch(m.type){case"group":case"app":H=e.jsx(Fe,{data:m,itemIndex:x,parentIds:[T.id,m.id],onClick:n},m.id);break;default:H=e.jsx(re,{data:m,itemIndex:x,onClick:n},m.id);break}return H})})},T.id))}),e.jsx(Ge,{data:A,onClose:()=>{P(null)}}),e.jsx(Xe,{data:j,onClose:()=>{q(null)},onItemClick:n})]})},Oe=c=>{const{list:o,onChange:a,storageKey:r,enableCaching:l,theme:n,noLetters:g,contextMenu:k,contextMenuBuilder:i,itemBuilder:C,itemIconBuilder:M,pagingDotBuilder:A,pagingDotsBuilder:P,...j}=c,q={list:o,onChange:a,storageKey:r,enableCaching:l},h={theme:n,noLetters:g,contextMenu:k,pagingDotsBuilder:P,pagingDotBuilder:A,itemBuilder:C,itemIconBuilder:M,contextMenuBuilder:i};return e.jsx(qe,{...q,children:e.jsx(ze,{...h,children:e.jsx(Ye,{...j})})})},_e={frontmatterEditor:{title:"编辑前置元数据",key:"键",value:"值",addEntry:"添加项目"},dialogControls:{save:"保存",cancel:"取消"},uploadImage:{uploadInstructions:"从您的设备中上传图片:",addViaUrlInstructions:"或从网址新增图片:",autoCompletePlaceholder:"选择或粘贴图片",alt:"替代文本:",title:"标题:"},imageEditor:{editImage:"编辑图片"},createLink:{url:"网址",urlPlaceholder:"选择或粘贴网址",title:"标题",saveTooltip:"设置网址",cancelTooltip:"取消更改"},linkPreview:{open:"在新窗口中打开 {{url}}",edit:"编辑链接网址",copyToClipboard:"复制到剪贴板",copied:"已复制!",remove:"移除链接"},table:{deleteTable:"删除表格",columnMenu:"列菜单",textAlignment:"文字对齐",alignLeft:"左对齐",alignCenter:"居中对齐",alignRight:"右对齐",insertColumnLeft:"在当前列左侧插入一列",insertColumnRight:"在当前列右侧插入一列",deleteColumn:"删除此列",rowMenu:"行菜单",insertRowAbove:"在当前行上方插入一行",insertRowBelow:"在当前行下方插入一行",deleteRow:"删除此行"},toolbar:{blockTypes:{paragraph:"段落",quote:"引用",heading:"标题 {{level}}"},blockTypeSelect:{selectBlockTypeTooltip:"选择块类型",placeholder:"块类型"},toggleGroup:"切换组",removeBold:"移除粗体",bold:"粗体",removeItalic:"移除斜体",italic:"斜体",underline:"移除下划线",removeUnderline:"下划线",removeInlineCode:"移除内联代码样式",inlineCode:"内联代码样式",link:"创建链接",richText:"富文本",diffMode:"差异模式",source:"源码模式",admonition:"插入注释区块",codeBlock:"插入代码块",editFrontmatter:"编辑前置元数据",insertFrontmatter:"插入前置元数据",image:"插入图片",insertSandpack:"插入 Sandpack",table:"插入表格",thematicBreak:"插入主题换行",bulletedList:"无序列表",numberedList:"有序列表",checkList:"任务列表",deleteSandpack:"删除 Sandpack",undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",superscript:"上标",subscript:"下标",strikethrough:"删除线",removeSubscript:"移除下标",removeSuperscript:"移除上标",removeStrikethrough:"移除删除线"},admonitions:{note:"注意",tip:"提示",danger:"危险",info:"信息",caution:"警告",changeType:"选择注释区块类型",placeholder:"注释区块类型"},codeBlock:{language:"代码块语言",selectLanguage:"选择代码块语言",inlineLanguage:"代码块语言"},codeblock:{delete:"删除代码块"},contentArea:{editableMarkdown:"可编辑的 Markdown"},image:{delete:"删除图片"}},Ue=(c,o,a)=>{const l=c.split(".").reduce((n,g)=>typeof n=="string"?n:n[g],_e);return typeof l!="string"?o:a?l.replace(/{{(.*?)}}/g,(n,g)=>a[g]):l},Ve=t.css`
406
+ --accentBase: var(--tomato-1);
407
+ --accentBgSubtle: var(--tomato-2);
408
+ --accentBg: var(--tomato-3);
409
+ --accentBgHover: var(--tomato-4);
410
+ --accentBgActive: var(--tomato-5);
411
+ --accentLine: var(--tomato-6);
412
+ --accentBorder: var(--tomato-7);
413
+ --accentBorderHover: var(--tomato-8);
414
+ --accentSolid: var(--tomato-9);
415
+ --accentSolidHover: var(--tomato-10);
416
+ --accentText: var(--tomato-11);
417
+ --accentTextContrast: var(--tomato-12);
418
+
419
+ --baseBase: var(--mauve-1);
420
+ --baseBgSubtle: var(--mauve-2);
421
+ --baseBg: var(--mauve-3);
422
+ --baseBgHover: var(--mauve-4);
423
+ --baseBgActive: var(--mauve-5);
424
+ --baseLine: var(--mauve-6);
425
+ --baseBorder: var(--mauve-7);
426
+ --baseBorderHover: var(--mauve-8);
427
+ --baseSolid: var(--mauve-9);
428
+ --baseSolidHover: var(--mauve-10);
429
+ --baseText: var(--mauve-11);
430
+ --baseTextContrast: var(--mauve-12);
431
+
432
+ --admonitionTipBg: var(--cyan-4);
433
+ --admonitionTipBorder: var(--cyan-8);
434
+
435
+ --admonitionInfoBg: var(--grass-4);
436
+ --admonitionInfoBorder: var(--grass-8);
437
+
438
+ --admonitionCautionBg: var(--amber-4);
439
+ --admonitionCautionBorder: var(--amber-8);
440
+
441
+ --admonitionDangerBg: var(--red-4);
442
+ --admonitionDangerBorder: var(--red-8);
443
+
444
+ --admonitionNoteBg: var(--mauve-4);
445
+ --admonitionNoteBorder: var(--mauve-8);
446
+
447
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
448
+ Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
449
+ --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
450
+ "Liberation Mono", "Courier New", monospace;
451
+
452
+ color: var(--baseText);
453
+ --basePageBg: #000000;
454
+ background-color: var(--basePageBg);
455
+ background-image: linear-gradient(
456
+ rgba(255, 255, 255, 0.05),
457
+ rgba(255, 255, 255, 0.05)
458
+ );
459
+ `,We=t.css`
406
460
  [class*="_toolbarRoot"] {
407
461
  flex-wrap: wrap;
462
+ transition: all 0.3s;
408
463
  }
409
464
  [class*="_codeMirrorWrapper"] {
410
465
  padding: 0;
@@ -471,7 +526,7 @@
471
526
  margin-bottom: 0;
472
527
  }
473
528
  }
474
- `,fe=t.cx("markdown-body",t.css`
529
+ `,be=t.cx("markdown-body",t.css`
475
530
  p {
476
531
  margin-bottom: 8px;
477
532
  }
@@ -491,4 +546,110 @@
491
546
  margin: 0 !important;
492
547
  }
493
548
  }
494
- `),We={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}},Je=d=>{const{children:o="",className:l}=d;return e.jsx(Me,{className:t.cx(fe,l),remarkPlugins:[Ne,De],rehypePlugins:[Be],components:{code(r){const{children:a,className:n,node:u,ref:b,...i}=r,C=/language-(\w+)/.exec(n||"");return C?e.jsx(Pe.Prism,{...i,PreTag:"div",children:String(a).replace(/\n$/,""),language:C[1],style:We}):e.jsx("code",{...i,className:n,children:a})}},children:o})},be=d=>{const{value:o,onChange:l,translation:r,pluginConfig:a,...n}=d,u=f.useRef(null),{image:b,diffSource:i={viewMode:"rich-text"},headings:C,link:S,codeBlock:q,codeMirror:B={codeBlockLanguages:{js:"JavaScript",css:"CSS",txt:"Plain Text",tsx:"TypeScript","":"Unspecified"}},directives:E={directiveDescriptors:[h.AdmonitionDirectiveDescriptor]}}=a??{},[A,g]=f.useState("");return f.useEffect(()=>{var c;o!==void 0&&u.current&&((c=u.current)==null||c.setMarkdown(o),g(o))},[o,u]),e.jsx(h.MDXEditor,{ref:u,className:Ue,contentEditableClassName:fe,markdown:A,onChange:c=>{!o&&!l&&g(c),l&&l(c)},translation:r??Ve,plugins:[h.toolbarPlugin({toolbarContents:()=>e.jsxs(h.DiffSourceToggleWrapper,{options:["rich-text","source"],children:[e.jsx(h.UndoRedo,{}),e.jsx(h.Separator,{}),e.jsx(h.BoldItalicUnderlineToggles,{}),e.jsx(h.CodeToggle,{}),e.jsx(h.Separator,{}),e.jsx(h.StrikeThroughSupSubToggles,{}),e.jsx(h.Separator,{}),e.jsx(h.ListsToggle,{}),e.jsx(h.Separator,{}),e.jsx(h.CreateLink,{}),e.jsx(h.InsertImage,{}),e.jsx(h.Separator,{}),e.jsx(h.InsertTable,{}),e.jsx(h.InsertThematicBreak,{}),e.jsx(h.Separator,{}),e.jsx(h.InsertCodeBlock,{}),e.jsx(h.Separator,{}),e.jsx(h.InsertFrontmatter,{})]})}),h.diffSourcePlugin(i),h.listsPlugin(),h.quotePlugin(),h.headingsPlugin(C),h.linkPlugin(S),h.linkDialogPlugin(),h.imagePlugin(b),h.tablePlugin(),h.thematicBreakPlugin(),h.frontmatterPlugin(),h.codeBlockPlugin(q),h.codeMirrorPlugin(B),h.markdownShortcutPlugin(),h.directivesPlugin(E)],...n})};be.Preview=Je;function xe(...d){return Le.twMerge($e.clsx(d))}const Ke=d=>{const{mouseX:o,title:l,icon:r,href:a}=d,n=f.useRef(null),u=s.useTransform(o,M=>{var L;const y=((L=n.current)==null?void 0:L.getBoundingClientRect())??{x:0,width:0};return M-y.x-y.width/2}),b=s.useTransform(u,[-150,0,150],[40,80,40]),i=s.useTransform(u,[-150,0,150],[40,80,40]),C=s.useTransform(u,[-150,0,150],[20,40,20]),S=s.useTransform(u,[-150,0,150],[20,40,20]),q=s.useSpring(b,{mass:.1,stiffness:150,damping:12}),B=s.useSpring(i,{mass:.1,stiffness:150,damping:12}),E=s.useSpring(C,{mass:.1,stiffness:150,damping:12}),A=s.useSpring(S,{mass:.1,stiffness:150,damping:12}),[g,c]=f.useState(!1);return e.jsx("a",{href:a,children:e.jsxs(s.motion.div,{ref:n,style:{width:q,height:B},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),className:"aspect-square rounded-full bg-gray-200 dark:bg-neutral-800 flex items-center justify-center relative",children:[e.jsx(s.AnimatePresence,{children:g&&e.jsx(s.motion.div,{initial:{opacity:0,y:10,x:"-50%"},animate:{opacity:1,y:0,x:"-50%"},exit:{opacity:0,y:2,x:"-50%"},className:"px-2 py-0.5 whitespace-pre rounded-md bg-gray-100 border dark:bg-neutral-800 dark:border-neutral-900 dark:text-white border-gray-200 text-neutral-700 absolute left-1/2 -translate-x-1/2 -top-8 w-fit text-xs",children:l})}),e.jsx(s.motion.div,{style:{width:E,height:A},className:"flex items-center justify-center",children:r})]})})},ve=d=>{const{items:o,className:l}=d,r=s.useMotionValue(1/0);return e.jsx(s.motion.div,{onMouseMove:a=>r.set(a.pageX),onMouseLeave:()=>r.set(1/0),className:xe("mx-auto hidden md:flex h-16 gap-4 items-end rounded-2xl bg-gray-50 dark:bg-neutral-900 px-4 pb-3",l),children:o.map(a=>e.jsx(Ke,{mouseX:r,...a},a.title))})},we=d=>{const{items:o,className:l,collapseIcon:r,autoHidden:a=!1}=d,[n,u]=f.useState(!1),b=()=>{u(!n)};return e.jsxs("div",{className:xe("relative block",a?"md:hidden":"",l),children:[e.jsx(s.AnimatePresence,{children:n&&e.jsx(s.motion.div,{layoutId:"nav",className:"absolute bottom-full mb-2 inset-x-0 flex flex-col gap-2",children:o.map((i,C)=>e.jsx(s.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10,transition:{delay:C*.05}},transition:{delay:(o.length-1-C)*.05},children:e.jsx("a",{href:i.href,className:"h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-900 flex items-center justify-center",children:e.jsx("div",{className:"h-4 w-4",children:i.icon})},i.title)},i.title))})}),e.jsx("button",{onClick:b,className:"h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-800 flex items-center justify-center",children:r||e.jsx(Q.RiMoreLine,{className:"h-5 w-5 text-neutral-500 dark:text-neutral-400"})})]})},ne=d=>{const{items:o,desktopClassName:l,mobileClassName:r,...a}=d;return e.jsxs(e.Fragment,{children:[e.jsx(ve,{items:o,className:l,...a}),e.jsx(we,{items:o,className:r,autoHidden:!0,...a})]})};ne.Desktop=ve,ne.Mobile=we,k.Desktop=_e,k.Dock=ne,k.MdEditor=be,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
549
+ `),Je=t.css`
550
+ /* light */
551
+ color-scheme: light;
552
+ --focus-outlineColor: #0969da;
553
+ --fgColor-default: #1f2328;
554
+ --fgColor-muted: #59636e;
555
+ --fgColor-accent: #0969da;
556
+ --fgColor-success: #1a7f37;
557
+ --fgColor-attention: #9a6700;
558
+ --fgColor-danger: #d1242f;
559
+ --fgColor-done: #8250df;
560
+ --bgColor-default: #ffffff;
561
+ --bgColor-muted: #f6f8fa;
562
+ --bgColor-neutral-muted: #818b981f;
563
+ --bgColor-attention-muted: #fff8c5;
564
+ --borderColor-default: #d1d9e0;
565
+ --borderColor-muted: #d1d9e0b3;
566
+ --borderColor-neutral-muted: #d1d9e0b3;
567
+ --borderColor-accent-emphasis: #0969da;
568
+ --borderColor-success-emphasis: #1a7f37;
569
+ --borderColor-attention-emphasis: #9a6700;
570
+ --borderColor-danger-emphasis: #cf222e;
571
+ --borderColor-done-emphasis: #8250df;
572
+ --color-prettylights-syntax-comment: #59636e;
573
+ --color-prettylights-syntax-constant: #0550ae;
574
+ --color-prettylights-syntax-constant-other-reference-link: #0a3069;
575
+ --color-prettylights-syntax-entity: #6639ba;
576
+ --color-prettylights-syntax-storage-modifier-import: #1f2328;
577
+ --color-prettylights-syntax-entity-tag: #0550ae;
578
+ --color-prettylights-syntax-keyword: #cf222e;
579
+ --color-prettylights-syntax-string: #0a3069;
580
+ --color-prettylights-syntax-variable: #953800;
581
+ --color-prettylights-syntax-brackethighlighter-unmatched: #82071e;
582
+ --color-prettylights-syntax-brackethighlighter-angle: #59636e;
583
+ --color-prettylights-syntax-invalid-illegal-text: #f6f8fa;
584
+ --color-prettylights-syntax-invalid-illegal-bg: #82071e;
585
+ --color-prettylights-syntax-carriage-return-text: #f6f8fa;
586
+ --color-prettylights-syntax-carriage-return-bg: #cf222e;
587
+ --color-prettylights-syntax-string-regexp: #116329;
588
+ --color-prettylights-syntax-markup-list: #3b2300;
589
+ --color-prettylights-syntax-markup-heading: #0550ae;
590
+ --color-prettylights-syntax-markup-italic: #1f2328;
591
+ --color-prettylights-syntax-markup-bold: #1f2328;
592
+ --color-prettylights-syntax-markup-deleted-text: #82071e;
593
+ --color-prettylights-syntax-markup-deleted-bg: #ffebe9;
594
+ --color-prettylights-syntax-markup-inserted-text: #116329;
595
+ --color-prettylights-syntax-markup-inserted-bg: #dafbe1;
596
+ --color-prettylights-syntax-markup-changed-text: #953800;
597
+ --color-prettylights-syntax-markup-changed-bg: #ffd8b5;
598
+ --color-prettylights-syntax-markup-ignored-text: #d1d9e0;
599
+ --color-prettylights-syntax-markup-ignored-bg: #0550ae;
600
+ --color-prettylights-syntax-meta-diff-range: #8250df;
601
+ --color-prettylights-syntax-sublimelinter-gutter-mark: #818b98;
602
+ `,Ke=t.css`
603
+ /* dark */
604
+ color-scheme: dark;
605
+ --focus-outlineColor: #1f6feb;
606
+ --fgColor-default: #f0f6fc;
607
+ --fgColor-muted: #9198a1;
608
+ --fgColor-accent: #4493f8;
609
+ --fgColor-success: #3fb950;
610
+ --fgColor-attention: #d29922;
611
+ --fgColor-danger: #f85149;
612
+ --fgColor-done: #ab7df8;
613
+ --bgColor-default: #0d1117;
614
+ --bgColor-muted: #151b23;
615
+ --bgColor-neutral-muted: #656c7633;
616
+ --bgColor-attention-muted: #bb800926;
617
+ --borderColor-default: #3d444d;
618
+ --borderColor-muted: #3d444db3;
619
+ --borderColor-neutral-muted: #3d444db3;
620
+ --borderColor-accent-emphasis: #1f6feb;
621
+ --borderColor-success-emphasis: #238636;
622
+ --borderColor-attention-emphasis: #9e6a03;
623
+ --borderColor-danger-emphasis: #da3633;
624
+ --borderColor-done-emphasis: #8957e5;
625
+ --color-prettylights-syntax-comment: #9198a1;
626
+ --color-prettylights-syntax-constant: #79c0ff;
627
+ --color-prettylights-syntax-constant-other-reference-link: #a5d6ff;
628
+ --color-prettylights-syntax-entity: #d2a8ff;
629
+ --color-prettylights-syntax-storage-modifier-import: #f0f6fc;
630
+ --color-prettylights-syntax-entity-tag: #7ee787;
631
+ --color-prettylights-syntax-keyword: #ff7b72;
632
+ --color-prettylights-syntax-string: #a5d6ff;
633
+ --color-prettylights-syntax-variable: #ffa657;
634
+ --color-prettylights-syntax-brackethighlighter-unmatched: #f85149;
635
+ --color-prettylights-syntax-brackethighlighter-angle: #9198a1;
636
+ --color-prettylights-syntax-invalid-illegal-text: #f0f6fc;
637
+ --color-prettylights-syntax-invalid-illegal-bg: #8e1519;
638
+ --color-prettylights-syntax-carriage-return-text: #f0f6fc;
639
+ --color-prettylights-syntax-carriage-return-bg: #b62324;
640
+ --color-prettylights-syntax-string-regexp: #7ee787;
641
+ --color-prettylights-syntax-markup-list: #f2cc60;
642
+ --color-prettylights-syntax-markup-heading: #1f6feb;
643
+ --color-prettylights-syntax-markup-italic: #f0f6fc;
644
+ --color-prettylights-syntax-markup-bold: #f0f6fc;
645
+ --color-prettylights-syntax-markup-deleted-text: #ffdcd7;
646
+ --color-prettylights-syntax-markup-deleted-bg: #67060c;
647
+ --color-prettylights-syntax-markup-inserted-text: #aff5b4;
648
+ --color-prettylights-syntax-markup-inserted-bg: #033a16;
649
+ --color-prettylights-syntax-markup-changed-text: #ffdfb6;
650
+ --color-prettylights-syntax-markup-changed-bg: #5a1e02;
651
+ --color-prettylights-syntax-markup-ignored-text: #f0f6fc;
652
+ --color-prettylights-syntax-markup-ignored-bg: #1158c7;
653
+ --color-prettylights-syntax-meta-diff-range: #d2a8ff;
654
+ --color-prettylights-syntax-sublimelinter-gutter-mark: #3d444d;
655
+ `,Ze={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}},Qe=c=>{const{children:o="",className:a}=c;return e.jsx(Me,{className:t.cx(be,a),remarkPlugins:[Be,Ne],rehypePlugins:[De],components:{code(r){const{children:l,className:n,node:g,ref:k,...i}=r,C=/language-(\w+)/.exec(n||"");return C?e.jsx(Pe.Prism,{...i,PreTag:"div",children:String(l).replace(/\n$/,""),language:C[1],style:Ze}):e.jsx("code",{...i,className:n,children:l})}},children:o})},ke=c=>{const{value:o,onChange:a,translation:r,pluginConfig:l,className:n,theme:g="auto",...k}=c,i=b.useRef(null),{image:C,diffSource:M={viewMode:"rich-text"},headings:A,link:P,codeBlock:j,codeMirror:q={codeBlockLanguages:{js:"JavaScript",css:"CSS",txt:"Plain Text",tsx:"TypeScript","":"Unspecified"}},directives:h={directiveDescriptors:[p.AdmonitionDirectiveDescriptor]}}=l??{},[d,I]=b.useState("");b.useEffect(()=>{var S;o!==void 0&&i.current&&((S=i.current)==null||S.setMarkdown(o),I(o))},[o,i]);const w=()=>{var S,u;return g==="dark"?!0:g==="light"?!1:(S=document.documentElement.getAttribute("style"))!=null&&S.includes("color-scheme: dark;")?!0:(u=document.documentElement.getAttribute("style"))!=null&&u.includes("color-scheme: light;")?!1:window.matchMedia("(prefers-color-scheme: dark)").matches};return e.jsx(p.MDXEditor,{ref:i,className:t.cx(We,w()?Ve:"",w()?Ke:Je,n),contentEditableClassName:be,markdown:d,onChange:S=>{!o&&!a&&I(S),a&&a(S)},translation:r??Ue,plugins:[p.toolbarPlugin({toolbarContents:()=>e.jsxs(p.DiffSourceToggleWrapper,{options:["rich-text","source"],children:[e.jsx(p.UndoRedo,{}),e.jsx(p.Separator,{}),e.jsx(p.BoldItalicUnderlineToggles,{}),e.jsx(p.CodeToggle,{}),e.jsx(p.Separator,{}),e.jsx(p.StrikeThroughSupSubToggles,{}),e.jsx(p.Separator,{}),e.jsx(p.ListsToggle,{}),e.jsx(p.Separator,{}),e.jsx(p.CreateLink,{}),e.jsx(p.InsertImage,{}),e.jsx(p.Separator,{}),e.jsx(p.InsertTable,{}),e.jsx(p.InsertThematicBreak,{}),e.jsx(p.Separator,{}),e.jsx(p.InsertCodeBlock,{}),e.jsx(p.Separator,{}),e.jsx(p.InsertFrontmatter,{})]})}),p.diffSourcePlugin(M),p.listsPlugin(),p.quotePlugin(),p.headingsPlugin(A),p.linkPlugin(P),p.linkDialogPlugin(),p.imagePlugin(C),p.tablePlugin(),p.thematicBreakPlugin(),p.frontmatterPlugin(),p.codeBlockPlugin(j),p.codeMirrorPlugin(q),p.markdownShortcutPlugin(),p.directivesPlugin(h)],...k})};ke.Preview=Qe;function xe(...c){return Le.twMerge($e.clsx(c))}const Re=c=>{const{mouseX:o,title:a,icon:r,href:l}=c,n=b.useRef(null),g=s.useTransform(o,I=>{var S;const w=((S=n.current)==null?void 0:S.getBoundingClientRect())??{x:0,width:0};return I-w.x-w.width/2}),k=s.useTransform(g,[-150,0,150],[40,80,40]),i=s.useTransform(g,[-150,0,150],[40,80,40]),C=s.useTransform(g,[-150,0,150],[20,40,20]),M=s.useTransform(g,[-150,0,150],[20,40,20]),A=s.useSpring(k,{mass:.1,stiffness:150,damping:12}),P=s.useSpring(i,{mass:.1,stiffness:150,damping:12}),j=s.useSpring(C,{mass:.1,stiffness:150,damping:12}),q=s.useSpring(M,{mass:.1,stiffness:150,damping:12}),[h,d]=b.useState(!1);return e.jsx("a",{href:l,children:e.jsxs(s.motion.div,{ref:n,style:{width:A,height:P},onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),className:"aspect-square rounded-full bg-gray-200 dark:bg-neutral-800 flex items-center justify-center relative",children:[e.jsx(s.AnimatePresence,{children:h&&e.jsx(s.motion.div,{initial:{opacity:0,y:10,x:"-50%"},animate:{opacity:1,y:0,x:"-50%"},exit:{opacity:0,y:2,x:"-50%"},className:"px-2 py-0.5 whitespace-pre rounded-md bg-gray-100 border dark:bg-neutral-800 dark:border-neutral-900 dark:text-white border-gray-200 text-neutral-700 absolute left-1/2 -translate-x-1/2 -top-8 w-fit text-xs",children:a})}),e.jsx(s.motion.div,{style:{width:j,height:q},className:"flex items-center justify-center",children:r})]})})},ye=c=>{const{items:o,className:a}=c,r=s.useMotionValue(1/0);return e.jsx(s.motion.div,{onMouseMove:l=>r.set(l.pageX),onMouseLeave:()=>r.set(1/0),className:xe("mx-auto hidden md:flex h-16 gap-4 items-end rounded-2xl bg-gray-50 dark:bg-neutral-900 px-4 pb-3",a),children:o.map(l=>e.jsx(Re,{mouseX:r,...l},l.title))})},ve=c=>{const{items:o,className:a,collapseIcon:r,autoHidden:l=!1}=c,[n,g]=b.useState(!1),k=()=>{g(!n)};return e.jsxs("div",{className:xe("relative block",l?"md:hidden":"",a),children:[e.jsx(s.AnimatePresence,{children:n&&e.jsx(s.motion.div,{layoutId:"nav",className:"absolute bottom-full mb-2 inset-x-0 flex flex-col gap-2",children:o.map((i,C)=>e.jsx(s.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10,transition:{delay:C*.05}},transition:{delay:(o.length-1-C)*.05},children:e.jsx("a",{href:i.href,className:"h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-900 flex items-center justify-center",children:e.jsx("div",{className:"h-4 w-4",children:i.icon})},i.title)},i.title))})}),e.jsx("button",{onClick:k,className:"h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-800 flex items-center justify-center",children:r||e.jsx(Q.RiMoreLine,{className:"h-5 w-5 text-neutral-500 dark:text-neutral-400"})})]})},ne=c=>{const{items:o,desktopClassName:a,mobileClassName:r,...l}=c;return e.jsxs(e.Fragment,{children:[e.jsx(ye,{items:o,className:a,...l}),e.jsx(ve,{items:o,className:r,autoHidden:!0,...l})]})};ne.Desktop=ye,ne.Mobile=ve,f.Desktop=Oe,f.Dock=ne,f.MdEditor=ke,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});