@aiquants/directory-tree 3.5.0 → 3.5.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"entryRendering.d.ts","sourceRoot":"","sources":["../src/entryRendering.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,0BAA0B,EAAE,8BAA8B,EAA6B,MAAM,YAAY,CAAA;AAEvH,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,KAAK,CAAA;AACrC,2FAA2F;AAC3F,eAAO,MAAM,WAAW,KAAK,CAAA;AAC7B,yDAAyD;AACzD,eAAO,MAAM,iBAAiB,KAAK,CAAA;AAEnC;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;CA8BhC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,UAAU,MAAM,KAAG,MAMnD,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC3B,WAAW,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;IACnB,eAAe,EAAE,OAAO,CAAA;IACxB,oBAAoB,EAAE,OAAO,CAAA;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,oFAAoF,gBAAgB,KAAG,SAQxI,CAAA;AA8BD;;;GAGG;AACH,eAAO,MAAM,4BAA4B,GAAI,WAAW,MAAM,EAAE,YAAY,MAAM,EAAE,WAAW,MAAM,KAAG,SA4GvG,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,KAAK,8BAA8B,EAAE,YAAY,0BAA0B,KAAG,SAa9G,CAAA;AAYD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAS5G,CAAA"}
1
+ {"version":3,"file":"entryRendering.d.ts","sourceRoot":"","sources":["../src/entryRendering.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,0BAA0B,EAAE,8BAA8B,EAA6B,MAAM,YAAY,CAAA;AAEvH,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,KAAK,CAAA;AACrC,2FAA2F;AAC3F,eAAO,MAAM,WAAW,KAAK,CAAA;AAC7B,yDAAyD;AACzD,eAAO,MAAM,iBAAiB,KAAK,CAAA;AAEnC;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;CA8BhC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,UAAU,MAAM,KAAG,MAMnD,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC3B,WAAW,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;IACnB,eAAe,EAAE,OAAO,CAAA;IACxB,oBAAoB,EAAE,OAAO,CAAA;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,oFAAoF,gBAAgB,KAAG,SAQxI,CAAA;AA8BD;;;GAGG;AACH,eAAO,MAAM,4BAA4B,GAAI,WAAW,MAAM,EAAE,YAAY,MAAM,EAAE,WAAW,MAAM,KAAG,SA4GvG,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,KAAK,8BAA8B,EAAE,YAAY,0BAA0B,KAAG,SAa9G,CAAA;AAmBD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAW5G,CAAA"}
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),bt=require("@aiquants/virtualscroll"),_=require("tailwind-merge"),Ge=require("@heroicons/react/24/solid"),A=require("@phosphor-icons/react");var _e={exports:{}},Se={};var gt;function Yt(){if(gt)return Se;gt=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(n,r,o){var l=null;if(o!==void 0&&(l=""+o),r.key!==void 0&&(l=""+r.key),"key"in r){o={};for(var f in r)f!=="key"&&(o[f]=r[f])}else o=r;return r=o.ref,{$$typeof:e,type:n,key:l,ref:r!==void 0?r:null,props:o}}return Se.Fragment=t,Se.jsx=a,Se.jsxs=a,Se}var Ee={};var vt;function Gt(){return vt||(vt=1,process.env.NODE_ENV!=="production"&&(function(){function e(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===K?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case p:return"Fragment";case O:return"Profiler";case g:return"StrictMode";case D:return"Suspense";case L:return"SuspenseList";case Z:return"Activity"}if(typeof s=="object")switch(typeof s.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),s.$$typeof){case h:return"Portal";case v:return s.displayName||"Context";case E:return(s._context.displayName||"Context")+".Consumer";case y:var m=s.render;return s=s.displayName,s||(s=m.displayName||m.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case $:return m=s.displayName||null,m!==null?m:e(s.type)||"Memo";case j:m=s._payload,s=s._init;try{return e(s(m))}catch{}}return null}function t(s){return""+s}function a(s){try{t(s);var m=!1}catch{m=!0}if(m){m=console;var k=m.error,I=typeof Symbol=="function"&&Symbol.toStringTag&&s[Symbol.toStringTag]||s.constructor.name||"Object";return k.call(m,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",I),t(s)}}function n(s){if(s===p)return"<>";if(typeof s=="object"&&s!==null&&s.$$typeof===j)return"<...>";try{var m=e(s);return m?"<"+m+">":"<...>"}catch{return"<...>"}}function r(){var s=M.A;return s===null?null:s.getOwner()}function o(){return Error("react-stack-top-frame")}function l(s){if(Y.call(s,"key")){var m=Object.getOwnPropertyDescriptor(s,"key").get;if(m&&m.isReactWarning)return!1}return s.key!==void 0}function f(s,m){function k(){te||(te=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",m))}k.isReactWarning=!0,Object.defineProperty(s,"key",{get:k,configurable:!0})}function C(){var s=e(this.type);return re[s]||(re[s]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),s=this.props.ref,s!==void 0?s:null}function b(s,m,k,I,z,oe){var T=k.ref;return s={$$typeof:N,type:s,key:m,props:k,_owner:I},(T!==void 0?T:null)!==null?Object.defineProperty(s,"ref",{enumerable:!1,get:C}):Object.defineProperty(s,"ref",{enumerable:!1,value:null}),s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(s,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(s,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:z}),Object.defineProperty(s,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:oe}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s}function u(s,m,k,I,z,oe){var T=m.children;if(T!==void 0)if(I)if(H(T)){for(I=0;I<T.length;I++)x(T[I]);Object.freeze&&Object.freeze(T)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else x(T);if(Y.call(m,"key")){T=e(s);var U=Object.keys(m).filter(function(le){return le!=="key"});I=0<U.length?"{key: someKey, "+U.join(": ..., ")+": ...}":"{key: someKey}",V[T+I]||(U=0<U.length?"{"+U.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),bt=require("@aiquants/virtualscroll"),_=require("tailwind-merge"),Ge=require("@heroicons/react/24/solid"),A=require("@phosphor-icons/react");var _e={exports:{}},Se={};var gt;function Yt(){if(gt)return Se;gt=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(n,r,o){var l=null;if(o!==void 0&&(l=""+o),r.key!==void 0&&(l=""+r.key),"key"in r){o={};for(var f in r)f!=="key"&&(o[f]=r[f])}else o=r;return r=o.ref,{$$typeof:e,type:n,key:l,ref:r!==void 0?r:null,props:o}}return Se.Fragment=t,Se.jsx=a,Se.jsxs=a,Se}var Ee={};var vt;function Gt(){return vt||(vt=1,process.env.NODE_ENV!=="production"&&(function(){function e(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===K?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case p:return"Fragment";case O:return"Profiler";case g:return"StrictMode";case D:return"Suspense";case L:return"SuspenseList";case Z:return"Activity"}if(typeof s=="object")switch(typeof s.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),s.$$typeof){case h:return"Portal";case v:return s.displayName||"Context";case E:return(s._context.displayName||"Context")+".Consumer";case y:var m=s.render;return s=s.displayName,s||(s=m.displayName||m.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case $:return m=s.displayName||null,m!==null?m:e(s.type)||"Memo";case j:m=s._payload,s=s._init;try{return e(s(m))}catch{}}return null}function t(s){return""+s}function a(s){try{t(s);var m=!1}catch{m=!0}if(m){m=console;var k=m.error,I=typeof Symbol=="function"&&Symbol.toStringTag&&s[Symbol.toStringTag]||s.constructor.name||"Object";return k.call(m,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",I),t(s)}}function n(s){if(s===p)return"<>";if(typeof s=="object"&&s!==null&&s.$$typeof===j)return"<...>";try{var m=e(s);return m?"<"+m+">":"<...>"}catch{return"<...>"}}function r(){var s=M.A;return s===null?null:s.getOwner()}function o(){return Error("react-stack-top-frame")}function l(s){if(Y.call(s,"key")){var m=Object.getOwnPropertyDescriptor(s,"key").get;if(m&&m.isReactWarning)return!1}return s.key!==void 0}function f(s,m){function k(){te||(te=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",m))}k.isReactWarning=!0,Object.defineProperty(s,"key",{get:k,configurable:!0})}function C(){var s=e(this.type);return re[s]||(re[s]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),s=this.props.ref,s!==void 0?s:null}function b(s,m,k,I,z,oe){var T=k.ref;return s={$$typeof:N,type:s,key:m,props:k,_owner:I},(T!==void 0?T:null)!==null?Object.defineProperty(s,"ref",{enumerable:!1,get:C}):Object.defineProperty(s,"ref",{enumerable:!1,value:null}),s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(s,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(s,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:z}),Object.defineProperty(s,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:oe}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s}function d(s,m,k,I,z,oe){var T=m.children;if(T!==void 0)if(I)if(H(T)){for(I=0;I<T.length;I++)x(T[I]);Object.freeze&&Object.freeze(T)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else x(T);if(Y.call(m,"key")){T=e(s);var U=Object.keys(m).filter(function(le){return le!=="key"});I=0<U.length?"{key: someKey, "+U.join(": ..., ")+": ...}":"{key: someKey}",V[T+I]||(U=0<U.length?"{"+U.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,I,T,U,T),V[T+I]=!0)}if(T=null,k!==void 0&&(a(k),T=""+k),l(m)&&(a(m.key),T=""+m.key),"key"in m){k={};for(var ne in m)ne!=="key"&&(k[ne]=m[ne])}else k=m;return T&&f(k,typeof s=="function"?s.displayName||s.name||"Unknown":s),b(s,T,k,r(),z,oe)}function x(s){S(s)?s._store&&(s._store.validated=1):typeof s=="object"&&s!==null&&s.$$typeof===j&&(s._payload.status==="fulfilled"?S(s._payload.value)&&s._payload.value._store&&(s._payload.value._store.validated=1):s._store&&(s._store.validated=1))}function S(s){return typeof s=="object"&&s!==null&&s.$$typeof===N}var w=c,N=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),v=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),K=Symbol.for("react.client.reference"),M=w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=Object.prototype.hasOwnProperty,H=Array.isArray,W=console.createTask?console.createTask:function(){return null};w={react_stack_bottom_frame:function(s){return s()}};var te,re={},P=w.react_stack_bottom_frame.bind(w,o)(),ae=W(n(o)),V={};Ee.Fragment=p,Ee.jsx=function(s,m,k){var I=1e4>M.recentlyCreatedOwnerStacks++;return u(s,m,k,!1,I?Error("react-stack-top-frame"):P,I?W(n(s)):ae)},Ee.jsxs=function(s,m,k){var I=1e4>M.recentlyCreatedOwnerStacks++;return u(s,m,k,!0,I?Error("react-stack-top-frame"):P,I?W(n(s)):ae)}})()),Ee}var wt;function Vt(){return wt||(wt=1,process.env.NODE_ENV==="production"?_e.exports=Yt():_e.exports=Gt()),_e.exports}var i=Vt();const Ae=18,Fe=12,kt=10,F={container:"directory-tree-container relative h-full transition-opacity duration-300 overflow-y-hidden pb-[3px] pr-[2px]",containerPending:"opacity-70",entry:"directory-tree-entry flex items-center cursor-pointer relative select-none text-xs leading-tight py-0.5",entryHover:_.twMerge("directory-tree-entry--hover hover:bg-gray-400/15","dark:hover:bg-gray-200/10"),entrySelected:_.twMerge("directory-tree-entry--selected bg-blue-400/10","dark:bg-blue-400/15"),entryItemSelected:_.twMerge("directory-tree-entry--item-selected bg-blue-400/20 shadow-[0_0_0_1px_rgba(59,130,246,0.3)]","dark:bg-blue-400/25 dark:shadow-[0_0_0_1px_rgba(96,165,250,0.4)]"),expandIcon:_.twMerge("directory-tree-expand-icon w-3.5 h-3.5 flex-shrink-0 flex items-center justify-center","text-gray-500","dark:text-gray-400"),expandIconSelected:_.twMerge("directory-tree-expand-icon--selected text-blue-700","dark:text-blue-400"),typeIcon:_.twMerge("directory-tree-type-icon w-3.5 h-3.5 flex-shrink-0 flex items-center justify-center","text-gray-500","dark:text-gray-400"),typeIconSelected:_.twMerge("directory-tree-type-icon--selected text-blue-700","dark:text-blue-400"),name:_.twMerge("directory-tree-name overflow-hidden text-ellipsis whitespace-nowrap ml-1 text-xs font-normal","text-gray-700","dark:text-gray-200"),nameDirectory:"directory-tree-name--directory font-medium",nameSelected:_.twMerge("directory-tree-name--selected text-blue-800 font-semibold","dark:text-blue-300")},pe=e=>{if(!e)return"";const t=e.split("?")[0].split("#")[0].split("/").pop()||e,a=t.lastIndexOf(".");return a<=0?"":t.slice(a+1).toLowerCase()},It=({isDirectory:e,isExpanded:t,showExpandIcons:a,useCanvasExpandIcons:n,expandIconSize:r})=>{const o=r?{width:r,height:r}:void 0,l=r?"":"h-4 w-4";return!(a&&e)||n?i.jsx("span",{className:l,style:o,"aria-hidden":"true"}):t?i.jsx(Ge.ChevronDownIcon,{className:l,style:o}):i.jsx(Ge.ChevronRightIcon,{className:l,style:o})},Ve=(e,t)=>{if(e==null||typeof e=="boolean")return null;if(typeof e=="function")return console.warn(`[DirectoryTree] Function returned by renderer for "${t}". Return a node.`),null;if(typeof e=="object"){if("then"in e)return console.warn(`[DirectoryTree] Promise returned for "${t}". Not supported.`),null;if(Array.isArray(e)){const n=e.map(r=>Ve(r,t)).filter(Boolean);return n.length?n:null}const a=e.type;if(a&&a.$$typeof===Symbol.for("react.lazy"))return console.warn(`[DirectoryTree] Lazy component for "${t}". Not supported.`),null}return e},Ut=(e,t,a)=>{const n=(t||(a?pe(a):"")).toLowerCase(),r=(e||"").toLowerCase();if(r&&r!=="application/octet-stream"){if(r==="text/markdown"||r==="text/x-markdown")return i.jsx(A.FileMd,{className:"h-4 w-4 text-sky-500 dark:text-sky-400"});if(r==="application/pdf")return i.jsx(A.FilePdf,{className:"h-4 w-4 text-red-500 dark:text-red-400"});if(r.includes("excel")||r.includes("spreadsheet")||r.includes("google-apps.spreadsheet"))return i.jsx(A.FileXls,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"});if(r==="text/csv"||r==="text/tab-separated-values")return i.jsx(A.FileCsv,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"});if(r.includes("word")||r.includes("msword")||r.includes("wordprocessingml")||r.includes("google-apps.document")||r==="application/rtf")return i.jsx(A.FileDoc,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"});if(r.includes("powerpoint")||r.includes("presentation")||r.includes("google-apps.presentation"))return i.jsx(A.FilePpt,{className:"h-4 w-4 text-orange-500 dark:text-orange-400"});if(r.startsWith("image/"))return i.jsx(A.FileImage,{className:"h-4 w-4 text-teal-500 dark:text-teal-400"});if(r.startsWith("audio/"))return i.jsx(A.FileAudio,{className:"h-4 w-4 text-pink-500 dark:text-pink-400"});if(r.startsWith("video/"))return i.jsx(A.FileVideo,{className:"h-4 w-4 text-violet-500 dark:text-violet-400"});if(r.includes("zip")||r.includes("tar")||r.includes("compressed")||r.includes("archive"))return i.jsx(A.FileZip,{className:"h-4 w-4 text-amber-500 dark:text-amber-400"});if(r==="application/json"||r.includes("javascript")||r.includes("typescript")||r.includes("xml")||r.startsWith("text/html")||r.startsWith("text/css")||r.includes("x-python")||r.includes("x-sh")||r.includes("x-go")||r.includes("x-rust"))return i.jsx(A.FileCode,{className:"h-4 w-4 text-purple-500 dark:text-purple-400"});if(r.startsWith("text/"))return i.jsx(A.FileText,{className:"h-4 w-4 text-gray-500 dark:text-gray-400"})}if(n){if(n==="md"||n==="markdown"||n==="mdx")return i.jsx(A.FileMd,{className:"h-4 w-4 text-sky-500 dark:text-sky-400"});if(n==="pdf")return i.jsx(A.FilePdf,{className:"h-4 w-4 text-red-500 dark:text-red-400"});if(["xls","xlsx","xlsm","xlsb","ods"].includes(n))return i.jsx(A.FileXls,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"});if(["csv","tsv"].includes(n))return i.jsx(A.FileCsv,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"});if(["doc","docx","rtf","odt"].includes(n))return i.jsx(A.FileDoc,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"});if(["ppt","pptx","odp"].includes(n))return i.jsx(A.FilePpt,{className:"h-4 w-4 text-orange-500 dark:text-orange-400"});if(["png","jpg","jpeg","gif","svg","webp","ico","bmp","tiff","avif"].includes(n))return i.jsx(A.FileImage,{className:"h-4 w-4 text-teal-500 dark:text-teal-400"});if(["js","mjs","cjs","ts","tsx","jsx","json","html","htm","css","scss","py","go","rs","c","cpp","h","hpp","sh","bash","yaml","yml","sql","xml","toml"].includes(n))return i.jsx(A.FileCode,{className:"h-4 w-4 text-purple-500 dark:text-purple-400"});if(["mp3","wav","ogg","m4a","flac","aac","wma"].includes(n))return i.jsx(A.FileAudio,{className:"h-4 w-4 text-pink-500 dark:text-pink-400"});if(["mp4","webm","mov","avi","mkv","wmv","flv"].includes(n))return i.jsx(A.FileVideo,{className:"h-4 w-4 text-violet-500 dark:text-violet-400"});if(["zip","tar","gz","7z","rar","tgz","bz2"].includes(n))return i.jsx(A.FileZip,{className:"h-4 w-4 text-amber-500 dark:text-amber-400"});if(["txt","log"].includes(n))return i.jsx(A.FileText,{className:"h-4 w-4 text-gray-500 dark:text-gray-400"})}return i.jsx(A.FileIcon,{className:"h-4 w-4 text-gray-400 dark:text-gray-400"})},Ct=(e,t)=>{const{entry:a,isDirectory:n,isExpanded:r,extension:o,mimeType:l}=e;let f;const C=l||a.mimeType;return a.icon!==void 0?f=a.icon:n?f=r&&t?.directoryExpanded||t?.directory||i.jsx(Ge.FolderIcon,{className:"h-4 w-4"}):o&&t?.fileByExtension?.[o]?f=t.fileByExtension[o]:f=t?.file||Ut(C,o,a.name),Ve(typeof f=="function"?f(e):f,a.absolutePath)},Xt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),jt=e=>{if(!e)return;const t=Object.entries(e);if(t.length!==0)return Object.fromEntries(t.map(([a,n])=>[`data-${Xt(a)}`,String(n)]))},qt=500,Tt=({entry:e,isDirectory:t,isExpanded:a,isItemSelected:n,selectionMode:r,onSelectionChange:o,onEntryClick:l,toggleDirectory:f,onToggleDirectoryRecursive:C})=>{const b=c.useRef(null);return c.useEffect(()=>()=>{b.current&&window.clearTimeout(b.current)},[]),c.useCallback(u=>{u.stopPropagation(),r!=="none"&&!t&&o&&o(e,!n);let x=!1;l({entry:e,isDirectory:t,isExpanded:a,preventDefault:()=>{x=!0}}),!(!t||x)&&(b.current?(window.clearTimeout(b.current),b.current=null,C(e)):b.current=window.setTimeout(()=>{f(e.absolutePath),b.current=null},qt))},[t,e,a,C,f,l,r,o,n])},Rt=e=>e==="right"?"dt-grid-cell--right":e==="center"?"dt-grid-cell--center":"",St=(e,t)=>e.children!==void 0&&t(e.absolutePath),Mt=(e,t)=>({width:e,gridTemplateColumns:t}),Pt=c.memo(({entry:e,indentLevel:t,positionInSet:a,setSize:n,rowHeight:r,isDirOpen:o,columns:l,numericTemplate:f,numericTotal:C,nameWidth:b,rowClassName:u,selection:{onEntryClick:x,selectedPath:S,mode:w="none",selectedItems:N,onSelectionChange:h},expansion:{toggleDirectory:p,onToggleDirectoryRecursive:g},visual:{iconOverrides:O,showExpandIcons:E=!0,showDirectoryIcons:v=!0,showFileIcons:y=!0,useCanvasExpandIcons:D=!1,expandIconSize:L,indentSize:$=Fe,highlightStyles:j}})=>{const[Z,K]=c.useState(!1),M=e.children!==void 0,Y=M&&o(e.absolutePath),H=e.absolutePath===S,W=!M&&!!N?.has(e.absolutePath),te=M?void 0:pe(e.name)||pe(e.relativePath)||pe(e.absolutePath),re=Tt({entry:e,isDirectory:M,isExpanded:Y,isItemSelected:W,selectionMode:w,onSelectionChange:h,onEntryClick:x,toggleDirectory:p,onToggleDirectoryRecursive:g}),P=Z?j?.hoverClassName!==void 0?j.hoverClassName:F.entryHover:"",ae=(()=>{if(M){if(H)return j?.directorySelectedClassName!==void 0?j.directorySelectedClassName:F.entrySelected}else if(H||W)return j?.itemSelectedClassName!==void 0?j.itemSelectedClassName:_.twMerge(H&&F.entrySelected,W&&F.entryItemSelected);return""})(),V=typeof u=="function"?u(e):u,s=_.twMerge("dt-grid-row cursor-pointer select-none",P,ae,V,e.className),m=_.twMerge(F.expandIcon,(H||W)&&F.expandIconSelected),k=_.twMerge(F.typeIcon,(H||W)&&F.typeIconSelected),I=_.twMerge("dt-grid-name-label ml-1","text-gray-700 dark:text-gray-200",M&&F.nameDirectory,(H||W)&&F.nameSelected),z=It({isDirectory:M,isExpanded:Y,showExpandIcons:E,useCanvasExpandIcons:D,expandIconSize:L}),oe=(M?v:y)?Ct({entry:e,isDirectory:M,isExpanded:Y,isSelected:H,isItemSelected:W,extension:te,mimeType:e.mimeType},O):null,T={indentLevel:t,isDirectory:M,isExpanded:Y},[U,...ne]=l,le=U?.render?U.render(e,T):e.label??e.name,fe={...Z?j?.hoverStyle:{},...M&&H?j?.directorySelectedStyle:{},...!M&&(H||W)?j?.itemSelectedStyle:{}};return i.jsxs("div",{className:s,style:{height:r,...fe,...e.style},role:"row","aria-expanded":M?Y:void 0,"aria-level":t+1,"aria-posinset":a,"aria-setsize":n,...jt(e.data),"data-entry-type":M?"directory":"file","data-entry-expanded":M?String(Y):void 0,"data-entry-selected":H?"true":void 0,"data-entry-item-selected":W?"true":void 0,onClick:re,onMouseEnter:()=>K(!0),onMouseLeave:()=>K(!1),onKeyDown:Q=>Q.key==="Enter"&&re(Q),tabIndex:0,children:[i.jsxs("div",{className:_.twMerge("dt-grid-name-cell",U?.className),role:"gridcell",style:{width:b,paddingLeft:Math.max(0,t*$)},children:[(E||D)&&i.jsx("span",{className:m,children:z}),(M?v:y)&&i.jsx("span",{className:k,children:oe}),i.jsx("span",{className:I,children:le})]}),ne.length>0&&i.jsx("div",{className:"dt-grid-numeric-viewport",children:i.jsx("div",{className:"dt-grid-numeric-track",style:Mt(C,f),children:ne.map(Q=>i.jsx("div",{className:_.twMerge("dt-grid-cell",Rt(Q.align),Q.className),role:"gridcell",children:Q.render?Q.render(e,T):null},Q.key))})})]})},(e,t)=>{if(e.entry!==t.entry)return!1;const a=St(e.entry,e.isDirOpen),n=St(t.entry,t.isDirOpen);return e.indentLevel===t.indentLevel&&e.positionInSet===t.positionInSet&&e.setSize===t.setSize&&e.rowHeight===t.rowHeight&&a===n&&e.columns===t.columns&&e.numericTemplate===t.numericTemplate&&e.numericTotal===t.numericTotal&&e.nameWidth===t.nameWidth&&e.rowClassName===t.rowClassName&&e.selection.selectedPath===t.selection.selectedPath&&e.selection.mode===t.selection.mode&&e.selection.selectedItems===t.selection.selectedItems&&e.visual===t.visual});Pt.displayName="DirectoryTreeGridRow";const _t=({kind:e,columns:t,numericTemplate:a,numericTotal:n,nameWidth:r,scrollBarWidth:o,className:l,nameContent:f,renderCell:C})=>{const[,...b]=t,u=e==="header"?"dt-grid-name-header":"dt-grid-name-footer",x=e==="header"?"dt-grid-header":"dt-grid-footer",S=e==="header"?"columnheader":"gridcell";return i.jsxs("div",{className:_.twMerge(x,"text-gray-600 dark:text-gray-300",l),role:"row",children:[i.jsx("div",{className:_.twMerge(u,"px-1",t[0]?.className),role:S,style:{width:r},children:f}),b.length>0&&i.jsx("div",{className:"dt-grid-numeric-viewport",children:i.jsx("div",{className:"dt-grid-numeric-track",style:Mt(n,a),children:b.map(w=>i.jsx("div",{className:_.twMerge("dt-grid-cell",Rt(w.align),w.className),role:S,children:C(w)},w.key))})}),i.jsx("div",{className:"dt-grid-scrollbar-spacer",style:{width:o},"aria-hidden":"true"})]})},Jt=({columns:e,className:t,...a})=>i.jsx(_t,{kind:"header",columns:e,className:t,nameContent:e[0]?.header??null,renderCell:n=>n.header??null,...a}),Et=(e,t)=>typeof e=="function"?e(t):e??null,Zt=({columns:e,allEntries:t,className:a,...n})=>i.jsx(_t,{kind:"footer",columns:e,className:a,nameContent:Et(e[0]?.footer,t),renderCell:r=>Et(r.footer,t),...n}),Kt=240,At=96,Ft=12,Ue=(e,t)=>{const a=e?.width;return typeof a=="number"&&Number.isFinite(a)&&a>0?a:t},Qt=e=>e.slice(1).map(t=>`${Ue(t,At)}px`).join(" "),er=({measuredWidth:e,columns:t,scrollBarWidth:a=Ft})=>{const n=Ue(t[0],Kt),r=t.slice(1).reduce((C,b)=>C+Ue(b,At),0),o=Number.isFinite(e)&&e>0?e:0,l=Math.max(0,o-n-Math.max(0,a)),f=Math.max(0,r-l);return{nameWidth:n,numericTotal:r,numericVisible:l,maxHScroll:f}},Ye=(e,t)=>!Number.isFinite(e)||e<0?0:e>t?t:e,tr=e=>{const t=[],a=n=>{for(const r of n)t.push(r),r.children&&r.children.length>0&&a(r.children)};return a(e),t},rr=(e,t)=>{const a=e.length-1;if(a<=0)return 0;let n=0,r=a-1,o=0;for(;n<=r;){const l=n+r>>>1;e[l]<=t?(o=l,n=l+1):r=l-1}return o},nr=(e,t,a)=>{if(a<=0||e.length===0||t.length!==e.length+1)return null;const n=rr(t,a),r=e[n];return r?{path:r.entry.absolutePath,offsetInViewport:a-t[n]}:null},sr=(e,t,a)=>{if(t.length===0||a.length!==t.length+1)return null;for(let n=0;n<t.length;n++)if(t[n].entry.absolutePath===e.path)return Math.max(0,a[n]+e.offsetInViewport);return null},ar=(e,t,a)=>{const n=[];for(let r=t;r<a;r++){const o=e[r];if(!(!o||o.length===0))for(const l of o)n.push(l)}return n},or=(e,t,a)=>{const n=[];for(let r=t;r<a;r++){const o=e[r];if(!(!o||o.length===0))for(const l of o)n.push(l)}return n},lr=(e,t,a,n)=>{const r=Math.max(1,Math.floor(t*n)),o=Math.max(1,Math.floor(a*n));(e.width!==r||e.height!==o)&&(e.width=r,e.height=o);const l=e.style;l.width!==`${t}px`&&(l.width=`${t}px`),l.height!==`${a}px`&&(l.height=`${a}px`)},ir=(e,t,a)=>{e.lineWidth=a,e.beginPath();for(const n of t)e.moveTo(n.x1,n.y1),e.lineTo(n.x2,n.y2);e.stroke()},cr=(e,t)=>{const a=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!a)return null;let n=a[1];n.length===3&&(n=n.split("").map(f=>f+f).join(""));const r=Number.parseInt(n.slice(0,2),16),o=Number.parseInt(n.slice(2,4),16),l=Number.parseInt(n.slice(4,6),16);return`rgba(${r}, ${o}, ${l}, ${t})`},ur=(e,t,a,n)=>{if(t.length===0)return;const r=cr(a,.14),o=e.strokeStyle,l=e.fillStyle,f=e.lineWidth,C=e.lineCap,b=e.lineJoin;e.strokeStyle=a,e.lineCap="round",e.lineJoin="round";for(const u of t){const x=n??u.size,S=Math.max(0,x/2),w=Math.max(1,Math.round(x*.08)),N=Math.max(1,Math.round(x*.14)),h=Math.max(0,S-w*.8),p=Math.max(0,h*.55);r&&(e.fillStyle=r,e.beginPath(),e.arc(u.centerX,u.centerY,h,0,Math.PI*2),e.fill()),e.lineWidth=w,e.beginPath(),e.arc(u.centerX,u.centerY,Math.max(0,S-w*.3),0,Math.PI*2),e.stroke(),e.lineWidth=N,e.beginPath(),e.moveTo(u.centerX-p,u.centerY),e.lineTo(u.centerX+p,u.centerY),e.stroke(),u.isExpanded||(e.beginPath(),e.moveTo(u.centerX,u.centerY-p),e.lineTo(u.centerX,u.centerY+p),e.stroke())}e.strokeStyle=o,e.fillStyle=l,e.lineWidth=f,e.lineCap=C,e.lineJoin=b},Ot=c.memo(({segmentsByItem:e,glyphsByItem:t,itemHeight:a,width:n,viewportHeight:r,scrollPosition:o,color:l="#a0aec0",strokeWidth:f=1,renderStartIndex:C,renderEndIndex:b,lookaheadEndIndex:u,devicePixelRatio:x,expandGlyphColor:S,expandGlyphSize:w})=>{const N=c.useRef(null),h=c.useRef(null),p=c.useRef({segmentsByItem:e,glyphsByItem:t,itemHeight:a,width:n,viewportHeight:r,scrollPosition:o,color:l,strokeWidth:f,renderStartIndex:C,renderEndIndex:b,lookaheadEndIndex:u,devicePixelRatio:x,expandGlyphColor:S,expandGlyphSize:w}),g=c.useCallback(()=>{h.current=null;const E=N.current;if(!E)return;const v=E.getContext("2d");if(!v)return;const y=p.current;if(y.width<=0||y.viewportHeight<=0){v.clearRect(0,0,E.width,E.height);return}const D=Number.isFinite(y.devicePixelRatio??NaN)?y.devicePixelRatio:typeof window<"u"&&window.devicePixelRatio||1;lr(E,y.width,y.viewportHeight,D);const L=y.segmentsByItem.length,$=typeof y.renderStartIndex=="number"&&Number.isFinite(y.renderStartIndex)?Math.max(0,Math.floor(y.renderStartIndex)):Math.max(0,Math.floor(y.scrollPosition/y.itemHeight)),j=Math.min(L,Math.ceil((y.scrollPosition+y.viewportHeight)/y.itemHeight)),Z=(()=>{if(typeof y.renderEndIndex=="number"&&Number.isFinite(y.renderEndIndex)){const H=Math.floor(y.renderEndIndex);return Math.max(Math.min(L,H+1),$)}return Math.max(j,$)})(),K=(()=>{if(typeof y.lookaheadEndIndex=="number"&&Number.isFinite(y.lookaheadEndIndex)){const H=Math.floor(y.lookaheadEndIndex),W=Math.min(L,H+1);return Math.max(W,Z)}return Math.max(j,Z)})(),M=ar(y.segmentsByItem,$,K),Y=or(y.glyphsByItem,$,K);v.save(),v.scale(D,D),v.clearRect(0,0,y.width,y.viewportHeight),v.translate(0,-y.scrollPosition),v.strokeStyle=y.color,ir(v,M,y.strokeWidth),ur(v,Y,y.expandGlyphColor??y.color,y.expandGlyphSize),v.restore()},[]),O=c.useCallback(()=>{h.current===null&&(h.current=window.requestAnimationFrame(g))},[g]);return c.useEffect(()=>{p.current={segmentsByItem:e,glyphsByItem:t,itemHeight:a,width:n,viewportHeight:r,scrollPosition:o,color:l,strokeWidth:f,renderStartIndex:C,renderEndIndex:b,lookaheadEndIndex:u,devicePixelRatio:x,expandGlyphColor:S,expandGlyphSize:w},O()},[e,t,a,n,r,o,l,f,C,b,u,x,S,w,O]),c.useEffect(()=>()=>{h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null)},[]),i.jsx("canvas",{ref:N,className:"pointer-events-none absolute top-0 left-0 z-0"})});Ot.displayName="TreeLineCanvas";const dr={msOverflowStyle:"none",scrollbarWidth:"none"},mr=()=>{let e=document.getElementById("directory-tree-webkit-scrollbar-hide");e||(e=document.createElement("style"),e.id="directory-tree-webkit-scrollbar-hide",e.textContent=".directory-tree-container::-webkit-scrollbar { display: none; }",document.head.appendChild(e))},fr=(e,t,a,n,r)=>{const o=[],l=[];let f=0;const C=(b,u,x)=>{const S=r?[...b].sort(r):b;for(let w=0;w<S.length;w++){const N=S[w],h=w===S.length-1,p=[...x,h],g=N.children!==void 0,O=g&&t(N.absolutePath,N.relativePath);let E=u,v=p,y=x;n&&(E=u-1,v=p.slice(1),y=x.slice(1)),o.push({entry:N,indentLevel:E,depth:u,positionInSet:w+1,setSize:S.length,parentIsLast:v}),a&&(E>f&&(f=E),l.push({id:N.absolutePath,name:N.name,absolutePath:N.absolutePath,indentLevel:E,isLastChild:h,isDirectory:g,isExpanded:O,ancestorIsLast:[...y],hideLines:n&&u===0})),g&&O&&N.children&&C(N.children,u+1,p)}};return C(e,0,[]),{flatItems:o,lineItems:l,maxIndent:f}},Nt=(e,t)=>{const a=e.length-1;if(a<=0)return 0;let n=0,r=a-1,o=0;for(;n<=r;){const l=n+r>>>1;e[l]<=t?(o=l,n=l+1):r=l-1}return o},hr=(e,t,a,n,r,o)=>{const l=n?.renderStart??Math.max(0,Nt(o,r)),f=t>0?Nt(o,r+t)+a:l+a,C=e>0?Math.min(e-1,Math.max(l,f)):l,b=n?.renderEnd??C,u=e>0?Math.min(e-1,b+a):b;return{renderStart:l,renderEnd:b,lookaheadEnd:u}},pr=(e,t,a,n,r,o)=>{if(e.length===0)return{segmentsByItem:[],glyphsByItem:[]};const l=Array.from({length:e.length},()=>[]),f=Array.from({length:e.length},()=>[]),C=u=>r?typeof o=="number"&&Number.isFinite(o)&&o>0?o:Math.max(8,Math.min(n*.9,u*.7)):0,b=3;for(let u=0;u<e.length;u++){const x=e[u];if(x.hideLines)continue;const S=[],w=t[u]??0,N=a[u]??0,h=N+w/2,p=C(w),g=p>0?p/2+2:n/1.5;for(let v=0;v<x.indentLevel;v++){if(x.ancestorIsLast[v]??!1)continue;let D=!1;for(let L=u;L<e.length;L++){const $=e[L];if($.indentLevel>v&&$.ancestorIsLast.length>v&&!$.ancestorIsLast[v]){D=!0;break}if(L>u&&$.indentLevel===v)break}if(D){const L=v*n+n/2+b;S.push({key:`${x.id}-ancestor-${v}`,x1:L,y1:N,x2:L,y2:N+w,itemIndex:u})}}const O=x.indentLevel*n,E=O+n/2+b;if(x.isDirectory?S.push({key:`${x.id}-connector-top`,x1:E,y1:N,x2:E,y2:h-g,itemIndex:u}):S.push({key:`${x.id}-connector-top`,x1:E,y1:N,x2:E,y2:h,itemIndex:u}),!x.isDirectory&&x.isLastChild&&S.push({key:`${x.id}-connector-horizontal`,x1:E,y1:h,x2:O+n+b,y2:h,itemIndex:u}),x.isLastChild||(x.isDirectory?S.push({key:`${x.id}-connector-bottom`,x1:E,y1:h+g,x2:E,y2:N+w,itemIndex:u}):S.push({key:`${x.id}-connector-bottom`,x1:E,y1:h,x2:E,y2:N+w,itemIndex:u})),l[u]=S,r&&x.isDirectory){const v=p,y=E,D=h;f[u]=[{key:`${x.id}-glyph`,itemIndex:u,centerX:y,centerY:D,size:v,isExpanded:x.isExpanded}]}}return{segmentsByItem:l,glyphsByItem:f}},Xe=c.memo(({entry:e,indentLevel:t,depth:a,positionInSet:n,setSize:r,rowHeight:o,isDirOpen:l,parentIsLast:f,renderChildren:C=!0,expansion:{toggleDirectory:b,onToggleDirectoryRecursive:u},selection:{onEntryClick:x,selectedPath:S,mode:w="none",selectedItems:N,onSelectionChange:h},visual:{iconOverrides:p,showExpandIcons:g=!0,showDirectoryIcons:O=!0,showFileIcons:E=!0,useCanvasExpandIcons:v=!1,expandIconSize:y,typeIconSize:D,fontSize:L,indentSize:$=Fe,highlightStyles:j,entryClassName:Z,entryStyle:K,nameClassName:M,nameStyle:Y,directoryNameClassName:H,directoryNameStyle:W,fileNameClassName:te,fileNameStyle:re}})=>{const[P,ae]=c.useState(null),[V,s]=c.useState(!1),m=e.children!==void 0,k=m&&l(e.absolutePath),I=e.absolutePath===S,z=!m&&N?.has(e.absolutePath),oe=m?void 0:pe(e.name)||pe(e.relativePath)||pe(e.absolutePath);c.useEffect(()=>{ae(k&&e.children?e.children:null)},[k,e.children]);const T=Tt({entry:e,isDirectory:m,isExpanded:k,isItemSelected:!!z,selectionMode:w,onSelectionChange:h,onEntryClick:x,toggleDirectory:b,onToggleDirectoryRecursive:u}),U=V?j?.hoverClassName!==void 0?j.hoverClassName:F.entryHover:"",ne=(()=>{if(m){if(I)return j?.directorySelectedClassName!==void 0?j.directorySelectedClassName:F.entrySelected}else if(I||z)return j?.itemSelectedClassName!==void 0?j.itemSelectedClassName:_.twMerge(I&&F.entrySelected,z&&F.entryItemSelected);return""})(),le=_.twMerge(F.entry,U,ne,Z,e.className),fe=_.twMerge(F.expandIcon,(I||z)&&F.expandIconSelected),Q=_.twMerge(F.typeIcon,(I||z)&&F.typeIconSelected),Oe=_.twMerge(F.name,M,m&&F.nameDirectory,m&&H,!m&&te,(I||z)&&F.nameSelected),ye=It({isDirectory:m,isExpanded:k,showExpandIcons:g,useCanvasExpandIcons:v,expandIconSize:y}),Ne=(m?O:E)?Ct({entry:e,isDirectory:m,isExpanded:k,isSelected:I,isItemSelected:!!z,extension:oe,mimeType:e.mimeType},p):null,Ie={...V?j?.hoverStyle:{},...m&&I?j?.directorySelectedStyle:{},...!m&&(I||z)?j?.itemSelectedStyle:{}},Ce=jt(e.data),je=D?{width:D,height:D}:void 0,we=L?{fontSize:typeof L=="number"?`${L}px`:L}:void 0;return i.jsxs(c.Fragment,{children:[i.jsxs("div",{className:le,style:{paddingLeft:`${Math.max(0,t*$)}px`,transform:t<0?`translateX(${t*$}px)`:void 0,width:t<0?`calc(100% + ${Math.abs(t*$)}px)`:void 0,height:`${o}px`,...we,...Ie,...K,...e.style},...Ce,"data-entry-type":m?"directory":"file","data-entry-expanded":m?String(k):void 0,"data-entry-selected":I?"true":void 0,"data-entry-item-selected":z?"true":void 0,onClick:T,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onKeyDown:X=>X.key==="Enter"&&T(X),tabIndex:0,role:"treeitem","aria-expanded":m?k:void 0,"aria-level":a+1,"aria-posinset":n,"aria-setsize":r,"aria-label":`${e.name} (${m?"directory":"file"})`,children:[(g||v)&&i.jsx("span",{className:fe,children:ye}),(m?O:E)&&i.jsx("span",{className:Q,style:je,children:Ne}),i.jsx("span",{className:Oe,style:{...we,...Y,...m?W:re},"data-entry-type":m?"directory":"file","data-entry-role":"name",children:e.label??e.name})]}),k&&P&&C&&i.jsx("fieldset",{children:P.map((X,ke)=>i.jsx(Xe,{entry:X,indentLevel:t+1,depth:a+1,positionInSet:ke+1,setSize:P.length,rowHeight:o,isDirOpen:l,parentIsLast:[...f,ke===P.length-1],expansion:{toggleDirectory:b,onToggleDirectoryRecursive:u},selection:{onEntryClick:x,selectedPath:S,mode:w,selectedItems:N,onSelectionChange:h},visual:{iconOverrides:p,showExpandIcons:g,showDirectoryIcons:O,showFileIcons:E,useCanvasExpandIcons:v,expandIconSize:y,highlightStyles:j,entryClassName:Z,entryStyle:K,nameClassName:M,nameStyle:Y,directoryNameClassName:H,directoryNameStyle:W,fileNameClassName:te,fileNameStyle:re}},X.absolutePath))})]},e.absolutePath)},(e,t)=>{if(e.entry!==t.entry)return!1;const a=e.entry.children!==void 0,n=t.entry.children!==void 0,r=a&&e.isDirOpen(e.entry.absolutePath),o=n&&t.isDirOpen(t.entry.absolutePath);return e.indentLevel===t.indentLevel&&e.depth===t.depth&&e.positionInSet===t.positionInSet&&e.setSize===t.setSize&&e.rowHeight===t.rowHeight&&r===o&&e.selection.selectedPath===t.selection.selectedPath&&e.selection.mode===t.selection.mode&&e.selection.selectedItems===t.selection.selectedItems&&e.visual.iconOverrides===t.visual.iconOverrides&&e.visual.showExpandIcons===t.visual.showExpandIcons&&e.visual.showDirectoryIcons===t.visual.showDirectoryIcons&&e.visual.showFileIcons===t.visual.showFileIcons&&e.visual.useCanvasExpandIcons===t.visual.useCanvasExpandIcons&&e.visual.expandIconSize===t.visual.expandIconSize&&e.visual.highlightStyles===t.visual.highlightStyles&&e.visual.entryClassName===t.visual.entryClassName&&e.visual.entryStyle===t.visual.entryStyle&&e.visual.nameClassName===t.visual.nameClassName&&e.visual.nameStyle===t.visual.nameStyle&&e.visual.directoryNameClassName===t.visual.directoryNameClassName&&e.visual.directoryNameStyle===t.visual.directoryNameStyle&&e.visual.fileNameClassName===t.visual.fileNameClassName&&e.visual.fileNameStyle===t.visual.fileNameStyle&&e.parentIsLast.length===t.parentIsLast.length&&e.parentIsLast.every((l,f)=>l===t.parentIsLast[f])});Xe.displayName="DirectoryEntryItem";const Dt=e=>{const t=[];if(e.children)for(const a of e.children)a.type==="directory"&&(t.push(a.absolutePath),t.push(...Dt(a)));return t},yr=({entries:e,expansion:{toggle:t,isExpanded:a,expandMultiple:n,collapseMultiple:r,isPending:o,alwaysExpanded:l=!1,doubleClickAction:f="recursive"},selection:{onEntryClick:C,selectedPath:b,mode:u="none",selectedItems:x,onSelectionChange:S},visual:{className:w,style:N,lineColor:h="#A0AEC0",showTreeLines:p=!0,showExpandIcons:g=!0,showDirectoryIcons:O=!0,showFileIcons:E=!0,iconOverrides:v,expandIconSize:y,itemHeight:D=Ae,removeRootIndent:L=!1,highlightStyles:$,entryClassName:j,entryStyle:Z,nameClassName:K,nameStyle:M,directoryNameClassName:Y,directoryNameStyle:H,fileNameClassName:W,fileNameStyle:te}={},virtualScroll:re,grid:P,sort:ae})=>{const V=P!==void 0,[s,m]=c.useState(!1),k=c.useRef(null),I=c.useRef(null),z=c.useRef(null),[oe,T]=c.useState(0),[U,ne]=c.useState(0),[le,fe]=c.useState(0),[Q,Oe]=c.useState(null),{overscanCount:ye=15,className:Ne,background:Ie,onScroll:Ce,onRangeChange:je,initialScrollIndex:we,initialScrollOffset:X,callbackThrottleMs:ke=5,contentInsets:xe,onItemFocus:qe,viewportHeightOverride:se,scrollBarOptions:De,behaviorOptions:Je,preserveScrollAnchor:Ze=!1,getItemKey:Lt,testId:Ke,contentProps:Qe}=re??{},[Te,Le]=c.useState(typeof X=="number"?X:0),$e=c.useRef(typeof X=="number"?X:0),et=c.useCallback((d,R)=>{$e.current=d,Le(d),Ce?.(d,R)},[Ce]),tt=c.useCallback(d=>{const{renderingStartIndex:R,renderingEndIndex:B}=d;Oe(J=>J&&J.renderStart===R&&J.renderEnd===B?J:{renderStart:R,renderEnd:B}),je?.(d)},[je]);c.useEffect(()=>{typeof X=="number"&&Le(X)},[X]),c.useEffect(()=>{m(!0),mr()},[]),c.useEffect(()=>{const d=k.current,R=V?I.current:d,B=()=>{if(d){const ee=d.clientWidth;ne(ie=>Math.abs(ie-ee)>1?ee:ie)}if(typeof se=="number")T(ee=>Math.abs(ee-se)>1?se:ee);else if(R){const ee=R.clientHeight;T(ie=>Math.abs(ie-ee)>1?ee:ie)}};if(!(d||R))return T(0);B();const J=new ResizeObserver(B);return d&&J.observe(d),R&&R!==d&&J.observe(R),()=>J.disconnect()},[se,V]);const ce=typeof se=="number"?se:oe,ue=c.useCallback(d=>l||(s?a(d):!1),[s,a,l]),rt=_.twMerge(F.container,o&&F.containerPending,w),nt=c.useMemo(()=>({...dr,...N??{},...typeof se=="number"?{height:se,minHeight:se}:{}}),[N,se]),He=c.useCallback((d,R)=>{const B=[d.absolutePath,...Dt(d)],J=R||f;if(B.every(ve=>ue(ve)))return r(B);if(B.every(ve=>!ue(ve))||J==="recursive")return n(B);if(J==="toggle")return r(B);console.warn(`[DirectoryTree] Unknown double click action: ${J}. No action taken.`)},[ue,n,r,f]),st=V?!1:L,{flatItems:at,lineItems:We,maxIndent:ot}=c.useMemo(()=>fr(e,ue,p,st,ae),[e,ue,p,st,ae]),G=c.useMemo(()=>at.map((d,R)=>{const B=typeof D=="function"?D(d.entry,R):D;return{...d,rowHeight:Number.isFinite(B)&&B>0?B:Ae}}),[at,D]),de=c.useMemo(()=>G.map(d=>d.rowHeight),[G]),he=c.useMemo(()=>{const d=new Array(de.length+1);d[0]=0;for(let R=0;R<de.length;R++)d[R+1]=d[R]+de[R];return d},[de]),lt=c.useCallback(d=>G[d]?.rowHeight??Ae,[G]),$t=c.useCallback(d=>G[d]?.entry.absolutePath??d,[G]),it=Lt??$t,Re=c.useMemo(()=>!p||We.length===0?{segmentsByItem:[],glyphsByItem:[]}:pr(We,de,he,Fe,p,y??kt),[We,de,he,p,y]),Me=c.useMemo(()=>!p||e.length===0?0:(ot+2)*Fe,[e.length,ot,p]),{renderStart:ct,renderEnd:ut,lookaheadEnd:dt}=c.useMemo(()=>hr(G.length,ce,ye,Q,Te,he),[G.length,ce,ye,Q,Te,he]),Be=c.useMemo(()=>!p||Me<=0||ce<=0||Re.segmentsByItem.length===0?null:i.jsx("div",{className:"pointer-events-none absolute inset-0 z-0","aria-hidden":"true",children:i.jsx("div",{className:"absolute top-0 left-0",style:{width:Me,height:ce},children:i.jsx(Ot,{segmentsByItem:Re.segmentsByItem,glyphsByItem:Re.glyphsByItem,itemHeight:de[0]??Ae,width:Me,viewportHeight:ce,scrollPosition:Te,color:h,expandGlyphColor:h,expandGlyphSize:y??kt,renderStartIndex:ct,renderEndIndex:ut,lookaheadEndIndex:dt})})}),[Me,ce,ct,ut,dt,Te,Re,h,p,y,de]),mt=c.useCallback(d=>G[d],[G]),ft=c.useRef(null);c.useLayoutEffect(()=>{const d=ft.current;if(ft.current={items:G,offsets:he},!Ze||!d||d.items===G)return;const R=z.current,B=typeof xe=="number"?xe:xe?.top??0,J=R?R.getScrollPosition():$e.current,ee=J-B,ie=nr(d.items,d.offsets,ee);if(!ie)return;const ve=sr(ie,G,he);if(ve===null)return;const ze=ve+B;if(Math.abs(ze-J)<1)return;const xt=R?.scrollTo(ze)??ze;$e.current=xt,Le(xt)},[G,he,Ze,xe]);const me=P?.columns,be=P?.scrollBarWidth??De?.width??Ft,q=c.useMemo(()=>me?er({measuredWidth:U,columns:me,scrollBarWidth:be}):null,[me,U,be]),Pe=c.useMemo(()=>me?Qt(me):"",[me]),Ht=c.useMemo(()=>P?.showFooter&&me?tr(e):[],[P?.showFooter,me,e]),ge=q?.maxHScroll??0;c.useEffect(()=>{fe(d=>Ye(d,ge))},[ge]);const ht=c.useCallback(d=>fe(R=>Ye(R+d,ge)),[ge]),pt=c.useMemo(()=>({iconOverrides:v,showExpandIcons:g,showDirectoryIcons:O,showFileIcons:E,useCanvasExpandIcons:p,expandIconSize:y,highlightStyles:$}),[v,g,O,E,p,y,$]),yt=c.useMemo(()=>i.jsx(bt.VirtualScroll,{ref:z,itemCount:G.length,getItem:mt,getItemHeight:lt,getItemKey:it,testId:Ke,contentProps:Qe,viewportSize:ce,overscanCount:ye,onScroll:et,onRangeChange:tt,className:Ne,onWheelHorizontal:V?ht:void 0,background:i.jsxs(i.Fragment,{children:[V&&q?i.jsx("div",{className:"pointer-events-none absolute top-0 left-0 z-0 h-full overflow-hidden",style:{width:q.nameWidth},"aria-hidden":"true",children:Be}):Be,Ie]}),initialScrollIndex:we,initialScrollOffset:X,onItemFocus:qe,callbackThrottleMs:ke,contentInsets:xe,scrollBarOptions:De,behaviorOptions:Je,children:d=>d?V&&P&&q?i.jsx(Pt,{entry:d.entry,indentLevel:d.indentLevel,positionInSet:d.positionInSet,setSize:d.setSize,rowHeight:d.rowHeight,isDirOpen:ue,columns:P.columns,numericTemplate:Pe,numericTotal:q.numericTotal,nameWidth:q.nameWidth,rowClassName:P.rowClassName,selection:{onEntryClick:C,selectedPath:b??null,mode:u,selectedItems:x,onSelectionChange:S},expansion:{toggleDirectory:t,onToggleDirectoryRecursive:He},visual:pt},d.entry.absolutePath):i.jsx(Xe,{entry:d.entry,indentLevel:d.indentLevel,depth:d.depth,positionInSet:d.positionInSet,setSize:d.setSize,rowHeight:d.rowHeight,isDirOpen:ue,parentIsLast:d.parentIsLast,renderChildren:!1,expansion:{toggleDirectory:t,onToggleDirectoryRecursive:He},selection:{onEntryClick:C,selectedPath:b??null,mode:u,selectedItems:x,onSelectionChange:S},visual:{iconOverrides:v,showExpandIcons:g,showDirectoryIcons:O,showFileIcons:E,useCanvasExpandIcons:p,expandIconSize:y,highlightStyles:$,entryClassName:j,entryStyle:Z,nameClassName:K,nameStyle:M,directoryNameClassName:Y,directoryNameStyle:H,fileNameClassName:W,fileNameStyle:te}},d.entry.absolutePath):null}),[G.length,mt,lt,it,Ke,Qe,ce,ye,et,tt,Ne,V,ht,q,Be,Ie,we,X,qe,ke,xe,De,Je,P,Pe,ue,C,b,u,x,S,t,He,pt,v,g,O,E,p,y,$,j,Z,K,M,Y,H,W,te]);if(!(P&&q))return i.jsx("div",{ref:k,className:rt,style:nt,role:"tree",children:yt});const Wt=P.showHeader??!0,Bt=P.showFooter??!1,zt={...nt,"--dt-hscroll":`${le}px`};return i.jsxs("div",{ref:k,className:_.twMerge(rt,"dt-grid"),style:zt,role:"treegrid",children:[Wt&&i.jsx(Jt,{columns:P.columns,numericTemplate:Pe,numericTotal:q.numericTotal,nameWidth:q.nameWidth,scrollBarWidth:be,className:P.headerClassName}),i.jsx("div",{ref:I,className:"dt-grid-body",children:yt}),ge>0&&i.jsxs("div",{className:"dt-grid-hscrollbar-row",children:[i.jsx("div",{className:"dt-grid-scrollbar-spacer",style:{width:q.nameWidth},"aria-hidden":"true"}),i.jsx(bt.ScrollBar,{horizontal:!0,contentSize:q.numericTotal,viewportSize:q.numericVisible,scrollPosition:le,scrollBarWidth:be,onScroll:d=>{const R=typeof d=="function"?d(le):d,B=Ye(R,ge);return fe(B),B}}),i.jsx("div",{className:"dt-grid-scrollbar-spacer",style:{width:be},"aria-hidden":"true"})]}),Bt&&i.jsx(Zt,{columns:P.columns,numericTemplate:Pe,numericTotal:q.numericTotal,nameWidth:q.nameWidth,scrollBarWidth:be,allEntries:Ht,className:P.footerClassName})]})},xr=({initialExpanded:e=new Set,storageKey:t}={})=>{const[a,n]=c.useTransition(),[r,o]=c.useState(()=>{if(typeof window<"u"&&t)try{const h=window.localStorage.getItem(t);if(h){const p=JSON.parse(h);return new Set(p)}}catch(h){console.error("[useDirectoryTreeState] Error reading from localStorage",h)}return e}),l=c.useCallback(h=>{n(()=>{o(p=>{const g=new Set(p);return h(g),g})})},[]),f=c.useCallback((h,p)=>{l(g=>{for(const O of h)p(g,O)})},[l]);c.useEffect(()=>{if(t&&typeof window<"u")try{window.localStorage.setItem(t,JSON.stringify(Array.from(r)))}catch(h){console.warn(`Error setting localStorage key "${t}":`,h)}},[r,t]);const C=c.useCallback(h=>{f([h],(p,g)=>{p.has(g)?p.delete(g):p.add(g)})},[f]),b=c.useCallback(h=>{f([h],(p,g)=>{p.add(g)})},[f]),u=c.useCallback(h=>{f([h],(p,g)=>{p.delete(g)})},[f]),x=c.useCallback(h=>{f(h,(p,g)=>{p.delete(g)})},[f]),S=c.useCallback(h=>{f(h,(p,g)=>{p.add(g)})},[f]),w=c.useCallback(()=>{l(h=>{h.clear()})},[l]),N=c.useCallback(h=>r.has(h),[r]);return{expanded:r,toggle:C,expand:b,collapse:u,collapseMultiple:x,expandMultiple:S,collapseAll:w,isExpanded:N,isPending:a}};exports.DirectoryTree=yr;exports.directoryTreeClasses=F;exports.useDirectoryTreeState=xr;
6
+ <%s key={someKey} {...props} />`,I,T,U,T),V[T+I]=!0)}if(T=null,k!==void 0&&(a(k),T=""+k),l(m)&&(a(m.key),T=""+m.key),"key"in m){k={};for(var ne in m)ne!=="key"&&(k[ne]=m[ne])}else k=m;return T&&f(k,typeof s=="function"?s.displayName||s.name||"Unknown":s),b(s,T,k,r(),z,oe)}function x(s){S(s)?s._store&&(s._store.validated=1):typeof s=="object"&&s!==null&&s.$$typeof===j&&(s._payload.status==="fulfilled"?S(s._payload.value)&&s._payload.value._store&&(s._payload.value._store.validated=1):s._store&&(s._store.validated=1))}function S(s){return typeof s=="object"&&s!==null&&s.$$typeof===N}var w=c,N=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),v=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),K=Symbol.for("react.client.reference"),M=w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=Object.prototype.hasOwnProperty,H=Array.isArray,W=console.createTask?console.createTask:function(){return null};w={react_stack_bottom_frame:function(s){return s()}};var te,re={},P=w.react_stack_bottom_frame.bind(w,o)(),ae=W(n(o)),V={};Ee.Fragment=p,Ee.jsx=function(s,m,k){var I=1e4>M.recentlyCreatedOwnerStacks++;return d(s,m,k,!1,I?Error("react-stack-top-frame"):P,I?W(n(s)):ae)},Ee.jsxs=function(s,m,k){var I=1e4>M.recentlyCreatedOwnerStacks++;return d(s,m,k,!0,I?Error("react-stack-top-frame"):P,I?W(n(s)):ae)}})()),Ee}var wt;function Vt(){return wt||(wt=1,process.env.NODE_ENV==="production"?_e.exports=Yt():_e.exports=Gt()),_e.exports}var i=Vt();const Ae=18,Fe=12,kt=10,F={container:"directory-tree-container relative h-full transition-opacity duration-300 overflow-y-hidden pb-[3px] pr-[2px]",containerPending:"opacity-70",entry:"directory-tree-entry flex items-center cursor-pointer relative select-none text-xs leading-tight py-0.5",entryHover:_.twMerge("directory-tree-entry--hover hover:bg-gray-400/15","dark:hover:bg-gray-200/10"),entrySelected:_.twMerge("directory-tree-entry--selected bg-blue-400/10","dark:bg-blue-400/15"),entryItemSelected:_.twMerge("directory-tree-entry--item-selected bg-blue-400/20 shadow-[0_0_0_1px_rgba(59,130,246,0.3)]","dark:bg-blue-400/25 dark:shadow-[0_0_0_1px_rgba(96,165,250,0.4)]"),expandIcon:_.twMerge("directory-tree-expand-icon w-3.5 h-3.5 flex-shrink-0 flex items-center justify-center","text-gray-500","dark:text-gray-400"),expandIconSelected:_.twMerge("directory-tree-expand-icon--selected text-blue-700","dark:text-blue-400"),typeIcon:_.twMerge("directory-tree-type-icon w-3.5 h-3.5 flex-shrink-0 flex items-center justify-center","text-gray-500","dark:text-gray-400"),typeIconSelected:_.twMerge("directory-tree-type-icon--selected text-blue-700","dark:text-blue-400"),name:_.twMerge("directory-tree-name overflow-hidden text-ellipsis whitespace-nowrap ml-1 text-xs font-normal","text-gray-700","dark:text-gray-200"),nameDirectory:"directory-tree-name--directory font-medium",nameSelected:_.twMerge("directory-tree-name--selected text-blue-800 font-semibold","dark:text-blue-300")},pe=e=>{if(!e)return"";const t=e.split("?")[0].split("#")[0].split("/").pop()||e,a=t.lastIndexOf(".");return a<=0?"":t.slice(a+1).toLowerCase()},It=({isDirectory:e,isExpanded:t,showExpandIcons:a,useCanvasExpandIcons:n,expandIconSize:r})=>{const o=r?{width:r,height:r}:void 0,l=r?"":"h-4 w-4";return!(a&&e)||n?i.jsx("span",{className:l,style:o,"aria-hidden":"true"}):t?i.jsx(Ge.ChevronDownIcon,{className:l,style:o}):i.jsx(Ge.ChevronRightIcon,{className:l,style:o})},Ve=(e,t)=>{if(e==null||typeof e=="boolean")return null;if(typeof e=="function")return console.warn(`[DirectoryTree] Function returned by renderer for "${t}". Return a node.`),null;if(typeof e=="object"){if("then"in e)return console.warn(`[DirectoryTree] Promise returned for "${t}". Not supported.`),null;if(Array.isArray(e)){const n=e.map(r=>Ve(r,t)).filter(Boolean);return n.length?n:null}const a=e.type;if(a&&a.$$typeof===Symbol.for("react.lazy"))return console.warn(`[DirectoryTree] Lazy component for "${t}". Not supported.`),null}return e},Ut=(e,t,a)=>{const n=(t||(a?pe(a):"")).toLowerCase(),r=(e||"").toLowerCase();if(r&&r!=="application/octet-stream"){if(r==="text/markdown"||r==="text/x-markdown")return i.jsx(A.FileMd,{className:"h-4 w-4 text-sky-500 dark:text-sky-400"});if(r==="application/pdf")return i.jsx(A.FilePdf,{className:"h-4 w-4 text-red-500 dark:text-red-400"});if(r.includes("excel")||r.includes("spreadsheet")||r.includes("google-apps.spreadsheet"))return i.jsx(A.FileXls,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"});if(r==="text/csv"||r==="text/tab-separated-values")return i.jsx(A.FileCsv,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"});if(r.includes("word")||r.includes("msword")||r.includes("wordprocessingml")||r.includes("google-apps.document")||r==="application/rtf")return i.jsx(A.FileDoc,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"});if(r.includes("powerpoint")||r.includes("presentation")||r.includes("google-apps.presentation"))return i.jsx(A.FilePpt,{className:"h-4 w-4 text-orange-500 dark:text-orange-400"});if(r.startsWith("image/"))return i.jsx(A.FileImage,{className:"h-4 w-4 text-teal-500 dark:text-teal-400"});if(r.startsWith("audio/"))return i.jsx(A.FileAudio,{className:"h-4 w-4 text-pink-500 dark:text-pink-400"});if(r.startsWith("video/"))return i.jsx(A.FileVideo,{className:"h-4 w-4 text-violet-500 dark:text-violet-400"});if(r.includes("zip")||r.includes("tar")||r.includes("compressed")||r.includes("archive"))return i.jsx(A.FileZip,{className:"h-4 w-4 text-amber-500 dark:text-amber-400"});if(r==="application/json"||r.includes("javascript")||r.includes("typescript")||r.includes("xml")||r.startsWith("text/html")||r.startsWith("text/css")||r.includes("x-python")||r.includes("x-sh")||r.includes("x-go")||r.includes("x-rust"))return i.jsx(A.FileCode,{className:"h-4 w-4 text-purple-500 dark:text-purple-400"});if(r.startsWith("text/"))return i.jsx(A.FileText,{className:"h-4 w-4 text-gray-500 dark:text-gray-400"})}if(n){if(n==="md"||n==="markdown"||n==="mdx")return i.jsx(A.FileMd,{className:"h-4 w-4 text-sky-500 dark:text-sky-400"});if(n==="pdf")return i.jsx(A.FilePdf,{className:"h-4 w-4 text-red-500 dark:text-red-400"});if(["xls","xlsx","xlsm","xlsb","ods"].includes(n))return i.jsx(A.FileXls,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"});if(["csv","tsv"].includes(n))return i.jsx(A.FileCsv,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"});if(["doc","docx","rtf","odt"].includes(n))return i.jsx(A.FileDoc,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"});if(["ppt","pptx","odp"].includes(n))return i.jsx(A.FilePpt,{className:"h-4 w-4 text-orange-500 dark:text-orange-400"});if(["png","jpg","jpeg","gif","svg","webp","ico","bmp","tiff","avif"].includes(n))return i.jsx(A.FileImage,{className:"h-4 w-4 text-teal-500 dark:text-teal-400"});if(["js","mjs","cjs","ts","tsx","jsx","json","html","htm","css","scss","py","go","rs","c","cpp","h","hpp","sh","bash","yaml","yml","sql","xml","toml"].includes(n))return i.jsx(A.FileCode,{className:"h-4 w-4 text-purple-500 dark:text-purple-400"});if(["mp3","wav","ogg","m4a","flac","aac","wma"].includes(n))return i.jsx(A.FileAudio,{className:"h-4 w-4 text-pink-500 dark:text-pink-400"});if(["mp4","webm","mov","avi","mkv","wmv","flv"].includes(n))return i.jsx(A.FileVideo,{className:"h-4 w-4 text-violet-500 dark:text-violet-400"});if(["zip","tar","gz","7z","rar","tgz","bz2"].includes(n))return i.jsx(A.FileZip,{className:"h-4 w-4 text-amber-500 dark:text-amber-400"});if(["txt","log"].includes(n))return i.jsx(A.FileText,{className:"h-4 w-4 text-gray-500 dark:text-gray-400"})}return i.jsx(A.FileIcon,{className:"h-4 w-4 text-gray-400 dark:text-gray-400"})},Ct=(e,t)=>{const{entry:a,isDirectory:n,isExpanded:r,extension:o,mimeType:l}=e;let f;const C=l||a.mimeType;return a.icon!==void 0?f=a.icon:n?f=r&&t?.directoryExpanded||t?.directory||i.jsx(Ge.FolderIcon,{className:"h-4 w-4"}):o&&t?.fileByExtension?.[o]?f=t.fileByExtension[o]:f=t?.file||Ut(C,o,a.name),Ve(typeof f=="function"?f(e):f,a.absolutePath)},Xt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),jt=e=>{if(!e)return;const t=Object.entries(e).filter(([,a])=>a!=null);if(t.length!==0)return Object.fromEntries(t.map(([a,n])=>[`data-${Xt(a)}`,String(n)]))},qt=500,Tt=({entry:e,isDirectory:t,isExpanded:a,isItemSelected:n,selectionMode:r,onSelectionChange:o,onEntryClick:l,toggleDirectory:f,onToggleDirectoryRecursive:C})=>{const b=c.useRef(null);return c.useEffect(()=>()=>{b.current&&window.clearTimeout(b.current)},[]),c.useCallback(d=>{d.stopPropagation(),r!=="none"&&!t&&o&&o(e,!n);let x=!1;l({entry:e,isDirectory:t,isExpanded:a,preventDefault:()=>{x=!0}}),!(!t||x)&&(b.current?(window.clearTimeout(b.current),b.current=null,C(e)):b.current=window.setTimeout(()=>{f(e.absolutePath),b.current=null},qt))},[t,e,a,C,f,l,r,o,n])},Rt=e=>e==="right"?"dt-grid-cell--right":e==="center"?"dt-grid-cell--center":"",St=(e,t)=>e.children!==void 0&&t(e.absolutePath),Mt=(e,t)=>({width:e,gridTemplateColumns:t}),Pt=c.memo(({entry:e,indentLevel:t,positionInSet:a,setSize:n,rowHeight:r,isDirOpen:o,columns:l,numericTemplate:f,numericTotal:C,nameWidth:b,rowClassName:d,selection:{onEntryClick:x,selectedPath:S,mode:w="none",selectedItems:N,onSelectionChange:h},expansion:{toggleDirectory:p,onToggleDirectoryRecursive:g},visual:{iconOverrides:O,showExpandIcons:E=!0,showDirectoryIcons:v=!0,showFileIcons:y=!0,useCanvasExpandIcons:D=!1,expandIconSize:L,indentSize:$=Fe,highlightStyles:j}})=>{const[Z,K]=c.useState(!1),M=e.children!==void 0,Y=M&&o(e.absolutePath),H=e.absolutePath===S,W=!M&&!!N?.has(e.absolutePath),te=M?void 0:pe(e.name)||pe(e.relativePath)||pe(e.absolutePath),re=Tt({entry:e,isDirectory:M,isExpanded:Y,isItemSelected:W,selectionMode:w,onSelectionChange:h,onEntryClick:x,toggleDirectory:p,onToggleDirectoryRecursive:g}),P=Z?j?.hoverClassName!==void 0?j.hoverClassName:F.entryHover:"",ae=(()=>{if(M){if(H)return j?.directorySelectedClassName!==void 0?j.directorySelectedClassName:F.entrySelected}else if(H||W)return j?.itemSelectedClassName!==void 0?j.itemSelectedClassName:_.twMerge(H&&F.entrySelected,W&&F.entryItemSelected);return""})(),V=typeof d=="function"?d(e):d,s=_.twMerge("dt-grid-row cursor-pointer select-none",P,ae,V,e.className),m=_.twMerge(F.expandIcon,(H||W)&&F.expandIconSelected),k=_.twMerge(F.typeIcon,(H||W)&&F.typeIconSelected),I=_.twMerge("dt-grid-name-label ml-1","text-gray-700 dark:text-gray-200",M&&F.nameDirectory,(H||W)&&F.nameSelected),z=It({isDirectory:M,isExpanded:Y,showExpandIcons:E,useCanvasExpandIcons:D,expandIconSize:L}),oe=(M?v:y)?Ct({entry:e,isDirectory:M,isExpanded:Y,isSelected:H,isItemSelected:W,extension:te,mimeType:e.mimeType},O):null,T={indentLevel:t,isDirectory:M,isExpanded:Y},[U,...ne]=l,le=U?.render?U.render(e,T):e.label??e.name,fe={...Z?j?.hoverStyle:{},...M&&H?j?.directorySelectedStyle:{},...!M&&(H||W)?j?.itemSelectedStyle:{}};return i.jsxs("div",{className:s,style:{height:r,...fe,...e.style},role:"row","aria-expanded":M?Y:void 0,"aria-level":t+1,"aria-posinset":a,"aria-setsize":n,...jt(e.data),"data-entry-type":M?"directory":"file","data-entry-expanded":M?String(Y):void 0,"data-entry-selected":H?"true":void 0,"data-entry-item-selected":W?"true":void 0,onClick:re,onMouseEnter:()=>K(!0),onMouseLeave:()=>K(!1),onKeyDown:Q=>Q.key==="Enter"&&re(Q),tabIndex:0,children:[i.jsxs("div",{className:_.twMerge("dt-grid-name-cell",U?.className),role:"gridcell",style:{width:b,paddingLeft:Math.max(0,t*$)},children:[(E||D)&&i.jsx("span",{className:m,children:z}),(M?v:y)&&i.jsx("span",{className:k,children:oe}),i.jsx("span",{className:I,children:le})]}),ne.length>0&&i.jsx("div",{className:"dt-grid-numeric-viewport",children:i.jsx("div",{className:"dt-grid-numeric-track",style:Mt(C,f),children:ne.map(Q=>i.jsx("div",{className:_.twMerge("dt-grid-cell",Rt(Q.align),Q.className),role:"gridcell",children:Q.render?Q.render(e,T):null},Q.key))})})]})},(e,t)=>{if(e.entry!==t.entry)return!1;const a=St(e.entry,e.isDirOpen),n=St(t.entry,t.isDirOpen);return e.indentLevel===t.indentLevel&&e.positionInSet===t.positionInSet&&e.setSize===t.setSize&&e.rowHeight===t.rowHeight&&a===n&&e.columns===t.columns&&e.numericTemplate===t.numericTemplate&&e.numericTotal===t.numericTotal&&e.nameWidth===t.nameWidth&&e.rowClassName===t.rowClassName&&e.selection.selectedPath===t.selection.selectedPath&&e.selection.mode===t.selection.mode&&e.selection.selectedItems===t.selection.selectedItems&&e.visual===t.visual});Pt.displayName="DirectoryTreeGridRow";const _t=({kind:e,columns:t,numericTemplate:a,numericTotal:n,nameWidth:r,scrollBarWidth:o,className:l,nameContent:f,renderCell:C})=>{const[,...b]=t,d=e==="header"?"dt-grid-name-header":"dt-grid-name-footer",x=e==="header"?"dt-grid-header":"dt-grid-footer",S=e==="header"?"columnheader":"gridcell";return i.jsxs("div",{className:_.twMerge(x,"text-gray-600 dark:text-gray-300",l),role:"row",children:[i.jsx("div",{className:_.twMerge(d,"px-1",t[0]?.className),role:S,style:{width:r},children:f}),b.length>0&&i.jsx("div",{className:"dt-grid-numeric-viewport",children:i.jsx("div",{className:"dt-grid-numeric-track",style:Mt(n,a),children:b.map(w=>i.jsx("div",{className:_.twMerge("dt-grid-cell",Rt(w.align),w.className),role:S,children:C(w)},w.key))})}),i.jsx("div",{className:"dt-grid-scrollbar-spacer",style:{width:o},"aria-hidden":"true"})]})},Jt=({columns:e,className:t,...a})=>i.jsx(_t,{kind:"header",columns:e,className:t,nameContent:e[0]?.header??null,renderCell:n=>n.header??null,...a}),Et=(e,t)=>typeof e=="function"?e(t):e??null,Zt=({columns:e,allEntries:t,className:a,...n})=>i.jsx(_t,{kind:"footer",columns:e,className:a,nameContent:Et(e[0]?.footer,t),renderCell:r=>Et(r.footer,t),...n}),Kt=240,At=96,Ft=12,Ue=(e,t)=>{const a=e?.width;return typeof a=="number"&&Number.isFinite(a)&&a>0?a:t},Qt=e=>e.slice(1).map(t=>`${Ue(t,At)}px`).join(" "),er=({measuredWidth:e,columns:t,scrollBarWidth:a=Ft})=>{const n=Ue(t[0],Kt),r=t.slice(1).reduce((C,b)=>C+Ue(b,At),0),o=Number.isFinite(e)&&e>0?e:0,l=Math.max(0,o-n-Math.max(0,a)),f=Math.max(0,r-l);return{nameWidth:n,numericTotal:r,numericVisible:l,maxHScroll:f}},Ye=(e,t)=>!Number.isFinite(e)||e<0?0:e>t?t:e,tr=e=>{const t=[],a=n=>{for(const r of n)t.push(r),r.children&&r.children.length>0&&a(r.children)};return a(e),t},rr=(e,t)=>{const a=e.length-1;if(a<=0)return 0;let n=0,r=a-1,o=0;for(;n<=r;){const l=n+r>>>1;e[l]<=t?(o=l,n=l+1):r=l-1}return o},nr=(e,t,a)=>{if(a<=0||e.length===0||t.length!==e.length+1)return null;const n=rr(t,a),r=e[n];return r?{path:r.entry.absolutePath,offsetInViewport:a-t[n]}:null},sr=(e,t,a)=>{if(t.length===0||a.length!==t.length+1)return null;for(let n=0;n<t.length;n++)if(t[n].entry.absolutePath===e.path)return Math.max(0,a[n]+e.offsetInViewport);return null},ar=(e,t,a)=>{const n=[];for(let r=t;r<a;r++){const o=e[r];if(!(!o||o.length===0))for(const l of o)n.push(l)}return n},or=(e,t,a)=>{const n=[];for(let r=t;r<a;r++){const o=e[r];if(!(!o||o.length===0))for(const l of o)n.push(l)}return n},lr=(e,t,a,n)=>{const r=Math.max(1,Math.floor(t*n)),o=Math.max(1,Math.floor(a*n));(e.width!==r||e.height!==o)&&(e.width=r,e.height=o);const l=e.style;l.width!==`${t}px`&&(l.width=`${t}px`),l.height!==`${a}px`&&(l.height=`${a}px`)},ir=(e,t,a)=>{e.lineWidth=a,e.beginPath();for(const n of t)e.moveTo(n.x1,n.y1),e.lineTo(n.x2,n.y2);e.stroke()},cr=(e,t)=>{const a=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!a)return null;let n=a[1];n.length===3&&(n=n.split("").map(f=>f+f).join(""));const r=Number.parseInt(n.slice(0,2),16),o=Number.parseInt(n.slice(2,4),16),l=Number.parseInt(n.slice(4,6),16);return`rgba(${r}, ${o}, ${l}, ${t})`},dr=(e,t,a,n)=>{if(t.length===0)return;const r=cr(a,.14),o=e.strokeStyle,l=e.fillStyle,f=e.lineWidth,C=e.lineCap,b=e.lineJoin;e.strokeStyle=a,e.lineCap="round",e.lineJoin="round";for(const d of t){const x=n??d.size,S=Math.max(0,x/2),w=Math.max(1,Math.round(x*.08)),N=Math.max(1,Math.round(x*.14)),h=Math.max(0,S-w*.8),p=Math.max(0,h*.55);r&&(e.fillStyle=r,e.beginPath(),e.arc(d.centerX,d.centerY,h,0,Math.PI*2),e.fill()),e.lineWidth=w,e.beginPath(),e.arc(d.centerX,d.centerY,Math.max(0,S-w*.3),0,Math.PI*2),e.stroke(),e.lineWidth=N,e.beginPath(),e.moveTo(d.centerX-p,d.centerY),e.lineTo(d.centerX+p,d.centerY),e.stroke(),d.isExpanded||(e.beginPath(),e.moveTo(d.centerX,d.centerY-p),e.lineTo(d.centerX,d.centerY+p),e.stroke())}e.strokeStyle=o,e.fillStyle=l,e.lineWidth=f,e.lineCap=C,e.lineJoin=b},Ot=c.memo(({segmentsByItem:e,glyphsByItem:t,itemHeight:a,width:n,viewportHeight:r,scrollPosition:o,color:l="#a0aec0",strokeWidth:f=1,renderStartIndex:C,renderEndIndex:b,lookaheadEndIndex:d,devicePixelRatio:x,expandGlyphColor:S,expandGlyphSize:w})=>{const N=c.useRef(null),h=c.useRef(null),p=c.useRef({segmentsByItem:e,glyphsByItem:t,itemHeight:a,width:n,viewportHeight:r,scrollPosition:o,color:l,strokeWidth:f,renderStartIndex:C,renderEndIndex:b,lookaheadEndIndex:d,devicePixelRatio:x,expandGlyphColor:S,expandGlyphSize:w}),g=c.useCallback(()=>{h.current=null;const E=N.current;if(!E)return;const v=E.getContext("2d");if(!v)return;const y=p.current;if(y.width<=0||y.viewportHeight<=0){v.clearRect(0,0,E.width,E.height);return}const D=Number.isFinite(y.devicePixelRatio??NaN)?y.devicePixelRatio:typeof window<"u"&&window.devicePixelRatio||1;lr(E,y.width,y.viewportHeight,D);const L=y.segmentsByItem.length,$=typeof y.renderStartIndex=="number"&&Number.isFinite(y.renderStartIndex)?Math.max(0,Math.floor(y.renderStartIndex)):Math.max(0,Math.floor(y.scrollPosition/y.itemHeight)),j=Math.min(L,Math.ceil((y.scrollPosition+y.viewportHeight)/y.itemHeight)),Z=(()=>{if(typeof y.renderEndIndex=="number"&&Number.isFinite(y.renderEndIndex)){const H=Math.floor(y.renderEndIndex);return Math.max(Math.min(L,H+1),$)}return Math.max(j,$)})(),K=(()=>{if(typeof y.lookaheadEndIndex=="number"&&Number.isFinite(y.lookaheadEndIndex)){const H=Math.floor(y.lookaheadEndIndex),W=Math.min(L,H+1);return Math.max(W,Z)}return Math.max(j,Z)})(),M=ar(y.segmentsByItem,$,K),Y=or(y.glyphsByItem,$,K);v.save(),v.scale(D,D),v.clearRect(0,0,y.width,y.viewportHeight),v.translate(0,-y.scrollPosition),v.strokeStyle=y.color,ir(v,M,y.strokeWidth),dr(v,Y,y.expandGlyphColor??y.color,y.expandGlyphSize),v.restore()},[]),O=c.useCallback(()=>{h.current===null&&(h.current=window.requestAnimationFrame(g))},[g]);return c.useEffect(()=>{p.current={segmentsByItem:e,glyphsByItem:t,itemHeight:a,width:n,viewportHeight:r,scrollPosition:o,color:l,strokeWidth:f,renderStartIndex:C,renderEndIndex:b,lookaheadEndIndex:d,devicePixelRatio:x,expandGlyphColor:S,expandGlyphSize:w},O()},[e,t,a,n,r,o,l,f,C,b,d,x,S,w,O]),c.useEffect(()=>()=>{h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null)},[]),i.jsx("canvas",{ref:N,className:"pointer-events-none absolute top-0 left-0 z-0"})});Ot.displayName="TreeLineCanvas";const ur={msOverflowStyle:"none",scrollbarWidth:"none"},mr=()=>{let e=document.getElementById("directory-tree-webkit-scrollbar-hide");e||(e=document.createElement("style"),e.id="directory-tree-webkit-scrollbar-hide",e.textContent=".directory-tree-container::-webkit-scrollbar { display: none; }",document.head.appendChild(e))},fr=(e,t,a,n,r)=>{const o=[],l=[];let f=0;const C=(b,d,x)=>{const S=r?[...b].sort(r):b;for(let w=0;w<S.length;w++){const N=S[w],h=w===S.length-1,p=[...x,h],g=N.children!==void 0,O=g&&t(N.absolutePath,N.relativePath);let E=d,v=p,y=x;n&&(E=d-1,v=p.slice(1),y=x.slice(1)),o.push({entry:N,indentLevel:E,depth:d,positionInSet:w+1,setSize:S.length,parentIsLast:v}),a&&(E>f&&(f=E),l.push({id:N.absolutePath,name:N.name,absolutePath:N.absolutePath,indentLevel:E,isLastChild:h,isDirectory:g,isExpanded:O,ancestorIsLast:[...y],hideLines:n&&d===0})),g&&O&&N.children&&C(N.children,d+1,p)}};return C(e,0,[]),{flatItems:o,lineItems:l,maxIndent:f}},Nt=(e,t)=>{const a=e.length-1;if(a<=0)return 0;let n=0,r=a-1,o=0;for(;n<=r;){const l=n+r>>>1;e[l]<=t?(o=l,n=l+1):r=l-1}return o},hr=(e,t,a,n,r,o)=>{const l=n?.renderStart??Math.max(0,Nt(o,r)),f=t>0?Nt(o,r+t)+a:l+a,C=e>0?Math.min(e-1,Math.max(l,f)):l,b=n?.renderEnd??C,d=e>0?Math.min(e-1,b+a):b;return{renderStart:l,renderEnd:b,lookaheadEnd:d}},pr=(e,t,a,n,r,o)=>{if(e.length===0)return{segmentsByItem:[],glyphsByItem:[]};const l=Array.from({length:e.length},()=>[]),f=Array.from({length:e.length},()=>[]),C=d=>r?typeof o=="number"&&Number.isFinite(o)&&o>0?o:Math.max(8,Math.min(n*.9,d*.7)):0,b=3;for(let d=0;d<e.length;d++){const x=e[d];if(x.hideLines)continue;const S=[],w=t[d]??0,N=a[d]??0,h=N+w/2,p=C(w),g=p>0?p/2+2:n/1.5;for(let v=0;v<x.indentLevel;v++){if(x.ancestorIsLast[v]??!1)continue;let D=!1;for(let L=d;L<e.length;L++){const $=e[L];if($.indentLevel>v&&$.ancestorIsLast.length>v&&!$.ancestorIsLast[v]){D=!0;break}if(L>d&&$.indentLevel===v)break}if(D){const L=v*n+n/2+b;S.push({key:`${x.id}-ancestor-${v}`,x1:L,y1:N,x2:L,y2:N+w,itemIndex:d})}}const O=x.indentLevel*n,E=O+n/2+b;if(x.isDirectory?S.push({key:`${x.id}-connector-top`,x1:E,y1:N,x2:E,y2:h-g,itemIndex:d}):S.push({key:`${x.id}-connector-top`,x1:E,y1:N,x2:E,y2:h,itemIndex:d}),!x.isDirectory&&x.isLastChild&&S.push({key:`${x.id}-connector-horizontal`,x1:E,y1:h,x2:O+n+b,y2:h,itemIndex:d}),x.isLastChild||(x.isDirectory?S.push({key:`${x.id}-connector-bottom`,x1:E,y1:h+g,x2:E,y2:N+w,itemIndex:d}):S.push({key:`${x.id}-connector-bottom`,x1:E,y1:h,x2:E,y2:N+w,itemIndex:d})),l[d]=S,r&&x.isDirectory){const v=p,y=E,D=h;f[d]=[{key:`${x.id}-glyph`,itemIndex:d,centerX:y,centerY:D,size:v,isExpanded:x.isExpanded}]}}return{segmentsByItem:l,glyphsByItem:f}},Xe=c.memo(({entry:e,indentLevel:t,depth:a,positionInSet:n,setSize:r,rowHeight:o,isDirOpen:l,parentIsLast:f,renderChildren:C=!0,expansion:{toggleDirectory:b,onToggleDirectoryRecursive:d},selection:{onEntryClick:x,selectedPath:S,mode:w="none",selectedItems:N,onSelectionChange:h},visual:{iconOverrides:p,showExpandIcons:g=!0,showDirectoryIcons:O=!0,showFileIcons:E=!0,useCanvasExpandIcons:v=!1,expandIconSize:y,typeIconSize:D,fontSize:L,indentSize:$=Fe,highlightStyles:j,entryClassName:Z,entryStyle:K,nameClassName:M,nameStyle:Y,directoryNameClassName:H,directoryNameStyle:W,fileNameClassName:te,fileNameStyle:re}})=>{const[P,ae]=c.useState(null),[V,s]=c.useState(!1),m=e.children!==void 0,k=m&&l(e.absolutePath),I=e.absolutePath===S,z=!m&&N?.has(e.absolutePath),oe=m?void 0:pe(e.name)||pe(e.relativePath)||pe(e.absolutePath);c.useEffect(()=>{ae(k&&e.children?e.children:null)},[k,e.children]);const T=Tt({entry:e,isDirectory:m,isExpanded:k,isItemSelected:!!z,selectionMode:w,onSelectionChange:h,onEntryClick:x,toggleDirectory:b,onToggleDirectoryRecursive:d}),U=V?j?.hoverClassName!==void 0?j.hoverClassName:F.entryHover:"",ne=(()=>{if(m){if(I)return j?.directorySelectedClassName!==void 0?j.directorySelectedClassName:F.entrySelected}else if(I||z)return j?.itemSelectedClassName!==void 0?j.itemSelectedClassName:_.twMerge(I&&F.entrySelected,z&&F.entryItemSelected);return""})(),le=_.twMerge(F.entry,U,ne,Z,e.className),fe=_.twMerge(F.expandIcon,(I||z)&&F.expandIconSelected),Q=_.twMerge(F.typeIcon,(I||z)&&F.typeIconSelected),Oe=_.twMerge(F.name,M,m&&F.nameDirectory,m&&H,!m&&te,(I||z)&&F.nameSelected),ye=It({isDirectory:m,isExpanded:k,showExpandIcons:g,useCanvasExpandIcons:v,expandIconSize:y}),Ne=(m?O:E)?Ct({entry:e,isDirectory:m,isExpanded:k,isSelected:I,isItemSelected:!!z,extension:oe,mimeType:e.mimeType},p):null,Ie={...V?j?.hoverStyle:{},...m&&I?j?.directorySelectedStyle:{},...!m&&(I||z)?j?.itemSelectedStyle:{}},Ce=jt(e.data),je=D?{width:D,height:D}:void 0,we=L?{fontSize:typeof L=="number"?`${L}px`:L}:void 0;return i.jsxs(c.Fragment,{children:[i.jsxs("div",{className:le,style:{paddingLeft:`${Math.max(0,t*$)}px`,transform:t<0?`translateX(${t*$}px)`:void 0,width:t<0?`calc(100% + ${Math.abs(t*$)}px)`:void 0,height:`${o}px`,...we,...Ie,...K,...e.style},...Ce,"data-entry-type":m?"directory":"file","data-entry-expanded":m?String(k):void 0,"data-entry-selected":I?"true":void 0,"data-entry-item-selected":z?"true":void 0,onClick:T,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onKeyDown:X=>X.key==="Enter"&&T(X),tabIndex:0,role:"treeitem","aria-expanded":m?k:void 0,"aria-level":a+1,"aria-posinset":n,"aria-setsize":r,"aria-label":`${e.name} (${m?"directory":"file"})`,children:[(g||v)&&i.jsx("span",{className:fe,children:ye}),(m?O:E)&&i.jsx("span",{className:Q,style:je,children:Ne}),i.jsx("span",{className:Oe,style:{...we,...Y,...m?W:re},"data-entry-type":m?"directory":"file","data-entry-role":"name",children:e.label??e.name})]}),k&&P&&C&&i.jsx("fieldset",{children:P.map((X,ke)=>i.jsx(Xe,{entry:X,indentLevel:t+1,depth:a+1,positionInSet:ke+1,setSize:P.length,rowHeight:o,isDirOpen:l,parentIsLast:[...f,ke===P.length-1],expansion:{toggleDirectory:b,onToggleDirectoryRecursive:d},selection:{onEntryClick:x,selectedPath:S,mode:w,selectedItems:N,onSelectionChange:h},visual:{iconOverrides:p,showExpandIcons:g,showDirectoryIcons:O,showFileIcons:E,useCanvasExpandIcons:v,expandIconSize:y,highlightStyles:j,entryClassName:Z,entryStyle:K,nameClassName:M,nameStyle:Y,directoryNameClassName:H,directoryNameStyle:W,fileNameClassName:te,fileNameStyle:re}},X.absolutePath))})]},e.absolutePath)},(e,t)=>{if(e.entry!==t.entry)return!1;const a=e.entry.children!==void 0,n=t.entry.children!==void 0,r=a&&e.isDirOpen(e.entry.absolutePath),o=n&&t.isDirOpen(t.entry.absolutePath);return e.indentLevel===t.indentLevel&&e.depth===t.depth&&e.positionInSet===t.positionInSet&&e.setSize===t.setSize&&e.rowHeight===t.rowHeight&&r===o&&e.selection.selectedPath===t.selection.selectedPath&&e.selection.mode===t.selection.mode&&e.selection.selectedItems===t.selection.selectedItems&&e.visual.iconOverrides===t.visual.iconOverrides&&e.visual.showExpandIcons===t.visual.showExpandIcons&&e.visual.showDirectoryIcons===t.visual.showDirectoryIcons&&e.visual.showFileIcons===t.visual.showFileIcons&&e.visual.useCanvasExpandIcons===t.visual.useCanvasExpandIcons&&e.visual.expandIconSize===t.visual.expandIconSize&&e.visual.highlightStyles===t.visual.highlightStyles&&e.visual.entryClassName===t.visual.entryClassName&&e.visual.entryStyle===t.visual.entryStyle&&e.visual.nameClassName===t.visual.nameClassName&&e.visual.nameStyle===t.visual.nameStyle&&e.visual.directoryNameClassName===t.visual.directoryNameClassName&&e.visual.directoryNameStyle===t.visual.directoryNameStyle&&e.visual.fileNameClassName===t.visual.fileNameClassName&&e.visual.fileNameStyle===t.visual.fileNameStyle&&e.parentIsLast.length===t.parentIsLast.length&&e.parentIsLast.every((l,f)=>l===t.parentIsLast[f])});Xe.displayName="DirectoryEntryItem";const Dt=e=>{const t=[];if(e.children)for(const a of e.children)a.type==="directory"&&(t.push(a.absolutePath),t.push(...Dt(a)));return t},yr=({entries:e,expansion:{toggle:t,isExpanded:a,expandMultiple:n,collapseMultiple:r,isPending:o,alwaysExpanded:l=!1,doubleClickAction:f="recursive"},selection:{onEntryClick:C,selectedPath:b,mode:d="none",selectedItems:x,onSelectionChange:S},visual:{className:w,style:N,lineColor:h="#A0AEC0",showTreeLines:p=!0,showExpandIcons:g=!0,showDirectoryIcons:O=!0,showFileIcons:E=!0,iconOverrides:v,expandIconSize:y,itemHeight:D=Ae,removeRootIndent:L=!1,highlightStyles:$,entryClassName:j,entryStyle:Z,nameClassName:K,nameStyle:M,directoryNameClassName:Y,directoryNameStyle:H,fileNameClassName:W,fileNameStyle:te}={},virtualScroll:re,grid:P,sort:ae})=>{const V=P!==void 0,[s,m]=c.useState(!1),k=c.useRef(null),I=c.useRef(null),z=c.useRef(null),[oe,T]=c.useState(0),[U,ne]=c.useState(0),[le,fe]=c.useState(0),[Q,Oe]=c.useState(null),{overscanCount:ye=15,className:Ne,background:Ie,onScroll:Ce,onRangeChange:je,initialScrollIndex:we,initialScrollOffset:X,callbackThrottleMs:ke=5,contentInsets:xe,onItemFocus:qe,viewportHeightOverride:se,scrollBarOptions:De,behaviorOptions:Je,preserveScrollAnchor:Ze=!1,getItemKey:Lt,testId:Ke,contentProps:Qe}=re??{},[Te,Le]=c.useState(typeof X=="number"?X:0),$e=c.useRef(typeof X=="number"?X:0),et=c.useCallback((u,R)=>{$e.current=u,Le(u),Ce?.(u,R)},[Ce]),tt=c.useCallback(u=>{const{renderingStartIndex:R,renderingEndIndex:B}=u;Oe(J=>J&&J.renderStart===R&&J.renderEnd===B?J:{renderStart:R,renderEnd:B}),je?.(u)},[je]);c.useEffect(()=>{typeof X=="number"&&Le(X)},[X]),c.useEffect(()=>{m(!0),mr()},[]),c.useEffect(()=>{const u=k.current,R=V?I.current:u,B=()=>{if(u){const ee=u.clientWidth;ne(ie=>Math.abs(ie-ee)>1?ee:ie)}if(typeof se=="number")T(ee=>Math.abs(ee-se)>1?se:ee);else if(R){const ee=R.clientHeight;T(ie=>Math.abs(ie-ee)>1?ee:ie)}};if(!(u||R))return T(0);B();const J=new ResizeObserver(B);return u&&J.observe(u),R&&R!==u&&J.observe(R),()=>J.disconnect()},[se,V]);const ce=typeof se=="number"?se:oe,de=c.useCallback(u=>l||(s?a(u):!1),[s,a,l]),rt=_.twMerge(F.container,o&&F.containerPending,w),nt=c.useMemo(()=>({...ur,...N??{},...typeof se=="number"?{height:se,minHeight:se}:{}}),[N,se]),He=c.useCallback((u,R)=>{const B=[u.absolutePath,...Dt(u)],J=R||f;if(B.every(ve=>de(ve)))return r(B);if(B.every(ve=>!de(ve))||J==="recursive")return n(B);if(J==="toggle")return r(B);console.warn(`[DirectoryTree] Unknown double click action: ${J}. No action taken.`)},[de,n,r,f]),st=V?!1:L,{flatItems:at,lineItems:We,maxIndent:ot}=c.useMemo(()=>fr(e,de,p,st,ae),[e,de,p,st,ae]),G=c.useMemo(()=>at.map((u,R)=>{const B=typeof D=="function"?D(u.entry,R):D;return{...u,rowHeight:Number.isFinite(B)&&B>0?B:Ae}}),[at,D]),ue=c.useMemo(()=>G.map(u=>u.rowHeight),[G]),he=c.useMemo(()=>{const u=new Array(ue.length+1);u[0]=0;for(let R=0;R<ue.length;R++)u[R+1]=u[R]+ue[R];return u},[ue]),lt=c.useCallback(u=>G[u]?.rowHeight??Ae,[G]),$t=c.useCallback(u=>G[u]?.entry.absolutePath??u,[G]),it=Lt??$t,Re=c.useMemo(()=>!p||We.length===0?{segmentsByItem:[],glyphsByItem:[]}:pr(We,ue,he,Fe,p,y??kt),[We,ue,he,p,y]),Me=c.useMemo(()=>!p||e.length===0?0:(ot+2)*Fe,[e.length,ot,p]),{renderStart:ct,renderEnd:dt,lookaheadEnd:ut}=c.useMemo(()=>hr(G.length,ce,ye,Q,Te,he),[G.length,ce,ye,Q,Te,he]),Be=c.useMemo(()=>!p||Me<=0||ce<=0||Re.segmentsByItem.length===0?null:i.jsx("div",{className:"pointer-events-none absolute inset-0 z-0","aria-hidden":"true",children:i.jsx("div",{className:"absolute top-0 left-0",style:{width:Me,height:ce},children:i.jsx(Ot,{segmentsByItem:Re.segmentsByItem,glyphsByItem:Re.glyphsByItem,itemHeight:ue[0]??Ae,width:Me,viewportHeight:ce,scrollPosition:Te,color:h,expandGlyphColor:h,expandGlyphSize:y??kt,renderStartIndex:ct,renderEndIndex:dt,lookaheadEndIndex:ut})})}),[Me,ce,ct,dt,ut,Te,Re,h,p,y,ue]),mt=c.useCallback(u=>G[u],[G]),ft=c.useRef(null);c.useLayoutEffect(()=>{const u=ft.current;if(ft.current={items:G,offsets:he},!Ze||!u||u.items===G)return;const R=z.current,B=typeof xe=="number"?xe:xe?.top??0,J=R?R.getScrollPosition():$e.current,ee=J-B,ie=nr(u.items,u.offsets,ee);if(!ie)return;const ve=sr(ie,G,he);if(ve===null)return;const ze=ve+B;if(Math.abs(ze-J)<1)return;const xt=R?.scrollTo(ze)??ze;$e.current=xt,Le(xt)},[G,he,Ze,xe]);const me=P?.columns,be=P?.scrollBarWidth??De?.width??Ft,q=c.useMemo(()=>me?er({measuredWidth:U,columns:me,scrollBarWidth:be}):null,[me,U,be]),Pe=c.useMemo(()=>me?Qt(me):"",[me]),Ht=c.useMemo(()=>P?.showFooter&&me?tr(e):[],[P?.showFooter,me,e]),ge=q?.maxHScroll??0;c.useEffect(()=>{fe(u=>Ye(u,ge))},[ge]);const ht=c.useCallback(u=>fe(R=>Ye(R+u,ge)),[ge]),pt=c.useMemo(()=>({iconOverrides:v,showExpandIcons:g,showDirectoryIcons:O,showFileIcons:E,useCanvasExpandIcons:p,expandIconSize:y,highlightStyles:$}),[v,g,O,E,p,y,$]),yt=c.useMemo(()=>i.jsx(bt.VirtualScroll,{ref:z,itemCount:G.length,getItem:mt,getItemHeight:lt,getItemKey:it,testId:Ke,contentProps:Qe,viewportSize:ce,overscanCount:ye,onScroll:et,onRangeChange:tt,className:Ne,onWheelHorizontal:V?ht:void 0,background:i.jsxs(i.Fragment,{children:[V&&q?i.jsx("div",{className:"pointer-events-none absolute top-0 left-0 z-0 h-full overflow-hidden",style:{width:q.nameWidth},"aria-hidden":"true",children:Be}):Be,Ie]}),initialScrollIndex:we,initialScrollOffset:X,onItemFocus:qe,callbackThrottleMs:ke,contentInsets:xe,scrollBarOptions:De,behaviorOptions:Je,children:u=>u?V&&P&&q?i.jsx(Pt,{entry:u.entry,indentLevel:u.indentLevel,positionInSet:u.positionInSet,setSize:u.setSize,rowHeight:u.rowHeight,isDirOpen:de,columns:P.columns,numericTemplate:Pe,numericTotal:q.numericTotal,nameWidth:q.nameWidth,rowClassName:P.rowClassName,selection:{onEntryClick:C,selectedPath:b??null,mode:d,selectedItems:x,onSelectionChange:S},expansion:{toggleDirectory:t,onToggleDirectoryRecursive:He},visual:pt},u.entry.absolutePath):i.jsx(Xe,{entry:u.entry,indentLevel:u.indentLevel,depth:u.depth,positionInSet:u.positionInSet,setSize:u.setSize,rowHeight:u.rowHeight,isDirOpen:de,parentIsLast:u.parentIsLast,renderChildren:!1,expansion:{toggleDirectory:t,onToggleDirectoryRecursive:He},selection:{onEntryClick:C,selectedPath:b??null,mode:d,selectedItems:x,onSelectionChange:S},visual:{iconOverrides:v,showExpandIcons:g,showDirectoryIcons:O,showFileIcons:E,useCanvasExpandIcons:p,expandIconSize:y,highlightStyles:$,entryClassName:j,entryStyle:Z,nameClassName:K,nameStyle:M,directoryNameClassName:Y,directoryNameStyle:H,fileNameClassName:W,fileNameStyle:te}},u.entry.absolutePath):null}),[G.length,mt,lt,it,Ke,Qe,ce,ye,et,tt,Ne,V,ht,q,Be,Ie,we,X,qe,ke,xe,De,Je,P,Pe,de,C,b,d,x,S,t,He,pt,v,g,O,E,p,y,$,j,Z,K,M,Y,H,W,te]);if(!(P&&q))return i.jsx("div",{ref:k,className:rt,style:nt,role:"tree",children:yt});const Wt=P.showHeader??!0,Bt=P.showFooter??!1,zt={...nt,"--dt-hscroll":`${le}px`};return i.jsxs("div",{ref:k,className:_.twMerge(rt,"dt-grid"),style:zt,role:"treegrid",children:[Wt&&i.jsx(Jt,{columns:P.columns,numericTemplate:Pe,numericTotal:q.numericTotal,nameWidth:q.nameWidth,scrollBarWidth:be,className:P.headerClassName}),i.jsx("div",{ref:I,className:"dt-grid-body",children:yt}),ge>0&&i.jsxs("div",{className:"dt-grid-hscrollbar-row",children:[i.jsx("div",{className:"dt-grid-scrollbar-spacer",style:{width:q.nameWidth},"aria-hidden":"true"}),i.jsx(bt.ScrollBar,{horizontal:!0,contentSize:q.numericTotal,viewportSize:q.numericVisible,scrollPosition:le,scrollBarWidth:be,onScroll:u=>{const R=typeof u=="function"?u(le):u,B=Ye(R,ge);return fe(B),B}}),i.jsx("div",{className:"dt-grid-scrollbar-spacer",style:{width:be},"aria-hidden":"true"})]}),Bt&&i.jsx(Zt,{columns:P.columns,numericTemplate:Pe,numericTotal:q.numericTotal,nameWidth:q.nameWidth,scrollBarWidth:be,allEntries:Ht,className:P.footerClassName})]})},xr=({initialExpanded:e=new Set,storageKey:t}={})=>{const[a,n]=c.useTransition(),[r,o]=c.useState(()=>{if(typeof window<"u"&&t)try{const h=window.localStorage.getItem(t);if(h){const p=JSON.parse(h);return new Set(p)}}catch(h){console.error("[useDirectoryTreeState] Error reading from localStorage",h)}return e}),l=c.useCallback(h=>{n(()=>{o(p=>{const g=new Set(p);return h(g),g})})},[]),f=c.useCallback((h,p)=>{l(g=>{for(const O of h)p(g,O)})},[l]);c.useEffect(()=>{if(t&&typeof window<"u")try{window.localStorage.setItem(t,JSON.stringify(Array.from(r)))}catch(h){console.warn(`Error setting localStorage key "${t}":`,h)}},[r,t]);const C=c.useCallback(h=>{f([h],(p,g)=>{p.has(g)?p.delete(g):p.add(g)})},[f]),b=c.useCallback(h=>{f([h],(p,g)=>{p.add(g)})},[f]),d=c.useCallback(h=>{f([h],(p,g)=>{p.delete(g)})},[f]),x=c.useCallback(h=>{f(h,(p,g)=>{p.delete(g)})},[f]),S=c.useCallback(h=>{f(h,(p,g)=>{p.add(g)})},[f]),w=c.useCallback(()=>{l(h=>{h.clear()})},[l]),N=c.useCallback(h=>r.has(h),[r]);return{expanded:r,toggle:C,expand:b,collapse:d,collapseMultiple:x,expandMultiple:S,collapseAll:w,isExpanded:N,isPending:a}};exports.DirectoryTree=yr;exports.directoryTreeClasses=F;exports.useDirectoryTreeState=xr;
package/dist/index.js CHANGED
@@ -368,7 +368,7 @@ const Le = 18, Fe = 12, Dt = 10, A = {
368
368
  }, vr = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Bt = (e) => {
369
369
  if (!e)
370
370
  return;
371
- const t = Object.entries(e);
371
+ const t = Object.entries(e).filter(([, a]) => a != null);
372
372
  if (t.length !== 0)
373
373
  return Object.fromEntries(t.map(([a, n]) => [`data-${vr(a)}`, String(n)]));
374
374
  }, br = 500, zt = ({ entry: e, isDirectory: t, isExpanded: a, isItemSelected: n, selectionMode: r, onSelectionChange: o, onEntryClick: l, toggleDirectory: m, onToggleDirectoryRecursive: I }) => {
@@ -1,3 +1,3 @@
1
1
  /*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
2
2
  /*! @aiquants/directory-tree standalone CSS — 非 Tailwind ホスト専用。ホストの Tailwind ビルドと混在させないこと */
3
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial}}}@layer theme{:root,:host{--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-600:oklch(59.6% .145 163.225);--color-teal-400:oklch(77.7% .152 181.912);--color-teal-500:oklch(70.4% .14 182.503);--color-sky-400:oklch(74.6% .16 232.661);--color-sky-500:oklch(68.5% .169 237.323);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-violet-400:oklch(70.2% .183 293.541);--color-violet-500:oklch(60.6% .25 292.717);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-pink-400:oklch(71.8% .202 349.761);--color-pink-500:oklch(65.6% .241 354.308);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--leading-tight:1.25;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}@layer base;@layer components{@layer components{.aqvs-scroll-pane{display:flex;position:relative}.aqvs-scroll-pane-content{flex:1;height:100%;position:relative;overflow:hidden}.aqvs-tap-scroll-circle{touch-action:none;-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;transition-property:transform;transition-duration:.1s;transition-timing-function:cubic-bezier(0,0,.2,1);display:flex;position:relative}.aqvs-tap-scroll-circle-visual-outer{border-radius:9999px;position:absolute;inset:0}.aqvs-tap-scroll-circle-gradient{background:linear-gradient(to bottom right,#1d4ed899,#60a5fa8c,#bfdbfe66);border-width:1px;border-color:#fff6;border-radius:9999px;position:absolute;inset:0;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.aqvs-tap-scroll-circle-inner{border-radius:9999px;position:absolute;inset:18%}.aqvs-sample-visual-pupil{background-color:#ffffffd9;border-width:1px;border-color:#ffffff80;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-sample-visual-highlight{background-color:#fffc;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-sample-visual-rod{background-color:#ffffff80;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-scrollbar{z-index:50;cursor:default;-webkit-user-select:none;user-select:none;touch-action:none;background-color:#fff;position:relative}.aqvs-scrollbar-horizontal{flex-direction:row;align-items:stretch;display:flex}.aqvs-scrollbar-vertical{flex-direction:column;align-items:stretch;display:flex}.aqvs-scrollbar-tap-circle-wrapper{pointer-events:auto;transition-property:opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1);position:absolute}.aqvs-scrollbar-arrow-button{color:#313131;background-color:#e0e0e0;justify-content:center;align-items:center;font-size:.75rem;line-height:1rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1);display:flex}.aqvs-scrollbar-arrow-button:focus{outline-offset:2px;outline:2px solid #0000}.aqvs-scrollbar-arrow-button:focus-visible{outline-offset:1px;outline:2px solid #60a5fa}.aqvs-scrollbar-arrow-button:disabled{cursor:not-allowed;opacity:.5}.aqvs-scrollbar-arrow-button:enabled:hover{background-color:#d4d4d4}.aqvs-scrollbar-track{background-color:#f5f5f5;flex:1;position:relative}.aqvs-scrollbar-overlay{pointer-events:none;position:absolute;inset:0}.aqvs-scrollbar-thumb-wrapper{touch-action:none;position:absolute}.aqvs-scrollbar-thumb{transform-origin:50%;background-color:#7f7f7f;transition:transform 80ms ease-out;position:absolute}.aqvs-scrollbar-thumb[data-thumb-state=disabled]{transition:none;transform:none}.aqvs-scrollbar-thumb[data-thumb-state=hover]{background-color:#5f5f5f}.aqvs-scrollbar-thumb[data-thumb-state=dragging]{background-color:#4f4f4f;transition:transform 60ms ease-out}.aqvs-scrollbar-thumb-horizontal{inset:1.5px 0}.aqvs-scrollbar-thumb-horizontal[data-thumb-state=hover]{top:-.5px;bottom:-.5px;transform:scaleY(1.06)}.aqvs-scrollbar-thumb-horizontal[data-thumb-state=dragging]{top:-.5px;bottom:-.5px;transform:scaleY(1.12)}.aqvs-scrollbar-thumb-vertical{inset:0 1.5px}.aqvs-scrollbar-thumb-vertical[data-thumb-state=hover]{left:-.5px;right:-.5px;transform:scaleX(1.06)}.aqvs-scrollbar-thumb-vertical[data-thumb-state=dragging]{left:-.5px;right:-.5px;transform:scaleX(1.12)}.aqvs-scroll-to-edge-button{pointer-events:auto;color:#fff;text-transform:uppercase;letter-spacing:.05em;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background-color:#1f2937cc;border-radius:9999px;padding:.25rem 3rem;font-size:10px;font-weight:500;transition-property:transform,background-color;transition-duration:.15s;transform:none;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.aqvs-scroll-to-edge-button:hover{background-color:#374151}.aqvs-scroll-to-edge-button:active{transform:scale(.95)}.aqvs-scroll-to-edge-overlay{pointer-events:none;z-index:10;transition-property:opacity;transition-duration:.5s;position:absolute;inset:0}.aqvs-scroll-to-edge-overlay[data-visible=true]{opacity:1}.aqvs-scroll-to-edge-overlay[data-visible=false]{opacity:0}.aqvs-scroll-to-edge-button-container{justify-content:center;display:flex;position:absolute;left:0;right:0}.aqvs-scroll-to-edge-button-container-top{top:.5rem}.aqvs-scroll-to-edge-button-container-bottom{bottom:.5rem}.aqvs-no-items-container{width:100%;position:absolute;top:0}.aqvs-no-items-text{text-align:center;color:#6b7280}.aqvs-item-container,.aqvs-bottom-inset,.aqvs-items-wrapper{width:100%;position:absolute}}.dt-grid{flex-direction:column;display:flex;position:relative}.dt-grid-body{flex:1;min-height:0;position:relative}.dt-grid-header,.dt-grid-footer,.dt-grid-row,.dt-grid-hscrollbar-row{align-items:stretch;display:flex}.dt-grid-name-cell,.dt-grid-name-header,.dt-grid-name-footer{z-index:1;flex-shrink:0;align-items:center;display:flex;position:relative;overflow:hidden}.dt-grid-numeric-viewport{flex:1;position:relative;overflow:hidden}.dt-grid-numeric-track{transform:translateX(calc(-1 * var(--dt-hscroll,0px)));will-change:transform;display:grid}.dt-grid-cell{white-space:nowrap;text-overflow:ellipsis;align-items:center;padding:0 8px;display:flex;overflow:hidden}.dt-grid-cell--right{text-align:right;justify-content:flex-end}.dt-grid-cell--center{text-align:center;justify-content:center}.dt-grid-name-label{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.dt-grid-scrollbar-spacer{flex-shrink:0}}@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.left-0{left:calc(var(--spacing) * 0)}.z-0{z-index:0}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.ml-1{margin-left:calc(var(--spacing) * 1)}.flex{display:flex}.grid{display:grid}.inline{display:inline}.table{display:table}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-full{height:100%}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-hidden{overflow:hidden}.overflow-y-hidden{overflow-y:hidden}.bg-blue-400\/10{background-color:#54a2ff1a}@supports (color:color-mix(in lab, red, red)){.bg-blue-400\/10{background-color:color-mix(in oklab, var(--color-blue-400) 10%, transparent)}}.bg-blue-400\/20{background-color:#54a2ff33}@supports (color:color-mix(in lab, red, red)){.bg-blue-400\/20{background-color:color-mix(in oklab, var(--color-blue-400) 20%, transparent)}}.px-1{padding-inline:calc(var(--spacing) * 1)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.pr-\[2px\]{padding-right:2px}.pb-\[3px\]{padding-bottom:3px}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-amber-500{color:var(--color-amber-500)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-blue-800{color:var(--color-blue-800)}.text-emerald-600{color:var(--color-emerald-600)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-orange-500{color:var(--color-orange-500)}.text-pink-500{color:var(--color-pink-500)}.text-purple-500{color:var(--color-purple-500)}.text-red-500{color:var(--color-red-500)}.text-sky-500{color:var(--color-sky-500)}.text-teal-500{color:var(--color-teal-500)}.text-violet-500{color:var(--color-violet-500)}.opacity-70{opacity:.7}.shadow-\[0_0_0_1px_rgba\(59\,130\,246\,0\.3\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#3b82f64d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-300{--tw-duration:.3s;transition-duration:.3s}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.hover\:bg-gray-400\/15:hover{background-color:#99a1af26}@supports (color:color-mix(in lab, red, red)){.hover\:bg-gray-400\/15:hover{background-color:color-mix(in oklab, var(--color-gray-400) 15%, transparent)}}}.dark\:bg-blue-400\/15:where(.dark,.dark *){background-color:#54a2ff26}@supports (color:color-mix(in lab, red, red)){.dark\:bg-blue-400\/15:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-blue-400) 15%, transparent)}}.dark\:bg-blue-400\/25:where(.dark,.dark *){background-color:#54a2ff40}@supports (color:color-mix(in lab, red, red)){.dark\:bg-blue-400\/25:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-blue-400) 25%, transparent)}}.dark\:text-amber-400:where(.dark,.dark *){color:var(--color-amber-400)}.dark\:text-blue-300:where(.dark,.dark *){color:var(--color-blue-300)}.dark\:text-blue-400:where(.dark,.dark *){color:var(--color-blue-400)}.dark\:text-emerald-400:where(.dark,.dark *){color:var(--color-emerald-400)}.dark\:text-gray-200:where(.dark,.dark *){color:var(--color-gray-200)}.dark\:text-gray-300:where(.dark,.dark *){color:var(--color-gray-300)}.dark\:text-gray-400:where(.dark,.dark *){color:var(--color-gray-400)}.dark\:text-orange-400:where(.dark,.dark *){color:var(--color-orange-400)}.dark\:text-pink-400:where(.dark,.dark *){color:var(--color-pink-400)}.dark\:text-purple-400:where(.dark,.dark *){color:var(--color-purple-400)}.dark\:text-red-400:where(.dark,.dark *){color:var(--color-red-400)}.dark\:text-sky-400:where(.dark,.dark *){color:var(--color-sky-400)}.dark\:text-teal-400:where(.dark,.dark *){color:var(--color-teal-400)}.dark\:text-violet-400:where(.dark,.dark *){color:var(--color-violet-400)}.dark\:shadow-\[0_0_0_1px_rgba\(96\,165\,250\,0\.4\)\]:where(.dark,.dark *){--tw-shadow:0 0 0 1px var(--tw-shadow-color,#60a5fa66);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}@media (hover:hover){.dark\:hover\:bg-gray-200\/10:where(.dark,.dark *):hover{background-color:#e5e7eb1a}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-gray-200\/10:where(.dark,.dark *):hover{background-color:color-mix(in oklab, var(--color-gray-200) 10%, transparent)}}}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}
3
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial}}}@layer theme{:root,:host{--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-600:oklch(59.6% .145 163.225);--color-teal-400:oklch(77.7% .152 181.912);--color-teal-500:oklch(70.4% .14 182.503);--color-sky-400:oklch(74.6% .16 232.661);--color-sky-500:oklch(68.5% .169 237.323);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-violet-400:oklch(70.2% .183 293.541);--color-violet-500:oklch(60.6% .25 292.717);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-pink-400:oklch(71.8% .202 349.761);--color-pink-500:oklch(65.6% .241 354.308);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--leading-tight:1.25;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}@layer base;@layer components{@layer components{.aqvs-scroll-pane{display:flex;position:relative}.aqvs-scroll-pane-content{flex:1;height:100%;position:relative;overflow:hidden}.aqvs-tap-scroll-circle{touch-action:none;-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;transition-property:transform;transition-duration:.1s;transition-timing-function:cubic-bezier(0,0,.2,1);display:flex;position:relative}.aqvs-tap-scroll-circle-visual-outer{border-radius:9999px;position:absolute;inset:0}.aqvs-tap-scroll-circle-gradient{background:linear-gradient(to bottom right,#1d4ed899,#60a5fa8c,#bfdbfe66);border-width:1px;border-color:#fff6;border-radius:9999px;position:absolute;inset:0;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.aqvs-tap-scroll-circle-inner{border-radius:9999px;position:absolute;inset:18%}.aqvs-sample-visual-pupil{background-color:#ffffffd9;border-width:1px;border-color:#ffffff80;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-sample-visual-highlight{background-color:#fffc;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-sample-visual-rod{background-color:#ffffff80;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-scrollbar{z-index:50;cursor:default;-webkit-user-select:none;user-select:none;touch-action:none;background-color:#fff;position:relative}.aqvs-scrollbar-horizontal{flex-direction:row;align-items:stretch;display:flex}.aqvs-scrollbar-vertical{flex-direction:column;align-items:stretch;display:flex}.aqvs-scrollbar-tap-circle-wrapper{pointer-events:auto;transition-property:opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1);position:absolute}.aqvs-scrollbar-arrow-button{color:#313131;background-color:#e0e0e0;justify-content:center;align-items:center;font-size:.75rem;line-height:1rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1);display:flex}.aqvs-scrollbar-arrow-button:focus{outline-offset:2px;outline:2px solid #0000}.aqvs-scrollbar-arrow-button:focus-visible{outline-offset:1px;outline:2px solid #60a5fa}.aqvs-scrollbar-arrow-button:disabled{cursor:not-allowed;opacity:.5}.aqvs-scrollbar-arrow-button:enabled:hover{background-color:#d4d4d4}.aqvs-scrollbar-track{background-color:#f5f5f5;flex:1;position:relative}.aqvs-scrollbar-overlay{pointer-events:none;position:absolute;inset:0}.aqvs-scrollbar-thumb-wrapper{touch-action:none;position:absolute}.aqvs-scrollbar-thumb{transform-origin:50%;background-color:#7f7f7f;transition:transform 80ms ease-out;position:absolute}.aqvs-scrollbar-thumb[data-thumb-state=disabled]{transition:none;transform:none}.aqvs-scrollbar-thumb[data-thumb-state=hover]{background-color:#5f5f5f}.aqvs-scrollbar-thumb[data-thumb-state=dragging]{background-color:#4f4f4f;transition:transform 60ms ease-out}.aqvs-scrollbar-thumb-horizontal{inset:1.5px 0}.aqvs-scrollbar-thumb-horizontal[data-thumb-state=hover]{top:-.5px;bottom:-.5px;transform:scaleY(1.06)}.aqvs-scrollbar-thumb-horizontal[data-thumb-state=dragging]{top:-.5px;bottom:-.5px;transform:scaleY(1.12)}.aqvs-scrollbar-thumb-vertical{inset:0 1.5px}.aqvs-scrollbar-thumb-vertical[data-thumb-state=hover]{left:-.5px;right:-.5px;transform:scaleX(1.06)}.aqvs-scrollbar-thumb-vertical[data-thumb-state=dragging]{left:-.5px;right:-.5px;transform:scaleX(1.12)}.aqvs-scroll-to-edge-button{pointer-events:auto;color:#fff;text-transform:uppercase;letter-spacing:.05em;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background-color:#1f2937cc;border-radius:9999px;padding:.25rem 3rem;font-size:10px;font-weight:500;transition-property:transform,background-color;transition-duration:.15s;transform:none;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.aqvs-scroll-to-edge-button:hover{background-color:#374151}.aqvs-scroll-to-edge-button:active{transform:scale(.95)}.aqvs-scroll-to-edge-overlay{pointer-events:none;z-index:10;transition-property:opacity;transition-duration:.5s;position:absolute;inset:0}.aqvs-scroll-to-edge-overlay[data-visible=true]{opacity:1}.aqvs-scroll-to-edge-overlay[data-visible=false]{opacity:0}.aqvs-scroll-to-edge-button-container{justify-content:center;display:flex;position:absolute;left:0;right:0}.aqvs-scroll-to-edge-button-container-top{top:.5rem}.aqvs-scroll-to-edge-button-container-bottom{bottom:.5rem}.aqvs-no-items-container{width:100%;position:absolute;top:0}.aqvs-no-items-text{text-align:center;color:#6b7280}.aqvs-item-container,.aqvs-bottom-inset,.aqvs-items-wrapper{width:100%;position:absolute}}.dt-grid{flex-direction:column;display:flex;position:relative}.dt-grid-body{flex:1;min-height:0;position:relative}.dt-grid-header,.dt-grid-footer,.dt-grid-row,.dt-grid-hscrollbar-row{align-items:stretch;display:flex}.dt-grid-name-cell,.dt-grid-name-header,.dt-grid-name-footer{z-index:1;flex-shrink:0;align-items:center;display:flex;position:relative;overflow:hidden}.dt-grid-numeric-viewport{flex:1;position:relative;overflow:hidden}.dt-grid-numeric-track{transform:translateX(calc(-1 * var(--dt-hscroll,0px)));will-change:transform;display:grid}.dt-grid-cell{white-space:nowrap;text-overflow:ellipsis;align-items:center;padding:0 8px;display:flex;overflow:hidden}.dt-grid-cell--right{text-align:right;justify-content:flex-end}.dt-grid-cell--center{text-align:center;justify-content:center}.dt-grid-name-label{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.dt-grid-scrollbar-spacer{flex-shrink:0}}@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.left-0{left:calc(var(--spacing) * 0)}.z-0{z-index:0}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.ml-1{margin-left:calc(var(--spacing) * 1)}.flex{display:flex}.grid{display:grid}.inline{display:inline}.table{display:table}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-full{height:100%}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-hidden{overflow:hidden}.overflow-y-hidden{overflow-y:hidden}.bg-blue-400\/10{background-color:#54a2ff1a}@supports (color:color-mix(in lab, red, red)){.bg-blue-400\/10{background-color:color-mix(in oklab, var(--color-blue-400) 10%, transparent)}}.bg-blue-400\/20{background-color:#54a2ff33}@supports (color:color-mix(in lab, red, red)){.bg-blue-400\/20{background-color:color-mix(in oklab, var(--color-blue-400) 20%, transparent)}}.px-1{padding-inline:calc(var(--spacing) * 1)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.pr-\[2px\]{padding-right:2px}.pb-\[3px\]{padding-bottom:3px}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-amber-500{color:var(--color-amber-500)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-blue-800{color:var(--color-blue-800)}.text-emerald-600{color:var(--color-emerald-600)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-orange-500{color:var(--color-orange-500)}.text-pink-500{color:var(--color-pink-500)}.text-purple-500{color:var(--color-purple-500)}.text-red-500{color:var(--color-red-500)}.text-sky-500{color:var(--color-sky-500)}.text-teal-500{color:var(--color-teal-500)}.text-violet-500{color:var(--color-violet-500)}.lowercase{text-transform:lowercase}.opacity-70{opacity:.7}.shadow-\[0_0_0_1px_rgba\(59\,130\,246\,0\.3\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#3b82f64d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-300{--tw-duration:.3s;transition-duration:.3s}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.hover\:bg-gray-400\/15:hover{background-color:#99a1af26}@supports (color:color-mix(in lab, red, red)){.hover\:bg-gray-400\/15:hover{background-color:color-mix(in oklab, var(--color-gray-400) 15%, transparent)}}}.dark\:bg-blue-400\/15:where(.dark,.dark *){background-color:#54a2ff26}@supports (color:color-mix(in lab, red, red)){.dark\:bg-blue-400\/15:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-blue-400) 15%, transparent)}}.dark\:bg-blue-400\/25:where(.dark,.dark *){background-color:#54a2ff40}@supports (color:color-mix(in lab, red, red)){.dark\:bg-blue-400\/25:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-blue-400) 25%, transparent)}}.dark\:text-amber-400:where(.dark,.dark *){color:var(--color-amber-400)}.dark\:text-blue-300:where(.dark,.dark *){color:var(--color-blue-300)}.dark\:text-blue-400:where(.dark,.dark *){color:var(--color-blue-400)}.dark\:text-emerald-400:where(.dark,.dark *){color:var(--color-emerald-400)}.dark\:text-gray-200:where(.dark,.dark *){color:var(--color-gray-200)}.dark\:text-gray-300:where(.dark,.dark *){color:var(--color-gray-300)}.dark\:text-gray-400:where(.dark,.dark *){color:var(--color-gray-400)}.dark\:text-orange-400:where(.dark,.dark *){color:var(--color-orange-400)}.dark\:text-pink-400:where(.dark,.dark *){color:var(--color-pink-400)}.dark\:text-purple-400:where(.dark,.dark *){color:var(--color-purple-400)}.dark\:text-red-400:where(.dark,.dark *){color:var(--color-red-400)}.dark\:text-sky-400:where(.dark,.dark *){color:var(--color-sky-400)}.dark\:text-teal-400:where(.dark,.dark *){color:var(--color-teal-400)}.dark\:text-violet-400:where(.dark,.dark *){color:var(--color-violet-400)}.dark\:shadow-\[0_0_0_1px_rgba\(96\,165\,250\,0\.4\)\]:where(.dark,.dark *){--tw-shadow:0 0 0 1px var(--tw-shadow-color,#60a5fa66);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}@media (hover:hover){.dark\:hover\:bg-gray-200\/10:where(.dark,.dark *):hover{background-color:#e5e7eb1a}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-gray-200\/10:where(.dark,.dark *):hover{background-color:color-mix(in oklab, var(--color-gray-200) 10%, transparent)}}}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiquants/directory-tree",
3
- "version": "3.5.0",
3
+ "version": "3.5.1",
4
4
  "description": "High-performance directory tree component for React with virtual scrolling and file selection",
5
5
  "sideEffects": [
6
6
  "**/*.css"
@@ -4,6 +4,7 @@
4
4
 
5
5
  | Version | Date | Author | Reviewer | Approver | Summary of Changes |
6
6
  | :--- | :--- | :--- | :--- | :--- | :--- |
7
+ | 3.5.1 | 2026-08-08 | Claude Opus 5 | | | Hardening of the 3.5.0 `data` API after adversarial review. `null` / `undefined` values now omit the attribute entirely instead of rendering `data-x="undefined"` — the type forbids them, but a dynamic or JS-side value can still produce one, and a consumer testing attribute *presence* would read that as a real state. The key-conversion contract is also corrected: it lowercases and inserts a dash before a capital that follows a lowercase letter or digit, which is **not** identical to the DOM `dataset` reverse mapping (`aBC` becomes `a-bc`, not `a-b-c`) and is **not injective** (`panelCount` and `panel-count` collapse to the same attribute; within one object the later key wins). 3.5.0 documented these as equivalent, which was wrong. Tests added for the nullish case and for grid-mode `data-*` + position output. |
7
8
  | 3.5.0 | 2026-08-08 | Claude Opus 5 | | | Rows now declare their position in the tree: `aria-level` (1-based **logical** depth, so `visual.removeRootIndent` no longer misreports the hierarchy it only shifts visually), `aria-posinset` and `aria-setsize`, taken from the **post-sort** sibling order so the announced position always matches the rendered one. Grid rows gain `aria-posinset` / `aria-setsize` alongside the `aria-level` they already had. New `DirectoryEntry.data` renders extra `data-*` attributes on the row so consumers can expose state as attributes instead of CSS classes (class names are a styling contract and break silently under utility refactors); keys are given without the `data-` prefix and camelCase is converted to kebab-case exactly as the DOM `dataset` API does, since React otherwise drops the attribute with only a warning. The component's own `data-entry-*` attributes cannot be overridden. Also completes the pass-through audit started in 3.4.0: `virtualScroll.testId` and `virtualScroll.contentProps` were accepted by the type but never forwarded, and are now forwarded (they target the scroll pane, a different element from the `role="tree"` container this component owns, so there is no ARIA conflict). |
8
9
  | 3.4.0 | 2026-08-08 | Claude Opus 5 | | | Add the optional top-level `sort` prop (`DirectoryEntryComparator`), applied to every sibling group inside `collectTreeData` immediately before flattening. Only a shallow copy of each sibling array is sorted, so every `DirectoryEntry` object and every `children` array keeps its identity and consumer-side memoization (row memo, reference-preserving decorators, hydration caches) survives a re-sort; the caller's `entries` arrays are never mutated. `isLastChild` and the ancestor chain derive from the loop index, so connector geometry follows the sorted order automatically, in grid mode too. Ordering is deliberately a top-level prop rather than a `visual` member because it changes row semantics rather than presentation. Also fixes a latent defect exposed by any reordering: `virtualScroll.getItemKey` was accepted by the type but never destructured or forwarded, so `VirtualScroll` fell back to index keying and every row whose index-to-entry mapping changed was unmounted and remounted; it is now forwarded, defaulting to `entry.absolutePath`. |
9
10
  | 3.1.0 | 2026-07-31 | Claude Opus 5 | | | Add opt-in `virtualScroll.preserveScrollAnchor`: when the row list mutates (e.g. streaming insertions above the viewport), the first visible row is kept visually stationary via a pre-paint (`useLayoutEffect`) scroll correction. Pure helpers `captureScrollAnchor` / `resolveAnchorScroll` live in `scrollAnchor.ts` (unit-tested). The anchor is captured from the **live pane position** (`getScrollPosition()`, inset-adjusted) rather than the RAF-throttled `onScroll` mirror, so corrections landing mid-scroll do not rubber-band by the notification lag; the handle's clamped return value is adopted, and the component's own `scrollPosition` state is updated **in the same pre-paint flush** so the tree-line canvas / expand glyphs never misalign from the rows. No correction at the top of the list (scroll 0) and pixel-position fallback when the anchored row vanished. Known trade-off: the programmatic correction goes through the ScrollPane handle, which stops an in-progress pointer-drag inertia fling (same as the pre-existing compensation path). Also removed a leftover dead `isEmpty` local. |
@@ -122,7 +123,7 @@ The fundamental data structure for representing a file or directory.
122
123
  | `absolutePath` | `string` | The absolute path of the entry. エントリの絶対パス。 |
123
124
  | `relativePath` | `string` | The path of the entry relative to the root. ルートからの相対パス。 |
124
125
  | `children` | `DirectoryEntry[] \| null` | An array of child entries if it's a directory, otherwise `null`. ディレクトリの場合は子エントリの配列、それ以外の場合は `null`。 |
125
- | `data` | `Record<string, string \| number \| boolean>` | Extra `data-*` attributes rendered on this entry's row. Keys omit the `data-` prefix; camelCase becomes kebab-case as with the DOM `dataset` API (`{ panelCount: 2 }` → `data-panel-count="2"`). Values are stringified. The component's own `data-entry-*` attributes always win. この行へ付与する追加の `data-*` 属性。キーは `data-` を含めず、camelCase は `dataset` と同じ規約で kebab-case になる。自前の `data-entry-*` は上書き不可。 |
126
+ | `data` | `Record<string, string \| number \| boolean>` | Extra `data-*` attributes rendered on this entry's row. Keys omit the `data-` prefix; a dash is inserted before each capital following a lowercase letter or digit and the whole key is lowercased (`{ panelCount: 2 }` → `data-panel-count="2"`). This is **not** the DOM `dataset` reverse mapping (`aBC` → `a-bc`) and is **not injective** (`panelCount` and `panel-count` collide; the later key wins). Values are stringified; `null` / `undefined` omit the attribute. The component's own `data-entry-*` attributes always win. この行へ付与する追加の `data-*` 属性。キーは `data-` を含めず、camelCase は `dataset` と同じ規約で kebab-case になる。自前の `data-entry-*` は上書き不可。 |
126
127
 
127
128
  **Why `data` exists**: it lets a consumer expose row state as an *attribute* rather than as a CSS class, so
128
129
  styling and test locators never depend on class names — those are a styling contract that changes freely under
@@ -252,11 +252,18 @@ export const resolveEntryIcon = (ctx: DirectoryTreeIconRenderContext, overrides?
252
252
 
253
253
  /**
254
254
  * @function toKebabCase
255
- * @description Converts a camelCase key to the kebab-case form HTML `data-*` attributes require.
256
- * camelCase のキーを、HTML の `data-*` 属性が要求する kebab-case へ変換する。
255
+ * @description Lowercases a key and inserts a dash before each capital that follows a lowercase
256
+ * letter or digit, producing the form HTML `data-*` attributes require.
257
+ * キーを小文字化し、小文字または数字に続く大文字の前へダッシュを挿入して、
258
+ * HTML の `data-*` 属性が要求する形へ変換する。
259
+ *
260
+ * @remarks これは DOM の `dataset` 逆変換と**同一ではない**。`dataset` は連続する大文字をそれぞれ
261
+ * 区切るが、ここでは `aBC` は `a-bc` になる。またこの変換は単射ではなく、`panelCount` と
262
+ * `panel-count` は同じ属性名へ落ちる (同一オブジェクト内に両方を書いた場合は後者が勝つ)。
263
+ * 実務上のキーは単語境界が明確なため問題にならないが、契約として明記しておく。
257
264
  *
258
265
  * @param key - 変換前のキー。
259
- * @returns kebab-case のキー。
266
+ * @returns 属性名として使える小文字ダッシュ区切りのキー。
260
267
  */
261
268
  const toKebabCase = (key: string): string => key.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase()
262
269
 
@@ -280,7 +287,9 @@ export const toDataAttributes = (data?: Record<string, string | number | boolean
280
287
  if (!data) {
281
288
  return undefined
282
289
  }
283
- const entries = Object.entries(data)
290
+ // null / undefined は「属性を出さない」意図として扱う。String() に通すと data-x="undefined" という
291
+ // 実在しない状態を DOM へ書き込んでしまい、属性の有無で判定する利用側が誤検知する
292
+ const entries = Object.entries(data).filter(([, value]) => value !== null && value !== undefined)
284
293
  if (entries.length === 0) {
285
294
  return undefined
286
295
  }