UNPKG

kolenkainc-honohub-react

Version:

React admin panel for honohub

28 lines 101 kB
"use strict";var e=require("react/jsx-runtime"),r=require("@heroicons/react/24/outline"),t=require("@tanstack/react-query"),n=require("nuqs/adapters/react-router"),o=require("react-hot-toast"),a=require("react-router-dom"),i=require("react"),l=require("@rafty/ui"),s=require("axios");require("shiki");var c=require("kolenkainc-honohub-shared"),u=require("fuse.js"),f=require("duck-form"),d=require("nuqs"),p=require("zod"),y=require("@rafty/corp"),m=require("dayjs"),h=require("@heroicons/react/24/outline/BoltIcon"),b=require("react-hook-form"),g=require("@duck-form/fields");function v(e){var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}var x=v(r);function j(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function O(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return a}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return j(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return j(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var w=i.createContext(null),S=function(r){var t,n,o,a=(t=O(i.useState({show:!1}),2),n=t[0],o=t[1],{action:{state:n,setState:o}});return e.jsx(w.Provider,{value:a,children:r.children})};var k=function(){var e=i.useContext(w);if(!e)throw new Error("Missing DialogManagerContext.Provider in the tree!");return e};function P(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function N(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return a}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return P(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return P(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var A=i.createContext(null);function E(r){var t,n,o,a=r.children,i=(t=N(l.useBoolean(),2),n=t[0],o=t[1],{isOpen:n,setOpen:o});return e.jsx(A.Provider,{value:i,children:a})}function I(){var e=i.useContext(A);if(!e)throw new Error("Missing DrawerContext.Provider in the tree!");return e}function D(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function C(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return a}}(e,r)||_(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(e){return function(e){if(Array.isArray(e))return D(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,r){if(e){if("string"==typeof e)return D(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?D(e,r):void 0}}function z(e){return"string"==typeof e?e:e.singular}function L(e){return"string"==typeof e?e:e.plural}function M(e){return Object.entries(e).reduce((function(e,r){var t,n,o,a=C(r,2),i=a[0],l=a[1];l&&(Array.isArray(l)?(t=e).push.apply(t,T(l.map((function(e){return"".concat(i,"=").concat(e)})))):"object"==(void 0===l?"undefined":(o=l)&&"undefined"!=typeof Symbol&&o.constructor===Symbol?"symbol":typeof o)?(n=e).push.apply(n,T(Object.entries(l).map((function(e){var r=C(e,2),t=r[0],n=r[1];return"".concat(t,"=").concat(n)})))):e.push("".concat(i,"=").concat(l)));return e}),[]).join("&")}function R(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function F(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}function B(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var H=i.createContext(null),q=function(r){var t=r.children,n=function(e){var r=i.useMemo((function(){return s.create(F(function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){R(e,r,t[r])}))}return e}({},e),{paramsSerializer:M}))}),[e]);return{endpoint:r}}(B(r,["children"]));return e.jsx(H.Provider,{value:n,children:t})};var U,V=function(){var e=i.useContext(H);if(!e)throw new Error("Missing ServerContext.Provider in the tree!");return e};function K(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function G(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return a}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return K(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return K(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}!function(e){e.DARK="dark",e.LIGHT="light",e.SYSTEM="system"}(U||(U={}));var $=i.createContext(null),Q=function(r){var t,n,o,a=r.children,l=(t=G(i.useState(localStorage.theme||"system"),2),n=t[0],o=t[1],i.useEffect((function(){var e=function(e){"dark"===e?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")};if("system"===n){var r=window.matchMedia("(prefers-color-scheme: dark)"),t=r.matches?"dark":"light";e(t);var o=function(r){e(r.matches?"dark":"light")};return r.addEventListener("change",o),function(){return r.removeEventListener("change",o)}}e(n)}),[n]),{theme:n,setTheme:function(e){o(e),localStorage.setItem("theme",e)}});return e.jsx($.Provider,{value:l,children:a})};var Y=function(e){var r,t=new Set,n=function(e,n){var o,a="function"==typeof e?e(r):e;if(!Object.is(a,r)){var i=r;r=(null!=n?n:"object"!=(void 0===a?"undefined":(o=a)&&"undefined"!=typeof Symbol&&o.constructor===Symbol?"symbol":typeof o)||null===a)?a:Object.assign({},r,a),t.forEach((function(e){return e(r,i)}))}},o=function(){return r},a={setState:n,getState:o,getInitialState:function(){return i},subscribe:function(e){return t.add(e),function(){return t.delete(e)}},destroy:function(){console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},i=r=e(n,o,a);return a};function W(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var J,X={exports:{}},Z={},ee={exports:{}},re={};var te,ne,oe,ae={}; /** * @license React * use-sync-external-store-shim.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */function ie(){return te||(te=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=i,r=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function t(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];!function(e,t,n){var o=r.ReactDebugCurrentFrame.getStackAddendum();""!==o&&(t+="%s",n=n.concat([o]));var a=n.map((function(e){return String(e)}));a.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,a)}("error",e,n)}var n="function"==typeof Object.is?Object.is:function(e,r){return e===r&&(0!==e||1/e==1/r)||e!=e&&r!=r},o=e.useState,a=e.useEffect,l=e.useLayoutEffect,s=e.useDebugValue,c=!1,u=!1;function f(e){var r=e.getSnapshot,t=e.value;try{var o=r();return!n(t,o)}catch(e){return!0}}var d=!!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?function(e,r,t){return r()}:function(r,i,d){c||void 0!==e.startTransition&&(c=!0,t("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var p=i();if(!u){var y=i();n(p,y)||(t("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0)}var m=o({inst:{value:p,getSnapshot:i}}),h=m[0].inst,b=m[1];return l((function(){h.value=p,h.getSnapshot=i,f(h)&&b({inst:h})}),[r,p,i]),a((function(){f(h)&&b({inst:h});return r((function(){f(h)&&b({inst:h})}))}),[r]),s(p),p},p=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:d;ae.useSyncExternalStore=p,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),ae}function le(){return ne||(ne=1,"production"===process.env.NODE_ENV?ee.exports=function(){if(J)return re;J=1;var e=i,r="function"==typeof Object.is?Object.is:function(e,r){return e===r&&(0!==e||1/e==1/r)||e!=e&&r!=r},t=e.useState,n=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}var s="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,r){return r()}:function(e,r){var i=r(),s=t({inst:{value:i,getSnapshot:r}}),c=s[0].inst,u=s[1];return o((function(){c.value=i,c.getSnapshot=r,l(c)&&u({inst:c})}),[e,i,r]),n((function(){return l(c)&&u({inst:c}),e((function(){l(c)&&u({inst:c})}))}),[e]),a(i),i};return re.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:s,re}():ee.exports=ie()),ee.exports} /** * @license React * use-sync-external-store-shim/with-selector.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var se,ce={}; /** * @license React * use-sync-external-store-shim/with-selector.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */"production"===process.env.NODE_ENV?X.exports=function(){if(oe)return Z;oe=1;var e=i,r=le(),t="function"==typeof Object.is?Object.is:function(e,r){return e===r&&(0!==e||1/e==1/r)||e!=e&&r!=r},n=r.useSyncExternalStore,o=e.useRef,a=e.useEffect,l=e.useMemo,s=e.useDebugValue;return Z.useSyncExternalStoreWithSelector=function(e,r,i,c,u){var f=o(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=l((function(){function e(e){if(!a){if(a=!0,n=e,e=c(e),void 0!==u&&d.hasValue){var r=d.value;if(u(r,e))return o=r}return o=e}if(r=o,t(n,e))return r;var i=c(e);return void 0!==u&&u(r,i)?r:(n=e,o=i)}var n,o,a=!1,l=void 0===i?null:i;return[function(){return e(r())},null===l?void 0:function(){return e(l())}]}),[r,i,c,u]);var p=n(e,f[0],f[1]);return a((function(){d.hasValue=!0,d.value=p}),[p]),s(p),p},Z}():X.exports=(se||(se=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=i,r=le(),t="function"==typeof Object.is?Object.is:function(e,r){return e===r&&(0!==e||1/e==1/r)||e!=e&&r!=r},n=r.useSyncExternalStore,o=e.useRef,a=e.useEffect,l=e.useMemo,s=e.useDebugValue;ce.useSyncExternalStoreWithSelector=function(e,r,i,c,u){var f,d=o(null);null===d.current?(f={hasValue:!1,value:null},d.current=f):f=d.current;var p=l((function(){var e,n,o=!1,a=function(r){if(!o){o=!0,e=r;var a=c(r);if(void 0!==u&&f.hasValue){var i=f.value;if(u(i,a))return n=i,i}return n=a,a}var l=n;if(t(e,r))return l;var s=c(r);return void 0!==u&&u(l,s)?l:(e=r,n=s,s)},l=void 0===i?null:i;return[function(){return a(r())},null===l?void 0:function(){return a(l())}]}),[r,i,c,u]),y=p[0],m=p[1],h=n(e,y,m);return a((function(){f.hasValue=!0,f.value=h}),[h]),s(h),h},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),ce);var ue=W(X.exports),fe=i.useDebugValue,de=ue.useSyncExternalStoreWithSelector,pe=!1,ye=function(e){return e};function me(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ye,t=arguments.length>2?arguments[2]:void 0;t&&!pe&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),pe=!0);var n=de(e.subscribe,e.getState,e.getServerState||e.getInitialState,r,t);return fe(n),n}var he=function(e){"function"!=typeof e&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");var r="function"==typeof e?function(e){return e?Y(e):Y}(e):e,t=function(e,t){return me(r,e,t)};return Object.assign(t,r),t};function be(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function ge(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ve(e,r){return null!=r&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function xe(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){ge(e,r,t[r])}))}return e}function je(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return a}}(e,r)||we(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Oe(e){return function(e){if(Array.isArray(e))return be(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||we(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function we(e,r){if(e){if("string"==typeof e)return be(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?be(e,r):void 0}}function Se(e,r){var t;try{t=e()}catch(e){return}return{getItem:function(e){var r,n=function(e){return null===e?null:JSON.parse(e,void 0)},o=null!=(r=t.getItem(e))?r:null;return ve(o,Promise)?o.then(n):n(o)},setItem:function(e,r){return t.setItem(e,JSON.stringify(r,void 0))},removeItem:function(e){return t.removeItem(e)}}}var ke,Pe=function(e){return function(r){try{var t=e(r);return ve(t,Promise)?t:{then:function(e){return Pe(e)(t)},catch:function(e){return this}}}catch(e){return{then:function(e){return this},catch:function(r){return Pe(r)(e)}}}}},Ne=function(e,r){return"getStorage"in r||"serialize"in r||"deserialize"in r?(console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),function(e,r){return function(t,n,o){var a,i=xe({getStorage:function(){return localStorage},serialize:JSON.stringify,deserialize:JSON.parse,partialize:function(e){return e},version:0,merge:function(e,r){return xe({},r,e)}},r),l=!1,s=new Set,c=new Set;try{a=i.getStorage()}catch(e){}if(!a)return e((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];console.warn("[zustand persist middleware] Unable to update item '".concat(i.name,"', the given storage is currently unavailable.")),t.apply(void 0,Oe(r))}),n,o);var u=Pe(i.serialize),f=function(){var e,r=i.partialize(xe({},n())),t=u({state:r,version:i.version}).then((function(e){return a.setItem(i.name,e)})).catch((function(r){e=r}));if(e)throw e;return t},d=o.setState;o.setState=function(e,r){d(e,r),f()};var p,y=e((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.apply(void 0,Oe(r)),f()}),n,o),m=function(){var e;if(a){l=!1,s.forEach((function(e){return e(n())}));var r=(null==(e=i.onRehydrateStorage)?void 0:e.call(i,n()))||void 0;return Pe(a.getItem.bind(a))(i.name).then((function(e){if(e)return i.deserialize(e)})).then((function(e){if(e){if("number"!=typeof e.version||e.version===i.version)return e.state;if(i.migrate)return i.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}})).then((function(e){var r;return p=i.merge(e,null!=(r=n())?r:y),t(p,!0),f()})).then((function(){null==r||r(p,void 0),l=!0,c.forEach((function(e){return e(p)}))})).catch((function(e){null==r||r(void 0,e)}))}};return o.persist={setOptions:function(e){i=xe({},i,e),e.getStorage&&(a=e.getStorage())},clearStorage:function(){null==a||a.removeItem(i.name)},getOptions:function(){return i},rehydrate:function(){return m()},hasHydrated:function(){return l},onHydrate:function(e){return s.add(e),function(){s.delete(e)}},onFinishHydration:function(e){return c.add(e),function(){c.delete(e)}}},m(),p||y}}(e,r)):function(e,r){return function(t,n,o){var a=xe({storage:Se((function(){return localStorage})),partialize:function(e){return e},version:0,merge:function(e,r){return xe({},r,e)}},r),i=!1,l=new Set,s=new Set,c=a.storage;if(!c)return e((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];console.warn("[zustand persist middleware] Unable to update item '".concat(a.name,"', the given storage is currently unavailable.")),t.apply(void 0,Oe(r))}),n,o);var u=function(){var e=a.partialize(xe({},n()));return c.setItem(a.name,{state:e,version:a.version})},f=o.setState;o.setState=function(e,r){f(e,r),u()};var d,p=e((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.apply(void 0,Oe(r)),u()}),n,o);o.getInitialState=function(){return p};var y=function(){var e,r;if(c){i=!1,l.forEach((function(e){var r;return e(null!=(r=n())?r:p)}));var o=(null==(r=a.onRehydrateStorage)?void 0:r.call(a,null!=(e=n())?e:p))||void 0;return Pe(c.getItem.bind(c))(a.name).then((function(e){if(e){if("number"!=typeof e.version||e.version===a.version)return[!1,e.state];if(a.migrate)return[!0,a.migrate(e.state,e.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]})).then((function(e){var r,o=je(e,2),i=o[0],l=o[1];if(d=a.merge(l,null!=(r=n())?r:p),t(d,!0),i)return u()})).then((function(){null==o||o(d,void 0),d=n(),i=!0,s.forEach((function(e){return e(d)}))})).catch((function(e){null==o||o(void 0,e)}))}};return o.persist={setOptions:function(e){a=xe({},a,e),e.storage&&(c=e.storage)},clearStorage:function(){null==c||c.removeItem(a.name)},getOptions:function(){return a},rehydrate:function(){return y()},hasHydrated:function(){return i},onHydrate:function(e){return l.add(e),function(){l.delete(e)}},onFinishHydration:function(e){return s.add(e),function(){s.delete(e)}}},a.skipHydration||y(),d||p}}(e,r)};!function(e){e.NODEJS="js",e.PYTHON="py",e.CURL="bash"}(ke||(ke={}));var Ae=function(){return(e?he(e):he)(Ne((function(e){return{isShrink:!1,lang:"js",setLang:function(r){return e({lang:r})},setShrink:function(r){return e((function(e){return{isShrink:void 0!==r?r:!e.isShrink}}))}}}),{name:"preferences",storage:Se((function(){return sessionStorage}))}));var e},Ee=i.createContext(null);function Ie(r){var t=r.children,n=i.useRef(Ae()).current;return e.jsxs(Ee.Provider,{value:n,children:[e.jsx(De,{}),t]})}function De(){var r,t=Ce((function(e){return{setShrink:e.setShrink}})).setShrink,n=null!==(r=l.useBreakpointValue({sm:!1,md:!0,lg:!0,xl:!1}))&&void 0!==r&&r;return i.useEffect((function(){t(n)}),[n]),e.jsx(e.Fragment,{})}function Ce(e){var r=i.useContext(Ee);if(!r)throw new Error("Missing PreferencesContext.Provider in the tree!");return me(r,e)}function Te(r){return e.jsx("div",{className:"flex w-full h-screen text-black dark:text-white dark:bg-secondary-950 selection:text-secondary-700 bg-white selection:bg-[#79ffe1] dark:selection:bg-[#f81ce5] dark:selection:text-white",children:r.children})}function _e(){var r=k().action,t=r.state,n=r.setState,o=t.show?l.eventHandler((function(){t.action(),n({show:!1})})):void 0;return e.jsxs(l.AlertDialog,{size:"sm",open:t.show,onOpenChange:function(){return n({show:!1})},children:[e.jsx(l.AlertDialogOverlay,{}),e.jsx(l.AlertDialogContent,{className:"gap-1 rounded-lg",children:t.show&&e.jsxs(e.Fragment,{children:[e.jsx(l.AlertDialogTitle,{children:t.title}),e.jsx(l.AlertDialogDescription,{children:t.message}),e.jsxs("div",{className:"flex justify-between mt-4",children:[e.jsx(l.AlertDialogCancel,{asChild:!0,children:e.jsx(l.Button,{children:"Cancel"})}),e.jsx(l.Button,{colorScheme:"error",onClick:o,onKeyDown:o,children:"Confirm"})]})]})})]})}function ze(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Le(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}function Me(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function Re(r){var t=r.className,n=Me(r,["className"]);return e.jsx("img",Le(function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){ze(e,r,t[r])}))}return e}({},n),{src:"https://honohub.dev/images/logo-small.png",alt:"honohub logo",className:l.classNames("size-7",t)}))}function Fe(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Be(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function He(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){Be(e,r,t[r])}))}return e}function qe(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}function Ue(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function Ve(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return a}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return Fe(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Fe(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ke,Ge=i.forwardRef((function(r,t){var n=r.className,o=r.options,s=Ue(r,["className","options"]),c=Ce((function(e){return e.isShrink}));return e.jsxs("div",qe(He({},s),{className:l.classNames("flex h-full relative flex-col flex-shrink-0 flex-grow-0",c?"w-16":"w-[250px] min-w-[250px] max-w-[250px]",n),ref:t,children:[e.jsx("header",{className:"px-3 my-[7.5px]",children:e.jsx("div",{className:"w-max",children:e.jsx(a.Link,{to:"/",children:c?e.jsx(Re,{className:"h-[39px] w-max"}):e.jsxs("div",{className:"flex items-center ml-1 w-max",children:[e.jsx(Re,{className:"h-8 w-max"}),e.jsxs("p",{className:"text-[26px] font-bold tracking-tight",children:["Hono",e.jsx("span",{className:"text-primary-500 dark:text-primary-300",children:"Hub"})]})]})})})}),e.jsx("hr",{className:c?"border-transparent":"border-secondary-200 dark:border-secondary-800"}),e.jsx("div",{className:"mt-[15px] px-3 overflow-x-hidden overflow-y-auto h-full",children:Object.entries(o).map((function(r,t){var n=Ve(r,2),o=n[0],a=n[1];return e.jsxs(i.Fragment,{children:[0!==t&&(c?e.jsx("div",{className:"h-[33px] flex items-center",children:e.jsx("hr",{className:"border-secondary-200 dark:border-secondary-800 w-full"})}):e.jsx($e,{children:o})),a.map((function(r){return e.jsx(Qe,He({},r),r.label)}))]},o)}))}),e.jsx(Ye,{})]}))}));function $e(r){return e.jsx("div",{className:"w-full mx-[5px] first:mt-0 mt-5 mb-1.5 font-semibold text-[10px] text-secondary-500 dark:text-secondary-400 uppercase select-none",children:r.children})}function Qe(t){var n=t.label,o=t.icon,i=t.path,s=Ce((function(e){return e.isShrink})),c=null!=o?o:r.PuzzlePieceIcon;return e.jsxs(a.NavLink,{title:n,to:i,className:function(e){var r=e.isActive;return l.classNames("cursor-pointer outline-none no-underline flex w-full items-center gap-2 mb-2 px-3 py-1 min-h-10 rounded-md min-w-0 select-none transition-all ease-in-out",r?"bg-primary-100 text-primary-600 dark:bg-secondary-700/80 dark:text-white":"text-secondary-600 dark:text-secondary-400 hover:text-black dark:hover:text-white hover:bg-secondary-100 dark:hover:bg-secondary-800/80",s&&"w-max")},children:[e.jsx(c,{className:"size-4 stroke-2"}),!s&&e.jsx(l.Text,{className:"font-semibold text-sm leading-none",children:n})]})}function Ye(){var t=Ce((function(e){return{isShrink:e.isShrink,setShrink:e.setShrink}})),n=t.isShrink,o=t.setShrink,a=n?r.ChevronRightIcon:r.ChevronLeftIcon,i=l.eventHandler((function(){return o()}));return e.jsx(l.Button,{className:"hidden lg:block absolute bottom-6 hover:dark:bg-secondary-950 hover:bg-white -right-4 border border-secondary-300 dark:border-secondary-700 bg-white dark:bg-secondary-950",size:"fab",onClick:i,onKeyDown:i,children:e.jsx(a,{className:"size-4 stroke-2 stroke-secondary-500 dark:stroke-secondary-400"})})}function We(r){var t=r.options,n=I(),o=n.isOpen,s=n.setOpen,c=a.useLocation().pathname;return i.useEffect((function(){s(!1)}),[c]),e.jsxs(l.Drawer,{side:"left",open:o,onOpenChange:s,children:[e.jsx(l.DrawerOverlay,{className:"z-[100]",children:e.jsx(l.DrawerClose,{className:"top-2 right-2"})}),e.jsx(l.DrawerContent,{className:"w-max p-0 z-[100] dark:bg-secondary-900",children:e.jsx(Ge,{options:t})})]})}function Je(r){var t=r.options;return e.jsx(S,{children:e.jsx(E,{children:e.jsxs(Te,{children:[e.jsx(Ge,{options:t,className:"hidden md:flex border-r border-secondary-200 dark:border-secondary-800"}),e.jsx(a.Outlet,{}),e.jsx(_e,{}),e.jsx(We,{options:t})]})})})}function Xe(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Ze(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}function er(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function rr(r){var t=r.children,n=r.className,o=er(r,["children","className"]);return e.jsx("div",Ze(function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){Xe(e,r,t[r])}))}return e}({},o),{className:l.classNames("flex-1 px-3 py-2 md:px-[18px] md:py-3 lg:px-6 lg:py-4 overflow-x-hidden overflow-y-auto scroll-smooth",n),children:e.jsx("div",{className:"flex flex-col min-h-0 w-full flex-grow gap-3 md:gap-4 lg:gap-5",children:t})}))}function tr(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function nr(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function or(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}function ar(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return a}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return tr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return tr(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ir(t){var n=t.options,o=l.useBreakpointValue({sm:"drawer",md:"static",lg:"static",xl:"static"}),s=ar(l.useBoolean(),2),c=s[0],u=s[1],f=a.useLocation().pathname;i.useEffect((function(){u(!1)}),[f]);var d=l.eventHandler((function(){return u()})),p=c?r.XMarkIcon:r.Bars3Icon,y=function(t){var n=t.className;return e.jsxs("div",{className:l.classNames("flex items-center w-full bg-secondary-100 dark:bg-secondary-900 p-3 md:p-4 lg:p-5 gap-2 md:gap-3 lg:gap-4 text-secondary-700 dark:text-secondary-300",n),children:[e.jsx(r.ArchiveBoxIcon,{className:"size-[18px] stroke-3"}),e.jsx("p",{className:"font-medium",children:"Collections"}),e.jsx("div",{className:"flex-1"}),e.jsx(l.Button,{size:"icon",variant:"ghost",onClick:d,onKeyDown:d,children:e.jsx(p,{className:"size-[18px] stroke-[3]"})})]})};return"drawer"===o?e.jsxs(e.Fragment,{children:[e.jsx(y,{className:"fixed z-30 bottom-0"}),e.jsxs(l.Drawer,{open:c,onOpenChange:u,children:[e.jsx(l.DrawerOverlay,{className:"z-40 bg-black/5"}),e.jsxs(l.DrawerContent,{className:"h-max z-40 max-h-[60%] flex flex-col bottom-0 top-auto !animate-none dark:bg-secondary-900 p-0 shadow-[0_-8px_10px_-5px_rgb(0,0,0,0.1)] dark:shadow-none",children:[e.jsx(lr,{options:n}),e.jsx(y,{})]})]})]}):e.jsx("div",{className:"flex h-full w-[250px] min-w-[250px] max-w-[250px] border-r flex-col flex-shrink-0 flex-grow-0 dark:border-secondary-800",children:e.jsx(lr,{options:n})})}function lr(r){var t=r.options,n=ar(i.useState(),2),o=n[0],a=n[1],s=ar(i.useMemo((function(){var e=t.map((function(e){var r=e.label,t=e.slug;return{label:L(r),slug:t}}));return[e,new u(e,{keys:["label"],includeMatches:!0})]}),[t]),2),c=s[0],f=s[1],d=c,p=!1;if(o){var y=f.search(o);0===y.length&&(p=!0),d=y.reduce((function(e,r){var t=r.item,n=r.matches;return e.push(or(function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){nr(e,r,t[r])}))}return e}({},t),{matches:null==n?void 0:n.flatMap((function(e){return e.indices}))})),e}),[])}return e.jsxs(e.Fragment,{children:[e.jsx("header",{className:"px-4 my-[15px]",children:e.jsx(l.InputField,{size:"sm",type:"search",value:o,onChange:function(e){return a(e.target.value)},placeholder:"Search...",variant:"ghost",className:"px-0 py-0 focus:border-transparent focus:ring-transparent dark:focus:border-transparent dark:focus:ring-transparent dark:ring-offset-transparent ring-offset-transparent"})}),e.jsx("hr",{className:"dark:border-secondary-800"}),e.jsx("div",{className:"mt-[15px] px-3 overflow-x-hidden overflow-y-auto h-full",children:p?e.jsx("p",{className:"font-medium text-sm text-center select-none text-secondary-400 dark:text-secondary-600",children:"Not found"}):d.map((function(r){var t=r.slug,n=r.label,o=r.matches;return e.jsx(sr,{link:t,label:n,matches:o},t)}))})]})}function sr(r){var t=r.link,n=r.label,o=r.matches,i=L(n);return e.jsx(a.NavLink,{title:i,to:t,className:function(e){var r=e.isActive;return l.classNames("cursor-pointer outline-none no-underline flex w-full items-center gap-2 mb-2 px-3 py-1 min-h-10 rounded-md min-w-0 select-none transition-all ease-in-out",r?"bg-primary-100 text-primary-600 dark:bg-secondary-700/80 dark:text-white":"text-secondary-600 dark:text-secondary-400 hover:text-black dark:hover:text-white hover:bg-secondary-100 dark:hover:bg-secondary-800/80")},children:e.jsx(l.Text,{className:"font-semibold text-sm leading-none capitalize",children:c.highlightMatches(i,o)})})}function cr(r){var t=r.options,n=a.useNavigate(),o=a.useLocation().pathname;return i.useEffect((function(){"/collections"===o&&n("/collections/".concat(t[0].slug))}),[t,o]),e.jsxs(e.Fragment,{children:[e.jsx(ir,{options:t}),e.jsx(rr,{className:"[&>div]:h-full",children:e.jsx(a.Outlet,{})})]})}function ur(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function fr(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){ur(e,r,t[r])}))}return e}function dr(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}function pr(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}!function(e){e.DRAWER="drawer",e.STATIC="static"}(Ke||(Ke={}));var yr=i.forwardRef((function(t,n){var o=t.className,a=t.children,i=pr(t,["className","children"]),s=I().setOpen,c=l.eventHandler((function(){return s(!0)}));return e.jsxs("header",dr(fr({},i),{className:l.classNames("flex items-center gap-2",o),ref:n,children:[e.jsx(l.Button,{variant:"ghost",size:"icon",className:"md:hidden",onClick:c,onKeyDown:c,children:e.jsx(r.Bars3Icon,{className:"size-[18px] stroke-[3]"})}),a]}))})),mr=i.forwardRef((function(r,t){var n=r.as,o=void 0===n?"h2":n,a=r.className,i=pr(r,["as","className"]),s=o;return e.jsx(s,dr(fr({},i),{className:l.classNames("text-2xl md:text-3xl font-bold dark:text-secondary-100 leading-tight",a),ref:t}))}));function hr(r){return e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsx(yr,{className:"md:hidden px-2 py-1 md:px-2.5 md:1.5 lg:px-3 lg:py-2 border-b border-secondary-200 dark:border-secondary-800",children:e.jsx(mr,{children:r.name})}),e.jsx("div",{className:"flex-1 overflow-x-hidden overflow-y-auto scroll-smooth",children:r.children})]})}function br(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function gr(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return a}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return br(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return br(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vr(e,r,t,n,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void t(e)}l.done?r(s):Promise.resolve(s).then(n,o)}function xr(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function jr(e,r){var t,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;i;)try{if(t=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=r.call(e,i)}catch(e){a=[6,e],n=0}finally{t=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function Or(e){var r,n,o=V().endpoint,a=function(e){return["collections",e.slug,"reference",e.search].filter((function(e){return null!=e}))}(function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){xr(e,r,t[r])}))}return e}({},e));return t.useInfiniteQuery({queryKey:a,queryFn:(r=function(r){var t,n,a;return jr(this,(function(i){return t=r.pageParam,n=void 0===t?0:t,a=r.signal,[2,o.get("/collections/".concat(e.slug,"/reference"),{signal:a,params:{search:e.search,offset:10*n}}).then((function(e){return e.data}))]}))},n=function(){var e=this,t=arguments;return new Promise((function(n,o){var a=r.apply(e,t);function i(e){vr(a,n,o,i,l,"next",e)}function l(e){vr(a,n,o,i,l,"throw",e)}i(void 0)}))},function(e){return n.apply(this,arguments)}),getNextPageParam:function(e,r){var t=r.flatMap((function(e){return e.results})).length;if(!(e.count<=t))return r.length},initialPageParam:0})}function wr(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Sr(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return a}}(e,r)||Pr(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kr(e){return function(e){if(Array.isArray(e))return wr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Pr(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pr(e,r){if(e){if("string"==typeof e)return wr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?wr(e,r):void 0}}function Nr(e){var r=Sr(d.useQueryState(e,d.parseAsArrayOf(d.parseAsString)),2),t=r[0],n=r[1];return{query:t,clear:l.eventHandler((function(){return n(null)})),setQuery:function(e){return l.eventHandler((function(){return n((function(r){var t=r?kr(r):[],n=t.findIndex((function(r){return r===e}));return n>-1?t.splice(n,1):t.push(e),0===t.length?null:t}))}))}}}function Ar(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Er(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}function Ir(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function Dr(t){var n=t.label,o=t.name,a=t.children,i=Nr(o),s=i.query,c=i.clear;return e.jsxs(l.AccordionItem,{value:o,className:"flex flex-col",children:[e.jsxs(l.AccordionTrigger,{className:"bg-transparent dark:bg-transparent hover:bg-secondary-100 dark:hover:bg-secondary-900 data-[state=open]:bg-secondary-100 dark:data-[state=open]:bg-secondary-900 py-2 flex-none data-[state=open]:text-black dark:data-[state=open]:text-white justify-start gap-2 capitalize",showIcon:!1,children:[e.jsx(r.ChevronDownIcon,{className:"stroke-secondary-600 group-data-[state=open]:stroke-black dark:stroke-secondary-400 dark:group-data-[state=open]:stroke-white shrink-0 -rotate-90 stroke-[2.5] transition-transform duration-200 group-data-[state=open]:rotate-0 size-3.5"}),n,s&&s.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-1"}),e.jsx("div",{className:"p-0.5 rounded text-red-500 dark:text-red-300 hover:bg-red-200/40 dark:hover:bg-red-300/10 transition-all outline-none focus-visible:ring-2 ring-red-300 dark:ring-red-100 ring-offset-2 ring-offset-white dark:ring-offset-secondary-950",onClick:c,onKeyDown:c,children:e.jsx(r.XMarkIcon,{className:"size-3.5 stroke-2"})})]})]}),e.jsx(l.AccordionContent,{className:"h-full px-0",children:a})]})}var Cr=i.forwardRef((function(t,n){var o=t.items,a=t.className,i=Ir(t,["items","className"]),s=Nr(i.name),c=s.query,u=s.setQuery;return e.jsx("div",Er(function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){Ar(e,r,t[r])}))}return e}({},i),{className:l.classNames("w-full max-h-[250px] overflow-y-auto",a),children:o.map((function(t){return e.jsxs("div",{className:"px-2.5 py-1.5 hover:dark:bg-secondary-800 rounded-sm cursor-pointer transition-all hover:bg-secondary-100 flex justify-between items-center",onClick:u(t.value),onKeyDown:u(t.value),ref:n,children:[e.jsx("p",{className:"text-xs",children:t.label}),(null==c?void 0:c.includes(t.value))&&e.jsx(r.CheckIcon,{className:"size-3.5 stroke-2 stroke-primary-500 dark:stroke-primary-300"})]},t.value)}))}))}));function Tr(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function _r(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return a}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return Tr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Tr(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zr(r){return e.jsxs("div",{className:"border border-secondary-300 dark:border-secondary-700 rounded-md max-h-full h-max flex flex-col min-w-72 overflow-hidd